diff options
Diffstat (limited to 'include')
516 files changed, 13607 insertions, 3384 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index d98c67001840..3ea214cff349 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
| @@ -83,7 +83,9 @@ | |||
| 83 | * Should the subsystem abort the loading of an ACPI table if the | 83 | * Should the subsystem abort the loading of an ACPI table if the |
| 84 | * table checksum is incorrect? | 84 | * table checksum is incorrect? |
| 85 | */ | 85 | */ |
| 86 | #ifndef ACPI_CHECKSUM_ABORT | ||
| 86 | #define ACPI_CHECKSUM_ABORT FALSE | 87 | #define ACPI_CHECKSUM_ABORT FALSE |
| 88 | #endif | ||
| 87 | 89 | ||
| 88 | /* | 90 | /* |
| 89 | * Generate a version of ACPICA that only supports "reduced hardware" | 91 | * Generate a version of ACPICA that only supports "reduced hardware" |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 7b2de026a4f3..8256eb4ad057 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
| @@ -28,8 +28,6 @@ | |||
| 28 | 28 | ||
| 29 | #include <linux/device.h> | 29 | #include <linux/device.h> |
| 30 | 30 | ||
| 31 | #include <acpi/acpi.h> | ||
| 32 | |||
| 33 | /* TBD: Make dynamic */ | 31 | /* TBD: Make dynamic */ |
| 34 | #define ACPI_MAX_HANDLES 10 | 32 | #define ACPI_MAX_HANDLES 10 |
| 35 | struct acpi_handle_list { | 33 | struct acpi_handle_list { |
| @@ -66,6 +64,32 @@ bool acpi_ata_match(acpi_handle handle); | |||
| 66 | bool acpi_bay_match(acpi_handle handle); | 64 | bool acpi_bay_match(acpi_handle handle); |
| 67 | bool acpi_dock_match(acpi_handle handle); | 65 | bool acpi_dock_match(acpi_handle handle); |
| 68 | 66 | ||
| 67 | bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, int rev, u64 funcs); | ||
| 68 | union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid, | ||
| 69 | int rev, int func, union acpi_object *argv4); | ||
| 70 | |||
| 71 | static inline union acpi_object * | ||
| 72 | acpi_evaluate_dsm_typed(acpi_handle handle, const u8 *uuid, int rev, int func, | ||
| 73 | union acpi_object *argv4, acpi_object_type type) | ||
| 74 | { | ||
| 75 | union acpi_object *obj; | ||
| 76 | |||
| 77 | obj = acpi_evaluate_dsm(handle, uuid, rev, func, argv4); | ||
| 78 | if (obj && obj->type != type) { | ||
| 79 | ACPI_FREE(obj); | ||
| 80 | obj = NULL; | ||
| 81 | } | ||
| 82 | |||
| 83 | return obj; | ||
| 84 | } | ||
| 85 | |||
| 86 | #define ACPI_INIT_DSM_ARGV4(cnt, eles) \ | ||
| 87 | { \ | ||
| 88 | .package.type = ACPI_TYPE_PACKAGE, \ | ||
| 89 | .package.count = (cnt), \ | ||
| 90 | .package.elements = (eles) \ | ||
| 91 | } | ||
| 92 | |||
| 69 | #ifdef CONFIG_ACPI | 93 | #ifdef CONFIG_ACPI |
| 70 | 94 | ||
| 71 | #include <linux/proc_fs.h> | 95 | #include <linux/proc_fs.h> |
| @@ -91,16 +115,11 @@ struct acpi_device; | |||
| 91 | * ----------------- | 115 | * ----------------- |
| 92 | */ | 116 | */ |
| 93 | 117 | ||
| 94 | enum acpi_hotplug_mode { | ||
| 95 | AHM_GENERIC = 0, | ||
| 96 | AHM_CONTAINER, | ||
| 97 | AHM_COUNT | ||
| 98 | }; | ||
| 99 | |||
| 100 | struct acpi_hotplug_profile { | 118 | struct acpi_hotplug_profile { |
| 101 | struct kobject kobj; | 119 | struct kobject kobj; |
| 120 | int (*scan_dependent)(struct acpi_device *adev); | ||
| 102 | bool enabled:1; | 121 | bool enabled:1; |
| 103 | enum acpi_hotplug_mode mode; | 122 | bool demand_offline:1; |
| 104 | }; | 123 | }; |
| 105 | 124 | ||
| 106 | static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile( | 125 | static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile( |
| @@ -168,7 +187,10 @@ struct acpi_device_flags { | |||
| 168 | u32 ejectable:1; | 187 | u32 ejectable:1; |
| 169 | u32 power_manageable:1; | 188 | u32 power_manageable:1; |
| 170 | u32 match_driver:1; | 189 | u32 match_driver:1; |
| 171 | u32 reserved:27; | 190 | u32 initialized:1; |
| 191 | u32 visited:1; | ||
| 192 | u32 no_hotplug:1; | ||
| 193 | u32 reserved:24; | ||
| 172 | }; | 194 | }; |
| 173 | 195 | ||
| 174 | /* File System */ | 196 | /* File System */ |
| @@ -298,6 +320,7 @@ struct acpi_device { | |||
| 298 | struct list_head children; | 320 | struct list_head children; |
| 299 | struct list_head node; | 321 | struct list_head node; |
| 300 | struct list_head wakeup_list; | 322 | struct list_head wakeup_list; |
| 323 | struct list_head del_list; | ||
| 301 | struct acpi_device_status status; | 324 | struct acpi_device_status status; |
| 302 | struct acpi_device_flags flags; | 325 | struct acpi_device_flags flags; |
| 303 | struct acpi_device_pnp pnp; | 326 | struct acpi_device_pnp pnp; |
| @@ -323,6 +346,11 @@ static inline void *acpi_driver_data(struct acpi_device *d) | |||
| 323 | #define to_acpi_device(d) container_of(d, struct acpi_device, dev) | 346 | #define to_acpi_device(d) container_of(d, struct acpi_device, dev) |
| 324 | #define to_acpi_driver(d) container_of(d, struct acpi_driver, drv) | 347 | #define to_acpi_driver(d) container_of(d, struct acpi_driver, drv) |
| 325 | 348 | ||
| 349 | static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta) | ||
| 350 | { | ||
| 351 | *((u32 *)&adev->status) = sta; | ||
| 352 | } | ||
| 353 | |||
| 326 | /* acpi_device.dev.bus == &acpi_bus_type */ | 354 | /* acpi_device.dev.bus == &acpi_bus_type */ |
| 327 | extern struct bus_type acpi_bus_type; | 355 | extern struct bus_type acpi_bus_type; |
| 328 | 356 | ||
| @@ -343,6 +371,7 @@ extern struct kobject *acpi_kobj; | |||
| 343 | extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); | 371 | extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); |
| 344 | void acpi_bus_private_data_handler(acpi_handle, void *); | 372 | void acpi_bus_private_data_handler(acpi_handle, void *); |
| 345 | int acpi_bus_get_private_data(acpi_handle, void **); | 373 | int acpi_bus_get_private_data(acpi_handle, void **); |
| 374 | void acpi_bus_no_hotplug(acpi_handle handle); | ||
| 346 | extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); | 375 | extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); |
| 347 | extern int register_acpi_notifier(struct notifier_block *); | 376 | extern int register_acpi_notifier(struct notifier_block *); |
| 348 | extern int unregister_acpi_notifier(struct notifier_block *); | 377 | extern int unregister_acpi_notifier(struct notifier_block *); |
| @@ -384,6 +413,11 @@ int acpi_match_device_ids(struct acpi_device *device, | |||
| 384 | int acpi_create_dir(struct acpi_device *); | 413 | int acpi_create_dir(struct acpi_device *); |
| 385 | void acpi_remove_dir(struct acpi_device *); | 414 | void acpi_remove_dir(struct acpi_device *); |
| 386 | 415 | ||
| 416 | static inline bool acpi_device_enumerated(struct acpi_device *adev) | ||
| 417 | { | ||
| 418 | return adev && adev->flags.initialized && adev->flags.visited; | ||
| 419 | } | ||
| 420 | |||
| 387 | typedef void (*acpi_hp_callback)(void *data, u32 src); | 421 | typedef void (*acpi_hp_callback)(void *data, u32 src); |
| 388 | 422 | ||
| 389 | acpi_status acpi_hotplug_execute(acpi_hp_callback func, void *data, u32 src); | 423 | acpi_status acpi_hotplug_execute(acpi_hp_callback func, void *data, u32 src); |
| @@ -407,7 +441,7 @@ struct acpi_bus_type { | |||
| 407 | struct list_head list; | 441 | struct list_head list; |
| 408 | const char *name; | 442 | const char *name; |
| 409 | bool (*match)(struct device *dev); | 443 | bool (*match)(struct device *dev); |
| 410 | int (*find_device) (struct device *, acpi_handle *); | 444 | struct acpi_device * (*find_companion)(struct device *); |
| 411 | void (*setup)(struct device *); | 445 | void (*setup)(struct device *); |
| 412 | void (*cleanup)(struct device *); | 446 | void (*cleanup)(struct device *); |
| 413 | }; | 447 | }; |
| @@ -426,12 +460,9 @@ struct acpi_pci_root { | |||
| 426 | }; | 460 | }; |
| 427 | 461 | ||
| 428 | /* helper */ | 462 | /* helper */ |
| 429 | acpi_handle acpi_find_child(acpi_handle, u64, bool); | 463 | |
| 430 | static inline acpi_handle acpi_get_child(acpi_handle handle, u64 addr) | 464 | struct acpi_device *acpi_find_child_device(struct acpi_device *parent, |
| 431 | { | 465 | u64 address, bool check_children); |
| 432 | return acpi_find_child(handle, addr, false); | ||
| 433 | } | ||
| 434 | void acpi_preset_companion(struct device *dev, acpi_handle parent, u64 addr); | ||
| 435 | int acpi_is_root_bridge(acpi_handle); | 466 | int acpi_is_root_bridge(acpi_handle); |
| 436 | struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); | 467 | struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); |
| 437 | 468 | ||
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 1cedfcb1bd88..b124fdb26046 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
| @@ -26,9 +26,6 @@ | |||
| 26 | #ifndef __ACPI_DRIVERS_H__ | 26 | #ifndef __ACPI_DRIVERS_H__ |
| 27 | #define __ACPI_DRIVERS_H__ | 27 | #define __ACPI_DRIVERS_H__ |
| 28 | 28 | ||
| 29 | #include <linux/acpi.h> | ||
| 30 | #include <acpi/acpi_bus.h> | ||
| 31 | |||
| 32 | #define ACPI_MAX_STRING 80 | 29 | #define ACPI_MAX_STRING 80 |
| 33 | 30 | ||
| 34 | /* | 31 | /* |
diff --git a/include/linux/acpi_io.h b/include/acpi/acpi_io.h index b0ffa219993e..2be858018c7f 100644 --- a/include/linux/acpi_io.h +++ b/include/acpi/acpi_io.h | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | #define _ACPI_IO_H_ | 2 | #define _ACPI_IO_H_ |
| 3 | 3 | ||
| 4 | #include <linux/io.h> | 4 | #include <linux/io.h> |
| 5 | #include <acpi/acpi.h> | ||
| 6 | 5 | ||
| 7 | static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, | 6 | static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, |
| 8 | acpi_size size) | 7 | acpi_size size) |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index d8f9457755b4..d2f16f14b419 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
| @@ -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 0x20130927 | 49 | #define ACPI_CA_VERSION 0x20131218 |
| 50 | 50 | ||
| 51 | #include <acpi/acconfig.h> | 51 | #include <acpi/acconfig.h> |
| 52 | #include <acpi/actypes.h> | 52 | #include <acpi/actypes.h> |
| @@ -54,7 +54,6 @@ | |||
| 54 | #include <acpi/acbuffer.h> | 54 | #include <acpi/acbuffer.h> |
| 55 | 55 | ||
| 56 | extern u8 acpi_gbl_permanent_mmap; | 56 | extern u8 acpi_gbl_permanent_mmap; |
| 57 | extern u32 acpi_rsdt_forced; | ||
| 58 | 57 | ||
| 59 | /* | 58 | /* |
| 60 | * Globals that are publically available | 59 | * Globals that are publically available |
| @@ -72,17 +71,19 @@ extern u32 acpi_dbg_layer; | |||
| 72 | 71 | ||
| 73 | /* ACPICA runtime options */ | 72 | /* ACPICA runtime options */ |
| 74 | 73 | ||
| 75 | extern u8 acpi_gbl_enable_interpreter_slack; | ||
| 76 | extern u8 acpi_gbl_all_methods_serialized; | 74 | extern u8 acpi_gbl_all_methods_serialized; |
| 77 | extern u8 acpi_gbl_create_osi_method; | ||
| 78 | extern u8 acpi_gbl_use_default_register_widths; | ||
| 79 | extern acpi_name acpi_gbl_trace_method_name; | ||
| 80 | extern u32 acpi_gbl_trace_flags; | ||
| 81 | extern bool acpi_gbl_enable_aml_debug_object; | ||
| 82 | extern u8 acpi_gbl_copy_dsdt_locally; | 75 | extern u8 acpi_gbl_copy_dsdt_locally; |
| 83 | extern u8 acpi_gbl_truncate_io_addresses; | 76 | extern u8 acpi_gbl_create_osi_method; |
| 84 | extern u8 acpi_gbl_disable_auto_repair; | 77 | extern u8 acpi_gbl_disable_auto_repair; |
| 85 | extern u8 acpi_gbl_disable_ssdt_table_load; | 78 | extern u8 acpi_gbl_disable_ssdt_table_load; |
| 79 | extern u8 acpi_gbl_do_not_use_xsdt; | ||
| 80 | extern bool acpi_gbl_enable_aml_debug_object; | ||
| 81 | extern u8 acpi_gbl_enable_interpreter_slack; | ||
| 82 | extern u32 acpi_gbl_trace_flags; | ||
| 83 | extern acpi_name acpi_gbl_trace_method_name; | ||
| 84 | extern u8 acpi_gbl_truncate_io_addresses; | ||
| 85 | extern u8 acpi_gbl_use32_bit_fadt_addresses; | ||
| 86 | extern u8 acpi_gbl_use_default_register_widths; | ||
| 86 | 87 | ||
| 87 | /* | 88 | /* |
| 88 | * Hardware-reduced prototypes. All interfaces that use these macros will | 89 | * Hardware-reduced prototypes. All interfaces that use these macros will |
| @@ -130,10 +131,9 @@ acpi_status __init acpi_terminate(void); | |||
| 130 | * Miscellaneous global interfaces | 131 | * Miscellaneous global interfaces |
| 131 | */ | 132 | */ |
| 132 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) | 133 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) |
| 133 | |||
| 134 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) | 134 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) |
| 135 | #ifdef ACPI_FUTURE_USAGE | 135 | #ifdef ACPI_FUTURE_USAGE |
| 136 | acpi_status acpi_subsystem_status(void); | 136 | acpi_status acpi_subsystem_status(void); |
| 137 | #endif | 137 | #endif |
| 138 | 138 | ||
| 139 | #ifdef ACPI_FUTURE_USAGE | 139 | #ifdef ACPI_FUTURE_USAGE |
| @@ -278,16 +278,13 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
| 278 | acpi_install_sci_handler(acpi_sci_handler | 278 | acpi_install_sci_handler(acpi_sci_handler |
| 279 | address, | 279 | address, |
| 280 | void *context)) | 280 | void *context)) |
| 281 | |||
| 282 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 281 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 283 | acpi_remove_sci_handler(acpi_sci_handler | 282 | acpi_remove_sci_handler(acpi_sci_handler |
| 284 | address)) | 283 | address)) |
| 285 | |||
| 286 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 284 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 287 | acpi_install_global_event_handler | 285 | acpi_install_global_event_handler |
| 288 | (acpi_gbl_event_handler handler, | 286 | (acpi_gbl_event_handler handler, |
| 289 | void *context)) | 287 | void *context)) |
| 290 | |||
| 291 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 288 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 292 | acpi_install_fixed_event_handler(u32 | 289 | acpi_install_fixed_event_handler(u32 |
| 293 | acpi_event, | 290 | acpi_event, |
| @@ -295,12 +292,10 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
| 295 | handler, | 292 | handler, |
| 296 | void | 293 | void |
| 297 | *context)) | 294 | *context)) |
| 298 | |||
| 299 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 295 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 300 | acpi_remove_fixed_event_handler(u32 acpi_event, | 296 | acpi_remove_fixed_event_handler(u32 acpi_event, |
| 301 | acpi_event_handler | 297 | acpi_event_handler |
| 302 | handler)) | 298 | handler)) |
| 303 | |||
| 304 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 299 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 305 | acpi_install_gpe_handler(acpi_handle | 300 | acpi_install_gpe_handler(acpi_handle |
| 306 | gpe_device, | 301 | gpe_device, |
| @@ -309,15 +304,14 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
| 309 | acpi_gpe_handler | 304 | acpi_gpe_handler |
| 310 | address, | 305 | address, |
| 311 | void *context)) | 306 | void *context)) |
| 312 | |||
| 313 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 307 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 314 | acpi_remove_gpe_handler(acpi_handle gpe_device, | 308 | acpi_remove_gpe_handler(acpi_handle gpe_device, |
| 315 | u32 gpe_number, | 309 | u32 gpe_number, |
| 316 | acpi_gpe_handler | 310 | acpi_gpe_handler |
| 317 | address)) | 311 | address)) |
| 318 | acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type, | 312 | acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type, |
| 319 | acpi_notify_handler handler, | 313 | acpi_notify_handler handler, |
| 320 | void *context); | 314 | void *context); |
| 321 | 315 | ||
| 322 | acpi_status | 316 | acpi_status |
| 323 | acpi_remove_notify_handler(acpi_handle device, | 317 | acpi_remove_notify_handler(acpi_handle device, |
| @@ -366,7 +360,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
| 366 | 360 | ||
| 367 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 361 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 368 | acpi_disable_event(u32 event, u32 flags)) | 362 | acpi_disable_event(u32 event, u32 flags)) |
| 369 | |||
| 370 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event)) | 363 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event)) |
| 371 | 364 | ||
| 372 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 365 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| @@ -404,20 +397,16 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
| 404 | parent_device, | 397 | parent_device, |
| 405 | acpi_handle gpe_device, | 398 | acpi_handle gpe_device, |
| 406 | u32 gpe_number)) | 399 | u32 gpe_number)) |
| 407 | |||
| 408 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 400 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 409 | acpi_set_gpe_wake_mask(acpi_handle gpe_device, | 401 | acpi_set_gpe_wake_mask(acpi_handle gpe_device, |
| 410 | u32 gpe_number, | 402 | u32 gpe_number, |
| 411 | u8 action)) | 403 | u8 action)) |
| 412 | |||
| 413 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 404 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 414 | acpi_get_gpe_status(acpi_handle gpe_device, | 405 | acpi_get_gpe_status(acpi_handle gpe_device, |
| 415 | u32 gpe_number, | 406 | u32 gpe_number, |
| 416 | acpi_event_status | 407 | acpi_event_status |
| 417 | *event_status)) | 408 | *event_status)) |
| 418 | |||
| 419 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void)) | 409 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void)) |
| 420 | |||
| 421 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void)) | 410 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void)) |
| 422 | 411 | ||
| 423 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 412 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| @@ -431,7 +420,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
| 431 | *gpe_block_address, | 420 | *gpe_block_address, |
| 432 | u32 register_count, | 421 | u32 register_count, |
| 433 | u32 interrupt_number)) | 422 | u32 interrupt_number)) |
| 434 | |||
| 435 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 423 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 436 | acpi_remove_gpe_block(acpi_handle gpe_device)) | 424 | acpi_remove_gpe_block(acpi_handle gpe_device)) |
| 437 | 425 | ||
| @@ -532,7 +520,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
| 532 | #ifdef ACPI_FUTURE_USAGE | 520 | #ifdef ACPI_FUTURE_USAGE |
| 533 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 521 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 534 | acpi_get_timer_resolution(u32 *resolution)) | 522 | acpi_get_timer_resolution(u32 *resolution)) |
| 535 | |||
| 536 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks)) | 523 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks)) |
| 537 | 524 | ||
| 538 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 525 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index 94970880126f..325aeae1fa99 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
| @@ -182,6 +182,9 @@ struct acpi_table_xsdt { | |||
| 182 | u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ | 182 | u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ |
| 183 | }; | 183 | }; |
| 184 | 184 | ||
| 185 | #define ACPI_RSDT_ENTRY_SIZE (sizeof (u32)) | ||
| 186 | #define ACPI_XSDT_ENTRY_SIZE (sizeof (u64)) | ||
| 187 | |||
| 185 | /******************************************************************************* | 188 | /******************************************************************************* |
| 186 | * | 189 | * |
| 187 | * FACS - Firmware ACPI Control Structure (FACS) | 190 | * FACS - Firmware ACPI Control Structure (FACS) |
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 556c83ee6b42..4ec8c194bfe5 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h | |||
| @@ -457,7 +457,7 @@ struct acpi_hest_aer_common { | |||
| 457 | u8 enabled; | 457 | u8 enabled; |
| 458 | u32 records_to_preallocate; | 458 | u32 records_to_preallocate; |
| 459 | u32 max_sections_per_record; | 459 | u32 max_sections_per_record; |
| 460 | u32 bus; | 460 | u32 bus; /* Bus and Segment numbers */ |
| 461 | u16 device; | 461 | u16 device; |
| 462 | u16 function; | 462 | u16 function; |
| 463 | u16 device_control; | 463 | u16 device_control; |
| @@ -473,6 +473,14 @@ struct acpi_hest_aer_common { | |||
| 473 | #define ACPI_HEST_FIRMWARE_FIRST (1) | 473 | #define ACPI_HEST_FIRMWARE_FIRST (1) |
| 474 | #define ACPI_HEST_GLOBAL (1<<1) | 474 | #define ACPI_HEST_GLOBAL (1<<1) |
| 475 | 475 | ||
| 476 | /* | ||
| 477 | * Macros to access the bus/segment numbers in Bus field above: | ||
| 478 | * Bus number is encoded in bits 7:0 | ||
| 479 | * Segment number is encoded in bits 23:8 | ||
| 480 | */ | ||
| 481 | #define ACPI_HEST_BUS(bus) ((bus) & 0xFF) | ||
| 482 | #define ACPI_HEST_SEGMENT(bus) (((bus) >> 8) & 0xFFFF) | ||
| 483 | |||
| 476 | /* Hardware Error Notification */ | 484 | /* Hardware Error Notification */ |
| 477 | 485 | ||
| 478 | struct acpi_hest_notify { | 486 | struct acpi_hest_notify { |
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 40f7ed115452..094a906a0e98 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h | |||
| @@ -327,6 +327,11 @@ struct acpi_table_dbg2 { | |||
| 327 | u32 info_count; | 327 | u32 info_count; |
| 328 | }; | 328 | }; |
| 329 | 329 | ||
| 330 | struct acpi_dbg2_header { | ||
| 331 | u32 info_offset; | ||
| 332 | u32 info_count; | ||
| 333 | }; | ||
| 334 | |||
| 330 | /* Debug Device Information Subtable */ | 335 | /* Debug Device Information Subtable */ |
| 331 | 336 | ||
| 332 | struct acpi_dbg2_device { | 337 | struct acpi_dbg2_device { |
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h index e2c0931a3d67..01c2a9013e40 100644 --- a/include/acpi/actbl3.h +++ b/include/acpi/actbl3.h | |||
| @@ -374,16 +374,22 @@ struct acpi_mpst_shared { | |||
| 374 | struct acpi_table_pcct { | 374 | struct acpi_table_pcct { |
| 375 | struct acpi_table_header header; /* Common ACPI table header */ | 375 | struct acpi_table_header header; /* Common ACPI table header */ |
| 376 | u32 flags; | 376 | u32 flags; |
| 377 | u32 latency; | 377 | u64 reserved; |
| 378 | u32 reserved; | ||
| 379 | }; | 378 | }; |
| 380 | 379 | ||
| 381 | /* Values for Flags field above */ | 380 | /* Values for Flags field above */ |
| 382 | 381 | ||
| 383 | #define ACPI_PCCT_DOORBELL 1 | 382 | #define ACPI_PCCT_DOORBELL 1 |
| 384 | 383 | ||
| 384 | /* Values for subtable type in struct acpi_subtable_header */ | ||
| 385 | |||
| 386 | enum acpi_pcct_type { | ||
| 387 | ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, | ||
| 388 | ACPI_PCCT_TYPE_RESERVED = 1 /* 1 and greater are reserved */ | ||
| 389 | }; | ||
| 390 | |||
| 385 | /* | 391 | /* |
| 386 | * PCCT subtables | 392 | * PCCT Subtables, correspond to Type in struct acpi_subtable_header |
| 387 | */ | 393 | */ |
| 388 | 394 | ||
| 389 | /* 0: Generic Communications Subspace */ | 395 | /* 0: Generic Communications Subspace */ |
| @@ -396,6 +402,9 @@ struct acpi_pcct_subspace { | |||
| 396 | struct acpi_generic_address doorbell_register; | 402 | struct acpi_generic_address doorbell_register; |
| 397 | u64 preserve_mask; | 403 | u64 preserve_mask; |
| 398 | u64 write_mask; | 404 | u64 write_mask; |
| 405 | u32 latency; | ||
| 406 | u32 max_access_rate; | ||
| 407 | u16 min_turnaround_time; | ||
| 399 | }; | 408 | }; |
| 400 | 409 | ||
| 401 | /* | 410 | /* |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 809b1a0fee7f..68a3ada689c9 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
| @@ -928,8 +928,8 @@ struct acpi_object_list { | |||
| 928 | * Miscellaneous common Data Structures used by the interfaces | 928 | * Miscellaneous common Data Structures used by the interfaces |
| 929 | */ | 929 | */ |
| 930 | #define ACPI_NO_BUFFER 0 | 930 | #define ACPI_NO_BUFFER 0 |
| 931 | #define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) | 931 | #define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) /* Let ACPICA allocate buffer */ |
| 932 | #define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) | 932 | #define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) /* For internal use only (enables tracking) */ |
| 933 | 933 | ||
| 934 | struct acpi_buffer { | 934 | struct acpi_buffer { |
| 935 | acpi_size length; /* Length in bytes of the buffer */ | 935 | acpi_size length; /* Length in bytes of the buffer */ |
| @@ -937,14 +937,6 @@ struct acpi_buffer { | |||
| 937 | }; | 937 | }; |
| 938 | 938 | ||
| 939 | /* | 939 | /* |
| 940 | * Free a buffer created in an struct acpi_buffer via ACPI_ALLOCATE_BUFFER. | ||
| 941 | * Note: We use acpi_os_free here because acpi_os_allocate was used to allocate | ||
| 942 | * the buffer. This purposefully bypasses the internal allocation tracking | ||
| 943 | * mechanism (if it is enabled). | ||
| 944 | */ | ||
| 945 | #define ACPI_FREE_BUFFER(b) acpi_os_free((b).pointer) | ||
| 946 | |||
| 947 | /* | ||
| 948 | * name_type for acpi_get_name | 940 | * name_type for acpi_get_name |
| 949 | */ | 941 | */ |
| 950 | #define ACPI_FULL_PATHNAME 0 | 942 | #define ACPI_FULL_PATHNAME 0 |
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 974d3ef7c141..b402eb67af83 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
| @@ -96,13 +96,14 @@ | |||
| 96 | #endif | 96 | #endif |
| 97 | 97 | ||
| 98 | /* | 98 | /* |
| 99 | * acpi_bin/acpi_dump/acpi_src/acpi_xtract configuration. All single | 99 | * acpi_bin/acpi_dump/acpi_src/acpi_xtract/Example configuration. All single |
| 100 | * threaded, with no debug output. | 100 | * threaded, with no debug output. |
| 101 | */ | 101 | */ |
| 102 | #if (defined ACPI_BIN_APP) || \ | 102 | #if (defined ACPI_BIN_APP) || \ |
| 103 | (defined ACPI_DUMP_APP) || \ | 103 | (defined ACPI_DUMP_APP) || \ |
| 104 | (defined ACPI_SRC_APP) || \ | 104 | (defined ACPI_SRC_APP) || \ |
| 105 | (defined ACPI_XTRACT_APP) | 105 | (defined ACPI_XTRACT_APP) || \ |
| 106 | (defined ACPI_EXAMPLE_APP) | ||
| 106 | #define ACPI_APPLICATION | 107 | #define ACPI_APPLICATION |
| 107 | #define ACPI_SINGLE_THREADED | 108 | #define ACPI_SINGLE_THREADED |
| 108 | #endif | 109 | #endif |
| @@ -394,4 +395,13 @@ typedef char *va_list; | |||
| 394 | 395 | ||
| 395 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ | 396 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ |
| 396 | 397 | ||
| 398 | #ifndef ACPI_FILE | ||
| 399 | #ifdef ACPI_APPLICATION | ||
| 400 | #include <stdio.h> | ||
| 401 | #define ACPI_FILE FILE * | ||
| 402 | #else | ||
| 403 | #define ACPI_FILE void * | ||
| 404 | #endif /* ACPI_APPLICATION */ | ||
| 405 | #endif /* ACPI_FILE */ | ||
| 406 | |||
| 397 | #endif /* __ACENV_H__ */ | 407 | #endif /* __ACENV_H__ */ |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 28f4f4dba0b6..008aa287c7a9 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
| @@ -239,10 +239,6 @@ void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size); | |||
| 239 | */ | 239 | */ |
| 240 | void early_acpi_os_unmap_memory(void __iomem * virt, acpi_size size); | 240 | void early_acpi_os_unmap_memory(void __iomem * virt, acpi_size size); |
| 241 | 241 | ||
| 242 | void acpi_os_gpe_count(u32 gpe_number); | ||
| 243 | |||
| 244 | void acpi_os_fixed_event_count(u32 fixed_event_number); | ||
| 245 | |||
| 246 | #endif /* __KERNEL__ */ | 242 | #endif /* __KERNEL__ */ |
| 247 | 243 | ||
| 248 | #endif /* __ACLINUX_H__ */ | 244 | #endif /* __ACLINUX_H__ */ |
diff --git a/include/asm-generic/audit_change_attr.h b/include/asm-generic/audit_change_attr.h index 89b73e5d0fd0..a1865537339b 100644 --- a/include/asm-generic/audit_change_attr.h +++ b/include/asm-generic/audit_change_attr.h | |||
| @@ -4,9 +4,11 @@ __NR_chmod, | |||
| 4 | __NR_fchmod, | 4 | __NR_fchmod, |
| 5 | #ifdef __NR_chown | 5 | #ifdef __NR_chown |
| 6 | __NR_chown, | 6 | __NR_chown, |
| 7 | __NR_fchown, | ||
| 8 | __NR_lchown, | 7 | __NR_lchown, |
| 9 | #endif | 8 | #endif |
| 9 | #ifdef __NR_fchown | ||
| 10 | __NR_fchown, | ||
| 11 | #endif | ||
| 10 | __NR_setxattr, | 12 | __NR_setxattr, |
| 11 | __NR_lsetxattr, | 13 | __NR_lsetxattr, |
| 12 | __NR_fsetxattr, | 14 | __NR_fsetxattr, |
diff --git a/include/asm-generic/audit_write.h b/include/asm-generic/audit_write.h index e7020c57b13b..274575d7129f 100644 --- a/include/asm-generic/audit_write.h +++ b/include/asm-generic/audit_write.h | |||
| @@ -10,6 +10,12 @@ __NR_truncate, | |||
| 10 | #ifdef __NR_truncate64 | 10 | #ifdef __NR_truncate64 |
| 11 | __NR_truncate64, | 11 | __NR_truncate64, |
| 12 | #endif | 12 | #endif |
| 13 | #ifdef __NR_ftruncate | ||
| 14 | __NR_ftruncate, | ||
| 15 | #endif | ||
| 16 | #ifdef __NR_ftruncate64 | ||
| 17 | __NR_ftruncate64, | ||
| 18 | #endif | ||
| 13 | #ifdef __NR_bind | 19 | #ifdef __NR_bind |
| 14 | __NR_bind, /* bind can affect fs object only in one way... */ | 20 | __NR_bind, /* bind can affect fs object only in one way... */ |
| 15 | #endif | 21 | #endif |
diff --git a/include/asm-generic/barrier.h b/include/asm-generic/barrier.h index 639d7a4d033b..6f692f8ac664 100644 --- a/include/asm-generic/barrier.h +++ b/include/asm-generic/barrier.h | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | /* Generic barrier definitions, based on MN10300 definitions. | 1 | /* |
| 2 | * Generic barrier definitions, originally based on MN10300 definitions. | ||
| 2 | * | 3 | * |
| 3 | * It should be possible to use these on really simple architectures, | 4 | * It should be possible to use these on really simple architectures, |
| 4 | * but it serves more as a starting point for new ports. | 5 | * but it serves more as a starting point for new ports. |
| @@ -16,35 +17,65 @@ | |||
| 16 | 17 | ||
| 17 | #ifndef __ASSEMBLY__ | 18 | #ifndef __ASSEMBLY__ |
| 18 | 19 | ||
| 19 | #define nop() asm volatile ("nop") | 20 | #include <linux/compiler.h> |
| 21 | |||
| 22 | #ifndef nop | ||
| 23 | #define nop() asm volatile ("nop") | ||
| 24 | #endif | ||
| 20 | 25 | ||
| 21 | /* | 26 | /* |
| 22 | * Force strict CPU ordering. | 27 | * Force strict CPU ordering. And yes, this is required on UP too when we're |
| 23 | * And yes, this is required on UP too when we're talking | 28 | * talking to devices. |
| 24 | * to devices. | ||
| 25 | * | 29 | * |
| 26 | * This implementation only contains a compiler barrier. | 30 | * Fall back to compiler barriers if nothing better is provided. |
| 27 | */ | 31 | */ |
| 28 | 32 | ||
| 29 | #define mb() asm volatile ("": : :"memory") | 33 | #ifndef mb |
| 34 | #define mb() barrier() | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #ifndef rmb | ||
| 30 | #define rmb() mb() | 38 | #define rmb() mb() |
| 31 | #define wmb() asm volatile ("": : :"memory") | 39 | #endif |
| 40 | |||
| 41 | #ifndef wmb | ||
| 42 | #define wmb() mb() | ||
| 43 | #endif | ||
| 44 | |||
| 45 | #ifndef read_barrier_depends | ||
| 46 | #define read_barrier_depends() do { } while (0) | ||
| 47 | #endif | ||
| 32 | 48 | ||
| 33 | #ifdef CONFIG_SMP | 49 | #ifdef CONFIG_SMP |
| 34 | #define smp_mb() mb() | 50 | #define smp_mb() mb() |
| 35 | #define smp_rmb() rmb() | 51 | #define smp_rmb() rmb() |
| 36 | #define smp_wmb() wmb() | 52 | #define smp_wmb() wmb() |
| 53 | #define smp_read_barrier_depends() read_barrier_depends() | ||
| 37 | #else | 54 | #else |
| 38 | #define smp_mb() barrier() | 55 | #define smp_mb() barrier() |
| 39 | #define smp_rmb() barrier() | 56 | #define smp_rmb() barrier() |
| 40 | #define smp_wmb() barrier() | 57 | #define smp_wmb() barrier() |
| 58 | #define smp_read_barrier_depends() do { } while (0) | ||
| 59 | #endif | ||
| 60 | |||
| 61 | #ifndef set_mb | ||
| 62 | #define set_mb(var, value) do { (var) = (value); mb(); } while (0) | ||
| 41 | #endif | 63 | #endif |
| 42 | 64 | ||
| 43 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 65 | #define smp_store_release(p, v) \ |
| 44 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | 66 | do { \ |
| 67 | compiletime_assert_atomic_type(*p); \ | ||
| 68 | smp_mb(); \ | ||
| 69 | ACCESS_ONCE(*p) = (v); \ | ||
| 70 | } while (0) | ||
| 45 | 71 | ||
| 46 | #define read_barrier_depends() do {} while (0) | 72 | #define smp_load_acquire(p) \ |
| 47 | #define smp_read_barrier_depends() do {} while (0) | 73 | ({ \ |
| 74 | typeof(*p) ___p1 = ACCESS_ONCE(*p); \ | ||
| 75 | compiletime_assert_atomic_type(*p); \ | ||
| 76 | smp_mb(); \ | ||
| 77 | ___p1; \ | ||
| 78 | }) | ||
| 48 | 79 | ||
| 49 | #endif /* !__ASSEMBLY__ */ | 80 | #endif /* !__ASSEMBLY__ */ |
| 50 | #endif /* __ASM_GENERIC_BARRIER_H */ | 81 | #endif /* __ASM_GENERIC_BARRIER_H */ |
diff --git a/include/asm-generic/fixmap.h b/include/asm-generic/fixmap.h new file mode 100644 index 000000000000..5a64ca4621f3 --- /dev/null +++ b/include/asm-generic/fixmap.h | |||
| @@ -0,0 +1,97 @@ | |||
| 1 | /* | ||
| 2 | * fixmap.h: compile-time virtual memory allocation | ||
| 3 | * | ||
| 4 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 5 | * License. See the file "COPYING" in the main directory of this archive | ||
| 6 | * for more details. | ||
| 7 | * | ||
| 8 | * Copyright (C) 1998 Ingo Molnar | ||
| 9 | * | ||
| 10 | * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 | ||
| 11 | * x86_32 and x86_64 integration by Gustavo F. Padovan, February 2009 | ||
| 12 | * Break out common bits to asm-generic by Mark Salter, November 2013 | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __ASM_GENERIC_FIXMAP_H | ||
| 16 | #define __ASM_GENERIC_FIXMAP_H | ||
| 17 | |||
| 18 | #include <linux/bug.h> | ||
| 19 | |||
| 20 | #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) | ||
| 21 | #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) | ||
| 22 | |||
| 23 | #ifndef __ASSEMBLY__ | ||
| 24 | /* | ||
| 25 | * 'index to address' translation. If anyone tries to use the idx | ||
| 26 | * directly without translation, we catch the bug with a NULL-deference | ||
| 27 | * kernel oops. Illegal ranges of incoming indices are caught too. | ||
| 28 | */ | ||
| 29 | static __always_inline unsigned long fix_to_virt(const unsigned int idx) | ||
| 30 | { | ||
| 31 | BUILD_BUG_ON(idx >= __end_of_fixed_addresses); | ||
| 32 | return __fix_to_virt(idx); | ||
| 33 | } | ||
| 34 | |||
| 35 | static inline unsigned long virt_to_fix(const unsigned long vaddr) | ||
| 36 | { | ||
| 37 | BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); | ||
| 38 | return __virt_to_fix(vaddr); | ||
| 39 | } | ||
| 40 | |||
| 41 | /* | ||
| 42 | * Provide some reasonable defaults for page flags. | ||
| 43 | * Not all architectures use all of these different types and some | ||
| 44 | * architectures use different names. | ||
| 45 | */ | ||
| 46 | #ifndef FIXMAP_PAGE_NORMAL | ||
| 47 | #define FIXMAP_PAGE_NORMAL PAGE_KERNEL | ||
| 48 | #endif | ||
| 49 | #ifndef FIXMAP_PAGE_NOCACHE | ||
| 50 | #define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_NOCACHE | ||
| 51 | #endif | ||
| 52 | #ifndef FIXMAP_PAGE_IO | ||
| 53 | #define FIXMAP_PAGE_IO PAGE_KERNEL_IO | ||
| 54 | #endif | ||
| 55 | #ifndef FIXMAP_PAGE_CLEAR | ||
| 56 | #define FIXMAP_PAGE_CLEAR __pgprot(0) | ||
| 57 | #endif | ||
| 58 | |||
| 59 | #ifndef set_fixmap | ||
| 60 | #define set_fixmap(idx, phys) \ | ||
| 61 | __set_fixmap(idx, phys, FIXMAP_PAGE_NORMAL) | ||
| 62 | #endif | ||
| 63 | |||
| 64 | #ifndef clear_fixmap | ||
| 65 | #define clear_fixmap(idx) \ | ||
| 66 | __set_fixmap(idx, 0, FIXMAP_PAGE_CLEAR) | ||
| 67 | #endif | ||
| 68 | |||
| 69 | /* Return a pointer with offset calculated */ | ||
| 70 | #define __set_fixmap_offset(idx, phys, flags) \ | ||
| 71 | ({ \ | ||
| 72 | unsigned long addr; \ | ||
| 73 | __set_fixmap(idx, phys, flags); \ | ||
| 74 | addr = fix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1)); \ | ||
| 75 | addr; \ | ||
| 76 | }) | ||
| 77 | |||
| 78 | #define set_fixmap_offset(idx, phys) \ | ||
| 79 | __set_fixmap_offset(idx, phys, FIXMAP_PAGE_NORMAL) | ||
| 80 | |||
| 81 | /* | ||
| 82 | * Some hardware wants to get fixmapped without caching. | ||
| 83 | */ | ||
| 84 | #define set_fixmap_nocache(idx, phys) \ | ||
| 85 | __set_fixmap(idx, phys, FIXMAP_PAGE_NOCACHE) | ||
| 86 | |||
| 87 | #define set_fixmap_offset_nocache(idx, phys) \ | ||
| 88 | __set_fixmap_offset(idx, phys, FIXMAP_PAGE_NOCACHE) | ||
| 89 | |||
| 90 | /* | ||
| 91 | * Some fixmaps are for IO | ||
| 92 | */ | ||
| 93 | #define set_fixmap_io(idx, phys) \ | ||
| 94 | __set_fixmap(idx, phys, FIXMAP_PAGE_IO) | ||
| 95 | |||
| 96 | #endif /* __ASSEMBLY__ */ | ||
| 97 | #endif /* __ASM_GENERIC_FIXMAP_H */ | ||
diff --git a/include/asm-generic/hash.h b/include/asm-generic/hash.h new file mode 100644 index 000000000000..b6312843dbd9 --- /dev/null +++ b/include/asm-generic/hash.h | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #ifndef __ASM_GENERIC_HASH_H | ||
| 2 | #define __ASM_GENERIC_HASH_H | ||
| 3 | |||
| 4 | struct fast_hash_ops; | ||
| 5 | static inline void setup_arch_fast_hash(struct fast_hash_ops *ops) | ||
| 6 | { | ||
| 7 | } | ||
| 8 | |||
| 9 | #endif /* __ASM_GENERIC_HASH_H */ | ||
diff --git a/include/asm-generic/int-l64.h b/include/asm-generic/int-l64.h deleted file mode 100644 index 27d4ec0dfce0..000000000000 --- a/include/asm-generic/int-l64.h +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * asm-generic/int-l64.h | ||
| 3 | * | ||
| 4 | * Integer declarations for architectures which use "long" | ||
| 5 | * for 64-bit types. | ||
| 6 | */ | ||
| 7 | #ifndef _ASM_GENERIC_INT_L64_H | ||
| 8 | #define _ASM_GENERIC_INT_L64_H | ||
| 9 | |||
| 10 | #include <uapi/asm-generic/int-l64.h> | ||
| 11 | |||
| 12 | |||
| 13 | #ifndef __ASSEMBLY__ | ||
| 14 | |||
| 15 | typedef signed char s8; | ||
| 16 | typedef unsigned char u8; | ||
| 17 | |||
| 18 | typedef signed short s16; | ||
| 19 | typedef unsigned short u16; | ||
| 20 | |||
| 21 | typedef signed int s32; | ||
| 22 | typedef unsigned int u32; | ||
| 23 | |||
| 24 | typedef signed long s64; | ||
| 25 | typedef unsigned long u64; | ||
| 26 | |||
| 27 | #define S8_C(x) x | ||
| 28 | #define U8_C(x) x ## U | ||
| 29 | #define S16_C(x) x | ||
| 30 | #define U16_C(x) x ## U | ||
| 31 | #define S32_C(x) x | ||
| 32 | #define U32_C(x) x ## U | ||
| 33 | #define S64_C(x) x ## L | ||
| 34 | #define U64_C(x) x ## UL | ||
| 35 | |||
| 36 | #else /* __ASSEMBLY__ */ | ||
| 37 | |||
| 38 | #define S8_C(x) x | ||
| 39 | #define U8_C(x) x | ||
| 40 | #define S16_C(x) x | ||
| 41 | #define U16_C(x) x | ||
| 42 | #define S32_C(x) x | ||
| 43 | #define U32_C(x) x | ||
| 44 | #define S64_C(x) x | ||
| 45 | #define U64_C(x) x | ||
| 46 | |||
| 47 | #endif /* __ASSEMBLY__ */ | ||
| 48 | |||
| 49 | #endif /* _ASM_GENERIC_INT_L64_H */ | ||
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index f330d28e4d0e..db0923458940 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
| @@ -217,7 +217,7 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) | |||
| 217 | #endif | 217 | #endif |
| 218 | 218 | ||
| 219 | #ifndef pte_accessible | 219 | #ifndef pte_accessible |
| 220 | # define pte_accessible(pte) ((void)(pte),1) | 220 | # define pte_accessible(mm, pte) ((void)(pte), 1) |
| 221 | #endif | 221 | #endif |
| 222 | 222 | ||
| 223 | #ifndef flush_tlb_fix_spurious_fault | 223 | #ifndef flush_tlb_fix_spurious_fault |
| @@ -599,11 +599,10 @@ static inline int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd) | |||
| 599 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 599 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 600 | barrier(); | 600 | barrier(); |
| 601 | #endif | 601 | #endif |
| 602 | if (pmd_none(pmdval)) | 602 | if (pmd_none(pmdval) || pmd_trans_huge(pmdval)) |
| 603 | return 1; | 603 | return 1; |
| 604 | if (unlikely(pmd_bad(pmdval))) { | 604 | if (unlikely(pmd_bad(pmdval))) { |
| 605 | if (!pmd_trans_huge(pmdval)) | 605 | pmd_clear_bad(pmd); |
| 606 | pmd_clear_bad(pmd); | ||
| 607 | return 1; | 606 | return 1; |
| 608 | } | 607 | } |
| 609 | return 0; | 608 | return 0; |
diff --git a/include/asm-generic/preempt.h b/include/asm-generic/preempt.h index ddf2b420ac8f..1cd3f5d767a8 100644 --- a/include/asm-generic/preempt.h +++ b/include/asm-generic/preempt.h | |||
| @@ -3,13 +3,11 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/thread_info.h> | 4 | #include <linux/thread_info.h> |
| 5 | 5 | ||
| 6 | /* | 6 | #define PREEMPT_ENABLED (0) |
| 7 | * We mask the PREEMPT_NEED_RESCHED bit so as not to confuse all current users | 7 | |
| 8 | * that think a non-zero value indicates we cannot preempt. | ||
| 9 | */ | ||
| 10 | static __always_inline int preempt_count(void) | 8 | static __always_inline int preempt_count(void) |
| 11 | { | 9 | { |
| 12 | return current_thread_info()->preempt_count & ~PREEMPT_NEED_RESCHED; | 10 | return current_thread_info()->preempt_count; |
| 13 | } | 11 | } |
| 14 | 12 | ||
| 15 | static __always_inline int *preempt_count_ptr(void) | 13 | static __always_inline int *preempt_count_ptr(void) |
| @@ -17,11 +15,6 @@ static __always_inline int *preempt_count_ptr(void) | |||
| 17 | return ¤t_thread_info()->preempt_count; | 15 | return ¤t_thread_info()->preempt_count; |
| 18 | } | 16 | } |
| 19 | 17 | ||
| 20 | /* | ||
| 21 | * We now loose PREEMPT_NEED_RESCHED and cause an extra reschedule; however the | ||
| 22 | * alternative is loosing a reschedule. Better schedule too often -- also this | ||
| 23 | * should be a very rare operation. | ||
| 24 | */ | ||
| 25 | static __always_inline void preempt_count_set(int pc) | 18 | static __always_inline void preempt_count_set(int pc) |
| 26 | { | 19 | { |
| 27 | *preempt_count_ptr() = pc; | 20 | *preempt_count_ptr() = pc; |
| @@ -41,28 +34,17 @@ static __always_inline void preempt_count_set(int pc) | |||
| 41 | task_thread_info(p)->preempt_count = PREEMPT_ENABLED; \ | 34 | task_thread_info(p)->preempt_count = PREEMPT_ENABLED; \ |
| 42 | } while (0) | 35 | } while (0) |
| 43 | 36 | ||
| 44 | /* | ||
| 45 | * We fold the NEED_RESCHED bit into the preempt count such that | ||
| 46 | * preempt_enable() can decrement and test for needing to reschedule with a | ||
| 47 | * single instruction. | ||
| 48 | * | ||
| 49 | * We invert the actual bit, so that when the decrement hits 0 we know we both | ||
| 50 | * need to resched (the bit is cleared) and can resched (no preempt count). | ||
| 51 | */ | ||
| 52 | |||
| 53 | static __always_inline void set_preempt_need_resched(void) | 37 | static __always_inline void set_preempt_need_resched(void) |
| 54 | { | 38 | { |
| 55 | *preempt_count_ptr() &= ~PREEMPT_NEED_RESCHED; | ||
| 56 | } | 39 | } |
| 57 | 40 | ||
| 58 | static __always_inline void clear_preempt_need_resched(void) | 41 | static __always_inline void clear_preempt_need_resched(void) |
| 59 | { | 42 | { |
| 60 | *preempt_count_ptr() |= PREEMPT_NEED_RESCHED; | ||
| 61 | } | 43 | } |
| 62 | 44 | ||
| 63 | static __always_inline bool test_preempt_need_resched(void) | 45 | static __always_inline bool test_preempt_need_resched(void) |
| 64 | { | 46 | { |
| 65 | return !(*preempt_count_ptr() & PREEMPT_NEED_RESCHED); | 47 | return false; |
| 66 | } | 48 | } |
| 67 | 49 | ||
| 68 | /* | 50 | /* |
| @@ -81,7 +63,12 @@ static __always_inline void __preempt_count_sub(int val) | |||
| 81 | 63 | ||
| 82 | static __always_inline bool __preempt_count_dec_and_test(void) | 64 | static __always_inline bool __preempt_count_dec_and_test(void) |
| 83 | { | 65 | { |
| 84 | return !--*preempt_count_ptr(); | 66 | /* |
| 67 | * Because of load-store architectures cannot do per-cpu atomic | ||
| 68 | * operations; we cannot use PREEMPT_NEED_RESCHED because it might get | ||
| 69 | * lost. | ||
| 70 | */ | ||
| 71 | return !--*preempt_count_ptr() && tif_need_resched(); | ||
| 85 | } | 72 | } |
| 86 | 73 | ||
| 87 | /* | 74 | /* |
| @@ -89,7 +76,7 @@ static __always_inline bool __preempt_count_dec_and_test(void) | |||
| 89 | */ | 76 | */ |
| 90 | static __always_inline bool should_resched(void) | 77 | static __always_inline bool should_resched(void) |
| 91 | { | 78 | { |
| 92 | return unlikely(!*preempt_count_ptr()); | 79 | return unlikely(!preempt_count() && tif_need_resched()); |
| 93 | } | 80 | } |
| 94 | 81 | ||
| 95 | #ifdef CONFIG_PREEMPT | 82 | #ifdef CONFIG_PREEMPT |
diff --git a/include/asm-generic/simd.h b/include/asm-generic/simd.h new file mode 100644 index 000000000000..f57eb7b5c23b --- /dev/null +++ b/include/asm-generic/simd.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | |||
| 2 | #include <linux/hardirq.h> | ||
| 3 | |||
| 4 | /* | ||
| 5 | * may_use_simd - whether it is allowable at this time to issue SIMD | ||
| 6 | * instructions or access the SIMD register file | ||
| 7 | * | ||
| 8 | * As architectures typically don't preserve the SIMD register file when | ||
| 9 | * taking an interrupt, !in_interrupt() should be a reasonable default. | ||
| 10 | */ | ||
| 11 | static __must_check inline bool may_use_simd(void) | ||
| 12 | { | ||
| 13 | return !in_interrupt(); | ||
| 14 | } | ||
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h index dc1269c74a52..72d8803832ff 100644 --- a/include/asm-generic/uaccess.h +++ b/include/asm-generic/uaccess.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | /* | 4 | /* |
| 5 | * User space memory access functions, these should work | 5 | * User space memory access functions, these should work |
| 6 | * on a ny machine that has kernel and user data in the same | 6 | * on any machine that has kernel and user data in the same |
| 7 | * address space, e.g. all NOMMU machines. | 7 | * address space, e.g. all NOMMU machines. |
| 8 | */ | 8 | */ |
| 9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
diff --git a/include/asm-generic/word-at-a-time.h b/include/asm-generic/word-at-a-time.h index 3f21f1b72e45..d3909effd725 100644 --- a/include/asm-generic/word-at-a-time.h +++ b/include/asm-generic/word-at-a-time.h | |||
| @@ -49,4 +49,12 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct | |||
| 49 | return (val + c->high_bits) & ~rhs; | 49 | return (val + c->high_bits) & ~rhs; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | #ifndef zero_bytemask | ||
| 53 | #ifdef CONFIG_64BIT | ||
| 54 | #define zero_bytemask(mask) (~0ul << fls64(mask)) | ||
| 55 | #else | ||
| 56 | #define zero_bytemask(mask) (~0ul << fls(mask)) | ||
| 57 | #endif /* CONFIG_64BIT */ | ||
| 58 | #endif /* zero_bytemask */ | ||
| 59 | |||
| 52 | #endif /* _ASM_WORD_AT_A_TIME_H */ | 60 | #endif /* _ASM_WORD_AT_A_TIME_H */ |
diff --git a/include/crypto/ablk_helper.h b/include/crypto/ablk_helper.h new file mode 100644 index 000000000000..4f93df50c23e --- /dev/null +++ b/include/crypto/ablk_helper.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* | ||
| 2 | * Shared async block cipher helpers | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _CRYPTO_ABLK_HELPER_H | ||
| 6 | #define _CRYPTO_ABLK_HELPER_H | ||
| 7 | |||
| 8 | #include <linux/crypto.h> | ||
| 9 | #include <linux/kernel.h> | ||
| 10 | #include <crypto/cryptd.h> | ||
| 11 | |||
| 12 | struct async_helper_ctx { | ||
| 13 | struct cryptd_ablkcipher *cryptd_tfm; | ||
| 14 | }; | ||
| 15 | |||
| 16 | extern int ablk_set_key(struct crypto_ablkcipher *tfm, const u8 *key, | ||
| 17 | unsigned int key_len); | ||
| 18 | |||
| 19 | extern int __ablk_encrypt(struct ablkcipher_request *req); | ||
| 20 | |||
| 21 | extern int ablk_encrypt(struct ablkcipher_request *req); | ||
| 22 | |||
| 23 | extern int ablk_decrypt(struct ablkcipher_request *req); | ||
| 24 | |||
| 25 | extern void ablk_exit(struct crypto_tfm *tfm); | ||
| 26 | |||
| 27 | extern int ablk_init_common(struct crypto_tfm *tfm, const char *drv_name); | ||
| 28 | |||
| 29 | extern int ablk_init(struct crypto_tfm *tfm); | ||
| 30 | |||
| 31 | #endif /* _CRYPTO_ABLK_HELPER_H */ | ||
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 418d270e1806..e73c19e90e38 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
| @@ -386,5 +386,21 @@ static inline int crypto_requires_sync(u32 type, u32 mask) | |||
| 386 | return (type ^ CRYPTO_ALG_ASYNC) & mask & CRYPTO_ALG_ASYNC; | 386 | return (type ^ CRYPTO_ALG_ASYNC) & mask & CRYPTO_ALG_ASYNC; |
| 387 | } | 387 | } |
| 388 | 388 | ||
| 389 | #endif /* _CRYPTO_ALGAPI_H */ | 389 | noinline unsigned long __crypto_memneq(const void *a, const void *b, size_t size); |
| 390 | |||
| 391 | /** | ||
| 392 | * crypto_memneq - Compare two areas of memory without leaking | ||
| 393 | * timing information. | ||
| 394 | * | ||
| 395 | * @a: One area of memory | ||
| 396 | * @b: Another area of memory | ||
| 397 | * @size: The size of the area. | ||
| 398 | * | ||
| 399 | * Returns 0 when data is equal, 1 otherwise. | ||
| 400 | */ | ||
| 401 | static inline int crypto_memneq(const void *a, const void *b, size_t size) | ||
| 402 | { | ||
| 403 | return __crypto_memneq(a, b, size) != 0UL ? 1 : 0; | ||
| 404 | } | ||
| 390 | 405 | ||
| 406 | #endif /* _CRYPTO_ALGAPI_H */ | ||
diff --git a/include/crypto/authenc.h b/include/crypto/authenc.h index e47b044929a8..6775059539b5 100644 --- a/include/crypto/authenc.h +++ b/include/crypto/authenc.h | |||
| @@ -23,5 +23,15 @@ struct crypto_authenc_key_param { | |||
| 23 | __be32 enckeylen; | 23 | __be32 enckeylen; |
| 24 | }; | 24 | }; |
| 25 | 25 | ||
| 26 | #endif /* _CRYPTO_AUTHENC_H */ | 26 | struct crypto_authenc_keys { |
| 27 | const u8 *authkey; | ||
| 28 | const u8 *enckey; | ||
| 29 | |||
| 30 | unsigned int authkeylen; | ||
| 31 | unsigned int enckeylen; | ||
| 32 | }; | ||
| 27 | 33 | ||
| 34 | int crypto_authenc_extractkeys(struct crypto_authenc_keys *keys, const u8 *key, | ||
| 35 | unsigned int keylen); | ||
| 36 | |||
| 37 | #endif /* _CRYPTO_AUTHENC_H */ | ||
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h index 13621cc8cf4c..6a626a507b8c 100644 --- a/include/crypto/scatterwalk.h +++ b/include/crypto/scatterwalk.h | |||
| @@ -36,6 +36,7 @@ static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num, | |||
| 36 | { | 36 | { |
| 37 | sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0); | 37 | sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0); |
| 38 | sg1[num - 1].page_link &= ~0x02; | 38 | sg1[num - 1].page_link &= ~0x02; |
| 39 | sg1[num - 1].page_link |= 0x01; | ||
| 39 | } | 40 | } |
| 40 | 41 | ||
| 41 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) | 42 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) |
| @@ -43,7 +44,7 @@ static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) | |||
| 43 | if (sg_is_last(sg)) | 44 | if (sg_is_last(sg)) |
| 44 | return NULL; | 45 | return NULL; |
| 45 | 46 | ||
| 46 | return (++sg)->length ? sg : (void *)sg_page(sg); | 47 | return (++sg)->length ? sg : sg_chain_ptr(sg); |
| 47 | } | 48 | } |
| 48 | 49 | ||
| 49 | static inline void scatterwalk_crypto_chain(struct scatterlist *head, | 50 | static inline void scatterwalk_crypto_chain(struct scatterlist *head, |
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index 87578c109e48..49376aec2fbb 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
| @@ -600,7 +600,7 @@ | |||
| 600 | {0x1002, 0x9645, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 600 | {0x1002, 0x9645, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
| 601 | {0x1002, 0x9647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ | 601 | {0x1002, 0x9647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ |
| 602 | {0x1002, 0x9648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ | 602 | {0x1002, 0x9648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ |
| 603 | {0x1002, 0x9649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ | 603 | {0x1002, 0x9649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\ |
| 604 | {0x1002, 0x964a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 604 | {0x1002, 0x964a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
| 605 | {0x1002, 0x964b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 605 | {0x1002, 0x964b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
| 606 | {0x1002, 0x964c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 606 | {0x1002, 0x964c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
diff --git a/include/dt-bindings/clk/at91.h b/include/dt-bindings/clk/at91.h new file mode 100644 index 000000000000..0b4cb999a3f7 --- /dev/null +++ b/include/dt-bindings/clk/at91.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * This header provides constants for AT91 pmc status. | ||
| 3 | * | ||
| 4 | * The constants defined in this header are being used in dts. | ||
| 5 | * | ||
| 6 | * Licensed under GPLv2 or later. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _DT_BINDINGS_CLK_AT91_H | ||
| 10 | #define _DT_BINDINGS_CLK_AT91_H | ||
| 11 | |||
| 12 | #define AT91_PMC_MOSCS 0 /* MOSCS Flag */ | ||
| 13 | #define AT91_PMC_LOCKA 1 /* PLLA Lock */ | ||
| 14 | #define AT91_PMC_LOCKB 2 /* PLLB Lock */ | ||
| 15 | #define AT91_PMC_MCKRDY 3 /* Master Clock */ | ||
| 16 | #define AT91_PMC_LOCKU 6 /* UPLL Lock */ | ||
| 17 | #define AT91_PMC_PCKRDY(id) (8 + (id)) /* Programmable Clock */ | ||
| 18 | #define AT91_PMC_MOSCSELS 16 /* Main Oscillator Selection */ | ||
| 19 | #define AT91_PMC_MOSCRCS 17 /* Main On-Chip RC */ | ||
| 20 | #define AT91_PMC_CFDEV 18 /* Clock Failure Detector Event */ | ||
| 21 | |||
| 22 | #endif | ||
diff --git a/include/dt-bindings/clk/exynos-audss-clk.h b/include/dt-bindings/clk/exynos-audss-clk.h index 8279f427c60f..0ae6f5a75d2a 100644 --- a/include/dt-bindings/clk/exynos-audss-clk.h +++ b/include/dt-bindings/clk/exynos-audss-clk.h | |||
| @@ -19,7 +19,8 @@ | |||
| 19 | #define EXYNOS_SCLK_I2S 7 | 19 | #define EXYNOS_SCLK_I2S 7 |
| 20 | #define EXYNOS_PCM_BUS 8 | 20 | #define EXYNOS_PCM_BUS 8 |
| 21 | #define EXYNOS_SCLK_PCM 9 | 21 | #define EXYNOS_SCLK_PCM 9 |
| 22 | #define EXYNOS_ADMA 10 | ||
| 22 | 23 | ||
| 23 | #define EXYNOS_AUDSS_MAX_CLKS 10 | 24 | #define EXYNOS_AUDSS_MAX_CLKS 11 |
| 24 | 25 | ||
| 25 | #endif | 26 | #endif |
diff --git a/include/dt-bindings/clock/exynos4.h b/include/dt-bindings/clock/exynos4.h new file mode 100644 index 000000000000..75aff336dfb0 --- /dev/null +++ b/include/dt-bindings/clock/exynos4.h | |||
| @@ -0,0 +1,244 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. | ||
| 3 | * Author: Andrzej Haja <a.hajda@samsung.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * Device Tree binding constants for Exynos4 clock controller. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef _DT_BINDINGS_CLOCK_EXYNOS_4_H | ||
| 13 | #define _DT_BINDINGS_CLOCK_EXYNOS_4_H | ||
| 14 | |||
| 15 | /* core clocks */ | ||
| 16 | #define CLK_XXTI 1 | ||
| 17 | #define CLK_XUSBXTI 2 | ||
| 18 | #define CLK_FIN_PLL 3 | ||
| 19 | #define CLK_FOUT_APLL 4 | ||
| 20 | #define CLK_FOUT_MPLL 5 | ||
| 21 | #define CLK_FOUT_EPLL 6 | ||
| 22 | #define CLK_FOUT_VPLL 7 | ||
| 23 | #define CLK_SCLK_APLL 8 | ||
| 24 | #define CLK_SCLK_MPLL 9 | ||
| 25 | #define CLK_SCLK_EPLL 10 | ||
| 26 | #define CLK_SCLK_VPLL 11 | ||
| 27 | #define CLK_ARM_CLK 12 | ||
| 28 | #define CLK_ACLK200 13 | ||
| 29 | #define CLK_ACLK100 14 | ||
| 30 | #define CLK_ACLK160 15 | ||
| 31 | #define CLK_ACLK133 16 | ||
| 32 | #define CLK_MOUT_MPLL_USER_T 17 /* Exynos4x12 only */ | ||
| 33 | #define CLK_MOUT_MPLL_USER_C 18 /* Exynos4x12 only */ | ||
| 34 | #define CLK_MOUT_CORE 19 | ||
| 35 | #define CLK_MOUT_APLL 20 | ||
| 36 | |||
| 37 | /* gate for special clocks (sclk) */ | ||
| 38 | #define CLK_SCLK_FIMC0 128 | ||
| 39 | #define CLK_SCLK_FIMC1 129 | ||
| 40 | #define CLK_SCLK_FIMC2 130 | ||
| 41 | #define CLK_SCLK_FIMC3 131 | ||
| 42 | #define CLK_SCLK_CAM0 132 | ||
| 43 | #define CLK_SCLK_CAM1 133 | ||
| 44 | #define CLK_SCLK_CSIS0 134 | ||
| 45 | #define CLK_SCLK_CSIS1 135 | ||
| 46 | #define CLK_SCLK_HDMI 136 | ||
| 47 | #define CLK_SCLK_MIXER 137 | ||
| 48 | #define CLK_SCLK_DAC 138 | ||
| 49 | #define CLK_SCLK_PIXEL 139 | ||
| 50 | #define CLK_SCLK_FIMD0 140 | ||
| 51 | #define CLK_SCLK_MDNIE0 141 /* Exynos4412 only */ | ||
| 52 | #define CLK_SCLK_MDNIE_PWM0 142 | ||
| 53 | #define CLK_SCLK_MIPI0 143 | ||
| 54 | #define CLK_SCLK_AUDIO0 144 | ||
| 55 | #define CLK_SCLK_MMC0 145 | ||
| 56 | #define CLK_SCLK_MMC1 146 | ||
| 57 | #define CLK_SCLK_MMC2 147 | ||
| 58 | #define CLK_SCLK_MMC3 148 | ||
| 59 | #define CLK_SCLK_MMC4 149 | ||
| 60 | #define CLK_SCLK_SATA 150 /* Exynos4210 only */ | ||
| 61 | #define CLK_SCLK_UART0 151 | ||
| 62 | #define CLK_SCLK_UART1 152 | ||
| 63 | #define CLK_SCLK_UART2 153 | ||
| 64 | #define CLK_SCLK_UART3 154 | ||
| 65 | #define CLK_SCLK_UART4 155 | ||
| 66 | #define CLK_SCLK_AUDIO1 156 | ||
| 67 | #define CLK_SCLK_AUDIO2 157 | ||
| 68 | #define CLK_SCLK_SPDIF 158 | ||
| 69 | #define CLK_SCLK_SPI0 159 | ||
| 70 | #define CLK_SCLK_SPI1 160 | ||
| 71 | #define CLK_SCLK_SPI2 161 | ||
| 72 | #define CLK_SCLK_SLIMBUS 162 | ||
| 73 | #define CLK_SCLK_FIMD1 163 /* Exynos4210 only */ | ||
| 74 | #define CLK_SCLK_MIPI1 164 /* Exynos4210 only */ | ||
| 75 | #define CLK_SCLK_PCM1 165 | ||
| 76 | #define CLK_SCLK_PCM2 166 | ||
| 77 | #define CLK_SCLK_I2S1 167 | ||
| 78 | #define CLK_SCLK_I2S2 168 | ||
| 79 | #define CLK_SCLK_MIPIHSI 169 /* Exynos4412 only */ | ||
| 80 | #define CLK_SCLK_MFC 170 | ||
| 81 | #define CLK_SCLK_PCM0 171 | ||
| 82 | #define CLK_SCLK_G3D 172 | ||
| 83 | #define CLK_SCLK_PWM_ISP 173 /* Exynos4x12 only */ | ||
| 84 | #define CLK_SCLK_SPI0_ISP 174 /* Exynos4x12 only */ | ||
| 85 | #define CLK_SCLK_SPI1_ISP 175 /* Exynos4x12 only */ | ||
| 86 | #define CLK_SCLK_UART_ISP 176 /* Exynos4x12 only */ | ||
| 87 | #define CLK_SCLK_FIMG2D 177 | ||
| 88 | |||
| 89 | /* gate clocks */ | ||
| 90 | #define CLK_FIMC0 256 | ||
| 91 | #define CLK_FIMC1 257 | ||
| 92 | #define CLK_FIMC2 258 | ||
| 93 | #define CLK_FIMC3 259 | ||
| 94 | #define CLK_CSIS0 260 | ||
| 95 | #define CLK_CSIS1 261 | ||
| 96 | #define CLK_JPEG 262 | ||
| 97 | #define CLK_SMMU_FIMC0 263 | ||
| 98 | #define CLK_SMMU_FIMC1 264 | ||
| 99 | #define CLK_SMMU_FIMC2 265 | ||
| 100 | #define CLK_SMMU_FIMC3 266 | ||
| 101 | #define CLK_SMMU_JPEG 267 | ||
| 102 | #define CLK_VP 268 | ||
| 103 | #define CLK_MIXER 269 | ||
| 104 | #define CLK_TVENC 270 /* Exynos4210 only */ | ||
| 105 | #define CLK_HDMI 271 | ||
| 106 | #define CLK_SMMU_TV 272 | ||
| 107 | #define CLK_MFC 273 | ||
| 108 | #define CLK_SMMU_MFCL 274 | ||
| 109 | #define CLK_SMMU_MFCR 275 | ||
| 110 | #define CLK_G3D 276 | ||
| 111 | #define CLK_G2D 277 | ||
| 112 | #define CLK_ROTATOR 278 /* Exynos4210 only */ | ||
| 113 | #define CLK_MDMA 279 /* Exynos4210 only */ | ||
| 114 | #define CLK_SMMU_G2D 280 /* Exynos4210 only */ | ||
| 115 | #define CLK_SMMU_ROTATOR 281 /* Exynos4210 only */ | ||
| 116 | #define CLK_SMMU_MDMA 282 /* Exynos4210 only */ | ||
| 117 | #define CLK_FIMD0 283 | ||
| 118 | #define CLK_MIE0 284 | ||
| 119 | #define CLK_MDNIE0 285 /* Exynos4412 only */ | ||
| 120 | #define CLK_DSIM0 286 | ||
| 121 | #define CLK_SMMU_FIMD0 287 | ||
| 122 | #define CLK_FIMD1 288 /* Exynos4210 only */ | ||
| 123 | #define CLK_MIE1 289 /* Exynos4210 only */ | ||
| 124 | #define CLK_DSIM1 290 /* Exynos4210 only */ | ||
| 125 | #define CLK_SMMU_FIMD1 291 /* Exynos4210 only */ | ||
| 126 | #define CLK_PDMA0 292 | ||
| 127 | #define CLK_PDMA1 293 | ||
| 128 | #define CLK_PCIE_PHY 294 | ||
| 129 | #define CLK_SATA_PHY 295 /* Exynos4210 only */ | ||
| 130 | #define CLK_TSI 296 | ||
| 131 | #define CLK_SDMMC0 297 | ||
| 132 | #define CLK_SDMMC1 298 | ||
| 133 | #define CLK_SDMMC2 299 | ||
| 134 | #define CLK_SDMMC3 300 | ||
| 135 | #define CLK_SDMMC4 301 | ||
| 136 | #define CLK_SATA 302 /* Exynos4210 only */ | ||
| 137 | #define CLK_SROMC 303 | ||
| 138 | #define CLK_USB_HOST 304 | ||
| 139 | #define CLK_USB_DEVICE 305 | ||
| 140 | #define CLK_PCIE 306 | ||
| 141 | #define CLK_ONENAND 307 | ||
| 142 | #define CLK_NFCON 308 | ||
| 143 | #define CLK_SMMU_PCIE 309 | ||
| 144 | #define CLK_GPS 310 | ||
| 145 | #define CLK_SMMU_GPS 311 | ||
| 146 | #define CLK_UART0 312 | ||
| 147 | #define CLK_UART1 313 | ||
| 148 | #define CLK_UART2 314 | ||
| 149 | #define CLK_UART3 315 | ||
| 150 | #define CLK_UART4 316 | ||
| 151 | #define CLK_I2C0 317 | ||
| 152 | #define CLK_I2C1 318 | ||
| 153 | #define CLK_I2C2 319 | ||
| 154 | #define CLK_I2C3 320 | ||
| 155 | #define CLK_I2C4 321 | ||
| 156 | #define CLK_I2C5 322 | ||
| 157 | #define CLK_I2C6 323 | ||
| 158 | #define CLK_I2C7 324 | ||
| 159 | #define CLK_I2C_HDMI 325 | ||
| 160 | #define CLK_TSADC 326 | ||
| 161 | #define CLK_SPI0 327 | ||
| 162 | #define CLK_SPI1 328 | ||
| 163 | #define CLK_SPI2 329 | ||
| 164 | #define CLK_I2S1 330 | ||
| 165 | #define CLK_I2S2 331 | ||
| 166 | #define CLK_PCM0 332 | ||
| 167 | #define CLK_I2S0 333 | ||
| 168 | #define CLK_PCM1 334 | ||
| 169 | #define CLK_PCM2 335 | ||
| 170 | #define CLK_PWM 336 | ||
| 171 | #define CLK_SLIMBUS 337 | ||
| 172 | #define CLK_SPDIF 338 | ||
| 173 | #define CLK_AC97 339 | ||
| 174 | #define CLK_MODEMIF 340 | ||
| 175 | #define CLK_CHIPID 341 | ||
| 176 | #define CLK_SYSREG 342 | ||
| 177 | #define CLK_HDMI_CEC 343 | ||
| 178 | #define CLK_MCT 344 | ||
| 179 | #define CLK_WDT 345 | ||
| 180 | #define CLK_RTC 346 | ||
| 181 | #define CLK_KEYIF 347 | ||
| 182 | #define CLK_AUDSS 348 | ||
| 183 | #define CLK_MIPI_HSI 349 /* Exynos4210 only */ | ||
| 184 | #define CLK_MDMA2 350 /* Exynos4210 only */ | ||
| 185 | #define CLK_PIXELASYNCM0 351 | ||
| 186 | #define CLK_PIXELASYNCM1 352 | ||
| 187 | #define CLK_FIMC_LITE0 353 /* Exynos4x12 only */ | ||
| 188 | #define CLK_FIMC_LITE1 354 /* Exynos4x12 only */ | ||
| 189 | #define CLK_PPMUISPX 355 /* Exynos4x12 only */ | ||
| 190 | #define CLK_PPMUISPMX 356 /* Exynos4x12 only */ | ||
| 191 | #define CLK_FIMC_ISP 357 /* Exynos4x12 only */ | ||
| 192 | #define CLK_FIMC_DRC 358 /* Exynos4x12 only */ | ||
| 193 | #define CLK_FIMC_FD 359 /* Exynos4x12 only */ | ||
| 194 | #define CLK_MCUISP 360 /* Exynos4x12 only */ | ||
| 195 | #define CLK_GICISP 361 /* Exynos4x12 only */ | ||
| 196 | #define CLK_SMMU_ISP 362 /* Exynos4x12 only */ | ||
| 197 | #define CLK_SMMU_DRC 363 /* Exynos4x12 only */ | ||
| 198 | #define CLK_SMMU_FD 364 /* Exynos4x12 only */ | ||
| 199 | #define CLK_SMMU_LITE0 365 /* Exynos4x12 only */ | ||
| 200 | #define CLK_SMMU_LITE1 366 /* Exynos4x12 only */ | ||
| 201 | #define CLK_MCUCTL_ISP 367 /* Exynos4x12 only */ | ||
| 202 | #define CLK_MPWM_ISP 368 /* Exynos4x12 only */ | ||
| 203 | #define CLK_I2C0_ISP 369 /* Exynos4x12 only */ | ||
| 204 | #define CLK_I2C1_ISP 370 /* Exynos4x12 only */ | ||
| 205 | #define CLK_MTCADC_ISP 371 /* Exynos4x12 only */ | ||
| 206 | #define CLK_PWM_ISP 372 /* Exynos4x12 only */ | ||
| 207 | #define CLK_WDT_ISP 373 /* Exynos4x12 only */ | ||
| 208 | #define CLK_UART_ISP 374 /* Exynos4x12 only */ | ||
| 209 | #define CLK_ASYNCAXIM 375 /* Exynos4x12 only */ | ||
| 210 | #define CLK_SMMU_ISPCX 376 /* Exynos4x12 only */ | ||
| 211 | #define CLK_SPI0_ISP 377 /* Exynos4x12 only */ | ||
| 212 | #define CLK_SPI1_ISP 378 /* Exynos4x12 only */ | ||
| 213 | #define CLK_PWM_ISP_SCLK 379 /* Exynos4x12 only */ | ||
| 214 | #define CLK_SPI0_ISP_SCLK 380 /* Exynos4x12 only */ | ||
| 215 | #define CLK_SPI1_ISP_SCLK 381 /* Exynos4x12 only */ | ||
| 216 | #define CLK_UART_ISP_SCLK 382 /* Exynos4x12 only */ | ||
| 217 | #define CLK_TMU_APBIF 383 | ||
| 218 | |||
| 219 | /* mux clocks */ | ||
| 220 | #define CLK_MOUT_FIMC0 384 | ||
| 221 | #define CLK_MOUT_FIMC1 385 | ||
| 222 | #define CLK_MOUT_FIMC2 386 | ||
| 223 | #define CLK_MOUT_FIMC3 387 | ||
| 224 | #define CLK_MOUT_CAM0 388 | ||
| 225 | #define CLK_MOUT_CAM1 389 | ||
| 226 | #define CLK_MOUT_CSIS0 390 | ||
| 227 | #define CLK_MOUT_CSIS1 391 | ||
| 228 | #define CLK_MOUT_G3D0 392 | ||
| 229 | #define CLK_MOUT_G3D1 393 | ||
| 230 | #define CLK_MOUT_G3D 394 | ||
| 231 | #define CLK_ACLK400_MCUISP 395 /* Exynos4x12 only */ | ||
| 232 | |||
| 233 | /* div clocks */ | ||
| 234 | #define CLK_DIV_ISP0 450 /* Exynos4x12 only */ | ||
| 235 | #define CLK_DIV_ISP1 451 /* Exynos4x12 only */ | ||
| 236 | #define CLK_DIV_MCUISP0 452 /* Exynos4x12 only */ | ||
| 237 | #define CLK_DIV_MCUISP1 453 /* Exynos4x12 only */ | ||
| 238 | #define CLK_DIV_ACLK200 454 /* Exynos4x12 only */ | ||
| 239 | #define CLK_DIV_ACLK400_MCUISP 455 /* Exynos4x12 only */ | ||
| 240 | |||
| 241 | /* must be greater than maximal clock id */ | ||
| 242 | #define CLK_NR_CLKS 456 | ||
| 243 | |||
| 244 | #endif /* _DT_BINDINGS_CLOCK_EXYNOS_4_H */ | ||
diff --git a/include/dt-bindings/clock/exynos5250.h b/include/dt-bindings/clock/exynos5250.h new file mode 100644 index 000000000000..922f2dca9bf0 --- /dev/null +++ b/include/dt-bindings/clock/exynos5250.h | |||
| @@ -0,0 +1,160 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. | ||
| 3 | * Author: Andrzej Haja <a.hajda@samsung.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * Device Tree binding constants for Exynos5250 clock controller. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef _DT_BINDINGS_CLOCK_EXYNOS_5250_H | ||
| 13 | #define _DT_BINDINGS_CLOCK_EXYNOS_5250_H | ||
| 14 | |||
| 15 | /* core clocks */ | ||
| 16 | #define CLK_FIN_PLL 1 | ||
| 17 | #define CLK_FOUT_APLL 2 | ||
| 18 | #define CLK_FOUT_MPLL 3 | ||
| 19 | #define CLK_FOUT_BPLL 4 | ||
| 20 | #define CLK_FOUT_GPLL 5 | ||
| 21 | #define CLK_FOUT_CPLL 6 | ||
| 22 | #define CLK_FOUT_EPLL 7 | ||
| 23 | #define CLK_FOUT_VPLL 8 | ||
| 24 | |||
| 25 | /* gate for special clocks (sclk) */ | ||
| 26 | #define CLK_SCLK_CAM_BAYER 128 | ||
| 27 | #define CLK_SCLK_CAM0 129 | ||
| 28 | #define CLK_SCLK_CAM1 130 | ||
| 29 | #define CLK_SCLK_GSCL_WA 131 | ||
| 30 | #define CLK_SCLK_GSCL_WB 132 | ||
| 31 | #define CLK_SCLK_FIMD1 133 | ||
| 32 | #define CLK_SCLK_MIPI1 134 | ||
| 33 | #define CLK_SCLK_DP 135 | ||
| 34 | #define CLK_SCLK_HDMI 136 | ||
| 35 | #define CLK_SCLK_PIXEL 137 | ||
| 36 | #define CLK_SCLK_AUDIO0 138 | ||
| 37 | #define CLK_SCLK_MMC0 139 | ||
| 38 | #define CLK_SCLK_MMC1 140 | ||
| 39 | #define CLK_SCLK_MMC2 141 | ||
| 40 | #define CLK_SCLK_MMC3 142 | ||
| 41 | #define CLK_SCLK_SATA 143 | ||
| 42 | #define CLK_SCLK_USB3 144 | ||
| 43 | #define CLK_SCLK_JPEG 145 | ||
| 44 | #define CLK_SCLK_UART0 146 | ||
| 45 | #define CLK_SCLK_UART1 147 | ||
| 46 | #define CLK_SCLK_UART2 148 | ||
| 47 | #define CLK_SCLK_UART3 149 | ||
| 48 | #define CLK_SCLK_PWM 150 | ||
| 49 | #define CLK_SCLK_AUDIO1 151 | ||
| 50 | #define CLK_SCLK_AUDIO2 152 | ||
| 51 | #define CLK_SCLK_SPDIF 153 | ||
| 52 | #define CLK_SCLK_SPI0 154 | ||
| 53 | #define CLK_SCLK_SPI1 155 | ||
| 54 | #define CLK_SCLK_SPI2 156 | ||
| 55 | #define CLK_DIV_I2S1 157 | ||
| 56 | #define CLK_DIV_I2S2 158 | ||
| 57 | #define CLK_SCLK_HDMIPHY 159 | ||
| 58 | #define CLK_DIV_PCM0 160 | ||
| 59 | |||
| 60 | /* gate clocks */ | ||
| 61 | #define CLK_GSCL0 256 | ||
| 62 | #define CLK_GSCL1 257 | ||
| 63 | #define CLK_GSCL2 258 | ||
| 64 | #define CLK_GSCL3 259 | ||
| 65 | #define CLK_GSCL_WA 260 | ||
| 66 | #define CLK_GSCL_WB 261 | ||
| 67 | #define CLK_SMMU_GSCL0 262 | ||
| 68 | #define CLK_SMMU_GSCL1 263 | ||
| 69 | #define CLK_SMMU_GSCL2 264 | ||
| 70 | #define CLK_SMMU_GSCL3 265 | ||
| 71 | #define CLK_MFC 266 | ||
| 72 | #define CLK_SMMU_MFCL 267 | ||
| 73 | #define CLK_SMMU_MFCR 268 | ||
| 74 | #define CLK_ROTATOR 269 | ||
| 75 | #define CLK_JPEG 270 | ||
| 76 | #define CLK_MDMA1 271 | ||
| 77 | #define CLK_SMMU_ROTATOR 272 | ||
| 78 | #define CLK_SMMU_JPEG 273 | ||
| 79 | #define CLK_SMMU_MDMA1 274 | ||
| 80 | #define CLK_PDMA0 275 | ||
| 81 | #define CLK_PDMA1 276 | ||
| 82 | #define CLK_SATA 277 | ||
| 83 | #define CLK_USBOTG 278 | ||
| 84 | #define CLK_MIPI_HSI 279 | ||
| 85 | #define CLK_SDMMC0 280 | ||
| 86 | #define CLK_SDMMC1 281 | ||
| 87 | #define CLK_SDMMC2 282 | ||
| 88 | #define CLK_SDMMC3 283 | ||
| 89 | #define CLK_SROMC 284 | ||
| 90 | #define CLK_USB2 285 | ||
| 91 | #define CLK_USB3 286 | ||
| 92 | #define CLK_SATA_PHYCTRL 287 | ||
| 93 | #define CLK_SATA_PHYI2C 288 | ||
| 94 | #define CLK_UART0 289 | ||
| 95 | #define CLK_UART1 290 | ||
| 96 | #define CLK_UART2 291 | ||
| 97 | #define CLK_UART3 292 | ||
| 98 | #define CLK_UART4 293 | ||
| 99 | #define CLK_I2C0 294 | ||
| 100 | #define CLK_I2C1 295 | ||
| 101 | #define CLK_I2C2 296 | ||
| 102 | #define CLK_I2C3 297 | ||
| 103 | #define CLK_I2C4 298 | ||
| 104 | #define CLK_I2C5 299 | ||
| 105 | #define CLK_I2C6 300 | ||
| 106 | #define CLK_I2C7 301 | ||
| 107 | #define CLK_I2C_HDMI 302 | ||
| 108 | #define CLK_ADC 303 | ||
| 109 | #define CLK_SPI0 304 | ||
| 110 | #define CLK_SPI1 305 | ||
| 111 | #define CLK_SPI2 306 | ||
| 112 | #define CLK_I2S1 307 | ||
| 113 | #define CLK_I2S2 308 | ||
| 114 | #define CLK_PCM1 309 | ||
| 115 | #define CLK_PCM2 310 | ||
| 116 | #define CLK_PWM 311 | ||
| 117 | #define CLK_SPDIF 312 | ||
| 118 | #define CLK_AC97 313 | ||
| 119 | #define CLK_HSI2C0 314 | ||
| 120 | #define CLK_HSI2C1 315 | ||
| 121 | #define CLK_HSI2C2 316 | ||
| 122 | #define CLK_HSI2C3 317 | ||
| 123 | #define CLK_CHIPID 318 | ||
| 124 | #define CLK_SYSREG 319 | ||
| 125 | #define CLK_PMU 320 | ||
| 126 | #define CLK_CMU_TOP 321 | ||
| 127 | #define CLK_CMU_CORE 322 | ||
| 128 | #define CLK_CMU_MEM 323 | ||
| 129 | #define CLK_TZPC0 324 | ||
| 130 | #define CLK_TZPC1 325 | ||
| 131 | #define CLK_TZPC2 326 | ||
| 132 | #define CLK_TZPC3 327 | ||
| 133 | #define CLK_TZPC4 328 | ||
| 134 | #define CLK_TZPC5 329 | ||
| 135 | #define CLK_TZPC6 330 | ||
| 136 | #define CLK_TZPC7 331 | ||
| 137 | #define CLK_TZPC8 332 | ||
| 138 | #define CLK_TZPC9 333 | ||
| 139 | #define CLK_HDMI_CEC 334 | ||
| 140 | #define CLK_MCT 335 | ||
| 141 | #define CLK_WDT 336 | ||
| 142 | #define CLK_RTC 337 | ||
| 143 | #define CLK_TMU 338 | ||
| 144 | #define CLK_FIMD1 339 | ||
| 145 | #define CLK_MIE1 340 | ||
| 146 | #define CLK_DSIM0 341 | ||
| 147 | #define CLK_DP 342 | ||
| 148 | #define CLK_MIXER 343 | ||
| 149 | #define CLK_HDMI 344 | ||
| 150 | #define CLK_G2D 345 | ||
| 151 | #define CLK_MDMA0 346 | ||
| 152 | #define CLK_SMMU_MDMA0 347 | ||
| 153 | |||
| 154 | /* mux clocks */ | ||
| 155 | #define CLK_MOUT_HDMI 1024 | ||
| 156 | |||
| 157 | /* must be greater than maximal clock id */ | ||
| 158 | #define CLK_NR_CLKS 1025 | ||
| 159 | |||
| 160 | #endif /* _DT_BINDINGS_CLOCK_EXYNOS_5250_H */ | ||
diff --git a/include/dt-bindings/clock/exynos5420.h b/include/dt-bindings/clock/exynos5420.h new file mode 100644 index 000000000000..5eefd8813f02 --- /dev/null +++ b/include/dt-bindings/clock/exynos5420.h | |||
| @@ -0,0 +1,188 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. | ||
| 3 | * Author: Andrzej Haja <a.hajda@samsung.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * Device Tree binding constants for Exynos5420 clock controller. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef _DT_BINDINGS_CLOCK_EXYNOS_5420_H | ||
| 13 | #define _DT_BINDINGS_CLOCK_EXYNOS_5420_H | ||
| 14 | |||
| 15 | /* core clocks */ | ||
| 16 | #define CLK_FIN_PLL 1 | ||
| 17 | #define CLK_FOUT_APLL 2 | ||
| 18 | #define CLK_FOUT_CPLL 3 | ||
| 19 | #define CLK_FOUT_DPLL 4 | ||
| 20 | #define CLK_FOUT_EPLL 5 | ||
| 21 | #define CLK_FOUT_RPLL 6 | ||
| 22 | #define CLK_FOUT_IPLL 7 | ||
| 23 | #define CLK_FOUT_SPLL 8 | ||
| 24 | #define CLK_FOUT_VPLL 9 | ||
| 25 | #define CLK_FOUT_MPLL 10 | ||
| 26 | #define CLK_FOUT_BPLL 11 | ||
| 27 | #define CLK_FOUT_KPLL 12 | ||
| 28 | |||
| 29 | /* gate for special clocks (sclk) */ | ||
| 30 | #define CLK_SCLK_UART0 128 | ||
| 31 | #define CLK_SCLK_UART1 129 | ||
| 32 | #define CLK_SCLK_UART2 130 | ||
| 33 | #define CLK_SCLK_UART3 131 | ||
| 34 | #define CLK_SCLK_MMC0 132 | ||
| 35 | #define CLK_SCLK_MMC1 133 | ||
| 36 | #define CLK_SCLK_MMC2 134 | ||
| 37 | #define CLK_SCLK_SPI0 135 | ||
| 38 | #define CLK_SCLK_SPI1 136 | ||
| 39 | #define CLK_SCLK_SPI2 137 | ||
| 40 | #define CLK_SCLK_I2S1 138 | ||
| 41 | #define CLK_SCLK_I2S2 139 | ||
| 42 | #define CLK_SCLK_PCM1 140 | ||
| 43 | #define CLK_SCLK_PCM2 141 | ||
| 44 | #define CLK_SCLK_SPDIF 142 | ||
| 45 | #define CLK_SCLK_HDMI 143 | ||
| 46 | #define CLK_SCLK_PIXEL 144 | ||
| 47 | #define CLK_SCLK_DP1 145 | ||
| 48 | #define CLK_SCLK_MIPI1 146 | ||
| 49 | #define CLK_SCLK_FIMD1 147 | ||
| 50 | #define CLK_SCLK_MAUDIO0 148 | ||
| 51 | #define CLK_SCLK_MAUPCM0 149 | ||
| 52 | #define CLK_SCLK_USBD300 150 | ||
| 53 | #define CLK_SCLK_USBD301 151 | ||
| 54 | #define CLK_SCLK_USBPHY300 152 | ||
| 55 | #define CLK_SCLK_USBPHY301 153 | ||
| 56 | #define CLK_SCLK_UNIPRO 154 | ||
| 57 | #define CLK_SCLK_PWM 155 | ||
| 58 | #define CLK_SCLK_GSCL_WA 156 | ||
| 59 | #define CLK_SCLK_GSCL_WB 157 | ||
| 60 | #define CLK_SCLK_HDMIPHY 158 | ||
| 61 | |||
| 62 | /* gate clocks */ | ||
| 63 | #define CLK_ACLK66_PERIC 256 | ||
| 64 | #define CLK_UART0 257 | ||
| 65 | #define CLK_UART1 258 | ||
| 66 | #define CLK_UART2 259 | ||
| 67 | #define CLK_UART3 260 | ||
| 68 | #define CLK_I2C0 261 | ||
| 69 | #define CLK_I2C1 262 | ||
| 70 | #define CLK_I2C2 263 | ||
| 71 | #define CLK_I2C3 264 | ||
| 72 | #define CLK_I2C4 265 | ||
| 73 | #define CLK_I2C5 266 | ||
| 74 | #define CLK_I2C6 267 | ||
| 75 | #define CLK_I2C7 268 | ||
| 76 | #define CLK_I2C_HDMI 269 | ||
| 77 | #define CLK_TSADC 270 | ||
| 78 | #define CLK_SPI0 271 | ||
| 79 | #define CLK_SPI1 272 | ||
| 80 | #define CLK_SPI2 273 | ||
| 81 | #define CLK_KEYIF 274 | ||
| 82 | #define CLK_I2S1 275 | ||
| 83 | #define CLK_I2S2 276 | ||
| 84 | #define CLK_PCM1 277 | ||
| 85 | #define CLK_PCM2 278 | ||
| 86 | #define CLK_PWM 279 | ||
| 87 | #define CLK_SPDIF 280 | ||
| 88 | #define CLK_I2C8 281 | ||
| 89 | #define CLK_I2C9 282 | ||
| 90 | #define CLK_I2C10 283 | ||
| 91 | #define CLK_ACLK66_PSGEN 300 | ||
| 92 | #define CLK_CHIPID 301 | ||
| 93 | #define CLK_SYSREG 302 | ||
| 94 | #define CLK_TZPC0 303 | ||
| 95 | #define CLK_TZPC1 304 | ||
| 96 | #define CLK_TZPC2 305 | ||
| 97 | #define CLK_TZPC3 306 | ||
| 98 | #define CLK_TZPC4 307 | ||
| 99 | #define CLK_TZPC5 308 | ||
| 100 | #define CLK_TZPC6 309 | ||
| 101 | #define CLK_TZPC7 310 | ||
| 102 | #define CLK_TZPC8 311 | ||
| 103 | #define CLK_TZPC9 312 | ||
| 104 | #define CLK_HDMI_CEC 313 | ||
| 105 | #define CLK_SECKEY 314 | ||
| 106 | #define CLK_MCT 315 | ||
| 107 | #define CLK_WDT 316 | ||
| 108 | #define CLK_RTC 317 | ||
| 109 | #define CLK_TMU 318 | ||
| 110 | #define CLK_TMU_GPU 319 | ||
| 111 | #define CLK_PCLK66_GPIO 330 | ||
| 112 | #define CLK_ACLK200_FSYS2 350 | ||
| 113 | #define CLK_MMC0 351 | ||
| 114 | #define CLK_MMC1 352 | ||
| 115 | #define CLK_MMC2 353 | ||
| 116 | #define CLK_SROMC 354 | ||
| 117 | #define CLK_UFS 355 | ||
| 118 | #define CLK_ACLK200_FSYS 360 | ||
| 119 | #define CLK_TSI 361 | ||
| 120 | #define CLK_PDMA0 362 | ||
| 121 | #define CLK_PDMA1 363 | ||
| 122 | #define CLK_RTIC 364 | ||
| 123 | #define CLK_USBH20 365 | ||
| 124 | #define CLK_USBD300 366 | ||
| 125 | #define CLK_USBD301 367 | ||
| 126 | #define CLK_ACLK400_MSCL 380 | ||
| 127 | #define CLK_MSCL0 381 | ||
| 128 | #define CLK_MSCL1 382 | ||
| 129 | #define CLK_MSCL2 383 | ||
| 130 | #define CLK_SMMU_MSCL0 384 | ||
| 131 | #define CLK_SMMU_MSCL1 385 | ||
| 132 | #define CLK_SMMU_MSCL2 386 | ||
| 133 | #define CLK_ACLK333 400 | ||
| 134 | #define CLK_MFC 401 | ||
| 135 | #define CLK_SMMU_MFCL 402 | ||
| 136 | #define CLK_SMMU_MFCR 403 | ||
| 137 | #define CLK_ACLK200_DISP1 410 | ||
| 138 | #define CLK_DSIM1 411 | ||
| 139 | #define CLK_DP1 412 | ||
| 140 | #define CLK_HDMI 413 | ||
| 141 | #define CLK_ACLK300_DISP1 420 | ||
| 142 | #define CLK_FIMD1 421 | ||
| 143 | #define CLK_SMMU_FIMD1 422 | ||
| 144 | #define CLK_ACLK166 430 | ||
| 145 | #define CLK_MIXER 431 | ||
| 146 | #define CLK_ACLK266 440 | ||
| 147 | #define CLK_ROTATOR 441 | ||
| 148 | #define CLK_MDMA1 442 | ||
| 149 | #define CLK_SMMU_ROTATOR 443 | ||
| 150 | #define CLK_SMMU_MDMA1 444 | ||
| 151 | #define CLK_ACLK300_JPEG 450 | ||
| 152 | #define CLK_JPEG 451 | ||
| 153 | #define CLK_JPEG2 452 | ||
| 154 | #define CLK_SMMU_JPEG 453 | ||
| 155 | #define CLK_ACLK300_GSCL 460 | ||
| 156 | #define CLK_SMMU_GSCL0 461 | ||
| 157 | #define CLK_SMMU_GSCL1 462 | ||
| 158 | #define CLK_GSCL_WA 463 | ||
| 159 | #define CLK_GSCL_WB 464 | ||
| 160 | #define CLK_GSCL0 465 | ||
| 161 | #define CLK_GSCL1 466 | ||
| 162 | #define CLK_CLK_3AA 467 | ||
| 163 | #define CLK_ACLK266_G2D 470 | ||
| 164 | #define CLK_SSS 471 | ||
| 165 | #define CLK_SLIM_SSS 472 | ||
| 166 | #define CLK_MDMA0 473 | ||
| 167 | #define CLK_ACLK333_G2D 480 | ||
| 168 | #define CLK_G2D 481 | ||
| 169 | #define CLK_ACLK333_432_GSCL 490 | ||
| 170 | #define CLK_SMMU_3AA 491 | ||
| 171 | #define CLK_SMMU_FIMCL0 492 | ||
| 172 | #define CLK_SMMU_FIMCL1 493 | ||
| 173 | #define CLK_SMMU_FIMCL3 494 | ||
| 174 | #define CLK_FIMC_LITE3 495 | ||
| 175 | #define CLK_ACLK_G3D 500 | ||
| 176 | #define CLK_G3D 501 | ||
| 177 | #define CLK_SMMU_MIXER 502 | ||
| 178 | |||
| 179 | /* mux clocks */ | ||
| 180 | #define CLK_MOUT_HDMI 640 | ||
| 181 | |||
| 182 | /* divider clocks */ | ||
| 183 | #define CLK_DOUT_PIXEL 768 | ||
| 184 | |||
| 185 | /* must be greater than maximal clock id */ | ||
| 186 | #define CLK_NR_CLKS 769 | ||
| 187 | |||
| 188 | #endif /* _DT_BINDINGS_CLOCK_EXYNOS_5420_H */ | ||
diff --git a/include/dt-bindings/clock/exynos5440.h b/include/dt-bindings/clock/exynos5440.h new file mode 100644 index 000000000000..70cd85077fa9 --- /dev/null +++ b/include/dt-bindings/clock/exynos5440.h | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. | ||
| 3 | * Author: Andrzej Haja <a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> | ||
| 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 | * Device Tree binding constants for Exynos5440 clock controller. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef _DT_BINDINGS_CLOCK_EXYNOS_5440_H | ||
| 13 | #define _DT_BINDINGS_CLOCK_EXYNOS_5440_H | ||
| 14 | |||
| 15 | #define CLK_XTAL 1 | ||
| 16 | #define CLK_ARM_CLK 2 | ||
| 17 | #define CLK_SPI_BAUD 16 | ||
| 18 | #define CLK_PB0_250 17 | ||
| 19 | #define CLK_PR0_250 18 | ||
| 20 | #define CLK_PR1_250 19 | ||
| 21 | #define CLK_B_250 20 | ||
| 22 | #define CLK_B_125 21 | ||
| 23 | #define CLK_B_200 22 | ||
| 24 | #define CLK_SATA 23 | ||
| 25 | #define CLK_USB 24 | ||
| 26 | #define CLK_GMAC0 25 | ||
| 27 | #define CLK_CS250 26 | ||
| 28 | #define CLK_PB0_250_O 27 | ||
| 29 | #define CLK_PR0_250_O 28 | ||
| 30 | #define CLK_PR1_250_O 29 | ||
| 31 | #define CLK_B_250_O 30 | ||
| 32 | #define CLK_B_125_O 31 | ||
| 33 | #define CLK_B_200_O 32 | ||
| 34 | #define CLK_SATA_O 33 | ||
| 35 | #define CLK_USB_O 34 | ||
| 36 | #define CLK_GMAC0_O 35 | ||
| 37 | #define CLK_CS250_O 36 | ||
| 38 | |||
| 39 | /* must be greater than maximal clock id */ | ||
| 40 | #define CLK_NR_CLKS 37 | ||
| 41 | |||
| 42 | #endif /* _DT_BINDINGS_CLOCK_EXYNOS_5440_H */ | ||
diff --git a/include/dt-bindings/clock/hi3620-clock.h b/include/dt-bindings/clock/hi3620-clock.h new file mode 100644 index 000000000000..6eaa6a45e110 --- /dev/null +++ b/include/dt-bindings/clock/hi3620-clock.h | |||
| @@ -0,0 +1,152 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2012-2013 Hisilicon Limited. | ||
| 3 | * Copyright (c) 2012-2013 Linaro Limited. | ||
| 4 | * | ||
| 5 | * Author: Haojian Zhuang <haojian.zhuang@linaro.org> | ||
| 6 | * Xin Li <li.xin@linaro.org> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License along | ||
| 19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 21 | * | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef __DTS_HI3620_CLOCK_H | ||
| 25 | #define __DTS_HI3620_CLOCK_H | ||
| 26 | |||
| 27 | #define HI3620_NONE_CLOCK 0 | ||
| 28 | |||
| 29 | /* fixed rate & fixed factor clocks */ | ||
| 30 | #define HI3620_OSC32K 1 | ||
| 31 | #define HI3620_OSC26M 2 | ||
| 32 | #define HI3620_PCLK 3 | ||
| 33 | #define HI3620_PLL_ARM0 4 | ||
| 34 | #define HI3620_PLL_ARM1 5 | ||
| 35 | #define HI3620_PLL_PERI 6 | ||
| 36 | #define HI3620_PLL_USB 7 | ||
| 37 | #define HI3620_PLL_HDMI 8 | ||
| 38 | #define HI3620_PLL_GPU 9 | ||
| 39 | #define HI3620_RCLK_TCXO 10 | ||
| 40 | #define HI3620_RCLK_CFGAXI 11 | ||
| 41 | #define HI3620_RCLK_PICO 12 | ||
| 42 | |||
| 43 | /* mux clocks */ | ||
| 44 | #define HI3620_TIMER0_MUX 32 | ||
| 45 | #define HI3620_TIMER1_MUX 33 | ||
| 46 | #define HI3620_TIMER2_MUX 34 | ||
| 47 | #define HI3620_TIMER3_MUX 35 | ||
| 48 | #define HI3620_TIMER4_MUX 36 | ||
| 49 | #define HI3620_TIMER5_MUX 37 | ||
| 50 | #define HI3620_TIMER6_MUX 38 | ||
| 51 | #define HI3620_TIMER7_MUX 39 | ||
| 52 | #define HI3620_TIMER8_MUX 40 | ||
| 53 | #define HI3620_TIMER9_MUX 41 | ||
| 54 | #define HI3620_UART0_MUX 42 | ||
| 55 | #define HI3620_UART1_MUX 43 | ||
| 56 | #define HI3620_UART2_MUX 44 | ||
| 57 | #define HI3620_UART3_MUX 45 | ||
| 58 | #define HI3620_UART4_MUX 46 | ||
| 59 | #define HI3620_SPI0_MUX 47 | ||
| 60 | #define HI3620_SPI1_MUX 48 | ||
| 61 | #define HI3620_SPI2_MUX 49 | ||
| 62 | #define HI3620_SAXI_MUX 50 | ||
| 63 | #define HI3620_PWM0_MUX 51 | ||
| 64 | #define HI3620_PWM1_MUX 52 | ||
| 65 | #define HI3620_SD_MUX 53 | ||
| 66 | #define HI3620_MMC1_MUX 54 | ||
| 67 | #define HI3620_MMC1_MUX2 55 | ||
| 68 | #define HI3620_G2D_MUX 56 | ||
| 69 | #define HI3620_VENC_MUX 57 | ||
| 70 | #define HI3620_VDEC_MUX 58 | ||
| 71 | #define HI3620_VPP_MUX 59 | ||
| 72 | #define HI3620_EDC0_MUX 60 | ||
| 73 | #define HI3620_LDI0_MUX 61 | ||
| 74 | #define HI3620_EDC1_MUX 62 | ||
| 75 | #define HI3620_LDI1_MUX 63 | ||
| 76 | #define HI3620_RCLK_HSIC 64 | ||
| 77 | #define HI3620_MMC2_MUX 65 | ||
| 78 | #define HI3620_MMC3_MUX 66 | ||
| 79 | |||
| 80 | /* divider clocks */ | ||
| 81 | #define HI3620_SHAREAXI_DIV 128 | ||
| 82 | #define HI3620_CFGAXI_DIV 129 | ||
| 83 | #define HI3620_SD_DIV 130 | ||
| 84 | #define HI3620_MMC1_DIV 131 | ||
| 85 | #define HI3620_HSIC_DIV 132 | ||
| 86 | #define HI3620_MMC2_DIV 133 | ||
| 87 | #define HI3620_MMC3_DIV 134 | ||
| 88 | |||
| 89 | /* gate clocks */ | ||
| 90 | #define HI3620_TIMERCLK01 160 | ||
| 91 | #define HI3620_TIMER_RCLK01 161 | ||
| 92 | #define HI3620_TIMERCLK23 162 | ||
| 93 | #define HI3620_TIMER_RCLK23 163 | ||
| 94 | #define HI3620_TIMERCLK45 164 | ||
| 95 | #define HI3620_TIMERCLK67 165 | ||
| 96 | #define HI3620_TIMERCLK89 166 | ||
| 97 | #define HI3620_RTCCLK 167 | ||
| 98 | #define HI3620_KPC_CLK 168 | ||
| 99 | #define HI3620_GPIOCLK0 169 | ||
| 100 | #define HI3620_GPIOCLK1 170 | ||
| 101 | #define HI3620_GPIOCLK2 171 | ||
| 102 | #define HI3620_GPIOCLK3 172 | ||
| 103 | #define HI3620_GPIOCLK4 173 | ||
| 104 | #define HI3620_GPIOCLK5 174 | ||
| 105 | #define HI3620_GPIOCLK6 175 | ||
| 106 | #define HI3620_GPIOCLK7 176 | ||
| 107 | #define HI3620_GPIOCLK8 177 | ||
| 108 | #define HI3620_GPIOCLK9 178 | ||
| 109 | #define HI3620_GPIOCLK10 179 | ||
| 110 | #define HI3620_GPIOCLK11 180 | ||
| 111 | #define HI3620_GPIOCLK12 181 | ||
| 112 | #define HI3620_GPIOCLK13 182 | ||
| 113 | #define HI3620_GPIOCLK14 183 | ||
| 114 | #define HI3620_GPIOCLK15 184 | ||
| 115 | #define HI3620_GPIOCLK16 185 | ||
| 116 | #define HI3620_GPIOCLK17 186 | ||
| 117 | #define HI3620_GPIOCLK18 187 | ||
| 118 | #define HI3620_GPIOCLK19 188 | ||
| 119 | #define HI3620_GPIOCLK20 189 | ||
| 120 | #define HI3620_GPIOCLK21 190 | ||
| 121 | #define HI3620_DPHY0_CLK 191 | ||
| 122 | #define HI3620_DPHY1_CLK 192 | ||
| 123 | #define HI3620_DPHY2_CLK 193 | ||
| 124 | #define HI3620_USBPHY_CLK 194 | ||
| 125 | #define HI3620_ACP_CLK 195 | ||
| 126 | #define HI3620_PWMCLK0 196 | ||
| 127 | #define HI3620_PWMCLK1 197 | ||
| 128 | #define HI3620_UARTCLK0 198 | ||
| 129 | #define HI3620_UARTCLK1 199 | ||
| 130 | #define HI3620_UARTCLK2 200 | ||
| 131 | #define HI3620_UARTCLK3 201 | ||
| 132 | #define HI3620_UARTCLK4 202 | ||
| 133 | #define HI3620_SPICLK0 203 | ||
| 134 | #define HI3620_SPICLK1 204 | ||
| 135 | #define HI3620_SPICLK2 205 | ||
| 136 | #define HI3620_I2CCLK0 206 | ||
| 137 | #define HI3620_I2CCLK1 207 | ||
| 138 | #define HI3620_I2CCLK2 208 | ||
| 139 | #define HI3620_I2CCLK3 209 | ||
| 140 | #define HI3620_SCI_CLK 210 | ||
| 141 | #define HI3620_DDRC_PER_CLK 211 | ||
| 142 | #define HI3620_DMAC_CLK 212 | ||
| 143 | #define HI3620_USB2DVC_CLK 213 | ||
| 144 | #define HI3620_SD_CLK 214 | ||
| 145 | #define HI3620_MMC_CLK1 215 | ||
| 146 | #define HI3620_MMC_CLK2 216 | ||
| 147 | #define HI3620_MMC_CLK3 217 | ||
| 148 | #define HI3620_MCU_CLK 218 | ||
| 149 | |||
| 150 | #define HI3620_NR_CLKS 219 | ||
| 151 | |||
| 152 | #endif /* __DTS_HI3620_CLOCK_H */ | ||
diff --git a/include/dt-bindings/clock/imx5-clock.h b/include/dt-bindings/clock/imx5-clock.h new file mode 100644 index 000000000000..5f2667ecd98e --- /dev/null +++ b/include/dt-bindings/clock/imx5-clock.h | |||
| @@ -0,0 +1,203 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2013 Lucas Stach, Pengutronix <l.stach@pengutronix.de> | ||
| 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 | |||
| 10 | #ifndef __DT_BINDINGS_CLOCK_IMX5_H | ||
| 11 | #define __DT_BINDINGS_CLOCK_IMX5_H | ||
| 12 | |||
| 13 | #define IMX5_CLK_DUMMY 0 | ||
| 14 | #define IMX5_CLK_CKIL 1 | ||
| 15 | #define IMX5_CLK_OSC 2 | ||
| 16 | #define IMX5_CLK_CKIH1 3 | ||
| 17 | #define IMX5_CLK_CKIH2 4 | ||
| 18 | #define IMX5_CLK_AHB 5 | ||
| 19 | #define IMX5_CLK_IPG 6 | ||
| 20 | #define IMX5_CLK_AXI_A 7 | ||
| 21 | #define IMX5_CLK_AXI_B 8 | ||
| 22 | #define IMX5_CLK_UART_PRED 9 | ||
| 23 | #define IMX5_CLK_UART_ROOT 10 | ||
| 24 | #define IMX5_CLK_ESDHC_A_PRED 11 | ||
| 25 | #define IMX5_CLK_ESDHC_B_PRED 12 | ||
| 26 | #define IMX5_CLK_ESDHC_C_SEL 13 | ||
| 27 | #define IMX5_CLK_ESDHC_D_SEL 14 | ||
| 28 | #define IMX5_CLK_EMI_SEL 15 | ||
| 29 | #define IMX5_CLK_EMI_SLOW_PODF 16 | ||
| 30 | #define IMX5_CLK_NFC_PODF 17 | ||
| 31 | #define IMX5_CLK_ECSPI_PRED 18 | ||
| 32 | #define IMX5_CLK_ECSPI_PODF 19 | ||
| 33 | #define IMX5_CLK_USBOH3_PRED 20 | ||
| 34 | #define IMX5_CLK_USBOH3_PODF 21 | ||
| 35 | #define IMX5_CLK_USB_PHY_PRED 22 | ||
| 36 | #define IMX5_CLK_USB_PHY_PODF 23 | ||
| 37 | #define IMX5_CLK_CPU_PODF 24 | ||
| 38 | #define IMX5_CLK_DI_PRED 25 | ||
| 39 | #define IMX5_CLK_TVE_SEL 27 | ||
| 40 | #define IMX5_CLK_UART1_IPG_GATE 28 | ||
| 41 | #define IMX5_CLK_UART1_PER_GATE 29 | ||
| 42 | #define IMX5_CLK_UART2_IPG_GATE 30 | ||
| 43 | #define IMX5_CLK_UART2_PER_GATE 31 | ||
| 44 | #define IMX5_CLK_UART3_IPG_GATE 32 | ||
| 45 | #define IMX5_CLK_UART3_PER_GATE 33 | ||
| 46 | #define IMX5_CLK_I2C1_GATE 34 | ||
| 47 | #define IMX5_CLK_I2C2_GATE 35 | ||
| 48 | #define IMX5_CLK_GPT_IPG_GATE 36 | ||
| 49 | #define IMX5_CLK_PWM1_IPG_GATE 37 | ||
| 50 | #define IMX5_CLK_PWM1_HF_GATE 38 | ||
| 51 | #define IMX5_CLK_PWM2_IPG_GATE 39 | ||
| 52 | #define IMX5_CLK_PWM2_HF_GATE 40 | ||
| 53 | #define IMX5_CLK_GPT_HF_GATE 41 | ||
| 54 | #define IMX5_CLK_FEC_GATE 42 | ||
| 55 | #define IMX5_CLK_USBOH3_PER_GATE 43 | ||
| 56 | #define IMX5_CLK_ESDHC1_IPG_GATE 44 | ||
| 57 | #define IMX5_CLK_ESDHC2_IPG_GATE 45 | ||
| 58 | #define IMX5_CLK_ESDHC3_IPG_GATE 46 | ||
| 59 | #define IMX5_CLK_ESDHC4_IPG_GATE 47 | ||
| 60 | #define IMX5_CLK_SSI1_IPG_GATE 48 | ||
| 61 | #define IMX5_CLK_SSI2_IPG_GATE 49 | ||
| 62 | #define IMX5_CLK_SSI3_IPG_GATE 50 | ||
| 63 | #define IMX5_CLK_ECSPI1_IPG_GATE 51 | ||
| 64 | #define IMX5_CLK_ECSPI1_PER_GATE 52 | ||
| 65 | #define IMX5_CLK_ECSPI2_IPG_GATE 53 | ||
| 66 | #define IMX5_CLK_ECSPI2_PER_GATE 54 | ||
| 67 | #define IMX5_CLK_CSPI_IPG_GATE 55 | ||
| 68 | #define IMX5_CLK_SDMA_GATE 56 | ||
| 69 | #define IMX5_CLK_EMI_SLOW_GATE 57 | ||
| 70 | #define IMX5_CLK_IPU_SEL 58 | ||
| 71 | #define IMX5_CLK_IPU_GATE 59 | ||
| 72 | #define IMX5_CLK_NFC_GATE 60 | ||
| 73 | #define IMX5_CLK_IPU_DI1_GATE 61 | ||
| 74 | #define IMX5_CLK_VPU_SEL 62 | ||
| 75 | #define IMX5_CLK_VPU_GATE 63 | ||
| 76 | #define IMX5_CLK_VPU_REFERENCE_GATE 64 | ||
| 77 | #define IMX5_CLK_UART4_IPG_GATE 65 | ||
| 78 | #define IMX5_CLK_UART4_PER_GATE 66 | ||
| 79 | #define IMX5_CLK_UART5_IPG_GATE 67 | ||
| 80 | #define IMX5_CLK_UART5_PER_GATE 68 | ||
| 81 | #define IMX5_CLK_TVE_GATE 69 | ||
| 82 | #define IMX5_CLK_TVE_PRED 70 | ||
| 83 | #define IMX5_CLK_ESDHC1_PER_GATE 71 | ||
| 84 | #define IMX5_CLK_ESDHC2_PER_GATE 72 | ||
| 85 | #define IMX5_CLK_ESDHC3_PER_GATE 73 | ||
| 86 | #define IMX5_CLK_ESDHC4_PER_GATE 74 | ||
| 87 | #define IMX5_CLK_USB_PHY_GATE 75 | ||
| 88 | #define IMX5_CLK_HSI2C_GATE 76 | ||
| 89 | #define IMX5_CLK_MIPI_HSC1_GATE 77 | ||
| 90 | #define IMX5_CLK_MIPI_HSC2_GATE 78 | ||
| 91 | #define IMX5_CLK_MIPI_ESC_GATE 79 | ||
| 92 | #define IMX5_CLK_MIPI_HSP_GATE 80 | ||
| 93 | #define IMX5_CLK_LDB_DI1_DIV_3_5 81 | ||
| 94 | #define IMX5_CLK_LDB_DI1_DIV 82 | ||
| 95 | #define IMX5_CLK_LDB_DI0_DIV_3_5 83 | ||
| 96 | #define IMX5_CLK_LDB_DI0_DIV 84 | ||
| 97 | #define IMX5_CLK_LDB_DI1_GATE 85 | ||
| 98 | #define IMX5_CLK_CAN2_SERIAL_GATE 86 | ||
| 99 | #define IMX5_CLK_CAN2_IPG_GATE 87 | ||
| 100 | #define IMX5_CLK_I2C3_GATE 88 | ||
| 101 | #define IMX5_CLK_LP_APM 89 | ||
| 102 | #define IMX5_CLK_PERIPH_APM 90 | ||
| 103 | #define IMX5_CLK_MAIN_BUS 91 | ||
| 104 | #define IMX5_CLK_AHB_MAX 92 | ||
| 105 | #define IMX5_CLK_AIPS_TZ1 93 | ||
| 106 | #define IMX5_CLK_AIPS_TZ2 94 | ||
| 107 | #define IMX5_CLK_TMAX1 95 | ||
| 108 | #define IMX5_CLK_TMAX2 96 | ||
| 109 | #define IMX5_CLK_TMAX3 97 | ||
| 110 | #define IMX5_CLK_SPBA 98 | ||
| 111 | #define IMX5_CLK_UART_SEL 99 | ||
| 112 | #define IMX5_CLK_ESDHC_A_SEL 100 | ||
| 113 | #define IMX5_CLK_ESDHC_B_SEL 101 | ||
| 114 | #define IMX5_CLK_ESDHC_A_PODF 102 | ||
| 115 | #define IMX5_CLK_ESDHC_B_PODF 103 | ||
| 116 | #define IMX5_CLK_ECSPI_SEL 104 | ||
| 117 | #define IMX5_CLK_USBOH3_SEL 105 | ||
| 118 | #define IMX5_CLK_USB_PHY_SEL 106 | ||
| 119 | #define IMX5_CLK_IIM_GATE 107 | ||
| 120 | #define IMX5_CLK_USBOH3_GATE 108 | ||
| 121 | #define IMX5_CLK_EMI_FAST_GATE 109 | ||
| 122 | #define IMX5_CLK_IPU_DI0_GATE 110 | ||
| 123 | #define IMX5_CLK_GPC_DVFS 111 | ||
| 124 | #define IMX5_CLK_PLL1_SW 112 | ||
| 125 | #define IMX5_CLK_PLL2_SW 113 | ||
| 126 | #define IMX5_CLK_PLL3_SW 114 | ||
| 127 | #define IMX5_CLK_IPU_DI0_SEL 115 | ||
| 128 | #define IMX5_CLK_IPU_DI1_SEL 116 | ||
| 129 | #define IMX5_CLK_TVE_EXT_SEL 117 | ||
| 130 | #define IMX5_CLK_MX51_MIPI 118 | ||
| 131 | #define IMX5_CLK_PLL4_SW 119 | ||
| 132 | #define IMX5_CLK_LDB_DI1_SEL 120 | ||
| 133 | #define IMX5_CLK_DI_PLL4_PODF 121 | ||
| 134 | #define IMX5_CLK_LDB_DI0_SEL 122 | ||
| 135 | #define IMX5_CLK_LDB_DI0_GATE 123 | ||
| 136 | #define IMX5_CLK_USB_PHY1_GATE 124 | ||
| 137 | #define IMX5_CLK_USB_PHY2_GATE 125 | ||
| 138 | #define IMX5_CLK_PER_LP_APM 126 | ||
| 139 | #define IMX5_CLK_PER_PRED1 127 | ||
| 140 | #define IMX5_CLK_PER_PRED2 128 | ||
| 141 | #define IMX5_CLK_PER_PODF 129 | ||
| 142 | #define IMX5_CLK_PER_ROOT 130 | ||
| 143 | #define IMX5_CLK_SSI_APM 131 | ||
| 144 | #define IMX5_CLK_SSI1_ROOT_SEL 132 | ||
| 145 | #define IMX5_CLK_SSI2_ROOT_SEL 133 | ||
| 146 | #define IMX5_CLK_SSI3_ROOT_SEL 134 | ||
| 147 | #define IMX5_CLK_SSI_EXT1_SEL 135 | ||
| 148 | #define IMX5_CLK_SSI_EXT2_SEL 136 | ||
| 149 | #define IMX5_CLK_SSI_EXT1_COM_SEL 137 | ||
| 150 | #define IMX5_CLK_SSI_EXT2_COM_SEL 138 | ||
| 151 | #define IMX5_CLK_SSI1_ROOT_PRED 139 | ||
| 152 | #define IMX5_CLK_SSI1_ROOT_PODF 140 | ||
| 153 | #define IMX5_CLK_SSI2_ROOT_PRED 141 | ||
| 154 | #define IMX5_CLK_SSI2_ROOT_PODF 142 | ||
| 155 | #define IMX5_CLK_SSI_EXT1_PRED 143 | ||
| 156 | #define IMX5_CLK_SSI_EXT1_PODF 144 | ||
| 157 | #define IMX5_CLK_SSI_EXT2_PRED 145 | ||
| 158 | #define IMX5_CLK_SSI_EXT2_PODF 146 | ||
| 159 | #define IMX5_CLK_SSI1_ROOT_GATE 147 | ||
| 160 | #define IMX5_CLK_SSI2_ROOT_GATE 148 | ||
| 161 | #define IMX5_CLK_SSI3_ROOT_GATE 149 | ||
| 162 | #define IMX5_CLK_SSI_EXT1_GATE 150 | ||
| 163 | #define IMX5_CLK_SSI_EXT2_GATE 151 | ||
| 164 | #define IMX5_CLK_EPIT1_IPG_GATE 152 | ||
| 165 | #define IMX5_CLK_EPIT1_HF_GATE 153 | ||
| 166 | #define IMX5_CLK_EPIT2_IPG_GATE 154 | ||
| 167 | #define IMX5_CLK_EPIT2_HF_GATE 155 | ||
| 168 | #define IMX5_CLK_CAN_SEL 156 | ||
| 169 | #define IMX5_CLK_CAN1_SERIAL_GATE 157 | ||
| 170 | #define IMX5_CLK_CAN1_IPG_GATE 158 | ||
| 171 | #define IMX5_CLK_OWIRE_GATE 159 | ||
| 172 | #define IMX5_CLK_GPU3D_SEL 160 | ||
| 173 | #define IMX5_CLK_GPU2D_SEL 161 | ||
| 174 | #define IMX5_CLK_GPU3D_GATE 162 | ||
| 175 | #define IMX5_CLK_GPU2D_GATE 163 | ||
| 176 | #define IMX5_CLK_GARB_GATE 164 | ||
| 177 | #define IMX5_CLK_CKO1_SEL 165 | ||
| 178 | #define IMX5_CLK_CKO1_PODF 166 | ||
| 179 | #define IMX5_CLK_CKO1 167 | ||
| 180 | #define IMX5_CLK_CKO2_SEL 168 | ||
| 181 | #define IMX5_CLK_CKO2_PODF 169 | ||
| 182 | #define IMX5_CLK_CKO2 170 | ||
| 183 | #define IMX5_CLK_SRTC_GATE 171 | ||
| 184 | #define IMX5_CLK_PATA_GATE 172 | ||
| 185 | #define IMX5_CLK_SATA_GATE 173 | ||
| 186 | #define IMX5_CLK_SPDIF_XTAL_SEL 174 | ||
| 187 | #define IMX5_CLK_SPDIF0_SEL 175 | ||
| 188 | #define IMX5_CLK_SPDIF1_SEL 176 | ||
| 189 | #define IMX5_CLK_SPDIF0_PRED 177 | ||
| 190 | #define IMX5_CLK_SPDIF0_PODF 178 | ||
| 191 | #define IMX5_CLK_SPDIF1_PRED 179 | ||
| 192 | #define IMX5_CLK_SPDIF1_PODF 180 | ||
| 193 | #define IMX5_CLK_SPDIF0_COM_SEL 181 | ||
| 194 | #define IMX5_CLK_SPDIF1_COM_SEL 182 | ||
| 195 | #define IMX5_CLK_SPDIF0_GATE 183 | ||
| 196 | #define IMX5_CLK_SPDIF1_GATE 184 | ||
| 197 | #define IMX5_CLK_SPDIF_IPG_GATE 185 | ||
| 198 | #define IMX5_CLK_OCRAM 186 | ||
| 199 | #define IMX5_CLK_SAHARA_IPG_GATE 187 | ||
| 200 | #define IMX5_CLK_SATA_REF 188 | ||
| 201 | #define IMX5_CLK_END 189 | ||
| 202 | |||
| 203 | #endif /* __DT_BINDINGS_CLOCK_IMX5_H */ | ||
diff --git a/include/dt-bindings/clock/imx6sl-clock.h b/include/dt-bindings/clock/imx6sl-clock.h index 7fcdf90879f2..7cf5c9969336 100644 --- a/include/dt-bindings/clock/imx6sl-clock.h +++ b/include/dt-bindings/clock/imx6sl-clock.h | |||
| @@ -143,6 +143,8 @@ | |||
| 143 | #define IMX6SL_CLK_USDHC2 130 | 143 | #define IMX6SL_CLK_USDHC2 130 |
| 144 | #define IMX6SL_CLK_USDHC3 131 | 144 | #define IMX6SL_CLK_USDHC3 131 |
| 145 | #define IMX6SL_CLK_USDHC4 132 | 145 | #define IMX6SL_CLK_USDHC4 132 |
| 146 | #define IMX6SL_CLK_CLK_END 133 | 146 | #define IMX6SL_CLK_PLL4_AUDIO_DIV 133 |
| 147 | #define IMX6SL_CLK_SPBA 134 | ||
| 148 | #define IMX6SL_CLK_END 135 | ||
| 147 | 149 | ||
| 148 | #endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */ | 150 | #endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */ |
diff --git a/include/dt-bindings/clock/qcom,gcc-msm8660.h b/include/dt-bindings/clock/qcom,gcc-msm8660.h new file mode 100644 index 000000000000..67665f6813dd --- /dev/null +++ b/include/dt-bindings/clock/qcom,gcc-msm8660.h | |||
| @@ -0,0 +1,276 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_CLK_MSM_GCC_8660_H | ||
| 15 | #define _DT_BINDINGS_CLK_MSM_GCC_8660_H | ||
| 16 | |||
| 17 | #define AFAB_CLK_SRC 0 | ||
| 18 | #define AFAB_CORE_CLK 1 | ||
| 19 | #define SCSS_A_CLK 2 | ||
| 20 | #define SCSS_H_CLK 3 | ||
| 21 | #define SCSS_XO_SRC_CLK 4 | ||
| 22 | #define AFAB_EBI1_CH0_A_CLK 5 | ||
| 23 | #define AFAB_EBI1_CH1_A_CLK 6 | ||
| 24 | #define AFAB_AXI_S0_FCLK 7 | ||
| 25 | #define AFAB_AXI_S1_FCLK 8 | ||
| 26 | #define AFAB_AXI_S2_FCLK 9 | ||
| 27 | #define AFAB_AXI_S3_FCLK 10 | ||
| 28 | #define AFAB_AXI_S4_FCLK 11 | ||
| 29 | #define SFAB_CORE_CLK 12 | ||
| 30 | #define SFAB_AXI_S0_FCLK 13 | ||
| 31 | #define SFAB_AXI_S1_FCLK 14 | ||
| 32 | #define SFAB_AXI_S2_FCLK 15 | ||
| 33 | #define SFAB_AXI_S3_FCLK 16 | ||
| 34 | #define SFAB_AXI_S4_FCLK 17 | ||
| 35 | #define SFAB_AHB_S0_FCLK 18 | ||
| 36 | #define SFAB_AHB_S1_FCLK 19 | ||
| 37 | #define SFAB_AHB_S2_FCLK 20 | ||
| 38 | #define SFAB_AHB_S3_FCLK 21 | ||
| 39 | #define SFAB_AHB_S4_FCLK 22 | ||
| 40 | #define SFAB_AHB_S5_FCLK 23 | ||
| 41 | #define SFAB_AHB_S6_FCLK 24 | ||
| 42 | #define SFAB_ADM0_M0_A_CLK 25 | ||
| 43 | #define SFAB_ADM0_M1_A_CLK 26 | ||
| 44 | #define SFAB_ADM0_M2_A_CLK 27 | ||
| 45 | #define ADM0_CLK 28 | ||
| 46 | #define ADM0_PBUS_CLK 29 | ||
| 47 | #define SFAB_ADM1_M0_A_CLK 30 | ||
| 48 | #define SFAB_ADM1_M1_A_CLK 31 | ||
| 49 | #define SFAB_ADM1_M2_A_CLK 32 | ||
| 50 | #define MMFAB_ADM1_M3_A_CLK 33 | ||
| 51 | #define ADM1_CLK 34 | ||
| 52 | #define ADM1_PBUS_CLK 35 | ||
| 53 | #define IMEM0_A_CLK 36 | ||
| 54 | #define MAHB0_CLK 37 | ||
| 55 | #define SFAB_LPASS_Q6_A_CLK 38 | ||
| 56 | #define SFAB_AFAB_M_A_CLK 39 | ||
| 57 | #define AFAB_SFAB_M0_A_CLK 40 | ||
| 58 | #define AFAB_SFAB_M1_A_CLK 41 | ||
| 59 | #define DFAB_CLK_SRC 42 | ||
| 60 | #define DFAB_CLK 43 | ||
| 61 | #define DFAB_CORE_CLK 44 | ||
| 62 | #define SFAB_DFAB_M_A_CLK 45 | ||
| 63 | #define DFAB_SFAB_M_A_CLK 46 | ||
| 64 | #define DFAB_SWAY0_H_CLK 47 | ||
| 65 | #define DFAB_SWAY1_H_CLK 48 | ||
| 66 | #define DFAB_ARB0_H_CLK 49 | ||
| 67 | #define DFAB_ARB1_H_CLK 50 | ||
| 68 | #define PPSS_H_CLK 51 | ||
| 69 | #define PPSS_PROC_CLK 52 | ||
| 70 | #define PPSS_TIMER0_CLK 53 | ||
| 71 | #define PPSS_TIMER1_CLK 54 | ||
| 72 | #define PMEM_A_CLK 55 | ||
| 73 | #define DMA_BAM_H_CLK 56 | ||
| 74 | #define SIC_H_CLK 57 | ||
| 75 | #define SPS_TIC_H_CLK 58 | ||
| 76 | #define SLIMBUS_H_CLK 59 | ||
| 77 | #define SLIMBUS_XO_SRC_CLK 60 | ||
| 78 | #define CFPB_2X_CLK_SRC 61 | ||
| 79 | #define CFPB_CLK 62 | ||
| 80 | #define CFPB0_H_CLK 63 | ||
| 81 | #define CFPB1_H_CLK 64 | ||
| 82 | #define CFPB2_H_CLK 65 | ||
| 83 | #define EBI2_2X_CLK 66 | ||
| 84 | #define EBI2_CLK 67 | ||
| 85 | #define SFAB_CFPB_M_H_CLK 68 | ||
| 86 | #define CFPB_MASTER_H_CLK 69 | ||
| 87 | #define SFAB_CFPB_S_HCLK 70 | ||
| 88 | #define CFPB_SPLITTER_H_CLK 71 | ||
| 89 | #define TSIF_H_CLK 72 | ||
| 90 | #define TSIF_INACTIVITY_TIMERS_CLK 73 | ||
| 91 | #define TSIF_REF_SRC 74 | ||
| 92 | #define TSIF_REF_CLK 75 | ||
| 93 | #define CE1_H_CLK 76 | ||
| 94 | #define CE2_H_CLK 77 | ||
| 95 | #define SFPB_H_CLK_SRC 78 | ||
| 96 | #define SFPB_H_CLK 79 | ||
| 97 | #define SFAB_SFPB_M_H_CLK 80 | ||
| 98 | #define SFAB_SFPB_S_H_CLK 81 | ||
| 99 | #define RPM_PROC_CLK 82 | ||
| 100 | #define RPM_BUS_H_CLK 83 | ||
| 101 | #define RPM_SLEEP_CLK 84 | ||
| 102 | #define RPM_TIMER_CLK 85 | ||
| 103 | #define MODEM_AHB1_H_CLK 86 | ||
| 104 | #define MODEM_AHB2_H_CLK 87 | ||
| 105 | #define RPM_MSG_RAM_H_CLK 88 | ||
| 106 | #define SC_H_CLK 89 | ||
| 107 | #define SC_A_CLK 90 | ||
| 108 | #define PMIC_ARB0_H_CLK 91 | ||
| 109 | #define PMIC_ARB1_H_CLK 92 | ||
| 110 | #define PMIC_SSBI2_SRC 93 | ||
| 111 | #define PMIC_SSBI2_CLK 94 | ||
| 112 | #define SDC1_H_CLK 95 | ||
| 113 | #define SDC2_H_CLK 96 | ||
| 114 | #define SDC3_H_CLK 97 | ||
| 115 | #define SDC4_H_CLK 98 | ||
| 116 | #define SDC5_H_CLK 99 | ||
| 117 | #define SDC1_SRC 100 | ||
| 118 | #define SDC2_SRC 101 | ||
| 119 | #define SDC3_SRC 102 | ||
| 120 | #define SDC4_SRC 103 | ||
| 121 | #define SDC5_SRC 104 | ||
| 122 | #define SDC1_CLK 105 | ||
| 123 | #define SDC2_CLK 106 | ||
| 124 | #define SDC3_CLK 107 | ||
| 125 | #define SDC4_CLK 108 | ||
| 126 | #define SDC5_CLK 109 | ||
| 127 | #define USB_HS1_H_CLK 110 | ||
| 128 | #define USB_HS1_XCVR_SRC 111 | ||
| 129 | #define USB_HS1_XCVR_CLK 112 | ||
| 130 | #define USB_HS2_H_CLK 113 | ||
| 131 | #define USB_HS2_XCVR_SRC 114 | ||
| 132 | #define USB_HS2_XCVR_CLK 115 | ||
| 133 | #define USB_FS1_H_CLK 116 | ||
| 134 | #define USB_FS1_XCVR_FS_SRC 117 | ||
| 135 | #define USB_FS1_XCVR_FS_CLK 118 | ||
| 136 | #define USB_FS1_SYSTEM_CLK 119 | ||
| 137 | #define USB_FS2_H_CLK 120 | ||
| 138 | #define USB_FS2_XCVR_FS_SRC 121 | ||
| 139 | #define USB_FS2_XCVR_FS_CLK 122 | ||
| 140 | #define USB_FS2_SYSTEM_CLK 123 | ||
| 141 | #define GSBI_COMMON_SIM_SRC 124 | ||
| 142 | #define GSBI1_H_CLK 125 | ||
| 143 | #define GSBI2_H_CLK 126 | ||
| 144 | #define GSBI3_H_CLK 127 | ||
| 145 | #define GSBI4_H_CLK 128 | ||
| 146 | #define GSBI5_H_CLK 129 | ||
| 147 | #define GSBI6_H_CLK 130 | ||
| 148 | #define GSBI7_H_CLK 131 | ||
| 149 | #define GSBI8_H_CLK 132 | ||
| 150 | #define GSBI9_H_CLK 133 | ||
| 151 | #define GSBI10_H_CLK 134 | ||
| 152 | #define GSBI11_H_CLK 135 | ||
| 153 | #define GSBI12_H_CLK 136 | ||
| 154 | #define GSBI1_UART_SRC 137 | ||
| 155 | #define GSBI1_UART_CLK 138 | ||
| 156 | #define GSBI2_UART_SRC 139 | ||
| 157 | #define GSBI2_UART_CLK 140 | ||
| 158 | #define GSBI3_UART_SRC 141 | ||
| 159 | #define GSBI3_UART_CLK 142 | ||
| 160 | #define GSBI4_UART_SRC 143 | ||
| 161 | #define GSBI4_UART_CLK 144 | ||
| 162 | #define GSBI5_UART_SRC 145 | ||
| 163 | #define GSBI5_UART_CLK 146 | ||
| 164 | #define GSBI6_UART_SRC 147 | ||
| 165 | #define GSBI6_UART_CLK 148 | ||
| 166 | #define GSBI7_UART_SRC 149 | ||
| 167 | #define GSBI7_UART_CLK 150 | ||
| 168 | #define GSBI8_UART_SRC 151 | ||
| 169 | #define GSBI8_UART_CLK 152 | ||
| 170 | #define GSBI9_UART_SRC 153 | ||
| 171 | #define GSBI9_UART_CLK 154 | ||
| 172 | #define GSBI10_UART_SRC 155 | ||
| 173 | #define GSBI10_UART_CLK 156 | ||
| 174 | #define GSBI11_UART_SRC 157 | ||
| 175 | #define GSBI11_UART_CLK 158 | ||
| 176 | #define GSBI12_UART_SRC 159 | ||
| 177 | #define GSBI12_UART_CLK 160 | ||
| 178 | #define GSBI1_QUP_SRC 161 | ||
| 179 | #define GSBI1_QUP_CLK 162 | ||
| 180 | #define GSBI2_QUP_SRC 163 | ||
| 181 | #define GSBI2_QUP_CLK 164 | ||
| 182 | #define GSBI3_QUP_SRC 165 | ||
| 183 | #define GSBI3_QUP_CLK 166 | ||
| 184 | #define GSBI4_QUP_SRC 167 | ||
| 185 | #define GSBI4_QUP_CLK 168 | ||
| 186 | #define GSBI5_QUP_SRC 169 | ||
| 187 | #define GSBI5_QUP_CLK 170 | ||
| 188 | #define GSBI6_QUP_SRC 171 | ||
| 189 | #define GSBI6_QUP_CLK 172 | ||
| 190 | #define GSBI7_QUP_SRC 173 | ||
| 191 | #define GSBI7_QUP_CLK 174 | ||
| 192 | #define GSBI8_QUP_SRC 175 | ||
| 193 | #define GSBI8_QUP_CLK 176 | ||
| 194 | #define GSBI9_QUP_SRC 177 | ||
| 195 | #define GSBI9_QUP_CLK 178 | ||
| 196 | #define GSBI10_QUP_SRC 179 | ||
| 197 | #define GSBI10_QUP_CLK 180 | ||
| 198 | #define GSBI11_QUP_SRC 181 | ||
| 199 | #define GSBI11_QUP_CLK 182 | ||
| 200 | #define GSBI12_QUP_SRC 183 | ||
| 201 | #define GSBI12_QUP_CLK 184 | ||
| 202 | #define GSBI1_SIM_CLK 185 | ||
| 203 | #define GSBI2_SIM_CLK 186 | ||
| 204 | #define GSBI3_SIM_CLK 187 | ||
| 205 | #define GSBI4_SIM_CLK 188 | ||
| 206 | #define GSBI5_SIM_CLK 189 | ||
| 207 | #define GSBI6_SIM_CLK 190 | ||
| 208 | #define GSBI7_SIM_CLK 191 | ||
| 209 | #define GSBI8_SIM_CLK 192 | ||
| 210 | #define GSBI9_SIM_CLK 193 | ||
| 211 | #define GSBI10_SIM_CLK 194 | ||
| 212 | #define GSBI11_SIM_CLK 195 | ||
| 213 | #define GSBI12_SIM_CLK 196 | ||
| 214 | #define SPDM_CFG_H_CLK 197 | ||
| 215 | #define SPDM_MSTR_H_CLK 198 | ||
| 216 | #define SPDM_FF_CLK_SRC 199 | ||
| 217 | #define SPDM_FF_CLK 200 | ||
| 218 | #define SEC_CTRL_CLK 201 | ||
| 219 | #define SEC_CTRL_ACC_CLK_SRC 202 | ||
| 220 | #define SEC_CTRL_ACC_CLK 203 | ||
| 221 | #define TLMM_H_CLK 204 | ||
| 222 | #define TLMM_CLK 205 | ||
| 223 | #define MARM_CLK_SRC 206 | ||
| 224 | #define MARM_CLK 207 | ||
| 225 | #define MAHB1_SRC 208 | ||
| 226 | #define MAHB1_CLK 209 | ||
| 227 | #define SFAB_MSS_S_H_CLK 210 | ||
| 228 | #define MAHB2_SRC 211 | ||
| 229 | #define MAHB2_CLK 212 | ||
| 230 | #define MSS_MODEM_CLK_SRC 213 | ||
| 231 | #define MSS_MODEM_CXO_CLK 214 | ||
| 232 | #define MSS_SLP_CLK 215 | ||
| 233 | #define MSS_SYS_REF_CLK 216 | ||
| 234 | #define TSSC_CLK_SRC 217 | ||
| 235 | #define TSSC_CLK 218 | ||
| 236 | #define PDM_SRC 219 | ||
| 237 | #define PDM_CLK 220 | ||
| 238 | #define GP0_SRC 221 | ||
| 239 | #define GP0_CLK 222 | ||
| 240 | #define GP1_SRC 223 | ||
| 241 | #define GP1_CLK 224 | ||
| 242 | #define GP2_SRC 225 | ||
| 243 | #define GP2_CLK 226 | ||
| 244 | #define PMEM_CLK 227 | ||
| 245 | #define MPM_CLK 228 | ||
| 246 | #define EBI1_ASFAB_SRC 229 | ||
| 247 | #define EBI1_CLK_SRC 230 | ||
| 248 | #define EBI1_CH0_CLK 231 | ||
| 249 | #define EBI1_CH1_CLK 232 | ||
| 250 | #define SFAB_SMPSS_S_H_CLK 233 | ||
| 251 | #define PRNG_SRC 234 | ||
| 252 | #define PRNG_CLK 235 | ||
| 253 | #define PXO_SRC 236 | ||
| 254 | #define LPASS_CXO_CLK 237 | ||
| 255 | #define LPASS_PXO_CLK 238 | ||
| 256 | #define SPDM_CY_PORT0_CLK 239 | ||
| 257 | #define SPDM_CY_PORT1_CLK 240 | ||
| 258 | #define SPDM_CY_PORT2_CLK 241 | ||
| 259 | #define SPDM_CY_PORT3_CLK 242 | ||
| 260 | #define SPDM_CY_PORT4_CLK 243 | ||
| 261 | #define SPDM_CY_PORT5_CLK 244 | ||
| 262 | #define SPDM_CY_PORT6_CLK 245 | ||
| 263 | #define SPDM_CY_PORT7_CLK 246 | ||
| 264 | #define PLL0 247 | ||
| 265 | #define PLL0_VOTE 248 | ||
| 266 | #define PLL5 249 | ||
| 267 | #define PLL6 250 | ||
| 268 | #define PLL6_VOTE 251 | ||
| 269 | #define PLL8 252 | ||
| 270 | #define PLL8_VOTE 253 | ||
| 271 | #define PLL9 254 | ||
| 272 | #define PLL10 255 | ||
| 273 | #define PLL11 256 | ||
| 274 | #define PLL12 257 | ||
| 275 | |||
| 276 | #endif | ||
diff --git a/include/dt-bindings/clock/qcom,gcc-msm8960.h b/include/dt-bindings/clock/qcom,gcc-msm8960.h new file mode 100644 index 000000000000..03bbf49d43b7 --- /dev/null +++ b/include/dt-bindings/clock/qcom,gcc-msm8960.h | |||
| @@ -0,0 +1,313 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_CLK_MSM_GCC_8960_H | ||
| 15 | #define _DT_BINDINGS_CLK_MSM_GCC_8960_H | ||
| 16 | |||
| 17 | #define AFAB_CLK_SRC 0 | ||
| 18 | #define AFAB_CORE_CLK 1 | ||
| 19 | #define SFAB_MSS_Q6_SW_A_CLK 2 | ||
| 20 | #define SFAB_MSS_Q6_FW_A_CLK 3 | ||
| 21 | #define QDSS_STM_CLK 4 | ||
| 22 | #define SCSS_A_CLK 5 | ||
| 23 | #define SCSS_H_CLK 6 | ||
| 24 | #define SCSS_XO_SRC_CLK 7 | ||
| 25 | #define AFAB_EBI1_CH0_A_CLK 8 | ||
| 26 | #define AFAB_EBI1_CH1_A_CLK 9 | ||
| 27 | #define AFAB_AXI_S0_FCLK 10 | ||
| 28 | #define AFAB_AXI_S1_FCLK 11 | ||
| 29 | #define AFAB_AXI_S2_FCLK 12 | ||
| 30 | #define AFAB_AXI_S3_FCLK 13 | ||
| 31 | #define AFAB_AXI_S4_FCLK 14 | ||
| 32 | #define SFAB_CORE_CLK 15 | ||
| 33 | #define SFAB_AXI_S0_FCLK 16 | ||
| 34 | #define SFAB_AXI_S1_FCLK 17 | ||
| 35 | #define SFAB_AXI_S2_FCLK 18 | ||
| 36 | #define SFAB_AXI_S3_FCLK 19 | ||
| 37 | #define SFAB_AXI_S4_FCLK 20 | ||
| 38 | #define SFAB_AHB_S0_FCLK 21 | ||
| 39 | #define SFAB_AHB_S1_FCLK 22 | ||
| 40 | #define SFAB_AHB_S2_FCLK 23 | ||
| 41 | #define SFAB_AHB_S3_FCLK 24 | ||
| 42 | #define SFAB_AHB_S4_FCLK 25 | ||
| 43 | #define SFAB_AHB_S5_FCLK 26 | ||
| 44 | #define SFAB_AHB_S6_FCLK 27 | ||
| 45 | #define SFAB_AHB_S7_FCLK 28 | ||
| 46 | #define QDSS_AT_CLK_SRC 29 | ||
| 47 | #define QDSS_AT_CLK 30 | ||
| 48 | #define QDSS_TRACECLKIN_CLK_SRC 31 | ||
| 49 | #define QDSS_TRACECLKIN_CLK 32 | ||
| 50 | #define QDSS_TSCTR_CLK_SRC 33 | ||
| 51 | #define QDSS_TSCTR_CLK 34 | ||
| 52 | #define SFAB_ADM0_M0_A_CLK 35 | ||
| 53 | #define SFAB_ADM0_M1_A_CLK 36 | ||
| 54 | #define SFAB_ADM0_M2_A_CLK 37 | ||
| 55 | #define ADM0_CLK 38 | ||
| 56 | #define ADM0_PBUS_CLK 39 | ||
| 57 | #define MSS_XPU_CLK 40 | ||
| 58 | #define IMEM0_A_CLK 41 | ||
| 59 | #define QDSS_H_CLK 42 | ||
| 60 | #define PCIE_A_CLK 43 | ||
| 61 | #define PCIE_AUX_CLK 44 | ||
| 62 | #define PCIE_PHY_REF_CLK 45 | ||
| 63 | #define PCIE_H_CLK 46 | ||
| 64 | #define SFAB_CLK_SRC 47 | ||
| 65 | #define MAHB0_CLK 48 | ||
| 66 | #define Q6SW_CLK_SRC 49 | ||
| 67 | #define Q6SW_CLK 50 | ||
| 68 | #define Q6FW_CLK_SRC 51 | ||
| 69 | #define Q6FW_CLK 52 | ||
| 70 | #define SFAB_MSS_M_A_CLK 53 | ||
| 71 | #define SFAB_USB3_M_A_CLK 54 | ||
| 72 | #define SFAB_LPASS_Q6_A_CLK 55 | ||
| 73 | #define SFAB_AFAB_M_A_CLK 56 | ||
| 74 | #define AFAB_SFAB_M0_A_CLK 57 | ||
| 75 | #define AFAB_SFAB_M1_A_CLK 58 | ||
| 76 | #define SFAB_SATA_S_H_CLK 59 | ||
| 77 | #define DFAB_CLK_SRC 60 | ||
| 78 | #define DFAB_CLK 61 | ||
| 79 | #define SFAB_DFAB_M_A_CLK 62 | ||
| 80 | #define DFAB_SFAB_M_A_CLK 63 | ||
| 81 | #define DFAB_SWAY0_H_CLK 64 | ||
| 82 | #define DFAB_SWAY1_H_CLK 65 | ||
| 83 | #define DFAB_ARB0_H_CLK 66 | ||
| 84 | #define DFAB_ARB1_H_CLK 67 | ||
| 85 | #define PPSS_H_CLK 68 | ||
| 86 | #define PPSS_PROC_CLK 69 | ||
| 87 | #define PPSS_TIMER0_CLK 70 | ||
| 88 | #define PPSS_TIMER1_CLK 71 | ||
| 89 | #define PMEM_A_CLK 72 | ||
| 90 | #define DMA_BAM_H_CLK 73 | ||
| 91 | #define SIC_H_CLK 74 | ||
| 92 | #define SPS_TIC_H_CLK 75 | ||
| 93 | #define SLIMBUS_H_CLK 76 | ||
| 94 | #define SLIMBUS_XO_SRC_CLK 77 | ||
| 95 | #define CFPB_2X_CLK_SRC 78 | ||
| 96 | #define CFPB_CLK 79 | ||
| 97 | #define CFPB0_H_CLK 80 | ||
| 98 | #define CFPB1_H_CLK 81 | ||
| 99 | #define CFPB2_H_CLK 82 | ||
| 100 | #define SFAB_CFPB_M_H_CLK 83 | ||
| 101 | #define CFPB_MASTER_H_CLK 84 | ||
| 102 | #define SFAB_CFPB_S_HCLK 85 | ||
| 103 | #define CFPB_SPLITTER_H_CLK 86 | ||
| 104 | #define TSIF_H_CLK 87 | ||
| 105 | #define TSIF_INACTIVITY_TIMERS_CLK 88 | ||
| 106 | #define TSIF_REF_SRC 89 | ||
| 107 | #define TSIF_REF_CLK 90 | ||
| 108 | #define CE1_H_CLK 91 | ||
| 109 | #define CE1_CORE_CLK 92 | ||
| 110 | #define CE1_SLEEP_CLK 93 | ||
| 111 | #define CE2_H_CLK 94 | ||
| 112 | #define CE2_CORE_CLK 95 | ||
| 113 | #define CE2_SLEEP_CLK 96 | ||
| 114 | #define SFPB_H_CLK_SRC 97 | ||
| 115 | #define SFPB_H_CLK 98 | ||
| 116 | #define SFAB_SFPB_M_H_CLK 99 | ||
| 117 | #define SFAB_SFPB_S_H_CLK 100 | ||
| 118 | #define RPM_PROC_CLK 101 | ||
| 119 | #define RPM_BUS_H_CLK 102 | ||
| 120 | #define RPM_SLEEP_CLK 103 | ||
| 121 | #define RPM_TIMER_CLK 104 | ||
| 122 | #define RPM_MSG_RAM_H_CLK 105 | ||
| 123 | #define PMIC_ARB0_H_CLK 106 | ||
| 124 | #define PMIC_ARB1_H_CLK 107 | ||
| 125 | #define PMIC_SSBI2_SRC 108 | ||
| 126 | #define PMIC_SSBI2_CLK 109 | ||
| 127 | #define SDC1_H_CLK 110 | ||
| 128 | #define SDC2_H_CLK 111 | ||
| 129 | #define SDC3_H_CLK 112 | ||
| 130 | #define SDC4_H_CLK 113 | ||
| 131 | #define SDC5_H_CLK 114 | ||
| 132 | #define SDC1_SRC 115 | ||
| 133 | #define SDC2_SRC 116 | ||
| 134 | #define SDC3_SRC 117 | ||
| 135 | #define SDC4_SRC 118 | ||
| 136 | #define SDC5_SRC 119 | ||
| 137 | #define SDC1_CLK 120 | ||
| 138 | #define SDC2_CLK 121 | ||
| 139 | #define SDC3_CLK 122 | ||
| 140 | #define SDC4_CLK 123 | ||
| 141 | #define SDC5_CLK 124 | ||
| 142 | #define DFAB_A2_H_CLK 125 | ||
| 143 | #define USB_HS1_H_CLK 126 | ||
| 144 | #define USB_HS1_XCVR_SRC 127 | ||
| 145 | #define USB_HS1_XCVR_CLK 128 | ||
| 146 | #define USB_HSIC_H_CLK 129 | ||
| 147 | #define USB_HSIC_XCVR_FS_SRC 130 | ||
| 148 | #define USB_HSIC_XCVR_FS_CLK 131 | ||
| 149 | #define USB_HSIC_SYSTEM_CLK_SRC 132 | ||
| 150 | #define USB_HSIC_SYSTEM_CLK 133 | ||
| 151 | #define CFPB0_C0_H_CLK 134 | ||
| 152 | #define CFPB0_C1_H_CLK 135 | ||
| 153 | #define CFPB0_D0_H_CLK 136 | ||
| 154 | #define CFPB0_D1_H_CLK 137 | ||
| 155 | #define USB_FS1_H_CLK 138 | ||
| 156 | #define USB_FS1_XCVR_FS_SRC 139 | ||
| 157 | #define USB_FS1_XCVR_FS_CLK 140 | ||
| 158 | #define USB_FS1_SYSTEM_CLK 141 | ||
| 159 | #define USB_FS2_H_CLK 142 | ||
| 160 | #define USB_FS2_XCVR_FS_SRC 143 | ||
| 161 | #define USB_FS2_XCVR_FS_CLK 144 | ||
| 162 | #define USB_FS2_SYSTEM_CLK 145 | ||
| 163 | #define GSBI_COMMON_SIM_SRC 146 | ||
| 164 | #define GSBI1_H_CLK 147 | ||
| 165 | #define GSBI2_H_CLK 148 | ||
| 166 | #define GSBI3_H_CLK 149 | ||
| 167 | #define GSBI4_H_CLK 150 | ||
| 168 | #define GSBI5_H_CLK 151 | ||
| 169 | #define GSBI6_H_CLK 152 | ||
| 170 | #define GSBI7_H_CLK 153 | ||
| 171 | #define GSBI8_H_CLK 154 | ||
| 172 | #define GSBI9_H_CLK 155 | ||
| 173 | #define GSBI10_H_CLK 156 | ||
| 174 | #define GSBI11_H_CLK 157 | ||
| 175 | #define GSBI12_H_CLK 158 | ||
| 176 | #define GSBI1_UART_SRC 159 | ||
| 177 | #define GSBI1_UART_CLK 160 | ||
| 178 | #define GSBI2_UART_SRC 161 | ||
| 179 | #define GSBI2_UART_CLK 162 | ||
| 180 | #define GSBI3_UART_SRC 163 | ||
| 181 | #define GSBI3_UART_CLK 164 | ||
| 182 | #define GSBI4_UART_SRC 165 | ||
| 183 | #define GSBI4_UART_CLK 166 | ||
| 184 | #define GSBI5_UART_SRC 167 | ||
| 185 | #define GSBI5_UART_CLK 168 | ||
| 186 | #define GSBI6_UART_SRC 169 | ||
| 187 | #define GSBI6_UART_CLK 170 | ||
| 188 | #define GSBI7_UART_SRC 171 | ||
| 189 | #define GSBI7_UART_CLK 172 | ||
| 190 | #define GSBI8_UART_SRC 173 | ||
| 191 | #define GSBI8_UART_CLK 174 | ||
| 192 | #define GSBI9_UART_SRC 175 | ||
| 193 | #define GSBI9_UART_CLK 176 | ||
| 194 | #define GSBI10_UART_SRC 177 | ||
| 195 | #define GSBI10_UART_CLK 178 | ||
| 196 | #define GSBI11_UART_SRC 179 | ||
| 197 | #define GSBI11_UART_CLK 180 | ||
| 198 | #define GSBI12_UART_SRC 181 | ||
| 199 | #define GSBI12_UART_CLK 182 | ||
| 200 | #define GSBI1_QUP_SRC 183 | ||
| 201 | #define GSBI1_QUP_CLK 184 | ||
| 202 | #define GSBI2_QUP_SRC 185 | ||
| 203 | #define GSBI2_QUP_CLK 186 | ||
| 204 | #define GSBI3_QUP_SRC 187 | ||
| 205 | #define GSBI3_QUP_CLK 188 | ||
| 206 | #define GSBI4_QUP_SRC 189 | ||
| 207 | #define GSBI4_QUP_CLK 190 | ||
| 208 | #define GSBI5_QUP_SRC 191 | ||
| 209 | #define GSBI5_QUP_CLK 192 | ||
| 210 | #define GSBI6_QUP_SRC 193 | ||
| 211 | #define GSBI6_QUP_CLK 194 | ||
| 212 | #define GSBI7_QUP_SRC 195 | ||
| 213 | #define GSBI7_QUP_CLK 196 | ||
| 214 | #define GSBI8_QUP_SRC 197 | ||
| 215 | #define GSBI8_QUP_CLK 198 | ||
| 216 | #define GSBI9_QUP_SRC 199 | ||
| 217 | #define GSBI9_QUP_CLK 200 | ||
| 218 | #define GSBI10_QUP_SRC 201 | ||
| 219 | #define GSBI10_QUP_CLK 202 | ||
| 220 | #define GSBI11_QUP_SRC 203 | ||
| 221 | #define GSBI11_QUP_CLK 204 | ||
| 222 | #define GSBI12_QUP_SRC 205 | ||
| 223 | #define GSBI12_QUP_CLK 206 | ||
| 224 | #define GSBI1_SIM_CLK 207 | ||
| 225 | #define GSBI2_SIM_CLK 208 | ||
| 226 | #define GSBI3_SIM_CLK 209 | ||
| 227 | #define GSBI4_SIM_CLK 210 | ||
| 228 | #define GSBI5_SIM_CLK 211 | ||
| 229 | #define GSBI6_SIM_CLK 212 | ||
| 230 | #define GSBI7_SIM_CLK 213 | ||
| 231 | #define GSBI8_SIM_CLK 214 | ||
| 232 | #define GSBI9_SIM_CLK 215 | ||
| 233 | #define GSBI10_SIM_CLK 216 | ||
| 234 | #define GSBI11_SIM_CLK 217 | ||
| 235 | #define GSBI12_SIM_CLK 218 | ||
| 236 | #define USB_HSIC_HSIC_CLK_SRC 219 | ||
| 237 | #define USB_HSIC_HSIC_CLK 220 | ||
| 238 | #define USB_HSIC_HSIO_CAL_CLK 221 | ||
| 239 | #define SPDM_CFG_H_CLK 222 | ||
| 240 | #define SPDM_MSTR_H_CLK 223 | ||
| 241 | #define SPDM_FF_CLK_SRC 224 | ||
| 242 | #define SPDM_FF_CLK 225 | ||
| 243 | #define SEC_CTRL_CLK 226 | ||
| 244 | #define SEC_CTRL_ACC_CLK_SRC 227 | ||
| 245 | #define SEC_CTRL_ACC_CLK 228 | ||
| 246 | #define TLMM_H_CLK 229 | ||
| 247 | #define TLMM_CLK 230 | ||
| 248 | #define SFAB_MSS_S_H_CLK 231 | ||
| 249 | #define MSS_SLP_CLK 232 | ||
| 250 | #define MSS_Q6SW_JTAG_CLK 233 | ||
| 251 | #define MSS_Q6FW_JTAG_CLK 234 | ||
| 252 | #define MSS_S_H_CLK 235 | ||
| 253 | #define MSS_CXO_SRC_CLK 236 | ||
| 254 | #define SATA_H_CLK 237 | ||
| 255 | #define SATA_SRC_CLK 238 | ||
| 256 | #define SATA_RXOOB_CLK 239 | ||
| 257 | #define SATA_PMALIVE_CLK 240 | ||
| 258 | #define SATA_PHY_REF_CLK 241 | ||
| 259 | #define TSSC_CLK_SRC 242 | ||
| 260 | #define TSSC_CLK 243 | ||
| 261 | #define PDM_SRC 244 | ||
| 262 | #define PDM_CLK 245 | ||
| 263 | #define GP0_SRC 246 | ||
| 264 | #define GP0_CLK 247 | ||
| 265 | #define GP1_SRC 248 | ||
| 266 | #define GP1_CLK 249 | ||
| 267 | #define GP2_SRC 250 | ||
| 268 | #define GP2_CLK 251 | ||
| 269 | #define MPM_CLK 252 | ||
| 270 | #define EBI1_CLK_SRC 253 | ||
| 271 | #define EBI1_CH0_CLK 254 | ||
| 272 | #define EBI1_CH1_CLK 255 | ||
| 273 | #define EBI1_2X_CLK 256 | ||
| 274 | #define EBI1_CH0_DQ_CLK 257 | ||
| 275 | #define EBI1_CH1_DQ_CLK 258 | ||
| 276 | #define EBI1_CH0_CA_CLK 259 | ||
| 277 | #define EBI1_CH1_CA_CLK 260 | ||
| 278 | #define EBI1_XO_CLK 261 | ||
| 279 | #define SFAB_SMPSS_S_H_CLK 262 | ||
| 280 | #define PRNG_SRC 263 | ||
| 281 | #define PRNG_CLK 264 | ||
| 282 | #define PXO_SRC 265 | ||
| 283 | #define LPASS_CXO_CLK 266 | ||
| 284 | #define LPASS_PXO_CLK 267 | ||
| 285 | #define SPDM_CY_PORT0_CLK 268 | ||
| 286 | #define SPDM_CY_PORT1_CLK 269 | ||
| 287 | #define SPDM_CY_PORT2_CLK 270 | ||
| 288 | #define SPDM_CY_PORT3_CLK 271 | ||
| 289 | #define SPDM_CY_PORT4_CLK 272 | ||
| 290 | #define SPDM_CY_PORT5_CLK 273 | ||
| 291 | #define SPDM_CY_PORT6_CLK 274 | ||
| 292 | #define SPDM_CY_PORT7_CLK 275 | ||
| 293 | #define PLL0 276 | ||
| 294 | #define PLL0_VOTE 277 | ||
| 295 | #define PLL3 278 | ||
| 296 | #define PLL3_VOTE 279 | ||
| 297 | #define PLL4_VOTE 280 | ||
| 298 | #define PLL5 281 | ||
| 299 | #define PLL5_VOTE 282 | ||
| 300 | #define PLL6 283 | ||
| 301 | #define PLL6_VOTE 284 | ||
| 302 | #define PLL7_VOTE 285 | ||
| 303 | #define PLL8 286 | ||
| 304 | #define PLL8_VOTE 287 | ||
| 305 | #define PLL9 288 | ||
| 306 | #define PLL10 289 | ||
| 307 | #define PLL11 290 | ||
| 308 | #define PLL12 291 | ||
| 309 | #define PLL13 292 | ||
| 310 | #define PLL14 293 | ||
| 311 | #define PLL14_VOTE 294 | ||
| 312 | |||
| 313 | #endif | ||
diff --git a/include/dt-bindings/clock/qcom,gcc-msm8974.h b/include/dt-bindings/clock/qcom,gcc-msm8974.h new file mode 100644 index 000000000000..223ca174d9d3 --- /dev/null +++ b/include/dt-bindings/clock/qcom,gcc-msm8974.h | |||
| @@ -0,0 +1,320 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_CLK_MSM_GCC_8974_H | ||
| 15 | #define _DT_BINDINGS_CLK_MSM_GCC_8974_H | ||
| 16 | |||
| 17 | #define GPLL0 0 | ||
| 18 | #define GPLL0_VOTE 1 | ||
| 19 | #define CONFIG_NOC_CLK_SRC 2 | ||
| 20 | #define GPLL2 3 | ||
| 21 | #define GPLL2_VOTE 4 | ||
| 22 | #define GPLL3 5 | ||
| 23 | #define GPLL3_VOTE 6 | ||
| 24 | #define PERIPH_NOC_CLK_SRC 7 | ||
| 25 | #define BLSP_UART_SIM_CLK_SRC 8 | ||
| 26 | #define QDSS_TSCTR_CLK_SRC 9 | ||
| 27 | #define BIMC_DDR_CLK_SRC 10 | ||
| 28 | #define SYSTEM_NOC_CLK_SRC 11 | ||
| 29 | #define GPLL1 12 | ||
| 30 | #define GPLL1_VOTE 13 | ||
| 31 | #define RPM_CLK_SRC 14 | ||
| 32 | #define GCC_BIMC_CLK 15 | ||
| 33 | #define BIMC_DDR_CPLL0_ROOT_CLK_SRC 16 | ||
| 34 | #define KPSS_AHB_CLK_SRC 17 | ||
| 35 | #define QDSS_AT_CLK_SRC 18 | ||
| 36 | #define USB30_MASTER_CLK_SRC 19 | ||
| 37 | #define BIMC_DDR_CPLL1_ROOT_CLK_SRC 20 | ||
| 38 | #define QDSS_STM_CLK_SRC 21 | ||
| 39 | #define ACC_CLK_SRC 22 | ||
| 40 | #define SEC_CTRL_CLK_SRC 23 | ||
| 41 | #define BLSP1_QUP1_I2C_APPS_CLK_SRC 24 | ||
| 42 | #define BLSP1_QUP1_SPI_APPS_CLK_SRC 25 | ||
| 43 | #define BLSP1_QUP2_I2C_APPS_CLK_SRC 26 | ||
| 44 | #define BLSP1_QUP2_SPI_APPS_CLK_SRC 27 | ||
| 45 | #define BLSP1_QUP3_I2C_APPS_CLK_SRC 28 | ||
| 46 | #define BLSP1_QUP3_SPI_APPS_CLK_SRC 29 | ||
| 47 | #define BLSP1_QUP4_I2C_APPS_CLK_SRC 30 | ||
| 48 | #define BLSP1_QUP4_SPI_APPS_CLK_SRC 31 | ||
| 49 | #define BLSP1_QUP5_I2C_APPS_CLK_SRC 32 | ||
| 50 | #define BLSP1_QUP5_SPI_APPS_CLK_SRC 33 | ||
| 51 | #define BLSP1_QUP6_I2C_APPS_CLK_SRC 34 | ||
| 52 | #define BLSP1_QUP6_SPI_APPS_CLK_SRC 35 | ||
| 53 | #define BLSP1_UART1_APPS_CLK_SRC 36 | ||
| 54 | #define BLSP1_UART2_APPS_CLK_SRC 37 | ||
| 55 | #define BLSP1_UART3_APPS_CLK_SRC 38 | ||
| 56 | #define BLSP1_UART4_APPS_CLK_SRC 39 | ||
| 57 | #define BLSP1_UART5_APPS_CLK_SRC 40 | ||
| 58 | #define BLSP1_UART6_APPS_CLK_SRC 41 | ||
| 59 | #define BLSP2_QUP1_I2C_APPS_CLK_SRC 42 | ||
| 60 | #define BLSP2_QUP1_SPI_APPS_CLK_SRC 43 | ||
| 61 | #define BLSP2_QUP2_I2C_APPS_CLK_SRC 44 | ||
| 62 | #define BLSP2_QUP2_SPI_APPS_CLK_SRC 45 | ||
| 63 | #define BLSP2_QUP3_I2C_APPS_CLK_SRC 46 | ||
| 64 | #define BLSP2_QUP3_SPI_APPS_CLK_SRC 47 | ||
| 65 | #define BLSP2_QUP4_I2C_APPS_CLK_SRC 48 | ||
| 66 | #define BLSP2_QUP4_SPI_APPS_CLK_SRC 49 | ||
| 67 | #define BLSP2_QUP5_I2C_APPS_CLK_SRC 50 | ||
| 68 | #define BLSP2_QUP5_SPI_APPS_CLK_SRC 51 | ||
| 69 | #define BLSP2_QUP6_I2C_APPS_CLK_SRC 52 | ||
| 70 | #define BLSP2_QUP6_SPI_APPS_CLK_SRC 53 | ||
| 71 | #define BLSP2_UART1_APPS_CLK_SRC 54 | ||
| 72 | #define BLSP2_UART2_APPS_CLK_SRC 55 | ||
| 73 | #define BLSP2_UART3_APPS_CLK_SRC 56 | ||
| 74 | #define BLSP2_UART4_APPS_CLK_SRC 57 | ||
| 75 | #define BLSP2_UART5_APPS_CLK_SRC 58 | ||
| 76 | #define BLSP2_UART6_APPS_CLK_SRC 59 | ||
| 77 | #define CE1_CLK_SRC 60 | ||
| 78 | #define CE2_CLK_SRC 61 | ||
| 79 | #define GP1_CLK_SRC 62 | ||
| 80 | #define GP2_CLK_SRC 63 | ||
| 81 | #define GP3_CLK_SRC 64 | ||
| 82 | #define PDM2_CLK_SRC 65 | ||
| 83 | #define QDSS_TRACECLKIN_CLK_SRC 66 | ||
| 84 | #define RBCPR_CLK_SRC 67 | ||
| 85 | #define SDCC1_APPS_CLK_SRC 68 | ||
| 86 | #define SDCC2_APPS_CLK_SRC 69 | ||
| 87 | #define SDCC3_APPS_CLK_SRC 70 | ||
| 88 | #define SDCC4_APPS_CLK_SRC 71 | ||
| 89 | #define SPMI_AHB_CLK_SRC 72 | ||
| 90 | #define SPMI_SER_CLK_SRC 73 | ||
| 91 | #define TSIF_REF_CLK_SRC 74 | ||
| 92 | #define USB30_MOCK_UTMI_CLK_SRC 75 | ||
| 93 | #define USB_HS_SYSTEM_CLK_SRC 76 | ||
| 94 | #define USB_HSIC_CLK_SRC 77 | ||
| 95 | #define USB_HSIC_IO_CAL_CLK_SRC 78 | ||
| 96 | #define USB_HSIC_SYSTEM_CLK_SRC 79 | ||
| 97 | #define GCC_BAM_DMA_AHB_CLK 80 | ||
| 98 | #define GCC_BAM_DMA_INACTIVITY_TIMERS_CLK 81 | ||
| 99 | #define GCC_BIMC_CFG_AHB_CLK 82 | ||
| 100 | #define GCC_BIMC_KPSS_AXI_CLK 83 | ||
| 101 | #define GCC_BIMC_SLEEP_CLK 84 | ||
| 102 | #define GCC_BIMC_SYSNOC_AXI_CLK 85 | ||
| 103 | #define GCC_BIMC_XO_CLK 86 | ||
| 104 | #define GCC_BLSP1_AHB_CLK 87 | ||
| 105 | #define GCC_BLSP1_SLEEP_CLK 88 | ||
| 106 | #define GCC_BLSP1_QUP1_I2C_APPS_CLK 89 | ||
| 107 | #define GCC_BLSP1_QUP1_SPI_APPS_CLK 90 | ||
| 108 | #define GCC_BLSP1_QUP2_I2C_APPS_CLK 91 | ||
| 109 | #define GCC_BLSP1_QUP2_SPI_APPS_CLK 92 | ||
| 110 | #define GCC_BLSP1_QUP3_I2C_APPS_CLK 93 | ||
| 111 | #define GCC_BLSP1_QUP3_SPI_APPS_CLK 94 | ||
| 112 | #define GCC_BLSP1_QUP4_I2C_APPS_CLK 95 | ||
| 113 | #define GCC_BLSP1_QUP4_SPI_APPS_CLK 96 | ||
| 114 | #define GCC_BLSP1_QUP5_I2C_APPS_CLK 97 | ||
| 115 | #define GCC_BLSP1_QUP5_SPI_APPS_CLK 98 | ||
| 116 | #define GCC_BLSP1_QUP6_I2C_APPS_CLK 99 | ||
| 117 | #define GCC_BLSP1_QUP6_SPI_APPS_CLK 100 | ||
| 118 | #define GCC_BLSP1_UART1_APPS_CLK 101 | ||
| 119 | #define GCC_BLSP1_UART1_SIM_CLK 102 | ||
| 120 | #define GCC_BLSP1_UART2_APPS_CLK 103 | ||
| 121 | #define GCC_BLSP1_UART2_SIM_CLK 104 | ||
| 122 | #define GCC_BLSP1_UART3_APPS_CLK 105 | ||
| 123 | #define GCC_BLSP1_UART3_SIM_CLK 106 | ||
| 124 | #define GCC_BLSP1_UART4_APPS_CLK 107 | ||
| 125 | #define GCC_BLSP1_UART4_SIM_CLK 108 | ||
| 126 | #define GCC_BLSP1_UART5_APPS_CLK 109 | ||
| 127 | #define GCC_BLSP1_UART5_SIM_CLK 110 | ||
| 128 | #define GCC_BLSP1_UART6_APPS_CLK 111 | ||
| 129 | #define GCC_BLSP1_UART6_SIM_CLK 112 | ||
| 130 | #define GCC_BLSP2_AHB_CLK 113 | ||
| 131 | #define GCC_BLSP2_SLEEP_CLK 114 | ||
| 132 | #define GCC_BLSP2_QUP1_I2C_APPS_CLK 115 | ||
| 133 | #define GCC_BLSP2_QUP1_SPI_APPS_CLK 116 | ||
| 134 | #define GCC_BLSP2_QUP2_I2C_APPS_CLK 117 | ||
| 135 | #define GCC_BLSP2_QUP2_SPI_APPS_CLK 118 | ||
| 136 | #define GCC_BLSP2_QUP3_I2C_APPS_CLK 119 | ||
| 137 | #define GCC_BLSP2_QUP3_SPI_APPS_CLK 120 | ||
| 138 | #define GCC_BLSP2_QUP4_I2C_APPS_CLK 121 | ||
| 139 | #define GCC_BLSP2_QUP4_SPI_APPS_CLK 122 | ||
| 140 | #define GCC_BLSP2_QUP5_I2C_APPS_CLK 123 | ||
| 141 | #define GCC_BLSP2_QUP5_SPI_APPS_CLK 124 | ||
| 142 | #define GCC_BLSP2_QUP6_I2C_APPS_CLK 125 | ||
| 143 | #define GCC_BLSP2_QUP6_SPI_APPS_CLK 126 | ||
| 144 | #define GCC_BLSP2_UART1_APPS_CLK 127 | ||
| 145 | #define GCC_BLSP2_UART1_SIM_CLK 128 | ||
| 146 | #define GCC_BLSP2_UART2_APPS_CLK 129 | ||
| 147 | #define GCC_BLSP2_UART2_SIM_CLK 130 | ||
| 148 | #define GCC_BLSP2_UART3_APPS_CLK 131 | ||
| 149 | #define GCC_BLSP2_UART3_SIM_CLK 132 | ||
| 150 | #define GCC_BLSP2_UART4_APPS_CLK 133 | ||
| 151 | #define GCC_BLSP2_UART4_SIM_CLK 134 | ||
| 152 | #define GCC_BLSP2_UART5_APPS_CLK 135 | ||
| 153 | #define GCC_BLSP2_UART5_SIM_CLK 136 | ||
| 154 | #define GCC_BLSP2_UART6_APPS_CLK 137 | ||
| 155 | #define GCC_BLSP2_UART6_SIM_CLK 138 | ||
| 156 | #define GCC_BOOT_ROM_AHB_CLK 139 | ||
| 157 | #define GCC_CE1_AHB_CLK 140 | ||
| 158 | #define GCC_CE1_AXI_CLK 141 | ||
| 159 | #define GCC_CE1_CLK 142 | ||
| 160 | #define GCC_CE2_AHB_CLK 143 | ||
| 161 | #define GCC_CE2_AXI_CLK 144 | ||
| 162 | #define GCC_CE2_CLK 145 | ||
| 163 | #define GCC_CNOC_BUS_TIMEOUT0_AHB_CLK 146 | ||
| 164 | #define GCC_CNOC_BUS_TIMEOUT1_AHB_CLK 147 | ||
| 165 | #define GCC_CNOC_BUS_TIMEOUT2_AHB_CLK 148 | ||
| 166 | #define GCC_CNOC_BUS_TIMEOUT3_AHB_CLK 149 | ||
| 167 | #define GCC_CNOC_BUS_TIMEOUT4_AHB_CLK 150 | ||
| 168 | #define GCC_CNOC_BUS_TIMEOUT5_AHB_CLK 151 | ||
| 169 | #define GCC_CNOC_BUS_TIMEOUT6_AHB_CLK 152 | ||
| 170 | #define GCC_CFG_NOC_AHB_CLK 153 | ||
| 171 | #define GCC_CFG_NOC_DDR_CFG_CLK 154 | ||
| 172 | #define GCC_CFG_NOC_RPM_AHB_CLK 155 | ||
| 173 | #define GCC_BIMC_DDR_CPLL0_CLK 156 | ||
| 174 | #define GCC_BIMC_DDR_CPLL1_CLK 157 | ||
| 175 | #define GCC_DDR_DIM_CFG_CLK 158 | ||
| 176 | #define GCC_DDR_DIM_SLEEP_CLK 159 | ||
| 177 | #define GCC_DEHR_CLK 160 | ||
| 178 | #define GCC_AHB_CLK 161 | ||
| 179 | #define GCC_IM_SLEEP_CLK 162 | ||
| 180 | #define GCC_XO_CLK 163 | ||
| 181 | #define GCC_XO_DIV4_CLK 164 | ||
| 182 | #define GCC_GP1_CLK 165 | ||
| 183 | #define GCC_GP2_CLK 166 | ||
| 184 | #define GCC_GP3_CLK 167 | ||
| 185 | #define GCC_IMEM_AXI_CLK 168 | ||
| 186 | #define GCC_IMEM_CFG_AHB_CLK 169 | ||
| 187 | #define GCC_KPSS_AHB_CLK 170 | ||
| 188 | #define GCC_KPSS_AXI_CLK 171 | ||
| 189 | #define GCC_LPASS_Q6_AXI_CLK 172 | ||
| 190 | #define GCC_MMSS_NOC_AT_CLK 173 | ||
| 191 | #define GCC_MMSS_NOC_CFG_AHB_CLK 174 | ||
| 192 | #define GCC_OCMEM_NOC_CFG_AHB_CLK 175 | ||
| 193 | #define GCC_OCMEM_SYS_NOC_AXI_CLK 176 | ||
| 194 | #define GCC_MPM_AHB_CLK 177 | ||
| 195 | #define GCC_MSG_RAM_AHB_CLK 178 | ||
| 196 | #define GCC_MSS_CFG_AHB_CLK 179 | ||
| 197 | #define GCC_MSS_Q6_BIMC_AXI_CLK 180 | ||
| 198 | #define GCC_NOC_CONF_XPU_AHB_CLK 181 | ||
| 199 | #define GCC_PDM2_CLK 182 | ||
| 200 | #define GCC_PDM_AHB_CLK 183 | ||
| 201 | #define GCC_PDM_XO4_CLK 184 | ||
| 202 | #define GCC_PERIPH_NOC_AHB_CLK 185 | ||
| 203 | #define GCC_PERIPH_NOC_AT_CLK 186 | ||
| 204 | #define GCC_PERIPH_NOC_CFG_AHB_CLK 187 | ||
| 205 | #define GCC_PERIPH_NOC_MPU_CFG_AHB_CLK 188 | ||
| 206 | #define GCC_PERIPH_XPU_AHB_CLK 189 | ||
| 207 | #define GCC_PNOC_BUS_TIMEOUT0_AHB_CLK 190 | ||
| 208 | #define GCC_PNOC_BUS_TIMEOUT1_AHB_CLK 191 | ||
| 209 | #define GCC_PNOC_BUS_TIMEOUT2_AHB_CLK 192 | ||
| 210 | #define GCC_PNOC_BUS_TIMEOUT3_AHB_CLK 193 | ||
| 211 | #define GCC_PNOC_BUS_TIMEOUT4_AHB_CLK 194 | ||
| 212 | #define GCC_PRNG_AHB_CLK 195 | ||
| 213 | #define GCC_QDSS_AT_CLK 196 | ||
| 214 | #define GCC_QDSS_CFG_AHB_CLK 197 | ||
| 215 | #define GCC_QDSS_DAP_AHB_CLK 198 | ||
| 216 | #define GCC_QDSS_DAP_CLK 199 | ||
| 217 | #define GCC_QDSS_ETR_USB_CLK 200 | ||
| 218 | #define GCC_QDSS_STM_CLK 201 | ||
| 219 | #define GCC_QDSS_TRACECLKIN_CLK 202 | ||
| 220 | #define GCC_QDSS_TSCTR_DIV16_CLK 203 | ||
| 221 | #define GCC_QDSS_TSCTR_DIV2_CLK 204 | ||
| 222 | #define GCC_QDSS_TSCTR_DIV3_CLK 205 | ||
| 223 | #define GCC_QDSS_TSCTR_DIV4_CLK 206 | ||
| 224 | #define GCC_QDSS_TSCTR_DIV8_CLK 207 | ||
| 225 | #define GCC_QDSS_RBCPR_XPU_AHB_CLK 208 | ||
| 226 | #define GCC_RBCPR_AHB_CLK 209 | ||
| 227 | #define GCC_RBCPR_CLK 210 | ||
| 228 | #define GCC_RPM_BUS_AHB_CLK 211 | ||
| 229 | #define GCC_RPM_PROC_HCLK 212 | ||
| 230 | #define GCC_RPM_SLEEP_CLK 213 | ||
| 231 | #define GCC_RPM_TIMER_CLK 214 | ||
| 232 | #define GCC_SDCC1_AHB_CLK 215 | ||
| 233 | #define GCC_SDCC1_APPS_CLK 216 | ||
| 234 | #define GCC_SDCC1_INACTIVITY_TIMERS_CLK 217 | ||
| 235 | #define GCC_SDCC2_AHB_CLK 218 | ||
| 236 | #define GCC_SDCC2_APPS_CLK 219 | ||
| 237 | #define GCC_SDCC2_INACTIVITY_TIMERS_CLK 220 | ||
| 238 | #define GCC_SDCC3_AHB_CLK 221 | ||
| 239 | #define GCC_SDCC3_APPS_CLK 222 | ||
| 240 | #define GCC_SDCC3_INACTIVITY_TIMERS_CLK 223 | ||
| 241 | #define GCC_SDCC4_AHB_CLK 224 | ||
| 242 | #define GCC_SDCC4_APPS_CLK 225 | ||
| 243 | #define GCC_SDCC4_INACTIVITY_TIMERS_CLK 226 | ||
| 244 | #define GCC_SEC_CTRL_ACC_CLK 227 | ||
| 245 | #define GCC_SEC_CTRL_AHB_CLK 228 | ||
| 246 | #define GCC_SEC_CTRL_BOOT_ROM_PATCH_CLK 229 | ||
| 247 | #define GCC_SEC_CTRL_CLK 230 | ||
| 248 | #define GCC_SEC_CTRL_SENSE_CLK 231 | ||
| 249 | #define GCC_SNOC_BUS_TIMEOUT0_AHB_CLK 232 | ||
| 250 | #define GCC_SNOC_BUS_TIMEOUT2_AHB_CLK 233 | ||
| 251 | #define GCC_SPDM_BIMC_CY_CLK 234 | ||
| 252 | #define GCC_SPDM_CFG_AHB_CLK 235 | ||
| 253 | #define GCC_SPDM_DEBUG_CY_CLK 236 | ||
| 254 | #define GCC_SPDM_FF_CLK 237 | ||
| 255 | #define GCC_SPDM_MSTR_AHB_CLK 238 | ||
| 256 | #define GCC_SPDM_PNOC_CY_CLK 239 | ||
| 257 | #define GCC_SPDM_RPM_CY_CLK 240 | ||
| 258 | #define GCC_SPDM_SNOC_CY_CLK 241 | ||
| 259 | #define GCC_SPMI_AHB_CLK 242 | ||
| 260 | #define GCC_SPMI_CNOC_AHB_CLK 243 | ||
| 261 | #define GCC_SPMI_SER_CLK 244 | ||
| 262 | #define GCC_SNOC_CNOC_AHB_CLK 245 | ||
| 263 | #define GCC_SNOC_PNOC_AHB_CLK 246 | ||
| 264 | #define GCC_SYS_NOC_AT_CLK 247 | ||
| 265 | #define GCC_SYS_NOC_AXI_CLK 248 | ||
| 266 | #define GCC_SYS_NOC_KPSS_AHB_CLK 249 | ||
| 267 | #define GCC_SYS_NOC_QDSS_STM_AXI_CLK 250 | ||
| 268 | #define GCC_SYS_NOC_USB3_AXI_CLK 251 | ||
| 269 | #define GCC_TCSR_AHB_CLK 252 | ||
| 270 | #define GCC_TLMM_AHB_CLK 253 | ||
| 271 | #define GCC_TLMM_CLK 254 | ||
| 272 | #define GCC_TSIF_AHB_CLK 255 | ||
| 273 | #define GCC_TSIF_INACTIVITY_TIMERS_CLK 256 | ||
| 274 | #define GCC_TSIF_REF_CLK 257 | ||
| 275 | #define GCC_USB2A_PHY_SLEEP_CLK 258 | ||
| 276 | #define GCC_USB2B_PHY_SLEEP_CLK 259 | ||
| 277 | #define GCC_USB30_MASTER_CLK 260 | ||
| 278 | #define GCC_USB30_MOCK_UTMI_CLK 261 | ||
| 279 | #define GCC_USB30_SLEEP_CLK 262 | ||
| 280 | #define GCC_USB_HS_AHB_CLK 263 | ||
| 281 | #define GCC_USB_HS_INACTIVITY_TIMERS_CLK 264 | ||
| 282 | #define GCC_USB_HS_SYSTEM_CLK 265 | ||
| 283 | #define GCC_USB_HSIC_AHB_CLK 266 | ||
| 284 | #define GCC_USB_HSIC_CLK 267 | ||
| 285 | #define GCC_USB_HSIC_IO_CAL_CLK 268 | ||
| 286 | #define GCC_USB_HSIC_IO_CAL_SLEEP_CLK 269 | ||
| 287 | #define GCC_USB_HSIC_SYSTEM_CLK 270 | ||
| 288 | #define GCC_WCSS_GPLL1_CLK_SRC 271 | ||
| 289 | #define GCC_MMSS_GPLL0_CLK_SRC 272 | ||
| 290 | #define GCC_LPASS_GPLL0_CLK_SRC 273 | ||
| 291 | #define GCC_WCSS_GPLL1_CLK_SRC_SLEEP_ENA 274 | ||
| 292 | #define GCC_MMSS_GPLL0_CLK_SRC_SLEEP_ENA 275 | ||
| 293 | #define GCC_LPASS_GPLL0_CLK_SRC_SLEEP_ENA 276 | ||
| 294 | #define GCC_IMEM_AXI_CLK_SLEEP_ENA 277 | ||
| 295 | #define GCC_SYS_NOC_KPSS_AHB_CLK_SLEEP_ENA 278 | ||
| 296 | #define GCC_BIMC_KPSS_AXI_CLK_SLEEP_ENA 279 | ||
| 297 | #define GCC_KPSS_AHB_CLK_SLEEP_ENA 280 | ||
| 298 | #define GCC_KPSS_AXI_CLK_SLEEP_ENA 281 | ||
| 299 | #define GCC_MPM_AHB_CLK_SLEEP_ENA 282 | ||
| 300 | #define GCC_OCMEM_SYS_NOC_AXI_CLK_SLEEP_ENA 283 | ||
| 301 | #define GCC_BLSP1_AHB_CLK_SLEEP_ENA 284 | ||
| 302 | #define GCC_BLSP1_SLEEP_CLK_SLEEP_ENA 285 | ||
| 303 | #define GCC_BLSP2_AHB_CLK_SLEEP_ENA 286 | ||
| 304 | #define GCC_BLSP2_SLEEP_CLK_SLEEP_ENA 287 | ||
| 305 | #define GCC_PRNG_AHB_CLK_SLEEP_ENA 288 | ||
| 306 | #define GCC_BAM_DMA_AHB_CLK_SLEEP_ENA 289 | ||
| 307 | #define GCC_BAM_DMA_INACTIVITY_TIMERS_CLK_SLEEP_ENA 290 | ||
| 308 | #define GCC_BOOT_ROM_AHB_CLK_SLEEP_ENA 291 | ||
| 309 | #define GCC_MSG_RAM_AHB_CLK_SLEEP_ENA 292 | ||
| 310 | #define GCC_TLMM_AHB_CLK_SLEEP_ENA 293 | ||
| 311 | #define GCC_TLMM_CLK_SLEEP_ENA 294 | ||
| 312 | #define GCC_SPMI_CNOC_AHB_CLK_SLEEP_ENA 295 | ||
| 313 | #define GCC_CE1_CLK_SLEEP_ENA 296 | ||
| 314 | #define GCC_CE1_AXI_CLK_SLEEP_ENA 297 | ||
| 315 | #define GCC_CE1_AHB_CLK_SLEEP_ENA 298 | ||
| 316 | #define GCC_CE2_CLK_SLEEP_ENA 299 | ||
| 317 | #define GCC_CE2_AXI_CLK_SLEEP_ENA 300 | ||
| 318 | #define GCC_CE2_AHB_CLK_SLEEP_ENA 301 | ||
| 319 | |||
| 320 | #endif | ||
diff --git a/include/dt-bindings/clock/qcom,mmcc-msm8960.h b/include/dt-bindings/clock/qcom,mmcc-msm8960.h new file mode 100644 index 000000000000..5868ef14a777 --- /dev/null +++ b/include/dt-bindings/clock/qcom,mmcc-msm8960.h | |||
| @@ -0,0 +1,137 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_CLK_MSM_MMCC_8960_H | ||
| 15 | #define _DT_BINDINGS_CLK_MSM_MMCC_8960_H | ||
| 16 | |||
| 17 | #define MMSS_AHB_SRC 0 | ||
| 18 | #define FAB_AHB_CLK 1 | ||
| 19 | #define APU_AHB_CLK 2 | ||
| 20 | #define TV_ENC_AHB_CLK 3 | ||
| 21 | #define AMP_AHB_CLK 4 | ||
| 22 | #define DSI2_S_AHB_CLK 5 | ||
| 23 | #define JPEGD_AHB_CLK 6 | ||
| 24 | #define GFX2D0_AHB_CLK 7 | ||
| 25 | #define DSI_S_AHB_CLK 8 | ||
| 26 | #define DSI2_M_AHB_CLK 9 | ||
| 27 | #define VPE_AHB_CLK 10 | ||
| 28 | #define SMMU_AHB_CLK 11 | ||
| 29 | #define HDMI_M_AHB_CLK 12 | ||
| 30 | #define VFE_AHB_CLK 13 | ||
| 31 | #define ROT_AHB_CLK 14 | ||
| 32 | #define VCODEC_AHB_CLK 15 | ||
| 33 | #define MDP_AHB_CLK 16 | ||
| 34 | #define DSI_M_AHB_CLK 17 | ||
| 35 | #define CSI_AHB_CLK 18 | ||
| 36 | #define MMSS_IMEM_AHB_CLK 19 | ||
| 37 | #define IJPEG_AHB_CLK 20 | ||
| 38 | #define HDMI_S_AHB_CLK 21 | ||
| 39 | #define GFX3D_AHB_CLK 22 | ||
| 40 | #define GFX2D1_AHB_CLK 23 | ||
| 41 | #define MMSS_FPB_CLK 24 | ||
| 42 | #define MMSS_AXI_SRC 25 | ||
| 43 | #define MMSS_FAB_CORE 26 | ||
| 44 | #define FAB_MSP_AXI_CLK 27 | ||
| 45 | #define JPEGD_AXI_CLK 28 | ||
| 46 | #define GMEM_AXI_CLK 29 | ||
| 47 | #define MDP_AXI_CLK 30 | ||
| 48 | #define MMSS_IMEM_AXI_CLK 31 | ||
| 49 | #define IJPEG_AXI_CLK 32 | ||
| 50 | #define GFX3D_AXI_CLK 33 | ||
| 51 | #define VCODEC_AXI_CLK 34 | ||
| 52 | #define VFE_AXI_CLK 35 | ||
| 53 | #define VPE_AXI_CLK 36 | ||
| 54 | #define ROT_AXI_CLK 37 | ||
| 55 | #define VCODEC_AXI_A_CLK 38 | ||
| 56 | #define VCODEC_AXI_B_CLK 39 | ||
| 57 | #define MM_AXI_S3_FCLK 40 | ||
| 58 | #define MM_AXI_S2_FCLK 41 | ||
| 59 | #define MM_AXI_S1_FCLK 42 | ||
| 60 | #define MM_AXI_S0_FCLK 43 | ||
| 61 | #define MM_AXI_S2_CLK 44 | ||
| 62 | #define MM_AXI_S1_CLK 45 | ||
| 63 | #define MM_AXI_S0_CLK 46 | ||
| 64 | #define CSI0_SRC 47 | ||
| 65 | #define CSI0_CLK 48 | ||
| 66 | #define CSI0_PHY_CLK 49 | ||
| 67 | #define CSI1_SRC 50 | ||
| 68 | #define CSI1_CLK 51 | ||
| 69 | #define CSI1_PHY_CLK 52 | ||
| 70 | #define CSI2_SRC 53 | ||
| 71 | #define CSI2_CLK 54 | ||
| 72 | #define CSI2_PHY_CLK 55 | ||
| 73 | #define DSI_SRC 56 | ||
| 74 | #define DSI_CLK 57 | ||
| 75 | #define CSI_PIX_CLK 58 | ||
| 76 | #define CSI_RDI_CLK 59 | ||
| 77 | #define MDP_VSYNC_CLK 60 | ||
| 78 | #define HDMI_DIV_CLK 61 | ||
| 79 | #define HDMI_APP_CLK 62 | ||
| 80 | #define CSI_PIX1_CLK 63 | ||
| 81 | #define CSI_RDI2_CLK 64 | ||
| 82 | #define CSI_RDI1_CLK 65 | ||
| 83 | #define GFX2D0_SRC 66 | ||
| 84 | #define GFX2D0_CLK 67 | ||
| 85 | #define GFX2D1_SRC 68 | ||
| 86 | #define GFX2D1_CLK 69 | ||
| 87 | #define GFX3D_SRC 70 | ||
| 88 | #define GFX3D_CLK 71 | ||
| 89 | #define IJPEG_SRC 72 | ||
| 90 | #define IJPEG_CLK 73 | ||
| 91 | #define JPEGD_SRC 74 | ||
| 92 | #define JPEGD_CLK 75 | ||
| 93 | #define MDP_SRC 76 | ||
| 94 | #define MDP_CLK 77 | ||
| 95 | #define MDP_LUT_CLK 78 | ||
| 96 | #define DSI2_PIXEL_SRC 79 | ||
| 97 | #define DSI2_PIXEL_CLK 80 | ||
| 98 | #define DSI2_SRC 81 | ||
| 99 | #define DSI2_CLK 82 | ||
| 100 | #define DSI1_BYTE_SRC 83 | ||
| 101 | #define DSI1_BYTE_CLK 84 | ||
| 102 | #define DSI2_BYTE_SRC 85 | ||
| 103 | #define DSI2_BYTE_CLK 86 | ||
| 104 | #define DSI1_ESC_SRC 87 | ||
| 105 | #define DSI1_ESC_CLK 88 | ||
| 106 | #define DSI2_ESC_SRC 89 | ||
| 107 | #define DSI2_ESC_CLK 90 | ||
| 108 | #define ROT_SRC 91 | ||
| 109 | #define ROT_CLK 92 | ||
| 110 | #define TV_ENC_CLK 93 | ||
| 111 | #define TV_DAC_CLK 94 | ||
| 112 | #define HDMI_TV_CLK 95 | ||
| 113 | #define MDP_TV_CLK 96 | ||
| 114 | #define TV_SRC 97 | ||
| 115 | #define VCODEC_SRC 98 | ||
| 116 | #define VCODEC_CLK 99 | ||
| 117 | #define VFE_SRC 100 | ||
| 118 | #define VFE_CLK 101 | ||
| 119 | #define VFE_CSI_CLK 102 | ||
| 120 | #define VPE_SRC 103 | ||
| 121 | #define VPE_CLK 104 | ||
| 122 | #define DSI_PIXEL_SRC 105 | ||
| 123 | #define DSI_PIXEL_CLK 106 | ||
| 124 | #define CAMCLK0_SRC 107 | ||
| 125 | #define CAMCLK0_CLK 108 | ||
| 126 | #define CAMCLK1_SRC 109 | ||
| 127 | #define CAMCLK1_CLK 110 | ||
| 128 | #define CAMCLK2_SRC 111 | ||
| 129 | #define CAMCLK2_CLK 112 | ||
| 130 | #define CSIPHYTIMER_SRC 113 | ||
| 131 | #define CSIPHY2_TIMER_CLK 114 | ||
| 132 | #define CSIPHY1_TIMER_CLK 115 | ||
| 133 | #define CSIPHY0_TIMER_CLK 116 | ||
| 134 | #define PLL1 117 | ||
| 135 | #define PLL2 118 | ||
| 136 | |||
| 137 | #endif | ||
diff --git a/include/dt-bindings/clock/qcom,mmcc-msm8974.h b/include/dt-bindings/clock/qcom,mmcc-msm8974.h new file mode 100644 index 000000000000..04d318d1187a --- /dev/null +++ b/include/dt-bindings/clock/qcom,mmcc-msm8974.h | |||
| @@ -0,0 +1,161 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_CLK_MSM_MMCC_8974_H | ||
| 15 | #define _DT_BINDINGS_CLK_MSM_MMCC_8974_H | ||
| 16 | |||
| 17 | #define MMSS_AHB_CLK_SRC 0 | ||
| 18 | #define MMSS_AXI_CLK_SRC 1 | ||
| 19 | #define MMPLL0 2 | ||
| 20 | #define MMPLL0_VOTE 3 | ||
| 21 | #define MMPLL1 4 | ||
| 22 | #define MMPLL1_VOTE 5 | ||
| 23 | #define MMPLL2 6 | ||
| 24 | #define MMPLL3 7 | ||
| 25 | #define CSI0_CLK_SRC 8 | ||
| 26 | #define CSI1_CLK_SRC 9 | ||
| 27 | #define CSI2_CLK_SRC 10 | ||
| 28 | #define CSI3_CLK_SRC 11 | ||
| 29 | #define VFE0_CLK_SRC 12 | ||
| 30 | #define VFE1_CLK_SRC 13 | ||
| 31 | #define MDP_CLK_SRC 14 | ||
| 32 | #define GFX3D_CLK_SRC 15 | ||
| 33 | #define JPEG0_CLK_SRC 16 | ||
| 34 | #define JPEG1_CLK_SRC 17 | ||
| 35 | #define JPEG2_CLK_SRC 18 | ||
| 36 | #define PCLK0_CLK_SRC 19 | ||
| 37 | #define PCLK1_CLK_SRC 20 | ||
| 38 | #define VCODEC0_CLK_SRC 21 | ||
| 39 | #define CCI_CLK_SRC 22 | ||
| 40 | #define CAMSS_GP0_CLK_SRC 23 | ||
| 41 | #define CAMSS_GP1_CLK_SRC 24 | ||
| 42 | #define MCLK0_CLK_SRC 25 | ||
| 43 | #define MCLK1_CLK_SRC 26 | ||
| 44 | #define MCLK2_CLK_SRC 27 | ||
| 45 | #define MCLK3_CLK_SRC 28 | ||
| 46 | #define CSI0PHYTIMER_CLK_SRC 29 | ||
| 47 | #define CSI1PHYTIMER_CLK_SRC 30 | ||
| 48 | #define CSI2PHYTIMER_CLK_SRC 31 | ||
| 49 | #define CPP_CLK_SRC 32 | ||
| 50 | #define BYTE0_CLK_SRC 33 | ||
| 51 | #define BYTE1_CLK_SRC 34 | ||
| 52 | #define EDPAUX_CLK_SRC 35 | ||
| 53 | #define EDPLINK_CLK_SRC 36 | ||
| 54 | #define EDPPIXEL_CLK_SRC 37 | ||
| 55 | #define ESC0_CLK_SRC 38 | ||
| 56 | #define ESC1_CLK_SRC 39 | ||
| 57 | #define EXTPCLK_CLK_SRC 40 | ||
| 58 | #define HDMI_CLK_SRC 41 | ||
| 59 | #define VSYNC_CLK_SRC 42 | ||
| 60 | #define RBCPR_CLK_SRC 43 | ||
| 61 | #define CAMSS_CCI_CCI_AHB_CLK 44 | ||
| 62 | #define CAMSS_CCI_CCI_CLK 45 | ||
| 63 | #define CAMSS_CSI0_AHB_CLK 46 | ||
| 64 | #define CAMSS_CSI0_CLK 47 | ||
| 65 | #define CAMSS_CSI0PHY_CLK 48 | ||
| 66 | #define CAMSS_CSI0PIX_CLK 49 | ||
| 67 | #define CAMSS_CSI0RDI_CLK 50 | ||
| 68 | #define CAMSS_CSI1_AHB_CLK 51 | ||
| 69 | #define CAMSS_CSI1_CLK 52 | ||
| 70 | #define CAMSS_CSI1PHY_CLK 53 | ||
| 71 | #define CAMSS_CSI1PIX_CLK 54 | ||
| 72 | #define CAMSS_CSI1RDI_CLK 55 | ||
| 73 | #define CAMSS_CSI2_AHB_CLK 56 | ||
| 74 | #define CAMSS_CSI2_CLK 57 | ||
| 75 | #define CAMSS_CSI2PHY_CLK 58 | ||
| 76 | #define CAMSS_CSI2PIX_CLK 59 | ||
| 77 | #define CAMSS_CSI2RDI_CLK 60 | ||
| 78 | #define CAMSS_CSI3_AHB_CLK 61 | ||
| 79 | #define CAMSS_CSI3_CLK 62 | ||
| 80 | #define CAMSS_CSI3PHY_CLK 63 | ||
| 81 | #define CAMSS_CSI3PIX_CLK 64 | ||
| 82 | #define CAMSS_CSI3RDI_CLK 65 | ||
| 83 | #define CAMSS_CSI_VFE0_CLK 66 | ||
| 84 | #define CAMSS_CSI_VFE1_CLK 67 | ||
| 85 | #define CAMSS_GP0_CLK 68 | ||
| 86 | #define CAMSS_GP1_CLK 69 | ||
| 87 | #define CAMSS_ISPIF_AHB_CLK 70 | ||
| 88 | #define CAMSS_JPEG_JPEG0_CLK 71 | ||
| 89 | #define CAMSS_JPEG_JPEG1_CLK 72 | ||
| 90 | #define CAMSS_JPEG_JPEG2_CLK 73 | ||
| 91 | #define CAMSS_JPEG_JPEG_AHB_CLK 74 | ||
| 92 | #define CAMSS_JPEG_JPEG_AXI_CLK 75 | ||
| 93 | #define CAMSS_JPEG_JPEG_OCMEMNOC_CLK 76 | ||
| 94 | #define CAMSS_MCLK0_CLK 77 | ||
| 95 | #define CAMSS_MCLK1_CLK 78 | ||
| 96 | #define CAMSS_MCLK2_CLK 79 | ||
| 97 | #define CAMSS_MCLK3_CLK 80 | ||
| 98 | #define CAMSS_MICRO_AHB_CLK 81 | ||
| 99 | #define CAMSS_PHY0_CSI0PHYTIMER_CLK 82 | ||
| 100 | #define CAMSS_PHY1_CSI1PHYTIMER_CLK 83 | ||
| 101 | #define CAMSS_PHY2_CSI2PHYTIMER_CLK 84 | ||
| 102 | #define CAMSS_TOP_AHB_CLK 85 | ||
| 103 | #define CAMSS_VFE_CPP_AHB_CLK 86 | ||
| 104 | #define CAMSS_VFE_CPP_CLK 87 | ||
| 105 | #define CAMSS_VFE_VFE0_CLK 88 | ||
| 106 | #define CAMSS_VFE_VFE1_CLK 89 | ||
| 107 | #define CAMSS_VFE_VFE_AHB_CLK 90 | ||
| 108 | #define CAMSS_VFE_VFE_AXI_CLK 91 | ||
| 109 | #define CAMSS_VFE_VFE_OCMEMNOC_CLK 92 | ||
| 110 | #define MDSS_AHB_CLK 93 | ||
| 111 | #define MDSS_AXI_CLK 94 | ||
| 112 | #define MDSS_BYTE0_CLK 95 | ||
| 113 | #define MDSS_BYTE1_CLK 96 | ||
| 114 | #define MDSS_EDPAUX_CLK 97 | ||
| 115 | #define MDSS_EDPLINK_CLK 98 | ||
| 116 | #define MDSS_EDPPIXEL_CLK 99 | ||
| 117 | #define MDSS_ESC0_CLK 100 | ||
| 118 | #define MDSS_ESC1_CLK 101 | ||
| 119 | #define MDSS_EXTPCLK_CLK 102 | ||
| 120 | #define MDSS_HDMI_AHB_CLK 103 | ||
| 121 | #define MDSS_HDMI_CLK 104 | ||
| 122 | #define MDSS_MDP_CLK 105 | ||
| 123 | #define MDSS_MDP_LUT_CLK 106 | ||
| 124 | #define MDSS_PCLK0_CLK 107 | ||
| 125 | #define MDSS_PCLK1_CLK 108 | ||
| 126 | #define MDSS_VSYNC_CLK 109 | ||
| 127 | #define MMSS_MISC_AHB_CLK 110 | ||
| 128 | #define MMSS_MMSSNOC_AHB_CLK 111 | ||
| 129 | #define MMSS_MMSSNOC_BTO_AHB_CLK 112 | ||
| 130 | #define MMSS_MMSSNOC_AXI_CLK 113 | ||
| 131 | #define MMSS_S0_AXI_CLK 114 | ||
| 132 | #define OCMEMCX_AHB_CLK 115 | ||
| 133 | #define OCMEMCX_OCMEMNOC_CLK 116 | ||
| 134 | #define OXILI_OCMEMGX_CLK 117 | ||
| 135 | #define OCMEMNOC_CLK 118 | ||
| 136 | #define OXILI_GFX3D_CLK 119 | ||
| 137 | #define OXILICX_AHB_CLK 120 | ||
| 138 | #define OXILICX_AXI_CLK 121 | ||
| 139 | #define VENUS0_AHB_CLK 122 | ||
| 140 | #define VENUS0_AXI_CLK 123 | ||
| 141 | #define VENUS0_OCMEMNOC_CLK 124 | ||
| 142 | #define VENUS0_VCODEC0_CLK 125 | ||
| 143 | #define OCMEMNOC_CLK_SRC 126 | ||
| 144 | #define SPDM_JPEG0 127 | ||
| 145 | #define SPDM_JPEG1 128 | ||
| 146 | #define SPDM_MDP 129 | ||
| 147 | #define SPDM_AXI 130 | ||
| 148 | #define SPDM_VCODEC0 131 | ||
| 149 | #define SPDM_VFE0 132 | ||
| 150 | #define SPDM_VFE1 133 | ||
| 151 | #define SPDM_JPEG2 134 | ||
| 152 | #define SPDM_PCLK1 135 | ||
| 153 | #define SPDM_GFX3D 136 | ||
| 154 | #define SPDM_AHB 137 | ||
| 155 | #define SPDM_PCLK0 138 | ||
| 156 | #define SPDM_OCMEMNOC 139 | ||
| 157 | #define SPDM_CSI0 140 | ||
| 158 | #define SPDM_RM_AXI 141 | ||
| 159 | #define SPDM_RM_OCMEMNOC 142 | ||
| 160 | |||
| 161 | #endif | ||
diff --git a/include/dt-bindings/clock/r8a7790-clock.h b/include/dt-bindings/clock/r8a7790-clock.h new file mode 100644 index 000000000000..859e9be511d9 --- /dev/null +++ b/include/dt-bindings/clock/r8a7790-clock.h | |||
| @@ -0,0 +1,107 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2013 Ideas On Board SPRL | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __DT_BINDINGS_CLOCK_R8A7790_H__ | ||
| 11 | #define __DT_BINDINGS_CLOCK_R8A7790_H__ | ||
| 12 | |||
| 13 | /* CPG */ | ||
| 14 | #define R8A7790_CLK_MAIN 0 | ||
| 15 | #define R8A7790_CLK_PLL0 1 | ||
| 16 | #define R8A7790_CLK_PLL1 2 | ||
| 17 | #define R8A7790_CLK_PLL3 3 | ||
| 18 | #define R8A7790_CLK_LB 4 | ||
| 19 | #define R8A7790_CLK_QSPI 5 | ||
| 20 | #define R8A7790_CLK_SDH 6 | ||
| 21 | #define R8A7790_CLK_SD0 7 | ||
| 22 | #define R8A7790_CLK_SD1 8 | ||
| 23 | #define R8A7790_CLK_Z 9 | ||
| 24 | |||
| 25 | /* MSTP0 */ | ||
| 26 | #define R8A7790_CLK_MSIOF0 0 | ||
| 27 | |||
| 28 | /* MSTP1 */ | ||
| 29 | #define R8A7790_CLK_TMU1 11 | ||
| 30 | #define R8A7790_CLK_TMU3 21 | ||
| 31 | #define R8A7790_CLK_TMU2 22 | ||
| 32 | #define R8A7790_CLK_CMT0 24 | ||
| 33 | #define R8A7790_CLK_TMU0 25 | ||
| 34 | #define R8A7790_CLK_VSP1_DU1 27 | ||
| 35 | #define R8A7790_CLK_VSP1_DU0 28 | ||
| 36 | #define R8A7790_CLK_VSP1_RT 30 | ||
| 37 | #define R8A7790_CLK_VSP1_SY 31 | ||
| 38 | |||
| 39 | /* MSTP2 */ | ||
| 40 | #define R8A7790_CLK_SCIFA2 2 | ||
| 41 | #define R8A7790_CLK_SCIFA1 3 | ||
| 42 | #define R8A7790_CLK_SCIFA0 4 | ||
| 43 | #define R8A7790_CLK_MSIOF2 5 | ||
| 44 | #define R8A7790_CLK_SCIFB0 6 | ||
| 45 | #define R8A7790_CLK_SCIFB1 7 | ||
| 46 | #define R8A7790_CLK_MSIOF1 8 | ||
| 47 | #define R8A7790_CLK_MSIOF3 15 | ||
| 48 | #define R8A7790_CLK_SCIFB2 16 | ||
| 49 | #define R8A7790_CLK_SYS_DMAC0 18 | ||
| 50 | #define R8A7790_CLK_SYS_DMAC1 19 | ||
| 51 | |||
| 52 | /* MSTP3 */ | ||
| 53 | #define R8A7790_CLK_TPU0 4 | ||
| 54 | #define R8A7790_CLK_MMCIF1 5 | ||
| 55 | #define R8A7790_CLK_SDHI3 11 | ||
| 56 | #define R8A7790_CLK_SDHI2 12 | ||
| 57 | #define R8A7790_CLK_SDHI1 13 | ||
| 58 | #define R8A7790_CLK_SDHI0 14 | ||
| 59 | #define R8A7790_CLK_MMCIF0 15 | ||
| 60 | #define R8A7790_CLK_SSUSB 28 | ||
| 61 | #define R8A7790_CLK_CMT1 29 | ||
| 62 | #define R8A7790_CLK_USBDMAC0 30 | ||
| 63 | #define R8A7790_CLK_USBDMAC1 31 | ||
| 64 | |||
| 65 | /* MSTP5 */ | ||
| 66 | #define R8A7790_CLK_THERMAL 22 | ||
| 67 | #define R8A7790_CLK_PWM 23 | ||
| 68 | |||
| 69 | /* MSTP7 */ | ||
| 70 | #define R8A7790_CLK_EHCI 3 | ||
| 71 | #define R8A7790_CLK_HSUSB 4 | ||
| 72 | #define R8A7790_CLK_HSCIF1 16 | ||
| 73 | #define R8A7790_CLK_HSCIF0 17 | ||
| 74 | #define R8A7790_CLK_SCIF1 20 | ||
| 75 | #define R8A7790_CLK_SCIF0 21 | ||
| 76 | #define R8A7790_CLK_DU2 22 | ||
| 77 | #define R8A7790_CLK_DU1 23 | ||
| 78 | #define R8A7790_CLK_DU0 24 | ||
| 79 | #define R8A7790_CLK_LVDS1 25 | ||
| 80 | #define R8A7790_CLK_LVDS0 26 | ||
| 81 | |||
| 82 | /* MSTP8 */ | ||
| 83 | #define R8A7790_CLK_VIN3 8 | ||
| 84 | #define R8A7790_CLK_VIN2 9 | ||
| 85 | #define R8A7790_CLK_VIN1 10 | ||
| 86 | #define R8A7790_CLK_VIN0 11 | ||
| 87 | #define R8A7790_CLK_ETHER 13 | ||
| 88 | #define R8A7790_CLK_SATA1 14 | ||
| 89 | #define R8A7790_CLK_SATA0 15 | ||
| 90 | |||
| 91 | /* MSTP9 */ | ||
| 92 | #define R8A7790_CLK_GPIO5 7 | ||
| 93 | #define R8A7790_CLK_GPIO4 8 | ||
| 94 | #define R8A7790_CLK_GPIO3 9 | ||
| 95 | #define R8A7790_CLK_GPIO2 10 | ||
| 96 | #define R8A7790_CLK_GPIO1 11 | ||
| 97 | #define R8A7790_CLK_GPIO0 12 | ||
| 98 | #define R8A7790_CLK_RCAN1 15 | ||
| 99 | #define R8A7790_CLK_RCAN0 16 | ||
| 100 | #define R8A7790_CLK_QSPI_MOD 17 | ||
| 101 | #define R8A7790_CLK_IICDVFS 26 | ||
| 102 | #define R8A7790_CLK_I2C3 28 | ||
| 103 | #define R8A7790_CLK_I2C2 29 | ||
| 104 | #define R8A7790_CLK_I2C1 30 | ||
| 105 | #define R8A7790_CLK_I2C0 31 | ||
| 106 | |||
| 107 | #endif /* __DT_BINDINGS_CLOCK_R8A7790_H__ */ | ||
diff --git a/include/dt-bindings/clock/r8a7791-clock.h b/include/dt-bindings/clock/r8a7791-clock.h new file mode 100644 index 000000000000..30f82f286e29 --- /dev/null +++ b/include/dt-bindings/clock/r8a7791-clock.h | |||
| @@ -0,0 +1,111 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2013 Ideas On Board SPRL | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __DT_BINDINGS_CLOCK_R8A7791_H__ | ||
| 11 | #define __DT_BINDINGS_CLOCK_R8A7791_H__ | ||
| 12 | |||
| 13 | /* CPG */ | ||
| 14 | #define R8A7791_CLK_MAIN 0 | ||
| 15 | #define R8A7791_CLK_PLL0 1 | ||
| 16 | #define R8A7791_CLK_PLL1 2 | ||
| 17 | #define R8A7791_CLK_PLL3 3 | ||
| 18 | #define R8A7791_CLK_LB 4 | ||
| 19 | #define R8A7791_CLK_QSPI 5 | ||
| 20 | #define R8A7791_CLK_SDH 6 | ||
| 21 | #define R8A7791_CLK_SD0 7 | ||
| 22 | #define R8A7791_CLK_Z 8 | ||
| 23 | |||
| 24 | /* MSTP0 */ | ||
| 25 | #define R8A7791_CLK_MSIOF0 0 | ||
| 26 | |||
| 27 | /* MSTP1 */ | ||
| 28 | #define R8A7791_CLK_TMU1 11 | ||
| 29 | #define R8A7791_CLK_TMU3 21 | ||
| 30 | #define R8A7791_CLK_TMU2 22 | ||
| 31 | #define R8A7791_CLK_CMT0 24 | ||
| 32 | #define R8A7791_CLK_TMU0 25 | ||
| 33 | #define R8A7791_CLK_VSP1_DU1 27 | ||
| 34 | #define R8A7791_CLK_VSP1_DU0 28 | ||
| 35 | #define R8A7791_CLK_VSP1_SY 31 | ||
| 36 | |||
| 37 | /* MSTP2 */ | ||
| 38 | #define R8A7791_CLK_SCIFA2 2 | ||
| 39 | #define R8A7791_CLK_SCIFA1 3 | ||
| 40 | #define R8A7791_CLK_SCIFA0 4 | ||
| 41 | #define R8A7791_CLK_MSIOF2 5 | ||
| 42 | #define R8A7791_CLK_SCIFB0 6 | ||
| 43 | #define R8A7791_CLK_SCIFB1 7 | ||
| 44 | #define R8A7791_CLK_MSIOF1 8 | ||
| 45 | #define R8A7791_CLK_SCIFB2 16 | ||
| 46 | #define R8A7791_CLK_DMAC 18 | ||
| 47 | |||
| 48 | /* MSTP3 */ | ||
| 49 | #define R8A7791_CLK_TPU0 4 | ||
| 50 | #define R8A7791_CLK_SDHI2 11 | ||
| 51 | #define R8A7791_CLK_SDHI1 12 | ||
| 52 | #define R8A7791_CLK_SDHI0 14 | ||
| 53 | #define R8A7791_CLK_MMCIF0 15 | ||
| 54 | #define R8A7791_CLK_SSUSB 28 | ||
| 55 | #define R8A7791_CLK_CMT1 29 | ||
| 56 | #define R8A7791_CLK_USBDMAC0 30 | ||
| 57 | #define R8A7791_CLK_USBDMAC1 31 | ||
| 58 | |||
| 59 | /* MSTP5 */ | ||
| 60 | #define R8A7791_CLK_THERMAL 22 | ||
| 61 | #define R8A7791_CLK_PWM 23 | ||
| 62 | |||
| 63 | /* MSTP7 */ | ||
| 64 | #define R8A7791_CLK_HSUSB 4 | ||
| 65 | #define R8A7791_CLK_HSCIF2 13 | ||
| 66 | #define R8A7791_CLK_SCIF5 14 | ||
| 67 | #define R8A7791_CLK_SCIF4 15 | ||
| 68 | #define R8A7791_CLK_HSCIF1 16 | ||
| 69 | #define R8A7791_CLK_HSCIF0 17 | ||
| 70 | #define R8A7791_CLK_SCIF3 18 | ||
| 71 | #define R8A7791_CLK_SCIF2 19 | ||
| 72 | #define R8A7791_CLK_SCIF1 20 | ||
| 73 | #define R8A7791_CLK_SCIF0 21 | ||
| 74 | #define R8A7791_CLK_DU1 23 | ||
| 75 | #define R8A7791_CLK_DU0 24 | ||
| 76 | #define R8A7791_CLK_LVDS0 26 | ||
| 77 | |||
| 78 | /* MSTP8 */ | ||
| 79 | #define R8A7791_CLK_VIN2 9 | ||
| 80 | #define R8A7791_CLK_VIN1 10 | ||
| 81 | #define R8A7791_CLK_VIN0 11 | ||
| 82 | #define R8A7791_CLK_ETHER 13 | ||
| 83 | #define R8A7791_CLK_SATA1 14 | ||
| 84 | #define R8A7791_CLK_SATA0 15 | ||
| 85 | |||
| 86 | /* MSTP9 */ | ||
| 87 | #define R8A7791_CLK_GPIO7 4 | ||
| 88 | #define R8A7791_CLK_GPIO6 5 | ||
| 89 | #define R8A7791_CLK_GPIO5 7 | ||
| 90 | #define R8A7791_CLK_GPIO4 8 | ||
| 91 | #define R8A7791_CLK_GPIO3 9 | ||
| 92 | #define R8A7791_CLK_GPIO2 10 | ||
| 93 | #define R8A7791_CLK_GPIO1 11 | ||
| 94 | #define R8A7791_CLK_GPIO0 12 | ||
| 95 | #define R8A7791_CLK_RCAN1 15 | ||
| 96 | #define R8A7791_CLK_RCAN0 16 | ||
| 97 | #define R8A7791_CLK_QSPI_MOD 17 | ||
| 98 | #define R8A7791_CLK_I2C5 25 | ||
| 99 | #define R8A7791_CLK_IICDVFS 26 | ||
| 100 | #define R8A7791_CLK_I2C4 27 | ||
| 101 | #define R8A7791_CLK_I2C3 28 | ||
| 102 | #define R8A7791_CLK_I2C2 29 | ||
| 103 | #define R8A7791_CLK_I2C1 30 | ||
| 104 | #define R8A7791_CLK_I2C0 31 | ||
| 105 | |||
| 106 | /* MSTP11 */ | ||
| 107 | #define R8A7791_CLK_SCIFA3 6 | ||
| 108 | #define R8A7791_CLK_SCIFA4 7 | ||
| 109 | #define R8A7791_CLK_SCIFA5 8 | ||
| 110 | |||
| 111 | #endif /* __DT_BINDINGS_CLOCK_R8A7791_H__ */ | ||
diff --git a/include/dt-bindings/clock/tegra114-car.h b/include/dt-bindings/clock/tegra114-car.h index 614aec417902..6d0d8d8ef31e 100644 --- a/include/dt-bindings/clock/tegra114-car.h +++ b/include/dt-bindings/clock/tegra114-car.h | |||
| @@ -37,10 +37,10 @@ | |||
| 37 | #define TEGRA114_CLK_I2S2 18 | 37 | #define TEGRA114_CLK_I2S2 18 |
| 38 | #define TEGRA114_CLK_EPP 19 | 38 | #define TEGRA114_CLK_EPP 19 |
| 39 | /* 20 (register bit affects vi and vi_sensor) */ | 39 | /* 20 (register bit affects vi and vi_sensor) */ |
| 40 | #define TEGRA114_CLK_GR_2D 21 | 40 | #define TEGRA114_CLK_GR2D 21 |
| 41 | #define TEGRA114_CLK_USBD 22 | 41 | #define TEGRA114_CLK_USBD 22 |
| 42 | #define TEGRA114_CLK_ISP 23 | 42 | #define TEGRA114_CLK_ISP 23 |
| 43 | #define TEGRA114_CLK_GR_3D 24 | 43 | #define TEGRA114_CLK_GR3D 24 |
| 44 | /* 25 */ | 44 | /* 25 */ |
| 45 | #define TEGRA114_CLK_DISP2 26 | 45 | #define TEGRA114_CLK_DISP2 26 |
| 46 | #define TEGRA114_CLK_DISP1 27 | 46 | #define TEGRA114_CLK_DISP1 27 |
| @@ -289,8 +289,8 @@ | |||
| 289 | #define TEGRA114_CLK_PCLK 261 | 289 | #define TEGRA114_CLK_PCLK 261 |
| 290 | #define TEGRA114_CLK_CCLK_G 262 | 290 | #define TEGRA114_CLK_CCLK_G 262 |
| 291 | #define TEGRA114_CLK_CCLK_LP 263 | 291 | #define TEGRA114_CLK_CCLK_LP 263 |
| 292 | /* 264 */ | 292 | #define TEGRA114_CLK_DFLL_REF 264 |
| 293 | /* 265 */ | 293 | #define TEGRA114_CLK_DFLL_SOC 265 |
| 294 | /* 266 */ | 294 | /* 266 */ |
| 295 | /* 267 */ | 295 | /* 267 */ |
| 296 | /* 268 */ | 296 | /* 268 */ |
diff --git a/include/dt-bindings/clock/tegra124-car.h b/include/dt-bindings/clock/tegra124-car.h new file mode 100644 index 000000000000..a1116a3b54ef --- /dev/null +++ b/include/dt-bindings/clock/tegra124-car.h | |||
| @@ -0,0 +1,341 @@ | |||
| 1 | /* | ||
| 2 | * This header provides constants for binding nvidia,tegra124-car. | ||
| 3 | * | ||
| 4 | * The first 192 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB | ||
| 5 | * registers. These IDs often match those in the CAR's RST_DEVICES registers, | ||
| 6 | * but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In | ||
| 7 | * this case, those clocks are assigned IDs above 185 in order to highlight | ||
| 8 | * this issue. Implementations that interpret these clock IDs as bit values | ||
| 9 | * within the CLK_OUT_ENB or RST_DEVICES registers should be careful to | ||
| 10 | * explicitly handle these special cases. | ||
| 11 | * | ||
| 12 | * The balance of the clocks controlled by the CAR are assigned IDs of 185 and | ||
| 13 | * above. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef _DT_BINDINGS_CLOCK_TEGRA124_CAR_H | ||
| 17 | #define _DT_BINDINGS_CLOCK_TEGRA124_CAR_H | ||
| 18 | |||
| 19 | /* 0 */ | ||
| 20 | /* 1 */ | ||
| 21 | /* 2 */ | ||
| 22 | #define TEGRA124_CLK_ISPB 3 | ||
| 23 | #define TEGRA124_CLK_RTC 4 | ||
| 24 | #define TEGRA124_CLK_TIMER 5 | ||
| 25 | #define TEGRA124_CLK_UARTA 6 | ||
| 26 | /* 7 (register bit affects uartb and vfir) */ | ||
| 27 | /* 8 */ | ||
| 28 | #define TEGRA124_CLK_SDMMC2 9 | ||
| 29 | /* 10 (register bit affects spdif_in and spdif_out) */ | ||
| 30 | #define TEGRA124_CLK_I2S1 11 | ||
| 31 | #define TEGRA124_CLK_I2C1 12 | ||
| 32 | #define TEGRA124_CLK_NDFLASH 13 | ||
| 33 | #define TEGRA124_CLK_SDMMC1 14 | ||
| 34 | #define TEGRA124_CLK_SDMMC4 15 | ||
| 35 | /* 16 */ | ||
| 36 | #define TEGRA124_CLK_PWM 17 | ||
| 37 | #define TEGRA124_CLK_I2S2 18 | ||
| 38 | /* 20 (register bit affects vi and vi_sensor) */ | ||
| 39 | #define TEGRA124_CLK_GR_2D 21 | ||
| 40 | #define TEGRA124_CLK_USBD 22 | ||
| 41 | #define TEGRA124_CLK_ISP 23 | ||
| 42 | #define TEGRA124_CLK_GR_3D 24 | ||
| 43 | /* 25 */ | ||
| 44 | #define TEGRA124_CLK_DISP2 26 | ||
| 45 | #define TEGRA124_CLK_DISP1 27 | ||
| 46 | #define TEGRA124_CLK_HOST1X 28 | ||
| 47 | #define TEGRA124_CLK_VCP 29 | ||
| 48 | #define TEGRA124_CLK_I2S0 30 | ||
| 49 | /* 31 */ | ||
| 50 | |||
| 51 | /* 32 */ | ||
| 52 | /* 33 */ | ||
| 53 | #define TEGRA124_CLK_APBDMA 34 | ||
| 54 | /* 35 */ | ||
| 55 | #define TEGRA124_CLK_KBC 36 | ||
| 56 | /* 37 */ | ||
| 57 | /* 38 */ | ||
| 58 | /* 39 (register bit affects fuse and fuse_burn) */ | ||
| 59 | #define TEGRA124_CLK_KFUSE 40 | ||
| 60 | #define TEGRA124_CLK_SBC1 41 | ||
| 61 | #define TEGRA124_CLK_NOR 42 | ||
| 62 | /* 43 */ | ||
| 63 | #define TEGRA124_CLK_SBC2 44 | ||
| 64 | /* 45 */ | ||
| 65 | #define TEGRA124_CLK_SBC3 46 | ||
| 66 | #define TEGRA124_CLK_I2C5 47 | ||
| 67 | #define TEGRA124_CLK_DSIA 48 | ||
| 68 | /* 49 */ | ||
| 69 | #define TEGRA124_CLK_MIPI 50 | ||
| 70 | #define TEGRA124_CLK_HDMI 51 | ||
| 71 | #define TEGRA124_CLK_CSI 52 | ||
| 72 | /* 53 */ | ||
| 73 | #define TEGRA124_CLK_I2C2 54 | ||
| 74 | #define TEGRA124_CLK_UARTC 55 | ||
| 75 | #define TEGRA124_CLK_MIPI_CAL 56 | ||
| 76 | #define TEGRA124_CLK_EMC 57 | ||
| 77 | #define TEGRA124_CLK_USB2 58 | ||
| 78 | #define TEGRA124_CLK_USB3 59 | ||
| 79 | /* 60 */ | ||
| 80 | #define TEGRA124_CLK_VDE 61 | ||
| 81 | #define TEGRA124_CLK_BSEA 62 | ||
| 82 | #define TEGRA124_CLK_BSEV 63 | ||
| 83 | |||
| 84 | /* 64 */ | ||
| 85 | #define TEGRA124_CLK_UARTD 65 | ||
| 86 | #define TEGRA124_CLK_UARTE 66 | ||
| 87 | #define TEGRA124_CLK_I2C3 67 | ||
| 88 | #define TEGRA124_CLK_SBC4 68 | ||
| 89 | #define TEGRA124_CLK_SDMMC3 69 | ||
| 90 | #define TEGRA124_CLK_PCIE 70 | ||
| 91 | #define TEGRA124_CLK_OWR 71 | ||
| 92 | #define TEGRA124_CLK_AFI 72 | ||
| 93 | #define TEGRA124_CLK_CSITE 73 | ||
| 94 | /* 74 */ | ||
| 95 | /* 75 */ | ||
| 96 | #define TEGRA124_CLK_LA 76 | ||
| 97 | #define TEGRA124_CLK_TRACE 77 | ||
| 98 | #define TEGRA124_CLK_SOC_THERM 78 | ||
| 99 | #define TEGRA124_CLK_DTV 79 | ||
| 100 | #define TEGRA124_CLK_NDSPEED 80 | ||
| 101 | #define TEGRA124_CLK_I2CSLOW 81 | ||
| 102 | #define TEGRA124_CLK_DSIB 82 | ||
| 103 | #define TEGRA124_CLK_TSEC 83 | ||
| 104 | /* 84 */ | ||
| 105 | /* 85 */ | ||
| 106 | /* 86 */ | ||
| 107 | /* 87 */ | ||
| 108 | /* 88 */ | ||
| 109 | #define TEGRA124_CLK_XUSB_HOST 89 | ||
| 110 | /* 90 */ | ||
| 111 | #define TEGRA124_CLK_MSENC 91 | ||
| 112 | #define TEGRA124_CLK_CSUS 92 | ||
| 113 | /* 93 */ | ||
| 114 | /* 94 */ | ||
| 115 | /* 95 (bit affects xusb_dev and xusb_dev_src) */ | ||
| 116 | |||
| 117 | /* 96 */ | ||
| 118 | /* 97 */ | ||
| 119 | /* 98 */ | ||
| 120 | #define TEGRA124_CLK_MSELECT 99 | ||
| 121 | #define TEGRA124_CLK_TSENSOR 100 | ||
| 122 | #define TEGRA124_CLK_I2S3 101 | ||
| 123 | #define TEGRA124_CLK_I2S4 102 | ||
| 124 | #define TEGRA124_CLK_I2C4 103 | ||
| 125 | #define TEGRA124_CLK_SBC5 104 | ||
| 126 | #define TEGRA124_CLK_SBC6 105 | ||
| 127 | #define TEGRA124_CLK_D_AUDIO 106 | ||
| 128 | #define TEGRA124_CLK_APBIF 107 | ||
| 129 | #define TEGRA124_CLK_DAM0 108 | ||
| 130 | #define TEGRA124_CLK_DAM1 109 | ||
| 131 | #define TEGRA124_CLK_DAM2 110 | ||
| 132 | #define TEGRA124_CLK_HDA2CODEC_2X 111 | ||
| 133 | /* 112 */ | ||
| 134 | #define TEGRA124_CLK_AUDIO0_2X 113 | ||
| 135 | #define TEGRA124_CLK_AUDIO1_2X 114 | ||
| 136 | #define TEGRA124_CLK_AUDIO2_2X 115 | ||
| 137 | #define TEGRA124_CLK_AUDIO3_2X 116 | ||
| 138 | #define TEGRA124_CLK_AUDIO4_2X 117 | ||
| 139 | #define TEGRA124_CLK_SPDIF_2X 118 | ||
| 140 | #define TEGRA124_CLK_ACTMON 119 | ||
| 141 | #define TEGRA124_CLK_EXTERN1 120 | ||
| 142 | #define TEGRA124_CLK_EXTERN2 121 | ||
| 143 | #define TEGRA124_CLK_EXTERN3 122 | ||
| 144 | #define TEGRA124_CLK_SATA_OOB 123 | ||
| 145 | #define TEGRA124_CLK_SATA 124 | ||
| 146 | #define TEGRA124_CLK_HDA 125 | ||
| 147 | /* 126 */ | ||
| 148 | #define TEGRA124_CLK_SE 127 | ||
| 149 | |||
| 150 | #define TEGRA124_CLK_HDA2HDMI 128 | ||
| 151 | #define TEGRA124_CLK_SATA_COLD 129 | ||
| 152 | /* 130 */ | ||
| 153 | /* 131 */ | ||
| 154 | /* 132 */ | ||
| 155 | /* 133 */ | ||
| 156 | /* 134 */ | ||
| 157 | /* 135 */ | ||
| 158 | /* 136 */ | ||
| 159 | /* 137 */ | ||
| 160 | /* 138 */ | ||
| 161 | /* 139 */ | ||
| 162 | /* 140 */ | ||
| 163 | /* 141 */ | ||
| 164 | /* 142 */ | ||
| 165 | /* 143 (bit affects xusb_falcon_src, xusb_fs_src, */ | ||
| 166 | /* xusb_host_src and xusb_ss_src) */ | ||
| 167 | #define TEGRA124_CLK_CILAB 144 | ||
| 168 | #define TEGRA124_CLK_CILCD 145 | ||
| 169 | #define TEGRA124_CLK_CILE 146 | ||
| 170 | #define TEGRA124_CLK_DSIALP 147 | ||
| 171 | #define TEGRA124_CLK_DSIBLP 148 | ||
| 172 | #define TEGRA124_CLK_ENTROPY 149 | ||
| 173 | #define TEGRA124_CLK_DDS 150 | ||
| 174 | /* 151 */ | ||
| 175 | #define TEGRA124_CLK_DP2 152 | ||
| 176 | #define TEGRA124_CLK_AMX 153 | ||
| 177 | #define TEGRA124_CLK_ADX 154 | ||
| 178 | /* 155 (bit affects dfll_ref and dfll_soc) */ | ||
| 179 | #define TEGRA124_CLK_XUSB_SS 156 | ||
| 180 | /* 157 */ | ||
| 181 | /* 158 */ | ||
| 182 | /* 159 */ | ||
| 183 | |||
| 184 | /* 160 */ | ||
| 185 | /* 161 */ | ||
| 186 | /* 162 */ | ||
| 187 | /* 163 */ | ||
| 188 | /* 164 */ | ||
| 189 | /* 165 */ | ||
| 190 | #define TEGRA124_CLK_I2C6 166 | ||
| 191 | /* 167 */ | ||
| 192 | /* 168 */ | ||
| 193 | /* 169 */ | ||
| 194 | /* 170 */ | ||
| 195 | #define TEGRA124_CLK_VIM2_CLK 171 | ||
| 196 | /* 172 */ | ||
| 197 | /* 173 */ | ||
| 198 | /* 174 */ | ||
| 199 | /* 175 */ | ||
| 200 | #define TEGRA124_CLK_HDMI_AUDIO 176 | ||
| 201 | #define TEGRA124_CLK_CLK72MHZ 177 | ||
| 202 | #define TEGRA124_CLK_VIC03 178 | ||
| 203 | /* 179 */ | ||
| 204 | #define TEGRA124_CLK_ADX1 180 | ||
| 205 | #define TEGRA124_CLK_DPAUX 181 | ||
| 206 | #define TEGRA124_CLK_SOR0 182 | ||
| 207 | /* 183 */ | ||
| 208 | #define TEGRA124_CLK_GPU 184 | ||
| 209 | #define TEGRA124_CLK_AMX1 185 | ||
| 210 | /* 186 */ | ||
| 211 | /* 187 */ | ||
| 212 | /* 188 */ | ||
| 213 | /* 189 */ | ||
| 214 | /* 190 */ | ||
| 215 | /* 191 */ | ||
| 216 | #define TEGRA124_CLK_UARTB 192 | ||
| 217 | #define TEGRA124_CLK_VFIR 193 | ||
| 218 | #define TEGRA124_CLK_SPDIF_IN 194 | ||
| 219 | #define TEGRA124_CLK_SPDIF_OUT 195 | ||
| 220 | #define TEGRA124_CLK_VI 196 | ||
| 221 | #define TEGRA124_CLK_VI_SENSOR 197 | ||
| 222 | #define TEGRA124_CLK_FUSE 198 | ||
| 223 | #define TEGRA124_CLK_FUSE_BURN 199 | ||
| 224 | #define TEGRA124_CLK_CLK_32K 200 | ||
| 225 | #define TEGRA124_CLK_CLK_M 201 | ||
| 226 | #define TEGRA124_CLK_CLK_M_DIV2 202 | ||
| 227 | #define TEGRA124_CLK_CLK_M_DIV4 203 | ||
| 228 | #define TEGRA124_CLK_PLL_REF 204 | ||
| 229 | #define TEGRA124_CLK_PLL_C 205 | ||
| 230 | #define TEGRA124_CLK_PLL_C_OUT1 206 | ||
| 231 | #define TEGRA124_CLK_PLL_C2 207 | ||
| 232 | #define TEGRA124_CLK_PLL_C3 208 | ||
| 233 | #define TEGRA124_CLK_PLL_M 209 | ||
| 234 | #define TEGRA124_CLK_PLL_M_OUT1 210 | ||
| 235 | #define TEGRA124_CLK_PLL_P 211 | ||
| 236 | #define TEGRA124_CLK_PLL_P_OUT1 212 | ||
| 237 | #define TEGRA124_CLK_PLL_P_OUT2 213 | ||
| 238 | #define TEGRA124_CLK_PLL_P_OUT3 214 | ||
| 239 | #define TEGRA124_CLK_PLL_P_OUT4 215 | ||
| 240 | #define TEGRA124_CLK_PLL_A 216 | ||
| 241 | #define TEGRA124_CLK_PLL_A_OUT0 217 | ||
| 242 | #define TEGRA124_CLK_PLL_D 218 | ||
| 243 | #define TEGRA124_CLK_PLL_D_OUT0 219 | ||
| 244 | #define TEGRA124_CLK_PLL_D2 220 | ||
| 245 | #define TEGRA124_CLK_PLL_D2_OUT0 221 | ||
| 246 | #define TEGRA124_CLK_PLL_U 222 | ||
| 247 | #define TEGRA124_CLK_PLL_U_480M 223 | ||
| 248 | |||
| 249 | #define TEGRA124_CLK_PLL_U_60M 224 | ||
| 250 | #define TEGRA124_CLK_PLL_U_48M 225 | ||
| 251 | #define TEGRA124_CLK_PLL_U_12M 226 | ||
| 252 | #define TEGRA124_CLK_PLL_X 227 | ||
| 253 | #define TEGRA124_CLK_PLL_X_OUT0 228 | ||
| 254 | #define TEGRA124_CLK_PLL_RE_VCO 229 | ||
| 255 | #define TEGRA124_CLK_PLL_RE_OUT 230 | ||
| 256 | #define TEGRA124_CLK_PLL_E 231 | ||
| 257 | #define TEGRA124_CLK_SPDIF_IN_SYNC 232 | ||
| 258 | #define TEGRA124_CLK_I2S0_SYNC 233 | ||
| 259 | #define TEGRA124_CLK_I2S1_SYNC 234 | ||
| 260 | #define TEGRA124_CLK_I2S2_SYNC 235 | ||
| 261 | #define TEGRA124_CLK_I2S3_SYNC 236 | ||
| 262 | #define TEGRA124_CLK_I2S4_SYNC 237 | ||
| 263 | #define TEGRA124_CLK_VIMCLK_SYNC 238 | ||
| 264 | #define TEGRA124_CLK_AUDIO0 239 | ||
| 265 | #define TEGRA124_CLK_AUDIO1 240 | ||
| 266 | #define TEGRA124_CLK_AUDIO2 241 | ||
| 267 | #define TEGRA124_CLK_AUDIO3 242 | ||
| 268 | #define TEGRA124_CLK_AUDIO4 243 | ||
| 269 | #define TEGRA124_CLK_SPDIF 244 | ||
| 270 | #define TEGRA124_CLK_CLK_OUT_1 245 | ||
| 271 | #define TEGRA124_CLK_CLK_OUT_2 246 | ||
| 272 | #define TEGRA124_CLK_CLK_OUT_3 247 | ||
| 273 | #define TEGRA124_CLK_BLINK 248 | ||
| 274 | /* 249 */ | ||
| 275 | /* 250 */ | ||
| 276 | /* 251 */ | ||
| 277 | #define TEGRA124_CLK_XUSB_HOST_SRC 252 | ||
| 278 | #define TEGRA124_CLK_XUSB_FALCON_SRC 253 | ||
| 279 | #define TEGRA124_CLK_XUSB_FS_SRC 254 | ||
| 280 | #define TEGRA124_CLK_XUSB_SS_SRC 255 | ||
| 281 | |||
| 282 | #define TEGRA124_CLK_XUSB_DEV_SRC 256 | ||
| 283 | #define TEGRA124_CLK_XUSB_DEV 257 | ||
| 284 | #define TEGRA124_CLK_XUSB_HS_SRC 258 | ||
| 285 | #define TEGRA124_CLK_SCLK 259 | ||
| 286 | #define TEGRA124_CLK_HCLK 260 | ||
| 287 | #define TEGRA124_CLK_PCLK 261 | ||
| 288 | #define TEGRA124_CLK_CCLK_G 262 | ||
| 289 | #define TEGRA124_CLK_CCLK_LP 263 | ||
| 290 | #define TEGRA124_CLK_DFLL_REF 264 | ||
| 291 | #define TEGRA124_CLK_DFLL_SOC 265 | ||
| 292 | #define TEGRA124_CLK_VI_SENSOR2 266 | ||
| 293 | #define TEGRA124_CLK_PLL_P_OUT5 267 | ||
| 294 | #define TEGRA124_CLK_CML0 268 | ||
| 295 | #define TEGRA124_CLK_CML1 269 | ||
| 296 | #define TEGRA124_CLK_PLL_C4 270 | ||
| 297 | #define TEGRA124_CLK_PLL_DP 271 | ||
| 298 | #define TEGRA124_CLK_PLL_E_MUX 272 | ||
| 299 | /* 273 */ | ||
| 300 | /* 274 */ | ||
| 301 | /* 275 */ | ||
| 302 | /* 276 */ | ||
| 303 | /* 277 */ | ||
| 304 | /* 278 */ | ||
| 305 | /* 279 */ | ||
| 306 | /* 280 */ | ||
| 307 | /* 281 */ | ||
| 308 | /* 282 */ | ||
| 309 | /* 283 */ | ||
| 310 | /* 284 */ | ||
| 311 | /* 285 */ | ||
| 312 | /* 286 */ | ||
| 313 | /* 287 */ | ||
| 314 | |||
| 315 | /* 288 */ | ||
| 316 | /* 289 */ | ||
| 317 | /* 290 */ | ||
| 318 | /* 291 */ | ||
| 319 | /* 292 */ | ||
| 320 | /* 293 */ | ||
| 321 | /* 294 */ | ||
| 322 | /* 295 */ | ||
| 323 | /* 296 */ | ||
| 324 | /* 297 */ | ||
| 325 | /* 298 */ | ||
| 326 | /* 299 */ | ||
| 327 | #define TEGRA124_CLK_AUDIO0_MUX 300 | ||
| 328 | #define TEGRA124_CLK_AUDIO1_MUX 301 | ||
| 329 | #define TEGRA124_CLK_AUDIO2_MUX 302 | ||
| 330 | #define TEGRA124_CLK_AUDIO3_MUX 303 | ||
| 331 | #define TEGRA124_CLK_AUDIO4_MUX 304 | ||
| 332 | #define TEGRA124_CLK_SPDIF_MUX 305 | ||
| 333 | #define TEGRA124_CLK_CLK_OUT_1_MUX 306 | ||
| 334 | #define TEGRA124_CLK_CLK_OUT_2_MUX 307 | ||
| 335 | #define TEGRA124_CLK_CLK_OUT_3_MUX 308 | ||
| 336 | #define TEGRA124_CLK_DSIA_MUX 309 | ||
| 337 | #define TEGRA124_CLK_DSIB_MUX 310 | ||
| 338 | #define TEGRA124_CLK_SOR0_LVDS 311 | ||
| 339 | #define TEGRA124_CLK_CLK_MAX 312 | ||
| 340 | |||
| 341 | #endif /* _DT_BINDINGS_CLOCK_TEGRA124_CAR_H */ | ||
diff --git a/include/dt-bindings/clock/tegra20-car.h b/include/dt-bindings/clock/tegra20-car.h index a1ae9a8fdd6c..9406207cfac8 100644 --- a/include/dt-bindings/clock/tegra20-car.h +++ b/include/dt-bindings/clock/tegra20-car.h | |||
| @@ -92,7 +92,7 @@ | |||
| 92 | #define TEGRA20_CLK_OWR 71 | 92 | #define TEGRA20_CLK_OWR 71 |
| 93 | #define TEGRA20_CLK_AFI 72 | 93 | #define TEGRA20_CLK_AFI 72 |
| 94 | #define TEGRA20_CLK_CSITE 73 | 94 | #define TEGRA20_CLK_CSITE 73 |
| 95 | #define TEGRA20_CLK_PCIE_XCLK 74 | 95 | /* 74 */ |
| 96 | #define TEGRA20_CLK_AVPUCQ 75 | 96 | #define TEGRA20_CLK_AVPUCQ 75 |
| 97 | #define TEGRA20_CLK_LA 76 | 97 | #define TEGRA20_CLK_LA 76 |
| 98 | /* 77 */ | 98 | /* 77 */ |
diff --git a/include/dt-bindings/clock/tegra30-car.h b/include/dt-bindings/clock/tegra30-car.h index e40fae8f9a8d..889e49ba0aa3 100644 --- a/include/dt-bindings/clock/tegra30-car.h +++ b/include/dt-bindings/clock/tegra30-car.h | |||
| @@ -92,7 +92,7 @@ | |||
| 92 | #define TEGRA30_CLK_OWR 71 | 92 | #define TEGRA30_CLK_OWR 71 |
| 93 | #define TEGRA30_CLK_AFI 72 | 93 | #define TEGRA30_CLK_AFI 72 |
| 94 | #define TEGRA30_CLK_CSITE 73 | 94 | #define TEGRA30_CLK_CSITE 73 |
| 95 | #define TEGRA30_CLK_PCIEX 74 | 95 | /* 74 */ |
| 96 | #define TEGRA30_CLK_AVPUCQ 75 | 96 | #define TEGRA30_CLK_AVPUCQ 75 |
| 97 | #define TEGRA30_CLK_LA 76 | 97 | #define TEGRA30_CLK_LA 76 |
| 98 | /* 77 */ | 98 | /* 77 */ |
| @@ -260,6 +260,14 @@ | |||
| 260 | /* 298 */ | 260 | /* 298 */ |
| 261 | /* 299 */ | 261 | /* 299 */ |
| 262 | #define TEGRA30_CLK_CLK_OUT_1_MUX 300 | 262 | #define TEGRA30_CLK_CLK_OUT_1_MUX 300 |
| 263 | #define TEGRA30_CLK_CLK_MAX 301 | 263 | #define TEGRA30_CLK_CLK_OUT_2_MUX 301 |
| 264 | #define TEGRA30_CLK_CLK_OUT_3_MUX 302 | ||
| 265 | #define TEGRA30_CLK_AUDIO0_MUX 303 | ||
| 266 | #define TEGRA30_CLK_AUDIO1_MUX 304 | ||
| 267 | #define TEGRA30_CLK_AUDIO2_MUX 305 | ||
| 268 | #define TEGRA30_CLK_AUDIO3_MUX 306 | ||
| 269 | #define TEGRA30_CLK_AUDIO4_MUX 307 | ||
| 270 | #define TEGRA30_CLK_SPDIF_MUX 308 | ||
| 271 | #define TEGRA30_CLK_CLK_MAX 309 | ||
| 264 | 272 | ||
| 265 | #endif /* _DT_BINDINGS_CLOCK_TEGRA30_CAR_H */ | 273 | #endif /* _DT_BINDINGS_CLOCK_TEGRA30_CAR_H */ |
diff --git a/include/dt-bindings/clock/vf610-clock.h b/include/dt-bindings/clock/vf610-clock.h index 4aa2b48cd151..a91602951d3d 100644 --- a/include/dt-bindings/clock/vf610-clock.h +++ b/include/dt-bindings/clock/vf610-clock.h | |||
| @@ -160,6 +160,10 @@ | |||
| 160 | #define VF610_CLK_GPU2D 147 | 160 | #define VF610_CLK_GPU2D 147 |
| 161 | #define VF610_CLK_ENET0 148 | 161 | #define VF610_CLK_ENET0 148 |
| 162 | #define VF610_CLK_ENET1 149 | 162 | #define VF610_CLK_ENET1 149 |
| 163 | #define VF610_CLK_END 150 | 163 | #define VF610_CLK_DMAMUX0 150 |
| 164 | #define VF610_CLK_DMAMUX1 151 | ||
| 165 | #define VF610_CLK_DMAMUX2 152 | ||
| 166 | #define VF610_CLK_DMAMUX3 153 | ||
| 167 | #define VF610_CLK_END 154 | ||
| 164 | 168 | ||
| 165 | #endif /* __DT_BINDINGS_CLOCK_VF610_H */ | 169 | #endif /* __DT_BINDINGS_CLOCK_VF610_H */ |
diff --git a/include/dt-bindings/gpio/tegra-gpio.h b/include/dt-bindings/gpio/tegra-gpio.h index 4d179c00f081..197dc28b676e 100644 --- a/include/dt-bindings/gpio/tegra-gpio.h +++ b/include/dt-bindings/gpio/tegra-gpio.h | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | #define TEGRA_GPIO_BANK_ID_CC 28 | 43 | #define TEGRA_GPIO_BANK_ID_CC 28 |
| 44 | #define TEGRA_GPIO_BANK_ID_DD 29 | 44 | #define TEGRA_GPIO_BANK_ID_DD 29 |
| 45 | #define TEGRA_GPIO_BANK_ID_EE 30 | 45 | #define TEGRA_GPIO_BANK_ID_EE 30 |
| 46 | #define TEGRA_GPIO_BANK_ID_FF 31 | ||
| 46 | 47 | ||
| 47 | #define TEGRA_GPIO(bank, offset) \ | 48 | #define TEGRA_GPIO(bank, offset) \ |
| 48 | ((TEGRA_GPIO_BANK_ID_##bank * 8) + offset) | 49 | ((TEGRA_GPIO_BANK_ID_##bank * 8) + offset) |
diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h index bed35e36fd27..b04528cd033c 100644 --- a/include/dt-bindings/pinctrl/omap.h +++ b/include/dt-bindings/pinctrl/omap.h | |||
| @@ -49,5 +49,25 @@ | |||
| 49 | #define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN) | 49 | #define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN) |
| 50 | #define PIN_OFF_WAKEUPENABLE WAKEUP_EN | 50 | #define PIN_OFF_WAKEUPENABLE WAKEUP_EN |
| 51 | 51 | ||
| 52 | /* | ||
| 53 | * Macros to allow using the absolute physical address instead of the | ||
| 54 | * padconf registers instead of the offset from padconf base. | ||
| 55 | */ | ||
| 56 | #define OMAP_IOPAD_OFFSET(pa, offset) (((pa) & 0xffff) - (offset)) | ||
| 57 | |||
| 58 | #define OMAP2420_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0030) (val) | ||
| 59 | #define OMAP2430_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2030) (val) | ||
| 60 | #define OMAP3_CORE1_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2030) (val) | ||
| 61 | #define OMAP3430_CORE2_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x25d8) (val) | ||
| 62 | #define OMAP3630_CORE2_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x25a0) (val) | ||
| 63 | #define OMAP3_WKUP_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2a00) (val) | ||
| 64 | #define AM33XX_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) | ||
| 65 | #define OMAP4_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0040) (val) | ||
| 66 | #define OMAP4_WKUP_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0xe040) (val) | ||
| 67 | #define AM4372_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) | ||
| 68 | #define OMAP5_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2840) (val) | ||
| 69 | #define OMAP5_WKUP_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0xc840) (val) | ||
| 70 | #define DRA7XX_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x3400) (val) | ||
| 71 | |||
| 52 | #endif | 72 | #endif |
| 53 | 73 | ||
diff --git a/include/dt-bindings/pinctrl/pinctrl-tegra.h b/include/dt-bindings/pinctrl/pinctrl-tegra.h new file mode 100644 index 000000000000..ebafa498be0f --- /dev/null +++ b/include/dt-bindings/pinctrl/pinctrl-tegra.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* | ||
| 2 | * This header provides constants for Tegra pinctrl bindings. | ||
| 3 | * | ||
| 4 | * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved. | ||
| 5 | * | ||
| 6 | * Author: Laxman Dewangan <ldewangan@nvidia.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify it | ||
| 9 | * under the terms and conditions 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 it will be useful, but WITHOUT | ||
| 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 15 | * more details. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef _DT_BINDINGS_PINCTRL_TEGRA_H | ||
| 19 | #define _DT_BINDINGS_PINCTRL_TEGRA_H | ||
| 20 | |||
| 21 | /* | ||
| 22 | * Enable/disable for diffeent dt properties. This is applicable for | ||
| 23 | * properties nvidia,enable-input, nvidia,tristate, nvidia,open-drain, | ||
| 24 | * nvidia,lock, nvidia,rcv-sel, nvidia,high-speed-mode, nvidia,schmitt. | ||
| 25 | */ | ||
| 26 | #define TEGRA_PIN_DISABLE 0 | ||
| 27 | #define TEGRA_PIN_ENABLE 1 | ||
| 28 | |||
| 29 | #define TEGRA_PIN_PULL_NONE 0 | ||
| 30 | #define TEGRA_PIN_PULL_DOWN 1 | ||
| 31 | #define TEGRA_PIN_PULL_UP 2 | ||
| 32 | |||
| 33 | /* Low power mode driver */ | ||
| 34 | #define TEGRA_PIN_LP_DRIVE_DIV_8 0 | ||
| 35 | #define TEGRA_PIN_LP_DRIVE_DIV_4 1 | ||
| 36 | #define TEGRA_PIN_LP_DRIVE_DIV_2 2 | ||
| 37 | #define TEGRA_PIN_LP_DRIVE_DIV_1 3 | ||
| 38 | |||
| 39 | /* Rising/Falling slew rate */ | ||
| 40 | #define TEGRA_PIN_SLEW_RATE_FASTEST 0 | ||
| 41 | #define TEGRA_PIN_SLEW_RATE_FAST 1 | ||
| 42 | #define TEGRA_PIN_SLEW_RATE_SLOW 2 | ||
| 43 | #define TEGRA_PIN_SLEW_RATE_SLOWEST 3 | ||
| 44 | |||
| 45 | #endif | ||
diff --git a/include/dt-bindings/reset/qcom,gcc-msm8660.h b/include/dt-bindings/reset/qcom,gcc-msm8660.h new file mode 100644 index 000000000000..a83282fe5465 --- /dev/null +++ b/include/dt-bindings/reset/qcom,gcc-msm8660.h | |||
| @@ -0,0 +1,134 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_RESET_MSM_GCC_8660_H | ||
| 15 | #define _DT_BINDINGS_RESET_MSM_GCC_8660_H | ||
| 16 | |||
| 17 | #define AFAB_CORE_RESET 0 | ||
| 18 | #define SCSS_SYS_RESET 1 | ||
| 19 | #define SCSS_SYS_POR_RESET 2 | ||
| 20 | #define AFAB_SMPSS_S_RESET 3 | ||
| 21 | #define AFAB_SMPSS_M1_RESET 4 | ||
| 22 | #define AFAB_SMPSS_M0_RESET 5 | ||
| 23 | #define AFAB_EBI1_S_RESET 6 | ||
| 24 | #define SFAB_CORE_RESET 7 | ||
| 25 | #define SFAB_ADM0_M0_RESET 8 | ||
| 26 | #define SFAB_ADM0_M1_RESET 9 | ||
| 27 | #define SFAB_ADM0_M2_RESET 10 | ||
| 28 | #define ADM0_C2_RESET 11 | ||
| 29 | #define ADM0_C1_RESET 12 | ||
| 30 | #define ADM0_C0_RESET 13 | ||
| 31 | #define ADM0_PBUS_RESET 14 | ||
| 32 | #define ADM0_RESET 15 | ||
| 33 | #define SFAB_ADM1_M0_RESET 16 | ||
| 34 | #define SFAB_ADM1_M1_RESET 17 | ||
| 35 | #define SFAB_ADM1_M2_RESET 18 | ||
| 36 | #define MMFAB_ADM1_M3_RESET 19 | ||
| 37 | #define ADM1_C3_RESET 20 | ||
| 38 | #define ADM1_C2_RESET 21 | ||
| 39 | #define ADM1_C1_RESET 22 | ||
| 40 | #define ADM1_C0_RESET 23 | ||
| 41 | #define ADM1_PBUS_RESET 24 | ||
| 42 | #define ADM1_RESET 25 | ||
| 43 | #define IMEM0_RESET 26 | ||
| 44 | #define SFAB_LPASS_Q6_RESET 27 | ||
| 45 | #define SFAB_AFAB_M_RESET 28 | ||
| 46 | #define AFAB_SFAB_M0_RESET 29 | ||
| 47 | #define AFAB_SFAB_M1_RESET 30 | ||
| 48 | #define DFAB_CORE_RESET 31 | ||
| 49 | #define SFAB_DFAB_M_RESET 32 | ||
| 50 | #define DFAB_SFAB_M_RESET 33 | ||
| 51 | #define DFAB_SWAY0_RESET 34 | ||
| 52 | #define DFAB_SWAY1_RESET 35 | ||
| 53 | #define DFAB_ARB0_RESET 36 | ||
| 54 | #define DFAB_ARB1_RESET 37 | ||
| 55 | #define PPSS_PROC_RESET 38 | ||
| 56 | #define PPSS_RESET 39 | ||
| 57 | #define PMEM_RESET 40 | ||
| 58 | #define DMA_BAM_RESET 41 | ||
| 59 | #define SIC_RESET 42 | ||
| 60 | #define SPS_TIC_RESET 43 | ||
| 61 | #define CFBP0_RESET 44 | ||
| 62 | #define CFBP1_RESET 45 | ||
| 63 | #define CFBP2_RESET 46 | ||
| 64 | #define EBI2_RESET 47 | ||
| 65 | #define SFAB_CFPB_M_RESET 48 | ||
| 66 | #define CFPB_MASTER_RESET 49 | ||
| 67 | #define SFAB_CFPB_S_RESET 50 | ||
| 68 | #define CFPB_SPLITTER_RESET 51 | ||
| 69 | #define TSIF_RESET 52 | ||
| 70 | #define CE1_RESET 53 | ||
| 71 | #define CE2_RESET 54 | ||
| 72 | #define SFAB_SFPB_M_RESET 55 | ||
| 73 | #define SFAB_SFPB_S_RESET 56 | ||
| 74 | #define RPM_PROC_RESET 57 | ||
| 75 | #define RPM_BUS_RESET 58 | ||
| 76 | #define RPM_MSG_RAM_RESET 59 | ||
| 77 | #define PMIC_ARB0_RESET 60 | ||
| 78 | #define PMIC_ARB1_RESET 61 | ||
| 79 | #define PMIC_SSBI2_RESET 62 | ||
| 80 | #define SDC1_RESET 63 | ||
| 81 | #define SDC2_RESET 64 | ||
| 82 | #define SDC3_RESET 65 | ||
| 83 | #define SDC4_RESET 66 | ||
| 84 | #define SDC5_RESET 67 | ||
| 85 | #define USB_HS1_RESET 68 | ||
| 86 | #define USB_HS2_XCVR_RESET 69 | ||
| 87 | #define USB_HS2_RESET 70 | ||
| 88 | #define USB_FS1_XCVR_RESET 71 | ||
| 89 | #define USB_FS1_RESET 72 | ||
| 90 | #define USB_FS2_XCVR_RESET 73 | ||
| 91 | #define USB_FS2_RESET 74 | ||
| 92 | #define GSBI1_RESET 75 | ||
| 93 | #define GSBI2_RESET 76 | ||
| 94 | #define GSBI3_RESET 77 | ||
| 95 | #define GSBI4_RESET 78 | ||
| 96 | #define GSBI5_RESET 79 | ||
| 97 | #define GSBI6_RESET 80 | ||
| 98 | #define GSBI7_RESET 81 | ||
| 99 | #define GSBI8_RESET 82 | ||
| 100 | #define GSBI9_RESET 83 | ||
| 101 | #define GSBI10_RESET 84 | ||
| 102 | #define GSBI11_RESET 85 | ||
| 103 | #define GSBI12_RESET 86 | ||
| 104 | #define SPDM_RESET 87 | ||
| 105 | #define SEC_CTRL_RESET 88 | ||
| 106 | #define TLMM_H_RESET 89 | ||
| 107 | #define TLMM_RESET 90 | ||
| 108 | #define MARRM_PWRON_RESET 91 | ||
| 109 | #define MARM_RESET 92 | ||
| 110 | #define MAHB1_RESET 93 | ||
| 111 | #define SFAB_MSS_S_RESET 94 | ||
| 112 | #define MAHB2_RESET 95 | ||
| 113 | #define MODEM_SW_AHB_RESET 96 | ||
| 114 | #define MODEM_RESET 97 | ||
| 115 | #define SFAB_MSS_MDM1_RESET 98 | ||
| 116 | #define SFAB_MSS_MDM0_RESET 99 | ||
| 117 | #define MSS_SLP_RESET 100 | ||
| 118 | #define MSS_MARM_SAW_RESET 101 | ||
| 119 | #define MSS_WDOG_RESET 102 | ||
| 120 | #define TSSC_RESET 103 | ||
| 121 | #define PDM_RESET 104 | ||
| 122 | #define SCSS_CORE0_RESET 105 | ||
| 123 | #define SCSS_CORE0_POR_RESET 106 | ||
| 124 | #define SCSS_CORE1_RESET 107 | ||
| 125 | #define SCSS_CORE1_POR_RESET 108 | ||
| 126 | #define MPM_RESET 109 | ||
| 127 | #define EBI1_1X_DIV_RESET 110 | ||
| 128 | #define EBI1_RESET 111 | ||
| 129 | #define SFAB_SMPSS_S_RESET 112 | ||
| 130 | #define USB_PHY0_RESET 113 | ||
| 131 | #define USB_PHY1_RESET 114 | ||
| 132 | #define PRNG_RESET 115 | ||
| 133 | |||
| 134 | #endif | ||
diff --git a/include/dt-bindings/reset/qcom,gcc-msm8960.h b/include/dt-bindings/reset/qcom,gcc-msm8960.h new file mode 100644 index 000000000000..a840e680323c --- /dev/null +++ b/include/dt-bindings/reset/qcom,gcc-msm8960.h | |||
| @@ -0,0 +1,118 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_RESET_MSM_GCC_8960_H | ||
| 15 | #define _DT_BINDINGS_RESET_MSM_GCC_8960_H | ||
| 16 | |||
| 17 | #define SFAB_MSS_Q6_SW_RESET 0 | ||
| 18 | #define SFAB_MSS_Q6_FW_RESET 1 | ||
| 19 | #define QDSS_STM_RESET 2 | ||
| 20 | #define AFAB_SMPSS_S_RESET 3 | ||
| 21 | #define AFAB_SMPSS_M1_RESET 4 | ||
| 22 | #define AFAB_SMPSS_M0_RESET 5 | ||
| 23 | #define AFAB_EBI1_CH0_RESET 6 | ||
| 24 | #define AFAB_EBI1_CH1_RESET 7 | ||
| 25 | #define SFAB_ADM0_M0_RESET 8 | ||
| 26 | #define SFAB_ADM0_M1_RESET 9 | ||
| 27 | #define SFAB_ADM0_M2_RESET 10 | ||
| 28 | #define ADM0_C2_RESET 11 | ||
| 29 | #define ADM0_C1_RESET 12 | ||
| 30 | #define ADM0_C0_RESET 13 | ||
| 31 | #define ADM0_PBUS_RESET 14 | ||
| 32 | #define ADM0_RESET 15 | ||
| 33 | #define QDSS_CLKS_SW_RESET 16 | ||
| 34 | #define QDSS_POR_RESET 17 | ||
| 35 | #define QDSS_TSCTR_RESET 18 | ||
| 36 | #define QDSS_HRESET_RESET 19 | ||
| 37 | #define QDSS_AXI_RESET 20 | ||
| 38 | #define QDSS_DBG_RESET 21 | ||
| 39 | #define PCIE_A_RESET 22 | ||
| 40 | #define PCIE_AUX_RESET 23 | ||
| 41 | #define PCIE_H_RESET 24 | ||
| 42 | #define SFAB_PCIE_M_RESET 25 | ||
| 43 | #define SFAB_PCIE_S_RESET 26 | ||
| 44 | #define SFAB_MSS_M_RESET 27 | ||
| 45 | #define SFAB_USB3_M_RESET 28 | ||
| 46 | #define SFAB_RIVA_M_RESET 29 | ||
| 47 | #define SFAB_LPASS_RESET 30 | ||
| 48 | #define SFAB_AFAB_M_RESET 31 | ||
| 49 | #define AFAB_SFAB_M0_RESET 32 | ||
| 50 | #define AFAB_SFAB_M1_RESET 33 | ||
| 51 | #define SFAB_SATA_S_RESET 34 | ||
| 52 | #define SFAB_DFAB_M_RESET 35 | ||
| 53 | #define DFAB_SFAB_M_RESET 36 | ||
| 54 | #define DFAB_SWAY0_RESET 37 | ||
| 55 | #define DFAB_SWAY1_RESET 38 | ||
| 56 | #define DFAB_ARB0_RESET 39 | ||
| 57 | #define DFAB_ARB1_RESET 40 | ||
| 58 | #define PPSS_PROC_RESET 41 | ||
| 59 | #define PPSS_RESET 42 | ||
| 60 | #define DMA_BAM_RESET 43 | ||
| 61 | #define SIC_TIC_RESET 44 | ||
| 62 | #define SLIMBUS_H_RESET 45 | ||
| 63 | #define SFAB_CFPB_M_RESET 46 | ||
| 64 | #define SFAB_CFPB_S_RESET 47 | ||
| 65 | #define TSIF_H_RESET 48 | ||
| 66 | #define CE1_H_RESET 49 | ||
| 67 | #define CE1_CORE_RESET 50 | ||
| 68 | #define CE1_SLEEP_RESET 51 | ||
| 69 | #define CE2_H_RESET 52 | ||
| 70 | #define CE2_CORE_RESET 53 | ||
| 71 | #define SFAB_SFPB_M_RESET 54 | ||
| 72 | #define SFAB_SFPB_S_RESET 55 | ||
| 73 | #define RPM_PROC_RESET 56 | ||
| 74 | #define PMIC_SSBI2_RESET 57 | ||
| 75 | #define SDC1_RESET 58 | ||
| 76 | #define SDC2_RESET 59 | ||
| 77 | #define SDC3_RESET 60 | ||
| 78 | #define SDC4_RESET 61 | ||
| 79 | #define SDC5_RESET 62 | ||
| 80 | #define DFAB_A2_RESET 63 | ||
| 81 | #define USB_HS1_RESET 64 | ||
| 82 | #define USB_HSIC_RESET 65 | ||
| 83 | #define USB_FS1_XCVR_RESET 66 | ||
| 84 | #define USB_FS1_RESET 67 | ||
| 85 | #define USB_FS2_XCVR_RESET 68 | ||
| 86 | #define USB_FS2_RESET 69 | ||
| 87 | #define GSBI1_RESET 70 | ||
| 88 | #define GSBI2_RESET 71 | ||
| 89 | #define GSBI3_RESET 72 | ||
| 90 | #define GSBI4_RESET 73 | ||
| 91 | #define GSBI5_RESET 74 | ||
| 92 | #define GSBI6_RESET 75 | ||
| 93 | #define GSBI7_RESET 76 | ||
| 94 | #define GSBI8_RESET 77 | ||
| 95 | #define GSBI9_RESET 78 | ||
| 96 | #define GSBI10_RESET 79 | ||
| 97 | #define GSBI11_RESET 80 | ||
| 98 | #define GSBI12_RESET 81 | ||
| 99 | #define SPDM_RESET 82 | ||
| 100 | #define TLMM_H_RESET 83 | ||
| 101 | #define SFAB_MSS_S_RESET 84 | ||
| 102 | #define MSS_SLP_RESET 85 | ||
| 103 | #define MSS_Q6SW_JTAG_RESET 86 | ||
| 104 | #define MSS_Q6FW_JTAG_RESET 87 | ||
| 105 | #define MSS_RESET 88 | ||
| 106 | #define SATA_H_RESET 89 | ||
| 107 | #define SATA_RXOOB_RESE 90 | ||
| 108 | #define SATA_PMALIVE_RESET 91 | ||
| 109 | #define SATA_SFAB_M_RESET 92 | ||
| 110 | #define TSSC_RESET 93 | ||
| 111 | #define PDM_RESET 94 | ||
| 112 | #define MPM_H_RESET 95 | ||
| 113 | #define MPM_RESET 96 | ||
| 114 | #define SFAB_SMPSS_S_RESET 97 | ||
| 115 | #define PRNG_RESET 98 | ||
| 116 | #define RIVA_RESET 99 | ||
| 117 | |||
| 118 | #endif | ||
diff --git a/include/dt-bindings/reset/qcom,gcc-msm8974.h b/include/dt-bindings/reset/qcom,gcc-msm8974.h new file mode 100644 index 000000000000..9bdf54322938 --- /dev/null +++ b/include/dt-bindings/reset/qcom,gcc-msm8974.h | |||
| @@ -0,0 +1,96 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_RESET_MSM_GCC_8974_H | ||
| 15 | #define _DT_BINDINGS_RESET_MSM_GCC_8974_H | ||
| 16 | |||
| 17 | #define GCC_SYSTEM_NOC_BCR 0 | ||
| 18 | #define GCC_CONFIG_NOC_BCR 1 | ||
| 19 | #define GCC_PERIPH_NOC_BCR 2 | ||
| 20 | #define GCC_IMEM_BCR 3 | ||
| 21 | #define GCC_MMSS_BCR 4 | ||
| 22 | #define GCC_QDSS_BCR 5 | ||
| 23 | #define GCC_USB_30_BCR 6 | ||
| 24 | #define GCC_USB3_PHY_BCR 7 | ||
| 25 | #define GCC_USB_HS_HSIC_BCR 8 | ||
| 26 | #define GCC_USB_HS_BCR 9 | ||
| 27 | #define GCC_USB2A_PHY_BCR 10 | ||
| 28 | #define GCC_USB2B_PHY_BCR 11 | ||
| 29 | #define GCC_SDCC1_BCR 12 | ||
| 30 | #define GCC_SDCC2_BCR 13 | ||
| 31 | #define GCC_SDCC3_BCR 14 | ||
| 32 | #define GCC_SDCC4_BCR 15 | ||
| 33 | #define GCC_BLSP1_BCR 16 | ||
| 34 | #define GCC_BLSP1_QUP1_BCR 17 | ||
| 35 | #define GCC_BLSP1_UART1_BCR 18 | ||
| 36 | #define GCC_BLSP1_QUP2_BCR 19 | ||
| 37 | #define GCC_BLSP1_UART2_BCR 20 | ||
| 38 | #define GCC_BLSP1_QUP3_BCR 21 | ||
| 39 | #define GCC_BLSP1_UART3_BCR 22 | ||
| 40 | #define GCC_BLSP1_QUP4_BCR 23 | ||
| 41 | #define GCC_BLSP1_UART4_BCR 24 | ||
| 42 | #define GCC_BLSP1_QUP5_BCR 25 | ||
| 43 | #define GCC_BLSP1_UART5_BCR 26 | ||
| 44 | #define GCC_BLSP1_QUP6_BCR 27 | ||
| 45 | #define GCC_BLSP1_UART6_BCR 28 | ||
| 46 | #define GCC_BLSP2_BCR 29 | ||
| 47 | #define GCC_BLSP2_QUP1_BCR 30 | ||
| 48 | #define GCC_BLSP2_UART1_BCR 31 | ||
| 49 | #define GCC_BLSP2_QUP2_BCR 32 | ||
| 50 | #define GCC_BLSP2_UART2_BCR 33 | ||
| 51 | #define GCC_BLSP2_QUP3_BCR 34 | ||
| 52 | #define GCC_BLSP2_UART3_BCR 35 | ||
| 53 | #define GCC_BLSP2_QUP4_BCR 36 | ||
| 54 | #define GCC_BLSP2_UART4_BCR 37 | ||
| 55 | #define GCC_BLSP2_QUP5_BCR 38 | ||
| 56 | #define GCC_BLSP2_UART5_BCR 39 | ||
| 57 | #define GCC_BLSP2_QUP6_BCR 40 | ||
| 58 | #define GCC_BLSP2_UART6_BCR 41 | ||
| 59 | #define GCC_PDM_BCR 42 | ||
| 60 | #define GCC_BAM_DMA_BCR 43 | ||
| 61 | #define GCC_TSIF_BCR 44 | ||
| 62 | #define GCC_TCSR_BCR 45 | ||
| 63 | #define GCC_BOOT_ROM_BCR 46 | ||
| 64 | #define GCC_MSG_RAM_BCR 47 | ||
| 65 | #define GCC_TLMM_BCR 48 | ||
| 66 | #define GCC_MPM_BCR 49 | ||
| 67 | #define GCC_SEC_CTRL_BCR 50 | ||
| 68 | #define GCC_SPMI_BCR 51 | ||
| 69 | #define GCC_SPDM_BCR 52 | ||
| 70 | #define GCC_CE1_BCR 53 | ||
| 71 | #define GCC_CE2_BCR 54 | ||
| 72 | #define GCC_BIMC_BCR 55 | ||
| 73 | #define GCC_MPM_NON_AHB_RESET 56 | ||
| 74 | #define GCC_MPM_AHB_RESET 57 | ||
| 75 | #define GCC_SNOC_BUS_TIMEOUT0_BCR 58 | ||
| 76 | #define GCC_SNOC_BUS_TIMEOUT2_BCR 59 | ||
| 77 | #define GCC_PNOC_BUS_TIMEOUT0_BCR 60 | ||
| 78 | #define GCC_PNOC_BUS_TIMEOUT1_BCR 61 | ||
| 79 | #define GCC_PNOC_BUS_TIMEOUT2_BCR 62 | ||
| 80 | #define GCC_PNOC_BUS_TIMEOUT3_BCR 63 | ||
| 81 | #define GCC_PNOC_BUS_TIMEOUT4_BCR 64 | ||
| 82 | #define GCC_CNOC_BUS_TIMEOUT0_BCR 65 | ||
| 83 | #define GCC_CNOC_BUS_TIMEOUT1_BCR 66 | ||
| 84 | #define GCC_CNOC_BUS_TIMEOUT2_BCR 67 | ||
| 85 | #define GCC_CNOC_BUS_TIMEOUT3_BCR 68 | ||
| 86 | #define GCC_CNOC_BUS_TIMEOUT4_BCR 69 | ||
| 87 | #define GCC_CNOC_BUS_TIMEOUT5_BCR 70 | ||
| 88 | #define GCC_CNOC_BUS_TIMEOUT6_BCR 71 | ||
| 89 | #define GCC_DEHR_BCR 72 | ||
| 90 | #define GCC_RBCPR_BCR 73 | ||
| 91 | #define GCC_MSS_RESTART 74 | ||
| 92 | #define GCC_LPASS_RESTART 75 | ||
| 93 | #define GCC_WCSS_RESTART 76 | ||
| 94 | #define GCC_VENUS_RESTART 77 | ||
| 95 | |||
| 96 | #endif | ||
diff --git a/include/dt-bindings/reset/qcom,mmcc-msm8960.h b/include/dt-bindings/reset/qcom,mmcc-msm8960.h new file mode 100644 index 000000000000..ba36ec680118 --- /dev/null +++ b/include/dt-bindings/reset/qcom,mmcc-msm8960.h | |||
| @@ -0,0 +1,93 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_RESET_MSM_MMCC_8960_H | ||
| 15 | #define _DT_BINDINGS_RESET_MSM_MMCC_8960_H | ||
| 16 | |||
| 17 | #define VPE_AXI_RESET 0 | ||
| 18 | #define IJPEG_AXI_RESET 1 | ||
| 19 | #define MPD_AXI_RESET 2 | ||
| 20 | #define VFE_AXI_RESET 3 | ||
| 21 | #define SP_AXI_RESET 4 | ||
| 22 | #define VCODEC_AXI_RESET 5 | ||
| 23 | #define ROT_AXI_RESET 6 | ||
| 24 | #define VCODEC_AXI_A_RESET 7 | ||
| 25 | #define VCODEC_AXI_B_RESET 8 | ||
| 26 | #define FAB_S3_AXI_RESET 9 | ||
| 27 | #define FAB_S2_AXI_RESET 10 | ||
| 28 | #define FAB_S1_AXI_RESET 11 | ||
| 29 | #define FAB_S0_AXI_RESET 12 | ||
| 30 | #define SMMU_GFX3D_ABH_RESET 13 | ||
| 31 | #define SMMU_VPE_AHB_RESET 14 | ||
| 32 | #define SMMU_VFE_AHB_RESET 15 | ||
| 33 | #define SMMU_ROT_AHB_RESET 16 | ||
| 34 | #define SMMU_VCODEC_B_AHB_RESET 17 | ||
| 35 | #define SMMU_VCODEC_A_AHB_RESET 18 | ||
| 36 | #define SMMU_MDP1_AHB_RESET 19 | ||
| 37 | #define SMMU_MDP0_AHB_RESET 20 | ||
| 38 | #define SMMU_JPEGD_AHB_RESET 21 | ||
| 39 | #define SMMU_IJPEG_AHB_RESET 22 | ||
| 40 | #define SMMU_GFX2D0_AHB_RESET 23 | ||
| 41 | #define SMMU_GFX2D1_AHB_RESET 24 | ||
| 42 | #define APU_AHB_RESET 25 | ||
| 43 | #define CSI_AHB_RESET 26 | ||
| 44 | #define TV_ENC_AHB_RESET 27 | ||
| 45 | #define VPE_AHB_RESET 28 | ||
| 46 | #define FABRIC_AHB_RESET 29 | ||
| 47 | #define GFX2D0_AHB_RESET 30 | ||
| 48 | #define GFX2D1_AHB_RESET 31 | ||
| 49 | #define GFX3D_AHB_RESET 32 | ||
| 50 | #define HDMI_AHB_RESET 33 | ||
| 51 | #define MSSS_IMEM_AHB_RESET 34 | ||
| 52 | #define IJPEG_AHB_RESET 35 | ||
| 53 | #define DSI_M_AHB_RESET 36 | ||
| 54 | #define DSI_S_AHB_RESET 37 | ||
| 55 | #define JPEGD_AHB_RESET 38 | ||
| 56 | #define MDP_AHB_RESET 39 | ||
| 57 | #define ROT_AHB_RESET 40 | ||
| 58 | #define VCODEC_AHB_RESET 41 | ||
| 59 | #define VFE_AHB_RESET 42 | ||
| 60 | #define DSI2_M_AHB_RESET 43 | ||
| 61 | #define DSI2_S_AHB_RESET 44 | ||
| 62 | #define CSIPHY2_RESET 45 | ||
| 63 | #define CSI_PIX1_RESET 46 | ||
| 64 | #define CSIPHY0_RESET 47 | ||
| 65 | #define CSIPHY1_RESET 48 | ||
| 66 | #define DSI2_RESET 49 | ||
| 67 | #define VFE_CSI_RESET 50 | ||
| 68 | #define MDP_RESET 51 | ||
| 69 | #define AMP_RESET 52 | ||
| 70 | #define JPEGD_RESET 53 | ||
| 71 | #define CSI1_RESET 54 | ||
| 72 | #define VPE_RESET 55 | ||
| 73 | #define MMSS_FABRIC_RESET 56 | ||
| 74 | #define VFE_RESET 57 | ||
| 75 | #define GFX2D0_RESET 58 | ||
| 76 | #define GFX2D1_RESET 59 | ||
| 77 | #define GFX3D_RESET 60 | ||
| 78 | #define HDMI_RESET 61 | ||
| 79 | #define MMSS_IMEM_RESET 62 | ||
| 80 | #define IJPEG_RESET 63 | ||
| 81 | #define CSI0_RESET 64 | ||
| 82 | #define DSI_RESET 65 | ||
| 83 | #define VCODEC_RESET 66 | ||
| 84 | #define MDP_TV_RESET 67 | ||
| 85 | #define MDP_VSYNC_RESET 68 | ||
| 86 | #define ROT_RESET 69 | ||
| 87 | #define TV_HDMI_RESET 70 | ||
| 88 | #define TV_ENC_RESET 71 | ||
| 89 | #define CSI2_RESET 72 | ||
| 90 | #define CSI_RDI1_RESET 73 | ||
| 91 | #define CSI_RDI2_RESET 74 | ||
| 92 | |||
| 93 | #endif | ||
diff --git a/include/dt-bindings/reset/qcom,mmcc-msm8974.h b/include/dt-bindings/reset/qcom,mmcc-msm8974.h new file mode 100644 index 000000000000..da3ec37f1b1e --- /dev/null +++ b/include/dt-bindings/reset/qcom,mmcc-msm8974.h | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_RESET_MSM_MMCC_8974_H | ||
| 15 | #define _DT_BINDINGS_RESET_MSM_MMCC_8974_H | ||
| 16 | |||
| 17 | #define SPDM_RESET 0 | ||
| 18 | #define SPDM_RM_RESET 1 | ||
| 19 | #define VENUS0_RESET 2 | ||
| 20 | #define MDSS_RESET 3 | ||
| 21 | #define CAMSS_PHY0_RESET 4 | ||
| 22 | #define CAMSS_PHY1_RESET 5 | ||
| 23 | #define CAMSS_PHY2_RESET 6 | ||
| 24 | #define CAMSS_CSI0_RESET 7 | ||
| 25 | #define CAMSS_CSI0PHY_RESET 8 | ||
| 26 | #define CAMSS_CSI0RDI_RESET 9 | ||
| 27 | #define CAMSS_CSI0PIX_RESET 10 | ||
| 28 | #define CAMSS_CSI1_RESET 11 | ||
| 29 | #define CAMSS_CSI1PHY_RESET 12 | ||
| 30 | #define CAMSS_CSI1RDI_RESET 13 | ||
| 31 | #define CAMSS_CSI1PIX_RESET 14 | ||
| 32 | #define CAMSS_CSI2_RESET 15 | ||
| 33 | #define CAMSS_CSI2PHY_RESET 16 | ||
| 34 | #define CAMSS_CSI2RDI_RESET 17 | ||
| 35 | #define CAMSS_CSI2PIX_RESET 18 | ||
| 36 | #define CAMSS_CSI3_RESET 19 | ||
| 37 | #define CAMSS_CSI3PHY_RESET 20 | ||
| 38 | #define CAMSS_CSI3RDI_RESET 21 | ||
| 39 | #define CAMSS_CSI3PIX_RESET 22 | ||
| 40 | #define CAMSS_ISPIF_RESET 23 | ||
| 41 | #define CAMSS_CCI_RESET 24 | ||
| 42 | #define CAMSS_MCLK0_RESET 25 | ||
| 43 | #define CAMSS_MCLK1_RESET 26 | ||
| 44 | #define CAMSS_MCLK2_RESET 27 | ||
| 45 | #define CAMSS_MCLK3_RESET 28 | ||
| 46 | #define CAMSS_GP0_RESET 29 | ||
| 47 | #define CAMSS_GP1_RESET 30 | ||
| 48 | #define CAMSS_TOP_RESET 31 | ||
| 49 | #define CAMSS_MICRO_RESET 32 | ||
| 50 | #define CAMSS_JPEG_RESET 33 | ||
| 51 | #define CAMSS_VFE_RESET 34 | ||
| 52 | #define CAMSS_CSI_VFE0_RESET 35 | ||
| 53 | #define CAMSS_CSI_VFE1_RESET 36 | ||
| 54 | #define OXILI_RESET 37 | ||
| 55 | #define OXILICX_RESET 38 | ||
| 56 | #define OCMEMCX_RESET 39 | ||
| 57 | #define MMSS_RBCRP_RESET 40 | ||
| 58 | #define MMSSNOCAHB_RESET 41 | ||
| 59 | #define MMSSNOCAXI_RESET 42 | ||
| 60 | #define OCMEMNOC_RESET 43 | ||
| 61 | |||
| 62 | #endif | ||
diff --git a/include/dt-bindings/thermal/thermal.h b/include/dt-bindings/thermal/thermal.h new file mode 100644 index 000000000000..59822a995858 --- /dev/null +++ b/include/dt-bindings/thermal/thermal.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* | ||
| 2 | * This header provides constants for most thermal bindings. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Texas Instruments | ||
| 5 | * Eduardo Valentin <eduardo.valentin@ti.com> | ||
| 6 | * | ||
| 7 | * GPLv2 only | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef _DT_BINDINGS_THERMAL_THERMAL_H | ||
| 11 | #define _DT_BINDINGS_THERMAL_THERMAL_H | ||
| 12 | |||
| 13 | /* On cooling devices upper and lower limits */ | ||
| 14 | #define THERMAL_NO_LIMIT (-1UL) | ||
| 15 | |||
| 16 | #endif | ||
| 17 | |||
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index 7e2d15837b02..be85127bfed3 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h | |||
| @@ -144,7 +144,7 @@ struct kvm_run; | |||
| 144 | struct kvm_exit_mmio; | 144 | struct kvm_exit_mmio; |
| 145 | 145 | ||
| 146 | #ifdef CONFIG_KVM_ARM_VGIC | 146 | #ifdef CONFIG_KVM_ARM_VGIC |
| 147 | int kvm_vgic_set_addr(struct kvm *kvm, unsigned long type, u64 addr); | 147 | int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 *addr, bool write); |
| 148 | int kvm_vgic_hyp_init(void); | 148 | int kvm_vgic_hyp_init(void); |
| 149 | int kvm_vgic_init(struct kvm *kvm); | 149 | int kvm_vgic_init(struct kvm *kvm); |
| 150 | int kvm_vgic_create(struct kvm *kvm); | 150 | int kvm_vgic_create(struct kvm *kvm); |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d9099b15b472..1151a1dcfe41 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | #include <acpi/acpi_bus.h> | 42 | #include <acpi/acpi_bus.h> |
| 43 | #include <acpi/acpi_drivers.h> | 43 | #include <acpi/acpi_drivers.h> |
| 44 | #include <acpi/acpi_numa.h> | 44 | #include <acpi/acpi_numa.h> |
| 45 | #include <acpi/acpi_io.h> | ||
| 45 | #include <asm/acpi.h> | 46 | #include <asm/acpi.h> |
| 46 | 47 | ||
| 47 | static inline acpi_handle acpi_device_handle(struct acpi_device *adev) | 48 | static inline acpi_handle acpi_device_handle(struct acpi_device *adev) |
| @@ -53,6 +54,12 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev) | |||
| 53 | #define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev) | 54 | #define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev) |
| 54 | #define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev)) | 55 | #define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev)) |
| 55 | 56 | ||
| 57 | static inline void acpi_preset_companion(struct device *dev, | ||
| 58 | struct acpi_device *parent, u64 addr) | ||
| 59 | { | ||
| 60 | ACPI_COMPANION_SET(dev, acpi_find_child_device(parent, addr, NULL)); | ||
| 61 | } | ||
| 62 | |||
| 56 | static inline const char *acpi_dev_name(struct acpi_device *adev) | 63 | static inline const char *acpi_dev_name(struct acpi_device *adev) |
| 57 | { | 64 | { |
| 58 | return dev_name(&adev->dev); | 65 | return dev_name(&adev->dev); |
| @@ -409,6 +416,9 @@ static inline bool acpi_driver_match_device(struct device *dev, | |||
| 409 | return !!acpi_match_device(drv->acpi_match_table, dev); | 416 | return !!acpi_match_device(drv->acpi_match_table, dev); |
| 410 | } | 417 | } |
| 411 | 418 | ||
| 419 | int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *); | ||
| 420 | int acpi_device_modalias(struct device *, char *, int); | ||
| 421 | |||
| 412 | #define ACPI_PTR(_ptr) (_ptr) | 422 | #define ACPI_PTR(_ptr) (_ptr) |
| 413 | 423 | ||
| 414 | #else /* !CONFIG_ACPI */ | 424 | #else /* !CONFIG_ACPI */ |
| @@ -460,7 +470,7 @@ struct acpi_table_header; | |||
| 460 | static inline int acpi_table_parse(char *id, | 470 | static inline int acpi_table_parse(char *id, |
| 461 | int (*handler)(struct acpi_table_header *)) | 471 | int (*handler)(struct acpi_table_header *)) |
| 462 | { | 472 | { |
| 463 | return -1; | 473 | return -ENODEV; |
| 464 | } | 474 | } |
| 465 | 475 | ||
| 466 | static inline int acpi_nvs_register(__u64 start, __u64 size) | 476 | static inline int acpi_nvs_register(__u64 start, __u64 size) |
| @@ -488,6 +498,18 @@ static inline bool acpi_driver_match_device(struct device *dev, | |||
| 488 | return false; | 498 | return false; |
| 489 | } | 499 | } |
| 490 | 500 | ||
| 501 | static inline int acpi_device_uevent_modalias(struct device *dev, | ||
| 502 | struct kobj_uevent_env *env) | ||
| 503 | { | ||
| 504 | return -ENODEV; | ||
| 505 | } | ||
| 506 | |||
| 507 | static inline int acpi_device_modalias(struct device *dev, | ||
| 508 | char *buf, int size) | ||
| 509 | { | ||
| 510 | return -ENODEV; | ||
| 511 | } | ||
| 512 | |||
| 491 | #define ACPI_PTR(_ptr) (NULL) | 513 | #define ACPI_PTR(_ptr) (NULL) |
| 492 | 514 | ||
| 493 | #endif /* !CONFIG_ACPI */ | 515 | #endif /* !CONFIG_ACPI */ |
diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h deleted file mode 100644 index d875bc3dba3c..000000000000 --- a/include/linux/acpi_gpio.h +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | #ifndef _LINUX_ACPI_GPIO_H_ | ||
| 2 | #define _LINUX_ACPI_GPIO_H_ | ||
| 3 | |||
| 4 | #include <linux/device.h> | ||
| 5 | #include <linux/err.h> | ||
| 6 | #include <linux/errno.h> | ||
| 7 | #include <linux/gpio.h> | ||
| 8 | #include <linux/gpio/consumer.h> | ||
| 9 | |||
| 10 | /** | ||
| 11 | * struct acpi_gpio_info - ACPI GPIO specific information | ||
| 12 | * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo | ||
| 13 | * @active_low: in case of @gpioint, the pin is active low | ||
| 14 | */ | ||
| 15 | struct acpi_gpio_info { | ||
| 16 | bool gpioint; | ||
| 17 | bool active_low; | ||
| 18 | }; | ||
| 19 | |||
| 20 | #ifdef CONFIG_GPIO_ACPI | ||
| 21 | |||
| 22 | struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index, | ||
| 23 | struct acpi_gpio_info *info); | ||
| 24 | void acpi_gpiochip_request_interrupts(struct gpio_chip *chip); | ||
| 25 | void acpi_gpiochip_free_interrupts(struct gpio_chip *chip); | ||
| 26 | |||
| 27 | #else /* CONFIG_GPIO_ACPI */ | ||
| 28 | |||
| 29 | static inline struct gpio_desc * | ||
| 30 | acpi_get_gpiod_by_index(struct device *dev, int index, | ||
| 31 | struct acpi_gpio_info *info) | ||
| 32 | { | ||
| 33 | return ERR_PTR(-ENOSYS); | ||
| 34 | } | ||
| 35 | |||
| 36 | static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { } | ||
| 37 | static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { } | ||
| 38 | |||
| 39 | #endif /* CONFIG_GPIO_ACPI */ | ||
| 40 | |||
| 41 | static inline int acpi_get_gpio_by_index(struct device *dev, int index, | ||
| 42 | struct acpi_gpio_info *info) | ||
| 43 | { | ||
| 44 | struct gpio_desc *desc = acpi_get_gpiod_by_index(dev, index, info); | ||
| 45 | |||
| 46 | if (IS_ERR(desc)) | ||
| 47 | return PTR_ERR(desc); | ||
| 48 | return desc_to_gpio(desc); | ||
| 49 | } | ||
| 50 | |||
| 51 | #endif /* _LINUX_ACPI_GPIO_H_ */ | ||
diff --git a/include/linux/amba/sp810.h b/include/linux/amba/sp810.h index 6636430dd0e6..c7df89f99115 100644 --- a/include/linux/amba/sp810.h +++ b/include/linux/amba/sp810.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/arm/include/asm/hardware/sp810.h | ||
| 3 | * | ||
| 4 | * ARM PrimeXsys System Controller SP810 header file | 2 | * ARM PrimeXsys System Controller SP810 header file |
| 5 | * | 3 | * |
| 6 | * Copyright (C) 2009 ST Microelectronics | 4 | * Copyright (C) 2009 ST Microelectronics |
| @@ -11,8 +9,8 @@ | |||
| 11 | * warranty of any kind, whether express or implied. | 9 | * warranty of any kind, whether express or implied. |
| 12 | */ | 10 | */ |
| 13 | 11 | ||
| 14 | #ifndef __ASM_ARM_SP810_H | 12 | #ifndef __AMBA_SP810_H |
| 15 | #define __ASM_ARM_SP810_H | 13 | #define __AMBA_SP810_H |
| 16 | 14 | ||
| 17 | #include <linux/io.h> | 15 | #include <linux/io.h> |
| 18 | 16 | ||
| @@ -61,4 +59,4 @@ static inline void sysctl_soft_reset(void __iomem *base) | |||
| 61 | writel(0, base + SCSYSSTAT); | 59 | writel(0, base + SCSYSSTAT); |
| 62 | } | 60 | } |
| 63 | 61 | ||
| 64 | #endif /* __ASM_ARM_SP810_H */ | 62 | #endif /* __AMBA_SP810_H */ |
diff --git a/include/linux/assoc_array.h b/include/linux/assoc_array.h index 9a193b84238a..a89df3be1686 100644 --- a/include/linux/assoc_array.h +++ b/include/linux/assoc_array.h | |||
| @@ -41,10 +41,10 @@ struct assoc_array_ops { | |||
| 41 | /* Is this the object we're looking for? */ | 41 | /* Is this the object we're looking for? */ |
| 42 | bool (*compare_object)(const void *object, const void *index_key); | 42 | bool (*compare_object)(const void *object, const void *index_key); |
| 43 | 43 | ||
| 44 | /* How different are two objects, to a bit position in their keys? (or | 44 | /* How different is an object from an index key, to a bit position in |
| 45 | * -1 if they're the same) | 45 | * their keys? (or -1 if they're the same) |
| 46 | */ | 46 | */ |
| 47 | int (*diff_objects)(const void *a, const void *b); | 47 | int (*diff_objects)(const void *object, const void *index_key); |
| 48 | 48 | ||
| 49 | /* Method to free an object. */ | 49 | /* Method to free an object. */ |
| 50 | void (*free_object)(void *object); | 50 | void (*free_object)(void *object); |
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h index fcdd81bd5314..8598f8eacb20 100644 --- a/include/linux/ath9k_platform.h +++ b/include/linux/ath9k_platform.h | |||
| @@ -32,6 +32,8 @@ struct ath9k_platform_data { | |||
| 32 | u32 gpio_val; | 32 | u32 gpio_val; |
| 33 | 33 | ||
| 34 | bool is_clk_25mhz; | 34 | bool is_clk_25mhz; |
| 35 | bool tx_gain_buffalo; | ||
| 36 | |||
| 35 | int (*get_mac_revision)(void); | 37 | int (*get_mac_revision)(void); |
| 36 | int (*external_reset)(void); | 38 | int (*external_reset)(void); |
| 37 | }; | 39 | }; |
diff --git a/include/linux/audit.h b/include/linux/audit.h index a40641954c29..aa865a9a4c4f 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -137,7 +137,7 @@ static inline void audit_syscall_exit(void *pt_regs) | |||
| 137 | { | 137 | { |
| 138 | if (unlikely(current->audit_context)) { | 138 | if (unlikely(current->audit_context)) { |
| 139 | int success = is_syscall_success(pt_regs); | 139 | int success = is_syscall_success(pt_regs); |
| 140 | int return_code = regs_return_value(pt_regs); | 140 | long return_code = regs_return_value(pt_regs); |
| 141 | 141 | ||
| 142 | __audit_syscall_exit(success, return_code); | 142 | __audit_syscall_exit(success, return_code); |
| 143 | } | 143 | } |
| @@ -202,7 +202,7 @@ static inline kuid_t audit_get_loginuid(struct task_struct *tsk) | |||
| 202 | return tsk->loginuid; | 202 | return tsk->loginuid; |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | static inline int audit_get_sessionid(struct task_struct *tsk) | 205 | static inline unsigned int audit_get_sessionid(struct task_struct *tsk) |
| 206 | { | 206 | { |
| 207 | return tsk->sessionid; | 207 | return tsk->sessionid; |
| 208 | } | 208 | } |
| @@ -220,7 +220,7 @@ extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); | |||
| 220 | extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, | 220 | extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, |
| 221 | const struct cred *new, | 221 | const struct cred *new, |
| 222 | const struct cred *old); | 222 | const struct cred *old); |
| 223 | extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); | 223 | extern void __audit_log_capset(const struct cred *new, const struct cred *old); |
| 224 | extern void __audit_mmap_fd(int fd, int flags); | 224 | extern void __audit_mmap_fd(int fd, int flags); |
| 225 | 225 | ||
| 226 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) | 226 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) |
| @@ -285,11 +285,11 @@ static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, | |||
| 285 | return 0; | 285 | return 0; |
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | static inline void audit_log_capset(pid_t pid, const struct cred *new, | 288 | static inline void audit_log_capset(const struct cred *new, |
| 289 | const struct cred *old) | 289 | const struct cred *old) |
| 290 | { | 290 | { |
| 291 | if (unlikely(!audit_dummy_context())) | 291 | if (unlikely(!audit_dummy_context())) |
| 292 | __audit_log_capset(pid, new, old); | 292 | __audit_log_capset(new, old); |
| 293 | } | 293 | } |
| 294 | 294 | ||
| 295 | static inline void audit_mmap_fd(int fd, int flags) | 295 | static inline void audit_mmap_fd(int fd, int flags) |
| @@ -359,7 +359,7 @@ static inline kuid_t audit_get_loginuid(struct task_struct *tsk) | |||
| 359 | { | 359 | { |
| 360 | return INVALID_UID; | 360 | return INVALID_UID; |
| 361 | } | 361 | } |
| 362 | static inline int audit_get_sessionid(struct task_struct *tsk) | 362 | static inline unsigned int audit_get_sessionid(struct task_struct *tsk) |
| 363 | { | 363 | { |
| 364 | return -1; | 364 | return -1; |
| 365 | } | 365 | } |
| @@ -397,8 +397,8 @@ static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, | |||
| 397 | { | 397 | { |
| 398 | return 0; | 398 | return 0; |
| 399 | } | 399 | } |
| 400 | static inline void audit_log_capset(pid_t pid, const struct cred *new, | 400 | static inline void audit_log_capset(const struct cred *new, |
| 401 | const struct cred *old) | 401 | const struct cred *old) |
| 402 | { } | 402 | { } |
| 403 | static inline void audit_mmap_fd(int fd, int flags) | 403 | static inline void audit_mmap_fd(int fd, int flags) |
| 404 | { } | 404 | { } |
| @@ -461,9 +461,11 @@ extern int audit_update_lsm_rules(void); | |||
| 461 | /* Private API (for audit.c only) */ | 461 | /* Private API (for audit.c only) */ |
| 462 | extern int audit_filter_user(int type); | 462 | extern int audit_filter_user(int type); |
| 463 | extern int audit_filter_type(int type); | 463 | extern int audit_filter_type(int type); |
| 464 | extern int audit_receive_filter(int type, int pid, int seq, | 464 | extern int audit_rule_change(int type, __u32 portid, int seq, |
| 465 | void *data, size_t datasz); | 465 | void *data, size_t datasz); |
| 466 | extern int audit_enabled; | 466 | extern int audit_list_rules_send(__u32 portid, int seq); |
| 467 | |||
| 468 | extern u32 audit_enabled; | ||
| 467 | #else /* CONFIG_AUDIT */ | 469 | #else /* CONFIG_AUDIT */ |
| 468 | static inline __printf(4, 5) | 470 | static inline __printf(4, 5) |
| 469 | void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type, | 471 | void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type, |
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h index 669fef5c745a..3e0fbe441763 100644 --- a/include/linux/auxvec.h +++ b/include/linux/auxvec.h | |||
| @@ -3,6 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <uapi/linux/auxvec.h> | 4 | #include <uapi/linux/auxvec.h> |
| 5 | 5 | ||
| 6 | #define AT_VECTOR_SIZE_BASE 19 /* NEW_AUX_ENT entries in auxiliary table */ | 6 | #define AT_VECTOR_SIZE_BASE 20 /* NEW_AUX_ENT entries in auxiliary table */ |
| 7 | /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ | 7 | /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ |
| 8 | #endif /* _LINUX_AUXVEC_H */ | 8 | #endif /* _LINUX_AUXVEC_H */ |
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index 4d043c30216f..0b3bb16c705a 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
| @@ -418,7 +418,14 @@ static inline void bcma_maskset16(struct bcma_device *cc, | |||
| 418 | bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set); | 418 | bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set); |
| 419 | } | 419 | } |
| 420 | 420 | ||
| 421 | extern struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid); | 421 | extern struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid, |
| 422 | u8 unit); | ||
| 423 | static inline struct bcma_device *bcma_find_core(struct bcma_bus *bus, | ||
| 424 | u16 coreid) | ||
| 425 | { | ||
| 426 | return bcma_find_core_unit(bus, coreid, 0); | ||
| 427 | } | ||
| 428 | |||
| 422 | extern bool bcma_core_is_enabled(struct bcma_device *core); | 429 | extern bool bcma_core_is_enabled(struct bcma_device *core); |
| 423 | extern void bcma_core_disable(struct bcma_device *core, u32 flags); | 430 | extern void bcma_core_disable(struct bcma_device *core, u32 flags); |
| 424 | extern int bcma_core_enable(struct bcma_device *core, u32 flags); | 431 | extern int bcma_core_enable(struct bcma_device *core, u32 flags); |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index f1f07d31a3af..2fae55def608 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #define _LINUX_BOOTMEM_H | 5 | #define _LINUX_BOOTMEM_H |
| 6 | 6 | ||
| 7 | #include <linux/mmzone.h> | 7 | #include <linux/mmzone.h> |
| 8 | #include <linux/mm_types.h> | ||
| 8 | #include <asm/dma.h> | 9 | #include <asm/dma.h> |
| 9 | 10 | ||
| 10 | /* | 11 | /* |
| @@ -52,7 +53,6 @@ extern void free_bootmem_node(pg_data_t *pgdat, | |||
| 52 | unsigned long size); | 53 | unsigned long size); |
| 53 | extern void free_bootmem(unsigned long physaddr, unsigned long size); | 54 | extern void free_bootmem(unsigned long physaddr, unsigned long size); |
| 54 | extern void free_bootmem_late(unsigned long physaddr, unsigned long size); | 55 | extern void free_bootmem_late(unsigned long physaddr, unsigned long size); |
| 55 | extern void __free_pages_bootmem(struct page *page, unsigned int order); | ||
| 56 | 56 | ||
| 57 | /* | 57 | /* |
| 58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | 58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, |
| @@ -142,6 +142,157 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | |||
| 142 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | 142 | #define alloc_bootmem_low_pages_node(pgdat, x) \ |
| 143 | __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) | 143 | __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) |
| 144 | 144 | ||
| 145 | |||
| 146 | #if defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) | ||
| 147 | |||
| 148 | /* FIXME: use MEMBLOCK_ALLOC_* variants here */ | ||
| 149 | #define BOOTMEM_ALLOC_ACCESSIBLE 0 | ||
| 150 | #define BOOTMEM_ALLOC_ANYWHERE (~(phys_addr_t)0) | ||
| 151 | |||
| 152 | /* FIXME: Move to memblock.h at a point where we remove nobootmem.c */ | ||
| 153 | void *memblock_virt_alloc_try_nid_nopanic(phys_addr_t size, | ||
| 154 | phys_addr_t align, phys_addr_t min_addr, | ||
| 155 | phys_addr_t max_addr, int nid); | ||
| 156 | void *memblock_virt_alloc_try_nid(phys_addr_t size, phys_addr_t align, | ||
| 157 | phys_addr_t min_addr, phys_addr_t max_addr, int nid); | ||
| 158 | void __memblock_free_early(phys_addr_t base, phys_addr_t size); | ||
| 159 | void __memblock_free_late(phys_addr_t base, phys_addr_t size); | ||
| 160 | |||
| 161 | static inline void * __init memblock_virt_alloc( | ||
| 162 | phys_addr_t size, phys_addr_t align) | ||
| 163 | { | ||
| 164 | return memblock_virt_alloc_try_nid(size, align, BOOTMEM_LOW_LIMIT, | ||
| 165 | BOOTMEM_ALLOC_ACCESSIBLE, | ||
| 166 | NUMA_NO_NODE); | ||
| 167 | } | ||
| 168 | |||
| 169 | static inline void * __init memblock_virt_alloc_nopanic( | ||
| 170 | phys_addr_t size, phys_addr_t align) | ||
| 171 | { | ||
| 172 | return memblock_virt_alloc_try_nid_nopanic(size, align, | ||
| 173 | BOOTMEM_LOW_LIMIT, | ||
| 174 | BOOTMEM_ALLOC_ACCESSIBLE, | ||
| 175 | NUMA_NO_NODE); | ||
| 176 | } | ||
| 177 | |||
| 178 | static inline void * __init memblock_virt_alloc_from_nopanic( | ||
| 179 | phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) | ||
| 180 | { | ||
| 181 | return memblock_virt_alloc_try_nid_nopanic(size, align, min_addr, | ||
| 182 | BOOTMEM_ALLOC_ACCESSIBLE, | ||
| 183 | NUMA_NO_NODE); | ||
| 184 | } | ||
| 185 | |||
| 186 | static inline void * __init memblock_virt_alloc_node( | ||
| 187 | phys_addr_t size, int nid) | ||
| 188 | { | ||
| 189 | return memblock_virt_alloc_try_nid(size, 0, BOOTMEM_LOW_LIMIT, | ||
| 190 | BOOTMEM_ALLOC_ACCESSIBLE, nid); | ||
| 191 | } | ||
| 192 | |||
| 193 | static inline void * __init memblock_virt_alloc_node_nopanic( | ||
| 194 | phys_addr_t size, int nid) | ||
| 195 | { | ||
| 196 | return memblock_virt_alloc_try_nid_nopanic(size, 0, BOOTMEM_LOW_LIMIT, | ||
| 197 | BOOTMEM_ALLOC_ACCESSIBLE, | ||
| 198 | nid); | ||
| 199 | } | ||
| 200 | |||
| 201 | static inline void __init memblock_free_early( | ||
| 202 | phys_addr_t base, phys_addr_t size) | ||
| 203 | { | ||
| 204 | __memblock_free_early(base, size); | ||
| 205 | } | ||
| 206 | |||
| 207 | static inline void __init memblock_free_early_nid( | ||
| 208 | phys_addr_t base, phys_addr_t size, int nid) | ||
| 209 | { | ||
| 210 | __memblock_free_early(base, size); | ||
| 211 | } | ||
| 212 | |||
| 213 | static inline void __init memblock_free_late( | ||
| 214 | phys_addr_t base, phys_addr_t size) | ||
| 215 | { | ||
| 216 | __memblock_free_late(base, size); | ||
| 217 | } | ||
| 218 | |||
| 219 | #else | ||
| 220 | |||
| 221 | #define BOOTMEM_ALLOC_ACCESSIBLE 0 | ||
| 222 | |||
| 223 | |||
| 224 | /* Fall back to all the existing bootmem APIs */ | ||
| 225 | static inline void * __init memblock_virt_alloc( | ||
| 226 | phys_addr_t size, phys_addr_t align) | ||
| 227 | { | ||
| 228 | if (!align) | ||
| 229 | align = SMP_CACHE_BYTES; | ||
| 230 | return __alloc_bootmem(size, align, BOOTMEM_LOW_LIMIT); | ||
| 231 | } | ||
| 232 | |||
| 233 | static inline void * __init memblock_virt_alloc_nopanic( | ||
| 234 | phys_addr_t size, phys_addr_t align) | ||
| 235 | { | ||
| 236 | if (!align) | ||
| 237 | align = SMP_CACHE_BYTES; | ||
| 238 | return __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT); | ||
| 239 | } | ||
| 240 | |||
| 241 | static inline void * __init memblock_virt_alloc_from_nopanic( | ||
| 242 | phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) | ||
| 243 | { | ||
| 244 | return __alloc_bootmem_nopanic(size, align, min_addr); | ||
| 245 | } | ||
| 246 | |||
| 247 | static inline void * __init memblock_virt_alloc_node( | ||
| 248 | phys_addr_t size, int nid) | ||
| 249 | { | ||
| 250 | return __alloc_bootmem_node(NODE_DATA(nid), size, SMP_CACHE_BYTES, | ||
| 251 | BOOTMEM_LOW_LIMIT); | ||
| 252 | } | ||
| 253 | |||
| 254 | static inline void * __init memblock_virt_alloc_node_nopanic( | ||
| 255 | phys_addr_t size, int nid) | ||
| 256 | { | ||
| 257 | return __alloc_bootmem_node_nopanic(NODE_DATA(nid), size, | ||
| 258 | SMP_CACHE_BYTES, | ||
| 259 | BOOTMEM_LOW_LIMIT); | ||
| 260 | } | ||
| 261 | |||
| 262 | static inline void * __init memblock_virt_alloc_try_nid(phys_addr_t size, | ||
| 263 | phys_addr_t align, phys_addr_t min_addr, phys_addr_t max_addr, int nid) | ||
| 264 | { | ||
| 265 | return __alloc_bootmem_node_high(NODE_DATA(nid), size, align, | ||
| 266 | min_addr); | ||
| 267 | } | ||
| 268 | |||
| 269 | static inline void * __init memblock_virt_alloc_try_nid_nopanic( | ||
| 270 | phys_addr_t size, phys_addr_t align, | ||
| 271 | phys_addr_t min_addr, phys_addr_t max_addr, int nid) | ||
| 272 | { | ||
| 273 | return ___alloc_bootmem_node_nopanic(NODE_DATA(nid), size, align, | ||
| 274 | min_addr, max_addr); | ||
| 275 | } | ||
| 276 | |||
| 277 | static inline void __init memblock_free_early( | ||
| 278 | phys_addr_t base, phys_addr_t size) | ||
| 279 | { | ||
| 280 | free_bootmem(base, size); | ||
| 281 | } | ||
| 282 | |||
| 283 | static inline void __init memblock_free_early_nid( | ||
| 284 | phys_addr_t base, phys_addr_t size, int nid) | ||
| 285 | { | ||
| 286 | free_bootmem_node(NODE_DATA(nid), base, size); | ||
| 287 | } | ||
| 288 | |||
| 289 | static inline void __init memblock_free_late( | ||
| 290 | phys_addr_t base, phys_addr_t size) | ||
| 291 | { | ||
| 292 | free_bootmem_late(base, size); | ||
| 293 | } | ||
| 294 | #endif /* defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) */ | ||
| 295 | |||
| 145 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP | 296 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP |
| 146 | extern void *alloc_remap(int nid, unsigned long size); | 297 | extern void *alloc_remap(int nid, unsigned long size); |
| 147 | #else | 298 | #else |
diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h index 27b1bcffe408..86c12c93e3cf 100644 --- a/include/linux/bottom_half.h +++ b/include/linux/bottom_half.h | |||
| @@ -1,9 +1,35 @@ | |||
| 1 | #ifndef _LINUX_BH_H | 1 | #ifndef _LINUX_BH_H |
| 2 | #define _LINUX_BH_H | 2 | #define _LINUX_BH_H |
| 3 | 3 | ||
| 4 | extern void local_bh_disable(void); | 4 | #include <linux/preempt.h> |
| 5 | #include <linux/preempt_mask.h> | ||
| 6 | |||
| 7 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
| 8 | extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt); | ||
| 9 | #else | ||
| 10 | static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) | ||
| 11 | { | ||
| 12 | preempt_count_add(cnt); | ||
| 13 | barrier(); | ||
| 14 | } | ||
| 15 | #endif | ||
| 16 | |||
| 17 | static inline void local_bh_disable(void) | ||
| 18 | { | ||
| 19 | __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET); | ||
| 20 | } | ||
| 21 | |||
| 5 | extern void _local_bh_enable(void); | 22 | extern void _local_bh_enable(void); |
| 6 | extern void local_bh_enable(void); | 23 | extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt); |
| 7 | extern void local_bh_enable_ip(unsigned long ip); | 24 | |
| 25 | static inline void local_bh_enable_ip(unsigned long ip) | ||
| 26 | { | ||
| 27 | __local_bh_enable_ip(ip, SOFTIRQ_DISABLE_OFFSET); | ||
| 28 | } | ||
| 29 | |||
| 30 | static inline void local_bh_enable(void) | ||
| 31 | { | ||
| 32 | __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET); | ||
| 33 | } | ||
| 8 | 34 | ||
| 9 | #endif /* _LINUX_BH_H */ | 35 | #endif /* _LINUX_BH_H */ |
diff --git a/include/linux/cache.h b/include/linux/cache.h index 4c570653ab84..17e7e82d2aa7 100644 --- a/include/linux/cache.h +++ b/include/linux/cache.h | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | #ifndef __LINUX_CACHE_H | 1 | #ifndef __LINUX_CACHE_H |
| 2 | #define __LINUX_CACHE_H | 2 | #define __LINUX_CACHE_H |
| 3 | 3 | ||
| 4 | #include <linux/kernel.h> | 4 | #include <uapi/linux/kernel.h> |
| 5 | #include <asm/cache.h> | 5 | #include <asm/cache.h> |
| 6 | 6 | ||
| 7 | #ifndef L1_CACHE_ALIGN | 7 | #ifndef L1_CACHE_ALIGN |
| 8 | #define L1_CACHE_ALIGN(x) ALIGN(x, L1_CACHE_BYTES) | 8 | #define L1_CACHE_ALIGN(x) __ALIGN_KERNEL(x, L1_CACHE_BYTES) |
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #ifndef SMP_CACHE_BYTES | 11 | #ifndef SMP_CACHE_BYTES |
diff --git a/include/linux/ccp.h b/include/linux/ccp.h new file mode 100644 index 000000000000..b941ab9f762b --- /dev/null +++ b/include/linux/ccp.h | |||
| @@ -0,0 +1,537 @@ | |||
| 1 | /* | ||
| 2 | * AMD Cryptographic Coprocessor (CCP) driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Advanced Micro Devices, Inc. | ||
| 5 | * | ||
| 6 | * Author: Tom Lendacky <thomas.lendacky@amd.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 __CPP_H__ | ||
| 14 | #define __CPP_H__ | ||
| 15 | |||
| 16 | #include <linux/scatterlist.h> | ||
| 17 | #include <linux/workqueue.h> | ||
| 18 | #include <linux/list.h> | ||
| 19 | #include <crypto/aes.h> | ||
| 20 | #include <crypto/sha.h> | ||
| 21 | |||
| 22 | |||
| 23 | struct ccp_device; | ||
| 24 | struct ccp_cmd; | ||
| 25 | |||
| 26 | #if defined(CONFIG_CRYPTO_DEV_CCP_DD) || \ | ||
| 27 | defined(CONFIG_CRYPTO_DEV_CCP_DD_MODULE) | ||
| 28 | |||
| 29 | /** | ||
| 30 | * ccp_enqueue_cmd - queue an operation for processing by the CCP | ||
| 31 | * | ||
| 32 | * @cmd: ccp_cmd struct to be processed | ||
| 33 | * | ||
| 34 | * Refer to the ccp_cmd struct below for required fields. | ||
| 35 | * | ||
| 36 | * Queue a cmd to be processed by the CCP. If queueing the cmd | ||
| 37 | * would exceed the defined length of the cmd queue the cmd will | ||
| 38 | * only be queued if the CCP_CMD_MAY_BACKLOG flag is set and will | ||
| 39 | * result in a return code of -EBUSY. | ||
| 40 | * | ||
| 41 | * The callback routine specified in the ccp_cmd struct will be | ||
| 42 | * called to notify the caller of completion (if the cmd was not | ||
| 43 | * backlogged) or advancement out of the backlog. If the cmd has | ||
| 44 | * advanced out of the backlog the "err" value of the callback | ||
| 45 | * will be -EINPROGRESS. Any other "err" value during callback is | ||
| 46 | * the result of the operation. | ||
| 47 | * | ||
| 48 | * The cmd has been successfully queued if: | ||
| 49 | * the return code is -EINPROGRESS or | ||
| 50 | * the return code is -EBUSY and CCP_CMD_MAY_BACKLOG flag is set | ||
| 51 | */ | ||
| 52 | int ccp_enqueue_cmd(struct ccp_cmd *cmd); | ||
| 53 | |||
| 54 | #else /* CONFIG_CRYPTO_DEV_CCP_DD is not enabled */ | ||
| 55 | |||
| 56 | static inline int ccp_enqueue_cmd(struct ccp_cmd *cmd) | ||
| 57 | { | ||
| 58 | return -ENODEV; | ||
| 59 | } | ||
| 60 | |||
| 61 | #endif /* CONFIG_CRYPTO_DEV_CCP_DD */ | ||
| 62 | |||
| 63 | |||
| 64 | /***** AES engine *****/ | ||
| 65 | /** | ||
| 66 | * ccp_aes_type - AES key size | ||
| 67 | * | ||
| 68 | * @CCP_AES_TYPE_128: 128-bit key | ||
| 69 | * @CCP_AES_TYPE_192: 192-bit key | ||
| 70 | * @CCP_AES_TYPE_256: 256-bit key | ||
| 71 | */ | ||
| 72 | enum ccp_aes_type { | ||
| 73 | CCP_AES_TYPE_128 = 0, | ||
| 74 | CCP_AES_TYPE_192, | ||
| 75 | CCP_AES_TYPE_256, | ||
| 76 | CCP_AES_TYPE__LAST, | ||
| 77 | }; | ||
| 78 | |||
| 79 | /** | ||
| 80 | * ccp_aes_mode - AES operation mode | ||
| 81 | * | ||
| 82 | * @CCP_AES_MODE_ECB: ECB mode | ||
| 83 | * @CCP_AES_MODE_CBC: CBC mode | ||
| 84 | * @CCP_AES_MODE_OFB: OFB mode | ||
| 85 | * @CCP_AES_MODE_CFB: CFB mode | ||
| 86 | * @CCP_AES_MODE_CTR: CTR mode | ||
| 87 | * @CCP_AES_MODE_CMAC: CMAC mode | ||
| 88 | */ | ||
| 89 | enum ccp_aes_mode { | ||
| 90 | CCP_AES_MODE_ECB = 0, | ||
| 91 | CCP_AES_MODE_CBC, | ||
| 92 | CCP_AES_MODE_OFB, | ||
| 93 | CCP_AES_MODE_CFB, | ||
| 94 | CCP_AES_MODE_CTR, | ||
| 95 | CCP_AES_MODE_CMAC, | ||
| 96 | CCP_AES_MODE__LAST, | ||
| 97 | }; | ||
| 98 | |||
| 99 | /** | ||
| 100 | * ccp_aes_mode - AES operation mode | ||
| 101 | * | ||
| 102 | * @CCP_AES_ACTION_DECRYPT: AES decrypt operation | ||
| 103 | * @CCP_AES_ACTION_ENCRYPT: AES encrypt operation | ||
| 104 | */ | ||
| 105 | enum ccp_aes_action { | ||
| 106 | CCP_AES_ACTION_DECRYPT = 0, | ||
| 107 | CCP_AES_ACTION_ENCRYPT, | ||
| 108 | CCP_AES_ACTION__LAST, | ||
| 109 | }; | ||
| 110 | |||
| 111 | /** | ||
| 112 | * struct ccp_aes_engine - CCP AES operation | ||
| 113 | * @type: AES operation key size | ||
| 114 | * @mode: AES operation mode | ||
| 115 | * @action: AES operation (decrypt/encrypt) | ||
| 116 | * @key: key to be used for this AES operation | ||
| 117 | * @key_len: length in bytes of key | ||
| 118 | * @iv: IV to be used for this AES operation | ||
| 119 | * @iv_len: length in bytes of iv | ||
| 120 | * @src: data to be used for this operation | ||
| 121 | * @dst: data produced by this operation | ||
| 122 | * @src_len: length in bytes of data used for this operation | ||
| 123 | * @cmac_final: indicates final operation when running in CMAC mode | ||
| 124 | * @cmac_key: K1/K2 key used in final CMAC operation | ||
| 125 | * @cmac_key_len: length in bytes of cmac_key | ||
| 126 | * | ||
| 127 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 128 | * - type, mode, action, key, key_len, src, dst, src_len | ||
| 129 | * - iv, iv_len for any mode other than ECB | ||
| 130 | * - cmac_final for CMAC mode | ||
| 131 | * - cmac_key, cmac_key_len for CMAC mode if cmac_final is non-zero | ||
| 132 | * | ||
| 133 | * The iv variable is used as both input and output. On completion of the | ||
| 134 | * AES operation the new IV overwrites the old IV. | ||
| 135 | */ | ||
| 136 | struct ccp_aes_engine { | ||
| 137 | enum ccp_aes_type type; | ||
| 138 | enum ccp_aes_mode mode; | ||
| 139 | enum ccp_aes_action action; | ||
| 140 | |||
| 141 | struct scatterlist *key; | ||
| 142 | u32 key_len; /* In bytes */ | ||
| 143 | |||
| 144 | struct scatterlist *iv; | ||
| 145 | u32 iv_len; /* In bytes */ | ||
| 146 | |||
| 147 | struct scatterlist *src, *dst; | ||
| 148 | u64 src_len; /* In bytes */ | ||
| 149 | |||
| 150 | u32 cmac_final; /* Indicates final cmac cmd */ | ||
| 151 | struct scatterlist *cmac_key; /* K1/K2 cmac key required for | ||
| 152 | * final cmac cmd */ | ||
| 153 | u32 cmac_key_len; /* In bytes */ | ||
| 154 | }; | ||
| 155 | |||
| 156 | /***** XTS-AES engine *****/ | ||
| 157 | /** | ||
| 158 | * ccp_xts_aes_unit_size - XTS unit size | ||
| 159 | * | ||
| 160 | * @CCP_XTS_AES_UNIT_SIZE_16: Unit size of 16 bytes | ||
| 161 | * @CCP_XTS_AES_UNIT_SIZE_512: Unit size of 512 bytes | ||
| 162 | * @CCP_XTS_AES_UNIT_SIZE_1024: Unit size of 1024 bytes | ||
| 163 | * @CCP_XTS_AES_UNIT_SIZE_2048: Unit size of 2048 bytes | ||
| 164 | * @CCP_XTS_AES_UNIT_SIZE_4096: Unit size of 4096 bytes | ||
| 165 | */ | ||
| 166 | enum ccp_xts_aes_unit_size { | ||
| 167 | CCP_XTS_AES_UNIT_SIZE_16 = 0, | ||
| 168 | CCP_XTS_AES_UNIT_SIZE_512, | ||
| 169 | CCP_XTS_AES_UNIT_SIZE_1024, | ||
| 170 | CCP_XTS_AES_UNIT_SIZE_2048, | ||
| 171 | CCP_XTS_AES_UNIT_SIZE_4096, | ||
| 172 | CCP_XTS_AES_UNIT_SIZE__LAST, | ||
| 173 | }; | ||
| 174 | |||
| 175 | /** | ||
| 176 | * struct ccp_xts_aes_engine - CCP XTS AES operation | ||
| 177 | * @action: AES operation (decrypt/encrypt) | ||
| 178 | * @unit_size: unit size of the XTS operation | ||
| 179 | * @key: key to be used for this XTS AES operation | ||
| 180 | * @key_len: length in bytes of key | ||
| 181 | * @iv: IV to be used for this XTS AES operation | ||
| 182 | * @iv_len: length in bytes of iv | ||
| 183 | * @src: data to be used for this operation | ||
| 184 | * @dst: data produced by this operation | ||
| 185 | * @src_len: length in bytes of data used for this operation | ||
| 186 | * @final: indicates final XTS operation | ||
| 187 | * | ||
| 188 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 189 | * - action, unit_size, key, key_len, iv, iv_len, src, dst, src_len, final | ||
| 190 | * | ||
| 191 | * The iv variable is used as both input and output. On completion of the | ||
| 192 | * AES operation the new IV overwrites the old IV. | ||
| 193 | */ | ||
| 194 | struct ccp_xts_aes_engine { | ||
| 195 | enum ccp_aes_action action; | ||
| 196 | enum ccp_xts_aes_unit_size unit_size; | ||
| 197 | |||
| 198 | struct scatterlist *key; | ||
| 199 | u32 key_len; /* In bytes */ | ||
| 200 | |||
| 201 | struct scatterlist *iv; | ||
| 202 | u32 iv_len; /* In bytes */ | ||
| 203 | |||
| 204 | struct scatterlist *src, *dst; | ||
| 205 | u64 src_len; /* In bytes */ | ||
| 206 | |||
| 207 | u32 final; | ||
| 208 | }; | ||
| 209 | |||
| 210 | /***** SHA engine *****/ | ||
| 211 | #define CCP_SHA_BLOCKSIZE SHA256_BLOCK_SIZE | ||
| 212 | #define CCP_SHA_CTXSIZE SHA256_DIGEST_SIZE | ||
| 213 | |||
| 214 | /** | ||
| 215 | * ccp_sha_type - type of SHA operation | ||
| 216 | * | ||
| 217 | * @CCP_SHA_TYPE_1: SHA-1 operation | ||
| 218 | * @CCP_SHA_TYPE_224: SHA-224 operation | ||
| 219 | * @CCP_SHA_TYPE_256: SHA-256 operation | ||
| 220 | */ | ||
| 221 | enum ccp_sha_type { | ||
| 222 | CCP_SHA_TYPE_1 = 1, | ||
| 223 | CCP_SHA_TYPE_224, | ||
| 224 | CCP_SHA_TYPE_256, | ||
| 225 | CCP_SHA_TYPE__LAST, | ||
| 226 | }; | ||
| 227 | |||
| 228 | /** | ||
| 229 | * struct ccp_sha_engine - CCP SHA operation | ||
| 230 | * @type: Type of SHA operation | ||
| 231 | * @ctx: current hash value | ||
| 232 | * @ctx_len: length in bytes of hash value | ||
| 233 | * @src: data to be used for this operation | ||
| 234 | * @src_len: length in bytes of data used for this operation | ||
| 235 | * @final: indicates final SHA operation | ||
| 236 | * @msg_bits: total length of the message in bits used in final SHA operation | ||
| 237 | * | ||
| 238 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 239 | * - type, ctx, ctx_len, src, src_len, final | ||
| 240 | * - msg_bits if final is non-zero | ||
| 241 | * | ||
| 242 | * The ctx variable is used as both input and output. On completion of the | ||
| 243 | * SHA operation the new hash value overwrites the old hash value. | ||
| 244 | */ | ||
| 245 | struct ccp_sha_engine { | ||
| 246 | enum ccp_sha_type type; | ||
| 247 | |||
| 248 | struct scatterlist *ctx; | ||
| 249 | u32 ctx_len; /* In bytes */ | ||
| 250 | |||
| 251 | struct scatterlist *src; | ||
| 252 | u64 src_len; /* In bytes */ | ||
| 253 | |||
| 254 | u32 final; /* Indicates final sha cmd */ | ||
| 255 | u64 msg_bits; /* Message length in bits required for | ||
| 256 | * final sha cmd */ | ||
| 257 | }; | ||
| 258 | |||
| 259 | /***** RSA engine *****/ | ||
| 260 | /** | ||
| 261 | * struct ccp_rsa_engine - CCP RSA operation | ||
| 262 | * @key_size: length in bits of RSA key | ||
| 263 | * @exp: RSA exponent | ||
| 264 | * @exp_len: length in bytes of exponent | ||
| 265 | * @mod: RSA modulus | ||
| 266 | * @mod_len: length in bytes of modulus | ||
| 267 | * @src: data to be used for this operation | ||
| 268 | * @dst: data produced by this operation | ||
| 269 | * @src_len: length in bytes of data used for this operation | ||
| 270 | * | ||
| 271 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 272 | * - key_size, exp, exp_len, mod, mod_len, src, dst, src_len | ||
| 273 | */ | ||
| 274 | struct ccp_rsa_engine { | ||
| 275 | u32 key_size; /* In bits */ | ||
| 276 | |||
| 277 | struct scatterlist *exp; | ||
| 278 | u32 exp_len; /* In bytes */ | ||
| 279 | |||
| 280 | struct scatterlist *mod; | ||
| 281 | u32 mod_len; /* In bytes */ | ||
| 282 | |||
| 283 | struct scatterlist *src, *dst; | ||
| 284 | u32 src_len; /* In bytes */ | ||
| 285 | }; | ||
| 286 | |||
| 287 | /***** Passthru engine *****/ | ||
| 288 | /** | ||
| 289 | * ccp_passthru_bitwise - type of bitwise passthru operation | ||
| 290 | * | ||
| 291 | * @CCP_PASSTHRU_BITWISE_NOOP: no bitwise operation performed | ||
| 292 | * @CCP_PASSTHRU_BITWISE_AND: perform bitwise AND of src with mask | ||
| 293 | * @CCP_PASSTHRU_BITWISE_OR: perform bitwise OR of src with mask | ||
| 294 | * @CCP_PASSTHRU_BITWISE_XOR: perform bitwise XOR of src with mask | ||
| 295 | * @CCP_PASSTHRU_BITWISE_MASK: overwrite with mask | ||
| 296 | */ | ||
| 297 | enum ccp_passthru_bitwise { | ||
| 298 | CCP_PASSTHRU_BITWISE_NOOP = 0, | ||
| 299 | CCP_PASSTHRU_BITWISE_AND, | ||
| 300 | CCP_PASSTHRU_BITWISE_OR, | ||
| 301 | CCP_PASSTHRU_BITWISE_XOR, | ||
| 302 | CCP_PASSTHRU_BITWISE_MASK, | ||
| 303 | CCP_PASSTHRU_BITWISE__LAST, | ||
| 304 | }; | ||
| 305 | |||
| 306 | /** | ||
| 307 | * ccp_passthru_byteswap - type of byteswap passthru operation | ||
| 308 | * | ||
| 309 | * @CCP_PASSTHRU_BYTESWAP_NOOP: no byte swapping performed | ||
| 310 | * @CCP_PASSTHRU_BYTESWAP_32BIT: swap bytes within 32-bit words | ||
| 311 | * @CCP_PASSTHRU_BYTESWAP_256BIT: swap bytes within 256-bit words | ||
| 312 | */ | ||
| 313 | enum ccp_passthru_byteswap { | ||
| 314 | CCP_PASSTHRU_BYTESWAP_NOOP = 0, | ||
| 315 | CCP_PASSTHRU_BYTESWAP_32BIT, | ||
| 316 | CCP_PASSTHRU_BYTESWAP_256BIT, | ||
| 317 | CCP_PASSTHRU_BYTESWAP__LAST, | ||
| 318 | }; | ||
| 319 | |||
| 320 | /** | ||
| 321 | * struct ccp_passthru_engine - CCP pass-through operation | ||
| 322 | * @bit_mod: bitwise operation to perform | ||
| 323 | * @byte_swap: byteswap operation to perform | ||
| 324 | * @mask: mask to be applied to data | ||
| 325 | * @mask_len: length in bytes of mask | ||
| 326 | * @src: data to be used for this operation | ||
| 327 | * @dst: data produced by this operation | ||
| 328 | * @src_len: length in bytes of data used for this operation | ||
| 329 | * @final: indicate final pass-through operation | ||
| 330 | * | ||
| 331 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 332 | * - bit_mod, byte_swap, src, dst, src_len | ||
| 333 | * - mask, mask_len if bit_mod is not CCP_PASSTHRU_BITWISE_NOOP | ||
| 334 | */ | ||
| 335 | struct ccp_passthru_engine { | ||
| 336 | enum ccp_passthru_bitwise bit_mod; | ||
| 337 | enum ccp_passthru_byteswap byte_swap; | ||
| 338 | |||
| 339 | struct scatterlist *mask; | ||
| 340 | u32 mask_len; /* In bytes */ | ||
| 341 | |||
| 342 | struct scatterlist *src, *dst; | ||
| 343 | u64 src_len; /* In bytes */ | ||
| 344 | |||
| 345 | u32 final; | ||
| 346 | }; | ||
| 347 | |||
| 348 | /***** ECC engine *****/ | ||
| 349 | #define CCP_ECC_MODULUS_BYTES 48 /* 384-bits */ | ||
| 350 | #define CCP_ECC_MAX_OPERANDS 6 | ||
| 351 | #define CCP_ECC_MAX_OUTPUTS 3 | ||
| 352 | |||
| 353 | /** | ||
| 354 | * ccp_ecc_function - type of ECC function | ||
| 355 | * | ||
| 356 | * @CCP_ECC_FUNCTION_MMUL_384BIT: 384-bit modular multiplication | ||
| 357 | * @CCP_ECC_FUNCTION_MADD_384BIT: 384-bit modular addition | ||
| 358 | * @CCP_ECC_FUNCTION_MINV_384BIT: 384-bit multiplicative inverse | ||
| 359 | * @CCP_ECC_FUNCTION_PADD_384BIT: 384-bit point addition | ||
| 360 | * @CCP_ECC_FUNCTION_PMUL_384BIT: 384-bit point multiplication | ||
| 361 | * @CCP_ECC_FUNCTION_PDBL_384BIT: 384-bit point doubling | ||
| 362 | */ | ||
| 363 | enum ccp_ecc_function { | ||
| 364 | CCP_ECC_FUNCTION_MMUL_384BIT = 0, | ||
| 365 | CCP_ECC_FUNCTION_MADD_384BIT, | ||
| 366 | CCP_ECC_FUNCTION_MINV_384BIT, | ||
| 367 | CCP_ECC_FUNCTION_PADD_384BIT, | ||
| 368 | CCP_ECC_FUNCTION_PMUL_384BIT, | ||
| 369 | CCP_ECC_FUNCTION_PDBL_384BIT, | ||
| 370 | }; | ||
| 371 | |||
| 372 | /** | ||
| 373 | * struct ccp_ecc_modular_math - CCP ECC modular math parameters | ||
| 374 | * @operand_1: first operand for the modular math operation | ||
| 375 | * @operand_1_len: length of the first operand | ||
| 376 | * @operand_2: second operand for the modular math operation | ||
| 377 | * (not used for CCP_ECC_FUNCTION_MINV_384BIT) | ||
| 378 | * @operand_2_len: length of the second operand | ||
| 379 | * (not used for CCP_ECC_FUNCTION_MINV_384BIT) | ||
| 380 | * @result: result of the modular math operation | ||
| 381 | * @result_len: length of the supplied result buffer | ||
| 382 | */ | ||
| 383 | struct ccp_ecc_modular_math { | ||
| 384 | struct scatterlist *operand_1; | ||
| 385 | unsigned int operand_1_len; /* In bytes */ | ||
| 386 | |||
| 387 | struct scatterlist *operand_2; | ||
| 388 | unsigned int operand_2_len; /* In bytes */ | ||
| 389 | |||
| 390 | struct scatterlist *result; | ||
| 391 | unsigned int result_len; /* In bytes */ | ||
| 392 | }; | ||
| 393 | |||
| 394 | /** | ||
| 395 | * struct ccp_ecc_point - CCP ECC point definition | ||
| 396 | * @x: the x coordinate of the ECC point | ||
| 397 | * @x_len: the length of the x coordinate | ||
| 398 | * @y: the y coordinate of the ECC point | ||
| 399 | * @y_len: the length of the y coordinate | ||
| 400 | */ | ||
| 401 | struct ccp_ecc_point { | ||
| 402 | struct scatterlist *x; | ||
| 403 | unsigned int x_len; /* In bytes */ | ||
| 404 | |||
| 405 | struct scatterlist *y; | ||
| 406 | unsigned int y_len; /* In bytes */ | ||
| 407 | }; | ||
| 408 | |||
| 409 | /** | ||
| 410 | * struct ccp_ecc_point_math - CCP ECC point math parameters | ||
| 411 | * @point_1: the first point of the ECC point math operation | ||
| 412 | * @point_2: the second point of the ECC point math operation | ||
| 413 | * (only used for CCP_ECC_FUNCTION_PADD_384BIT) | ||
| 414 | * @domain_a: the a parameter of the ECC curve | ||
| 415 | * @domain_a_len: the length of the a parameter | ||
| 416 | * @scalar: the scalar parameter for the point match operation | ||
| 417 | * (only used for CCP_ECC_FUNCTION_PMUL_384BIT) | ||
| 418 | * @scalar_len: the length of the scalar parameter | ||
| 419 | * (only used for CCP_ECC_FUNCTION_PMUL_384BIT) | ||
| 420 | * @result: the point resulting from the point math operation | ||
| 421 | */ | ||
| 422 | struct ccp_ecc_point_math { | ||
| 423 | struct ccp_ecc_point point_1; | ||
| 424 | struct ccp_ecc_point point_2; | ||
| 425 | |||
| 426 | struct scatterlist *domain_a; | ||
| 427 | unsigned int domain_a_len; /* In bytes */ | ||
| 428 | |||
| 429 | struct scatterlist *scalar; | ||
| 430 | unsigned int scalar_len; /* In bytes */ | ||
| 431 | |||
| 432 | struct ccp_ecc_point result; | ||
| 433 | }; | ||
| 434 | |||
| 435 | /** | ||
| 436 | * struct ccp_ecc_engine - CCP ECC operation | ||
| 437 | * @function: ECC function to perform | ||
| 438 | * @mod: ECC modulus | ||
| 439 | * @mod_len: length in bytes of modulus | ||
| 440 | * @mm: module math parameters | ||
| 441 | * @pm: point math parameters | ||
| 442 | * @ecc_result: result of the ECC operation | ||
| 443 | * | ||
| 444 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 445 | * - function, mod, mod_len | ||
| 446 | * - operand, operand_len, operand_count, output, output_len, output_count | ||
| 447 | * - ecc_result | ||
| 448 | */ | ||
| 449 | struct ccp_ecc_engine { | ||
| 450 | enum ccp_ecc_function function; | ||
| 451 | |||
| 452 | struct scatterlist *mod; | ||
| 453 | u32 mod_len; /* In bytes */ | ||
| 454 | |||
| 455 | union { | ||
| 456 | struct ccp_ecc_modular_math mm; | ||
| 457 | struct ccp_ecc_point_math pm; | ||
| 458 | } u; | ||
| 459 | |||
| 460 | u16 ecc_result; | ||
| 461 | }; | ||
| 462 | |||
| 463 | |||
| 464 | /** | ||
| 465 | * ccp_engine - CCP operation identifiers | ||
| 466 | * | ||
| 467 | * @CCP_ENGINE_AES: AES operation | ||
| 468 | * @CCP_ENGINE_XTS_AES: 128-bit XTS AES operation | ||
| 469 | * @CCP_ENGINE_RSVD1: unused | ||
| 470 | * @CCP_ENGINE_SHA: SHA operation | ||
| 471 | * @CCP_ENGINE_RSA: RSA operation | ||
| 472 | * @CCP_ENGINE_PASSTHRU: pass-through operation | ||
| 473 | * @CCP_ENGINE_ZLIB_DECOMPRESS: unused | ||
| 474 | * @CCP_ENGINE_ECC: ECC operation | ||
| 475 | */ | ||
| 476 | enum ccp_engine { | ||
| 477 | CCP_ENGINE_AES = 0, | ||
| 478 | CCP_ENGINE_XTS_AES_128, | ||
| 479 | CCP_ENGINE_RSVD1, | ||
| 480 | CCP_ENGINE_SHA, | ||
| 481 | CCP_ENGINE_RSA, | ||
| 482 | CCP_ENGINE_PASSTHRU, | ||
| 483 | CCP_ENGINE_ZLIB_DECOMPRESS, | ||
| 484 | CCP_ENGINE_ECC, | ||
| 485 | CCP_ENGINE__LAST, | ||
| 486 | }; | ||
| 487 | |||
| 488 | /* Flag values for flags member of ccp_cmd */ | ||
| 489 | #define CCP_CMD_MAY_BACKLOG 0x00000001 | ||
| 490 | |||
| 491 | /** | ||
| 492 | * struct ccp_cmd - CPP operation request | ||
| 493 | * @entry: list element (ccp driver use only) | ||
| 494 | * @work: work element used for callbacks (ccp driver use only) | ||
| 495 | * @ccp: CCP device to be run on (ccp driver use only) | ||
| 496 | * @ret: operation return code (ccp driver use only) | ||
| 497 | * @flags: cmd processing flags | ||
| 498 | * @engine: CCP operation to perform | ||
| 499 | * @engine_error: CCP engine return code | ||
| 500 | * @u: engine specific structures, refer to specific engine struct below | ||
| 501 | * @callback: operation completion callback function | ||
| 502 | * @data: parameter value to be supplied to the callback function | ||
| 503 | * | ||
| 504 | * Variables required to be set when calling ccp_enqueue_cmd(): | ||
| 505 | * - engine, callback | ||
| 506 | * - See the operation structures below for what is required for each | ||
| 507 | * operation. | ||
| 508 | */ | ||
| 509 | struct ccp_cmd { | ||
| 510 | /* The list_head, work_struct, ccp and ret variables are for use | ||
| 511 | * by the CCP driver only. | ||
| 512 | */ | ||
| 513 | struct list_head entry; | ||
| 514 | struct work_struct work; | ||
| 515 | struct ccp_device *ccp; | ||
| 516 | int ret; | ||
| 517 | |||
| 518 | u32 flags; | ||
| 519 | |||
| 520 | enum ccp_engine engine; | ||
| 521 | u32 engine_error; | ||
| 522 | |||
| 523 | union { | ||
| 524 | struct ccp_aes_engine aes; | ||
| 525 | struct ccp_xts_aes_engine xts; | ||
| 526 | struct ccp_sha_engine sha; | ||
| 527 | struct ccp_rsa_engine rsa; | ||
| 528 | struct ccp_passthru_engine passthru; | ||
| 529 | struct ccp_ecc_engine ecc; | ||
| 530 | } u; | ||
| 531 | |||
| 532 | /* Completion callback support */ | ||
| 533 | void (*callback)(void *data, int err); | ||
| 534 | void *data; | ||
| 535 | }; | ||
| 536 | |||
| 537 | #endif | ||
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h index 0442c3d800f0..a6ef9cc267ec 100644 --- a/include/linux/ceph/decode.h +++ b/include/linux/ceph/decode.h | |||
| @@ -8,23 +8,6 @@ | |||
| 8 | 8 | ||
| 9 | #include <linux/ceph/types.h> | 9 | #include <linux/ceph/types.h> |
| 10 | 10 | ||
| 11 | /* This seemed to be the easiest place to define these */ | ||
| 12 | |||
| 13 | #define U8_MAX ((u8)(~0U)) | ||
| 14 | #define U16_MAX ((u16)(~0U)) | ||
| 15 | #define U32_MAX ((u32)(~0U)) | ||
| 16 | #define U64_MAX ((u64)(~0ULL)) | ||
| 17 | |||
| 18 | #define S8_MAX ((s8)(U8_MAX >> 1)) | ||
| 19 | #define S16_MAX ((s16)(U16_MAX >> 1)) | ||
| 20 | #define S32_MAX ((s32)(U32_MAX >> 1)) | ||
| 21 | #define S64_MAX ((s64)(U64_MAX >> 1LL)) | ||
| 22 | |||
| 23 | #define S8_MIN ((s8)(-S8_MAX - 1)) | ||
| 24 | #define S16_MIN ((s16)(-S16_MAX - 1)) | ||
| 25 | #define S32_MIN ((s32)(-S32_MAX - 1)) | ||
| 26 | #define S64_MIN ((s64)(-S64_MAX - 1LL)) | ||
| 27 | |||
| 28 | /* | 11 | /* |
| 29 | * in all cases, | 12 | * in all cases, |
| 30 | * void **p pointer to position pointer | 13 | * void **p pointer to position pointer |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 39c1d9469677..5c097596104b 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/xattr.h> | 21 | #include <linux/xattr.h> |
| 22 | #include <linux/fs.h> | 22 | #include <linux/fs.h> |
| 23 | #include <linux/percpu-refcount.h> | 23 | #include <linux/percpu-refcount.h> |
| 24 | #include <linux/seq_file.h> | ||
| 24 | 25 | ||
| 25 | #ifdef CONFIG_CGROUPS | 26 | #ifdef CONFIG_CGROUPS |
| 26 | 27 | ||
| @@ -28,8 +29,6 @@ struct cgroupfs_root; | |||
| 28 | struct cgroup_subsys; | 29 | struct cgroup_subsys; |
| 29 | struct inode; | 30 | struct inode; |
| 30 | struct cgroup; | 31 | struct cgroup; |
| 31 | struct css_id; | ||
| 32 | struct eventfd_ctx; | ||
| 33 | 32 | ||
| 34 | extern int cgroup_init_early(void); | 33 | extern int cgroup_init_early(void); |
| 35 | extern int cgroup_init(void); | 34 | extern int cgroup_init(void); |
| @@ -79,8 +78,6 @@ struct cgroup_subsys_state { | |||
| 79 | struct cgroup_subsys_state *parent; | 78 | struct cgroup_subsys_state *parent; |
| 80 | 79 | ||
| 81 | unsigned long flags; | 80 | unsigned long flags; |
| 82 | /* ID for this css, if possible */ | ||
| 83 | struct css_id __rcu *id; | ||
| 84 | 81 | ||
| 85 | /* percpu_ref killing and RCU release */ | 82 | /* percpu_ref killing and RCU release */ |
| 86 | struct rcu_head rcu_head; | 83 | struct rcu_head rcu_head; |
| @@ -239,10 +236,6 @@ struct cgroup { | |||
| 239 | struct rcu_head rcu_head; | 236 | struct rcu_head rcu_head; |
| 240 | struct work_struct destroy_work; | 237 | struct work_struct destroy_work; |
| 241 | 238 | ||
| 242 | /* List of events which userspace want to receive */ | ||
| 243 | struct list_head event_list; | ||
| 244 | spinlock_t event_list_lock; | ||
| 245 | |||
| 246 | /* directory xattrs */ | 239 | /* directory xattrs */ |
| 247 | struct simple_xattrs xattrs; | 240 | struct simple_xattrs xattrs; |
| 248 | }; | 241 | }; |
| @@ -280,6 +273,9 @@ enum { | |||
| 280 | * - "tasks" is removed. Everything should be at process | 273 | * - "tasks" is removed. Everything should be at process |
| 281 | * granularity. Use "cgroup.procs" instead. | 274 | * granularity. Use "cgroup.procs" instead. |
| 282 | * | 275 | * |
| 276 | * - "cgroup.procs" is not sorted. pids will be unique unless they | ||
| 277 | * got recycled inbetween reads. | ||
| 278 | * | ||
| 283 | * - "release_agent" and "notify_on_release" are removed. | 279 | * - "release_agent" and "notify_on_release" are removed. |
| 284 | * Replacement notification mechanism will be implemented. | 280 | * Replacement notification mechanism will be implemented. |
| 285 | * | 281 | * |
| @@ -320,9 +316,6 @@ struct cgroupfs_root { | |||
| 320 | /* Unique id for this hierarchy. */ | 316 | /* Unique id for this hierarchy. */ |
| 321 | int hierarchy_id; | 317 | int hierarchy_id; |
| 322 | 318 | ||
| 323 | /* A list running through the attached subsystems */ | ||
| 324 | struct list_head subsys_list; | ||
| 325 | |||
| 326 | /* The root cgroup for this hierarchy */ | 319 | /* The root cgroup for this hierarchy */ |
| 327 | struct cgroup top_cgroup; | 320 | struct cgroup top_cgroup; |
| 328 | 321 | ||
| @@ -389,16 +382,6 @@ struct css_set { | |||
| 389 | }; | 382 | }; |
| 390 | 383 | ||
| 391 | /* | 384 | /* |
| 392 | * cgroup_map_cb is an abstract callback API for reporting map-valued | ||
| 393 | * control files | ||
| 394 | */ | ||
| 395 | |||
| 396 | struct cgroup_map_cb { | ||
| 397 | int (*fill)(struct cgroup_map_cb *cb, const char *key, u64 value); | ||
| 398 | void *state; | ||
| 399 | }; | ||
| 400 | |||
| 401 | /* | ||
| 402 | * struct cftype: handler definitions for cgroup control files | 385 | * struct cftype: handler definitions for cgroup control files |
| 403 | * | 386 | * |
| 404 | * When reading/writing to a file: | 387 | * When reading/writing to a file: |
| @@ -445,10 +428,6 @@ struct cftype { | |||
| 445 | */ | 428 | */ |
| 446 | struct cgroup_subsys *ss; | 429 | struct cgroup_subsys *ss; |
| 447 | 430 | ||
| 448 | int (*open)(struct inode *inode, struct file *file); | ||
| 449 | ssize_t (*read)(struct cgroup_subsys_state *css, struct cftype *cft, | ||
| 450 | struct file *file, | ||
| 451 | char __user *buf, size_t nbytes, loff_t *ppos); | ||
| 452 | /* | 431 | /* |
| 453 | * read_u64() is a shortcut for the common case of returning a | 432 | * read_u64() is a shortcut for the common case of returning a |
| 454 | * single integer. Use it in place of read() | 433 | * single integer. Use it in place of read() |
| @@ -458,24 +437,14 @@ struct cftype { | |||
| 458 | * read_s64() is a signed version of read_u64() | 437 | * read_s64() is a signed version of read_u64() |
| 459 | */ | 438 | */ |
| 460 | s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft); | 439 | s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft); |
| 461 | /* | ||
| 462 | * read_map() is used for defining a map of key/value | ||
| 463 | * pairs. It should call cb->fill(cb, key, value) for each | ||
| 464 | * entry. The key/value pairs (and their ordering) should not | ||
| 465 | * change between reboots. | ||
| 466 | */ | ||
| 467 | int (*read_map)(struct cgroup_subsys_state *css, struct cftype *cft, | ||
| 468 | struct cgroup_map_cb *cb); | ||
| 469 | /* | ||
| 470 | * read_seq_string() is used for outputting a simple sequence | ||
| 471 | * using seqfile. | ||
| 472 | */ | ||
| 473 | int (*read_seq_string)(struct cgroup_subsys_state *css, | ||
| 474 | struct cftype *cft, struct seq_file *m); | ||
| 475 | 440 | ||
| 476 | ssize_t (*write)(struct cgroup_subsys_state *css, struct cftype *cft, | 441 | /* generic seq_file read interface */ |
| 477 | struct file *file, | 442 | int (*seq_show)(struct seq_file *sf, void *v); |
| 478 | const char __user *buf, size_t nbytes, loff_t *ppos); | 443 | |
| 444 | /* optional ops, implement all or none */ | ||
| 445 | void *(*seq_start)(struct seq_file *sf, loff_t *ppos); | ||
| 446 | void *(*seq_next)(struct seq_file *sf, void *v, loff_t *ppos); | ||
| 447 | void (*seq_stop)(struct seq_file *sf, void *v); | ||
| 479 | 448 | ||
| 480 | /* | 449 | /* |
| 481 | * write_u64() is a shortcut for the common case of accepting | 450 | * write_u64() is a shortcut for the common case of accepting |
| @@ -504,27 +473,6 @@ struct cftype { | |||
| 504 | * kick type for multiplexing. | 473 | * kick type for multiplexing. |
| 505 | */ | 474 | */ |
| 506 | int (*trigger)(struct cgroup_subsys_state *css, unsigned int event); | 475 | int (*trigger)(struct cgroup_subsys_state *css, unsigned int event); |
| 507 | |||
| 508 | int (*release)(struct inode *inode, struct file *file); | ||
| 509 | |||
| 510 | /* | ||
| 511 | * register_event() callback will be used to add new userspace | ||
| 512 | * waiter for changes related to the cftype. Implement it if | ||
| 513 | * you want to provide this functionality. Use eventfd_signal() | ||
| 514 | * on eventfd to send notification to userspace. | ||
| 515 | */ | ||
| 516 | int (*register_event)(struct cgroup_subsys_state *css, | ||
| 517 | struct cftype *cft, struct eventfd_ctx *eventfd, | ||
| 518 | const char *args); | ||
| 519 | /* | ||
| 520 | * unregister_event() callback will be called when userspace | ||
| 521 | * closes the eventfd or on cgroup removing. | ||
| 522 | * This callback must be implemented, if you want provide | ||
| 523 | * notification functionality. | ||
| 524 | */ | ||
| 525 | void (*unregister_event)(struct cgroup_subsys_state *css, | ||
| 526 | struct cftype *cft, | ||
| 527 | struct eventfd_ctx *eventfd); | ||
| 528 | }; | 476 | }; |
| 529 | 477 | ||
| 530 | /* | 478 | /* |
| @@ -538,6 +486,26 @@ struct cftype_set { | |||
| 538 | }; | 486 | }; |
| 539 | 487 | ||
| 540 | /* | 488 | /* |
| 489 | * cgroupfs file entry, pointed to from leaf dentry->d_fsdata. Don't | ||
| 490 | * access directly. | ||
| 491 | */ | ||
| 492 | struct cfent { | ||
| 493 | struct list_head node; | ||
| 494 | struct dentry *dentry; | ||
| 495 | struct cftype *type; | ||
| 496 | struct cgroup_subsys_state *css; | ||
| 497 | |||
| 498 | /* file xattrs */ | ||
| 499 | struct simple_xattrs xattrs; | ||
| 500 | }; | ||
| 501 | |||
| 502 | /* seq_file->private points to the following, only ->priv is public */ | ||
| 503 | struct cgroup_open_file { | ||
| 504 | struct cfent *cfe; | ||
| 505 | void *priv; | ||
| 506 | }; | ||
| 507 | |||
| 508 | /* | ||
| 541 | * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This | 509 | * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This |
| 542 | * function can be called as long as @cgrp is accessible. | 510 | * function can be called as long as @cgrp is accessible. |
| 543 | */ | 511 | */ |
| @@ -552,6 +520,18 @@ static inline const char *cgroup_name(const struct cgroup *cgrp) | |||
| 552 | return rcu_dereference(cgrp->name)->name; | 520 | return rcu_dereference(cgrp->name)->name; |
| 553 | } | 521 | } |
| 554 | 522 | ||
| 523 | static inline struct cgroup_subsys_state *seq_css(struct seq_file *seq) | ||
| 524 | { | ||
| 525 | struct cgroup_open_file *of = seq->private; | ||
| 526 | return of->cfe->css; | ||
| 527 | } | ||
| 528 | |||
| 529 | static inline struct cftype *seq_cft(struct seq_file *seq) | ||
| 530 | { | ||
| 531 | struct cgroup_open_file *of = seq->private; | ||
| 532 | return of->cfe->type; | ||
| 533 | } | ||
| 534 | |||
| 555 | int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); | 535 | int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); |
| 556 | int cgroup_rm_cftypes(struct cftype *cfts); | 536 | int cgroup_rm_cftypes(struct cftype *cfts); |
| 557 | 537 | ||
| @@ -631,12 +611,8 @@ struct cgroup_subsys { | |||
| 631 | #define MAX_CGROUP_TYPE_NAMELEN 32 | 611 | #define MAX_CGROUP_TYPE_NAMELEN 32 |
| 632 | const char *name; | 612 | const char *name; |
| 633 | 613 | ||
| 634 | /* | 614 | /* link to parent, protected by cgroup_lock() */ |
| 635 | * Link to parent, and list entry in parent's children. | ||
| 636 | * Protected by cgroup_lock() | ||
| 637 | */ | ||
| 638 | struct cgroupfs_root *root; | 615 | struct cgroupfs_root *root; |
| 639 | struct list_head sibling; | ||
| 640 | 616 | ||
| 641 | /* list of cftype_sets */ | 617 | /* list of cftype_sets */ |
| 642 | struct list_head cftsets; | 618 | struct list_head cftsets; |
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index b613ffd402d1..7b99d717411d 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
| @@ -31,7 +31,7 @@ SUBSYS(devices) | |||
| 31 | SUBSYS(freezer) | 31 | SUBSYS(freezer) |
| 32 | #endif | 32 | #endif |
| 33 | 33 | ||
| 34 | #if IS_SUBSYS_ENABLED(CONFIG_NET_CLS_CGROUP) | 34 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_NET_CLASSID) |
| 35 | SUBSYS(net_cls) | 35 | SUBSYS(net_cls) |
| 36 | #endif | 36 | #endif |
| 37 | 37 | ||
| @@ -43,7 +43,7 @@ SUBSYS(blkio) | |||
| 43 | SUBSYS(perf) | 43 | SUBSYS(perf) |
| 44 | #endif | 44 | #endif |
| 45 | 45 | ||
| 46 | #if IS_SUBSYS_ENABLED(CONFIG_NETPRIO_CGROUP) | 46 | #if IS_SUBSYS_ENABLED(CONFIG_CGROUP_NET_PRIO) |
| 47 | SUBSYS(net_prio) | 47 | SUBSYS(net_prio) |
| 48 | #endif | 48 | #endif |
| 49 | 49 | ||
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h index 8138c94409f3..efbf70b9fd84 100644 --- a/include/linux/clk-private.h +++ b/include/linux/clk-private.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #define __LINUX_CLK_PRIVATE_H | 12 | #define __LINUX_CLK_PRIVATE_H |
| 13 | 13 | ||
| 14 | #include <linux/clk-provider.h> | 14 | #include <linux/clk-provider.h> |
| 15 | #include <linux/kref.h> | ||
| 15 | #include <linux/list.h> | 16 | #include <linux/list.h> |
| 16 | 17 | ||
| 17 | /* | 18 | /* |
| @@ -25,10 +26,13 @@ | |||
| 25 | 26 | ||
| 26 | #ifdef CONFIG_COMMON_CLK | 27 | #ifdef CONFIG_COMMON_CLK |
| 27 | 28 | ||
| 29 | struct module; | ||
| 30 | |||
| 28 | struct clk { | 31 | struct clk { |
| 29 | const char *name; | 32 | const char *name; |
| 30 | const struct clk_ops *ops; | 33 | const struct clk_ops *ops; |
| 31 | struct clk_hw *hw; | 34 | struct clk_hw *hw; |
| 35 | struct module *owner; | ||
| 32 | struct clk *parent; | 36 | struct clk *parent; |
| 33 | const char **parent_names; | 37 | const char **parent_names; |
| 34 | struct clk **parents; | 38 | struct clk **parents; |
| @@ -41,12 +45,14 @@ struct clk { | |||
| 41 | unsigned long flags; | 45 | unsigned long flags; |
| 42 | unsigned int enable_count; | 46 | unsigned int enable_count; |
| 43 | unsigned int prepare_count; | 47 | unsigned int prepare_count; |
| 48 | unsigned long accuracy; | ||
| 44 | struct hlist_head children; | 49 | struct hlist_head children; |
| 45 | struct hlist_node child_node; | 50 | struct hlist_node child_node; |
| 46 | unsigned int notifier_count; | 51 | unsigned int notifier_count; |
| 47 | #ifdef CONFIG_COMMON_CLK_DEBUG | 52 | #ifdef CONFIG_DEBUG_FS |
| 48 | struct dentry *dentry; | 53 | struct dentry *dentry; |
| 49 | #endif | 54 | #endif |
| 55 | struct kref ref; | ||
| 50 | }; | 56 | }; |
| 51 | 57 | ||
| 52 | /* | 58 | /* |
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 7e59253b8603..999b28ba38f7 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */ | 29 | #define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */ |
| 30 | #define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */ | 30 | #define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */ |
| 31 | #define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */ | 31 | #define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */ |
| 32 | #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */ | ||
| 32 | 33 | ||
| 33 | struct clk_hw; | 34 | struct clk_hw; |
| 34 | 35 | ||
| @@ -108,6 +109,25 @@ struct clk_hw; | |||
| 108 | * which is likely helpful for most .set_rate implementation. | 109 | * which is likely helpful for most .set_rate implementation. |
| 109 | * Returns 0 on success, -EERROR otherwise. | 110 | * Returns 0 on success, -EERROR otherwise. |
| 110 | * | 111 | * |
| 112 | * @recalc_accuracy: Recalculate the accuracy of this clock. The clock accuracy | ||
| 113 | * is expressed in ppb (parts per billion). The parent accuracy is | ||
| 114 | * an input parameter. | ||
| 115 | * Returns the calculated accuracy. Optional - if this op is not | ||
| 116 | * set then clock accuracy will be initialized to parent accuracy | ||
| 117 | * or 0 (perfect clock) if clock has no parent. | ||
| 118 | * | ||
| 119 | * @set_rate_and_parent: Change the rate and the parent of this clock. The | ||
| 120 | * requested rate is specified by the second argument, which | ||
| 121 | * should typically be the return of .round_rate call. The | ||
| 122 | * third argument gives the parent rate which is likely helpful | ||
| 123 | * for most .set_rate_and_parent implementation. The fourth | ||
| 124 | * argument gives the parent index. This callback is optional (and | ||
| 125 | * unnecessary) for clocks with 0 or 1 parents as well as | ||
| 126 | * for clocks that can tolerate switching the rate and the parent | ||
| 127 | * separately via calls to .set_parent and .set_rate. | ||
| 128 | * Returns 0 on success, -EERROR otherwise. | ||
| 129 | * | ||
| 130 | * | ||
| 111 | * The clk_enable/clk_disable and clk_prepare/clk_unprepare pairs allow | 131 | * The clk_enable/clk_disable and clk_prepare/clk_unprepare pairs allow |
| 112 | * implementations to split any work between atomic (enable) and sleepable | 132 | * implementations to split any work between atomic (enable) and sleepable |
| 113 | * (prepare) contexts. If enabling a clock requires code that might sleep, | 133 | * (prepare) contexts. If enabling a clock requires code that might sleep, |
| @@ -139,6 +159,11 @@ struct clk_ops { | |||
| 139 | u8 (*get_parent)(struct clk_hw *hw); | 159 | u8 (*get_parent)(struct clk_hw *hw); |
| 140 | int (*set_rate)(struct clk_hw *hw, unsigned long, | 160 | int (*set_rate)(struct clk_hw *hw, unsigned long, |
| 141 | unsigned long); | 161 | unsigned long); |
| 162 | int (*set_rate_and_parent)(struct clk_hw *hw, | ||
| 163 | unsigned long rate, | ||
| 164 | unsigned long parent_rate, u8 index); | ||
| 165 | unsigned long (*recalc_accuracy)(struct clk_hw *hw, | ||
| 166 | unsigned long parent_accuracy); | ||
| 142 | void (*init)(struct clk_hw *hw); | 167 | void (*init)(struct clk_hw *hw); |
| 143 | }; | 168 | }; |
| 144 | 169 | ||
| @@ -194,6 +219,7 @@ struct clk_hw { | |||
| 194 | struct clk_fixed_rate { | 219 | struct clk_fixed_rate { |
| 195 | struct clk_hw hw; | 220 | struct clk_hw hw; |
| 196 | unsigned long fixed_rate; | 221 | unsigned long fixed_rate; |
| 222 | unsigned long fixed_accuracy; | ||
| 197 | u8 flags; | 223 | u8 flags; |
| 198 | }; | 224 | }; |
| 199 | 225 | ||
| @@ -201,6 +227,9 @@ extern const struct clk_ops clk_fixed_rate_ops; | |||
| 201 | struct clk *clk_register_fixed_rate(struct device *dev, const char *name, | 227 | struct clk *clk_register_fixed_rate(struct device *dev, const char *name, |
| 202 | const char *parent_name, unsigned long flags, | 228 | const char *parent_name, unsigned long flags, |
| 203 | unsigned long fixed_rate); | 229 | unsigned long fixed_rate); |
| 230 | struct clk *clk_register_fixed_rate_with_accuracy(struct device *dev, | ||
| 231 | const char *name, const char *parent_name, unsigned long flags, | ||
| 232 | unsigned long fixed_rate, unsigned long fixed_accuracy); | ||
| 204 | 233 | ||
| 205 | void of_fixed_clk_setup(struct device_node *np); | 234 | void of_fixed_clk_setup(struct device_node *np); |
| 206 | 235 | ||
| @@ -433,6 +462,7 @@ struct clk *clk_get_parent_by_index(struct clk *clk, u8 index); | |||
| 433 | unsigned int __clk_get_enable_count(struct clk *clk); | 462 | unsigned int __clk_get_enable_count(struct clk *clk); |
| 434 | unsigned int __clk_get_prepare_count(struct clk *clk); | 463 | unsigned int __clk_get_prepare_count(struct clk *clk); |
| 435 | unsigned long __clk_get_rate(struct clk *clk); | 464 | unsigned long __clk_get_rate(struct clk *clk); |
| 465 | unsigned long __clk_get_accuracy(struct clk *clk); | ||
| 436 | unsigned long __clk_get_flags(struct clk *clk); | 466 | unsigned long __clk_get_flags(struct clk *clk); |
| 437 | bool __clk_is_prepared(struct clk *clk); | 467 | bool __clk_is_prepared(struct clk *clk); |
| 438 | bool __clk_is_enabled(struct clk *clk); | 468 | bool __clk_is_enabled(struct clk *clk); |
diff --git a/include/linux/clk.h b/include/linux/clk.h index 9a6d04524b1a..0dd91148165e 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
| @@ -82,6 +82,23 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb); | |||
| 82 | 82 | ||
| 83 | int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb); | 83 | int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb); |
| 84 | 84 | ||
| 85 | /** | ||
| 86 | * clk_get_accuracy - obtain the clock accuracy in ppb (parts per billion) | ||
| 87 | * for a clock source. | ||
| 88 | * @clk: clock source | ||
| 89 | * | ||
| 90 | * This gets the clock source accuracy expressed in ppb. | ||
| 91 | * A perfect clock returns 0. | ||
| 92 | */ | ||
| 93 | long clk_get_accuracy(struct clk *clk); | ||
| 94 | |||
| 95 | #else | ||
| 96 | |||
| 97 | static inline long clk_get_accuracy(struct clk *clk) | ||
| 98 | { | ||
| 99 | return -ENOTSUPP; | ||
| 100 | } | ||
| 101 | |||
| 85 | #endif | 102 | #endif |
| 86 | 103 | ||
| 87 | /** | 104 | /** |
diff --git a/include/linux/clk/at91_pmc.h b/include/linux/clk/at91_pmc.h new file mode 100644 index 000000000000..a6911ebbd02a --- /dev/null +++ b/include/linux/clk/at91_pmc.h | |||
| @@ -0,0 +1,192 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/clk/at91_pmc.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005 Ivan Kokshaysky | ||
| 5 | * Copyright (C) SAN People | ||
| 6 | * | ||
| 7 | * Power Management Controller (PMC) - System peripherals registers. | ||
| 8 | * Based on AT91RM9200 datasheet revision E. | ||
| 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 as published by | ||
| 12 | * the Free Software Foundation; either version 2 of the License, or | ||
| 13 | * (at your option) any later version. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef AT91_PMC_H | ||
| 17 | #define AT91_PMC_H | ||
| 18 | |||
| 19 | #ifndef __ASSEMBLY__ | ||
| 20 | extern void __iomem *at91_pmc_base; | ||
| 21 | |||
| 22 | #define at91_pmc_read(field) \ | ||
| 23 | __raw_readl(at91_pmc_base + field) | ||
| 24 | |||
| 25 | #define at91_pmc_write(field, value) \ | ||
| 26 | __raw_writel(value, at91_pmc_base + field) | ||
| 27 | #else | ||
| 28 | .extern at91_pmc_base | ||
| 29 | #endif | ||
| 30 | |||
| 31 | #define AT91_PMC_SCER 0x00 /* System Clock Enable Register */ | ||
| 32 | #define AT91_PMC_SCDR 0x04 /* System Clock Disable Register */ | ||
| 33 | |||
| 34 | #define AT91_PMC_SCSR 0x08 /* System Clock Status Register */ | ||
| 35 | #define AT91_PMC_PCK (1 << 0) /* Processor Clock */ | ||
| 36 | #define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */ | ||
| 37 | #define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */ | ||
| 38 | #define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */ | ||
| 39 | #define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */ | ||
| 40 | #define AT91SAM926x_PMC_UDP (1 << 7) /* USB Devcice Port Clock [AT91SAM926x only] */ | ||
| 41 | #define AT91_PMC_PCK0 (1 << 8) /* Programmable Clock 0 */ | ||
| 42 | #define AT91_PMC_PCK1 (1 << 9) /* Programmable Clock 1 */ | ||
| 43 | #define AT91_PMC_PCK2 (1 << 10) /* Programmable Clock 2 */ | ||
| 44 | #define AT91_PMC_PCK3 (1 << 11) /* Programmable Clock 3 */ | ||
| 45 | #define AT91_PMC_PCK4 (1 << 12) /* Programmable Clock 4 [AT572D940HF only] */ | ||
| 46 | #define AT91_PMC_HCK0 (1 << 16) /* AHB Clock (USB host) [AT91SAM9261 only] */ | ||
| 47 | #define AT91_PMC_HCK1 (1 << 17) /* AHB Clock (LCD) [AT91SAM9261 only] */ | ||
| 48 | |||
| 49 | #define AT91_PMC_PCER 0x10 /* Peripheral Clock Enable Register */ | ||
| 50 | #define AT91_PMC_PCDR 0x14 /* Peripheral Clock Disable Register */ | ||
| 51 | #define AT91_PMC_PCSR 0x18 /* Peripheral Clock Status Register */ | ||
| 52 | |||
| 53 | #define AT91_CKGR_UCKR 0x1C /* UTMI Clock Register [some SAM9] */ | ||
| 54 | #define AT91_PMC_UPLLEN (1 << 16) /* UTMI PLL Enable */ | ||
| 55 | #define AT91_PMC_UPLLCOUNT (0xf << 20) /* UTMI PLL Start-up Time */ | ||
| 56 | #define AT91_PMC_BIASEN (1 << 24) /* UTMI BIAS Enable */ | ||
| 57 | #define AT91_PMC_BIASCOUNT (0xf << 28) /* UTMI BIAS Start-up Time */ | ||
| 58 | |||
| 59 | #define AT91_CKGR_MOR 0x20 /* Main Oscillator Register [not on SAM9RL] */ | ||
| 60 | #define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */ | ||
| 61 | #define AT91_PMC_OSCBYPASS (1 << 1) /* Oscillator Bypass */ | ||
| 62 | #define AT91_PMC_MOSCRCEN (1 << 3) /* Main On-Chip RC Oscillator Enable [some SAM9] */ | ||
| 63 | #define AT91_PMC_OSCOUNT (0xff << 8) /* Main Oscillator Start-up Time */ | ||
| 64 | #define AT91_PMC_KEY (0x37 << 16) /* MOR Writing Key */ | ||
| 65 | #define AT91_PMC_MOSCSEL (1 << 24) /* Main Oscillator Selection [some SAM9] */ | ||
| 66 | #define AT91_PMC_CFDEN (1 << 25) /* Clock Failure Detector Enable [some SAM9] */ | ||
| 67 | |||
| 68 | #define AT91_CKGR_MCFR 0x24 /* Main Clock Frequency Register */ | ||
| 69 | #define AT91_PMC_MAINF (0xffff << 0) /* Main Clock Frequency */ | ||
| 70 | #define AT91_PMC_MAINRDY (1 << 16) /* Main Clock Ready */ | ||
| 71 | |||
| 72 | #define AT91_CKGR_PLLAR 0x28 /* PLL A Register */ | ||
| 73 | #define AT91_CKGR_PLLBR 0x2c /* PLL B Register */ | ||
| 74 | #define AT91_PMC_DIV (0xff << 0) /* Divider */ | ||
| 75 | #define AT91_PMC_PLLCOUNT (0x3f << 8) /* PLL Counter */ | ||
| 76 | #define AT91_PMC_OUT (3 << 14) /* PLL Clock Frequency Range */ | ||
| 77 | #define AT91_PMC_MUL (0x7ff << 16) /* PLL Multiplier */ | ||
| 78 | #define AT91_PMC_MUL_GET(n) ((n) >> 16 & 0x7ff) | ||
| 79 | #define AT91_PMC3_MUL (0x7f << 18) /* PLL Multiplier [SAMA5 only] */ | ||
| 80 | #define AT91_PMC3_MUL_GET(n) ((n) >> 18 & 0x7f) | ||
| 81 | #define AT91_PMC_USBDIV (3 << 28) /* USB Divisor (PLLB only) */ | ||
| 82 | #define AT91_PMC_USBDIV_1 (0 << 28) | ||
| 83 | #define AT91_PMC_USBDIV_2 (1 << 28) | ||
| 84 | #define AT91_PMC_USBDIV_4 (2 << 28) | ||
| 85 | #define AT91_PMC_USB96M (1 << 28) /* Divider by 2 Enable (PLLB only) */ | ||
| 86 | |||
| 87 | #define AT91_PMC_MCKR 0x30 /* Master Clock Register */ | ||
| 88 | #define AT91_PMC_CSS (3 << 0) /* Master Clock Selection */ | ||
| 89 | #define AT91_PMC_CSS_SLOW (0 << 0) | ||
| 90 | #define AT91_PMC_CSS_MAIN (1 << 0) | ||
| 91 | #define AT91_PMC_CSS_PLLA (2 << 0) | ||
| 92 | #define AT91_PMC_CSS_PLLB (3 << 0) | ||
| 93 | #define AT91_PMC_CSS_UPLL (3 << 0) /* [some SAM9 only] */ | ||
| 94 | #define PMC_PRES_OFFSET 2 | ||
| 95 | #define AT91_PMC_PRES (7 << PMC_PRES_OFFSET) /* Master Clock Prescaler */ | ||
| 96 | #define AT91_PMC_PRES_1 (0 << PMC_PRES_OFFSET) | ||
| 97 | #define AT91_PMC_PRES_2 (1 << PMC_PRES_OFFSET) | ||
| 98 | #define AT91_PMC_PRES_4 (2 << PMC_PRES_OFFSET) | ||
| 99 | #define AT91_PMC_PRES_8 (3 << PMC_PRES_OFFSET) | ||
| 100 | #define AT91_PMC_PRES_16 (4 << PMC_PRES_OFFSET) | ||
| 101 | #define AT91_PMC_PRES_32 (5 << PMC_PRES_OFFSET) | ||
| 102 | #define AT91_PMC_PRES_64 (6 << PMC_PRES_OFFSET) | ||
| 103 | #define PMC_ALT_PRES_OFFSET 4 | ||
| 104 | #define AT91_PMC_ALT_PRES (7 << PMC_ALT_PRES_OFFSET) /* Master Clock Prescaler [alternate location] */ | ||
| 105 | #define AT91_PMC_ALT_PRES_1 (0 << PMC_ALT_PRES_OFFSET) | ||
| 106 | #define AT91_PMC_ALT_PRES_2 (1 << PMC_ALT_PRES_OFFSET) | ||
| 107 | #define AT91_PMC_ALT_PRES_4 (2 << PMC_ALT_PRES_OFFSET) | ||
| 108 | #define AT91_PMC_ALT_PRES_8 (3 << PMC_ALT_PRES_OFFSET) | ||
| 109 | #define AT91_PMC_ALT_PRES_16 (4 << PMC_ALT_PRES_OFFSET) | ||
| 110 | #define AT91_PMC_ALT_PRES_32 (5 << PMC_ALT_PRES_OFFSET) | ||
| 111 | #define AT91_PMC_ALT_PRES_64 (6 << PMC_ALT_PRES_OFFSET) | ||
| 112 | #define AT91_PMC_MDIV (3 << 8) /* Master Clock Division */ | ||
| 113 | #define AT91RM9200_PMC_MDIV_1 (0 << 8) /* [AT91RM9200 only] */ | ||
| 114 | #define AT91RM9200_PMC_MDIV_2 (1 << 8) | ||
| 115 | #define AT91RM9200_PMC_MDIV_3 (2 << 8) | ||
| 116 | #define AT91RM9200_PMC_MDIV_4 (3 << 8) | ||
| 117 | #define AT91SAM9_PMC_MDIV_1 (0 << 8) /* [SAM9 only] */ | ||
| 118 | #define AT91SAM9_PMC_MDIV_2 (1 << 8) | ||
| 119 | #define AT91SAM9_PMC_MDIV_4 (2 << 8) | ||
| 120 | #define AT91SAM9_PMC_MDIV_6 (3 << 8) /* [some SAM9 only] */ | ||
| 121 | #define AT91SAM9_PMC_MDIV_3 (3 << 8) /* [some SAM9 only] */ | ||
| 122 | #define AT91_PMC_PDIV (1 << 12) /* Processor Clock Division [some SAM9 only] */ | ||
| 123 | #define AT91_PMC_PDIV_1 (0 << 12) | ||
| 124 | #define AT91_PMC_PDIV_2 (1 << 12) | ||
| 125 | #define AT91_PMC_PLLADIV2 (1 << 12) /* PLLA divisor by 2 [some SAM9 only] */ | ||
| 126 | #define AT91_PMC_PLLADIV2_OFF (0 << 12) | ||
| 127 | #define AT91_PMC_PLLADIV2_ON (1 << 12) | ||
| 128 | |||
| 129 | #define AT91_PMC_USB 0x38 /* USB Clock Register [some SAM9 only] */ | ||
| 130 | #define AT91_PMC_USBS (0x1 << 0) /* USB OHCI Input clock selection */ | ||
| 131 | #define AT91_PMC_USBS_PLLA (0 << 0) | ||
| 132 | #define AT91_PMC_USBS_UPLL (1 << 0) | ||
| 133 | #define AT91_PMC_USBS_PLLB (1 << 0) /* [AT91SAMN12 only] */ | ||
| 134 | #define AT91_PMC_OHCIUSBDIV (0xF << 8) /* Divider for USB OHCI Clock */ | ||
| 135 | #define AT91_PMC_OHCIUSBDIV_1 (0x0 << 8) | ||
| 136 | #define AT91_PMC_OHCIUSBDIV_2 (0x1 << 8) | ||
| 137 | |||
| 138 | #define AT91_PMC_SMD 0x3c /* Soft Modem Clock Register [some SAM9 only] */ | ||
| 139 | #define AT91_PMC_SMDS (0x1 << 0) /* SMD input clock selection */ | ||
| 140 | #define AT91_PMC_SMD_DIV (0x1f << 8) /* SMD input clock divider */ | ||
| 141 | #define AT91_PMC_SMDDIV(n) (((n) << 8) & AT91_PMC_SMD_DIV) | ||
| 142 | |||
| 143 | #define AT91_PMC_PCKR(n) (0x40 + ((n) * 4)) /* Programmable Clock 0-N Registers */ | ||
| 144 | #define AT91_PMC_ALT_PCKR_CSS (0x7 << 0) /* Programmable Clock Source Selection [alternate length] */ | ||
| 145 | #define AT91_PMC_CSS_MASTER (4 << 0) /* [some SAM9 only] */ | ||
| 146 | #define AT91_PMC_CSSMCK (0x1 << 8) /* CSS or Master Clock Selection */ | ||
| 147 | #define AT91_PMC_CSSMCK_CSS (0 << 8) | ||
| 148 | #define AT91_PMC_CSSMCK_MCK (1 << 8) | ||
| 149 | |||
| 150 | #define AT91_PMC_IER 0x60 /* Interrupt Enable Register */ | ||
| 151 | #define AT91_PMC_IDR 0x64 /* Interrupt Disable Register */ | ||
| 152 | #define AT91_PMC_SR 0x68 /* Status Register */ | ||
| 153 | #define AT91_PMC_MOSCS (1 << 0) /* MOSCS Flag */ | ||
| 154 | #define AT91_PMC_LOCKA (1 << 1) /* PLLA Lock */ | ||
| 155 | #define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */ | ||
| 156 | #define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */ | ||
| 157 | #define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [some SAM9] */ | ||
| 158 | #define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */ | ||
| 159 | #define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */ | ||
| 160 | #define AT91_PMC_PCK2RDY (1 << 10) /* Programmable Clock 2 */ | ||
| 161 | #define AT91_PMC_PCK3RDY (1 << 11) /* Programmable Clock 3 */ | ||
| 162 | #define AT91_PMC_MOSCSELS (1 << 16) /* Main Oscillator Selection [some SAM9] */ | ||
| 163 | #define AT91_PMC_MOSCRCS (1 << 17) /* Main On-Chip RC [some SAM9] */ | ||
| 164 | #define AT91_PMC_CFDEV (1 << 18) /* Clock Failure Detector Event [some SAM9] */ | ||
| 165 | #define AT91_PMC_IMR 0x6c /* Interrupt Mask Register */ | ||
| 166 | |||
| 167 | #define AT91_PMC_PLLICPR 0x80 /* PLL Charge Pump Current Register */ | ||
| 168 | |||
| 169 | #define AT91_PMC_PROT 0xe4 /* Write Protect Mode Register [some SAM9] */ | ||
| 170 | #define AT91_PMC_WPEN (0x1 << 0) /* Write Protect Enable */ | ||
| 171 | #define AT91_PMC_WPKEY (0xffffff << 8) /* Write Protect Key */ | ||
| 172 | #define AT91_PMC_PROTKEY (0x504d43 << 8) /* Activation Code */ | ||
| 173 | |||
| 174 | #define AT91_PMC_WPSR 0xe8 /* Write Protect Status Register [some SAM9] */ | ||
| 175 | #define AT91_PMC_WPVS (0x1 << 0) /* Write Protect Violation Status */ | ||
| 176 | #define AT91_PMC_WPVSRC (0xffff << 8) /* Write Protect Violation Source */ | ||
| 177 | |||
| 178 | #define AT91_PMC_PCER1 0x100 /* Peripheral Clock Enable Register 1 [SAMA5 only]*/ | ||
| 179 | #define AT91_PMC_PCDR1 0x104 /* Peripheral Clock Enable Register 1 */ | ||
| 180 | #define AT91_PMC_PCSR1 0x108 /* Peripheral Clock Enable Register 1 */ | ||
| 181 | |||
| 182 | #define AT91_PMC_PCR 0x10c /* Peripheral Control Register [some SAM9 and SAMA5] */ | ||
| 183 | #define AT91_PMC_PCR_PID (0x3f << 0) /* Peripheral ID */ | ||
| 184 | #define AT91_PMC_PCR_CMD (0x1 << 12) /* Command (read=0, write=1) */ | ||
| 185 | #define AT91_PMC_PCR_DIV(n) ((n) << 16) /* Divisor Value */ | ||
| 186 | #define AT91_PMC_PCR_DIV0 0x0 /* Peripheral clock is MCK */ | ||
| 187 | #define AT91_PMC_PCR_DIV2 0x1 /* Peripheral clock is MCK/2 */ | ||
| 188 | #define AT91_PMC_PCR_DIV4 0x2 /* Peripheral clock is MCK/4 */ | ||
| 189 | #define AT91_PMC_PCR_DIV8 0x3 /* Peripheral clock is MCK/8 */ | ||
| 190 | #define AT91_PMC_PCR_EN (0x1 << 28) /* Enable */ | ||
| 191 | |||
| 192 | #endif | ||
diff --git a/include/linux/clk/shmobile.h b/include/linux/clk/shmobile.h new file mode 100644 index 000000000000..f9bf080a1123 --- /dev/null +++ b/include/linux/clk/shmobile.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2013 Ideas On Board SPRL | ||
| 3 | * | ||
| 4 | * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.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 | |||
| 12 | #ifndef __LINUX_CLK_SHMOBILE_H_ | ||
| 13 | #define __LINUX_CLK_SHMOBILE_H_ | ||
| 14 | |||
| 15 | #include <linux/types.h> | ||
| 16 | |||
| 17 | void rcar_gen2_clocks_init(u32 mode); | ||
| 18 | |||
| 19 | #endif | ||
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h index 23a0ceee831f..3ca9fca827a2 100644 --- a/include/linux/clk/tegra.h +++ b/include/linux/clk/tegra.h | |||
| @@ -120,13 +120,6 @@ static inline void tegra_cpu_clock_resume(void) | |||
| 120 | } | 120 | } |
| 121 | #endif | 121 | #endif |
| 122 | 122 | ||
| 123 | #ifdef CONFIG_ARCH_TEGRA | ||
| 124 | void tegra_periph_reset_deassert(struct clk *c); | ||
| 125 | void tegra_periph_reset_assert(struct clk *c); | ||
| 126 | #else | ||
| 127 | static inline void tegra_periph_reset_deassert(struct clk *c) {} | ||
| 128 | static inline void tegra_periph_reset_assert(struct clk *c) {} | ||
| 129 | #endif | ||
| 130 | void tegra_clocks_apply_init_table(void); | 123 | void tegra_clocks_apply_init_table(void); |
| 131 | 124 | ||
| 132 | #endif /* __LINUX_CLK_TEGRA_H_ */ | 125 | #endif /* __LINUX_CLK_TEGRA_H_ */ |
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h index a6a6f603103b..94bad77eeb4a 100644 --- a/include/linux/clkdev.h +++ b/include/linux/clkdev.h | |||
| @@ -43,4 +43,9 @@ int clk_add_alias(const char *, const char *, char *, struct device *); | |||
| 43 | int clk_register_clkdev(struct clk *, const char *, const char *, ...); | 43 | int clk_register_clkdev(struct clk *, const char *, const char *, ...); |
| 44 | int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t); | 44 | int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t); |
| 45 | 45 | ||
| 46 | #ifdef CONFIG_COMMON_CLK | ||
| 47 | int __clk_get(struct clk *clk); | ||
| 48 | void __clk_put(struct clk *clk); | ||
| 49 | #endif | ||
| 50 | |||
| 46 | #endif | 51 | #endif |
diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 091d72e70d8a..7e1c76e3cd68 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h | |||
| @@ -62,6 +62,22 @@ static inline bool compaction_deferred(struct zone *zone, int order) | |||
| 62 | return zone->compact_considered < defer_limit; | 62 | return zone->compact_considered < defer_limit; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | /* | ||
| 66 | * Update defer tracking counters after successful compaction of given order, | ||
| 67 | * which means an allocation either succeeded (alloc_success == true) or is | ||
| 68 | * expected to succeed. | ||
| 69 | */ | ||
| 70 | static inline void compaction_defer_reset(struct zone *zone, int order, | ||
| 71 | bool alloc_success) | ||
| 72 | { | ||
| 73 | if (alloc_success) { | ||
| 74 | zone->compact_considered = 0; | ||
| 75 | zone->compact_defer_shift = 0; | ||
| 76 | } | ||
| 77 | if (order >= zone->compact_order_failed) | ||
| 78 | zone->compact_order_failed = order + 1; | ||
| 79 | } | ||
| 80 | |||
| 65 | /* Returns true if restarting compaction after many failures */ | 81 | /* Returns true if restarting compaction after many failures */ |
| 66 | static inline bool compaction_restarting(struct zone *zone, int order) | 82 | static inline bool compaction_restarting(struct zone *zone, int order) |
| 67 | { | 83 | { |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 24545cd90a25..02ae99e8e6d3 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
| @@ -37,6 +37,9 @@ | |||
| 37 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ | 37 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ |
| 38 | (typeof(ptr)) (__ptr + (off)); }) | 38 | (typeof(ptr)) (__ptr + (off)); }) |
| 39 | 39 | ||
| 40 | /* Make the optimizer believe the variable can be manipulated arbitrarily. */ | ||
| 41 | #define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var)) | ||
| 42 | |||
| 40 | #ifdef __CHECKER__ | 43 | #ifdef __CHECKER__ |
| 41 | #define __must_be_array(arr) 0 | 44 | #define __must_be_array(arr) 0 |
| 42 | #else | 45 | #else |
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h index 973ce10c40b6..5529c5239421 100644 --- a/include/linux/compiler-intel.h +++ b/include/linux/compiler-intel.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | */ | 15 | */ |
| 16 | #undef barrier | 16 | #undef barrier |
| 17 | #undef RELOC_HIDE | 17 | #undef RELOC_HIDE |
| 18 | #undef OPTIMIZER_HIDE_VAR | ||
| 18 | 19 | ||
| 19 | #define barrier() __memory_barrier() | 20 | #define barrier() __memory_barrier() |
| 20 | 21 | ||
| @@ -23,13 +24,17 @@ | |||
| 23 | __ptr = (unsigned long) (ptr); \ | 24 | __ptr = (unsigned long) (ptr); \ |
| 24 | (typeof(ptr)) (__ptr + (off)); }) | 25 | (typeof(ptr)) (__ptr + (off)); }) |
| 25 | 26 | ||
| 27 | /* This should act as an optimization barrier on var. | ||
| 28 | * Given that this compiler does not have inline assembly, a compiler barrier | ||
| 29 | * is the best we can do. | ||
| 30 | */ | ||
| 31 | #define OPTIMIZER_HIDE_VAR(var) barrier() | ||
| 32 | |||
| 26 | /* Intel ECC compiler doesn't support __builtin_types_compatible_p() */ | 33 | /* Intel ECC compiler doesn't support __builtin_types_compatible_p() */ |
| 27 | #define __must_be_array(a) 0 | 34 | #define __must_be_array(a) 0 |
| 28 | 35 | ||
| 29 | #endif | 36 | #endif |
| 30 | 37 | ||
| 31 | #define uninitialized_var(x) x | ||
| 32 | |||
| 33 | #ifndef __HAVE_BUILTIN_BSWAP16__ | 38 | #ifndef __HAVE_BUILTIN_BSWAP16__ |
| 34 | /* icc has this, but it's called _bswap16 */ | 39 | /* icc has this, but it's called _bswap16 */ |
| 35 | #define __HAVE_BUILTIN_BSWAP16__ | 40 | #define __HAVE_BUILTIN_BSWAP16__ |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 92669cd182a6..2472740d7ab2 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -170,6 +170,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 170 | (typeof(ptr)) (__ptr + (off)); }) | 170 | (typeof(ptr)) (__ptr + (off)); }) |
| 171 | #endif | 171 | #endif |
| 172 | 172 | ||
| 173 | #ifndef OPTIMIZER_HIDE_VAR | ||
| 174 | #define OPTIMIZER_HIDE_VAR(var) barrier() | ||
| 175 | #endif | ||
| 176 | |||
| 173 | /* Not-quite-unique ID. */ | 177 | /* Not-quite-unique ID. */ |
| 174 | #ifndef __UNIQUE_ID | 178 | #ifndef __UNIQUE_ID |
| 175 | # define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__) | 179 | # define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__) |
| @@ -298,6 +302,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 298 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) | 302 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) |
| 299 | #endif | 303 | #endif |
| 300 | 304 | ||
| 305 | /* Is this type a native word size -- useful for atomic operations */ | ||
| 306 | #ifndef __native_word | ||
| 307 | # define __native_word(t) (sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) | ||
| 308 | #endif | ||
| 309 | |||
| 301 | /* Compile time object size, -1 for unknown */ | 310 | /* Compile time object size, -1 for unknown */ |
| 302 | #ifndef __compiletime_object_size | 311 | #ifndef __compiletime_object_size |
| 303 | # define __compiletime_object_size(obj) -1 | 312 | # define __compiletime_object_size(obj) -1 |
| @@ -337,6 +346,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 337 | #define compiletime_assert(condition, msg) \ | 346 | #define compiletime_assert(condition, msg) \ |
| 338 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) | 347 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) |
| 339 | 348 | ||
| 349 | #define compiletime_assert_atomic_type(t) \ | ||
| 350 | compiletime_assert(__native_word(t), \ | ||
| 351 | "Need native word sized stores/loads for atomicity.") | ||
| 352 | |||
| 340 | /* | 353 | /* |
| 341 | * Prevent the compiler from merging or refetching accesses. The compiler | 354 | * Prevent the compiler from merging or refetching accesses. The compiler |
| 342 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), | 355 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), |
diff --git a/include/linux/component.h b/include/linux/component.h new file mode 100644 index 000000000000..68870182ca1e --- /dev/null +++ b/include/linux/component.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | #ifndef COMPONENT_H | ||
| 2 | #define COMPONENT_H | ||
| 3 | |||
| 4 | struct device; | ||
| 5 | |||
| 6 | struct component_ops { | ||
| 7 | int (*bind)(struct device *, struct device *, void *); | ||
| 8 | void (*unbind)(struct device *, struct device *, void *); | ||
| 9 | }; | ||
| 10 | |||
| 11 | int component_add(struct device *, const struct component_ops *); | ||
| 12 | void component_del(struct device *, const struct component_ops *); | ||
| 13 | |||
| 14 | int component_bind_all(struct device *, void *); | ||
| 15 | void component_unbind_all(struct device *, void *); | ||
| 16 | |||
| 17 | struct master; | ||
| 18 | |||
| 19 | struct component_master_ops { | ||
| 20 | int (*add_components)(struct device *, struct master *); | ||
| 21 | int (*bind)(struct device *); | ||
| 22 | void (*unbind)(struct device *); | ||
| 23 | }; | ||
| 24 | |||
| 25 | int component_master_add(struct device *, const struct component_master_ops *); | ||
| 26 | void component_master_del(struct device *, | ||
| 27 | const struct component_master_ops *); | ||
| 28 | |||
| 29 | int component_master_add_child(struct master *master, | ||
| 30 | int (*compare)(struct device *, void *), void *compare_data); | ||
| 31 | |||
| 32 | #endif | ||
diff --git a/include/linux/container.h b/include/linux/container.h new file mode 100644 index 000000000000..3c03e6fd2035 --- /dev/null +++ b/include/linux/container.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* | ||
| 2 | * Definitions for container bus type. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013, Intel Corporation | ||
| 5 | * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #include <linux/device.h> | ||
| 13 | |||
| 14 | /* drivers/base/power/container.c */ | ||
| 15 | extern struct bus_type container_subsys; | ||
| 16 | |||
| 17 | struct container_dev { | ||
| 18 | struct device dev; | ||
| 19 | int (*offline)(struct container_dev *cdev); | ||
| 20 | }; | ||
| 21 | |||
| 22 | static inline struct container_dev *to_container_dev(struct device *dev) | ||
| 23 | { | ||
| 24 | return container_of(dev, struct container_dev, dev); | ||
| 25 | } | ||
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index 158158704c30..37b81bd51ec0 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h | |||
| @@ -17,13 +17,13 @@ extern void __context_tracking_task_switch(struct task_struct *prev, | |||
| 17 | 17 | ||
| 18 | static inline void user_enter(void) | 18 | static inline void user_enter(void) |
| 19 | { | 19 | { |
| 20 | if (static_key_false(&context_tracking_enabled)) | 20 | if (context_tracking_is_enabled()) |
| 21 | context_tracking_user_enter(); | 21 | context_tracking_user_enter(); |
| 22 | 22 | ||
| 23 | } | 23 | } |
| 24 | static inline void user_exit(void) | 24 | static inline void user_exit(void) |
| 25 | { | 25 | { |
| 26 | if (static_key_false(&context_tracking_enabled)) | 26 | if (context_tracking_is_enabled()) |
| 27 | context_tracking_user_exit(); | 27 | context_tracking_user_exit(); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| @@ -31,7 +31,7 @@ static inline enum ctx_state exception_enter(void) | |||
| 31 | { | 31 | { |
| 32 | enum ctx_state prev_ctx; | 32 | enum ctx_state prev_ctx; |
| 33 | 33 | ||
| 34 | if (!static_key_false(&context_tracking_enabled)) | 34 | if (!context_tracking_is_enabled()) |
| 35 | return 0; | 35 | return 0; |
| 36 | 36 | ||
| 37 | prev_ctx = this_cpu_read(context_tracking.state); | 37 | prev_ctx = this_cpu_read(context_tracking.state); |
| @@ -42,7 +42,7 @@ static inline enum ctx_state exception_enter(void) | |||
| 42 | 42 | ||
| 43 | static inline void exception_exit(enum ctx_state prev_ctx) | 43 | static inline void exception_exit(enum ctx_state prev_ctx) |
| 44 | { | 44 | { |
| 45 | if (static_key_false(&context_tracking_enabled)) { | 45 | if (context_tracking_is_enabled()) { |
| 46 | if (prev_ctx == IN_USER) | 46 | if (prev_ctx == IN_USER) |
| 47 | context_tracking_user_enter(); | 47 | context_tracking_user_enter(); |
| 48 | } | 48 | } |
| @@ -51,7 +51,7 @@ static inline void exception_exit(enum ctx_state prev_ctx) | |||
| 51 | static inline void context_tracking_task_switch(struct task_struct *prev, | 51 | static inline void context_tracking_task_switch(struct task_struct *prev, |
| 52 | struct task_struct *next) | 52 | struct task_struct *next) |
| 53 | { | 53 | { |
| 54 | if (static_key_false(&context_tracking_enabled)) | 54 | if (context_tracking_is_enabled()) |
| 55 | __context_tracking_task_switch(prev, next); | 55 | __context_tracking_task_switch(prev, next); |
| 56 | } | 56 | } |
| 57 | #else | 57 | #else |
diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h index 0f1979d0674f..97a81225d037 100644 --- a/include/linux/context_tracking_state.h +++ b/include/linux/context_tracking_state.h | |||
| @@ -22,15 +22,20 @@ struct context_tracking { | |||
| 22 | extern struct static_key context_tracking_enabled; | 22 | extern struct static_key context_tracking_enabled; |
| 23 | DECLARE_PER_CPU(struct context_tracking, context_tracking); | 23 | DECLARE_PER_CPU(struct context_tracking, context_tracking); |
| 24 | 24 | ||
| 25 | static inline bool context_tracking_in_user(void) | 25 | static inline bool context_tracking_is_enabled(void) |
| 26 | { | 26 | { |
| 27 | return __this_cpu_read(context_tracking.state) == IN_USER; | 27 | return static_key_false(&context_tracking_enabled); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | static inline bool context_tracking_active(void) | 30 | static inline bool context_tracking_cpu_is_enabled(void) |
| 31 | { | 31 | { |
| 32 | return __this_cpu_read(context_tracking.active); | 32 | return __this_cpu_read(context_tracking.active); |
| 33 | } | 33 | } |
| 34 | |||
| 35 | static inline bool context_tracking_in_user(void) | ||
| 36 | { | ||
| 37 | return __this_cpu_read(context_tracking.state) == IN_USER; | ||
| 38 | } | ||
| 34 | #else | 39 | #else |
| 35 | static inline bool context_tracking_in_user(void) { return false; } | 40 | static inline bool context_tracking_in_user(void) { return false; } |
| 36 | static inline bool context_tracking_active(void) { return false; } | 41 | static inline bool context_tracking_active(void) { return false; } |
diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h index a5d52eea8232..c303d383def1 100644 --- a/include/linux/cpu_cooling.h +++ b/include/linux/cpu_cooling.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #ifndef __CPU_COOLING_H__ | 24 | #ifndef __CPU_COOLING_H__ |
| 25 | #define __CPU_COOLING_H__ | 25 | #define __CPU_COOLING_H__ |
| 26 | 26 | ||
| 27 | #include <linux/of.h> | ||
| 27 | #include <linux/thermal.h> | 28 | #include <linux/thermal.h> |
| 28 | #include <linux/cpumask.h> | 29 | #include <linux/cpumask.h> |
| 29 | 30 | ||
| @@ -36,6 +37,24 @@ struct thermal_cooling_device * | |||
| 36 | cpufreq_cooling_register(const struct cpumask *clip_cpus); | 37 | cpufreq_cooling_register(const struct cpumask *clip_cpus); |
| 37 | 38 | ||
| 38 | /** | 39 | /** |
| 40 | * of_cpufreq_cooling_register - create cpufreq cooling device based on DT. | ||
| 41 | * @np: a valid struct device_node to the cooling device device tree node. | ||
| 42 | * @clip_cpus: cpumask of cpus where the frequency constraints will happen | ||
| 43 | */ | ||
| 44 | #ifdef CONFIG_THERMAL_OF | ||
| 45 | struct thermal_cooling_device * | ||
| 46 | of_cpufreq_cooling_register(struct device_node *np, | ||
| 47 | const struct cpumask *clip_cpus); | ||
| 48 | #else | ||
| 49 | static inline struct thermal_cooling_device * | ||
| 50 | of_cpufreq_cooling_register(struct device_node *np, | ||
| 51 | const struct cpumask *clip_cpus) | ||
| 52 | { | ||
| 53 | return NULL; | ||
| 54 | } | ||
| 55 | #endif | ||
| 56 | |||
| 57 | /** | ||
| 39 | * cpufreq_cooling_unregister - function to remove cpufreq cooling device. | 58 | * cpufreq_cooling_unregister - function to remove cpufreq cooling device. |
| 40 | * @cdev: thermal cooling device pointer. | 59 | * @cdev: thermal cooling device pointer. |
| 41 | */ | 60 | */ |
| @@ -48,6 +67,12 @@ cpufreq_cooling_register(const struct cpumask *clip_cpus) | |||
| 48 | { | 67 | { |
| 49 | return NULL; | 68 | return NULL; |
| 50 | } | 69 | } |
| 70 | static inline struct thermal_cooling_device * | ||
| 71 | of_cpufreq_cooling_register(struct device_node *np, | ||
| 72 | const struct cpumask *clip_cpus) | ||
| 73 | { | ||
| 74 | return NULL; | ||
| 75 | } | ||
| 51 | static inline | 76 | static inline |
| 52 | void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) | 77 | void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) |
| 53 | { | 78 | { |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index dc196bbcf227..4d89e0e6f9cc 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #ifndef _LINUX_CPUFREQ_H | 11 | #ifndef _LINUX_CPUFREQ_H |
| 12 | #define _LINUX_CPUFREQ_H | 12 | #define _LINUX_CPUFREQ_H |
| 13 | 13 | ||
| 14 | #include <linux/clk.h> | ||
| 14 | #include <linux/cpumask.h> | 15 | #include <linux/cpumask.h> |
| 15 | #include <linux/completion.h> | 16 | #include <linux/completion.h> |
| 16 | #include <linux/kobject.h> | 17 | #include <linux/kobject.h> |
| @@ -66,6 +67,7 @@ struct cpufreq_policy { | |||
| 66 | unsigned int cpu; /* cpu nr of CPU managing this policy */ | 67 | unsigned int cpu; /* cpu nr of CPU managing this policy */ |
| 67 | unsigned int last_cpu; /* cpu nr of previous CPU that managed | 68 | unsigned int last_cpu; /* cpu nr of previous CPU that managed |
| 68 | * this policy */ | 69 | * this policy */ |
| 70 | struct clk *clk; | ||
| 69 | struct cpufreq_cpuinfo cpuinfo;/* see above */ | 71 | struct cpufreq_cpuinfo cpuinfo;/* see above */ |
| 70 | 72 | ||
| 71 | unsigned int min; /* in kHz */ | 73 | unsigned int min; /* in kHz */ |
| @@ -225,6 +227,11 @@ struct cpufreq_driver { | |||
| 225 | int (*suspend) (struct cpufreq_policy *policy); | 227 | int (*suspend) (struct cpufreq_policy *policy); |
| 226 | int (*resume) (struct cpufreq_policy *policy); | 228 | int (*resume) (struct cpufreq_policy *policy); |
| 227 | struct freq_attr **attr; | 229 | struct freq_attr **attr; |
| 230 | |||
| 231 | /* platform specific boost support code */ | ||
| 232 | bool boost_supported; | ||
| 233 | bool boost_enabled; | ||
| 234 | int (*set_boost) (int state); | ||
| 228 | }; | 235 | }; |
| 229 | 236 | ||
| 230 | /* flags */ | 237 | /* flags */ |
| @@ -252,6 +259,15 @@ struct cpufreq_driver { | |||
| 252 | */ | 259 | */ |
| 253 | #define CPUFREQ_ASYNC_NOTIFICATION (1 << 4) | 260 | #define CPUFREQ_ASYNC_NOTIFICATION (1 << 4) |
| 254 | 261 | ||
| 262 | /* | ||
| 263 | * Set by drivers which want cpufreq core to check if CPU is running at a | ||
| 264 | * frequency present in freq-table exposed by the driver. For these drivers if | ||
| 265 | * CPU is found running at an out of table freq, we will try to set it to a freq | ||
| 266 | * from the table. And if that fails, we will stop further boot process by | ||
| 267 | * issuing a BUG_ON(). | ||
| 268 | */ | ||
| 269 | #define CPUFREQ_NEED_INITIAL_FREQ_CHECK (1 << 5) | ||
| 270 | |||
| 255 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); | 271 | int cpufreq_register_driver(struct cpufreq_driver *driver_data); |
| 256 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); | 272 | int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); |
| 257 | 273 | ||
| @@ -299,6 +315,8 @@ cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy) | |||
| 299 | #define CPUFREQ_NOTIFY (2) | 315 | #define CPUFREQ_NOTIFY (2) |
| 300 | #define CPUFREQ_START (3) | 316 | #define CPUFREQ_START (3) |
| 301 | #define CPUFREQ_UPDATE_POLICY_CPU (4) | 317 | #define CPUFREQ_UPDATE_POLICY_CPU (4) |
| 318 | #define CPUFREQ_CREATE_POLICY (5) | ||
| 319 | #define CPUFREQ_REMOVE_POLICY (6) | ||
| 302 | 320 | ||
| 303 | #ifdef CONFIG_CPU_FREQ | 321 | #ifdef CONFIG_CPU_FREQ |
| 304 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); | 322 | int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); |
| @@ -306,6 +324,8 @@ int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list); | |||
| 306 | 324 | ||
| 307 | void cpufreq_notify_transition(struct cpufreq_policy *policy, | 325 | void cpufreq_notify_transition(struct cpufreq_policy *policy, |
| 308 | struct cpufreq_freqs *freqs, unsigned int state); | 326 | struct cpufreq_freqs *freqs, unsigned int state); |
| 327 | void cpufreq_notify_post_transition(struct cpufreq_policy *policy, | ||
| 328 | struct cpufreq_freqs *freqs, int transition_failed); | ||
| 309 | 329 | ||
| 310 | #else /* CONFIG_CPU_FREQ */ | 330 | #else /* CONFIG_CPU_FREQ */ |
| 311 | static inline int cpufreq_register_notifier(struct notifier_block *nb, | 331 | static inline int cpufreq_register_notifier(struct notifier_block *nb, |
| @@ -420,6 +440,7 @@ extern struct cpufreq_governor cpufreq_gov_conservative; | |||
| 420 | 440 | ||
| 421 | #define CPUFREQ_ENTRY_INVALID ~0 | 441 | #define CPUFREQ_ENTRY_INVALID ~0 |
| 422 | #define CPUFREQ_TABLE_END ~1 | 442 | #define CPUFREQ_TABLE_END ~1 |
| 443 | #define CPUFREQ_BOOST_FREQ ~2 | ||
| 423 | 444 | ||
| 424 | struct cpufreq_frequency_table { | 445 | struct cpufreq_frequency_table { |
| 425 | unsigned int driver_data; /* driver specific data, not used by core */ | 446 | unsigned int driver_data; /* driver specific data, not used by core */ |
| @@ -439,10 +460,30 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, | |||
| 439 | unsigned int target_freq, | 460 | unsigned int target_freq, |
| 440 | unsigned int relation, | 461 | unsigned int relation, |
| 441 | unsigned int *index); | 462 | unsigned int *index); |
| 463 | int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy, | ||
| 464 | unsigned int freq); | ||
| 442 | 465 | ||
| 443 | void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); | 466 | void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); |
| 444 | ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); | 467 | ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); |
| 445 | 468 | ||
| 469 | #ifdef CONFIG_CPU_FREQ | ||
| 470 | int cpufreq_boost_trigger_state(int state); | ||
| 471 | int cpufreq_boost_supported(void); | ||
| 472 | int cpufreq_boost_enabled(void); | ||
| 473 | #else | ||
| 474 | static inline int cpufreq_boost_trigger_state(int state) | ||
| 475 | { | ||
| 476 | return 0; | ||
| 477 | } | ||
| 478 | static inline int cpufreq_boost_supported(void) | ||
| 479 | { | ||
| 480 | return 0; | ||
| 481 | } | ||
| 482 | static inline int cpufreq_boost_enabled(void) | ||
| 483 | { | ||
| 484 | return 0; | ||
| 485 | } | ||
| 486 | #endif | ||
| 446 | /* the following funtion is for cpufreq core use only */ | 487 | /* the following funtion is for cpufreq core use only */ |
| 447 | struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); | 488 | struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); |
| 448 | 489 | ||
| @@ -455,6 +496,7 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu); | |||
| 455 | int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, | 496 | int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, |
| 456 | struct cpufreq_frequency_table *table); | 497 | struct cpufreq_frequency_table *table); |
| 457 | 498 | ||
| 499 | unsigned int cpufreq_generic_get(unsigned int cpu); | ||
| 458 | int cpufreq_generic_init(struct cpufreq_policy *policy, | 500 | int cpufreq_generic_init(struct cpufreq_policy *policy, |
| 459 | struct cpufreq_frequency_table *table, | 501 | struct cpufreq_frequency_table *table, |
| 460 | unsigned int transition_latency); | 502 | unsigned int transition_latency); |
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index fe68a5a98583..7032518f8542 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | #include <linux/proc_fs.h> | 6 | #include <linux/proc_fs.h> |
| 7 | #include <linux/elf.h> | 7 | #include <linux/elf.h> |
| 8 | 8 | ||
| 9 | #include <asm/pgtable.h> /* for pgprot_t */ | ||
| 10 | |||
| 9 | #define ELFCORE_ADDR_MAX (-1ULL) | 11 | #define ELFCORE_ADDR_MAX (-1ULL) |
| 10 | #define ELFCORE_ADDR_ERR (-2ULL) | 12 | #define ELFCORE_ADDR_ERR (-2ULL) |
| 11 | 13 | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 57e87e749a48..bf72e9ac6de0 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -29,8 +29,10 @@ struct vfsmount; | |||
| 29 | /* The hash is always the low bits of hash_len */ | 29 | /* The hash is always the low bits of hash_len */ |
| 30 | #ifdef __LITTLE_ENDIAN | 30 | #ifdef __LITTLE_ENDIAN |
| 31 | #define HASH_LEN_DECLARE u32 hash; u32 len; | 31 | #define HASH_LEN_DECLARE u32 hash; u32 len; |
| 32 | #define bytemask_from_count(cnt) (~(~0ul << (cnt)*8)) | ||
| 32 | #else | 33 | #else |
| 33 | #define HASH_LEN_DECLARE u32 len; u32 hash; | 34 | #define HASH_LEN_DECLARE u32 len; u32 hash; |
| 35 | #define bytemask_from_count(cnt) (~(~0ul >> (cnt)*8)) | ||
| 34 | #endif | 36 | #endif |
| 35 | 37 | ||
| 36 | /* | 38 | /* |
diff --git a/include/linux/dma-debug.h b/include/linux/dma-debug.h index fc0e34ce038f..fe8cb610deac 100644 --- a/include/linux/dma-debug.h +++ b/include/linux/dma-debug.h | |||
| @@ -85,6 +85,8 @@ extern void debug_dma_sync_sg_for_device(struct device *dev, | |||
| 85 | 85 | ||
| 86 | extern void debug_dma_dump_mappings(struct device *dev); | 86 | extern void debug_dma_dump_mappings(struct device *dev); |
| 87 | 87 | ||
| 88 | extern void debug_dma_assert_idle(struct page *page); | ||
| 89 | |||
| 88 | #else /* CONFIG_DMA_API_DEBUG */ | 90 | #else /* CONFIG_DMA_API_DEBUG */ |
| 89 | 91 | ||
| 90 | static inline void dma_debug_add_bus(struct bus_type *bus) | 92 | static inline void dma_debug_add_bus(struct bus_type *bus) |
| @@ -183,6 +185,10 @@ static inline void debug_dma_dump_mappings(struct device *dev) | |||
| 183 | { | 185 | { |
| 184 | } | 186 | } |
| 185 | 187 | ||
| 188 | static inline void debug_dma_assert_idle(struct page *page) | ||
| 189 | { | ||
| 190 | } | ||
| 191 | |||
| 186 | #endif /* CONFIG_DMA_API_DEBUG */ | 192 | #endif /* CONFIG_DMA_API_DEBUG */ |
| 187 | 193 | ||
| 188 | #endif /* __DMA_DEBUG_H */ | 194 | #endif /* __DMA_DEBUG_H */ |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 41cf0c399288..6fd9390ccf91 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #define LINUX_DMAENGINE_H | 22 | #define LINUX_DMAENGINE_H |
| 23 | 23 | ||
| 24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
| 25 | #include <linux/err.h> | ||
| 25 | #include <linux/uio.h> | 26 | #include <linux/uio.h> |
| 26 | #include <linux/bug.h> | 27 | #include <linux/bug.h> |
| 27 | #include <linux/scatterlist.h> | 28 | #include <linux/scatterlist.h> |
| @@ -363,6 +364,32 @@ struct dma_slave_config { | |||
| 363 | unsigned int slave_id; | 364 | unsigned int slave_id; |
| 364 | }; | 365 | }; |
| 365 | 366 | ||
| 367 | /** | ||
| 368 | * enum dma_residue_granularity - Granularity of the reported transfer residue | ||
| 369 | * @DMA_RESIDUE_GRANULARITY_DESCRIPTOR: Residue reporting is not support. The | ||
| 370 | * DMA channel is only able to tell whether a descriptor has been completed or | ||
| 371 | * not, which means residue reporting is not supported by this channel. The | ||
| 372 | * residue field of the dma_tx_state field will always be 0. | ||
| 373 | * @DMA_RESIDUE_GRANULARITY_SEGMENT: Residue is updated after each successfully | ||
| 374 | * completed segment of the transfer (For cyclic transfers this is after each | ||
| 375 | * period). This is typically implemented by having the hardware generate an | ||
| 376 | * interrupt after each transferred segment and then the drivers updates the | ||
| 377 | * outstanding residue by the size of the segment. Another possibility is if | ||
| 378 | * the hardware supports scatter-gather and the segment descriptor has a field | ||
| 379 | * which gets set after the segment has been completed. The driver then counts | ||
| 380 | * the number of segments without the flag set to compute the residue. | ||
| 381 | * @DMA_RESIDUE_GRANULARITY_BURST: Residue is updated after each transferred | ||
| 382 | * burst. This is typically only supported if the hardware has a progress | ||
| 383 | * register of some sort (E.g. a register with the current read/write address | ||
| 384 | * or a register with the amount of bursts/beats/bytes that have been | ||
| 385 | * transferred or still need to be transferred). | ||
| 386 | */ | ||
| 387 | enum dma_residue_granularity { | ||
| 388 | DMA_RESIDUE_GRANULARITY_DESCRIPTOR = 0, | ||
| 389 | DMA_RESIDUE_GRANULARITY_SEGMENT = 1, | ||
| 390 | DMA_RESIDUE_GRANULARITY_BURST = 2, | ||
| 391 | }; | ||
| 392 | |||
| 366 | /* struct dma_slave_caps - expose capabilities of a slave channel only | 393 | /* struct dma_slave_caps - expose capabilities of a slave channel only |
| 367 | * | 394 | * |
| 368 | * @src_addr_widths: bit mask of src addr widths the channel supports | 395 | * @src_addr_widths: bit mask of src addr widths the channel supports |
| @@ -373,6 +400,7 @@ struct dma_slave_config { | |||
| 373 | * should be checked by controller as well | 400 | * should be checked by controller as well |
| 374 | * @cmd_pause: true, if pause and thereby resume is supported | 401 | * @cmd_pause: true, if pause and thereby resume is supported |
| 375 | * @cmd_terminate: true, if terminate cmd is supported | 402 | * @cmd_terminate: true, if terminate cmd is supported |
| 403 | * @residue_granularity: granularity of the reported transfer residue | ||
| 376 | */ | 404 | */ |
| 377 | struct dma_slave_caps { | 405 | struct dma_slave_caps { |
| 378 | u32 src_addr_widths; | 406 | u32 src_addr_widths; |
| @@ -380,6 +408,7 @@ struct dma_slave_caps { | |||
| 380 | u32 directions; | 408 | u32 directions; |
| 381 | bool cmd_pause; | 409 | bool cmd_pause; |
| 382 | bool cmd_terminate; | 410 | bool cmd_terminate; |
| 411 | enum dma_residue_granularity residue_granularity; | ||
| 383 | }; | 412 | }; |
| 384 | 413 | ||
| 385 | static inline const char *dma_chan_name(struct dma_chan *chan) | 414 | static inline const char *dma_chan_name(struct dma_chan *chan) |
| @@ -1040,6 +1069,8 @@ enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); | |||
| 1040 | void dma_issue_pending_all(void); | 1069 | void dma_issue_pending_all(void); |
| 1041 | struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, | 1070 | struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, |
| 1042 | dma_filter_fn fn, void *fn_param); | 1071 | dma_filter_fn fn, void *fn_param); |
| 1072 | struct dma_chan *dma_request_slave_channel_reason(struct device *dev, | ||
| 1073 | const char *name); | ||
| 1043 | struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); | 1074 | struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); |
| 1044 | void dma_release_channel(struct dma_chan *chan); | 1075 | void dma_release_channel(struct dma_chan *chan); |
| 1045 | #else | 1076 | #else |
| @@ -1063,6 +1094,11 @@ static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, | |||
| 1063 | { | 1094 | { |
| 1064 | return NULL; | 1095 | return NULL; |
| 1065 | } | 1096 | } |
| 1097 | static inline struct dma_chan *dma_request_slave_channel_reason( | ||
| 1098 | struct device *dev, const char *name) | ||
| 1099 | { | ||
| 1100 | return ERR_PTR(-ENODEV); | ||
| 1101 | } | ||
| 1066 | static inline struct dma_chan *dma_request_slave_channel(struct device *dev, | 1102 | static inline struct dma_chan *dma_request_slave_channel(struct device *dev, |
| 1067 | const char *name) | 1103 | const char *name) |
| 1068 | { | 1104 | { |
| @@ -1079,6 +1115,7 @@ int dma_async_device_register(struct dma_device *device); | |||
| 1079 | void dma_async_device_unregister(struct dma_device *device); | 1115 | void dma_async_device_unregister(struct dma_device *device); |
| 1080 | void dma_run_dependencies(struct dma_async_tx_descriptor *tx); | 1116 | void dma_run_dependencies(struct dma_async_tx_descriptor *tx); |
| 1081 | struct dma_chan *dma_get_slave_channel(struct dma_chan *chan); | 1117 | struct dma_chan *dma_get_slave_channel(struct dma_chan *chan); |
| 1118 | struct dma_chan *dma_get_any_slave_channel(struct dma_device *device); | ||
| 1082 | struct dma_chan *net_dma_find_channel(void); | 1119 | struct dma_chan *net_dma_find_channel(void); |
| 1083 | #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) | 1120 | #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) |
| 1084 | #define dma_request_slave_channel_compat(mask, x, y, dev, name) \ | 1121 | #define dma_request_slave_channel_compat(mask, x, y, dev, name) \ |
diff --git a/include/linux/edac.h b/include/linux/edac.h index dbdffe8d4469..8e6c20af11a2 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
| @@ -35,6 +35,34 @@ extern void edac_atomic_assert_error(void); | |||
| 35 | extern struct bus_type *edac_get_sysfs_subsys(void); | 35 | extern struct bus_type *edac_get_sysfs_subsys(void); |
| 36 | extern void edac_put_sysfs_subsys(void); | 36 | extern void edac_put_sysfs_subsys(void); |
| 37 | 37 | ||
| 38 | enum { | ||
| 39 | EDAC_REPORTING_ENABLED, | ||
| 40 | EDAC_REPORTING_DISABLED, | ||
| 41 | EDAC_REPORTING_FORCE | ||
| 42 | }; | ||
| 43 | |||
| 44 | extern int edac_report_status; | ||
| 45 | #ifdef CONFIG_EDAC | ||
| 46 | static inline int get_edac_report_status(void) | ||
| 47 | { | ||
| 48 | return edac_report_status; | ||
| 49 | } | ||
| 50 | |||
| 51 | static inline void set_edac_report_status(int new) | ||
| 52 | { | ||
| 53 | edac_report_status = new; | ||
| 54 | } | ||
| 55 | #else | ||
| 56 | static inline int get_edac_report_status(void) | ||
| 57 | { | ||
| 58 | return EDAC_REPORTING_DISABLED; | ||
| 59 | } | ||
| 60 | |||
| 61 | static inline void set_edac_report_status(int new) | ||
| 62 | { | ||
| 63 | } | ||
| 64 | #endif | ||
| 65 | |||
| 38 | static inline void opstate_init(void) | 66 | static inline void opstate_init(void) |
| 39 | { | 67 | { |
| 40 | switch (edac_op_state) { | 68 | switch (edac_op_state) { |
diff --git a/include/linux/efi.h b/include/linux/efi.h index bc5687d0f315..0a819e7a60c9 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -556,6 +556,9 @@ extern struct efi { | |||
| 556 | unsigned long hcdp; /* HCDP table */ | 556 | unsigned long hcdp; /* HCDP table */ |
| 557 | unsigned long uga; /* UGA table */ | 557 | unsigned long uga; /* UGA table */ |
| 558 | unsigned long uv_systab; /* UV system table */ | 558 | unsigned long uv_systab; /* UV system table */ |
| 559 | unsigned long fw_vendor; /* fw_vendor */ | ||
| 560 | unsigned long runtime; /* runtime table */ | ||
| 561 | unsigned long config_table; /* config tables */ | ||
| 559 | efi_get_time_t *get_time; | 562 | efi_get_time_t *get_time; |
| 560 | efi_set_time_t *set_time; | 563 | efi_set_time_t *set_time; |
| 561 | efi_get_wakeup_time_t *get_wakeup_time; | 564 | efi_get_wakeup_time_t *get_wakeup_time; |
| @@ -653,6 +656,7 @@ extern int __init efi_setup_pcdp_console(char *); | |||
| 653 | #define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */ | 656 | #define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */ |
| 654 | #define EFI_MEMMAP 4 /* Can we use EFI memory map? */ | 657 | #define EFI_MEMMAP 4 /* Can we use EFI memory map? */ |
| 655 | #define EFI_64BIT 5 /* Is the firmware 64-bit? */ | 658 | #define EFI_64BIT 5 /* Is the firmware 64-bit? */ |
| 659 | #define EFI_ARCH_1 6 /* First arch-specific bit */ | ||
| 656 | 660 | ||
| 657 | #ifdef CONFIG_EFI | 661 | #ifdef CONFIG_EFI |
| 658 | # ifdef CONFIG_X86 | 662 | # ifdef CONFIG_X86 |
| @@ -801,6 +805,8 @@ struct efivar_entry { | |||
| 801 | struct efi_variable var; | 805 | struct efi_variable var; |
| 802 | struct list_head list; | 806 | struct list_head list; |
| 803 | struct kobject kobj; | 807 | struct kobject kobj; |
| 808 | bool scanning; | ||
| 809 | bool deleting; | ||
| 804 | }; | 810 | }; |
| 805 | 811 | ||
| 806 | 812 | ||
| @@ -866,6 +872,21 @@ void efivar_run_worker(void); | |||
| 866 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) | 872 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) |
| 867 | int efivars_sysfs_init(void); | 873 | int efivars_sysfs_init(void); |
| 868 | 874 | ||
| 875 | #define EFIVARS_DATA_SIZE_MAX 1024 | ||
| 876 | |||
| 869 | #endif /* CONFIG_EFI_VARS */ | 877 | #endif /* CONFIG_EFI_VARS */ |
| 870 | 878 | ||
| 879 | #ifdef CONFIG_EFI_RUNTIME_MAP | ||
| 880 | int efi_runtime_map_init(struct kobject *); | ||
| 881 | void efi_runtime_map_setup(void *, int, u32); | ||
| 882 | #else | ||
| 883 | static inline int efi_runtime_map_init(struct kobject *kobj) | ||
| 884 | { | ||
| 885 | return 0; | ||
| 886 | } | ||
| 887 | |||
| 888 | static inline void | ||
| 889 | efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size) {} | ||
| 890 | #endif | ||
| 891 | |||
| 871 | #endif /* _LINUX_EFI_H */ | 892 | #endif /* _LINUX_EFI_H */ |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index fc4a9aa7dd82..9c5529dc6d07 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/netdevice.h> | 26 | #include <linux/netdevice.h> |
| 27 | #include <linux/random.h> | 27 | #include <linux/random.h> |
| 28 | #include <asm/unaligned.h> | 28 | #include <asm/unaligned.h> |
| 29 | #include <asm/bitsperlong.h> | ||
| 29 | 30 | ||
| 30 | #ifdef __KERNEL__ | 31 | #ifdef __KERNEL__ |
| 31 | __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev); | 32 | __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev); |
| @@ -60,6 +61,8 @@ static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = | |||
| 60 | * | 61 | * |
| 61 | * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per | 62 | * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per |
| 62 | * IEEE 802.1Q 8.6.3 Frame filtering. | 63 | * IEEE 802.1Q 8.6.3 Frame filtering. |
| 64 | * | ||
| 65 | * Please note: addr must be aligned to u16. | ||
| 63 | */ | 66 | */ |
| 64 | static inline bool is_link_local_ether_addr(const u8 *addr) | 67 | static inline bool is_link_local_ether_addr(const u8 *addr) |
| 65 | { | 68 | { |
| @@ -67,7 +70,12 @@ static inline bool is_link_local_ether_addr(const u8 *addr) | |||
| 67 | static const __be16 *b = (const __be16 *)eth_reserved_addr_base; | 70 | static const __be16 *b = (const __be16 *)eth_reserved_addr_base; |
| 68 | static const __be16 m = cpu_to_be16(0xfff0); | 71 | static const __be16 m = cpu_to_be16(0xfff0); |
| 69 | 72 | ||
| 73 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) | ||
| 74 | return (((*(const u32 *)addr) ^ (*(const u32 *)b)) | | ||
| 75 | ((a[2] ^ b[2]) & m)) == 0; | ||
| 76 | #else | ||
| 70 | return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0; | 77 | return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0; |
| 78 | #endif | ||
| 71 | } | 79 | } |
| 72 | 80 | ||
| 73 | /** | 81 | /** |
| @@ -75,10 +83,18 @@ static inline bool is_link_local_ether_addr(const u8 *addr) | |||
| 75 | * @addr: Pointer to a six-byte array containing the Ethernet address | 83 | * @addr: Pointer to a six-byte array containing the Ethernet address |
| 76 | * | 84 | * |
| 77 | * Return true if the address is all zeroes. | 85 | * Return true if the address is all zeroes. |
| 86 | * | ||
| 87 | * Please note: addr must be aligned to u16. | ||
| 78 | */ | 88 | */ |
| 79 | static inline bool is_zero_ether_addr(const u8 *addr) | 89 | static inline bool is_zero_ether_addr(const u8 *addr) |
| 80 | { | 90 | { |
| 81 | return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]); | 91 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) |
| 92 | return ((*(const u32 *)addr) | (*(const u16 *)(addr + 4))) == 0; | ||
| 93 | #else | ||
| 94 | return (*(const u16 *)(addr + 0) | | ||
| 95 | *(const u16 *)(addr + 2) | | ||
| 96 | *(const u16 *)(addr + 4)) == 0; | ||
| 97 | #endif | ||
| 82 | } | 98 | } |
| 83 | 99 | ||
| 84 | /** | 100 | /** |
| @@ -109,10 +125,14 @@ static inline bool is_local_ether_addr(const u8 *addr) | |||
| 109 | * @addr: Pointer to a six-byte array containing the Ethernet address | 125 | * @addr: Pointer to a six-byte array containing the Ethernet address |
| 110 | * | 126 | * |
| 111 | * Return true if the address is the broadcast address. | 127 | * Return true if the address is the broadcast address. |
| 128 | * | ||
| 129 | * Please note: addr must be aligned to u16. | ||
| 112 | */ | 130 | */ |
| 113 | static inline bool is_broadcast_ether_addr(const u8 *addr) | 131 | static inline bool is_broadcast_ether_addr(const u8 *addr) |
| 114 | { | 132 | { |
| 115 | return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == 0xff; | 133 | return (*(const u16 *)(addr + 0) & |
| 134 | *(const u16 *)(addr + 2) & | ||
| 135 | *(const u16 *)(addr + 4)) == 0xffff; | ||
| 116 | } | 136 | } |
| 117 | 137 | ||
| 118 | /** | 138 | /** |
| @@ -134,6 +154,8 @@ static inline bool is_unicast_ether_addr(const u8 *addr) | |||
| 134 | * a multicast address, and is not FF:FF:FF:FF:FF:FF. | 154 | * a multicast address, and is not FF:FF:FF:FF:FF:FF. |
| 135 | * | 155 | * |
| 136 | * Return true if the address is valid. | 156 | * Return true if the address is valid. |
| 157 | * | ||
| 158 | * Please note: addr must be aligned to u16. | ||
| 137 | */ | 159 | */ |
| 138 | static inline bool is_valid_ether_addr(const u8 *addr) | 160 | static inline bool is_valid_ether_addr(const u8 *addr) |
| 139 | { | 161 | { |
| @@ -196,6 +218,28 @@ static inline void eth_hw_addr_random(struct net_device *dev) | |||
| 196 | } | 218 | } |
| 197 | 219 | ||
| 198 | /** | 220 | /** |
| 221 | * ether_addr_copy - Copy an Ethernet address | ||
| 222 | * @dst: Pointer to a six-byte array Ethernet address destination | ||
| 223 | * @src: Pointer to a six-byte array Ethernet address source | ||
| 224 | * | ||
| 225 | * Please note: dst & src must both be aligned to u16. | ||
| 226 | */ | ||
| 227 | static inline void ether_addr_copy(u8 *dst, const u8 *src) | ||
| 228 | { | ||
| 229 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) | ||
| 230 | *(u32 *)dst = *(const u32 *)src; | ||
| 231 | *(u16 *)(dst + 4) = *(const u16 *)(src + 4); | ||
| 232 | #else | ||
| 233 | u16 *a = (u16 *)dst; | ||
| 234 | const u16 *b = (const u16 *)src; | ||
| 235 | |||
| 236 | a[0] = b[0]; | ||
| 237 | a[1] = b[1]; | ||
| 238 | a[2] = b[2]; | ||
| 239 | #endif | ||
| 240 | } | ||
| 241 | |||
| 242 | /** | ||
| 199 | * eth_hw_addr_inherit - Copy dev_addr from another net_device | 243 | * eth_hw_addr_inherit - Copy dev_addr from another net_device |
| 200 | * @dst: pointer to net_device to copy dev_addr to | 244 | * @dst: pointer to net_device to copy dev_addr to |
| 201 | * @src: pointer to net_device to copy dev_addr from | 245 | * @src: pointer to net_device to copy dev_addr from |
| @@ -207,24 +251,7 @@ static inline void eth_hw_addr_inherit(struct net_device *dst, | |||
| 207 | struct net_device *src) | 251 | struct net_device *src) |
| 208 | { | 252 | { |
| 209 | dst->addr_assign_type = src->addr_assign_type; | 253 | dst->addr_assign_type = src->addr_assign_type; |
| 210 | memcpy(dst->dev_addr, src->dev_addr, ETH_ALEN); | 254 | ether_addr_copy(dst->dev_addr, src->dev_addr); |
| 211 | } | ||
| 212 | |||
| 213 | /** | ||
| 214 | * compare_ether_addr - Compare two Ethernet addresses | ||
| 215 | * @addr1: Pointer to a six-byte array containing the Ethernet address | ||
| 216 | * @addr2: Pointer other six-byte array containing the Ethernet address | ||
| 217 | * | ||
| 218 | * Compare two Ethernet addresses, returns 0 if equal, non-zero otherwise. | ||
| 219 | * Unlike memcmp(), it doesn't return a value suitable for sorting. | ||
| 220 | */ | ||
| 221 | static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2) | ||
| 222 | { | ||
| 223 | const u16 *a = (const u16 *) addr1; | ||
| 224 | const u16 *b = (const u16 *) addr2; | ||
| 225 | |||
| 226 | BUILD_BUG_ON(ETH_ALEN != 6); | ||
| 227 | return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0; | ||
| 228 | } | 255 | } |
| 229 | 256 | ||
| 230 | /** | 257 | /** |
| @@ -233,18 +260,21 @@ static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2) | |||
| 233 | * @addr2: Pointer other six-byte array containing the Ethernet address | 260 | * @addr2: Pointer other six-byte array containing the Ethernet address |
| 234 | * | 261 | * |
| 235 | * Compare two Ethernet addresses, returns true if equal | 262 | * Compare two Ethernet addresses, returns true if equal |
| 263 | * | ||
| 264 | * Please note: addr1 & addr2 must both be aligned to u16. | ||
| 236 | */ | 265 | */ |
| 237 | static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) | 266 | static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) |
| 238 | { | 267 | { |
| 239 | return !compare_ether_addr(addr1, addr2); | 268 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) |
| 240 | } | 269 | u32 fold = ((*(const u32 *)addr1) ^ (*(const u32 *)addr2)) | |
| 270 | ((*(const u16 *)(addr1 + 4)) ^ (*(const u16 *)(addr2 + 4))); | ||
| 241 | 271 | ||
| 242 | static inline unsigned long zap_last_2bytes(unsigned long value) | 272 | return fold == 0; |
| 243 | { | ||
| 244 | #ifdef __BIG_ENDIAN | ||
| 245 | return value >> 16; | ||
| 246 | #else | 273 | #else |
| 247 | return value << 16; | 274 | const u16 *a = (const u16 *)addr1; |
| 275 | const u16 *b = (const u16 *)addr2; | ||
| 276 | |||
| 277 | return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) == 0; | ||
| 248 | #endif | 278 | #endif |
| 249 | } | 279 | } |
| 250 | 280 | ||
| @@ -265,22 +295,38 @@ static inline unsigned long zap_last_2bytes(unsigned long value) | |||
| 265 | static inline bool ether_addr_equal_64bits(const u8 addr1[6+2], | 295 | static inline bool ether_addr_equal_64bits(const u8 addr1[6+2], |
| 266 | const u8 addr2[6+2]) | 296 | const u8 addr2[6+2]) |
| 267 | { | 297 | { |
| 268 | #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS | 298 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 |
| 269 | unsigned long fold = ((*(unsigned long *)addr1) ^ | 299 | u64 fold = (*(const u64 *)addr1) ^ (*(const u64 *)addr2); |
| 270 | (*(unsigned long *)addr2)); | ||
| 271 | |||
| 272 | if (sizeof(fold) == 8) | ||
| 273 | return zap_last_2bytes(fold) == 0; | ||
| 274 | 300 | ||
| 275 | fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^ | 301 | #ifdef __BIG_ENDIAN |
| 276 | (*(unsigned long *)(addr2 + 4))); | 302 | return (fold >> 16) == 0; |
| 277 | return fold == 0; | 303 | #else |
| 304 | return (fold << 16) == 0; | ||
| 305 | #endif | ||
| 278 | #else | 306 | #else |
| 279 | return ether_addr_equal(addr1, addr2); | 307 | return ether_addr_equal(addr1, addr2); |
| 280 | #endif | 308 | #endif |
| 281 | } | 309 | } |
| 282 | 310 | ||
| 283 | /** | 311 | /** |
| 312 | * ether_addr_equal_unaligned - Compare two not u16 aligned Ethernet addresses | ||
| 313 | * @addr1: Pointer to a six-byte array containing the Ethernet address | ||
| 314 | * @addr2: Pointer other six-byte array containing the Ethernet address | ||
| 315 | * | ||
| 316 | * Compare two Ethernet addresses, returns true if equal | ||
| 317 | * | ||
| 318 | * Please note: Use only when any Ethernet address may not be u16 aligned. | ||
| 319 | */ | ||
| 320 | static inline bool ether_addr_equal_unaligned(const u8 *addr1, const u8 *addr2) | ||
| 321 | { | ||
| 322 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) | ||
| 323 | return ether_addr_equal(addr1, addr2); | ||
| 324 | #else | ||
| 325 | return memcmp(addr1, addr2, ETH_ALEN) == 0; | ||
| 326 | #endif | ||
| 327 | } | ||
| 328 | |||
| 329 | /** | ||
| 284 | * is_etherdev_addr - Tell if given Ethernet address belongs to the device. | 330 | * is_etherdev_addr - Tell if given Ethernet address belongs to the device. |
| 285 | * @dev: Pointer to a device structure | 331 | * @dev: Pointer to a device structure |
| 286 | * @addr: Pointer to a six-byte array containing the Ethernet address | 332 | * @addr: Pointer to a six-byte array containing the Ethernet address |
diff --git a/include/linux/export.h b/include/linux/export.h index 3f2793d51899..96e45ea463e7 100644 --- a/include/linux/export.h +++ b/include/linux/export.h | |||
| @@ -59,6 +59,7 @@ extern struct module __this_module; | |||
| 59 | static const char __kstrtab_##sym[] \ | 59 | static const char __kstrtab_##sym[] \ |
| 60 | __attribute__((section("__ksymtab_strings"), aligned(1))) \ | 60 | __attribute__((section("__ksymtab_strings"), aligned(1))) \ |
| 61 | = VMLINUX_SYMBOL_STR(sym); \ | 61 | = VMLINUX_SYMBOL_STR(sym); \ |
| 62 | extern const struct kernel_symbol __ksymtab_##sym; \ | ||
| 62 | __visible const struct kernel_symbol __ksymtab_##sym \ | 63 | __visible const struct kernel_symbol __ksymtab_##sym \ |
| 63 | __used \ | 64 | __used \ |
| 64 | __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ | 65 | __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ |
diff --git a/include/linux/extcon/extcon-gpio.h b/include/linux/extcon/extcon-gpio.h index 4195810f87fe..8900fdf511c6 100644 --- a/include/linux/extcon/extcon-gpio.h +++ b/include/linux/extcon/extcon-gpio.h | |||
| @@ -51,6 +51,7 @@ struct gpio_extcon_platform_data { | |||
| 51 | /* if NULL, "0" or "1" will be printed */ | 51 | /* if NULL, "0" or "1" will be printed */ |
| 52 | const char *state_on; | 52 | const char *state_on; |
| 53 | const char *state_off; | 53 | const char *state_off; |
| 54 | bool check_on_resume; | ||
| 54 | }; | 55 | }; |
| 55 | 56 | ||
| 56 | #endif /* __EXTCON_GPIO_H__ */ | 57 | #endif /* __EXTCON_GPIO_H__ */ |
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index bb942f6d5702..da74d878dc4f 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h | |||
| @@ -153,6 +153,13 @@ struct f2fs_extent { | |||
| 153 | #define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5) | 153 | #define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5) |
| 154 | 154 | ||
| 155 | #define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */ | 155 | #define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */ |
| 156 | #define F2FS_INLINE_DATA 0x02 /* file inline data flag */ | ||
| 157 | |||
| 158 | #define MAX_INLINE_DATA (sizeof(__le32) * (DEF_ADDRS_PER_INODE - \ | ||
| 159 | F2FS_INLINE_XATTR_ADDRS - 1)) | ||
| 160 | |||
| 161 | #define INLINE_DATA_OFFSET (PAGE_CACHE_SIZE - sizeof(struct node_footer) \ | ||
| 162 | - sizeof(__le32) * (DEF_ADDRS_PER_INODE + 5 - 1)) | ||
| 156 | 163 | ||
| 157 | struct f2fs_inode { | 164 | struct f2fs_inode { |
| 158 | __le16 i_mode; /* file mode */ | 165 | __le16 i_mode; /* file mode */ |
diff --git a/include/linux/filter.h b/include/linux/filter.h index ff4e40cd45b1..e568c8ef896b 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
| @@ -83,6 +83,11 @@ static inline void bpf_jit_free(struct sk_filter *fp) | |||
| 83 | #define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns) | 83 | #define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns) |
| 84 | #endif | 84 | #endif |
| 85 | 85 | ||
| 86 | static inline int bpf_tell_extensions(void) | ||
| 87 | { | ||
| 88 | return SKF_AD_MAX; | ||
| 89 | } | ||
| 90 | |||
| 86 | enum { | 91 | enum { |
| 87 | BPF_S_RET_K = 1, | 92 | BPF_S_RET_K = 1, |
| 88 | BPF_S_RET_A, | 93 | BPF_S_RET_A, |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index e154c1005cd1..59529330efd6 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
| @@ -68,4 +68,11 @@ static inline void release_firmware(const struct firmware *fw) | |||
| 68 | 68 | ||
| 69 | #endif | 69 | #endif |
| 70 | 70 | ||
| 71 | #ifdef CONFIG_FW_LOADER_USER_HELPER | ||
| 72 | int request_firmware_direct(const struct firmware **fw, const char *name, | ||
| 73 | struct device *device); | ||
| 74 | #else | ||
| 75 | #define request_firmware_direct request_firmware | ||
| 76 | #endif | ||
| 77 | |||
| 71 | #endif | 78 | #endif |
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h index 6843cf193a44..b6efb0c64408 100644 --- a/include/linux/flex_array.h +++ b/include/linux/flex_array.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _FLEX_ARRAY_H | 2 | #define _FLEX_ARRAY_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/reciprocal_div.h> | ||
| 5 | #include <asm/page.h> | 6 | #include <asm/page.h> |
| 6 | 7 | ||
| 7 | #define FLEX_ARRAY_PART_SIZE PAGE_SIZE | 8 | #define FLEX_ARRAY_PART_SIZE PAGE_SIZE |
| @@ -22,7 +23,7 @@ struct flex_array { | |||
| 22 | int element_size; | 23 | int element_size; |
| 23 | int total_nr_elements; | 24 | int total_nr_elements; |
| 24 | int elems_per_part; | 25 | int elems_per_part; |
| 25 | u32 reciprocal_elems; | 26 | struct reciprocal_value reciprocal_elems; |
| 26 | struct flex_array_part *parts[]; | 27 | struct flex_array_part *parts[]; |
| 27 | }; | 28 | }; |
| 28 | /* | 29 | /* |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 4b2ee8d12f5e..7d8d5e608594 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/path.h> /* struct path */ | 15 | #include <linux/path.h> /* struct path */ |
| 16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
| 17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 18 | |||
| 19 | #include <linux/atomic.h> | 18 | #include <linux/atomic.h> |
| 20 | 19 | ||
| 21 | /* | 20 | /* |
| @@ -79,6 +78,7 @@ struct fsnotify_group; | |||
| 79 | struct fsnotify_event; | 78 | struct fsnotify_event; |
| 80 | struct fsnotify_mark; | 79 | struct fsnotify_mark; |
| 81 | struct fsnotify_event_private_data; | 80 | struct fsnotify_event_private_data; |
| 81 | struct fsnotify_fname; | ||
| 82 | 82 | ||
| 83 | /* | 83 | /* |
| 84 | * Each group much define these ops. The fsnotify infrastructure will call | 84 | * Each group much define these ops. The fsnotify infrastructure will call |
| @@ -94,17 +94,27 @@ struct fsnotify_event_private_data; | |||
| 94 | * userspace messages that marks have been removed. | 94 | * userspace messages that marks have been removed. |
| 95 | */ | 95 | */ |
| 96 | struct fsnotify_ops { | 96 | struct fsnotify_ops { |
| 97 | bool (*should_send_event)(struct fsnotify_group *group, struct inode *inode, | ||
| 98 | struct fsnotify_mark *inode_mark, | ||
| 99 | struct fsnotify_mark *vfsmount_mark, | ||
| 100 | __u32 mask, void *data, int data_type); | ||
| 101 | int (*handle_event)(struct fsnotify_group *group, | 97 | int (*handle_event)(struct fsnotify_group *group, |
| 98 | struct inode *inode, | ||
| 102 | struct fsnotify_mark *inode_mark, | 99 | struct fsnotify_mark *inode_mark, |
| 103 | struct fsnotify_mark *vfsmount_mark, | 100 | struct fsnotify_mark *vfsmount_mark, |
| 104 | struct fsnotify_event *event); | 101 | u32 mask, void *data, int data_type, |
| 102 | const unsigned char *file_name); | ||
| 105 | void (*free_group_priv)(struct fsnotify_group *group); | 103 | void (*free_group_priv)(struct fsnotify_group *group); |
| 106 | void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group); | 104 | void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group); |
| 107 | void (*free_event_priv)(struct fsnotify_event_private_data *priv); | 105 | void (*free_event)(struct fsnotify_event *event); |
| 106 | }; | ||
| 107 | |||
| 108 | /* | ||
| 109 | * all of the information about the original object we want to now send to | ||
| 110 | * a group. If you want to carry more info from the accessing task to the | ||
| 111 | * listener this structure is where you need to be adding fields. | ||
| 112 | */ | ||
| 113 | struct fsnotify_event { | ||
| 114 | struct list_head list; | ||
| 115 | /* inode may ONLY be dereferenced during handle_event(). */ | ||
| 116 | struct inode *inode; /* either the inode the event happened to or its parent */ | ||
| 117 | u32 mask; /* the type of access, bitwise OR for FS_* event types */ | ||
| 108 | }; | 118 | }; |
| 109 | 119 | ||
| 110 | /* | 120 | /* |
| @@ -148,7 +158,11 @@ struct fsnotify_group { | |||
| 148 | * a group */ | 158 | * a group */ |
| 149 | struct list_head marks_list; /* all inode marks for this group */ | 159 | struct list_head marks_list; /* all inode marks for this group */ |
| 150 | 160 | ||
| 151 | struct fasync_struct *fsn_fa; /* async notification */ | 161 | struct fasync_struct *fsn_fa; /* async notification */ |
| 162 | |||
| 163 | struct fsnotify_event overflow_event; /* Event we queue when the | ||
| 164 | * notification list is too | ||
| 165 | * full */ | ||
| 152 | 166 | ||
| 153 | /* groups can define private fields here or use the void *private */ | 167 | /* groups can define private fields here or use the void *private */ |
| 154 | union { | 168 | union { |
| @@ -177,76 +191,10 @@ struct fsnotify_group { | |||
| 177 | }; | 191 | }; |
| 178 | }; | 192 | }; |
| 179 | 193 | ||
| 180 | /* | ||
| 181 | * A single event can be queued in multiple group->notification_lists. | ||
| 182 | * | ||
| 183 | * each group->notification_list will point to an event_holder which in turns points | ||
| 184 | * to the actual event that needs to be sent to userspace. | ||
| 185 | * | ||
| 186 | * Seemed cheaper to create a refcnt'd event and a small holder for every group | ||
| 187 | * than create a different event for every group | ||
| 188 | * | ||
| 189 | */ | ||
| 190 | struct fsnotify_event_holder { | ||
| 191 | struct fsnotify_event *event; | ||
| 192 | struct list_head event_list; | ||
| 193 | }; | ||
| 194 | |||
| 195 | /* | ||
| 196 | * Inotify needs to tack data onto an event. This struct lets us later find the | ||
| 197 | * correct private data of the correct group. | ||
| 198 | */ | ||
| 199 | struct fsnotify_event_private_data { | ||
| 200 | struct fsnotify_group *group; | ||
| 201 | struct list_head event_list; | ||
| 202 | }; | ||
| 203 | |||
| 204 | /* | ||
| 205 | * all of the information about the original object we want to now send to | ||
| 206 | * a group. If you want to carry more info from the accessing task to the | ||
| 207 | * listener this structure is where you need to be adding fields. | ||
| 208 | */ | ||
| 209 | struct fsnotify_event { | ||
| 210 | /* | ||
| 211 | * If we create an event we are also likely going to need a holder | ||
| 212 | * to link to a group. So embed one holder in the event. Means only | ||
| 213 | * one allocation for the common case where we only have one group | ||
| 214 | */ | ||
| 215 | struct fsnotify_event_holder holder; | ||
| 216 | spinlock_t lock; /* protection for the associated event_holder and private_list */ | ||
| 217 | /* to_tell may ONLY be dereferenced during handle_event(). */ | ||
| 218 | struct inode *to_tell; /* either the inode the event happened to or its parent */ | ||
| 219 | /* | ||
| 220 | * depending on the event type we should have either a path or inode | ||
| 221 | * We hold a reference on path, but NOT on inode. Since we have the ref on | ||
| 222 | * the path, it may be dereferenced at any point during this object's | ||
| 223 | * lifetime. That reference is dropped when this object's refcnt hits | ||
| 224 | * 0. If this event contains an inode instead of a path, the inode may | ||
| 225 | * ONLY be used during handle_event(). | ||
| 226 | */ | ||
| 227 | union { | ||
| 228 | struct path path; | ||
| 229 | struct inode *inode; | ||
| 230 | }; | ||
| 231 | /* when calling fsnotify tell it if the data is a path or inode */ | 194 | /* when calling fsnotify tell it if the data is a path or inode */ |
| 232 | #define FSNOTIFY_EVENT_NONE 0 | 195 | #define FSNOTIFY_EVENT_NONE 0 |
| 233 | #define FSNOTIFY_EVENT_PATH 1 | 196 | #define FSNOTIFY_EVENT_PATH 1 |
| 234 | #define FSNOTIFY_EVENT_INODE 2 | 197 | #define FSNOTIFY_EVENT_INODE 2 |
| 235 | int data_type; /* which of the above union we have */ | ||
| 236 | atomic_t refcnt; /* how many groups still are using/need to send this event */ | ||
| 237 | __u32 mask; /* the type of access, bitwise OR for FS_* event types */ | ||
| 238 | |||
| 239 | u32 sync_cookie; /* used to corrolate events, namely inotify mv events */ | ||
| 240 | const unsigned char *file_name; | ||
| 241 | size_t name_len; | ||
| 242 | struct pid *tgid; | ||
| 243 | |||
| 244 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS | ||
| 245 | __u32 response; /* userspace answer to question */ | ||
| 246 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ | ||
| 247 | |||
| 248 | struct list_head private_data_list; /* groups can store private data here */ | ||
| 249 | }; | ||
| 250 | 198 | ||
| 251 | /* | 199 | /* |
| 252 | * Inode specific fields in an fsnotify_mark | 200 | * Inode specific fields in an fsnotify_mark |
| @@ -370,17 +318,12 @@ extern void fsnotify_put_group(struct fsnotify_group *group); | |||
| 370 | extern void fsnotify_destroy_group(struct fsnotify_group *group); | 318 | extern void fsnotify_destroy_group(struct fsnotify_group *group); |
| 371 | /* fasync handler function */ | 319 | /* fasync handler function */ |
| 372 | extern int fsnotify_fasync(int fd, struct file *file, int on); | 320 | extern int fsnotify_fasync(int fd, struct file *file, int on); |
| 373 | /* take a reference to an event */ | 321 | /* Free event from memory */ |
| 374 | extern void fsnotify_get_event(struct fsnotify_event *event); | 322 | extern void fsnotify_destroy_event(struct fsnotify_group *group, |
| 375 | extern void fsnotify_put_event(struct fsnotify_event *event); | 323 | struct fsnotify_event *event); |
| 376 | /* find private data previously attached to an event and unlink it */ | ||
| 377 | extern struct fsnotify_event_private_data *fsnotify_remove_priv_from_event(struct fsnotify_group *group, | ||
| 378 | struct fsnotify_event *event); | ||
| 379 | |||
| 380 | /* attach the event to the group notification queue */ | 324 | /* attach the event to the group notification queue */ |
| 381 | extern struct fsnotify_event *fsnotify_add_notify_event(struct fsnotify_group *group, | 325 | extern struct fsnotify_event *fsnotify_add_notify_event(struct fsnotify_group *group, |
| 382 | struct fsnotify_event *event, | 326 | struct fsnotify_event *event, |
| 383 | struct fsnotify_event_private_data *priv, | ||
| 384 | struct fsnotify_event *(*merge)(struct list_head *, | 327 | struct fsnotify_event *(*merge)(struct list_head *, |
| 385 | struct fsnotify_event *)); | 328 | struct fsnotify_event *)); |
| 386 | /* true if the group notification queue is empty */ | 329 | /* true if the group notification queue is empty */ |
| @@ -430,15 +373,8 @@ extern void fsnotify_put_mark(struct fsnotify_mark *mark); | |||
| 430 | extern void fsnotify_unmount_inodes(struct list_head *list); | 373 | extern void fsnotify_unmount_inodes(struct list_head *list); |
| 431 | 374 | ||
| 432 | /* put here because inotify does some weird stuff when destroying watches */ | 375 | /* put here because inotify does some weird stuff when destroying watches */ |
| 433 | extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, | 376 | extern void fsnotify_init_event(struct fsnotify_event *event, |
| 434 | void *data, int data_is, | 377 | struct inode *to_tell, u32 mask); |
| 435 | const unsigned char *name, | ||
| 436 | u32 cookie, gfp_t gfp); | ||
| 437 | |||
| 438 | /* fanotify likes to change events after they are on lists... */ | ||
| 439 | extern struct fsnotify_event *fsnotify_clone_event(struct fsnotify_event *old_event); | ||
| 440 | extern int fsnotify_replace_event(struct fsnotify_event_holder *old_holder, | ||
| 441 | struct fsnotify_event *new_event); | ||
| 442 | 378 | ||
| 443 | #else | 379 | #else |
| 444 | 380 | ||
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 31ea4b428360..f4233b195dab 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -570,8 +570,6 @@ static inline int | |||
| 570 | ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } | 570 | ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } |
| 571 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 571 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
| 572 | 572 | ||
| 573 | loff_t ftrace_filter_lseek(struct file *file, loff_t offset, int whence); | ||
| 574 | |||
| 575 | /* totally disable ftrace - can not re-enable after this */ | 573 | /* totally disable ftrace - can not re-enable after this */ |
| 576 | void ftrace_kill(void); | 574 | void ftrace_kill(void); |
| 577 | 575 | ||
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 9abbe630c456..4e4cc28623ad 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | |||
| 1 | #ifndef _LINUX_FTRACE_EVENT_H | 2 | #ifndef _LINUX_FTRACE_EVENT_H |
| 2 | #define _LINUX_FTRACE_EVENT_H | 3 | #define _LINUX_FTRACE_EVENT_H |
| 3 | 4 | ||
| @@ -248,6 +249,9 @@ struct ftrace_event_call { | |||
| 248 | #ifdef CONFIG_PERF_EVENTS | 249 | #ifdef CONFIG_PERF_EVENTS |
| 249 | int perf_refcount; | 250 | int perf_refcount; |
| 250 | struct hlist_head __percpu *perf_events; | 251 | struct hlist_head __percpu *perf_events; |
| 252 | |||
| 253 | int (*perf_perm)(struct ftrace_event_call *, | ||
| 254 | struct perf_event *); | ||
| 251 | #endif | 255 | #endif |
| 252 | }; | 256 | }; |
| 253 | 257 | ||
| @@ -261,6 +265,8 @@ enum { | |||
| 261 | FTRACE_EVENT_FL_NO_SET_FILTER_BIT, | 265 | FTRACE_EVENT_FL_NO_SET_FILTER_BIT, |
| 262 | FTRACE_EVENT_FL_SOFT_MODE_BIT, | 266 | FTRACE_EVENT_FL_SOFT_MODE_BIT, |
| 263 | FTRACE_EVENT_FL_SOFT_DISABLED_BIT, | 267 | FTRACE_EVENT_FL_SOFT_DISABLED_BIT, |
| 268 | FTRACE_EVENT_FL_TRIGGER_MODE_BIT, | ||
| 269 | FTRACE_EVENT_FL_TRIGGER_COND_BIT, | ||
| 264 | }; | 270 | }; |
| 265 | 271 | ||
| 266 | /* | 272 | /* |
| @@ -272,6 +278,8 @@ enum { | |||
| 272 | * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED | 278 | * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED |
| 273 | * SOFT_DISABLED - When set, do not trace the event (even though its | 279 | * SOFT_DISABLED - When set, do not trace the event (even though its |
| 274 | * tracepoint may be enabled) | 280 | * tracepoint may be enabled) |
| 281 | * TRIGGER_MODE - When set, invoke the triggers associated with the event | ||
| 282 | * TRIGGER_COND - When set, one or more triggers has an associated filter | ||
| 275 | */ | 283 | */ |
| 276 | enum { | 284 | enum { |
| 277 | FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT), | 285 | FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT), |
| @@ -280,6 +288,8 @@ enum { | |||
| 280 | FTRACE_EVENT_FL_NO_SET_FILTER = (1 << FTRACE_EVENT_FL_NO_SET_FILTER_BIT), | 288 | FTRACE_EVENT_FL_NO_SET_FILTER = (1 << FTRACE_EVENT_FL_NO_SET_FILTER_BIT), |
| 281 | FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT), | 289 | FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT), |
| 282 | FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT), | 290 | FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT), |
| 291 | FTRACE_EVENT_FL_TRIGGER_MODE = (1 << FTRACE_EVENT_FL_TRIGGER_MODE_BIT), | ||
| 292 | FTRACE_EVENT_FL_TRIGGER_COND = (1 << FTRACE_EVENT_FL_TRIGGER_COND_BIT), | ||
| 283 | }; | 293 | }; |
| 284 | 294 | ||
| 285 | struct ftrace_event_file { | 295 | struct ftrace_event_file { |
| @@ -289,6 +299,7 @@ struct ftrace_event_file { | |||
| 289 | struct dentry *dir; | 299 | struct dentry *dir; |
| 290 | struct trace_array *tr; | 300 | struct trace_array *tr; |
| 291 | struct ftrace_subsystem_dir *system; | 301 | struct ftrace_subsystem_dir *system; |
| 302 | struct list_head triggers; | ||
| 292 | 303 | ||
| 293 | /* | 304 | /* |
| 294 | * 32 bit flags: | 305 | * 32 bit flags: |
| @@ -296,6 +307,7 @@ struct ftrace_event_file { | |||
| 296 | * bit 1: enabled cmd record | 307 | * bit 1: enabled cmd record |
| 297 | * bit 2: enable/disable with the soft disable bit | 308 | * bit 2: enable/disable with the soft disable bit |
| 298 | * bit 3: soft disabled | 309 | * bit 3: soft disabled |
| 310 | * bit 4: trigger enabled | ||
| 299 | * | 311 | * |
| 300 | * Note: The bits must be set atomically to prevent races | 312 | * Note: The bits must be set atomically to prevent races |
| 301 | * from other writers. Reads of flags do not need to be in | 313 | * from other writers. Reads of flags do not need to be in |
| @@ -307,6 +319,7 @@ struct ftrace_event_file { | |||
| 307 | */ | 319 | */ |
| 308 | unsigned long flags; | 320 | unsigned long flags; |
| 309 | atomic_t sm_ref; /* soft-mode reference counter */ | 321 | atomic_t sm_ref; /* soft-mode reference counter */ |
| 322 | atomic_t tm_ref; /* trigger-mode reference counter */ | ||
| 310 | }; | 323 | }; |
| 311 | 324 | ||
| 312 | #define __TRACE_EVENT_FLAGS(name, value) \ | 325 | #define __TRACE_EVENT_FLAGS(name, value) \ |
| @@ -317,10 +330,31 @@ struct ftrace_event_file { | |||
| 317 | } \ | 330 | } \ |
| 318 | early_initcall(trace_init_flags_##name); | 331 | early_initcall(trace_init_flags_##name); |
| 319 | 332 | ||
| 333 | #define __TRACE_EVENT_PERF_PERM(name, expr...) \ | ||
| 334 | static int perf_perm_##name(struct ftrace_event_call *tp_event, \ | ||
| 335 | struct perf_event *p_event) \ | ||
| 336 | { \ | ||
| 337 | return ({ expr; }); \ | ||
| 338 | } \ | ||
| 339 | static int __init trace_init_perf_perm_##name(void) \ | ||
| 340 | { \ | ||
| 341 | event_##name.perf_perm = &perf_perm_##name; \ | ||
| 342 | return 0; \ | ||
| 343 | } \ | ||
| 344 | early_initcall(trace_init_perf_perm_##name); | ||
| 345 | |||
| 320 | #define PERF_MAX_TRACE_SIZE 2048 | 346 | #define PERF_MAX_TRACE_SIZE 2048 |
| 321 | 347 | ||
| 322 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ | 348 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ |
| 323 | 349 | ||
| 350 | enum event_trigger_type { | ||
| 351 | ETT_NONE = (0), | ||
| 352 | ETT_TRACE_ONOFF = (1 << 0), | ||
| 353 | ETT_SNAPSHOT = (1 << 1), | ||
| 354 | ETT_STACKTRACE = (1 << 2), | ||
| 355 | ETT_EVENT_ENABLE = (1 << 3), | ||
| 356 | }; | ||
| 357 | |||
| 324 | extern void destroy_preds(struct ftrace_event_file *file); | 358 | extern void destroy_preds(struct ftrace_event_file *file); |
| 325 | extern void destroy_call_preds(struct ftrace_event_call *call); | 359 | extern void destroy_call_preds(struct ftrace_event_call *call); |
| 326 | extern int filter_match_preds(struct event_filter *filter, void *rec); | 360 | extern int filter_match_preds(struct event_filter *filter, void *rec); |
| @@ -331,6 +365,127 @@ extern int filter_check_discard(struct ftrace_event_file *file, void *rec, | |||
| 331 | extern int call_filter_check_discard(struct ftrace_event_call *call, void *rec, | 365 | extern int call_filter_check_discard(struct ftrace_event_call *call, void *rec, |
| 332 | struct ring_buffer *buffer, | 366 | struct ring_buffer *buffer, |
| 333 | struct ring_buffer_event *event); | 367 | struct ring_buffer_event *event); |
| 368 | extern enum event_trigger_type event_triggers_call(struct ftrace_event_file *file, | ||
| 369 | void *rec); | ||
| 370 | extern void event_triggers_post_call(struct ftrace_event_file *file, | ||
| 371 | enum event_trigger_type tt); | ||
| 372 | |||
| 373 | /** | ||
| 374 | * ftrace_trigger_soft_disabled - do triggers and test if soft disabled | ||
| 375 | * @file: The file pointer of the event to test | ||
| 376 | * | ||
| 377 | * If any triggers without filters are attached to this event, they | ||
| 378 | * will be called here. If the event is soft disabled and has no | ||
| 379 | * triggers that require testing the fields, it will return true, | ||
| 380 | * otherwise false. | ||
| 381 | */ | ||
| 382 | static inline bool | ||
| 383 | ftrace_trigger_soft_disabled(struct ftrace_event_file *file) | ||
| 384 | { | ||
| 385 | unsigned long eflags = file->flags; | ||
| 386 | |||
| 387 | if (!(eflags & FTRACE_EVENT_FL_TRIGGER_COND)) { | ||
| 388 | if (eflags & FTRACE_EVENT_FL_TRIGGER_MODE) | ||
| 389 | event_triggers_call(file, NULL); | ||
| 390 | if (eflags & FTRACE_EVENT_FL_SOFT_DISABLED) | ||
| 391 | return true; | ||
| 392 | } | ||
| 393 | return false; | ||
| 394 | } | ||
| 395 | |||
| 396 | /* | ||
| 397 | * Helper function for event_trigger_unlock_commit{_regs}(). | ||
| 398 | * If there are event triggers attached to this event that requires | ||
| 399 | * filtering against its fields, then they wil be called as the | ||
| 400 | * entry already holds the field information of the current event. | ||
| 401 | * | ||
| 402 | * It also checks if the event should be discarded or not. | ||
| 403 | * It is to be discarded if the event is soft disabled and the | ||
| 404 | * event was only recorded to process triggers, or if the event | ||
| 405 | * filter is active and this event did not match the filters. | ||
| 406 | * | ||
| 407 | * Returns true if the event is discarded, false otherwise. | ||
| 408 | */ | ||
| 409 | static inline bool | ||
| 410 | __event_trigger_test_discard(struct ftrace_event_file *file, | ||
| 411 | struct ring_buffer *buffer, | ||
| 412 | struct ring_buffer_event *event, | ||
| 413 | void *entry, | ||
| 414 | enum event_trigger_type *tt) | ||
| 415 | { | ||
| 416 | unsigned long eflags = file->flags; | ||
| 417 | |||
| 418 | if (eflags & FTRACE_EVENT_FL_TRIGGER_COND) | ||
| 419 | *tt = event_triggers_call(file, entry); | ||
| 420 | |||
| 421 | if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT, &file->flags)) | ||
| 422 | ring_buffer_discard_commit(buffer, event); | ||
| 423 | else if (!filter_check_discard(file, entry, buffer, event)) | ||
| 424 | return false; | ||
| 425 | |||
| 426 | return true; | ||
| 427 | } | ||
| 428 | |||
| 429 | /** | ||
| 430 | * event_trigger_unlock_commit - handle triggers and finish event commit | ||
| 431 | * @file: The file pointer assoctiated to the event | ||
| 432 | * @buffer: The ring buffer that the event is being written to | ||
| 433 | * @event: The event meta data in the ring buffer | ||
| 434 | * @entry: The event itself | ||
| 435 | * @irq_flags: The state of the interrupts at the start of the event | ||
| 436 | * @pc: The state of the preempt count at the start of the event. | ||
| 437 | * | ||
| 438 | * This is a helper function to handle triggers that require data | ||
| 439 | * from the event itself. It also tests the event against filters and | ||
| 440 | * if the event is soft disabled and should be discarded. | ||
| 441 | */ | ||
| 442 | static inline void | ||
| 443 | event_trigger_unlock_commit(struct ftrace_event_file *file, | ||
| 444 | struct ring_buffer *buffer, | ||
| 445 | struct ring_buffer_event *event, | ||
| 446 | void *entry, unsigned long irq_flags, int pc) | ||
| 447 | { | ||
| 448 | enum event_trigger_type tt = ETT_NONE; | ||
| 449 | |||
| 450 | if (!__event_trigger_test_discard(file, buffer, event, entry, &tt)) | ||
| 451 | trace_buffer_unlock_commit(buffer, event, irq_flags, pc); | ||
| 452 | |||
| 453 | if (tt) | ||
| 454 | event_triggers_post_call(file, tt); | ||
| 455 | } | ||
| 456 | |||
| 457 | /** | ||
| 458 | * event_trigger_unlock_commit_regs - handle triggers and finish event commit | ||
| 459 | * @file: The file pointer assoctiated to the event | ||
| 460 | * @buffer: The ring buffer that the event is being written to | ||
| 461 | * @event: The event meta data in the ring buffer | ||
| 462 | * @entry: The event itself | ||
| 463 | * @irq_flags: The state of the interrupts at the start of the event | ||
| 464 | * @pc: The state of the preempt count at the start of the event. | ||
| 465 | * | ||
| 466 | * This is a helper function to handle triggers that require data | ||
| 467 | * from the event itself. It also tests the event against filters and | ||
| 468 | * if the event is soft disabled and should be discarded. | ||
| 469 | * | ||
| 470 | * Same as event_trigger_unlock_commit() but calls | ||
| 471 | * trace_buffer_unlock_commit_regs() instead of trace_buffer_unlock_commit(). | ||
| 472 | */ | ||
| 473 | static inline void | ||
| 474 | event_trigger_unlock_commit_regs(struct ftrace_event_file *file, | ||
| 475 | struct ring_buffer *buffer, | ||
| 476 | struct ring_buffer_event *event, | ||
| 477 | void *entry, unsigned long irq_flags, int pc, | ||
| 478 | struct pt_regs *regs) | ||
| 479 | { | ||
| 480 | enum event_trigger_type tt = ETT_NONE; | ||
| 481 | |||
| 482 | if (!__event_trigger_test_discard(file, buffer, event, entry, &tt)) | ||
| 483 | trace_buffer_unlock_commit_regs(buffer, event, | ||
| 484 | irq_flags, pc, regs); | ||
| 485 | |||
| 486 | if (tt) | ||
| 487 | event_triggers_post_call(file, tt); | ||
| 488 | } | ||
| 334 | 489 | ||
| 335 | enum { | 490 | enum { |
| 336 | FILTER_OTHER = 0, | 491 | FILTER_OTHER = 0, |
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index 1eda33d7cb10..1c2fdaa2ffc3 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | #ifndef __GENALLOC_H__ | 30 | #ifndef __GENALLOC_H__ |
| 31 | #define __GENALLOC_H__ | 31 | #define __GENALLOC_H__ |
| 32 | 32 | ||
| 33 | #include <linux/spinlock_types.h> | ||
| 34 | |||
| 33 | struct device; | 35 | struct device; |
| 34 | struct device_node; | 36 | struct device_node; |
| 35 | 37 | ||
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 9b4dd491f7e8..0437439bc047 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef __LINUX_GFP_H | 1 | #ifndef __LINUX_GFP_H |
| 2 | #define __LINUX_GFP_H | 2 | #define __LINUX_GFP_H |
| 3 | 3 | ||
| 4 | #include <linux/mmdebug.h> | ||
| 4 | #include <linux/mmzone.h> | 5 | #include <linux/mmzone.h> |
| 5 | #include <linux/stddef.h> | 6 | #include <linux/stddef.h> |
| 6 | #include <linux/linkage.h> | 7 | #include <linux/linkage.h> |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 13dfd24d01ab..b581b13d29d9 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
| @@ -90,7 +90,6 @@ void devm_gpio_free(struct device *dev, unsigned int gpio); | |||
| 90 | 90 | ||
| 91 | #include <linux/kernel.h> | 91 | #include <linux/kernel.h> |
| 92 | #include <linux/types.h> | 92 | #include <linux/types.h> |
| 93 | #include <linux/errno.h> | ||
| 94 | #include <linux/bug.h> | 93 | #include <linux/bug.h> |
| 95 | #include <linux/pinctrl/pinctrl.h> | 94 | #include <linux/pinctrl/pinctrl.h> |
| 96 | 95 | ||
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 656a27efb2c8..a3e181e09636 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h | |||
| @@ -2,9 +2,12 @@ | |||
| 2 | #define __LINUX_GPIO_DRIVER_H | 2 | #define __LINUX_GPIO_DRIVER_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/module.h> | ||
| 5 | 6 | ||
| 6 | struct device; | 7 | struct device; |
| 7 | struct gpio_desc; | 8 | struct gpio_desc; |
| 9 | struct of_phandle_args; | ||
| 10 | struct device_node; | ||
| 8 | struct seq_file; | 11 | struct seq_file; |
| 9 | 12 | ||
| 10 | /** | 13 | /** |
| @@ -36,14 +39,15 @@ struct seq_file; | |||
| 36 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO | 39 | * @ngpio: the number of GPIOs handled by this controller; the last GPIO |
| 37 | * handled is (base + ngpio - 1). | 40 | * handled is (base + ngpio - 1). |
| 38 | * @desc: array of ngpio descriptors. Private. | 41 | * @desc: array of ngpio descriptors. Private. |
| 39 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they | ||
| 40 | * must while accessing GPIO expander chips over I2C or SPI | ||
| 41 | * @names: if set, must be an array of strings to use as alternative | 42 | * @names: if set, must be an array of strings to use as alternative |
| 42 | * names for the GPIOs in this chip. Any entry in the array | 43 | * names for the GPIOs in this chip. Any entry in the array |
| 43 | * may be NULL if there is no alias for the GPIO, however the | 44 | * may be NULL if there is no alias for the GPIO, however the |
| 44 | * array must be @ngpio entries long. A name can include a single printk | 45 | * array must be @ngpio entries long. A name can include a single printk |
| 45 | * format specifier for an unsigned int. It is substituted by the actual | 46 | * format specifier for an unsigned int. It is substituted by the actual |
| 46 | * number of the gpio. | 47 | * number of the gpio. |
| 48 | * @can_sleep: flag must be set iff get()/set() methods sleep, as they | ||
| 49 | * must while accessing GPIO expander chips over I2C or SPI | ||
| 50 | * @exported: flags if the gpiochip is exported for use from sysfs. Private. | ||
| 47 | * | 51 | * |
| 48 | * A gpio_chip can help platforms abstract various sources of GPIOs so | 52 | * A gpio_chip can help platforms abstract various sources of GPIOs so |
| 49 | * they can all be accessed through a common programing interface. | 53 | * they can all be accessed through a common programing interface. |
| @@ -88,8 +92,8 @@ struct gpio_chip { | |||
| 88 | u16 ngpio; | 92 | u16 ngpio; |
| 89 | struct gpio_desc *desc; | 93 | struct gpio_desc *desc; |
| 90 | const char *const *names; | 94 | const char *const *names; |
| 91 | unsigned can_sleep:1; | 95 | bool can_sleep; |
| 92 | unsigned exported:1; | 96 | bool exported; |
| 93 | 97 | ||
| 94 | #if defined(CONFIG_OF_GPIO) | 98 | #if defined(CONFIG_OF_GPIO) |
| 95 | /* | 99 | /* |
| @@ -125,60 +129,58 @@ extern struct gpio_chip *gpiochip_find(void *data, | |||
| 125 | int gpiod_lock_as_irq(struct gpio_desc *desc); | 129 | int gpiod_lock_as_irq(struct gpio_desc *desc); |
| 126 | void gpiod_unlock_as_irq(struct gpio_desc *desc); | 130 | void gpiod_unlock_as_irq(struct gpio_desc *desc); |
| 127 | 131 | ||
| 132 | enum gpio_lookup_flags { | ||
| 133 | GPIO_ACTIVE_HIGH = (0 << 0), | ||
| 134 | GPIO_ACTIVE_LOW = (1 << 0), | ||
| 135 | GPIO_OPEN_DRAIN = (1 << 1), | ||
| 136 | GPIO_OPEN_SOURCE = (1 << 2), | ||
| 137 | }; | ||
| 138 | |||
| 128 | /** | 139 | /** |
| 129 | * Lookup table for associating GPIOs to specific devices and functions using | 140 | * struct gpiod_lookup - lookup table |
| 130 | * platform data. | 141 | * @chip_label: name of the chip the GPIO belongs to |
| 142 | * @chip_hwnum: hardware number (i.e. relative to the chip) of the GPIO | ||
| 143 | * @con_id: name of the GPIO from the device's point of view | ||
| 144 | * @idx: index of the GPIO in case several GPIOs share the same name | ||
| 145 | * @flags: mask of GPIO_* values | ||
| 146 | * | ||
| 147 | * gpiod_lookup is a lookup table for associating GPIOs to specific devices and | ||
| 148 | * functions using platform data. | ||
| 131 | */ | 149 | */ |
| 132 | struct gpiod_lookup { | 150 | struct gpiod_lookup { |
| 133 | struct list_head list; | ||
| 134 | /* | ||
| 135 | * name of the chip the GPIO belongs to | ||
| 136 | */ | ||
| 137 | const char *chip_label; | 151 | const char *chip_label; |
| 138 | /* | ||
| 139 | * hardware number (i.e. relative to the chip) of the GPIO | ||
| 140 | */ | ||
| 141 | u16 chip_hwnum; | 152 | u16 chip_hwnum; |
| 142 | /* | ||
| 143 | * name of device that can claim this GPIO | ||
| 144 | */ | ||
| 145 | const char *dev_id; | ||
| 146 | /* | ||
| 147 | * name of the GPIO from the device's point of view | ||
| 148 | */ | ||
| 149 | const char *con_id; | 153 | const char *con_id; |
| 150 | /* | ||
| 151 | * index of the GPIO in case several GPIOs share the same name | ||
| 152 | */ | ||
| 153 | unsigned int idx; | 154 | unsigned int idx; |
| 154 | /* | 155 | enum gpio_lookup_flags flags; |
| 155 | * mask of GPIOF_* values | 156 | }; |
| 156 | */ | 157 | |
| 157 | unsigned long flags; | 158 | struct gpiod_lookup_table { |
| 159 | struct list_head list; | ||
| 160 | const char *dev_id; | ||
| 161 | struct gpiod_lookup table[]; | ||
| 158 | }; | 162 | }; |
| 159 | 163 | ||
| 160 | /* | 164 | /* |
| 161 | * Simple definition of a single GPIO under a con_id | 165 | * Simple definition of a single GPIO under a con_id |
| 162 | */ | 166 | */ |
| 163 | #define GPIO_LOOKUP(_chip_label, _chip_hwnum, _dev_id, _con_id, _flags) \ | 167 | #define GPIO_LOOKUP(_chip_label, _chip_hwnum, _con_id, _flags) \ |
| 164 | GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, 0, _flags) | 168 | GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _con_id, 0, _flags) |
| 165 | 169 | ||
| 166 | /* | 170 | /* |
| 167 | * Use this macro if you need to have several GPIOs under the same con_id. | 171 | * Use this macro if you need to have several GPIOs under the same con_id. |
| 168 | * Each GPIO needs to use a different index and can be accessed using | 172 | * Each GPIO needs to use a different index and can be accessed using |
| 169 | * gpiod_get_index() | 173 | * gpiod_get_index() |
| 170 | */ | 174 | */ |
| 171 | #define GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, _idx, \ | 175 | #define GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _con_id, _idx, _flags) \ |
| 172 | _flags) \ | ||
| 173 | { \ | 176 | { \ |
| 174 | .chip_label = _chip_label, \ | 177 | .chip_label = _chip_label, \ |
| 175 | .chip_hwnum = _chip_hwnum, \ | 178 | .chip_hwnum = _chip_hwnum, \ |
| 176 | .dev_id = _dev_id, \ | ||
| 177 | .con_id = _con_id, \ | 179 | .con_id = _con_id, \ |
| 178 | .idx = _idx, \ | 180 | .idx = _idx, \ |
| 179 | .flags = _flags, \ | 181 | .flags = _flags, \ |
| 180 | } | 182 | } |
| 181 | 183 | ||
| 182 | void gpiod_add_table(struct gpiod_lookup *table, size_t size); | 184 | void gpiod_add_lookup_table(struct gpiod_lookup_table *table); |
| 183 | 185 | ||
| 184 | #endif | 186 | #endif |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index d9cf963ac832..12d5f972f23f 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <linux/lockdep.h> | 5 | #include <linux/lockdep.h> |
| 6 | #include <linux/ftrace_irq.h> | 6 | #include <linux/ftrace_irq.h> |
| 7 | #include <linux/vtime.h> | 7 | #include <linux/vtime.h> |
| 8 | #include <asm/hardirq.h> | ||
| 8 | 9 | ||
| 9 | 10 | ||
| 10 | extern void synchronize_irq(unsigned int irq); | 11 | extern void synchronize_irq(unsigned int irq); |
diff --git a/include/linux/hash.h b/include/linux/hash.h index f09a0ae4d858..bd1754c7ecef 100644 --- a/include/linux/hash.h +++ b/include/linux/hash.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include <asm/types.h> | 17 | #include <asm/types.h> |
| 18 | #include <asm/hash.h> | ||
| 18 | #include <linux/compiler.h> | 19 | #include <linux/compiler.h> |
| 19 | 20 | ||
| 20 | /* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ | 21 | /* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ |
| @@ -78,4 +79,39 @@ static inline u32 hash32_ptr(const void *ptr) | |||
| 78 | #endif | 79 | #endif |
| 79 | return (u32)val; | 80 | return (u32)val; |
| 80 | } | 81 | } |
| 82 | |||
| 83 | struct fast_hash_ops { | ||
| 84 | u32 (*hash)(const void *data, u32 len, u32 seed); | ||
| 85 | u32 (*hash2)(const u32 *data, u32 len, u32 seed); | ||
| 86 | }; | ||
| 87 | |||
| 88 | /** | ||
| 89 | * arch_fast_hash - Caclulates a hash over a given buffer that can have | ||
| 90 | * arbitrary size. This function will eventually use an | ||
| 91 | * architecture-optimized hashing implementation if | ||
| 92 | * available, and trades off distribution for speed. | ||
| 93 | * | ||
| 94 | * @data: buffer to hash | ||
| 95 | * @len: length of buffer in bytes | ||
| 96 | * @seed: start seed | ||
| 97 | * | ||
| 98 | * Returns 32bit hash. | ||
| 99 | */ | ||
| 100 | extern u32 arch_fast_hash(const void *data, u32 len, u32 seed); | ||
| 101 | |||
| 102 | /** | ||
| 103 | * arch_fast_hash2 - Caclulates a hash over a given buffer that has a | ||
| 104 | * size that is of a multiple of 32bit words. This | ||
| 105 | * function will eventually use an architecture- | ||
| 106 | * optimized hashing implementation if available, | ||
| 107 | * and trades off distribution for speed. | ||
| 108 | * | ||
| 109 | * @data: buffer to hash (must be 32bit padded) | ||
| 110 | * @len: number of 32bit words | ||
| 111 | * @seed: start seed | ||
| 112 | * | ||
| 113 | * Returns 32bit hash. | ||
| 114 | */ | ||
| 115 | extern u32 arch_fast_hash2(const u32 *data, u32 len, u32 seed); | ||
| 116 | |||
| 81 | #endif /* _LINUX_HASH_H */ | 117 | #endif /* _LINUX_HASH_H */ |
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index a265af294ea4..b914ca3f57ba 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h | |||
| @@ -21,6 +21,8 @@ | |||
| 21 | 21 | ||
| 22 | #include <linux/hid.h> | 22 | #include <linux/hid.h> |
| 23 | #include <linux/hid-sensor-ids.h> | 23 | #include <linux/hid-sensor-ids.h> |
| 24 | #include <linux/iio/iio.h> | ||
| 25 | #include <linux/iio/trigger.h> | ||
| 24 | 26 | ||
| 25 | /** | 27 | /** |
| 26 | * struct hid_sensor_hub_attribute_info - Attribute info | 28 | * struct hid_sensor_hub_attribute_info - Attribute info |
| @@ -40,6 +42,8 @@ struct hid_sensor_hub_attribute_info { | |||
| 40 | s32 units; | 42 | s32 units; |
| 41 | s32 unit_expo; | 43 | s32 unit_expo; |
| 42 | s32 size; | 44 | s32 size; |
| 45 | s32 logical_minimum; | ||
| 46 | s32 logical_maximum; | ||
| 43 | }; | 47 | }; |
| 44 | 48 | ||
| 45 | /** | 49 | /** |
| @@ -184,6 +188,7 @@ struct hid_sensor_common { | |||
| 184 | struct platform_device *pdev; | 188 | struct platform_device *pdev; |
| 185 | unsigned usage_id; | 189 | unsigned usage_id; |
| 186 | bool data_ready; | 190 | bool data_ready; |
| 191 | struct iio_trigger *trigger; | ||
| 187 | struct hid_sensor_hub_attribute_info poll; | 192 | struct hid_sensor_hub_attribute_info poll; |
| 188 | struct hid_sensor_hub_attribute_info report_state; | 193 | struct hid_sensor_hub_attribute_info report_state; |
| 189 | struct hid_sensor_hub_attribute_info power_state; | 194 | struct hid_sensor_hub_attribute_info power_state; |
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h index 4f945d3ed49f..beaf965621c1 100644 --- a/include/linux/hid-sensor-ids.h +++ b/include/linux/hid-sensor-ids.h | |||
| @@ -23,22 +23,26 @@ | |||
| 23 | 23 | ||
| 24 | /* Accel 3D (200073) */ | 24 | /* Accel 3D (200073) */ |
| 25 | #define HID_USAGE_SENSOR_ACCEL_3D 0x200073 | 25 | #define HID_USAGE_SENSOR_ACCEL_3D 0x200073 |
| 26 | #define HID_USAGE_SENSOR_DATA_ACCELERATION 0x200452 | ||
| 26 | #define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453 | 27 | #define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453 |
| 27 | #define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454 | 28 | #define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454 |
| 28 | #define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455 | 29 | #define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455 |
| 29 | 30 | ||
| 30 | /* ALS (200041) */ | 31 | /* ALS (200041) */ |
| 31 | #define HID_USAGE_SENSOR_ALS 0x200041 | 32 | #define HID_USAGE_SENSOR_ALS 0x200041 |
| 33 | #define HID_USAGE_SENSOR_DATA_LIGHT 0x2004d0 | ||
| 32 | #define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1 | 34 | #define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1 |
| 33 | 35 | ||
| 34 | /* Gyro 3D: (200076) */ | 36 | /* Gyro 3D: (200076) */ |
| 35 | #define HID_USAGE_SENSOR_GYRO_3D 0x200076 | 37 | #define HID_USAGE_SENSOR_GYRO_3D 0x200076 |
| 38 | #define HID_USAGE_SENSOR_DATA_ANGL_VELOCITY 0x200456 | ||
| 36 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457 | 39 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457 |
| 37 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 | 40 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 |
| 38 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 | 41 | #define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 |
| 39 | 42 | ||
| 40 | /* ORIENTATION: Compass 3D: (200083) */ | 43 | /* ORIENTATION: Compass 3D: (200083) */ |
| 41 | #define HID_USAGE_SENSOR_COMPASS_3D 0x200083 | 44 | #define HID_USAGE_SENSOR_COMPASS_3D 0x200083 |
| 45 | #define HID_USAGE_SENSOR_DATA_ORIENTATION 0x200470 | ||
| 42 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 | 46 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 |
| 43 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 | 47 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 |
| 44 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473 | 48 | #define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473 |
| @@ -54,10 +58,14 @@ | |||
| 54 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B | 58 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B |
| 55 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C | 59 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C |
| 56 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D | 60 | #define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D |
| 61 | |||
| 62 | /* ORIENTATION: Inclinometer 3D: (200086) */ | ||
| 63 | #define HID_USAGE_SENSOR_INCLINOMETER_3D 0x200086 | ||
| 57 | #define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E | 64 | #define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E |
| 58 | #define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F | 65 | #define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F |
| 59 | #define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480 | 66 | #define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480 |
| 60 | #define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481 | 67 | #define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481 |
| 68 | |||
| 61 | #define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482 | 69 | #define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482 |
| 62 | #define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483 | 70 | #define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483 |
| 63 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484 | 71 | #define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484 |
| @@ -117,4 +125,20 @@ | |||
| 117 | #define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 | 125 | #define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 |
| 118 | #define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 | 126 | #define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 |
| 119 | 127 | ||
| 128 | /* Per data field properties */ | ||
| 129 | #define HID_USAGE_SENSOR_DATA_MOD_NONE 0x00 | ||
| 130 | #define HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS 0x1000 | ||
| 131 | |||
| 132 | /* Power state enumerations */ | ||
| 133 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_UNDEFINED_ENUM 0x00 | ||
| 134 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM 0x01 | ||
| 135 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D1_LOW_POWER_ENUM 0x02 | ||
| 136 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D2_STANDBY_WITH_WAKE_ENUM 0x03 | ||
| 137 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D3_SLEEP_WITH_WAKE_ENUM 0x04 | ||
| 138 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM 0x05 | ||
| 139 | |||
| 140 | /* Report State enumerations */ | ||
| 141 | #define HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM 0x00 | ||
| 142 | #define HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM 0x01 | ||
| 143 | |||
| 120 | #endif | 144 | #endif |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 91672e2deec3..db512014e061 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
| @@ -157,6 +157,26 @@ static inline int hpage_nr_pages(struct page *page) | |||
| 157 | return HPAGE_PMD_NR; | 157 | return HPAGE_PMD_NR; |
| 158 | return 1; | 158 | return 1; |
| 159 | } | 159 | } |
| 160 | /* | ||
| 161 | * compound_trans_head() should be used instead of compound_head(), | ||
| 162 | * whenever the "page" passed as parameter could be the tail of a | ||
| 163 | * transparent hugepage that could be undergoing a | ||
| 164 | * __split_huge_page_refcount(). The page structure layout often | ||
| 165 | * changes across releases and it makes extensive use of unions. So if | ||
| 166 | * the page structure layout will change in a way that | ||
| 167 | * page->first_page gets clobbered by __split_huge_page_refcount, the | ||
| 168 | * implementation making use of smp_rmb() will be required. | ||
| 169 | * | ||
| 170 | * Currently we define compound_trans_head as compound_head, because | ||
| 171 | * page->private is in the same union with page->first_page, and | ||
| 172 | * page->private isn't clobbered. However this also means we're | ||
| 173 | * currently leaving dirt into the page->private field of anonymous | ||
| 174 | * pages resulting from a THP split, instead of setting page->private | ||
| 175 | * to zero like for every other page that has PG_private not set. But | ||
| 176 | * anonymous pages don't use page->private so this is not a problem. | ||
| 177 | */ | ||
| 178 | #if 0 | ||
| 179 | /* This will be needed if page->private will be clobbered in split_huge_page */ | ||
| 160 | static inline struct page *compound_trans_head(struct page *page) | 180 | static inline struct page *compound_trans_head(struct page *page) |
| 161 | { | 181 | { |
| 162 | if (PageTail(page)) { | 182 | if (PageTail(page)) { |
| @@ -174,6 +194,9 @@ static inline struct page *compound_trans_head(struct page *page) | |||
| 174 | } | 194 | } |
| 175 | return page; | 195 | return page; |
| 176 | } | 196 | } |
| 197 | #else | ||
| 198 | #define compound_trans_head(page) compound_head(page) | ||
| 199 | #endif | ||
| 177 | 200 | ||
| 178 | extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, | 201 | extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, |
| 179 | unsigned long addr, pmd_t pmd, pmd_t *pmdp); | 202 | unsigned long addr, pmd_t pmd, pmd_t *pmdp); |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 9649ff0c63f8..8c43cc469d78 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _LINUX_HUGETLB_H | 2 | #define _LINUX_HUGETLB_H |
| 3 | 3 | ||
| 4 | #include <linux/mm_types.h> | 4 | #include <linux/mm_types.h> |
| 5 | #include <linux/mmdebug.h> | ||
| 5 | #include <linux/fs.h> | 6 | #include <linux/fs.h> |
| 6 | #include <linux/hugetlb_inline.h> | 7 | #include <linux/hugetlb_inline.h> |
| 7 | #include <linux/cgroup.h> | 8 | #include <linux/cgroup.h> |
| @@ -31,7 +32,6 @@ struct hugepage_subpool *hugepage_new_subpool(long nr_blocks); | |||
| 31 | void hugepage_put_subpool(struct hugepage_subpool *spool); | 32 | void hugepage_put_subpool(struct hugepage_subpool *spool); |
| 32 | 33 | ||
| 33 | int PageHuge(struct page *page); | 34 | int PageHuge(struct page *page); |
| 34 | int PageHeadHuge(struct page *page_head); | ||
| 35 | 35 | ||
| 36 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | 36 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); |
| 37 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); | 37 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
| @@ -104,11 +104,6 @@ static inline int PageHuge(struct page *page) | |||
| 104 | return 0; | 104 | return 0; |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | static inline int PageHeadHuge(struct page *page_head) | ||
| 108 | { | ||
| 109 | return 0; | ||
| 110 | } | ||
| 111 | |||
| 112 | static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) | 107 | static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) |
| 113 | { | 108 | { |
| 114 | } | 109 | } |
| @@ -142,7 +137,10 @@ static inline int dequeue_hwpoisoned_huge_page(struct page *page) | |||
| 142 | return 0; | 137 | return 0; |
| 143 | } | 138 | } |
| 144 | 139 | ||
| 145 | #define isolate_huge_page(p, l) false | 140 | static inline bool isolate_huge_page(struct page *page, struct list_head *list) |
| 141 | { | ||
| 142 | return false; | ||
| 143 | } | ||
| 146 | #define putback_active_hugepage(p) do {} while (0) | 144 | #define putback_active_hugepage(p) do {} while (0) |
| 147 | #define is_hugepage_active(x) false | 145 | #define is_hugepage_active(x) false |
| 148 | 146 | ||
| @@ -357,6 +355,7 @@ static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma, | |||
| 357 | 355 | ||
| 358 | static inline struct hstate *page_hstate(struct page *page) | 356 | static inline struct hstate *page_hstate(struct page *page) |
| 359 | { | 357 | { |
| 358 | VM_BUG_ON_PAGE(!PageHuge(page), page); | ||
| 360 | return size_to_hstate(PAGE_SIZE << compound_order(page)); | 359 | return size_to_hstate(PAGE_SIZE << compound_order(page)); |
| 361 | } | 360 | } |
| 362 | 361 | ||
diff --git a/include/linux/hugetlb_cgroup.h b/include/linux/hugetlb_cgroup.h index ce8217f7b5c2..787bba3bf552 100644 --- a/include/linux/hugetlb_cgroup.h +++ b/include/linux/hugetlb_cgroup.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #ifndef _LINUX_HUGETLB_CGROUP_H | 15 | #ifndef _LINUX_HUGETLB_CGROUP_H |
| 16 | #define _LINUX_HUGETLB_CGROUP_H | 16 | #define _LINUX_HUGETLB_CGROUP_H |
| 17 | 17 | ||
| 18 | #include <linux/mmdebug.h> | ||
| 18 | #include <linux/res_counter.h> | 19 | #include <linux/res_counter.h> |
| 19 | 20 | ||
| 20 | struct hugetlb_cgroup; | 21 | struct hugetlb_cgroup; |
| @@ -28,7 +29,7 @@ struct hugetlb_cgroup; | |||
| 28 | 29 | ||
| 29 | static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page) | 30 | static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page) |
| 30 | { | 31 | { |
| 31 | VM_BUG_ON(!PageHuge(page)); | 32 | VM_BUG_ON_PAGE(!PageHuge(page), page); |
| 32 | 33 | ||
| 33 | if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER) | 34 | if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER) |
| 34 | return NULL; | 35 | return NULL; |
| @@ -38,7 +39,7 @@ static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page) | |||
| 38 | static inline | 39 | static inline |
| 39 | int set_hugetlb_cgroup(struct page *page, struct hugetlb_cgroup *h_cg) | 40 | int set_hugetlb_cgroup(struct page *page, struct hugetlb_cgroup *h_cg) |
| 40 | { | 41 | { |
| 41 | VM_BUG_ON(!PageHuge(page)); | 42 | VM_BUG_ON_PAGE(!PageHuge(page), page); |
| 42 | 43 | ||
| 43 | if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER) | 44 | if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER) |
| 44 | return -1; | 45 | return -1; |
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h index 49ed17fdf055..5388326fbbff 100644 --- a/include/linux/i2c-pnx.h +++ b/include/linux/i2c-pnx.h | |||
| @@ -31,7 +31,6 @@ struct i2c_pnx_algo_data { | |||
| 31 | int last; | 31 | int last; |
| 32 | struct clk *clk; | 32 | struct clk *clk; |
| 33 | struct i2c_adapter adapter; | 33 | struct i2c_adapter adapter; |
| 34 | phys_addr_t base; | ||
| 35 | int irq; | 34 | int irq; |
| 36 | u32 timeout; | 35 | u32 timeout; |
| 37 | }; | 36 | }; |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index eff50e062be8..d9c8dbd3373f 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -445,7 +445,7 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data) | |||
| 445 | static inline struct i2c_adapter * | 445 | static inline struct i2c_adapter * |
| 446 | i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) | 446 | i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) |
| 447 | { | 447 | { |
| 448 | #if IS_ENABLED(I2C_MUX) | 448 | #if IS_ENABLED(CONFIG_I2C_MUX) |
| 449 | struct device *parent = adapter->dev.parent; | 449 | struct device *parent = adapter->dev.parent; |
| 450 | 450 | ||
| 451 | if (parent != NULL && parent->type == &i2c_adapter_type) | 451 | if (parent != NULL && parent->type == &i2c_adapter_type) |
diff --git a/include/linux/i2c/tsc2007.h b/include/linux/i2c/tsc2007.h index 506a9f7af51e..4f35b6ad3889 100644 --- a/include/linux/i2c/tsc2007.h +++ b/include/linux/i2c/tsc2007.h | |||
| @@ -7,16 +7,14 @@ struct tsc2007_platform_data { | |||
| 7 | u16 model; /* 2007. */ | 7 | u16 model; /* 2007. */ |
| 8 | u16 x_plate_ohms; /* must be non-zero value */ | 8 | u16 x_plate_ohms; /* must be non-zero value */ |
| 9 | u16 max_rt; /* max. resistance above which samples are ignored */ | 9 | u16 max_rt; /* max. resistance above which samples are ignored */ |
| 10 | unsigned long poll_delay; /* delay (in ms) after pen-down event | ||
| 11 | before polling starts */ | ||
| 12 | unsigned long poll_period; /* time (in ms) between samples */ | 10 | unsigned long poll_period; /* time (in ms) between samples */ |
| 13 | int fuzzx; /* fuzz factor for X, Y and pressure axes */ | 11 | int fuzzx; /* fuzz factor for X, Y and pressure axes */ |
| 14 | int fuzzy; | 12 | int fuzzy; |
| 15 | int fuzzz; | 13 | int fuzzz; |
| 16 | 14 | ||
| 17 | int (*get_pendown_state)(void); | 15 | int (*get_pendown_state)(struct device *); |
| 18 | void (*clear_penirq)(void); /* If needed, clear 2nd level | 16 | /* If needed, clear 2nd level interrupt source */ |
| 19 | interrupt source */ | 17 | void (*clear_penirq)(void); |
| 20 | int (*init_platform_hw)(void); | 18 | int (*init_platform_hw)(void); |
| 21 | void (*exit_platform_hw)(void); | 19 | void (*exit_platform_hw)(void); |
| 22 | }; | 20 | }; |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 673a3ce67f31..ade1c06d4ceb 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
| @@ -175,6 +175,9 @@ static inline int twl_class_is_ ##class(void) \ | |||
| 175 | TWL_CLASS_IS(4030, TWL4030_CLASS_ID) | 175 | TWL_CLASS_IS(4030, TWL4030_CLASS_ID) |
| 176 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) | 176 | TWL_CLASS_IS(6030, TWL6030_CLASS_ID) |
| 177 | 177 | ||
| 178 | /* Set the regcache bypass for the regmap associated with the nodule */ | ||
| 179 | int twl_set_regcache_bypass(u8 mod_no, bool enable); | ||
| 180 | |||
| 178 | /* | 181 | /* |
| 179 | * Read and write several 8-bit registers at once. | 182 | * Read and write several 8-bit registers at once. |
| 180 | */ | 183 | */ |
| @@ -667,8 +670,6 @@ struct twl4030_codec_data { | |||
| 667 | unsigned int digimic_delay; /* in ms */ | 670 | unsigned int digimic_delay; /* in ms */ |
| 668 | unsigned int ramp_delay_value; | 671 | unsigned int ramp_delay_value; |
| 669 | unsigned int offset_cncl_path; | 672 | unsigned int offset_cncl_path; |
| 670 | unsigned int check_defaults:1; | ||
| 671 | unsigned int reset_registers:1; | ||
| 672 | unsigned int hs_extmute:1; | 673 | unsigned int hs_extmute:1; |
| 673 | int hs_extmute_gpio; | 674 | int hs_extmute_gpio; |
| 674 | }; | 675 | }; |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 46a14229a162..93b5ca754b5b 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
| @@ -18,14 +18,10 @@ | |||
| 18 | #include <linux/completion.h> | 18 | #include <linux/completion.h> |
| 19 | #include <linux/pm.h> | 19 | #include <linux/pm.h> |
| 20 | #include <linux/mutex.h> | 20 | #include <linux/mutex.h> |
| 21 | #ifdef CONFIG_BLK_DEV_IDEACPI | ||
| 22 | #include <acpi/acpi.h> | ||
| 23 | #endif | ||
| 24 | #include <asm/byteorder.h> | ||
| 25 | #include <asm/io.h> | ||
| 26 | |||
| 27 | /* for request_sense */ | 21 | /* for request_sense */ |
| 28 | #include <linux/cdrom.h> | 22 | #include <linux/cdrom.h> |
| 23 | #include <asm/byteorder.h> | ||
| 24 | #include <asm/io.h> | ||
| 29 | 25 | ||
| 30 | #if defined(CONFIG_CRIS) || defined(CONFIG_FRV) || defined(CONFIG_MN10300) | 26 | #if defined(CONFIG_CRIS) || defined(CONFIG_FRV) || defined(CONFIG_MN10300) |
| 31 | # define SUPPORT_VLB_SYNC 0 | 27 | # define SUPPORT_VLB_SYNC 0 |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 8c3b26a21574..e526a8cecb70 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
| @@ -1411,8 +1411,12 @@ struct ieee80211_vht_operation { | |||
| 1411 | #define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700 | 1411 | #define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700 |
| 1412 | #define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 | 1412 | #define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 |
| 1413 | #define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 | 1413 | #define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 |
| 1414 | #define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MAX 0x0000e000 | 1414 | #define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT 13 |
| 1415 | #define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MAX 0x00070000 | 1415 | #define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK \ |
| 1416 | (7 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT) | ||
| 1417 | #define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT 16 | ||
| 1418 | #define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK \ | ||
| 1419 | (7 << IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT) | ||
| 1416 | #define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 | 1420 | #define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 |
| 1417 | #define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 | 1421 | #define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 |
| 1418 | #define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000 | 1422 | #define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000 |
| @@ -1853,6 +1857,7 @@ enum ieee80211_key_len { | |||
| 1853 | WLAN_KEY_LEN_CCMP = 16, | 1857 | WLAN_KEY_LEN_CCMP = 16, |
| 1854 | WLAN_KEY_LEN_TKIP = 32, | 1858 | WLAN_KEY_LEN_TKIP = 32, |
| 1855 | WLAN_KEY_LEN_AES_CMAC = 16, | 1859 | WLAN_KEY_LEN_AES_CMAC = 16, |
| 1860 | WLAN_KEY_LEN_SMS4 = 32, | ||
| 1856 | }; | 1861 | }; |
| 1857 | 1862 | ||
| 1858 | #define IEEE80211_WEP_IV_LEN 4 | 1863 | #define IEEE80211_WEP_IV_LEN 4 |
| @@ -1898,6 +1903,7 @@ enum ieee80211_tdls_actioncode { | |||
| 1898 | #define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6) | 1903 | #define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6) |
| 1899 | 1904 | ||
| 1900 | #define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6) | 1905 | #define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6) |
| 1906 | #define WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED BIT(7) | ||
| 1901 | 1907 | ||
| 1902 | /* TDLS specific payload type in the LLC/SNAP header */ | 1908 | /* TDLS specific payload type in the LLC/SNAP header */ |
| 1903 | #define WLAN_TDLS_SNAP_RFTYPE 0x2 | 1909 | #define WLAN_TDLS_SNAP_RFTYPE 0x2 |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 84ba5ac39e03..7c8b20b120ea 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _LINUX_IF_MACVLAN_H | 2 | #define _LINUX_IF_MACVLAN_H |
| 3 | 3 | ||
| 4 | #include <linux/if_link.h> | 4 | #include <linux/if_link.h> |
| 5 | #include <linux/if_vlan.h> | ||
| 5 | #include <linux/list.h> | 6 | #include <linux/list.h> |
| 6 | #include <linux/netdevice.h> | 7 | #include <linux/netdevice.h> |
| 7 | #include <linux/netlink.h> | 8 | #include <linux/netlink.h> |
| @@ -24,28 +25,6 @@ static inline struct socket *macvtap_get_socket(struct file *f) | |||
| 24 | struct macvlan_port; | 25 | struct macvlan_port; |
| 25 | struct macvtap_queue; | 26 | struct macvtap_queue; |
| 26 | 27 | ||
| 27 | /** | ||
| 28 | * struct macvlan_pcpu_stats - MACVLAN percpu stats | ||
| 29 | * @rx_packets: number of received packets | ||
| 30 | * @rx_bytes: number of received bytes | ||
| 31 | * @rx_multicast: number of received multicast packets | ||
| 32 | * @tx_packets: number of transmitted packets | ||
| 33 | * @tx_bytes: number of transmitted bytes | ||
| 34 | * @syncp: synchronization point for 64bit counters | ||
| 35 | * @rx_errors: number of rx errors | ||
| 36 | * @tx_dropped: number of tx dropped packets | ||
| 37 | */ | ||
| 38 | struct macvlan_pcpu_stats { | ||
| 39 | u64 rx_packets; | ||
| 40 | u64 rx_bytes; | ||
| 41 | u64 rx_multicast; | ||
| 42 | u64 tx_packets; | ||
| 43 | u64 tx_bytes; | ||
| 44 | struct u64_stats_sync syncp; | ||
| 45 | u32 rx_errors; | ||
| 46 | u32 tx_dropped; | ||
| 47 | }; | ||
| 48 | |||
| 49 | /* | 28 | /* |
| 50 | * Maximum times a macvtap device can be opened. This can be used to | 29 | * Maximum times a macvtap device can be opened. This can be used to |
| 51 | * configure the number of receive queue, e.g. for multiqueue virtio. | 30 | * configure the number of receive queue, e.g. for multiqueue virtio. |
| @@ -62,15 +41,13 @@ struct macvlan_dev { | |||
| 62 | struct macvlan_port *port; | 41 | struct macvlan_port *port; |
| 63 | struct net_device *lowerdev; | 42 | struct net_device *lowerdev; |
| 64 | void *fwd_priv; | 43 | void *fwd_priv; |
| 65 | struct macvlan_pcpu_stats __percpu *pcpu_stats; | 44 | struct vlan_pcpu_stats __percpu *pcpu_stats; |
| 66 | 45 | ||
| 67 | DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ); | 46 | DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ); |
| 68 | 47 | ||
| 69 | netdev_features_t set_features; | 48 | netdev_features_t set_features; |
| 70 | enum macvlan_mode mode; | 49 | enum macvlan_mode mode; |
| 71 | u16 flags; | 50 | u16 flags; |
| 72 | int (*receive)(struct sk_buff *skb); | ||
| 73 | int (*forward)(struct net_device *dev, struct sk_buff *skb); | ||
| 74 | /* This array tracks active taps. */ | 51 | /* This array tracks active taps. */ |
| 75 | struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES]; | 52 | struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES]; |
| 76 | /* This list tracks all taps (both enabled and disabled) */ | 53 | /* This list tracks all taps (both enabled and disabled) */ |
| @@ -86,7 +63,7 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | |||
| 86 | bool multicast) | 63 | bool multicast) |
| 87 | { | 64 | { |
| 88 | if (likely(success)) { | 65 | if (likely(success)) { |
| 89 | struct macvlan_pcpu_stats *pcpu_stats; | 66 | struct vlan_pcpu_stats *pcpu_stats; |
| 90 | 67 | ||
| 91 | pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); | 68 | pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); |
| 92 | u64_stats_update_begin(&pcpu_stats->syncp); | 69 | u64_stats_update_begin(&pcpu_stats->syncp); |
| @@ -103,10 +80,7 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | |||
| 103 | extern void macvlan_common_setup(struct net_device *dev); | 80 | extern void macvlan_common_setup(struct net_device *dev); |
| 104 | 81 | ||
| 105 | extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, | 82 | extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, |
| 106 | struct nlattr *tb[], struct nlattr *data[], | 83 | struct nlattr *tb[], struct nlattr *data[]); |
| 107 | int (*receive)(struct sk_buff *skb), | ||
| 108 | int (*forward)(struct net_device *dev, | ||
| 109 | struct sk_buff *skb)); | ||
| 110 | 84 | ||
| 111 | extern void macvlan_count_rx(const struct macvlan_dev *vlan, | 85 | extern void macvlan_count_rx(const struct macvlan_dev *vlan, |
| 112 | unsigned int len, bool success, | 86 | unsigned int len, bool success, |
| @@ -116,9 +90,6 @@ extern void macvlan_dellink(struct net_device *dev, struct list_head *head); | |||
| 116 | 90 | ||
| 117 | extern int macvlan_link_register(struct rtnl_link_ops *ops); | 91 | extern int macvlan_link_register(struct rtnl_link_ops *ops); |
| 118 | 92 | ||
| 119 | extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, | ||
| 120 | struct net_device *dev); | ||
| 121 | |||
| 122 | #if IS_ENABLED(CONFIG_MACVLAN) | 93 | #if IS_ENABLED(CONFIG_MACVLAN) |
| 123 | static inline struct net_device * | 94 | static inline struct net_device * |
| 124 | macvlan_dev_real_dev(const struct net_device *dev) | 95 | macvlan_dev_real_dev(const struct net_device *dev) |
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index f4e56ecd0b1a..712710bc0580 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
| @@ -13,13 +13,4 @@ | |||
| 13 | #define for_each_ip_tunnel_rcu(pos, start) \ | 13 | #define for_each_ip_tunnel_rcu(pos, start) \ |
| 14 | for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next)) | 14 | for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next)) |
| 15 | 15 | ||
| 16 | /* often modified stats are per cpu, other are shared (netdev->stats) */ | ||
| 17 | struct pcpu_tstats { | ||
| 18 | u64 rx_packets; | ||
| 19 | u64 rx_bytes; | ||
| 20 | u64 tx_packets; | ||
| 21 | u64 tx_bytes; | ||
| 22 | struct u64_stats_sync syncp; | ||
| 23 | }; | ||
| 24 | |||
| 25 | #endif /* _IF_TUNNEL_H_ */ | 16 | #endif /* _IF_TUNNEL_H_ */ |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index f252deb99454..bbedfb56bd66 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
| @@ -82,25 +82,6 @@ static inline int is_vlan_dev(struct net_device *dev) | |||
| 82 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) | 82 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) |
| 83 | #define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) | 83 | #define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) |
| 84 | 84 | ||
| 85 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | ||
| 86 | |||
| 87 | extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev, | ||
| 88 | __be16 vlan_proto, u16 vlan_id); | ||
| 89 | extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); | ||
| 90 | extern u16 vlan_dev_vlan_id(const struct net_device *dev); | ||
| 91 | |||
| 92 | /** | ||
| 93 | * struct vlan_priority_tci_mapping - vlan egress priority mappings | ||
| 94 | * @priority: skb priority | ||
| 95 | * @vlan_qos: vlan priority: (skb->priority << 13) & 0xE000 | ||
| 96 | * @next: pointer to next struct | ||
| 97 | */ | ||
| 98 | struct vlan_priority_tci_mapping { | ||
| 99 | u32 priority; | ||
| 100 | u16 vlan_qos; | ||
| 101 | struct vlan_priority_tci_mapping *next; | ||
| 102 | }; | ||
| 103 | |||
| 104 | /** | 85 | /** |
| 105 | * struct vlan_pcpu_stats - VLAN percpu rx/tx stats | 86 | * struct vlan_pcpu_stats - VLAN percpu rx/tx stats |
| 106 | * @rx_packets: number of received packets | 87 | * @rx_packets: number of received packets |
| @@ -123,6 +104,25 @@ struct vlan_pcpu_stats { | |||
| 123 | u32 tx_dropped; | 104 | u32 tx_dropped; |
| 124 | }; | 105 | }; |
| 125 | 106 | ||
| 107 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | ||
| 108 | |||
| 109 | extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev, | ||
| 110 | __be16 vlan_proto, u16 vlan_id); | ||
| 111 | extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); | ||
| 112 | extern u16 vlan_dev_vlan_id(const struct net_device *dev); | ||
| 113 | |||
| 114 | /** | ||
| 115 | * struct vlan_priority_tci_mapping - vlan egress priority mappings | ||
| 116 | * @priority: skb priority | ||
| 117 | * @vlan_qos: vlan priority: (skb->priority << 13) & 0xE000 | ||
| 118 | * @next: pointer to next struct | ||
| 119 | */ | ||
| 120 | struct vlan_priority_tci_mapping { | ||
| 121 | u32 priority; | ||
| 122 | u16 vlan_qos; | ||
| 123 | struct vlan_priority_tci_mapping *next; | ||
| 124 | }; | ||
| 125 | |||
| 126 | struct proc_dir_entry; | 126 | struct proc_dir_entry; |
| 127 | struct netpoll; | 127 | struct netpoll; |
| 128 | 128 | ||
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index 15607b45221a..519392763393 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h | |||
| @@ -21,6 +21,8 @@ struct iio_buffer; | |||
| 21 | * struct iio_buffer_access_funcs - access functions for buffers. | 21 | * struct iio_buffer_access_funcs - access functions for buffers. |
| 22 | * @store_to: actually store stuff to the buffer | 22 | * @store_to: actually store stuff to the buffer |
| 23 | * @read_first_n: try to get a specified number of bytes (must exist) | 23 | * @read_first_n: try to get a specified number of bytes (must exist) |
| 24 | * @data_available: indicates whether data for reading from the buffer is | ||
| 25 | * available. | ||
| 24 | * @request_update: if a parameter change has been marked, update underlying | 26 | * @request_update: if a parameter change has been marked, update underlying |
| 25 | * storage. | 27 | * storage. |
| 26 | * @get_bytes_per_datum:get current bytes per datum | 28 | * @get_bytes_per_datum:get current bytes per datum |
| @@ -43,6 +45,7 @@ struct iio_buffer_access_funcs { | |||
| 43 | int (*read_first_n)(struct iio_buffer *buffer, | 45 | int (*read_first_n)(struct iio_buffer *buffer, |
| 44 | size_t n, | 46 | size_t n, |
| 45 | char __user *buf); | 47 | char __user *buf); |
| 48 | bool (*data_available)(struct iio_buffer *buffer); | ||
| 46 | 49 | ||
| 47 | int (*request_update)(struct iio_buffer *buffer); | 50 | int (*request_update)(struct iio_buffer *buffer); |
| 48 | 51 | ||
diff --git a/include/linux/iio/events.h b/include/linux/iio/events.h index 5dab2c41031f..8bbd7bc1043d 100644 --- a/include/linux/iio/events.h +++ b/include/linux/iio/events.h | |||
| @@ -46,10 +46,6 @@ struct iio_event_data { | |||
| 46 | ((u16)chan)) | 46 | ((u16)chan)) |
| 47 | 47 | ||
| 48 | 48 | ||
| 49 | #define IIO_EV_DIR_MAX 4 | ||
| 50 | #define IIO_EV_BIT(type, direction) \ | ||
| 51 | (1 << (type*IIO_EV_DIR_MAX + direction)) | ||
| 52 | |||
| 53 | /** | 49 | /** |
| 54 | * IIO_MOD_EVENT_CODE() - create event identifier for modified channels | 50 | * IIO_MOD_EVENT_CODE() - create event identifier for modified channels |
| 55 | * @chan_type: Type of the channel. Should be one of enum iio_chan_type. | 51 | * @chan_type: Type of the channel. Should be one of enum iio_chan_type. |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 256a90a1bea6..75a8a20c8179 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
| @@ -185,7 +185,6 @@ struct iio_event_spec { | |||
| 185 | * by all channels of the same direction. | 185 | * by all channels of the same direction. |
| 186 | * @info_mask_shared_by_all: What information is to be exported that is shared | 186 | * @info_mask_shared_by_all: What information is to be exported that is shared |
| 187 | * by all channels. | 187 | * by all channels. |
| 188 | * @event_mask: What events can this channel produce. | ||
| 189 | * @event_spec: Array of events which should be registered for this | 188 | * @event_spec: Array of events which should be registered for this |
| 190 | * channel. | 189 | * channel. |
| 191 | * @num_event_specs: Size of the event_spec array. | 190 | * @num_event_specs: Size of the event_spec array. |
| @@ -226,7 +225,6 @@ struct iio_chan_spec { | |||
| 226 | long info_mask_shared_by_type; | 225 | long info_mask_shared_by_type; |
| 227 | long info_mask_shared_by_dir; | 226 | long info_mask_shared_by_dir; |
| 228 | long info_mask_shared_by_all; | 227 | long info_mask_shared_by_all; |
| 229 | long event_mask; | ||
| 230 | const struct iio_event_spec *event_spec; | 228 | const struct iio_event_spec *event_spec; |
| 231 | unsigned int num_event_specs; | 229 | unsigned int num_event_specs; |
| 232 | const struct iio_chan_spec_ext_info *ext_info; | 230 | const struct iio_chan_spec_ext_info *ext_info; |
| @@ -307,16 +305,8 @@ struct iio_dev; | |||
| 307 | * returns IIO_VAL_INT_PLUS_MICRO. | 305 | * returns IIO_VAL_INT_PLUS_MICRO. |
| 308 | * @read_event_config: find out if the event is enabled. | 306 | * @read_event_config: find out if the event is enabled. |
| 309 | * @write_event_config: set if the event is enabled. | 307 | * @write_event_config: set if the event is enabled. |
| 310 | * @read_event_value: read a value associated with the event. Meaning | 308 | * @read_event_value: read a configuration value associated with the event. |
| 311 | * is event dependant. event_code specifies which event. | 309 | * @write_event_value: write a configuration value for the event. |
| 312 | * @write_event_value: write the value associated with the event. | ||
| 313 | * Meaning is event dependent. | ||
| 314 | * @read_event_config_new: find out if the event is enabled. New style interface. | ||
| 315 | * @write_event_config_new: set if the event is enabled. New style interface. | ||
| 316 | * @read_event_value_new: read a configuration value associated with the event. | ||
| 317 | * New style interface. | ||
| 318 | * @write_event_value_new: write a configuration value for the event. New style | ||
| 319 | * interface. | ||
| 320 | * @validate_trigger: function to validate the trigger when the | 310 | * @validate_trigger: function to validate the trigger when the |
| 321 | * current trigger gets changed. | 311 | * current trigger gets changed. |
| 322 | * @update_scan_mode: function to configure device and scan buffer when | 312 | * @update_scan_mode: function to configure device and scan buffer when |
| @@ -345,37 +335,23 @@ struct iio_info { | |||
| 345 | long mask); | 335 | long mask); |
| 346 | 336 | ||
| 347 | int (*read_event_config)(struct iio_dev *indio_dev, | 337 | int (*read_event_config)(struct iio_dev *indio_dev, |
| 348 | u64 event_code); | ||
| 349 | |||
| 350 | int (*write_event_config)(struct iio_dev *indio_dev, | ||
| 351 | u64 event_code, | ||
| 352 | int state); | ||
| 353 | |||
| 354 | int (*read_event_value)(struct iio_dev *indio_dev, | ||
| 355 | u64 event_code, | ||
| 356 | int *val); | ||
| 357 | int (*write_event_value)(struct iio_dev *indio_dev, | ||
| 358 | u64 event_code, | ||
| 359 | int val); | ||
| 360 | |||
| 361 | int (*read_event_config_new)(struct iio_dev *indio_dev, | ||
| 362 | const struct iio_chan_spec *chan, | 338 | const struct iio_chan_spec *chan, |
| 363 | enum iio_event_type type, | 339 | enum iio_event_type type, |
| 364 | enum iio_event_direction dir); | 340 | enum iio_event_direction dir); |
| 365 | 341 | ||
| 366 | int (*write_event_config_new)(struct iio_dev *indio_dev, | 342 | int (*write_event_config)(struct iio_dev *indio_dev, |
| 367 | const struct iio_chan_spec *chan, | 343 | const struct iio_chan_spec *chan, |
| 368 | enum iio_event_type type, | 344 | enum iio_event_type type, |
| 369 | enum iio_event_direction dir, | 345 | enum iio_event_direction dir, |
| 370 | int state); | 346 | int state); |
| 371 | 347 | ||
| 372 | int (*read_event_value_new)(struct iio_dev *indio_dev, | 348 | int (*read_event_value)(struct iio_dev *indio_dev, |
| 373 | const struct iio_chan_spec *chan, | 349 | const struct iio_chan_spec *chan, |
| 374 | enum iio_event_type type, | 350 | enum iio_event_type type, |
| 375 | enum iio_event_direction dir, | 351 | enum iio_event_direction dir, |
| 376 | enum iio_event_info info, int *val, int *val2); | 352 | enum iio_event_info info, int *val, int *val2); |
| 377 | 353 | ||
| 378 | int (*write_event_value_new)(struct iio_dev *indio_dev, | 354 | int (*write_event_value)(struct iio_dev *indio_dev, |
| 379 | const struct iio_chan_spec *chan, | 355 | const struct iio_chan_spec *chan, |
| 380 | enum iio_event_type type, | 356 | enum iio_event_type type, |
| 381 | enum iio_event_direction dir, | 357 | enum iio_event_direction dir, |
| @@ -490,32 +466,12 @@ struct iio_dev { | |||
| 490 | #endif | 466 | #endif |
| 491 | }; | 467 | }; |
| 492 | 468 | ||
| 493 | /** | ||
| 494 | * iio_find_channel_from_si() - get channel from its scan index | ||
| 495 | * @indio_dev: device | ||
| 496 | * @si: scan index to match | ||
| 497 | */ | ||
| 498 | const struct iio_chan_spec | 469 | const struct iio_chan_spec |
| 499 | *iio_find_channel_from_si(struct iio_dev *indio_dev, int si); | 470 | *iio_find_channel_from_si(struct iio_dev *indio_dev, int si); |
| 500 | |||
| 501 | /** | ||
| 502 | * iio_device_register() - register a device with the IIO subsystem | ||
| 503 | * @indio_dev: Device structure filled by the device driver | ||
| 504 | **/ | ||
| 505 | int iio_device_register(struct iio_dev *indio_dev); | 471 | int iio_device_register(struct iio_dev *indio_dev); |
| 506 | |||
| 507 | /** | ||
| 508 | * iio_device_unregister() - unregister a device from the IIO subsystem | ||
| 509 | * @indio_dev: Device structure representing the device. | ||
| 510 | **/ | ||
| 511 | void iio_device_unregister(struct iio_dev *indio_dev); | 472 | void iio_device_unregister(struct iio_dev *indio_dev); |
| 512 | 473 | int devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev); | |
| 513 | /** | 474 | void devm_iio_device_unregister(struct device *dev, struct iio_dev *indio_dev); |
| 514 | * iio_push_event() - try to add event to the list for userspace reading | ||
| 515 | * @indio_dev: IIO device structure | ||
| 516 | * @ev_code: What event | ||
| 517 | * @timestamp: When the event occurred | ||
| 518 | **/ | ||
| 519 | int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp); | 475 | int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp); |
| 520 | 476 | ||
| 521 | extern struct bus_type iio_bus_type; | 477 | extern struct bus_type iio_bus_type; |
| @@ -579,10 +535,6 @@ static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev) | |||
| 579 | 535 | ||
| 580 | /* Can we make this smaller? */ | 536 | /* Can we make this smaller? */ |
| 581 | #define IIO_ALIGN L1_CACHE_BYTES | 537 | #define IIO_ALIGN L1_CACHE_BYTES |
| 582 | /** | ||
| 583 | * iio_device_alloc() - allocate an iio_dev from a driver | ||
| 584 | * @sizeof_priv: Space to allocate for private structure. | ||
| 585 | **/ | ||
| 586 | struct iio_dev *iio_device_alloc(int sizeof_priv); | 538 | struct iio_dev *iio_device_alloc(int sizeof_priv); |
| 587 | 539 | ||
| 588 | static inline void *iio_priv(const struct iio_dev *indio_dev) | 540 | static inline void *iio_priv(const struct iio_dev *indio_dev) |
| @@ -596,64 +548,11 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv) | |||
| 596 | ALIGN(sizeof(struct iio_dev), IIO_ALIGN)); | 548 | ALIGN(sizeof(struct iio_dev), IIO_ALIGN)); |
| 597 | } | 549 | } |
| 598 | 550 | ||
| 599 | /** | ||
| 600 | * iio_device_free() - free an iio_dev from a driver | ||
| 601 | * @indio_dev: the iio_dev associated with the device | ||
| 602 | **/ | ||
| 603 | void iio_device_free(struct iio_dev *indio_dev); | 551 | void iio_device_free(struct iio_dev *indio_dev); |
| 604 | |||
| 605 | /** | ||
| 606 | * devm_iio_device_alloc - Resource-managed iio_device_alloc() | ||
| 607 | * @dev: Device to allocate iio_dev for | ||
| 608 | * @sizeof_priv: Space to allocate for private structure. | ||
| 609 | * | ||
| 610 | * Managed iio_device_alloc. iio_dev allocated with this function is | ||
| 611 | * automatically freed on driver detach. | ||
| 612 | * | ||
| 613 | * If an iio_dev allocated with this function needs to be freed separately, | ||
| 614 | * devm_iio_device_free() must be used. | ||
| 615 | * | ||
| 616 | * RETURNS: | ||
| 617 | * Pointer to allocated iio_dev on success, NULL on failure. | ||
| 618 | */ | ||
| 619 | struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv); | 552 | struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv); |
| 620 | |||
| 621 | /** | ||
| 622 | * devm_iio_device_free - Resource-managed iio_device_free() | ||
| 623 | * @dev: Device this iio_dev belongs to | ||
| 624 | * @indio_dev: the iio_dev associated with the device | ||
| 625 | * | ||
| 626 | * Free iio_dev allocated with devm_iio_device_alloc(). | ||
| 627 | */ | ||
| 628 | void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev); | 553 | void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev); |
| 629 | |||
| 630 | /** | ||
| 631 | * devm_iio_trigger_alloc - Resource-managed iio_trigger_alloc() | ||
| 632 | * @dev: Device to allocate iio_trigger for | ||
| 633 | * @fmt: trigger name format. If it includes format | ||
| 634 | * specifiers, the additional arguments following | ||
| 635 | * format are formatted and inserted in the resulting | ||
| 636 | * string replacing their respective specifiers. | ||
| 637 | * | ||
| 638 | * Managed iio_trigger_alloc. iio_trigger allocated with this function is | ||
| 639 | * automatically freed on driver detach. | ||
| 640 | * | ||
| 641 | * If an iio_trigger allocated with this function needs to be freed separately, | ||
| 642 | * devm_iio_trigger_free() must be used. | ||
| 643 | * | ||
| 644 | * RETURNS: | ||
| 645 | * Pointer to allocated iio_trigger on success, NULL on failure. | ||
| 646 | */ | ||
| 647 | struct iio_trigger *devm_iio_trigger_alloc(struct device *dev, | 554 | struct iio_trigger *devm_iio_trigger_alloc(struct device *dev, |
| 648 | const char *fmt, ...); | 555 | const char *fmt, ...); |
| 649 | |||
| 650 | /** | ||
| 651 | * devm_iio_trigger_free - Resource-managed iio_trigger_free() | ||
| 652 | * @dev: Device this iio_dev belongs to | ||
| 653 | * @iio_trig: the iio_trigger associated with the device | ||
| 654 | * | ||
| 655 | * Free iio_trigger allocated with devm_iio_trigger_alloc(). | ||
| 656 | */ | ||
| 657 | void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig); | 556 | void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig); |
| 658 | 557 | ||
| 659 | /** | 558 | /** |
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 4ac928ee31c5..084d882fe01b 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
| @@ -29,6 +29,7 @@ enum iio_chan_type { | |||
| 29 | IIO_ALTVOLTAGE, | 29 | IIO_ALTVOLTAGE, |
| 30 | IIO_CCT, | 30 | IIO_CCT, |
| 31 | IIO_PRESSURE, | 31 | IIO_PRESSURE, |
| 32 | IIO_HUMIDITYRELATIVE, | ||
| 32 | }; | 33 | }; |
| 33 | 34 | ||
| 34 | enum iio_modifier { | 35 | enum iio_modifier { |
diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h index 2cf55afbcd4e..9a715cfa1fe3 100644 --- a/include/linux/inet_lro.h +++ b/include/linux/inet_lro.h | |||
| @@ -133,33 +133,10 @@ struct net_lro_mgr { | |||
| 133 | void lro_receive_skb(struct net_lro_mgr *lro_mgr, | 133 | void lro_receive_skb(struct net_lro_mgr *lro_mgr, |
| 134 | struct sk_buff *skb, | 134 | struct sk_buff *skb, |
| 135 | void *priv); | 135 | void *priv); |
| 136 | |||
| 137 | /* | ||
| 138 | * Processes a fragment list | ||
| 139 | * | ||
| 140 | * This functions aggregate fragments and generate SKBs do pass | ||
| 141 | * the packets to the stack. | ||
| 142 | * | ||
| 143 | * @lro_mgr: LRO manager to use | ||
| 144 | * @frags: Fragment to be processed. Must contain entire header in first | ||
| 145 | * element. | ||
| 146 | * @len: Length of received data | ||
| 147 | * @true_size: Actual size of memory the fragment is consuming | ||
| 148 | * @priv: Private data that may be used by driver functions | ||
| 149 | * (for example get_tcp_ip_hdr) | ||
| 150 | */ | ||
| 151 | |||
| 152 | void lro_receive_frags(struct net_lro_mgr *lro_mgr, | ||
| 153 | struct skb_frag_struct *frags, | ||
| 154 | int len, int true_size, void *priv, __wsum sum); | ||
| 155 | |||
| 156 | /* | 136 | /* |
| 157 | * Forward all aggregated SKBs held by lro_mgr to network stack | 137 | * Forward all aggregated SKBs held by lro_mgr to network stack |
| 158 | */ | 138 | */ |
| 159 | 139 | ||
| 160 | void lro_flush_all(struct net_lro_mgr *lro_mgr); | 140 | void lro_flush_all(struct net_lro_mgr *lro_mgr); |
| 161 | 141 | ||
| 162 | void lro_flush_pkt(struct net_lro_mgr *lro_mgr, | ||
| 163 | struct iphdr *iph, struct tcphdr *tcph); | ||
| 164 | |||
| 165 | #endif | 142 | #endif |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 0d678aefe69d..0068708161ff 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
| @@ -136,8 +136,8 @@ struct in_ifaddr { | |||
| 136 | __be32 ifa_mask; | 136 | __be32 ifa_mask; |
| 137 | __be32 ifa_broadcast; | 137 | __be32 ifa_broadcast; |
| 138 | unsigned char ifa_scope; | 138 | unsigned char ifa_scope; |
| 139 | unsigned char ifa_flags; | ||
| 140 | unsigned char ifa_prefixlen; | 139 | unsigned char ifa_prefixlen; |
| 140 | __u32 ifa_flags; | ||
| 141 | char ifa_label[IFNAMSIZ]; | 141 | char ifa_label[IFNAMSIZ]; |
| 142 | 142 | ||
| 143 | /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */ | 143 | /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */ |
| @@ -164,11 +164,10 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *); | |||
| 164 | void devinet_init(void); | 164 | void devinet_init(void); |
| 165 | struct in_device *inetdev_by_index(struct net *, int); | 165 | struct in_device *inetdev_by_index(struct net *, int); |
| 166 | __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); | 166 | __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); |
| 167 | __be32 inet_confirm_addr(struct in_device *in_dev, __be32 dst, __be32 local, | 167 | __be32 inet_confirm_addr(struct net *net, struct in_device *in_dev, __be32 dst, |
| 168 | int scope); | 168 | __be32 local, int scope); |
| 169 | struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, | 169 | struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, |
| 170 | __be32 mask); | 170 | __be32 mask); |
| 171 | |||
| 172 | static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) | 171 | static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) |
| 173 | { | 172 | { |
| 174 | return !((addr^ifa->ifa_address)&ifa->ifa_mask); | 173 | return !((addr^ifa->ifa_address)&ifa->ifa_mask); |
| @@ -220,6 +219,13 @@ static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev) | |||
| 220 | return rtnl_dereference(dev->ip_ptr); | 219 | return rtnl_dereference(dev->ip_ptr); |
| 221 | } | 220 | } |
| 222 | 221 | ||
| 222 | static inline struct neigh_parms *__in_dev_arp_parms_get_rcu(const struct net_device *dev) | ||
| 223 | { | ||
| 224 | struct in_device *in_dev = __in_dev_get_rcu(dev); | ||
| 225 | |||
| 226 | return in_dev ? in_dev->arp_parms : NULL; | ||
| 227 | } | ||
| 228 | |||
| 223 | void in_dev_finish_destroy(struct in_device *idev); | 229 | void in_dev_finish_destroy(struct in_device *idev); |
| 224 | 230 | ||
| 225 | static inline void in_dev_put(struct in_device *idev) | 231 | static inline void in_dev_put(struct in_device *idev) |
diff --git a/include/linux/init.h b/include/linux/init.h index 8e68a64bfe00..e1688802964f 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
| @@ -286,9 +286,11 @@ void __init parse_early_options(char *cmdline); | |||
| 286 | #define arch_initcall(fn) module_init(fn) | 286 | #define arch_initcall(fn) module_init(fn) |
| 287 | #define subsys_initcall(fn) module_init(fn) | 287 | #define subsys_initcall(fn) module_init(fn) |
| 288 | #define fs_initcall(fn) module_init(fn) | 288 | #define fs_initcall(fn) module_init(fn) |
| 289 | #define rootfs_initcall(fn) module_init(fn) | ||
| 289 | #define device_initcall(fn) module_init(fn) | 290 | #define device_initcall(fn) module_init(fn) |
| 290 | #define late_initcall(fn) module_init(fn) | 291 | #define late_initcall(fn) module_init(fn) |
| 291 | 292 | ||
| 293 | #define console_initcall(fn) module_init(fn) | ||
| 292 | #define security_initcall(fn) module_init(fn) | 294 | #define security_initcall(fn) module_init(fn) |
| 293 | 295 | ||
| 294 | /* Each module must use one module_init(). */ | 296 | /* Each module must use one module_init(). */ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index b0ed422e4e4a..6df7f9fe0d01 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/user_namespace.h> | 11 | #include <linux/user_namespace.h> |
| 12 | #include <linux/securebits.h> | 12 | #include <linux/securebits.h> |
| 13 | #include <linux/seqlock.h> | 13 | #include <linux/seqlock.h> |
| 14 | #include <linux/rbtree.h> | ||
| 14 | #include <net/net_namespace.h> | 15 | #include <net/net_namespace.h> |
| 15 | #include <linux/sched/rt.h> | 16 | #include <linux/sched/rt.h> |
| 16 | 17 | ||
| @@ -40,6 +41,7 @@ extern struct fs_struct init_fs; | |||
| 40 | 41 | ||
| 41 | #define INIT_SIGNALS(sig) { \ | 42 | #define INIT_SIGNALS(sig) { \ |
| 42 | .nr_threads = 1, \ | 43 | .nr_threads = 1, \ |
| 44 | .thread_head = LIST_HEAD_INIT(init_task.thread_node), \ | ||
| 43 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ | 45 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ |
| 44 | .shared_pending = { \ | 46 | .shared_pending = { \ |
| 45 | .list = LIST_HEAD_INIT(sig.shared_pending.list), \ | 47 | .list = LIST_HEAD_INIT(sig.shared_pending.list), \ |
| @@ -95,7 +97,7 @@ extern struct group_info init_groups; | |||
| 95 | #ifdef CONFIG_AUDITSYSCALL | 97 | #ifdef CONFIG_AUDITSYSCALL |
| 96 | #define INIT_IDS \ | 98 | #define INIT_IDS \ |
| 97 | .loginuid = INVALID_UID, \ | 99 | .loginuid = INVALID_UID, \ |
| 98 | .sessionid = -1, | 100 | .sessionid = (unsigned int)-1, |
| 99 | #else | 101 | #else |
| 100 | #define INIT_IDS | 102 | #define INIT_IDS |
| 101 | #endif | 103 | #endif |
| @@ -154,6 +156,14 @@ extern struct task_group root_task_group; | |||
| 154 | 156 | ||
| 155 | #define INIT_TASK_COMM "swapper" | 157 | #define INIT_TASK_COMM "swapper" |
| 156 | 158 | ||
| 159 | #ifdef CONFIG_RT_MUTEXES | ||
| 160 | # define INIT_RT_MUTEXES(tsk) \ | ||
| 161 | .pi_waiters = RB_ROOT, \ | ||
| 162 | .pi_waiters_leftmost = NULL, | ||
| 163 | #else | ||
| 164 | # define INIT_RT_MUTEXES(tsk) | ||
| 165 | #endif | ||
| 166 | |||
| 157 | /* | 167 | /* |
| 158 | * INIT_TASK is used to set up the first task table, touch at | 168 | * INIT_TASK is used to set up the first task table, touch at |
| 159 | * your own risk!. Base=0, limit=0x1fffff (=2MB) | 169 | * your own risk!. Base=0, limit=0x1fffff (=2MB) |
| @@ -213,6 +223,7 @@ extern struct task_group root_task_group; | |||
| 213 | [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ | 223 | [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ |
| 214 | }, \ | 224 | }, \ |
| 215 | .thread_group = LIST_HEAD_INIT(tsk.thread_group), \ | 225 | .thread_group = LIST_HEAD_INIT(tsk.thread_group), \ |
| 226 | .thread_node = LIST_HEAD_INIT(init_signals.thread_head), \ | ||
| 216 | INIT_IDS \ | 227 | INIT_IDS \ |
| 217 | INIT_PERF_EVENTS(tsk) \ | 228 | INIT_PERF_EVENTS(tsk) \ |
| 218 | INIT_TRACE_IRQFLAGS \ | 229 | INIT_TRACE_IRQFLAGS \ |
| @@ -221,6 +232,7 @@ extern struct task_group root_task_group; | |||
| 221 | INIT_TRACE_RECURSION \ | 232 | INIT_TRACE_RECURSION \ |
| 222 | INIT_TASK_RCU_PREEMPT(tsk) \ | 233 | INIT_TASK_RCU_PREEMPT(tsk) \ |
| 223 | INIT_CPUSET_SEQ(tsk) \ | 234 | INIT_CPUSET_SEQ(tsk) \ |
| 235 | INIT_RT_MUTEXES(tsk) \ | ||
| 224 | INIT_VTIME(tsk) \ | 236 | INIT_VTIME(tsk) \ |
| 225 | } | 237 | } |
| 226 | 238 | ||
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 5d89d1b808a6..2faef339d8f2 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <uapi/linux/ipv6.h> | 4 | #include <uapi/linux/ipv6.h> |
| 5 | 5 | ||
| 6 | #define ipv6_optlen(p) (((p)->hdrlen+1) << 3) | 6 | #define ipv6_optlen(p) (((p)->hdrlen+1) << 3) |
| 7 | #define ipv6_authlen(p) (((p)->hdrlen+2) << 2) | ||
| 7 | /* | 8 | /* |
| 8 | * This structure contains configuration options per IPv6 link. | 9 | * This structure contains configuration options per IPv6 link. |
| 9 | */ | 10 | */ |
| @@ -190,7 +191,8 @@ struct ipv6_pinfo { | |||
| 190 | /* sockopt flags */ | 191 | /* sockopt flags */ |
| 191 | __u16 recverr:1, | 192 | __u16 recverr:1, |
| 192 | sndflow:1, | 193 | sndflow:1, |
| 193 | pmtudisc:2, | 194 | repflow:1, |
| 195 | pmtudisc:3, | ||
| 194 | ipv6only:1, | 196 | ipv6only:1, |
| 195 | srcprefs:3, /* 001: prefer temporary address | 197 | srcprefs:3, /* 001: prefer temporary address |
| 196 | * 010: prefer public address | 198 | * 010: prefer public address |
| @@ -199,7 +201,7 @@ struct ipv6_pinfo { | |||
| 199 | dontfrag:1; | 201 | dontfrag:1; |
| 200 | __u8 min_hopcount; | 202 | __u8 min_hopcount; |
| 201 | __u8 tclass; | 203 | __u8 tclass; |
| 202 | __u8 rcv_tclass; | 204 | __be32 rcv_flowinfo; |
| 203 | 205 | ||
| 204 | __u32 dst_cookie; | 206 | __u32 dst_cookie; |
| 205 | __u32 rx_dst_cookie; | 207 | __u32 rx_dst_cookie; |
| @@ -282,6 +284,8 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to, | |||
| 282 | 284 | ||
| 283 | #define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) | 285 | #define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) |
| 284 | #define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) | 286 | #define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) |
| 287 | #define ipv6_sk_rxinfo(sk) ((sk)->sk_family == PF_INET6 && \ | ||
| 288 | inet6_sk(sk)->rxopt.bits.rxinfo) | ||
| 285 | 289 | ||
| 286 | static inline const struct in6_addr *inet6_rcv_saddr(const struct sock *sk) | 290 | static inline const struct in6_addr *inet6_rcv_saddr(const struct sock *sk) |
| 287 | { | 291 | { |
| @@ -298,6 +302,7 @@ static inline int inet_v6_ipv6only(const struct sock *sk) | |||
| 298 | #else | 302 | #else |
| 299 | #define __ipv6_only_sock(sk) 0 | 303 | #define __ipv6_only_sock(sk) 0 |
| 300 | #define ipv6_only_sock(sk) 0 | 304 | #define ipv6_only_sock(sk) 0 |
| 305 | #define ipv6_sk_rxinfo(sk) 0 | ||
| 301 | 306 | ||
| 302 | static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) | 307 | static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) |
| 303 | { | 308 | { |
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h index cac496b1e279..0ceb389dba6c 100644 --- a/include/linux/irqchip/arm-gic.h +++ b/include/linux/irqchip/arm-gic.h | |||
| @@ -17,6 +17,9 @@ | |||
| 17 | #define GIC_CPU_EOI 0x10 | 17 | #define GIC_CPU_EOI 0x10 |
| 18 | #define GIC_CPU_RUNNINGPRI 0x14 | 18 | #define GIC_CPU_RUNNINGPRI 0x14 |
| 19 | #define GIC_CPU_HIGHPRI 0x18 | 19 | #define GIC_CPU_HIGHPRI 0x18 |
| 20 | #define GIC_CPU_ALIAS_BINPOINT 0x1c | ||
| 21 | #define GIC_CPU_ACTIVEPRIO 0xd0 | ||
| 22 | #define GIC_CPU_IDENT 0xfc | ||
| 20 | 23 | ||
| 21 | #define GIC_DIST_CTRL 0x000 | 24 | #define GIC_DIST_CTRL 0x000 |
| 22 | #define GIC_DIST_CTR 0x004 | 25 | #define GIC_DIST_CTR 0x004 |
| @@ -56,6 +59,15 @@ | |||
| 56 | #define GICH_LR_ACTIVE_BIT (1 << 29) | 59 | #define GICH_LR_ACTIVE_BIT (1 << 29) |
| 57 | #define GICH_LR_EOI (1 << 19) | 60 | #define GICH_LR_EOI (1 << 19) |
| 58 | 61 | ||
| 62 | #define GICH_VMCR_CTRL_SHIFT 0 | ||
| 63 | #define GICH_VMCR_CTRL_MASK (0x21f << GICH_VMCR_CTRL_SHIFT) | ||
| 64 | #define GICH_VMCR_PRIMASK_SHIFT 27 | ||
| 65 | #define GICH_VMCR_PRIMASK_MASK (0x1f << GICH_VMCR_PRIMASK_SHIFT) | ||
| 66 | #define GICH_VMCR_BINPOINT_SHIFT 21 | ||
| 67 | #define GICH_VMCR_BINPOINT_MASK (0x7 << GICH_VMCR_BINPOINT_SHIFT) | ||
| 68 | #define GICH_VMCR_ALIAS_BINPOINT_SHIFT 18 | ||
| 69 | #define GICH_VMCR_ALIAS_BINPOINT_MASK (0x7 << GICH_VMCR_ALIAS_BINPOINT_SHIFT) | ||
| 70 | |||
| 59 | #define GICH_MISR_EOI (1 << 0) | 71 | #define GICH_MISR_EOI (1 << 0) |
| 60 | #define GICH_MISR_U (1 << 1) | 72 | #define GICH_MISR_U (1 << 1) |
| 61 | 73 | ||
diff --git a/include/linux/irqchip/xtensa-mx.h b/include/linux/irqchip/xtensa-mx.h new file mode 100644 index 000000000000..9c3b6ecc8b2f --- /dev/null +++ b/include/linux/irqchip/xtensa-mx.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* | ||
| 2 | * Xtensa MX interrupt distributor | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002 - 2013 Tensilica, Inc. | ||
| 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 __LINUX_IRQCHIP_XTENSA_MX_H | ||
| 12 | #define __LINUX_IRQCHIP_XTENSA_MX_H | ||
| 13 | |||
| 14 | struct device_node; | ||
| 15 | int xtensa_mx_init_legacy(struct device_node *interrupt_parent); | ||
| 16 | |||
| 17 | #endif /* __LINUX_IRQCHIP_XTENSA_MX_H */ | ||
diff --git a/include/linux/irqchip/xtensa-pic.h b/include/linux/irqchip/xtensa-pic.h new file mode 100644 index 000000000000..48718ae5ab68 --- /dev/null +++ b/include/linux/irqchip/xtensa-pic.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /* | ||
| 2 | * Xtensa built-in interrupt controller | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002 - 2013 Tensilica, Inc. | ||
| 5 | * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar | ||
| 6 | * | ||
| 7 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 8 | * License. See the file "COPYING" in the main directory of this archive | ||
| 9 | * for more details. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __LINUX_IRQCHIP_XTENSA_PIC_H | ||
| 13 | #define __LINUX_IRQCHIP_XTENSA_PIC_H | ||
| 14 | |||
| 15 | struct device_node; | ||
| 16 | int xtensa_pic_init_legacy(struct device_node *interrupt_parent); | ||
| 17 | |||
| 18 | #endif /* __LINUX_IRQCHIP_XTENSA_PIC_H */ | ||
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index 56fb646909dc..26e2661d3935 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
| @@ -152,6 +152,14 @@ static inline int irq_balancing_disabled(unsigned int irq) | |||
| 152 | return desc->status_use_accessors & IRQ_NO_BALANCING_MASK; | 152 | return desc->status_use_accessors & IRQ_NO_BALANCING_MASK; |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | static inline int irq_is_percpu(unsigned int irq) | ||
| 156 | { | ||
| 157 | struct irq_desc *desc; | ||
| 158 | |||
| 159 | desc = irq_to_desc(irq); | ||
| 160 | return desc->status_use_accessors & IRQ_PER_CPU; | ||
| 161 | } | ||
| 162 | |||
| 155 | static inline void | 163 | static inline void |
| 156 | irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class) | 164 | irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class) |
| 157 | { | 165 | { |
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h index 714ba08dc092..e374e369fb2f 100644 --- a/include/linux/irqreturn.h +++ b/include/linux/irqreturn.h | |||
| @@ -14,6 +14,6 @@ enum irqreturn { | |||
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | typedef enum irqreturn irqreturn_t; | 16 | typedef enum irqreturn irqreturn_t; |
| 17 | #define IRQ_RETVAL(x) ((x) != IRQ_NONE) | 17 | #define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE) |
| 18 | 18 | ||
| 19 | #endif | 19 | #endif |
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h index 8ba7e5b9d62c..605cc5c333d9 100644 --- a/include/linux/iscsi_ibft.h +++ b/include/linux/iscsi_ibft.h | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | #ifndef ISCSI_IBFT_H | 21 | #ifndef ISCSI_IBFT_H |
| 22 | #define ISCSI_IBFT_H | 22 | #define ISCSI_IBFT_H |
| 23 | 23 | ||
| 24 | #include <acpi/acpi.h> | 24 | #include <linux/acpi.h> |
| 25 | 25 | ||
| 26 | /* | 26 | /* |
| 27 | * Logical location of iSCSI Boot Format Table. | 27 | * Logical location of iSCSI Boot Format Table. |
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 39999775b922..5c1dfb2a9e73 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
| @@ -81,18 +81,21 @@ struct module; | |||
| 81 | #include <linux/atomic.h> | 81 | #include <linux/atomic.h> |
| 82 | #ifdef HAVE_JUMP_LABEL | 82 | #ifdef HAVE_JUMP_LABEL |
| 83 | 83 | ||
| 84 | #define JUMP_LABEL_TRUE_BRANCH 1UL | 84 | #define JUMP_LABEL_TYPE_FALSE_BRANCH 0UL |
| 85 | #define JUMP_LABEL_TYPE_TRUE_BRANCH 1UL | ||
| 86 | #define JUMP_LABEL_TYPE_MASK 1UL | ||
| 85 | 87 | ||
| 86 | static | 88 | static |
| 87 | inline struct jump_entry *jump_label_get_entries(struct static_key *key) | 89 | inline struct jump_entry *jump_label_get_entries(struct static_key *key) |
| 88 | { | 90 | { |
| 89 | return (struct jump_entry *)((unsigned long)key->entries | 91 | return (struct jump_entry *)((unsigned long)key->entries |
| 90 | & ~JUMP_LABEL_TRUE_BRANCH); | 92 | & ~JUMP_LABEL_TYPE_MASK); |
| 91 | } | 93 | } |
| 92 | 94 | ||
| 93 | static inline bool jump_label_get_branch_default(struct static_key *key) | 95 | static inline bool jump_label_get_branch_default(struct static_key *key) |
| 94 | { | 96 | { |
| 95 | if ((unsigned long)key->entries & JUMP_LABEL_TRUE_BRANCH) | 97 | if (((unsigned long)key->entries & JUMP_LABEL_TYPE_MASK) == |
| 98 | JUMP_LABEL_TYPE_TRUE_BRANCH) | ||
| 96 | return true; | 99 | return true; |
| 97 | return false; | 100 | return false; |
| 98 | } | 101 | } |
| @@ -122,10 +125,12 @@ extern void static_key_slow_inc(struct static_key *key); | |||
| 122 | extern void static_key_slow_dec(struct static_key *key); | 125 | extern void static_key_slow_dec(struct static_key *key); |
| 123 | extern void jump_label_apply_nops(struct module *mod); | 126 | extern void jump_label_apply_nops(struct module *mod); |
| 124 | 127 | ||
| 125 | #define STATIC_KEY_INIT_TRUE ((struct static_key) \ | 128 | #define STATIC_KEY_INIT_TRUE ((struct static_key) \ |
| 126 | { .enabled = ATOMIC_INIT(1), .entries = (void *)1 }) | 129 | { .enabled = ATOMIC_INIT(1), \ |
| 127 | #define STATIC_KEY_INIT_FALSE ((struct static_key) \ | 130 | .entries = (void *)JUMP_LABEL_TYPE_TRUE_BRANCH }) |
| 128 | { .enabled = ATOMIC_INIT(0), .entries = (void *)0 }) | 131 | #define STATIC_KEY_INIT_FALSE ((struct static_key) \ |
| 132 | { .enabled = ATOMIC_INIT(0), \ | ||
| 133 | .entries = (void *)JUMP_LABEL_TYPE_FALSE_BRANCH }) | ||
| 129 | 134 | ||
| 130 | #else /* !HAVE_JUMP_LABEL */ | 135 | #else /* !HAVE_JUMP_LABEL */ |
| 131 | 136 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d4e98d13eff4..196d1ea86df0 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -29,6 +29,19 @@ | |||
| 29 | #define ULLONG_MAX (~0ULL) | 29 | #define ULLONG_MAX (~0ULL) |
| 30 | #define SIZE_MAX (~(size_t)0) | 30 | #define SIZE_MAX (~(size_t)0) |
| 31 | 31 | ||
| 32 | #define U8_MAX ((u8)~0U) | ||
| 33 | #define S8_MAX ((s8)(U8_MAX>>1)) | ||
| 34 | #define S8_MIN ((s8)(-S8_MAX - 1)) | ||
| 35 | #define U16_MAX ((u16)~0U) | ||
| 36 | #define S16_MAX ((s16)(U16_MAX>>1)) | ||
| 37 | #define S16_MIN ((s16)(-S16_MAX - 1)) | ||
| 38 | #define U32_MAX ((u32)~0U) | ||
| 39 | #define S32_MAX ((s32)(U32_MAX>>1)) | ||
| 40 | #define S32_MIN ((s32)(-S32_MAX - 1)) | ||
| 41 | #define U64_MAX ((u64)~0ULL) | ||
| 42 | #define S64_MAX ((s64)(U64_MAX>>1)) | ||
| 43 | #define S64_MIN ((s64)(-S64_MAX - 1)) | ||
| 44 | |||
| 32 | #define STACK_MAGIC 0xdeadbeef | 45 | #define STACK_MAGIC 0xdeadbeef |
| 33 | 46 | ||
| 34 | #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) | 47 | #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) |
| @@ -193,7 +206,27 @@ extern int _cond_resched(void); | |||
| 193 | (__x < 0) ? -__x : __x; \ | 206 | (__x < 0) ? -__x : __x; \ |
| 194 | }) | 207 | }) |
| 195 | 208 | ||
| 196 | #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP) | 209 | /** |
| 210 | * reciprocal_scale - "scale" a value into range [0, ep_ro) | ||
| 211 | * @val: value | ||
| 212 | * @ep_ro: right open interval endpoint | ||
| 213 | * | ||
| 214 | * Perform a "reciprocal multiplication" in order to "scale" a value into | ||
| 215 | * range [0, ep_ro), where the upper interval endpoint is right-open. | ||
| 216 | * This is useful, e.g. for accessing a index of an array containing | ||
| 217 | * ep_ro elements, for example. Think of it as sort of modulus, only that | ||
| 218 | * the result isn't that of modulo. ;) Note that if initial input is a | ||
| 219 | * small value, then result will return 0. | ||
| 220 | * | ||
| 221 | * Return: a result based on val in interval [0, ep_ro). | ||
| 222 | */ | ||
| 223 | static inline u32 reciprocal_scale(u32 val, u32 ep_ro) | ||
| 224 | { | ||
| 225 | return (u32)(((u64) val * ep_ro) >> 32); | ||
| 226 | } | ||
| 227 | |||
| 228 | #if defined(CONFIG_MMU) && \ | ||
| 229 | (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)) | ||
| 197 | void might_fault(void); | 230 | void might_fault(void); |
| 198 | #else | 231 | #else |
| 199 | static inline void might_fault(void) { } | 232 | static inline void might_fault(void) { } |
| @@ -393,6 +426,15 @@ extern int panic_on_oops; | |||
| 393 | extern int panic_on_unrecovered_nmi; | 426 | extern int panic_on_unrecovered_nmi; |
| 394 | extern int panic_on_io_nmi; | 427 | extern int panic_on_io_nmi; |
| 395 | extern int sysctl_panic_on_stackoverflow; | 428 | extern int sysctl_panic_on_stackoverflow; |
| 429 | /* | ||
| 430 | * Only to be used by arch init code. If the user over-wrote the default | ||
| 431 | * CONFIG_PANIC_TIMEOUT, honor it. | ||
| 432 | */ | ||
| 433 | static inline void set_arch_panic_timeout(int timeout, int arch_default_timeout) | ||
| 434 | { | ||
| 435 | if (panic_timeout == arch_default_timeout) | ||
| 436 | panic_timeout = timeout; | ||
| 437 | } | ||
| 396 | extern const char *print_tainted(void); | 438 | extern const char *print_tainted(void); |
| 397 | enum lockdep_ok { | 439 | enum lockdep_ok { |
| 398 | LOCKDEP_STILL_OK, | 440 | LOCKDEP_STILL_OK, |
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h new file mode 100644 index 000000000000..5be9f0228a3b --- /dev/null +++ b/include/linux/kernfs.h | |||
| @@ -0,0 +1,376 @@ | |||
| 1 | /* | ||
| 2 | * kernfs.h - pseudo filesystem decoupled from vfs locking | ||
| 3 | * | ||
| 4 | * This file is released under the GPLv2. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef __LINUX_KERNFS_H | ||
| 8 | #define __LINUX_KERNFS_H | ||
| 9 | |||
| 10 | #include <linux/kernel.h> | ||
| 11 | #include <linux/err.h> | ||
| 12 | #include <linux/list.h> | ||
| 13 | #include <linux/mutex.h> | ||
| 14 | #include <linux/idr.h> | ||
| 15 | #include <linux/lockdep.h> | ||
| 16 | #include <linux/rbtree.h> | ||
| 17 | #include <linux/atomic.h> | ||
| 18 | #include <linux/completion.h> | ||
| 19 | |||
| 20 | struct file; | ||
| 21 | struct dentry; | ||
| 22 | struct iattr; | ||
| 23 | struct seq_file; | ||
| 24 | struct vm_area_struct; | ||
| 25 | struct super_block; | ||
| 26 | struct file_system_type; | ||
| 27 | |||
| 28 | struct kernfs_open_node; | ||
| 29 | struct kernfs_iattrs; | ||
| 30 | |||
| 31 | enum kernfs_node_type { | ||
| 32 | KERNFS_DIR = 0x0001, | ||
| 33 | KERNFS_FILE = 0x0002, | ||
| 34 | KERNFS_LINK = 0x0004, | ||
| 35 | }; | ||
| 36 | |||
| 37 | #define KERNFS_TYPE_MASK 0x000f | ||
| 38 | #define KERNFS_ACTIVE_REF KERNFS_FILE | ||
| 39 | #define KERNFS_FLAG_MASK ~KERNFS_TYPE_MASK | ||
| 40 | |||
| 41 | enum kernfs_node_flag { | ||
| 42 | KERNFS_REMOVED = 0x0010, | ||
| 43 | KERNFS_NS = 0x0020, | ||
| 44 | KERNFS_HAS_SEQ_SHOW = 0x0040, | ||
| 45 | KERNFS_HAS_MMAP = 0x0080, | ||
| 46 | KERNFS_LOCKDEP = 0x0100, | ||
| 47 | KERNFS_STATIC_NAME = 0x0200, | ||
| 48 | }; | ||
| 49 | |||
| 50 | /* type-specific structures for kernfs_node union members */ | ||
| 51 | struct kernfs_elem_dir { | ||
| 52 | unsigned long subdirs; | ||
| 53 | /* children rbtree starts here and goes through kn->rb */ | ||
| 54 | struct rb_root children; | ||
| 55 | |||
| 56 | /* | ||
| 57 | * The kernfs hierarchy this directory belongs to. This fits | ||
| 58 | * better directly in kernfs_node but is here to save space. | ||
| 59 | */ | ||
| 60 | struct kernfs_root *root; | ||
| 61 | }; | ||
| 62 | |||
| 63 | struct kernfs_elem_symlink { | ||
| 64 | struct kernfs_node *target_kn; | ||
| 65 | }; | ||
| 66 | |||
| 67 | struct kernfs_elem_attr { | ||
| 68 | const struct kernfs_ops *ops; | ||
| 69 | struct kernfs_open_node *open; | ||
| 70 | loff_t size; | ||
| 71 | }; | ||
| 72 | |||
| 73 | /* | ||
| 74 | * kernfs_node - the building block of kernfs hierarchy. Each and every | ||
| 75 | * kernfs node is represented by single kernfs_node. Most fields are | ||
| 76 | * private to kernfs and shouldn't be accessed directly by kernfs users. | ||
| 77 | * | ||
| 78 | * As long as s_count reference is held, the kernfs_node itself is | ||
| 79 | * accessible. Dereferencing elem or any other outer entity requires | ||
| 80 | * active reference. | ||
| 81 | */ | ||
| 82 | struct kernfs_node { | ||
| 83 | atomic_t count; | ||
| 84 | atomic_t active; | ||
| 85 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 86 | struct lockdep_map dep_map; | ||
| 87 | #endif | ||
| 88 | /* the following two fields are published */ | ||
| 89 | struct kernfs_node *parent; | ||
| 90 | const char *name; | ||
| 91 | |||
| 92 | struct rb_node rb; | ||
| 93 | |||
| 94 | union { | ||
| 95 | struct completion *completion; | ||
| 96 | struct kernfs_node *removed_list; | ||
| 97 | } u; | ||
| 98 | |||
| 99 | const void *ns; /* namespace tag */ | ||
| 100 | unsigned int hash; /* ns + name hash */ | ||
| 101 | union { | ||
| 102 | struct kernfs_elem_dir dir; | ||
| 103 | struct kernfs_elem_symlink symlink; | ||
| 104 | struct kernfs_elem_attr attr; | ||
| 105 | }; | ||
| 106 | |||
| 107 | void *priv; | ||
| 108 | |||
| 109 | unsigned short flags; | ||
| 110 | umode_t mode; | ||
| 111 | unsigned int ino; | ||
| 112 | struct kernfs_iattrs *iattr; | ||
| 113 | }; | ||
| 114 | |||
| 115 | /* | ||
| 116 | * kernfs_dir_ops may be specified on kernfs_create_root() to support | ||
| 117 | * directory manipulation syscalls. These optional callbacks are invoked | ||
| 118 | * on the matching syscalls and can perform any kernfs operations which | ||
| 119 | * don't necessarily have to be the exact operation requested. | ||
| 120 | */ | ||
| 121 | struct kernfs_dir_ops { | ||
| 122 | int (*mkdir)(struct kernfs_node *parent, const char *name, | ||
| 123 | umode_t mode); | ||
| 124 | int (*rmdir)(struct kernfs_node *kn); | ||
| 125 | int (*rename)(struct kernfs_node *kn, struct kernfs_node *new_parent, | ||
| 126 | const char *new_name); | ||
| 127 | }; | ||
| 128 | |||
| 129 | struct kernfs_root { | ||
| 130 | /* published fields */ | ||
| 131 | struct kernfs_node *kn; | ||
| 132 | |||
| 133 | /* private fields, do not use outside kernfs proper */ | ||
| 134 | struct ida ino_ida; | ||
| 135 | struct kernfs_dir_ops *dir_ops; | ||
| 136 | }; | ||
| 137 | |||
| 138 | struct kernfs_open_file { | ||
| 139 | /* published fields */ | ||
| 140 | struct kernfs_node *kn; | ||
| 141 | struct file *file; | ||
| 142 | |||
| 143 | /* private fields, do not use outside kernfs proper */ | ||
| 144 | struct mutex mutex; | ||
| 145 | int event; | ||
| 146 | struct list_head list; | ||
| 147 | |||
| 148 | bool mmapped; | ||
| 149 | const struct vm_operations_struct *vm_ops; | ||
| 150 | }; | ||
| 151 | |||
| 152 | struct kernfs_ops { | ||
| 153 | /* | ||
| 154 | * Read is handled by either seq_file or raw_read(). | ||
| 155 | * | ||
| 156 | * If seq_show() is present, seq_file path is active. Other seq | ||
| 157 | * operations are optional and if not implemented, the behavior is | ||
| 158 | * equivalent to single_open(). @sf->private points to the | ||
| 159 | * associated kernfs_open_file. | ||
| 160 | * | ||
| 161 | * read() is bounced through kernel buffer and a read larger than | ||
| 162 | * PAGE_SIZE results in partial operation of PAGE_SIZE. | ||
| 163 | */ | ||
| 164 | int (*seq_show)(struct seq_file *sf, void *v); | ||
| 165 | |||
| 166 | void *(*seq_start)(struct seq_file *sf, loff_t *ppos); | ||
| 167 | void *(*seq_next)(struct seq_file *sf, void *v, loff_t *ppos); | ||
| 168 | void (*seq_stop)(struct seq_file *sf, void *v); | ||
| 169 | |||
| 170 | ssize_t (*read)(struct kernfs_open_file *of, char *buf, size_t bytes, | ||
| 171 | loff_t off); | ||
| 172 | |||
| 173 | /* | ||
| 174 | * write() is bounced through kernel buffer and a write larger than | ||
| 175 | * PAGE_SIZE results in partial operation of PAGE_SIZE. | ||
| 176 | */ | ||
| 177 | ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t bytes, | ||
| 178 | loff_t off); | ||
| 179 | |||
| 180 | int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma); | ||
| 181 | |||
| 182 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 183 | struct lock_class_key lockdep_key; | ||
| 184 | #endif | ||
| 185 | }; | ||
| 186 | |||
| 187 | #ifdef CONFIG_SYSFS | ||
| 188 | |||
| 189 | static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) | ||
| 190 | { | ||
| 191 | return kn->flags & KERNFS_TYPE_MASK; | ||
| 192 | } | ||
| 193 | |||
| 194 | /** | ||
| 195 | * kernfs_enable_ns - enable namespace under a directory | ||
| 196 | * @kn: directory of interest, should be empty | ||
| 197 | * | ||
| 198 | * This is to be called right after @kn is created to enable namespace | ||
| 199 | * under it. All children of @kn must have non-NULL namespace tags and | ||
| 200 | * only the ones which match the super_block's tag will be visible. | ||
| 201 | */ | ||
| 202 | static inline void kernfs_enable_ns(struct kernfs_node *kn) | ||
| 203 | { | ||
| 204 | WARN_ON_ONCE(kernfs_type(kn) != KERNFS_DIR); | ||
| 205 | WARN_ON_ONCE(!RB_EMPTY_ROOT(&kn->dir.children)); | ||
| 206 | kn->flags |= KERNFS_NS; | ||
| 207 | } | ||
| 208 | |||
| 209 | /** | ||
| 210 | * kernfs_ns_enabled - test whether namespace is enabled | ||
| 211 | * @kn: the node to test | ||
| 212 | * | ||
| 213 | * Test whether namespace filtering is enabled for the children of @ns. | ||
| 214 | */ | ||
| 215 | static inline bool kernfs_ns_enabled(struct kernfs_node *kn) | ||
| 216 | { | ||
| 217 | return kn->flags & KERNFS_NS; | ||
| 218 | } | ||
| 219 | |||
| 220 | struct kernfs_node *kernfs_find_and_get_ns(struct kernfs_node *parent, | ||
| 221 | const char *name, const void *ns); | ||
| 222 | void kernfs_get(struct kernfs_node *kn); | ||
| 223 | void kernfs_put(struct kernfs_node *kn); | ||
| 224 | |||
| 225 | struct kernfs_root *kernfs_create_root(struct kernfs_dir_ops *kdops, | ||
| 226 | void *priv); | ||
| 227 | void kernfs_destroy_root(struct kernfs_root *root); | ||
| 228 | |||
| 229 | struct kernfs_node *kernfs_create_dir_ns(struct kernfs_node *parent, | ||
| 230 | const char *name, umode_t mode, | ||
| 231 | void *priv, const void *ns); | ||
| 232 | struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent, | ||
| 233 | const char *name, | ||
| 234 | umode_t mode, loff_t size, | ||
| 235 | const struct kernfs_ops *ops, | ||
| 236 | void *priv, const void *ns, | ||
| 237 | bool name_is_static, | ||
| 238 | struct lock_class_key *key); | ||
| 239 | struct kernfs_node *kernfs_create_link(struct kernfs_node *parent, | ||
| 240 | const char *name, | ||
| 241 | struct kernfs_node *target); | ||
| 242 | void kernfs_remove(struct kernfs_node *kn); | ||
| 243 | int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name, | ||
| 244 | const void *ns); | ||
| 245 | int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent, | ||
| 246 | const char *new_name, const void *new_ns); | ||
| 247 | int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr); | ||
| 248 | void kernfs_notify(struct kernfs_node *kn); | ||
| 249 | |||
| 250 | const void *kernfs_super_ns(struct super_block *sb); | ||
| 251 | struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, | ||
| 252 | struct kernfs_root *root, const void *ns); | ||
| 253 | void kernfs_kill_sb(struct super_block *sb); | ||
| 254 | |||
| 255 | void kernfs_init(void); | ||
| 256 | |||
| 257 | #else /* CONFIG_SYSFS */ | ||
| 258 | |||
| 259 | static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) | ||
| 260 | { return 0; } /* whatever */ | ||
| 261 | |||
| 262 | static inline void kernfs_enable_ns(struct kernfs_node *kn) { } | ||
| 263 | |||
| 264 | static inline bool kernfs_ns_enabled(struct kernfs_node *kn) | ||
| 265 | { return false; } | ||
| 266 | |||
| 267 | static inline struct kernfs_node * | ||
| 268 | kernfs_find_and_get_ns(struct kernfs_node *parent, const char *name, | ||
| 269 | const void *ns) | ||
| 270 | { return NULL; } | ||
| 271 | |||
| 272 | static inline void kernfs_get(struct kernfs_node *kn) { } | ||
| 273 | static inline void kernfs_put(struct kernfs_node *kn) { } | ||
| 274 | |||
| 275 | static inline struct kernfs_root * | ||
| 276 | kernfs_create_root(struct kernfs_dir_ops *kdops, void *priv) | ||
| 277 | { return ERR_PTR(-ENOSYS); } | ||
| 278 | |||
| 279 | static inline void kernfs_destroy_root(struct kernfs_root *root) { } | ||
| 280 | |||
| 281 | static inline struct kernfs_node * | ||
| 282 | kernfs_create_dir_ns(struct kernfs_node *parent, const char *name, | ||
| 283 | umode_t mode, void *priv, const void *ns) | ||
| 284 | { return ERR_PTR(-ENOSYS); } | ||
| 285 | |||
| 286 | static inline struct kernfs_node * | ||
| 287 | __kernfs_create_file(struct kernfs_node *parent, const char *name, | ||
| 288 | umode_t mode, loff_t size, const struct kernfs_ops *ops, | ||
| 289 | void *priv, const void *ns, bool name_is_static, | ||
| 290 | struct lock_class_key *key) | ||
| 291 | { return ERR_PTR(-ENOSYS); } | ||
| 292 | |||
| 293 | static inline struct kernfs_node * | ||
| 294 | kernfs_create_link(struct kernfs_node *parent, const char *name, | ||
| 295 | struct kernfs_node *target) | ||
| 296 | { return ERR_PTR(-ENOSYS); } | ||
| 297 | |||
| 298 | static inline void kernfs_remove(struct kernfs_node *kn) { } | ||
| 299 | |||
| 300 | static inline int kernfs_remove_by_name_ns(struct kernfs_node *kn, | ||
| 301 | const char *name, const void *ns) | ||
| 302 | { return -ENOSYS; } | ||
| 303 | |||
| 304 | static inline int kernfs_rename_ns(struct kernfs_node *kn, | ||
| 305 | struct kernfs_node *new_parent, | ||
| 306 | const char *new_name, const void *new_ns) | ||
| 307 | { return -ENOSYS; } | ||
| 308 | |||
| 309 | static inline int kernfs_setattr(struct kernfs_node *kn, | ||
| 310 | const struct iattr *iattr) | ||
| 311 | { return -ENOSYS; } | ||
| 312 | |||
| 313 | static inline void kernfs_notify(struct kernfs_node *kn) { } | ||
| 314 | |||
| 315 | static inline const void *kernfs_super_ns(struct super_block *sb) | ||
| 316 | { return NULL; } | ||
| 317 | |||
| 318 | static inline struct dentry * | ||
| 319 | kernfs_mount_ns(struct file_system_type *fs_type, int flags, | ||
| 320 | struct kernfs_root *root, const void *ns) | ||
| 321 | { return ERR_PTR(-ENOSYS); } | ||
| 322 | |||
| 323 | static inline void kernfs_kill_sb(struct super_block *sb) { } | ||
| 324 | |||
| 325 | static inline void kernfs_init(void) { } | ||
| 326 | |||
| 327 | #endif /* CONFIG_SYSFS */ | ||
| 328 | |||
| 329 | static inline struct kernfs_node * | ||
| 330 | kernfs_find_and_get(struct kernfs_node *kn, const char *name) | ||
| 331 | { | ||
| 332 | return kernfs_find_and_get_ns(kn, name, NULL); | ||
| 333 | } | ||
| 334 | |||
| 335 | static inline struct kernfs_node * | ||
| 336 | kernfs_create_dir(struct kernfs_node *parent, const char *name, umode_t mode, | ||
| 337 | void *priv) | ||
| 338 | { | ||
| 339 | return kernfs_create_dir_ns(parent, name, mode, priv, NULL); | ||
| 340 | } | ||
| 341 | |||
| 342 | static inline struct kernfs_node * | ||
| 343 | kernfs_create_file_ns(struct kernfs_node *parent, const char *name, | ||
| 344 | umode_t mode, loff_t size, const struct kernfs_ops *ops, | ||
| 345 | void *priv, const void *ns) | ||
| 346 | { | ||
| 347 | struct lock_class_key *key = NULL; | ||
| 348 | |||
| 349 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 350 | key = (struct lock_class_key *)&ops->lockdep_key; | ||
| 351 | #endif | ||
| 352 | return __kernfs_create_file(parent, name, mode, size, ops, priv, ns, | ||
| 353 | false, key); | ||
| 354 | } | ||
| 355 | |||
| 356 | static inline struct kernfs_node * | ||
| 357 | kernfs_create_file(struct kernfs_node *parent, const char *name, umode_t mode, | ||
| 358 | loff_t size, const struct kernfs_ops *ops, void *priv) | ||
| 359 | { | ||
| 360 | return kernfs_create_file_ns(parent, name, mode, size, ops, priv, NULL); | ||
| 361 | } | ||
| 362 | |||
| 363 | static inline int kernfs_remove_by_name(struct kernfs_node *parent, | ||
| 364 | const char *name) | ||
| 365 | { | ||
| 366 | return kernfs_remove_by_name_ns(parent, name, NULL); | ||
| 367 | } | ||
| 368 | |||
| 369 | static inline struct dentry * | ||
| 370 | kernfs_mount(struct file_system_type *fs_type, int flags, | ||
| 371 | struct kernfs_root *root) | ||
| 372 | { | ||
| 373 | return kernfs_mount_ns(fs_type, flags, root, NULL); | ||
| 374 | } | ||
| 375 | |||
| 376 | #endif /* __LINUX_KERNFS_H */ | ||
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d78d28a733b1..6d4066cdb5b5 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
| @@ -170,6 +170,7 @@ unsigned long paddr_vmcoreinfo_note(void); | |||
| 170 | 170 | ||
| 171 | extern struct kimage *kexec_image; | 171 | extern struct kimage *kexec_image; |
| 172 | extern struct kimage *kexec_crash_image; | 172 | extern struct kimage *kexec_crash_image; |
| 173 | extern int kexec_load_disabled; | ||
| 173 | 174 | ||
| 174 | #ifndef kexec_flush_icache_page | 175 | #ifndef kexec_flush_icache_page |
| 175 | #define kexec_flush_icache_page(page) | 176 | #define kexec_flush_icache_page(page) |
| @@ -198,6 +199,9 @@ extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; | |||
| 198 | extern size_t vmcoreinfo_size; | 199 | extern size_t vmcoreinfo_size; |
| 199 | extern size_t vmcoreinfo_max_size; | 200 | extern size_t vmcoreinfo_max_size; |
| 200 | 201 | ||
| 202 | /* flag to track if kexec reboot is in progress */ | ||
| 203 | extern bool kexec_in_progress; | ||
| 204 | |||
| 201 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, | 205 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, |
| 202 | unsigned long long *crash_size, unsigned long long *crash_base); | 206 | unsigned long long *crash_size, unsigned long long *crash_base); |
| 203 | int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, | 207 | int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, |
diff --git a/include/linux/kobj_completion.h b/include/linux/kobj_completion.h deleted file mode 100644 index a428f6436063..000000000000 --- a/include/linux/kobj_completion.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | #ifndef _KOBJ_COMPLETION_H_ | ||
| 2 | #define _KOBJ_COMPLETION_H_ | ||
| 3 | |||
| 4 | #include <linux/kobject.h> | ||
| 5 | #include <linux/completion.h> | ||
| 6 | |||
| 7 | struct kobj_completion { | ||
| 8 | struct kobject kc_kobj; | ||
| 9 | struct completion kc_unregister; | ||
| 10 | }; | ||
| 11 | |||
| 12 | #define kobj_to_kobj_completion(kobj) \ | ||
| 13 | container_of(kobj, struct kobj_completion, kc_kobj) | ||
| 14 | |||
| 15 | void kobj_completion_init(struct kobj_completion *kc, struct kobj_type *ktype); | ||
| 16 | void kobj_completion_release(struct kobject *kobj); | ||
| 17 | void kobj_completion_del_and_wait(struct kobj_completion *kc); | ||
| 18 | #endif /* _KOBJ_COMPLETION_H_ */ | ||
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index e7ba650086ce..926afb6f6b5f 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
| @@ -64,7 +64,7 @@ struct kobject { | |||
| 64 | struct kobject *parent; | 64 | struct kobject *parent; |
| 65 | struct kset *kset; | 65 | struct kset *kset; |
| 66 | struct kobj_type *ktype; | 66 | struct kobj_type *ktype; |
| 67 | struct sysfs_dirent *sd; | 67 | struct kernfs_node *sd; |
| 68 | struct kref kref; | 68 | struct kref kref; |
| 69 | #ifdef CONFIG_DEBUG_KOBJECT_RELEASE | 69 | #ifdef CONFIG_DEBUG_KOBJECT_RELEASE |
| 70 | struct delayed_work release; | 70 | struct delayed_work release; |
diff --git a/include/linux/ksm.h b/include/linux/ksm.h index 45c9b6a17bcb..3be6bb18562d 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h | |||
| @@ -73,11 +73,7 @@ static inline void set_page_stable_node(struct page *page, | |||
| 73 | struct page *ksm_might_need_to_copy(struct page *page, | 73 | struct page *ksm_might_need_to_copy(struct page *page, |
| 74 | struct vm_area_struct *vma, unsigned long address); | 74 | struct vm_area_struct *vma, unsigned long address); |
| 75 | 75 | ||
| 76 | int page_referenced_ksm(struct page *page, | 76 | int rmap_walk_ksm(struct page *page, struct rmap_walk_control *rwc); |
| 77 | struct mem_cgroup *memcg, unsigned long *vm_flags); | ||
| 78 | int try_to_unmap_ksm(struct page *page, enum ttu_flags flags); | ||
| 79 | int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page *, | ||
| 80 | struct vm_area_struct *, unsigned long, void *), void *arg); | ||
| 81 | void ksm_migrate_page(struct page *newpage, struct page *oldpage); | 77 | void ksm_migrate_page(struct page *newpage, struct page *oldpage); |
| 82 | 78 | ||
| 83 | #else /* !CONFIG_KSM */ | 79 | #else /* !CONFIG_KSM */ |
| @@ -115,13 +111,8 @@ static inline int page_referenced_ksm(struct page *page, | |||
| 115 | return 0; | 111 | return 0; |
| 116 | } | 112 | } |
| 117 | 113 | ||
| 118 | static inline int try_to_unmap_ksm(struct page *page, enum ttu_flags flags) | 114 | static inline int rmap_walk_ksm(struct page *page, |
| 119 | { | 115 | struct rmap_walk_control *rwc) |
| 120 | return 0; | ||
| 121 | } | ||
| 122 | |||
| 123 | static inline int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page*, | ||
| 124 | struct vm_area_struct *, unsigned long, void *), void *arg) | ||
| 125 | { | 116 | { |
| 126 | return 0; | 117 | return 0; |
| 127 | } | 118 | } |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 9523d2ad7535..b8e9a43e501a 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -172,8 +172,6 @@ int kvm_io_bus_write_cookie(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, | |||
| 172 | int len, const void *val, long cookie); | 172 | int len, const void *val, long cookie); |
| 173 | int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, | 173 | int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, |
| 174 | void *val); | 174 | void *val); |
| 175 | int kvm_io_bus_read_cookie(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, | ||
| 176 | int len, void *val, long cookie); | ||
| 177 | int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, | 175 | int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, |
| 178 | int len, struct kvm_io_device *dev); | 176 | int len, struct kvm_io_device *dev); |
| 179 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, | 177 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, |
| @@ -463,8 +461,6 @@ void kvm_exit(void); | |||
| 463 | 461 | ||
| 464 | void kvm_get_kvm(struct kvm *kvm); | 462 | void kvm_get_kvm(struct kvm *kvm); |
| 465 | void kvm_put_kvm(struct kvm *kvm); | 463 | void kvm_put_kvm(struct kvm *kvm); |
| 466 | void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new, | ||
| 467 | u64 last_generation); | ||
| 468 | 464 | ||
| 469 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) | 465 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) |
| 470 | { | 466 | { |
| @@ -537,7 +533,6 @@ unsigned long gfn_to_hva_prot(struct kvm *kvm, gfn_t gfn, bool *writable); | |||
| 537 | unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn); | 533 | unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn); |
| 538 | void kvm_release_page_clean(struct page *page); | 534 | void kvm_release_page_clean(struct page *page); |
| 539 | void kvm_release_page_dirty(struct page *page); | 535 | void kvm_release_page_dirty(struct page *page); |
| 540 | void kvm_set_page_dirty(struct page *page); | ||
| 541 | void kvm_set_page_accessed(struct page *page); | 536 | void kvm_set_page_accessed(struct page *page); |
| 542 | 537 | ||
| 543 | pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); | 538 | pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); |
| @@ -549,7 +544,6 @@ pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault, | |||
| 549 | pfn_t gfn_to_pfn_memslot(struct kvm_memory_slot *slot, gfn_t gfn); | 544 | pfn_t gfn_to_pfn_memslot(struct kvm_memory_slot *slot, gfn_t gfn); |
| 550 | pfn_t gfn_to_pfn_memslot_atomic(struct kvm_memory_slot *slot, gfn_t gfn); | 545 | pfn_t gfn_to_pfn_memslot_atomic(struct kvm_memory_slot *slot, gfn_t gfn); |
| 551 | 546 | ||
| 552 | void kvm_release_pfn_dirty(pfn_t pfn); | ||
| 553 | void kvm_release_pfn_clean(pfn_t pfn); | 547 | void kvm_release_pfn_clean(pfn_t pfn); |
| 554 | void kvm_set_pfn_dirty(pfn_t pfn); | 548 | void kvm_set_pfn_dirty(pfn_t pfn); |
| 555 | void kvm_set_pfn_accessed(pfn_t pfn); | 549 | void kvm_set_pfn_accessed(pfn_t pfn); |
| @@ -576,14 +570,11 @@ struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); | |||
| 576 | int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); | 570 | int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); |
| 577 | unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn); | 571 | unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn); |
| 578 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); | 572 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); |
| 579 | void mark_page_dirty_in_slot(struct kvm *kvm, struct kvm_memory_slot *memslot, | ||
| 580 | gfn_t gfn); | ||
| 581 | 573 | ||
| 582 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); | 574 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); |
| 583 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); | 575 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); |
| 584 | bool kvm_vcpu_yield_to(struct kvm_vcpu *target); | 576 | bool kvm_vcpu_yield_to(struct kvm_vcpu *target); |
| 585 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); | 577 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); |
| 586 | void kvm_resched(struct kvm_vcpu *vcpu); | ||
| 587 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); | 578 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); |
| 588 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); | 579 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); |
| 589 | 580 | ||
| @@ -605,8 +596,6 @@ int kvm_get_dirty_log(struct kvm *kvm, | |||
| 605 | int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, | 596 | int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, |
| 606 | struct kvm_dirty_log *log); | 597 | struct kvm_dirty_log *log); |
| 607 | 598 | ||
| 608 | int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, | ||
| 609 | struct kvm_userspace_memory_region *mem); | ||
| 610 | int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level, | 599 | int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level, |
| 611 | bool line_status); | 600 | bool line_status); |
| 612 | long kvm_arch_vm_ioctl(struct file *filp, | 601 | long kvm_arch_vm_ioctl(struct file *filp, |
| @@ -654,8 +643,6 @@ void kvm_arch_check_processor_compat(void *rtn); | |||
| 654 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); | 643 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); |
| 655 | int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu); | 644 | int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu); |
| 656 | 645 | ||
| 657 | void kvm_free_physmem(struct kvm *kvm); | ||
| 658 | |||
| 659 | void *kvm_kvzalloc(unsigned long size); | 646 | void *kvm_kvzalloc(unsigned long size); |
| 660 | void kvm_kvfree(const void *addr); | 647 | void kvm_kvfree(const void *addr); |
| 661 | 648 | ||
| @@ -1076,6 +1063,7 @@ struct kvm_device *kvm_device_from_filp(struct file *filp); | |||
| 1076 | extern struct kvm_device_ops kvm_mpic_ops; | 1063 | extern struct kvm_device_ops kvm_mpic_ops; |
| 1077 | extern struct kvm_device_ops kvm_xics_ops; | 1064 | extern struct kvm_device_ops kvm_xics_ops; |
| 1078 | extern struct kvm_device_ops kvm_vfio_ops; | 1065 | extern struct kvm_device_ops kvm_vfio_ops; |
| 1066 | extern struct kvm_device_ops kvm_arm_vgic_v2_ops; | ||
| 1079 | 1067 | ||
| 1080 | #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT | 1068 | #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT |
| 1081 | 1069 | ||
| @@ -1097,12 +1085,6 @@ static inline void kvm_vcpu_set_in_spin_loop(struct kvm_vcpu *vcpu, bool val) | |||
| 1097 | static inline void kvm_vcpu_set_dy_eligible(struct kvm_vcpu *vcpu, bool val) | 1085 | static inline void kvm_vcpu_set_dy_eligible(struct kvm_vcpu *vcpu, bool val) |
| 1098 | { | 1086 | { |
| 1099 | } | 1087 | } |
| 1100 | |||
| 1101 | static inline bool kvm_vcpu_eligible_for_directed_yield(struct kvm_vcpu *vcpu) | ||
| 1102 | { | ||
| 1103 | return true; | ||
| 1104 | } | ||
| 1105 | |||
| 1106 | #endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */ | 1088 | #endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */ |
| 1107 | #endif | 1089 | #endif |
| 1108 | 1090 | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index 0e23c26485f4..bec6dbe939a0 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -418,6 +418,9 @@ enum { | |||
| 418 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ | 418 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ |
| 419 | ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ | 419 | ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ |
| 420 | ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */ | 420 | ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */ |
| 421 | ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */ | ||
| 422 | ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */ | ||
| 423 | ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */ | ||
| 421 | 424 | ||
| 422 | /* DMA mask for user DMA control: User visible values; DO NOT | 425 | /* DMA mask for user DMA control: User visible values; DO NOT |
| 423 | renumber */ | 426 | renumber */ |
diff --git a/include/linux/lockref.h b/include/linux/lockref.h index c8929c3832db..4bfde0e99ed5 100644 --- a/include/linux/lockref.h +++ b/include/linux/lockref.h | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | #define USE_CMPXCHG_LOCKREF \ | 20 | #define USE_CMPXCHG_LOCKREF \ |
| 21 | (IS_ENABLED(CONFIG_ARCH_USE_CMPXCHG_LOCKREF) && \ | 21 | (IS_ENABLED(CONFIG_ARCH_USE_CMPXCHG_LOCKREF) && \ |
| 22 | IS_ENABLED(CONFIG_SMP) && !BLOATED_SPINLOCKS) | 22 | IS_ENABLED(CONFIG_SMP) && SPINLOCK_SIZE <= 4) |
| 23 | 23 | ||
| 24 | struct lockref { | 24 | struct lockref { |
| 25 | union { | 25 | union { |
diff --git a/include/linux/math64.h b/include/linux/math64.h index 69ed5f5e9f6e..c45c089bfdac 100644 --- a/include/linux/math64.h +++ b/include/linux/math64.h | |||
| @@ -133,4 +133,34 @@ __iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder) | |||
| 133 | return ret; | 133 | return ret; |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | #if defined(CONFIG_ARCH_SUPPORTS_INT128) && defined(__SIZEOF_INT128__) | ||
| 137 | |||
| 138 | #ifndef mul_u64_u32_shr | ||
| 139 | static inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift) | ||
| 140 | { | ||
| 141 | return (u64)(((unsigned __int128)a * mul) >> shift); | ||
| 142 | } | ||
| 143 | #endif /* mul_u64_u32_shr */ | ||
| 144 | |||
| 145 | #else | ||
| 146 | |||
| 147 | #ifndef mul_u64_u32_shr | ||
| 148 | static inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift) | ||
| 149 | { | ||
| 150 | u32 ah, al; | ||
| 151 | u64 ret; | ||
| 152 | |||
| 153 | al = a; | ||
| 154 | ah = a >> 32; | ||
| 155 | |||
| 156 | ret = ((u64)al * mul) >> shift; | ||
| 157 | if (ah) | ||
| 158 | ret += ((u64)ah * mul) << (32 - shift); | ||
| 159 | |||
| 160 | return ret; | ||
| 161 | } | ||
| 162 | #endif /* mul_u64_u32_shr */ | ||
| 163 | |||
| 164 | #endif | ||
| 165 | |||
| 136 | #endif /* _LINUX_MATH64_H */ | 166 | #endif /* _LINUX_MATH64_H */ |
diff --git a/include/linux/mdio.h b/include/linux/mdio.h index 3d15c838116c..b42963bc81dd 100644 --- a/include/linux/mdio.h +++ b/include/linux/mdio.h | |||
| @@ -70,9 +70,6 @@ extern int mdio45_nway_restart(const struct mdio_if_info *mdio); | |||
| 70 | extern void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio, | 70 | extern void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio, |
| 71 | struct ethtool_cmd *ecmd, | 71 | struct ethtool_cmd *ecmd, |
| 72 | u32 npage_adv, u32 npage_lpa); | 72 | u32 npage_adv, u32 npage_lpa); |
| 73 | extern void | ||
| 74 | mdio45_ethtool_spauseparam_an(const struct mdio_if_info *mdio, | ||
| 75 | const struct ethtool_pauseparam *ecmd); | ||
| 76 | 73 | ||
| 77 | /** | 74 | /** |
| 78 | * mdio45_ethtool_gset - get settings for ETHTOOL_GSET | 75 | * mdio45_ethtool_gset - get settings for ETHTOOL_GSET |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 77c60e52939d..1ef66360f0b0 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
| @@ -19,9 +19,13 @@ | |||
| 19 | 19 | ||
| 20 | #define INIT_MEMBLOCK_REGIONS 128 | 20 | #define INIT_MEMBLOCK_REGIONS 128 |
| 21 | 21 | ||
| 22 | /* Definition of memblock flags. */ | ||
| 23 | #define MEMBLOCK_HOTPLUG 0x1 /* hotpluggable region */ | ||
| 24 | |||
| 22 | struct memblock_region { | 25 | struct memblock_region { |
| 23 | phys_addr_t base; | 26 | phys_addr_t base; |
| 24 | phys_addr_t size; | 27 | phys_addr_t size; |
| 28 | unsigned long flags; | ||
| 25 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 29 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
| 26 | int nid; | 30 | int nid; |
| 27 | #endif | 31 | #endif |
| @@ -43,15 +47,21 @@ struct memblock { | |||
| 43 | 47 | ||
| 44 | extern struct memblock memblock; | 48 | extern struct memblock memblock; |
| 45 | extern int memblock_debug; | 49 | extern int memblock_debug; |
| 50 | #ifdef CONFIG_MOVABLE_NODE | ||
| 51 | /* If movable_node boot option specified */ | ||
| 52 | extern bool movable_node_enabled; | ||
| 53 | #endif /* CONFIG_MOVABLE_NODE */ | ||
| 46 | 54 | ||
| 47 | #define memblock_dbg(fmt, ...) \ | 55 | #define memblock_dbg(fmt, ...) \ |
| 48 | if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 56 | if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
| 49 | 57 | ||
| 50 | phys_addr_t memblock_find_in_range_node(phys_addr_t start, phys_addr_t end, | 58 | phys_addr_t memblock_find_in_range_node(phys_addr_t size, phys_addr_t align, |
| 51 | phys_addr_t size, phys_addr_t align, int nid); | 59 | phys_addr_t start, phys_addr_t end, |
| 60 | int nid); | ||
| 52 | phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end, | 61 | phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end, |
| 53 | phys_addr_t size, phys_addr_t align); | 62 | phys_addr_t size, phys_addr_t align); |
| 54 | phys_addr_t get_allocated_memblock_reserved_regions_info(phys_addr_t *addr); | 63 | phys_addr_t get_allocated_memblock_reserved_regions_info(phys_addr_t *addr); |
| 64 | phys_addr_t get_allocated_memblock_memory_regions_info(phys_addr_t *addr); | ||
| 55 | void memblock_allow_resize(void); | 65 | void memblock_allow_resize(void); |
| 56 | int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid); | 66 | int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid); |
| 57 | int memblock_add(phys_addr_t base, phys_addr_t size); | 67 | int memblock_add(phys_addr_t base, phys_addr_t size); |
| @@ -59,6 +69,28 @@ int memblock_remove(phys_addr_t base, phys_addr_t size); | |||
| 59 | int memblock_free(phys_addr_t base, phys_addr_t size); | 69 | int memblock_free(phys_addr_t base, phys_addr_t size); |
| 60 | int memblock_reserve(phys_addr_t base, phys_addr_t size); | 70 | int memblock_reserve(phys_addr_t base, phys_addr_t size); |
| 61 | void memblock_trim_memory(phys_addr_t align); | 71 | void memblock_trim_memory(phys_addr_t align); |
| 72 | int memblock_mark_hotplug(phys_addr_t base, phys_addr_t size); | ||
| 73 | int memblock_clear_hotplug(phys_addr_t base, phys_addr_t size); | ||
| 74 | #ifdef CONFIG_MOVABLE_NODE | ||
| 75 | static inline bool memblock_is_hotpluggable(struct memblock_region *m) | ||
| 76 | { | ||
| 77 | return m->flags & MEMBLOCK_HOTPLUG; | ||
| 78 | } | ||
| 79 | |||
| 80 | static inline bool movable_node_is_enabled(void) | ||
| 81 | { | ||
| 82 | return movable_node_enabled; | ||
| 83 | } | ||
| 84 | #else | ||
| 85 | static inline bool memblock_is_hotpluggable(struct memblock_region *m) | ||
| 86 | { | ||
| 87 | return false; | ||
| 88 | } | ||
| 89 | static inline bool movable_node_is_enabled(void) | ||
| 90 | { | ||
| 91 | return false; | ||
| 92 | } | ||
| 93 | #endif | ||
| 62 | 94 | ||
| 63 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 95 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
| 64 | int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn, | 96 | int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn, |
| @@ -87,7 +119,7 @@ void __next_free_mem_range(u64 *idx, int nid, phys_addr_t *out_start, | |||
| 87 | /** | 119 | /** |
| 88 | * for_each_free_mem_range - iterate through free memblock areas | 120 | * for_each_free_mem_range - iterate through free memblock areas |
| 89 | * @i: u64 used as loop variable | 121 | * @i: u64 used as loop variable |
| 90 | * @nid: node selector, %MAX_NUMNODES for all nodes | 122 | * @nid: node selector, %NUMA_NO_NODE for all nodes |
| 91 | * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL | 123 | * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL |
| 92 | * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL | 124 | * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL |
| 93 | * @p_nid: ptr to int for nid of the range, can be %NULL | 125 | * @p_nid: ptr to int for nid of the range, can be %NULL |
| @@ -107,7 +139,7 @@ void __next_free_mem_range_rev(u64 *idx, int nid, phys_addr_t *out_start, | |||
| 107 | /** | 139 | /** |
| 108 | * for_each_free_mem_range_reverse - rev-iterate through free memblock areas | 140 | * for_each_free_mem_range_reverse - rev-iterate through free memblock areas |
| 109 | * @i: u64 used as loop variable | 141 | * @i: u64 used as loop variable |
| 110 | * @nid: node selector, %MAX_NUMNODES for all nodes | 142 | * @nid: node selector, %NUMA_NO_NODE for all nodes |
| 111 | * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL | 143 | * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL |
| 112 | * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL | 144 | * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL |
| 113 | * @p_nid: ptr to int for nid of the range, can be %NULL | 145 | * @p_nid: ptr to int for nid of the range, can be %NULL |
| @@ -121,8 +153,21 @@ void __next_free_mem_range_rev(u64 *idx, int nid, phys_addr_t *out_start, | |||
| 121 | i != (u64)ULLONG_MAX; \ | 153 | i != (u64)ULLONG_MAX; \ |
| 122 | __next_free_mem_range_rev(&i, nid, p_start, p_end, p_nid)) | 154 | __next_free_mem_range_rev(&i, nid, p_start, p_end, p_nid)) |
| 123 | 155 | ||
| 156 | static inline void memblock_set_region_flags(struct memblock_region *r, | ||
| 157 | unsigned long flags) | ||
| 158 | { | ||
| 159 | r->flags |= flags; | ||
| 160 | } | ||
| 161 | |||
| 162 | static inline void memblock_clear_region_flags(struct memblock_region *r, | ||
| 163 | unsigned long flags) | ||
| 164 | { | ||
| 165 | r->flags &= ~flags; | ||
| 166 | } | ||
| 167 | |||
| 124 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 168 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
| 125 | int memblock_set_node(phys_addr_t base, phys_addr_t size, int nid); | 169 | int memblock_set_node(phys_addr_t base, phys_addr_t size, |
| 170 | struct memblock_type *type, int nid); | ||
| 126 | 171 | ||
| 127 | static inline void memblock_set_region_node(struct memblock_region *r, int nid) | 172 | static inline void memblock_set_region_node(struct memblock_region *r, int nid) |
| 128 | { | 173 | { |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index b3e7a667e03c..abd0113b6620 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
| @@ -497,10 +497,11 @@ void __memcg_kmem_commit_charge(struct page *page, | |||
| 497 | void __memcg_kmem_uncharge_pages(struct page *page, int order); | 497 | void __memcg_kmem_uncharge_pages(struct page *page, int order); |
| 498 | 498 | ||
| 499 | int memcg_cache_id(struct mem_cgroup *memcg); | 499 | int memcg_cache_id(struct mem_cgroup *memcg); |
| 500 | int memcg_register_cache(struct mem_cgroup *memcg, struct kmem_cache *s, | 500 | int memcg_alloc_cache_params(struct mem_cgroup *memcg, struct kmem_cache *s, |
| 501 | struct kmem_cache *root_cache); | 501 | struct kmem_cache *root_cache); |
| 502 | void memcg_release_cache(struct kmem_cache *cachep); | 502 | void memcg_free_cache_params(struct kmem_cache *s); |
| 503 | void memcg_cache_list_add(struct mem_cgroup *memcg, struct kmem_cache *cachep); | 503 | void memcg_register_cache(struct kmem_cache *s); |
| 504 | void memcg_unregister_cache(struct kmem_cache *s); | ||
| 504 | 505 | ||
| 505 | int memcg_update_cache_size(struct kmem_cache *s, int num_groups); | 506 | int memcg_update_cache_size(struct kmem_cache *s, int num_groups); |
| 506 | void memcg_update_array_size(int num_groups); | 507 | void memcg_update_array_size(int num_groups); |
| @@ -640,19 +641,21 @@ static inline int memcg_cache_id(struct mem_cgroup *memcg) | |||
| 640 | return -1; | 641 | return -1; |
| 641 | } | 642 | } |
| 642 | 643 | ||
| 643 | static inline int | 644 | static inline int memcg_alloc_cache_params(struct mem_cgroup *memcg, |
| 644 | memcg_register_cache(struct mem_cgroup *memcg, struct kmem_cache *s, | 645 | struct kmem_cache *s, struct kmem_cache *root_cache) |
| 645 | struct kmem_cache *root_cache) | ||
| 646 | { | 646 | { |
| 647 | return 0; | 647 | return 0; |
| 648 | } | 648 | } |
| 649 | 649 | ||
| 650 | static inline void memcg_release_cache(struct kmem_cache *cachep) | 650 | static inline void memcg_free_cache_params(struct kmem_cache *s) |
| 651 | { | ||
| 652 | } | ||
| 653 | |||
| 654 | static inline void memcg_register_cache(struct kmem_cache *s) | ||
| 651 | { | 655 | { |
| 652 | } | 656 | } |
| 653 | 657 | ||
| 654 | static inline void memcg_cache_list_add(struct mem_cgroup *memcg, | 658 | static inline void memcg_unregister_cache(struct kmem_cache *s) |
| 655 | struct kmem_cache *s) | ||
| 656 | { | 659 | { |
| 657 | } | 660 | } |
| 658 | 661 | ||
diff --git a/include/linux/memory.h b/include/linux/memory.h index 9a6bbf76452d..bb7384e3c3d8 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
| @@ -35,6 +35,7 @@ struct memory_block { | |||
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | int arch_get_memory_phys_device(unsigned long start_pfn); | 37 | int arch_get_memory_phys_device(unsigned long start_pfn); |
| 38 | unsigned long __weak memory_block_size_bytes(void); | ||
| 38 | 39 | ||
| 39 | /* These states are exposed to userspace as text strings in sysfs */ | 40 | /* These states are exposed to userspace as text strings in sysfs */ |
| 40 | #define MEM_ONLINE (1<<0) /* exposed to userspace */ | 41 | #define MEM_ONLINE (1<<0) /* exposed to userspace */ |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 9fe426b30a41..5f1ea756aace 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
| @@ -211,20 +211,8 @@ static inline void mpol_get(struct mempolicy *pol) | |||
| 211 | { | 211 | { |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | static inline struct mempolicy *mpol_dup(struct mempolicy *old) | ||
| 215 | { | ||
| 216 | return NULL; | ||
| 217 | } | ||
| 218 | |||
| 219 | struct shared_policy {}; | 214 | struct shared_policy {}; |
| 220 | 215 | ||
| 221 | static inline int mpol_set_shared_policy(struct shared_policy *info, | ||
| 222 | struct vm_area_struct *vma, | ||
| 223 | struct mempolicy *new) | ||
| 224 | { | ||
| 225 | return -EINVAL; | ||
| 226 | } | ||
| 227 | |||
| 228 | static inline void mpol_shared_policy_init(struct shared_policy *sp, | 216 | static inline void mpol_shared_policy_init(struct shared_policy *sp, |
| 229 | struct mempolicy *mpol) | 217 | struct mempolicy *mpol) |
| 230 | { | 218 | { |
| @@ -234,12 +222,6 @@ static inline void mpol_free_shared_policy(struct shared_policy *p) | |||
| 234 | { | 222 | { |
| 235 | } | 223 | } |
| 236 | 224 | ||
| 237 | static inline struct mempolicy * | ||
| 238 | mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx) | ||
| 239 | { | ||
| 240 | return NULL; | ||
| 241 | } | ||
| 242 | |||
| 243 | #define vma_policy(vma) NULL | 225 | #define vma_policy(vma) NULL |
| 244 | 226 | ||
| 245 | static inline int | 227 | static inline int |
| @@ -266,10 +248,6 @@ static inline void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new) | |||
| 266 | { | 248 | { |
| 267 | } | 249 | } |
| 268 | 250 | ||
| 269 | static inline void mpol_fix_fork_child_flag(struct task_struct *p) | ||
| 270 | { | ||
| 271 | } | ||
| 272 | |||
| 273 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, | 251 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, |
| 274 | unsigned long addr, gfp_t gfp_flags, | 252 | unsigned long addr, gfp_t gfp_flags, |
| 275 | struct mempolicy **mpol, nodemask_t **nodemask) | 253 | struct mempolicy **mpol, nodemask_t **nodemask) |
| @@ -284,12 +262,6 @@ static inline bool init_nodemask_of_mempolicy(nodemask_t *m) | |||
| 284 | return false; | 262 | return false; |
| 285 | } | 263 | } |
| 286 | 264 | ||
| 287 | static inline bool mempolicy_nodemask_intersects(struct task_struct *tsk, | ||
| 288 | const nodemask_t *mask) | ||
| 289 | { | ||
| 290 | return false; | ||
| 291 | } | ||
| 292 | |||
| 293 | static inline int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, | 265 | static inline int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, |
| 294 | const nodemask_t *to, int flags) | 266 | const nodemask_t *to, int flags) |
| 295 | { | 267 | { |
| @@ -307,10 +279,6 @@ static inline int mpol_parse_str(char *str, struct mempolicy **mpol) | |||
| 307 | } | 279 | } |
| 308 | #endif | 280 | #endif |
| 309 | 281 | ||
| 310 | static inline void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol) | ||
| 311 | { | ||
| 312 | } | ||
| 313 | |||
| 314 | static inline int mpol_misplaced(struct page *page, struct vm_area_struct *vma, | 282 | static inline int mpol_misplaced(struct page *page, struct vm_area_struct *vma, |
| 315 | unsigned long address) | 283 | unsigned long address) |
| 316 | { | 284 | { |
diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h deleted file mode 100644 index 172b2f201ae0..000000000000 --- a/include/linux/mfd/abx500/ab8500-gpio.h +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright ST-Ericsson 2010. | ||
| 3 | * | ||
| 4 | * Author: Bibek Basu <bibek.basu@stericsson.com> | ||
| 5 | * Licensed under GPLv2. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef _AB8500_GPIO_H | ||
| 9 | #define _AB8500_GPIO_H | ||
| 10 | |||
| 11 | /* | ||
| 12 | * Platform data to register a block: only the initial gpio/irq number. | ||
| 13 | * Array sizes are large enough to contain all AB8500 and AB9540 GPIO | ||
| 14 | * registers. | ||
| 15 | */ | ||
| 16 | |||
| 17 | struct abx500_gpio_platform_data { | ||
| 18 | int gpio_base; | ||
| 19 | }; | ||
| 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, | ||
| 31 | }; | ||
| 32 | |||
| 33 | #endif /* _AB8500_GPIO_H */ | ||
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index f4acd898dac9..a86ca1406fb8 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
| @@ -368,7 +368,6 @@ struct ab8500 { | |||
| 368 | }; | 368 | }; |
| 369 | 369 | ||
| 370 | struct ab8500_regulator_platform_data; | 370 | struct ab8500_regulator_platform_data; |
| 371 | struct ab8500_gpio_platform_data; | ||
| 372 | struct ab8500_codec_platform_data; | 371 | struct ab8500_codec_platform_data; |
| 373 | struct ab8500_sysctrl_platform_data; | 372 | struct ab8500_sysctrl_platform_data; |
| 374 | 373 | ||
| @@ -382,7 +381,6 @@ struct ab8500_platform_data { | |||
| 382 | int irq_base; | 381 | int irq_base; |
| 383 | void (*init) (struct ab8500 *); | 382 | void (*init) (struct ab8500 *); |
| 384 | struct ab8500_regulator_platform_data *regulator; | 383 | struct ab8500_regulator_platform_data *regulator; |
| 385 | struct abx500_gpio_platform_data *gpio; | ||
| 386 | struct ab8500_codec_platform_data *codec; | 384 | struct ab8500_codec_platform_data *codec; |
| 387 | struct ab8500_sysctrl_platform_data *sysctrl; | 385 | struct ab8500_sysctrl_platform_data *sysctrl; |
| 388 | }; | 386 | }; |
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h index cb49417f8ba9..fdf3aa376eb2 100644 --- a/include/linux/mfd/arizona/registers.h +++ b/include/linux/mfd/arizona/registers.h | |||
| @@ -139,6 +139,7 @@ | |||
| 139 | #define ARIZONA_INPUT_ENABLES_STATUS 0x301 | 139 | #define ARIZONA_INPUT_ENABLES_STATUS 0x301 |
| 140 | #define ARIZONA_INPUT_RATE 0x308 | 140 | #define ARIZONA_INPUT_RATE 0x308 |
| 141 | #define ARIZONA_INPUT_VOLUME_RAMP 0x309 | 141 | #define ARIZONA_INPUT_VOLUME_RAMP 0x309 |
| 142 | #define ARIZONA_HPF_CONTROL 0x30C | ||
| 142 | #define ARIZONA_IN1L_CONTROL 0x310 | 143 | #define ARIZONA_IN1L_CONTROL 0x310 |
| 143 | #define ARIZONA_ADC_DIGITAL_VOLUME_1L 0x311 | 144 | #define ARIZONA_ADC_DIGITAL_VOLUME_1L 0x311 |
| 144 | #define ARIZONA_DMIC1L_CONTROL 0x312 | 145 | #define ARIZONA_DMIC1L_CONTROL 0x312 |
| @@ -160,6 +161,7 @@ | |||
| 160 | #define ARIZONA_IN4L_CONTROL 0x328 | 161 | #define ARIZONA_IN4L_CONTROL 0x328 |
| 161 | #define ARIZONA_ADC_DIGITAL_VOLUME_4L 0x329 | 162 | #define ARIZONA_ADC_DIGITAL_VOLUME_4L 0x329 |
| 162 | #define ARIZONA_DMIC4L_CONTROL 0x32A | 163 | #define ARIZONA_DMIC4L_CONTROL 0x32A |
| 164 | #define ARIZONA_IN4R_CONTROL 0x32C | ||
| 163 | #define ARIZONA_ADC_DIGITAL_VOLUME_4R 0x32D | 165 | #define ARIZONA_ADC_DIGITAL_VOLUME_4R 0x32D |
| 164 | #define ARIZONA_DMIC4R_CONTROL 0x32E | 166 | #define ARIZONA_DMIC4R_CONTROL 0x32E |
| 165 | #define ARIZONA_OUTPUT_ENABLES_1 0x400 | 167 | #define ARIZONA_OUTPUT_ENABLES_1 0x400 |
| @@ -224,6 +226,9 @@ | |||
| 224 | #define ARIZONA_PDM_SPK1_CTRL_2 0x491 | 226 | #define ARIZONA_PDM_SPK1_CTRL_2 0x491 |
| 225 | #define ARIZONA_PDM_SPK2_CTRL_1 0x492 | 227 | #define ARIZONA_PDM_SPK2_CTRL_1 0x492 |
| 226 | #define ARIZONA_PDM_SPK2_CTRL_2 0x493 | 228 | #define ARIZONA_PDM_SPK2_CTRL_2 0x493 |
| 229 | #define ARIZONA_HP1_SHORT_CIRCUIT_CTRL 0x4A0 | ||
| 230 | #define ARIZONA_HP2_SHORT_CIRCUIT_CTRL 0x4A1 | ||
| 231 | #define ARIZONA_HP3_SHORT_CIRCUIT_CTRL 0x4A2 | ||
| 227 | #define ARIZONA_SPK_CTRL_2 0x4B5 | 232 | #define ARIZONA_SPK_CTRL_2 0x4B5 |
| 228 | #define ARIZONA_SPK_CTRL_3 0x4B6 | 233 | #define ARIZONA_SPK_CTRL_3 0x4B6 |
| 229 | #define ARIZONA_DAC_COMP_1 0x4DC | 234 | #define ARIZONA_DAC_COMP_1 0x4DC |
| @@ -511,6 +516,38 @@ | |||
| 511 | #define ARIZONA_AIF2TX2MIX_INPUT_3_VOLUME 0x74D | 516 | #define ARIZONA_AIF2TX2MIX_INPUT_3_VOLUME 0x74D |
| 512 | #define ARIZONA_AIF2TX2MIX_INPUT_4_SOURCE 0x74E | 517 | #define ARIZONA_AIF2TX2MIX_INPUT_4_SOURCE 0x74E |
| 513 | #define ARIZONA_AIF2TX2MIX_INPUT_4_VOLUME 0x74F | 518 | #define ARIZONA_AIF2TX2MIX_INPUT_4_VOLUME 0x74F |
| 519 | #define ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE 0x750 | ||
| 520 | #define ARIZONA_AIF2TX3MIX_INPUT_1_VOLUME 0x751 | ||
| 521 | #define ARIZONA_AIF2TX3MIX_INPUT_2_SOURCE 0x752 | ||
| 522 | #define ARIZONA_AIF2TX3MIX_INPUT_2_VOLUME 0x753 | ||
| 523 | #define ARIZONA_AIF2TX3MIX_INPUT_3_SOURCE 0x754 | ||
| 524 | #define ARIZONA_AIF2TX3MIX_INPUT_3_VOLUME 0x755 | ||
| 525 | #define ARIZONA_AIF2TX3MIX_INPUT_4_SOURCE 0x756 | ||
| 526 | #define ARIZONA_AIF2TX3MIX_INPUT_4_VOLUME 0x757 | ||
| 527 | #define ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE 0x758 | ||
| 528 | #define ARIZONA_AIF2TX4MIX_INPUT_1_VOLUME 0x759 | ||
| 529 | #define ARIZONA_AIF2TX4MIX_INPUT_2_SOURCE 0x75A | ||
| 530 | #define ARIZONA_AIF2TX4MIX_INPUT_2_VOLUME 0x75B | ||
| 531 | #define ARIZONA_AIF2TX4MIX_INPUT_3_SOURCE 0x75C | ||
| 532 | #define ARIZONA_AIF2TX4MIX_INPUT_3_VOLUME 0x75D | ||
| 533 | #define ARIZONA_AIF2TX4MIX_INPUT_4_SOURCE 0x75E | ||
| 534 | #define ARIZONA_AIF2TX4MIX_INPUT_4_VOLUME 0x75F | ||
| 535 | #define ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE 0x760 | ||
| 536 | #define ARIZONA_AIF2TX5MIX_INPUT_1_VOLUME 0x761 | ||
| 537 | #define ARIZONA_AIF2TX5MIX_INPUT_2_SOURCE 0x762 | ||
| 538 | #define ARIZONA_AIF2TX5MIX_INPUT_2_VOLUME 0x763 | ||
| 539 | #define ARIZONA_AIF2TX5MIX_INPUT_3_SOURCE 0x764 | ||
| 540 | #define ARIZONA_AIF2TX5MIX_INPUT_3_VOLUME 0x765 | ||
| 541 | #define ARIZONA_AIF2TX5MIX_INPUT_4_SOURCE 0x766 | ||
| 542 | #define ARIZONA_AIF2TX5MIX_INPUT_4_VOLUME 0x767 | ||
| 543 | #define ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE 0x768 | ||
| 544 | #define ARIZONA_AIF2TX6MIX_INPUT_1_VOLUME 0x769 | ||
| 545 | #define ARIZONA_AIF2TX6MIX_INPUT_2_SOURCE 0x76A | ||
| 546 | #define ARIZONA_AIF2TX6MIX_INPUT_2_VOLUME 0x76B | ||
| 547 | #define ARIZONA_AIF2TX6MIX_INPUT_3_SOURCE 0x76C | ||
| 548 | #define ARIZONA_AIF2TX6MIX_INPUT_3_VOLUME 0x76D | ||
| 549 | #define ARIZONA_AIF2TX6MIX_INPUT_4_SOURCE 0x76E | ||
| 550 | #define ARIZONA_AIF2TX6MIX_INPUT_4_VOLUME 0x76F | ||
| 514 | #define ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE 0x780 | 551 | #define ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE 0x780 |
| 515 | #define ARIZONA_AIF3TX1MIX_INPUT_1_VOLUME 0x781 | 552 | #define ARIZONA_AIF3TX1MIX_INPUT_1_VOLUME 0x781 |
| 516 | #define ARIZONA_AIF3TX1MIX_INPUT_2_SOURCE 0x782 | 553 | #define ARIZONA_AIF3TX1MIX_INPUT_2_SOURCE 0x782 |
| @@ -2196,6 +2233,15 @@ | |||
| 2196 | /* | 2233 | /* |
| 2197 | * R677 (0x2A5) - Mic Detect 3 | 2234 | * R677 (0x2A5) - Mic Detect 3 |
| 2198 | */ | 2235 | */ |
| 2236 | #define ARIZONA_MICD_LVL_0 0x0004 /* MICD_LVL - [2] */ | ||
| 2237 | #define ARIZONA_MICD_LVL_1 0x0008 /* MICD_LVL - [3] */ | ||
| 2238 | #define ARIZONA_MICD_LVL_2 0x0010 /* MICD_LVL - [4] */ | ||
| 2239 | #define ARIZONA_MICD_LVL_3 0x0020 /* MICD_LVL - [5] */ | ||
| 2240 | #define ARIZONA_MICD_LVL_4 0x0040 /* MICD_LVL - [6] */ | ||
| 2241 | #define ARIZONA_MICD_LVL_5 0x0080 /* MICD_LVL - [7] */ | ||
| 2242 | #define ARIZONA_MICD_LVL_6 0x0100 /* MICD_LVL - [8] */ | ||
| 2243 | #define ARIZONA_MICD_LVL_7 0x0200 /* MICD_LVL - [9] */ | ||
| 2244 | #define ARIZONA_MICD_LVL_8 0x0400 /* MICD_LVL - [10] */ | ||
| 2199 | #define ARIZONA_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */ | 2245 | #define ARIZONA_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */ |
| 2200 | #define ARIZONA_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */ | 2246 | #define ARIZONA_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */ |
| 2201 | #define ARIZONA_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */ | 2247 | #define ARIZONA_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */ |
| @@ -2293,8 +2339,18 @@ | |||
| 2293 | #define ARIZONA_IN_VI_RAMP_WIDTH 3 /* IN_VI_RAMP - [2:0] */ | 2339 | #define ARIZONA_IN_VI_RAMP_WIDTH 3 /* IN_VI_RAMP - [2:0] */ |
| 2294 | 2340 | ||
| 2295 | /* | 2341 | /* |
| 2342 | * R780 (0x30C) - HPF Control | ||
| 2343 | */ | ||
| 2344 | #define ARIZONA_IN_HPF_CUT_MASK 0x0007 /* IN_HPF_CUT [2:0] */ | ||
| 2345 | #define ARIZONA_IN_HPF_CUT_SHIFT 0 /* IN_HPF_CUT [2:0] */ | ||
| 2346 | #define ARIZONA_IN_HPF_CUT_WIDTH 3 /* IN_HPF_CUT [2:0] */ | ||
| 2347 | |||
| 2348 | /* | ||
| 2296 | * R784 (0x310) - IN1L Control | 2349 | * R784 (0x310) - IN1L Control |
| 2297 | */ | 2350 | */ |
| 2351 | #define ARIZONA_IN1L_HPF_MASK 0x8000 /* IN1L_HPF - [15] */ | ||
| 2352 | #define ARIZONA_IN1L_HPF_SHIFT 15 /* IN1L_HPF - [15] */ | ||
| 2353 | #define ARIZONA_IN1L_HPF_WIDTH 1 /* IN1L_HPF - [15] */ | ||
| 2298 | #define ARIZONA_IN1_OSR_MASK 0x6000 /* IN1_OSR - [14:13] */ | 2354 | #define ARIZONA_IN1_OSR_MASK 0x6000 /* IN1_OSR - [14:13] */ |
| 2299 | #define ARIZONA_IN1_OSR_SHIFT 13 /* IN1_OSR - [14:13] */ | 2355 | #define ARIZONA_IN1_OSR_SHIFT 13 /* IN1_OSR - [14:13] */ |
| 2300 | #define ARIZONA_IN1_OSR_WIDTH 2 /* IN1_OSR - [14:13] */ | 2356 | #define ARIZONA_IN1_OSR_WIDTH 2 /* IN1_OSR - [14:13] */ |
| @@ -2333,6 +2389,9 @@ | |||
| 2333 | /* | 2389 | /* |
| 2334 | * R788 (0x314) - IN1R Control | 2390 | * R788 (0x314) - IN1R Control |
| 2335 | */ | 2391 | */ |
| 2392 | #define ARIZONA_IN1R_HPF_MASK 0x8000 /* IN1R_HPF - [15] */ | ||
| 2393 | #define ARIZONA_IN1R_HPF_SHIFT 15 /* IN1R_HPF - [15] */ | ||
| 2394 | #define ARIZONA_IN1R_HPF_WIDTH 1 /* IN1R_HPF - [15] */ | ||
| 2336 | #define ARIZONA_IN1R_PGA_VOL_MASK 0x00FE /* IN1R_PGA_VOL - [7:1] */ | 2395 | #define ARIZONA_IN1R_PGA_VOL_MASK 0x00FE /* IN1R_PGA_VOL - [7:1] */ |
| 2337 | #define ARIZONA_IN1R_PGA_VOL_SHIFT 1 /* IN1R_PGA_VOL - [7:1] */ | 2396 | #define ARIZONA_IN1R_PGA_VOL_SHIFT 1 /* IN1R_PGA_VOL - [7:1] */ |
| 2338 | #define ARIZONA_IN1R_PGA_VOL_WIDTH 7 /* IN1R_PGA_VOL - [7:1] */ | 2397 | #define ARIZONA_IN1R_PGA_VOL_WIDTH 7 /* IN1R_PGA_VOL - [7:1] */ |
| @@ -2362,6 +2421,9 @@ | |||
| 2362 | /* | 2421 | /* |
| 2363 | * R792 (0x318) - IN2L Control | 2422 | * R792 (0x318) - IN2L Control |
| 2364 | */ | 2423 | */ |
| 2424 | #define ARIZONA_IN2L_HPF_MASK 0x8000 /* IN2L_HPF - [15] */ | ||
| 2425 | #define ARIZONA_IN2L_HPF_SHIFT 15 /* IN2L_HPF - [15] */ | ||
| 2426 | #define ARIZONA_IN2L_HPF_WIDTH 1 /* IN2L_HPF - [15] */ | ||
| 2365 | #define ARIZONA_IN2_OSR_MASK 0x6000 /* IN2_OSR - [14:13] */ | 2427 | #define ARIZONA_IN2_OSR_MASK 0x6000 /* IN2_OSR - [14:13] */ |
| 2366 | #define ARIZONA_IN2_OSR_SHIFT 13 /* IN2_OSR - [14:13] */ | 2428 | #define ARIZONA_IN2_OSR_SHIFT 13 /* IN2_OSR - [14:13] */ |
| 2367 | #define ARIZONA_IN2_OSR_WIDTH 2 /* IN2_OSR - [14:13] */ | 2429 | #define ARIZONA_IN2_OSR_WIDTH 2 /* IN2_OSR - [14:13] */ |
| @@ -2400,6 +2462,9 @@ | |||
| 2400 | /* | 2462 | /* |
| 2401 | * R796 (0x31C) - IN2R Control | 2463 | * R796 (0x31C) - IN2R Control |
| 2402 | */ | 2464 | */ |
| 2465 | #define ARIZONA_IN2R_HPF_MASK 0x8000 /* IN2R_HPF - [15] */ | ||
| 2466 | #define ARIZONA_IN2R_HPF_SHIFT 15 /* IN2R_HPF - [15] */ | ||
| 2467 | #define ARIZONA_IN2R_HPF_WIDTH 1 /* IN2R_HPF - [15] */ | ||
| 2403 | #define ARIZONA_IN2R_PGA_VOL_MASK 0x00FE /* IN2R_PGA_VOL - [7:1] */ | 2468 | #define ARIZONA_IN2R_PGA_VOL_MASK 0x00FE /* IN2R_PGA_VOL - [7:1] */ |
| 2404 | #define ARIZONA_IN2R_PGA_VOL_SHIFT 1 /* IN2R_PGA_VOL - [7:1] */ | 2469 | #define ARIZONA_IN2R_PGA_VOL_SHIFT 1 /* IN2R_PGA_VOL - [7:1] */ |
| 2405 | #define ARIZONA_IN2R_PGA_VOL_WIDTH 7 /* IN2R_PGA_VOL - [7:1] */ | 2470 | #define ARIZONA_IN2R_PGA_VOL_WIDTH 7 /* IN2R_PGA_VOL - [7:1] */ |
| @@ -2429,6 +2494,9 @@ | |||
| 2429 | /* | 2494 | /* |
| 2430 | * R800 (0x320) - IN3L Control | 2495 | * R800 (0x320) - IN3L Control |
| 2431 | */ | 2496 | */ |
| 2497 | #define ARIZONA_IN3L_HPF_MASK 0x8000 /* IN3L_HPF - [15] */ | ||
| 2498 | #define ARIZONA_IN3L_HPF_SHIFT 15 /* IN3L_HPF - [15] */ | ||
| 2499 | #define ARIZONA_IN3L_HPF_WIDTH 1 /* IN3L_HPF - [15] */ | ||
| 2432 | #define ARIZONA_IN3_OSR_MASK 0x6000 /* IN3_OSR - [14:13] */ | 2500 | #define ARIZONA_IN3_OSR_MASK 0x6000 /* IN3_OSR - [14:13] */ |
| 2433 | #define ARIZONA_IN3_OSR_SHIFT 13 /* IN3_OSR - [14:13] */ | 2501 | #define ARIZONA_IN3_OSR_SHIFT 13 /* IN3_OSR - [14:13] */ |
| 2434 | #define ARIZONA_IN3_OSR_WIDTH 2 /* IN3_OSR - [14:13] */ | 2502 | #define ARIZONA_IN3_OSR_WIDTH 2 /* IN3_OSR - [14:13] */ |
| @@ -2467,6 +2535,9 @@ | |||
| 2467 | /* | 2535 | /* |
| 2468 | * R804 (0x324) - IN3R Control | 2536 | * R804 (0x324) - IN3R Control |
| 2469 | */ | 2537 | */ |
| 2538 | #define ARIZONA_IN3R_HPF_MASK 0x8000 /* IN3R_HPF - [15] */ | ||
| 2539 | #define ARIZONA_IN3R_HPF_SHIFT 15 /* IN3R_HPF - [15] */ | ||
| 2540 | #define ARIZONA_IN3R_HPF_WIDTH 1 /* IN3R_HPF - [15] */ | ||
| 2470 | #define ARIZONA_IN3R_PGA_VOL_MASK 0x00FE /* IN3R_PGA_VOL - [7:1] */ | 2541 | #define ARIZONA_IN3R_PGA_VOL_MASK 0x00FE /* IN3R_PGA_VOL - [7:1] */ |
| 2471 | #define ARIZONA_IN3R_PGA_VOL_SHIFT 1 /* IN3R_PGA_VOL - [7:1] */ | 2542 | #define ARIZONA_IN3R_PGA_VOL_SHIFT 1 /* IN3R_PGA_VOL - [7:1] */ |
| 2472 | #define ARIZONA_IN3R_PGA_VOL_WIDTH 7 /* IN3R_PGA_VOL - [7:1] */ | 2543 | #define ARIZONA_IN3R_PGA_VOL_WIDTH 7 /* IN3R_PGA_VOL - [7:1] */ |
| @@ -2496,6 +2567,9 @@ | |||
| 2496 | /* | 2567 | /* |
| 2497 | * R808 (0x328) - IN4 Control | 2568 | * R808 (0x328) - IN4 Control |
| 2498 | */ | 2569 | */ |
| 2570 | #define ARIZONA_IN4L_HPF_MASK 0x8000 /* IN4L_HPF - [15] */ | ||
| 2571 | #define ARIZONA_IN4L_HPF_SHIFT 15 /* IN4L_HPF - [15] */ | ||
| 2572 | #define ARIZONA_IN4L_HPF_WIDTH 1 /* IN4L_HPF - [15] */ | ||
| 2499 | #define ARIZONA_IN4_OSR_MASK 0x6000 /* IN4_OSR - [14:13] */ | 2573 | #define ARIZONA_IN4_OSR_MASK 0x6000 /* IN4_OSR - [14:13] */ |
| 2500 | #define ARIZONA_IN4_OSR_SHIFT 13 /* IN4_OSR - [14:13] */ | 2574 | #define ARIZONA_IN4_OSR_SHIFT 13 /* IN4_OSR - [14:13] */ |
| 2501 | #define ARIZONA_IN4_OSR_WIDTH 2 /* IN4_OSR - [14:13] */ | 2575 | #define ARIZONA_IN4_OSR_WIDTH 2 /* IN4_OSR - [14:13] */ |
| @@ -2526,6 +2600,13 @@ | |||
| 2526 | #define ARIZONA_IN4L_DMIC_DLY_WIDTH 6 /* IN4L_DMIC_DLY - [5:0] */ | 2600 | #define ARIZONA_IN4L_DMIC_DLY_WIDTH 6 /* IN4L_DMIC_DLY - [5:0] */ |
| 2527 | 2601 | ||
| 2528 | /* | 2602 | /* |
| 2603 | * R812 (0x32C) - IN4R Control | ||
| 2604 | */ | ||
| 2605 | #define ARIZONA_IN4R_HPF_MASK 0x8000 /* IN4R_HPF - [15] */ | ||
| 2606 | #define ARIZONA_IN4R_HPF_SHIFT 15 /* IN4R_HPF - [15] */ | ||
| 2607 | #define ARIZONA_IN4R_HPF_WIDTH 1 /* IN4R_HPF - [15] */ | ||
| 2608 | |||
| 2609 | /* | ||
| 2529 | * R813 (0x32D) - ADC Digital Volume 4R | 2610 | * R813 (0x32D) - ADC Digital Volume 4R |
| 2530 | */ | 2611 | */ |
| 2531 | #define ARIZONA_IN_VU 0x0200 /* IN_VU */ | 2612 | #define ARIZONA_IN_VU 0x0200 /* IN_VU */ |
| @@ -3138,6 +3219,10 @@ | |||
| 3138 | /* | 3219 | /* |
| 3139 | * R1088 (0x440) - DRE Enable | 3220 | * R1088 (0x440) - DRE Enable |
| 3140 | */ | 3221 | */ |
| 3222 | #define ARIZONA_DRE3R_ENA 0x0020 /* DRE3R_ENA */ | ||
| 3223 | #define ARIZONA_DRE3R_ENA_MASK 0x0020 /* DRE3R_ENA */ | ||
| 3224 | #define ARIZONA_DRE3R_ENA_SHIFT 5 /* DRE3R_ENA */ | ||
| 3225 | #define ARIZONA_DRE3R_ENA_WIDTH 1 /* DRE3R_ENA */ | ||
| 3141 | #define ARIZONA_DRE3L_ENA 0x0010 /* DRE3L_ENA */ | 3226 | #define ARIZONA_DRE3L_ENA 0x0010 /* DRE3L_ENA */ |
| 3142 | #define ARIZONA_DRE3L_ENA_MASK 0x0010 /* DRE3L_ENA */ | 3227 | #define ARIZONA_DRE3L_ENA_MASK 0x0010 /* DRE3L_ENA */ |
| 3143 | #define ARIZONA_DRE3L_ENA_SHIFT 4 /* DRE3L_ENA */ | 3228 | #define ARIZONA_DRE3L_ENA_SHIFT 4 /* DRE3L_ENA */ |
| @@ -3260,6 +3345,30 @@ | |||
| 3260 | #define ARIZONA_SPK2_FMT_WIDTH 1 /* SPK2_FMT */ | 3345 | #define ARIZONA_SPK2_FMT_WIDTH 1 /* SPK2_FMT */ |
| 3261 | 3346 | ||
| 3262 | /* | 3347 | /* |
| 3348 | * R1184 (0x4A0) - HP1 Short Circuit Ctrl | ||
| 3349 | */ | ||
| 3350 | #define ARIZONA_HP1_SC_ENA 0x1000 /* HP1_SC_ENA */ | ||
| 3351 | #define ARIZONA_HP1_SC_ENA_MASK 0x1000 /* HP1_SC_ENA */ | ||
| 3352 | #define ARIZONA_HP1_SC_ENA_SHIFT 12 /* HP1_SC_ENA */ | ||
| 3353 | #define ARIZONA_HP1_SC_ENA_WIDTH 1 /* HP1_SC_ENA */ | ||
| 3354 | |||
| 3355 | /* | ||
| 3356 | * R1185 (0x4A1) - HP2 Short Circuit Ctrl | ||
| 3357 | */ | ||
| 3358 | #define ARIZONA_HP2_SC_ENA 0x1000 /* HP2_SC_ENA */ | ||
| 3359 | #define ARIZONA_HP2_SC_ENA_MASK 0x1000 /* HP2_SC_ENA */ | ||
| 3360 | #define ARIZONA_HP2_SC_ENA_SHIFT 12 /* HP2_SC_ENA */ | ||
| 3361 | #define ARIZONA_HP2_SC_ENA_WIDTH 1 /* HP2_SC_ENA */ | ||
| 3362 | |||
| 3363 | /* | ||
| 3364 | * R1186 (0x4A2) - HP3 Short Circuit Ctrl | ||
| 3365 | */ | ||
| 3366 | #define ARIZONA_HP3_SC_ENA 0x1000 /* HP3_SC_ENA */ | ||
| 3367 | #define ARIZONA_HP3_SC_ENA_MASK 0x1000 /* HP3_SC_ENA */ | ||
| 3368 | #define ARIZONA_HP3_SC_ENA_SHIFT 12 /* HP3_SC_ENA */ | ||
| 3369 | #define ARIZONA_HP3_SC_ENA_WIDTH 1 /* HP3_SC_ENA */ | ||
| 3370 | |||
| 3371 | /* | ||
| 3263 | * R1244 (0x4DC) - DAC comp 1 | 3372 | * R1244 (0x4DC) - DAC comp 1 |
| 3264 | */ | 3373 | */ |
| 3265 | #define ARIZONA_OUT_COMP_COEFF_MASK 0xFFFF /* OUT_COMP_COEFF - [15:0] */ | 3374 | #define ARIZONA_OUT_COMP_COEFF_MASK 0xFFFF /* OUT_COMP_COEFF - [15:0] */ |
| @@ -3726,6 +3835,35 @@ | |||
| 3726 | #define ARIZONA_AIF2TX2_SLOT_WIDTH 6 /* AIF2TX2_SLOT - [5:0] */ | 3835 | #define ARIZONA_AIF2TX2_SLOT_WIDTH 6 /* AIF2TX2_SLOT - [5:0] */ |
| 3727 | 3836 | ||
| 3728 | /* | 3837 | /* |
| 3838 | * R1355 (0x54B) - AIF2 Frame Ctrl 5 | ||
| 3839 | */ | ||
| 3840 | #define ARIZONA_AIF2TX3_SLOT_MASK 0x003F /* AIF2TX3_SLOT - [5:0] */ | ||
| 3841 | #define ARIZONA_AIF2TX3_SLOT_SHIFT 0 /* AIF2TX3_SLOT - [5:0] */ | ||
| 3842 | #define ARIZONA_AIF2TX3_SLOT_WIDTH 6 /* AIF2TX3_SLOT - [5:0] */ | ||
| 3843 | |||
| 3844 | /* | ||
| 3845 | * R1356 (0x54C) - AIF2 Frame Ctrl 6 | ||
| 3846 | */ | ||
| 3847 | #define ARIZONA_AIF2TX4_SLOT_MASK 0x003F /* AIF2TX4_SLOT - [5:0] */ | ||
| 3848 | #define ARIZONA_AIF2TX4_SLOT_SHIFT 0 /* AIF2TX4_SLOT - [5:0] */ | ||
| 3849 | #define ARIZONA_AIF2TX4_SLOT_WIDTH 6 /* AIF2TX4_SLOT - [5:0] */ | ||
| 3850 | |||
| 3851 | |||
| 3852 | /* | ||
| 3853 | * R1357 (0x54D) - AIF2 Frame Ctrl 7 | ||
| 3854 | */ | ||
| 3855 | #define ARIZONA_AIF2TX5_SLOT_MASK 0x003F /* AIF2TX5_SLOT - [5:0] */ | ||
| 3856 | #define ARIZONA_AIF2TX5_SLOT_SHIFT 0 /* AIF2TX5_SLOT - [5:0] */ | ||
| 3857 | #define ARIZONA_AIF2TX5_SLOT_WIDTH 6 /* AIF2TX5_SLOT - [5:0] */ | ||
| 3858 | |||
| 3859 | /* | ||
| 3860 | * R1358 (0x54E) - AIF2 Frame Ctrl 8 | ||
| 3861 | */ | ||
| 3862 | #define ARIZONA_AIF2TX6_SLOT_MASK 0x003F /* AIF2TX6_SLOT - [5:0] */ | ||
| 3863 | #define ARIZONA_AIF2TX6_SLOT_SHIFT 0 /* AIF2TX6_SLOT - [5:0] */ | ||
| 3864 | #define ARIZONA_AIF2TX6_SLOT_WIDTH 6 /* AIF2TX6_SLOT - [5:0] */ | ||
| 3865 | |||
| 3866 | /* | ||
| 3729 | * R1361 (0x551) - AIF2 Frame Ctrl 11 | 3867 | * R1361 (0x551) - AIF2 Frame Ctrl 11 |
| 3730 | */ | 3868 | */ |
| 3731 | #define ARIZONA_AIF2RX1_SLOT_MASK 0x003F /* AIF2RX1_SLOT - [5:0] */ | 3869 | #define ARIZONA_AIF2RX1_SLOT_MASK 0x003F /* AIF2RX1_SLOT - [5:0] */ |
| @@ -3740,8 +3878,52 @@ | |||
| 3740 | #define ARIZONA_AIF2RX2_SLOT_WIDTH 6 /* AIF2RX2_SLOT - [5:0] */ | 3878 | #define ARIZONA_AIF2RX2_SLOT_WIDTH 6 /* AIF2RX2_SLOT - [5:0] */ |
| 3741 | 3879 | ||
| 3742 | /* | 3880 | /* |
| 3881 | * R1363 (0x553) - AIF2 Frame Ctrl 13 | ||
| 3882 | */ | ||
| 3883 | #define ARIZONA_AIF2RX3_SLOT_MASK 0x003F /* AIF2RX3_SLOT - [5:0] */ | ||
| 3884 | #define ARIZONA_AIF2RX3_SLOT_SHIFT 0 /* AIF2RX3_SLOT - [5:0] */ | ||
| 3885 | #define ARIZONA_AIF2RX3_SLOT_WIDTH 6 /* AIF2RX3_SLOT - [5:0] */ | ||
| 3886 | |||
| 3887 | /* | ||
| 3888 | * R1364 (0x554) - AIF2 Frame Ctrl 14 | ||
| 3889 | */ | ||
| 3890 | #define ARIZONA_AIF2RX4_SLOT_MASK 0x003F /* AIF2RX4_SLOT - [5:0] */ | ||
| 3891 | #define ARIZONA_AIF2RX4_SLOT_SHIFT 0 /* AIF2RX4_SLOT - [5:0] */ | ||
| 3892 | #define ARIZONA_AIF2RX4_SLOT_WIDTH 6 /* AIF2RX4_SLOT - [5:0] */ | ||
| 3893 | |||
| 3894 | /* | ||
| 3895 | * R1365 (0x555) - AIF2 Frame Ctrl 15 | ||
| 3896 | */ | ||
| 3897 | #define ARIZONA_AIF2RX5_SLOT_MASK 0x003F /* AIF2RX5_SLOT - [5:0] */ | ||
| 3898 | #define ARIZONA_AIF2RX5_SLOT_SHIFT 0 /* AIF2RX5_SLOT - [5:0] */ | ||
| 3899 | #define ARIZONA_AIF2RX5_SLOT_WIDTH 6 /* AIF2RX5_SLOT - [5:0] */ | ||
| 3900 | |||
| 3901 | /* | ||
| 3902 | * R1366 (0x556) - AIF2 Frame Ctrl 16 | ||
| 3903 | */ | ||
| 3904 | #define ARIZONA_AIF2RX6_SLOT_MASK 0x003F /* AIF2RX6_SLOT - [5:0] */ | ||
| 3905 | #define ARIZONA_AIF2RX6_SLOT_SHIFT 0 /* AIF2RX6_SLOT - [5:0] */ | ||
| 3906 | #define ARIZONA_AIF2RX6_SLOT_WIDTH 6 /* AIF2RX6_SLOT - [5:0] */ | ||
| 3907 | |||
| 3908 | /* | ||
| 3743 | * R1369 (0x559) - AIF2 Tx Enables | 3909 | * R1369 (0x559) - AIF2 Tx Enables |
| 3744 | */ | 3910 | */ |
| 3911 | #define ARIZONA_AIF2TX6_ENA 0x0020 /* AIF2TX6_ENA */ | ||
| 3912 | #define ARIZONA_AIF2TX6_ENA_MASK 0x0020 /* AIF2TX6_ENA */ | ||
| 3913 | #define ARIZONA_AIF2TX6_ENA_SHIFT 5 /* AIF2TX6_ENA */ | ||
| 3914 | #define ARIZONA_AIF2TX6_ENA_WIDTH 1 /* AIF2TX6_ENA */ | ||
| 3915 | #define ARIZONA_AIF2TX5_ENA 0x0010 /* AIF2TX5_ENA */ | ||
| 3916 | #define ARIZONA_AIF2TX5_ENA_MASK 0x0010 /* AIF2TX5_ENA */ | ||
| 3917 | #define ARIZONA_AIF2TX5_ENA_SHIFT 4 /* AIF2TX5_ENA */ | ||
| 3918 | #define ARIZONA_AIF2TX5_ENA_WIDTH 1 /* AIF2TX5_ENA */ | ||
| 3919 | #define ARIZONA_AIF2TX4_ENA 0x0008 /* AIF2TX4_ENA */ | ||
| 3920 | #define ARIZONA_AIF2TX4_ENA_MASK 0x0008 /* AIF2TX4_ENA */ | ||
| 3921 | #define ARIZONA_AIF2TX4_ENA_SHIFT 3 /* AIF2TX4_ENA */ | ||
| 3922 | #define ARIZONA_AIF2TX4_ENA_WIDTH 1 /* AIF2TX4_ENA */ | ||
| 3923 | #define ARIZONA_AIF2TX3_ENA 0x0004 /* AIF2TX3_ENA */ | ||
| 3924 | #define ARIZONA_AIF2TX3_ENA_MASK 0x0004 /* AIF2TX3_ENA */ | ||
| 3925 | #define ARIZONA_AIF2TX3_ENA_SHIFT 2 /* AIF2TX3_ENA */ | ||
| 3926 | #define ARIZONA_AIF2TX3_ENA_WIDTH 1 /* AIF2TX3_ENA */ | ||
| 3745 | #define ARIZONA_AIF2TX2_ENA 0x0002 /* AIF2TX2_ENA */ | 3927 | #define ARIZONA_AIF2TX2_ENA 0x0002 /* AIF2TX2_ENA */ |
| 3746 | #define ARIZONA_AIF2TX2_ENA_MASK 0x0002 /* AIF2TX2_ENA */ | 3928 | #define ARIZONA_AIF2TX2_ENA_MASK 0x0002 /* AIF2TX2_ENA */ |
| 3747 | #define ARIZONA_AIF2TX2_ENA_SHIFT 1 /* AIF2TX2_ENA */ | 3929 | #define ARIZONA_AIF2TX2_ENA_SHIFT 1 /* AIF2TX2_ENA */ |
| @@ -3754,6 +3936,22 @@ | |||
| 3754 | /* | 3936 | /* |
| 3755 | * R1370 (0x55A) - AIF2 Rx Enables | 3937 | * R1370 (0x55A) - AIF2 Rx Enables |
| 3756 | */ | 3938 | */ |
| 3939 | #define ARIZONA_AIF2RX6_ENA 0x0020 /* AIF2RX6_ENA */ | ||
| 3940 | #define ARIZONA_AIF2RX6_ENA_MASK 0x0020 /* AIF2RX6_ENA */ | ||
| 3941 | #define ARIZONA_AIF2RX6_ENA_SHIFT 5 /* AIF2RX6_ENA */ | ||
| 3942 | #define ARIZONA_AIF2RX6_ENA_WIDTH 1 /* AIF2RX6_ENA */ | ||
| 3943 | #define ARIZONA_AIF2RX5_ENA 0x0010 /* AIF2RX5_ENA */ | ||
| 3944 | #define ARIZONA_AIF2RX5_ENA_MASK 0x0010 /* AIF2RX5_ENA */ | ||
| 3945 | #define ARIZONA_AIF2RX5_ENA_SHIFT 4 /* AIF2RX5_ENA */ | ||
| 3946 | #define ARIZONA_AIF2RX5_ENA_WIDTH 1 /* AIF2RX5_ENA */ | ||
| 3947 | #define ARIZONA_AIF2RX4_ENA 0x0008 /* AIF2RX4_ENA */ | ||
| 3948 | #define ARIZONA_AIF2RX4_ENA_MASK 0x0008 /* AIF2RX4_ENA */ | ||
| 3949 | #define ARIZONA_AIF2RX4_ENA_SHIFT 3 /* AIF2RX4_ENA */ | ||
| 3950 | #define ARIZONA_AIF2RX4_ENA_WIDTH 1 /* AIF2RX4_ENA */ | ||
| 3951 | #define ARIZONA_AIF2RX3_ENA 0x0004 /* AIF2RX3_ENA */ | ||
| 3952 | #define ARIZONA_AIF2RX3_ENA_MASK 0x0004 /* AIF2RX3_ENA */ | ||
| 3953 | #define ARIZONA_AIF2RX3_ENA_SHIFT 2 /* AIF2RX3_ENA */ | ||
| 3954 | #define ARIZONA_AIF2RX3_ENA_WIDTH 1 /* AIF2RX3_ENA */ | ||
| 3757 | #define ARIZONA_AIF2RX2_ENA 0x0002 /* AIF2RX2_ENA */ | 3955 | #define ARIZONA_AIF2RX2_ENA 0x0002 /* AIF2RX2_ENA */ |
| 3758 | #define ARIZONA_AIF2RX2_ENA_MASK 0x0002 /* AIF2RX2_ENA */ | 3956 | #define ARIZONA_AIF2RX2_ENA_MASK 0x0002 /* AIF2RX2_ENA */ |
| 3759 | #define ARIZONA_AIF2RX2_ENA_SHIFT 1 /* AIF2RX2_ENA */ | 3957 | #define ARIZONA_AIF2RX2_ENA_SHIFT 1 /* AIF2RX2_ENA */ |
diff --git a/include/linux/mfd/as3722.h b/include/linux/mfd/as3722.h index 16bf8a0dcd97..8d43e9f2a842 100644 --- a/include/linux/mfd/as3722.h +++ b/include/linux/mfd/as3722.h | |||
| @@ -151,6 +151,7 @@ | |||
| 151 | #define AS3722_ASIC_ID1_REG 0x90 | 151 | #define AS3722_ASIC_ID1_REG 0x90 |
| 152 | #define AS3722_ASIC_ID2_REG 0x91 | 152 | #define AS3722_ASIC_ID2_REG 0x91 |
| 153 | #define AS3722_LOCK_REG 0x9E | 153 | #define AS3722_LOCK_REG 0x9E |
| 154 | #define AS3722_FUSE7_REG 0xA7 | ||
| 154 | #define AS3722_MAX_REGISTER 0xF4 | 155 | #define AS3722_MAX_REGISTER 0xF4 |
| 155 | 156 | ||
| 156 | #define AS3722_SD0_EXT_ENABLE_MASK 0x03 | 157 | #define AS3722_SD0_EXT_ENABLE_MASK 0x03 |
| @@ -224,6 +225,7 @@ | |||
| 224 | #define AS3722_SD_VSEL_MASK 0x7F | 225 | #define AS3722_SD_VSEL_MASK 0x7F |
| 225 | #define AS3722_SD0_VSEL_MIN 0x01 | 226 | #define AS3722_SD0_VSEL_MIN 0x01 |
| 226 | #define AS3722_SD0_VSEL_MAX 0x5A | 227 | #define AS3722_SD0_VSEL_MAX 0x5A |
| 228 | #define AS3722_SD0_VSEL_LOW_VOL_MAX 0x6E | ||
| 227 | #define AS3722_SD2_VSEL_MIN 0x01 | 229 | #define AS3722_SD2_VSEL_MIN 0x01 |
| 228 | #define AS3722_SD2_VSEL_MAX 0x7F | 230 | #define AS3722_SD2_VSEL_MAX 0x7F |
| 229 | 231 | ||
| @@ -314,6 +316,7 @@ | |||
| 314 | #define AS3722_GPIO_IOSF_GPIO_INTERRUPT_IN AS3722_GPIO_IOSF_VAL(3) | 316 | #define AS3722_GPIO_IOSF_GPIO_INTERRUPT_IN AS3722_GPIO_IOSF_VAL(3) |
| 315 | #define AS3722_GPIO_IOSF_ISINK_PWM_IN AS3722_GPIO_IOSF_VAL(4) | 317 | #define AS3722_GPIO_IOSF_ISINK_PWM_IN AS3722_GPIO_IOSF_VAL(4) |
| 316 | #define AS3722_GPIO_IOSF_VOLTAGE_STBY AS3722_GPIO_IOSF_VAL(5) | 318 | #define AS3722_GPIO_IOSF_VOLTAGE_STBY AS3722_GPIO_IOSF_VAL(5) |
| 319 | #define AS3722_GPIO_IOSF_SD0_OUT AS3722_GPIO_IOSF_VAL(6) | ||
| 317 | #define AS3722_GPIO_IOSF_PWR_GOOD_OUT AS3722_GPIO_IOSF_VAL(7) | 320 | #define AS3722_GPIO_IOSF_PWR_GOOD_OUT AS3722_GPIO_IOSF_VAL(7) |
| 318 | #define AS3722_GPIO_IOSF_Q32K_OUT AS3722_GPIO_IOSF_VAL(8) | 321 | #define AS3722_GPIO_IOSF_Q32K_OUT AS3722_GPIO_IOSF_VAL(8) |
| 319 | #define AS3722_GPIO_IOSF_WATCHDOG_IN AS3722_GPIO_IOSF_VAL(9) | 322 | #define AS3722_GPIO_IOSF_WATCHDOG_IN AS3722_GPIO_IOSF_VAL(9) |
| @@ -341,6 +344,8 @@ | |||
| 341 | #define AS3722_EXT_CONTROL_ENABLE2 0x2 | 344 | #define AS3722_EXT_CONTROL_ENABLE2 0x2 |
| 342 | #define AS3722_EXT_CONTROL_ENABLE3 0x3 | 345 | #define AS3722_EXT_CONTROL_ENABLE3 0x3 |
| 343 | 346 | ||
| 347 | #define AS3722_FUSE7_SD0_LOW_VOLTAGE BIT(4) | ||
| 348 | |||
| 344 | /* Interrupt IDs */ | 349 | /* Interrupt IDs */ |
| 345 | enum as3722_irq { | 350 | enum as3722_irq { |
| 346 | AS3722_IRQ_LID, | 351 | AS3722_IRQ_LID, |
diff --git a/include/linux/mfd/lp3943.h b/include/linux/mfd/lp3943.h new file mode 100644 index 000000000000..3490db782988 --- /dev/null +++ b/include/linux/mfd/lp3943.h | |||
| @@ -0,0 +1,114 @@ | |||
| 1 | /* | ||
| 2 | * TI/National Semiconductor LP3943 Device | ||
| 3 | * | ||
| 4 | * Copyright 2013 Texas Instruments | ||
| 5 | * | ||
| 6 | * Author: Milo Kim <milo.kim@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 | |||
| 14 | #ifndef __MFD_LP3943_H__ | ||
| 15 | #define __MFD_LP3943_H__ | ||
| 16 | |||
| 17 | #include <linux/gpio.h> | ||
| 18 | #include <linux/pwm.h> | ||
| 19 | #include <linux/regmap.h> | ||
| 20 | |||
| 21 | /* Registers */ | ||
| 22 | #define LP3943_REG_GPIO_A 0x00 | ||
| 23 | #define LP3943_REG_GPIO_B 0x01 | ||
| 24 | #define LP3943_REG_PRESCALE0 0x02 | ||
| 25 | #define LP3943_REG_PWM0 0x03 | ||
| 26 | #define LP3943_REG_PRESCALE1 0x04 | ||
| 27 | #define LP3943_REG_PWM1 0x05 | ||
| 28 | #define LP3943_REG_MUX0 0x06 | ||
| 29 | #define LP3943_REG_MUX1 0x07 | ||
| 30 | #define LP3943_REG_MUX2 0x08 | ||
| 31 | #define LP3943_REG_MUX3 0x09 | ||
| 32 | |||
| 33 | /* Bit description for LP3943_REG_MUX0 ~ 3 */ | ||
| 34 | #define LP3943_GPIO_IN 0x00 | ||
| 35 | #define LP3943_GPIO_OUT_HIGH 0x00 | ||
| 36 | #define LP3943_GPIO_OUT_LOW 0x01 | ||
| 37 | #define LP3943_DIM_PWM0 0x02 | ||
| 38 | #define LP3943_DIM_PWM1 0x03 | ||
| 39 | |||
| 40 | #define LP3943_NUM_PWMS 2 | ||
| 41 | |||
| 42 | enum lp3943_pwm_output { | ||
| 43 | LP3943_PWM_OUT0, | ||
| 44 | LP3943_PWM_OUT1, | ||
| 45 | LP3943_PWM_OUT2, | ||
| 46 | LP3943_PWM_OUT3, | ||
| 47 | LP3943_PWM_OUT4, | ||
| 48 | LP3943_PWM_OUT5, | ||
| 49 | LP3943_PWM_OUT6, | ||
| 50 | LP3943_PWM_OUT7, | ||
| 51 | LP3943_PWM_OUT8, | ||
| 52 | LP3943_PWM_OUT9, | ||
| 53 | LP3943_PWM_OUT10, | ||
| 54 | LP3943_PWM_OUT11, | ||
| 55 | LP3943_PWM_OUT12, | ||
| 56 | LP3943_PWM_OUT13, | ||
| 57 | LP3943_PWM_OUT14, | ||
| 58 | LP3943_PWM_OUT15, | ||
| 59 | }; | ||
| 60 | |||
| 61 | /* | ||
| 62 | * struct lp3943_pwm_map | ||
| 63 | * @output: Output pins which are mapped to each PWM channel | ||
| 64 | * @num_outputs: Number of outputs | ||
| 65 | */ | ||
| 66 | struct lp3943_pwm_map { | ||
| 67 | enum lp3943_pwm_output *output; | ||
| 68 | int num_outputs; | ||
| 69 | }; | ||
| 70 | |||
| 71 | /* | ||
| 72 | * struct lp3943_platform_data | ||
| 73 | * @pwms: Output channel definitions for PWM channel 0 and 1 | ||
| 74 | */ | ||
| 75 | struct lp3943_platform_data { | ||
| 76 | struct lp3943_pwm_map *pwms[LP3943_NUM_PWMS]; | ||
| 77 | }; | ||
| 78 | |||
| 79 | /* | ||
| 80 | * struct lp3943_reg_cfg | ||
| 81 | * @reg: Register address | ||
| 82 | * @mask: Register bit mask to be updated | ||
| 83 | * @shift: Register bit shift | ||
| 84 | */ | ||
| 85 | struct lp3943_reg_cfg { | ||
| 86 | u8 reg; | ||
| 87 | u8 mask; | ||
| 88 | u8 shift; | ||
| 89 | }; | ||
| 90 | |||
| 91 | /* | ||
| 92 | * struct lp3943 | ||
| 93 | * @dev: Parent device pointer | ||
| 94 | * @regmap: Used for I2C communication on accessing registers | ||
| 95 | * @pdata: LP3943 platform specific data | ||
| 96 | * @mux_cfg: Register configuration for pin MUX | ||
| 97 | * @pin_used: Bit mask for output pin used. | ||
| 98 | * This bitmask is used for pin assignment management. | ||
| 99 | * 1 = pin used, 0 = available. | ||
| 100 | * Only LSB 16 bits are used, but it is unsigned long type | ||
| 101 | * for atomic bitwise operations. | ||
| 102 | */ | ||
| 103 | struct lp3943 { | ||
| 104 | struct device *dev; | ||
| 105 | struct regmap *regmap; | ||
| 106 | struct lp3943_platform_data *pdata; | ||
| 107 | const struct lp3943_reg_cfg *mux_cfg; | ||
| 108 | unsigned long pin_used; | ||
| 109 | }; | ||
| 110 | |||
| 111 | int lp3943_read_byte(struct lp3943 *lp3943, u8 reg, u8 *read); | ||
| 112 | int lp3943_write_byte(struct lp3943 *lp3943, u8 reg, u8 data); | ||
| 113 | int lp3943_update_bits(struct lp3943 *lp3943, u8 reg, u8 mask, u8 data); | ||
| 114 | #endif | ||
diff --git a/include/linux/mfd/max14577-private.h b/include/linux/mfd/max14577-private.h new file mode 100644 index 000000000000..a3d0185196d3 --- /dev/null +++ b/include/linux/mfd/max14577-private.h | |||
| @@ -0,0 +1,330 @@ | |||
| 1 | /* | ||
| 2 | * max14577-private.h - Common API for the Maxim 14577 internal sub chip | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Samsung Electrnoics | ||
| 5 | * Chanwoo Choi <cw00.choi@samsung.com> | ||
| 6 | * Krzysztof Kozlowski <k.kozlowski@samsung.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __MAX14577_PRIVATE_H__ | ||
| 20 | #define __MAX14577_PRIVATE_H__ | ||
| 21 | |||
| 22 | #include <linux/i2c.h> | ||
| 23 | #include <linux/regmap.h> | ||
| 24 | |||
| 25 | #define MAX14577_REG_INVALID (0xff) | ||
| 26 | |||
| 27 | /* Slave addr = 0x4A: Interrupt */ | ||
| 28 | enum max14577_reg { | ||
| 29 | MAX14577_REG_DEVICEID = 0x00, | ||
| 30 | MAX14577_REG_INT1 = 0x01, | ||
| 31 | MAX14577_REG_INT2 = 0x02, | ||
| 32 | MAX14577_REG_INT3 = 0x03, | ||
| 33 | MAX14577_REG_STATUS1 = 0x04, | ||
| 34 | MAX14577_REG_STATUS2 = 0x05, | ||
| 35 | MAX14577_REG_STATUS3 = 0x06, | ||
| 36 | MAX14577_REG_INTMASK1 = 0x07, | ||
| 37 | MAX14577_REG_INTMASK2 = 0x08, | ||
| 38 | MAX14577_REG_INTMASK3 = 0x09, | ||
| 39 | MAX14577_REG_CDETCTRL1 = 0x0A, | ||
| 40 | MAX14577_REG_RFU = 0x0B, | ||
| 41 | MAX14577_REG_CONTROL1 = 0x0C, | ||
| 42 | MAX14577_REG_CONTROL2 = 0x0D, | ||
| 43 | MAX14577_REG_CONTROL3 = 0x0E, | ||
| 44 | MAX14577_REG_CHGCTRL1 = 0x0F, | ||
| 45 | MAX14577_REG_CHGCTRL2 = 0x10, | ||
| 46 | MAX14577_REG_CHGCTRL3 = 0x11, | ||
| 47 | MAX14577_REG_CHGCTRL4 = 0x12, | ||
| 48 | MAX14577_REG_CHGCTRL5 = 0x13, | ||
| 49 | MAX14577_REG_CHGCTRL6 = 0x14, | ||
| 50 | MAX14577_REG_CHGCTRL7 = 0x15, | ||
| 51 | |||
| 52 | MAX14577_REG_END, | ||
| 53 | }; | ||
| 54 | |||
| 55 | /* Slave addr = 0x4A: MUIC */ | ||
| 56 | enum max14577_muic_reg { | ||
| 57 | MAX14577_MUIC_REG_STATUS1 = 0x04, | ||
| 58 | MAX14577_MUIC_REG_STATUS2 = 0x05, | ||
| 59 | MAX14577_MUIC_REG_CONTROL1 = 0x0C, | ||
| 60 | MAX14577_MUIC_REG_CONTROL3 = 0x0E, | ||
| 61 | |||
| 62 | MAX14577_MUIC_REG_END, | ||
| 63 | }; | ||
| 64 | |||
| 65 | enum max14577_muic_charger_type { | ||
| 66 | MAX14577_CHARGER_TYPE_NONE = 0, | ||
| 67 | MAX14577_CHARGER_TYPE_USB, | ||
| 68 | MAX14577_CHARGER_TYPE_DOWNSTREAM_PORT, | ||
| 69 | MAX14577_CHARGER_TYPE_DEDICATED_CHG, | ||
| 70 | MAX14577_CHARGER_TYPE_SPECIAL_500MA, | ||
| 71 | MAX14577_CHARGER_TYPE_SPECIAL_1A, | ||
| 72 | MAX14577_CHARGER_TYPE_RESERVED, | ||
| 73 | MAX14577_CHARGER_TYPE_DEAD_BATTERY = 7, | ||
| 74 | }; | ||
| 75 | |||
| 76 | /* MAX14577 interrupts */ | ||
| 77 | #define INT1_ADC_MASK (0x1 << 0) | ||
| 78 | #define INT1_ADCLOW_MASK (0x1 << 1) | ||
| 79 | #define INT1_ADCERR_MASK (0x1 << 2) | ||
| 80 | |||
| 81 | #define INT2_CHGTYP_MASK (0x1 << 0) | ||
| 82 | #define INT2_CHGDETRUN_MASK (0x1 << 1) | ||
| 83 | #define INT2_DCDTMR_MASK (0x1 << 2) | ||
| 84 | #define INT2_DBCHG_MASK (0x1 << 3) | ||
| 85 | #define INT2_VBVOLT_MASK (0x1 << 4) | ||
| 86 | |||
| 87 | #define INT3_EOC_MASK (0x1 << 0) | ||
| 88 | #define INT3_CGMBC_MASK (0x1 << 1) | ||
| 89 | #define INT3_OVP_MASK (0x1 << 2) | ||
| 90 | #define INT3_MBCCHGERR_MASK (0x1 << 3) | ||
| 91 | |||
| 92 | /* MAX14577 DEVICE ID register */ | ||
| 93 | #define DEVID_VENDORID_SHIFT 0 | ||
| 94 | #define DEVID_DEVICEID_SHIFT 3 | ||
| 95 | #define DEVID_VENDORID_MASK (0x07 << DEVID_VENDORID_SHIFT) | ||
| 96 | #define DEVID_DEVICEID_MASK (0x1f << DEVID_DEVICEID_SHIFT) | ||
| 97 | |||
| 98 | /* MAX14577 STATUS1 register */ | ||
| 99 | #define STATUS1_ADC_SHIFT 0 | ||
| 100 | #define STATUS1_ADCLOW_SHIFT 5 | ||
| 101 | #define STATUS1_ADCERR_SHIFT 6 | ||
| 102 | #define STATUS1_ADC_MASK (0x1f << STATUS1_ADC_SHIFT) | ||
| 103 | #define STATUS1_ADCLOW_MASK (0x1 << STATUS1_ADCLOW_SHIFT) | ||
| 104 | #define STATUS1_ADCERR_MASK (0x1 << STATUS1_ADCERR_SHIFT) | ||
| 105 | |||
| 106 | /* MAX14577 STATUS2 register */ | ||
| 107 | #define STATUS2_CHGTYP_SHIFT 0 | ||
| 108 | #define STATUS2_CHGDETRUN_SHIFT 3 | ||
| 109 | #define STATUS2_DCDTMR_SHIFT 4 | ||
| 110 | #define STATUS2_DBCHG_SHIFT 5 | ||
| 111 | #define STATUS2_VBVOLT_SHIFT 6 | ||
| 112 | #define STATUS2_CHGTYP_MASK (0x7 << STATUS2_CHGTYP_SHIFT) | ||
| 113 | #define STATUS2_CHGDETRUN_MASK (0x1 << STATUS2_CHGDETRUN_SHIFT) | ||
| 114 | #define STATUS2_DCDTMR_MASK (0x1 << STATUS2_DCDTMR_SHIFT) | ||
| 115 | #define STATUS2_DBCHG_MASK (0x1 << STATUS2_DBCHG_SHIFT) | ||
| 116 | #define STATUS2_VBVOLT_MASK (0x1 << STATUS2_VBVOLT_SHIFT) | ||
| 117 | |||
| 118 | /* MAX14577 CONTROL1 register */ | ||
| 119 | #define COMN1SW_SHIFT 0 | ||
| 120 | #define COMP2SW_SHIFT 3 | ||
| 121 | #define MICEN_SHIFT 6 | ||
| 122 | #define IDBEN_SHIFT 7 | ||
| 123 | #define COMN1SW_MASK (0x7 << COMN1SW_SHIFT) | ||
| 124 | #define COMP2SW_MASK (0x7 << COMP2SW_SHIFT) | ||
| 125 | #define MICEN_MASK (0x1 << MICEN_SHIFT) | ||
| 126 | #define IDBEN_MASK (0x1 << IDBEN_SHIFT) | ||
| 127 | #define CLEAR_IDBEN_MICEN_MASK (COMN1SW_MASK | COMP2SW_MASK) | ||
| 128 | #define CTRL1_SW_USB ((1 << COMP2SW_SHIFT) \ | ||
| 129 | | (1 << COMN1SW_SHIFT)) | ||
| 130 | #define CTRL1_SW_AUDIO ((2 << COMP2SW_SHIFT) \ | ||
| 131 | | (2 << COMN1SW_SHIFT)) | ||
| 132 | #define CTRL1_SW_UART ((3 << COMP2SW_SHIFT) \ | ||
| 133 | | (3 << COMN1SW_SHIFT)) | ||
| 134 | #define CTRL1_SW_OPEN ((0 << COMP2SW_SHIFT) \ | ||
| 135 | | (0 << COMN1SW_SHIFT)) | ||
| 136 | |||
| 137 | /* MAX14577 CONTROL2 register */ | ||
| 138 | #define CTRL2_LOWPWR_SHIFT (0) | ||
| 139 | #define CTRL2_ADCEN_SHIFT (1) | ||
| 140 | #define CTRL2_CPEN_SHIFT (2) | ||
| 141 | #define CTRL2_SFOUTASRT_SHIFT (3) | ||
| 142 | #define CTRL2_SFOUTORD_SHIFT (4) | ||
| 143 | #define CTRL2_ACCDET_SHIFT (5) | ||
| 144 | #define CTRL2_USBCPINT_SHIFT (6) | ||
| 145 | #define CTRL2_RCPS_SHIFT (7) | ||
| 146 | #define CTRL2_LOWPWR_MASK (0x1 << CTRL2_LOWPWR_SHIFT) | ||
| 147 | #define CTRL2_ADCEN_MASK (0x1 << CTRL2_ADCEN_SHIFT) | ||
| 148 | #define CTRL2_CPEN_MASK (0x1 << CTRL2_CPEN_SHIFT) | ||
| 149 | #define CTRL2_SFOUTASRT_MASK (0x1 << CTRL2_SFOUTASRT_SHIFT) | ||
| 150 | #define CTRL2_SFOUTORD_MASK (0x1 << CTRL2_SFOUTORD_SHIFT) | ||
| 151 | #define CTRL2_ACCDET_MASK (0x1 << CTRL2_ACCDET_SHIFT) | ||
| 152 | #define CTRL2_USBCPINT_MASK (0x1 << CTRL2_USBCPINT_SHIFT) | ||
| 153 | #define CTRL2_RCPS_MASK (0x1 << CTR2_RCPS_SHIFT) | ||
| 154 | |||
| 155 | #define CTRL2_CPEN1_LOWPWR0 ((1 << CTRL2_CPEN_SHIFT) | \ | ||
| 156 | (0 << CTRL2_LOWPWR_SHIFT)) | ||
| 157 | #define CTRL2_CPEN0_LOWPWR1 ((0 << CTRL2_CPEN_SHIFT) | \ | ||
| 158 | (1 << CTRL2_LOWPWR_SHIFT)) | ||
| 159 | |||
| 160 | /* MAX14577 CONTROL3 register */ | ||
| 161 | #define CTRL3_JIGSET_SHIFT 0 | ||
| 162 | #define CTRL3_BOOTSET_SHIFT 2 | ||
| 163 | #define CTRL3_ADCDBSET_SHIFT 4 | ||
| 164 | #define CTRL3_JIGSET_MASK (0x3 << CTRL3_JIGSET_SHIFT) | ||
| 165 | #define CTRL3_BOOTSET_MASK (0x3 << CTRL3_BOOTSET_SHIFT) | ||
| 166 | #define CTRL3_ADCDBSET_MASK (0x3 << CTRL3_ADCDBSET_SHIFT) | ||
| 167 | |||
| 168 | /* Slave addr = 0x4A: Charger */ | ||
| 169 | enum max14577_charger_reg { | ||
| 170 | MAX14577_CHG_REG_STATUS3 = 0x06, | ||
| 171 | MAX14577_CHG_REG_CHG_CTRL1 = 0x0F, | ||
| 172 | MAX14577_CHG_REG_CHG_CTRL2 = 0x10, | ||
| 173 | MAX14577_CHG_REG_CHG_CTRL3 = 0x11, | ||
| 174 | MAX14577_CHG_REG_CHG_CTRL4 = 0x12, | ||
| 175 | MAX14577_CHG_REG_CHG_CTRL5 = 0x13, | ||
| 176 | MAX14577_CHG_REG_CHG_CTRL6 = 0x14, | ||
| 177 | MAX14577_CHG_REG_CHG_CTRL7 = 0x15, | ||
| 178 | |||
| 179 | MAX14577_CHG_REG_END, | ||
| 180 | }; | ||
| 181 | |||
| 182 | /* MAX14577 STATUS3 register */ | ||
| 183 | #define STATUS3_EOC_SHIFT 0 | ||
| 184 | #define STATUS3_CGMBC_SHIFT 1 | ||
| 185 | #define STATUS3_OVP_SHIFT 2 | ||
| 186 | #define STATUS3_MBCCHGERR_SHIFT 3 | ||
| 187 | #define STATUS3_EOC_MASK (0x1 << STATUS3_EOC_SHIFT) | ||
| 188 | #define STATUS3_CGMBC_MASK (0x1 << STATUS3_CGMBC_SHIFT) | ||
| 189 | #define STATUS3_OVP_MASK (0x1 << STATUS3_OVP_SHIFT) | ||
| 190 | #define STATUS3_MBCCHGERR_MASK (0x1 << STATUS3_MBCCHGERR_SHIFT) | ||
| 191 | |||
| 192 | /* MAX14577 CDETCTRL1 register */ | ||
| 193 | #define CDETCTRL1_CHGDETEN_SHIFT 0 | ||
| 194 | #define CDETCTRL1_CHGTYPMAN_SHIFT 1 | ||
| 195 | #define CDETCTRL1_DCDEN_SHIFT 2 | ||
| 196 | #define CDETCTRL1_DCD2SCT_SHIFT 3 | ||
| 197 | #define CDETCTRL1_DCHKTM_SHIFT 4 | ||
| 198 | #define CDETCTRL1_DBEXIT_SHIFT 5 | ||
| 199 | #define CDETCTRL1_DBIDLE_SHIFT 6 | ||
| 200 | #define CDETCTRL1_CDPDET_SHIFT 7 | ||
| 201 | #define CDETCTRL1_CHGDETEN_MASK (0x1 << CDETCTRL1_CHGDETEN_SHIFT) | ||
| 202 | #define CDETCTRL1_CHGTYPMAN_MASK (0x1 << CDETCTRL1_CHGTYPMAN_SHIFT) | ||
| 203 | #define CDETCTRL1_DCDEN_MASK (0x1 << CDETCTRL1_DCDEN_SHIFT) | ||
| 204 | #define CDETCTRL1_DCD2SCT_MASK (0x1 << CDETCTRL1_DCD2SCT_SHIFT) | ||
| 205 | #define CDETCTRL1_DCHKTM_MASK (0x1 << CDETCTRL1_DCHKTM_SHIFT) | ||
| 206 | #define CDETCTRL1_DBEXIT_MASK (0x1 << CDETCTRL1_DBEXIT_SHIFT) | ||
| 207 | #define CDETCTRL1_DBIDLE_MASK (0x1 << CDETCTRL1_DBIDLE_SHIFT) | ||
| 208 | #define CDETCTRL1_CDPDET_MASK (0x1 << CDETCTRL1_CDPDET_SHIFT) | ||
| 209 | |||
| 210 | /* MAX14577 CHGCTRL1 register */ | ||
| 211 | #define CHGCTRL1_TCHW_SHIFT 4 | ||
| 212 | #define CHGCTRL1_TCHW_MASK (0x7 << CHGCTRL1_TCHW_SHIFT) | ||
| 213 | |||
| 214 | /* MAX14577 CHGCTRL2 register */ | ||
| 215 | #define CHGCTRL2_MBCHOSTEN_SHIFT 6 | ||
| 216 | #define CHGCTRL2_MBCHOSTEN_MASK (0x1 << CHGCTRL2_MBCHOSTEN_SHIFT) | ||
| 217 | #define CHGCTRL2_VCHGR_RC_SHIFT 7 | ||
| 218 | #define CHGCTRL2_VCHGR_RC_MASK (0x1 << CHGCTRL2_VCHGR_RC_SHIFT) | ||
| 219 | |||
| 220 | /* MAX14577 CHGCTRL3 register */ | ||
| 221 | #define CHGCTRL3_MBCCVWRC_SHIFT 0 | ||
| 222 | #define CHGCTRL3_MBCCVWRC_MASK (0xf << CHGCTRL3_MBCCVWRC_SHIFT) | ||
| 223 | |||
| 224 | /* MAX14577 CHGCTRL4 register */ | ||
| 225 | #define CHGCTRL4_MBCICHWRCH_SHIFT 0 | ||
| 226 | #define CHGCTRL4_MBCICHWRCH_MASK (0xf << CHGCTRL4_MBCICHWRCH_SHIFT) | ||
| 227 | #define CHGCTRL4_MBCICHWRCL_SHIFT 4 | ||
| 228 | #define CHGCTRL4_MBCICHWRCL_MASK (0x1 << CHGCTRL4_MBCICHWRCL_SHIFT) | ||
| 229 | |||
| 230 | /* MAX14577 CHGCTRL5 register */ | ||
| 231 | #define CHGCTRL5_EOCS_SHIFT 0 | ||
| 232 | #define CHGCTRL5_EOCS_MASK (0xf << CHGCTRL5_EOCS_SHIFT) | ||
| 233 | |||
| 234 | /* MAX14577 CHGCTRL6 register */ | ||
| 235 | #define CHGCTRL6_AUTOSTOP_SHIFT 5 | ||
| 236 | #define CHGCTRL6_AUTOSTOP_MASK (0x1 << CHGCTRL6_AUTOSTOP_SHIFT) | ||
| 237 | |||
| 238 | /* MAX14577 CHGCTRL7 register */ | ||
| 239 | #define CHGCTRL7_OTPCGHCVS_SHIFT 0 | ||
| 240 | #define CHGCTRL7_OTPCGHCVS_MASK (0x3 << CHGCTRL7_OTPCGHCVS_SHIFT) | ||
| 241 | |||
| 242 | /* MAX14577 regulator current limits (as in CHGCTRL4 register), uA */ | ||
| 243 | #define MAX14577_REGULATOR_CURRENT_LIMIT_MIN 90000 | ||
| 244 | #define MAX14577_REGULATOR_CURRENT_LIMIT_HIGH_START 200000 | ||
| 245 | #define MAX14577_REGULATOR_CURRENT_LIMIT_HIGH_STEP 50000 | ||
| 246 | #define MAX14577_REGULATOR_CURRENT_LIMIT_MAX 950000 | ||
| 247 | |||
| 248 | /* MAX14577 regulator SFOUT LDO voltage, fixed, uV */ | ||
| 249 | #define MAX14577_REGULATOR_SAFEOUT_VOLTAGE 4900000 | ||
| 250 | |||
| 251 | enum max14577_irq_source { | ||
| 252 | MAX14577_IRQ_INT1 = 0, | ||
| 253 | MAX14577_IRQ_INT2, | ||
| 254 | MAX14577_IRQ_INT3, | ||
| 255 | |||
| 256 | MAX14577_IRQ_REGS_NUM, | ||
| 257 | }; | ||
| 258 | |||
| 259 | enum max14577_irq { | ||
| 260 | /* INT1 */ | ||
| 261 | MAX14577_IRQ_INT1_ADC, | ||
| 262 | MAX14577_IRQ_INT1_ADCLOW, | ||
| 263 | MAX14577_IRQ_INT1_ADCERR, | ||
| 264 | |||
| 265 | /* INT2 */ | ||
| 266 | MAX14577_IRQ_INT2_CHGTYP, | ||
| 267 | MAX14577_IRQ_INT2_CHGDETRUN, | ||
| 268 | MAX14577_IRQ_INT2_DCDTMR, | ||
| 269 | MAX14577_IRQ_INT2_DBCHG, | ||
| 270 | MAX14577_IRQ_INT2_VBVOLT, | ||
| 271 | |||
| 272 | /* INT3 */ | ||
| 273 | MAX14577_IRQ_INT3_EOC, | ||
| 274 | MAX14577_IRQ_INT3_CGMBC, | ||
| 275 | MAX14577_IRQ_INT3_OVP, | ||
| 276 | MAX14577_IRQ_INT3_MBCCHGERR, | ||
| 277 | |||
| 278 | MAX14577_IRQ_NUM, | ||
| 279 | }; | ||
| 280 | |||
| 281 | struct max14577 { | ||
| 282 | struct device *dev; | ||
| 283 | struct i2c_client *i2c; /* Slave addr = 0x4A */ | ||
| 284 | |||
| 285 | struct regmap *regmap; | ||
| 286 | |||
| 287 | struct regmap_irq_chip_data *irq_data; | ||
| 288 | int irq; | ||
| 289 | |||
| 290 | /* Device ID */ | ||
| 291 | u8 vendor_id; /* Vendor Identification */ | ||
| 292 | u8 device_id; /* Chip Version */ | ||
| 293 | }; | ||
| 294 | |||
| 295 | /* MAX14577 shared regmap API function */ | ||
| 296 | static inline int max14577_read_reg(struct regmap *map, u8 reg, u8 *dest) | ||
| 297 | { | ||
| 298 | unsigned int val; | ||
| 299 | int ret; | ||
| 300 | |||
| 301 | ret = regmap_read(map, reg, &val); | ||
| 302 | *dest = val; | ||
| 303 | |||
| 304 | return ret; | ||
| 305 | } | ||
| 306 | |||
| 307 | static inline int max14577_bulk_read(struct regmap *map, u8 reg, u8 *buf, | ||
| 308 | int count) | ||
| 309 | { | ||
| 310 | return regmap_bulk_read(map, reg, buf, count); | ||
| 311 | } | ||
| 312 | |||
| 313 | static inline int max14577_write_reg(struct regmap *map, u8 reg, u8 value) | ||
| 314 | { | ||
| 315 | return regmap_write(map, reg, value); | ||
| 316 | } | ||
| 317 | |||
| 318 | static inline int max14577_bulk_write(struct regmap *map, u8 reg, u8 *buf, | ||
| 319 | int count) | ||
| 320 | { | ||
| 321 | return regmap_bulk_write(map, reg, buf, count); | ||
| 322 | } | ||
| 323 | |||
| 324 | static inline int max14577_update_reg(struct regmap *map, u8 reg, u8 mask, | ||
| 325 | u8 val) | ||
| 326 | { | ||
| 327 | return regmap_update_bits(map, reg, mask, val); | ||
| 328 | } | ||
| 329 | |||
| 330 | #endif /* __MAX14577_PRIVATE_H__ */ | ||
diff --git a/include/linux/mfd/max14577.h b/include/linux/mfd/max14577.h new file mode 100644 index 000000000000..247b021dfaaf --- /dev/null +++ b/include/linux/mfd/max14577.h | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | /* | ||
| 2 | * max14577.h - Driver for the Maxim 14577 | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Samsung Electrnoics | ||
| 5 | * Chanwoo Choi <cw00.choi@samsung.com> | ||
| 6 | * Krzysztof Kozlowski <k.kozlowski@samsung.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * This driver is based on max8997.h | ||
| 19 | * | ||
| 20 | * MAX14577 has MUIC, Charger devices. | ||
| 21 | * The devices share the same I2C bus and interrupt line | ||
| 22 | * included in this mfd driver. | ||
| 23 | */ | ||
| 24 | |||
| 25 | #ifndef __MAX14577_H__ | ||
| 26 | #define __MAX14577_H__ | ||
| 27 | |||
| 28 | #include <linux/mfd/max14577-private.h> | ||
| 29 | #include <linux/regulator/consumer.h> | ||
| 30 | |||
| 31 | /* | ||
| 32 | * MAX14577 Regulator | ||
| 33 | */ | ||
| 34 | |||
| 35 | /* MAX14577 regulator IDs */ | ||
| 36 | enum max14577_regulators { | ||
| 37 | MAX14577_SAFEOUT = 0, | ||
| 38 | MAX14577_CHARGER, | ||
| 39 | |||
| 40 | MAX14577_REG_MAX, | ||
| 41 | }; | ||
| 42 | |||
| 43 | struct max14577_regulator_platform_data { | ||
| 44 | int id; | ||
| 45 | struct regulator_init_data *initdata; | ||
| 46 | struct device_node *of_node; | ||
| 47 | }; | ||
| 48 | |||
| 49 | /* | ||
| 50 | * MAX14577 MFD platform data | ||
| 51 | */ | ||
| 52 | struct max14577_platform_data { | ||
| 53 | /* IRQ */ | ||
| 54 | int irq_base; | ||
| 55 | |||
| 56 | /* current control GPIOs */ | ||
| 57 | int gpio_pogo_vbatt_en; | ||
| 58 | int gpio_pogo_vbus_en; | ||
| 59 | |||
| 60 | /* current control GPIO control function */ | ||
| 61 | int (*set_gpio_pogo_vbatt_en) (int gpio_val); | ||
| 62 | int (*set_gpio_pogo_vbus_en) (int gpio_val); | ||
| 63 | |||
| 64 | int (*set_gpio_pogo_cb) (int new_dev); | ||
| 65 | |||
| 66 | struct max14577_regulator_platform_data *regulators; | ||
| 67 | }; | ||
| 68 | |||
| 69 | #endif /* __MAX14577_H__ */ | ||
diff --git a/include/linux/mfd/max77686-private.h b/include/linux/mfd/max77686-private.h index d327d4971e4f..8c75a9c8dfab 100644 --- a/include/linux/mfd/max77686-private.h +++ b/include/linux/mfd/max77686-private.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * max77686.h - Voltage regulator driver for the Maxim 77686 | 2 | * max77686-private.h - Voltage regulator driver for the Maxim 77686 |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2012 Samsung Electrnoics | 4 | * Copyright (C) 2012 Samsung Electrnoics |
| 5 | * Chiwoong Byun <woong.byun@samsung.com> | 5 | * Chiwoong Byun <woong.byun@samsung.com> |
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h index fb465dfbb59e..ad1ae7f345ad 100644 --- a/include/linux/mfd/max8997-private.h +++ b/include/linux/mfd/max8997-private.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * max8997.h - Voltage regulator driver for the Maxim 8997 | 2 | * max8997-private.h - Voltage regulator driver for the Maxim 8997 |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2010 Samsung Electrnoics | 4 | * Copyright (C) 2010 Samsung Electrnoics |
| 5 | * MyungJoo Ham <myungjoo.ham@samsung.com> | 5 | * MyungJoo Ham <myungjoo.ham@samsung.com> |
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h index 84844e0a5704..4ecb24b4b863 100644 --- a/include/linux/mfd/max8998-private.h +++ b/include/linux/mfd/max8998-private.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * max8998.h - Voltage regulator driver for the Maxim 8998 | 2 | * max8998-private.h - Voltage regulator driver for the Maxim 8998 |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2009-2010 Samsung Electrnoics | 4 | * Copyright (C) 2009-2010 Samsung Electrnoics |
| 5 | * Kyungmin Park <kyungmin.park@samsung.com> | 5 | * Kyungmin Park <kyungmin.park@samsung.com> |
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h index 67c17b5a6f44..6156686bf108 100644 --- a/include/linux/mfd/mc13xxx.h +++ b/include/linux/mfd/mc13xxx.h | |||
| @@ -21,8 +21,6 @@ int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val); | |||
| 21 | int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset, | 21 | int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset, |
| 22 | u32 mask, u32 val); | 22 | u32 mask, u32 val); |
| 23 | 23 | ||
| 24 | int mc13xxx_get_flags(struct mc13xxx *mc13xxx); | ||
| 25 | |||
| 26 | int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq, | 24 | int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq, |
| 27 | irq_handler_t handler, const char *name, void *dev); | 25 | irq_handler_t handler, const char *name, void *dev); |
| 28 | int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq, | 26 | int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq, |
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index 2d0c9071bcfb..41c9bde410c5 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h | |||
| @@ -39,7 +39,8 @@ enum sec_device_type { | |||
| 39 | struct sec_pmic_dev { | 39 | struct sec_pmic_dev { |
| 40 | struct device *dev; | 40 | struct device *dev; |
| 41 | struct sec_platform_data *pdata; | 41 | struct sec_platform_data *pdata; |
| 42 | struct regmap *regmap; | 42 | struct regmap *regmap_pmic; |
| 43 | struct regmap *regmap_rtc; | ||
| 43 | struct i2c_client *i2c; | 44 | struct i2c_client *i2c; |
| 44 | struct i2c_client *rtc; | 45 | struct i2c_client *rtc; |
| 45 | 46 | ||
| @@ -58,12 +59,6 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic); | |||
| 58 | void sec_irq_exit(struct sec_pmic_dev *sec_pmic); | 59 | void sec_irq_exit(struct sec_pmic_dev *sec_pmic); |
| 59 | int sec_irq_resume(struct sec_pmic_dev *sec_pmic); | 60 | int sec_irq_resume(struct sec_pmic_dev *sec_pmic); |
| 60 | 61 | ||
| 61 | extern int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest); | ||
| 62 | extern int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf); | ||
| 63 | extern int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value); | ||
| 64 | extern int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf); | ||
| 65 | extern int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask); | ||
| 66 | |||
| 67 | struct sec_platform_data { | 62 | struct sec_platform_data { |
| 68 | struct sec_regulator_data *regulators; | 63 | struct sec_regulator_data *regulators; |
| 69 | struct sec_opmode_data *opmode; | 64 | struct sec_opmode_data *opmode; |
diff --git a/include/linux/mfd/samsung/s5m8767.h b/include/linux/mfd/samsung/s5m8767.h index 306a95fc558c..2ab0b0f03641 100644 --- a/include/linux/mfd/samsung/s5m8767.h +++ b/include/linux/mfd/samsung/s5m8767.h | |||
| @@ -183,6 +183,22 @@ enum s5m8767_regulators { | |||
| 183 | S5M8767_REG_MAX, | 183 | S5M8767_REG_MAX, |
| 184 | }; | 184 | }; |
| 185 | 185 | ||
| 186 | #define S5M8767_ENCTRL_SHIFT 6 | 186 | #define S5M8767_ENCTRL_SHIFT 6 |
| 187 | #define S5M8767_ENCTRL_MASK (0x3 << S5M8767_ENCTRL_SHIFT) | ||
| 188 | |||
| 189 | /* | ||
| 190 | * Values for BUCK_RAMP field in DVS_RAMP register, matching raw values | ||
| 191 | * in mV/us. | ||
| 192 | */ | ||
| 193 | enum s5m8767_dvs_buck_ramp_values { | ||
| 194 | S5M8767_DVS_BUCK_RAMP_5 = 0x4, | ||
| 195 | S5M8767_DVS_BUCK_RAMP_10 = 0x9, | ||
| 196 | S5M8767_DVS_BUCK_RAMP_12_5 = 0xb, | ||
| 197 | S5M8767_DVS_BUCK_RAMP_25 = 0xd, | ||
| 198 | S5M8767_DVS_BUCK_RAMP_50 = 0xe, | ||
| 199 | S5M8767_DVS_BUCK_RAMP_100 = 0xf, | ||
| 200 | }; | ||
| 201 | #define S5M8767_DVS_BUCK_RAMP_SHIFT 4 | ||
| 202 | #define S5M8767_DVS_BUCK_RAMP_MASK (0xf << S5M8767_DVS_BUCK_RAMP_SHIFT) | ||
| 187 | 203 | ||
| 188 | #endif /* __LINUX_MFD_S5M8767_H */ | 204 | #endif /* __LINUX_MFD_S5M8767_H */ |
diff --git a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h index b6d36b38b99c..866e355fa409 100644 --- a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h +++ b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h | |||
| @@ -212,6 +212,7 @@ | |||
| 212 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU1_DI1 (0x1 << 4) | 212 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU1_DI1 (0x1 << 4) |
| 213 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI0 (0x2 << 4) | 213 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI0 (0x2 << 4) |
| 214 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI1 (0x3 << 4) | 214 | #define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI1 (0x3 << 4) |
| 215 | #define IMX6Q_GPR3_HDMI_MUX_CTL_SHIFT 2 | ||
| 215 | #define IMX6Q_GPR3_HDMI_MUX_CTL_MASK (0x3 << 2) | 216 | #define IMX6Q_GPR3_HDMI_MUX_CTL_MASK (0x3 << 2) |
| 216 | #define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI0 (0x0 << 2) | 217 | #define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI0 (0x0 << 2) |
| 217 | #define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI1 (0x1 << 2) | 218 | #define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI1 (0x1 << 2) |
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h index d498d98f0c2c..fb96c84dada5 100644 --- a/include/linux/mfd/ti_am335x_tscadc.h +++ b/include/linux/mfd/ti_am335x_tscadc.h | |||
| @@ -159,6 +159,9 @@ struct ti_tscadc_dev { | |||
| 159 | int adc_cell; /* -1 if not used */ | 159 | int adc_cell; /* -1 if not used */ |
| 160 | struct mfd_cell cells[TSCADC_CELLS]; | 160 | struct mfd_cell cells[TSCADC_CELLS]; |
| 161 | u32 reg_se_cache; | 161 | u32 reg_se_cache; |
| 162 | bool adc_waiting; | ||
| 163 | bool adc_in_use; | ||
| 164 | wait_queue_head_t reg_se_wait; | ||
| 162 | spinlock_t reg_lock; | 165 | spinlock_t reg_lock; |
| 163 | unsigned int clk_div; | 166 | unsigned int clk_div; |
| 164 | 167 | ||
| @@ -176,8 +179,9 @@ static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p) | |||
| 176 | return *tscadc_dev; | 179 | return *tscadc_dev; |
| 177 | } | 180 | } |
| 178 | 181 | ||
| 179 | void am335x_tsc_se_update(struct ti_tscadc_dev *tsadc); | 182 | void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val); |
| 180 | void am335x_tsc_se_set(struct ti_tscadc_dev *tsadc, u32 val); | 183 | void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val); |
| 181 | void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val); | 184 | void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val); |
| 185 | void am335x_tsc_se_adc_done(struct ti_tscadc_dev *tsadc); | ||
| 182 | 186 | ||
| 183 | #endif | 187 | #endif |
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h index 87994542573b..cbecec2e353a 100644 --- a/include/linux/mfd/tps6586x.h +++ b/include/linux/mfd/tps6586x.h | |||
| @@ -13,6 +13,12 @@ | |||
| 13 | #define TPS6586X_SLEW_RATE_SET 0x08 | 13 | #define TPS6586X_SLEW_RATE_SET 0x08 |
| 14 | #define TPS6586X_SLEW_RATE_MASK 0x07 | 14 | #define TPS6586X_SLEW_RATE_MASK 0x07 |
| 15 | 15 | ||
| 16 | /* VERSION CRC */ | ||
| 17 | #define TPS658621A 0x15 | ||
| 18 | #define TPS658621CD 0x2c | ||
| 19 | #define TPS658623 0x1b | ||
| 20 | #define TPS658643 0x03 | ||
| 21 | |||
| 16 | enum { | 22 | enum { |
| 17 | TPS6586X_ID_SYS, | 23 | TPS6586X_ID_SYS, |
| 18 | TPS6586X_ID_SM_0, | 24 | TPS6586X_ID_SM_0, |
| @@ -97,5 +103,6 @@ extern int tps6586x_clr_bits(struct device *dev, int reg, uint8_t bit_mask); | |||
| 97 | extern int tps6586x_update(struct device *dev, int reg, uint8_t val, | 103 | extern int tps6586x_update(struct device *dev, int reg, uint8_t val, |
| 98 | uint8_t mask); | 104 | uint8_t mask); |
| 99 | extern int tps6586x_irq_get_virq(struct device *dev, int irq); | 105 | extern int tps6586x_irq_get_virq(struct device *dev, int irq); |
| 106 | extern int tps6586x_get_version(struct device *dev); | ||
| 100 | 107 | ||
| 101 | #endif /*__LINUX_MFD_TPS6586X_H */ | 108 | #endif /*__LINUX_MFD_TPS6586X_H */ |
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h index 20e433e551e3..16c2335c2856 100644 --- a/include/linux/mfd/tps65910.h +++ b/include/linux/mfd/tps65910.h | |||
| @@ -358,8 +358,6 @@ | |||
| 358 | /*Register BBCH (0x80) register.RegisterDescription */ | 358 | /*Register BBCH (0x80) register.RegisterDescription */ |
| 359 | #define BBCH_BBSEL_MASK 0x06 | 359 | #define BBCH_BBSEL_MASK 0x06 |
| 360 | #define BBCH_BBSEL_SHIFT 1 | 360 | #define BBCH_BBSEL_SHIFT 1 |
| 361 | #define BBCH_BBCHEN_MASK 0x01 | ||
| 362 | #define BBCH_BBCHEN_SHIFT 0 | ||
| 363 | 361 | ||
| 364 | 362 | ||
| 365 | /*Register DCDCCTRL (0x80) register.RegisterDescription */ | 363 | /*Register DCDCCTRL (0x80) register.RegisterDescription */ |
| @@ -833,6 +831,7 @@ | |||
| 833 | #define TPS65910_REG_VAUX2 10 | 831 | #define TPS65910_REG_VAUX2 10 |
| 834 | #define TPS65910_REG_VAUX33 11 | 832 | #define TPS65910_REG_VAUX33 11 |
| 835 | #define TPS65910_REG_VMMC 12 | 833 | #define TPS65910_REG_VMMC 12 |
| 834 | #define TPS65910_REG_VBB 13 | ||
| 836 | 835 | ||
| 837 | #define TPS65911_REG_VDDCTRL 4 | 836 | #define TPS65911_REG_VDDCTRL 4 |
| 838 | #define TPS65911_REG_LDO1 5 | 837 | #define TPS65911_REG_LDO1 5 |
| @@ -845,7 +844,7 @@ | |||
| 845 | #define TPS65911_REG_LDO8 12 | 844 | #define TPS65911_REG_LDO8 12 |
| 846 | 845 | ||
| 847 | /* Max number of TPS65910/11 regulators */ | 846 | /* Max number of TPS65910/11 regulators */ |
| 848 | #define TPS65910_NUM_REGS 13 | 847 | #define TPS65910_NUM_REGS 14 |
| 849 | 848 | ||
| 850 | /* External sleep controls through EN1/EN2/EN3/SLEEP inputs */ | 849 | /* External sleep controls through EN1/EN2/EN3/SLEEP inputs */ |
| 851 | #define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN1 0x1 | 850 | #define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN1 0x1 |
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h index ad05ce60c1c9..2e5b194b9b19 100644 --- a/include/linux/micrel_phy.h +++ b/include/linux/micrel_phy.h | |||
| @@ -22,6 +22,8 @@ | |||
| 22 | #define PHY_ID_KSZ8021 0x00221555 | 22 | #define PHY_ID_KSZ8021 0x00221555 |
| 23 | #define PHY_ID_KSZ8031 0x00221556 | 23 | #define PHY_ID_KSZ8031 0x00221556 |
| 24 | #define PHY_ID_KSZ8041 0x00221510 | 24 | #define PHY_ID_KSZ8041 0x00221510 |
| 25 | /* undocumented */ | ||
| 26 | #define PHY_ID_KSZ8041RNLI 0x00221537 | ||
| 25 | #define PHY_ID_KSZ8051 0x00221550 | 27 | #define PHY_ID_KSZ8051 0x00221550 |
| 26 | /* same id: ks8001 Rev. A/B, and ks8721 Rev 3. */ | 28 | /* same id: ks8001 Rev. A/B, and ks8721 Rev 3. */ |
| 27 | #define PHY_ID_KSZ8001 0x0022161A | 29 | #define PHY_ID_KSZ8001 0x0022161A |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index f5096b58b20d..84a31ad0b791 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
| @@ -35,16 +35,12 @@ enum migrate_reason { | |||
| 35 | 35 | ||
| 36 | #ifdef CONFIG_MIGRATION | 36 | #ifdef CONFIG_MIGRATION |
| 37 | 37 | ||
| 38 | extern void putback_lru_pages(struct list_head *l); | ||
| 39 | extern void putback_movable_pages(struct list_head *l); | 38 | extern void putback_movable_pages(struct list_head *l); |
| 40 | extern int migrate_page(struct address_space *, | 39 | extern int migrate_page(struct address_space *, |
| 41 | struct page *, struct page *, enum migrate_mode); | 40 | struct page *, struct page *, enum migrate_mode); |
| 42 | extern int migrate_pages(struct list_head *l, new_page_t x, | 41 | extern int migrate_pages(struct list_head *l, new_page_t x, |
| 43 | unsigned long private, enum migrate_mode mode, int reason); | 42 | unsigned long private, enum migrate_mode mode, int reason); |
| 44 | 43 | ||
| 45 | extern int fail_migrate_page(struct address_space *, | ||
| 46 | struct page *, struct page *); | ||
| 47 | |||
| 48 | extern int migrate_prep(void); | 44 | extern int migrate_prep(void); |
| 49 | extern int migrate_prep_local(void); | 45 | extern int migrate_prep_local(void); |
| 50 | extern int migrate_vmas(struct mm_struct *mm, | 46 | extern int migrate_vmas(struct mm_struct *mm, |
| @@ -55,10 +51,10 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
| 55 | struct page *newpage, struct page *page); | 51 | struct page *newpage, struct page *page); |
| 56 | extern int migrate_page_move_mapping(struct address_space *mapping, | 52 | extern int migrate_page_move_mapping(struct address_space *mapping, |
| 57 | struct page *newpage, struct page *page, | 53 | struct page *newpage, struct page *page, |
| 58 | struct buffer_head *head, enum migrate_mode mode); | 54 | struct buffer_head *head, enum migrate_mode mode, |
| 55 | int extra_count); | ||
| 59 | #else | 56 | #else |
| 60 | 57 | ||
| 61 | static inline void putback_lru_pages(struct list_head *l) {} | ||
| 62 | static inline void putback_movable_pages(struct list_head *l) {} | 58 | static inline void putback_movable_pages(struct list_head *l) {} |
| 63 | static inline int migrate_pages(struct list_head *l, new_page_t x, | 59 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
| 64 | unsigned long private, enum migrate_mode mode, int reason) | 60 | unsigned long private, enum migrate_mode mode, int reason) |
| @@ -85,15 +81,23 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
| 85 | 81 | ||
| 86 | /* Possible settings for the migrate_page() method in address_operations */ | 82 | /* Possible settings for the migrate_page() method in address_operations */ |
| 87 | #define migrate_page NULL | 83 | #define migrate_page NULL |
| 88 | #define fail_migrate_page NULL | ||
| 89 | 84 | ||
| 90 | #endif /* CONFIG_MIGRATION */ | 85 | #endif /* CONFIG_MIGRATION */ |
| 91 | 86 | ||
| 92 | #ifdef CONFIG_NUMA_BALANCING | 87 | #ifdef CONFIG_NUMA_BALANCING |
| 88 | extern bool pmd_trans_migrating(pmd_t pmd); | ||
| 89 | extern void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd); | ||
| 93 | extern int migrate_misplaced_page(struct page *page, | 90 | extern int migrate_misplaced_page(struct page *page, |
| 94 | struct vm_area_struct *vma, int node); | 91 | struct vm_area_struct *vma, int node); |
| 95 | extern bool migrate_ratelimited(int node); | 92 | extern bool migrate_ratelimited(int node); |
| 96 | #else | 93 | #else |
| 94 | static inline bool pmd_trans_migrating(pmd_t pmd) | ||
| 95 | { | ||
| 96 | return false; | ||
| 97 | } | ||
| 98 | static inline void wait_migrate_huge_page(struct anon_vma *anon_vma, pmd_t *pmd) | ||
| 99 | { | ||
| 100 | } | ||
| 97 | static inline int migrate_misplaced_page(struct page *page, | 101 | static inline int migrate_misplaced_page(struct page *page, |
| 98 | struct vm_area_struct *vma, int node) | 102 | struct vm_area_struct *vma, int node) |
| 99 | { | 103 | { |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index f7eaf2d60083..3737f7218f51 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #define STORE_QUEUE_MINOR 155 | 30 | #define STORE_QUEUE_MINOR 155 |
| 31 | #define I2O_MINOR 166 | 31 | #define I2O_MINOR 166 |
| 32 | #define MICROCODE_MINOR 184 | 32 | #define MICROCODE_MINOR 184 |
| 33 | #define VFIO_MINOR 196 | ||
| 33 | #define TUN_MINOR 200 | 34 | #define TUN_MINOR 200 |
| 34 | #define CUSE_MINOR 203 | 35 | #define CUSE_MINOR 203 |
| 35 | #define MWAVE_MINOR 219 /* ACP/Mwave Modem */ | 36 | #define MWAVE_MINOR 219 /* ACP/Mwave Modem */ |
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h index 8df61bc5da00..79a347238168 100644 --- a/include/linux/mlx4/cmd.h +++ b/include/linux/mlx4/cmd.h | |||
| @@ -157,6 +157,7 @@ enum { | |||
| 157 | /* register/delete flow steering network rules */ | 157 | /* register/delete flow steering network rules */ |
| 158 | MLX4_QP_FLOW_STEERING_ATTACH = 0x65, | 158 | MLX4_QP_FLOW_STEERING_ATTACH = 0x65, |
| 159 | MLX4_QP_FLOW_STEERING_DETACH = 0x66, | 159 | MLX4_QP_FLOW_STEERING_DETACH = 0x66, |
| 160 | MLX4_FLOW_STEERING_IB_UC_QP_RANGE = 0x64, | ||
| 160 | }; | 161 | }; |
| 161 | 162 | ||
| 162 | enum { | 163 | enum { |
| @@ -180,6 +181,7 @@ enum { | |||
| 180 | MLX4_SET_PORT_GID_TABLE = 0x5, | 181 | MLX4_SET_PORT_GID_TABLE = 0x5, |
| 181 | MLX4_SET_PORT_PRIO2TC = 0x8, | 182 | MLX4_SET_PORT_PRIO2TC = 0x8, |
| 182 | MLX4_SET_PORT_SCHEDULER = 0x9, | 183 | MLX4_SET_PORT_SCHEDULER = 0x9, |
| 184 | MLX4_SET_PORT_VXLAN = 0xB | ||
| 183 | }; | 185 | }; |
| 184 | 186 | ||
| 185 | enum { | 187 | enum { |
diff --git a/include/linux/mlx4/cq.h b/include/linux/mlx4/cq.h index 98fa492cf406..e7ecc12a1163 100644 --- a/include/linux/mlx4/cq.h +++ b/include/linux/mlx4/cq.h | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #define MLX4_CQ_H | 34 | #define MLX4_CQ_H |
| 35 | 35 | ||
| 36 | #include <linux/types.h> | 36 | #include <linux/types.h> |
| 37 | #include <uapi/linux/if_ether.h> | ||
| 37 | 38 | ||
| 38 | #include <linux/mlx4/device.h> | 39 | #include <linux/mlx4/device.h> |
| 39 | #include <linux/mlx4/doorbell.h> | 40 | #include <linux/mlx4/doorbell.h> |
| @@ -43,10 +44,15 @@ struct mlx4_cqe { | |||
| 43 | __be32 immed_rss_invalid; | 44 | __be32 immed_rss_invalid; |
| 44 | __be32 g_mlpath_rqpn; | 45 | __be32 g_mlpath_rqpn; |
| 45 | __be16 sl_vid; | 46 | __be16 sl_vid; |
| 46 | __be16 rlid; | 47 | union { |
| 47 | __be16 status; | 48 | struct { |
| 48 | u8 ipv6_ext_mask; | 49 | __be16 rlid; |
| 49 | u8 badfcs_enc; | 50 | __be16 status; |
| 51 | u8 ipv6_ext_mask; | ||
| 52 | u8 badfcs_enc; | ||
| 53 | }; | ||
| 54 | u8 smac[ETH_ALEN]; | ||
| 55 | }; | ||
| 50 | __be32 byte_cnt; | 56 | __be32 byte_cnt; |
| 51 | __be16 wqe_index; | 57 | __be16 wqe_index; |
| 52 | __be16 checksum; | 58 | __be16 checksum; |
| @@ -81,8 +87,14 @@ struct mlx4_ts_cqe { | |||
| 81 | } __packed; | 87 | } __packed; |
| 82 | 88 | ||
| 83 | enum { | 89 | enum { |
| 90 | MLX4_CQE_L2_TUNNEL_IPOK = 1 << 31, | ||
| 84 | MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29, | 91 | MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29, |
| 92 | MLX4_CQE_L2_TUNNEL = 1 << 27, | ||
| 93 | MLX4_CQE_L2_TUNNEL_CSUM = 1 << 26, | ||
| 94 | MLX4_CQE_L2_TUNNEL_IPV4 = 1 << 25, | ||
| 95 | |||
| 85 | MLX4_CQE_QPN_MASK = 0xffffff, | 96 | MLX4_CQE_QPN_MASK = 0xffffff, |
| 97 | MLX4_CQE_VID_MASK = 0xfff, | ||
| 86 | }; | 98 | }; |
| 87 | 99 | ||
| 88 | enum { | 100 | enum { |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 7d3a523160ba..5edd2c68274d 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -119,6 +119,11 @@ static inline const char *mlx4_steering_mode_str(int steering_mode) | |||
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | enum { | 121 | enum { |
| 122 | MLX4_TUNNEL_OFFLOAD_MODE_NONE, | ||
| 123 | MLX4_TUNNEL_OFFLOAD_MODE_VXLAN | ||
| 124 | }; | ||
| 125 | |||
| 126 | enum { | ||
| 122 | MLX4_DEV_CAP_FLAG_RC = 1LL << 0, | 127 | MLX4_DEV_CAP_FLAG_RC = 1LL << 0, |
| 123 | MLX4_DEV_CAP_FLAG_UC = 1LL << 1, | 128 | MLX4_DEV_CAP_FLAG_UC = 1LL << 1, |
| 124 | MLX4_DEV_CAP_FLAG_UD = 1LL << 2, | 129 | MLX4_DEV_CAP_FLAG_UD = 1LL << 2, |
| @@ -160,7 +165,9 @@ enum { | |||
| 160 | MLX4_DEV_CAP_FLAG2_TS = 1LL << 5, | 165 | MLX4_DEV_CAP_FLAG2_TS = 1LL << 5, |
| 161 | MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6, | 166 | MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6, |
| 162 | MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7, | 167 | MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7, |
| 163 | MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 8 | 168 | MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 8, |
| 169 | MLX4_DEV_CAP_FLAG2_DMFS_IPOIB = 1LL << 9, | ||
| 170 | MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS = 1LL << 10, | ||
| 164 | }; | 171 | }; |
| 165 | 172 | ||
| 166 | enum { | 173 | enum { |
| @@ -454,6 +461,8 @@ struct mlx4_caps { | |||
| 454 | u32 userspace_caps; /* userspace must be aware of these */ | 461 | u32 userspace_caps; /* userspace must be aware of these */ |
| 455 | u32 function_caps; /* VFs must be aware of these */ | 462 | u32 function_caps; /* VFs must be aware of these */ |
| 456 | u16 hca_core_clock; | 463 | u16 hca_core_clock; |
| 464 | u64 phys_port_id[MLX4_MAX_PORTS + 1]; | ||
| 465 | int tunnel_offload_mode; | ||
| 457 | }; | 466 | }; |
| 458 | 467 | ||
| 459 | struct mlx4_buf_list { | 468 | struct mlx4_buf_list { |
| @@ -908,6 +917,7 @@ enum mlx4_net_trans_rule_id { | |||
| 908 | MLX4_NET_TRANS_RULE_ID_IPV4, | 917 | MLX4_NET_TRANS_RULE_ID_IPV4, |
| 909 | MLX4_NET_TRANS_RULE_ID_TCP, | 918 | MLX4_NET_TRANS_RULE_ID_TCP, |
| 910 | MLX4_NET_TRANS_RULE_ID_UDP, | 919 | MLX4_NET_TRANS_RULE_ID_UDP, |
| 920 | MLX4_NET_TRANS_RULE_ID_VXLAN, | ||
| 911 | MLX4_NET_TRANS_RULE_NUM, /* should be last */ | 921 | MLX4_NET_TRANS_RULE_NUM, /* should be last */ |
| 912 | }; | 922 | }; |
| 913 | 923 | ||
| @@ -965,6 +975,12 @@ struct mlx4_spec_ib { | |||
| 965 | u8 dst_gid_msk[16]; | 975 | u8 dst_gid_msk[16]; |
| 966 | }; | 976 | }; |
| 967 | 977 | ||
| 978 | struct mlx4_spec_vxlan { | ||
| 979 | __be32 vni; | ||
| 980 | __be32 vni_mask; | ||
| 981 | |||
| 982 | }; | ||
| 983 | |||
| 968 | struct mlx4_spec_list { | 984 | struct mlx4_spec_list { |
| 969 | struct list_head list; | 985 | struct list_head list; |
| 970 | enum mlx4_net_trans_rule_id id; | 986 | enum mlx4_net_trans_rule_id id; |
| @@ -973,6 +989,7 @@ struct mlx4_spec_list { | |||
| 973 | struct mlx4_spec_ib ib; | 989 | struct mlx4_spec_ib ib; |
| 974 | struct mlx4_spec_ipv4 ipv4; | 990 | struct mlx4_spec_ipv4 ipv4; |
| 975 | struct mlx4_spec_tcp_udp tcp_udp; | 991 | struct mlx4_spec_tcp_udp tcp_udp; |
| 992 | struct mlx4_spec_vxlan vxlan; | ||
| 976 | }; | 993 | }; |
| 977 | }; | 994 | }; |
| 978 | 995 | ||
| @@ -1059,6 +1076,15 @@ struct mlx4_net_trans_rule_hw_ipv4 { | |||
| 1059 | __be32 src_ip_msk; | 1076 | __be32 src_ip_msk; |
| 1060 | } __packed; | 1077 | } __packed; |
| 1061 | 1078 | ||
| 1079 | struct mlx4_net_trans_rule_hw_vxlan { | ||
| 1080 | u8 size; | ||
| 1081 | u8 rsvd; | ||
| 1082 | __be16 id; | ||
| 1083 | __be32 rsvd1; | ||
| 1084 | __be32 vni; | ||
| 1085 | __be32 vni_mask; | ||
| 1086 | } __packed; | ||
| 1087 | |||
| 1062 | struct _rule_hw { | 1088 | struct _rule_hw { |
| 1063 | union { | 1089 | union { |
| 1064 | struct { | 1090 | struct { |
| @@ -1070,9 +1096,19 @@ struct _rule_hw { | |||
| 1070 | struct mlx4_net_trans_rule_hw_ib ib; | 1096 | struct mlx4_net_trans_rule_hw_ib ib; |
| 1071 | struct mlx4_net_trans_rule_hw_ipv4 ipv4; | 1097 | struct mlx4_net_trans_rule_hw_ipv4 ipv4; |
| 1072 | struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp; | 1098 | struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp; |
| 1099 | struct mlx4_net_trans_rule_hw_vxlan vxlan; | ||
| 1073 | }; | 1100 | }; |
| 1074 | }; | 1101 | }; |
| 1075 | 1102 | ||
| 1103 | enum { | ||
| 1104 | VXLAN_STEER_BY_OUTER_MAC = 1 << 0, | ||
| 1105 | VXLAN_STEER_BY_OUTER_VLAN = 1 << 1, | ||
| 1106 | VXLAN_STEER_BY_VSID_VNI = 1 << 2, | ||
| 1107 | VXLAN_STEER_BY_INNER_MAC = 1 << 3, | ||
| 1108 | VXLAN_STEER_BY_INNER_VLAN = 1 << 4, | ||
| 1109 | }; | ||
| 1110 | |||
| 1111 | |||
| 1076 | int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn, | 1112 | int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn, |
| 1077 | enum mlx4_net_trans_promisc_mode mode); | 1113 | enum mlx4_net_trans_promisc_mode mode); |
| 1078 | int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port, | 1114 | int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port, |
| @@ -1095,6 +1131,8 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn, | |||
| 1095 | int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc); | 1131 | int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc); |
| 1096 | int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, | 1132 | int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, |
| 1097 | u8 *pg, u16 *ratelimit); | 1133 | u8 *pg, u16 *ratelimit); |
| 1134 | int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering); | ||
| 1135 | int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx); | ||
| 1098 | int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); | 1136 | int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); |
| 1099 | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); | 1137 | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); |
| 1100 | void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan); | 1138 | void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan); |
| @@ -1113,6 +1151,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap, | |||
| 1113 | int *vector); | 1151 | int *vector); |
| 1114 | void mlx4_release_eq(struct mlx4_dev *dev, int vec); | 1152 | void mlx4_release_eq(struct mlx4_dev *dev, int vec); |
| 1115 | 1153 | ||
| 1154 | int mlx4_get_phys_port_id(struct mlx4_dev *dev); | ||
| 1116 | int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); | 1155 | int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); |
| 1117 | int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); | 1156 | int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); |
| 1118 | 1157 | ||
| @@ -1144,6 +1183,9 @@ int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, u8 port, int | |||
| 1144 | void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid); | 1183 | void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid); |
| 1145 | __be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave); | 1184 | __be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave); |
| 1146 | 1185 | ||
| 1186 | int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn, | ||
| 1187 | u32 max_range_qpn); | ||
| 1188 | |||
| 1147 | cycle_t mlx4_read_clock(struct mlx4_dev *dev); | 1189 | cycle_t mlx4_read_clock(struct mlx4_dev *dev); |
| 1148 | 1190 | ||
| 1149 | #endif /* MLX4_DEVICE_H */ | 1191 | #endif /* MLX4_DEVICE_H */ |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 6d351473c292..59f8ba84568b 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
| @@ -109,6 +109,10 @@ enum { | |||
| 109 | MLX4_RSS_TCP_IPV4 = 1 << 4, | 109 | MLX4_RSS_TCP_IPV4 = 1 << 4, |
| 110 | MLX4_RSS_IPV4 = 1 << 5, | 110 | MLX4_RSS_IPV4 = 1 << 5, |
| 111 | 111 | ||
| 112 | MLX4_RSS_BY_OUTER_HEADERS = 0 << 6, | ||
| 113 | MLX4_RSS_BY_INNER_HEADERS = 2 << 6, | ||
| 114 | MLX4_RSS_BY_INNER_HEADERS_IPONLY = 3 << 6, | ||
| 115 | |||
| 112 | /* offset of mlx4_rss_context within mlx4_qp_context.pri_path */ | 116 | /* offset of mlx4_rss_context within mlx4_qp_context.pri_path */ |
| 113 | MLX4_RSS_OFFSET_IN_QPC_PRI_PATH = 0x24, | 117 | MLX4_RSS_OFFSET_IN_QPC_PRI_PATH = 0x24, |
| 114 | /* offset of being RSS indirection QP within mlx4_qp_context.flags */ | 118 | /* offset of being RSS indirection QP within mlx4_qp_context.flags */ |
| @@ -252,6 +256,8 @@ enum { /* param3 */ | |||
| 252 | 256 | ||
| 253 | enum { | 257 | enum { |
| 254 | MLX4_WQE_CTRL_NEC = 1 << 29, | 258 | MLX4_WQE_CTRL_NEC = 1 << 29, |
| 259 | MLX4_WQE_CTRL_IIP = 1 << 28, | ||
| 260 | MLX4_WQE_CTRL_ILP = 1 << 27, | ||
| 255 | MLX4_WQE_CTRL_FENCE = 1 << 6, | 261 | MLX4_WQE_CTRL_FENCE = 1 << 6, |
| 256 | MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2, | 262 | MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2, |
| 257 | MLX4_WQE_CTRL_SOLICITED = 1 << 1, | 263 | MLX4_WQE_CTRL_SOLICITED = 1 << 1, |
diff --git a/include/linux/mlx5/cq.h b/include/linux/mlx5/cq.h index 3db67f73d96d..2202c7f72b75 100644 --- a/include/linux/mlx5/cq.h +++ b/include/linux/mlx5/cq.h | |||
| @@ -79,15 +79,23 @@ enum { | |||
| 79 | MLX5_CQE_RESP_SEND = 2, | 79 | MLX5_CQE_RESP_SEND = 2, |
| 80 | MLX5_CQE_RESP_SEND_IMM = 3, | 80 | MLX5_CQE_RESP_SEND_IMM = 3, |
| 81 | MLX5_CQE_RESP_SEND_INV = 4, | 81 | MLX5_CQE_RESP_SEND_INV = 4, |
| 82 | MLX5_CQE_RESIZE_CQ = 0xff, /* TBD */ | 82 | MLX5_CQE_RESIZE_CQ = 5, |
| 83 | MLX5_CQE_REQ_ERR = 13, | 83 | MLX5_CQE_REQ_ERR = 13, |
| 84 | MLX5_CQE_RESP_ERR = 14, | 84 | MLX5_CQE_RESP_ERR = 14, |
| 85 | MLX5_CQE_INVALID = 15, | ||
| 85 | }; | 86 | }; |
| 86 | 87 | ||
| 87 | enum { | 88 | enum { |
| 88 | MLX5_CQ_MODIFY_RESEIZE = 0, | 89 | MLX5_CQ_MODIFY_PERIOD = 1 << 0, |
| 89 | MLX5_CQ_MODIFY_MODER = 1, | 90 | MLX5_CQ_MODIFY_COUNT = 1 << 1, |
| 90 | MLX5_CQ_MODIFY_MAPPING = 2, | 91 | MLX5_CQ_MODIFY_OVERRUN = 1 << 2, |
| 92 | }; | ||
| 93 | |||
| 94 | enum { | ||
| 95 | MLX5_CQ_OPMOD_RESIZE = 1, | ||
| 96 | MLX5_MODIFY_CQ_MASK_LOG_SIZE = 1 << 0, | ||
| 97 | MLX5_MODIFY_CQ_MASK_PG_OFFSET = 1 << 1, | ||
| 98 | MLX5_MODIFY_CQ_MASK_PG_SIZE = 1 << 2, | ||
| 91 | }; | 99 | }; |
| 92 | 100 | ||
| 93 | struct mlx5_cq_modify_params { | 101 | struct mlx5_cq_modify_params { |
| @@ -158,7 +166,7 @@ int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); | |||
| 158 | int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, | 166 | int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, |
| 159 | struct mlx5_query_cq_mbox_out *out); | 167 | struct mlx5_query_cq_mbox_out *out); |
| 160 | int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, | 168 | int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, |
| 161 | int type, struct mlx5_cq_modify_params *params); | 169 | struct mlx5_modify_cq_mbox_in *in, int in_sz); |
| 162 | int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); | 170 | int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); |
| 163 | void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); | 171 | void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); |
| 164 | 172 | ||
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index da78875807fc..817a6fae6d2c 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h | |||
| @@ -104,9 +104,10 @@ enum { | |||
| 104 | }; | 104 | }; |
| 105 | 105 | ||
| 106 | enum { | 106 | enum { |
| 107 | MLX5_BF_REGS_PER_PAGE = 4, | 107 | MLX5_BF_REGS_PER_PAGE = 4, |
| 108 | MLX5_MAX_UAR_PAGES = 1 << 8, | 108 | MLX5_MAX_UAR_PAGES = 1 << 8, |
| 109 | MLX5_MAX_UUARS = MLX5_MAX_UAR_PAGES * MLX5_BF_REGS_PER_PAGE, | 109 | MLX5_NON_FP_BF_REGS_PER_PAGE = 2, |
| 110 | MLX5_MAX_UUARS = MLX5_MAX_UAR_PAGES * MLX5_NON_FP_BF_REGS_PER_PAGE, | ||
| 110 | }; | 111 | }; |
| 111 | 112 | ||
| 112 | enum { | 113 | enum { |
| @@ -176,6 +177,8 @@ enum { | |||
| 176 | MLX5_DEV_CAP_FLAG_APM = 1LL << 17, | 177 | MLX5_DEV_CAP_FLAG_APM = 1LL << 17, |
| 177 | MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 18, | 178 | MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 18, |
| 178 | MLX5_DEV_CAP_FLAG_ON_DMND_PG = 1LL << 24, | 179 | MLX5_DEV_CAP_FLAG_ON_DMND_PG = 1LL << 24, |
| 180 | MLX5_DEV_CAP_FLAG_CQ_MODER = 1LL << 29, | ||
| 181 | MLX5_DEV_CAP_FLAG_RESIZE_CQ = 1LL << 30, | ||
| 179 | MLX5_DEV_CAP_FLAG_RESIZE_SRQ = 1LL << 32, | 182 | MLX5_DEV_CAP_FLAG_RESIZE_SRQ = 1LL << 32, |
| 180 | MLX5_DEV_CAP_FLAG_REMOTE_FENCE = 1LL << 38, | 183 | MLX5_DEV_CAP_FLAG_REMOTE_FENCE = 1LL << 38, |
| 181 | MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39, | 184 | MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39, |
| @@ -231,7 +234,8 @@ enum { | |||
| 231 | }; | 234 | }; |
| 232 | 235 | ||
| 233 | enum { | 236 | enum { |
| 234 | MLX5_ADAPTER_PAGE_SHIFT = 12 | 237 | MLX5_ADAPTER_PAGE_SHIFT = 12, |
| 238 | MLX5_ADAPTER_PAGE_SIZE = 1 << MLX5_ADAPTER_PAGE_SHIFT, | ||
| 235 | }; | 239 | }; |
| 236 | 240 | ||
| 237 | enum { | 241 | enum { |
| @@ -697,6 +701,20 @@ struct mlx5_query_cq_mbox_out { | |||
| 697 | __be64 pas[0]; | 701 | __be64 pas[0]; |
| 698 | }; | 702 | }; |
| 699 | 703 | ||
| 704 | struct mlx5_modify_cq_mbox_in { | ||
| 705 | struct mlx5_inbox_hdr hdr; | ||
| 706 | __be32 cqn; | ||
| 707 | __be32 field_select; | ||
| 708 | struct mlx5_cq_context ctx; | ||
| 709 | u8 rsvd[192]; | ||
| 710 | __be64 pas[0]; | ||
| 711 | }; | ||
| 712 | |||
| 713 | struct mlx5_modify_cq_mbox_out { | ||
| 714 | struct mlx5_outbox_hdr hdr; | ||
| 715 | u8 rsvd[8]; | ||
| 716 | }; | ||
| 717 | |||
| 700 | struct mlx5_enable_hca_mbox_in { | 718 | struct mlx5_enable_hca_mbox_in { |
| 701 | struct mlx5_inbox_hdr hdr; | 719 | struct mlx5_inbox_hdr hdr; |
| 702 | u8 rsvd[8]; | 720 | u8 rsvd[8]; |
| @@ -831,8 +849,8 @@ struct mlx5_create_mkey_mbox_in { | |||
| 831 | struct mlx5_mkey_seg seg; | 849 | struct mlx5_mkey_seg seg; |
| 832 | u8 rsvd1[16]; | 850 | u8 rsvd1[16]; |
| 833 | __be32 xlat_oct_act_size; | 851 | __be32 xlat_oct_act_size; |
| 834 | __be32 bsf_coto_act_size; | 852 | __be32 rsvd2; |
| 835 | u8 rsvd2[168]; | 853 | u8 rsvd3[168]; |
| 836 | __be64 pas[0]; | 854 | __be64 pas[0]; |
| 837 | }; | 855 | }; |
| 838 | 856 | ||
| @@ -871,6 +889,7 @@ struct mlx5_modify_mkey_mbox_in { | |||
| 871 | 889 | ||
| 872 | struct mlx5_modify_mkey_mbox_out { | 890 | struct mlx5_modify_mkey_mbox_out { |
| 873 | struct mlx5_outbox_hdr hdr; | 891 | struct mlx5_outbox_hdr hdr; |
| 892 | u8 rsvd[8]; | ||
| 874 | }; | 893 | }; |
| 875 | 894 | ||
| 876 | struct mlx5_dump_mkey_mbox_in { | 895 | struct mlx5_dump_mkey_mbox_in { |
diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h index d9e3eacb3a7f..d51eff713549 100644 --- a/include/linux/mlx5/qp.h +++ b/include/linux/mlx5/qp.h | |||
| @@ -464,4 +464,49 @@ void mlx5_cleanup_qp_table(struct mlx5_core_dev *dev); | |||
| 464 | int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); | 464 | int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); |
| 465 | void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); | 465 | void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); |
| 466 | 466 | ||
| 467 | static inline const char *mlx5_qp_type_str(int type) | ||
| 468 | { | ||
| 469 | switch (type) { | ||
| 470 | case MLX5_QP_ST_RC: return "RC"; | ||
| 471 | case MLX5_QP_ST_UC: return "C"; | ||
| 472 | case MLX5_QP_ST_UD: return "UD"; | ||
| 473 | case MLX5_QP_ST_XRC: return "XRC"; | ||
| 474 | case MLX5_QP_ST_MLX: return "MLX"; | ||
| 475 | case MLX5_QP_ST_QP0: return "QP0"; | ||
| 476 | case MLX5_QP_ST_QP1: return "QP1"; | ||
| 477 | case MLX5_QP_ST_RAW_ETHERTYPE: return "RAW_ETHERTYPE"; | ||
| 478 | case MLX5_QP_ST_RAW_IPV6: return "RAW_IPV6"; | ||
| 479 | case MLX5_QP_ST_SNIFFER: return "SNIFFER"; | ||
| 480 | case MLX5_QP_ST_SYNC_UMR: return "SYNC_UMR"; | ||
| 481 | case MLX5_QP_ST_PTP_1588: return "PTP_1588"; | ||
| 482 | case MLX5_QP_ST_REG_UMR: return "REG_UMR"; | ||
| 483 | default: return "Invalid transport type"; | ||
| 484 | } | ||
| 485 | } | ||
| 486 | |||
| 487 | static inline const char *mlx5_qp_state_str(int state) | ||
| 488 | { | ||
| 489 | switch (state) { | ||
| 490 | case MLX5_QP_STATE_RST: | ||
| 491 | return "RST"; | ||
| 492 | case MLX5_QP_STATE_INIT: | ||
| 493 | return "INIT"; | ||
| 494 | case MLX5_QP_STATE_RTR: | ||
| 495 | return "RTR"; | ||
| 496 | case MLX5_QP_STATE_RTS: | ||
| 497 | return "RTS"; | ||
| 498 | case MLX5_QP_STATE_SQER: | ||
| 499 | return "SQER"; | ||
| 500 | case MLX5_QP_STATE_SQD: | ||
| 501 | return "SQD"; | ||
| 502 | case MLX5_QP_STATE_ERR: | ||
| 503 | return "ERR"; | ||
| 504 | case MLX5_QP_STATE_SQ_DRAINING: | ||
| 505 | return "SQ_DRAINING"; | ||
| 506 | case MLX5_QP_STATE_SUSPENDED: | ||
| 507 | return "SUSPENDED"; | ||
| 508 | default: return "Invalid QP state"; | ||
| 509 | } | ||
| 510 | } | ||
| 511 | |||
| 467 | #endif /* MLX5_QP_H */ | 512 | #endif /* MLX5_QP_H */ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 1cedd000cf29..d9992fc128ca 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
| 7 | 7 | ||
| 8 | #include <linux/mmdebug.h> | ||
| 8 | #include <linux/gfp.h> | 9 | #include <linux/gfp.h> |
| 9 | #include <linux/bug.h> | 10 | #include <linux/bug.h> |
| 10 | #include <linux/list.h> | 11 | #include <linux/list.h> |
| @@ -57,6 +58,15 @@ extern int sysctl_legacy_va_layout; | |||
| 57 | extern unsigned long sysctl_user_reserve_kbytes; | 58 | extern unsigned long sysctl_user_reserve_kbytes; |
| 58 | extern unsigned long sysctl_admin_reserve_kbytes; | 59 | extern unsigned long sysctl_admin_reserve_kbytes; |
| 59 | 60 | ||
| 61 | extern int sysctl_overcommit_memory; | ||
| 62 | extern int sysctl_overcommit_ratio; | ||
| 63 | extern unsigned long sysctl_overcommit_kbytes; | ||
| 64 | |||
| 65 | extern int overcommit_ratio_handler(struct ctl_table *, int, void __user *, | ||
| 66 | size_t *, loff_t *); | ||
| 67 | extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *, | ||
| 68 | size_t *, loff_t *); | ||
| 69 | |||
| 60 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) | 70 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) |
| 61 | 71 | ||
| 62 | /* to align the pointer to the (next) page boundary */ | 72 | /* to align the pointer to the (next) page boundary */ |
| @@ -294,7 +304,7 @@ static inline int get_freepage_migratetype(struct page *page) | |||
| 294 | */ | 304 | */ |
| 295 | static inline int put_page_testzero(struct page *page) | 305 | static inline int put_page_testzero(struct page *page) |
| 296 | { | 306 | { |
| 297 | VM_BUG_ON(atomic_read(&page->_count) == 0); | 307 | VM_BUG_ON_PAGE(atomic_read(&page->_count) == 0, page); |
| 298 | return atomic_dec_and_test(&page->_count); | 308 | return atomic_dec_and_test(&page->_count); |
| 299 | } | 309 | } |
| 300 | 310 | ||
| @@ -355,7 +365,7 @@ static inline int is_vmalloc_or_module_addr(const void *x) | |||
| 355 | static inline void compound_lock(struct page *page) | 365 | static inline void compound_lock(struct page *page) |
| 356 | { | 366 | { |
| 357 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 367 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 358 | VM_BUG_ON(PageSlab(page)); | 368 | VM_BUG_ON_PAGE(PageSlab(page), page); |
| 359 | bit_spin_lock(PG_compound_lock, &page->flags); | 369 | bit_spin_lock(PG_compound_lock, &page->flags); |
| 360 | #endif | 370 | #endif |
| 361 | } | 371 | } |
| @@ -363,7 +373,7 @@ static inline void compound_lock(struct page *page) | |||
| 363 | static inline void compound_unlock(struct page *page) | 373 | static inline void compound_unlock(struct page *page) |
| 364 | { | 374 | { |
| 365 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 375 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 366 | VM_BUG_ON(PageSlab(page)); | 376 | VM_BUG_ON_PAGE(PageSlab(page), page); |
| 367 | bit_spin_unlock(PG_compound_lock, &page->flags); | 377 | bit_spin_unlock(PG_compound_lock, &page->flags); |
| 368 | #endif | 378 | #endif |
| 369 | } | 379 | } |
| @@ -414,15 +424,44 @@ static inline int page_count(struct page *page) | |||
| 414 | return atomic_read(&compound_head(page)->_count); | 424 | return atomic_read(&compound_head(page)->_count); |
| 415 | } | 425 | } |
| 416 | 426 | ||
| 427 | #ifdef CONFIG_HUGETLB_PAGE | ||
| 428 | extern int PageHeadHuge(struct page *page_head); | ||
| 429 | #else /* CONFIG_HUGETLB_PAGE */ | ||
| 430 | static inline int PageHeadHuge(struct page *page_head) | ||
| 431 | { | ||
| 432 | return 0; | ||
| 433 | } | ||
| 434 | #endif /* CONFIG_HUGETLB_PAGE */ | ||
| 435 | |||
| 436 | static inline bool __compound_tail_refcounted(struct page *page) | ||
| 437 | { | ||
| 438 | return !PageSlab(page) && !PageHeadHuge(page); | ||
| 439 | } | ||
| 440 | |||
| 441 | /* | ||
| 442 | * This takes a head page as parameter and tells if the | ||
| 443 | * tail page reference counting can be skipped. | ||
| 444 | * | ||
| 445 | * For this to be safe, PageSlab and PageHeadHuge must remain true on | ||
| 446 | * any given page where they return true here, until all tail pins | ||
| 447 | * have been released. | ||
| 448 | */ | ||
| 449 | static inline bool compound_tail_refcounted(struct page *page) | ||
| 450 | { | ||
| 451 | VM_BUG_ON_PAGE(!PageHead(page), page); | ||
| 452 | return __compound_tail_refcounted(page); | ||
| 453 | } | ||
| 454 | |||
| 417 | static inline void get_huge_page_tail(struct page *page) | 455 | static inline void get_huge_page_tail(struct page *page) |
| 418 | { | 456 | { |
| 419 | /* | 457 | /* |
| 420 | * __split_huge_page_refcount() cannot run | 458 | * __split_huge_page_refcount() cannot run from under us. |
| 421 | * from under us. | ||
| 422 | */ | 459 | */ |
| 423 | VM_BUG_ON(page_mapcount(page) < 0); | 460 | VM_BUG_ON_PAGE(!PageTail(page), page); |
| 424 | VM_BUG_ON(atomic_read(&page->_count) != 0); | 461 | VM_BUG_ON_PAGE(page_mapcount(page) < 0, page); |
| 425 | atomic_inc(&page->_mapcount); | 462 | VM_BUG_ON_PAGE(atomic_read(&page->_count) != 0, page); |
| 463 | if (compound_tail_refcounted(page->first_page)) | ||
| 464 | atomic_inc(&page->_mapcount); | ||
| 426 | } | 465 | } |
| 427 | 466 | ||
| 428 | extern bool __get_page_tail(struct page *page); | 467 | extern bool __get_page_tail(struct page *page); |
| @@ -436,7 +475,7 @@ static inline void get_page(struct page *page) | |||
| 436 | * Getting a normal page or the head of a compound page | 475 | * Getting a normal page or the head of a compound page |
| 437 | * requires to already have an elevated page->_count. | 476 | * requires to already have an elevated page->_count. |
| 438 | */ | 477 | */ |
| 439 | VM_BUG_ON(atomic_read(&page->_count) <= 0); | 478 | VM_BUG_ON_PAGE(atomic_read(&page->_count) <= 0, page); |
| 440 | atomic_inc(&page->_count); | 479 | atomic_inc(&page->_count); |
| 441 | } | 480 | } |
| 442 | 481 | ||
| @@ -473,13 +512,13 @@ static inline int PageBuddy(struct page *page) | |||
| 473 | 512 | ||
| 474 | static inline void __SetPageBuddy(struct page *page) | 513 | static inline void __SetPageBuddy(struct page *page) |
| 475 | { | 514 | { |
| 476 | VM_BUG_ON(atomic_read(&page->_mapcount) != -1); | 515 | VM_BUG_ON_PAGE(atomic_read(&page->_mapcount) != -1, page); |
| 477 | atomic_set(&page->_mapcount, PAGE_BUDDY_MAPCOUNT_VALUE); | 516 | atomic_set(&page->_mapcount, PAGE_BUDDY_MAPCOUNT_VALUE); |
| 478 | } | 517 | } |
| 479 | 518 | ||
| 480 | static inline void __ClearPageBuddy(struct page *page) | 519 | static inline void __ClearPageBuddy(struct page *page) |
| 481 | { | 520 | { |
| 482 | VM_BUG_ON(!PageBuddy(page)); | 521 | VM_BUG_ON_PAGE(!PageBuddy(page), page); |
| 483 | atomic_set(&page->_mapcount, -1); | 522 | atomic_set(&page->_mapcount, -1); |
| 484 | } | 523 | } |
| 485 | 524 | ||
| @@ -846,11 +885,14 @@ static __always_inline void *lowmem_page_address(const struct page *page) | |||
| 846 | #endif | 885 | #endif |
| 847 | 886 | ||
| 848 | #if defined(WANT_PAGE_VIRTUAL) | 887 | #if defined(WANT_PAGE_VIRTUAL) |
| 849 | #define page_address(page) ((page)->virtual) | 888 | static inline void *page_address(const struct page *page) |
| 850 | #define set_page_address(page, address) \ | 889 | { |
| 851 | do { \ | 890 | return page->virtual; |
| 852 | (page)->virtual = (address); \ | 891 | } |
| 853 | } while(0) | 892 | static inline void set_page_address(struct page *page, void *address) |
| 893 | { | ||
| 894 | page->virtual = address; | ||
| 895 | } | ||
| 854 | #define page_address_init() do { } while(0) | 896 | #define page_address_init() do { } while(0) |
| 855 | #endif | 897 | #endif |
| 856 | 898 | ||
| @@ -984,7 +1026,6 @@ extern void pagefault_out_of_memory(void); | |||
| 984 | * various contexts. | 1026 | * various contexts. |
| 985 | */ | 1027 | */ |
| 986 | #define SHOW_MEM_FILTER_NODES (0x0001u) /* disallowed nodes */ | 1028 | #define SHOW_MEM_FILTER_NODES (0x0001u) /* disallowed nodes */ |
| 987 | #define SHOW_MEM_FILTER_PAGE_COUNT (0x0002u) /* page type count */ | ||
| 988 | 1029 | ||
| 989 | extern void show_free_areas(unsigned int flags); | 1030 | extern void show_free_areas(unsigned int flags); |
| 990 | extern bool skip_free_areas_node(unsigned int flags, int nid); | 1031 | extern bool skip_free_areas_node(unsigned int flags, int nid); |
| @@ -1317,7 +1358,8 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a | |||
| 1317 | #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ | 1358 | #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ |
| 1318 | 1359 | ||
| 1319 | #if USE_SPLIT_PTE_PTLOCKS | 1360 | #if USE_SPLIT_PTE_PTLOCKS |
| 1320 | #if BLOATED_SPINLOCKS | 1361 | #if ALLOC_SPLIT_PTLOCKS |
| 1362 | void __init ptlock_cache_init(void); | ||
| 1321 | extern bool ptlock_alloc(struct page *page); | 1363 | extern bool ptlock_alloc(struct page *page); |
| 1322 | extern void ptlock_free(struct page *page); | 1364 | extern void ptlock_free(struct page *page); |
| 1323 | 1365 | ||
| @@ -1325,7 +1367,11 @@ static inline spinlock_t *ptlock_ptr(struct page *page) | |||
| 1325 | { | 1367 | { |
| 1326 | return page->ptl; | 1368 | return page->ptl; |
| 1327 | } | 1369 | } |
| 1328 | #else /* BLOATED_SPINLOCKS */ | 1370 | #else /* ALLOC_SPLIT_PTLOCKS */ |
| 1371 | static inline void ptlock_cache_init(void) | ||
| 1372 | { | ||
| 1373 | } | ||
| 1374 | |||
| 1329 | static inline bool ptlock_alloc(struct page *page) | 1375 | static inline bool ptlock_alloc(struct page *page) |
| 1330 | { | 1376 | { |
| 1331 | return true; | 1377 | return true; |
| @@ -1339,7 +1385,7 @@ static inline spinlock_t *ptlock_ptr(struct page *page) | |||
| 1339 | { | 1385 | { |
| 1340 | return &page->ptl; | 1386 | return &page->ptl; |
| 1341 | } | 1387 | } |
| 1342 | #endif /* BLOATED_SPINLOCKS */ | 1388 | #endif /* ALLOC_SPLIT_PTLOCKS */ |
| 1343 | 1389 | ||
| 1344 | static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) | 1390 | static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) |
| 1345 | { | 1391 | { |
| @@ -1356,7 +1402,7 @@ static inline bool ptlock_init(struct page *page) | |||
| 1356 | * slab code uses page->slab_cache and page->first_page (for tail | 1402 | * slab code uses page->slab_cache and page->first_page (for tail |
| 1357 | * pages), which share storage with page->ptl. | 1403 | * pages), which share storage with page->ptl. |
| 1358 | */ | 1404 | */ |
| 1359 | VM_BUG_ON(*(unsigned long *)&page->ptl); | 1405 | VM_BUG_ON_PAGE(*(unsigned long *)&page->ptl, page); |
| 1360 | if (!ptlock_alloc(page)) | 1406 | if (!ptlock_alloc(page)) |
| 1361 | return false; | 1407 | return false; |
| 1362 | spin_lock_init(ptlock_ptr(page)); | 1408 | spin_lock_init(ptlock_ptr(page)); |
| @@ -1378,10 +1424,17 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) | |||
| 1378 | { | 1424 | { |
| 1379 | return &mm->page_table_lock; | 1425 | return &mm->page_table_lock; |
| 1380 | } | 1426 | } |
| 1427 | static inline void ptlock_cache_init(void) {} | ||
| 1381 | static inline bool ptlock_init(struct page *page) { return true; } | 1428 | static inline bool ptlock_init(struct page *page) { return true; } |
| 1382 | static inline void pte_lock_deinit(struct page *page) {} | 1429 | static inline void pte_lock_deinit(struct page *page) {} |
| 1383 | #endif /* USE_SPLIT_PTE_PTLOCKS */ | 1430 | #endif /* USE_SPLIT_PTE_PTLOCKS */ |
| 1384 | 1431 | ||
| 1432 | static inline void pgtable_init(void) | ||
| 1433 | { | ||
| 1434 | ptlock_cache_init(); | ||
| 1435 | pgtable_cache_init(); | ||
| 1436 | } | ||
| 1437 | |||
| 1385 | static inline bool pgtable_page_ctor(struct page *page) | 1438 | static inline bool pgtable_page_ctor(struct page *page) |
| 1386 | { | 1439 | { |
| 1387 | inc_zone_page_state(page, NR_PAGETABLE); | 1440 | inc_zone_page_state(page, NR_PAGETABLE); |
| @@ -1440,7 +1493,7 @@ static inline bool pgtable_pmd_page_ctor(struct page *page) | |||
| 1440 | static inline void pgtable_pmd_page_dtor(struct page *page) | 1493 | static inline void pgtable_pmd_page_dtor(struct page *page) |
| 1441 | { | 1494 | { |
| 1442 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 1495 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 1443 | VM_BUG_ON(page->pmd_huge_pte); | 1496 | VM_BUG_ON_PAGE(page->pmd_huge_pte, page); |
| 1444 | #endif | 1497 | #endif |
| 1445 | ptlock_free(page); | 1498 | ptlock_free(page); |
| 1446 | } | 1499 | } |
| @@ -1977,8 +2030,6 @@ extern void shake_page(struct page *p, int access); | |||
| 1977 | extern atomic_long_t num_poisoned_pages; | 2030 | extern atomic_long_t num_poisoned_pages; |
| 1978 | extern int soft_offline_page(struct page *page, int flags); | 2031 | extern int soft_offline_page(struct page *page, int flags); |
| 1979 | 2032 | ||
| 1980 | extern void dump_page(struct page *page); | ||
| 1981 | |||
| 1982 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS) | 2033 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS) |
| 1983 | extern void clear_huge_page(struct page *page, | 2034 | extern void clear_huge_page(struct page *page, |
| 1984 | unsigned long addr, | 2035 | unsigned long addr, |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index bd299418a934..290901a8c1de 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -26,6 +26,7 @@ struct address_space; | |||
| 26 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) | 26 | #define USE_SPLIT_PTE_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) |
| 27 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ | 27 | #define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ |
| 28 | IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK)) | 28 | IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK)) |
| 29 | #define ALLOC_SPLIT_PTLOCKS (SPINLOCK_SIZE > BITS_PER_LONG/8) | ||
| 29 | 30 | ||
| 30 | /* | 31 | /* |
| 31 | * Each physical page in the system has a struct page associated with | 32 | * Each physical page in the system has a struct page associated with |
| @@ -155,7 +156,7 @@ struct page { | |||
| 155 | * system if PG_buddy is set. | 156 | * system if PG_buddy is set. |
| 156 | */ | 157 | */ |
| 157 | #if USE_SPLIT_PTE_PTLOCKS | 158 | #if USE_SPLIT_PTE_PTLOCKS |
| 158 | #if BLOATED_SPINLOCKS | 159 | #if ALLOC_SPLIT_PTLOCKS |
| 159 | spinlock_t *ptl; | 160 | spinlock_t *ptl; |
| 160 | #else | 161 | #else |
| 161 | spinlock_t ptl; | 162 | spinlock_t ptl; |
| @@ -443,6 +444,14 @@ struct mm_struct { | |||
| 443 | /* numa_scan_seq prevents two threads setting pte_numa */ | 444 | /* numa_scan_seq prevents two threads setting pte_numa */ |
| 444 | int numa_scan_seq; | 445 | int numa_scan_seq; |
| 445 | #endif | 446 | #endif |
| 447 | #if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION) | ||
| 448 | /* | ||
| 449 | * An operation with batched TLB flushing is going on. Anything that | ||
| 450 | * can move process memory needs to flush the TLB when moving a | ||
| 451 | * PROT_NONE or PROT_NUMA mapped page. | ||
| 452 | */ | ||
| 453 | bool tlb_flush_pending; | ||
| 454 | #endif | ||
| 446 | struct uprobes_state uprobes_state; | 455 | struct uprobes_state uprobes_state; |
| 447 | }; | 456 | }; |
| 448 | 457 | ||
| @@ -459,4 +468,45 @@ static inline cpumask_t *mm_cpumask(struct mm_struct *mm) | |||
| 459 | return mm->cpu_vm_mask_var; | 468 | return mm->cpu_vm_mask_var; |
| 460 | } | 469 | } |
| 461 | 470 | ||
| 471 | #if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION) | ||
| 472 | /* | ||
| 473 | * Memory barriers to keep this state in sync are graciously provided by | ||
| 474 | * the page table locks, outside of which no page table modifications happen. | ||
| 475 | * The barriers below prevent the compiler from re-ordering the instructions | ||
| 476 | * around the memory barriers that are already present in the code. | ||
| 477 | */ | ||
| 478 | static inline bool mm_tlb_flush_pending(struct mm_struct *mm) | ||
| 479 | { | ||
| 480 | barrier(); | ||
| 481 | return mm->tlb_flush_pending; | ||
| 482 | } | ||
| 483 | static inline void set_tlb_flush_pending(struct mm_struct *mm) | ||
| 484 | { | ||
| 485 | mm->tlb_flush_pending = true; | ||
| 486 | |||
| 487 | /* | ||
| 488 | * Guarantee that the tlb_flush_pending store does not leak into the | ||
| 489 | * critical section updating the page tables | ||
| 490 | */ | ||
| 491 | smp_mb__before_spinlock(); | ||
| 492 | } | ||
| 493 | /* Clearing is done after a TLB flush, which also provides a barrier. */ | ||
| 494 | static inline void clear_tlb_flush_pending(struct mm_struct *mm) | ||
| 495 | { | ||
| 496 | barrier(); | ||
| 497 | mm->tlb_flush_pending = false; | ||
| 498 | } | ||
| 499 | #else | ||
| 500 | static inline bool mm_tlb_flush_pending(struct mm_struct *mm) | ||
| 501 | { | ||
| 502 | return false; | ||
| 503 | } | ||
| 504 | static inline void set_tlb_flush_pending(struct mm_struct *mm) | ||
| 505 | { | ||
| 506 | } | ||
| 507 | static inline void clear_tlb_flush_pending(struct mm_struct *mm) | ||
| 508 | { | ||
| 509 | } | ||
| 510 | #endif | ||
| 511 | |||
| 462 | #endif /* _LINUX_MM_TYPES_H */ | 512 | #endif /* _LINUX_MM_TYPES_H */ |
diff --git a/include/linux/mman.h b/include/linux/mman.h index 7f7f8dae4b1d..16373c8f5f57 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | extern int sysctl_overcommit_memory; | 10 | extern int sysctl_overcommit_memory; |
| 11 | extern int sysctl_overcommit_ratio; | 11 | extern int sysctl_overcommit_ratio; |
| 12 | extern unsigned long sysctl_overcommit_kbytes; | ||
| 12 | extern struct percpu_counter vm_committed_as; | 13 | extern struct percpu_counter vm_committed_as; |
| 13 | 14 | ||
| 14 | #ifdef CONFIG_SMP | 15 | #ifdef CONFIG_SMP |
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index 9f03feedc8e7..d8836623f36a 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h | |||
| @@ -23,6 +23,15 @@ | |||
| 23 | /* | 23 | /* |
| 24 | * Vendors and devices. Sort key: vendor first, device next. | 24 | * Vendors and devices. Sort key: vendor first, device next. |
| 25 | */ | 25 | */ |
| 26 | #define SDIO_VENDOR_ID_BROADCOM 0x02d0 | ||
| 27 | #define SDIO_DEVICE_ID_BROADCOM_43143 43143 | ||
| 28 | #define SDIO_DEVICE_ID_BROADCOM_43241 0x4324 | ||
| 29 | #define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 | ||
| 30 | #define SDIO_DEVICE_ID_BROADCOM_4330 0x4330 | ||
| 31 | #define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 | ||
| 32 | #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 | ||
| 33 | #define SDIO_DEVICE_ID_BROADCOM_43362 43362 | ||
| 34 | |||
| 26 | #define SDIO_VENDOR_ID_INTEL 0x0089 | 35 | #define SDIO_VENDOR_ID_INTEL 0x0089 |
| 27 | #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402 | 36 | #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402 |
| 28 | #define SDIO_DEVICE_ID_INTEL_IWMC3200WIFI 0x1403 | 37 | #define SDIO_DEVICE_ID_INTEL_IWMC3200WIFI 0x1403 |
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h index 580bd587d916..5042c036dda9 100644 --- a/include/linux/mmdebug.h +++ b/include/linux/mmdebug.h | |||
| @@ -1,10 +1,19 @@ | |||
| 1 | #ifndef LINUX_MM_DEBUG_H | 1 | #ifndef LINUX_MM_DEBUG_H |
| 2 | #define LINUX_MM_DEBUG_H 1 | 2 | #define LINUX_MM_DEBUG_H 1 |
| 3 | 3 | ||
| 4 | struct page; | ||
| 5 | |||
| 6 | extern void dump_page(struct page *page, char *reason); | ||
| 7 | extern void dump_page_badflags(struct page *page, char *reason, | ||
| 8 | unsigned long badflags); | ||
| 9 | |||
| 4 | #ifdef CONFIG_DEBUG_VM | 10 | #ifdef CONFIG_DEBUG_VM |
| 5 | #define VM_BUG_ON(cond) BUG_ON(cond) | 11 | #define VM_BUG_ON(cond) BUG_ON(cond) |
| 12 | #define VM_BUG_ON_PAGE(cond, page) \ | ||
| 13 | do { if (unlikely(cond)) { dump_page(page, NULL); BUG(); } } while (0) | ||
| 6 | #else | 14 | #else |
| 7 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond) | 15 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond) |
| 16 | #define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond) | ||
| 8 | #endif | 17 | #endif |
| 9 | 18 | ||
| 10 | #ifdef CONFIG_DEBUG_VIRTUAL | 19 | #ifdef CONFIG_DEBUG_VIRTUAL |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index bd791e452ad7..5f2052c83154 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -490,6 +490,12 @@ struct zone { | |||
| 490 | unsigned long managed_pages; | 490 | unsigned long managed_pages; |
| 491 | 491 | ||
| 492 | /* | 492 | /* |
| 493 | * Number of MIGRATE_RESEVE page block. To maintain for just | ||
| 494 | * optimization. Protected by zone->lock. | ||
| 495 | */ | ||
| 496 | int nr_migrate_reserve_block; | ||
| 497 | |||
| 498 | /* | ||
| 493 | * rarely used fields: | 499 | * rarely used fields: |
| 494 | */ | 500 | */ |
| 495 | const char *name; | 501 | const char *name; |
| @@ -758,10 +764,7 @@ typedef struct pglist_data { | |||
| 758 | int kswapd_max_order; | 764 | int kswapd_max_order; |
| 759 | enum zone_type classzone_idx; | 765 | enum zone_type classzone_idx; |
| 760 | #ifdef CONFIG_NUMA_BALANCING | 766 | #ifdef CONFIG_NUMA_BALANCING |
| 761 | /* | 767 | /* Lock serializing the migrate rate limiting window */ |
| 762 | * Lock serializing the per destination node AutoNUMA memory | ||
| 763 | * migration rate limiting data. | ||
| 764 | */ | ||
| 765 | spinlock_t numabalancing_migrate_lock; | 768 | spinlock_t numabalancing_migrate_lock; |
| 766 | 769 | ||
| 767 | /* Rate limiting time interval */ | 770 | /* Rate limiting time interval */ |
diff --git a/include/linux/module.h b/include/linux/module.h index 15cd6b1b211e..eaf60ff9ba94 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -29,8 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | #define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN | 30 | #define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN |
| 31 | 31 | ||
| 32 | struct modversion_info | 32 | struct modversion_info { |
| 33 | { | ||
| 34 | unsigned long crc; | 33 | unsigned long crc; |
| 35 | char name[MODULE_NAME_LEN]; | 34 | char name[MODULE_NAME_LEN]; |
| 36 | }; | 35 | }; |
| @@ -84,12 +83,12 @@ void sort_main_extable(void); | |||
| 84 | void trim_init_extable(struct module *m); | 83 | void trim_init_extable(struct module *m); |
| 85 | 84 | ||
| 86 | #ifdef MODULE | 85 | #ifdef MODULE |
| 87 | #define MODULE_GENERIC_TABLE(gtype,name) \ | 86 | #define MODULE_GENERIC_TABLE(gtype, name) \ |
| 88 | extern const struct gtype##_id __mod_##gtype##_table \ | 87 | extern const struct gtype##_id __mod_##gtype##_table \ |
| 89 | __attribute__ ((unused, alias(__stringify(name)))) | 88 | __attribute__ ((unused, alias(__stringify(name)))) |
| 90 | 89 | ||
| 91 | #else /* !MODULE */ | 90 | #else /* !MODULE */ |
| 92 | #define MODULE_GENERIC_TABLE(gtype,name) | 91 | #define MODULE_GENERIC_TABLE(gtype, name) |
| 93 | #endif | 92 | #endif |
| 94 | 93 | ||
| 95 | /* Generic info of form tag = "info" */ | 94 | /* Generic info of form tag = "info" */ |
| @@ -126,7 +125,7 @@ extern const struct gtype##_id __mod_##gtype##_table \ | |||
| 126 | * is a GPL combined work. | 125 | * is a GPL combined work. |
| 127 | * | 126 | * |
| 128 | * This exists for several reasons | 127 | * This exists for several reasons |
| 129 | * 1. So modinfo can show license info for users wanting to vet their setup | 128 | * 1. So modinfo can show license info for users wanting to vet their setup |
| 130 | * is free | 129 | * is free |
| 131 | * 2. So the community can ignore bug reports including proprietary modules | 130 | * 2. So the community can ignore bug reports including proprietary modules |
| 132 | * 3. So vendors can do likewise based on their own policies | 131 | * 3. So vendors can do likewise based on their own policies |
| @@ -138,27 +137,29 @@ extern const struct gtype##_id __mod_##gtype##_table \ | |||
| 138 | * authors use multiple MODULE_AUTHOR() statements/lines. | 137 | * authors use multiple MODULE_AUTHOR() statements/lines. |
| 139 | */ | 138 | */ |
| 140 | #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) | 139 | #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) |
| 141 | 140 | ||
| 142 | /* What your module does. */ | 141 | /* What your module does. */ |
| 143 | #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) | 142 | #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) |
| 144 | 143 | ||
| 145 | #define MODULE_DEVICE_TABLE(type,name) \ | 144 | #define MODULE_DEVICE_TABLE(type, name) \ |
| 146 | MODULE_GENERIC_TABLE(type##_device,name) | 145 | MODULE_GENERIC_TABLE(type##_device, name) |
| 147 | 146 | ||
| 148 | /* Version of form [<epoch>:]<version>[-<extra-version>]. | 147 | /* Version of form [<epoch>:]<version>[-<extra-version>]. |
| 149 | Or for CVS/RCS ID version, everything but the number is stripped. | 148 | * Or for CVS/RCS ID version, everything but the number is stripped. |
| 150 | <epoch>: A (small) unsigned integer which allows you to start versions | 149 | * <epoch>: A (small) unsigned integer which allows you to start versions |
| 151 | anew. If not mentioned, it's zero. eg. "2:1.0" is after | 150 | * anew. If not mentioned, it's zero. eg. "2:1.0" is after |
| 152 | "1:2.0". | 151 | * "1:2.0". |
| 153 | <version>: The <version> may contain only alphanumerics and the | 152 | |
| 154 | character `.'. Ordered by numeric sort for numeric parts, | 153 | * <version>: The <version> may contain only alphanumerics and the |
| 155 | ascii sort for ascii parts (as per RPM or DEB algorithm). | 154 | * character `.'. Ordered by numeric sort for numeric parts, |
| 156 | <extraversion>: Like <version>, but inserted for local | 155 | * ascii sort for ascii parts (as per RPM or DEB algorithm). |
| 157 | customizations, eg "rh3" or "rusty1". | 156 | |
| 158 | 157 | * <extraversion>: Like <version>, but inserted for local | |
| 159 | Using this automatically adds a checksum of the .c files and the | 158 | * customizations, eg "rh3" or "rusty1". |
| 160 | local headers in "srcversion". | 159 | |
| 161 | */ | 160 | * Using this automatically adds a checksum of the .c files and the |
| 161 | * local headers in "srcversion". | ||
| 162 | */ | ||
| 162 | 163 | ||
| 163 | #if defined(MODULE) || !defined(CONFIG_SYSFS) | 164 | #if defined(MODULE) || !defined(CONFIG_SYSFS) |
| 164 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) | 165 | #define MODULE_VERSION(_version) MODULE_INFO(version, _version) |
| @@ -226,8 +227,7 @@ struct module_ref { | |||
| 226 | unsigned long decs; | 227 | unsigned long decs; |
| 227 | } __attribute((aligned(2 * sizeof(unsigned long)))); | 228 | } __attribute((aligned(2 * sizeof(unsigned long)))); |
| 228 | 229 | ||
| 229 | struct module | 230 | struct module { |
| 230 | { | ||
| 231 | enum module_state state; | 231 | enum module_state state; |
| 232 | 232 | ||
| 233 | /* Member of list of modules */ | 233 | /* Member of list of modules */ |
| @@ -451,7 +451,7 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, | |||
| 451 | 451 | ||
| 452 | extern void __module_put_and_exit(struct module *mod, long code) | 452 | extern void __module_put_and_exit(struct module *mod, long code) |
| 453 | __attribute__((noreturn)); | 453 | __attribute__((noreturn)); |
| 454 | #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code); | 454 | #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code) |
| 455 | 455 | ||
| 456 | #ifdef CONFIG_MODULE_UNLOAD | 456 | #ifdef CONFIG_MODULE_UNLOAD |
| 457 | unsigned long module_refcount(struct module *mod); | 457 | unsigned long module_refcount(struct module *mod); |
| @@ -480,8 +480,8 @@ static inline void module_put(struct module *module) | |||
| 480 | static inline void __module_get(struct module *module) | 480 | static inline void __module_get(struct module *module) |
| 481 | { | 481 | { |
| 482 | } | 482 | } |
| 483 | #define symbol_put(x) do { } while(0) | 483 | #define symbol_put(x) do { } while (0) |
| 484 | #define symbol_put_addr(p) do { } while(0) | 484 | #define symbol_put_addr(p) do { } while (0) |
| 485 | 485 | ||
| 486 | #endif /* CONFIG_MODULE_UNLOAD */ | 486 | #endif /* CONFIG_MODULE_UNLOAD */ |
| 487 | int ref_module(struct module *a, struct module *b); | 487 | int ref_module(struct module *a, struct module *b); |
| @@ -507,8 +507,8 @@ int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned | |||
| 507 | /* For extable.c to search modules' exception tables. */ | 507 | /* For extable.c to search modules' exception tables. */ |
| 508 | const struct exception_table_entry *search_module_extables(unsigned long addr); | 508 | const struct exception_table_entry *search_module_extables(unsigned long addr); |
| 509 | 509 | ||
| 510 | int register_module_notifier(struct notifier_block * nb); | 510 | int register_module_notifier(struct notifier_block *nb); |
| 511 | int unregister_module_notifier(struct notifier_block * nb); | 511 | int unregister_module_notifier(struct notifier_block *nb); |
| 512 | 512 | ||
| 513 | extern void print_modules(void); | 513 | extern void print_modules(void); |
| 514 | 514 | ||
| @@ -548,8 +548,8 @@ static inline bool is_module_text_address(unsigned long addr) | |||
| 548 | 548 | ||
| 549 | /* Get/put a kernel symbol (calls should be symmetric) */ | 549 | /* Get/put a kernel symbol (calls should be symmetric) */ |
| 550 | #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); }) | 550 | #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); }) |
| 551 | #define symbol_put(x) do { } while(0) | 551 | #define symbol_put(x) do { } while (0) |
| 552 | #define symbol_put_addr(x) do { } while(0) | 552 | #define symbol_put_addr(x) do { } while (0) |
| 553 | 553 | ||
| 554 | static inline void __module_get(struct module *module) | 554 | static inline void __module_get(struct module *module) |
| 555 | { | 555 | { |
| @@ -606,13 +606,13 @@ static inline int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, | |||
| 606 | return 0; | 606 | return 0; |
| 607 | } | 607 | } |
| 608 | 608 | ||
| 609 | static inline int register_module_notifier(struct notifier_block * nb) | 609 | static inline int register_module_notifier(struct notifier_block *nb) |
| 610 | { | 610 | { |
| 611 | /* no events will happen anyway, so this can always succeed */ | 611 | /* no events will happen anyway, so this can always succeed */ |
| 612 | return 0; | 612 | return 0; |
| 613 | } | 613 | } |
| 614 | 614 | ||
| 615 | static inline int unregister_module_notifier(struct notifier_block * nb) | 615 | static inline int unregister_module_notifier(struct notifier_block *nb) |
| 616 | { | 616 | { |
| 617 | return 0; | 617 | return 0; |
| 618 | } | 618 | } |
diff --git a/include/linux/msi.h b/include/linux/msi.h index 009b02481436..92a2f991262a 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
| @@ -60,10 +60,10 @@ void arch_teardown_msi_irq(unsigned int irq); | |||
| 60 | int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); | 60 | int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); |
| 61 | void arch_teardown_msi_irqs(struct pci_dev *dev); | 61 | void arch_teardown_msi_irqs(struct pci_dev *dev); |
| 62 | int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); | 62 | int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); |
| 63 | void arch_restore_msi_irqs(struct pci_dev *dev, int irq); | 63 | void arch_restore_msi_irqs(struct pci_dev *dev); |
| 64 | 64 | ||
| 65 | void default_teardown_msi_irqs(struct pci_dev *dev); | 65 | void default_teardown_msi_irqs(struct pci_dev *dev); |
| 66 | void default_restore_msi_irqs(struct pci_dev *dev, int irq); | 66 | void default_restore_msi_irqs(struct pci_dev *dev); |
| 67 | u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); | 67 | u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); |
| 68 | u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag); | 68 | u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag); |
| 69 | 69 | ||
diff --git a/include/linux/net.h b/include/linux/net.h index 4bcee94cef93..94734a6259a4 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -181,7 +181,7 @@ struct proto_ops { | |||
| 181 | int offset, size_t size, int flags); | 181 | int offset, size_t size, int flags); |
| 182 | ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, | 182 | ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, |
| 183 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); | 183 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); |
| 184 | void (*set_peek_off)(struct sock *sk, int val); | 184 | int (*set_peek_off)(struct sock *sk, int val); |
| 185 | }; | 185 | }; |
| 186 | 186 | ||
| 187 | #define DECLARE_SOCKADDR(type, dst, src) \ | 187 | #define DECLARE_SOCKADDR(type, dst, src) \ |
| @@ -245,9 +245,6 @@ do { \ | |||
| 245 | #define net_dbg_ratelimited(fmt, ...) \ | 245 | #define net_dbg_ratelimited(fmt, ...) \ |
| 246 | net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__) | 246 | net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__) |
| 247 | 247 | ||
| 248 | #define net_random() prandom_u32() | ||
| 249 | #define net_srandom(seed) prandom_seed((__force u32)(seed)) | ||
| 250 | |||
| 251 | bool __net_get_random_once(void *buf, int nbytes, bool *done, | 248 | bool __net_get_random_once(void *buf, int nbytes, bool *done, |
| 252 | struct static_key *done_key); | 249 | struct static_key *done_key); |
| 253 | 250 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7f0ed423a360..440a02ee6f92 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -668,15 +668,28 @@ extern struct rps_sock_flow_table __rcu *rps_sock_flow_table; | |||
| 668 | bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id, | 668 | bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id, |
| 669 | u16 filter_id); | 669 | u16 filter_id); |
| 670 | #endif | 670 | #endif |
| 671 | #endif /* CONFIG_RPS */ | ||
| 671 | 672 | ||
| 672 | /* This structure contains an instance of an RX queue. */ | 673 | /* This structure contains an instance of an RX queue. */ |
| 673 | struct netdev_rx_queue { | 674 | struct netdev_rx_queue { |
| 675 | #ifdef CONFIG_RPS | ||
| 674 | struct rps_map __rcu *rps_map; | 676 | struct rps_map __rcu *rps_map; |
| 675 | struct rps_dev_flow_table __rcu *rps_flow_table; | 677 | struct rps_dev_flow_table __rcu *rps_flow_table; |
| 678 | #endif | ||
| 676 | struct kobject kobj; | 679 | struct kobject kobj; |
| 677 | struct net_device *dev; | 680 | struct net_device *dev; |
| 678 | } ____cacheline_aligned_in_smp; | 681 | } ____cacheline_aligned_in_smp; |
| 679 | #endif /* CONFIG_RPS */ | 682 | |
| 683 | /* | ||
| 684 | * RX queue sysfs structures and functions. | ||
| 685 | */ | ||
| 686 | struct rx_queue_attribute { | ||
| 687 | struct attribute attr; | ||
| 688 | ssize_t (*show)(struct netdev_rx_queue *queue, | ||
| 689 | struct rx_queue_attribute *attr, char *buf); | ||
| 690 | ssize_t (*store)(struct netdev_rx_queue *queue, | ||
| 691 | struct rx_queue_attribute *attr, const char *buf, size_t len); | ||
| 692 | }; | ||
| 680 | 693 | ||
| 681 | #ifdef CONFIG_XPS | 694 | #ifdef CONFIG_XPS |
| 682 | /* | 695 | /* |
| @@ -769,7 +782,8 @@ struct netdev_phys_port_id { | |||
| 769 | * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX) | 782 | * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX) |
| 770 | * Required can not be NULL. | 783 | * Required can not be NULL. |
| 771 | * | 784 | * |
| 772 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb); | 785 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb, |
| 786 | * void *accel_priv); | ||
| 773 | * Called to decide which queue to when device supports multiple | 787 | * Called to decide which queue to when device supports multiple |
| 774 | * transmit queues. | 788 | * transmit queues. |
| 775 | * | 789 | * |
| @@ -990,7 +1004,8 @@ struct net_device_ops { | |||
| 990 | netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb, | 1004 | netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb, |
| 991 | struct net_device *dev); | 1005 | struct net_device *dev); |
| 992 | u16 (*ndo_select_queue)(struct net_device *dev, | 1006 | u16 (*ndo_select_queue)(struct net_device *dev, |
| 993 | struct sk_buff *skb); | 1007 | struct sk_buff *skb, |
| 1008 | void *accel_priv); | ||
| 994 | void (*ndo_change_rx_flags)(struct net_device *dev, | 1009 | void (*ndo_change_rx_flags)(struct net_device *dev, |
| 995 | int flags); | 1010 | int flags); |
| 996 | void (*ndo_set_rx_mode)(struct net_device *dev); | 1011 | void (*ndo_set_rx_mode)(struct net_device *dev); |
| @@ -1255,7 +1270,7 @@ struct net_device { | |||
| 1255 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ | 1270 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ |
| 1256 | unsigned char addr_assign_type; /* hw address assignment type */ | 1271 | unsigned char addr_assign_type; /* hw address assignment type */ |
| 1257 | unsigned char addr_len; /* hardware address length */ | 1272 | unsigned char addr_len; /* hardware address length */ |
| 1258 | unsigned char neigh_priv_len; | 1273 | unsigned short neigh_priv_len; |
| 1259 | unsigned short dev_id; /* Used to differentiate devices | 1274 | unsigned short dev_id; /* Used to differentiate devices |
| 1260 | * that share the same link | 1275 | * that share the same link |
| 1261 | * layer address | 1276 | * layer address |
| @@ -1283,6 +1298,9 @@ struct net_device { | |||
| 1283 | #if IS_ENABLED(CONFIG_NET_DSA) | 1298 | #if IS_ENABLED(CONFIG_NET_DSA) |
| 1284 | struct dsa_switch_tree *dsa_ptr; /* dsa specific data */ | 1299 | struct dsa_switch_tree *dsa_ptr; /* dsa specific data */ |
| 1285 | #endif | 1300 | #endif |
| 1301 | #if IS_ENABLED(CONFIG_TIPC) | ||
| 1302 | struct tipc_bearer __rcu *tipc_ptr; /* TIPC specific data */ | ||
| 1303 | #endif | ||
| 1286 | void *atalk_ptr; /* AppleTalk link */ | 1304 | void *atalk_ptr; /* AppleTalk link */ |
| 1287 | struct in_device __rcu *ip_ptr; /* IPv4 specific data */ | 1305 | struct in_device __rcu *ip_ptr; /* IPv4 specific data */ |
| 1288 | struct dn_dev __rcu *dn_ptr; /* DECnet specific data */ | 1306 | struct dn_dev __rcu *dn_ptr; /* DECnet specific data */ |
| @@ -1308,7 +1326,7 @@ struct net_device { | |||
| 1308 | unicast) */ | 1326 | unicast) */ |
| 1309 | 1327 | ||
| 1310 | 1328 | ||
| 1311 | #ifdef CONFIG_RPS | 1329 | #ifdef CONFIG_SYSFS |
| 1312 | struct netdev_rx_queue *_rx; | 1330 | struct netdev_rx_queue *_rx; |
| 1313 | 1331 | ||
| 1314 | /* Number of RX queues allocated at register_netdev() time */ | 1332 | /* Number of RX queues allocated at register_netdev() time */ |
| @@ -1406,7 +1424,7 @@ struct net_device { | |||
| 1406 | union { | 1424 | union { |
| 1407 | void *ml_priv; | 1425 | void *ml_priv; |
| 1408 | struct pcpu_lstats __percpu *lstats; /* loopback stats */ | 1426 | struct pcpu_lstats __percpu *lstats; /* loopback stats */ |
| 1409 | struct pcpu_tstats __percpu *tstats; /* tunnel stats */ | 1427 | struct pcpu_sw_netstats __percpu *tstats; |
| 1410 | struct pcpu_dstats __percpu *dstats; /* dummy stats */ | 1428 | struct pcpu_dstats __percpu *dstats; /* dummy stats */ |
| 1411 | struct pcpu_vstats __percpu *vstats; /* veth stats */ | 1429 | struct pcpu_vstats __percpu *vstats; /* veth stats */ |
| 1412 | }; | 1430 | }; |
| @@ -1419,6 +1437,8 @@ struct net_device { | |||
| 1419 | struct device dev; | 1437 | struct device dev; |
| 1420 | /* space for optional device, statistics, and wireless sysfs groups */ | 1438 | /* space for optional device, statistics, and wireless sysfs groups */ |
| 1421 | const struct attribute_group *sysfs_groups[4]; | 1439 | const struct attribute_group *sysfs_groups[4]; |
| 1440 | /* space for optional per-rx queue attributes */ | ||
| 1441 | const struct attribute_group *sysfs_rx_queue_group; | ||
| 1422 | 1442 | ||
| 1423 | /* rtnetlink link ops */ | 1443 | /* rtnetlink link ops */ |
| 1424 | const struct rtnl_link_ops *rtnl_link_ops; | 1444 | const struct rtnl_link_ops *rtnl_link_ops; |
| @@ -1441,7 +1461,7 @@ struct net_device { | |||
| 1441 | /* max exchange id for FCoE LRO by ddp */ | 1461 | /* max exchange id for FCoE LRO by ddp */ |
| 1442 | unsigned int fcoe_ddp_xid; | 1462 | unsigned int fcoe_ddp_xid; |
| 1443 | #endif | 1463 | #endif |
| 1444 | #if IS_ENABLED(CONFIG_NETPRIO_CGROUP) | 1464 | #if IS_ENABLED(CONFIG_CGROUP_NET_PRIO) |
| 1445 | struct netprio_map __rcu *priomap; | 1465 | struct netprio_map __rcu *priomap; |
| 1446 | #endif | 1466 | #endif |
| 1447 | /* phy device may attach itself for hardware timestamping */ | 1467 | /* phy device may attach itself for hardware timestamping */ |
| @@ -1529,7 +1549,8 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev, | |||
| 1529 | } | 1549 | } |
| 1530 | 1550 | ||
| 1531 | struct netdev_queue *netdev_pick_tx(struct net_device *dev, | 1551 | struct netdev_queue *netdev_pick_tx(struct net_device *dev, |
| 1532 | struct sk_buff *skb); | 1552 | struct sk_buff *skb, |
| 1553 | void *accel_priv); | ||
| 1533 | u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); | 1554 | u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); |
| 1534 | 1555 | ||
| 1535 | /* | 1556 | /* |
| @@ -1629,7 +1650,10 @@ struct napi_gro_cb { | |||
| 1629 | int data_offset; | 1650 | int data_offset; |
| 1630 | 1651 | ||
| 1631 | /* This is non-zero if the packet cannot be merged with the new skb. */ | 1652 | /* This is non-zero if the packet cannot be merged with the new skb. */ |
| 1632 | int flush; | 1653 | u16 flush; |
| 1654 | |||
| 1655 | /* Save the IP ID here and check when we get to the transport layer */ | ||
| 1656 | u16 flush_id; | ||
| 1633 | 1657 | ||
| 1634 | /* Number of segments aggregated. */ | 1658 | /* Number of segments aggregated. */ |
| 1635 | u16 count; | 1659 | u16 count; |
| @@ -1646,7 +1670,13 @@ struct napi_gro_cb { | |||
| 1646 | unsigned long age; | 1670 | unsigned long age; |
| 1647 | 1671 | ||
| 1648 | /* Used in ipv6_gro_receive() */ | 1672 | /* Used in ipv6_gro_receive() */ |
| 1649 | int proto; | 1673 | u16 proto; |
| 1674 | |||
| 1675 | /* Used in udp_gro_receive */ | ||
| 1676 | u16 udp_mark; | ||
| 1677 | |||
| 1678 | /* used to support CHECKSUM_COMPLETE for tunneling protocols */ | ||
| 1679 | __wsum csum; | ||
| 1650 | 1680 | ||
| 1651 | /* used in skb_gro_receive() slow path */ | 1681 | /* used in skb_gro_receive() slow path */ |
| 1652 | struct sk_buff *last; | 1682 | struct sk_buff *last; |
| @@ -1673,7 +1703,7 @@ struct offload_callbacks { | |||
| 1673 | int (*gso_send_check)(struct sk_buff *skb); | 1703 | int (*gso_send_check)(struct sk_buff *skb); |
| 1674 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | 1704 | struct sk_buff **(*gro_receive)(struct sk_buff **head, |
| 1675 | struct sk_buff *skb); | 1705 | struct sk_buff *skb); |
| 1676 | int (*gro_complete)(struct sk_buff *skb); | 1706 | int (*gro_complete)(struct sk_buff *skb, int nhoff); |
| 1677 | }; | 1707 | }; |
| 1678 | 1708 | ||
| 1679 | struct packet_offload { | 1709 | struct packet_offload { |
| @@ -1682,6 +1712,20 @@ struct packet_offload { | |||
| 1682 | struct list_head list; | 1712 | struct list_head list; |
| 1683 | }; | 1713 | }; |
| 1684 | 1714 | ||
| 1715 | struct udp_offload { | ||
| 1716 | __be16 port; | ||
| 1717 | struct offload_callbacks callbacks; | ||
| 1718 | }; | ||
| 1719 | |||
| 1720 | /* often modified stats are per cpu, other are shared (netdev->stats) */ | ||
| 1721 | struct pcpu_sw_netstats { | ||
| 1722 | u64 rx_packets; | ||
| 1723 | u64 rx_bytes; | ||
| 1724 | u64 tx_packets; | ||
| 1725 | u64 tx_bytes; | ||
| 1726 | struct u64_stats_sync syncp; | ||
| 1727 | }; | ||
| 1728 | |||
| 1685 | #include <linux/notifier.h> | 1729 | #include <linux/notifier.h> |
| 1686 | 1730 | ||
| 1687 | /* netdevice notifier chain. Please remember to update the rtnetlink | 1731 | /* netdevice notifier chain. Please remember to update the rtnetlink |
| @@ -1697,7 +1741,7 @@ struct packet_offload { | |||
| 1697 | #define NETDEV_CHANGE 0x0004 /* Notify device state change */ | 1741 | #define NETDEV_CHANGE 0x0004 /* Notify device state change */ |
| 1698 | #define NETDEV_REGISTER 0x0005 | 1742 | #define NETDEV_REGISTER 0x0005 |
| 1699 | #define NETDEV_UNREGISTER 0x0006 | 1743 | #define NETDEV_UNREGISTER 0x0006 |
| 1700 | #define NETDEV_CHANGEMTU 0x0007 | 1744 | #define NETDEV_CHANGEMTU 0x0007 /* notify after mtu change happened */ |
| 1701 | #define NETDEV_CHANGEADDR 0x0008 | 1745 | #define NETDEV_CHANGEADDR 0x0008 |
| 1702 | #define NETDEV_GOING_DOWN 0x0009 | 1746 | #define NETDEV_GOING_DOWN 0x0009 |
| 1703 | #define NETDEV_CHANGENAME 0x000A | 1747 | #define NETDEV_CHANGENAME 0x000A |
| @@ -1713,6 +1757,7 @@ struct packet_offload { | |||
| 1713 | #define NETDEV_JOIN 0x0014 | 1757 | #define NETDEV_JOIN 0x0014 |
| 1714 | #define NETDEV_CHANGEUPPER 0x0015 | 1758 | #define NETDEV_CHANGEUPPER 0x0015 |
| 1715 | #define NETDEV_RESEND_IGMP 0x0016 | 1759 | #define NETDEV_RESEND_IGMP 0x0016 |
| 1760 | #define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */ | ||
| 1716 | 1761 | ||
| 1717 | int register_netdevice_notifier(struct notifier_block *nb); | 1762 | int register_netdevice_notifier(struct notifier_block *nb); |
| 1718 | int unregister_netdevice_notifier(struct notifier_block *nb); | 1763 | int unregister_netdevice_notifier(struct notifier_block *nb); |
| @@ -1738,8 +1783,6 @@ netdev_notifier_info_to_dev(const struct netdev_notifier_info *info) | |||
| 1738 | return info->dev; | 1783 | return info->dev; |
| 1739 | } | 1784 | } |
| 1740 | 1785 | ||
| 1741 | int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev, | ||
| 1742 | struct netdev_notifier_info *info); | ||
| 1743 | int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | 1786 | int call_netdevice_notifiers(unsigned long val, struct net_device *dev); |
| 1744 | 1787 | ||
| 1745 | 1788 | ||
| @@ -1806,7 +1849,6 @@ void dev_remove_pack(struct packet_type *pt); | |||
| 1806 | void __dev_remove_pack(struct packet_type *pt); | 1849 | void __dev_remove_pack(struct packet_type *pt); |
| 1807 | void dev_add_offload(struct packet_offload *po); | 1850 | void dev_add_offload(struct packet_offload *po); |
| 1808 | void dev_remove_offload(struct packet_offload *po); | 1851 | void dev_remove_offload(struct packet_offload *po); |
| 1809 | void __dev_remove_offload(struct packet_offload *po); | ||
| 1810 | 1852 | ||
| 1811 | struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, | 1853 | struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, |
| 1812 | unsigned short mask); | 1854 | unsigned short mask); |
| @@ -1819,6 +1861,7 @@ int dev_close(struct net_device *dev); | |||
| 1819 | void dev_disable_lro(struct net_device *dev); | 1861 | void dev_disable_lro(struct net_device *dev); |
| 1820 | int dev_loopback_xmit(struct sk_buff *newskb); | 1862 | int dev_loopback_xmit(struct sk_buff *newskb); |
| 1821 | int dev_queue_xmit(struct sk_buff *skb); | 1863 | int dev_queue_xmit(struct sk_buff *skb); |
| 1864 | int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv); | ||
| 1822 | int register_netdevice(struct net_device *dev); | 1865 | int register_netdevice(struct net_device *dev); |
| 1823 | void unregister_netdevice_queue(struct net_device *dev, struct list_head *head); | 1866 | void unregister_netdevice_queue(struct net_device *dev, struct list_head *head); |
| 1824 | void unregister_netdevice_many(struct list_head *head); | 1867 | void unregister_netdevice_many(struct list_head *head); |
| @@ -1891,6 +1934,14 @@ static inline void *skb_gro_network_header(struct sk_buff *skb) | |||
| 1891 | skb_network_offset(skb); | 1934 | skb_network_offset(skb); |
| 1892 | } | 1935 | } |
| 1893 | 1936 | ||
| 1937 | static inline void skb_gro_postpull_rcsum(struct sk_buff *skb, | ||
| 1938 | const void *start, unsigned int len) | ||
| 1939 | { | ||
| 1940 | if (skb->ip_summed == CHECKSUM_COMPLETE) | ||
| 1941 | NAPI_GRO_CB(skb)->csum = csum_sub(NAPI_GRO_CB(skb)->csum, | ||
| 1942 | csum_partial(start, len, 0)); | ||
| 1943 | } | ||
| 1944 | |||
| 1894 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, | 1945 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, |
| 1895 | unsigned short type, | 1946 | unsigned short type, |
| 1896 | const void *daddr, const void *saddr, | 1947 | const void *daddr, const void *saddr, |
| @@ -1912,6 +1963,15 @@ static inline int dev_parse_header(const struct sk_buff *skb, | |||
| 1912 | return dev->header_ops->parse(skb, haddr); | 1963 | return dev->header_ops->parse(skb, haddr); |
| 1913 | } | 1964 | } |
| 1914 | 1965 | ||
| 1966 | static inline int dev_rebuild_header(struct sk_buff *skb) | ||
| 1967 | { | ||
| 1968 | const struct net_device *dev = skb->dev; | ||
| 1969 | |||
| 1970 | if (!dev->header_ops || !dev->header_ops->rebuild) | ||
| 1971 | return 0; | ||
| 1972 | return dev->header_ops->rebuild(skb); | ||
| 1973 | } | ||
| 1974 | |||
| 1915 | typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); | 1975 | typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); |
| 1916 | int register_gifconf(unsigned int family, gifconf_func_t *gifconf); | 1976 | int register_gifconf(unsigned int family, gifconf_func_t *gifconf); |
| 1917 | static inline int unregister_gifconf(unsigned int family) | 1977 | static inline int unregister_gifconf(unsigned int family) |
| @@ -2338,7 +2398,7 @@ static inline bool netif_is_multiqueue(const struct net_device *dev) | |||
| 2338 | 2398 | ||
| 2339 | int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq); | 2399 | int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq); |
| 2340 | 2400 | ||
| 2341 | #ifdef CONFIG_RPS | 2401 | #ifdef CONFIG_SYSFS |
| 2342 | int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq); | 2402 | int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq); |
| 2343 | #else | 2403 | #else |
| 2344 | static inline int netif_set_real_num_rx_queues(struct net_device *dev, | 2404 | static inline int netif_set_real_num_rx_queues(struct net_device *dev, |
| @@ -2357,7 +2417,7 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev, | |||
| 2357 | from_dev->real_num_tx_queues); | 2417 | from_dev->real_num_tx_queues); |
| 2358 | if (err) | 2418 | if (err) |
| 2359 | return err; | 2419 | return err; |
| 2360 | #ifdef CONFIG_RPS | 2420 | #ifdef CONFIG_SYSFS |
| 2361 | return netif_set_real_num_rx_queues(to_dev, | 2421 | return netif_set_real_num_rx_queues(to_dev, |
| 2362 | from_dev->real_num_rx_queues); | 2422 | from_dev->real_num_rx_queues); |
| 2363 | #else | 2423 | #else |
| @@ -2365,20 +2425,67 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev, | |||
| 2365 | #endif | 2425 | #endif |
| 2366 | } | 2426 | } |
| 2367 | 2427 | ||
| 2428 | #ifdef CONFIG_SYSFS | ||
| 2429 | static inline unsigned int get_netdev_rx_queue_index( | ||
| 2430 | struct netdev_rx_queue *queue) | ||
| 2431 | { | ||
| 2432 | struct net_device *dev = queue->dev; | ||
| 2433 | int index = queue - dev->_rx; | ||
| 2434 | |||
| 2435 | BUG_ON(index >= dev->num_rx_queues); | ||
| 2436 | return index; | ||
| 2437 | } | ||
| 2438 | #endif | ||
| 2439 | |||
| 2368 | #define DEFAULT_MAX_NUM_RSS_QUEUES (8) | 2440 | #define DEFAULT_MAX_NUM_RSS_QUEUES (8) |
| 2369 | int netif_get_num_default_rss_queues(void); | 2441 | int netif_get_num_default_rss_queues(void); |
| 2370 | 2442 | ||
| 2371 | /* Use this variant when it is known for sure that it | 2443 | enum skb_free_reason { |
| 2372 | * is executing from hardware interrupt context or with hardware interrupts | 2444 | SKB_REASON_CONSUMED, |
| 2373 | * disabled. | 2445 | SKB_REASON_DROPPED, |
| 2374 | */ | 2446 | }; |
| 2375 | void dev_kfree_skb_irq(struct sk_buff *skb); | 2447 | |
| 2448 | void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason); | ||
| 2449 | void __dev_kfree_skb_any(struct sk_buff *skb, enum skb_free_reason reason); | ||
| 2376 | 2450 | ||
| 2377 | /* Use this variant in places where it could be invoked | 2451 | /* |
| 2378 | * from either hardware interrupt or other context, with hardware interrupts | 2452 | * It is not allowed to call kfree_skb() or consume_skb() from hardware |
| 2379 | * either disabled or enabled. | 2453 | * interrupt context or with hardware interrupts being disabled. |
| 2454 | * (in_irq() || irqs_disabled()) | ||
| 2455 | * | ||
| 2456 | * We provide four helpers that can be used in following contexts : | ||
| 2457 | * | ||
| 2458 | * dev_kfree_skb_irq(skb) when caller drops a packet from irq context, | ||
| 2459 | * replacing kfree_skb(skb) | ||
| 2460 | * | ||
| 2461 | * dev_consume_skb_irq(skb) when caller consumes a packet from irq context. | ||
| 2462 | * Typically used in place of consume_skb(skb) in TX completion path | ||
| 2463 | * | ||
| 2464 | * dev_kfree_skb_any(skb) when caller doesn't know its current irq context, | ||
| 2465 | * replacing kfree_skb(skb) | ||
| 2466 | * | ||
| 2467 | * dev_consume_skb_any(skb) when caller doesn't know its current irq context, | ||
| 2468 | * and consumed a packet. Used in place of consume_skb(skb) | ||
| 2380 | */ | 2469 | */ |
| 2381 | void dev_kfree_skb_any(struct sk_buff *skb); | 2470 | static inline void dev_kfree_skb_irq(struct sk_buff *skb) |
| 2471 | { | ||
| 2472 | __dev_kfree_skb_irq(skb, SKB_REASON_DROPPED); | ||
| 2473 | } | ||
| 2474 | |||
| 2475 | static inline void dev_consume_skb_irq(struct sk_buff *skb) | ||
| 2476 | { | ||
| 2477 | __dev_kfree_skb_irq(skb, SKB_REASON_CONSUMED); | ||
| 2478 | } | ||
| 2479 | |||
| 2480 | static inline void dev_kfree_skb_any(struct sk_buff *skb) | ||
| 2481 | { | ||
| 2482 | __dev_kfree_skb_any(skb, SKB_REASON_DROPPED); | ||
| 2483 | } | ||
| 2484 | |||
| 2485 | static inline void dev_consume_skb_any(struct sk_buff *skb) | ||
| 2486 | { | ||
| 2487 | __dev_kfree_skb_any(skb, SKB_REASON_CONSUMED); | ||
| 2488 | } | ||
| 2382 | 2489 | ||
| 2383 | int netif_rx(struct sk_buff *skb); | 2490 | int netif_rx(struct sk_buff *skb); |
| 2384 | int netif_rx_ni(struct sk_buff *skb); | 2491 | int netif_rx_ni(struct sk_buff *skb); |
| @@ -2387,6 +2494,8 @@ gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb); | |||
| 2387 | void napi_gro_flush(struct napi_struct *napi, bool flush_old); | 2494 | void napi_gro_flush(struct napi_struct *napi, bool flush_old); |
| 2388 | struct sk_buff *napi_get_frags(struct napi_struct *napi); | 2495 | struct sk_buff *napi_get_frags(struct napi_struct *napi); |
| 2389 | gro_result_t napi_gro_frags(struct napi_struct *napi); | 2496 | gro_result_t napi_gro_frags(struct napi_struct *napi); |
| 2497 | struct packet_offload *gro_find_receive_by_type(__be16 type); | ||
| 2498 | struct packet_offload *gro_find_complete_by_type(__be16 type); | ||
| 2390 | 2499 | ||
| 2391 | static inline void napi_free_frags(struct napi_struct *napi) | 2500 | static inline void napi_free_frags(struct napi_struct *napi) |
| 2392 | { | 2501 | { |
| @@ -2417,7 +2526,7 @@ int dev_change_carrier(struct net_device *, bool new_carrier); | |||
| 2417 | int dev_get_phys_port_id(struct net_device *dev, | 2526 | int dev_get_phys_port_id(struct net_device *dev, |
| 2418 | struct netdev_phys_port_id *ppid); | 2527 | struct netdev_phys_port_id *ppid); |
| 2419 | int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | 2528 | int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, |
| 2420 | struct netdev_queue *txq, void *accel_priv); | 2529 | struct netdev_queue *txq); |
| 2421 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); | 2530 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); |
| 2422 | 2531 | ||
| 2423 | extern int netdev_budget; | 2532 | extern int netdev_budget; |
| @@ -2772,17 +2881,10 @@ int register_netdev(struct net_device *dev); | |||
| 2772 | void unregister_netdev(struct net_device *dev); | 2881 | void unregister_netdev(struct net_device *dev); |
| 2773 | 2882 | ||
| 2774 | /* General hardware address lists handling functions */ | 2883 | /* General hardware address lists handling functions */ |
| 2775 | int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list, | ||
| 2776 | struct netdev_hw_addr_list *from_list, | ||
| 2777 | int addr_len, unsigned char addr_type); | ||
| 2778 | void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list, | ||
| 2779 | struct netdev_hw_addr_list *from_list, | ||
| 2780 | int addr_len, unsigned char addr_type); | ||
| 2781 | int __hw_addr_sync(struct netdev_hw_addr_list *to_list, | 2884 | int __hw_addr_sync(struct netdev_hw_addr_list *to_list, |
| 2782 | struct netdev_hw_addr_list *from_list, int addr_len); | 2885 | struct netdev_hw_addr_list *from_list, int addr_len); |
| 2783 | void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, | 2886 | void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, |
| 2784 | struct netdev_hw_addr_list *from_list, int addr_len); | 2887 | struct netdev_hw_addr_list *from_list, int addr_len); |
| 2785 | void __hw_addr_flush(struct netdev_hw_addr_list *list); | ||
| 2786 | void __hw_addr_init(struct netdev_hw_addr_list *list); | 2888 | void __hw_addr_init(struct netdev_hw_addr_list *list); |
| 2787 | 2889 | ||
| 2788 | /* Functions used for device addresses handling */ | 2890 | /* Functions used for device addresses handling */ |
| @@ -2790,10 +2892,6 @@ int dev_addr_add(struct net_device *dev, const unsigned char *addr, | |||
| 2790 | unsigned char addr_type); | 2892 | unsigned char addr_type); |
| 2791 | int dev_addr_del(struct net_device *dev, const unsigned char *addr, | 2893 | int dev_addr_del(struct net_device *dev, const unsigned char *addr, |
| 2792 | unsigned char addr_type); | 2894 | unsigned char addr_type); |
| 2793 | int dev_addr_add_multiple(struct net_device *to_dev, | ||
| 2794 | struct net_device *from_dev, unsigned char addr_type); | ||
| 2795 | int dev_addr_del_multiple(struct net_device *to_dev, | ||
| 2796 | struct net_device *from_dev, unsigned char addr_type); | ||
| 2797 | void dev_addr_flush(struct net_device *dev); | 2895 | void dev_addr_flush(struct net_device *dev); |
| 2798 | int dev_addr_init(struct net_device *dev); | 2896 | int dev_addr_init(struct net_device *dev); |
| 2799 | 2897 | ||
| @@ -2840,7 +2938,6 @@ extern int weight_p; | |||
| 2840 | extern int bpf_jit_enable; | 2938 | extern int bpf_jit_enable; |
| 2841 | 2939 | ||
| 2842 | bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev); | 2940 | bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev); |
| 2843 | bool netdev_has_any_upper_dev(struct net_device *dev); | ||
| 2844 | struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev, | 2941 | struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev, |
| 2845 | struct list_head **iter); | 2942 | struct list_head **iter); |
| 2846 | 2943 | ||
| @@ -2869,6 +2966,7 @@ void *netdev_lower_get_next_private_rcu(struct net_device *dev, | |||
| 2869 | priv = netdev_lower_get_next_private_rcu(dev, &(iter))) | 2966 | priv = netdev_lower_get_next_private_rcu(dev, &(iter))) |
| 2870 | 2967 | ||
| 2871 | void *netdev_adjacent_get_private(struct list_head *adj_list); | 2968 | void *netdev_adjacent_get_private(struct list_head *adj_list); |
| 2969 | void *netdev_lower_get_first_private_rcu(struct net_device *dev); | ||
| 2872 | struct net_device *netdev_master_upper_dev_get(struct net_device *dev); | 2970 | struct net_device *netdev_master_upper_dev_get(struct net_device *dev); |
| 2873 | struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); | 2971 | struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); |
| 2874 | int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev); | 2972 | int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev); |
| @@ -2879,8 +2977,7 @@ int netdev_master_upper_dev_link_private(struct net_device *dev, | |||
| 2879 | void *private); | 2977 | void *private); |
| 2880 | void netdev_upper_dev_unlink(struct net_device *dev, | 2978 | void netdev_upper_dev_unlink(struct net_device *dev, |
| 2881 | struct net_device *upper_dev); | 2979 | struct net_device *upper_dev); |
| 2882 | void *netdev_lower_dev_get_private_rcu(struct net_device *dev, | 2980 | void netdev_adjacent_rename_links(struct net_device *dev, char *oldname); |
| 2883 | struct net_device *lower_dev); | ||
| 2884 | void *netdev_lower_dev_get_private(struct net_device *dev, | 2981 | void *netdev_lower_dev_get_private(struct net_device *dev, |
| 2885 | struct net_device *lower_dev); | 2982 | struct net_device *lower_dev); |
| 2886 | int skb_checksum_help(struct sk_buff *skb); | 2983 | int skb_checksum_help(struct sk_buff *skb); |
| @@ -3008,6 +3105,19 @@ static inline void netif_set_gso_max_size(struct net_device *dev, | |||
| 3008 | dev->gso_max_size = size; | 3105 | dev->gso_max_size = size; |
| 3009 | } | 3106 | } |
| 3010 | 3107 | ||
| 3108 | static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol, | ||
| 3109 | int pulled_hlen, u16 mac_offset, | ||
| 3110 | int mac_len) | ||
| 3111 | { | ||
| 3112 | skb->protocol = protocol; | ||
| 3113 | skb->encapsulation = 1; | ||
| 3114 | skb_push(skb, pulled_hlen); | ||
| 3115 | skb_reset_transport_header(skb); | ||
| 3116 | skb->mac_header = mac_offset; | ||
| 3117 | skb->network_header = skb->mac_header + mac_len; | ||
| 3118 | skb->mac_len = mac_len; | ||
| 3119 | } | ||
| 3120 | |||
| 3011 | static inline bool netif_is_macvlan(struct net_device *dev) | 3121 | static inline bool netif_is_macvlan(struct net_device *dev) |
| 3012 | { | 3122 | { |
| 3013 | return dev->priv_flags & IFF_MACVLAN; | 3123 | return dev->priv_flags & IFF_MACVLAN; |
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h index c7174b816674..0c7d01eae56c 100644 --- a/include/linux/netfilter/ipset/ip_set.h +++ b/include/linux/netfilter/ipset/ip_set.h | |||
| @@ -331,7 +331,6 @@ extern ip_set_id_t ip_set_get_byname(struct net *net, | |||
| 331 | const char *name, struct ip_set **set); | 331 | const char *name, struct ip_set **set); |
| 332 | extern void ip_set_put_byindex(struct net *net, ip_set_id_t index); | 332 | extern void ip_set_put_byindex(struct net *net, ip_set_id_t index); |
| 333 | extern const char *ip_set_name_byindex(struct net *net, ip_set_id_t index); | 333 | extern const char *ip_set_name_byindex(struct net *net, ip_set_id_t index); |
| 334 | extern ip_set_id_t ip_set_nfnl_get(struct net *net, const char *name); | ||
| 335 | extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index); | 334 | extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index); |
| 336 | extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index); | 335 | extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index); |
| 337 | 336 | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 7a6c396a263b..aad8eeaf416d 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
| @@ -62,7 +62,6 @@ extern void netlink_kernel_release(struct sock *sk); | |||
| 62 | extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); | 62 | extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); |
| 63 | extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); | 63 | extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); |
| 64 | extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group); | 64 | extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group); |
| 65 | extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); | ||
| 66 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 65 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
| 67 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); | 66 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); |
| 68 | extern struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size, | 67 | extern struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size, |
| @@ -168,7 +167,6 @@ struct netlink_tap { | |||
| 168 | }; | 167 | }; |
| 169 | 168 | ||
| 170 | extern int netlink_add_tap(struct netlink_tap *nt); | 169 | extern int netlink_add_tap(struct netlink_tap *nt); |
| 171 | extern int __netlink_remove_tap(struct netlink_tap *nt); | ||
| 172 | extern int netlink_remove_tap(struct netlink_tap *nt); | 170 | extern int netlink_remove_tap(struct netlink_tap *nt); |
| 173 | 171 | ||
| 174 | #endif /* __LINUX_NETLINK_H */ | 172 | #endif /* __LINUX_NETLINK_H */ |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index c1637062c1ce..12c2cb947df5 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -413,16 +413,6 @@ enum lock_type4 { | |||
| 413 | #define NFS4_VERSION 4 | 413 | #define NFS4_VERSION 4 |
| 414 | #define NFS4_MINOR_VERSION 0 | 414 | #define NFS4_MINOR_VERSION 0 |
| 415 | 415 | ||
| 416 | #if defined(CONFIG_NFS_V4_2) | ||
| 417 | #define NFS4_MAX_MINOR_VERSION 2 | ||
| 418 | #else | ||
| 419 | #if defined(CONFIG_NFS_V4_1) | ||
| 420 | #define NFS4_MAX_MINOR_VERSION 1 | ||
| 421 | #else | ||
| 422 | #define NFS4_MAX_MINOR_VERSION 0 | ||
| 423 | #endif /* CONFIG_NFS_V4_1 */ | ||
| 424 | #endif /* CONFIG_NFS_V4_2 */ | ||
| 425 | |||
| 426 | #define NFS4_DEBUG 1 | 416 | #define NFS4_DEBUG 1 |
| 427 | 417 | ||
| 428 | /* Index of predefined Linux client operations */ | 418 | /* Index of predefined Linux client operations */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 14a48207a304..48997374eaf0 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -507,24 +507,6 @@ extern int nfs_mountpoint_expiry_timeout; | |||
| 507 | extern void nfs_release_automount_timer(void); | 507 | extern void nfs_release_automount_timer(void); |
| 508 | 508 | ||
| 509 | /* | 509 | /* |
| 510 | * linux/fs/nfs/nfs4proc.c | ||
| 511 | */ | ||
| 512 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL | ||
| 513 | extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); | ||
| 514 | static inline void nfs4_label_free(struct nfs4_label *label) | ||
| 515 | { | ||
| 516 | if (label) { | ||
| 517 | kfree(label->label); | ||
| 518 | kfree(label); | ||
| 519 | } | ||
| 520 | return; | ||
| 521 | } | ||
| 522 | #else | ||
| 523 | static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; } | ||
| 524 | static inline void nfs4_label_free(void *label) {} | ||
| 525 | #endif | ||
| 526 | |||
| 527 | /* | ||
| 528 | * linux/fs/nfs/unlink.c | 510 | * linux/fs/nfs/unlink.c |
| 529 | */ | 511 | */ |
| 530 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); | 512 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); |
diff --git a/include/linux/of.h b/include/linux/of.h index 276c546980d8..70c64ba17fa5 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -377,8 +377,13 @@ static inline bool of_have_populated_dt(void) | |||
| 377 | return false; | 377 | return false; |
| 378 | } | 378 | } |
| 379 | 379 | ||
| 380 | /* Kill an unused variable warning on a device_node pointer */ | ||
| 381 | static inline void __of_use_dn(const struct device_node *np) | ||
| 382 | { | ||
| 383 | } | ||
| 384 | |||
| 380 | #define for_each_child_of_node(parent, child) \ | 385 | #define for_each_child_of_node(parent, child) \ |
| 381 | while (0) | 386 | while (__of_use_dn(parent), __of_use_dn(child), 0) |
| 382 | 387 | ||
| 383 | #define for_each_available_child_of_node(parent, child) \ | 388 | #define for_each_available_child_of_node(parent, child) \ |
| 384 | while (0) | 389 | while (0) |
diff --git a/include/linux/of_device.h b/include/linux/of_device.h index 82ce324fdce7..8d7dd6768cb7 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h | |||
| @@ -64,6 +64,12 @@ static inline int of_driver_match_device(struct device *dev, | |||
| 64 | static inline void of_device_uevent(struct device *dev, | 64 | static inline void of_device_uevent(struct device *dev, |
| 65 | struct kobj_uevent_env *env) { } | 65 | struct kobj_uevent_env *env) { } |
| 66 | 66 | ||
| 67 | static inline int of_device_get_modalias(struct device *dev, | ||
| 68 | char *str, ssize_t len) | ||
| 69 | { | ||
| 70 | return -ENODEV; | ||
| 71 | } | ||
| 72 | |||
| 67 | static inline int of_device_uevent_modalias(struct device *dev, | 73 | static inline int of_device_uevent_modalias(struct device *dev, |
| 68 | struct kobj_uevent_env *env) | 74 | struct kobj_uevent_env *env) |
| 69 | { | 75 | { |
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h index 8163107b94b4..6fe8464ed767 100644 --- a/include/linux/of_mdio.h +++ b/include/linux/of_mdio.h | |||
| @@ -19,6 +19,9 @@ extern struct phy_device *of_phy_connect(struct net_device *dev, | |||
| 19 | struct device_node *phy_np, | 19 | struct device_node *phy_np, |
| 20 | void (*hndlr)(struct net_device *), | 20 | void (*hndlr)(struct net_device *), |
| 21 | u32 flags, phy_interface_t iface); | 21 | u32 flags, phy_interface_t iface); |
| 22 | struct phy_device *of_phy_attach(struct net_device *dev, | ||
| 23 | struct device_node *phy_np, u32 flags, | ||
| 24 | phy_interface_t iface); | ||
| 22 | extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, | 25 | extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, |
| 23 | void (*hndlr)(struct net_device *), | 26 | void (*hndlr)(struct net_device *), |
| 24 | phy_interface_t iface); | 27 | phy_interface_t iface); |
| @@ -44,6 +47,13 @@ static inline struct phy_device *of_phy_connect(struct net_device *dev, | |||
| 44 | return NULL; | 47 | return NULL; |
| 45 | } | 48 | } |
| 46 | 49 | ||
| 50 | static inline struct phy_device *of_phy_attach(struct net_device *dev, | ||
| 51 | struct device_node *phy_np, | ||
| 52 | u32 flags, phy_interface_t iface) | ||
| 53 | { | ||
| 54 | return NULL; | ||
| 55 | } | ||
| 56 | |||
| 47 | static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, | 57 | static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, |
| 48 | void (*hndlr)(struct net_device *), | 58 | void (*hndlr)(struct net_device *), |
| 49 | phy_interface_t iface) | 59 | phy_interface_t iface) |
diff --git a/include/linux/padata.h b/include/linux/padata.h index 86292beebfe2..438694650471 100644 --- a/include/linux/padata.h +++ b/include/linux/padata.h | |||
| @@ -129,10 +129,9 @@ struct parallel_data { | |||
| 129 | struct padata_serial_queue __percpu *squeue; | 129 | struct padata_serial_queue __percpu *squeue; |
| 130 | atomic_t reorder_objects; | 130 | atomic_t reorder_objects; |
| 131 | atomic_t refcnt; | 131 | atomic_t refcnt; |
| 132 | atomic_t seq_nr; | ||
| 132 | struct padata_cpumask cpumask; | 133 | struct padata_cpumask cpumask; |
| 133 | spinlock_t lock ____cacheline_aligned; | 134 | spinlock_t lock ____cacheline_aligned; |
| 134 | spinlock_t seq_lock; | ||
| 135 | unsigned int seq_nr; | ||
| 136 | unsigned int processed; | 135 | unsigned int processed; |
| 137 | struct timer_list timer; | 136 | struct timer_list timer; |
| 138 | }; | 137 | }; |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 98ada58f9942..e464b4e987e8 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
| @@ -412,7 +412,7 @@ static inline void ClearPageCompound(struct page *page) | |||
| 412 | */ | 412 | */ |
| 413 | static inline int PageTransHuge(struct page *page) | 413 | static inline int PageTransHuge(struct page *page) |
| 414 | { | 414 | { |
| 415 | VM_BUG_ON(PageTail(page)); | 415 | VM_BUG_ON_PAGE(PageTail(page), page); |
| 416 | return PageHead(page); | 416 | return PageHead(page); |
| 417 | } | 417 | } |
| 418 | 418 | ||
| @@ -460,25 +460,25 @@ static inline int PageTransTail(struct page *page) | |||
| 460 | */ | 460 | */ |
| 461 | static inline int PageSlabPfmemalloc(struct page *page) | 461 | static inline int PageSlabPfmemalloc(struct page *page) |
| 462 | { | 462 | { |
| 463 | VM_BUG_ON(!PageSlab(page)); | 463 | VM_BUG_ON_PAGE(!PageSlab(page), page); |
| 464 | return PageActive(page); | 464 | return PageActive(page); |
| 465 | } | 465 | } |
| 466 | 466 | ||
| 467 | static inline void SetPageSlabPfmemalloc(struct page *page) | 467 | static inline void SetPageSlabPfmemalloc(struct page *page) |
| 468 | { | 468 | { |
| 469 | VM_BUG_ON(!PageSlab(page)); | 469 | VM_BUG_ON_PAGE(!PageSlab(page), page); |
| 470 | SetPageActive(page); | 470 | SetPageActive(page); |
| 471 | } | 471 | } |
| 472 | 472 | ||
| 473 | static inline void __ClearPageSlabPfmemalloc(struct page *page) | 473 | static inline void __ClearPageSlabPfmemalloc(struct page *page) |
| 474 | { | 474 | { |
| 475 | VM_BUG_ON(!PageSlab(page)); | 475 | VM_BUG_ON_PAGE(!PageSlab(page), page); |
| 476 | __ClearPageActive(page); | 476 | __ClearPageActive(page); |
| 477 | } | 477 | } |
| 478 | 478 | ||
| 479 | static inline void ClearPageSlabPfmemalloc(struct page *page) | 479 | static inline void ClearPageSlabPfmemalloc(struct page *page) |
| 480 | { | 480 | { |
| 481 | VM_BUG_ON(!PageSlab(page)); | 481 | VM_BUG_ON_PAGE(!PageSlab(page), page); |
| 482 | ClearPageActive(page); | 482 | ClearPageActive(page); |
| 483 | } | 483 | } |
| 484 | 484 | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index e3dea75a078b..1710d1b060ba 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -162,7 +162,7 @@ static inline int page_cache_get_speculative(struct page *page) | |||
| 162 | * disabling preempt, and hence no need for the "speculative get" that | 162 | * disabling preempt, and hence no need for the "speculative get" that |
| 163 | * SMP requires. | 163 | * SMP requires. |
| 164 | */ | 164 | */ |
| 165 | VM_BUG_ON(page_count(page) == 0); | 165 | VM_BUG_ON_PAGE(page_count(page) == 0, page); |
| 166 | atomic_inc(&page->_count); | 166 | atomic_inc(&page->_count); |
| 167 | 167 | ||
| 168 | #else | 168 | #else |
| @@ -175,7 +175,7 @@ static inline int page_cache_get_speculative(struct page *page) | |||
| 175 | return 0; | 175 | return 0; |
| 176 | } | 176 | } |
| 177 | #endif | 177 | #endif |
| 178 | VM_BUG_ON(PageTail(page)); | 178 | VM_BUG_ON_PAGE(PageTail(page), page); |
| 179 | 179 | ||
| 180 | return 1; | 180 | return 1; |
| 181 | } | 181 | } |
| @@ -191,14 +191,14 @@ static inline int page_cache_add_speculative(struct page *page, int count) | |||
| 191 | # ifdef CONFIG_PREEMPT_COUNT | 191 | # ifdef CONFIG_PREEMPT_COUNT |
| 192 | VM_BUG_ON(!in_atomic()); | 192 | VM_BUG_ON(!in_atomic()); |
| 193 | # endif | 193 | # endif |
| 194 | VM_BUG_ON(page_count(page) == 0); | 194 | VM_BUG_ON_PAGE(page_count(page) == 0, page); |
| 195 | atomic_add(count, &page->_count); | 195 | atomic_add(count, &page->_count); |
| 196 | 196 | ||
| 197 | #else | 197 | #else |
| 198 | if (unlikely(!atomic_add_unless(&page->_count, count, 0))) | 198 | if (unlikely(!atomic_add_unless(&page->_count, count, 0))) |
| 199 | return 0; | 199 | return 0; |
| 200 | #endif | 200 | #endif |
| 201 | VM_BUG_ON(PageCompound(page) && page != compound_head(page)); | 201 | VM_BUG_ON_PAGE(PageCompound(page) && page != compound_head(page), page); |
| 202 | 202 | ||
| 203 | return 1; | 203 | return 1; |
| 204 | } | 204 | } |
| @@ -210,7 +210,7 @@ static inline int page_freeze_refs(struct page *page, int count) | |||
| 210 | 210 | ||
| 211 | static inline void page_unfreeze_refs(struct page *page, int count) | 211 | static inline void page_unfreeze_refs(struct page *page, int count) |
| 212 | { | 212 | { |
| 213 | VM_BUG_ON(page_count(page) != 0); | 213 | VM_BUG_ON_PAGE(page_count(page) != 0, page); |
| 214 | VM_BUG_ON(count == 0); | 214 | VM_BUG_ON(count == 0); |
| 215 | 215 | ||
| 216 | atomic_set(&page->_count, count); | 216 | atomic_set(&page->_count, count); |
diff --git a/include/linux/parser.h b/include/linux/parser.h index ea2281e726f6..39d5b7955b23 100644 --- a/include/linux/parser.h +++ b/include/linux/parser.h | |||
| @@ -29,5 +29,6 @@ int match_token(char *, const match_table_t table, substring_t args[]); | |||
| 29 | int match_int(substring_t *, int *result); | 29 | int match_int(substring_t *, int *result); |
| 30 | int match_octal(substring_t *, int *result); | 30 | int match_octal(substring_t *, int *result); |
| 31 | int match_hex(substring_t *, int *result); | 31 | int match_hex(substring_t *, int *result); |
| 32 | bool match_wildcard(const char *pattern, const char *str); | ||
| 32 | size_t match_strlcpy(char *, const substring_t *, size_t); | 33 | size_t match_strlcpy(char *, const substring_t *, size_t); |
| 33 | char *match_strdup(const substring_t *); | 34 | char *match_strdup(const substring_t *); |
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h index 68bcefd7fca0..72031785fe1d 100644 --- a/include/linux/pci-ats.h +++ b/include/linux/pci-ats.h | |||
| @@ -56,10 +56,7 @@ static inline int pci_ats_enabled(struct pci_dev *dev) | |||
| 56 | 56 | ||
| 57 | int pci_enable_pri(struct pci_dev *pdev, u32 reqs); | 57 | int pci_enable_pri(struct pci_dev *pdev, u32 reqs); |
| 58 | void pci_disable_pri(struct pci_dev *pdev); | 58 | void pci_disable_pri(struct pci_dev *pdev); |
| 59 | bool pci_pri_enabled(struct pci_dev *pdev); | ||
| 60 | int pci_reset_pri(struct pci_dev *pdev); | 59 | int pci_reset_pri(struct pci_dev *pdev); |
| 61 | bool pci_pri_stopped(struct pci_dev *pdev); | ||
| 62 | int pci_pri_status(struct pci_dev *pdev); | ||
| 63 | 60 | ||
| 64 | #else /* CONFIG_PCI_PRI */ | 61 | #else /* CONFIG_PCI_PRI */ |
| 65 | 62 | ||
| @@ -72,25 +69,11 @@ static inline void pci_disable_pri(struct pci_dev *pdev) | |||
| 72 | { | 69 | { |
| 73 | } | 70 | } |
| 74 | 71 | ||
| 75 | static inline bool pci_pri_enabled(struct pci_dev *pdev) | ||
| 76 | { | ||
| 77 | return false; | ||
| 78 | } | ||
| 79 | |||
| 80 | static inline int pci_reset_pri(struct pci_dev *pdev) | 72 | static inline int pci_reset_pri(struct pci_dev *pdev) |
| 81 | { | 73 | { |
| 82 | return -ENODEV; | 74 | return -ENODEV; |
| 83 | } | 75 | } |
| 84 | 76 | ||
| 85 | static inline bool pci_pri_stopped(struct pci_dev *pdev) | ||
| 86 | { | ||
| 87 | return true; | ||
| 88 | } | ||
| 89 | |||
| 90 | static inline int pci_pri_status(struct pci_dev *pdev) | ||
| 91 | { | ||
| 92 | return -ENODEV; | ||
| 93 | } | ||
| 94 | #endif /* CONFIG_PCI_PRI */ | 77 | #endif /* CONFIG_PCI_PRI */ |
| 95 | 78 | ||
| 96 | #ifdef CONFIG_PCI_PASID | 79 | #ifdef CONFIG_PCI_PASID |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 1084a15175e0..fb57c892b214 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -224,7 +224,8 @@ enum pci_bus_speed { | |||
| 224 | }; | 224 | }; |
| 225 | 225 | ||
| 226 | struct pci_cap_saved_data { | 226 | struct pci_cap_saved_data { |
| 227 | char cap_nr; | 227 | u16 cap_nr; |
| 228 | bool cap_extended; | ||
| 228 | unsigned int size; | 229 | unsigned int size; |
| 229 | u32 data[0]; | 230 | u32 data[0]; |
| 230 | }; | 231 | }; |
| @@ -351,7 +352,7 @@ struct pci_dev { | |||
| 351 | struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */ | 352 | struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */ |
| 352 | #ifdef CONFIG_PCI_MSI | 353 | #ifdef CONFIG_PCI_MSI |
| 353 | struct list_head msi_list; | 354 | struct list_head msi_list; |
| 354 | struct kset *msi_kset; | 355 | const struct attribute_group **msi_irq_groups; |
| 355 | #endif | 356 | #endif |
| 356 | struct pci_vpd *vpd; | 357 | struct pci_vpd *vpd; |
| 357 | #ifdef CONFIG_PCI_ATS | 358 | #ifdef CONFIG_PCI_ATS |
| @@ -375,7 +376,6 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev) | |||
| 375 | } | 376 | } |
| 376 | 377 | ||
| 377 | struct pci_dev *pci_alloc_dev(struct pci_bus *bus); | 378 | struct pci_dev *pci_alloc_dev(struct pci_bus *bus); |
| 378 | struct pci_dev * __deprecated alloc_pci_dev(void); | ||
| 379 | 379 | ||
| 380 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) | 380 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) |
| 381 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) | 381 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) |
| @@ -385,8 +385,6 @@ static inline int pci_channel_offline(struct pci_dev *pdev) | |||
| 385 | return (pdev->error_state != pci_channel_io_normal); | 385 | return (pdev->error_state != pci_channel_io_normal); |
| 386 | } | 386 | } |
| 387 | 387 | ||
| 388 | extern struct resource busn_resource; | ||
| 389 | |||
| 390 | struct pci_host_bridge_window { | 388 | struct pci_host_bridge_window { |
| 391 | struct list_head list; | 389 | struct list_head list; |
| 392 | struct resource *res; /* host bridge aperture (CPU address) */ | 390 | struct resource *res; /* host bridge aperture (CPU address) */ |
| @@ -551,8 +549,8 @@ int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, | |||
| 551 | int reg, int len, u32 val); | 549 | int reg, int len, u32 val); |
| 552 | 550 | ||
| 553 | struct pci_bus_region { | 551 | struct pci_bus_region { |
| 554 | resource_size_t start; | 552 | dma_addr_t start; |
| 555 | resource_size_t end; | 553 | dma_addr_t end; |
| 556 | }; | 554 | }; |
| 557 | 555 | ||
| 558 | struct pci_dynids { | 556 | struct pci_dynids { |
| @@ -634,8 +632,7 @@ struct pci_driver { | |||
| 634 | * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table | 632 | * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table |
| 635 | * @_table: device table name | 633 | * @_table: device table name |
| 636 | * | 634 | * |
| 637 | * This macro is used to create a struct pci_device_id array (a device table) | 635 | * This macro is deprecated and should not be used in new code. |
| 638 | * in a generic manner. | ||
| 639 | */ | 636 | */ |
| 640 | #define DEFINE_PCI_DEVICE_TABLE(_table) \ | 637 | #define DEFINE_PCI_DEVICE_TABLE(_table) \ |
| 641 | const struct pci_device_id _table[] | 638 | const struct pci_device_id _table[] |
| @@ -737,9 +734,9 @@ void pci_fixup_cardbus(struct pci_bus *); | |||
| 737 | 734 | ||
| 738 | /* Generic PCI functions used internally */ | 735 | /* Generic PCI functions used internally */ |
| 739 | 736 | ||
| 740 | void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 737 | void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region, |
| 741 | struct resource *res); | 738 | struct resource *res); |
| 742 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | 739 | void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res, |
| 743 | struct pci_bus_region *region); | 740 | struct pci_bus_region *region); |
| 744 | void pcibios_scan_specific_bus(int busn); | 741 | void pcibios_scan_specific_bus(int busn); |
| 745 | struct pci_bus *pci_find_bus(int domain, int busnr); | 742 | struct pci_bus *pci_find_bus(int domain, int busnr); |
| @@ -763,7 +760,6 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, | |||
| 763 | const char *name, | 760 | const char *name, |
| 764 | struct hotplug_slot *hotplug); | 761 | struct hotplug_slot *hotplug); |
| 765 | void pci_destroy_slot(struct pci_slot *slot); | 762 | void pci_destroy_slot(struct pci_slot *slot); |
| 766 | void pci_renumber_slot(struct pci_slot *slot, int slot_nr); | ||
| 767 | int pci_scan_slot(struct pci_bus *bus, int devfn); | 763 | int pci_scan_slot(struct pci_bus *bus, int devfn); |
| 768 | struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); | 764 | struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); |
| 769 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); | 765 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); |
| @@ -779,6 +775,7 @@ struct pci_dev *pci_dev_get(struct pci_dev *dev); | |||
| 779 | void pci_dev_put(struct pci_dev *dev); | 775 | void pci_dev_put(struct pci_dev *dev); |
| 780 | void pci_remove_bus(struct pci_bus *b); | 776 | void pci_remove_bus(struct pci_bus *b); |
| 781 | void pci_stop_and_remove_bus_device(struct pci_dev *dev); | 777 | void pci_stop_and_remove_bus_device(struct pci_dev *dev); |
| 778 | void pci_stop_and_remove_bus_device_locked(struct pci_dev *dev); | ||
| 782 | void pci_stop_root_bus(struct pci_bus *bus); | 779 | void pci_stop_root_bus(struct pci_bus *bus); |
| 783 | void pci_remove_root_bus(struct pci_bus *bus); | 780 | void pci_remove_root_bus(struct pci_bus *bus); |
| 784 | void pci_setup_cardbus(struct pci_bus *bus); | 781 | void pci_setup_cardbus(struct pci_bus *bus); |
| @@ -938,6 +935,7 @@ bool pci_check_and_unmask_intx(struct pci_dev *dev); | |||
| 938 | void pci_msi_off(struct pci_dev *dev); | 935 | void pci_msi_off(struct pci_dev *dev); |
| 939 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); | 936 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); |
| 940 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); | 937 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); |
| 938 | int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask); | ||
| 941 | int pci_wait_for_pending_transaction(struct pci_dev *dev); | 939 | int pci_wait_for_pending_transaction(struct pci_dev *dev); |
| 942 | int pcix_get_max_mmrbc(struct pci_dev *dev); | 940 | int pcix_get_max_mmrbc(struct pci_dev *dev); |
| 943 | int pcix_get_mmrbc(struct pci_dev *dev); | 941 | int pcix_get_mmrbc(struct pci_dev *dev); |
| @@ -951,15 +949,19 @@ int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed, | |||
| 951 | int __pci_reset_function(struct pci_dev *dev); | 949 | int __pci_reset_function(struct pci_dev *dev); |
| 952 | int __pci_reset_function_locked(struct pci_dev *dev); | 950 | int __pci_reset_function_locked(struct pci_dev *dev); |
| 953 | int pci_reset_function(struct pci_dev *dev); | 951 | int pci_reset_function(struct pci_dev *dev); |
| 952 | int pci_try_reset_function(struct pci_dev *dev); | ||
| 954 | int pci_probe_reset_slot(struct pci_slot *slot); | 953 | int pci_probe_reset_slot(struct pci_slot *slot); |
| 955 | int pci_reset_slot(struct pci_slot *slot); | 954 | int pci_reset_slot(struct pci_slot *slot); |
| 955 | int pci_try_reset_slot(struct pci_slot *slot); | ||
| 956 | int pci_probe_reset_bus(struct pci_bus *bus); | 956 | int pci_probe_reset_bus(struct pci_bus *bus); |
| 957 | int pci_reset_bus(struct pci_bus *bus); | 957 | int pci_reset_bus(struct pci_bus *bus); |
| 958 | int pci_try_reset_bus(struct pci_bus *bus); | ||
| 958 | void pci_reset_bridge_secondary_bus(struct pci_dev *dev); | 959 | void pci_reset_bridge_secondary_bus(struct pci_dev *dev); |
| 959 | void pci_update_resource(struct pci_dev *dev, int resno); | 960 | void pci_update_resource(struct pci_dev *dev, int resno); |
| 960 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 961 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
| 961 | int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); | 962 | int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); |
| 962 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); | 963 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); |
| 964 | bool pci_device_is_present(struct pci_dev *pdev); | ||
| 963 | 965 | ||
| 964 | /* ROM control related routines */ | 966 | /* ROM control related routines */ |
| 965 | int pci_enable_rom(struct pci_dev *pdev); | 967 | int pci_enable_rom(struct pci_dev *pdev); |
| @@ -973,9 +975,14 @@ void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size); | |||
| 973 | int pci_save_state(struct pci_dev *dev); | 975 | int pci_save_state(struct pci_dev *dev); |
| 974 | void pci_restore_state(struct pci_dev *dev); | 976 | void pci_restore_state(struct pci_dev *dev); |
| 975 | struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev); | 977 | struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev); |
| 976 | int pci_load_saved_state(struct pci_dev *dev, struct pci_saved_state *state); | ||
| 977 | int pci_load_and_free_saved_state(struct pci_dev *dev, | 978 | int pci_load_and_free_saved_state(struct pci_dev *dev, |
| 978 | struct pci_saved_state **state); | 979 | struct pci_saved_state **state); |
| 980 | struct pci_cap_saved_state *pci_find_saved_cap(struct pci_dev *dev, char cap); | ||
| 981 | struct pci_cap_saved_state *pci_find_saved_ext_cap(struct pci_dev *dev, | ||
| 982 | u16 cap); | ||
| 983 | int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size); | ||
| 984 | int pci_add_ext_cap_save_buffer(struct pci_dev *dev, | ||
| 985 | u16 cap, unsigned int size); | ||
| 979 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); | 986 | int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); |
| 980 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | 987 | int pci_set_power_state(struct pci_dev *dev, pci_power_t state); |
| 981 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 988 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
| @@ -984,7 +991,6 @@ void pci_pme_active(struct pci_dev *dev, bool enable); | |||
| 984 | int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, | 991 | int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
| 985 | bool runtime, bool enable); | 992 | bool runtime, bool enable); |
| 986 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); | 993 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); |
| 987 | pci_power_t pci_target_state(struct pci_dev *dev); | ||
| 988 | int pci_prepare_to_sleep(struct pci_dev *dev); | 994 | int pci_prepare_to_sleep(struct pci_dev *dev); |
| 989 | int pci_back_from_sleep(struct pci_dev *dev); | 995 | int pci_back_from_sleep(struct pci_dev *dev); |
| 990 | bool pci_dev_run_wake(struct pci_dev *dev); | 996 | bool pci_dev_run_wake(struct pci_dev *dev); |
| @@ -997,21 +1003,10 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | |||
| 997 | return __pci_enable_wake(dev, state, false, enable); | 1003 | return __pci_enable_wake(dev, state, false, enable); |
| 998 | } | 1004 | } |
| 999 | 1005 | ||
| 1000 | #define PCI_EXP_IDO_REQUEST (1<<0) | 1006 | /* PCI Virtual Channel */ |
| 1001 | #define PCI_EXP_IDO_COMPLETION (1<<1) | 1007 | int pci_save_vc_state(struct pci_dev *dev); |
| 1002 | void pci_enable_ido(struct pci_dev *dev, unsigned long type); | 1008 | void pci_restore_vc_state(struct pci_dev *dev); |
| 1003 | void pci_disable_ido(struct pci_dev *dev, unsigned long type); | 1009 | void pci_allocate_vc_save_buffers(struct pci_dev *dev); |
| 1004 | |||
| 1005 | enum pci_obff_signal_type { | ||
| 1006 | PCI_EXP_OBFF_SIGNAL_L0 = 0, | ||
| 1007 | PCI_EXP_OBFF_SIGNAL_ALWAYS = 1, | ||
| 1008 | }; | ||
| 1009 | int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); | ||
| 1010 | void pci_disable_obff(struct pci_dev *dev); | ||
| 1011 | |||
| 1012 | int pci_enable_ltr(struct pci_dev *dev); | ||
| 1013 | void pci_disable_ltr(struct pci_dev *dev); | ||
| 1014 | int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns); | ||
| 1015 | 1010 | ||
| 1016 | /* For use by arch with custom probe code */ | 1011 | /* For use by arch with custom probe code */ |
| 1017 | void set_pcie_port_type(struct pci_dev *pdev); | 1012 | void set_pcie_port_type(struct pci_dev *pdev); |
| @@ -1021,11 +1016,12 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev); | |||
| 1021 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); | 1016 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); |
| 1022 | unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); | 1017 | unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); |
| 1023 | unsigned int pci_rescan_bus(struct pci_bus *bus); | 1018 | unsigned int pci_rescan_bus(struct pci_bus *bus); |
| 1019 | void pci_lock_rescan_remove(void); | ||
| 1020 | void pci_unlock_rescan_remove(void); | ||
| 1024 | 1021 | ||
| 1025 | /* Vital product data routines */ | 1022 | /* Vital product data routines */ |
| 1026 | ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); | 1023 | ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); |
| 1027 | ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); | 1024 | ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); |
| 1028 | int pci_vpd_truncate(struct pci_dev *dev, size_t size); | ||
| 1029 | 1025 | ||
| 1030 | /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ | 1026 | /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ |
| 1031 | resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx); | 1027 | resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx); |
| @@ -1077,6 +1073,14 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus, | |||
| 1077 | resource_size_t), | 1073 | resource_size_t), |
| 1078 | void *alignf_data); | 1074 | void *alignf_data); |
| 1079 | 1075 | ||
| 1076 | static inline dma_addr_t pci_bus_address(struct pci_dev *pdev, int bar) | ||
| 1077 | { | ||
| 1078 | struct pci_bus_region region; | ||
| 1079 | |||
| 1080 | pcibios_resource_to_bus(pdev->bus, ®ion, &pdev->resource[bar]); | ||
| 1081 | return region.start; | ||
| 1082 | } | ||
| 1083 | |||
| 1080 | /* Proper probing supporting hot-pluggable devices */ | 1084 | /* Proper probing supporting hot-pluggable devices */ |
| 1081 | int __must_check __pci_register_driver(struct pci_driver *, struct module *, | 1085 | int __must_check __pci_register_driver(struct pci_driver *, struct module *, |
| 1082 | const char *mod_name); | 1086 | const char *mod_name); |
| @@ -1114,7 +1118,6 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, | |||
| 1114 | 1118 | ||
| 1115 | void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), | 1119 | void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), |
| 1116 | void *userdata); | 1120 | void *userdata); |
| 1117 | int pci_cfg_space_size_ext(struct pci_dev *dev); | ||
| 1118 | int pci_cfg_space_size(struct pci_dev *dev); | 1121 | int pci_cfg_space_size(struct pci_dev *dev); |
| 1119 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); | 1122 | unsigned char pci_bus_max_busnr(struct pci_bus *bus); |
| 1120 | void pci_setup_bridge(struct pci_bus *bus); | 1123 | void pci_setup_bridge(struct pci_bus *bus); |
| @@ -1153,59 +1156,42 @@ struct msix_entry { | |||
| 1153 | }; | 1156 | }; |
| 1154 | 1157 | ||
| 1155 | 1158 | ||
| 1156 | #ifndef CONFIG_PCI_MSI | 1159 | #ifdef CONFIG_PCI_MSI |
| 1157 | static inline int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec) | 1160 | int pci_msi_vec_count(struct pci_dev *dev); |
| 1158 | { | 1161 | int pci_enable_msi_block(struct pci_dev *dev, int nvec); |
| 1159 | return -1; | ||
| 1160 | } | ||
| 1161 | |||
| 1162 | static inline int | ||
| 1163 | pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec) | ||
| 1164 | { | ||
| 1165 | return -1; | ||
| 1166 | } | ||
| 1167 | |||
| 1168 | static inline void pci_msi_shutdown(struct pci_dev *dev) | ||
| 1169 | { } | ||
| 1170 | static inline void pci_disable_msi(struct pci_dev *dev) | ||
| 1171 | { } | ||
| 1172 | |||
| 1173 | static inline int pci_msix_table_size(struct pci_dev *dev) | ||
| 1174 | { | ||
| 1175 | return 0; | ||
| 1176 | } | ||
| 1177 | static inline int pci_enable_msix(struct pci_dev *dev, | ||
| 1178 | struct msix_entry *entries, int nvec) | ||
| 1179 | { | ||
| 1180 | return -1; | ||
| 1181 | } | ||
| 1182 | |||
| 1183 | static inline void pci_msix_shutdown(struct pci_dev *dev) | ||
| 1184 | { } | ||
| 1185 | static inline void pci_disable_msix(struct pci_dev *dev) | ||
| 1186 | { } | ||
| 1187 | |||
| 1188 | static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) | ||
| 1189 | { } | ||
| 1190 | |||
| 1191 | static inline void pci_restore_msi_state(struct pci_dev *dev) | ||
| 1192 | { } | ||
| 1193 | static inline int pci_msi_enabled(void) | ||
| 1194 | { | ||
| 1195 | return 0; | ||
| 1196 | } | ||
| 1197 | #else | ||
| 1198 | int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); | ||
| 1199 | int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); | ||
| 1200 | void pci_msi_shutdown(struct pci_dev *dev); | 1162 | void pci_msi_shutdown(struct pci_dev *dev); |
| 1201 | void pci_disable_msi(struct pci_dev *dev); | 1163 | void pci_disable_msi(struct pci_dev *dev); |
| 1202 | int pci_msix_table_size(struct pci_dev *dev); | 1164 | int pci_msix_vec_count(struct pci_dev *dev); |
| 1203 | int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); | 1165 | int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); |
| 1204 | void pci_msix_shutdown(struct pci_dev *dev); | 1166 | void pci_msix_shutdown(struct pci_dev *dev); |
| 1205 | void pci_disable_msix(struct pci_dev *dev); | 1167 | void pci_disable_msix(struct pci_dev *dev); |
| 1206 | void msi_remove_pci_irq_vectors(struct pci_dev *dev); | 1168 | void msi_remove_pci_irq_vectors(struct pci_dev *dev); |
| 1207 | void pci_restore_msi_state(struct pci_dev *dev); | 1169 | void pci_restore_msi_state(struct pci_dev *dev); |
| 1208 | int pci_msi_enabled(void); | 1170 | int pci_msi_enabled(void); |
| 1171 | int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec); | ||
| 1172 | int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, | ||
| 1173 | int minvec, int maxvec); | ||
| 1174 | #else | ||
| 1175 | static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; } | ||
| 1176 | static inline int pci_enable_msi_block(struct pci_dev *dev, int nvec) | ||
| 1177 | { return -ENOSYS; } | ||
| 1178 | static inline void pci_msi_shutdown(struct pci_dev *dev) { } | ||
| 1179 | static inline void pci_disable_msi(struct pci_dev *dev) { } | ||
| 1180 | static inline int pci_msix_vec_count(struct pci_dev *dev) { return -ENOSYS; } | ||
| 1181 | static inline int pci_enable_msix(struct pci_dev *dev, | ||
| 1182 | struct msix_entry *entries, int nvec) | ||
| 1183 | { return -ENOSYS; } | ||
| 1184 | static inline void pci_msix_shutdown(struct pci_dev *dev) { } | ||
| 1185 | static inline void pci_disable_msix(struct pci_dev *dev) { } | ||
| 1186 | static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) { } | ||
| 1187 | static inline void pci_restore_msi_state(struct pci_dev *dev) { } | ||
| 1188 | static inline int pci_msi_enabled(void) { return 0; } | ||
| 1189 | static inline int pci_enable_msi_range(struct pci_dev *dev, int minvec, | ||
| 1190 | int maxvec) | ||
| 1191 | { return -ENOSYS; } | ||
| 1192 | static inline int pci_enable_msix_range(struct pci_dev *dev, | ||
| 1193 | struct msix_entry *entries, int minvec, int maxvec) | ||
| 1194 | { return -ENOSYS; } | ||
| 1209 | #endif | 1195 | #endif |
| 1210 | 1196 | ||
| 1211 | #ifdef CONFIG_PCIEPORTBUS | 1197 | #ifdef CONFIG_PCIEPORTBUS |
| @@ -1216,12 +1202,10 @@ extern bool pcie_ports_auto; | |||
| 1216 | #define pcie_ports_auto false | 1202 | #define pcie_ports_auto false |
| 1217 | #endif | 1203 | #endif |
| 1218 | 1204 | ||
| 1219 | #ifndef CONFIG_PCIEASPM | 1205 | #ifdef CONFIG_PCIEASPM |
| 1220 | static inline int pcie_aspm_enabled(void) { return 0; } | ||
| 1221 | static inline bool pcie_aspm_support_enabled(void) { return false; } | ||
| 1222 | #else | ||
| 1223 | int pcie_aspm_enabled(void); | ||
| 1224 | bool pcie_aspm_support_enabled(void); | 1206 | bool pcie_aspm_support_enabled(void); |
| 1207 | #else | ||
| 1208 | static inline bool pcie_aspm_support_enabled(void) { return false; } | ||
| 1225 | #endif | 1209 | #endif |
| 1226 | 1210 | ||
| 1227 | #ifdef CONFIG_PCIEAER | 1211 | #ifdef CONFIG_PCIEAER |
| @@ -1232,15 +1216,12 @@ static inline void pci_no_aer(void) { } | |||
| 1232 | static inline bool pci_aer_available(void) { return false; } | 1216 | static inline bool pci_aer_available(void) { return false; } |
| 1233 | #endif | 1217 | #endif |
| 1234 | 1218 | ||
| 1235 | #ifndef CONFIG_PCIE_ECRC | 1219 | #ifdef CONFIG_PCIE_ECRC |
| 1236 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) | ||
| 1237 | { | ||
| 1238 | return; | ||
| 1239 | } | ||
| 1240 | static inline void pcie_ecrc_get_policy(char *str) {}; | ||
| 1241 | #else | ||
| 1242 | void pcie_set_ecrc_checking(struct pci_dev *dev); | 1220 | void pcie_set_ecrc_checking(struct pci_dev *dev); |
| 1243 | void pcie_ecrc_get_policy(char *str); | 1221 | void pcie_ecrc_get_policy(char *str); |
| 1222 | #else | ||
| 1223 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { } | ||
| 1224 | static inline void pcie_ecrc_get_policy(char *str) { } | ||
| 1244 | #endif | 1225 | #endif |
| 1245 | 1226 | ||
| 1246 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) | 1227 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) |
| @@ -1264,15 +1245,8 @@ void pci_cfg_access_unlock(struct pci_dev *dev); | |||
| 1264 | extern int pci_domains_supported; | 1245 | extern int pci_domains_supported; |
| 1265 | #else | 1246 | #else |
| 1266 | enum { pci_domains_supported = 0 }; | 1247 | enum { pci_domains_supported = 0 }; |
| 1267 | static inline int pci_domain_nr(struct pci_bus *bus) | 1248 | static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } |
| 1268 | { | 1249 | static inline int pci_proc_domain(struct pci_bus *bus) { return 0; } |
| 1269 | return 0; | ||
| 1270 | } | ||
| 1271 | |||
| 1272 | static inline int pci_proc_domain(struct pci_bus *bus) | ||
| 1273 | { | ||
| 1274 | return 0; | ||
| 1275 | } | ||
| 1276 | #endif /* CONFIG_PCI_DOMAINS */ | 1250 | #endif /* CONFIG_PCI_DOMAINS */ |
| 1277 | 1251 | ||
| 1278 | /* some architectures require additional setup to direct VGA traffic */ | 1252 | /* some architectures require additional setup to direct VGA traffic */ |
| @@ -1301,180 +1275,88 @@ _PCI_NOP_ALL(write,) | |||
| 1301 | static inline struct pci_dev *pci_get_device(unsigned int vendor, | 1275 | static inline struct pci_dev *pci_get_device(unsigned int vendor, |
| 1302 | unsigned int device, | 1276 | unsigned int device, |
| 1303 | struct pci_dev *from) | 1277 | struct pci_dev *from) |
| 1304 | { | 1278 | { return NULL; } |
| 1305 | return NULL; | ||
| 1306 | } | ||
| 1307 | 1279 | ||
| 1308 | static inline struct pci_dev *pci_get_subsys(unsigned int vendor, | 1280 | static inline struct pci_dev *pci_get_subsys(unsigned int vendor, |
| 1309 | unsigned int device, | 1281 | unsigned int device, |
| 1310 | unsigned int ss_vendor, | 1282 | unsigned int ss_vendor, |
| 1311 | unsigned int ss_device, | 1283 | unsigned int ss_device, |
| 1312 | struct pci_dev *from) | 1284 | struct pci_dev *from) |
| 1313 | { | 1285 | { return NULL; } |
| 1314 | return NULL; | ||
| 1315 | } | ||
| 1316 | 1286 | ||
| 1317 | static inline struct pci_dev *pci_get_class(unsigned int class, | 1287 | static inline struct pci_dev *pci_get_class(unsigned int class, |
| 1318 | struct pci_dev *from) | 1288 | struct pci_dev *from) |
| 1319 | { | 1289 | { return NULL; } |
| 1320 | return NULL; | ||
| 1321 | } | ||
| 1322 | 1290 | ||
| 1323 | #define pci_dev_present(ids) (0) | 1291 | #define pci_dev_present(ids) (0) |
| 1324 | #define no_pci_devices() (1) | 1292 | #define no_pci_devices() (1) |
| 1325 | #define pci_dev_put(dev) do { } while (0) | 1293 | #define pci_dev_put(dev) do { } while (0) |
| 1326 | 1294 | ||
| 1327 | static inline void pci_set_master(struct pci_dev *dev) | 1295 | static inline void pci_set_master(struct pci_dev *dev) { } |
| 1328 | { } | 1296 | static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; } |
| 1329 | 1297 | static inline void pci_disable_device(struct pci_dev *dev) { } | |
| 1330 | static inline int pci_enable_device(struct pci_dev *dev) | ||
| 1331 | { | ||
| 1332 | return -EIO; | ||
| 1333 | } | ||
| 1334 | |||
| 1335 | static inline void pci_disable_device(struct pci_dev *dev) | ||
| 1336 | { } | ||
| 1337 | |||
| 1338 | static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) | 1298 | static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) |
| 1339 | { | 1299 | { return -EIO; } |
| 1340 | return -EIO; | ||
| 1341 | } | ||
| 1342 | |||
| 1343 | static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) | 1300 | static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) |
| 1344 | { | 1301 | { return -EIO; } |
| 1345 | return -EIO; | ||
| 1346 | } | ||
| 1347 | |||
| 1348 | static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, | 1302 | static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, |
| 1349 | unsigned int size) | 1303 | unsigned int size) |
| 1350 | { | 1304 | { return -EIO; } |
| 1351 | return -EIO; | ||
| 1352 | } | ||
| 1353 | |||
| 1354 | static inline int pci_set_dma_seg_boundary(struct pci_dev *dev, | 1305 | static inline int pci_set_dma_seg_boundary(struct pci_dev *dev, |
| 1355 | unsigned long mask) | 1306 | unsigned long mask) |
| 1356 | { | 1307 | { return -EIO; } |
| 1357 | return -EIO; | ||
| 1358 | } | ||
| 1359 | |||
| 1360 | static inline int pci_assign_resource(struct pci_dev *dev, int i) | 1308 | static inline int pci_assign_resource(struct pci_dev *dev, int i) |
| 1361 | { | 1309 | { return -EBUSY; } |
| 1362 | return -EBUSY; | ||
| 1363 | } | ||
| 1364 | |||
| 1365 | static inline int __pci_register_driver(struct pci_driver *drv, | 1310 | static inline int __pci_register_driver(struct pci_driver *drv, |
| 1366 | struct module *owner) | 1311 | struct module *owner) |
| 1367 | { | 1312 | { return 0; } |
| 1368 | return 0; | ||
| 1369 | } | ||
| 1370 | |||
| 1371 | static inline int pci_register_driver(struct pci_driver *drv) | 1313 | static inline int pci_register_driver(struct pci_driver *drv) |
| 1372 | { | 1314 | { return 0; } |
| 1373 | return 0; | 1315 | static inline void pci_unregister_driver(struct pci_driver *drv) { } |
| 1374 | } | ||
| 1375 | |||
| 1376 | static inline void pci_unregister_driver(struct pci_driver *drv) | ||
| 1377 | { } | ||
| 1378 | |||
| 1379 | static inline int pci_find_capability(struct pci_dev *dev, int cap) | 1316 | static inline int pci_find_capability(struct pci_dev *dev, int cap) |
| 1380 | { | 1317 | { return 0; } |
| 1381 | return 0; | ||
| 1382 | } | ||
| 1383 | |||
| 1384 | static inline int pci_find_next_capability(struct pci_dev *dev, u8 post, | 1318 | static inline int pci_find_next_capability(struct pci_dev *dev, u8 post, |
| 1385 | int cap) | 1319 | int cap) |
| 1386 | { | 1320 | { return 0; } |
| 1387 | return 0; | ||
| 1388 | } | ||
| 1389 | |||
| 1390 | static inline int pci_find_ext_capability(struct pci_dev *dev, int cap) | 1321 | static inline int pci_find_ext_capability(struct pci_dev *dev, int cap) |
| 1391 | { | 1322 | { return 0; } |
| 1392 | return 0; | ||
| 1393 | } | ||
| 1394 | 1323 | ||
| 1395 | /* Power management related routines */ | 1324 | /* Power management related routines */ |
| 1396 | static inline int pci_save_state(struct pci_dev *dev) | 1325 | static inline int pci_save_state(struct pci_dev *dev) { return 0; } |
| 1397 | { | 1326 | static inline void pci_restore_state(struct pci_dev *dev) { } |
| 1398 | return 0; | ||
| 1399 | } | ||
| 1400 | |||
| 1401 | static inline void pci_restore_state(struct pci_dev *dev) | ||
| 1402 | { } | ||
| 1403 | |||
| 1404 | static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) | 1327 | static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) |
| 1405 | { | 1328 | { return 0; } |
| 1406 | return 0; | ||
| 1407 | } | ||
| 1408 | |||
| 1409 | static inline int pci_wake_from_d3(struct pci_dev *dev, bool enable) | 1329 | static inline int pci_wake_from_d3(struct pci_dev *dev, bool enable) |
| 1410 | { | 1330 | { return 0; } |
| 1411 | return 0; | ||
| 1412 | } | ||
| 1413 | |||
| 1414 | static inline pci_power_t pci_choose_state(struct pci_dev *dev, | 1331 | static inline pci_power_t pci_choose_state(struct pci_dev *dev, |
| 1415 | pm_message_t state) | 1332 | pm_message_t state) |
| 1416 | { | 1333 | { return PCI_D0; } |
| 1417 | return PCI_D0; | ||
| 1418 | } | ||
| 1419 | |||
| 1420 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | 1334 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
| 1421 | int enable) | 1335 | int enable) |
| 1422 | { | 1336 | { return 0; } |
| 1423 | return 0; | ||
| 1424 | } | ||
| 1425 | |||
| 1426 | static inline void pci_enable_ido(struct pci_dev *dev, unsigned long type) | ||
| 1427 | { | ||
| 1428 | } | ||
| 1429 | |||
| 1430 | static inline void pci_disable_ido(struct pci_dev *dev, unsigned long type) | ||
| 1431 | { | ||
| 1432 | } | ||
| 1433 | |||
| 1434 | static inline int pci_enable_obff(struct pci_dev *dev, unsigned long type) | ||
| 1435 | { | ||
| 1436 | return 0; | ||
| 1437 | } | ||
| 1438 | |||
| 1439 | static inline void pci_disable_obff(struct pci_dev *dev) | ||
| 1440 | { | ||
| 1441 | } | ||
| 1442 | 1337 | ||
| 1443 | static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) | 1338 | static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) |
| 1444 | { | 1339 | { return -EIO; } |
| 1445 | return -EIO; | 1340 | static inline void pci_release_regions(struct pci_dev *dev) { } |
| 1446 | } | ||
| 1447 | |||
| 1448 | static inline void pci_release_regions(struct pci_dev *dev) | ||
| 1449 | { } | ||
| 1450 | 1341 | ||
| 1451 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) | 1342 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) |
| 1452 | 1343 | ||
| 1453 | static inline void pci_block_cfg_access(struct pci_dev *dev) | 1344 | static inline void pci_block_cfg_access(struct pci_dev *dev) { } |
| 1454 | { } | ||
| 1455 | |||
| 1456 | static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) | 1345 | static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) |
| 1457 | { return 0; } | 1346 | { return 0; } |
| 1458 | 1347 | static inline void pci_unblock_cfg_access(struct pci_dev *dev) { } | |
| 1459 | static inline void pci_unblock_cfg_access(struct pci_dev *dev) | ||
| 1460 | { } | ||
| 1461 | 1348 | ||
| 1462 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) | 1349 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) |
| 1463 | { return NULL; } | 1350 | { return NULL; } |
| 1464 | |||
| 1465 | static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, | 1351 | static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, |
| 1466 | unsigned int devfn) | 1352 | unsigned int devfn) |
| 1467 | { return NULL; } | 1353 | { return NULL; } |
| 1468 | |||
| 1469 | static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | 1354 | static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, |
| 1470 | unsigned int devfn) | 1355 | unsigned int devfn) |
| 1471 | { return NULL; } | 1356 | { return NULL; } |
| 1472 | 1357 | ||
| 1473 | static inline int pci_domain_nr(struct pci_bus *bus) | 1358 | static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } |
| 1474 | { return 0; } | 1359 | static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; } |
| 1475 | |||
| 1476 | static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) | ||
| 1477 | { return NULL; } | ||
| 1478 | 1360 | ||
| 1479 | #define dev_is_pci(d) (false) | 1361 | #define dev_is_pci(d) (false) |
| 1480 | #define dev_is_pf(d) (false) | 1362 | #define dev_is_pf(d) (false) |
| @@ -1485,10 +1367,6 @@ static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) | |||
| 1485 | 1367 | ||
| 1486 | #include <asm/pci.h> | 1368 | #include <asm/pci.h> |
| 1487 | 1369 | ||
| 1488 | #ifndef PCIBIOS_MAX_MEM_32 | ||
| 1489 | #define PCIBIOS_MAX_MEM_32 (-1) | ||
| 1490 | #endif | ||
| 1491 | |||
| 1492 | /* these helpers provide future and backwards compatibility | 1370 | /* these helpers provide future and backwards compatibility |
| 1493 | * for accessing popular PCI BAR info */ | 1371 | * for accessing popular PCI BAR info */ |
| 1494 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) | 1372 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) |
| @@ -1567,65 +1445,65 @@ enum pci_fixup_pass { | |||
| 1567 | /* Anonymous variables would be nice... */ | 1445 | /* Anonymous variables would be nice... */ |
| 1568 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ | 1446 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ |
| 1569 | class_shift, hook) \ | 1447 | class_shift, hook) \ |
| 1570 | static const struct pci_fixup __pci_fixup_##name __used \ | 1448 | static const struct pci_fixup __PASTE(__pci_fixup_##name,__LINE__) __used \ |
| 1571 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ | 1449 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ |
| 1572 | = { vendor, device, class, class_shift, hook }; | 1450 | = { vendor, device, class, class_shift, hook }; |
| 1573 | 1451 | ||
| 1574 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ | 1452 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ |
| 1575 | class_shift, hook) \ | 1453 | class_shift, hook) \ |
| 1576 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1454 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
| 1577 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1455 | hook, vendor, device, class, class_shift, hook) |
| 1578 | #define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \ | 1456 | #define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \ |
| 1579 | class_shift, hook) \ | 1457 | class_shift, hook) \ |
| 1580 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ | 1458 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ |
| 1581 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1459 | hook, vendor, device, class, class_shift, hook) |
| 1582 | #define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \ | 1460 | #define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \ |
| 1583 | class_shift, hook) \ | 1461 | class_shift, hook) \ |
| 1584 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ | 1462 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ |
| 1585 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1463 | hook, vendor, device, class, class_shift, hook) |
| 1586 | #define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \ | 1464 | #define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \ |
| 1587 | class_shift, hook) \ | 1465 | class_shift, hook) \ |
| 1588 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ | 1466 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ |
| 1589 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1467 | hook, vendor, device, class, class_shift, hook) |
| 1590 | #define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \ | 1468 | #define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \ |
| 1591 | class_shift, hook) \ | 1469 | class_shift, hook) \ |
| 1592 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ | 1470 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ |
| 1593 | resume##vendor##device##hook, vendor, device, class, \ | 1471 | resume##hook, vendor, device, class, \ |
| 1594 | class_shift, hook) | 1472 | class_shift, hook) |
| 1595 | #define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \ | 1473 | #define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \ |
| 1596 | class_shift, hook) \ | 1474 | class_shift, hook) \ |
| 1597 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ | 1475 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ |
| 1598 | resume_early##vendor##device##hook, vendor, device, \ | 1476 | resume_early##hook, vendor, device, \ |
| 1599 | class, class_shift, hook) | 1477 | class, class_shift, hook) |
| 1600 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \ | 1478 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \ |
| 1601 | class_shift, hook) \ | 1479 | class_shift, hook) \ |
| 1602 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1480 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
| 1603 | suspend##vendor##device##hook, vendor, device, class, \ | 1481 | suspend##hook, vendor, device, class, \ |
| 1604 | class_shift, hook) | 1482 | class_shift, hook) |
| 1605 | 1483 | ||
| 1606 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ | 1484 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ |
| 1607 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1485 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
| 1608 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1486 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
| 1609 | #define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \ | 1487 | #define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \ |
| 1610 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ | 1488 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ |
| 1611 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1489 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
| 1612 | #define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \ | 1490 | #define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \ |
| 1613 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ | 1491 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ |
| 1614 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1492 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
| 1615 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ | 1493 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ |
| 1616 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ | 1494 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ |
| 1617 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1495 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
| 1618 | #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ | 1496 | #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ |
| 1619 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ | 1497 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ |
| 1620 | resume##vendor##device##hook, vendor, device, \ | 1498 | resume##hook, vendor, device, \ |
| 1621 | PCI_ANY_ID, 0, hook) | 1499 | PCI_ANY_ID, 0, hook) |
| 1622 | #define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \ | 1500 | #define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \ |
| 1623 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ | 1501 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ |
| 1624 | resume_early##vendor##device##hook, vendor, device, \ | 1502 | resume_early##hook, vendor, device, \ |
| 1625 | PCI_ANY_ID, 0, hook) | 1503 | PCI_ANY_ID, 0, hook) |
| 1626 | #define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \ | 1504 | #define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \ |
| 1627 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1505 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
| 1628 | suspend##vendor##device##hook, vendor, device, \ | 1506 | suspend##hook, vendor, device, \ |
| 1629 | PCI_ANY_ID, 0, hook) | 1507 | PCI_ANY_ID, 0, hook) |
| 1630 | 1508 | ||
| 1631 | #ifdef CONFIG_PCI_QUIRKS | 1509 | #ifdef CONFIG_PCI_QUIRKS |
| @@ -1634,7 +1512,7 @@ struct pci_dev *pci_get_dma_source(struct pci_dev *dev); | |||
| 1634 | int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); | 1512 | int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); |
| 1635 | #else | 1513 | #else |
| 1636 | static inline void pci_fixup_device(enum pci_fixup_pass pass, | 1514 | static inline void pci_fixup_device(enum pci_fixup_pass pass, |
| 1637 | struct pci_dev *dev) {} | 1515 | struct pci_dev *dev) { } |
| 1638 | static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev) | 1516 | static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev) |
| 1639 | { | 1517 | { |
| 1640 | return pci_dev_get(dev); | 1518 | return pci_dev_get(dev); |
| @@ -1706,32 +1584,17 @@ int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); | |||
| 1706 | int pci_sriov_get_totalvfs(struct pci_dev *dev); | 1584 | int pci_sriov_get_totalvfs(struct pci_dev *dev); |
| 1707 | #else | 1585 | #else |
| 1708 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) | 1586 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) |
| 1709 | { | 1587 | { return -ENODEV; } |
| 1710 | return -ENODEV; | 1588 | static inline void pci_disable_sriov(struct pci_dev *dev) { } |
| 1711 | } | ||
| 1712 | static inline void pci_disable_sriov(struct pci_dev *dev) | ||
| 1713 | { | ||
| 1714 | } | ||
| 1715 | static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) | 1589 | static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) |
| 1716 | { | 1590 | { return IRQ_NONE; } |
| 1717 | return IRQ_NONE; | 1591 | static inline int pci_num_vf(struct pci_dev *dev) { return 0; } |
| 1718 | } | ||
| 1719 | static inline int pci_num_vf(struct pci_dev *dev) | ||
| 1720 | { | ||
| 1721 | return 0; | ||
| 1722 | } | ||
| 1723 | static inline int pci_vfs_assigned(struct pci_dev *dev) | 1592 | static inline int pci_vfs_assigned(struct pci_dev *dev) |
| 1724 | { | 1593 | { return 0; } |
| 1725 | return 0; | ||
| 1726 | } | ||
| 1727 | static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) | 1594 | static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) |
| 1728 | { | 1595 | { return 0; } |
| 1729 | return 0; | ||
| 1730 | } | ||
| 1731 | static inline int pci_sriov_get_totalvfs(struct pci_dev *dev) | 1596 | static inline int pci_sriov_get_totalvfs(struct pci_dev *dev) |
| 1732 | { | 1597 | { return 0; } |
| 1733 | return 0; | ||
| 1734 | } | ||
| 1735 | #endif | 1598 | #endif |
| 1736 | 1599 | ||
| 1737 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) | 1600 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index a2e2f1d17e16..5f2e559af6b0 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
| @@ -175,8 +175,7 @@ struct hotplug_params { | |||
| 175 | }; | 175 | }; |
| 176 | 176 | ||
| 177 | #ifdef CONFIG_ACPI | 177 | #ifdef CONFIG_ACPI |
| 178 | #include <acpi/acpi.h> | 178 | #include <linux/acpi.h> |
| 179 | #include <acpi/acpi_bus.h> | ||
| 180 | int pci_get_hp_params(struct pci_dev *dev, struct hotplug_params *hpp); | 179 | int pci_get_hp_params(struct pci_dev *dev, struct hotplug_params *hpp); |
| 181 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); | 180 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); |
| 182 | int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); | 181 | int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 57e890abe1f0..a5fc7d01aad6 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
| @@ -69,6 +69,7 @@ | |||
| 69 | __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ | 69 | __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ |
| 70 | extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ | 70 | extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ |
| 71 | __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ | 71 | __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ |
| 72 | extern __PCPU_ATTRS(sec) __typeof__(type) name; \ | ||
| 72 | __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ | 73 | __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ |
| 73 | __typeof__(type) name | 74 | __typeof__(type) name |
| 74 | #else | 75 | #else |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 9e4761caa80c..e3817d2441b6 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef __LINUX_PERCPU_H | 1 | #ifndef __LINUX_PERCPU_H |
| 2 | #define __LINUX_PERCPU_H | 2 | #define __LINUX_PERCPU_H |
| 3 | 3 | ||
| 4 | #include <linux/mmdebug.h> | ||
| 4 | #include <linux/preempt.h> | 5 | #include <linux/preempt.h> |
| 5 | #include <linux/smp.h> | 6 | #include <linux/smp.h> |
| 6 | #include <linux/cpumask.h> | 7 | #include <linux/cpumask.h> |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 2e069d1288df..e56b07f5c9b6 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -320,6 +320,7 @@ struct perf_event { | |||
| 320 | struct list_head migrate_entry; | 320 | struct list_head migrate_entry; |
| 321 | 321 | ||
| 322 | struct hlist_node hlist_entry; | 322 | struct hlist_node hlist_entry; |
| 323 | struct list_head active_entry; | ||
| 323 | int nr_siblings; | 324 | int nr_siblings; |
| 324 | int group_flags; | 325 | int group_flags; |
| 325 | struct perf_event *group_leader; | 326 | struct perf_event *group_leader; |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 48a4dc3cb8cf..565188ca328f 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * include/linux/phy.h | ||
| 3 | * | ||
| 4 | * Framework and drivers for configuring and reading different PHYs | 2 | * Framework and drivers for configuring and reading different PHYs |
| 5 | * Based on code in sungem_phy.c and gianfar_phy.c | 3 | * Based on code in sungem_phy.c and gianfar_phy.c |
| 6 | * | 4 | * |
| @@ -27,18 +25,27 @@ | |||
| 27 | 25 | ||
| 28 | #include <linux/atomic.h> | 26 | #include <linux/atomic.h> |
| 29 | 27 | ||
| 30 | #define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \ | 28 | #define PHY_DEFAULT_FEATURES (SUPPORTED_Autoneg | \ |
| 31 | SUPPORTED_10baseT_Full | \ | ||
| 32 | SUPPORTED_100baseT_Half | \ | ||
| 33 | SUPPORTED_100baseT_Full | \ | ||
| 34 | SUPPORTED_Autoneg | \ | ||
| 35 | SUPPORTED_TP | \ | 29 | SUPPORTED_TP | \ |
| 36 | SUPPORTED_MII) | 30 | SUPPORTED_MII) |
| 37 | 31 | ||
| 38 | #define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \ | 32 | #define PHY_10BT_FEATURES (SUPPORTED_10baseT_Half | \ |
| 39 | SUPPORTED_1000baseT_Half | \ | 33 | SUPPORTED_10baseT_Full) |
| 34 | |||
| 35 | #define PHY_100BT_FEATURES (SUPPORTED_100baseT_Half | \ | ||
| 36 | SUPPORTED_100baseT_Full) | ||
| 37 | |||
| 38 | #define PHY_1000BT_FEATURES (SUPPORTED_1000baseT_Half | \ | ||
| 40 | SUPPORTED_1000baseT_Full) | 39 | SUPPORTED_1000baseT_Full) |
| 41 | 40 | ||
| 41 | #define PHY_BASIC_FEATURES (PHY_10BT_FEATURES | \ | ||
| 42 | PHY_100BT_FEATURES | \ | ||
| 43 | PHY_DEFAULT_FEATURES) | ||
| 44 | |||
| 45 | #define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \ | ||
| 46 | PHY_1000BT_FEATURES) | ||
| 47 | |||
| 48 | |||
| 42 | /* | 49 | /* |
| 43 | * Set phydev->irq to PHY_POLL if interrupts are not supported, | 50 | * Set phydev->irq to PHY_POLL if interrupts are not supported, |
| 44 | * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if | 51 | * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if |
| @@ -66,6 +73,7 @@ typedef enum { | |||
| 66 | PHY_INTERFACE_MODE_RGMII_TXID, | 73 | PHY_INTERFACE_MODE_RGMII_TXID, |
| 67 | PHY_INTERFACE_MODE_RTBI, | 74 | PHY_INTERFACE_MODE_RTBI, |
| 68 | PHY_INTERFACE_MODE_SMII, | 75 | PHY_INTERFACE_MODE_SMII, |
| 76 | PHY_INTERFACE_MODE_XGMII, | ||
| 69 | } phy_interface_t; | 77 | } phy_interface_t; |
| 70 | 78 | ||
| 71 | 79 | ||
| @@ -231,7 +239,7 @@ int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val); | |||
| 231 | * - phy_stop moves to HALTED | 239 | * - phy_stop moves to HALTED |
| 232 | */ | 240 | */ |
| 233 | enum phy_state { | 241 | enum phy_state { |
| 234 | PHY_DOWN=0, | 242 | PHY_DOWN = 0, |
| 235 | PHY_STARTING, | 243 | PHY_STARTING, |
| 236 | PHY_READY, | 244 | PHY_READY, |
| 237 | PHY_PENDING, | 245 | PHY_PENDING, |
| @@ -275,11 +283,9 @@ struct phy_c45_device_ids { | |||
| 275 | * attached_dev: The attached enet driver's device instance ptr | 283 | * attached_dev: The attached enet driver's device instance ptr |
| 276 | * adjust_link: Callback for the enet controller to respond to | 284 | * adjust_link: Callback for the enet controller to respond to |
| 277 | * changes in the link state. | 285 | * changes in the link state. |
| 278 | * adjust_state: Callback for the enet driver to respond to | ||
| 279 | * changes in the state machine. | ||
| 280 | * | 286 | * |
| 281 | * speed, duplex, pause, supported, advertising, and | 287 | * speed, duplex, pause, supported, advertising, lp_advertising, |
| 282 | * autoneg are used like in mii_if_info | 288 | * and autoneg are used like in mii_if_info |
| 283 | * | 289 | * |
| 284 | * interrupts currently only supports enabled or disabled, | 290 | * interrupts currently only supports enabled or disabled, |
| 285 | * but could be changed in the future to support enabling | 291 | * but could be changed in the future to support enabling |
| @@ -331,6 +337,7 @@ struct phy_device { | |||
| 331 | /* See mii.h for more info */ | 337 | /* See mii.h for more info */ |
| 332 | u32 supported; | 338 | u32 supported; |
| 333 | u32 advertising; | 339 | u32 advertising; |
| 340 | u32 lp_advertising; | ||
| 334 | 341 | ||
| 335 | int autoneg; | 342 | int autoneg; |
| 336 | 343 | ||
| @@ -356,8 +363,6 @@ struct phy_device { | |||
| 356 | struct net_device *attached_dev; | 363 | struct net_device *attached_dev; |
| 357 | 364 | ||
| 358 | void (*adjust_link)(struct net_device *dev); | 365 | void (*adjust_link)(struct net_device *dev); |
| 359 | |||
| 360 | void (*adjust_state)(struct net_device *dev); | ||
| 361 | }; | 366 | }; |
| 362 | #define to_phy_device(d) container_of(d, struct phy_device, dev) | 367 | #define to_phy_device(d) container_of(d, struct phy_device, dev) |
| 363 | 368 | ||
| @@ -484,6 +489,24 @@ struct phy_fixup { | |||
| 484 | }; | 489 | }; |
| 485 | 490 | ||
| 486 | /** | 491 | /** |
| 492 | * phy_read_mmd - Convenience function for reading a register | ||
| 493 | * from an MMD on a given PHY. | ||
| 494 | * @phydev: The phy_device struct | ||
| 495 | * @devad: The MMD to read from | ||
| 496 | * @regnum: The register on the MMD to read | ||
| 497 | * | ||
| 498 | * Same rules as for phy_read(); | ||
| 499 | */ | ||
| 500 | static inline int phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum) | ||
| 501 | { | ||
| 502 | if (!phydev->is_c45) | ||
| 503 | return -EOPNOTSUPP; | ||
| 504 | |||
| 505 | return mdiobus_read(phydev->bus, phydev->addr, | ||
| 506 | MII_ADDR_C45 | (devad << 16) | (regnum & 0xffff)); | ||
| 507 | } | ||
| 508 | |||
| 509 | /** | ||
| 487 | * phy_read - Convenience function for reading a given PHY register | 510 | * phy_read - Convenience function for reading a given PHY register |
| 488 | * @phydev: the phy_device struct | 511 | * @phydev: the phy_device struct |
| 489 | * @regnum: register number to read | 512 | * @regnum: register number to read |
| @@ -533,20 +556,46 @@ static inline bool phy_is_internal(struct phy_device *phydev) | |||
| 533 | return phydev->is_internal; | 556 | return phydev->is_internal; |
| 534 | } | 557 | } |
| 535 | 558 | ||
| 559 | /** | ||
| 560 | * phy_write_mmd - Convenience function for writing a register | ||
| 561 | * on an MMD on a given PHY. | ||
| 562 | * @phydev: The phy_device struct | ||
| 563 | * @devad: The MMD to read from | ||
| 564 | * @regnum: The register on the MMD to read | ||
| 565 | * @val: value to write to @regnum | ||
| 566 | * | ||
| 567 | * Same rules as for phy_write(); | ||
| 568 | */ | ||
| 569 | static inline int phy_write_mmd(struct phy_device *phydev, int devad, | ||
| 570 | u32 regnum, u16 val) | ||
| 571 | { | ||
| 572 | if (!phydev->is_c45) | ||
| 573 | return -EOPNOTSUPP; | ||
| 574 | |||
| 575 | regnum = MII_ADDR_C45 | ((devad & 0x1f) << 16) | (regnum & 0xffff); | ||
| 576 | |||
| 577 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); | ||
| 578 | } | ||
| 579 | |||
| 536 | struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, | 580 | struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, |
| 537 | bool is_c45, struct phy_c45_device_ids *c45_ids); | 581 | bool is_c45, |
| 582 | struct phy_c45_device_ids *c45_ids); | ||
| 538 | struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); | 583 | struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); |
| 539 | int phy_device_register(struct phy_device *phy); | 584 | int phy_device_register(struct phy_device *phy); |
| 540 | int phy_init_hw(struct phy_device *phydev); | 585 | int phy_init_hw(struct phy_device *phydev); |
| 541 | struct phy_device * phy_attach(struct net_device *dev, | 586 | int phy_suspend(struct phy_device *phydev); |
| 542 | const char *bus_id, phy_interface_t interface); | 587 | int phy_resume(struct phy_device *phydev); |
| 588 | struct phy_device *phy_attach(struct net_device *dev, const char *bus_id, | ||
| 589 | phy_interface_t interface); | ||
| 543 | struct phy_device *phy_find_first(struct mii_bus *bus); | 590 | struct phy_device *phy_find_first(struct mii_bus *bus); |
| 591 | int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | ||
| 592 | u32 flags, phy_interface_t interface); | ||
| 544 | int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, | 593 | int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, |
| 545 | void (*handler)(struct net_device *), | 594 | void (*handler)(struct net_device *), |
| 546 | phy_interface_t interface); | 595 | phy_interface_t interface); |
| 547 | struct phy_device * phy_connect(struct net_device *dev, const char *bus_id, | 596 | struct phy_device *phy_connect(struct net_device *dev, const char *bus_id, |
| 548 | void (*handler)(struct net_device *), | 597 | void (*handler)(struct net_device *), |
| 549 | phy_interface_t interface); | 598 | phy_interface_t interface); |
| 550 | void phy_disconnect(struct phy_device *phydev); | 599 | void phy_disconnect(struct phy_device *phydev); |
| 551 | void phy_detach(struct phy_device *phydev); | 600 | void phy_detach(struct phy_device *phydev); |
| 552 | void phy_start(struct phy_device *phydev); | 601 | void phy_start(struct phy_device *phydev); |
| @@ -555,7 +604,8 @@ int phy_start_aneg(struct phy_device *phydev); | |||
| 555 | 604 | ||
| 556 | int phy_stop_interrupts(struct phy_device *phydev); | 605 | int phy_stop_interrupts(struct phy_device *phydev); |
| 557 | 606 | ||
| 558 | static inline int phy_read_status(struct phy_device *phydev) { | 607 | static inline int phy_read_status(struct phy_device *phydev) |
| 608 | { | ||
| 559 | return phydev->drv->read_status(phydev); | 609 | return phydev->drv->read_status(phydev); |
| 560 | } | 610 | } |
| 561 | 611 | ||
| @@ -573,31 +623,29 @@ int phy_drivers_register(struct phy_driver *new_driver, int n); | |||
| 573 | void phy_state_machine(struct work_struct *work); | 623 | void phy_state_machine(struct work_struct *work); |
| 574 | void phy_change(struct work_struct *work); | 624 | void phy_change(struct work_struct *work); |
| 575 | void phy_mac_interrupt(struct phy_device *phydev, int new_link); | 625 | void phy_mac_interrupt(struct phy_device *phydev, int new_link); |
| 576 | void phy_start_machine(struct phy_device *phydev, | 626 | void phy_start_machine(struct phy_device *phydev); |
| 577 | void (*handler)(struct net_device *)); | ||
| 578 | void phy_stop_machine(struct phy_device *phydev); | 627 | void phy_stop_machine(struct phy_device *phydev); |
| 579 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); | 628 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); |
| 580 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); | 629 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); |
| 581 | int phy_mii_ioctl(struct phy_device *phydev, | 630 | int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd); |
| 582 | struct ifreq *ifr, int cmd); | ||
| 583 | int phy_start_interrupts(struct phy_device *phydev); | 631 | int phy_start_interrupts(struct phy_device *phydev); |
| 584 | void phy_print_status(struct phy_device *phydev); | 632 | void phy_print_status(struct phy_device *phydev); |
| 585 | void phy_device_free(struct phy_device *phydev); | 633 | void phy_device_free(struct phy_device *phydev); |
| 586 | 634 | ||
| 587 | int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, | 635 | int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, |
| 588 | int (*run)(struct phy_device *)); | 636 | int (*run)(struct phy_device *)); |
| 589 | int phy_register_fixup_for_id(const char *bus_id, | 637 | int phy_register_fixup_for_id(const char *bus_id, |
| 590 | int (*run)(struct phy_device *)); | 638 | int (*run)(struct phy_device *)); |
| 591 | int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask, | 639 | int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask, |
| 592 | int (*run)(struct phy_device *)); | 640 | int (*run)(struct phy_device *)); |
| 593 | int phy_scan_fixups(struct phy_device *phydev); | ||
| 594 | 641 | ||
| 595 | int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable); | 642 | int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable); |
| 596 | int phy_get_eee_err(struct phy_device *phydev); | 643 | int phy_get_eee_err(struct phy_device *phydev); |
| 597 | int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data); | 644 | int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data); |
| 598 | int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data); | 645 | int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data); |
| 599 | int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol); | 646 | int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol); |
| 600 | void phy_ethtool_get_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol); | 647 | void phy_ethtool_get_wol(struct phy_device *phydev, |
| 648 | struct ethtool_wolinfo *wol); | ||
| 601 | 649 | ||
| 602 | int __init mdio_bus_init(void); | 650 | int __init mdio_bus_init(void); |
| 603 | void mdio_bus_exit(void); | 651 | void mdio_bus_exit(void); |
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 6d722695e027..e273e5ac19c9 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h | |||
| @@ -38,6 +38,14 @@ struct phy_ops { | |||
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | * struct phy_attrs - represents phy attributes | ||
| 42 | * @bus_width: Data path width implemented by PHY | ||
| 43 | */ | ||
| 44 | struct phy_attrs { | ||
| 45 | u32 bus_width; | ||
| 46 | }; | ||
| 47 | |||
| 48 | /** | ||
| 41 | * struct phy - represents the phy device | 49 | * struct phy - represents the phy device |
| 42 | * @dev: phy device | 50 | * @dev: phy device |
| 43 | * @id: id of the phy device | 51 | * @id: id of the phy device |
| @@ -46,6 +54,7 @@ struct phy_ops { | |||
| 46 | * @mutex: mutex to protect phy_ops | 54 | * @mutex: mutex to protect phy_ops |
| 47 | * @init_count: used to protect when the PHY is used by multiple consumers | 55 | * @init_count: used to protect when the PHY is used by multiple consumers |
| 48 | * @power_count: used to protect when the PHY is used by multiple consumers | 56 | * @power_count: used to protect when the PHY is used by multiple consumers |
| 57 | * @phy_attrs: used to specify PHY specific attributes | ||
| 49 | */ | 58 | */ |
| 50 | struct phy { | 59 | struct phy { |
| 51 | struct device dev; | 60 | struct device dev; |
| @@ -55,6 +64,7 @@ struct phy { | |||
| 55 | struct mutex mutex; | 64 | struct mutex mutex; |
| 56 | int init_count; | 65 | int init_count; |
| 57 | int power_count; | 66 | int power_count; |
| 67 | struct phy_attrs attrs; | ||
| 58 | }; | 68 | }; |
| 59 | 69 | ||
| 60 | /** | 70 | /** |
| @@ -127,6 +137,14 @@ int phy_init(struct phy *phy); | |||
| 127 | int phy_exit(struct phy *phy); | 137 | int phy_exit(struct phy *phy); |
| 128 | int phy_power_on(struct phy *phy); | 138 | int phy_power_on(struct phy *phy); |
| 129 | int phy_power_off(struct phy *phy); | 139 | int phy_power_off(struct phy *phy); |
| 140 | static inline int phy_get_bus_width(struct phy *phy) | ||
| 141 | { | ||
| 142 | return phy->attrs.bus_width; | ||
| 143 | } | ||
| 144 | static inline void phy_set_bus_width(struct phy *phy, int bus_width) | ||
| 145 | { | ||
| 146 | phy->attrs.bus_width = bus_width; | ||
| 147 | } | ||
| 130 | struct phy *phy_get(struct device *dev, const char *string); | 148 | struct phy *phy_get(struct device *dev, const char *string); |
| 131 | struct phy *devm_phy_get(struct device *dev, const char *string); | 149 | struct phy *devm_phy_get(struct device *dev, const char *string); |
| 132 | void phy_put(struct phy *phy); | 150 | void phy_put(struct phy *phy); |
| @@ -199,6 +217,16 @@ static inline int phy_power_off(struct phy *phy) | |||
| 199 | return -ENOSYS; | 217 | return -ENOSYS; |
| 200 | } | 218 | } |
| 201 | 219 | ||
| 220 | static inline int phy_get_bus_width(struct phy *phy) | ||
| 221 | { | ||
| 222 | return -ENOSYS; | ||
| 223 | } | ||
| 224 | |||
| 225 | static inline void phy_set_bus_width(struct phy *phy, int bus_width) | ||
| 226 | { | ||
| 227 | return; | ||
| 228 | } | ||
| 229 | |||
| 202 | static inline struct phy *phy_get(struct device *dev, const char *string) | 230 | static inline struct phy *phy_get(struct device *dev, const char *string) |
| 203 | { | 231 | { |
| 204 | return ERR_PTR(-ENOSYS); | 232 | return ERR_PTR(-ENOSYS); |
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index fb90ef5eb038..a15f10727eb8 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h | |||
| @@ -61,6 +61,9 @@ | |||
| 61 | * argument is ignored. | 61 | * argument is ignored. |
| 62 | * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current | 62 | * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current |
| 63 | * passed as argument. The argument is in mA. | 63 | * passed as argument. The argument is in mA. |
| 64 | * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not | ||
| 65 | * affect the pin's ability to drive output. 1 enables input, 0 disables | ||
| 66 | * input. | ||
| 64 | * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. | 67 | * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. |
| 65 | * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, | 68 | * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, |
| 66 | * schmitt-trigger mode is disabled. | 69 | * schmitt-trigger mode is disabled. |
| @@ -82,8 +85,10 @@ | |||
| 82 | * operation, if several modes of operation are supported these can be | 85 | * operation, if several modes of operation are supported these can be |
| 83 | * passed in the argument on a custom form, else just use argument 1 | 86 | * passed in the argument on a custom form, else just use argument 1 |
| 84 | * to indicate low power mode, argument 0 turns low power mode off. | 87 | * to indicate low power mode, argument 0 turns low power mode off. |
| 85 | * @PIN_CONFIG_OUTPUT: this will configure the pin in output, use argument | 88 | * @PIN_CONFIG_OUTPUT: this will configure the pin as an output. Use argument |
| 86 | * 1 to indicate high level, argument 0 to indicate low level. | 89 | * 1 to indicate high level, argument 0 to indicate low level. (Please |
| 90 | * see Documentation/pinctrl.txt, section "GPIO mode pitfalls" for a | ||
| 91 | * discussion around this parameter.) | ||
| 87 | * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if | 92 | * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if |
| 88 | * you need to pass in custom configurations to the pin controller, use | 93 | * you need to pass in custom configurations to the pin controller, use |
| 89 | * PIN_CONFIG_END+1 as the base offset. | 94 | * PIN_CONFIG_END+1 as the base offset. |
| @@ -99,6 +104,7 @@ enum pin_config_param { | |||
| 99 | PIN_CONFIG_DRIVE_OPEN_DRAIN, | 104 | PIN_CONFIG_DRIVE_OPEN_DRAIN, |
| 100 | PIN_CONFIG_DRIVE_OPEN_SOURCE, | 105 | PIN_CONFIG_DRIVE_OPEN_SOURCE, |
| 101 | PIN_CONFIG_DRIVE_STRENGTH, | 106 | PIN_CONFIG_DRIVE_STRENGTH, |
| 107 | PIN_CONFIG_INPUT_ENABLE, | ||
| 102 | PIN_CONFIG_INPUT_SCHMITT_ENABLE, | 108 | PIN_CONFIG_INPUT_SCHMITT_ENABLE, |
| 103 | PIN_CONFIG_INPUT_SCHMITT, | 109 | PIN_CONFIG_INPUT_SCHMITT, |
| 104 | PIN_CONFIG_INPUT_DEBOUNCE, | 110 | PIN_CONFIG_INPUT_DEBOUNCE, |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index fefb88663975..cc8e1aff0e28 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
| @@ -32,10 +32,12 @@ struct device_node; | |||
| 32 | * pins, pads or other muxable units in this struct | 32 | * pins, pads or other muxable units in this struct |
| 33 | * @number: unique pin number from the global pin number space | 33 | * @number: unique pin number from the global pin number space |
| 34 | * @name: a name for this pin | 34 | * @name: a name for this pin |
| 35 | * @drv_data: driver-defined per-pin data. pinctrl core does not touch this | ||
| 35 | */ | 36 | */ |
| 36 | struct pinctrl_pin_desc { | 37 | struct pinctrl_pin_desc { |
| 37 | unsigned number; | 38 | unsigned number; |
| 38 | const char *name; | 39 | const char *name; |
| 40 | void *drv_data; | ||
| 39 | }; | 41 | }; |
| 40 | 42 | ||
| 41 | /* Convenience macro to define a single named or anonymous pin descriptor */ | 43 | /* Convenience macro to define a single named or anonymous pin descriptor */ |
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index b8809fef61f5..ab5752692113 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
| @@ -157,6 +157,8 @@ int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *); | |||
| 157 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); | 157 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); |
| 158 | void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); | 158 | void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); |
| 159 | 159 | ||
| 160 | extern const struct pipe_buf_operations nosteal_pipe_buf_ops; | ||
| 161 | |||
| 160 | /* for F_SETPIPE_SZ and F_GETPIPE_SZ */ | 162 | /* for F_SETPIPE_SZ and F_GETPIPE_SZ */ |
| 161 | long pipe_fcntl(struct file *, unsigned int, unsigned long arg); | 163 | long pipe_fcntl(struct file *, unsigned int, unsigned long arg); |
| 162 | struct pipe_inode_info *get_pipe_info(struct file *file); | 164 | struct pipe_inode_info *get_pipe_info(struct file *file); |
diff --git a/include/linux/platform_data/asoc-ti-mcbsp.h b/include/linux/platform_data/asoc-ti-mcbsp.h index c78d90b28b19..3c73c045f8da 100644 --- a/include/linux/platform_data/asoc-ti-mcbsp.h +++ b/include/linux/platform_data/asoc-ti-mcbsp.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/arm/plat-omap/include/mach/mcbsp.h | ||
| 3 | * | ||
| 4 | * Defines for Multi-Channel Buffered Serial Port | 2 | * Defines for Multi-Channel Buffered Serial Port |
| 5 | * | 3 | * |
| 6 | * Copyright (C) 2002 RidgeRun, Inc. | 4 | * Copyright (C) 2002 RidgeRun, Inc. |
| @@ -21,8 +19,8 @@ | |||
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 | * | 20 | * |
| 23 | */ | 21 | */ |
| 24 | #ifndef __ASM_ARCH_OMAP_MCBSP_H | 22 | #ifndef __ASOC_TI_MCBSP_H |
| 25 | #define __ASM_ARCH_OMAP_MCBSP_H | 23 | #define __ASOC_TI_MCBSP_H |
| 26 | 24 | ||
| 27 | #include <linux/spinlock.h> | 25 | #include <linux/spinlock.h> |
| 28 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
diff --git a/include/linux/platform_data/asoc-ux500-msp.h b/include/linux/platform_data/asoc-ux500-msp.h index 9991aea3d577..2f34bb98fe2a 100644 --- a/include/linux/platform_data/asoc-ux500-msp.h +++ b/include/linux/platform_data/asoc-ux500-msp.h | |||
| @@ -10,16 +10,9 @@ | |||
| 10 | 10 | ||
| 11 | #include <linux/platform_data/dma-ste-dma40.h> | 11 | #include <linux/platform_data/dma-ste-dma40.h> |
| 12 | 12 | ||
| 13 | enum msp_i2s_id { | ||
| 14 | MSP_I2S_0 = 0, | ||
| 15 | MSP_I2S_1, | ||
| 16 | MSP_I2S_2, | ||
| 17 | MSP_I2S_3, | ||
| 18 | }; | ||
| 19 | |||
| 20 | /* Platform data structure for a MSP I2S-device */ | 13 | /* Platform data structure for a MSP I2S-device */ |
| 21 | struct msp_i2s_platform_data { | 14 | struct msp_i2s_platform_data { |
| 22 | enum msp_i2s_id id; | 15 | int id; |
| 23 | struct stedma40_chan_cfg *msp_i2s_dma_rx; | 16 | struct stedma40_chan_cfg *msp_i2s_dma_rx; |
| 24 | struct stedma40_chan_cfg *msp_i2s_dma_tx; | 17 | struct stedma40_chan_cfg *msp_i2s_dma_tx; |
| 25 | }; | 18 | }; |
diff --git a/include/linux/platform_data/clocksource-nomadik-mtu.h b/include/linux/platform_data/clocksource-nomadik-mtu.h deleted file mode 100644 index 80088973b734..000000000000 --- a/include/linux/platform_data/clocksource-nomadik-mtu.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #ifndef __PLAT_MTU_H | ||
| 2 | #define __PLAT_MTU_H | ||
| 3 | |||
| 4 | void nmdk_timer_init(void __iomem *base, int irq); | ||
| 5 | void nmdk_clkevt_reset(void); | ||
| 6 | void nmdk_clksrc_reset(void); | ||
| 7 | |||
| 8 | #endif /* __PLAT_MTU_H */ | ||
| 9 | |||
diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h index 689a856b86f9..5245992b0367 100644 --- a/include/linux/platform_data/davinci_asp.h +++ b/include/linux/platform_data/davinci_asp.h | |||
| @@ -92,6 +92,7 @@ enum { | |||
| 92 | MCASP_VERSION_1 = 0, /* DM646x */ | 92 | MCASP_VERSION_1 = 0, /* DM646x */ |
| 93 | MCASP_VERSION_2, /* DA8xx/OMAPL1x */ | 93 | MCASP_VERSION_2, /* DA8xx/OMAPL1x */ |
| 94 | MCASP_VERSION_3, /* TI81xx/AM33xx */ | 94 | MCASP_VERSION_3, /* TI81xx/AM33xx */ |
| 95 | MCASP_VERSION_4, /* DRA7xxx */ | ||
| 95 | }; | 96 | }; |
| 96 | 97 | ||
| 97 | enum mcbsp_clk_input_pin { | 98 | enum mcbsp_clk_input_pin { |
diff --git a/include/linux/platform_data/eth-netx.h b/include/linux/platform_data/eth-netx.h index 88af1ac28ead..a395159725d5 100644 --- a/include/linux/platform_data/eth-netx.h +++ b/include/linux/platform_data/eth-netx.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/arm/mach-netx/include/mach/eth.h | ||
| 3 | * | ||
| 4 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | 2 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix |
| 5 | * | 3 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
| @@ -17,8 +15,8 @@ | |||
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | */ | 16 | */ |
| 19 | 17 | ||
| 20 | #ifndef ASMARM_ARCH_ETH_H | 18 | #ifndef __ETH_NETX_H |
| 21 | #define ASMARM_ARCH_ETH_H | 19 | #define __ETH_NETX_H |
| 22 | 20 | ||
| 23 | struct netxeth_platform_data { | 21 | struct netxeth_platform_data { |
| 24 | unsigned int xcno; /* number of xmac/xpec engine this eth uses */ | 22 | unsigned int xcno; /* number of xmac/xpec engine this eth uses */ |
diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h index 6efd20264585..fbe2f7535741 100644 --- a/include/linux/platform_data/gpio-davinci.h +++ b/include/linux/platform_data/gpio-davinci.h | |||
| @@ -28,13 +28,12 @@ enum davinci_gpio_type { | |||
| 28 | struct davinci_gpio_platform_data { | 28 | struct davinci_gpio_platform_data { |
| 29 | u32 ngpio; | 29 | u32 ngpio; |
| 30 | u32 gpio_unbanked; | 30 | u32 gpio_unbanked; |
| 31 | u32 intc_irq_num; | ||
| 32 | }; | 31 | }; |
| 33 | 32 | ||
| 34 | 33 | ||
| 35 | struct davinci_gpio_controller { | 34 | struct davinci_gpio_controller { |
| 36 | struct gpio_chip chip; | 35 | struct gpio_chip chip; |
| 37 | int irq_base; | 36 | struct irq_domain *irq_domain; |
| 38 | /* Serialize access to GPIO registers */ | 37 | /* Serialize access to GPIO registers */ |
| 39 | spinlock_t lock; | 38 | spinlock_t lock; |
| 40 | void __iomem *regs; | 39 | void __iomem *regs; |
diff --git a/include/linux/platform_data/gpio-lpc32xx.h b/include/linux/platform_data/gpio-lpc32xx.h new file mode 100644 index 000000000000..a544e962a818 --- /dev/null +++ b/include/linux/platform_data/gpio-lpc32xx.h | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | /* | ||
| 2 | * Author: Kevin Wells <kevin.wells@nxp.com> | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 NXP Semiconductors | ||
| 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 __MACH_GPIO_LPC32XX_H | ||
| 18 | #define __MACH_GPIO_LPC32XX_H | ||
| 19 | |||
| 20 | /* | ||
| 21 | * Note! | ||
| 22 | * Muxed GP pins need to be setup to the GP state in the board level | ||
| 23 | * code prior to using this driver. | ||
| 24 | * GPI pins : 28xP3 group | ||
| 25 | * GPO pins : 24xP3 group | ||
| 26 | * GPIO pins: 8xP0 group, 24xP1 group, 13xP2 group, 6xP3 group | ||
| 27 | */ | ||
| 28 | |||
| 29 | #define LPC32XX_GPIO_P0_MAX 8 | ||
| 30 | #define LPC32XX_GPIO_P1_MAX 24 | ||
| 31 | #define LPC32XX_GPIO_P2_MAX 13 | ||
| 32 | #define LPC32XX_GPIO_P3_MAX 6 | ||
| 33 | #define LPC32XX_GPI_P3_MAX 29 | ||
| 34 | #define LPC32XX_GPO_P3_MAX 24 | ||
| 35 | |||
| 36 | #define LPC32XX_GPIO_P0_GRP 0 | ||
| 37 | #define LPC32XX_GPIO_P1_GRP (LPC32XX_GPIO_P0_GRP + LPC32XX_GPIO_P0_MAX) | ||
| 38 | #define LPC32XX_GPIO_P2_GRP (LPC32XX_GPIO_P1_GRP + LPC32XX_GPIO_P1_MAX) | ||
| 39 | #define LPC32XX_GPIO_P3_GRP (LPC32XX_GPIO_P2_GRP + LPC32XX_GPIO_P2_MAX) | ||
| 40 | #define LPC32XX_GPI_P3_GRP (LPC32XX_GPIO_P3_GRP + LPC32XX_GPIO_P3_MAX) | ||
| 41 | #define LPC32XX_GPO_P3_GRP (LPC32XX_GPI_P3_GRP + LPC32XX_GPI_P3_MAX) | ||
| 42 | |||
| 43 | /* | ||
| 44 | * A specific GPIO can be selected with this macro | ||
| 45 | * ie, GPIO_05 can be selected with LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 5) | ||
| 46 | * See the LPC32x0 User's guide for GPIO group numbers | ||
| 47 | */ | ||
| 48 | #define LPC32XX_GPIO(x, y) ((x) + (y)) | ||
| 49 | |||
| 50 | #endif /* __MACH_GPIO_LPC32XX_H */ | ||
diff --git a/include/linux/platform_data/hwmon-s3c.h b/include/linux/platform_data/hwmon-s3c.h index c167e4429bc7..0e3cce130fe2 100644 --- a/include/linux/platform_data/hwmon-s3c.h +++ b/include/linux/platform_data/hwmon-s3c.h | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | /* linux/arch/arm/plat-s3c/include/plat/hwmon.h | 1 | /* |
| 2 | * | ||
| 3 | * Copyright 2005 Simtec Electronics | 2 | * Copyright 2005 Simtec Electronics |
| 4 | * Ben Dooks <ben@simtec.co.uk> | 3 | * Ben Dooks <ben@simtec.co.uk> |
| 5 | * http://armlinux.simtec.co.uk/ | 4 | * http://armlinux.simtec.co.uk/ |
| @@ -11,8 +10,8 @@ | |||
| 11 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
| 12 | */ | 11 | */ |
| 13 | 12 | ||
| 14 | #ifndef __ASM_ARCH_ADC_HWMON_H | 13 | #ifndef __HWMON_S3C_H__ |
| 15 | #define __ASM_ARCH_ADC_HWMON_H __FILE__ | 14 | #define __HWMON_S3C_H__ |
| 16 | 15 | ||
| 17 | /** | 16 | /** |
| 18 | * s3c_hwmon_chcfg - channel configuration | 17 | * s3c_hwmon_chcfg - channel configuration |
| @@ -47,5 +46,4 @@ struct s3c_hwmon_pdata { | |||
| 47 | */ | 46 | */ |
| 48 | extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd); | 47 | extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd); |
| 49 | 48 | ||
| 50 | #endif /* __ASM_ARCH_ADC_HWMON_H */ | 49 | #endif /* __HWMON_S3C_H__ */ |
| 51 | |||
diff --git a/include/linux/platform_data/i2c-nomadik.h b/include/linux/platform_data/i2c-nomadik.h deleted file mode 100644 index 3a8be9cdc95c..000000000000 --- a/include/linux/platform_data/i2c-nomadik.h +++ /dev/null | |||
| @@ -1,39 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2009 ST-Ericsson | ||
| 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 | #ifndef __PDATA_I2C_NOMADIK_H | ||
| 9 | #define __PDATA_I2C_NOMADIK_H | ||
| 10 | |||
| 11 | enum i2c_freq_mode { | ||
| 12 | I2C_FREQ_MODE_STANDARD, /* up to 100 Kb/s */ | ||
| 13 | I2C_FREQ_MODE_FAST, /* up to 400 Kb/s */ | ||
| 14 | I2C_FREQ_MODE_HIGH_SPEED, /* up to 3.4 Mb/s */ | ||
| 15 | I2C_FREQ_MODE_FAST_PLUS, /* up to 1 Mb/s */ | ||
| 16 | }; | ||
| 17 | |||
| 18 | /** | ||
| 19 | * struct nmk_i2c_controller - client specific controller configuration | ||
| 20 | * @clk_freq: clock frequency for the operation mode | ||
| 21 | * @slsu: Slave data setup time in ns. | ||
| 22 | * The needed setup time for three modes of operation | ||
| 23 | * are 250ns, 100ns and 10ns respectively thus leading | ||
| 24 | * to the values of 14, 6, 2 for a 48 MHz i2c clk | ||
| 25 | * @tft: Tx FIFO Threshold in bytes | ||
| 26 | * @rft: Rx FIFO Threshold in bytes | ||
| 27 | * @timeout Slave response timeout(ms) | ||
| 28 | * @sm: speed mode | ||
| 29 | */ | ||
| 30 | struct nmk_i2c_controller { | ||
| 31 | u32 clk_freq; | ||
| 32 | unsigned short slsu; | ||
| 33 | unsigned char tft; | ||
| 34 | unsigned char rft; | ||
| 35 | int timeout; | ||
| 36 | enum i2c_freq_mode sm; | ||
| 37 | }; | ||
| 38 | |||
| 39 | #endif /* __PDATA_I2C_NOMADIK_H */ | ||
diff --git a/include/linux/platform_data/keypad-ep93xx.h b/include/linux/platform_data/keypad-ep93xx.h index 1e2f4e97f428..adccee25b162 100644 --- a/include/linux/platform_data/keypad-ep93xx.h +++ b/include/linux/platform_data/keypad-ep93xx.h | |||
| @@ -1,9 +1,5 @@ | |||
| 1 | /* | 1 | #ifndef __KEYPAD_EP93XX_H |
| 2 | * arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h | 2 | #define __KEYPAD_EP93XX_H |
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef __ASM_ARCH_EP93XX_KEYPAD_H | ||
| 6 | #define __ASM_ARCH_EP93XX_KEYPAD_H | ||
| 7 | 3 | ||
| 8 | struct matrix_keymap_data; | 4 | struct matrix_keymap_data; |
| 9 | 5 | ||
| @@ -32,4 +28,4 @@ struct ep93xx_keypad_platform_data { | |||
| 32 | #define EP93XX_MATRIX_ROWS (8) | 28 | #define EP93XX_MATRIX_ROWS (8) |
| 33 | #define EP93XX_MATRIX_COLS (8) | 29 | #define EP93XX_MATRIX_COLS (8) |
| 34 | 30 | ||
| 35 | #endif /* __ASM_ARCH_EP93XX_KEYPAD_H */ | 31 | #endif /* __KEYPAD_EP93XX_H */ |
diff --git a/include/linux/platform_data/keypad-omap.h b/include/linux/platform_data/keypad-omap.h index a6b21eddb212..c3a3abae98f0 100644 --- a/include/linux/platform_data/keypad-omap.h +++ b/include/linux/platform_data/keypad-omap.h | |||
| @@ -1,14 +1,12 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/arm/plat-omap/include/mach/keypad.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com> | 2 | * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com> |
| 5 | * | 3 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | 4 | * 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 | 5 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
| 9 | */ | 7 | */ |
| 10 | #ifndef ASMARM_ARCH_KEYPAD_H | 8 | #ifndef __KEYPAD_OMAP_H |
| 11 | #define ASMARM_ARCH_KEYPAD_H | 9 | #define __KEYPAD_OMAP_H |
| 12 | 10 | ||
| 13 | #ifndef CONFIG_ARCH_OMAP1 | 11 | #ifndef CONFIG_ARCH_OMAP1 |
| 14 | #warning Please update the board to use matrix-keypad driver | 12 | #warning Please update the board to use matrix-keypad driver |
diff --git a/include/linux/platform_data/max197.h b/include/linux/platform_data/max197.h index e2a41dd7690c..8da8f94ee15c 100644 --- a/include/linux/platform_data/max197.h +++ b/include/linux/platform_data/max197.h | |||
| @@ -11,6 +11,9 @@ | |||
| 11 | * For further information, see the Documentation/hwmon/max197 file. | 11 | * For further information, see the Documentation/hwmon/max197 file. |
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #ifndef _PDATA_MAX197_H | ||
| 15 | #define _PDATA_MAX197_H | ||
| 16 | |||
| 14 | /** | 17 | /** |
| 15 | * struct max197_platform_data - MAX197 connectivity info | 18 | * struct max197_platform_data - MAX197 connectivity info |
| 16 | * @convert: Function used to start a conversion with control byte ctrl. | 19 | * @convert: Function used to start a conversion with control byte ctrl. |
| @@ -19,3 +22,5 @@ | |||
| 19 | struct max197_platform_data { | 22 | struct max197_platform_data { |
| 20 | int (*convert)(u8 ctrl); | 23 | int (*convert)(u8 ctrl); |
| 21 | }; | 24 | }; |
| 25 | |||
| 26 | #endif /* _PDATA_MAX197_H */ | ||
diff --git a/include/linux/platform_data/mfd-mcp-sa11x0.h b/include/linux/platform_data/mfd-mcp-sa11x0.h index 4b2860ae3828..747cd6baf711 100644 --- a/include/linux/platform_data/mfd-mcp-sa11x0.h +++ b/include/linux/platform_data/mfd-mcp-sa11x0.h | |||
| @@ -1,14 +1,12 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/arm/mach-sa1100/include/mach/mcp.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005 Russell King. | 2 | * Copyright (C) 2005 Russell King. |
| 5 | * | 3 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | 4 | * 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 | 5 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
| 9 | */ | 7 | */ |
| 10 | #ifndef __ASM_ARM_ARCH_MCP_H | 8 | #ifndef __MFD_MCP_SA11X0_H |
| 11 | #define __ASM_ARM_ARCH_MCP_H | 9 | #define __MFD_MCP_SA11X0_H |
| 12 | 10 | ||
| 13 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 14 | 12 | ||
diff --git a/include/linux/platform_data/pinctrl-nomadik.h b/include/linux/platform_data/pinctrl-nomadik.h deleted file mode 100644 index abf5bed84df3..000000000000 --- a/include/linux/platform_data/pinctrl-nomadik.h +++ /dev/null | |||
| @@ -1,242 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Structures and registers for GPIO access in the Nomadik SoC | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008 STMicroelectronics | ||
| 5 | * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com> | ||
| 6 | * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it> | ||
| 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 __PLAT_NOMADIK_GPIO | ||
| 14 | #define __PLAT_NOMADIK_GPIO | ||
| 15 | |||
| 16 | /* | ||
| 17 | * pin configurations are represented by 32-bit integers: | ||
| 18 | * | ||
| 19 | * bit 0.. 8 - Pin Number (512 Pins Maximum) | ||
| 20 | * bit 9..10 - Alternate Function Selection | ||
| 21 | * bit 11..12 - Pull up/down state | ||
| 22 | * bit 13 - Sleep mode behaviour | ||
| 23 | * bit 14 - Direction | ||
| 24 | * bit 15 - Value (if output) | ||
| 25 | * bit 16..18 - SLPM pull up/down state | ||
| 26 | * bit 19..20 - SLPM direction | ||
| 27 | * bit 21..22 - SLPM Value (if output) | ||
| 28 | * bit 23..25 - PDIS value (if input) | ||
| 29 | * bit 26 - Gpio mode | ||
| 30 | * bit 27 - Sleep mode | ||
| 31 | * | ||
| 32 | * to facilitate the definition, the following macros are provided | ||
| 33 | * | ||
| 34 | * PIN_CFG_DEFAULT - default config (0): | ||
| 35 | * pull up/down = disabled | ||
| 36 | * sleep mode = input/wakeup | ||
| 37 | * direction = input | ||
| 38 | * value = low | ||
| 39 | * SLPM direction = same as normal | ||
| 40 | * SLPM pull = same as normal | ||
| 41 | * SLPM value = same as normal | ||
| 42 | * | ||
| 43 | * PIN_CFG - default config with alternate function | ||
| 44 | */ | ||
| 45 | |||
| 46 | typedef unsigned long pin_cfg_t; | ||
| 47 | |||
| 48 | #define PIN_NUM_MASK 0x1ff | ||
| 49 | #define PIN_NUM(x) ((x) & PIN_NUM_MASK) | ||
| 50 | |||
| 51 | #define PIN_ALT_SHIFT 9 | ||
| 52 | #define PIN_ALT_MASK (0x3 << PIN_ALT_SHIFT) | ||
| 53 | #define PIN_ALT(x) (((x) & PIN_ALT_MASK) >> PIN_ALT_SHIFT) | ||
| 54 | #define PIN_GPIO (NMK_GPIO_ALT_GPIO << PIN_ALT_SHIFT) | ||
| 55 | #define PIN_ALT_A (NMK_GPIO_ALT_A << PIN_ALT_SHIFT) | ||
| 56 | #define PIN_ALT_B (NMK_GPIO_ALT_B << PIN_ALT_SHIFT) | ||
| 57 | #define PIN_ALT_C (NMK_GPIO_ALT_C << PIN_ALT_SHIFT) | ||
| 58 | |||
| 59 | #define PIN_PULL_SHIFT 11 | ||
| 60 | #define PIN_PULL_MASK (0x3 << PIN_PULL_SHIFT) | ||
| 61 | #define PIN_PULL(x) (((x) & PIN_PULL_MASK) >> PIN_PULL_SHIFT) | ||
| 62 | #define PIN_PULL_NONE (NMK_GPIO_PULL_NONE << PIN_PULL_SHIFT) | ||
| 63 | #define PIN_PULL_UP (NMK_GPIO_PULL_UP << PIN_PULL_SHIFT) | ||
| 64 | #define PIN_PULL_DOWN (NMK_GPIO_PULL_DOWN << PIN_PULL_SHIFT) | ||
| 65 | |||
| 66 | #define PIN_SLPM_SHIFT 13 | ||
| 67 | #define PIN_SLPM_MASK (0x1 << PIN_SLPM_SHIFT) | ||
| 68 | #define PIN_SLPM(x) (((x) & PIN_SLPM_MASK) >> PIN_SLPM_SHIFT) | ||
| 69 | #define PIN_SLPM_MAKE_INPUT (NMK_GPIO_SLPM_INPUT << PIN_SLPM_SHIFT) | ||
| 70 | #define PIN_SLPM_NOCHANGE (NMK_GPIO_SLPM_NOCHANGE << PIN_SLPM_SHIFT) | ||
| 71 | /* These two replace the above in DB8500v2+ */ | ||
| 72 | #define PIN_SLPM_WAKEUP_ENABLE (NMK_GPIO_SLPM_WAKEUP_ENABLE << PIN_SLPM_SHIFT) | ||
| 73 | #define PIN_SLPM_WAKEUP_DISABLE (NMK_GPIO_SLPM_WAKEUP_DISABLE << PIN_SLPM_SHIFT) | ||
| 74 | #define PIN_SLPM_USE_MUX_SETTINGS_IN_SLEEP PIN_SLPM_WAKEUP_DISABLE | ||
| 75 | |||
| 76 | #define PIN_SLPM_GPIO PIN_SLPM_WAKEUP_ENABLE /* In SLPM, pin is a gpio */ | ||
| 77 | #define PIN_SLPM_ALTFUNC PIN_SLPM_WAKEUP_DISABLE /* In SLPM, pin is altfunc */ | ||
| 78 | |||
| 79 | #define PIN_DIR_SHIFT 14 | ||
| 80 | #define PIN_DIR_MASK (0x1 << PIN_DIR_SHIFT) | ||
| 81 | #define PIN_DIR(x) (((x) & PIN_DIR_MASK) >> PIN_DIR_SHIFT) | ||
| 82 | #define PIN_DIR_INPUT (0 << PIN_DIR_SHIFT) | ||
| 83 | #define PIN_DIR_OUTPUT (1 << PIN_DIR_SHIFT) | ||
| 84 | |||
| 85 | #define PIN_VAL_SHIFT 15 | ||
| 86 | #define PIN_VAL_MASK (0x1 << PIN_VAL_SHIFT) | ||
| 87 | #define PIN_VAL(x) (((x) & PIN_VAL_MASK) >> PIN_VAL_SHIFT) | ||
| 88 | #define PIN_VAL_LOW (0 << PIN_VAL_SHIFT) | ||
| 89 | #define PIN_VAL_HIGH (1 << PIN_VAL_SHIFT) | ||
| 90 | |||
| 91 | #define PIN_SLPM_PULL_SHIFT 16 | ||
| 92 | #define PIN_SLPM_PULL_MASK (0x7 << PIN_SLPM_PULL_SHIFT) | ||
| 93 | #define PIN_SLPM_PULL(x) \ | ||
| 94 | (((x) & PIN_SLPM_PULL_MASK) >> PIN_SLPM_PULL_SHIFT) | ||
| 95 | #define PIN_SLPM_PULL_NONE \ | ||
| 96 | ((1 + NMK_GPIO_PULL_NONE) << PIN_SLPM_PULL_SHIFT) | ||
| 97 | #define PIN_SLPM_PULL_UP \ | ||
| 98 | ((1 + NMK_GPIO_PULL_UP) << PIN_SLPM_PULL_SHIFT) | ||
| 99 | #define PIN_SLPM_PULL_DOWN \ | ||
| 100 | ((1 + NMK_GPIO_PULL_DOWN) << PIN_SLPM_PULL_SHIFT) | ||
| 101 | |||
| 102 | #define PIN_SLPM_DIR_SHIFT 19 | ||
| 103 | #define PIN_SLPM_DIR_MASK (0x3 << PIN_SLPM_DIR_SHIFT) | ||
| 104 | #define PIN_SLPM_DIR(x) \ | ||
| 105 | (((x) & PIN_SLPM_DIR_MASK) >> PIN_SLPM_DIR_SHIFT) | ||
| 106 | #define PIN_SLPM_DIR_INPUT ((1 + 0) << PIN_SLPM_DIR_SHIFT) | ||
| 107 | #define PIN_SLPM_DIR_OUTPUT ((1 + 1) << PIN_SLPM_DIR_SHIFT) | ||
| 108 | |||
| 109 | #define PIN_SLPM_VAL_SHIFT 21 | ||
| 110 | #define PIN_SLPM_VAL_MASK (0x3 << PIN_SLPM_VAL_SHIFT) | ||
| 111 | #define PIN_SLPM_VAL(x) \ | ||
| 112 | (((x) & PIN_SLPM_VAL_MASK) >> PIN_SLPM_VAL_SHIFT) | ||
| 113 | #define PIN_SLPM_VAL_LOW ((1 + 0) << PIN_SLPM_VAL_SHIFT) | ||
| 114 | #define PIN_SLPM_VAL_HIGH ((1 + 1) << PIN_SLPM_VAL_SHIFT) | ||
| 115 | |||
| 116 | #define PIN_SLPM_PDIS_SHIFT 23 | ||
| 117 | #define PIN_SLPM_PDIS_MASK (0x3 << PIN_SLPM_PDIS_SHIFT) | ||
| 118 | #define PIN_SLPM_PDIS(x) \ | ||
| 119 | (((x) & PIN_SLPM_PDIS_MASK) >> PIN_SLPM_PDIS_SHIFT) | ||
| 120 | #define PIN_SLPM_PDIS_NO_CHANGE (0 << PIN_SLPM_PDIS_SHIFT) | ||
| 121 | #define PIN_SLPM_PDIS_DISABLED (1 << PIN_SLPM_PDIS_SHIFT) | ||
| 122 | #define PIN_SLPM_PDIS_ENABLED (2 << PIN_SLPM_PDIS_SHIFT) | ||
| 123 | |||
| 124 | #define PIN_LOWEMI_SHIFT 25 | ||
| 125 | #define PIN_LOWEMI_MASK (0x1 << PIN_LOWEMI_SHIFT) | ||
| 126 | #define PIN_LOWEMI(x) (((x) & PIN_LOWEMI_MASK) >> PIN_LOWEMI_SHIFT) | ||
| 127 | #define PIN_LOWEMI_DISABLED (0 << PIN_LOWEMI_SHIFT) | ||
| 128 | #define PIN_LOWEMI_ENABLED (1 << PIN_LOWEMI_SHIFT) | ||
| 129 | |||
| 130 | #define PIN_GPIOMODE_SHIFT 26 | ||
| 131 | #define PIN_GPIOMODE_MASK (0x1 << PIN_GPIOMODE_SHIFT) | ||
| 132 | #define PIN_GPIOMODE(x) (((x) & PIN_GPIOMODE_MASK) >> PIN_GPIOMODE_SHIFT) | ||
| 133 | #define PIN_GPIOMODE_DISABLED (0 << PIN_GPIOMODE_SHIFT) | ||
| 134 | #define PIN_GPIOMODE_ENABLED (1 << PIN_GPIOMODE_SHIFT) | ||
| 135 | |||
| 136 | #define PIN_SLEEPMODE_SHIFT 27 | ||
| 137 | #define PIN_SLEEPMODE_MASK (0x1 << PIN_SLEEPMODE_SHIFT) | ||
| 138 | #define PIN_SLEEPMODE(x) (((x) & PIN_SLEEPMODE_MASK) >> PIN_SLEEPMODE_SHIFT) | ||
| 139 | #define PIN_SLEEPMODE_DISABLED (0 << PIN_SLEEPMODE_SHIFT) | ||
| 140 | #define PIN_SLEEPMODE_ENABLED (1 << PIN_SLEEPMODE_SHIFT) | ||
| 141 | |||
| 142 | |||
| 143 | /* Shortcuts. Use these instead of separate DIR, PULL, and VAL. */ | ||
| 144 | #define PIN_INPUT_PULLDOWN (PIN_DIR_INPUT | PIN_PULL_DOWN) | ||
| 145 | #define PIN_INPUT_PULLUP (PIN_DIR_INPUT | PIN_PULL_UP) | ||
| 146 | #define PIN_INPUT_NOPULL (PIN_DIR_INPUT | PIN_PULL_NONE) | ||
| 147 | #define PIN_OUTPUT_LOW (PIN_DIR_OUTPUT | PIN_VAL_LOW) | ||
| 148 | #define PIN_OUTPUT_HIGH (PIN_DIR_OUTPUT | PIN_VAL_HIGH) | ||
| 149 | |||
| 150 | #define PIN_SLPM_INPUT_PULLDOWN (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_DOWN) | ||
| 151 | #define PIN_SLPM_INPUT_PULLUP (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_UP) | ||
| 152 | #define PIN_SLPM_INPUT_NOPULL (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_NONE) | ||
| 153 | #define PIN_SLPM_OUTPUT_LOW (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_LOW) | ||
| 154 | #define PIN_SLPM_OUTPUT_HIGH (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_HIGH) | ||
| 155 | |||
| 156 | #define PIN_CFG_DEFAULT (0) | ||
| 157 | |||
| 158 | #define PIN_CFG(num, alt) \ | ||
| 159 | (PIN_CFG_DEFAULT |\ | ||
| 160 | (PIN_NUM(num) | PIN_##alt)) | ||
| 161 | |||
| 162 | #define PIN_CFG_INPUT(num, alt, pull) \ | ||
| 163 | (PIN_CFG_DEFAULT |\ | ||
| 164 | (PIN_NUM(num) | PIN_##alt | PIN_INPUT_##pull)) | ||
| 165 | |||
| 166 | #define PIN_CFG_OUTPUT(num, alt, val) \ | ||
| 167 | (PIN_CFG_DEFAULT |\ | ||
| 168 | (PIN_NUM(num) | PIN_##alt | PIN_OUTPUT_##val)) | ||
| 169 | |||
| 170 | /* | ||
| 171 | * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving | ||
| 172 | * the "gpio" namespace for generic and cross-machine functions | ||
| 173 | */ | ||
| 174 | |||
| 175 | #define GPIO_BLOCK_SHIFT 5 | ||
| 176 | #define NMK_GPIO_PER_CHIP (1 << GPIO_BLOCK_SHIFT) | ||
| 177 | |||
| 178 | /* Register in the logic block */ | ||
| 179 | #define NMK_GPIO_DAT 0x00 | ||
| 180 | #define NMK_GPIO_DATS 0x04 | ||
| 181 | #define NMK_GPIO_DATC 0x08 | ||
| 182 | #define NMK_GPIO_PDIS 0x0c | ||
| 183 | #define NMK_GPIO_DIR 0x10 | ||
| 184 | #define NMK_GPIO_DIRS 0x14 | ||
| 185 | #define NMK_GPIO_DIRC 0x18 | ||
| 186 | #define NMK_GPIO_SLPC 0x1c | ||
| 187 | #define NMK_GPIO_AFSLA 0x20 | ||
| 188 | #define NMK_GPIO_AFSLB 0x24 | ||
| 189 | #define NMK_GPIO_LOWEMI 0x28 | ||
| 190 | |||
| 191 | #define NMK_GPIO_RIMSC 0x40 | ||
| 192 | #define NMK_GPIO_FIMSC 0x44 | ||
| 193 | #define NMK_GPIO_IS 0x48 | ||
| 194 | #define NMK_GPIO_IC 0x4c | ||
| 195 | #define NMK_GPIO_RWIMSC 0x50 | ||
| 196 | #define NMK_GPIO_FWIMSC 0x54 | ||
| 197 | #define NMK_GPIO_WKS 0x58 | ||
| 198 | /* These appear in DB8540 and later ASICs */ | ||
| 199 | #define NMK_GPIO_EDGELEVEL 0x5C | ||
| 200 | #define NMK_GPIO_LEVEL 0x60 | ||
| 201 | |||
| 202 | /* Alternate functions: function C is set in hw by setting both A and B */ | ||
| 203 | #define NMK_GPIO_ALT_GPIO 0 | ||
| 204 | #define NMK_GPIO_ALT_A 1 | ||
| 205 | #define NMK_GPIO_ALT_B 2 | ||
| 206 | #define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B) | ||
| 207 | |||
| 208 | #define NMK_GPIO_ALT_CX_SHIFT 2 | ||
| 209 | #define NMK_GPIO_ALT_C1 ((1<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) | ||
| 210 | #define NMK_GPIO_ALT_C2 ((2<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) | ||
| 211 | #define NMK_GPIO_ALT_C3 ((3<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) | ||
| 212 | #define NMK_GPIO_ALT_C4 ((4<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) | ||
| 213 | |||
| 214 | /* Pull up/down values */ | ||
| 215 | enum nmk_gpio_pull { | ||
| 216 | NMK_GPIO_PULL_NONE, | ||
| 217 | NMK_GPIO_PULL_UP, | ||
| 218 | NMK_GPIO_PULL_DOWN, | ||
| 219 | }; | ||
| 220 | |||
| 221 | /* Sleep mode */ | ||
| 222 | enum nmk_gpio_slpm { | ||
| 223 | NMK_GPIO_SLPM_INPUT, | ||
| 224 | NMK_GPIO_SLPM_WAKEUP_ENABLE = NMK_GPIO_SLPM_INPUT, | ||
| 225 | NMK_GPIO_SLPM_NOCHANGE, | ||
| 226 | NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE, | ||
| 227 | }; | ||
| 228 | |||
| 229 | /* | ||
| 230 | * Platform data to register a block: only the initial gpio/irq number. | ||
| 231 | */ | ||
| 232 | struct nmk_gpio_platform_data { | ||
| 233 | char *name; | ||
| 234 | int first_gpio; | ||
| 235 | int first_irq; | ||
| 236 | int num_gpio; | ||
| 237 | u32 (*get_secondary_status)(unsigned int bank); | ||
| 238 | void (*set_ioforce)(bool enable); | ||
| 239 | bool supports_sleepmode; | ||
| 240 | }; | ||
| 241 | |||
| 242 | #endif /* __PLAT_NOMADIK_GPIO */ | ||
diff --git a/include/linux/platform_data/pn544.h b/include/linux/platform_data/pn544.h index 713bfd703342..5ce1ab983f44 100644 --- a/include/linux/platform_data/pn544.h +++ b/include/linux/platform_data/pn544.h | |||
| @@ -16,8 +16,7 @@ | |||
| 16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
| 17 | * | 17 | * |
| 18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software | 19 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 21 | */ | 20 | */ |
| 22 | 21 | ||
| 23 | #ifndef _PN544_H_ | 22 | #ifndef _PN544_H_ |
diff --git a/include/linux/platform_data/sht15.h b/include/linux/platform_data/sht15.h index 33e0fd27225e..12289c1e9413 100644 --- a/include/linux/platform_data/sht15.h +++ b/include/linux/platform_data/sht15.h | |||
| @@ -12,6 +12,9 @@ | |||
| 12 | * For further information, see the Documentation/hwmon/sht15 file. | 12 | * For further information, see the Documentation/hwmon/sht15 file. |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #ifndef _PDATA_SHT15_H | ||
| 16 | #define _PDATA_SHT15_H | ||
| 17 | |||
| 15 | /** | 18 | /** |
| 16 | * struct sht15_platform_data - sht15 connectivity info | 19 | * struct sht15_platform_data - sht15 connectivity info |
| 17 | * @gpio_data: no. of gpio to which bidirectional data line is | 20 | * @gpio_data: no. of gpio to which bidirectional data line is |
| @@ -31,3 +34,5 @@ struct sht15_platform_data { | |||
| 31 | bool no_otp_reload; | 34 | bool no_otp_reload; |
| 32 | bool low_resolution; | 35 | bool low_resolution; |
| 33 | }; | 36 | }; |
| 37 | |||
| 38 | #endif /* _PDATA_SHT15_H */ | ||
diff --git a/include/linux/platform_data/spi-nuc900.h b/include/linux/platform_data/spi-nuc900.h index 2c4e0c128501..4b3f46832e19 100644 --- a/include/linux/platform_data/spi-nuc900.h +++ b/include/linux/platform_data/spi-nuc900.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/arm/mach-w90x900/include/mach/nuc900_spi.h | ||
| 3 | * | ||
| 4 | * Copyright (c) 2009 Nuvoton technology corporation. | 2 | * Copyright (c) 2009 Nuvoton technology corporation. |
| 5 | * | 3 | * |
| 6 | * Wan ZongShun <mcuos.com@gmail.com> | 4 | * Wan ZongShun <mcuos.com@gmail.com> |
| @@ -11,8 +9,8 @@ | |||
| 11 | * | 9 | * |
| 12 | */ | 10 | */ |
| 13 | 11 | ||
| 14 | #ifndef __ASM_ARCH_SPI_H | 12 | #ifndef __SPI_NUC900_H |
| 15 | #define __ASM_ARCH_SPI_H | 13 | #define __SPI_NUC900_H |
| 16 | 14 | ||
| 17 | extern void mfp_set_groupg(struct device *dev, const char *subname); | 15 | extern void mfp_set_groupg(struct device *dev, const char *subname); |
| 18 | 16 | ||
| @@ -32,4 +30,4 @@ struct nuc900_spi_chip { | |||
| 32 | unsigned char bits_per_word; | 30 | unsigned char bits_per_word; |
| 33 | }; | 31 | }; |
| 34 | 32 | ||
| 35 | #endif /* __ASM_ARCH_SPI_H */ | 33 | #endif /* __SPI_NUC900_H */ |
diff --git a/include/linux/platform_data/usb-ehci-orion.h b/include/linux/platform_data/usb-ehci-orion.h index 6fc78e430420..52b0acb35fd7 100644 --- a/include/linux/platform_data/usb-ehci-orion.h +++ b/include/linux/platform_data/usb-ehci-orion.h | |||
| @@ -1,13 +1,11 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/arm/plat-orion/include/plat/ehci-orion.h | ||
| 3 | * | ||
| 4 | * This file is licensed under the terms of the GNU General Public | 2 | * This file is licensed under the terms of the GNU General Public |
| 5 | * License version 2. This program is licensed "as is" without any | 3 | * License version 2. This program is licensed "as is" without any |
| 6 | * warranty of any kind, whether express or implied. | 4 | * warranty of any kind, whether express or implied. |
| 7 | */ | 5 | */ |
| 8 | 6 | ||
| 9 | #ifndef __PLAT_EHCI_ORION_H | 7 | #ifndef __USB_EHCI_ORION_H |
| 10 | #define __PLAT_EHCI_ORION_H | 8 | #define __USB_EHCI_ORION_H |
| 11 | 9 | ||
| 12 | #include <linux/mbus.h> | 10 | #include <linux/mbus.h> |
| 13 | 11 | ||
diff --git a/include/linux/platform_data/usb-omap1.h b/include/linux/platform_data/usb-omap1.h new file mode 100644 index 000000000000..43b5ce139c37 --- /dev/null +++ b/include/linux/platform_data/usb-omap1.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /* | ||
| 2 | * Platform data for OMAP1 USB | ||
| 3 | * | ||
| 4 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 5 | * License. See the file "COPYING" in the main directory of this archive for | ||
| 6 | * more details. | ||
| 7 | */ | ||
| 8 | #ifndef __LINUX_USB_OMAP1_H | ||
| 9 | #define __LINUX_USB_OMAP1_H | ||
| 10 | |||
| 11 | #include <linux/platform_device.h> | ||
| 12 | |||
| 13 | struct omap_usb_config { | ||
| 14 | /* Configure drivers according to the connectors on your board: | ||
| 15 | * - "A" connector (rectagular) | ||
| 16 | * ... for host/OHCI use, set "register_host". | ||
| 17 | * - "B" connector (squarish) or "Mini-B" | ||
| 18 | * ... for device/gadget use, set "register_dev". | ||
| 19 | * - "Mini-AB" connector (very similar to Mini-B) | ||
| 20 | * ... for OTG use as device OR host, initialize "otg" | ||
| 21 | */ | ||
| 22 | unsigned register_host:1; | ||
| 23 | unsigned register_dev:1; | ||
| 24 | u8 otg; /* port number, 1-based: usb1 == 2 */ | ||
| 25 | |||
| 26 | const char *extcon; /* extcon device for OTG */ | ||
| 27 | |||
| 28 | u8 hmc_mode; | ||
| 29 | |||
| 30 | /* implicitly true if otg: host supports remote wakeup? */ | ||
| 31 | u8 rwc; | ||
| 32 | |||
| 33 | /* signaling pins used to talk to transceiver on usbN: | ||
| 34 | * 0 == usbN unused | ||
| 35 | * 2 == usb0-only, using internal transceiver | ||
| 36 | * 3 == 3 wire bidirectional | ||
| 37 | * 4 == 4 wire bidirectional | ||
| 38 | * 6 == 6 wire unidirectional (or TLL) | ||
| 39 | */ | ||
| 40 | u8 pins[3]; | ||
| 41 | |||
| 42 | struct platform_device *udc_device; | ||
| 43 | struct platform_device *ohci_device; | ||
| 44 | struct platform_device *otg_device; | ||
| 45 | |||
| 46 | u32 (*usb0_init)(unsigned nwires, unsigned is_device); | ||
| 47 | u32 (*usb1_init)(unsigned nwires); | ||
| 48 | u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup); | ||
| 49 | |||
| 50 | int (*ocpi_enable)(void); | ||
| 51 | }; | ||
| 52 | |||
| 53 | #endif /* __LINUX_USB_OMAP1_H */ | ||
diff --git a/include/linux/platform_data/video-ep93xx.h b/include/linux/platform_data/video-ep93xx.h index d5ae11d7c453..92fc2b2232e7 100644 --- a/include/linux/platform_data/video-ep93xx.h +++ b/include/linux/platform_data/video-ep93xx.h | |||
| @@ -1,9 +1,5 @@ | |||
| 1 | /* | 1 | #ifndef __VIDEO_EP93XX_H |
| 2 | * arch/arm/mach-ep93xx/include/mach/fb.h | 2 | #define __VIDEO_EP93XX_H |
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef __ASM_ARCH_EP93XXFB_H | ||
| 6 | #define __ASM_ARCH_EP93XXFB_H | ||
| 7 | 3 | ||
| 8 | struct platform_device; | 4 | struct platform_device; |
| 9 | struct fb_videomode; | 5 | struct fb_videomode; |
| @@ -53,4 +49,4 @@ struct ep93xxfb_mach_info { | |||
| 53 | void (*blank)(int blank_mode, struct fb_info *info); | 49 | void (*blank)(int blank_mode, struct fb_info *info); |
| 54 | }; | 50 | }; |
| 55 | 51 | ||
| 56 | #endif /* __ASM_ARCH_EP93XXFB_H */ | 52 | #endif /* __VIDEO_EP93XX_H */ |
diff --git a/include/linux/platform_data/video-msm_fb.h b/include/linux/platform_data/video-msm_fb.h index 1f4fc81b3d8f..31449be3eadb 100644 --- a/include/linux/platform_data/video-msm_fb.h +++ b/include/linux/platform_data/video-msm_fb.h | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | /* arch/arm/mach-msm/include/mach/msm_fb.h | 1 | /* |
| 2 | * | ||
| 3 | * Internal shared definitions for various MSM framebuffer parts. | 2 | * Internal shared definitions for various MSM framebuffer parts. |
| 4 | * | 3 | * |
| 5 | * Copyright (C) 2007 Google Incorporated | 4 | * Copyright (C) 2007 Google Incorporated |
diff --git a/include/linux/platform_data/video-pxafb.h b/include/linux/platform_data/video-pxafb.h index 486b4c519ae2..07c6c1e153f8 100644 --- a/include/linux/platform_data/video-pxafb.h +++ b/include/linux/platform_data/video-pxafb.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/arm/mach-pxa/include/mach/pxafb.h | ||
| 3 | * | ||
| 4 | * Support for the xscale frame buffer. | 2 | * Support for the xscale frame buffer. |
| 5 | * | 3 | * |
| 6 | * Author: Jean-Frederic Clere | 4 | * Author: Jean-Frederic Clere |
diff --git a/include/linux/pm.h b/include/linux/pm.h index a224c7f5c377..8c6583a53a06 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -311,6 +311,18 @@ struct dev_pm_ops { | |||
| 311 | #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) | 311 | #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) |
| 312 | #endif | 312 | #endif |
| 313 | 313 | ||
| 314 | #ifdef CONFIG_PM_SLEEP | ||
| 315 | #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ | ||
| 316 | .suspend_late = suspend_fn, \ | ||
| 317 | .resume_early = resume_fn, \ | ||
| 318 | .freeze_late = suspend_fn, \ | ||
| 319 | .thaw_early = resume_fn, \ | ||
| 320 | .poweroff_late = suspend_fn, \ | ||
| 321 | .restore_early = resume_fn, | ||
| 322 | #else | ||
| 323 | #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) | ||
| 324 | #endif | ||
| 325 | |||
| 314 | #ifdef CONFIG_PM_RUNTIME | 326 | #ifdef CONFIG_PM_RUNTIME |
| 315 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | 327 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ |
| 316 | .runtime_suspend = suspend_fn, \ | 328 | .runtime_suspend = suspend_fn, \ |
| @@ -320,6 +332,15 @@ struct dev_pm_ops { | |||
| 320 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) | 332 | #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) |
| 321 | #endif | 333 | #endif |
| 322 | 334 | ||
| 335 | #ifdef CONFIG_PM | ||
| 336 | #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ | ||
| 337 | .runtime_suspend = suspend_fn, \ | ||
| 338 | .runtime_resume = resume_fn, \ | ||
| 339 | .runtime_idle = idle_fn, | ||
| 340 | #else | ||
| 341 | #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) | ||
| 342 | #endif | ||
| 343 | |||
| 323 | /* | 344 | /* |
| 324 | * Use this if you want to use the same suspend and resume callbacks for suspend | 345 | * Use this if you want to use the same suspend and resume callbacks for suspend |
| 325 | * to RAM and hibernation. | 346 | * to RAM and hibernation. |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 6fa7cea25da9..16c9a62fa1c0 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
| @@ -23,6 +23,14 @@ | |||
| 23 | usage_count */ | 23 | usage_count */ |
| 24 | #define RPM_AUTO 0x08 /* Use autosuspend_delay */ | 24 | #define RPM_AUTO 0x08 /* Use autosuspend_delay */ |
| 25 | 25 | ||
| 26 | #ifdef CONFIG_PM | ||
| 27 | extern int pm_generic_runtime_suspend(struct device *dev); | ||
| 28 | extern int pm_generic_runtime_resume(struct device *dev); | ||
| 29 | #else | ||
| 30 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | ||
| 31 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | ||
| 32 | #endif | ||
| 33 | |||
| 26 | #ifdef CONFIG_PM_RUNTIME | 34 | #ifdef CONFIG_PM_RUNTIME |
| 27 | 35 | ||
| 28 | extern struct workqueue_struct *pm_wq; | 36 | extern struct workqueue_struct *pm_wq; |
| @@ -37,8 +45,6 @@ extern void pm_runtime_enable(struct device *dev); | |||
| 37 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); | 45 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); |
| 38 | extern void pm_runtime_allow(struct device *dev); | 46 | extern void pm_runtime_allow(struct device *dev); |
| 39 | extern void pm_runtime_forbid(struct device *dev); | 47 | extern void pm_runtime_forbid(struct device *dev); |
| 40 | extern int pm_generic_runtime_suspend(struct device *dev); | ||
| 41 | extern int pm_generic_runtime_resume(struct device *dev); | ||
| 42 | extern void pm_runtime_no_callbacks(struct device *dev); | 48 | extern void pm_runtime_no_callbacks(struct device *dev); |
| 43 | extern void pm_runtime_irq_safe(struct device *dev); | 49 | extern void pm_runtime_irq_safe(struct device *dev); |
| 44 | extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); | 50 | extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); |
| @@ -142,8 +148,6 @@ static inline bool pm_runtime_active(struct device *dev) { return true; } | |||
| 142 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } | 148 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } |
| 143 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } | 149 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } |
| 144 | 150 | ||
| 145 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | ||
| 146 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | ||
| 147 | static inline void pm_runtime_no_callbacks(struct device *dev) {} | 151 | static inline void pm_runtime_no_callbacks(struct device *dev) {} |
| 148 | static inline void pm_runtime_irq_safe(struct device *dev) {} | 152 | static inline void pm_runtime_irq_safe(struct device *dev) {} |
| 149 | 153 | ||
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 7931efe71175..833099bf8090 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
| @@ -39,9 +39,6 @@ struct posix_acl_entry { | |||
| 39 | union { | 39 | union { |
| 40 | kuid_t e_uid; | 40 | kuid_t e_uid; |
| 41 | kgid_t e_gid; | 41 | kgid_t e_gid; |
| 42 | #ifndef CONFIG_UIDGID_STRICT_TYPE_CHECKS | ||
| 43 | unsigned int e_id; | ||
| 44 | #endif | ||
| 45 | }; | 42 | }; |
| 46 | }; | 43 | }; |
| 47 | 44 | ||
| @@ -94,78 +91,12 @@ extern int posix_acl_chmod(struct posix_acl **, gfp_t, umode_t); | |||
| 94 | extern struct posix_acl *get_posix_acl(struct inode *, int); | 91 | extern struct posix_acl *get_posix_acl(struct inode *, int); |
| 95 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); | 92 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); |
| 96 | 93 | ||
| 97 | #ifdef CONFIG_FS_POSIX_ACL | 94 | struct posix_acl **acl_by_type(struct inode *inode, int type); |
| 98 | static inline struct posix_acl **acl_by_type(struct inode *inode, int type) | 95 | struct posix_acl *get_cached_acl(struct inode *inode, int type); |
| 99 | { | 96 | struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type); |
| 100 | switch (type) { | 97 | void set_cached_acl(struct inode *inode, int type, struct posix_acl *acl); |
| 101 | case ACL_TYPE_ACCESS: | 98 | void forget_cached_acl(struct inode *inode, int type); |
| 102 | return &inode->i_acl; | 99 | void forget_all_cached_acls(struct inode *inode); |
| 103 | case ACL_TYPE_DEFAULT: | ||
| 104 | return &inode->i_default_acl; | ||
| 105 | default: | ||
| 106 | BUG(); | ||
| 107 | } | ||
| 108 | } | ||
| 109 | |||
| 110 | static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) | ||
| 111 | { | ||
| 112 | struct posix_acl **p = acl_by_type(inode, type); | ||
| 113 | struct posix_acl *acl = ACCESS_ONCE(*p); | ||
| 114 | if (acl) { | ||
| 115 | spin_lock(&inode->i_lock); | ||
| 116 | acl = *p; | ||
| 117 | if (acl != ACL_NOT_CACHED) | ||
| 118 | acl = posix_acl_dup(acl); | ||
| 119 | spin_unlock(&inode->i_lock); | ||
| 120 | } | ||
| 121 | return acl; | ||
| 122 | } | ||
| 123 | |||
| 124 | static inline struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type) | ||
| 125 | { | ||
| 126 | return rcu_dereference(*acl_by_type(inode, type)); | ||
| 127 | } | ||
| 128 | |||
| 129 | static inline void set_cached_acl(struct inode *inode, | ||
| 130 | int type, | ||
| 131 | struct posix_acl *acl) | ||
| 132 | { | ||
| 133 | struct posix_acl **p = acl_by_type(inode, type); | ||
| 134 | struct posix_acl *old; | ||
| 135 | spin_lock(&inode->i_lock); | ||
| 136 | old = *p; | ||
| 137 | rcu_assign_pointer(*p, posix_acl_dup(acl)); | ||
| 138 | spin_unlock(&inode->i_lock); | ||
| 139 | if (old != ACL_NOT_CACHED) | ||
| 140 | posix_acl_release(old); | ||
| 141 | } | ||
| 142 | |||
| 143 | static inline void forget_cached_acl(struct inode *inode, int type) | ||
| 144 | { | ||
| 145 | struct posix_acl **p = acl_by_type(inode, type); | ||
| 146 | struct posix_acl *old; | ||
| 147 | spin_lock(&inode->i_lock); | ||
| 148 | old = *p; | ||
| 149 | *p = ACL_NOT_CACHED; | ||
| 150 | spin_unlock(&inode->i_lock); | ||
| 151 | if (old != ACL_NOT_CACHED) | ||
| 152 | posix_acl_release(old); | ||
| 153 | } | ||
| 154 | |||
| 155 | static inline void forget_all_cached_acls(struct inode *inode) | ||
| 156 | { | ||
| 157 | struct posix_acl *old_access, *old_default; | ||
| 158 | spin_lock(&inode->i_lock); | ||
| 159 | old_access = inode->i_acl; | ||
| 160 | old_default = inode->i_default_acl; | ||
| 161 | inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED; | ||
| 162 | spin_unlock(&inode->i_lock); | ||
| 163 | if (old_access != ACL_NOT_CACHED) | ||
| 164 | posix_acl_release(old_access); | ||
| 165 | if (old_default != ACL_NOT_CACHED) | ||
| 166 | posix_acl_release(old_default); | ||
| 167 | } | ||
| 168 | #endif | ||
| 169 | 100 | ||
| 170 | static inline void cache_no_acl(struct inode *inode) | 101 | static inline void cache_no_acl(struct inode *inode) |
| 171 | { | 102 | { |
diff --git a/include/linux/power/bq2415x_charger.h b/include/linux/power/bq2415x_charger.h index 8dcc0f46fc0a..50762af8b834 100644 --- a/include/linux/power/bq2415x_charger.h +++ b/include/linux/power/bq2415x_charger.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * bq2415x charger driver | 2 | * bq2415x charger driver |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2011-2012 Pali Rohár <pali.rohar@gmail.com> | 4 | * Copyright (C) 2011-2013 Pali Rohár <pali.rohar@gmail.com> |
| 5 | * | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | 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 | 7 | * it under the terms of the GNU General Public License as published by |
| @@ -31,46 +31,9 @@ | |||
| 31 | * termination current. It it is less or equal to zero, configuring charge | 31 | * termination current. It it is less or equal to zero, configuring charge |
| 32 | * and termination current will not be possible. | 32 | * and termination current will not be possible. |
| 33 | * | 33 | * |
| 34 | * Function set_mode_hook is needed for automode (setting correct current | 34 | * For automode support is needed to provide name of power supply device |
| 35 | * limit when charger is connected/disconnected or setting boost mode). | 35 | * in value notify_device. Device driver must immediately report property |
| 36 | * When is NULL, automode function is disabled. When is not NULL, it must | 36 | * POWER_SUPPLY_PROP_CURRENT_MAX when current changed. |
| 37 | * have this prototype: | ||
| 38 | * | ||
| 39 | * int (*set_mode_hook)( | ||
| 40 | * void (*hook)(enum bq2415x_mode mode, void *data), | ||
| 41 | * void *data) | ||
| 42 | * | ||
| 43 | * hook is hook function (see below) and data is pointer to driver private | ||
| 44 | * data | ||
| 45 | * | ||
| 46 | * bq2415x driver will call it as: | ||
| 47 | * | ||
| 48 | * platform_data->set_mode_hook(bq2415x_hook_function, bq2415x_device); | ||
| 49 | * | ||
| 50 | * Board/platform function set_mode_hook return non zero value when hook | ||
| 51 | * function was successful registered. Platform code should call that hook | ||
| 52 | * function (which get from pointer, with data) every time when charger | ||
| 53 | * was connected/disconnected or require to enable boost mode. bq2415x | ||
| 54 | * driver then will set correct current limit, enable/disable charger or | ||
| 55 | * boost mode. | ||
| 56 | * | ||
| 57 | * Hook function has this prototype: | ||
| 58 | * | ||
| 59 | * void hook(enum bq2415x_mode mode, void *data); | ||
| 60 | * | ||
| 61 | * mode is bq2415x mode (charger or boost) | ||
| 62 | * data is pointer to driver private data (which get from | ||
| 63 | * set_charger_type_hook) | ||
| 64 | * | ||
| 65 | * When bq driver is being unloaded, it call function: | ||
| 66 | * | ||
| 67 | * platform_data->set_mode_hook(NULL, NULL); | ||
| 68 | * | ||
| 69 | * (hook function and driver private data are NULL) | ||
| 70 | * | ||
| 71 | * After that board/platform code must not call driver hook function! It | ||
| 72 | * is possible that pointer to hook function will not be valid and calling | ||
| 73 | * will cause undefined result. | ||
| 74 | */ | 37 | */ |
| 75 | 38 | ||
| 76 | /* Supported modes with maximal current limit */ | 39 | /* Supported modes with maximal current limit */ |
| @@ -89,8 +52,7 @@ struct bq2415x_platform_data { | |||
| 89 | int charge_current; /* mA */ | 52 | int charge_current; /* mA */ |
| 90 | int termination_current; /* mA */ | 53 | int termination_current; /* mA */ |
| 91 | int resistor_sense; /* m ohm */ | 54 | int resistor_sense; /* m ohm */ |
| 92 | int (*set_mode_hook)(void (*hook)(enum bq2415x_mode mode, void *data), | 55 | const char *notify_device; /* name */ |
| 93 | void *data); | ||
| 94 | }; | 56 | }; |
| 95 | 57 | ||
| 96 | #endif | 58 | #endif |
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h index 0e86840eb603..07e7945a1ff2 100644 --- a/include/linux/power/charger-manager.h +++ b/include/linux/power/charger-manager.h | |||
| @@ -37,6 +37,8 @@ enum cm_event_types { | |||
| 37 | CM_EVENT_BATT_FULL, | 37 | CM_EVENT_BATT_FULL, |
| 38 | CM_EVENT_BATT_IN, | 38 | CM_EVENT_BATT_IN, |
| 39 | CM_EVENT_BATT_OUT, | 39 | CM_EVENT_BATT_OUT, |
| 40 | CM_EVENT_BATT_OVERHEAT, | ||
| 41 | CM_EVENT_BATT_COLD, | ||
| 40 | CM_EVENT_EXT_PWR_IN_OUT, | 42 | CM_EVENT_EXT_PWR_IN_OUT, |
| 41 | CM_EVENT_CHG_START_STOP, | 43 | CM_EVENT_CHG_START_STOP, |
| 42 | CM_EVENT_OTHERS, | 44 | CM_EVENT_OTHERS, |
| @@ -173,11 +175,10 @@ struct charger_regulator { | |||
| 173 | * @num_charger_regulator: the number of entries in charger_regulators | 175 | * @num_charger_regulator: the number of entries in charger_regulators |
| 174 | * @charger_regulators: array of charger regulators | 176 | * @charger_regulators: array of charger regulators |
| 175 | * @psy_fuel_gauge: the name of power-supply for fuel gauge | 177 | * @psy_fuel_gauge: the name of power-supply for fuel gauge |
| 176 | * @temperature_out_of_range: | 178 | * @thermal_zone : the name of thermal zone for battery |
| 177 | * Determine whether the status is overheat or cold or normal. | 179 | * @temp_min : Minimum battery temperature for charging. |
| 178 | * return_value > 0: overheat | 180 | * @temp_max : Maximum battery temperature for charging. |
| 179 | * return_value == 0: normal | 181 | * @temp_diff : Temperature diffential to restart charging. |
| 180 | * return_value < 0: cold | ||
| 181 | * @measure_battery_temp: | 182 | * @measure_battery_temp: |
| 182 | * true: measure battery temperature | 183 | * true: measure battery temperature |
| 183 | * false: measure ambient temperature | 184 | * false: measure ambient temperature |
| @@ -190,7 +191,7 @@ struct charger_regulator { | |||
| 190 | * max_duration_ms', cm start charging. | 191 | * max_duration_ms', cm start charging. |
| 191 | */ | 192 | */ |
| 192 | struct charger_desc { | 193 | struct charger_desc { |
| 193 | char *psy_name; | 194 | const char *psy_name; |
| 194 | 195 | ||
| 195 | enum polling_modes polling_mode; | 196 | enum polling_modes polling_mode; |
| 196 | unsigned int polling_interval_ms; | 197 | unsigned int polling_interval_ms; |
| @@ -203,18 +204,23 @@ struct charger_desc { | |||
| 203 | 204 | ||
| 204 | enum data_source battery_present; | 205 | enum data_source battery_present; |
| 205 | 206 | ||
| 206 | char **psy_charger_stat; | 207 | const char **psy_charger_stat; |
| 207 | 208 | ||
| 208 | int num_charger_regulators; | 209 | int num_charger_regulators; |
| 209 | struct charger_regulator *charger_regulators; | 210 | struct charger_regulator *charger_regulators; |
| 210 | 211 | ||
| 211 | char *psy_fuel_gauge; | 212 | const char *psy_fuel_gauge; |
| 213 | |||
| 214 | const char *thermal_zone; | ||
| 215 | |||
| 216 | int temp_min; | ||
| 217 | int temp_max; | ||
| 218 | int temp_diff; | ||
| 212 | 219 | ||
| 213 | int (*temperature_out_of_range)(int *mC); | ||
| 214 | bool measure_battery_temp; | 220 | bool measure_battery_temp; |
| 215 | 221 | ||
| 216 | u64 charging_max_duration_ms; | 222 | u32 charging_max_duration_ms; |
| 217 | u64 discharging_max_duration_ms; | 223 | u32 discharging_max_duration_ms; |
| 218 | }; | 224 | }; |
| 219 | 225 | ||
| 220 | #define PSY_NAME_MAX 30 | 226 | #define PSY_NAME_MAX 30 |
| @@ -226,13 +232,13 @@ struct charger_desc { | |||
| 226 | * @desc: instance of charger_desc | 232 | * @desc: instance of charger_desc |
| 227 | * @fuel_gauge: power_supply for fuel gauge | 233 | * @fuel_gauge: power_supply for fuel gauge |
| 228 | * @charger_stat: array of power_supply for chargers | 234 | * @charger_stat: array of power_supply for chargers |
| 235 | * @tzd_batt : thermal zone device for battery | ||
| 229 | * @charger_enabled: the state of charger | 236 | * @charger_enabled: the state of charger |
| 230 | * @fullbatt_vchk_jiffies_at: | 237 | * @fullbatt_vchk_jiffies_at: |
| 231 | * jiffies at the time full battery check will occur. | 238 | * jiffies at the time full battery check will occur. |
| 232 | * @fullbatt_vchk_work: work queue for full battery check | 239 | * @fullbatt_vchk_work: work queue for full battery check |
| 233 | * @emergency_stop: | 240 | * @emergency_stop: |
| 234 | * When setting true, stop charging | 241 | * When setting true, stop charging |
| 235 | * @last_temp_mC: the measured temperature in milli-Celsius | ||
| 236 | * @psy_name_buf: the name of power-supply-class for charger manager | 242 | * @psy_name_buf: the name of power-supply-class for charger manager |
| 237 | * @charger_psy: power_supply for charger manager | 243 | * @charger_psy: power_supply for charger manager |
| 238 | * @status_save_ext_pwr_inserted: | 244 | * @status_save_ext_pwr_inserted: |
| @@ -250,13 +256,15 @@ struct charger_manager { | |||
| 250 | struct power_supply *fuel_gauge; | 256 | struct power_supply *fuel_gauge; |
| 251 | struct power_supply **charger_stat; | 257 | struct power_supply **charger_stat; |
| 252 | 258 | ||
| 259 | #ifdef CONFIG_THERMAL | ||
| 260 | struct thermal_zone_device *tzd_batt; | ||
| 261 | #endif | ||
| 253 | bool charger_enabled; | 262 | bool charger_enabled; |
| 254 | 263 | ||
| 255 | unsigned long fullbatt_vchk_jiffies_at; | 264 | unsigned long fullbatt_vchk_jiffies_at; |
| 256 | struct delayed_work fullbatt_vchk_work; | 265 | struct delayed_work fullbatt_vchk_work; |
| 257 | 266 | ||
| 258 | int emergency_stop; | 267 | int emergency_stop; |
| 259 | int last_temp_mC; | ||
| 260 | 268 | ||
| 261 | char psy_name_buf[PSY_NAME_MAX + 1]; | 269 | char psy_name_buf[PSY_NAME_MAX + 1]; |
| 262 | struct power_supply charger_psy; | 270 | struct power_supply charger_psy; |
diff --git a/include/linux/power/isp1704_charger.h b/include/linux/power/isp1704_charger.h index 68096a6aa2d7..0105d9e7af85 100644 --- a/include/linux/power/isp1704_charger.h +++ b/include/linux/power/isp1704_charger.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | struct isp1704_charger_data { | 25 | struct isp1704_charger_data { |
| 26 | void (*set_power)(bool on); | 26 | void (*set_power)(bool on); |
| 27 | int enable_gpio; | ||
| 27 | }; | 28 | }; |
| 28 | 29 | ||
| 29 | #endif | 30 | #endif |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 5c2600630dc9..c9dc4e09854c 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/workqueue.h> | 16 | #include <linux/workqueue.h> |
| 17 | #include <linux/leds.h> | 17 | #include <linux/leds.h> |
| 18 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
| 19 | #include <linux/notifier.h> | ||
| 19 | 20 | ||
| 20 | struct device; | 21 | struct device; |
| 21 | 22 | ||
| @@ -158,6 +159,10 @@ enum power_supply_type { | |||
| 158 | POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */ | 159 | POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */ |
| 159 | }; | 160 | }; |
| 160 | 161 | ||
| 162 | enum power_supply_notifier_events { | ||
| 163 | PSY_EVENT_PROP_CHANGED, | ||
| 164 | }; | ||
| 165 | |||
| 161 | union power_supply_propval { | 166 | union power_supply_propval { |
| 162 | int intval; | 167 | int intval; |
| 163 | const char *strval; | 168 | const char *strval; |
| @@ -235,7 +240,18 @@ struct power_supply_info { | |||
| 235 | int use_for_apm; | 240 | int use_for_apm; |
| 236 | }; | 241 | }; |
| 237 | 242 | ||
| 243 | extern struct atomic_notifier_head power_supply_notifier; | ||
| 244 | extern int power_supply_reg_notifier(struct notifier_block *nb); | ||
| 245 | extern void power_supply_unreg_notifier(struct notifier_block *nb); | ||
| 238 | extern struct power_supply *power_supply_get_by_name(const char *name); | 246 | extern struct power_supply *power_supply_get_by_name(const char *name); |
| 247 | #ifdef CONFIG_OF | ||
| 248 | extern struct power_supply *power_supply_get_by_phandle(struct device_node *np, | ||
| 249 | const char *property); | ||
| 250 | #else /* !CONFIG_OF */ | ||
| 251 | static inline struct power_supply * | ||
| 252 | power_supply_get_by_phandle(struct device_node *np, const char *property) | ||
| 253 | { return NULL; } | ||
| 254 | #endif /* CONFIG_OF */ | ||
| 239 | extern void power_supply_changed(struct power_supply *psy); | 255 | extern void power_supply_changed(struct power_supply *psy); |
| 240 | extern int power_supply_am_i_supplied(struct power_supply *psy); | 256 | extern int power_supply_am_i_supplied(struct power_supply *psy); |
| 241 | extern int power_supply_set_battery_charged(struct power_supply *psy); | 257 | extern int power_supply_set_battery_charged(struct power_supply *psy); |
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index a3d9dc8c2c00..de83b4eb1642 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
| @@ -64,7 +64,11 @@ do { \ | |||
| 64 | } while (0) | 64 | } while (0) |
| 65 | 65 | ||
| 66 | #else | 66 | #else |
| 67 | #define preempt_enable() preempt_enable_no_resched() | 67 | #define preempt_enable() \ |
| 68 | do { \ | ||
| 69 | barrier(); \ | ||
| 70 | preempt_count_dec(); \ | ||
| 71 | } while (0) | ||
| 68 | #define preempt_check_resched() do { } while (0) | 72 | #define preempt_check_resched() do { } while (0) |
| 69 | #endif | 73 | #endif |
| 70 | 74 | ||
| @@ -93,7 +97,11 @@ do { \ | |||
| 93 | __preempt_schedule_context(); \ | 97 | __preempt_schedule_context(); \ |
| 94 | } while (0) | 98 | } while (0) |
| 95 | #else | 99 | #else |
| 96 | #define preempt_enable_notrace() preempt_enable_no_resched_notrace() | 100 | #define preempt_enable_notrace() \ |
| 101 | do { \ | ||
| 102 | barrier(); \ | ||
| 103 | __preempt_count_dec(); \ | ||
| 104 | } while (0) | ||
| 97 | #endif | 105 | #endif |
| 98 | 106 | ||
| 99 | #else /* !CONFIG_PREEMPT_COUNT */ | 107 | #else /* !CONFIG_PREEMPT_COUNT */ |
| @@ -116,6 +124,26 @@ do { \ | |||
| 116 | 124 | ||
| 117 | #endif /* CONFIG_PREEMPT_COUNT */ | 125 | #endif /* CONFIG_PREEMPT_COUNT */ |
| 118 | 126 | ||
| 127 | #ifdef MODULE | ||
| 128 | /* | ||
| 129 | * Modules have no business playing preemption tricks. | ||
| 130 | */ | ||
| 131 | #undef sched_preempt_enable_no_resched | ||
| 132 | #undef preempt_enable_no_resched | ||
| 133 | #undef preempt_enable_no_resched_notrace | ||
| 134 | #undef preempt_check_resched | ||
| 135 | #endif | ||
| 136 | |||
| 137 | #define preempt_set_need_resched() \ | ||
| 138 | do { \ | ||
| 139 | set_preempt_need_resched(); \ | ||
| 140 | } while (0) | ||
| 141 | #define preempt_fold_need_resched() \ | ||
| 142 | do { \ | ||
| 143 | if (tif_need_resched()) \ | ||
| 144 | set_preempt_need_resched(); \ | ||
| 145 | } while (0) | ||
| 146 | |||
| 119 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 147 | #ifdef CONFIG_PREEMPT_NOTIFIERS |
| 120 | 148 | ||
| 121 | struct preempt_notifier; | 149 | struct preempt_notifier; |
diff --git a/include/linux/preempt_mask.h b/include/linux/preempt_mask.h index d169820203dd..dbeec4d4a3be 100644 --- a/include/linux/preempt_mask.h +++ b/include/linux/preempt_mask.h | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | #define LINUX_PREEMPT_MASK_H | 2 | #define LINUX_PREEMPT_MASK_H |
| 3 | 3 | ||
| 4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
| 5 | #include <asm/hardirq.h> | ||
| 6 | 5 | ||
| 7 | /* | 6 | /* |
| 8 | * We put the hardirq and softirq counter into the preemption | 7 | * We put the hardirq and softirq counter into the preemption |
| @@ -79,6 +78,21 @@ | |||
| 79 | #endif | 78 | #endif |
| 80 | 79 | ||
| 81 | /* | 80 | /* |
| 81 | * The preempt_count offset needed for things like: | ||
| 82 | * | ||
| 83 | * spin_lock_bh() | ||
| 84 | * | ||
| 85 | * Which need to disable both preemption (CONFIG_PREEMPT_COUNT) and | ||
| 86 | * softirqs, such that unlock sequences of: | ||
| 87 | * | ||
| 88 | * spin_unlock(); | ||
| 89 | * local_bh_enable(); | ||
| 90 | * | ||
| 91 | * Work as expected. | ||
| 92 | */ | ||
| 93 | #define SOFTIRQ_LOCK_OFFSET (SOFTIRQ_DISABLE_OFFSET + PREEMPT_CHECK_OFFSET) | ||
| 94 | |||
| 95 | /* | ||
| 82 | * Are we running in atomic context? WARNING: this macro cannot | 96 | * Are we running in atomic context? WARNING: this macro cannot |
| 83 | * always detect atomic context; in particular, it cannot know about | 97 | * always detect atomic context; in particular, it cannot know about |
| 84 | * held spinlocks in non-preemptible kernels. Thus it should not be | 98 | * held spinlocks in non-preemptible kernels. Thus it should not be |
diff --git a/include/linux/printk.h b/include/linux/printk.h index 694925837a16..fa47e2708c01 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <linux/init.h> | 5 | #include <linux/init.h> |
| 6 | #include <linux/kern_levels.h> | 6 | #include <linux/kern_levels.h> |
| 7 | #include <linux/linkage.h> | 7 | #include <linux/linkage.h> |
| 8 | #include <linux/cache.h> | ||
| 8 | 9 | ||
| 9 | extern const char linux_banner[]; | 10 | extern const char linux_banner[]; |
| 10 | extern const char linux_proc_banner[]; | 11 | extern const char linux_proc_banner[]; |
| @@ -88,6 +89,13 @@ struct va_format { | |||
| 88 | #define HW_ERR "[Hardware Error]: " | 89 | #define HW_ERR "[Hardware Error]: " |
| 89 | 90 | ||
| 90 | /* | 91 | /* |
| 92 | * DEPRECATED | ||
| 93 | * Add this to a message whenever you want to warn user space about the use | ||
| 94 | * of a deprecated aspect of an API so they can stop using it | ||
| 95 | */ | ||
| 96 | #define DEPRECATED "[Deprecated]: " | ||
| 97 | |||
| 98 | /* | ||
| 91 | * Dummy printk for disabled debugging statements to use whilst maintaining | 99 | * Dummy printk for disabled debugging statements to use whilst maintaining |
| 92 | * gcc's format and side-effect checking. | 100 | * gcc's format and side-effect checking. |
| 93 | */ | 101 | */ |
| @@ -253,17 +261,17 @@ extern asmlinkage void dump_stack(void) __cold; | |||
| 253 | */ | 261 | */ |
| 254 | 262 | ||
| 255 | #ifdef CONFIG_PRINTK | 263 | #ifdef CONFIG_PRINTK |
| 256 | #define printk_once(fmt, ...) \ | 264 | #define printk_once(fmt, ...) \ |
| 257 | ({ \ | 265 | ({ \ |
| 258 | static bool __print_once; \ | 266 | static bool __print_once __read_mostly; \ |
| 259 | \ | 267 | \ |
| 260 | if (!__print_once) { \ | 268 | if (!__print_once) { \ |
| 261 | __print_once = true; \ | 269 | __print_once = true; \ |
| 262 | printk(fmt, ##__VA_ARGS__); \ | 270 | printk(fmt, ##__VA_ARGS__); \ |
| 263 | } \ | 271 | } \ |
| 264 | }) | 272 | }) |
| 265 | #else | 273 | #else |
| 266 | #define printk_once(fmt, ...) \ | 274 | #define printk_once(fmt, ...) \ |
| 267 | no_printk(fmt, ##__VA_ARGS__) | 275 | no_printk(fmt, ##__VA_ARGS__) |
| 268 | #endif | 276 | #endif |
| 269 | 277 | ||
diff --git a/include/linux/projid.h b/include/linux/projid.h index 36517b95be5c..8c1f2c55226d 100644 --- a/include/linux/projid.h +++ b/include/linux/projid.h | |||
| @@ -18,8 +18,6 @@ extern struct user_namespace init_user_ns; | |||
| 18 | 18 | ||
| 19 | typedef __kernel_uid32_t projid_t; | 19 | typedef __kernel_uid32_t projid_t; |
| 20 | 20 | ||
| 21 | #ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS | ||
| 22 | |||
| 23 | typedef struct { | 21 | typedef struct { |
| 24 | projid_t val; | 22 | projid_t val; |
| 25 | } kprojid_t; | 23 | } kprojid_t; |
| @@ -31,19 +29,6 @@ static inline projid_t __kprojid_val(kprojid_t projid) | |||
| 31 | 29 | ||
| 32 | #define KPROJIDT_INIT(value) (kprojid_t){ value } | 30 | #define KPROJIDT_INIT(value) (kprojid_t){ value } |
| 33 | 31 | ||
| 34 | #else | ||
| 35 | |||
| 36 | typedef projid_t kprojid_t; | ||
| 37 | |||
| 38 | static inline projid_t __kprojid_val(kprojid_t projid) | ||
| 39 | { | ||
| 40 | return projid; | ||
| 41 | } | ||
| 42 | |||
| 43 | #define KPROJIDT_INIT(value) ((kprojid_t) value ) | ||
| 44 | |||
| 45 | #endif | ||
| 46 | |||
| 47 | #define INVALID_PROJID KPROJIDT_INIT(-1) | 32 | #define INVALID_PROJID KPROJIDT_INIT(-1) |
| 48 | #define OVERFLOW_PROJID 65534 | 33 | #define OVERFLOW_PROJID 65534 |
| 49 | 34 | ||
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index abd437d0a8a7..ece0c6bbfcc5 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
| @@ -51,6 +51,7 @@ struct pstore_info { | |||
| 51 | char *buf; | 51 | char *buf; |
| 52 | size_t bufsize; | 52 | size_t bufsize; |
| 53 | struct mutex read_mutex; /* serialize open/read/close */ | 53 | struct mutex read_mutex; /* serialize open/read/close */ |
| 54 | int flags; | ||
| 54 | int (*open)(struct pstore_info *psi); | 55 | int (*open)(struct pstore_info *psi); |
| 55 | int (*close)(struct pstore_info *psi); | 56 | int (*close)(struct pstore_info *psi); |
| 56 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, | 57 | ssize_t (*read)(u64 *id, enum pstore_type_id *type, |
| @@ -70,6 +71,8 @@ struct pstore_info { | |||
| 70 | void *data; | 71 | void *data; |
| 71 | }; | 72 | }; |
| 72 | 73 | ||
| 74 | #define PSTORE_FLAGS_FRAGILE 1 | ||
| 75 | |||
| 73 | #ifdef CONFIG_PSTORE | 76 | #ifdef CONFIG_PSTORE |
| 74 | extern int pstore_register(struct pstore_info *); | 77 | extern int pstore_register(struct pstore_info *); |
| 75 | extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason); | 78 | extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason); |
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index 753207c8ce20..ecc730977a5a 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
| @@ -14,13 +14,6 @@ ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) | |||
| 14 | } | 14 | } |
| 15 | #else | 15 | #else |
| 16 | extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); | 16 | extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); |
| 17 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, | ||
| 18 | unsigned long addr, | ||
| 19 | unsigned long len, | ||
| 20 | unsigned long pgoff, | ||
| 21 | unsigned long flags); | ||
| 22 | |||
| 23 | extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma); | ||
| 24 | #endif | 17 | #endif |
| 25 | 18 | ||
| 26 | extern const struct file_operations ramfs_file_operations; | 19 | extern const struct file_operations ramfs_file_operations; |
diff --git a/include/linux/random.h b/include/linux/random.h index 4002b3df4c85..1cfce0e24dbd 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | 8 | ||
| 9 | #include <uapi/linux/random.h> | 9 | #include <uapi/linux/random.h> |
| 10 | 10 | ||
| 11 | |||
| 12 | extern void add_device_randomness(const void *, unsigned int); | 11 | extern void add_device_randomness(const void *, unsigned int); |
| 13 | extern void add_input_randomness(unsigned int type, unsigned int code, | 12 | extern void add_input_randomness(unsigned int type, unsigned int code, |
| 14 | unsigned int value); | 13 | unsigned int value); |
| @@ -38,6 +37,23 @@ struct rnd_state { | |||
| 38 | u32 prandom_u32_state(struct rnd_state *state); | 37 | u32 prandom_u32_state(struct rnd_state *state); |
| 39 | void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes); | 38 | void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes); |
| 40 | 39 | ||
| 40 | /** | ||
| 41 | * prandom_u32_max - returns a pseudo-random number in interval [0, ep_ro) | ||
| 42 | * @ep_ro: right open interval endpoint | ||
| 43 | * | ||
| 44 | * Returns a pseudo-random number that is in interval [0, ep_ro). Note | ||
| 45 | * that the result depends on PRNG being well distributed in [0, ~0U] | ||
| 46 | * u32 space. Here we use maximally equidistributed combined Tausworthe | ||
| 47 | * generator, that is, prandom_u32(). This is useful when requesting a | ||
| 48 | * random index of an array containing ep_ro elements, for example. | ||
| 49 | * | ||
| 50 | * Returns: pseudo-random number in interval [0, ep_ro) | ||
| 51 | */ | ||
| 52 | static inline u32 prandom_u32_max(u32 ep_ro) | ||
| 53 | { | ||
| 54 | return (u32)(((u64) prandom_u32() * ep_ro) >> 32); | ||
| 55 | } | ||
| 56 | |||
| 41 | /* | 57 | /* |
| 42 | * Handle minimum values for seeds | 58 | * Handle minimum values for seeds |
| 43 | */ | 59 | */ |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 45a0a9e81478..dbaf99084112 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
| @@ -55,8 +55,8 @@ static inline void __list_add_rcu(struct list_head *new, | |||
| 55 | next->prev = new; | 55 | next->prev = new; |
| 56 | } | 56 | } |
| 57 | #else | 57 | #else |
| 58 | extern void __list_add_rcu(struct list_head *new, | 58 | void __list_add_rcu(struct list_head *new, |
| 59 | struct list_head *prev, struct list_head *next); | 59 | struct list_head *prev, struct list_head *next); |
| 60 | #endif | 60 | #endif |
| 61 | 61 | ||
| 62 | /** | 62 | /** |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 39cbb889e20d..3e355c688618 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -50,13 +50,13 @@ extern int rcutorture_runnable; /* for sysctl */ | |||
| 50 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ | 50 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ |
| 51 | 51 | ||
| 52 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 52 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
| 53 | extern void rcutorture_record_test_transition(void); | 53 | void rcutorture_record_test_transition(void); |
| 54 | extern void rcutorture_record_progress(unsigned long vernum); | 54 | void rcutorture_record_progress(unsigned long vernum); |
| 55 | extern void do_trace_rcu_torture_read(const char *rcutorturename, | 55 | void do_trace_rcu_torture_read(const char *rcutorturename, |
| 56 | struct rcu_head *rhp, | 56 | struct rcu_head *rhp, |
| 57 | unsigned long secs, | 57 | unsigned long secs, |
| 58 | unsigned long c_old, | 58 | unsigned long c_old, |
| 59 | unsigned long c); | 59 | unsigned long c); |
| 60 | #else | 60 | #else |
| 61 | static inline void rcutorture_record_test_transition(void) | 61 | static inline void rcutorture_record_test_transition(void) |
| 62 | { | 62 | { |
| @@ -65,11 +65,11 @@ static inline void rcutorture_record_progress(unsigned long vernum) | |||
| 65 | { | 65 | { |
| 66 | } | 66 | } |
| 67 | #ifdef CONFIG_RCU_TRACE | 67 | #ifdef CONFIG_RCU_TRACE |
| 68 | extern void do_trace_rcu_torture_read(const char *rcutorturename, | 68 | void do_trace_rcu_torture_read(const char *rcutorturename, |
| 69 | struct rcu_head *rhp, | 69 | struct rcu_head *rhp, |
| 70 | unsigned long secs, | 70 | unsigned long secs, |
| 71 | unsigned long c_old, | 71 | unsigned long c_old, |
| 72 | unsigned long c); | 72 | unsigned long c); |
| 73 | #else | 73 | #else |
| 74 | #define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ | 74 | #define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ |
| 75 | do { } while (0) | 75 | do { } while (0) |
| @@ -118,8 +118,8 @@ extern void do_trace_rcu_torture_read(const char *rcutorturename, | |||
| 118 | * if CPU A and CPU B are the same CPU (but again only if the system has | 118 | * if CPU A and CPU B are the same CPU (but again only if the system has |
| 119 | * more than one CPU). | 119 | * more than one CPU). |
| 120 | */ | 120 | */ |
| 121 | extern void call_rcu(struct rcu_head *head, | 121 | void call_rcu(struct rcu_head *head, |
| 122 | void (*func)(struct rcu_head *head)); | 122 | void (*func)(struct rcu_head *head)); |
| 123 | 123 | ||
| 124 | #else /* #ifdef CONFIG_PREEMPT_RCU */ | 124 | #else /* #ifdef CONFIG_PREEMPT_RCU */ |
| 125 | 125 | ||
| @@ -149,8 +149,8 @@ extern void call_rcu(struct rcu_head *head, | |||
| 149 | * See the description of call_rcu() for more detailed information on | 149 | * See the description of call_rcu() for more detailed information on |
| 150 | * memory ordering guarantees. | 150 | * memory ordering guarantees. |
| 151 | */ | 151 | */ |
| 152 | extern void call_rcu_bh(struct rcu_head *head, | 152 | void call_rcu_bh(struct rcu_head *head, |
| 153 | void (*func)(struct rcu_head *head)); | 153 | void (*func)(struct rcu_head *head)); |
| 154 | 154 | ||
| 155 | /** | 155 | /** |
| 156 | * call_rcu_sched() - Queue an RCU for invocation after sched grace period. | 156 | * call_rcu_sched() - Queue an RCU for invocation after sched grace period. |
| @@ -171,16 +171,16 @@ extern void call_rcu_bh(struct rcu_head *head, | |||
| 171 | * See the description of call_rcu() for more detailed information on | 171 | * See the description of call_rcu() for more detailed information on |
| 172 | * memory ordering guarantees. | 172 | * memory ordering guarantees. |
| 173 | */ | 173 | */ |
| 174 | extern void call_rcu_sched(struct rcu_head *head, | 174 | void call_rcu_sched(struct rcu_head *head, |
| 175 | void (*func)(struct rcu_head *rcu)); | 175 | void (*func)(struct rcu_head *rcu)); |
| 176 | 176 | ||
| 177 | extern void synchronize_sched(void); | 177 | void synchronize_sched(void); |
| 178 | 178 | ||
| 179 | #ifdef CONFIG_PREEMPT_RCU | 179 | #ifdef CONFIG_PREEMPT_RCU |
| 180 | 180 | ||
| 181 | extern void __rcu_read_lock(void); | 181 | void __rcu_read_lock(void); |
| 182 | extern void __rcu_read_unlock(void); | 182 | void __rcu_read_unlock(void); |
| 183 | extern void rcu_read_unlock_special(struct task_struct *t); | 183 | void rcu_read_unlock_special(struct task_struct *t); |
| 184 | void synchronize_rcu(void); | 184 | void synchronize_rcu(void); |
| 185 | 185 | ||
| 186 | /* | 186 | /* |
| @@ -216,19 +216,19 @@ static inline int rcu_preempt_depth(void) | |||
| 216 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ | 216 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ |
| 217 | 217 | ||
| 218 | /* Internal to kernel */ | 218 | /* Internal to kernel */ |
| 219 | extern void rcu_init(void); | 219 | void rcu_init(void); |
| 220 | extern void rcu_sched_qs(int cpu); | 220 | void rcu_sched_qs(int cpu); |
| 221 | extern void rcu_bh_qs(int cpu); | 221 | void rcu_bh_qs(int cpu); |
| 222 | extern void rcu_check_callbacks(int cpu, int user); | 222 | void rcu_check_callbacks(int cpu, int user); |
| 223 | struct notifier_block; | 223 | struct notifier_block; |
| 224 | extern void rcu_idle_enter(void); | 224 | void rcu_idle_enter(void); |
| 225 | extern void rcu_idle_exit(void); | 225 | void rcu_idle_exit(void); |
| 226 | extern void rcu_irq_enter(void); | 226 | void rcu_irq_enter(void); |
| 227 | extern void rcu_irq_exit(void); | 227 | void rcu_irq_exit(void); |
| 228 | 228 | ||
| 229 | #ifdef CONFIG_RCU_USER_QS | 229 | #ifdef CONFIG_RCU_USER_QS |
| 230 | extern void rcu_user_enter(void); | 230 | void rcu_user_enter(void); |
| 231 | extern void rcu_user_exit(void); | 231 | void rcu_user_exit(void); |
| 232 | #else | 232 | #else |
| 233 | static inline void rcu_user_enter(void) { } | 233 | static inline void rcu_user_enter(void) { } |
| 234 | static inline void rcu_user_exit(void) { } | 234 | static inline void rcu_user_exit(void) { } |
| @@ -262,7 +262,7 @@ static inline void rcu_user_hooks_switch(struct task_struct *prev, | |||
| 262 | } while (0) | 262 | } while (0) |
| 263 | 263 | ||
| 264 | #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) | 264 | #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) |
| 265 | extern bool __rcu_is_watching(void); | 265 | bool __rcu_is_watching(void); |
| 266 | #endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */ | 266 | #endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */ |
| 267 | 267 | ||
| 268 | /* | 268 | /* |
| @@ -289,8 +289,8 @@ void wait_rcu_gp(call_rcu_func_t crf); | |||
| 289 | * initialization. | 289 | * initialization. |
| 290 | */ | 290 | */ |
| 291 | #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD | 291 | #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD |
| 292 | extern void init_rcu_head_on_stack(struct rcu_head *head); | 292 | void init_rcu_head_on_stack(struct rcu_head *head); |
| 293 | extern void destroy_rcu_head_on_stack(struct rcu_head *head); | 293 | void destroy_rcu_head_on_stack(struct rcu_head *head); |
| 294 | #else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ | 294 | #else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ |
| 295 | static inline void init_rcu_head_on_stack(struct rcu_head *head) | 295 | static inline void init_rcu_head_on_stack(struct rcu_head *head) |
| 296 | { | 296 | { |
| @@ -325,6 +325,7 @@ static inline void rcu_lock_release(struct lockdep_map *map) | |||
| 325 | extern struct lockdep_map rcu_lock_map; | 325 | extern struct lockdep_map rcu_lock_map; |
| 326 | extern struct lockdep_map rcu_bh_lock_map; | 326 | extern struct lockdep_map rcu_bh_lock_map; |
| 327 | extern struct lockdep_map rcu_sched_lock_map; | 327 | extern struct lockdep_map rcu_sched_lock_map; |
| 328 | extern struct lockdep_map rcu_callback_map; | ||
| 328 | extern int debug_lockdep_rcu_enabled(void); | 329 | extern int debug_lockdep_rcu_enabled(void); |
| 329 | 330 | ||
| 330 | /** | 331 | /** |
| @@ -362,7 +363,7 @@ static inline int rcu_read_lock_held(void) | |||
| 362 | * rcu_read_lock_bh_held() is defined out of line to avoid #include-file | 363 | * rcu_read_lock_bh_held() is defined out of line to avoid #include-file |
| 363 | * hell. | 364 | * hell. |
| 364 | */ | 365 | */ |
| 365 | extern int rcu_read_lock_bh_held(void); | 366 | int rcu_read_lock_bh_held(void); |
| 366 | 367 | ||
| 367 | /** | 368 | /** |
| 368 | * rcu_read_lock_sched_held() - might we be in RCU-sched read-side critical section? | 369 | * rcu_read_lock_sched_held() - might we be in RCU-sched read-side critical section? |
| @@ -448,7 +449,7 @@ static inline int rcu_read_lock_sched_held(void) | |||
| 448 | 449 | ||
| 449 | #ifdef CONFIG_PROVE_RCU | 450 | #ifdef CONFIG_PROVE_RCU |
| 450 | 451 | ||
| 451 | extern int rcu_my_thread_group_empty(void); | 452 | int rcu_my_thread_group_empty(void); |
| 452 | 453 | ||
| 453 | /** | 454 | /** |
| 454 | * rcu_lockdep_assert - emit lockdep splat if specified condition not met | 455 | * rcu_lockdep_assert - emit lockdep splat if specified condition not met |
| @@ -548,10 +549,48 @@ static inline void rcu_preempt_sleep_check(void) | |||
| 548 | smp_read_barrier_depends(); \ | 549 | smp_read_barrier_depends(); \ |
| 549 | (_________p1); \ | 550 | (_________p1); \ |
| 550 | }) | 551 | }) |
| 551 | #define __rcu_assign_pointer(p, v, space) \ | 552 | |
| 553 | /** | ||
| 554 | * RCU_INITIALIZER() - statically initialize an RCU-protected global variable | ||
| 555 | * @v: The value to statically initialize with. | ||
| 556 | */ | ||
| 557 | #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v) | ||
| 558 | |||
| 559 | /** | ||
| 560 | * rcu_assign_pointer() - assign to RCU-protected pointer | ||
| 561 | * @p: pointer to assign to | ||
| 562 | * @v: value to assign (publish) | ||
| 563 | * | ||
| 564 | * Assigns the specified value to the specified RCU-protected | ||
| 565 | * pointer, ensuring that any concurrent RCU readers will see | ||
| 566 | * any prior initialization. | ||
| 567 | * | ||
| 568 | * Inserts memory barriers on architectures that require them | ||
| 569 | * (which is most of them), and also prevents the compiler from | ||
| 570 | * reordering the code that initializes the structure after the pointer | ||
| 571 | * assignment. More importantly, this call documents which pointers | ||
| 572 | * will be dereferenced by RCU read-side code. | ||
| 573 | * | ||
| 574 | * In some special cases, you may use RCU_INIT_POINTER() instead | ||
| 575 | * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due | ||
| 576 | * to the fact that it does not constrain either the CPU or the compiler. | ||
| 577 | * That said, using RCU_INIT_POINTER() when you should have used | ||
| 578 | * rcu_assign_pointer() is a very bad thing that results in | ||
| 579 | * impossible-to-diagnose memory corruption. So please be careful. | ||
| 580 | * See the RCU_INIT_POINTER() comment header for details. | ||
| 581 | * | ||
| 582 | * Note that rcu_assign_pointer() evaluates each of its arguments only | ||
| 583 | * once, appearances notwithstanding. One of the "extra" evaluations | ||
| 584 | * is in typeof() and the other visible only to sparse (__CHECKER__), | ||
| 585 | * neither of which actually execute the argument. As with most cpp | ||
| 586 | * macros, this execute-arguments-only-once property is important, so | ||
| 587 | * please be careful when making changes to rcu_assign_pointer() and the | ||
| 588 | * other macros that it invokes. | ||
| 589 | */ | ||
| 590 | #define rcu_assign_pointer(p, v) \ | ||
| 552 | do { \ | 591 | do { \ |
| 553 | smp_wmb(); \ | 592 | smp_wmb(); \ |
| 554 | (p) = (typeof(*v) __force space *)(v); \ | 593 | ACCESS_ONCE(p) = RCU_INITIALIZER(v); \ |
| 555 | } while (0) | 594 | } while (0) |
| 556 | 595 | ||
| 557 | 596 | ||
| @@ -890,32 +929,6 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
| 890 | } | 929 | } |
| 891 | 930 | ||
| 892 | /** | 931 | /** |
| 893 | * rcu_assign_pointer() - assign to RCU-protected pointer | ||
| 894 | * @p: pointer to assign to | ||
| 895 | * @v: value to assign (publish) | ||
| 896 | * | ||
| 897 | * Assigns the specified value to the specified RCU-protected | ||
| 898 | * pointer, ensuring that any concurrent RCU readers will see | ||
| 899 | * any prior initialization. | ||
| 900 | * | ||
| 901 | * Inserts memory barriers on architectures that require them | ||
| 902 | * (which is most of them), and also prevents the compiler from | ||
| 903 | * reordering the code that initializes the structure after the pointer | ||
| 904 | * assignment. More importantly, this call documents which pointers | ||
| 905 | * will be dereferenced by RCU read-side code. | ||
| 906 | * | ||
| 907 | * In some special cases, you may use RCU_INIT_POINTER() instead | ||
| 908 | * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due | ||
| 909 | * to the fact that it does not constrain either the CPU or the compiler. | ||
| 910 | * That said, using RCU_INIT_POINTER() when you should have used | ||
| 911 | * rcu_assign_pointer() is a very bad thing that results in | ||
| 912 | * impossible-to-diagnose memory corruption. So please be careful. | ||
| 913 | * See the RCU_INIT_POINTER() comment header for details. | ||
| 914 | */ | ||
| 915 | #define rcu_assign_pointer(p, v) \ | ||
| 916 | __rcu_assign_pointer((p), (v), __rcu) | ||
| 917 | |||
| 918 | /** | ||
| 919 | * RCU_INIT_POINTER() - initialize an RCU protected pointer | 932 | * RCU_INIT_POINTER() - initialize an RCU protected pointer |
| 920 | * | 933 | * |
| 921 | * Initialize an RCU-protected pointer in special cases where readers | 934 | * Initialize an RCU-protected pointer in special cases where readers |
| @@ -949,7 +962,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
| 949 | */ | 962 | */ |
| 950 | #define RCU_INIT_POINTER(p, v) \ | 963 | #define RCU_INIT_POINTER(p, v) \ |
| 951 | do { \ | 964 | do { \ |
| 952 | p = (typeof(*v) __force __rcu *)(v); \ | 965 | p = RCU_INITIALIZER(v); \ |
| 953 | } while (0) | 966 | } while (0) |
| 954 | 967 | ||
| 955 | /** | 968 | /** |
| @@ -958,7 +971,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
| 958 | * GCC-style initialization for an RCU-protected pointer in a structure field. | 971 | * GCC-style initialization for an RCU-protected pointer in a structure field. |
| 959 | */ | 972 | */ |
| 960 | #define RCU_POINTER_INITIALIZER(p, v) \ | 973 | #define RCU_POINTER_INITIALIZER(p, v) \ |
| 961 | .p = (typeof(*v) __force __rcu *)(v) | 974 | .p = RCU_INITIALIZER(v) |
| 962 | 975 | ||
| 963 | /* | 976 | /* |
| 964 | * Does the specified offset indicate that the corresponding rcu_head | 977 | * Does the specified offset indicate that the corresponding rcu_head |
| @@ -1005,7 +1018,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
| 1005 | __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) | 1018 | __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) |
| 1006 | 1019 | ||
| 1007 | #ifdef CONFIG_RCU_NOCB_CPU | 1020 | #ifdef CONFIG_RCU_NOCB_CPU |
| 1008 | extern bool rcu_is_nocb_cpu(int cpu); | 1021 | bool rcu_is_nocb_cpu(int cpu); |
| 1009 | #else | 1022 | #else |
| 1010 | static inline bool rcu_is_nocb_cpu(int cpu) { return false; } | 1023 | static inline bool rcu_is_nocb_cpu(int cpu) { return false; } |
| 1011 | #endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ | 1024 | #endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ |
| @@ -1013,8 +1026,8 @@ static inline bool rcu_is_nocb_cpu(int cpu) { return false; } | |||
| 1013 | 1026 | ||
| 1014 | /* Only for use by adaptive-ticks code. */ | 1027 | /* Only for use by adaptive-ticks code. */ |
| 1015 | #ifdef CONFIG_NO_HZ_FULL_SYSIDLE | 1028 | #ifdef CONFIG_NO_HZ_FULL_SYSIDLE |
| 1016 | extern bool rcu_sys_is_idle(void); | 1029 | bool rcu_sys_is_idle(void); |
| 1017 | extern void rcu_sysidle_force_exit(void); | 1030 | void rcu_sysidle_force_exit(void); |
| 1018 | #else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */ | 1031 | #else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */ |
| 1019 | 1032 | ||
| 1020 | static inline bool rcu_sys_is_idle(void) | 1033 | static inline bool rcu_sys_is_idle(void) |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 09ebcbe9fd78..6f01771b571c 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
| @@ -125,7 +125,7 @@ static inline void exit_rcu(void) | |||
| 125 | 125 | ||
| 126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 127 | extern int rcu_scheduler_active __read_mostly; | 127 | extern int rcu_scheduler_active __read_mostly; |
| 128 | extern void rcu_scheduler_starting(void); | 128 | void rcu_scheduler_starting(void); |
| 129 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 129 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
| 130 | static inline void rcu_scheduler_starting(void) | 130 | static inline void rcu_scheduler_starting(void) |
| 131 | { | 131 | { |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 4b9c81548742..72137ee8c603 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
| @@ -30,9 +30,9 @@ | |||
| 30 | #ifndef __LINUX_RCUTREE_H | 30 | #ifndef __LINUX_RCUTREE_H |
| 31 | #define __LINUX_RCUTREE_H | 31 | #define __LINUX_RCUTREE_H |
| 32 | 32 | ||
| 33 | extern void rcu_note_context_switch(int cpu); | 33 | void rcu_note_context_switch(int cpu); |
| 34 | extern int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); | 34 | int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); |
| 35 | extern void rcu_cpu_stall_reset(void); | 35 | void rcu_cpu_stall_reset(void); |
| 36 | 36 | ||
| 37 | /* | 37 | /* |
| 38 | * Note a virtualization-based context switch. This is simply a | 38 | * Note a virtualization-based context switch. This is simply a |
| @@ -44,9 +44,9 @@ static inline void rcu_virt_note_context_switch(int cpu) | |||
| 44 | rcu_note_context_switch(cpu); | 44 | rcu_note_context_switch(cpu); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | extern void synchronize_rcu_bh(void); | 47 | void synchronize_rcu_bh(void); |
| 48 | extern void synchronize_sched_expedited(void); | 48 | void synchronize_sched_expedited(void); |
| 49 | extern void synchronize_rcu_expedited(void); | 49 | void synchronize_rcu_expedited(void); |
| 50 | 50 | ||
| 51 | void kfree_call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); | 51 | void kfree_call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); |
| 52 | 52 | ||
| @@ -71,25 +71,25 @@ static inline void synchronize_rcu_bh_expedited(void) | |||
| 71 | synchronize_sched_expedited(); | 71 | synchronize_sched_expedited(); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | extern void rcu_barrier(void); | 74 | void rcu_barrier(void); |
| 75 | extern void rcu_barrier_bh(void); | 75 | void rcu_barrier_bh(void); |
| 76 | extern void rcu_barrier_sched(void); | 76 | void rcu_barrier_sched(void); |
| 77 | 77 | ||
| 78 | extern unsigned long rcutorture_testseq; | 78 | extern unsigned long rcutorture_testseq; |
| 79 | extern unsigned long rcutorture_vernum; | 79 | extern unsigned long rcutorture_vernum; |
| 80 | extern long rcu_batches_completed(void); | 80 | long rcu_batches_completed(void); |
| 81 | extern long rcu_batches_completed_bh(void); | 81 | long rcu_batches_completed_bh(void); |
| 82 | extern long rcu_batches_completed_sched(void); | 82 | long rcu_batches_completed_sched(void); |
| 83 | 83 | ||
| 84 | extern void rcu_force_quiescent_state(void); | 84 | void rcu_force_quiescent_state(void); |
| 85 | extern void rcu_bh_force_quiescent_state(void); | 85 | void rcu_bh_force_quiescent_state(void); |
| 86 | extern void rcu_sched_force_quiescent_state(void); | 86 | void rcu_sched_force_quiescent_state(void); |
| 87 | 87 | ||
| 88 | extern void exit_rcu(void); | 88 | void exit_rcu(void); |
| 89 | 89 | ||
| 90 | extern void rcu_scheduler_starting(void); | 90 | void rcu_scheduler_starting(void); |
| 91 | extern int rcu_scheduler_active __read_mostly; | 91 | extern int rcu_scheduler_active __read_mostly; |
| 92 | 92 | ||
| 93 | extern bool rcu_is_watching(void); | 93 | bool rcu_is_watching(void); |
| 94 | 94 | ||
| 95 | #endif /* __LINUX_RCUTREE_H */ | 95 | #endif /* __LINUX_RCUTREE_H */ |
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 8e00f9f6f963..9e7db9e73cc1 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
| @@ -43,6 +43,7 @@ extern int unregister_reboot_notifier(struct notifier_block *); | |||
| 43 | * Architecture-specific implementations of sys_reboot commands. | 43 | * Architecture-specific implementations of sys_reboot commands. |
| 44 | */ | 44 | */ |
| 45 | 45 | ||
| 46 | extern void migrate_to_reboot_cpu(void); | ||
| 46 | extern void machine_restart(char *cmd); | 47 | extern void machine_restart(char *cmd); |
| 47 | extern void machine_halt(void); | 48 | extern void machine_halt(void); |
| 48 | extern void machine_power_off(void); | 49 | extern void machine_power_off(void); |
diff --git a/include/linux/reciprocal_div.h b/include/linux/reciprocal_div.h index f9c90b33285b..8c5a3fb6c6c5 100644 --- a/include/linux/reciprocal_div.h +++ b/include/linux/reciprocal_div.h | |||
| @@ -4,29 +4,32 @@ | |||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | /* | 6 | /* |
| 7 | * This file describes reciprocical division. | 7 | * This algorithm is based on the paper "Division by Invariant |
| 8 | * Integers Using Multiplication" by Torbjörn Granlund and Peter | ||
| 9 | * L. Montgomery. | ||
| 8 | * | 10 | * |
| 9 | * This optimizes the (A/B) problem, when A and B are two u32 | 11 | * The assembler implementation from Agner Fog, which this code is |
| 10 | * and B is a known value (but not known at compile time) | 12 | * based on, can be found here: |
| 13 | * http://www.agner.org/optimize/asmlib.zip | ||
| 11 | * | 14 | * |
| 12 | * The math principle used is : | 15 | * This optimization for A/B is helpful if the divisor B is mostly |
| 13 | * Let RECIPROCAL_VALUE(B) be (((1LL << 32) + (B - 1))/ B) | 16 | * runtime invariant. The reciprocal of B is calculated in the |
| 14 | * Then A / B = (u32)(((u64)(A) * (R)) >> 32) | 17 | * slow-path with reciprocal_value(). The fast-path can then just use |
| 15 | * | 18 | * a much faster multiplication operation with a variable dividend A |
| 16 | * This replaces a divide by a multiply (and a shift), and | 19 | * to calculate the division A/B. |
| 17 | * is generally less expensive in CPU cycles. | ||
| 18 | */ | 20 | */ |
| 19 | 21 | ||
| 20 | /* | 22 | struct reciprocal_value { |
| 21 | * Computes the reciprocal value (R) for the value B of the divisor. | 23 | u32 m; |
| 22 | * Should not be called before each reciprocal_divide(), | 24 | u8 sh1, sh2; |
| 23 | * or else the performance is slower than a normal divide. | 25 | }; |
| 24 | */ | ||
| 25 | extern u32 reciprocal_value(u32 B); | ||
| 26 | 26 | ||
| 27 | struct reciprocal_value reciprocal_value(u32 d); | ||
| 27 | 28 | ||
| 28 | static inline u32 reciprocal_divide(u32 A, u32 R) | 29 | static inline u32 reciprocal_divide(u32 a, struct reciprocal_value R) |
| 29 | { | 30 | { |
| 30 | return (u32)(((u64)A * R) >> 32); | 31 | u32 t = (u32)(((u64)a * R.m) >> 32); |
| 32 | return (t + ((a - t) >> R.sh1)) >> R.sh2; | ||
| 31 | } | 33 | } |
| 32 | #endif | 34 | |
| 35 | #endif /* _LINUX_RECIPROCAL_DIV_H */ | ||
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index e55907804d39..4149f1a9b003 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
| @@ -122,9 +122,9 @@ typedef void (*regmap_unlock)(void *); | |||
| 122 | * volatile_table (see below) is not, the check is performed on | 122 | * volatile_table (see below) is not, the check is performed on |
| 123 | * such table (a register is volatile if it belongs to one of | 123 | * such table (a register is volatile if it belongs to one of |
| 124 | * the ranges specified by volatile_table). | 124 | * the ranges specified by volatile_table). |
| 125 | * @precious_reg: Optional callback returning true if the rgister | 125 | * @precious_reg: Optional callback returning true if the register |
| 126 | * should not be read outside of a call from the driver | 126 | * should not be read outside of a call from the driver |
| 127 | * (eg, a clear on read interrupt status register). If this | 127 | * (e.g., a clear on read interrupt status register). If this |
| 128 | * field is NULL but precious_table (see below) is not, the | 128 | * field is NULL but precious_table (see below) is not, the |
| 129 | * check is performed on such table (a register is precious if | 129 | * check is performed on such table (a register is precious if |
| 130 | * it belongs to one of the ranges specified by precious_table). | 130 | * it belongs to one of the ranges specified by precious_table). |
| @@ -136,9 +136,9 @@ typedef void (*regmap_unlock)(void *); | |||
| 136 | * are not overridden). | 136 | * are not overridden). |
| 137 | * @reg_read: Optional callback that if filled will be used to perform | 137 | * @reg_read: Optional callback that if filled will be used to perform |
| 138 | * all the reads from the registers. Should only be provided for | 138 | * all the reads from the registers. Should only be provided for |
| 139 | * devices whos read operation cannot be represented as a simple read | 139 | * devices whose read operation cannot be represented as a simple |
| 140 | * operation on a bus such as SPI, I2C, etc. Most of the devices do | 140 | * read operation on a bus such as SPI, I2C, etc. Most of the |
| 141 | * not need this. | 141 | * devices do not need this. |
| 142 | * @reg_write: Same as above for writing. | 142 | * @reg_write: Same as above for writing. |
| 143 | * @fast_io: Register IO is fast. Use a spinlock instead of a mutex | 143 | * @fast_io: Register IO is fast. Use a spinlock instead of a mutex |
| 144 | * to perform locking. This field is ignored if custom lock/unlock | 144 | * to perform locking. This field is ignored if custom lock/unlock |
| @@ -497,11 +497,13 @@ struct regmap_irq { | |||
| 497 | * | 497 | * |
| 498 | * @status_base: Base status register address. | 498 | * @status_base: Base status register address. |
| 499 | * @mask_base: Base mask register address. | 499 | * @mask_base: Base mask register address. |
| 500 | * @ack_base: Base ack address. If zero then the chip is clear on read. | 500 | * @ack_base: Base ack address. If zero then the chip is clear on read. |
| 501 | * Using zero value is possible with @use_ack bit. | ||
| 501 | * @wake_base: Base address for wake enables. If zero unsupported. | 502 | * @wake_base: Base address for wake enables. If zero unsupported. |
| 502 | * @irq_reg_stride: Stride to use for chips where registers are not contiguous. | 503 | * @irq_reg_stride: Stride to use for chips where registers are not contiguous. |
| 503 | * @init_ack_masked: Ack all masked interrupts once during initalization. | 504 | * @init_ack_masked: Ack all masked interrupts once during initalization. |
| 504 | * @mask_invert: Inverted mask register: cleared bits are masked out. | 505 | * @mask_invert: Inverted mask register: cleared bits are masked out. |
| 506 | * @use_ack: Use @ack register even if it is zero. | ||
| 505 | * @wake_invert: Inverted wake register: cleared bits are wake enabled. | 507 | * @wake_invert: Inverted wake register: cleared bits are wake enabled. |
| 506 | * @runtime_pm: Hold a runtime PM lock on the device when accessing it. | 508 | * @runtime_pm: Hold a runtime PM lock on the device when accessing it. |
| 507 | * | 509 | * |
| @@ -520,6 +522,7 @@ struct regmap_irq_chip { | |||
| 520 | unsigned int irq_reg_stride; | 522 | unsigned int irq_reg_stride; |
| 521 | bool init_ack_masked:1; | 523 | bool init_ack_masked:1; |
| 522 | bool mask_invert:1; | 524 | bool mask_invert:1; |
| 525 | bool use_ack:1; | ||
| 523 | bool wake_invert:1; | 526 | bool wake_invert:1; |
| 524 | bool runtime_pm:1; | 527 | bool runtime_pm:1; |
| 525 | 528 | ||
diff --git a/include/linux/regulator/act8865.h b/include/linux/regulator/act8865.h new file mode 100644 index 000000000000..49206c1b4905 --- /dev/null +++ b/include/linux/regulator/act8865.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /* | ||
| 2 | * act8865.h -- Voltage regulation for the active-semi act8865 | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Atmel Corporation. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; version 2 of the License. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef __LINUX_REGULATOR_ACT8865_H | ||
| 17 | #define __LINUX_REGULATOR_ACT8865_H | ||
| 18 | |||
| 19 | #include <linux/regulator/machine.h> | ||
| 20 | |||
| 21 | enum { | ||
| 22 | ACT8865_ID_DCDC1, | ||
| 23 | ACT8865_ID_DCDC2, | ||
| 24 | ACT8865_ID_DCDC3, | ||
| 25 | ACT8865_ID_LDO1, | ||
| 26 | ACT8865_ID_LDO2, | ||
| 27 | ACT8865_ID_LDO3, | ||
| 28 | ACT8865_ID_LDO4, | ||
| 29 | ACT8865_REG_NUM, | ||
| 30 | }; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * act8865_regulator_data - regulator data | ||
| 34 | * @id: regulator id | ||
| 35 | * @name: regulator name | ||
| 36 | * @platform_data: regulator init data | ||
| 37 | */ | ||
| 38 | struct act8865_regulator_data { | ||
| 39 | int id; | ||
| 40 | const char *name; | ||
| 41 | struct regulator_init_data *platform_data; | ||
| 42 | }; | ||
| 43 | |||
| 44 | /** | ||
| 45 | * act8865_platform_data - platform data for act8865 | ||
| 46 | * @num_regulators: number of regulators used | ||
| 47 | * @regulators: pointer to regulators used | ||
| 48 | */ | ||
| 49 | struct act8865_platform_data { | ||
| 50 | int num_regulators; | ||
| 51 | struct act8865_regulator_data *regulators; | ||
| 52 | }; | ||
| 53 | #endif | ||
diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h index 2f61311ae3e0..41a4695fde08 100644 --- a/include/linux/reset-controller.h +++ b/include/linux/reset-controller.h | |||
| @@ -21,6 +21,7 @@ struct reset_control_ops { | |||
| 21 | 21 | ||
| 22 | struct module; | 22 | struct module; |
| 23 | struct device_node; | 23 | struct device_node; |
| 24 | struct of_phandle_args; | ||
| 24 | 25 | ||
| 25 | /** | 26 | /** |
| 26 | * struct reset_controller_dev - reset controller entity that might | 27 | * struct reset_controller_dev - reset controller entity that might |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 6dacb93a6d94..1da693d51255 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
| @@ -184,13 +184,13 @@ static inline void page_dup_rmap(struct page *page) | |||
| 184 | int page_referenced(struct page *, int is_locked, | 184 | int page_referenced(struct page *, int is_locked, |
| 185 | struct mem_cgroup *memcg, unsigned long *vm_flags); | 185 | struct mem_cgroup *memcg, unsigned long *vm_flags); |
| 186 | int page_referenced_one(struct page *, struct vm_area_struct *, | 186 | int page_referenced_one(struct page *, struct vm_area_struct *, |
| 187 | unsigned long address, unsigned int *mapcount, unsigned long *vm_flags); | 187 | unsigned long address, void *arg); |
| 188 | 188 | ||
| 189 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) | 189 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) |
| 190 | 190 | ||
| 191 | int try_to_unmap(struct page *, enum ttu_flags flags); | 191 | int try_to_unmap(struct page *, enum ttu_flags flags); |
| 192 | int try_to_unmap_one(struct page *, struct vm_area_struct *, | 192 | int try_to_unmap_one(struct page *, struct vm_area_struct *, |
| 193 | unsigned long address, enum ttu_flags flags); | 193 | unsigned long address, void *arg); |
| 194 | 194 | ||
| 195 | /* | 195 | /* |
| 196 | * Called from mm/filemap_xip.c to unmap empty zero page | 196 | * Called from mm/filemap_xip.c to unmap empty zero page |
| @@ -236,10 +236,27 @@ void page_unlock_anon_vma_read(struct anon_vma *anon_vma); | |||
| 236 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | 236 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); |
| 237 | 237 | ||
| 238 | /* | 238 | /* |
| 239 | * Called by migrate.c to remove migration ptes, but might be used more later. | 239 | * rmap_walk_control: To control rmap traversing for specific needs |
| 240 | * | ||
| 241 | * arg: passed to rmap_one() and invalid_vma() | ||
| 242 | * rmap_one: executed on each vma where page is mapped | ||
| 243 | * done: for checking traversing termination condition | ||
| 244 | * file_nonlinear: for handling file nonlinear mapping | ||
| 245 | * anon_lock: for getting anon_lock by optimized way rather than default | ||
| 246 | * invalid_vma: for skipping uninterested vma | ||
| 240 | */ | 247 | */ |
| 241 | int rmap_walk(struct page *page, int (*rmap_one)(struct page *, | 248 | struct rmap_walk_control { |
| 242 | struct vm_area_struct *, unsigned long, void *), void *arg); | 249 | void *arg; |
| 250 | int (*rmap_one)(struct page *page, struct vm_area_struct *vma, | ||
| 251 | unsigned long addr, void *arg); | ||
| 252 | int (*done)(struct page *page); | ||
| 253 | int (*file_nonlinear)(struct page *, struct address_space *, | ||
| 254 | struct vm_area_struct *vma); | ||
| 255 | struct anon_vma *(*anon_lock)(struct page *page); | ||
| 256 | bool (*invalid_vma)(struct vm_area_struct *vma, void *arg); | ||
| 257 | }; | ||
| 258 | |||
| 259 | int rmap_walk(struct page *page, struct rmap_walk_control *rwc); | ||
| 243 | 260 | ||
| 244 | #else /* !CONFIG_MMU */ | 261 | #else /* !CONFIG_MMU */ |
| 245 | 262 | ||
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h index de17134244f3..3aed8d737e1a 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | #define __LINUX_RT_MUTEX_H | 13 | #define __LINUX_RT_MUTEX_H |
| 14 | 14 | ||
| 15 | #include <linux/linkage.h> | 15 | #include <linux/linkage.h> |
| 16 | #include <linux/plist.h> | 16 | #include <linux/rbtree.h> |
| 17 | #include <linux/spinlock_types.h> | 17 | #include <linux/spinlock_types.h> |
| 18 | 18 | ||
| 19 | extern int max_lock_depth; /* for sysctl */ | 19 | extern int max_lock_depth; /* for sysctl */ |
| @@ -22,12 +22,14 @@ extern int max_lock_depth; /* for sysctl */ | |||
| 22 | * The rt_mutex structure | 22 | * The rt_mutex structure |
| 23 | * | 23 | * |
| 24 | * @wait_lock: spinlock to protect the structure | 24 | * @wait_lock: spinlock to protect the structure |
| 25 | * @wait_list: pilist head to enqueue waiters in priority order | 25 | * @waiters: rbtree root to enqueue waiters in priority order |
| 26 | * @waiters_leftmost: top waiter | ||
| 26 | * @owner: the mutex owner | 27 | * @owner: the mutex owner |
| 27 | */ | 28 | */ |
| 28 | struct rt_mutex { | 29 | struct rt_mutex { |
| 29 | raw_spinlock_t wait_lock; | 30 | raw_spinlock_t wait_lock; |
| 30 | struct plist_head wait_list; | 31 | struct rb_root waiters; |
| 32 | struct rb_node *waiters_leftmost; | ||
| 31 | struct task_struct *owner; | 33 | struct task_struct *owner; |
| 32 | #ifdef CONFIG_DEBUG_RT_MUTEXES | 34 | #ifdef CONFIG_DEBUG_RT_MUTEXES |
| 33 | int save_state; | 35 | int save_state; |
| @@ -66,7 +68,7 @@ struct hrtimer_sleeper; | |||
| 66 | 68 | ||
| 67 | #define __RT_MUTEX_INITIALIZER(mutexname) \ | 69 | #define __RT_MUTEX_INITIALIZER(mutexname) \ |
| 68 | { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ | 70 | { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ |
| 69 | , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list) \ | 71 | , .waiters = RB_ROOT \ |
| 70 | , .owner = NULL \ | 72 | , .owner = NULL \ |
| 71 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} | 73 | __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} |
| 72 | 74 | ||
| @@ -98,12 +100,4 @@ extern int rt_mutex_trylock(struct rt_mutex *lock); | |||
| 98 | 100 | ||
| 99 | extern void rt_mutex_unlock(struct rt_mutex *lock); | 101 | extern void rt_mutex_unlock(struct rt_mutex *lock); |
| 100 | 102 | ||
| 101 | #ifdef CONFIG_RT_MUTEXES | ||
| 102 | # define INIT_RT_MUTEXES(tsk) \ | ||
| 103 | .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters), \ | ||
| 104 | INIT_RT_MUTEX_DEBUG(tsk) | ||
| 105 | #else | ||
| 106 | # define INIT_RT_MUTEXES(tsk) | ||
| 107 | #endif | ||
| 108 | |||
| 109 | #endif | 103 | #endif |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 939428ad25ac..8e3e66ac0a52 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
| @@ -24,6 +24,11 @@ extern int rtnl_trylock(void); | |||
| 24 | extern int rtnl_is_locked(void); | 24 | extern int rtnl_is_locked(void); |
| 25 | #ifdef CONFIG_PROVE_LOCKING | 25 | #ifdef CONFIG_PROVE_LOCKING |
| 26 | extern int lockdep_rtnl_is_held(void); | 26 | extern int lockdep_rtnl_is_held(void); |
| 27 | #else | ||
| 28 | static inline int lockdep_rtnl_is_held(void) | ||
| 29 | { | ||
| 30 | return 1; | ||
| 31 | } | ||
| 27 | #endif /* #ifdef CONFIG_PROVE_LOCKING */ | 32 | #endif /* #ifdef CONFIG_PROVE_LOCKING */ |
| 28 | 33 | ||
| 29 | /** | 34 | /** |
diff --git a/include/linux/rwlock_api_smp.h b/include/linux/rwlock_api_smp.h index 9c9f0495d37c..5b9b84b20407 100644 --- a/include/linux/rwlock_api_smp.h +++ b/include/linux/rwlock_api_smp.h | |||
| @@ -172,8 +172,7 @@ static inline void __raw_read_lock_irq(rwlock_t *lock) | |||
| 172 | 172 | ||
| 173 | static inline void __raw_read_lock_bh(rwlock_t *lock) | 173 | static inline void __raw_read_lock_bh(rwlock_t *lock) |
| 174 | { | 174 | { |
| 175 | local_bh_disable(); | 175 | __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 176 | preempt_disable(); | ||
| 177 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | 176 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); |
| 178 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); | 177 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); |
| 179 | } | 178 | } |
| @@ -200,8 +199,7 @@ static inline void __raw_write_lock_irq(rwlock_t *lock) | |||
| 200 | 199 | ||
| 201 | static inline void __raw_write_lock_bh(rwlock_t *lock) | 200 | static inline void __raw_write_lock_bh(rwlock_t *lock) |
| 202 | { | 201 | { |
| 203 | local_bh_disable(); | 202 | __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 204 | preempt_disable(); | ||
| 205 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 203 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
| 206 | LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); | 204 | LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); |
| 207 | } | 205 | } |
| @@ -250,8 +248,7 @@ static inline void __raw_read_unlock_bh(rwlock_t *lock) | |||
| 250 | { | 248 | { |
| 251 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 249 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
| 252 | do_raw_read_unlock(lock); | 250 | do_raw_read_unlock(lock); |
| 253 | preempt_enable_no_resched(); | 251 | __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 254 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 255 | } | 252 | } |
| 256 | 253 | ||
| 257 | static inline void __raw_write_unlock_irqrestore(rwlock_t *lock, | 254 | static inline void __raw_write_unlock_irqrestore(rwlock_t *lock, |
| @@ -275,8 +272,7 @@ static inline void __raw_write_unlock_bh(rwlock_t *lock) | |||
| 275 | { | 272 | { |
| 276 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 273 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
| 277 | do_raw_write_unlock(lock); | 274 | do_raw_write_unlock(lock); |
| 278 | preempt_enable_no_resched(); | 275 | __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 279 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 280 | } | 276 | } |
| 281 | 277 | ||
| 282 | #endif /* __LINUX_RWLOCK_API_SMP_H */ | 278 | #endif /* __LINUX_RWLOCK_API_SMP_H */ |
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index adae88f5b0ab..a964f7285600 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
| @@ -345,6 +345,7 @@ struct sg_mapping_iter { | |||
| 345 | 345 | ||
| 346 | void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl, | 346 | void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl, |
| 347 | unsigned int nents, unsigned int flags); | 347 | unsigned int nents, unsigned int flags); |
| 348 | bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset); | ||
| 348 | bool sg_miter_next(struct sg_mapping_iter *miter); | 349 | bool sg_miter_next(struct sg_mapping_iter *miter); |
| 349 | void sg_miter_stop(struct sg_mapping_iter *miter); | 350 | void sg_miter_stop(struct sg_mapping_iter *miter); |
| 350 | 351 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 7e35d4b9e14a..68a0e84463a0 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -16,6 +16,7 @@ struct sched_param { | |||
| 16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
| 17 | #include <linux/timex.h> | 17 | #include <linux/timex.h> |
| 18 | #include <linux/jiffies.h> | 18 | #include <linux/jiffies.h> |
| 19 | #include <linux/plist.h> | ||
| 19 | #include <linux/rbtree.h> | 20 | #include <linux/rbtree.h> |
| 20 | #include <linux/thread_info.h> | 21 | #include <linux/thread_info.h> |
| 21 | #include <linux/cpumask.h> | 22 | #include <linux/cpumask.h> |
| @@ -56,6 +57,70 @@ struct sched_param { | |||
| 56 | 57 | ||
| 57 | #include <asm/processor.h> | 58 | #include <asm/processor.h> |
| 58 | 59 | ||
| 60 | #define SCHED_ATTR_SIZE_VER0 48 /* sizeof first published struct */ | ||
| 61 | |||
| 62 | /* | ||
| 63 | * Extended scheduling parameters data structure. | ||
| 64 | * | ||
| 65 | * This is needed because the original struct sched_param can not be | ||
| 66 | * altered without introducing ABI issues with legacy applications | ||
| 67 | * (e.g., in sched_getparam()). | ||
| 68 | * | ||
| 69 | * However, the possibility of specifying more than just a priority for | ||
| 70 | * the tasks may be useful for a wide variety of application fields, e.g., | ||
| 71 | * multimedia, streaming, automation and control, and many others. | ||
| 72 | * | ||
| 73 | * This variant (sched_attr) is meant at describing a so-called | ||
| 74 | * sporadic time-constrained task. In such model a task is specified by: | ||
| 75 | * - the activation period or minimum instance inter-arrival time; | ||
| 76 | * - the maximum (or average, depending on the actual scheduling | ||
| 77 | * discipline) computation time of all instances, a.k.a. runtime; | ||
| 78 | * - the deadline (relative to the actual activation time) of each | ||
| 79 | * instance. | ||
| 80 | * Very briefly, a periodic (sporadic) task asks for the execution of | ||
| 81 | * some specific computation --which is typically called an instance-- | ||
| 82 | * (at most) every period. Moreover, each instance typically lasts no more | ||
| 83 | * than the runtime and must be completed by time instant t equal to | ||
| 84 | * the instance activation time + the deadline. | ||
| 85 | * | ||
| 86 | * This is reflected by the actual fields of the sched_attr structure: | ||
| 87 | * | ||
| 88 | * @size size of the structure, for fwd/bwd compat. | ||
| 89 | * | ||
| 90 | * @sched_policy task's scheduling policy | ||
| 91 | * @sched_flags for customizing the scheduler behaviour | ||
| 92 | * @sched_nice task's nice value (SCHED_NORMAL/BATCH) | ||
| 93 | * @sched_priority task's static priority (SCHED_FIFO/RR) | ||
| 94 | * @sched_deadline representative of the task's deadline | ||
| 95 | * @sched_runtime representative of the task's runtime | ||
| 96 | * @sched_period representative of the task's period | ||
| 97 | * | ||
| 98 | * Given this task model, there are a multiplicity of scheduling algorithms | ||
| 99 | * and policies, that can be used to ensure all the tasks will make their | ||
| 100 | * timing constraints. | ||
| 101 | * | ||
| 102 | * As of now, the SCHED_DEADLINE policy (sched_dl scheduling class) is the | ||
| 103 | * only user of this new interface. More information about the algorithm | ||
| 104 | * available in the scheduling class file or in Documentation/. | ||
| 105 | */ | ||
| 106 | struct sched_attr { | ||
| 107 | u32 size; | ||
| 108 | |||
| 109 | u32 sched_policy; | ||
| 110 | u64 sched_flags; | ||
| 111 | |||
| 112 | /* SCHED_NORMAL, SCHED_BATCH */ | ||
| 113 | s32 sched_nice; | ||
| 114 | |||
| 115 | /* SCHED_FIFO, SCHED_RR */ | ||
| 116 | u32 sched_priority; | ||
| 117 | |||
| 118 | /* SCHED_DEADLINE */ | ||
| 119 | u64 sched_runtime; | ||
| 120 | u64 sched_deadline; | ||
| 121 | u64 sched_period; | ||
| 122 | }; | ||
| 123 | |||
| 59 | struct exec_domain; | 124 | struct exec_domain; |
| 60 | struct futex_pi_state; | 125 | struct futex_pi_state; |
| 61 | struct robust_list_head; | 126 | struct robust_list_head; |
| @@ -164,11 +229,10 @@ extern char ___assert_task_state[1 - 2*!!( | |||
| 164 | /* get_task_state() */ | 229 | /* get_task_state() */ |
| 165 | #define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \ | 230 | #define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \ |
| 166 | TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \ | 231 | TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \ |
| 167 | __TASK_TRACED) | 232 | __TASK_TRACED | EXIT_ZOMBIE | EXIT_DEAD) |
| 168 | 233 | ||
| 169 | #define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) | 234 | #define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) |
| 170 | #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) | 235 | #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) |
| 171 | #define task_is_dead(task) ((task)->exit_state != 0) | ||
| 172 | #define task_is_stopped_or_traced(task) \ | 236 | #define task_is_stopped_or_traced(task) \ |
| 173 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) | 237 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) |
| 174 | #define task_contributes_to_load(task) \ | 238 | #define task_contributes_to_load(task) \ |
| @@ -327,22 +391,33 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | |||
| 327 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | 391 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} |
| 328 | #endif | 392 | #endif |
| 329 | 393 | ||
| 330 | |||
| 331 | extern void set_dumpable(struct mm_struct *mm, int value); | ||
| 332 | extern int get_dumpable(struct mm_struct *mm); | ||
| 333 | |||
| 334 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ | 394 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ |
| 335 | #define SUID_DUMP_USER 1 /* Dump as user of process */ | 395 | #define SUID_DUMP_USER 1 /* Dump as user of process */ |
| 336 | #define SUID_DUMP_ROOT 2 /* Dump as root */ | 396 | #define SUID_DUMP_ROOT 2 /* Dump as root */ |
| 337 | 397 | ||
| 338 | /* mm flags */ | 398 | /* mm flags */ |
| 339 | /* dumpable bits */ | ||
| 340 | #define MMF_DUMPABLE 0 /* core dump is permitted */ | ||
| 341 | #define MMF_DUMP_SECURELY 1 /* core file is readable only by root */ | ||
| 342 | 399 | ||
| 400 | /* for SUID_DUMP_* above */ | ||
| 343 | #define MMF_DUMPABLE_BITS 2 | 401 | #define MMF_DUMPABLE_BITS 2 |
| 344 | #define MMF_DUMPABLE_MASK ((1 << MMF_DUMPABLE_BITS) - 1) | 402 | #define MMF_DUMPABLE_MASK ((1 << MMF_DUMPABLE_BITS) - 1) |
| 345 | 403 | ||
| 404 | extern void set_dumpable(struct mm_struct *mm, int value); | ||
| 405 | /* | ||
| 406 | * This returns the actual value of the suid_dumpable flag. For things | ||
| 407 | * that are using this for checking for privilege transitions, it must | ||
| 408 | * test against SUID_DUMP_USER rather than treating it as a boolean | ||
| 409 | * value. | ||
| 410 | */ | ||
| 411 | static inline int __get_dumpable(unsigned long mm_flags) | ||
| 412 | { | ||
| 413 | return mm_flags & MMF_DUMPABLE_MASK; | ||
| 414 | } | ||
| 415 | |||
| 416 | static inline int get_dumpable(struct mm_struct *mm) | ||
| 417 | { | ||
| 418 | return __get_dumpable(mm->flags); | ||
| 419 | } | ||
| 420 | |||
| 346 | /* coredump filter bits */ | 421 | /* coredump filter bits */ |
| 347 | #define MMF_DUMP_ANON_PRIVATE 2 | 422 | #define MMF_DUMP_ANON_PRIVATE 2 |
| 348 | #define MMF_DUMP_ANON_SHARED 3 | 423 | #define MMF_DUMP_ANON_SHARED 3 |
| @@ -440,8 +515,6 @@ struct task_cputime { | |||
| 440 | .sum_exec_runtime = 0, \ | 515 | .sum_exec_runtime = 0, \ |
| 441 | } | 516 | } |
| 442 | 517 | ||
| 443 | #define PREEMPT_ENABLED (PREEMPT_NEED_RESCHED) | ||
| 444 | |||
| 445 | #ifdef CONFIG_PREEMPT_COUNT | 518 | #ifdef CONFIG_PREEMPT_COUNT |
| 446 | #define PREEMPT_DISABLED (1 + PREEMPT_ENABLED) | 519 | #define PREEMPT_DISABLED (1 + PREEMPT_ENABLED) |
| 447 | #else | 520 | #else |
| @@ -487,6 +560,7 @@ struct signal_struct { | |||
| 487 | atomic_t sigcnt; | 560 | atomic_t sigcnt; |
| 488 | atomic_t live; | 561 | atomic_t live; |
| 489 | int nr_threads; | 562 | int nr_threads; |
| 563 | struct list_head thread_head; | ||
| 490 | 564 | ||
| 491 | wait_queue_head_t wait_chldexit; /* for wait4() */ | 565 | wait_queue_head_t wait_chldexit; /* for wait4() */ |
| 492 | 566 | ||
| @@ -831,8 +905,6 @@ struct sched_domain { | |||
| 831 | unsigned int balance_interval; /* initialise to 1. units in ms. */ | 905 | unsigned int balance_interval; /* initialise to 1. units in ms. */ |
| 832 | unsigned int nr_balance_failed; /* initialise to 0 */ | 906 | unsigned int nr_balance_failed; /* initialise to 0 */ |
| 833 | 907 | ||
| 834 | u64 last_update; | ||
| 835 | |||
| 836 | /* idle_balance() stats */ | 908 | /* idle_balance() stats */ |
| 837 | u64 max_newidle_lb_cost; | 909 | u64 max_newidle_lb_cost; |
| 838 | unsigned long next_decay_max_lb_cost; | 910 | unsigned long next_decay_max_lb_cost; |
| @@ -934,7 +1006,8 @@ struct pipe_inode_info; | |||
| 934 | struct uts_namespace; | 1006 | struct uts_namespace; |
| 935 | 1007 | ||
| 936 | struct load_weight { | 1008 | struct load_weight { |
| 937 | unsigned long weight, inv_weight; | 1009 | unsigned long weight; |
| 1010 | u32 inv_weight; | ||
| 938 | }; | 1011 | }; |
| 939 | 1012 | ||
| 940 | struct sched_avg { | 1013 | struct sched_avg { |
| @@ -1032,6 +1105,51 @@ struct sched_rt_entity { | |||
| 1032 | #endif | 1105 | #endif |
| 1033 | }; | 1106 | }; |
| 1034 | 1107 | ||
| 1108 | struct sched_dl_entity { | ||
| 1109 | struct rb_node rb_node; | ||
| 1110 | |||
| 1111 | /* | ||
| 1112 | * Original scheduling parameters. Copied here from sched_attr | ||
| 1113 | * during sched_setscheduler2(), they will remain the same until | ||
| 1114 | * the next sched_setscheduler2(). | ||
| 1115 | */ | ||
| 1116 | u64 dl_runtime; /* maximum runtime for each instance */ | ||
| 1117 | u64 dl_deadline; /* relative deadline of each instance */ | ||
| 1118 | u64 dl_period; /* separation of two instances (period) */ | ||
| 1119 | u64 dl_bw; /* dl_runtime / dl_deadline */ | ||
| 1120 | |||
| 1121 | /* | ||
| 1122 | * Actual scheduling parameters. Initialized with the values above, | ||
| 1123 | * they are continously updated during task execution. Note that | ||
| 1124 | * the remaining runtime could be < 0 in case we are in overrun. | ||
| 1125 | */ | ||
| 1126 | s64 runtime; /* remaining runtime for this instance */ | ||
| 1127 | u64 deadline; /* absolute deadline for this instance */ | ||
| 1128 | unsigned int flags; /* specifying the scheduler behaviour */ | ||
| 1129 | |||
| 1130 | /* | ||
| 1131 | * Some bool flags: | ||
| 1132 | * | ||
| 1133 | * @dl_throttled tells if we exhausted the runtime. If so, the | ||
| 1134 | * task has to wait for a replenishment to be performed at the | ||
| 1135 | * next firing of dl_timer. | ||
| 1136 | * | ||
| 1137 | * @dl_new tells if a new instance arrived. If so we must | ||
| 1138 | * start executing it with full runtime and reset its absolute | ||
| 1139 | * deadline; | ||
| 1140 | * | ||
| 1141 | * @dl_boosted tells if we are boosted due to DI. If so we are | ||
| 1142 | * outside bandwidth enforcement mechanism (but only until we | ||
| 1143 | * exit the critical section). | ||
| 1144 | */ | ||
| 1145 | int dl_throttled, dl_new, dl_boosted; | ||
| 1146 | |||
| 1147 | /* | ||
| 1148 | * Bandwidth enforcement timer. Each -deadline task has its | ||
| 1149 | * own bandwidth to be enforced, thus we need one timer per task. | ||
| 1150 | */ | ||
| 1151 | struct hrtimer dl_timer; | ||
| 1152 | }; | ||
| 1035 | 1153 | ||
| 1036 | struct rcu_node; | 1154 | struct rcu_node; |
| 1037 | 1155 | ||
| @@ -1068,6 +1186,7 @@ struct task_struct { | |||
| 1068 | #ifdef CONFIG_CGROUP_SCHED | 1186 | #ifdef CONFIG_CGROUP_SCHED |
| 1069 | struct task_group *sched_task_group; | 1187 | struct task_group *sched_task_group; |
| 1070 | #endif | 1188 | #endif |
| 1189 | struct sched_dl_entity dl; | ||
| 1071 | 1190 | ||
| 1072 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 1191 | #ifdef CONFIG_PREEMPT_NOTIFIERS |
| 1073 | /* list of struct preempt_notifier: */ | 1192 | /* list of struct preempt_notifier: */ |
| @@ -1101,6 +1220,7 @@ struct task_struct { | |||
| 1101 | struct list_head tasks; | 1220 | struct list_head tasks; |
| 1102 | #ifdef CONFIG_SMP | 1221 | #ifdef CONFIG_SMP |
| 1103 | struct plist_node pushable_tasks; | 1222 | struct plist_node pushable_tasks; |
| 1223 | struct rb_node pushable_dl_tasks; | ||
| 1104 | #endif | 1224 | #endif |
| 1105 | 1225 | ||
| 1106 | struct mm_struct *mm, *active_mm; | 1226 | struct mm_struct *mm, *active_mm; |
| @@ -1119,7 +1239,6 @@ struct task_struct { | |||
| 1119 | /* Used for emulating ABI behavior of previous Linux versions */ | 1239 | /* Used for emulating ABI behavior of previous Linux versions */ |
| 1120 | unsigned int personality; | 1240 | unsigned int personality; |
| 1121 | 1241 | ||
| 1122 | unsigned did_exec:1; | ||
| 1123 | unsigned in_execve:1; /* Tell the LSMs that the process is doing an | 1242 | unsigned in_execve:1; /* Tell the LSMs that the process is doing an |
| 1124 | * execve */ | 1243 | * execve */ |
| 1125 | unsigned in_iowait:1; | 1244 | unsigned in_iowait:1; |
| @@ -1163,6 +1282,7 @@ struct task_struct { | |||
| 1163 | /* PID/PID hash table linkage. */ | 1282 | /* PID/PID hash table linkage. */ |
| 1164 | struct pid_link pids[PIDTYPE_MAX]; | 1283 | struct pid_link pids[PIDTYPE_MAX]; |
| 1165 | struct list_head thread_group; | 1284 | struct list_head thread_group; |
| 1285 | struct list_head thread_node; | ||
| 1166 | 1286 | ||
| 1167 | struct completion *vfork_done; /* for vfork() */ | 1287 | struct completion *vfork_done; /* for vfork() */ |
| 1168 | int __user *set_child_tid; /* CLONE_CHILD_SETTID */ | 1288 | int __user *set_child_tid; /* CLONE_CHILD_SETTID */ |
| @@ -1252,9 +1372,12 @@ struct task_struct { | |||
| 1252 | 1372 | ||
| 1253 | #ifdef CONFIG_RT_MUTEXES | 1373 | #ifdef CONFIG_RT_MUTEXES |
| 1254 | /* PI waiters blocked on a rt_mutex held by this task */ | 1374 | /* PI waiters blocked on a rt_mutex held by this task */ |
| 1255 | struct plist_head pi_waiters; | 1375 | struct rb_root pi_waiters; |
| 1376 | struct rb_node *pi_waiters_leftmost; | ||
| 1256 | /* Deadlock detection and priority inheritance handling */ | 1377 | /* Deadlock detection and priority inheritance handling */ |
| 1257 | struct rt_mutex_waiter *pi_blocked_on; | 1378 | struct rt_mutex_waiter *pi_blocked_on; |
| 1379 | /* Top pi_waiters task */ | ||
| 1380 | struct task_struct *pi_top_task; | ||
| 1258 | #endif | 1381 | #endif |
| 1259 | 1382 | ||
| 1260 | #ifdef CONFIG_DEBUG_MUTEXES | 1383 | #ifdef CONFIG_DEBUG_MUTEXES |
| @@ -1883,7 +2006,9 @@ static inline void sched_clock_idle_wakeup_event(u64 delta_ns) | |||
| 1883 | * but then during bootup it turns out that sched_clock() | 2006 | * but then during bootup it turns out that sched_clock() |
| 1884 | * is reliable after all: | 2007 | * is reliable after all: |
| 1885 | */ | 2008 | */ |
| 1886 | extern int sched_clock_stable; | 2009 | extern int sched_clock_stable(void); |
| 2010 | extern void set_sched_clock_stable(void); | ||
| 2011 | extern void clear_sched_clock_stable(void); | ||
| 1887 | 2012 | ||
| 1888 | extern void sched_clock_tick(void); | 2013 | extern void sched_clock_tick(void); |
| 1889 | extern void sched_clock_idle_sleep_event(void); | 2014 | extern void sched_clock_idle_sleep_event(void); |
| @@ -1962,6 +2087,8 @@ extern int sched_setscheduler(struct task_struct *, int, | |||
| 1962 | const struct sched_param *); | 2087 | const struct sched_param *); |
| 1963 | extern int sched_setscheduler_nocheck(struct task_struct *, int, | 2088 | extern int sched_setscheduler_nocheck(struct task_struct *, int, |
| 1964 | const struct sched_param *); | 2089 | const struct sched_param *); |
| 2090 | extern int sched_setattr(struct task_struct *, | ||
| 2091 | const struct sched_attr *); | ||
| 1965 | extern struct task_struct *idle_task(int cpu); | 2092 | extern struct task_struct *idle_task(int cpu); |
| 1966 | /** | 2093 | /** |
| 1967 | * is_idle_task - is the specified task an idle task? | 2094 | * is_idle_task - is the specified task an idle task? |
| @@ -2041,7 +2168,7 @@ extern void wake_up_new_task(struct task_struct *tsk); | |||
| 2041 | #else | 2168 | #else |
| 2042 | static inline void kick_process(struct task_struct *tsk) { } | 2169 | static inline void kick_process(struct task_struct *tsk) { } |
| 2043 | #endif | 2170 | #endif |
| 2044 | extern void sched_fork(unsigned long clone_flags, struct task_struct *p); | 2171 | extern int sched_fork(unsigned long clone_flags, struct task_struct *p); |
| 2045 | extern void sched_dead(struct task_struct *p); | 2172 | extern void sched_dead(struct task_struct *p); |
| 2046 | 2173 | ||
| 2047 | extern void proc_caches_init(void); | 2174 | extern void proc_caches_init(void); |
| @@ -2167,8 +2294,6 @@ extern struct mm_struct *get_task_mm(struct task_struct *task); | |||
| 2167 | extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode); | 2294 | extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode); |
| 2168 | /* Remove the current tasks stale references to the old mm_struct */ | 2295 | /* Remove the current tasks stale references to the old mm_struct */ |
| 2169 | extern void mm_release(struct task_struct *, struct mm_struct *); | 2296 | extern void mm_release(struct task_struct *, struct mm_struct *); |
| 2170 | /* Allocate a new mm structure and copy contents from tsk->mm */ | ||
| 2171 | extern struct mm_struct *dup_mm(struct task_struct *tsk); | ||
| 2172 | 2297 | ||
| 2173 | extern int copy_thread(unsigned long, unsigned long, unsigned long, | 2298 | extern int copy_thread(unsigned long, unsigned long, unsigned long, |
| 2174 | struct task_struct *); | 2299 | struct task_struct *); |
| @@ -2226,6 +2351,16 @@ extern bool current_is_single_threaded(void); | |||
| 2226 | #define while_each_thread(g, t) \ | 2351 | #define while_each_thread(g, t) \ |
| 2227 | while ((t = next_thread(t)) != g) | 2352 | while ((t = next_thread(t)) != g) |
| 2228 | 2353 | ||
| 2354 | #define __for_each_thread(signal, t) \ | ||
| 2355 | list_for_each_entry_rcu(t, &(signal)->thread_head, thread_node) | ||
| 2356 | |||
| 2357 | #define for_each_thread(p, t) \ | ||
| 2358 | __for_each_thread((p)->signal, t) | ||
| 2359 | |||
| 2360 | /* Careful: this is a double loop, 'break' won't work as expected. */ | ||
| 2361 | #define for_each_process_thread(p, t) \ | ||
| 2362 | for_each_process(p) for_each_thread(p, t) | ||
| 2363 | |||
| 2229 | static inline int get_nr_threads(struct task_struct *tsk) | 2364 | static inline int get_nr_threads(struct task_struct *tsk) |
| 2230 | { | 2365 | { |
| 2231 | return tsk->signal->nr_threads; | 2366 | return tsk->signal->nr_threads; |
| @@ -2630,6 +2765,21 @@ static inline bool __must_check current_clr_polling_and_test(void) | |||
| 2630 | } | 2765 | } |
| 2631 | #endif | 2766 | #endif |
| 2632 | 2767 | ||
| 2768 | static inline void current_clr_polling(void) | ||
| 2769 | { | ||
| 2770 | __current_clr_polling(); | ||
| 2771 | |||
| 2772 | /* | ||
| 2773 | * Ensure we check TIF_NEED_RESCHED after we clear the polling bit. | ||
| 2774 | * Once the bit is cleared, we'll get IPIs with every new | ||
| 2775 | * TIF_NEED_RESCHED and the IPI handler, scheduler_ipi(), will also | ||
| 2776 | * fold. | ||
| 2777 | */ | ||
| 2778 | smp_mb(); /* paired with resched_task() */ | ||
| 2779 | |||
| 2780 | preempt_fold_need_resched(); | ||
| 2781 | } | ||
| 2782 | |||
| 2633 | static __always_inline bool need_resched(void) | 2783 | static __always_inline bool need_resched(void) |
| 2634 | { | 2784 | { |
| 2635 | return unlikely(tif_need_resched()); | 2785 | return unlikely(tif_need_resched()); |
diff --git a/include/linux/sched/deadline.h b/include/linux/sched/deadline.h new file mode 100644 index 000000000000..9d303b8847df --- /dev/null +++ b/include/linux/sched/deadline.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | #ifndef _SCHED_DEADLINE_H | ||
| 2 | #define _SCHED_DEADLINE_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * SCHED_DEADLINE tasks has negative priorities, reflecting | ||
| 6 | * the fact that any of them has higher prio than RT and | ||
| 7 | * NORMAL/BATCH tasks. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #define MAX_DL_PRIO 0 | ||
| 11 | |||
| 12 | static inline int dl_prio(int prio) | ||
| 13 | { | ||
| 14 | if (unlikely(prio < MAX_DL_PRIO)) | ||
| 15 | return 1; | ||
| 16 | return 0; | ||
| 17 | } | ||
| 18 | |||
| 19 | static inline int dl_task(struct task_struct *p) | ||
| 20 | { | ||
| 21 | return dl_prio(p->prio); | ||
| 22 | } | ||
| 23 | |||
| 24 | #endif /* _SCHED_DEADLINE_H */ | ||
diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h index 440434df3627..34e4ebea8fce 100644 --- a/include/linux/sched/rt.h +++ b/include/linux/sched/rt.h | |||
| @@ -35,6 +35,7 @@ static inline int rt_task(struct task_struct *p) | |||
| 35 | #ifdef CONFIG_RT_MUTEXES | 35 | #ifdef CONFIG_RT_MUTEXES |
| 36 | extern int rt_mutex_getprio(struct task_struct *p); | 36 | extern int rt_mutex_getprio(struct task_struct *p); |
| 37 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | 37 | extern void rt_mutex_setprio(struct task_struct *p, int prio); |
| 38 | extern struct task_struct *rt_mutex_get_top_task(struct task_struct *task); | ||
| 38 | extern void rt_mutex_adjust_pi(struct task_struct *p); | 39 | extern void rt_mutex_adjust_pi(struct task_struct *p); |
| 39 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) | 40 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) |
| 40 | { | 41 | { |
| @@ -45,6 +46,10 @@ static inline int rt_mutex_getprio(struct task_struct *p) | |||
| 45 | { | 46 | { |
| 46 | return p->normal_prio; | 47 | return p->normal_prio; |
| 47 | } | 48 | } |
| 49 | static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task) | ||
| 50 | { | ||
| 51 | return NULL; | ||
| 52 | } | ||
| 48 | # define rt_mutex_adjust_pi(p) do { } while (0) | 53 | # define rt_mutex_adjust_pi(p) do { } while (0) |
| 49 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) | 54 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) |
| 50 | { | 55 | { |
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index 41467f8ff8ec..b13cf430764f 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h | |||
| @@ -48,7 +48,6 @@ extern unsigned int sysctl_numa_balancing_scan_delay; | |||
| 48 | extern unsigned int sysctl_numa_balancing_scan_period_min; | 48 | extern unsigned int sysctl_numa_balancing_scan_period_min; |
| 49 | extern unsigned int sysctl_numa_balancing_scan_period_max; | 49 | extern unsigned int sysctl_numa_balancing_scan_period_max; |
| 50 | extern unsigned int sysctl_numa_balancing_scan_size; | 50 | extern unsigned int sysctl_numa_balancing_scan_size; |
| 51 | extern unsigned int sysctl_numa_balancing_settle_count; | ||
| 52 | 51 | ||
| 53 | #ifdef CONFIG_SCHED_DEBUG | 52 | #ifdef CONFIG_SCHED_DEBUG |
| 54 | extern unsigned int sysctl_sched_migration_cost; | 53 | extern unsigned int sysctl_sched_migration_cost; |
| @@ -100,4 +99,8 @@ extern int sched_rt_handler(struct ctl_table *table, int write, | |||
| 100 | void __user *buffer, size_t *lenp, | 99 | void __user *buffer, size_t *lenp, |
| 101 | loff_t *ppos); | 100 | loff_t *ppos); |
| 102 | 101 | ||
| 102 | extern int sysctl_numa_balancing(struct ctl_table *table, int write, | ||
| 103 | void __user *buffer, size_t *lenp, | ||
| 104 | loff_t *ppos); | ||
| 105 | |||
| 103 | #endif /* _SCHED_SYSCTL_H */ | 106 | #endif /* _SCHED_SYSCTL_H */ |
diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 3bfe8d6ee248..a9414fd49dc6 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h | |||
| @@ -23,13 +23,12 @@ | |||
| 23 | * See the GNU General Public License for more details. | 23 | * See the GNU General Public License for more details. |
| 24 | * | 24 | * |
| 25 | * You should have received a copy of the GNU General Public License | 25 | * You should have received a copy of the GNU General Public License |
| 26 | * along with GNU CC; see the file COPYING. If not, write to | 26 | * along with GNU CC; see the file COPYING. If not, see |
| 27 | * the Free Software Foundation, 59 Temple Place - Suite 330, | 27 | * <http://www.gnu.org/licenses/>. |
| 28 | * Boston, MA 02111-1307, USA. | ||
| 29 | * | 28 | * |
| 30 | * Please send any bug reports or fixes you make to the | 29 | * Please send any bug reports or fixes you make to the |
| 31 | * email address(es): | 30 | * email address(es): |
| 32 | * lksctp developers <lksctp-developerst@lists.sourceforge.net> | 31 | * lksctp developers <linux-sctp@vger.kernel.org> |
| 33 | * | 32 | * |
| 34 | * Or submit a bug report through the following website: | 33 | * Or submit a bug report through the following website: |
| 35 | * http://www.sf.net/projects/lksctp | 34 | * http://www.sf.net/projects/lksctp |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index cf87a24c0f92..535f158977b9 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
| @@ -117,15 +117,15 @@ repeat: | |||
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | /** | 119 | /** |
| 120 | * read_seqcount_begin_no_lockdep - start seq-read critical section w/o lockdep | 120 | * raw_read_seqcount_begin - start seq-read critical section w/o lockdep |
| 121 | * @s: pointer to seqcount_t | 121 | * @s: pointer to seqcount_t |
| 122 | * Returns: count to be passed to read_seqcount_retry | 122 | * Returns: count to be passed to read_seqcount_retry |
| 123 | * | 123 | * |
| 124 | * read_seqcount_begin_no_lockdep opens a read critical section of the given | 124 | * raw_read_seqcount_begin opens a read critical section of the given |
| 125 | * seqcount, but without any lockdep checking. Validity of the critical | 125 | * seqcount, but without any lockdep checking. Validity of the critical |
| 126 | * section is tested by checking read_seqcount_retry function. | 126 | * section is tested by checking read_seqcount_retry function. |
| 127 | */ | 127 | */ |
| 128 | static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s) | 128 | static inline unsigned raw_read_seqcount_begin(const seqcount_t *s) |
| 129 | { | 129 | { |
| 130 | unsigned ret = __read_seqcount_begin(s); | 130 | unsigned ret = __read_seqcount_begin(s); |
| 131 | smp_rmb(); | 131 | smp_rmb(); |
| @@ -144,7 +144,7 @@ static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s) | |||
| 144 | static inline unsigned read_seqcount_begin(const seqcount_t *s) | 144 | static inline unsigned read_seqcount_begin(const seqcount_t *s) |
| 145 | { | 145 | { |
| 146 | seqcount_lockdep_reader_access(s); | 146 | seqcount_lockdep_reader_access(s); |
| 147 | return read_seqcount_begin_no_lockdep(s); | 147 | return raw_read_seqcount_begin(s); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | /** | 150 | /** |
| @@ -206,14 +206,26 @@ static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) | |||
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | 208 | ||
| 209 | |||
| 210 | static inline void raw_write_seqcount_begin(seqcount_t *s) | ||
| 211 | { | ||
| 212 | s->sequence++; | ||
| 213 | smp_wmb(); | ||
| 214 | } | ||
| 215 | |||
| 216 | static inline void raw_write_seqcount_end(seqcount_t *s) | ||
| 217 | { | ||
| 218 | smp_wmb(); | ||
| 219 | s->sequence++; | ||
| 220 | } | ||
| 221 | |||
| 209 | /* | 222 | /* |
| 210 | * Sequence counter only version assumes that callers are using their | 223 | * Sequence counter only version assumes that callers are using their |
| 211 | * own mutexing. | 224 | * own mutexing. |
| 212 | */ | 225 | */ |
| 213 | static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass) | 226 | static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass) |
| 214 | { | 227 | { |
| 215 | s->sequence++; | 228 | raw_write_seqcount_begin(s); |
| 216 | smp_wmb(); | ||
| 217 | seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_); | 229 | seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_); |
| 218 | } | 230 | } |
| 219 | 231 | ||
| @@ -225,8 +237,7 @@ static inline void write_seqcount_begin(seqcount_t *s) | |||
| 225 | static inline void write_seqcount_end(seqcount_t *s) | 237 | static inline void write_seqcount_end(seqcount_t *s) |
| 226 | { | 238 | { |
| 227 | seqcount_release(&s->dep_map, 1, _RET_IP_); | 239 | seqcount_release(&s->dep_map, 1, _RET_IP_); |
| 228 | smp_wmb(); | 240 | raw_write_seqcount_end(s); |
| 229 | s->sequence++; | ||
| 230 | } | 241 | } |
| 231 | 242 | ||
| 232 | /** | 243 | /** |
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index 50fe651da965..22b3640c9424 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
| @@ -10,15 +10,6 @@ | |||
| 10 | 10 | ||
| 11 | #define SCIx_NOT_SUPPORTED (-1) | 11 | #define SCIx_NOT_SUPPORTED (-1) |
| 12 | 12 | ||
| 13 | enum { | ||
| 14 | SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ | ||
| 15 | SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ | ||
| 16 | SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */ | ||
| 17 | SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */ | ||
| 18 | SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */ | ||
| 19 | SCBRR_ALGO_6, /* HSCIF variable sample rate algorithm */ | ||
| 20 | }; | ||
| 21 | |||
| 22 | #define SCSCR_TIE (1 << 7) | 13 | #define SCSCR_TIE (1 << 7) |
| 23 | #define SCSCR_RIE (1 << 6) | 14 | #define SCSCR_RIE (1 << 6) |
| 24 | #define SCSCR_TE (1 << 5) | 15 | #define SCSCR_TE (1 << 5) |
| @@ -59,28 +50,6 @@ enum { | |||
| 59 | /* HSSRR HSCIF */ | 50 | /* HSSRR HSCIF */ |
| 60 | #define HSCIF_SRE 0x8000 | 51 | #define HSCIF_SRE 0x8000 |
| 61 | 52 | ||
| 62 | /* Offsets into the sci_port->irqs array */ | ||
| 63 | enum { | ||
| 64 | SCIx_ERI_IRQ, | ||
| 65 | SCIx_RXI_IRQ, | ||
| 66 | SCIx_TXI_IRQ, | ||
| 67 | SCIx_BRI_IRQ, | ||
| 68 | SCIx_NR_IRQS, | ||
| 69 | |||
| 70 | SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */ | ||
| 71 | }; | ||
| 72 | |||
| 73 | /* Offsets into the sci_port->gpios array */ | ||
| 74 | enum { | ||
| 75 | SCIx_SCK, | ||
| 76 | SCIx_RXD, | ||
| 77 | SCIx_TXD, | ||
| 78 | SCIx_CTS, | ||
| 79 | SCIx_RTS, | ||
| 80 | |||
| 81 | SCIx_NR_FNS, | ||
| 82 | }; | ||
| 83 | |||
| 84 | enum { | 53 | enum { |
| 85 | SCIx_PROBE_REGTYPE, | 54 | SCIx_PROBE_REGTYPE, |
| 86 | 55 | ||
| @@ -99,19 +68,6 @@ enum { | |||
| 99 | SCIx_NR_REGTYPES, | 68 | SCIx_NR_REGTYPES, |
| 100 | }; | 69 | }; |
| 101 | 70 | ||
| 102 | #define SCIx_IRQ_MUXED(irq) \ | ||
| 103 | { \ | ||
| 104 | [SCIx_ERI_IRQ] = (irq), \ | ||
| 105 | [SCIx_RXI_IRQ] = (irq), \ | ||
| 106 | [SCIx_TXI_IRQ] = (irq), \ | ||
| 107 | [SCIx_BRI_IRQ] = (irq), \ | ||
| 108 | } | ||
| 109 | |||
| 110 | #define SCIx_IRQ_IS_MUXED(port) \ | ||
| 111 | ((port)->cfg->irqs[SCIx_ERI_IRQ] == \ | ||
| 112 | (port)->cfg->irqs[SCIx_RXI_IRQ]) || \ | ||
| 113 | ((port)->cfg->irqs[SCIx_ERI_IRQ] && \ | ||
| 114 | !(port)->cfg->irqs[SCIx_RXI_IRQ]) | ||
| 115 | /* | 71 | /* |
| 116 | * SCI register subset common for all port types. | 72 | * SCI register subset common for all port types. |
| 117 | * Not all registers will exist on all parts. | 73 | * Not all registers will exist on all parts. |
| @@ -140,22 +96,16 @@ struct plat_sci_port_ops { | |||
| 140 | * Platform device specific platform_data struct | 96 | * Platform device specific platform_data struct |
| 141 | */ | 97 | */ |
| 142 | struct plat_sci_port { | 98 | struct plat_sci_port { |
| 143 | unsigned long mapbase; /* resource base */ | ||
| 144 | unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ | ||
| 145 | unsigned int gpios[SCIx_NR_FNS]; /* SCK, RXD, TXD, CTS, RTS */ | ||
| 146 | unsigned int type; /* SCI / SCIF / IRDA / HSCIF */ | 99 | unsigned int type; /* SCI / SCIF / IRDA / HSCIF */ |
| 147 | upf_t flags; /* UPF_* flags */ | 100 | upf_t flags; /* UPF_* flags */ |
| 148 | unsigned long capabilities; /* Port features/capabilities */ | 101 | unsigned long capabilities; /* Port features/capabilities */ |
| 149 | 102 | ||
| 150 | unsigned int scbrr_algo_id; /* SCBRR calculation algo */ | 103 | unsigned int sampling_rate; |
| 151 | unsigned int scscr; /* SCSCR initialization */ | 104 | unsigned int scscr; /* SCSCR initialization */ |
| 152 | 105 | ||
| 153 | /* | 106 | /* |
| 154 | * Platform overrides if necessary, defaults otherwise. | 107 | * Platform overrides if necessary, defaults otherwise. |
| 155 | */ | 108 | */ |
| 156 | int overrun_bit; | ||
| 157 | unsigned int error_mask; | ||
| 158 | |||
| 159 | int port_reg; | 109 | int port_reg; |
| 160 | unsigned char regshift; | 110 | unsigned char regshift; |
| 161 | unsigned char regtype; | 111 | unsigned char regtype; |
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h index 631af63af42d..4723bbfa1c26 100644 --- a/include/linux/sfi_acpi.h +++ b/include/linux/sfi_acpi.h | |||
| @@ -59,8 +59,11 @@ | |||
| 59 | #ifndef _LINUX_SFI_ACPI_H | 59 | #ifndef _LINUX_SFI_ACPI_H |
| 60 | #define _LINUX_SFI_ACPI_H | 60 | #define _LINUX_SFI_ACPI_H |
| 61 | 61 | ||
| 62 | #include <linux/acpi.h> | ||
| 63 | #include <linux/sfi.h> | ||
| 64 | |||
| 62 | #ifdef CONFIG_SFI | 65 | #ifdef CONFIG_SFI |
| 63 | #include <acpi/acpi.h> /* struct acpi_table_header */ | 66 | #include <acpi/acpi.h> /* FIXME: inclusion should be removed */ |
| 64 | 67 | ||
| 65 | extern int sfi_acpi_table_parse(char *signature, char *oem_id, | 68 | extern int sfi_acpi_table_parse(char *signature, char *oem_id, |
| 66 | char *oem_table_id, | 69 | char *oem_table_id, |
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h index 90b5e30c2f22..8c9131db2b25 100644 --- a/include/linux/sh_eth.h +++ b/include/linux/sh_eth.h | |||
| @@ -8,6 +8,7 @@ enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN}; | |||
| 8 | 8 | ||
| 9 | struct sh_eth_plat_data { | 9 | struct sh_eth_plat_data { |
| 10 | int phy; | 10 | int phy; |
| 11 | int phy_irq; | ||
| 11 | int edmac_endian; | 12 | int edmac_endian; |
| 12 | phy_interface_t phy_interface; | 13 | phy_interface_t phy_interface; |
| 13 | void (*set_mdio_gate)(void *addr); | 14 | void (*set_mdio_gate)(void *addr); |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 30aa0dc60d75..9d55438bc4ad 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
| @@ -47,6 +47,8 @@ extern int shmem_init(void); | |||
| 47 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); | 47 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); |
| 48 | extern struct file *shmem_file_setup(const char *name, | 48 | extern struct file *shmem_file_setup(const char *name, |
| 49 | loff_t size, unsigned long flags); | 49 | loff_t size, unsigned long flags); |
| 50 | extern struct file *shmem_kernel_file_setup(const char *name, loff_t size, | ||
| 51 | unsigned long flags); | ||
| 50 | extern int shmem_zero_setup(struct vm_area_struct *); | 52 | extern int shmem_zero_setup(struct vm_area_struct *); |
| 51 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); | 53 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); |
| 52 | extern void shmem_unlock_mapping(struct address_space *mapping); | 54 | extern void shmem_unlock_mapping(struct address_space *mapping); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index bec1cc7d5e3c..1f689e62e4cb 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -34,11 +34,82 @@ | |||
| 34 | #include <linux/netdev_features.h> | 34 | #include <linux/netdev_features.h> |
| 35 | #include <net/flow_keys.h> | 35 | #include <net/flow_keys.h> |
| 36 | 36 | ||
| 37 | /* A. Checksumming of received packets by device. | ||
| 38 | * | ||
| 39 | * CHECKSUM_NONE: | ||
| 40 | * | ||
| 41 | * Device failed to checksum this packet e.g. due to lack of capabilities. | ||
| 42 | * The packet contains full (though not verified) checksum in packet but | ||
| 43 | * not in skb->csum. Thus, skb->csum is undefined in this case. | ||
| 44 | * | ||
| 45 | * CHECKSUM_UNNECESSARY: | ||
| 46 | * | ||
| 47 | * The hardware you're dealing with doesn't calculate the full checksum | ||
| 48 | * (as in CHECKSUM_COMPLETE), but it does parse headers and verify checksums | ||
| 49 | * for specific protocols e.g. TCP/UDP/SCTP, then, for such packets it will | ||
| 50 | * set CHECKSUM_UNNECESSARY if their checksums are okay. skb->csum is still | ||
| 51 | * undefined in this case though. It is a bad option, but, unfortunately, | ||
| 52 | * nowadays most vendors do this. Apparently with the secret goal to sell | ||
| 53 | * you new devices, when you will add new protocol to your host, f.e. IPv6 8) | ||
| 54 | * | ||
| 55 | * CHECKSUM_COMPLETE: | ||
| 56 | * | ||
| 57 | * This is the most generic way. The device supplied checksum of the _whole_ | ||
| 58 | * packet as seen by netif_rx() and fills out in skb->csum. Meaning, the | ||
| 59 | * hardware doesn't need to parse L3/L4 headers to implement this. | ||
| 60 | * | ||
| 61 | * Note: Even if device supports only some protocols, but is able to produce | ||
| 62 | * skb->csum, it MUST use CHECKSUM_COMPLETE, not CHECKSUM_UNNECESSARY. | ||
| 63 | * | ||
| 64 | * CHECKSUM_PARTIAL: | ||
| 65 | * | ||
| 66 | * This is identical to the case for output below. This may occur on a packet | ||
| 67 | * received directly from another Linux OS, e.g., a virtualized Linux kernel | ||
| 68 | * on the same host. The packet can be treated in the same way as | ||
| 69 | * CHECKSUM_UNNECESSARY, except that on output (i.e., forwarding) the | ||
| 70 | * checksum must be filled in by the OS or the hardware. | ||
| 71 | * | ||
| 72 | * B. Checksumming on output. | ||
| 73 | * | ||
| 74 | * CHECKSUM_NONE: | ||
| 75 | * | ||
| 76 | * The skb was already checksummed by the protocol, or a checksum is not | ||
| 77 | * required. | ||
| 78 | * | ||
| 79 | * CHECKSUM_PARTIAL: | ||
| 80 | * | ||
| 81 | * The device is required to checksum the packet as seen by hard_start_xmit() | ||
| 82 | * from skb->csum_start up to the end, and to record/write the checksum at | ||
| 83 | * offset skb->csum_start + skb->csum_offset. | ||
| 84 | * | ||
| 85 | * The device must show its capabilities in dev->features, set up at device | ||
| 86 | * setup time, e.g. netdev_features.h: | ||
| 87 | * | ||
| 88 | * NETIF_F_HW_CSUM - It's a clever device, it's able to checksum everything. | ||
| 89 | * NETIF_F_IP_CSUM - Device is dumb, it's able to checksum only TCP/UDP over | ||
| 90 | * IPv4. Sigh. Vendors like this way for an unknown reason. | ||
| 91 | * Though, see comment above about CHECKSUM_UNNECESSARY. 8) | ||
| 92 | * NETIF_F_IPV6_CSUM - About as dumb as the last one but does IPv6 instead. | ||
| 93 | * NETIF_F_... - Well, you get the picture. | ||
| 94 | * | ||
| 95 | * CHECKSUM_UNNECESSARY: | ||
| 96 | * | ||
| 97 | * Normally, the device will do per protocol specific checksumming. Protocol | ||
| 98 | * implementations that do not want the NIC to perform the checksum | ||
| 99 | * calculation should use this flag in their outgoing skbs. | ||
| 100 | * | ||
| 101 | * NETIF_F_FCOE_CRC - This indicates that the device can do FCoE FC CRC | ||
| 102 | * offload. Correspondingly, the FCoE protocol driver | ||
| 103 | * stack should use CHECKSUM_UNNECESSARY. | ||
| 104 | * | ||
| 105 | * Any questions? No questions, good. --ANK | ||
| 106 | */ | ||
| 107 | |||
| 37 | /* Don't change this without changing skb_csum_unnecessary! */ | 108 | /* Don't change this without changing skb_csum_unnecessary! */ |
| 38 | #define CHECKSUM_NONE 0 | 109 | #define CHECKSUM_NONE 0 |
| 39 | #define CHECKSUM_UNNECESSARY 1 | 110 | #define CHECKSUM_UNNECESSARY 1 |
| 40 | #define CHECKSUM_COMPLETE 2 | 111 | #define CHECKSUM_COMPLETE 2 |
| 41 | #define CHECKSUM_PARTIAL 3 | 112 | #define CHECKSUM_PARTIAL 3 |
| 42 | 113 | ||
| 43 | #define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \ | 114 | #define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \ |
| 44 | ~(SMP_CACHE_BYTES - 1)) | 115 | ~(SMP_CACHE_BYTES - 1)) |
| @@ -54,58 +125,6 @@ | |||
| 54 | SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \ | 125 | SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \ |
| 55 | SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) | 126 | SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) |
| 56 | 127 | ||
| 57 | /* A. Checksumming of received packets by device. | ||
| 58 | * | ||
| 59 | * NONE: device failed to checksum this packet. | ||
| 60 | * skb->csum is undefined. | ||
| 61 | * | ||
| 62 | * UNNECESSARY: device parsed packet and wouldbe verified checksum. | ||
| 63 | * skb->csum is undefined. | ||
| 64 | * It is bad option, but, unfortunately, many of vendors do this. | ||
| 65 | * Apparently with secret goal to sell you new device, when you | ||
| 66 | * will add new protocol to your host. F.e. IPv6. 8) | ||
| 67 | * | ||
| 68 | * COMPLETE: the most generic way. Device supplied checksum of _all_ | ||
| 69 | * the packet as seen by netif_rx in skb->csum. | ||
| 70 | * NOTE: Even if device supports only some protocols, but | ||
| 71 | * is able to produce some skb->csum, it MUST use COMPLETE, | ||
| 72 | * not UNNECESSARY. | ||
| 73 | * | ||
| 74 | * PARTIAL: identical to the case for output below. This may occur | ||
| 75 | * on a packet received directly from another Linux OS, e.g., | ||
| 76 | * a virtualised Linux kernel on the same host. The packet can | ||
| 77 | * be treated in the same way as UNNECESSARY except that on | ||
| 78 | * output (i.e., forwarding) the checksum must be filled in | ||
| 79 | * by the OS or the hardware. | ||
| 80 | * | ||
| 81 | * B. Checksumming on output. | ||
| 82 | * | ||
| 83 | * NONE: skb is checksummed by protocol or csum is not required. | ||
| 84 | * | ||
| 85 | * PARTIAL: device is required to csum packet as seen by hard_start_xmit | ||
| 86 | * from skb->csum_start to the end and to record the checksum | ||
| 87 | * at skb->csum_start + skb->csum_offset. | ||
| 88 | * | ||
| 89 | * Device must show its capabilities in dev->features, set | ||
| 90 | * at device setup time. | ||
| 91 | * NETIF_F_HW_CSUM - it is clever device, it is able to checksum | ||
| 92 | * everything. | ||
| 93 | * NETIF_F_IP_CSUM - device is dumb. It is able to csum only | ||
| 94 | * TCP/UDP over IPv4. Sigh. Vendors like this | ||
| 95 | * way by an unknown reason. Though, see comment above | ||
| 96 | * about CHECKSUM_UNNECESSARY. 8) | ||
| 97 | * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead. | ||
| 98 | * | ||
| 99 | * UNNECESSARY: device will do per protocol specific csum. Protocol drivers | ||
| 100 | * that do not want net to perform the checksum calculation should use | ||
| 101 | * this flag in their outgoing skbs. | ||
| 102 | * NETIF_F_FCOE_CRC this indicates the device can do FCoE FC CRC | ||
| 103 | * offload. Correspondingly, the FCoE protocol driver | ||
| 104 | * stack should use CHECKSUM_UNNECESSARY. | ||
| 105 | * | ||
| 106 | * Any questions? No questions, good. --ANK | ||
| 107 | */ | ||
| 108 | |||
| 109 | struct net_device; | 128 | struct net_device; |
| 110 | struct scatterlist; | 129 | struct scatterlist; |
| 111 | struct pipe_inode_info; | 130 | struct pipe_inode_info; |
| @@ -703,15 +722,78 @@ unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, | |||
| 703 | unsigned int to, struct ts_config *config, | 722 | unsigned int to, struct ts_config *config, |
| 704 | struct ts_state *state); | 723 | struct ts_state *state); |
| 705 | 724 | ||
| 706 | void __skb_get_rxhash(struct sk_buff *skb); | 725 | /* |
| 707 | static inline __u32 skb_get_rxhash(struct sk_buff *skb) | 726 | * Packet hash types specify the type of hash in skb_set_hash. |
| 727 | * | ||
| 728 | * Hash types refer to the protocol layer addresses which are used to | ||
| 729 | * construct a packet's hash. The hashes are used to differentiate or identify | ||
| 730 | * flows of the protocol layer for the hash type. Hash types are either | ||
| 731 | * layer-2 (L2), layer-3 (L3), or layer-4 (L4). | ||
| 732 | * | ||
| 733 | * Properties of hashes: | ||
| 734 | * | ||
| 735 | * 1) Two packets in different flows have different hash values | ||
| 736 | * 2) Two packets in the same flow should have the same hash value | ||
| 737 | * | ||
| 738 | * A hash at a higher layer is considered to be more specific. A driver should | ||
| 739 | * set the most specific hash possible. | ||
| 740 | * | ||
| 741 | * A driver cannot indicate a more specific hash than the layer at which a hash | ||
| 742 | * was computed. For instance an L3 hash cannot be set as an L4 hash. | ||
| 743 | * | ||
| 744 | * A driver may indicate a hash level which is less specific than the | ||
| 745 | * actual layer the hash was computed on. For instance, a hash computed | ||
| 746 | * at L4 may be considered an L3 hash. This should only be done if the | ||
| 747 | * driver can't unambiguously determine that the HW computed the hash at | ||
| 748 | * the higher layer. Note that the "should" in the second property above | ||
| 749 | * permits this. | ||
| 750 | */ | ||
| 751 | enum pkt_hash_types { | ||
| 752 | PKT_HASH_TYPE_NONE, /* Undefined type */ | ||
| 753 | PKT_HASH_TYPE_L2, /* Input: src_MAC, dest_MAC */ | ||
| 754 | PKT_HASH_TYPE_L3, /* Input: src_IP, dst_IP */ | ||
| 755 | PKT_HASH_TYPE_L4, /* Input: src_IP, dst_IP, src_port, dst_port */ | ||
| 756 | }; | ||
| 757 | |||
| 758 | static inline void | ||
| 759 | skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type) | ||
| 760 | { | ||
| 761 | skb->l4_rxhash = (type == PKT_HASH_TYPE_L4); | ||
| 762 | skb->rxhash = hash; | ||
| 763 | } | ||
| 764 | |||
| 765 | void __skb_get_hash(struct sk_buff *skb); | ||
| 766 | static inline __u32 skb_get_hash(struct sk_buff *skb) | ||
| 708 | { | 767 | { |
| 709 | if (!skb->l4_rxhash) | 768 | if (!skb->l4_rxhash) |
| 710 | __skb_get_rxhash(skb); | 769 | __skb_get_hash(skb); |
| 711 | 770 | ||
| 712 | return skb->rxhash; | 771 | return skb->rxhash; |
| 713 | } | 772 | } |
| 714 | 773 | ||
| 774 | static inline __u32 skb_get_hash_raw(const struct sk_buff *skb) | ||
| 775 | { | ||
| 776 | return skb->rxhash; | ||
| 777 | } | ||
| 778 | |||
| 779 | static inline void skb_clear_hash(struct sk_buff *skb) | ||
| 780 | { | ||
| 781 | skb->rxhash = 0; | ||
| 782 | skb->l4_rxhash = 0; | ||
| 783 | } | ||
| 784 | |||
| 785 | static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb) | ||
| 786 | { | ||
| 787 | if (!skb->l4_rxhash) | ||
| 788 | skb_clear_hash(skb); | ||
| 789 | } | ||
| 790 | |||
| 791 | static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from) | ||
| 792 | { | ||
| 793 | to->rxhash = from->rxhash; | ||
| 794 | to->l4_rxhash = from->l4_rxhash; | ||
| 795 | }; | ||
| 796 | |||
| 715 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | 797 | #ifdef NET_SKBUFF_DATA_USES_OFFSET |
| 716 | static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) | 798 | static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) |
| 717 | { | 799 | { |
| @@ -750,7 +832,7 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb) | |||
| 750 | */ | 832 | */ |
| 751 | static inline int skb_queue_empty(const struct sk_buff_head *list) | 833 | static inline int skb_queue_empty(const struct sk_buff_head *list) |
| 752 | { | 834 | { |
| 753 | return list->next == (struct sk_buff *)list; | 835 | return list->next == (const struct sk_buff *) list; |
| 754 | } | 836 | } |
| 755 | 837 | ||
| 756 | /** | 838 | /** |
| @@ -763,7 +845,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list) | |||
| 763 | static inline bool skb_queue_is_last(const struct sk_buff_head *list, | 845 | static inline bool skb_queue_is_last(const struct sk_buff_head *list, |
| 764 | const struct sk_buff *skb) | 846 | const struct sk_buff *skb) |
| 765 | { | 847 | { |
| 766 | return skb->next == (struct sk_buff *)list; | 848 | return skb->next == (const struct sk_buff *) list; |
| 767 | } | 849 | } |
| 768 | 850 | ||
| 769 | /** | 851 | /** |
| @@ -776,7 +858,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list, | |||
| 776 | static inline bool skb_queue_is_first(const struct sk_buff_head *list, | 858 | static inline bool skb_queue_is_first(const struct sk_buff_head *list, |
| 777 | const struct sk_buff *skb) | 859 | const struct sk_buff *skb) |
| 778 | { | 860 | { |
| 779 | return skb->prev == (struct sk_buff *)list; | 861 | return skb->prev == (const struct sk_buff *) list; |
| 780 | } | 862 | } |
| 781 | 863 | ||
| 782 | /** | 864 | /** |
| @@ -1638,6 +1720,11 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) | |||
| 1638 | skb->mac_header += offset; | 1720 | skb->mac_header += offset; |
| 1639 | } | 1721 | } |
| 1640 | 1722 | ||
| 1723 | static inline void skb_pop_mac_header(struct sk_buff *skb) | ||
| 1724 | { | ||
| 1725 | skb->mac_header = skb->network_header; | ||
| 1726 | } | ||
| 1727 | |||
| 1641 | static inline void skb_probe_transport_header(struct sk_buff *skb, | 1728 | static inline void skb_probe_transport_header(struct sk_buff *skb, |
| 1642 | const int offset_hint) | 1729 | const int offset_hint) |
| 1643 | { | 1730 | { |
| @@ -2263,6 +2350,24 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, | |||
| 2263 | 2350 | ||
| 2264 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); | 2351 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); |
| 2265 | 2352 | ||
| 2353 | /** | ||
| 2354 | * pskb_trim_rcsum - trim received skb and update checksum | ||
| 2355 | * @skb: buffer to trim | ||
| 2356 | * @len: new length | ||
| 2357 | * | ||
| 2358 | * This is exactly the same as pskb_trim except that it ensures the | ||
| 2359 | * checksum of received packets are still valid after the operation. | ||
| 2360 | */ | ||
| 2361 | |||
| 2362 | static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | ||
| 2363 | { | ||
| 2364 | if (likely(len >= skb->len)) | ||
| 2365 | return 0; | ||
| 2366 | if (skb->ip_summed == CHECKSUM_COMPLETE) | ||
| 2367 | skb->ip_summed = CHECKSUM_NONE; | ||
| 2368 | return __pskb_trim(skb, len); | ||
| 2369 | } | ||
| 2370 | |||
| 2266 | #define skb_queue_walk(queue, skb) \ | 2371 | #define skb_queue_walk(queue, skb) \ |
| 2267 | for (skb = (queue)->next; \ | 2372 | for (skb = (queue)->next; \ |
| 2268 | skb != (struct sk_buff *)(queue); \ | 2373 | skb != (struct sk_buff *)(queue); \ |
| @@ -2345,6 +2450,9 @@ int skb_splice_bits(struct sk_buff *skb, unsigned int offset, | |||
| 2345 | struct pipe_inode_info *pipe, unsigned int len, | 2450 | struct pipe_inode_info *pipe, unsigned int len, |
| 2346 | unsigned int flags); | 2451 | unsigned int flags); |
| 2347 | void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); | 2452 | void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); |
| 2453 | unsigned int skb_zerocopy_headlen(const struct sk_buff *from); | ||
| 2454 | void skb_zerocopy(struct sk_buff *to, const struct sk_buff *from, | ||
| 2455 | int len, int hlen); | ||
| 2348 | void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len); | 2456 | void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len); |
| 2349 | int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen); | 2457 | int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen); |
| 2350 | void skb_scrub_packet(struct sk_buff *skb, bool xnet); | 2458 | void skb_scrub_packet(struct sk_buff *skb, bool xnet); |
| @@ -2360,27 +2468,6 @@ __wsum __skb_checksum(const struct sk_buff *skb, int offset, int len, | |||
| 2360 | __wsum skb_checksum(const struct sk_buff *skb, int offset, int len, | 2468 | __wsum skb_checksum(const struct sk_buff *skb, int offset, int len, |
| 2361 | __wsum csum); | 2469 | __wsum csum); |
| 2362 | 2470 | ||
| 2363 | /** | ||
| 2364 | * pskb_trim_rcsum - trim received skb and update checksum | ||
| 2365 | * @skb: buffer to trim | ||
| 2366 | * @len: new length | ||
| 2367 | * | ||
| 2368 | * This is exactly the same as pskb_trim except that it ensures the | ||
| 2369 | * checksum of received packets are still valid after the operation. | ||
| 2370 | */ | ||
| 2371 | |||
| 2372 | static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | ||
| 2373 | { | ||
| 2374 | if (likely(len >= skb->len)) | ||
| 2375 | return 0; | ||
| 2376 | if (skb->ip_summed == CHECKSUM_COMPLETE) { | ||
| 2377 | __wsum adj = skb_checksum(skb, len, skb->len - len, 0); | ||
| 2378 | |||
| 2379 | skb->csum = csum_sub(skb->csum, adj); | ||
| 2380 | } | ||
| 2381 | return __pskb_trim(skb, len); | ||
| 2382 | } | ||
| 2383 | |||
| 2384 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | 2471 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, |
| 2385 | int len, void *buffer) | 2472 | int len, void *buffer) |
| 2386 | { | 2473 | { |
| @@ -2395,6 +2482,24 @@ static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | |||
| 2395 | return buffer; | 2482 | return buffer; |
| 2396 | } | 2483 | } |
| 2397 | 2484 | ||
| 2485 | /** | ||
| 2486 | * skb_needs_linearize - check if we need to linearize a given skb | ||
| 2487 | * depending on the given device features. | ||
| 2488 | * @skb: socket buffer to check | ||
| 2489 | * @features: net device features | ||
| 2490 | * | ||
| 2491 | * Returns true if either: | ||
| 2492 | * 1. skb has frag_list and the device doesn't support FRAGLIST, or | ||
| 2493 | * 2. skb is fragmented and the device does not support SG. | ||
| 2494 | */ | ||
| 2495 | static inline bool skb_needs_linearize(struct sk_buff *skb, | ||
| 2496 | netdev_features_t features) | ||
| 2497 | { | ||
| 2498 | return skb_is_nonlinear(skb) && | ||
| 2499 | ((skb_has_frag_list(skb) && !(features & NETIF_F_FRAGLIST)) || | ||
| 2500 | (skb_shinfo(skb)->nr_frags && !(features & NETIF_F_SG))); | ||
| 2501 | } | ||
| 2502 | |||
| 2398 | static inline void skb_copy_from_linear_data(const struct sk_buff *skb, | 2503 | static inline void skb_copy_from_linear_data(const struct sk_buff *skb, |
| 2399 | void *to, | 2504 | void *to, |
| 2400 | const unsigned int len) | 2505 | const unsigned int len) |
| @@ -2529,6 +2634,10 @@ static inline void sw_tx_timestamp(struct sk_buff *skb) | |||
| 2529 | * Ethernet MAC Drivers should call this function in their hard_xmit() | 2634 | * Ethernet MAC Drivers should call this function in their hard_xmit() |
| 2530 | * function immediately before giving the sk_buff to the MAC hardware. | 2635 | * function immediately before giving the sk_buff to the MAC hardware. |
| 2531 | * | 2636 | * |
| 2637 | * Specifically, one should make absolutely sure that this function is | ||
| 2638 | * called before TX completion of this packet can trigger. Otherwise | ||
| 2639 | * the packet could potentially already be freed. | ||
| 2640 | * | ||
| 2532 | * @skb: A socket buffer. | 2641 | * @skb: A socket buffer. |
| 2533 | */ | 2642 | */ |
| 2534 | static inline void skb_tx_timestamp(struct sk_buff *skb) | 2643 | static inline void skb_tx_timestamp(struct sk_buff *skb) |
| @@ -2789,6 +2898,8 @@ static inline void skb_checksum_none_assert(const struct sk_buff *skb) | |||
| 2789 | 2898 | ||
| 2790 | bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); | 2899 | bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); |
| 2791 | 2900 | ||
| 2901 | int skb_checksum_setup(struct sk_buff *skb, bool recalculate); | ||
| 2902 | |||
| 2792 | u32 __skb_get_poff(const struct sk_buff *skb); | 2903 | u32 __skb_get_poff(const struct sk_buff *skb); |
| 2793 | 2904 | ||
| 2794 | /** | 2905 | /** |
diff --git a/include/linux/slab.h b/include/linux/slab.h index c2bba248fa63..a060142aa5f5 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -388,10 +388,55 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags) | |||
| 388 | /** | 388 | /** |
| 389 | * kmalloc - allocate memory | 389 | * kmalloc - allocate memory |
| 390 | * @size: how many bytes of memory are required. | 390 | * @size: how many bytes of memory are required. |
| 391 | * @flags: the type of memory to allocate (see kcalloc). | 391 | * @flags: the type of memory to allocate. |
| 392 | * | 392 | * |
| 393 | * kmalloc is the normal method of allocating memory | 393 | * kmalloc is the normal method of allocating memory |
| 394 | * for objects smaller than page size in the kernel. | 394 | * for objects smaller than page size in the kernel. |
| 395 | * | ||
| 396 | * The @flags argument may be one of: | ||
| 397 | * | ||
| 398 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | ||
| 399 | * | ||
| 400 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | ||
| 401 | * | ||
| 402 | * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. | ||
| 403 | * For example, use this inside interrupt handlers. | ||
| 404 | * | ||
| 405 | * %GFP_HIGHUSER - Allocate pages from high memory. | ||
| 406 | * | ||
| 407 | * %GFP_NOIO - Do not do any I/O at all while trying to get memory. | ||
| 408 | * | ||
| 409 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | ||
| 410 | * | ||
| 411 | * %GFP_NOWAIT - Allocation will not sleep. | ||
| 412 | * | ||
| 413 | * %GFP_THISNODE - Allocate node-local memory only. | ||
| 414 | * | ||
| 415 | * %GFP_DMA - Allocation suitable for DMA. | ||
| 416 | * Should only be used for kmalloc() caches. Otherwise, use a | ||
| 417 | * slab created with SLAB_DMA. | ||
| 418 | * | ||
| 419 | * Also it is possible to set different flags by OR'ing | ||
| 420 | * in one or more of the following additional @flags: | ||
| 421 | * | ||
| 422 | * %__GFP_COLD - Request cache-cold pages instead of | ||
| 423 | * trying to return cache-warm pages. | ||
| 424 | * | ||
| 425 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | ||
| 426 | * | ||
| 427 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | ||
| 428 | * (think twice before using). | ||
| 429 | * | ||
| 430 | * %__GFP_NORETRY - If memory is not immediately available, | ||
| 431 | * then give up at once. | ||
| 432 | * | ||
| 433 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | ||
| 434 | * | ||
| 435 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | ||
| 436 | * | ||
| 437 | * There are other flags available as well, but these are not intended | ||
| 438 | * for general use, and so are not documented here. For a full list of | ||
| 439 | * potential flags, always refer to linux/gfp.h. | ||
| 395 | */ | 440 | */ |
| 396 | static __always_inline void *kmalloc(size_t size, gfp_t flags) | 441 | static __always_inline void *kmalloc(size_t size, gfp_t flags) |
| 397 | { | 442 | { |
| @@ -468,7 +513,9 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
| 468 | * | 513 | * |
| 469 | * Both the root cache and the child caches will have it. For the root cache, | 514 | * Both the root cache and the child caches will have it. For the root cache, |
| 470 | * this will hold a dynamically allocated array large enough to hold | 515 | * this will hold a dynamically allocated array large enough to hold |
| 471 | * information about the currently limited memcgs in the system. | 516 | * information about the currently limited memcgs in the system. To allow the |
| 517 | * array to be accessed without taking any locks, on relocation we free the old | ||
| 518 | * version only after a grace period. | ||
| 472 | * | 519 | * |
| 473 | * Child caches will hold extra metadata needed for its operation. Fields are: | 520 | * Child caches will hold extra metadata needed for its operation. Fields are: |
| 474 | * | 521 | * |
| @@ -483,7 +530,10 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
| 483 | struct memcg_cache_params { | 530 | struct memcg_cache_params { |
| 484 | bool is_root_cache; | 531 | bool is_root_cache; |
| 485 | union { | 532 | union { |
| 486 | struct kmem_cache *memcg_caches[0]; | 533 | struct { |
| 534 | struct rcu_head rcu_head; | ||
| 535 | struct kmem_cache *memcg_caches[0]; | ||
| 536 | }; | ||
| 487 | struct { | 537 | struct { |
| 488 | struct mem_cgroup *memcg; | 538 | struct mem_cgroup *memcg; |
| 489 | struct list_head list; | 539 | struct list_head list; |
| @@ -502,61 +552,6 @@ int cache_show(struct kmem_cache *s, struct seq_file *m); | |||
| 502 | void print_slabinfo_header(struct seq_file *m); | 552 | void print_slabinfo_header(struct seq_file *m); |
| 503 | 553 | ||
| 504 | /** | 554 | /** |
| 505 | * kmalloc - allocate memory | ||
| 506 | * @size: how many bytes of memory are required. | ||
| 507 | * @flags: the type of memory to allocate. | ||
| 508 | * | ||
| 509 | * The @flags argument may be one of: | ||
| 510 | * | ||
| 511 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | ||
| 512 | * | ||
| 513 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | ||
| 514 | * | ||
| 515 | * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. | ||
| 516 | * For example, use this inside interrupt handlers. | ||
| 517 | * | ||
| 518 | * %GFP_HIGHUSER - Allocate pages from high memory. | ||
| 519 | * | ||
| 520 | * %GFP_NOIO - Do not do any I/O at all while trying to get memory. | ||
| 521 | * | ||
| 522 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | ||
| 523 | * | ||
| 524 | * %GFP_NOWAIT - Allocation will not sleep. | ||
| 525 | * | ||
| 526 | * %GFP_THISNODE - Allocate node-local memory only. | ||
| 527 | * | ||
| 528 | * %GFP_DMA - Allocation suitable for DMA. | ||
| 529 | * Should only be used for kmalloc() caches. Otherwise, use a | ||
| 530 | * slab created with SLAB_DMA. | ||
| 531 | * | ||
| 532 | * Also it is possible to set different flags by OR'ing | ||
| 533 | * in one or more of the following additional @flags: | ||
| 534 | * | ||
| 535 | * %__GFP_COLD - Request cache-cold pages instead of | ||
| 536 | * trying to return cache-warm pages. | ||
| 537 | * | ||
| 538 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | ||
| 539 | * | ||
| 540 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | ||
| 541 | * (think twice before using). | ||
| 542 | * | ||
| 543 | * %__GFP_NORETRY - If memory is not immediately available, | ||
| 544 | * then give up at once. | ||
| 545 | * | ||
| 546 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | ||
| 547 | * | ||
| 548 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | ||
| 549 | * | ||
| 550 | * There are other flags available as well, but these are not intended | ||
| 551 | * for general use, and so are not documented here. For a full list of | ||
| 552 | * potential flags, always refer to linux/gfp.h. | ||
| 553 | * | ||
| 554 | * kmalloc is the normal method of allocating memory | ||
| 555 | * in the kernel. | ||
| 556 | */ | ||
| 557 | static __always_inline void *kmalloc(size_t size, gfp_t flags); | ||
| 558 | |||
| 559 | /** | ||
| 560 | * kmalloc_array - allocate memory for an array. | 555 | * kmalloc_array - allocate memory for an array. |
| 561 | * @n: number of elements. | 556 | * @n: number of elements. |
| 562 | * @size: element size. | 557 | * @size: element size. |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 09bfffb08a56..8235dfbb3b05 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
| @@ -1,18 +1,20 @@ | |||
| 1 | #ifndef _LINUX_SLAB_DEF_H | 1 | #ifndef _LINUX_SLAB_DEF_H |
| 2 | #define _LINUX_SLAB_DEF_H | 2 | #define _LINUX_SLAB_DEF_H |
| 3 | 3 | ||
| 4 | #include <linux/reciprocal_div.h> | ||
| 5 | |||
| 4 | /* | 6 | /* |
| 5 | * Definitions unique to the original Linux SLAB allocator. | 7 | * Definitions unique to the original Linux SLAB allocator. |
| 6 | */ | 8 | */ |
| 7 | 9 | ||
| 8 | struct kmem_cache { | 10 | struct kmem_cache { |
| 9 | /* 1) Cache tunables. Protected by cache_chain_mutex */ | 11 | /* 1) Cache tunables. Protected by slab_mutex */ |
| 10 | unsigned int batchcount; | 12 | unsigned int batchcount; |
| 11 | unsigned int limit; | 13 | unsigned int limit; |
| 12 | unsigned int shared; | 14 | unsigned int shared; |
| 13 | 15 | ||
| 14 | unsigned int size; | 16 | unsigned int size; |
| 15 | u32 reciprocal_buffer_size; | 17 | struct reciprocal_value reciprocal_buffer_size; |
| 16 | /* 2) touched by every alloc & free from the backend */ | 18 | /* 2) touched by every alloc & free from the backend */ |
| 17 | 19 | ||
| 18 | unsigned int flags; /* constant flags */ | 20 | unsigned int flags; /* constant flags */ |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 445ef7519dc2..8e98297f1388 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
| @@ -45,13 +45,13 @@ struct linger { | |||
| 45 | */ | 45 | */ |
| 46 | 46 | ||
| 47 | struct msghdr { | 47 | struct msghdr { |
| 48 | void * msg_name; /* Socket name */ | 48 | void *msg_name; /* ptr to socket address structure */ |
| 49 | int msg_namelen; /* Length of name */ | 49 | int msg_namelen; /* size of socket address structure */ |
| 50 | struct iovec * msg_iov; /* Data blocks */ | 50 | struct iovec *msg_iov; /* scatter/gather array */ |
| 51 | __kernel_size_t msg_iovlen; /* Number of blocks */ | 51 | __kernel_size_t msg_iovlen; /* # elements in msg_iov */ |
| 52 | void * msg_control; /* Per protocol magic (eg BSD file descriptor passing) */ | 52 | void *msg_control; /* ancillary data */ |
| 53 | __kernel_size_t msg_controllen; /* Length of cmsg list */ | 53 | __kernel_size_t msg_controllen; /* ancillary data buffer length */ |
| 54 | unsigned int msg_flags; | 54 | unsigned int msg_flags; /* flags on received message */ |
| 55 | }; | 55 | }; |
| 56 | 56 | ||
| 57 | /* For recvmmsg/sendmmsg */ | 57 | /* For recvmmsg/sendmmsg */ |
| @@ -305,8 +305,6 @@ struct ucred { | |||
| 305 | /* IPX options */ | 305 | /* IPX options */ |
| 306 | #define IPX_TYPE 1 | 306 | #define IPX_TYPE 1 |
| 307 | 307 | ||
| 308 | extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred); | ||
| 309 | |||
| 310 | extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, | 308 | extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, |
| 311 | int offset, int len); | 309 | int offset, int len); |
| 312 | extern int csum_partial_copy_fromiovecend(unsigned char *kdata, | 310 | extern int csum_partial_copy_fromiovecend(unsigned char *kdata, |
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h deleted file mode 100644 index 0aa6acc73317..000000000000 --- a/include/linux/spi/74x164.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #ifndef LINUX_SPI_74X164_H | ||
| 2 | #define LINUX_SPI_74X164_H | ||
| 3 | |||
| 4 | struct gen_74x164_chip_platform_data { | ||
| 5 | /* number assigned to the first GPIO */ | ||
| 6 | unsigned base; | ||
| 7 | }; | ||
| 8 | |||
| 9 | #endif | ||
diff --git a/include/linux/spi/s3c24xx.h b/include/linux/spi/s3c24xx.h index c23b923e493b..ca271c06c591 100644 --- a/include/linux/spi/s3c24xx.h +++ b/include/linux/spi/s3c24xx.h | |||
| @@ -23,4 +23,6 @@ struct s3c2410_spi_info { | |||
| 23 | void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol); | 23 | void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol); |
| 24 | }; | 24 | }; |
| 25 | 25 | ||
| 26 | extern int s3c24xx_set_fiq(unsigned int irq, bool on); | ||
| 27 | |||
| 26 | #endif /* __LINUX_SPI_S3C24XX_H */ | 28 | #endif /* __LINUX_SPI_S3C24XX_H */ |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 8c62ba74dd91..a1d4ca290862 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
| @@ -75,6 +75,7 @@ struct spi_device { | |||
| 75 | struct spi_master *master; | 75 | struct spi_master *master; |
| 76 | u32 max_speed_hz; | 76 | u32 max_speed_hz; |
| 77 | u8 chip_select; | 77 | u8 chip_select; |
| 78 | u8 bits_per_word; | ||
| 78 | u16 mode; | 79 | u16 mode; |
| 79 | #define SPI_CPHA 0x01 /* clock phase */ | 80 | #define SPI_CPHA 0x01 /* clock phase */ |
| 80 | #define SPI_CPOL 0x02 /* clock polarity */ | 81 | #define SPI_CPOL 0x02 /* clock polarity */ |
| @@ -92,7 +93,6 @@ struct spi_device { | |||
| 92 | #define SPI_TX_QUAD 0x200 /* transmit with 4 wires */ | 93 | #define SPI_TX_QUAD 0x200 /* transmit with 4 wires */ |
| 93 | #define SPI_RX_DUAL 0x400 /* receive with 2 wires */ | 94 | #define SPI_RX_DUAL 0x400 /* receive with 2 wires */ |
| 94 | #define SPI_RX_QUAD 0x800 /* receive with 4 wires */ | 95 | #define SPI_RX_QUAD 0x800 /* receive with 4 wires */ |
| 95 | u8 bits_per_word; | ||
| 96 | int irq; | 96 | int irq; |
| 97 | void *controller_state; | 97 | void *controller_state; |
| 98 | void *controller_data; | 98 | void *controller_data; |
| @@ -277,15 +277,17 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
| 277 | * @unprepare_transfer_hardware: there are currently no more messages on the | 277 | * @unprepare_transfer_hardware: there are currently no more messages on the |
| 278 | * queue so the subsystem notifies the driver that it may relax the | 278 | * queue so the subsystem notifies the driver that it may relax the |
| 279 | * hardware by issuing this call | 279 | * hardware by issuing this call |
| 280 | * @set_cs: assert or deassert chip select, true to assert. May be called | 280 | * @set_cs: set the logic level of the chip select line. May be called |
| 281 | * from interrupt context. | 281 | * from interrupt context. |
| 282 | * @prepare_message: set up the controller to transfer a single message, | 282 | * @prepare_message: set up the controller to transfer a single message, |
| 283 | * for example doing DMA mapping. Called from threaded | 283 | * for example doing DMA mapping. Called from threaded |
| 284 | * context. | 284 | * context. |
| 285 | * @transfer_one: transfer a single spi_transfer. When the | 285 | * @transfer_one: transfer a single spi_transfer. |
| 286 | * driver is finished with this transfer it must call | 286 | * - return 0 if the transfer is finished, |
| 287 | * spi_finalize_current_transfer() so the subsystem can issue | 287 | * - return 1 if the transfer is still in progress. When |
| 288 | * the next transfer | 288 | * the driver is finished with this transfer it must |
| 289 | * call spi_finalize_current_transfer() so the subsystem | ||
| 290 | * can issue the next transfer | ||
| 289 | * @unprepare_message: undo any work done by prepare_message(). | 291 | * @unprepare_message: undo any work done by prepare_message(). |
| 290 | * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS | 292 | * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS |
| 291 | * number. Any individual value may be -ENOENT for CS lines that | 293 | * number. Any individual value may be -ENOENT for CS lines that |
| @@ -576,8 +578,8 @@ struct spi_transfer { | |||
| 576 | dma_addr_t rx_dma; | 578 | dma_addr_t rx_dma; |
| 577 | 579 | ||
| 578 | unsigned cs_change:1; | 580 | unsigned cs_change:1; |
| 579 | u8 tx_nbits; | 581 | unsigned tx_nbits:3; |
| 580 | u8 rx_nbits; | 582 | unsigned rx_nbits:3; |
| 581 | #define SPI_NBITS_SINGLE 0x01 /* 1bit transfer */ | 583 | #define SPI_NBITS_SINGLE 0x01 /* 1bit transfer */ |
| 582 | #define SPI_NBITS_DUAL 0x02 /* 2bits transfer */ | 584 | #define SPI_NBITS_DUAL 0x02 /* 2bits transfer */ |
| 583 | #define SPI_NBITS_QUAD 0x04 /* 4bits transfer */ | 585 | #define SPI_NBITS_QUAD 0x04 /* 4bits transfer */ |
| @@ -847,7 +849,7 @@ static inline ssize_t spi_w8r16(struct spi_device *spi, u8 cmd) | |||
| 847 | ssize_t status; | 849 | ssize_t status; |
| 848 | u16 result; | 850 | u16 result; |
| 849 | 851 | ||
| 850 | status = spi_write_then_read(spi, &cmd, 1, (u8 *) &result, 2); | 852 | status = spi_write_then_read(spi, &cmd, 1, &result, 2); |
| 851 | 853 | ||
| 852 | /* return negative errno or unsigned value */ | 854 | /* return negative errno or unsigned value */ |
| 853 | return (status < 0) ? status : result; | 855 | return (status < 0) ? status : result; |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 75f34949d9ab..3f2867ff0ced 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
| @@ -130,6 +130,16 @@ do { \ | |||
| 130 | #define smp_mb__before_spinlock() smp_wmb() | 130 | #define smp_mb__before_spinlock() smp_wmb() |
| 131 | #endif | 131 | #endif |
| 132 | 132 | ||
| 133 | /* | ||
| 134 | * Place this after a lock-acquisition primitive to guarantee that | ||
| 135 | * an UNLOCK+LOCK pair act as a full barrier. This guarantee applies | ||
| 136 | * if the UNLOCK and LOCK are executed by the same CPU or if the | ||
| 137 | * UNLOCK and LOCK operate on the same lock variable. | ||
| 138 | */ | ||
| 139 | #ifndef smp_mb__after_unlock_lock | ||
| 140 | #define smp_mb__after_unlock_lock() do { } while (0) | ||
| 141 | #endif | ||
| 142 | |||
| 133 | /** | 143 | /** |
| 134 | * raw_spin_unlock_wait - wait until the spinlock gets unlocked | 144 | * raw_spin_unlock_wait - wait until the spinlock gets unlocked |
| 135 | * @lock: the spinlock in question. | 145 | * @lock: the spinlock in question. |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index bdb9993f0fda..42dfab89e740 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
| @@ -131,8 +131,7 @@ static inline void __raw_spin_lock_irq(raw_spinlock_t *lock) | |||
| 131 | 131 | ||
| 132 | static inline void __raw_spin_lock_bh(raw_spinlock_t *lock) | 132 | static inline void __raw_spin_lock_bh(raw_spinlock_t *lock) |
| 133 | { | 133 | { |
| 134 | local_bh_disable(); | 134 | __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 135 | preempt_disable(); | ||
| 136 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 135 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
| 137 | LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); | 136 | LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); |
| 138 | } | 137 | } |
| @@ -174,20 +173,17 @@ static inline void __raw_spin_unlock_bh(raw_spinlock_t *lock) | |||
| 174 | { | 173 | { |
| 175 | spin_release(&lock->dep_map, 1, _RET_IP_); | 174 | spin_release(&lock->dep_map, 1, _RET_IP_); |
| 176 | do_raw_spin_unlock(lock); | 175 | do_raw_spin_unlock(lock); |
| 177 | preempt_enable_no_resched(); | 176 | __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 178 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 179 | } | 177 | } |
| 180 | 178 | ||
| 181 | static inline int __raw_spin_trylock_bh(raw_spinlock_t *lock) | 179 | static inline int __raw_spin_trylock_bh(raw_spinlock_t *lock) |
| 182 | { | 180 | { |
| 183 | local_bh_disable(); | 181 | __local_bh_disable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 184 | preempt_disable(); | ||
| 185 | if (do_raw_spin_trylock(lock)) { | 182 | if (do_raw_spin_trylock(lock)) { |
| 186 | spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); | 183 | spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); |
| 187 | return 1; | 184 | return 1; |
| 188 | } | 185 | } |
| 189 | preempt_enable_no_resched(); | 186 | __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET); |
| 190 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 191 | return 0; | 187 | return 0; |
| 192 | } | 188 | } |
| 193 | 189 | ||
diff --git a/include/linux/spinlock_api_up.h b/include/linux/spinlock_api_up.h index af1f47229e70..d0d188861ad6 100644 --- a/include/linux/spinlock_api_up.h +++ b/include/linux/spinlock_api_up.h | |||
| @@ -24,11 +24,14 @@ | |||
| 24 | * flags straight, to suppress compiler warnings of unused lock | 24 | * flags straight, to suppress compiler warnings of unused lock |
| 25 | * variables, and to add the proper checker annotations: | 25 | * variables, and to add the proper checker annotations: |
| 26 | */ | 26 | */ |
| 27 | #define ___LOCK(lock) \ | ||
| 28 | do { __acquire(lock); (void)(lock); } while (0) | ||
| 29 | |||
| 27 | #define __LOCK(lock) \ | 30 | #define __LOCK(lock) \ |
| 28 | do { preempt_disable(); __acquire(lock); (void)(lock); } while (0) | 31 | do { preempt_disable(); ___LOCK(lock); } while (0) |
| 29 | 32 | ||
| 30 | #define __LOCK_BH(lock) \ | 33 | #define __LOCK_BH(lock) \ |
| 31 | do { local_bh_disable(); __LOCK(lock); } while (0) | 34 | do { __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_LOCK_OFFSET); ___LOCK(lock); } while (0) |
| 32 | 35 | ||
| 33 | #define __LOCK_IRQ(lock) \ | 36 | #define __LOCK_IRQ(lock) \ |
| 34 | do { local_irq_disable(); __LOCK(lock); } while (0) | 37 | do { local_irq_disable(); __LOCK(lock); } while (0) |
| @@ -36,12 +39,15 @@ | |||
| 36 | #define __LOCK_IRQSAVE(lock, flags) \ | 39 | #define __LOCK_IRQSAVE(lock, flags) \ |
| 37 | do { local_irq_save(flags); __LOCK(lock); } while (0) | 40 | do { local_irq_save(flags); __LOCK(lock); } while (0) |
| 38 | 41 | ||
| 42 | #define ___UNLOCK(lock) \ | ||
| 43 | do { __release(lock); (void)(lock); } while (0) | ||
| 44 | |||
| 39 | #define __UNLOCK(lock) \ | 45 | #define __UNLOCK(lock) \ |
| 40 | do { preempt_enable(); __release(lock); (void)(lock); } while (0) | 46 | do { preempt_enable(); ___UNLOCK(lock); } while (0) |
| 41 | 47 | ||
| 42 | #define __UNLOCK_BH(lock) \ | 48 | #define __UNLOCK_BH(lock) \ |
| 43 | do { preempt_enable_no_resched(); local_bh_enable(); \ | 49 | do { __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_LOCK_OFFSET); \ |
| 44 | __release(lock); (void)(lock); } while (0) | 50 | ___UNLOCK(lock); } while (0) |
| 45 | 51 | ||
| 46 | #define __UNLOCK_IRQ(lock) \ | 52 | #define __UNLOCK_IRQ(lock) \ |
| 47 | do { local_irq_enable(); __UNLOCK(lock); } while (0) | 53 | do { local_irq_enable(); __UNLOCK(lock); } while (0) |
diff --git a/include/linux/ssbi.h b/include/linux/ssbi.h index 44ef5da21470..bcbb642a7641 100644 --- a/include/linux/ssbi.h +++ b/include/linux/ssbi.h | |||
| @@ -17,22 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
| 19 | 19 | ||
| 20 | struct ssbi_slave_info { | 20 | int ssbi_write(struct device *dev, u16 addr, const u8 *buf, int len); |
| 21 | const char *name; | ||
| 22 | void *platform_data; | ||
| 23 | }; | ||
| 24 | |||
| 25 | enum ssbi_controller_type { | ||
| 26 | MSM_SBI_CTRL_SSBI = 0, | ||
| 27 | MSM_SBI_CTRL_SSBI2, | ||
| 28 | MSM_SBI_CTRL_PMIC_ARBITER, | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct ssbi_platform_data { | ||
| 32 | struct ssbi_slave_info slave; | ||
| 33 | enum ssbi_controller_type controller_type; | ||
| 34 | }; | ||
| 35 | |||
| 36 | int ssbi_write(struct device *dev, u16 addr, u8 *buf, int len); | ||
| 37 | int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len); | 21 | int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len); |
| 22 | |||
| 38 | #endif | 23 | #endif |
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index bb5deb0feb6b..6f27d4f957bd 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
| @@ -110,12 +110,34 @@ struct plat_stmmacenet_data { | |||
| 110 | int force_sf_dma_mode; | 110 | int force_sf_dma_mode; |
| 111 | int force_thresh_dma_mode; | 111 | int force_thresh_dma_mode; |
| 112 | int riwt_off; | 112 | int riwt_off; |
| 113 | int max_speed; | ||
| 114 | int maxmtu; | ||
| 113 | void (*fix_mac_speed)(void *priv, unsigned int speed); | 115 | void (*fix_mac_speed)(void *priv, unsigned int speed); |
| 114 | void (*bus_setup)(void __iomem *ioaddr); | 116 | void (*bus_setup)(void __iomem *ioaddr); |
| 115 | int (*init)(struct platform_device *pdev); | 117 | void *(*setup)(struct platform_device *pdev); |
| 116 | void (*exit)(struct platform_device *pdev); | 118 | void (*free)(struct platform_device *pdev, void *priv); |
| 119 | int (*init)(struct platform_device *pdev, void *priv); | ||
| 120 | void (*exit)(struct platform_device *pdev, void *priv); | ||
| 117 | void *custom_cfg; | 121 | void *custom_cfg; |
| 118 | void *custom_data; | 122 | void *custom_data; |
| 119 | void *bsp_priv; | 123 | void *bsp_priv; |
| 120 | }; | 124 | }; |
| 125 | |||
| 126 | /* of_data for SoC glue layer device tree bindings */ | ||
| 127 | |||
| 128 | struct stmmac_of_data { | ||
| 129 | int has_gmac; | ||
| 130 | int enh_desc; | ||
| 131 | int tx_coe; | ||
| 132 | int rx_coe; | ||
| 133 | int bugged_jumbo; | ||
| 134 | int pmt; | ||
| 135 | int riwt_off; | ||
| 136 | void (*fix_mac_speed)(void *priv, unsigned int speed); | ||
| 137 | void (*bus_setup)(void __iomem *ioaddr); | ||
| 138 | void *(*setup)(struct platform_device *pdev); | ||
| 139 | void (*free)(struct platform_device *pdev, void *priv); | ||
| 140 | int (*init)(struct platform_device *pdev, void *priv); | ||
| 141 | void (*exit)(struct platform_device *pdev, void *priv); | ||
| 142 | }; | ||
| 121 | #endif | 143 | #endif |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 94273bbe6050..40ed9e9a77e5 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -38,6 +38,7 @@ struct rlimit; | |||
| 38 | struct rlimit64; | 38 | struct rlimit64; |
| 39 | struct rusage; | 39 | struct rusage; |
| 40 | struct sched_param; | 40 | struct sched_param; |
| 41 | struct sched_attr; | ||
| 41 | struct sel_arg_struct; | 42 | struct sel_arg_struct; |
| 42 | struct semaphore; | 43 | struct semaphore; |
| 43 | struct sembuf; | 44 | struct sembuf; |
| @@ -279,9 +280,14 @@ asmlinkage long sys_sched_setscheduler(pid_t pid, int policy, | |||
| 279 | struct sched_param __user *param); | 280 | struct sched_param __user *param); |
| 280 | asmlinkage long sys_sched_setparam(pid_t pid, | 281 | asmlinkage long sys_sched_setparam(pid_t pid, |
| 281 | struct sched_param __user *param); | 282 | struct sched_param __user *param); |
| 283 | asmlinkage long sys_sched_setattr(pid_t pid, | ||
| 284 | struct sched_attr __user *attr); | ||
| 282 | asmlinkage long sys_sched_getscheduler(pid_t pid); | 285 | asmlinkage long sys_sched_getscheduler(pid_t pid); |
| 283 | asmlinkage long sys_sched_getparam(pid_t pid, | 286 | asmlinkage long sys_sched_getparam(pid_t pid, |
| 284 | struct sched_param __user *param); | 287 | struct sched_param __user *param); |
| 288 | asmlinkage long sys_sched_getattr(pid_t pid, | ||
| 289 | struct sched_attr __user *attr, | ||
| 290 | unsigned int size); | ||
| 285 | asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, | 291 | asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, |
| 286 | unsigned long __user *user_mask_ptr); | 292 | unsigned long __user *user_mask_ptr); |
| 287 | asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, | 293 | asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len, |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 6695040a0317..30b2ebee6439 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #ifndef _SYSFS_H_ | 12 | #ifndef _SYSFS_H_ |
| 13 | #define _SYSFS_H_ | 13 | #define _SYSFS_H_ |
| 14 | 14 | ||
| 15 | #include <linux/kernfs.h> | ||
| 15 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
| 16 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 17 | #include <linux/list.h> | 18 | #include <linux/list.h> |
| @@ -175,8 +176,6 @@ struct sysfs_ops { | |||
| 175 | ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); | 176 | ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); |
| 176 | }; | 177 | }; |
| 177 | 178 | ||
| 178 | struct sysfs_dirent; | ||
| 179 | |||
| 180 | #ifdef CONFIG_SYSFS | 179 | #ifdef CONFIG_SYSFS |
| 181 | 180 | ||
| 182 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), | 181 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), |
| @@ -244,12 +243,6 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, | |||
| 244 | const char *link_name); | 243 | const char *link_name); |
| 245 | 244 | ||
| 246 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); | 245 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); |
| 247 | void sysfs_notify_dirent(struct sysfs_dirent *sd); | ||
| 248 | struct sysfs_dirent *sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, | ||
| 249 | const unsigned char *name, | ||
| 250 | const void *ns); | ||
| 251 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); | ||
| 252 | void sysfs_put(struct sysfs_dirent *sd); | ||
| 253 | 246 | ||
| 254 | int __must_check sysfs_init(void); | 247 | int __must_check sysfs_init(void); |
| 255 | 248 | ||
| @@ -419,22 +412,6 @@ static inline void sysfs_notify(struct kobject *kobj, const char *dir, | |||
| 419 | const char *attr) | 412 | const char *attr) |
| 420 | { | 413 | { |
| 421 | } | 414 | } |
| 422 | static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) | ||
| 423 | { | ||
| 424 | } | ||
| 425 | static inline struct sysfs_dirent * | ||
| 426 | sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, const unsigned char *name, | ||
| 427 | const void *ns) | ||
| 428 | { | ||
| 429 | return NULL; | ||
| 430 | } | ||
| 431 | static inline struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd) | ||
| 432 | { | ||
| 433 | return NULL; | ||
| 434 | } | ||
| 435 | static inline void sysfs_put(struct sysfs_dirent *sd) | ||
| 436 | { | ||
| 437 | } | ||
| 438 | 415 | ||
| 439 | static inline int __must_check sysfs_init(void) | 416 | static inline int __must_check sysfs_init(void) |
| 440 | { | 417 | { |
| @@ -461,10 +438,26 @@ static inline int sysfs_rename_link(struct kobject *kobj, struct kobject *target | |||
| 461 | return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL); | 438 | return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL); |
| 462 | } | 439 | } |
| 463 | 440 | ||
| 464 | static inline struct sysfs_dirent * | 441 | static inline void sysfs_notify_dirent(struct kernfs_node *kn) |
| 465 | sysfs_get_dirent(struct sysfs_dirent *parent_sd, const unsigned char *name) | 442 | { |
| 443 | kernfs_notify(kn); | ||
| 444 | } | ||
| 445 | |||
| 446 | static inline struct kernfs_node *sysfs_get_dirent(struct kernfs_node *parent, | ||
| 447 | const unsigned char *name) | ||
| 448 | { | ||
| 449 | return kernfs_find_and_get(parent, name); | ||
| 450 | } | ||
| 451 | |||
| 452 | static inline struct kernfs_node *sysfs_get(struct kernfs_node *kn) | ||
| 453 | { | ||
| 454 | kernfs_get(kn); | ||
| 455 | return kn; | ||
| 456 | } | ||
| 457 | |||
| 458 | static inline void sysfs_put(struct kernfs_node *kn) | ||
| 466 | { | 459 | { |
| 467 | return sysfs_get_dirent_ns(parent_sd, name, NULL); | 460 | kernfs_put(kn); |
| 468 | } | 461 | } |
| 469 | 462 | ||
| 470 | #endif /* _SYSFS_H_ */ | 463 | #endif /* _SYSFS_H_ */ |
diff --git a/include/linux/tboot.h b/include/linux/tboot.h index c75128bed5fa..9a54b331f938 100644 --- a/include/linux/tboot.h +++ b/include/linux/tboot.h | |||
| @@ -34,7 +34,7 @@ enum { | |||
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | #ifdef CONFIG_INTEL_TXT | 36 | #ifdef CONFIG_INTEL_TXT |
| 37 | #include <acpi/acpi.h> | 37 | #include <linux/acpi.h> |
| 38 | /* used to communicate between tboot and the launched kernel */ | 38 | /* used to communicate between tboot and the launched kernel */ |
| 39 | 39 | ||
| 40 | #define TB_KEY_SIZE 64 /* 512 bits */ | 40 | #define TB_KEY_SIZE 64 /* 512 bits */ |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index d68633452d9b..4ad0706d40eb 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
| @@ -248,7 +248,10 @@ struct tcp_sock { | |||
| 248 | struct sk_buff* lost_skb_hint; | 248 | struct sk_buff* lost_skb_hint; |
| 249 | struct sk_buff *retransmit_skb_hint; | 249 | struct sk_buff *retransmit_skb_hint; |
| 250 | 250 | ||
| 251 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ | 251 | /* OOO segments go in this list. Note that socket lock must be held, |
| 252 | * as we do not use sk_buff_head lock. | ||
| 253 | */ | ||
| 254 | struct sk_buff_head out_of_order_queue; | ||
| 252 | 255 | ||
| 253 | /* SACKs data, these 2 need to be together (see tcp_options_write) */ | 256 | /* SACKs data, these 2 need to be together (see tcp_options_write) */ |
| 254 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ | 257 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ |
diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h index c98cfa406952..46f0a07812b4 100644 --- a/include/linux/tegra-powergate.h +++ b/include/linux/tegra-powergate.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #define _MACH_TEGRA_POWERGATE_H_ | 19 | #define _MACH_TEGRA_POWERGATE_H_ |
| 20 | 20 | ||
| 21 | struct clk; | 21 | struct clk; |
| 22 | struct reset_control; | ||
| 22 | 23 | ||
| 23 | #define TEGRA_POWERGATE_CPU 0 | 24 | #define TEGRA_POWERGATE_CPU 0 |
| 24 | #define TEGRA_POWERGATE_3D 1 | 25 | #define TEGRA_POWERGATE_3D 1 |
| @@ -37,20 +38,97 @@ struct clk; | |||
| 37 | #define TEGRA_POWERGATE_CPU0 14 | 38 | #define TEGRA_POWERGATE_CPU0 14 |
| 38 | #define TEGRA_POWERGATE_C0NC 15 | 39 | #define TEGRA_POWERGATE_C0NC 15 |
| 39 | #define TEGRA_POWERGATE_C1NC 16 | 40 | #define TEGRA_POWERGATE_C1NC 16 |
| 41 | #define TEGRA_POWERGATE_SOR 17 | ||
| 40 | #define TEGRA_POWERGATE_DIS 18 | 42 | #define TEGRA_POWERGATE_DIS 18 |
| 41 | #define TEGRA_POWERGATE_DISB 19 | 43 | #define TEGRA_POWERGATE_DISB 19 |
| 42 | #define TEGRA_POWERGATE_XUSBA 20 | 44 | #define TEGRA_POWERGATE_XUSBA 20 |
| 43 | #define TEGRA_POWERGATE_XUSBB 21 | 45 | #define TEGRA_POWERGATE_XUSBB 21 |
| 44 | #define TEGRA_POWERGATE_XUSBC 22 | 46 | #define TEGRA_POWERGATE_XUSBC 22 |
| 47 | #define TEGRA_POWERGATE_VIC 23 | ||
| 48 | #define TEGRA_POWERGATE_IRAM 24 | ||
| 45 | 49 | ||
| 46 | #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D | 50 | #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D |
| 47 | 51 | ||
| 52 | #define TEGRA_IO_RAIL_CSIA 0 | ||
| 53 | #define TEGRA_IO_RAIL_CSIB 1 | ||
| 54 | #define TEGRA_IO_RAIL_DSI 2 | ||
| 55 | #define TEGRA_IO_RAIL_MIPI_BIAS 3 | ||
| 56 | #define TEGRA_IO_RAIL_PEX_BIAS 4 | ||
| 57 | #define TEGRA_IO_RAIL_PEX_CLK1 5 | ||
| 58 | #define TEGRA_IO_RAIL_PEX_CLK2 6 | ||
| 59 | #define TEGRA_IO_RAIL_USB0 9 | ||
| 60 | #define TEGRA_IO_RAIL_USB1 10 | ||
| 61 | #define TEGRA_IO_RAIL_USB2 11 | ||
| 62 | #define TEGRA_IO_RAIL_USB_BIAS 12 | ||
| 63 | #define TEGRA_IO_RAIL_NAND 13 | ||
| 64 | #define TEGRA_IO_RAIL_UART 14 | ||
| 65 | #define TEGRA_IO_RAIL_BB 15 | ||
| 66 | #define TEGRA_IO_RAIL_AUDIO 17 | ||
| 67 | #define TEGRA_IO_RAIL_HSIC 19 | ||
| 68 | #define TEGRA_IO_RAIL_COMP 22 | ||
| 69 | #define TEGRA_IO_RAIL_HDMI 28 | ||
| 70 | #define TEGRA_IO_RAIL_PEX_CNTRL 32 | ||
| 71 | #define TEGRA_IO_RAIL_SDMMC1 33 | ||
| 72 | #define TEGRA_IO_RAIL_SDMMC3 34 | ||
| 73 | #define TEGRA_IO_RAIL_SDMMC4 35 | ||
| 74 | #define TEGRA_IO_RAIL_CAM 36 | ||
| 75 | #define TEGRA_IO_RAIL_RES 37 | ||
| 76 | #define TEGRA_IO_RAIL_HV 38 | ||
| 77 | #define TEGRA_IO_RAIL_DSIB 39 | ||
| 78 | #define TEGRA_IO_RAIL_DSIC 40 | ||
| 79 | #define TEGRA_IO_RAIL_DSID 41 | ||
| 80 | #define TEGRA_IO_RAIL_CSIE 44 | ||
| 81 | #define TEGRA_IO_RAIL_LVDS 57 | ||
| 82 | #define TEGRA_IO_RAIL_SYS_DDC 58 | ||
| 83 | |||
| 84 | #ifdef CONFIG_ARCH_TEGRA | ||
| 48 | int tegra_powergate_is_powered(int id); | 85 | int tegra_powergate_is_powered(int id); |
| 49 | int tegra_powergate_power_on(int id); | 86 | int tegra_powergate_power_on(int id); |
| 50 | int tegra_powergate_power_off(int id); | 87 | int tegra_powergate_power_off(int id); |
| 51 | int tegra_powergate_remove_clamping(int id); | 88 | int tegra_powergate_remove_clamping(int id); |
| 52 | 89 | ||
| 53 | /* Must be called with clk disabled, and returns with clk enabled */ | 90 | /* Must be called with clk disabled, and returns with clk enabled */ |
| 54 | int tegra_powergate_sequence_power_up(int id, struct clk *clk); | 91 | int tegra_powergate_sequence_power_up(int id, struct clk *clk, |
| 92 | struct reset_control *rst); | ||
| 93 | |||
| 94 | int tegra_io_rail_power_on(int id); | ||
| 95 | int tegra_io_rail_power_off(int id); | ||
| 96 | #else | ||
| 97 | static inline int tegra_powergate_is_powered(int id) | ||
| 98 | { | ||
| 99 | return -ENOSYS; | ||
| 100 | } | ||
| 101 | |||
| 102 | static inline int tegra_powergate_power_on(int id) | ||
| 103 | { | ||
| 104 | return -ENOSYS; | ||
| 105 | } | ||
| 106 | |||
| 107 | static inline int tegra_powergate_power_off(int id) | ||
| 108 | { | ||
| 109 | return -ENOSYS; | ||
| 110 | } | ||
| 111 | |||
| 112 | static inline int tegra_powergate_remove_clamping(int id) | ||
| 113 | { | ||
| 114 | return -ENOSYS; | ||
| 115 | } | ||
| 116 | |||
| 117 | static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk, | ||
| 118 | struct reset_control *rst) | ||
| 119 | { | ||
| 120 | return -ENOSYS; | ||
| 121 | } | ||
| 122 | |||
| 123 | static inline int tegra_io_rail_power_on(int id) | ||
| 124 | { | ||
| 125 | return -ENOSYS; | ||
| 126 | } | ||
| 127 | |||
| 128 | static inline int tegra_io_rail_power_off(int id) | ||
| 129 | { | ||
| 130 | return -ENOSYS; | ||
| 131 | } | ||
| 132 | #endif | ||
| 55 | 133 | ||
| 56 | #endif /* _MACH_TEGRA_POWERGATE_H_ */ | 134 | #endif /* _MACH_TEGRA_POWERGATE_H_ */ |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index b268d3cf7ae3..f7e11c7ea7d9 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #ifndef __THERMAL_H__ | 25 | #ifndef __THERMAL_H__ |
| 26 | #define __THERMAL_H__ | 26 | #define __THERMAL_H__ |
| 27 | 27 | ||
| 28 | #include <linux/of.h> | ||
| 28 | #include <linux/idr.h> | 29 | #include <linux/idr.h> |
| 29 | #include <linux/device.h> | 30 | #include <linux/device.h> |
| 30 | #include <linux/workqueue.h> | 31 | #include <linux/workqueue.h> |
| @@ -143,6 +144,7 @@ struct thermal_cooling_device { | |||
| 143 | int id; | 144 | int id; |
| 144 | char type[THERMAL_NAME_LENGTH]; | 145 | char type[THERMAL_NAME_LENGTH]; |
| 145 | struct device device; | 146 | struct device device; |
| 147 | struct device_node *np; | ||
| 146 | void *devdata; | 148 | void *devdata; |
| 147 | const struct thermal_cooling_device_ops *ops; | 149 | const struct thermal_cooling_device_ops *ops; |
| 148 | bool updated; /* true if the cooling device does not need update */ | 150 | bool updated; /* true if the cooling device does not need update */ |
| @@ -172,7 +174,7 @@ struct thermal_zone_device { | |||
| 172 | int emul_temperature; | 174 | int emul_temperature; |
| 173 | int passive; | 175 | int passive; |
| 174 | unsigned int forced_passive; | 176 | unsigned int forced_passive; |
| 175 | const struct thermal_zone_device_ops *ops; | 177 | struct thermal_zone_device_ops *ops; |
| 176 | const struct thermal_zone_params *tzp; | 178 | const struct thermal_zone_params *tzp; |
| 177 | struct thermal_governor *governor; | 179 | struct thermal_governor *governor; |
| 178 | struct list_head thermal_instances; | 180 | struct list_head thermal_instances; |
| @@ -242,8 +244,31 @@ struct thermal_genl_event { | |||
| 242 | }; | 244 | }; |
| 243 | 245 | ||
| 244 | /* Function declarations */ | 246 | /* Function declarations */ |
| 247 | #ifdef CONFIG_THERMAL_OF | ||
| 248 | struct thermal_zone_device * | ||
| 249 | thermal_zone_of_sensor_register(struct device *dev, int id, | ||
| 250 | void *data, int (*get_temp)(void *, long *), | ||
| 251 | int (*get_trend)(void *, long *)); | ||
| 252 | void thermal_zone_of_sensor_unregister(struct device *dev, | ||
| 253 | struct thermal_zone_device *tz); | ||
| 254 | #else | ||
| 255 | static inline struct thermal_zone_device * | ||
| 256 | thermal_zone_of_sensor_register(struct device *dev, int id, | ||
| 257 | void *data, int (*get_temp)(void *, long *), | ||
| 258 | int (*get_trend)(void *, long *)) | ||
| 259 | { | ||
| 260 | return NULL; | ||
| 261 | } | ||
| 262 | |||
| 263 | static inline | ||
| 264 | void thermal_zone_of_sensor_unregister(struct device *dev, | ||
| 265 | struct thermal_zone_device *tz) | ||
| 266 | { | ||
| 267 | } | ||
| 268 | |||
| 269 | #endif | ||
| 245 | struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, | 270 | struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, |
| 246 | void *, const struct thermal_zone_device_ops *, | 271 | void *, struct thermal_zone_device_ops *, |
| 247 | const struct thermal_zone_params *, int, int); | 272 | const struct thermal_zone_params *, int, int); |
| 248 | void thermal_zone_device_unregister(struct thermal_zone_device *); | 273 | void thermal_zone_device_unregister(struct thermal_zone_device *); |
| 249 | 274 | ||
| @@ -256,6 +281,9 @@ void thermal_zone_device_update(struct thermal_zone_device *); | |||
| 256 | 281 | ||
| 257 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, | 282 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, |
| 258 | const struct thermal_cooling_device_ops *); | 283 | const struct thermal_cooling_device_ops *); |
| 284 | struct thermal_cooling_device * | ||
| 285 | thermal_of_cooling_device_register(struct device_node *np, char *, void *, | ||
| 286 | const struct thermal_cooling_device_ops *); | ||
| 259 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); | 287 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); |
| 260 | struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name); | 288 | struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name); |
| 261 | int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp); | 289 | int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp); |
diff --git a/include/linux/tick.h b/include/linux/tick.h index 5128d33bbb39..0175d8663b6c 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
| @@ -104,7 +104,7 @@ extern struct cpumask *tick_get_broadcast_oneshot_mask(void); | |||
| 104 | extern void tick_clock_notify(void); | 104 | extern void tick_clock_notify(void); |
| 105 | extern int tick_check_oneshot_change(int allow_nohz); | 105 | extern int tick_check_oneshot_change(int allow_nohz); |
| 106 | extern struct tick_sched *tick_get_tick_sched(int cpu); | 106 | extern struct tick_sched *tick_get_tick_sched(int cpu); |
| 107 | extern void tick_check_idle(int cpu); | 107 | extern void tick_check_idle(void); |
| 108 | extern int tick_oneshot_mode_active(void); | 108 | extern int tick_oneshot_mode_active(void); |
| 109 | # ifndef arch_needs_cpu | 109 | # ifndef arch_needs_cpu |
| 110 | # define arch_needs_cpu(cpu) (0) | 110 | # define arch_needs_cpu(cpu) (0) |
| @@ -112,7 +112,7 @@ extern int tick_oneshot_mode_active(void); | |||
| 112 | # else | 112 | # else |
| 113 | static inline void tick_clock_notify(void) { } | 113 | static inline void tick_clock_notify(void) { } |
| 114 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | 114 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } |
| 115 | static inline void tick_check_idle(int cpu) { } | 115 | static inline void tick_check_idle(void) { } |
| 116 | static inline int tick_oneshot_mode_active(void) { return 0; } | 116 | static inline int tick_oneshot_mode_active(void) { return 0; } |
| 117 | # endif | 117 | # endif |
| 118 | 118 | ||
| @@ -121,7 +121,7 @@ static inline void tick_init(void) { } | |||
| 121 | static inline void tick_cancel_sched_timer(int cpu) { } | 121 | static inline void tick_cancel_sched_timer(int cpu) { } |
| 122 | static inline void tick_clock_notify(void) { } | 122 | static inline void tick_clock_notify(void) { } |
| 123 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | 123 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } |
| 124 | static inline void tick_check_idle(int cpu) { } | 124 | static inline void tick_check_idle(void) { } |
| 125 | static inline int tick_oneshot_mode_active(void) { return 0; } | 125 | static inline int tick_oneshot_mode_active(void) { return 0; } |
| 126 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ | 126 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ |
| 127 | 127 | ||
| @@ -165,7 +165,7 @@ extern cpumask_var_t tick_nohz_full_mask; | |||
| 165 | 165 | ||
| 166 | static inline bool tick_nohz_full_enabled(void) | 166 | static inline bool tick_nohz_full_enabled(void) |
| 167 | { | 167 | { |
| 168 | if (!static_key_false(&context_tracking_enabled)) | 168 | if (!context_tracking_is_enabled()) |
| 169 | return false; | 169 | return false; |
| 170 | 170 | ||
| 171 | return tick_nohz_full_running; | 171 | return tick_nohz_full_running; |
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index 9a9051bb1a03..fff1d0976f80 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h | |||
| @@ -29,6 +29,18 @@ | |||
| 29 | */ | 29 | */ |
| 30 | #define TPM_ANY_NUM 0xFFFF | 30 | #define TPM_ANY_NUM 0xFFFF |
| 31 | 31 | ||
| 32 | struct tpm_chip; | ||
| 33 | |||
| 34 | struct tpm_class_ops { | ||
| 35 | const u8 req_complete_mask; | ||
| 36 | const u8 req_complete_val; | ||
| 37 | bool (*req_canceled)(struct tpm_chip *chip, u8 status); | ||
| 38 | int (*recv) (struct tpm_chip *chip, u8 *buf, size_t len); | ||
| 39 | int (*send) (struct tpm_chip *chip, u8 *buf, size_t len); | ||
| 40 | void (*cancel) (struct tpm_chip *chip); | ||
| 41 | u8 (*status) (struct tpm_chip *chip); | ||
| 42 | }; | ||
| 43 | |||
| 32 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) | 44 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) |
| 33 | 45 | ||
| 34 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); | 46 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index ebeab360d851..accc497f8d72 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -267,6 +267,8 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 267 | 267 | ||
| 268 | #define TRACE_EVENT_FLAGS(event, flag) | 268 | #define TRACE_EVENT_FLAGS(event, flag) |
| 269 | 269 | ||
| 270 | #define TRACE_EVENT_PERF_PERM(event, expr...) | ||
| 271 | |||
| 270 | #endif /* DECLARE_TRACE */ | 272 | #endif /* DECLARE_TRACE */ |
| 271 | 273 | ||
| 272 | #ifndef TRACE_EVENT | 274 | #ifndef TRACE_EVENT |
| @@ -274,7 +276,7 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 274 | * For use with the TRACE_EVENT macro: | 276 | * For use with the TRACE_EVENT macro: |
| 275 | * | 277 | * |
| 276 | * We define a tracepoint, its arguments, its printk format | 278 | * We define a tracepoint, its arguments, its printk format |
| 277 | * and its 'fast binay record' layout. | 279 | * and its 'fast binary record' layout. |
| 278 | * | 280 | * |
| 279 | * Firstly, name your tracepoint via TRACE_EVENT(name : the | 281 | * Firstly, name your tracepoint via TRACE_EVENT(name : the |
| 280 | * 'subsystem_event' notation is fine. | 282 | * 'subsystem_event' notation is fine. |
| @@ -399,4 +401,6 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 399 | 401 | ||
| 400 | #define TRACE_EVENT_FLAGS(event, flag) | 402 | #define TRACE_EVENT_FLAGS(event, flag) |
| 401 | 403 | ||
| 404 | #define TRACE_EVENT_PERF_PERM(event, expr...) | ||
| 405 | |||
| 402 | #endif /* ifdef TRACE_EVENT (see note above) */ | 406 | #endif /* ifdef TRACE_EVENT (see note above) */ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 97d660ed70c1..90b4fdc8a61f 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -39,10 +39,14 @@ struct tty_buffer { | |||
| 39 | int size; | 39 | int size; |
| 40 | int commit; | 40 | int commit; |
| 41 | int read; | 41 | int read; |
| 42 | int flags; | ||
| 42 | /* Data points here */ | 43 | /* Data points here */ |
| 43 | unsigned long data[0]; | 44 | unsigned long data[0]; |
| 44 | }; | 45 | }; |
| 45 | 46 | ||
| 47 | /* Values for .flags field of tty_buffer */ | ||
| 48 | #define TTYB_NORMAL 1 /* buffer has no flags buffer */ | ||
| 49 | |||
| 46 | static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs) | 50 | static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs) |
| 47 | { | 51 | { |
| 48 | return ((unsigned char *)b->data) + ofs; | 52 | return ((unsigned char *)b->data) + ofs; |
| @@ -60,7 +64,8 @@ struct tty_bufhead { | |||
| 60 | atomic_t priority; | 64 | atomic_t priority; |
| 61 | struct tty_buffer sentinel; | 65 | struct tty_buffer sentinel; |
| 62 | struct llist_head free; /* Free queue head */ | 66 | struct llist_head free; /* Free queue head */ |
| 63 | atomic_t memory_used; /* In-use buffers excluding free list */ | 67 | atomic_t mem_used; /* In-use buffers excluding free list */ |
| 68 | int mem_limit; | ||
| 64 | struct tty_buffer *tail; /* Active buffer */ | 69 | struct tty_buffer *tail; /* Active buffer */ |
| 65 | }; | 70 | }; |
| 66 | /* | 71 | /* |
| @@ -137,6 +142,7 @@ struct tty_bufhead { | |||
| 137 | #define C_CLOCAL(tty) _C_FLAG((tty), CLOCAL) | 142 | #define C_CLOCAL(tty) _C_FLAG((tty), CLOCAL) |
| 138 | #define C_CIBAUD(tty) _C_FLAG((tty), CIBAUD) | 143 | #define C_CIBAUD(tty) _C_FLAG((tty), CIBAUD) |
| 139 | #define C_CRTSCTS(tty) _C_FLAG((tty), CRTSCTS) | 144 | #define C_CRTSCTS(tty) _C_FLAG((tty), CRTSCTS) |
| 145 | #define C_CMSPAR(tty) _C_FLAG((tty), CMSPAR) | ||
| 140 | 146 | ||
| 141 | #define L_ISIG(tty) _L_FLAG((tty), ISIG) | 147 | #define L_ISIG(tty) _L_FLAG((tty), ISIG) |
| 142 | #define L_ICANON(tty) _L_FLAG((tty), ICANON) | 148 | #define L_ICANON(tty) _L_FLAG((tty), ICANON) |
| @@ -422,7 +428,6 @@ extern int is_ignored(int sig); | |||
| 422 | extern int tty_signal(int sig, struct tty_struct *tty); | 428 | extern int tty_signal(int sig, struct tty_struct *tty); |
| 423 | extern void tty_hangup(struct tty_struct *tty); | 429 | extern void tty_hangup(struct tty_struct *tty); |
| 424 | extern void tty_vhangup(struct tty_struct *tty); | 430 | extern void tty_vhangup(struct tty_struct *tty); |
| 425 | extern void tty_vhangup_locked(struct tty_struct *tty); | ||
| 426 | extern void tty_unhangup(struct file *filp); | 431 | extern void tty_unhangup(struct file *filp); |
| 427 | extern int tty_hung_up_p(struct file *filp); | 432 | extern int tty_hung_up_p(struct file *filp); |
| 428 | extern void do_SAK(struct tty_struct *tty); | 433 | extern void do_SAK(struct tty_struct *tty); |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 21ddd7d9ea1f..c28dd523f96e 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
| @@ -1,6 +1,7 @@ | |||
| 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_set_limit(struct tty_port *port, int limit); | ||
| 4 | extern int tty_buffer_space_avail(struct tty_port *port); | 5 | extern int tty_buffer_space_avail(struct tty_port *port); |
| 5 | extern int tty_buffer_request_room(struct tty_port *port, size_t size); | 6 | extern int tty_buffer_request_room(struct tty_port *port, size_t size); |
| 6 | extern int tty_insert_flip_string_flags(struct tty_port *port, | 7 | extern int tty_insert_flip_string_flags(struct tty_port *port, |
| @@ -9,8 +10,6 @@ extern int tty_insert_flip_string_fixed_flag(struct tty_port *port, | |||
| 9 | const unsigned char *chars, char flag, size_t size); | 10 | const unsigned char *chars, char flag, size_t size); |
| 10 | extern int tty_prepare_flip_string(struct tty_port *port, | 11 | extern int tty_prepare_flip_string(struct tty_port *port, |
| 11 | unsigned char **chars, size_t size); | 12 | unsigned char **chars, size_t size); |
| 12 | extern int tty_prepare_flip_string_flags(struct tty_port *port, | ||
| 13 | unsigned char **chars, char **flags, size_t size); | ||
| 14 | extern void tty_flip_buffer_push(struct tty_port *port); | 13 | extern void tty_flip_buffer_push(struct tty_port *port); |
| 15 | void tty_schedule_flip(struct tty_port *port); | 14 | void tty_schedule_flip(struct tty_port *port); |
| 16 | 15 | ||
| @@ -18,8 +17,12 @@ static inline int tty_insert_flip_char(struct tty_port *port, | |||
| 18 | unsigned char ch, char flag) | 17 | unsigned char ch, char flag) |
| 19 | { | 18 | { |
| 20 | struct tty_buffer *tb = port->buf.tail; | 19 | struct tty_buffer *tb = port->buf.tail; |
| 21 | if (tb && tb->used < tb->size) { | 20 | int change; |
| 22 | *flag_buf_ptr(tb, tb->used) = flag; | 21 | |
| 22 | change = (tb->flags & TTYB_NORMAL) && (flag != TTY_NORMAL); | ||
| 23 | if (!change && tb->used < tb->size) { | ||
| 24 | if (~tb->flags & TTYB_NORMAL) | ||
| 25 | *flag_buf_ptr(tb, tb->used) = flag; | ||
| 23 | *char_buf_ptr(tb, tb->used++) = ch; | 26 | *char_buf_ptr(tb, tb->used++) = ch; |
| 24 | return 1; | 27 | return 1; |
| 25 | } | 28 | } |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index f15c898ff462..b8347c207cb8 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
| @@ -84,7 +84,8 @@ | |||
| 84 | * processing. <cp> is a pointer to the buffer of input | 84 | * processing. <cp> is a pointer to the buffer of input |
| 85 | * character received by the device. <fp> is a pointer to a | 85 | * character received by the device. <fp> is a pointer to a |
| 86 | * pointer of flag bytes which indicate whether a character was | 86 | * pointer of flag bytes which indicate whether a character was |
| 87 | * received with a parity error, etc. | 87 | * received with a parity error, etc. <fp> may be NULL to indicate |
| 88 | * all data received is TTY_NORMAL. | ||
| 88 | * | 89 | * |
| 89 | * void (*write_wakeup)(struct tty_struct *); | 90 | * void (*write_wakeup)(struct tty_struct *); |
| 90 | * | 91 | * |
| @@ -118,7 +119,8 @@ | |||
| 118 | * processing. <cp> is a pointer to the buffer of input | 119 | * processing. <cp> is a pointer to the buffer of input |
| 119 | * character received by the device. <fp> is a pointer to a | 120 | * character received by the device. <fp> is a pointer to a |
| 120 | * pointer of flag bytes which indicate whether a character was | 121 | * pointer of flag bytes which indicate whether a character was |
| 121 | * received with a parity error, etc. | 122 | * received with a parity error, etc. <fp> may be NULL to indicate |
| 123 | * all data received is TTY_NORMAL. | ||
| 122 | * If assigned, prefer this function for automatic flow control. | 124 | * If assigned, prefer this function for automatic flow control. |
| 123 | */ | 125 | */ |
| 124 | 126 | ||
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 9d8cf056e661..ecd3319dac33 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h | |||
| @@ -25,13 +25,16 @@ static inline void pagefault_disable(void) | |||
| 25 | 25 | ||
| 26 | static inline void pagefault_enable(void) | 26 | static inline void pagefault_enable(void) |
| 27 | { | 27 | { |
| 28 | #ifndef CONFIG_PREEMPT | ||
| 28 | /* | 29 | /* |
| 29 | * make sure to issue those last loads/stores before enabling | 30 | * make sure to issue those last loads/stores before enabling |
| 30 | * the pagefault handler again. | 31 | * the pagefault handler again. |
| 31 | */ | 32 | */ |
| 32 | barrier(); | 33 | barrier(); |
| 33 | preempt_count_dec(); | 34 | preempt_count_dec(); |
| 34 | preempt_check_resched(); | 35 | #else |
| 36 | preempt_enable(); | ||
| 37 | #endif | ||
| 35 | } | 38 | } |
| 36 | 39 | ||
| 37 | #ifndef ARCH_HAS_NOCACHE_UACCESS | 40 | #ifndef ARCH_HAS_NOCACHE_UACCESS |
diff --git a/include/linux/uidgid.h b/include/linux/uidgid.h index 8e522cbcef29..2d1f9b627f91 100644 --- a/include/linux/uidgid.h +++ b/include/linux/uidgid.h | |||
| @@ -17,8 +17,6 @@ | |||
| 17 | struct user_namespace; | 17 | struct user_namespace; |
| 18 | extern struct user_namespace init_user_ns; | 18 | extern struct user_namespace init_user_ns; |
| 19 | 19 | ||
| 20 | #ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS | ||
| 21 | |||
| 22 | typedef struct { | 20 | typedef struct { |
| 23 | uid_t val; | 21 | uid_t val; |
| 24 | } kuid_t; | 22 | } kuid_t; |
| @@ -41,26 +39,6 @@ static inline gid_t __kgid_val(kgid_t gid) | |||
| 41 | return gid.val; | 39 | return gid.val; |
| 42 | } | 40 | } |
| 43 | 41 | ||
| 44 | #else | ||
| 45 | |||
| 46 | typedef uid_t kuid_t; | ||
| 47 | typedef gid_t kgid_t; | ||
| 48 | |||
| 49 | static inline uid_t __kuid_val(kuid_t uid) | ||
| 50 | { | ||
| 51 | return uid; | ||
| 52 | } | ||
| 53 | |||
| 54 | static inline gid_t __kgid_val(kgid_t gid) | ||
| 55 | { | ||
| 56 | return gid; | ||
| 57 | } | ||
| 58 | |||
| 59 | #define KUIDT_INIT(value) ((kuid_t) value ) | ||
| 60 | #define KGIDT_INIT(value) ((kgid_t) value ) | ||
| 61 | |||
| 62 | #endif | ||
| 63 | |||
| 64 | #define GLOBAL_ROOT_UID KUIDT_INIT(0) | 42 | #define GLOBAL_ROOT_UID KUIDT_INIT(0) |
| 65 | #define GLOBAL_ROOT_GID KGIDT_INIT(0) | 43 | #define GLOBAL_ROOT_GID KGIDT_INIT(0) |
| 66 | 44 | ||
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index 319eae70fe84..e32251e00e62 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h | |||
| @@ -26,16 +26,13 @@ | |||
| 26 | 26 | ||
| 27 | #include <linux/errno.h> | 27 | #include <linux/errno.h> |
| 28 | #include <linux/rbtree.h> | 28 | #include <linux/rbtree.h> |
| 29 | #include <linux/types.h> | ||
| 29 | 30 | ||
| 30 | struct vm_area_struct; | 31 | struct vm_area_struct; |
| 31 | struct mm_struct; | 32 | struct mm_struct; |
| 32 | struct inode; | 33 | struct inode; |
| 33 | struct notifier_block; | 34 | struct notifier_block; |
| 34 | 35 | ||
| 35 | #ifdef CONFIG_ARCH_SUPPORTS_UPROBES | ||
| 36 | # include <asm/uprobes.h> | ||
| 37 | #endif | ||
| 38 | |||
| 39 | #define UPROBE_HANDLER_REMOVE 1 | 36 | #define UPROBE_HANDLER_REMOVE 1 |
| 40 | #define UPROBE_HANDLER_MASK 1 | 37 | #define UPROBE_HANDLER_MASK 1 |
| 41 | 38 | ||
| @@ -60,6 +57,8 @@ struct uprobe_consumer { | |||
| 60 | }; | 57 | }; |
| 61 | 58 | ||
| 62 | #ifdef CONFIG_UPROBES | 59 | #ifdef CONFIG_UPROBES |
| 60 | #include <asm/uprobes.h> | ||
| 61 | |||
| 63 | enum uprobe_task_state { | 62 | enum uprobe_task_state { |
| 64 | UTASK_RUNNING, | 63 | UTASK_RUNNING, |
| 65 | UTASK_SSTEP, | 64 | UTASK_SSTEP, |
| @@ -72,35 +71,28 @@ enum uprobe_task_state { | |||
| 72 | */ | 71 | */ |
| 73 | struct uprobe_task { | 72 | struct uprobe_task { |
| 74 | enum uprobe_task_state state; | 73 | enum uprobe_task_state state; |
| 75 | struct arch_uprobe_task autask; | ||
| 76 | 74 | ||
| 77 | struct return_instance *return_instances; | 75 | union { |
| 78 | unsigned int depth; | 76 | struct { |
| 79 | struct uprobe *active_uprobe; | 77 | struct arch_uprobe_task autask; |
| 78 | unsigned long vaddr; | ||
| 79 | }; | ||
| 80 | 80 | ||
| 81 | struct { | ||
| 82 | struct callback_head dup_xol_work; | ||
| 83 | unsigned long dup_xol_addr; | ||
| 84 | }; | ||
| 85 | }; | ||
| 86 | |||
| 87 | struct uprobe *active_uprobe; | ||
| 81 | unsigned long xol_vaddr; | 88 | unsigned long xol_vaddr; |
| 82 | unsigned long vaddr; | ||
| 83 | }; | ||
| 84 | 89 | ||
| 85 | /* | 90 | struct return_instance *return_instances; |
| 86 | * On a breakpoint hit, thread contests for a slot. It frees the | 91 | unsigned int depth; |
| 87 | * slot after singlestep. Currently a fixed number of slots are | ||
| 88 | * allocated. | ||
| 89 | */ | ||
| 90 | struct xol_area { | ||
| 91 | wait_queue_head_t wq; /* if all slots are busy */ | ||
| 92 | atomic_t slot_count; /* number of in-use slots */ | ||
| 93 | unsigned long *bitmap; /* 0 = free slot */ | ||
| 94 | struct page *page; | ||
| 95 | |||
| 96 | /* | ||
| 97 | * We keep the vma's vm_start rather than a pointer to the vma | ||
| 98 | * itself. The probed process or a naughty kernel module could make | ||
| 99 | * the vma go away, and we must handle that reasonably gracefully. | ||
| 100 | */ | ||
| 101 | unsigned long vaddr; /* Page(s) of instruction slots */ | ||
| 102 | }; | 92 | }; |
| 103 | 93 | ||
| 94 | struct xol_area; | ||
| 95 | |||
| 104 | struct uprobes_state { | 96 | struct uprobes_state { |
| 105 | struct xol_area *xol_area; | 97 | struct xol_area *xol_area; |
| 106 | }; | 98 | }; |
| @@ -109,6 +101,7 @@ extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsign | |||
| 109 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); | 101 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); |
| 110 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); | 102 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); |
| 111 | extern bool __weak is_trap_insn(uprobe_opcode_t *insn); | 103 | extern bool __weak is_trap_insn(uprobe_opcode_t *insn); |
| 104 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); | ||
| 112 | extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); | 105 | extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); |
| 113 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 106 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
| 114 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); | 107 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); |
| @@ -120,7 +113,6 @@ extern void uprobe_end_dup_mmap(void); | |||
| 120 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); | 113 | extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); |
| 121 | extern void uprobe_free_utask(struct task_struct *t); | 114 | extern void uprobe_free_utask(struct task_struct *t); |
| 122 | extern void uprobe_copy_process(struct task_struct *t, unsigned long flags); | 115 | extern void uprobe_copy_process(struct task_struct *t, unsigned long flags); |
| 123 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); | ||
| 124 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); | 116 | extern int uprobe_post_sstep_notifier(struct pt_regs *regs); |
| 125 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); | 117 | extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); |
| 126 | extern void uprobe_notify_resume(struct pt_regs *regs); | 118 | extern void uprobe_notify_resume(struct pt_regs *regs); |
| @@ -176,10 +168,6 @@ static inline bool uprobe_deny_signal(void) | |||
| 176 | { | 168 | { |
| 177 | return false; | 169 | return false; |
| 178 | } | 170 | } |
| 179 | static inline unsigned long uprobe_get_swbp_addr(struct pt_regs *regs) | ||
| 180 | { | ||
| 181 | return 0; | ||
| 182 | } | ||
| 183 | static inline void uprobe_free_utask(struct task_struct *t) | 171 | static inline void uprobe_free_utask(struct task_struct *t) |
| 184 | { | 172 | { |
| 185 | } | 173 | } |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 7454865ad148..c716da18c668 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -965,6 +965,7 @@ struct usb_dynid { | |||
| 965 | }; | 965 | }; |
| 966 | 966 | ||
| 967 | extern ssize_t usb_store_new_id(struct usb_dynids *dynids, | 967 | extern ssize_t usb_store_new_id(struct usb_dynids *dynids, |
| 968 | const struct usb_device_id *id_table, | ||
| 968 | struct device_driver *driver, | 969 | struct device_driver *driver, |
| 969 | const char *buf, size_t count); | 970 | const char *buf, size_t count); |
| 970 | 971 | ||
| @@ -1264,6 +1265,8 @@ typedef void (*usb_complete_t)(struct urb *); | |||
| 1264 | * @sg: scatter gather buffer list, the buffer size of each element in | 1265 | * @sg: scatter gather buffer list, the buffer size of each element in |
| 1265 | * the list (except the last) must be divisible by the endpoint's | 1266 | * the list (except the last) must be divisible by the endpoint's |
| 1266 | * max packet size if no_sg_constraint isn't set in 'struct usb_bus' | 1267 | * max packet size if no_sg_constraint isn't set in 'struct usb_bus' |
| 1268 | * (FIXME: scatter-gather under xHCI is broken for periodic transfers. | ||
| 1269 | * Do not use urb->sg for interrupt endpoints for now, only bulk.) | ||
| 1267 | * @num_mapped_sgs: (internal) number of mapped sg entries | 1270 | * @num_mapped_sgs: (internal) number of mapped sg entries |
| 1268 | * @num_sgs: number of entries in the sg list | 1271 | * @num_sgs: number of entries in the sg list |
| 1269 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may | 1272 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may |
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index 7d399671a566..708bd119627f 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h | |||
| @@ -24,6 +24,7 @@ struct ci_hdrc_platform_data { | |||
| 24 | * but otg is not supported (no register otgsc). | 24 | * but otg is not supported (no register otgsc). |
| 25 | */ | 25 | */ |
| 26 | #define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4) | 26 | #define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4) |
| 27 | #define CI_HDRC_IMX28_WRITE_FIX BIT(5) | ||
| 27 | enum usb_dr_mode dr_mode; | 28 | enum usb_dr_mode dr_mode; |
| 28 | #define CI_HDRC_CONTROLLER_RESET_EVENT 0 | 29 | #define CI_HDRC_CONTROLLER_RESET_EVENT 0 |
| 29 | #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 | 30 | #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 5e61589fc166..dba63f53906c 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -468,6 +468,8 @@ struct usb_function_instance { | |||
| 468 | struct config_group group; | 468 | struct config_group group; |
| 469 | struct list_head cfs_list; | 469 | struct list_head cfs_list; |
| 470 | struct usb_function_driver *fd; | 470 | struct usb_function_driver *fd; |
| 471 | int (*set_inst_name)(struct usb_function_instance *inst, | ||
| 472 | const char *name); | ||
| 471 | void (*free_func_inst)(struct usb_function_instance *inst); | 473 | void (*free_func_inst)(struct usb_function_instance *inst); |
| 472 | }; | 474 | }; |
| 473 | 475 | ||
diff --git a/include/linux/usb/functionfs.h b/include/linux/usb/functionfs.h index 65d0a88dbc67..71190663f1ee 100644 --- a/include/linux/usb/functionfs.h +++ b/include/linux/usb/functionfs.h | |||
| @@ -3,34 +3,4 @@ | |||
| 3 | 3 | ||
| 4 | #include <uapi/linux/usb/functionfs.h> | 4 | #include <uapi/linux/usb/functionfs.h> |
| 5 | 5 | ||
| 6 | |||
| 7 | struct ffs_data; | ||
| 8 | struct usb_composite_dev; | ||
| 9 | struct usb_configuration; | ||
| 10 | |||
| 11 | |||
| 12 | static int functionfs_init(void) __attribute__((warn_unused_result)); | ||
| 13 | static void functionfs_cleanup(void); | ||
| 14 | |||
| 15 | static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev) | ||
| 16 | __attribute__((warn_unused_result, nonnull)); | ||
| 17 | static void functionfs_unbind(struct ffs_data *ffs) | ||
| 18 | __attribute__((nonnull)); | ||
| 19 | |||
| 20 | static int functionfs_bind_config(struct usb_composite_dev *cdev, | ||
| 21 | struct usb_configuration *c, | ||
| 22 | struct ffs_data *ffs) | ||
| 23 | __attribute__((warn_unused_result, nonnull)); | ||
| 24 | |||
| 25 | |||
| 26 | static int functionfs_ready_callback(struct ffs_data *ffs) | ||
| 27 | __attribute__((warn_unused_result, nonnull)); | ||
| 28 | static void functionfs_closed_callback(struct ffs_data *ffs) | ||
| 29 | __attribute__((nonnull)); | ||
| 30 | static void *functionfs_acquire_dev_callback(const char *dev_name) | ||
| 31 | __attribute__((warn_unused_result, nonnull)); | ||
| 32 | static void functionfs_release_dev_callback(struct ffs_data *ffs_data) | ||
| 33 | __attribute__((nonnull)); | ||
| 34 | |||
| 35 | |||
| 36 | #endif | 6 | #endif |
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 942ef5e053bf..c3a61853cd13 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
| @@ -148,6 +148,9 @@ struct usb_ep_ops { | |||
| 148 | * @maxpacket:The maximum packet size used on this endpoint. The initial | 148 | * @maxpacket:The maximum packet size used on this endpoint. The initial |
| 149 | * value can sometimes be reduced (hardware allowing), according to | 149 | * value can sometimes be reduced (hardware allowing), according to |
| 150 | * the endpoint descriptor used to configure the endpoint. | 150 | * the endpoint descriptor used to configure the endpoint. |
| 151 | * @maxpacket_limit:The maximum packet size value which can be handled by this | ||
| 152 | * endpoint. It's set once by UDC driver when endpoint is initialized, and | ||
| 153 | * should not be changed. Should not be confused with maxpacket. | ||
| 151 | * @max_streams: The maximum number of streams supported | 154 | * @max_streams: The maximum number of streams supported |
| 152 | * by this EP (0 - 16, actual number is 2^n) | 155 | * by this EP (0 - 16, actual number is 2^n) |
| 153 | * @mult: multiplier, 'mult' value for SS Isoc EPs | 156 | * @mult: multiplier, 'mult' value for SS Isoc EPs |
| @@ -171,6 +174,7 @@ struct usb_ep { | |||
| 171 | const struct usb_ep_ops *ops; | 174 | const struct usb_ep_ops *ops; |
| 172 | struct list_head ep_list; | 175 | struct list_head ep_list; |
| 173 | unsigned maxpacket:16; | 176 | unsigned maxpacket:16; |
| 177 | unsigned maxpacket_limit:16; | ||
| 174 | unsigned max_streams:16; | 178 | unsigned max_streams:16; |
| 175 | unsigned mult:2; | 179 | unsigned mult:2; |
| 176 | unsigned maxburst:5; | 180 | unsigned maxburst:5; |
| @@ -182,6 +186,21 @@ struct usb_ep { | |||
| 182 | /*-------------------------------------------------------------------------*/ | 186 | /*-------------------------------------------------------------------------*/ |
| 183 | 187 | ||
| 184 | /** | 188 | /** |
| 189 | * usb_ep_set_maxpacket_limit - set maximum packet size limit for endpoint | ||
| 190 | * @ep:the endpoint being configured | ||
| 191 | * @maxpacket_limit:value of maximum packet size limit | ||
| 192 | * | ||
| 193 | * This function shoud be used only in UDC drivers to initialize endpoint | ||
| 194 | * (usually in probe function). | ||
| 195 | */ | ||
| 196 | static inline void usb_ep_set_maxpacket_limit(struct usb_ep *ep, | ||
| 197 | unsigned maxpacket_limit) | ||
| 198 | { | ||
| 199 | ep->maxpacket_limit = maxpacket_limit; | ||
| 200 | ep->maxpacket = maxpacket_limit; | ||
| 201 | } | ||
| 202 | |||
| 203 | /** | ||
| 185 | * usb_ep_enable - configure endpoint, making it usable | 204 | * usb_ep_enable - configure endpoint, making it usable |
| 186 | * @ep:the endpoint being configured. may not be the endpoint named "ep0". | 205 | * @ep:the endpoint being configured. may not be the endpoint named "ep0". |
| 187 | * drivers discover endpoints through the ep_list of a usb_gadget. | 206 | * drivers discover endpoints through the ep_list of a usb_gadget. |
| @@ -485,6 +504,11 @@ struct usb_gadget_ops { | |||
| 485 | * @max_speed: Maximal speed the UDC can handle. UDC must support this | 504 | * @max_speed: Maximal speed the UDC can handle. UDC must support this |
| 486 | * and all slower speeds. | 505 | * and all slower speeds. |
| 487 | * @state: the state we are now (attached, suspended, configured, etc) | 506 | * @state: the state we are now (attached, suspended, configured, etc) |
| 507 | * @name: Identifies the controller hardware type. Used in diagnostics | ||
| 508 | * and sometimes configuration. | ||
| 509 | * @dev: Driver model state for this abstract device. | ||
| 510 | * @out_epnum: last used out ep number | ||
| 511 | * @in_epnum: last used in ep number | ||
| 488 | * @sg_supported: true if we can handle scatter-gather | 512 | * @sg_supported: true if we can handle scatter-gather |
| 489 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the | 513 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the |
| 490 | * gadget driver must provide a USB OTG descriptor. | 514 | * gadget driver must provide a USB OTG descriptor. |
| @@ -497,11 +521,8 @@ struct usb_gadget_ops { | |||
| 497 | * only supports HNP on a different root port. | 521 | * only supports HNP on a different root port. |
| 498 | * @b_hnp_enable: OTG device feature flag, indicating that the A-Host | 522 | * @b_hnp_enable: OTG device feature flag, indicating that the A-Host |
| 499 | * enabled HNP support. | 523 | * enabled HNP support. |
| 500 | * @name: Identifies the controller hardware type. Used in diagnostics | 524 | * @quirk_ep_out_aligned_size: epout requires buffer size to be aligned to |
| 501 | * and sometimes configuration. | 525 | * MaxPacketSize. |
| 502 | * @dev: Driver model state for this abstract device. | ||
| 503 | * @out_epnum: last used out ep number | ||
| 504 | * @in_epnum: last used in ep number | ||
| 505 | * | 526 | * |
| 506 | * Gadgets have a mostly-portable "gadget driver" implementing device | 527 | * Gadgets have a mostly-portable "gadget driver" implementing device |
| 507 | * functions, handling all usb configurations and interfaces. Gadget | 528 | * functions, handling all usb configurations and interfaces. Gadget |
| @@ -530,16 +551,18 @@ struct usb_gadget { | |||
| 530 | enum usb_device_speed speed; | 551 | enum usb_device_speed speed; |
| 531 | enum usb_device_speed max_speed; | 552 | enum usb_device_speed max_speed; |
| 532 | enum usb_device_state state; | 553 | enum usb_device_state state; |
| 554 | const char *name; | ||
| 555 | struct device dev; | ||
| 556 | unsigned out_epnum; | ||
| 557 | unsigned in_epnum; | ||
| 558 | |||
| 533 | unsigned sg_supported:1; | 559 | unsigned sg_supported:1; |
| 534 | unsigned is_otg:1; | 560 | unsigned is_otg:1; |
| 535 | unsigned is_a_peripheral:1; | 561 | unsigned is_a_peripheral:1; |
| 536 | unsigned b_hnp_enable:1; | 562 | unsigned b_hnp_enable:1; |
| 537 | unsigned a_hnp_support:1; | 563 | unsigned a_hnp_support:1; |
| 538 | unsigned a_alt_hnp_support:1; | 564 | unsigned a_alt_hnp_support:1; |
| 539 | const char *name; | 565 | unsigned quirk_ep_out_aligned_size:1; |
| 540 | struct device dev; | ||
| 541 | unsigned out_epnum; | ||
| 542 | unsigned in_epnum; | ||
| 543 | }; | 566 | }; |
| 544 | #define work_to_gadget(w) (container_of((w), struct usb_gadget, work)) | 567 | #define work_to_gadget(w) (container_of((w), struct usb_gadget, work)) |
| 545 | 568 | ||
| @@ -558,6 +581,23 @@ static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev) | |||
| 558 | 581 | ||
| 559 | 582 | ||
| 560 | /** | 583 | /** |
| 584 | * usb_ep_align_maybe - returns @len aligned to ep's maxpacketsize if gadget | ||
| 585 | * requires quirk_ep_out_aligned_size, otherwise reguens len. | ||
| 586 | * @g: controller to check for quirk | ||
| 587 | * @ep: the endpoint whose maxpacketsize is used to align @len | ||
| 588 | * @len: buffer size's length to align to @ep's maxpacketsize | ||
| 589 | * | ||
| 590 | * This helper is used in case it's required for any reason to check and maybe | ||
| 591 | * align buffer's size to an ep's maxpacketsize. | ||
| 592 | */ | ||
| 593 | static inline size_t | ||
| 594 | usb_ep_align_maybe(struct usb_gadget *g, struct usb_ep *ep, size_t len) | ||
| 595 | { | ||
| 596 | return !g->quirk_ep_out_aligned_size ? len : | ||
| 597 | round_up(len, (size_t)ep->desc->wMaxPacketSize); | ||
| 598 | } | ||
| 599 | |||
| 600 | /** | ||
| 561 | * gadget_is_dualspeed - return true iff the hardware handles high speed | 601 | * gadget_is_dualspeed - return true iff the hardware handles high speed |
| 562 | * @g: controller that might support both high and full speeds | 602 | * @g: controller that might support both high and full speeds |
| 563 | */ | 603 | */ |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index b8aba196f7f1..efe8d8a7c7ad 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
| @@ -134,6 +134,7 @@ struct usb_hcd { | |||
| 134 | unsigned rh_registered:1;/* is root hub registered? */ | 134 | unsigned rh_registered:1;/* is root hub registered? */ |
| 135 | unsigned rh_pollable:1; /* may we poll the root hub? */ | 135 | unsigned rh_pollable:1; /* may we poll the root hub? */ |
| 136 | unsigned msix_enabled:1; /* driver has MSI-X enabled? */ | 136 | unsigned msix_enabled:1; /* driver has MSI-X enabled? */ |
| 137 | unsigned remove_phy:1; /* auto-remove USB phy */ | ||
| 137 | 138 | ||
| 138 | /* The next flag is a stopgap, to be removed when all the HCDs | 139 | /* The next flag is a stopgap, to be removed when all the HCDs |
| 139 | * support the new root-hub polling mechanism. */ | 140 | * support the new root-hub polling mechanism. */ |
| @@ -352,6 +353,8 @@ struct hc_driver { | |||
| 352 | void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); | 353 | void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); |
| 353 | /* Returns the hardware-chosen device address */ | 354 | /* Returns the hardware-chosen device address */ |
| 354 | int (*address_device)(struct usb_hcd *, struct usb_device *udev); | 355 | int (*address_device)(struct usb_hcd *, struct usb_device *udev); |
| 356 | /* prepares the hardware to send commands to the device */ | ||
| 357 | int (*enable_device)(struct usb_hcd *, struct usb_device *udev); | ||
| 355 | /* Notifies the HCD after a hub descriptor is fetched. | 358 | /* Notifies the HCD after a hub descriptor is fetched. |
| 356 | * Will block. | 359 | * Will block. |
| 357 | */ | 360 | */ |
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h index 22a396c13f3a..32754835a39b 100644 --- a/include/linux/usb/msm_hsusb.h +++ b/include/linux/usb/msm_hsusb.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
| 22 | #include <linux/usb/otg.h> | 22 | #include <linux/usb/otg.h> |
| 23 | #include <linux/clk.h> | ||
| 23 | 24 | ||
| 24 | /** | 25 | /** |
| 25 | * Supported USB modes | 26 | * Supported USB modes |
| @@ -135,6 +136,8 @@ struct msm_otg_platform_data { | |||
| 135 | enum msm_usb_phy_type phy_type; | 136 | enum msm_usb_phy_type phy_type; |
| 136 | void (*setup_gpio)(enum usb_otg_state state); | 137 | void (*setup_gpio)(enum usb_otg_state state); |
| 137 | char *pclk_src_name; | 138 | char *pclk_src_name; |
| 139 | int (*link_clk_reset)(struct clk *link_clk, bool assert); | ||
| 140 | int (*phy_clk_reset)(struct clk *phy_clk); | ||
| 138 | }; | 141 | }; |
| 139 | 142 | ||
| 140 | /** | 143 | /** |
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index eb505250940a..a4ee1b582183 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h | |||
| @@ -76,6 +76,9 @@ struct musb_hdrc_config { | |||
| 76 | unsigned dma:1 __deprecated; /* supports DMA */ | 76 | unsigned dma:1 __deprecated; /* supports DMA */ |
| 77 | unsigned vendor_req:1 __deprecated; /* vendor registers required */ | 77 | unsigned vendor_req:1 __deprecated; /* vendor registers required */ |
| 78 | 78 | ||
| 79 | /* need to explicitly de-assert the port reset after resume? */ | ||
| 80 | unsigned host_port_deassert_reset_at_resume:1; | ||
| 81 | |||
| 79 | u8 num_eps; /* number of endpoints _with_ ep0 */ | 82 | u8 num_eps; /* number of endpoints _with_ ep0 */ |
| 80 | u8 dma_channels __deprecated; /* number of dma channels */ | 83 | u8 dma_channels __deprecated; /* number of dma channels */ |
| 81 | u8 dyn_fifo_size; /* dynamic size in bytes */ | 84 | u8 dyn_fifo_size; /* dynamic size in bytes */ |
diff --git a/include/linux/usb/omap_control_usb.h b/include/linux/usb/omap_control_usb.h index 596b01918813..69ae383ee3cc 100644 --- a/include/linux/usb/omap_control_usb.h +++ b/include/linux/usb/omap_control_usb.h | |||
| @@ -24,6 +24,7 @@ enum omap_control_usb_type { | |||
| 24 | OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ | 24 | OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ |
| 25 | OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ | 25 | OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ |
| 26 | OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ | 26 | OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ |
| 27 | OMAP_CTRL_TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */ | ||
| 27 | }; | 28 | }; |
| 28 | 29 | ||
| 29 | struct omap_control_usb { | 30 | struct omap_control_usb { |
| @@ -64,6 +65,11 @@ enum omap_control_usb_mode { | |||
| 64 | 65 | ||
| 65 | #define OMAP_CTRL_USB2_PHY_PD BIT(28) | 66 | #define OMAP_CTRL_USB2_PHY_PD BIT(28) |
| 66 | 67 | ||
| 68 | #define AM437X_CTRL_USB2_PHY_PD BIT(0) | ||
| 69 | #define AM437X_CTRL_USB2_OTG_PD BIT(1) | ||
| 70 | #define AM437X_CTRL_USB2_OTGVDET_EN BIT(19) | ||
| 71 | #define AM437X_CTRL_USB2_OTGSESSEND_EN BIT(20) | ||
| 72 | |||
| 67 | #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) | 73 | #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) |
| 68 | extern void omap_control_usb_phy_power(struct device *dev, int on); | 74 | extern void omap_control_usb_phy_power(struct device *dev, int on); |
| 69 | extern void omap_control_usb_set_mode(struct device *dev, | 75 | extern void omap_control_usb_set_mode(struct device *dev, |
diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h new file mode 100644 index 000000000000..b6ba1bfb86f2 --- /dev/null +++ b/include/linux/usb/otg-fsm.h | |||
| @@ -0,0 +1,244 @@ | |||
| 1 | /* Copyright (C) 2007,2008 Freescale Semiconductor, Inc. | ||
| 2 | * | ||
| 3 | * This program is free software; you can redistribute it and/or modify it | ||
| 4 | * under the terms of the GNU General Public License as published by the | ||
| 5 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 6 | * option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, but | ||
| 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 11 | * General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License along | ||
| 14 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 15 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef __LINUX_USB_OTG_FSM_H | ||
| 19 | #define __LINUX_USB_OTG_FSM_H | ||
| 20 | |||
| 21 | #include <linux/mutex.h> | ||
| 22 | #include <linux/errno.h> | ||
| 23 | |||
| 24 | #undef VERBOSE | ||
| 25 | |||
| 26 | #ifdef VERBOSE | ||
| 27 | #define VDBG(fmt, args...) pr_debug("[%s] " fmt , \ | ||
| 28 | __func__, ## args) | ||
| 29 | #else | ||
| 30 | #define VDBG(stuff...) do {} while (0) | ||
| 31 | #endif | ||
| 32 | |||
| 33 | #ifdef VERBOSE | ||
| 34 | #define MPC_LOC printk("Current Location [%s]:[%d]\n", __FILE__, __LINE__) | ||
| 35 | #else | ||
| 36 | #define MPC_LOC do {} while (0) | ||
| 37 | #endif | ||
| 38 | |||
| 39 | #define PROTO_UNDEF (0) | ||
| 40 | #define PROTO_HOST (1) | ||
| 41 | #define PROTO_GADGET (2) | ||
| 42 | |||
| 43 | enum otg_fsm_timer { | ||
| 44 | /* Standard OTG timers */ | ||
| 45 | A_WAIT_VRISE, | ||
| 46 | A_WAIT_VFALL, | ||
| 47 | A_WAIT_BCON, | ||
| 48 | A_AIDL_BDIS, | ||
| 49 | B_ASE0_BRST, | ||
| 50 | A_BIDL_ADIS, | ||
| 51 | |||
| 52 | /* Auxiliary timers */ | ||
| 53 | B_SE0_SRP, | ||
| 54 | B_SRP_FAIL, | ||
| 55 | A_WAIT_ENUM, | ||
| 56 | |||
| 57 | NUM_OTG_FSM_TIMERS, | ||
| 58 | }; | ||
| 59 | |||
| 60 | /* OTG state machine according to the OTG spec */ | ||
| 61 | struct otg_fsm { | ||
| 62 | /* Input */ | ||
| 63 | int id; | ||
| 64 | int adp_change; | ||
| 65 | int power_up; | ||
| 66 | int test_device; | ||
| 67 | int a_bus_drop; | ||
| 68 | int a_bus_req; | ||
| 69 | int a_srp_det; | ||
| 70 | int a_vbus_vld; | ||
| 71 | int b_conn; | ||
| 72 | int a_bus_resume; | ||
| 73 | int a_bus_suspend; | ||
| 74 | int a_conn; | ||
| 75 | int b_bus_req; | ||
| 76 | int b_se0_srp; | ||
| 77 | int b_ssend_srp; | ||
| 78 | int b_sess_vld; | ||
| 79 | /* Auxilary inputs */ | ||
| 80 | int a_sess_vld; | ||
| 81 | int b_bus_resume; | ||
| 82 | int b_bus_suspend; | ||
| 83 | |||
| 84 | /* Output */ | ||
| 85 | int data_pulse; | ||
| 86 | int drv_vbus; | ||
| 87 | int loc_conn; | ||
| 88 | int loc_sof; | ||
| 89 | int adp_prb; | ||
| 90 | int adp_sns; | ||
| 91 | |||
| 92 | /* Internal variables */ | ||
| 93 | int a_set_b_hnp_en; | ||
| 94 | int b_srp_done; | ||
| 95 | int b_hnp_enable; | ||
| 96 | int a_clr_err; | ||
| 97 | |||
| 98 | /* Informative variables */ | ||
| 99 | int a_bus_drop_inf; | ||
| 100 | int a_bus_req_inf; | ||
| 101 | int a_clr_err_inf; | ||
| 102 | int b_bus_req_inf; | ||
| 103 | /* Auxilary informative variables */ | ||
| 104 | int a_suspend_req_inf; | ||
| 105 | |||
| 106 | /* Timeout indicator for timers */ | ||
| 107 | int a_wait_vrise_tmout; | ||
| 108 | int a_wait_vfall_tmout; | ||
| 109 | int a_wait_bcon_tmout; | ||
| 110 | int a_aidl_bdis_tmout; | ||
| 111 | int b_ase0_brst_tmout; | ||
| 112 | int a_bidl_adis_tmout; | ||
| 113 | |||
| 114 | struct otg_fsm_ops *ops; | ||
| 115 | struct usb_otg *otg; | ||
| 116 | |||
| 117 | /* Current usb protocol used: 0:undefine; 1:host; 2:client */ | ||
| 118 | int protocol; | ||
| 119 | struct mutex lock; | ||
| 120 | }; | ||
| 121 | |||
| 122 | struct otg_fsm_ops { | ||
| 123 | void (*chrg_vbus)(struct otg_fsm *fsm, int on); | ||
| 124 | void (*drv_vbus)(struct otg_fsm *fsm, int on); | ||
| 125 | void (*loc_conn)(struct otg_fsm *fsm, int on); | ||
| 126 | void (*loc_sof)(struct otg_fsm *fsm, int on); | ||
| 127 | void (*start_pulse)(struct otg_fsm *fsm); | ||
| 128 | void (*start_adp_prb)(struct otg_fsm *fsm); | ||
| 129 | void (*start_adp_sns)(struct otg_fsm *fsm); | ||
| 130 | void (*add_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer); | ||
| 131 | void (*del_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer); | ||
| 132 | int (*start_host)(struct otg_fsm *fsm, int on); | ||
| 133 | int (*start_gadget)(struct otg_fsm *fsm, int on); | ||
| 134 | }; | ||
| 135 | |||
| 136 | |||
| 137 | static inline int otg_chrg_vbus(struct otg_fsm *fsm, int on) | ||
| 138 | { | ||
| 139 | if (!fsm->ops->chrg_vbus) | ||
| 140 | return -EOPNOTSUPP; | ||
| 141 | fsm->ops->chrg_vbus(fsm, on); | ||
| 142 | return 0; | ||
| 143 | } | ||
| 144 | |||
| 145 | static inline int otg_drv_vbus(struct otg_fsm *fsm, int on) | ||
| 146 | { | ||
| 147 | if (!fsm->ops->drv_vbus) | ||
| 148 | return -EOPNOTSUPP; | ||
| 149 | if (fsm->drv_vbus != on) { | ||
| 150 | fsm->drv_vbus = on; | ||
| 151 | fsm->ops->drv_vbus(fsm, on); | ||
| 152 | } | ||
| 153 | return 0; | ||
| 154 | } | ||
| 155 | |||
| 156 | static inline int otg_loc_conn(struct otg_fsm *fsm, int on) | ||
| 157 | { | ||
| 158 | if (!fsm->ops->loc_conn) | ||
| 159 | return -EOPNOTSUPP; | ||
| 160 | if (fsm->loc_conn != on) { | ||
| 161 | fsm->loc_conn = on; | ||
| 162 | fsm->ops->loc_conn(fsm, on); | ||
| 163 | } | ||
| 164 | return 0; | ||
| 165 | } | ||
| 166 | |||
| 167 | static inline int otg_loc_sof(struct otg_fsm *fsm, int on) | ||
| 168 | { | ||
| 169 | if (!fsm->ops->loc_sof) | ||
| 170 | return -EOPNOTSUPP; | ||
| 171 | if (fsm->loc_sof != on) { | ||
| 172 | fsm->loc_sof = on; | ||
| 173 | fsm->ops->loc_sof(fsm, on); | ||
| 174 | } | ||
| 175 | return 0; | ||
| 176 | } | ||
| 177 | |||
| 178 | static inline int otg_start_pulse(struct otg_fsm *fsm) | ||
| 179 | { | ||
| 180 | if (!fsm->ops->start_pulse) | ||
| 181 | return -EOPNOTSUPP; | ||
| 182 | if (!fsm->data_pulse) { | ||
| 183 | fsm->data_pulse = 1; | ||
| 184 | fsm->ops->start_pulse(fsm); | ||
| 185 | } | ||
| 186 | return 0; | ||
| 187 | } | ||
| 188 | |||
| 189 | static inline int otg_start_adp_prb(struct otg_fsm *fsm) | ||
| 190 | { | ||
| 191 | if (!fsm->ops->start_adp_prb) | ||
| 192 | return -EOPNOTSUPP; | ||
| 193 | if (!fsm->adp_prb) { | ||
| 194 | fsm->adp_sns = 0; | ||
| 195 | fsm->adp_prb = 1; | ||
| 196 | fsm->ops->start_adp_prb(fsm); | ||
| 197 | } | ||
| 198 | return 0; | ||
| 199 | } | ||
| 200 | |||
| 201 | static inline int otg_start_adp_sns(struct otg_fsm *fsm) | ||
| 202 | { | ||
| 203 | if (!fsm->ops->start_adp_sns) | ||
| 204 | return -EOPNOTSUPP; | ||
| 205 | if (!fsm->adp_sns) { | ||
| 206 | fsm->adp_sns = 1; | ||
| 207 | fsm->ops->start_adp_sns(fsm); | ||
| 208 | } | ||
| 209 | return 0; | ||
| 210 | } | ||
| 211 | |||
| 212 | static inline int otg_add_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer) | ||
| 213 | { | ||
| 214 | if (!fsm->ops->add_timer) | ||
| 215 | return -EOPNOTSUPP; | ||
| 216 | fsm->ops->add_timer(fsm, timer); | ||
| 217 | return 0; | ||
| 218 | } | ||
| 219 | |||
| 220 | static inline int otg_del_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer) | ||
| 221 | { | ||
| 222 | if (!fsm->ops->del_timer) | ||
| 223 | return -EOPNOTSUPP; | ||
| 224 | fsm->ops->del_timer(fsm, timer); | ||
| 225 | return 0; | ||
| 226 | } | ||
| 227 | |||
| 228 | static inline int otg_start_host(struct otg_fsm *fsm, int on) | ||
| 229 | { | ||
| 230 | if (!fsm->ops->start_host) | ||
| 231 | return -EOPNOTSUPP; | ||
| 232 | return fsm->ops->start_host(fsm, on); | ||
| 233 | } | ||
| 234 | |||
| 235 | static inline int otg_start_gadget(struct otg_fsm *fsm, int on) | ||
| 236 | { | ||
| 237 | if (!fsm->ops->start_gadget) | ||
| 238 | return -EOPNOTSUPP; | ||
| 239 | return fsm->ops->start_gadget(fsm, on); | ||
| 240 | } | ||
| 241 | |||
| 242 | int otg_statemachine(struct otg_fsm *fsm); | ||
| 243 | |||
| 244 | #endif /* __LINUX_USB_OTG_FSM_H */ | ||
diff --git a/include/linux/usb/wusb.h b/include/linux/usb/wusb.h index 0c4d4ca370ec..eeb28329fa3c 100644 --- a/include/linux/usb/wusb.h +++ b/include/linux/usb/wusb.h | |||
| @@ -271,6 +271,8 @@ static inline u8 wusb_key_index(int index, int type, int originator) | |||
| 271 | #define WUSB_KEY_INDEX_TYPE_GTK 2 | 271 | #define WUSB_KEY_INDEX_TYPE_GTK 2 |
| 272 | #define WUSB_KEY_INDEX_ORIGINATOR_HOST 0 | 272 | #define WUSB_KEY_INDEX_ORIGINATOR_HOST 0 |
| 273 | #define WUSB_KEY_INDEX_ORIGINATOR_DEVICE 1 | 273 | #define WUSB_KEY_INDEX_ORIGINATOR_DEVICE 1 |
| 274 | /* bits 0-3 used for the key index. */ | ||
| 275 | #define WUSB_KEY_INDEX_MAX 15 | ||
| 274 | 276 | ||
| 275 | /* A CCM Nonce, defined in WUSB1.0[6.4.1] */ | 277 | /* A CCM Nonce, defined in WUSB1.0[6.4.1] */ |
| 276 | struct aes_ccm_nonce { | 278 | struct aes_ccm_nonce { |
diff --git a/include/linux/uwb/umc.h b/include/linux/uwb/umc.h index 891d1d5f3947..ba82f03d8287 100644 --- a/include/linux/uwb/umc.h +++ b/include/linux/uwb/umc.h | |||
| @@ -143,7 +143,7 @@ int umc_match_pci_id(struct umc_driver *umc_drv, struct umc_dev *umc); | |||
| 143 | static inline struct pci_dev *umc_parent_pci_dev(struct umc_dev *umc_dev) | 143 | static inline struct pci_dev *umc_parent_pci_dev(struct umc_dev *umc_dev) |
| 144 | { | 144 | { |
| 145 | struct pci_dev *pci_dev = NULL; | 145 | struct pci_dev *pci_dev = NULL; |
| 146 | if (umc_dev->dev.parent->bus == &pci_bus_type) | 146 | if (dev_is_pci(umc_dev->dev.parent)) |
| 147 | pci_dev = to_pci_dev(umc_dev->dev.parent); | 147 | pci_dev = to_pci_dev(umc_dev->dev.parent); |
| 148 | return pci_dev; | 148 | return pci_dev; |
| 149 | } | 149 | } |
diff --git a/include/linux/vme.h b/include/linux/vme.h index c9d65bf14cec..8cd6f19ca518 100644 --- a/include/linux/vme.h +++ b/include/linux/vme.h | |||
| @@ -164,7 +164,8 @@ int vme_lm_attach(struct vme_resource *, int, void (*callback)(int)); | |||
| 164 | int vme_lm_detach(struct vme_resource *, int); | 164 | int vme_lm_detach(struct vme_resource *, int); |
| 165 | void vme_lm_free(struct vme_resource *); | 165 | void vme_lm_free(struct vme_resource *); |
| 166 | 166 | ||
| 167 | int vme_slot_get(struct vme_dev *); | 167 | int vme_slot_num(struct vme_dev *); |
| 168 | int vme_bus_num(struct vme_dev *); | ||
| 168 | 169 | ||
| 169 | int vme_register_driver(struct vme_driver *, unsigned int); | 170 | int vme_register_driver(struct vme_driver *, unsigned int); |
| 170 | void vme_unregister_driver(struct vme_driver *); | 171 | void vme_unregister_driver(struct vme_driver *); |
diff --git a/include/linux/vmpressure.h b/include/linux/vmpressure.h index 3f3788d49362..3e4535876d37 100644 --- a/include/linux/vmpressure.h +++ b/include/linux/vmpressure.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <linux/gfp.h> | 7 | #include <linux/gfp.h> |
| 8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
| 9 | #include <linux/cgroup.h> | 9 | #include <linux/cgroup.h> |
| 10 | #include <linux/eventfd.h> | ||
| 10 | 11 | ||
| 11 | struct vmpressure { | 12 | struct vmpressure { |
| 12 | unsigned long scanned; | 13 | unsigned long scanned; |
| @@ -33,13 +34,10 @@ extern void vmpressure_init(struct vmpressure *vmpr); | |||
| 33 | extern void vmpressure_cleanup(struct vmpressure *vmpr); | 34 | extern void vmpressure_cleanup(struct vmpressure *vmpr); |
| 34 | extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); | 35 | extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); |
| 35 | extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); | 36 | extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); |
| 36 | extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css); | 37 | extern int vmpressure_register_event(struct mem_cgroup *memcg, |
| 37 | extern int vmpressure_register_event(struct cgroup_subsys_state *css, | ||
| 38 | struct cftype *cft, | ||
| 39 | struct eventfd_ctx *eventfd, | 38 | struct eventfd_ctx *eventfd, |
| 40 | const char *args); | 39 | const char *args); |
| 41 | extern void vmpressure_unregister_event(struct cgroup_subsys_state *css, | 40 | extern void vmpressure_unregister_event(struct mem_cgroup *memcg, |
| 42 | struct cftype *cft, | ||
| 43 | struct eventfd_ctx *eventfd); | 41 | struct eventfd_ctx *eventfd); |
| 44 | #else | 42 | #else |
| 45 | static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, | 43 | static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, |
diff --git a/include/linux/vtime.h b/include/linux/vtime.h index f5b72b364bda..c5165fd256f9 100644 --- a/include/linux/vtime.h +++ b/include/linux/vtime.h | |||
| @@ -19,8 +19,8 @@ static inline bool vtime_accounting_enabled(void) { return true; } | |||
| 19 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN | 19 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN |
| 20 | static inline bool vtime_accounting_enabled(void) | 20 | static inline bool vtime_accounting_enabled(void) |
| 21 | { | 21 | { |
| 22 | if (static_key_false(&context_tracking_enabled)) { | 22 | if (context_tracking_is_enabled()) { |
| 23 | if (context_tracking_active()) | 23 | if (context_tracking_cpu_is_enabled()) |
| 24 | return true; | 24 | return true; |
| 25 | } | 25 | } |
| 26 | 26 | ||
diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h index 065e3ae79ab0..d58594a32324 100644 --- a/include/linux/w1-gpio.h +++ b/include/linux/w1-gpio.h | |||
| @@ -20,6 +20,7 @@ struct w1_gpio_platform_data { | |||
| 20 | unsigned int is_open_drain:1; | 20 | unsigned int is_open_drain:1; |
| 21 | void (*enable_external_pullup)(int enable); | 21 | void (*enable_external_pullup)(int enable); |
| 22 | unsigned int ext_pullup_enable_pin; | 22 | unsigned int ext_pullup_enable_pin; |
| 23 | unsigned int pullup_duration; | ||
| 23 | }; | 24 | }; |
| 24 | 25 | ||
| 25 | #endif /* _LINUX_W1_GPIO_H */ | 26 | #endif /* _LINUX_W1_GPIO_H */ |
diff --git a/include/linux/wait.h b/include/linux/wait.h index eaa00b10abaa..559044c79232 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
| @@ -286,8 +286,8 @@ do { \ | |||
| 286 | * wait_event_cmd - sleep until a condition gets true | 286 | * wait_event_cmd - sleep until a condition gets true |
| 287 | * @wq: the waitqueue to wait on | 287 | * @wq: the waitqueue to wait on |
| 288 | * @condition: a C expression for the event to wait for | 288 | * @condition: a C expression for the event to wait for |
| 289 | * cmd1: the command will be executed before sleep | 289 | * @cmd1: the command will be executed before sleep |
| 290 | * cmd2: the command will be executed after sleep | 290 | * @cmd2: the command will be executed after sleep |
| 291 | * | 291 | * |
| 292 | * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the | 292 | * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the |
| 293 | * @condition evaluates to true. The @condition is checked each time | 293 | * @condition evaluates to true. The @condition is checked each time |
diff --git a/include/linux/zorro.h b/include/linux/zorro.h index dff42025649b..63fbba0740c2 100644 --- a/include/linux/zorro.h +++ b/include/linux/zorro.h | |||
| @@ -11,107 +11,10 @@ | |||
| 11 | #ifndef _LINUX_ZORRO_H | 11 | #ifndef _LINUX_ZORRO_H |
| 12 | #define _LINUX_ZORRO_H | 12 | #define _LINUX_ZORRO_H |
| 13 | 13 | ||
| 14 | #include <linux/device.h> | ||
| 15 | |||
| 16 | |||
| 17 | /* | ||
| 18 | * Each Zorro board has a 32-bit ID of the form | ||
| 19 | * | ||
| 20 | * mmmmmmmmmmmmmmmmppppppppeeeeeeee | ||
| 21 | * | ||
| 22 | * with | ||
| 23 | * | ||
| 24 | * mmmmmmmmmmmmmmmm 16-bit Manufacturer ID (assigned by CBM (sigh)) | ||
| 25 | * pppppppp 8-bit Product ID (assigned by manufacturer) | ||
| 26 | * eeeeeeee 8-bit Extended Product ID (currently only used | ||
| 27 | * for some GVP boards) | ||
| 28 | */ | ||
| 29 | |||
| 30 | |||
| 31 | #define ZORRO_MANUF(id) ((id) >> 16) | ||
| 32 | #define ZORRO_PROD(id) (((id) >> 8) & 0xff) | ||
| 33 | #define ZORRO_EPC(id) ((id) & 0xff) | ||
| 34 | |||
| 35 | #define ZORRO_ID(manuf, prod, epc) \ | ||
| 36 | ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc)) | ||
| 37 | |||
| 38 | typedef __u32 zorro_id; | ||
| 39 | |||
| 40 | |||
| 41 | /* Include the ID list */ | ||
| 42 | #include <linux/zorro_ids.h> | ||
| 43 | |||
| 44 | 14 | ||
| 45 | /* | 15 | #include <uapi/linux/zorro.h> |
| 46 | * GVP identifies most of its products through the 'extended product code' | ||
| 47 | * (epc). The epc has to be ANDed with the GVP_PRODMASK before the | ||
| 48 | * identification. | ||
| 49 | */ | ||
| 50 | |||
| 51 | #define GVP_PRODMASK (0xf8) | ||
| 52 | #define GVP_SCSICLKMASK (0x01) | ||
| 53 | |||
| 54 | enum GVP_flags { | ||
| 55 | GVP_IO = 0x01, | ||
| 56 | GVP_ACCEL = 0x02, | ||
| 57 | GVP_SCSI = 0x04, | ||
| 58 | GVP_24BITDMA = 0x08, | ||
| 59 | GVP_25BITDMA = 0x10, | ||
| 60 | GVP_NOBANK = 0x20, | ||
| 61 | GVP_14MHZ = 0x40, | ||
| 62 | }; | ||
| 63 | |||
| 64 | |||
| 65 | struct Node { | ||
| 66 | struct Node *ln_Succ; /* Pointer to next (successor) */ | ||
| 67 | struct Node *ln_Pred; /* Pointer to previous (predecessor) */ | ||
| 68 | __u8 ln_Type; | ||
| 69 | __s8 ln_Pri; /* Priority, for sorting */ | ||
| 70 | __s8 *ln_Name; /* ID string, null terminated */ | ||
| 71 | } __attribute__ ((packed)); | ||
| 72 | |||
| 73 | struct ExpansionRom { | ||
| 74 | /* -First 16 bytes of the expansion ROM */ | ||
| 75 | __u8 er_Type; /* Board type, size and flags */ | ||
| 76 | __u8 er_Product; /* Product number, assigned by manufacturer */ | ||
| 77 | __u8 er_Flags; /* Flags */ | ||
| 78 | __u8 er_Reserved03; /* Must be zero ($ff inverted) */ | ||
| 79 | __u16 er_Manufacturer; /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */ | ||
| 80 | __u32 er_SerialNumber; /* Available for use by manufacturer */ | ||
| 81 | __u16 er_InitDiagVec; /* Offset to optional "DiagArea" structure */ | ||
| 82 | __u8 er_Reserved0c; | ||
| 83 | __u8 er_Reserved0d; | ||
| 84 | __u8 er_Reserved0e; | ||
| 85 | __u8 er_Reserved0f; | ||
| 86 | } __attribute__ ((packed)); | ||
| 87 | |||
| 88 | /* er_Type board type bits */ | ||
| 89 | #define ERT_TYPEMASK 0xc0 | ||
| 90 | #define ERT_ZORROII 0xc0 | ||
| 91 | #define ERT_ZORROIII 0x80 | ||
| 92 | |||
| 93 | /* other bits defined in er_Type */ | ||
| 94 | #define ERTB_MEMLIST 5 /* Link RAM into free memory list */ | ||
| 95 | #define ERTF_MEMLIST (1<<5) | ||
| 96 | |||
| 97 | struct ConfigDev { | ||
| 98 | struct Node cd_Node; | ||
| 99 | __u8 cd_Flags; /* (read/write) */ | ||
| 100 | __u8 cd_Pad; /* reserved */ | ||
| 101 | struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */ | ||
| 102 | void *cd_BoardAddr; /* where in memory the board was placed */ | ||
| 103 | __u32 cd_BoardSize; /* size of board in bytes */ | ||
| 104 | __u16 cd_SlotAddr; /* which slot number (PRIVATE) */ | ||
| 105 | __u16 cd_SlotSize; /* number of slots (PRIVATE) */ | ||
| 106 | void *cd_Driver; /* pointer to node of driver */ | ||
| 107 | struct ConfigDev *cd_NextCD; /* linked list of drivers to config */ | ||
| 108 | __u32 cd_Unused[4]; /* for whatever the driver wants */ | ||
| 109 | } __attribute__ ((packed)); | ||
| 110 | |||
| 111 | #define ZORRO_NUM_AUTO 16 | ||
| 112 | |||
| 113 | #ifdef __KERNEL__ | ||
| 114 | 16 | ||
| 17 | #include <linux/device.h> | ||
| 115 | #include <linux/init.h> | 18 | #include <linux/init.h> |
| 116 | #include <linux/ioport.h> | 19 | #include <linux/ioport.h> |
| 117 | #include <linux/mod_devicetable.h> | 20 | #include <linux/mod_devicetable.h> |
| @@ -175,7 +78,23 @@ static inline struct zorro_driver *zorro_dev_driver(const struct zorro_dev *z) | |||
| 175 | 78 | ||
| 176 | 79 | ||
| 177 | extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */ | 80 | extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */ |
| 178 | extern struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO]; | 81 | extern struct zorro_dev *zorro_autocon; |
| 82 | |||
| 83 | |||
| 84 | /* | ||
| 85 | * Minimal information about a Zorro device, passed from bootinfo | ||
| 86 | * Only available temporarily, i.e. until initmem has been freed! | ||
| 87 | */ | ||
| 88 | |||
| 89 | struct zorro_dev_init { | ||
| 90 | struct ExpansionRom rom; | ||
| 91 | u16 slotaddr; | ||
| 92 | u16 slotsize; | ||
| 93 | u32 boardaddr; | ||
| 94 | u32 boardsize; | ||
| 95 | }; | ||
| 96 | |||
| 97 | extern struct zorro_dev_init zorro_autocon_init[ZORRO_NUM_AUTO] __initdata; | ||
| 179 | 98 | ||
| 180 | 99 | ||
| 181 | /* | 100 | /* |
| @@ -229,6 +148,4 @@ extern DECLARE_BITMAP(zorro_unused_z2ram, 128); | |||
| 229 | #define Z2RAM_CHUNKSHIFT (16) | 148 | #define Z2RAM_CHUNKSHIFT (16) |
| 230 | 149 | ||
| 231 | 150 | ||
| 232 | #endif /* __KERNEL__ */ | ||
| 233 | |||
| 234 | #endif /* _LINUX_ZORRO_H */ | 151 | #endif /* _LINUX_ZORRO_H */ |
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index bd8218b15009..941055e9d125 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h | |||
| @@ -83,7 +83,7 @@ struct vb2_fileio_data; | |||
| 83 | struct vb2_mem_ops { | 83 | struct vb2_mem_ops { |
| 84 | void *(*alloc)(void *alloc_ctx, unsigned long size, gfp_t gfp_flags); | 84 | void *(*alloc)(void *alloc_ctx, unsigned long size, gfp_t gfp_flags); |
| 85 | void (*put)(void *buf_priv); | 85 | void (*put)(void *buf_priv); |
| 86 | struct dma_buf *(*get_dmabuf)(void *buf_priv); | 86 | struct dma_buf *(*get_dmabuf)(void *buf_priv, unsigned long flags); |
| 87 | 87 | ||
| 88 | void *(*get_userptr)(void *alloc_ctx, unsigned long vaddr, | 88 | void *(*get_userptr)(void *alloc_ctx, unsigned long vaddr, |
| 89 | unsigned long size, int write); | 89 | unsigned long size, int write); |
diff --git a/include/net/Space.h b/include/net/Space.h new file mode 100644 index 000000000000..8a32771e4215 --- /dev/null +++ b/include/net/Space.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* A unified ethernet device probe. This is the easiest way to have every | ||
| 2 | * ethernet adaptor have the name "eth[0123...]". | ||
| 3 | */ | ||
| 4 | |||
| 5 | struct net_device *hp100_probe(int unit); | ||
| 6 | struct net_device *ultra_probe(int unit); | ||
| 7 | struct net_device *wd_probe(int unit); | ||
| 8 | struct net_device *ne_probe(int unit); | ||
| 9 | struct net_device *fmv18x_probe(int unit); | ||
| 10 | struct net_device *i82596_probe(int unit); | ||
| 11 | struct net_device *ni65_probe(int unit); | ||
| 12 | struct net_device *sonic_probe(int unit); | ||
| 13 | struct net_device *smc_init(int unit); | ||
| 14 | struct net_device *atarilance_probe(int unit); | ||
| 15 | struct net_device *sun3lance_probe(int unit); | ||
| 16 | struct net_device *sun3_82586_probe(int unit); | ||
| 17 | struct net_device *apne_probe(int unit); | ||
| 18 | struct net_device *cs89x0_probe(int unit); | ||
| 19 | struct net_device *mvme147lance_probe(int unit); | ||
| 20 | struct net_device *tc515_probe(int unit); | ||
| 21 | struct net_device *lance_probe(int unit); | ||
| 22 | struct net_device *mac8390_probe(int unit); | ||
| 23 | struct net_device *mac89x0_probe(int unit); | ||
| 24 | struct net_device *cops_probe(int unit); | ||
| 25 | struct net_device *ltpc_probe(void); | ||
| 26 | |||
| 27 | /* Fibre Channel adapters */ | ||
| 28 | int iph5526_probe(struct net_device *dev); | ||
| 29 | |||
| 30 | /* SBNI adapters */ | ||
| 31 | int sbni_probe(int unit); | ||
diff --git a/include/net/act_api.h b/include/net/act_api.h index 9e90fdff470d..788d8378e587 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include <net/pkt_sched.h> | 9 | #include <net/pkt_sched.h> |
| 10 | 10 | ||
| 11 | struct tcf_common { | 11 | struct tcf_common { |
| 12 | struct tcf_common *tcfc_next; | 12 | struct hlist_node tcfc_head; |
| 13 | u32 tcfc_index; | 13 | u32 tcfc_index; |
| 14 | int tcfc_refcnt; | 14 | int tcfc_refcnt; |
| 15 | int tcfc_bindcnt; | 15 | int tcfc_bindcnt; |
| @@ -22,7 +22,7 @@ struct tcf_common { | |||
| 22 | spinlock_t tcfc_lock; | 22 | spinlock_t tcfc_lock; |
| 23 | struct rcu_head tcfc_rcu; | 23 | struct rcu_head tcfc_rcu; |
| 24 | }; | 24 | }; |
| 25 | #define tcf_next common.tcfc_next | 25 | #define tcf_head common.tcfc_head |
| 26 | #define tcf_index common.tcfc_index | 26 | #define tcf_index common.tcfc_index |
| 27 | #define tcf_refcnt common.tcfc_refcnt | 27 | #define tcf_refcnt common.tcfc_refcnt |
| 28 | #define tcf_bindcnt common.tcfc_bindcnt | 28 | #define tcf_bindcnt common.tcfc_bindcnt |
| @@ -36,9 +36,10 @@ struct tcf_common { | |||
| 36 | #define tcf_rcu common.tcfc_rcu | 36 | #define tcf_rcu common.tcfc_rcu |
| 37 | 37 | ||
| 38 | struct tcf_hashinfo { | 38 | struct tcf_hashinfo { |
| 39 | struct tcf_common **htab; | 39 | struct hlist_head *htab; |
| 40 | unsigned int hmask; | 40 | unsigned int hmask; |
| 41 | rwlock_t *lock; | 41 | spinlock_t lock; |
| 42 | u32 index; | ||
| 42 | }; | 43 | }; |
| 43 | 44 | ||
| 44 | static inline unsigned int tcf_hash(u32 index, unsigned int hmask) | 45 | static inline unsigned int tcf_hash(u32 index, unsigned int hmask) |
| @@ -46,33 +47,47 @@ static inline unsigned int tcf_hash(u32 index, unsigned int hmask) | |||
| 46 | return index & hmask; | 47 | return index & hmask; |
| 47 | } | 48 | } |
| 48 | 49 | ||
| 50 | static inline int tcf_hashinfo_init(struct tcf_hashinfo *hf, unsigned int mask) | ||
| 51 | { | ||
| 52 | int i; | ||
| 53 | |||
| 54 | spin_lock_init(&hf->lock); | ||
| 55 | hf->index = 0; | ||
| 56 | hf->hmask = mask; | ||
| 57 | hf->htab = kzalloc((mask + 1) * sizeof(struct hlist_head), | ||
| 58 | GFP_KERNEL); | ||
| 59 | if (!hf->htab) | ||
| 60 | return -ENOMEM; | ||
| 61 | for (i = 0; i < mask + 1; i++) | ||
| 62 | INIT_HLIST_HEAD(&hf->htab[i]); | ||
| 63 | return 0; | ||
| 64 | } | ||
| 65 | |||
| 66 | static inline void tcf_hashinfo_destroy(struct tcf_hashinfo *hf) | ||
| 67 | { | ||
| 68 | kfree(hf->htab); | ||
| 69 | } | ||
| 70 | |||
| 49 | #ifdef CONFIG_NET_CLS_ACT | 71 | #ifdef CONFIG_NET_CLS_ACT |
| 50 | 72 | ||
| 51 | #define ACT_P_CREATED 1 | 73 | #define ACT_P_CREATED 1 |
| 52 | #define ACT_P_DELETED 1 | 74 | #define ACT_P_DELETED 1 |
| 53 | 75 | ||
| 54 | struct tcf_act_hdr { | ||
| 55 | struct tcf_common common; | ||
| 56 | }; | ||
| 57 | |||
| 58 | struct tc_action { | 76 | struct tc_action { |
| 59 | void *priv; | 77 | void *priv; |
| 60 | const struct tc_action_ops *ops; | 78 | const struct tc_action_ops *ops; |
| 61 | __u32 type; /* for backward compat(TCA_OLD_COMPAT) */ | 79 | __u32 type; /* for backward compat(TCA_OLD_COMPAT) */ |
| 62 | __u32 order; | 80 | __u32 order; |
| 63 | struct tc_action *next; | 81 | struct list_head list; |
| 64 | }; | 82 | }; |
| 65 | 83 | ||
| 66 | #define TCA_CAP_NONE 0 | ||
| 67 | struct tc_action_ops { | 84 | struct tc_action_ops { |
| 68 | struct tc_action_ops *next; | 85 | struct list_head head; |
| 69 | struct tcf_hashinfo *hinfo; | 86 | struct tcf_hashinfo *hinfo; |
| 70 | char kind[IFNAMSIZ]; | 87 | char kind[IFNAMSIZ]; |
| 71 | __u32 type; /* TBD to match kind */ | 88 | __u32 type; /* TBD to match kind */ |
| 72 | __u32 capab; /* capabilities includes 4 bit version */ | ||
| 73 | struct module *owner; | 89 | struct module *owner; |
| 74 | int (*act)(struct sk_buff *, const struct tc_action *, struct tcf_result *); | 90 | int (*act)(struct sk_buff *, const struct tc_action *, struct tcf_result *); |
| 75 | int (*get_stats)(struct sk_buff *, struct tc_action *); | ||
| 76 | int (*dump)(struct sk_buff *, struct tc_action *, int, int); | 91 | int (*dump)(struct sk_buff *, struct tc_action *, int, int); |
| 77 | int (*cleanup)(struct tc_action *, int bind); | 92 | int (*cleanup)(struct tc_action *, int bind); |
| 78 | int (*lookup)(struct tc_action *, u32); | 93 | int (*lookup)(struct tc_action *, u32); |
| @@ -82,34 +97,30 @@ struct tc_action_ops { | |||
| 82 | int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *); | 97 | int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *); |
| 83 | }; | 98 | }; |
| 84 | 99 | ||
| 85 | struct tcf_common *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo); | 100 | int tcf_hash_search(struct tc_action *a, u32 index); |
| 86 | void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo); | 101 | void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo); |
| 87 | int tcf_hash_release(struct tcf_common *p, int bind, | 102 | int tcf_hash_release(struct tcf_common *p, int bind, |
| 88 | struct tcf_hashinfo *hinfo); | 103 | struct tcf_hashinfo *hinfo); |
| 89 | int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb, | 104 | u32 tcf_hash_new_index(struct tcf_hashinfo *hinfo); |
| 90 | int type, struct tc_action *a); | ||
| 91 | u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo); | ||
| 92 | int tcf_hash_search(struct tc_action *a, u32 index); | ||
| 93 | struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, | 105 | struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, |
| 94 | int bind, struct tcf_hashinfo *hinfo); | 106 | int bind); |
| 95 | struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est, | 107 | struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est, |
| 96 | struct tc_action *a, int size, | 108 | struct tc_action *a, int size, |
| 97 | int bind, u32 *idx_gen, | 109 | int bind); |
| 98 | struct tcf_hashinfo *hinfo); | ||
| 99 | void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo); | 110 | void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo); |
| 100 | 111 | ||
| 101 | int tcf_register_action(struct tc_action_ops *a); | 112 | int tcf_register_action(struct tc_action_ops *a); |
| 102 | int tcf_unregister_action(struct tc_action_ops *a); | 113 | int tcf_unregister_action(struct tc_action_ops *a); |
| 103 | void tcf_action_destroy(struct tc_action *a, int bind); | 114 | void tcf_action_destroy(struct list_head *actions, int bind); |
| 104 | int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, | 115 | int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions, |
| 105 | struct tcf_result *res); | 116 | struct tcf_result *res); |
| 106 | struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla, | 117 | int tcf_action_init(struct net *net, struct nlattr *nla, |
| 107 | struct nlattr *est, char *n, int ovr, | 118 | struct nlattr *est, char *n, int ovr, |
| 108 | int bind); | 119 | int bind, struct list_head *); |
| 109 | struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla, | 120 | struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla, |
| 110 | struct nlattr *est, char *n, int ovr, | 121 | struct nlattr *est, char *n, int ovr, |
| 111 | int bind); | 122 | int bind); |
| 112 | int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); | 123 | int tcf_action_dump(struct sk_buff *skb, struct list_head *, int, int); |
| 113 | int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); | 124 | int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); |
| 114 | int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); | 125 | int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); |
| 115 | int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int); | 126 | int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int); |
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 86505bfa5d2c..50e39a8822b4 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
| @@ -81,9 +81,9 @@ int ipv6_dev_get_saddr(struct net *net, const struct net_device *dev, | |||
| 81 | const struct in6_addr *daddr, unsigned int srcprefs, | 81 | const struct in6_addr *daddr, unsigned int srcprefs, |
| 82 | struct in6_addr *saddr); | 82 | struct in6_addr *saddr); |
| 83 | int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr, | 83 | int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr, |
| 84 | unsigned char banned_flags); | 84 | u32 banned_flags); |
| 85 | int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr, | 85 | int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr, |
| 86 | unsigned char banned_flags); | 86 | u32 banned_flags); |
| 87 | int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2); | 87 | int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2); |
| 88 | void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr); | 88 | void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr); |
| 89 | void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr); | 89 | void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr); |
| @@ -205,8 +205,9 @@ void ipv6_sock_ac_close(struct sock *sk); | |||
| 205 | int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); | 205 | int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); |
| 206 | int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); | 206 | int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); |
| 207 | bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, | 207 | bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, |
| 208 | const struct in6_addr *addr); | 208 | const struct in6_addr *addr); |
| 209 | 209 | bool ipv6_chk_acast_addr_src(struct net *net, struct net_device *dev, | |
| 210 | const struct in6_addr *addr); | ||
| 210 | 211 | ||
| 211 | /* Device notifier */ | 212 | /* Device notifier */ |
| 212 | int register_inet6addr_notifier(struct notifier_block *nb); | 213 | int register_inet6addr_notifier(struct notifier_block *nb); |
| @@ -248,6 +249,13 @@ static inline struct inet6_dev *in6_dev_get(const struct net_device *dev) | |||
| 248 | return idev; | 249 | return idev; |
| 249 | } | 250 | } |
| 250 | 251 | ||
| 252 | static inline struct neigh_parms *__in6_dev_nd_parms_get_rcu(const struct net_device *dev) | ||
| 253 | { | ||
| 254 | struct inet6_dev *idev = __in6_dev_get(dev); | ||
| 255 | |||
| 256 | return idev ? idev->nd_parms : NULL; | ||
| 257 | } | ||
| 258 | |||
| 251 | void in6_dev_finish_destroy(struct inet6_dev *idev); | 259 | void in6_dev_finish_destroy(struct inet6_dev *idev); |
| 252 | 260 | ||
| 253 | static inline void in6_dev_put(struct inet6_dev *idev) | 261 | static inline void in6_dev_put(struct inet6_dev *idev) |
diff --git a/include/net/arp.h b/include/net/arp.h index 7509d9da4e36..73c49864076b 100644 --- a/include/net/arp.h +++ b/include/net/arp.h | |||
| @@ -62,6 +62,5 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, | |||
| 62 | const unsigned char *src_hw, | 62 | const unsigned char *src_hw, |
| 63 | const unsigned char *target_hw); | 63 | const unsigned char *target_hw); |
| 64 | void arp_xmit(struct sk_buff *skb); | 64 | void arp_xmit(struct sk_buff *skb); |
| 65 | int arp_invalidate(struct net_device *dev, __be32 ip); | ||
| 66 | 65 | ||
| 67 | #endif /* _ARP_H */ | 66 | #endif /* _ARP_H */ |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 2a628b28249f..f4f9ee466791 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -115,6 +115,9 @@ struct bt_voice { | |||
| 115 | #define BT_VOICE_TRANSPARENT 0x0003 | 115 | #define BT_VOICE_TRANSPARENT 0x0003 |
| 116 | #define BT_VOICE_CVSD_16BIT 0x0060 | 116 | #define BT_VOICE_CVSD_16BIT 0x0060 |
| 117 | 117 | ||
| 118 | #define BT_SNDMTU 12 | ||
| 119 | #define BT_RCVMTU 13 | ||
| 120 | |||
| 118 | __printf(1, 2) | 121 | __printf(1, 2) |
| 119 | int bt_info(const char *fmt, ...); | 122 | int bt_info(const char *fmt, ...); |
| 120 | __printf(1, 2) | 123 | __printf(1, 2) |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 1784c48699f0..66c1cd87bfe7 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
| @@ -83,7 +83,8 @@ | |||
| 83 | enum { | 83 | enum { |
| 84 | HCI_QUIRK_RESET_ON_CLOSE, | 84 | HCI_QUIRK_RESET_ON_CLOSE, |
| 85 | HCI_QUIRK_RAW_DEVICE, | 85 | HCI_QUIRK_RAW_DEVICE, |
| 86 | HCI_QUIRK_FIXUP_BUFFER_SIZE | 86 | HCI_QUIRK_FIXUP_BUFFER_SIZE, |
| 87 | HCI_QUIRK_BROKEN_STORED_LINK_KEY, | ||
| 87 | }; | 88 | }; |
| 88 | 89 | ||
| 89 | /* HCI device flags */ | 90 | /* HCI device flags */ |
| @@ -131,6 +132,7 @@ enum { | |||
| 131 | HCI_PERIODIC_INQ, | 132 | HCI_PERIODIC_INQ, |
| 132 | HCI_FAST_CONNECTABLE, | 133 | HCI_FAST_CONNECTABLE, |
| 133 | HCI_BREDR_ENABLED, | 134 | HCI_BREDR_ENABLED, |
| 135 | HCI_6LOWPAN_ENABLED, | ||
| 134 | }; | 136 | }; |
| 135 | 137 | ||
| 136 | /* A mask for the flags that are supposed to remain when a reset happens | 138 | /* A mask for the flags that are supposed to remain when a reset happens |
| @@ -275,6 +277,12 @@ enum { | |||
| 275 | #define LMP_EXTFEATURES 0x80 | 277 | #define LMP_EXTFEATURES 0x80 |
| 276 | 278 | ||
| 277 | /* Extended LMP features */ | 279 | /* Extended LMP features */ |
| 280 | #define LMP_CSB_MASTER 0x01 | ||
| 281 | #define LMP_CSB_SLAVE 0x02 | ||
| 282 | #define LMP_SYNC_TRAIN 0x04 | ||
| 283 | #define LMP_SYNC_SCAN 0x08 | ||
| 284 | |||
| 285 | /* Host features */ | ||
| 278 | #define LMP_HOST_SSP 0x01 | 286 | #define LMP_HOST_SSP 0x01 |
| 279 | #define LMP_HOST_LE 0x02 | 287 | #define LMP_HOST_LE 0x02 |
| 280 | #define LMP_HOST_LE_BREDR 0x04 | 288 | #define LMP_HOST_LE_BREDR 0x04 |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index f8555ad7b104..f2f0cf5865c4 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -448,6 +448,7 @@ enum { | |||
| 448 | HCI_CONN_SSP_ENABLED, | 448 | HCI_CONN_SSP_ENABLED, |
| 449 | HCI_CONN_POWER_SAVE, | 449 | HCI_CONN_POWER_SAVE, |
| 450 | HCI_CONN_REMOTE_OOB, | 450 | HCI_CONN_REMOTE_OOB, |
| 451 | HCI_CONN_6LOWPAN, | ||
| 451 | }; | 452 | }; |
| 452 | 453 | ||
| 453 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) | 454 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) |
| @@ -798,6 +799,12 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
| 798 | #define lmp_transp_capable(dev) ((dev)->features[0][2] & LMP_TRANSPARENT) | 799 | #define lmp_transp_capable(dev) ((dev)->features[0][2] & LMP_TRANSPARENT) |
| 799 | 800 | ||
| 800 | /* ----- Extended LMP capabilities ----- */ | 801 | /* ----- Extended LMP capabilities ----- */ |
| 802 | #define lmp_csb_master_capable(dev) ((dev)->features[2][0] & LMP_CSB_MASTER) | ||
| 803 | #define lmp_csb_slave_capable(dev) ((dev)->features[2][0] & LMP_CSB_SLAVE) | ||
| 804 | #define lmp_sync_train_capable(dev) ((dev)->features[2][0] & LMP_SYNC_TRAIN) | ||
| 805 | #define lmp_sync_scan_capable(dev) ((dev)->features[2][0] & LMP_SYNC_SCAN) | ||
| 806 | |||
| 807 | /* ----- Host capabilities ----- */ | ||
| 801 | #define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP) | 808 | #define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP) |
| 802 | #define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) | 809 | #define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) |
| 803 | #define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) | 810 | #define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index c853b16de4ef..dbc4a89984ca 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
| @@ -112,6 +112,9 @@ struct l2cap_conninfo { | |||
| 112 | #define L2CAP_MOVE_CHAN_CFM_RSP 0x11 | 112 | #define L2CAP_MOVE_CHAN_CFM_RSP 0x11 |
| 113 | #define L2CAP_CONN_PARAM_UPDATE_REQ 0x12 | 113 | #define L2CAP_CONN_PARAM_UPDATE_REQ 0x12 |
| 114 | #define L2CAP_CONN_PARAM_UPDATE_RSP 0x13 | 114 | #define L2CAP_CONN_PARAM_UPDATE_RSP 0x13 |
| 115 | #define L2CAP_LE_CONN_REQ 0x14 | ||
| 116 | #define L2CAP_LE_CONN_RSP 0x15 | ||
| 117 | #define L2CAP_LE_CREDITS 0x16 | ||
| 115 | 118 | ||
| 116 | /* L2CAP extended feature mask */ | 119 | /* L2CAP extended feature mask */ |
| 117 | #define L2CAP_FEAT_FLOWCTL 0x00000001 | 120 | #define L2CAP_FEAT_FLOWCTL 0x00000001 |
| @@ -133,6 +136,7 @@ struct l2cap_conninfo { | |||
| 133 | #define L2CAP_FC_L2CAP 0x02 | 136 | #define L2CAP_FC_L2CAP 0x02 |
| 134 | #define L2CAP_FC_CONNLESS 0x04 | 137 | #define L2CAP_FC_CONNLESS 0x04 |
| 135 | #define L2CAP_FC_A2MP 0x08 | 138 | #define L2CAP_FC_A2MP 0x08 |
| 139 | #define L2CAP_FC_6LOWPAN 0x3e /* reserved and temporary value */ | ||
| 136 | 140 | ||
| 137 | /* L2CAP Control Field bit masks */ | 141 | /* L2CAP Control Field bit masks */ |
| 138 | #define L2CAP_CTRL_SAR 0xC000 | 142 | #define L2CAP_CTRL_SAR 0xC000 |
| @@ -249,6 +253,7 @@ struct l2cap_conn_rsp { | |||
| 249 | #define L2CAP_CID_SMP 0x0006 | 253 | #define L2CAP_CID_SMP 0x0006 |
| 250 | #define L2CAP_CID_DYN_START 0x0040 | 254 | #define L2CAP_CID_DYN_START 0x0040 |
| 251 | #define L2CAP_CID_DYN_END 0xffff | 255 | #define L2CAP_CID_DYN_END 0xffff |
| 256 | #define L2CAP_CID_LE_DYN_END 0x007f | ||
| 252 | 257 | ||
| 253 | /* connect/create channel results */ | 258 | /* connect/create channel results */ |
| 254 | #define L2CAP_CR_SUCCESS 0x0000 | 259 | #define L2CAP_CR_SUCCESS 0x0000 |
| @@ -257,6 +262,10 @@ struct l2cap_conn_rsp { | |||
| 257 | #define L2CAP_CR_SEC_BLOCK 0x0003 | 262 | #define L2CAP_CR_SEC_BLOCK 0x0003 |
| 258 | #define L2CAP_CR_NO_MEM 0x0004 | 263 | #define L2CAP_CR_NO_MEM 0x0004 |
| 259 | #define L2CAP_CR_BAD_AMP 0x0005 | 264 | #define L2CAP_CR_BAD_AMP 0x0005 |
| 265 | #define L2CAP_CR_AUTHENTICATION 0x0005 | ||
| 266 | #define L2CAP_CR_AUTHORIZATION 0x0006 | ||
| 267 | #define L2CAP_CR_BAD_KEY_SIZE 0x0007 | ||
| 268 | #define L2CAP_CR_ENCRYPTION 0x0008 | ||
| 260 | 269 | ||
| 261 | /* connect/create channel status */ | 270 | /* connect/create channel status */ |
| 262 | #define L2CAP_CS_NO_INFO 0x0000 | 271 | #define L2CAP_CS_NO_INFO 0x0000 |
| @@ -321,6 +330,12 @@ struct l2cap_conf_rfc { | |||
| 321 | #define L2CAP_MODE_ERTM 0x03 | 330 | #define L2CAP_MODE_ERTM 0x03 |
| 322 | #define L2CAP_MODE_STREAMING 0x04 | 331 | #define L2CAP_MODE_STREAMING 0x04 |
| 323 | 332 | ||
| 333 | /* Unlike the above this one doesn't actually map to anything that would | ||
| 334 | * ever be sent over the air. Therefore, use a value that's unlikely to | ||
| 335 | * ever be used in the BR/EDR configuration phase. | ||
| 336 | */ | ||
| 337 | #define L2CAP_MODE_LE_FLOWCTL 0x80 | ||
| 338 | |||
| 324 | struct l2cap_conf_efs { | 339 | struct l2cap_conf_efs { |
| 325 | __u8 id; | 340 | __u8 id; |
| 326 | __u8 stype; | 341 | __u8 stype; |
| @@ -423,6 +438,30 @@ struct l2cap_conn_param_update_rsp { | |||
| 423 | #define L2CAP_CONN_PARAM_ACCEPTED 0x0000 | 438 | #define L2CAP_CONN_PARAM_ACCEPTED 0x0000 |
| 424 | #define L2CAP_CONN_PARAM_REJECTED 0x0001 | 439 | #define L2CAP_CONN_PARAM_REJECTED 0x0001 |
| 425 | 440 | ||
| 441 | #define L2CAP_LE_MAX_CREDITS 10 | ||
| 442 | #define L2CAP_LE_DEFAULT_MPS 230 | ||
| 443 | |||
| 444 | struct l2cap_le_conn_req { | ||
| 445 | __le16 psm; | ||
| 446 | __le16 scid; | ||
| 447 | __le16 mtu; | ||
| 448 | __le16 mps; | ||
| 449 | __le16 credits; | ||
| 450 | } __packed; | ||
| 451 | |||
| 452 | struct l2cap_le_conn_rsp { | ||
| 453 | __le16 dcid; | ||
| 454 | __le16 mtu; | ||
| 455 | __le16 mps; | ||
| 456 | __le16 credits; | ||
| 457 | __le16 result; | ||
| 458 | } __packed; | ||
| 459 | |||
| 460 | struct l2cap_le_credits { | ||
| 461 | __le16 cid; | ||
| 462 | __le16 credits; | ||
| 463 | } __packed; | ||
| 464 | |||
| 426 | /* ----- L2CAP channels and connections ----- */ | 465 | /* ----- L2CAP channels and connections ----- */ |
| 427 | struct l2cap_seq_list { | 466 | struct l2cap_seq_list { |
| 428 | __u16 head; | 467 | __u16 head; |
| @@ -477,6 +516,9 @@ struct l2cap_chan { | |||
| 477 | __u16 monitor_timeout; | 516 | __u16 monitor_timeout; |
| 478 | __u16 mps; | 517 | __u16 mps; |
| 479 | 518 | ||
| 519 | __u16 tx_credits; | ||
| 520 | __u16 rx_credits; | ||
| 521 | |||
| 480 | __u8 tx_state; | 522 | __u8 tx_state; |
| 481 | __u8 rx_state; | 523 | __u8 rx_state; |
| 482 | 524 | ||
| @@ -553,6 +595,7 @@ struct l2cap_ops { | |||
| 553 | void (*ready) (struct l2cap_chan *chan); | 595 | void (*ready) (struct l2cap_chan *chan); |
| 554 | void (*defer) (struct l2cap_chan *chan); | 596 | void (*defer) (struct l2cap_chan *chan); |
| 555 | void (*resume) (struct l2cap_chan *chan); | 597 | void (*resume) (struct l2cap_chan *chan); |
| 598 | void (*suspend) (struct l2cap_chan *chan); | ||
| 556 | void (*set_shutdown) (struct l2cap_chan *chan); | 599 | void (*set_shutdown) (struct l2cap_chan *chan); |
| 557 | long (*get_sndtimeo) (struct l2cap_chan *chan); | 600 | long (*get_sndtimeo) (struct l2cap_chan *chan); |
| 558 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, | 601 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, |
| @@ -654,6 +697,7 @@ enum { | |||
| 654 | FLAG_EXT_CTRL, | 697 | FLAG_EXT_CTRL, |
| 655 | FLAG_EFS_ENABLE, | 698 | FLAG_EFS_ENABLE, |
| 656 | FLAG_DEFER_SETUP, | 699 | FLAG_DEFER_SETUP, |
| 700 | FLAG_LE_CONN_REQ_SENT, | ||
| 657 | }; | 701 | }; |
| 658 | 702 | ||
| 659 | enum { | 703 | enum { |
| @@ -809,11 +853,13 @@ static inline long l2cap_chan_no_get_sndtimeo(struct l2cap_chan *chan) | |||
| 809 | } | 853 | } |
| 810 | 854 | ||
| 811 | extern bool disable_ertm; | 855 | extern bool disable_ertm; |
| 856 | extern bool enable_lecoc; | ||
| 812 | 857 | ||
| 813 | int l2cap_init_sockets(void); | 858 | int l2cap_init_sockets(void); |
| 814 | void l2cap_cleanup_sockets(void); | 859 | void l2cap_cleanup_sockets(void); |
| 815 | bool l2cap_is_socket(struct socket *sock); | 860 | bool l2cap_is_socket(struct socket *sock); |
| 816 | 861 | ||
| 862 | void __l2cap_le_connect_rsp_defer(struct l2cap_chan *chan); | ||
| 817 | void __l2cap_connect_rsp_defer(struct l2cap_chan *chan); | 863 | void __l2cap_connect_rsp_defer(struct l2cap_chan *chan); |
| 818 | 864 | ||
| 819 | int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm); | 865 | int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm); |
diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h index 829627d7b846..1d67fb6b23a0 100644 --- a/include/net/busy_poll.h +++ b/include/net/busy_poll.h | |||
| @@ -42,27 +42,10 @@ static inline bool net_busy_loop_on(void) | |||
| 42 | return sysctl_net_busy_poll; | 42 | return sysctl_net_busy_poll; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | /* a wrapper to make debug_smp_processor_id() happy | ||
| 46 | * we can use sched_clock() because we don't care much about precision | ||
| 47 | * we only care that the average is bounded | ||
| 48 | */ | ||
| 49 | #ifdef CONFIG_DEBUG_PREEMPT | ||
| 50 | static inline u64 busy_loop_us_clock(void) | ||
| 51 | { | ||
| 52 | u64 rc; | ||
| 53 | |||
| 54 | preempt_disable_notrace(); | ||
| 55 | rc = sched_clock(); | ||
| 56 | preempt_enable_no_resched_notrace(); | ||
| 57 | |||
| 58 | return rc >> 10; | ||
| 59 | } | ||
| 60 | #else /* CONFIG_DEBUG_PREEMPT */ | ||
| 61 | static inline u64 busy_loop_us_clock(void) | 45 | static inline u64 busy_loop_us_clock(void) |
| 62 | { | 46 | { |
| 63 | return sched_clock() >> 10; | 47 | return local_clock() >> 10; |
| 64 | } | 48 | } |
| 65 | #endif /* CONFIG_DEBUG_PREEMPT */ | ||
| 66 | 49 | ||
| 67 | static inline unsigned long sk_busy_loop_end_time(struct sock *sk) | 50 | static inline unsigned long sk_busy_loop_end_time(struct sock *sk) |
| 68 | { | 51 | { |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 3eae46cb1acf..b1f84b05c67e 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
| @@ -91,9 +91,8 @@ enum ieee80211_band { | |||
| 91 | * Channel flags set by the regulatory control code. | 91 | * Channel flags set by the regulatory control code. |
| 92 | * | 92 | * |
| 93 | * @IEEE80211_CHAN_DISABLED: This channel is disabled. | 93 | * @IEEE80211_CHAN_DISABLED: This channel is disabled. |
| 94 | * @IEEE80211_CHAN_PASSIVE_SCAN: Only passive scanning is permitted | 94 | * @IEEE80211_CHAN_NO_IR: do not initiate radiation, this includes |
| 95 | * on this channel. | 95 | * sending probe requests or beaconing. |
| 96 | * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel. | ||
| 97 | * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel. | 96 | * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel. |
| 98 | * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel | 97 | * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel |
| 99 | * is not permitted. | 98 | * is not permitted. |
| @@ -113,8 +112,8 @@ enum ieee80211_band { | |||
| 113 | */ | 112 | */ |
| 114 | enum ieee80211_channel_flags { | 113 | enum ieee80211_channel_flags { |
| 115 | IEEE80211_CHAN_DISABLED = 1<<0, | 114 | IEEE80211_CHAN_DISABLED = 1<<0, |
| 116 | IEEE80211_CHAN_PASSIVE_SCAN = 1<<1, | 115 | IEEE80211_CHAN_NO_IR = 1<<1, |
| 117 | IEEE80211_CHAN_NO_IBSS = 1<<2, | 116 | /* hole at 1<<2 */ |
| 118 | IEEE80211_CHAN_RADAR = 1<<3, | 117 | IEEE80211_CHAN_RADAR = 1<<3, |
| 119 | IEEE80211_CHAN_NO_HT40PLUS = 1<<4, | 118 | IEEE80211_CHAN_NO_HT40PLUS = 1<<4, |
| 120 | IEEE80211_CHAN_NO_HT40MINUS = 1<<5, | 119 | IEEE80211_CHAN_NO_HT40MINUS = 1<<5, |
| @@ -748,6 +747,8 @@ enum station_parameters_apply_mask { | |||
| 748 | * @supported_channels_len: number of supported channels | 747 | * @supported_channels_len: number of supported channels |
| 749 | * @supported_oper_classes: supported oper classes in IEEE 802.11 format | 748 | * @supported_oper_classes: supported oper classes in IEEE 802.11 format |
| 750 | * @supported_oper_classes_len: number of supported operating classes | 749 | * @supported_oper_classes_len: number of supported operating classes |
| 750 | * @opmode_notif: operating mode field from Operating Mode Notification | ||
| 751 | * @opmode_notif_used: information if operating mode field is used | ||
| 751 | */ | 752 | */ |
| 752 | struct station_parameters { | 753 | struct station_parameters { |
| 753 | const u8 *supported_rates; | 754 | const u8 *supported_rates; |
| @@ -771,6 +772,8 @@ struct station_parameters { | |||
| 771 | u8 supported_channels_len; | 772 | u8 supported_channels_len; |
| 772 | const u8 *supported_oper_classes; | 773 | const u8 *supported_oper_classes; |
| 773 | u8 supported_oper_classes_len; | 774 | u8 supported_oper_classes_len; |
| 775 | u8 opmode_notif; | ||
| 776 | bool opmode_notif_used; | ||
| 774 | }; | 777 | }; |
| 775 | 778 | ||
| 776 | /** | 779 | /** |
| @@ -1763,7 +1766,8 @@ enum wiphy_params_flags { | |||
| 1763 | struct cfg80211_bitrate_mask { | 1766 | struct cfg80211_bitrate_mask { |
| 1764 | struct { | 1767 | struct { |
| 1765 | u32 legacy; | 1768 | u32 legacy; |
| 1766 | u8 mcs[IEEE80211_HT_MCS_MASK_LEN]; | 1769 | u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN]; |
| 1770 | u16 vht_mcs[NL80211_VHT_NSS_MAX]; | ||
| 1767 | } control[IEEE80211_NUM_BANDS]; | 1771 | } control[IEEE80211_NUM_BANDS]; |
| 1768 | }; | 1772 | }; |
| 1769 | /** | 1773 | /** |
| @@ -1945,6 +1949,73 @@ struct cfg80211_update_ft_ies_params { | |||
| 1945 | }; | 1949 | }; |
| 1946 | 1950 | ||
| 1947 | /** | 1951 | /** |
| 1952 | * struct cfg80211_mgmt_tx_params - mgmt tx parameters | ||
| 1953 | * | ||
| 1954 | * This structure provides information needed to transmit a mgmt frame | ||
| 1955 | * | ||
| 1956 | * @chan: channel to use | ||
| 1957 | * @offchan: indicates wether off channel operation is required | ||
| 1958 | * @wait: duration for ROC | ||
| 1959 | * @buf: buffer to transmit | ||
| 1960 | * @len: buffer length | ||
| 1961 | * @no_cck: don't use cck rates for this frame | ||
| 1962 | * @dont_wait_for_ack: tells the low level not to wait for an ack | ||
| 1963 | */ | ||
| 1964 | struct cfg80211_mgmt_tx_params { | ||
| 1965 | struct ieee80211_channel *chan; | ||
| 1966 | bool offchan; | ||
| 1967 | unsigned int wait; | ||
| 1968 | const u8 *buf; | ||
| 1969 | size_t len; | ||
| 1970 | bool no_cck; | ||
| 1971 | bool dont_wait_for_ack; | ||
| 1972 | }; | ||
| 1973 | |||
| 1974 | /** | ||
| 1975 | * struct cfg80211_dscp_exception - DSCP exception | ||
| 1976 | * | ||
| 1977 | * @dscp: DSCP value that does not adhere to the user priority range definition | ||
| 1978 | * @up: user priority value to which the corresponding DSCP value belongs | ||
| 1979 | */ | ||
| 1980 | struct cfg80211_dscp_exception { | ||
| 1981 | u8 dscp; | ||
| 1982 | u8 up; | ||
| 1983 | }; | ||
| 1984 | |||
| 1985 | /** | ||
| 1986 | * struct cfg80211_dscp_range - DSCP range definition for user priority | ||
| 1987 | * | ||
| 1988 | * @low: lowest DSCP value of this user priority range, inclusive | ||
| 1989 | * @high: highest DSCP value of this user priority range, inclusive | ||
| 1990 | */ | ||
| 1991 | struct cfg80211_dscp_range { | ||
| 1992 | u8 low; | ||
| 1993 | u8 high; | ||
| 1994 | }; | ||
| 1995 | |||
| 1996 | /* QoS Map Set element length defined in IEEE Std 802.11-2012, 8.4.2.97 */ | ||
| 1997 | #define IEEE80211_QOS_MAP_MAX_EX 21 | ||
| 1998 | #define IEEE80211_QOS_MAP_LEN_MIN 16 | ||
| 1999 | #define IEEE80211_QOS_MAP_LEN_MAX \ | ||
| 2000 | (IEEE80211_QOS_MAP_LEN_MIN + 2 * IEEE80211_QOS_MAP_MAX_EX) | ||
| 2001 | |||
| 2002 | /** | ||
| 2003 | * struct cfg80211_qos_map - QoS Map Information | ||
| 2004 | * | ||
| 2005 | * This struct defines the Interworking QoS map setting for DSCP values | ||
| 2006 | * | ||
| 2007 | * @num_des: number of DSCP exceptions (0..21) | ||
| 2008 | * @dscp_exception: optionally up to maximum of 21 DSCP exceptions from | ||
| 2009 | * the user priority DSCP range definition | ||
| 2010 | * @up: DSCP range definition for a particular user priority | ||
| 2011 | */ | ||
| 2012 | struct cfg80211_qos_map { | ||
| 2013 | u8 num_des; | ||
| 2014 | struct cfg80211_dscp_exception dscp_exception[IEEE80211_QOS_MAP_MAX_EX]; | ||
| 2015 | struct cfg80211_dscp_range up[8]; | ||
| 2016 | }; | ||
| 2017 | |||
| 2018 | /** | ||
| 1948 | * struct cfg80211_ops - backend description for wireless configuration | 2019 | * struct cfg80211_ops - backend description for wireless configuration |
| 1949 | * | 2020 | * |
| 1950 | * This struct is registered by fullmac card drivers and/or wireless stacks | 2021 | * This struct is registered by fullmac card drivers and/or wireless stacks |
| @@ -2186,6 +2257,8 @@ struct cfg80211_update_ft_ies_params { | |||
| 2186 | * @set_coalesce: Set coalesce parameters. | 2257 | * @set_coalesce: Set coalesce parameters. |
| 2187 | * | 2258 | * |
| 2188 | * @channel_switch: initiate channel-switch procedure (with CSA) | 2259 | * @channel_switch: initiate channel-switch procedure (with CSA) |
| 2260 | * | ||
| 2261 | * @set_qos_map: Set QoS mapping information to the driver | ||
| 2189 | */ | 2262 | */ |
| 2190 | struct cfg80211_ops { | 2263 | struct cfg80211_ops { |
| 2191 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); | 2264 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); |
| @@ -2342,9 +2415,8 @@ struct cfg80211_ops { | |||
| 2342 | u64 cookie); | 2415 | u64 cookie); |
| 2343 | 2416 | ||
| 2344 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, | 2417 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, |
| 2345 | struct ieee80211_channel *chan, bool offchan, | 2418 | struct cfg80211_mgmt_tx_params *params, |
| 2346 | unsigned int wait, const u8 *buf, size_t len, | 2419 | u64 *cookie); |
| 2347 | bool no_cck, bool dont_wait_for_ack, u64 *cookie); | ||
| 2348 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | 2420 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, |
| 2349 | struct wireless_dev *wdev, | 2421 | struct wireless_dev *wdev, |
| 2350 | u64 cookie); | 2422 | u64 cookie); |
| @@ -2428,6 +2500,9 @@ struct cfg80211_ops { | |||
| 2428 | int (*channel_switch)(struct wiphy *wiphy, | 2500 | int (*channel_switch)(struct wiphy *wiphy, |
| 2429 | struct net_device *dev, | 2501 | struct net_device *dev, |
| 2430 | struct cfg80211_csa_settings *params); | 2502 | struct cfg80211_csa_settings *params); |
| 2503 | int (*set_qos_map)(struct wiphy *wiphy, | ||
| 2504 | struct net_device *dev, | ||
| 2505 | struct cfg80211_qos_map *qos_map); | ||
| 2431 | }; | 2506 | }; |
| 2432 | 2507 | ||
| 2433 | /* | 2508 | /* |
| @@ -2438,27 +2513,6 @@ struct cfg80211_ops { | |||
| 2438 | /** | 2513 | /** |
| 2439 | * enum wiphy_flags - wiphy capability flags | 2514 | * enum wiphy_flags - wiphy capability flags |
| 2440 | * | 2515 | * |
| 2441 | * @WIPHY_FLAG_CUSTOM_REGULATORY: tells us the driver for this device | ||
| 2442 | * has its own custom regulatory domain and cannot identify the | ||
| 2443 | * ISO / IEC 3166 alpha2 it belongs to. When this is enabled | ||
| 2444 | * we will disregard the first regulatory hint (when the | ||
| 2445 | * initiator is %REGDOM_SET_BY_CORE). | ||
| 2446 | * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will | ||
| 2447 | * ignore regulatory domain settings until it gets its own regulatory | ||
| 2448 | * domain via its regulatory_hint() unless the regulatory hint is | ||
| 2449 | * from a country IE. After its gets its own regulatory domain it will | ||
| 2450 | * only allow further regulatory domain settings to further enhance | ||
| 2451 | * compliance. For example if channel 13 and 14 are disabled by this | ||
| 2452 | * regulatory domain no user regulatory domain can enable these channels | ||
| 2453 | * at a later time. This can be used for devices which do not have | ||
| 2454 | * calibration information guaranteed for frequencies or settings | ||
| 2455 | * outside of its regulatory domain. If used in combination with | ||
| 2456 | * WIPHY_FLAG_CUSTOM_REGULATORY the inspected country IE power settings | ||
| 2457 | * will be followed. | ||
| 2458 | * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure | ||
| 2459 | * that passive scan flags and beaconing flags may not be lifted by | ||
| 2460 | * cfg80211 due to regulatory beacon hints. For more information on beacon | ||
| 2461 | * hints read the documenation for regulatory_hint_found_beacon() | ||
| 2462 | * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this | 2516 | * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this |
| 2463 | * wiphy at all | 2517 | * wiphy at all |
| 2464 | * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled | 2518 | * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled |
| @@ -2497,9 +2551,9 @@ struct cfg80211_ops { | |||
| 2497 | * beaconing mode (AP, IBSS, Mesh, ...). | 2551 | * beaconing mode (AP, IBSS, Mesh, ...). |
| 2498 | */ | 2552 | */ |
| 2499 | enum wiphy_flags { | 2553 | enum wiphy_flags { |
| 2500 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), | 2554 | /* use hole at 0 */ |
| 2501 | WIPHY_FLAG_STRICT_REGULATORY = BIT(1), | 2555 | /* use hole at 1 */ |
| 2502 | WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), | 2556 | /* use hole at 2 */ |
| 2503 | WIPHY_FLAG_NETNS_OK = BIT(3), | 2557 | WIPHY_FLAG_NETNS_OK = BIT(3), |
| 2504 | WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), | 2558 | WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), |
| 2505 | WIPHY_FLAG_4ADDR_AP = BIT(5), | 2559 | WIPHY_FLAG_4ADDR_AP = BIT(5), |
| @@ -2676,6 +2730,34 @@ struct wiphy_coalesce_support { | |||
| 2676 | }; | 2730 | }; |
| 2677 | 2731 | ||
| 2678 | /** | 2732 | /** |
| 2733 | * enum wiphy_vendor_command_flags - validation flags for vendor commands | ||
| 2734 | * @WIPHY_VENDOR_CMD_NEED_WDEV: vendor command requires wdev | ||
| 2735 | * @WIPHY_VENDOR_CMD_NEED_NETDEV: vendor command requires netdev | ||
| 2736 | * @WIPHY_VENDOR_CMD_NEED_RUNNING: interface/wdev must be up & running | ||
| 2737 | * (must be combined with %_WDEV or %_NETDEV) | ||
| 2738 | */ | ||
| 2739 | enum wiphy_vendor_command_flags { | ||
| 2740 | WIPHY_VENDOR_CMD_NEED_WDEV = BIT(0), | ||
| 2741 | WIPHY_VENDOR_CMD_NEED_NETDEV = BIT(1), | ||
| 2742 | WIPHY_VENDOR_CMD_NEED_RUNNING = BIT(2), | ||
| 2743 | }; | ||
| 2744 | |||
| 2745 | /** | ||
| 2746 | * struct wiphy_vendor_command - vendor command definition | ||
| 2747 | * @info: vendor command identifying information, as used in nl80211 | ||
| 2748 | * @flags: flags, see &enum wiphy_vendor_command_flags | ||
| 2749 | * @doit: callback for the operation, note that wdev is %NULL if the | ||
| 2750 | * flags didn't ask for a wdev and non-%NULL otherwise; the data | ||
| 2751 | * pointer may be %NULL if userspace provided no data at all | ||
| 2752 | */ | ||
| 2753 | struct wiphy_vendor_command { | ||
| 2754 | struct nl80211_vendor_cmd_info info; | ||
| 2755 | u32 flags; | ||
| 2756 | int (*doit)(struct wiphy *wiphy, struct wireless_dev *wdev, | ||
| 2757 | const void *data, int data_len); | ||
| 2758 | }; | ||
| 2759 | |||
| 2760 | /** | ||
| 2679 | * struct wiphy - wireless hardware description | 2761 | * struct wiphy - wireless hardware description |
| 2680 | * @reg_notifier: the driver's regulatory notification callback, | 2762 | * @reg_notifier: the driver's regulatory notification callback, |
| 2681 | * note that if your driver uses wiphy_apply_custom_regulatory() | 2763 | * note that if your driver uses wiphy_apply_custom_regulatory() |
| @@ -2721,6 +2803,8 @@ struct wiphy_coalesce_support { | |||
| 2721 | * @software_iftypes: bitmask of software interface types, these are not | 2803 | * @software_iftypes: bitmask of software interface types, these are not |
| 2722 | * subject to any restrictions since they are purely managed in SW. | 2804 | * subject to any restrictions since they are purely managed in SW. |
| 2723 | * @flags: wiphy flags, see &enum wiphy_flags | 2805 | * @flags: wiphy flags, see &enum wiphy_flags |
| 2806 | * @regulatory_flags: wiphy regulatory flags, see | ||
| 2807 | * &enum ieee80211_regulatory_flags | ||
| 2724 | * @features: features advertised to nl80211, see &enum nl80211_feature_flags. | 2808 | * @features: features advertised to nl80211, see &enum nl80211_feature_flags. |
| 2725 | * @bss_priv_size: each BSS struct has private data allocated with it, | 2809 | * @bss_priv_size: each BSS struct has private data allocated with it, |
| 2726 | * this variable determines its size | 2810 | * this variable determines its size |
| @@ -2786,6 +2870,11 @@ struct wiphy_coalesce_support { | |||
| 2786 | * @extended_capabilities_mask: mask of the valid values | 2870 | * @extended_capabilities_mask: mask of the valid values |
| 2787 | * @extended_capabilities_len: length of the extended capabilities | 2871 | * @extended_capabilities_len: length of the extended capabilities |
| 2788 | * @coalesce: packet coalescing support information | 2872 | * @coalesce: packet coalescing support information |
| 2873 | * | ||
| 2874 | * @vendor_commands: array of vendor commands supported by the hardware | ||
| 2875 | * @n_vendor_commands: number of vendor commands | ||
| 2876 | * @vendor_events: array of vendor events supported by the hardware | ||
| 2877 | * @n_vendor_events: number of vendor events | ||
| 2789 | */ | 2878 | */ |
| 2790 | struct wiphy { | 2879 | struct wiphy { |
| 2791 | /* assign these fields before you register the wiphy */ | 2880 | /* assign these fields before you register the wiphy */ |
| @@ -2809,7 +2898,7 @@ struct wiphy { | |||
| 2809 | 2898 | ||
| 2810 | u16 max_acl_mac_addrs; | 2899 | u16 max_acl_mac_addrs; |
| 2811 | 2900 | ||
| 2812 | u32 flags, features; | 2901 | u32 flags, regulatory_flags, features; |
| 2813 | 2902 | ||
| 2814 | u32 ap_sme_capa; | 2903 | u32 ap_sme_capa; |
| 2815 | 2904 | ||
| @@ -2897,6 +2986,10 @@ struct wiphy { | |||
| 2897 | 2986 | ||
| 2898 | const struct wiphy_coalesce_support *coalesce; | 2987 | const struct wiphy_coalesce_support *coalesce; |
| 2899 | 2988 | ||
| 2989 | const struct wiphy_vendor_command *vendor_commands; | ||
| 2990 | const struct nl80211_vendor_cmd_info *vendor_events; | ||
| 2991 | int n_vendor_commands, n_vendor_events; | ||
| 2992 | |||
| 2900 | char priv[0] __aligned(NETDEV_ALIGN); | 2993 | char priv[0] __aligned(NETDEV_ALIGN); |
| 2901 | }; | 2994 | }; |
| 2902 | 2995 | ||
| @@ -3388,9 +3481,11 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list, | |||
| 3388 | /** | 3481 | /** |
| 3389 | * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame | 3482 | * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame |
| 3390 | * @skb: the data frame | 3483 | * @skb: the data frame |
| 3484 | * @qos_map: Interworking QoS mapping or %NULL if not in use | ||
| 3391 | * Return: The 802.1p/1d tag. | 3485 | * Return: The 802.1p/1d tag. |
| 3392 | */ | 3486 | */ |
| 3393 | unsigned int cfg80211_classify8021d(struct sk_buff *skb); | 3487 | unsigned int cfg80211_classify8021d(struct sk_buff *skb, |
| 3488 | struct cfg80211_qos_map *qos_map); | ||
| 3394 | 3489 | ||
| 3395 | /** | 3490 | /** |
| 3396 | * cfg80211_find_ie - find information element in data | 3491 | * cfg80211_find_ie - find information element in data |
| @@ -3472,6 +3567,9 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2); | |||
| 3472 | * custom regulatory domain will be trusted completely and as such previous | 3567 | * custom regulatory domain will be trusted completely and as such previous |
| 3473 | * default channel settings will be disregarded. If no rule is found for a | 3568 | * default channel settings will be disregarded. If no rule is found for a |
| 3474 | * channel on the regulatory domain the channel will be disabled. | 3569 | * channel on the regulatory domain the channel will be disabled. |
| 3570 | * Drivers using this for a wiphy should also set the wiphy flag | ||
| 3571 | * WIPHY_FLAG_CUSTOM_REGULATORY or cfg80211 will set it for the wiphy | ||
| 3572 | * that called this helper. | ||
| 3475 | */ | 3573 | */ |
| 3476 | void wiphy_apply_custom_regulatory(struct wiphy *wiphy, | 3574 | void wiphy_apply_custom_regulatory(struct wiphy *wiphy, |
| 3477 | const struct ieee80211_regdomain *regd); | 3575 | const struct ieee80211_regdomain *regd); |
| @@ -3838,6 +3936,121 @@ void wiphy_rfkill_start_polling(struct wiphy *wiphy); | |||
| 3838 | */ | 3936 | */ |
| 3839 | void wiphy_rfkill_stop_polling(struct wiphy *wiphy); | 3937 | void wiphy_rfkill_stop_polling(struct wiphy *wiphy); |
| 3840 | 3938 | ||
| 3939 | /** | ||
| 3940 | * DOC: Vendor commands | ||
| 3941 | * | ||
| 3942 | * Occasionally, there are special protocol or firmware features that | ||
| 3943 | * can't be implemented very openly. For this and similar cases, the | ||
| 3944 | * vendor command functionality allows implementing the features with | ||
| 3945 | * (typically closed-source) userspace and firmware, using nl80211 as | ||
| 3946 | * the configuration mechanism. | ||
| 3947 | * | ||
| 3948 | * A driver supporting vendor commands must register them as an array | ||
| 3949 | * in struct wiphy, with handlers for each one, each command has an | ||
| 3950 | * OUI and sub command ID to identify it. | ||
| 3951 | * | ||
| 3952 | * Note that this feature should not be (ab)used to implement protocol | ||
| 3953 | * features that could openly be shared across drivers. In particular, | ||
| 3954 | * it must never be required to use vendor commands to implement any | ||
| 3955 | * "normal" functionality that higher-level userspace like connection | ||
| 3956 | * managers etc. need. | ||
| 3957 | */ | ||
| 3958 | |||
| 3959 | struct sk_buff *__cfg80211_alloc_reply_skb(struct wiphy *wiphy, | ||
| 3960 | enum nl80211_commands cmd, | ||
| 3961 | enum nl80211_attrs attr, | ||
| 3962 | int approxlen); | ||
| 3963 | |||
| 3964 | struct sk_buff *__cfg80211_alloc_event_skb(struct wiphy *wiphy, | ||
| 3965 | enum nl80211_commands cmd, | ||
| 3966 | enum nl80211_attrs attr, | ||
| 3967 | int vendor_event_idx, | ||
| 3968 | int approxlen, gfp_t gfp); | ||
| 3969 | |||
| 3970 | void __cfg80211_send_event_skb(struct sk_buff *skb, gfp_t gfp); | ||
| 3971 | |||
| 3972 | /** | ||
| 3973 | * cfg80211_vendor_cmd_alloc_reply_skb - allocate vendor command reply | ||
| 3974 | * @wiphy: the wiphy | ||
| 3975 | * @approxlen: an upper bound of the length of the data that will | ||
| 3976 | * be put into the skb | ||
| 3977 | * | ||
| 3978 | * This function allocates and pre-fills an skb for a reply to | ||
| 3979 | * a vendor command. Since it is intended for a reply, calling | ||
| 3980 | * it outside of a vendor command's doit() operation is invalid. | ||
| 3981 | * | ||
| 3982 | * The returned skb is pre-filled with some identifying data in | ||
| 3983 | * a way that any data that is put into the skb (with skb_put(), | ||
| 3984 | * nla_put() or similar) will end up being within the | ||
| 3985 | * %NL80211_ATTR_VENDOR_DATA attribute, so all that needs to be done | ||
| 3986 | * with the skb is adding data for the corresponding userspace tool | ||
| 3987 | * which can then read that data out of the vendor data attribute. | ||
| 3988 | * You must not modify the skb in any other way. | ||
| 3989 | * | ||
| 3990 | * When done, call cfg80211_vendor_cmd_reply() with the skb and return | ||
| 3991 | * its error code as the result of the doit() operation. | ||
| 3992 | * | ||
| 3993 | * Return: An allocated and pre-filled skb. %NULL if any errors happen. | ||
| 3994 | */ | ||
| 3995 | static inline struct sk_buff * | ||
| 3996 | cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, int approxlen) | ||
| 3997 | { | ||
| 3998 | return __cfg80211_alloc_reply_skb(wiphy, NL80211_CMD_VENDOR, | ||
| 3999 | NL80211_ATTR_VENDOR_DATA, approxlen); | ||
| 4000 | } | ||
| 4001 | |||
| 4002 | /** | ||
| 4003 | * cfg80211_vendor_cmd_reply - send the reply skb | ||
| 4004 | * @skb: The skb, must have been allocated with | ||
| 4005 | * cfg80211_vendor_cmd_alloc_reply_skb() | ||
| 4006 | * | ||
| 4007 | * Since calling this function will usually be the last thing | ||
| 4008 | * before returning from the vendor command doit() you should | ||
| 4009 | * return the error code. Note that this function consumes the | ||
| 4010 | * skb regardless of the return value. | ||
| 4011 | * | ||
| 4012 | * Return: An error code or 0 on success. | ||
| 4013 | */ | ||
| 4014 | int cfg80211_vendor_cmd_reply(struct sk_buff *skb); | ||
| 4015 | |||
| 4016 | /** | ||
| 4017 | * cfg80211_vendor_event_alloc - allocate vendor-specific event skb | ||
| 4018 | * @wiphy: the wiphy | ||
| 4019 | * @event_idx: index of the vendor event in the wiphy's vendor_events | ||
| 4020 | * @approxlen: an upper bound of the length of the data that will | ||
| 4021 | * be put into the skb | ||
| 4022 | * @gfp: allocation flags | ||
| 4023 | * | ||
| 4024 | * This function allocates and pre-fills an skb for an event on the | ||
| 4025 | * vendor-specific multicast group. | ||
| 4026 | * | ||
| 4027 | * When done filling the skb, call cfg80211_vendor_event() with the | ||
| 4028 | * skb to send the event. | ||
| 4029 | * | ||
| 4030 | * Return: An allocated and pre-filled skb. %NULL if any errors happen. | ||
| 4031 | */ | ||
| 4032 | static inline struct sk_buff * | ||
| 4033 | cfg80211_vendor_event_alloc(struct wiphy *wiphy, int approxlen, | ||
| 4034 | int event_idx, gfp_t gfp) | ||
| 4035 | { | ||
| 4036 | return __cfg80211_alloc_event_skb(wiphy, NL80211_CMD_VENDOR, | ||
| 4037 | NL80211_ATTR_VENDOR_DATA, | ||
| 4038 | event_idx, approxlen, gfp); | ||
| 4039 | } | ||
| 4040 | |||
| 4041 | /** | ||
| 4042 | * cfg80211_vendor_event - send the event | ||
| 4043 | * @skb: The skb, must have been allocated with cfg80211_vendor_event_alloc() | ||
| 4044 | * @gfp: allocation flags | ||
| 4045 | * | ||
| 4046 | * This function sends the given @skb, which must have been allocated | ||
| 4047 | * by cfg80211_vendor_event_alloc(), as an event. It always consumes it. | ||
| 4048 | */ | ||
| 4049 | static inline void cfg80211_vendor_event(struct sk_buff *skb, gfp_t gfp) | ||
| 4050 | { | ||
| 4051 | __cfg80211_send_event_skb(skb, gfp); | ||
| 4052 | } | ||
| 4053 | |||
| 3841 | #ifdef CONFIG_NL80211_TESTMODE | 4054 | #ifdef CONFIG_NL80211_TESTMODE |
| 3842 | /** | 4055 | /** |
| 3843 | * DOC: Test mode | 4056 | * DOC: Test mode |
| @@ -3873,8 +4086,12 @@ void wiphy_rfkill_stop_polling(struct wiphy *wiphy); | |||
| 3873 | * | 4086 | * |
| 3874 | * Return: An allocated and pre-filled skb. %NULL if any errors happen. | 4087 | * Return: An allocated and pre-filled skb. %NULL if any errors happen. |
| 3875 | */ | 4088 | */ |
| 3876 | struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, | 4089 | static inline struct sk_buff * |
| 3877 | int approxlen); | 4090 | cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, int approxlen) |
| 4091 | { | ||
| 4092 | return __cfg80211_alloc_reply_skb(wiphy, NL80211_CMD_TESTMODE, | ||
| 4093 | NL80211_ATTR_TESTDATA, approxlen); | ||
| 4094 | } | ||
| 3878 | 4095 | ||
| 3879 | /** | 4096 | /** |
| 3880 | * cfg80211_testmode_reply - send the reply skb | 4097 | * cfg80211_testmode_reply - send the reply skb |
| @@ -3888,7 +4105,10 @@ struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, | |||
| 3888 | * | 4105 | * |
| 3889 | * Return: An error code or 0 on success. | 4106 | * Return: An error code or 0 on success. |
| 3890 | */ | 4107 | */ |
| 3891 | int cfg80211_testmode_reply(struct sk_buff *skb); | 4108 | static inline int cfg80211_testmode_reply(struct sk_buff *skb) |
| 4109 | { | ||
| 4110 | return cfg80211_vendor_cmd_reply(skb); | ||
| 4111 | } | ||
| 3892 | 4112 | ||
| 3893 | /** | 4113 | /** |
| 3894 | * cfg80211_testmode_alloc_event_skb - allocate testmode event | 4114 | * cfg80211_testmode_alloc_event_skb - allocate testmode event |
| @@ -3911,8 +4131,13 @@ int cfg80211_testmode_reply(struct sk_buff *skb); | |||
| 3911 | * | 4131 | * |
| 3912 | * Return: An allocated and pre-filled skb. %NULL if any errors happen. | 4132 | * Return: An allocated and pre-filled skb. %NULL if any errors happen. |
| 3913 | */ | 4133 | */ |
| 3914 | struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, | 4134 | static inline struct sk_buff * |
| 3915 | int approxlen, gfp_t gfp); | 4135 | cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, int approxlen, gfp_t gfp) |
| 4136 | { | ||
| 4137 | return __cfg80211_alloc_event_skb(wiphy, NL80211_CMD_TESTMODE, | ||
| 4138 | NL80211_ATTR_TESTDATA, -1, | ||
| 4139 | approxlen, gfp); | ||
| 4140 | } | ||
| 3916 | 4141 | ||
| 3917 | /** | 4142 | /** |
| 3918 | * cfg80211_testmode_event - send the event | 4143 | * cfg80211_testmode_event - send the event |
| @@ -3924,7 +4149,10 @@ struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, | |||
| 3924 | * by cfg80211_testmode_alloc_event_skb(), as an event. It always | 4149 | * by cfg80211_testmode_alloc_event_skb(), as an event. It always |
| 3925 | * consumes it. | 4150 | * consumes it. |
| 3926 | */ | 4151 | */ |
| 3927 | void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp); | 4152 | static inline void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp) |
| 4153 | { | ||
| 4154 | __cfg80211_send_event_skb(skb, gfp); | ||
| 4155 | } | ||
| 3928 | 4156 | ||
| 3929 | #define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd), | 4157 | #define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd), |
| 3930 | #define CFG80211_TESTMODE_DUMP(cmd) .testmode_dump = (cmd), | 4158 | #define CFG80211_TESTMODE_DUMP(cmd) .testmode_dump = (cmd), |
| @@ -4146,6 +4374,7 @@ void cfg80211_radar_event(struct wiphy *wiphy, | |||
| 4146 | /** | 4374 | /** |
| 4147 | * cfg80211_cac_event - Channel availability check (CAC) event | 4375 | * cfg80211_cac_event - Channel availability check (CAC) event |
| 4148 | * @netdev: network device | 4376 | * @netdev: network device |
| 4377 | * @chandef: chandef for the current channel | ||
| 4149 | * @event: type of event | 4378 | * @event: type of event |
| 4150 | * @gfp: context flags | 4379 | * @gfp: context flags |
| 4151 | * | 4380 | * |
| @@ -4154,6 +4383,7 @@ void cfg80211_radar_event(struct wiphy *wiphy, | |||
| 4154 | * also by full-MAC drivers. | 4383 | * also by full-MAC drivers. |
| 4155 | */ | 4384 | */ |
| 4156 | void cfg80211_cac_event(struct net_device *netdev, | 4385 | void cfg80211_cac_event(struct net_device *netdev, |
| 4386 | const struct cfg80211_chan_def *chandef, | ||
| 4157 | enum nl80211_radar_event event, gfp_t gfp); | 4387 | enum nl80211_radar_event event, gfp_t gfp); |
| 4158 | 4388 | ||
| 4159 | 4389 | ||
| @@ -4279,7 +4509,8 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy, | |||
| 4279 | * @dev: the device which switched channels | 4509 | * @dev: the device which switched channels |
| 4280 | * @chandef: the new channel definition | 4510 | * @chandef: the new channel definition |
| 4281 | * | 4511 | * |
| 4282 | * Acquires wdev_lock, so must only be called from sleepable driver context! | 4512 | * Caller must acquire wdev_lock, therefore must only be called from sleepable |
| 4513 | * driver context! | ||
| 4283 | */ | 4514 | */ |
| 4284 | void cfg80211_ch_switch_notify(struct net_device *dev, | 4515 | void cfg80211_ch_switch_notify(struct net_device *dev, |
| 4285 | struct cfg80211_chan_def *chandef); | 4516 | struct cfg80211_chan_def *chandef); |
| @@ -4409,6 +4640,14 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, | |||
| 4409 | */ | 4640 | */ |
| 4410 | void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp); | 4641 | void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp); |
| 4411 | 4642 | ||
| 4643 | /** | ||
| 4644 | * ieee80211_get_num_supported_channels - get number of channels device has | ||
| 4645 | * @wiphy: the wiphy | ||
| 4646 | * | ||
| 4647 | * Return: the number of channels supported by the device. | ||
| 4648 | */ | ||
| 4649 | unsigned int ieee80211_get_num_supported_channels(struct wiphy *wiphy); | ||
| 4650 | |||
| 4412 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 4651 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
| 4413 | 4652 | ||
| 4414 | /* wiphy_printk helpers, similar to dev_printk */ | 4653 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h index a8c2ef6d3b93..a6fd939f202d 100644 --- a/include/net/cipso_ipv4.h +++ b/include/net/cipso_ipv4.h | |||
| @@ -26,8 +26,7 @@ | |||
| 26 | * the GNU General Public License for more details. | 26 | * the GNU General Public License for more details. |
| 27 | * | 27 | * |
| 28 | * You should have received a copy of the GNU General Public License | 28 | * You should have received a copy of the GNU General Public License |
| 29 | * along with this program; if not, write to the Free Software | 29 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 30 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 31 | * | 30 | * |
| 32 | */ | 31 | */ |
| 33 | 32 | ||
| @@ -304,7 +303,7 @@ static inline int cipso_v4_validate(const struct sk_buff *skb, | |||
| 304 | 303 | ||
| 305 | for (opt_iter = 6; opt_iter < opt_len;) { | 304 | for (opt_iter = 6; opt_iter < opt_len;) { |
| 306 | tag_len = opt[opt_iter + 1]; | 305 | tag_len = opt[opt_iter + 1]; |
| 307 | if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))) { | 306 | if ((tag_len == 0) || (tag_len > (opt_len - opt_iter))) { |
| 308 | err_offset = opt_iter + 1; | 307 | err_offset = opt_iter + 1; |
| 309 | goto out; | 308 | goto out; |
| 310 | } | 309 | } |
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h index 33d03b648646..9cf2d5ef38d9 100644 --- a/include/net/cls_cgroup.h +++ b/include/net/cls_cgroup.h | |||
| @@ -16,17 +16,16 @@ | |||
| 16 | #include <linux/cgroup.h> | 16 | #include <linux/cgroup.h> |
| 17 | #include <linux/hardirq.h> | 17 | #include <linux/hardirq.h> |
| 18 | #include <linux/rcupdate.h> | 18 | #include <linux/rcupdate.h> |
| 19 | #include <net/sock.h> | ||
| 19 | 20 | ||
| 20 | #if IS_ENABLED(CONFIG_NET_CLS_CGROUP) | 21 | #ifdef CONFIG_CGROUP_NET_CLASSID |
| 21 | struct cgroup_cls_state | 22 | struct cgroup_cls_state { |
| 22 | { | ||
| 23 | struct cgroup_subsys_state css; | 23 | struct cgroup_subsys_state css; |
| 24 | u32 classid; | 24 | u32 classid; |
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | void sock_update_classid(struct sock *sk); | 27 | struct cgroup_cls_state *task_cls_state(struct task_struct *p); |
| 28 | 28 | ||
| 29 | #if IS_BUILTIN(CONFIG_NET_CLS_CGROUP) | ||
| 30 | static inline u32 task_cls_classid(struct task_struct *p) | 29 | static inline u32 task_cls_classid(struct task_struct *p) |
| 31 | { | 30 | { |
| 32 | u32 classid; | 31 | u32 classid; |
| @@ -41,33 +40,18 @@ static inline u32 task_cls_classid(struct task_struct *p) | |||
| 41 | 40 | ||
| 42 | return classid; | 41 | return classid; |
| 43 | } | 42 | } |
| 44 | #elif IS_MODULE(CONFIG_NET_CLS_CGROUP) | ||
| 45 | static inline u32 task_cls_classid(struct task_struct *p) | ||
| 46 | { | ||
| 47 | struct cgroup_subsys_state *css; | ||
| 48 | u32 classid = 0; | ||
| 49 | |||
| 50 | if (in_interrupt()) | ||
| 51 | return 0; | ||
| 52 | |||
| 53 | rcu_read_lock(); | ||
| 54 | css = task_css(p, net_cls_subsys_id); | ||
| 55 | if (css) | ||
| 56 | classid = container_of(css, | ||
| 57 | struct cgroup_cls_state, css)->classid; | ||
| 58 | rcu_read_unlock(); | ||
| 59 | 43 | ||
| 60 | return classid; | ||
| 61 | } | ||
| 62 | #endif | ||
| 63 | #else /* !CGROUP_NET_CLS_CGROUP */ | ||
| 64 | static inline void sock_update_classid(struct sock *sk) | 44 | static inline void sock_update_classid(struct sock *sk) |
| 65 | { | 45 | { |
| 66 | } | 46 | u32 classid; |
| 67 | 47 | ||
| 68 | static inline u32 task_cls_classid(struct task_struct *p) | 48 | classid = task_cls_classid(current); |
| 49 | if (classid != sk->sk_classid) | ||
| 50 | sk->sk_classid = classid; | ||
| 51 | } | ||
| 52 | #else /* !CONFIG_CGROUP_NET_CLASSID */ | ||
| 53 | static inline void sock_update_classid(struct sock *sk) | ||
| 69 | { | 54 | { |
| 70 | return 0; | ||
| 71 | } | 55 | } |
| 72 | #endif /* CGROUP_NET_CLS_CGROUP */ | 56 | #endif /* CONFIG_CGROUP_NET_CLASSID */ |
| 73 | #endif /* _NET_CLS_CGROUP_H */ | 57 | #endif /* _NET_CLS_CGROUP_H */ |
diff --git a/include/net/codel.h b/include/net/codel.h index 3b04ff5f6f8d..fe0eab32ce76 100644 --- a/include/net/codel.h +++ b/include/net/codel.h | |||
| @@ -46,7 +46,6 @@ | |||
| 46 | #include <linux/skbuff.h> | 46 | #include <linux/skbuff.h> |
| 47 | #include <net/pkt_sched.h> | 47 | #include <net/pkt_sched.h> |
| 48 | #include <net/inet_ecn.h> | 48 | #include <net/inet_ecn.h> |
| 49 | #include <linux/reciprocal_div.h> | ||
| 50 | 49 | ||
| 51 | /* Controlling Queue Delay (CoDel) algorithm | 50 | /* Controlling Queue Delay (CoDel) algorithm |
| 52 | * ========================================= | 51 | * ========================================= |
| @@ -211,10 +210,9 @@ static codel_time_t codel_control_law(codel_time_t t, | |||
| 211 | codel_time_t interval, | 210 | codel_time_t interval, |
| 212 | u32 rec_inv_sqrt) | 211 | u32 rec_inv_sqrt) |
| 213 | { | 212 | { |
| 214 | return t + reciprocal_divide(interval, rec_inv_sqrt << REC_INV_SQRT_SHIFT); | 213 | return t + reciprocal_scale(interval, rec_inv_sqrt << REC_INV_SQRT_SHIFT); |
| 215 | } | 214 | } |
| 216 | 215 | ||
| 217 | |||
| 218 | static bool codel_should_drop(const struct sk_buff *skb, | 216 | static bool codel_should_drop(const struct sk_buff *skb, |
| 219 | struct Qdisc *sch, | 217 | struct Qdisc *sch, |
| 220 | struct codel_vars *vars, | 218 | struct codel_vars *vars, |
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h index d2f3041c0dfa..aec07c8a660a 100644 --- a/include/net/dcbevent.h +++ b/include/net/dcbevent.h | |||
| @@ -11,8 +11,7 @@ | |||
| 11 | * more details. | 11 | * more details. |
| 12 | * | 12 | * |
| 13 | * You should have received a copy of the GNU General Public License along with | 13 | * You should have received a copy of the GNU General Public License along with |
| 14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 14 | * this program; if not, see <http://www.gnu.org/licenses/>. |
| 15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
| 16 | * | 15 | * |
| 17 | * Author: John Fastabend <john.r.fastabend@intel.com> | 16 | * Author: John Fastabend <john.r.fastabend@intel.com> |
| 18 | */ | 17 | */ |
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h index fc5d5dcebb00..a975edf21b22 100644 --- a/include/net/dcbnl.h +++ b/include/net/dcbnl.h | |||
| @@ -11,8 +11,7 @@ | |||
| 11 | * more details. | 11 | * more details. |
| 12 | * | 12 | * |
| 13 | * You should have received a copy of the GNU General Public License along with | 13 | * You should have received a copy of the GNU General Public License along with |
| 14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 14 | * this program; if not, see <http://www.gnu.org/licenses/>. |
| 15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
| 16 | * | 15 | * |
| 17 | * Author: Lucy Liu <lucy.liu@intel.com> | 16 | * Author: Lucy Liu <lucy.liu@intel.com> |
| 18 | */ | 17 | */ |
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h index 20b5ab06032d..197886cd7bdd 100644 --- a/include/net/dn_dev.h +++ b/include/net/dn_dev.h | |||
| @@ -9,7 +9,7 @@ struct dn_ifaddr { | |||
| 9 | struct dn_dev *ifa_dev; | 9 | struct dn_dev *ifa_dev; |
| 10 | __le16 ifa_local; | 10 | __le16 ifa_local; |
| 11 | __le16 ifa_address; | 11 | __le16 ifa_address; |
| 12 | __u8 ifa_flags; | 12 | __u32 ifa_flags; |
| 13 | __u8 ifa_scope; | 13 | __u8 ifa_scope; |
| 14 | char ifa_label[IFNAMSIZ]; | 14 | char ifa_label[IFNAMSIZ]; |
| 15 | struct rcu_head rcu; | 15 | struct rcu_head rcu; |
diff --git a/include/net/dst.h b/include/net/dst.h index 44995c13e941..77eb53fabfb0 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -322,12 +322,11 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev, | |||
| 322 | skb->dev = dev; | 322 | skb->dev = dev; |
| 323 | 323 | ||
| 324 | /* | 324 | /* |
| 325 | * Clear rxhash so that we can recalulate the hash for the | 325 | * Clear hash so that we can recalulate the hash for the |
| 326 | * encapsulated packet, unless we have already determine the hash | 326 | * encapsulated packet, unless we have already determine the hash |
| 327 | * over the L4 4-tuple. | 327 | * over the L4 4-tuple. |
| 328 | */ | 328 | */ |
| 329 | if (!skb->l4_rxhash) | 329 | skb_clear_hash_if_not_l4(skb); |
| 330 | skb->rxhash = 0; | ||
| 331 | skb_set_queue_mapping(skb, 0); | 330 | skb_set_queue_mapping(skb, 0); |
| 332 | skb_scrub_packet(skb, !net_eq(net, dev_net(dev))); | 331 | skb_scrub_packet(skb, !net_eq(net, dev_net(dev))); |
| 333 | } | 332 | } |
diff --git a/include/net/flow.h b/include/net/flow.h index 65ce471d2ab5..d23e7fa2042e 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
| @@ -20,8 +20,7 @@ struct flowi_common { | |||
| 20 | __u8 flowic_proto; | 20 | __u8 flowic_proto; |
| 21 | __u8 flowic_flags; | 21 | __u8 flowic_flags; |
| 22 | #define FLOWI_FLAG_ANYSRC 0x01 | 22 | #define FLOWI_FLAG_ANYSRC 0x01 |
| 23 | #define FLOWI_FLAG_CAN_SLEEP 0x02 | 23 | #define FLOWI_FLAG_KNOWN_NH 0x02 |
| 24 | #define FLOWI_FLAG_KNOWN_NH 0x04 | ||
| 25 | __u32 flowic_secid; | 24 | __u32 flowic_secid; |
| 26 | }; | 25 | }; |
| 27 | 26 | ||
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 1b177ed803b7..93695f0e22a5 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
| @@ -73,6 +73,7 @@ struct genl_family { | |||
| 73 | * @attrs: netlink attributes | 73 | * @attrs: netlink attributes |
| 74 | * @_net: network namespace | 74 | * @_net: network namespace |
| 75 | * @user_ptr: user pointers | 75 | * @user_ptr: user pointers |
| 76 | * @dst_sk: destination socket | ||
| 76 | */ | 77 | */ |
| 77 | struct genl_info { | 78 | struct genl_info { |
| 78 | u32 snd_seq; | 79 | u32 snd_seq; |
| @@ -85,6 +86,7 @@ struct genl_info { | |||
| 85 | struct net * _net; | 86 | struct net * _net; |
| 86 | #endif | 87 | #endif |
| 87 | void * user_ptr[2]; | 88 | void * user_ptr[2]; |
| 89 | struct sock * dst_sk; | ||
| 88 | }; | 90 | }; |
| 89 | 91 | ||
| 90 | static inline struct net *genl_info_net(struct genl_info *info) | 92 | static inline struct net *genl_info_net(struct genl_info *info) |
| @@ -177,6 +179,8 @@ void genl_notify(struct genl_family *family, | |||
| 177 | struct sk_buff *skb, struct net *net, u32 portid, | 179 | struct sk_buff *skb, struct net *net, u32 portid, |
| 178 | u32 group, struct nlmsghdr *nlh, gfp_t flags); | 180 | u32 group, struct nlmsghdr *nlh, gfp_t flags); |
| 179 | 181 | ||
| 182 | struct sk_buff *genlmsg_new_unicast(size_t payload, struct genl_info *info, | ||
| 183 | gfp_t flags); | ||
| 180 | void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, | 184 | void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, |
| 181 | struct genl_family *family, int flags, u8 cmd); | 185 | struct genl_family *family, int flags, u8 cmd); |
| 182 | 186 | ||
diff --git a/include/net/gre.h b/include/net/gre.h index dcd9ae3270d3..70046a0b0b89 100644 --- a/include/net/gre.h +++ b/include/net/gre.h | |||
| @@ -33,9 +33,6 @@ struct gre_cisco_protocol { | |||
| 33 | int gre_cisco_register(struct gre_cisco_protocol *proto); | 33 | int gre_cisco_register(struct gre_cisco_protocol *proto); |
| 34 | int gre_cisco_unregister(struct gre_cisco_protocol *proto); | 34 | int gre_cisco_unregister(struct gre_cisco_protocol *proto); |
| 35 | 35 | ||
| 36 | int gre_offload_init(void); | ||
| 37 | void gre_offload_exit(void); | ||
| 38 | |||
| 39 | void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi, | 36 | void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi, |
| 40 | int hdr_len); | 37 | int hdr_len); |
| 41 | 38 | ||
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index 76d54270f2e2..9650a3ffd2d2 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
| @@ -50,8 +50,8 @@ struct inet6_ifaddr { | |||
| 50 | 50 | ||
| 51 | int state; | 51 | int state; |
| 52 | 52 | ||
| 53 | __u32 flags; | ||
| 53 | __u8 dad_probes; | 54 | __u8 dad_probes; |
| 54 | __u8 flags; | ||
| 55 | 55 | ||
| 56 | __u16 scope; | 56 | __u16 scope; |
| 57 | 57 | ||
| @@ -165,7 +165,6 @@ struct inet6_dev { | |||
| 165 | struct net_device *dev; | 165 | struct net_device *dev; |
| 166 | 166 | ||
| 167 | struct list_head addr_list; | 167 | struct list_head addr_list; |
| 168 | int valid_ll_addr_cnt; | ||
| 169 | 168 | ||
| 170 | struct ifmcaddr6 *mc_list; | 169 | struct ifmcaddr6 *mc_list; |
| 171 | struct ifmcaddr6 *mc_tomb; | 170 | struct ifmcaddr6 *mc_tomb; |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 71c6e264e5b5..61474ea02152 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
| @@ -133,9 +133,9 @@ struct inet_timewait_sock { | |||
| 133 | /* And these are ours. */ | 133 | /* And these are ours. */ |
| 134 | unsigned int tw_ipv6only : 1, | 134 | unsigned int tw_ipv6only : 1, |
| 135 | tw_transparent : 1, | 135 | tw_transparent : 1, |
| 136 | tw_pad : 6, /* 6 bits hole */ | 136 | tw_flowlabel : 20, |
| 137 | tw_tos : 8, | 137 | tw_pad : 2, /* 2 bits hole */ |
| 138 | tw_pad2 : 16; /* 16 bits hole */ | 138 | tw_tos : 8; |
| 139 | kmemcheck_bitfield_end(flags); | 139 | kmemcheck_bitfield_end(flags); |
| 140 | u32 tw_ttd; | 140 | u32 tw_ttd; |
| 141 | struct inet_bind_bucket *tw_tb; | 141 | struct inet_bind_bucket *tw_tb; |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index f4e127af4e17..6efe73c79c52 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
| @@ -163,7 +163,6 @@ void inet_putpeer(struct inet_peer *p); | |||
| 163 | bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout); | 163 | bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout); |
| 164 | 164 | ||
| 165 | void inetpeer_invalidate_tree(struct inet_peer_base *); | 165 | void inetpeer_invalidate_tree(struct inet_peer_base *); |
| 166 | void inetpeer_invalidate_family(int family); | ||
| 167 | 166 | ||
| 168 | /* | 167 | /* |
| 169 | * temporary check to make sure we dont access rid, ip_id_count, tcp_ts, | 168 | * temporary check to make sure we dont access rid, ip_id_count, tcp_ts, |
diff --git a/include/net/ip.h b/include/net/ip.h index 217bc5bfc6c6..23be0fd37937 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
| @@ -63,6 +63,7 @@ struct ipcm_cookie { | |||
| 63 | }; | 63 | }; |
| 64 | 64 | ||
| 65 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) | 65 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) |
| 66 | #define PKTINFO_SKB_CB(skb) ((struct in_pktinfo *)((skb)->cb)) | ||
| 66 | 67 | ||
| 67 | struct ip_ra_chain { | 68 | struct ip_ra_chain { |
| 68 | struct ip_ra_chain __rcu *next; | 69 | struct ip_ra_chain __rcu *next; |
| @@ -90,7 +91,7 @@ struct packet_type; | |||
| 90 | struct rtable; | 91 | struct rtable; |
| 91 | struct sockaddr; | 92 | struct sockaddr; |
| 92 | 93 | ||
| 93 | int igmp_mc_proc_init(void); | 94 | int igmp_mc_init(void); |
| 94 | 95 | ||
| 95 | /* | 96 | /* |
| 96 | * Functions provided by ip.c | 97 | * Functions provided by ip.c |
| @@ -177,12 +178,6 @@ void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr, | |||
| 177 | __be32 saddr, const struct ip_reply_arg *arg, | 178 | __be32 saddr, const struct ip_reply_arg *arg, |
| 178 | unsigned int len); | 179 | unsigned int len); |
| 179 | 180 | ||
| 180 | struct ipv4_config { | ||
| 181 | int log_martians; | ||
| 182 | int no_pmtu_disc; | ||
| 183 | }; | ||
| 184 | |||
| 185 | extern struct ipv4_config ipv4_config; | ||
| 186 | #define IP_INC_STATS(net, field) SNMP_INC_STATS64((net)->mib.ip_statistics, field) | 181 | #define IP_INC_STATS(net, field) SNMP_INC_STATS64((net)->mib.ip_statistics, field) |
| 187 | #define IP_INC_STATS_BH(net, field) SNMP_INC_STATS64_BH((net)->mib.ip_statistics, field) | 182 | #define IP_INC_STATS_BH(net, field) SNMP_INC_STATS64_BH((net)->mib.ip_statistics, field) |
| 188 | #define IP_ADD_STATS(net, field, val) SNMP_ADD_STATS64((net)->mib.ip_statistics, field, val) | 183 | #define IP_ADD_STATS(net, field, val) SNMP_ADD_STATS64((net)->mib.ip_statistics, field, val) |
| @@ -269,6 +264,39 @@ int ip_dont_fragment(struct sock *sk, struct dst_entry *dst) | |||
| 269 | !(dst_metric_locked(dst, RTAX_MTU))); | 264 | !(dst_metric_locked(dst, RTAX_MTU))); |
| 270 | } | 265 | } |
| 271 | 266 | ||
| 267 | static inline bool ip_sk_accept_pmtu(const struct sock *sk) | ||
| 268 | { | ||
| 269 | return inet_sk(sk)->pmtudisc != IP_PMTUDISC_INTERFACE; | ||
| 270 | } | ||
| 271 | |||
| 272 | static inline bool ip_sk_use_pmtu(const struct sock *sk) | ||
| 273 | { | ||
| 274 | return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE; | ||
| 275 | } | ||
| 276 | |||
| 277 | static inline unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst, | ||
| 278 | bool forwarding) | ||
| 279 | { | ||
| 280 | struct net *net = dev_net(dst->dev); | ||
| 281 | |||
| 282 | if (net->ipv4.sysctl_ip_fwd_use_pmtu || | ||
| 283 | dst_metric_locked(dst, RTAX_MTU) || | ||
| 284 | !forwarding) | ||
| 285 | return dst_mtu(dst); | ||
| 286 | |||
| 287 | return min(dst->dev->mtu, IP_MAX_MTU); | ||
| 288 | } | ||
| 289 | |||
| 290 | static inline unsigned int ip_skb_dst_mtu(const struct sk_buff *skb) | ||
| 291 | { | ||
| 292 | if (!skb->sk || ip_sk_use_pmtu(skb->sk)) { | ||
| 293 | bool forwarding = IPCB(skb)->flags & IPSKB_FORWARDED; | ||
| 294 | return ip_dst_mtu_maybe_forward(skb_dst(skb), forwarding); | ||
| 295 | } else { | ||
| 296 | return min(skb_dst(skb)->dev->mtu, IP_MAX_MTU); | ||
| 297 | } | ||
| 298 | } | ||
| 299 | |||
| 272 | void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); | 300 | void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); |
| 273 | 301 | ||
| 274 | static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk) | 302 | static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk) |
| @@ -473,7 +501,7 @@ int compat_ip_getsockopt(struct sock *sk, int level, int optname, | |||
| 473 | int ip_ra_control(struct sock *sk, unsigned char on, | 501 | int ip_ra_control(struct sock *sk, unsigned char on, |
| 474 | void (*destructor)(struct sock *)); | 502 | void (*destructor)(struct sock *)); |
| 475 | 503 | ||
| 476 | int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); | 504 | int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len); |
| 477 | void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, | 505 | void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
| 478 | u32 info, u8 *payload); | 506 | u32 info, u8 *payload); |
| 479 | void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, | 507 | void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 2182525e4d74..aca0c2709fd6 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
| @@ -282,7 +282,7 @@ struct fib6_node *fib6_locate(struct fib6_node *root, | |||
| 282 | const struct in6_addr *saddr, int src_len); | 282 | const struct in6_addr *saddr, int src_len); |
| 283 | 283 | ||
| 284 | void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg), | 284 | void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg), |
| 285 | int prune, void *arg); | 285 | void *arg); |
| 286 | 286 | ||
| 287 | int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info); | 287 | int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info); |
| 288 | 288 | ||
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 733747ce163c..017badb1aec7 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
| @@ -51,26 +51,6 @@ static inline unsigned int rt6_flags2srcprefs(int flags) | |||
| 51 | return (flags >> 3) & 7; | 51 | return (flags >> 3) & 7; |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | void rt6_bind_peer(struct rt6_info *rt, int create); | ||
| 55 | |||
| 56 | static inline struct inet_peer *__rt6_get_peer(struct rt6_info *rt, int create) | ||
| 57 | { | ||
| 58 | if (rt6_has_peer(rt)) | ||
| 59 | return rt6_peer_ptr(rt); | ||
| 60 | |||
| 61 | rt6_bind_peer(rt, create); | ||
| 62 | return (rt6_has_peer(rt) ? rt6_peer_ptr(rt) : NULL); | ||
| 63 | } | ||
| 64 | |||
| 65 | static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) | ||
| 66 | { | ||
| 67 | return __rt6_get_peer(rt, 0); | ||
| 68 | } | ||
| 69 | |||
| 70 | static inline struct inet_peer *rt6_get_peer_create(struct rt6_info *rt) | ||
| 71 | { | ||
| 72 | return __rt6_get_peer(rt, 1); | ||
| 73 | } | ||
| 74 | 54 | ||
| 75 | void ip6_route_input(struct sk_buff *skb); | 55 | void ip6_route_input(struct sk_buff *skb); |
| 76 | 56 | ||
| @@ -172,16 +152,28 @@ static inline bool ipv6_unicast_destination(const struct sk_buff *skb) | |||
| 172 | return rt->rt6i_flags & RTF_LOCAL; | 152 | return rt->rt6i_flags & RTF_LOCAL; |
| 173 | } | 153 | } |
| 174 | 154 | ||
| 155 | static inline bool ipv6_anycast_destination(const struct sk_buff *skb) | ||
| 156 | { | ||
| 157 | struct rt6_info *rt = (struct rt6_info *) skb_dst(skb); | ||
| 158 | |||
| 159 | return rt->rt6i_flags & RTF_ANYCAST; | ||
| 160 | } | ||
| 161 | |||
| 175 | int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | 162 | int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); |
| 176 | 163 | ||
| 177 | static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | 164 | static inline int ip6_skb_dst_mtu(struct sk_buff *skb) |
| 178 | { | 165 | { |
| 179 | struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; | 166 | struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; |
| 180 | 167 | ||
| 181 | return (np && np->pmtudisc == IPV6_PMTUDISC_PROBE) ? | 168 | return (np && np->pmtudisc >= IPV6_PMTUDISC_PROBE) ? |
| 182 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | 169 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); |
| 183 | } | 170 | } |
| 184 | 171 | ||
| 172 | static inline bool ip6_sk_accept_pmtu(const struct sock *sk) | ||
| 173 | { | ||
| 174 | return inet6_sk(sk)->pmtudisc != IPV6_PMTUDISC_INTERFACE; | ||
| 175 | } | ||
| 176 | |||
| 185 | static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt) | 177 | static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt) |
| 186 | { | 178 | { |
| 187 | return &rt->rt6i_gateway; | 179 | return &rt->rt6i_gateway; |
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index 6d1549c4893c..a5593dab6af7 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h | |||
| @@ -79,7 +79,7 @@ static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 79 | err = ip6_local_out(skb); | 79 | err = ip6_local_out(skb); |
| 80 | 80 | ||
| 81 | if (net_xmit_eval(err) == 0) { | 81 | if (net_xmit_eval(err) == 0) { |
| 82 | struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats); | 82 | struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats); |
| 83 | u64_stats_update_begin(&tstats->syncp); | 83 | u64_stats_update_begin(&tstats->syncp); |
| 84 | tstats->tx_bytes += pkt_len; | 84 | tstats->tx_bytes += pkt_len; |
| 85 | tstats->tx_packets++; | 85 | tstats->tx_packets++; |
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index 732f8c6ae975..48ed75c21260 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h | |||
| @@ -38,6 +38,10 @@ struct ip_tunnel_prl_entry { | |||
| 38 | struct rcu_head rcu_head; | 38 | struct rcu_head rcu_head; |
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| 41 | struct ip_tunnel_dst { | ||
| 42 | struct dst_entry __rcu *dst; | ||
| 43 | }; | ||
| 44 | |||
| 41 | struct ip_tunnel { | 45 | struct ip_tunnel { |
| 42 | struct ip_tunnel __rcu *next; | 46 | struct ip_tunnel __rcu *next; |
| 43 | struct hlist_node hash_node; | 47 | struct hlist_node hash_node; |
| @@ -54,6 +58,8 @@ struct ip_tunnel { | |||
| 54 | int hlen; /* Precalculated header length */ | 58 | int hlen; /* Precalculated header length */ |
| 55 | int mlink; | 59 | int mlink; |
| 56 | 60 | ||
| 61 | struct ip_tunnel_dst __percpu *dst_cache; | ||
| 62 | |||
| 57 | struct ip_tunnel_parm parms; | 63 | struct ip_tunnel_parm parms; |
| 58 | 64 | ||
| 59 | /* for SIT */ | 65 | /* for SIT */ |
| @@ -155,10 +161,10 @@ struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb, bool gre_csum, | |||
| 155 | 161 | ||
| 156 | static inline void iptunnel_xmit_stats(int err, | 162 | static inline void iptunnel_xmit_stats(int err, |
| 157 | struct net_device_stats *err_stats, | 163 | struct net_device_stats *err_stats, |
| 158 | struct pcpu_tstats __percpu *stats) | 164 | struct pcpu_sw_netstats __percpu *stats) |
| 159 | { | 165 | { |
| 160 | if (err > 0) { | 166 | if (err > 0) { |
| 161 | struct pcpu_tstats *tstats = this_cpu_ptr(stats); | 167 | struct pcpu_sw_netstats *tstats = this_cpu_ptr(stats); |
| 162 | 168 | ||
| 163 | u64_stats_update_begin(&tstats->syncp); | 169 | u64_stats_update_begin(&tstats->syncp); |
| 164 | tstats->tx_bytes += err; | 170 | tstats->tx_bytes += err; |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 2a5f668cd683..4f541f11ce63 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
| @@ -110,7 +110,8 @@ struct frag_hdr { | |||
| 110 | __be32 identification; | 110 | __be32 identification; |
| 111 | }; | 111 | }; |
| 112 | 112 | ||
| 113 | #define IP6_MF 0x0001 | 113 | #define IP6_MF 0x0001 |
| 114 | #define IP6_OFFSET 0xFFF8 | ||
| 114 | 115 | ||
| 115 | #include <net/sock.h> | 116 | #include <net/sock.h> |
| 116 | 117 | ||
| @@ -237,6 +238,8 @@ struct ip6_flowlabel { | |||
| 237 | 238 | ||
| 238 | #define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF) | 239 | #define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF) |
| 239 | #define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) | 240 | #define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) |
| 241 | #define IPV6_TCLASS_MASK (IPV6_FLOWINFO_MASK & ~IPV6_FLOWLABEL_MASK) | ||
| 242 | #define IPV6_TCLASS_SHIFT 20 | ||
| 240 | 243 | ||
| 241 | struct ipv6_fl_socklist { | 244 | struct ipv6_fl_socklist { |
| 242 | struct ipv6_fl_socklist __rcu *next; | 245 | struct ipv6_fl_socklist __rcu *next; |
| @@ -250,7 +253,8 @@ struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions *opt_space, | |||
| 250 | struct ipv6_txoptions *fopt); | 253 | struct ipv6_txoptions *fopt); |
| 251 | void fl6_free_socklist(struct sock *sk); | 254 | void fl6_free_socklist(struct sock *sk); |
| 252 | int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen); | 255 | int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen); |
| 253 | int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq); | 256 | int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq, |
| 257 | int flags); | ||
| 254 | int ip6_flowlabel_init(void); | 258 | int ip6_flowlabel_init(void); |
| 255 | void ip6_flowlabel_cleanup(void); | 259 | void ip6_flowlabel_cleanup(void); |
| 256 | 260 | ||
| @@ -265,9 +269,6 @@ void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info); | |||
| 265 | int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, | 269 | int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, |
| 266 | struct icmp6hdr *thdr, int len); | 270 | struct icmp6hdr *thdr, int len); |
| 267 | 271 | ||
| 268 | struct dst_entry *icmpv6_route_lookup(struct net *net, struct sk_buff *skb, | ||
| 269 | struct sock *sk, struct flowi6 *fl6); | ||
| 270 | |||
| 271 | int ip6_ra_control(struct sock *sk, int sel); | 272 | int ip6_ra_control(struct sock *sk, int sel); |
| 272 | 273 | ||
| 273 | int ipv6_parse_hopopts(struct sk_buff *skb); | 274 | int ipv6_parse_hopopts(struct sk_buff *skb); |
| @@ -677,6 +678,15 @@ static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr) | |||
| 677 | return *(__be32 *)hdr & IPV6_FLOWINFO_MASK; | 678 | return *(__be32 *)hdr & IPV6_FLOWINFO_MASK; |
| 678 | } | 679 | } |
| 679 | 680 | ||
| 681 | static inline __be32 ip6_flowlabel(const struct ipv6hdr *hdr) | ||
| 682 | { | ||
| 683 | return *(__be32 *)hdr & IPV6_FLOWLABEL_MASK; | ||
| 684 | } | ||
| 685 | |||
| 686 | static inline u8 ip6_tclass(__be32 flowinfo) | ||
| 687 | { | ||
| 688 | return ntohl(flowinfo & IPV6_TCLASS_MASK) >> IPV6_TCLASS_SHIFT; | ||
| 689 | } | ||
| 680 | /* | 690 | /* |
| 681 | * Prototypes exported by ipv6 | 691 | * Prototypes exported by ipv6 |
| 682 | */ | 692 | */ |
| @@ -711,11 +721,9 @@ void ip6_flush_pending_frames(struct sock *sk); | |||
| 711 | 721 | ||
| 712 | int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6); | 722 | int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6); |
| 713 | struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | 723 | struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, |
| 714 | const struct in6_addr *final_dst, | 724 | const struct in6_addr *final_dst); |
| 715 | bool can_sleep); | ||
| 716 | struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | 725 | struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, |
| 717 | const struct in6_addr *final_dst, | 726 | const struct in6_addr *final_dst); |
| 718 | bool can_sleep); | ||
| 719 | struct dst_entry *ip6_blackhole_route(struct net *net, | 727 | struct dst_entry *ip6_blackhole_route(struct net *net, |
| 720 | struct dst_entry *orig_dst); | 728 | struct dst_entry *orig_dst); |
| 721 | 729 | ||
| @@ -775,9 +783,13 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
| 775 | char __user *optval, int __user *optlen); | 783 | char __user *optval, int __user *optlen); |
| 776 | 784 | ||
| 777 | int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); | 785 | int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); |
| 786 | int ip6_datagram_connect_v6_only(struct sock *sk, struct sockaddr *addr, | ||
| 787 | int addr_len); | ||
| 778 | 788 | ||
| 779 | int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); | 789 | int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, |
| 780 | int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len); | 790 | int *addr_len); |
| 791 | int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len, | ||
| 792 | int *addr_len); | ||
| 781 | void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, | 793 | void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
| 782 | u32 info, u8 *payload); | 794 | u32 info, u8 *payload); |
| 783 | void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info); | 795 | void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info); |
| @@ -832,7 +844,6 @@ static inline int snmp6_unregister_dev(struct inet6_dev *idev) { return 0; } | |||
| 832 | 844 | ||
| 833 | #ifdef CONFIG_SYSCTL | 845 | #ifdef CONFIG_SYSCTL |
| 834 | extern struct ctl_table ipv6_route_table_template[]; | 846 | extern struct ctl_table ipv6_route_table_template[]; |
| 835 | extern struct ctl_table ipv6_icmp_table_template[]; | ||
| 836 | 847 | ||
| 837 | struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); | 848 | struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); |
| 838 | struct ctl_table *ipv6_route_sysctl_init(struct net *net); | 849 | struct ctl_table *ipv6_route_sysctl_init(struct net *net); |
diff --git a/include/net/irda/discovery.h b/include/net/irda/discovery.h index 0ce93398720d..63ae32530567 100644 --- a/include/net/irda/discovery.h +++ b/include/net/irda/discovery.h | |||
| @@ -23,9 +23,7 @@ | |||
| 23 | * GNU General Public License for more details. | 23 | * GNU General Public License for more details. |
| 24 | * | 24 | * |
| 25 | * You should have received a copy of the GNU General Public License | 25 | * You should have received a copy of the GNU General Public License |
| 26 | * along with this program; if not, write to the Free Software | 26 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 27 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 28 | * MA 02111-1307 USA | ||
| 29 | * | 27 | * |
| 30 | ********************************************************************/ | 28 | ********************************************************************/ |
| 31 | 29 | ||
diff --git a/include/net/irda/ircomm_core.h b/include/net/irda/ircomm_core.h index 69b610acd2df..2a580ce9edad 100644 --- a/include/net/irda/ircomm_core.h +++ b/include/net/irda/ircomm_core.h | |||
| @@ -22,9 +22,7 @@ | |||
| 22 | * GNU General Public License for more details. | 22 | * GNU General Public License for more details. |
| 23 | * | 23 | * |
| 24 | * You should have received a copy of the GNU General Public License | 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, write to the Free Software | 25 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 27 | * MA 02111-1307 USA | ||
| 28 | * | 26 | * |
| 29 | ********************************************************************/ | 27 | ********************************************************************/ |
| 30 | 28 | ||
diff --git a/include/net/irda/ircomm_event.h b/include/net/irda/ircomm_event.h index bc0c6f31f1c6..5bbc32998d57 100644 --- a/include/net/irda/ircomm_event.h +++ b/include/net/irda/ircomm_event.h | |||
| @@ -22,9 +22,7 @@ | |||
| 22 | * GNU General Public License for more details. | 22 | * GNU General Public License for more details. |
| 23 | * | 23 | * |
| 24 | * You should have received a copy of the GNU General Public License | 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, write to the Free Software | 25 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 27 | * MA 02111-1307 USA | ||
| 28 | * | 26 | * |
| 29 | ********************************************************************/ | 27 | ********************************************************************/ |
| 30 | 28 | ||
diff --git a/include/net/irda/ircomm_lmp.h b/include/net/irda/ircomm_lmp.h index ae02106be590..5042a5021a04 100644 --- a/include/net/irda/ircomm_lmp.h +++ b/include/net/irda/ircomm_lmp.h | |||
| @@ -22,9 +22,7 @@ | |||
| 22 | * GNU General Public License for more details. | 22 | * GNU General Public License for more details. |
| 23 | * | 23 | * |
| 24 | * You should have received a copy of the GNU General Public License | 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, write to the Free Software | 25 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 27 | * MA 02111-1307 USA | ||
| 28 | * | 26 | * |
| 29 | ********************************************************************/ | 27 | ********************************************************************/ |
| 30 | 28 | ||
diff --git a/include/net/irda/ircomm_param.h b/include/net/irda/ircomm_param.h index e6678800c41f..1f67432321c4 100644 --- a/include/net/irda/ircomm_param.h +++ b/include/net/irda/ircomm_param.h | |||
| @@ -22,9 +22,7 @@ | |||
| 22 | * GNU General Public License for more details. | 22 | * GNU General Public License for more details. |
| 23 | * | 23 | * |
| 24 | * You should have received a copy of the GNU General Public License | 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, write to the Free Software | 25 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 27 | * MA 02111-1307 USA | ||
| 28 | * | 26 | * |
| 29 | ********************************************************************/ | 27 | ********************************************************************/ |
| 30 | 28 | ||
diff --git a/include/net/irda/ircomm_ttp.h b/include/net/irda/ircomm_ttp.h index 403081ed725c..c5627288bca3 100644 --- a/include/net/irda/ircomm_ttp.h +++ b/include/net/irda/ircomm_ttp.h | |||
| @@ -22,9 +22,7 @@ | |||
| 22 | * GNU General Public License for more details. | 22 | * GNU General Public License for more details. |
| 23 | * | 23 | * |
| 24 | * You should have received a copy of the GNU General Public License | 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, write to the Free Software | 25 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 27 | * MA 02111-1307 USA | ||
| 28 | * | 26 | * |
| 29 | ********************************************************************/ | 27 | ********************************************************************/ |
| 30 | 28 | ||
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h index 0224402260a7..8d4f588974bc 100644 --- a/include/net/irda/ircomm_tty.h +++ b/include/net/irda/ircomm_tty.h | |||
| @@ -22,9 +22,7 @@ | |||
| 22 | * GNU General Public License for more details. | 22 | * GNU General Public License for more details. |
| 23 | * | 23 | * |
| 24 | * You should have received a copy of the GNU General Public License | 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, write to the Free Software | 25 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 27 | * MA 02111-1307 USA | ||
| 28 | * | 26 | * |
| 29 | ********************************************************************/ | 27 | ********************************************************************/ |
| 30 | 28 | ||
diff --git a/include/net/irda/ircomm_tty_attach.h b/include/net/irda/ircomm_tty_attach.h index 0a63bbb972d7..20dcbdf258cf 100644 --- a/include/net/irda/ircomm_tty_attach.h +++ b/include/net/irda/ircomm_tty_attach.h | |||
| @@ -22,9 +22,7 @@ | |||
| 22 | * GNU General Public License for more details. | 22 | * GNU General Public License for more details. |
| 23 | * | 23 | * |
| 24 | * You should have received a copy of the GNU General Public License | 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, write to the Free Software | 25 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 27 | * MA 02111-1307 USA | ||
| 28 | * | 26 | * |
| 29 | ********************************************************************/ | 27 | ********************************************************************/ |
| 30 | 28 | ||
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h index 11417475a6c3..664bf8178412 100644 --- a/include/net/irda/irda_device.h +++ b/include/net/irda/irda_device.h | |||
| @@ -24,9 +24,7 @@ | |||
| 24 | * GNU General Public License for more details. | 24 | * GNU General Public License for more details. |
| 25 | * | 25 | * |
| 26 | * You should have received a copy of the GNU General Public License | 26 | * You should have received a copy of the GNU General Public License |
| 27 | * along with this program; if not, write to the Free Software | 27 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 29 | * MA 02111-1307 USA | ||
| 30 | * | 28 | * |
| 31 | ********************************************************************/ | 29 | ********************************************************************/ |
| 32 | 30 | ||
diff --git a/include/net/irda/irlap_event.h b/include/net/irda/irlap_event.h index f9d88da97af2..e4325fee1267 100644 --- a/include/net/irda/irlap_event.h +++ b/include/net/irda/irlap_event.h | |||
| @@ -25,9 +25,7 @@ | |||
| 25 | * GNU General Public License for more details. | 25 | * GNU General Public License for more details. |
| 26 | * | 26 | * |
| 27 | * You should have received a copy of the GNU General Public License | 27 | * You should have received a copy of the GNU General Public License |
| 28 | * along with this program; if not, write to the Free Software | 28 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 29 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 30 | * MA 02111-1307 USA | ||
| 31 | * | 29 | * |
| 32 | ********************************************************************/ | 30 | ********************************************************************/ |
| 33 | 31 | ||
diff --git a/include/net/irda/irlap_frame.h b/include/net/irda/irlap_frame.h index 57173ae398ae..cbc12a926e5f 100644 --- a/include/net/irda/irlap_frame.h +++ b/include/net/irda/irlap_frame.h | |||
| @@ -24,9 +24,7 @@ | |||
| 24 | * GNU General Public License for more details. | 24 | * GNU General Public License for more details. |
| 25 | * | 25 | * |
| 26 | * You should have received a copy of the GNU General Public License | 26 | * You should have received a copy of the GNU General Public License |
| 27 | * along with this program; if not, write to the Free Software | 27 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 29 | * MA 02111-1307 USA | ||
| 30 | * | 28 | * |
| 31 | ********************************************************************/ | 29 | ********************************************************************/ |
| 32 | 30 | ||
diff --git a/include/net/irda/parameters.h b/include/net/irda/parameters.h index c0d938847bd3..42713c931d1f 100644 --- a/include/net/irda/parameters.h +++ b/include/net/irda/parameters.h | |||
| @@ -22,9 +22,7 @@ | |||
| 22 | * GNU General Public License for more details. | 22 | * GNU General Public License for more details. |
| 23 | * | 23 | * |
| 24 | * You should have received a copy of the GNU General Public License | 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, write to the Free Software | 25 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 27 | * MA 02111-1307 USA | ||
| 28 | * | 26 | * |
| 29 | * Michel Dänzer <daenzer@debian.org>, 10/2001 | 27 | * Michel Dänzer <daenzer@debian.org>, 10/2001 |
| 30 | * - simplify irda_pv_t to avoid endianness issues | 28 | * - simplify irda_pv_t to avoid endianness issues |
diff --git a/include/net/irda/qos.h b/include/net/irda/qos.h index cc577dc0a0ef..05a5a249956f 100644 --- a/include/net/irda/qos.h +++ b/include/net/irda/qos.h | |||
| @@ -22,9 +22,7 @@ | |||
| 22 | * GNU General Public License for more details. | 22 | * GNU General Public License for more details. |
| 23 | * | 23 | * |
| 24 | * You should have received a copy of the GNU General Public License | 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, write to the Free Software | 25 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
| 27 | * MA 02111-1307 USA | ||
| 28 | * | 26 | * |
| 29 | ********************************************************************/ | 27 | ********************************************************************/ |
| 30 | 28 | ||
diff --git a/include/net/llc.h b/include/net/llc.h index 68490cbc8a65..e8e61d4fb458 100644 --- a/include/net/llc.h +++ b/include/net/llc.h | |||
| @@ -93,7 +93,6 @@ struct hlist_nulls_head *llc_sk_laddr_hash(struct llc_sap *sap, | |||
| 93 | #define LLC_DEST_CONN 2 /* Type 2 goes here */ | 93 | #define LLC_DEST_CONN 2 /* Type 2 goes here */ |
| 94 | 94 | ||
| 95 | extern struct list_head llc_sap_list; | 95 | extern struct list_head llc_sap_list; |
| 96 | extern spinlock_t llc_sap_list_lock; | ||
| 97 | 96 | ||
| 98 | int llc_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, | 97 | int llc_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, |
| 99 | struct net_device *orig_dev); | 98 | struct net_device *orig_dev); |
diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h index 31e2de7d57c5..c0f0a13ed818 100644 --- a/include/net/llc_pdu.h +++ b/include/net/llc_pdu.h | |||
| @@ -142,7 +142,7 @@ | |||
| 142 | #define LLC_S_PF_IS_1(pdu) ((pdu->ctrl_2 & LLC_S_PF_BIT_MASK) ? 1 : 0) | 142 | #define LLC_S_PF_IS_1(pdu) ((pdu->ctrl_2 & LLC_S_PF_BIT_MASK) ? 1 : 0) |
| 143 | 143 | ||
| 144 | #define PDU_SUPV_GET_Nr(pdu) ((pdu->ctrl_2 & 0xFE) >> 1) | 144 | #define PDU_SUPV_GET_Nr(pdu) ((pdu->ctrl_2 & 0xFE) >> 1) |
| 145 | #define PDU_GET_NEXT_Vr(sn) (++sn & ~LLC_2_SEQ_NBR_MODULO) | 145 | #define PDU_GET_NEXT_Vr(sn) (((sn) + 1) & ~LLC_2_SEQ_NBR_MODULO) |
| 146 | 146 | ||
| 147 | /* FRMR information field macros */ | 147 | /* FRMR information field macros */ |
| 148 | 148 | ||
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 7ceed99a05bc..f4ab2fb4d50c 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -154,12 +154,14 @@ struct ieee80211_low_level_stats { | |||
| 154 | * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed | 154 | * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed |
| 155 | * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel, | 155 | * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel, |
| 156 | * this is used only with channel switching with CSA | 156 | * this is used only with channel switching with CSA |
| 157 | * @IEEE80211_CHANCTX_CHANGE_MIN_WIDTH: The min required channel width changed | ||
| 157 | */ | 158 | */ |
| 158 | enum ieee80211_chanctx_change { | 159 | enum ieee80211_chanctx_change { |
| 159 | IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), | 160 | IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), |
| 160 | IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), | 161 | IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), |
| 161 | IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), | 162 | IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), |
| 162 | IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3), | 163 | IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3), |
| 164 | IEEE80211_CHANCTX_CHANGE_MIN_WIDTH = BIT(4), | ||
| 163 | }; | 165 | }; |
| 164 | 166 | ||
| 165 | /** | 167 | /** |
| @@ -169,6 +171,7 @@ enum ieee80211_chanctx_change { | |||
| 169 | * that contains it is visible in mac80211 only. | 171 | * that contains it is visible in mac80211 only. |
| 170 | * | 172 | * |
| 171 | * @def: the channel definition | 173 | * @def: the channel definition |
| 174 | * @min_def: the minimum channel definition currently required. | ||
| 172 | * @rx_chains_static: The number of RX chains that must always be | 175 | * @rx_chains_static: The number of RX chains that must always be |
| 173 | * active on the channel to receive MIMO transmissions | 176 | * active on the channel to receive MIMO transmissions |
| 174 | * @rx_chains_dynamic: The number of RX chains that must be enabled | 177 | * @rx_chains_dynamic: The number of RX chains that must be enabled |
| @@ -180,6 +183,7 @@ enum ieee80211_chanctx_change { | |||
| 180 | */ | 183 | */ |
| 181 | struct ieee80211_chanctx_conf { | 184 | struct ieee80211_chanctx_conf { |
| 182 | struct cfg80211_chan_def def; | 185 | struct cfg80211_chan_def def; |
| 186 | struct cfg80211_chan_def min_def; | ||
| 183 | 187 | ||
| 184 | u8 rx_chains_static, rx_chains_dynamic; | 188 | u8 rx_chains_static, rx_chains_dynamic; |
| 185 | 189 | ||
| @@ -1159,6 +1163,19 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | |||
| 1159 | } | 1163 | } |
| 1160 | 1164 | ||
| 1161 | /** | 1165 | /** |
| 1166 | * wdev_to_ieee80211_vif - return a vif struct from a wdev | ||
| 1167 | * @wdev: the wdev to get the vif for | ||
| 1168 | * | ||
| 1169 | * This can be used by mac80211 drivers with direct cfg80211 APIs | ||
| 1170 | * (like the vendor commands) that get a wdev. | ||
| 1171 | * | ||
| 1172 | * Note that this function may return %NULL if the given wdev isn't | ||
| 1173 | * associated with a vif that the driver knows about (e.g. monitor | ||
| 1174 | * or AP_VLAN interfaces.) | ||
| 1175 | */ | ||
| 1176 | struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev); | ||
| 1177 | |||
| 1178 | /** | ||
| 1162 | * enum ieee80211_key_flags - key flags | 1179 | * enum ieee80211_key_flags - key flags |
| 1163 | * | 1180 | * |
| 1164 | * These flags are used for communication about keys between the driver | 1181 | * These flags are used for communication about keys between the driver |
| @@ -1229,6 +1246,36 @@ struct ieee80211_key_conf { | |||
| 1229 | }; | 1246 | }; |
| 1230 | 1247 | ||
| 1231 | /** | 1248 | /** |
| 1249 | * struct ieee80211_cipher_scheme - cipher scheme | ||
| 1250 | * | ||
| 1251 | * This structure contains a cipher scheme information defining | ||
| 1252 | * the secure packet crypto handling. | ||
| 1253 | * | ||
| 1254 | * @cipher: a cipher suite selector | ||
| 1255 | * @iftype: a cipher iftype bit mask indicating an allowed cipher usage | ||
| 1256 | * @hdr_len: a length of a security header used the cipher | ||
| 1257 | * @pn_len: a length of a packet number in the security header | ||
| 1258 | * @pn_off: an offset of pn from the beginning of the security header | ||
| 1259 | * @key_idx_off: an offset of key index byte in the security header | ||
| 1260 | * @key_idx_mask: a bit mask of key_idx bits | ||
| 1261 | * @key_idx_shift: a bit shift needed to get key_idx | ||
| 1262 | * key_idx value calculation: | ||
| 1263 | * (sec_header_base[key_idx_off] & key_idx_mask) >> key_idx_shift | ||
| 1264 | * @mic_len: a mic length in bytes | ||
| 1265 | */ | ||
| 1266 | struct ieee80211_cipher_scheme { | ||
| 1267 | u32 cipher; | ||
| 1268 | u16 iftype; | ||
| 1269 | u8 hdr_len; | ||
| 1270 | u8 pn_len; | ||
| 1271 | u8 pn_off; | ||
| 1272 | u8 key_idx_off; | ||
| 1273 | u8 key_idx_mask; | ||
| 1274 | u8 key_idx_shift; | ||
| 1275 | u8 mic_len; | ||
| 1276 | }; | ||
| 1277 | |||
| 1278 | /** | ||
| 1232 | * enum set_key_cmd - key command | 1279 | * enum set_key_cmd - key command |
| 1233 | * | 1280 | * |
| 1234 | * Used with the set_key() callback in &struct ieee80211_ops, this | 1281 | * Used with the set_key() callback in &struct ieee80211_ops, this |
| @@ -1566,7 +1613,8 @@ enum ieee80211_hw_flags { | |||
| 1566 | * @extra_tx_headroom: headroom to reserve in each transmit skb | 1613 | * @extra_tx_headroom: headroom to reserve in each transmit skb |
| 1567 | * for use by the driver (e.g. for transmit headers.) | 1614 | * for use by the driver (e.g. for transmit headers.) |
| 1568 | * | 1615 | * |
| 1569 | * @channel_change_time: time (in microseconds) it takes to change channels. | 1616 | * @extra_beacon_tailroom: tailroom to reserve in each beacon tx skb. |
| 1617 | * Can be used by drivers to add extra IEs. | ||
| 1570 | * | 1618 | * |
| 1571 | * @max_signal: Maximum value for signal (rssi) in RX information, used | 1619 | * @max_signal: Maximum value for signal (rssi) in RX information, used |
| 1572 | * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB | 1620 | * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB |
| @@ -1636,6 +1684,10 @@ enum ieee80211_hw_flags { | |||
| 1636 | * @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may | 1684 | * @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may |
| 1637 | * deliver to a WMM STA during any Service Period triggered by the WMM STA. | 1685 | * deliver to a WMM STA during any Service Period triggered by the WMM STA. |
| 1638 | * Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values. | 1686 | * Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values. |
| 1687 | * | ||
| 1688 | * @n_cipher_schemes: a size of an array of cipher schemes definitions. | ||
| 1689 | * @cipher_schemes: a pointer to an array of cipher scheme definitions | ||
| 1690 | * supported by HW. | ||
| 1639 | */ | 1691 | */ |
| 1640 | struct ieee80211_hw { | 1692 | struct ieee80211_hw { |
| 1641 | struct ieee80211_conf conf; | 1693 | struct ieee80211_conf conf; |
| @@ -1644,7 +1696,7 @@ struct ieee80211_hw { | |||
| 1644 | void *priv; | 1696 | void *priv; |
| 1645 | u32 flags; | 1697 | u32 flags; |
| 1646 | unsigned int extra_tx_headroom; | 1698 | unsigned int extra_tx_headroom; |
| 1647 | int channel_change_time; | 1699 | unsigned int extra_beacon_tailroom; |
| 1648 | int vif_data_size; | 1700 | int vif_data_size; |
| 1649 | int sta_data_size; | 1701 | int sta_data_size; |
| 1650 | int chanctx_data_size; | 1702 | int chanctx_data_size; |
| @@ -1663,6 +1715,8 @@ struct ieee80211_hw { | |||
| 1663 | netdev_features_t netdev_features; | 1715 | netdev_features_t netdev_features; |
| 1664 | u8 uapsd_queues; | 1716 | u8 uapsd_queues; |
| 1665 | u8 uapsd_max_sp_len; | 1717 | u8 uapsd_max_sp_len; |
| 1718 | u8 n_cipher_schemes; | ||
| 1719 | const struct ieee80211_cipher_scheme *cipher_schemes; | ||
| 1666 | }; | 1720 | }; |
| 1667 | 1721 | ||
| 1668 | /** | 1722 | /** |
| @@ -2065,6 +2119,11 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
| 2065 | * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP) | 2119 | * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP) |
| 2066 | * and also take care of the EOSP and MORE_DATA bits in the frame. | 2120 | * and also take care of the EOSP and MORE_DATA bits in the frame. |
| 2067 | * The driver may also use ieee80211_sta_eosp() in this case. | 2121 | * The driver may also use ieee80211_sta_eosp() in this case. |
| 2122 | * | ||
| 2123 | * Note that if the driver ever buffers frames other than QoS-data | ||
| 2124 | * frames, it must take care to never send a non-QoS-data frame as | ||
| 2125 | * the last frame in a service period, adding a QoS-nulldata frame | ||
| 2126 | * after a non-QoS-data frame if needed. | ||
| 2068 | */ | 2127 | */ |
| 2069 | 2128 | ||
| 2070 | /** | 2129 | /** |
| @@ -2358,9 +2417,6 @@ enum ieee80211_roc_type { | |||
| 2358 | * See the section "Frame filtering" for more information. | 2417 | * See the section "Frame filtering" for more information. |
| 2359 | * This callback must be implemented and can sleep. | 2418 | * This callback must be implemented and can sleep. |
| 2360 | * | 2419 | * |
| 2361 | * @set_multicast_list: Configure the device's interface specific RX multicast | ||
| 2362 | * filter. This callback is optional. This callback must be atomic. | ||
| 2363 | * | ||
| 2364 | * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit | 2420 | * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit |
| 2365 | * must be set or cleared for a given STA. Must be atomic. | 2421 | * must be set or cleared for a given STA. Must be atomic. |
| 2366 | * | 2422 | * |
| @@ -2445,7 +2501,11 @@ enum ieee80211_roc_type { | |||
| 2445 | * AP, IBSS/WDS/mesh peer etc. This callback can sleep. | 2501 | * AP, IBSS/WDS/mesh peer etc. This callback can sleep. |
| 2446 | * | 2502 | * |
| 2447 | * @sta_remove: Notifies low level driver about removal of an associated | 2503 | * @sta_remove: Notifies low level driver about removal of an associated |
| 2448 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. | 2504 | * station, AP, IBSS/WDS/mesh peer etc. Note that after the callback |
| 2505 | * returns it isn't safe to use the pointer, not even RCU protected; | ||
| 2506 | * no RCU grace period is guaranteed between returning here and freeing | ||
| 2507 | * the station. See @sta_pre_rcu_remove if needed. | ||
| 2508 | * This callback can sleep. | ||
| 2449 | * | 2509 | * |
| 2450 | * @sta_add_debugfs: Drivers can use this callback to add debugfs files | 2510 | * @sta_add_debugfs: Drivers can use this callback to add debugfs files |
| 2451 | * when a station is added to mac80211's station list. This callback | 2511 | * when a station is added to mac80211's station list. This callback |
| @@ -2464,7 +2524,17 @@ enum ieee80211_roc_type { | |||
| 2464 | * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.) | 2524 | * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.) |
| 2465 | * This callback is mutually exclusive with @sta_add/@sta_remove. | 2525 | * This callback is mutually exclusive with @sta_add/@sta_remove. |
| 2466 | * It must not fail for down transitions but may fail for transitions | 2526 | * It must not fail for down transitions but may fail for transitions |
| 2467 | * up the list of states. | 2527 | * up the list of states. Also note that after the callback returns it |
| 2528 | * isn't safe to use the pointer, not even RCU protected - no RCU grace | ||
| 2529 | * period is guaranteed between returning here and freeing the station. | ||
| 2530 | * See @sta_pre_rcu_remove if needed. | ||
| 2531 | * The callback can sleep. | ||
| 2532 | * | ||
| 2533 | * @sta_pre_rcu_remove: Notify driver about station removal before RCU | ||
| 2534 | * synchronisation. This is useful if a driver needs to have station | ||
| 2535 | * pointers protected using RCU, it can then use this call to clear | ||
| 2536 | * the pointers instead of waiting for an RCU grace period to elapse | ||
| 2537 | * in @sta_state. | ||
| 2468 | * The callback can sleep. | 2538 | * The callback can sleep. |
| 2469 | * | 2539 | * |
| 2470 | * @sta_rc_update: Notifies the driver of changes to the bitrates that can be | 2540 | * @sta_rc_update: Notifies the driver of changes to the bitrates that can be |
| @@ -2724,10 +2794,6 @@ struct ieee80211_ops { | |||
| 2724 | unsigned int changed_flags, | 2794 | unsigned int changed_flags, |
| 2725 | unsigned int *total_flags, | 2795 | unsigned int *total_flags, |
| 2726 | u64 multicast); | 2796 | u64 multicast); |
| 2727 | void (*set_multicast_list)(struct ieee80211_hw *hw, | ||
| 2728 | struct ieee80211_vif *vif, bool allmulti, | ||
| 2729 | struct netdev_hw_addr_list *mc_list); | ||
| 2730 | |||
| 2731 | int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, | 2797 | int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, |
| 2732 | bool set); | 2798 | bool set); |
| 2733 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, | 2799 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
| @@ -2781,6 +2847,9 @@ struct ieee80211_ops { | |||
| 2781 | struct ieee80211_sta *sta, | 2847 | struct ieee80211_sta *sta, |
| 2782 | enum ieee80211_sta_state old_state, | 2848 | enum ieee80211_sta_state old_state, |
| 2783 | enum ieee80211_sta_state new_state); | 2849 | enum ieee80211_sta_state new_state); |
| 2850 | void (*sta_pre_rcu_remove)(struct ieee80211_hw *hw, | ||
| 2851 | struct ieee80211_vif *vif, | ||
| 2852 | struct ieee80211_sta *sta); | ||
| 2784 | void (*sta_rc_update)(struct ieee80211_hw *hw, | 2853 | void (*sta_rc_update)(struct ieee80211_hw *hw, |
| 2785 | struct ieee80211_vif *vif, | 2854 | struct ieee80211_vif *vif, |
| 2786 | struct ieee80211_sta *sta, | 2855 | struct ieee80211_sta *sta, |
| @@ -4585,4 +4654,51 @@ bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw, | |||
| 4585 | struct ieee80211_vif *vif, struct sk_buff *skb, | 4654 | struct ieee80211_vif *vif, struct sk_buff *skb, |
| 4586 | int band, struct ieee80211_sta **sta); | 4655 | int band, struct ieee80211_sta **sta); |
| 4587 | 4656 | ||
| 4657 | /** | ||
| 4658 | * struct ieee80211_noa_data - holds temporary data for tracking P2P NoA state | ||
| 4659 | * | ||
| 4660 | * @next_tsf: TSF timestamp of the next absent state change | ||
| 4661 | * @has_next_tsf: next absent state change event pending | ||
| 4662 | * | ||
| 4663 | * @absent: descriptor bitmask, set if GO is currently absent | ||
| 4664 | * | ||
| 4665 | * private: | ||
| 4666 | * | ||
| 4667 | * @count: count fields from the NoA descriptors | ||
| 4668 | * @desc: adjusted data from the NoA | ||
| 4669 | */ | ||
| 4670 | struct ieee80211_noa_data { | ||
| 4671 | u32 next_tsf; | ||
| 4672 | bool has_next_tsf; | ||
| 4673 | |||
| 4674 | u8 absent; | ||
| 4675 | |||
| 4676 | u8 count[IEEE80211_P2P_NOA_DESC_MAX]; | ||
| 4677 | struct { | ||
| 4678 | u32 start; | ||
| 4679 | u32 duration; | ||
| 4680 | u32 interval; | ||
| 4681 | } desc[IEEE80211_P2P_NOA_DESC_MAX]; | ||
| 4682 | }; | ||
| 4683 | |||
| 4684 | /** | ||
| 4685 | * ieee80211_parse_p2p_noa - initialize NoA tracking data from P2P IE | ||
| 4686 | * | ||
| 4687 | * @attr: P2P NoA IE | ||
| 4688 | * @data: NoA tracking data | ||
| 4689 | * @tsf: current TSF timestamp | ||
| 4690 | * | ||
| 4691 | * Return: number of successfully parsed descriptors | ||
| 4692 | */ | ||
| 4693 | int ieee80211_parse_p2p_noa(const struct ieee80211_p2p_noa_attr *attr, | ||
| 4694 | struct ieee80211_noa_data *data, u32 tsf); | ||
| 4695 | |||
| 4696 | /** | ||
| 4697 | * ieee80211_update_p2p_noa - get next pending P2P GO absent state change | ||
| 4698 | * | ||
| 4699 | * @data: NoA tracking data | ||
| 4700 | * @tsf: current TSF timestamp | ||
| 4701 | */ | ||
| 4702 | void ieee80211_update_p2p_noa(struct ieee80211_noa_data *data, u32 tsf); | ||
| 4703 | |||
| 4588 | #endif /* MAC80211_H */ | 4704 | #endif /* MAC80211_H */ |
diff --git a/include/net/mip6.h b/include/net/mip6.h index 26ba99b5a4b1..0386b618908c 100644 --- a/include/net/mip6.h +++ b/include/net/mip6.h | |||
| @@ -13,8 +13,7 @@ | |||
| 13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
| 14 | * | 14 | * |
| 15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 18 | */ | 17 | */ |
| 19 | /* | 18 | /* |
| 20 | * Authors: | 19 | * Authors: |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 536501a3e58d..7277caf3743d 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/skbuff.h> | 21 | #include <linux/skbuff.h> |
| 22 | #include <linux/rcupdate.h> | 22 | #include <linux/rcupdate.h> |
| 23 | #include <linux/seq_file.h> | 23 | #include <linux/seq_file.h> |
| 24 | #include <linux/bitmap.h> | ||
| 24 | 25 | ||
| 25 | #include <linux/err.h> | 26 | #include <linux/err.h> |
| 26 | #include <linux/sysctl.h> | 27 | #include <linux/sysctl.h> |
| @@ -37,6 +38,32 @@ | |||
| 37 | 38 | ||
| 38 | struct neighbour; | 39 | struct neighbour; |
| 39 | 40 | ||
| 41 | enum { | ||
| 42 | NEIGH_VAR_MCAST_PROBES, | ||
| 43 | NEIGH_VAR_UCAST_PROBES, | ||
| 44 | NEIGH_VAR_APP_PROBES, | ||
| 45 | NEIGH_VAR_RETRANS_TIME, | ||
| 46 | NEIGH_VAR_BASE_REACHABLE_TIME, | ||
| 47 | NEIGH_VAR_DELAY_PROBE_TIME, | ||
| 48 | NEIGH_VAR_GC_STALETIME, | ||
| 49 | NEIGH_VAR_QUEUE_LEN_BYTES, | ||
| 50 | NEIGH_VAR_PROXY_QLEN, | ||
| 51 | NEIGH_VAR_ANYCAST_DELAY, | ||
| 52 | NEIGH_VAR_PROXY_DELAY, | ||
| 53 | NEIGH_VAR_LOCKTIME, | ||
| 54 | #define NEIGH_VAR_DATA_MAX (NEIGH_VAR_LOCKTIME + 1) | ||
| 55 | /* Following are used as a second way to access one of the above */ | ||
| 56 | NEIGH_VAR_QUEUE_LEN, /* same data as NEIGH_VAR_QUEUE_LEN_BYTES */ | ||
| 57 | NEIGH_VAR_RETRANS_TIME_MS, /* same data as NEIGH_VAR_RETRANS_TIME */ | ||
| 58 | NEIGH_VAR_BASE_REACHABLE_TIME_MS, /* same data as NEIGH_VAR_BASE_REACHABLE_TIME */ | ||
| 59 | /* Following are used by "default" only */ | ||
| 60 | NEIGH_VAR_GC_INTERVAL, | ||
| 61 | NEIGH_VAR_GC_THRESH1, | ||
| 62 | NEIGH_VAR_GC_THRESH2, | ||
| 63 | NEIGH_VAR_GC_THRESH3, | ||
| 64 | NEIGH_VAR_MAX | ||
| 65 | }; | ||
| 66 | |||
| 40 | struct neigh_parms { | 67 | struct neigh_parms { |
| 41 | #ifdef CONFIG_NET_NS | 68 | #ifdef CONFIG_NET_NS |
| 42 | struct net *net; | 69 | struct net *net; |
| @@ -53,22 +80,35 @@ struct neigh_parms { | |||
| 53 | atomic_t refcnt; | 80 | atomic_t refcnt; |
| 54 | struct rcu_head rcu_head; | 81 | struct rcu_head rcu_head; |
| 55 | 82 | ||
| 56 | int base_reachable_time; | ||
| 57 | int retrans_time; | ||
| 58 | int gc_staletime; | ||
| 59 | int reachable_time; | 83 | int reachable_time; |
| 60 | int delay_probe_time; | 84 | int data[NEIGH_VAR_DATA_MAX]; |
| 61 | 85 | DECLARE_BITMAP(data_state, NEIGH_VAR_DATA_MAX); | |
| 62 | int queue_len_bytes; | ||
| 63 | int ucast_probes; | ||
| 64 | int app_probes; | ||
| 65 | int mcast_probes; | ||
| 66 | int anycast_delay; | ||
| 67 | int proxy_delay; | ||
| 68 | int proxy_qlen; | ||
| 69 | int locktime; | ||
| 70 | }; | 86 | }; |
| 71 | 87 | ||
| 88 | static inline void neigh_var_set(struct neigh_parms *p, int index, int val) | ||
| 89 | { | ||
| 90 | set_bit(index, p->data_state); | ||
| 91 | p->data[index] = val; | ||
| 92 | } | ||
| 93 | |||
| 94 | #define NEIGH_VAR(p, attr) ((p)->data[NEIGH_VAR_ ## attr]) | ||
| 95 | |||
| 96 | /* In ndo_neigh_setup, NEIGH_VAR_INIT should be used. | ||
| 97 | * In other cases, NEIGH_VAR_SET should be used. | ||
| 98 | */ | ||
| 99 | #define NEIGH_VAR_INIT(p, attr, val) (NEIGH_VAR(p, attr) = val) | ||
| 100 | #define NEIGH_VAR_SET(p, attr, val) neigh_var_set(p, NEIGH_VAR_ ## attr, val) | ||
| 101 | |||
| 102 | static inline void neigh_parms_data_state_setall(struct neigh_parms *p) | ||
| 103 | { | ||
| 104 | bitmap_fill(p->data_state, NEIGH_VAR_DATA_MAX); | ||
| 105 | } | ||
| 106 | |||
| 107 | static inline void neigh_parms_data_state_cleanall(struct neigh_parms *p) | ||
| 108 | { | ||
| 109 | bitmap_zero(p->data_state, NEIGH_VAR_DATA_MAX); | ||
| 110 | } | ||
| 111 | |||
| 72 | struct neigh_statistics { | 112 | struct neigh_statistics { |
| 73 | unsigned long allocs; /* number of allocated neighs */ | 113 | unsigned long allocs; /* number of allocated neighs */ |
| 74 | unsigned long destroys; /* number of destroyed neighs */ | 114 | unsigned long destroys; /* number of destroyed neighs */ |
| @@ -180,6 +220,11 @@ struct neigh_table { | |||
| 180 | struct pneigh_entry **phash_buckets; | 220 | struct pneigh_entry **phash_buckets; |
| 181 | }; | 221 | }; |
| 182 | 222 | ||
| 223 | static inline int neigh_parms_family(struct neigh_parms *p) | ||
| 224 | { | ||
| 225 | return p->tbl->family; | ||
| 226 | } | ||
| 227 | |||
| 183 | #define NEIGH_PRIV_ALIGN sizeof(long long) | 228 | #define NEIGH_PRIV_ALIGN sizeof(long long) |
| 184 | #define NEIGH_ENTRY_SIZE(size) ALIGN((size), NEIGH_PRIV_ALIGN) | 229 | #define NEIGH_ENTRY_SIZE(size) ALIGN((size), NEIGH_PRIV_ALIGN) |
| 185 | 230 | ||
| @@ -212,6 +257,7 @@ static inline struct neighbour *neigh_create(struct neigh_table *tbl, | |||
| 212 | void neigh_destroy(struct neighbour *neigh); | 257 | void neigh_destroy(struct neighbour *neigh); |
| 213 | int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb); | 258 | int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb); |
| 214 | int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags); | 259 | int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags); |
| 260 | void __neigh_set_probe_once(struct neighbour *neigh); | ||
| 215 | void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); | 261 | void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); |
| 216 | int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); | 262 | int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); |
| 217 | int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb); | 263 | int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb); |
| @@ -274,8 +320,17 @@ void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *, | |||
| 274 | void *neigh_seq_next(struct seq_file *, void *, loff_t *); | 320 | void *neigh_seq_next(struct seq_file *, void *, loff_t *); |
| 275 | void neigh_seq_stop(struct seq_file *, void *); | 321 | void neigh_seq_stop(struct seq_file *, void *); |
| 276 | 322 | ||
| 323 | int neigh_proc_dointvec(struct ctl_table *ctl, int write, | ||
| 324 | void __user *buffer, size_t *lenp, loff_t *ppos); | ||
| 325 | int neigh_proc_dointvec_jiffies(struct ctl_table *ctl, int write, | ||
| 326 | void __user *buffer, | ||
| 327 | size_t *lenp, loff_t *ppos); | ||
| 328 | int neigh_proc_dointvec_ms_jiffies(struct ctl_table *ctl, int write, | ||
| 329 | void __user *buffer, | ||
| 330 | size_t *lenp, loff_t *ppos); | ||
| 331 | |||
| 277 | int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, | 332 | int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, |
| 278 | char *p_name, proc_handler *proc_handler); | 333 | proc_handler *proc_handler); |
| 279 | void neigh_sysctl_unregister(struct neigh_parms *p); | 334 | void neigh_sysctl_unregister(struct neigh_parms *p); |
| 280 | 335 | ||
| 281 | static inline void __neigh_parms_put(struct neigh_parms *parms) | 336 | static inline void __neigh_parms_put(struct neigh_parms *parms) |
diff --git a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h index 6c3d12e2949f..981c327374da 100644 --- a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h +++ b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h | |||
| @@ -19,6 +19,4 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp; | |||
| 19 | int nf_conntrack_ipv4_compat_init(void); | 19 | int nf_conntrack_ipv4_compat_init(void); |
| 20 | void nf_conntrack_ipv4_compat_fini(void); | 20 | void nf_conntrack_ipv4_compat_fini(void); |
| 21 | 21 | ||
| 22 | void need_ipv4_conntrack(void); | ||
| 23 | |||
| 24 | #endif /*_NF_CONNTRACK_IPV4_H*/ | 22 | #endif /*_NF_CONNTRACK_IPV4_H*/ |
diff --git a/include/net/netfilter/ipv4/nf_reject.h b/include/net/netfilter/ipv4/nf_reject.h new file mode 100644 index 000000000000..931fbf812171 --- /dev/null +++ b/include/net/netfilter/ipv4/nf_reject.h | |||
| @@ -0,0 +1,128 @@ | |||
| 1 | #ifndef _IPV4_NF_REJECT_H | ||
| 2 | #define _IPV4_NF_REJECT_H | ||
| 3 | |||
| 4 | #include <net/ip.h> | ||
| 5 | #include <net/tcp.h> | ||
| 6 | #include <net/route.h> | ||
| 7 | #include <net/dst.h> | ||
| 8 | |||
| 9 | static inline void nf_send_unreach(struct sk_buff *skb_in, int code) | ||
| 10 | { | ||
| 11 | icmp_send(skb_in, ICMP_DEST_UNREACH, code, 0); | ||
| 12 | } | ||
| 13 | |||
| 14 | /* Send RST reply */ | ||
| 15 | static void nf_send_reset(struct sk_buff *oldskb, int hook) | ||
| 16 | { | ||
| 17 | struct sk_buff *nskb; | ||
| 18 | const struct iphdr *oiph; | ||
| 19 | struct iphdr *niph; | ||
| 20 | const struct tcphdr *oth; | ||
| 21 | struct tcphdr _otcph, *tcph; | ||
| 22 | |||
| 23 | /* IP header checks: fragment. */ | ||
| 24 | if (ip_hdr(oldskb)->frag_off & htons(IP_OFFSET)) | ||
| 25 | return; | ||
| 26 | |||
| 27 | oth = skb_header_pointer(oldskb, ip_hdrlen(oldskb), | ||
| 28 | sizeof(_otcph), &_otcph); | ||
| 29 | if (oth == NULL) | ||
| 30 | return; | ||
| 31 | |||
| 32 | /* No RST for RST. */ | ||
| 33 | if (oth->rst) | ||
| 34 | return; | ||
| 35 | |||
| 36 | if (skb_rtable(oldskb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST)) | ||
| 37 | return; | ||
| 38 | |||
| 39 | /* Check checksum */ | ||
| 40 | if (nf_ip_checksum(oldskb, hook, ip_hdrlen(oldskb), IPPROTO_TCP)) | ||
| 41 | return; | ||
| 42 | oiph = ip_hdr(oldskb); | ||
| 43 | |||
| 44 | nskb = alloc_skb(sizeof(struct iphdr) + sizeof(struct tcphdr) + | ||
| 45 | LL_MAX_HEADER, GFP_ATOMIC); | ||
| 46 | if (!nskb) | ||
| 47 | return; | ||
| 48 | |||
| 49 | skb_reserve(nskb, LL_MAX_HEADER); | ||
| 50 | |||
| 51 | skb_reset_network_header(nskb); | ||
| 52 | niph = (struct iphdr *)skb_put(nskb, sizeof(struct iphdr)); | ||
| 53 | niph->version = 4; | ||
| 54 | niph->ihl = sizeof(struct iphdr) / 4; | ||
| 55 | niph->tos = 0; | ||
| 56 | niph->id = 0; | ||
| 57 | niph->frag_off = htons(IP_DF); | ||
| 58 | niph->protocol = IPPROTO_TCP; | ||
| 59 | niph->check = 0; | ||
| 60 | niph->saddr = oiph->daddr; | ||
| 61 | niph->daddr = oiph->saddr; | ||
| 62 | |||
| 63 | skb_reset_transport_header(nskb); | ||
| 64 | tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr)); | ||
| 65 | memset(tcph, 0, sizeof(*tcph)); | ||
| 66 | tcph->source = oth->dest; | ||
| 67 | tcph->dest = oth->source; | ||
| 68 | tcph->doff = sizeof(struct tcphdr) / 4; | ||
| 69 | |||
| 70 | if (oth->ack) | ||
| 71 | tcph->seq = oth->ack_seq; | ||
| 72 | else { | ||
| 73 | tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin + | ||
| 74 | oldskb->len - ip_hdrlen(oldskb) - | ||
| 75 | (oth->doff << 2)); | ||
| 76 | tcph->ack = 1; | ||
| 77 | } | ||
| 78 | |||
| 79 | tcph->rst = 1; | ||
| 80 | tcph->check = ~tcp_v4_check(sizeof(struct tcphdr), niph->saddr, | ||
| 81 | niph->daddr, 0); | ||
| 82 | nskb->ip_summed = CHECKSUM_PARTIAL; | ||
| 83 | nskb->csum_start = (unsigned char *)tcph - nskb->head; | ||
| 84 | nskb->csum_offset = offsetof(struct tcphdr, check); | ||
| 85 | |||
| 86 | /* ip_route_me_harder expects skb->dst to be set */ | ||
| 87 | skb_dst_set_noref(nskb, skb_dst(oldskb)); | ||
| 88 | |||
| 89 | nskb->protocol = htons(ETH_P_IP); | ||
| 90 | if (ip_route_me_harder(nskb, RTN_UNSPEC)) | ||
| 91 | goto free_nskb; | ||
| 92 | |||
| 93 | niph->ttl = ip4_dst_hoplimit(skb_dst(nskb)); | ||
| 94 | |||
| 95 | /* "Never happens" */ | ||
| 96 | if (nskb->len > dst_mtu(skb_dst(nskb))) | ||
| 97 | goto free_nskb; | ||
| 98 | |||
| 99 | nf_ct_attach(nskb, oldskb); | ||
| 100 | |||
| 101 | #ifdef CONFIG_BRIDGE_NETFILTER | ||
| 102 | /* If we use ip_local_out for bridged traffic, the MAC source on | ||
| 103 | * the RST will be ours, instead of the destination's. This confuses | ||
| 104 | * some routers/firewalls, and they drop the packet. So we need to | ||
| 105 | * build the eth header using the original destination's MAC as the | ||
| 106 | * source, and send the RST packet directly. | ||
| 107 | */ | ||
| 108 | if (oldskb->nf_bridge) { | ||
| 109 | struct ethhdr *oeth = eth_hdr(oldskb); | ||
| 110 | nskb->dev = oldskb->nf_bridge->physindev; | ||
| 111 | niph->tot_len = htons(nskb->len); | ||
| 112 | ip_send_check(niph); | ||
| 113 | if (dev_hard_header(nskb, nskb->dev, ntohs(nskb->protocol), | ||
| 114 | oeth->h_source, oeth->h_dest, nskb->len) < 0) | ||
| 115 | goto free_nskb; | ||
| 116 | dev_queue_xmit(nskb); | ||
| 117 | } else | ||
| 118 | #endif | ||
| 119 | ip_local_out(nskb); | ||
| 120 | |||
| 121 | return; | ||
| 122 | |||
| 123 | free_nskb: | ||
| 124 | kfree_skb(nskb); | ||
| 125 | } | ||
| 126 | |||
| 127 | |||
| 128 | #endif /* _IPV4_NF_REJECT_H */ | ||
diff --git a/include/net/netfilter/ipv6/nf_reject.h b/include/net/netfilter/ipv6/nf_reject.h new file mode 100644 index 000000000000..710d17ed70b4 --- /dev/null +++ b/include/net/netfilter/ipv6/nf_reject.h | |||
| @@ -0,0 +1,171 @@ | |||
| 1 | #ifndef _IPV6_NF_REJECT_H | ||
| 2 | #define _IPV6_NF_REJECT_H | ||
| 3 | |||
| 4 | #include <net/ipv6.h> | ||
| 5 | #include <net/ip6_route.h> | ||
| 6 | #include <net/ip6_fib.h> | ||
| 7 | #include <net/ip6_checksum.h> | ||
| 8 | #include <linux/netfilter_ipv6.h> | ||
| 9 | |||
| 10 | static inline void | ||
| 11 | nf_send_unreach6(struct net *net, struct sk_buff *skb_in, unsigned char code, | ||
| 12 | unsigned int hooknum) | ||
| 13 | { | ||
| 14 | if (hooknum == NF_INET_LOCAL_OUT && skb_in->dev == NULL) | ||
| 15 | skb_in->dev = net->loopback_dev; | ||
| 16 | |||
| 17 | icmpv6_send(skb_in, ICMPV6_DEST_UNREACH, code, 0); | ||
| 18 | } | ||
| 19 | |||
| 20 | /* Send RST reply */ | ||
| 21 | static void nf_send_reset6(struct net *net, struct sk_buff *oldskb, int hook) | ||
| 22 | { | ||
| 23 | struct sk_buff *nskb; | ||
| 24 | struct tcphdr otcph, *tcph; | ||
| 25 | unsigned int otcplen, hh_len; | ||
| 26 | int tcphoff, needs_ack; | ||
| 27 | const struct ipv6hdr *oip6h = ipv6_hdr(oldskb); | ||
| 28 | struct ipv6hdr *ip6h; | ||
| 29 | #define DEFAULT_TOS_VALUE 0x0U | ||
| 30 | const __u8 tclass = DEFAULT_TOS_VALUE; | ||
| 31 | struct dst_entry *dst = NULL; | ||
| 32 | u8 proto; | ||
| 33 | __be16 frag_off; | ||
| 34 | struct flowi6 fl6; | ||
| 35 | |||
| 36 | if ((!(ipv6_addr_type(&oip6h->saddr) & IPV6_ADDR_UNICAST)) || | ||
| 37 | (!(ipv6_addr_type(&oip6h->daddr) & IPV6_ADDR_UNICAST))) { | ||
| 38 | pr_debug("addr is not unicast.\n"); | ||
| 39 | return; | ||
| 40 | } | ||
| 41 | |||
| 42 | proto = oip6h->nexthdr; | ||
| 43 | tcphoff = ipv6_skip_exthdr(oldskb, ((u8*)(oip6h+1) - oldskb->data), &proto, &frag_off); | ||
| 44 | |||
| 45 | if ((tcphoff < 0) || (tcphoff > oldskb->len)) { | ||
| 46 | pr_debug("Cannot get TCP header.\n"); | ||
| 47 | return; | ||
| 48 | } | ||
| 49 | |||
| 50 | otcplen = oldskb->len - tcphoff; | ||
| 51 | |||
| 52 | /* IP header checks: fragment, too short. */ | ||
| 53 | if (proto != IPPROTO_TCP || otcplen < sizeof(struct tcphdr)) { | ||
| 54 | pr_debug("proto(%d) != IPPROTO_TCP, " | ||
| 55 | "or too short. otcplen = %d\n", | ||
| 56 | proto, otcplen); | ||
| 57 | return; | ||
| 58 | } | ||
| 59 | |||
| 60 | if (skb_copy_bits(oldskb, tcphoff, &otcph, sizeof(struct tcphdr))) | ||
| 61 | BUG(); | ||
| 62 | |||
| 63 | /* No RST for RST. */ | ||
| 64 | if (otcph.rst) { | ||
| 65 | pr_debug("RST is set\n"); | ||
| 66 | return; | ||
| 67 | } | ||
| 68 | |||
| 69 | /* Check checksum. */ | ||
| 70 | if (nf_ip6_checksum(oldskb, hook, tcphoff, IPPROTO_TCP)) { | ||
| 71 | pr_debug("TCP checksum is invalid\n"); | ||
| 72 | return; | ||
| 73 | } | ||
| 74 | |||
| 75 | memset(&fl6, 0, sizeof(fl6)); | ||
| 76 | fl6.flowi6_proto = IPPROTO_TCP; | ||
| 77 | fl6.saddr = oip6h->daddr; | ||
| 78 | fl6.daddr = oip6h->saddr; | ||
| 79 | fl6.fl6_sport = otcph.dest; | ||
| 80 | fl6.fl6_dport = otcph.source; | ||
| 81 | security_skb_classify_flow(oldskb, flowi6_to_flowi(&fl6)); | ||
| 82 | dst = ip6_route_output(net, NULL, &fl6); | ||
| 83 | if (dst == NULL || dst->error) { | ||
| 84 | dst_release(dst); | ||
| 85 | return; | ||
| 86 | } | ||
| 87 | dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0); | ||
| 88 | if (IS_ERR(dst)) | ||
| 89 | return; | ||
| 90 | |||
| 91 | hh_len = (dst->dev->hard_header_len + 15)&~15; | ||
| 92 | nskb = alloc_skb(hh_len + 15 + dst->header_len + sizeof(struct ipv6hdr) | ||
| 93 | + sizeof(struct tcphdr) + dst->trailer_len, | ||
| 94 | GFP_ATOMIC); | ||
| 95 | |||
| 96 | if (!nskb) { | ||
| 97 | net_dbg_ratelimited("cannot alloc skb\n"); | ||
| 98 | dst_release(dst); | ||
| 99 | return; | ||
| 100 | } | ||
| 101 | |||
| 102 | skb_dst_set(nskb, dst); | ||
| 103 | |||
| 104 | skb_reserve(nskb, hh_len + dst->header_len); | ||
| 105 | |||
| 106 | skb_put(nskb, sizeof(struct ipv6hdr)); | ||
| 107 | skb_reset_network_header(nskb); | ||
| 108 | ip6h = ipv6_hdr(nskb); | ||
| 109 | ip6_flow_hdr(ip6h, tclass, 0); | ||
| 110 | ip6h->hop_limit = ip6_dst_hoplimit(dst); | ||
| 111 | ip6h->nexthdr = IPPROTO_TCP; | ||
| 112 | ip6h->saddr = oip6h->daddr; | ||
| 113 | ip6h->daddr = oip6h->saddr; | ||
| 114 | |||
| 115 | skb_reset_transport_header(nskb); | ||
| 116 | tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr)); | ||
| 117 | /* Truncate to length (no data) */ | ||
| 118 | tcph->doff = sizeof(struct tcphdr)/4; | ||
| 119 | tcph->source = otcph.dest; | ||
| 120 | tcph->dest = otcph.source; | ||
| 121 | |||
| 122 | if (otcph.ack) { | ||
| 123 | needs_ack = 0; | ||
| 124 | tcph->seq = otcph.ack_seq; | ||
| 125 | tcph->ack_seq = 0; | ||
| 126 | } else { | ||
| 127 | needs_ack = 1; | ||
| 128 | tcph->ack_seq = htonl(ntohl(otcph.seq) + otcph.syn + otcph.fin | ||
| 129 | + otcplen - (otcph.doff<<2)); | ||
| 130 | tcph->seq = 0; | ||
| 131 | } | ||
| 132 | |||
| 133 | /* Reset flags */ | ||
| 134 | ((u_int8_t *)tcph)[13] = 0; | ||
| 135 | tcph->rst = 1; | ||
| 136 | tcph->ack = needs_ack; | ||
| 137 | tcph->window = 0; | ||
| 138 | tcph->urg_ptr = 0; | ||
| 139 | tcph->check = 0; | ||
| 140 | |||
| 141 | /* Adjust TCP checksum */ | ||
| 142 | tcph->check = csum_ipv6_magic(&ipv6_hdr(nskb)->saddr, | ||
| 143 | &ipv6_hdr(nskb)->daddr, | ||
| 144 | sizeof(struct tcphdr), IPPROTO_TCP, | ||
| 145 | csum_partial(tcph, | ||
| 146 | sizeof(struct tcphdr), 0)); | ||
| 147 | |||
| 148 | nf_ct_attach(nskb, oldskb); | ||
| 149 | |||
| 150 | #ifdef CONFIG_BRIDGE_NETFILTER | ||
| 151 | /* If we use ip6_local_out for bridged traffic, the MAC source on | ||
| 152 | * the RST will be ours, instead of the destination's. This confuses | ||
| 153 | * some routers/firewalls, and they drop the packet. So we need to | ||
| 154 | * build the eth header using the original destination's MAC as the | ||
| 155 | * source, and send the RST packet directly. | ||
| 156 | */ | ||
| 157 | if (oldskb->nf_bridge) { | ||
| 158 | struct ethhdr *oeth = eth_hdr(oldskb); | ||
| 159 | nskb->dev = oldskb->nf_bridge->physindev; | ||
| 160 | nskb->protocol = htons(ETH_P_IPV6); | ||
| 161 | ip6h->payload_len = htons(sizeof(struct tcphdr)); | ||
| 162 | if (dev_hard_header(nskb, nskb->dev, ntohs(nskb->protocol), | ||
| 163 | oeth->h_source, oeth->h_dest, nskb->len) < 0) | ||
| 164 | return; | ||
| 165 | dev_queue_xmit(nskb); | ||
| 166 | } else | ||
| 167 | #endif | ||
| 168 | ip6_local_out(nskb); | ||
| 169 | } | ||
| 170 | |||
| 171 | #endif /* _IPV6_NF_REJECT_H */ | ||
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h index 3efab704b7eb..adc1fa3dd7ab 100644 --- a/include/net/netfilter/nf_conntrack_l3proto.h +++ b/include/net/netfilter/nf_conntrack_l3proto.h | |||
| @@ -87,7 +87,6 @@ int nf_ct_l3proto_register(struct nf_conntrack_l3proto *proto); | |||
| 87 | void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto); | 87 | void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto); |
| 88 | 88 | ||
| 89 | struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); | 89 | struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); |
| 90 | void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); | ||
| 91 | 90 | ||
| 92 | /* Existing built-in protocols */ | 91 | /* Existing built-in protocols */ |
| 93 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; | 92 | extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; |
diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h index c1d5b3e34a21..84a53d780306 100644 --- a/include/net/netfilter/nf_queue.h +++ b/include/net/netfilter/nf_queue.h | |||
| @@ -1,6 +1,10 @@ | |||
| 1 | #ifndef _NF_QUEUE_H | 1 | #ifndef _NF_QUEUE_H |
| 2 | #define _NF_QUEUE_H | 2 | #define _NF_QUEUE_H |
| 3 | 3 | ||
| 4 | #include <linux/ip.h> | ||
| 5 | #include <linux/ipv6.h> | ||
| 6 | #include <linux/jhash.h> | ||
| 7 | |||
| 4 | /* Each queued (to userspace) skbuff has one of these. */ | 8 | /* Each queued (to userspace) skbuff has one of these. */ |
| 5 | struct nf_queue_entry { | 9 | struct nf_queue_entry { |
| 6 | struct list_head list; | 10 | struct list_head list; |
| @@ -33,4 +37,62 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict); | |||
| 33 | bool nf_queue_entry_get_refs(struct nf_queue_entry *entry); | 37 | bool nf_queue_entry_get_refs(struct nf_queue_entry *entry); |
| 34 | void nf_queue_entry_release_refs(struct nf_queue_entry *entry); | 38 | void nf_queue_entry_release_refs(struct nf_queue_entry *entry); |
| 35 | 39 | ||
| 40 | static inline void init_hashrandom(u32 *jhash_initval) | ||
| 41 | { | ||
| 42 | while (*jhash_initval == 0) | ||
| 43 | *jhash_initval = prandom_u32(); | ||
| 44 | } | ||
| 45 | |||
| 46 | static inline u32 hash_v4(const struct sk_buff *skb, u32 jhash_initval) | ||
| 47 | { | ||
| 48 | const struct iphdr *iph = ip_hdr(skb); | ||
| 49 | |||
| 50 | /* packets in either direction go into same queue */ | ||
| 51 | if ((__force u32)iph->saddr < (__force u32)iph->daddr) | ||
| 52 | return jhash_3words((__force u32)iph->saddr, | ||
| 53 | (__force u32)iph->daddr, iph->protocol, jhash_initval); | ||
| 54 | |||
| 55 | return jhash_3words((__force u32)iph->daddr, | ||
| 56 | (__force u32)iph->saddr, iph->protocol, jhash_initval); | ||
| 57 | } | ||
| 58 | |||
| 59 | #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) | ||
| 60 | static inline u32 hash_v6(const struct sk_buff *skb, u32 jhash_initval) | ||
| 61 | { | ||
| 62 | const struct ipv6hdr *ip6h = ipv6_hdr(skb); | ||
| 63 | u32 a, b, c; | ||
| 64 | |||
| 65 | if ((__force u32)ip6h->saddr.s6_addr32[3] < | ||
| 66 | (__force u32)ip6h->daddr.s6_addr32[3]) { | ||
| 67 | a = (__force u32) ip6h->saddr.s6_addr32[3]; | ||
| 68 | b = (__force u32) ip6h->daddr.s6_addr32[3]; | ||
| 69 | } else { | ||
| 70 | b = (__force u32) ip6h->saddr.s6_addr32[3]; | ||
| 71 | a = (__force u32) ip6h->daddr.s6_addr32[3]; | ||
| 72 | } | ||
| 73 | |||
| 74 | if ((__force u32)ip6h->saddr.s6_addr32[1] < | ||
| 75 | (__force u32)ip6h->daddr.s6_addr32[1]) | ||
| 76 | c = (__force u32) ip6h->saddr.s6_addr32[1]; | ||
| 77 | else | ||
| 78 | c = (__force u32) ip6h->daddr.s6_addr32[1]; | ||
| 79 | |||
| 80 | return jhash_3words(a, b, c, jhash_initval); | ||
| 81 | } | ||
| 82 | #endif | ||
| 83 | |||
| 84 | static inline u32 | ||
| 85 | nfqueue_hash(const struct sk_buff *skb, u16 queue, u16 queues_total, u8 family, | ||
| 86 | u32 jhash_initval) | ||
| 87 | { | ||
| 88 | if (family == NFPROTO_IPV4) | ||
| 89 | queue += ((u64) hash_v4(skb, jhash_initval) * queues_total) >> 32; | ||
| 90 | #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES) | ||
| 91 | else if (family == NFPROTO_IPV6) | ||
| 92 | queue += ((u64) hash_v6(skb, jhash_initval) * queues_total) >> 32; | ||
| 93 | #endif | ||
| 94 | |||
| 95 | return queue; | ||
| 96 | } | ||
| 97 | |||
| 36 | #endif /* _NF_QUEUE_H */ | 98 | #endif /* _NF_QUEUE_H */ |
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index 5a91abfc0c30..57c8ff7955df 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h | |||
| @@ -13,9 +13,10 @@ struct nft_pktinfo { | |||
| 13 | struct sk_buff *skb; | 13 | struct sk_buff *skb; |
| 14 | const struct net_device *in; | 14 | const struct net_device *in; |
| 15 | const struct net_device *out; | 15 | const struct net_device *out; |
| 16 | u8 hooknum; | 16 | const struct nf_hook_ops *ops; |
| 17 | u8 nhoff; | 17 | u8 nhoff; |
| 18 | u8 thoff; | 18 | u8 thoff; |
| 19 | u8 tprot; | ||
| 19 | /* for x_tables compatibility */ | 20 | /* for x_tables compatibility */ |
| 20 | struct xt_action_param xt; | 21 | struct xt_action_param xt; |
| 21 | }; | 22 | }; |
| @@ -29,7 +30,8 @@ static inline void nft_set_pktinfo(struct nft_pktinfo *pkt, | |||
| 29 | pkt->skb = skb; | 30 | pkt->skb = skb; |
| 30 | pkt->in = pkt->xt.in = in; | 31 | pkt->in = pkt->xt.in = in; |
| 31 | pkt->out = pkt->xt.out = out; | 32 | pkt->out = pkt->xt.out = out; |
| 32 | pkt->hooknum = pkt->xt.hooknum = ops->hooknum; | 33 | pkt->ops = ops; |
| 34 | pkt->xt.hooknum = ops->hooknum; | ||
| 33 | pkt->xt.family = ops->pf; | 35 | pkt->xt.family = ops->pf; |
| 34 | } | 36 | } |
| 35 | 37 | ||
| @@ -421,6 +423,8 @@ struct nft_stats { | |||
| 421 | u64 pkts; | 423 | u64 pkts; |
| 422 | }; | 424 | }; |
| 423 | 425 | ||
| 426 | #define NFT_HOOK_OPS_MAX 2 | ||
| 427 | |||
| 424 | /** | 428 | /** |
| 425 | * struct nft_base_chain - nf_tables base chain | 429 | * struct nft_base_chain - nf_tables base chain |
| 426 | * | 430 | * |
| @@ -431,8 +435,8 @@ struct nft_stats { | |||
| 431 | * @chain: the chain | 435 | * @chain: the chain |
| 432 | */ | 436 | */ |
| 433 | struct nft_base_chain { | 437 | struct nft_base_chain { |
| 434 | struct nf_hook_ops ops; | 438 | struct nf_hook_ops ops[NFT_HOOK_OPS_MAX]; |
| 435 | enum nft_chain_type type; | 439 | const struct nf_chain_type *type; |
| 436 | u8 policy; | 440 | u8 policy; |
| 437 | struct nft_stats __percpu *stats; | 441 | struct nft_stats __percpu *stats; |
| 438 | struct nft_chain chain; | 442 | struct nft_chain chain; |
| @@ -443,8 +447,8 @@ static inline struct nft_base_chain *nft_base_chain(const struct nft_chain *chai | |||
| 443 | return container_of(chain, struct nft_base_chain, chain); | 447 | return container_of(chain, struct nft_base_chain, chain); |
| 444 | } | 448 | } |
| 445 | 449 | ||
| 446 | unsigned int nft_do_chain_pktinfo(struct nft_pktinfo *pkt, | 450 | unsigned int nft_do_chain(struct nft_pktinfo *pkt, |
| 447 | const struct nf_hook_ops *ops); | 451 | const struct nf_hook_ops *ops); |
| 448 | 452 | ||
| 449 | /** | 453 | /** |
| 450 | * struct nft_table - nf_tables table | 454 | * struct nft_table - nf_tables table |
| @@ -475,6 +479,8 @@ struct nft_table { | |||
| 475 | * @nhooks: number of hooks in this family | 479 | * @nhooks: number of hooks in this family |
| 476 | * @owner: module owner | 480 | * @owner: module owner |
| 477 | * @tables: used internally | 481 | * @tables: used internally |
| 482 | * @nops: number of hook ops in this family | ||
| 483 | * @hook_ops_init: initialization function for chain hook ops | ||
| 478 | * @hooks: hookfn overrides for packet validation | 484 | * @hooks: hookfn overrides for packet validation |
| 479 | */ | 485 | */ |
| 480 | struct nft_af_info { | 486 | struct nft_af_info { |
| @@ -483,23 +489,36 @@ struct nft_af_info { | |||
| 483 | unsigned int nhooks; | 489 | unsigned int nhooks; |
| 484 | struct module *owner; | 490 | struct module *owner; |
| 485 | struct list_head tables; | 491 | struct list_head tables; |
| 492 | unsigned int nops; | ||
| 493 | void (*hook_ops_init)(struct nf_hook_ops *, | ||
| 494 | unsigned int); | ||
| 486 | nf_hookfn *hooks[NF_MAX_HOOKS]; | 495 | nf_hookfn *hooks[NF_MAX_HOOKS]; |
| 487 | }; | 496 | }; |
| 488 | 497 | ||
| 489 | int nft_register_afinfo(struct net *, struct nft_af_info *); | 498 | int nft_register_afinfo(struct net *, struct nft_af_info *); |
| 490 | void nft_unregister_afinfo(struct nft_af_info *); | 499 | void nft_unregister_afinfo(struct nft_af_info *); |
| 491 | 500 | ||
| 501 | /** | ||
| 502 | * struct nf_chain_type - nf_tables chain type info | ||
| 503 | * | ||
| 504 | * @name: name of the type | ||
| 505 | * @type: numeric identifier | ||
| 506 | * @family: address family | ||
| 507 | * @owner: module owner | ||
| 508 | * @hook_mask: mask of valid hooks | ||
| 509 | * @hooks: hookfn overrides | ||
| 510 | */ | ||
| 492 | struct nf_chain_type { | 511 | struct nf_chain_type { |
| 493 | unsigned int hook_mask; | 512 | const char *name; |
| 494 | const char *name; | 513 | enum nft_chain_type type; |
| 495 | enum nft_chain_type type; | 514 | int family; |
| 496 | nf_hookfn *fn[NF_MAX_HOOKS]; | 515 | struct module *owner; |
| 497 | struct module *me; | 516 | unsigned int hook_mask; |
| 498 | int family; | 517 | nf_hookfn *hooks[NF_MAX_HOOKS]; |
| 499 | }; | 518 | }; |
| 500 | 519 | ||
| 501 | int nft_register_chain_type(struct nf_chain_type *); | 520 | int nft_register_chain_type(const struct nf_chain_type *); |
| 502 | void nft_unregister_chain_type(struct nf_chain_type *); | 521 | void nft_unregister_chain_type(const struct nf_chain_type *); |
| 503 | 522 | ||
| 504 | int nft_register_expr(struct nft_expr_type *); | 523 | int nft_register_expr(struct nft_expr_type *); |
| 505 | void nft_unregister_expr(struct nft_expr_type *); | 524 | void nft_unregister_expr(struct nft_expr_type *); |
diff --git a/include/net/netfilter/nf_tables_ipv4.h b/include/net/netfilter/nf_tables_ipv4.h index 1be1c2c197ee..cba143fbd2e4 100644 --- a/include/net/netfilter/nf_tables_ipv4.h +++ b/include/net/netfilter/nf_tables_ipv4.h | |||
| @@ -15,9 +15,12 @@ nft_set_pktinfo_ipv4(struct nft_pktinfo *pkt, | |||
| 15 | 15 | ||
| 16 | nft_set_pktinfo(pkt, ops, skb, in, out); | 16 | nft_set_pktinfo(pkt, ops, skb, in, out); |
| 17 | 17 | ||
| 18 | pkt->xt.thoff = ip_hdrlen(pkt->skb); | ||
| 19 | ip = ip_hdr(pkt->skb); | 18 | ip = ip_hdr(pkt->skb); |
| 19 | pkt->tprot = ip->protocol; | ||
| 20 | pkt->xt.thoff = ip_hdrlen(pkt->skb); | ||
| 20 | pkt->xt.fragoff = ntohs(ip->frag_off) & IP_OFFSET; | 21 | pkt->xt.fragoff = ntohs(ip->frag_off) & IP_OFFSET; |
| 21 | } | 22 | } |
| 22 | 23 | ||
| 24 | extern struct nft_af_info nft_af_ipv4; | ||
| 25 | |||
| 23 | #endif | 26 | #endif |
diff --git a/include/net/netfilter/nf_tables_ipv6.h b/include/net/netfilter/nf_tables_ipv6.h index 4a9b88a65963..74d976137658 100644 --- a/include/net/netfilter/nf_tables_ipv6.h +++ b/include/net/netfilter/nf_tables_ipv6.h | |||
| @@ -21,10 +21,13 @@ nft_set_pktinfo_ipv6(struct nft_pktinfo *pkt, | |||
| 21 | if (protohdr < 0) | 21 | if (protohdr < 0) |
| 22 | return -1; | 22 | return -1; |
| 23 | 23 | ||
| 24 | pkt->tprot = protohdr; | ||
| 24 | pkt->xt.thoff = thoff; | 25 | pkt->xt.thoff = thoff; |
| 25 | pkt->xt.fragoff = frag_off; | 26 | pkt->xt.fragoff = frag_off; |
| 26 | 27 | ||
| 27 | return 0; | 28 | return 0; |
| 28 | } | 29 | } |
| 29 | 30 | ||
| 31 | extern struct nft_af_info nft_af_ipv6; | ||
| 32 | |||
| 30 | #endif | 33 | #endif |
diff --git a/include/net/netlabel.h b/include/net/netlabel.h index 2c95d55f7914..4fe018c48ed9 100644 --- a/include/net/netlabel.h +++ b/include/net/netlabel.h | |||
| @@ -22,8 +22,7 @@ | |||
| 22 | * the GNU General Public License for more details. | 22 | * the GNU General Public License for more details. |
| 23 | * | 23 | * |
| 24 | * You should have received a copy of the GNU General Public License | 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, write to the Free Software | 25 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 27 | * | 26 | * |
| 28 | */ | 27 | */ |
| 29 | 28 | ||
| @@ -111,7 +110,7 @@ struct cipso_v4_doi; | |||
| 111 | struct netlbl_audit { | 110 | struct netlbl_audit { |
| 112 | u32 secid; | 111 | u32 secid; |
| 113 | kuid_t loginuid; | 112 | kuid_t loginuid; |
| 114 | u32 sessionid; | 113 | unsigned int sessionid; |
| 115 | }; | 114 | }; |
| 116 | 115 | ||
| 117 | /* | 116 | /* |
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index c9c0c538b68b..fbcc7fa536dc 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
| @@ -65,6 +65,23 @@ struct nf_ip_net { | |||
| 65 | struct netns_ct { | 65 | struct netns_ct { |
| 66 | atomic_t count; | 66 | atomic_t count; |
| 67 | unsigned int expect_count; | 67 | unsigned int expect_count; |
| 68 | #ifdef CONFIG_SYSCTL | ||
| 69 | struct ctl_table_header *sysctl_header; | ||
| 70 | struct ctl_table_header *acct_sysctl_header; | ||
| 71 | struct ctl_table_header *tstamp_sysctl_header; | ||
| 72 | struct ctl_table_header *event_sysctl_header; | ||
| 73 | struct ctl_table_header *helper_sysctl_header; | ||
| 74 | #endif | ||
| 75 | char *slabname; | ||
| 76 | unsigned int sysctl_log_invalid; /* Log invalid packets */ | ||
| 77 | unsigned int sysctl_events_retry_timeout; | ||
| 78 | int sysctl_events; | ||
| 79 | int sysctl_acct; | ||
| 80 | int sysctl_auto_assign_helper; | ||
| 81 | bool auto_assign_helper_warned; | ||
| 82 | int sysctl_tstamp; | ||
| 83 | int sysctl_checksum; | ||
| 84 | |||
| 68 | unsigned int htable_size; | 85 | unsigned int htable_size; |
| 69 | struct kmem_cache *nf_conntrack_cachep; | 86 | struct kmem_cache *nf_conntrack_cachep; |
| 70 | struct hlist_nulls_head *hash; | 87 | struct hlist_nulls_head *hash; |
| @@ -75,14 +92,6 @@ struct netns_ct { | |||
| 75 | struct ip_conntrack_stat __percpu *stat; | 92 | struct ip_conntrack_stat __percpu *stat; |
| 76 | struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; | 93 | struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; |
| 77 | struct nf_exp_event_notifier __rcu *nf_expect_event_cb; | 94 | struct nf_exp_event_notifier __rcu *nf_expect_event_cb; |
| 78 | int sysctl_events; | ||
| 79 | unsigned int sysctl_events_retry_timeout; | ||
| 80 | int sysctl_acct; | ||
| 81 | int sysctl_tstamp; | ||
| 82 | int sysctl_checksum; | ||
| 83 | unsigned int sysctl_log_invalid; /* Log invalid packets */ | ||
| 84 | int sysctl_auto_assign_helper; | ||
| 85 | bool auto_assign_helper_warned; | ||
| 86 | struct nf_ip_net nf_ct_proto; | 95 | struct nf_ip_net nf_ct_proto; |
| 87 | #if defined(CONFIG_NF_CONNTRACK_LABELS) | 96 | #if defined(CONFIG_NF_CONNTRACK_LABELS) |
| 88 | unsigned int labels_used; | 97 | unsigned int labels_used; |
| @@ -92,13 +101,5 @@ struct netns_ct { | |||
| 92 | struct hlist_head *nat_bysource; | 101 | struct hlist_head *nat_bysource; |
| 93 | unsigned int nat_htable_size; | 102 | unsigned int nat_htable_size; |
| 94 | #endif | 103 | #endif |
| 95 | #ifdef CONFIG_SYSCTL | ||
| 96 | struct ctl_table_header *sysctl_header; | ||
| 97 | struct ctl_table_header *acct_sysctl_header; | ||
| 98 | struct ctl_table_header *tstamp_sysctl_header; | ||
| 99 | struct ctl_table_header *event_sysctl_header; | ||
| 100 | struct ctl_table_header *helper_sysctl_header; | ||
| 101 | #endif | ||
| 102 | char *slabname; | ||
| 103 | }; | 104 | }; |
| 104 | #endif | 105 | #endif |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index ee520cba2ec2..80f500a29498 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
| @@ -69,6 +69,8 @@ struct netns_ipv4 { | |||
| 69 | struct local_ports sysctl_local_ports; | 69 | struct local_ports sysctl_local_ports; |
| 70 | 70 | ||
| 71 | int sysctl_tcp_ecn; | 71 | int sysctl_tcp_ecn; |
| 72 | int sysctl_ip_no_pmtu_disc; | ||
| 73 | int sysctl_ip_fwd_use_pmtu; | ||
| 72 | 74 | ||
| 73 | kgid_t sysctl_ping_group_range[2]; | 75 | kgid_t sysctl_ping_group_range[2]; |
| 74 | 76 | ||
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index 0fb2401197c5..21edaf1f7916 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
| @@ -27,7 +27,9 @@ struct netns_sysctl_ipv6 { | |||
| 27 | int ip6_rt_gc_elasticity; | 27 | int ip6_rt_gc_elasticity; |
| 28 | int ip6_rt_mtu_expires; | 28 | int ip6_rt_mtu_expires; |
| 29 | int ip6_rt_min_advmss; | 29 | int ip6_rt_min_advmss; |
| 30 | int flowlabel_consistency; | ||
| 30 | int icmpv6_time; | 31 | int icmpv6_time; |
| 32 | int anycast_src_echo_reply; | ||
| 31 | }; | 33 | }; |
| 32 | 34 | ||
| 33 | struct netns_ipv6 { | 35 | struct netns_ipv6 { |
diff --git a/include/net/netns/nftables.h b/include/net/netns/nftables.h index 15d056d534e3..26a394cb91a8 100644 --- a/include/net/netns/nftables.h +++ b/include/net/netns/nftables.h | |||
| @@ -10,6 +10,7 @@ struct netns_nftables { | |||
| 10 | struct list_head commit_list; | 10 | struct list_head commit_list; |
| 11 | struct nft_af_info *ipv4; | 11 | struct nft_af_info *ipv4; |
| 12 | struct nft_af_info *ipv6; | 12 | struct nft_af_info *ipv6; |
| 13 | struct nft_af_info *inet; | ||
| 13 | struct nft_af_info *arp; | 14 | struct nft_af_info *arp; |
| 14 | struct nft_af_info *bridge; | 15 | struct nft_af_info *bridge; |
| 15 | u8 gencursor; | 16 | u8 gencursor; |
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h index 5299e69a32af..1006a265beb3 100644 --- a/include/net/netns/xfrm.h +++ b/include/net/netns/xfrm.h | |||
| @@ -33,8 +33,6 @@ struct netns_xfrm { | |||
| 33 | struct hlist_head state_gc_list; | 33 | struct hlist_head state_gc_list; |
| 34 | struct work_struct state_gc_work; | 34 | struct work_struct state_gc_work; |
| 35 | 35 | ||
| 36 | wait_queue_head_t km_waitq; | ||
| 37 | |||
| 38 | struct list_head policy_all; | 36 | struct list_head policy_all; |
| 39 | struct hlist_head *policy_byidx; | 37 | struct hlist_head *policy_byidx; |
| 40 | unsigned int policy_idx_hmask; | 38 | unsigned int policy_idx_hmask; |
| @@ -59,6 +57,10 @@ struct netns_xfrm { | |||
| 59 | #if IS_ENABLED(CONFIG_IPV6) | 57 | #if IS_ENABLED(CONFIG_IPV6) |
| 60 | struct dst_ops xfrm6_dst_ops; | 58 | struct dst_ops xfrm6_dst_ops; |
| 61 | #endif | 59 | #endif |
| 60 | spinlock_t xfrm_state_lock; | ||
| 61 | spinlock_t xfrm_policy_sk_bundle_lock; | ||
| 62 | rwlock_t xfrm_policy_lock; | ||
| 63 | struct mutex xfrm_cfg_mutex; | ||
| 62 | }; | 64 | }; |
| 63 | 65 | ||
| 64 | #endif | 66 | #endif |
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h index 099d02782e22..dafc09f0fdbc 100644 --- a/include/net/netprio_cgroup.h +++ b/include/net/netprio_cgroup.h | |||
| @@ -13,12 +13,12 @@ | |||
| 13 | 13 | ||
| 14 | #ifndef _NETPRIO_CGROUP_H | 14 | #ifndef _NETPRIO_CGROUP_H |
| 15 | #define _NETPRIO_CGROUP_H | 15 | #define _NETPRIO_CGROUP_H |
| 16 | |||
| 16 | #include <linux/cgroup.h> | 17 | #include <linux/cgroup.h> |
| 17 | #include <linux/hardirq.h> | 18 | #include <linux/hardirq.h> |
| 18 | #include <linux/rcupdate.h> | 19 | #include <linux/rcupdate.h> |
| 19 | 20 | ||
| 20 | 21 | #if IS_ENABLED(CONFIG_CGROUP_NET_PRIO) | |
| 21 | #if IS_ENABLED(CONFIG_NETPRIO_CGROUP) | ||
| 22 | struct netprio_map { | 22 | struct netprio_map { |
| 23 | struct rcu_head rcu; | 23 | struct rcu_head rcu; |
| 24 | u32 priomap_len; | 24 | u32 priomap_len; |
| @@ -27,8 +27,7 @@ struct netprio_map { | |||
| 27 | 27 | ||
| 28 | void sock_update_netprioidx(struct sock *sk); | 28 | void sock_update_netprioidx(struct sock *sk); |
| 29 | 29 | ||
| 30 | #if IS_BUILTIN(CONFIG_NETPRIO_CGROUP) | 30 | #if IS_BUILTIN(CONFIG_CGROUP_NET_PRIO) |
| 31 | |||
| 32 | static inline u32 task_netprioidx(struct task_struct *p) | 31 | static inline u32 task_netprioidx(struct task_struct *p) |
| 33 | { | 32 | { |
| 34 | struct cgroup_subsys_state *css; | 33 | struct cgroup_subsys_state *css; |
| @@ -40,9 +39,7 @@ static inline u32 task_netprioidx(struct task_struct *p) | |||
| 40 | rcu_read_unlock(); | 39 | rcu_read_unlock(); |
| 41 | return idx; | 40 | return idx; |
| 42 | } | 41 | } |
| 43 | 42 | #elif IS_MODULE(CONFIG_CGROUP_NET_PRIO) | |
| 44 | #elif IS_MODULE(CONFIG_NETPRIO_CGROUP) | ||
| 45 | |||
| 46 | static inline u32 task_netprioidx(struct task_struct *p) | 43 | static inline u32 task_netprioidx(struct task_struct *p) |
| 47 | { | 44 | { |
| 48 | struct cgroup_subsys_state *css; | 45 | struct cgroup_subsys_state *css; |
| @@ -56,9 +53,7 @@ static inline u32 task_netprioidx(struct task_struct *p) | |||
| 56 | return idx; | 53 | return idx; |
| 57 | } | 54 | } |
| 58 | #endif | 55 | #endif |
| 59 | 56 | #else /* !CONFIG_CGROUP_NET_PRIO */ | |
| 60 | #else /* !CONFIG_NETPRIO_CGROUP */ | ||
| 61 | |||
| 62 | static inline u32 task_netprioidx(struct task_struct *p) | 57 | static inline u32 task_netprioidx(struct task_struct *p) |
| 63 | { | 58 | { |
| 64 | return 0; | 59 | return 0; |
| @@ -66,6 +61,5 @@ static inline u32 task_netprioidx(struct task_struct *p) | |||
| 66 | 61 | ||
| 67 | #define sock_update_netprioidx(sk) | 62 | #define sock_update_netprioidx(sk) |
| 68 | 63 | ||
| 69 | #endif /* CONFIG_NETPRIO_CGROUP */ | 64 | #endif /* CONFIG_CGROUP_NET_PRIO */ |
| 70 | |||
| 71 | #endif /* _NET_CLS_CGROUP_H */ | 65 | #endif /* _NET_CLS_CGROUP_H */ |
diff --git a/include/net/nfc/digital.h b/include/net/nfc/digital.h index 36acecd5f06c..81af21e9bcd4 100644 --- a/include/net/nfc/digital.h +++ b/include/net/nfc/digital.h | |||
| @@ -122,6 +122,16 @@ typedef void (*nfc_digital_cmd_complete_t)(struct nfc_digital_dev *ddev, | |||
| 122 | * switch_rf to turn the radio on. A call to in|tg_configure_hw must turn | 122 | * switch_rf to turn the radio on. A call to in|tg_configure_hw must turn |
| 123 | * the device radio on. | 123 | * the device radio on. |
| 124 | * @abort_cmd: Discard the last sent command. | 124 | * @abort_cmd: Discard the last sent command. |
| 125 | * | ||
| 126 | * Notes: Asynchronous functions have a timeout parameter. It is the driver | ||
| 127 | * responsibility to call the digital stack back through the | ||
| 128 | * nfc_digital_cmd_complete_t callback when no RF respsonse has been | ||
| 129 | * received within the specified time (in milliseconds). In that case the | ||
| 130 | * driver must set the resp sk_buff to ERR_PTR(-ETIMEDOUT). | ||
| 131 | * Since the digital stack serializes commands to be sent, it's mandatory | ||
| 132 | * for the driver to handle the timeout correctly. Otherwise the stack | ||
| 133 | * would not be able to send new commands, waiting for the reply of the | ||
| 134 | * current one. | ||
| 125 | */ | 135 | */ |
| 126 | struct nfc_digital_ops { | 136 | struct nfc_digital_ops { |
| 127 | int (*in_configure_hw)(struct nfc_digital_dev *ddev, int type, | 137 | int (*in_configure_hw)(struct nfc_digital_dev *ddev, int type, |
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index 2eca2960ca9c..03c4650b548c 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
| @@ -12,9 +12,7 @@ | |||
| 12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. |
| 13 | * | 13 | * |
| 14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the | 15 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 16 | * Free Software Foundation, Inc., | ||
| 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 18 | */ | 16 | */ |
| 19 | 17 | ||
| 20 | #ifndef __NET_HCI_H | 18 | #ifndef __NET_HCI_H |
diff --git a/include/net/nfc/llc.h b/include/net/nfc/llc.h index 400ab7ae749d..c25fbdee0d61 100644 --- a/include/net/nfc/llc.h +++ b/include/net/nfc/llc.h | |||
| @@ -13,9 +13,7 @@ | |||
| 13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
| 14 | * | 14 | * |
| 15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the | 16 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 17 | * Free Software Foundation, Inc., | ||
| 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 19 | */ | 17 | */ |
| 20 | 18 | ||
| 21 | #ifndef __NFC_LLC_H_ | 19 | #ifndef __NFC_LLC_H_ |
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h index e5aa5acafea0..fbfa4e471abb 100644 --- a/include/net/nfc/nci.h +++ b/include/net/nfc/nci.h | |||
| @@ -20,8 +20,7 @@ | |||
| 20 | * GNU General Public License for more details. | 20 | * GNU General Public License for more details. |
| 21 | * | 21 | * |
| 22 | * You should have received a copy of the GNU General Public License | 22 | * You should have received a copy of the GNU General Public License |
| 23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 25 | * | 24 | * |
| 26 | */ | 25 | */ |
| 27 | 26 | ||
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h index 6126f1f992b4..1f9a0f5272fe 100644 --- a/include/net/nfc/nci_core.h +++ b/include/net/nfc/nci_core.h | |||
| @@ -21,8 +21,7 @@ | |||
| 21 | * GNU General Public License for more details. | 21 | * GNU General Public License for more details. |
| 22 | * | 22 | * |
| 23 | * You should have received a copy of the GNU General Public License | 23 | * You should have received a copy of the GNU General Public License |
| 24 | * along with this program; if not, write to the Free Software | 24 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 25 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 26 | * | 25 | * |
| 27 | */ | 26 | */ |
| 28 | 27 | ||
| @@ -68,6 +67,7 @@ struct nci_ops { | |||
| 68 | int (*open)(struct nci_dev *ndev); | 67 | int (*open)(struct nci_dev *ndev); |
| 69 | int (*close)(struct nci_dev *ndev); | 68 | int (*close)(struct nci_dev *ndev); |
| 70 | int (*send)(struct nci_dev *ndev, struct sk_buff *skb); | 69 | int (*send)(struct nci_dev *ndev, struct sk_buff *skb); |
| 70 | int (*setup)(struct nci_dev *ndev); | ||
| 71 | }; | 71 | }; |
| 72 | 72 | ||
| 73 | #define NCI_MAX_SUPPORTED_RF_INTERFACES 4 | 73 | #define NCI_MAX_SUPPORTED_RF_INTERFACES 4 |
| @@ -154,6 +154,7 @@ void nci_free_device(struct nci_dev *ndev); | |||
| 154 | int nci_register_device(struct nci_dev *ndev); | 154 | int nci_register_device(struct nci_dev *ndev); |
| 155 | void nci_unregister_device(struct nci_dev *ndev); | 155 | void nci_unregister_device(struct nci_dev *ndev); |
| 156 | int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb); | 156 | int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb); |
| 157 | int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val); | ||
| 157 | 158 | ||
| 158 | static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, | 159 | static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, |
| 159 | unsigned int len, | 160 | unsigned int len, |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index 82fc4e43fc6e..e80894bca1d0 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
| @@ -16,9 +16,7 @@ | |||
| 16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
| 17 | * | 17 | * |
| 18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the | 19 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 20 | * Free Software Foundation, Inc., | ||
| 21 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 22 | */ | 20 | */ |
| 23 | 21 | ||
| 24 | #ifndef __NET_NFC_H | 22 | #ifndef __NET_NFC_H |
diff --git a/include/net/ping.h b/include/net/ping.h index 3f67704f3747..026479b61a2d 100644 --- a/include/net/ping.h +++ b/include/net/ping.h | |||
| @@ -31,9 +31,14 @@ | |||
| 31 | 31 | ||
| 32 | /* Compatibility glue so we can support IPv6 when it's compiled as a module */ | 32 | /* Compatibility glue so we can support IPv6 when it's compiled as a module */ |
| 33 | struct pingv6_ops { | 33 | struct pingv6_ops { |
| 34 | int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len); | 34 | int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len, |
| 35 | int (*ip6_datagram_recv_ctl)(struct sock *sk, struct msghdr *msg, | 35 | int *addr_len); |
| 36 | struct sk_buff *skb); | 36 | void (*ip6_datagram_recv_common_ctl)(struct sock *sk, |
| 37 | struct msghdr *msg, | ||
| 38 | struct sk_buff *skb); | ||
| 39 | void (*ip6_datagram_recv_specific_ctl)(struct sock *sk, | ||
| 40 | struct msghdr *msg, | ||
| 41 | struct sk_buff *skb); | ||
| 37 | int (*icmpv6_err_convert)(u8 type, u8 code, int *err); | 42 | int (*icmpv6_err_convert)(u8 type, u8 code, int *err); |
| 38 | void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err, | 43 | void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err, |
| 39 | __be16 port, u32 info, u8 *payload); | 44 | __be16 port, u32 info, u8 *payload); |
| @@ -41,11 +46,6 @@ struct pingv6_ops { | |||
| 41 | const struct net_device *dev, int strict); | 46 | const struct net_device *dev, int strict); |
| 42 | }; | 47 | }; |
| 43 | 48 | ||
| 44 | struct ping_table { | ||
| 45 | struct hlist_nulls_head hash[PING_HTABLE_SIZE]; | ||
| 46 | rwlock_t lock; | ||
| 47 | }; | ||
| 48 | |||
| 49 | struct ping_iter_state { | 49 | struct ping_iter_state { |
| 50 | struct seq_net_private p; | 50 | struct seq_net_private p; |
| 51 | int bucket; | 51 | int bucket; |
| @@ -53,7 +53,6 @@ struct ping_iter_state { | |||
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | extern struct proto ping_prot; | 55 | extern struct proto ping_prot; |
| 56 | extern struct ping_table ping_table; | ||
| 57 | #if IS_ENABLED(CONFIG_IPV6) | 56 | #if IS_ENABLED(CONFIG_IPV6) |
| 58 | extern struct pingv6_ops pingv6_ops; | 57 | extern struct pingv6_ops pingv6_ops; |
| 59 | #endif | 58 | #endif |
| @@ -80,8 +79,6 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
| 80 | size_t len, int noblock, int flags, int *addr_len); | 79 | size_t len, int noblock, int flags, int *addr_len); |
| 81 | int ping_common_sendmsg(int family, struct msghdr *msg, size_t len, | 80 | int ping_common_sendmsg(int family, struct msghdr *msg, size_t len, |
| 82 | void *user_icmph, size_t icmph_len); | 81 | void *user_icmph, size_t icmph_len); |
| 83 | int ping_v4_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | ||
| 84 | size_t len); | ||
| 85 | int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 82 | int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
| 86 | size_t len); | 83 | size_t len); |
| 87 | int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); | 84 | int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); |
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 2ebef77a2f9a..a2441fb1428f 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h | |||
| @@ -62,18 +62,26 @@ tcf_unbind_filter(struct tcf_proto *tp, struct tcf_result *r) | |||
| 62 | 62 | ||
| 63 | struct tcf_exts { | 63 | struct tcf_exts { |
| 64 | #ifdef CONFIG_NET_CLS_ACT | 64 | #ifdef CONFIG_NET_CLS_ACT |
| 65 | struct tc_action *action; | 65 | __u32 type; /* for backward compat(TCA_OLD_COMPAT) */ |
| 66 | struct list_head actions; | ||
| 66 | #endif | 67 | #endif |
| 67 | }; | 68 | /* Map to export classifier specific extension TLV types to the |
| 68 | 69 | * generic extensions API. Unsupported extensions must be set to 0. | |
| 69 | /* Map to export classifier specific extension TLV types to the | 70 | */ |
| 70 | * generic extensions API. Unsupported extensions must be set to 0. | ||
| 71 | */ | ||
| 72 | struct tcf_ext_map { | ||
| 73 | int action; | 71 | int action; |
| 74 | int police; | 72 | int police; |
| 75 | }; | 73 | }; |
| 76 | 74 | ||
| 75 | static inline void tcf_exts_init(struct tcf_exts *exts, int action, int police) | ||
| 76 | { | ||
| 77 | #ifdef CONFIG_NET_CLS_ACT | ||
| 78 | exts->type = 0; | ||
| 79 | INIT_LIST_HEAD(&exts->actions); | ||
| 80 | #endif | ||
| 81 | exts->action = action; | ||
| 82 | exts->police = police; | ||
| 83 | } | ||
| 84 | |||
| 77 | /** | 85 | /** |
| 78 | * tcf_exts_is_predicative - check if a predicative extension is present | 86 | * tcf_exts_is_predicative - check if a predicative extension is present |
| 79 | * @exts: tc filter extensions handle | 87 | * @exts: tc filter extensions handle |
| @@ -85,7 +93,7 @@ static inline int | |||
| 85 | tcf_exts_is_predicative(struct tcf_exts *exts) | 93 | tcf_exts_is_predicative(struct tcf_exts *exts) |
| 86 | { | 94 | { |
| 87 | #ifdef CONFIG_NET_CLS_ACT | 95 | #ifdef CONFIG_NET_CLS_ACT |
| 88 | return !!exts->action; | 96 | return !list_empty(&exts->actions); |
| 89 | #else | 97 | #else |
| 90 | return 0; | 98 | return 0; |
| 91 | #endif | 99 | #endif |
| @@ -120,23 +128,20 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts, | |||
| 120 | struct tcf_result *res) | 128 | struct tcf_result *res) |
| 121 | { | 129 | { |
| 122 | #ifdef CONFIG_NET_CLS_ACT | 130 | #ifdef CONFIG_NET_CLS_ACT |
| 123 | if (exts->action) | 131 | if (!list_empty(&exts->actions)) |
| 124 | return tcf_action_exec(skb, exts->action, res); | 132 | return tcf_action_exec(skb, &exts->actions, res); |
| 125 | #endif | 133 | #endif |
| 126 | return 0; | 134 | return 0; |
| 127 | } | 135 | } |
| 128 | 136 | ||
| 129 | int tcf_exts_validate(struct net *net, struct tcf_proto *tp, | 137 | int tcf_exts_validate(struct net *net, struct tcf_proto *tp, |
| 130 | struct nlattr **tb, struct nlattr *rate_tlv, | 138 | struct nlattr **tb, struct nlattr *rate_tlv, |
| 131 | struct tcf_exts *exts, | 139 | struct tcf_exts *exts); |
| 132 | const struct tcf_ext_map *map); | ||
| 133 | void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); | 140 | void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); |
| 134 | void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, | 141 | void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, |
| 135 | struct tcf_exts *src); | 142 | struct tcf_exts *src); |
| 136 | int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts, | 143 | int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts); |
| 137 | const struct tcf_ext_map *map); | 144 | int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts); |
| 138 | int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, | ||
| 139 | const struct tcf_ext_map *map); | ||
| 140 | 145 | ||
| 141 | /** | 146 | /** |
| 142 | * struct tcf_pkt_info - packet information | 147 | * struct tcf_pkt_info - packet information |
| @@ -333,27 +338,27 @@ static inline int tcf_valid_offset(const struct sk_buff *skb, | |||
| 333 | #include <net/net_namespace.h> | 338 | #include <net/net_namespace.h> |
| 334 | 339 | ||
| 335 | static inline int | 340 | static inline int |
| 336 | tcf_change_indev(struct tcf_proto *tp, char *indev, struct nlattr *indev_tlv) | 341 | tcf_change_indev(struct net *net, struct nlattr *indev_tlv) |
| 337 | { | 342 | { |
| 343 | char indev[IFNAMSIZ]; | ||
| 344 | struct net_device *dev; | ||
| 345 | |||
| 338 | if (nla_strlcpy(indev, indev_tlv, IFNAMSIZ) >= IFNAMSIZ) | 346 | if (nla_strlcpy(indev, indev_tlv, IFNAMSIZ) >= IFNAMSIZ) |
| 339 | return -EINVAL; | 347 | return -EINVAL; |
| 340 | return 0; | 348 | dev = __dev_get_by_name(net, indev); |
| 349 | if (!dev) | ||
| 350 | return -ENODEV; | ||
| 351 | return dev->ifindex; | ||
| 341 | } | 352 | } |
| 342 | 353 | ||
| 343 | static inline int | 354 | static inline bool |
| 344 | tcf_match_indev(struct sk_buff *skb, char *indev) | 355 | tcf_match_indev(struct sk_buff *skb, int ifindex) |
| 345 | { | 356 | { |
| 346 | struct net_device *dev; | 357 | if (!ifindex) |
| 347 | 358 | return true; | |
| 348 | if (indev[0]) { | 359 | if (!skb->skb_iif) |
| 349 | if (!skb->skb_iif) | 360 | return false; |
| 350 | return 0; | 361 | return ifindex == skb->skb_iif; |
| 351 | dev = __dev_get_by_index(dev_net(skb->dev), skb->skb_iif); | ||
| 352 | if (!dev || strcmp(indev, dev->name)) | ||
| 353 | return 0; | ||
| 354 | } | ||
| 355 | |||
| 356 | return 1; | ||
| 357 | } | 362 | } |
| 358 | #endif /* CONFIG_NET_CLS_IND */ | 363 | #endif /* CONFIG_NET_CLS_IND */ |
| 359 | 364 | ||
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 59ec3cd15d68..891d80d2c4d2 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
| @@ -88,6 +88,7 @@ int unregister_qdisc(struct Qdisc_ops *qops); | |||
| 88 | void qdisc_get_default(char *id, size_t len); | 88 | void qdisc_get_default(char *id, size_t len); |
| 89 | int qdisc_set_default(const char *id); | 89 | int qdisc_set_default(const char *id); |
| 90 | 90 | ||
| 91 | void qdisc_list_add(struct Qdisc *q); | ||
| 91 | void qdisc_list_del(struct Qdisc *q); | 92 | void qdisc_list_del(struct Qdisc *q); |
| 92 | struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); | 93 | struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); |
| 93 | struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); | 94 | struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); |
diff --git a/include/net/protocol.h b/include/net/protocol.h index fbf7676c9a02..a7e986b08147 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
| @@ -43,7 +43,12 @@ struct net_protocol { | |||
| 43 | int (*handler)(struct sk_buff *skb); | 43 | int (*handler)(struct sk_buff *skb); |
| 44 | void (*err_handler)(struct sk_buff *skb, u32 info); | 44 | void (*err_handler)(struct sk_buff *skb, u32 info); |
| 45 | unsigned int no_policy:1, | 45 | unsigned int no_policy:1, |
| 46 | netns_ok:1; | 46 | netns_ok:1, |
| 47 | /* does the protocol do more stringent | ||
| 48 | * icmp tag validation than simple | ||
| 49 | * socket lookup? | ||
| 50 | */ | ||
| 51 | icmp_strict_tag_validation:1; | ||
| 47 | }; | 52 | }; |
| 48 | 53 | ||
| 49 | #if IS_ENABLED(CONFIG_IPV6) | 54 | #if IS_ENABLED(CONFIG_IPV6) |
| @@ -103,6 +108,9 @@ int inet_del_offload(const struct net_offload *prot, unsigned char num); | |||
| 103 | void inet_register_protosw(struct inet_protosw *p); | 108 | void inet_register_protosw(struct inet_protosw *p); |
| 104 | void inet_unregister_protosw(struct inet_protosw *p); | 109 | void inet_unregister_protosw(struct inet_protosw *p); |
| 105 | 110 | ||
| 111 | int udp_add_offload(struct udp_offload *prot); | ||
| 112 | void udp_del_offload(struct udp_offload *prot); | ||
| 113 | |||
| 106 | #if IS_ENABLED(CONFIG_IPV6) | 114 | #if IS_ENABLED(CONFIG_IPV6) |
| 107 | int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num); | 115 | int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num); |
| 108 | int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num); | 116 | int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num); |
diff --git a/include/net/red.h b/include/net/red.h index ef46058d35bf..76e0b5f922c6 100644 --- a/include/net/red.h +++ b/include/net/red.h | |||
| @@ -130,7 +130,8 @@ struct red_parms { | |||
| 130 | u32 qth_max; /* Max avg length threshold: Wlog scaled */ | 130 | u32 qth_max; /* Max avg length threshold: Wlog scaled */ |
| 131 | u32 Scell_max; | 131 | u32 Scell_max; |
| 132 | u32 max_P; /* probability, [0 .. 1.0] 32 scaled */ | 132 | u32 max_P; /* probability, [0 .. 1.0] 32 scaled */ |
| 133 | u32 max_P_reciprocal; /* reciprocal_value(max_P / qth_delta) */ | 133 | /* reciprocal_value(max_P / qth_delta) */ |
| 134 | struct reciprocal_value max_P_reciprocal; | ||
| 134 | u32 qth_delta; /* max_th - min_th */ | 135 | u32 qth_delta; /* max_th - min_th */ |
| 135 | u32 target_min; /* min_th + 0.4*(max_th - min_th) */ | 136 | u32 target_min; /* min_th + 0.4*(max_th - min_th) */ |
| 136 | u32 target_max; /* min_th + 0.6*(max_th - min_th) */ | 137 | u32 target_max; /* min_th + 0.6*(max_th - min_th) */ |
| @@ -303,7 +304,7 @@ static inline unsigned long red_calc_qavg(const struct red_parms *p, | |||
| 303 | 304 | ||
| 304 | static inline u32 red_random(const struct red_parms *p) | 305 | static inline u32 red_random(const struct red_parms *p) |
| 305 | { | 306 | { |
| 306 | return reciprocal_divide(net_random(), p->max_P_reciprocal); | 307 | return reciprocal_divide(prandom_u32(), p->max_P_reciprocal); |
| 307 | } | 308 | } |
| 308 | 309 | ||
| 309 | static inline int red_mark_probability(const struct red_parms *p, | 310 | static inline int red_mark_probability(const struct red_parms *p, |
diff --git a/include/net/regulatory.h b/include/net/regulatory.h index f17ed590d64a..b07cdc9fa454 100644 --- a/include/net/regulatory.h +++ b/include/net/regulatory.h | |||
| @@ -38,17 +38,17 @@ enum environment_cap { | |||
| 38 | * | 38 | * |
| 39 | * @rcu_head: RCU head struct used to free the request | 39 | * @rcu_head: RCU head struct used to free the request |
| 40 | * @wiphy_idx: this is set if this request's initiator is | 40 | * @wiphy_idx: this is set if this request's initiator is |
| 41 | * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This | 41 | * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This |
| 42 | * can be used by the wireless core to deal with conflicts | 42 | * can be used by the wireless core to deal with conflicts |
| 43 | * and potentially inform users of which devices specifically | 43 | * and potentially inform users of which devices specifically |
| 44 | * cased the conflicts. | 44 | * cased the conflicts. |
| 45 | * @initiator: indicates who sent this request, could be any of | 45 | * @initiator: indicates who sent this request, could be any of |
| 46 | * of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*) | 46 | * of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*) |
| 47 | * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested | 47 | * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested |
| 48 | * regulatory domain. We have a few special codes: | 48 | * regulatory domain. We have a few special codes: |
| 49 | * 00 - World regulatory domain | 49 | * 00 - World regulatory domain |
| 50 | * 99 - built by driver but a specific alpha2 cannot be determined | 50 | * 99 - built by driver but a specific alpha2 cannot be determined |
| 51 | * 98 - result of an intersection between two regulatory domains | 51 | * 98 - result of an intersection between two regulatory domains |
| 52 | * 97 - regulatory domain has not yet been configured | 52 | * 97 - regulatory domain has not yet been configured |
| 53 | * @dfs_region: If CRDA responded with a regulatory domain that requires | 53 | * @dfs_region: If CRDA responded with a regulatory domain that requires |
| 54 | * DFS master operation on a known DFS region (NL80211_DFS_*), | 54 | * DFS master operation on a known DFS region (NL80211_DFS_*), |
| @@ -59,8 +59,8 @@ enum environment_cap { | |||
| 59 | * of hint passed. This could be any of the %NL80211_USER_REG_HINT_* | 59 | * of hint passed. This could be any of the %NL80211_USER_REG_HINT_* |
| 60 | * types. | 60 | * types. |
| 61 | * @intersect: indicates whether the wireless core should intersect | 61 | * @intersect: indicates whether the wireless core should intersect |
| 62 | * the requested regulatory domain with the presently set regulatory | 62 | * the requested regulatory domain with the presently set regulatory |
| 63 | * domain. | 63 | * domain. |
| 64 | * @processed: indicates whether or not this requests has already been | 64 | * @processed: indicates whether or not this requests has already been |
| 65 | * processed. When the last request is processed it means that the | 65 | * processed. When the last request is processed it means that the |
| 66 | * currently regulatory domain set on cfg80211 is updated from | 66 | * currently regulatory domain set on cfg80211 is updated from |
| @@ -68,9 +68,9 @@ enum environment_cap { | |||
| 68 | * the last request is not yet processed we must yield until it | 68 | * the last request is not yet processed we must yield until it |
| 69 | * is processed before processing any new requests. | 69 | * is processed before processing any new requests. |
| 70 | * @country_ie_checksum: checksum of the last processed and accepted | 70 | * @country_ie_checksum: checksum of the last processed and accepted |
| 71 | * country IE | 71 | * country IE |
| 72 | * @country_ie_env: lets us know if the AP is telling us we are outdoor, | 72 | * @country_ie_env: lets us know if the AP is telling us we are outdoor, |
| 73 | * indoor, or if it doesn't matter | 73 | * indoor, or if it doesn't matter |
| 74 | * @list: used to insert into the reg_requests_list linked list | 74 | * @list: used to insert into the reg_requests_list linked list |
| 75 | */ | 75 | */ |
| 76 | struct regulatory_request { | 76 | struct regulatory_request { |
| @@ -79,13 +79,67 @@ struct regulatory_request { | |||
| 79 | enum nl80211_reg_initiator initiator; | 79 | enum nl80211_reg_initiator initiator; |
| 80 | enum nl80211_user_reg_hint_type user_reg_hint_type; | 80 | enum nl80211_user_reg_hint_type user_reg_hint_type; |
| 81 | char alpha2[2]; | 81 | char alpha2[2]; |
| 82 | u8 dfs_region; | 82 | enum nl80211_dfs_regions dfs_region; |
| 83 | bool intersect; | 83 | bool intersect; |
| 84 | bool processed; | 84 | bool processed; |
| 85 | enum environment_cap country_ie_env; | 85 | enum environment_cap country_ie_env; |
| 86 | struct list_head list; | 86 | struct list_head list; |
| 87 | }; | 87 | }; |
| 88 | 88 | ||
| 89 | /** | ||
| 90 | * enum ieee80211_regulatory_flags - device regulatory flags | ||
| 91 | * | ||
| 92 | * @REGULATORY_CUSTOM_REG: tells us the driver for this device | ||
| 93 | * has its own custom regulatory domain and cannot identify the | ||
| 94 | * ISO / IEC 3166 alpha2 it belongs to. When this is enabled | ||
| 95 | * we will disregard the first regulatory hint (when the | ||
| 96 | * initiator is %REGDOM_SET_BY_CORE). Drivers that use | ||
| 97 | * wiphy_apply_custom_regulatory() should have this flag set | ||
| 98 | * or the regulatory core will set it for the wiphy. | ||
| 99 | * If you use regulatory_hint() *after* using | ||
| 100 | * wiphy_apply_custom_regulatory() the wireless core will | ||
| 101 | * clear the REGULATORY_CUSTOM_REG for your wiphy as it would be | ||
| 102 | * implied that the device somehow gained knowledge of its region. | ||
| 103 | * @REGULATORY_STRICT_REG: tells us that the wiphy for this device | ||
| 104 | * has regulatory domain that it wishes to be considered as the | ||
| 105 | * superset for regulatory rules. After this device gets its regulatory | ||
| 106 | * domain programmed further regulatory hints shall only be considered | ||
| 107 | * for this device to enhance regulatory compliance, forcing the | ||
| 108 | * device to only possibly use subsets of the original regulatory | ||
| 109 | * rules. For example if channel 13 and 14 are disabled by this | ||
| 110 | * device's regulatory domain no user specified regulatory hint which | ||
| 111 | * has these channels enabled would enable them for this wiphy, | ||
| 112 | * the device's original regulatory domain will be trusted as the | ||
| 113 | * base. You can program the superset of regulatory rules for this | ||
| 114 | * wiphy with regulatory_hint() for cards programmed with an | ||
| 115 | * ISO3166-alpha2 country code. wiphys that use regulatory_hint() | ||
| 116 | * will have their wiphy->regd programmed once the regulatory | ||
| 117 | * domain is set, and all other regulatory hints will be ignored | ||
| 118 | * until their own regulatory domain gets programmed. | ||
| 119 | * @REGULATORY_DISABLE_BEACON_HINTS: enable this if your driver needs to | ||
| 120 | * ensure that passive scan flags and beaconing flags may not be lifted by | ||
| 121 | * cfg80211 due to regulatory beacon hints. For more information on beacon | ||
| 122 | * hints read the documenation for regulatory_hint_found_beacon() | ||
| 123 | * @REGULATORY_COUNTRY_IE_FOLLOW_POWER: for devices that have a preference | ||
| 124 | * that even though they may have programmed their own custom power | ||
| 125 | * setting prior to wiphy registration, they want to ensure their channel | ||
| 126 | * power settings are updated for this connection with the power settings | ||
| 127 | * derived from the regulatory domain. The regulatory domain used will be | ||
| 128 | * based on the ISO3166-alpha2 from country IE provided through | ||
| 129 | * regulatory_hint_country_ie() | ||
| 130 | * @REGULATORY_COUNTRY_IE_IGNORE: for devices that have a preference to ignore | ||
| 131 | * all country IE information processed by the regulatory core. This will | ||
| 132 | * override %REGULATORY_COUNTRY_IE_FOLLOW_POWER as all country IEs will | ||
| 133 | * be ignored. | ||
| 134 | */ | ||
| 135 | enum ieee80211_regulatory_flags { | ||
| 136 | REGULATORY_CUSTOM_REG = BIT(0), | ||
| 137 | REGULATORY_STRICT_REG = BIT(1), | ||
| 138 | REGULATORY_DISABLE_BEACON_HINTS = BIT(2), | ||
| 139 | REGULATORY_COUNTRY_IE_FOLLOW_POWER = BIT(3), | ||
| 140 | REGULATORY_COUNTRY_IE_IGNORE = BIT(4), | ||
| 141 | }; | ||
| 142 | |||
| 89 | struct ieee80211_freq_range { | 143 | struct ieee80211_freq_range { |
| 90 | u32 start_freq_khz; | 144 | u32 start_freq_khz; |
| 91 | u32 end_freq_khz; | 145 | u32 end_freq_khz; |
| @@ -107,7 +161,7 @@ struct ieee80211_regdomain { | |||
| 107 | struct rcu_head rcu_head; | 161 | struct rcu_head rcu_head; |
| 108 | u32 n_reg_rules; | 162 | u32 n_reg_rules; |
| 109 | char alpha2[2]; | 163 | char alpha2[2]; |
| 110 | u8 dfs_region; | 164 | enum nl80211_dfs_regions dfs_region; |
| 111 | struct ieee80211_reg_rule reg_rules[]; | 165 | struct ieee80211_reg_rule reg_rules[]; |
| 112 | }; | 166 | }; |
| 113 | 167 | ||
diff --git a/include/net/route.h b/include/net/route.h index f68c167280a7..9d1f423d5944 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
| @@ -36,6 +36,9 @@ | |||
| 36 | #include <linux/cache.h> | 36 | #include <linux/cache.h> |
| 37 | #include <linux/security.h> | 37 | #include <linux/security.h> |
| 38 | 38 | ||
| 39 | /* IPv4 datagram length is stored into 16bit field (tot_len) */ | ||
| 40 | #define IP_MAX_MTU 0xFFFFU | ||
| 41 | |||
| 39 | #define RTO_ONLINK 0x01 | 42 | #define RTO_ONLINK 0x01 |
| 40 | 43 | ||
| 41 | #define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE)) | 44 | #define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE)) |
| @@ -239,14 +242,12 @@ static inline char rt_tos2priority(u8 tos) | |||
| 239 | static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 src, | 242 | static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 src, |
| 240 | u32 tos, int oif, u8 protocol, | 243 | u32 tos, int oif, u8 protocol, |
| 241 | __be16 sport, __be16 dport, | 244 | __be16 sport, __be16 dport, |
| 242 | struct sock *sk, bool can_sleep) | 245 | struct sock *sk) |
| 243 | { | 246 | { |
| 244 | __u8 flow_flags = 0; | 247 | __u8 flow_flags = 0; |
| 245 | 248 | ||
| 246 | if (inet_sk(sk)->transparent) | 249 | if (inet_sk(sk)->transparent) |
| 247 | flow_flags |= FLOWI_FLAG_ANYSRC; | 250 | flow_flags |= FLOWI_FLAG_ANYSRC; |
| 248 | if (can_sleep) | ||
| 249 | flow_flags |= FLOWI_FLAG_CAN_SLEEP; | ||
| 250 | 251 | ||
| 251 | flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE, | 252 | flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE, |
| 252 | protocol, flow_flags, dst, src, dport, sport); | 253 | protocol, flow_flags, dst, src, dport, sport); |
| @@ -256,13 +257,13 @@ static inline struct rtable *ip_route_connect(struct flowi4 *fl4, | |||
| 256 | __be32 dst, __be32 src, u32 tos, | 257 | __be32 dst, __be32 src, u32 tos, |
| 257 | int oif, u8 protocol, | 258 | int oif, u8 protocol, |
| 258 | __be16 sport, __be16 dport, | 259 | __be16 sport, __be16 dport, |
| 259 | struct sock *sk, bool can_sleep) | 260 | struct sock *sk) |
| 260 | { | 261 | { |
| 261 | struct net *net = sock_net(sk); | 262 | struct net *net = sock_net(sk); |
| 262 | struct rtable *rt; | 263 | struct rtable *rt; |
| 263 | 264 | ||
| 264 | ip_route_connect_init(fl4, dst, src, tos, oif, protocol, | 265 | ip_route_connect_init(fl4, dst, src, tos, oif, protocol, |
| 265 | sport, dport, sk, can_sleep); | 266 | sport, dport, sk); |
| 266 | 267 | ||
| 267 | if (!dst || !src) { | 268 | if (!dst || !src) { |
| 268 | rt = __ip_route_output_key(net, fl4); | 269 | rt = __ip_route_output_key(net, fl4); |
| @@ -313,20 +314,4 @@ static inline int ip4_dst_hoplimit(const struct dst_entry *dst) | |||
| 313 | return hoplimit; | 314 | return hoplimit; |
| 314 | } | 315 | } |
| 315 | 316 | ||
| 316 | static inline bool ip_sk_accept_pmtu(const struct sock *sk) | ||
| 317 | { | ||
| 318 | return inet_sk(sk)->pmtudisc != IP_PMTUDISC_INTERFACE; | ||
| 319 | } | ||
| 320 | |||
| 321 | static inline bool ip_sk_use_pmtu(const struct sock *sk) | ||
| 322 | { | ||
| 323 | return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE; | ||
| 324 | } | ||
| 325 | |||
| 326 | static inline int ip_skb_dst_mtu(const struct sk_buff *skb) | ||
| 327 | { | ||
| 328 | return (!skb->sk || ip_sk_use_pmtu(skb->sk)) ? | ||
| 329 | dst_mtu(skb_dst(skb)) : skb_dst(skb)->dev->mtu; | ||
| 330 | } | ||
| 331 | |||
| 332 | #endif /* _ROUTE_H */ | 317 | #endif /* _ROUTE_H */ |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index bb13a182fba6..661e45d38051 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
| @@ -79,6 +79,20 @@ struct rtnl_link_ops { | |||
| 79 | const struct net_device *dev); | 79 | const struct net_device *dev); |
| 80 | unsigned int (*get_num_tx_queues)(void); | 80 | unsigned int (*get_num_tx_queues)(void); |
| 81 | unsigned int (*get_num_rx_queues)(void); | 81 | unsigned int (*get_num_rx_queues)(void); |
| 82 | |||
| 83 | int slave_maxtype; | ||
| 84 | const struct nla_policy *slave_policy; | ||
| 85 | int (*slave_validate)(struct nlattr *tb[], | ||
| 86 | struct nlattr *data[]); | ||
| 87 | int (*slave_changelink)(struct net_device *dev, | ||
| 88 | struct net_device *slave_dev, | ||
| 89 | struct nlattr *tb[], | ||
| 90 | struct nlattr *data[]); | ||
| 91 | size_t (*get_slave_size)(const struct net_device *dev, | ||
| 92 | const struct net_device *slave_dev); | ||
| 93 | int (*fill_slave_info)(struct sk_buff *skb, | ||
| 94 | const struct net_device *dev, | ||
| 95 | const struct net_device *slave_dev); | ||
| 82 | }; | 96 | }; |
| 83 | 97 | ||
| 84 | int __rtnl_link_register(struct rtnl_link_ops *ops); | 98 | int __rtnl_link_register(struct rtnl_link_ops *ops); |
| @@ -115,10 +129,9 @@ struct rtnl_af_ops { | |||
| 115 | const struct nlattr *attr); | 129 | const struct nlattr *attr); |
| 116 | }; | 130 | }; |
| 117 | 131 | ||
| 118 | int __rtnl_af_register(struct rtnl_af_ops *ops); | ||
| 119 | void __rtnl_af_unregister(struct rtnl_af_ops *ops); | 132 | void __rtnl_af_unregister(struct rtnl_af_ops *ops); |
| 120 | 133 | ||
| 121 | int rtnl_af_register(struct rtnl_af_ops *ops); | 134 | void rtnl_af_register(struct rtnl_af_ops *ops); |
| 122 | void rtnl_af_unregister(struct rtnl_af_ops *ops); | 135 | void rtnl_af_unregister(struct rtnl_af_ops *ops); |
| 123 | 136 | ||
| 124 | struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); | 137 | struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index d0a6321c302e..d062f81c692f 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
| @@ -185,7 +185,7 @@ struct tcf_result { | |||
| 185 | }; | 185 | }; |
| 186 | 186 | ||
| 187 | struct tcf_proto_ops { | 187 | struct tcf_proto_ops { |
| 188 | struct tcf_proto_ops *next; | 188 | struct list_head head; |
| 189 | char kind[IFNAMSIZ]; | 189 | char kind[IFNAMSIZ]; |
| 190 | 190 | ||
| 191 | int (*classify)(struct sk_buff *, | 191 | int (*classify)(struct sk_buff *, |
| @@ -204,7 +204,7 @@ struct tcf_proto_ops { | |||
| 204 | void (*walk)(struct tcf_proto*, struct tcf_walker *arg); | 204 | void (*walk)(struct tcf_proto*, struct tcf_walker *arg); |
| 205 | 205 | ||
| 206 | /* rtnetlink specific */ | 206 | /* rtnetlink specific */ |
| 207 | int (*dump)(struct tcf_proto*, unsigned long, | 207 | int (*dump)(struct net*, struct tcf_proto*, unsigned long, |
| 208 | struct sk_buff *skb, struct tcmsg*); | 208 | struct sk_buff *skb, struct tcmsg*); |
| 209 | 209 | ||
| 210 | struct module *owner; | 210 | struct module *owner; |
diff --git a/include/net/sctp/auth.h b/include/net/sctp/auth.h index aa80bef3c9d5..f2d58aa37a6f 100644 --- a/include/net/sctp/auth.h +++ b/include/net/sctp/auth.h | |||
| @@ -16,9 +16,8 @@ | |||
| 16 | * See the GNU General Public License for more details. | 16 | * See the GNU General Public License for more details. |
| 17 | * | 17 | * |
| 18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with GNU CC; see the file COPYING. If not, write to | 19 | * along with GNU CC; see the file COPYING. If not, see |
| 20 | * the Free Software Foundation, 59 Temple Place - Suite 330, | 20 | * <http://www.gnu.org/licenses/>. |
| 21 | * Boston, MA 02111-1307, USA. | ||
| 22 | * | 21 | * |
| 23 | * Please send any bug reports or fixes you make to the | 22 | * Please send any bug reports or fixes you make to the |
| 24 | * email address(es): | 23 | * email address(es): |
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h index 6bd44fe94c26..4a5b9a306c69 100644 --- a/include/net/sctp/checksum.h +++ b/include/net/sctp/checksum.h | |||
| @@ -19,9 +19,8 @@ | |||
| 19 | * See the GNU General Public License for more details. | 19 | * See the GNU General Public License for more details. |
| 20 | * | 20 | * |
| 21 | * You should have received a copy of the GNU General Public License | 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with GNU CC; see the file COPYING. If not, write to | 22 | * along with GNU CC; see the file COPYING. If not, see |
| 23 | * the Free Software Foundation, 59 Temple Place - Suite 330, | 23 | * <http://www.gnu.org/licenses/>. |
| 24 | * Boston, MA 02111-1307, USA. | ||
| 25 | * | 24 | * |
| 26 | * Please send any bug reports or fixes you make to the | 25 | * Please send any bug reports or fixes you make to the |
| 27 | * email address(es): | 26 | * email address(es): |
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 832f2191489c..4b7cd695e431 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
| @@ -19,9 +19,8 @@ | |||
| 19 | * See the GNU General Public License for more details. | 19 | * See the GNU General Public License for more details. |
| 20 | * | 20 | * |
| 21 | * You should have received a copy of the GNU General Public License | 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with GNU CC; see the file COPYING. If not, write to | 22 | * along with GNU CC; see the file COPYING. If not, see |
| 23 | * the Free Software Foundation, 59 Temple Place - Suite 330, | 23 | * <http://www.gnu.org/licenses/>. |
| 24 | * Boston, MA 02111-1307, USA. | ||
| 25 | * | 24 | * |
| 26 | * Please send any bug reports or fixes you make to the | 25 | * Please send any bug reports or fixes you make to the |
| 27 | * email address(es): | 26 | * email address(es): |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 2f0a565a0fd5..307728f622ef 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
| @@ -19,9 +19,8 @@ | |||
| 19 | * See the GNU General Public License for more details. | 19 | * See the GNU General Public License for more details. |
| 20 | * | 20 | * |
| 21 | * You should have received a copy of the GNU General Public License | 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with GNU CC; see the file COPYING. If not, write to | 22 | * along with GNU CC; see the file COPYING. If not, see |
| 23 | * the Free Software Foundation, 59 Temple Place - Suite 330, | 23 | * <http://www.gnu.org/licenses/>. |
| 24 | * Boston, MA 02111-1307, USA. | ||
| 25 | * | 24 | * |
| 26 | * Please send any bug reports or fixes you make to the | 25 | * Please send any bug reports or fixes you make to the |
| 27 | * email address(es): | 26 | * email address(es): |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index c5fe80697f8d..a3353f45ef94 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
| @@ -21,9 +21,8 @@ | |||
| 21 | * See the GNU General Public License for more details. | 21 | * See the GNU General Public License for more details. |
| 22 | * | 22 | * |
| 23 | * You should have received a copy of the GNU General Public License | 23 | * You should have received a copy of the GNU General Public License |
| 24 | * along with GNU CC; see the file COPYING. If not, write to | 24 | * along with GNU CC; see the file COPYING. If not, see |
| 25 | * the Free Software Foundation, 59 Temple Place - Suite 330, | 25 | * <http://www.gnu.org/licenses/>. |
| 26 | * Boston, MA 02111-1307, USA. | ||
| 27 | * | 26 | * |
| 28 | * Please send any bug reports or fixes you make to the | 27 | * Please send any bug reports or fixes you make to the |
| 29 | * email address(es): | 28 | * email address(es): |
| @@ -171,25 +170,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly; | |||
| 171 | * Section: Macros, externs, and inlines | 170 | * Section: Macros, externs, and inlines |
| 172 | */ | 171 | */ |
| 173 | 172 | ||
| 174 | /* spin lock wrappers. */ | ||
| 175 | #define sctp_spin_lock_irqsave(lock, flags) spin_lock_irqsave(lock, flags) | ||
| 176 | #define sctp_spin_unlock_irqrestore(lock, flags) \ | ||
| 177 | spin_unlock_irqrestore(lock, flags) | ||
| 178 | #define sctp_local_bh_disable() local_bh_disable() | ||
| 179 | #define sctp_local_bh_enable() local_bh_enable() | ||
| 180 | #define sctp_spin_lock(lock) spin_lock(lock) | ||
| 181 | #define sctp_spin_unlock(lock) spin_unlock(lock) | ||
| 182 | #define sctp_write_lock(lock) write_lock(lock) | ||
| 183 | #define sctp_write_unlock(lock) write_unlock(lock) | ||
| 184 | #define sctp_read_lock(lock) read_lock(lock) | ||
| 185 | #define sctp_read_unlock(lock) read_unlock(lock) | ||
| 186 | |||
| 187 | /* sock lock wrappers. */ | ||
| 188 | #define sctp_lock_sock(sk) lock_sock(sk) | ||
| 189 | #define sctp_release_sock(sk) release_sock(sk) | ||
| 190 | #define sctp_bh_lock_sock(sk) bh_lock_sock(sk) | ||
| 191 | #define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk) | ||
| 192 | |||
| 193 | /* SCTP SNMP MIB stats handlers */ | 173 | /* SCTP SNMP MIB stats handlers */ |
| 194 | #define SCTP_INC_STATS(net, field) SNMP_INC_STATS((net)->sctp.sctp_statistics, field) | 174 | #define SCTP_INC_STATS(net, field) SNMP_INC_STATS((net)->sctp.sctp_statistics, field) |
| 195 | #define SCTP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->sctp.sctp_statistics, field) | 175 | #define SCTP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->sctp.sctp_statistics, field) |
| @@ -354,13 +334,13 @@ static inline void sctp_skb_list_tail(struct sk_buff_head *list, | |||
| 354 | { | 334 | { |
| 355 | unsigned long flags; | 335 | unsigned long flags; |
| 356 | 336 | ||
| 357 | sctp_spin_lock_irqsave(&head->lock, flags); | 337 | spin_lock_irqsave(&head->lock, flags); |
| 358 | sctp_spin_lock(&list->lock); | 338 | spin_lock(&list->lock); |
| 359 | 339 | ||
| 360 | skb_queue_splice_tail_init(list, head); | 340 | skb_queue_splice_tail_init(list, head); |
| 361 | 341 | ||
| 362 | sctp_spin_unlock(&list->lock); | 342 | spin_unlock(&list->lock); |
| 363 | sctp_spin_unlock_irqrestore(&head->lock, flags); | 343 | spin_unlock_irqrestore(&head->lock, flags); |
| 364 | } | 344 | } |
| 365 | 345 | ||
| 366 | /** | 346 | /** |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 4ef75af340b6..7f4eeb340a54 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
| @@ -21,9 +21,8 @@ | |||
| 21 | * See the GNU General Public License for more details. | 21 | * See the GNU General Public License for more details. |
| 22 | * | 22 | * |
| 23 | * You should have received a copy of the GNU General Public License | 23 | * You should have received a copy of the GNU General Public License |
| 24 | * along with GNU CC; see the file COPYING. If not, write to | 24 | * along with GNU CC; see the file COPYING. If not, see |
| 25 | * the Free Software Foundation, 59 Temple Place - Suite 330, | 25 | * <http://www.gnu.org/licenses/>. |
| 26 | * Boston, MA 02111-1307, USA. | ||
| 27 | * | 26 | * |
| 28 | * Please send any bug reports or fixes you make to the | 27 | * Please send any bug reports or fixes you make to the |
| 29 | * email addresses: | 28 | * email addresses: |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 2174d8da0770..d992ca3145fe 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -19,9 +19,8 @@ | |||
| 19 | * See the GNU General Public License for more details. | 19 | * See the GNU General Public License for more details. |
| 20 | * | 20 | * |
| 21 | * You should have received a copy of the GNU General Public License | 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with GNU CC; see the file COPYING. If not, write to | 22 | * along with GNU CC; see the file COPYING. If not, see |
| 23 | * the Free Software Foundation, 59 Temple Place - Suite 330, | 23 | * <http://www.gnu.org/licenses/>. |
| 24 | * Boston, MA 02111-1307, USA. | ||
| 25 | * | 24 | * |
| 26 | * Please send any bug reports or fixes you make to the | 25 | * Please send any bug reports or fixes you make to the |
| 27 | * email addresses: | 26 | * email addresses: |
| @@ -629,6 +628,7 @@ struct sctp_chunk { | |||
| 629 | #define SCTP_NEED_FRTX 0x1 | 628 | #define SCTP_NEED_FRTX 0x1 |
| 630 | #define SCTP_DONT_FRTX 0x2 | 629 | #define SCTP_DONT_FRTX 0x2 |
| 631 | __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ | 630 | __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ |
| 631 | resent:1, /* Has this chunk ever been resent. */ | ||
| 632 | has_tsn:1, /* Does this chunk have a TSN yet? */ | 632 | has_tsn:1, /* Does this chunk have a TSN yet? */ |
| 633 | has_ssn:1, /* Does this chunk have a SSN yet? */ | 633 | has_ssn:1, /* Does this chunk have a SSN yet? */ |
| 634 | singleton:1, /* Only chunk in the packet? */ | 634 | singleton:1, /* Only chunk in the packet? */ |
| @@ -649,7 +649,6 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len, | |||
| 649 | struct iovec *data); | 649 | struct iovec *data); |
| 650 | void sctp_chunk_free(struct sctp_chunk *); | 650 | void sctp_chunk_free(struct sctp_chunk *); |
| 651 | void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); | 651 | void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); |
| 652 | void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data); | ||
| 653 | struct sctp_chunk *sctp_chunkify(struct sk_buff *, | 652 | struct sctp_chunk *sctp_chunkify(struct sk_buff *, |
| 654 | const struct sctp_association *, | 653 | const struct sctp_association *, |
| 655 | struct sock *); | 654 | struct sock *); |
| @@ -1045,9 +1044,6 @@ struct sctp_outq { | |||
| 1045 | 1044 | ||
| 1046 | /* Corked? */ | 1045 | /* Corked? */ |
| 1047 | char cork; | 1046 | char cork; |
| 1048 | |||
| 1049 | /* Is this structure empty? */ | ||
| 1050 | char empty; | ||
| 1051 | }; | 1047 | }; |
| 1052 | 1048 | ||
| 1053 | void sctp_outq_init(struct sctp_association *, struct sctp_outq *); | 1049 | void sctp_outq_init(struct sctp_association *, struct sctp_outq *); |
| @@ -1360,12 +1356,6 @@ struct sctp_association { | |||
| 1360 | 1356 | ||
| 1361 | /* This is all information about our peer. */ | 1357 | /* This is all information about our peer. */ |
| 1362 | struct { | 1358 | struct { |
| 1363 | /* rwnd | ||
| 1364 | * | ||
| 1365 | * Peer Rwnd : Current calculated value of the peer's rwnd. | ||
| 1366 | */ | ||
| 1367 | __u32 rwnd; | ||
| 1368 | |||
| 1369 | /* transport_addr_list | 1359 | /* transport_addr_list |
| 1370 | * | 1360 | * |
| 1371 | * Peer : A list of SCTP transport addresses that the | 1361 | * Peer : A list of SCTP transport addresses that the |
| @@ -1383,6 +1373,12 @@ struct sctp_association { | |||
| 1383 | */ | 1373 | */ |
| 1384 | struct list_head transport_addr_list; | 1374 | struct list_head transport_addr_list; |
| 1385 | 1375 | ||
| 1376 | /* rwnd | ||
| 1377 | * | ||
| 1378 | * Peer Rwnd : Current calculated value of the peer's rwnd. | ||
| 1379 | */ | ||
| 1380 | __u32 rwnd; | ||
| 1381 | |||
| 1386 | /* transport_count | 1382 | /* transport_count |
| 1387 | * | 1383 | * |
| 1388 | * Peer : A count of the number of peer addresses | 1384 | * Peer : A count of the number of peer addresses |
| @@ -1465,6 +1461,20 @@ struct sctp_association { | |||
| 1465 | */ | 1461 | */ |
| 1466 | struct sctp_tsnmap tsn_map; | 1462 | struct sctp_tsnmap tsn_map; |
| 1467 | 1463 | ||
| 1464 | /* This mask is used to disable sending the ASCONF chunk | ||
| 1465 | * with specified parameter to peer. | ||
| 1466 | */ | ||
| 1467 | __be16 addip_disabled_mask; | ||
| 1468 | |||
| 1469 | /* These are capabilities which our peer advertised. */ | ||
| 1470 | __u8 ecn_capable:1, /* Can peer do ECN? */ | ||
| 1471 | ipv4_address:1, /* Peer understands IPv4 addresses? */ | ||
| 1472 | ipv6_address:1, /* Peer understands IPv6 addresses? */ | ||
| 1473 | hostname_address:1, /* Peer understands DNS addresses? */ | ||
| 1474 | asconf_capable:1, /* Does peer support ADDIP? */ | ||
| 1475 | prsctp_capable:1, /* Can peer do PR-SCTP? */ | ||
| 1476 | auth_capable:1; /* Is peer doing SCTP-AUTH? */ | ||
| 1477 | |||
| 1468 | /* Ack State : This flag indicates if the next received | 1478 | /* Ack State : This flag indicates if the next received |
| 1469 | * : packet is to be responded to with a | 1479 | * : packet is to be responded to with a |
| 1470 | * : SACK. This is initializedto 0. When a packet | 1480 | * : SACK. This is initializedto 0. When a packet |
| @@ -1479,25 +1489,11 @@ struct sctp_association { | |||
| 1479 | __u32 sack_cnt; | 1489 | __u32 sack_cnt; |
| 1480 | __u32 sack_generation; | 1490 | __u32 sack_generation; |
| 1481 | 1491 | ||
| 1482 | /* These are capabilities which our peer advertised. */ | ||
| 1483 | __u8 ecn_capable:1, /* Can peer do ECN? */ | ||
| 1484 | ipv4_address:1, /* Peer understands IPv4 addresses? */ | ||
| 1485 | ipv6_address:1, /* Peer understands IPv6 addresses? */ | ||
| 1486 | hostname_address:1, /* Peer understands DNS addresses? */ | ||
| 1487 | asconf_capable:1, /* Does peer support ADDIP? */ | ||
| 1488 | prsctp_capable:1, /* Can peer do PR-SCTP? */ | ||
| 1489 | auth_capable:1; /* Is peer doing SCTP-AUTH? */ | ||
| 1490 | |||
| 1491 | __u32 adaptation_ind; /* Adaptation Code point. */ | 1492 | __u32 adaptation_ind; /* Adaptation Code point. */ |
| 1492 | 1493 | ||
| 1493 | /* This mask is used to disable sending the ASCONF chunk | ||
| 1494 | * with specified parameter to peer. | ||
| 1495 | */ | ||
| 1496 | __be16 addip_disabled_mask; | ||
| 1497 | |||
| 1498 | struct sctp_inithdr_host i; | 1494 | struct sctp_inithdr_host i; |
| 1499 | int cookie_len; | ||
| 1500 | void *cookie; | 1495 | void *cookie; |
| 1496 | int cookie_len; | ||
| 1501 | 1497 | ||
| 1502 | /* ADDIP Section 4.2 Upon reception of an ASCONF Chunk. | 1498 | /* ADDIP Section 4.2 Upon reception of an ASCONF Chunk. |
| 1503 | * C1) ... "Peer-Serial-Number'. This value MUST be initialized to the | 1499 | * C1) ... "Peer-Serial-Number'. This value MUST be initialized to the |
| @@ -1529,14 +1525,14 @@ struct sctp_association { | |||
| 1529 | */ | 1525 | */ |
| 1530 | sctp_state_t state; | 1526 | sctp_state_t state; |
| 1531 | 1527 | ||
| 1532 | /* The cookie life I award for any cookie. */ | ||
| 1533 | ktime_t cookie_life; | ||
| 1534 | |||
| 1535 | /* Overall : The overall association error count. | 1528 | /* Overall : The overall association error count. |
| 1536 | * Error Count : [Clear this any time I get something.] | 1529 | * Error Count : [Clear this any time I get something.] |
| 1537 | */ | 1530 | */ |
| 1538 | int overall_error_count; | 1531 | int overall_error_count; |
| 1539 | 1532 | ||
| 1533 | /* The cookie life I award for any cookie. */ | ||
| 1534 | ktime_t cookie_life; | ||
| 1535 | |||
| 1540 | /* These are the association's initial, max, and min RTO values. | 1536 | /* These are the association's initial, max, and min RTO values. |
| 1541 | * These values will be initialized by system defaults, but can | 1537 | * These values will be initialized by system defaults, but can |
| 1542 | * be modified via the SCTP_RTOINFO socket option. | 1538 | * be modified via the SCTP_RTOINFO socket option. |
| @@ -1591,10 +1587,9 @@ struct sctp_association { | |||
| 1591 | /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ | 1587 | /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ |
| 1592 | __u32 param_flags; | 1588 | __u32 param_flags; |
| 1593 | 1589 | ||
| 1590 | __u32 sackfreq; | ||
| 1594 | /* SACK delay timeout */ | 1591 | /* SACK delay timeout */ |
| 1595 | unsigned long sackdelay; | 1592 | unsigned long sackdelay; |
| 1596 | __u32 sackfreq; | ||
| 1597 | |||
| 1598 | 1593 | ||
| 1599 | unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES]; | 1594 | unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES]; |
| 1600 | struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES]; | 1595 | struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES]; |
| @@ -1602,12 +1597,12 @@ struct sctp_association { | |||
| 1602 | /* Transport to which SHUTDOWN chunk was last sent. */ | 1597 | /* Transport to which SHUTDOWN chunk was last sent. */ |
| 1603 | struct sctp_transport *shutdown_last_sent_to; | 1598 | struct sctp_transport *shutdown_last_sent_to; |
| 1604 | 1599 | ||
| 1605 | /* How many times have we resent a SHUTDOWN */ | ||
| 1606 | int shutdown_retries; | ||
| 1607 | |||
| 1608 | /* Transport to which INIT chunk was last sent. */ | 1600 | /* Transport to which INIT chunk was last sent. */ |
| 1609 | struct sctp_transport *init_last_sent_to; | 1601 | struct sctp_transport *init_last_sent_to; |
| 1610 | 1602 | ||
| 1603 | /* How many times have we resent a SHUTDOWN */ | ||
| 1604 | int shutdown_retries; | ||
| 1605 | |||
| 1611 | /* Next TSN : The next TSN number to be assigned to a new | 1606 | /* Next TSN : The next TSN number to be assigned to a new |
| 1612 | * : DATA chunk. This is sent in the INIT or INIT | 1607 | * : DATA chunk. This is sent in the INIT or INIT |
| 1613 | * : ACK chunk to the peer and incremented each | 1608 | * : ACK chunk to the peer and incremented each |
| @@ -1725,12 +1720,6 @@ struct sctp_association { | |||
| 1725 | /* How many duplicated TSNs have we seen? */ | 1720 | /* How many duplicated TSNs have we seen? */ |
| 1726 | int numduptsns; | 1721 | int numduptsns; |
| 1727 | 1722 | ||
| 1728 | /* Number of seconds of idle time before an association is closed. | ||
| 1729 | * In the association context, this is really used as a boolean | ||
| 1730 | * since the real timeout is stored in the timeouts array | ||
| 1731 | */ | ||
| 1732 | __u32 autoclose; | ||
| 1733 | |||
| 1734 | /* These are to support | 1723 | /* These are to support |
| 1735 | * "SCTP Extensions for Dynamic Reconfiguration of IP Addresses | 1724 | * "SCTP Extensions for Dynamic Reconfiguration of IP Addresses |
| 1736 | * and Enforcement of Flow and Message Limits" | 1725 | * and Enforcement of Flow and Message Limits" |
| @@ -1818,8 +1807,8 @@ struct sctp_association { | |||
| 1818 | * after reaching 4294967295. | 1807 | * after reaching 4294967295. |
| 1819 | */ | 1808 | */ |
| 1820 | __u32 addip_serial; | 1809 | __u32 addip_serial; |
| 1821 | union sctp_addr *asconf_addr_del_pending; | ||
| 1822 | int src_out_of_asoc_ok; | 1810 | int src_out_of_asoc_ok; |
| 1811 | union sctp_addr *asconf_addr_del_pending; | ||
| 1823 | struct sctp_transport *new_transport; | 1812 | struct sctp_transport *new_transport; |
| 1824 | 1813 | ||
| 1825 | /* SCTP AUTH: list of the endpoint shared keys. These | 1814 | /* SCTP AUTH: list of the endpoint shared keys. These |
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h index 54bbbe547303..31b8dbaad45a 100644 --- a/include/net/sctp/tsnmap.h +++ b/include/net/sctp/tsnmap.h | |||
| @@ -22,9 +22,8 @@ | |||
| 22 | * See the GNU General Public License for more details. | 22 | * See the GNU General Public License for more details. |
| 23 | * | 23 | * |
| 24 | * You should have received a copy of the GNU General Public License | 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with GNU CC; see the file COPYING. If not, write to | 25 | * along with GNU CC; see the file COPYING. If not, see |
| 26 | * the Free Software Foundation, 59 Temple Place - Suite 330, | 26 | * <http://www.gnu.org/licenses/>. |
| 27 | * Boston, MA 02111-1307, USA. | ||
| 28 | * | 27 | * |
| 29 | * Please send any bug reports or fixes you make to the | 28 | * Please send any bug reports or fixes you make to the |
| 30 | * email address(es): | 29 | * email address(es): |
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h index 27b9f5c90153..daacb32b55b5 100644 --- a/include/net/sctp/ulpevent.h +++ b/include/net/sctp/ulpevent.h | |||
| @@ -25,9 +25,8 @@ | |||
| 25 | * See the GNU General Public License for more details. | 25 | * See the GNU General Public License for more details. |
| 26 | * | 26 | * |
| 27 | * You should have received a copy of the GNU General Public License | 27 | * You should have received a copy of the GNU General Public License |
| 28 | * along with GNU CC; see the file COPYING. If not, write to | 28 | * along with GNU CC; see the file COPYING. If not, see |
| 29 | * the Free Software Foundation, 59 Temple Place - Suite 330, | 29 | * <http://www.gnu.org/licenses/>. |
| 30 | * Boston, MA 02111-1307, USA. | ||
| 31 | * | 30 | * |
| 32 | * Please send any bug reports or fixes you make to the | 31 | * Please send any bug reports or fixes you make to the |
| 33 | * email address(es): | 32 | * email address(es): |
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h index b0cf5d54d717..e0dce07b8794 100644 --- a/include/net/sctp/ulpqueue.h +++ b/include/net/sctp/ulpqueue.h | |||
| @@ -24,9 +24,8 @@ | |||
| 24 | * See the GNU General Public License for more details. | 24 | * See the GNU General Public License for more details. |
| 25 | * | 25 | * |
| 26 | * You should have received a copy of the GNU General Public License | 26 | * You should have received a copy of the GNU General Public License |
| 27 | * along with GNU CC; see the file COPYING. If not, write to | 27 | * along with GNU CC; see the file COPYING. If not, see |
| 28 | * the Free Software Foundation, 59 Temple Place - Suite 330, | 28 | * <http://www.gnu.org/licenses/>. |
| 29 | * Boston, MA 02111-1307, USA. | ||
| 30 | * | 29 | * |
| 31 | * Please send any bug reports or fixes you make to the | 30 | * Please send any bug reports or fixes you make to the |
| 32 | * email addresses: | 31 | * email addresses: |
diff --git a/include/net/sock.h b/include/net/sock.h index e3a18ff0c38b..5c3f7c3624aa 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -395,7 +395,7 @@ struct sock { | |||
| 395 | unsigned short sk_ack_backlog; | 395 | unsigned short sk_ack_backlog; |
| 396 | unsigned short sk_max_ack_backlog; | 396 | unsigned short sk_max_ack_backlog; |
| 397 | __u32 sk_priority; | 397 | __u32 sk_priority; |
| 398 | #if IS_ENABLED(CONFIG_NETPRIO_CGROUP) | 398 | #if IS_ENABLED(CONFIG_CGROUP_NET_PRIO) |
| 399 | __u32 sk_cgrp_prioidx; | 399 | __u32 sk_cgrp_prioidx; |
| 400 | #endif | 400 | #endif |
| 401 | struct pid *sk_peer_pid; | 401 | struct pid *sk_peer_pid; |
| @@ -820,30 +820,44 @@ static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) | |||
| 820 | return sk->sk_backlog_rcv(sk, skb); | 820 | return sk->sk_backlog_rcv(sk, skb); |
| 821 | } | 821 | } |
| 822 | 822 | ||
| 823 | static inline void sock_rps_record_flow(const struct sock *sk) | 823 | static inline void sock_rps_record_flow_hash(__u32 hash) |
| 824 | { | 824 | { |
| 825 | #ifdef CONFIG_RPS | 825 | #ifdef CONFIG_RPS |
| 826 | struct rps_sock_flow_table *sock_flow_table; | 826 | struct rps_sock_flow_table *sock_flow_table; |
| 827 | 827 | ||
| 828 | rcu_read_lock(); | 828 | rcu_read_lock(); |
| 829 | sock_flow_table = rcu_dereference(rps_sock_flow_table); | 829 | sock_flow_table = rcu_dereference(rps_sock_flow_table); |
| 830 | rps_record_sock_flow(sock_flow_table, sk->sk_rxhash); | 830 | rps_record_sock_flow(sock_flow_table, hash); |
| 831 | rcu_read_unlock(); | 831 | rcu_read_unlock(); |
| 832 | #endif | 832 | #endif |
| 833 | } | 833 | } |
| 834 | 834 | ||
| 835 | static inline void sock_rps_reset_flow(const struct sock *sk) | 835 | static inline void sock_rps_reset_flow_hash(__u32 hash) |
| 836 | { | 836 | { |
| 837 | #ifdef CONFIG_RPS | 837 | #ifdef CONFIG_RPS |
| 838 | struct rps_sock_flow_table *sock_flow_table; | 838 | struct rps_sock_flow_table *sock_flow_table; |
| 839 | 839 | ||
| 840 | rcu_read_lock(); | 840 | rcu_read_lock(); |
| 841 | sock_flow_table = rcu_dereference(rps_sock_flow_table); | 841 | sock_flow_table = rcu_dereference(rps_sock_flow_table); |
| 842 | rps_reset_sock_flow(sock_flow_table, sk->sk_rxhash); | 842 | rps_reset_sock_flow(sock_flow_table, hash); |
| 843 | rcu_read_unlock(); | 843 | rcu_read_unlock(); |
| 844 | #endif | 844 | #endif |
| 845 | } | 845 | } |
| 846 | 846 | ||
| 847 | static inline void sock_rps_record_flow(const struct sock *sk) | ||
| 848 | { | ||
| 849 | #ifdef CONFIG_RPS | ||
| 850 | sock_rps_record_flow_hash(sk->sk_rxhash); | ||
| 851 | #endif | ||
| 852 | } | ||
| 853 | |||
| 854 | static inline void sock_rps_reset_flow(const struct sock *sk) | ||
| 855 | { | ||
| 856 | #ifdef CONFIG_RPS | ||
| 857 | sock_rps_reset_flow_hash(sk->sk_rxhash); | ||
| 858 | #endif | ||
| 859 | } | ||
| 860 | |||
| 847 | static inline void sock_rps_save_rxhash(struct sock *sk, | 861 | static inline void sock_rps_save_rxhash(struct sock *sk, |
| 848 | const struct sk_buff *skb) | 862 | const struct sk_buff *skb) |
| 849 | { | 863 | { |
| @@ -1035,7 +1049,6 @@ enum cg_proto_flags { | |||
| 1035 | }; | 1049 | }; |
| 1036 | 1050 | ||
| 1037 | struct cg_proto { | 1051 | struct cg_proto { |
| 1038 | void (*enter_memory_pressure)(struct sock *sk); | ||
| 1039 | struct res_counter memory_allocated; /* Current allocated memory. */ | 1052 | struct res_counter memory_allocated; /* Current allocated memory. */ |
| 1040 | struct percpu_counter sockets_allocated; /* Current number of sockets. */ | 1053 | struct percpu_counter sockets_allocated; /* Current number of sockets. */ |
| 1041 | int memory_pressure; | 1054 | int memory_pressure; |
| @@ -1155,8 +1168,7 @@ static inline void sk_leave_memory_pressure(struct sock *sk) | |||
| 1155 | struct proto *prot = sk->sk_prot; | 1168 | struct proto *prot = sk->sk_prot; |
| 1156 | 1169 | ||
| 1157 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) | 1170 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) |
| 1158 | if (cg_proto->memory_pressure) | 1171 | cg_proto->memory_pressure = 0; |
| 1159 | cg_proto->memory_pressure = 0; | ||
| 1160 | } | 1172 | } |
| 1161 | 1173 | ||
| 1162 | } | 1174 | } |
| @@ -1171,7 +1183,7 @@ static inline void sk_enter_memory_pressure(struct sock *sk) | |||
| 1171 | struct proto *prot = sk->sk_prot; | 1183 | struct proto *prot = sk->sk_prot; |
| 1172 | 1184 | ||
| 1173 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) | 1185 | for (; cg_proto; cg_proto = parent_cg_proto(prot, cg_proto)) |
| 1174 | cg_proto->enter_memory_pressure(sk); | 1186 | cg_proto->memory_pressure = 1; |
| 1175 | } | 1187 | } |
| 1176 | 1188 | ||
| 1177 | sk->sk_prot->enter_memory_pressure(sk); | 1189 | sk->sk_prot->enter_memory_pressure(sk); |
| @@ -1537,8 +1549,6 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority); | |||
| 1537 | 1549 | ||
| 1538 | struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force, | 1550 | struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force, |
| 1539 | gfp_t priority); | 1551 | gfp_t priority); |
| 1540 | struct sk_buff *sock_rmalloc(struct sock *sk, unsigned long size, int force, | ||
| 1541 | gfp_t priority); | ||
| 1542 | void sock_wfree(struct sk_buff *skb); | 1552 | void sock_wfree(struct sk_buff *skb); |
| 1543 | void skb_orphan_partial(struct sk_buff *skb); | 1553 | void skb_orphan_partial(struct sk_buff *skb); |
| 1544 | void sock_rfree(struct sk_buff *skb); | 1554 | void sock_rfree(struct sk_buff *skb); |
diff --git a/include/net/tc_act/tc_skbedit.h b/include/net/tc_act/tc_skbedit.h index e103fe02f375..dd5d86fab030 100644 --- a/include/net/tc_act/tc_skbedit.h +++ b/include/net/tc_act/tc_skbedit.h | |||
| @@ -11,8 +11,7 @@ | |||
| 11 | * more details. | 11 | * more details. |
| 12 | * | 12 | * |
| 13 | * You should have received a copy of the GNU General Public License along with | 13 | * You should have received a copy of the GNU General Public License along with |
| 14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 14 | * this program; if not, see <http://www.gnu.org/licenses/>. |
| 15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
| 16 | * | 15 | * |
| 17 | * Author: Alexander Duyck <alexander.h.duyck@intel.com> | 16 | * Author: Alexander Duyck <alexander.h.duyck@intel.com> |
| 18 | */ | 17 | */ |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 70e55d200610..56fc366da6d5 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -282,6 +282,7 @@ extern int sysctl_tcp_limit_output_bytes; | |||
| 282 | extern int sysctl_tcp_challenge_ack_limit; | 282 | extern int sysctl_tcp_challenge_ack_limit; |
| 283 | extern unsigned int sysctl_tcp_notsent_lowat; | 283 | extern unsigned int sysctl_tcp_notsent_lowat; |
| 284 | extern int sysctl_tcp_min_tso_segs; | 284 | extern int sysctl_tcp_min_tso_segs; |
| 285 | extern int sysctl_tcp_autocorking; | ||
| 285 | 286 | ||
| 286 | extern atomic_long_t tcp_memory_allocated; | 287 | extern atomic_long_t tcp_memory_allocated; |
| 287 | extern struct percpu_counter tcp_sockets_allocated; | 288 | extern struct percpu_counter tcp_sockets_allocated; |
| @@ -467,7 +468,6 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, | |||
| 467 | struct tcp_fastopen_cookie *foc); | 468 | struct tcp_fastopen_cookie *foc); |
| 468 | int tcp_disconnect(struct sock *sk, int flags); | 469 | int tcp_disconnect(struct sock *sk, int flags); |
| 469 | 470 | ||
| 470 | void tcp_connect_init(struct sock *sk); | ||
| 471 | void tcp_finish_connect(struct sock *sk, struct sk_buff *skb); | 471 | void tcp_finish_connect(struct sock *sk, struct sk_buff *skb); |
| 472 | int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size); | 472 | int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size); |
| 473 | void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb); | 473 | void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb); |
| @@ -622,8 +622,6 @@ static inline u32 __tcp_set_rto(const struct tcp_sock *tp) | |||
| 622 | return (tp->srtt >> 3) + tp->rttvar; | 622 | return (tp->srtt >> 3) + tp->rttvar; |
| 623 | } | 623 | } |
| 624 | 624 | ||
| 625 | void tcp_set_rto(struct sock *sk); | ||
| 626 | |||
| 627 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) | 625 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) |
| 628 | { | 626 | { |
| 629 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | | 627 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | |
| @@ -977,13 +975,6 @@ static inline u32 tcp_wnd_end(const struct tcp_sock *tp) | |||
| 977 | } | 975 | } |
| 978 | bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight); | 976 | bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight); |
| 979 | 977 | ||
| 980 | static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss, | ||
| 981 | const struct sk_buff *skb) | ||
| 982 | { | ||
| 983 | if (skb->len < mss) | ||
| 984 | tp->snd_sml = TCP_SKB_CB(skb)->end_seq; | ||
| 985 | } | ||
| 986 | |||
| 987 | static inline void tcp_check_probe_timer(struct sock *sk) | 978 | static inline void tcp_check_probe_timer(struct sock *sk) |
| 988 | { | 979 | { |
| 989 | const struct tcp_sock *tp = tcp_sk(sk); | 980 | const struct tcp_sock *tp = tcp_sk(sk); |
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h index 48660e50ae90..b927413dde86 100644 --- a/include/net/transp_v6.h +++ b/include/net/transp_v6.h | |||
| @@ -32,8 +32,13 @@ void tcpv6_exit(void); | |||
| 32 | 32 | ||
| 33 | int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); | 33 | int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); |
| 34 | 34 | ||
| 35 | int ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg, | 35 | /* this does all the common and the specific ctl work */ |
| 36 | struct sk_buff *skb); | 36 | void ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg, |
| 37 | struct sk_buff *skb); | ||
| 38 | void ip6_datagram_recv_common_ctl(struct sock *sk, struct msghdr *msg, | ||
| 39 | struct sk_buff *skb); | ||
| 40 | void ip6_datagram_recv_specific_ctl(struct sock *sk, struct msghdr *msg, | ||
| 41 | struct sk_buff *skb); | ||
| 37 | 42 | ||
| 38 | int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg, | 43 | int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg, |
| 39 | struct flowi6 *fl6, struct ipv6_txoptions *opt, | 44 | struct flowi6 *fl6, struct ipv6_txoptions *opt, |
diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 6b6d180fb91a..5deef1ae78c9 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h | |||
| @@ -21,6 +21,7 @@ struct vxlan_sock { | |||
| 21 | struct rcu_head rcu; | 21 | struct rcu_head rcu; |
| 22 | struct hlist_head vni_list[VNI_HASH_SIZE]; | 22 | struct hlist_head vni_list[VNI_HASH_SIZE]; |
| 23 | atomic_t refcnt; | 23 | atomic_t refcnt; |
| 24 | struct udp_offload udp_offloads; | ||
| 24 | }; | 25 | }; |
| 25 | 26 | ||
| 26 | struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, | 27 | struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 6b82fdf4ba71..afa5730fb3bd 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -53,7 +53,6 @@ | |||
| 53 | #define XFRM_INC_STATS_USER(net, field) ((void)(net)) | 53 | #define XFRM_INC_STATS_USER(net, field) ((void)(net)) |
| 54 | #endif | 54 | #endif |
| 55 | 55 | ||
| 56 | extern struct mutex xfrm_cfg_mutex; | ||
| 57 | 56 | ||
| 58 | /* Organization of SPD aka "XFRM rules" | 57 | /* Organization of SPD aka "XFRM rules" |
| 59 | ------------------------------------ | 58 | ------------------------------------ |
| @@ -681,7 +680,7 @@ struct xfrm_spi_skb_cb { | |||
| 681 | struct xfrm_audit { | 680 | struct xfrm_audit { |
| 682 | u32 secid; | 681 | u32 secid; |
| 683 | kuid_t loginuid; | 682 | kuid_t loginuid; |
| 684 | u32 sessionid; | 683 | unsigned int sessionid; |
| 685 | }; | 684 | }; |
| 686 | 685 | ||
| 687 | #ifdef CONFIG_AUDITSYSCALL | 686 | #ifdef CONFIG_AUDITSYSCALL |
| @@ -699,7 +698,7 @@ static inline struct audit_buffer *xfrm_audit_start(const char *op) | |||
| 699 | return audit_buf; | 698 | return audit_buf; |
| 700 | } | 699 | } |
| 701 | 700 | ||
| 702 | static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid, | 701 | static inline void xfrm_audit_helper_usrinfo(kuid_t auid, unsigned int ses, u32 secid, |
| 703 | struct audit_buffer *audit_buf) | 702 | struct audit_buffer *audit_buf) |
| 704 | { | 703 | { |
| 705 | char *secctx; | 704 | char *secctx; |
| @@ -716,13 +715,13 @@ static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid, | |||
| 716 | } | 715 | } |
| 717 | 716 | ||
| 718 | void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, kuid_t auid, | 717 | void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, kuid_t auid, |
| 719 | u32 ses, u32 secid); | 718 | unsigned int ses, u32 secid); |
| 720 | void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, kuid_t auid, | 719 | void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, kuid_t auid, |
| 721 | u32 ses, u32 secid); | 720 | unsigned int ses, u32 secid); |
| 722 | void xfrm_audit_state_add(struct xfrm_state *x, int result, kuid_t auid, | 721 | void xfrm_audit_state_add(struct xfrm_state *x, int result, kuid_t auid, |
| 723 | u32 ses, u32 secid); | 722 | unsigned int ses, u32 secid); |
| 724 | void xfrm_audit_state_delete(struct xfrm_state *x, int result, kuid_t auid, | 723 | void xfrm_audit_state_delete(struct xfrm_state *x, int result, kuid_t auid, |
| 725 | u32 ses, u32 secid); | 724 | unsigned int ses, u32 secid); |
| 726 | void xfrm_audit_state_replay_overflow(struct xfrm_state *x, | 725 | void xfrm_audit_state_replay_overflow(struct xfrm_state *x, |
| 727 | struct sk_buff *skb); | 726 | struct sk_buff *skb); |
| 728 | void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb, | 727 | void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb, |
| @@ -735,22 +734,22 @@ void xfrm_audit_state_icvfail(struct xfrm_state *x, struct sk_buff *skb, | |||
| 735 | #else | 734 | #else |
| 736 | 735 | ||
| 737 | static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, | 736 | static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, |
| 738 | kuid_t auid, u32 ses, u32 secid) | 737 | kuid_t auid, unsigned int ses, u32 secid) |
| 739 | { | 738 | { |
| 740 | } | 739 | } |
| 741 | 740 | ||
| 742 | static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, | 741 | static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, |
| 743 | kuid_t auid, u32 ses, u32 secid) | 742 | kuid_t auid, unsigned int ses, u32 secid) |
| 744 | { | 743 | { |
| 745 | } | 744 | } |
| 746 | 745 | ||
| 747 | static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, | 746 | static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, |
| 748 | kuid_t auid, u32 ses, u32 secid) | 747 | kuid_t auid, unsigned int ses, u32 secid) |
| 749 | { | 748 | { |
| 750 | } | 749 | } |
| 751 | 750 | ||
| 752 | static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, | 751 | static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, |
| 753 | kuid_t auid, u32 ses, u32 secid) | 752 | kuid_t auid, unsigned int ses, u32 secid) |
| 754 | { | 753 | { |
| 755 | } | 754 | } |
| 756 | 755 | ||
| @@ -1409,7 +1408,7 @@ static inline void xfrm_sysctl_fini(struct net *net) | |||
| 1409 | void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); | 1408 | void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); |
| 1410 | int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, | 1409 | int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, |
| 1411 | int (*func)(struct xfrm_state *, int, void*), void *); | 1410 | int (*func)(struct xfrm_state *, int, void*), void *); |
| 1412 | void xfrm_state_walk_done(struct xfrm_state_walk *walk); | 1411 | void xfrm_state_walk_done(struct xfrm_state_walk *walk, struct net *net); |
| 1413 | struct xfrm_state *xfrm_state_alloc(struct net *net); | 1412 | struct xfrm_state *xfrm_state_alloc(struct net *net); |
| 1414 | struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr, | 1413 | struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr, |
| 1415 | const xfrm_address_t *saddr, | 1414 | const xfrm_address_t *saddr, |
| @@ -1422,6 +1421,8 @@ struct xfrm_state *xfrm_stateonly_find(struct net *net, u32 mark, | |||
| 1422 | xfrm_address_t *saddr, | 1421 | xfrm_address_t *saddr, |
| 1423 | unsigned short family, | 1422 | unsigned short family, |
| 1424 | u8 mode, u8 proto, u32 reqid); | 1423 | u8 mode, u8 proto, u32 reqid); |
| 1424 | struct xfrm_state *xfrm_state_lookup_byspi(struct net *net, __be32 spi, | ||
| 1425 | unsigned short family); | ||
| 1425 | int xfrm_state_check_expire(struct xfrm_state *x); | 1426 | int xfrm_state_check_expire(struct xfrm_state *x); |
| 1426 | void xfrm_state_insert(struct xfrm_state *x); | 1427 | void xfrm_state_insert(struct xfrm_state *x); |
| 1427 | int xfrm_state_add(struct xfrm_state *x); | 1428 | int xfrm_state_add(struct xfrm_state *x); |
| @@ -1436,12 +1437,12 @@ struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark, | |||
| 1436 | unsigned short family); | 1437 | unsigned short family); |
| 1437 | #ifdef CONFIG_XFRM_SUB_POLICY | 1438 | #ifdef CONFIG_XFRM_SUB_POLICY |
| 1438 | int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n, | 1439 | int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n, |
| 1439 | unsigned short family); | 1440 | unsigned short family, struct net *net); |
| 1440 | int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n, | 1441 | int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n, |
| 1441 | unsigned short family); | 1442 | unsigned short family); |
| 1442 | #else | 1443 | #else |
| 1443 | static inline int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, | 1444 | static inline int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, |
| 1444 | int n, unsigned short family) | 1445 | int n, unsigned short family, struct net *net) |
| 1445 | { | 1446 | { |
| 1446 | return -ENOSYS; | 1447 | return -ENOSYS; |
| 1447 | } | 1448 | } |
| @@ -1553,7 +1554,7 @@ void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type); | |||
| 1553 | int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk, | 1554 | int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk, |
| 1554 | int (*func)(struct xfrm_policy *, int, int, void*), | 1555 | int (*func)(struct xfrm_policy *, int, int, void*), |
| 1555 | void *); | 1556 | void *); |
| 1556 | void xfrm_policy_walk_done(struct xfrm_policy_walk *walk); | 1557 | void xfrm_policy_walk_done(struct xfrm_policy_walk *walk, struct net *net); |
| 1557 | int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); | 1558 | int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); |
| 1558 | struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, | 1559 | struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, |
| 1559 | u8 type, int dir, | 1560 | u8 type, int dir, |
| @@ -1564,6 +1565,7 @@ struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir, | |||
| 1564 | u32 id, int delete, int *err); | 1565 | u32 id, int delete, int *err); |
| 1565 | int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); | 1566 | int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); |
| 1566 | u32 xfrm_get_acqseq(void); | 1567 | u32 xfrm_get_acqseq(void); |
| 1568 | int verify_spi_info(u8 proto, u32 min, u32 max); | ||
| 1567 | int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); | 1569 | int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); |
| 1568 | struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark, | 1570 | struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark, |
| 1569 | u8 mode, u32 reqid, u8 proto, | 1571 | u8 mode, u32 reqid, u8 proto, |
| @@ -1576,12 +1578,12 @@ int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); | |||
| 1576 | int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, | 1578 | int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, |
| 1577 | const struct xfrm_migrate *m, int num_bundles, | 1579 | const struct xfrm_migrate *m, int num_bundles, |
| 1578 | const struct xfrm_kmaddress *k); | 1580 | const struct xfrm_kmaddress *k); |
| 1579 | struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m); | 1581 | struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *net); |
| 1580 | struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x, | 1582 | struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x, |
| 1581 | struct xfrm_migrate *m); | 1583 | struct xfrm_migrate *m); |
| 1582 | int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, | 1584 | int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, |
| 1583 | struct xfrm_migrate *m, int num_bundles, | 1585 | struct xfrm_migrate *m, int num_bundles, |
| 1584 | struct xfrm_kmaddress *k); | 1586 | struct xfrm_kmaddress *k, struct net *net); |
| 1585 | #endif | 1587 | #endif |
| 1586 | 1588 | ||
| 1587 | int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); | 1589 | int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); |
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h index f3ac0f2c4c66..ce55906b54a0 100644 --- a/include/rdma/ib_addr.h +++ b/include/rdma/ib_addr.h | |||
| @@ -38,10 +38,15 @@ | |||
| 38 | #include <linux/in6.h> | 38 | #include <linux/in6.h> |
| 39 | #include <linux/if_arp.h> | 39 | #include <linux/if_arp.h> |
| 40 | #include <linux/netdevice.h> | 40 | #include <linux/netdevice.h> |
| 41 | #include <linux/inetdevice.h> | ||
| 41 | #include <linux/socket.h> | 42 | #include <linux/socket.h> |
| 42 | #include <linux/if_vlan.h> | 43 | #include <linux/if_vlan.h> |
| 44 | #include <net/ipv6.h> | ||
| 45 | #include <net/if_inet6.h> | ||
| 46 | #include <net/ip.h> | ||
| 43 | #include <rdma/ib_verbs.h> | 47 | #include <rdma/ib_verbs.h> |
| 44 | #include <rdma/ib_pack.h> | 48 | #include <rdma/ib_pack.h> |
| 49 | #include <net/ipv6.h> | ||
| 45 | 50 | ||
| 46 | struct rdma_addr_client { | 51 | struct rdma_addr_client { |
| 47 | atomic_t refcount; | 52 | atomic_t refcount; |
| @@ -72,7 +77,8 @@ struct rdma_dev_addr { | |||
| 72 | * rdma_translate_ip - Translate a local IP address to an RDMA hardware | 77 | * rdma_translate_ip - Translate a local IP address to an RDMA hardware |
| 73 | * address. | 78 | * address. |
| 74 | */ | 79 | */ |
| 75 | int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr); | 80 | int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr, |
| 81 | u16 *vlan_id); | ||
| 76 | 82 | ||
| 77 | /** | 83 | /** |
| 78 | * rdma_resolve_ip - Resolve source and destination IP addresses to | 84 | * rdma_resolve_ip - Resolve source and destination IP addresses to |
| @@ -104,6 +110,10 @@ int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev, | |||
| 104 | 110 | ||
| 105 | int rdma_addr_size(struct sockaddr *addr); | 111 | int rdma_addr_size(struct sockaddr *addr); |
| 106 | 112 | ||
| 113 | int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id); | ||
| 114 | int rdma_addr_find_dmac_by_grh(union ib_gid *sgid, union ib_gid *dgid, u8 *smac, | ||
| 115 | u16 *vlan_id); | ||
| 116 | |||
| 107 | static inline u16 ib_addr_get_pkey(struct rdma_dev_addr *dev_addr) | 117 | static inline u16 ib_addr_get_pkey(struct rdma_dev_addr *dev_addr) |
| 108 | { | 118 | { |
| 109 | return ((u16)dev_addr->broadcast[8] << 8) | (u16)dev_addr->broadcast[9]; | 119 | return ((u16)dev_addr->broadcast[8] << 8) | (u16)dev_addr->broadcast[9]; |
| @@ -126,41 +136,60 @@ static inline int rdma_addr_gid_offset(struct rdma_dev_addr *dev_addr) | |||
| 126 | return dev_addr->dev_type == ARPHRD_INFINIBAND ? 4 : 0; | 136 | return dev_addr->dev_type == ARPHRD_INFINIBAND ? 4 : 0; |
| 127 | } | 137 | } |
| 128 | 138 | ||
| 129 | static inline void iboe_mac_vlan_to_ll(union ib_gid *gid, u8 *mac, u16 vid) | 139 | static inline u16 rdma_vlan_dev_vlan_id(const struct net_device *dev) |
| 130 | { | 140 | { |
| 131 | memset(gid->raw, 0, 16); | 141 | return dev->priv_flags & IFF_802_1Q_VLAN ? |
| 132 | *((__be32 *) gid->raw) = cpu_to_be32(0xfe800000); | 142 | vlan_dev_vlan_id(dev) : 0xffff; |
| 133 | if (vid < 0x1000) { | 143 | } |
| 134 | gid->raw[12] = vid & 0xff; | 144 | |
| 135 | gid->raw[11] = vid >> 8; | 145 | static inline int rdma_ip2gid(struct sockaddr *addr, union ib_gid *gid) |
| 136 | } else { | 146 | { |
| 137 | gid->raw[12] = 0xfe; | 147 | switch (addr->sa_family) { |
| 138 | gid->raw[11] = 0xff; | 148 | case AF_INET: |
| 149 | ipv6_addr_set_v4mapped(((struct sockaddr_in *) | ||
| 150 | addr)->sin_addr.s_addr, | ||
| 151 | (struct in6_addr *)gid); | ||
| 152 | break; | ||
| 153 | case AF_INET6: | ||
| 154 | memcpy(gid->raw, &((struct sockaddr_in6 *)addr)->sin6_addr, 16); | ||
| 155 | break; | ||
| 156 | default: | ||
| 157 | return -EINVAL; | ||
| 139 | } | 158 | } |
| 140 | memcpy(gid->raw + 13, mac + 3, 3); | 159 | return 0; |
| 141 | memcpy(gid->raw + 8, mac, 3); | ||
| 142 | gid->raw[8] ^= 2; | ||
| 143 | } | 160 | } |
| 144 | 161 | ||
| 145 | static inline u16 rdma_vlan_dev_vlan_id(const struct net_device *dev) | 162 | /* Important - sockaddr should be a union of sockaddr_in and sockaddr_in6 */ |
| 163 | static inline int rdma_gid2ip(struct sockaddr *out, union ib_gid *gid) | ||
| 146 | { | 164 | { |
| 147 | return dev->priv_flags & IFF_802_1Q_VLAN ? | 165 | if (ipv6_addr_v4mapped((struct in6_addr *)gid)) { |
| 148 | vlan_dev_vlan_id(dev) : 0xffff; | 166 | struct sockaddr_in *out_in = (struct sockaddr_in *)out; |
| 167 | memset(out_in, 0, sizeof(*out_in)); | ||
| 168 | out_in->sin_family = AF_INET; | ||
| 169 | memcpy(&out_in->sin_addr.s_addr, gid->raw + 12, 4); | ||
| 170 | } else { | ||
| 171 | struct sockaddr_in6 *out_in = (struct sockaddr_in6 *)out; | ||
| 172 | memset(out_in, 0, sizeof(*out_in)); | ||
| 173 | out_in->sin6_family = AF_INET6; | ||
| 174 | memcpy(&out_in->sin6_addr.s6_addr, gid->raw, 16); | ||
| 175 | } | ||
| 176 | return 0; | ||
| 149 | } | 177 | } |
| 150 | 178 | ||
| 151 | static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr, | 179 | static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr, |
| 152 | union ib_gid *gid) | 180 | union ib_gid *gid) |
| 153 | { | 181 | { |
| 154 | struct net_device *dev; | 182 | struct net_device *dev; |
| 155 | u16 vid = 0xffff; | 183 | struct in_device *ip4; |
| 156 | 184 | ||
| 157 | dev = dev_get_by_index(&init_net, dev_addr->bound_dev_if); | 185 | dev = dev_get_by_index(&init_net, dev_addr->bound_dev_if); |
| 158 | if (dev) { | 186 | if (dev) { |
| 159 | vid = rdma_vlan_dev_vlan_id(dev); | 187 | ip4 = (struct in_device *)dev->ip_ptr; |
| 188 | if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address) | ||
| 189 | ipv6_addr_set_v4mapped(ip4->ifa_list->ifa_address, | ||
| 190 | (struct in6_addr *)gid); | ||
| 160 | dev_put(dev); | 191 | dev_put(dev); |
| 161 | } | 192 | } |
| 162 | |||
| 163 | iboe_mac_vlan_to_ll(gid, dev_addr->src_dev_addr, vid); | ||
| 164 | } | 193 | } |
| 165 | 194 | ||
| 166 | static inline void rdma_addr_get_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) | 195 | static inline void rdma_addr_get_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) |
diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h index 0e3ff30647d5..f29e3a27c2cc 100644 --- a/include/rdma/ib_cm.h +++ b/include/rdma/ib_cm.h | |||
| @@ -601,4 +601,5 @@ struct ib_cm_sidr_rep_param { | |||
| 601 | int ib_send_cm_sidr_rep(struct ib_cm_id *cm_id, | 601 | int ib_send_cm_sidr_rep(struct ib_cm_id *cm_id, |
| 602 | struct ib_cm_sidr_rep_param *param); | 602 | struct ib_cm_sidr_rep_param *param); |
| 603 | 603 | ||
| 604 | int ib_update_cm_av(struct ib_cm_id *id, const u8 *smac, const u8 *alt_smac); | ||
| 604 | #endif /* IB_CM_H */ | 605 | #endif /* IB_CM_H */ |
diff --git a/include/rdma/ib_pack.h b/include/rdma/ib_pack.h index b37fe3b10a9d..b1f7592e02e4 100644 --- a/include/rdma/ib_pack.h +++ b/include/rdma/ib_pack.h | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #define IB_PACK_H | 34 | #define IB_PACK_H |
| 35 | 35 | ||
| 36 | #include <rdma/ib_verbs.h> | 36 | #include <rdma/ib_verbs.h> |
| 37 | #include <uapi/linux/if_ether.h> | ||
| 37 | 38 | ||
| 38 | enum { | 39 | enum { |
| 39 | IB_LRH_BYTES = 8, | 40 | IB_LRH_BYTES = 8, |
diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h index 125f8714301d..7e071a6abb34 100644 --- a/include/rdma/ib_sa.h +++ b/include/rdma/ib_sa.h | |||
| @@ -154,6 +154,9 @@ struct ib_sa_path_rec { | |||
| 154 | u8 packet_life_time_selector; | 154 | u8 packet_life_time_selector; |
| 155 | u8 packet_life_time; | 155 | u8 packet_life_time; |
| 156 | u8 preference; | 156 | u8 preference; |
| 157 | u8 smac[ETH_ALEN]; | ||
| 158 | u8 dmac[ETH_ALEN]; | ||
| 159 | u16 vlan_id; | ||
| 157 | }; | 160 | }; |
| 158 | 161 | ||
| 159 | #define IB_SA_MCMEMBER_REC_MGID IB_SA_COMP_MASK( 0) | 162 | #define IB_SA_MCMEMBER_REC_MGID IB_SA_COMP_MASK( 0) |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 979874c627ee..8d4a1c06f7e4 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
| @@ -48,6 +48,7 @@ | |||
| 48 | #include <linux/rwsem.h> | 48 | #include <linux/rwsem.h> |
| 49 | #include <linux/scatterlist.h> | 49 | #include <linux/scatterlist.h> |
| 50 | #include <linux/workqueue.h> | 50 | #include <linux/workqueue.h> |
| 51 | #include <uapi/linux/if_ether.h> | ||
| 51 | 52 | ||
| 52 | #include <linux/atomic.h> | 53 | #include <linux/atomic.h> |
| 53 | #include <asm/uaccess.h> | 54 | #include <asm/uaccess.h> |
| @@ -69,12 +70,14 @@ enum rdma_node_type { | |||
| 69 | RDMA_NODE_IB_ROUTER, | 70 | RDMA_NODE_IB_ROUTER, |
| 70 | RDMA_NODE_RNIC, | 71 | RDMA_NODE_RNIC, |
| 71 | RDMA_NODE_USNIC, | 72 | RDMA_NODE_USNIC, |
| 73 | RDMA_NODE_USNIC_UDP, | ||
| 72 | }; | 74 | }; |
| 73 | 75 | ||
| 74 | enum rdma_transport_type { | 76 | enum rdma_transport_type { |
| 75 | RDMA_TRANSPORT_IB, | 77 | RDMA_TRANSPORT_IB, |
| 76 | RDMA_TRANSPORT_IWARP, | 78 | RDMA_TRANSPORT_IWARP, |
| 77 | RDMA_TRANSPORT_USNIC | 79 | RDMA_TRANSPORT_USNIC, |
| 80 | RDMA_TRANSPORT_USNIC_UDP | ||
| 78 | }; | 81 | }; |
| 79 | 82 | ||
| 80 | enum rdma_transport_type | 83 | enum rdma_transport_type |
| @@ -472,6 +475,8 @@ struct ib_ah_attr { | |||
| 472 | u8 static_rate; | 475 | u8 static_rate; |
| 473 | u8 ah_flags; | 476 | u8 ah_flags; |
| 474 | u8 port_num; | 477 | u8 port_num; |
| 478 | u8 dmac[ETH_ALEN]; | ||
| 479 | u16 vlan_id; | ||
| 475 | }; | 480 | }; |
| 476 | 481 | ||
| 477 | enum ib_wc_status { | 482 | enum ib_wc_status { |
| @@ -524,6 +529,8 @@ enum ib_wc_flags { | |||
| 524 | IB_WC_WITH_IMM = (1<<1), | 529 | IB_WC_WITH_IMM = (1<<1), |
| 525 | IB_WC_WITH_INVALIDATE = (1<<2), | 530 | IB_WC_WITH_INVALIDATE = (1<<2), |
| 526 | IB_WC_IP_CSUM_OK = (1<<3), | 531 | IB_WC_IP_CSUM_OK = (1<<3), |
| 532 | IB_WC_WITH_SMAC = (1<<4), | ||
| 533 | IB_WC_WITH_VLAN = (1<<5), | ||
| 527 | }; | 534 | }; |
| 528 | 535 | ||
| 529 | struct ib_wc { | 536 | struct ib_wc { |
| @@ -544,6 +551,8 @@ struct ib_wc { | |||
| 544 | u8 sl; | 551 | u8 sl; |
| 545 | u8 dlid_path_bits; | 552 | u8 dlid_path_bits; |
| 546 | u8 port_num; /* valid only for DR SMPs on switches */ | 553 | u8 port_num; /* valid only for DR SMPs on switches */ |
| 554 | u8 smac[ETH_ALEN]; | ||
| 555 | u16 vlan_id; | ||
| 547 | }; | 556 | }; |
| 548 | 557 | ||
| 549 | enum ib_cq_notify_flags { | 558 | enum ib_cq_notify_flags { |
| @@ -633,6 +642,7 @@ enum ib_qp_type { | |||
| 633 | enum ib_qp_create_flags { | 642 | enum ib_qp_create_flags { |
| 634 | IB_QP_CREATE_IPOIB_UD_LSO = 1 << 0, | 643 | IB_QP_CREATE_IPOIB_UD_LSO = 1 << 0, |
| 635 | IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK = 1 << 1, | 644 | IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK = 1 << 1, |
| 645 | IB_QP_CREATE_NETIF_QP = 1 << 5, | ||
| 636 | /* reserve bits 26-31 for low level drivers' internal use */ | 646 | /* reserve bits 26-31 for low level drivers' internal use */ |
| 637 | IB_QP_CREATE_RESERVED_START = 1 << 26, | 647 | IB_QP_CREATE_RESERVED_START = 1 << 26, |
| 638 | IB_QP_CREATE_RESERVED_END = 1 << 31, | 648 | IB_QP_CREATE_RESERVED_END = 1 << 31, |
| @@ -721,7 +731,11 @@ enum ib_qp_attr_mask { | |||
| 721 | IB_QP_MAX_DEST_RD_ATOMIC = (1<<17), | 731 | IB_QP_MAX_DEST_RD_ATOMIC = (1<<17), |
| 722 | IB_QP_PATH_MIG_STATE = (1<<18), | 732 | IB_QP_PATH_MIG_STATE = (1<<18), |
| 723 | IB_QP_CAP = (1<<19), | 733 | IB_QP_CAP = (1<<19), |
| 724 | IB_QP_DEST_QPN = (1<<20) | 734 | IB_QP_DEST_QPN = (1<<20), |
| 735 | IB_QP_SMAC = (1<<21), | ||
| 736 | IB_QP_ALT_SMAC = (1<<22), | ||
| 737 | IB_QP_VID = (1<<23), | ||
| 738 | IB_QP_ALT_VID = (1<<24), | ||
| 725 | }; | 739 | }; |
| 726 | 740 | ||
| 727 | enum ib_qp_state { | 741 | enum ib_qp_state { |
| @@ -771,6 +785,10 @@ struct ib_qp_attr { | |||
| 771 | u8 rnr_retry; | 785 | u8 rnr_retry; |
| 772 | u8 alt_port_num; | 786 | u8 alt_port_num; |
| 773 | u8 alt_timeout; | 787 | u8 alt_timeout; |
| 788 | u8 smac[ETH_ALEN]; | ||
| 789 | u8 alt_smac[ETH_ALEN]; | ||
| 790 | u16 vlan_id; | ||
| 791 | u16 alt_vlan_id; | ||
| 774 | }; | 792 | }; |
| 775 | 793 | ||
| 776 | enum ib_wr_opcode { | 794 | enum ib_wr_opcode { |
| @@ -978,7 +996,7 @@ struct ib_uobject { | |||
| 978 | }; | 996 | }; |
| 979 | 997 | ||
| 980 | struct ib_udata { | 998 | struct ib_udata { |
| 981 | void __user *inbuf; | 999 | const void __user *inbuf; |
| 982 | void __user *outbuf; | 1000 | void __user *outbuf; |
| 983 | size_t inlen; | 1001 | size_t inlen; |
| 984 | size_t outlen; | 1002 | size_t outlen; |
| @@ -1099,13 +1117,14 @@ enum ib_flow_attr_type { | |||
| 1099 | enum ib_flow_spec_type { | 1117 | enum ib_flow_spec_type { |
| 1100 | /* L2 headers*/ | 1118 | /* L2 headers*/ |
| 1101 | IB_FLOW_SPEC_ETH = 0x20, | 1119 | IB_FLOW_SPEC_ETH = 0x20, |
| 1120 | IB_FLOW_SPEC_IB = 0x22, | ||
| 1102 | /* L3 header*/ | 1121 | /* L3 header*/ |
| 1103 | IB_FLOW_SPEC_IPV4 = 0x30, | 1122 | IB_FLOW_SPEC_IPV4 = 0x30, |
| 1104 | /* L4 headers*/ | 1123 | /* L4 headers*/ |
| 1105 | IB_FLOW_SPEC_TCP = 0x40, | 1124 | IB_FLOW_SPEC_TCP = 0x40, |
| 1106 | IB_FLOW_SPEC_UDP = 0x41 | 1125 | IB_FLOW_SPEC_UDP = 0x41 |
| 1107 | }; | 1126 | }; |
| 1108 | 1127 | #define IB_FLOW_SPEC_LAYER_MASK 0xF0 | |
| 1109 | #define IB_FLOW_SPEC_SUPPORT_LAYERS 4 | 1128 | #define IB_FLOW_SPEC_SUPPORT_LAYERS 4 |
| 1110 | 1129 | ||
| 1111 | /* Flow steering rule priority is set according to it's domain. | 1130 | /* Flow steering rule priority is set according to it's domain. |
| @@ -1133,6 +1152,18 @@ struct ib_flow_spec_eth { | |||
| 1133 | struct ib_flow_eth_filter mask; | 1152 | struct ib_flow_eth_filter mask; |
| 1134 | }; | 1153 | }; |
| 1135 | 1154 | ||
| 1155 | struct ib_flow_ib_filter { | ||
| 1156 | __be16 dlid; | ||
| 1157 | __u8 sl; | ||
| 1158 | }; | ||
| 1159 | |||
| 1160 | struct ib_flow_spec_ib { | ||
| 1161 | enum ib_flow_spec_type type; | ||
| 1162 | u16 size; | ||
| 1163 | struct ib_flow_ib_filter val; | ||
| 1164 | struct ib_flow_ib_filter mask; | ||
| 1165 | }; | ||
| 1166 | |||
| 1136 | struct ib_flow_ipv4_filter { | 1167 | struct ib_flow_ipv4_filter { |
| 1137 | __be32 src_ip; | 1168 | __be32 src_ip; |
| 1138 | __be32 dst_ip; | 1169 | __be32 dst_ip; |
| @@ -1163,6 +1194,7 @@ union ib_flow_spec { | |||
| 1163 | u16 size; | 1194 | u16 size; |
| 1164 | }; | 1195 | }; |
| 1165 | struct ib_flow_spec_eth eth; | 1196 | struct ib_flow_spec_eth eth; |
| 1197 | struct ib_flow_spec_ib ib; | ||
| 1166 | struct ib_flow_spec_ipv4 ipv4; | 1198 | struct ib_flow_spec_ipv4 ipv4; |
| 1167 | struct ib_flow_spec_tcp_udp tcp_udp; | 1199 | struct ib_flow_spec_tcp_udp tcp_udp; |
| 1168 | }; | 1200 | }; |
| @@ -1488,6 +1520,7 @@ static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len | |||
| 1488 | * @next_state: Next QP state | 1520 | * @next_state: Next QP state |
| 1489 | * @type: QP type | 1521 | * @type: QP type |
| 1490 | * @mask: Mask of supplied QP attributes | 1522 | * @mask: Mask of supplied QP attributes |
| 1523 | * @ll : link layer of port | ||
| 1491 | * | 1524 | * |
| 1492 | * This function is a helper function that a low-level driver's | 1525 | * This function is a helper function that a low-level driver's |
| 1493 | * modify_qp method can use to validate the consumer's input. It | 1526 | * modify_qp method can use to validate the consumer's input. It |
| @@ -1496,7 +1529,8 @@ static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len | |||
| 1496 | * and that the attribute mask supplied is allowed for the transition. | 1529 | * and that the attribute mask supplied is allowed for the transition. |
| 1497 | */ | 1530 | */ |
| 1498 | int ib_modify_qp_is_ok(enum ib_qp_state cur_state, enum ib_qp_state next_state, | 1531 | int ib_modify_qp_is_ok(enum ib_qp_state cur_state, enum ib_qp_state next_state, |
| 1499 | enum ib_qp_type type, enum ib_qp_attr_mask mask); | 1532 | enum ib_qp_type type, enum ib_qp_attr_mask mask, |
| 1533 | enum rdma_link_layer ll); | ||
| 1500 | 1534 | ||
| 1501 | int ib_register_event_handler (struct ib_event_handler *event_handler); | 1535 | int ib_register_event_handler (struct ib_event_handler *event_handler); |
| 1502 | int ib_unregister_event_handler(struct ib_event_handler *event_handler); | 1536 | int ib_unregister_event_handler(struct ib_event_handler *event_handler); |
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 5d6ed6cf12cc..fd0421c6d40a 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
| @@ -70,6 +70,7 @@ enum iscsi_uevent_e { | |||
| 70 | ISCSI_UEVENT_LOGOUT_FLASHNODE = UEVENT_BASE + 29, | 70 | ISCSI_UEVENT_LOGOUT_FLASHNODE = UEVENT_BASE + 29, |
| 71 | ISCSI_UEVENT_LOGOUT_FLASHNODE_SID = UEVENT_BASE + 30, | 71 | ISCSI_UEVENT_LOGOUT_FLASHNODE_SID = UEVENT_BASE + 30, |
| 72 | ISCSI_UEVENT_SET_CHAP = UEVENT_BASE + 31, | 72 | ISCSI_UEVENT_SET_CHAP = UEVENT_BASE + 31, |
| 73 | ISCSI_UEVENT_GET_HOST_STATS = UEVENT_BASE + 32, | ||
| 73 | 74 | ||
| 74 | /* up events */ | 75 | /* up events */ |
| 75 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, | 76 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, |
| @@ -242,6 +243,9 @@ struct iscsi_uevent { | |||
| 242 | uint32_t host_no; | 243 | uint32_t host_no; |
| 243 | uint32_t sid; | 244 | uint32_t sid; |
| 244 | } logout_flashnode_sid; | 245 | } logout_flashnode_sid; |
| 246 | struct msg_get_host_stats { | ||
| 247 | uint32_t host_no; | ||
| 248 | } get_host_stats; | ||
| 245 | } u; | 249 | } u; |
| 246 | union { | 250 | union { |
| 247 | /* messages k -> u */ | 251 | /* messages k -> u */ |
| @@ -311,6 +315,7 @@ enum iscsi_param_type { | |||
| 311 | ISCSI_NET_PARAM, /* iscsi_net_param */ | 315 | ISCSI_NET_PARAM, /* iscsi_net_param */ |
| 312 | ISCSI_FLASHNODE_PARAM, /* iscsi_flashnode_param */ | 316 | ISCSI_FLASHNODE_PARAM, /* iscsi_flashnode_param */ |
| 313 | ISCSI_CHAP_PARAM, /* iscsi_chap_param */ | 317 | ISCSI_CHAP_PARAM, /* iscsi_chap_param */ |
| 318 | ISCSI_IFACE_PARAM, /* iscsi_iface_param */ | ||
| 314 | }; | 319 | }; |
| 315 | 320 | ||
| 316 | /* structure for minimalist usecase */ | 321 | /* structure for minimalist usecase */ |
| @@ -383,28 +388,106 @@ struct iscsi_path { | |||
| 383 | #define ISCSI_VLAN_DISABLE 0x01 | 388 | #define ISCSI_VLAN_DISABLE 0x01 |
| 384 | #define ISCSI_VLAN_ENABLE 0x02 | 389 | #define ISCSI_VLAN_ENABLE 0x02 |
| 385 | 390 | ||
| 391 | /* iscsi generic enable/disabled setting for various features */ | ||
| 392 | #define ISCSI_NET_PARAM_DISABLE 0x01 | ||
| 393 | #define ISCSI_NET_PARAM_ENABLE 0x02 | ||
| 394 | |||
| 386 | /* iSCSI network params */ | 395 | /* iSCSI network params */ |
| 387 | enum iscsi_net_param { | 396 | enum iscsi_net_param { |
| 388 | ISCSI_NET_PARAM_IPV4_ADDR = 1, | 397 | ISCSI_NET_PARAM_IPV4_ADDR = 1, |
| 389 | ISCSI_NET_PARAM_IPV4_SUBNET = 2, | 398 | ISCSI_NET_PARAM_IPV4_SUBNET, |
| 390 | ISCSI_NET_PARAM_IPV4_GW = 3, | 399 | ISCSI_NET_PARAM_IPV4_GW, |
| 391 | ISCSI_NET_PARAM_IPV4_BOOTPROTO = 4, | 400 | ISCSI_NET_PARAM_IPV4_BOOTPROTO, |
| 392 | ISCSI_NET_PARAM_MAC = 5, | 401 | ISCSI_NET_PARAM_MAC, |
| 393 | ISCSI_NET_PARAM_IPV6_LINKLOCAL = 6, | 402 | ISCSI_NET_PARAM_IPV6_LINKLOCAL, |
| 394 | ISCSI_NET_PARAM_IPV6_ADDR = 7, | 403 | ISCSI_NET_PARAM_IPV6_ADDR, |
| 395 | ISCSI_NET_PARAM_IPV6_ROUTER = 8, | 404 | ISCSI_NET_PARAM_IPV6_ROUTER, |
| 396 | ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG = 9, | 405 | ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG, |
| 397 | ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG = 10, | 406 | ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG, |
| 398 | ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG = 11, | 407 | ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG, |
| 399 | ISCSI_NET_PARAM_IFACE_ENABLE = 12, | 408 | ISCSI_NET_PARAM_IFACE_ENABLE, |
| 400 | ISCSI_NET_PARAM_VLAN_ID = 13, | 409 | ISCSI_NET_PARAM_VLAN_ID, |
| 401 | ISCSI_NET_PARAM_VLAN_PRIORITY = 14, | 410 | ISCSI_NET_PARAM_VLAN_PRIORITY, |
| 402 | ISCSI_NET_PARAM_VLAN_ENABLED = 15, | 411 | ISCSI_NET_PARAM_VLAN_ENABLED, |
| 403 | ISCSI_NET_PARAM_VLAN_TAG = 16, | 412 | ISCSI_NET_PARAM_VLAN_TAG, |
| 404 | ISCSI_NET_PARAM_IFACE_TYPE = 17, | 413 | ISCSI_NET_PARAM_IFACE_TYPE, |
| 405 | ISCSI_NET_PARAM_IFACE_NAME = 18, | 414 | ISCSI_NET_PARAM_IFACE_NAME, |
| 406 | ISCSI_NET_PARAM_MTU = 19, | 415 | ISCSI_NET_PARAM_MTU, |
| 407 | ISCSI_NET_PARAM_PORT = 20, | 416 | ISCSI_NET_PARAM_PORT, |
| 417 | ISCSI_NET_PARAM_IPADDR_STATE, | ||
| 418 | ISCSI_NET_PARAM_IPV6_LINKLOCAL_STATE, | ||
| 419 | ISCSI_NET_PARAM_IPV6_ROUTER_STATE, | ||
| 420 | ISCSI_NET_PARAM_DELAYED_ACK_EN, | ||
| 421 | ISCSI_NET_PARAM_TCP_NAGLE_DISABLE, | ||
| 422 | ISCSI_NET_PARAM_TCP_WSF_DISABLE, | ||
| 423 | ISCSI_NET_PARAM_TCP_WSF, | ||
| 424 | ISCSI_NET_PARAM_TCP_TIMER_SCALE, | ||
| 425 | ISCSI_NET_PARAM_TCP_TIMESTAMP_EN, | ||
| 426 | ISCSI_NET_PARAM_CACHE_ID, | ||
| 427 | ISCSI_NET_PARAM_IPV4_DHCP_DNS_ADDR_EN, | ||
| 428 | ISCSI_NET_PARAM_IPV4_DHCP_SLP_DA_EN, | ||
| 429 | ISCSI_NET_PARAM_IPV4_TOS_EN, | ||
| 430 | ISCSI_NET_PARAM_IPV4_TOS, | ||
| 431 | ISCSI_NET_PARAM_IPV4_GRAT_ARP_EN, | ||
| 432 | ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID_EN, | ||
| 433 | ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID, | ||
| 434 | ISCSI_NET_PARAM_IPV4_DHCP_REQ_VENDOR_ID_EN, | ||
| 435 | ISCSI_NET_PARAM_IPV4_DHCP_USE_VENDOR_ID_EN, | ||
| 436 | ISCSI_NET_PARAM_IPV4_DHCP_VENDOR_ID, | ||
| 437 | ISCSI_NET_PARAM_IPV4_DHCP_LEARN_IQN_EN, | ||
| 438 | ISCSI_NET_PARAM_IPV4_FRAGMENT_DISABLE, | ||
| 439 | ISCSI_NET_PARAM_IPV4_IN_FORWARD_EN, | ||
| 440 | ISCSI_NET_PARAM_IPV4_TTL, | ||
| 441 | ISCSI_NET_PARAM_IPV6_GRAT_NEIGHBOR_ADV_EN, | ||
| 442 | ISCSI_NET_PARAM_IPV6_MLD_EN, | ||
| 443 | ISCSI_NET_PARAM_IPV6_FLOW_LABEL, | ||
| 444 | ISCSI_NET_PARAM_IPV6_TRAFFIC_CLASS, | ||
| 445 | ISCSI_NET_PARAM_IPV6_HOP_LIMIT, | ||
| 446 | ISCSI_NET_PARAM_IPV6_ND_REACHABLE_TMO, | ||
| 447 | ISCSI_NET_PARAM_IPV6_ND_REXMIT_TIME, | ||
| 448 | ISCSI_NET_PARAM_IPV6_ND_STALE_TMO, | ||
| 449 | ISCSI_NET_PARAM_IPV6_DUP_ADDR_DETECT_CNT, | ||
| 450 | ISCSI_NET_PARAM_IPV6_RTR_ADV_LINK_MTU, | ||
| 451 | ISCSI_NET_PARAM_REDIRECT_EN, | ||
| 452 | }; | ||
| 453 | |||
| 454 | enum iscsi_ipaddress_state { | ||
| 455 | ISCSI_IPDDRESS_STATE_UNCONFIGURED, | ||
| 456 | ISCSI_IPDDRESS_STATE_ACQUIRING, | ||
| 457 | ISCSI_IPDDRESS_STATE_TENTATIVE, | ||
| 458 | ISCSI_IPDDRESS_STATE_VALID, | ||
| 459 | ISCSI_IPDDRESS_STATE_DISABLING, | ||
| 460 | ISCSI_IPDDRESS_STATE_INVALID, | ||
| 461 | ISCSI_IPDDRESS_STATE_DEPRECATED, | ||
| 462 | }; | ||
| 463 | |||
| 464 | enum iscsi_router_state { | ||
| 465 | ISCSI_ROUTER_STATE_UNKNOWN, | ||
| 466 | ISCSI_ROUTER_STATE_ADVERTISED, | ||
| 467 | ISCSI_ROUTER_STATE_MANUAL, | ||
| 468 | ISCSI_ROUTER_STATE_STALE, | ||
| 469 | }; | ||
| 470 | |||
| 471 | /* iSCSI specific settings params for iface */ | ||
| 472 | enum iscsi_iface_param { | ||
| 473 | ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO, | ||
| 474 | ISCSI_IFACE_PARAM_HDRDGST_EN, | ||
| 475 | ISCSI_IFACE_PARAM_DATADGST_EN, | ||
| 476 | ISCSI_IFACE_PARAM_IMM_DATA_EN, | ||
| 477 | ISCSI_IFACE_PARAM_INITIAL_R2T_EN, | ||
| 478 | ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN, | ||
| 479 | ISCSI_IFACE_PARAM_PDU_INORDER_EN, | ||
| 480 | ISCSI_IFACE_PARAM_ERL, | ||
| 481 | ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH, | ||
| 482 | ISCSI_IFACE_PARAM_FIRST_BURST, | ||
| 483 | ISCSI_IFACE_PARAM_MAX_R2T, | ||
| 484 | ISCSI_IFACE_PARAM_MAX_BURST, | ||
| 485 | ISCSI_IFACE_PARAM_CHAP_AUTH_EN, | ||
| 486 | ISCSI_IFACE_PARAM_BIDI_CHAP_EN, | ||
| 487 | ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL, | ||
| 488 | ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN, | ||
| 489 | ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN, | ||
| 490 | ISCSI_IFACE_PARAM_INITIATOR_NAME, | ||
| 408 | }; | 491 | }; |
| 409 | 492 | ||
| 410 | enum iscsi_conn_state { | 493 | enum iscsi_conn_state { |
| @@ -535,6 +618,7 @@ enum iscsi_param { | |||
| 535 | 618 | ||
| 536 | ISCSI_PARAM_DISCOVERY_PARENT_IDX, | 619 | ISCSI_PARAM_DISCOVERY_PARENT_IDX, |
| 537 | ISCSI_PARAM_DISCOVERY_PARENT_TYPE, | 620 | ISCSI_PARAM_DISCOVERY_PARENT_TYPE, |
| 621 | ISCSI_PARAM_LOCAL_IPADDR, | ||
| 538 | /* must always be last */ | 622 | /* must always be last */ |
| 539 | ISCSI_PARAM_MAX, | 623 | ISCSI_PARAM_MAX, |
| 540 | }; | 624 | }; |
| @@ -766,4 +850,112 @@ struct iscsi_chap_rec { | |||
| 766 | uint8_t password_length; | 850 | uint8_t password_length; |
| 767 | }; | 851 | }; |
| 768 | 852 | ||
| 853 | #define ISCSI_HOST_STATS_CUSTOM_MAX 32 | ||
| 854 | #define ISCSI_HOST_STATS_CUSTOM_DESC_MAX 64 | ||
| 855 | struct iscsi_host_stats_custom { | ||
| 856 | char desc[ISCSI_HOST_STATS_CUSTOM_DESC_MAX]; | ||
| 857 | uint64_t value; | ||
| 858 | }; | ||
| 859 | |||
| 860 | /* struct iscsi_offload_host_stats: Host statistics, | ||
| 861 | * Include statistics for MAC, IP, TCP & iSCSI. | ||
| 862 | */ | ||
| 863 | struct iscsi_offload_host_stats { | ||
| 864 | /* MAC */ | ||
| 865 | uint64_t mactx_frames; | ||
| 866 | uint64_t mactx_bytes; | ||
| 867 | uint64_t mactx_multicast_frames; | ||
| 868 | uint64_t mactx_broadcast_frames; | ||
| 869 | uint64_t mactx_pause_frames; | ||
| 870 | uint64_t mactx_control_frames; | ||
| 871 | uint64_t mactx_deferral; | ||
| 872 | uint64_t mactx_excess_deferral; | ||
| 873 | uint64_t mactx_late_collision; | ||
| 874 | uint64_t mactx_abort; | ||
| 875 | uint64_t mactx_single_collision; | ||
| 876 | uint64_t mactx_multiple_collision; | ||
| 877 | uint64_t mactx_collision; | ||
| 878 | uint64_t mactx_frames_dropped; | ||
| 879 | uint64_t mactx_jumbo_frames; | ||
| 880 | uint64_t macrx_frames; | ||
| 881 | uint64_t macrx_bytes; | ||
| 882 | uint64_t macrx_unknown_control_frames; | ||
| 883 | uint64_t macrx_pause_frames; | ||
| 884 | uint64_t macrx_control_frames; | ||
| 885 | uint64_t macrx_dribble; | ||
| 886 | uint64_t macrx_frame_length_error; | ||
| 887 | uint64_t macrx_jabber; | ||
| 888 | uint64_t macrx_carrier_sense_error; | ||
| 889 | uint64_t macrx_frame_discarded; | ||
| 890 | uint64_t macrx_frames_dropped; | ||
| 891 | uint64_t mac_crc_error; | ||
| 892 | uint64_t mac_encoding_error; | ||
| 893 | uint64_t macrx_length_error_large; | ||
| 894 | uint64_t macrx_length_error_small; | ||
| 895 | uint64_t macrx_multicast_frames; | ||
| 896 | uint64_t macrx_broadcast_frames; | ||
| 897 | /* IP */ | ||
| 898 | uint64_t iptx_packets; | ||
| 899 | uint64_t iptx_bytes; | ||
| 900 | uint64_t iptx_fragments; | ||
| 901 | uint64_t iprx_packets; | ||
| 902 | uint64_t iprx_bytes; | ||
| 903 | uint64_t iprx_fragments; | ||
| 904 | uint64_t ip_datagram_reassembly; | ||
| 905 | uint64_t ip_invalid_address_error; | ||
| 906 | uint64_t ip_error_packets; | ||
| 907 | uint64_t ip_fragrx_overlap; | ||
| 908 | uint64_t ip_fragrx_outoforder; | ||
| 909 | uint64_t ip_datagram_reassembly_timeout; | ||
| 910 | uint64_t ipv6tx_packets; | ||
| 911 | uint64_t ipv6tx_bytes; | ||
| 912 | uint64_t ipv6tx_fragments; | ||
| 913 | uint64_t ipv6rx_packets; | ||
| 914 | uint64_t ipv6rx_bytes; | ||
| 915 | uint64_t ipv6rx_fragments; | ||
| 916 | uint64_t ipv6_datagram_reassembly; | ||
| 917 | uint64_t ipv6_invalid_address_error; | ||
| 918 | uint64_t ipv6_error_packets; | ||
| 919 | uint64_t ipv6_fragrx_overlap; | ||
| 920 | uint64_t ipv6_fragrx_outoforder; | ||
| 921 | uint64_t ipv6_datagram_reassembly_timeout; | ||
| 922 | /* TCP */ | ||
| 923 | uint64_t tcptx_segments; | ||
| 924 | uint64_t tcptx_bytes; | ||
| 925 | uint64_t tcprx_segments; | ||
| 926 | uint64_t tcprx_byte; | ||
| 927 | uint64_t tcp_duplicate_ack_retx; | ||
| 928 | uint64_t tcp_retx_timer_expired; | ||
| 929 | uint64_t tcprx_duplicate_ack; | ||
| 930 | uint64_t tcprx_pure_ackr; | ||
| 931 | uint64_t tcptx_delayed_ack; | ||
| 932 | uint64_t tcptx_pure_ack; | ||
| 933 | uint64_t tcprx_segment_error; | ||
| 934 | uint64_t tcprx_segment_outoforder; | ||
| 935 | uint64_t tcprx_window_probe; | ||
| 936 | uint64_t tcprx_window_update; | ||
| 937 | uint64_t tcptx_window_probe_persist; | ||
| 938 | /* ECC */ | ||
| 939 | uint64_t ecc_error_correction; | ||
| 940 | /* iSCSI */ | ||
| 941 | uint64_t iscsi_pdu_tx; | ||
| 942 | uint64_t iscsi_data_bytes_tx; | ||
| 943 | uint64_t iscsi_pdu_rx; | ||
| 944 | uint64_t iscsi_data_bytes_rx; | ||
| 945 | uint64_t iscsi_io_completed; | ||
| 946 | uint64_t iscsi_unexpected_io_rx; | ||
| 947 | uint64_t iscsi_format_error; | ||
| 948 | uint64_t iscsi_hdr_digest_error; | ||
| 949 | uint64_t iscsi_data_digest_error; | ||
| 950 | uint64_t iscsi_sequence_error; | ||
| 951 | /* | ||
| 952 | * iSCSI Custom Host Statistics support, i.e. Transport could | ||
| 953 | * extend existing host statistics with its own specific statistics | ||
| 954 | * up to ISCSI_HOST_STATS_CUSTOM_MAX | ||
| 955 | */ | ||
| 956 | uint32_t custom_length; | ||
| 957 | struct iscsi_host_stats_custom custom[0] | ||
| 958 | __aligned(sizeof(uint64_t)); | ||
| 959 | }; | ||
| 960 | |||
| 769 | #endif | 961 | #endif |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 6ac9e17acdc4..309f51336fb9 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
| @@ -231,6 +231,7 @@ struct iscsi_conn { | |||
| 231 | uint8_t ipv6_traffic_class; | 231 | uint8_t ipv6_traffic_class; |
| 232 | uint8_t ipv6_flow_label; | 232 | uint8_t ipv6_flow_label; |
| 233 | uint8_t is_fw_assigned_ipv6; | 233 | uint8_t is_fw_assigned_ipv6; |
| 234 | char *local_ipaddr; | ||
| 234 | 235 | ||
| 235 | /* MIB-statistics */ | 236 | /* MIB-statistics */ |
| 236 | uint64_t txdata_octets; | 237 | uint64_t txdata_octets; |
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index de5f5d8f1f8a..91558a1f97f4 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
| @@ -55,6 +55,7 @@ struct scsi_cmnd { | |||
| 55 | struct scsi_device *device; | 55 | struct scsi_device *device; |
| 56 | struct list_head list; /* scsi_cmnd participates in queue lists */ | 56 | struct list_head list; /* scsi_cmnd participates in queue lists */ |
| 57 | struct list_head eh_entry; /* entry for the host eh_cmd_q */ | 57 | struct list_head eh_entry; /* entry for the host eh_cmd_q */ |
| 58 | struct delayed_work abort_work; | ||
| 58 | int eh_eflags; /* Used by error handlr */ | 59 | int eh_eflags; /* Used by error handlr */ |
| 59 | 60 | ||
| 60 | /* | 61 | /* |
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h index d443aa06a722..20fdfc2526ad 100644 --- a/include/scsi/scsi_driver.h +++ b/include/scsi/scsi_driver.h | |||
| @@ -16,7 +16,7 @@ struct scsi_driver { | |||
| 16 | 16 | ||
| 17 | void (*rescan)(struct device *); | 17 | void (*rescan)(struct device *); |
| 18 | int (*done)(struct scsi_cmnd *); | 18 | int (*done)(struct scsi_cmnd *); |
| 19 | int (*eh_action)(struct scsi_cmnd *, unsigned char *, int, int); | 19 | int (*eh_action)(struct scsi_cmnd *, int); |
| 20 | }; | 20 | }; |
| 21 | #define to_scsi_driver(drv) \ | 21 | #define to_scsi_driver(drv) \ |
| 22 | container_of((drv), struct scsi_driver, gendrv) | 22 | container_of((drv), struct scsi_driver, gendrv) |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 546084964d55..53075e5039e6 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
| @@ -475,6 +475,14 @@ struct scsi_host_template { | |||
| 475 | */ | 475 | */ |
| 476 | unsigned ordered_tag:1; | 476 | unsigned ordered_tag:1; |
| 477 | 477 | ||
| 478 | /* True if the controller does not support WRITE SAME */ | ||
| 479 | unsigned no_write_same:1; | ||
| 480 | |||
| 481 | /* | ||
| 482 | * True if asynchronous aborts are not supported | ||
| 483 | */ | ||
| 484 | unsigned no_async_abort:1; | ||
| 485 | |||
| 478 | /* | 486 | /* |
| 479 | * Countdown for host blocking with no commands outstanding. | 487 | * Countdown for host blocking with no commands outstanding. |
| 480 | */ | 488 | */ |
| @@ -677,6 +685,9 @@ struct Scsi_Host { | |||
| 677 | /* Don't resume host in EH */ | 685 | /* Don't resume host in EH */ |
| 678 | unsigned eh_noresume:1; | 686 | unsigned eh_noresume:1; |
| 679 | 687 | ||
| 688 | /* The controller does not support WRITE SAME */ | ||
| 689 | unsigned no_write_same:1; | ||
| 690 | |||
| 680 | /* | 691 | /* |
| 681 | * Optional work queue to be utilized by the transport | 692 | * Optional work queue to be utilized by the transport |
| 682 | */ | 693 | */ |
| @@ -684,6 +695,11 @@ struct Scsi_Host { | |||
| 684 | struct workqueue_struct *work_q; | 695 | struct workqueue_struct *work_q; |
| 685 | 696 | ||
| 686 | /* | 697 | /* |
| 698 | * Task management function work queue | ||
| 699 | */ | ||
| 700 | struct workqueue_struct *tmf_work_q; | ||
| 701 | |||
| 702 | /* | ||
| 687 | * Host has rejected a command because it was busy. | 703 | * Host has rejected a command because it was busy. |
| 688 | */ | 704 | */ |
| 689 | unsigned int host_blocked; | 705 | unsigned int host_blocked; |
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index fe7c8f3e93f8..88640a47216c 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
| @@ -166,6 +166,7 @@ struct iscsi_transport { | |||
| 166 | int (*logout_flashnode) (struct iscsi_bus_flash_session *fnode_sess, | 166 | int (*logout_flashnode) (struct iscsi_bus_flash_session *fnode_sess, |
| 167 | struct iscsi_bus_flash_conn *fnode_conn); | 167 | struct iscsi_bus_flash_conn *fnode_conn); |
| 168 | int (*logout_flashnode_sid) (struct iscsi_cls_session *cls_sess); | 168 | int (*logout_flashnode_sid) (struct iscsi_cls_session *cls_sess); |
| 169 | int (*get_host_stats) (struct Scsi_Host *shost, char *buf, int len); | ||
| 169 | }; | 170 | }; |
| 170 | 171 | ||
| 171 | /* | 172 | /* |
| @@ -478,4 +479,7 @@ iscsi_find_flashnode_sess(struct Scsi_Host *shost, void *data, | |||
| 478 | extern struct device * | 479 | extern struct device * |
| 479 | iscsi_find_flashnode_conn(struct iscsi_bus_flash_session *fnode_sess); | 480 | iscsi_find_flashnode_conn(struct iscsi_bus_flash_session *fnode_sess); |
| 480 | 481 | ||
| 482 | extern char * | ||
| 483 | iscsi_get_ipaddress_state_name(enum iscsi_ipaddress_state port_state); | ||
| 484 | extern char *iscsi_get_router_state_name(enum iscsi_router_state router_state); | ||
| 481 | #endif | 485 | #endif |
diff --git a/include/scsi/scsi_transport_srp.h b/include/scsi/scsi_transport_srp.h index 4ebf6913b7b2..b11da5c1331e 100644 --- a/include/scsi/scsi_transport_srp.h +++ b/include/scsi/scsi_transport_srp.h | |||
| @@ -19,7 +19,7 @@ struct srp_rport_identifiers { | |||
| 19 | * @SRP_RPORT_BLOCKED: Transport layer not operational; fast I/O fail timer | 19 | * @SRP_RPORT_BLOCKED: Transport layer not operational; fast I/O fail timer |
| 20 | * is running and I/O has been blocked. | 20 | * is running and I/O has been blocked. |
| 21 | * @SRP_RPORT_FAIL_FAST: Fast I/O fail timer has expired; fail I/O fast. | 21 | * @SRP_RPORT_FAIL_FAST: Fast I/O fail timer has expired; fail I/O fast. |
| 22 | * @SRP_RPORT_LOST: Device loss timer has expired; port is being removed. | 22 | * @SRP_RPORT_LOST: Port is being removed. |
| 23 | */ | 23 | */ |
| 24 | enum srp_rport_state { | 24 | enum srp_rport_state { |
| 25 | SRP_RPORT_RUNNING, | 25 | SRP_RPORT_RUNNING, |
| @@ -29,10 +29,26 @@ enum srp_rport_state { | |||
| 29 | }; | 29 | }; |
| 30 | 30 | ||
| 31 | /** | 31 | /** |
| 32 | * struct srp_rport | 32 | * struct srp_rport - SRP initiator or target port |
| 33 | * @lld_data: LLD private data. | 33 | * |
| 34 | * @mutex: Protects against concurrent rport reconnect / fast_io_fail / | 34 | * Fields that are relevant for SRP initiator and SRP target drivers: |
| 35 | * dev_loss_tmo activity. | 35 | * @dev: Device associated with this rport. |
| 36 | * @port_id: 16-byte port identifier. | ||
| 37 | * @roles: Role of this port - initiator or target. | ||
| 38 | * | ||
| 39 | * Fields that are only relevant for SRP initiator drivers: | ||
| 40 | * @lld_data: LLD private data. | ||
| 41 | * @mutex: Protects against concurrent rport reconnect / | ||
| 42 | * fast_io_fail / dev_loss_tmo activity. | ||
| 43 | * @state: rport state. | ||
| 44 | * @deleted: Whether or not srp_rport_del() has already been invoked. | ||
| 45 | * @reconnect_delay: Reconnect delay in seconds. | ||
| 46 | * @failed_reconnects: Number of failed reconnect attempts. | ||
| 47 | * @reconnect_work: Work structure used for scheduling reconnect attempts. | ||
| 48 | * @fast_io_fail_tmo: Fast I/O fail timeout in seconds. | ||
| 49 | * @dev_loss_tmo: Device loss timeout in seconds. | ||
| 50 | * @fast_io_fail_work: Work structure used for scheduling fast I/O fail work. | ||
| 51 | * @dev_loss_work: Work structure used for scheduling device loss work. | ||
| 36 | */ | 52 | */ |
| 37 | struct srp_rport { | 53 | struct srp_rport { |
| 38 | /* for initiator and target drivers */ | 54 | /* for initiator and target drivers */ |
| @@ -48,7 +64,6 @@ struct srp_rport { | |||
| 48 | 64 | ||
| 49 | struct mutex mutex; | 65 | struct mutex mutex; |
| 50 | enum srp_rport_state state; | 66 | enum srp_rport_state state; |
| 51 | bool deleted; | ||
| 52 | int reconnect_delay; | 67 | int reconnect_delay; |
| 53 | int failed_reconnects; | 68 | int failed_reconnects; |
| 54 | struct delayed_work reconnect_work; | 69 | struct delayed_work reconnect_work; |
| @@ -60,6 +75,8 @@ struct srp_rport { | |||
| 60 | 75 | ||
| 61 | /** | 76 | /** |
| 62 | * struct srp_function_template | 77 | * struct srp_function_template |
| 78 | * | ||
| 79 | * Fields that are only relevant for SRP initiator drivers: | ||
| 63 | * @has_rport_state: Whether or not to create the state, fast_io_fail_tmo and | 80 | * @has_rport_state: Whether or not to create the state, fast_io_fail_tmo and |
| 64 | * dev_loss_tmo sysfs attribute for an rport. | 81 | * dev_loss_tmo sysfs attribute for an rport. |
| 65 | * @reset_timer_if_blocked: Whether or srp_timed_out() should reset the command | 82 | * @reset_timer_if_blocked: Whether or srp_timed_out() should reset the command |
| @@ -71,6 +88,11 @@ struct srp_rport { | |||
| 71 | * srp_reconnect_rport(). | 88 | * srp_reconnect_rport(). |
| 72 | * @terminate_rport_io: Callback function for terminating all outstanding I/O | 89 | * @terminate_rport_io: Callback function for terminating all outstanding I/O |
| 73 | * requests for an rport. | 90 | * requests for an rport. |
| 91 | * @rport_delete: Callback function that deletes an rport. | ||
| 92 | * | ||
| 93 | * Fields that are only relevant for SRP target drivers: | ||
| 94 | * @tsk_mgmt_response: Callback function for sending a task management response. | ||
| 95 | * @it_nexus_response: Callback function for processing an IT nexus response. | ||
| 74 | */ | 96 | */ |
| 75 | struct srp_function_template { | 97 | struct srp_function_template { |
| 76 | /* for initiator drivers */ | 98 | /* for initiator drivers */ |
| @@ -101,9 +123,11 @@ extern int srp_tmo_valid(int reconnect_delay, int fast_io_fail_tmo, | |||
| 101 | extern int srp_reconnect_rport(struct srp_rport *rport); | 123 | extern int srp_reconnect_rport(struct srp_rport *rport); |
| 102 | extern void srp_start_tl_fail_timers(struct srp_rport *rport); | 124 | extern void srp_start_tl_fail_timers(struct srp_rport *rport); |
| 103 | extern void srp_remove_host(struct Scsi_Host *); | 125 | extern void srp_remove_host(struct Scsi_Host *); |
| 126 | extern void srp_stop_rport_timers(struct srp_rport *rport); | ||
| 104 | 127 | ||
| 105 | /** | 128 | /** |
| 106 | * srp_chkready() - evaluate the transport layer state before I/O | 129 | * srp_chkready() - evaluate the transport layer state before I/O |
| 130 | * @rport: SRP target port pointer. | ||
| 107 | * | 131 | * |
| 108 | * Returns a SCSI result code that can be returned by the LLD queuecommand() | 132 | * Returns a SCSI result code that can be returned by the LLD queuecommand() |
| 109 | * implementation. The role of this function is similar to that of | 133 | * implementation. The role of this function is similar to that of |
diff --git a/include/sound/cs42l52.h b/include/sound/cs42l52.h index 7c2be4a51894..bbabf84bdb44 100644 --- a/include/sound/cs42l52.h +++ b/include/sound/cs42l52.h | |||
| @@ -16,17 +16,11 @@ struct cs42l52_platform_data { | |||
| 16 | /* MICBIAS Level. Check datasheet Pg48 */ | 16 | /* MICBIAS Level. Check datasheet Pg48 */ |
| 17 | unsigned int micbias_lvl; | 17 | unsigned int micbias_lvl; |
| 18 | 18 | ||
| 19 | /* MICA mode selection 0=Single 1=Differential */ | 19 | /* MICA mode selection Differential or Single-ended */ |
| 20 | unsigned int mica_cfg; | 20 | bool mica_diff_cfg; |
| 21 | 21 | ||
| 22 | /* MICB mode selection 0=Single 1=Differential */ | 22 | /* MICB mode selection Differential or Single-ended */ |
| 23 | unsigned int micb_cfg; | 23 | bool micb_diff_cfg; |
| 24 | |||
| 25 | /* MICA Select 0=MIC1A 1=MIC2A */ | ||
| 26 | unsigned int mica_sel; | ||
| 27 | |||
| 28 | /* MICB Select 0=MIC2A 1=MIC2B */ | ||
| 29 | unsigned int micb_sel; | ||
| 30 | 24 | ||
| 31 | /* Charge Pump Freq. Check datasheet Pg73 */ | 25 | /* Charge Pump Freq. Check datasheet Pg73 */ |
| 32 | unsigned int chgfreq; | 26 | unsigned int chgfreq; |
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index 15017311f2e9..eb73a3a39ec2 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h | |||
| @@ -114,6 +114,10 @@ void snd_dmaengine_pcm_set_config_from_dai_data( | |||
| 114 | * @compat_filter_fn: Will be used as the filter function when requesting a | 114 | * @compat_filter_fn: Will be used as the filter function when requesting a |
| 115 | * channel for platforms which do not use devicetree. The filter parameter | 115 | * channel for platforms which do not use devicetree. The filter parameter |
| 116 | * will be the DAI's DMA data. | 116 | * will be the DAI's DMA data. |
| 117 | * @dma_dev: If set, request DMA channel on this device rather than the DAI | ||
| 118 | * device. | ||
| 119 | * @chan_names: If set, these custom DMA channel names will be requested at | ||
| 120 | * registration time. | ||
| 117 | * @pcm_hardware: snd_pcm_hardware struct to be used for the PCM. | 121 | * @pcm_hardware: snd_pcm_hardware struct to be used for the PCM. |
| 118 | * @prealloc_buffer_size: Size of the preallocated audio buffer. | 122 | * @prealloc_buffer_size: Size of the preallocated audio buffer. |
| 119 | * | 123 | * |
| @@ -130,6 +134,8 @@ struct snd_dmaengine_pcm_config { | |||
| 130 | struct snd_soc_pcm_runtime *rtd, | 134 | struct snd_soc_pcm_runtime *rtd, |
| 131 | struct snd_pcm_substream *substream); | 135 | struct snd_pcm_substream *substream); |
| 132 | dma_filter_fn compat_filter_fn; | 136 | dma_filter_fn compat_filter_fn; |
| 137 | struct device *dma_dev; | ||
| 138 | const char *chan_names[SNDRV_PCM_STREAM_LAST + 1]; | ||
| 133 | 139 | ||
| 134 | const struct snd_pcm_hardware *pcm_hardware; | 140 | const struct snd_pcm_hardware *pcm_hardware; |
| 135 | unsigned int prealloc_buffer_size; | 141 | unsigned int prealloc_buffer_size; |
| @@ -140,6 +146,10 @@ int snd_dmaengine_pcm_register(struct device *dev, | |||
| 140 | unsigned int flags); | 146 | unsigned int flags); |
| 141 | void snd_dmaengine_pcm_unregister(struct device *dev); | 147 | void snd_dmaengine_pcm_unregister(struct device *dev); |
| 142 | 148 | ||
| 149 | int devm_snd_dmaengine_pcm_register(struct device *dev, | ||
| 150 | const struct snd_dmaengine_pcm_config *config, | ||
| 151 | unsigned int flags); | ||
| 152 | |||
| 143 | int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream, | 153 | int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream, |
| 144 | struct snd_pcm_hw_params *params, | 154 | struct snd_pcm_hw_params *params, |
| 145 | struct dma_slave_config *slave_config); | 155 | struct dma_slave_config *slave_config); |
diff --git a/include/sound/hda_verbs.h b/include/sound/hda_verbs.h new file mode 100644 index 000000000000..d0509db6d0ec --- /dev/null +++ b/include/sound/hda_verbs.h | |||
| @@ -0,0 +1,554 @@ | |||
| 1 | /* | ||
| 2 | * HD-audio codec verbs | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef __SOUND_HDA_VERBS_H | ||
| 6 | #define __SOUND_HDA_VERBS_H | ||
| 7 | |||
| 8 | /* | ||
| 9 | * nodes | ||
| 10 | */ | ||
| 11 | #define AC_NODE_ROOT 0x00 | ||
| 12 | |||
| 13 | /* | ||
| 14 | * function group types | ||
| 15 | */ | ||
| 16 | enum { | ||
| 17 | AC_GRP_AUDIO_FUNCTION = 0x01, | ||
| 18 | AC_GRP_MODEM_FUNCTION = 0x02, | ||
| 19 | }; | ||
| 20 | |||
| 21 | /* | ||
| 22 | * widget types | ||
| 23 | */ | ||
| 24 | enum { | ||
| 25 | AC_WID_AUD_OUT, /* Audio Out */ | ||
| 26 | AC_WID_AUD_IN, /* Audio In */ | ||
| 27 | AC_WID_AUD_MIX, /* Audio Mixer */ | ||
| 28 | AC_WID_AUD_SEL, /* Audio Selector */ | ||
| 29 | AC_WID_PIN, /* Pin Complex */ | ||
| 30 | AC_WID_POWER, /* Power */ | ||
| 31 | AC_WID_VOL_KNB, /* Volume Knob */ | ||
| 32 | AC_WID_BEEP, /* Beep Generator */ | ||
| 33 | AC_WID_VENDOR = 0x0f /* Vendor specific */ | ||
| 34 | }; | ||
| 35 | |||
| 36 | /* | ||
| 37 | * GET verbs | ||
| 38 | */ | ||
| 39 | #define AC_VERB_GET_STREAM_FORMAT 0x0a00 | ||
| 40 | #define AC_VERB_GET_AMP_GAIN_MUTE 0x0b00 | ||
| 41 | #define AC_VERB_GET_PROC_COEF 0x0c00 | ||
| 42 | #define AC_VERB_GET_COEF_INDEX 0x0d00 | ||
| 43 | #define AC_VERB_PARAMETERS 0x0f00 | ||
| 44 | #define AC_VERB_GET_CONNECT_SEL 0x0f01 | ||
| 45 | #define AC_VERB_GET_CONNECT_LIST 0x0f02 | ||
| 46 | #define AC_VERB_GET_PROC_STATE 0x0f03 | ||
| 47 | #define AC_VERB_GET_SDI_SELECT 0x0f04 | ||
| 48 | #define AC_VERB_GET_POWER_STATE 0x0f05 | ||
| 49 | #define AC_VERB_GET_CONV 0x0f06 | ||
| 50 | #define AC_VERB_GET_PIN_WIDGET_CONTROL 0x0f07 | ||
| 51 | #define AC_VERB_GET_UNSOLICITED_RESPONSE 0x0f08 | ||
| 52 | #define AC_VERB_GET_PIN_SENSE 0x0f09 | ||
| 53 | #define AC_VERB_GET_BEEP_CONTROL 0x0f0a | ||
| 54 | #define AC_VERB_GET_EAPD_BTLENABLE 0x0f0c | ||
| 55 | #define AC_VERB_GET_DIGI_CONVERT_1 0x0f0d | ||
| 56 | #define AC_VERB_GET_DIGI_CONVERT_2 0x0f0e /* unused */ | ||
| 57 | #define AC_VERB_GET_VOLUME_KNOB_CONTROL 0x0f0f | ||
| 58 | /* f10-f1a: GPIO */ | ||
| 59 | #define AC_VERB_GET_GPIO_DATA 0x0f15 | ||
| 60 | #define AC_VERB_GET_GPIO_MASK 0x0f16 | ||
| 61 | #define AC_VERB_GET_GPIO_DIRECTION 0x0f17 | ||
| 62 | #define AC_VERB_GET_GPIO_WAKE_MASK 0x0f18 | ||
| 63 | #define AC_VERB_GET_GPIO_UNSOLICITED_RSP_MASK 0x0f19 | ||
| 64 | #define AC_VERB_GET_GPIO_STICKY_MASK 0x0f1a | ||
| 65 | #define AC_VERB_GET_CONFIG_DEFAULT 0x0f1c | ||
| 66 | /* f20: AFG/MFG */ | ||
| 67 | #define AC_VERB_GET_SUBSYSTEM_ID 0x0f20 | ||
| 68 | #define AC_VERB_GET_CVT_CHAN_COUNT 0x0f2d | ||
| 69 | #define AC_VERB_GET_HDMI_DIP_SIZE 0x0f2e | ||
| 70 | #define AC_VERB_GET_HDMI_ELDD 0x0f2f | ||
| 71 | #define AC_VERB_GET_HDMI_DIP_INDEX 0x0f30 | ||
| 72 | #define AC_VERB_GET_HDMI_DIP_DATA 0x0f31 | ||
| 73 | #define AC_VERB_GET_HDMI_DIP_XMIT 0x0f32 | ||
| 74 | #define AC_VERB_GET_HDMI_CP_CTRL 0x0f33 | ||
| 75 | #define AC_VERB_GET_HDMI_CHAN_SLOT 0x0f34 | ||
| 76 | #define AC_VERB_GET_DEVICE_SEL 0xf35 | ||
| 77 | #define AC_VERB_GET_DEVICE_LIST 0xf36 | ||
| 78 | |||
| 79 | /* | ||
| 80 | * SET verbs | ||
| 81 | */ | ||
| 82 | #define AC_VERB_SET_STREAM_FORMAT 0x200 | ||
| 83 | #define AC_VERB_SET_AMP_GAIN_MUTE 0x300 | ||
| 84 | #define AC_VERB_SET_PROC_COEF 0x400 | ||
| 85 | #define AC_VERB_SET_COEF_INDEX 0x500 | ||
| 86 | #define AC_VERB_SET_CONNECT_SEL 0x701 | ||
| 87 | #define AC_VERB_SET_PROC_STATE 0x703 | ||
| 88 | #define AC_VERB_SET_SDI_SELECT 0x704 | ||
| 89 | #define AC_VERB_SET_POWER_STATE 0x705 | ||
| 90 | #define AC_VERB_SET_CHANNEL_STREAMID 0x706 | ||
| 91 | #define AC_VERB_SET_PIN_WIDGET_CONTROL 0x707 | ||
| 92 | #define AC_VERB_SET_UNSOLICITED_ENABLE 0x708 | ||
| 93 | #define AC_VERB_SET_PIN_SENSE 0x709 | ||
| 94 | #define AC_VERB_SET_BEEP_CONTROL 0x70a | ||
| 95 | #define AC_VERB_SET_EAPD_BTLENABLE 0x70c | ||
| 96 | #define AC_VERB_SET_DIGI_CONVERT_1 0x70d | ||
| 97 | #define AC_VERB_SET_DIGI_CONVERT_2 0x70e | ||
| 98 | #define AC_VERB_SET_VOLUME_KNOB_CONTROL 0x70f | ||
| 99 | #define AC_VERB_SET_GPIO_DATA 0x715 | ||
| 100 | #define AC_VERB_SET_GPIO_MASK 0x716 | ||
| 101 | #define AC_VERB_SET_GPIO_DIRECTION 0x717 | ||
| 102 | #define AC_VERB_SET_GPIO_WAKE_MASK 0x718 | ||
| 103 | #define AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK 0x719 | ||
| 104 | #define AC_VERB_SET_GPIO_STICKY_MASK 0x71a | ||
| 105 | #define AC_VERB_SET_CONFIG_DEFAULT_BYTES_0 0x71c | ||
| 106 | #define AC_VERB_SET_CONFIG_DEFAULT_BYTES_1 0x71d | ||
| 107 | #define AC_VERB_SET_CONFIG_DEFAULT_BYTES_2 0x71e | ||
| 108 | #define AC_VERB_SET_CONFIG_DEFAULT_BYTES_3 0x71f | ||
| 109 | #define AC_VERB_SET_EAPD 0x788 | ||
| 110 | #define AC_VERB_SET_CODEC_RESET 0x7ff | ||
| 111 | #define AC_VERB_SET_CVT_CHAN_COUNT 0x72d | ||
| 112 | #define AC_VERB_SET_HDMI_DIP_INDEX 0x730 | ||
| 113 | #define AC_VERB_SET_HDMI_DIP_DATA 0x731 | ||
| 114 | #define AC_VERB_SET_HDMI_DIP_XMIT 0x732 | ||
| 115 | #define AC_VERB_SET_HDMI_CP_CTRL 0x733 | ||
| 116 | #define AC_VERB_SET_HDMI_CHAN_SLOT 0x734 | ||
| 117 | #define AC_VERB_SET_DEVICE_SEL 0x735 | ||
| 118 | |||
| 119 | /* | ||
| 120 | * Parameter IDs | ||
| 121 | */ | ||
| 122 | #define AC_PAR_VENDOR_ID 0x00 | ||
| 123 | #define AC_PAR_SUBSYSTEM_ID 0x01 | ||
| 124 | #define AC_PAR_REV_ID 0x02 | ||
| 125 | #define AC_PAR_NODE_COUNT 0x04 | ||
| 126 | #define AC_PAR_FUNCTION_TYPE 0x05 | ||
| 127 | #define AC_PAR_AUDIO_FG_CAP 0x08 | ||
| 128 | #define AC_PAR_AUDIO_WIDGET_CAP 0x09 | ||
| 129 | #define AC_PAR_PCM 0x0a | ||
| 130 | #define AC_PAR_STREAM 0x0b | ||
| 131 | #define AC_PAR_PIN_CAP 0x0c | ||
| 132 | #define AC_PAR_AMP_IN_CAP 0x0d | ||
| 133 | #define AC_PAR_CONNLIST_LEN 0x0e | ||
| 134 | #define AC_PAR_POWER_STATE 0x0f | ||
| 135 | #define AC_PAR_PROC_CAP 0x10 | ||
| 136 | #define AC_PAR_GPIO_CAP 0x11 | ||
| 137 | #define AC_PAR_AMP_OUT_CAP 0x12 | ||
| 138 | #define AC_PAR_VOL_KNB_CAP 0x13 | ||
| 139 | #define AC_PAR_DEVLIST_LEN 0x15 | ||
| 140 | #define AC_PAR_HDMI_LPCM_CAP 0x20 | ||
| 141 | |||
| 142 | /* | ||
| 143 | * AC_VERB_PARAMETERS results (32bit) | ||
| 144 | */ | ||
| 145 | |||
| 146 | /* Function Group Type */ | ||
| 147 | #define AC_FGT_TYPE (0xff<<0) | ||
| 148 | #define AC_FGT_TYPE_SHIFT 0 | ||
| 149 | #define AC_FGT_UNSOL_CAP (1<<8) | ||
| 150 | |||
| 151 | /* Audio Function Group Capabilities */ | ||
| 152 | #define AC_AFG_OUT_DELAY (0xf<<0) | ||
| 153 | #define AC_AFG_IN_DELAY (0xf<<8) | ||
| 154 | #define AC_AFG_BEEP_GEN (1<<16) | ||
| 155 | |||
| 156 | /* Audio Widget Capabilities */ | ||
| 157 | #define AC_WCAP_STEREO (1<<0) /* stereo I/O */ | ||
| 158 | #define AC_WCAP_IN_AMP (1<<1) /* AMP-in present */ | ||
| 159 | #define AC_WCAP_OUT_AMP (1<<2) /* AMP-out present */ | ||
| 160 | #define AC_WCAP_AMP_OVRD (1<<3) /* AMP-parameter override */ | ||
| 161 | #define AC_WCAP_FORMAT_OVRD (1<<4) /* format override */ | ||
| 162 | #define AC_WCAP_STRIPE (1<<5) /* stripe */ | ||
| 163 | #define AC_WCAP_PROC_WID (1<<6) /* Proc Widget */ | ||
| 164 | #define AC_WCAP_UNSOL_CAP (1<<7) /* Unsol capable */ | ||
| 165 | #define AC_WCAP_CONN_LIST (1<<8) /* connection list */ | ||
| 166 | #define AC_WCAP_DIGITAL (1<<9) /* digital I/O */ | ||
| 167 | #define AC_WCAP_POWER (1<<10) /* power control */ | ||
| 168 | #define AC_WCAP_LR_SWAP (1<<11) /* L/R swap */ | ||
| 169 | #define AC_WCAP_CP_CAPS (1<<12) /* content protection */ | ||
| 170 | #define AC_WCAP_CHAN_CNT_EXT (7<<13) /* channel count ext */ | ||
| 171 | #define AC_WCAP_DELAY (0xf<<16) | ||
| 172 | #define AC_WCAP_DELAY_SHIFT 16 | ||
| 173 | #define AC_WCAP_TYPE (0xf<<20) | ||
| 174 | #define AC_WCAP_TYPE_SHIFT 20 | ||
| 175 | |||
| 176 | /* supported PCM rates and bits */ | ||
| 177 | #define AC_SUPPCM_RATES (0xfff << 0) | ||
| 178 | #define AC_SUPPCM_BITS_8 (1<<16) | ||
| 179 | #define AC_SUPPCM_BITS_16 (1<<17) | ||
| 180 | #define AC_SUPPCM_BITS_20 (1<<18) | ||
| 181 | #define AC_SUPPCM_BITS_24 (1<<19) | ||
| 182 | #define AC_SUPPCM_BITS_32 (1<<20) | ||
| 183 | |||
| 184 | /* supported PCM stream format */ | ||
| 185 | #define AC_SUPFMT_PCM (1<<0) | ||
| 186 | #define AC_SUPFMT_FLOAT32 (1<<1) | ||
| 187 | #define AC_SUPFMT_AC3 (1<<2) | ||
| 188 | |||
| 189 | /* GP I/O count */ | ||
| 190 | #define AC_GPIO_IO_COUNT (0xff<<0) | ||
| 191 | #define AC_GPIO_O_COUNT (0xff<<8) | ||
| 192 | #define AC_GPIO_O_COUNT_SHIFT 8 | ||
| 193 | #define AC_GPIO_I_COUNT (0xff<<16) | ||
| 194 | #define AC_GPIO_I_COUNT_SHIFT 16 | ||
| 195 | #define AC_GPIO_UNSOLICITED (1<<30) | ||
| 196 | #define AC_GPIO_WAKE (1<<31) | ||
| 197 | |||
| 198 | /* Converter stream, channel */ | ||
| 199 | #define AC_CONV_CHANNEL (0xf<<0) | ||
| 200 | #define AC_CONV_STREAM (0xf<<4) | ||
| 201 | #define AC_CONV_STREAM_SHIFT 4 | ||
| 202 | |||
| 203 | /* Input converter SDI select */ | ||
| 204 | #define AC_SDI_SELECT (0xf<<0) | ||
| 205 | |||
| 206 | /* stream format id */ | ||
| 207 | #define AC_FMT_CHAN_SHIFT 0 | ||
| 208 | #define AC_FMT_CHAN_MASK (0x0f << 0) | ||
| 209 | #define AC_FMT_BITS_SHIFT 4 | ||
| 210 | #define AC_FMT_BITS_MASK (7 << 4) | ||
| 211 | #define AC_FMT_BITS_8 (0 << 4) | ||
| 212 | #define AC_FMT_BITS_16 (1 << 4) | ||
| 213 | #define AC_FMT_BITS_20 (2 << 4) | ||
| 214 | #define AC_FMT_BITS_24 (3 << 4) | ||
| 215 | #define AC_FMT_BITS_32 (4 << 4) | ||
| 216 | #define AC_FMT_DIV_SHIFT 8 | ||
| 217 | #define AC_FMT_DIV_MASK (7 << 8) | ||
| 218 | #define AC_FMT_MULT_SHIFT 11 | ||
| 219 | #define AC_FMT_MULT_MASK (7 << 11) | ||
| 220 | #define AC_FMT_BASE_SHIFT 14 | ||
| 221 | #define AC_FMT_BASE_48K (0 << 14) | ||
| 222 | #define AC_FMT_BASE_44K (1 << 14) | ||
| 223 | #define AC_FMT_TYPE_SHIFT 15 | ||
| 224 | #define AC_FMT_TYPE_PCM (0 << 15) | ||
| 225 | #define AC_FMT_TYPE_NON_PCM (1 << 15) | ||
| 226 | |||
| 227 | /* Unsolicited response control */ | ||
| 228 | #define AC_UNSOL_TAG (0x3f<<0) | ||
| 229 | #define AC_UNSOL_ENABLED (1<<7) | ||
| 230 | #define AC_USRSP_EN AC_UNSOL_ENABLED | ||
| 231 | |||
| 232 | /* Unsolicited responses */ | ||
| 233 | #define AC_UNSOL_RES_TAG (0x3f<<26) | ||
| 234 | #define AC_UNSOL_RES_TAG_SHIFT 26 | ||
| 235 | #define AC_UNSOL_RES_SUBTAG (0x1f<<21) | ||
| 236 | #define AC_UNSOL_RES_SUBTAG_SHIFT 21 | ||
| 237 | #define AC_UNSOL_RES_DE (0x3f<<15) /* Device Entry | ||
| 238 | * (for DP1.2 MST) | ||
| 239 | */ | ||
| 240 | #define AC_UNSOL_RES_DE_SHIFT 15 | ||
| 241 | #define AC_UNSOL_RES_IA (1<<2) /* Inactive (for DP1.2 MST) */ | ||
| 242 | #define AC_UNSOL_RES_ELDV (1<<1) /* ELD Data valid (for HDMI) */ | ||
| 243 | #define AC_UNSOL_RES_PD (1<<0) /* pinsense detect */ | ||
| 244 | #define AC_UNSOL_RES_CP_STATE (1<<1) /* content protection */ | ||
| 245 | #define AC_UNSOL_RES_CP_READY (1<<0) /* content protection */ | ||
| 246 | |||
| 247 | /* Pin widget capabilies */ | ||
| 248 | #define AC_PINCAP_IMP_SENSE (1<<0) /* impedance sense capable */ | ||
| 249 | #define AC_PINCAP_TRIG_REQ (1<<1) /* trigger required */ | ||
| 250 | #define AC_PINCAP_PRES_DETECT (1<<2) /* presence detect capable */ | ||
| 251 | #define AC_PINCAP_HP_DRV (1<<3) /* headphone drive capable */ | ||
| 252 | #define AC_PINCAP_OUT (1<<4) /* output capable */ | ||
| 253 | #define AC_PINCAP_IN (1<<5) /* input capable */ | ||
| 254 | #define AC_PINCAP_BALANCE (1<<6) /* balanced I/O capable */ | ||
| 255 | /* Note: This LR_SWAP pincap is defined in the Realtek ALC883 specification, | ||
| 256 | * but is marked reserved in the Intel HDA specification. | ||
| 257 | */ | ||
| 258 | #define AC_PINCAP_LR_SWAP (1<<7) /* L/R swap */ | ||
| 259 | /* Note: The same bit as LR_SWAP is newly defined as HDMI capability | ||
| 260 | * in HD-audio specification | ||
| 261 | */ | ||
| 262 | #define AC_PINCAP_HDMI (1<<7) /* HDMI pin */ | ||
| 263 | #define AC_PINCAP_DP (1<<24) /* DisplayPort pin, can | ||
| 264 | * coexist with AC_PINCAP_HDMI | ||
| 265 | */ | ||
| 266 | #define AC_PINCAP_VREF (0x37<<8) | ||
| 267 | #define AC_PINCAP_VREF_SHIFT 8 | ||
| 268 | #define AC_PINCAP_EAPD (1<<16) /* EAPD capable */ | ||
| 269 | #define AC_PINCAP_HBR (1<<27) /* High Bit Rate */ | ||
| 270 | /* Vref status (used in pin cap) */ | ||
| 271 | #define AC_PINCAP_VREF_HIZ (1<<0) /* Hi-Z */ | ||
| 272 | #define AC_PINCAP_VREF_50 (1<<1) /* 50% */ | ||
| 273 | #define AC_PINCAP_VREF_GRD (1<<2) /* ground */ | ||
| 274 | #define AC_PINCAP_VREF_80 (1<<4) /* 80% */ | ||
| 275 | #define AC_PINCAP_VREF_100 (1<<5) /* 100% */ | ||
| 276 | |||
| 277 | /* Amplifier capabilities */ | ||
| 278 | #define AC_AMPCAP_OFFSET (0x7f<<0) /* 0dB offset */ | ||
| 279 | #define AC_AMPCAP_OFFSET_SHIFT 0 | ||
| 280 | #define AC_AMPCAP_NUM_STEPS (0x7f<<8) /* number of steps */ | ||
| 281 | #define AC_AMPCAP_NUM_STEPS_SHIFT 8 | ||
| 282 | #define AC_AMPCAP_STEP_SIZE (0x7f<<16) /* step size 0-32dB | ||
| 283 | * in 0.25dB | ||
| 284 | */ | ||
| 285 | #define AC_AMPCAP_STEP_SIZE_SHIFT 16 | ||
| 286 | #define AC_AMPCAP_MUTE (1<<31) /* mute capable */ | ||
| 287 | #define AC_AMPCAP_MUTE_SHIFT 31 | ||
| 288 | |||
| 289 | /* driver-specific amp-caps: using bits 24-30 */ | ||
| 290 | #define AC_AMPCAP_MIN_MUTE (1 << 30) /* min-volume = mute */ | ||
| 291 | |||
| 292 | /* Connection list */ | ||
| 293 | #define AC_CLIST_LENGTH (0x7f<<0) | ||
| 294 | #define AC_CLIST_LONG (1<<7) | ||
| 295 | |||
| 296 | /* Supported power status */ | ||
| 297 | #define AC_PWRST_D0SUP (1<<0) | ||
| 298 | #define AC_PWRST_D1SUP (1<<1) | ||
| 299 | #define AC_PWRST_D2SUP (1<<2) | ||
| 300 | #define AC_PWRST_D3SUP (1<<3) | ||
| 301 | #define AC_PWRST_D3COLDSUP (1<<4) | ||
| 302 | #define AC_PWRST_S3D3COLDSUP (1<<29) | ||
| 303 | #define AC_PWRST_CLKSTOP (1<<30) | ||
| 304 | #define AC_PWRST_EPSS (1U<<31) | ||
| 305 | |||
| 306 | /* Power state values */ | ||
| 307 | #define AC_PWRST_SETTING (0xf<<0) | ||
| 308 | #define AC_PWRST_ACTUAL (0xf<<4) | ||
| 309 | #define AC_PWRST_ACTUAL_SHIFT 4 | ||
| 310 | #define AC_PWRST_D0 0x00 | ||
| 311 | #define AC_PWRST_D1 0x01 | ||
| 312 | #define AC_PWRST_D2 0x02 | ||
| 313 | #define AC_PWRST_D3 0x03 | ||
| 314 | #define AC_PWRST_ERROR (1<<8) | ||
| 315 | #define AC_PWRST_CLK_STOP_OK (1<<9) | ||
| 316 | #define AC_PWRST_SETTING_RESET (1<<10) | ||
| 317 | |||
| 318 | /* Processing capabilies */ | ||
| 319 | #define AC_PCAP_BENIGN (1<<0) | ||
| 320 | #define AC_PCAP_NUM_COEF (0xff<<8) | ||
| 321 | #define AC_PCAP_NUM_COEF_SHIFT 8 | ||
| 322 | |||
| 323 | /* Volume knobs capabilities */ | ||
| 324 | #define AC_KNBCAP_NUM_STEPS (0x7f<<0) | ||
| 325 | #define AC_KNBCAP_DELTA (1<<7) | ||
| 326 | |||
| 327 | /* HDMI LPCM capabilities */ | ||
| 328 | #define AC_LPCMCAP_48K_CP_CHNS (0x0f<<0) /* max channels w/ CP-on */ | ||
| 329 | #define AC_LPCMCAP_48K_NO_CHNS (0x0f<<4) /* max channels w/o CP-on */ | ||
| 330 | #define AC_LPCMCAP_48K_20BIT (1<<8) /* 20b bitrate supported */ | ||
| 331 | #define AC_LPCMCAP_48K_24BIT (1<<9) /* 24b bitrate supported */ | ||
| 332 | #define AC_LPCMCAP_96K_CP_CHNS (0x0f<<10) /* max channels w/ CP-on */ | ||
| 333 | #define AC_LPCMCAP_96K_NO_CHNS (0x0f<<14) /* max channels w/o CP-on */ | ||
| 334 | #define AC_LPCMCAP_96K_20BIT (1<<18) /* 20b bitrate supported */ | ||
| 335 | #define AC_LPCMCAP_96K_24BIT (1<<19) /* 24b bitrate supported */ | ||
| 336 | #define AC_LPCMCAP_192K_CP_CHNS (0x0f<<20) /* max channels w/ CP-on */ | ||
| 337 | #define AC_LPCMCAP_192K_NO_CHNS (0x0f<<24) /* max channels w/o CP-on */ | ||
| 338 | #define AC_LPCMCAP_192K_20BIT (1<<28) /* 20b bitrate supported */ | ||
| 339 | #define AC_LPCMCAP_192K_24BIT (1<<29) /* 24b bitrate supported */ | ||
| 340 | #define AC_LPCMCAP_44K (1<<30) /* 44.1kHz support */ | ||
| 341 | #define AC_LPCMCAP_44K_MS (1<<31) /* 44.1kHz-multiplies support */ | ||
| 342 | |||
| 343 | /* Display pin's device list length */ | ||
| 344 | #define AC_DEV_LIST_LEN_MASK 0x3f | ||
| 345 | #define AC_MAX_DEV_LIST_LEN 64 | ||
| 346 | |||
| 347 | /* | ||
| 348 | * Control Parameters | ||
| 349 | */ | ||
| 350 | |||
| 351 | /* Amp gain/mute */ | ||
| 352 | #define AC_AMP_MUTE (1<<7) | ||
| 353 | #define AC_AMP_GAIN (0x7f) | ||
| 354 | #define AC_AMP_GET_INDEX (0xf<<0) | ||
| 355 | |||
| 356 | #define AC_AMP_GET_LEFT (1<<13) | ||
| 357 | #define AC_AMP_GET_RIGHT (0<<13) | ||
| 358 | #define AC_AMP_GET_OUTPUT (1<<15) | ||
| 359 | #define AC_AMP_GET_INPUT (0<<15) | ||
| 360 | |||
| 361 | #define AC_AMP_SET_INDEX (0xf<<8) | ||
| 362 | #define AC_AMP_SET_INDEX_SHIFT 8 | ||
| 363 | #define AC_AMP_SET_RIGHT (1<<12) | ||
| 364 | #define AC_AMP_SET_LEFT (1<<13) | ||
| 365 | #define AC_AMP_SET_INPUT (1<<14) | ||
| 366 | #define AC_AMP_SET_OUTPUT (1<<15) | ||
| 367 | |||
| 368 | /* DIGITAL1 bits */ | ||
| 369 | #define AC_DIG1_ENABLE (1<<0) | ||
| 370 | #define AC_DIG1_V (1<<1) | ||
| 371 | #define AC_DIG1_VCFG (1<<2) | ||
| 372 | #define AC_DIG1_EMPHASIS (1<<3) | ||
| 373 | #define AC_DIG1_COPYRIGHT (1<<4) | ||
| 374 | #define AC_DIG1_NONAUDIO (1<<5) | ||
| 375 | #define AC_DIG1_PROFESSIONAL (1<<6) | ||
| 376 | #define AC_DIG1_LEVEL (1<<7) | ||
| 377 | |||
| 378 | /* DIGITAL2 bits */ | ||
| 379 | #define AC_DIG2_CC (0x7f<<0) | ||
| 380 | |||
| 381 | /* DIGITAL3 bits */ | ||
| 382 | #define AC_DIG3_ICT (0xf<<0) | ||
| 383 | #define AC_DIG3_KAE (1<<7) | ||
| 384 | |||
| 385 | /* Pin widget control - 8bit */ | ||
| 386 | #define AC_PINCTL_EPT (0x3<<0) | ||
| 387 | #define AC_PINCTL_EPT_NATIVE 0 | ||
| 388 | #define AC_PINCTL_EPT_HBR 3 | ||
| 389 | #define AC_PINCTL_VREFEN (0x7<<0) | ||
| 390 | #define AC_PINCTL_VREF_HIZ 0 /* Hi-Z */ | ||
| 391 | #define AC_PINCTL_VREF_50 1 /* 50% */ | ||
| 392 | #define AC_PINCTL_VREF_GRD 2 /* ground */ | ||
| 393 | #define AC_PINCTL_VREF_80 4 /* 80% */ | ||
| 394 | #define AC_PINCTL_VREF_100 5 /* 100% */ | ||
| 395 | #define AC_PINCTL_IN_EN (1<<5) | ||
| 396 | #define AC_PINCTL_OUT_EN (1<<6) | ||
| 397 | #define AC_PINCTL_HP_EN (1<<7) | ||
| 398 | |||
| 399 | /* Pin sense - 32bit */ | ||
| 400 | #define AC_PINSENSE_IMPEDANCE_MASK (0x7fffffff) | ||
| 401 | #define AC_PINSENSE_PRESENCE (1<<31) | ||
| 402 | #define AC_PINSENSE_ELDV (1<<30) /* ELD valid (HDMI) */ | ||
| 403 | |||
| 404 | /* EAPD/BTL enable - 32bit */ | ||
| 405 | #define AC_EAPDBTL_BALANCED (1<<0) | ||
| 406 | #define AC_EAPDBTL_EAPD (1<<1) | ||
| 407 | #define AC_EAPDBTL_LR_SWAP (1<<2) | ||
| 408 | |||
| 409 | /* HDMI ELD data */ | ||
| 410 | #define AC_ELDD_ELD_VALID (1<<31) | ||
| 411 | #define AC_ELDD_ELD_DATA 0xff | ||
| 412 | |||
| 413 | /* HDMI DIP size */ | ||
| 414 | #define AC_DIPSIZE_ELD_BUF (1<<3) /* ELD buf size of packet size */ | ||
| 415 | #define AC_DIPSIZE_PACK_IDX (0x07<<0) /* packet index */ | ||
| 416 | |||
| 417 | /* HDMI DIP index */ | ||
| 418 | #define AC_DIPIDX_PACK_IDX (0x07<<5) /* packet idnex */ | ||
| 419 | #define AC_DIPIDX_BYTE_IDX (0x1f<<0) /* byte index */ | ||
| 420 | |||
| 421 | /* HDMI DIP xmit (transmit) control */ | ||
| 422 | #define AC_DIPXMIT_MASK (0x3<<6) | ||
| 423 | #define AC_DIPXMIT_DISABLE (0x0<<6) /* disable xmit */ | ||
| 424 | #define AC_DIPXMIT_ONCE (0x2<<6) /* xmit once then disable */ | ||
| 425 | #define AC_DIPXMIT_BEST (0x3<<6) /* best effort */ | ||
| 426 | |||
| 427 | /* HDMI content protection (CP) control */ | ||
| 428 | #define AC_CPCTRL_CES (1<<9) /* current encryption state */ | ||
| 429 | #define AC_CPCTRL_READY (1<<8) /* ready bit */ | ||
| 430 | #define AC_CPCTRL_SUBTAG (0x1f<<3) /* subtag for unsol-resp */ | ||
| 431 | #define AC_CPCTRL_STATE (3<<0) /* current CP request state */ | ||
| 432 | |||
| 433 | /* Converter channel <-> HDMI slot mapping */ | ||
| 434 | #define AC_CVTMAP_HDMI_SLOT (0xf<<0) /* HDMI slot number */ | ||
| 435 | #define AC_CVTMAP_CHAN (0xf<<4) /* converter channel number */ | ||
| 436 | |||
| 437 | /* configuration default - 32bit */ | ||
| 438 | #define AC_DEFCFG_SEQUENCE (0xf<<0) | ||
| 439 | #define AC_DEFCFG_DEF_ASSOC (0xf<<4) | ||
| 440 | #define AC_DEFCFG_ASSOC_SHIFT 4 | ||
| 441 | #define AC_DEFCFG_MISC (0xf<<8) | ||
| 442 | #define AC_DEFCFG_MISC_SHIFT 8 | ||
| 443 | #define AC_DEFCFG_MISC_NO_PRESENCE (1<<0) | ||
| 444 | #define AC_DEFCFG_COLOR (0xf<<12) | ||
| 445 | #define AC_DEFCFG_COLOR_SHIFT 12 | ||
| 446 | #define AC_DEFCFG_CONN_TYPE (0xf<<16) | ||
| 447 | #define AC_DEFCFG_CONN_TYPE_SHIFT 16 | ||
| 448 | #define AC_DEFCFG_DEVICE (0xf<<20) | ||
| 449 | #define AC_DEFCFG_DEVICE_SHIFT 20 | ||
| 450 | #define AC_DEFCFG_LOCATION (0x3f<<24) | ||
| 451 | #define AC_DEFCFG_LOCATION_SHIFT 24 | ||
| 452 | #define AC_DEFCFG_PORT_CONN (0x3<<30) | ||
| 453 | #define AC_DEFCFG_PORT_CONN_SHIFT 30 | ||
| 454 | |||
| 455 | /* Display pin's device list entry */ | ||
| 456 | #define AC_DE_PD (1<<0) | ||
| 457 | #define AC_DE_ELDV (1<<1) | ||
| 458 | #define AC_DE_IA (1<<2) | ||
| 459 | |||
| 460 | /* device device types (0x0-0xf) */ | ||
| 461 | enum { | ||
| 462 | AC_JACK_LINE_OUT, | ||
| 463 | AC_JACK_SPEAKER, | ||
| 464 | AC_JACK_HP_OUT, | ||
| 465 | AC_JACK_CD, | ||
| 466 | AC_JACK_SPDIF_OUT, | ||
| 467 | AC_JACK_DIG_OTHER_OUT, | ||
| 468 | AC_JACK_MODEM_LINE_SIDE, | ||
| 469 | AC_JACK_MODEM_HAND_SIDE, | ||
| 470 | AC_JACK_LINE_IN, | ||
| 471 | AC_JACK_AUX, | ||
| 472 | AC_JACK_MIC_IN, | ||
| 473 | AC_JACK_TELEPHONY, | ||
| 474 | AC_JACK_SPDIF_IN, | ||
| 475 | AC_JACK_DIG_OTHER_IN, | ||
| 476 | AC_JACK_OTHER = 0xf, | ||
| 477 | }; | ||
| 478 | |||
| 479 | /* jack connection types (0x0-0xf) */ | ||
| 480 | enum { | ||
| 481 | AC_JACK_CONN_UNKNOWN, | ||
| 482 | AC_JACK_CONN_1_8, | ||
| 483 | AC_JACK_CONN_1_4, | ||
| 484 | AC_JACK_CONN_ATAPI, | ||
| 485 | AC_JACK_CONN_RCA, | ||
| 486 | AC_JACK_CONN_OPTICAL, | ||
| 487 | AC_JACK_CONN_OTHER_DIGITAL, | ||
| 488 | AC_JACK_CONN_OTHER_ANALOG, | ||
| 489 | AC_JACK_CONN_DIN, | ||
| 490 | AC_JACK_CONN_XLR, | ||
| 491 | AC_JACK_CONN_RJ11, | ||
| 492 | AC_JACK_CONN_COMB, | ||
| 493 | AC_JACK_CONN_OTHER = 0xf, | ||
| 494 | }; | ||
| 495 | |||
| 496 | /* jack colors (0x0-0xf) */ | ||
| 497 | enum { | ||
| 498 | AC_JACK_COLOR_UNKNOWN, | ||
| 499 | AC_JACK_COLOR_BLACK, | ||
| 500 | AC_JACK_COLOR_GREY, | ||
| 501 | AC_JACK_COLOR_BLUE, | ||
| 502 | AC_JACK_COLOR_GREEN, | ||
| 503 | AC_JACK_COLOR_RED, | ||
| 504 | AC_JACK_COLOR_ORANGE, | ||
| 505 | AC_JACK_COLOR_YELLOW, | ||
| 506 | AC_JACK_COLOR_PURPLE, | ||
| 507 | AC_JACK_COLOR_PINK, | ||
| 508 | AC_JACK_COLOR_WHITE = 0xe, | ||
| 509 | AC_JACK_COLOR_OTHER, | ||
| 510 | }; | ||
| 511 | |||
| 512 | /* Jack location (0x0-0x3f) */ | ||
| 513 | /* common case */ | ||
| 514 | enum { | ||
| 515 | AC_JACK_LOC_NONE, | ||
| 516 | AC_JACK_LOC_REAR, | ||
| 517 | AC_JACK_LOC_FRONT, | ||
| 518 | AC_JACK_LOC_LEFT, | ||
| 519 | AC_JACK_LOC_RIGHT, | ||
| 520 | AC_JACK_LOC_TOP, | ||
| 521 | AC_JACK_LOC_BOTTOM, | ||
| 522 | }; | ||
| 523 | /* bits 4-5 */ | ||
| 524 | enum { | ||
| 525 | AC_JACK_LOC_EXTERNAL = 0x00, | ||
| 526 | AC_JACK_LOC_INTERNAL = 0x10, | ||
| 527 | AC_JACK_LOC_SEPARATE = 0x20, | ||
| 528 | AC_JACK_LOC_OTHER = 0x30, | ||
| 529 | }; | ||
| 530 | enum { | ||
| 531 | /* external on primary chasis */ | ||
| 532 | AC_JACK_LOC_REAR_PANEL = 0x07, | ||
| 533 | AC_JACK_LOC_DRIVE_BAY, | ||
| 534 | /* internal */ | ||
| 535 | AC_JACK_LOC_RISER = 0x17, | ||
| 536 | AC_JACK_LOC_HDMI, | ||
| 537 | AC_JACK_LOC_ATAPI, | ||
| 538 | /* others */ | ||
| 539 | AC_JACK_LOC_MOBILE_IN = 0x37, | ||
| 540 | AC_JACK_LOC_MOBILE_OUT, | ||
| 541 | }; | ||
| 542 | |||
| 543 | /* Port connectivity (0-3) */ | ||
| 544 | enum { | ||
| 545 | AC_JACK_PORT_COMPLEX, | ||
| 546 | AC_JACK_PORT_NONE, | ||
| 547 | AC_JACK_PORT_FIXED, | ||
| 548 | AC_JACK_PORT_BOTH, | ||
| 549 | }; | ||
| 550 | |||
| 551 | /* max. codec address */ | ||
| 552 | #define HDA_MAX_CODEC_ADDRESS 0x0f | ||
| 553 | |||
| 554 | #endif /* __SOUND_HDA_VERBS_H */ | ||
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index af9983970417..782d1df34208 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h | |||
| @@ -108,7 +108,7 @@ static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab, | |||
| 108 | { | 108 | { |
| 109 | struct snd_sg_buf *sgbuf = dmab->private_data; | 109 | struct snd_sg_buf *sgbuf = dmab->private_data; |
| 110 | dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr; | 110 | dma_addr_t addr = sgbuf->table[offset >> PAGE_SHIFT].addr; |
| 111 | addr &= PAGE_MASK; | 111 | addr &= ~((dma_addr_t)PAGE_SIZE - 1); |
| 112 | return addr + offset % PAGE_SIZE; | 112 | return addr + offset % PAGE_SIZE; |
| 113 | } | 113 | } |
| 114 | 114 | ||
| @@ -149,13 +149,6 @@ int snd_dma_alloc_pages_fallback(int type, struct device *dev, size_t size, | |||
| 149 | struct snd_dma_buffer *dmab); | 149 | struct snd_dma_buffer *dmab); |
| 150 | void snd_dma_free_pages(struct snd_dma_buffer *dmab); | 150 | void snd_dma_free_pages(struct snd_dma_buffer *dmab); |
| 151 | 151 | ||
| 152 | /* buffer-preservation managements */ | ||
| 153 | |||
| 154 | #define snd_dma_pci_buf_id(pci) (((unsigned int)(pci)->vendor << 16) | (pci)->device) | ||
| 155 | |||
| 156 | size_t snd_dma_get_reserved_buf(struct snd_dma_buffer *dmab, unsigned int id); | ||
| 157 | int snd_dma_reserve_buf(struct snd_dma_buffer *dmab, unsigned int id); | ||
| 158 | |||
| 159 | /* basic memory allocation functions */ | 152 | /* basic memory allocation functions */ |
| 160 | void *snd_malloc_pages(size_t size, gfp_t gfp_flags); | 153 | void *snd_malloc_pages(size_t size, gfp_t gfp_flags); |
| 161 | void snd_free_pages(void *ptr, size_t size); | 154 | void snd_free_pages(void *ptr, size_t size); |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 84b10f9a2832..4883499ab38b 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
| @@ -381,7 +381,6 @@ struct snd_pcm_substream { | |||
| 381 | struct pm_qos_request latency_pm_qos_req; /* pm_qos request */ | 381 | struct pm_qos_request latency_pm_qos_req; /* pm_qos request */ |
| 382 | size_t buffer_bytes_max; /* limit ring buffer size */ | 382 | size_t buffer_bytes_max; /* limit ring buffer size */ |
| 383 | struct snd_dma_buffer dma_buffer; | 383 | struct snd_dma_buffer dma_buffer; |
| 384 | unsigned int dma_buf_id; | ||
| 385 | size_t dma_max; | 384 | size_t dma_max; |
| 386 | /* -- hardware operations -- */ | 385 | /* -- hardware operations -- */ |
| 387 | const struct snd_pcm_ops *ops; | 386 | const struct snd_pcm_ops *ops; |
| @@ -901,6 +900,8 @@ extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates; | |||
| 901 | int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime); | 900 | int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime); |
| 902 | unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate); | 901 | unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate); |
| 903 | unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit); | 902 | unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit); |
| 903 | unsigned int snd_pcm_rate_mask_intersect(unsigned int rates_a, | ||
| 904 | unsigned int rates_b); | ||
| 904 | 905 | ||
| 905 | static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, | 906 | static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, |
| 906 | struct snd_dma_buffer *bufp) | 907 | struct snd_dma_buffer *bufp) |
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 37ae12e0ab06..6b1c78f05fab 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h | |||
| @@ -354,4 +354,16 @@ params_period_bytes(const struct snd_pcm_hw_params *p) | |||
| 354 | params_channels(p)) / 8; | 354 | params_channels(p)) / 8; |
| 355 | } | 355 | } |
| 356 | 356 | ||
| 357 | static inline int | ||
| 358 | params_width(const struct snd_pcm_hw_params *p) | ||
| 359 | { | ||
| 360 | return snd_pcm_format_width(params_format(p)); | ||
| 361 | } | ||
| 362 | |||
| 363 | static inline int | ||
| 364 | params_physical_width(const struct snd_pcm_hw_params *p) | ||
| 365 | { | ||
| 366 | return snd_pcm_format_physical_width(params_format(p)); | ||
| 367 | } | ||
| 368 | |||
| 357 | #endif /* __SOUND_PCM_PARAMS_H */ | 369 | #endif /* __SOUND_PCM_PARAMS_H */ |
diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h index 12afab18945d..6add6ccc811e 100644 --- a/include/sound/rcar_snd.h +++ b/include/sound/rcar_snd.h | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | #define RSND_GEN1_ADG 1 | 18 | #define RSND_GEN1_ADG 1 |
| 19 | #define RSND_GEN1_SSI 2 | 19 | #define RSND_GEN1_SSI 2 |
| 20 | 20 | ||
| 21 | #define RSND_GEN2_SRU 0 | 21 | #define RSND_GEN2_SCU 0 |
| 22 | #define RSND_GEN2_ADG 1 | 22 | #define RSND_GEN2_ADG 1 |
| 23 | #define RSND_GEN2_SSIU 2 | 23 | #define RSND_GEN2_SSIU 2 |
| 24 | #define RSND_GEN2_SSI 3 | 24 | #define RSND_GEN2_SSI 3 |
| @@ -34,7 +34,6 @@ | |||
| 34 | * B : SSI direction | 34 | * B : SSI direction |
| 35 | */ | 35 | */ |
| 36 | #define RSND_SSI_CLK_PIN_SHARE (1 << 31) | 36 | #define RSND_SSI_CLK_PIN_SHARE (1 << 31) |
| 37 | #define RSND_SSI_CLK_FROM_ADG (1 << 30) /* clock parent is master */ | ||
| 38 | #define RSND_SSI_SYNC (1 << 29) /* SSI34_sync etc */ | 37 | #define RSND_SSI_SYNC (1 << 29) /* SSI34_sync etc */ |
| 39 | 38 | ||
| 40 | #define RSND_SSI_PLAY (1 << 24) | 39 | #define RSND_SSI_PLAY (1 << 24) |
| @@ -58,6 +57,7 @@ struct rsnd_ssi_platform_info { | |||
| 58 | 57 | ||
| 59 | struct rsnd_scu_platform_info { | 58 | struct rsnd_scu_platform_info { |
| 60 | u32 flags; | 59 | u32 flags; |
| 60 | u32 convert_rate; /* sampling rate convert */ | ||
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| 63 | /* | 63 | /* |
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 800c101bb096..71f27c403194 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
| @@ -123,6 +123,8 @@ int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | |||
| 123 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute, | 123 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute, |
| 124 | int direction); | 124 | int direction); |
| 125 | 125 | ||
| 126 | int snd_soc_dai_is_dummy(struct snd_soc_dai *dai); | ||
| 127 | |||
| 126 | struct snd_soc_dai_ops { | 128 | struct snd_soc_dai_ops { |
| 127 | /* | 129 | /* |
| 128 | * DAI clocking configuration, all optional. | 130 | * DAI clocking configuration, all optional. |
| @@ -220,6 +222,8 @@ struct snd_soc_dai_driver { | |||
| 220 | struct snd_soc_pcm_stream capture; | 222 | struct snd_soc_pcm_stream capture; |
| 221 | struct snd_soc_pcm_stream playback; | 223 | struct snd_soc_pcm_stream playback; |
| 222 | unsigned int symmetric_rates:1; | 224 | unsigned int symmetric_rates:1; |
| 225 | unsigned int symmetric_channels:1; | ||
| 226 | unsigned int symmetric_samplebits:1; | ||
| 223 | 227 | ||
| 224 | /* probe ordering - for components with runtime dependencies */ | 228 | /* probe ordering - for components with runtime dependencies */ |
| 225 | int probe_order; | 229 | int probe_order; |
| @@ -244,6 +248,8 @@ struct snd_soc_dai { | |||
| 244 | unsigned int capture_active:1; /* stream is in use */ | 248 | unsigned int capture_active:1; /* stream is in use */ |
| 245 | unsigned int playback_active:1; /* stream is in use */ | 249 | unsigned int playback_active:1; /* stream is in use */ |
| 246 | unsigned int symmetric_rates:1; | 250 | unsigned int symmetric_rates:1; |
| 251 | unsigned int symmetric_channels:1; | ||
| 252 | unsigned int symmetric_samplebits:1; | ||
| 247 | struct snd_pcm_runtime *runtime; | 253 | struct snd_pcm_runtime *runtime; |
| 248 | unsigned int active; | 254 | unsigned int active; |
| 249 | unsigned char probed:1; | 255 | unsigned char probed:1; |
| @@ -258,6 +264,8 @@ struct snd_soc_dai { | |||
| 258 | 264 | ||
| 259 | /* Symmetry data - only valid if symmetry is being enforced */ | 265 | /* Symmetry data - only valid if symmetry is being enforced */ |
| 260 | unsigned int rate; | 266 | unsigned int rate; |
| 267 | unsigned int channels; | ||
| 268 | unsigned int sample_bits; | ||
| 261 | 269 | ||
| 262 | /* parent platform/codec */ | 270 | /* parent platform/codec */ |
| 263 | struct snd_soc_platform *platform; | 271 | struct snd_soc_platform *platform; |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 2037c45adfe6..68d92e36facd 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
| @@ -104,7 +104,8 @@ struct device; | |||
| 104 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ | 104 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
| 105 | .kcontrol_news = wcontrols, .num_kcontrols = 1} | 105 | .kcontrol_news = wcontrols, .num_kcontrols = 1} |
| 106 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 106 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
| 107 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, \ | 107 | { .id = snd_soc_dapm_mux, .name = wname, \ |
| 108 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ | ||
| 108 | .kcontrol_news = wcontrols, .num_kcontrols = 1} | 109 | .kcontrol_news = wcontrols, .num_kcontrols = 1} |
| 109 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 110 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
| 110 | { .id = snd_soc_dapm_virt_mux, .name = wname, \ | 111 | { .id = snd_soc_dapm_virt_mux, .name = wname, \ |
| @@ -411,6 +412,7 @@ int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, | |||
| 411 | int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, | 412 | int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, |
| 412 | struct snd_soc_dai *dai); | 413 | struct snd_soc_dai *dai); |
| 413 | int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card); | 414 | int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card); |
| 415 | void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card); | ||
| 414 | int snd_soc_dapm_new_pcm(struct snd_soc_card *card, | 416 | int snd_soc_dapm_new_pcm(struct snd_soc_card *card, |
| 415 | const struct snd_soc_pcm_stream *params, | 417 | const struct snd_soc_pcm_stream *params, |
| 416 | struct snd_soc_dapm_widget *source, | 418 | struct snd_soc_dapm_widget *source, |
diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h index 047d657c331c..2883a7a6f9f3 100644 --- a/include/sound/soc-dpcm.h +++ b/include/sound/soc-dpcm.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #ifndef __LINUX_SND_SOC_DPCM_H | 11 | #ifndef __LINUX_SND_SOC_DPCM_H |
| 12 | #define __LINUX_SND_SOC_DPCM_H | 12 | #define __LINUX_SND_SOC_DPCM_H |
| 13 | 13 | ||
| 14 | #include <linux/slab.h> | ||
| 14 | #include <linux/list.h> | 15 | #include <linux/list.h> |
| 15 | #include <sound/pcm.h> | 16 | #include <sound/pcm.h> |
| 16 | 17 | ||
| @@ -135,4 +136,25 @@ int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute); | |||
| 135 | int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); | 136 | int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); |
| 136 | int soc_dpcm_runtime_update(struct snd_soc_card *); | 137 | int soc_dpcm_runtime_update(struct snd_soc_card *); |
| 137 | 138 | ||
| 139 | int dpcm_path_get(struct snd_soc_pcm_runtime *fe, | ||
| 140 | int stream, struct snd_soc_dapm_widget_list **list_); | ||
| 141 | int dpcm_process_paths(struct snd_soc_pcm_runtime *fe, | ||
| 142 | int stream, struct snd_soc_dapm_widget_list **list, int new); | ||
| 143 | int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream); | ||
| 144 | int dpcm_be_dai_shutdown(struct snd_soc_pcm_runtime *fe, int stream); | ||
| 145 | void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream); | ||
| 146 | void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream); | ||
| 147 | int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream); | ||
| 148 | int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int tream); | ||
| 149 | int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, int cmd); | ||
| 150 | int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream); | ||
| 151 | int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, | ||
| 152 | int event); | ||
| 153 | |||
| 154 | static inline void dpcm_path_put(struct snd_soc_dapm_widget_list **list) | ||
| 155 | { | ||
| 156 | kfree(*list); | ||
| 157 | } | ||
| 158 | |||
| 159 | |||
| 138 | #endif | 160 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 1f741cb24f33..9a001472b96a 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
| @@ -334,9 +334,7 @@ struct snd_soc_jack_pin; | |||
| 334 | #include <sound/soc-dapm.h> | 334 | #include <sound/soc-dapm.h> |
| 335 | #include <sound/soc-dpcm.h> | 335 | #include <sound/soc-dpcm.h> |
| 336 | 336 | ||
| 337 | #ifdef CONFIG_GPIOLIB | ||
| 338 | struct snd_soc_jack_gpio; | 337 | struct snd_soc_jack_gpio; |
| 339 | #endif | ||
| 340 | 338 | ||
| 341 | typedef int (*hw_write_t)(void *,const char* ,int); | 339 | typedef int (*hw_write_t)(void *,const char* ,int); |
| 342 | 340 | ||
| @@ -446,6 +444,17 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, | |||
| 446 | struct snd_soc_jack_gpio *gpios); | 444 | struct snd_soc_jack_gpio *gpios); |
| 447 | void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, | 445 | void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, |
| 448 | struct snd_soc_jack_gpio *gpios); | 446 | struct snd_soc_jack_gpio *gpios); |
| 447 | #else | ||
| 448 | static inline int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, | ||
| 449 | struct snd_soc_jack_gpio *gpios) | ||
| 450 | { | ||
| 451 | return 0; | ||
| 452 | } | ||
| 453 | |||
| 454 | static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, | ||
| 455 | struct snd_soc_jack_gpio *gpios) | ||
| 456 | { | ||
| 457 | } | ||
| 449 | #endif | 458 | #endif |
| 450 | 459 | ||
| 451 | /* codec register bit access */ | 460 | /* codec register bit access */ |
| @@ -580,7 +589,6 @@ struct snd_soc_jack_zone { | |||
| 580 | * to provide more complex checks (eg, reading an | 589 | * to provide more complex checks (eg, reading an |
| 581 | * ADC). | 590 | * ADC). |
| 582 | */ | 591 | */ |
| 583 | #ifdef CONFIG_GPIOLIB | ||
| 584 | struct snd_soc_jack_gpio { | 592 | struct snd_soc_jack_gpio { |
| 585 | unsigned int gpio; | 593 | unsigned int gpio; |
| 586 | const char *name; | 594 | const char *name; |
| @@ -594,7 +602,6 @@ struct snd_soc_jack_gpio { | |||
| 594 | 602 | ||
| 595 | int (*jack_status_check)(void); | 603 | int (*jack_status_check)(void); |
| 596 | }; | 604 | }; |
| 597 | #endif | ||
| 598 | 605 | ||
| 599 | struct snd_soc_jack { | 606 | struct snd_soc_jack { |
| 600 | struct mutex mutex; | 607 | struct mutex mutex; |
| @@ -879,6 +886,8 @@ struct snd_soc_dai_link { | |||
| 879 | 886 | ||
| 880 | /* Symmetry requirements */ | 887 | /* Symmetry requirements */ |
| 881 | unsigned int symmetric_rates:1; | 888 | unsigned int symmetric_rates:1; |
| 889 | unsigned int symmetric_channels:1; | ||
| 890 | unsigned int symmetric_samplebits:1; | ||
| 882 | 891 | ||
| 883 | /* Do not create a PCM for this DAI link (Backend link) */ | 892 | /* Do not create a PCM for this DAI link (Backend link) */ |
| 884 | unsigned int no_pcm:1; | 893 | unsigned int no_pcm:1; |
| @@ -886,6 +895,10 @@ struct snd_soc_dai_link { | |||
| 886 | /* This DAI link can route to other DAI links at runtime (Frontend)*/ | 895 | /* This DAI link can route to other DAI links at runtime (Frontend)*/ |
| 887 | unsigned int dynamic:1; | 896 | unsigned int dynamic:1; |
| 888 | 897 | ||
| 898 | /* DPCM capture and Playback support */ | ||
| 899 | unsigned int dpcm_capture:1; | ||
| 900 | unsigned int dpcm_playback:1; | ||
| 901 | |||
| 889 | /* pmdown_time is ignored at stop */ | 902 | /* pmdown_time is ignored at stop */ |
| 890 | unsigned int ignore_pmdown_time:1; | 903 | unsigned int ignore_pmdown_time:1; |
| 891 | 904 | ||
| @@ -1029,6 +1042,7 @@ struct snd_soc_pcm_runtime { | |||
| 1029 | 1042 | ||
| 1030 | /* Dynamic PCM BE runtime data */ | 1043 | /* Dynamic PCM BE runtime data */ |
| 1031 | struct snd_soc_dpcm_runtime dpcm[2]; | 1044 | struct snd_soc_dpcm_runtime dpcm[2]; |
| 1045 | int fe_compr; | ||
| 1032 | 1046 | ||
| 1033 | long pmdown_time; | 1047 | long pmdown_time; |
| 1034 | unsigned char pop_wait:1; | 1048 | unsigned char pop_wait:1; |
diff --git a/include/sound/spear_dma.h b/include/sound/spear_dma.h index 1b365bfdfb37..65aca51fe255 100644 --- a/include/sound/spear_dma.h +++ b/include/sound/spear_dma.h | |||
| @@ -29,7 +29,6 @@ struct spear_dma_data { | |||
| 29 | dma_addr_t addr; | 29 | dma_addr_t addr; |
| 30 | u32 max_burst; | 30 | u32 max_burst; |
| 31 | enum dma_slave_buswidth addr_width; | 31 | enum dma_slave_buswidth addr_width; |
| 32 | bool (*filter)(struct dma_chan *chan, void *slave); | ||
| 33 | }; | 32 | }; |
| 34 | 33 | ||
| 35 | #endif /* SPEAR_DMA_H */ | 34 | #endif /* SPEAR_DMA_H */ |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 45412a6afa69..321301c0a643 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
| @@ -517,10 +517,6 @@ struct se_node_acl { | |||
| 517 | u32 acl_index; | 517 | u32 acl_index; |
| 518 | #define MAX_ACL_TAG_SIZE 64 | 518 | #define MAX_ACL_TAG_SIZE 64 |
| 519 | char acl_tag[MAX_ACL_TAG_SIZE]; | 519 | char acl_tag[MAX_ACL_TAG_SIZE]; |
| 520 | u64 num_cmds; | ||
| 521 | u64 read_bytes; | ||
| 522 | u64 write_bytes; | ||
| 523 | spinlock_t stats_lock; | ||
| 524 | /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */ | 520 | /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */ |
| 525 | atomic_t acl_pr_ref_count; | 521 | atomic_t acl_pr_ref_count; |
| 526 | struct se_dev_entry **device_list; | 522 | struct se_dev_entry **device_list; |
| @@ -624,6 +620,7 @@ struct se_dev_attrib { | |||
| 624 | u32 unmap_granularity; | 620 | u32 unmap_granularity; |
| 625 | u32 unmap_granularity_alignment; | 621 | u32 unmap_granularity_alignment; |
| 626 | u32 max_write_same_len; | 622 | u32 max_write_same_len; |
| 623 | u32 max_bytes_per_io; | ||
| 627 | struct se_device *da_dev; | 624 | struct se_device *da_dev; |
| 628 | struct config_group da_group; | 625 | struct config_group da_group; |
| 629 | }; | 626 | }; |
diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h index fde1b3e94c7d..06f544ef2f6f 100644 --- a/include/trace/events/compaction.h +++ b/include/trace/events/compaction.h | |||
| @@ -67,6 +67,48 @@ TRACE_EVENT(mm_compaction_migratepages, | |||
| 67 | __entry->nr_failed) | 67 | __entry->nr_failed) |
| 68 | ); | 68 | ); |
| 69 | 69 | ||
| 70 | TRACE_EVENT(mm_compaction_begin, | ||
| 71 | TP_PROTO(unsigned long zone_start, unsigned long migrate_start, | ||
| 72 | unsigned long free_start, unsigned long zone_end), | ||
| 73 | |||
| 74 | TP_ARGS(zone_start, migrate_start, free_start, zone_end), | ||
| 75 | |||
| 76 | TP_STRUCT__entry( | ||
| 77 | __field(unsigned long, zone_start) | ||
| 78 | __field(unsigned long, migrate_start) | ||
| 79 | __field(unsigned long, free_start) | ||
| 80 | __field(unsigned long, zone_end) | ||
| 81 | ), | ||
| 82 | |||
| 83 | TP_fast_assign( | ||
| 84 | __entry->zone_start = zone_start; | ||
| 85 | __entry->migrate_start = migrate_start; | ||
| 86 | __entry->free_start = free_start; | ||
| 87 | __entry->zone_end = zone_end; | ||
| 88 | ), | ||
| 89 | |||
| 90 | TP_printk("zone_start=%lu migrate_start=%lu free_start=%lu zone_end=%lu", | ||
| 91 | __entry->zone_start, | ||
| 92 | __entry->migrate_start, | ||
| 93 | __entry->free_start, | ||
| 94 | __entry->zone_end) | ||
| 95 | ); | ||
| 96 | |||
| 97 | TRACE_EVENT(mm_compaction_end, | ||
| 98 | TP_PROTO(int status), | ||
| 99 | |||
| 100 | TP_ARGS(status), | ||
| 101 | |||
| 102 | TP_STRUCT__entry( | ||
| 103 | __field(int, status) | ||
| 104 | ), | ||
| 105 | |||
| 106 | TP_fast_assign( | ||
| 107 | __entry->status = status; | ||
| 108 | ), | ||
| 109 | |||
| 110 | TP_printk("status=%d", __entry->status) | ||
| 111 | ); | ||
| 70 | 112 | ||
| 71 | #endif /* _TRACE_COMPACTION_H */ | 113 | #endif /* _TRACE_COMPACTION_H */ |
| 72 | 114 | ||
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index e0dc355fa317..3b9f28dfc849 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h | |||
| @@ -16,15 +16,28 @@ | |||
| 16 | { META, "META" }, \ | 16 | { META, "META" }, \ |
| 17 | { META_FLUSH, "META_FLUSH" }) | 17 | { META_FLUSH, "META_FLUSH" }) |
| 18 | 18 | ||
| 19 | #define show_bio_type(type) \ | 19 | #define F2FS_BIO_MASK(t) (t & (READA | WRITE_FLUSH_FUA)) |
| 20 | __print_symbolic(type, \ | 20 | #define F2FS_BIO_EXTRA_MASK(t) (t & (REQ_META | REQ_PRIO)) |
| 21 | { READ, "READ" }, \ | 21 | |
| 22 | { READA, "READAHEAD" }, \ | 22 | #define show_bio_type(type) show_bio_base(type), show_bio_extra(type) |
| 23 | { READ_SYNC, "READ_SYNC" }, \ | 23 | |
| 24 | { WRITE, "WRITE" }, \ | 24 | #define show_bio_base(type) \ |
| 25 | { WRITE_SYNC, "WRITE_SYNC" }, \ | 25 | __print_symbolic(F2FS_BIO_MASK(type), \ |
| 26 | { WRITE_FLUSH, "WRITE_FLUSH" }, \ | 26 | { READ, "READ" }, \ |
| 27 | { WRITE_FUA, "WRITE_FUA" }) | 27 | { READA, "READAHEAD" }, \ |
| 28 | { READ_SYNC, "READ_SYNC" }, \ | ||
| 29 | { WRITE, "WRITE" }, \ | ||
| 30 | { WRITE_SYNC, "WRITE_SYNC" }, \ | ||
| 31 | { WRITE_FLUSH, "WRITE_FLUSH" }, \ | ||
| 32 | { WRITE_FUA, "WRITE_FUA" }, \ | ||
| 33 | { WRITE_FLUSH_FUA, "WRITE_FLUSH_FUA" }) | ||
| 34 | |||
| 35 | #define show_bio_extra(type) \ | ||
| 36 | __print_symbolic(F2FS_BIO_EXTRA_MASK(type), \ | ||
| 37 | { REQ_META, "(M)" }, \ | ||
| 38 | { REQ_PRIO, "(P)" }, \ | ||
| 39 | { REQ_META | REQ_PRIO, "(MP)" }, \ | ||
| 40 | { 0, " \b" }) | ||
| 28 | 41 | ||
| 29 | #define show_data_type(type) \ | 42 | #define show_data_type(type) \ |
| 30 | __print_symbolic(type, \ | 43 | __print_symbolic(type, \ |
| @@ -421,7 +434,7 @@ TRACE_EVENT(f2fs_truncate_partial_nodes, | |||
| 421 | __entry->err) | 434 | __entry->err) |
| 422 | ); | 435 | ); |
| 423 | 436 | ||
| 424 | TRACE_EVENT_CONDITION(f2fs_readpage, | 437 | TRACE_EVENT_CONDITION(f2fs_submit_page_bio, |
| 425 | 438 | ||
| 426 | TP_PROTO(struct page *page, sector_t blkaddr, int type), | 439 | TP_PROTO(struct page *page, sector_t blkaddr, int type), |
| 427 | 440 | ||
| @@ -446,7 +459,7 @@ TRACE_EVENT_CONDITION(f2fs_readpage, | |||
| 446 | ), | 459 | ), |
| 447 | 460 | ||
| 448 | TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " | 461 | TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " |
| 449 | "blkaddr = 0x%llx, bio_type = %s", | 462 | "blkaddr = 0x%llx, bio_type = %s%s", |
| 450 | show_dev_ino(__entry), | 463 | show_dev_ino(__entry), |
| 451 | (unsigned long)__entry->index, | 464 | (unsigned long)__entry->index, |
| 452 | (unsigned long long)__entry->blkaddr, | 465 | (unsigned long long)__entry->blkaddr, |
| @@ -598,36 +611,54 @@ TRACE_EVENT(f2fs_reserve_new_block, | |||
| 598 | __entry->ofs_in_node) | 611 | __entry->ofs_in_node) |
| 599 | ); | 612 | ); |
| 600 | 613 | ||
| 601 | TRACE_EVENT(f2fs_do_submit_bio, | 614 | DECLARE_EVENT_CLASS(f2fs__submit_bio, |
| 602 | 615 | ||
| 603 | TP_PROTO(struct super_block *sb, int btype, bool sync, struct bio *bio), | 616 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), |
| 604 | 617 | ||
| 605 | TP_ARGS(sb, btype, sync, bio), | 618 | TP_ARGS(sb, rw, type, bio), |
| 606 | 619 | ||
| 607 | TP_STRUCT__entry( | 620 | TP_STRUCT__entry( |
| 608 | __field(dev_t, dev) | 621 | __field(dev_t, dev) |
| 609 | __field(int, btype) | 622 | __field(int, rw) |
| 610 | __field(bool, sync) | 623 | __field(int, type) |
| 611 | __field(sector_t, sector) | 624 | __field(sector_t, sector) |
| 612 | __field(unsigned int, size) | 625 | __field(unsigned int, size) |
| 613 | ), | 626 | ), |
| 614 | 627 | ||
| 615 | TP_fast_assign( | 628 | TP_fast_assign( |
| 616 | __entry->dev = sb->s_dev; | 629 | __entry->dev = sb->s_dev; |
| 617 | __entry->btype = btype; | 630 | __entry->rw = rw; |
| 618 | __entry->sync = sync; | 631 | __entry->type = type; |
| 619 | __entry->sector = bio->bi_sector; | 632 | __entry->sector = bio->bi_sector; |
| 620 | __entry->size = bio->bi_size; | 633 | __entry->size = bio->bi_size; |
| 621 | ), | 634 | ), |
| 622 | 635 | ||
| 623 | TP_printk("dev = (%d,%d), type = %s, io = %s, sector = %lld, size = %u", | 636 | TP_printk("dev = (%d,%d), %s%s, %s, sector = %lld, size = %u", |
| 624 | show_dev(__entry), | 637 | show_dev(__entry), |
| 625 | show_block_type(__entry->btype), | 638 | show_bio_type(__entry->rw), |
| 626 | __entry->sync ? "sync" : "no sync", | 639 | show_block_type(__entry->type), |
| 627 | (unsigned long long)__entry->sector, | 640 | (unsigned long long)__entry->sector, |
| 628 | __entry->size) | 641 | __entry->size) |
| 629 | ); | 642 | ); |
| 630 | 643 | ||
| 644 | DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_write_bio, | ||
| 645 | |||
| 646 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), | ||
| 647 | |||
| 648 | TP_ARGS(sb, rw, type, bio), | ||
| 649 | |||
| 650 | TP_CONDITION(bio) | ||
| 651 | ); | ||
| 652 | |||
| 653 | DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio, | ||
| 654 | |||
| 655 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), | ||
| 656 | |||
| 657 | TP_ARGS(sb, rw, type, bio), | ||
| 658 | |||
| 659 | TP_CONDITION(bio) | ||
| 660 | ); | ||
| 661 | |||
| 631 | DECLARE_EVENT_CLASS(f2fs__page, | 662 | DECLARE_EVENT_CLASS(f2fs__page, |
| 632 | 663 | ||
| 633 | TP_PROTO(struct page *page, int type), | 664 | TP_PROTO(struct page *page, int type), |
| @@ -674,15 +705,16 @@ DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite, | |||
| 674 | TP_ARGS(page, type) | 705 | TP_ARGS(page, type) |
| 675 | ); | 706 | ); |
| 676 | 707 | ||
| 677 | TRACE_EVENT(f2fs_submit_write_page, | 708 | TRACE_EVENT(f2fs_submit_page_mbio, |
| 678 | 709 | ||
| 679 | TP_PROTO(struct page *page, block_t blk_addr, int type), | 710 | TP_PROTO(struct page *page, int rw, int type, block_t blk_addr), |
| 680 | 711 | ||
| 681 | TP_ARGS(page, blk_addr, type), | 712 | TP_ARGS(page, rw, type, blk_addr), |
| 682 | 713 | ||
| 683 | TP_STRUCT__entry( | 714 | TP_STRUCT__entry( |
| 684 | __field(dev_t, dev) | 715 | __field(dev_t, dev) |
| 685 | __field(ino_t, ino) | 716 | __field(ino_t, ino) |
| 717 | __field(int, rw) | ||
| 686 | __field(int, type) | 718 | __field(int, type) |
| 687 | __field(pgoff_t, index) | 719 | __field(pgoff_t, index) |
| 688 | __field(block_t, block) | 720 | __field(block_t, block) |
| @@ -691,13 +723,15 @@ TRACE_EVENT(f2fs_submit_write_page, | |||
| 691 | TP_fast_assign( | 723 | TP_fast_assign( |
| 692 | __entry->dev = page->mapping->host->i_sb->s_dev; | 724 | __entry->dev = page->mapping->host->i_sb->s_dev; |
| 693 | __entry->ino = page->mapping->host->i_ino; | 725 | __entry->ino = page->mapping->host->i_ino; |
| 726 | __entry->rw = rw; | ||
| 694 | __entry->type = type; | 727 | __entry->type = type; |
| 695 | __entry->index = page->index; | 728 | __entry->index = page->index; |
| 696 | __entry->block = blk_addr; | 729 | __entry->block = blk_addr; |
| 697 | ), | 730 | ), |
| 698 | 731 | ||
| 699 | TP_printk("dev = (%d,%d), ino = %lu, %s, index = %lu, blkaddr = 0x%llx", | 732 | TP_printk("dev = (%d,%d), ino = %lu, %s%s, %s, index = %lu, blkaddr = 0x%llx", |
| 700 | show_dev_ino(__entry), | 733 | show_dev_ino(__entry), |
| 734 | show_bio_type(__entry->rw), | ||
| 701 | show_block_type(__entry->type), | 735 | show_block_type(__entry->type), |
| 702 | (unsigned long)__entry->index, | 736 | (unsigned long)__entry->index, |
| 703 | (unsigned long long)__entry->block) | 737 | (unsigned long long)__entry->block) |
| @@ -727,6 +761,29 @@ TRACE_EVENT(f2fs_write_checkpoint, | |||
| 727 | __entry->msg) | 761 | __entry->msg) |
| 728 | ); | 762 | ); |
| 729 | 763 | ||
| 764 | TRACE_EVENT(f2fs_issue_discard, | ||
| 765 | |||
| 766 | TP_PROTO(struct super_block *sb, block_t blkstart, block_t blklen), | ||
| 767 | |||
| 768 | TP_ARGS(sb, blkstart, blklen), | ||
| 769 | |||
| 770 | TP_STRUCT__entry( | ||
| 771 | __field(dev_t, dev) | ||
| 772 | __field(block_t, blkstart) | ||
| 773 | __field(block_t, blklen) | ||
| 774 | ), | ||
| 775 | |||
| 776 | TP_fast_assign( | ||
| 777 | __entry->dev = sb->s_dev; | ||
| 778 | __entry->blkstart = blkstart; | ||
| 779 | __entry->blklen = blklen; | ||
| 780 | ), | ||
| 781 | |||
| 782 | TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx", | ||
| 783 | show_dev(__entry), | ||
| 784 | (unsigned long long)__entry->blkstart, | ||
| 785 | (unsigned long long)__entry->blklen) | ||
| 786 | ); | ||
| 730 | #endif /* _TRACE_F2FS_H */ | 787 | #endif /* _TRACE_F2FS_H */ |
| 731 | 788 | ||
| 732 | /* This part must be outside protection */ | 789 | /* This part must be outside protection */ |
diff --git a/include/trace/events/migrate.h b/include/trace/events/migrate.h index ec2a6ccfd7e5..3075ffbb9a83 100644 --- a/include/trace/events/migrate.h +++ b/include/trace/events/migrate.h | |||
| @@ -45,6 +45,32 @@ TRACE_EVENT(mm_migrate_pages, | |||
| 45 | __print_symbolic(__entry->reason, MIGRATE_REASON)) | 45 | __print_symbolic(__entry->reason, MIGRATE_REASON)) |
| 46 | ); | 46 | ); |
| 47 | 47 | ||
| 48 | TRACE_EVENT(mm_numa_migrate_ratelimit, | ||
| 49 | |||
| 50 | TP_PROTO(struct task_struct *p, int dst_nid, unsigned long nr_pages), | ||
| 51 | |||
| 52 | TP_ARGS(p, dst_nid, nr_pages), | ||
| 53 | |||
| 54 | TP_STRUCT__entry( | ||
| 55 | __array( char, comm, TASK_COMM_LEN) | ||
| 56 | __field( pid_t, pid) | ||
| 57 | __field( int, dst_nid) | ||
| 58 | __field( unsigned long, nr_pages) | ||
| 59 | ), | ||
| 60 | |||
| 61 | TP_fast_assign( | ||
| 62 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | ||
| 63 | __entry->pid = p->pid; | ||
| 64 | __entry->dst_nid = dst_nid; | ||
| 65 | __entry->nr_pages = nr_pages; | ||
| 66 | ), | ||
| 67 | |||
| 68 | TP_printk("comm=%s pid=%d dst_nid=%d nr_pages=%lu", | ||
| 69 | __entry->comm, | ||
| 70 | __entry->pid, | ||
| 71 | __entry->dst_nid, | ||
| 72 | __entry->nr_pages) | ||
| 73 | ); | ||
| 48 | #endif /* _TRACE_MIGRATE_H */ | 74 | #endif /* _TRACE_MIGRATE_H */ |
| 49 | 75 | ||
| 50 | /* This part must be outside protection */ | 76 | /* This part must be outside protection */ |
diff --git a/include/trace/events/net.h b/include/trace/events/net.h index f99645d05a8f..a34f27b2e394 100644 --- a/include/trace/events/net.h +++ b/include/trace/events/net.h | |||
| @@ -6,9 +6,67 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/skbuff.h> | 7 | #include <linux/skbuff.h> |
| 8 | #include <linux/netdevice.h> | 8 | #include <linux/netdevice.h> |
| 9 | #include <linux/if_vlan.h> | ||
| 9 | #include <linux/ip.h> | 10 | #include <linux/ip.h> |
| 10 | #include <linux/tracepoint.h> | 11 | #include <linux/tracepoint.h> |
| 11 | 12 | ||
| 13 | TRACE_EVENT(net_dev_start_xmit, | ||
| 14 | |||
| 15 | TP_PROTO(const struct sk_buff *skb, const struct net_device *dev), | ||
| 16 | |||
| 17 | TP_ARGS(skb, dev), | ||
| 18 | |||
| 19 | TP_STRUCT__entry( | ||
| 20 | __string( name, dev->name ) | ||
| 21 | __field( u16, queue_mapping ) | ||
| 22 | __field( const void *, skbaddr ) | ||
| 23 | __field( bool, vlan_tagged ) | ||
| 24 | __field( u16, vlan_proto ) | ||
| 25 | __field( u16, vlan_tci ) | ||
| 26 | __field( u16, protocol ) | ||
| 27 | __field( u8, ip_summed ) | ||
| 28 | __field( unsigned int, len ) | ||
| 29 | __field( unsigned int, data_len ) | ||
| 30 | __field( int, network_offset ) | ||
| 31 | __field( bool, transport_offset_valid) | ||
| 32 | __field( int, transport_offset) | ||
| 33 | __field( u8, tx_flags ) | ||
| 34 | __field( u16, gso_size ) | ||
| 35 | __field( u16, gso_segs ) | ||
| 36 | __field( u16, gso_type ) | ||
| 37 | ), | ||
| 38 | |||
| 39 | TP_fast_assign( | ||
| 40 | __assign_str(name, dev->name); | ||
| 41 | __entry->queue_mapping = skb->queue_mapping; | ||
| 42 | __entry->skbaddr = skb; | ||
| 43 | __entry->vlan_tagged = vlan_tx_tag_present(skb); | ||
| 44 | __entry->vlan_proto = ntohs(skb->vlan_proto); | ||
| 45 | __entry->vlan_tci = vlan_tx_tag_get(skb); | ||
| 46 | __entry->protocol = ntohs(skb->protocol); | ||
| 47 | __entry->ip_summed = skb->ip_summed; | ||
| 48 | __entry->len = skb->len; | ||
| 49 | __entry->data_len = skb->data_len; | ||
| 50 | __entry->network_offset = skb_network_offset(skb); | ||
| 51 | __entry->transport_offset_valid = | ||
| 52 | skb_transport_header_was_set(skb); | ||
| 53 | __entry->transport_offset = skb_transport_offset(skb); | ||
| 54 | __entry->tx_flags = skb_shinfo(skb)->tx_flags; | ||
| 55 | __entry->gso_size = skb_shinfo(skb)->gso_size; | ||
| 56 | __entry->gso_segs = skb_shinfo(skb)->gso_segs; | ||
| 57 | __entry->gso_type = skb_shinfo(skb)->gso_type; | ||
| 58 | ), | ||
| 59 | |||
| 60 | TP_printk("dev=%s queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x vlan_tci=0x%04x protocol=0x%04x ip_summed=%d len=%u data_len=%u network_offset=%d transport_offset_valid=%d transport_offset=%d tx_flags=%d gso_size=%d gso_segs=%d gso_type=%#x", | ||
| 61 | __get_str(name), __entry->queue_mapping, __entry->skbaddr, | ||
| 62 | __entry->vlan_tagged, __entry->vlan_proto, __entry->vlan_tci, | ||
| 63 | __entry->protocol, __entry->ip_summed, __entry->len, | ||
| 64 | __entry->data_len, | ||
| 65 | __entry->network_offset, __entry->transport_offset_valid, | ||
| 66 | __entry->transport_offset, __entry->tx_flags, | ||
| 67 | __entry->gso_size, __entry->gso_segs, __entry->gso_type) | ||
| 68 | ); | ||
| 69 | |||
| 12 | TRACE_EVENT(net_dev_xmit, | 70 | TRACE_EVENT(net_dev_xmit, |
| 13 | 71 | ||
| 14 | TP_PROTO(struct sk_buff *skb, | 72 | TP_PROTO(struct sk_buff *skb, |
| @@ -78,6 +136,106 @@ DEFINE_EVENT(net_dev_template, netif_rx, | |||
| 78 | 136 | ||
| 79 | TP_ARGS(skb) | 137 | TP_ARGS(skb) |
| 80 | ); | 138 | ); |
| 139 | |||
| 140 | DECLARE_EVENT_CLASS(net_dev_rx_verbose_template, | ||
| 141 | |||
| 142 | TP_PROTO(const struct sk_buff *skb), | ||
| 143 | |||
| 144 | TP_ARGS(skb), | ||
| 145 | |||
| 146 | TP_STRUCT__entry( | ||
| 147 | __string( name, skb->dev->name ) | ||
| 148 | __field( unsigned int, napi_id ) | ||
| 149 | __field( u16, queue_mapping ) | ||
| 150 | __field( const void *, skbaddr ) | ||
| 151 | __field( bool, vlan_tagged ) | ||
| 152 | __field( u16, vlan_proto ) | ||
| 153 | __field( u16, vlan_tci ) | ||
| 154 | __field( u16, protocol ) | ||
| 155 | __field( u8, ip_summed ) | ||
| 156 | __field( u32, rxhash ) | ||
| 157 | __field( bool, l4_rxhash ) | ||
| 158 | __field( unsigned int, len ) | ||
| 159 | __field( unsigned int, data_len ) | ||
| 160 | __field( unsigned int, truesize ) | ||
| 161 | __field( bool, mac_header_valid) | ||
| 162 | __field( int, mac_header ) | ||
| 163 | __field( unsigned char, nr_frags ) | ||
| 164 | __field( u16, gso_size ) | ||
| 165 | __field( u16, gso_type ) | ||
| 166 | ), | ||
| 167 | |||
| 168 | TP_fast_assign( | ||
| 169 | __assign_str(name, skb->dev->name); | ||
| 170 | #ifdef CONFIG_NET_RX_BUSY_POLL | ||
| 171 | __entry->napi_id = skb->napi_id; | ||
| 172 | #else | ||
| 173 | __entry->napi_id = 0; | ||
| 174 | #endif | ||
| 175 | __entry->queue_mapping = skb->queue_mapping; | ||
| 176 | __entry->skbaddr = skb; | ||
| 177 | __entry->vlan_tagged = vlan_tx_tag_present(skb); | ||
| 178 | __entry->vlan_proto = ntohs(skb->vlan_proto); | ||
| 179 | __entry->vlan_tci = vlan_tx_tag_get(skb); | ||
| 180 | __entry->protocol = ntohs(skb->protocol); | ||
| 181 | __entry->ip_summed = skb->ip_summed; | ||
| 182 | __entry->rxhash = skb->rxhash; | ||
| 183 | __entry->l4_rxhash = skb->l4_rxhash; | ||
| 184 | __entry->len = skb->len; | ||
| 185 | __entry->data_len = skb->data_len; | ||
| 186 | __entry->truesize = skb->truesize; | ||
| 187 | __entry->mac_header_valid = skb_mac_header_was_set(skb); | ||
| 188 | __entry->mac_header = skb_mac_header(skb) - skb->data; | ||
| 189 | __entry->nr_frags = skb_shinfo(skb)->nr_frags; | ||
| 190 | __entry->gso_size = skb_shinfo(skb)->gso_size; | ||
| 191 | __entry->gso_type = skb_shinfo(skb)->gso_type; | ||
| 192 | ), | ||
| 193 | |||
| 194 | TP_printk("dev=%s napi_id=%#x queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x vlan_tci=0x%04x protocol=0x%04x ip_summed=%d rxhash=0x%08x l4_rxhash=%d len=%u data_len=%u truesize=%u mac_header_valid=%d mac_header=%d nr_frags=%d gso_size=%d gso_type=%#x", | ||
| 195 | __get_str(name), __entry->napi_id, __entry->queue_mapping, | ||
| 196 | __entry->skbaddr, __entry->vlan_tagged, __entry->vlan_proto, | ||
| 197 | __entry->vlan_tci, __entry->protocol, __entry->ip_summed, | ||
| 198 | __entry->rxhash, __entry->l4_rxhash, __entry->len, | ||
| 199 | __entry->data_len, __entry->truesize, | ||
| 200 | __entry->mac_header_valid, __entry->mac_header, | ||
| 201 | __entry->nr_frags, __entry->gso_size, __entry->gso_type) | ||
| 202 | ); | ||
| 203 | |||
| 204 | DEFINE_EVENT(net_dev_rx_verbose_template, napi_gro_frags_entry, | ||
| 205 | |||
| 206 | TP_PROTO(const struct sk_buff *skb), | ||
| 207 | |||
| 208 | TP_ARGS(skb) | ||
| 209 | ); | ||
| 210 | |||
| 211 | DEFINE_EVENT(net_dev_rx_verbose_template, napi_gro_receive_entry, | ||
| 212 | |||
| 213 | TP_PROTO(const struct sk_buff *skb), | ||
| 214 | |||
| 215 | TP_ARGS(skb) | ||
| 216 | ); | ||
| 217 | |||
| 218 | DEFINE_EVENT(net_dev_rx_verbose_template, netif_receive_skb_entry, | ||
| 219 | |||
| 220 | TP_PROTO(const struct sk_buff *skb), | ||
| 221 | |||
| 222 | TP_ARGS(skb) | ||
| 223 | ); | ||
| 224 | |||
| 225 | DEFINE_EVENT(net_dev_rx_verbose_template, netif_rx_entry, | ||
| 226 | |||
| 227 | TP_PROTO(const struct sk_buff *skb), | ||
| 228 | |||
| 229 | TP_ARGS(skb) | ||
| 230 | ); | ||
| 231 | |||
| 232 | DEFINE_EVENT(net_dev_rx_verbose_template, netif_rx_ni_entry, | ||
| 233 | |||
| 234 | TP_PROTO(const struct sk_buff *skb), | ||
| 235 | |||
| 236 | TP_ARGS(skb) | ||
| 237 | ); | ||
| 238 | |||
| 81 | #endif /* _TRACE_NET_H */ | 239 | #endif /* _TRACE_NET_H */ |
| 82 | 240 | ||
| 83 | /* This part must be outside protection */ | 241 | /* This part must be outside protection */ |
diff --git a/include/trace/events/power.h b/include/trace/events/power.h index cda100d6762d..9e9475c85de5 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h | |||
| @@ -35,6 +35,59 @@ DEFINE_EVENT(cpu, cpu_idle, | |||
| 35 | TP_ARGS(state, cpu_id) | 35 | TP_ARGS(state, cpu_id) |
| 36 | ); | 36 | ); |
| 37 | 37 | ||
| 38 | TRACE_EVENT(pstate_sample, | ||
| 39 | |||
| 40 | TP_PROTO(u32 core_busy, | ||
| 41 | u32 scaled_busy, | ||
| 42 | u32 state, | ||
| 43 | u64 mperf, | ||
| 44 | u64 aperf, | ||
| 45 | u32 energy, | ||
| 46 | u32 freq | ||
| 47 | ), | ||
| 48 | |||
| 49 | TP_ARGS(core_busy, | ||
| 50 | scaled_busy, | ||
| 51 | state, | ||
| 52 | mperf, | ||
| 53 | aperf, | ||
| 54 | energy, | ||
| 55 | freq | ||
| 56 | ), | ||
| 57 | |||
| 58 | TP_STRUCT__entry( | ||
| 59 | __field(u32, core_busy) | ||
| 60 | __field(u32, scaled_busy) | ||
| 61 | __field(u32, state) | ||
| 62 | __field(u64, mperf) | ||
| 63 | __field(u64, aperf) | ||
| 64 | __field(u32, energy) | ||
| 65 | __field(u32, freq) | ||
| 66 | |||
| 67 | ), | ||
| 68 | |||
| 69 | TP_fast_assign( | ||
| 70 | __entry->core_busy = core_busy; | ||
| 71 | __entry->scaled_busy = scaled_busy; | ||
| 72 | __entry->state = state; | ||
| 73 | __entry->mperf = mperf; | ||
| 74 | __entry->aperf = aperf; | ||
| 75 | __entry->energy = energy; | ||
| 76 | __entry->freq = freq; | ||
| 77 | ), | ||
| 78 | |||
| 79 | TP_printk("core_busy=%lu scaled=%lu state=%lu mperf=%llu aperf=%llu energy=%lu freq=%lu ", | ||
| 80 | (unsigned long)__entry->core_busy, | ||
| 81 | (unsigned long)__entry->scaled_busy, | ||
| 82 | (unsigned long)__entry->state, | ||
| 83 | (unsigned long long)__entry->mperf, | ||
| 84 | (unsigned long long)__entry->aperf, | ||
| 85 | (unsigned long)__entry->energy, | ||
| 86 | (unsigned long)__entry->freq | ||
| 87 | ) | ||
| 88 | |||
| 89 | ); | ||
| 90 | |||
| 38 | /* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */ | 91 | /* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */ |
| 39 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING | 92 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING |
| 40 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING | 93 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING |
diff --git a/include/trace/events/ras.h b/include/trace/events/ras.h index 88b878383797..1c875ad1ee5f 100644 --- a/include/trace/events/ras.h +++ b/include/trace/events/ras.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #define _TRACE_AER_H | 5 | #define _TRACE_AER_H |
| 6 | 6 | ||
| 7 | #include <linux/tracepoint.h> | 7 | #include <linux/tracepoint.h> |
| 8 | #include <linux/edac.h> | 8 | #include <linux/aer.h> |
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | /* | 11 | /* |
| @@ -63,10 +63,10 @@ TRACE_EVENT(aer_event, | |||
| 63 | 63 | ||
| 64 | TP_printk("%s PCIe Bus Error: severity=%s, %s\n", | 64 | TP_printk("%s PCIe Bus Error: severity=%s, %s\n", |
| 65 | __get_str(dev_name), | 65 | __get_str(dev_name), |
| 66 | __entry->severity == HW_EVENT_ERR_CORRECTED ? "Corrected" : | 66 | __entry->severity == AER_CORRECTABLE ? "Corrected" : |
| 67 | __entry->severity == HW_EVENT_ERR_FATAL ? | 67 | __entry->severity == AER_FATAL ? |
| 68 | "Fatal" : "Uncorrected", | 68 | "Fatal" : "Uncorrected, non-fatal", |
| 69 | __entry->severity == HW_EVENT_ERR_CORRECTED ? | 69 | __entry->severity == AER_CORRECTABLE ? |
| 70 | __print_flags(__entry->status, "|", aer_correctable_errors) : | 70 | __print_flags(__entry->status, "|", aer_correctable_errors) : |
| 71 | __print_flags(__entry->status, "|", aer_uncorrectable_errors)) | 71 | __print_flags(__entry->status, "|", aer_uncorrectable_errors)) |
| 72 | ); | 72 | ); |
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 04c308413a5d..67e1bbf83695 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
| @@ -443,6 +443,93 @@ TRACE_EVENT(sched_process_hang, | |||
| 443 | ); | 443 | ); |
| 444 | #endif /* CONFIG_DETECT_HUNG_TASK */ | 444 | #endif /* CONFIG_DETECT_HUNG_TASK */ |
| 445 | 445 | ||
| 446 | DECLARE_EVENT_CLASS(sched_move_task_template, | ||
| 447 | |||
| 448 | TP_PROTO(struct task_struct *tsk, int src_cpu, int dst_cpu), | ||
| 449 | |||
| 450 | TP_ARGS(tsk, src_cpu, dst_cpu), | ||
| 451 | |||
| 452 | TP_STRUCT__entry( | ||
| 453 | __field( pid_t, pid ) | ||
| 454 | __field( pid_t, tgid ) | ||
| 455 | __field( pid_t, ngid ) | ||
| 456 | __field( int, src_cpu ) | ||
| 457 | __field( int, src_nid ) | ||
| 458 | __field( int, dst_cpu ) | ||
| 459 | __field( int, dst_nid ) | ||
| 460 | ), | ||
| 461 | |||
| 462 | TP_fast_assign( | ||
| 463 | __entry->pid = task_pid_nr(tsk); | ||
| 464 | __entry->tgid = task_tgid_nr(tsk); | ||
| 465 | __entry->ngid = task_numa_group_id(tsk); | ||
| 466 | __entry->src_cpu = src_cpu; | ||
| 467 | __entry->src_nid = cpu_to_node(src_cpu); | ||
| 468 | __entry->dst_cpu = dst_cpu; | ||
| 469 | __entry->dst_nid = cpu_to_node(dst_cpu); | ||
| 470 | ), | ||
| 471 | |||
| 472 | TP_printk("pid=%d tgid=%d ngid=%d src_cpu=%d src_nid=%d dst_cpu=%d dst_nid=%d", | ||
| 473 | __entry->pid, __entry->tgid, __entry->ngid, | ||
| 474 | __entry->src_cpu, __entry->src_nid, | ||
| 475 | __entry->dst_cpu, __entry->dst_nid) | ||
| 476 | ); | ||
| 477 | |||
| 478 | /* | ||
| 479 | * Tracks migration of tasks from one runqueue to another. Can be used to | ||
| 480 | * detect if automatic NUMA balancing is bouncing between nodes | ||
| 481 | */ | ||
| 482 | DEFINE_EVENT(sched_move_task_template, sched_move_numa, | ||
| 483 | TP_PROTO(struct task_struct *tsk, int src_cpu, int dst_cpu), | ||
| 484 | |||
| 485 | TP_ARGS(tsk, src_cpu, dst_cpu) | ||
| 486 | ); | ||
| 487 | |||
| 488 | DEFINE_EVENT(sched_move_task_template, sched_stick_numa, | ||
| 489 | TP_PROTO(struct task_struct *tsk, int src_cpu, int dst_cpu), | ||
| 490 | |||
| 491 | TP_ARGS(tsk, src_cpu, dst_cpu) | ||
| 492 | ); | ||
| 493 | |||
| 494 | TRACE_EVENT(sched_swap_numa, | ||
| 495 | |||
| 496 | TP_PROTO(struct task_struct *src_tsk, int src_cpu, | ||
| 497 | struct task_struct *dst_tsk, int dst_cpu), | ||
| 498 | |||
| 499 | TP_ARGS(src_tsk, src_cpu, dst_tsk, dst_cpu), | ||
| 500 | |||
| 501 | TP_STRUCT__entry( | ||
| 502 | __field( pid_t, src_pid ) | ||
| 503 | __field( pid_t, src_tgid ) | ||
| 504 | __field( pid_t, src_ngid ) | ||
| 505 | __field( int, src_cpu ) | ||
| 506 | __field( int, src_nid ) | ||
| 507 | __field( pid_t, dst_pid ) | ||
| 508 | __field( pid_t, dst_tgid ) | ||
| 509 | __field( pid_t, dst_ngid ) | ||
| 510 | __field( int, dst_cpu ) | ||
| 511 | __field( int, dst_nid ) | ||
| 512 | ), | ||
| 513 | |||
| 514 | TP_fast_assign( | ||
| 515 | __entry->src_pid = task_pid_nr(src_tsk); | ||
| 516 | __entry->src_tgid = task_tgid_nr(src_tsk); | ||
| 517 | __entry->src_ngid = task_numa_group_id(src_tsk); | ||
| 518 | __entry->src_cpu = src_cpu; | ||
| 519 | __entry->src_nid = cpu_to_node(src_cpu); | ||
| 520 | __entry->dst_pid = task_pid_nr(dst_tsk); | ||
| 521 | __entry->dst_tgid = task_tgid_nr(dst_tsk); | ||
| 522 | __entry->dst_ngid = task_numa_group_id(dst_tsk); | ||
| 523 | __entry->dst_cpu = dst_cpu; | ||
| 524 | __entry->dst_nid = cpu_to_node(dst_cpu); | ||
| 525 | ), | ||
| 526 | |||
| 527 | TP_printk("src_pid=%d src_tgid=%d src_ngid=%d src_cpu=%d src_nid=%d dst_pid=%d dst_tgid=%d dst_ngid=%d dst_cpu=%d dst_nid=%d", | ||
| 528 | __entry->src_pid, __entry->src_tgid, __entry->src_ngid, | ||
| 529 | __entry->src_cpu, __entry->src_nid, | ||
| 530 | __entry->dst_pid, __entry->dst_tgid, __entry->dst_ngid, | ||
| 531 | __entry->dst_cpu, __entry->dst_nid) | ||
| 532 | ); | ||
| 446 | #endif /* _TRACE_SCHED_H */ | 533 | #endif /* _TRACE_SCHED_H */ |
| 447 | 534 | ||
| 448 | /* This part must be outside protection */ | 535 | /* This part must be outside protection */ |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 52594b20179e..1a8b28db3775 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
| @@ -90,6 +90,10 @@ | |||
| 90 | #define TRACE_EVENT_FLAGS(name, value) \ | 90 | #define TRACE_EVENT_FLAGS(name, value) \ |
| 91 | __TRACE_EVENT_FLAGS(name, value) | 91 | __TRACE_EVENT_FLAGS(name, value) |
| 92 | 92 | ||
| 93 | #undef TRACE_EVENT_PERF_PERM | ||
| 94 | #define TRACE_EVENT_PERF_PERM(name, expr...) \ | ||
| 95 | __TRACE_EVENT_PERF_PERM(name, expr) | ||
| 96 | |||
| 93 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 97 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 94 | 98 | ||
| 95 | 99 | ||
| @@ -140,6 +144,9 @@ | |||
| 140 | #undef TRACE_EVENT_FLAGS | 144 | #undef TRACE_EVENT_FLAGS |
| 141 | #define TRACE_EVENT_FLAGS(event, flag) | 145 | #define TRACE_EVENT_FLAGS(event, flag) |
| 142 | 146 | ||
| 147 | #undef TRACE_EVENT_PERF_PERM | ||
| 148 | #define TRACE_EVENT_PERF_PERM(event, expr...) | ||
| 149 | |||
| 143 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 150 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 144 | 151 | ||
| 145 | /* | 152 | /* |
| @@ -372,7 +379,8 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | |||
| 372 | __data_size += (len) * sizeof(type); | 379 | __data_size += (len) * sizeof(type); |
| 373 | 380 | ||
| 374 | #undef __string | 381 | #undef __string |
| 375 | #define __string(item, src) __dynamic_array(char, item, strlen(src) + 1) | 382 | #define __string(item, src) __dynamic_array(char, item, \ |
| 383 | strlen((src) ? (const char *)(src) : "(null)") + 1) | ||
| 376 | 384 | ||
| 377 | #undef DECLARE_EVENT_CLASS | 385 | #undef DECLARE_EVENT_CLASS |
| 378 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 386 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| @@ -410,6 +418,8 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
| 410 | * struct ftrace_event_file *ftrace_file = __data; | 418 | * struct ftrace_event_file *ftrace_file = __data; |
| 411 | * struct ftrace_event_call *event_call = ftrace_file->event_call; | 419 | * struct ftrace_event_call *event_call = ftrace_file->event_call; |
| 412 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; | 420 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; |
| 421 | * unsigned long eflags = ftrace_file->flags; | ||
| 422 | * enum event_trigger_type __tt = ETT_NONE; | ||
| 413 | * struct ring_buffer_event *event; | 423 | * struct ring_buffer_event *event; |
| 414 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 | 424 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 |
| 415 | * struct ring_buffer *buffer; | 425 | * struct ring_buffer *buffer; |
| @@ -417,9 +427,12 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
| 417 | * int __data_size; | 427 | * int __data_size; |
| 418 | * int pc; | 428 | * int pc; |
| 419 | * | 429 | * |
| 420 | * if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT, | 430 | * if (!(eflags & FTRACE_EVENT_FL_TRIGGER_COND)) { |
| 421 | * &ftrace_file->flags)) | 431 | * if (eflags & FTRACE_EVENT_FL_TRIGGER_MODE) |
| 422 | * return; | 432 | * event_triggers_call(ftrace_file, NULL); |
| 433 | * if (eflags & FTRACE_EVENT_FL_SOFT_DISABLED) | ||
| 434 | * return; | ||
| 435 | * } | ||
| 423 | * | 436 | * |
| 424 | * local_save_flags(irq_flags); | 437 | * local_save_flags(irq_flags); |
| 425 | * pc = preempt_count(); | 438 | * pc = preempt_count(); |
| @@ -437,8 +450,17 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
| 437 | * { <assign>; } <-- Here we assign the entries by the __field and | 450 | * { <assign>; } <-- Here we assign the entries by the __field and |
| 438 | * __array macros. | 451 | * __array macros. |
| 439 | * | 452 | * |
| 440 | * if (!filter_check_discard(ftrace_file, entry, buffer, event)) | 453 | * if (eflags & FTRACE_EVENT_FL_TRIGGER_COND) |
| 454 | * __tt = event_triggers_call(ftrace_file, entry); | ||
| 455 | * | ||
| 456 | * if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT, | ||
| 457 | * &ftrace_file->flags)) | ||
| 458 | * ring_buffer_discard_commit(buffer, event); | ||
| 459 | * else if (!filter_check_discard(ftrace_file, entry, buffer, event)) | ||
| 441 | * trace_buffer_unlock_commit(buffer, event, irq_flags, pc); | 460 | * trace_buffer_unlock_commit(buffer, event, irq_flags, pc); |
| 461 | * | ||
| 462 | * if (__tt) | ||
| 463 | * event_triggers_post_call(ftrace_file, __tt); | ||
| 442 | * } | 464 | * } |
| 443 | * | 465 | * |
| 444 | * static struct trace_event ftrace_event_type_<call> = { | 466 | * static struct trace_event ftrace_event_type_<call> = { |
| @@ -501,7 +523,7 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
| 501 | 523 | ||
| 502 | #undef __assign_str | 524 | #undef __assign_str |
| 503 | #define __assign_str(dst, src) \ | 525 | #define __assign_str(dst, src) \ |
| 504 | strcpy(__get_str(dst), src); | 526 | strcpy(__get_str(dst), (src) ? (const char *)(src) : "(null)"); |
| 505 | 527 | ||
| 506 | #undef TP_fast_assign | 528 | #undef TP_fast_assign |
| 507 | #define TP_fast_assign(args...) args | 529 | #define TP_fast_assign(args...) args |
| @@ -531,8 +553,7 @@ ftrace_raw_event_##call(void *__data, proto) \ | |||
| 531 | int __data_size; \ | 553 | int __data_size; \ |
| 532 | int pc; \ | 554 | int pc; \ |
| 533 | \ | 555 | \ |
| 534 | if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT, \ | 556 | if (ftrace_trigger_soft_disabled(ftrace_file)) \ |
| 535 | &ftrace_file->flags)) \ | ||
| 536 | return; \ | 557 | return; \ |
| 537 | \ | 558 | \ |
| 538 | local_save_flags(irq_flags); \ | 559 | local_save_flags(irq_flags); \ |
| @@ -552,8 +573,8 @@ ftrace_raw_event_##call(void *__data, proto) \ | |||
| 552 | \ | 573 | \ |
| 553 | { assign; } \ | 574 | { assign; } \ |
| 554 | \ | 575 | \ |
| 555 | if (!filter_check_discard(ftrace_file, entry, buffer, event)) \ | 576 | event_trigger_unlock_commit(ftrace_file, buffer, event, entry, \ |
| 556 | trace_buffer_unlock_commit(buffer, event, irq_flags, pc); \ | 577 | irq_flags, pc); \ |
| 557 | } | 578 | } |
| 558 | /* | 579 | /* |
| 559 | * The ftrace_test_probe is compiled out, it is only here as a build time check | 580 | * The ftrace_test_probe is compiled out, it is only here as a build time check |
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h index 38f14d0264c3..ea0796bdcf88 100644 --- a/include/uapi/asm-generic/socket.h +++ b/include/uapi/asm-generic/socket.h | |||
| @@ -80,4 +80,6 @@ | |||
| 80 | 80 | ||
| 81 | #define SO_MAX_PACING_RATE 47 | 81 | #define SO_MAX_PACING_RATE 47 |
| 82 | 82 | ||
| 83 | #define SO_BPF_EXTENSIONS 48 | ||
| 84 | |||
| 83 | #endif /* __ASM_GENERIC_SOCKET_H */ | 85 | #endif /* __ASM_GENERIC_SOCKET_H */ |
diff --git a/include/uapi/asm-generic/statfs.h b/include/uapi/asm-generic/statfs.h index 0999647fca13..cb89cc730f0b 100644 --- a/include/uapi/asm-generic/statfs.h +++ b/include/uapi/asm-generic/statfs.h | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | */ | 13 | */ |
| 14 | #ifndef __statfs_word | 14 | #ifndef __statfs_word |
| 15 | #if __BITS_PER_LONG == 64 | 15 | #if __BITS_PER_LONG == 64 |
| 16 | #define __statfs_word long | 16 | #define __statfs_word __kernel_long_t |
| 17 | #else | 17 | #else |
| 18 | #define __statfs_word __u32 | 18 | #define __statfs_word __u32 |
| 19 | #endif | 19 | #endif |
diff --git a/include/uapi/asm-generic/types.h b/include/uapi/asm-generic/types.h index bd39806013b5..a3877926b0d4 100644 --- a/include/uapi/asm-generic/types.h +++ b/include/uapi/asm-generic/types.h | |||
| @@ -1,8 +1,7 @@ | |||
| 1 | #ifndef _ASM_GENERIC_TYPES_H | 1 | #ifndef _ASM_GENERIC_TYPES_H |
| 2 | #define _ASM_GENERIC_TYPES_H | 2 | #define _ASM_GENERIC_TYPES_H |
| 3 | /* | 3 | /* |
| 4 | * int-ll64 is used practically everywhere now, | 4 | * int-ll64 is used everywhere now. |
| 5 | * so use it as a reasonable default. | ||
| 6 | */ | 5 | */ |
| 7 | #include <asm-generic/int-ll64.h> | 6 | #include <asm-generic/int-ll64.h> |
| 8 | 7 | ||
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h index 2f3f7ea8c77b..fe421e8a431b 100644 --- a/include/uapi/drm/radeon_drm.h +++ b/include/uapi/drm/radeon_drm.h | |||
| @@ -983,6 +983,8 @@ struct drm_radeon_cs { | |||
| 983 | #define RADEON_INFO_SI_CP_DMA_COMPUTE 0x17 | 983 | #define RADEON_INFO_SI_CP_DMA_COMPUTE 0x17 |
| 984 | /* CIK macrotile mode array */ | 984 | /* CIK macrotile mode array */ |
| 985 | #define RADEON_INFO_CIK_MACROTILE_MODE_ARRAY 0x18 | 985 | #define RADEON_INFO_CIK_MACROTILE_MODE_ARRAY 0x18 |
| 986 | /* query the number of render backends */ | ||
| 987 | #define RADEON_INFO_SI_BACKEND_ENABLED_MASK 0x19 | ||
| 986 | 988 | ||
| 987 | 989 | ||
| 988 | struct drm_radeon_info { | 990 | struct drm_radeon_info { |
diff --git a/include/uapi/drm/vmwgfx_drm.h b/include/uapi/drm/vmwgfx_drm.h index bcb0912afe7a..f854ca4a1372 100644 --- a/include/uapi/drm/vmwgfx_drm.h +++ b/include/uapi/drm/vmwgfx_drm.h | |||
| @@ -75,6 +75,7 @@ | |||
| 75 | #define DRM_VMW_PARAM_FIFO_CAPS 4 | 75 | #define DRM_VMW_PARAM_FIFO_CAPS 4 |
| 76 | #define DRM_VMW_PARAM_MAX_FB_SIZE 5 | 76 | #define DRM_VMW_PARAM_MAX_FB_SIZE 5 |
| 77 | #define DRM_VMW_PARAM_FIFO_HW_VERSION 6 | 77 | #define DRM_VMW_PARAM_FIFO_HW_VERSION 6 |
| 78 | #define DRM_VMW_PARAM_MAX_SURF_MEMORY 7 | ||
| 78 | 79 | ||
| 79 | /** | 80 | /** |
| 80 | * struct drm_vmw_getparam_arg | 81 | * struct drm_vmw_getparam_arg |
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index 33d2b8fe166d..3ce25b5d75a9 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild | |||
| @@ -426,3 +426,5 @@ header-y += x25.h | |||
| 426 | header-y += xattr.h | 426 | header-y += xattr.h |
| 427 | header-y += xfrm.h | 427 | header-y += xfrm.h |
| 428 | header-y += hw_breakpoint.h | 428 | header-y += hw_breakpoint.h |
| 429 | header-y += zorro.h | ||
| 430 | header-y += zorro_ids.h | ||
diff --git a/include/uapi/linux/apm_bios.h b/include/uapi/linux/apm_bios.h index 724f409adae0..df79bca1b898 100644 --- a/include/uapi/linux/apm_bios.h +++ b/include/uapi/linux/apm_bios.h | |||
| @@ -67,6 +67,8 @@ struct apm_bios_info { | |||
| 67 | #define APM_USER_SUSPEND 0x000a | 67 | #define APM_USER_SUSPEND 0x000a |
| 68 | #define APM_STANDBY_RESUME 0x000b | 68 | #define APM_STANDBY_RESUME 0x000b |
| 69 | #define APM_CAPABILITY_CHANGE 0x000c | 69 | #define APM_CAPABILITY_CHANGE 0x000c |
| 70 | #define APM_USER_HIBERNATION 0x000d | ||
| 71 | #define APM_HIBERNATION_RESUME 0x000e | ||
| 70 | 72 | ||
| 71 | /* | 73 | /* |
| 72 | * Error codes | 74 | * Error codes |
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h index 44b05a09f193..2d48fe1274ca 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h | |||
| @@ -319,6 +319,12 @@ enum { | |||
| 319 | #define AUDIT_STATUS_PID 0x0004 | 319 | #define AUDIT_STATUS_PID 0x0004 |
| 320 | #define AUDIT_STATUS_RATE_LIMIT 0x0008 | 320 | #define AUDIT_STATUS_RATE_LIMIT 0x0008 |
| 321 | #define AUDIT_STATUS_BACKLOG_LIMIT 0x0010 | 321 | #define AUDIT_STATUS_BACKLOG_LIMIT 0x0010 |
| 322 | #define AUDIT_STATUS_BACKLOG_WAIT_TIME 0x0020 | ||
| 323 | |||
| 324 | #define AUDIT_VERSION_BACKLOG_LIMIT 1 | ||
| 325 | #define AUDIT_VERSION_BACKLOG_WAIT_TIME 2 | ||
| 326 | #define AUDIT_VERSION_LATEST AUDIT_VERSION_BACKLOG_WAIT_TIME | ||
| 327 | |||
| 322 | /* Failure-to-log actions */ | 328 | /* Failure-to-log actions */ |
| 323 | #define AUDIT_FAIL_SILENT 0 | 329 | #define AUDIT_FAIL_SILENT 0 |
| 324 | #define AUDIT_FAIL_PRINTK 1 | 330 | #define AUDIT_FAIL_PRINTK 1 |
| @@ -375,6 +381,8 @@ struct audit_status { | |||
| 375 | __u32 backlog_limit; /* waiting messages limit */ | 381 | __u32 backlog_limit; /* waiting messages limit */ |
| 376 | __u32 lost; /* messages lost */ | 382 | __u32 lost; /* messages lost */ |
| 377 | __u32 backlog; /* messages waiting in queue */ | 383 | __u32 backlog; /* messages waiting in queue */ |
| 384 | __u32 version; /* audit api version number */ | ||
| 385 | __u32 backlog_wait_time;/* message queue wait timeout */ | ||
| 378 | }; | 386 | }; |
| 379 | 387 | ||
| 380 | struct audit_features { | 388 | struct audit_features { |
diff --git a/include/uapi/linux/dm-log-userspace.h b/include/uapi/linux/dm-log-userspace.h index 0678c2adc421..0fa0d9ef06a5 100644 --- a/include/uapi/linux/dm-log-userspace.h +++ b/include/uapi/linux/dm-log-userspace.h | |||
| @@ -201,11 +201,18 @@ | |||
| 201 | * int (*flush)(struct dm_dirty_log *log); | 201 | * int (*flush)(struct dm_dirty_log *log); |
| 202 | * | 202 | * |
| 203 | * Payload-to-userspace: | 203 | * Payload-to-userspace: |
| 204 | * None. | 204 | * If the 'integrated_flush' directive is present in the constructor |
| 205 | * table, the payload is as same as DM_ULOG_MARK_REGION: | ||
| 206 | * uint64_t [] - region(s) to mark | ||
| 207 | * else | ||
| 208 | * None | ||
| 205 | * Payload-to-kernel: | 209 | * Payload-to-kernel: |
| 206 | * None. | 210 | * None. |
| 207 | * | 211 | * |
| 208 | * No incoming or outgoing payload. Simply flush log state to disk. | 212 | * If the 'integrated_flush' option was used during the creation of the |
| 213 | * log, mark region requests are carried as payload in the flush request. | ||
| 214 | * Piggybacking the mark requests in this way allows for fewer communications | ||
| 215 | * between kernel and userspace. | ||
| 209 | * | 216 | * |
| 210 | * When the request has been processed, user-space must return the | 217 | * When the request has been processed, user-space must return the |
| 211 | * dm_ulog_request to the kernel - setting the 'error' field and clearing | 218 | * dm_ulog_request to the kernel - setting the 'error' field and clearing |
| @@ -385,8 +392,15 @@ | |||
| 385 | * version 2: DM_ULOG_CTR allowed to return a string containing a | 392 | * version 2: DM_ULOG_CTR allowed to return a string containing a |
| 386 | * device name that is to be registered with DM via | 393 | * device name that is to be registered with DM via |
| 387 | * 'dm_get_device'. | 394 | * 'dm_get_device'. |
| 395 | * version 3: DM_ULOG_FLUSH is capable of carrying payload for marking | ||
| 396 | * regions. This "integrated flush" reduces the number of | ||
| 397 | * requests between the kernel and userspace by effectively | ||
| 398 | * merging 'mark' and 'flush' requests. A constructor table | ||
| 399 | * argument ('integrated_flush') is required to turn this | ||
| 400 | * feature on, so it is backwards compatible with older | ||
| 401 | * userspace versions. | ||
| 388 | */ | 402 | */ |
| 389 | #define DM_ULOG_REQUEST_VERSION 2 | 403 | #define DM_ULOG_REQUEST_VERSION 3 |
| 390 | 404 | ||
| 391 | struct dm_ulog_request { | 405 | struct dm_ulog_request { |
| 392 | /* | 406 | /* |
diff --git a/include/uapi/linux/dn.h b/include/uapi/linux/dn.h index 5fbdd3d49eba..4295c745f342 100644 --- a/include/uapi/linux/dn.h +++ b/include/uapi/linux/dn.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _LINUX_DN_H | 1 | #ifndef _LINUX_DN_H |
| 2 | #define _LINUX_DN_H | 2 | #define _LINUX_DN_H |
| 3 | 3 | ||
| 4 | #include <linux/ioctl.h> | ||
| 4 | #include <linux/types.h> | 5 | #include <linux/types.h> |
| 5 | #include <linux/if_ether.h> | 6 | #include <linux/if_ether.h> |
| 6 | 7 | ||
diff --git a/include/uapi/linux/eventpoll.h b/include/uapi/linux/eventpoll.h index 2c267bcbb85c..bc81fb2e1f0e 100644 --- a/include/uapi/linux/eventpoll.h +++ b/include/uapi/linux/eventpoll.h | |||
| @@ -61,5 +61,16 @@ struct epoll_event { | |||
| 61 | __u64 data; | 61 | __u64 data; |
| 62 | } EPOLL_PACKED; | 62 | } EPOLL_PACKED; |
| 63 | 63 | ||
| 64 | 64 | #ifdef CONFIG_PM_SLEEP | |
| 65 | static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) | ||
| 66 | { | ||
| 67 | if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND)) | ||
| 68 | epev->events &= ~EPOLLWAKEUP; | ||
| 69 | } | ||
| 70 | #else | ||
| 71 | static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) | ||
| 72 | { | ||
| 73 | epev->events &= ~EPOLLWAKEUP; | ||
| 74 | } | ||
| 75 | #endif | ||
| 65 | #endif /* _UAPI_LINUX_EVENTPOLL_H */ | 76 | #endif /* _UAPI_LINUX_EVENTPOLL_H */ |
diff --git a/include/uapi/linux/genetlink.h b/include/uapi/linux/genetlink.h index 1af72d8228e0..c3363ba1ae05 100644 --- a/include/uapi/linux/genetlink.h +++ b/include/uapi/linux/genetlink.h | |||
| @@ -28,6 +28,7 @@ struct genlmsghdr { | |||
| 28 | #define GENL_ID_GENERATE 0 | 28 | #define GENL_ID_GENERATE 0 |
| 29 | #define GENL_ID_CTRL NLMSG_MIN_TYPE | 29 | #define GENL_ID_CTRL NLMSG_MIN_TYPE |
| 30 | #define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1) | 30 | #define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1) |
| 31 | #define GENL_ID_PMCRAID (NLMSG_MIN_TYPE + 2) | ||
| 31 | 32 | ||
| 32 | /************************************************************************** | 33 | /************************************************************************** |
| 33 | * Controller | 34 | * Controller |
diff --git a/include/uapi/linux/genwqe/genwqe_card.h b/include/uapi/linux/genwqe/genwqe_card.h new file mode 100644 index 000000000000..795e957bb840 --- /dev/null +++ b/include/uapi/linux/genwqe/genwqe_card.h | |||
| @@ -0,0 +1,500 @@ | |||
| 1 | #ifndef __GENWQE_CARD_H__ | ||
| 2 | #define __GENWQE_CARD_H__ | ||
| 3 | |||
| 4 | /** | ||
| 5 | * IBM Accelerator Family 'GenWQE' | ||
| 6 | * | ||
| 7 | * (C) Copyright IBM Corp. 2013 | ||
| 8 | * | ||
| 9 | * Author: Frank Haverkamp <haver@linux.vnet.ibm.com> | ||
| 10 | * Author: Joerg-Stephan Vogt <jsvogt@de.ibm.com> | ||
| 11 | * Author: Michael Jung <mijung@de.ibm.com> | ||
| 12 | * Author: Michael Ruettger <michael@ibmra.de> | ||
| 13 | * | ||
| 14 | * This program is free software; you can redistribute it and/or modify | ||
| 15 | * it under the terms of the GNU General Public License (version 2 only) | ||
| 16 | * as published by the Free Software Foundation. | ||
| 17 | * | ||
| 18 | * This program is distributed in the hope that it will be useful, | ||
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | * GNU General Public License for more details. | ||
| 22 | */ | ||
| 23 | |||
| 24 | /* | ||
| 25 | * User-space API for the GenWQE card. For debugging and test purposes | ||
| 26 | * the register addresses are included here too. | ||
| 27 | */ | ||
| 28 | |||
| 29 | #include <linux/types.h> | ||
| 30 | #include <linux/ioctl.h> | ||
| 31 | |||
| 32 | /* Basename of sysfs, debugfs and /dev interfaces */ | ||
| 33 | #define GENWQE_DEVNAME "genwqe" | ||
| 34 | |||
| 35 | #define GENWQE_TYPE_ALTERA_230 0x00 /* GenWQE4 Stratix-IV-230 */ | ||
| 36 | #define GENWQE_TYPE_ALTERA_530 0x01 /* GenWQE4 Stratix-IV-530 */ | ||
| 37 | #define GENWQE_TYPE_ALTERA_A4 0x02 /* GenWQE5 A4 Stratix-V-A4 */ | ||
| 38 | #define GENWQE_TYPE_ALTERA_A7 0x03 /* GenWQE5 A7 Stratix-V-A7 */ | ||
| 39 | |||
| 40 | /* MMIO Unit offsets: Each UnitID occupies a defined address range */ | ||
| 41 | #define GENWQE_UID_OFFS(uid) ((uid) << 24) | ||
| 42 | #define GENWQE_SLU_OFFS GENWQE_UID_OFFS(0) | ||
| 43 | #define GENWQE_HSU_OFFS GENWQE_UID_OFFS(1) | ||
| 44 | #define GENWQE_APP_OFFS GENWQE_UID_OFFS(2) | ||
| 45 | #define GENWQE_MAX_UNITS 3 | ||
| 46 | |||
| 47 | /* Common offsets per UnitID */ | ||
| 48 | #define IO_EXTENDED_ERROR_POINTER 0x00000048 | ||
| 49 | #define IO_ERROR_INJECT_SELECTOR 0x00000060 | ||
| 50 | #define IO_EXTENDED_DIAG_SELECTOR 0x00000070 | ||
| 51 | #define IO_EXTENDED_DIAG_READ_MBX 0x00000078 | ||
| 52 | #define IO_EXTENDED_DIAG_MAP(ring) (0x00000500 | ((ring) << 3)) | ||
| 53 | |||
| 54 | #define GENWQE_EXTENDED_DIAG_SELECTOR(ring, trace) (((ring) << 8) | (trace)) | ||
| 55 | |||
| 56 | /* UnitID 0: Service Layer Unit (SLU) */ | ||
| 57 | |||
| 58 | /* SLU: Unit Configuration Register */ | ||
| 59 | #define IO_SLU_UNITCFG 0x00000000 | ||
| 60 | #define IO_SLU_UNITCFG_TYPE_MASK 0x000000000ff00000 /* 27:20 */ | ||
| 61 | |||
| 62 | /* SLU: Fault Isolation Register (FIR) (ac_slu_fir) */ | ||
| 63 | #define IO_SLU_FIR 0x00000008 /* read only, wr direct */ | ||
| 64 | #define IO_SLU_FIR_CLR 0x00000010 /* read and clear */ | ||
| 65 | |||
| 66 | /* SLU: First Error Capture Register (FEC/WOF) */ | ||
| 67 | #define IO_SLU_FEC 0x00000018 | ||
| 68 | |||
| 69 | #define IO_SLU_ERR_ACT_MASK 0x00000020 | ||
| 70 | #define IO_SLU_ERR_ATTN_MASK 0x00000028 | ||
| 71 | #define IO_SLU_FIRX1_ACT_MASK 0x00000030 | ||
| 72 | #define IO_SLU_FIRX0_ACT_MASK 0x00000038 | ||
| 73 | #define IO_SLU_SEC_LEM_DEBUG_OVR 0x00000040 | ||
| 74 | #define IO_SLU_EXTENDED_ERR_PTR 0x00000048 | ||
| 75 | #define IO_SLU_COMMON_CONFIG 0x00000060 | ||
| 76 | |||
| 77 | #define IO_SLU_FLASH_FIR 0x00000108 | ||
| 78 | #define IO_SLU_SLC_FIR 0x00000110 | ||
| 79 | #define IO_SLU_RIU_TRAP 0x00000280 | ||
| 80 | #define IO_SLU_FLASH_FEC 0x00000308 | ||
| 81 | #define IO_SLU_SLC_FEC 0x00000310 | ||
| 82 | |||
| 83 | /* | ||
| 84 | * The Virtual Function's Access is from offset 0x00010000 | ||
| 85 | * The Physical Function's Access is from offset 0x00050000 | ||
| 86 | * Single Shared Registers exists only at offset 0x00060000 | ||
| 87 | * | ||
| 88 | * SLC: Queue Virtual Window Window for accessing into a specific VF | ||
| 89 | * queue. When accessing the 0x10000 space using the 0x50000 address | ||
| 90 | * segment, the value indicated here is used to specify which VF | ||
| 91 | * register is decoded. This register, and the 0x50000 register space | ||
| 92 | * can only be accessed by the PF. Example, if this register is set to | ||
| 93 | * 0x2, then a read from 0x50000 is the same as a read from 0x10000 | ||
| 94 | * from VF=2. | ||
| 95 | */ | ||
| 96 | |||
| 97 | /* SLC: Queue Segment */ | ||
| 98 | #define IO_SLC_QUEUE_SEGMENT 0x00010000 | ||
| 99 | #define IO_SLC_VF_QUEUE_SEGMENT 0x00050000 | ||
| 100 | |||
| 101 | /* SLC: Queue Offset */ | ||
| 102 | #define IO_SLC_QUEUE_OFFSET 0x00010008 | ||
| 103 | #define IO_SLC_VF_QUEUE_OFFSET 0x00050008 | ||
| 104 | |||
| 105 | /* SLC: Queue Configuration */ | ||
| 106 | #define IO_SLC_QUEUE_CONFIG 0x00010010 | ||
| 107 | #define IO_SLC_VF_QUEUE_CONFIG 0x00050010 | ||
| 108 | |||
| 109 | /* SLC: Job Timout/Only accessible for the PF */ | ||
| 110 | #define IO_SLC_APPJOB_TIMEOUT 0x00010018 | ||
| 111 | #define IO_SLC_VF_APPJOB_TIMEOUT 0x00050018 | ||
| 112 | #define TIMEOUT_250MS 0x0000000f | ||
| 113 | #define HEARTBEAT_DISABLE 0x0000ff00 | ||
| 114 | |||
| 115 | /* SLC: Queue InitSequence Register */ | ||
| 116 | #define IO_SLC_QUEUE_INITSQN 0x00010020 | ||
| 117 | #define IO_SLC_VF_QUEUE_INITSQN 0x00050020 | ||
| 118 | |||
| 119 | /* SLC: Queue Wrap */ | ||
| 120 | #define IO_SLC_QUEUE_WRAP 0x00010028 | ||
| 121 | #define IO_SLC_VF_QUEUE_WRAP 0x00050028 | ||
| 122 | |||
| 123 | /* SLC: Queue Status */ | ||
| 124 | #define IO_SLC_QUEUE_STATUS 0x00010100 | ||
| 125 | #define IO_SLC_VF_QUEUE_STATUS 0x00050100 | ||
| 126 | |||
| 127 | /* SLC: Queue Working Time */ | ||
| 128 | #define IO_SLC_QUEUE_WTIME 0x00010030 | ||
| 129 | #define IO_SLC_VF_QUEUE_WTIME 0x00050030 | ||
| 130 | |||
| 131 | /* SLC: Queue Error Counts */ | ||
| 132 | #define IO_SLC_QUEUE_ERRCNTS 0x00010038 | ||
| 133 | #define IO_SLC_VF_QUEUE_ERRCNTS 0x00050038 | ||
| 134 | |||
| 135 | /* SLC: Queue Loast Response Word */ | ||
| 136 | #define IO_SLC_QUEUE_LRW 0x00010040 | ||
| 137 | #define IO_SLC_VF_QUEUE_LRW 0x00050040 | ||
| 138 | |||
| 139 | /* SLC: Freerunning Timer */ | ||
| 140 | #define IO_SLC_FREE_RUNNING_TIMER 0x00010108 | ||
| 141 | #define IO_SLC_VF_FREE_RUNNING_TIMER 0x00050108 | ||
| 142 | |||
| 143 | /* SLC: Queue Virtual Access Region */ | ||
| 144 | #define IO_PF_SLC_VIRTUAL_REGION 0x00050000 | ||
| 145 | |||
| 146 | /* SLC: Queue Virtual Window */ | ||
| 147 | #define IO_PF_SLC_VIRTUAL_WINDOW 0x00060000 | ||
| 148 | |||
| 149 | /* SLC: DDCB Application Job Pending [n] (n=0:63) */ | ||
| 150 | #define IO_PF_SLC_JOBPEND(n) (0x00061000 + 8*(n)) | ||
| 151 | #define IO_SLC_JOBPEND(n) IO_PF_SLC_JOBPEND(n) | ||
| 152 | |||
| 153 | /* SLC: Parser Trap RAM [n] (n=0:31) */ | ||
| 154 | #define IO_SLU_SLC_PARSE_TRAP(n) (0x00011000 + 8*(n)) | ||
| 155 | |||
| 156 | /* SLC: Dispatcher Trap RAM [n] (n=0:31) */ | ||
| 157 | #define IO_SLU_SLC_DISP_TRAP(n) (0x00011200 + 8*(n)) | ||
| 158 | |||
| 159 | /* Global Fault Isolation Register (GFIR) */ | ||
| 160 | #define IO_SLC_CFGREG_GFIR 0x00020000 | ||
| 161 | #define GFIR_ERR_TRIGGER 0x0000ffff | ||
| 162 | |||
| 163 | /* SLU: Soft Reset Register */ | ||
| 164 | #define IO_SLC_CFGREG_SOFTRESET 0x00020018 | ||
| 165 | |||
| 166 | /* SLU: Misc Debug Register */ | ||
| 167 | #define IO_SLC_MISC_DEBUG 0x00020060 | ||
| 168 | #define IO_SLC_MISC_DEBUG_CLR 0x00020068 | ||
| 169 | #define IO_SLC_MISC_DEBUG_SET 0x00020070 | ||
| 170 | |||
| 171 | /* Temperature Sensor Reading */ | ||
| 172 | #define IO_SLU_TEMPERATURE_SENSOR 0x00030000 | ||
| 173 | #define IO_SLU_TEMPERATURE_CONFIG 0x00030008 | ||
| 174 | |||
| 175 | /* Voltage Margining Control */ | ||
| 176 | #define IO_SLU_VOLTAGE_CONTROL 0x00030080 | ||
| 177 | #define IO_SLU_VOLTAGE_NOMINAL 0x00000000 | ||
| 178 | #define IO_SLU_VOLTAGE_DOWN5 0x00000006 | ||
| 179 | #define IO_SLU_VOLTAGE_UP5 0x00000007 | ||
| 180 | |||
| 181 | /* Direct LED Control Register */ | ||
| 182 | #define IO_SLU_LEDCONTROL 0x00030100 | ||
| 183 | |||
| 184 | /* SLU: Flashbus Direct Access -A5 */ | ||
| 185 | #define IO_SLU_FLASH_DIRECTACCESS 0x00040010 | ||
| 186 | |||
| 187 | /* SLU: Flashbus Direct Access2 -A5 */ | ||
| 188 | #define IO_SLU_FLASH_DIRECTACCESS2 0x00040020 | ||
| 189 | |||
| 190 | /* SLU: Flashbus Command Interface -A5 */ | ||
| 191 | #define IO_SLU_FLASH_CMDINTF 0x00040030 | ||
| 192 | |||
| 193 | /* SLU: BitStream Loaded */ | ||
| 194 | #define IO_SLU_BITSTREAM 0x00040040 | ||
| 195 | |||
| 196 | /* This Register has a switch which will change the CAs to UR */ | ||
| 197 | #define IO_HSU_ERR_BEHAVIOR 0x01001010 | ||
| 198 | |||
| 199 | #define IO_SLC2_SQB_TRAP 0x00062000 | ||
| 200 | #define IO_SLC2_QUEUE_MANAGER_TRAP 0x00062008 | ||
| 201 | #define IO_SLC2_FLS_MASTER_TRAP 0x00062010 | ||
| 202 | |||
| 203 | /* UnitID 1: HSU Registers */ | ||
| 204 | #define IO_HSU_UNITCFG 0x01000000 | ||
| 205 | #define IO_HSU_FIR 0x01000008 | ||
| 206 | #define IO_HSU_FIR_CLR 0x01000010 | ||
| 207 | #define IO_HSU_FEC 0x01000018 | ||
| 208 | #define IO_HSU_ERR_ACT_MASK 0x01000020 | ||
| 209 | #define IO_HSU_ERR_ATTN_MASK 0x01000028 | ||
| 210 | #define IO_HSU_FIRX1_ACT_MASK 0x01000030 | ||
| 211 | #define IO_HSU_FIRX0_ACT_MASK 0x01000038 | ||
| 212 | #define IO_HSU_SEC_LEM_DEBUG_OVR 0x01000040 | ||
| 213 | #define IO_HSU_EXTENDED_ERR_PTR 0x01000048 | ||
| 214 | #define IO_HSU_COMMON_CONFIG 0x01000060 | ||
| 215 | |||
| 216 | /* UnitID 2: Application Unit (APP) */ | ||
| 217 | #define IO_APP_UNITCFG 0x02000000 | ||
| 218 | #define IO_APP_FIR 0x02000008 | ||
| 219 | #define IO_APP_FIR_CLR 0x02000010 | ||
| 220 | #define IO_APP_FEC 0x02000018 | ||
| 221 | #define IO_APP_ERR_ACT_MASK 0x02000020 | ||
| 222 | #define IO_APP_ERR_ATTN_MASK 0x02000028 | ||
| 223 | #define IO_APP_FIRX1_ACT_MASK 0x02000030 | ||
| 224 | #define IO_APP_FIRX0_ACT_MASK 0x02000038 | ||
| 225 | #define IO_APP_SEC_LEM_DEBUG_OVR 0x02000040 | ||
| 226 | #define IO_APP_EXTENDED_ERR_PTR 0x02000048 | ||
| 227 | #define IO_APP_COMMON_CONFIG 0x02000060 | ||
| 228 | |||
| 229 | #define IO_APP_DEBUG_REG_01 0x02010000 | ||
| 230 | #define IO_APP_DEBUG_REG_02 0x02010008 | ||
| 231 | #define IO_APP_DEBUG_REG_03 0x02010010 | ||
| 232 | #define IO_APP_DEBUG_REG_04 0x02010018 | ||
| 233 | #define IO_APP_DEBUG_REG_05 0x02010020 | ||
| 234 | #define IO_APP_DEBUG_REG_06 0x02010028 | ||
| 235 | #define IO_APP_DEBUG_REG_07 0x02010030 | ||
| 236 | #define IO_APP_DEBUG_REG_08 0x02010038 | ||
| 237 | #define IO_APP_DEBUG_REG_09 0x02010040 | ||
| 238 | #define IO_APP_DEBUG_REG_10 0x02010048 | ||
| 239 | #define IO_APP_DEBUG_REG_11 0x02010050 | ||
| 240 | #define IO_APP_DEBUG_REG_12 0x02010058 | ||
| 241 | #define IO_APP_DEBUG_REG_13 0x02010060 | ||
| 242 | #define IO_APP_DEBUG_REG_14 0x02010068 | ||
| 243 | #define IO_APP_DEBUG_REG_15 0x02010070 | ||
| 244 | #define IO_APP_DEBUG_REG_16 0x02010078 | ||
| 245 | #define IO_APP_DEBUG_REG_17 0x02010080 | ||
| 246 | #define IO_APP_DEBUG_REG_18 0x02010088 | ||
| 247 | |||
| 248 | /* Read/write from/to registers */ | ||
| 249 | struct genwqe_reg_io { | ||
| 250 | __u64 num; /* register offset/address */ | ||
| 251 | __u64 val64; | ||
| 252 | }; | ||
| 253 | |||
| 254 | /* | ||
| 255 | * All registers of our card will return values not equal this values. | ||
| 256 | * If we see IO_ILLEGAL_VALUE on any of our MMIO register reads, the | ||
| 257 | * card can be considered as unusable. It will need recovery. | ||
| 258 | */ | ||
| 259 | #define IO_ILLEGAL_VALUE 0xffffffffffffffffull | ||
| 260 | |||
| 261 | /* | ||
| 262 | * Generic DDCB execution interface. | ||
| 263 | * | ||
| 264 | * This interface is a first prototype resulting from discussions we | ||
| 265 | * had with other teams which wanted to use the Genwqe card. It allows | ||
| 266 | * to issue a DDCB request in a generic way. The request will block | ||
| 267 | * until it finishes or time out with error. | ||
| 268 | * | ||
| 269 | * Some DDCBs require DMA addresses to be specified in the ASIV | ||
| 270 | * block. The interface provies the capability to let the kernel | ||
| 271 | * driver know where those addresses are by specifying the ATS field, | ||
| 272 | * such that it can replace the user-space addresses with appropriate | ||
| 273 | * DMA addresses or DMA addresses of a scatter gather list which is | ||
| 274 | * dynamically created. | ||
| 275 | * | ||
| 276 | * Our hardware will refuse DDCB execution if the ATS field is not as | ||
| 277 | * expected. That means the DDCB execution engine in the chip knows | ||
| 278 | * where it expects DMA addresses within the ASIV part of the DDCB and | ||
| 279 | * will check that against the ATS field definition. Any invalid or | ||
| 280 | * unknown ATS content will lead to DDCB refusal. | ||
| 281 | */ | ||
| 282 | |||
| 283 | /* Genwqe chip Units */ | ||
| 284 | #define DDCB_ACFUNC_SLU 0x00 /* chip service layer unit */ | ||
| 285 | #define DDCB_ACFUNC_APP 0x01 /* chip application */ | ||
| 286 | |||
| 287 | /* DDCB return codes (RETC) */ | ||
| 288 | #define DDCB_RETC_IDLE 0x0000 /* Unexecuted/DDCB created */ | ||
| 289 | #define DDCB_RETC_PENDING 0x0101 /* Pending Execution */ | ||
| 290 | #define DDCB_RETC_COMPLETE 0x0102 /* Cmd complete. No error */ | ||
| 291 | #define DDCB_RETC_FAULT 0x0104 /* App Err, recoverable */ | ||
| 292 | #define DDCB_RETC_ERROR 0x0108 /* App Err, non-recoverable */ | ||
| 293 | #define DDCB_RETC_FORCED_ERROR 0x01ff /* overwritten by driver */ | ||
| 294 | |||
| 295 | #define DDCB_RETC_UNEXEC 0x0110 /* Unexe/Removed from queue */ | ||
| 296 | #define DDCB_RETC_TERM 0x0120 /* Terminated */ | ||
| 297 | #define DDCB_RETC_RES0 0x0140 /* Reserved */ | ||
| 298 | #define DDCB_RETC_RES1 0x0180 /* Reserved */ | ||
| 299 | |||
| 300 | /* DDCB Command Options (CMDOPT) */ | ||
| 301 | #define DDCB_OPT_ECHO_FORCE_NO 0x0000 /* ECHO DDCB */ | ||
| 302 | #define DDCB_OPT_ECHO_FORCE_102 0x0001 /* force return code */ | ||
| 303 | #define DDCB_OPT_ECHO_FORCE_104 0x0002 | ||
| 304 | #define DDCB_OPT_ECHO_FORCE_108 0x0003 | ||
| 305 | |||
| 306 | #define DDCB_OPT_ECHO_FORCE_110 0x0004 /* only on PF ! */ | ||
| 307 | #define DDCB_OPT_ECHO_FORCE_120 0x0005 | ||
| 308 | #define DDCB_OPT_ECHO_FORCE_140 0x0006 | ||
| 309 | #define DDCB_OPT_ECHO_FORCE_180 0x0007 | ||
| 310 | |||
| 311 | #define DDCB_OPT_ECHO_COPY_NONE (0 << 5) | ||
| 312 | #define DDCB_OPT_ECHO_COPY_ALL (1 << 5) | ||
| 313 | |||
| 314 | /* Definitions of Service Layer Commands */ | ||
| 315 | #define SLCMD_ECHO_SYNC 0x00 /* PF/VF */ | ||
| 316 | #define SLCMD_MOVE_FLASH 0x06 /* PF only */ | ||
| 317 | #define SLCMD_MOVE_FLASH_FLAGS_MODE 0x03 /* bit 0 and 1 used for mode */ | ||
| 318 | #define SLCMD_MOVE_FLASH_FLAGS_DLOAD 0 /* mode: download */ | ||
| 319 | #define SLCMD_MOVE_FLASH_FLAGS_EMUL 1 /* mode: emulation */ | ||
| 320 | #define SLCMD_MOVE_FLASH_FLAGS_UPLOAD 2 /* mode: upload */ | ||
| 321 | #define SLCMD_MOVE_FLASH_FLAGS_VERIFY 3 /* mode: verify */ | ||
| 322 | #define SLCMD_MOVE_FLASH_FLAG_NOTAP (1 << 2)/* just dump DDCB and exit */ | ||
| 323 | #define SLCMD_MOVE_FLASH_FLAG_POLL (1 << 3)/* wait for RETC >= 0102 */ | ||
| 324 | #define SLCMD_MOVE_FLASH_FLAG_PARTITION (1 << 4) | ||
| 325 | #define SLCMD_MOVE_FLASH_FLAG_ERASE (1 << 5) | ||
| 326 | |||
| 327 | enum genwqe_card_state { | ||
| 328 | GENWQE_CARD_UNUSED = 0, | ||
| 329 | GENWQE_CARD_USED = 1, | ||
| 330 | GENWQE_CARD_FATAL_ERROR = 2, | ||
| 331 | GENWQE_CARD_STATE_MAX, | ||
| 332 | }; | ||
| 333 | |||
| 334 | /* common struct for chip image exchange */ | ||
| 335 | struct genwqe_bitstream { | ||
| 336 | __u64 data_addr; /* pointer to image data */ | ||
| 337 | __u32 size; /* size of image file */ | ||
| 338 | __u32 crc; /* crc of this image */ | ||
| 339 | __u64 target_addr; /* starting address in Flash */ | ||
| 340 | __u32 partition; /* '0', '1', or 'v' */ | ||
| 341 | __u32 uid; /* 1=host/x=dram */ | ||
| 342 | |||
| 343 | __u64 slu_id; /* informational/sim: SluID */ | ||
| 344 | __u64 app_id; /* informational/sim: AppID */ | ||
| 345 | |||
| 346 | __u16 retc; /* returned from processing */ | ||
| 347 | __u16 attn; /* attention code from processing */ | ||
| 348 | __u32 progress; /* progress code from processing */ | ||
| 349 | }; | ||
| 350 | |||
| 351 | /* Issuing a specific DDCB command */ | ||
| 352 | #define DDCB_LENGTH 256 /* for debug data */ | ||
| 353 | #define DDCB_ASIV_LENGTH 104 /* len of the DDCB ASIV array */ | ||
| 354 | #define DDCB_ASIV_LENGTH_ATS 96 /* ASIV in ATS architecture */ | ||
| 355 | #define DDCB_ASV_LENGTH 64 /* len of the DDCB ASV array */ | ||
| 356 | #define DDCB_FIXUPS 12 /* maximum number of fixups */ | ||
| 357 | |||
| 358 | struct genwqe_debug_data { | ||
| 359 | char driver_version[64]; | ||
| 360 | __u64 slu_unitcfg; | ||
| 361 | __u64 app_unitcfg; | ||
| 362 | |||
| 363 | __u8 ddcb_before[DDCB_LENGTH]; | ||
| 364 | __u8 ddcb_prev[DDCB_LENGTH]; | ||
| 365 | __u8 ddcb_finished[DDCB_LENGTH]; | ||
| 366 | }; | ||
| 367 | |||
| 368 | /* | ||
| 369 | * Address Translation Specification (ATS) definitions | ||
| 370 | * | ||
| 371 | * Each 4 bit within the ATS 64-bit word specify the required address | ||
| 372 | * translation at the defined offset. | ||
| 373 | * | ||
| 374 | * 63 LSB | ||
| 375 | * 6666.5555.5555.5544.4444.4443.3333.3333 ... 11 | ||
| 376 | * 3210.9876.5432.1098.7654.3210.9876.5432 ... 1098.7654.3210 | ||
| 377 | * | ||
| 378 | * offset: 0x00 0x08 0x10 0x18 0x20 0x28 0x30 0x38 ... 0x68 0x70 0x78 | ||
| 379 | * res res res res ASIV ... | ||
| 380 | * The first 4 entries in the ATS word are reserved. The following nibbles | ||
| 381 | * each describe at an 8 byte offset the format of the required data. | ||
| 382 | */ | ||
| 383 | #define ATS_TYPE_DATA 0x0ull /* data */ | ||
| 384 | #define ATS_TYPE_FLAT_RD 0x4ull /* flat buffer read only */ | ||
| 385 | #define ATS_TYPE_FLAT_RDWR 0x5ull /* flat buffer read/write */ | ||
| 386 | #define ATS_TYPE_SGL_RD 0x6ull /* sgl read only */ | ||
| 387 | #define ATS_TYPE_SGL_RDWR 0x7ull /* sgl read/write */ | ||
| 388 | |||
| 389 | #define ATS_SET_FLAGS(_struct, _field, _flags) \ | ||
| 390 | (((_flags) & 0xf) << (44 - (4 * (offsetof(_struct, _field) / 8)))) | ||
| 391 | |||
| 392 | #define ATS_GET_FLAGS(_ats, _byte_offs) \ | ||
| 393 | (((_ats) >> (44 - (4 * ((_byte_offs) / 8)))) & 0xf) | ||
| 394 | |||
| 395 | /** | ||
| 396 | * struct genwqe_ddcb_cmd - User parameter for generic DDCB commands | ||
| 397 | * | ||
| 398 | * On the way into the kernel the driver will read the whole data | ||
| 399 | * structure. On the way out the driver will not copy the ASIV data | ||
| 400 | * back to user-space. | ||
| 401 | */ | ||
| 402 | struct genwqe_ddcb_cmd { | ||
| 403 | /* START of data copied to/from driver */ | ||
| 404 | __u64 next_addr; /* chaining genwqe_ddcb_cmd */ | ||
| 405 | __u64 flags; /* reserved */ | ||
| 406 | |||
| 407 | __u8 acfunc; /* accelerators functional unit */ | ||
| 408 | __u8 cmd; /* command to execute */ | ||
| 409 | __u8 asiv_length; /* used parameter length */ | ||
| 410 | __u8 asv_length; /* length of valid return values */ | ||
| 411 | __u16 cmdopts; /* command options */ | ||
| 412 | __u16 retc; /* return code from processing */ | ||
| 413 | |||
| 414 | __u16 attn; /* attention code from processing */ | ||
| 415 | __u16 vcrc; /* variant crc16 */ | ||
| 416 | __u32 progress; /* progress code from processing */ | ||
| 417 | |||
| 418 | __u64 deque_ts; /* dequeue time stamp */ | ||
| 419 | __u64 cmplt_ts; /* completion time stamp */ | ||
| 420 | __u64 disp_ts; /* SW processing start */ | ||
| 421 | |||
| 422 | /* move to end and avoid copy-back */ | ||
| 423 | __u64 ddata_addr; /* collect debug data */ | ||
| 424 | |||
| 425 | /* command specific values */ | ||
| 426 | __u8 asv[DDCB_ASV_LENGTH]; | ||
| 427 | |||
| 428 | /* END of data copied from driver */ | ||
| 429 | union { | ||
| 430 | struct { | ||
| 431 | __u64 ats; | ||
| 432 | __u8 asiv[DDCB_ASIV_LENGTH_ATS]; | ||
| 433 | }; | ||
| 434 | /* used for flash update to keep it backward compatible */ | ||
| 435 | __u8 __asiv[DDCB_ASIV_LENGTH]; | ||
| 436 | }; | ||
| 437 | /* END of data copied to driver */ | ||
| 438 | }; | ||
| 439 | |||
| 440 | #define GENWQE_IOC_CODE 0xa5 | ||
| 441 | |||
| 442 | /* Access functions */ | ||
| 443 | #define GENWQE_READ_REG64 _IOR(GENWQE_IOC_CODE, 30, struct genwqe_reg_io) | ||
| 444 | #define GENWQE_WRITE_REG64 _IOW(GENWQE_IOC_CODE, 31, struct genwqe_reg_io) | ||
| 445 | #define GENWQE_READ_REG32 _IOR(GENWQE_IOC_CODE, 32, struct genwqe_reg_io) | ||
| 446 | #define GENWQE_WRITE_REG32 _IOW(GENWQE_IOC_CODE, 33, struct genwqe_reg_io) | ||
| 447 | #define GENWQE_READ_REG16 _IOR(GENWQE_IOC_CODE, 34, struct genwqe_reg_io) | ||
| 448 | #define GENWQE_WRITE_REG16 _IOW(GENWQE_IOC_CODE, 35, struct genwqe_reg_io) | ||
| 449 | |||
| 450 | #define GENWQE_GET_CARD_STATE _IOR(GENWQE_IOC_CODE, 36, enum genwqe_card_state) | ||
| 451 | |||
| 452 | /** | ||
| 453 | * struct genwqe_mem - Memory pinning/unpinning information | ||
| 454 | * @addr: virtual user space address | ||
| 455 | * @size: size of the area pin/dma-map/unmap | ||
| 456 | * direction: 0: read/1: read and write | ||
| 457 | * | ||
| 458 | * Avoid pinning and unpinning of memory pages dynamically. Instead | ||
| 459 | * the idea is to pin the whole buffer space required for DDCB | ||
| 460 | * opertionas in advance. The driver will reuse this pinning and the | ||
| 461 | * memory associated with it to setup the sglists for the DDCB | ||
| 462 | * requests without the need to allocate and free memory or map and | ||
| 463 | * unmap to get the DMA addresses. | ||
| 464 | * | ||
| 465 | * The inverse operation needs to be called after the pinning is not | ||
| 466 | * needed anymore. The pinnings else the pinnings will get removed | ||
| 467 | * after the device is closed. Note that pinnings will required | ||
| 468 | * memory. | ||
| 469 | */ | ||
| 470 | struct genwqe_mem { | ||
| 471 | __u64 addr; | ||
| 472 | __u64 size; | ||
| 473 | __u64 direction; | ||
| 474 | __u64 flags; | ||
| 475 | }; | ||
| 476 | |||
| 477 | #define GENWQE_PIN_MEM _IOWR(GENWQE_IOC_CODE, 40, struct genwqe_mem) | ||
| 478 | #define GENWQE_UNPIN_MEM _IOWR(GENWQE_IOC_CODE, 41, struct genwqe_mem) | ||
| 479 | |||
| 480 | /* | ||
| 481 | * Generic synchronous DDCB execution interface. | ||
| 482 | * Synchronously execute a DDCB. | ||
| 483 | * | ||
| 484 | * Return: 0 on success or negative error code. | ||
| 485 | * -EINVAL: Invalid parameters (ASIV_LEN, ASV_LEN, illegal fixups | ||
| 486 | * no mappings found/could not create mappings | ||
| 487 | * -EFAULT: illegal addresses in fixups, purging failed | ||
| 488 | * -EBADMSG: enqueing failed, retc != DDCB_RETC_COMPLETE | ||
| 489 | */ | ||
| 490 | #define GENWQE_EXECUTE_DDCB \ | ||
| 491 | _IOWR(GENWQE_IOC_CODE, 50, struct genwqe_ddcb_cmd) | ||
| 492 | |||
| 493 | #define GENWQE_EXECUTE_RAW_DDCB \ | ||
| 494 | _IOWR(GENWQE_IOC_CODE, 51, struct genwqe_ddcb_cmd) | ||
| 495 | |||
| 496 | /* Service Layer functions (PF only) */ | ||
| 497 | #define GENWQE_SLU_UPDATE _IOWR(GENWQE_IOC_CODE, 80, struct genwqe_bitstream) | ||
| 498 | #define GENWQE_SLU_READ _IOWR(GENWQE_IOC_CODE, 81, struct genwqe_bitstream) | ||
| 499 | |||
| 500 | #endif /* __GENWQE_CARD_H__ */ | ||
diff --git a/include/uapi/linux/gfs2_ondisk.h b/include/uapi/linux/gfs2_ondisk.h index b2de1f9a88d6..0f24c07aed51 100644 --- a/include/uapi/linux/gfs2_ondisk.h +++ b/include/uapi/linux/gfs2_ondisk.h | |||
| @@ -319,7 +319,16 @@ struct gfs2_leaf { | |||
| 319 | __be32 lf_dirent_format; /* Format of the dirents */ | 319 | __be32 lf_dirent_format; /* Format of the dirents */ |
| 320 | __be64 lf_next; /* Next leaf, if overflow */ | 320 | __be64 lf_next; /* Next leaf, if overflow */ |
| 321 | 321 | ||
| 322 | __u8 lf_reserved[64]; | 322 | union { |
| 323 | __u8 lf_reserved[64]; | ||
| 324 | struct { | ||
| 325 | __be64 lf_inode; /* Dir inode number */ | ||
| 326 | __be32 lf_dist; /* Dist from inode on chain */ | ||
| 327 | __be32 lf_nsec; /* Last ins/del usecs */ | ||
| 328 | __be64 lf_sec; /* Last ins/del in secs */ | ||
| 329 | __u8 lf_reserved2[40]; | ||
| 330 | }; | ||
| 331 | }; | ||
| 323 | }; | 332 | }; |
| 324 | 333 | ||
| 325 | /* | 334 | /* |
diff --git a/include/uapi/linux/if_addr.h b/include/uapi/linux/if_addr.h index 23357ab81a77..dea10a87dfd1 100644 --- a/include/uapi/linux/if_addr.h +++ b/include/uapi/linux/if_addr.h | |||
| @@ -18,6 +18,9 @@ struct ifaddrmsg { | |||
| 18 | * It makes no difference for normally configured broadcast interfaces, | 18 | * It makes no difference for normally configured broadcast interfaces, |
| 19 | * but for point-to-point IFA_ADDRESS is DESTINATION address, | 19 | * but for point-to-point IFA_ADDRESS is DESTINATION address, |
| 20 | * local address is supplied in IFA_LOCAL attribute. | 20 | * local address is supplied in IFA_LOCAL attribute. |
| 21 | * | ||
| 22 | * IFA_FLAGS is a u32 attribute that extends the u8 field ifa_flags. | ||
| 23 | * If present, the value from struct ifaddrmsg will be ignored. | ||
| 21 | */ | 24 | */ |
| 22 | enum { | 25 | enum { |
| 23 | IFA_UNSPEC, | 26 | IFA_UNSPEC, |
| @@ -28,6 +31,7 @@ enum { | |||
| 28 | IFA_ANYCAST, | 31 | IFA_ANYCAST, |
| 29 | IFA_CACHEINFO, | 32 | IFA_CACHEINFO, |
| 30 | IFA_MULTICAST, | 33 | IFA_MULTICAST, |
| 34 | IFA_FLAGS, | ||
| 31 | __IFA_MAX, | 35 | __IFA_MAX, |
| 32 | }; | 36 | }; |
| 33 | 37 | ||
| @@ -44,6 +48,8 @@ enum { | |||
| 44 | #define IFA_F_DEPRECATED 0x20 | 48 | #define IFA_F_DEPRECATED 0x20 |
| 45 | #define IFA_F_TENTATIVE 0x40 | 49 | #define IFA_F_TENTATIVE 0x40 |
| 46 | #define IFA_F_PERMANENT 0x80 | 50 | #define IFA_F_PERMANENT 0x80 |
| 51 | #define IFA_F_MANAGETEMPADDR 0x100 | ||
| 52 | #define IFA_F_NOPREFIXROUTE 0x200 | ||
| 47 | 53 | ||
| 48 | struct ifa_cacheinfo { | 54 | struct ifa_cacheinfo { |
| 49 | __u32 ifa_prefered; | 55 | __u32 ifa_prefered; |
diff --git a/include/uapi/linux/if_arp.h b/include/uapi/linux/if_arp.h index d7fea3496f32..4d024d75d64b 100644 --- a/include/uapi/linux/if_arp.h +++ b/include/uapi/linux/if_arp.h | |||
| @@ -94,6 +94,7 @@ | |||
| 94 | #define ARPHRD_CAIF 822 /* CAIF media type */ | 94 | #define ARPHRD_CAIF 822 /* CAIF media type */ |
| 95 | #define ARPHRD_IP6GRE 823 /* GRE over IPv6 */ | 95 | #define ARPHRD_IP6GRE 823 /* GRE over IPv6 */ |
| 96 | #define ARPHRD_NETLINK 824 /* Netlink header */ | 96 | #define ARPHRD_NETLINK 824 /* Netlink header */ |
| 97 | #define ARPHRD_6LOWPAN 825 /* IPv6 over LoWPAN */ | ||
| 97 | 98 | ||
| 98 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ | 99 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ |
| 99 | #define ARPHRD_NONE 0xFFFE /* zero header length */ | 100 | #define ARPHRD_NONE 0xFFFE /* zero header length */ |
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index b78566f59aba..16410b6e7819 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
| @@ -240,6 +240,8 @@ enum { | |||
| 240 | IFLA_INFO_KIND, | 240 | IFLA_INFO_KIND, |
| 241 | IFLA_INFO_DATA, | 241 | IFLA_INFO_DATA, |
| 242 | IFLA_INFO_XSTATS, | 242 | IFLA_INFO_XSTATS, |
| 243 | IFLA_INFO_SLAVE_KIND, | ||
| 244 | IFLA_INFO_SLAVE_DATA, | ||
| 243 | __IFLA_INFO_MAX, | 245 | __IFLA_INFO_MAX, |
| 244 | }; | 246 | }; |
| 245 | 247 | ||
| @@ -331,11 +333,57 @@ enum { | |||
| 331 | IFLA_BOND_UNSPEC, | 333 | IFLA_BOND_UNSPEC, |
| 332 | IFLA_BOND_MODE, | 334 | IFLA_BOND_MODE, |
| 333 | IFLA_BOND_ACTIVE_SLAVE, | 335 | IFLA_BOND_ACTIVE_SLAVE, |
| 336 | IFLA_BOND_MIIMON, | ||
| 337 | IFLA_BOND_UPDELAY, | ||
| 338 | IFLA_BOND_DOWNDELAY, | ||
| 339 | IFLA_BOND_USE_CARRIER, | ||
| 340 | IFLA_BOND_ARP_INTERVAL, | ||
| 341 | IFLA_BOND_ARP_IP_TARGET, | ||
| 342 | IFLA_BOND_ARP_VALIDATE, | ||
| 343 | IFLA_BOND_ARP_ALL_TARGETS, | ||
| 344 | IFLA_BOND_PRIMARY, | ||
| 345 | IFLA_BOND_PRIMARY_RESELECT, | ||
| 346 | IFLA_BOND_FAIL_OVER_MAC, | ||
| 347 | IFLA_BOND_XMIT_HASH_POLICY, | ||
| 348 | IFLA_BOND_RESEND_IGMP, | ||
| 349 | IFLA_BOND_NUM_PEER_NOTIF, | ||
| 350 | IFLA_BOND_ALL_SLAVES_ACTIVE, | ||
| 351 | IFLA_BOND_MIN_LINKS, | ||
| 352 | IFLA_BOND_LP_INTERVAL, | ||
| 353 | IFLA_BOND_PACKETS_PER_SLAVE, | ||
| 354 | IFLA_BOND_AD_LACP_RATE, | ||
| 355 | IFLA_BOND_AD_SELECT, | ||
| 356 | IFLA_BOND_AD_INFO, | ||
| 334 | __IFLA_BOND_MAX, | 357 | __IFLA_BOND_MAX, |
| 335 | }; | 358 | }; |
| 336 | 359 | ||
| 337 | #define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1) | 360 | #define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1) |
| 338 | 361 | ||
| 362 | enum { | ||
| 363 | IFLA_BOND_AD_INFO_UNSPEC, | ||
| 364 | IFLA_BOND_AD_INFO_AGGREGATOR, | ||
| 365 | IFLA_BOND_AD_INFO_NUM_PORTS, | ||
| 366 | IFLA_BOND_AD_INFO_ACTOR_KEY, | ||
| 367 | IFLA_BOND_AD_INFO_PARTNER_KEY, | ||
| 368 | IFLA_BOND_AD_INFO_PARTNER_MAC, | ||
| 369 | __IFLA_BOND_AD_INFO_MAX, | ||
| 370 | }; | ||
| 371 | |||
| 372 | #define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1) | ||
| 373 | |||
| 374 | enum { | ||
| 375 | IFLA_BOND_SLAVE_UNSPEC, | ||
| 376 | IFLA_BOND_SLAVE_STATE, | ||
| 377 | IFLA_BOND_SLAVE_MII_STATUS, | ||
| 378 | IFLA_BOND_SLAVE_LINK_FAILURE_COUNT, | ||
| 379 | IFLA_BOND_SLAVE_PERM_HWADDR, | ||
| 380 | IFLA_BOND_SLAVE_QUEUE_ID, | ||
| 381 | IFLA_BOND_SLAVE_AD_AGGREGATOR_ID, | ||
| 382 | __IFLA_BOND_SLAVE_MAX, | ||
| 383 | }; | ||
| 384 | |||
| 385 | #define IFLA_BOND_SLAVE_MAX (__IFLA_BOND_SLAVE_MAX - 1) | ||
| 386 | |||
| 339 | /* SR-IOV virtual function management section */ | 387 | /* SR-IOV virtual function management section */ |
| 340 | 388 | ||
| 341 | enum { | 389 | enum { |
| @@ -488,7 +536,9 @@ enum { | |||
| 488 | IFLA_HSR_UNSPEC, | 536 | IFLA_HSR_UNSPEC, |
| 489 | IFLA_HSR_SLAVE1, | 537 | IFLA_HSR_SLAVE1, |
| 490 | IFLA_HSR_SLAVE2, | 538 | IFLA_HSR_SLAVE2, |
| 491 | IFLA_HSR_MULTICAST_SPEC, | 539 | IFLA_HSR_MULTICAST_SPEC, /* Last byte of supervision addr */ |
| 540 | IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */ | ||
| 541 | IFLA_HSR_SEQ_NR, | ||
| 492 | __IFLA_HSR_MAX, | 542 | __IFLA_HSR_MAX, |
| 493 | }; | 543 | }; |
| 494 | 544 | ||
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h index dbf06667394b..bac27fa05f5b 100644 --- a/include/uapi/linux/if_packet.h +++ b/include/uapi/linux/if_packet.h | |||
| @@ -26,8 +26,10 @@ struct sockaddr_ll { | |||
| 26 | #define PACKET_MULTICAST 2 /* To group */ | 26 | #define PACKET_MULTICAST 2 /* To group */ |
| 27 | #define PACKET_OTHERHOST 3 /* To someone else */ | 27 | #define PACKET_OTHERHOST 3 /* To someone else */ |
| 28 | #define PACKET_OUTGOING 4 /* Outgoing of any type */ | 28 | #define PACKET_OUTGOING 4 /* Outgoing of any type */ |
| 29 | /* These ones are invisible by user level */ | ||
| 30 | #define PACKET_LOOPBACK 5 /* MC/BRD frame looped back */ | 29 | #define PACKET_LOOPBACK 5 /* MC/BRD frame looped back */ |
| 30 | #define PACKET_USER 6 /* To user space */ | ||
| 31 | #define PACKET_KERNEL 7 /* To kernel space */ | ||
| 32 | /* Unused, PACKET_FASTROUTE and PACKET_LOOPBACK are invisible to user space */ | ||
| 31 | #define PACKET_FASTROUTE 6 /* Fastrouted frame */ | 33 | #define PACKET_FASTROUTE 6 /* Fastrouted frame */ |
| 32 | 34 | ||
| 33 | /* Packet socket options */ | 35 | /* Packet socket options */ |
| @@ -51,12 +53,14 @@ struct sockaddr_ll { | |||
| 51 | #define PACKET_TIMESTAMP 17 | 53 | #define PACKET_TIMESTAMP 17 |
| 52 | #define PACKET_FANOUT 18 | 54 | #define PACKET_FANOUT 18 |
| 53 | #define PACKET_TX_HAS_OFF 19 | 55 | #define PACKET_TX_HAS_OFF 19 |
| 56 | #define PACKET_QDISC_BYPASS 20 | ||
| 54 | 57 | ||
| 55 | #define PACKET_FANOUT_HASH 0 | 58 | #define PACKET_FANOUT_HASH 0 |
| 56 | #define PACKET_FANOUT_LB 1 | 59 | #define PACKET_FANOUT_LB 1 |
| 57 | #define PACKET_FANOUT_CPU 2 | 60 | #define PACKET_FANOUT_CPU 2 |
| 58 | #define PACKET_FANOUT_ROLLOVER 3 | 61 | #define PACKET_FANOUT_ROLLOVER 3 |
| 59 | #define PACKET_FANOUT_RND 4 | 62 | #define PACKET_FANOUT_RND 4 |
| 63 | #define PACKET_FANOUT_QM 5 | ||
| 60 | #define PACKET_FANOUT_FLAG_ROLLOVER 0x1000 | 64 | #define PACKET_FANOUT_FLAG_ROLLOVER 0x1000 |
| 61 | #define PACKET_FANOUT_FLAG_DEFRAG 0x8000 | 65 | #define PACKET_FANOUT_FLAG_DEFRAG 0x8000 |
| 62 | 66 | ||
| @@ -83,17 +87,18 @@ struct tpacket_auxdata { | |||
| 83 | __u16 tp_mac; | 87 | __u16 tp_mac; |
| 84 | __u16 tp_net; | 88 | __u16 tp_net; |
| 85 | __u16 tp_vlan_tci; | 89 | __u16 tp_vlan_tci; |
| 86 | __u16 tp_padding; | 90 | __u16 tp_vlan_tpid; |
| 87 | }; | 91 | }; |
| 88 | 92 | ||
| 89 | /* Rx ring - header status */ | 93 | /* Rx ring - header status */ |
| 90 | #define TP_STATUS_KERNEL 0 | 94 | #define TP_STATUS_KERNEL 0 |
| 91 | #define TP_STATUS_USER (1 << 0) | 95 | #define TP_STATUS_USER (1 << 0) |
| 92 | #define TP_STATUS_COPY (1 << 1) | 96 | #define TP_STATUS_COPY (1 << 1) |
| 93 | #define TP_STATUS_LOSING (1 << 2) | 97 | #define TP_STATUS_LOSING (1 << 2) |
| 94 | #define TP_STATUS_CSUMNOTREADY (1 << 3) | 98 | #define TP_STATUS_CSUMNOTREADY (1 << 3) |
| 95 | #define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */ | 99 | #define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */ |
| 96 | #define TP_STATUS_BLK_TMO (1 << 5) | 100 | #define TP_STATUS_BLK_TMO (1 << 5) |
| 101 | #define TP_STATUS_VLAN_TPID_VALID (1 << 6) /* auxdata has valid tp_vlan_tpid */ | ||
| 97 | 102 | ||
| 98 | /* Tx ring - header status */ | 103 | /* Tx ring - header status */ |
| 99 | #define TP_STATUS_AVAILABLE 0 | 104 | #define TP_STATUS_AVAILABLE 0 |
| @@ -132,12 +137,15 @@ struct tpacket2_hdr { | |||
| 132 | __u32 tp_sec; | 137 | __u32 tp_sec; |
| 133 | __u32 tp_nsec; | 138 | __u32 tp_nsec; |
| 134 | __u16 tp_vlan_tci; | 139 | __u16 tp_vlan_tci; |
| 135 | __u16 tp_padding; | 140 | __u16 tp_vlan_tpid; |
| 141 | __u8 tp_padding[4]; | ||
| 136 | }; | 142 | }; |
| 137 | 143 | ||
| 138 | struct tpacket_hdr_variant1 { | 144 | struct tpacket_hdr_variant1 { |
| 139 | __u32 tp_rxhash; | 145 | __u32 tp_rxhash; |
| 140 | __u32 tp_vlan_tci; | 146 | __u32 tp_vlan_tci; |
| 147 | __u16 tp_vlan_tpid; | ||
| 148 | __u16 tp_padding; | ||
| 141 | }; | 149 | }; |
| 142 | 150 | ||
| 143 | struct tpacket3_hdr { | 151 | struct tpacket3_hdr { |
| @@ -153,6 +161,7 @@ struct tpacket3_hdr { | |||
| 153 | union { | 161 | union { |
| 154 | struct tpacket_hdr_variant1 hv1; | 162 | struct tpacket_hdr_variant1 hv1; |
| 155 | }; | 163 | }; |
| 164 | __u8 tp_padding[8]; | ||
| 156 | }; | 165 | }; |
| 157 | 166 | ||
| 158 | struct tpacket_bd_ts { | 167 | struct tpacket_bd_ts { |
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h index 440d5c479145..633b93cac1ed 100644 --- a/include/uapi/linux/in6.h +++ b/include/uapi/linux/in6.h | |||
| @@ -85,6 +85,8 @@ struct in6_flowlabel_req { | |||
| 85 | 85 | ||
| 86 | #define IPV6_FL_F_CREATE 1 | 86 | #define IPV6_FL_F_CREATE 1 |
| 87 | #define IPV6_FL_F_EXCL 2 | 87 | #define IPV6_FL_F_EXCL 2 |
| 88 | #define IPV6_FL_F_REFLECT 4 | ||
| 89 | #define IPV6_FL_F_REMOTE 8 | ||
| 88 | 90 | ||
| 89 | #define IPV6_FL_S_NONE 0 | 91 | #define IPV6_FL_S_NONE 0 |
| 90 | #define IPV6_FL_S_EXCL 1 | 92 | #define IPV6_FL_S_EXCL 1 |
| @@ -188,6 +190,10 @@ enum { | |||
| 188 | #define IPV6_PMTUDISC_WANT 1 | 190 | #define IPV6_PMTUDISC_WANT 1 |
| 189 | #define IPV6_PMTUDISC_DO 2 | 191 | #define IPV6_PMTUDISC_DO 2 |
| 190 | #define IPV6_PMTUDISC_PROBE 3 | 192 | #define IPV6_PMTUDISC_PROBE 3 |
| 193 | /* same as IPV6_PMTUDISC_PROBE, provided for symetry with IPv4 | ||
| 194 | * also see comments on IP_PMTUDISC_INTERFACE | ||
| 195 | */ | ||
| 196 | #define IPV6_PMTUDISC_INTERFACE 4 | ||
| 191 | 197 | ||
| 192 | /* Flowlabel */ | 198 | /* Flowlabel */ |
| 193 | #define IPV6_FLOWLABEL_MGR 32 | 199 | #define IPV6_FLOWLABEL_MGR 32 |
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index a3726275876d..bd24470d24a2 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h | |||
| @@ -464,7 +464,8 @@ struct input_keymap_entry { | |||
| 464 | #define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */ | 464 | #define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */ |
| 465 | #define KEY_DISPLAY_OFF 245 /* display device to off state */ | 465 | #define KEY_DISPLAY_OFF 245 /* display device to off state */ |
| 466 | 466 | ||
| 467 | #define KEY_WIMAX 246 | 467 | #define KEY_WWAN 246 /* Wireless WAN (LTE, UMTS, GSM, etc.) */ |
| 468 | #define KEY_WIMAX KEY_WWAN | ||
| 468 | #define KEY_RFKILL 247 /* Key that controls all radios */ | 469 | #define KEY_RFKILL 247 /* Key that controls all radios */ |
| 469 | 470 | ||
| 470 | #define KEY_MICMUTE 248 /* Mute / unmute the microphone */ | 471 | #define KEY_MICMUTE 248 /* Mute / unmute the microphone */ |
| @@ -719,6 +720,8 @@ struct input_keymap_entry { | |||
| 719 | #define BTN_DPAD_LEFT 0x222 | 720 | #define BTN_DPAD_LEFT 0x222 |
| 720 | #define BTN_DPAD_RIGHT 0x223 | 721 | #define BTN_DPAD_RIGHT 0x223 |
| 721 | 722 | ||
| 723 | #define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ | ||
| 724 | |||
| 722 | #define BTN_TRIGGER_HAPPY 0x2c0 | 725 | #define BTN_TRIGGER_HAPPY 0x2c0 |
| 723 | #define BTN_TRIGGER_HAPPY1 0x2c0 | 726 | #define BTN_TRIGGER_HAPPY1 0x2c0 |
| 724 | #define BTN_TRIGGER_HAPPY2 0x2c1 | 727 | #define BTN_TRIGGER_HAPPY2 0x2c1 |
| @@ -856,6 +859,7 @@ struct input_keymap_entry { | |||
| 856 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ | 859 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ |
| 857 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ | 860 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ |
| 858 | #define SW_LINEIN_INSERT 0x0d /* set = inserted */ | 861 | #define SW_LINEIN_INSERT 0x0d /* set = inserted */ |
| 862 | #define SW_MUTE_DEVICE 0x0e /* set = device disabled */ | ||
| 859 | #define SW_MAX 0x0f | 863 | #define SW_MAX 0x0f |
| 860 | #define SW_CNT (SW_MAX+1) | 864 | #define SW_CNT (SW_MAX+1) |
| 861 | 865 | ||
diff --git a/include/uapi/linux/kexec.h b/include/uapi/linux/kexec.h index 104838f65bc1..d6629d49a243 100644 --- a/include/uapi/linux/kexec.h +++ b/include/uapi/linux/kexec.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | */ | 18 | */ |
| 19 | #define KEXEC_ARCH_DEFAULT ( 0 << 16) | 19 | #define KEXEC_ARCH_DEFAULT ( 0 << 16) |
| 20 | #define KEXEC_ARCH_386 ( 3 << 16) | 20 | #define KEXEC_ARCH_386 ( 3 << 16) |
| 21 | #define KEXEC_ARCH_68K ( 4 << 16) | ||
| 21 | #define KEXEC_ARCH_X86_64 (62 << 16) | 22 | #define KEXEC_ARCH_X86_64 (62 << 16) |
| 22 | #define KEXEC_ARCH_PPC (20 << 16) | 23 | #define KEXEC_ARCH_PPC (20 << 16) |
| 23 | #define KEXEC_ARCH_PPC64 (21 << 16) | 24 | #define KEXEC_ARCH_PPC64 (21 << 16) |
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 902f12461873..932d7f2637d6 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h | |||
| @@ -674,6 +674,7 @@ struct kvm_ppc_smmu_info { | |||
| 674 | #define KVM_CAP_ARM_EL1_32BIT 93 | 674 | #define KVM_CAP_ARM_EL1_32BIT 93 |
| 675 | #define KVM_CAP_SPAPR_MULTITCE 94 | 675 | #define KVM_CAP_SPAPR_MULTITCE 94 |
| 676 | #define KVM_CAP_EXT_EMUL_CPUID 95 | 676 | #define KVM_CAP_EXT_EMUL_CPUID 95 |
| 677 | #define KVM_CAP_HYPERV_TIME 96 | ||
| 677 | 678 | ||
| 678 | #ifdef KVM_CAP_IRQ_ROUTING | 679 | #ifdef KVM_CAP_IRQ_ROUTING |
| 679 | 680 | ||
| @@ -853,6 +854,7 @@ struct kvm_device_attr { | |||
| 853 | #define KVM_DEV_VFIO_GROUP 1 | 854 | #define KVM_DEV_VFIO_GROUP 1 |
| 854 | #define KVM_DEV_VFIO_GROUP_ADD 1 | 855 | #define KVM_DEV_VFIO_GROUP_ADD 1 |
| 855 | #define KVM_DEV_VFIO_GROUP_DEL 2 | 856 | #define KVM_DEV_VFIO_GROUP_DEL 2 |
| 857 | #define KVM_DEV_TYPE_ARM_VGIC_V2 5 | ||
| 856 | 858 | ||
| 857 | /* | 859 | /* |
| 858 | * ioctls for VM fds | 860 | * ioctls for VM fds |
diff --git a/include/uapi/linux/mic_common.h b/include/uapi/linux/mic_common.h index 17e7d95e4f53..6eb40244e019 100644 --- a/include/uapi/linux/mic_common.h +++ b/include/uapi/linux/mic_common.h | |||
| @@ -23,12 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | #include <linux/virtio_ring.h> | 24 | #include <linux/virtio_ring.h> |
| 25 | 25 | ||
| 26 | #ifndef __KERNEL__ | 26 | #define __mic_align(a, x) (((a) + (x) - 1) & ~((x) - 1)) |
| 27 | #define ALIGN(a, x) (((a) + (x) - 1) & ~((x) - 1)) | ||
| 28 | #define __aligned(x) __attribute__ ((aligned(x))) | ||
| 29 | #endif | ||
| 30 | |||
| 31 | #define mic_aligned_size(x) ALIGN(sizeof(x), 8) | ||
| 32 | 27 | ||
| 33 | /** | 28 | /** |
| 34 | * struct mic_device_desc: Virtio device information shared between the | 29 | * struct mic_device_desc: Virtio device information shared between the |
| @@ -48,8 +43,8 @@ struct mic_device_desc { | |||
| 48 | __u8 feature_len; | 43 | __u8 feature_len; |
| 49 | __u8 config_len; | 44 | __u8 config_len; |
| 50 | __u8 status; | 45 | __u8 status; |
| 51 | __u64 config[0]; | 46 | __le64 config[0]; |
| 52 | } __aligned(8); | 47 | } __attribute__ ((aligned(8))); |
| 53 | 48 | ||
| 54 | /** | 49 | /** |
| 55 | * struct mic_device_ctrl: Per virtio device information in the device page | 50 | * struct mic_device_ctrl: Per virtio device information in the device page |
| @@ -66,7 +61,7 @@ struct mic_device_desc { | |||
| 66 | * @h2c_vdev_db: The doorbell number to be used by host. Set by guest. | 61 | * @h2c_vdev_db: The doorbell number to be used by host. Set by guest. |
| 67 | */ | 62 | */ |
| 68 | struct mic_device_ctrl { | 63 | struct mic_device_ctrl { |
| 69 | __u64 vdev; | 64 | __le64 vdev; |
| 70 | __u8 config_change; | 65 | __u8 config_change; |
| 71 | __u8 vdev_reset; | 66 | __u8 vdev_reset; |
| 72 | __u8 guest_ack; | 67 | __u8 guest_ack; |
| @@ -74,7 +69,7 @@ struct mic_device_ctrl { | |||
| 74 | __u8 used_address_updated; | 69 | __u8 used_address_updated; |
| 75 | __s8 c2h_vdev_db; | 70 | __s8 c2h_vdev_db; |
| 76 | __s8 h2c_vdev_db; | 71 | __s8 h2c_vdev_db; |
| 77 | } __aligned(8); | 72 | } __attribute__ ((aligned(8))); |
| 78 | 73 | ||
| 79 | /** | 74 | /** |
| 80 | * struct mic_bootparam: Virtio device independent information in device page | 75 | * struct mic_bootparam: Virtio device independent information in device page |
| @@ -87,13 +82,13 @@ struct mic_device_ctrl { | |||
| 87 | * @shutdown_card: Set to 1 by the host when a card shutdown is initiated | 82 | * @shutdown_card: Set to 1 by the host when a card shutdown is initiated |
| 88 | */ | 83 | */ |
| 89 | struct mic_bootparam { | 84 | struct mic_bootparam { |
| 90 | __u32 magic; | 85 | __le32 magic; |
| 91 | __s8 c2h_shutdown_db; | 86 | __s8 c2h_shutdown_db; |
| 92 | __s8 h2c_shutdown_db; | 87 | __s8 h2c_shutdown_db; |
| 93 | __s8 h2c_config_db; | 88 | __s8 h2c_config_db; |
| 94 | __u8 shutdown_status; | 89 | __u8 shutdown_status; |
| 95 | __u8 shutdown_card; | 90 | __u8 shutdown_card; |
| 96 | } __aligned(8); | 91 | } __attribute__ ((aligned(8))); |
| 97 | 92 | ||
| 98 | /** | 93 | /** |
| 99 | * struct mic_device_page: High level representation of the device page | 94 | * struct mic_device_page: High level representation of the device page |
| @@ -116,10 +111,10 @@ struct mic_device_page { | |||
| 116 | * @num: The number of entries in the virtio_ring | 111 | * @num: The number of entries in the virtio_ring |
| 117 | */ | 112 | */ |
| 118 | struct mic_vqconfig { | 113 | struct mic_vqconfig { |
| 119 | __u64 address; | 114 | __le64 address; |
| 120 | __u64 used_address; | 115 | __le64 used_address; |
| 121 | __u16 num; | 116 | __le16 num; |
| 122 | } __aligned(8); | 117 | } __attribute__ ((aligned(8))); |
| 123 | 118 | ||
| 124 | /* | 119 | /* |
| 125 | * The alignment to use between consumer and producer parts of vring. | 120 | * The alignment to use between consumer and producer parts of vring. |
| @@ -154,7 +149,7 @@ struct mic_vqconfig { | |||
| 154 | */ | 149 | */ |
| 155 | struct _mic_vring_info { | 150 | struct _mic_vring_info { |
| 156 | __u16 avail_idx; | 151 | __u16 avail_idx; |
| 157 | int magic; | 152 | __le32 magic; |
| 158 | }; | 153 | }; |
| 159 | 154 | ||
| 160 | /** | 155 | /** |
| @@ -173,15 +168,13 @@ struct mic_vring { | |||
| 173 | int len; | 168 | int len; |
| 174 | }; | 169 | }; |
| 175 | 170 | ||
| 176 | #define mic_aligned_desc_size(d) ALIGN(mic_desc_size(d), 8) | 171 | #define mic_aligned_desc_size(d) __mic_align(mic_desc_size(d), 8) |
| 177 | 172 | ||
| 178 | #ifndef INTEL_MIC_CARD | 173 | #ifndef INTEL_MIC_CARD |
| 179 | static inline unsigned mic_desc_size(const struct mic_device_desc *desc) | 174 | static inline unsigned mic_desc_size(const struct mic_device_desc *desc) |
| 180 | { | 175 | { |
| 181 | return mic_aligned_size(*desc) | 176 | return sizeof(*desc) + desc->num_vq * sizeof(struct mic_vqconfig) |
| 182 | + desc->num_vq * mic_aligned_size(struct mic_vqconfig) | 177 | + desc->feature_len * 2 + desc->config_len; |
| 183 | + desc->feature_len * 2 | ||
| 184 | + desc->config_len; | ||
| 185 | } | 178 | } |
| 186 | 179 | ||
| 187 | static inline struct mic_vqconfig * | 180 | static inline struct mic_vqconfig * |
| @@ -201,8 +194,7 @@ static inline __u8 *mic_vq_configspace(const struct mic_device_desc *desc) | |||
| 201 | } | 194 | } |
| 202 | static inline unsigned mic_total_desc_size(struct mic_device_desc *desc) | 195 | static inline unsigned mic_total_desc_size(struct mic_device_desc *desc) |
| 203 | { | 196 | { |
| 204 | return mic_aligned_desc_size(desc) + | 197 | return mic_aligned_desc_size(desc) + sizeof(struct mic_device_ctrl); |
| 205 | mic_aligned_size(struct mic_device_ctrl); | ||
| 206 | } | 198 | } |
| 207 | #endif | 199 | #endif |
| 208 | 200 | ||
diff --git a/include/uapi/linux/neighbour.h b/include/uapi/linux/neighbour.h index f175212420ab..d3ef583104e0 100644 --- a/include/uapi/linux/neighbour.h +++ b/include/uapi/linux/neighbour.h | |||
| @@ -58,7 +58,7 @@ enum { | |||
| 58 | 58 | ||
| 59 | /* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change | 59 | /* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change |
| 60 | and make no address resolution or NUD. | 60 | and make no address resolution or NUD. |
| 61 | NUD_PERMANENT is also cannot be deleted by garbage collectors. | 61 | NUD_PERMANENT also cannot be deleted by garbage collectors. |
| 62 | */ | 62 | */ |
| 63 | 63 | ||
| 64 | struct nda_cacheinfo { | 64 | struct nda_cacheinfo { |
diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h index ae5df122e42f..f53879c0f590 100644 --- a/include/uapi/linux/net_tstamp.h +++ b/include/uapi/linux/net_tstamp.h | |||
| @@ -26,17 +26,17 @@ enum { | |||
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| 29 | * struct hwtstamp_config - %SIOCSHWTSTAMP parameter | 29 | * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter |
| 30 | * | 30 | * |
| 31 | * @flags: no flags defined right now, must be zero | 31 | * @flags: no flags defined right now, must be zero for %SIOCSHWTSTAMP |
| 32 | * @tx_type: one of HWTSTAMP_TX_* | 32 | * @tx_type: one of HWTSTAMP_TX_* |
| 33 | * @rx_type: one of one of HWTSTAMP_FILTER_* | 33 | * @rx_filter: one of HWTSTAMP_FILTER_* |
| 34 | * | 34 | * |
| 35 | * %SIOCSHWTSTAMP expects a &struct ifreq with a ifr_data pointer to | 35 | * %SIOCGHWTSTAMP and %SIOCSHWTSTAMP expect a &struct ifreq with a |
| 36 | * this structure. dev_ifsioc() in the kernel takes care of the | 36 | * ifr_data pointer to this structure. For %SIOCSHWTSTAMP, if the |
| 37 | * translation between 32 bit userspace and 64 bit kernel. The | 37 | * driver or hardware does not support the requested @rx_filter value, |
| 38 | * structure is intentionally chosen so that it has the same layout on | 38 | * the driver may use a more general filter mode. In this case |
| 39 | * 32 and 64 bit systems, don't break this! | 39 | * @rx_filter will indicate the actual mode on return. |
| 40 | */ | 40 | */ |
| 41 | struct hwtstamp_config { | 41 | struct hwtstamp_config { |
| 42 | int flags; | 42 | int flags; |
diff --git a/include/uapi/linux/netconf.h b/include/uapi/linux/netconf.h index 64804a798b0c..669a1f0b1d97 100644 --- a/include/uapi/linux/netconf.h +++ b/include/uapi/linux/netconf.h | |||
| @@ -14,6 +14,7 @@ enum { | |||
| 14 | NETCONFA_FORWARDING, | 14 | NETCONFA_FORWARDING, |
| 15 | NETCONFA_RP_FILTER, | 15 | NETCONFA_RP_FILTER, |
| 16 | NETCONFA_MC_FORWARDING, | 16 | NETCONFA_MC_FORWARDING, |
| 17 | NETCONFA_PROXY_NEIGH, | ||
| 17 | __NETCONFA_MAX | 18 | __NETCONFA_MAX |
| 18 | }; | 19 | }; |
| 19 | #define NETCONFA_MAX (__NETCONFA_MAX - 1) | 20 | #define NETCONFA_MAX (__NETCONFA_MAX - 1) |
diff --git a/include/uapi/linux/netfilter.h b/include/uapi/linux/netfilter.h index f7dc0ebeeba5..ef1b1f88ca18 100644 --- a/include/uapi/linux/netfilter.h +++ b/include/uapi/linux/netfilter.h | |||
| @@ -53,6 +53,7 @@ enum nf_inet_hooks { | |||
| 53 | 53 | ||
| 54 | enum { | 54 | enum { |
| 55 | NFPROTO_UNSPEC = 0, | 55 | NFPROTO_UNSPEC = 0, |
| 56 | NFPROTO_INET = 1, | ||
| 56 | NFPROTO_IPV4 = 2, | 57 | NFPROTO_IPV4 = 2, |
| 57 | NFPROTO_ARP = 3, | 58 | NFPROTO_ARP = 3, |
| 58 | NFPROTO_BRIDGE = 7, | 59 | NFPROTO_BRIDGE = 7, |
diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild index 17c3af2c4bb9..1d973d2ba417 100644 --- a/include/uapi/linux/netfilter/Kbuild +++ b/include/uapi/linux/netfilter/Kbuild | |||
| @@ -39,6 +39,7 @@ header-y += xt_TEE.h | |||
| 39 | header-y += xt_TPROXY.h | 39 | header-y += xt_TPROXY.h |
| 40 | header-y += xt_addrtype.h | 40 | header-y += xt_addrtype.h |
| 41 | header-y += xt_bpf.h | 41 | header-y += xt_bpf.h |
| 42 | header-y += xt_cgroup.h | ||
| 42 | header-y += xt_cluster.h | 43 | header-y += xt_cluster.h |
| 43 | header-y += xt_comment.h | 44 | header-y += xt_comment.h |
| 44 | header-y += xt_connbytes.h | 45 | header-y += xt_connbytes.h |
| @@ -54,8 +55,10 @@ header-y += xt_ecn.h | |||
| 54 | header-y += xt_esp.h | 55 | header-y += xt_esp.h |
| 55 | header-y += xt_hashlimit.h | 56 | header-y += xt_hashlimit.h |
| 56 | header-y += xt_helper.h | 57 | header-y += xt_helper.h |
| 58 | header-y += xt_ipcomp.h | ||
| 57 | header-y += xt_iprange.h | 59 | header-y += xt_iprange.h |
| 58 | header-y += xt_ipvs.h | 60 | header-y += xt_ipvs.h |
| 61 | header-y += xt_l2tp.h | ||
| 59 | header-y += xt_length.h | 62 | header-y += xt_length.h |
| 60 | header-y += xt_limit.h | 63 | header-y += xt_limit.h |
| 61 | header-y += xt_mac.h | 64 | header-y += xt_mac.h |
diff --git a/include/uapi/linux/netfilter/nf_nat.h b/include/uapi/linux/netfilter/nf_nat.h index bf0cc373ffb6..1ad3659102b6 100644 --- a/include/uapi/linux/netfilter/nf_nat.h +++ b/include/uapi/linux/netfilter/nf_nat.h | |||
| @@ -4,10 +4,14 @@ | |||
| 4 | #include <linux/netfilter.h> | 4 | #include <linux/netfilter.h> |
| 5 | #include <linux/netfilter/nf_conntrack_tuple_common.h> | 5 | #include <linux/netfilter/nf_conntrack_tuple_common.h> |
| 6 | 6 | ||
| 7 | #define NF_NAT_RANGE_MAP_IPS 1 | 7 | #define NF_NAT_RANGE_MAP_IPS (1 << 0) |
| 8 | #define NF_NAT_RANGE_PROTO_SPECIFIED 2 | 8 | #define NF_NAT_RANGE_PROTO_SPECIFIED (1 << 1) |
| 9 | #define NF_NAT_RANGE_PROTO_RANDOM 4 | 9 | #define NF_NAT_RANGE_PROTO_RANDOM (1 << 2) |
| 10 | #define NF_NAT_RANGE_PERSISTENT 8 | 10 | #define NF_NAT_RANGE_PERSISTENT (1 << 3) |
| 11 | #define NF_NAT_RANGE_PROTO_RANDOM_FULLY (1 << 4) | ||
| 12 | |||
| 13 | #define NF_NAT_RANGE_PROTO_RANDOM_ALL \ | ||
| 14 | (NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PROTO_RANDOM_FULLY) | ||
| 11 | 15 | ||
| 12 | struct nf_nat_ipv4_range { | 16 | struct nf_nat_ipv4_range { |
| 13 | unsigned int flags; | 17 | unsigned int flags; |
diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h index fbfd229a8e99..83c985a6170b 100644 --- a/include/uapi/linux/netfilter/nf_tables.h +++ b/include/uapi/linux/netfilter/nf_tables.h | |||
| @@ -110,11 +110,13 @@ enum nft_table_flags { | |||
| 110 | * | 110 | * |
| 111 | * @NFTA_TABLE_NAME: name of the table (NLA_STRING) | 111 | * @NFTA_TABLE_NAME: name of the table (NLA_STRING) |
| 112 | * @NFTA_TABLE_FLAGS: bitmask of enum nft_table_flags (NLA_U32) | 112 | * @NFTA_TABLE_FLAGS: bitmask of enum nft_table_flags (NLA_U32) |
| 113 | * @NFTA_TABLE_USE: number of chains in this table (NLA_U32) | ||
| 113 | */ | 114 | */ |
| 114 | enum nft_table_attributes { | 115 | enum nft_table_attributes { |
| 115 | NFTA_TABLE_UNSPEC, | 116 | NFTA_TABLE_UNSPEC, |
| 116 | NFTA_TABLE_NAME, | 117 | NFTA_TABLE_NAME, |
| 117 | NFTA_TABLE_FLAGS, | 118 | NFTA_TABLE_FLAGS, |
| 119 | NFTA_TABLE_USE, | ||
| 118 | __NFTA_TABLE_MAX | 120 | __NFTA_TABLE_MAX |
| 119 | }; | 121 | }; |
| 120 | #define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1) | 122 | #define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1) |
| @@ -529,6 +531,8 @@ enum nft_exthdr_attributes { | |||
| 529 | * @NFT_META_NFTRACE: packet nftrace bit | 531 | * @NFT_META_NFTRACE: packet nftrace bit |
| 530 | * @NFT_META_RTCLASSID: realm value of packet's route (skb->dst->tclassid) | 532 | * @NFT_META_RTCLASSID: realm value of packet's route (skb->dst->tclassid) |
| 531 | * @NFT_META_SECMARK: packet secmark (skb->secmark) | 533 | * @NFT_META_SECMARK: packet secmark (skb->secmark) |
| 534 | * @NFT_META_NFPROTO: netfilter protocol | ||
| 535 | * @NFT_META_L4PROTO: layer 4 protocol number | ||
| 532 | */ | 536 | */ |
| 533 | enum nft_meta_keys { | 537 | enum nft_meta_keys { |
| 534 | NFT_META_LEN, | 538 | NFT_META_LEN, |
| @@ -546,6 +550,8 @@ enum nft_meta_keys { | |||
| 546 | NFT_META_NFTRACE, | 550 | NFT_META_NFTRACE, |
| 547 | NFT_META_RTCLASSID, | 551 | NFT_META_RTCLASSID, |
| 548 | NFT_META_SECMARK, | 552 | NFT_META_SECMARK, |
| 553 | NFT_META_NFPROTO, | ||
| 554 | NFT_META_L4PROTO, | ||
| 549 | }; | 555 | }; |
| 550 | 556 | ||
| 551 | /** | 557 | /** |
| @@ -553,11 +559,13 @@ enum nft_meta_keys { | |||
| 553 | * | 559 | * |
| 554 | * @NFTA_META_DREG: destination register (NLA_U32) | 560 | * @NFTA_META_DREG: destination register (NLA_U32) |
| 555 | * @NFTA_META_KEY: meta data item to load (NLA_U32: nft_meta_keys) | 561 | * @NFTA_META_KEY: meta data item to load (NLA_U32: nft_meta_keys) |
| 562 | * @NFTA_META_SREG: source register (NLA_U32) | ||
| 556 | */ | 563 | */ |
| 557 | enum nft_meta_attributes { | 564 | enum nft_meta_attributes { |
| 558 | NFTA_META_UNSPEC, | 565 | NFTA_META_UNSPEC, |
| 559 | NFTA_META_DREG, | 566 | NFTA_META_DREG, |
| 560 | NFTA_META_KEY, | 567 | NFTA_META_KEY, |
| 568 | NFTA_META_SREG, | ||
| 561 | __NFTA_META_MAX | 569 | __NFTA_META_MAX |
| 562 | }; | 570 | }; |
| 563 | #define NFTA_META_MAX (__NFTA_META_MAX - 1) | 571 | #define NFTA_META_MAX (__NFTA_META_MAX - 1) |
| @@ -601,12 +609,14 @@ enum nft_ct_keys { | |||
| 601 | * @NFTA_CT_DREG: destination register (NLA_U32) | 609 | * @NFTA_CT_DREG: destination register (NLA_U32) |
| 602 | * @NFTA_CT_KEY: conntrack data item to load (NLA_U32: nft_ct_keys) | 610 | * @NFTA_CT_KEY: conntrack data item to load (NLA_U32: nft_ct_keys) |
| 603 | * @NFTA_CT_DIRECTION: direction in case of directional keys (NLA_U8) | 611 | * @NFTA_CT_DIRECTION: direction in case of directional keys (NLA_U8) |
| 612 | * @NFTA_CT_SREG: source register (NLA_U32) | ||
| 604 | */ | 613 | */ |
| 605 | enum nft_ct_attributes { | 614 | enum nft_ct_attributes { |
| 606 | NFTA_CT_UNSPEC, | 615 | NFTA_CT_UNSPEC, |
| 607 | NFTA_CT_DREG, | 616 | NFTA_CT_DREG, |
| 608 | NFTA_CT_KEY, | 617 | NFTA_CT_KEY, |
| 609 | NFTA_CT_DIRECTION, | 618 | NFTA_CT_DIRECTION, |
| 619 | NFTA_CT_SREG, | ||
| 610 | __NFTA_CT_MAX | 620 | __NFTA_CT_MAX |
| 611 | }; | 621 | }; |
| 612 | #define NFTA_CT_MAX (__NFTA_CT_MAX - 1) | 622 | #define NFTA_CT_MAX (__NFTA_CT_MAX - 1) |
| @@ -658,6 +668,26 @@ enum nft_log_attributes { | |||
| 658 | #define NFTA_LOG_MAX (__NFTA_LOG_MAX - 1) | 668 | #define NFTA_LOG_MAX (__NFTA_LOG_MAX - 1) |
| 659 | 669 | ||
| 660 | /** | 670 | /** |
| 671 | * enum nft_queue_attributes - nf_tables queue expression netlink attributes | ||
| 672 | * | ||
| 673 | * @NFTA_QUEUE_NUM: netlink queue to send messages to (NLA_U16) | ||
| 674 | * @NFTA_QUEUE_TOTAL: number of queues to load balance packets on (NLA_U16) | ||
| 675 | * @NFTA_QUEUE_FLAGS: various flags (NLA_U16) | ||
| 676 | */ | ||
| 677 | enum nft_queue_attributes { | ||
| 678 | NFTA_QUEUE_UNSPEC, | ||
| 679 | NFTA_QUEUE_NUM, | ||
| 680 | NFTA_QUEUE_TOTAL, | ||
| 681 | NFTA_QUEUE_FLAGS, | ||
| 682 | __NFTA_QUEUE_MAX | ||
| 683 | }; | ||
| 684 | #define NFTA_QUEUE_MAX (__NFTA_QUEUE_MAX - 1) | ||
| 685 | |||
| 686 | #define NFT_QUEUE_FLAG_BYPASS 0x01 /* for compatibility with v2 */ | ||
| 687 | #define NFT_QUEUE_FLAG_CPU_FANOUT 0x02 /* use current CPU (no hashing) */ | ||
| 688 | #define NFT_QUEUE_FLAG_MASK 0x03 | ||
| 689 | |||
| 690 | /** | ||
| 661 | * enum nft_reject_types - nf_tables reject expression reject types | 691 | * enum nft_reject_types - nf_tables reject expression reject types |
| 662 | * | 692 | * |
| 663 | * @NFT_REJECT_ICMP_UNREACH: reject using ICMP unreachable | 693 | * @NFT_REJECT_ICMP_UNREACH: reject using ICMP unreachable |
diff --git a/include/uapi/linux/netfilter/nfnetlink_queue.h b/include/uapi/linux/netfilter/nfnetlink_queue.h index 0132bad79de7..8dd819e2b5fe 100644 --- a/include/uapi/linux/netfilter/nfnetlink_queue.h +++ b/include/uapi/linux/netfilter/nfnetlink_queue.h | |||
| @@ -47,6 +47,8 @@ enum nfqnl_attr_type { | |||
| 47 | NFQA_CAP_LEN, /* __u32 length of captured packet */ | 47 | NFQA_CAP_LEN, /* __u32 length of captured packet */ |
| 48 | NFQA_SKB_INFO, /* __u32 skb meta information */ | 48 | NFQA_SKB_INFO, /* __u32 skb meta information */ |
| 49 | NFQA_EXP, /* nf_conntrack_netlink.h */ | 49 | NFQA_EXP, /* nf_conntrack_netlink.h */ |
| 50 | NFQA_UID, /* __u32 sk uid */ | ||
| 51 | NFQA_GID, /* __u32 sk gid */ | ||
| 50 | 52 | ||
| 51 | __NFQA_MAX | 53 | __NFQA_MAX |
| 52 | }; | 54 | }; |
| @@ -99,7 +101,8 @@ enum nfqnl_attr_config { | |||
| 99 | #define NFQA_CFG_F_FAIL_OPEN (1 << 0) | 101 | #define NFQA_CFG_F_FAIL_OPEN (1 << 0) |
| 100 | #define NFQA_CFG_F_CONNTRACK (1 << 1) | 102 | #define NFQA_CFG_F_CONNTRACK (1 << 1) |
| 101 | #define NFQA_CFG_F_GSO (1 << 2) | 103 | #define NFQA_CFG_F_GSO (1 << 2) |
| 102 | #define NFQA_CFG_F_MAX (1 << 3) | 104 | #define NFQA_CFG_F_UID_GID (1 << 3) |
| 105 | #define NFQA_CFG_F_MAX (1 << 4) | ||
| 103 | 106 | ||
| 104 | /* flags for NFQA_SKB_INFO */ | 107 | /* flags for NFQA_SKB_INFO */ |
| 105 | /* packet appears to have wrong checksums, but they are ok */ | 108 | /* packet appears to have wrong checksums, but they are ok */ |
diff --git a/include/uapi/linux/netfilter/xt_cgroup.h b/include/uapi/linux/netfilter/xt_cgroup.h new file mode 100644 index 000000000000..43acb7e175f6 --- /dev/null +++ b/include/uapi/linux/netfilter/xt_cgroup.h | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #ifndef _UAPI_XT_CGROUP_H | ||
| 2 | #define _UAPI_XT_CGROUP_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | struct xt_cgroup_info { | ||
| 7 | __u32 id; | ||
| 8 | __u32 invert; | ||
| 9 | }; | ||
| 10 | |||
| 11 | #endif /* _UAPI_XT_CGROUP_H */ | ||
diff --git a/include/uapi/linux/netfilter/xt_ipcomp.h b/include/uapi/linux/netfilter/xt_ipcomp.h new file mode 100644 index 000000000000..45c7e40eb8e1 --- /dev/null +++ b/include/uapi/linux/netfilter/xt_ipcomp.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #ifndef _XT_IPCOMP_H | ||
| 2 | #define _XT_IPCOMP_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | struct xt_ipcomp { | ||
| 7 | __u32 spis[2]; /* Security Parameter Index */ | ||
| 8 | __u8 invflags; /* Inverse flags */ | ||
| 9 | __u8 hdrres; /* Test of the Reserved Filed */ | ||
| 10 | }; | ||
| 11 | |||
| 12 | /* Values for "invflags" field in struct xt_ipcomp. */ | ||
| 13 | #define XT_IPCOMP_INV_SPI 0x01 /* Invert the sense of spi. */ | ||
| 14 | #define XT_IPCOMP_INV_MASK 0x01 /* All possible flags. */ | ||
| 15 | |||
| 16 | #endif /*_XT_IPCOMP_H*/ | ||
diff --git a/include/uapi/linux/netfilter/xt_l2tp.h b/include/uapi/linux/netfilter/xt_l2tp.h new file mode 100644 index 000000000000..7dccfa0acbfa --- /dev/null +++ b/include/uapi/linux/netfilter/xt_l2tp.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #ifndef _LINUX_NETFILTER_XT_L2TP_H | ||
| 2 | #define _LINUX_NETFILTER_XT_L2TP_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | enum xt_l2tp_type { | ||
| 7 | XT_L2TP_TYPE_CONTROL, | ||
| 8 | XT_L2TP_TYPE_DATA, | ||
| 9 | }; | ||
| 10 | |||
| 11 | /* L2TP matching stuff */ | ||
| 12 | struct xt_l2tp_info { | ||
| 13 | __u32 tid; /* tunnel id */ | ||
| 14 | __u32 sid; /* session id */ | ||
| 15 | __u8 version; /* L2TP protocol version */ | ||
| 16 | __u8 type; /* L2TP packet type */ | ||
| 17 | __u8 flags; /* which fields to match */ | ||
| 18 | }; | ||
| 19 | |||
| 20 | enum { | ||
| 21 | XT_L2TP_TID = (1 << 0), /* match L2TP tunnel id */ | ||
| 22 | XT_L2TP_SID = (1 << 1), /* match L2TP session id */ | ||
| 23 | XT_L2TP_VERSION = (1 << 2), /* match L2TP protocol version */ | ||
| 24 | XT_L2TP_TYPE = (1 << 3), /* match L2TP packet type */ | ||
| 25 | }; | ||
| 26 | |||
| 27 | #endif /* _LINUX_NETFILTER_XT_L2TP_H */ | ||
diff --git a/include/uapi/linux/netfilter/xt_osf.h b/include/uapi/linux/netfilter/xt_osf.h index 18afa495f973..5d66caeba3ee 100644 --- a/include/uapi/linux/netfilter/xt_osf.h +++ b/include/uapi/linux/netfilter/xt_osf.h | |||
| @@ -13,8 +13,7 @@ | |||
| 13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
| 14 | * | 14 | * |
| 15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 18 | */ | 17 | */ |
| 19 | 18 | ||
| 20 | #ifndef _XT_OSF_H | 19 | #ifndef _XT_OSF_H |
diff --git a/include/uapi/linux/netlink_diag.h b/include/uapi/linux/netlink_diag.h index 4e31db4eea41..f2159d30d1f5 100644 --- a/include/uapi/linux/netlink_diag.h +++ b/include/uapi/linux/netlink_diag.h | |||
| @@ -33,6 +33,7 @@ struct netlink_diag_ring { | |||
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | enum { | 35 | enum { |
| 36 | /* NETLINK_DIAG_NONE, standard nl API requires this attribute! */ | ||
| 36 | NETLINK_DIAG_MEMINFO, | 37 | NETLINK_DIAG_MEMINFO, |
| 37 | NETLINK_DIAG_GROUPS, | 38 | NETLINK_DIAG_GROUPS, |
| 38 | NETLINK_DIAG_RX_RING, | 39 | NETLINK_DIAG_RX_RING, |
diff --git a/include/uapi/linux/nfs4.h b/include/uapi/linux/nfs4.h index 788128ebac45..35f5f4c6c260 100644 --- a/include/uapi/linux/nfs4.h +++ b/include/uapi/linux/nfs4.h | |||
| @@ -150,7 +150,7 @@ | |||
| 150 | #define NFS4_SECINFO_STYLE4_CURRENT_FH 0 | 150 | #define NFS4_SECINFO_STYLE4_CURRENT_FH 0 |
| 151 | #define NFS4_SECINFO_STYLE4_PARENT 1 | 151 | #define NFS4_SECINFO_STYLE4_PARENT 1 |
| 152 | 152 | ||
| 153 | #define NFS4_MAX_UINT64 (~(u64)0) | 153 | #define NFS4_MAX_UINT64 (~(__u64)0) |
| 154 | 154 | ||
| 155 | /* An NFS4 sessions server must support at least NFS4_MAX_OPS operations. | 155 | /* An NFS4 sessions server must support at least NFS4_MAX_OPS operations. |
| 156 | * If a compound requires more operations, adjust NFS4_MAX_OPS accordingly. | 156 | * If a compound requires more operations, adjust NFS4_MAX_OPS accordingly. |
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index f752e9821e71..91054fd660e0 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
| @@ -581,7 +581,14 @@ | |||
| 581 | * operation, %NL80211_ATTR_MAC contains the peer MAC address, and | 581 | * operation, %NL80211_ATTR_MAC contains the peer MAC address, and |
| 582 | * %NL80211_ATTR_REASON_CODE the reason code to be used (only with | 582 | * %NL80211_ATTR_REASON_CODE the reason code to be used (only with |
| 583 | * %NL80211_TDLS_TEARDOWN). | 583 | * %NL80211_TDLS_TEARDOWN). |
| 584 | * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. | 584 | * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. The |
| 585 | * %NL80211_ATTR_TDLS_ACTION attribute determines the type of frame to be | ||
| 586 | * sent. Public Action codes (802.11-2012 8.1.5.1) will be sent as | ||
| 587 | * 802.11 management frames, while TDLS action codes (802.11-2012 | ||
| 588 | * 8.5.13.1) will be encapsulated and sent as data frames. The currently | ||
| 589 | * supported Public Action code is %WLAN_PUB_ACTION_TDLS_DISCOVER_RES | ||
| 590 | * and the currently supported TDLS actions codes are given in | ||
| 591 | * &enum ieee80211_tdls_actioncode. | ||
| 585 | * | 592 | * |
| 586 | * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP | 593 | * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP |
| 587 | * (or GO) interface (i.e. hostapd) to ask for unexpected frames to | 594 | * (or GO) interface (i.e. hostapd) to ask for unexpected frames to |
| @@ -686,6 +693,21 @@ | |||
| 686 | * other station that transmission must be blocked until the channel | 693 | * other station that transmission must be blocked until the channel |
| 687 | * switch is complete. | 694 | * switch is complete. |
| 688 | * | 695 | * |
| 696 | * @NL80211_CMD_VENDOR: Vendor-specified command/event. The command is specified | ||
| 697 | * by the %NL80211_ATTR_VENDOR_ID attribute and a sub-command in | ||
| 698 | * %NL80211_ATTR_VENDOR_SUBCMD. Parameter(s) can be transported in | ||
| 699 | * %NL80211_ATTR_VENDOR_DATA. | ||
| 700 | * For feature advertisement, the %NL80211_ATTR_VENDOR_DATA attribute is | ||
| 701 | * used in the wiphy data as a nested attribute containing descriptions | ||
| 702 | * (&struct nl80211_vendor_cmd_info) of the supported vendor commands. | ||
| 703 | * This may also be sent as an event with the same attributes. | ||
| 704 | * | ||
| 705 | * @NL80211_CMD_SET_QOS_MAP: Set Interworking QoS mapping for IP DSCP values. | ||
| 706 | * The QoS mapping information is included in %NL80211_ATTR_QOS_MAP. If | ||
| 707 | * that attribute is not included, QoS mapping is disabled. Since this | ||
| 708 | * QoS mapping is relevant for IP packets, it is only valid during an | ||
| 709 | * association. This is cleared on disassociation and AP restart. | ||
| 710 | * | ||
| 689 | * @NL80211_CMD_MAX: highest used command number | 711 | * @NL80211_CMD_MAX: highest used command number |
| 690 | * @__NL80211_CMD_AFTER_LAST: internal use | 712 | * @__NL80211_CMD_AFTER_LAST: internal use |
| 691 | */ | 713 | */ |
| @@ -853,6 +875,10 @@ enum nl80211_commands { | |||
| 853 | 875 | ||
| 854 | NL80211_CMD_CHANNEL_SWITCH, | 876 | NL80211_CMD_CHANNEL_SWITCH, |
| 855 | 877 | ||
| 878 | NL80211_CMD_VENDOR, | ||
| 879 | |||
| 880 | NL80211_CMD_SET_QOS_MAP, | ||
| 881 | |||
| 856 | /* add new commands above here */ | 882 | /* add new commands above here */ |
| 857 | 883 | ||
| 858 | /* used to define NL80211_CMD_MAX below */ | 884 | /* used to define NL80211_CMD_MAX below */ |
| @@ -1508,6 +1534,27 @@ enum nl80211_commands { | |||
| 1508 | * to react to radar events, e.g. initiate a channel switch or leave the | 1534 | * to react to radar events, e.g. initiate a channel switch or leave the |
| 1509 | * IBSS network. | 1535 | * IBSS network. |
| 1510 | * | 1536 | * |
| 1537 | * @NL80211_ATTR_SUPPORT_5_MHZ: A flag indicating that the device supports | ||
| 1538 | * 5 MHz channel bandwidth. | ||
| 1539 | * @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports | ||
| 1540 | * 10 MHz channel bandwidth. | ||
| 1541 | * | ||
| 1542 | * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode | ||
| 1543 | * Notification Element based on association request when used with | ||
| 1544 | * %NL80211_CMD_NEW_STATION; u8 attribute. | ||
| 1545 | * | ||
| 1546 | * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if | ||
| 1547 | * %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet) | ||
| 1548 | * @NL80211_ATTR_VENDOR_SUBCMD: vendor sub-command | ||
| 1549 | * @NL80211_ATTR_VENDOR_DATA: data for the vendor command, if any; this | ||
| 1550 | * attribute is also used for vendor command feature advertisement | ||
| 1551 | * @NL80211_ATTR_VENDOR_EVENTS: used for event list advertising in the wiphy | ||
| 1552 | * info, containing a nested array of possible events | ||
| 1553 | * | ||
| 1554 | * @NL80211_ATTR_QOS_MAP: IP DSCP mapping for Interworking QoS mapping. This | ||
| 1555 | * data is in the format defined for the payload of the QoS Map Set element | ||
| 1556 | * in IEEE Std 802.11-2012, 8.4.2.97. | ||
| 1557 | * | ||
| 1511 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1558 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 1512 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1559 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| 1513 | */ | 1560 | */ |
| @@ -1824,6 +1871,18 @@ enum nl80211_attrs { | |||
| 1824 | 1871 | ||
| 1825 | NL80211_ATTR_HANDLE_DFS, | 1872 | NL80211_ATTR_HANDLE_DFS, |
| 1826 | 1873 | ||
| 1874 | NL80211_ATTR_SUPPORT_5_MHZ, | ||
| 1875 | NL80211_ATTR_SUPPORT_10_MHZ, | ||
| 1876 | |||
| 1877 | NL80211_ATTR_OPMODE_NOTIF, | ||
| 1878 | |||
| 1879 | NL80211_ATTR_VENDOR_ID, | ||
| 1880 | NL80211_ATTR_VENDOR_SUBCMD, | ||
| 1881 | NL80211_ATTR_VENDOR_DATA, | ||
| 1882 | NL80211_ATTR_VENDOR_EVENTS, | ||
| 1883 | |||
| 1884 | NL80211_ATTR_QOS_MAP, | ||
| 1885 | |||
| 1827 | /* add attributes here, update the policy in nl80211.c */ | 1886 | /* add attributes here, update the policy in nl80211.c */ |
| 1828 | 1887 | ||
| 1829 | __NL80211_ATTR_AFTER_LAST, | 1888 | __NL80211_ATTR_AFTER_LAST, |
| @@ -2224,10 +2283,9 @@ enum nl80211_band_attr { | |||
| 2224 | * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz | 2283 | * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz |
| 2225 | * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current | 2284 | * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current |
| 2226 | * regulatory domain. | 2285 | * regulatory domain. |
| 2227 | * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is | 2286 | * @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation |
| 2228 | * permitted on this channel in current regulatory domain. | 2287 | * are permitted on this channel, this includes sending probe |
| 2229 | * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted | 2288 | * requests, or modes of operation that require beaconing. |
| 2230 | * on this channel in current regulatory domain. | ||
| 2231 | * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory | 2289 | * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory |
| 2232 | * on this channel in current regulatory domain. | 2290 | * on this channel in current regulatory domain. |
| 2233 | * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm | 2291 | * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm |
| @@ -2254,8 +2312,8 @@ enum nl80211_frequency_attr { | |||
| 2254 | __NL80211_FREQUENCY_ATTR_INVALID, | 2312 | __NL80211_FREQUENCY_ATTR_INVALID, |
| 2255 | NL80211_FREQUENCY_ATTR_FREQ, | 2313 | NL80211_FREQUENCY_ATTR_FREQ, |
| 2256 | NL80211_FREQUENCY_ATTR_DISABLED, | 2314 | NL80211_FREQUENCY_ATTR_DISABLED, |
| 2257 | NL80211_FREQUENCY_ATTR_PASSIVE_SCAN, | 2315 | NL80211_FREQUENCY_ATTR_NO_IR, |
| 2258 | NL80211_FREQUENCY_ATTR_NO_IBSS, | 2316 | __NL80211_FREQUENCY_ATTR_NO_IBSS, |
| 2259 | NL80211_FREQUENCY_ATTR_RADAR, | 2317 | NL80211_FREQUENCY_ATTR_RADAR, |
| 2260 | NL80211_FREQUENCY_ATTR_MAX_TX_POWER, | 2318 | NL80211_FREQUENCY_ATTR_MAX_TX_POWER, |
| 2261 | NL80211_FREQUENCY_ATTR_DFS_STATE, | 2319 | NL80211_FREQUENCY_ATTR_DFS_STATE, |
| @@ -2271,6 +2329,9 @@ enum nl80211_frequency_attr { | |||
| 2271 | }; | 2329 | }; |
| 2272 | 2330 | ||
| 2273 | #define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER | 2331 | #define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER |
| 2332 | #define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR | ||
| 2333 | #define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR | ||
| 2334 | #define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR | ||
| 2274 | 2335 | ||
| 2275 | /** | 2336 | /** |
| 2276 | * enum nl80211_bitrate_attr - bitrate attributes | 2337 | * enum nl80211_bitrate_attr - bitrate attributes |
| @@ -2413,8 +2474,9 @@ enum nl80211_sched_scan_match_attr { | |||
| 2413 | * @NL80211_RRF_DFS: DFS support is required to be used | 2474 | * @NL80211_RRF_DFS: DFS support is required to be used |
| 2414 | * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links | 2475 | * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links |
| 2415 | * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links | 2476 | * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links |
| 2416 | * @NL80211_RRF_PASSIVE_SCAN: passive scan is required | 2477 | * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed, |
| 2417 | * @NL80211_RRF_NO_IBSS: no IBSS is allowed | 2478 | * this includes probe requests or modes of operation that require |
| 2479 | * beaconing. | ||
| 2418 | */ | 2480 | */ |
| 2419 | enum nl80211_reg_rule_flags { | 2481 | enum nl80211_reg_rule_flags { |
| 2420 | NL80211_RRF_NO_OFDM = 1<<0, | 2482 | NL80211_RRF_NO_OFDM = 1<<0, |
| @@ -2424,10 +2486,17 @@ enum nl80211_reg_rule_flags { | |||
| 2424 | NL80211_RRF_DFS = 1<<4, | 2486 | NL80211_RRF_DFS = 1<<4, |
| 2425 | NL80211_RRF_PTP_ONLY = 1<<5, | 2487 | NL80211_RRF_PTP_ONLY = 1<<5, |
| 2426 | NL80211_RRF_PTMP_ONLY = 1<<6, | 2488 | NL80211_RRF_PTMP_ONLY = 1<<6, |
| 2427 | NL80211_RRF_PASSIVE_SCAN = 1<<7, | 2489 | NL80211_RRF_NO_IR = 1<<7, |
| 2428 | NL80211_RRF_NO_IBSS = 1<<8, | 2490 | __NL80211_RRF_NO_IBSS = 1<<8, |
| 2429 | }; | 2491 | }; |
| 2430 | 2492 | ||
| 2493 | #define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR | ||
| 2494 | #define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR | ||
| 2495 | #define NL80211_RRF_NO_IR NL80211_RRF_NO_IR | ||
| 2496 | |||
| 2497 | /* For backport compatibility with older userspace */ | ||
| 2498 | #define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS) | ||
| 2499 | |||
| 2431 | /** | 2500 | /** |
| 2432 | * enum nl80211_dfs_regions - regulatory DFS regions | 2501 | * enum nl80211_dfs_regions - regulatory DFS regions |
| 2433 | * | 2502 | * |
| @@ -3058,21 +3127,35 @@ enum nl80211_key_attributes { | |||
| 3058 | * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with | 3127 | * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with |
| 3059 | * 1 = 500 kbps) but without the IE length restriction (at most | 3128 | * 1 = 500 kbps) but without the IE length restriction (at most |
| 3060 | * %NL80211_MAX_SUPP_RATES in a single array). | 3129 | * %NL80211_MAX_SUPP_RATES in a single array). |
| 3061 | * @NL80211_TXRATE_MCS: HT (MCS) rates allowed for TX rate selection | 3130 | * @NL80211_TXRATE_HT: HT (MCS) rates allowed for TX rate selection |
| 3062 | * in an array of MCS numbers. | 3131 | * in an array of MCS numbers. |
| 3132 | * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection, | ||
| 3133 | * see &struct nl80211_txrate_vht | ||
| 3063 | * @__NL80211_TXRATE_AFTER_LAST: internal | 3134 | * @__NL80211_TXRATE_AFTER_LAST: internal |
| 3064 | * @NL80211_TXRATE_MAX: highest TX rate attribute | 3135 | * @NL80211_TXRATE_MAX: highest TX rate attribute |
| 3065 | */ | 3136 | */ |
| 3066 | enum nl80211_tx_rate_attributes { | 3137 | enum nl80211_tx_rate_attributes { |
| 3067 | __NL80211_TXRATE_INVALID, | 3138 | __NL80211_TXRATE_INVALID, |
| 3068 | NL80211_TXRATE_LEGACY, | 3139 | NL80211_TXRATE_LEGACY, |
| 3069 | NL80211_TXRATE_MCS, | 3140 | NL80211_TXRATE_HT, |
| 3141 | NL80211_TXRATE_VHT, | ||
| 3070 | 3142 | ||
| 3071 | /* keep last */ | 3143 | /* keep last */ |
| 3072 | __NL80211_TXRATE_AFTER_LAST, | 3144 | __NL80211_TXRATE_AFTER_LAST, |
| 3073 | NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1 | 3145 | NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1 |
| 3074 | }; | 3146 | }; |
| 3075 | 3147 | ||
| 3148 | #define NL80211_TXRATE_MCS NL80211_TXRATE_HT | ||
| 3149 | #define NL80211_VHT_NSS_MAX 8 | ||
| 3150 | |||
| 3151 | /** | ||
| 3152 | * struct nl80211_txrate_vht - VHT MCS/NSS txrate bitmap | ||
| 3153 | * @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.) | ||
| 3154 | */ | ||
| 3155 | struct nl80211_txrate_vht { | ||
| 3156 | __u16 mcs[NL80211_VHT_NSS_MAX]; | ||
| 3157 | }; | ||
| 3158 | |||
| 3076 | /** | 3159 | /** |
| 3077 | * enum nl80211_band - Frequency band | 3160 | * enum nl80211_band - Frequency band |
| 3078 | * @NL80211_BAND_2GHZ: 2.4 GHz ISM band | 3161 | * @NL80211_BAND_2GHZ: 2.4 GHz ISM band |
| @@ -3934,4 +4017,24 @@ enum nl80211_rxmgmt_flags { | |||
| 3934 | NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0, | 4017 | NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0, |
| 3935 | }; | 4018 | }; |
| 3936 | 4019 | ||
| 4020 | /* | ||
| 4021 | * If this flag is unset, the lower 24 bits are an OUI, if set | ||
| 4022 | * a Linux nl80211 vendor ID is used (no such IDs are allocated | ||
| 4023 | * yet, so that's not valid so far) | ||
| 4024 | */ | ||
| 4025 | #define NL80211_VENDOR_ID_IS_LINUX 0x80000000 | ||
| 4026 | |||
| 4027 | /** | ||
| 4028 | * struct nl80211_vendor_cmd_info - vendor command data | ||
| 4029 | * @vendor_id: If the %NL80211_VENDOR_ID_IS_LINUX flag is clear, then the | ||
| 4030 | * value is a 24-bit OUI; if it is set then a separately allocated ID | ||
| 4031 | * may be used, but no such IDs are allocated yet. New IDs should be | ||
| 4032 | * added to this file when needed. | ||
| 4033 | * @subcmd: sub-command ID for the command | ||
| 4034 | */ | ||
| 4035 | struct nl80211_vendor_cmd_info { | ||
| 4036 | __u32 vendor_id; | ||
| 4037 | __u32 subcmd; | ||
| 4038 | }; | ||
| 4039 | |||
| 3937 | #endif /* __LINUX_NL80211_H */ | 4040 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h index d120f9fe0017..970553cbbc8e 100644 --- a/include/uapi/linux/openvswitch.h +++ b/include/uapi/linux/openvswitch.h | |||
| @@ -40,7 +40,15 @@ struct ovs_header { | |||
| 40 | 40 | ||
| 41 | #define OVS_DATAPATH_FAMILY "ovs_datapath" | 41 | #define OVS_DATAPATH_FAMILY "ovs_datapath" |
| 42 | #define OVS_DATAPATH_MCGROUP "ovs_datapath" | 42 | #define OVS_DATAPATH_MCGROUP "ovs_datapath" |
| 43 | #define OVS_DATAPATH_VERSION 0x1 | 43 | |
| 44 | /* V2: | ||
| 45 | * - API users are expected to provide OVS_DP_ATTR_USER_FEATURES | ||
| 46 | * when creating the datapath. | ||
| 47 | */ | ||
| 48 | #define OVS_DATAPATH_VERSION 2 | ||
| 49 | |||
| 50 | /* First OVS datapath version to support features */ | ||
| 51 | #define OVS_DP_VER_FEATURES 2 | ||
| 44 | 52 | ||
| 45 | enum ovs_datapath_cmd { | 53 | enum ovs_datapath_cmd { |
| 46 | OVS_DP_CMD_UNSPEC, | 54 | OVS_DP_CMD_UNSPEC, |
| @@ -75,6 +83,7 @@ enum ovs_datapath_attr { | |||
| 75 | OVS_DP_ATTR_UPCALL_PID, /* Netlink PID to receive upcalls */ | 83 | OVS_DP_ATTR_UPCALL_PID, /* Netlink PID to receive upcalls */ |
| 76 | OVS_DP_ATTR_STATS, /* struct ovs_dp_stats */ | 84 | OVS_DP_ATTR_STATS, /* struct ovs_dp_stats */ |
| 77 | OVS_DP_ATTR_MEGAFLOW_STATS, /* struct ovs_dp_megaflow_stats */ | 85 | OVS_DP_ATTR_MEGAFLOW_STATS, /* struct ovs_dp_megaflow_stats */ |
| 86 | OVS_DP_ATTR_USER_FEATURES, /* OVS_DP_F_* */ | ||
| 78 | __OVS_DP_ATTR_MAX | 87 | __OVS_DP_ATTR_MAX |
| 79 | }; | 88 | }; |
| 80 | 89 | ||
| @@ -106,6 +115,9 @@ struct ovs_vport_stats { | |||
| 106 | __u64 tx_dropped; /* no space available in linux */ | 115 | __u64 tx_dropped; /* no space available in linux */ |
| 107 | }; | 116 | }; |
| 108 | 117 | ||
| 118 | /* Allow last Netlink attribute to be unaligned */ | ||
| 119 | #define OVS_DP_F_UNALIGNED (1 << 0) | ||
| 120 | |||
| 109 | /* Fixed logical ports. */ | 121 | /* Fixed logical ports. */ |
| 110 | #define OVSP_LOCAL ((__u32)0) | 122 | #define OVSP_LOCAL ((__u32)0) |
| 111 | 123 | ||
diff --git a/include/uapi/linux/packet_diag.h b/include/uapi/linux/packet_diag.h index b2cc0cd9c4d9..d08c63f3dd6f 100644 --- a/include/uapi/linux/packet_diag.h +++ b/include/uapi/linux/packet_diag.h | |||
| @@ -29,6 +29,7 @@ struct packet_diag_msg { | |||
| 29 | }; | 29 | }; |
| 30 | 30 | ||
| 31 | enum { | 31 | enum { |
| 32 | /* PACKET_DIAG_NONE, standard nl API requires this attribute! */ | ||
| 32 | PACKET_DIAG_INFO, | 33 | PACKET_DIAG_INFO, |
| 33 | PACKET_DIAG_MCLIST, | 34 | PACKET_DIAG_MCLIST, |
| 34 | PACKET_DIAG_RX_RING, | 35 | PACKET_DIAG_RX_RING, |
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index 4a98e85438a7..30db069bce62 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h | |||
| @@ -489,7 +489,12 @@ | |||
| 489 | #define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */ | 489 | #define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */ |
| 490 | #define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */ | 490 | #define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */ |
| 491 | #define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */ | 491 | #define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */ |
| 492 | #define PCI_EXP_LNKSTA_CLS_8_0GB 0x0003 /* Current Link Speed 8.0GT/s */ | ||
| 492 | #define PCI_EXP_LNKSTA_NLW 0x03f0 /* Negotiated Link Width */ | 493 | #define PCI_EXP_LNKSTA_NLW 0x03f0 /* Negotiated Link Width */ |
| 494 | #define PCI_EXP_LNKSTA_NLW_X1 0x0010 /* Current Link Width x1 */ | ||
| 495 | #define PCI_EXP_LNKSTA_NLW_X2 0x0020 /* Current Link Width x2 */ | ||
| 496 | #define PCI_EXP_LNKSTA_NLW_X4 0x0040 /* Current Link Width x4 */ | ||
| 497 | #define PCI_EXP_LNKSTA_NLW_X8 0x0080 /* Current Link Width x8 */ | ||
| 493 | #define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */ | 498 | #define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */ |
| 494 | #define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */ | 499 | #define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */ |
| 495 | #define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */ | 500 | #define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */ |
| @@ -518,8 +523,16 @@ | |||
| 518 | #define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */ | 523 | #define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */ |
| 519 | #define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */ | 524 | #define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */ |
| 520 | #define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */ | 525 | #define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */ |
| 526 | #define PCI_EXP_SLTCTL_ATTN_IND_ON 0x0040 /* Attention Indicator on */ | ||
| 527 | #define PCI_EXP_SLTCTL_ATTN_IND_BLINK 0x0080 /* Attention Indicator blinking */ | ||
| 528 | #define PCI_EXP_SLTCTL_ATTN_IND_OFF 0x00c0 /* Attention Indicator off */ | ||
| 521 | #define PCI_EXP_SLTCTL_PIC 0x0300 /* Power Indicator Control */ | 529 | #define PCI_EXP_SLTCTL_PIC 0x0300 /* Power Indicator Control */ |
| 530 | #define PCI_EXP_SLTCTL_PWR_IND_ON 0x0100 /* Power Indicator on */ | ||
| 531 | #define PCI_EXP_SLTCTL_PWR_IND_BLINK 0x0200 /* Power Indicator blinking */ | ||
| 532 | #define PCI_EXP_SLTCTL_PWR_IND_OFF 0x0300 /* Power Indicator off */ | ||
| 522 | #define PCI_EXP_SLTCTL_PCC 0x0400 /* Power Controller Control */ | 533 | #define PCI_EXP_SLTCTL_PCC 0x0400 /* Power Controller Control */ |
| 534 | #define PCI_EXP_SLTCTL_PWR_ON 0x0000 /* Power On */ | ||
| 535 | #define PCI_EXP_SLTCTL_PWR_OFF 0x0400 /* Power Off */ | ||
| 523 | #define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */ | 536 | #define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */ |
| 524 | #define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */ | 537 | #define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */ |
| 525 | #define PCI_EXP_SLTSTA 26 /* Slot Status */ | 538 | #define PCI_EXP_SLTSTA 26 /* Slot Status */ |
| @@ -677,17 +690,34 @@ | |||
| 677 | #define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */ | 690 | #define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */ |
| 678 | 691 | ||
| 679 | /* Virtual Channel */ | 692 | /* Virtual Channel */ |
| 680 | #define PCI_VC_PORT_REG1 4 | 693 | #define PCI_VC_PORT_CAP1 4 |
| 681 | #define PCI_VC_REG1_EVCC 0x7 /* extended VC count */ | 694 | #define PCI_VC_CAP1_EVCC 0x00000007 /* extended VC count */ |
| 682 | #define PCI_VC_PORT_REG2 8 | 695 | #define PCI_VC_CAP1_LPEVCC 0x00000070 /* low prio extended VC count */ |
| 683 | #define PCI_VC_REG2_32_PHASE 0x2 | 696 | #define PCI_VC_CAP1_ARB_SIZE 0x00000c00 |
| 684 | #define PCI_VC_REG2_64_PHASE 0x4 | 697 | #define PCI_VC_PORT_CAP2 8 |
| 685 | #define PCI_VC_REG2_128_PHASE 0x8 | 698 | #define PCI_VC_CAP2_32_PHASE 0x00000002 |
| 699 | #define PCI_VC_CAP2_64_PHASE 0x00000004 | ||
| 700 | #define PCI_VC_CAP2_128_PHASE 0x00000008 | ||
| 701 | #define PCI_VC_CAP2_ARB_OFF 0xff000000 | ||
| 686 | #define PCI_VC_PORT_CTRL 12 | 702 | #define PCI_VC_PORT_CTRL 12 |
| 703 | #define PCI_VC_PORT_CTRL_LOAD_TABLE 0x00000001 | ||
| 687 | #define PCI_VC_PORT_STATUS 14 | 704 | #define PCI_VC_PORT_STATUS 14 |
| 705 | #define PCI_VC_PORT_STATUS_TABLE 0x00000001 | ||
| 688 | #define PCI_VC_RES_CAP 16 | 706 | #define PCI_VC_RES_CAP 16 |
| 707 | #define PCI_VC_RES_CAP_32_PHASE 0x00000002 | ||
| 708 | #define PCI_VC_RES_CAP_64_PHASE 0x00000004 | ||
| 709 | #define PCI_VC_RES_CAP_128_PHASE 0x00000008 | ||
| 710 | #define PCI_VC_RES_CAP_128_PHASE_TB 0x00000010 | ||
| 711 | #define PCI_VC_RES_CAP_256_PHASE 0x00000020 | ||
| 712 | #define PCI_VC_RES_CAP_ARB_OFF 0xff000000 | ||
| 689 | #define PCI_VC_RES_CTRL 20 | 713 | #define PCI_VC_RES_CTRL 20 |
| 714 | #define PCI_VC_RES_CTRL_LOAD_TABLE 0x00010000 | ||
| 715 | #define PCI_VC_RES_CTRL_ARB_SELECT 0x000e0000 | ||
| 716 | #define PCI_VC_RES_CTRL_ID 0x07000000 | ||
| 717 | #define PCI_VC_RES_CTRL_ENABLE 0x80000000 | ||
| 690 | #define PCI_VC_RES_STATUS 26 | 718 | #define PCI_VC_RES_STATUS 26 |
| 719 | #define PCI_VC_RES_STATUS_TABLE 0x00000001 | ||
| 720 | #define PCI_VC_RES_STATUS_NEGO 0x00000002 | ||
| 691 | #define PCI_CAP_VC_BASE_SIZEOF 0x10 | 721 | #define PCI_CAP_VC_BASE_SIZEOF 0x10 |
| 692 | #define PCI_CAP_VC_PER_VC_SIZEOF 0x0C | 722 | #define PCI_CAP_VC_PER_VC_SIZEOF 0x0C |
| 693 | 723 | ||
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index e1802d6153ae..853bc1ccb395 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h | |||
| @@ -679,6 +679,7 @@ enum perf_event_type { | |||
| 679 | * | 679 | * |
| 680 | * { u64 weight; } && PERF_SAMPLE_WEIGHT | 680 | * { u64 weight; } && PERF_SAMPLE_WEIGHT |
| 681 | * { u64 data_src; } && PERF_SAMPLE_DATA_SRC | 681 | * { u64 data_src; } && PERF_SAMPLE_DATA_SRC |
| 682 | * { u64 transaction; } && PERF_SAMPLE_TRANSACTION | ||
| 682 | * }; | 683 | * }; |
| 683 | */ | 684 | */ |
| 684 | PERF_RECORD_SAMPLE = 9, | 685 | PERF_RECORD_SAMPLE = 9, |
| @@ -724,6 +725,7 @@ enum perf_callchain_context { | |||
| 724 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) | 725 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) |
| 725 | #define PERF_FLAG_FD_OUTPUT (1U << 1) | 726 | #define PERF_FLAG_FD_OUTPUT (1U << 1) |
| 726 | #define PERF_FLAG_PID_CGROUP (1U << 2) /* pid=cgroup id, per-cpu mode only */ | 727 | #define PERF_FLAG_PID_CGROUP (1U << 2) /* pid=cgroup id, per-cpu mode only */ |
| 728 | #define PERF_FLAG_FD_CLOEXEC (1U << 3) /* O_CLOEXEC */ | ||
| 727 | 729 | ||
| 728 | union perf_mem_data_src { | 730 | union perf_mem_data_src { |
| 729 | __u64 val; | 731 | __u64 val; |
| @@ -786,7 +788,7 @@ union perf_mem_data_src { | |||
| 786 | #define PERF_MEM_TLB_SHIFT 26 | 788 | #define PERF_MEM_TLB_SHIFT 26 |
| 787 | 789 | ||
| 788 | #define PERF_MEM_S(a, s) \ | 790 | #define PERF_MEM_S(a, s) \ |
| 789 | (((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT) | 791 | (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT) |
| 790 | 792 | ||
| 791 | /* | 793 | /* |
| 792 | * single taken branch record layout: | 794 | * single taken branch record layout: |
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h index a806687ad98f..d62316baae94 100644 --- a/include/uapi/linux/pkt_sched.h +++ b/include/uapi/linux/pkt_sched.h | |||
| @@ -173,6 +173,8 @@ enum { | |||
| 173 | TCA_TBF_PTAB, | 173 | TCA_TBF_PTAB, |
| 174 | TCA_TBF_RATE64, | 174 | TCA_TBF_RATE64, |
| 175 | TCA_TBF_PRATE64, | 175 | TCA_TBF_PRATE64, |
| 176 | TCA_TBF_BURST, | ||
| 177 | TCA_TBF_PBURST, | ||
| 176 | __TCA_TBF_MAX, | 178 | __TCA_TBF_MAX, |
| 177 | }; | 179 | }; |
| 178 | 180 | ||
| @@ -523,6 +525,7 @@ enum { | |||
| 523 | TCA_NETEM_LOSS, | 525 | TCA_NETEM_LOSS, |
| 524 | TCA_NETEM_RATE, | 526 | TCA_NETEM_RATE, |
| 525 | TCA_NETEM_ECN, | 527 | TCA_NETEM_ECN, |
| 528 | TCA_NETEM_RATE64, | ||
| 526 | __TCA_NETEM_MAX, | 529 | __TCA_NETEM_MAX, |
| 527 | }; | 530 | }; |
| 528 | 531 | ||
| @@ -790,4 +793,54 @@ struct tc_fq_qd_stats { | |||
| 790 | __u32 throttled_flows; | 793 | __u32 throttled_flows; |
| 791 | __u32 pad; | 794 | __u32 pad; |
| 792 | }; | 795 | }; |
| 796 | |||
| 797 | /* Heavy-Hitter Filter */ | ||
| 798 | |||
| 799 | enum { | ||
| 800 | TCA_HHF_UNSPEC, | ||
| 801 | TCA_HHF_BACKLOG_LIMIT, | ||
| 802 | TCA_HHF_QUANTUM, | ||
| 803 | TCA_HHF_HH_FLOWS_LIMIT, | ||
| 804 | TCA_HHF_RESET_TIMEOUT, | ||
| 805 | TCA_HHF_ADMIT_BYTES, | ||
| 806 | TCA_HHF_EVICT_TIMEOUT, | ||
| 807 | TCA_HHF_NON_HH_WEIGHT, | ||
| 808 | __TCA_HHF_MAX | ||
| 809 | }; | ||
| 810 | |||
| 811 | #define TCA_HHF_MAX (__TCA_HHF_MAX - 1) | ||
| 812 | |||
| 813 | struct tc_hhf_xstats { | ||
| 814 | __u32 drop_overlimit; /* number of times max qdisc packet limit | ||
| 815 | * was hit | ||
| 816 | */ | ||
| 817 | __u32 hh_overlimit; /* number of times max heavy-hitters was hit */ | ||
| 818 | __u32 hh_tot_count; /* number of captured heavy-hitters so far */ | ||
| 819 | __u32 hh_cur_count; /* number of current heavy-hitters */ | ||
| 820 | }; | ||
| 821 | |||
| 822 | /* PIE */ | ||
| 823 | enum { | ||
| 824 | TCA_PIE_UNSPEC, | ||
| 825 | TCA_PIE_TARGET, | ||
| 826 | TCA_PIE_LIMIT, | ||
| 827 | TCA_PIE_TUPDATE, | ||
| 828 | TCA_PIE_ALPHA, | ||
| 829 | TCA_PIE_BETA, | ||
| 830 | TCA_PIE_ECN, | ||
| 831 | TCA_PIE_BYTEMODE, | ||
| 832 | __TCA_PIE_MAX | ||
| 833 | }; | ||
| 834 | #define TCA_PIE_MAX (__TCA_PIE_MAX - 1) | ||
| 835 | |||
| 836 | struct tc_pie_xstats { | ||
| 837 | __u32 prob; /* current probability */ | ||
| 838 | __u32 delay; /* current delay in ms */ | ||
| 839 | __u32 avg_dq_rate; /* current average dq_rate in bits/pie_time */ | ||
| 840 | __u32 packets_in; /* total number of packets enqueued */ | ||
| 841 | __u32 dropped; /* packets dropped due to pie_action */ | ||
| 842 | __u32 overlimit; /* dropped due to lack of space in queue */ | ||
| 843 | __u32 maxq; /* maximum queue size */ | ||
| 844 | __u32 ecn_mark; /* packets marked with ecn*/ | ||
| 845 | }; | ||
| 793 | #endif | 846 | #endif |
diff --git a/include/uapi/linux/ppp-ioctl.h b/include/uapi/linux/ppp-ioctl.h index 2d9a8859550a..63a23a3b8bb7 100644 --- a/include/uapi/linux/ppp-ioctl.h +++ b/include/uapi/linux/ppp-ioctl.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 14 | #include <linux/compiler.h> | 14 | #include <linux/compiler.h> |
| 15 | #include <linux/ppp_defs.h> | ||
| 15 | 16 | ||
| 16 | /* | 17 | /* |
| 17 | * Bit definitions for flags argument to PPPIOCGFLAGS/PPPIOCSFLAGS. | 18 | * Bit definitions for flags argument to PPPIOCGFLAGS/PPPIOCSFLAGS. |
diff --git a/include/uapi/linux/raid/md_p.h b/include/uapi/linux/raid/md_p.h index f7cf7f351144..49f4210d4394 100644 --- a/include/uapi/linux/raid/md_p.h +++ b/include/uapi/linux/raid/md_p.h | |||
| @@ -292,6 +292,9 @@ struct mdp_superblock_1 { | |||
| 292 | * backwards anyway. | 292 | * backwards anyway. |
| 293 | */ | 293 | */ |
| 294 | #define MD_FEATURE_NEW_OFFSET 64 /* new_offset must be honoured */ | 294 | #define MD_FEATURE_NEW_OFFSET 64 /* new_offset must be honoured */ |
| 295 | #define MD_FEATURE_RECOVERY_BITMAP 128 /* recovery that is happening | ||
| 296 | * is guided by bitmap. | ||
| 297 | */ | ||
| 295 | #define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \ | 298 | #define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \ |
| 296 | |MD_FEATURE_RECOVERY_OFFSET \ | 299 | |MD_FEATURE_RECOVERY_OFFSET \ |
| 297 | |MD_FEATURE_RESHAPE_ACTIVE \ | 300 | |MD_FEATURE_RESHAPE_ACTIVE \ |
| @@ -299,6 +302,7 @@ struct mdp_superblock_1 { | |||
| 299 | |MD_FEATURE_REPLACEMENT \ | 302 | |MD_FEATURE_REPLACEMENT \ |
| 300 | |MD_FEATURE_RESHAPE_BACKWARDS \ | 303 | |MD_FEATURE_RESHAPE_BACKWARDS \ |
| 301 | |MD_FEATURE_NEW_OFFSET \ | 304 | |MD_FEATURE_NEW_OFFSET \ |
| 305 | |MD_FEATURE_RECOVERY_BITMAP \ | ||
| 302 | ) | 306 | ) |
| 303 | 307 | ||
| 304 | #endif | 308 | #endif |
diff --git a/include/uapi/linux/sched.h b/include/uapi/linux/sched.h index 5a0f945927ac..34f9d7387d13 100644 --- a/include/uapi/linux/sched.h +++ b/include/uapi/linux/sched.h | |||
| @@ -39,8 +39,14 @@ | |||
| 39 | #define SCHED_BATCH 3 | 39 | #define SCHED_BATCH 3 |
| 40 | /* SCHED_ISO: reserved but not implemented yet */ | 40 | /* SCHED_ISO: reserved but not implemented yet */ |
| 41 | #define SCHED_IDLE 5 | 41 | #define SCHED_IDLE 5 |
| 42 | #define SCHED_DEADLINE 6 | ||
| 43 | |||
| 42 | /* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */ | 44 | /* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */ |
| 43 | #define SCHED_RESET_ON_FORK 0x40000000 | 45 | #define SCHED_RESET_ON_FORK 0x40000000 |
| 44 | 46 | ||
| 47 | /* | ||
| 48 | * For the sched_{set,get}attr() calls | ||
| 49 | */ | ||
| 50 | #define SCHED_FLAG_RESET_ON_FORK 0x01 | ||
| 45 | 51 | ||
| 46 | #endif /* _UAPI_LINUX_SCHED_H */ | 52 | #endif /* _UAPI_LINUX_SCHED_H */ |
diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h index ca451e99b28b..266022a2be4a 100644 --- a/include/uapi/linux/sctp.h +++ b/include/uapi/linux/sctp.h | |||
| @@ -22,9 +22,8 @@ | |||
| 22 | * See the GNU General Public License for more details. | 22 | * See the GNU General Public License for more details. |
| 23 | * | 23 | * |
| 24 | * You should have received a copy of the GNU General Public License | 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with GNU CC; see the file COPYING. If not, write to | 25 | * along with GNU CC; see the file COPYING. If not, see |
| 26 | * the Free Software Foundation, 59 Temple Place - Suite 330, | 26 | * <http://www.gnu.org/licenses/>. |
| 27 | * Boston, MA 02111-1307, USA. | ||
| 28 | * | 27 | * |
| 29 | * Please send any bug reports or fixes you make to the | 28 | * Please send any bug reports or fixes you make to the |
| 30 | * email address(es): | 29 | * email address(es): |
diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h index 1bdb4a39d1e1..bbaba22f2d1b 100644 --- a/include/uapi/linux/snmp.h +++ b/include/uapi/linux/snmp.h | |||
| @@ -258,6 +258,7 @@ enum | |||
| 258 | LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */ | 258 | LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */ |
| 259 | LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */ | 259 | LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */ |
| 260 | LINUX_MIB_BUSYPOLLRXPACKETS, /* BusyPollRxPackets */ | 260 | LINUX_MIB_BUSYPOLLRXPACKETS, /* BusyPollRxPackets */ |
| 261 | LINUX_MIB_TCPAUTOCORKING, /* TCPAutoCorking */ | ||
| 261 | __LINUX_MIB_MAX | 262 | __LINUX_MIB_MAX |
| 262 | }; | 263 | }; |
| 263 | 264 | ||
diff --git a/include/uapi/linux/sockios.h b/include/uapi/linux/sockios.h index 7997a506ad41..e888b1aed69f 100644 --- a/include/uapi/linux/sockios.h +++ b/include/uapi/linux/sockios.h | |||
| @@ -125,7 +125,8 @@ | |||
| 125 | #define SIOCBRDELIF 0x89a3 /* remove interface from bridge */ | 125 | #define SIOCBRDELIF 0x89a3 /* remove interface from bridge */ |
| 126 | 126 | ||
| 127 | /* hardware time stamping: parameters in linux/net_tstamp.h */ | 127 | /* hardware time stamping: parameters in linux/net_tstamp.h */ |
| 128 | #define SIOCSHWTSTAMP 0x89b0 | 128 | #define SIOCSHWTSTAMP 0x89b0 /* set and get config */ |
| 129 | #define SIOCGHWTSTAMP 0x89b1 /* get config */ | ||
| 129 | 130 | ||
| 130 | /* Device private ioctl calls */ | 131 | /* Device private ioctl calls */ |
| 131 | 132 | ||
diff --git a/include/uapi/linux/tc_act/tc_ipt.h b/include/uapi/linux/tc_act/tc_ipt.h index a2335563d21f..130aaadf6fac 100644 --- a/include/uapi/linux/tc_act/tc_ipt.h +++ b/include/uapi/linux/tc_act/tc_ipt.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <linux/pkt_cls.h> | 4 | #include <linux/pkt_cls.h> |
| 5 | 5 | ||
| 6 | #define TCA_ACT_IPT 6 | 6 | #define TCA_ACT_IPT 6 |
| 7 | #define TCA_ACT_XT 10 | ||
| 7 | 8 | ||
| 8 | enum { | 9 | enum { |
| 9 | TCA_IPT_UNSPEC, | 10 | TCA_IPT_UNSPEC, |
diff --git a/include/uapi/linux/tcp_metrics.h b/include/uapi/linux/tcp_metrics.h index cb5157b55f32..54a37b13f2c4 100644 --- a/include/uapi/linux/tcp_metrics.h +++ b/include/uapi/linux/tcp_metrics.h | |||
| @@ -35,6 +35,8 @@ enum { | |||
| 35 | TCP_METRICS_ATTR_FOPEN_SYN_DROPS, /* u16, count of drops */ | 35 | TCP_METRICS_ATTR_FOPEN_SYN_DROPS, /* u16, count of drops */ |
| 36 | TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS, /* msecs age */ | 36 | TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS, /* msecs age */ |
| 37 | TCP_METRICS_ATTR_FOPEN_COOKIE, /* binary */ | 37 | TCP_METRICS_ATTR_FOPEN_COOKIE, /* binary */ |
| 38 | TCP_METRICS_ATTR_SADDR_IPV4, /* u32 */ | ||
| 39 | TCP_METRICS_ATTR_SADDR_IPV6, /* binary */ | ||
| 38 | 40 | ||
| 39 | __TCP_METRICS_ATTR_MAX, | 41 | __TCP_METRICS_ATTR_MAX, |
| 40 | }; | 42 | }; |
diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h index b9e2a6a7446f..1eb0b8dd1830 100644 --- a/include/uapi/linux/unix_diag.h +++ b/include/uapi/linux/unix_diag.h | |||
| @@ -31,6 +31,7 @@ struct unix_diag_msg { | |||
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | enum { | 33 | enum { |
| 34 | /* UNIX_DIAG_NONE, standard nl API requires this attribute! */ | ||
| 34 | UNIX_DIAG_NAME, | 35 | UNIX_DIAG_NAME, |
| 35 | UNIX_DIAG_VFS, | 36 | UNIX_DIAG_VFS, |
| 36 | UNIX_DIAG_PEER, | 37 | UNIX_DIAG_PEER, |
diff --git a/include/uapi/linux/zorro.h b/include/uapi/linux/zorro.h new file mode 100644 index 000000000000..59d021b242ed --- /dev/null +++ b/include/uapi/linux/zorro.h | |||
| @@ -0,0 +1,113 @@ | |||
| 1 | /* | ||
| 2 | * linux/zorro.h -- Amiga AutoConfig (Zorro) Bus Definitions | ||
| 3 | * | ||
| 4 | * Copyright (C) 1995--2003 Geert Uytterhoeven | ||
| 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 _UAPI_LINUX_ZORRO_H | ||
| 12 | #define _UAPI_LINUX_ZORRO_H | ||
| 13 | |||
| 14 | #include <linux/types.h> | ||
| 15 | |||
| 16 | |||
| 17 | /* | ||
| 18 | * Each Zorro board has a 32-bit ID of the form | ||
| 19 | * | ||
| 20 | * mmmmmmmmmmmmmmmmppppppppeeeeeeee | ||
| 21 | * | ||
| 22 | * with | ||
| 23 | * | ||
| 24 | * mmmmmmmmmmmmmmmm 16-bit Manufacturer ID (assigned by CBM (sigh)) | ||
| 25 | * pppppppp 8-bit Product ID (assigned by manufacturer) | ||
| 26 | * eeeeeeee 8-bit Extended Product ID (currently only used | ||
| 27 | * for some GVP boards) | ||
| 28 | */ | ||
| 29 | |||
| 30 | |||
| 31 | #define ZORRO_MANUF(id) ((id) >> 16) | ||
| 32 | #define ZORRO_PROD(id) (((id) >> 8) & 0xff) | ||
| 33 | #define ZORRO_EPC(id) ((id) & 0xff) | ||
| 34 | |||
| 35 | #define ZORRO_ID(manuf, prod, epc) \ | ||
| 36 | ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc)) | ||
| 37 | |||
| 38 | typedef __u32 zorro_id; | ||
| 39 | |||
| 40 | |||
| 41 | /* Include the ID list */ | ||
| 42 | #include <linux/zorro_ids.h> | ||
| 43 | |||
| 44 | |||
| 45 | /* | ||
| 46 | * GVP identifies most of its products through the 'extended product code' | ||
| 47 | * (epc). The epc has to be ANDed with the GVP_PRODMASK before the | ||
| 48 | * identification. | ||
| 49 | */ | ||
| 50 | |||
| 51 | #define GVP_PRODMASK (0xf8) | ||
| 52 | #define GVP_SCSICLKMASK (0x01) | ||
| 53 | |||
| 54 | enum GVP_flags { | ||
| 55 | GVP_IO = 0x01, | ||
| 56 | GVP_ACCEL = 0x02, | ||
| 57 | GVP_SCSI = 0x04, | ||
| 58 | GVP_24BITDMA = 0x08, | ||
| 59 | GVP_25BITDMA = 0x10, | ||
| 60 | GVP_NOBANK = 0x20, | ||
| 61 | GVP_14MHZ = 0x40, | ||
| 62 | }; | ||
| 63 | |||
| 64 | |||
| 65 | struct Node { | ||
| 66 | __be32 ln_Succ; /* Pointer to next (successor) */ | ||
| 67 | __be32 ln_Pred; /* Pointer to previous (predecessor) */ | ||
| 68 | __u8 ln_Type; | ||
| 69 | __s8 ln_Pri; /* Priority, for sorting */ | ||
| 70 | __be32 ln_Name; /* ID string, null terminated */ | ||
| 71 | } __packed; | ||
| 72 | |||
| 73 | struct ExpansionRom { | ||
| 74 | /* -First 16 bytes of the expansion ROM */ | ||
| 75 | __u8 er_Type; /* Board type, size and flags */ | ||
| 76 | __u8 er_Product; /* Product number, assigned by manufacturer */ | ||
| 77 | __u8 er_Flags; /* Flags */ | ||
| 78 | __u8 er_Reserved03; /* Must be zero ($ff inverted) */ | ||
| 79 | __be16 er_Manufacturer; /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */ | ||
| 80 | __be32 er_SerialNumber; /* Available for use by manufacturer */ | ||
| 81 | __be16 er_InitDiagVec; /* Offset to optional "DiagArea" structure */ | ||
| 82 | __u8 er_Reserved0c; | ||
| 83 | __u8 er_Reserved0d; | ||
| 84 | __u8 er_Reserved0e; | ||
| 85 | __u8 er_Reserved0f; | ||
| 86 | } __packed; | ||
| 87 | |||
| 88 | /* er_Type board type bits */ | ||
| 89 | #define ERT_TYPEMASK 0xc0 | ||
| 90 | #define ERT_ZORROII 0xc0 | ||
| 91 | #define ERT_ZORROIII 0x80 | ||
| 92 | |||
| 93 | /* other bits defined in er_Type */ | ||
| 94 | #define ERTB_MEMLIST 5 /* Link RAM into free memory list */ | ||
| 95 | #define ERTF_MEMLIST (1<<5) | ||
| 96 | |||
| 97 | struct ConfigDev { | ||
| 98 | struct Node cd_Node; | ||
| 99 | __u8 cd_Flags; /* (read/write) */ | ||
| 100 | __u8 cd_Pad; /* reserved */ | ||
| 101 | struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */ | ||
| 102 | __be32 cd_BoardAddr; /* where in memory the board was placed */ | ||
| 103 | __be32 cd_BoardSize; /* size of board in bytes */ | ||
| 104 | __be16 cd_SlotAddr; /* which slot number (PRIVATE) */ | ||
| 105 | __be16 cd_SlotSize; /* number of slots (PRIVATE) */ | ||
| 106 | __be32 cd_Driver; /* pointer to node of driver */ | ||
| 107 | __be32 cd_NextCD; /* linked list of drivers to config */ | ||
| 108 | __be32 cd_Unused[4]; /* for whatever the driver wants */ | ||
| 109 | } __packed; | ||
| 110 | |||
| 111 | #define ZORRO_NUM_AUTO 16 | ||
| 112 | |||
| 113 | #endif /* _UAPI_LINUX_ZORRO_H */ | ||
diff --git a/include/linux/zorro_ids.h b/include/uapi/linux/zorro_ids.h index 74bc53bcfdcf..74bc53bcfdcf 100644 --- a/include/linux/zorro_ids.h +++ b/include/uapi/linux/zorro_ids.h | |||
diff --git a/include/uapi/sound/compress_offload.h b/include/uapi/sound/compress_offload.h index d630163b9a2e..5759810e1c1b 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, 1) | 33 | #define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 2) |
| 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 |
| @@ -67,8 +67,8 @@ struct snd_compr_params { | |||
| 67 | struct snd_compr_tstamp { | 67 | struct snd_compr_tstamp { |
| 68 | __u32 byte_offset; | 68 | __u32 byte_offset; |
| 69 | __u32 copied_total; | 69 | __u32 copied_total; |
| 70 | snd_pcm_uframes_t pcm_frames; | 70 | __u32 pcm_frames; |
| 71 | snd_pcm_uframes_t pcm_io_frames; | 71 | __u32 pcm_io_frames; |
| 72 | __u32 sampling_rate; | 72 | __u32 sampling_rate; |
| 73 | }; | 73 | }; |
| 74 | 74 | ||
diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h index 602dc6c45d1a..165e7059de75 100644 --- a/include/uapi/sound/compress_params.h +++ b/include/uapi/sound/compress_params.h | |||
| @@ -57,6 +57,7 @@ | |||
| 57 | #define MAX_NUM_CODECS 32 | 57 | #define MAX_NUM_CODECS 32 |
| 58 | #define MAX_NUM_CODEC_DESCRIPTORS 32 | 58 | #define MAX_NUM_CODEC_DESCRIPTORS 32 |
| 59 | #define MAX_NUM_BITRATES 32 | 59 | #define MAX_NUM_BITRATES 32 |
| 60 | #define MAX_NUM_SAMPLE_RATES 32 | ||
| 60 | 61 | ||
| 61 | /* Codecs are listed linearly to allow for extensibility */ | 62 | /* Codecs are listed linearly to allow for extensibility */ |
| 62 | #define SND_AUDIOCODEC_PCM ((__u32) 0x00000001) | 63 | #define SND_AUDIOCODEC_PCM ((__u32) 0x00000001) |
| @@ -324,7 +325,8 @@ union snd_codec_options { | |||
| 324 | 325 | ||
| 325 | /** struct snd_codec_desc - description of codec capabilities | 326 | /** struct snd_codec_desc - description of codec capabilities |
| 326 | * @max_ch: Maximum number of audio channels | 327 | * @max_ch: Maximum number of audio channels |
| 327 | * @sample_rates: Sampling rates in Hz, use SNDRV_PCM_RATE_xxx for this | 328 | * @sample_rates: Sampling rates in Hz, use values like 48000 for this |
| 329 | * @num_sample_rates: Number of valid values in sample_rates array | ||
| 328 | * @bit_rate: Indexed array containing supported bit rates | 330 | * @bit_rate: Indexed array containing supported bit rates |
| 329 | * @num_bitrates: Number of valid values in bit_rate array | 331 | * @num_bitrates: Number of valid values in bit_rate array |
| 330 | * @rate_control: value is specified by SND_RATECONTROLMODE defines. | 332 | * @rate_control: value is specified by SND_RATECONTROLMODE defines. |
| @@ -346,7 +348,8 @@ union snd_codec_options { | |||
| 346 | 348 | ||
| 347 | struct snd_codec_desc { | 349 | struct snd_codec_desc { |
| 348 | __u32 max_ch; | 350 | __u32 max_ch; |
| 349 | __u32 sample_rates; | 351 | __u32 sample_rates[MAX_NUM_SAMPLE_RATES]; |
| 352 | __u32 num_sample_rates; | ||
| 350 | __u32 bit_rate[MAX_NUM_BITRATES]; | 353 | __u32 bit_rate[MAX_NUM_BITRATES]; |
| 351 | __u32 num_bitrates; | 354 | __u32 num_bitrates; |
| 352 | __u32 rate_control; | 355 | __u32 rate_control; |
| @@ -364,7 +367,8 @@ struct snd_codec_desc { | |||
| 364 | * @ch_out: Number of output channels. In case of contradiction between | 367 | * @ch_out: Number of output channels. In case of contradiction between |
| 365 | * this field and the channelMode field, the channelMode field | 368 | * this field and the channelMode field, the channelMode field |
| 366 | * overrides. | 369 | * overrides. |
| 367 | * @sample_rate: Audio sample rate of input data | 370 | * @sample_rate: Audio sample rate of input data in Hz, use values like 48000 |
| 371 | * for this. | ||
| 368 | * @bit_rate: Bitrate of encoded data. May be ignored by decoders | 372 | * @bit_rate: Bitrate of encoded data. May be ignored by decoders |
| 369 | * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines. | 373 | * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines. |
| 370 | * Encoders may rely on profiles for quality levels. | 374 | * Encoders may rely on profiles for quality levels. |
diff --git a/include/video/pxa168fb.h b/include/video/pxa168fb.h index 8c2f385a90ea..84cbb1f69ea6 100644 --- a/include/video/pxa168fb.h +++ b/include/video/pxa168fb.h | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/arch/arm/mach-mmp/include/mach/pxa168fb.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 Marvell International Ltd. | 2 | * Copyright (C) 2009 Marvell International Ltd. |
| 5 | * | 3 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
diff --git a/include/xen/events.h b/include/xen/events.h index c9ea10ee2273..c9c85cf84895 100644 --- a/include/xen/events.h +++ b/include/xen/events.h | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | #include <asm/xen/hypercall.h> | 7 | #include <asm/xen/hypercall.h> |
| 8 | #include <asm/xen/events.h> | 8 | #include <asm/xen/events.h> |
| 9 | 9 | ||
| 10 | unsigned xen_evtchn_nr_channels(void); | ||
| 11 | |||
| 10 | int bind_evtchn_to_irq(unsigned int evtchn); | 12 | int bind_evtchn_to_irq(unsigned int evtchn); |
| 11 | int bind_evtchn_to_irqhandler(unsigned int evtchn, | 13 | int bind_evtchn_to_irqhandler(unsigned int evtchn, |
| 12 | irq_handler_t handler, | 14 | irq_handler_t handler, |
| @@ -37,6 +39,11 @@ int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain, | |||
| 37 | */ | 39 | */ |
| 38 | void unbind_from_irqhandler(unsigned int irq, void *dev_id); | 40 | void unbind_from_irqhandler(unsigned int irq, void *dev_id); |
| 39 | 41 | ||
| 42 | #define XEN_IRQ_PRIORITY_MAX EVTCHN_FIFO_PRIORITY_MAX | ||
| 43 | #define XEN_IRQ_PRIORITY_DEFAULT EVTCHN_FIFO_PRIORITY_DEFAULT | ||
| 44 | #define XEN_IRQ_PRIORITY_MIN EVTCHN_FIFO_PRIORITY_MIN | ||
| 45 | int xen_set_irq_priority(unsigned irq, unsigned priority); | ||
| 46 | |||
| 40 | /* | 47 | /* |
| 41 | * Allow extra references to event channels exposed to userspace by evtchn | 48 | * Allow extra references to event channels exposed to userspace by evtchn |
| 42 | */ | 49 | */ |
| @@ -73,6 +80,8 @@ void xen_poll_irq_timeout(int irq, u64 timeout); | |||
| 73 | 80 | ||
| 74 | /* Determine the IRQ which is bound to an event channel */ | 81 | /* Determine the IRQ which is bound to an event channel */ |
| 75 | unsigned irq_from_evtchn(unsigned int evtchn); | 82 | unsigned irq_from_evtchn(unsigned int evtchn); |
| 83 | int irq_from_virq(unsigned int cpu, unsigned int virq); | ||
| 84 | unsigned int evtchn_from_irq(unsigned irq); | ||
| 76 | 85 | ||
| 77 | /* Xen HVM evtchn vector callback */ | 86 | /* Xen HVM evtchn vector callback */ |
| 78 | void xen_hvm_callback_vector(void); | 87 | void xen_hvm_callback_vector(void); |
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index 694dcaf266e6..5acb1e4ac0d3 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h | |||
| @@ -178,8 +178,15 @@ int arch_gnttab_map_status(uint64_t *frames, unsigned long nr_gframes, | |||
| 178 | grant_status_t **__shared); | 178 | grant_status_t **__shared); |
| 179 | void arch_gnttab_unmap(void *shared, unsigned long nr_gframes); | 179 | void arch_gnttab_unmap(void *shared, unsigned long nr_gframes); |
| 180 | 180 | ||
| 181 | extern unsigned long xen_hvm_resume_frames; | 181 | struct grant_frames { |
| 182 | xen_pfn_t *pfn; | ||
| 183 | unsigned int count; | ||
| 184 | void *vaddr; | ||
| 185 | }; | ||
| 186 | extern struct grant_frames xen_auto_xlat_grant_frames; | ||
| 182 | unsigned int gnttab_max_grant_frames(void); | 187 | unsigned int gnttab_max_grant_frames(void); |
| 188 | int gnttab_setup_auto_xlat_frames(unsigned long addr); | ||
| 189 | void gnttab_free_auto_xlat_frames(void); | ||
| 183 | 190 | ||
| 184 | #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) | 191 | #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) |
| 185 | 192 | ||
diff --git a/include/xen/interface/callback.h b/include/xen/interface/callback.h index 8c5fa0e20155..dc3193f4b581 100644 --- a/include/xen/interface/callback.h +++ b/include/xen/interface/callback.h | |||
| @@ -36,7 +36,7 @@ | |||
| 36 | * @extra_args == Operation-specific extra arguments (NULL if none). | 36 | * @extra_args == Operation-specific extra arguments (NULL if none). |
| 37 | */ | 37 | */ |
| 38 | 38 | ||
| 39 | /* ia64, x86: Callback for event delivery. */ | 39 | /* x86: Callback for event delivery. */ |
| 40 | #define CALLBACKTYPE_event 0 | 40 | #define CALLBACKTYPE_event 0 |
| 41 | 41 | ||
| 42 | /* x86: Failsafe callback when guest state cannot be restored by Xen. */ | 42 | /* x86: Failsafe callback when guest state cannot be restored by Xen. */ |
diff --git a/include/xen/interface/elfnote.h b/include/xen/interface/elfnote.h index 0360b15f4883..6f4eae328ca7 100644 --- a/include/xen/interface/elfnote.h +++ b/include/xen/interface/elfnote.h | |||
| @@ -140,6 +140,19 @@ | |||
| 140 | */ | 140 | */ |
| 141 | #define XEN_ELFNOTE_SUSPEND_CANCEL 14 | 141 | #define XEN_ELFNOTE_SUSPEND_CANCEL 14 |
| 142 | 142 | ||
| 143 | /* | ||
| 144 | * The features supported by this kernel (numeric). | ||
| 145 | * | ||
| 146 | * Other than XEN_ELFNOTE_FEATURES on pre-4.2 Xen, this note allows a | ||
| 147 | * kernel to specify support for features that older hypervisors don't | ||
| 148 | * know about. The set of features 4.2 and newer hypervisors will | ||
| 149 | * consider supported by the kernel is the combination of the sets | ||
| 150 | * specified through this and the string note. | ||
| 151 | * | ||
| 152 | * LEGACY: FEATURES | ||
| 153 | */ | ||
| 154 | #define XEN_ELFNOTE_SUPPORTED_FEATURES 17 | ||
| 155 | |||
| 143 | #endif /* __XEN_PUBLIC_ELFNOTE_H__ */ | 156 | #endif /* __XEN_PUBLIC_ELFNOTE_H__ */ |
| 144 | 157 | ||
| 145 | /* | 158 | /* |
diff --git a/include/xen/interface/event_channel.h b/include/xen/interface/event_channel.h index f4942921e202..7e6acef5415b 100644 --- a/include/xen/interface/event_channel.h +++ b/include/xen/interface/event_channel.h | |||
| @@ -190,6 +190,39 @@ struct evtchn_reset { | |||
| 190 | }; | 190 | }; |
| 191 | typedef struct evtchn_reset evtchn_reset_t; | 191 | typedef struct evtchn_reset evtchn_reset_t; |
| 192 | 192 | ||
| 193 | /* | ||
| 194 | * EVTCHNOP_init_control: initialize the control block for the FIFO ABI. | ||
| 195 | */ | ||
| 196 | #define EVTCHNOP_init_control 11 | ||
| 197 | struct evtchn_init_control { | ||
| 198 | /* IN parameters. */ | ||
| 199 | uint64_t control_gfn; | ||
| 200 | uint32_t offset; | ||
| 201 | uint32_t vcpu; | ||
| 202 | /* OUT parameters. */ | ||
| 203 | uint8_t link_bits; | ||
| 204 | uint8_t _pad[7]; | ||
| 205 | }; | ||
| 206 | |||
| 207 | /* | ||
| 208 | * EVTCHNOP_expand_array: add an additional page to the event array. | ||
| 209 | */ | ||
| 210 | #define EVTCHNOP_expand_array 12 | ||
| 211 | struct evtchn_expand_array { | ||
| 212 | /* IN parameters. */ | ||
| 213 | uint64_t array_gfn; | ||
| 214 | }; | ||
| 215 | |||
| 216 | /* | ||
| 217 | * EVTCHNOP_set_priority: set the priority for an event channel. | ||
| 218 | */ | ||
| 219 | #define EVTCHNOP_set_priority 13 | ||
| 220 | struct evtchn_set_priority { | ||
| 221 | /* IN parameters. */ | ||
| 222 | uint32_t port; | ||
| 223 | uint32_t priority; | ||
| 224 | }; | ||
| 225 | |||
| 193 | struct evtchn_op { | 226 | struct evtchn_op { |
| 194 | uint32_t cmd; /* EVTCHNOP_* */ | 227 | uint32_t cmd; /* EVTCHNOP_* */ |
| 195 | union { | 228 | union { |
| @@ -207,4 +240,39 @@ struct evtchn_op { | |||
| 207 | }; | 240 | }; |
| 208 | DEFINE_GUEST_HANDLE_STRUCT(evtchn_op); | 241 | DEFINE_GUEST_HANDLE_STRUCT(evtchn_op); |
| 209 | 242 | ||
| 243 | /* | ||
| 244 | * 2-level ABI | ||
| 245 | */ | ||
| 246 | |||
| 247 | #define EVTCHN_2L_NR_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64) | ||
| 248 | |||
| 249 | /* | ||
| 250 | * FIFO ABI | ||
| 251 | */ | ||
| 252 | |||
| 253 | /* Events may have priorities from 0 (highest) to 15 (lowest). */ | ||
| 254 | #define EVTCHN_FIFO_PRIORITY_MAX 0 | ||
| 255 | #define EVTCHN_FIFO_PRIORITY_DEFAULT 7 | ||
| 256 | #define EVTCHN_FIFO_PRIORITY_MIN 15 | ||
| 257 | |||
| 258 | #define EVTCHN_FIFO_MAX_QUEUES (EVTCHN_FIFO_PRIORITY_MIN + 1) | ||
| 259 | |||
| 260 | typedef uint32_t event_word_t; | ||
| 261 | |||
| 262 | #define EVTCHN_FIFO_PENDING 31 | ||
| 263 | #define EVTCHN_FIFO_MASKED 30 | ||
| 264 | #define EVTCHN_FIFO_LINKED 29 | ||
| 265 | #define EVTCHN_FIFO_BUSY 28 | ||
| 266 | |||
| 267 | #define EVTCHN_FIFO_LINK_BITS 17 | ||
| 268 | #define EVTCHN_FIFO_LINK_MASK ((1 << EVTCHN_FIFO_LINK_BITS) - 1) | ||
| 269 | |||
| 270 | #define EVTCHN_FIFO_NR_CHANNELS (1 << EVTCHN_FIFO_LINK_BITS) | ||
| 271 | |||
| 272 | struct evtchn_fifo_control_block { | ||
| 273 | uint32_t ready; | ||
| 274 | uint32_t _rsvd; | ||
| 275 | event_word_t head[EVTCHN_FIFO_MAX_QUEUES]; | ||
| 276 | }; | ||
| 277 | |||
| 210 | #endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */ | 278 | #endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */ |
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h index 65e12099ef89..ae665ac59c36 100644 --- a/include/xen/interface/io/blkif.h +++ b/include/xen/interface/io/blkif.h | |||
| @@ -146,7 +146,7 @@ struct blkif_request_segment_aligned { | |||
| 146 | struct blkif_request_rw { | 146 | struct blkif_request_rw { |
| 147 | uint8_t nr_segments; /* number of segments */ | 147 | uint8_t nr_segments; /* number of segments */ |
| 148 | blkif_vdev_t handle; /* only for read/write requests */ | 148 | blkif_vdev_t handle; /* only for read/write requests */ |
| 149 | #ifdef CONFIG_X86_64 | 149 | #ifndef CONFIG_X86_32 |
| 150 | uint32_t _pad1; /* offsetof(blkif_request,u.rw.id) == 8 */ | 150 | uint32_t _pad1; /* offsetof(blkif_request,u.rw.id) == 8 */ |
| 151 | #endif | 151 | #endif |
| 152 | uint64_t id; /* private guest value, echoed in resp */ | 152 | uint64_t id; /* private guest value, echoed in resp */ |
| @@ -163,7 +163,7 @@ struct blkif_request_discard { | |||
| 163 | uint8_t flag; /* BLKIF_DISCARD_SECURE or zero. */ | 163 | uint8_t flag; /* BLKIF_DISCARD_SECURE or zero. */ |
| 164 | #define BLKIF_DISCARD_SECURE (1<<0) /* ignored if discard-secure=0 */ | 164 | #define BLKIF_DISCARD_SECURE (1<<0) /* ignored if discard-secure=0 */ |
| 165 | blkif_vdev_t _pad1; /* only for read/write requests */ | 165 | blkif_vdev_t _pad1; /* only for read/write requests */ |
| 166 | #ifdef CONFIG_X86_64 | 166 | #ifndef CONFIG_X86_32 |
| 167 | uint32_t _pad2; /* offsetof(blkif_req..,u.discard.id)==8*/ | 167 | uint32_t _pad2; /* offsetof(blkif_req..,u.discard.id)==8*/ |
| 168 | #endif | 168 | #endif |
| 169 | uint64_t id; /* private guest value, echoed in resp */ | 169 | uint64_t id; /* private guest value, echoed in resp */ |
| @@ -175,7 +175,7 @@ struct blkif_request_discard { | |||
| 175 | struct blkif_request_other { | 175 | struct blkif_request_other { |
| 176 | uint8_t _pad1; | 176 | uint8_t _pad1; |
| 177 | blkif_vdev_t _pad2; /* only for read/write requests */ | 177 | blkif_vdev_t _pad2; /* only for read/write requests */ |
| 178 | #ifdef CONFIG_X86_64 | 178 | #ifndef CONFIG_X86_32 |
| 179 | uint32_t _pad3; /* offsetof(blkif_req..,u.other.id)==8*/ | 179 | uint32_t _pad3; /* offsetof(blkif_req..,u.other.id)==8*/ |
| 180 | #endif | 180 | #endif |
| 181 | uint64_t id; /* private guest value, echoed in resp */ | 181 | uint64_t id; /* private guest value, echoed in resp */ |
| @@ -184,7 +184,7 @@ struct blkif_request_other { | |||
| 184 | struct blkif_request_indirect { | 184 | struct blkif_request_indirect { |
| 185 | uint8_t indirect_op; | 185 | uint8_t indirect_op; |
| 186 | uint16_t nr_segments; | 186 | uint16_t nr_segments; |
| 187 | #ifdef CONFIG_X86_64 | 187 | #ifndef CONFIG_X86_32 |
| 188 | uint32_t _pad1; /* offsetof(blkif_...,u.indirect.id) == 8 */ | 188 | uint32_t _pad1; /* offsetof(blkif_...,u.indirect.id) == 8 */ |
| 189 | #endif | 189 | #endif |
| 190 | uint64_t id; | 190 | uint64_t id; |
| @@ -192,7 +192,7 @@ struct blkif_request_indirect { | |||
| 192 | blkif_vdev_t handle; | 192 | blkif_vdev_t handle; |
| 193 | uint16_t _pad2; | 193 | uint16_t _pad2; |
| 194 | grant_ref_t indirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST]; | 194 | grant_ref_t indirect_grefs[BLKIF_MAX_INDIRECT_PAGES_PER_REQUEST]; |
| 195 | #ifdef CONFIG_X86_64 | 195 | #ifndef CONFIG_X86_32 |
| 196 | uint32_t _pad3; /* make it 64 byte aligned */ | 196 | uint32_t _pad3; /* make it 64 byte aligned */ |
| 197 | #else | 197 | #else |
| 198 | uint64_t _pad3; /* make it 64 byte aligned */ | 198 | uint64_t _pad3; /* make it 64 byte aligned */ |
diff --git a/include/xen/interface/io/protocols.h b/include/xen/interface/io/protocols.h index 056744b4b05e..545a14ba0bb3 100644 --- a/include/xen/interface/io/protocols.h +++ b/include/xen/interface/io/protocols.h | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #define XEN_IO_PROTO_ABI_X86_32 "x86_32-abi" | 4 | #define XEN_IO_PROTO_ABI_X86_32 "x86_32-abi" |
| 5 | #define XEN_IO_PROTO_ABI_X86_64 "x86_64-abi" | 5 | #define XEN_IO_PROTO_ABI_X86_64 "x86_64-abi" |
| 6 | #define XEN_IO_PROTO_ABI_IA64 "ia64-abi" | ||
| 7 | #define XEN_IO_PROTO_ABI_POWERPC64 "powerpc64-abi" | 6 | #define XEN_IO_PROTO_ABI_POWERPC64 "powerpc64-abi" |
| 8 | #define XEN_IO_PROTO_ABI_ARM "arm-abi" | 7 | #define XEN_IO_PROTO_ABI_ARM "arm-abi" |
| 9 | 8 | ||
| @@ -11,8 +10,6 @@ | |||
| 11 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_32 | 10 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_32 |
| 12 | #elif defined(__x86_64__) | 11 | #elif defined(__x86_64__) |
| 13 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_64 | 12 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_64 |
| 14 | #elif defined(__ia64__) | ||
| 15 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_IA64 | ||
| 16 | #elif defined(__powerpc64__) | 13 | #elif defined(__powerpc64__) |
| 17 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_POWERPC64 | 14 | # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_POWERPC64 |
| 18 | #elif defined(__arm__) || defined(__aarch64__) | 15 | #elif defined(__arm__) || defined(__aarch64__) |
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h index 53ec4167bd0b..0cd5ca333fac 100644 --- a/include/xen/interface/xen.h +++ b/include/xen/interface/xen.h | |||
| @@ -281,12 +281,6 @@ struct multicall_entry { | |||
| 281 | }; | 281 | }; |
| 282 | DEFINE_GUEST_HANDLE_STRUCT(multicall_entry); | 282 | DEFINE_GUEST_HANDLE_STRUCT(multicall_entry); |
| 283 | 283 | ||
| 284 | /* | ||
| 285 | * Event channel endpoints per domain: | ||
| 286 | * 1024 if a long is 32 bits; 4096 if a long is 64 bits. | ||
| 287 | */ | ||
| 288 | #define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64) | ||
| 289 | |||
| 290 | struct vcpu_time_info { | 284 | struct vcpu_time_info { |
| 291 | /* | 285 | /* |
| 292 | * Updates to the following values are preceded and followed | 286 | * Updates to the following values are preceded and followed |
diff --git a/include/xen/platform_pci.h b/include/xen/platform_pci.h index 438c256c274b..5c52b5583917 100644 --- a/include/xen/platform_pci.h +++ b/include/xen/platform_pci.h | |||
| @@ -46,6 +46,27 @@ static inline int xen_must_unplug_disks(void) { | |||
| 46 | #endif | 46 | #endif |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | extern int xen_platform_pci_unplug; | 49 | #if defined(CONFIG_XEN_PVHVM) |
| 50 | 50 | extern bool xen_has_pv_devices(void); | |
| 51 | extern bool xen_has_pv_disk_devices(void); | ||
| 52 | extern bool xen_has_pv_nic_devices(void); | ||
| 53 | extern bool xen_has_pv_and_legacy_disk_devices(void); | ||
| 54 | #else | ||
| 55 | static inline bool xen_has_pv_devices(void) | ||
| 56 | { | ||
| 57 | return IS_ENABLED(CONFIG_XEN); | ||
| 58 | } | ||
| 59 | static inline bool xen_has_pv_disk_devices(void) | ||
| 60 | { | ||
| 61 | return IS_ENABLED(CONFIG_XEN); | ||
| 62 | } | ||
| 63 | static inline bool xen_has_pv_nic_devices(void) | ||
| 64 | { | ||
| 65 | return IS_ENABLED(CONFIG_XEN); | ||
| 66 | } | ||
| 67 | static inline bool xen_has_pv_and_legacy_disk_devices(void) | ||
| 68 | { | ||
| 69 | return false; | ||
| 70 | } | ||
| 71 | #endif | ||
| 51 | #endif /* _XEN_PLATFORM_PCI_H */ | 72 | #endif /* _XEN_PLATFORM_PCI_H */ |
diff --git a/include/xen/xen.h b/include/xen/xen.h index a74d4362c4f8..0c0e3ef4c45d 100644 --- a/include/xen/xen.h +++ b/include/xen/xen.h | |||
| @@ -29,4 +29,18 @@ extern enum xen_domain_type xen_domain_type; | |||
| 29 | #define xen_initial_domain() (0) | 29 | #define xen_initial_domain() (0) |
| 30 | #endif /* CONFIG_XEN_DOM0 */ | 30 | #endif /* CONFIG_XEN_DOM0 */ |
| 31 | 31 | ||
| 32 | #ifdef CONFIG_XEN_PVH | ||
| 33 | /* This functionality exists only for x86. The XEN_PVHVM support exists | ||
| 34 | * only in x86 world - hence on ARM it will be always disabled. | ||
| 35 | * N.B. ARM guests are neither PV nor HVM nor PVHVM. | ||
| 36 | * It's a bit like PVH but is different also (it's further towards the H | ||
| 37 | * end of the spectrum than even PVH). | ||
| 38 | */ | ||
| 39 | #include <xen/features.h> | ||
| 40 | #define xen_pvh_domain() (xen_pv_domain() && \ | ||
| 41 | xen_feature(XENFEAT_auto_translated_physmap) && \ | ||
| 42 | xen_have_vector_callback) | ||
| 43 | #else | ||
| 44 | #define xen_pvh_domain() (0) | ||
| 45 | #endif | ||
| 32 | #endif /* _XEN_XEN_H */ | 46 | #endif /* _XEN_XEN_H */ |
