diff options
Diffstat (limited to 'include')
328 files changed, 11337 insertions, 3387 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 932a60d6ed82..5a0a3e5daf85 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
| @@ -219,6 +219,24 @@ | |||
| 219 | 219 | ||
| 220 | /****************************************************************************** | 220 | /****************************************************************************** |
| 221 | * | 221 | * |
| 222 | * Miscellaneous constants | ||
| 223 | * | ||
| 224 | *****************************************************************************/ | ||
| 225 | |||
| 226 | /* UUID constants */ | ||
| 227 | |||
| 228 | #define UUID_BUFFER_LENGTH 16 /* Length of UUID in memory */ | ||
| 229 | #define UUID_STRING_LENGTH 36 /* Total length of a UUID string */ | ||
| 230 | |||
| 231 | /* Positions for required hyphens (dashes) in UUID strings */ | ||
| 232 | |||
| 233 | #define UUID_HYPHEN1_OFFSET 8 | ||
| 234 | #define UUID_HYPHEN2_OFFSET 13 | ||
| 235 | #define UUID_HYPHEN3_OFFSET 18 | ||
| 236 | #define UUID_HYPHEN4_OFFSET 23 | ||
| 237 | |||
| 238 | /****************************************************************************** | ||
| 239 | * | ||
| 222 | * ACPI AML Debugger | 240 | * ACPI AML Debugger |
| 223 | * | 241 | * |
| 224 | *****************************************************************************/ | 242 | *****************************************************************************/ |
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index 3dd6e838dc30..c728113374f5 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h | |||
| @@ -55,6 +55,7 @@ | |||
| 55 | #define METHOD_NAME__HID "_HID" | 55 | #define METHOD_NAME__HID "_HID" |
| 56 | #define METHOD_NAME__INI "_INI" | 56 | #define METHOD_NAME__INI "_INI" |
| 57 | #define METHOD_NAME__PLD "_PLD" | 57 | #define METHOD_NAME__PLD "_PLD" |
| 58 | #define METHOD_NAME__DSD "_DSD" | ||
| 58 | #define METHOD_NAME__PRS "_PRS" | 59 | #define METHOD_NAME__PRS "_PRS" |
| 59 | #define METHOD_NAME__PRT "_PRT" | 60 | #define METHOD_NAME__PRT "_PRT" |
| 60 | #define METHOD_NAME__PRW "_PRW" | 61 | #define METHOD_NAME__PRW "_PRW" |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index b5714580801a..bcfd808b1098 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
| @@ -315,12 +315,19 @@ struct acpi_device_wakeup_flags { | |||
| 315 | u8 notifier_present:1; /* Wake-up notify handler has been installed */ | 315 | u8 notifier_present:1; /* Wake-up notify handler has been installed */ |
| 316 | }; | 316 | }; |
| 317 | 317 | ||
| 318 | struct acpi_device_wakeup_context { | ||
| 319 | struct work_struct work; | ||
| 320 | struct device *dev; | ||
| 321 | }; | ||
| 322 | |||
| 318 | struct acpi_device_wakeup { | 323 | struct acpi_device_wakeup { |
| 319 | acpi_handle gpe_device; | 324 | acpi_handle gpe_device; |
| 320 | u64 gpe_number; | 325 | u64 gpe_number; |
| 321 | u64 sleep_state; | 326 | u64 sleep_state; |
| 322 | struct list_head resources; | 327 | struct list_head resources; |
| 323 | struct acpi_device_wakeup_flags flags; | 328 | struct acpi_device_wakeup_flags flags; |
| 329 | struct acpi_device_wakeup_context context; | ||
| 330 | struct wakeup_source *ws; | ||
| 324 | int prepare_count; | 331 | int prepare_count; |
| 325 | }; | 332 | }; |
| 326 | 333 | ||
| @@ -372,15 +379,9 @@ static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta) | |||
| 372 | } | 379 | } |
| 373 | 380 | ||
| 374 | static inline void acpi_set_hp_context(struct acpi_device *adev, | 381 | static inline void acpi_set_hp_context(struct acpi_device *adev, |
| 375 | struct acpi_hotplug_context *hp, | 382 | struct acpi_hotplug_context *hp) |
| 376 | int (*notify)(struct acpi_device *, u32), | ||
| 377 | void (*uevent)(struct acpi_device *, u32), | ||
| 378 | void (*fixup)(struct acpi_device *)) | ||
| 379 | { | 383 | { |
| 380 | hp->self = adev; | 384 | hp->self = adev; |
| 381 | hp->notify = notify; | ||
| 382 | hp->uevent = uevent; | ||
| 383 | hp->fixup = fixup; | ||
| 384 | adev->hp = hp; | 385 | adev->hp = hp; |
| 385 | } | 386 | } |
| 386 | 387 | ||
| @@ -487,6 +488,8 @@ struct acpi_bus_type { | |||
| 487 | }; | 488 | }; |
| 488 | int register_acpi_bus_type(struct acpi_bus_type *); | 489 | int register_acpi_bus_type(struct acpi_bus_type *); |
| 489 | int unregister_acpi_bus_type(struct acpi_bus_type *); | 490 | int unregister_acpi_bus_type(struct acpi_bus_type *); |
| 491 | int acpi_bind_one(struct device *dev, struct acpi_device *adev); | ||
| 492 | int acpi_unbind_one(struct device *dev); | ||
| 490 | 493 | ||
| 491 | struct acpi_pci_root { | 494 | struct acpi_pci_root { |
| 492 | struct acpi_device * device; | 495 | struct acpi_device * device; |
| @@ -510,20 +513,18 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state); | |||
| 510 | int acpi_disable_wakeup_device_power(struct acpi_device *dev); | 513 | int acpi_disable_wakeup_device_power(struct acpi_device *dev); |
| 511 | 514 | ||
| 512 | #ifdef CONFIG_PM | 515 | #ifdef CONFIG_PM |
| 513 | acpi_status acpi_add_pm_notifier(struct acpi_device *adev, | 516 | acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev, |
| 514 | acpi_notify_handler handler, void *context); | 517 | void (*work_func)(struct work_struct *work)); |
| 515 | acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, | 518 | acpi_status acpi_remove_pm_notifier(struct acpi_device *adev); |
| 516 | acpi_notify_handler handler); | ||
| 517 | int acpi_pm_device_sleep_state(struct device *, int *, int); | 519 | int acpi_pm_device_sleep_state(struct device *, int *, int); |
| 518 | #else | 520 | #else |
| 519 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, | 521 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, |
| 520 | acpi_notify_handler handler, | 522 | struct device *dev, |
| 521 | void *context) | 523 | void (*work_func)(struct work_struct *work)) |
| 522 | { | 524 | { |
| 523 | return AE_SUPPORT; | 525 | return AE_SUPPORT; |
| 524 | } | 526 | } |
| 525 | static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, | 527 | static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev) |
| 526 | acpi_notify_handler handler) | ||
| 527 | { | 528 | { |
| 528 | return AE_SUPPORT; | 529 | return AE_SUPPORT; |
| 529 | } | 530 | } |
| @@ -538,13 +539,8 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) | |||
| 538 | #endif | 539 | #endif |
| 539 | 540 | ||
| 540 | #ifdef CONFIG_PM_RUNTIME | 541 | #ifdef CONFIG_PM_RUNTIME |
| 541 | int __acpi_device_run_wake(struct acpi_device *, bool); | ||
| 542 | int acpi_pm_device_run_wake(struct device *, bool); | 542 | int acpi_pm_device_run_wake(struct device *, bool); |
| 543 | #else | 543 | #else |
| 544 | static inline int __acpi_device_run_wake(struct acpi_device *adev, bool en) | ||
| 545 | { | ||
| 546 | return -ENODEV; | ||
| 547 | } | ||
| 548 | static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) | 544 | static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) |
| 549 | { | 545 | { |
| 550 | return -ENODEV; | 546 | return -ENODEV; |
| @@ -552,14 +548,8 @@ static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) | |||
| 552 | #endif | 548 | #endif |
| 553 | 549 | ||
| 554 | #ifdef CONFIG_PM_SLEEP | 550 | #ifdef CONFIG_PM_SLEEP |
| 555 | int __acpi_device_sleep_wake(struct acpi_device *, u32, bool); | ||
| 556 | int acpi_pm_device_sleep_wake(struct device *, bool); | 551 | int acpi_pm_device_sleep_wake(struct device *, bool); |
| 557 | #else | 552 | #else |
| 558 | static inline int __acpi_device_sleep_wake(struct acpi_device *adev, | ||
| 559 | u32 target_state, bool enable) | ||
| 560 | { | ||
| 561 | return -ENODEV; | ||
| 562 | } | ||
| 563 | static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) | 553 | static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) |
| 564 | { | 554 | { |
| 565 | return -ENODEV; | 555 | return -ENODEV; |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index f6f5f8af2112..03b3e6d405ff 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
| @@ -399,4 +399,35 @@ char *acpi_os_get_next_filename(void *dir_handle); | |||
| 399 | void acpi_os_close_directory(void *dir_handle); | 399 | void acpi_os_close_directory(void *dir_handle); |
| 400 | #endif | 400 | #endif |
| 401 | 401 | ||
| 402 | /* | ||
| 403 | * File I/O and related support | ||
| 404 | */ | ||
| 405 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_open_file | ||
| 406 | ACPI_FILE acpi_os_open_file(const char *path, u8 modes); | ||
| 407 | #endif | ||
| 408 | |||
| 409 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_file | ||
| 410 | void acpi_os_close_file(ACPI_FILE file); | ||
| 411 | #endif | ||
| 412 | |||
| 413 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_file | ||
| 414 | int | ||
| 415 | acpi_os_read_file(ACPI_FILE file, | ||
| 416 | void *buffer, acpi_size size, acpi_size count); | ||
| 417 | #endif | ||
| 418 | |||
| 419 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_file | ||
| 420 | int | ||
| 421 | acpi_os_write_file(ACPI_FILE file, | ||
| 422 | void *buffer, acpi_size size, acpi_size count); | ||
| 423 | #endif | ||
| 424 | |||
| 425 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_file_offset | ||
| 426 | long acpi_os_get_file_offset(ACPI_FILE file); | ||
| 427 | #endif | ||
| 428 | |||
| 429 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_set_file_offset | ||
| 430 | acpi_status acpi_os_set_file_offset(ACPI_FILE file, long offset, u8 from); | ||
| 431 | #endif | ||
| 432 | |||
| 402 | #endif /* __ACPIOSXF_H__ */ | 433 | #endif /* __ACPIOSXF_H__ */ |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 35b525c19711..b7c89d47efbe 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
| @@ -46,15 +46,13 @@ | |||
| 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 0x20140424 | 49 | #define ACPI_CA_VERSION 0x20140724 |
| 50 | 50 | ||
| 51 | #include <acpi/acconfig.h> | 51 | #include <acpi/acconfig.h> |
| 52 | #include <acpi/actypes.h> | 52 | #include <acpi/actypes.h> |
| 53 | #include <acpi/actbl.h> | 53 | #include <acpi/actbl.h> |
| 54 | #include <acpi/acbuffer.h> | 54 | #include <acpi/acbuffer.h> |
| 55 | 55 | ||
| 56 | extern u8 acpi_gbl_permanent_mmap; | ||
| 57 | |||
| 58 | /***************************************************************************** | 56 | /***************************************************************************** |
| 59 | * | 57 | * |
| 60 | * Macros used for ACPICA globals and configuration | 58 | * Macros used for ACPICA globals and configuration |
| @@ -335,6 +333,23 @@ ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running); | |||
| 335 | 333 | ||
| 336 | #endif /* ACPI_DEBUG_OUTPUT */ | 334 | #endif /* ACPI_DEBUG_OUTPUT */ |
| 337 | 335 | ||
| 336 | /* | ||
| 337 | * Application prototypes | ||
| 338 | * | ||
| 339 | * All interfaces used by application will be configured | ||
| 340 | * out of the ACPICA build unless the ACPI_APPLICATION | ||
| 341 | * flag is defined. | ||
| 342 | */ | ||
| 343 | #ifdef ACPI_APPLICATION | ||
| 344 | #define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \ | ||
| 345 | prototype; | ||
| 346 | |||
| 347 | #else | ||
| 348 | #define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \ | ||
| 349 | static ACPI_INLINE prototype {return;} | ||
| 350 | |||
| 351 | #endif /* ACPI_APPLICATION */ | ||
| 352 | |||
| 338 | /***************************************************************************** | 353 | /***************************************************************************** |
| 339 | * | 354 | * |
| 340 | * ACPICA public interface prototypes | 355 | * ACPICA public interface prototypes |
| @@ -658,6 +673,10 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
| 658 | u32 gpe_number)) | 673 | u32 gpe_number)) |
| 659 | 674 | ||
| 660 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 675 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
| 676 | acpi_mark_gpe_for_wake(acpi_handle gpe_device, | ||
| 677 | u32 gpe_number)) | ||
| 678 | |||
| 679 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
| 661 | acpi_setup_gpe_for_wake(acpi_handle | 680 | acpi_setup_gpe_for_wake(acpi_handle |
| 662 | parent_device, | 681 | parent_device, |
| 663 | acpi_handle gpe_device, | 682 | acpi_handle gpe_device, |
| @@ -861,21 +880,32 @@ ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6) | |||
| 861 | const char *module_name, | 880 | const char *module_name, |
| 862 | u32 component_id, | 881 | u32 component_id, |
| 863 | const char *format, ...)) | 882 | const char *format, ...)) |
| 883 | ACPI_APP_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1) | ||
| 884 | void ACPI_INTERNAL_VAR_XFACE | ||
| 885 | acpi_log_error(const char *format, ...)) | ||
| 864 | 886 | ||
| 865 | /* | 887 | /* |
| 866 | * Divergences | 888 | * Divergences |
| 867 | */ | 889 | */ |
| 868 | acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type); | 890 | ACPI_GLOBAL(u8, acpi_gbl_permanent_mmap); |
| 869 | 891 | ||
| 870 | acpi_status acpi_unload_table_id(acpi_owner_id id); | 892 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 893 | acpi_get_id(acpi_handle object, | ||
| 894 | acpi_owner_id * out_type)) | ||
| 871 | 895 | ||
| 872 | acpi_status | 896 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_unload_table_id(acpi_owner_id id)) |
| 873 | acpi_get_table_with_size(acpi_string signature, | ||
| 874 | u32 instance, struct acpi_table_header **out_table, | ||
| 875 | acpi_size *tbl_size); | ||
| 876 | 897 | ||
| 877 | acpi_status | 898 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status |
| 878 | acpi_get_data_full(acpi_handle object, acpi_object_handler handler, void **data, | 899 | acpi_get_table_with_size(acpi_string signature, |
| 879 | void (*callback)(void *)); | 900 | u32 instance, |
| 901 | struct acpi_table_header | ||
| 902 | **out_table, | ||
| 903 | acpi_size *tbl_size)) | ||
| 904 | |||
| 905 | ACPI_EXTERNAL_RETURN_STATUS(acpi_status | ||
| 906 | acpi_get_data_full(acpi_handle object, | ||
| 907 | acpi_object_handler handler, | ||
| 908 | void **data, | ||
| 909 | void (*callback)(void *))) | ||
| 880 | 910 | ||
| 881 | #endif /* __ACXFACE_H__ */ | 911 | #endif /* __ACXFACE_H__ */ |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index 1cc7ef13c01a..bee19d8170c5 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
| @@ -270,7 +270,8 @@ struct acpi_table_fadt { | |||
| 270 | u32 flags; /* Miscellaneous flag bits (see below for individual flags) */ | 270 | u32 flags; /* Miscellaneous flag bits (see below for individual flags) */ |
| 271 | struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */ | 271 | struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */ |
| 272 | u8 reset_value; /* Value to write to the reset_register port to reset the system */ | 272 | u8 reset_value; /* Value to write to the reset_register port to reset the system */ |
| 273 | u8 reserved4[3]; /* Reserved, must be zero */ | 273 | u16 arm_boot_flags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */ |
| 274 | u8 minor_revision; /* FADT Minor Revision (ACPI 5.1) */ | ||
| 274 | u64 Xfacs; /* 64-bit physical address of FACS */ | 275 | u64 Xfacs; /* 64-bit physical address of FACS */ |
| 275 | u64 Xdsdt; /* 64-bit physical address of DSDT */ | 276 | u64 Xdsdt; /* 64-bit physical address of DSDT */ |
| 276 | struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ | 277 | struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ |
| @@ -285,7 +286,7 @@ struct acpi_table_fadt { | |||
| 285 | struct acpi_generic_address sleep_status; /* 64-bit Sleep Status register (ACPI 5.0) */ | 286 | struct acpi_generic_address sleep_status; /* 64-bit Sleep Status register (ACPI 5.0) */ |
| 286 | }; | 287 | }; |
| 287 | 288 | ||
| 288 | /* Masks for FADT Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */ | 289 | /* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */ |
| 289 | 290 | ||
| 290 | #define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */ | 291 | #define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */ |
| 291 | #define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */ | 292 | #define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */ |
| @@ -296,6 +297,11 @@ struct acpi_table_fadt { | |||
| 296 | 297 | ||
| 297 | #define FADT2_REVISION_ID 3 | 298 | #define FADT2_REVISION_ID 3 |
| 298 | 299 | ||
| 300 | /* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */ | ||
| 301 | |||
| 302 | #define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */ | ||
| 303 | #define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */ | ||
| 304 | |||
| 299 | /* Masks for FADT flags */ | 305 | /* Masks for FADT flags */ |
| 300 | 306 | ||
| 301 | #define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */ | 307 | #define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */ |
| @@ -399,7 +405,7 @@ struct acpi_table_desc { | |||
| 399 | * FADT V5 size: 0x10C | 405 | * FADT V5 size: 0x10C |
| 400 | */ | 406 | */ |
| 401 | #define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4) | 407 | #define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4) |
| 402 | #define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3) | 408 | #define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (minor_revision) + 1) |
| 403 | #define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control)) | 409 | #define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control)) |
| 404 | #define ACPI_FADT_V5_SIZE (u32) (sizeof (struct acpi_table_fadt)) | 410 | #define ACPI_FADT_V5_SIZE (u32) (sizeof (struct acpi_table_fadt)) |
| 405 | 411 | ||
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 4ad7da805180..7626bfeac2cb 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h | |||
| @@ -604,7 +604,7 @@ struct acpi_hest_generic { | |||
| 604 | 604 | ||
| 605 | /* Generic Error Status block */ | 605 | /* Generic Error Status block */ |
| 606 | 606 | ||
| 607 | struct acpi_generic_status { | 607 | struct acpi_hest_generic_status { |
| 608 | u32 block_status; | 608 | u32 block_status; |
| 609 | u32 raw_data_offset; | 609 | u32 raw_data_offset; |
| 610 | u32 raw_data_length; | 610 | u32 raw_data_length; |
| @@ -614,15 +614,15 @@ struct acpi_generic_status { | |||
| 614 | 614 | ||
| 615 | /* Values for block_status flags above */ | 615 | /* Values for block_status flags above */ |
| 616 | 616 | ||
| 617 | #define ACPI_GEN_ERR_UC BIT(0) | 617 | #define ACPI_HEST_UNCORRECTABLE (1) |
| 618 | #define ACPI_GEN_ERR_CE BIT(1) | 618 | #define ACPI_HEST_CORRECTABLE (1<<1) |
| 619 | #define ACPI_GEN_ERR_MULTI_UC BIT(2) | 619 | #define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2) |
| 620 | #define ACPI_GEN_ERR_MULTI_CE BIT(3) | 620 | #define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3) |
| 621 | #define ACPI_GEN_ERR_COUNT_SHIFT (0xFF<<4) /* 8 bits, error count */ | 621 | #define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */ |
| 622 | 622 | ||
| 623 | /* Generic Error Data entry */ | 623 | /* Generic Error Data entry */ |
| 624 | 624 | ||
| 625 | struct acpi_generic_data { | 625 | struct acpi_hest_generic_data { |
| 626 | u8 section_type[16]; | 626 | u8 section_type[16]; |
| 627 | u32 error_severity; | 627 | u32 error_severity; |
| 628 | u16 revision; | 628 | u16 revision; |
| @@ -671,7 +671,9 @@ enum acpi_madt_type { | |||
| 671 | ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, | 671 | ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, |
| 672 | ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11, | 672 | ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11, |
| 673 | ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, | 673 | ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, |
| 674 | ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */ | 674 | ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13, |
| 675 | ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14, | ||
| 676 | ACPI_MADT_TYPE_RESERVED = 15 /* 15 and greater are reserved */ | ||
| 675 | }; | 677 | }; |
| 676 | 678 | ||
| 677 | /* | 679 | /* |
| @@ -797,15 +799,26 @@ struct acpi_madt_local_x2apic_nmi { | |||
| 797 | struct acpi_madt_generic_interrupt { | 799 | struct acpi_madt_generic_interrupt { |
| 798 | struct acpi_subtable_header header; | 800 | struct acpi_subtable_header header; |
| 799 | u16 reserved; /* reserved - must be zero */ | 801 | u16 reserved; /* reserved - must be zero */ |
| 800 | u32 gic_id; | 802 | u32 cpu_interface_number; |
| 801 | u32 uid; | 803 | u32 uid; |
| 802 | u32 flags; | 804 | u32 flags; |
| 803 | u32 parking_version; | 805 | u32 parking_version; |
| 804 | u32 performance_interrupt; | 806 | u32 performance_interrupt; |
| 805 | u64 parked_address; | 807 | u64 parked_address; |
| 806 | u64 base_address; | 808 | u64 base_address; |
| 809 | u64 gicv_base_address; | ||
| 810 | u64 gich_base_address; | ||
| 811 | u32 vgic_interrupt; | ||
| 812 | u64 gicr_base_address; | ||
| 813 | u64 arm_mpidr; | ||
| 807 | }; | 814 | }; |
| 808 | 815 | ||
| 816 | /* Masks for Flags field above */ | ||
| 817 | |||
| 818 | /* ACPI_MADT_ENABLED (1) Processor is usable if set */ | ||
| 819 | #define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */ | ||
| 820 | #define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */ | ||
| 821 | |||
| 809 | /* 12: Generic Distributor (ACPI 5.0) */ | 822 | /* 12: Generic Distributor (ACPI 5.0) */ |
| 810 | 823 | ||
| 811 | struct acpi_madt_generic_distributor { | 824 | struct acpi_madt_generic_distributor { |
| @@ -817,11 +830,36 @@ struct acpi_madt_generic_distributor { | |||
| 817 | u32 reserved2; /* reserved - must be zero */ | 830 | u32 reserved2; /* reserved - must be zero */ |
| 818 | }; | 831 | }; |
| 819 | 832 | ||
| 833 | /* 13: Generic MSI Frame (ACPI 5.1) */ | ||
| 834 | |||
| 835 | struct acpi_madt_generic_msi_frame { | ||
| 836 | struct acpi_subtable_header header; | ||
| 837 | u16 reserved; /* reserved - must be zero */ | ||
| 838 | u32 msi_frame_id; | ||
| 839 | u64 base_address; | ||
| 840 | u32 flags; | ||
| 841 | u16 spi_count; | ||
| 842 | u16 spi_base; | ||
| 843 | }; | ||
| 844 | |||
| 845 | /* Masks for Flags field above */ | ||
| 846 | |||
| 847 | #define ACPI_MADT_OVERRIDE_SPI_VALUES (1) | ||
| 848 | |||
| 849 | /* 14: Generic Redistributor (ACPI 5.1) */ | ||
| 850 | |||
| 851 | struct acpi_madt_generic_redistributor { | ||
| 852 | struct acpi_subtable_header header; | ||
| 853 | u16 reserved; /* reserved - must be zero */ | ||
| 854 | u64 base_address; | ||
| 855 | u32 length; | ||
| 856 | }; | ||
| 857 | |||
| 820 | /* | 858 | /* |
| 821 | * Common flags fields for MADT subtables | 859 | * Common flags fields for MADT subtables |
| 822 | */ | 860 | */ |
| 823 | 861 | ||
| 824 | /* MADT Local APIC flags (lapic_flags) and GIC flags */ | 862 | /* MADT Local APIC flags */ |
| 825 | 863 | ||
| 826 | #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ | 864 | #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ |
| 827 | 865 | ||
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 860e5c883eb3..ecff62405f17 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h | |||
| @@ -396,7 +396,7 @@ struct acpi_table_dbgp { | |||
| 396 | * Version 1 | 396 | * Version 1 |
| 397 | * | 397 | * |
| 398 | * Conforms to "Intel Virtualization Technology for Directed I/O", | 398 | * Conforms to "Intel Virtualization Technology for Directed I/O", |
| 399 | * Version 1.2, Sept. 2008 | 399 | * Version 2.2, Sept. 2013 |
| 400 | * | 400 | * |
| 401 | ******************************************************************************/ | 401 | ******************************************************************************/ |
| 402 | 402 | ||
| @@ -423,9 +423,9 @@ struct acpi_dmar_header { | |||
| 423 | enum acpi_dmar_type { | 423 | enum acpi_dmar_type { |
| 424 | ACPI_DMAR_TYPE_HARDWARE_UNIT = 0, | 424 | ACPI_DMAR_TYPE_HARDWARE_UNIT = 0, |
| 425 | ACPI_DMAR_TYPE_RESERVED_MEMORY = 1, | 425 | ACPI_DMAR_TYPE_RESERVED_MEMORY = 1, |
| 426 | ACPI_DMAR_TYPE_ATSR = 2, | 426 | ACPI_DMAR_TYPE_ROOT_ATS = 2, |
| 427 | ACPI_DMAR_HARDWARE_AFFINITY = 3, | 427 | ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3, |
| 428 | ACPI_DMAR_TYPE_ANDD = 4, | 428 | ACPI_DMAR_TYPE_NAMESPACE = 4, |
| 429 | ACPI_DMAR_TYPE_RESERVED = 5 /* 5 and greater are reserved */ | 429 | ACPI_DMAR_TYPE_RESERVED = 5 /* 5 and greater are reserved */ |
| 430 | }; | 430 | }; |
| 431 | 431 | ||
| @@ -439,7 +439,7 @@ struct acpi_dmar_device_scope { | |||
| 439 | u8 bus; | 439 | u8 bus; |
| 440 | }; | 440 | }; |
| 441 | 441 | ||
| 442 | /* Values for entry_type in struct acpi_dmar_device_scope */ | 442 | /* Values for entry_type in struct acpi_dmar_device_scope - device types */ |
| 443 | 443 | ||
| 444 | enum acpi_dmar_scope_type { | 444 | enum acpi_dmar_scope_type { |
| 445 | ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0, | 445 | ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0, |
| @@ -447,7 +447,7 @@ enum acpi_dmar_scope_type { | |||
| 447 | ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2, | 447 | ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2, |
| 448 | ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3, | 448 | ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3, |
| 449 | ACPI_DMAR_SCOPE_TYPE_HPET = 4, | 449 | ACPI_DMAR_SCOPE_TYPE_HPET = 4, |
| 450 | ACPI_DMAR_SCOPE_TYPE_ACPI = 5, | 450 | ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5, |
| 451 | ACPI_DMAR_SCOPE_TYPE_RESERVED = 6 /* 6 and greater are reserved */ | 451 | ACPI_DMAR_SCOPE_TYPE_RESERVED = 6 /* 6 and greater are reserved */ |
| 452 | }; | 452 | }; |
| 453 | 453 | ||
| @@ -516,7 +516,7 @@ struct acpi_dmar_andd { | |||
| 516 | struct acpi_dmar_header header; | 516 | struct acpi_dmar_header header; |
| 517 | u8 reserved[3]; | 517 | u8 reserved[3]; |
| 518 | u8 device_number; | 518 | u8 device_number; |
| 519 | u8 object_name[]; | 519 | char device_name[1]; |
| 520 | }; | 520 | }; |
| 521 | 521 | ||
| 522 | /******************************************************************************* | 522 | /******************************************************************************* |
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h index c2295cc4a5c0..787bcc814463 100644 --- a/include/acpi/actbl3.h +++ b/include/acpi/actbl3.h | |||
| @@ -241,33 +241,96 @@ struct acpi_s3pt_suspend { | |||
| 241 | 241 | ||
| 242 | /******************************************************************************* | 242 | /******************************************************************************* |
| 243 | * | 243 | * |
| 244 | * GTDT - Generic Timer Description Table (ACPI 5.0) | 244 | * GTDT - Generic Timer Description Table (ACPI 5.1) |
| 245 | * Version 1 | 245 | * Version 2 |
| 246 | * | 246 | * |
| 247 | ******************************************************************************/ | 247 | ******************************************************************************/ |
| 248 | 248 | ||
| 249 | struct acpi_table_gtdt { | 249 | struct acpi_table_gtdt { |
| 250 | struct acpi_table_header header; /* Common ACPI table header */ | 250 | struct acpi_table_header header; /* Common ACPI table header */ |
| 251 | u64 address; | 251 | u64 counter_block_addresss; |
| 252 | u32 flags; | 252 | u32 reserved; |
| 253 | u32 secure_pl1_interrupt; | 253 | u32 secure_el1_interrupt; |
| 254 | u32 secure_pl1_flags; | 254 | u32 secure_el1_flags; |
| 255 | u32 non_secure_pl1_interrupt; | 255 | u32 non_secure_el1_interrupt; |
| 256 | u32 non_secure_pl1_flags; | 256 | u32 non_secure_el1_flags; |
| 257 | u32 virtual_timer_interrupt; | 257 | u32 virtual_timer_interrupt; |
| 258 | u32 virtual_timer_flags; | 258 | u32 virtual_timer_flags; |
| 259 | u32 non_secure_pl2_interrupt; | 259 | u32 non_secure_el2_interrupt; |
| 260 | u32 non_secure_pl2_flags; | 260 | u32 non_secure_el2_flags; |
| 261 | u64 counter_read_block_address; | ||
| 262 | u32 platform_timer_count; | ||
| 263 | u32 platform_timer_offset; | ||
| 261 | }; | 264 | }; |
| 262 | 265 | ||
| 263 | /* Values for Flags field above */ | 266 | /* Flag Definitions: Timer Block Physical Timers and Virtual timers */ |
| 267 | |||
| 268 | #define ACPI_GTDT_INTERRUPT_MODE (1) | ||
| 269 | #define ACPI_GTDT_INTERRUPT_POLARITY (1<<1) | ||
| 270 | #define ACPI_GTDT_ALWAYS_ON (1<<2) | ||
| 271 | |||
| 272 | /* Common GTDT subtable header */ | ||
| 273 | |||
| 274 | struct acpi_gtdt_header { | ||
| 275 | u8 type; | ||
| 276 | u16 length; | ||
| 277 | }; | ||
| 264 | 278 | ||
| 265 | #define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1 | 279 | /* Values for GTDT subtable type above */ |
| 266 | 280 | ||
| 267 | /* Values for all "TimerFlags" fields above */ | 281 | enum acpi_gtdt_type { |
| 282 | ACPI_GTDT_TYPE_TIMER_BLOCK = 0, | ||
| 283 | ACPI_GTDT_TYPE_WATCHDOG = 1, | ||
| 284 | ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */ | ||
| 285 | }; | ||
| 286 | |||
| 287 | /* GTDT Subtables, correspond to Type in struct acpi_gtdt_header */ | ||
| 288 | |||
| 289 | /* 0: Generic Timer Block */ | ||
| 290 | |||
| 291 | struct acpi_gtdt_timer_block { | ||
| 292 | struct acpi_gtdt_header header; | ||
| 293 | u8 reserved; | ||
| 294 | u64 block_address; | ||
| 295 | u32 timer_count; | ||
| 296 | u32 timer_offset; | ||
| 297 | }; | ||
| 298 | |||
| 299 | /* Timer Sub-Structure, one per timer */ | ||
| 300 | |||
| 301 | struct acpi_gtdt_timer_entry { | ||
| 302 | u8 frame_number; | ||
| 303 | u8 reserved[3]; | ||
| 304 | u64 base_address; | ||
| 305 | u64 el0_base_address; | ||
| 306 | u32 timer_interrupt; | ||
| 307 | u32 timer_flags; | ||
| 308 | u32 virtual_timer_interrupt; | ||
| 309 | u32 virtual_timer_flags; | ||
| 310 | u32 common_flags; | ||
| 311 | }; | ||
| 268 | 312 | ||
| 269 | #define ACPI_GTDT_INTERRUPT_MODE 1 | 313 | /* Flag Definitions: common_flags above */ |
| 270 | #define ACPI_GTDT_INTERRUPT_POLARITY 2 | 314 | |
| 315 | #define ACPI_GTDT_GT_IS_SECURE_TIMER (1) | ||
| 316 | #define ACPI_GTDT_GT_ALWAYS_ON (1<<1) | ||
| 317 | |||
| 318 | /* 1: SBSA Generic Watchdog Structure */ | ||
| 319 | |||
| 320 | struct acpi_gtdt_watchdog { | ||
| 321 | struct acpi_gtdt_header header; | ||
| 322 | u8 reserved; | ||
| 323 | u64 refresh_frame_address; | ||
| 324 | u64 control_frame_address; | ||
| 325 | u32 timer_interrupt; | ||
| 326 | u32 timer_flags; | ||
| 327 | }; | ||
| 328 | |||
| 329 | /* Flag Definitions: timer_flags above */ | ||
| 330 | |||
| 331 | #define ACPI_GTDT_WATCHDOG_IRQ_MODE (1) | ||
| 332 | #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1) | ||
| 333 | #define ACPI_GTDT_WATCHDOG_SECURE (1<<2) | ||
| 271 | 334 | ||
| 272 | /******************************************************************************* | 335 | /******************************************************************************* |
| 273 | * | 336 | * |
| @@ -385,7 +448,8 @@ struct acpi_table_pcct { | |||
| 385 | 448 | ||
| 386 | enum acpi_pcct_type { | 449 | enum acpi_pcct_type { |
| 387 | ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, | 450 | ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, |
| 388 | ACPI_PCCT_TYPE_RESERVED = 1 /* 1 and greater are reserved */ | 451 | ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1, |
| 452 | ACPI_PCCT_TYPE_RESERVED = 2 /* 2 and greater are reserved */ | ||
| 389 | }; | 453 | }; |
| 390 | 454 | ||
| 391 | /* | 455 | /* |
| @@ -407,6 +471,28 @@ struct acpi_pcct_subspace { | |||
| 407 | u16 min_turnaround_time; | 471 | u16 min_turnaround_time; |
| 408 | }; | 472 | }; |
| 409 | 473 | ||
| 474 | /* 1: HW-reduced Communications Subspace (ACPI 5.1) */ | ||
| 475 | |||
| 476 | struct acpi_pcct_hw_reduced { | ||
| 477 | struct acpi_subtable_header header; | ||
| 478 | u32 doorbell_interrupt; | ||
| 479 | u8 flags; | ||
| 480 | u8 reserved; | ||
| 481 | u64 base_address; | ||
| 482 | u64 length; | ||
| 483 | struct acpi_generic_address doorbell_register; | ||
| 484 | u64 preserve_mask; | ||
| 485 | u64 write_mask; | ||
| 486 | u32 latency; | ||
| 487 | u32 max_access_rate; | ||
| 488 | u16 min_turnaround_time; | ||
| 489 | }; | ||
| 490 | |||
| 491 | /* Values for doorbell flags above */ | ||
| 492 | |||
| 493 | #define ACPI_PCCT_INTERRUPT_POLARITY (1) | ||
| 494 | #define ACPI_PCCT_INTERRUPT_MODE (1<<1) | ||
| 495 | |||
| 410 | /* | 496 | /* |
| 411 | * PCC memory structures (not part of the ACPI table) | 497 | * PCC memory structures (not part of the ACPI table) |
| 412 | */ | 498 | */ |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 19b26bb69a70..ac03ec81d342 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
| @@ -126,6 +126,7 @@ | |||
| 126 | typedef unsigned char u8; | 126 | typedef unsigned char u8; |
| 127 | typedef unsigned char u8; | 127 | typedef unsigned char u8; |
| 128 | typedef unsigned short u16; | 128 | typedef unsigned short u16; |
| 129 | typedef short s16; | ||
| 129 | typedef COMPILER_DEPENDENT_UINT64 u64; | 130 | typedef COMPILER_DEPENDENT_UINT64 u64; |
| 130 | typedef COMPILER_DEPENDENT_INT64 s64; | 131 | typedef COMPILER_DEPENDENT_INT64 s64; |
| 131 | 132 | ||
| @@ -516,7 +517,7 @@ typedef u64 acpi_integer; | |||
| 516 | 517 | ||
| 517 | #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(acpi_size) i) | 518 | #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(acpi_size) i) |
| 518 | #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL) | 519 | #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL) |
| 519 | #define ACPI_OFFSET(d, f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL) | 520 | #define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) NULL) |
| 520 | #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) | 521 | #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) |
| 521 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) | 522 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) |
| 522 | 523 | ||
| @@ -611,8 +612,9 @@ typedef u64 acpi_integer; | |||
| 611 | #define ACPI_NOTIFY_RESERVED (u8) 0x0A | 612 | #define ACPI_NOTIFY_RESERVED (u8) 0x0A |
| 612 | #define ACPI_NOTIFY_LOCALITY_UPDATE (u8) 0x0B | 613 | #define ACPI_NOTIFY_LOCALITY_UPDATE (u8) 0x0B |
| 613 | #define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C | 614 | #define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C |
| 615 | #define ACPI_NOTIFY_AFFINITY_UPDATE (u8) 0x0D | ||
| 614 | 616 | ||
| 615 | #define ACPI_NOTIFY_MAX 0x0C | 617 | #define ACPI_NOTIFY_MAX 0x0D |
| 616 | 618 | ||
| 617 | /* | 619 | /* |
| 618 | * Types associated with ACPI names and objects. The first group of | 620 | * Types associated with ACPI names and objects. The first group of |
| @@ -1244,4 +1246,17 @@ struct acpi_memory_list { | |||
| 1244 | #define ACPI_OSI_WIN_7 0x0B | 1246 | #define ACPI_OSI_WIN_7 0x0B |
| 1245 | #define ACPI_OSI_WIN_8 0x0C | 1247 | #define ACPI_OSI_WIN_8 0x0C |
| 1246 | 1248 | ||
| 1249 | /* Definitions of file IO */ | ||
| 1250 | |||
| 1251 | #define ACPI_FILE_READING 0x01 | ||
| 1252 | #define ACPI_FILE_WRITING 0x02 | ||
| 1253 | #define ACPI_FILE_BINARY 0x04 | ||
| 1254 | |||
| 1255 | #define ACPI_FILE_BEGIN 0x01 | ||
| 1256 | #define ACPI_FILE_END 0x02 | ||
| 1257 | |||
| 1258 | /* Definitions of getopt */ | ||
| 1259 | |||
| 1260 | #define ACPI_OPT_END -1 | ||
| 1261 | |||
| 1247 | #endif /* __ACTYPES_H__ */ | 1262 | #endif /* __ACTYPES_H__ */ |
diff --git a/include/acpi/apei.h b/include/acpi/apei.h index 04f349d8da73..76284bb560a6 100644 --- a/include/acpi/apei.h +++ b/include/acpi/apei.h | |||
| @@ -42,5 +42,9 @@ ssize_t erst_read(u64 record_id, struct cper_record_header *record, | |||
| 42 | size_t buflen); | 42 | size_t buflen); |
| 43 | int erst_clear(u64 record_id); | 43 | int erst_clear(u64 record_id); |
| 44 | 44 | ||
| 45 | int arch_apei_enable_cmcff(struct acpi_hest_header *hest_hdr, void *data); | ||
| 46 | void arch_apei_report_mem_error(int sev, struct cper_sec_mem_err *mem_err); | ||
| 47 | void arch_apei_flush_tlb_one(unsigned long addr); | ||
| 48 | |||
| 45 | #endif | 49 | #endif |
| 46 | #endif | 50 | #endif |
diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h index dfd60d0bfd27..720446cb243e 100644 --- a/include/acpi/ghes.h +++ b/include/acpi/ghes.h | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | struct ghes { | 15 | struct ghes { |
| 16 | struct acpi_hest_generic *generic; | 16 | struct acpi_hest_generic *generic; |
| 17 | struct acpi_generic_status *estatus; | 17 | struct acpi_hest_generic_status *estatus; |
| 18 | u64 buffer_paddr; | 18 | u64 buffer_paddr; |
| 19 | unsigned long flags; | 19 | unsigned long flags; |
| 20 | union { | 20 | union { |
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index e863dd5c4e04..5f8cc1fa3278 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
| @@ -87,20 +87,14 @@ | |||
| 87 | #define ACPI_DBG_TRACK_ALLOCATIONS | 87 | #define ACPI_DBG_TRACK_ALLOCATIONS |
| 88 | #endif | 88 | #endif |
| 89 | 89 | ||
| 90 | /* acpi_names configuration. Single threaded with debugger output enabled. */ | ||
| 91 | |||
| 92 | #ifdef ACPI_NAMES_APP | ||
| 93 | #define ACPI_DEBUGGER | ||
| 94 | #define ACPI_APPLICATION | ||
| 95 | #define ACPI_SINGLE_THREADED | ||
| 96 | #endif | ||
| 97 | |||
| 98 | /* | 90 | /* |
| 99 | * acpi_bin/acpi_dump/acpi_src/acpi_xtract/Example configuration. All single | 91 | * acpi_bin/acpi_dump/acpi_help/acpi_names/acpi_src/acpi_xtract/Example configuration. |
| 100 | * threaded, with no debug output. | 92 | * All single threaded. |
| 101 | */ | 93 | */ |
| 102 | #if (defined ACPI_BIN_APP) || \ | 94 | #if (defined ACPI_BIN_APP) || \ |
| 103 | (defined ACPI_DUMP_APP) || \ | 95 | (defined ACPI_DUMP_APP) || \ |
| 96 | (defined ACPI_HELP_APP) || \ | ||
| 97 | (defined ACPI_NAMES_APP) || \ | ||
| 104 | (defined ACPI_SRC_APP) || \ | 98 | (defined ACPI_SRC_APP) || \ |
| 105 | (defined ACPI_XTRACT_APP) || \ | 99 | (defined ACPI_XTRACT_APP) || \ |
| 106 | (defined ACPI_EXAMPLE_APP) | 100 | (defined ACPI_EXAMPLE_APP) |
| @@ -108,12 +102,40 @@ | |||
| 108 | #define ACPI_SINGLE_THREADED | 102 | #define ACPI_SINGLE_THREADED |
| 109 | #endif | 103 | #endif |
| 110 | 104 | ||
| 105 | /* acpi_help configuration. Error messages disabled. */ | ||
| 106 | |||
| 111 | #ifdef ACPI_HELP_APP | 107 | #ifdef ACPI_HELP_APP |
| 112 | #define ACPI_APPLICATION | ||
| 113 | #define ACPI_SINGLE_THREADED | ||
| 114 | #define ACPI_NO_ERROR_MESSAGES | 108 | #define ACPI_NO_ERROR_MESSAGES |
| 115 | #endif | 109 | #endif |
| 116 | 110 | ||
| 111 | /* acpi_names configuration. Debug output enabled. */ | ||
| 112 | |||
| 113 | #ifdef ACPI_NAMES_APP | ||
| 114 | #define ACPI_DEBUG_OUTPUT | ||
| 115 | #endif | ||
| 116 | |||
| 117 | /* acpi_exec/acpi_names/Example configuration. Native RSDP used. */ | ||
| 118 | |||
| 119 | #if (defined ACPI_EXEC_APP) || \ | ||
| 120 | (defined ACPI_EXAMPLE_APP) || \ | ||
| 121 | (defined ACPI_NAMES_APP) | ||
| 122 | #define ACPI_USE_NATIVE_RSDP_POINTER | ||
| 123 | #endif | ||
| 124 | |||
| 125 | /* acpi_dump configuration. Native mapping used if provied by OSPMs */ | ||
| 126 | |||
| 127 | #ifdef ACPI_DUMP_APP | ||
| 128 | #define ACPI_USE_NATIVE_MEMORY_MAPPING | ||
| 129 | #define USE_NATIVE_ALLOCATE_ZEROED | ||
| 130 | #endif | ||
| 131 | |||
| 132 | /* acpi_names/Example configuration. Hardware disabled */ | ||
| 133 | |||
| 134 | #if (defined ACPI_EXAMPLE_APP) || \ | ||
| 135 | (defined ACPI_NAMES_APP) | ||
| 136 | #define ACPI_REDUCED_HARDWARE 1 | ||
| 137 | #endif | ||
| 138 | |||
| 117 | /* Linkable ACPICA library */ | 139 | /* Linkable ACPICA library */ |
| 118 | 140 | ||
| 119 | #ifdef ACPI_LIBRARY | 141 | #ifdef ACPI_LIBRARY |
| @@ -185,6 +207,9 @@ | |||
| 185 | #elif defined(_AED_EFI) | 207 | #elif defined(_AED_EFI) |
| 186 | #include "acefi.h" | 208 | #include "acefi.h" |
| 187 | 209 | ||
| 210 | #elif defined(_GNU_EFI) | ||
| 211 | #include "acefi.h" | ||
| 212 | |||
| 188 | #elif defined(__HAIKU__) | 213 | #elif defined(__HAIKU__) |
| 189 | #include "achaiku.h" | 214 | #include "achaiku.h" |
| 190 | 215 | ||
| @@ -399,8 +424,12 @@ typedef char *va_list; | |||
| 399 | #ifdef ACPI_APPLICATION | 424 | #ifdef ACPI_APPLICATION |
| 400 | #include <stdio.h> | 425 | #include <stdio.h> |
| 401 | #define ACPI_FILE FILE * | 426 | #define ACPI_FILE FILE * |
| 427 | #define ACPI_FILE_OUT stdout | ||
| 428 | #define ACPI_FILE_ERR stderr | ||
| 402 | #else | 429 | #else |
| 403 | #define ACPI_FILE void * | 430 | #define ACPI_FILE void * |
| 431 | #define ACPI_FILE_OUT NULL | ||
| 432 | #define ACPI_FILE_ERR NULL | ||
| 404 | #endif /* ACPI_APPLICATION */ | 433 | #endif /* ACPI_APPLICATION */ |
| 405 | #endif /* ACPI_FILE */ | 434 | #endif /* ACPI_FILE */ |
| 406 | 435 | ||
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index cd1f052d55bb..1ba7c190c2cc 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
| @@ -44,6 +44,16 @@ | |||
| 44 | #ifndef __ACLINUX_H__ | 44 | #ifndef __ACLINUX_H__ |
| 45 | #define __ACLINUX_H__ | 45 | #define __ACLINUX_H__ |
| 46 | 46 | ||
| 47 | #ifdef __KERNEL__ | ||
| 48 | |||
| 49 | /* ACPICA external files should not include ACPICA headers directly. */ | ||
| 50 | |||
| 51 | #if !defined(BUILDING_ACPICA) && !defined(_LINUX_ACPI_H) | ||
| 52 | #error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead." | ||
| 53 | #endif | ||
| 54 | |||
| 55 | #endif | ||
| 56 | |||
| 47 | /* Common (in-kernel/user-space) ACPICA configuration */ | 57 | /* Common (in-kernel/user-space) ACPICA configuration */ |
| 48 | 58 | ||
| 49 | #define ACPI_USE_SYSTEM_CLIBRARY | 59 | #define ACPI_USE_SYSTEM_CLIBRARY |
| @@ -70,7 +80,9 @@ | |||
| 70 | #ifdef EXPORT_ACPI_INTERFACES | 80 | #ifdef EXPORT_ACPI_INTERFACES |
| 71 | #include <linux/export.h> | 81 | #include <linux/export.h> |
| 72 | #endif | 82 | #endif |
| 83 | #ifdef CONFIG_ACPI | ||
| 73 | #include <asm/acenv.h> | 84 | #include <asm/acenv.h> |
| 85 | #endif | ||
| 74 | 86 | ||
| 75 | #ifndef CONFIG_ACPI | 87 | #ifndef CONFIG_ACPI |
| 76 | 88 | ||
diff --git a/include/acpi/platform/aclinuxex.h b/include/acpi/platform/aclinuxex.h index 191e741cfa0e..568d4b886712 100644 --- a/include/acpi/platform/aclinuxex.h +++ b/include/acpi/platform/aclinuxex.h | |||
| @@ -46,6 +46,28 @@ | |||
| 46 | 46 | ||
| 47 | #ifdef __KERNEL__ | 47 | #ifdef __KERNEL__ |
| 48 | 48 | ||
| 49 | #ifndef ACPI_USE_NATIVE_DIVIDE | ||
| 50 | |||
| 51 | #ifndef ACPI_DIV_64_BY_32 | ||
| 52 | #define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \ | ||
| 53 | do { \ | ||
| 54 | u64 (__n) = ((u64) n_hi) << 32 | (n_lo); \ | ||
| 55 | (r32) = do_div ((__n), (d32)); \ | ||
| 56 | (q32) = (u32) (__n); \ | ||
| 57 | } while (0) | ||
| 58 | #endif | ||
| 59 | |||
| 60 | #ifndef ACPI_SHIFT_RIGHT_64 | ||
| 61 | #define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \ | ||
| 62 | do { \ | ||
| 63 | (n_lo) >>= 1; \ | ||
| 64 | (n_lo) |= (((n_hi) & 1) << 31); \ | ||
| 65 | (n_hi) >>= 1; \ | ||
| 66 | } while (0) | ||
| 67 | #endif | ||
| 68 | |||
| 69 | #endif | ||
| 70 | |||
| 49 | /* | 71 | /* |
| 50 | * Overrides for in-kernel ACPICA | 72 | * Overrides for in-kernel ACPICA |
| 51 | */ | 73 | */ |
diff --git a/include/asm-generic/io-64-nonatomic-hi-lo.h b/include/asm-generic/io-64-nonatomic-hi-lo.h index a6806a94250d..2e29d13fc154 100644 --- a/include/asm-generic/io-64-nonatomic-hi-lo.h +++ b/include/asm-generic/io-64-nonatomic-hi-lo.h | |||
| @@ -4,8 +4,7 @@ | |||
| 4 | #include <linux/io.h> | 4 | #include <linux/io.h> |
| 5 | #include <asm-generic/int-ll64.h> | 5 | #include <asm-generic/int-ll64.h> |
| 6 | 6 | ||
| 7 | #ifndef readq | 7 | static inline __u64 hi_lo_readq(const volatile void __iomem *addr) |
| 8 | static inline __u64 readq(const volatile void __iomem *addr) | ||
| 9 | { | 8 | { |
| 10 | const volatile u32 __iomem *p = addr; | 9 | const volatile u32 __iomem *p = addr; |
| 11 | u32 low, high; | 10 | u32 low, high; |
| @@ -15,14 +14,19 @@ static inline __u64 readq(const volatile void __iomem *addr) | |||
| 15 | 14 | ||
| 16 | return low + ((u64)high << 32); | 15 | return low + ((u64)high << 32); |
| 17 | } | 16 | } |
| 18 | #endif | ||
| 19 | 17 | ||
| 20 | #ifndef writeq | 18 | static inline void hi_lo_writeq(__u64 val, volatile void __iomem *addr) |
| 21 | static inline void writeq(__u64 val, volatile void __iomem *addr) | ||
| 22 | { | 19 | { |
| 23 | writel(val >> 32, addr + 4); | 20 | writel(val >> 32, addr + 4); |
| 24 | writel(val, addr); | 21 | writel(val, addr); |
| 25 | } | 22 | } |
| 23 | |||
| 24 | #ifndef readq | ||
| 25 | #define readq hi_lo_readq | ||
| 26 | #endif | ||
| 27 | |||
| 28 | #ifndef writeq | ||
| 29 | #define writeq hi_lo_writeq | ||
| 26 | #endif | 30 | #endif |
| 27 | 31 | ||
| 28 | #endif /* _ASM_IO_64_NONATOMIC_HI_LO_H_ */ | 32 | #endif /* _ASM_IO_64_NONATOMIC_HI_LO_H_ */ |
diff --git a/include/asm-generic/io-64-nonatomic-lo-hi.h b/include/asm-generic/io-64-nonatomic-lo-hi.h index ca546b1ff8b5..0efacff0a1ce 100644 --- a/include/asm-generic/io-64-nonatomic-lo-hi.h +++ b/include/asm-generic/io-64-nonatomic-lo-hi.h | |||
| @@ -4,8 +4,7 @@ | |||
| 4 | #include <linux/io.h> | 4 | #include <linux/io.h> |
| 5 | #include <asm-generic/int-ll64.h> | 5 | #include <asm-generic/int-ll64.h> |
| 6 | 6 | ||
| 7 | #ifndef readq | 7 | static inline __u64 lo_hi_readq(const volatile void __iomem *addr) |
| 8 | static inline __u64 readq(const volatile void __iomem *addr) | ||
| 9 | { | 8 | { |
| 10 | const volatile u32 __iomem *p = addr; | 9 | const volatile u32 __iomem *p = addr; |
| 11 | u32 low, high; | 10 | u32 low, high; |
| @@ -15,14 +14,19 @@ static inline __u64 readq(const volatile void __iomem *addr) | |||
| 15 | 14 | ||
| 16 | return low + ((u64)high << 32); | 15 | return low + ((u64)high << 32); |
| 17 | } | 16 | } |
| 18 | #endif | ||
| 19 | 17 | ||
| 20 | #ifndef writeq | 18 | static inline void lo_hi_writeq(__u64 val, volatile void __iomem *addr) |
| 21 | static inline void writeq(__u64 val, volatile void __iomem *addr) | ||
| 22 | { | 19 | { |
| 23 | writel(val, addr); | 20 | writel(val, addr); |
| 24 | writel(val >> 32, addr + 4); | 21 | writel(val >> 32, addr + 4); |
| 25 | } | 22 | } |
| 23 | |||
| 24 | #ifndef readq | ||
| 25 | #define readq lo_hi_readq | ||
| 26 | #endif | ||
| 27 | |||
| 28 | #ifndef writeq | ||
| 29 | #define writeq lo_hi_writeq | ||
| 26 | #endif | 30 | #endif |
| 27 | 31 | ||
| 28 | #endif /* _ASM_IO_64_NONATOMIC_LO_HI_H_ */ | 32 | #endif /* _ASM_IO_64_NONATOMIC_LO_HI_H_ */ |
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index 0703aa75b5e8..4d9f233c4ba8 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h | |||
| @@ -36,93 +36,385 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; | |||
| 36 | #endif | 36 | #endif |
| 37 | 37 | ||
| 38 | /* | 38 | /* |
| 39 | * Add a offset to a pointer but keep the pointer as is. | 39 | * Arch may define arch_raw_cpu_ptr() to provide more efficient address |
| 40 | * | 40 | * translations for raw_cpu_ptr(). |
| 41 | * Only S390 provides its own means of moving the pointer. | ||
| 42 | */ | 41 | */ |
| 43 | #ifndef SHIFT_PERCPU_PTR | 42 | #ifndef arch_raw_cpu_ptr |
| 44 | /* Weird cast keeps both GCC and sparse happy. */ | 43 | #define arch_raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset) |
| 45 | #define SHIFT_PERCPU_PTR(__p, __offset) ({ \ | ||
| 46 | __verify_pcpu_ptr((__p)); \ | ||
| 47 | RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset)); \ | ||
| 48 | }) | ||
| 49 | #endif | 44 | #endif |
| 50 | 45 | ||
| 51 | /* | 46 | #ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA |
| 52 | * A percpu variable may point to a discarded regions. The following are | 47 | extern void setup_per_cpu_areas(void); |
| 53 | * established ways to produce a usable pointer from the percpu variable | ||
| 54 | * offset. | ||
| 55 | */ | ||
| 56 | #define per_cpu(var, cpu) \ | ||
| 57 | (*SHIFT_PERCPU_PTR(&(var), per_cpu_offset(cpu))) | ||
| 58 | |||
| 59 | #ifndef raw_cpu_ptr | ||
| 60 | #define raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset) | ||
| 61 | #endif | 48 | #endif |
| 62 | #ifdef CONFIG_DEBUG_PREEMPT | 49 | |
| 63 | #define this_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, my_cpu_offset) | 50 | #endif /* SMP */ |
| 51 | |||
| 52 | #ifndef PER_CPU_BASE_SECTION | ||
| 53 | #ifdef CONFIG_SMP | ||
| 54 | #define PER_CPU_BASE_SECTION ".data..percpu" | ||
| 64 | #else | 55 | #else |
| 65 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | 56 | #define PER_CPU_BASE_SECTION ".data" |
| 57 | #endif | ||
| 66 | #endif | 58 | #endif |
| 67 | 59 | ||
| 68 | #define __get_cpu_var(var) (*this_cpu_ptr(&(var))) | 60 | #ifndef PER_CPU_ATTRIBUTES |
| 69 | #define __raw_get_cpu_var(var) (*raw_cpu_ptr(&(var))) | 61 | #define PER_CPU_ATTRIBUTES |
| 62 | #endif | ||
| 70 | 63 | ||
| 71 | #ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA | 64 | #ifndef PER_CPU_DEF_ATTRIBUTES |
| 72 | extern void setup_per_cpu_areas(void); | 65 | #define PER_CPU_DEF_ATTRIBUTES |
| 73 | #endif | 66 | #endif |
| 74 | 67 | ||
| 75 | #else /* ! SMP */ | 68 | #define raw_cpu_generic_to_op(pcp, val, op) \ |
| 69 | do { \ | ||
| 70 | *raw_cpu_ptr(&(pcp)) op val; \ | ||
| 71 | } while (0) | ||
| 76 | 72 | ||
| 77 | #define VERIFY_PERCPU_PTR(__p) ({ \ | 73 | #define raw_cpu_generic_add_return(pcp, val) \ |
| 78 | __verify_pcpu_ptr((__p)); \ | 74 | ({ \ |
| 79 | (typeof(*(__p)) __kernel __force *)(__p); \ | 75 | raw_cpu_add(pcp, val); \ |
| 76 | raw_cpu_read(pcp); \ | ||
| 80 | }) | 77 | }) |
| 81 | 78 | ||
| 82 | #define per_cpu(var, cpu) (*((void)(cpu), VERIFY_PERCPU_PTR(&(var)))) | 79 | #define raw_cpu_generic_xchg(pcp, nval) \ |
| 83 | #define __get_cpu_var(var) (*VERIFY_PERCPU_PTR(&(var))) | 80 | ({ \ |
| 84 | #define __raw_get_cpu_var(var) (*VERIFY_PERCPU_PTR(&(var))) | 81 | typeof(pcp) __ret; \ |
| 85 | #define this_cpu_ptr(ptr) per_cpu_ptr(ptr, 0) | 82 | __ret = raw_cpu_read(pcp); \ |
| 86 | #define raw_cpu_ptr(ptr) this_cpu_ptr(ptr) | 83 | raw_cpu_write(pcp, nval); \ |
| 84 | __ret; \ | ||
| 85 | }) | ||
| 87 | 86 | ||
| 88 | #endif /* SMP */ | 87 | #define raw_cpu_generic_cmpxchg(pcp, oval, nval) \ |
| 88 | ({ \ | ||
| 89 | typeof(pcp) __ret; \ | ||
| 90 | __ret = raw_cpu_read(pcp); \ | ||
| 91 | if (__ret == (oval)) \ | ||
| 92 | raw_cpu_write(pcp, nval); \ | ||
| 93 | __ret; \ | ||
| 94 | }) | ||
| 89 | 95 | ||
| 90 | #ifndef PER_CPU_BASE_SECTION | 96 | #define raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ |
| 91 | #ifdef CONFIG_SMP | 97 | ({ \ |
| 92 | #define PER_CPU_BASE_SECTION ".data..percpu" | 98 | int __ret = 0; \ |
| 93 | #else | 99 | if (raw_cpu_read(pcp1) == (oval1) && \ |
| 94 | #define PER_CPU_BASE_SECTION ".data" | 100 | raw_cpu_read(pcp2) == (oval2)) { \ |
| 101 | raw_cpu_write(pcp1, nval1); \ | ||
| 102 | raw_cpu_write(pcp2, nval2); \ | ||
| 103 | __ret = 1; \ | ||
| 104 | } \ | ||
| 105 | (__ret); \ | ||
| 106 | }) | ||
| 107 | |||
| 108 | #define this_cpu_generic_read(pcp) \ | ||
| 109 | ({ \ | ||
| 110 | typeof(pcp) __ret; \ | ||
| 111 | preempt_disable(); \ | ||
| 112 | __ret = *this_cpu_ptr(&(pcp)); \ | ||
| 113 | preempt_enable(); \ | ||
| 114 | __ret; \ | ||
| 115 | }) | ||
| 116 | |||
| 117 | #define this_cpu_generic_to_op(pcp, val, op) \ | ||
| 118 | do { \ | ||
| 119 | unsigned long __flags; \ | ||
| 120 | raw_local_irq_save(__flags); \ | ||
| 121 | *raw_cpu_ptr(&(pcp)) op val; \ | ||
| 122 | raw_local_irq_restore(__flags); \ | ||
| 123 | } while (0) | ||
| 124 | |||
| 125 | #define this_cpu_generic_add_return(pcp, val) \ | ||
| 126 | ({ \ | ||
| 127 | typeof(pcp) __ret; \ | ||
| 128 | unsigned long __flags; \ | ||
| 129 | raw_local_irq_save(__flags); \ | ||
| 130 | raw_cpu_add(pcp, val); \ | ||
| 131 | __ret = raw_cpu_read(pcp); \ | ||
| 132 | raw_local_irq_restore(__flags); \ | ||
| 133 | __ret; \ | ||
| 134 | }) | ||
| 135 | |||
| 136 | #define this_cpu_generic_xchg(pcp, nval) \ | ||
| 137 | ({ \ | ||
| 138 | typeof(pcp) __ret; \ | ||
| 139 | unsigned long __flags; \ | ||
| 140 | raw_local_irq_save(__flags); \ | ||
| 141 | __ret = raw_cpu_read(pcp); \ | ||
| 142 | raw_cpu_write(pcp, nval); \ | ||
| 143 | raw_local_irq_restore(__flags); \ | ||
| 144 | __ret; \ | ||
| 145 | }) | ||
| 146 | |||
| 147 | #define this_cpu_generic_cmpxchg(pcp, oval, nval) \ | ||
| 148 | ({ \ | ||
| 149 | typeof(pcp) __ret; \ | ||
| 150 | unsigned long __flags; \ | ||
| 151 | raw_local_irq_save(__flags); \ | ||
| 152 | __ret = raw_cpu_read(pcp); \ | ||
| 153 | if (__ret == (oval)) \ | ||
| 154 | raw_cpu_write(pcp, nval); \ | ||
| 155 | raw_local_irq_restore(__flags); \ | ||
| 156 | __ret; \ | ||
| 157 | }) | ||
| 158 | |||
| 159 | #define this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 160 | ({ \ | ||
| 161 | int __ret; \ | ||
| 162 | unsigned long __flags; \ | ||
| 163 | raw_local_irq_save(__flags); \ | ||
| 164 | __ret = raw_cpu_generic_cmpxchg_double(pcp1, pcp2, \ | ||
| 165 | oval1, oval2, nval1, nval2); \ | ||
| 166 | raw_local_irq_restore(__flags); \ | ||
| 167 | __ret; \ | ||
| 168 | }) | ||
| 169 | |||
| 170 | #ifndef raw_cpu_read_1 | ||
| 171 | #define raw_cpu_read_1(pcp) (*raw_cpu_ptr(&(pcp))) | ||
| 95 | #endif | 172 | #endif |
| 173 | #ifndef raw_cpu_read_2 | ||
| 174 | #define raw_cpu_read_2(pcp) (*raw_cpu_ptr(&(pcp))) | ||
| 175 | #endif | ||
| 176 | #ifndef raw_cpu_read_4 | ||
| 177 | #define raw_cpu_read_4(pcp) (*raw_cpu_ptr(&(pcp))) | ||
| 178 | #endif | ||
| 179 | #ifndef raw_cpu_read_8 | ||
| 180 | #define raw_cpu_read_8(pcp) (*raw_cpu_ptr(&(pcp))) | ||
| 96 | #endif | 181 | #endif |
| 97 | 182 | ||
| 98 | #ifdef CONFIG_SMP | 183 | #ifndef raw_cpu_write_1 |
| 184 | #define raw_cpu_write_1(pcp, val) raw_cpu_generic_to_op(pcp, val, =) | ||
| 185 | #endif | ||
| 186 | #ifndef raw_cpu_write_2 | ||
| 187 | #define raw_cpu_write_2(pcp, val) raw_cpu_generic_to_op(pcp, val, =) | ||
| 188 | #endif | ||
| 189 | #ifndef raw_cpu_write_4 | ||
| 190 | #define raw_cpu_write_4(pcp, val) raw_cpu_generic_to_op(pcp, val, =) | ||
| 191 | #endif | ||
| 192 | #ifndef raw_cpu_write_8 | ||
| 193 | #define raw_cpu_write_8(pcp, val) raw_cpu_generic_to_op(pcp, val, =) | ||
| 194 | #endif | ||
| 99 | 195 | ||
| 100 | #ifdef MODULE | 196 | #ifndef raw_cpu_add_1 |
| 101 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | 197 | #define raw_cpu_add_1(pcp, val) raw_cpu_generic_to_op(pcp, val, +=) |
| 102 | #define PER_CPU_ALIGNED_SECTION "" | 198 | #endif |
| 103 | #else | 199 | #ifndef raw_cpu_add_2 |
| 104 | #define PER_CPU_SHARED_ALIGNED_SECTION "..shared_aligned" | 200 | #define raw_cpu_add_2(pcp, val) raw_cpu_generic_to_op(pcp, val, +=) |
| 105 | #define PER_CPU_ALIGNED_SECTION "..shared_aligned" | 201 | #endif |
| 202 | #ifndef raw_cpu_add_4 | ||
| 203 | #define raw_cpu_add_4(pcp, val) raw_cpu_generic_to_op(pcp, val, +=) | ||
| 204 | #endif | ||
| 205 | #ifndef raw_cpu_add_8 | ||
| 206 | #define raw_cpu_add_8(pcp, val) raw_cpu_generic_to_op(pcp, val, +=) | ||
| 106 | #endif | 207 | #endif |
| 107 | #define PER_CPU_FIRST_SECTION "..first" | ||
| 108 | 208 | ||
| 109 | #else | 209 | #ifndef raw_cpu_and_1 |
| 210 | #define raw_cpu_and_1(pcp, val) raw_cpu_generic_to_op(pcp, val, &=) | ||
| 211 | #endif | ||
| 212 | #ifndef raw_cpu_and_2 | ||
| 213 | #define raw_cpu_and_2(pcp, val) raw_cpu_generic_to_op(pcp, val, &=) | ||
| 214 | #endif | ||
| 215 | #ifndef raw_cpu_and_4 | ||
| 216 | #define raw_cpu_and_4(pcp, val) raw_cpu_generic_to_op(pcp, val, &=) | ||
| 217 | #endif | ||
| 218 | #ifndef raw_cpu_and_8 | ||
| 219 | #define raw_cpu_and_8(pcp, val) raw_cpu_generic_to_op(pcp, val, &=) | ||
| 220 | #endif | ||
| 221 | |||
| 222 | #ifndef raw_cpu_or_1 | ||
| 223 | #define raw_cpu_or_1(pcp, val) raw_cpu_generic_to_op(pcp, val, |=) | ||
| 224 | #endif | ||
| 225 | #ifndef raw_cpu_or_2 | ||
| 226 | #define raw_cpu_or_2(pcp, val) raw_cpu_generic_to_op(pcp, val, |=) | ||
| 227 | #endif | ||
| 228 | #ifndef raw_cpu_or_4 | ||
| 229 | #define raw_cpu_or_4(pcp, val) raw_cpu_generic_to_op(pcp, val, |=) | ||
| 230 | #endif | ||
| 231 | #ifndef raw_cpu_or_8 | ||
| 232 | #define raw_cpu_or_8(pcp, val) raw_cpu_generic_to_op(pcp, val, |=) | ||
| 233 | #endif | ||
| 110 | 234 | ||
| 111 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | 235 | #ifndef raw_cpu_add_return_1 |
| 112 | #define PER_CPU_ALIGNED_SECTION "..shared_aligned" | 236 | #define raw_cpu_add_return_1(pcp, val) raw_cpu_generic_add_return(pcp, val) |
| 113 | #define PER_CPU_FIRST_SECTION "" | 237 | #endif |
| 238 | #ifndef raw_cpu_add_return_2 | ||
| 239 | #define raw_cpu_add_return_2(pcp, val) raw_cpu_generic_add_return(pcp, val) | ||
| 240 | #endif | ||
| 241 | #ifndef raw_cpu_add_return_4 | ||
| 242 | #define raw_cpu_add_return_4(pcp, val) raw_cpu_generic_add_return(pcp, val) | ||
| 243 | #endif | ||
| 244 | #ifndef raw_cpu_add_return_8 | ||
| 245 | #define raw_cpu_add_return_8(pcp, val) raw_cpu_generic_add_return(pcp, val) | ||
| 246 | #endif | ||
| 114 | 247 | ||
| 248 | #ifndef raw_cpu_xchg_1 | ||
| 249 | #define raw_cpu_xchg_1(pcp, nval) raw_cpu_generic_xchg(pcp, nval) | ||
| 250 | #endif | ||
| 251 | #ifndef raw_cpu_xchg_2 | ||
| 252 | #define raw_cpu_xchg_2(pcp, nval) raw_cpu_generic_xchg(pcp, nval) | ||
| 253 | #endif | ||
| 254 | #ifndef raw_cpu_xchg_4 | ||
| 255 | #define raw_cpu_xchg_4(pcp, nval) raw_cpu_generic_xchg(pcp, nval) | ||
| 256 | #endif | ||
| 257 | #ifndef raw_cpu_xchg_8 | ||
| 258 | #define raw_cpu_xchg_8(pcp, nval) raw_cpu_generic_xchg(pcp, nval) | ||
| 115 | #endif | 259 | #endif |
| 116 | 260 | ||
| 117 | #ifndef PER_CPU_ATTRIBUTES | 261 | #ifndef raw_cpu_cmpxchg_1 |
| 118 | #define PER_CPU_ATTRIBUTES | 262 | #define raw_cpu_cmpxchg_1(pcp, oval, nval) \ |
| 263 | raw_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 264 | #endif | ||
| 265 | #ifndef raw_cpu_cmpxchg_2 | ||
| 266 | #define raw_cpu_cmpxchg_2(pcp, oval, nval) \ | ||
| 267 | raw_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 268 | #endif | ||
| 269 | #ifndef raw_cpu_cmpxchg_4 | ||
| 270 | #define raw_cpu_cmpxchg_4(pcp, oval, nval) \ | ||
| 271 | raw_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 272 | #endif | ||
| 273 | #ifndef raw_cpu_cmpxchg_8 | ||
| 274 | #define raw_cpu_cmpxchg_8(pcp, oval, nval) \ | ||
| 275 | raw_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 119 | #endif | 276 | #endif |
| 120 | 277 | ||
| 121 | #ifndef PER_CPU_DEF_ATTRIBUTES | 278 | #ifndef raw_cpu_cmpxchg_double_1 |
| 122 | #define PER_CPU_DEF_ATTRIBUTES | 279 | #define raw_cpu_cmpxchg_double_1(pcp1, pcp2, oval1, oval2, nval1, nval2) \ |
| 280 | raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 281 | #endif | ||
| 282 | #ifndef raw_cpu_cmpxchg_double_2 | ||
| 283 | #define raw_cpu_cmpxchg_double_2(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 284 | raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 285 | #endif | ||
| 286 | #ifndef raw_cpu_cmpxchg_double_4 | ||
| 287 | #define raw_cpu_cmpxchg_double_4(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 288 | raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 289 | #endif | ||
| 290 | #ifndef raw_cpu_cmpxchg_double_8 | ||
| 291 | #define raw_cpu_cmpxchg_double_8(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 292 | raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 293 | #endif | ||
| 294 | |||
| 295 | #ifndef this_cpu_read_1 | ||
| 296 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp) | ||
| 297 | #endif | ||
| 298 | #ifndef this_cpu_read_2 | ||
| 299 | #define this_cpu_read_2(pcp) this_cpu_generic_read(pcp) | ||
| 300 | #endif | ||
| 301 | #ifndef this_cpu_read_4 | ||
| 302 | #define this_cpu_read_4(pcp) this_cpu_generic_read(pcp) | ||
| 303 | #endif | ||
| 304 | #ifndef this_cpu_read_8 | ||
| 305 | #define this_cpu_read_8(pcp) this_cpu_generic_read(pcp) | ||
| 123 | #endif | 306 | #endif |
| 124 | 307 | ||
| 125 | /* Keep until we have removed all uses of __this_cpu_ptr */ | 308 | #ifndef this_cpu_write_1 |
| 126 | #define __this_cpu_ptr raw_cpu_ptr | 309 | #define this_cpu_write_1(pcp, val) this_cpu_generic_to_op(pcp, val, =) |
| 310 | #endif | ||
| 311 | #ifndef this_cpu_write_2 | ||
| 312 | #define this_cpu_write_2(pcp, val) this_cpu_generic_to_op(pcp, val, =) | ||
| 313 | #endif | ||
| 314 | #ifndef this_cpu_write_4 | ||
| 315 | #define this_cpu_write_4(pcp, val) this_cpu_generic_to_op(pcp, val, =) | ||
| 316 | #endif | ||
| 317 | #ifndef this_cpu_write_8 | ||
| 318 | #define this_cpu_write_8(pcp, val) this_cpu_generic_to_op(pcp, val, =) | ||
| 319 | #endif | ||
| 320 | |||
| 321 | #ifndef this_cpu_add_1 | ||
| 322 | #define this_cpu_add_1(pcp, val) this_cpu_generic_to_op(pcp, val, +=) | ||
| 323 | #endif | ||
| 324 | #ifndef this_cpu_add_2 | ||
| 325 | #define this_cpu_add_2(pcp, val) this_cpu_generic_to_op(pcp, val, +=) | ||
| 326 | #endif | ||
| 327 | #ifndef this_cpu_add_4 | ||
| 328 | #define this_cpu_add_4(pcp, val) this_cpu_generic_to_op(pcp, val, +=) | ||
| 329 | #endif | ||
| 330 | #ifndef this_cpu_add_8 | ||
| 331 | #define this_cpu_add_8(pcp, val) this_cpu_generic_to_op(pcp, val, +=) | ||
| 332 | #endif | ||
| 333 | |||
| 334 | #ifndef this_cpu_and_1 | ||
| 335 | #define this_cpu_and_1(pcp, val) this_cpu_generic_to_op(pcp, val, &=) | ||
| 336 | #endif | ||
| 337 | #ifndef this_cpu_and_2 | ||
| 338 | #define this_cpu_and_2(pcp, val) this_cpu_generic_to_op(pcp, val, &=) | ||
| 339 | #endif | ||
| 340 | #ifndef this_cpu_and_4 | ||
| 341 | #define this_cpu_and_4(pcp, val) this_cpu_generic_to_op(pcp, val, &=) | ||
| 342 | #endif | ||
| 343 | #ifndef this_cpu_and_8 | ||
| 344 | #define this_cpu_and_8(pcp, val) this_cpu_generic_to_op(pcp, val, &=) | ||
| 345 | #endif | ||
| 346 | |||
| 347 | #ifndef this_cpu_or_1 | ||
| 348 | #define this_cpu_or_1(pcp, val) this_cpu_generic_to_op(pcp, val, |=) | ||
| 349 | #endif | ||
| 350 | #ifndef this_cpu_or_2 | ||
| 351 | #define this_cpu_or_2(pcp, val) this_cpu_generic_to_op(pcp, val, |=) | ||
| 352 | #endif | ||
| 353 | #ifndef this_cpu_or_4 | ||
| 354 | #define this_cpu_or_4(pcp, val) this_cpu_generic_to_op(pcp, val, |=) | ||
| 355 | #endif | ||
| 356 | #ifndef this_cpu_or_8 | ||
| 357 | #define this_cpu_or_8(pcp, val) this_cpu_generic_to_op(pcp, val, |=) | ||
| 358 | #endif | ||
| 359 | |||
| 360 | #ifndef this_cpu_add_return_1 | ||
| 361 | #define this_cpu_add_return_1(pcp, val) this_cpu_generic_add_return(pcp, val) | ||
| 362 | #endif | ||
| 363 | #ifndef this_cpu_add_return_2 | ||
| 364 | #define this_cpu_add_return_2(pcp, val) this_cpu_generic_add_return(pcp, val) | ||
| 365 | #endif | ||
| 366 | #ifndef this_cpu_add_return_4 | ||
| 367 | #define this_cpu_add_return_4(pcp, val) this_cpu_generic_add_return(pcp, val) | ||
| 368 | #endif | ||
| 369 | #ifndef this_cpu_add_return_8 | ||
| 370 | #define this_cpu_add_return_8(pcp, val) this_cpu_generic_add_return(pcp, val) | ||
| 371 | #endif | ||
| 372 | |||
| 373 | #ifndef this_cpu_xchg_1 | ||
| 374 | #define this_cpu_xchg_1(pcp, nval) this_cpu_generic_xchg(pcp, nval) | ||
| 375 | #endif | ||
| 376 | #ifndef this_cpu_xchg_2 | ||
| 377 | #define this_cpu_xchg_2(pcp, nval) this_cpu_generic_xchg(pcp, nval) | ||
| 378 | #endif | ||
| 379 | #ifndef this_cpu_xchg_4 | ||
| 380 | #define this_cpu_xchg_4(pcp, nval) this_cpu_generic_xchg(pcp, nval) | ||
| 381 | #endif | ||
| 382 | #ifndef this_cpu_xchg_8 | ||
| 383 | #define this_cpu_xchg_8(pcp, nval) this_cpu_generic_xchg(pcp, nval) | ||
| 384 | #endif | ||
| 385 | |||
| 386 | #ifndef this_cpu_cmpxchg_1 | ||
| 387 | #define this_cpu_cmpxchg_1(pcp, oval, nval) \ | ||
| 388 | this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 389 | #endif | ||
| 390 | #ifndef this_cpu_cmpxchg_2 | ||
| 391 | #define this_cpu_cmpxchg_2(pcp, oval, nval) \ | ||
| 392 | this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 393 | #endif | ||
| 394 | #ifndef this_cpu_cmpxchg_4 | ||
| 395 | #define this_cpu_cmpxchg_4(pcp, oval, nval) \ | ||
| 396 | this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 397 | #endif | ||
| 398 | #ifndef this_cpu_cmpxchg_8 | ||
| 399 | #define this_cpu_cmpxchg_8(pcp, oval, nval) \ | ||
| 400 | this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 401 | #endif | ||
| 402 | |||
| 403 | #ifndef this_cpu_cmpxchg_double_1 | ||
| 404 | #define this_cpu_cmpxchg_double_1(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 405 | this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 406 | #endif | ||
| 407 | #ifndef this_cpu_cmpxchg_double_2 | ||
| 408 | #define this_cpu_cmpxchg_double_2(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 409 | this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 410 | #endif | ||
| 411 | #ifndef this_cpu_cmpxchg_double_4 | ||
| 412 | #define this_cpu_cmpxchg_double_4(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 413 | this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 414 | #endif | ||
| 415 | #ifndef this_cpu_cmpxchg_double_8 | ||
| 416 | #define this_cpu_cmpxchg_double_8(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 417 | this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 418 | #endif | ||
| 127 | 419 | ||
| 128 | #endif /* _ASM_GENERIC_PERCPU_H_ */ | 420 | #endif /* _ASM_GENERIC_PERCPU_H_ */ |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index c1c0b0cf39b4..5ba0360663a7 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
| @@ -268,6 +268,9 @@ | |||
| 268 | VMLINUX_SYMBOL(__start_pci_fixups_suspend) = .; \ | 268 | VMLINUX_SYMBOL(__start_pci_fixups_suspend) = .; \ |
| 269 | *(.pci_fixup_suspend) \ | 269 | *(.pci_fixup_suspend) \ |
| 270 | VMLINUX_SYMBOL(__end_pci_fixups_suspend) = .; \ | 270 | VMLINUX_SYMBOL(__end_pci_fixups_suspend) = .; \ |
| 271 | VMLINUX_SYMBOL(__start_pci_fixups_suspend_late) = .; \ | ||
| 272 | *(.pci_fixup_suspend_late) \ | ||
| 273 | VMLINUX_SYMBOL(__end_pci_fixups_suspend_late) = .; \ | ||
| 271 | } \ | 274 | } \ |
| 272 | \ | 275 | \ |
| 273 | /* Built-in firmware blobs */ \ | 276 | /* Built-in firmware blobs */ \ |
diff --git a/include/clocksource/pxa.h b/include/clocksource/pxa.h new file mode 100644 index 000000000000..1efbe5a66958 --- /dev/null +++ b/include/clocksource/pxa.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /* | ||
| 2 | * PXA clocksource, clockevents, and OST interrupt handlers. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2014 Robert Jarzmik | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; version 2 of the License. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef _CLOCKSOURCE_PXA_H | ||
| 13 | #define _CLOCKSOURCE_PXA_H | ||
| 14 | |||
| 15 | extern void pxa_timer_nodt_init(int irq, void __iomem *base, | ||
| 16 | unsigned long clock_tick_rate); | ||
| 17 | |||
| 18 | #endif | ||
diff --git a/include/crypto/aead.h b/include/crypto/aead.h index 0edf949f6369..94b19be67574 100644 --- a/include/crypto/aead.h +++ b/include/crypto/aead.h | |||
| @@ -75,9 +75,9 @@ static inline void aead_givcrypt_free(struct aead_givcrypt_request *req) | |||
| 75 | 75 | ||
| 76 | static inline void aead_givcrypt_set_callback( | 76 | static inline void aead_givcrypt_set_callback( |
| 77 | struct aead_givcrypt_request *req, u32 flags, | 77 | struct aead_givcrypt_request *req, u32 flags, |
| 78 | crypto_completion_t complete, void *data) | 78 | crypto_completion_t compl, void *data) |
| 79 | { | 79 | { |
| 80 | aead_request_set_callback(&req->areq, flags, complete, data); | 80 | aead_request_set_callback(&req->areq, flags, compl, data); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | static inline void aead_givcrypt_set_crypt(struct aead_givcrypt_request *req, | 83 | static inline void aead_givcrypt_set_crypt(struct aead_givcrypt_request *req, |
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 016c2f110f63..623a59c1ff5a 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
| @@ -410,4 +410,10 @@ static inline int crypto_memneq(const void *a, const void *b, size_t size) | |||
| 410 | return __crypto_memneq(a, b, size) != 0UL ? 1 : 0; | 410 | return __crypto_memneq(a, b, size) != 0UL ? 1 : 0; |
| 411 | } | 411 | } |
| 412 | 412 | ||
| 413 | static inline void crypto_yield(u32 flags) | ||
| 414 | { | ||
| 415 | if (flags & CRYPTO_TFM_REQ_MAY_SLEEP) | ||
| 416 | cond_resched(); | ||
| 417 | } | ||
| 418 | |||
| 413 | #endif /* _CRYPTO_ALGAPI_H */ | 419 | #endif /* _CRYPTO_ALGAPI_H */ |
diff --git a/include/crypto/des.h b/include/crypto/des.h index 2971c6304ade..fc6274c6bb26 100644 --- a/include/crypto/des.h +++ b/include/crypto/des.h | |||
| @@ -16,4 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | extern unsigned long des_ekey(u32 *pe, const u8 *k); | 17 | extern unsigned long des_ekey(u32 *pe, const u8 *k); |
| 18 | 18 | ||
| 19 | extern int __des3_ede_setkey(u32 *expkey, u32 *flags, const u8 *key, | ||
| 20 | unsigned int keylen); | ||
| 21 | |||
| 19 | #endif /* __CRYPTO_DES_H */ | 22 | #endif /* __CRYPTO_DES_H */ |
diff --git a/include/crypto/drbg.h b/include/crypto/drbg.h new file mode 100644 index 000000000000..831d786976c5 --- /dev/null +++ b/include/crypto/drbg.h | |||
| @@ -0,0 +1,290 @@ | |||
| 1 | /* | ||
| 2 | * DRBG based on NIST SP800-90A | ||
| 3 | * | ||
| 4 | * Copyright Stephan Mueller <smueller@chronox.de>, 2014 | ||
| 5 | * | ||
| 6 | * Redistribution and use in source and binary forms, with or without | ||
| 7 | * modification, are permitted provided that the following conditions | ||
| 8 | * are met: | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, and the entire permission notice in its entirety, | ||
| 11 | * including the disclaimer of warranties. | ||
| 12 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 13 | * notice, this list of conditions and the following disclaimer in the | ||
| 14 | * documentation and/or other materials provided with the distribution. | ||
| 15 | * 3. The name of the author may not be used to endorse or promote | ||
| 16 | * products derived from this software without specific prior | ||
| 17 | * written permission. | ||
| 18 | * | ||
| 19 | * ALTERNATIVELY, this product may be distributed under the terms of | ||
| 20 | * the GNU General Public License, in which case the provisions of the GPL are | ||
| 21 | * required INSTEAD OF the above restrictions. (This clause is | ||
| 22 | * necessary due to a potential bad interaction between the GPL and | ||
| 23 | * the restrictions contained in a BSD-style copyright.) | ||
| 24 | * | ||
| 25 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
| 26 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
| 27 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF | ||
| 28 | * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE | ||
| 29 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT | ||
| 31 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
| 32 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
| 33 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | ||
| 35 | * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH | ||
| 36 | * DAMAGE. | ||
| 37 | */ | ||
| 38 | |||
| 39 | #ifndef _DRBG_H | ||
| 40 | #define _DRBG_H | ||
| 41 | |||
| 42 | |||
| 43 | #include <linux/random.h> | ||
| 44 | #include <linux/scatterlist.h> | ||
| 45 | #include <crypto/hash.h> | ||
| 46 | #include <linux/module.h> | ||
| 47 | #include <linux/crypto.h> | ||
| 48 | #include <linux/slab.h> | ||
| 49 | #include <crypto/internal/rng.h> | ||
| 50 | #include <crypto/rng.h> | ||
| 51 | #include <linux/fips.h> | ||
| 52 | #include <linux/spinlock.h> | ||
| 53 | #include <linux/list.h> | ||
| 54 | |||
| 55 | /* | ||
| 56 | * Concatenation Helper and string operation helper | ||
| 57 | * | ||
| 58 | * SP800-90A requires the concatenation of different data. To avoid copying | ||
| 59 | * buffers around or allocate additional memory, the following data structure | ||
| 60 | * is used to point to the original memory with its size. In addition, it | ||
| 61 | * is used to build a linked list. The linked list defines the concatenation | ||
| 62 | * of individual buffers. The order of memory block referenced in that | ||
| 63 | * linked list determines the order of concatenation. | ||
| 64 | */ | ||
| 65 | struct drbg_string { | ||
| 66 | const unsigned char *buf; | ||
| 67 | size_t len; | ||
| 68 | struct list_head list; | ||
| 69 | }; | ||
| 70 | |||
| 71 | static inline void drbg_string_fill(struct drbg_string *string, | ||
| 72 | const unsigned char *buf, size_t len) | ||
| 73 | { | ||
| 74 | string->buf = buf; | ||
| 75 | string->len = len; | ||
| 76 | INIT_LIST_HEAD(&string->list); | ||
| 77 | } | ||
| 78 | |||
| 79 | struct drbg_state; | ||
| 80 | typedef uint32_t drbg_flag_t; | ||
| 81 | |||
| 82 | struct drbg_core { | ||
| 83 | drbg_flag_t flags; /* flags for the cipher */ | ||
| 84 | __u8 statelen; /* maximum state length */ | ||
| 85 | /* | ||
| 86 | * maximum length of personalization string or additional input | ||
| 87 | * string -- exponent for base 2 | ||
| 88 | */ | ||
| 89 | __u8 max_addtllen; | ||
| 90 | /* maximum bits per RNG request -- exponent for base 2*/ | ||
| 91 | __u8 max_bits; | ||
| 92 | /* maximum number of requests -- exponent for base 2 */ | ||
| 93 | __u8 max_req; | ||
| 94 | __u8 blocklen_bytes; /* block size of output in bytes */ | ||
| 95 | char cra_name[CRYPTO_MAX_ALG_NAME]; /* mapping to kernel crypto API */ | ||
| 96 | /* kernel crypto API backend cipher name */ | ||
| 97 | char backend_cra_name[CRYPTO_MAX_ALG_NAME]; | ||
| 98 | }; | ||
| 99 | |||
| 100 | struct drbg_state_ops { | ||
| 101 | int (*update)(struct drbg_state *drbg, struct list_head *seed, | ||
| 102 | int reseed); | ||
| 103 | int (*generate)(struct drbg_state *drbg, | ||
| 104 | unsigned char *buf, unsigned int buflen, | ||
| 105 | struct list_head *addtl); | ||
| 106 | int (*crypto_init)(struct drbg_state *drbg); | ||
| 107 | int (*crypto_fini)(struct drbg_state *drbg); | ||
| 108 | |||
| 109 | }; | ||
| 110 | |||
| 111 | struct drbg_test_data { | ||
| 112 | struct drbg_string *testentropy; /* TEST PARAMETER: test entropy */ | ||
| 113 | }; | ||
| 114 | |||
| 115 | struct drbg_state { | ||
| 116 | spinlock_t drbg_lock; /* lock around DRBG */ | ||
| 117 | unsigned char *V; /* internal state 10.1.1.1 1a) */ | ||
| 118 | /* hash: static value 10.1.1.1 1b) hmac / ctr: key */ | ||
| 119 | unsigned char *C; | ||
| 120 | /* Number of RNG requests since last reseed -- 10.1.1.1 1c) */ | ||
| 121 | size_t reseed_ctr; | ||
| 122 | /* some memory the DRBG can use for its operation */ | ||
| 123 | unsigned char *scratchpad; | ||
| 124 | void *priv_data; /* Cipher handle */ | ||
| 125 | bool seeded; /* DRBG fully seeded? */ | ||
| 126 | bool pr; /* Prediction resistance enabled? */ | ||
| 127 | #ifdef CONFIG_CRYPTO_FIPS | ||
| 128 | bool fips_primed; /* Continuous test primed? */ | ||
| 129 | unsigned char *prev; /* FIPS 140-2 continuous test value */ | ||
| 130 | #endif | ||
| 131 | const struct drbg_state_ops *d_ops; | ||
| 132 | const struct drbg_core *core; | ||
| 133 | struct drbg_test_data *test_data; | ||
| 134 | }; | ||
| 135 | |||
| 136 | static inline __u8 drbg_statelen(struct drbg_state *drbg) | ||
| 137 | { | ||
| 138 | if (drbg && drbg->core) | ||
| 139 | return drbg->core->statelen; | ||
| 140 | return 0; | ||
| 141 | } | ||
| 142 | |||
| 143 | static inline __u8 drbg_blocklen(struct drbg_state *drbg) | ||
| 144 | { | ||
| 145 | if (drbg && drbg->core) | ||
| 146 | return drbg->core->blocklen_bytes; | ||
| 147 | return 0; | ||
| 148 | } | ||
| 149 | |||
| 150 | static inline __u8 drbg_keylen(struct drbg_state *drbg) | ||
| 151 | { | ||
| 152 | if (drbg && drbg->core) | ||
| 153 | return (drbg->core->statelen - drbg->core->blocklen_bytes); | ||
| 154 | return 0; | ||
| 155 | } | ||
| 156 | |||
| 157 | static inline size_t drbg_max_request_bytes(struct drbg_state *drbg) | ||
| 158 | { | ||
| 159 | /* max_bits is in bits, but buflen is in bytes */ | ||
| 160 | return (1 << (drbg->core->max_bits - 3)); | ||
| 161 | } | ||
| 162 | |||
| 163 | static inline size_t drbg_max_addtl(struct drbg_state *drbg) | ||
| 164 | { | ||
| 165 | return (1UL<<(drbg->core->max_addtllen)); | ||
| 166 | } | ||
| 167 | |||
| 168 | static inline size_t drbg_max_requests(struct drbg_state *drbg) | ||
| 169 | { | ||
| 170 | return (1UL<<(drbg->core->max_req)); | ||
| 171 | } | ||
| 172 | |||
| 173 | /* | ||
| 174 | * kernel crypto API input data structure for DRBG generate in case dlen | ||
| 175 | * is set to 0 | ||
| 176 | */ | ||
| 177 | struct drbg_gen { | ||
| 178 | unsigned char *outbuf; /* output buffer for random numbers */ | ||
| 179 | unsigned int outlen; /* size of output buffer */ | ||
| 180 | struct drbg_string *addtl; /* additional information string */ | ||
| 181 | struct drbg_test_data *test_data; /* test data */ | ||
| 182 | }; | ||
| 183 | |||
| 184 | /* | ||
| 185 | * This is a wrapper to the kernel crypto API function of | ||
| 186 | * crypto_rng_get_bytes() to allow the caller to provide additional data. | ||
| 187 | * | ||
| 188 | * @drng DRBG handle -- see crypto_rng_get_bytes | ||
| 189 | * @outbuf output buffer -- see crypto_rng_get_bytes | ||
| 190 | * @outlen length of output buffer -- see crypto_rng_get_bytes | ||
| 191 | * @addtl_input additional information string input buffer | ||
| 192 | * @addtllen length of additional information string buffer | ||
| 193 | * | ||
| 194 | * return | ||
| 195 | * see crypto_rng_get_bytes | ||
| 196 | */ | ||
| 197 | static inline int crypto_drbg_get_bytes_addtl(struct crypto_rng *drng, | ||
| 198 | unsigned char *outbuf, unsigned int outlen, | ||
| 199 | struct drbg_string *addtl) | ||
| 200 | { | ||
| 201 | int ret; | ||
| 202 | struct drbg_gen genbuf; | ||
| 203 | genbuf.outbuf = outbuf; | ||
| 204 | genbuf.outlen = outlen; | ||
| 205 | genbuf.addtl = addtl; | ||
| 206 | genbuf.test_data = NULL; | ||
| 207 | ret = crypto_rng_get_bytes(drng, (u8 *)&genbuf, 0); | ||
| 208 | return ret; | ||
| 209 | } | ||
| 210 | |||
| 211 | /* | ||
| 212 | * TEST code | ||
| 213 | * | ||
| 214 | * This is a wrapper to the kernel crypto API function of | ||
| 215 | * crypto_rng_get_bytes() to allow the caller to provide additional data and | ||
| 216 | * allow furnishing of test_data | ||
| 217 | * | ||
| 218 | * @drng DRBG handle -- see crypto_rng_get_bytes | ||
| 219 | * @outbuf output buffer -- see crypto_rng_get_bytes | ||
| 220 | * @outlen length of output buffer -- see crypto_rng_get_bytes | ||
| 221 | * @addtl_input additional information string input buffer | ||
| 222 | * @addtllen length of additional information string buffer | ||
| 223 | * @test_data filled test data | ||
| 224 | * | ||
| 225 | * return | ||
| 226 | * see crypto_rng_get_bytes | ||
| 227 | */ | ||
| 228 | static inline int crypto_drbg_get_bytes_addtl_test(struct crypto_rng *drng, | ||
| 229 | unsigned char *outbuf, unsigned int outlen, | ||
| 230 | struct drbg_string *addtl, | ||
| 231 | struct drbg_test_data *test_data) | ||
| 232 | { | ||
| 233 | int ret; | ||
| 234 | struct drbg_gen genbuf; | ||
| 235 | genbuf.outbuf = outbuf; | ||
| 236 | genbuf.outlen = outlen; | ||
| 237 | genbuf.addtl = addtl; | ||
| 238 | genbuf.test_data = test_data; | ||
| 239 | ret = crypto_rng_get_bytes(drng, (u8 *)&genbuf, 0); | ||
| 240 | return ret; | ||
| 241 | } | ||
| 242 | |||
| 243 | /* | ||
| 244 | * TEST code | ||
| 245 | * | ||
| 246 | * This is a wrapper to the kernel crypto API function of | ||
| 247 | * crypto_rng_reset() to allow the caller to provide test_data | ||
| 248 | * | ||
| 249 | * @drng DRBG handle -- see crypto_rng_reset | ||
| 250 | * @pers personalization string input buffer | ||
| 251 | * @perslen length of additional information string buffer | ||
| 252 | * @test_data filled test data | ||
| 253 | * | ||
| 254 | * return | ||
| 255 | * see crypto_rng_reset | ||
| 256 | */ | ||
| 257 | static inline int crypto_drbg_reset_test(struct crypto_rng *drng, | ||
| 258 | struct drbg_string *pers, | ||
| 259 | struct drbg_test_data *test_data) | ||
| 260 | { | ||
| 261 | int ret; | ||
| 262 | struct drbg_gen genbuf; | ||
| 263 | genbuf.outbuf = NULL; | ||
| 264 | genbuf.outlen = 0; | ||
| 265 | genbuf.addtl = pers; | ||
| 266 | genbuf.test_data = test_data; | ||
| 267 | ret = crypto_rng_reset(drng, (u8 *)&genbuf, 0); | ||
| 268 | return ret; | ||
| 269 | } | ||
| 270 | |||
| 271 | /* DRBG type flags */ | ||
| 272 | #define DRBG_CTR ((drbg_flag_t)1<<0) | ||
| 273 | #define DRBG_HMAC ((drbg_flag_t)1<<1) | ||
| 274 | #define DRBG_HASH ((drbg_flag_t)1<<2) | ||
| 275 | #define DRBG_TYPE_MASK (DRBG_CTR | DRBG_HMAC | DRBG_HASH) | ||
| 276 | /* DRBG strength flags */ | ||
| 277 | #define DRBG_STRENGTH128 ((drbg_flag_t)1<<3) | ||
| 278 | #define DRBG_STRENGTH192 ((drbg_flag_t)1<<4) | ||
| 279 | #define DRBG_STRENGTH256 ((drbg_flag_t)1<<5) | ||
| 280 | #define DRBG_STRENGTH_MASK (DRBG_STRENGTH128 | DRBG_STRENGTH192 | \ | ||
| 281 | DRBG_STRENGTH256) | ||
| 282 | |||
| 283 | enum drbg_prefixes { | ||
| 284 | DRBG_PREFIX0 = 0x00, | ||
| 285 | DRBG_PREFIX1, | ||
| 286 | DRBG_PREFIX2, | ||
| 287 | DRBG_PREFIX3 | ||
| 288 | }; | ||
| 289 | |||
| 290 | #endif /* _DRBG_H */ | ||
diff --git a/include/crypto/hash.h b/include/crypto/hash.h index 26cb1eb16f4c..a39195539601 100644 --- a/include/crypto/hash.h +++ b/include/crypto/hash.h | |||
| @@ -238,10 +238,10 @@ static inline struct ahash_request *ahash_request_cast( | |||
| 238 | 238 | ||
| 239 | static inline void ahash_request_set_callback(struct ahash_request *req, | 239 | static inline void ahash_request_set_callback(struct ahash_request *req, |
| 240 | u32 flags, | 240 | u32 flags, |
| 241 | crypto_completion_t complete, | 241 | crypto_completion_t compl, |
| 242 | void *data) | 242 | void *data) |
| 243 | { | 243 | { |
| 244 | req->base.complete = complete; | 244 | req->base.complete = compl; |
| 245 | req->base.data = data; | 245 | req->base.data = data; |
| 246 | req->base.flags = flags; | 246 | req->base.flags = flags; |
| 247 | } | 247 | } |
diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h index 06e8b32d541c..b3a46c515d1b 100644 --- a/include/crypto/internal/skcipher.h +++ b/include/crypto/internal/skcipher.h | |||
| @@ -81,8 +81,7 @@ static inline int skcipher_enqueue_givcrypt( | |||
| 81 | static inline struct skcipher_givcrypt_request *skcipher_dequeue_givcrypt( | 81 | static inline struct skcipher_givcrypt_request *skcipher_dequeue_givcrypt( |
| 82 | struct crypto_queue *queue) | 82 | struct crypto_queue *queue) |
| 83 | { | 83 | { |
| 84 | return __crypto_dequeue_request( | 84 | return skcipher_givcrypt_cast(crypto_dequeue_request(queue)); |
| 85 | queue, offsetof(struct skcipher_givcrypt_request, creq.base)); | ||
| 86 | } | 85 | } |
| 87 | 86 | ||
| 88 | static inline void *skcipher_givcrypt_reqctx( | 87 | static inline void *skcipher_givcrypt_reqctx( |
diff --git a/include/crypto/pkcs7.h b/include/crypto/pkcs7.h new file mode 100644 index 000000000000..691c79172a26 --- /dev/null +++ b/include/crypto/pkcs7.h | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | /* PKCS#7 crypto data parser | ||
| 2 | * | ||
| 3 | * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved. | ||
| 4 | * Written by David Howells (dhowells@redhat.com) | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public Licence | ||
| 8 | * as published by the Free Software Foundation; either version | ||
| 9 | * 2 of the Licence, or (at your option) any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | struct key; | ||
| 13 | struct pkcs7_message; | ||
| 14 | |||
| 15 | /* | ||
| 16 | * pkcs7_parser.c | ||
| 17 | */ | ||
| 18 | extern struct pkcs7_message *pkcs7_parse_message(const void *data, | ||
| 19 | size_t datalen); | ||
| 20 | extern void pkcs7_free_message(struct pkcs7_message *pkcs7); | ||
| 21 | |||
| 22 | extern int pkcs7_get_content_data(const struct pkcs7_message *pkcs7, | ||
| 23 | const void **_data, size_t *_datalen, | ||
| 24 | bool want_wrapper); | ||
| 25 | |||
| 26 | /* | ||
| 27 | * pkcs7_trust.c | ||
| 28 | */ | ||
| 29 | extern int pkcs7_validate_trust(struct pkcs7_message *pkcs7, | ||
| 30 | struct key *trust_keyring, | ||
| 31 | bool *_trusted); | ||
| 32 | |||
| 33 | /* | ||
| 34 | * pkcs7_verify.c | ||
| 35 | */ | ||
| 36 | extern int pkcs7_verify(struct pkcs7_message *pkcs7); | ||
diff --git a/include/crypto/public_key.h b/include/crypto/public_key.h index fc09732613ad..0d164c6af539 100644 --- a/include/crypto/public_key.h +++ b/include/crypto/public_key.h | |||
| @@ -98,4 +98,8 @@ struct key; | |||
| 98 | extern int verify_signature(const struct key *key, | 98 | extern int verify_signature(const struct key *key, |
| 99 | const struct public_key_signature *sig); | 99 | const struct public_key_signature *sig); |
| 100 | 100 | ||
| 101 | extern struct key *x509_request_asymmetric_key(struct key *keyring, | ||
| 102 | const char *issuer, | ||
| 103 | const char *key_id); | ||
| 104 | |||
| 101 | #endif /* _LINUX_PUBLIC_KEY_H */ | 105 | #endif /* _LINUX_PUBLIC_KEY_H */ |
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h index 6a626a507b8c..7ef512f8631c 100644 --- a/include/crypto/scatterwalk.h +++ b/include/crypto/scatterwalk.h | |||
| @@ -25,12 +25,6 @@ | |||
| 25 | #include <linux/scatterlist.h> | 25 | #include <linux/scatterlist.h> |
| 26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
| 27 | 27 | ||
| 28 | static inline void crypto_yield(u32 flags) | ||
| 29 | { | ||
| 30 | if (flags & CRYPTO_TFM_REQ_MAY_SLEEP) | ||
| 31 | cond_resched(); | ||
| 32 | } | ||
| 33 | |||
| 34 | static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num, | 28 | static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num, |
| 35 | struct scatterlist *sg2) | 29 | struct scatterlist *sg2) |
| 36 | { | 30 | { |
diff --git a/include/crypto/skcipher.h b/include/crypto/skcipher.h index 25fd6126522d..07d245f073d1 100644 --- a/include/crypto/skcipher.h +++ b/include/crypto/skcipher.h | |||
| @@ -86,9 +86,9 @@ static inline void skcipher_givcrypt_free(struct skcipher_givcrypt_request *req) | |||
| 86 | 86 | ||
| 87 | static inline void skcipher_givcrypt_set_callback( | 87 | static inline void skcipher_givcrypt_set_callback( |
| 88 | struct skcipher_givcrypt_request *req, u32 flags, | 88 | struct skcipher_givcrypt_request *req, u32 flags, |
| 89 | crypto_completion_t complete, void *data) | 89 | crypto_completion_t compl, void *data) |
| 90 | { | 90 | { |
| 91 | ablkcipher_request_set_callback(&req->creq, flags, complete, data); | 91 | ablkcipher_request_set_callback(&req->creq, flags, compl, data); |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | static inline void skcipher_givcrypt_set_crypt( | 94 | static inline void skcipher_givcrypt_set_crypt( |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 8af71a8e2c00..e41f17ea1f13 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
| @@ -83,6 +83,7 @@ struct drm_device; | |||
| 83 | 83 | ||
| 84 | struct device_node; | 84 | struct device_node; |
| 85 | struct videomode; | 85 | struct videomode; |
| 86 | struct reservation_object; | ||
| 86 | 87 | ||
| 87 | #include <drm/drm_os_linux.h> | 88 | #include <drm/drm_os_linux.h> |
| 88 | #include <drm/drm_hashtab.h> | 89 | #include <drm/drm_hashtab.h> |
| @@ -923,6 +924,8 @@ struct drm_driver { | |||
| 923 | /* low-level interface used by drm_gem_prime_{import,export} */ | 924 | /* low-level interface used by drm_gem_prime_{import,export} */ |
| 924 | int (*gem_prime_pin)(struct drm_gem_object *obj); | 925 | int (*gem_prime_pin)(struct drm_gem_object *obj); |
| 925 | void (*gem_prime_unpin)(struct drm_gem_object *obj); | 926 | void (*gem_prime_unpin)(struct drm_gem_object *obj); |
| 927 | struct reservation_object * (*gem_prime_res_obj)( | ||
| 928 | struct drm_gem_object *obj); | ||
| 926 | struct sg_table *(*gem_prime_get_sg_table)(struct drm_gem_object *obj); | 929 | struct sg_table *(*gem_prime_get_sg_table)(struct drm_gem_object *obj); |
| 927 | struct drm_gem_object *(*gem_prime_import_sg_table)( | 930 | struct drm_gem_object *(*gem_prime_import_sg_table)( |
| 928 | struct drm_device *dev, size_t size, | 931 | struct drm_device *dev, size_t size, |
diff --git a/include/dt-bindings/clock/clps711x-clock.h b/include/dt-bindings/clock/clps711x-clock.h new file mode 100644 index 000000000000..0c4c80b63242 --- /dev/null +++ b/include/dt-bindings/clock/clps711x-clock.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru> | ||
| 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_CLPS711X_H | ||
| 11 | #define __DT_BINDINGS_CLOCK_CLPS711X_H | ||
| 12 | |||
| 13 | #define CLPS711X_CLK_DUMMY 0 | ||
| 14 | #define CLPS711X_CLK_CPU 1 | ||
| 15 | #define CLPS711X_CLK_BUS 2 | ||
| 16 | #define CLPS711X_CLK_PLL 3 | ||
| 17 | #define CLPS711X_CLK_TIMERREF 4 | ||
| 18 | #define CLPS711X_CLK_TIMER1 5 | ||
| 19 | #define CLPS711X_CLK_TIMER2 6 | ||
| 20 | #define CLPS711X_CLK_PWM 7 | ||
| 21 | #define CLPS711X_CLK_SPIREF 8 | ||
| 22 | #define CLPS711X_CLK_SPI 9 | ||
| 23 | #define CLPS711X_CLK_UART 10 | ||
| 24 | #define CLPS711X_CLK_TICK 11 | ||
| 25 | #define CLPS711X_CLK_MAX 12 | ||
| 26 | |||
| 27 | #endif | ||
diff --git a/include/dt-bindings/clock/exynos4.h b/include/dt-bindings/clock/exynos4.h index 1106ca540a96..459bd2bd411f 100644 --- a/include/dt-bindings/clock/exynos4.h +++ b/include/dt-bindings/clock/exynos4.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. | 2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. |
| 3 | * Author: Andrzej Haja <a.hajda@samsung.com> | 3 | * Author: Andrzej Hajda <a.hajda@samsung.com> |
| 4 | * | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify | 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 | 6 | * it under the terms of the GNU General Public License version 2 as |
| @@ -34,6 +34,11 @@ | |||
| 34 | #define CLK_MOUT_CORE 19 | 34 | #define CLK_MOUT_CORE 19 |
| 35 | #define CLK_MOUT_APLL 20 | 35 | #define CLK_MOUT_APLL 20 |
| 36 | #define CLK_SCLK_HDMIPHY 22 | 36 | #define CLK_SCLK_HDMIPHY 22 |
| 37 | #define CLK_OUT_DMC 23 | ||
| 38 | #define CLK_OUT_TOP 24 | ||
| 39 | #define CLK_OUT_LEFTBUS 25 | ||
| 40 | #define CLK_OUT_RIGHTBUS 26 | ||
| 41 | #define CLK_OUT_CPU 27 | ||
| 37 | 42 | ||
| 38 | /* gate for special clocks (sclk) */ | 43 | /* gate for special clocks (sclk) */ |
| 39 | #define CLK_SCLK_FIMC0 128 | 44 | #define CLK_SCLK_FIMC0 128 |
| @@ -230,6 +235,24 @@ | |||
| 230 | #define CLK_MOUT_G3D 394 | 235 | #define CLK_MOUT_G3D 394 |
| 231 | #define CLK_ACLK400_MCUISP 395 /* Exynos4x12 only */ | 236 | #define CLK_ACLK400_MCUISP 395 /* Exynos4x12 only */ |
| 232 | 237 | ||
| 238 | /* gate clocks - ppmu */ | ||
| 239 | #define CLK_PPMULEFT 400 | ||
| 240 | #define CLK_PPMURIGHT 401 | ||
| 241 | #define CLK_PPMUCAMIF 402 | ||
| 242 | #define CLK_PPMUTV 403 | ||
| 243 | #define CLK_PPMUMFC_L 404 | ||
| 244 | #define CLK_PPMUMFC_R 405 | ||
| 245 | #define CLK_PPMUG3D 406 | ||
| 246 | #define CLK_PPMUIMAGE 407 | ||
| 247 | #define CLK_PPMULCD0 408 | ||
| 248 | #define CLK_PPMULCD1 409 /* Exynos4210 only */ | ||
| 249 | #define CLK_PPMUFILE 410 | ||
| 250 | #define CLK_PPMUGPS 411 | ||
| 251 | #define CLK_PPMUDMC0 412 | ||
| 252 | #define CLK_PPMUDMC1 413 | ||
| 253 | #define CLK_PPMUCPU 414 | ||
| 254 | #define CLK_PPMUACP 415 | ||
| 255 | |||
| 233 | /* div clocks */ | 256 | /* div clocks */ |
| 234 | #define CLK_DIV_ISP0 450 /* Exynos4x12 only */ | 257 | #define CLK_DIV_ISP0 450 /* Exynos4x12 only */ |
| 235 | #define CLK_DIV_ISP1 451 /* Exynos4x12 only */ | 258 | #define CLK_DIV_ISP1 451 /* Exynos4x12 only */ |
diff --git a/include/dt-bindings/clock/exynos5250.h b/include/dt-bindings/clock/exynos5250.h index be6e97c54f54..4273891dc78e 100644 --- a/include/dt-bindings/clock/exynos5250.h +++ b/include/dt-bindings/clock/exynos5250.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. | 2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. |
| 3 | * Author: Andrzej Haja <a.hajda@samsung.com> | 3 | * Author: Andrzej Hajda <a.hajda@samsung.com> |
| 4 | * | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify | 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 | 6 | * it under the terms of the GNU General Public License version 2 as |
diff --git a/include/dt-bindings/clock/exynos5420.h b/include/dt-bindings/clock/exynos5420.h index 21d51ae1d242..8dc0913f1775 100644 --- a/include/dt-bindings/clock/exynos5420.h +++ b/include/dt-bindings/clock/exynos5420.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. | 2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. |
| 3 | * Author: Andrzej Haja <a.hajda@samsung.com> | 3 | * Author: Andrzej Hajda <a.hajda@samsung.com> |
| 4 | * | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify | 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 | 6 | * it under the terms of the GNU General Public License version 2 as |
diff --git a/include/dt-bindings/clock/exynos5440.h b/include/dt-bindings/clock/exynos5440.h index 70cd85077fa9..c66fc405a79a 100644 --- a/include/dt-bindings/clock/exynos5440.h +++ b/include/dt-bindings/clock/exynos5440.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. | 2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. |
| 3 | * Author: Andrzej Haja <a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> | 3 | * Author: Andrzej Hajda <a.hajda@samsung.com> |
| 4 | * | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify | 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 | 6 | * it under the terms of the GNU General Public License version 2 as |
diff --git a/include/dt-bindings/clock/qcom,gcc-apq8084.h b/include/dt-bindings/clock/qcom,gcc-apq8084.h new file mode 100644 index 000000000000..2c0da566c46a --- /dev/null +++ b/include/dt-bindings/clock/qcom,gcc-apq8084.h | |||
| @@ -0,0 +1,351 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2014, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_CLK_APQ_GCC_8084_H | ||
| 15 | #define _DT_BINDINGS_CLK_APQ_GCC_8084_H | ||
| 16 | |||
| 17 | #define GPLL0 0 | ||
| 18 | #define GPLL0_VOTE 1 | ||
| 19 | #define GPLL1 2 | ||
| 20 | #define GPLL1_VOTE 3 | ||
| 21 | #define GPLL2 4 | ||
| 22 | #define GPLL2_VOTE 5 | ||
| 23 | #define GPLL3 6 | ||
| 24 | #define GPLL3_VOTE 7 | ||
| 25 | #define GPLL4 8 | ||
| 26 | #define GPLL4_VOTE 9 | ||
| 27 | #define CONFIG_NOC_CLK_SRC 10 | ||
| 28 | #define PERIPH_NOC_CLK_SRC 11 | ||
| 29 | #define SYSTEM_NOC_CLK_SRC 12 | ||
| 30 | #define BLSP_UART_SIM_CLK_SRC 13 | ||
| 31 | #define QDSS_TSCTR_CLK_SRC 14 | ||
| 32 | #define UFS_AXI_CLK_SRC 15 | ||
| 33 | #define RPM_CLK_SRC 16 | ||
| 34 | #define KPSS_AHB_CLK_SRC 17 | ||
| 35 | #define QDSS_AT_CLK_SRC 18 | ||
| 36 | #define BIMC_DDR_CLK_SRC 19 | ||
| 37 | #define USB30_MASTER_CLK_SRC 20 | ||
| 38 | #define USB30_SEC_MASTER_CLK_SRC 21 | ||
| 39 | #define USB_HSIC_AHB_CLK_SRC 22 | ||
| 40 | #define MMSS_BIMC_GFX_CLK_SRC 23 | ||
| 41 | #define QDSS_STM_CLK_SRC 24 | ||
| 42 | #define ACC_CLK_SRC 25 | ||
| 43 | #define SEC_CTRL_CLK_SRC 26 | ||
| 44 | #define BLSP1_QUP1_I2C_APPS_CLK_SRC 27 | ||
| 45 | #define BLSP1_QUP1_SPI_APPS_CLK_SRC 28 | ||
| 46 | #define BLSP1_QUP2_I2C_APPS_CLK_SRC 29 | ||
| 47 | #define BLSP1_QUP2_SPI_APPS_CLK_SRC 30 | ||
| 48 | #define BLSP1_QUP3_I2C_APPS_CLK_SRC 31 | ||
| 49 | #define BLSP1_QUP3_SPI_APPS_CLK_SRC 32 | ||
| 50 | #define BLSP1_QUP4_I2C_APPS_CLK_SRC 33 | ||
| 51 | #define BLSP1_QUP4_SPI_APPS_CLK_SRC 34 | ||
| 52 | #define BLSP1_QUP5_I2C_APPS_CLK_SRC 35 | ||
| 53 | #define BLSP1_QUP5_SPI_APPS_CLK_SRC 36 | ||
| 54 | #define BLSP1_QUP6_I2C_APPS_CLK_SRC 37 | ||
| 55 | #define BLSP1_QUP6_SPI_APPS_CLK_SRC 38 | ||
| 56 | #define BLSP1_UART1_APPS_CLK_SRC 39 | ||
| 57 | #define BLSP1_UART2_APPS_CLK_SRC 40 | ||
| 58 | #define BLSP1_UART3_APPS_CLK_SRC 41 | ||
| 59 | #define BLSP1_UART4_APPS_CLK_SRC 42 | ||
| 60 | #define BLSP1_UART5_APPS_CLK_SRC 43 | ||
| 61 | #define BLSP1_UART6_APPS_CLK_SRC 44 | ||
| 62 | #define BLSP2_QUP1_I2C_APPS_CLK_SRC 45 | ||
| 63 | #define BLSP2_QUP1_SPI_APPS_CLK_SRC 46 | ||
| 64 | #define BLSP2_QUP2_I2C_APPS_CLK_SRC 47 | ||
| 65 | #define BLSP2_QUP2_SPI_APPS_CLK_SRC 48 | ||
| 66 | #define BLSP2_QUP3_I2C_APPS_CLK_SRC 49 | ||
| 67 | #define BLSP2_QUP3_SPI_APPS_CLK_SRC 50 | ||
| 68 | #define BLSP2_QUP4_I2C_APPS_CLK_SRC 51 | ||
| 69 | #define BLSP2_QUP4_SPI_APPS_CLK_SRC 52 | ||
| 70 | #define BLSP2_QUP5_I2C_APPS_CLK_SRC 53 | ||
| 71 | #define BLSP2_QUP5_SPI_APPS_CLK_SRC 54 | ||
| 72 | #define BLSP2_QUP6_I2C_APPS_CLK_SRC 55 | ||
| 73 | #define BLSP2_QUP6_SPI_APPS_CLK_SRC 56 | ||
| 74 | #define BLSP2_UART1_APPS_CLK_SRC 57 | ||
| 75 | #define BLSP2_UART2_APPS_CLK_SRC 58 | ||
| 76 | #define BLSP2_UART3_APPS_CLK_SRC 59 | ||
| 77 | #define BLSP2_UART4_APPS_CLK_SRC 60 | ||
| 78 | #define BLSP2_UART5_APPS_CLK_SRC 61 | ||
| 79 | #define BLSP2_UART6_APPS_CLK_SRC 62 | ||
| 80 | #define CE1_CLK_SRC 63 | ||
| 81 | #define CE2_CLK_SRC 64 | ||
| 82 | #define CE3_CLK_SRC 65 | ||
| 83 | #define GP1_CLK_SRC 66 | ||
| 84 | #define GP2_CLK_SRC 67 | ||
| 85 | #define GP3_CLK_SRC 68 | ||
| 86 | #define PDM2_CLK_SRC 69 | ||
| 87 | #define QDSS_TRACECLKIN_CLK_SRC 70 | ||
| 88 | #define RBCPR_CLK_SRC 71 | ||
| 89 | #define SATA_ASIC0_CLK_SRC 72 | ||
| 90 | #define SATA_PMALIVE_CLK_SRC 73 | ||
| 91 | #define SATA_RX_CLK_SRC 74 | ||
| 92 | #define SATA_RX_OOB_CLK_SRC 75 | ||
| 93 | #define SDCC1_APPS_CLK_SRC 76 | ||
| 94 | #define SDCC2_APPS_CLK_SRC 77 | ||
| 95 | #define SDCC3_APPS_CLK_SRC 78 | ||
| 96 | #define SDCC4_APPS_CLK_SRC 79 | ||
| 97 | #define GCC_SNOC_BUS_TIMEOUT0_AHB_CLK 80 | ||
| 98 | #define SPMI_AHB_CLK_SRC 81 | ||
| 99 | #define SPMI_SER_CLK_SRC 82 | ||
| 100 | #define TSIF_REF_CLK_SRC 83 | ||
| 101 | #define USB30_MOCK_UTMI_CLK_SRC 84 | ||
| 102 | #define USB30_SEC_MOCK_UTMI_CLK_SRC 85 | ||
| 103 | #define USB_HS_SYSTEM_CLK_SRC 86 | ||
| 104 | #define USB_HSIC_CLK_SRC 87 | ||
| 105 | #define USB_HSIC_IO_CAL_CLK_SRC 88 | ||
| 106 | #define USB_HSIC_MOCK_UTMI_CLK_SRC 89 | ||
| 107 | #define USB_HSIC_SYSTEM_CLK_SRC 90 | ||
| 108 | #define GCC_BAM_DMA_AHB_CLK 91 | ||
| 109 | #define GCC_BAM_DMA_INACTIVITY_TIMERS_CLK 92 | ||
| 110 | #define DDR_CLK_SRC 93 | ||
| 111 | #define GCC_BIMC_CFG_AHB_CLK 94 | ||
| 112 | #define GCC_BIMC_CLK 95 | ||
| 113 | #define GCC_BIMC_KPSS_AXI_CLK 96 | ||
| 114 | #define GCC_BIMC_SLEEP_CLK 97 | ||
| 115 | #define GCC_BIMC_SYSNOC_AXI_CLK 98 | ||
| 116 | #define GCC_BIMC_XO_CLK 99 | ||
| 117 | #define GCC_BLSP1_AHB_CLK 100 | ||
| 118 | #define GCC_BLSP1_SLEEP_CLK 101 | ||
| 119 | #define GCC_BLSP1_QUP1_I2C_APPS_CLK 102 | ||
| 120 | #define GCC_BLSP1_QUP1_SPI_APPS_CLK 103 | ||
| 121 | #define GCC_BLSP1_QUP2_I2C_APPS_CLK 104 | ||
| 122 | #define GCC_BLSP1_QUP2_SPI_APPS_CLK 105 | ||
| 123 | #define GCC_BLSP1_QUP3_I2C_APPS_CLK 106 | ||
| 124 | #define GCC_BLSP1_QUP3_SPI_APPS_CLK 107 | ||
| 125 | #define GCC_BLSP1_QUP4_I2C_APPS_CLK 108 | ||
| 126 | #define GCC_BLSP1_QUP4_SPI_APPS_CLK 109 | ||
| 127 | #define GCC_BLSP1_QUP5_I2C_APPS_CLK 110 | ||
| 128 | #define GCC_BLSP1_QUP5_SPI_APPS_CLK 111 | ||
| 129 | #define GCC_BLSP1_QUP6_I2C_APPS_CLK 112 | ||
| 130 | #define GCC_BLSP1_QUP6_SPI_APPS_CLK 113 | ||
| 131 | #define GCC_BLSP1_UART1_APPS_CLK 114 | ||
| 132 | #define GCC_BLSP1_UART1_SIM_CLK 115 | ||
| 133 | #define GCC_BLSP1_UART2_APPS_CLK 116 | ||
| 134 | #define GCC_BLSP1_UART2_SIM_CLK 117 | ||
| 135 | #define GCC_BLSP1_UART3_APPS_CLK 118 | ||
| 136 | #define GCC_BLSP1_UART3_SIM_CLK 119 | ||
| 137 | #define GCC_BLSP1_UART4_APPS_CLK 120 | ||
| 138 | #define GCC_BLSP1_UART4_SIM_CLK 121 | ||
| 139 | #define GCC_BLSP1_UART5_APPS_CLK 122 | ||
| 140 | #define GCC_BLSP1_UART5_SIM_CLK 123 | ||
| 141 | #define GCC_BLSP1_UART6_APPS_CLK 124 | ||
| 142 | #define GCC_BLSP1_UART6_SIM_CLK 125 | ||
| 143 | #define GCC_BLSP2_AHB_CLK 126 | ||
| 144 | #define GCC_BLSP2_SLEEP_CLK 127 | ||
| 145 | #define GCC_BLSP2_QUP1_I2C_APPS_CLK 128 | ||
| 146 | #define GCC_BLSP2_QUP1_SPI_APPS_CLK 129 | ||
| 147 | #define GCC_BLSP2_QUP2_I2C_APPS_CLK 130 | ||
| 148 | #define GCC_BLSP2_QUP2_SPI_APPS_CLK 131 | ||
| 149 | #define GCC_BLSP2_QUP3_I2C_APPS_CLK 132 | ||
| 150 | #define GCC_BLSP2_QUP3_SPI_APPS_CLK 133 | ||
| 151 | #define GCC_BLSP2_QUP4_I2C_APPS_CLK 134 | ||
| 152 | #define GCC_BLSP2_QUP4_SPI_APPS_CLK 135 | ||
| 153 | #define GCC_BLSP2_QUP5_I2C_APPS_CLK 136 | ||
| 154 | #define GCC_BLSP2_QUP5_SPI_APPS_CLK 137 | ||
| 155 | #define GCC_BLSP2_QUP6_I2C_APPS_CLK 138 | ||
| 156 | #define GCC_BLSP2_QUP6_SPI_APPS_CLK 139 | ||
| 157 | #define GCC_BLSP2_UART1_APPS_CLK 140 | ||
| 158 | #define GCC_BLSP2_UART1_SIM_CLK 141 | ||
| 159 | #define GCC_BLSP2_UART2_APPS_CLK 142 | ||
| 160 | #define GCC_BLSP2_UART2_SIM_CLK 143 | ||
| 161 | #define GCC_BLSP2_UART3_APPS_CLK 144 | ||
| 162 | #define GCC_BLSP2_UART3_SIM_CLK 145 | ||
| 163 | #define GCC_BLSP2_UART4_APPS_CLK 146 | ||
| 164 | #define GCC_BLSP2_UART4_SIM_CLK 147 | ||
| 165 | #define GCC_BLSP2_UART5_APPS_CLK 148 | ||
| 166 | #define GCC_BLSP2_UART5_SIM_CLK 149 | ||
| 167 | #define GCC_BLSP2_UART6_APPS_CLK 150 | ||
| 168 | #define GCC_BLSP2_UART6_SIM_CLK 151 | ||
| 169 | #define GCC_BOOT_ROM_AHB_CLK 152 | ||
| 170 | #define GCC_CE1_AHB_CLK 153 | ||
| 171 | #define GCC_CE1_AXI_CLK 154 | ||
| 172 | #define GCC_CE1_CLK 155 | ||
| 173 | #define GCC_CE2_AHB_CLK 156 | ||
| 174 | #define GCC_CE2_AXI_CLK 157 | ||
| 175 | #define GCC_CE2_CLK 158 | ||
| 176 | #define GCC_CE3_AHB_CLK 159 | ||
| 177 | #define GCC_CE3_AXI_CLK 160 | ||
| 178 | #define GCC_CE3_CLK 161 | ||
| 179 | #define GCC_CNOC_BUS_TIMEOUT0_AHB_CLK 162 | ||
| 180 | #define GCC_CNOC_BUS_TIMEOUT1_AHB_CLK 163 | ||
| 181 | #define GCC_CNOC_BUS_TIMEOUT2_AHB_CLK 164 | ||
| 182 | #define GCC_CNOC_BUS_TIMEOUT3_AHB_CLK 165 | ||
| 183 | #define GCC_CNOC_BUS_TIMEOUT4_AHB_CLK 166 | ||
| 184 | #define GCC_CNOC_BUS_TIMEOUT5_AHB_CLK 167 | ||
| 185 | #define GCC_CNOC_BUS_TIMEOUT6_AHB_CLK 168 | ||
| 186 | #define GCC_CNOC_BUS_TIMEOUT7_AHB_CLK 169 | ||
| 187 | #define GCC_CFG_NOC_AHB_CLK 170 | ||
| 188 | #define GCC_CFG_NOC_DDR_CFG_CLK 171 | ||
| 189 | #define GCC_CFG_NOC_RPM_AHB_CLK 172 | ||
| 190 | #define GCC_COPSS_SMMU_AHB_CLK 173 | ||
| 191 | #define GCC_COPSS_SMMU_AXI_CLK 174 | ||
| 192 | #define GCC_DCD_XO_CLK 175 | ||
| 193 | #define GCC_BIMC_DDR_CH0_CLK 176 | ||
| 194 | #define GCC_BIMC_DDR_CH1_CLK 177 | ||
| 195 | #define GCC_BIMC_DDR_CPLL0_CLK 178 | ||
| 196 | #define GCC_BIMC_DDR_CPLL1_CLK 179 | ||
| 197 | #define GCC_BIMC_GFX_CLK 180 | ||
| 198 | #define GCC_DDR_DIM_CFG_CLK 181 | ||
| 199 | #define GCC_DDR_DIM_SLEEP_CLK 182 | ||
| 200 | #define GCC_DEHR_CLK 183 | ||
| 201 | #define GCC_AHB_CLK 184 | ||
| 202 | #define GCC_IM_SLEEP_CLK 185 | ||
| 203 | #define GCC_XO_CLK 186 | ||
| 204 | #define GCC_XO_DIV4_CLK 187 | ||
| 205 | #define GCC_GP1_CLK 188 | ||
| 206 | #define GCC_GP2_CLK 189 | ||
| 207 | #define GCC_GP3_CLK 190 | ||
| 208 | #define GCC_IMEM_AXI_CLK 191 | ||
| 209 | #define GCC_IMEM_CFG_AHB_CLK 192 | ||
| 210 | #define GCC_KPSS_AHB_CLK 193 | ||
| 211 | #define GCC_KPSS_AXI_CLK 194 | ||
| 212 | #define GCC_LPASS_MPORT_AXI_CLK 195 | ||
| 213 | #define GCC_LPASS_Q6_AXI_CLK 196 | ||
| 214 | #define GCC_LPASS_SWAY_CLK 197 | ||
| 215 | #define GCC_MMSS_BIMC_GFX_CLK 198 | ||
| 216 | #define GCC_MMSS_NOC_AT_CLK 199 | ||
| 217 | #define GCC_MMSS_NOC_CFG_AHB_CLK 200 | ||
| 218 | #define GCC_MMSS_VPU_MAPLE_SYS_NOC_AXI_CLK 201 | ||
| 219 | #define GCC_OCMEM_NOC_CFG_AHB_CLK 202 | ||
| 220 | #define GCC_OCMEM_SYS_NOC_AXI_CLK 203 | ||
| 221 | #define GCC_MPM_AHB_CLK 204 | ||
| 222 | #define GCC_MSG_RAM_AHB_CLK 205 | ||
| 223 | #define GCC_NOC_CONF_XPU_AHB_CLK 206 | ||
| 224 | #define GCC_PDM2_CLK 207 | ||
| 225 | #define GCC_PDM_AHB_CLK 208 | ||
| 226 | #define GCC_PDM_XO4_CLK 209 | ||
| 227 | #define GCC_PERIPH_NOC_AHB_CLK 210 | ||
| 228 | #define GCC_PERIPH_NOC_AT_CLK 211 | ||
| 229 | #define GCC_PERIPH_NOC_CFG_AHB_CLK 212 | ||
| 230 | #define GCC_PERIPH_NOC_USB_HSIC_AHB_CLK 213 | ||
| 231 | #define GCC_PERIPH_NOC_MPU_CFG_AHB_CLK 214 | ||
| 232 | #define GCC_PERIPH_XPU_AHB_CLK 215 | ||
| 233 | #define GCC_PNOC_BUS_TIMEOUT0_AHB_CLK 216 | ||
| 234 | #define GCC_PNOC_BUS_TIMEOUT1_AHB_CLK 217 | ||
| 235 | #define GCC_PNOC_BUS_TIMEOUT2_AHB_CLK 218 | ||
| 236 | #define GCC_PNOC_BUS_TIMEOUT3_AHB_CLK 219 | ||
| 237 | #define GCC_PNOC_BUS_TIMEOUT4_AHB_CLK 220 | ||
| 238 | #define GCC_PRNG_AHB_CLK 221 | ||
| 239 | #define GCC_QDSS_AT_CLK 222 | ||
| 240 | #define GCC_QDSS_CFG_AHB_CLK 223 | ||
| 241 | #define GCC_QDSS_DAP_AHB_CLK 224 | ||
| 242 | #define GCC_QDSS_DAP_CLK 225 | ||
| 243 | #define GCC_QDSS_ETR_USB_CLK 226 | ||
| 244 | #define GCC_QDSS_STM_CLK 227 | ||
| 245 | #define GCC_QDSS_TRACECLKIN_CLK 228 | ||
| 246 | #define GCC_QDSS_TSCTR_DIV16_CLK 229 | ||
| 247 | #define GCC_QDSS_TSCTR_DIV2_CLK 230 | ||
| 248 | #define GCC_QDSS_TSCTR_DIV3_CLK 231 | ||
| 249 | #define GCC_QDSS_TSCTR_DIV4_CLK 232 | ||
| 250 | #define GCC_QDSS_TSCTR_DIV8_CLK 233 | ||
| 251 | #define GCC_QDSS_RBCPR_XPU_AHB_CLK 234 | ||
| 252 | #define GCC_RBCPR_AHB_CLK 235 | ||
| 253 | #define GCC_RBCPR_CLK 236 | ||
| 254 | #define GCC_RPM_BUS_AHB_CLK 237 | ||
| 255 | #define GCC_RPM_PROC_HCLK 238 | ||
| 256 | #define GCC_RPM_SLEEP_CLK 239 | ||
| 257 | #define GCC_RPM_TIMER_CLK 240 | ||
| 258 | #define GCC_SATA_ASIC0_CLK 241 | ||
| 259 | #define GCC_SATA_AXI_CLK 242 | ||
| 260 | #define GCC_SATA_CFG_AHB_CLK 243 | ||
| 261 | #define GCC_SATA_PMALIVE_CLK 244 | ||
| 262 | #define GCC_SATA_RX_CLK 245 | ||
| 263 | #define GCC_SATA_RX_OOB_CLK 246 | ||
| 264 | #define GCC_SDCC1_AHB_CLK 247 | ||
| 265 | #define GCC_SDCC1_APPS_CLK 248 | ||
| 266 | #define GCC_SDCC1_CDCCAL_FF_CLK 249 | ||
| 267 | #define GCC_SDCC1_CDCCAL_SLEEP_CLK 250 | ||
| 268 | #define GCC_SDCC2_AHB_CLK 251 | ||
| 269 | #define GCC_SDCC2_APPS_CLK 252 | ||
| 270 | #define GCC_SDCC2_INACTIVITY_TIMERS_CLK 253 | ||
| 271 | #define GCC_SDCC3_AHB_CLK 254 | ||
| 272 | #define GCC_SDCC3_APPS_CLK 255 | ||
| 273 | #define GCC_SDCC3_INACTIVITY_TIMERS_CLK 256 | ||
| 274 | #define GCC_SDCC4_AHB_CLK 257 | ||
| 275 | #define GCC_SDCC4_APPS_CLK 258 | ||
| 276 | #define GCC_SDCC4_INACTIVITY_TIMERS_CLK 259 | ||
| 277 | #define GCC_SEC_CTRL_ACC_CLK 260 | ||
| 278 | #define GCC_SEC_CTRL_AHB_CLK 261 | ||
| 279 | #define GCC_SEC_CTRL_BOOT_ROM_PATCH_CLK 262 | ||
| 280 | #define GCC_SEC_CTRL_CLK 263 | ||
| 281 | #define GCC_SEC_CTRL_SENSE_CLK 264 | ||
| 282 | #define GCC_SNOC_BUS_TIMEOUT2_AHB_CLK 265 | ||
| 283 | #define GCC_SNOC_BUS_TIMEOUT3_AHB_CLK 266 | ||
| 284 | #define GCC_SPDM_BIMC_CY_CLK 267 | ||
| 285 | #define GCC_SPDM_CFG_AHB_CLK 268 | ||
| 286 | #define GCC_SPDM_DEBUG_CY_CLK 269 | ||
| 287 | #define GCC_SPDM_FF_CLK 270 | ||
| 288 | #define GCC_SPDM_MSTR_AHB_CLK 271 | ||
| 289 | #define GCC_SPDM_PNOC_CY_CLK 272 | ||
| 290 | #define GCC_SPDM_RPM_CY_CLK 273 | ||
| 291 | #define GCC_SPDM_SNOC_CY_CLK 274 | ||
| 292 | #define GCC_SPMI_AHB_CLK 275 | ||
| 293 | #define GCC_SPMI_CNOC_AHB_CLK 276 | ||
| 294 | #define GCC_SPMI_SER_CLK 277 | ||
| 295 | #define GCC_SPSS_AHB_CLK 278 | ||
| 296 | #define GCC_SNOC_CNOC_AHB_CLK 279 | ||
| 297 | #define GCC_SNOC_PNOC_AHB_CLK 280 | ||
| 298 | #define GCC_SYS_NOC_AT_CLK 281 | ||
| 299 | #define GCC_SYS_NOC_AXI_CLK 282 | ||
| 300 | #define GCC_SYS_NOC_KPSS_AHB_CLK 283 | ||
| 301 | #define GCC_SYS_NOC_QDSS_STM_AXI_CLK 284 | ||
| 302 | #define GCC_SYS_NOC_UFS_AXI_CLK 285 | ||
| 303 | #define GCC_SYS_NOC_USB3_AXI_CLK 286 | ||
| 304 | #define GCC_SYS_NOC_USB3_SEC_AXI_CLK 287 | ||
| 305 | #define GCC_TCSR_AHB_CLK 288 | ||
| 306 | #define GCC_TLMM_AHB_CLK 289 | ||
| 307 | #define GCC_TLMM_CLK 290 | ||
| 308 | #define GCC_TSIF_AHB_CLK 291 | ||
| 309 | #define GCC_TSIF_INACTIVITY_TIMERS_CLK 292 | ||
| 310 | #define GCC_TSIF_REF_CLK 293 | ||
| 311 | #define GCC_UFS_AHB_CLK 294 | ||
| 312 | #define GCC_UFS_AXI_CLK 295 | ||
| 313 | #define GCC_UFS_RX_CFG_CLK 296 | ||
| 314 | #define GCC_UFS_RX_SYMBOL_0_CLK 297 | ||
| 315 | #define GCC_UFS_RX_SYMBOL_1_CLK 298 | ||
| 316 | #define GCC_UFS_TX_CFG_CLK 299 | ||
| 317 | #define GCC_UFS_TX_SYMBOL_0_CLK 300 | ||
| 318 | #define GCC_UFS_TX_SYMBOL_1_CLK 301 | ||
| 319 | #define GCC_USB2A_PHY_SLEEP_CLK 302 | ||
| 320 | #define GCC_USB2B_PHY_SLEEP_CLK 303 | ||
| 321 | #define GCC_USB30_MASTER_CLK 304 | ||
| 322 | #define GCC_USB30_MOCK_UTMI_CLK 305 | ||
| 323 | #define GCC_USB30_SLEEP_CLK 306 | ||
| 324 | #define GCC_USB30_SEC_MASTER_CLK 307 | ||
| 325 | #define GCC_USB30_SEC_MOCK_UTMI_CLK 308 | ||
| 326 | #define GCC_USB30_SEC_SLEEP_CLK 309 | ||
| 327 | #define GCC_USB_HS_AHB_CLK 310 | ||
| 328 | #define GCC_USB_HS_INACTIVITY_TIMERS_CLK 311 | ||
| 329 | #define GCC_USB_HS_SYSTEM_CLK 312 | ||
| 330 | #define GCC_USB_HSIC_AHB_CLK 313 | ||
| 331 | #define GCC_USB_HSIC_CLK 314 | ||
| 332 | #define GCC_USB_HSIC_IO_CAL_CLK 315 | ||
| 333 | #define GCC_USB_HSIC_IO_CAL_SLEEP_CLK 316 | ||
| 334 | #define GCC_USB_HSIC_MOCK_UTMI_CLK 317 | ||
| 335 | #define GCC_USB_HSIC_SYSTEM_CLK 318 | ||
| 336 | #define PCIE_0_AUX_CLK_SRC 319 | ||
| 337 | #define PCIE_0_PIPE_CLK_SRC 320 | ||
| 338 | #define PCIE_1_AUX_CLK_SRC 321 | ||
| 339 | #define PCIE_1_PIPE_CLK_SRC 322 | ||
| 340 | #define GCC_PCIE_0_AUX_CLK 323 | ||
| 341 | #define GCC_PCIE_0_CFG_AHB_CLK 324 | ||
| 342 | #define GCC_PCIE_0_MSTR_AXI_CLK 325 | ||
| 343 | #define GCC_PCIE_0_PIPE_CLK 326 | ||
| 344 | #define GCC_PCIE_0_SLV_AXI_CLK 327 | ||
| 345 | #define GCC_PCIE_1_AUX_CLK 328 | ||
| 346 | #define GCC_PCIE_1_CFG_AHB_CLK 329 | ||
| 347 | #define GCC_PCIE_1_MSTR_AXI_CLK 330 | ||
| 348 | #define GCC_PCIE_1_PIPE_CLK 331 | ||
| 349 | #define GCC_PCIE_1_SLV_AXI_CLK 332 | ||
| 350 | |||
| 351 | #endif | ||
diff --git a/include/dt-bindings/clock/qcom,gcc-ipq806x.h b/include/dt-bindings/clock/qcom,gcc-ipq806x.h new file mode 100644 index 000000000000..b857cadb0bd4 --- /dev/null +++ b/include/dt-bindings/clock/qcom,gcc-ipq806x.h | |||
| @@ -0,0 +1,293 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2014, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_CLK_GCC_IPQ806X_H | ||
| 15 | #define _DT_BINDINGS_CLK_GCC_IPQ806X_H | ||
| 16 | |||
| 17 | #define AFAB_CLK_SRC 0 | ||
| 18 | #define QDSS_STM_CLK 1 | ||
| 19 | #define SCSS_A_CLK 2 | ||
| 20 | #define SCSS_H_CLK 3 | ||
| 21 | #define AFAB_CORE_CLK 4 | ||
| 22 | #define SCSS_XO_SRC_CLK 5 | ||
| 23 | #define AFAB_EBI1_CH0_A_CLK 6 | ||
| 24 | #define AFAB_EBI1_CH1_A_CLK 7 | ||
| 25 | #define AFAB_AXI_S0_FCLK 8 | ||
| 26 | #define AFAB_AXI_S1_FCLK 9 | ||
| 27 | #define AFAB_AXI_S2_FCLK 10 | ||
| 28 | #define AFAB_AXI_S3_FCLK 11 | ||
| 29 | #define AFAB_AXI_S4_FCLK 12 | ||
| 30 | #define SFAB_CORE_CLK 13 | ||
| 31 | #define SFAB_AXI_S0_FCLK 14 | ||
| 32 | #define SFAB_AXI_S1_FCLK 15 | ||
| 33 | #define SFAB_AXI_S2_FCLK 16 | ||
| 34 | #define SFAB_AXI_S3_FCLK 17 | ||
| 35 | #define SFAB_AXI_S4_FCLK 18 | ||
| 36 | #define SFAB_AXI_S5_FCLK 19 | ||
| 37 | #define SFAB_AHB_S0_FCLK 20 | ||
| 38 | #define SFAB_AHB_S1_FCLK 21 | ||
| 39 | #define SFAB_AHB_S2_FCLK 22 | ||
| 40 | #define SFAB_AHB_S3_FCLK 23 | ||
| 41 | #define SFAB_AHB_S4_FCLK 24 | ||
| 42 | #define SFAB_AHB_S5_FCLK 25 | ||
| 43 | #define SFAB_AHB_S6_FCLK 26 | ||
| 44 | #define SFAB_AHB_S7_FCLK 27 | ||
| 45 | #define QDSS_AT_CLK_SRC 28 | ||
| 46 | #define QDSS_AT_CLK 29 | ||
| 47 | #define QDSS_TRACECLKIN_CLK_SRC 30 | ||
| 48 | #define QDSS_TRACECLKIN_CLK 31 | ||
| 49 | #define QDSS_TSCTR_CLK_SRC 32 | ||
| 50 | #define QDSS_TSCTR_CLK 33 | ||
| 51 | #define SFAB_ADM0_M0_A_CLK 34 | ||
| 52 | #define SFAB_ADM0_M1_A_CLK 35 | ||
| 53 | #define SFAB_ADM0_M2_H_CLK 36 | ||
| 54 | #define ADM0_CLK 37 | ||
| 55 | #define ADM0_PBUS_CLK 38 | ||
| 56 | #define IMEM0_A_CLK 39 | ||
| 57 | #define QDSS_H_CLK 40 | ||
| 58 | #define PCIE_A_CLK 41 | ||
| 59 | #define PCIE_AUX_CLK 42 | ||
| 60 | #define PCIE_H_CLK 43 | ||
| 61 | #define PCIE_PHY_CLK 44 | ||
| 62 | #define SFAB_CLK_SRC 45 | ||
| 63 | #define SFAB_LPASS_Q6_A_CLK 46 | ||
| 64 | #define SFAB_AFAB_M_A_CLK 47 | ||
| 65 | #define AFAB_SFAB_M0_A_CLK 48 | ||
| 66 | #define AFAB_SFAB_M1_A_CLK 49 | ||
| 67 | #define SFAB_SATA_S_H_CLK 50 | ||
| 68 | #define DFAB_CLK_SRC 51 | ||
| 69 | #define DFAB_CLK 52 | ||
| 70 | #define SFAB_DFAB_M_A_CLK 53 | ||
| 71 | #define DFAB_SFAB_M_A_CLK 54 | ||
| 72 | #define DFAB_SWAY0_H_CLK 55 | ||
| 73 | #define DFAB_SWAY1_H_CLK 56 | ||
| 74 | #define DFAB_ARB0_H_CLK 57 | ||
| 75 | #define DFAB_ARB1_H_CLK 58 | ||
| 76 | #define PPSS_H_CLK 59 | ||
| 77 | #define PPSS_PROC_CLK 60 | ||
| 78 | #define PPSS_TIMER0_CLK 61 | ||
| 79 | #define PPSS_TIMER1_CLK 62 | ||
| 80 | #define PMEM_A_CLK 63 | ||
| 81 | #define DMA_BAM_H_CLK 64 | ||
| 82 | #define SIC_H_CLK 65 | ||
| 83 | #define SPS_TIC_H_CLK 66 | ||
| 84 | #define CFPB_2X_CLK_SRC 67 | ||
| 85 | #define CFPB_CLK 68 | ||
| 86 | #define CFPB0_H_CLK 69 | ||
| 87 | #define CFPB1_H_CLK 70 | ||
| 88 | #define CFPB2_H_CLK 71 | ||
| 89 | #define SFAB_CFPB_M_H_CLK 72 | ||
| 90 | #define CFPB_MASTER_H_CLK 73 | ||
| 91 | #define SFAB_CFPB_S_H_CLK 74 | ||
| 92 | #define CFPB_SPLITTER_H_CLK 75 | ||
| 93 | #define TSIF_H_CLK 76 | ||
| 94 | #define TSIF_INACTIVITY_TIMERS_CLK 77 | ||
| 95 | #define TSIF_REF_SRC 78 | ||
| 96 | #define TSIF_REF_CLK 79 | ||
| 97 | #define CE1_H_CLK 80 | ||
| 98 | #define CE1_CORE_CLK 81 | ||
| 99 | #define CE1_SLEEP_CLK 82 | ||
| 100 | #define CE2_H_CLK 83 | ||
| 101 | #define CE2_CORE_CLK 84 | ||
| 102 | #define SFPB_H_CLK_SRC 85 | ||
| 103 | #define SFPB_H_CLK 86 | ||
| 104 | #define SFAB_SFPB_M_H_CLK 87 | ||
| 105 | #define SFAB_SFPB_S_H_CLK 88 | ||
| 106 | #define RPM_PROC_CLK 89 | ||
| 107 | #define RPM_BUS_H_CLK 90 | ||
| 108 | #define RPM_SLEEP_CLK 91 | ||
| 109 | #define RPM_TIMER_CLK 92 | ||
| 110 | #define RPM_MSG_RAM_H_CLK 93 | ||
| 111 | #define PMIC_ARB0_H_CLK 94 | ||
| 112 | #define PMIC_ARB1_H_CLK 95 | ||
| 113 | #define PMIC_SSBI2_SRC 96 | ||
| 114 | #define PMIC_SSBI2_CLK 97 | ||
| 115 | #define SDC1_H_CLK 98 | ||
| 116 | #define SDC2_H_CLK 99 | ||
| 117 | #define SDC3_H_CLK 100 | ||
| 118 | #define SDC4_H_CLK 101 | ||
| 119 | #define SDC1_SRC 102 | ||
| 120 | #define SDC1_CLK 103 | ||
| 121 | #define SDC2_SRC 104 | ||
| 122 | #define SDC2_CLK 105 | ||
| 123 | #define SDC3_SRC 106 | ||
| 124 | #define SDC3_CLK 107 | ||
| 125 | #define SDC4_SRC 108 | ||
| 126 | #define SDC4_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_HSIC_H_CLK 113 | ||
| 131 | #define USB_HSIC_XCVR_SRC 114 | ||
| 132 | #define USB_HSIC_XCVR_CLK 115 | ||
| 133 | #define USB_HSIC_SYSTEM_CLK_SRC 116 | ||
| 134 | #define USB_HSIC_SYSTEM_CLK 117 | ||
| 135 | #define CFPB0_C0_H_CLK 118 | ||
| 136 | #define CFPB0_D0_H_CLK 119 | ||
| 137 | #define CFPB0_C1_H_CLK 120 | ||
| 138 | #define CFPB0_D1_H_CLK 121 | ||
| 139 | #define USB_FS1_H_CLK 122 | ||
| 140 | #define USB_FS1_XCVR_SRC 123 | ||
| 141 | #define USB_FS1_XCVR_CLK 124 | ||
| 142 | #define USB_FS1_SYSTEM_CLK 125 | ||
| 143 | #define GSBI_COMMON_SIM_SRC 126 | ||
| 144 | #define GSBI1_H_CLK 127 | ||
| 145 | #define GSBI2_H_CLK 128 | ||
| 146 | #define GSBI3_H_CLK 129 | ||
| 147 | #define GSBI4_H_CLK 130 | ||
| 148 | #define GSBI5_H_CLK 131 | ||
| 149 | #define GSBI6_H_CLK 132 | ||
| 150 | #define GSBI7_H_CLK 133 | ||
| 151 | #define GSBI1_QUP_SRC 134 | ||
| 152 | #define GSBI1_QUP_CLK 135 | ||
| 153 | #define GSBI2_QUP_SRC 136 | ||
| 154 | #define GSBI2_QUP_CLK 137 | ||
| 155 | #define GSBI3_QUP_SRC 138 | ||
| 156 | #define GSBI3_QUP_CLK 139 | ||
| 157 | #define GSBI4_QUP_SRC 140 | ||
| 158 | #define GSBI4_QUP_CLK 141 | ||
| 159 | #define GSBI5_QUP_SRC 142 | ||
| 160 | #define GSBI5_QUP_CLK 143 | ||
| 161 | #define GSBI6_QUP_SRC 144 | ||
| 162 | #define GSBI6_QUP_CLK 145 | ||
| 163 | #define GSBI7_QUP_SRC 146 | ||
| 164 | #define GSBI7_QUP_CLK 147 | ||
| 165 | #define GSBI1_UART_SRC 148 | ||
| 166 | #define GSBI1_UART_CLK 149 | ||
| 167 | #define GSBI2_UART_SRC 150 | ||
| 168 | #define GSBI2_UART_CLK 151 | ||
| 169 | #define GSBI3_UART_SRC 152 | ||
| 170 | #define GSBI3_UART_CLK 153 | ||
| 171 | #define GSBI4_UART_SRC 154 | ||
| 172 | #define GSBI4_UART_CLK 155 | ||
| 173 | #define GSBI5_UART_SRC 156 | ||
| 174 | #define GSBI5_UART_CLK 157 | ||
| 175 | #define GSBI6_UART_SRC 158 | ||
| 176 | #define GSBI6_UART_CLK 159 | ||
| 177 | #define GSBI7_UART_SRC 160 | ||
| 178 | #define GSBI7_UART_CLK 161 | ||
| 179 | #define GSBI1_SIM_CLK 162 | ||
| 180 | #define GSBI2_SIM_CLK 163 | ||
| 181 | #define GSBI3_SIM_CLK 164 | ||
| 182 | #define GSBI4_SIM_CLK 165 | ||
| 183 | #define GSBI5_SIM_CLK 166 | ||
| 184 | #define GSBI6_SIM_CLK 167 | ||
| 185 | #define GSBI7_SIM_CLK 168 | ||
| 186 | #define USB_HSIC_HSIC_CLK_SRC 169 | ||
| 187 | #define USB_HSIC_HSIC_CLK 170 | ||
| 188 | #define USB_HSIC_HSIO_CAL_CLK 171 | ||
| 189 | #define SPDM_CFG_H_CLK 172 | ||
| 190 | #define SPDM_MSTR_H_CLK 173 | ||
| 191 | #define SPDM_FF_CLK_SRC 174 | ||
| 192 | #define SPDM_FF_CLK 175 | ||
| 193 | #define SEC_CTRL_CLK 176 | ||
| 194 | #define SEC_CTRL_ACC_CLK_SRC 177 | ||
| 195 | #define SEC_CTRL_ACC_CLK 178 | ||
| 196 | #define TLMM_H_CLK 179 | ||
| 197 | #define TLMM_CLK 180 | ||
| 198 | #define SATA_H_CLK 181 | ||
| 199 | #define SATA_CLK_SRC 182 | ||
| 200 | #define SATA_RXOOB_CLK 183 | ||
| 201 | #define SATA_PMALIVE_CLK 184 | ||
| 202 | #define SATA_PHY_REF_CLK 185 | ||
| 203 | #define SATA_A_CLK 186 | ||
| 204 | #define SATA_PHY_CFG_CLK 187 | ||
| 205 | #define TSSC_CLK_SRC 188 | ||
| 206 | #define TSSC_CLK 189 | ||
| 207 | #define PDM_SRC 190 | ||
| 208 | #define PDM_CLK 191 | ||
| 209 | #define GP0_SRC 192 | ||
| 210 | #define GP0_CLK 193 | ||
| 211 | #define GP1_SRC 194 | ||
| 212 | #define GP1_CLK 195 | ||
| 213 | #define GP2_SRC 196 | ||
| 214 | #define GP2_CLK 197 | ||
| 215 | #define MPM_CLK 198 | ||
| 216 | #define EBI1_CLK_SRC 199 | ||
| 217 | #define EBI1_CH0_CLK 200 | ||
| 218 | #define EBI1_CH1_CLK 201 | ||
| 219 | #define EBI1_2X_CLK 202 | ||
| 220 | #define EBI1_CH0_DQ_CLK 203 | ||
| 221 | #define EBI1_CH1_DQ_CLK 204 | ||
| 222 | #define EBI1_CH0_CA_CLK 205 | ||
| 223 | #define EBI1_CH1_CA_CLK 206 | ||
| 224 | #define EBI1_XO_CLK 207 | ||
| 225 | #define SFAB_SMPSS_S_H_CLK 208 | ||
| 226 | #define PRNG_SRC 209 | ||
| 227 | #define PRNG_CLK 210 | ||
| 228 | #define PXO_SRC 211 | ||
| 229 | #define SPDM_CY_PORT0_CLK 212 | ||
| 230 | #define SPDM_CY_PORT1_CLK 213 | ||
| 231 | #define SPDM_CY_PORT2_CLK 214 | ||
| 232 | #define SPDM_CY_PORT3_CLK 215 | ||
| 233 | #define SPDM_CY_PORT4_CLK 216 | ||
| 234 | #define SPDM_CY_PORT5_CLK 217 | ||
| 235 | #define SPDM_CY_PORT6_CLK 218 | ||
| 236 | #define SPDM_CY_PORT7_CLK 219 | ||
| 237 | #define PLL0 220 | ||
| 238 | #define PLL0_VOTE 221 | ||
| 239 | #define PLL3 222 | ||
| 240 | #define PLL3_VOTE 223 | ||
| 241 | #define PLL4 224 | ||
| 242 | #define PLL4_VOTE 225 | ||
| 243 | #define PLL8 226 | ||
| 244 | #define PLL8_VOTE 227 | ||
| 245 | #define PLL9 228 | ||
| 246 | #define PLL10 229 | ||
| 247 | #define PLL11 230 | ||
| 248 | #define PLL12 231 | ||
| 249 | #define PLL14 232 | ||
| 250 | #define PLL14_VOTE 233 | ||
| 251 | #define PLL18 234 | ||
| 252 | #define CE5_SRC 235 | ||
| 253 | #define CE5_H_CLK 236 | ||
| 254 | #define CE5_CORE_CLK 237 | ||
| 255 | #define CE3_SLEEP_CLK 238 | ||
| 256 | #define SFAB_AHB_S8_FCLK 239 | ||
| 257 | #define SPDM_CY_PORT8_CLK 246 | ||
| 258 | #define PCIE_ALT_REF_SRC 247 | ||
| 259 | #define PCIE_ALT_REF_CLK 248 | ||
| 260 | #define PCIE_1_A_CLK 249 | ||
| 261 | #define PCIE_1_AUX_CLK 250 | ||
| 262 | #define PCIE_1_H_CLK 251 | ||
| 263 | #define PCIE_1_PHY_CLK 252 | ||
| 264 | #define PCIE_1_ALT_REF_SRC 253 | ||
| 265 | #define PCIE_1_ALT_REF_CLK 254 | ||
| 266 | #define PCIE_2_A_CLK 255 | ||
| 267 | #define PCIE_2_AUX_CLK 256 | ||
| 268 | #define PCIE_2_H_CLK 257 | ||
| 269 | #define PCIE_2_PHY_CLK 258 | ||
| 270 | #define PCIE_2_ALT_REF_SRC 259 | ||
| 271 | #define PCIE_2_ALT_REF_CLK 260 | ||
| 272 | #define EBI2_CLK 261 | ||
| 273 | #define USB30_SLEEP_CLK 262 | ||
| 274 | #define USB30_UTMI_SRC 263 | ||
| 275 | #define USB30_0_UTMI_CLK 264 | ||
| 276 | #define USB30_1_UTMI_CLK 265 | ||
| 277 | #define USB30_MASTER_SRC 266 | ||
| 278 | #define USB30_0_MASTER_CLK 267 | ||
| 279 | #define USB30_1_MASTER_CLK 268 | ||
| 280 | #define GMAC_CORE1_CLK_SRC 269 | ||
| 281 | #define GMAC_CORE2_CLK_SRC 270 | ||
| 282 | #define GMAC_CORE3_CLK_SRC 271 | ||
| 283 | #define GMAC_CORE4_CLK_SRC 272 | ||
| 284 | #define GMAC_CORE1_CLK 273 | ||
| 285 | #define GMAC_CORE2_CLK 274 | ||
| 286 | #define GMAC_CORE3_CLK 275 | ||
| 287 | #define GMAC_CORE4_CLK 276 | ||
| 288 | #define UBI32_CORE1_CLK_SRC 277 | ||
| 289 | #define UBI32_CORE2_CLK_SRC 278 | ||
| 290 | #define UBI32_CORE1_CLK 279 | ||
| 291 | #define UBI32_CORE2_CLK 280 | ||
| 292 | |||
| 293 | #endif | ||
diff --git a/include/dt-bindings/clock/qcom,gcc-msm8960.h b/include/dt-bindings/clock/qcom,gcc-msm8960.h index f9f547146a15..7d20eedfee98 100644 --- a/include/dt-bindings/clock/qcom,gcc-msm8960.h +++ b/include/dt-bindings/clock/qcom,gcc-msm8960.h | |||
| @@ -308,5 +308,16 @@ | |||
| 308 | #define PLL13 292 | 308 | #define PLL13 292 |
| 309 | #define PLL14 293 | 309 | #define PLL14 293 |
| 310 | #define PLL14_VOTE 294 | 310 | #define PLL14_VOTE 294 |
| 311 | #define USB_HS3_H_CLK 295 | ||
| 312 | #define USB_HS3_XCVR_SRC 296 | ||
| 313 | #define USB_HS3_XCVR_CLK 297 | ||
| 314 | #define USB_HS4_H_CLK 298 | ||
| 315 | #define USB_HS4_XCVR_SRC 299 | ||
| 316 | #define USB_HS4_XCVR_CLK 300 | ||
| 317 | #define SATA_PHY_CFG_CLK 301 | ||
| 318 | #define SATA_A_CLK 302 | ||
| 319 | #define CE3_SRC 303 | ||
| 320 | #define CE3_CORE_CLK 304 | ||
| 321 | #define CE3_H_CLK 305 | ||
| 311 | 322 | ||
| 312 | #endif | 323 | #endif |
diff --git a/include/dt-bindings/clock/qcom,mmcc-apq8084.h b/include/dt-bindings/clock/qcom,mmcc-apq8084.h new file mode 100644 index 000000000000..a929f86d0ddd --- /dev/null +++ b/include/dt-bindings/clock/qcom,mmcc-apq8084.h | |||
| @@ -0,0 +1,183 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2014, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_CLK_APQ_MMCC_8084_H | ||
| 15 | #define _DT_BINDINGS_CLK_APQ_MMCC_8084_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 MMPLL4 8 | ||
| 26 | #define CSI0_CLK_SRC 9 | ||
| 27 | #define CSI1_CLK_SRC 10 | ||
| 28 | #define CSI2_CLK_SRC 11 | ||
| 29 | #define CSI3_CLK_SRC 12 | ||
| 30 | #define VCODEC0_CLK_SRC 13 | ||
| 31 | #define VFE0_CLK_SRC 14 | ||
| 32 | #define VFE1_CLK_SRC 15 | ||
| 33 | #define MDP_CLK_SRC 16 | ||
| 34 | #define PCLK0_CLK_SRC 17 | ||
| 35 | #define PCLK1_CLK_SRC 18 | ||
| 36 | #define OCMEMNOC_CLK_SRC 19 | ||
| 37 | #define GFX3D_CLK_SRC 20 | ||
| 38 | #define JPEG0_CLK_SRC 21 | ||
| 39 | #define JPEG1_CLK_SRC 22 | ||
| 40 | #define JPEG2_CLK_SRC 23 | ||
| 41 | #define EDPPIXEL_CLK_SRC 24 | ||
| 42 | #define EXTPCLK_CLK_SRC 25 | ||
| 43 | #define VP_CLK_SRC 26 | ||
| 44 | #define CCI_CLK_SRC 27 | ||
| 45 | #define CAMSS_GP0_CLK_SRC 28 | ||
| 46 | #define CAMSS_GP1_CLK_SRC 29 | ||
| 47 | #define MCLK0_CLK_SRC 30 | ||
| 48 | #define MCLK1_CLK_SRC 31 | ||
| 49 | #define MCLK2_CLK_SRC 32 | ||
| 50 | #define MCLK3_CLK_SRC 33 | ||
| 51 | #define CSI0PHYTIMER_CLK_SRC 34 | ||
| 52 | #define CSI1PHYTIMER_CLK_SRC 35 | ||
| 53 | #define CSI2PHYTIMER_CLK_SRC 36 | ||
| 54 | #define CPP_CLK_SRC 37 | ||
| 55 | #define BYTE0_CLK_SRC 38 | ||
| 56 | #define BYTE1_CLK_SRC 39 | ||
| 57 | #define EDPAUX_CLK_SRC 40 | ||
| 58 | #define EDPLINK_CLK_SRC 41 | ||
| 59 | #define ESC0_CLK_SRC 42 | ||
| 60 | #define ESC1_CLK_SRC 43 | ||
| 61 | #define HDMI_CLK_SRC 44 | ||
| 62 | #define VSYNC_CLK_SRC 45 | ||
| 63 | #define RBCPR_CLK_SRC 46 | ||
| 64 | #define RBBMTIMER_CLK_SRC 47 | ||
| 65 | #define MAPLE_CLK_SRC 48 | ||
| 66 | #define VDP_CLK_SRC 49 | ||
| 67 | #define VPU_BUS_CLK_SRC 50 | ||
| 68 | #define MMSS_CXO_CLK 51 | ||
| 69 | #define MMSS_SLEEPCLK_CLK 52 | ||
| 70 | #define AVSYNC_AHB_CLK 53 | ||
| 71 | #define AVSYNC_EDPPIXEL_CLK 54 | ||
| 72 | #define AVSYNC_EXTPCLK_CLK 55 | ||
| 73 | #define AVSYNC_PCLK0_CLK 56 | ||
| 74 | #define AVSYNC_PCLK1_CLK 57 | ||
| 75 | #define AVSYNC_VP_CLK 58 | ||
| 76 | #define CAMSS_AHB_CLK 59 | ||
| 77 | #define CAMSS_CCI_CCI_AHB_CLK 60 | ||
| 78 | #define CAMSS_CCI_CCI_CLK 61 | ||
| 79 | #define CAMSS_CSI0_AHB_CLK 62 | ||
| 80 | #define CAMSS_CSI0_CLK 63 | ||
| 81 | #define CAMSS_CSI0PHY_CLK 64 | ||
| 82 | #define CAMSS_CSI0PIX_CLK 65 | ||
| 83 | #define CAMSS_CSI0RDI_CLK 66 | ||
| 84 | #define CAMSS_CSI1_AHB_CLK 67 | ||
| 85 | #define CAMSS_CSI1_CLK 68 | ||
| 86 | #define CAMSS_CSI1PHY_CLK 69 | ||
| 87 | #define CAMSS_CSI1PIX_CLK 70 | ||
| 88 | #define CAMSS_CSI1RDI_CLK 71 | ||
| 89 | #define CAMSS_CSI2_AHB_CLK 72 | ||
| 90 | #define CAMSS_CSI2_CLK 73 | ||
| 91 | #define CAMSS_CSI2PHY_CLK 74 | ||
| 92 | #define CAMSS_CSI2PIX_CLK 75 | ||
| 93 | #define CAMSS_CSI2RDI_CLK 76 | ||
| 94 | #define CAMSS_CSI3_AHB_CLK 77 | ||
| 95 | #define CAMSS_CSI3_CLK 78 | ||
| 96 | #define CAMSS_CSI3PHY_CLK 79 | ||
| 97 | #define CAMSS_CSI3PIX_CLK 80 | ||
| 98 | #define CAMSS_CSI3RDI_CLK 81 | ||
| 99 | #define CAMSS_CSI_VFE0_CLK 82 | ||
| 100 | #define CAMSS_CSI_VFE1_CLK 83 | ||
| 101 | #define CAMSS_GP0_CLK 84 | ||
| 102 | #define CAMSS_GP1_CLK 85 | ||
| 103 | #define CAMSS_ISPIF_AHB_CLK 86 | ||
| 104 | #define CAMSS_JPEG_JPEG0_CLK 87 | ||
| 105 | #define CAMSS_JPEG_JPEG1_CLK 88 | ||
| 106 | #define CAMSS_JPEG_JPEG2_CLK 89 | ||
| 107 | #define CAMSS_JPEG_JPEG_AHB_CLK 90 | ||
| 108 | #define CAMSS_JPEG_JPEG_AXI_CLK 91 | ||
| 109 | #define CAMSS_MCLK0_CLK 92 | ||
| 110 | #define CAMSS_MCLK1_CLK 93 | ||
| 111 | #define CAMSS_MCLK2_CLK 94 | ||
| 112 | #define CAMSS_MCLK3_CLK 95 | ||
| 113 | #define CAMSS_MICRO_AHB_CLK 96 | ||
| 114 | #define CAMSS_PHY0_CSI0PHYTIMER_CLK 97 | ||
| 115 | #define CAMSS_PHY1_CSI1PHYTIMER_CLK 98 | ||
| 116 | #define CAMSS_PHY2_CSI2PHYTIMER_CLK 99 | ||
| 117 | #define CAMSS_TOP_AHB_CLK 100 | ||
| 118 | #define CAMSS_VFE_CPP_AHB_CLK 101 | ||
| 119 | #define CAMSS_VFE_CPP_CLK 102 | ||
| 120 | #define CAMSS_VFE_VFE0_CLK 103 | ||
| 121 | #define CAMSS_VFE_VFE1_CLK 104 | ||
| 122 | #define CAMSS_VFE_VFE_AHB_CLK 105 | ||
| 123 | #define CAMSS_VFE_VFE_AXI_CLK 106 | ||
| 124 | #define MDSS_AHB_CLK 107 | ||
| 125 | #define MDSS_AXI_CLK 108 | ||
| 126 | #define MDSS_BYTE0_CLK 109 | ||
| 127 | #define MDSS_BYTE1_CLK 110 | ||
| 128 | #define MDSS_EDPAUX_CLK 111 | ||
| 129 | #define MDSS_EDPLINK_CLK 112 | ||
| 130 | #define MDSS_EDPPIXEL_CLK 113 | ||
| 131 | #define MDSS_ESC0_CLK 114 | ||
| 132 | #define MDSS_ESC1_CLK 115 | ||
| 133 | #define MDSS_EXTPCLK_CLK 116 | ||
| 134 | #define MDSS_HDMI_AHB_CLK 117 | ||
| 135 | #define MDSS_HDMI_CLK 118 | ||
| 136 | #define MDSS_MDP_CLK 119 | ||
| 137 | #define MDSS_MDP_LUT_CLK 120 | ||
| 138 | #define MDSS_PCLK0_CLK 121 | ||
| 139 | #define MDSS_PCLK1_CLK 122 | ||
| 140 | #define MDSS_VSYNC_CLK 123 | ||
| 141 | #define MMSS_RBCPR_AHB_CLK 124 | ||
| 142 | #define MMSS_RBCPR_CLK 125 | ||
| 143 | #define MMSS_SPDM_AHB_CLK 126 | ||
| 144 | #define MMSS_SPDM_AXI_CLK 127 | ||
| 145 | #define MMSS_SPDM_CSI0_CLK 128 | ||
| 146 | #define MMSS_SPDM_GFX3D_CLK 129 | ||
| 147 | #define MMSS_SPDM_JPEG0_CLK 130 | ||
| 148 | #define MMSS_SPDM_JPEG1_CLK 131 | ||
| 149 | #define MMSS_SPDM_JPEG2_CLK 132 | ||
| 150 | #define MMSS_SPDM_MDP_CLK 133 | ||
| 151 | #define MMSS_SPDM_PCLK0_CLK 134 | ||
| 152 | #define MMSS_SPDM_PCLK1_CLK 135 | ||
| 153 | #define MMSS_SPDM_VCODEC0_CLK 136 | ||
| 154 | #define MMSS_SPDM_VFE0_CLK 137 | ||
| 155 | #define MMSS_SPDM_VFE1_CLK 138 | ||
| 156 | #define MMSS_SPDM_RM_AXI_CLK 139 | ||
| 157 | #define MMSS_SPDM_RM_OCMEMNOC_CLK 140 | ||
| 158 | #define MMSS_MISC_AHB_CLK 141 | ||
| 159 | #define MMSS_MMSSNOC_AHB_CLK 142 | ||
| 160 | #define MMSS_MMSSNOC_BTO_AHB_CLK 143 | ||
| 161 | #define MMSS_MMSSNOC_AXI_CLK 144 | ||
| 162 | #define MMSS_S0_AXI_CLK 145 | ||
| 163 | #define OCMEMCX_AHB_CLK 146 | ||
| 164 | #define OCMEMCX_OCMEMNOC_CLK 147 | ||
| 165 | #define OXILI_OCMEMGX_CLK 148 | ||
| 166 | #define OXILI_GFX3D_CLK 149 | ||
| 167 | #define OXILI_RBBMTIMER_CLK 150 | ||
| 168 | #define OXILICX_AHB_CLK 151 | ||
| 169 | #define VENUS0_AHB_CLK 152 | ||
| 170 | #define VENUS0_AXI_CLK 153 | ||
| 171 | #define VENUS0_CORE0_VCODEC_CLK 154 | ||
| 172 | #define VENUS0_CORE1_VCODEC_CLK 155 | ||
| 173 | #define VENUS0_OCMEMNOC_CLK 156 | ||
| 174 | #define VENUS0_VCODEC0_CLK 157 | ||
| 175 | #define VPU_AHB_CLK 158 | ||
| 176 | #define VPU_AXI_CLK 159 | ||
| 177 | #define VPU_BUS_CLK 160 | ||
| 178 | #define VPU_CXO_CLK 161 | ||
| 179 | #define VPU_MAPLE_CLK 162 | ||
| 180 | #define VPU_SLEEP_CLK 163 | ||
| 181 | #define VPU_VDP_CLK 164 | ||
| 182 | |||
| 183 | #endif | ||
diff --git a/include/dt-bindings/clock/qcom,mmcc-msm8960.h b/include/dt-bindings/clock/qcom,mmcc-msm8960.h index 5868ef14a777..85041b28f97f 100644 --- a/include/dt-bindings/clock/qcom,mmcc-msm8960.h +++ b/include/dt-bindings/clock/qcom,mmcc-msm8960.h | |||
| @@ -133,5 +133,13 @@ | |||
| 133 | #define CSIPHY0_TIMER_CLK 116 | 133 | #define CSIPHY0_TIMER_CLK 116 |
| 134 | #define PLL1 117 | 134 | #define PLL1 117 |
| 135 | #define PLL2 118 | 135 | #define PLL2 118 |
| 136 | #define RGB_TV_CLK 119 | ||
| 137 | #define NPL_TV_CLK 120 | ||
| 138 | #define VCAP_AHB_CLK 121 | ||
| 139 | #define VCAP_AXI_CLK 122 | ||
| 140 | #define VCAP_SRC 123 | ||
| 141 | #define VCAP_CLK 124 | ||
| 142 | #define VCAP_NPL_CLK 125 | ||
| 143 | #define PLL15 126 | ||
| 136 | 144 | ||
| 137 | #endif | 145 | #endif |
diff --git a/include/dt-bindings/clock/rk3066a-cru.h b/include/dt-bindings/clock/rk3066a-cru.h new file mode 100644 index 000000000000..bc1ed1dbd855 --- /dev/null +++ b/include/dt-bindings/clock/rk3066a-cru.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2014 MundoReader S.L. | ||
| 3 | * Author: Heiko Stuebner <heiko@sntech.de> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #include <dt-bindings/clock/rk3188-cru-common.h> | ||
| 17 | |||
| 18 | /* soft-reset indices */ | ||
| 19 | #define SRST_SRST1 0 | ||
| 20 | #define SRST_SRST2 1 | ||
| 21 | |||
| 22 | #define SRST_L2MEM 18 | ||
| 23 | #define SRST_I2S0 23 | ||
| 24 | #define SRST_I2S1 24 | ||
| 25 | #define SRST_I2S2 25 | ||
| 26 | #define SRST_TIMER2 29 | ||
| 27 | |||
| 28 | #define SRST_GPIO4 36 | ||
| 29 | #define SRST_GPIO6 38 | ||
| 30 | |||
| 31 | #define SRST_TSADC 92 | ||
| 32 | |||
| 33 | #define SRST_HDMI 96 | ||
| 34 | #define SRST_HDMI_APB 97 | ||
| 35 | #define SRST_CIF1 111 | ||
diff --git a/include/dt-bindings/clock/rk3188-cru-common.h b/include/dt-bindings/clock/rk3188-cru-common.h new file mode 100644 index 000000000000..750ee60e75fb --- /dev/null +++ b/include/dt-bindings/clock/rk3188-cru-common.h | |||
| @@ -0,0 +1,249 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2014 MundoReader S.L. | ||
| 3 | * Author: Heiko Stuebner <heiko@sntech.de> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | */ | ||
| 15 | |||
| 16 | /* core clocks from */ | ||
| 17 | #define PLL_APLL 1 | ||
| 18 | #define PLL_DPLL 2 | ||
| 19 | #define PLL_CPLL 3 | ||
| 20 | #define PLL_GPLL 4 | ||
| 21 | #define CORE_PERI 5 | ||
| 22 | #define CORE_L2C 6 | ||
| 23 | |||
| 24 | /* sclk gates (special clocks) */ | ||
| 25 | #define SCLK_UART0 64 | ||
| 26 | #define SCLK_UART1 65 | ||
| 27 | #define SCLK_UART2 66 | ||
| 28 | #define SCLK_UART3 67 | ||
| 29 | #define SCLK_MAC 68 | ||
| 30 | #define SCLK_SPI0 69 | ||
| 31 | #define SCLK_SPI1 70 | ||
| 32 | #define SCLK_SARADC 71 | ||
| 33 | #define SCLK_SDMMC 72 | ||
| 34 | #define SCLK_SDIO 73 | ||
| 35 | #define SCLK_EMMC 74 | ||
| 36 | #define SCLK_I2S0 75 | ||
| 37 | #define SCLK_I2S1 76 | ||
| 38 | #define SCLK_I2S2 77 | ||
| 39 | #define SCLK_SPDIF 78 | ||
| 40 | #define SCLK_CIF0 79 | ||
| 41 | #define SCLK_CIF1 80 | ||
| 42 | #define SCLK_OTGPHY0 81 | ||
| 43 | #define SCLK_OTGPHY1 82 | ||
| 44 | #define SCLK_HSADC 83 | ||
| 45 | #define SCLK_TIMER0 84 | ||
| 46 | #define SCLK_TIMER1 85 | ||
| 47 | #define SCLK_TIMER2 86 | ||
| 48 | #define SCLK_TIMER3 87 | ||
| 49 | #define SCLK_TIMER4 88 | ||
| 50 | #define SCLK_TIMER5 89 | ||
| 51 | #define SCLK_TIMER6 90 | ||
| 52 | #define SCLK_JTAG 91 | ||
| 53 | #define SCLK_SMC 92 | ||
| 54 | |||
| 55 | #define DCLK_LCDC0 190 | ||
| 56 | #define DCLK_LCDC1 191 | ||
| 57 | |||
| 58 | /* aclk gates */ | ||
| 59 | #define ACLK_DMA1 192 | ||
| 60 | #define ACLK_DMA2 193 | ||
| 61 | #define ACLK_GPS 194 | ||
| 62 | #define ACLK_LCDC0 195 | ||
| 63 | #define ACLK_LCDC1 196 | ||
| 64 | #define ACLK_GPU 197 | ||
| 65 | #define ACLK_SMC 198 | ||
| 66 | #define ACLK_CIF 199 | ||
| 67 | #define ACLK_IPP 200 | ||
| 68 | #define ACLK_RGA 201 | ||
| 69 | #define ACLK_CIF0 202 | ||
| 70 | |||
| 71 | /* pclk gates */ | ||
| 72 | #define PCLK_GRF 320 | ||
| 73 | #define PCLK_PMU 321 | ||
| 74 | #define PCLK_TIMER0 322 | ||
| 75 | #define PCLK_TIMER1 323 | ||
| 76 | #define PCLK_TIMER2 324 | ||
| 77 | #define PCLK_TIMER3 325 | ||
| 78 | #define PCLK_PWM01 326 | ||
| 79 | #define PCLK_PWM23 327 | ||
| 80 | #define PCLK_SPI0 328 | ||
| 81 | #define PCLK_SPI1 329 | ||
| 82 | #define PCLK_SARADC 330 | ||
| 83 | #define PCLK_WDT 331 | ||
| 84 | #define PCLK_UART0 332 | ||
| 85 | #define PCLK_UART1 333 | ||
| 86 | #define PCLK_UART2 334 | ||
| 87 | #define PCLK_UART3 335 | ||
| 88 | #define PCLK_I2C0 336 | ||
| 89 | #define PCLK_I2C1 337 | ||
| 90 | #define PCLK_I2C2 338 | ||
| 91 | #define PCLK_I2C3 339 | ||
| 92 | #define PCLK_I2C4 340 | ||
| 93 | #define PCLK_GPIO0 341 | ||
| 94 | #define PCLK_GPIO1 342 | ||
| 95 | #define PCLK_GPIO2 343 | ||
| 96 | #define PCLK_GPIO3 344 | ||
| 97 | #define PCLK_GPIO4 345 | ||
| 98 | #define PCLK_GPIO6 346 | ||
| 99 | #define PCLK_EFUSE 347 | ||
| 100 | #define PCLK_TZPC 348 | ||
| 101 | #define PCLK_TSADC 349 | ||
| 102 | |||
| 103 | /* hclk gates */ | ||
| 104 | #define HCLK_SDMMC 448 | ||
| 105 | #define HCLK_SDIO 449 | ||
| 106 | #define HCLK_EMMC 450 | ||
| 107 | #define HCLK_OTG0 451 | ||
| 108 | #define HCLK_EMAC 452 | ||
| 109 | #define HCLK_SPDIF 453 | ||
| 110 | #define HCLK_I2S0 454 | ||
| 111 | #define HCLK_I2S1 455 | ||
| 112 | #define HCLK_I2S2 456 | ||
| 113 | #define HCLK_OTG1 457 | ||
| 114 | #define HCLK_HSIC 458 | ||
| 115 | #define HCLK_HSADC 459 | ||
| 116 | #define HCLK_PIDF 460 | ||
| 117 | #define HCLK_LCDC0 461 | ||
| 118 | #define HCLK_LCDC1 462 | ||
| 119 | #define HCLK_ROM 463 | ||
| 120 | #define HCLK_CIF0 464 | ||
| 121 | #define HCLK_IPP 465 | ||
| 122 | #define HCLK_RGA 466 | ||
| 123 | #define HCLK_NANDC0 467 | ||
| 124 | |||
| 125 | #define CLK_NR_CLKS (HCLK_NANDC0 + 1) | ||
| 126 | |||
| 127 | /* soft-reset indices */ | ||
| 128 | #define SRST_MCORE 2 | ||
| 129 | #define SRST_CORE0 3 | ||
| 130 | #define SRST_CORE1 4 | ||
| 131 | #define SRST_MCORE_DBG 7 | ||
| 132 | #define SRST_CORE0_DBG 8 | ||
| 133 | #define SRST_CORE1_DBG 9 | ||
| 134 | #define SRST_CORE0_WDT 12 | ||
| 135 | #define SRST_CORE1_WDT 13 | ||
| 136 | #define SRST_STRC_SYS 14 | ||
| 137 | #define SRST_L2C 15 | ||
| 138 | |||
| 139 | #define SRST_CPU_AHB 17 | ||
| 140 | #define SRST_AHB2APB 19 | ||
| 141 | #define SRST_DMA1 20 | ||
| 142 | #define SRST_INTMEM 21 | ||
| 143 | #define SRST_ROM 22 | ||
| 144 | #define SRST_SPDIF 26 | ||
| 145 | #define SRST_TIMER0 27 | ||
| 146 | #define SRST_TIMER1 28 | ||
| 147 | #define SRST_EFUSE 30 | ||
| 148 | |||
| 149 | #define SRST_GPIO0 32 | ||
| 150 | #define SRST_GPIO1 33 | ||
| 151 | #define SRST_GPIO2 34 | ||
| 152 | #define SRST_GPIO3 35 | ||
| 153 | |||
| 154 | #define SRST_UART0 39 | ||
| 155 | #define SRST_UART1 40 | ||
| 156 | #define SRST_UART2 41 | ||
| 157 | #define SRST_UART3 42 | ||
| 158 | #define SRST_I2C0 43 | ||
| 159 | #define SRST_I2C1 44 | ||
| 160 | #define SRST_I2C2 45 | ||
| 161 | #define SRST_I2C3 46 | ||
| 162 | #define SRST_I2C4 47 | ||
| 163 | |||
| 164 | #define SRST_PWM0 48 | ||
| 165 | #define SRST_PWM1 49 | ||
| 166 | #define SRST_DAP_PO 50 | ||
| 167 | #define SRST_DAP 51 | ||
| 168 | #define SRST_DAP_SYS 52 | ||
| 169 | #define SRST_TPIU_ATB 53 | ||
| 170 | #define SRST_PMU_APB 54 | ||
| 171 | #define SRST_GRF 55 | ||
| 172 | #define SRST_PMU 56 | ||
| 173 | #define SRST_PERI_AXI 57 | ||
| 174 | #define SRST_PERI_AHB 58 | ||
| 175 | #define SRST_PERI_APB 59 | ||
| 176 | #define SRST_PERI_NIU 60 | ||
| 177 | #define SRST_CPU_PERI 61 | ||
| 178 | #define SRST_EMEM_PERI 62 | ||
| 179 | #define SRST_USB_PERI 63 | ||
| 180 | |||
| 181 | #define SRST_DMA2 64 | ||
| 182 | #define SRST_SMC 65 | ||
| 183 | #define SRST_MAC 66 | ||
| 184 | #define SRST_NANC0 68 | ||
| 185 | #define SRST_USBOTG0 69 | ||
| 186 | #define SRST_USBPHY0 70 | ||
| 187 | #define SRST_OTGC0 71 | ||
| 188 | #define SRST_USBOTG1 72 | ||
| 189 | #define SRST_USBPHY1 73 | ||
| 190 | #define SRST_OTGC1 74 | ||
| 191 | #define SRST_HSADC 76 | ||
| 192 | #define SRST_PIDFILTER 77 | ||
| 193 | #define SRST_DDR_MSCH 79 | ||
| 194 | |||
| 195 | #define SRST_TZPC 80 | ||
| 196 | #define SRST_SDMMC 81 | ||
| 197 | #define SRST_SDIO 82 | ||
| 198 | #define SRST_EMMC 83 | ||
| 199 | #define SRST_SPI0 84 | ||
| 200 | #define SRST_SPI1 85 | ||
| 201 | #define SRST_WDT 86 | ||
| 202 | #define SRST_SARADC 87 | ||
| 203 | #define SRST_DDRPHY 88 | ||
| 204 | #define SRST_DDRPHY_APB 89 | ||
| 205 | #define SRST_DDRCTL 90 | ||
| 206 | #define SRST_DDRCTL_APB 91 | ||
| 207 | #define SRST_DDRPUB 93 | ||
| 208 | |||
| 209 | #define SRST_VIO0_AXI 98 | ||
| 210 | #define SRST_VIO0_AHB 99 | ||
| 211 | #define SRST_LCDC0_AXI 100 | ||
| 212 | #define SRST_LCDC0_AHB 101 | ||
| 213 | #define SRST_LCDC0_DCLK 102 | ||
| 214 | #define SRST_LCDC1_AXI 103 | ||
| 215 | #define SRST_LCDC1_AHB 104 | ||
| 216 | #define SRST_LCDC1_DCLK 105 | ||
| 217 | #define SRST_IPP_AXI 106 | ||
| 218 | #define SRST_IPP_AHB 107 | ||
| 219 | #define SRST_RGA_AXI 108 | ||
| 220 | #define SRST_RGA_AHB 109 | ||
| 221 | #define SRST_CIF0 110 | ||
| 222 | |||
| 223 | #define SRST_VCODEC_AXI 112 | ||
| 224 | #define SRST_VCODEC_AHB 113 | ||
| 225 | #define SRST_VIO1_AXI 114 | ||
| 226 | #define SRST_VCODEC_CPU 115 | ||
| 227 | #define SRST_VCODEC_NIU 116 | ||
| 228 | #define SRST_GPU 120 | ||
| 229 | #define SRST_GPU_NIU 122 | ||
| 230 | #define SRST_TFUN_ATB 125 | ||
| 231 | #define SRST_TFUN_APB 126 | ||
| 232 | #define SRST_CTI4_APB 127 | ||
| 233 | |||
| 234 | #define SRST_TPIU_APB 128 | ||
| 235 | #define SRST_TRACE 129 | ||
| 236 | #define SRST_CORE_DBG 130 | ||
| 237 | #define SRST_DBG_APB 131 | ||
| 238 | #define SRST_CTI0 132 | ||
| 239 | #define SRST_CTI0_APB 133 | ||
| 240 | #define SRST_CTI1 134 | ||
| 241 | #define SRST_CTI1_APB 135 | ||
| 242 | #define SRST_PTM_CORE0 136 | ||
| 243 | #define SRST_PTM_CORE1 137 | ||
| 244 | #define SRST_PTM0 138 | ||
| 245 | #define SRST_PTM0_ATB 139 | ||
| 246 | #define SRST_PTM1 140 | ||
| 247 | #define SRST_PTM1_ATB 141 | ||
| 248 | #define SRST_CTM 142 | ||
| 249 | #define SRST_TS 143 | ||
diff --git a/include/dt-bindings/clock/rk3188-cru.h b/include/dt-bindings/clock/rk3188-cru.h new file mode 100644 index 000000000000..9fac8edd3f9d --- /dev/null +++ b/include/dt-bindings/clock/rk3188-cru.h | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2014 MundoReader S.L. | ||
| 3 | * Author: Heiko Stuebner <heiko@sntech.de> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #include <dt-bindings/clock/rk3188-cru-common.h> | ||
| 17 | |||
| 18 | /* soft-reset indices */ | ||
| 19 | #define SRST_PTM_CORE2 0 | ||
| 20 | #define SRST_PTM_CORE3 1 | ||
| 21 | #define SRST_CORE2 5 | ||
| 22 | #define SRST_CORE3 6 | ||
| 23 | #define SRST_CORE2_DBG 10 | ||
| 24 | #define SRST_CORE3_DBG 11 | ||
| 25 | |||
| 26 | #define SRST_TIMER2 16 | ||
| 27 | #define SRST_TIMER4 23 | ||
| 28 | #define SRST_I2S0 24 | ||
| 29 | #define SRST_TIMER5 25 | ||
| 30 | #define SRST_TIMER3 29 | ||
| 31 | #define SRST_TIMER6 31 | ||
| 32 | |||
| 33 | #define SRST_PTM3 36 | ||
| 34 | #define SRST_PTM3_ATB 37 | ||
| 35 | |||
| 36 | #define SRST_GPS 67 | ||
| 37 | #define SRST_HSICPHY 75 | ||
| 38 | #define SRST_TIMER 78 | ||
| 39 | |||
| 40 | #define SRST_PTM2 92 | ||
| 41 | #define SRST_CORE2_WDT 94 | ||
| 42 | #define SRST_CORE3_WDT 95 | ||
| 43 | |||
| 44 | #define SRST_PTM2_ATB 111 | ||
| 45 | |||
| 46 | #define SRST_HSIC 117 | ||
| 47 | #define SRST_CTI2 118 | ||
| 48 | #define SRST_CTI2_APB 119 | ||
| 49 | #define SRST_GPU_BRIDGE 121 | ||
| 50 | #define SRST_CTI3 123 | ||
| 51 | #define SRST_CTI3_APB 124 | ||
diff --git a/include/dt-bindings/clock/rk3288-cru.h b/include/dt-bindings/clock/rk3288-cru.h new file mode 100644 index 000000000000..ebcb460ea4ad --- /dev/null +++ b/include/dt-bindings/clock/rk3288-cru.h | |||
| @@ -0,0 +1,278 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2014 MundoReader S.L. | ||
| 3 | * Author: Heiko Stuebner <heiko@sntech.de> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | */ | ||
| 15 | |||
| 16 | /* core clocks */ | ||
| 17 | #define PLL_APLL 1 | ||
| 18 | #define PLL_DPLL 2 | ||
| 19 | #define PLL_CPLL 3 | ||
| 20 | #define PLL_GPLL 4 | ||
| 21 | #define PLL_NPLL 5 | ||
| 22 | |||
| 23 | /* sclk gates (special clocks) */ | ||
| 24 | #define SCLK_GPU 64 | ||
| 25 | #define SCLK_SPI0 65 | ||
| 26 | #define SCLK_SPI1 66 | ||
| 27 | #define SCLK_SPI2 67 | ||
| 28 | #define SCLK_SDMMC 68 | ||
| 29 | #define SCLK_SDIO0 69 | ||
| 30 | #define SCLK_SDIO1 70 | ||
| 31 | #define SCLK_EMMC 71 | ||
| 32 | #define SCLK_TSADC 72 | ||
| 33 | #define SCLK_SARADC 73 | ||
| 34 | #define SCLK_PS2C 74 | ||
| 35 | #define SCLK_NANDC0 75 | ||
| 36 | #define SCLK_NANDC1 76 | ||
| 37 | #define SCLK_UART0 77 | ||
| 38 | #define SCLK_UART1 78 | ||
| 39 | #define SCLK_UART2 79 | ||
| 40 | #define SCLK_UART3 80 | ||
| 41 | #define SCLK_UART4 81 | ||
| 42 | #define SCLK_I2S0 82 | ||
| 43 | #define SCLK_SPDIF 83 | ||
| 44 | #define SCLK_SPDIF8CH 84 | ||
| 45 | #define SCLK_TIMER0 85 | ||
| 46 | #define SCLK_TIMER1 86 | ||
| 47 | #define SCLK_TIMER2 87 | ||
| 48 | #define SCLK_TIMER3 88 | ||
| 49 | #define SCLK_TIMER4 89 | ||
| 50 | #define SCLK_TIMER5 90 | ||
| 51 | #define SCLK_TIMER6 91 | ||
| 52 | #define SCLK_HSADC 92 | ||
| 53 | #define SCLK_OTGPHY0 93 | ||
| 54 | #define SCLK_OTGPHY1 94 | ||
| 55 | #define SCLK_OTGPHY2 95 | ||
| 56 | #define SCLK_OTG_ADP 96 | ||
| 57 | #define SCLK_HSICPHY480M 97 | ||
| 58 | #define SCLK_HSICPHY12M 98 | ||
| 59 | #define SCLK_MACREF 99 | ||
| 60 | #define SCLK_LCDC_PWM0 100 | ||
| 61 | #define SCLK_LCDC_PWM1 101 | ||
| 62 | #define SCLK_MAC_RX 102 | ||
| 63 | #define SCLK_MAC_TX 103 | ||
| 64 | |||
| 65 | #define DCLK_VOP0 190 | ||
| 66 | #define DCLK_VOP1 191 | ||
| 67 | |||
| 68 | /* aclk gates */ | ||
| 69 | #define ACLK_GPU 192 | ||
| 70 | #define ACLK_DMAC1 193 | ||
| 71 | #define ACLK_DMAC2 194 | ||
| 72 | #define ACLK_MMU 195 | ||
| 73 | #define ACLK_GMAC 196 | ||
| 74 | #define ACLK_VOP0 197 | ||
| 75 | #define ACLK_VOP1 198 | ||
| 76 | #define ACLK_CRYPTO 199 | ||
| 77 | #define ACLK_RGA 200 | ||
| 78 | |||
| 79 | /* pclk gates */ | ||
| 80 | #define PCLK_GPIO0 320 | ||
| 81 | #define PCLK_GPIO1 321 | ||
| 82 | #define PCLK_GPIO2 322 | ||
| 83 | #define PCLK_GPIO3 323 | ||
| 84 | #define PCLK_GPIO4 324 | ||
| 85 | #define PCLK_GPIO5 325 | ||
| 86 | #define PCLK_GPIO6 326 | ||
| 87 | #define PCLK_GPIO7 327 | ||
| 88 | #define PCLK_GPIO8 328 | ||
| 89 | #define PCLK_GRF 329 | ||
| 90 | #define PCLK_SGRF 330 | ||
| 91 | #define PCLK_PMU 331 | ||
| 92 | #define PCLK_I2C0 332 | ||
| 93 | #define PCLK_I2C1 333 | ||
| 94 | #define PCLK_I2C2 334 | ||
| 95 | #define PCLK_I2C3 335 | ||
| 96 | #define PCLK_I2C4 336 | ||
| 97 | #define PCLK_I2C5 337 | ||
| 98 | #define PCLK_SPI0 338 | ||
| 99 | #define PCLK_SPI1 339 | ||
| 100 | #define PCLK_SPI2 340 | ||
| 101 | #define PCLK_UART0 341 | ||
| 102 | #define PCLK_UART1 342 | ||
| 103 | #define PCLK_UART2 343 | ||
| 104 | #define PCLK_UART3 344 | ||
| 105 | #define PCLK_UART4 345 | ||
| 106 | #define PCLK_TSADC 346 | ||
| 107 | #define PCLK_SARADC 347 | ||
| 108 | #define PCLK_SIM 348 | ||
| 109 | #define PCLK_GMAC 349 | ||
| 110 | #define PCLK_PWM 350 | ||
| 111 | #define PCLK_RKPWM 351 | ||
| 112 | #define PCLK_PS2C 352 | ||
| 113 | #define PCLK_TIMER 353 | ||
| 114 | #define PCLK_TZPC 354 | ||
| 115 | |||
| 116 | /* hclk gates */ | ||
| 117 | #define HCLK_GPS 448 | ||
| 118 | #define HCLK_OTG0 449 | ||
| 119 | #define HCLK_USBHOST0 450 | ||
| 120 | #define HCLK_USBHOST1 451 | ||
| 121 | #define HCLK_HSIC 452 | ||
| 122 | #define HCLK_NANDC0 453 | ||
| 123 | #define HCLK_NANDC1 454 | ||
| 124 | #define HCLK_TSP 455 | ||
| 125 | #define HCLK_SDMMC 456 | ||
| 126 | #define HCLK_SDIO0 457 | ||
| 127 | #define HCLK_SDIO1 458 | ||
| 128 | #define HCLK_EMMC 459 | ||
| 129 | #define HCLK_HSADC 460 | ||
| 130 | #define HCLK_CRYPTO 461 | ||
| 131 | #define HCLK_I2S0 462 | ||
| 132 | #define HCLK_SPDIF 463 | ||
| 133 | #define HCLK_SPDIF8CH 464 | ||
| 134 | #define HCLK_VOP0 465 | ||
| 135 | #define HCLK_VOP1 466 | ||
| 136 | #define HCLK_ROM 467 | ||
| 137 | #define HCLK_IEP 468 | ||
| 138 | #define HCLK_ISP 469 | ||
| 139 | #define HCLK_RGA 470 | ||
| 140 | |||
| 141 | #define CLK_NR_CLKS (HCLK_RGA + 1) | ||
| 142 | |||
| 143 | /* soft-reset indices */ | ||
| 144 | #define SRST_CORE0 0 | ||
| 145 | #define SRST_CORE1 1 | ||
| 146 | #define SRST_CORE2 2 | ||
| 147 | #define SRST_CORE3 3 | ||
| 148 | #define SRST_CORE0_PO 4 | ||
| 149 | #define SRST_CORE1_PO 5 | ||
| 150 | #define SRST_CORE2_PO 6 | ||
| 151 | #define SRST_CORE3_PO 7 | ||
| 152 | #define SRST_PDCORE_STRSYS 8 | ||
| 153 | #define SRST_PDBUS_STRSYS 9 | ||
| 154 | #define SRST_L2C 10 | ||
| 155 | #define SRST_TOPDBG 11 | ||
| 156 | #define SRST_CORE0_DBG 12 | ||
| 157 | #define SRST_CORE1_DBG 13 | ||
| 158 | #define SRST_CORE2_DBG 14 | ||
| 159 | #define SRST_CORE3_DBG 15 | ||
| 160 | |||
| 161 | #define SRST_PDBUG_AHB_ARBITOR 16 | ||
| 162 | #define SRST_EFUSE256 17 | ||
| 163 | #define SRST_DMAC1 18 | ||
| 164 | #define SRST_INTMEM 19 | ||
| 165 | #define SRST_ROM 20 | ||
| 166 | #define SRST_SPDIF8CH 21 | ||
| 167 | #define SRST_TIMER 22 | ||
| 168 | #define SRST_I2S0 23 | ||
| 169 | #define SRST_SPDIF 24 | ||
| 170 | #define SRST_TIMER0 25 | ||
| 171 | #define SRST_TIMER1 26 | ||
| 172 | #define SRST_TIMER2 27 | ||
| 173 | #define SRST_TIMER3 28 | ||
| 174 | #define SRST_TIMER4 29 | ||
| 175 | #define SRST_TIMER5 30 | ||
| 176 | #define SRST_EFUSE 31 | ||
| 177 | |||
| 178 | #define SRST_GPIO0 32 | ||
| 179 | #define SRST_GPIO1 33 | ||
| 180 | #define SRST_GPIO2 34 | ||
| 181 | #define SRST_GPIO3 35 | ||
| 182 | #define SRST_GPIO4 36 | ||
| 183 | #define SRST_GPIO5 37 | ||
| 184 | #define SRST_GPIO6 38 | ||
| 185 | #define SRST_GPIO7 39 | ||
| 186 | #define SRST_GPIO8 40 | ||
| 187 | #define SRST_I2C0 42 | ||
| 188 | #define SRST_I2C1 43 | ||
| 189 | #define SRST_I2C2 44 | ||
| 190 | #define SRST_I2C3 45 | ||
| 191 | #define SRST_I2C4 46 | ||
| 192 | #define SRST_I2C5 47 | ||
| 193 | |||
| 194 | #define SRST_DWPWM 48 | ||
| 195 | #define SRST_MMC_PERI 49 | ||
| 196 | #define SRST_PERIPH_MMU 50 | ||
| 197 | #define SRST_DAP 51 | ||
| 198 | #define SRST_DAP_SYS 52 | ||
| 199 | #define SRST_TPIU 53 | ||
| 200 | #define SRST_PMU_APB 54 | ||
| 201 | #define SRST_GRF 55 | ||
| 202 | #define SRST_PMU 56 | ||
| 203 | #define SRST_PERIPH_AXI 57 | ||
| 204 | #define SRST_PERIPH_AHB 58 | ||
| 205 | #define SRST_PERIPH_APB 59 | ||
| 206 | #define SRST_PERIPH_NIU 60 | ||
| 207 | #define SRST_PDPERI_AHB_ARBI 61 | ||
| 208 | #define SRST_EMEM 62 | ||
| 209 | #define SRST_USB_PERI 63 | ||
| 210 | |||
| 211 | #define SRST_DMAC2 64 | ||
| 212 | #define SRST_MAC 66 | ||
| 213 | #define SRST_GPS 67 | ||
| 214 | #define SRST_RKPWM 69 | ||
| 215 | #define SRST_CCP 71 | ||
| 216 | #define SRST_USBHOST0 72 | ||
| 217 | #define SRST_HSIC 73 | ||
| 218 | #define SRST_HSIC_AUX 74 | ||
| 219 | #define SRST_HSIC_PHY 75 | ||
| 220 | #define SRST_HSADC 76 | ||
| 221 | #define SRST_NANDC0 77 | ||
| 222 | #define SRST_NANDC1 78 | ||
| 223 | |||
| 224 | #define SRST_TZPC 80 | ||
| 225 | #define SRST_SPI0 83 | ||
| 226 | #define SRST_SPI1 84 | ||
| 227 | #define SRST_SPI2 85 | ||
| 228 | #define SRST_SARADC 87 | ||
| 229 | #define SRST_PDALIVE_NIU 88 | ||
| 230 | #define SRST_PDPMU_INTMEM 89 | ||
| 231 | #define SRST_PDPMU_NIU 90 | ||
| 232 | #define SRST_SGRF 91 | ||
| 233 | |||
| 234 | #define SRST_VIO_ARBI 96 | ||
| 235 | #define SRST_RGA_NIU 97 | ||
| 236 | #define SRST_VIO0_NIU_AXI 98 | ||
| 237 | #define SRST_VIO_NIU_AHB 99 | ||
| 238 | #define SRST_LCDC0_AXI 100 | ||
| 239 | #define SRST_LCDC0_AHB 101 | ||
| 240 | #define SRST_LCDC0_DCLK 102 | ||
| 241 | #define SRST_VIO1_NIU_AXI 103 | ||
| 242 | #define SRST_VIP 104 | ||
| 243 | #define SRST_RGA_CORE 105 | ||
| 244 | #define SRST_IEP_AXI 106 | ||
| 245 | #define SRST_IEP_AHB 107 | ||
| 246 | #define SRST_RGA_AXI 108 | ||
| 247 | #define SRST_RGA_AHB 109 | ||
| 248 | #define SRST_ISP 110 | ||
| 249 | #define SRST_EDP 111 | ||
| 250 | |||
| 251 | #define SRST_VCODEC_AXI 112 | ||
| 252 | #define SRST_VCODEC_AHB 113 | ||
| 253 | #define SRST_VIO_H2P 114 | ||
| 254 | #define SRST_MIPIDSI0 115 | ||
| 255 | #define SRST_MIPIDSI1 116 | ||
| 256 | #define SRST_MIPICSI 117 | ||
| 257 | #define SRST_LVDS_PHY 118 | ||
| 258 | #define SRST_LVDS_CON 119 | ||
| 259 | #define SRST_GPU 120 | ||
| 260 | #define SRST_HDMI 121 | ||
| 261 | #define SRST_CORE_PVTM 124 | ||
| 262 | #define SRST_GPU_PVTM 125 | ||
| 263 | |||
| 264 | #define SRST_MMC0 128 | ||
| 265 | #define SRST_SDIO0 129 | ||
| 266 | #define SRST_SDIO1 130 | ||
| 267 | #define SRST_EMMC 131 | ||
| 268 | #define SRST_USBOTG_AHB 132 | ||
| 269 | #define SRST_USBOTG_PHY 133 | ||
| 270 | #define SRST_USBOTG_CON 134 | ||
| 271 | #define SRST_USBHOST0_AHB 135 | ||
| 272 | #define SRST_USBHOST0_PHY 136 | ||
| 273 | #define SRST_USBHOST0_CON 137 | ||
| 274 | #define SRST_USBHOST1_AHB 138 | ||
| 275 | #define SRST_USBHOST1_PHY 139 | ||
| 276 | #define SRST_USBHOST1_CON 140 | ||
| 277 | #define SRST_USB_ADP 141 | ||
| 278 | #define SRST_ACC_EFUSE 142 | ||
diff --git a/include/dt-bindings/mfd/palmas.h b/include/dt-bindings/mfd/palmas.h new file mode 100644 index 000000000000..2c8ac4841385 --- /dev/null +++ b/include/dt-bindings/mfd/palmas.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /* | ||
| 2 | * This header provides macros for Palmas device bindings. | ||
| 3 | * | ||
| 4 | * Copyright (c) 2013, NVIDIA Corporation. | ||
| 5 | * | ||
| 6 | * Author: Laxman Dewangan <ldewangan@nvidia.com> | ||
| 7 | * | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __DT_BINDINGS_PALMAS_H__ | ||
| 11 | #define __DT_BINDINGS_PALMAS_H | ||
| 12 | |||
| 13 | /* External control pins */ | ||
| 14 | #define PALMAS_EXT_CONTROL_PIN_ENABLE1 1 | ||
| 15 | #define PALMAS_EXT_CONTROL_PIN_ENABLE2 2 | ||
| 16 | #define PALMAS_EXT_CONTROL_PIN_NSLEEP 3 | ||
| 17 | |||
| 18 | #endif /* __DT_BINDINGS_PALMAS_H */ | ||
diff --git a/include/dt-bindings/phy/phy-miphy365x.h b/include/dt-bindings/phy/phy-miphy365x.h new file mode 100644 index 000000000000..8ef8aba6edd6 --- /dev/null +++ b/include/dt-bindings/phy/phy-miphy365x.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | /* | ||
| 2 | * This header provides constants for the phy framework | ||
| 3 | * based on the STMicroelectronics MiPHY365x. | ||
| 4 | * | ||
| 5 | * Author: Lee Jones <lee.jones@linaro.org> | ||
| 6 | */ | ||
| 7 | #ifndef _DT_BINDINGS_PHY_MIPHY | ||
| 8 | #define _DT_BINDINGS_PHY_MIPHY | ||
| 9 | |||
| 10 | #define MIPHY_TYPE_SATA 1 | ||
| 11 | #define MIPHY_TYPE_PCIE 2 | ||
| 12 | #define MIPHY_TYPE_USB 3 | ||
| 13 | |||
| 14 | #endif /* _DT_BINDINGS_PHY_MIPHY */ | ||
diff --git a/include/dt-bindings/pinctrl/dra.h b/include/dt-bindings/pinctrl/dra.h index 002a2855c046..3d33794e4f3e 100644 --- a/include/dt-bindings/pinctrl/dra.h +++ b/include/dt-bindings/pinctrl/dra.h | |||
| @@ -30,7 +30,8 @@ | |||
| 30 | #define MUX_MODE14 0xe | 30 | #define MUX_MODE14 0xe |
| 31 | #define MUX_MODE15 0xf | 31 | #define MUX_MODE15 0xf |
| 32 | 32 | ||
| 33 | #define PULL_ENA (1 << 16) | 33 | #define PULL_ENA (0 << 16) |
| 34 | #define PULL_DIS (1 << 16) | ||
| 34 | #define PULL_UP (1 << 17) | 35 | #define PULL_UP (1 << 17) |
| 35 | #define INPUT_EN (1 << 18) | 36 | #define INPUT_EN (1 << 18) |
| 36 | #define SLEWCONTROL (1 << 19) | 37 | #define SLEWCONTROL (1 << 19) |
| @@ -38,10 +39,10 @@ | |||
| 38 | #define WAKEUP_EVENT (1 << 25) | 39 | #define WAKEUP_EVENT (1 << 25) |
| 39 | 40 | ||
| 40 | /* Active pin states */ | 41 | /* Active pin states */ |
| 41 | #define PIN_OUTPUT 0 | 42 | #define PIN_OUTPUT (0 | PULL_DIS) |
| 42 | #define PIN_OUTPUT_PULLUP (PIN_OUTPUT | PULL_ENA | PULL_UP) | 43 | #define PIN_OUTPUT_PULLUP (PIN_OUTPUT | PULL_ENA | PULL_UP) |
| 43 | #define PIN_OUTPUT_PULLDOWN (PIN_OUTPUT | PULL_ENA) | 44 | #define PIN_OUTPUT_PULLDOWN (PIN_OUTPUT | PULL_ENA) |
| 44 | #define PIN_INPUT INPUT_EN | 45 | #define PIN_INPUT (INPUT_EN | PULL_DIS) |
| 45 | #define PIN_INPUT_SLEW (INPUT_EN | SLEWCONTROL) | 46 | #define PIN_INPUT_SLEW (INPUT_EN | SLEWCONTROL) |
| 46 | #define PIN_INPUT_PULLUP (PULL_ENA | INPUT_EN | PULL_UP) | 47 | #define PIN_INPUT_PULLUP (PULL_ENA | INPUT_EN | PULL_UP) |
| 47 | #define PIN_INPUT_PULLDOWN (PULL_ENA | INPUT_EN) | 48 | #define PIN_INPUT_PULLDOWN (PULL_ENA | INPUT_EN) |
diff --git a/include/dt-bindings/reset/qcom,gcc-apq8084.h b/include/dt-bindings/reset/qcom,gcc-apq8084.h new file mode 100644 index 000000000000..527caaf48e3d --- /dev/null +++ b/include/dt-bindings/reset/qcom,gcc-apq8084.h | |||
| @@ -0,0 +1,109 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2014, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_RESET_APQ_GCC_8084_H | ||
| 15 | #define _DT_BINDINGS_RESET_APQ_GCC_8084_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_PRNG_BCR 43 | ||
| 61 | #define GCC_BAM_DMA_BCR 44 | ||
| 62 | #define GCC_TSIF_BCR 45 | ||
| 63 | #define GCC_TCSR_BCR 46 | ||
| 64 | #define GCC_BOOT_ROM_BCR 47 | ||
| 65 | #define GCC_MSG_RAM_BCR 48 | ||
| 66 | #define GCC_TLMM_BCR 49 | ||
| 67 | #define GCC_MPM_BCR 50 | ||
| 68 | #define GCC_MPM_AHB_RESET 51 | ||
| 69 | #define GCC_MPM_NON_AHB_RESET 52 | ||
| 70 | #define GCC_SEC_CTRL_BCR 53 | ||
| 71 | #define GCC_SPMI_BCR 54 | ||
| 72 | #define GCC_SPDM_BCR 55 | ||
| 73 | #define GCC_CE1_BCR 56 | ||
| 74 | #define GCC_CE2_BCR 57 | ||
| 75 | #define GCC_BIMC_BCR 58 | ||
| 76 | #define GCC_SNOC_BUS_TIMEOUT0_BCR 59 | ||
| 77 | #define GCC_SNOC_BUS_TIMEOUT2_BCR 60 | ||
| 78 | #define GCC_PNOC_BUS_TIMEOUT0_BCR 61 | ||
| 79 | #define GCC_PNOC_BUS_TIMEOUT1_BCR 62 | ||
| 80 | #define GCC_PNOC_BUS_TIMEOUT2_BCR 63 | ||
| 81 | #define GCC_PNOC_BUS_TIMEOUT3_BCR 64 | ||
| 82 | #define GCC_PNOC_BUS_TIMEOUT4_BCR 65 | ||
| 83 | #define GCC_CNOC_BUS_TIMEOUT0_BCR 66 | ||
| 84 | #define GCC_CNOC_BUS_TIMEOUT1_BCR 67 | ||
| 85 | #define GCC_CNOC_BUS_TIMEOUT2_BCR 68 | ||
| 86 | #define GCC_CNOC_BUS_TIMEOUT3_BCR 69 | ||
| 87 | #define GCC_CNOC_BUS_TIMEOUT4_BCR 70 | ||
| 88 | #define GCC_CNOC_BUS_TIMEOUT5_BCR 71 | ||
| 89 | #define GCC_CNOC_BUS_TIMEOUT6_BCR 72 | ||
| 90 | #define GCC_DEHR_BCR 73 | ||
| 91 | #define GCC_RBCPR_BCR 74 | ||
| 92 | #define GCC_MSS_RESTART 75 | ||
| 93 | #define GCC_LPASS_RESTART 76 | ||
| 94 | #define GCC_WCSS_RESTART 77 | ||
| 95 | #define GCC_VENUS_RESTART 78 | ||
| 96 | #define GCC_COPSS_SMMU_BCR 79 | ||
| 97 | #define GCC_SPSS_BCR 80 | ||
| 98 | #define GCC_PCIE_0_BCR 81 | ||
| 99 | #define GCC_PCIE_0_PHY_BCR 82 | ||
| 100 | #define GCC_PCIE_1_BCR 83 | ||
| 101 | #define GCC_PCIE_1_PHY_BCR 84 | ||
| 102 | #define GCC_USB_30_SEC_BCR 85 | ||
| 103 | #define GCC_USB3_SEC_PHY_BCR 86 | ||
| 104 | #define GCC_SATA_BCR 87 | ||
| 105 | #define GCC_CE3_BCR 88 | ||
| 106 | #define GCC_UFS_BCR 89 | ||
| 107 | #define GCC_USB30_PHY_COM_BCR 90 | ||
| 108 | |||
| 109 | #endif | ||
diff --git a/include/dt-bindings/reset/qcom,gcc-ipq806x.h b/include/dt-bindings/reset/qcom,gcc-ipq806x.h new file mode 100644 index 000000000000..0ad5ef930b5d --- /dev/null +++ b/include/dt-bindings/reset/qcom,gcc-ipq806x.h | |||
| @@ -0,0 +1,132 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2014, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_RESET_IPQ_806X_H | ||
| 15 | #define _DT_BINDINGS_RESET_IPQ_806X_H | ||
| 16 | |||
| 17 | #define QDSS_STM_RESET 0 | ||
| 18 | #define AFAB_SMPSS_S_RESET 1 | ||
| 19 | #define AFAB_SMPSS_M1_RESET 2 | ||
| 20 | #define AFAB_SMPSS_M0_RESET 3 | ||
| 21 | #define AFAB_EBI1_CH0_RESET 4 | ||
| 22 | #define AFAB_EBI1_CH1_RESET 5 | ||
| 23 | #define SFAB_ADM0_M0_RESET 6 | ||
| 24 | #define SFAB_ADM0_M1_RESET 7 | ||
| 25 | #define SFAB_ADM0_M2_RESET 8 | ||
| 26 | #define ADM0_C2_RESET 9 | ||
| 27 | #define ADM0_C1_RESET 10 | ||
| 28 | #define ADM0_C0_RESET 11 | ||
| 29 | #define ADM0_PBUS_RESET 12 | ||
| 30 | #define ADM0_RESET 13 | ||
| 31 | #define QDSS_CLKS_SW_RESET 14 | ||
| 32 | #define QDSS_POR_RESET 15 | ||
| 33 | #define QDSS_TSCTR_RESET 16 | ||
| 34 | #define QDSS_HRESET_RESET 17 | ||
| 35 | #define QDSS_AXI_RESET 18 | ||
| 36 | #define QDSS_DBG_RESET 19 | ||
| 37 | #define SFAB_PCIE_M_RESET 20 | ||
| 38 | #define SFAB_PCIE_S_RESET 21 | ||
| 39 | #define PCIE_EXT_RESET 22 | ||
| 40 | #define PCIE_PHY_RESET 23 | ||
| 41 | #define PCIE_PCI_RESET 24 | ||
| 42 | #define PCIE_POR_RESET 25 | ||
| 43 | #define PCIE_HCLK_RESET 26 | ||
| 44 | #define PCIE_ACLK_RESET 27 | ||
| 45 | #define SFAB_LPASS_RESET 28 | ||
| 46 | #define SFAB_AFAB_M_RESET 29 | ||
| 47 | #define AFAB_SFAB_M0_RESET 30 | ||
| 48 | #define AFAB_SFAB_M1_RESET 31 | ||
| 49 | #define SFAB_SATA_S_RESET 32 | ||
| 50 | #define SFAB_DFAB_M_RESET 33 | ||
| 51 | #define DFAB_SFAB_M_RESET 34 | ||
| 52 | #define DFAB_SWAY0_RESET 35 | ||
| 53 | #define DFAB_SWAY1_RESET 36 | ||
| 54 | #define DFAB_ARB0_RESET 37 | ||
| 55 | #define DFAB_ARB1_RESET 38 | ||
| 56 | #define PPSS_PROC_RESET 39 | ||
| 57 | #define PPSS_RESET 40 | ||
| 58 | #define DMA_BAM_RESET 41 | ||
| 59 | #define SPS_TIC_H_RESET 42 | ||
| 60 | #define SFAB_CFPB_M_RESET 43 | ||
| 61 | #define SFAB_CFPB_S_RESET 44 | ||
| 62 | #define TSIF_H_RESET 45 | ||
| 63 | #define CE1_H_RESET 46 | ||
| 64 | #define CE1_CORE_RESET 47 | ||
| 65 | #define CE1_SLEEP_RESET 48 | ||
| 66 | #define CE2_H_RESET 49 | ||
| 67 | #define CE2_CORE_RESET 50 | ||
| 68 | #define SFAB_SFPB_M_RESET 51 | ||
| 69 | #define SFAB_SFPB_S_RESET 52 | ||
| 70 | #define RPM_PROC_RESET 53 | ||
| 71 | #define PMIC_SSBI2_RESET 54 | ||
| 72 | #define SDC1_RESET 55 | ||
| 73 | #define SDC2_RESET 56 | ||
| 74 | #define SDC3_RESET 57 | ||
| 75 | #define SDC4_RESET 58 | ||
| 76 | #define USB_HS1_RESET 59 | ||
| 77 | #define USB_HSIC_RESET 60 | ||
| 78 | #define USB_FS1_XCVR_RESET 61 | ||
| 79 | #define USB_FS1_RESET 62 | ||
| 80 | #define GSBI1_RESET 63 | ||
| 81 | #define GSBI2_RESET 64 | ||
| 82 | #define GSBI3_RESET 65 | ||
| 83 | #define GSBI4_RESET 66 | ||
| 84 | #define GSBI5_RESET 67 | ||
| 85 | #define GSBI6_RESET 68 | ||
| 86 | #define GSBI7_RESET 69 | ||
| 87 | #define SPDM_RESET 70 | ||
| 88 | #define SEC_CTRL_RESET 71 | ||
| 89 | #define TLMM_H_RESET 72 | ||
| 90 | #define SFAB_SATA_M_RESET 73 | ||
| 91 | #define SATA_RESET 74 | ||
| 92 | #define TSSC_RESET 75 | ||
| 93 | #define PDM_RESET 76 | ||
| 94 | #define MPM_H_RESET 77 | ||
| 95 | #define MPM_RESET 78 | ||
| 96 | #define SFAB_SMPSS_S_RESET 79 | ||
| 97 | #define PRNG_RESET 80 | ||
| 98 | #define SFAB_CE3_M_RESET 81 | ||
| 99 | #define SFAB_CE3_S_RESET 82 | ||
| 100 | #define CE3_SLEEP_RESET 83 | ||
| 101 | #define PCIE_1_M_RESET 84 | ||
| 102 | #define PCIE_1_S_RESET 85 | ||
| 103 | #define PCIE_1_EXT_RESET 86 | ||
| 104 | #define PCIE_1_PHY_RESET 87 | ||
| 105 | #define PCIE_1_PCI_RESET 88 | ||
| 106 | #define PCIE_1_POR_RESET 89 | ||
| 107 | #define PCIE_1_HCLK_RESET 90 | ||
| 108 | #define PCIE_1_ACLK_RESET 91 | ||
| 109 | #define PCIE_2_M_RESET 92 | ||
| 110 | #define PCIE_2_S_RESET 93 | ||
| 111 | #define PCIE_2_EXT_RESET 94 | ||
| 112 | #define PCIE_2_PHY_RESET 95 | ||
| 113 | #define PCIE_2_PCI_RESET 96 | ||
| 114 | #define PCIE_2_POR_RESET 97 | ||
| 115 | #define PCIE_2_HCLK_RESET 98 | ||
| 116 | #define PCIE_2_ACLK_RESET 99 | ||
| 117 | #define SFAB_USB30_S_RESET 100 | ||
| 118 | #define SFAB_USB30_M_RESET 101 | ||
| 119 | #define USB30_0_PORT2_HS_PHY_RESET 102 | ||
| 120 | #define USB30_0_MASTER_RESET 103 | ||
| 121 | #define USB30_0_SLEEP_RESET 104 | ||
| 122 | #define USB30_0_UTMI_PHY_RESET 105 | ||
| 123 | #define USB30_0_POWERON_RESET 106 | ||
| 124 | #define USB30_0_PHY_RESET 107 | ||
| 125 | #define USB30_1_MASTER_RESET 108 | ||
| 126 | #define USB30_1_SLEEP_RESET 109 | ||
| 127 | #define USB30_1_UTMI_PHY_RESET 110 | ||
| 128 | #define USB30_1_POWERON_RESET 111 | ||
| 129 | #define USB30_1_PHY_RESET 112 | ||
| 130 | #define NSSFB0_RESET 113 | ||
| 131 | #define NSSFB1_RESET 114 | ||
| 132 | #endif | ||
diff --git a/include/dt-bindings/reset/qcom,gcc-msm8960.h b/include/dt-bindings/reset/qcom,gcc-msm8960.h index 07edd0e65eed..47c8686955da 100644 --- a/include/dt-bindings/reset/qcom,gcc-msm8960.h +++ b/include/dt-bindings/reset/qcom,gcc-msm8960.h | |||
| @@ -114,5 +114,21 @@ | |||
| 114 | #define SFAB_SMPSS_S_RESET 97 | 114 | #define SFAB_SMPSS_S_RESET 97 |
| 115 | #define PRNG_RESET 98 | 115 | #define PRNG_RESET 98 |
| 116 | #define RIVA_RESET 99 | 116 | #define RIVA_RESET 99 |
| 117 | #define USB_HS3_RESET 100 | ||
| 118 | #define USB_HS4_RESET 101 | ||
| 119 | #define CE3_RESET 102 | ||
| 120 | #define PCIE_EXT_PCI_RESET 103 | ||
| 121 | #define PCIE_PHY_RESET 104 | ||
| 122 | #define PCIE_PCI_RESET 105 | ||
| 123 | #define PCIE_POR_RESET 106 | ||
| 124 | #define PCIE_HCLK_RESET 107 | ||
| 125 | #define PCIE_ACLK_RESET 108 | ||
| 126 | #define CE3_H_RESET 109 | ||
| 127 | #define SFAB_CE3_M_RESET 110 | ||
| 128 | #define SFAB_CE3_S_RESET 111 | ||
| 129 | #define SATA_RESET 112 | ||
| 130 | #define CE3_SLEEP_RESET 113 | ||
| 131 | #define GSS_SLP_RESET 114 | ||
| 132 | #define GSS_RESET 115 | ||
| 117 | 133 | ||
| 118 | #endif | 134 | #endif |
diff --git a/include/dt-bindings/reset/qcom,mmcc-apq8084.h b/include/dt-bindings/reset/qcom,mmcc-apq8084.h new file mode 100644 index 000000000000..c1671396531d --- /dev/null +++ b/include/dt-bindings/reset/qcom,mmcc-apq8084.h | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2014, The Linux Foundation. All rights reserved. | ||
| 3 | * | ||
| 4 | * This software is licensed under the terms of the GNU General Public | ||
| 5 | * License version 2, as published by the Free Software Foundation, and | ||
| 6 | * may be copied, distributed, and modified under those terms. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _DT_BINDINGS_RESET_APQ_MMCC_8084_H | ||
| 15 | #define _DT_BINDINGS_RESET_APQ_MMCC_8084_H | ||
| 16 | |||
| 17 | #define MMSS_SPDM_RESET 0 | ||
| 18 | #define MMSS_SPDM_RM_RESET 1 | ||
| 19 | #define VENUS0_RESET 2 | ||
| 20 | #define VPU_RESET 3 | ||
| 21 | #define MDSS_RESET 4 | ||
| 22 | #define AVSYNC_RESET 5 | ||
| 23 | #define CAMSS_PHY0_RESET 6 | ||
| 24 | #define CAMSS_PHY1_RESET 7 | ||
| 25 | #define CAMSS_PHY2_RESET 8 | ||
| 26 | #define CAMSS_CSI0_RESET 9 | ||
| 27 | #define CAMSS_CSI0PHY_RESET 10 | ||
| 28 | #define CAMSS_CSI0RDI_RESET 11 | ||
| 29 | #define CAMSS_CSI0PIX_RESET 12 | ||
| 30 | #define CAMSS_CSI1_RESET 13 | ||
| 31 | #define CAMSS_CSI1PHY_RESET 14 | ||
| 32 | #define CAMSS_CSI1RDI_RESET 15 | ||
| 33 | #define CAMSS_CSI1PIX_RESET 16 | ||
| 34 | #define CAMSS_CSI2_RESET 17 | ||
| 35 | #define CAMSS_CSI2PHY_RESET 18 | ||
| 36 | #define CAMSS_CSI2RDI_RESET 19 | ||
| 37 | #define CAMSS_CSI2PIX_RESET 20 | ||
| 38 | #define CAMSS_CSI3_RESET 21 | ||
| 39 | #define CAMSS_CSI3PHY_RESET 22 | ||
| 40 | #define CAMSS_CSI3RDI_RESET 23 | ||
| 41 | #define CAMSS_CSI3PIX_RESET 24 | ||
| 42 | #define CAMSS_ISPIF_RESET 25 | ||
| 43 | #define CAMSS_CCI_RESET 26 | ||
| 44 | #define CAMSS_MCLK0_RESET 27 | ||
| 45 | #define CAMSS_MCLK1_RESET 28 | ||
| 46 | #define CAMSS_MCLK2_RESET 29 | ||
| 47 | #define CAMSS_MCLK3_RESET 30 | ||
| 48 | #define CAMSS_GP0_RESET 31 | ||
| 49 | #define CAMSS_GP1_RESET 32 | ||
| 50 | #define CAMSS_TOP_RESET 33 | ||
| 51 | #define CAMSS_AHB_RESET 34 | ||
| 52 | #define CAMSS_MICRO_RESET 35 | ||
| 53 | #define CAMSS_JPEG_RESET 36 | ||
| 54 | #define CAMSS_VFE_RESET 37 | ||
| 55 | #define CAMSS_CSI_VFE0_RESET 38 | ||
| 56 | #define CAMSS_CSI_VFE1_RESET 39 | ||
| 57 | #define OXILI_RESET 40 | ||
| 58 | #define OXILICX_RESET 41 | ||
| 59 | #define OCMEMCX_RESET 42 | ||
| 60 | #define MMSS_RBCRP_RESET 43 | ||
| 61 | #define MMSSNOCAHB_RESET 44 | ||
| 62 | #define MMSSNOCAXI_RESET 45 | ||
| 63 | |||
| 64 | #endif | ||
diff --git a/include/dt-bindings/reset/qcom,mmcc-msm8960.h b/include/dt-bindings/reset/qcom,mmcc-msm8960.h index ba36ec680118..11741113a841 100644 --- a/include/dt-bindings/reset/qcom,mmcc-msm8960.h +++ b/include/dt-bindings/reset/qcom,mmcc-msm8960.h | |||
| @@ -89,5 +89,13 @@ | |||
| 89 | #define CSI2_RESET 72 | 89 | #define CSI2_RESET 72 |
| 90 | #define CSI_RDI1_RESET 73 | 90 | #define CSI_RDI1_RESET 73 |
| 91 | #define CSI_RDI2_RESET 74 | 91 | #define CSI_RDI2_RESET 74 |
| 92 | #define GFX3D_AXI_RESET 75 | ||
| 93 | #define VCAP_AXI_RESET 76 | ||
| 94 | #define SMMU_VCAP_AHB_RESET 77 | ||
| 95 | #define VCAP_AHB_RESET 78 | ||
| 96 | #define CSI_RDI_RESET 79 | ||
| 97 | #define CSI_PIX_RESET 80 | ||
| 98 | #define VCAP_NPL_RESET 81 | ||
| 99 | #define VCAP_RESET 82 | ||
| 92 | 100 | ||
| 93 | #endif | 101 | #endif |
diff --git a/include/keys/big_key-type.h b/include/keys/big_key-type.h index d69bc8af3292..e0970a578188 100644 --- a/include/keys/big_key-type.h +++ b/include/keys/big_key-type.h | |||
| @@ -16,7 +16,8 @@ | |||
| 16 | 16 | ||
| 17 | extern struct key_type key_type_big_key; | 17 | extern struct key_type key_type_big_key; |
| 18 | 18 | ||
| 19 | extern int big_key_instantiate(struct key *key, struct key_preparsed_payload *prep); | 19 | extern int big_key_preparse(struct key_preparsed_payload *prep); |
| 20 | extern void big_key_free_preparse(struct key_preparsed_payload *prep); | ||
| 20 | extern void big_key_revoke(struct key *key); | 21 | extern void big_key_revoke(struct key *key); |
| 21 | extern void big_key_destroy(struct key *key); | 22 | extern void big_key_destroy(struct key *key); |
| 22 | extern void big_key_describe(const struct key *big_key, struct seq_file *m); | 23 | extern void big_key_describe(const struct key *big_key, struct seq_file *m); |
diff --git a/include/keys/system_keyring.h b/include/keys/system_keyring.h index 8dabc399bd1d..72665eb80692 100644 --- a/include/keys/system_keyring.h +++ b/include/keys/system_keyring.h | |||
| @@ -17,7 +17,15 @@ | |||
| 17 | #include <linux/key.h> | 17 | #include <linux/key.h> |
| 18 | 18 | ||
| 19 | extern struct key *system_trusted_keyring; | 19 | extern struct key *system_trusted_keyring; |
| 20 | 20 | static inline struct key *get_system_trusted_keyring(void) | |
| 21 | { | ||
| 22 | return system_trusted_keyring; | ||
| 23 | } | ||
| 24 | #else | ||
| 25 | static inline struct key *get_system_trusted_keyring(void) | ||
| 26 | { | ||
| 27 | return NULL; | ||
| 28 | } | ||
| 21 | #endif | 29 | #endif |
| 22 | 30 | ||
| 23 | #endif /* _KEYS_SYSTEM_KEYRING_H */ | 31 | #endif /* _KEYS_SYSTEM_KEYRING_H */ |
diff --git a/include/keys/user-type.h b/include/keys/user-type.h index 5e452c84f1e6..3ab1873a4bfa 100644 --- a/include/keys/user-type.h +++ b/include/keys/user-type.h | |||
| @@ -37,7 +37,8 @@ extern struct key_type key_type_logon; | |||
| 37 | 37 | ||
| 38 | struct key_preparsed_payload; | 38 | struct key_preparsed_payload; |
| 39 | 39 | ||
| 40 | extern int user_instantiate(struct key *key, struct key_preparsed_payload *prep); | 40 | extern int user_preparse(struct key_preparsed_payload *prep); |
| 41 | extern void user_free_preparse(struct key_preparsed_payload *prep); | ||
| 41 | extern int user_update(struct key *key, struct key_preparsed_payload *prep); | 42 | extern int user_update(struct key *key, struct key_preparsed_payload *prep); |
| 42 | extern int user_match(const struct key *key, const void *criterion); | 43 | extern int user_match(const struct key *key, const void *criterion); |
| 43 | extern void user_revoke(struct key *key); | 44 | extern void user_revoke(struct key *key); |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 358c01b971db..5320153c311b 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -29,17 +29,17 @@ | |||
| 29 | #include <linux/ioport.h> /* for struct resource */ | 29 | #include <linux/ioport.h> /* for struct resource */ |
| 30 | #include <linux/device.h> | 30 | #include <linux/device.h> |
| 31 | 31 | ||
| 32 | #ifdef CONFIG_ACPI | ||
| 33 | |||
| 34 | #ifndef _LINUX | 32 | #ifndef _LINUX |
| 35 | #define _LINUX | 33 | #define _LINUX |
| 36 | #endif | 34 | #endif |
| 35 | #include <acpi/acpi.h> | ||
| 36 | |||
| 37 | #ifdef CONFIG_ACPI | ||
| 37 | 38 | ||
| 38 | #include <linux/list.h> | 39 | #include <linux/list.h> |
| 39 | #include <linux/mod_devicetable.h> | 40 | #include <linux/mod_devicetable.h> |
| 40 | #include <linux/dynamic_debug.h> | 41 | #include <linux/dynamic_debug.h> |
| 41 | 42 | ||
| 42 | #include <acpi/acpi.h> | ||
| 43 | #include <acpi/acpi_bus.h> | 43 | #include <acpi/acpi_bus.h> |
| 44 | #include <acpi/acpi_drivers.h> | 44 | #include <acpi/acpi_drivers.h> |
| 45 | #include <acpi/acpi_numa.h> | 45 | #include <acpi/acpi_numa.h> |
diff --git a/include/linux/aer.h b/include/linux/aer.h index 4dbaa7081530..c826d1c28f9c 100644 --- a/include/linux/aer.h +++ b/include/linux/aer.h | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | #define AER_FATAL 1 | 11 | #define AER_FATAL 1 |
| 12 | #define AER_CORRECTABLE 2 | 12 | #define AER_CORRECTABLE 2 |
| 13 | 13 | ||
| 14 | struct pci_dev; | ||
| 15 | |||
| 14 | struct aer_header_log_regs { | 16 | struct aer_header_log_regs { |
| 15 | unsigned int dw0; | 17 | unsigned int dw0; |
| 16 | unsigned int dw1; | 18 | unsigned int dw1; |
diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h index 6dfd51a04d77..09a947e8bc87 100644 --- a/include/linux/ahci_platform.h +++ b/include/linux/ahci_platform.h | |||
| @@ -43,10 +43,7 @@ struct ahci_host_priv *ahci_platform_get_resources( | |||
| 43 | struct platform_device *pdev); | 43 | struct platform_device *pdev); |
| 44 | int ahci_platform_init_host(struct platform_device *pdev, | 44 | int ahci_platform_init_host(struct platform_device *pdev, |
| 45 | struct ahci_host_priv *hpriv, | 45 | struct ahci_host_priv *hpriv, |
| 46 | const struct ata_port_info *pi_template, | 46 | const struct ata_port_info *pi_template); |
| 47 | unsigned long host_flags, | ||
| 48 | unsigned int force_port_map, | ||
| 49 | unsigned int mask_port_map); | ||
| 50 | 47 | ||
| 51 | int ahci_platform_suspend_host(struct device *dev); | 48 | int ahci_platform_suspend_host(struct device *dev); |
| 52 | int ahci_platform_resume_host(struct device *dev); | 49 | int ahci_platform_resume_host(struct device *dev); |
diff --git a/include/linux/amd-iommu.h b/include/linux/amd-iommu.h index 15f6b9edd0b1..2b08e79f5100 100644 --- a/include/linux/amd-iommu.h +++ b/include/linux/amd-iommu.h | |||
| @@ -119,6 +119,13 @@ typedef int (*amd_iommu_invalid_ppr_cb)(struct pci_dev *pdev, | |||
| 119 | extern int amd_iommu_set_invalid_ppr_cb(struct pci_dev *pdev, | 119 | extern int amd_iommu_set_invalid_ppr_cb(struct pci_dev *pdev, |
| 120 | amd_iommu_invalid_ppr_cb cb); | 120 | amd_iommu_invalid_ppr_cb cb); |
| 121 | 121 | ||
| 122 | #define PPR_FAULT_EXEC (1 << 1) | ||
| 123 | #define PPR_FAULT_READ (1 << 2) | ||
| 124 | #define PPR_FAULT_WRITE (1 << 5) | ||
| 125 | #define PPR_FAULT_USER (1 << 6) | ||
| 126 | #define PPR_FAULT_RSVD (1 << 7) | ||
| 127 | #define PPR_FAULT_GN (1 << 8) | ||
| 128 | |||
| 122 | /** | 129 | /** |
| 123 | * amd_iommu_device_info() - Get information about IOMMUv2 support of a | 130 | * amd_iommu_device_info() - Get information about IOMMUv2 support of a |
| 124 | * PCI device | 131 | * PCI device |
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index 7216b0daf544..df0356220730 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h | |||
| @@ -22,10 +22,6 @@ | |||
| 22 | #ifdef __KERNEL__ | 22 | #ifdef __KERNEL__ |
| 23 | #include <linux/irqreturn.h> | 23 | #include <linux/irqreturn.h> |
| 24 | 24 | ||
| 25 | #ifndef bool | ||
| 26 | #define bool int | ||
| 27 | #endif | ||
| 28 | |||
| 29 | /* | 25 | /* |
| 30 | * RECON_THRESHOLD is the maximum number of RECON messages to receive | 26 | * RECON_THRESHOLD is the maximum number of RECON messages to receive |
| 31 | * within one minute before printing a "cabling problem" warning. The | 27 | * within one minute before printing a "cabling problem" warning. The |
| @@ -285,9 +281,9 @@ struct arcnet_local { | |||
| 285 | unsigned long first_recon; /* time of "first" RECON message to count */ | 281 | unsigned long first_recon; /* time of "first" RECON message to count */ |
| 286 | unsigned long last_recon; /* time of most recent RECON */ | 282 | unsigned long last_recon; /* time of most recent RECON */ |
| 287 | int num_recons; /* number of RECONs between first and last. */ | 283 | int num_recons; /* number of RECONs between first and last. */ |
| 288 | bool network_down; /* do we think the network is down? */ | 284 | int network_down; /* do we think the network is down? */ |
| 289 | 285 | ||
| 290 | bool excnak_pending; /* We just got an excesive nak interrupt */ | 286 | int excnak_pending; /* We just got an excesive nak interrupt */ |
| 291 | 287 | ||
| 292 | struct { | 288 | struct { |
| 293 | uint16_t sequence; /* sequence number (incs with each packet) */ | 289 | uint16_t sequence; /* sequence number (incs with each packet) */ |
| @@ -305,7 +301,7 @@ struct arcnet_local { | |||
| 305 | void (*command) (struct net_device * dev, int cmd); | 301 | void (*command) (struct net_device * dev, int cmd); |
| 306 | int (*status) (struct net_device * dev); | 302 | int (*status) (struct net_device * dev); |
| 307 | void (*intmask) (struct net_device * dev, int mask); | 303 | void (*intmask) (struct net_device * dev, int mask); |
| 308 | bool (*reset) (struct net_device * dev, bool really_reset); | 304 | int (*reset) (struct net_device * dev, int really_reset); |
| 309 | void (*open) (struct net_device * dev); | 305 | void (*open) (struct net_device * dev); |
| 310 | void (*close) (struct net_device * dev); | 306 | void (*close) (struct net_device * dev); |
| 311 | 307 | ||
diff --git a/include/linux/atmel-ssc.h b/include/linux/atmel-ssc.h index 571a12ebb018..7c0f6549898b 100644 --- a/include/linux/atmel-ssc.h +++ b/include/linux/atmel-ssc.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | struct atmel_ssc_platform_data { | 8 | struct atmel_ssc_platform_data { |
| 9 | int use_dma; | 9 | int use_dma; |
| 10 | int has_fslen_ext; | ||
| 10 | }; | 11 | }; |
| 11 | 12 | ||
| 12 | struct ssc_device { | 13 | struct ssc_device { |
| @@ -71,6 +72,12 @@ void ssc_free(struct ssc_device *ssc); | |||
| 71 | #define SSC_RFMR_DATNB_OFFSET 8 | 72 | #define SSC_RFMR_DATNB_OFFSET 8 |
| 72 | #define SSC_RFMR_FSEDGE_SIZE 1 | 73 | #define SSC_RFMR_FSEDGE_SIZE 1 |
| 73 | #define SSC_RFMR_FSEDGE_OFFSET 24 | 74 | #define SSC_RFMR_FSEDGE_OFFSET 24 |
| 75 | /* | ||
| 76 | * The FSLEN_EXT exist on at91sam9rl, at91sam9g10, | ||
| 77 | * at91sam9g20, and at91sam9g45 and newer SoCs | ||
| 78 | */ | ||
| 79 | #define SSC_RFMR_FSLEN_EXT_SIZE 4 | ||
| 80 | #define SSC_RFMR_FSLEN_EXT_OFFSET 28 | ||
| 74 | #define SSC_RFMR_FSLEN_SIZE 4 | 81 | #define SSC_RFMR_FSLEN_SIZE 4 |
| 75 | #define SSC_RFMR_FSLEN_OFFSET 16 | 82 | #define SSC_RFMR_FSLEN_OFFSET 16 |
| 76 | #define SSC_RFMR_FSOS_SIZE 4 | 83 | #define SSC_RFMR_FSOS_SIZE 4 |
| @@ -109,6 +116,12 @@ void ssc_free(struct ssc_device *ssc); | |||
| 109 | #define SSC_TFMR_FSDEN_OFFSET 23 | 116 | #define SSC_TFMR_FSDEN_OFFSET 23 |
| 110 | #define SSC_TFMR_FSEDGE_SIZE 1 | 117 | #define SSC_TFMR_FSEDGE_SIZE 1 |
| 111 | #define SSC_TFMR_FSEDGE_OFFSET 24 | 118 | #define SSC_TFMR_FSEDGE_OFFSET 24 |
| 119 | /* | ||
| 120 | * The FSLEN_EXT exist on at91sam9rl, at91sam9g10, | ||
| 121 | * at91sam9g20, and at91sam9g45 and newer SoCs | ||
| 122 | */ | ||
| 123 | #define SSC_TFMR_FSLEN_EXT_SIZE 4 | ||
| 124 | #define SSC_TFMR_FSLEN_EXT_OFFSET 28 | ||
| 112 | #define SSC_TFMR_FSLEN_SIZE 4 | 125 | #define SSC_TFMR_FSLEN_SIZE 4 |
| 113 | #define SSC_TFMR_FSLEN_OFFSET 16 | 126 | #define SSC_TFMR_FSLEN_OFFSET 16 |
| 114 | #define SSC_TFMR_FSOS_SIZE 3 | 127 | #define SSC_TFMR_FSOS_SIZE 3 |
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index 0b3bb16c705a..0272e49135d0 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/bcma/bcma_driver_chipcommon.h> | 7 | #include <linux/bcma/bcma_driver_chipcommon.h> |
| 8 | #include <linux/bcma/bcma_driver_pci.h> | 8 | #include <linux/bcma/bcma_driver_pci.h> |
| 9 | #include <linux/bcma/bcma_driver_pcie2.h> | ||
| 9 | #include <linux/bcma/bcma_driver_mips.h> | 10 | #include <linux/bcma/bcma_driver_mips.h> |
| 10 | #include <linux/bcma/bcma_driver_gmac_cmn.h> | 11 | #include <linux/bcma/bcma_driver_gmac_cmn.h> |
| 11 | #include <linux/ssb/ssb.h> /* SPROM sharing */ | 12 | #include <linux/ssb/ssb.h> /* SPROM sharing */ |
| @@ -72,17 +73,17 @@ struct bcma_host_ops { | |||
| 72 | /* Core-ID values. */ | 73 | /* Core-ID values. */ |
| 73 | #define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */ | 74 | #define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */ |
| 74 | #define BCMA_CORE_4706_CHIPCOMMON 0x500 | 75 | #define BCMA_CORE_4706_CHIPCOMMON 0x500 |
| 75 | #define BCMA_CORE_PCIEG2 0x501 | 76 | #define BCMA_CORE_NS_PCIEG2 0x501 |
| 76 | #define BCMA_CORE_DMA 0x502 | 77 | #define BCMA_CORE_NS_DMA 0x502 |
| 77 | #define BCMA_CORE_SDIO3 0x503 | 78 | #define BCMA_CORE_NS_SDIO3 0x503 |
| 78 | #define BCMA_CORE_USB20 0x504 | 79 | #define BCMA_CORE_NS_USB20 0x504 |
| 79 | #define BCMA_CORE_USB30 0x505 | 80 | #define BCMA_CORE_NS_USB30 0x505 |
| 80 | #define BCMA_CORE_A9JTAG 0x506 | 81 | #define BCMA_CORE_NS_A9JTAG 0x506 |
| 81 | #define BCMA_CORE_DDR23 0x507 | 82 | #define BCMA_CORE_NS_DDR23 0x507 |
| 82 | #define BCMA_CORE_ROM 0x508 | 83 | #define BCMA_CORE_NS_ROM 0x508 |
| 83 | #define BCMA_CORE_NAND 0x509 | 84 | #define BCMA_CORE_NS_NAND 0x509 |
| 84 | #define BCMA_CORE_QSPI 0x50A | 85 | #define BCMA_CORE_NS_QSPI 0x50A |
| 85 | #define BCMA_CORE_CHIPCOMMON_B 0x50B | 86 | #define BCMA_CORE_NS_CHIPCOMMON_B 0x50B |
| 86 | #define BCMA_CORE_4706_SOC_RAM 0x50E | 87 | #define BCMA_CORE_4706_SOC_RAM 0x50E |
| 87 | #define BCMA_CORE_ARMCA9 0x510 | 88 | #define BCMA_CORE_ARMCA9 0x510 |
| 88 | #define BCMA_CORE_4706_MAC_GBIT 0x52D | 89 | #define BCMA_CORE_4706_MAC_GBIT 0x52D |
| @@ -157,6 +158,9 @@ struct bcma_host_ops { | |||
| 157 | /* Chip IDs of PCIe devices */ | 158 | /* Chip IDs of PCIe devices */ |
| 158 | #define BCMA_CHIP_ID_BCM4313 0x4313 | 159 | #define BCMA_CHIP_ID_BCM4313 0x4313 |
| 159 | #define BCMA_CHIP_ID_BCM43142 43142 | 160 | #define BCMA_CHIP_ID_BCM43142 43142 |
| 161 | #define BCMA_CHIP_ID_BCM43131 43131 | ||
| 162 | #define BCMA_CHIP_ID_BCM43217 43217 | ||
| 163 | #define BCMA_CHIP_ID_BCM43222 43222 | ||
| 160 | #define BCMA_CHIP_ID_BCM43224 43224 | 164 | #define BCMA_CHIP_ID_BCM43224 43224 |
| 161 | #define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8 | 165 | #define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8 |
| 162 | #define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa | 166 | #define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa |
| @@ -333,6 +337,7 @@ struct bcma_bus { | |||
| 333 | 337 | ||
| 334 | struct bcma_drv_cc drv_cc; | 338 | struct bcma_drv_cc drv_cc; |
| 335 | struct bcma_drv_pci drv_pci[2]; | 339 | struct bcma_drv_pci drv_pci[2]; |
| 340 | struct bcma_drv_pcie2 drv_pcie2; | ||
| 336 | struct bcma_drv_mips drv_mips; | 341 | struct bcma_drv_mips drv_mips; |
| 337 | struct bcma_drv_gmac_cmn drv_gmac_cmn; | 342 | struct bcma_drv_gmac_cmn drv_gmac_cmn; |
| 338 | 343 | ||
diff --git a/include/linux/bcma/bcma_driver_pcie2.h b/include/linux/bcma/bcma_driver_pcie2.h new file mode 100644 index 000000000000..5988b05781c3 --- /dev/null +++ b/include/linux/bcma/bcma_driver_pcie2.h | |||
| @@ -0,0 +1,158 @@ | |||
| 1 | #ifndef LINUX_BCMA_DRIVER_PCIE2_H_ | ||
| 2 | #define LINUX_BCMA_DRIVER_PCIE2_H_ | ||
| 3 | |||
| 4 | #define BCMA_CORE_PCIE2_CLK_CONTROL 0x0000 | ||
| 5 | #define PCIE2_CLKC_RST_OE 0x0001 /* When set, drives PCI_RESET out to pin */ | ||
| 6 | #define PCIE2_CLKC_RST 0x0002 /* Value driven out to pin */ | ||
| 7 | #define PCIE2_CLKC_SPERST 0x0004 /* SurvivePeRst */ | ||
| 8 | #define PCIE2_CLKC_DISABLE_L1CLK_GATING 0x0010 | ||
| 9 | #define PCIE2_CLKC_DLYPERST 0x0100 /* Delay PeRst to CoE Core */ | ||
| 10 | #define PCIE2_CLKC_DISSPROMLD 0x0200 /* DisableSpromLoadOnPerst */ | ||
| 11 | #define PCIE2_CLKC_WAKE_MODE_L2 0x1000 /* Wake on L2 */ | ||
| 12 | #define BCMA_CORE_PCIE2_RC_PM_CONTROL 0x0004 | ||
| 13 | #define BCMA_CORE_PCIE2_RC_PM_STATUS 0x0008 | ||
| 14 | #define BCMA_CORE_PCIE2_EP_PM_CONTROL 0x000C | ||
| 15 | #define BCMA_CORE_PCIE2_EP_PM_STATUS 0x0010 | ||
| 16 | #define BCMA_CORE_PCIE2_EP_LTR_CONTROL 0x0014 | ||
| 17 | #define BCMA_CORE_PCIE2_EP_LTR_STATUS 0x0018 | ||
| 18 | #define BCMA_CORE_PCIE2_EP_OBFF_STATUS 0x001C | ||
| 19 | #define BCMA_CORE_PCIE2_PCIE_ERR_STATUS 0x0020 | ||
| 20 | #define BCMA_CORE_PCIE2_RC_AXI_CONFIG 0x0100 | ||
| 21 | #define BCMA_CORE_PCIE2_EP_AXI_CONFIG 0x0104 | ||
| 22 | #define BCMA_CORE_PCIE2_RXDEBUG_STATUS0 0x0108 | ||
| 23 | #define BCMA_CORE_PCIE2_RXDEBUG_CONTROL0 0x010C | ||
| 24 | #define BCMA_CORE_PCIE2_CONFIGINDADDR 0x0120 | ||
| 25 | #define BCMA_CORE_PCIE2_CONFIGINDDATA 0x0124 | ||
| 26 | #define BCMA_CORE_PCIE2_MDIOCONTROL 0x0128 | ||
| 27 | #define BCMA_CORE_PCIE2_MDIOWRDATA 0x012C | ||
| 28 | #define BCMA_CORE_PCIE2_MDIORDDATA 0x0130 | ||
| 29 | #define BCMA_CORE_PCIE2_DATAINTF 0x0180 | ||
| 30 | #define BCMA_CORE_PCIE2_D2H_INTRLAZY_0 0x0188 | ||
| 31 | #define BCMA_CORE_PCIE2_H2D_INTRLAZY_0 0x018c | ||
| 32 | #define BCMA_CORE_PCIE2_H2D_INTSTAT_0 0x0190 | ||
| 33 | #define BCMA_CORE_PCIE2_H2D_INTMASK_0 0x0194 | ||
| 34 | #define BCMA_CORE_PCIE2_D2H_INTSTAT_0 0x0198 | ||
| 35 | #define BCMA_CORE_PCIE2_D2H_INTMASK_0 0x019c | ||
| 36 | #define BCMA_CORE_PCIE2_LTR_STATE 0x01A0 /* Latency Tolerance Reporting */ | ||
| 37 | #define PCIE2_LTR_ACTIVE 2 | ||
| 38 | #define PCIE2_LTR_ACTIVE_IDLE 1 | ||
| 39 | #define PCIE2_LTR_SLEEP 0 | ||
| 40 | #define PCIE2_LTR_FINAL_MASK 0x300 | ||
| 41 | #define PCIE2_LTR_FINAL_SHIFT 8 | ||
| 42 | #define BCMA_CORE_PCIE2_PWR_INT_STATUS 0x01A4 | ||
| 43 | #define BCMA_CORE_PCIE2_PWR_INT_MASK 0x01A8 | ||
| 44 | #define BCMA_CORE_PCIE2_CFG_ADDR 0x01F8 | ||
| 45 | #define BCMA_CORE_PCIE2_CFG_DATA 0x01FC | ||
| 46 | #define BCMA_CORE_PCIE2_SYS_EQ_PAGE 0x0200 | ||
| 47 | #define BCMA_CORE_PCIE2_SYS_MSI_PAGE 0x0204 | ||
| 48 | #define BCMA_CORE_PCIE2_SYS_MSI_INTREN 0x0208 | ||
| 49 | #define BCMA_CORE_PCIE2_SYS_MSI_CTRL0 0x0210 | ||
| 50 | #define BCMA_CORE_PCIE2_SYS_MSI_CTRL1 0x0214 | ||
| 51 | #define BCMA_CORE_PCIE2_SYS_MSI_CTRL2 0x0218 | ||
| 52 | #define BCMA_CORE_PCIE2_SYS_MSI_CTRL3 0x021C | ||
| 53 | #define BCMA_CORE_PCIE2_SYS_MSI_CTRL4 0x0220 | ||
| 54 | #define BCMA_CORE_PCIE2_SYS_MSI_CTRL5 0x0224 | ||
| 55 | #define BCMA_CORE_PCIE2_SYS_EQ_HEAD0 0x0250 | ||
| 56 | #define BCMA_CORE_PCIE2_SYS_EQ_TAIL0 0x0254 | ||
| 57 | #define BCMA_CORE_PCIE2_SYS_EQ_HEAD1 0x0258 | ||
| 58 | #define BCMA_CORE_PCIE2_SYS_EQ_TAIL1 0x025C | ||
| 59 | #define BCMA_CORE_PCIE2_SYS_EQ_HEAD2 0x0260 | ||
| 60 | #define BCMA_CORE_PCIE2_SYS_EQ_TAIL2 0x0264 | ||
| 61 | #define BCMA_CORE_PCIE2_SYS_EQ_HEAD3 0x0268 | ||
| 62 | #define BCMA_CORE_PCIE2_SYS_EQ_TAIL3 0x026C | ||
| 63 | #define BCMA_CORE_PCIE2_SYS_EQ_HEAD4 0x0270 | ||
| 64 | #define BCMA_CORE_PCIE2_SYS_EQ_TAIL4 0x0274 | ||
| 65 | #define BCMA_CORE_PCIE2_SYS_EQ_HEAD5 0x0278 | ||
| 66 | #define BCMA_CORE_PCIE2_SYS_EQ_TAIL5 0x027C | ||
| 67 | #define BCMA_CORE_PCIE2_SYS_RC_INTX_EN 0x0330 | ||
| 68 | #define BCMA_CORE_PCIE2_SYS_RC_INTX_CSR 0x0334 | ||
| 69 | #define BCMA_CORE_PCIE2_SYS_MSI_REQ 0x0340 | ||
| 70 | #define BCMA_CORE_PCIE2_SYS_HOST_INTR_EN 0x0344 | ||
| 71 | #define BCMA_CORE_PCIE2_SYS_HOST_INTR_CSR 0x0348 | ||
| 72 | #define BCMA_CORE_PCIE2_SYS_HOST_INTR0 0x0350 | ||
| 73 | #define BCMA_CORE_PCIE2_SYS_HOST_INTR1 0x0354 | ||
| 74 | #define BCMA_CORE_PCIE2_SYS_HOST_INTR2 0x0358 | ||
| 75 | #define BCMA_CORE_PCIE2_SYS_HOST_INTR3 0x035C | ||
| 76 | #define BCMA_CORE_PCIE2_SYS_EP_INT_EN0 0x0360 | ||
| 77 | #define BCMA_CORE_PCIE2_SYS_EP_INT_EN1 0x0364 | ||
| 78 | #define BCMA_CORE_PCIE2_SYS_EP_INT_CSR0 0x0370 | ||
| 79 | #define BCMA_CORE_PCIE2_SYS_EP_INT_CSR1 0x0374 | ||
| 80 | #define BCMA_CORE_PCIE2_SPROM(wordoffset) (0x0800 + ((wordoffset) * 2)) | ||
| 81 | #define BCMA_CORE_PCIE2_FUNC0_IMAP0_0 0x0C00 | ||
| 82 | #define BCMA_CORE_PCIE2_FUNC0_IMAP0_1 0x0C04 | ||
| 83 | #define BCMA_CORE_PCIE2_FUNC0_IMAP0_2 0x0C08 | ||
| 84 | #define BCMA_CORE_PCIE2_FUNC0_IMAP0_3 0x0C0C | ||
| 85 | #define BCMA_CORE_PCIE2_FUNC0_IMAP0_4 0x0C10 | ||
| 86 | #define BCMA_CORE_PCIE2_FUNC0_IMAP0_5 0x0C14 | ||
| 87 | #define BCMA_CORE_PCIE2_FUNC0_IMAP0_6 0x0C18 | ||
| 88 | #define BCMA_CORE_PCIE2_FUNC0_IMAP0_7 0x0C1C | ||
| 89 | #define BCMA_CORE_PCIE2_FUNC1_IMAP0_0 0x0C20 | ||
| 90 | #define BCMA_CORE_PCIE2_FUNC1_IMAP0_1 0x0C24 | ||
| 91 | #define BCMA_CORE_PCIE2_FUNC1_IMAP0_2 0x0C28 | ||
| 92 | #define BCMA_CORE_PCIE2_FUNC1_IMAP0_3 0x0C2C | ||
| 93 | #define BCMA_CORE_PCIE2_FUNC1_IMAP0_4 0x0C30 | ||
| 94 | #define BCMA_CORE_PCIE2_FUNC1_IMAP0_5 0x0C34 | ||
| 95 | #define BCMA_CORE_PCIE2_FUNC1_IMAP0_6 0x0C38 | ||
| 96 | #define BCMA_CORE_PCIE2_FUNC1_IMAP0_7 0x0C3C | ||
| 97 | #define BCMA_CORE_PCIE2_FUNC0_IMAP1 0x0C80 | ||
| 98 | #define BCMA_CORE_PCIE2_FUNC1_IMAP1 0x0C88 | ||
| 99 | #define BCMA_CORE_PCIE2_FUNC0_IMAP2 0x0CC0 | ||
| 100 | #define BCMA_CORE_PCIE2_FUNC1_IMAP2 0x0CC8 | ||
| 101 | #define BCMA_CORE_PCIE2_IARR0_LOWER 0x0D00 | ||
| 102 | #define BCMA_CORE_PCIE2_IARR0_UPPER 0x0D04 | ||
| 103 | #define BCMA_CORE_PCIE2_IARR1_LOWER 0x0D08 | ||
| 104 | #define BCMA_CORE_PCIE2_IARR1_UPPER 0x0D0C | ||
| 105 | #define BCMA_CORE_PCIE2_IARR2_LOWER 0x0D10 | ||
| 106 | #define BCMA_CORE_PCIE2_IARR2_UPPER 0x0D14 | ||
| 107 | #define BCMA_CORE_PCIE2_OARR0 0x0D20 | ||
| 108 | #define BCMA_CORE_PCIE2_OARR1 0x0D28 | ||
| 109 | #define BCMA_CORE_PCIE2_OARR2 0x0D30 | ||
| 110 | #define BCMA_CORE_PCIE2_OMAP0_LOWER 0x0D40 | ||
| 111 | #define BCMA_CORE_PCIE2_OMAP0_UPPER 0x0D44 | ||
| 112 | #define BCMA_CORE_PCIE2_OMAP1_LOWER 0x0D48 | ||
| 113 | #define BCMA_CORE_PCIE2_OMAP1_UPPER 0x0D4C | ||
| 114 | #define BCMA_CORE_PCIE2_OMAP2_LOWER 0x0D50 | ||
| 115 | #define BCMA_CORE_PCIE2_OMAP2_UPPER 0x0D54 | ||
| 116 | #define BCMA_CORE_PCIE2_FUNC1_IARR1_SIZE 0x0D58 | ||
| 117 | #define BCMA_CORE_PCIE2_FUNC1_IARR2_SIZE 0x0D5C | ||
| 118 | #define BCMA_CORE_PCIE2_MEM_CONTROL 0x0F00 | ||
| 119 | #define BCMA_CORE_PCIE2_MEM_ECC_ERRLOG0 0x0F04 | ||
| 120 | #define BCMA_CORE_PCIE2_MEM_ECC_ERRLOG1 0x0F08 | ||
| 121 | #define BCMA_CORE_PCIE2_LINK_STATUS 0x0F0C | ||
| 122 | #define BCMA_CORE_PCIE2_STRAP_STATUS 0x0F10 | ||
| 123 | #define BCMA_CORE_PCIE2_RESET_STATUS 0x0F14 | ||
| 124 | #define BCMA_CORE_PCIE2_RESETEN_IN_LINKDOWN 0x0F18 | ||
| 125 | #define BCMA_CORE_PCIE2_MISC_INTR_EN 0x0F1C | ||
| 126 | #define BCMA_CORE_PCIE2_TX_DEBUG_CFG 0x0F20 | ||
| 127 | #define BCMA_CORE_PCIE2_MISC_CONFIG 0x0F24 | ||
| 128 | #define BCMA_CORE_PCIE2_MISC_STATUS 0x0F28 | ||
| 129 | #define BCMA_CORE_PCIE2_INTR_EN 0x0F30 | ||
| 130 | #define BCMA_CORE_PCIE2_INTR_CLEAR 0x0F34 | ||
| 131 | #define BCMA_CORE_PCIE2_INTR_STATUS 0x0F38 | ||
| 132 | |||
| 133 | /* PCIE gen2 config regs */ | ||
| 134 | #define PCIE2_INTSTATUS 0x090 | ||
| 135 | #define PCIE2_INTMASK 0x094 | ||
| 136 | #define PCIE2_SBMBX 0x098 | ||
| 137 | |||
| 138 | #define PCIE2_PMCR_REFUP 0x1814 /* Trefup time */ | ||
| 139 | |||
| 140 | #define PCIE2_CAP_DEVSTSCTRL2_OFFSET 0xD4 | ||
| 141 | #define PCIE2_CAP_DEVSTSCTRL2_LTRENAB 0x400 | ||
| 142 | #define PCIE2_PVT_REG_PM_CLK_PERIOD 0x184c | ||
| 143 | |||
| 144 | struct bcma_drv_pcie2 { | ||
| 145 | struct bcma_device *core; | ||
| 146 | }; | ||
| 147 | |||
| 148 | #define pcie2_read16(pcie2, offset) bcma_read16((pcie2)->core, offset) | ||
| 149 | #define pcie2_read32(pcie2, offset) bcma_read32((pcie2)->core, offset) | ||
| 150 | #define pcie2_write16(pcie2, offset, val) bcma_write16((pcie2)->core, offset, val) | ||
| 151 | #define pcie2_write32(pcie2, offset, val) bcma_write32((pcie2)->core, offset, val) | ||
| 152 | |||
| 153 | #define pcie2_set32(pcie2, offset, set) bcma_set32((pcie2)->core, offset, set) | ||
| 154 | #define pcie2_mask32(pcie2, offset, mask) bcma_mask32((pcie2)->core, offset, mask) | ||
| 155 | |||
| 156 | void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2); | ||
| 157 | |||
| 158 | #endif /* LINUX_BCMA_DRIVER_PCIE2_H_ */ | ||
diff --git a/include/linux/capability.h b/include/linux/capability.h index 84b13ad67c1c..aa93e5ef594c 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
| @@ -78,8 +78,11 @@ extern const kernel_cap_t __cap_init_eff_set; | |||
| 78 | # error Fix up hand-coded capability macro initializers | 78 | # error Fix up hand-coded capability macro initializers |
| 79 | #else /* HAND-CODED capability initializers */ | 79 | #else /* HAND-CODED capability initializers */ |
| 80 | 80 | ||
| 81 | #define CAP_LAST_U32 ((_KERNEL_CAPABILITY_U32S) - 1) | ||
| 82 | #define CAP_LAST_U32_VALID_MASK (CAP_TO_MASK(CAP_LAST_CAP + 1) -1) | ||
| 83 | |||
| 81 | # define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }}) | 84 | # define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }}) |
| 82 | # define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }}) | 85 | # define CAP_FULL_SET ((kernel_cap_t){{ ~0, CAP_LAST_U32_VALID_MASK }}) |
| 83 | # define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \ | 86 | # define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \ |
| 84 | | CAP_TO_MASK(CAP_LINUX_IMMUTABLE), \ | 87 | | CAP_TO_MASK(CAP_LINUX_IMMUTABLE), \ |
| 85 | CAP_FS_MASK_B1 } }) | 88 | CAP_FS_MASK_B1 } }) |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 8a111dd42d7a..b5223c570eba 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -203,7 +203,15 @@ struct cgroup { | |||
| 203 | struct kernfs_node *kn; /* cgroup kernfs entry */ | 203 | struct kernfs_node *kn; /* cgroup kernfs entry */ |
| 204 | struct kernfs_node *populated_kn; /* kn for "cgroup.subtree_populated" */ | 204 | struct kernfs_node *populated_kn; /* kn for "cgroup.subtree_populated" */ |
| 205 | 205 | ||
| 206 | /* the bitmask of subsystems enabled on the child cgroups */ | 206 | /* |
| 207 | * The bitmask of subsystems enabled on the child cgroups. | ||
| 208 | * ->subtree_control is the one configured through | ||
| 209 | * "cgroup.subtree_control" while ->child_subsys_mask is the | ||
| 210 | * effective one which may have more subsystems enabled. | ||
| 211 | * Controller knobs are made available iff it's enabled in | ||
| 212 | * ->subtree_control. | ||
| 213 | */ | ||
| 214 | unsigned int subtree_control; | ||
| 207 | unsigned int child_subsys_mask; | 215 | unsigned int child_subsys_mask; |
| 208 | 216 | ||
| 209 | /* Private pointers for each registered subsystem */ | 217 | /* Private pointers for each registered subsystem */ |
| @@ -248,73 +256,9 @@ struct cgroup { | |||
| 248 | 256 | ||
| 249 | /* cgroup_root->flags */ | 257 | /* cgroup_root->flags */ |
| 250 | enum { | 258 | enum { |
| 251 | /* | 259 | CGRP_ROOT_SANE_BEHAVIOR = (1 << 0), /* __DEVEL__sane_behavior specified */ |
| 252 | * Unfortunately, cgroup core and various controllers are riddled | ||
| 253 | * with idiosyncrasies and pointless options. The following flag, | ||
| 254 | * when set, will force sane behavior - some options are forced on, | ||
| 255 | * others are disallowed, and some controllers will change their | ||
| 256 | * hierarchical or other behaviors. | ||
| 257 | * | ||
| 258 | * The set of behaviors affected by this flag are still being | ||
| 259 | * determined and developed and the mount option for this flag is | ||
| 260 | * prefixed with __DEVEL__. The prefix will be dropped once we | ||
| 261 | * reach the point where all behaviors are compatible with the | ||
| 262 | * planned unified hierarchy, which will automatically turn on this | ||
| 263 | * flag. | ||
| 264 | * | ||
| 265 | * The followings are the behaviors currently affected this flag. | ||
| 266 | * | ||
| 267 | * - Mount options "noprefix", "xattr", "clone_children", | ||
| 268 | * "release_agent" and "name" are disallowed. | ||
| 269 | * | ||
| 270 | * - When mounting an existing superblock, mount options should | ||
| 271 | * match. | ||
| 272 | * | ||
| 273 | * - Remount is disallowed. | ||
| 274 | * | ||
| 275 | * - rename(2) is disallowed. | ||
| 276 | * | ||
| 277 | * - "tasks" is removed. Everything should be at process | ||
| 278 | * granularity. Use "cgroup.procs" instead. | ||
| 279 | * | ||
| 280 | * - "cgroup.procs" is not sorted. pids will be unique unless they | ||
| 281 | * got recycled inbetween reads. | ||
| 282 | * | ||
| 283 | * - "release_agent" and "notify_on_release" are removed. | ||
| 284 | * Replacement notification mechanism will be implemented. | ||
| 285 | * | ||
| 286 | * - "cgroup.clone_children" is removed. | ||
| 287 | * | ||
| 288 | * - "cgroup.subtree_populated" is available. Its value is 0 if | ||
| 289 | * the cgroup and its descendants contain no task; otherwise, 1. | ||
| 290 | * The file also generates kernfs notification which can be | ||
| 291 | * monitored through poll and [di]notify when the value of the | ||
| 292 | * file changes. | ||
| 293 | * | ||
| 294 | * - If mount is requested with sane_behavior but without any | ||
| 295 | * subsystem, the default unified hierarchy is mounted. | ||
| 296 | * | ||
| 297 | * - cpuset: tasks will be kept in empty cpusets when hotplug happens | ||
| 298 | * and take masks of ancestors with non-empty cpus/mems, instead of | ||
| 299 | * being moved to an ancestor. | ||
| 300 | * | ||
| 301 | * - cpuset: a task can be moved into an empty cpuset, and again it | ||
| 302 | * takes masks of ancestors. | ||
| 303 | * | ||
| 304 | * - memcg: use_hierarchy is on by default and the cgroup file for | ||
| 305 | * the flag is not created. | ||
| 306 | * | ||
| 307 | * - blkcg: blk-throttle becomes properly hierarchical. | ||
| 308 | * | ||
| 309 | * - debug: disallowed on the default hierarchy. | ||
| 310 | */ | ||
| 311 | CGRP_ROOT_SANE_BEHAVIOR = (1 << 0), | ||
| 312 | |||
| 313 | CGRP_ROOT_NOPREFIX = (1 << 1), /* mounted subsystems have no named prefix */ | 260 | CGRP_ROOT_NOPREFIX = (1 << 1), /* mounted subsystems have no named prefix */ |
| 314 | CGRP_ROOT_XATTR = (1 << 2), /* supports extended attributes */ | 261 | CGRP_ROOT_XATTR = (1 << 2), /* supports extended attributes */ |
| 315 | |||
| 316 | /* mount options live below bit 16 */ | ||
| 317 | CGRP_ROOT_OPTION_MASK = (1 << 16) - 1, | ||
| 318 | }; | 262 | }; |
| 319 | 263 | ||
| 320 | /* | 264 | /* |
| @@ -440,9 +384,11 @@ struct css_set { | |||
| 440 | enum { | 384 | enum { |
| 441 | CFTYPE_ONLY_ON_ROOT = (1 << 0), /* only create on root cgrp */ | 385 | CFTYPE_ONLY_ON_ROOT = (1 << 0), /* only create on root cgrp */ |
| 442 | CFTYPE_NOT_ON_ROOT = (1 << 1), /* don't create on root cgrp */ | 386 | CFTYPE_NOT_ON_ROOT = (1 << 1), /* don't create on root cgrp */ |
| 443 | CFTYPE_INSANE = (1 << 2), /* don't create if sane_behavior */ | ||
| 444 | CFTYPE_NO_PREFIX = (1 << 3), /* (DON'T USE FOR NEW FILES) no subsys prefix */ | 387 | CFTYPE_NO_PREFIX = (1 << 3), /* (DON'T USE FOR NEW FILES) no subsys prefix */ |
| 445 | CFTYPE_ONLY_ON_DFL = (1 << 4), /* only on default hierarchy */ | 388 | |
| 389 | /* internal flags, do not use outside cgroup core proper */ | ||
| 390 | __CFTYPE_ONLY_ON_DFL = (1 << 16), /* only on default hierarchy */ | ||
| 391 | __CFTYPE_NOT_ON_DFL = (1 << 17), /* not on default hierarchy */ | ||
| 446 | }; | 392 | }; |
| 447 | 393 | ||
| 448 | #define MAX_CFTYPE_NAME 64 | 394 | #define MAX_CFTYPE_NAME 64 |
| @@ -526,20 +472,64 @@ struct cftype { | |||
| 526 | extern struct cgroup_root cgrp_dfl_root; | 472 | extern struct cgroup_root cgrp_dfl_root; |
| 527 | extern struct css_set init_css_set; | 473 | extern struct css_set init_css_set; |
| 528 | 474 | ||
| 475 | /** | ||
| 476 | * cgroup_on_dfl - test whether a cgroup is on the default hierarchy | ||
| 477 | * @cgrp: the cgroup of interest | ||
| 478 | * | ||
| 479 | * The default hierarchy is the v2 interface of cgroup and this function | ||
| 480 | * can be used to test whether a cgroup is on the default hierarchy for | ||
| 481 | * cases where a subsystem should behave differnetly depending on the | ||
| 482 | * interface version. | ||
| 483 | * | ||
| 484 | * The set of behaviors which change on the default hierarchy are still | ||
| 485 | * being determined and the mount option is prefixed with __DEVEL__. | ||
| 486 | * | ||
| 487 | * List of changed behaviors: | ||
| 488 | * | ||
| 489 | * - Mount options "noprefix", "xattr", "clone_children", "release_agent" | ||
| 490 | * and "name" are disallowed. | ||
| 491 | * | ||
| 492 | * - When mounting an existing superblock, mount options should match. | ||
| 493 | * | ||
| 494 | * - Remount is disallowed. | ||
| 495 | * | ||
| 496 | * - rename(2) is disallowed. | ||
| 497 | * | ||
| 498 | * - "tasks" is removed. Everything should be at process granularity. Use | ||
| 499 | * "cgroup.procs" instead. | ||
| 500 | * | ||
| 501 | * - "cgroup.procs" is not sorted. pids will be unique unless they got | ||
| 502 | * recycled inbetween reads. | ||
| 503 | * | ||
| 504 | * - "release_agent" and "notify_on_release" are removed. Replacement | ||
| 505 | * notification mechanism will be implemented. | ||
| 506 | * | ||
| 507 | * - "cgroup.clone_children" is removed. | ||
| 508 | * | ||
| 509 | * - "cgroup.subtree_populated" is available. Its value is 0 if the cgroup | ||
| 510 | * and its descendants contain no task; otherwise, 1. The file also | ||
| 511 | * generates kernfs notification which can be monitored through poll and | ||
| 512 | * [di]notify when the value of the file changes. | ||
| 513 | * | ||
| 514 | * - cpuset: tasks will be kept in empty cpusets when hotplug happens and | ||
| 515 | * take masks of ancestors with non-empty cpus/mems, instead of being | ||
| 516 | * moved to an ancestor. | ||
| 517 | * | ||
| 518 | * - cpuset: a task can be moved into an empty cpuset, and again it takes | ||
| 519 | * masks of ancestors. | ||
| 520 | * | ||
| 521 | * - memcg: use_hierarchy is on by default and the cgroup file for the flag | ||
| 522 | * is not created. | ||
| 523 | * | ||
| 524 | * - blkcg: blk-throttle becomes properly hierarchical. | ||
| 525 | * | ||
| 526 | * - debug: disallowed on the default hierarchy. | ||
| 527 | */ | ||
| 529 | static inline bool cgroup_on_dfl(const struct cgroup *cgrp) | 528 | static inline bool cgroup_on_dfl(const struct cgroup *cgrp) |
| 530 | { | 529 | { |
| 531 | return cgrp->root == &cgrp_dfl_root; | 530 | return cgrp->root == &cgrp_dfl_root; |
| 532 | } | 531 | } |
| 533 | 532 | ||
| 534 | /* | ||
| 535 | * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This | ||
| 536 | * function can be called as long as @cgrp is accessible. | ||
| 537 | */ | ||
| 538 | static inline bool cgroup_sane_behavior(const struct cgroup *cgrp) | ||
| 539 | { | ||
| 540 | return cgrp->root->flags & CGRP_ROOT_SANE_BEHAVIOR; | ||
| 541 | } | ||
| 542 | |||
| 543 | /* no synchronization, the result can only be used as a hint */ | 533 | /* no synchronization, the result can only be used as a hint */ |
| 544 | static inline bool cgroup_has_tasks(struct cgroup *cgrp) | 534 | static inline bool cgroup_has_tasks(struct cgroup *cgrp) |
| 545 | { | 535 | { |
| @@ -602,7 +592,8 @@ static inline void pr_cont_cgroup_path(struct cgroup *cgrp) | |||
| 602 | 592 | ||
| 603 | char *task_cgroup_path(struct task_struct *task, char *buf, size_t buflen); | 593 | char *task_cgroup_path(struct task_struct *task, char *buf, size_t buflen); |
| 604 | 594 | ||
| 605 | int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); | 595 | int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); |
| 596 | int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); | ||
| 606 | int cgroup_rm_cftypes(struct cftype *cfts); | 597 | int cgroup_rm_cftypes(struct cftype *cfts); |
| 607 | 598 | ||
| 608 | bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor); | 599 | bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor); |
| @@ -634,6 +625,7 @@ struct cgroup_subsys { | |||
| 634 | int (*css_online)(struct cgroup_subsys_state *css); | 625 | int (*css_online)(struct cgroup_subsys_state *css); |
| 635 | void (*css_offline)(struct cgroup_subsys_state *css); | 626 | void (*css_offline)(struct cgroup_subsys_state *css); |
| 636 | void (*css_free)(struct cgroup_subsys_state *css); | 627 | void (*css_free)(struct cgroup_subsys_state *css); |
| 628 | void (*css_reset)(struct cgroup_subsys_state *css); | ||
| 637 | 629 | ||
| 638 | int (*can_attach)(struct cgroup_subsys_state *css, | 630 | int (*can_attach)(struct cgroup_subsys_state *css, |
| 639 | struct cgroup_taskset *tset); | 631 | struct cgroup_taskset *tset); |
| @@ -682,8 +674,21 @@ struct cgroup_subsys { | |||
| 682 | */ | 674 | */ |
| 683 | struct list_head cfts; | 675 | struct list_head cfts; |
| 684 | 676 | ||
| 685 | /* base cftypes, automatically registered with subsys itself */ | 677 | /* |
| 686 | struct cftype *base_cftypes; | 678 | * Base cftypes which are automatically registered. The two can |
| 679 | * point to the same array. | ||
| 680 | */ | ||
| 681 | struct cftype *dfl_cftypes; /* for the default hierarchy */ | ||
| 682 | struct cftype *legacy_cftypes; /* for the legacy hierarchies */ | ||
| 683 | |||
| 684 | /* | ||
| 685 | * A subsystem may depend on other subsystems. When such subsystem | ||
| 686 | * is enabled on a cgroup, the depended-upon subsystems are enabled | ||
| 687 | * together if available. Subsystems enabled due to dependency are | ||
| 688 | * not visible to userland until explicitly enabled. The following | ||
| 689 | * specifies the mask of subsystems that this one depends on. | ||
| 690 | */ | ||
| 691 | unsigned int depends_on; | ||
| 687 | }; | 692 | }; |
| 688 | 693 | ||
| 689 | #define SUBSYS(_x) extern struct cgroup_subsys _x ## _cgrp_subsys; | 694 | #define SUBSYS(_x) extern struct cgroup_subsys _x ## _cgrp_subsys; |
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 0c287dbbb144..411dd7eb2653 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
| @@ -619,5 +619,10 @@ static inline void clk_writel(u32 val, u32 __iomem *reg) | |||
| 619 | 619 | ||
| 620 | #endif /* platform dependent I/O accessors */ | 620 | #endif /* platform dependent I/O accessors */ |
| 621 | 621 | ||
| 622 | #ifdef CONFIG_DEBUG_FS | ||
| 623 | struct dentry *clk_debugfs_add_file(struct clk *clk, char *name, umode_t mode, | ||
| 624 | void *data, const struct file_operations *fops); | ||
| 625 | #endif | ||
| 626 | |||
| 622 | #endif /* CONFIG_COMMON_CLK */ | 627 | #endif /* CONFIG_COMMON_CLK */ |
| 623 | #endif /* CLK_PROVIDER_H */ | 628 | #endif /* CLK_PROVIDER_H */ |
diff --git a/include/linux/clk/clk-conf.h b/include/linux/clk/clk-conf.h new file mode 100644 index 000000000000..f3050e15f833 --- /dev/null +++ b/include/linux/clk/clk-conf.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2014 Samsung Electronics Co., Ltd. | ||
| 3 | * Sylwester Nawrocki <s.nawrocki@samsung.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | */ | ||
| 9 | |||
| 10 | struct device_node; | ||
| 11 | |||
| 12 | #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK) | ||
| 13 | int of_clk_set_defaults(struct device_node *node, bool clk_supplier); | ||
| 14 | #else | ||
| 15 | static inline int of_clk_set_defaults(struct device_node *node, | ||
| 16 | bool clk_supplier) | ||
| 17 | { | ||
| 18 | return 0; | ||
| 19 | } | ||
| 20 | #endif | ||
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index a16b497d5159..653f0e2b6ca9 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
| @@ -162,7 +162,6 @@ extern u64 timecounter_cyc2time(struct timecounter *tc, | |||
| 162 | * @archdata: arch-specific data | 162 | * @archdata: arch-specific data |
| 163 | * @suspend: suspend function for the clocksource, if necessary | 163 | * @suspend: suspend function for the clocksource, if necessary |
| 164 | * @resume: resume function for the clocksource, if necessary | 164 | * @resume: resume function for the clocksource, if necessary |
| 165 | * @cycle_last: most recent cycle counter value seen by ::read() | ||
| 166 | * @owner: module reference, must be set by clocksource in modules | 165 | * @owner: module reference, must be set by clocksource in modules |
| 167 | */ | 166 | */ |
| 168 | struct clocksource { | 167 | struct clocksource { |
| @@ -171,7 +170,6 @@ struct clocksource { | |||
| 171 | * clocksource itself is cacheline aligned. | 170 | * clocksource itself is cacheline aligned. |
| 172 | */ | 171 | */ |
| 173 | cycle_t (*read)(struct clocksource *cs); | 172 | cycle_t (*read)(struct clocksource *cs); |
| 174 | cycle_t cycle_last; | ||
| 175 | cycle_t mask; | 173 | cycle_t mask; |
| 176 | u32 mult; | 174 | u32 mult; |
| 177 | u32 shift; | 175 | u32 shift; |
diff --git a/include/linux/component.h b/include/linux/component.h index 68870182ca1e..c00dcc302611 100644 --- a/include/linux/component.h +++ b/include/linux/component.h | |||
| @@ -29,4 +29,11 @@ void component_master_del(struct device *, | |||
| 29 | int component_master_add_child(struct master *master, | 29 | int component_master_add_child(struct master *master, |
| 30 | int (*compare)(struct device *, void *), void *compare_data); | 30 | int (*compare)(struct device *, void *), void *compare_data); |
| 31 | 31 | ||
| 32 | struct component_match; | ||
| 33 | |||
| 34 | int component_master_add_with_match(struct device *, | ||
| 35 | const struct component_master_ops *, struct component_match *); | ||
| 36 | void component_match_add(struct device *, struct component_match **, | ||
| 37 | int (*compare)(struct device *, void *), void *compare_data); | ||
| 38 | |||
| 32 | #endif | 39 | #endif |
diff --git a/include/linux/cper.h b/include/linux/cper.h index 2fc0ec3d89cc..76abba4b238e 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #define LINUX_CPER_H | 22 | #define LINUX_CPER_H |
| 23 | 23 | ||
| 24 | #include <linux/uuid.h> | 24 | #include <linux/uuid.h> |
| 25 | #include <linux/trace_seq.h> | ||
| 25 | 26 | ||
| 26 | /* CPER record signature and the size */ | 27 | /* CPER record signature and the size */ |
| 27 | #define CPER_SIG_RECORD "CPER" | 28 | #define CPER_SIG_RECORD "CPER" |
| @@ -36,6 +37,13 @@ | |||
| 36 | #define CPER_RECORD_REV 0x0100 | 37 | #define CPER_RECORD_REV 0x0100 |
| 37 | 38 | ||
| 38 | /* | 39 | /* |
| 40 | * CPER record length contains the CPER fields which are relevant for further | ||
| 41 | * handling of a memory error in userspace (we don't carry all the fields | ||
| 42 | * defined in the UEFI spec because some of them don't make any sense.) | ||
| 43 | * Currently, a length of 256 should be more than enough. | ||
| 44 | */ | ||
| 45 | #define CPER_REC_LEN 256 | ||
| 46 | /* | ||
| 39 | * Severity difinition for error_severity in struct cper_record_header | 47 | * Severity difinition for error_severity in struct cper_record_header |
| 40 | * and section_severity in struct cper_section_descriptor | 48 | * and section_severity in struct cper_section_descriptor |
| 41 | */ | 49 | */ |
| @@ -356,6 +364,24 @@ struct cper_sec_mem_err { | |||
| 356 | __u16 mem_dev_handle; /* module handle in UEFI 2.4 */ | 364 | __u16 mem_dev_handle; /* module handle in UEFI 2.4 */ |
| 357 | }; | 365 | }; |
| 358 | 366 | ||
| 367 | struct cper_mem_err_compact { | ||
| 368 | __u64 validation_bits; | ||
| 369 | __u16 node; | ||
| 370 | __u16 card; | ||
| 371 | __u16 module; | ||
| 372 | __u16 bank; | ||
| 373 | __u16 device; | ||
| 374 | __u16 row; | ||
| 375 | __u16 column; | ||
| 376 | __u16 bit_pos; | ||
| 377 | __u64 requestor_id; | ||
| 378 | __u64 responder_id; | ||
| 379 | __u64 target_id; | ||
| 380 | __u16 rank; | ||
| 381 | __u16 mem_array_handle; | ||
| 382 | __u16 mem_dev_handle; | ||
| 383 | }; | ||
| 384 | |||
| 359 | struct cper_sec_pcie { | 385 | struct cper_sec_pcie { |
| 360 | __u64 validation_bits; | 386 | __u64 validation_bits; |
| 361 | __u32 port_type; | 387 | __u32 port_type; |
| @@ -395,7 +421,13 @@ struct cper_sec_pcie { | |||
| 395 | #pragma pack() | 421 | #pragma pack() |
| 396 | 422 | ||
| 397 | u64 cper_next_record_id(void); | 423 | u64 cper_next_record_id(void); |
| 424 | const char *cper_severity_str(unsigned int); | ||
| 425 | const char *cper_mem_err_type_str(unsigned int); | ||
| 398 | void cper_print_bits(const char *prefix, unsigned int bits, | 426 | void cper_print_bits(const char *prefix, unsigned int bits, |
| 399 | const char * const strs[], unsigned int strs_size); | 427 | const char * const strs[], unsigned int strs_size); |
| 428 | void cper_mem_err_pack(const struct cper_sec_mem_err *, | ||
| 429 | struct cper_mem_err_compact *); | ||
| 430 | const char *cper_mem_err_unpack(struct trace_seq *, | ||
| 431 | struct cper_mem_err_compact *); | ||
| 400 | 432 | ||
| 401 | #endif | 433 | #endif |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 8f8ae95c6e27..7d1955afa62c 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -176,6 +176,7 @@ static inline void disable_cpufreq(void) { } | |||
| 176 | 176 | ||
| 177 | #define CPUFREQ_RELATION_L 0 /* lowest frequency at or above target */ | 177 | #define CPUFREQ_RELATION_L 0 /* lowest frequency at or above target */ |
| 178 | #define CPUFREQ_RELATION_H 1 /* highest frequency below or at target */ | 178 | #define CPUFREQ_RELATION_H 1 /* highest frequency below or at target */ |
| 179 | #define CPUFREQ_RELATION_C 2 /* closest frequency to target */ | ||
| 179 | 180 | ||
| 180 | struct freq_attr { | 181 | struct freq_attr { |
| 181 | struct attribute attr; | 182 | struct attribute attr; |
diff --git a/include/linux/crc32.h b/include/linux/crc32.h index 7d275c4fc011..9e8a032c1788 100644 --- a/include/linux/crc32.h +++ b/include/linux/crc32.h | |||
| @@ -8,8 +8,8 @@ | |||
| 8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
| 9 | #include <linux/bitrev.h> | 9 | #include <linux/bitrev.h> |
| 10 | 10 | ||
| 11 | extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len); | 11 | u32 __pure crc32_le(u32 crc, unsigned char const *p, size_t len); |
| 12 | extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); | 12 | u32 __pure crc32_be(u32 crc, unsigned char const *p, size_t len); |
| 13 | 13 | ||
| 14 | /** | 14 | /** |
| 15 | * crc32_le_combine - Combine two crc32 check values into one. For two | 15 | * crc32_le_combine - Combine two crc32 check values into one. For two |
| @@ -29,9 +29,14 @@ extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); | |||
| 29 | * with the same initializer as crc1, and crc2 seed was 0. See | 29 | * with the same initializer as crc1, and crc2 seed was 0. See |
| 30 | * also crc32_combine_test(). | 30 | * also crc32_combine_test(). |
| 31 | */ | 31 | */ |
| 32 | extern u32 crc32_le_combine(u32 crc1, u32 crc2, size_t len2); | 32 | u32 __attribute_const__ crc32_le_shift(u32 crc, size_t len); |
| 33 | 33 | ||
| 34 | extern u32 __crc32c_le(u32 crc, unsigned char const *p, size_t len); | 34 | static inline u32 crc32_le_combine(u32 crc1, u32 crc2, size_t len2) |
| 35 | { | ||
| 36 | return crc32_le_shift(crc1, len2) ^ crc2; | ||
| 37 | } | ||
| 38 | |||
| 39 | u32 __pure __crc32c_le(u32 crc, unsigned char const *p, size_t len); | ||
| 35 | 40 | ||
| 36 | /** | 41 | /** |
| 37 | * __crc32c_le_combine - Combine two crc32c check values into one. For two | 42 | * __crc32c_le_combine - Combine two crc32c check values into one. For two |
| @@ -51,7 +56,12 @@ extern u32 __crc32c_le(u32 crc, unsigned char const *p, size_t len); | |||
| 51 | * seeded with the same initializer as crc1, and crc2 seed | 56 | * seeded with the same initializer as crc1, and crc2 seed |
| 52 | * was 0. See also crc32c_combine_test(). | 57 | * was 0. See also crc32c_combine_test(). |
| 53 | */ | 58 | */ |
| 54 | extern u32 __crc32c_le_combine(u32 crc1, u32 crc2, size_t len2); | 59 | u32 __attribute_const__ __crc32c_le_shift(u32 crc, size_t len); |
| 60 | |||
| 61 | static inline u32 __crc32c_le_combine(u32 crc1, u32 crc2, size_t len2) | ||
| 62 | { | ||
| 63 | return __crc32c_le_shift(crc1, len2) ^ crc2; | ||
| 64 | } | ||
| 55 | 65 | ||
| 56 | #define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)(data), length) | 66 | #define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)(data), length) |
| 57 | 67 | ||
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index b92eadf92d72..d45e949699ea 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
| @@ -710,9 +710,9 @@ static inline void ablkcipher_request_free(struct ablkcipher_request *req) | |||
| 710 | 710 | ||
| 711 | static inline void ablkcipher_request_set_callback( | 711 | static inline void ablkcipher_request_set_callback( |
| 712 | struct ablkcipher_request *req, | 712 | struct ablkcipher_request *req, |
| 713 | u32 flags, crypto_completion_t complete, void *data) | 713 | u32 flags, crypto_completion_t compl, void *data) |
| 714 | { | 714 | { |
| 715 | req->base.complete = complete; | 715 | req->base.complete = compl; |
| 716 | req->base.data = data; | 716 | req->base.data = data; |
| 717 | req->base.flags = flags; | 717 | req->base.flags = flags; |
| 718 | } | 718 | } |
| @@ -841,10 +841,10 @@ static inline void aead_request_free(struct aead_request *req) | |||
| 841 | 841 | ||
| 842 | static inline void aead_request_set_callback(struct aead_request *req, | 842 | static inline void aead_request_set_callback(struct aead_request *req, |
| 843 | u32 flags, | 843 | u32 flags, |
| 844 | crypto_completion_t complete, | 844 | crypto_completion_t compl, |
| 845 | void *data) | 845 | void *data) |
| 846 | { | 846 | { |
| 847 | req->base.complete = complete; | 847 | req->base.complete = compl; |
| 848 | req->base.data = data; | 848 | req->base.data = data; |
| 849 | req->base.flags = flags; | 849 | req->base.flags = flags; |
| 850 | } | 850 | } |
diff --git a/include/linux/device.h b/include/linux/device.h index af424acd393d..43d183aeb25b 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -124,7 +124,7 @@ struct bus_type { | |||
| 124 | 124 | ||
| 125 | const struct dev_pm_ops *pm; | 125 | const struct dev_pm_ops *pm; |
| 126 | 126 | ||
| 127 | struct iommu_ops *iommu_ops; | 127 | const struct iommu_ops *iommu_ops; |
| 128 | 128 | ||
| 129 | struct subsys_private *p; | 129 | struct subsys_private *p; |
| 130 | struct lock_class_key lock_key; | 130 | struct lock_class_key lock_key; |
| @@ -605,6 +605,10 @@ extern int devres_release_group(struct device *dev, void *id); | |||
| 605 | 605 | ||
| 606 | /* managed devm_k.alloc/kfree for device drivers */ | 606 | /* managed devm_k.alloc/kfree for device drivers */ |
| 607 | extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp); | 607 | extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp); |
| 608 | extern char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt, | ||
| 609 | va_list ap); | ||
| 610 | extern char *devm_kasprintf(struct device *dev, gfp_t gfp, | ||
| 611 | const char *fmt, ...); | ||
| 608 | static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp) | 612 | static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp) |
| 609 | { | 613 | { |
| 610 | return devm_kmalloc(dev, size, gfp | __GFP_ZERO); | 614 | return devm_kmalloc(dev, size, gfp | __GFP_ZERO); |
| @@ -631,8 +635,6 @@ extern unsigned long devm_get_free_pages(struct device *dev, | |||
| 631 | extern void devm_free_pages(struct device *dev, unsigned long addr); | 635 | extern void devm_free_pages(struct device *dev, unsigned long addr); |
| 632 | 636 | ||
| 633 | void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); | 637 | void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); |
| 634 | void __iomem *devm_request_and_ioremap(struct device *dev, | ||
| 635 | struct resource *res); | ||
| 636 | 638 | ||
| 637 | /* allows to add/remove a custom action to devres stack */ | 639 | /* allows to add/remove a custom action to devres stack */ |
| 638 | int devm_add_action(struct device *dev, void (*action)(void *), void *data); | 640 | int devm_add_action(struct device *dev, void (*action)(void *), void *data); |
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index f886985a28b2..694e1fe1c4b4 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | #include <linux/list.h> | 30 | #include <linux/list.h> |
| 31 | #include <linux/dma-mapping.h> | 31 | #include <linux/dma-mapping.h> |
| 32 | #include <linux/fs.h> | 32 | #include <linux/fs.h> |
| 33 | #include <linux/fence.h> | ||
| 34 | #include <linux/wait.h> | ||
| 33 | 35 | ||
| 34 | struct device; | 36 | struct device; |
| 35 | struct dma_buf; | 37 | struct dma_buf; |
| @@ -115,6 +117,7 @@ struct dma_buf_ops { | |||
| 115 | * @exp_name: name of the exporter; useful for debugging. | 117 | * @exp_name: name of the exporter; useful for debugging. |
| 116 | * @list_node: node for dma_buf accounting and debugging. | 118 | * @list_node: node for dma_buf accounting and debugging. |
| 117 | * @priv: exporter specific private data for this buffer object. | 119 | * @priv: exporter specific private data for this buffer object. |
| 120 | * @resv: reservation object linked to this dma-buf | ||
| 118 | */ | 121 | */ |
| 119 | struct dma_buf { | 122 | struct dma_buf { |
| 120 | size_t size; | 123 | size_t size; |
| @@ -128,6 +131,17 @@ struct dma_buf { | |||
| 128 | const char *exp_name; | 131 | const char *exp_name; |
| 129 | struct list_head list_node; | 132 | struct list_head list_node; |
| 130 | void *priv; | 133 | void *priv; |
| 134 | struct reservation_object *resv; | ||
| 135 | |||
| 136 | /* poll support */ | ||
| 137 | wait_queue_head_t poll; | ||
| 138 | |||
| 139 | struct dma_buf_poll_cb_t { | ||
| 140 | struct fence_cb cb; | ||
| 141 | wait_queue_head_t *poll; | ||
| 142 | |||
| 143 | unsigned long active; | ||
| 144 | } cb_excl, cb_shared; | ||
| 131 | }; | 145 | }; |
| 132 | 146 | ||
| 133 | /** | 147 | /** |
| @@ -168,10 +182,11 @@ void dma_buf_detach(struct dma_buf *dmabuf, | |||
| 168 | struct dma_buf_attachment *dmabuf_attach); | 182 | struct dma_buf_attachment *dmabuf_attach); |
| 169 | 183 | ||
| 170 | struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops, | 184 | struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops, |
| 171 | size_t size, int flags, const char *); | 185 | size_t size, int flags, const char *, |
| 186 | struct reservation_object *); | ||
| 172 | 187 | ||
| 173 | #define dma_buf_export(priv, ops, size, flags) \ | 188 | #define dma_buf_export(priv, ops, size, flags, resv) \ |
| 174 | dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME) | 189 | dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME, resv) |
| 175 | 190 | ||
| 176 | int dma_buf_fd(struct dma_buf *dmabuf, int flags); | 191 | int dma_buf_fd(struct dma_buf *dmabuf, int flags); |
| 177 | struct dma_buf *dma_buf_get(int fd); | 192 | struct dma_buf *dma_buf_get(int fd); |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index d2c5cc7c583c..3d1c2aa51530 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -299,6 +299,7 @@ enum dma_slave_buswidth { | |||
| 299 | DMA_SLAVE_BUSWIDTH_UNDEFINED = 0, | 299 | DMA_SLAVE_BUSWIDTH_UNDEFINED = 0, |
| 300 | DMA_SLAVE_BUSWIDTH_1_BYTE = 1, | 300 | DMA_SLAVE_BUSWIDTH_1_BYTE = 1, |
| 301 | DMA_SLAVE_BUSWIDTH_2_BYTES = 2, | 301 | DMA_SLAVE_BUSWIDTH_2_BYTES = 2, |
| 302 | DMA_SLAVE_BUSWIDTH_3_BYTES = 3, | ||
| 302 | DMA_SLAVE_BUSWIDTH_4_BYTES = 4, | 303 | DMA_SLAVE_BUSWIDTH_4_BYTES = 4, |
| 303 | DMA_SLAVE_BUSWIDTH_8_BYTES = 8, | 304 | DMA_SLAVE_BUSWIDTH_8_BYTES = 8, |
| 304 | }; | 305 | }; |
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 23c8db129560..1deece46a0ca 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
| @@ -114,22 +114,30 @@ extern int dmar_remove_dev_scope(struct dmar_pci_notify_info *info, | |||
| 114 | /* Intel IOMMU detection */ | 114 | /* Intel IOMMU detection */ |
| 115 | extern int detect_intel_iommu(void); | 115 | extern int detect_intel_iommu(void); |
| 116 | extern int enable_drhd_fault_handling(void); | 116 | extern int enable_drhd_fault_handling(void); |
| 117 | #else | 117 | |
| 118 | struct dmar_pci_notify_info; | 118 | #ifdef CONFIG_INTEL_IOMMU |
| 119 | static inline int detect_intel_iommu(void) | 119 | extern int iommu_detected, no_iommu; |
| 120 | extern int intel_iommu_init(void); | ||
| 121 | extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header); | ||
| 122 | extern int dmar_parse_one_atsr(struct acpi_dmar_header *header); | ||
| 123 | extern int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info); | ||
| 124 | #else /* !CONFIG_INTEL_IOMMU: */ | ||
| 125 | static inline int intel_iommu_init(void) { return -ENODEV; } | ||
| 126 | static inline int dmar_parse_one_rmrr(struct acpi_dmar_header *header) | ||
| 120 | { | 127 | { |
| 121 | return -ENODEV; | 128 | return 0; |
| 122 | } | 129 | } |
| 123 | 130 | static inline int dmar_parse_one_atsr(struct acpi_dmar_header *header) | |
| 124 | static inline int dmar_table_init(void) | ||
| 125 | { | 131 | { |
| 126 | return -ENODEV; | 132 | return 0; |
| 127 | } | 133 | } |
| 128 | static inline int enable_drhd_fault_handling(void) | 134 | static inline int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info) |
| 129 | { | 135 | { |
| 130 | return -1; | 136 | return 0; |
| 131 | } | 137 | } |
| 132 | #endif /* !CONFIG_DMAR_TABLE */ | 138 | #endif /* CONFIG_INTEL_IOMMU */ |
| 139 | |||
| 140 | #endif /* CONFIG_DMAR_TABLE */ | ||
| 133 | 141 | ||
| 134 | struct irte { | 142 | struct irte { |
| 135 | union { | 143 | union { |
| @@ -177,26 +185,4 @@ extern int dmar_set_interrupt(struct intel_iommu *iommu); | |||
| 177 | extern irqreturn_t dmar_fault(int irq, void *dev_id); | 185 | extern irqreturn_t dmar_fault(int irq, void *dev_id); |
| 178 | extern int arch_setup_dmar_msi(unsigned int irq); | 186 | extern int arch_setup_dmar_msi(unsigned int irq); |
| 179 | 187 | ||
| 180 | #ifdef CONFIG_INTEL_IOMMU | ||
| 181 | extern int iommu_detected, no_iommu; | ||
| 182 | extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header); | ||
| 183 | extern int dmar_parse_one_atsr(struct acpi_dmar_header *header); | ||
| 184 | extern int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info); | ||
| 185 | extern int intel_iommu_init(void); | ||
| 186 | #else /* !CONFIG_INTEL_IOMMU: */ | ||
| 187 | static inline int intel_iommu_init(void) { return -ENODEV; } | ||
| 188 | static inline int dmar_parse_one_rmrr(struct acpi_dmar_header *header) | ||
| 189 | { | ||
| 190 | return 0; | ||
| 191 | } | ||
| 192 | static inline int dmar_parse_one_atsr(struct acpi_dmar_header *header) | ||
| 193 | { | ||
| 194 | return 0; | ||
| 195 | } | ||
| 196 | static inline int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info) | ||
| 197 | { | ||
| 198 | return 0; | ||
| 199 | } | ||
| 200 | #endif /* CONFIG_INTEL_IOMMU */ | ||
| 201 | |||
| 202 | #endif /* __DMAR_H__ */ | 188 | #endif /* __DMAR_H__ */ |
diff --git a/include/linux/efi.h b/include/linux/efi.h index 41bbf8ba4ba8..efc681fd5895 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/ioport.h> | 20 | #include <linux/ioport.h> |
| 21 | #include <linux/pfn.h> | 21 | #include <linux/pfn.h> |
| 22 | #include <linux/pstore.h> | 22 | #include <linux/pstore.h> |
| 23 | #include <linux/reboot.h> | ||
| 23 | 24 | ||
| 24 | #include <asm/page.h> | 25 | #include <asm/page.h> |
| 25 | 26 | ||
| @@ -521,6 +522,8 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, | |||
| 521 | int *reset_type); | 522 | int *reset_type); |
| 522 | typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long size); | 523 | typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long size); |
| 523 | 524 | ||
| 525 | void efi_native_runtime_setup(void); | ||
| 526 | |||
| 524 | /* | 527 | /* |
| 525 | * EFI Configuration Table and GUID definitions | 528 | * EFI Configuration Table and GUID definitions |
| 526 | */ | 529 | */ |
| @@ -870,11 +873,13 @@ extern int __init efi_uart_console_only (void); | |||
| 870 | extern void efi_initialize_iomem_resources(struct resource *code_resource, | 873 | extern void efi_initialize_iomem_resources(struct resource *code_resource, |
| 871 | struct resource *data_resource, struct resource *bss_resource); | 874 | struct resource *data_resource, struct resource *bss_resource); |
| 872 | extern void efi_get_time(struct timespec *now); | 875 | extern void efi_get_time(struct timespec *now); |
| 873 | extern int efi_set_rtc_mmss(const struct timespec *now); | ||
| 874 | extern void efi_reserve_boot_services(void); | 876 | extern void efi_reserve_boot_services(void); |
| 875 | extern int efi_get_fdt_params(struct efi_fdt_params *params, int verbose); | 877 | extern int efi_get_fdt_params(struct efi_fdt_params *params, int verbose); |
| 876 | extern struct efi_memory_map memmap; | 878 | extern struct efi_memory_map memmap; |
| 877 | 879 | ||
| 880 | extern int efi_reboot_quirk_mode; | ||
| 881 | extern bool efi_poweroff_required(void); | ||
| 882 | |||
| 878 | /* Iterate through an efi_memory_map */ | 883 | /* Iterate through an efi_memory_map */ |
| 879 | #define for_each_efi_memory_desc(m, md) \ | 884 | #define for_each_efi_memory_desc(m, md) \ |
| 880 | for ((md) = (m)->map; \ | 885 | for ((md) = (m)->map; \ |
| @@ -916,7 +921,8 @@ extern int __init efi_setup_pcdp_console(char *); | |||
| 916 | #define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */ | 921 | #define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */ |
| 917 | #define EFI_MEMMAP 4 /* Can we use EFI memory map? */ | 922 | #define EFI_MEMMAP 4 /* Can we use EFI memory map? */ |
| 918 | #define EFI_64BIT 5 /* Is the firmware 64-bit? */ | 923 | #define EFI_64BIT 5 /* Is the firmware 64-bit? */ |
| 919 | #define EFI_ARCH_1 6 /* First arch-specific bit */ | 924 | #define EFI_PARAVIRT 6 /* Access is via a paravirt interface */ |
| 925 | #define EFI_ARCH_1 7 /* First arch-specific bit */ | ||
| 920 | 926 | ||
| 921 | #ifdef CONFIG_EFI | 927 | #ifdef CONFIG_EFI |
| 922 | /* | 928 | /* |
| @@ -926,11 +932,14 @@ static inline bool efi_enabled(int feature) | |||
| 926 | { | 932 | { |
| 927 | return test_bit(feature, &efi.flags) != 0; | 933 | return test_bit(feature, &efi.flags) != 0; |
| 928 | } | 934 | } |
| 935 | extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused); | ||
| 929 | #else | 936 | #else |
| 930 | static inline bool efi_enabled(int feature) | 937 | static inline bool efi_enabled(int feature) |
| 931 | { | 938 | { |
| 932 | return false; | 939 | return false; |
| 933 | } | 940 | } |
| 941 | static inline void | ||
| 942 | efi_reboot(enum reboot_mode reboot_mode, const char *__unused) {} | ||
| 934 | #endif | 943 | #endif |
| 935 | 944 | ||
| 936 | /* | 945 | /* |
| @@ -1031,12 +1040,8 @@ struct efivar_operations { | |||
| 1031 | struct efivars { | 1040 | struct efivars { |
| 1032 | /* | 1041 | /* |
| 1033 | * ->lock protects two things: | 1042 | * ->lock protects two things: |
| 1034 | * 1) ->list - adds, removals, reads, writes | 1043 | * 1) efivarfs_list and efivars_sysfs_list |
| 1035 | * 2) ops.[gs]et_variable() calls. | 1044 | * 2) ->ops calls |
| 1036 | * It must not be held when creating sysfs entries or calling kmalloc. | ||
| 1037 | * ops.get_next_variable() is only called from register_efivars() | ||
| 1038 | * or efivar_update_sysfs_entries(), | ||
| 1039 | * which is protected by the BKL, so that path is safe. | ||
| 1040 | */ | 1045 | */ |
| 1041 | spinlock_t lock; | 1046 | spinlock_t lock; |
| 1042 | struct kset *kset; | 1047 | struct kset *kset; |
| @@ -1161,4 +1166,46 @@ static inline void | |||
| 1161 | efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size) {} | 1166 | efi_runtime_map_setup(void *map, int nr_entries, u32 desc_size) {} |
| 1162 | #endif | 1167 | #endif |
| 1163 | 1168 | ||
| 1169 | /* prototypes shared between arch specific and generic stub code */ | ||
| 1170 | |||
| 1171 | #define pr_efi(sys_table, msg) efi_printk(sys_table, "EFI stub: "msg) | ||
| 1172 | #define pr_efi_err(sys_table, msg) efi_printk(sys_table, "EFI stub: ERROR: "msg) | ||
| 1173 | |||
| 1174 | void efi_printk(efi_system_table_t *sys_table_arg, char *str); | ||
| 1175 | |||
| 1176 | void efi_free(efi_system_table_t *sys_table_arg, unsigned long size, | ||
| 1177 | unsigned long addr); | ||
| 1178 | |||
| 1179 | char *efi_convert_cmdline(efi_system_table_t *sys_table_arg, | ||
| 1180 | efi_loaded_image_t *image, int *cmd_line_len); | ||
| 1181 | |||
| 1182 | efi_status_t efi_get_memory_map(efi_system_table_t *sys_table_arg, | ||
| 1183 | efi_memory_desc_t **map, | ||
| 1184 | unsigned long *map_size, | ||
| 1185 | unsigned long *desc_size, | ||
| 1186 | u32 *desc_ver, | ||
| 1187 | unsigned long *key_ptr); | ||
| 1188 | |||
| 1189 | efi_status_t efi_low_alloc(efi_system_table_t *sys_table_arg, | ||
| 1190 | unsigned long size, unsigned long align, | ||
| 1191 | unsigned long *addr); | ||
| 1192 | |||
| 1193 | efi_status_t efi_high_alloc(efi_system_table_t *sys_table_arg, | ||
| 1194 | unsigned long size, unsigned long align, | ||
| 1195 | unsigned long *addr, unsigned long max); | ||
| 1196 | |||
| 1197 | efi_status_t efi_relocate_kernel(efi_system_table_t *sys_table_arg, | ||
| 1198 | unsigned long *image_addr, | ||
| 1199 | unsigned long image_size, | ||
| 1200 | unsigned long alloc_size, | ||
| 1201 | unsigned long preferred_addr, | ||
| 1202 | unsigned long alignment); | ||
| 1203 | |||
| 1204 | efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, | ||
| 1205 | efi_loaded_image_t *image, | ||
| 1206 | char *cmd_line, char *option_string, | ||
| 1207 | unsigned long max_addr, | ||
| 1208 | unsigned long *load_addr, | ||
| 1209 | unsigned long *load_size); | ||
| 1210 | |||
| 1164 | #endif /* _LINUX_EFI_H */ | 1211 | #endif /* _LINUX_EFI_H */ |
diff --git a/include/linux/extcon/sm5502.h b/include/linux/extcon/sm5502.h new file mode 100644 index 000000000000..030526bf8d79 --- /dev/null +++ b/include/linux/extcon/sm5502.h | |||
| @@ -0,0 +1,287 @@ | |||
| 1 | /* | ||
| 2 | * sm5502.h | ||
| 3 | * | ||
| 4 | * Copyright (c) 2014 Samsung Electronics Co., Ltd | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms of the GNU General Public License as published by the | ||
| 8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 9 | * option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef __LINUX_EXTCON_SM5502_H | ||
| 18 | #define __LINUX_EXTCON_SM5502_H | ||
| 19 | |||
| 20 | enum sm5502_types { | ||
| 21 | TYPE_SM5502, | ||
| 22 | }; | ||
| 23 | |||
| 24 | /* SM5502 registers */ | ||
| 25 | enum sm5502_reg { | ||
| 26 | SM5502_REG_DEVICE_ID = 0x01, | ||
| 27 | SM5502_REG_CONTROL, | ||
| 28 | SM5502_REG_INT1, | ||
| 29 | SM5502_REG_INT2, | ||
| 30 | SM5502_REG_INTMASK1, | ||
| 31 | SM5502_REG_INTMASK2, | ||
| 32 | SM5502_REG_ADC, | ||
| 33 | SM5502_REG_TIMING_SET1, | ||
| 34 | SM5502_REG_TIMING_SET2, | ||
| 35 | SM5502_REG_DEV_TYPE1, | ||
| 36 | SM5502_REG_DEV_TYPE2, | ||
| 37 | SM5502_REG_BUTTON1, | ||
| 38 | SM5502_REG_BUTTON2, | ||
| 39 | SM5502_REG_CAR_KIT_STATUS, | ||
| 40 | SM5502_REG_RSVD1, | ||
| 41 | SM5502_REG_RSVD2, | ||
| 42 | SM5502_REG_RSVD3, | ||
| 43 | SM5502_REG_RSVD4, | ||
| 44 | SM5502_REG_MANUAL_SW1, | ||
| 45 | SM5502_REG_MANUAL_SW2, | ||
| 46 | SM5502_REG_DEV_TYPE3, | ||
| 47 | SM5502_REG_RSVD5, | ||
| 48 | SM5502_REG_RSVD6, | ||
| 49 | SM5502_REG_RSVD7, | ||
| 50 | SM5502_REG_RSVD8, | ||
| 51 | SM5502_REG_RSVD9, | ||
| 52 | SM5502_REG_RESET, | ||
| 53 | SM5502_REG_RSVD10, | ||
| 54 | SM5502_REG_RESERVED_ID1, | ||
| 55 | SM5502_REG_RSVD11, | ||
| 56 | SM5502_REG_RSVD12, | ||
| 57 | SM5502_REG_RESERVED_ID2, | ||
| 58 | SM5502_REG_RSVD13, | ||
| 59 | SM5502_REG_OCP, | ||
| 60 | SM5502_REG_RSVD14, | ||
| 61 | SM5502_REG_RSVD15, | ||
| 62 | SM5502_REG_RSVD16, | ||
| 63 | SM5502_REG_RSVD17, | ||
| 64 | SM5502_REG_RSVD18, | ||
| 65 | SM5502_REG_RSVD19, | ||
| 66 | SM5502_REG_RSVD20, | ||
| 67 | SM5502_REG_RSVD21, | ||
| 68 | SM5502_REG_RSVD22, | ||
| 69 | SM5502_REG_RSVD23, | ||
| 70 | SM5502_REG_RSVD24, | ||
| 71 | SM5502_REG_RSVD25, | ||
| 72 | SM5502_REG_RSVD26, | ||
| 73 | SM5502_REG_RSVD27, | ||
| 74 | SM5502_REG_RSVD28, | ||
| 75 | SM5502_REG_RSVD29, | ||
| 76 | SM5502_REG_RSVD30, | ||
| 77 | SM5502_REG_RSVD31, | ||
| 78 | SM5502_REG_RSVD32, | ||
| 79 | SM5502_REG_RSVD33, | ||
| 80 | SM5502_REG_RSVD34, | ||
| 81 | SM5502_REG_RSVD35, | ||
| 82 | SM5502_REG_RSVD36, | ||
| 83 | SM5502_REG_RESERVED_ID3, | ||
| 84 | |||
| 85 | SM5502_REG_END, | ||
| 86 | }; | ||
| 87 | |||
| 88 | /* Define SM5502 MASK/SHIFT constant */ | ||
| 89 | #define SM5502_REG_DEVICE_ID_VENDOR_SHIFT 0 | ||
| 90 | #define SM5502_REG_DEVICE_ID_VERSION_SHIFT 3 | ||
| 91 | #define SM5502_REG_DEVICE_ID_VENDOR_MASK (0x3 << SM5502_REG_DEVICE_ID_VENDOR_SHIFT) | ||
| 92 | #define SM5502_REG_DEVICE_ID_VERSION_MASK (0x1f << SM5502_REG_DEVICE_ID_VERSION_SHIFT) | ||
| 93 | |||
| 94 | #define SM5502_REG_CONTROL_MASK_INT_SHIFT 0 | ||
| 95 | #define SM5502_REG_CONTROL_WAIT_SHIFT 1 | ||
| 96 | #define SM5502_REG_CONTROL_MANUAL_SW_SHIFT 2 | ||
| 97 | #define SM5502_REG_CONTROL_RAW_DATA_SHIFT 3 | ||
| 98 | #define SM5502_REG_CONTROL_SW_OPEN_SHIFT 4 | ||
| 99 | #define SM5502_REG_CONTROL_MASK_INT_MASK (0x1 << SM5502_REG_CONTROL_MASK_INT_SHIFT) | ||
| 100 | #define SM5502_REG_CONTROL_WAIT_MASK (0x1 << SM5502_REG_CONTROL_WAIT_SHIFT) | ||
| 101 | #define SM5502_REG_CONTROL_MANUAL_SW_MASK (0x1 << SM5502_REG_CONTROL_MANUAL_SW_SHIFT) | ||
| 102 | #define SM5502_REG_CONTROL_RAW_DATA_MASK (0x1 << SM5502_REG_CONTROL_RAW_DATA_SHIFT) | ||
| 103 | #define SM5502_REG_CONTROL_SW_OPEN_MASK (0x1 << SM5502_REG_CONTROL_SW_OPEN_SHIFT) | ||
| 104 | |||
| 105 | #define SM5502_REG_INTM1_ATTACH_SHIFT 0 | ||
| 106 | #define SM5502_REG_INTM1_DETACH_SHIFT 1 | ||
| 107 | #define SM5502_REG_INTM1_KP_SHIFT 2 | ||
| 108 | #define SM5502_REG_INTM1_LKP_SHIFT 3 | ||
| 109 | #define SM5502_REG_INTM1_LKR_SHIFT 4 | ||
| 110 | #define SM5502_REG_INTM1_OVP_EVENT_SHIFT 5 | ||
| 111 | #define SM5502_REG_INTM1_OCP_EVENT_SHIFT 6 | ||
| 112 | #define SM5502_REG_INTM1_OVP_OCP_DIS_SHIFT 7 | ||
| 113 | #define SM5502_REG_INTM1_ATTACH_MASK (0x1 << SM5502_REG_INTM1_ATTACH_SHIFT) | ||
| 114 | #define SM5502_REG_INTM1_DETACH_MASK (0x1 << SM5502_REG_INTM1_DETACH_SHIFT) | ||
| 115 | #define SM5502_REG_INTM1_KP_MASK (0x1 << SM5502_REG_INTM1_KP_SHIFT) | ||
| 116 | #define SM5502_REG_INTM1_LKP_MASK (0x1 << SM5502_REG_INTM1_LKP_SHIFT) | ||
| 117 | #define SM5502_REG_INTM1_LKR_MASK (0x1 << SM5502_REG_INTM1_LKR_SHIFT) | ||
| 118 | #define SM5502_REG_INTM1_OVP_EVENT_MASK (0x1 << SM5502_REG_INTM1_OVP_EVENT_SHIFT) | ||
| 119 | #define SM5502_REG_INTM1_OCP_EVENT_MASK (0x1 << SM5502_REG_INTM1_OCP_EVENT_SHIFT) | ||
| 120 | #define SM5502_REG_INTM1_OVP_OCP_DIS_MASK (0x1 << SM5502_REG_INTM1_OVP_OCP_DIS_SHIFT) | ||
| 121 | |||
| 122 | #define SM5502_REG_INTM2_VBUS_DET_SHIFT 0 | ||
| 123 | #define SM5502_REG_INTM2_REV_ACCE_SHIFT 1 | ||
| 124 | #define SM5502_REG_INTM2_ADC_CHG_SHIFT 2 | ||
| 125 | #define SM5502_REG_INTM2_STUCK_KEY_SHIFT 3 | ||
| 126 | #define SM5502_REG_INTM2_STUCK_KEY_RCV_SHIFT 4 | ||
| 127 | #define SM5502_REG_INTM2_MHL_SHIFT 5 | ||
| 128 | #define SM5502_REG_INTM2_VBUS_DET_MASK (0x1 << SM5502_REG_INTM2_VBUS_DET_SHIFT) | ||
| 129 | #define SM5502_REG_INTM2_REV_ACCE_MASK (0x1 << SM5502_REG_INTM2_REV_ACCE_SHIFT) | ||
| 130 | #define SM5502_REG_INTM2_ADC_CHG_MASK (0x1 << SM5502_REG_INTM2_ADC_CHG_SHIFT) | ||
| 131 | #define SM5502_REG_INTM2_STUCK_KEY_MASK (0x1 << SM5502_REG_INTM2_STUCK_KEY_SHIFT) | ||
| 132 | #define SM5502_REG_INTM2_STUCK_KEY_RCV_MASK (0x1 << SM5502_REG_INTM2_STUCK_KEY_RCV_SHIFT) | ||
| 133 | #define SM5502_REG_INTM2_MHL_MASK (0x1 << SM5502_REG_INTM2_MHL_SHIFT) | ||
| 134 | |||
| 135 | #define SM5502_REG_ADC_SHIFT 0 | ||
| 136 | #define SM5502_REG_ADC_MASK (0x1f << SM5502_REG_ADC_SHIFT) | ||
| 137 | |||
| 138 | #define SM5502_REG_TIMING_SET1_KEY_PRESS_SHIFT 4 | ||
| 139 | #define SM5502_REG_TIMING_SET1_KEY_PRESS_MASK (0xf << SM5502_REG_TIMING_SET1_KEY_PRESS_SHIFT) | ||
| 140 | #define TIMING_KEY_PRESS_100MS 0x0 | ||
| 141 | #define TIMING_KEY_PRESS_200MS 0x1 | ||
| 142 | #define TIMING_KEY_PRESS_300MS 0x2 | ||
| 143 | #define TIMING_KEY_PRESS_400MS 0x3 | ||
| 144 | #define TIMING_KEY_PRESS_500MS 0x4 | ||
| 145 | #define TIMING_KEY_PRESS_600MS 0x5 | ||
| 146 | #define TIMING_KEY_PRESS_700MS 0x6 | ||
| 147 | #define TIMING_KEY_PRESS_800MS 0x7 | ||
| 148 | #define TIMING_KEY_PRESS_900MS 0x8 | ||
| 149 | #define TIMING_KEY_PRESS_1000MS 0x9 | ||
| 150 | #define SM5502_REG_TIMING_SET1_ADC_DET_SHIFT 0 | ||
| 151 | #define SM5502_REG_TIMING_SET1_ADC_DET_MASK (0xf << SM5502_REG_TIMING_SET1_ADC_DET_SHIFT) | ||
| 152 | #define TIMING_ADC_DET_50MS 0x0 | ||
| 153 | #define TIMING_ADC_DET_100MS 0x1 | ||
| 154 | #define TIMING_ADC_DET_150MS 0x2 | ||
| 155 | #define TIMING_ADC_DET_200MS 0x3 | ||
| 156 | #define TIMING_ADC_DET_300MS 0x4 | ||
| 157 | #define TIMING_ADC_DET_400MS 0x5 | ||
| 158 | #define TIMING_ADC_DET_500MS 0x6 | ||
| 159 | #define TIMING_ADC_DET_600MS 0x7 | ||
| 160 | #define TIMING_ADC_DET_700MS 0x8 | ||
| 161 | #define TIMING_ADC_DET_800MS 0x9 | ||
| 162 | #define TIMING_ADC_DET_900MS 0xA | ||
| 163 | #define TIMING_ADC_DET_1000MS 0xB | ||
| 164 | |||
| 165 | #define SM5502_REG_TIMING_SET2_SW_WAIT_SHIFT 4 | ||
| 166 | #define SM5502_REG_TIMING_SET2_SW_WAIT_MASK (0xf << SM5502_REG_TIMING_SET2_SW_WAIT_SHIFT) | ||
| 167 | #define TIMING_SW_WAIT_10MS 0x0 | ||
| 168 | #define TIMING_SW_WAIT_30MS 0x1 | ||
| 169 | #define TIMING_SW_WAIT_50MS 0x2 | ||
| 170 | #define TIMING_SW_WAIT_70MS 0x3 | ||
| 171 | #define TIMING_SW_WAIT_90MS 0x4 | ||
| 172 | #define TIMING_SW_WAIT_110MS 0x5 | ||
| 173 | #define TIMING_SW_WAIT_130MS 0x6 | ||
| 174 | #define TIMING_SW_WAIT_150MS 0x7 | ||
| 175 | #define TIMING_SW_WAIT_170MS 0x8 | ||
| 176 | #define TIMING_SW_WAIT_190MS 0x9 | ||
| 177 | #define TIMING_SW_WAIT_210MS 0xA | ||
| 178 | #define SM5502_REG_TIMING_SET2_LONG_KEY_SHIFT 0 | ||
| 179 | #define SM5502_REG_TIMING_SET2_LONG_KEY_MASK (0xf << SM5502_REG_TIMING_SET2_LONG_KEY_SHIFT) | ||
| 180 | #define TIMING_LONG_KEY_300MS 0x0 | ||
| 181 | #define TIMING_LONG_KEY_400MS 0x1 | ||
| 182 | #define TIMING_LONG_KEY_500MS 0x2 | ||
| 183 | #define TIMING_LONG_KEY_600MS 0x3 | ||
| 184 | #define TIMING_LONG_KEY_700MS 0x4 | ||
| 185 | #define TIMING_LONG_KEY_800MS 0x5 | ||
| 186 | #define TIMING_LONG_KEY_900MS 0x6 | ||
| 187 | #define TIMING_LONG_KEY_1000MS 0x7 | ||
| 188 | #define TIMING_LONG_KEY_1100MS 0x8 | ||
| 189 | #define TIMING_LONG_KEY_1200MS 0x9 | ||
| 190 | #define TIMING_LONG_KEY_1300MS 0xA | ||
| 191 | #define TIMING_LONG_KEY_1400MS 0xB | ||
| 192 | #define TIMING_LONG_KEY_1500MS 0xC | ||
| 193 | |||
| 194 | #define SM5502_REG_DEV_TYPE1_AUDIO_TYPE1_SHIFT 0 | ||
| 195 | #define SM5502_REG_DEV_TYPE1_AUDIO_TYPE2_SHIFT 1 | ||
| 196 | #define SM5502_REG_DEV_TYPE1_USB_SDP_SHIFT 2 | ||
| 197 | #define SM5502_REG_DEV_TYPE1_UART_SHIFT 3 | ||
| 198 | #define SM5502_REG_DEV_TYPE1_CAR_KIT_CHARGER_SHIFT 4 | ||
| 199 | #define SM5502_REG_DEV_TYPE1_USB_CHG_SHIFT 5 | ||
| 200 | #define SM5502_REG_DEV_TYPE1_DEDICATED_CHG_SHIFT 6 | ||
| 201 | #define SM5502_REG_DEV_TYPE1_USB_OTG_SHIFT 7 | ||
| 202 | #define SM5502_REG_DEV_TYPE1_AUDIO_TYPE1_MASK (0x1 << SM5502_REG_DEV_TYPE1_AUDIO_TYPE1_SHIFT) | ||
| 203 | #define SM5502_REG_DEV_TYPE1_AUDIO_TYPE1__MASK (0x1 << SM5502_REG_DEV_TYPE1_AUDIO_TYPE2_SHIFT) | ||
| 204 | #define SM5502_REG_DEV_TYPE1_USB_SDP_MASK (0x1 << SM5502_REG_DEV_TYPE1_USB_SDP_SHIFT) | ||
| 205 | #define SM5502_REG_DEV_TYPE1_UART_MASK (0x1 << SM5502_REG_DEV_TYPE1_UART_SHIFT) | ||
| 206 | #define SM5502_REG_DEV_TYPE1_CAR_KIT_CHARGER_MASK (0x1 << SM5502_REG_DEV_TYPE1_CAR_KIT_CHARGER_SHIFT) | ||
| 207 | #define SM5502_REG_DEV_TYPE1_USB_CHG_MASK (0x1 << SM5502_REG_DEV_TYPE1_USB_CHG_SHIFT) | ||
| 208 | #define SM5502_REG_DEV_TYPE1_DEDICATED_CHG_MASK (0x1 << SM5502_REG_DEV_TYPE1_DEDICATED_CHG_SHIFT) | ||
| 209 | #define SM5502_REG_DEV_TYPE1_USB_OTG_MASK (0x1 << SM5502_REG_DEV_TYPE1_USB_OTG_SHIFT) | ||
| 210 | |||
| 211 | #define SM5502_REG_DEV_TYPE2_JIG_USB_ON_SHIFT 0 | ||
| 212 | #define SM5502_REG_DEV_TYPE2_JIG_USB_OFF_SHIFT 1 | ||
| 213 | #define SM5502_REG_DEV_TYPE2_JIG_UART_ON_SHIFT 2 | ||
| 214 | #define SM5502_REG_DEV_TYPE2_JIG_UART_OFF_SHIFT 3 | ||
| 215 | #define SM5502_REG_DEV_TYPE2_PPD_SHIFT 4 | ||
| 216 | #define SM5502_REG_DEV_TYPE2_TTY_SHIFT 5 | ||
| 217 | #define SM5502_REG_DEV_TYPE2_AV_CABLE_SHIFT 6 | ||
| 218 | #define SM5502_REG_DEV_TYPE2_JIG_USB_ON_MASK (0x1 << SM5502_REG_DEV_TYPE2_JIG_USB_ON_SHIFT) | ||
| 219 | #define SM5502_REG_DEV_TYPE2_JIG_USB_OFF_MASK (0x1 << SM5502_REG_DEV_TYPE2_JIG_USB_OFF_SHIFT) | ||
| 220 | #define SM5502_REG_DEV_TYPE2_JIG_UART_ON_MASK (0x1 << SM5502_REG_DEV_TYPE2_JIG_UART_ON_SHIFT) | ||
| 221 | #define SM5502_REG_DEV_TYPE2_JIG_UART_OFF_MASK (0x1 << SM5502_REG_DEV_TYPE2_JIG_UART_OFF_SHIFT) | ||
| 222 | #define SM5502_REG_DEV_TYPE2_PPD_MASK (0x1 << SM5502_REG_DEV_TYPE2_PPD_SHIFT) | ||
| 223 | #define SM5502_REG_DEV_TYPE2_TTY_MASK (0x1 << SM5502_REG_DEV_TYPE2_TTY_SHIFT) | ||
| 224 | #define SM5502_REG_DEV_TYPE2_AV_CABLE_MASK (0x1 << SM5502_REG_DEV_TYPE2_AV_CABLE_SHIFT) | ||
| 225 | |||
| 226 | #define SM5502_REG_MANUAL_SW1_VBUSIN_SHIFT 0 | ||
| 227 | #define SM5502_REG_MANUAL_SW1_DP_SHIFT 2 | ||
| 228 | #define SM5502_REG_MANUAL_SW1_DM_SHIFT 5 | ||
| 229 | #define SM5502_REG_MANUAL_SW1_VBUSIN_MASK (0x3 << SM5502_REG_MANUAL_SW1_VBUSIN_SHIFT) | ||
| 230 | #define SM5502_REG_MANUAL_SW1_DP_MASK (0x7 << SM5502_REG_MANUAL_SW1_DP_SHIFT) | ||
| 231 | #define SM5502_REG_MANUAL_SW1_DM_MASK (0x7 << SM5502_REG_MANUAL_SW1_DM_SHIFT) | ||
| 232 | #define VBUSIN_SWITCH_OPEN 0x0 | ||
| 233 | #define VBUSIN_SWITCH_VBUSOUT 0x1 | ||
| 234 | #define VBUSIN_SWITCH_MIC 0x2 | ||
| 235 | #define VBUSIN_SWITCH_VBUSOUT_WITH_USB 0x3 | ||
| 236 | #define DM_DP_CON_SWITCH_OPEN 0x0 | ||
| 237 | #define DM_DP_CON_SWITCH_USB 0x1 | ||
| 238 | #define DM_DP_CON_SWITCH_AUDIO 0x2 | ||
| 239 | #define DM_DP_CON_SWITCH_UART 0x3 | ||
| 240 | #define DM_DP_SWITCH_OPEN ((DM_DP_CON_SWITCH_OPEN <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \ | ||
| 241 | | (DM_DP_CON_SWITCH_OPEN <<SM5502_REG_MANUAL_SW1_DM_SHIFT)) | ||
| 242 | #define DM_DP_SWITCH_USB ((DM_DP_CON_SWITCH_USB <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \ | ||
| 243 | | (DM_DP_CON_SWITCH_USB <<SM5502_REG_MANUAL_SW1_DM_SHIFT)) | ||
| 244 | #define DM_DP_SWITCH_AUDIO ((DM_DP_CON_SWITCH_AUDIO <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \ | ||
| 245 | | (DM_DP_CON_SWITCH_AUDIO <<SM5502_REG_MANUAL_SW1_DM_SHIFT)) | ||
| 246 | #define DM_DP_SWITCH_UART ((DM_DP_CON_SWITCH_UART <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \ | ||
| 247 | | (DM_DP_CON_SWITCH_UART <<SM5502_REG_MANUAL_SW1_DM_SHIFT)) | ||
| 248 | |||
| 249 | /* SM5502 Interrupts */ | ||
| 250 | enum sm5502_irq { | ||
| 251 | /* INT1 */ | ||
| 252 | SM5502_IRQ_INT1_ATTACH, | ||
| 253 | SM5502_IRQ_INT1_DETACH, | ||
| 254 | SM5502_IRQ_INT1_KP, | ||
| 255 | SM5502_IRQ_INT1_LKP, | ||
| 256 | SM5502_IRQ_INT1_LKR, | ||
| 257 | SM5502_IRQ_INT1_OVP_EVENT, | ||
| 258 | SM5502_IRQ_INT1_OCP_EVENT, | ||
| 259 | SM5502_IRQ_INT1_OVP_OCP_DIS, | ||
| 260 | |||
| 261 | /* INT2 */ | ||
| 262 | SM5502_IRQ_INT2_VBUS_DET, | ||
| 263 | SM5502_IRQ_INT2_REV_ACCE, | ||
| 264 | SM5502_IRQ_INT2_ADC_CHG, | ||
| 265 | SM5502_IRQ_INT2_STUCK_KEY, | ||
| 266 | SM5502_IRQ_INT2_STUCK_KEY_RCV, | ||
| 267 | SM5502_IRQ_INT2_MHL, | ||
| 268 | |||
| 269 | SM5502_IRQ_NUM, | ||
| 270 | }; | ||
| 271 | |||
| 272 | #define SM5502_IRQ_INT1_ATTACH_MASK BIT(0) | ||
| 273 | #define SM5502_IRQ_INT1_DETACH_MASK BIT(1) | ||
| 274 | #define SM5502_IRQ_INT1_KP_MASK BIT(2) | ||
| 275 | #define SM5502_IRQ_INT1_LKP_MASK BIT(3) | ||
| 276 | #define SM5502_IRQ_INT1_LKR_MASK BIT(4) | ||
| 277 | #define SM5502_IRQ_INT1_OVP_EVENT_MASK BIT(5) | ||
| 278 | #define SM5502_IRQ_INT1_OCP_EVENT_MASK BIT(6) | ||
| 279 | #define SM5502_IRQ_INT1_OVP_OCP_DIS_MASK BIT(7) | ||
| 280 | #define SM5502_IRQ_INT2_VBUS_DET_MASK BIT(0) | ||
| 281 | #define SM5502_IRQ_INT2_REV_ACCE_MASK BIT(1) | ||
| 282 | #define SM5502_IRQ_INT2_ADC_CHG_MASK BIT(2) | ||
| 283 | #define SM5502_IRQ_INT2_STUCK_KEY_MASK BIT(3) | ||
| 284 | #define SM5502_IRQ_INT2_STUCK_KEY_RCV_MASK BIT(4) | ||
| 285 | #define SM5502_IRQ_INT2_MHL_MASK BIT(5) | ||
| 286 | |||
| 287 | #endif /* __LINUX_EXTCON_SM5502_H */ | ||
diff --git a/include/linux/fence.h b/include/linux/fence.h new file mode 100644 index 000000000000..d174585b874b --- /dev/null +++ b/include/linux/fence.h | |||
| @@ -0,0 +1,360 @@ | |||
| 1 | /* | ||
| 2 | * Fence mechanism for dma-buf to allow for asynchronous dma access | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Canonical Ltd | ||
| 5 | * Copyright (C) 2012 Texas Instruments | ||
| 6 | * | ||
| 7 | * Authors: | ||
| 8 | * Rob Clark <robdclark@gmail.com> | ||
| 9 | * Maarten Lankhorst <maarten.lankhorst@canonical.com> | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify it | ||
| 12 | * under the terms of the GNU General Public License version 2 as published by | ||
| 13 | * the Free Software Foundation. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 18 | * more details. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __LINUX_FENCE_H | ||
| 22 | #define __LINUX_FENCE_H | ||
| 23 | |||
| 24 | #include <linux/err.h> | ||
| 25 | #include <linux/wait.h> | ||
| 26 | #include <linux/list.h> | ||
| 27 | #include <linux/bitops.h> | ||
| 28 | #include <linux/kref.h> | ||
| 29 | #include <linux/sched.h> | ||
| 30 | #include <linux/printk.h> | ||
| 31 | #include <linux/rcupdate.h> | ||
| 32 | |||
| 33 | struct fence; | ||
| 34 | struct fence_ops; | ||
| 35 | struct fence_cb; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * struct fence - software synchronization primitive | ||
| 39 | * @refcount: refcount for this fence | ||
| 40 | * @ops: fence_ops associated with this fence | ||
| 41 | * @rcu: used for releasing fence with kfree_rcu | ||
| 42 | * @cb_list: list of all callbacks to call | ||
| 43 | * @lock: spin_lock_irqsave used for locking | ||
| 44 | * @context: execution context this fence belongs to, returned by | ||
| 45 | * fence_context_alloc() | ||
| 46 | * @seqno: the sequence number of this fence inside the execution context, | ||
| 47 | * can be compared to decide which fence would be signaled later. | ||
| 48 | * @flags: A mask of FENCE_FLAG_* defined below | ||
| 49 | * @timestamp: Timestamp when the fence was signaled. | ||
| 50 | * @status: Optional, only valid if < 0, must be set before calling | ||
| 51 | * fence_signal, indicates that the fence has completed with an error. | ||
| 52 | * | ||
| 53 | * the flags member must be manipulated and read using the appropriate | ||
| 54 | * atomic ops (bit_*), so taking the spinlock will not be needed most | ||
| 55 | * of the time. | ||
| 56 | * | ||
| 57 | * FENCE_FLAG_SIGNALED_BIT - fence is already signaled | ||
| 58 | * FENCE_FLAG_ENABLE_SIGNAL_BIT - enable_signaling might have been called* | ||
| 59 | * FENCE_FLAG_USER_BITS - start of the unused bits, can be used by the | ||
| 60 | * implementer of the fence for its own purposes. Can be used in different | ||
| 61 | * ways by different fence implementers, so do not rely on this. | ||
| 62 | * | ||
| 63 | * *) Since atomic bitops are used, this is not guaranteed to be the case. | ||
| 64 | * Particularly, if the bit was set, but fence_signal was called right | ||
| 65 | * before this bit was set, it would have been able to set the | ||
| 66 | * FENCE_FLAG_SIGNALED_BIT, before enable_signaling was called. | ||
| 67 | * Adding a check for FENCE_FLAG_SIGNALED_BIT after setting | ||
| 68 | * FENCE_FLAG_ENABLE_SIGNAL_BIT closes this race, and makes sure that | ||
| 69 | * after fence_signal was called, any enable_signaling call will have either | ||
| 70 | * been completed, or never called at all. | ||
| 71 | */ | ||
| 72 | struct fence { | ||
| 73 | struct kref refcount; | ||
| 74 | const struct fence_ops *ops; | ||
| 75 | struct rcu_head rcu; | ||
| 76 | struct list_head cb_list; | ||
| 77 | spinlock_t *lock; | ||
| 78 | unsigned context, seqno; | ||
| 79 | unsigned long flags; | ||
| 80 | ktime_t timestamp; | ||
| 81 | int status; | ||
| 82 | }; | ||
| 83 | |||
| 84 | enum fence_flag_bits { | ||
| 85 | FENCE_FLAG_SIGNALED_BIT, | ||
| 86 | FENCE_FLAG_ENABLE_SIGNAL_BIT, | ||
| 87 | FENCE_FLAG_USER_BITS, /* must always be last member */ | ||
| 88 | }; | ||
| 89 | |||
| 90 | typedef void (*fence_func_t)(struct fence *fence, struct fence_cb *cb); | ||
| 91 | |||
| 92 | /** | ||
| 93 | * struct fence_cb - callback for fence_add_callback | ||
| 94 | * @node: used by fence_add_callback to append this struct to fence::cb_list | ||
| 95 | * @func: fence_func_t to call | ||
| 96 | * | ||
| 97 | * This struct will be initialized by fence_add_callback, additional | ||
| 98 | * data can be passed along by embedding fence_cb in another struct. | ||
| 99 | */ | ||
| 100 | struct fence_cb { | ||
| 101 | struct list_head node; | ||
| 102 | fence_func_t func; | ||
| 103 | }; | ||
| 104 | |||
| 105 | /** | ||
| 106 | * struct fence_ops - operations implemented for fence | ||
| 107 | * @get_driver_name: returns the driver name. | ||
| 108 | * @get_timeline_name: return the name of the context this fence belongs to. | ||
| 109 | * @enable_signaling: enable software signaling of fence. | ||
| 110 | * @signaled: [optional] peek whether the fence is signaled, can be null. | ||
| 111 | * @wait: custom wait implementation, or fence_default_wait. | ||
| 112 | * @release: [optional] called on destruction of fence, can be null | ||
| 113 | * @fill_driver_data: [optional] callback to fill in free-form debug info | ||
| 114 | * Returns amount of bytes filled, or -errno. | ||
| 115 | * @fence_value_str: [optional] fills in the value of the fence as a string | ||
| 116 | * @timeline_value_str: [optional] fills in the current value of the timeline | ||
| 117 | * as a string | ||
| 118 | * | ||
| 119 | * Notes on enable_signaling: | ||
| 120 | * For fence implementations that have the capability for hw->hw | ||
| 121 | * signaling, they can implement this op to enable the necessary | ||
| 122 | * irqs, or insert commands into cmdstream, etc. This is called | ||
| 123 | * in the first wait() or add_callback() path to let the fence | ||
| 124 | * implementation know that there is another driver waiting on | ||
| 125 | * the signal (ie. hw->sw case). | ||
| 126 | * | ||
| 127 | * This function can be called called from atomic context, but not | ||
| 128 | * from irq context, so normal spinlocks can be used. | ||
| 129 | * | ||
| 130 | * A return value of false indicates the fence already passed, | ||
| 131 | * or some failure occured that made it impossible to enable | ||
| 132 | * signaling. True indicates succesful enabling. | ||
| 133 | * | ||
| 134 | * fence->status may be set in enable_signaling, but only when false is | ||
| 135 | * returned. | ||
| 136 | * | ||
| 137 | * Calling fence_signal before enable_signaling is called allows | ||
| 138 | * for a tiny race window in which enable_signaling is called during, | ||
| 139 | * before, or after fence_signal. To fight this, it is recommended | ||
| 140 | * that before enable_signaling returns true an extra reference is | ||
| 141 | * taken on the fence, to be released when the fence is signaled. | ||
| 142 | * This will mean fence_signal will still be called twice, but | ||
| 143 | * the second time will be a noop since it was already signaled. | ||
| 144 | * | ||
| 145 | * Notes on signaled: | ||
| 146 | * May set fence->status if returning true. | ||
| 147 | * | ||
| 148 | * Notes on wait: | ||
| 149 | * Must not be NULL, set to fence_default_wait for default implementation. | ||
| 150 | * the fence_default_wait implementation should work for any fence, as long | ||
| 151 | * as enable_signaling works correctly. | ||
| 152 | * | ||
| 153 | * Must return -ERESTARTSYS if the wait is intr = true and the wait was | ||
| 154 | * interrupted, and remaining jiffies if fence has signaled, or 0 if wait | ||
| 155 | * timed out. Can also return other error values on custom implementations, | ||
| 156 | * which should be treated as if the fence is signaled. For example a hardware | ||
| 157 | * lockup could be reported like that. | ||
| 158 | * | ||
| 159 | * Notes on release: | ||
| 160 | * Can be NULL, this function allows additional commands to run on | ||
| 161 | * destruction of the fence. Can be called from irq context. | ||
| 162 | * If pointer is set to NULL, kfree will get called instead. | ||
| 163 | */ | ||
| 164 | |||
| 165 | struct fence_ops { | ||
| 166 | const char * (*get_driver_name)(struct fence *fence); | ||
| 167 | const char * (*get_timeline_name)(struct fence *fence); | ||
| 168 | bool (*enable_signaling)(struct fence *fence); | ||
| 169 | bool (*signaled)(struct fence *fence); | ||
| 170 | signed long (*wait)(struct fence *fence, bool intr, signed long timeout); | ||
| 171 | void (*release)(struct fence *fence); | ||
| 172 | |||
| 173 | int (*fill_driver_data)(struct fence *fence, void *data, int size); | ||
| 174 | void (*fence_value_str)(struct fence *fence, char *str, int size); | ||
| 175 | void (*timeline_value_str)(struct fence *fence, char *str, int size); | ||
| 176 | }; | ||
| 177 | |||
| 178 | void fence_init(struct fence *fence, const struct fence_ops *ops, | ||
| 179 | spinlock_t *lock, unsigned context, unsigned seqno); | ||
| 180 | |||
| 181 | void fence_release(struct kref *kref); | ||
| 182 | void fence_free(struct fence *fence); | ||
| 183 | |||
| 184 | /** | ||
| 185 | * fence_get - increases refcount of the fence | ||
| 186 | * @fence: [in] fence to increase refcount of | ||
| 187 | * | ||
| 188 | * Returns the same fence, with refcount increased by 1. | ||
| 189 | */ | ||
| 190 | static inline struct fence *fence_get(struct fence *fence) | ||
| 191 | { | ||
| 192 | if (fence) | ||
| 193 | kref_get(&fence->refcount); | ||
| 194 | return fence; | ||
| 195 | } | ||
| 196 | |||
| 197 | /** | ||
| 198 | * fence_get_rcu - get a fence from a reservation_object_list with rcu read lock | ||
| 199 | * @fence: [in] fence to increase refcount of | ||
| 200 | * | ||
| 201 | * Function returns NULL if no refcount could be obtained, or the fence. | ||
| 202 | */ | ||
| 203 | static inline struct fence *fence_get_rcu(struct fence *fence) | ||
| 204 | { | ||
| 205 | if (kref_get_unless_zero(&fence->refcount)) | ||
| 206 | return fence; | ||
| 207 | else | ||
| 208 | return NULL; | ||
| 209 | } | ||
| 210 | |||
| 211 | /** | ||
| 212 | * fence_put - decreases refcount of the fence | ||
| 213 | * @fence: [in] fence to reduce refcount of | ||
| 214 | */ | ||
| 215 | static inline void fence_put(struct fence *fence) | ||
| 216 | { | ||
| 217 | if (fence) | ||
| 218 | kref_put(&fence->refcount, fence_release); | ||
| 219 | } | ||
| 220 | |||
| 221 | int fence_signal(struct fence *fence); | ||
| 222 | int fence_signal_locked(struct fence *fence); | ||
| 223 | signed long fence_default_wait(struct fence *fence, bool intr, signed long timeout); | ||
| 224 | int fence_add_callback(struct fence *fence, struct fence_cb *cb, | ||
| 225 | fence_func_t func); | ||
| 226 | bool fence_remove_callback(struct fence *fence, struct fence_cb *cb); | ||
| 227 | void fence_enable_sw_signaling(struct fence *fence); | ||
| 228 | |||
| 229 | /** | ||
| 230 | * fence_is_signaled_locked - Return an indication if the fence is signaled yet. | ||
| 231 | * @fence: [in] the fence to check | ||
| 232 | * | ||
| 233 | * Returns true if the fence was already signaled, false if not. Since this | ||
| 234 | * function doesn't enable signaling, it is not guaranteed to ever return | ||
| 235 | * true if fence_add_callback, fence_wait or fence_enable_sw_signaling | ||
| 236 | * haven't been called before. | ||
| 237 | * | ||
| 238 | * This function requires fence->lock to be held. | ||
| 239 | */ | ||
| 240 | static inline bool | ||
| 241 | fence_is_signaled_locked(struct fence *fence) | ||
| 242 | { | ||
| 243 | if (test_bit(FENCE_FLAG_SIGNALED_BIT, &fence->flags)) | ||
| 244 | return true; | ||
| 245 | |||
| 246 | if (fence->ops->signaled && fence->ops->signaled(fence)) { | ||
| 247 | fence_signal_locked(fence); | ||
| 248 | return true; | ||
| 249 | } | ||
| 250 | |||
| 251 | return false; | ||
| 252 | } | ||
| 253 | |||
| 254 | /** | ||
| 255 | * fence_is_signaled - Return an indication if the fence is signaled yet. | ||
| 256 | * @fence: [in] the fence to check | ||
| 257 | * | ||
| 258 | * Returns true if the fence was already signaled, false if not. Since this | ||
| 259 | * function doesn't enable signaling, it is not guaranteed to ever return | ||
| 260 | * true if fence_add_callback, fence_wait or fence_enable_sw_signaling | ||
| 261 | * haven't been called before. | ||
| 262 | * | ||
| 263 | * It's recommended for seqno fences to call fence_signal when the | ||
| 264 | * operation is complete, it makes it possible to prevent issues from | ||
| 265 | * wraparound between time of issue and time of use by checking the return | ||
| 266 | * value of this function before calling hardware-specific wait instructions. | ||
| 267 | */ | ||
| 268 | static inline bool | ||
| 269 | fence_is_signaled(struct fence *fence) | ||
| 270 | { | ||
| 271 | if (test_bit(FENCE_FLAG_SIGNALED_BIT, &fence->flags)) | ||
| 272 | return true; | ||
| 273 | |||
| 274 | if (fence->ops->signaled && fence->ops->signaled(fence)) { | ||
| 275 | fence_signal(fence); | ||
| 276 | return true; | ||
| 277 | } | ||
| 278 | |||
| 279 | return false; | ||
| 280 | } | ||
| 281 | |||
| 282 | /** | ||
| 283 | * fence_later - return the chronologically later fence | ||
| 284 | * @f1: [in] the first fence from the same context | ||
| 285 | * @f2: [in] the second fence from the same context | ||
| 286 | * | ||
| 287 | * Returns NULL if both fences are signaled, otherwise the fence that would be | ||
| 288 | * signaled last. Both fences must be from the same context, since a seqno is | ||
| 289 | * not re-used across contexts. | ||
| 290 | */ | ||
| 291 | static inline struct fence *fence_later(struct fence *f1, struct fence *f2) | ||
| 292 | { | ||
| 293 | if (WARN_ON(f1->context != f2->context)) | ||
| 294 | return NULL; | ||
| 295 | |||
| 296 | /* | ||
| 297 | * can't check just FENCE_FLAG_SIGNALED_BIT here, it may never have been | ||
| 298 | * set if enable_signaling wasn't called, and enabling that here is | ||
| 299 | * overkill. | ||
| 300 | */ | ||
| 301 | if (f2->seqno - f1->seqno <= INT_MAX) | ||
| 302 | return fence_is_signaled(f2) ? NULL : f2; | ||
| 303 | else | ||
| 304 | return fence_is_signaled(f1) ? NULL : f1; | ||
| 305 | } | ||
| 306 | |||
| 307 | signed long fence_wait_timeout(struct fence *, bool intr, signed long timeout); | ||
| 308 | |||
| 309 | |||
| 310 | /** | ||
| 311 | * fence_wait - sleep until the fence gets signaled | ||
| 312 | * @fence: [in] the fence to wait on | ||
| 313 | * @intr: [in] if true, do an interruptible wait | ||
| 314 | * | ||
| 315 | * This function will return -ERESTARTSYS if interrupted by a signal, | ||
| 316 | * or 0 if the fence was signaled. Other error values may be | ||
| 317 | * returned on custom implementations. | ||
| 318 | * | ||
| 319 | * Performs a synchronous wait on this fence. It is assumed the caller | ||
| 320 | * directly or indirectly holds a reference to the fence, otherwise the | ||
| 321 | * fence might be freed before return, resulting in undefined behavior. | ||
| 322 | */ | ||
| 323 | static inline signed long fence_wait(struct fence *fence, bool intr) | ||
| 324 | { | ||
| 325 | signed long ret; | ||
| 326 | |||
| 327 | /* Since fence_wait_timeout cannot timeout with | ||
| 328 | * MAX_SCHEDULE_TIMEOUT, only valid return values are | ||
| 329 | * -ERESTARTSYS and MAX_SCHEDULE_TIMEOUT. | ||
| 330 | */ | ||
| 331 | ret = fence_wait_timeout(fence, intr, MAX_SCHEDULE_TIMEOUT); | ||
| 332 | |||
| 333 | return ret < 0 ? ret : 0; | ||
| 334 | } | ||
| 335 | |||
| 336 | unsigned fence_context_alloc(unsigned num); | ||
| 337 | |||
| 338 | #define FENCE_TRACE(f, fmt, args...) \ | ||
| 339 | do { \ | ||
| 340 | struct fence *__ff = (f); \ | ||
| 341 | if (config_enabled(CONFIG_FENCE_TRACE)) \ | ||
| 342 | pr_info("f %u#%u: " fmt, \ | ||
| 343 | __ff->context, __ff->seqno, ##args); \ | ||
| 344 | } while (0) | ||
| 345 | |||
| 346 | #define FENCE_WARN(f, fmt, args...) \ | ||
| 347 | do { \ | ||
| 348 | struct fence *__ff = (f); \ | ||
| 349 | pr_warn("f %u#%u: " fmt, __ff->context, __ff->seqno, \ | ||
| 350 | ##args); \ | ||
| 351 | } while (0) | ||
| 352 | |||
| 353 | #define FENCE_ERR(f, fmt, args...) \ | ||
| 354 | do { \ | ||
| 355 | struct fence *__ff = (f); \ | ||
| 356 | pr_err("f %u#%u: " fmt, __ff->context, __ff->seqno, \ | ||
| 357 | ##args); \ | ||
| 358 | } while (0) | ||
| 359 | |||
| 360 | #endif /* __LINUX_FENCE_H */ | ||
diff --git a/include/linux/filter.h b/include/linux/filter.h index a7e3c48d73a7..a5227ab8ccb1 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/atomic.h> | 7 | #include <linux/atomic.h> |
| 8 | #include <linux/compat.h> | 8 | #include <linux/compat.h> |
| 9 | #include <linux/skbuff.h> | ||
| 9 | #include <linux/workqueue.h> | 10 | #include <linux/workqueue.h> |
| 10 | #include <uapi/linux/filter.h> | 11 | #include <uapi/linux/filter.h> |
| 11 | 12 | ||
| @@ -81,7 +82,7 @@ enum { | |||
| 81 | /* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */ | 82 | /* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */ |
| 82 | 83 | ||
| 83 | #define BPF_ALU64_REG(OP, DST, SRC) \ | 84 | #define BPF_ALU64_REG(OP, DST, SRC) \ |
| 84 | ((struct sock_filter_int) { \ | 85 | ((struct bpf_insn) { \ |
| 85 | .code = BPF_ALU64 | BPF_OP(OP) | BPF_X, \ | 86 | .code = BPF_ALU64 | BPF_OP(OP) | BPF_X, \ |
| 86 | .dst_reg = DST, \ | 87 | .dst_reg = DST, \ |
| 87 | .src_reg = SRC, \ | 88 | .src_reg = SRC, \ |
| @@ -89,7 +90,7 @@ enum { | |||
| 89 | .imm = 0 }) | 90 | .imm = 0 }) |
| 90 | 91 | ||
| 91 | #define BPF_ALU32_REG(OP, DST, SRC) \ | 92 | #define BPF_ALU32_REG(OP, DST, SRC) \ |
| 92 | ((struct sock_filter_int) { \ | 93 | ((struct bpf_insn) { \ |
| 93 | .code = BPF_ALU | BPF_OP(OP) | BPF_X, \ | 94 | .code = BPF_ALU | BPF_OP(OP) | BPF_X, \ |
| 94 | .dst_reg = DST, \ | 95 | .dst_reg = DST, \ |
| 95 | .src_reg = SRC, \ | 96 | .src_reg = SRC, \ |
| @@ -99,7 +100,7 @@ enum { | |||
| 99 | /* ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 */ | 100 | /* ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 */ |
| 100 | 101 | ||
| 101 | #define BPF_ALU64_IMM(OP, DST, IMM) \ | 102 | #define BPF_ALU64_IMM(OP, DST, IMM) \ |
| 102 | ((struct sock_filter_int) { \ | 103 | ((struct bpf_insn) { \ |
| 103 | .code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \ | 104 | .code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \ |
| 104 | .dst_reg = DST, \ | 105 | .dst_reg = DST, \ |
| 105 | .src_reg = 0, \ | 106 | .src_reg = 0, \ |
| @@ -107,7 +108,7 @@ enum { | |||
| 107 | .imm = IMM }) | 108 | .imm = IMM }) |
| 108 | 109 | ||
| 109 | #define BPF_ALU32_IMM(OP, DST, IMM) \ | 110 | #define BPF_ALU32_IMM(OP, DST, IMM) \ |
| 110 | ((struct sock_filter_int) { \ | 111 | ((struct bpf_insn) { \ |
| 111 | .code = BPF_ALU | BPF_OP(OP) | BPF_K, \ | 112 | .code = BPF_ALU | BPF_OP(OP) | BPF_K, \ |
| 112 | .dst_reg = DST, \ | 113 | .dst_reg = DST, \ |
| 113 | .src_reg = 0, \ | 114 | .src_reg = 0, \ |
| @@ -117,7 +118,7 @@ enum { | |||
| 117 | /* Endianess conversion, cpu_to_{l,b}e(), {l,b}e_to_cpu() */ | 118 | /* Endianess conversion, cpu_to_{l,b}e(), {l,b}e_to_cpu() */ |
| 118 | 119 | ||
| 119 | #define BPF_ENDIAN(TYPE, DST, LEN) \ | 120 | #define BPF_ENDIAN(TYPE, DST, LEN) \ |
| 120 | ((struct sock_filter_int) { \ | 121 | ((struct bpf_insn) { \ |
| 121 | .code = BPF_ALU | BPF_END | BPF_SRC(TYPE), \ | 122 | .code = BPF_ALU | BPF_END | BPF_SRC(TYPE), \ |
| 122 | .dst_reg = DST, \ | 123 | .dst_reg = DST, \ |
| 123 | .src_reg = 0, \ | 124 | .src_reg = 0, \ |
| @@ -127,7 +128,7 @@ enum { | |||
| 127 | /* Short form of mov, dst_reg = src_reg */ | 128 | /* Short form of mov, dst_reg = src_reg */ |
| 128 | 129 | ||
| 129 | #define BPF_MOV64_REG(DST, SRC) \ | 130 | #define BPF_MOV64_REG(DST, SRC) \ |
| 130 | ((struct sock_filter_int) { \ | 131 | ((struct bpf_insn) { \ |
| 131 | .code = BPF_ALU64 | BPF_MOV | BPF_X, \ | 132 | .code = BPF_ALU64 | BPF_MOV | BPF_X, \ |
| 132 | .dst_reg = DST, \ | 133 | .dst_reg = DST, \ |
| 133 | .src_reg = SRC, \ | 134 | .src_reg = SRC, \ |
| @@ -135,7 +136,7 @@ enum { | |||
| 135 | .imm = 0 }) | 136 | .imm = 0 }) |
| 136 | 137 | ||
| 137 | #define BPF_MOV32_REG(DST, SRC) \ | 138 | #define BPF_MOV32_REG(DST, SRC) \ |
| 138 | ((struct sock_filter_int) { \ | 139 | ((struct bpf_insn) { \ |
| 139 | .code = BPF_ALU | BPF_MOV | BPF_X, \ | 140 | .code = BPF_ALU | BPF_MOV | BPF_X, \ |
| 140 | .dst_reg = DST, \ | 141 | .dst_reg = DST, \ |
| 141 | .src_reg = SRC, \ | 142 | .src_reg = SRC, \ |
| @@ -145,7 +146,7 @@ enum { | |||
| 145 | /* Short form of mov, dst_reg = imm32 */ | 146 | /* Short form of mov, dst_reg = imm32 */ |
| 146 | 147 | ||
| 147 | #define BPF_MOV64_IMM(DST, IMM) \ | 148 | #define BPF_MOV64_IMM(DST, IMM) \ |
| 148 | ((struct sock_filter_int) { \ | 149 | ((struct bpf_insn) { \ |
| 149 | .code = BPF_ALU64 | BPF_MOV | BPF_K, \ | 150 | .code = BPF_ALU64 | BPF_MOV | BPF_K, \ |
| 150 | .dst_reg = DST, \ | 151 | .dst_reg = DST, \ |
| 151 | .src_reg = 0, \ | 152 | .src_reg = 0, \ |
| @@ -153,7 +154,7 @@ enum { | |||
| 153 | .imm = IMM }) | 154 | .imm = IMM }) |
| 154 | 155 | ||
| 155 | #define BPF_MOV32_IMM(DST, IMM) \ | 156 | #define BPF_MOV32_IMM(DST, IMM) \ |
| 156 | ((struct sock_filter_int) { \ | 157 | ((struct bpf_insn) { \ |
| 157 | .code = BPF_ALU | BPF_MOV | BPF_K, \ | 158 | .code = BPF_ALU | BPF_MOV | BPF_K, \ |
| 158 | .dst_reg = DST, \ | 159 | .dst_reg = DST, \ |
| 159 | .src_reg = 0, \ | 160 | .src_reg = 0, \ |
| @@ -163,7 +164,7 @@ enum { | |||
| 163 | /* Short form of mov based on type, BPF_X: dst_reg = src_reg, BPF_K: dst_reg = imm32 */ | 164 | /* Short form of mov based on type, BPF_X: dst_reg = src_reg, BPF_K: dst_reg = imm32 */ |
| 164 | 165 | ||
| 165 | #define BPF_MOV64_RAW(TYPE, DST, SRC, IMM) \ | 166 | #define BPF_MOV64_RAW(TYPE, DST, SRC, IMM) \ |
| 166 | ((struct sock_filter_int) { \ | 167 | ((struct bpf_insn) { \ |
| 167 | .code = BPF_ALU64 | BPF_MOV | BPF_SRC(TYPE), \ | 168 | .code = BPF_ALU64 | BPF_MOV | BPF_SRC(TYPE), \ |
| 168 | .dst_reg = DST, \ | 169 | .dst_reg = DST, \ |
| 169 | .src_reg = SRC, \ | 170 | .src_reg = SRC, \ |
| @@ -171,7 +172,7 @@ enum { | |||
| 171 | .imm = IMM }) | 172 | .imm = IMM }) |
| 172 | 173 | ||
| 173 | #define BPF_MOV32_RAW(TYPE, DST, SRC, IMM) \ | 174 | #define BPF_MOV32_RAW(TYPE, DST, SRC, IMM) \ |
| 174 | ((struct sock_filter_int) { \ | 175 | ((struct bpf_insn) { \ |
| 175 | .code = BPF_ALU | BPF_MOV | BPF_SRC(TYPE), \ | 176 | .code = BPF_ALU | BPF_MOV | BPF_SRC(TYPE), \ |
| 176 | .dst_reg = DST, \ | 177 | .dst_reg = DST, \ |
| 177 | .src_reg = SRC, \ | 178 | .src_reg = SRC, \ |
| @@ -181,7 +182,7 @@ enum { | |||
| 181 | /* Direct packet access, R0 = *(uint *) (skb->data + imm32) */ | 182 | /* Direct packet access, R0 = *(uint *) (skb->data + imm32) */ |
| 182 | 183 | ||
| 183 | #define BPF_LD_ABS(SIZE, IMM) \ | 184 | #define BPF_LD_ABS(SIZE, IMM) \ |
| 184 | ((struct sock_filter_int) { \ | 185 | ((struct bpf_insn) { \ |
| 185 | .code = BPF_LD | BPF_SIZE(SIZE) | BPF_ABS, \ | 186 | .code = BPF_LD | BPF_SIZE(SIZE) | BPF_ABS, \ |
| 186 | .dst_reg = 0, \ | 187 | .dst_reg = 0, \ |
| 187 | .src_reg = 0, \ | 188 | .src_reg = 0, \ |
| @@ -191,7 +192,7 @@ enum { | |||
| 191 | /* Indirect packet access, R0 = *(uint *) (skb->data + src_reg + imm32) */ | 192 | /* Indirect packet access, R0 = *(uint *) (skb->data + src_reg + imm32) */ |
| 192 | 193 | ||
| 193 | #define BPF_LD_IND(SIZE, SRC, IMM) \ | 194 | #define BPF_LD_IND(SIZE, SRC, IMM) \ |
| 194 | ((struct sock_filter_int) { \ | 195 | ((struct bpf_insn) { \ |
| 195 | .code = BPF_LD | BPF_SIZE(SIZE) | BPF_IND, \ | 196 | .code = BPF_LD | BPF_SIZE(SIZE) | BPF_IND, \ |
| 196 | .dst_reg = 0, \ | 197 | .dst_reg = 0, \ |
| 197 | .src_reg = SRC, \ | 198 | .src_reg = SRC, \ |
| @@ -201,7 +202,7 @@ enum { | |||
| 201 | /* Memory load, dst_reg = *(uint *) (src_reg + off16) */ | 202 | /* Memory load, dst_reg = *(uint *) (src_reg + off16) */ |
| 202 | 203 | ||
| 203 | #define BPF_LDX_MEM(SIZE, DST, SRC, OFF) \ | 204 | #define BPF_LDX_MEM(SIZE, DST, SRC, OFF) \ |
| 204 | ((struct sock_filter_int) { \ | 205 | ((struct bpf_insn) { \ |
| 205 | .code = BPF_LDX | BPF_SIZE(SIZE) | BPF_MEM, \ | 206 | .code = BPF_LDX | BPF_SIZE(SIZE) | BPF_MEM, \ |
| 206 | .dst_reg = DST, \ | 207 | .dst_reg = DST, \ |
| 207 | .src_reg = SRC, \ | 208 | .src_reg = SRC, \ |
| @@ -211,7 +212,7 @@ enum { | |||
| 211 | /* Memory store, *(uint *) (dst_reg + off16) = src_reg */ | 212 | /* Memory store, *(uint *) (dst_reg + off16) = src_reg */ |
| 212 | 213 | ||
| 213 | #define BPF_STX_MEM(SIZE, DST, SRC, OFF) \ | 214 | #define BPF_STX_MEM(SIZE, DST, SRC, OFF) \ |
| 214 | ((struct sock_filter_int) { \ | 215 | ((struct bpf_insn) { \ |
| 215 | .code = BPF_STX | BPF_SIZE(SIZE) | BPF_MEM, \ | 216 | .code = BPF_STX | BPF_SIZE(SIZE) | BPF_MEM, \ |
| 216 | .dst_reg = DST, \ | 217 | .dst_reg = DST, \ |
| 217 | .src_reg = SRC, \ | 218 | .src_reg = SRC, \ |
| @@ -221,7 +222,7 @@ enum { | |||
| 221 | /* Memory store, *(uint *) (dst_reg + off16) = imm32 */ | 222 | /* Memory store, *(uint *) (dst_reg + off16) = imm32 */ |
| 222 | 223 | ||
| 223 | #define BPF_ST_MEM(SIZE, DST, OFF, IMM) \ | 224 | #define BPF_ST_MEM(SIZE, DST, OFF, IMM) \ |
| 224 | ((struct sock_filter_int) { \ | 225 | ((struct bpf_insn) { \ |
| 225 | .code = BPF_ST | BPF_SIZE(SIZE) | BPF_MEM, \ | 226 | .code = BPF_ST | BPF_SIZE(SIZE) | BPF_MEM, \ |
| 226 | .dst_reg = DST, \ | 227 | .dst_reg = DST, \ |
| 227 | .src_reg = 0, \ | 228 | .src_reg = 0, \ |
| @@ -231,7 +232,7 @@ enum { | |||
| 231 | /* Conditional jumps against registers, if (dst_reg 'op' src_reg) goto pc + off16 */ | 232 | /* Conditional jumps against registers, if (dst_reg 'op' src_reg) goto pc + off16 */ |
| 232 | 233 | ||
| 233 | #define BPF_JMP_REG(OP, DST, SRC, OFF) \ | 234 | #define BPF_JMP_REG(OP, DST, SRC, OFF) \ |
| 234 | ((struct sock_filter_int) { \ | 235 | ((struct bpf_insn) { \ |
| 235 | .code = BPF_JMP | BPF_OP(OP) | BPF_X, \ | 236 | .code = BPF_JMP | BPF_OP(OP) | BPF_X, \ |
| 236 | .dst_reg = DST, \ | 237 | .dst_reg = DST, \ |
| 237 | .src_reg = SRC, \ | 238 | .src_reg = SRC, \ |
| @@ -241,7 +242,7 @@ enum { | |||
| 241 | /* Conditional jumps against immediates, if (dst_reg 'op' imm32) goto pc + off16 */ | 242 | /* Conditional jumps against immediates, if (dst_reg 'op' imm32) goto pc + off16 */ |
| 242 | 243 | ||
| 243 | #define BPF_JMP_IMM(OP, DST, IMM, OFF) \ | 244 | #define BPF_JMP_IMM(OP, DST, IMM, OFF) \ |
| 244 | ((struct sock_filter_int) { \ | 245 | ((struct bpf_insn) { \ |
| 245 | .code = BPF_JMP | BPF_OP(OP) | BPF_K, \ | 246 | .code = BPF_JMP | BPF_OP(OP) | BPF_K, \ |
| 246 | .dst_reg = DST, \ | 247 | .dst_reg = DST, \ |
| 247 | .src_reg = 0, \ | 248 | .src_reg = 0, \ |
| @@ -251,7 +252,7 @@ enum { | |||
| 251 | /* Function call */ | 252 | /* Function call */ |
| 252 | 253 | ||
| 253 | #define BPF_EMIT_CALL(FUNC) \ | 254 | #define BPF_EMIT_CALL(FUNC) \ |
| 254 | ((struct sock_filter_int) { \ | 255 | ((struct bpf_insn) { \ |
| 255 | .code = BPF_JMP | BPF_CALL, \ | 256 | .code = BPF_JMP | BPF_CALL, \ |
| 256 | .dst_reg = 0, \ | 257 | .dst_reg = 0, \ |
| 257 | .src_reg = 0, \ | 258 | .src_reg = 0, \ |
| @@ -261,7 +262,7 @@ enum { | |||
| 261 | /* Raw code statement block */ | 262 | /* Raw code statement block */ |
| 262 | 263 | ||
| 263 | #define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \ | 264 | #define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \ |
| 264 | ((struct sock_filter_int) { \ | 265 | ((struct bpf_insn) { \ |
| 265 | .code = CODE, \ | 266 | .code = CODE, \ |
| 266 | .dst_reg = DST, \ | 267 | .dst_reg = DST, \ |
| 267 | .src_reg = SRC, \ | 268 | .src_reg = SRC, \ |
| @@ -271,7 +272,7 @@ enum { | |||
| 271 | /* Program exit */ | 272 | /* Program exit */ |
| 272 | 273 | ||
| 273 | #define BPF_EXIT_INSN() \ | 274 | #define BPF_EXIT_INSN() \ |
| 274 | ((struct sock_filter_int) { \ | 275 | ((struct bpf_insn) { \ |
| 275 | .code = BPF_JMP | BPF_EXIT, \ | 276 | .code = BPF_JMP | BPF_EXIT, \ |
| 276 | .dst_reg = 0, \ | 277 | .dst_reg = 0, \ |
| 277 | .src_reg = 0, \ | 278 | .src_reg = 0, \ |
| @@ -295,9 +296,10 @@ enum { | |||
| 295 | }) | 296 | }) |
| 296 | 297 | ||
| 297 | /* Macro to invoke filter function. */ | 298 | /* Macro to invoke filter function. */ |
| 298 | #define SK_RUN_FILTER(filter, ctx) (*filter->bpf_func)(ctx, filter->insnsi) | 299 | #define SK_RUN_FILTER(filter, ctx) \ |
| 300 | (*filter->prog->bpf_func)(ctx, filter->prog->insnsi) | ||
| 299 | 301 | ||
| 300 | struct sock_filter_int { | 302 | struct bpf_insn { |
| 301 | __u8 code; /* opcode */ | 303 | __u8 code; /* opcode */ |
| 302 | __u8 dst_reg:4; /* dest register */ | 304 | __u8 dst_reg:4; /* dest register */ |
| 303 | __u8 src_reg:4; /* source register */ | 305 | __u8 src_reg:4; /* source register */ |
| @@ -322,54 +324,58 @@ struct sk_buff; | |||
| 322 | struct sock; | 324 | struct sock; |
| 323 | struct seccomp_data; | 325 | struct seccomp_data; |
| 324 | 326 | ||
| 325 | struct sk_filter { | 327 | struct bpf_prog { |
| 326 | atomic_t refcnt; | ||
| 327 | u32 jited:1, /* Is our filter JIT'ed? */ | 328 | u32 jited:1, /* Is our filter JIT'ed? */ |
| 328 | len:31; /* Number of filter blocks */ | 329 | len:31; /* Number of filter blocks */ |
| 329 | struct sock_fprog_kern *orig_prog; /* Original BPF program */ | 330 | struct sock_fprog_kern *orig_prog; /* Original BPF program */ |
| 330 | struct rcu_head rcu; | ||
| 331 | unsigned int (*bpf_func)(const struct sk_buff *skb, | 331 | unsigned int (*bpf_func)(const struct sk_buff *skb, |
| 332 | const struct sock_filter_int *filter); | 332 | const struct bpf_insn *filter); |
| 333 | union { | 333 | union { |
| 334 | struct sock_filter insns[0]; | 334 | struct sock_filter insns[0]; |
| 335 | struct sock_filter_int insnsi[0]; | 335 | struct bpf_insn insnsi[0]; |
| 336 | struct work_struct work; | 336 | struct work_struct work; |
| 337 | }; | 337 | }; |
| 338 | }; | 338 | }; |
| 339 | 339 | ||
| 340 | static inline unsigned int sk_filter_size(unsigned int proglen) | 340 | struct sk_filter { |
| 341 | atomic_t refcnt; | ||
| 342 | struct rcu_head rcu; | ||
| 343 | struct bpf_prog *prog; | ||
| 344 | }; | ||
| 345 | |||
| 346 | #define BPF_PROG_RUN(filter, ctx) (*filter->bpf_func)(ctx, filter->insnsi) | ||
| 347 | |||
| 348 | static inline unsigned int bpf_prog_size(unsigned int proglen) | ||
| 341 | { | 349 | { |
| 342 | return max(sizeof(struct sk_filter), | 350 | return max(sizeof(struct bpf_prog), |
| 343 | offsetof(struct sk_filter, insns[proglen])); | 351 | offsetof(struct bpf_prog, insns[proglen])); |
| 344 | } | 352 | } |
| 345 | 353 | ||
| 346 | #define sk_filter_proglen(fprog) \ | 354 | #define bpf_classic_proglen(fprog) (fprog->len * sizeof(fprog->filter[0])) |
| 347 | (fprog->len * sizeof(fprog->filter[0])) | ||
| 348 | 355 | ||
| 349 | int sk_filter(struct sock *sk, struct sk_buff *skb); | 356 | int sk_filter(struct sock *sk, struct sk_buff *skb); |
| 350 | 357 | ||
| 351 | void sk_filter_select_runtime(struct sk_filter *fp); | 358 | void bpf_prog_select_runtime(struct bpf_prog *fp); |
| 352 | void sk_filter_free(struct sk_filter *fp); | 359 | void bpf_prog_free(struct bpf_prog *fp); |
| 353 | 360 | ||
| 354 | int sk_convert_filter(struct sock_filter *prog, int len, | 361 | int bpf_convert_filter(struct sock_filter *prog, int len, |
| 355 | struct sock_filter_int *new_prog, int *new_len); | 362 | struct bpf_insn *new_prog, int *new_len); |
| 356 | 363 | ||
| 357 | int sk_unattached_filter_create(struct sk_filter **pfp, | 364 | int bpf_prog_create(struct bpf_prog **pfp, struct sock_fprog_kern *fprog); |
| 358 | struct sock_fprog_kern *fprog); | 365 | void bpf_prog_destroy(struct bpf_prog *fp); |
| 359 | void sk_unattached_filter_destroy(struct sk_filter *fp); | ||
| 360 | 366 | ||
| 361 | int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); | 367 | int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); |
| 362 | int sk_detach_filter(struct sock *sk); | 368 | int sk_detach_filter(struct sock *sk); |
| 363 | 369 | ||
| 364 | int sk_chk_filter(struct sock_filter *filter, unsigned int flen); | 370 | int bpf_check_classic(const struct sock_filter *filter, unsigned int flen); |
| 365 | int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, | 371 | int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, |
| 366 | unsigned int len); | 372 | unsigned int len); |
| 367 | 373 | ||
| 368 | void sk_filter_charge(struct sock *sk, struct sk_filter *fp); | 374 | bool sk_filter_charge(struct sock *sk, struct sk_filter *fp); |
| 369 | void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp); | 375 | void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp); |
| 370 | 376 | ||
| 371 | u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5); | 377 | u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5); |
| 372 | void bpf_int_jit_compile(struct sk_filter *fp); | 378 | void bpf_int_jit_compile(struct bpf_prog *fp); |
| 373 | 379 | ||
| 374 | #define BPF_ANC BIT(15) | 380 | #define BPF_ANC BIT(15) |
| 375 | 381 | ||
| @@ -406,13 +412,25 @@ static inline u16 bpf_anc_helper(const struct sock_filter *ftest) | |||
| 406 | } | 412 | } |
| 407 | } | 413 | } |
| 408 | 414 | ||
| 415 | void *bpf_internal_load_pointer_neg_helper(const struct sk_buff *skb, | ||
| 416 | int k, unsigned int size); | ||
| 417 | |||
| 418 | static inline void *bpf_load_pointer(const struct sk_buff *skb, int k, | ||
| 419 | unsigned int size, void *buffer) | ||
| 420 | { | ||
| 421 | if (k >= 0) | ||
| 422 | return skb_header_pointer(skb, k, size, buffer); | ||
| 423 | |||
| 424 | return bpf_internal_load_pointer_neg_helper(skb, k, size); | ||
| 425 | } | ||
| 426 | |||
| 409 | #ifdef CONFIG_BPF_JIT | 427 | #ifdef CONFIG_BPF_JIT |
| 410 | #include <stdarg.h> | 428 | #include <stdarg.h> |
| 411 | #include <linux/linkage.h> | 429 | #include <linux/linkage.h> |
| 412 | #include <linux/printk.h> | 430 | #include <linux/printk.h> |
| 413 | 431 | ||
| 414 | void bpf_jit_compile(struct sk_filter *fp); | 432 | void bpf_jit_compile(struct bpf_prog *fp); |
| 415 | void bpf_jit_free(struct sk_filter *fp); | 433 | void bpf_jit_free(struct bpf_prog *fp); |
| 416 | 434 | ||
| 417 | static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen, | 435 | static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen, |
| 418 | u32 pass, void *image) | 436 | u32 pass, void *image) |
| @@ -426,11 +444,11 @@ static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen, | |||
| 426 | #else | 444 | #else |
| 427 | #include <linux/slab.h> | 445 | #include <linux/slab.h> |
| 428 | 446 | ||
| 429 | static inline void bpf_jit_compile(struct sk_filter *fp) | 447 | static inline void bpf_jit_compile(struct bpf_prog *fp) |
| 430 | { | 448 | { |
| 431 | } | 449 | } |
| 432 | 450 | ||
| 433 | static inline void bpf_jit_free(struct sk_filter *fp) | 451 | static inline void bpf_jit_free(struct bpf_prog *fp) |
| 434 | { | 452 | { |
| 435 | kfree(fp); | 453 | kfree(fp); |
| 436 | } | 454 | } |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 59529330efd6..5c41c5e75b5c 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
| @@ -45,6 +45,8 @@ int request_firmware_nowait( | |||
| 45 | struct module *module, bool uevent, | 45 | struct module *module, bool uevent, |
| 46 | const char *name, struct device *device, gfp_t gfp, void *context, | 46 | const char *name, struct device *device, gfp_t gfp, void *context, |
| 47 | void (*cont)(const struct firmware *fw, void *context)); | 47 | void (*cont)(const struct firmware *fw, void *context)); |
| 48 | int request_firmware_direct(const struct firmware **fw, const char *name, | ||
| 49 | struct device *device); | ||
| 48 | 50 | ||
| 49 | void release_firmware(const struct firmware *fw); | 51 | void release_firmware(const struct firmware *fw); |
| 50 | #else | 52 | #else |
| @@ -66,13 +68,12 @@ static inline void release_firmware(const struct firmware *fw) | |||
| 66 | { | 68 | { |
| 67 | } | 69 | } |
| 68 | 70 | ||
| 69 | #endif | 71 | static inline int request_firmware_direct(const struct firmware **fw, |
| 72 | const char *name, | ||
| 73 | struct device *device) | ||
| 74 | { | ||
| 75 | return -EINVAL; | ||
| 76 | } | ||
| 70 | 77 | ||
| 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 | 78 | #endif |
| 77 | |||
| 78 | #endif | 79 | #endif |
diff --git a/include/linux/fs.h b/include/linux/fs.h index e11d60cc867b..2daccaf4b547 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -833,7 +833,7 @@ static inline struct file *get_file(struct file *f) | |||
| 833 | * | 833 | * |
| 834 | * Lockd stuffs a "host" pointer into this. | 834 | * Lockd stuffs a "host" pointer into this. |
| 835 | */ | 835 | */ |
| 836 | typedef struct files_struct *fl_owner_t; | 836 | typedef void *fl_owner_t; |
| 837 | 837 | ||
| 838 | struct file_lock_operations { | 838 | struct file_lock_operations { |
| 839 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | 839 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 404a686a3644..6bb5e3f2a3b4 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -33,8 +33,7 @@ | |||
| 33 | * features, then it must call an indirect function that | 33 | * features, then it must call an indirect function that |
| 34 | * does. Or at least does enough to prevent any unwelcomed side effects. | 34 | * does. Or at least does enough to prevent any unwelcomed side effects. |
| 35 | */ | 35 | */ |
| 36 | #if !defined(CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST) || \ | 36 | #if !ARCH_SUPPORTS_FTRACE_OPS |
| 37 | !ARCH_SUPPORTS_FTRACE_OPS | ||
| 38 | # define FTRACE_FORCE_LIST_FUNC 1 | 37 | # define FTRACE_FORCE_LIST_FUNC 1 |
| 39 | #else | 38 | #else |
| 40 | # define FTRACE_FORCE_LIST_FUNC 0 | 39 | # define FTRACE_FORCE_LIST_FUNC 0 |
| @@ -118,17 +117,18 @@ struct ftrace_ops { | |||
| 118 | ftrace_func_t func; | 117 | ftrace_func_t func; |
| 119 | struct ftrace_ops *next; | 118 | struct ftrace_ops *next; |
| 120 | unsigned long flags; | 119 | unsigned long flags; |
| 121 | int __percpu *disabled; | ||
| 122 | void *private; | 120 | void *private; |
| 121 | int __percpu *disabled; | ||
| 123 | #ifdef CONFIG_DYNAMIC_FTRACE | 122 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 123 | int nr_trampolines; | ||
| 124 | struct ftrace_hash *notrace_hash; | 124 | struct ftrace_hash *notrace_hash; |
| 125 | struct ftrace_hash *filter_hash; | 125 | struct ftrace_hash *filter_hash; |
| 126 | struct ftrace_hash *tramp_hash; | ||
| 126 | struct mutex regex_lock; | 127 | struct mutex regex_lock; |
| 128 | unsigned long trampoline; | ||
| 127 | #endif | 129 | #endif |
| 128 | }; | 130 | }; |
| 129 | 131 | ||
| 130 | extern int function_trace_stop; | ||
| 131 | |||
| 132 | /* | 132 | /* |
| 133 | * Type of the current tracing. | 133 | * Type of the current tracing. |
| 134 | */ | 134 | */ |
| @@ -140,32 +140,6 @@ enum ftrace_tracing_type_t { | |||
| 140 | /* Current tracing type, default is FTRACE_TYPE_ENTER */ | 140 | /* Current tracing type, default is FTRACE_TYPE_ENTER */ |
| 141 | extern enum ftrace_tracing_type_t ftrace_tracing_type; | 141 | extern enum ftrace_tracing_type_t ftrace_tracing_type; |
| 142 | 142 | ||
| 143 | /** | ||
| 144 | * ftrace_stop - stop function tracer. | ||
| 145 | * | ||
| 146 | * A quick way to stop the function tracer. Note this an on off switch, | ||
| 147 | * it is not something that is recursive like preempt_disable. | ||
| 148 | * This does not disable the calling of mcount, it only stops the | ||
| 149 | * calling of functions from mcount. | ||
| 150 | */ | ||
| 151 | static inline void ftrace_stop(void) | ||
| 152 | { | ||
| 153 | function_trace_stop = 1; | ||
| 154 | } | ||
| 155 | |||
| 156 | /** | ||
| 157 | * ftrace_start - start the function tracer. | ||
| 158 | * | ||
| 159 | * This function is the inverse of ftrace_stop. This does not enable | ||
| 160 | * the function tracing if the function tracer is disabled. This only | ||
| 161 | * sets the function tracer flag to continue calling the functions | ||
| 162 | * from mcount. | ||
| 163 | */ | ||
| 164 | static inline void ftrace_start(void) | ||
| 165 | { | ||
| 166 | function_trace_stop = 0; | ||
| 167 | } | ||
| 168 | |||
| 169 | /* | 143 | /* |
| 170 | * The ftrace_ops must be a static and should also | 144 | * The ftrace_ops must be a static and should also |
| 171 | * be read_mostly. These functions do modify read_mostly variables | 145 | * be read_mostly. These functions do modify read_mostly variables |
| @@ -242,8 +216,6 @@ static inline int ftrace_nr_registered_ops(void) | |||
| 242 | } | 216 | } |
| 243 | static inline void clear_ftrace_function(void) { } | 217 | static inline void clear_ftrace_function(void) { } |
| 244 | static inline void ftrace_kill(void) { } | 218 | static inline void ftrace_kill(void) { } |
| 245 | static inline void ftrace_stop(void) { } | ||
| 246 | static inline void ftrace_start(void) { } | ||
| 247 | #endif /* CONFIG_FUNCTION_TRACER */ | 219 | #endif /* CONFIG_FUNCTION_TRACER */ |
| 248 | 220 | ||
| 249 | #ifdef CONFIG_STACK_TRACER | 221 | #ifdef CONFIG_STACK_TRACER |
| @@ -317,13 +289,20 @@ extern int ftrace_nr_registered_ops(void); | |||
| 317 | * from tracing that function. | 289 | * from tracing that function. |
| 318 | */ | 290 | */ |
| 319 | enum { | 291 | enum { |
| 320 | FTRACE_FL_ENABLED = (1UL << 29), | 292 | FTRACE_FL_ENABLED = (1UL << 31), |
| 321 | FTRACE_FL_REGS = (1UL << 30), | 293 | FTRACE_FL_REGS = (1UL << 30), |
| 322 | FTRACE_FL_REGS_EN = (1UL << 31) | 294 | FTRACE_FL_REGS_EN = (1UL << 29), |
| 295 | FTRACE_FL_TRAMP = (1UL << 28), | ||
| 296 | FTRACE_FL_TRAMP_EN = (1UL << 27), | ||
| 323 | }; | 297 | }; |
| 324 | 298 | ||
| 325 | #define FTRACE_FL_MASK (0x7UL << 29) | 299 | #define FTRACE_REF_MAX_SHIFT 27 |
| 326 | #define FTRACE_REF_MAX ((1UL << 29) - 1) | 300 | #define FTRACE_FL_BITS 5 |
| 301 | #define FTRACE_FL_MASKED_BITS ((1UL << FTRACE_FL_BITS) - 1) | ||
| 302 | #define FTRACE_FL_MASK (FTRACE_FL_MASKED_BITS << FTRACE_REF_MAX_SHIFT) | ||
| 303 | #define FTRACE_REF_MAX ((1UL << FTRACE_REF_MAX_SHIFT) - 1) | ||
| 304 | |||
| 305 | #define ftrace_rec_count(rec) ((rec)->flags & ~FTRACE_FL_MASK) | ||
| 327 | 306 | ||
| 328 | struct dyn_ftrace { | 307 | struct dyn_ftrace { |
| 329 | unsigned long ip; /* address of mcount call-site */ | 308 | unsigned long ip; /* address of mcount call-site */ |
| @@ -431,6 +410,10 @@ void ftrace_modify_all_code(int command); | |||
| 431 | #define FTRACE_ADDR ((unsigned long)ftrace_caller) | 410 | #define FTRACE_ADDR ((unsigned long)ftrace_caller) |
| 432 | #endif | 411 | #endif |
| 433 | 412 | ||
| 413 | #ifndef FTRACE_GRAPH_ADDR | ||
| 414 | #define FTRACE_GRAPH_ADDR ((unsigned long)ftrace_graph_caller) | ||
| 415 | #endif | ||
| 416 | |||
| 434 | #ifndef FTRACE_REGS_ADDR | 417 | #ifndef FTRACE_REGS_ADDR |
| 435 | #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS | 418 | #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS |
| 436 | # define FTRACE_REGS_ADDR ((unsigned long)ftrace_regs_caller) | 419 | # define FTRACE_REGS_ADDR ((unsigned long)ftrace_regs_caller) |
| @@ -439,6 +422,16 @@ void ftrace_modify_all_code(int command); | |||
| 439 | #endif | 422 | #endif |
| 440 | #endif | 423 | #endif |
| 441 | 424 | ||
| 425 | /* | ||
| 426 | * If an arch would like functions that are only traced | ||
| 427 | * by the function graph tracer to jump directly to its own | ||
| 428 | * trampoline, then they can define FTRACE_GRAPH_TRAMP_ADDR | ||
| 429 | * to be that address to jump to. | ||
| 430 | */ | ||
| 431 | #ifndef FTRACE_GRAPH_TRAMP_ADDR | ||
| 432 | #define FTRACE_GRAPH_TRAMP_ADDR ((unsigned long) 0) | ||
| 433 | #endif | ||
| 434 | |||
| 442 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 435 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
| 443 | extern void ftrace_graph_caller(void); | 436 | extern void ftrace_graph_caller(void); |
| 444 | extern int ftrace_enable_ftrace_graph_caller(void); | 437 | extern int ftrace_enable_ftrace_graph_caller(void); |
| @@ -736,6 +729,7 @@ extern char __irqentry_text_end[]; | |||
| 736 | extern int register_ftrace_graph(trace_func_graph_ret_t retfunc, | 729 | extern int register_ftrace_graph(trace_func_graph_ret_t retfunc, |
| 737 | trace_func_graph_ent_t entryfunc); | 730 | trace_func_graph_ent_t entryfunc); |
| 738 | 731 | ||
| 732 | extern bool ftrace_graph_is_dead(void); | ||
| 739 | extern void ftrace_graph_stop(void); | 733 | extern void ftrace_graph_stop(void); |
| 740 | 734 | ||
| 741 | /* The current handlers in use */ | 735 | /* The current handlers in use */ |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index cff3106ffe2c..06c6faa9e5cc 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -272,7 +272,6 @@ struct ftrace_event_call { | |||
| 272 | struct trace_event event; | 272 | struct trace_event event; |
| 273 | const char *print_fmt; | 273 | const char *print_fmt; |
| 274 | struct event_filter *filter; | 274 | struct event_filter *filter; |
| 275 | struct list_head *files; | ||
| 276 | void *mod; | 275 | void *mod; |
| 277 | void *data; | 276 | void *data; |
| 278 | /* | 277 | /* |
| @@ -404,8 +403,6 @@ enum event_trigger_type { | |||
| 404 | ETT_EVENT_ENABLE = (1 << 3), | 403 | ETT_EVENT_ENABLE = (1 << 3), |
| 405 | }; | 404 | }; |
| 406 | 405 | ||
| 407 | extern void destroy_preds(struct ftrace_event_file *file); | ||
| 408 | extern void destroy_call_preds(struct ftrace_event_call *call); | ||
| 409 | extern int filter_match_preds(struct event_filter *filter, void *rec); | 406 | extern int filter_match_preds(struct event_filter *filter, void *rec); |
| 410 | 407 | ||
| 411 | extern int filter_check_discard(struct ftrace_event_file *file, void *rec, | 408 | extern int filter_check_discard(struct ftrace_event_file *file, void *rec, |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index e7a8d3fa91d5..a036d058a249 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
| @@ -165,6 +165,7 @@ enum hrtimer_base_type { | |||
| 165 | * struct hrtimer_cpu_base - the per cpu clock bases | 165 | * struct hrtimer_cpu_base - the per cpu clock bases |
| 166 | * @lock: lock protecting the base and associated clock bases | 166 | * @lock: lock protecting the base and associated clock bases |
| 167 | * and timers | 167 | * and timers |
| 168 | * @cpu: cpu number | ||
| 168 | * @active_bases: Bitfield to mark bases with active timers | 169 | * @active_bases: Bitfield to mark bases with active timers |
| 169 | * @clock_was_set: Indicates that clock was set from irq context. | 170 | * @clock_was_set: Indicates that clock was set from irq context. |
| 170 | * @expires_next: absolute time of the next event which was scheduled | 171 | * @expires_next: absolute time of the next event which was scheduled |
| @@ -179,6 +180,7 @@ enum hrtimer_base_type { | |||
| 179 | */ | 180 | */ |
| 180 | struct hrtimer_cpu_base { | 181 | struct hrtimer_cpu_base { |
| 181 | raw_spinlock_t lock; | 182 | raw_spinlock_t lock; |
| 183 | unsigned int cpu; | ||
| 182 | unsigned int active_bases; | 184 | unsigned int active_bases; |
| 183 | unsigned int clock_was_set; | 185 | unsigned int clock_was_set; |
| 184 | #ifdef CONFIG_HIGH_RES_TIMERS | 186 | #ifdef CONFIG_HIGH_RES_TIMERS |
| @@ -324,14 +326,6 @@ static inline void timerfd_clock_was_set(void) { } | |||
| 324 | #endif | 326 | #endif |
| 325 | extern void hrtimers_resume(void); | 327 | extern void hrtimers_resume(void); |
| 326 | 328 | ||
| 327 | extern ktime_t ktime_get(void); | ||
| 328 | extern ktime_t ktime_get_real(void); | ||
| 329 | extern ktime_t ktime_get_boottime(void); | ||
| 330 | extern ktime_t ktime_get_monotonic_offset(void); | ||
| 331 | extern ktime_t ktime_get_clocktai(void); | ||
| 332 | extern ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot, | ||
| 333 | ktime_t *offs_tai); | ||
| 334 | |||
| 335 | DECLARE_PER_CPU(struct tick_device, tick_cpu_device); | 329 | DECLARE_PER_CPU(struct tick_device, tick_cpu_device); |
| 336 | 330 | ||
| 337 | 331 | ||
| @@ -452,12 +446,6 @@ extern void hrtimer_run_pending(void); | |||
| 452 | /* Bootup initialization: */ | 446 | /* Bootup initialization: */ |
| 453 | extern void __init hrtimers_init(void); | 447 | extern void __init hrtimers_init(void); |
| 454 | 448 | ||
| 455 | #if BITS_PER_LONG < 64 | ||
| 456 | extern u64 ktime_divns(const ktime_t kt, s64 div); | ||
| 457 | #else /* BITS_PER_LONG < 64 */ | ||
| 458 | # define ktime_divns(kt, div) (u64)((kt).tv64 / (div)) | ||
| 459 | #endif | ||
| 460 | |||
| 461 | /* Show pending timers: */ | 449 | /* Show pending timers: */ |
| 462 | extern void sysrq_timer_list_show(void); | 450 | extern void sysrq_timer_list_show(void); |
| 463 | 451 | ||
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 255cd5cc0754..a23c096b3080 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -80,6 +80,7 @@ int dequeue_hwpoisoned_huge_page(struct page *page); | |||
| 80 | bool isolate_huge_page(struct page *page, struct list_head *list); | 80 | bool isolate_huge_page(struct page *page, struct list_head *list); |
| 81 | void putback_active_hugepage(struct page *page); | 81 | void putback_active_hugepage(struct page *page); |
| 82 | bool is_hugepage_active(struct page *page); | 82 | bool is_hugepage_active(struct page *page); |
| 83 | void free_huge_page(struct page *page); | ||
| 83 | 84 | ||
| 84 | #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE | 85 | #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE |
| 85 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); | 86 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); |
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h index b4b0eef5fddf..914bb08cd738 100644 --- a/include/linux/hw_random.h +++ b/include/linux/hw_random.h | |||
| @@ -29,6 +29,8 @@ | |||
| 29 | * @read: New API. drivers can fill up to max bytes of data | 29 | * @read: New API. drivers can fill up to max bytes of data |
| 30 | * into the buffer. The buffer is aligned for any type. | 30 | * into the buffer. The buffer is aligned for any type. |
| 31 | * @priv: Private data, for use by the RNG driver. | 31 | * @priv: Private data, for use by the RNG driver. |
| 32 | * @quality: Estimation of true entropy in RNG's bitstream | ||
| 33 | * (per mill). | ||
| 32 | */ | 34 | */ |
| 33 | struct hwrng { | 35 | struct hwrng { |
| 34 | const char *name; | 36 | const char *name; |
| @@ -38,6 +40,7 @@ struct hwrng { | |||
| 38 | int (*data_read)(struct hwrng *rng, u32 *data); | 40 | int (*data_read)(struct hwrng *rng, u32 *data); |
| 39 | int (*read)(struct hwrng *rng, void *data, size_t max, bool wait); | 41 | int (*read)(struct hwrng *rng, void *data, size_t max, bool wait); |
| 40 | unsigned long priv; | 42 | unsigned long priv; |
| 43 | unsigned short quality; | ||
| 41 | 44 | ||
| 42 | /* internal. */ | 45 | /* internal. */ |
| 43 | struct list_head list; | 46 | struct list_head list; |
| @@ -47,5 +50,7 @@ struct hwrng { | |||
| 47 | extern int hwrng_register(struct hwrng *rng); | 50 | extern int hwrng_register(struct hwrng *rng); |
| 48 | /** Unregister a Hardware Random Number Generator driver. */ | 51 | /** Unregister a Hardware Random Number Generator driver. */ |
| 49 | extern void hwrng_unregister(struct hwrng *rng); | 52 | extern void hwrng_unregister(struct hwrng *rng); |
| 53 | /** Feed random bits into the pool. */ | ||
| 54 | extern void add_hwgenerator_randomness(const char *buffer, size_t count, size_t entropy); | ||
| 50 | 55 | ||
| 51 | #endif /* LINUX_HWRANDOM_H_ */ | 56 | #endif /* LINUX_HWRANDOM_H_ */ |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 6bff13f74050..63ab3873c5ed 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
| @@ -1001,6 +1001,26 @@ struct ieee80211_vendor_ie { | |||
| 1001 | u8 oui_type; | 1001 | u8 oui_type; |
| 1002 | } __packed; | 1002 | } __packed; |
| 1003 | 1003 | ||
| 1004 | struct ieee80211_wmm_ac_param { | ||
| 1005 | u8 aci_aifsn; /* AIFSN, ACM, ACI */ | ||
| 1006 | u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */ | ||
| 1007 | __le16 txop_limit; | ||
| 1008 | } __packed; | ||
| 1009 | |||
| 1010 | struct ieee80211_wmm_param_ie { | ||
| 1011 | u8 element_id; /* Element ID: 221 (0xdd); */ | ||
| 1012 | u8 len; /* Length: 24 */ | ||
| 1013 | /* required fields for WMM version 1 */ | ||
| 1014 | u8 oui[3]; /* 00:50:f2 */ | ||
| 1015 | u8 oui_type; /* 2 */ | ||
| 1016 | u8 oui_subtype; /* 1 */ | ||
| 1017 | u8 version; /* 1 for WMM version 1.0 */ | ||
| 1018 | u8 qos_info; /* AP/STA specific QoS info */ | ||
| 1019 | u8 reserved; /* 0 */ | ||
| 1020 | /* AC_BE, AC_BK, AC_VI, AC_VO */ | ||
| 1021 | struct ieee80211_wmm_ac_param ac[4]; | ||
| 1022 | } __packed; | ||
| 1023 | |||
| 1004 | /* Control frames */ | 1024 | /* Control frames */ |
| 1005 | struct ieee80211_rts { | 1025 | struct ieee80211_rts { |
| 1006 | __le16 frame_control; | 1026 | __le16 frame_control; |
| @@ -1621,6 +1641,9 @@ enum ieee80211_reasoncode { | |||
| 1621 | WLAN_REASON_INVALID_RSN_IE_CAP = 22, | 1641 | WLAN_REASON_INVALID_RSN_IE_CAP = 22, |
| 1622 | WLAN_REASON_IEEE8021X_FAILED = 23, | 1642 | WLAN_REASON_IEEE8021X_FAILED = 23, |
| 1623 | WLAN_REASON_CIPHER_SUITE_REJECTED = 24, | 1643 | WLAN_REASON_CIPHER_SUITE_REJECTED = 24, |
| 1644 | /* TDLS (802.11z) */ | ||
| 1645 | WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE = 25, | ||
| 1646 | WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED = 26, | ||
| 1624 | /* 802.11e */ | 1647 | /* 802.11e */ |
| 1625 | WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32, | 1648 | WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32, |
| 1626 | WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33, | 1649 | WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33, |
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index fd22789d7b2e..808dcb8cc04f 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h | |||
| @@ -36,8 +36,28 @@ extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __use | |||
| 36 | 36 | ||
| 37 | typedef int br_should_route_hook_t(struct sk_buff *skb); | 37 | typedef int br_should_route_hook_t(struct sk_buff *skb); |
| 38 | extern br_should_route_hook_t __rcu *br_should_route_hook; | 38 | extern br_should_route_hook_t __rcu *br_should_route_hook; |
| 39 | |||
| 40 | #if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING) | ||
| 39 | int br_multicast_list_adjacent(struct net_device *dev, | 41 | int br_multicast_list_adjacent(struct net_device *dev, |
| 40 | struct list_head *br_ip_list); | 42 | struct list_head *br_ip_list); |
| 43 | bool br_multicast_has_querier_anywhere(struct net_device *dev, int proto); | ||
| 41 | bool br_multicast_has_querier_adjacent(struct net_device *dev, int proto); | 44 | bool br_multicast_has_querier_adjacent(struct net_device *dev, int proto); |
| 45 | #else | ||
| 46 | static inline int br_multicast_list_adjacent(struct net_device *dev, | ||
| 47 | struct list_head *br_ip_list) | ||
| 48 | { | ||
| 49 | return 0; | ||
| 50 | } | ||
| 51 | static inline bool br_multicast_has_querier_anywhere(struct net_device *dev, | ||
| 52 | int proto) | ||
| 53 | { | ||
| 54 | return false; | ||
| 55 | } | ||
| 56 | static inline bool br_multicast_has_querier_adjacent(struct net_device *dev, | ||
| 57 | int proto) | ||
| 58 | { | ||
| 59 | return false; | ||
| 60 | } | ||
| 61 | #endif | ||
| 42 | 62 | ||
| 43 | #endif | 63 | #endif |
diff --git a/include/linux/iio/accel/kxcjk_1013.h b/include/linux/iio/accel/kxcjk_1013.h new file mode 100644 index 000000000000..fd1d540ea62d --- /dev/null +++ b/include/linux/iio/accel/kxcjk_1013.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * KXCJK-1013 3-axis accelerometer Interface | ||
| 3 | * Copyright (c) 2014, Intel Corporation. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms and conditions of the GNU General Public License, | ||
| 7 | * version 2, as published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __IIO_KXCJK_1013_H__ | ||
| 16 | #define __IIO_KXCJK_1013_H__ | ||
| 17 | |||
| 18 | struct kxcjk_1013_platform_data { | ||
| 19 | bool active_high_intr; | ||
| 20 | }; | ||
| 21 | |||
| 22 | #endif | ||
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h index 96f51f0e0096..d8257ab60bac 100644 --- a/include/linux/iio/common/st_sensors.h +++ b/include/linux/iio/common/st_sensors.h | |||
| @@ -47,6 +47,7 @@ | |||
| 47 | .type = device_type, \ | 47 | .type = device_type, \ |
| 48 | .modified = mod, \ | 48 | .modified = mod, \ |
| 49 | .info_mask_separate = mask, \ | 49 | .info_mask_separate = mask, \ |
| 50 | .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ | ||
| 50 | .scan_index = index, \ | 51 | .scan_index = index, \ |
| 51 | .channel2 = ch2, \ | 52 | .channel2 = ch2, \ |
| 52 | .address = addr, \ | 53 | .address = addr, \ |
| @@ -59,11 +60,6 @@ | |||
| 59 | }, \ | 60 | }, \ |
| 60 | } | 61 | } |
| 61 | 62 | ||
| 62 | #define ST_SENSOR_DEV_ATTR_SAMP_FREQ() \ | ||
| 63 | IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO, \ | ||
| 64 | st_sensors_sysfs_get_sampling_frequency, \ | ||
| 65 | st_sensors_sysfs_set_sampling_frequency) | ||
| 66 | |||
| 67 | #define ST_SENSORS_DEV_ATTR_SAMP_FREQ_AVAIL() \ | 63 | #define ST_SENSORS_DEV_ATTR_SAMP_FREQ_AVAIL() \ |
| 68 | IIO_DEV_ATTR_SAMP_FREQ_AVAIL( \ | 64 | IIO_DEV_ATTR_SAMP_FREQ_AVAIL( \ |
| 69 | st_sensors_sysfs_sampling_frequency_avail) | 65 | st_sensors_sysfs_sampling_frequency_avail) |
| @@ -285,12 +281,6 @@ int st_sensors_read_info_raw(struct iio_dev *indio_dev, | |||
| 285 | int st_sensors_check_device_support(struct iio_dev *indio_dev, | 281 | int st_sensors_check_device_support(struct iio_dev *indio_dev, |
| 286 | int num_sensors_list, const struct st_sensors *sensors); | 282 | int num_sensors_list, const struct st_sensors *sensors); |
| 287 | 283 | ||
| 288 | ssize_t st_sensors_sysfs_get_sampling_frequency(struct device *dev, | ||
| 289 | struct device_attribute *attr, char *buf); | ||
| 290 | |||
| 291 | ssize_t st_sensors_sysfs_set_sampling_frequency(struct device *dev, | ||
| 292 | struct device_attribute *attr, const char *buf, size_t size); | ||
| 293 | |||
| 294 | ssize_t st_sensors_sysfs_sampling_frequency_avail(struct device *dev, | 284 | ssize_t st_sensors_sysfs_sampling_frequency_avail(struct device *dev, |
| 295 | struct device_attribute *attr, char *buf); | 285 | struct device_attribute *attr, char *buf); |
| 296 | 286 | ||
diff --git a/include/linux/iio/common/st_sensors_i2c.h b/include/linux/iio/common/st_sensors_i2c.h index 67d845385ae2..1796af093368 100644 --- a/include/linux/iio/common/st_sensors_i2c.h +++ b/include/linux/iio/common/st_sensors_i2c.h | |||
| @@ -13,8 +13,19 @@ | |||
| 13 | 13 | ||
| 14 | #include <linux/i2c.h> | 14 | #include <linux/i2c.h> |
| 15 | #include <linux/iio/common/st_sensors.h> | 15 | #include <linux/iio/common/st_sensors.h> |
| 16 | #include <linux/of.h> | ||
| 16 | 17 | ||
| 17 | void st_sensors_i2c_configure(struct iio_dev *indio_dev, | 18 | void st_sensors_i2c_configure(struct iio_dev *indio_dev, |
| 18 | struct i2c_client *client, struct st_sensor_data *sdata); | 19 | struct i2c_client *client, struct st_sensor_data *sdata); |
| 19 | 20 | ||
| 21 | #ifdef CONFIG_OF | ||
| 22 | void st_sensors_of_i2c_probe(struct i2c_client *client, | ||
| 23 | const struct of_device_id *match); | ||
| 24 | #else | ||
| 25 | static inline void st_sensors_of_i2c_probe(struct i2c_client *client, | ||
| 26 | const struct of_device_id *match) | ||
| 27 | { | ||
| 28 | } | ||
| 29 | #endif | ||
| 30 | |||
| 20 | #endif /* ST_SENSORS_I2C_H */ | 31 | #endif /* ST_SENSORS_I2C_H */ |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index ccde91725f98..15dc6bc2bdd2 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
| @@ -277,14 +277,7 @@ static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, | |||
| 277 | **/ | 277 | **/ |
| 278 | static inline s64 iio_get_time_ns(void) | 278 | static inline s64 iio_get_time_ns(void) |
| 279 | { | 279 | { |
| 280 | struct timespec ts; | 280 | return ktime_get_real_ns(); |
| 281 | /* | ||
| 282 | * calls getnstimeofday. | ||
| 283 | * If hrtimers then up to ns accurate, if not microsecond. | ||
| 284 | */ | ||
| 285 | ktime_get_real_ts(&ts); | ||
| 286 | |||
| 287 | return timespec_to_ns(&ts); | ||
| 288 | } | 281 | } |
| 289 | 282 | ||
| 290 | /* Device operating modes */ | 283 | /* Device operating modes */ |
diff --git a/include/linux/iio/imu/adis.h b/include/linux/iio/imu/adis.h index b665dc7f017b..fa2d01ef8f55 100644 --- a/include/linux/iio/imu/adis.h +++ b/include/linux/iio/imu/adis.h | |||
| @@ -157,13 +157,14 @@ int adis_single_conversion(struct iio_dev *indio_dev, | |||
| 157 | const struct iio_chan_spec *chan, unsigned int error_mask, | 157 | const struct iio_chan_spec *chan, unsigned int error_mask, |
| 158 | int *val); | 158 | int *val); |
| 159 | 159 | ||
| 160 | #define ADIS_VOLTAGE_CHAN(addr, si, chan, name, bits) { \ | 160 | #define ADIS_VOLTAGE_CHAN(addr, si, chan, name, info_all, bits) { \ |
| 161 | .type = IIO_VOLTAGE, \ | 161 | .type = IIO_VOLTAGE, \ |
| 162 | .indexed = 1, \ | 162 | .indexed = 1, \ |
| 163 | .channel = (chan), \ | 163 | .channel = (chan), \ |
| 164 | .extend_name = name, \ | 164 | .extend_name = name, \ |
| 165 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ | 165 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
| 166 | BIT(IIO_CHAN_INFO_SCALE), \ | 166 | BIT(IIO_CHAN_INFO_SCALE), \ |
| 167 | .info_mask_shared_by_all = info_all, \ | ||
| 167 | .address = (addr), \ | 168 | .address = (addr), \ |
| 168 | .scan_index = (si), \ | 169 | .scan_index = (si), \ |
| 169 | .scan_type = { \ | 170 | .scan_type = { \ |
| @@ -174,19 +175,20 @@ int adis_single_conversion(struct iio_dev *indio_dev, | |||
| 174 | }, \ | 175 | }, \ |
| 175 | } | 176 | } |
| 176 | 177 | ||
| 177 | #define ADIS_SUPPLY_CHAN(addr, si, bits) \ | 178 | #define ADIS_SUPPLY_CHAN(addr, si, info_all, bits) \ |
| 178 | ADIS_VOLTAGE_CHAN(addr, si, 0, "supply", bits) | 179 | ADIS_VOLTAGE_CHAN(addr, si, 0, "supply", info_all, bits) |
| 179 | 180 | ||
| 180 | #define ADIS_AUX_ADC_CHAN(addr, si, bits) \ | 181 | #define ADIS_AUX_ADC_CHAN(addr, si, info_all, bits) \ |
| 181 | ADIS_VOLTAGE_CHAN(addr, si, 1, NULL, bits) | 182 | ADIS_VOLTAGE_CHAN(addr, si, 1, NULL, info_all, bits) |
| 182 | 183 | ||
| 183 | #define ADIS_TEMP_CHAN(addr, si, bits) { \ | 184 | #define ADIS_TEMP_CHAN(addr, si, info_all, bits) { \ |
| 184 | .type = IIO_TEMP, \ | 185 | .type = IIO_TEMP, \ |
| 185 | .indexed = 1, \ | 186 | .indexed = 1, \ |
| 186 | .channel = 0, \ | 187 | .channel = 0, \ |
| 187 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ | 188 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
| 188 | BIT(IIO_CHAN_INFO_SCALE) | \ | 189 | BIT(IIO_CHAN_INFO_SCALE) | \ |
| 189 | BIT(IIO_CHAN_INFO_OFFSET), \ | 190 | BIT(IIO_CHAN_INFO_OFFSET), \ |
| 191 | .info_mask_shared_by_all = info_all, \ | ||
| 190 | .address = (addr), \ | 192 | .address = (addr), \ |
| 191 | .scan_index = (si), \ | 193 | .scan_index = (si), \ |
| 192 | .scan_type = { \ | 194 | .scan_type = { \ |
| @@ -197,13 +199,14 @@ int adis_single_conversion(struct iio_dev *indio_dev, | |||
| 197 | }, \ | 199 | }, \ |
| 198 | } | 200 | } |
| 199 | 201 | ||
| 200 | #define ADIS_MOD_CHAN(_type, mod, addr, si, info_sep, bits) { \ | 202 | #define ADIS_MOD_CHAN(_type, mod, addr, si, info_sep, info_all, bits) { \ |
| 201 | .type = (_type), \ | 203 | .type = (_type), \ |
| 202 | .modified = 1, \ | 204 | .modified = 1, \ |
| 203 | .channel2 = IIO_MOD_ ## mod, \ | 205 | .channel2 = IIO_MOD_ ## mod, \ |
| 204 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ | 206 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
| 205 | info_sep, \ | 207 | info_sep, \ |
| 206 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ | 208 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ |
| 209 | .info_mask_shared_by_all = info_all, \ | ||
| 207 | .address = (addr), \ | 210 | .address = (addr), \ |
| 208 | .scan_index = (si), \ | 211 | .scan_index = (si), \ |
| 209 | .scan_type = { \ | 212 | .scan_type = { \ |
| @@ -214,17 +217,17 @@ int adis_single_conversion(struct iio_dev *indio_dev, | |||
| 214 | }, \ | 217 | }, \ |
| 215 | } | 218 | } |
| 216 | 219 | ||
| 217 | #define ADIS_ACCEL_CHAN(mod, addr, si, info_sep, bits) \ | 220 | #define ADIS_ACCEL_CHAN(mod, addr, si, info_sep, info_all, bits) \ |
| 218 | ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info_sep, bits) | 221 | ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info_sep, info_all, bits) |
| 219 | 222 | ||
| 220 | #define ADIS_GYRO_CHAN(mod, addr, si, info_sep, bits) \ | 223 | #define ADIS_GYRO_CHAN(mod, addr, si, info_sep, info_all, bits) \ |
| 221 | ADIS_MOD_CHAN(IIO_ANGL_VEL, mod, addr, si, info_sep, bits) | 224 | ADIS_MOD_CHAN(IIO_ANGL_VEL, mod, addr, si, info_sep, info_all, bits) |
| 222 | 225 | ||
| 223 | #define ADIS_INCLI_CHAN(mod, addr, si, info_sep, bits) \ | 226 | #define ADIS_INCLI_CHAN(mod, addr, si, info_sep, info_all, bits) \ |
| 224 | ADIS_MOD_CHAN(IIO_INCLI, mod, addr, si, info_sep, bits) | 227 | ADIS_MOD_CHAN(IIO_INCLI, mod, addr, si, info_sep, info_all, bits) |
| 225 | 228 | ||
| 226 | #define ADIS_ROT_CHAN(mod, addr, si, info_sep, bits) \ | 229 | #define ADIS_ROT_CHAN(mod, addr, si, info_sep, info_all, bits) \ |
| 227 | ADIS_MOD_CHAN(IIO_ROT, mod, addr, si, info_sep, bits) | 230 | ADIS_MOD_CHAN(IIO_ROT, mod, addr, si, info_sep, info_all, bits) |
| 228 | 231 | ||
| 229 | #ifdef CONFIG_IIO_ADIS_LIB_BUFFER | 232 | #ifdef CONFIG_IIO_ADIS_LIB_BUFFER |
| 230 | 233 | ||
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index 369cf2cd5144..4b79ffe7b188 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h | |||
| @@ -129,12 +129,11 @@ void iio_trigger_unregister(struct iio_trigger *trig_info); | |||
| 129 | /** | 129 | /** |
| 130 | * iio_trigger_poll() - called on a trigger occurring | 130 | * iio_trigger_poll() - called on a trigger occurring |
| 131 | * @trig: trigger which occurred | 131 | * @trig: trigger which occurred |
| 132 | * @time: timestamp when trigger occurred | ||
| 133 | * | 132 | * |
| 134 | * Typically called in relevant hardware interrupt handler. | 133 | * Typically called in relevant hardware interrupt handler. |
| 135 | **/ | 134 | **/ |
| 136 | void iio_trigger_poll(struct iio_trigger *trig, s64 time); | 135 | void iio_trigger_poll(struct iio_trigger *trig); |
| 137 | void iio_trigger_poll_chained(struct iio_trigger *trig, s64 time); | 136 | void iio_trigger_poll_chained(struct iio_trigger *trig); |
| 138 | 137 | ||
| 139 | irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private); | 138 | irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private); |
| 140 | 139 | ||
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index d480631eabc2..4a2af8adf874 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
| @@ -56,6 +56,10 @@ enum iio_modifier { | |||
| 56 | IIO_MOD_QUATERNION, | 56 | IIO_MOD_QUATERNION, |
| 57 | IIO_MOD_TEMP_AMBIENT, | 57 | IIO_MOD_TEMP_AMBIENT, |
| 58 | IIO_MOD_TEMP_OBJECT, | 58 | IIO_MOD_TEMP_OBJECT, |
| 59 | IIO_MOD_NORTH_MAGN, | ||
| 60 | IIO_MOD_NORTH_TRUE, | ||
| 61 | IIO_MOD_NORTH_MAGN_TILT_COMP, | ||
| 62 | IIO_MOD_NORTH_TRUE_TILT_COMP | ||
| 59 | }; | 63 | }; |
| 60 | 64 | ||
| 61 | enum iio_event_type { | 65 | enum iio_event_type { |
| @@ -70,6 +74,7 @@ enum iio_event_info { | |||
| 70 | IIO_EV_INFO_ENABLE, | 74 | IIO_EV_INFO_ENABLE, |
| 71 | IIO_EV_INFO_VALUE, | 75 | IIO_EV_INFO_VALUE, |
| 72 | IIO_EV_INFO_HYSTERESIS, | 76 | IIO_EV_INFO_HYSTERESIS, |
| 77 | IIO_EV_INFO_PERIOD, | ||
| 73 | }; | 78 | }; |
| 74 | 79 | ||
| 75 | enum iio_event_direction { | 80 | enum iio_event_direction { |
diff --git a/include/linux/ima.h b/include/linux/ima.h index 1b7f268cddce..7cf5e9b32550 100644 --- a/include/linux/ima.h +++ b/include/linux/ima.h | |||
| @@ -19,6 +19,7 @@ extern int ima_file_check(struct file *file, int mask); | |||
| 19 | extern void ima_file_free(struct file *file); | 19 | extern void ima_file_free(struct file *file); |
| 20 | extern int ima_file_mmap(struct file *file, unsigned long prot); | 20 | extern int ima_file_mmap(struct file *file, unsigned long prot); |
| 21 | extern int ima_module_check(struct file *file); | 21 | extern int ima_module_check(struct file *file); |
| 22 | extern int ima_fw_from_file(struct file *file, char *buf, size_t size); | ||
| 22 | 23 | ||
| 23 | #else | 24 | #else |
| 24 | static inline int ima_bprm_check(struct linux_binprm *bprm) | 25 | static inline int ima_bprm_check(struct linux_binprm *bprm) |
| @@ -46,6 +47,11 @@ static inline int ima_module_check(struct file *file) | |||
| 46 | return 0; | 47 | return 0; |
| 47 | } | 48 | } |
| 48 | 49 | ||
| 50 | static inline int ima_fw_from_file(struct file *file, char *buf, size_t size) | ||
| 51 | { | ||
| 52 | return 0; | ||
| 53 | } | ||
| 54 | |||
| 49 | #endif /* CONFIG_IMA */ | 55 | #endif /* CONFIG_IMA */ |
| 50 | 56 | ||
| 51 | #ifdef CONFIG_IMA_APPRAISE | 57 | #ifdef CONFIG_IMA_APPRAISE |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 6df7f9fe0d01..2bb4c4f3531a 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -102,12 +102,6 @@ extern struct group_info init_groups; | |||
| 102 | #define INIT_IDS | 102 | #define INIT_IDS |
| 103 | #endif | 103 | #endif |
| 104 | 104 | ||
| 105 | #ifdef CONFIG_RCU_BOOST | ||
| 106 | #define INIT_TASK_RCU_BOOST() \ | ||
| 107 | .rcu_boost_mutex = NULL, | ||
| 108 | #else | ||
| 109 | #define INIT_TASK_RCU_BOOST() | ||
| 110 | #endif | ||
| 111 | #ifdef CONFIG_TREE_PREEMPT_RCU | 105 | #ifdef CONFIG_TREE_PREEMPT_RCU |
| 112 | #define INIT_TASK_RCU_TREE_PREEMPT() \ | 106 | #define INIT_TASK_RCU_TREE_PREEMPT() \ |
| 113 | .rcu_blocked_node = NULL, | 107 | .rcu_blocked_node = NULL, |
| @@ -119,8 +113,7 @@ extern struct group_info init_groups; | |||
| 119 | .rcu_read_lock_nesting = 0, \ | 113 | .rcu_read_lock_nesting = 0, \ |
| 120 | .rcu_read_unlock_special = 0, \ | 114 | .rcu_read_unlock_special = 0, \ |
| 121 | .rcu_node_entry = LIST_HEAD_INIT(tsk.rcu_node_entry), \ | 115 | .rcu_node_entry = LIST_HEAD_INIT(tsk.rcu_node_entry), \ |
| 122 | INIT_TASK_RCU_TREE_PREEMPT() \ | 116 | INIT_TASK_RCU_TREE_PREEMPT() |
| 123 | INIT_TASK_RCU_BOOST() | ||
| 124 | #else | 117 | #else |
| 125 | #define INIT_TASK_RCU_PREEMPT(tsk) | 118 | #define INIT_TASK_RCU_PREEMPT(tsk) |
| 126 | #endif | 119 | #endif |
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 0a2da5188217..a65208a8fe18 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h | |||
| @@ -336,6 +336,7 @@ struct intel_iommu { | |||
| 336 | #ifdef CONFIG_IRQ_REMAP | 336 | #ifdef CONFIG_IRQ_REMAP |
| 337 | struct ir_table *ir_table; /* Interrupt remapping info */ | 337 | struct ir_table *ir_table; /* Interrupt remapping info */ |
| 338 | #endif | 338 | #endif |
| 339 | struct device *iommu_dev; /* IOMMU-sysfs device */ | ||
| 339 | int node; | 340 | int node; |
| 340 | }; | 341 | }; |
| 341 | 342 | ||
| @@ -365,4 +366,6 @@ extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); | |||
| 365 | 366 | ||
| 366 | extern int dmar_ir_support(void); | 367 | extern int dmar_ir_support(void); |
| 367 | 368 | ||
| 369 | extern const struct attribute_group *intel_iommu_groups[]; | ||
| 370 | |||
| 368 | #endif | 371 | #endif |
diff --git a/include/linux/io.h b/include/linux/io.h index b76e6e545806..d5fc9b8d8b03 100644 --- a/include/linux/io.h +++ b/include/linux/io.h | |||
| @@ -58,6 +58,8 @@ static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr) | |||
| 58 | } | 58 | } |
| 59 | #endif | 59 | #endif |
| 60 | 60 | ||
| 61 | #define IOMEM_ERR_PTR(err) (__force void __iomem *)ERR_PTR(err) | ||
| 62 | |||
| 61 | void __iomem *devm_ioremap(struct device *dev, resource_size_t offset, | 63 | void __iomem *devm_ioremap(struct device *dev, resource_size_t offset, |
| 62 | unsigned long size); | 64 | unsigned long size); |
| 63 | void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset, | 65 | void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset, |
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index b96a5b2136e4..20f9a527922a 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
| @@ -50,7 +50,7 @@ struct iommu_domain_geometry { | |||
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | struct iommu_domain { | 52 | struct iommu_domain { |
| 53 | struct iommu_ops *ops; | 53 | const struct iommu_ops *ops; |
| 54 | void *priv; | 54 | void *priv; |
| 55 | iommu_fault_handler_t handler; | 55 | iommu_fault_handler_t handler; |
| 56 | void *handler_token; | 56 | void *handler_token; |
| @@ -140,7 +140,7 @@ struct iommu_ops { | |||
| 140 | #define IOMMU_GROUP_NOTIFY_UNBIND_DRIVER 5 /* Pre Driver unbind */ | 140 | #define IOMMU_GROUP_NOTIFY_UNBIND_DRIVER 5 /* Pre Driver unbind */ |
| 141 | #define IOMMU_GROUP_NOTIFY_UNBOUND_DRIVER 6 /* Post Driver unbind */ | 141 | #define IOMMU_GROUP_NOTIFY_UNBOUND_DRIVER 6 /* Post Driver unbind */ |
| 142 | 142 | ||
| 143 | extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops); | 143 | extern int bus_set_iommu(struct bus_type *bus, const struct iommu_ops *ops); |
| 144 | extern bool iommu_present(struct bus_type *bus); | 144 | extern bool iommu_present(struct bus_type *bus); |
| 145 | extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus); | 145 | extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus); |
| 146 | extern struct iommu_group *iommu_group_get_by_id(int id); | 146 | extern struct iommu_group *iommu_group_get_by_id(int id); |
| @@ -181,11 +181,18 @@ extern int iommu_group_register_notifier(struct iommu_group *group, | |||
| 181 | extern int iommu_group_unregister_notifier(struct iommu_group *group, | 181 | extern int iommu_group_unregister_notifier(struct iommu_group *group, |
| 182 | struct notifier_block *nb); | 182 | struct notifier_block *nb); |
| 183 | extern int iommu_group_id(struct iommu_group *group); | 183 | extern int iommu_group_id(struct iommu_group *group); |
| 184 | extern struct iommu_group *iommu_group_get_for_dev(struct device *dev); | ||
| 184 | 185 | ||
| 185 | extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr, | 186 | extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr, |
| 186 | void *data); | 187 | void *data); |
| 187 | extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, | 188 | extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, |
| 188 | void *data); | 189 | void *data); |
| 190 | struct device *iommu_device_create(struct device *parent, void *drvdata, | ||
| 191 | const struct attribute_group **groups, | ||
| 192 | const char *fmt, ...); | ||
| 193 | void iommu_device_destroy(struct device *dev); | ||
| 194 | int iommu_device_link(struct device *dev, struct device *link); | ||
| 195 | void iommu_device_unlink(struct device *dev, struct device *link); | ||
| 189 | 196 | ||
| 190 | /* Window handling function prototypes */ | 197 | /* Window handling function prototypes */ |
| 191 | extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, | 198 | extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, |
| @@ -396,6 +403,27 @@ static inline int iommu_domain_set_attr(struct iommu_domain *domain, | |||
| 396 | return -EINVAL; | 403 | return -EINVAL; |
| 397 | } | 404 | } |
| 398 | 405 | ||
| 406 | static inline struct device *iommu_device_create(struct device *parent, | ||
| 407 | void *drvdata, | ||
| 408 | const struct attribute_group **groups, | ||
| 409 | const char *fmt, ...) | ||
| 410 | { | ||
| 411 | return ERR_PTR(-ENODEV); | ||
| 412 | } | ||
| 413 | |||
| 414 | static inline void iommu_device_destroy(struct device *dev) | ||
| 415 | { | ||
| 416 | } | ||
| 417 | |||
| 418 | static inline int iommu_device_link(struct device *dev, struct device *link) | ||
| 419 | { | ||
| 420 | return -EINVAL; | ||
| 421 | } | ||
| 422 | |||
| 423 | static inline void iommu_device_unlink(struct device *dev, struct device *link) | ||
| 424 | { | ||
| 425 | } | ||
| 426 | |||
| 399 | #endif /* CONFIG_IOMMU_API */ | 427 | #endif /* CONFIG_IOMMU_API */ |
| 400 | 428 | ||
| 401 | #endif /* __LINUX_IOMMU_H */ | 429 | #endif /* __LINUX_IOMMU_H */ |
diff --git a/include/linux/iova.h b/include/linux/iova.h index 3277f4711349..19e81d5ccb6d 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h | |||
| @@ -34,6 +34,11 @@ struct iova_domain { | |||
| 34 | unsigned long dma_32bit_pfn; | 34 | unsigned long dma_32bit_pfn; |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | static inline unsigned long iova_size(struct iova *iova) | ||
| 38 | { | ||
| 39 | return iova->pfn_hi - iova->pfn_lo + 1; | ||
| 40 | } | ||
| 41 | |||
| 37 | struct iova *alloc_iova_mem(void); | 42 | struct iova *alloc_iova_mem(void); |
| 38 | void free_iova_mem(struct iova *iova); | 43 | void free_iova_mem(struct iova *iova); |
| 39 | void free_iova(struct iova_domain *iovad, unsigned long pfn); | 44 | void free_iova(struct iova_domain *iovad, unsigned long pfn); |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 2faef339d8f2..ff560537dd61 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
| @@ -39,6 +39,7 @@ struct ipv6_devconf { | |||
| 39 | #endif | 39 | #endif |
| 40 | __s32 proxy_ndp; | 40 | __s32 proxy_ndp; |
| 41 | __s32 accept_source_route; | 41 | __s32 accept_source_route; |
| 42 | __s32 accept_ra_from_local; | ||
| 42 | #ifdef CONFIG_IPV6_OPTIMISTIC_DAD | 43 | #ifdef CONFIG_IPV6_OPTIMISTIC_DAD |
| 43 | __s32 optimistic_dad; | 44 | __s32 optimistic_dad; |
| 44 | #endif | 45 | #endif |
| @@ -193,12 +194,13 @@ struct ipv6_pinfo { | |||
| 193 | sndflow:1, | 194 | sndflow:1, |
| 194 | repflow:1, | 195 | repflow:1, |
| 195 | pmtudisc:3, | 196 | pmtudisc:3, |
| 196 | ipv6only:1, | 197 | padding:1, /* 1 bit hole */ |
| 197 | srcprefs:3, /* 001: prefer temporary address | 198 | srcprefs:3, /* 001: prefer temporary address |
| 198 | * 010: prefer public address | 199 | * 010: prefer public address |
| 199 | * 100: prefer care-of address | 200 | * 100: prefer care-of address |
| 200 | */ | 201 | */ |
| 201 | dontfrag:1; | 202 | dontfrag:1, |
| 203 | autoflowlabel:1; | ||
| 202 | __u8 min_hopcount; | 204 | __u8 min_hopcount; |
| 203 | __u8 tclass; | 205 | __u8 tclass; |
| 204 | __be32 rcv_flowinfo; | 206 | __be32 rcv_flowinfo; |
| @@ -256,16 +258,6 @@ static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) | |||
| 256 | return inet_sk(__sk)->pinet6; | 258 | return inet_sk(__sk)->pinet6; |
| 257 | } | 259 | } |
| 258 | 260 | ||
| 259 | static inline struct request_sock *inet6_reqsk_alloc(struct request_sock_ops *ops) | ||
| 260 | { | ||
| 261 | struct request_sock *req = reqsk_alloc(ops); | ||
| 262 | |||
| 263 | if (req) | ||
| 264 | inet_rsk(req)->pktopts = NULL; | ||
| 265 | |||
| 266 | return req; | ||
| 267 | } | ||
| 268 | |||
| 269 | static inline struct raw6_sock *raw6_sk(const struct sock *sk) | 261 | static inline struct raw6_sock *raw6_sk(const struct sock *sk) |
| 270 | { | 262 | { |
| 271 | return (struct raw6_sock *)sk; | 263 | return (struct raw6_sock *)sk; |
| @@ -282,8 +274,8 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to, | |||
| 282 | __inet_sk_copy_descendant(sk_to, sk_from, ancestor_size); | 274 | __inet_sk_copy_descendant(sk_to, sk_from, ancestor_size); |
| 283 | } | 275 | } |
| 284 | 276 | ||
| 285 | #define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) | 277 | #define __ipv6_only_sock(sk) (sk->sk_ipv6only) |
| 286 | #define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) | 278 | #define ipv6_only_sock(sk) (__ipv6_only_sock(sk)) |
| 287 | #define ipv6_sk_rxinfo(sk) ((sk)->sk_family == PF_INET6 && \ | 279 | #define ipv6_sk_rxinfo(sk) ((sk)->sk_family == PF_INET6 && \ |
| 288 | inet6_sk(sk)->rxopt.bits.rxinfo) | 280 | inet6_sk(sk)->rxopt.bits.rxinfo) |
| 289 | 281 | ||
| @@ -296,8 +288,8 @@ static inline const struct in6_addr *inet6_rcv_saddr(const struct sock *sk) | |||
| 296 | 288 | ||
| 297 | static inline int inet_v6_ipv6only(const struct sock *sk) | 289 | static inline int inet_v6_ipv6only(const struct sock *sk) |
| 298 | { | 290 | { |
| 299 | return likely(sk->sk_state != TCP_TIME_WAIT) ? | 291 | /* ipv6only field is at same position for timewait and other sockets */ |
| 300 | ipv6_only_sock(sk) : inet_twsk(sk)->tw_ipv6only; | 292 | return ipv6_only_sock(sk); |
| 301 | } | 293 | } |
| 302 | #else | 294 | #else |
| 303 | #define __ipv6_only_sock(sk) 0 | 295 | #define __ipv6_only_sock(sk) 0 |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 0d998d8b01d8..62af59242ddc 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
| @@ -771,6 +771,8 @@ void irq_gc_eoi(struct irq_data *d); | |||
| 771 | int irq_gc_set_wake(struct irq_data *d, unsigned int on); | 771 | int irq_gc_set_wake(struct irq_data *d, unsigned int on); |
| 772 | 772 | ||
| 773 | /* Setup functions for irq_chip_generic */ | 773 | /* Setup functions for irq_chip_generic */ |
| 774 | int irq_map_generic_chip(struct irq_domain *d, unsigned int virq, | ||
| 775 | irq_hw_number_t hw_irq); | ||
| 774 | struct irq_chip_generic * | 776 | struct irq_chip_generic * |
| 775 | irq_alloc_generic_chip(const char *name, int nr_ct, unsigned int irq_base, | 777 | irq_alloc_generic_chip(const char *name, int nr_ct, unsigned int irq_base, |
| 776 | void __iomem *reg_base, irq_flow_handler_t handler); | 778 | void __iomem *reg_base, irq_flow_handler_t handler); |
diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h index 19ae05d4b8ec..bf9422c3aefe 100644 --- a/include/linux/irq_work.h +++ b/include/linux/irq_work.h | |||
| @@ -33,6 +33,11 @@ void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *)) | |||
| 33 | #define DEFINE_IRQ_WORK(name, _f) struct irq_work name = { .func = (_f), } | 33 | #define DEFINE_IRQ_WORK(name, _f) struct irq_work name = { .func = (_f), } |
| 34 | 34 | ||
| 35 | bool irq_work_queue(struct irq_work *work); | 35 | bool irq_work_queue(struct irq_work *work); |
| 36 | |||
| 37 | #ifdef CONFIG_SMP | ||
| 38 | bool irq_work_queue_on(struct irq_work *work, int cpu); | ||
| 39 | #endif | ||
| 40 | |||
| 36 | void irq_work_run(void); | 41 | void irq_work_run(void); |
| 37 | void irq_work_sync(struct irq_work *work); | 42 | void irq_work_sync(struct irq_work *work); |
| 38 | 43 | ||
diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h new file mode 100644 index 000000000000..03a4ea37ba86 --- /dev/null +++ b/include/linux/irqchip/arm-gic-v3.h | |||
| @@ -0,0 +1,200 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2013, 2014 ARM Limited, All Rights Reserved. | ||
| 3 | * Author: Marc Zyngier <marc.zyngier@arm.com> | ||
| 4 | * | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | */ | ||
| 18 | #ifndef __LINUX_IRQCHIP_ARM_GIC_V3_H | ||
| 19 | #define __LINUX_IRQCHIP_ARM_GIC_V3_H | ||
| 20 | |||
| 21 | #include <asm/sysreg.h> | ||
| 22 | |||
| 23 | /* | ||
| 24 | * Distributor registers. We assume we're running non-secure, with ARE | ||
| 25 | * being set. Secure-only and non-ARE registers are not described. | ||
| 26 | */ | ||
| 27 | #define GICD_CTLR 0x0000 | ||
| 28 | #define GICD_TYPER 0x0004 | ||
| 29 | #define GICD_IIDR 0x0008 | ||
| 30 | #define GICD_STATUSR 0x0010 | ||
| 31 | #define GICD_SETSPI_NSR 0x0040 | ||
| 32 | #define GICD_CLRSPI_NSR 0x0048 | ||
| 33 | #define GICD_SETSPI_SR 0x0050 | ||
| 34 | #define GICD_CLRSPI_SR 0x0058 | ||
| 35 | #define GICD_SEIR 0x0068 | ||
| 36 | #define GICD_ISENABLER 0x0100 | ||
| 37 | #define GICD_ICENABLER 0x0180 | ||
| 38 | #define GICD_ISPENDR 0x0200 | ||
| 39 | #define GICD_ICPENDR 0x0280 | ||
| 40 | #define GICD_ISACTIVER 0x0300 | ||
| 41 | #define GICD_ICACTIVER 0x0380 | ||
| 42 | #define GICD_IPRIORITYR 0x0400 | ||
| 43 | #define GICD_ICFGR 0x0C00 | ||
| 44 | #define GICD_IROUTER 0x6000 | ||
| 45 | #define GICD_PIDR2 0xFFE8 | ||
| 46 | |||
| 47 | #define GICD_CTLR_RWP (1U << 31) | ||
| 48 | #define GICD_CTLR_ARE_NS (1U << 4) | ||
| 49 | #define GICD_CTLR_ENABLE_G1A (1U << 1) | ||
| 50 | #define GICD_CTLR_ENABLE_G1 (1U << 0) | ||
| 51 | |||
| 52 | #define GICD_IROUTER_SPI_MODE_ONE (0U << 31) | ||
| 53 | #define GICD_IROUTER_SPI_MODE_ANY (1U << 31) | ||
| 54 | |||
| 55 | #define GIC_PIDR2_ARCH_MASK 0xf0 | ||
| 56 | #define GIC_PIDR2_ARCH_GICv3 0x30 | ||
| 57 | #define GIC_PIDR2_ARCH_GICv4 0x40 | ||
| 58 | |||
| 59 | /* | ||
| 60 | * Re-Distributor registers, offsets from RD_base | ||
| 61 | */ | ||
| 62 | #define GICR_CTLR GICD_CTLR | ||
| 63 | #define GICR_IIDR 0x0004 | ||
| 64 | #define GICR_TYPER 0x0008 | ||
| 65 | #define GICR_STATUSR GICD_STATUSR | ||
| 66 | #define GICR_WAKER 0x0014 | ||
| 67 | #define GICR_SETLPIR 0x0040 | ||
| 68 | #define GICR_CLRLPIR 0x0048 | ||
| 69 | #define GICR_SEIR GICD_SEIR | ||
| 70 | #define GICR_PROPBASER 0x0070 | ||
| 71 | #define GICR_PENDBASER 0x0078 | ||
| 72 | #define GICR_INVLPIR 0x00A0 | ||
| 73 | #define GICR_INVALLR 0x00B0 | ||
| 74 | #define GICR_SYNCR 0x00C0 | ||
| 75 | #define GICR_MOVLPIR 0x0100 | ||
| 76 | #define GICR_MOVALLR 0x0110 | ||
| 77 | #define GICR_PIDR2 GICD_PIDR2 | ||
| 78 | |||
| 79 | #define GICR_WAKER_ProcessorSleep (1U << 1) | ||
| 80 | #define GICR_WAKER_ChildrenAsleep (1U << 2) | ||
| 81 | |||
| 82 | /* | ||
| 83 | * Re-Distributor registers, offsets from SGI_base | ||
| 84 | */ | ||
| 85 | #define GICR_ISENABLER0 GICD_ISENABLER | ||
| 86 | #define GICR_ICENABLER0 GICD_ICENABLER | ||
| 87 | #define GICR_ISPENDR0 GICD_ISPENDR | ||
| 88 | #define GICR_ICPENDR0 GICD_ICPENDR | ||
| 89 | #define GICR_ISACTIVER0 GICD_ISACTIVER | ||
| 90 | #define GICR_ICACTIVER0 GICD_ICACTIVER | ||
| 91 | #define GICR_IPRIORITYR0 GICD_IPRIORITYR | ||
| 92 | #define GICR_ICFGR0 GICD_ICFGR | ||
| 93 | |||
| 94 | #define GICR_TYPER_VLPIS (1U << 1) | ||
| 95 | #define GICR_TYPER_LAST (1U << 4) | ||
| 96 | |||
| 97 | /* | ||
| 98 | * CPU interface registers | ||
| 99 | */ | ||
| 100 | #define ICC_CTLR_EL1_EOImode_drop_dir (0U << 1) | ||
| 101 | #define ICC_CTLR_EL1_EOImode_drop (1U << 1) | ||
| 102 | #define ICC_SRE_EL1_SRE (1U << 0) | ||
| 103 | |||
| 104 | /* | ||
| 105 | * Hypervisor interface registers (SRE only) | ||
| 106 | */ | ||
| 107 | #define ICH_LR_VIRTUAL_ID_MASK ((1UL << 32) - 1) | ||
| 108 | |||
| 109 | #define ICH_LR_EOI (1UL << 41) | ||
| 110 | #define ICH_LR_GROUP (1UL << 60) | ||
| 111 | #define ICH_LR_STATE (3UL << 62) | ||
| 112 | #define ICH_LR_PENDING_BIT (1UL << 62) | ||
| 113 | #define ICH_LR_ACTIVE_BIT (1UL << 63) | ||
| 114 | |||
| 115 | #define ICH_MISR_EOI (1 << 0) | ||
| 116 | #define ICH_MISR_U (1 << 1) | ||
| 117 | |||
| 118 | #define ICH_HCR_EN (1 << 0) | ||
| 119 | #define ICH_HCR_UIE (1 << 1) | ||
| 120 | |||
| 121 | #define ICH_VMCR_CTLR_SHIFT 0 | ||
| 122 | #define ICH_VMCR_CTLR_MASK (0x21f << ICH_VMCR_CTLR_SHIFT) | ||
| 123 | #define ICH_VMCR_BPR1_SHIFT 18 | ||
| 124 | #define ICH_VMCR_BPR1_MASK (7 << ICH_VMCR_BPR1_SHIFT) | ||
| 125 | #define ICH_VMCR_BPR0_SHIFT 21 | ||
| 126 | #define ICH_VMCR_BPR0_MASK (7 << ICH_VMCR_BPR0_SHIFT) | ||
| 127 | #define ICH_VMCR_PMR_SHIFT 24 | ||
| 128 | #define ICH_VMCR_PMR_MASK (0xffUL << ICH_VMCR_PMR_SHIFT) | ||
| 129 | |||
| 130 | #define ICC_EOIR1_EL1 sys_reg(3, 0, 12, 12, 1) | ||
| 131 | #define ICC_IAR1_EL1 sys_reg(3, 0, 12, 12, 0) | ||
| 132 | #define ICC_SGI1R_EL1 sys_reg(3, 0, 12, 11, 5) | ||
| 133 | #define ICC_PMR_EL1 sys_reg(3, 0, 4, 6, 0) | ||
| 134 | #define ICC_CTLR_EL1 sys_reg(3, 0, 12, 12, 4) | ||
| 135 | #define ICC_SRE_EL1 sys_reg(3, 0, 12, 12, 5) | ||
| 136 | #define ICC_GRPEN1_EL1 sys_reg(3, 0, 12, 12, 7) | ||
| 137 | |||
| 138 | #define ICC_IAR1_EL1_SPURIOUS 0x3ff | ||
| 139 | |||
| 140 | #define ICC_SRE_EL2 sys_reg(3, 4, 12, 9, 5) | ||
| 141 | |||
| 142 | #define ICC_SRE_EL2_SRE (1 << 0) | ||
| 143 | #define ICC_SRE_EL2_ENABLE (1 << 3) | ||
| 144 | |||
| 145 | /* | ||
| 146 | * System register definitions | ||
| 147 | */ | ||
| 148 | #define ICH_VSEIR_EL2 sys_reg(3, 4, 12, 9, 4) | ||
| 149 | #define ICH_HCR_EL2 sys_reg(3, 4, 12, 11, 0) | ||
| 150 | #define ICH_VTR_EL2 sys_reg(3, 4, 12, 11, 1) | ||
| 151 | #define ICH_MISR_EL2 sys_reg(3, 4, 12, 11, 2) | ||
| 152 | #define ICH_EISR_EL2 sys_reg(3, 4, 12, 11, 3) | ||
| 153 | #define ICH_ELSR_EL2 sys_reg(3, 4, 12, 11, 5) | ||
| 154 | #define ICH_VMCR_EL2 sys_reg(3, 4, 12, 11, 7) | ||
| 155 | |||
| 156 | #define __LR0_EL2(x) sys_reg(3, 4, 12, 12, x) | ||
| 157 | #define __LR8_EL2(x) sys_reg(3, 4, 12, 13, x) | ||
| 158 | |||
| 159 | #define ICH_LR0_EL2 __LR0_EL2(0) | ||
| 160 | #define ICH_LR1_EL2 __LR0_EL2(1) | ||
| 161 | #define ICH_LR2_EL2 __LR0_EL2(2) | ||
| 162 | #define ICH_LR3_EL2 __LR0_EL2(3) | ||
| 163 | #define ICH_LR4_EL2 __LR0_EL2(4) | ||
| 164 | #define ICH_LR5_EL2 __LR0_EL2(5) | ||
| 165 | #define ICH_LR6_EL2 __LR0_EL2(6) | ||
| 166 | #define ICH_LR7_EL2 __LR0_EL2(7) | ||
| 167 | #define ICH_LR8_EL2 __LR8_EL2(0) | ||
| 168 | #define ICH_LR9_EL2 __LR8_EL2(1) | ||
| 169 | #define ICH_LR10_EL2 __LR8_EL2(2) | ||
| 170 | #define ICH_LR11_EL2 __LR8_EL2(3) | ||
| 171 | #define ICH_LR12_EL2 __LR8_EL2(4) | ||
| 172 | #define ICH_LR13_EL2 __LR8_EL2(5) | ||
| 173 | #define ICH_LR14_EL2 __LR8_EL2(6) | ||
| 174 | #define ICH_LR15_EL2 __LR8_EL2(7) | ||
| 175 | |||
| 176 | #define __AP0Rx_EL2(x) sys_reg(3, 4, 12, 8, x) | ||
| 177 | #define ICH_AP0R0_EL2 __AP0Rx_EL2(0) | ||
| 178 | #define ICH_AP0R1_EL2 __AP0Rx_EL2(1) | ||
| 179 | #define ICH_AP0R2_EL2 __AP0Rx_EL2(2) | ||
| 180 | #define ICH_AP0R3_EL2 __AP0Rx_EL2(3) | ||
| 181 | |||
| 182 | #define __AP1Rx_EL2(x) sys_reg(3, 4, 12, 9, x) | ||
| 183 | #define ICH_AP1R0_EL2 __AP1Rx_EL2(0) | ||
| 184 | #define ICH_AP1R1_EL2 __AP1Rx_EL2(1) | ||
| 185 | #define ICH_AP1R2_EL2 __AP1Rx_EL2(2) | ||
| 186 | #define ICH_AP1R3_EL2 __AP1Rx_EL2(3) | ||
| 187 | |||
| 188 | #ifndef __ASSEMBLY__ | ||
| 189 | |||
| 190 | #include <linux/stringify.h> | ||
| 191 | |||
| 192 | static inline void gic_write_eoir(u64 irq) | ||
| 193 | { | ||
| 194 | asm volatile("msr_s " __stringify(ICC_EOIR1_EL1) ", %0" : : "r" (irq)); | ||
| 195 | isb(); | ||
| 196 | } | ||
| 197 | |||
| 198 | #endif | ||
| 199 | |||
| 200 | #endif | ||
diff --git a/include/linux/irqchip/spear-shirq.h b/include/linux/irqchip/spear-shirq.h deleted file mode 100644 index c8be16d213a3..000000000000 --- a/include/linux/irqchip/spear-shirq.h +++ /dev/null | |||
| @@ -1,64 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * SPEAr platform shared irq layer header file | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009-2012 ST Microelectronics | ||
| 5 | * Viresh Kumar <viresh.linux@gmail.com> | ||
| 6 | * | ||
| 7 | * This file is licensed under the terms of the GNU General Public | ||
| 8 | * License version 2. This program is licensed "as is" without any | ||
| 9 | * warranty of any kind, whether express or implied. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __SPEAR_SHIRQ_H | ||
| 13 | #define __SPEAR_SHIRQ_H | ||
| 14 | |||
| 15 | #include <linux/irq.h> | ||
| 16 | #include <linux/types.h> | ||
| 17 | |||
| 18 | /* | ||
| 19 | * struct shirq_regs: shared irq register configuration | ||
| 20 | * | ||
| 21 | * enb_reg: enable register offset | ||
| 22 | * reset_to_enb: val 1 indicates, we need to clear bit for enabling interrupt | ||
| 23 | * status_reg: status register offset | ||
| 24 | * status_reg_mask: status register valid mask | ||
| 25 | * clear_reg: clear register offset | ||
| 26 | * reset_to_clear: val 1 indicates, we need to clear bit for clearing interrupt | ||
| 27 | */ | ||
| 28 | struct shirq_regs { | ||
| 29 | u32 enb_reg; | ||
| 30 | u32 reset_to_enb; | ||
| 31 | u32 status_reg; | ||
| 32 | u32 clear_reg; | ||
| 33 | u32 reset_to_clear; | ||
| 34 | }; | ||
| 35 | |||
| 36 | /* | ||
| 37 | * struct spear_shirq: shared irq structure | ||
| 38 | * | ||
| 39 | * irq: hardware irq number | ||
| 40 | * irq_base: base irq in linux domain | ||
| 41 | * irq_nr: no. of shared interrupts in a particular block | ||
| 42 | * irq_bit_off: starting bit offset in the status register | ||
| 43 | * invalid_irq: irq group is currently disabled | ||
| 44 | * base: base address of shared irq register | ||
| 45 | * regs: register configuration for shared irq block | ||
| 46 | */ | ||
| 47 | struct spear_shirq { | ||
| 48 | u32 irq; | ||
| 49 | u32 irq_base; | ||
| 50 | u32 irq_nr; | ||
| 51 | u32 irq_bit_off; | ||
| 52 | int invalid_irq; | ||
| 53 | void __iomem *base; | ||
| 54 | struct shirq_regs regs; | ||
| 55 | }; | ||
| 56 | |||
| 57 | int __init spear300_shirq_of_init(struct device_node *np, | ||
| 58 | struct device_node *parent); | ||
| 59 | int __init spear310_shirq_of_init(struct device_node *np, | ||
| 60 | struct device_node *parent); | ||
| 61 | int __init spear320_shirq_of_init(struct device_node *np, | ||
| 62 | struct device_node *parent); | ||
| 63 | |||
| 64 | #endif /* __SPEAR_SHIRQ_H */ | ||
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index c983ed18c332..b0f9d16e48f6 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h | |||
| @@ -172,6 +172,8 @@ extern int irq_domain_associate(struct irq_domain *domain, unsigned int irq, | |||
| 172 | extern void irq_domain_associate_many(struct irq_domain *domain, | 172 | extern void irq_domain_associate_many(struct irq_domain *domain, |
| 173 | unsigned int irq_base, | 173 | unsigned int irq_base, |
| 174 | irq_hw_number_t hwirq_base, int count); | 174 | irq_hw_number_t hwirq_base, int count); |
| 175 | extern void irq_domain_disassociate(struct irq_domain *domain, | ||
| 176 | unsigned int irq); | ||
| 175 | 177 | ||
| 176 | extern unsigned int irq_create_mapping(struct irq_domain *host, | 178 | extern unsigned int irq_create_mapping(struct irq_domain *host, |
| 177 | irq_hw_number_t hwirq); | 179 | irq_hw_number_t hwirq); |
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h index 8e10f57f109f..a0070c6dfaf8 100644 --- a/include/linux/isdn_ppp.h +++ b/include/linux/isdn_ppp.h | |||
| @@ -180,8 +180,8 @@ struct ippp_struct { | |||
| 180 | struct slcompress *slcomp; | 180 | struct slcompress *slcomp; |
| 181 | #endif | 181 | #endif |
| 182 | #ifdef CONFIG_IPPP_FILTER | 182 | #ifdef CONFIG_IPPP_FILTER |
| 183 | struct sk_filter *pass_filter; /* filter for packets to pass */ | 183 | struct bpf_prog *pass_filter; /* filter for packets to pass */ |
| 184 | struct sk_filter *active_filter; /* filter for pkts to reset idle */ | 184 | struct bpf_prog *active_filter; /* filter for pkts to reset idle */ |
| 185 | #endif | 185 | #endif |
| 186 | unsigned long debug; | 186 | unsigned long debug; |
| 187 | struct isdn_ppp_compressor *compressor,*decompressor; | 187 | struct isdn_ppp_compressor *compressor,*decompressor; |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 4c52907a6d8b..a9e2268ecccb 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -501,7 +501,7 @@ static inline char * __deprecated pack_hex_byte(char *buf, u8 byte) | |||
| 501 | extern int hex_to_bin(char ch); | 501 | extern int hex_to_bin(char ch); |
| 502 | extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); | 502 | extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); |
| 503 | 503 | ||
| 504 | int mac_pton(const char *s, u8 *mac); | 504 | bool mac_pton(const char *s, u8 *mac); |
| 505 | 505 | ||
| 506 | /* | 506 | /* |
| 507 | * General tracing related utility functions - trace_printk(), | 507 | * General tracing related utility functions - trace_printk(), |
diff --git a/include/linux/key-type.h b/include/linux/key-type.h index a74c3a84dfdd..44792ee649de 100644 --- a/include/linux/key-type.h +++ b/include/linux/key-type.h | |||
| @@ -41,10 +41,11 @@ struct key_construction { | |||
| 41 | struct key_preparsed_payload { | 41 | struct key_preparsed_payload { |
| 42 | char *description; /* Proposed key description (or NULL) */ | 42 | char *description; /* Proposed key description (or NULL) */ |
| 43 | void *type_data[2]; /* Private key-type data */ | 43 | void *type_data[2]; /* Private key-type data */ |
| 44 | void *payload; /* Proposed payload */ | 44 | void *payload[2]; /* Proposed payload */ |
| 45 | const void *data; /* Raw data */ | 45 | const void *data; /* Raw data */ |
| 46 | size_t datalen; /* Raw datalen */ | 46 | size_t datalen; /* Raw datalen */ |
| 47 | size_t quotalen; /* Quota length for proposed payload */ | 47 | size_t quotalen; /* Quota length for proposed payload */ |
| 48 | time_t expiry; /* Expiry time of key */ | ||
| 48 | bool trusted; /* True if key is trusted */ | 49 | bool trusted; /* True if key is trusted */ |
| 49 | }; | 50 | }; |
| 50 | 51 | ||
| @@ -159,5 +160,7 @@ static inline int key_negate_and_link(struct key *key, | |||
| 159 | return key_reject_and_link(key, timeout, ENOKEY, keyring, instkey); | 160 | return key_reject_and_link(key, timeout, ENOKEY, keyring, instkey); |
| 160 | } | 161 | } |
| 161 | 162 | ||
| 163 | extern int generic_key_instantiate(struct key *key, struct key_preparsed_payload *prep); | ||
| 164 | |||
| 162 | #endif /* CONFIG_KEYS */ | 165 | #endif /* CONFIG_KEYS */ |
| 163 | #endif /* _LINUX_KEY_TYPE_H */ | 166 | #endif /* _LINUX_KEY_TYPE_H */ |
diff --git a/include/linux/key.h b/include/linux/key.h index 017b0826642f..e1d4715f3222 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
| @@ -170,6 +170,8 @@ struct key { | |||
| 170 | #define KEY_FLAG_INVALIDATED 7 /* set if key has been invalidated */ | 170 | #define KEY_FLAG_INVALIDATED 7 /* set if key has been invalidated */ |
| 171 | #define KEY_FLAG_TRUSTED 8 /* set if key is trusted */ | 171 | #define KEY_FLAG_TRUSTED 8 /* set if key is trusted */ |
| 172 | #define KEY_FLAG_TRUSTED_ONLY 9 /* set if keyring only accepts links to trusted keys */ | 172 | #define KEY_FLAG_TRUSTED_ONLY 9 /* set if keyring only accepts links to trusted keys */ |
| 173 | #define KEY_FLAG_BUILTIN 10 /* set if key is builtin */ | ||
| 174 | #define KEY_FLAG_ROOT_CAN_INVAL 11 /* set if key can be invalidated by root without permission */ | ||
| 173 | 175 | ||
| 174 | /* the key type and key description string | 176 | /* the key type and key description string |
| 175 | * - the desc is used to match a key against search criteria | 177 | * - the desc is used to match a key against search criteria |
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 7dcef3317689..13d55206ccf6 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
| @@ -73,7 +73,6 @@ struct kthread_worker { | |||
| 73 | struct kthread_work { | 73 | struct kthread_work { |
| 74 | struct list_head node; | 74 | struct list_head node; |
| 75 | kthread_work_func_t func; | 75 | kthread_work_func_t func; |
| 76 | wait_queue_head_t done; | ||
| 77 | struct kthread_worker *worker; | 76 | struct kthread_worker *worker; |
| 78 | }; | 77 | }; |
| 79 | 78 | ||
| @@ -85,7 +84,6 @@ struct kthread_work { | |||
| 85 | #define KTHREAD_WORK_INIT(work, fn) { \ | 84 | #define KTHREAD_WORK_INIT(work, fn) { \ |
| 86 | .node = LIST_HEAD_INIT((work).node), \ | 85 | .node = LIST_HEAD_INIT((work).node), \ |
| 87 | .func = (fn), \ | 86 | .func = (fn), \ |
| 88 | .done = __WAIT_QUEUE_HEAD_INITIALIZER((work).done), \ | ||
| 89 | } | 87 | } |
| 90 | 88 | ||
| 91 | #define DEFINE_KTHREAD_WORKER(worker) \ | 89 | #define DEFINE_KTHREAD_WORKER(worker) \ |
| @@ -95,22 +93,16 @@ struct kthread_work { | |||
| 95 | struct kthread_work work = KTHREAD_WORK_INIT(work, fn) | 93 | struct kthread_work work = KTHREAD_WORK_INIT(work, fn) |
| 96 | 94 | ||
| 97 | /* | 95 | /* |
| 98 | * kthread_worker.lock and kthread_work.done need their own lockdep class | 96 | * kthread_worker.lock needs its own lockdep class key when defined on |
| 99 | * keys if they are defined on stack with lockdep enabled. Use the | 97 | * stack with lockdep enabled. Use the following macros in such cases. |
| 100 | * following macros when defining them on stack. | ||
| 101 | */ | 98 | */ |
| 102 | #ifdef CONFIG_LOCKDEP | 99 | #ifdef CONFIG_LOCKDEP |
| 103 | # define KTHREAD_WORKER_INIT_ONSTACK(worker) \ | 100 | # define KTHREAD_WORKER_INIT_ONSTACK(worker) \ |
| 104 | ({ init_kthread_worker(&worker); worker; }) | 101 | ({ init_kthread_worker(&worker); worker; }) |
| 105 | # define DEFINE_KTHREAD_WORKER_ONSTACK(worker) \ | 102 | # define DEFINE_KTHREAD_WORKER_ONSTACK(worker) \ |
| 106 | struct kthread_worker worker = KTHREAD_WORKER_INIT_ONSTACK(worker) | 103 | struct kthread_worker worker = KTHREAD_WORKER_INIT_ONSTACK(worker) |
| 107 | # define KTHREAD_WORK_INIT_ONSTACK(work, fn) \ | ||
| 108 | ({ init_kthread_work((&work), fn); work; }) | ||
| 109 | # define DEFINE_KTHREAD_WORK_ONSTACK(work, fn) \ | ||
| 110 | struct kthread_work work = KTHREAD_WORK_INIT_ONSTACK(work, fn) | ||
| 111 | #else | 104 | #else |
| 112 | # define DEFINE_KTHREAD_WORKER_ONSTACK(worker) DEFINE_KTHREAD_WORKER(worker) | 105 | # define DEFINE_KTHREAD_WORKER_ONSTACK(worker) DEFINE_KTHREAD_WORKER(worker) |
| 113 | # define DEFINE_KTHREAD_WORK_ONSTACK(work, fn) DEFINE_KTHREAD_WORK(work, fn) | ||
| 114 | #endif | 106 | #endif |
| 115 | 107 | ||
| 116 | extern void __init_kthread_worker(struct kthread_worker *worker, | 108 | extern void __init_kthread_worker(struct kthread_worker *worker, |
| @@ -127,7 +119,6 @@ extern void __init_kthread_worker(struct kthread_worker *worker, | |||
| 127 | memset((work), 0, sizeof(struct kthread_work)); \ | 119 | memset((work), 0, sizeof(struct kthread_work)); \ |
| 128 | INIT_LIST_HEAD(&(work)->node); \ | 120 | INIT_LIST_HEAD(&(work)->node); \ |
| 129 | (work)->func = (fn); \ | 121 | (work)->func = (fn); \ |
| 130 | init_waitqueue_head(&(work)->done); \ | ||
| 131 | } while (0) | 122 | } while (0) |
| 132 | 123 | ||
| 133 | int kthread_worker_fn(void *worker_ptr); | 124 | int kthread_worker_fn(void *worker_ptr); |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index de9e46e6bcc9..c9d645ad98ff 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
| @@ -27,43 +27,19 @@ | |||
| 27 | /* | 27 | /* |
| 28 | * ktime_t: | 28 | * ktime_t: |
| 29 | * | 29 | * |
| 30 | * On 64-bit CPUs a single 64-bit variable is used to store the hrtimers | 30 | * A single 64-bit variable is used to store the hrtimers |
| 31 | * internal representation of time values in scalar nanoseconds. The | 31 | * internal representation of time values in scalar nanoseconds. The |
| 32 | * design plays out best on 64-bit CPUs, where most conversions are | 32 | * design plays out best on 64-bit CPUs, where most conversions are |
| 33 | * NOPs and most arithmetic ktime_t operations are plain arithmetic | 33 | * NOPs and most arithmetic ktime_t operations are plain arithmetic |
| 34 | * operations. | 34 | * operations. |
| 35 | * | 35 | * |
| 36 | * On 32-bit CPUs an optimized representation of the timespec structure | ||
| 37 | * is used to avoid expensive conversions from and to timespecs. The | ||
| 38 | * endian-aware order of the tv struct members is chosen to allow | ||
| 39 | * mathematical operations on the tv64 member of the union too, which | ||
| 40 | * for certain operations produces better code. | ||
| 41 | * | ||
| 42 | * For architectures with efficient support for 64/32-bit conversions the | ||
| 43 | * plain scalar nanosecond based representation can be selected by the | ||
| 44 | * config switch CONFIG_KTIME_SCALAR. | ||
| 45 | */ | 36 | */ |
| 46 | union ktime { | 37 | union ktime { |
| 47 | s64 tv64; | 38 | s64 tv64; |
| 48 | #if BITS_PER_LONG != 64 && !defined(CONFIG_KTIME_SCALAR) | ||
| 49 | struct { | ||
| 50 | # ifdef __BIG_ENDIAN | ||
| 51 | s32 sec, nsec; | ||
| 52 | # else | ||
| 53 | s32 nsec, sec; | ||
| 54 | # endif | ||
| 55 | } tv; | ||
| 56 | #endif | ||
| 57 | }; | 39 | }; |
| 58 | 40 | ||
| 59 | typedef union ktime ktime_t; /* Kill this */ | 41 | typedef union ktime ktime_t; /* Kill this */ |
| 60 | 42 | ||
| 61 | /* | ||
| 62 | * ktime_t definitions when using the 64-bit scalar representation: | ||
| 63 | */ | ||
| 64 | |||
| 65 | #if (BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR) | ||
| 66 | |||
| 67 | /** | 43 | /** |
| 68 | * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value | 44 | * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value |
| 69 | * @secs: seconds to set | 45 | * @secs: seconds to set |
| @@ -71,13 +47,12 @@ typedef union ktime ktime_t; /* Kill this */ | |||
| 71 | * | 47 | * |
| 72 | * Return: The ktime_t representation of the value. | 48 | * Return: The ktime_t representation of the value. |
| 73 | */ | 49 | */ |
| 74 | static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) | 50 | static inline ktime_t ktime_set(const s64 secs, const unsigned long nsecs) |
| 75 | { | 51 | { |
| 76 | #if (BITS_PER_LONG == 64) | ||
| 77 | if (unlikely(secs >= KTIME_SEC_MAX)) | 52 | if (unlikely(secs >= KTIME_SEC_MAX)) |
| 78 | return (ktime_t){ .tv64 = KTIME_MAX }; | 53 | return (ktime_t){ .tv64 = KTIME_MAX }; |
| 79 | #endif | 54 | |
| 80 | return (ktime_t) { .tv64 = (s64)secs * NSEC_PER_SEC + (s64)nsecs }; | 55 | return (ktime_t) { .tv64 = secs * NSEC_PER_SEC + (s64)nsecs }; |
| 81 | } | 56 | } |
| 82 | 57 | ||
| 83 | /* Subtract two ktime_t variables. rem = lhs -rhs: */ | 58 | /* Subtract two ktime_t variables. rem = lhs -rhs: */ |
| @@ -108,6 +83,12 @@ static inline ktime_t timespec_to_ktime(struct timespec ts) | |||
| 108 | return ktime_set(ts.tv_sec, ts.tv_nsec); | 83 | return ktime_set(ts.tv_sec, ts.tv_nsec); |
| 109 | } | 84 | } |
| 110 | 85 | ||
| 86 | /* convert a timespec64 to ktime_t format: */ | ||
| 87 | static inline ktime_t timespec64_to_ktime(struct timespec64 ts) | ||
| 88 | { | ||
| 89 | return ktime_set(ts.tv_sec, ts.tv_nsec); | ||
| 90 | } | ||
| 91 | |||
| 111 | /* convert a timeval to ktime_t format: */ | 92 | /* convert a timeval to ktime_t format: */ |
| 112 | static inline ktime_t timeval_to_ktime(struct timeval tv) | 93 | static inline ktime_t timeval_to_ktime(struct timeval tv) |
| 113 | { | 94 | { |
| @@ -117,159 +98,15 @@ static inline ktime_t timeval_to_ktime(struct timeval tv) | |||
| 117 | /* Map the ktime_t to timespec conversion to ns_to_timespec function */ | 98 | /* Map the ktime_t to timespec conversion to ns_to_timespec function */ |
| 118 | #define ktime_to_timespec(kt) ns_to_timespec((kt).tv64) | 99 | #define ktime_to_timespec(kt) ns_to_timespec((kt).tv64) |
| 119 | 100 | ||
| 101 | /* Map the ktime_t to timespec conversion to ns_to_timespec function */ | ||
| 102 | #define ktime_to_timespec64(kt) ns_to_timespec64((kt).tv64) | ||
| 103 | |||
| 120 | /* Map the ktime_t to timeval conversion to ns_to_timeval function */ | 104 | /* Map the ktime_t to timeval conversion to ns_to_timeval function */ |
| 121 | #define ktime_to_timeval(kt) ns_to_timeval((kt).tv64) | 105 | #define ktime_to_timeval(kt) ns_to_timeval((kt).tv64) |
| 122 | 106 | ||
| 123 | /* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */ | 107 | /* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */ |
| 124 | #define ktime_to_ns(kt) ((kt).tv64) | 108 | #define ktime_to_ns(kt) ((kt).tv64) |
| 125 | 109 | ||
| 126 | #else /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */ | ||
| 127 | |||
| 128 | /* | ||
| 129 | * Helper macros/inlines to get the ktime_t math right in the timespec | ||
| 130 | * representation. The macros are sometimes ugly - their actual use is | ||
| 131 | * pretty okay-ish, given the circumstances. We do all this for | ||
| 132 | * performance reasons. The pure scalar nsec_t based code was nice and | ||
| 133 | * simple, but created too many 64-bit / 32-bit conversions and divisions. | ||
| 134 | * | ||
| 135 | * Be especially aware that negative values are represented in a way | ||
| 136 | * that the tv.sec field is negative and the tv.nsec field is greater | ||
| 137 | * or equal to zero but less than nanoseconds per second. This is the | ||
| 138 | * same representation which is used by timespecs. | ||
| 139 | * | ||
| 140 | * tv.sec < 0 and 0 >= tv.nsec < NSEC_PER_SEC | ||
| 141 | */ | ||
| 142 | |||
| 143 | /* Set a ktime_t variable to a value in sec/nsec representation: */ | ||
| 144 | static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) | ||
| 145 | { | ||
| 146 | return (ktime_t) { .tv = { .sec = secs, .nsec = nsecs } }; | ||
| 147 | } | ||
| 148 | |||
| 149 | /** | ||
| 150 | * ktime_sub - subtract two ktime_t variables | ||
| 151 | * @lhs: minuend | ||
| 152 | * @rhs: subtrahend | ||
| 153 | * | ||
| 154 | * Return: The remainder of the subtraction. | ||
| 155 | */ | ||
| 156 | static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs) | ||
| 157 | { | ||
| 158 | ktime_t res; | ||
| 159 | |||
| 160 | res.tv64 = lhs.tv64 - rhs.tv64; | ||
| 161 | if (res.tv.nsec < 0) | ||
| 162 | res.tv.nsec += NSEC_PER_SEC; | ||
| 163 | |||
| 164 | return res; | ||
| 165 | } | ||
| 166 | |||
| 167 | /** | ||
| 168 | * ktime_add - add two ktime_t variables | ||
| 169 | * @add1: addend1 | ||
| 170 | * @add2: addend2 | ||
| 171 | * | ||
| 172 | * Return: The sum of @add1 and @add2. | ||
| 173 | */ | ||
| 174 | static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2) | ||
| 175 | { | ||
| 176 | ktime_t res; | ||
| 177 | |||
| 178 | res.tv64 = add1.tv64 + add2.tv64; | ||
| 179 | /* | ||
| 180 | * performance trick: the (u32) -NSEC gives 0x00000000Fxxxxxxx | ||
| 181 | * so we subtract NSEC_PER_SEC and add 1 to the upper 32 bit. | ||
| 182 | * | ||
| 183 | * it's equivalent to: | ||
| 184 | * tv.nsec -= NSEC_PER_SEC | ||
| 185 | * tv.sec ++; | ||
| 186 | */ | ||
| 187 | if (res.tv.nsec >= NSEC_PER_SEC) | ||
| 188 | res.tv64 += (u32)-NSEC_PER_SEC; | ||
| 189 | |||
| 190 | return res; | ||
| 191 | } | ||
| 192 | |||
| 193 | /** | ||
| 194 | * ktime_add_ns - Add a scalar nanoseconds value to a ktime_t variable | ||
| 195 | * @kt: addend | ||
| 196 | * @nsec: the scalar nsec value to add | ||
| 197 | * | ||
| 198 | * Return: The sum of @kt and @nsec in ktime_t format. | ||
| 199 | */ | ||
| 200 | extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec); | ||
| 201 | |||
| 202 | /** | ||
| 203 | * ktime_sub_ns - Subtract a scalar nanoseconds value from a ktime_t variable | ||
| 204 | * @kt: minuend | ||
| 205 | * @nsec: the scalar nsec value to subtract | ||
| 206 | * | ||
| 207 | * Return: The subtraction of @nsec from @kt in ktime_t format. | ||
| 208 | */ | ||
| 209 | extern ktime_t ktime_sub_ns(const ktime_t kt, u64 nsec); | ||
| 210 | |||
| 211 | /** | ||
| 212 | * timespec_to_ktime - convert a timespec to ktime_t format | ||
| 213 | * @ts: the timespec variable to convert | ||
| 214 | * | ||
| 215 | * Return: A ktime_t variable with the converted timespec value. | ||
| 216 | */ | ||
| 217 | static inline ktime_t timespec_to_ktime(const struct timespec ts) | ||
| 218 | { | ||
| 219 | return (ktime_t) { .tv = { .sec = (s32)ts.tv_sec, | ||
| 220 | .nsec = (s32)ts.tv_nsec } }; | ||
| 221 | } | ||
| 222 | |||
| 223 | /** | ||
| 224 | * timeval_to_ktime - convert a timeval to ktime_t format | ||
| 225 | * @tv: the timeval variable to convert | ||
| 226 | * | ||
| 227 | * Return: A ktime_t variable with the converted timeval value. | ||
| 228 | */ | ||
| 229 | static inline ktime_t timeval_to_ktime(const struct timeval tv) | ||
| 230 | { | ||
| 231 | return (ktime_t) { .tv = { .sec = (s32)tv.tv_sec, | ||
| 232 | .nsec = (s32)(tv.tv_usec * | ||
| 233 | NSEC_PER_USEC) } }; | ||
| 234 | } | ||
| 235 | |||
| 236 | /** | ||
| 237 | * ktime_to_timespec - convert a ktime_t variable to timespec format | ||
| 238 | * @kt: the ktime_t variable to convert | ||
| 239 | * | ||
| 240 | * Return: The timespec representation of the ktime value. | ||
| 241 | */ | ||
| 242 | static inline struct timespec ktime_to_timespec(const ktime_t kt) | ||
| 243 | { | ||
| 244 | return (struct timespec) { .tv_sec = (time_t) kt.tv.sec, | ||
| 245 | .tv_nsec = (long) kt.tv.nsec }; | ||
| 246 | } | ||
| 247 | |||
| 248 | /** | ||
| 249 | * ktime_to_timeval - convert a ktime_t variable to timeval format | ||
| 250 | * @kt: the ktime_t variable to convert | ||
| 251 | * | ||
| 252 | * Return: The timeval representation of the ktime value. | ||
| 253 | */ | ||
| 254 | static inline struct timeval ktime_to_timeval(const ktime_t kt) | ||
| 255 | { | ||
| 256 | return (struct timeval) { | ||
| 257 | .tv_sec = (time_t) kt.tv.sec, | ||
| 258 | .tv_usec = (suseconds_t) (kt.tv.nsec / NSEC_PER_USEC) }; | ||
| 259 | } | ||
| 260 | |||
| 261 | /** | ||
| 262 | * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds | ||
| 263 | * @kt: the ktime_t variable to convert | ||
| 264 | * | ||
| 265 | * Return: The scalar nanoseconds representation of @kt. | ||
| 266 | */ | ||
| 267 | static inline s64 ktime_to_ns(const ktime_t kt) | ||
| 268 | { | ||
| 269 | return (s64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec; | ||
| 270 | } | ||
| 271 | |||
| 272 | #endif /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */ | ||
| 273 | 110 | ||
| 274 | /** | 111 | /** |
| 275 | * ktime_equal - Compares two ktime_t variables to see if they are equal | 112 | * ktime_equal - Compares two ktime_t variables to see if they are equal |
| @@ -328,16 +165,20 @@ static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2) | |||
| 328 | return ktime_compare(cmp1, cmp2) < 0; | 165 | return ktime_compare(cmp1, cmp2) < 0; |
| 329 | } | 166 | } |
| 330 | 167 | ||
| 168 | #if BITS_PER_LONG < 64 | ||
| 169 | extern u64 ktime_divns(const ktime_t kt, s64 div); | ||
| 170 | #else /* BITS_PER_LONG < 64 */ | ||
| 171 | # define ktime_divns(kt, div) (u64)((kt).tv64 / (div)) | ||
| 172 | #endif | ||
| 173 | |||
| 331 | static inline s64 ktime_to_us(const ktime_t kt) | 174 | static inline s64 ktime_to_us(const ktime_t kt) |
| 332 | { | 175 | { |
| 333 | struct timeval tv = ktime_to_timeval(kt); | 176 | return ktime_divns(kt, NSEC_PER_USEC); |
| 334 | return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec; | ||
| 335 | } | 177 | } |
| 336 | 178 | ||
| 337 | static inline s64 ktime_to_ms(const ktime_t kt) | 179 | static inline s64 ktime_to_ms(const ktime_t kt) |
| 338 | { | 180 | { |
| 339 | struct timeval tv = ktime_to_timeval(kt); | 181 | return ktime_divns(kt, NSEC_PER_MSEC); |
| 340 | return (s64) tv.tv_sec * MSEC_PER_SEC + tv.tv_usec / USEC_PER_MSEC; | ||
| 341 | } | 182 | } |
| 342 | 183 | ||
| 343 | static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier) | 184 | static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier) |
| @@ -381,6 +222,25 @@ static inline __must_check bool ktime_to_timespec_cond(const ktime_t kt, | |||
| 381 | } | 222 | } |
| 382 | } | 223 | } |
| 383 | 224 | ||
| 225 | /** | ||
| 226 | * ktime_to_timespec64_cond - convert a ktime_t variable to timespec64 | ||
| 227 | * format only if the variable contains data | ||
| 228 | * @kt: the ktime_t variable to convert | ||
| 229 | * @ts: the timespec variable to store the result in | ||
| 230 | * | ||
| 231 | * Return: %true if there was a successful conversion, %false if kt was 0. | ||
| 232 | */ | ||
| 233 | static inline __must_check bool ktime_to_timespec64_cond(const ktime_t kt, | ||
| 234 | struct timespec64 *ts) | ||
| 235 | { | ||
| 236 | if (kt.tv64) { | ||
| 237 | *ts = ktime_to_timespec64(kt); | ||
| 238 | return true; | ||
| 239 | } else { | ||
| 240 | return false; | ||
| 241 | } | ||
| 242 | } | ||
| 243 | |||
| 384 | /* | 244 | /* |
| 385 | * The resolution of the clocks. The resolution value is returned in | 245 | * The resolution of the clocks. The resolution value is returned in |
| 386 | * the clock_getres() system call to give application programmers an | 246 | * the clock_getres() system call to give application programmers an |
| @@ -390,12 +250,6 @@ static inline __must_check bool ktime_to_timespec_cond(const ktime_t kt, | |||
| 390 | #define LOW_RES_NSEC TICK_NSEC | 250 | #define LOW_RES_NSEC TICK_NSEC |
| 391 | #define KTIME_LOW_RES (ktime_t){ .tv64 = LOW_RES_NSEC } | 251 | #define KTIME_LOW_RES (ktime_t){ .tv64 = LOW_RES_NSEC } |
| 392 | 252 | ||
| 393 | /* Get the monotonic time in timespec format: */ | ||
| 394 | extern void ktime_get_ts(struct timespec *ts); | ||
| 395 | |||
| 396 | /* Get the real (wall-) time in timespec format: */ | ||
| 397 | #define ktime_get_real_ts(ts) getnstimeofday(ts) | ||
| 398 | |||
| 399 | static inline ktime_t ns_to_ktime(u64 ns) | 253 | static inline ktime_t ns_to_ktime(u64 ns) |
| 400 | { | 254 | { |
| 401 | static const ktime_t ktime_zero = { .tv64 = 0 }; | 255 | static const ktime_t ktime_zero = { .tv64 = 0 }; |
| @@ -410,4 +264,6 @@ static inline ktime_t ms_to_ktime(u64 ms) | |||
| 410 | return ktime_add_ms(ktime_zero, ms); | 264 | return ktime_add_ms(ktime_zero, ms); |
| 411 | } | 265 | } |
| 412 | 266 | ||
| 267 | # include <linux/timekeeping.h> | ||
| 268 | |||
| 413 | #endif | 269 | #endif |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 5ab4e3a76721..92abb497ab14 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -593,6 +593,7 @@ struct ata_host { | |||
| 593 | struct device *dev; | 593 | struct device *dev; |
| 594 | void __iomem * const *iomap; | 594 | void __iomem * const *iomap; |
| 595 | unsigned int n_ports; | 595 | unsigned int n_ports; |
| 596 | unsigned int n_tags; /* nr of NCQ tags */ | ||
| 596 | void *private_data; | 597 | void *private_data; |
| 597 | struct ata_port_operations *ops; | 598 | struct ata_port_operations *ops; |
| 598 | unsigned long flags; | 599 | unsigned long flags; |
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h index 6d9371f88875..a614b33d0a39 100644 --- a/include/linux/mfd/arizona/core.h +++ b/include/linux/mfd/arizona/core.h | |||
| @@ -110,6 +110,12 @@ struct arizona { | |||
| 110 | int clk32k_ref; | 110 | int clk32k_ref; |
| 111 | 111 | ||
| 112 | struct snd_soc_dapm_context *dapm; | 112 | struct snd_soc_dapm_context *dapm; |
| 113 | |||
| 114 | int tdm_width[ARIZONA_MAX_AIF]; | ||
| 115 | int tdm_slots[ARIZONA_MAX_AIF]; | ||
| 116 | |||
| 117 | uint16_t dac_comp_coeff; | ||
| 118 | uint8_t dac_comp_enabled; | ||
| 113 | }; | 119 | }; |
| 114 | 120 | ||
| 115 | int arizona_clk32k_enable(struct arizona *arizona); | 121 | int arizona_clk32k_enable(struct arizona *arizona); |
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h index 12a5c135c746..4578c72c9b86 100644 --- a/include/linux/mfd/arizona/pdata.h +++ b/include/linux/mfd/arizona/pdata.h | |||
| @@ -127,6 +127,9 @@ struct arizona_pdata { | |||
| 127 | /** Internal pull on GPIO5 is disabled when used for jack detection */ | 127 | /** Internal pull on GPIO5 is disabled when used for jack detection */ |
| 128 | bool jd_gpio5_nopull; | 128 | bool jd_gpio5_nopull; |
| 129 | 129 | ||
| 130 | /** set to true if jackdet contact opens on insert */ | ||
| 131 | bool jd_invert; | ||
| 132 | |||
| 130 | /** Use the headphone detect circuit to identify the accessory */ | 133 | /** Use the headphone detect circuit to identify the accessory */ |
| 131 | bool hpdet_acc_id; | 134 | bool hpdet_acc_id; |
| 132 | 135 | ||
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index 3e050b933dd0..c466ff3e16b8 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h | |||
| @@ -262,6 +262,41 @@ enum max77693_irq_source { | |||
| 262 | MAX77693_IRQ_GROUP_NR, | 262 | MAX77693_IRQ_GROUP_NR, |
| 263 | }; | 263 | }; |
| 264 | 264 | ||
| 265 | #define LED_IRQ_FLED2_OPEN BIT(0) | ||
| 266 | #define LED_IRQ_FLED2_SHORT BIT(1) | ||
| 267 | #define LED_IRQ_FLED1_OPEN BIT(2) | ||
| 268 | #define LED_IRQ_FLED1_SHORT BIT(3) | ||
| 269 | #define LED_IRQ_MAX_FLASH BIT(4) | ||
| 270 | |||
| 271 | #define TOPSYS_IRQ_T120C_INT BIT(0) | ||
| 272 | #define TOPSYS_IRQ_T140C_INT BIT(1) | ||
| 273 | #define TOPSYS_IRQ_LOWSYS_INT BIT(3) | ||
| 274 | |||
| 275 | #define CHG_IRQ_BYP_I BIT(0) | ||
| 276 | #define CHG_IRQ_THM_I BIT(2) | ||
| 277 | #define CHG_IRQ_BAT_I BIT(3) | ||
| 278 | #define CHG_IRQ_CHG_I BIT(4) | ||
| 279 | #define CHG_IRQ_CHGIN_I BIT(6) | ||
| 280 | |||
| 281 | #define MUIC_IRQ_INT1_ADC BIT(0) | ||
| 282 | #define MUIC_IRQ_INT1_ADC_LOW BIT(1) | ||
| 283 | #define MUIC_IRQ_INT1_ADC_ERR BIT(2) | ||
| 284 | #define MUIC_IRQ_INT1_ADC1K BIT(3) | ||
| 285 | |||
| 286 | #define MUIC_IRQ_INT2_CHGTYP BIT(0) | ||
| 287 | #define MUIC_IRQ_INT2_CHGDETREUN BIT(1) | ||
| 288 | #define MUIC_IRQ_INT2_DCDTMR BIT(2) | ||
| 289 | #define MUIC_IRQ_INT2_DXOVP BIT(3) | ||
| 290 | #define MUIC_IRQ_INT2_VBVOLT BIT(4) | ||
| 291 | #define MUIC_IRQ_INT2_VIDRM BIT(5) | ||
| 292 | |||
| 293 | #define MUIC_IRQ_INT3_EOC BIT(0) | ||
| 294 | #define MUIC_IRQ_INT3_CGMBC BIT(1) | ||
| 295 | #define MUIC_IRQ_INT3_OVP BIT(2) | ||
| 296 | #define MUIC_IRQ_INT3_MBCCHG_ERR BIT(3) | ||
| 297 | #define MUIC_IRQ_INT3_CHG_ENABLED BIT(4) | ||
| 298 | #define MUIC_IRQ_INT3_BAT_DET BIT(5) | ||
| 299 | |||
| 265 | enum max77693_irq { | 300 | enum max77693_irq { |
| 266 | /* PMIC - FLASH */ | 301 | /* PMIC - FLASH */ |
| 267 | MAX77693_LED_IRQ_FLED2_OPEN, | 302 | MAX77693_LED_IRQ_FLED2_OPEN, |
| @@ -282,6 +317,10 @@ enum max77693_irq { | |||
| 282 | MAX77693_CHG_IRQ_CHG_I, | 317 | MAX77693_CHG_IRQ_CHG_I, |
| 283 | MAX77693_CHG_IRQ_CHGIN_I, | 318 | MAX77693_CHG_IRQ_CHGIN_I, |
| 284 | 319 | ||
| 320 | MAX77693_IRQ_NR, | ||
| 321 | }; | ||
| 322 | |||
| 323 | enum max77693_irq_muic { | ||
| 285 | /* MUIC INT1 */ | 324 | /* MUIC INT1 */ |
| 286 | MAX77693_MUIC_IRQ_INT1_ADC, | 325 | MAX77693_MUIC_IRQ_INT1_ADC, |
| 287 | MAX77693_MUIC_IRQ_INT1_ADC_LOW, | 326 | MAX77693_MUIC_IRQ_INT1_ADC_LOW, |
| @@ -304,7 +343,7 @@ enum max77693_irq { | |||
| 304 | MAX77693_MUIC_IRQ_INT3_CHG_ENABLED, | 343 | MAX77693_MUIC_IRQ_INT3_CHG_ENABLED, |
| 305 | MAX77693_MUIC_IRQ_INT3_BAT_DET, | 344 | MAX77693_MUIC_IRQ_INT3_BAT_DET, |
| 306 | 345 | ||
| 307 | MAX77693_IRQ_NR, | 346 | MAX77693_MUIC_IRQ_NR, |
| 308 | }; | 347 | }; |
| 309 | 348 | ||
| 310 | struct max77693_dev { | 349 | struct max77693_dev { |
| @@ -319,7 +358,10 @@ struct max77693_dev { | |||
| 319 | struct regmap *regmap_muic; | 358 | struct regmap *regmap_muic; |
| 320 | struct regmap *regmap_haptic; | 359 | struct regmap *regmap_haptic; |
| 321 | 360 | ||
| 322 | struct irq_domain *irq_domain; | 361 | struct regmap_irq_chip_data *irq_data_led; |
| 362 | struct regmap_irq_chip_data *irq_data_topsys; | ||
| 363 | struct regmap_irq_chip_data *irq_data_charger; | ||
| 364 | struct regmap_irq_chip_data *irq_data_muic; | ||
| 323 | 365 | ||
| 324 | int irq; | 366 | int irq; |
| 325 | int irq_gpio; | 367 | int irq_gpio; |
| @@ -332,14 +374,6 @@ enum max77693_types { | |||
| 332 | TYPE_MAX77693, | 374 | TYPE_MAX77693, |
| 333 | }; | 375 | }; |
| 334 | 376 | ||
| 335 | extern int max77693_read_reg(struct regmap *map, u8 reg, u8 *dest); | ||
| 336 | extern int max77693_bulk_read(struct regmap *map, u8 reg, int count, | ||
| 337 | u8 *buf); | ||
| 338 | extern int max77693_write_reg(struct regmap *map, u8 reg, u8 value); | ||
| 339 | extern int max77693_bulk_write(struct regmap *map, u8 reg, int count, | ||
| 340 | u8 *buf); | ||
| 341 | extern int max77693_update_reg(struct regmap *map, u8 reg, u8 val, u8 mask); | ||
| 342 | |||
| 343 | extern int max77693_irq_init(struct max77693_dev *max77686); | 377 | extern int max77693_irq_init(struct max77693_dev *max77686); |
| 344 | extern void max77693_irq_exit(struct max77693_dev *max77686); | 378 | extern void max77693_irq_exit(struct max77693_dev *max77686); |
| 345 | extern int max77693_irq_resume(struct max77693_dev *max77686); | 379 | extern int max77693_irq_resume(struct max77693_dev *max77686); |
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 3420e09e2e20..fb0390a1a498 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | #define PALMAS_CHIP_ID 0xC035 | 30 | #define PALMAS_CHIP_ID 0xC035 |
| 31 | #define PALMAS_CHIP_CHARGER_ID 0xC036 | 31 | #define PALMAS_CHIP_CHARGER_ID 0xC036 |
| 32 | 32 | ||
| 33 | #define TPS65917_RESERVED -1 | ||
| 34 | |||
| 33 | #define is_palmas(a) (((a) == PALMAS_CHIP_OLD_ID) || \ | 35 | #define is_palmas(a) (((a) == PALMAS_CHIP_OLD_ID) || \ |
| 34 | ((a) == PALMAS_CHIP_ID)) | 36 | ((a) == PALMAS_CHIP_ID)) |
| 35 | #define is_palmas_charger(a) ((a) == PALMAS_CHIP_CHARGER_ID) | 37 | #define is_palmas_charger(a) ((a) == PALMAS_CHIP_CHARGER_ID) |
| @@ -51,6 +53,8 @@ struct palmas_pmic; | |||
| 51 | struct palmas_gpadc; | 53 | struct palmas_gpadc; |
| 52 | struct palmas_resource; | 54 | struct palmas_resource; |
| 53 | struct palmas_usb; | 55 | struct palmas_usb; |
| 56 | struct palmas_pmic_driver_data; | ||
| 57 | struct palmas_pmic_platform_data; | ||
| 54 | 58 | ||
| 55 | enum palmas_usb_state { | 59 | enum palmas_usb_state { |
| 56 | PALMAS_USB_STATE_DISCONNECT, | 60 | PALMAS_USB_STATE_DISCONNECT, |
| @@ -74,6 +78,8 @@ struct palmas { | |||
| 74 | struct mutex irq_lock; | 78 | struct mutex irq_lock; |
| 75 | struct regmap_irq_chip_data *irq_data; | 79 | struct regmap_irq_chip_data *irq_data; |
| 76 | 80 | ||
| 81 | struct palmas_pmic_driver_data *pmic_ddata; | ||
| 82 | |||
| 77 | /* Child Devices */ | 83 | /* Child Devices */ |
| 78 | struct palmas_pmic *pmic; | 84 | struct palmas_pmic *pmic; |
| 79 | struct palmas_gpadc *gpadc; | 85 | struct palmas_gpadc *gpadc; |
| @@ -86,6 +92,46 @@ struct palmas { | |||
| 86 | u8 pwm_muxed; | 92 | u8 pwm_muxed; |
| 87 | }; | 93 | }; |
| 88 | 94 | ||
| 95 | #define PALMAS_EXT_REQ (PALMAS_EXT_CONTROL_ENABLE1 | \ | ||
| 96 | PALMAS_EXT_CONTROL_ENABLE2 | \ | ||
| 97 | PALMAS_EXT_CONTROL_NSLEEP) | ||
| 98 | |||
| 99 | struct palmas_sleep_requestor_info { | ||
| 100 | int id; | ||
| 101 | int reg_offset; | ||
| 102 | int bit_pos; | ||
| 103 | }; | ||
| 104 | |||
| 105 | struct palmas_regs_info { | ||
| 106 | char *name; | ||
| 107 | char *sname; | ||
| 108 | u8 vsel_addr; | ||
| 109 | u8 ctrl_addr; | ||
| 110 | u8 tstep_addr; | ||
| 111 | int sleep_id; | ||
| 112 | }; | ||
| 113 | |||
| 114 | struct palmas_pmic_driver_data { | ||
| 115 | int smps_start; | ||
| 116 | int smps_end; | ||
| 117 | int ldo_begin; | ||
| 118 | int ldo_end; | ||
| 119 | int max_reg; | ||
| 120 | struct palmas_regs_info *palmas_regs_info; | ||
| 121 | struct of_regulator_match *palmas_matches; | ||
| 122 | struct palmas_sleep_requestor_info *sleep_req_info; | ||
| 123 | int (*smps_register)(struct palmas_pmic *pmic, | ||
| 124 | struct palmas_pmic_driver_data *ddata, | ||
| 125 | struct palmas_pmic_platform_data *pdata, | ||
| 126 | const char *pdev_name, | ||
| 127 | struct regulator_config config); | ||
| 128 | int (*ldo_register)(struct palmas_pmic *pmic, | ||
| 129 | struct palmas_pmic_driver_data *ddata, | ||
| 130 | struct palmas_pmic_platform_data *pdata, | ||
| 131 | const char *pdev_name, | ||
| 132 | struct regulator_config config); | ||
| 133 | }; | ||
| 134 | |||
| 89 | struct palmas_gpadc_platform_data { | 135 | struct palmas_gpadc_platform_data { |
| 90 | /* Channel 3 current source is only enabled during conversion */ | 136 | /* Channel 3 current source is only enabled during conversion */ |
| 91 | int ch3_current; | 137 | int ch3_current; |
| @@ -184,6 +230,27 @@ enum palmas_regulators { | |||
| 184 | PALMAS_NUM_REGS, | 230 | PALMAS_NUM_REGS, |
| 185 | }; | 231 | }; |
| 186 | 232 | ||
| 233 | enum tps65917_regulators { | ||
| 234 | /* SMPS regulators */ | ||
| 235 | TPS65917_REG_SMPS1, | ||
| 236 | TPS65917_REG_SMPS2, | ||
| 237 | TPS65917_REG_SMPS3, | ||
| 238 | TPS65917_REG_SMPS4, | ||
| 239 | TPS65917_REG_SMPS5, | ||
| 240 | /* LDO regulators */ | ||
| 241 | TPS65917_REG_LDO1, | ||
| 242 | TPS65917_REG_LDO2, | ||
| 243 | TPS65917_REG_LDO3, | ||
| 244 | TPS65917_REG_LDO4, | ||
| 245 | TPS65917_REG_LDO5, | ||
| 246 | TPS65917_REG_REGEN1, | ||
| 247 | TPS65917_REG_REGEN2, | ||
| 248 | TPS65917_REG_REGEN3, | ||
| 249 | |||
| 250 | /* Total number of regulators */ | ||
| 251 | TPS65917_NUM_REGS, | ||
| 252 | }; | ||
| 253 | |||
| 187 | /* External controll signal name */ | 254 | /* External controll signal name */ |
| 188 | enum { | 255 | enum { |
| 189 | PALMAS_EXT_CONTROL_ENABLE1 = 0x1, | 256 | PALMAS_EXT_CONTROL_ENABLE1 = 0x1, |
| @@ -228,6 +295,24 @@ enum palmas_external_requestor_id { | |||
| 228 | PALMAS_EXTERNAL_REQSTR_ID_MAX, | 295 | PALMAS_EXTERNAL_REQSTR_ID_MAX, |
| 229 | }; | 296 | }; |
| 230 | 297 | ||
| 298 | enum tps65917_external_requestor_id { | ||
| 299 | TPS65917_EXTERNAL_REQSTR_ID_REGEN1, | ||
| 300 | TPS65917_EXTERNAL_REQSTR_ID_REGEN2, | ||
| 301 | TPS65917_EXTERNAL_REQSTR_ID_REGEN3, | ||
| 302 | TPS65917_EXTERNAL_REQSTR_ID_SMPS1, | ||
| 303 | TPS65917_EXTERNAL_REQSTR_ID_SMPS2, | ||
| 304 | TPS65917_EXTERNAL_REQSTR_ID_SMPS3, | ||
| 305 | TPS65917_EXTERNAL_REQSTR_ID_SMPS4, | ||
| 306 | TPS65917_EXTERNAL_REQSTR_ID_SMPS5, | ||
| 307 | TPS65917_EXTERNAL_REQSTR_ID_LDO1, | ||
| 308 | TPS65917_EXTERNAL_REQSTR_ID_LDO2, | ||
| 309 | TPS65917_EXTERNAL_REQSTR_ID_LDO3, | ||
| 310 | TPS65917_EXTERNAL_REQSTR_ID_LDO4, | ||
| 311 | TPS65917_EXTERNAL_REQSTR_ID_LDO5, | ||
| 312 | /* Last entry */ | ||
| 313 | TPS65917_EXTERNAL_REQSTR_ID_MAX, | ||
| 314 | }; | ||
| 315 | |||
| 231 | struct palmas_pmic_platform_data { | 316 | struct palmas_pmic_platform_data { |
| 232 | /* An array of pointers to regulator init data indexed by regulator | 317 | /* An array of pointers to regulator init data indexed by regulator |
| 233 | * ID | 318 | * ID |
| @@ -349,6 +434,48 @@ struct palmas_gpadc_result { | |||
| 349 | 434 | ||
| 350 | #define PALMAS_MAX_CHANNELS 16 | 435 | #define PALMAS_MAX_CHANNELS 16 |
| 351 | 436 | ||
| 437 | /* Define the tps65917 IRQ numbers */ | ||
| 438 | enum tps65917_irqs { | ||
| 439 | /* INT1 registers */ | ||
| 440 | TPS65917_RESERVED1, | ||
| 441 | TPS65917_PWRON_IRQ, | ||
| 442 | TPS65917_LONG_PRESS_KEY_IRQ, | ||
| 443 | TPS65917_RESERVED2, | ||
| 444 | TPS65917_PWRDOWN_IRQ, | ||
| 445 | TPS65917_HOTDIE_IRQ, | ||
| 446 | TPS65917_VSYS_MON_IRQ, | ||
| 447 | TPS65917_RESERVED3, | ||
| 448 | /* INT2 registers */ | ||
| 449 | TPS65917_RESERVED4, | ||
| 450 | TPS65917_OTP_ERROR_IRQ, | ||
| 451 | TPS65917_WDT_IRQ, | ||
| 452 | TPS65917_RESERVED5, | ||
| 453 | TPS65917_RESET_IN_IRQ, | ||
| 454 | TPS65917_FSD_IRQ, | ||
| 455 | TPS65917_SHORT_IRQ, | ||
| 456 | TPS65917_RESERVED6, | ||
| 457 | /* INT3 registers */ | ||
| 458 | TPS65917_GPADC_AUTO_0_IRQ, | ||
| 459 | TPS65917_GPADC_AUTO_1_IRQ, | ||
| 460 | TPS65917_GPADC_EOC_SW_IRQ, | ||
| 461 | TPS65917_RESREVED6, | ||
| 462 | TPS65917_RESERVED7, | ||
| 463 | TPS65917_RESERVED8, | ||
| 464 | TPS65917_RESERVED9, | ||
| 465 | TPS65917_VBUS_IRQ, | ||
| 466 | /* INT4 registers */ | ||
| 467 | TPS65917_GPIO_0_IRQ, | ||
| 468 | TPS65917_GPIO_1_IRQ, | ||
| 469 | TPS65917_GPIO_2_IRQ, | ||
| 470 | TPS65917_GPIO_3_IRQ, | ||
| 471 | TPS65917_GPIO_4_IRQ, | ||
| 472 | TPS65917_GPIO_5_IRQ, | ||
| 473 | TPS65917_GPIO_6_IRQ, | ||
| 474 | TPS65917_RESERVED10, | ||
| 475 | /* Total Number IRQs */ | ||
| 476 | TPS65917_NUM_IRQ, | ||
| 477 | }; | ||
| 478 | |||
| 352 | /* Define the palmas IRQ numbers */ | 479 | /* Define the palmas IRQ numbers */ |
| 353 | enum palmas_irqs { | 480 | enum palmas_irqs { |
| 354 | /* INT1 registers */ | 481 | /* INT1 registers */ |
| @@ -400,6 +527,7 @@ struct palmas_pmic { | |||
| 400 | 527 | ||
| 401 | int smps123; | 528 | int smps123; |
| 402 | int smps457; | 529 | int smps457; |
| 530 | int smps12; | ||
| 403 | 531 | ||
| 404 | int range[PALMAS_REG_SMPS10_OUT1]; | 532 | int range[PALMAS_REG_SMPS10_OUT1]; |
| 405 | unsigned int ramp_delay[PALMAS_REG_SMPS10_OUT1]; | 533 | unsigned int ramp_delay[PALMAS_REG_SMPS10_OUT1]; |
| @@ -2871,6 +2999,715 @@ enum usb_irq_events { | |||
| 2871 | #define PALMAS_GPADC_TRIM15 0x0E | 2999 | #define PALMAS_GPADC_TRIM15 0x0E |
| 2872 | #define PALMAS_GPADC_TRIM16 0x0F | 3000 | #define PALMAS_GPADC_TRIM16 0x0F |
| 2873 | 3001 | ||
| 3002 | /* TPS65917 Interrupt registers */ | ||
| 3003 | |||
| 3004 | /* Registers for function INTERRUPT */ | ||
| 3005 | #define TPS65917_INT1_STATUS 0x00 | ||
| 3006 | #define TPS65917_INT1_MASK 0x01 | ||
| 3007 | #define TPS65917_INT1_LINE_STATE 0x02 | ||
| 3008 | #define TPS65917_INT2_STATUS 0x05 | ||
| 3009 | #define TPS65917_INT2_MASK 0x06 | ||
| 3010 | #define TPS65917_INT2_LINE_STATE 0x07 | ||
| 3011 | #define TPS65917_INT3_STATUS 0x0A | ||
| 3012 | #define TPS65917_INT3_MASK 0x0B | ||
| 3013 | #define TPS65917_INT3_LINE_STATE 0x0C | ||
| 3014 | #define TPS65917_INT4_STATUS 0x0F | ||
| 3015 | #define TPS65917_INT4_MASK 0x10 | ||
| 3016 | #define TPS65917_INT4_LINE_STATE 0x11 | ||
| 3017 | #define TPS65917_INT4_EDGE_DETECT1 0x12 | ||
| 3018 | #define TPS65917_INT4_EDGE_DETECT2 0x13 | ||
| 3019 | #define TPS65917_INT_CTRL 0x14 | ||
| 3020 | |||
| 3021 | /* Bit definitions for INT1_STATUS */ | ||
| 3022 | #define TPS65917_INT1_STATUS_VSYS_MON 0x40 | ||
| 3023 | #define TPS65917_INT1_STATUS_VSYS_MON_SHIFT 0x06 | ||
| 3024 | #define TPS65917_INT1_STATUS_HOTDIE 0x20 | ||
| 3025 | #define TPS65917_INT1_STATUS_HOTDIE_SHIFT 0x05 | ||
| 3026 | #define TPS65917_INT1_STATUS_PWRDOWN 0x10 | ||
| 3027 | #define TPS65917_INT1_STATUS_PWRDOWN_SHIFT 0x04 | ||
| 3028 | #define TPS65917_INT1_STATUS_LONG_PRESS_KEY 0x04 | ||
| 3029 | #define TPS65917_INT1_STATUS_LONG_PRESS_KEY_SHIFT 0x02 | ||
| 3030 | #define TPS65917_INT1_STATUS_PWRON 0x02 | ||
| 3031 | #define TPS65917_INT1_STATUS_PWRON_SHIFT 0x01 | ||
| 3032 | |||
| 3033 | /* Bit definitions for INT1_MASK */ | ||
| 3034 | #define TPS65917_INT1_MASK_VSYS_MON 0x40 | ||
| 3035 | #define TPS65917_INT1_MASK_VSYS_MON_SHIFT 0x06 | ||
| 3036 | #define TPS65917_INT1_MASK_HOTDIE 0x20 | ||
| 3037 | #define TPS65917_INT1_MASK_HOTDIE_SHIFT 0x05 | ||
| 3038 | #define TPS65917_INT1_MASK_PWRDOWN 0x10 | ||
| 3039 | #define TPS65917_INT1_MASK_PWRDOWN_SHIFT 0x04 | ||
| 3040 | #define TPS65917_INT1_MASK_LONG_PRESS_KEY 0x04 | ||
| 3041 | #define TPS65917_INT1_MASK_LONG_PRESS_KEY_SHIFT 0x02 | ||
| 3042 | #define TPS65917_INT1_MASK_PWRON 0x02 | ||
| 3043 | #define TPS65917_INT1_MASK_PWRON_SHIFT 0x01 | ||
| 3044 | |||
| 3045 | /* Bit definitions for INT1_LINE_STATE */ | ||
| 3046 | #define TPS65917_INT1_LINE_STATE_VSYS_MON 0x40 | ||
| 3047 | #define TPS65917_INT1_LINE_STATE_VSYS_MON_SHIFT 0x06 | ||
| 3048 | #define TPS65917_INT1_LINE_STATE_HOTDIE 0x20 | ||
| 3049 | #define TPS65917_INT1_LINE_STATE_HOTDIE_SHIFT 0x05 | ||
| 3050 | #define TPS65917_INT1_LINE_STATE_PWRDOWN 0x10 | ||
| 3051 | #define TPS65917_INT1_LINE_STATE_PWRDOWN_SHIFT 0x04 | ||
| 3052 | #define TPS65917_INT1_LINE_STATE_LONG_PRESS_KEY 0x04 | ||
| 3053 | #define TPS65917_INT1_LINE_STATE_LONG_PRESS_KEY_SHIFT 0x02 | ||
| 3054 | #define TPS65917_INT1_LINE_STATE_PWRON 0x02 | ||
| 3055 | #define TPS65917_INT1_LINE_STATE_PWRON_SHIFT 0x01 | ||
| 3056 | |||
| 3057 | /* Bit definitions for INT2_STATUS */ | ||
| 3058 | #define TPS65917_INT2_STATUS_SHORT 0x40 | ||
| 3059 | #define TPS65917_INT2_STATUS_SHORT_SHIFT 0x06 | ||
| 3060 | #define TPS65917_INT2_STATUS_FSD 0x20 | ||
| 3061 | #define TPS65917_INT2_STATUS_FSD_SHIFT 0x05 | ||
| 3062 | #define TPS65917_INT2_STATUS_RESET_IN 0x10 | ||
| 3063 | #define TPS65917_INT2_STATUS_RESET_IN_SHIFT 0x04 | ||
| 3064 | #define TPS65917_INT2_STATUS_WDT 0x04 | ||
| 3065 | #define TPS65917_INT2_STATUS_WDT_SHIFT 0x02 | ||
| 3066 | #define TPS65917_INT2_STATUS_OTP_ERROR 0x02 | ||
| 3067 | #define TPS65917_INT2_STATUS_OTP_ERROR_SHIFT 0x01 | ||
| 3068 | |||
| 3069 | /* Bit definitions for INT2_MASK */ | ||
| 3070 | #define TPS65917_INT2_MASK_SHORT 0x40 | ||
| 3071 | #define TPS65917_INT2_MASK_SHORT_SHIFT 0x06 | ||
| 3072 | #define TPS65917_INT2_MASK_FSD 0x20 | ||
| 3073 | #define TPS65917_INT2_MASK_FSD_SHIFT 0x05 | ||
| 3074 | #define TPS65917_INT2_MASK_RESET_IN 0x10 | ||
| 3075 | #define TPS65917_INT2_MASK_RESET_IN_SHIFT 0x04 | ||
| 3076 | #define TPS65917_INT2_MASK_WDT 0x04 | ||
| 3077 | #define TPS65917_INT2_MASK_WDT_SHIFT 0x02 | ||
| 3078 | #define TPS65917_INT2_MASK_OTP_ERROR_TIMER 0x02 | ||
| 3079 | #define TPS65917_INT2_MASK_OTP_ERROR_SHIFT 0x01 | ||
| 3080 | |||
| 3081 | /* Bit definitions for INT2_LINE_STATE */ | ||
| 3082 | #define TPS65917_INT2_LINE_STATE_SHORT 0x40 | ||
| 3083 | #define TPS65917_INT2_LINE_STATE_SHORT_SHIFT 0x06 | ||
| 3084 | #define TPS65917_INT2_LINE_STATE_FSD 0x20 | ||
| 3085 | #define TPS65917_INT2_LINE_STATE_FSD_SHIFT 0x05 | ||
| 3086 | #define TPS65917_INT2_LINE_STATE_RESET_IN 0x10 | ||
| 3087 | #define TPS65917_INT2_LINE_STATE_RESET_IN_SHIFT 0x04 | ||
| 3088 | #define TPS65917_INT2_LINE_STATE_WDT 0x04 | ||
| 3089 | #define TPS65917_INT2_LINE_STATE_WDT_SHIFT 0x02 | ||
| 3090 | #define TPS65917_INT2_LINE_STATE_OTP_ERROR 0x02 | ||
| 3091 | #define TPS65917_INT2_LINE_STATE_OTP_ERROR_SHIFT 0x01 | ||
| 3092 | |||
| 3093 | /* Bit definitions for INT3_STATUS */ | ||
| 3094 | #define TPS65917_INT3_STATUS_VBUS 0x80 | ||
| 3095 | #define TPS65917_INT3_STATUS_VBUS_SHIFT 0x07 | ||
| 3096 | #define TPS65917_INT3_STATUS_GPADC_EOC_SW 0x04 | ||
| 3097 | #define TPS65917_INT3_STATUS_GPADC_EOC_SW_SHIFT 0x02 | ||
| 3098 | #define TPS65917_INT3_STATUS_GPADC_AUTO_1 0x02 | ||
| 3099 | #define TPS65917_INT3_STATUS_GPADC_AUTO_1_SHIFT 0x01 | ||
| 3100 | #define TPS65917_INT3_STATUS_GPADC_AUTO_0 0x01 | ||
| 3101 | #define TPS65917_INT3_STATUS_GPADC_AUTO_0_SHIFT 0x00 | ||
| 3102 | |||
| 3103 | /* Bit definitions for INT3_MASK */ | ||
| 3104 | #define TPS65917_INT3_MASK_VBUS 0x80 | ||
| 3105 | #define TPS65917_INT3_MASK_VBUS_SHIFT 0x07 | ||
| 3106 | #define TPS65917_INT3_MASK_GPADC_EOC_SW 0x04 | ||
| 3107 | #define TPS65917_INT3_MASK_GPADC_EOC_SW_SHIFT 0x02 | ||
| 3108 | #define TPS65917_INT3_MASK_GPADC_AUTO_1 0x02 | ||
| 3109 | #define TPS65917_INT3_MASK_GPADC_AUTO_1_SHIFT 0x01 | ||
| 3110 | #define TPS65917_INT3_MASK_GPADC_AUTO_0 0x01 | ||
| 3111 | #define TPS65917_INT3_MASK_GPADC_AUTO_0_SHIFT 0x00 | ||
| 3112 | |||
| 3113 | /* Bit definitions for INT3_LINE_STATE */ | ||
| 3114 | #define TPS65917_INT3_LINE_STATE_VBUS 0x80 | ||
| 3115 | #define TPS65917_INT3_LINE_STATE_VBUS_SHIFT 0x07 | ||
| 3116 | #define TPS65917_INT3_LINE_STATE_GPADC_EOC_SW 0x04 | ||
| 3117 | #define TPS65917_INT3_LINE_STATE_GPADC_EOC_SW_SHIFT 0x02 | ||
| 3118 | #define TPS65917_INT3_LINE_STATE_GPADC_AUTO_1 0x02 | ||
| 3119 | #define TPS65917_INT3_LINE_STATE_GPADC_AUTO_1_SHIFT 0x01 | ||
| 3120 | #define TPS65917_INT3_LINE_STATE_GPADC_AUTO_0 0x01 | ||
| 3121 | #define TPS65917_INT3_LINE_STATE_GPADC_AUTO_0_SHIFT 0x00 | ||
| 3122 | |||
| 3123 | /* Bit definitions for INT4_STATUS */ | ||
| 3124 | #define TPS65917_INT4_STATUS_GPIO_6 0x40 | ||
| 3125 | #define TPS65917_INT4_STATUS_GPIO_6_SHIFT 0x06 | ||
| 3126 | #define TPS65917_INT4_STATUS_GPIO_5 0x20 | ||
| 3127 | #define TPS65917_INT4_STATUS_GPIO_5_SHIFT 0x05 | ||
| 3128 | #define TPS65917_INT4_STATUS_GPIO_4 0x10 | ||
| 3129 | #define TPS65917_INT4_STATUS_GPIO_4_SHIFT 0x04 | ||
| 3130 | #define TPS65917_INT4_STATUS_GPIO_3 0x08 | ||
| 3131 | #define TPS65917_INT4_STATUS_GPIO_3_SHIFT 0x03 | ||
| 3132 | #define TPS65917_INT4_STATUS_GPIO_2 0x04 | ||
| 3133 | #define TPS65917_INT4_STATUS_GPIO_2_SHIFT 0x02 | ||
| 3134 | #define TPS65917_INT4_STATUS_GPIO_1 0x02 | ||
| 3135 | #define TPS65917_INT4_STATUS_GPIO_1_SHIFT 0x01 | ||
| 3136 | #define TPS65917_INT4_STATUS_GPIO_0 0x01 | ||
| 3137 | #define TPS65917_INT4_STATUS_GPIO_0_SHIFT 0x00 | ||
| 3138 | |||
| 3139 | /* Bit definitions for INT4_MASK */ | ||
| 3140 | #define TPS65917_INT4_MASK_GPIO_6 0x40 | ||
| 3141 | #define TPS65917_INT4_MASK_GPIO_6_SHIFT 0x06 | ||
| 3142 | #define TPS65917_INT4_MASK_GPIO_5 0x20 | ||
| 3143 | #define TPS65917_INT4_MASK_GPIO_5_SHIFT 0x05 | ||
| 3144 | #define TPS65917_INT4_MASK_GPIO_4 0x10 | ||
| 3145 | #define TPS65917_INT4_MASK_GPIO_4_SHIFT 0x04 | ||
| 3146 | #define TPS65917_INT4_MASK_GPIO_3 0x08 | ||
| 3147 | #define TPS65917_INT4_MASK_GPIO_3_SHIFT 0x03 | ||
| 3148 | #define TPS65917_INT4_MASK_GPIO_2 0x04 | ||
| 3149 | #define TPS65917_INT4_MASK_GPIO_2_SHIFT 0x02 | ||
| 3150 | #define TPS65917_INT4_MASK_GPIO_1 0x02 | ||
| 3151 | #define TPS65917_INT4_MASK_GPIO_1_SHIFT 0x01 | ||
| 3152 | #define TPS65917_INT4_MASK_GPIO_0 0x01 | ||
| 3153 | #define TPS65917_INT4_MASK_GPIO_0_SHIFT 0x00 | ||
| 3154 | |||
| 3155 | /* Bit definitions for INT4_LINE_STATE */ | ||
| 3156 | #define TPS65917_INT4_LINE_STATE_GPIO_6 0x40 | ||
| 3157 | #define TPS65917_INT4_LINE_STATE_GPIO_6_SHIFT 0x06 | ||
| 3158 | #define TPS65917_INT4_LINE_STATE_GPIO_5 0x20 | ||
| 3159 | #define TPS65917_INT4_LINE_STATE_GPIO_5_SHIFT 0x05 | ||
| 3160 | #define TPS65917_INT4_LINE_STATE_GPIO_4 0x10 | ||
| 3161 | #define TPS65917_INT4_LINE_STATE_GPIO_4_SHIFT 0x04 | ||
| 3162 | #define TPS65917_INT4_LINE_STATE_GPIO_3 0x08 | ||
| 3163 | #define TPS65917_INT4_LINE_STATE_GPIO_3_SHIFT 0x03 | ||
| 3164 | #define TPS65917_INT4_LINE_STATE_GPIO_2 0x04 | ||
| 3165 | #define TPS65917_INT4_LINE_STATE_GPIO_2_SHIFT 0x02 | ||
| 3166 | #define TPS65917_INT4_LINE_STATE_GPIO_1 0x02 | ||
| 3167 | #define TPS65917_INT4_LINE_STATE_GPIO_1_SHIFT 0x01 | ||
| 3168 | #define TPS65917_INT4_LINE_STATE_GPIO_0 0x01 | ||
| 3169 | #define TPS65917_INT4_LINE_STATE_GPIO_0_SHIFT 0x00 | ||
| 3170 | |||
| 3171 | /* Bit definitions for INT4_EDGE_DETECT1 */ | ||
| 3172 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_3_RISING 0x80 | ||
| 3173 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_3_RISING_SHIFT 0x07 | ||
| 3174 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_3_FALLING 0x40 | ||
| 3175 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_3_FALLING_SHIFT 0x06 | ||
| 3176 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_2_RISING 0x20 | ||
| 3177 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_2_RISING_SHIFT 0x05 | ||
| 3178 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_2_FALLING 0x10 | ||
| 3179 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_2_FALLING_SHIFT 0x04 | ||
| 3180 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_1_RISING 0x08 | ||
| 3181 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_1_RISING_SHIFT 0x03 | ||
| 3182 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_1_FALLING 0x04 | ||
| 3183 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_1_FALLING_SHIFT 0x02 | ||
| 3184 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_0_RISING 0x02 | ||
| 3185 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_0_RISING_SHIFT 0x01 | ||
| 3186 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_0_FALLING 0x01 | ||
| 3187 | #define TPS65917_INT4_EDGE_DETECT1_GPIO_0_FALLING_SHIFT 0x00 | ||
| 3188 | |||
| 3189 | /* Bit definitions for INT4_EDGE_DETECT2 */ | ||
| 3190 | #define TPS65917_INT4_EDGE_DETECT2_GPIO_6_RISING 0x20 | ||
| 3191 | #define TPS65917_INT4_EDGE_DETECT2_GPIO_6_RISING_SHIFT 0x05 | ||
| 3192 | #define TPS65917_INT4_EDGE_DETECT2_GPIO_6_FALLING 0x10 | ||
| 3193 | #define TPS65917_INT4_EDGE_DETECT2_GPIO_6_FALLING_SHIFT 0x04 | ||
| 3194 | #define TPS65917_INT4_EDGE_DETECT2_GPIO_5_RISING 0x08 | ||
| 3195 | #define TPS65917_INT4_EDGE_DETECT2_GPIO_5_RISING_SHIFT 0x03 | ||
| 3196 | #define TPS65917_INT4_EDGE_DETECT2_GPIO_5_FALLING 0x04 | ||
| 3197 | #define TPS65917_INT4_EDGE_DETECT2_GPIO_5_FALLING_SHIFT 0x02 | ||
| 3198 | #define TPS65917_INT4_EDGE_DETECT2_GPIO_4_RISING 0x02 | ||
| 3199 | #define TPS65917_INT4_EDGE_DETECT2_GPIO_4_RISING_SHIFT 0x01 | ||
| 3200 | #define TPS65917_INT4_EDGE_DETECT2_GPIO_4_FALLING 0x01 | ||
| 3201 | #define TPS65917_INT4_EDGE_DETECT2_GPIO_4_FALLING_SHIFT 0x00 | ||
| 3202 | |||
| 3203 | /* Bit definitions for INT_CTRL */ | ||
| 3204 | #define TPS65917_INT_CTRL_INT_PENDING 0x04 | ||
| 3205 | #define TPS65917_INT_CTRL_INT_PENDING_SHIFT 0x02 | ||
| 3206 | #define TPS65917_INT_CTRL_INT_CLEAR 0x01 | ||
| 3207 | #define TPS65917_INT_CTRL_INT_CLEAR_SHIFT 0x00 | ||
| 3208 | |||
| 3209 | /* TPS65917 SMPS Registers */ | ||
| 3210 | |||
| 3211 | /* Registers for function SMPS */ | ||
| 3212 | #define TPS65917_SMPS1_CTRL 0x00 | ||
| 3213 | #define TPS65917_SMPS1_FORCE 0x02 | ||
| 3214 | #define TPS65917_SMPS1_VOLTAGE 0x03 | ||
| 3215 | #define TPS65917_SMPS2_CTRL 0x04 | ||
| 3216 | #define TPS65917_SMPS2_FORCE 0x06 | ||
| 3217 | #define TPS65917_SMPS2_VOLTAGE 0x07 | ||
| 3218 | #define TPS65917_SMPS3_CTRL 0x0C | ||
| 3219 | #define TPS65917_SMPS3_FORCE 0x0E | ||
| 3220 | #define TPS65917_SMPS3_VOLTAGE 0x0F | ||
| 3221 | #define TPS65917_SMPS4_CTRL 0x10 | ||
| 3222 | #define TPS65917_SMPS4_VOLTAGE 0x13 | ||
| 3223 | #define TPS65917_SMPS5_CTRL 0x18 | ||
| 3224 | #define TPS65917_SMPS5_VOLTAGE 0x1B | ||
| 3225 | #define TPS65917_SMPS_CTRL 0x24 | ||
| 3226 | #define TPS65917_SMPS_PD_CTRL 0x25 | ||
| 3227 | #define TPS65917_SMPS_THERMAL_EN 0x27 | ||
| 3228 | #define TPS65917_SMPS_THERMAL_STATUS 0x28 | ||
| 3229 | #define TPS65917_SMPS_SHORT_STATUS 0x29 | ||
| 3230 | #define TPS65917_SMPS_NEGATIVE_CURRENT_LIMIT_EN 0x2A | ||
| 3231 | #define TPS65917_SMPS_POWERGOOD_MASK1 0x2B | ||
| 3232 | #define TPS65917_SMPS_POWERGOOD_MASK2 0x2C | ||
| 3233 | |||
| 3234 | /* Bit definitions for SMPS1_CTRL */ | ||
| 3235 | #define TPS65917_SMPS1_CTRL_WR_S 0x80 | ||
| 3236 | #define TPS65917_SMPS1_CTRL_WR_S_SHIFT 0x07 | ||
| 3237 | #define TPS65917_SMPS1_CTRL_ROOF_FLOOR_EN 0x40 | ||
| 3238 | #define TPS65917_SMPS1_CTRL_ROOF_FLOOR_EN_SHIFT 0x06 | ||
| 3239 | #define TPS65917_SMPS1_CTRL_STATUS_MASK 0x30 | ||
| 3240 | #define TPS65917_SMPS1_CTRL_STATUS_SHIFT 0x04 | ||
| 3241 | #define TPS65917_SMPS1_CTRL_MODE_SLEEP_MASK 0x0C | ||
| 3242 | #define TPS65917_SMPS1_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3243 | #define TPS65917_SMPS1_CTRL_MODE_ACTIVE_MASK 0x03 | ||
| 3244 | #define TPS65917_SMPS1_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3245 | |||
| 3246 | /* Bit definitions for SMPS1_FORCE */ | ||
| 3247 | #define TPS65917_SMPS1_FORCE_CMD 0x80 | ||
| 3248 | #define TPS65917_SMPS1_FORCE_CMD_SHIFT 0x07 | ||
| 3249 | #define TPS65917_SMPS1_FORCE_VSEL_MASK 0x7F | ||
| 3250 | #define TPS65917_SMPS1_FORCE_VSEL_SHIFT 0x00 | ||
| 3251 | |||
| 3252 | /* Bit definitions for SMPS1_VOLTAGE */ | ||
| 3253 | #define TPS65917_SMPS1_VOLTAGE_RANGE 0x80 | ||
| 3254 | #define TPS65917_SMPS1_VOLTAGE_RANGE_SHIFT 0x07 | ||
| 3255 | #define TPS65917_SMPS1_VOLTAGE_VSEL_MASK 0x7F | ||
| 3256 | #define TPS65917_SMPS1_VOLTAGE_VSEL_SHIFT 0x00 | ||
| 3257 | |||
| 3258 | /* Bit definitions for SMPS2_CTRL */ | ||
| 3259 | #define TPS65917_SMPS2_CTRL_WR_S 0x80 | ||
| 3260 | #define TPS65917_SMPS2_CTRL_WR_S_SHIFT 0x07 | ||
| 3261 | #define TPS65917_SMPS2_CTRL_ROOF_FLOOR_EN 0x40 | ||
| 3262 | #define TPS65917_SMPS2_CTRL_ROOF_FLOOR_EN_SHIFT 0x06 | ||
| 3263 | #define TPS65917_SMPS2_CTRL_STATUS_MASK 0x30 | ||
| 3264 | #define TPS65917_SMPS2_CTRL_STATUS_SHIFT 0x04 | ||
| 3265 | #define TPS65917_SMPS2_CTRL_MODE_SLEEP_MASK 0x0C | ||
| 3266 | #define TPS65917_SMPS2_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3267 | #define TPS65917_SMPS2_CTRL_MODE_ACTIVE_MASK 0x03 | ||
| 3268 | #define TPS65917_SMPS2_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3269 | |||
| 3270 | /* Bit definitions for SMPS2_FORCE */ | ||
| 3271 | #define TPS65917_SMPS2_FORCE_CMD 0x80 | ||
| 3272 | #define TPS65917_SMPS2_FORCE_CMD_SHIFT 0x07 | ||
| 3273 | #define TPS65917_SMPS2_FORCE_VSEL_MASK 0x7F | ||
| 3274 | #define TPS65917_SMPS2_FORCE_VSEL_SHIFT 0x00 | ||
| 3275 | |||
| 3276 | /* Bit definitions for SMPS2_VOLTAGE */ | ||
| 3277 | #define TPS65917_SMPS2_VOLTAGE_RANGE 0x80 | ||
| 3278 | #define TPS65917_SMPS2_VOLTAGE_RANGE_SHIFT 0x07 | ||
| 3279 | #define TPS65917_SMPS2_VOLTAGE_VSEL_MASK 0x7F | ||
| 3280 | #define TPS65917_SMPS2_VOLTAGE_VSEL_SHIFT 0x00 | ||
| 3281 | |||
| 3282 | /* Bit definitions for SMPS3_CTRL */ | ||
| 3283 | #define TPS65917_SMPS3_CTRL_WR_S 0x80 | ||
| 3284 | #define TPS65917_SMPS3_CTRL_WR_S_SHIFT 0x07 | ||
| 3285 | #define TPS65917_SMPS3_CTRL_ROOF_FLOOR_EN 0x40 | ||
| 3286 | #define TPS65917_SMPS3_CTRL_ROOF_FLOOR_EN_SHIFT 0x06 | ||
| 3287 | #define TPS65917_SMPS3_CTRL_STATUS_MASK 0x30 | ||
| 3288 | #define TPS65917_SMPS3_CTRL_STATUS_SHIFT 0x04 | ||
| 3289 | #define TPS65917_SMPS3_CTRL_MODE_SLEEP_MASK 0x0C | ||
| 3290 | #define TPS65917_SMPS3_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3291 | #define TPS65917_SMPS3_CTRL_MODE_ACTIVE_MASK 0x03 | ||
| 3292 | #define TPS65917_SMPS3_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3293 | |||
| 3294 | /* Bit definitions for SMPS3_FORCE */ | ||
| 3295 | #define TPS65917_SMPS3_FORCE_CMD 0x80 | ||
| 3296 | #define TPS65917_SMPS3_FORCE_CMD_SHIFT 0x07 | ||
| 3297 | #define TPS65917_SMPS3_FORCE_VSEL_MASK 0x7F | ||
| 3298 | #define TPS65917_SMPS3_FORCE_VSEL_SHIFT 0x00 | ||
| 3299 | |||
| 3300 | /* Bit definitions for SMPS3_VOLTAGE */ | ||
| 3301 | #define TPS65917_SMPS3_VOLTAGE_RANGE 0x80 | ||
| 3302 | #define TPS65917_SMPS3_VOLTAGE_RANGE_SHIFT 0x07 | ||
| 3303 | #define TPS65917_SMPS3_VOLTAGE_VSEL_MASK 0x7F | ||
| 3304 | #define TPS65917_SMPS3_VOLTAGE_VSEL_SHIFT 0x00 | ||
| 3305 | |||
| 3306 | /* Bit definitions for SMPS4_CTRL */ | ||
| 3307 | #define TPS65917_SMPS4_CTRL_WR_S 0x80 | ||
| 3308 | #define TPS65917_SMPS4_CTRL_WR_S_SHIFT 0x07 | ||
| 3309 | #define TPS65917_SMPS4_CTRL_ROOF_FLOOR_EN 0x40 | ||
| 3310 | #define TPS65917_SMPS4_CTRL_ROOF_FLOOR_EN_SHIFT 0x06 | ||
| 3311 | #define TPS65917_SMPS4_CTRL_STATUS_MASK 0x30 | ||
| 3312 | #define TPS65917_SMPS4_CTRL_STATUS_SHIFT 0x04 | ||
| 3313 | #define TPS65917_SMPS4_CTRL_MODE_SLEEP_MASK 0x0C | ||
| 3314 | #define TPS65917_SMPS4_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3315 | #define TPS65917_SMPS4_CTRL_MODE_ACTIVE_MASK 0x03 | ||
| 3316 | #define TPS65917_SMPS4_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3317 | |||
| 3318 | /* Bit definitions for SMPS4_VOLTAGE */ | ||
| 3319 | #define TPS65917_SMPS4_VOLTAGE_RANGE 0x80 | ||
| 3320 | #define TPS65917_SMPS4_VOLTAGE_RANGE_SHIFT 0x07 | ||
| 3321 | #define TPS65917_SMPS4_VOLTAGE_VSEL_MASK 0x7F | ||
| 3322 | #define TPS65917_SMPS4_VOLTAGE_VSEL_SHIFT 0x00 | ||
| 3323 | |||
| 3324 | /* Bit definitions for SMPS5_CTRL */ | ||
| 3325 | #define TPS65917_SMPS5_CTRL_WR_S 0x80 | ||
| 3326 | #define TPS65917_SMPS5_CTRL_WR_S_SHIFT 0x07 | ||
| 3327 | #define TPS65917_SMPS5_CTRL_ROOF_FLOOR_EN 0x40 | ||
| 3328 | #define TPS65917_SMPS5_CTRL_ROOF_FLOOR_EN_SHIFT 0x06 | ||
| 3329 | #define TPS65917_SMPS5_CTRL_STATUS_MASK 0x30 | ||
| 3330 | #define TPS65917_SMPS5_CTRL_STATUS_SHIFT 0x04 | ||
| 3331 | #define TPS65917_SMPS5_CTRL_MODE_SLEEP_MASK 0x0C | ||
| 3332 | #define TPS65917_SMPS5_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3333 | #define TPS65917_SMPS5_CTRL_MODE_ACTIVE_MASK 0x03 | ||
| 3334 | #define TPS65917_SMPS5_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3335 | |||
| 3336 | /* Bit definitions for SMPS5_VOLTAGE */ | ||
| 3337 | #define TPS65917_SMPS5_VOLTAGE_RANGE 0x80 | ||
| 3338 | #define TPS65917_SMPS5_VOLTAGE_RANGE_SHIFT 0x07 | ||
| 3339 | #define TPS65917_SMPS5_VOLTAGE_VSEL_MASK 0x7F | ||
| 3340 | #define TPS65917_SMPS5_VOLTAGE_VSEL_SHIFT 0x00 | ||
| 3341 | |||
| 3342 | /* Bit definitions for SMPS_CTRL */ | ||
| 3343 | #define TPS65917_SMPS_CTRL_SMPS1_SMPS12_EN 0x10 | ||
| 3344 | #define TPS65917_SMPS_CTRL_SMPS1_SMPS12_EN_SHIFT 0x04 | ||
| 3345 | #define TPS65917_SMPS_CTRL_SMPS12_PHASE_CTRL 0x03 | ||
| 3346 | #define TPS65917_SMPS_CTRL_SMPS12_PHASE_CTRL_SHIFT 0x00 | ||
| 3347 | |||
| 3348 | /* Bit definitions for SMPS_PD_CTRL */ | ||
| 3349 | #define TPS65917_SMPS_PD_CTRL_SMPS5 0x40 | ||
| 3350 | #define TPS65917_SMPS_PD_CTRL_SMPS5_SHIFT 0x06 | ||
| 3351 | #define TPS65917_SMPS_PD_CTRL_SMPS4 0x10 | ||
| 3352 | #define TPS65917_SMPS_PD_CTRL_SMPS4_SHIFT 0x04 | ||
| 3353 | #define TPS65917_SMPS_PD_CTRL_SMPS3 0x08 | ||
| 3354 | #define TPS65917_SMPS_PD_CTRL_SMPS3_SHIFT 0x03 | ||
| 3355 | #define TPS65917_SMPS_PD_CTRL_SMPS2 0x02 | ||
| 3356 | #define TPS65917_SMPS_PD_CTRL_SMPS2_SHIFT 0x01 | ||
| 3357 | #define TPS65917_SMPS_PD_CTRL_SMPS1 0x01 | ||
| 3358 | #define TPS65917_SMPS_PD_CTRL_SMPS1_SHIFT 0x00 | ||
| 3359 | |||
| 3360 | /* Bit definitions for SMPS_THERMAL_EN */ | ||
| 3361 | #define TPS65917_SMPS_THERMAL_EN_SMPS5 0x40 | ||
| 3362 | #define TPS65917_SMPS_THERMAL_EN_SMPS5_SHIFT 0x06 | ||
| 3363 | #define TPS65917_SMPS_THERMAL_EN_SMPS3 0x08 | ||
| 3364 | #define TPS65917_SMPS_THERMAL_EN_SMPS3_SHIFT 0x03 | ||
| 3365 | #define TPS65917_SMPS_THERMAL_EN_SMPS12 0x01 | ||
| 3366 | #define TPS65917_SMPS_THERMAL_EN_SMPS12_SHIFT 0x00 | ||
| 3367 | |||
| 3368 | /* Bit definitions for SMPS_THERMAL_STATUS */ | ||
| 3369 | #define TPS65917_SMPS_THERMAL_STATUS_SMPS5 0x40 | ||
| 3370 | #define TPS65917_SMPS_THERMAL_STATUS_SMPS5_SHIFT 0x06 | ||
| 3371 | #define TPS65917_SMPS_THERMAL_STATUS_SMPS3 0x08 | ||
| 3372 | #define TPS65917_SMPS_THERMAL_STATUS_SMPS3_SHIFT 0x03 | ||
| 3373 | #define TPS65917_SMPS_THERMAL_STATUS_SMPS12 0x01 | ||
| 3374 | #define TPS65917_SMPS_THERMAL_STATUS_SMPS12_SHIFT 0x00 | ||
| 3375 | |||
| 3376 | /* Bit definitions for SMPS_SHORT_STATUS */ | ||
| 3377 | #define TPS65917_SMPS_SHORT_STATUS_SMPS5 0x40 | ||
| 3378 | #define TPS65917_SMPS_SHORT_STATUS_SMPS5_SHIFT 0x06 | ||
| 3379 | #define TPS65917_SMPS_SHORT_STATUS_SMPS4 0x10 | ||
| 3380 | #define TPS65917_SMPS_SHORT_STATUS_SMPS4_SHIFT 0x04 | ||
| 3381 | #define TPS65917_SMPS_SHORT_STATUS_SMPS3 0x08 | ||
| 3382 | #define TPS65917_SMPS_SHORT_STATUS_SMPS3_SHIFT 0x03 | ||
| 3383 | #define TPS65917_SMPS_SHORT_STATUS_SMPS2 0x02 | ||
| 3384 | #define TPS65917_SMPS_SHORT_STATUS_SMPS2_SHIFT 0x01 | ||
| 3385 | #define TPS65917_SMPS_SHORT_STATUS_SMPS1 0x01 | ||
| 3386 | #define TPS65917_SMPS_SHORT_STATUS_SMPS1_SHIFT 0x00 | ||
| 3387 | |||
| 3388 | /* Bit definitions for SMPS_NEGATIVE_CURRENT_LIMIT_EN */ | ||
| 3389 | #define TPS65917_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS5 0x40 | ||
| 3390 | #define TPS65917_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS5_SHIFT 0x06 | ||
| 3391 | #define TPS65917_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS4 0x10 | ||
| 3392 | #define TPS65917_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS4_SHIFT 0x04 | ||
| 3393 | #define TPS65917_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS3 0x08 | ||
| 3394 | #define TPS65917_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS3_SHIFT 0x03 | ||
| 3395 | #define TPS65917_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS2 0x02 | ||
| 3396 | #define TPS65917_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS2_SHIFT 0x01 | ||
| 3397 | #define TPS65917_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS1 0x01 | ||
| 3398 | #define TPS65917_SMPS_NEGATIVE_CURRENT_LIMIT_EN_SMPS1_SHIFT 0x00 | ||
| 3399 | |||
| 3400 | /* Bit definitions for SMPS_POWERGOOD_MASK1 */ | ||
| 3401 | #define TPS65917_SMPS_POWERGOOD_MASK1_SMPS5 0x40 | ||
| 3402 | #define TPS65917_SMPS_POWERGOOD_MASK1_SMPS5_SHIFT 0x06 | ||
| 3403 | #define TPS65917_SMPS_POWERGOOD_MASK1_SMPS4 0x10 | ||
| 3404 | #define TPS65917_SMPS_POWERGOOD_MASK1_SMPS4_SHIFT 0x04 | ||
| 3405 | #define TPS65917_SMPS_POWERGOOD_MASK1_SMPS3 0x08 | ||
| 3406 | #define TPS65917_SMPS_POWERGOOD_MASK1_SMPS3_SHIFT 0x03 | ||
| 3407 | #define TPS65917_SMPS_POWERGOOD_MASK1_SMPS2 0x02 | ||
| 3408 | #define TPS65917_SMPS_POWERGOOD_MASK1_SMPS2_SHIFT 0x01 | ||
| 3409 | #define TPS65917_SMPS_POWERGOOD_MASK1_SMPS1 0x01 | ||
| 3410 | #define TPS65917_SMPS_POWERGOOD_MASK1_SMPS1_SHIFT 0x00 | ||
| 3411 | |||
| 3412 | /* Bit definitions for SMPS_POWERGOOD_MASK2 */ | ||
| 3413 | #define TPS65917_SMPS_POWERGOOD_MASK2_POWERGOOD_TYPE_SELECT 0x80 | ||
| 3414 | #define TPS65917_SMPS_POWERGOOD_MASK2_POWERGOOD_TYPE_SELECT_SHIFT 0x07 | ||
| 3415 | #define TPS65917_SMPS_POWERGOOD_MASK2_OVC_ALARM_SHIFT 0x10 | ||
| 3416 | #define TPS65917_SMPS_POWERGOOD_MASK2_OVC_ALARM 0x04 | ||
| 3417 | |||
| 3418 | /* Bit definitions for SMPS_PLL_CTRL */ | ||
| 3419 | |||
| 3420 | #define TPS65917_SMPS_PLL_CTRL_PLL_EN_PLL_BYPASS_SHIFT 0x08 | ||
| 3421 | #define TPS65917_SMPS_PLL_CTRL_PLL_PLL_EN_BYPASS 0x03 | ||
| 3422 | #define TPS65917_SMPS_PLL_CTRL_PLL_PLL_BYPASS_CLK_SHIFT 0x04 | ||
| 3423 | #define TPS65917_SMPS_PLL_CTRL_PLL_PLL_BYPASS_CLK 0x02 | ||
| 3424 | |||
| 3425 | /* Registers for function LDO */ | ||
| 3426 | #define TPS65917_LDO1_CTRL 0x00 | ||
| 3427 | #define TPS65917_LDO1_VOLTAGE 0x01 | ||
| 3428 | #define TPS65917_LDO2_CTRL 0x02 | ||
| 3429 | #define TPS65917_LDO2_VOLTAGE 0x03 | ||
| 3430 | #define TPS65917_LDO3_CTRL 0x04 | ||
| 3431 | #define TPS65917_LDO3_VOLTAGE 0x05 | ||
| 3432 | #define TPS65917_LDO4_CTRL 0x0E | ||
| 3433 | #define TPS65917_LDO4_VOLTAGE 0x0F | ||
| 3434 | #define TPS65917_LDO5_CTRL 0x12 | ||
| 3435 | #define TPS65917_LDO5_VOLTAGE 0x13 | ||
| 3436 | #define TPS65917_LDO_PD_CTRL1 0x1B | ||
| 3437 | #define TPS65917_LDO_PD_CTRL2 0x1C | ||
| 3438 | #define TPS65917_LDO_SHORT_STATUS1 0x1D | ||
| 3439 | #define TPS65917_LDO_SHORT_STATUS2 0x1E | ||
| 3440 | #define TPS65917_LDO_PD_CTRL3 0x2D | ||
| 3441 | #define TPS65917_LDO_SHORT_STATUS3 0x2E | ||
| 3442 | |||
| 3443 | /* Bit definitions for LDO1_CTRL */ | ||
| 3444 | #define TPS65917_LDO1_CTRL_WR_S 0x80 | ||
| 3445 | #define TPS65917_LDO1_CTRL_WR_S_SHIFT 0x07 | ||
| 3446 | #define TPS65917_LDO1_CTRL_BYPASS_EN 0x40 | ||
| 3447 | #define TPS65917_LDO1_CTRL_BYPASS_EN_SHIFT 0x06 | ||
| 3448 | #define TPS65917_LDO1_CTRL_STATUS 0x10 | ||
| 3449 | #define TPS65917_LDO1_CTRL_STATUS_SHIFT 0x04 | ||
| 3450 | #define TPS65917_LDO1_CTRL_MODE_SLEEP 0x04 | ||
| 3451 | #define TPS65917_LDO1_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3452 | #define TPS65917_LDO1_CTRL_MODE_ACTIVE 0x01 | ||
| 3453 | #define TPS65917_LDO1_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3454 | |||
| 3455 | /* Bit definitions for LDO1_VOLTAGE */ | ||
| 3456 | #define TPS65917_LDO1_VOLTAGE_VSEL_MASK 0x2F | ||
| 3457 | #define TPS65917_LDO1_VOLTAGE_VSEL_SHIFT 0x00 | ||
| 3458 | |||
| 3459 | /* Bit definitions for LDO2_CTRL */ | ||
| 3460 | #define TPS65917_LDO2_CTRL_WR_S 0x80 | ||
| 3461 | #define TPS65917_LDO2_CTRL_WR_S_SHIFT 0x07 | ||
| 3462 | #define TPS65917_LDO2_CTRL_BYPASS_EN 0x40 | ||
| 3463 | #define TPS65917_LDO2_CTRL_BYPASS_EN_SHIFT 0x06 | ||
| 3464 | #define TPS65917_LDO2_CTRL_STATUS 0x10 | ||
| 3465 | #define TPS65917_LDO2_CTRL_STATUS_SHIFT 0x04 | ||
| 3466 | #define TPS65917_LDO2_CTRL_MODE_SLEEP 0x04 | ||
| 3467 | #define TPS65917_LDO2_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3468 | #define TPS65917_LDO2_CTRL_MODE_ACTIVE 0x01 | ||
| 3469 | #define TPS65917_LDO2_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3470 | |||
| 3471 | /* Bit definitions for LDO2_VOLTAGE */ | ||
| 3472 | #define TPS65917_LDO2_VOLTAGE_VSEL_MASK 0x2F | ||
| 3473 | #define TPS65917_LDO2_VOLTAGE_VSEL_SHIFT 0x00 | ||
| 3474 | |||
| 3475 | /* Bit definitions for LDO3_CTRL */ | ||
| 3476 | #define TPS65917_LDO3_CTRL_WR_S 0x80 | ||
| 3477 | #define TPS65917_LDO3_CTRL_WR_S_SHIFT 0x07 | ||
| 3478 | #define TPS65917_LDO3_CTRL_STATUS 0x10 | ||
| 3479 | #define TPS65917_LDO3_CTRL_STATUS_SHIFT 0x04 | ||
| 3480 | #define TPS65917_LDO3_CTRL_MODE_SLEEP 0x04 | ||
| 3481 | #define TPS65917_LDO3_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3482 | #define TPS65917_LDO3_CTRL_MODE_ACTIVE 0x01 | ||
| 3483 | #define TPS65917_LDO3_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3484 | |||
| 3485 | /* Bit definitions for LDO3_VOLTAGE */ | ||
| 3486 | #define TPS65917_LDO3_VOLTAGE_VSEL_MASK 0x2F | ||
| 3487 | #define TPS65917_LDO3_VOLTAGE_VSEL_SHIFT 0x00 | ||
| 3488 | |||
| 3489 | /* Bit definitions for LDO4_CTRL */ | ||
| 3490 | #define TPS65917_LDO4_CTRL_WR_S 0x80 | ||
| 3491 | #define TPS65917_LDO4_CTRL_WR_S_SHIFT 0x07 | ||
| 3492 | #define TPS65917_LDO4_CTRL_STATUS 0x10 | ||
| 3493 | #define TPS65917_LDO4_CTRL_STATUS_SHIFT 0x04 | ||
| 3494 | #define TPS65917_LDO4_CTRL_MODE_SLEEP 0x04 | ||
| 3495 | #define TPS65917_LDO4_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3496 | #define TPS65917_LDO4_CTRL_MODE_ACTIVE 0x01 | ||
| 3497 | #define TPS65917_LDO4_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3498 | |||
| 3499 | /* Bit definitions for LDO4_VOLTAGE */ | ||
| 3500 | #define TPS65917_LDO4_VOLTAGE_VSEL_MASK 0x2F | ||
| 3501 | #define TPS65917_LDO4_VOLTAGE_VSEL_SHIFT 0x00 | ||
| 3502 | |||
| 3503 | /* Bit definitions for LDO5_CTRL */ | ||
| 3504 | #define TPS65917_LDO5_CTRL_WR_S 0x80 | ||
| 3505 | #define TPS65917_LDO5_CTRL_WR_S_SHIFT 0x07 | ||
| 3506 | #define TPS65917_LDO5_CTRL_STATUS 0x10 | ||
| 3507 | #define TPS65917_LDO5_CTRL_STATUS_SHIFT 0x04 | ||
| 3508 | #define TPS65917_LDO5_CTRL_MODE_SLEEP 0x04 | ||
| 3509 | #define TPS65917_LDO5_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3510 | #define TPS65917_LDO5_CTRL_MODE_ACTIVE 0x01 | ||
| 3511 | #define TPS65917_LDO5_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3512 | |||
| 3513 | /* Bit definitions for LDO5_VOLTAGE */ | ||
| 3514 | #define TPS65917_LDO5_VOLTAGE_VSEL_MASK 0x2F | ||
| 3515 | #define TPS65917_LDO5_VOLTAGE_VSEL_SHIFT 0x00 | ||
| 3516 | |||
| 3517 | /* Bit definitions for LDO_PD_CTRL1 */ | ||
| 3518 | #define TPS65917_LDO_PD_CTRL1_LDO4 0x80 | ||
| 3519 | #define TPS65917_LDO_PD_CTRL1_LDO4_SHIFT 0x07 | ||
| 3520 | #define TPS65917_LDO_PD_CTRL1_LDO2 0x02 | ||
| 3521 | #define TPS65917_LDO_PD_CTRL1_LDO2_SHIFT 0x01 | ||
| 3522 | #define TPS65917_LDO_PD_CTRL1_LDO1 0x01 | ||
| 3523 | #define TPS65917_LDO_PD_CTRL1_LDO1_SHIFT 0x00 | ||
| 3524 | |||
| 3525 | /* Bit definitions for LDO_PD_CTRL2 */ | ||
| 3526 | #define TPS65917_LDO_PD_CTRL2_LDO3 0x04 | ||
| 3527 | #define TPS65917_LDO_PD_CTRL2_LDO3_SHIFT 0x02 | ||
| 3528 | #define TPS65917_LDO_PD_CTRL2_LDO5 0x02 | ||
| 3529 | #define TPS65917_LDO_PD_CTRL2_LDO5_SHIFT 0x01 | ||
| 3530 | |||
| 3531 | /* Bit definitions for LDO_PD_CTRL3 */ | ||
| 3532 | #define TPS65917_LDO_PD_CTRL2_LDOVANA 0x80 | ||
| 3533 | #define TPS65917_LDO_PD_CTRL2_LDOVANA_SHIFT 0x07 | ||
| 3534 | |||
| 3535 | /* Bit definitions for LDO_SHORT_STATUS1 */ | ||
| 3536 | #define TPS65917_LDO_SHORT_STATUS1_LDO4 0x80 | ||
| 3537 | #define TPS65917_LDO_SHORT_STATUS1_LDO4_SHIFT 0x07 | ||
| 3538 | #define TPS65917_LDO_SHORT_STATUS1_LDO2 0x02 | ||
| 3539 | #define TPS65917_LDO_SHORT_STATUS1_LDO2_SHIFT 0x01 | ||
| 3540 | #define TPS65917_LDO_SHORT_STATUS1_LDO1 0x01 | ||
| 3541 | #define TPS65917_LDO_SHORT_STATUS1_LDO1_SHIFT 0x00 | ||
| 3542 | |||
| 3543 | /* Bit definitions for LDO_SHORT_STATUS2 */ | ||
| 3544 | #define TPS65917_LDO_SHORT_STATUS2_LDO3 0x04 | ||
| 3545 | #define TPS65917_LDO_SHORT_STATUS2_LDO3_SHIFT 0x02 | ||
| 3546 | #define TPS65917_LDO_SHORT_STATUS2_LDO5 0x02 | ||
| 3547 | #define TPS65917_LDO_SHORT_STATUS2_LDO5_SHIFT 0x01 | ||
| 3548 | |||
| 3549 | /* Bit definitions for LDO_SHORT_STATUS2 */ | ||
| 3550 | #define TPS65917_LDO_SHORT_STATUS2_LDOVANA 0x80 | ||
| 3551 | #define TPS65917_LDO_SHORT_STATUS2_LDOVANA_SHIFT 0x07 | ||
| 3552 | |||
| 3553 | /* Bit definitions for REGEN1_CTRL */ | ||
| 3554 | #define TPS65917_REGEN1_CTRL_STATUS 0x10 | ||
| 3555 | #define TPS65917_REGEN1_CTRL_STATUS_SHIFT 0x04 | ||
| 3556 | #define TPS65917_REGEN1_CTRL_MODE_SLEEP 0x04 | ||
| 3557 | #define TPS65917_REGEN1_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3558 | #define TPS65917_REGEN1_CTRL_MODE_ACTIVE 0x01 | ||
| 3559 | #define TPS65917_REGEN1_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3560 | |||
| 3561 | /* Bit definitions for PLLEN_CTRL */ | ||
| 3562 | #define TPS65917_PLLEN_CTRL_STATUS 0x10 | ||
| 3563 | #define TPS65917_PLLEN_CTRL_STATUS_SHIFT 0x04 | ||
| 3564 | #define TPS65917_PLLEN_CTRL_MODE_SLEEP 0x04 | ||
| 3565 | #define TPS65917_PLLEN_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3566 | #define TPS65917_PLLEN_CTRL_MODE_ACTIVE 0x01 | ||
| 3567 | #define TPS65917_PLLEN_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3568 | |||
| 3569 | /* Bit definitions for REGEN2_CTRL */ | ||
| 3570 | #define TPS65917_REGEN2_CTRL_STATUS 0x10 | ||
| 3571 | #define TPS65917_REGEN2_CTRL_STATUS_SHIFT 0x04 | ||
| 3572 | #define TPS65917_REGEN2_CTRL_MODE_SLEEP 0x04 | ||
| 3573 | #define TPS65917_REGEN2_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3574 | #define TPS65917_REGEN2_CTRL_MODE_ACTIVE 0x01 | ||
| 3575 | #define TPS65917_REGEN2_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3576 | |||
| 3577 | /* Bit definitions for NSLEEP_RES_ASSIGN */ | ||
| 3578 | #define TPS65917_NSLEEP_RES_ASSIGN_PLL_EN 0x08 | ||
| 3579 | #define TPS65917_NSLEEP_RES_ASSIGN_PLL_EN_SHIFT 0x03 | ||
| 3580 | #define TPS65917_NSLEEP_RES_ASSIGN_REGEN3 0x04 | ||
| 3581 | #define TPS65917_NSLEEP_RES_ASSIGN_REGEN3_SHIFT 0x02 | ||
| 3582 | #define TPS65917_NSLEEP_RES_ASSIGN_REGEN2 0x02 | ||
| 3583 | #define TPS65917_NSLEEP_RES_ASSIGN_REGEN2_SHIFT 0x01 | ||
| 3584 | #define TPS65917_NSLEEP_RES_ASSIGN_REGEN1 0x01 | ||
| 3585 | #define TPS65917_NSLEEP_RES_ASSIGN_REGEN1_SHIFT 0x00 | ||
| 3586 | |||
| 3587 | /* Bit definitions for NSLEEP_SMPS_ASSIGN */ | ||
| 3588 | #define TPS65917_NSLEEP_SMPS_ASSIGN_SMPS5 0x40 | ||
| 3589 | #define TPS65917_NSLEEP_SMPS_ASSIGN_SMPS5_SHIFT 0x06 | ||
| 3590 | #define TPS65917_NSLEEP_SMPS_ASSIGN_SMPS4 0x10 | ||
| 3591 | #define TPS65917_NSLEEP_SMPS_ASSIGN_SMPS4_SHIFT 0x04 | ||
| 3592 | #define TPS65917_NSLEEP_SMPS_ASSIGN_SMPS3 0x08 | ||
| 3593 | #define TPS65917_NSLEEP_SMPS_ASSIGN_SMPS3_SHIFT 0x03 | ||
| 3594 | #define TPS65917_NSLEEP_SMPS_ASSIGN_SMPS2 0x02 | ||
| 3595 | #define TPS65917_NSLEEP_SMPS_ASSIGN_SMPS2_SHIFT 0x01 | ||
| 3596 | #define TPS65917_NSLEEP_SMPS_ASSIGN_SMPS1 0x01 | ||
| 3597 | #define TPS65917_NSLEEP_SMPS_ASSIGN_SMPS1_SHIFT 0x00 | ||
| 3598 | |||
| 3599 | /* Bit definitions for NSLEEP_LDO_ASSIGN1 */ | ||
| 3600 | #define TPS65917_NSLEEP_LDO_ASSIGN1_LDO4 0x80 | ||
| 3601 | #define TPS65917_NSLEEP_LDO_ASSIGN1_LDO4_SHIFT 0x07 | ||
| 3602 | #define TPS65917_NSLEEP_LDO_ASSIGN1_LDO2 0x02 | ||
| 3603 | #define TPS65917_NSLEEP_LDO_ASSIGN1_LDO2_SHIFT 0x01 | ||
| 3604 | #define TPS65917_NSLEEP_LDO_ASSIGN1_LDO1 0x01 | ||
| 3605 | #define TPS65917_NSLEEP_LDO_ASSIGN1_LDO1_SHIFT 0x00 | ||
| 3606 | |||
| 3607 | /* Bit definitions for NSLEEP_LDO_ASSIGN2 */ | ||
| 3608 | #define TPS65917_NSLEEP_LDO_ASSIGN2_LDO3 0x04 | ||
| 3609 | #define TPS65917_NSLEEP_LDO_ASSIGN2_LDO3_SHIFT 0x02 | ||
| 3610 | #define TPS65917_NSLEEP_LDO_ASSIGN2_LDO5 0x02 | ||
| 3611 | #define TPS65917_NSLEEP_LDO_ASSIGN2_LDO5_SHIFT 0x01 | ||
| 3612 | |||
| 3613 | /* Bit definitions for ENABLE1_RES_ASSIGN */ | ||
| 3614 | #define TPS65917_ENABLE1_RES_ASSIGN_PLLEN 0x08 | ||
| 3615 | #define TPS65917_ENABLE1_RES_ASSIGN_PLLEN_SHIFT 0x03 | ||
| 3616 | #define TPS65917_ENABLE1_RES_ASSIGN_REGEN3 0x04 | ||
| 3617 | #define TPS65917_ENABLE1_RES_ASSIGN_REGEN3_SHIFT 0x02 | ||
| 3618 | #define TPS65917_ENABLE1_RES_ASSIGN_REGEN2 0x02 | ||
| 3619 | #define TPS65917_ENABLE1_RES_ASSIGN_REGEN2_SHIFT 0x01 | ||
| 3620 | #define TPS65917_ENABLE1_RES_ASSIGN_REGEN1 0x01 | ||
| 3621 | #define TPS65917_ENABLE1_RES_ASSIGN_REGEN1_SHIFT 0x00 | ||
| 3622 | |||
| 3623 | /* Bit definitions for ENABLE1_SMPS_ASSIGN */ | ||
| 3624 | #define TPS65917_ENABLE1_SMPS_ASSIGN_SMPS5 0x40 | ||
| 3625 | #define TPS65917_ENABLE1_SMPS_ASSIGN_SMPS5_SHIFT 0x06 | ||
| 3626 | #define TPS65917_ENABLE1_SMPS_ASSIGN_SMPS4 0x10 | ||
| 3627 | #define TPS65917_ENABLE1_SMPS_ASSIGN_SMPS4_SHIFT 0x04 | ||
| 3628 | #define TPS65917_ENABLE1_SMPS_ASSIGN_SMPS3 0x08 | ||
| 3629 | #define TPS65917_ENABLE1_SMPS_ASSIGN_SMPS3_SHIFT 0x03 | ||
| 3630 | #define TPS65917_ENABLE1_SMPS_ASSIGN_SMPS2 0x02 | ||
| 3631 | #define TPS65917_ENABLE1_SMPS_ASSIGN_SMPS2_SHIFT 0x01 | ||
| 3632 | #define TPS65917_ENABLE1_SMPS_ASSIGN_SMPS1 0x01 | ||
| 3633 | #define TPS65917_ENABLE1_SMPS_ASSIGN_SMPS1_SHIFT 0x00 | ||
| 3634 | |||
| 3635 | /* Bit definitions for ENABLE1_LDO_ASSIGN1 */ | ||
| 3636 | #define TPS65917_ENABLE1_LDO_ASSIGN1_LDO4 0x80 | ||
| 3637 | #define TPS65917_ENABLE1_LDO_ASSIGN1_LDO4_SHIFT 0x07 | ||
| 3638 | #define TPS65917_ENABLE1_LDO_ASSIGN1_LDO2 0x02 | ||
| 3639 | #define TPS65917_ENABLE1_LDO_ASSIGN1_LDO2_SHIFT 0x01 | ||
| 3640 | #define TPS65917_ENABLE1_LDO_ASSIGN1_LDO1 0x01 | ||
| 3641 | #define TPS65917_ENABLE1_LDO_ASSIGN1_LDO1_SHIFT 0x00 | ||
| 3642 | |||
| 3643 | /* Bit definitions for ENABLE1_LDO_ASSIGN2 */ | ||
| 3644 | #define TPS65917_ENABLE1_LDO_ASSIGN2_LDO3 0x04 | ||
| 3645 | #define TPS65917_ENABLE1_LDO_ASSIGN2_LDO3_SHIFT 0x02 | ||
| 3646 | #define TPS65917_ENABLE1_LDO_ASSIGN2_LDO5 0x02 | ||
| 3647 | #define TPS65917_ENABLE1_LDO_ASSIGN2_LDO5_SHIFT 0x01 | ||
| 3648 | |||
| 3649 | /* Bit definitions for ENABLE2_RES_ASSIGN */ | ||
| 3650 | #define TPS65917_ENABLE2_RES_ASSIGN_PLLEN 0x08 | ||
| 3651 | #define TPS65917_ENABLE2_RES_ASSIGN_PLLEN_SHIFT 0x03 | ||
| 3652 | #define TPS65917_ENABLE2_RES_ASSIGN_REGEN3 0x04 | ||
| 3653 | #define TPS65917_ENABLE2_RES_ASSIGN_REGEN3_SHIFT 0x02 | ||
| 3654 | #define TPS65917_ENABLE2_RES_ASSIGN_REGEN2 0x02 | ||
| 3655 | #define TPS65917_ENABLE2_RES_ASSIGN_REGEN2_SHIFT 0x01 | ||
| 3656 | #define TPS65917_ENABLE2_RES_ASSIGN_REGEN1 0x01 | ||
| 3657 | #define TPS65917_ENABLE2_RES_ASSIGN_REGEN1_SHIFT 0x00 | ||
| 3658 | |||
| 3659 | /* Bit definitions for ENABLE2_SMPS_ASSIGN */ | ||
| 3660 | #define TPS65917_ENABLE2_SMPS_ASSIGN_SMPS5 0x40 | ||
| 3661 | #define TPS65917_ENABLE2_SMPS_ASSIGN_SMPS5_SHIFT 0x06 | ||
| 3662 | #define TPS65917_ENABLE2_SMPS_ASSIGN_SMPS4 0x10 | ||
| 3663 | #define TPS65917_ENABLE2_SMPS_ASSIGN_SMPS4_SHIFT 0x04 | ||
| 3664 | #define TPS65917_ENABLE2_SMPS_ASSIGN_SMPS3 0x08 | ||
| 3665 | #define TPS65917_ENABLE2_SMPS_ASSIGN_SMPS3_SHIFT 0x03 | ||
| 3666 | #define TPS65917_ENABLE2_SMPS_ASSIGN_SMPS2 0x02 | ||
| 3667 | #define TPS65917_ENABLE2_SMPS_ASSIGN_SMPS2_SHIFT 0x01 | ||
| 3668 | #define TPS65917_ENABLE2_SMPS_ASSIGN_SMPS1 0x01 | ||
| 3669 | #define TPS65917_ENABLE2_SMPS_ASSIGN_SMPS1_SHIFT 0x00 | ||
| 3670 | |||
| 3671 | /* Bit definitions for ENABLE2_LDO_ASSIGN1 */ | ||
| 3672 | #define TPS65917_ENABLE2_LDO_ASSIGN1_LDO4 0x80 | ||
| 3673 | #define TPS65917_ENABLE2_LDO_ASSIGN1_LDO4_SHIFT 0x07 | ||
| 3674 | #define TPS65917_ENABLE2_LDO_ASSIGN1_LDO2 0x02 | ||
| 3675 | #define TPS65917_ENABLE2_LDO_ASSIGN1_LDO2_SHIFT 0x01 | ||
| 3676 | #define TPS65917_ENABLE2_LDO_ASSIGN1_LDO1 0x01 | ||
| 3677 | #define TPS65917_ENABLE2_LDO_ASSIGN1_LDO1_SHIFT 0x00 | ||
| 3678 | |||
| 3679 | /* Bit definitions for ENABLE2_LDO_ASSIGN2 */ | ||
| 3680 | #define TPS65917_ENABLE2_LDO_ASSIGN2_LDO3 0x04 | ||
| 3681 | #define TPS65917_ENABLE2_LDO_ASSIGN2_LDO3_SHIFT 0x02 | ||
| 3682 | #define TPS65917_ENABLE2_LDO_ASSIGN2_LDO5 0x02 | ||
| 3683 | #define TPS65917_ENABLE2_LDO_ASSIGN2_LDO5_SHIFT 0x01 | ||
| 3684 | |||
| 3685 | /* Bit definitions for REGEN3_CTRL */ | ||
| 3686 | #define TPS65917_REGEN3_CTRL_STATUS 0x10 | ||
| 3687 | #define TPS65917_REGEN3_CTRL_STATUS_SHIFT 0x04 | ||
| 3688 | #define TPS65917_REGEN3_CTRL_MODE_SLEEP 0x04 | ||
| 3689 | #define TPS65917_REGEN3_CTRL_MODE_SLEEP_SHIFT 0x02 | ||
| 3690 | #define TPS65917_REGEN3_CTRL_MODE_ACTIVE 0x01 | ||
| 3691 | #define TPS65917_REGEN3_CTRL_MODE_ACTIVE_SHIFT 0x00 | ||
| 3692 | |||
| 3693 | /* Registers for function RESOURCE */ | ||
| 3694 | #define TPS65917_REGEN1_CTRL 0x2 | ||
| 3695 | #define TPS65917_PLLEN_CTRL 0x3 | ||
| 3696 | #define TPS65917_NSLEEP_RES_ASSIGN 0x6 | ||
| 3697 | #define TPS65917_NSLEEP_SMPS_ASSIGN 0x7 | ||
| 3698 | #define TPS65917_NSLEEP_LDO_ASSIGN1 0x8 | ||
| 3699 | #define TPS65917_NSLEEP_LDO_ASSIGN2 0x9 | ||
| 3700 | #define TPS65917_ENABLE1_RES_ASSIGN 0xA | ||
| 3701 | #define TPS65917_ENABLE1_SMPS_ASSIGN 0xB | ||
| 3702 | #define TPS65917_ENABLE1_LDO_ASSIGN1 0xC | ||
| 3703 | #define TPS65917_ENABLE1_LDO_ASSIGN2 0xD | ||
| 3704 | #define TPS65917_ENABLE2_RES_ASSIGN 0xE | ||
| 3705 | #define TPS65917_ENABLE2_SMPS_ASSIGN 0xF | ||
| 3706 | #define TPS65917_ENABLE2_LDO_ASSIGN1 0x10 | ||
| 3707 | #define TPS65917_ENABLE2_LDO_ASSIGN2 0x11 | ||
| 3708 | #define TPS65917_REGEN2_CTRL 0x12 | ||
| 3709 | #define TPS65917_REGEN3_CTRL 0x13 | ||
| 3710 | |||
| 2874 | static inline int palmas_read(struct palmas *palmas, unsigned int base, | 3711 | static inline int palmas_read(struct palmas *palmas, unsigned int base, |
| 2875 | unsigned int reg, unsigned int *val) | 3712 | unsigned int reg, unsigned int *val) |
| 2876 | { | 3713 | { |
diff --git a/include/linux/mic_bus.h b/include/linux/mic_bus.h new file mode 100644 index 000000000000..d5b5f76d57ef --- /dev/null +++ b/include/linux/mic_bus.h | |||
| @@ -0,0 +1,110 @@ | |||
| 1 | /* | ||
| 2 | * Intel MIC Platform Software Stack (MPSS) | ||
| 3 | * | ||
| 4 | * Copyright(c) 2014 Intel Corporation. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License, version 2, as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, but | ||
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | * General Public License for more details. | ||
| 14 | * | ||
| 15 | * The full GNU General Public License is included in this distribution in | ||
| 16 | * the file called "COPYING". | ||
| 17 | * | ||
| 18 | * Intel MIC Bus driver. | ||
| 19 | * | ||
| 20 | * This implementation is very similar to the the virtio bus driver | ||
| 21 | * implementation @ include/linux/virtio.h. | ||
| 22 | */ | ||
| 23 | #ifndef _MIC_BUS_H_ | ||
| 24 | #define _MIC_BUS_H_ | ||
| 25 | /* | ||
| 26 | * Everything a mbus driver needs to work with any particular mbus | ||
| 27 | * implementation. | ||
| 28 | */ | ||
| 29 | #include <linux/interrupt.h> | ||
| 30 | #include <linux/dma-mapping.h> | ||
| 31 | |||
| 32 | struct mbus_device_id { | ||
| 33 | __u32 device; | ||
| 34 | __u32 vendor; | ||
| 35 | }; | ||
| 36 | |||
| 37 | #define MBUS_DEV_DMA_HOST 2 | ||
| 38 | #define MBUS_DEV_DMA_MIC 3 | ||
| 39 | #define MBUS_DEV_ANY_ID 0xffffffff | ||
| 40 | |||
| 41 | /** | ||
| 42 | * mbus_device - representation of a device using mbus | ||
| 43 | * @mmio_va: virtual address of mmio space | ||
| 44 | * @hw_ops: the hardware ops supported by this device. | ||
| 45 | * @id: the device type identification (used to match it with a driver). | ||
| 46 | * @dev: underlying device. | ||
| 47 | * be used to communicate with. | ||
| 48 | * @index: unique position on the mbus bus | ||
| 49 | */ | ||
| 50 | struct mbus_device { | ||
| 51 | void __iomem *mmio_va; | ||
| 52 | struct mbus_hw_ops *hw_ops; | ||
| 53 | struct mbus_device_id id; | ||
| 54 | struct device dev; | ||
| 55 | int index; | ||
| 56 | }; | ||
| 57 | |||
| 58 | /** | ||
| 59 | * mbus_driver - operations for a mbus I/O driver | ||
| 60 | * @driver: underlying device driver (populate name and owner). | ||
| 61 | * @id_table: the ids serviced by this driver. | ||
| 62 | * @probe: the function to call when a device is found. Returns 0 or -errno. | ||
| 63 | * @remove: the function to call when a device is removed. | ||
| 64 | */ | ||
| 65 | struct mbus_driver { | ||
| 66 | struct device_driver driver; | ||
| 67 | const struct mbus_device_id *id_table; | ||
| 68 | int (*probe)(struct mbus_device *dev); | ||
| 69 | void (*scan)(struct mbus_device *dev); | ||
| 70 | void (*remove)(struct mbus_device *dev); | ||
| 71 | }; | ||
| 72 | |||
| 73 | /** | ||
| 74 | * struct mic_irq - opaque pointer used as cookie | ||
| 75 | */ | ||
| 76 | struct mic_irq; | ||
| 77 | |||
| 78 | /** | ||
| 79 | * mbus_hw_ops - Hardware operations for accessing a MIC device on the MIC bus. | ||
| 80 | */ | ||
| 81 | struct mbus_hw_ops { | ||
| 82 | struct mic_irq* (*request_threaded_irq)(struct mbus_device *mbdev, | ||
| 83 | irq_handler_t handler, | ||
| 84 | irq_handler_t thread_fn, | ||
| 85 | const char *name, void *data, | ||
| 86 | int intr_src); | ||
| 87 | void (*free_irq)(struct mbus_device *mbdev, | ||
| 88 | struct mic_irq *cookie, void *data); | ||
| 89 | void (*ack_interrupt)(struct mbus_device *mbdev, int num); | ||
| 90 | }; | ||
| 91 | |||
| 92 | struct mbus_device * | ||
| 93 | mbus_register_device(struct device *pdev, int id, struct dma_map_ops *dma_ops, | ||
| 94 | struct mbus_hw_ops *hw_ops, void __iomem *mmio_va); | ||
| 95 | void mbus_unregister_device(struct mbus_device *mbdev); | ||
| 96 | |||
| 97 | int mbus_register_driver(struct mbus_driver *drv); | ||
| 98 | void mbus_unregister_driver(struct mbus_driver *drv); | ||
| 99 | |||
| 100 | static inline struct mbus_device *dev_to_mbus(struct device *_dev) | ||
| 101 | { | ||
| 102 | return container_of(_dev, struct mbus_device, dev); | ||
| 103 | } | ||
| 104 | |||
| 105 | static inline struct mbus_driver *drv_to_mbus(struct device_driver *drv) | ||
| 106 | { | ||
| 107 | return container_of(drv, struct mbus_driver, driver); | ||
| 108 | } | ||
| 109 | |||
| 110 | #endif /* _MIC_BUS_H */ | ||
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 35b51e7af886..e15b1544ea83 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -48,6 +48,17 @@ | |||
| 48 | #define MSIX_LEGACY_SZ 4 | 48 | #define MSIX_LEGACY_SZ 4 |
| 49 | #define MIN_MSIX_P_PORT 5 | 49 | #define MIN_MSIX_P_PORT 5 |
| 50 | 50 | ||
| 51 | #define MLX4_NUM_UP 8 | ||
| 52 | #define MLX4_NUM_TC 8 | ||
| 53 | #define MLX4_MAX_100M_UNITS_VAL 255 /* | ||
| 54 | * work around: can't set values | ||
| 55 | * greater then this value when | ||
| 56 | * using 100 Mbps units. | ||
| 57 | */ | ||
| 58 | #define MLX4_RATELIMIT_100M_UNITS 3 /* 100 Mbps */ | ||
| 59 | #define MLX4_RATELIMIT_1G_UNITS 4 /* 1 Gbps */ | ||
| 60 | #define MLX4_RATELIMIT_DEFAULT 0x00ff | ||
| 61 | |||
| 51 | #define MLX4_ROCE_MAX_GIDS 128 | 62 | #define MLX4_ROCE_MAX_GIDS 128 |
| 52 | #define MLX4_ROCE_PF_GIDS 16 | 63 | #define MLX4_ROCE_PF_GIDS 16 |
| 53 | 64 | ||
| @@ -1243,4 +1254,11 @@ int mlx4_vf_smi_enabled(struct mlx4_dev *dev, int slave, int port); | |||
| 1243 | int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port); | 1254 | int mlx4_vf_get_enable_smi_admin(struct mlx4_dev *dev, int slave, int port); |
| 1244 | int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, | 1255 | int mlx4_vf_set_enable_smi_admin(struct mlx4_dev *dev, int slave, int port, |
| 1245 | int enable); | 1256 | int enable); |
| 1257 | |||
| 1258 | /* Returns true if running in low memory profile (kdump kernel) */ | ||
| 1259 | static inline bool mlx4_low_memory_profile(void) | ||
| 1260 | { | ||
| 1261 | return reset_devices; | ||
| 1262 | } | ||
| 1263 | |||
| 1246 | #endif /* MLX4_DEVICE_H */ | 1264 | #endif /* MLX4_DEVICE_H */ |
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index 3406cfb1267a..334947151dfc 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h | |||
| @@ -456,9 +456,6 @@ struct mlx5_eqe_cq_err { | |||
| 456 | u8 syndrome; | 456 | u8 syndrome; |
| 457 | }; | 457 | }; |
| 458 | 458 | ||
| 459 | struct mlx5_eqe_dropped_packet { | ||
| 460 | }; | ||
| 461 | |||
| 462 | struct mlx5_eqe_port_state { | 459 | struct mlx5_eqe_port_state { |
| 463 | u8 reserved0[8]; | 460 | u8 reserved0[8]; |
| 464 | u8 port; | 461 | u8 port; |
| @@ -498,7 +495,6 @@ union ev_data { | |||
| 498 | struct mlx5_eqe_comp comp; | 495 | struct mlx5_eqe_comp comp; |
| 499 | struct mlx5_eqe_qp_srq qp_srq; | 496 | struct mlx5_eqe_qp_srq qp_srq; |
| 500 | struct mlx5_eqe_cq_err cq_err; | 497 | struct mlx5_eqe_cq_err cq_err; |
| 501 | struct mlx5_eqe_dropped_packet dp; | ||
| 502 | struct mlx5_eqe_port_state port; | 498 | struct mlx5_eqe_port_state port; |
| 503 | struct mlx5_eqe_gpio gpio; | 499 | struct mlx5_eqe_gpio gpio; |
| 504 | struct mlx5_eqe_congestion cong; | 500 | struct mlx5_eqe_congestion cong; |
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 2bce4aad2570..b88e9b46d957 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h | |||
| @@ -381,8 +381,8 @@ struct mlx5_buf { | |||
| 381 | struct mlx5_buf_list *page_list; | 381 | struct mlx5_buf_list *page_list; |
| 382 | int nbufs; | 382 | int nbufs; |
| 383 | int npages; | 383 | int npages; |
| 384 | int page_shift; | ||
| 385 | int size; | 384 | int size; |
| 385 | u8 page_shift; | ||
| 386 | }; | 386 | }; |
| 387 | 387 | ||
| 388 | struct mlx5_eq { | 388 | struct mlx5_eq { |
| @@ -543,6 +543,10 @@ struct mlx5_priv { | |||
| 543 | /* protect mkey key part */ | 543 | /* protect mkey key part */ |
| 544 | spinlock_t mkey_lock; | 544 | spinlock_t mkey_lock; |
| 545 | u8 mkey_key; | 545 | u8 mkey_key; |
| 546 | |||
| 547 | struct list_head dev_list; | ||
| 548 | struct list_head ctx_list; | ||
| 549 | spinlock_t ctx_lock; | ||
| 546 | }; | 550 | }; |
| 547 | 551 | ||
| 548 | struct mlx5_core_dev { | 552 | struct mlx5_core_dev { |
| @@ -555,7 +559,7 @@ struct mlx5_core_dev { | |||
| 555 | struct mlx5_init_seg __iomem *iseg; | 559 | struct mlx5_init_seg __iomem *iseg; |
| 556 | void (*event) (struct mlx5_core_dev *dev, | 560 | void (*event) (struct mlx5_core_dev *dev, |
| 557 | enum mlx5_dev_event event, | 561 | enum mlx5_dev_event event, |
| 558 | void *data); | 562 | unsigned long param); |
| 559 | struct mlx5_priv priv; | 563 | struct mlx5_priv priv; |
| 560 | struct mlx5_profile *profile; | 564 | struct mlx5_profile *profile; |
| 561 | atomic_t num_qps; | 565 | atomic_t num_qps; |
| @@ -604,8 +608,8 @@ struct mlx5_cmd_work_ent { | |||
| 604 | int page_queue; | 608 | int page_queue; |
| 605 | u8 status; | 609 | u8 status; |
| 606 | u8 token; | 610 | u8 token; |
| 607 | struct timespec ts1; | 611 | u64 ts1; |
| 608 | struct timespec ts2; | 612 | u64 ts2; |
| 609 | u16 op; | 613 | u16 op; |
| 610 | }; | 614 | }; |
| 611 | 615 | ||
| @@ -686,8 +690,6 @@ static inline u32 mlx5_base_mkey(const u32 key) | |||
| 686 | return key & 0xffffff00u; | 690 | return key & 0xffffff00u; |
| 687 | } | 691 | } |
| 688 | 692 | ||
| 689 | int mlx5_dev_init(struct mlx5_core_dev *dev, struct pci_dev *pdev); | ||
| 690 | void mlx5_dev_cleanup(struct mlx5_core_dev *dev); | ||
| 691 | int mlx5_cmd_init(struct mlx5_core_dev *dev); | 693 | int mlx5_cmd_init(struct mlx5_core_dev *dev); |
| 692 | void mlx5_cmd_cleanup(struct mlx5_core_dev *dev); | 694 | void mlx5_cmd_cleanup(struct mlx5_core_dev *dev); |
| 693 | void mlx5_cmd_use_events(struct mlx5_core_dev *dev); | 695 | void mlx5_cmd_use_events(struct mlx5_core_dev *dev); |
| @@ -734,7 +736,7 @@ int mlx5_core_dump_fill_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, | |||
| 734 | int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn); | 736 | int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn); |
| 735 | int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn); | 737 | int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn); |
| 736 | int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, void *inb, void *outb, | 738 | int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, void *inb, void *outb, |
| 737 | u16 opmod, int port); | 739 | u16 opmod, u8 port); |
| 738 | void mlx5_pagealloc_init(struct mlx5_core_dev *dev); | 740 | void mlx5_pagealloc_init(struct mlx5_core_dev *dev); |
| 739 | void mlx5_pagealloc_cleanup(struct mlx5_core_dev *dev); | 741 | void mlx5_pagealloc_cleanup(struct mlx5_core_dev *dev); |
| 740 | int mlx5_pagealloc_start(struct mlx5_core_dev *dev); | 742 | int mlx5_pagealloc_start(struct mlx5_core_dev *dev); |
| @@ -767,7 +769,7 @@ void mlx5_qp_debugfs_cleanup(struct mlx5_core_dev *dev); | |||
| 767 | int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in, | 769 | int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in, |
| 768 | int size_in, void *data_out, int size_out, | 770 | int size_in, void *data_out, int size_out, |
| 769 | u16 reg_num, int arg, int write); | 771 | u16 reg_num, int arg, int write); |
| 770 | int mlx5_set_port_caps(struct mlx5_core_dev *dev, int port_num, u32 caps); | 772 | int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 port_num, u32 caps); |
| 771 | 773 | ||
| 772 | int mlx5_debug_eq_add(struct mlx5_core_dev *dev, struct mlx5_eq *eq); | 774 | int mlx5_debug_eq_add(struct mlx5_core_dev *dev, struct mlx5_eq *eq); |
| 773 | void mlx5_debug_eq_remove(struct mlx5_core_dev *dev, struct mlx5_eq *eq); | 775 | void mlx5_debug_eq_remove(struct mlx5_core_dev *dev, struct mlx5_eq *eq); |
| @@ -811,9 +813,20 @@ enum { | |||
| 811 | MAX_MR_CACHE_ENTRIES = 16, | 813 | MAX_MR_CACHE_ENTRIES = 16, |
| 812 | }; | 814 | }; |
| 813 | 815 | ||
| 816 | struct mlx5_interface { | ||
| 817 | void * (*add)(struct mlx5_core_dev *dev); | ||
| 818 | void (*remove)(struct mlx5_core_dev *dev, void *context); | ||
| 819 | void (*event)(struct mlx5_core_dev *dev, void *context, | ||
| 820 | enum mlx5_dev_event event, unsigned long param); | ||
| 821 | struct list_head list; | ||
| 822 | }; | ||
| 823 | |||
| 824 | int mlx5_register_interface(struct mlx5_interface *intf); | ||
| 825 | void mlx5_unregister_interface(struct mlx5_interface *intf); | ||
| 826 | |||
| 814 | struct mlx5_profile { | 827 | struct mlx5_profile { |
| 815 | u64 mask; | 828 | u64 mask; |
| 816 | u32 log_max_qp; | 829 | u8 log_max_qp; |
| 817 | struct { | 830 | struct { |
| 818 | int size; | 831 | int size; |
| 819 | int limit; | 832 | int limit; |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 96c5750e3110..796deac19fcf 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -516,4 +516,12 @@ struct vm_special_mapping | |||
| 516 | struct page **pages; | 516 | struct page **pages; |
| 517 | }; | 517 | }; |
| 518 | 518 | ||
| 519 | enum tlb_flush_reason { | ||
| 520 | TLB_FLUSH_ON_TASK_SWITCH, | ||
| 521 | TLB_REMOTE_SHOOTDOWN, | ||
| 522 | TLB_LOCAL_SHOOTDOWN, | ||
| 523 | TLB_LOCAL_MM_SHOOTDOWN, | ||
| 524 | NR_TLB_FLUSH_REASONS, | ||
| 525 | }; | ||
| 526 | |||
| 519 | #endif /* _LINUX_MM_TYPES_H */ | 527 | #endif /* _LINUX_MM_TYPES_H */ |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index b1990c5524e1..494f99e852da 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
| @@ -381,6 +381,11 @@ extern int param_set_ulong(const char *val, const struct kernel_param *kp); | |||
| 381 | extern int param_get_ulong(char *buffer, const struct kernel_param *kp); | 381 | extern int param_get_ulong(char *buffer, const struct kernel_param *kp); |
| 382 | #define param_check_ulong(name, p) __param_check(name, p, unsigned long) | 382 | #define param_check_ulong(name, p) __param_check(name, p, unsigned long) |
| 383 | 383 | ||
| 384 | extern struct kernel_param_ops param_ops_ullong; | ||
| 385 | extern int param_set_ullong(const char *val, const struct kernel_param *kp); | ||
| 386 | extern int param_get_ullong(char *buffer, const struct kernel_param *kp); | ||
| 387 | #define param_check_ullong(name, p) __param_check(name, p, unsigned long long) | ||
| 388 | |||
| 384 | extern struct kernel_param_ops param_ops_charp; | 389 | extern struct kernel_param_ops param_ops_charp; |
| 385 | extern int param_set_charp(const char *val, const struct kernel_param *kp); | 390 | extern int param_set_charp(const char *val, const struct kernel_param *kp); |
| 386 | extern int param_get_charp(char *buffer, const struct kernel_param *kp); | 391 | extern int param_get_charp(char *buffer, const struct kernel_param *kp); |
diff --git a/include/linux/msi.h b/include/linux/msi.h index 92a2f991262a..8103f32f6d87 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
| @@ -25,7 +25,8 @@ void write_msi_msg(unsigned int irq, struct msi_msg *msg); | |||
| 25 | struct msi_desc { | 25 | struct msi_desc { |
| 26 | struct { | 26 | struct { |
| 27 | __u8 is_msix : 1; | 27 | __u8 is_msix : 1; |
| 28 | __u8 multiple: 3; /* log2 number of messages */ | 28 | __u8 multiple: 3; /* log2 num of messages allocated */ |
| 29 | __u8 multi_cap : 3; /* log2 num of messages supported */ | ||
| 29 | __u8 maskbit : 1; /* mask-pending bit supported ? */ | 30 | __u8 maskbit : 1; /* mask-pending bit supported ? */ |
| 30 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ | 31 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ |
| 31 | __u8 pos; /* Location of the msi capability */ | 32 | __u8 pos; /* Location of the msi capability */ |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 42aa9b9ecd5f..8d5535c58cc2 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
| @@ -176,8 +176,4 @@ extern void mutex_unlock(struct mutex *lock); | |||
| 176 | 176 | ||
| 177 | extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); | 177 | extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); |
| 178 | 178 | ||
| 179 | #ifndef arch_mutex_cpu_relax | ||
| 180 | # define arch_mutex_cpu_relax() cpu_relax() | ||
| 181 | #endif | ||
| 182 | |||
| 183 | #endif /* __LINUX_MUTEX_H */ | 179 | #endif /* __LINUX_MUTEX_H */ |
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index d99800cbdcf3..dcfdecbfa0b7 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h | |||
| @@ -176,4 +176,12 @@ enum { | |||
| 176 | NETIF_F_HW_VLAN_STAG_RX | \ | 176 | NETIF_F_HW_VLAN_STAG_RX | \ |
| 177 | NETIF_F_HW_VLAN_STAG_TX) | 177 | NETIF_F_HW_VLAN_STAG_TX) |
| 178 | 178 | ||
| 179 | #define NETIF_F_GSO_ENCAP_ALL (NETIF_F_GSO_GRE | \ | ||
| 180 | NETIF_F_GSO_GRE_CSUM | \ | ||
| 181 | NETIF_F_GSO_IPIP | \ | ||
| 182 | NETIF_F_GSO_SIT | \ | ||
| 183 | NETIF_F_GSO_UDP_TUNNEL | \ | ||
| 184 | NETIF_F_GSO_UDP_TUNNEL_CSUM | \ | ||
| 185 | NETIF_F_GSO_MPLS) | ||
| 186 | |||
| 179 | #endif /* _LINUX_NETDEV_FEATURES_H */ | 187 | #endif /* _LINUX_NETDEV_FEATURES_H */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 66f9a04ec270..38377392d082 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -943,7 +943,8 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev, | |||
| 943 | * const unsigned char *addr) | 943 | * const unsigned char *addr) |
| 944 | * Deletes the FDB entry from dev coresponding to addr. | 944 | * Deletes the FDB entry from dev coresponding to addr. |
| 945 | * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, | 945 | * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, |
| 946 | * struct net_device *dev, int idx) | 946 | * struct net_device *dev, struct net_device *filter_dev, |
| 947 | * int idx) | ||
| 947 | * Used to add FDB entries to dump requests. Implementers should add | 948 | * Used to add FDB entries to dump requests. Implementers should add |
| 948 | * entries to skb and update idx with the number of entries. | 949 | * entries to skb and update idx with the number of entries. |
| 949 | * | 950 | * |
| @@ -1114,6 +1115,7 @@ struct net_device_ops { | |||
| 1114 | int (*ndo_fdb_dump)(struct sk_buff *skb, | 1115 | int (*ndo_fdb_dump)(struct sk_buff *skb, |
| 1115 | struct netlink_callback *cb, | 1116 | struct netlink_callback *cb, |
| 1116 | struct net_device *dev, | 1117 | struct net_device *dev, |
| 1118 | struct net_device *filter_dev, | ||
| 1117 | int idx); | 1119 | int idx); |
| 1118 | 1120 | ||
| 1119 | int (*ndo_bridge_setlink)(struct net_device *dev, | 1121 | int (*ndo_bridge_setlink)(struct net_device *dev, |
| @@ -1229,42 +1231,228 @@ enum netdev_priv_flags { | |||
| 1229 | #define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE | 1231 | #define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE |
| 1230 | #define IFF_MACVLAN IFF_MACVLAN | 1232 | #define IFF_MACVLAN IFF_MACVLAN |
| 1231 | 1233 | ||
| 1232 | /* | 1234 | /** |
| 1233 | * The DEVICE structure. | 1235 | * struct net_device - The DEVICE structure. |
| 1234 | * Actually, this whole structure is a big mistake. It mixes I/O | 1236 | * Actually, this whole structure is a big mistake. It mixes I/O |
| 1235 | * data with strictly "high-level" data, and it has to know about | 1237 | * data with strictly "high-level" data, and it has to know about |
| 1236 | * almost every data structure used in the INET module. | 1238 | * almost every data structure used in the INET module. |
| 1239 | * | ||
| 1240 | * @name: This is the first field of the "visible" part of this structure | ||
| 1241 | * (i.e. as seen by users in the "Space.c" file). It is the name | ||
| 1242 | * of the interface. | ||
| 1243 | * | ||
| 1244 | * @name_hlist: Device name hash chain, please keep it close to name[] | ||
| 1245 | * @ifalias: SNMP alias | ||
| 1246 | * @mem_end: Shared memory end | ||
| 1247 | * @mem_start: Shared memory start | ||
| 1248 | * @base_addr: Device I/O address | ||
| 1249 | * @irq: Device IRQ number | ||
| 1250 | * | ||
| 1251 | * @state: Generic network queuing layer state, see netdev_state_t | ||
| 1252 | * @dev_list: The global list of network devices | ||
| 1253 | * @napi_list: List entry, that is used for polling napi devices | ||
| 1254 | * @unreg_list: List entry, that is used, when we are unregistering the | ||
| 1255 | * device, see the function unregister_netdev | ||
| 1256 | * @close_list: List entry, that is used, when we are closing the device | ||
| 1257 | * | ||
| 1258 | * @adj_list: Directly linked devices, like slaves for bonding | ||
| 1259 | * @all_adj_list: All linked devices, *including* neighbours | ||
| 1260 | * @features: Currently active device features | ||
| 1261 | * @hw_features: User-changeable features | ||
| 1262 | * | ||
| 1263 | * @wanted_features: User-requested features | ||
| 1264 | * @vlan_features: Mask of features inheritable by VLAN devices | ||
| 1265 | * | ||
| 1266 | * @hw_enc_features: Mask of features inherited by encapsulating devices | ||
| 1267 | * This field indicates what encapsulation | ||
| 1268 | * offloads the hardware is capable of doing, | ||
| 1269 | * and drivers will need to set them appropriately. | ||
| 1270 | * | ||
| 1271 | * @mpls_features: Mask of features inheritable by MPLS | ||
| 1272 | * | ||
| 1273 | * @ifindex: interface index | ||
| 1274 | * @iflink: unique device identifier | ||
| 1275 | * | ||
| 1276 | * @stats: Statistics struct, which was left as a legacy, use | ||
| 1277 | * rtnl_link_stats64 instead | ||
| 1278 | * | ||
| 1279 | * @rx_dropped: Dropped packets by core network, | ||
| 1280 | * do not use this in drivers | ||
| 1281 | * @tx_dropped: Dropped packets by core network, | ||
| 1282 | * do not use this in drivers | ||
| 1283 | * | ||
| 1284 | * @carrier_changes: Stats to monitor carrier on<->off transitions | ||
| 1285 | * | ||
| 1286 | * @wireless_handlers: List of functions to handle Wireless Extensions, | ||
| 1287 | * instead of ioctl, | ||
| 1288 | * see <net/iw_handler.h> for details. | ||
| 1289 | * @wireless_data: Instance data managed by the core of wireless extensions | ||
| 1290 | * | ||
| 1291 | * @netdev_ops: Includes several pointers to callbacks, | ||
| 1292 | * if one wants to override the ndo_*() functions | ||
| 1293 | * @ethtool_ops: Management operations | ||
| 1294 | * @fwd_ops: Management operations | ||
| 1295 | * @header_ops: Includes callbacks for creating,parsing,rebuilding,etc | ||
| 1296 | * of Layer 2 headers. | ||
| 1297 | * | ||
| 1298 | * @flags: Interface flags (a la BSD) | ||
| 1299 | * @priv_flags: Like 'flags' but invisible to userspace, | ||
| 1300 | * see if.h for the definitions | ||
| 1301 | * @gflags: Global flags ( kept as legacy ) | ||
| 1302 | * @padded: How much padding added by alloc_netdev() | ||
| 1303 | * @operstate: RFC2863 operstate | ||
| 1304 | * @link_mode: Mapping policy to operstate | ||
| 1305 | * @if_port: Selectable AUI, TP, ... | ||
| 1306 | * @dma: DMA channel | ||
| 1307 | * @mtu: Interface MTU value | ||
| 1308 | * @type: Interface hardware type | ||
| 1309 | * @hard_header_len: Hardware header length | ||
| 1310 | * | ||
| 1311 | * @needed_headroom: Extra headroom the hardware may need, but not in all | ||
| 1312 | * cases can this be guaranteed | ||
| 1313 | * @needed_tailroom: Extra tailroom the hardware may need, but not in all | ||
| 1314 | * cases can this be guaranteed. Some cases also use | ||
| 1315 | * LL_MAX_HEADER instead to allocate the skb | ||
| 1316 | * | ||
| 1317 | * interface address info: | ||
| 1318 | * | ||
| 1319 | * @perm_addr: Permanent hw address | ||
| 1320 | * @addr_assign_type: Hw address assignment type | ||
| 1321 | * @addr_len: Hardware address length | ||
| 1322 | * @neigh_priv_len; Used in neigh_alloc(), | ||
| 1323 | * initialized only in atm/clip.c | ||
| 1324 | * @dev_id: Used to differentiate devices that share | ||
| 1325 | * the same link layer address | ||
| 1326 | * @dev_port: Used to differentiate devices that share | ||
| 1327 | * the same function | ||
| 1328 | * @addr_list_lock: XXX: need comments on this one | ||
| 1329 | * @uc: unicast mac addresses | ||
| 1330 | * @mc: multicast mac addresses | ||
| 1331 | * @dev_addrs: list of device hw addresses | ||
| 1332 | * @queues_kset: Group of all Kobjects in the Tx and RX queues | ||
| 1333 | * @uc_promisc: Counter, that indicates, that promiscuous mode | ||
| 1334 | * has been enabled due to the need to listen to | ||
| 1335 | * additional unicast addresses in a device that | ||
| 1336 | * does not implement ndo_set_rx_mode() | ||
| 1337 | * @promiscuity: Number of times, the NIC is told to work in | ||
| 1338 | * Promiscuous mode, if it becomes 0 the NIC will | ||
| 1339 | * exit from working in Promiscuous mode | ||
| 1340 | * @allmulti: Counter, enables or disables allmulticast mode | ||
| 1341 | * | ||
| 1342 | * @vlan_info: VLAN info | ||
| 1343 | * @dsa_ptr: dsa specific data | ||
| 1344 | * @tipc_ptr: TIPC specific data | ||
| 1345 | * @atalk_ptr: AppleTalk link | ||
| 1346 | * @ip_ptr: IPv4 specific data | ||
| 1347 | * @dn_ptr: DECnet specific data | ||
| 1348 | * @ip6_ptr: IPv6 specific data | ||
| 1349 | * @ax25_ptr: AX.25 specific data | ||
| 1350 | * @ieee80211_ptr: IEEE 802.11 specific data, assign before registering | ||
| 1351 | * | ||
| 1352 | * @last_rx: Time of last Rx | ||
| 1353 | * @dev_addr: Hw address (before bcast, | ||
| 1354 | * because most packets are unicast) | ||
| 1355 | * | ||
| 1356 | * @_rx: Array of RX queues | ||
| 1357 | * @num_rx_queues: Number of RX queues | ||
| 1358 | * allocated at register_netdev() time | ||
| 1359 | * @real_num_rx_queues: Number of RX queues currently active in device | ||
| 1360 | * | ||
| 1361 | * @rx_handler: handler for received packets | ||
| 1362 | * @rx_handler_data: XXX: need comments on this one | ||
| 1363 | * @ingress_queue: XXX: need comments on this one | ||
| 1364 | * @broadcast: hw bcast address | ||
| 1365 | * | ||
| 1366 | * @_tx: Array of TX queues | ||
| 1367 | * @num_tx_queues: Number of TX queues allocated at alloc_netdev_mq() time | ||
| 1368 | * @real_num_tx_queues: Number of TX queues currently active in device | ||
| 1369 | * @qdisc: Root qdisc from userspace point of view | ||
| 1370 | * @tx_queue_len: Max frames per queue allowed | ||
| 1371 | * @tx_global_lock: XXX: need comments on this one | ||
| 1372 | * | ||
| 1373 | * @xps_maps: XXX: need comments on this one | ||
| 1374 | * | ||
| 1375 | * @rx_cpu_rmap: CPU reverse-mapping for RX completion interrupts, | ||
| 1376 | * indexed by RX queue number. Assigned by driver. | ||
| 1377 | * This must only be set if the ndo_rx_flow_steer | ||
| 1378 | * operation is defined | ||
| 1379 | * | ||
| 1380 | * @trans_start: Time (in jiffies) of last Tx | ||
| 1381 | * @watchdog_timeo: Represents the timeout that is used by | ||
| 1382 | * the watchdog ( see dev_watchdog() ) | ||
| 1383 | * @watchdog_timer: List of timers | ||
| 1384 | * | ||
| 1385 | * @pcpu_refcnt: Number of references to this device | ||
| 1386 | * @todo_list: Delayed register/unregister | ||
| 1387 | * @index_hlist: Device index hash chain | ||
| 1388 | * @link_watch_list: XXX: need comments on this one | ||
| 1389 | * | ||
| 1390 | * @reg_state: Register/unregister state machine | ||
| 1391 | * @dismantle: Device is going to be freed | ||
| 1392 | * @rtnl_link_state: This enum represents the phases of creating | ||
| 1393 | * a new link | ||
| 1394 | * | ||
| 1395 | * @destructor: Called from unregister, | ||
| 1396 | * can be used to call free_netdev | ||
| 1397 | * @npinfo: XXX: need comments on this one | ||
| 1398 | * @nd_net: Network namespace this network device is inside | ||
| 1399 | * | ||
| 1400 | * @ml_priv: Mid-layer private | ||
| 1401 | * @lstats: Loopback statistics | ||
| 1402 | * @tstats: Tunnel statistics | ||
| 1403 | * @dstats: Dummy statistics | ||
| 1404 | * @vstats: Virtual ethernet statistics | ||
| 1405 | * | ||
| 1406 | * @garp_port: GARP | ||
| 1407 | * @mrp_port: MRP | ||
| 1408 | * | ||
| 1409 | * @dev: Class/net/name entry | ||
| 1410 | * @sysfs_groups: Space for optional device, statistics and wireless | ||
| 1411 | * sysfs groups | ||
| 1412 | * | ||
| 1413 | * @sysfs_rx_queue_group: Space for optional per-rx queue attributes | ||
| 1414 | * @rtnl_link_ops: Rtnl_link_ops | ||
| 1415 | * | ||
| 1416 | * @gso_max_size: Maximum size of generic segmentation offload | ||
| 1417 | * @gso_max_segs: Maximum number of segments that can be passed to the | ||
| 1418 | * NIC for GSO | ||
| 1419 | * | ||
| 1420 | * @dcbnl_ops: Data Center Bridging netlink ops | ||
| 1421 | * @num_tc: Number of traffic classes in the net device | ||
| 1422 | * @tc_to_txq: XXX: need comments on this one | ||
| 1423 | * @prio_tc_map XXX: need comments on this one | ||
| 1424 | * | ||
| 1425 | * @fcoe_ddp_xid: Max exchange id for FCoE LRO by ddp | ||
| 1426 | * | ||
| 1427 | * @priomap: XXX: need comments on this one | ||
| 1428 | * @phydev: Physical device may attach itself | ||
| 1429 | * for hardware timestamping | ||
| 1430 | * | ||
| 1431 | * @qdisc_tx_busylock: XXX: need comments on this one | ||
| 1432 | * | ||
| 1433 | * @group: The group, that the device belongs to | ||
| 1434 | * @pm_qos_req: Power Management QoS object | ||
| 1237 | * | 1435 | * |
| 1238 | * FIXME: cleanup struct net_device such that network protocol info | 1436 | * FIXME: cleanup struct net_device such that network protocol info |
| 1239 | * moves out. | 1437 | * moves out. |
| 1240 | */ | 1438 | */ |
| 1241 | 1439 | ||
| 1242 | struct net_device { | 1440 | struct net_device { |
| 1243 | |||
| 1244 | /* | ||
| 1245 | * This is the first field of the "visible" part of this structure | ||
| 1246 | * (i.e. as seen by users in the "Space.c" file). It is the name | ||
| 1247 | * of the interface. | ||
| 1248 | */ | ||
| 1249 | char name[IFNAMSIZ]; | 1441 | char name[IFNAMSIZ]; |
| 1250 | |||
| 1251 | /* device name hash chain, please keep it close to name[] */ | ||
| 1252 | struct hlist_node name_hlist; | 1442 | struct hlist_node name_hlist; |
| 1253 | |||
| 1254 | /* snmp alias */ | ||
| 1255 | char *ifalias; | 1443 | char *ifalias; |
| 1256 | |||
| 1257 | /* | 1444 | /* |
| 1258 | * I/O specific fields | 1445 | * I/O specific fields |
| 1259 | * FIXME: Merge these and struct ifmap into one | 1446 | * FIXME: Merge these and struct ifmap into one |
| 1260 | */ | 1447 | */ |
| 1261 | unsigned long mem_end; /* shared mem end */ | 1448 | unsigned long mem_end; |
| 1262 | unsigned long mem_start; /* shared mem start */ | 1449 | unsigned long mem_start; |
| 1263 | unsigned long base_addr; /* device I/O address */ | 1450 | unsigned long base_addr; |
| 1264 | int irq; /* device IRQ number */ | 1451 | int irq; |
| 1265 | 1452 | ||
| 1266 | /* | 1453 | /* |
| 1267 | * Some hardware also needs these fields, but they are not | 1454 | * Some hardware also needs these fields (state,dev_list, |
| 1455 | * napi_list,unreg_list,close_list) but they are not | ||
| 1268 | * part of the usual set specified in Space.c. | 1456 | * part of the usual set specified in Space.c. |
| 1269 | */ | 1457 | */ |
| 1270 | 1458 | ||
| @@ -1275,110 +1463,80 @@ struct net_device { | |||
| 1275 | struct list_head unreg_list; | 1463 | struct list_head unreg_list; |
| 1276 | struct list_head close_list; | 1464 | struct list_head close_list; |
| 1277 | 1465 | ||
| 1278 | /* directly linked devices, like slaves for bonding */ | ||
| 1279 | struct { | 1466 | struct { |
| 1280 | struct list_head upper; | 1467 | struct list_head upper; |
| 1281 | struct list_head lower; | 1468 | struct list_head lower; |
| 1282 | } adj_list; | 1469 | } adj_list; |
| 1283 | 1470 | ||
| 1284 | /* all linked devices, *including* neighbours */ | ||
| 1285 | struct { | 1471 | struct { |
| 1286 | struct list_head upper; | 1472 | struct list_head upper; |
| 1287 | struct list_head lower; | 1473 | struct list_head lower; |
| 1288 | } all_adj_list; | 1474 | } all_adj_list; |
| 1289 | 1475 | ||
| 1290 | |||
| 1291 | /* currently active device features */ | ||
| 1292 | netdev_features_t features; | 1476 | netdev_features_t features; |
| 1293 | /* user-changeable features */ | ||
| 1294 | netdev_features_t hw_features; | 1477 | netdev_features_t hw_features; |
| 1295 | /* user-requested features */ | ||
| 1296 | netdev_features_t wanted_features; | 1478 | netdev_features_t wanted_features; |
| 1297 | /* mask of features inheritable by VLAN devices */ | ||
| 1298 | netdev_features_t vlan_features; | 1479 | netdev_features_t vlan_features; |
| 1299 | /* mask of features inherited by encapsulating devices | ||
| 1300 | * This field indicates what encapsulation offloads | ||
| 1301 | * the hardware is capable of doing, and drivers will | ||
| 1302 | * need to set them appropriately. | ||
| 1303 | */ | ||
| 1304 | netdev_features_t hw_enc_features; | 1480 | netdev_features_t hw_enc_features; |
| 1305 | /* mask of fetures inheritable by MPLS */ | ||
| 1306 | netdev_features_t mpls_features; | 1481 | netdev_features_t mpls_features; |
| 1307 | 1482 | ||
| 1308 | /* Interface index. Unique device identifier */ | ||
| 1309 | int ifindex; | 1483 | int ifindex; |
| 1310 | int iflink; | 1484 | int iflink; |
| 1311 | 1485 | ||
| 1312 | struct net_device_stats stats; | 1486 | struct net_device_stats stats; |
| 1313 | 1487 | ||
| 1314 | /* dropped packets by core network, Do not use this in drivers */ | ||
| 1315 | atomic_long_t rx_dropped; | 1488 | atomic_long_t rx_dropped; |
| 1316 | atomic_long_t tx_dropped; | 1489 | atomic_long_t tx_dropped; |
| 1317 | 1490 | ||
| 1318 | /* Stats to monitor carrier on<->off transitions */ | ||
| 1319 | atomic_t carrier_changes; | 1491 | atomic_t carrier_changes; |
| 1320 | 1492 | ||
| 1321 | #ifdef CONFIG_WIRELESS_EXT | 1493 | #ifdef CONFIG_WIRELESS_EXT |
| 1322 | /* List of functions to handle Wireless Extensions (instead of ioctl). | ||
| 1323 | * See <net/iw_handler.h> for details. Jean II */ | ||
| 1324 | const struct iw_handler_def * wireless_handlers; | 1494 | const struct iw_handler_def * wireless_handlers; |
| 1325 | /* Instance data managed by the core of Wireless Extensions. */ | ||
| 1326 | struct iw_public_data * wireless_data; | 1495 | struct iw_public_data * wireless_data; |
| 1327 | #endif | 1496 | #endif |
| 1328 | /* Management operations */ | ||
| 1329 | const struct net_device_ops *netdev_ops; | 1497 | const struct net_device_ops *netdev_ops; |
| 1330 | const struct ethtool_ops *ethtool_ops; | 1498 | const struct ethtool_ops *ethtool_ops; |
| 1331 | const struct forwarding_accel_ops *fwd_ops; | 1499 | const struct forwarding_accel_ops *fwd_ops; |
| 1332 | 1500 | ||
| 1333 | /* Hardware header description */ | ||
| 1334 | const struct header_ops *header_ops; | 1501 | const struct header_ops *header_ops; |
| 1335 | 1502 | ||
| 1336 | unsigned int flags; /* interface flags (a la BSD) */ | 1503 | unsigned int flags; |
| 1337 | unsigned int priv_flags; /* Like 'flags' but invisible to userspace. | 1504 | unsigned int priv_flags; |
| 1338 | * See if.h for definitions. */ | 1505 | |
| 1339 | unsigned short gflags; | 1506 | unsigned short gflags; |
| 1340 | unsigned short padded; /* How much padding added by alloc_netdev() */ | 1507 | unsigned short padded; |
| 1341 | 1508 | ||
| 1342 | unsigned char operstate; /* RFC2863 operstate */ | 1509 | unsigned char operstate; |
| 1343 | unsigned char link_mode; /* mapping policy to operstate */ | 1510 | unsigned char link_mode; |
| 1344 | 1511 | ||
| 1345 | unsigned char if_port; /* Selectable AUI, TP,..*/ | 1512 | unsigned char if_port; |
| 1346 | unsigned char dma; /* DMA channel */ | 1513 | unsigned char dma; |
| 1347 | 1514 | ||
| 1348 | unsigned int mtu; /* interface MTU value */ | 1515 | unsigned int mtu; |
| 1349 | unsigned short type; /* interface hardware type */ | 1516 | unsigned short type; |
| 1350 | unsigned short hard_header_len; /* hardware hdr length */ | 1517 | unsigned short hard_header_len; |
| 1351 | 1518 | ||
| 1352 | /* extra head- and tailroom the hardware may need, but not in all cases | ||
| 1353 | * can this be guaranteed, especially tailroom. Some cases also use | ||
| 1354 | * LL_MAX_HEADER instead to allocate the skb. | ||
| 1355 | */ | ||
| 1356 | unsigned short needed_headroom; | 1519 | unsigned short needed_headroom; |
| 1357 | unsigned short needed_tailroom; | 1520 | unsigned short needed_tailroom; |
| 1358 | 1521 | ||
| 1359 | /* Interface address info. */ | 1522 | /* Interface address info. */ |
| 1360 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ | 1523 | unsigned char perm_addr[MAX_ADDR_LEN]; |
| 1361 | unsigned char addr_assign_type; /* hw address assignment type */ | 1524 | unsigned char addr_assign_type; |
| 1362 | unsigned char addr_len; /* hardware address length */ | 1525 | unsigned char addr_len; |
| 1363 | unsigned short neigh_priv_len; | 1526 | unsigned short neigh_priv_len; |
| 1364 | unsigned short dev_id; /* Used to differentiate devices | 1527 | unsigned short dev_id; |
| 1365 | * that share the same link | 1528 | unsigned short dev_port; |
| 1366 | * layer address | ||
| 1367 | */ | ||
| 1368 | unsigned short dev_port; /* Used to differentiate | ||
| 1369 | * devices that share the same | ||
| 1370 | * function | ||
| 1371 | */ | ||
| 1372 | spinlock_t addr_list_lock; | 1529 | spinlock_t addr_list_lock; |
| 1373 | struct netdev_hw_addr_list uc; /* Unicast mac addresses */ | 1530 | struct netdev_hw_addr_list uc; |
| 1374 | struct netdev_hw_addr_list mc; /* Multicast mac addresses */ | 1531 | struct netdev_hw_addr_list mc; |
| 1375 | struct netdev_hw_addr_list dev_addrs; /* list of device | 1532 | struct netdev_hw_addr_list dev_addrs; |
| 1376 | * hw addresses | 1533 | |
| 1377 | */ | ||
| 1378 | #ifdef CONFIG_SYSFS | 1534 | #ifdef CONFIG_SYSFS |
| 1379 | struct kset *queues_kset; | 1535 | struct kset *queues_kset; |
| 1380 | #endif | 1536 | #endif |
| 1381 | 1537 | ||
| 1538 | unsigned char name_assign_type; | ||
| 1539 | |||
| 1382 | bool uc_promisc; | 1540 | bool uc_promisc; |
| 1383 | unsigned int promiscuity; | 1541 | unsigned int promiscuity; |
| 1384 | unsigned int allmulti; | 1542 | unsigned int allmulti; |
| @@ -1387,40 +1545,34 @@ struct net_device { | |||
| 1387 | /* Protocol specific pointers */ | 1545 | /* Protocol specific pointers */ |
| 1388 | 1546 | ||
| 1389 | #if IS_ENABLED(CONFIG_VLAN_8021Q) | 1547 | #if IS_ENABLED(CONFIG_VLAN_8021Q) |
| 1390 | struct vlan_info __rcu *vlan_info; /* VLAN info */ | 1548 | struct vlan_info __rcu *vlan_info; |
| 1391 | #endif | 1549 | #endif |
| 1392 | #if IS_ENABLED(CONFIG_NET_DSA) | 1550 | #if IS_ENABLED(CONFIG_NET_DSA) |
| 1393 | struct dsa_switch_tree *dsa_ptr; /* dsa specific data */ | 1551 | struct dsa_switch_tree *dsa_ptr; |
| 1394 | #endif | 1552 | #endif |
| 1395 | #if IS_ENABLED(CONFIG_TIPC) | 1553 | #if IS_ENABLED(CONFIG_TIPC) |
| 1396 | struct tipc_bearer __rcu *tipc_ptr; /* TIPC specific data */ | 1554 | struct tipc_bearer __rcu *tipc_ptr; |
| 1397 | #endif | 1555 | #endif |
| 1398 | void *atalk_ptr; /* AppleTalk link */ | 1556 | void *atalk_ptr; |
| 1399 | struct in_device __rcu *ip_ptr; /* IPv4 specific data */ | 1557 | struct in_device __rcu *ip_ptr; |
| 1400 | struct dn_dev __rcu *dn_ptr; /* DECnet specific data */ | 1558 | struct dn_dev __rcu *dn_ptr; |
| 1401 | struct inet6_dev __rcu *ip6_ptr; /* IPv6 specific data */ | 1559 | struct inet6_dev __rcu *ip6_ptr; |
| 1402 | void *ax25_ptr; /* AX.25 specific data */ | 1560 | void *ax25_ptr; |
| 1403 | struct wireless_dev *ieee80211_ptr; /* IEEE 802.11 specific data, | 1561 | struct wireless_dev *ieee80211_ptr; |
| 1404 | assign before registering */ | ||
| 1405 | 1562 | ||
| 1406 | /* | 1563 | /* |
| 1407 | * Cache lines mostly used on receive path (including eth_type_trans()) | 1564 | * Cache lines mostly used on receive path (including eth_type_trans()) |
| 1408 | */ | 1565 | */ |
| 1409 | unsigned long last_rx; /* Time of last Rx */ | 1566 | unsigned long last_rx; |
| 1410 | 1567 | ||
| 1411 | /* Interface address info used in eth_type_trans() */ | 1568 | /* Interface address info used in eth_type_trans() */ |
| 1412 | unsigned char *dev_addr; /* hw address, (before bcast | 1569 | unsigned char *dev_addr; |
| 1413 | because most packets are | ||
| 1414 | unicast) */ | ||
| 1415 | 1570 | ||
| 1416 | 1571 | ||
| 1417 | #ifdef CONFIG_SYSFS | 1572 | #ifdef CONFIG_SYSFS |
| 1418 | struct netdev_rx_queue *_rx; | 1573 | struct netdev_rx_queue *_rx; |
| 1419 | 1574 | ||
| 1420 | /* Number of RX queues allocated at register_netdev() time */ | ||
| 1421 | unsigned int num_rx_queues; | 1575 | unsigned int num_rx_queues; |
| 1422 | |||
| 1423 | /* Number of RX queues currently active in device */ | ||
| 1424 | unsigned int real_num_rx_queues; | 1576 | unsigned int real_num_rx_queues; |
| 1425 | 1577 | ||
| 1426 | #endif | 1578 | #endif |
| @@ -1429,33 +1581,23 @@ struct net_device { | |||
| 1429 | void __rcu *rx_handler_data; | 1581 | void __rcu *rx_handler_data; |
| 1430 | 1582 | ||
| 1431 | struct netdev_queue __rcu *ingress_queue; | 1583 | struct netdev_queue __rcu *ingress_queue; |
| 1432 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | 1584 | unsigned char broadcast[MAX_ADDR_LEN]; |
| 1433 | 1585 | ||
| 1434 | 1586 | ||
| 1435 | /* | 1587 | /* |
| 1436 | * Cache lines mostly used on transmit path | 1588 | * Cache lines mostly used on transmit path |
| 1437 | */ | 1589 | */ |
| 1438 | struct netdev_queue *_tx ____cacheline_aligned_in_smp; | 1590 | struct netdev_queue *_tx ____cacheline_aligned_in_smp; |
| 1439 | |||
| 1440 | /* Number of TX queues allocated at alloc_netdev_mq() time */ | ||
| 1441 | unsigned int num_tx_queues; | 1591 | unsigned int num_tx_queues; |
| 1442 | |||
| 1443 | /* Number of TX queues currently active in device */ | ||
| 1444 | unsigned int real_num_tx_queues; | 1592 | unsigned int real_num_tx_queues; |
| 1445 | |||
| 1446 | /* root qdisc from userspace point of view */ | ||
| 1447 | struct Qdisc *qdisc; | 1593 | struct Qdisc *qdisc; |
| 1448 | 1594 | unsigned long tx_queue_len; | |
| 1449 | unsigned long tx_queue_len; /* Max frames per queue allowed */ | ||
| 1450 | spinlock_t tx_global_lock; | 1595 | spinlock_t tx_global_lock; |
| 1451 | 1596 | ||
| 1452 | #ifdef CONFIG_XPS | 1597 | #ifdef CONFIG_XPS |
| 1453 | struct xps_dev_maps __rcu *xps_maps; | 1598 | struct xps_dev_maps __rcu *xps_maps; |
| 1454 | #endif | 1599 | #endif |
| 1455 | #ifdef CONFIG_RFS_ACCEL | 1600 | #ifdef CONFIG_RFS_ACCEL |
| 1456 | /* CPU reverse-mapping for RX completion interrupts, indexed | ||
| 1457 | * by RX queue number. Assigned by driver. This must only be | ||
| 1458 | * set if the ndo_rx_flow_steer operation is defined. */ | ||
| 1459 | struct cpu_rmap *rx_cpu_rmap; | 1601 | struct cpu_rmap *rx_cpu_rmap; |
| 1460 | #endif | 1602 | #endif |
| 1461 | 1603 | ||
| @@ -1465,22 +1607,17 @@ struct net_device { | |||
| 1465 | * trans_start here is expensive for high speed devices on SMP, | 1607 | * trans_start here is expensive for high speed devices on SMP, |
| 1466 | * please use netdev_queue->trans_start instead. | 1608 | * please use netdev_queue->trans_start instead. |
| 1467 | */ | 1609 | */ |
| 1468 | unsigned long trans_start; /* Time (in jiffies) of last Tx */ | 1610 | unsigned long trans_start; |
| 1469 | 1611 | ||
| 1470 | int watchdog_timeo; /* used by dev_watchdog() */ | 1612 | int watchdog_timeo; |
| 1471 | struct timer_list watchdog_timer; | 1613 | struct timer_list watchdog_timer; |
| 1472 | 1614 | ||
| 1473 | /* Number of references to this device */ | ||
| 1474 | int __percpu *pcpu_refcnt; | 1615 | int __percpu *pcpu_refcnt; |
| 1475 | |||
| 1476 | /* delayed register/unregister */ | ||
| 1477 | struct list_head todo_list; | 1616 | struct list_head todo_list; |
| 1478 | /* device index hash chain */ | ||
| 1479 | struct hlist_node index_hlist; | ||
| 1480 | 1617 | ||
| 1618 | struct hlist_node index_hlist; | ||
| 1481 | struct list_head link_watch_list; | 1619 | struct list_head link_watch_list; |
| 1482 | 1620 | ||
| 1483 | /* register/unregister state machine */ | ||
| 1484 | enum { NETREG_UNINITIALIZED=0, | 1621 | enum { NETREG_UNINITIALIZED=0, |
| 1485 | NETREG_REGISTERED, /* completed register_netdevice */ | 1622 | NETREG_REGISTERED, /* completed register_netdevice */ |
| 1486 | NETREG_UNREGISTERING, /* called unregister_netdevice */ | 1623 | NETREG_UNREGISTERING, /* called unregister_netdevice */ |
| @@ -1489,14 +1626,13 @@ struct net_device { | |||
| 1489 | NETREG_DUMMY, /* dummy device for NAPI poll */ | 1626 | NETREG_DUMMY, /* dummy device for NAPI poll */ |
| 1490 | } reg_state:8; | 1627 | } reg_state:8; |
| 1491 | 1628 | ||
| 1492 | bool dismantle; /* device is going do be freed */ | 1629 | bool dismantle; |
| 1493 | 1630 | ||
| 1494 | enum { | 1631 | enum { |
| 1495 | RTNL_LINK_INITIALIZED, | 1632 | RTNL_LINK_INITIALIZED, |
| 1496 | RTNL_LINK_INITIALIZING, | 1633 | RTNL_LINK_INITIALIZING, |
| 1497 | } rtnl_link_state:16; | 1634 | } rtnl_link_state:16; |
| 1498 | 1635 | ||
| 1499 | /* Called from unregister, can be used to call free_netdev */ | ||
| 1500 | void (*destructor)(struct net_device *dev); | 1636 | void (*destructor)(struct net_device *dev); |
| 1501 | 1637 | ||
| 1502 | #ifdef CONFIG_NETPOLL | 1638 | #ifdef CONFIG_NETPOLL |
| @@ -1504,31 +1640,25 @@ struct net_device { | |||
| 1504 | #endif | 1640 | #endif |
| 1505 | 1641 | ||
| 1506 | #ifdef CONFIG_NET_NS | 1642 | #ifdef CONFIG_NET_NS |
| 1507 | /* Network namespace this network device is inside */ | ||
| 1508 | struct net *nd_net; | 1643 | struct net *nd_net; |
| 1509 | #endif | 1644 | #endif |
| 1510 | 1645 | ||
| 1511 | /* mid-layer private */ | 1646 | /* mid-layer private */ |
| 1512 | union { | 1647 | union { |
| 1513 | void *ml_priv; | 1648 | void *ml_priv; |
| 1514 | struct pcpu_lstats __percpu *lstats; /* loopback stats */ | 1649 | struct pcpu_lstats __percpu *lstats; |
| 1515 | struct pcpu_sw_netstats __percpu *tstats; | 1650 | struct pcpu_sw_netstats __percpu *tstats; |
| 1516 | struct pcpu_dstats __percpu *dstats; /* dummy stats */ | 1651 | struct pcpu_dstats __percpu *dstats; |
| 1517 | struct pcpu_vstats __percpu *vstats; /* veth stats */ | 1652 | struct pcpu_vstats __percpu *vstats; |
| 1518 | }; | 1653 | }; |
| 1519 | /* GARP */ | 1654 | |
| 1520 | struct garp_port __rcu *garp_port; | 1655 | struct garp_port __rcu *garp_port; |
| 1521 | /* MRP */ | ||
| 1522 | struct mrp_port __rcu *mrp_port; | 1656 | struct mrp_port __rcu *mrp_port; |
| 1523 | 1657 | ||
| 1524 | /* class/net/name entry */ | 1658 | struct device dev; |
| 1525 | struct device dev; | ||
| 1526 | /* space for optional device, statistics, and wireless sysfs groups */ | ||
| 1527 | const struct attribute_group *sysfs_groups[4]; | 1659 | const struct attribute_group *sysfs_groups[4]; |
| 1528 | /* space for optional per-rx queue attributes */ | ||
| 1529 | const struct attribute_group *sysfs_rx_queue_group; | 1660 | const struct attribute_group *sysfs_rx_queue_group; |
| 1530 | 1661 | ||
| 1531 | /* rtnetlink link ops */ | ||
| 1532 | const struct rtnl_link_ops *rtnl_link_ops; | 1662 | const struct rtnl_link_ops *rtnl_link_ops; |
| 1533 | 1663 | ||
| 1534 | /* for setting kernel sock attribute on TCP connection setup */ | 1664 | /* for setting kernel sock attribute on TCP connection setup */ |
| @@ -1538,7 +1668,6 @@ struct net_device { | |||
| 1538 | u16 gso_max_segs; | 1668 | u16 gso_max_segs; |
| 1539 | 1669 | ||
| 1540 | #ifdef CONFIG_DCB | 1670 | #ifdef CONFIG_DCB |
| 1541 | /* Data Center Bridging netlink ops */ | ||
| 1542 | const struct dcbnl_rtnl_ops *dcbnl_ops; | 1671 | const struct dcbnl_rtnl_ops *dcbnl_ops; |
| 1543 | #endif | 1672 | #endif |
| 1544 | u8 num_tc; | 1673 | u8 num_tc; |
| @@ -1546,20 +1675,14 @@ struct net_device { | |||
| 1546 | u8 prio_tc_map[TC_BITMASK + 1]; | 1675 | u8 prio_tc_map[TC_BITMASK + 1]; |
| 1547 | 1676 | ||
| 1548 | #if IS_ENABLED(CONFIG_FCOE) | 1677 | #if IS_ENABLED(CONFIG_FCOE) |
| 1549 | /* max exchange id for FCoE LRO by ddp */ | ||
| 1550 | unsigned int fcoe_ddp_xid; | 1678 | unsigned int fcoe_ddp_xid; |
| 1551 | #endif | 1679 | #endif |
| 1552 | #if IS_ENABLED(CONFIG_CGROUP_NET_PRIO) | 1680 | #if IS_ENABLED(CONFIG_CGROUP_NET_PRIO) |
| 1553 | struct netprio_map __rcu *priomap; | 1681 | struct netprio_map __rcu *priomap; |
| 1554 | #endif | 1682 | #endif |
| 1555 | /* phy device may attach itself for hardware timestamping */ | ||
| 1556 | struct phy_device *phydev; | 1683 | struct phy_device *phydev; |
| 1557 | |||
| 1558 | struct lock_class_key *qdisc_tx_busylock; | 1684 | struct lock_class_key *qdisc_tx_busylock; |
| 1559 | |||
| 1560 | /* group the device belongs to */ | ||
| 1561 | int group; | 1685 | int group; |
| 1562 | |||
| 1563 | struct pm_qos_request pm_qos_req; | 1686 | struct pm_qos_request pm_qos_req; |
| 1564 | }; | 1687 | }; |
| 1565 | #define to_net_dev(d) container_of(d, struct net_device, dev) | 1688 | #define to_net_dev(d) container_of(d, struct net_device, dev) |
| @@ -2486,7 +2609,7 @@ static inline int netif_set_xps_queue(struct net_device *dev, | |||
| 2486 | * as a distribution range limit for the returned value. | 2609 | * as a distribution range limit for the returned value. |
| 2487 | */ | 2610 | */ |
| 2488 | static inline u16 skb_tx_hash(const struct net_device *dev, | 2611 | static inline u16 skb_tx_hash(const struct net_device *dev, |
| 2489 | const struct sk_buff *skb) | 2612 | struct sk_buff *skb) |
| 2490 | { | 2613 | { |
| 2491 | return __skb_tx_hash(dev, skb, dev->real_num_tx_queues); | 2614 | return __skb_tx_hash(dev, skb, dev->real_num_tx_queues); |
| 2492 | } | 2615 | } |
| @@ -2987,13 +3110,15 @@ void ether_setup(struct net_device *dev); | |||
| 2987 | 3110 | ||
| 2988 | /* Support for loadable net-drivers */ | 3111 | /* Support for loadable net-drivers */ |
| 2989 | struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, | 3112 | struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, |
| 3113 | unsigned char name_assign_type, | ||
| 2990 | void (*setup)(struct net_device *), | 3114 | void (*setup)(struct net_device *), |
| 2991 | unsigned int txqs, unsigned int rxqs); | 3115 | unsigned int txqs, unsigned int rxqs); |
| 2992 | #define alloc_netdev(sizeof_priv, name, setup) \ | 3116 | #define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \ |
| 2993 | alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1) | 3117 | alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, 1, 1) |
| 2994 | 3118 | ||
| 2995 | #define alloc_netdev_mq(sizeof_priv, name, setup, count) \ | 3119 | #define alloc_netdev_mq(sizeof_priv, name, name_assign_type, setup, count) \ |
| 2996 | alloc_netdev_mqs(sizeof_priv, name, setup, count, count) | 3120 | alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, count, \ |
| 3121 | count) | ||
| 2997 | 3122 | ||
| 2998 | int register_netdev(struct net_device *dev); | 3123 | int register_netdev(struct net_device *dev); |
| 2999 | void unregister_netdev(struct net_device *dev); | 3124 | void unregister_netdev(struct net_device *dev); |
| @@ -3377,11 +3502,26 @@ extern struct pernet_operations __net_initdata loopback_net_ops; | |||
| 3377 | 3502 | ||
| 3378 | static inline const char *netdev_name(const struct net_device *dev) | 3503 | static inline const char *netdev_name(const struct net_device *dev) |
| 3379 | { | 3504 | { |
| 3380 | if (dev->reg_state != NETREG_REGISTERED) | 3505 | if (!dev->name[0] || strchr(dev->name, '%')) |
| 3381 | return "(unregistered net_device)"; | 3506 | return "(unnamed net_device)"; |
| 3382 | return dev->name; | 3507 | return dev->name; |
| 3383 | } | 3508 | } |
| 3384 | 3509 | ||
| 3510 | static inline const char *netdev_reg_state(const struct net_device *dev) | ||
| 3511 | { | ||
| 3512 | switch (dev->reg_state) { | ||
| 3513 | case NETREG_UNINITIALIZED: return " (uninitialized)"; | ||
| 3514 | case NETREG_REGISTERED: return ""; | ||
| 3515 | case NETREG_UNREGISTERING: return " (unregistering)"; | ||
| 3516 | case NETREG_UNREGISTERED: return " (unregistered)"; | ||
| 3517 | case NETREG_RELEASED: return " (released)"; | ||
| 3518 | case NETREG_DUMMY: return " (dummy)"; | ||
| 3519 | } | ||
| 3520 | |||
| 3521 | WARN_ONCE(1, "%s: unknown reg_state %d\n", dev->name, dev->reg_state); | ||
| 3522 | return " (unknown)"; | ||
| 3523 | } | ||
| 3524 | |||
| 3385 | __printf(3, 4) | 3525 | __printf(3, 4) |
| 3386 | int netdev_printk(const char *level, const struct net_device *dev, | 3526 | int netdev_printk(const char *level, const struct net_device *dev, |
| 3387 | const char *format, ...); | 3527 | const char *format, ...); |
| @@ -3438,7 +3578,8 @@ do { \ | |||
| 3438 | * file/line information and a backtrace. | 3578 | * file/line information and a backtrace. |
| 3439 | */ | 3579 | */ |
| 3440 | #define netdev_WARN(dev, format, args...) \ | 3580 | #define netdev_WARN(dev, format, args...) \ |
| 3441 | WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args) | 3581 | WARN(1, "netdevice: %s%s\n" format, netdev_name(dev), \ |
| 3582 | netdev_reg_state(dev), ##args) | ||
| 3442 | 3583 | ||
| 3443 | /* netif printk helpers, similar to netdev_printk */ | 3584 | /* netif printk helpers, similar to netdev_printk */ |
| 3444 | 3585 | ||
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 447775ee2c4b..1d2a6ab6b8bb 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h | |||
| @@ -63,4 +63,8 @@ extern int proc_dowatchdog(struct ctl_table *, int , | |||
| 63 | void __user *, size_t *, loff_t *); | 63 | void __user *, size_t *, loff_t *); |
| 64 | #endif | 64 | #endif |
| 65 | 65 | ||
| 66 | #ifdef CONFIG_HAVE_ACPI_APEI_NMI | ||
| 67 | #include <asm/nmi.h> | ||
| 68 | #endif | ||
| 69 | |||
| 66 | #endif | 70 | #endif |
diff --git a/include/linux/of_address.h b/include/linux/of_address.h index c13b8782a4eb..fb7b7221e063 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h | |||
| @@ -109,7 +109,12 @@ static inline bool of_dma_is_coherent(struct device_node *np) | |||
| 109 | extern int of_address_to_resource(struct device_node *dev, int index, | 109 | extern int of_address_to_resource(struct device_node *dev, int index, |
| 110 | struct resource *r); | 110 | struct resource *r); |
| 111 | void __iomem *of_iomap(struct device_node *node, int index); | 111 | void __iomem *of_iomap(struct device_node *node, int index); |
| 112 | void __iomem *of_io_request_and_map(struct device_node *device, | ||
| 113 | int index, char *name); | ||
| 112 | #else | 114 | #else |
| 115 | |||
| 116 | #include <linux/io.h> | ||
| 117 | |||
| 113 | static inline int of_address_to_resource(struct device_node *dev, int index, | 118 | static inline int of_address_to_resource(struct device_node *dev, int index, |
| 114 | struct resource *r) | 119 | struct resource *r) |
| 115 | { | 120 | { |
| @@ -120,6 +125,12 @@ static inline void __iomem *of_iomap(struct device_node *device, int index) | |||
| 120 | { | 125 | { |
| 121 | return NULL; | 126 | return NULL; |
| 122 | } | 127 | } |
| 128 | |||
| 129 | static inline void __iomem *of_io_request_and_map(struct device_node *device, | ||
| 130 | int index, char *name) | ||
| 131 | { | ||
| 132 | return IOMEM_ERR_PTR(-EINVAL); | ||
| 133 | } | ||
| 123 | #endif | 134 | #endif |
| 124 | 135 | ||
| 125 | #if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI) | 136 | #if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI) |
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 05117899fcb4..0ff360d5b3b3 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
| @@ -73,6 +73,8 @@ extern int early_init_dt_scan_root(unsigned long node, const char *uname, | |||
| 73 | int depth, void *data); | 73 | int depth, void *data); |
| 74 | 74 | ||
| 75 | extern bool early_init_dt_scan(void *params); | 75 | extern bool early_init_dt_scan(void *params); |
| 76 | extern bool early_init_dt_verify(void *params); | ||
| 77 | extern void early_init_dt_scan_nodes(void); | ||
| 76 | 78 | ||
| 77 | extern const char *of_flat_dt_get_machine_name(void); | 79 | extern const char *of_flat_dt_get_machine_name(void); |
| 78 | extern const void *of_flat_dt_match_machine(const void *default_match, | 80 | extern const void *of_flat_dt_match_machine(const void *default_match, |
| @@ -84,6 +86,7 @@ extern void unflatten_and_copy_device_tree(void); | |||
| 84 | extern void early_init_devtree(void *); | 86 | extern void early_init_devtree(void *); |
| 85 | extern void early_get_first_memblock_info(void *, phys_addr_t *); | 87 | extern void early_get_first_memblock_info(void *, phys_addr_t *); |
| 86 | extern u64 fdt_translate_address(const void *blob, int node_offset); | 88 | extern u64 fdt_translate_address(const void *blob, int node_offset); |
| 89 | extern void of_fdt_limit_memory(int limit); | ||
| 87 | #else /* CONFIG_OF_FLATTREE */ | 90 | #else /* CONFIG_OF_FLATTREE */ |
| 88 | static inline void early_init_fdt_scan_reserved_mem(void) {} | 91 | static inline void early_init_fdt_scan_reserved_mem(void) {} |
| 89 | static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } | 92 | static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } |
diff --git a/include/linux/oid_registry.h b/include/linux/oid_registry.h index 6926db724258..c2bbf672b84e 100644 --- a/include/linux/oid_registry.h +++ b/include/linux/oid_registry.h | |||
| @@ -52,9 +52,15 @@ enum OID { | |||
| 52 | OID_md4, /* 1.2.840.113549.2.4 */ | 52 | OID_md4, /* 1.2.840.113549.2.4 */ |
| 53 | OID_md5, /* 1.2.840.113549.2.5 */ | 53 | OID_md5, /* 1.2.840.113549.2.5 */ |
| 54 | 54 | ||
| 55 | OID_certAuthInfoAccess, /* 1.3.6.1.5.5.7.1.1 */ | 55 | /* Microsoft Authenticode & Software Publishing */ |
| 56 | OID_msIndirectData, /* 1.3.6.1.4.1.311.2.1.4 */ | ||
| 57 | OID_msPeImageDataObjId, /* 1.3.6.1.4.1.311.2.1.15 */ | ||
| 58 | OID_msIndividualSPKeyPurpose, /* 1.3.6.1.4.1.311.2.1.21 */ | ||
| 56 | OID_msOutlookExpress, /* 1.3.6.1.4.1.311.16.4 */ | 59 | OID_msOutlookExpress, /* 1.3.6.1.4.1.311.16.4 */ |
| 60 | |||
| 61 | OID_certAuthInfoAccess, /* 1.3.6.1.5.5.7.1.1 */ | ||
| 57 | OID_sha1, /* 1.3.14.3.2.26 */ | 62 | OID_sha1, /* 1.3.14.3.2.26 */ |
| 63 | OID_sha256, /* 2.16.840.1.101.3.4.2.1 */ | ||
| 58 | 64 | ||
| 59 | /* Distinguished Name attribute IDs [RFC 2256] */ | 65 | /* Distinguished Name attribute IDs [RFC 2256] */ |
| 60 | OID_commonName, /* 2.5.4.3 */ | 66 | OID_commonName, /* 2.5.4.3 */ |
diff --git a/include/linux/omap-iommu.h b/include/linux/omap-iommu.h index cac78de09c07..c1aede46718b 100644 --- a/include/linux/omap-iommu.h +++ b/include/linux/omap-iommu.h | |||
| @@ -10,41 +10,8 @@ | |||
| 10 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #ifndef _INTEL_IOMMU_H_ | 13 | #ifndef _OMAP_IOMMU_H_ |
| 14 | #define _INTEL_IOMMU_H_ | 14 | #define _OMAP_IOMMU_H_ |
| 15 | |||
| 16 | struct iovm_struct { | ||
| 17 | struct omap_iommu *iommu; /* iommu object which this belongs to */ | ||
| 18 | u32 da_start; /* area definition */ | ||
| 19 | u32 da_end; | ||
| 20 | u32 flags; /* IOVMF_: see below */ | ||
| 21 | struct list_head list; /* linked in ascending order */ | ||
| 22 | const struct sg_table *sgt; /* keep 'page' <-> 'da' mapping */ | ||
| 23 | void *va; /* mpu side mapped address */ | ||
| 24 | }; | ||
| 25 | |||
| 26 | #define MMU_RAM_ENDIAN_SHIFT 9 | ||
| 27 | #define MMU_RAM_ENDIAN_LITTLE (0 << MMU_RAM_ENDIAN_SHIFT) | ||
| 28 | #define MMU_RAM_ELSZ_8 (0 << MMU_RAM_ELSZ_SHIFT) | ||
| 29 | #define IOVMF_ENDIAN_LITTLE MMU_RAM_ENDIAN_LITTLE | ||
| 30 | #define MMU_RAM_ELSZ_SHIFT 7 | ||
| 31 | #define IOVMF_ELSZ_8 MMU_RAM_ELSZ_8 | ||
| 32 | |||
| 33 | struct iommu_domain; | ||
| 34 | |||
| 35 | extern struct iovm_struct *omap_find_iovm_area(struct device *dev, u32 da); | ||
| 36 | extern u32 | ||
| 37 | omap_iommu_vmap(struct iommu_domain *domain, struct device *dev, u32 da, | ||
| 38 | const struct sg_table *sgt, u32 flags); | ||
| 39 | extern struct sg_table *omap_iommu_vunmap(struct iommu_domain *domain, | ||
| 40 | struct device *dev, u32 da); | ||
| 41 | extern u32 | ||
| 42 | omap_iommu_vmalloc(struct iommu_domain *domain, struct device *dev, | ||
| 43 | u32 da, size_t bytes, u32 flags); | ||
| 44 | extern void | ||
| 45 | omap_iommu_vfree(struct iommu_domain *domain, struct device *dev, | ||
| 46 | const u32 da); | ||
| 47 | extern void *omap_da_to_va(struct device *dev, u32 da); | ||
| 48 | 15 | ||
| 49 | extern void omap_iommu_save_ctx(struct device *dev); | 16 | extern void omap_iommu_save_ctx(struct device *dev); |
| 50 | extern void omap_iommu_restore_ctx(struct device *dev); | 17 | extern void omap_iommu_restore_ctx(struct device *dev); |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 0a97b583ee8d..e1474ae18c88 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -399,6 +399,18 @@ static inline struct page *read_mapping_page(struct address_space *mapping, | |||
| 399 | } | 399 | } |
| 400 | 400 | ||
| 401 | /* | 401 | /* |
| 402 | * Get the offset in PAGE_SIZE. | ||
| 403 | * (TODO: hugepage should have ->index in PAGE_SIZE) | ||
| 404 | */ | ||
| 405 | static inline pgoff_t page_to_pgoff(struct page *page) | ||
| 406 | { | ||
| 407 | if (unlikely(PageHeadHuge(page))) | ||
| 408 | return page->index << compound_order(page); | ||
| 409 | else | ||
| 410 | return page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); | ||
| 411 | } | ||
| 412 | |||
| 413 | /* | ||
| 402 | * Return byte-offset into filesystem object for page. | 414 | * Return byte-offset into filesystem object for page. |
| 403 | */ | 415 | */ |
| 404 | static inline loff_t page_offset(struct page *page) | 416 | static inline loff_t page_offset(struct page *page) |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 637a608ded0b..64dacb7288a6 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
| @@ -11,12 +11,17 @@ | |||
| 11 | #include <linux/acpi.h> | 11 | #include <linux/acpi.h> |
| 12 | 12 | ||
| 13 | #ifdef CONFIG_ACPI | 13 | #ifdef CONFIG_ACPI |
| 14 | extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev, | 14 | extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev); |
| 15 | struct pci_bus *pci_bus); | 15 | static inline acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev) |
| 16 | extern acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev); | 16 | { |
| 17 | return acpi_remove_pm_notifier(dev); | ||
| 18 | } | ||
| 17 | extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev, | 19 | extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev, |
| 18 | struct pci_dev *pci_dev); | 20 | struct pci_dev *pci_dev); |
| 19 | extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev); | 21 | static inline acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev) |
| 22 | { | ||
| 23 | return acpi_remove_pm_notifier(dev); | ||
| 24 | } | ||
| 20 | extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle); | 25 | extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle); |
| 21 | 26 | ||
| 22 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | 27 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 466bcd111d85..61978a460841 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -978,6 +978,8 @@ int pci_try_reset_slot(struct pci_slot *slot); | |||
| 978 | int pci_probe_reset_bus(struct pci_bus *bus); | 978 | int pci_probe_reset_bus(struct pci_bus *bus); |
| 979 | int pci_reset_bus(struct pci_bus *bus); | 979 | int pci_reset_bus(struct pci_bus *bus); |
| 980 | int pci_try_reset_bus(struct pci_bus *bus); | 980 | int pci_try_reset_bus(struct pci_bus *bus); |
| 981 | void pci_reset_secondary_bus(struct pci_dev *dev); | ||
| 982 | void pcibios_reset_secondary_bus(struct pci_dev *dev); | ||
| 981 | void pci_reset_bridge_secondary_bus(struct pci_dev *dev); | 983 | void pci_reset_bridge_secondary_bus(struct pci_dev *dev); |
| 982 | void pci_update_resource(struct pci_dev *dev, int resno); | 984 | void pci_update_resource(struct pci_dev *dev, int resno); |
| 983 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 985 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
| @@ -1186,7 +1188,6 @@ int pci_msix_vec_count(struct pci_dev *dev); | |||
| 1186 | int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); | 1188 | int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); |
| 1187 | void pci_msix_shutdown(struct pci_dev *dev); | 1189 | void pci_msix_shutdown(struct pci_dev *dev); |
| 1188 | void pci_disable_msix(struct pci_dev *dev); | 1190 | void pci_disable_msix(struct pci_dev *dev); |
| 1189 | void msi_remove_pci_irq_vectors(struct pci_dev *dev); | ||
| 1190 | void pci_restore_msi_state(struct pci_dev *dev); | 1191 | void pci_restore_msi_state(struct pci_dev *dev); |
| 1191 | int pci_msi_enabled(void); | 1192 | int pci_msi_enabled(void); |
| 1192 | int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec); | 1193 | int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec); |
| @@ -1217,7 +1218,6 @@ static inline int pci_enable_msix(struct pci_dev *dev, | |||
| 1217 | { return -ENOSYS; } | 1218 | { return -ENOSYS; } |
| 1218 | static inline void pci_msix_shutdown(struct pci_dev *dev) { } | 1219 | static inline void pci_msix_shutdown(struct pci_dev *dev) { } |
| 1219 | static inline void pci_disable_msix(struct pci_dev *dev) { } | 1220 | static inline void pci_disable_msix(struct pci_dev *dev) { } |
| 1220 | static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) { } | ||
| 1221 | static inline void pci_restore_msi_state(struct pci_dev *dev) { } | 1221 | static inline void pci_restore_msi_state(struct pci_dev *dev) { } |
| 1222 | static inline int pci_msi_enabled(void) { return 0; } | 1222 | static inline int pci_msi_enabled(void) { return 0; } |
| 1223 | static inline int pci_enable_msi_range(struct pci_dev *dev, int minvec, | 1223 | static inline int pci_enable_msi_range(struct pci_dev *dev, int minvec, |
| @@ -1477,8 +1477,9 @@ enum pci_fixup_pass { | |||
| 1477 | pci_fixup_final, /* Final phase of device fixups */ | 1477 | pci_fixup_final, /* Final phase of device fixups */ |
| 1478 | pci_fixup_enable, /* pci_enable_device() time */ | 1478 | pci_fixup_enable, /* pci_enable_device() time */ |
| 1479 | pci_fixup_resume, /* pci_device_resume() */ | 1479 | pci_fixup_resume, /* pci_device_resume() */ |
| 1480 | pci_fixup_suspend, /* pci_device_suspend */ | 1480 | pci_fixup_suspend, /* pci_device_suspend() */ |
| 1481 | pci_fixup_resume_early, /* pci_device_resume_early() */ | 1481 | pci_fixup_resume_early, /* pci_device_resume_early() */ |
| 1482 | pci_fixup_suspend_late, /* pci_device_suspend_late() */ | ||
| 1482 | }; | 1483 | }; |
| 1483 | 1484 | ||
| 1484 | /* Anonymous variables would be nice... */ | 1485 | /* Anonymous variables would be nice... */ |
| @@ -1519,6 +1520,11 @@ enum pci_fixup_pass { | |||
| 1519 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1520 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
| 1520 | suspend##hook, vendor, device, class, \ | 1521 | suspend##hook, vendor, device, class, \ |
| 1521 | class_shift, hook) | 1522 | class_shift, hook) |
| 1523 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND_LATE(vendor, device, class, \ | ||
| 1524 | class_shift, hook) \ | ||
| 1525 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend_late, \ | ||
| 1526 | suspend_late##hook, vendor, device, \ | ||
| 1527 | class, class_shift, hook) | ||
| 1522 | 1528 | ||
| 1523 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ | 1529 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ |
| 1524 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1530 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
| @@ -1544,6 +1550,10 @@ enum pci_fixup_pass { | |||
| 1544 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1550 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
| 1545 | suspend##hook, vendor, device, \ | 1551 | suspend##hook, vendor, device, \ |
| 1546 | PCI_ANY_ID, 0, hook) | 1552 | PCI_ANY_ID, 0, hook) |
| 1553 | #define DECLARE_PCI_FIXUP_SUSPEND_LATE(vendor, device, hook) \ | ||
| 1554 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend_late, \ | ||
| 1555 | suspend_late##hook, vendor, device, \ | ||
| 1556 | PCI_ANY_ID, 0, hook) | ||
| 1547 | 1557 | ||
| 1548 | #ifdef CONFIG_PCI_QUIRKS | 1558 | #ifdef CONFIG_PCI_QUIRKS |
| 1549 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); | 1559 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 7fa31731c854..6ed0bb73a864 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | * Do not add new entries to this file unless the definitions | 6 | * Do not add new entries to this file unless the definitions |
| 7 | * are shared between multiple drivers. | 7 | * are shared between multiple drivers. |
| 8 | */ | 8 | */ |
| 9 | #ifndef _LINUX_PCI_IDS_H | ||
| 10 | #define _LINUX_PCI_IDS_H | ||
| 9 | 11 | ||
| 10 | /* Device classes and subclasses */ | 12 | /* Device classes and subclasses */ |
| 11 | 13 | ||
| @@ -2968,3 +2970,5 @@ | |||
| 2968 | #define PCI_DEVICE_ID_XEN_PLATFORM 0x0001 | 2970 | #define PCI_DEVICE_ID_XEN_PLATFORM 0x0001 |
| 2969 | 2971 | ||
| 2970 | #define PCI_VENDOR_ID_OCZ 0x1b85 | 2972 | #define PCI_VENDOR_ID_OCZ 0x1b85 |
| 2973 | |||
| 2974 | #endif /* _LINUX_PCI_IDS_H */ | ||
diff --git a/include/linux/pe.h b/include/linux/pe.h new file mode 100644 index 000000000000..e170b95e763b --- /dev/null +++ b/include/linux/pe.h | |||
| @@ -0,0 +1,448 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2011 Red Hat, Inc. | ||
| 3 | * All rights reserved. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; version 2 of the License. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | * | ||
| 17 | * Author(s): Peter Jones <pjones@redhat.com> | ||
| 18 | */ | ||
| 19 | #ifndef __LINUX_PE_H | ||
| 20 | #define __LINUX_PE_H | ||
| 21 | |||
| 22 | #include <linux/types.h> | ||
| 23 | |||
| 24 | #define MZ_MAGIC 0x5a4d /* "MZ" */ | ||
| 25 | |||
| 26 | struct mz_hdr { | ||
| 27 | uint16_t magic; /* MZ_MAGIC */ | ||
| 28 | uint16_t lbsize; /* size of last used block */ | ||
| 29 | uint16_t blocks; /* pages in file, 0x3 */ | ||
| 30 | uint16_t relocs; /* relocations */ | ||
| 31 | uint16_t hdrsize; /* header size in "paragraphs" */ | ||
| 32 | uint16_t min_extra_pps; /* .bss */ | ||
| 33 | uint16_t max_extra_pps; /* runtime limit for the arena size */ | ||
| 34 | uint16_t ss; /* relative stack segment */ | ||
| 35 | uint16_t sp; /* initial %sp register */ | ||
| 36 | uint16_t checksum; /* word checksum */ | ||
| 37 | uint16_t ip; /* initial %ip register */ | ||
| 38 | uint16_t cs; /* initial %cs relative to load segment */ | ||
| 39 | uint16_t reloc_table_offset; /* offset of the first relocation */ | ||
| 40 | uint16_t overlay_num; /* overlay number. set to 0. */ | ||
| 41 | uint16_t reserved0[4]; /* reserved */ | ||
| 42 | uint16_t oem_id; /* oem identifier */ | ||
| 43 | uint16_t oem_info; /* oem specific */ | ||
| 44 | uint16_t reserved1[10]; /* reserved */ | ||
| 45 | uint32_t peaddr; /* address of pe header */ | ||
| 46 | char message[64]; /* message to print */ | ||
| 47 | }; | ||
| 48 | |||
| 49 | struct mz_reloc { | ||
| 50 | uint16_t offset; | ||
| 51 | uint16_t segment; | ||
| 52 | }; | ||
| 53 | |||
| 54 | #define PE_MAGIC 0x00004550 /* "PE\0\0" */ | ||
| 55 | #define PE_OPT_MAGIC_PE32 0x010b | ||
| 56 | #define PE_OPT_MAGIC_PE32_ROM 0x0107 | ||
| 57 | #define PE_OPT_MAGIC_PE32PLUS 0x020b | ||
| 58 | |||
| 59 | /* machine type */ | ||
| 60 | #define IMAGE_FILE_MACHINE_UNKNOWN 0x0000 | ||
| 61 | #define IMAGE_FILE_MACHINE_AM33 0x01d3 | ||
| 62 | #define IMAGE_FILE_MACHINE_AMD64 0x8664 | ||
| 63 | #define IMAGE_FILE_MACHINE_ARM 0x01c0 | ||
| 64 | #define IMAGE_FILE_MACHINE_ARMV7 0x01c4 | ||
| 65 | #define IMAGE_FILE_MACHINE_EBC 0x0ebc | ||
| 66 | #define IMAGE_FILE_MACHINE_I386 0x014c | ||
| 67 | #define IMAGE_FILE_MACHINE_IA64 0x0200 | ||
| 68 | #define IMAGE_FILE_MACHINE_M32R 0x9041 | ||
| 69 | #define IMAGE_FILE_MACHINE_MIPS16 0x0266 | ||
| 70 | #define IMAGE_FILE_MACHINE_MIPSFPU 0x0366 | ||
| 71 | #define IMAGE_FILE_MACHINE_MIPSFPU16 0x0466 | ||
| 72 | #define IMAGE_FILE_MACHINE_POWERPC 0x01f0 | ||
| 73 | #define IMAGE_FILE_MACHINE_POWERPCFP 0x01f1 | ||
| 74 | #define IMAGE_FILE_MACHINE_R4000 0x0166 | ||
| 75 | #define IMAGE_FILE_MACHINE_SH3 0x01a2 | ||
| 76 | #define IMAGE_FILE_MACHINE_SH3DSP 0x01a3 | ||
| 77 | #define IMAGE_FILE_MACHINE_SH3E 0x01a4 | ||
| 78 | #define IMAGE_FILE_MACHINE_SH4 0x01a6 | ||
| 79 | #define IMAGE_FILE_MACHINE_SH5 0x01a8 | ||
| 80 | #define IMAGE_FILE_MACHINE_THUMB 0x01c2 | ||
| 81 | #define IMAGE_FILE_MACHINE_WCEMIPSV2 0x0169 | ||
| 82 | |||
| 83 | /* flags */ | ||
| 84 | #define IMAGE_FILE_RELOCS_STRIPPED 0x0001 | ||
| 85 | #define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 | ||
| 86 | #define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 | ||
| 87 | #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 | ||
| 88 | #define IMAGE_FILE_AGGRESSIVE_WS_TRIM 0x0010 | ||
| 89 | #define IMAGE_FILE_LARGE_ADDRESS_AWARE 0x0020 | ||
| 90 | #define IMAGE_FILE_16BIT_MACHINE 0x0040 | ||
| 91 | #define IMAGE_FILE_BYTES_REVERSED_LO 0x0080 | ||
| 92 | #define IMAGE_FILE_32BIT_MACHINE 0x0100 | ||
| 93 | #define IMAGE_FILE_DEBUG_STRIPPED 0x0200 | ||
| 94 | #define IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 0x0400 | ||
| 95 | #define IMAGE_FILE_NET_RUN_FROM_SWAP 0x0800 | ||
| 96 | #define IMAGE_FILE_SYSTEM 0x1000 | ||
| 97 | #define IMAGE_FILE_DLL 0x2000 | ||
| 98 | #define IMAGE_FILE_UP_SYSTEM_ONLY 0x4000 | ||
| 99 | #define IMAGE_FILE_BYTES_REVERSED_HI 0x8000 | ||
| 100 | |||
| 101 | struct pe_hdr { | ||
| 102 | uint32_t magic; /* PE magic */ | ||
| 103 | uint16_t machine; /* machine type */ | ||
| 104 | uint16_t sections; /* number of sections */ | ||
| 105 | uint32_t timestamp; /* time_t */ | ||
| 106 | uint32_t symbol_table; /* symbol table offset */ | ||
| 107 | uint32_t symbols; /* number of symbols */ | ||
| 108 | uint16_t opt_hdr_size; /* size of optional header */ | ||
| 109 | uint16_t flags; /* flags */ | ||
| 110 | }; | ||
| 111 | |||
| 112 | #define IMAGE_FILE_OPT_ROM_MAGIC 0x107 | ||
| 113 | #define IMAGE_FILE_OPT_PE32_MAGIC 0x10b | ||
| 114 | #define IMAGE_FILE_OPT_PE32_PLUS_MAGIC 0x20b | ||
| 115 | |||
| 116 | #define IMAGE_SUBSYSTEM_UNKNOWN 0 | ||
| 117 | #define IMAGE_SUBSYSTEM_NATIVE 1 | ||
| 118 | #define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 | ||
| 119 | #define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 | ||
| 120 | #define IMAGE_SUBSYSTEM_POSIX_CUI 7 | ||
| 121 | #define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9 | ||
| 122 | #define IMAGE_SUBSYSTEM_EFI_APPLICATION 10 | ||
| 123 | #define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11 | ||
| 124 | #define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12 | ||
| 125 | #define IMAGE_SUBSYSTEM_EFI_ROM_IMAGE 13 | ||
| 126 | #define IMAGE_SUBSYSTEM_XBOX 14 | ||
| 127 | |||
| 128 | #define IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE 0x0040 | ||
| 129 | #define IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY 0x0080 | ||
| 130 | #define IMAGE_DLL_CHARACTERISTICS_NX_COMPAT 0x0100 | ||
| 131 | #define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200 | ||
| 132 | #define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400 | ||
| 133 | #define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800 | ||
| 134 | #define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000 | ||
| 135 | #define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000 | ||
| 136 | |||
| 137 | /* the fact that pe32 isn't padded where pe32+ is 64-bit means union won't | ||
| 138 | * work right. vomit. */ | ||
| 139 | struct pe32_opt_hdr { | ||
| 140 | /* "standard" header */ | ||
| 141 | uint16_t magic; /* file type */ | ||
| 142 | uint8_t ld_major; /* linker major version */ | ||
| 143 | uint8_t ld_minor; /* linker minor version */ | ||
| 144 | uint32_t text_size; /* size of text section(s) */ | ||
| 145 | uint32_t data_size; /* size of data section(s) */ | ||
| 146 | uint32_t bss_size; /* size of bss section(s) */ | ||
| 147 | uint32_t entry_point; /* file offset of entry point */ | ||
| 148 | uint32_t code_base; /* relative code addr in ram */ | ||
| 149 | uint32_t data_base; /* relative data addr in ram */ | ||
| 150 | /* "windows" header */ | ||
| 151 | uint32_t image_base; /* preferred load address */ | ||
| 152 | uint32_t section_align; /* alignment in bytes */ | ||
| 153 | uint32_t file_align; /* file alignment in bytes */ | ||
| 154 | uint16_t os_major; /* major OS version */ | ||
| 155 | uint16_t os_minor; /* minor OS version */ | ||
| 156 | uint16_t image_major; /* major image version */ | ||
| 157 | uint16_t image_minor; /* minor image version */ | ||
| 158 | uint16_t subsys_major; /* major subsystem version */ | ||
| 159 | uint16_t subsys_minor; /* minor subsystem version */ | ||
| 160 | uint32_t win32_version; /* reserved, must be 0 */ | ||
| 161 | uint32_t image_size; /* image size */ | ||
| 162 | uint32_t header_size; /* header size rounded up to | ||
| 163 | file_align */ | ||
| 164 | uint32_t csum; /* checksum */ | ||
| 165 | uint16_t subsys; /* subsystem */ | ||
| 166 | uint16_t dll_flags; /* more flags! */ | ||
| 167 | uint32_t stack_size_req;/* amt of stack requested */ | ||
| 168 | uint32_t stack_size; /* amt of stack required */ | ||
| 169 | uint32_t heap_size_req; /* amt of heap requested */ | ||
| 170 | uint32_t heap_size; /* amt of heap required */ | ||
| 171 | uint32_t loader_flags; /* reserved, must be 0 */ | ||
| 172 | uint32_t data_dirs; /* number of data dir entries */ | ||
| 173 | }; | ||
| 174 | |||
| 175 | struct pe32plus_opt_hdr { | ||
| 176 | uint16_t magic; /* file type */ | ||
| 177 | uint8_t ld_major; /* linker major version */ | ||
| 178 | uint8_t ld_minor; /* linker minor version */ | ||
| 179 | uint32_t text_size; /* size of text section(s) */ | ||
| 180 | uint32_t data_size; /* size of data section(s) */ | ||
| 181 | uint32_t bss_size; /* size of bss section(s) */ | ||
| 182 | uint32_t entry_point; /* file offset of entry point */ | ||
| 183 | uint32_t code_base; /* relative code addr in ram */ | ||
| 184 | /* "windows" header */ | ||
| 185 | uint64_t image_base; /* preferred load address */ | ||
| 186 | uint32_t section_align; /* alignment in bytes */ | ||
| 187 | uint32_t file_align; /* file alignment in bytes */ | ||
| 188 | uint16_t os_major; /* major OS version */ | ||
| 189 | uint16_t os_minor; /* minor OS version */ | ||
| 190 | uint16_t image_major; /* major image version */ | ||
| 191 | uint16_t image_minor; /* minor image version */ | ||
| 192 | uint16_t subsys_major; /* major subsystem version */ | ||
| 193 | uint16_t subsys_minor; /* minor subsystem version */ | ||
| 194 | uint32_t win32_version; /* reserved, must be 0 */ | ||
| 195 | uint32_t image_size; /* image size */ | ||
| 196 | uint32_t header_size; /* header size rounded up to | ||
| 197 | file_align */ | ||
| 198 | uint32_t csum; /* checksum */ | ||
| 199 | uint16_t subsys; /* subsystem */ | ||
| 200 | uint16_t dll_flags; /* more flags! */ | ||
| 201 | uint64_t stack_size_req;/* amt of stack requested */ | ||
| 202 | uint64_t stack_size; /* amt of stack required */ | ||
| 203 | uint64_t heap_size_req; /* amt of heap requested */ | ||
| 204 | uint64_t heap_size; /* amt of heap required */ | ||
| 205 | uint32_t loader_flags; /* reserved, must be 0 */ | ||
| 206 | uint32_t data_dirs; /* number of data dir entries */ | ||
| 207 | }; | ||
| 208 | |||
| 209 | struct data_dirent { | ||
| 210 | uint32_t virtual_address; /* relative to load address */ | ||
| 211 | uint32_t size; | ||
| 212 | }; | ||
| 213 | |||
| 214 | struct data_directory { | ||
| 215 | struct data_dirent exports; /* .edata */ | ||
| 216 | struct data_dirent imports; /* .idata */ | ||
| 217 | struct data_dirent resources; /* .rsrc */ | ||
| 218 | struct data_dirent exceptions; /* .pdata */ | ||
| 219 | struct data_dirent certs; /* certs */ | ||
| 220 | struct data_dirent base_relocations; /* .reloc */ | ||
| 221 | struct data_dirent debug; /* .debug */ | ||
| 222 | struct data_dirent arch; /* reservered */ | ||
| 223 | struct data_dirent global_ptr; /* global pointer reg. Size=0 */ | ||
| 224 | struct data_dirent tls; /* .tls */ | ||
| 225 | struct data_dirent load_config; /* load configuration structure */ | ||
| 226 | struct data_dirent bound_imports; /* no idea */ | ||
| 227 | struct data_dirent import_addrs; /* import address table */ | ||
| 228 | struct data_dirent delay_imports; /* delay-load import table */ | ||
| 229 | struct data_dirent clr_runtime_hdr; /* .cor (object only) */ | ||
| 230 | struct data_dirent reserved; | ||
| 231 | }; | ||
| 232 | |||
| 233 | struct section_header { | ||
| 234 | char name[8]; /* name or "/12\0" string tbl offset */ | ||
| 235 | uint32_t virtual_size; /* size of loaded section in ram */ | ||
| 236 | uint32_t virtual_address; /* relative virtual address */ | ||
| 237 | uint32_t raw_data_size; /* size of the section */ | ||
| 238 | uint32_t data_addr; /* file pointer to first page of sec */ | ||
| 239 | uint32_t relocs; /* file pointer to relocation entries */ | ||
| 240 | uint32_t line_numbers; /* line numbers! */ | ||
| 241 | uint16_t num_relocs; /* number of relocations */ | ||
| 242 | uint16_t num_lin_numbers; /* srsly. */ | ||
| 243 | uint32_t flags; | ||
| 244 | }; | ||
| 245 | |||
| 246 | /* they actually defined 0x00000000 as well, but I think we'll skip that one. */ | ||
| 247 | #define IMAGE_SCN_RESERVED_0 0x00000001 | ||
| 248 | #define IMAGE_SCN_RESERVED_1 0x00000002 | ||
| 249 | #define IMAGE_SCN_RESERVED_2 0x00000004 | ||
| 250 | #define IMAGE_SCN_TYPE_NO_PAD 0x00000008 /* don't pad - obsolete */ | ||
| 251 | #define IMAGE_SCN_RESERVED_3 0x00000010 | ||
| 252 | #define IMAGE_SCN_CNT_CODE 0x00000020 /* .text */ | ||
| 253 | #define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 /* .data */ | ||
| 254 | #define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 /* .bss */ | ||
| 255 | #define IMAGE_SCN_LNK_OTHER 0x00000100 /* reserved */ | ||
| 256 | #define IMAGE_SCN_LNK_INFO 0x00000200 /* .drectve comments */ | ||
| 257 | #define IMAGE_SCN_RESERVED_4 0x00000400 | ||
| 258 | #define IMAGE_SCN_LNK_REMOVE 0x00000800 /* .o only - scn to be rm'd*/ | ||
| 259 | #define IMAGE_SCN_LNK_COMDAT 0x00001000 /* .o only - COMDAT data */ | ||
| 260 | #define IMAGE_SCN_RESERVED_5 0x00002000 /* spec omits this */ | ||
| 261 | #define IMAGE_SCN_RESERVED_6 0x00004000 /* spec omits this */ | ||
| 262 | #define IMAGE_SCN_GPREL 0x00008000 /* global pointer referenced data */ | ||
| 263 | /* spec lists 0x20000 twice, I suspect they meant 0x10000 for one of them */ | ||
| 264 | #define IMAGE_SCN_MEM_PURGEABLE 0x00010000 /* reserved for "future" use */ | ||
| 265 | #define IMAGE_SCN_16BIT 0x00020000 /* reserved for "future" use */ | ||
| 266 | #define IMAGE_SCN_LOCKED 0x00040000 /* reserved for "future" use */ | ||
| 267 | #define IMAGE_SCN_PRELOAD 0x00080000 /* reserved for "future" use */ | ||
| 268 | /* and here they just stuck a 1-byte integer in the middle of a bitfield */ | ||
| 269 | #define IMAGE_SCN_ALIGN_1BYTES 0x00100000 /* it does what it says on the box */ | ||
| 270 | #define IMAGE_SCN_ALIGN_2BYTES 0x00200000 | ||
| 271 | #define IMAGE_SCN_ALIGN_4BYTES 0x00300000 | ||
| 272 | #define IMAGE_SCN_ALIGN_8BYTES 0x00400000 | ||
| 273 | #define IMAGE_SCN_ALIGN_16BYTES 0x00500000 | ||
| 274 | #define IMAGE_SCN_ALIGN_32BYTES 0x00600000 | ||
| 275 | #define IMAGE_SCN_ALIGN_64BYTES 0x00700000 | ||
| 276 | #define IMAGE_SCN_ALIGN_128BYTES 0x00800000 | ||
| 277 | #define IMAGE_SCN_ALIGN_256BYTES 0x00900000 | ||
| 278 | #define IMAGE_SCN_ALIGN_512BYTES 0x00a00000 | ||
| 279 | #define IMAGE_SCN_ALIGN_1024BYTES 0x00b00000 | ||
| 280 | #define IMAGE_SCN_ALIGN_2048BYTES 0x00c00000 | ||
| 281 | #define IMAGE_SCN_ALIGN_4096BYTES 0x00d00000 | ||
| 282 | #define IMAGE_SCN_ALIGN_8192BYTES 0x00e00000 | ||
| 283 | #define IMAGE_SCN_LNK_NRELOC_OVFL 0x01000000 /* extended relocations */ | ||
| 284 | #define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 /* scn can be discarded */ | ||
| 285 | #define IMAGE_SCN_MEM_NOT_CACHED 0x04000000 /* cannot be cached */ | ||
| 286 | #define IMAGE_SCN_MEM_NOT_PAGED 0x08000000 /* not pageable */ | ||
| 287 | #define IMAGE_SCN_MEM_SHARED 0x10000000 /* can be shared */ | ||
| 288 | #define IMAGE_SCN_MEM_EXECUTE 0x20000000 /* can be executed as code */ | ||
| 289 | #define IMAGE_SCN_MEM_READ 0x40000000 /* readable */ | ||
| 290 | #define IMAGE_SCN_MEM_WRITE 0x80000000 /* writeable */ | ||
| 291 | |||
| 292 | enum x64_coff_reloc_type { | ||
| 293 | IMAGE_REL_AMD64_ABSOLUTE = 0, | ||
| 294 | IMAGE_REL_AMD64_ADDR64, | ||
| 295 | IMAGE_REL_AMD64_ADDR32, | ||
| 296 | IMAGE_REL_AMD64_ADDR32N, | ||
| 297 | IMAGE_REL_AMD64_REL32, | ||
| 298 | IMAGE_REL_AMD64_REL32_1, | ||
| 299 | IMAGE_REL_AMD64_REL32_2, | ||
| 300 | IMAGE_REL_AMD64_REL32_3, | ||
| 301 | IMAGE_REL_AMD64_REL32_4, | ||
| 302 | IMAGE_REL_AMD64_REL32_5, | ||
| 303 | IMAGE_REL_AMD64_SECTION, | ||
| 304 | IMAGE_REL_AMD64_SECREL, | ||
| 305 | IMAGE_REL_AMD64_SECREL7, | ||
| 306 | IMAGE_REL_AMD64_TOKEN, | ||
| 307 | IMAGE_REL_AMD64_SREL32, | ||
| 308 | IMAGE_REL_AMD64_PAIR, | ||
| 309 | IMAGE_REL_AMD64_SSPAN32, | ||
| 310 | }; | ||
| 311 | |||
| 312 | enum arm_coff_reloc_type { | ||
| 313 | IMAGE_REL_ARM_ABSOLUTE, | ||
| 314 | IMAGE_REL_ARM_ADDR32, | ||
| 315 | IMAGE_REL_ARM_ADDR32N, | ||
| 316 | IMAGE_REL_ARM_BRANCH2, | ||
| 317 | IMAGE_REL_ARM_BRANCH1, | ||
| 318 | IMAGE_REL_ARM_SECTION, | ||
| 319 | IMAGE_REL_ARM_SECREL, | ||
| 320 | }; | ||
| 321 | |||
| 322 | enum sh_coff_reloc_type { | ||
| 323 | IMAGE_REL_SH3_ABSOLUTE, | ||
| 324 | IMAGE_REL_SH3_DIRECT16, | ||
| 325 | IMAGE_REL_SH3_DIRECT32, | ||
| 326 | IMAGE_REL_SH3_DIRECT8, | ||
| 327 | IMAGE_REL_SH3_DIRECT8_WORD, | ||
| 328 | IMAGE_REL_SH3_DIRECT8_LONG, | ||
| 329 | IMAGE_REL_SH3_DIRECT4, | ||
| 330 | IMAGE_REL_SH3_DIRECT4_WORD, | ||
| 331 | IMAGE_REL_SH3_DIRECT4_LONG, | ||
| 332 | IMAGE_REL_SH3_PCREL8_WORD, | ||
| 333 | IMAGE_REL_SH3_PCREL8_LONG, | ||
| 334 | IMAGE_REL_SH3_PCREL12_WORD, | ||
| 335 | IMAGE_REL_SH3_STARTOF_SECTION, | ||
| 336 | IMAGE_REL_SH3_SIZEOF_SECTION, | ||
| 337 | IMAGE_REL_SH3_SECTION, | ||
| 338 | IMAGE_REL_SH3_SECREL, | ||
| 339 | IMAGE_REL_SH3_DIRECT32_NB, | ||
| 340 | IMAGE_REL_SH3_GPREL4_LONG, | ||
| 341 | IMAGE_REL_SH3_TOKEN, | ||
| 342 | IMAGE_REL_SHM_PCRELPT, | ||
| 343 | IMAGE_REL_SHM_REFLO, | ||
| 344 | IMAGE_REL_SHM_REFHALF, | ||
| 345 | IMAGE_REL_SHM_RELLO, | ||
| 346 | IMAGE_REL_SHM_RELHALF, | ||
| 347 | IMAGE_REL_SHM_PAIR, | ||
| 348 | IMAGE_REL_SHM_NOMODE, | ||
| 349 | }; | ||
| 350 | |||
| 351 | enum ppc_coff_reloc_type { | ||
| 352 | IMAGE_REL_PPC_ABSOLUTE, | ||
| 353 | IMAGE_REL_PPC_ADDR64, | ||
| 354 | IMAGE_REL_PPC_ADDR32, | ||
| 355 | IMAGE_REL_PPC_ADDR24, | ||
| 356 | IMAGE_REL_PPC_ADDR16, | ||
| 357 | IMAGE_REL_PPC_ADDR14, | ||
| 358 | IMAGE_REL_PPC_REL24, | ||
| 359 | IMAGE_REL_PPC_REL14, | ||
| 360 | IMAGE_REL_PPC_ADDR32N, | ||
| 361 | IMAGE_REL_PPC_SECREL, | ||
| 362 | IMAGE_REL_PPC_SECTION, | ||
| 363 | IMAGE_REL_PPC_SECREL16, | ||
| 364 | IMAGE_REL_PPC_REFHI, | ||
| 365 | IMAGE_REL_PPC_REFLO, | ||
| 366 | IMAGE_REL_PPC_PAIR, | ||
| 367 | IMAGE_REL_PPC_SECRELLO, | ||
| 368 | IMAGE_REL_PPC_GPREL, | ||
| 369 | IMAGE_REL_PPC_TOKEN, | ||
| 370 | }; | ||
| 371 | |||
| 372 | enum x86_coff_reloc_type { | ||
| 373 | IMAGE_REL_I386_ABSOLUTE, | ||
| 374 | IMAGE_REL_I386_DIR16, | ||
| 375 | IMAGE_REL_I386_REL16, | ||
| 376 | IMAGE_REL_I386_DIR32, | ||
| 377 | IMAGE_REL_I386_DIR32NB, | ||
| 378 | IMAGE_REL_I386_SEG12, | ||
| 379 | IMAGE_REL_I386_SECTION, | ||
| 380 | IMAGE_REL_I386_SECREL, | ||
| 381 | IMAGE_REL_I386_TOKEN, | ||
| 382 | IMAGE_REL_I386_SECREL7, | ||
| 383 | IMAGE_REL_I386_REL32, | ||
| 384 | }; | ||
| 385 | |||
| 386 | enum ia64_coff_reloc_type { | ||
| 387 | IMAGE_REL_IA64_ABSOLUTE, | ||
| 388 | IMAGE_REL_IA64_IMM14, | ||
| 389 | IMAGE_REL_IA64_IMM22, | ||
| 390 | IMAGE_REL_IA64_IMM64, | ||
| 391 | IMAGE_REL_IA64_DIR32, | ||
| 392 | IMAGE_REL_IA64_DIR64, | ||
| 393 | IMAGE_REL_IA64_PCREL21B, | ||
| 394 | IMAGE_REL_IA64_PCREL21M, | ||
| 395 | IMAGE_REL_IA64_PCREL21F, | ||
| 396 | IMAGE_REL_IA64_GPREL22, | ||
| 397 | IMAGE_REL_IA64_LTOFF22, | ||
| 398 | IMAGE_REL_IA64_SECTION, | ||
| 399 | IMAGE_REL_IA64_SECREL22, | ||
| 400 | IMAGE_REL_IA64_SECREL64I, | ||
| 401 | IMAGE_REL_IA64_SECREL32, | ||
| 402 | IMAGE_REL_IA64_DIR32NB, | ||
| 403 | IMAGE_REL_IA64_SREL14, | ||
| 404 | IMAGE_REL_IA64_SREL22, | ||
| 405 | IMAGE_REL_IA64_SREL32, | ||
| 406 | IMAGE_REL_IA64_UREL32, | ||
| 407 | IMAGE_REL_IA64_PCREL60X, | ||
| 408 | IMAGE_REL_IA64_PCREL60B, | ||
| 409 | IMAGE_REL_IA64_PCREL60F, | ||
| 410 | IMAGE_REL_IA64_PCREL60I, | ||
| 411 | IMAGE_REL_IA64_PCREL60M, | ||
| 412 | IMAGE_REL_IA64_IMMGPREL6, | ||
| 413 | IMAGE_REL_IA64_TOKEN, | ||
| 414 | IMAGE_REL_IA64_GPREL32, | ||
| 415 | IMAGE_REL_IA64_ADDEND, | ||
| 416 | }; | ||
| 417 | |||
| 418 | struct coff_reloc { | ||
| 419 | uint32_t virtual_address; | ||
| 420 | uint32_t symbol_table_index; | ||
| 421 | union { | ||
| 422 | enum x64_coff_reloc_type x64_type; | ||
| 423 | enum arm_coff_reloc_type arm_type; | ||
| 424 | enum sh_coff_reloc_type sh_type; | ||
| 425 | enum ppc_coff_reloc_type ppc_type; | ||
| 426 | enum x86_coff_reloc_type x86_type; | ||
| 427 | enum ia64_coff_reloc_type ia64_type; | ||
| 428 | uint16_t data; | ||
| 429 | }; | ||
| 430 | }; | ||
| 431 | |||
| 432 | /* | ||
| 433 | * Definitions for the contents of the certs data block | ||
| 434 | */ | ||
| 435 | #define WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x0002 | ||
| 436 | #define WIN_CERT_TYPE_EFI_OKCS115 0x0EF0 | ||
| 437 | #define WIN_CERT_TYPE_EFI_GUID 0x0EF1 | ||
| 438 | |||
| 439 | #define WIN_CERT_REVISION_1_0 0x0100 | ||
| 440 | #define WIN_CERT_REVISION_2_0 0x0200 | ||
| 441 | |||
| 442 | struct win_certificate { | ||
| 443 | uint32_t length; | ||
| 444 | uint16_t revision; | ||
| 445 | uint16_t cert_type; | ||
| 446 | }; | ||
| 447 | |||
| 448 | #endif /* __LINUX_PE_H */ | ||
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index dec01d6c3f80..cfd56046ecec 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
| @@ -1,6 +1,40 @@ | |||
| 1 | /* | ||
| 2 | * linux/percpu-defs.h - basic definitions for percpu areas | ||
| 3 | * | ||
| 4 | * DO NOT INCLUDE DIRECTLY OUTSIDE PERCPU IMPLEMENTATION PROPER. | ||
| 5 | * | ||
| 6 | * This file is separate from linux/percpu.h to avoid cyclic inclusion | ||
| 7 | * dependency from arch header files. Only to be included from | ||
| 8 | * asm/percpu.h. | ||
| 9 | * | ||
| 10 | * This file includes macros necessary to declare percpu sections and | ||
| 11 | * variables, and definitions of percpu accessors and operations. It | ||
| 12 | * should provide enough percpu features to arch header files even when | ||
| 13 | * they can only include asm/percpu.h to avoid cyclic inclusion dependency. | ||
| 14 | */ | ||
| 15 | |||
| 1 | #ifndef _LINUX_PERCPU_DEFS_H | 16 | #ifndef _LINUX_PERCPU_DEFS_H |
| 2 | #define _LINUX_PERCPU_DEFS_H | 17 | #define _LINUX_PERCPU_DEFS_H |
| 3 | 18 | ||
| 19 | #ifdef CONFIG_SMP | ||
| 20 | |||
| 21 | #ifdef MODULE | ||
| 22 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | ||
| 23 | #define PER_CPU_ALIGNED_SECTION "" | ||
| 24 | #else | ||
| 25 | #define PER_CPU_SHARED_ALIGNED_SECTION "..shared_aligned" | ||
| 26 | #define PER_CPU_ALIGNED_SECTION "..shared_aligned" | ||
| 27 | #endif | ||
| 28 | #define PER_CPU_FIRST_SECTION "..first" | ||
| 29 | |||
| 30 | #else | ||
| 31 | |||
| 32 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | ||
| 33 | #define PER_CPU_ALIGNED_SECTION "..shared_aligned" | ||
| 34 | #define PER_CPU_FIRST_SECTION "" | ||
| 35 | |||
| 36 | #endif | ||
| 37 | |||
| 4 | /* | 38 | /* |
| 5 | * Base implementations of per-CPU variable declarations and definitions, where | 39 | * Base implementations of per-CPU variable declarations and definitions, where |
| 6 | * the section in which the variable is to be placed is provided by the | 40 | * the section in which the variable is to be placed is provided by the |
| @@ -19,19 +53,6 @@ | |||
| 19 | __attribute__((section(".discard"), unused)) | 53 | __attribute__((section(".discard"), unused)) |
| 20 | 54 | ||
| 21 | /* | 55 | /* |
| 22 | * Macro which verifies @ptr is a percpu pointer without evaluating | ||
| 23 | * @ptr. This is to be used in percpu accessors to verify that the | ||
| 24 | * input parameter is a percpu pointer. | ||
| 25 | * | ||
| 26 | * + 0 is required in order to convert the pointer type from a | ||
| 27 | * potential array type to a pointer to a single item of the array. | ||
| 28 | */ | ||
| 29 | #define __verify_pcpu_ptr(ptr) do { \ | ||
| 30 | const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \ | ||
| 31 | (void)__vpp_verify; \ | ||
| 32 | } while (0) | ||
| 33 | |||
| 34 | /* | ||
| 35 | * s390 and alpha modules require percpu variables to be defined as | 56 | * s390 and alpha modules require percpu variables to be defined as |
| 36 | * weak to force the compiler to generate GOT based external | 57 | * weak to force the compiler to generate GOT based external |
| 37 | * references for them. This is necessary because percpu sections | 58 | * references for them. This is necessary because percpu sections |
| @@ -164,4 +185,337 @@ | |||
| 164 | #define EXPORT_PER_CPU_SYMBOL_GPL(var) | 185 | #define EXPORT_PER_CPU_SYMBOL_GPL(var) |
| 165 | #endif | 186 | #endif |
| 166 | 187 | ||
| 188 | /* | ||
| 189 | * Accessors and operations. | ||
| 190 | */ | ||
| 191 | #ifndef __ASSEMBLY__ | ||
| 192 | |||
| 193 | /* | ||
| 194 | * __verify_pcpu_ptr() verifies @ptr is a percpu pointer without evaluating | ||
| 195 | * @ptr and is invoked once before a percpu area is accessed by all | ||
| 196 | * accessors and operations. This is performed in the generic part of | ||
| 197 | * percpu and arch overrides don't need to worry about it; however, if an | ||
| 198 | * arch wants to implement an arch-specific percpu accessor or operation, | ||
| 199 | * it may use __verify_pcpu_ptr() to verify the parameters. | ||
| 200 | * | ||
| 201 | * + 0 is required in order to convert the pointer type from a | ||
| 202 | * potential array type to a pointer to a single item of the array. | ||
| 203 | */ | ||
| 204 | #define __verify_pcpu_ptr(ptr) \ | ||
| 205 | do { \ | ||
| 206 | const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \ | ||
| 207 | (void)__vpp_verify; \ | ||
| 208 | } while (0) | ||
| 209 | |||
| 210 | #ifdef CONFIG_SMP | ||
| 211 | |||
| 212 | /* | ||
| 213 | * Add an offset to a pointer but keep the pointer as-is. Use RELOC_HIDE() | ||
| 214 | * to prevent the compiler from making incorrect assumptions about the | ||
| 215 | * pointer value. The weird cast keeps both GCC and sparse happy. | ||
| 216 | */ | ||
| 217 | #define SHIFT_PERCPU_PTR(__p, __offset) \ | ||
| 218 | RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset)) | ||
| 219 | |||
| 220 | #define per_cpu_ptr(ptr, cpu) \ | ||
| 221 | ({ \ | ||
| 222 | __verify_pcpu_ptr(ptr); \ | ||
| 223 | SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))); \ | ||
| 224 | }) | ||
| 225 | |||
| 226 | #define raw_cpu_ptr(ptr) \ | ||
| 227 | ({ \ | ||
| 228 | __verify_pcpu_ptr(ptr); \ | ||
| 229 | arch_raw_cpu_ptr(ptr); \ | ||
| 230 | }) | ||
| 231 | |||
| 232 | #ifdef CONFIG_DEBUG_PREEMPT | ||
| 233 | #define this_cpu_ptr(ptr) \ | ||
| 234 | ({ \ | ||
| 235 | __verify_pcpu_ptr(ptr); \ | ||
| 236 | SHIFT_PERCPU_PTR(ptr, my_cpu_offset); \ | ||
| 237 | }) | ||
| 238 | #else | ||
| 239 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ||
| 240 | #endif | ||
| 241 | |||
| 242 | #else /* CONFIG_SMP */ | ||
| 243 | |||
| 244 | #define VERIFY_PERCPU_PTR(__p) \ | ||
| 245 | ({ \ | ||
| 246 | __verify_pcpu_ptr(__p); \ | ||
| 247 | (typeof(*(__p)) __kernel __force *)(__p); \ | ||
| 248 | }) | ||
| 249 | |||
| 250 | #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR(ptr); }) | ||
| 251 | #define raw_cpu_ptr(ptr) per_cpu_ptr(ptr, 0) | ||
| 252 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ||
| 253 | |||
| 254 | #endif /* CONFIG_SMP */ | ||
| 255 | |||
| 256 | #define per_cpu(var, cpu) (*per_cpu_ptr(&(var), cpu)) | ||
| 257 | #define __raw_get_cpu_var(var) (*raw_cpu_ptr(&(var))) | ||
| 258 | #define __get_cpu_var(var) (*this_cpu_ptr(&(var))) | ||
| 259 | |||
| 260 | /* keep until we have removed all uses of __this_cpu_ptr */ | ||
| 261 | #define __this_cpu_ptr(ptr) raw_cpu_ptr(ptr) | ||
| 262 | |||
| 263 | /* | ||
| 264 | * Must be an lvalue. Since @var must be a simple identifier, | ||
| 265 | * we force a syntax error here if it isn't. | ||
| 266 | */ | ||
| 267 | #define get_cpu_var(var) \ | ||
| 268 | (*({ \ | ||
| 269 | preempt_disable(); \ | ||
| 270 | this_cpu_ptr(&var); \ | ||
| 271 | })) | ||
| 272 | |||
| 273 | /* | ||
| 274 | * The weird & is necessary because sparse considers (void)(var) to be | ||
| 275 | * a direct dereference of percpu variable (var). | ||
| 276 | */ | ||
| 277 | #define put_cpu_var(var) \ | ||
| 278 | do { \ | ||
| 279 | (void)&(var); \ | ||
| 280 | preempt_enable(); \ | ||
| 281 | } while (0) | ||
| 282 | |||
| 283 | #define get_cpu_ptr(var) \ | ||
| 284 | ({ \ | ||
| 285 | preempt_disable(); \ | ||
| 286 | this_cpu_ptr(var); \ | ||
| 287 | }) | ||
| 288 | |||
| 289 | #define put_cpu_ptr(var) \ | ||
| 290 | do { \ | ||
| 291 | (void)(var); \ | ||
| 292 | preempt_enable(); \ | ||
| 293 | } while (0) | ||
| 294 | |||
| 295 | /* | ||
| 296 | * Branching function to split up a function into a set of functions that | ||
| 297 | * are called for different scalar sizes of the objects handled. | ||
| 298 | */ | ||
| 299 | |||
| 300 | extern void __bad_size_call_parameter(void); | ||
| 301 | |||
| 302 | #ifdef CONFIG_DEBUG_PREEMPT | ||
| 303 | extern void __this_cpu_preempt_check(const char *op); | ||
| 304 | #else | ||
| 305 | static inline void __this_cpu_preempt_check(const char *op) { } | ||
| 306 | #endif | ||
| 307 | |||
| 308 | #define __pcpu_size_call_return(stem, variable) \ | ||
| 309 | ({ \ | ||
| 310 | typeof(variable) pscr_ret__; \ | ||
| 311 | __verify_pcpu_ptr(&(variable)); \ | ||
| 312 | switch(sizeof(variable)) { \ | ||
| 313 | case 1: pscr_ret__ = stem##1(variable); break; \ | ||
| 314 | case 2: pscr_ret__ = stem##2(variable); break; \ | ||
| 315 | case 4: pscr_ret__ = stem##4(variable); break; \ | ||
| 316 | case 8: pscr_ret__ = stem##8(variable); break; \ | ||
| 317 | default: \ | ||
| 318 | __bad_size_call_parameter(); break; \ | ||
| 319 | } \ | ||
| 320 | pscr_ret__; \ | ||
| 321 | }) | ||
| 322 | |||
| 323 | #define __pcpu_size_call_return2(stem, variable, ...) \ | ||
| 324 | ({ \ | ||
| 325 | typeof(variable) pscr2_ret__; \ | ||
| 326 | __verify_pcpu_ptr(&(variable)); \ | ||
| 327 | switch(sizeof(variable)) { \ | ||
| 328 | case 1: pscr2_ret__ = stem##1(variable, __VA_ARGS__); break; \ | ||
| 329 | case 2: pscr2_ret__ = stem##2(variable, __VA_ARGS__); break; \ | ||
| 330 | case 4: pscr2_ret__ = stem##4(variable, __VA_ARGS__); break; \ | ||
| 331 | case 8: pscr2_ret__ = stem##8(variable, __VA_ARGS__); break; \ | ||
| 332 | default: \ | ||
| 333 | __bad_size_call_parameter(); break; \ | ||
| 334 | } \ | ||
| 335 | pscr2_ret__; \ | ||
| 336 | }) | ||
| 337 | |||
| 338 | /* | ||
| 339 | * Special handling for cmpxchg_double. cmpxchg_double is passed two | ||
| 340 | * percpu variables. The first has to be aligned to a double word | ||
| 341 | * boundary and the second has to follow directly thereafter. | ||
| 342 | * We enforce this on all architectures even if they don't support | ||
| 343 | * a double cmpxchg instruction, since it's a cheap requirement, and it | ||
| 344 | * avoids breaking the requirement for architectures with the instruction. | ||
| 345 | */ | ||
| 346 | #define __pcpu_double_call_return_bool(stem, pcp1, pcp2, ...) \ | ||
| 347 | ({ \ | ||
| 348 | bool pdcrb_ret__; \ | ||
| 349 | __verify_pcpu_ptr(&(pcp1)); \ | ||
| 350 | BUILD_BUG_ON(sizeof(pcp1) != sizeof(pcp2)); \ | ||
| 351 | VM_BUG_ON((unsigned long)(&(pcp1)) % (2 * sizeof(pcp1))); \ | ||
| 352 | VM_BUG_ON((unsigned long)(&(pcp2)) != \ | ||
| 353 | (unsigned long)(&(pcp1)) + sizeof(pcp1)); \ | ||
| 354 | switch(sizeof(pcp1)) { \ | ||
| 355 | case 1: pdcrb_ret__ = stem##1(pcp1, pcp2, __VA_ARGS__); break; \ | ||
| 356 | case 2: pdcrb_ret__ = stem##2(pcp1, pcp2, __VA_ARGS__); break; \ | ||
| 357 | case 4: pdcrb_ret__ = stem##4(pcp1, pcp2, __VA_ARGS__); break; \ | ||
| 358 | case 8: pdcrb_ret__ = stem##8(pcp1, pcp2, __VA_ARGS__); break; \ | ||
| 359 | default: \ | ||
| 360 | __bad_size_call_parameter(); break; \ | ||
| 361 | } \ | ||
| 362 | pdcrb_ret__; \ | ||
| 363 | }) | ||
| 364 | |||
| 365 | #define __pcpu_size_call(stem, variable, ...) \ | ||
| 366 | do { \ | ||
| 367 | __verify_pcpu_ptr(&(variable)); \ | ||
| 368 | switch(sizeof(variable)) { \ | ||
| 369 | case 1: stem##1(variable, __VA_ARGS__);break; \ | ||
| 370 | case 2: stem##2(variable, __VA_ARGS__);break; \ | ||
| 371 | case 4: stem##4(variable, __VA_ARGS__);break; \ | ||
| 372 | case 8: stem##8(variable, __VA_ARGS__);break; \ | ||
| 373 | default: \ | ||
| 374 | __bad_size_call_parameter();break; \ | ||
| 375 | } \ | ||
| 376 | } while (0) | ||
| 377 | |||
| 378 | /* | ||
| 379 | * this_cpu operations (C) 2008-2013 Christoph Lameter <cl@linux.com> | ||
| 380 | * | ||
| 381 | * Optimized manipulation for memory allocated through the per cpu | ||
| 382 | * allocator or for addresses of per cpu variables. | ||
| 383 | * | ||
| 384 | * These operation guarantee exclusivity of access for other operations | ||
| 385 | * on the *same* processor. The assumption is that per cpu data is only | ||
| 386 | * accessed by a single processor instance (the current one). | ||
| 387 | * | ||
| 388 | * The arch code can provide optimized implementation by defining macros | ||
| 389 | * for certain scalar sizes. F.e. provide this_cpu_add_2() to provide per | ||
| 390 | * cpu atomic operations for 2 byte sized RMW actions. If arch code does | ||
| 391 | * not provide operations for a scalar size then the fallback in the | ||
| 392 | * generic code will be used. | ||
| 393 | * | ||
| 394 | * cmpxchg_double replaces two adjacent scalars at once. The first two | ||
| 395 | * parameters are per cpu variables which have to be of the same size. A | ||
| 396 | * truth value is returned to indicate success or failure (since a double | ||
| 397 | * register result is difficult to handle). There is very limited hardware | ||
| 398 | * support for these operations, so only certain sizes may work. | ||
| 399 | */ | ||
| 400 | |||
| 401 | /* | ||
| 402 | * Operations for contexts where we do not want to do any checks for | ||
| 403 | * preemptions. Unless strictly necessary, always use [__]this_cpu_*() | ||
| 404 | * instead. | ||
| 405 | * | ||
| 406 | * If there is no other protection through preempt disable and/or disabling | ||
| 407 | * interupts then one of these RMW operations can show unexpected behavior | ||
| 408 | * because the execution thread was rescheduled on another processor or an | ||
| 409 | * interrupt occurred and the same percpu variable was modified from the | ||
| 410 | * interrupt context. | ||
| 411 | */ | ||
| 412 | #define raw_cpu_read(pcp) __pcpu_size_call_return(raw_cpu_read_, pcp) | ||
| 413 | #define raw_cpu_write(pcp, val) __pcpu_size_call(raw_cpu_write_, pcp, val) | ||
| 414 | #define raw_cpu_add(pcp, val) __pcpu_size_call(raw_cpu_add_, pcp, val) | ||
| 415 | #define raw_cpu_and(pcp, val) __pcpu_size_call(raw_cpu_and_, pcp, val) | ||
| 416 | #define raw_cpu_or(pcp, val) __pcpu_size_call(raw_cpu_or_, pcp, val) | ||
| 417 | #define raw_cpu_add_return(pcp, val) __pcpu_size_call_return2(raw_cpu_add_return_, pcp, val) | ||
| 418 | #define raw_cpu_xchg(pcp, nval) __pcpu_size_call_return2(raw_cpu_xchg_, pcp, nval) | ||
| 419 | #define raw_cpu_cmpxchg(pcp, oval, nval) \ | ||
| 420 | __pcpu_size_call_return2(raw_cpu_cmpxchg_, pcp, oval, nval) | ||
| 421 | #define raw_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 422 | __pcpu_double_call_return_bool(raw_cpu_cmpxchg_double_, pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 423 | |||
| 424 | #define raw_cpu_sub(pcp, val) raw_cpu_add(pcp, -(val)) | ||
| 425 | #define raw_cpu_inc(pcp) raw_cpu_add(pcp, 1) | ||
| 426 | #define raw_cpu_dec(pcp) raw_cpu_sub(pcp, 1) | ||
| 427 | #define raw_cpu_sub_return(pcp, val) raw_cpu_add_return(pcp, -(typeof(pcp))(val)) | ||
| 428 | #define raw_cpu_inc_return(pcp) raw_cpu_add_return(pcp, 1) | ||
| 429 | #define raw_cpu_dec_return(pcp) raw_cpu_add_return(pcp, -1) | ||
| 430 | |||
| 431 | /* | ||
| 432 | * Operations for contexts that are safe from preemption/interrupts. These | ||
| 433 | * operations verify that preemption is disabled. | ||
| 434 | */ | ||
| 435 | #define __this_cpu_read(pcp) \ | ||
| 436 | ({ \ | ||
| 437 | __this_cpu_preempt_check("read"); \ | ||
| 438 | raw_cpu_read(pcp); \ | ||
| 439 | }) | ||
| 440 | |||
| 441 | #define __this_cpu_write(pcp, val) \ | ||
| 442 | ({ \ | ||
| 443 | __this_cpu_preempt_check("write"); \ | ||
| 444 | raw_cpu_write(pcp, val); \ | ||
| 445 | }) | ||
| 446 | |||
| 447 | #define __this_cpu_add(pcp, val) \ | ||
| 448 | ({ \ | ||
| 449 | __this_cpu_preempt_check("add"); \ | ||
| 450 | raw_cpu_add(pcp, val); \ | ||
| 451 | }) | ||
| 452 | |||
| 453 | #define __this_cpu_and(pcp, val) \ | ||
| 454 | ({ \ | ||
| 455 | __this_cpu_preempt_check("and"); \ | ||
| 456 | raw_cpu_and(pcp, val); \ | ||
| 457 | }) | ||
| 458 | |||
| 459 | #define __this_cpu_or(pcp, val) \ | ||
| 460 | ({ \ | ||
| 461 | __this_cpu_preempt_check("or"); \ | ||
| 462 | raw_cpu_or(pcp, val); \ | ||
| 463 | }) | ||
| 464 | |||
| 465 | #define __this_cpu_add_return(pcp, val) \ | ||
| 466 | ({ \ | ||
| 467 | __this_cpu_preempt_check("add_return"); \ | ||
| 468 | raw_cpu_add_return(pcp, val); \ | ||
| 469 | }) | ||
| 470 | |||
| 471 | #define __this_cpu_xchg(pcp, nval) \ | ||
| 472 | ({ \ | ||
| 473 | __this_cpu_preempt_check("xchg"); \ | ||
| 474 | raw_cpu_xchg(pcp, nval); \ | ||
| 475 | }) | ||
| 476 | |||
| 477 | #define __this_cpu_cmpxchg(pcp, oval, nval) \ | ||
| 478 | ({ \ | ||
| 479 | __this_cpu_preempt_check("cmpxchg"); \ | ||
| 480 | raw_cpu_cmpxchg(pcp, oval, nval); \ | ||
| 481 | }) | ||
| 482 | |||
| 483 | #define __this_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 484 | ({ __this_cpu_preempt_check("cmpxchg_double"); \ | ||
| 485 | raw_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2); \ | ||
| 486 | }) | ||
| 487 | |||
| 488 | #define __this_cpu_sub(pcp, val) __this_cpu_add(pcp, -(typeof(pcp))(val)) | ||
| 489 | #define __this_cpu_inc(pcp) __this_cpu_add(pcp, 1) | ||
| 490 | #define __this_cpu_dec(pcp) __this_cpu_sub(pcp, 1) | ||
| 491 | #define __this_cpu_sub_return(pcp, val) __this_cpu_add_return(pcp, -(typeof(pcp))(val)) | ||
| 492 | #define __this_cpu_inc_return(pcp) __this_cpu_add_return(pcp, 1) | ||
| 493 | #define __this_cpu_dec_return(pcp) __this_cpu_add_return(pcp, -1) | ||
| 494 | |||
| 495 | /* | ||
| 496 | * Operations with implied preemption protection. These operations can be | ||
| 497 | * used without worrying about preemption. Note that interrupts may still | ||
| 498 | * occur while an operation is in progress and if the interrupt modifies | ||
| 499 | * the variable too then RMW actions may not be reliable. | ||
| 500 | */ | ||
| 501 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp) | ||
| 502 | #define this_cpu_write(pcp, val) __pcpu_size_call(this_cpu_write_, pcp, val) | ||
| 503 | #define this_cpu_add(pcp, val) __pcpu_size_call(this_cpu_add_, pcp, val) | ||
| 504 | #define this_cpu_and(pcp, val) __pcpu_size_call(this_cpu_and_, pcp, val) | ||
| 505 | #define this_cpu_or(pcp, val) __pcpu_size_call(this_cpu_or_, pcp, val) | ||
| 506 | #define this_cpu_add_return(pcp, val) __pcpu_size_call_return2(this_cpu_add_return_, pcp, val) | ||
| 507 | #define this_cpu_xchg(pcp, nval) __pcpu_size_call_return2(this_cpu_xchg_, pcp, nval) | ||
| 508 | #define this_cpu_cmpxchg(pcp, oval, nval) \ | ||
| 509 | __pcpu_size_call_return2(this_cpu_cmpxchg_, pcp, oval, nval) | ||
| 510 | #define this_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 511 | __pcpu_double_call_return_bool(this_cpu_cmpxchg_double_, pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 512 | |||
| 513 | #define this_cpu_sub(pcp, val) this_cpu_add(pcp, -(typeof(pcp))(val)) | ||
| 514 | #define this_cpu_inc(pcp) this_cpu_add(pcp, 1) | ||
| 515 | #define this_cpu_dec(pcp) this_cpu_sub(pcp, 1) | ||
| 516 | #define this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(typeof(pcp))(val)) | ||
| 517 | #define this_cpu_inc_return(pcp) this_cpu_add_return(pcp, 1) | ||
| 518 | #define this_cpu_dec_return(pcp) this_cpu_add_return(pcp, -1) | ||
| 519 | |||
| 520 | #endif /* __ASSEMBLY__ */ | ||
| 167 | #endif /* _LINUX_PERCPU_DEFS_H */ | 521 | #endif /* _LINUX_PERCPU_DEFS_H */ |
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h index 5d8920e23073..3dfbf237cd8f 100644 --- a/include/linux/percpu-refcount.h +++ b/include/linux/percpu-refcount.h | |||
| @@ -57,11 +57,9 @@ struct percpu_ref { | |||
| 57 | atomic_t count; | 57 | atomic_t count; |
| 58 | /* | 58 | /* |
| 59 | * The low bit of the pointer indicates whether the ref is in percpu | 59 | * The low bit of the pointer indicates whether the ref is in percpu |
| 60 | * mode; if set, then get/put will manipulate the atomic_t (this is a | 60 | * mode; if set, then get/put will manipulate the atomic_t. |
| 61 | * hack because we need to keep the pointer around for | ||
| 62 | * percpu_ref_kill_rcu()) | ||
| 63 | */ | 61 | */ |
| 64 | unsigned __percpu *pcpu_count; | 62 | unsigned long pcpu_count_ptr; |
| 65 | percpu_ref_func_t *release; | 63 | percpu_ref_func_t *release; |
| 66 | percpu_ref_func_t *confirm_kill; | 64 | percpu_ref_func_t *confirm_kill; |
| 67 | struct rcu_head rcu; | 65 | struct rcu_head rcu; |
| @@ -69,7 +67,8 @@ struct percpu_ref { | |||
| 69 | 67 | ||
| 70 | int __must_check percpu_ref_init(struct percpu_ref *ref, | 68 | int __must_check percpu_ref_init(struct percpu_ref *ref, |
| 71 | percpu_ref_func_t *release); | 69 | percpu_ref_func_t *release); |
| 72 | void percpu_ref_cancel_init(struct percpu_ref *ref); | 70 | void percpu_ref_reinit(struct percpu_ref *ref); |
| 71 | void percpu_ref_exit(struct percpu_ref *ref); | ||
| 73 | void percpu_ref_kill_and_confirm(struct percpu_ref *ref, | 72 | void percpu_ref_kill_and_confirm(struct percpu_ref *ref, |
| 74 | percpu_ref_func_t *confirm_kill); | 73 | percpu_ref_func_t *confirm_kill); |
| 75 | 74 | ||
| @@ -88,12 +87,28 @@ static inline void percpu_ref_kill(struct percpu_ref *ref) | |||
| 88 | return percpu_ref_kill_and_confirm(ref, NULL); | 87 | return percpu_ref_kill_and_confirm(ref, NULL); |
| 89 | } | 88 | } |
| 90 | 89 | ||
| 91 | #define PCPU_STATUS_BITS 2 | ||
| 92 | #define PCPU_STATUS_MASK ((1 << PCPU_STATUS_BITS) - 1) | ||
| 93 | #define PCPU_REF_PTR 0 | ||
| 94 | #define PCPU_REF_DEAD 1 | 90 | #define PCPU_REF_DEAD 1 |
| 95 | 91 | ||
| 96 | #define REF_STATUS(count) (((unsigned long) count) & PCPU_STATUS_MASK) | 92 | /* |
| 93 | * Internal helper. Don't use outside percpu-refcount proper. The | ||
| 94 | * function doesn't return the pointer and let the caller test it for NULL | ||
| 95 | * because doing so forces the compiler to generate two conditional | ||
| 96 | * branches as it can't assume that @ref->pcpu_count is not NULL. | ||
| 97 | */ | ||
| 98 | static inline bool __pcpu_ref_alive(struct percpu_ref *ref, | ||
| 99 | unsigned __percpu **pcpu_countp) | ||
| 100 | { | ||
| 101 | unsigned long pcpu_ptr = ACCESS_ONCE(ref->pcpu_count_ptr); | ||
| 102 | |||
| 103 | /* paired with smp_store_release() in percpu_ref_reinit() */ | ||
| 104 | smp_read_barrier_depends(); | ||
| 105 | |||
| 106 | if (unlikely(pcpu_ptr & PCPU_REF_DEAD)) | ||
| 107 | return false; | ||
| 108 | |||
| 109 | *pcpu_countp = (unsigned __percpu *)pcpu_ptr; | ||
| 110 | return true; | ||
| 111 | } | ||
| 97 | 112 | ||
| 98 | /** | 113 | /** |
| 99 | * percpu_ref_get - increment a percpu refcount | 114 | * percpu_ref_get - increment a percpu refcount |
| @@ -107,9 +122,7 @@ static inline void percpu_ref_get(struct percpu_ref *ref) | |||
| 107 | 122 | ||
| 108 | rcu_read_lock_sched(); | 123 | rcu_read_lock_sched(); |
| 109 | 124 | ||
| 110 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | 125 | if (__pcpu_ref_alive(ref, &pcpu_count)) |
| 111 | |||
| 112 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) | ||
| 113 | this_cpu_inc(*pcpu_count); | 126 | this_cpu_inc(*pcpu_count); |
| 114 | else | 127 | else |
| 115 | atomic_inc(&ref->count); | 128 | atomic_inc(&ref->count); |
| @@ -133,9 +146,7 @@ static inline bool percpu_ref_tryget(struct percpu_ref *ref) | |||
| 133 | 146 | ||
| 134 | rcu_read_lock_sched(); | 147 | rcu_read_lock_sched(); |
| 135 | 148 | ||
| 136 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | 149 | if (__pcpu_ref_alive(ref, &pcpu_count)) { |
| 137 | |||
| 138 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) { | ||
| 139 | this_cpu_inc(*pcpu_count); | 150 | this_cpu_inc(*pcpu_count); |
| 140 | ret = true; | 151 | ret = true; |
| 141 | } else { | 152 | } else { |
| @@ -168,9 +179,7 @@ static inline bool percpu_ref_tryget_live(struct percpu_ref *ref) | |||
| 168 | 179 | ||
| 169 | rcu_read_lock_sched(); | 180 | rcu_read_lock_sched(); |
| 170 | 181 | ||
| 171 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | 182 | if (__pcpu_ref_alive(ref, &pcpu_count)) { |
| 172 | |||
| 173 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) { | ||
| 174 | this_cpu_inc(*pcpu_count); | 183 | this_cpu_inc(*pcpu_count); |
| 175 | ret = true; | 184 | ret = true; |
| 176 | } | 185 | } |
| @@ -193,9 +202,7 @@ static inline void percpu_ref_put(struct percpu_ref *ref) | |||
| 193 | 202 | ||
| 194 | rcu_read_lock_sched(); | 203 | rcu_read_lock_sched(); |
| 195 | 204 | ||
| 196 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | 205 | if (__pcpu_ref_alive(ref, &pcpu_count)) |
| 197 | |||
| 198 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) | ||
| 199 | this_cpu_dec(*pcpu_count); | 206 | this_cpu_dec(*pcpu_count); |
| 200 | else if (unlikely(atomic_dec_and_test(&ref->count))) | 207 | else if (unlikely(atomic_dec_and_test(&ref->count))) |
| 201 | ref->release(ref); | 208 | ref->release(ref); |
| @@ -203,4 +210,19 @@ static inline void percpu_ref_put(struct percpu_ref *ref) | |||
| 203 | rcu_read_unlock_sched(); | 210 | rcu_read_unlock_sched(); |
| 204 | } | 211 | } |
| 205 | 212 | ||
| 213 | /** | ||
| 214 | * percpu_ref_is_zero - test whether a percpu refcount reached zero | ||
| 215 | * @ref: percpu_ref to test | ||
| 216 | * | ||
| 217 | * Returns %true if @ref reached zero. | ||
| 218 | */ | ||
| 219 | static inline bool percpu_ref_is_zero(struct percpu_ref *ref) | ||
| 220 | { | ||
| 221 | unsigned __percpu *pcpu_count; | ||
| 222 | |||
| 223 | if (__pcpu_ref_alive(ref, &pcpu_count)) | ||
| 224 | return false; | ||
| 225 | return !atomic_read(&ref->count); | ||
| 226 | } | ||
| 227 | |||
| 206 | #endif | 228 | #endif |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 8419053d0f2e..6f61b61b7996 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -23,32 +23,6 @@ | |||
| 23 | PERCPU_MODULE_RESERVE) | 23 | PERCPU_MODULE_RESERVE) |
| 24 | #endif | 24 | #endif |
| 25 | 25 | ||
| 26 | /* | ||
| 27 | * Must be an lvalue. Since @var must be a simple identifier, | ||
| 28 | * we force a syntax error here if it isn't. | ||
| 29 | */ | ||
| 30 | #define get_cpu_var(var) (*({ \ | ||
| 31 | preempt_disable(); \ | ||
| 32 | this_cpu_ptr(&var); })) | ||
| 33 | |||
| 34 | /* | ||
| 35 | * The weird & is necessary because sparse considers (void)(var) to be | ||
| 36 | * a direct dereference of percpu variable (var). | ||
| 37 | */ | ||
| 38 | #define put_cpu_var(var) do { \ | ||
| 39 | (void)&(var); \ | ||
| 40 | preempt_enable(); \ | ||
| 41 | } while (0) | ||
| 42 | |||
| 43 | #define get_cpu_ptr(var) ({ \ | ||
| 44 | preempt_disable(); \ | ||
| 45 | this_cpu_ptr(var); }) | ||
| 46 | |||
| 47 | #define put_cpu_ptr(var) do { \ | ||
| 48 | (void)(var); \ | ||
| 49 | preempt_enable(); \ | ||
| 50 | } while (0) | ||
| 51 | |||
| 52 | /* minimum unit size, also is the maximum supported allocation size */ | 26 | /* minimum unit size, also is the maximum supported allocation size */ |
| 53 | #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(32 << 10) | 27 | #define PCPU_MIN_UNIT_SIZE PFN_ALIGN(32 << 10) |
| 54 | 28 | ||
| @@ -140,17 +114,6 @@ extern int __init pcpu_page_first_chunk(size_t reserved_size, | |||
| 140 | pcpu_fc_populate_pte_fn_t populate_pte_fn); | 114 | pcpu_fc_populate_pte_fn_t populate_pte_fn); |
| 141 | #endif | 115 | #endif |
| 142 | 116 | ||
| 143 | /* | ||
| 144 | * Use this to get to a cpu's version of the per-cpu object | ||
| 145 | * dynamically allocated. Non-atomic access to the current CPU's | ||
| 146 | * version should probably be combined with get_cpu()/put_cpu(). | ||
| 147 | */ | ||
| 148 | #ifdef CONFIG_SMP | ||
| 149 | #define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) | ||
| 150 | #else | ||
| 151 | #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR((ptr)); }) | ||
| 152 | #endif | ||
| 153 | |||
| 154 | extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align); | 117 | extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align); |
| 155 | extern bool is_kernel_percpu_address(unsigned long addr); | 118 | extern bool is_kernel_percpu_address(unsigned long addr); |
| 156 | 119 | ||
| @@ -166,640 +129,4 @@ extern phys_addr_t per_cpu_ptr_to_phys(void *addr); | |||
| 166 | #define alloc_percpu(type) \ | 129 | #define alloc_percpu(type) \ |
| 167 | (typeof(type) __percpu *)__alloc_percpu(sizeof(type), __alignof__(type)) | 130 | (typeof(type) __percpu *)__alloc_percpu(sizeof(type), __alignof__(type)) |
| 168 | 131 | ||
| 169 | /* | ||
| 170 | * Branching function to split up a function into a set of functions that | ||
| 171 | * are called for different scalar sizes of the objects handled. | ||
| 172 | */ | ||
| 173 | |||
| 174 | extern void __bad_size_call_parameter(void); | ||
| 175 | |||
| 176 | #ifdef CONFIG_DEBUG_PREEMPT | ||
| 177 | extern void __this_cpu_preempt_check(const char *op); | ||
| 178 | #else | ||
| 179 | static inline void __this_cpu_preempt_check(const char *op) { } | ||
| 180 | #endif | ||
| 181 | |||
| 182 | #define __pcpu_size_call_return(stem, variable) \ | ||
| 183 | ({ typeof(variable) pscr_ret__; \ | ||
| 184 | __verify_pcpu_ptr(&(variable)); \ | ||
| 185 | switch(sizeof(variable)) { \ | ||
| 186 | case 1: pscr_ret__ = stem##1(variable);break; \ | ||
| 187 | case 2: pscr_ret__ = stem##2(variable);break; \ | ||
| 188 | case 4: pscr_ret__ = stem##4(variable);break; \ | ||
| 189 | case 8: pscr_ret__ = stem##8(variable);break; \ | ||
| 190 | default: \ | ||
| 191 | __bad_size_call_parameter();break; \ | ||
| 192 | } \ | ||
| 193 | pscr_ret__; \ | ||
| 194 | }) | ||
| 195 | |||
| 196 | #define __pcpu_size_call_return2(stem, variable, ...) \ | ||
| 197 | ({ \ | ||
| 198 | typeof(variable) pscr2_ret__; \ | ||
| 199 | __verify_pcpu_ptr(&(variable)); \ | ||
| 200 | switch(sizeof(variable)) { \ | ||
| 201 | case 1: pscr2_ret__ = stem##1(variable, __VA_ARGS__); break; \ | ||
| 202 | case 2: pscr2_ret__ = stem##2(variable, __VA_ARGS__); break; \ | ||
| 203 | case 4: pscr2_ret__ = stem##4(variable, __VA_ARGS__); break; \ | ||
| 204 | case 8: pscr2_ret__ = stem##8(variable, __VA_ARGS__); break; \ | ||
| 205 | default: \ | ||
| 206 | __bad_size_call_parameter(); break; \ | ||
| 207 | } \ | ||
| 208 | pscr2_ret__; \ | ||
| 209 | }) | ||
| 210 | |||
| 211 | /* | ||
| 212 | * Special handling for cmpxchg_double. cmpxchg_double is passed two | ||
| 213 | * percpu variables. The first has to be aligned to a double word | ||
| 214 | * boundary and the second has to follow directly thereafter. | ||
| 215 | * We enforce this on all architectures even if they don't support | ||
| 216 | * a double cmpxchg instruction, since it's a cheap requirement, and it | ||
| 217 | * avoids breaking the requirement for architectures with the instruction. | ||
| 218 | */ | ||
| 219 | #define __pcpu_double_call_return_bool(stem, pcp1, pcp2, ...) \ | ||
| 220 | ({ \ | ||
| 221 | bool pdcrb_ret__; \ | ||
| 222 | __verify_pcpu_ptr(&pcp1); \ | ||
| 223 | BUILD_BUG_ON(sizeof(pcp1) != sizeof(pcp2)); \ | ||
| 224 | VM_BUG_ON((unsigned long)(&pcp1) % (2 * sizeof(pcp1))); \ | ||
| 225 | VM_BUG_ON((unsigned long)(&pcp2) != \ | ||
| 226 | (unsigned long)(&pcp1) + sizeof(pcp1)); \ | ||
| 227 | switch(sizeof(pcp1)) { \ | ||
| 228 | case 1: pdcrb_ret__ = stem##1(pcp1, pcp2, __VA_ARGS__); break; \ | ||
| 229 | case 2: pdcrb_ret__ = stem##2(pcp1, pcp2, __VA_ARGS__); break; \ | ||
| 230 | case 4: pdcrb_ret__ = stem##4(pcp1, pcp2, __VA_ARGS__); break; \ | ||
| 231 | case 8: pdcrb_ret__ = stem##8(pcp1, pcp2, __VA_ARGS__); break; \ | ||
| 232 | default: \ | ||
| 233 | __bad_size_call_parameter(); break; \ | ||
| 234 | } \ | ||
| 235 | pdcrb_ret__; \ | ||
| 236 | }) | ||
| 237 | |||
| 238 | #define __pcpu_size_call(stem, variable, ...) \ | ||
| 239 | do { \ | ||
| 240 | __verify_pcpu_ptr(&(variable)); \ | ||
| 241 | switch(sizeof(variable)) { \ | ||
| 242 | case 1: stem##1(variable, __VA_ARGS__);break; \ | ||
| 243 | case 2: stem##2(variable, __VA_ARGS__);break; \ | ||
| 244 | case 4: stem##4(variable, __VA_ARGS__);break; \ | ||
| 245 | case 8: stem##8(variable, __VA_ARGS__);break; \ | ||
| 246 | default: \ | ||
| 247 | __bad_size_call_parameter();break; \ | ||
| 248 | } \ | ||
| 249 | } while (0) | ||
| 250 | |||
| 251 | /* | ||
| 252 | * this_cpu operations (C) 2008-2013 Christoph Lameter <cl@linux.com> | ||
| 253 | * | ||
| 254 | * Optimized manipulation for memory allocated through the per cpu | ||
| 255 | * allocator or for addresses of per cpu variables. | ||
| 256 | * | ||
| 257 | * These operation guarantee exclusivity of access for other operations | ||
| 258 | * on the *same* processor. The assumption is that per cpu data is only | ||
| 259 | * accessed by a single processor instance (the current one). | ||
| 260 | * | ||
| 261 | * The first group is used for accesses that must be done in a | ||
| 262 | * preemption safe way since we know that the context is not preempt | ||
| 263 | * safe. Interrupts may occur. If the interrupt modifies the variable | ||
| 264 | * too then RMW actions will not be reliable. | ||
| 265 | * | ||
| 266 | * The arch code can provide optimized functions in two ways: | ||
| 267 | * | ||
| 268 | * 1. Override the function completely. F.e. define this_cpu_add(). | ||
| 269 | * The arch must then ensure that the various scalar format passed | ||
| 270 | * are handled correctly. | ||
| 271 | * | ||
| 272 | * 2. Provide functions for certain scalar sizes. F.e. provide | ||
| 273 | * this_cpu_add_2() to provide per cpu atomic operations for 2 byte | ||
| 274 | * sized RMW actions. If arch code does not provide operations for | ||
| 275 | * a scalar size then the fallback in the generic code will be | ||
| 276 | * used. | ||
| 277 | */ | ||
| 278 | |||
| 279 | #define _this_cpu_generic_read(pcp) \ | ||
| 280 | ({ typeof(pcp) ret__; \ | ||
| 281 | preempt_disable(); \ | ||
| 282 | ret__ = *this_cpu_ptr(&(pcp)); \ | ||
| 283 | preempt_enable(); \ | ||
| 284 | ret__; \ | ||
| 285 | }) | ||
| 286 | |||
| 287 | #ifndef this_cpu_read | ||
| 288 | # ifndef this_cpu_read_1 | ||
| 289 | # define this_cpu_read_1(pcp) _this_cpu_generic_read(pcp) | ||
| 290 | # endif | ||
| 291 | # ifndef this_cpu_read_2 | ||
| 292 | # define this_cpu_read_2(pcp) _this_cpu_generic_read(pcp) | ||
| 293 | # endif | ||
| 294 | # ifndef this_cpu_read_4 | ||
| 295 | # define this_cpu_read_4(pcp) _this_cpu_generic_read(pcp) | ||
| 296 | # endif | ||
| 297 | # ifndef this_cpu_read_8 | ||
| 298 | # define this_cpu_read_8(pcp) _this_cpu_generic_read(pcp) | ||
| 299 | # endif | ||
| 300 | # define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, (pcp)) | ||
| 301 | #endif | ||
| 302 | |||
| 303 | #define _this_cpu_generic_to_op(pcp, val, op) \ | ||
| 304 | do { \ | ||
| 305 | unsigned long flags; \ | ||
| 306 | raw_local_irq_save(flags); \ | ||
| 307 | *raw_cpu_ptr(&(pcp)) op val; \ | ||
| 308 | raw_local_irq_restore(flags); \ | ||
| 309 | } while (0) | ||
| 310 | |||
| 311 | #ifndef this_cpu_write | ||
| 312 | # ifndef this_cpu_write_1 | ||
| 313 | # define this_cpu_write_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) | ||
| 314 | # endif | ||
| 315 | # ifndef this_cpu_write_2 | ||
| 316 | # define this_cpu_write_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) | ||
| 317 | # endif | ||
| 318 | # ifndef this_cpu_write_4 | ||
| 319 | # define this_cpu_write_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) | ||
| 320 | # endif | ||
| 321 | # ifndef this_cpu_write_8 | ||
| 322 | # define this_cpu_write_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) | ||
| 323 | # endif | ||
| 324 | # define this_cpu_write(pcp, val) __pcpu_size_call(this_cpu_write_, (pcp), (val)) | ||
| 325 | #endif | ||
| 326 | |||
| 327 | #ifndef this_cpu_add | ||
| 328 | # ifndef this_cpu_add_1 | ||
| 329 | # define this_cpu_add_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) | ||
| 330 | # endif | ||
| 331 | # ifndef this_cpu_add_2 | ||
| 332 | # define this_cpu_add_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) | ||
| 333 | # endif | ||
| 334 | # ifndef this_cpu_add_4 | ||
| 335 | # define this_cpu_add_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) | ||
| 336 | # endif | ||
| 337 | # ifndef this_cpu_add_8 | ||
| 338 | # define this_cpu_add_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) | ||
| 339 | # endif | ||
| 340 | # define this_cpu_add(pcp, val) __pcpu_size_call(this_cpu_add_, (pcp), (val)) | ||
| 341 | #endif | ||
| 342 | |||
| 343 | #ifndef this_cpu_sub | ||
| 344 | # define this_cpu_sub(pcp, val) this_cpu_add((pcp), -(typeof(pcp))(val)) | ||
| 345 | #endif | ||
| 346 | |||
| 347 | #ifndef this_cpu_inc | ||
| 348 | # define this_cpu_inc(pcp) this_cpu_add((pcp), 1) | ||
| 349 | #endif | ||
| 350 | |||
| 351 | #ifndef this_cpu_dec | ||
| 352 | # define this_cpu_dec(pcp) this_cpu_sub((pcp), 1) | ||
| 353 | #endif | ||
| 354 | |||
| 355 | #ifndef this_cpu_and | ||
| 356 | # ifndef this_cpu_and_1 | ||
| 357 | # define this_cpu_and_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) | ||
| 358 | # endif | ||
| 359 | # ifndef this_cpu_and_2 | ||
| 360 | # define this_cpu_and_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) | ||
| 361 | # endif | ||
| 362 | # ifndef this_cpu_and_4 | ||
| 363 | # define this_cpu_and_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) | ||
| 364 | # endif | ||
| 365 | # ifndef this_cpu_and_8 | ||
| 366 | # define this_cpu_and_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) | ||
| 367 | # endif | ||
| 368 | # define this_cpu_and(pcp, val) __pcpu_size_call(this_cpu_and_, (pcp), (val)) | ||
| 369 | #endif | ||
| 370 | |||
| 371 | #ifndef this_cpu_or | ||
| 372 | # ifndef this_cpu_or_1 | ||
| 373 | # define this_cpu_or_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) | ||
| 374 | # endif | ||
| 375 | # ifndef this_cpu_or_2 | ||
| 376 | # define this_cpu_or_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) | ||
| 377 | # endif | ||
| 378 | # ifndef this_cpu_or_4 | ||
| 379 | # define this_cpu_or_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) | ||
| 380 | # endif | ||
| 381 | # ifndef this_cpu_or_8 | ||
| 382 | # define this_cpu_or_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) | ||
| 383 | # endif | ||
| 384 | # define this_cpu_or(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) | ||
| 385 | #endif | ||
| 386 | |||
| 387 | #define _this_cpu_generic_add_return(pcp, val) \ | ||
| 388 | ({ \ | ||
| 389 | typeof(pcp) ret__; \ | ||
| 390 | unsigned long flags; \ | ||
| 391 | raw_local_irq_save(flags); \ | ||
| 392 | raw_cpu_add(pcp, val); \ | ||
| 393 | ret__ = raw_cpu_read(pcp); \ | ||
| 394 | raw_local_irq_restore(flags); \ | ||
| 395 | ret__; \ | ||
| 396 | }) | ||
| 397 | |||
| 398 | #ifndef this_cpu_add_return | ||
| 399 | # ifndef this_cpu_add_return_1 | ||
| 400 | # define this_cpu_add_return_1(pcp, val) _this_cpu_generic_add_return(pcp, val) | ||
| 401 | # endif | ||
| 402 | # ifndef this_cpu_add_return_2 | ||
| 403 | # define this_cpu_add_return_2(pcp, val) _this_cpu_generic_add_return(pcp, val) | ||
| 404 | # endif | ||
| 405 | # ifndef this_cpu_add_return_4 | ||
| 406 | # define this_cpu_add_return_4(pcp, val) _this_cpu_generic_add_return(pcp, val) | ||
| 407 | # endif | ||
| 408 | # ifndef this_cpu_add_return_8 | ||
| 409 | # define this_cpu_add_return_8(pcp, val) _this_cpu_generic_add_return(pcp, val) | ||
| 410 | # endif | ||
| 411 | # define this_cpu_add_return(pcp, val) __pcpu_size_call_return2(this_cpu_add_return_, pcp, val) | ||
| 412 | #endif | ||
| 413 | |||
| 414 | #define this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(typeof(pcp))(val)) | ||
| 415 | #define this_cpu_inc_return(pcp) this_cpu_add_return(pcp, 1) | ||
| 416 | #define this_cpu_dec_return(pcp) this_cpu_add_return(pcp, -1) | ||
| 417 | |||
| 418 | #define _this_cpu_generic_xchg(pcp, nval) \ | ||
| 419 | ({ typeof(pcp) ret__; \ | ||
| 420 | unsigned long flags; \ | ||
| 421 | raw_local_irq_save(flags); \ | ||
| 422 | ret__ = raw_cpu_read(pcp); \ | ||
| 423 | raw_cpu_write(pcp, nval); \ | ||
| 424 | raw_local_irq_restore(flags); \ | ||
| 425 | ret__; \ | ||
| 426 | }) | ||
| 427 | |||
| 428 | #ifndef this_cpu_xchg | ||
| 429 | # ifndef this_cpu_xchg_1 | ||
| 430 | # define this_cpu_xchg_1(pcp, nval) _this_cpu_generic_xchg(pcp, nval) | ||
| 431 | # endif | ||
| 432 | # ifndef this_cpu_xchg_2 | ||
| 433 | # define this_cpu_xchg_2(pcp, nval) _this_cpu_generic_xchg(pcp, nval) | ||
| 434 | # endif | ||
| 435 | # ifndef this_cpu_xchg_4 | ||
| 436 | # define this_cpu_xchg_4(pcp, nval) _this_cpu_generic_xchg(pcp, nval) | ||
| 437 | # endif | ||
| 438 | # ifndef this_cpu_xchg_8 | ||
| 439 | # define this_cpu_xchg_8(pcp, nval) _this_cpu_generic_xchg(pcp, nval) | ||
| 440 | # endif | ||
| 441 | # define this_cpu_xchg(pcp, nval) \ | ||
| 442 | __pcpu_size_call_return2(this_cpu_xchg_, (pcp), nval) | ||
| 443 | #endif | ||
| 444 | |||
| 445 | #define _this_cpu_generic_cmpxchg(pcp, oval, nval) \ | ||
| 446 | ({ \ | ||
| 447 | typeof(pcp) ret__; \ | ||
| 448 | unsigned long flags; \ | ||
| 449 | raw_local_irq_save(flags); \ | ||
| 450 | ret__ = raw_cpu_read(pcp); \ | ||
| 451 | if (ret__ == (oval)) \ | ||
| 452 | raw_cpu_write(pcp, nval); \ | ||
| 453 | raw_local_irq_restore(flags); \ | ||
| 454 | ret__; \ | ||
| 455 | }) | ||
| 456 | |||
| 457 | #ifndef this_cpu_cmpxchg | ||
| 458 | # ifndef this_cpu_cmpxchg_1 | ||
| 459 | # define this_cpu_cmpxchg_1(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 460 | # endif | ||
| 461 | # ifndef this_cpu_cmpxchg_2 | ||
| 462 | # define this_cpu_cmpxchg_2(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 463 | # endif | ||
| 464 | # ifndef this_cpu_cmpxchg_4 | ||
| 465 | # define this_cpu_cmpxchg_4(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 466 | # endif | ||
| 467 | # ifndef this_cpu_cmpxchg_8 | ||
| 468 | # define this_cpu_cmpxchg_8(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 469 | # endif | ||
| 470 | # define this_cpu_cmpxchg(pcp, oval, nval) \ | ||
| 471 | __pcpu_size_call_return2(this_cpu_cmpxchg_, pcp, oval, nval) | ||
| 472 | #endif | ||
| 473 | |||
| 474 | /* | ||
| 475 | * cmpxchg_double replaces two adjacent scalars at once. The first | ||
| 476 | * two parameters are per cpu variables which have to be of the same | ||
| 477 | * size. A truth value is returned to indicate success or failure | ||
| 478 | * (since a double register result is difficult to handle). There is | ||
| 479 | * very limited hardware support for these operations, so only certain | ||
| 480 | * sizes may work. | ||
| 481 | */ | ||
| 482 | #define _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 483 | ({ \ | ||
| 484 | int ret__; \ | ||
| 485 | unsigned long flags; \ | ||
| 486 | raw_local_irq_save(flags); \ | ||
| 487 | ret__ = raw_cpu_generic_cmpxchg_double(pcp1, pcp2, \ | ||
| 488 | oval1, oval2, nval1, nval2); \ | ||
| 489 | raw_local_irq_restore(flags); \ | ||
| 490 | ret__; \ | ||
| 491 | }) | ||
| 492 | |||
| 493 | #ifndef this_cpu_cmpxchg_double | ||
| 494 | # ifndef this_cpu_cmpxchg_double_1 | ||
| 495 | # define this_cpu_cmpxchg_double_1(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 496 | _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 497 | # endif | ||
| 498 | # ifndef this_cpu_cmpxchg_double_2 | ||
| 499 | # define this_cpu_cmpxchg_double_2(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 500 | _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 501 | # endif | ||
| 502 | # ifndef this_cpu_cmpxchg_double_4 | ||
| 503 | # define this_cpu_cmpxchg_double_4(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 504 | _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 505 | # endif | ||
| 506 | # ifndef this_cpu_cmpxchg_double_8 | ||
| 507 | # define this_cpu_cmpxchg_double_8(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 508 | _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 509 | # endif | ||
| 510 | # define this_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 511 | __pcpu_double_call_return_bool(this_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2)) | ||
| 512 | #endif | ||
| 513 | |||
| 514 | /* | ||
| 515 | * Generic percpu operations for contexts where we do not want to do | ||
| 516 | * any checks for preemptiosn. | ||
| 517 | * | ||
| 518 | * If there is no other protection through preempt disable and/or | ||
| 519 | * disabling interupts then one of these RMW operations can show unexpected | ||
| 520 | * behavior because the execution thread was rescheduled on another processor | ||
| 521 | * or an interrupt occurred and the same percpu variable was modified from | ||
| 522 | * the interrupt context. | ||
| 523 | */ | ||
| 524 | #ifndef raw_cpu_read | ||
| 525 | # ifndef raw_cpu_read_1 | ||
| 526 | # define raw_cpu_read_1(pcp) (*raw_cpu_ptr(&(pcp))) | ||
| 527 | # endif | ||
| 528 | # ifndef raw_cpu_read_2 | ||
| 529 | # define raw_cpu_read_2(pcp) (*raw_cpu_ptr(&(pcp))) | ||
| 530 | # endif | ||
| 531 | # ifndef raw_cpu_read_4 | ||
| 532 | # define raw_cpu_read_4(pcp) (*raw_cpu_ptr(&(pcp))) | ||
| 533 | # endif | ||
| 534 | # ifndef raw_cpu_read_8 | ||
| 535 | # define raw_cpu_read_8(pcp) (*raw_cpu_ptr(&(pcp))) | ||
| 536 | # endif | ||
| 537 | # define raw_cpu_read(pcp) __pcpu_size_call_return(raw_cpu_read_, (pcp)) | ||
| 538 | #endif | ||
| 539 | |||
| 540 | #define raw_cpu_generic_to_op(pcp, val, op) \ | ||
| 541 | do { \ | ||
| 542 | *raw_cpu_ptr(&(pcp)) op val; \ | ||
| 543 | } while (0) | ||
| 544 | |||
| 545 | |||
| 546 | #ifndef raw_cpu_write | ||
| 547 | # ifndef raw_cpu_write_1 | ||
| 548 | # define raw_cpu_write_1(pcp, val) raw_cpu_generic_to_op((pcp), (val), =) | ||
| 549 | # endif | ||
| 550 | # ifndef raw_cpu_write_2 | ||
| 551 | # define raw_cpu_write_2(pcp, val) raw_cpu_generic_to_op((pcp), (val), =) | ||
| 552 | # endif | ||
| 553 | # ifndef raw_cpu_write_4 | ||
| 554 | # define raw_cpu_write_4(pcp, val) raw_cpu_generic_to_op((pcp), (val), =) | ||
| 555 | # endif | ||
| 556 | # ifndef raw_cpu_write_8 | ||
| 557 | # define raw_cpu_write_8(pcp, val) raw_cpu_generic_to_op((pcp), (val), =) | ||
| 558 | # endif | ||
| 559 | # define raw_cpu_write(pcp, val) __pcpu_size_call(raw_cpu_write_, (pcp), (val)) | ||
| 560 | #endif | ||
| 561 | |||
| 562 | #ifndef raw_cpu_add | ||
| 563 | # ifndef raw_cpu_add_1 | ||
| 564 | # define raw_cpu_add_1(pcp, val) raw_cpu_generic_to_op((pcp), (val), +=) | ||
| 565 | # endif | ||
| 566 | # ifndef raw_cpu_add_2 | ||
| 567 | # define raw_cpu_add_2(pcp, val) raw_cpu_generic_to_op((pcp), (val), +=) | ||
| 568 | # endif | ||
| 569 | # ifndef raw_cpu_add_4 | ||
| 570 | # define raw_cpu_add_4(pcp, val) raw_cpu_generic_to_op((pcp), (val), +=) | ||
| 571 | # endif | ||
| 572 | # ifndef raw_cpu_add_8 | ||
| 573 | # define raw_cpu_add_8(pcp, val) raw_cpu_generic_to_op((pcp), (val), +=) | ||
| 574 | # endif | ||
| 575 | # define raw_cpu_add(pcp, val) __pcpu_size_call(raw_cpu_add_, (pcp), (val)) | ||
| 576 | #endif | ||
| 577 | |||
| 578 | #ifndef raw_cpu_sub | ||
| 579 | # define raw_cpu_sub(pcp, val) raw_cpu_add((pcp), -(val)) | ||
| 580 | #endif | ||
| 581 | |||
| 582 | #ifndef raw_cpu_inc | ||
| 583 | # define raw_cpu_inc(pcp) raw_cpu_add((pcp), 1) | ||
| 584 | #endif | ||
| 585 | |||
| 586 | #ifndef raw_cpu_dec | ||
| 587 | # define raw_cpu_dec(pcp) raw_cpu_sub((pcp), 1) | ||
| 588 | #endif | ||
| 589 | |||
| 590 | #ifndef raw_cpu_and | ||
| 591 | # ifndef raw_cpu_and_1 | ||
| 592 | # define raw_cpu_and_1(pcp, val) raw_cpu_generic_to_op((pcp), (val), &=) | ||
| 593 | # endif | ||
| 594 | # ifndef raw_cpu_and_2 | ||
| 595 | # define raw_cpu_and_2(pcp, val) raw_cpu_generic_to_op((pcp), (val), &=) | ||
| 596 | # endif | ||
| 597 | # ifndef raw_cpu_and_4 | ||
| 598 | # define raw_cpu_and_4(pcp, val) raw_cpu_generic_to_op((pcp), (val), &=) | ||
| 599 | # endif | ||
| 600 | # ifndef raw_cpu_and_8 | ||
| 601 | # define raw_cpu_and_8(pcp, val) raw_cpu_generic_to_op((pcp), (val), &=) | ||
| 602 | # endif | ||
| 603 | # define raw_cpu_and(pcp, val) __pcpu_size_call(raw_cpu_and_, (pcp), (val)) | ||
| 604 | #endif | ||
| 605 | |||
| 606 | #ifndef raw_cpu_or | ||
| 607 | # ifndef raw_cpu_or_1 | ||
| 608 | # define raw_cpu_or_1(pcp, val) raw_cpu_generic_to_op((pcp), (val), |=) | ||
| 609 | # endif | ||
| 610 | # ifndef raw_cpu_or_2 | ||
| 611 | # define raw_cpu_or_2(pcp, val) raw_cpu_generic_to_op((pcp), (val), |=) | ||
| 612 | # endif | ||
| 613 | # ifndef raw_cpu_or_4 | ||
| 614 | # define raw_cpu_or_4(pcp, val) raw_cpu_generic_to_op((pcp), (val), |=) | ||
| 615 | # endif | ||
| 616 | # ifndef raw_cpu_or_8 | ||
| 617 | # define raw_cpu_or_8(pcp, val) raw_cpu_generic_to_op((pcp), (val), |=) | ||
| 618 | # endif | ||
| 619 | # define raw_cpu_or(pcp, val) __pcpu_size_call(raw_cpu_or_, (pcp), (val)) | ||
| 620 | #endif | ||
| 621 | |||
| 622 | #define raw_cpu_generic_add_return(pcp, val) \ | ||
| 623 | ({ \ | ||
| 624 | raw_cpu_add(pcp, val); \ | ||
| 625 | raw_cpu_read(pcp); \ | ||
| 626 | }) | ||
| 627 | |||
| 628 | #ifndef raw_cpu_add_return | ||
| 629 | # ifndef raw_cpu_add_return_1 | ||
| 630 | # define raw_cpu_add_return_1(pcp, val) raw_cpu_generic_add_return(pcp, val) | ||
| 631 | # endif | ||
| 632 | # ifndef raw_cpu_add_return_2 | ||
| 633 | # define raw_cpu_add_return_2(pcp, val) raw_cpu_generic_add_return(pcp, val) | ||
| 634 | # endif | ||
| 635 | # ifndef raw_cpu_add_return_4 | ||
| 636 | # define raw_cpu_add_return_4(pcp, val) raw_cpu_generic_add_return(pcp, val) | ||
| 637 | # endif | ||
| 638 | # ifndef raw_cpu_add_return_8 | ||
| 639 | # define raw_cpu_add_return_8(pcp, val) raw_cpu_generic_add_return(pcp, val) | ||
| 640 | # endif | ||
| 641 | # define raw_cpu_add_return(pcp, val) \ | ||
| 642 | __pcpu_size_call_return2(raw_cpu_add_return_, pcp, val) | ||
| 643 | #endif | ||
| 644 | |||
| 645 | #define raw_cpu_sub_return(pcp, val) raw_cpu_add_return(pcp, -(typeof(pcp))(val)) | ||
| 646 | #define raw_cpu_inc_return(pcp) raw_cpu_add_return(pcp, 1) | ||
| 647 | #define raw_cpu_dec_return(pcp) raw_cpu_add_return(pcp, -1) | ||
| 648 | |||
| 649 | #define raw_cpu_generic_xchg(pcp, nval) \ | ||
| 650 | ({ typeof(pcp) ret__; \ | ||
| 651 | ret__ = raw_cpu_read(pcp); \ | ||
| 652 | raw_cpu_write(pcp, nval); \ | ||
| 653 | ret__; \ | ||
| 654 | }) | ||
| 655 | |||
| 656 | #ifndef raw_cpu_xchg | ||
| 657 | # ifndef raw_cpu_xchg_1 | ||
| 658 | # define raw_cpu_xchg_1(pcp, nval) raw_cpu_generic_xchg(pcp, nval) | ||
| 659 | # endif | ||
| 660 | # ifndef raw_cpu_xchg_2 | ||
| 661 | # define raw_cpu_xchg_2(pcp, nval) raw_cpu_generic_xchg(pcp, nval) | ||
| 662 | # endif | ||
| 663 | # ifndef raw_cpu_xchg_4 | ||
| 664 | # define raw_cpu_xchg_4(pcp, nval) raw_cpu_generic_xchg(pcp, nval) | ||
| 665 | # endif | ||
| 666 | # ifndef raw_cpu_xchg_8 | ||
| 667 | # define raw_cpu_xchg_8(pcp, nval) raw_cpu_generic_xchg(pcp, nval) | ||
| 668 | # endif | ||
| 669 | # define raw_cpu_xchg(pcp, nval) \ | ||
| 670 | __pcpu_size_call_return2(raw_cpu_xchg_, (pcp), nval) | ||
| 671 | #endif | ||
| 672 | |||
| 673 | #define raw_cpu_generic_cmpxchg(pcp, oval, nval) \ | ||
| 674 | ({ \ | ||
| 675 | typeof(pcp) ret__; \ | ||
| 676 | ret__ = raw_cpu_read(pcp); \ | ||
| 677 | if (ret__ == (oval)) \ | ||
| 678 | raw_cpu_write(pcp, nval); \ | ||
| 679 | ret__; \ | ||
| 680 | }) | ||
| 681 | |||
| 682 | #ifndef raw_cpu_cmpxchg | ||
| 683 | # ifndef raw_cpu_cmpxchg_1 | ||
| 684 | # define raw_cpu_cmpxchg_1(pcp, oval, nval) raw_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 685 | # endif | ||
| 686 | # ifndef raw_cpu_cmpxchg_2 | ||
| 687 | # define raw_cpu_cmpxchg_2(pcp, oval, nval) raw_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 688 | # endif | ||
| 689 | # ifndef raw_cpu_cmpxchg_4 | ||
| 690 | # define raw_cpu_cmpxchg_4(pcp, oval, nval) raw_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 691 | # endif | ||
| 692 | # ifndef raw_cpu_cmpxchg_8 | ||
| 693 | # define raw_cpu_cmpxchg_8(pcp, oval, nval) raw_cpu_generic_cmpxchg(pcp, oval, nval) | ||
| 694 | # endif | ||
| 695 | # define raw_cpu_cmpxchg(pcp, oval, nval) \ | ||
| 696 | __pcpu_size_call_return2(raw_cpu_cmpxchg_, pcp, oval, nval) | ||
| 697 | #endif | ||
| 698 | |||
| 699 | #define raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 700 | ({ \ | ||
| 701 | int __ret = 0; \ | ||
| 702 | if (raw_cpu_read(pcp1) == (oval1) && \ | ||
| 703 | raw_cpu_read(pcp2) == (oval2)) { \ | ||
| 704 | raw_cpu_write(pcp1, (nval1)); \ | ||
| 705 | raw_cpu_write(pcp2, (nval2)); \ | ||
| 706 | __ret = 1; \ | ||
| 707 | } \ | ||
| 708 | (__ret); \ | ||
| 709 | }) | ||
| 710 | |||
| 711 | #ifndef raw_cpu_cmpxchg_double | ||
| 712 | # ifndef raw_cpu_cmpxchg_double_1 | ||
| 713 | # define raw_cpu_cmpxchg_double_1(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 714 | raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 715 | # endif | ||
| 716 | # ifndef raw_cpu_cmpxchg_double_2 | ||
| 717 | # define raw_cpu_cmpxchg_double_2(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 718 | raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 719 | # endif | ||
| 720 | # ifndef raw_cpu_cmpxchg_double_4 | ||
| 721 | # define raw_cpu_cmpxchg_double_4(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 722 | raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 723 | # endif | ||
| 724 | # ifndef raw_cpu_cmpxchg_double_8 | ||
| 725 | # define raw_cpu_cmpxchg_double_8(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 726 | raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) | ||
| 727 | # endif | ||
| 728 | # define raw_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 729 | __pcpu_double_call_return_bool(raw_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2)) | ||
| 730 | #endif | ||
| 731 | |||
| 732 | /* | ||
| 733 | * Generic percpu operations for context that are safe from preemption/interrupts. | ||
| 734 | */ | ||
| 735 | #ifndef __this_cpu_read | ||
| 736 | # define __this_cpu_read(pcp) \ | ||
| 737 | (__this_cpu_preempt_check("read"),__pcpu_size_call_return(raw_cpu_read_, (pcp))) | ||
| 738 | #endif | ||
| 739 | |||
| 740 | #ifndef __this_cpu_write | ||
| 741 | # define __this_cpu_write(pcp, val) \ | ||
| 742 | do { __this_cpu_preempt_check("write"); \ | ||
| 743 | __pcpu_size_call(raw_cpu_write_, (pcp), (val)); \ | ||
| 744 | } while (0) | ||
| 745 | #endif | ||
| 746 | |||
| 747 | #ifndef __this_cpu_add | ||
| 748 | # define __this_cpu_add(pcp, val) \ | ||
| 749 | do { __this_cpu_preempt_check("add"); \ | ||
| 750 | __pcpu_size_call(raw_cpu_add_, (pcp), (val)); \ | ||
| 751 | } while (0) | ||
| 752 | #endif | ||
| 753 | |||
| 754 | #ifndef __this_cpu_sub | ||
| 755 | # define __this_cpu_sub(pcp, val) __this_cpu_add((pcp), -(typeof(pcp))(val)) | ||
| 756 | #endif | ||
| 757 | |||
| 758 | #ifndef __this_cpu_inc | ||
| 759 | # define __this_cpu_inc(pcp) __this_cpu_add((pcp), 1) | ||
| 760 | #endif | ||
| 761 | |||
| 762 | #ifndef __this_cpu_dec | ||
| 763 | # define __this_cpu_dec(pcp) __this_cpu_sub((pcp), 1) | ||
| 764 | #endif | ||
| 765 | |||
| 766 | #ifndef __this_cpu_and | ||
| 767 | # define __this_cpu_and(pcp, val) \ | ||
| 768 | do { __this_cpu_preempt_check("and"); \ | ||
| 769 | __pcpu_size_call(raw_cpu_and_, (pcp), (val)); \ | ||
| 770 | } while (0) | ||
| 771 | |||
| 772 | #endif | ||
| 773 | |||
| 774 | #ifndef __this_cpu_or | ||
| 775 | # define __this_cpu_or(pcp, val) \ | ||
| 776 | do { __this_cpu_preempt_check("or"); \ | ||
| 777 | __pcpu_size_call(raw_cpu_or_, (pcp), (val)); \ | ||
| 778 | } while (0) | ||
| 779 | #endif | ||
| 780 | |||
| 781 | #ifndef __this_cpu_add_return | ||
| 782 | # define __this_cpu_add_return(pcp, val) \ | ||
| 783 | (__this_cpu_preempt_check("add_return"),__pcpu_size_call_return2(raw_cpu_add_return_, pcp, val)) | ||
| 784 | #endif | ||
| 785 | |||
| 786 | #define __this_cpu_sub_return(pcp, val) __this_cpu_add_return(pcp, -(typeof(pcp))(val)) | ||
| 787 | #define __this_cpu_inc_return(pcp) __this_cpu_add_return(pcp, 1) | ||
| 788 | #define __this_cpu_dec_return(pcp) __this_cpu_add_return(pcp, -1) | ||
| 789 | |||
| 790 | #ifndef __this_cpu_xchg | ||
| 791 | # define __this_cpu_xchg(pcp, nval) \ | ||
| 792 | (__this_cpu_preempt_check("xchg"),__pcpu_size_call_return2(raw_cpu_xchg_, (pcp), nval)) | ||
| 793 | #endif | ||
| 794 | |||
| 795 | #ifndef __this_cpu_cmpxchg | ||
| 796 | # define __this_cpu_cmpxchg(pcp, oval, nval) \ | ||
| 797 | (__this_cpu_preempt_check("cmpxchg"),__pcpu_size_call_return2(raw_cpu_cmpxchg_, pcp, oval, nval)) | ||
| 798 | #endif | ||
| 799 | |||
| 800 | #ifndef __this_cpu_cmpxchg_double | ||
| 801 | # define __this_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ | ||
| 802 | (__this_cpu_preempt_check("cmpxchg_double"),__pcpu_double_call_return_bool(raw_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2))) | ||
| 803 | #endif | ||
| 804 | |||
| 805 | #endif /* __LINUX_PERCPU_H */ | 132 | #endif /* __LINUX_PERCPU_H */ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 68041446c450..ed39956b5613 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -545,6 +545,24 @@ struct phy_driver { | |||
| 545 | */ | 545 | */ |
| 546 | void (*link_change_notify)(struct phy_device *dev); | 546 | void (*link_change_notify)(struct phy_device *dev); |
| 547 | 547 | ||
| 548 | /* A function provided by a phy specific driver to override the | ||
| 549 | * the PHY driver framework support for reading a MMD register | ||
| 550 | * from the PHY. If not supported, return -1. This function is | ||
| 551 | * optional for PHY specific drivers, if not provided then the | ||
| 552 | * default MMD read function is used by the PHY framework. | ||
| 553 | */ | ||
| 554 | int (*read_mmd_indirect)(struct phy_device *dev, int ptrad, | ||
| 555 | int devnum, int regnum); | ||
| 556 | |||
| 557 | /* A function provided by a phy specific driver to override the | ||
| 558 | * the PHY driver framework support for writing a MMD register | ||
| 559 | * from the PHY. This function is optional for PHY specific drivers, | ||
| 560 | * if not provided then the default MMD read function is used by | ||
| 561 | * the PHY framework. | ||
| 562 | */ | ||
| 563 | void (*write_mmd_indirect)(struct phy_device *dev, int ptrad, | ||
| 564 | int devnum, int regnum, u32 val); | ||
| 565 | |||
| 548 | struct device_driver driver; | 566 | struct device_driver driver; |
| 549 | }; | 567 | }; |
| 550 | #define to_phy_driver(d) container_of(d, struct phy_driver, driver) | 568 | #define to_phy_driver(d) container_of(d, struct phy_driver, driver) |
diff --git a/include/linux/phy/omap_control_phy.h b/include/linux/phy/omap_control_phy.h index 5450403c7546..e9e6cfbfbb58 100644 --- a/include/linux/phy/omap_control_phy.h +++ b/include/linux/phy/omap_control_phy.h | |||
| @@ -23,6 +23,7 @@ enum omap_control_phy_type { | |||
| 23 | OMAP_CTRL_TYPE_OTGHS = 1, /* Mailbox OTGHS_CONTROL */ | 23 | OMAP_CTRL_TYPE_OTGHS = 1, /* Mailbox OTGHS_CONTROL */ |
| 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_PCIE, /* RX TX control of ACSPCIE */ | ||
| 26 | OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ | 27 | OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ |
| 27 | OMAP_CTRL_TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */ | 28 | OMAP_CTRL_TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */ |
| 28 | }; | 29 | }; |
| @@ -33,6 +34,7 @@ struct omap_control_phy { | |||
| 33 | u32 __iomem *otghs_control; | 34 | u32 __iomem *otghs_control; |
| 34 | u32 __iomem *power; | 35 | u32 __iomem *power; |
| 35 | u32 __iomem *power_aux; | 36 | u32 __iomem *power_aux; |
| 37 | u32 __iomem *pcie_pcs; | ||
| 36 | 38 | ||
| 37 | struct clk *sys_clk; | 39 | struct clk *sys_clk; |
| 38 | 40 | ||
| @@ -63,6 +65,9 @@ enum omap_control_usb_mode { | |||
| 63 | #define OMAP_CTRL_PIPE3_PHY_TX_RX_POWERON 0x3 | 65 | #define OMAP_CTRL_PIPE3_PHY_TX_RX_POWERON 0x3 |
| 64 | #define OMAP_CTRL_PIPE3_PHY_TX_RX_POWEROFF 0x0 | 66 | #define OMAP_CTRL_PIPE3_PHY_TX_RX_POWEROFF 0x0 |
| 65 | 67 | ||
| 68 | #define OMAP_CTRL_PCIE_PCS_MASK 0xff | ||
| 69 | #define OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT 0x8 | ||
| 70 | |||
| 66 | #define OMAP_CTRL_USB2_PHY_PD BIT(28) | 71 | #define OMAP_CTRL_USB2_PHY_PD BIT(28) |
| 67 | 72 | ||
| 68 | #define AM437X_CTRL_USB2_PHY_PD BIT(0) | 73 | #define AM437X_CTRL_USB2_PHY_PD BIT(0) |
| @@ -74,6 +79,7 @@ enum omap_control_usb_mode { | |||
| 74 | void omap_control_phy_power(struct device *dev, int on); | 79 | void omap_control_phy_power(struct device *dev, int on); |
| 75 | void omap_control_usb_set_mode(struct device *dev, | 80 | void omap_control_usb_set_mode(struct device *dev, |
| 76 | enum omap_control_usb_mode mode); | 81 | enum omap_control_usb_mode mode); |
| 82 | void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay); | ||
| 77 | #else | 83 | #else |
| 78 | 84 | ||
| 79 | static inline void omap_control_phy_power(struct device *dev, int on) | 85 | static inline void omap_control_phy_power(struct device *dev, int on) |
| @@ -84,6 +90,10 @@ static inline void omap_control_usb_set_mode(struct device *dev, | |||
| 84 | enum omap_control_usb_mode mode) | 90 | enum omap_control_usb_mode mode) |
| 85 | { | 91 | { |
| 86 | } | 92 | } |
| 93 | |||
| 94 | static inline void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay) | ||
| 95 | { | ||
| 96 | } | ||
| 87 | #endif | 97 | #endif |
| 88 | 98 | ||
| 89 | #endif /* __OMAP_CONTROL_PHY_H__ */ | 99 | #endif /* __OMAP_CONTROL_PHY_H__ */ |
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 2760744cb2a7..8cb6f815475b 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/of.h> | 18 | #include <linux/of.h> |
| 19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
| 20 | #include <linux/pm_runtime.h> | 20 | #include <linux/pm_runtime.h> |
| 21 | #include <linux/regulator/consumer.h> | ||
| 21 | 22 | ||
| 22 | struct phy; | 23 | struct phy; |
| 23 | 24 | ||
| @@ -65,6 +66,7 @@ struct phy { | |||
| 65 | int init_count; | 66 | int init_count; |
| 66 | int power_count; | 67 | int power_count; |
| 67 | struct phy_attrs attrs; | 68 | struct phy_attrs attrs; |
| 69 | struct regulator *pwr; | ||
| 68 | }; | 70 | }; |
| 69 | 71 | ||
| 70 | /** | 72 | /** |
| @@ -156,9 +158,10 @@ void devm_phy_put(struct device *dev, struct phy *phy); | |||
| 156 | struct phy *of_phy_get(struct device_node *np, const char *con_id); | 158 | struct phy *of_phy_get(struct device_node *np, const char *con_id); |
| 157 | struct phy *of_phy_simple_xlate(struct device *dev, | 159 | struct phy *of_phy_simple_xlate(struct device *dev, |
| 158 | struct of_phandle_args *args); | 160 | struct of_phandle_args *args); |
| 159 | struct phy *phy_create(struct device *dev, const struct phy_ops *ops, | 161 | struct phy *phy_create(struct device *dev, struct device_node *node, |
| 160 | struct phy_init_data *init_data); | 162 | const struct phy_ops *ops, |
| 161 | struct phy *devm_phy_create(struct device *dev, | 163 | struct phy_init_data *init_data); |
| 164 | struct phy *devm_phy_create(struct device *dev, struct device_node *node, | ||
| 162 | const struct phy_ops *ops, struct phy_init_data *init_data); | 165 | const struct phy_ops *ops, struct phy_init_data *init_data); |
| 163 | void phy_destroy(struct phy *phy); | 166 | void phy_destroy(struct phy *phy); |
| 164 | void devm_phy_destroy(struct device *dev, struct phy *phy); | 167 | void devm_phy_destroy(struct device *dev, struct phy *phy); |
| @@ -297,13 +300,17 @@ static inline struct phy *of_phy_simple_xlate(struct device *dev, | |||
| 297 | } | 300 | } |
| 298 | 301 | ||
| 299 | static inline struct phy *phy_create(struct device *dev, | 302 | static inline struct phy *phy_create(struct device *dev, |
| 300 | const struct phy_ops *ops, struct phy_init_data *init_data) | 303 | struct device_node *node, |
| 304 | const struct phy_ops *ops, | ||
| 305 | struct phy_init_data *init_data) | ||
| 301 | { | 306 | { |
| 302 | return ERR_PTR(-ENOSYS); | 307 | return ERR_PTR(-ENOSYS); |
| 303 | } | 308 | } |
| 304 | 309 | ||
| 305 | static inline struct phy *devm_phy_create(struct device *dev, | 310 | static inline struct phy *devm_phy_create(struct device *dev, |
| 306 | const struct phy_ops *ops, struct phy_init_data *init_data) | 311 | struct device_node *node, |
| 312 | const struct phy_ops *ops, | ||
| 313 | struct phy_init_data *init_data) | ||
| 307 | { | 314 | { |
| 308 | return ERR_PTR(-ENOSYS); | 315 | return ERR_PTR(-ENOSYS); |
| 309 | } | 316 | } |
diff --git a/include/linux/platform_data/ad7291.h b/include/linux/platform_data/ad7291.h new file mode 100644 index 000000000000..bbd89fa51188 --- /dev/null +++ b/include/linux/platform_data/ad7291.h | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #ifndef __IIO_AD7291_H__ | ||
| 2 | #define __IIO_AD7291_H__ | ||
| 3 | |||
| 4 | /** | ||
| 5 | * struct ad7291_platform_data - AD7291 platform data | ||
| 6 | * @use_external_ref: Whether to use an external or internal reference voltage | ||
| 7 | */ | ||
| 8 | struct ad7291_platform_data { | ||
| 9 | bool use_external_ref; | ||
| 10 | }; | ||
| 11 | |||
| 12 | #endif | ||
diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h index 709c6f7e2f8c..a6591c693ebb 100644 --- a/include/linux/platform_data/asoc-s3c.h +++ b/include/linux/platform_data/asoc-s3c.h | |||
| @@ -15,15 +15,6 @@ | |||
| 15 | #define S3C64XX_AC97_GPE 1 | 15 | #define S3C64XX_AC97_GPE 1 |
| 16 | extern void s3c64xx_ac97_setup_gpio(int); | 16 | extern void s3c64xx_ac97_setup_gpio(int); |
| 17 | 17 | ||
| 18 | /* | ||
| 19 | * The machine init code calls s5p*_spdif_setup_gpio with | ||
| 20 | * one of these defines in order to select appropriate bank | ||
| 21 | * of GPIO for S/PDIF pins | ||
| 22 | */ | ||
| 23 | #define S5PC100_SPDIF_GPD 0 | ||
| 24 | #define S5PC100_SPDIF_GPG3 1 | ||
| 25 | extern void s5pc100_spdif_setup_gpio(int); | ||
| 26 | |||
| 27 | struct samsung_i2s { | 18 | struct samsung_i2s { |
| 28 | /* If the Primary DAI has 5.1 Channels */ | 19 | /* If the Primary DAI has 5.1 Channels */ |
| 29 | #define QUIRK_PRI_6CHAN (1 << 0) | 20 | #define QUIRK_PRI_6CHAN (1 << 0) |
diff --git a/include/linux/platform_data/ata-samsung_cf.h b/include/linux/platform_data/ata-samsung_cf.h index c2049e3d7444..748e71642c4a 100644 --- a/include/linux/platform_data/ata-samsung_cf.h +++ b/include/linux/platform_data/ata-samsung_cf.h | |||
| @@ -29,7 +29,6 @@ extern void s3c_ide_set_platdata(struct s3c_ide_platdata *pdata); | |||
| 29 | 29 | ||
| 30 | /* architecture-specific IDE configuration */ | 30 | /* architecture-specific IDE configuration */ |
| 31 | extern void s3c64xx_ide_setup_gpio(void); | 31 | extern void s3c64xx_ide_setup_gpio(void); |
| 32 | extern void s5pc100_ide_setup_gpio(void); | ||
| 33 | extern void s5pv210_ide_setup_gpio(void); | 32 | extern void s5pv210_ide_setup_gpio(void); |
| 34 | 33 | ||
| 35 | #endif /*__ATA_SAMSUNG_CF_H */ | 34 | #endif /*__ATA_SAMSUNG_CF_H */ |
diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h index bcbc6c3c14c0..d05542aafa3e 100644 --- a/include/linux/platform_data/dma-imx.h +++ b/include/linux/platform_data/dma-imx.h | |||
| @@ -50,6 +50,7 @@ enum imx_dma_prio { | |||
| 50 | 50 | ||
| 51 | struct imx_dma_data { | 51 | struct imx_dma_data { |
| 52 | int dma_request; /* DMA request line */ | 52 | int dma_request; /* DMA request line */ |
| 53 | int dma_request2; /* secondary DMA request line */ | ||
| 53 | enum sdma_peripheral_type peripheral_type; | 54 | enum sdma_peripheral_type peripheral_type; |
| 54 | int priority; | 55 | int priority; |
| 55 | }; | 56 | }; |
diff --git a/include/linux/platform_data/dsp-omap.h b/include/linux/platform_data/dsp-omap.h deleted file mode 100644 index 5927709b1908..000000000000 --- a/include/linux/platform_data/dsp-omap.h +++ /dev/null | |||
| @@ -1,34 +0,0 @@ | |||
| 1 | #ifndef __OMAP_DSP_H__ | ||
| 2 | #define __OMAP_DSP_H__ | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | struct omap_dsp_platform_data { | ||
| 7 | void (*dsp_set_min_opp) (u8 opp_id); | ||
| 8 | u8 (*dsp_get_opp) (void); | ||
| 9 | void (*cpu_set_freq) (unsigned long f); | ||
| 10 | unsigned long (*cpu_get_freq) (void); | ||
| 11 | unsigned long mpu_speed[6]; | ||
| 12 | |||
| 13 | /* functions to write and read PRCM registers */ | ||
| 14 | void (*dsp_prm_write)(u32, s16 , u16); | ||
| 15 | u32 (*dsp_prm_read)(s16 , u16); | ||
| 16 | u32 (*dsp_prm_rmw_bits)(u32, u32, s16, s16); | ||
| 17 | void (*dsp_cm_write)(u32, s16 , u16); | ||
| 18 | u32 (*dsp_cm_read)(s16 , u16); | ||
| 19 | u32 (*dsp_cm_rmw_bits)(u32, u32, s16, s16); | ||
| 20 | |||
| 21 | void (*set_bootaddr)(u32); | ||
| 22 | void (*set_bootmode)(u8); | ||
| 23 | |||
| 24 | phys_addr_t phys_mempool_base; | ||
| 25 | phys_addr_t phys_mempool_size; | ||
| 26 | }; | ||
| 27 | |||
| 28 | #if defined(CONFIG_TIDSPBRIDGE) || defined(CONFIG_TIDSPBRIDGE_MODULE) | ||
| 29 | extern void omap_dsp_reserve_sdram_memblock(void); | ||
| 30 | #else | ||
| 31 | static inline void omap_dsp_reserve_sdram_memblock(void) { } | ||
| 32 | #endif | ||
| 33 | |||
| 34 | #endif | ||
diff --git a/include/linux/platform_data/iommu-omap.h b/include/linux/platform_data/iommu-omap.h index 5b429c43a297..54a0a9582fad 100644 --- a/include/linux/platform_data/iommu-omap.h +++ b/include/linux/platform_data/iommu-omap.h | |||
| @@ -31,14 +31,10 @@ struct omap_iommu_arch_data { | |||
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | * struct omap_mmu_dev_attr - OMAP mmu device attributes for omap_hwmod | 33 | * struct omap_mmu_dev_attr - OMAP mmu device attributes for omap_hwmod |
| 34 | * @da_start: device address where the va space starts. | ||
| 35 | * @da_end: device address where the va space ends. | ||
| 36 | * @nr_tlb_entries: number of entries supported by the translation | 34 | * @nr_tlb_entries: number of entries supported by the translation |
| 37 | * look-aside buffer (TLB). | 35 | * look-aside buffer (TLB). |
| 38 | */ | 36 | */ |
| 39 | struct omap_mmu_dev_attr { | 37 | struct omap_mmu_dev_attr { |
| 40 | u32 da_start; | ||
| 41 | u32 da_end; | ||
| 42 | int nr_tlb_entries; | 38 | int nr_tlb_entries; |
| 43 | }; | 39 | }; |
| 44 | 40 | ||
| @@ -46,8 +42,6 @@ struct iommu_platform_data { | |||
| 46 | const char *name; | 42 | const char *name; |
| 47 | const char *reset_name; | 43 | const char *reset_name; |
| 48 | int nr_tlb_entries; | 44 | int nr_tlb_entries; |
| 49 | u32 da_start; | ||
| 50 | u32 da_end; | ||
| 51 | 45 | ||
| 52 | int (*assert_reset)(struct platform_device *pdev, const char *name); | 46 | int (*assert_reset)(struct platform_device *pdev, const char *name); |
| 53 | int (*deassert_reset)(struct platform_device *pdev, const char *name); | 47 | int (*deassert_reset)(struct platform_device *pdev, const char *name); |
diff --git a/include/linux/platform_data/ntc_thermistor.h b/include/linux/platform_data/ntc_thermistor.h index c7285b575462..0a6de4ca4930 100644 --- a/include/linux/platform_data/ntc_thermistor.h +++ b/include/linux/platform_data/ntc_thermistor.h | |||
| @@ -26,6 +26,7 @@ struct iio_channel; | |||
| 26 | enum ntc_thermistor_type { | 26 | enum ntc_thermistor_type { |
| 27 | TYPE_NCPXXWB473, | 27 | TYPE_NCPXXWB473, |
| 28 | TYPE_NCPXXWL333, | 28 | TYPE_NCPXXWL333, |
| 29 | TYPE_B57330V2103, | ||
| 29 | }; | 30 | }; |
| 30 | 31 | ||
| 31 | struct ntc_thermistor_platform_data { | 32 | struct ntc_thermistor_platform_data { |
diff --git a/include/linux/platform_data/st21nfcb.h b/include/linux/platform_data/st21nfcb.h new file mode 100644 index 000000000000..2d11f1f5efab --- /dev/null +++ b/include/linux/platform_data/st21nfcb.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | /* | ||
| 2 | * Driver include for the ST21NFCB NFC chip. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2014 STMicroelectronics SAS. All rights reserved. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms and conditions of the GNU General Public License, | ||
| 8 | * version 2, as published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef _ST21NFCB_NCI_H_ | ||
| 20 | #define _ST21NFCB_NCI_H_ | ||
| 21 | |||
| 22 | #include <linux/i2c.h> | ||
| 23 | |||
| 24 | #define ST21NFCB_NCI_DRIVER_NAME "st21nfcb_nci" | ||
| 25 | |||
| 26 | struct st21nfcb_nfc_platform_data { | ||
| 27 | unsigned int gpio_irq; | ||
| 28 | unsigned int gpio_reset; | ||
| 29 | unsigned int irq_polarity; | ||
| 30 | }; | ||
| 31 | |||
| 32 | #endif /* _ST21NFCA_HCI_H_ */ | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 16f6654082dd..153d303af7eb 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -28,6 +28,7 @@ struct platform_device { | |||
| 28 | struct resource *resource; | 28 | struct resource *resource; |
| 29 | 29 | ||
| 30 | const struct platform_device_id *id_entry; | 30 | const struct platform_device_id *id_entry; |
| 31 | char *driver_override; /* Driver name to force a match */ | ||
| 31 | 32 | ||
| 32 | /* MFD cell pointer */ | 33 | /* MFD cell pointer */ |
| 33 | struct mfd_cell *mfd_cell; | 34 | struct mfd_cell *mfd_cell; |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 43fd6716f662..367f49b9a1c9 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
| @@ -24,11 +24,20 @@ | |||
| 24 | #define RPM_AUTO 0x08 /* Use autosuspend_delay */ | 24 | #define RPM_AUTO 0x08 /* Use autosuspend_delay */ |
| 25 | 25 | ||
| 26 | #ifdef CONFIG_PM | 26 | #ifdef CONFIG_PM |
| 27 | extern struct workqueue_struct *pm_wq; | ||
| 28 | |||
| 29 | static inline bool queue_pm_work(struct work_struct *work) | ||
| 30 | { | ||
| 31 | return queue_work(pm_wq, work); | ||
| 32 | } | ||
| 33 | |||
| 27 | extern int pm_generic_runtime_suspend(struct device *dev); | 34 | extern int pm_generic_runtime_suspend(struct device *dev); |
| 28 | extern int pm_generic_runtime_resume(struct device *dev); | 35 | extern int pm_generic_runtime_resume(struct device *dev); |
| 29 | extern int pm_runtime_force_suspend(struct device *dev); | 36 | extern int pm_runtime_force_suspend(struct device *dev); |
| 30 | extern int pm_runtime_force_resume(struct device *dev); | 37 | extern int pm_runtime_force_resume(struct device *dev); |
| 31 | #else | 38 | #else |
| 39 | static inline bool queue_pm_work(struct work_struct *work) { return false; } | ||
| 40 | |||
| 32 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | 41 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } |
| 33 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | 42 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } |
| 34 | static inline int pm_runtime_force_suspend(struct device *dev) { return 0; } | 43 | static inline int pm_runtime_force_suspend(struct device *dev) { return 0; } |
| @@ -37,8 +46,6 @@ static inline int pm_runtime_force_resume(struct device *dev) { return 0; } | |||
| 37 | 46 | ||
| 38 | #ifdef CONFIG_PM_RUNTIME | 47 | #ifdef CONFIG_PM_RUNTIME |
| 39 | 48 | ||
| 40 | extern struct workqueue_struct *pm_wq; | ||
| 41 | |||
| 42 | extern int __pm_runtime_idle(struct device *dev, int rpmflags); | 49 | extern int __pm_runtime_idle(struct device *dev, int rpmflags); |
| 43 | extern int __pm_runtime_suspend(struct device *dev, int rpmflags); | 50 | extern int __pm_runtime_suspend(struct device *dev, int rpmflags); |
| 44 | extern int __pm_runtime_resume(struct device *dev, int rpmflags); | 51 | extern int __pm_runtime_resume(struct device *dev, int rpmflags); |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index f2b76aeaf4e4..f3dea41dbcd2 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
| @@ -120,6 +120,7 @@ enum power_supply_property { | |||
| 120 | POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX, | 120 | POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX, |
| 121 | POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT, | 121 | POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT, |
| 122 | POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX, | 122 | POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX, |
| 123 | POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, | ||
| 123 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, | 124 | POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, |
| 124 | POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, | 125 | POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, |
| 125 | POWER_SUPPLY_PROP_ENERGY_FULL, | 126 | POWER_SUPPLY_PROP_ENERGY_FULL, |
| @@ -131,6 +132,8 @@ enum power_supply_property { | |||
| 131 | POWER_SUPPLY_PROP_CAPACITY_ALERT_MAX, /* in percents! */ | 132 | POWER_SUPPLY_PROP_CAPACITY_ALERT_MAX, /* in percents! */ |
| 132 | POWER_SUPPLY_PROP_CAPACITY_LEVEL, | 133 | POWER_SUPPLY_PROP_CAPACITY_LEVEL, |
| 133 | POWER_SUPPLY_PROP_TEMP, | 134 | POWER_SUPPLY_PROP_TEMP, |
| 135 | POWER_SUPPLY_PROP_TEMP_MAX, | ||
| 136 | POWER_SUPPLY_PROP_TEMP_MIN, | ||
| 134 | POWER_SUPPLY_PROP_TEMP_ALERT_MIN, | 137 | POWER_SUPPLY_PROP_TEMP_ALERT_MIN, |
| 135 | POWER_SUPPLY_PROP_TEMP_ALERT_MAX, | 138 | POWER_SUPPLY_PROP_TEMP_ALERT_MAX, |
| 136 | POWER_SUPPLY_PROP_TEMP_AMBIENT, | 139 | POWER_SUPPLY_PROP_TEMP_AMBIENT, |
| @@ -142,6 +145,7 @@ enum power_supply_property { | |||
| 142 | POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, | 145 | POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, |
| 143 | POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */ | 146 | POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */ |
| 144 | POWER_SUPPLY_PROP_SCOPE, | 147 | POWER_SUPPLY_PROP_SCOPE, |
| 148 | POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT, | ||
| 145 | /* Properties of type `const char *' */ | 149 | /* Properties of type `const char *' */ |
| 146 | POWER_SUPPLY_PROP_MODEL_NAME, | 150 | POWER_SUPPLY_PROP_MODEL_NAME, |
| 147 | POWER_SUPPLY_PROP_MANUFACTURER, | 151 | POWER_SUPPLY_PROP_MANUFACTURER, |
diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h index 7dfed71d76a6..159c987b1853 100644 --- a/include/linux/ptp_classify.h +++ b/include/linux/ptp_classify.h | |||
| @@ -33,8 +33,8 @@ | |||
| 33 | #define PTP_CLASS_IPV4 0x10 /* event in an IPV4 UDP packet */ | 33 | #define PTP_CLASS_IPV4 0x10 /* event in an IPV4 UDP packet */ |
| 34 | #define PTP_CLASS_IPV6 0x20 /* event in an IPV6 UDP packet */ | 34 | #define PTP_CLASS_IPV6 0x20 /* event in an IPV6 UDP packet */ |
| 35 | #define PTP_CLASS_L2 0x30 /* event in a L2 packet */ | 35 | #define PTP_CLASS_L2 0x30 /* event in a L2 packet */ |
| 36 | #define PTP_CLASS_VLAN 0x40 /* event in a VLAN tagged L2 packet */ | 36 | #define PTP_CLASS_PMASK 0x30 /* mask for the packet type field */ |
| 37 | #define PTP_CLASS_PMASK 0xf0 /* mask for the packet type field */ | 37 | #define PTP_CLASS_VLAN 0x40 /* event in a VLAN tagged packet */ |
| 38 | 38 | ||
| 39 | #define PTP_CLASS_V1_IPV4 (PTP_CLASS_V1 | PTP_CLASS_IPV4) | 39 | #define PTP_CLASS_V1_IPV4 (PTP_CLASS_V1 | PTP_CLASS_IPV4) |
| 40 | #define PTP_CLASS_V1_IPV6 (PTP_CLASS_V1 | PTP_CLASS_IPV6) /* probably DNE */ | 40 | #define PTP_CLASS_V1_IPV6 (PTP_CLASS_V1 | PTP_CLASS_IPV6) /* probably DNE */ |
| @@ -54,7 +54,6 @@ | |||
| 54 | #define IP6_HLEN 40 | 54 | #define IP6_HLEN 40 |
| 55 | #define UDP_HLEN 8 | 55 | #define UDP_HLEN 8 |
| 56 | #define OFF_IHL 14 | 56 | #define OFF_IHL 14 |
| 57 | #define OFF_PTP6 (ETH_HLEN + IP6_HLEN + UDP_HLEN) | ||
| 58 | #define IPV4_HLEN(data) (((struct iphdr *)(data + OFF_IHL))->ihl << 2) | 57 | #define IPV4_HLEN(data) (((struct iphdr *)(data + OFF_IHL))->ihl << 2) |
| 59 | 58 | ||
| 60 | #if defined(CONFIG_NET_PTP_CLASSIFY) | 59 | #if defined(CONFIG_NET_PTP_CLASSIFY) |
diff --git a/include/linux/ras.h b/include/linux/ras.h new file mode 100644 index 000000000000..2aceeafd6fe5 --- /dev/null +++ b/include/linux/ras.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #ifndef __RAS_H__ | ||
| 2 | #define __RAS_H__ | ||
| 3 | |||
| 4 | #ifdef CONFIG_DEBUG_FS | ||
| 5 | int ras_userspace_consumers(void); | ||
| 6 | void ras_debugfs_init(void); | ||
| 7 | int ras_add_daemon_trace(void); | ||
| 8 | #else | ||
| 9 | static inline int ras_userspace_consumers(void) { return 0; } | ||
| 10 | static inline void ras_debugfs_init(void) { return; } | ||
| 11 | static inline int ras_add_daemon_trace(void) { return 0; } | ||
| 12 | #endif | ||
| 13 | |||
| 14 | #endif | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 6a94cc8b1ca0..d231aa17b1d7 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -826,15 +826,14 @@ static inline void rcu_preempt_sleep_check(void) | |||
| 826 | * read-side critical section that would block in a !PREEMPT kernel. | 826 | * read-side critical section that would block in a !PREEMPT kernel. |
| 827 | * But if you want the full story, read on! | 827 | * But if you want the full story, read on! |
| 828 | * | 828 | * |
| 829 | * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU), it | 829 | * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU), |
| 830 | * is illegal to block while in an RCU read-side critical section. In | 830 | * it is illegal to block while in an RCU read-side critical section. |
| 831 | * preemptible RCU implementations (TREE_PREEMPT_RCU and TINY_PREEMPT_RCU) | 831 | * In preemptible RCU implementations (TREE_PREEMPT_RCU) in CONFIG_PREEMPT |
| 832 | * in CONFIG_PREEMPT kernel builds, RCU read-side critical sections may | 832 | * kernel builds, RCU read-side critical sections may be preempted, |
| 833 | * be preempted, but explicit blocking is illegal. Finally, in preemptible | 833 | * but explicit blocking is illegal. Finally, in preemptible RCU |
| 834 | * RCU implementations in real-time (with -rt patchset) kernel builds, | 834 | * implementations in real-time (with -rt patchset) kernel builds, RCU |
| 835 | * RCU read-side critical sections may be preempted and they may also | 835 | * read-side critical sections may be preempted and they may also block, but |
| 836 | * block, but only when acquiring spinlocks that are subject to priority | 836 | * only when acquiring spinlocks that are subject to priority inheritance. |
| 837 | * inheritance. | ||
| 838 | */ | 837 | */ |
| 839 | static inline void rcu_read_lock(void) | 838 | static inline void rcu_read_lock(void) |
| 840 | { | 839 | { |
| @@ -858,6 +857,34 @@ static inline void rcu_read_lock(void) | |||
| 858 | /** | 857 | /** |
| 859 | * rcu_read_unlock() - marks the end of an RCU read-side critical section. | 858 | * rcu_read_unlock() - marks the end of an RCU read-side critical section. |
| 860 | * | 859 | * |
| 860 | * In most situations, rcu_read_unlock() is immune from deadlock. | ||
| 861 | * However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock() | ||
| 862 | * is responsible for deboosting, which it does via rt_mutex_unlock(). | ||
| 863 | * Unfortunately, this function acquires the scheduler's runqueue and | ||
| 864 | * priority-inheritance spinlocks. This means that deadlock could result | ||
| 865 | * if the caller of rcu_read_unlock() already holds one of these locks or | ||
| 866 | * any lock that is ever acquired while holding them. | ||
| 867 | * | ||
| 868 | * That said, RCU readers are never priority boosted unless they were | ||
| 869 | * preempted. Therefore, one way to avoid deadlock is to make sure | ||
| 870 | * that preemption never happens within any RCU read-side critical | ||
| 871 | * section whose outermost rcu_read_unlock() is called with one of | ||
| 872 | * rt_mutex_unlock()'s locks held. Such preemption can be avoided in | ||
| 873 | * a number of ways, for example, by invoking preempt_disable() before | ||
| 874 | * critical section's outermost rcu_read_lock(). | ||
| 875 | * | ||
| 876 | * Given that the set of locks acquired by rt_mutex_unlock() might change | ||
| 877 | * at any time, a somewhat more future-proofed approach is to make sure | ||
| 878 | * that that preemption never happens within any RCU read-side critical | ||
| 879 | * section whose outermost rcu_read_unlock() is called with irqs disabled. | ||
| 880 | * This approach relies on the fact that rt_mutex_unlock() currently only | ||
| 881 | * acquires irq-disabled locks. | ||
| 882 | * | ||
| 883 | * The second of these two approaches is best in most situations, | ||
| 884 | * however, the first approach can also be useful, at least to those | ||
| 885 | * developers willing to keep abreast of the set of locks acquired by | ||
| 886 | * rt_mutex_unlock(). | ||
| 887 | * | ||
| 861 | * See rcu_read_lock() for more information. | 888 | * See rcu_read_lock() for more information. |
| 862 | */ | 889 | */ |
| 863 | static inline void rcu_read_unlock(void) | 890 | static inline void rcu_read_unlock(void) |
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 7b0e4b425cdf..c5ed83f49c4e 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
| @@ -396,6 +396,7 @@ void regmap_exit(struct regmap *map); | |||
| 396 | int regmap_reinit_cache(struct regmap *map, | 396 | int regmap_reinit_cache(struct regmap *map, |
| 397 | const struct regmap_config *config); | 397 | const struct regmap_config *config); |
| 398 | struct regmap *dev_get_regmap(struct device *dev, const char *name); | 398 | struct regmap *dev_get_regmap(struct device *dev, const char *name); |
| 399 | struct device *regmap_get_device(struct regmap *map); | ||
| 399 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); | 400 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val); |
| 400 | int regmap_write_async(struct regmap *map, unsigned int reg, unsigned int val); | 401 | int regmap_write_async(struct regmap *map, unsigned int reg, unsigned int val); |
| 401 | int regmap_raw_write(struct regmap *map, unsigned int reg, | 402 | int regmap_raw_write(struct regmap *map, unsigned int reg, |
| @@ -729,6 +730,12 @@ static inline struct regmap *dev_get_regmap(struct device *dev, | |||
| 729 | return NULL; | 730 | return NULL; |
| 730 | } | 731 | } |
| 731 | 732 | ||
| 733 | static inline struct device *regmap_get_device(struct regmap *map) | ||
| 734 | { | ||
| 735 | WARN_ONCE(1, "regmap API is disabled"); | ||
| 736 | return NULL; | ||
| 737 | } | ||
| 738 | |||
| 732 | #endif | 739 | #endif |
| 733 | 740 | ||
| 734 | #endif | 741 | #endif |
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h index 75307447cef9..d8ecefaf63ca 100644 --- a/include/linux/regulator/ab8500.h +++ b/include/linux/regulator/ab8500.h | |||
| @@ -322,18 +322,4 @@ struct ab8500_regulator_platform_data { | |||
| 322 | struct regulator_init_data *ext_regulator; | 322 | struct regulator_init_data *ext_regulator; |
| 323 | }; | 323 | }; |
| 324 | 324 | ||
| 325 | #ifdef CONFIG_REGULATOR_AB8500_DEBUG | ||
| 326 | int ab8500_regulator_debug_init(struct platform_device *pdev); | ||
| 327 | int ab8500_regulator_debug_exit(struct platform_device *pdev); | ||
| 328 | #else | ||
| 329 | static inline int ab8500_regulator_debug_init(struct platform_device *pdev) | ||
| 330 | { | ||
| 331 | return 0; | ||
| 332 | } | ||
| 333 | static inline int ab8500_regulator_debug_exit(struct platform_device *pdev) | ||
| 334 | { | ||
| 335 | return 0; | ||
| 336 | } | ||
| 337 | #endif | ||
| 338 | |||
| 339 | #endif | 325 | #endif |
diff --git a/include/linux/regulator/act8865.h b/include/linux/regulator/act8865.h index 49206c1b4905..b6c4909b33af 100644 --- a/include/linux/regulator/act8865.h +++ b/include/linux/regulator/act8865.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * act8865.h -- Voltage regulation for the active-semi act8865 | 2 | * act8865.h -- Voltage regulation for active-semi act88xx PMUs |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2013 Atmel Corporation. | 4 | * Copyright (C) 2013 Atmel Corporation. |
| 5 | * | 5 | * |
| @@ -29,6 +29,27 @@ enum { | |||
| 29 | ACT8865_REG_NUM, | 29 | ACT8865_REG_NUM, |
| 30 | }; | 30 | }; |
| 31 | 31 | ||
| 32 | enum { | ||
| 33 | ACT8846_ID_REG1, | ||
| 34 | ACT8846_ID_REG2, | ||
| 35 | ACT8846_ID_REG3, | ||
| 36 | ACT8846_ID_REG4, | ||
| 37 | ACT8846_ID_REG5, | ||
| 38 | ACT8846_ID_REG6, | ||
| 39 | ACT8846_ID_REG7, | ||
| 40 | ACT8846_ID_REG8, | ||
| 41 | ACT8846_ID_REG9, | ||
| 42 | ACT8846_ID_REG10, | ||
| 43 | ACT8846_ID_REG11, | ||
| 44 | ACT8846_ID_REG12, | ||
| 45 | ACT8846_REG_NUM, | ||
| 46 | }; | ||
| 47 | |||
| 48 | enum { | ||
| 49 | ACT8865, | ||
| 50 | ACT8846, | ||
| 51 | }; | ||
| 52 | |||
| 32 | /** | 53 | /** |
| 33 | * act8865_regulator_data - regulator data | 54 | * act8865_regulator_data - regulator data |
| 34 | * @id: regulator id | 55 | * @id: regulator id |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 14ec18d5e18b..f8a8733068a7 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | 37 | ||
| 38 | struct device; | 38 | struct device; |
| 39 | struct notifier_block; | 39 | struct notifier_block; |
| 40 | struct regmap; | ||
| 40 | 41 | ||
| 41 | /* | 42 | /* |
| 42 | * Regulator operating modes. | 43 | * Regulator operating modes. |
| @@ -215,6 +216,13 @@ int regulator_set_optimum_mode(struct regulator *regulator, int load_uA); | |||
| 215 | 216 | ||
| 216 | int regulator_allow_bypass(struct regulator *regulator, bool allow); | 217 | int regulator_allow_bypass(struct regulator *regulator, bool allow); |
| 217 | 218 | ||
| 219 | struct regmap *regulator_get_regmap(struct regulator *regulator); | ||
| 220 | int regulator_get_hardware_vsel_register(struct regulator *regulator, | ||
| 221 | unsigned *vsel_reg, | ||
| 222 | unsigned *vsel_mask); | ||
| 223 | int regulator_list_hardware_vsel(struct regulator *regulator, | ||
| 224 | unsigned selector); | ||
| 225 | |||
| 218 | /* regulator notifier block */ | 226 | /* regulator notifier block */ |
| 219 | int regulator_register_notifier(struct regulator *regulator, | 227 | int regulator_register_notifier(struct regulator *regulator, |
| 220 | struct notifier_block *nb); | 228 | struct notifier_block *nb); |
| @@ -457,6 +465,24 @@ static inline int regulator_allow_bypass(struct regulator *regulator, | |||
| 457 | return 0; | 465 | return 0; |
| 458 | } | 466 | } |
| 459 | 467 | ||
| 468 | static inline struct regmap *regulator_get_regmap(struct regulator *regulator) | ||
| 469 | { | ||
| 470 | return ERR_PTR(-EOPNOTSUPP); | ||
| 471 | } | ||
| 472 | |||
| 473 | static inline int regulator_get_hardware_vsel_register(struct regulator *regulator, | ||
| 474 | unsigned *vsel_reg, | ||
| 475 | unsigned *vsel_mask) | ||
| 476 | { | ||
| 477 | return -EOPNOTSUPP; | ||
| 478 | } | ||
| 479 | |||
| 480 | static inline int regulator_list_hardware_vsel(struct regulator *regulator, | ||
| 481 | unsigned selector) | ||
| 482 | { | ||
| 483 | return -EOPNOTSUPP; | ||
| 484 | } | ||
| 485 | |||
| 460 | static inline int regulator_register_notifier(struct regulator *regulator, | 486 | static inline int regulator_register_notifier(struct regulator *regulator, |
| 461 | struct notifier_block *nb) | 487 | struct notifier_block *nb) |
| 462 | { | 488 | { |
diff --git a/include/linux/regulator/da9211.h b/include/linux/regulator/da9211.h new file mode 100644 index 000000000000..0981ce0e72cc --- /dev/null +++ b/include/linux/regulator/da9211.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | /* | ||
| 2 | * da9211.h - Regulator device driver for DA9211 | ||
| 3 | * Copyright (C) 2014 Dialog Semiconductor Ltd. | ||
| 4 | * | ||
| 5 | * This library is free software; you can redistribute it and/or | ||
| 6 | * modify it under the terms of the GNU Library General Public | ||
| 7 | * License as published by the Free Software Foundation; either | ||
| 8 | * version 2 of the License, or (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This library 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 GNU | ||
| 13 | * Library General Public License for more details. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef __LINUX_REGULATOR_DA9211_H | ||
| 17 | #define __LINUX_REGULATOR_DA9211_H | ||
| 18 | |||
| 19 | #include <linux/regulator/machine.h> | ||
| 20 | |||
| 21 | #define DA9211_MAX_REGULATORS 2 | ||
| 22 | |||
| 23 | struct da9211_pdata { | ||
| 24 | /* | ||
| 25 | * Number of buck | ||
| 26 | * 1 : 4 phase 1 buck | ||
| 27 | * 2 : 2 phase 2 buck | ||
| 28 | */ | ||
| 29 | int num_buck; | ||
| 30 | struct regulator_init_data *init_data; | ||
| 31 | }; | ||
| 32 | #endif | ||
diff --git a/include/linux/reservation.h b/include/linux/reservation.h index 813dae960ebd..5a0b64cf68b4 100644 --- a/include/linux/reservation.h +++ b/include/linux/reservation.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | * Copyright (C) 2012 Texas Instruments | 6 | * Copyright (C) 2012 Texas Instruments |
| 7 | * | 7 | * |
| 8 | * Authors: | 8 | * Authors: |
| 9 | * Rob Clark <rob.clark@linaro.org> | 9 | * Rob Clark <robdclark@gmail.com> |
| 10 | * Maarten Lankhorst <maarten.lankhorst@canonical.com> | 10 | * Maarten Lankhorst <maarten.lankhorst@canonical.com> |
| 11 | * Thomas Hellstrom <thellstrom-at-vmware-dot-com> | 11 | * Thomas Hellstrom <thellstrom-at-vmware-dot-com> |
| 12 | * | 12 | * |
| @@ -40,23 +40,103 @@ | |||
| 40 | #define _LINUX_RESERVATION_H | 40 | #define _LINUX_RESERVATION_H |
| 41 | 41 | ||
| 42 | #include <linux/ww_mutex.h> | 42 | #include <linux/ww_mutex.h> |
| 43 | #include <linux/fence.h> | ||
| 44 | #include <linux/slab.h> | ||
| 45 | #include <linux/seqlock.h> | ||
| 46 | #include <linux/rcupdate.h> | ||
| 43 | 47 | ||
| 44 | extern struct ww_class reservation_ww_class; | 48 | extern struct ww_class reservation_ww_class; |
| 49 | extern struct lock_class_key reservation_seqcount_class; | ||
| 50 | extern const char reservation_seqcount_string[]; | ||
| 51 | |||
| 52 | struct reservation_object_list { | ||
| 53 | struct rcu_head rcu; | ||
| 54 | u32 shared_count, shared_max; | ||
| 55 | struct fence __rcu *shared[]; | ||
| 56 | }; | ||
| 45 | 57 | ||
| 46 | struct reservation_object { | 58 | struct reservation_object { |
| 47 | struct ww_mutex lock; | 59 | struct ww_mutex lock; |
| 60 | seqcount_t seq; | ||
| 61 | |||
| 62 | struct fence __rcu *fence_excl; | ||
| 63 | struct reservation_object_list __rcu *fence; | ||
| 64 | struct reservation_object_list *staged; | ||
| 48 | }; | 65 | }; |
| 49 | 66 | ||
| 67 | #define reservation_object_held(obj) lockdep_is_held(&(obj)->lock.base) | ||
| 68 | #define reservation_object_assert_held(obj) \ | ||
| 69 | lockdep_assert_held(&(obj)->lock.base) | ||
| 70 | |||
| 50 | static inline void | 71 | static inline void |
| 51 | reservation_object_init(struct reservation_object *obj) | 72 | reservation_object_init(struct reservation_object *obj) |
| 52 | { | 73 | { |
| 53 | ww_mutex_init(&obj->lock, &reservation_ww_class); | 74 | ww_mutex_init(&obj->lock, &reservation_ww_class); |
| 75 | |||
| 76 | __seqcount_init(&obj->seq, reservation_seqcount_string, &reservation_seqcount_class); | ||
| 77 | RCU_INIT_POINTER(obj->fence, NULL); | ||
| 78 | RCU_INIT_POINTER(obj->fence_excl, NULL); | ||
| 79 | obj->staged = NULL; | ||
| 54 | } | 80 | } |
| 55 | 81 | ||
| 56 | static inline void | 82 | static inline void |
| 57 | reservation_object_fini(struct reservation_object *obj) | 83 | reservation_object_fini(struct reservation_object *obj) |
| 58 | { | 84 | { |
| 85 | int i; | ||
| 86 | struct reservation_object_list *fobj; | ||
| 87 | struct fence *excl; | ||
| 88 | |||
| 89 | /* | ||
| 90 | * This object should be dead and all references must have | ||
| 91 | * been released to it, so no need to be protected with rcu. | ||
| 92 | */ | ||
| 93 | excl = rcu_dereference_protected(obj->fence_excl, 1); | ||
| 94 | if (excl) | ||
| 95 | fence_put(excl); | ||
| 96 | |||
| 97 | fobj = rcu_dereference_protected(obj->fence, 1); | ||
| 98 | if (fobj) { | ||
| 99 | for (i = 0; i < fobj->shared_count; ++i) | ||
| 100 | fence_put(rcu_dereference_protected(fobj->shared[i], 1)); | ||
| 101 | |||
| 102 | kfree(fobj); | ||
| 103 | } | ||
| 104 | kfree(obj->staged); | ||
| 105 | |||
| 59 | ww_mutex_destroy(&obj->lock); | 106 | ww_mutex_destroy(&obj->lock); |
| 60 | } | 107 | } |
| 61 | 108 | ||
| 109 | static inline struct reservation_object_list * | ||
| 110 | reservation_object_get_list(struct reservation_object *obj) | ||
| 111 | { | ||
| 112 | return rcu_dereference_protected(obj->fence, | ||
| 113 | reservation_object_held(obj)); | ||
| 114 | } | ||
| 115 | |||
| 116 | static inline struct fence * | ||
| 117 | reservation_object_get_excl(struct reservation_object *obj) | ||
| 118 | { | ||
| 119 | return rcu_dereference_protected(obj->fence_excl, | ||
| 120 | reservation_object_held(obj)); | ||
| 121 | } | ||
| 122 | |||
| 123 | int reservation_object_reserve_shared(struct reservation_object *obj); | ||
| 124 | void reservation_object_add_shared_fence(struct reservation_object *obj, | ||
| 125 | struct fence *fence); | ||
| 126 | |||
| 127 | void reservation_object_add_excl_fence(struct reservation_object *obj, | ||
| 128 | struct fence *fence); | ||
| 129 | |||
| 130 | int reservation_object_get_fences_rcu(struct reservation_object *obj, | ||
| 131 | struct fence **pfence_excl, | ||
| 132 | unsigned *pshared_count, | ||
| 133 | struct fence ***pshared); | ||
| 134 | |||
| 135 | long reservation_object_wait_timeout_rcu(struct reservation_object *obj, | ||
| 136 | bool wait_all, bool intr, | ||
| 137 | unsigned long timeout); | ||
| 138 | |||
| 139 | bool reservation_object_test_signaled_rcu(struct reservation_object *obj, | ||
| 140 | bool test_all); | ||
| 141 | |||
| 62 | #endif /* _LINUX_RESERVATION_H */ | 142 | #endif /* _LINUX_RESERVATION_H */ |
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h new file mode 100644 index 000000000000..9cda293c867d --- /dev/null +++ b/include/linux/rhashtable.h | |||
| @@ -0,0 +1,213 @@ | |||
| 1 | /* | ||
| 2 | * Resizable, Scalable, Concurrent Hash Table | ||
| 3 | * | ||
| 4 | * Copyright (c) 2014 Thomas Graf <tgraf@suug.ch> | ||
| 5 | * Copyright (c) 2008-2014 Patrick McHardy <kaber@trash.net> | ||
| 6 | * | ||
| 7 | * Based on the following paper by Josh Triplett, Paul E. McKenney | ||
| 8 | * and Jonathan Walpole: | ||
| 9 | * https://www.usenix.org/legacy/event/atc11/tech/final_files/Triplett.pdf | ||
| 10 | * | ||
| 11 | * Code partially derived from nft_hash | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License version 2 as | ||
| 15 | * published by the Free Software Foundation. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef _LINUX_RHASHTABLE_H | ||
| 19 | #define _LINUX_RHASHTABLE_H | ||
| 20 | |||
| 21 | #include <linux/rculist.h> | ||
| 22 | |||
| 23 | struct rhash_head { | ||
| 24 | struct rhash_head *next; | ||
| 25 | }; | ||
| 26 | |||
| 27 | #define INIT_HASH_HEAD(ptr) ((ptr)->next = NULL) | ||
| 28 | |||
| 29 | struct bucket_table { | ||
| 30 | size_t size; | ||
| 31 | struct rhash_head __rcu *buckets[]; | ||
| 32 | }; | ||
| 33 | |||
| 34 | typedef u32 (*rht_hashfn_t)(const void *data, u32 len, u32 seed); | ||
| 35 | typedef u32 (*rht_obj_hashfn_t)(const void *data, u32 seed); | ||
| 36 | |||
| 37 | struct rhashtable; | ||
| 38 | |||
| 39 | /** | ||
| 40 | * struct rhashtable_params - Hash table construction parameters | ||
| 41 | * @nelem_hint: Hint on number of elements, should be 75% of desired size | ||
| 42 | * @key_len: Length of key | ||
| 43 | * @key_offset: Offset of key in struct to be hashed | ||
| 44 | * @head_offset: Offset of rhash_head in struct to be hashed | ||
| 45 | * @hash_rnd: Seed to use while hashing | ||
| 46 | * @max_shift: Maximum number of shifts while expanding | ||
| 47 | * @hashfn: Function to hash key | ||
| 48 | * @obj_hashfn: Function to hash object | ||
| 49 | * @grow_decision: If defined, may return true if table should expand | ||
| 50 | * @shrink_decision: If defined, may return true if table should shrink | ||
| 51 | * @mutex_is_held: Must return true if protecting mutex is held | ||
| 52 | */ | ||
| 53 | struct rhashtable_params { | ||
| 54 | size_t nelem_hint; | ||
| 55 | size_t key_len; | ||
| 56 | size_t key_offset; | ||
| 57 | size_t head_offset; | ||
| 58 | u32 hash_rnd; | ||
| 59 | size_t max_shift; | ||
| 60 | rht_hashfn_t hashfn; | ||
| 61 | rht_obj_hashfn_t obj_hashfn; | ||
| 62 | bool (*grow_decision)(const struct rhashtable *ht, | ||
| 63 | size_t new_size); | ||
| 64 | bool (*shrink_decision)(const struct rhashtable *ht, | ||
| 65 | size_t new_size); | ||
| 66 | int (*mutex_is_held)(void); | ||
| 67 | }; | ||
| 68 | |||
| 69 | /** | ||
| 70 | * struct rhashtable - Hash table handle | ||
| 71 | * @tbl: Bucket table | ||
| 72 | * @nelems: Number of elements in table | ||
| 73 | * @shift: Current size (1 << shift) | ||
| 74 | * @p: Configuration parameters | ||
| 75 | */ | ||
| 76 | struct rhashtable { | ||
| 77 | struct bucket_table __rcu *tbl; | ||
| 78 | size_t nelems; | ||
| 79 | size_t shift; | ||
| 80 | struct rhashtable_params p; | ||
| 81 | }; | ||
| 82 | |||
| 83 | #ifdef CONFIG_PROVE_LOCKING | ||
| 84 | int lockdep_rht_mutex_is_held(const struct rhashtable *ht); | ||
| 85 | #else | ||
| 86 | static inline int lockdep_rht_mutex_is_held(const struct rhashtable *ht) | ||
| 87 | { | ||
| 88 | return 1; | ||
| 89 | } | ||
| 90 | #endif /* CONFIG_PROVE_LOCKING */ | ||
| 91 | |||
| 92 | int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params); | ||
| 93 | |||
| 94 | u32 rhashtable_hashfn(const struct rhashtable *ht, const void *key, u32 len); | ||
| 95 | u32 rhashtable_obj_hashfn(const struct rhashtable *ht, void *ptr); | ||
| 96 | |||
| 97 | void rhashtable_insert(struct rhashtable *ht, struct rhash_head *node, gfp_t); | ||
| 98 | bool rhashtable_remove(struct rhashtable *ht, struct rhash_head *node, gfp_t); | ||
| 99 | void rhashtable_remove_pprev(struct rhashtable *ht, struct rhash_head *obj, | ||
| 100 | struct rhash_head **pprev, gfp_t flags); | ||
| 101 | |||
| 102 | bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size); | ||
| 103 | bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size); | ||
| 104 | |||
| 105 | int rhashtable_expand(struct rhashtable *ht, gfp_t flags); | ||
| 106 | int rhashtable_shrink(struct rhashtable *ht, gfp_t flags); | ||
| 107 | |||
| 108 | void *rhashtable_lookup(const struct rhashtable *ht, const void *key); | ||
| 109 | void *rhashtable_lookup_compare(const struct rhashtable *ht, u32 hash, | ||
| 110 | bool (*compare)(void *, void *), void *arg); | ||
| 111 | |||
| 112 | void rhashtable_destroy(const struct rhashtable *ht); | ||
| 113 | |||
| 114 | #define rht_dereference(p, ht) \ | ||
| 115 | rcu_dereference_protected(p, lockdep_rht_mutex_is_held(ht)) | ||
| 116 | |||
| 117 | #define rht_dereference_rcu(p, ht) \ | ||
| 118 | rcu_dereference_check(p, lockdep_rht_mutex_is_held(ht)) | ||
| 119 | |||
| 120 | /* Internal, use rht_obj() instead */ | ||
| 121 | #define rht_entry(ptr, type, member) container_of(ptr, type, member) | ||
| 122 | #define rht_entry_safe(ptr, type, member) \ | ||
| 123 | ({ \ | ||
| 124 | typeof(ptr) __ptr = (ptr); \ | ||
| 125 | __ptr ? rht_entry(__ptr, type, member) : NULL; \ | ||
| 126 | }) | ||
| 127 | #define rht_entry_safe_rcu(ptr, type, member) \ | ||
| 128 | ({ \ | ||
| 129 | typeof(*ptr) __rcu *__ptr = (typeof(*ptr) __rcu __force *)ptr; \ | ||
| 130 | __ptr ? container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member) : NULL; \ | ||
| 131 | }) | ||
| 132 | |||
| 133 | #define rht_next_entry_safe(pos, ht, member) \ | ||
| 134 | ({ \ | ||
| 135 | pos ? rht_entry_safe(rht_dereference((pos)->member.next, ht), \ | ||
| 136 | typeof(*(pos)), member) : NULL; \ | ||
| 137 | }) | ||
| 138 | |||
| 139 | /** | ||
| 140 | * rht_for_each - iterate over hash chain | ||
| 141 | * @pos: &struct rhash_head to use as a loop cursor. | ||
| 142 | * @head: head of the hash chain (struct rhash_head *) | ||
| 143 | * @ht: pointer to your struct rhashtable | ||
| 144 | */ | ||
| 145 | #define rht_for_each(pos, head, ht) \ | ||
| 146 | for (pos = rht_dereference(head, ht); \ | ||
| 147 | pos; \ | ||
| 148 | pos = rht_dereference((pos)->next, ht)) | ||
| 149 | |||
| 150 | /** | ||
| 151 | * rht_for_each_entry - iterate over hash chain of given type | ||
| 152 | * @pos: type * to use as a loop cursor. | ||
| 153 | * @head: head of the hash chain (struct rhash_head *) | ||
| 154 | * @ht: pointer to your struct rhashtable | ||
| 155 | * @member: name of the rhash_head within the hashable struct. | ||
| 156 | */ | ||
| 157 | #define rht_for_each_entry(pos, head, ht, member) \ | ||
| 158 | for (pos = rht_entry_safe(rht_dereference(head, ht), \ | ||
| 159 | typeof(*(pos)), member); \ | ||
| 160 | pos; \ | ||
| 161 | pos = rht_next_entry_safe(pos, ht, member)) | ||
| 162 | |||
| 163 | /** | ||
| 164 | * rht_for_each_entry_safe - safely iterate over hash chain of given type | ||
| 165 | * @pos: type * to use as a loop cursor. | ||
| 166 | * @n: type * to use for temporary next object storage | ||
| 167 | * @head: head of the hash chain (struct rhash_head *) | ||
| 168 | * @ht: pointer to your struct rhashtable | ||
| 169 | * @member: name of the rhash_head within the hashable struct. | ||
| 170 | * | ||
| 171 | * This hash chain list-traversal primitive allows for the looped code to | ||
| 172 | * remove the loop cursor from the list. | ||
| 173 | */ | ||
| 174 | #define rht_for_each_entry_safe(pos, n, head, ht, member) \ | ||
| 175 | for (pos = rht_entry_safe(rht_dereference(head, ht), \ | ||
| 176 | typeof(*(pos)), member), \ | ||
| 177 | n = rht_next_entry_safe(pos, ht, member); \ | ||
| 178 | pos; \ | ||
| 179 | pos = n, \ | ||
| 180 | n = rht_next_entry_safe(pos, ht, member)) | ||
| 181 | |||
| 182 | /** | ||
| 183 | * rht_for_each_rcu - iterate over rcu hash chain | ||
| 184 | * @pos: &struct rhash_head to use as a loop cursor. | ||
| 185 | * @head: head of the hash chain (struct rhash_head *) | ||
| 186 | * @ht: pointer to your struct rhashtable | ||
| 187 | * | ||
| 188 | * This hash chain list-traversal primitive may safely run concurrently with | ||
| 189 | * the _rcu fkht mutation primitives such as rht_insert() as long as the | ||
| 190 | * traversal is guarded by rcu_read_lock(). | ||
| 191 | */ | ||
| 192 | #define rht_for_each_rcu(pos, head, ht) \ | ||
| 193 | for (pos = rht_dereference_rcu(head, ht); \ | ||
| 194 | pos; \ | ||
| 195 | pos = rht_dereference_rcu((pos)->next, ht)) | ||
| 196 | |||
| 197 | /** | ||
| 198 | * rht_for_each_entry_rcu - iterate over rcu hash chain of given type | ||
| 199 | * @pos: type * to use as a loop cursor. | ||
| 200 | * @head: head of the hash chain (struct rhash_head *) | ||
| 201 | * @member: name of the rhash_head within the hashable struct. | ||
| 202 | * | ||
| 203 | * This hash chain list-traversal primitive may safely run concurrently with | ||
| 204 | * the _rcu fkht mutation primitives such as rht_insert() as long as the | ||
| 205 | * traversal is guarded by rcu_read_lock(). | ||
| 206 | */ | ||
| 207 | #define rht_for_each_entry_rcu(pos, head, member) \ | ||
| 208 | for (pos = rht_entry_safe_rcu(head, typeof(*(pos)), member); \ | ||
| 209 | pos; \ | ||
| 210 | pos = rht_entry_safe_rcu((pos)->member.next, \ | ||
| 211 | typeof(*(pos)), member)) | ||
| 212 | |||
| 213 | #endif /* _LINUX_RHASHTABLE_H */ | ||
diff --git a/include/linux/rndis.h b/include/linux/rndis.h index 0c8dc7195cdb..93c0a64aefa6 100644 --- a/include/linux/rndis.h +++ b/include/linux/rndis.h | |||
| @@ -65,6 +65,7 @@ | |||
| 65 | #define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION 0x40010012 | 65 | #define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION 0x40010012 |
| 66 | #define RNDIS_STATUS_WW_INDICATION RDIA_SPECIFIC_INDICATION | 66 | #define RNDIS_STATUS_WW_INDICATION RDIA_SPECIFIC_INDICATION |
| 67 | #define RNDIS_STATUS_LINK_SPEED_CHANGE 0x40010013L | 67 | #define RNDIS_STATUS_LINK_SPEED_CHANGE 0x40010013L |
| 68 | #define RNDIS_STATUS_NETWORK_CHANGE 0x40010018 | ||
| 68 | 69 | ||
| 69 | #define RNDIS_STATUS_NOT_RESETTABLE 0x80010001 | 70 | #define RNDIS_STATUS_NOT_RESETTABLE 0x80010001 |
| 70 | #define RNDIS_STATUS_SOFT_ERRORS 0x80010003 | 71 | #define RNDIS_STATUS_SOFT_ERRORS 0x80010003 |
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h index 3aed8d737e1a..1abba5ce2a2f 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h | |||
| @@ -90,11 +90,9 @@ extern void __rt_mutex_init(struct rt_mutex *lock, const char *name); | |||
| 90 | extern void rt_mutex_destroy(struct rt_mutex *lock); | 90 | extern void rt_mutex_destroy(struct rt_mutex *lock); |
| 91 | 91 | ||
| 92 | extern void rt_mutex_lock(struct rt_mutex *lock); | 92 | extern void rt_mutex_lock(struct rt_mutex *lock); |
| 93 | extern int rt_mutex_lock_interruptible(struct rt_mutex *lock, | 93 | extern int rt_mutex_lock_interruptible(struct rt_mutex *lock); |
| 94 | int detect_deadlock); | ||
| 95 | extern int rt_mutex_timed_lock(struct rt_mutex *lock, | 94 | extern int rt_mutex_timed_lock(struct rt_mutex *lock, |
| 96 | struct hrtimer_sleeper *timeout, | 95 | struct hrtimer_sleeper *timeout); |
| 97 | int detect_deadlock); | ||
| 98 | 96 | ||
| 99 | extern int rt_mutex_trylock(struct rt_mutex *lock); | 97 | extern int rt_mutex_trylock(struct rt_mutex *lock); |
| 100 | 98 | ||
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 953937ea5233..167bae7bdfa4 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
| @@ -78,6 +78,7 @@ extern void __rtnl_unlock(void); | |||
| 78 | extern int ndo_dflt_fdb_dump(struct sk_buff *skb, | 78 | extern int ndo_dflt_fdb_dump(struct sk_buff *skb, |
| 79 | struct netlink_callback *cb, | 79 | struct netlink_callback *cb, |
| 80 | struct net_device *dev, | 80 | struct net_device *dev, |
| 81 | struct net_device *filter_dev, | ||
| 81 | int idx); | 82 | int idx); |
| 82 | extern int ndo_dflt_fdb_add(struct ndmsg *ndm, | 83 | extern int ndo_dflt_fdb_add(struct ndmsg *ndm, |
| 83 | struct nlattr *tb[], | 84 | struct nlattr *tb[], |
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index a964f7285600..f4ec8bbcb372 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
| @@ -229,10 +229,10 @@ void sg_init_one(struct scatterlist *, const void *, unsigned int); | |||
| 229 | typedef struct scatterlist *(sg_alloc_fn)(unsigned int, gfp_t); | 229 | typedef struct scatterlist *(sg_alloc_fn)(unsigned int, gfp_t); |
| 230 | typedef void (sg_free_fn)(struct scatterlist *, unsigned int); | 230 | typedef void (sg_free_fn)(struct scatterlist *, unsigned int); |
| 231 | 231 | ||
| 232 | void __sg_free_table(struct sg_table *, unsigned int, sg_free_fn *); | 232 | void __sg_free_table(struct sg_table *, unsigned int, bool, sg_free_fn *); |
| 233 | void sg_free_table(struct sg_table *); | 233 | void sg_free_table(struct sg_table *); |
| 234 | int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int, gfp_t, | 234 | int __sg_alloc_table(struct sg_table *, unsigned int, unsigned int, |
| 235 | sg_alloc_fn *); | 235 | struct scatterlist *, gfp_t, sg_alloc_fn *); |
| 236 | int sg_alloc_table(struct sg_table *, unsigned int, gfp_t); | 236 | int sg_alloc_table(struct sg_table *, unsigned int, gfp_t); |
| 237 | int sg_alloc_table_from_pages(struct sg_table *sgt, | 237 | int sg_alloc_table_from_pages(struct sg_table *sgt, |
| 238 | struct page **pages, unsigned int n_pages, | 238 | struct page **pages, unsigned int n_pages, |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 0376b054a0d0..84729f7c472c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -168,8 +168,7 @@ extern int nr_processes(void); | |||
| 168 | extern unsigned long nr_running(void); | 168 | extern unsigned long nr_running(void); |
| 169 | extern unsigned long nr_iowait(void); | 169 | extern unsigned long nr_iowait(void); |
| 170 | extern unsigned long nr_iowait_cpu(int cpu); | 170 | extern unsigned long nr_iowait_cpu(int cpu); |
| 171 | extern unsigned long this_cpu_load(void); | 171 | extern void get_iowait_load(unsigned long *nr_waiters, unsigned long *load); |
| 172 | |||
| 173 | 172 | ||
| 174 | extern void calc_global_load(unsigned long ticks); | 173 | extern void calc_global_load(unsigned long ticks); |
| 175 | extern void update_cpu_load_nohz(void); | 174 | extern void update_cpu_load_nohz(void); |
| @@ -813,7 +812,7 @@ struct task_delay_info { | |||
| 813 | * associated with the operation is added to XXX_delay. | 812 | * associated with the operation is added to XXX_delay. |
| 814 | * XXX_delay contains the accumulated delay time in nanoseconds. | 813 | * XXX_delay contains the accumulated delay time in nanoseconds. |
| 815 | */ | 814 | */ |
| 816 | struct timespec blkio_start, blkio_end; /* Shared by blkio, swapin */ | 815 | u64 blkio_start; /* Shared by blkio, swapin */ |
| 817 | u64 blkio_delay; /* wait for sync block io completion */ | 816 | u64 blkio_delay; /* wait for sync block io completion */ |
| 818 | u64 swapin_delay; /* wait for swapin block io completion */ | 817 | u64 swapin_delay; /* wait for swapin block io completion */ |
| 819 | u32 blkio_count; /* total count of the number of sync block */ | 818 | u32 blkio_count; /* total count of the number of sync block */ |
| @@ -821,7 +820,7 @@ struct task_delay_info { | |||
| 821 | u32 swapin_count; /* total count of the number of swapin block */ | 820 | u32 swapin_count; /* total count of the number of swapin block */ |
| 822 | /* io operations performed */ | 821 | /* io operations performed */ |
| 823 | 822 | ||
| 824 | struct timespec freepages_start, freepages_end; | 823 | u64 freepages_start; |
| 825 | u64 freepages_delay; /* wait for memory reclaim */ | 824 | u64 freepages_delay; /* wait for memory reclaim */ |
| 826 | u32 freepages_count; /* total count of memory reclaim */ | 825 | u32 freepages_count; /* total count of memory reclaim */ |
| 827 | }; | 826 | }; |
| @@ -1270,9 +1269,6 @@ struct task_struct { | |||
| 1270 | #ifdef CONFIG_TREE_PREEMPT_RCU | 1269 | #ifdef CONFIG_TREE_PREEMPT_RCU |
| 1271 | struct rcu_node *rcu_blocked_node; | 1270 | struct rcu_node *rcu_blocked_node; |
| 1272 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 1271 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
| 1273 | #ifdef CONFIG_RCU_BOOST | ||
| 1274 | struct rt_mutex *rcu_boost_mutex; | ||
| 1275 | #endif /* #ifdef CONFIG_RCU_BOOST */ | ||
| 1276 | 1272 | ||
| 1277 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) | 1273 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) |
| 1278 | struct sched_info sched_info; | 1274 | struct sched_info sched_info; |
| @@ -1307,13 +1303,12 @@ struct task_struct { | |||
| 1307 | * execve */ | 1303 | * execve */ |
| 1308 | unsigned in_iowait:1; | 1304 | unsigned in_iowait:1; |
| 1309 | 1305 | ||
| 1310 | /* task may not gain privileges */ | ||
| 1311 | unsigned no_new_privs:1; | ||
| 1312 | |||
| 1313 | /* Revert to default priority/policy when forking */ | 1306 | /* Revert to default priority/policy when forking */ |
| 1314 | unsigned sched_reset_on_fork:1; | 1307 | unsigned sched_reset_on_fork:1; |
| 1315 | unsigned sched_contributes_to_load:1; | 1308 | unsigned sched_contributes_to_load:1; |
| 1316 | 1309 | ||
| 1310 | unsigned long atomic_flags; /* Flags needing atomic access. */ | ||
| 1311 | |||
| 1317 | pid_t pid; | 1312 | pid_t pid; |
| 1318 | pid_t tgid; | 1313 | pid_t tgid; |
| 1319 | 1314 | ||
| @@ -1367,8 +1362,8 @@ struct task_struct { | |||
| 1367 | } vtime_snap_whence; | 1362 | } vtime_snap_whence; |
| 1368 | #endif | 1363 | #endif |
| 1369 | unsigned long nvcsw, nivcsw; /* context switch counts */ | 1364 | unsigned long nvcsw, nivcsw; /* context switch counts */ |
| 1370 | struct timespec start_time; /* monotonic time */ | 1365 | u64 start_time; /* monotonic time in nsec */ |
| 1371 | struct timespec real_start_time; /* boot based time */ | 1366 | u64 real_start_time; /* boot based time in nsec */ |
| 1372 | /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ | 1367 | /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ |
| 1373 | unsigned long min_flt, maj_flt; | 1368 | unsigned long min_flt, maj_flt; |
| 1374 | 1369 | ||
| @@ -1440,8 +1435,6 @@ struct task_struct { | |||
| 1440 | struct rb_node *pi_waiters_leftmost; | 1435 | struct rb_node *pi_waiters_leftmost; |
| 1441 | /* Deadlock detection and priority inheritance handling */ | 1436 | /* Deadlock detection and priority inheritance handling */ |
| 1442 | struct rt_mutex_waiter *pi_blocked_on; | 1437 | struct rt_mutex_waiter *pi_blocked_on; |
| 1443 | /* Top pi_waiters task */ | ||
| 1444 | struct task_struct *pi_top_task; | ||
| 1445 | #endif | 1438 | #endif |
| 1446 | 1439 | ||
| 1447 | #ifdef CONFIG_DEBUG_MUTEXES | 1440 | #ifdef CONFIG_DEBUG_MUTEXES |
| @@ -1967,6 +1960,19 @@ static inline void memalloc_noio_restore(unsigned int flags) | |||
| 1967 | current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags; | 1960 | current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags; |
| 1968 | } | 1961 | } |
| 1969 | 1962 | ||
| 1963 | /* Per-process atomic flags. */ | ||
| 1964 | #define PFA_NO_NEW_PRIVS 0x00000001 /* May not gain new privileges. */ | ||
| 1965 | |||
| 1966 | static inline bool task_no_new_privs(struct task_struct *p) | ||
| 1967 | { | ||
| 1968 | return test_bit(PFA_NO_NEW_PRIVS, &p->atomic_flags); | ||
| 1969 | } | ||
| 1970 | |||
| 1971 | static inline void task_set_no_new_privs(struct task_struct *p) | ||
| 1972 | { | ||
| 1973 | set_bit(PFA_NO_NEW_PRIVS, &p->atomic_flags); | ||
| 1974 | } | ||
| 1975 | |||
| 1970 | /* | 1976 | /* |
| 1971 | * task->jobctl flags | 1977 | * task->jobctl flags |
| 1972 | */ | 1978 | */ |
| @@ -2009,9 +2015,6 @@ static inline void rcu_copy_process(struct task_struct *p) | |||
| 2009 | #ifdef CONFIG_TREE_PREEMPT_RCU | 2015 | #ifdef CONFIG_TREE_PREEMPT_RCU |
| 2010 | p->rcu_blocked_node = NULL; | 2016 | p->rcu_blocked_node = NULL; |
| 2011 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 2017 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
| 2012 | #ifdef CONFIG_RCU_BOOST | ||
| 2013 | p->rcu_boost_mutex = NULL; | ||
| 2014 | #endif /* #ifdef CONFIG_RCU_BOOST */ | ||
| 2015 | INIT_LIST_HEAD(&p->rcu_node_entry); | 2018 | INIT_LIST_HEAD(&p->rcu_node_entry); |
| 2016 | } | 2019 | } |
| 2017 | 2020 | ||
| @@ -2788,7 +2791,7 @@ static inline bool __must_check current_set_polling_and_test(void) | |||
| 2788 | 2791 | ||
| 2789 | /* | 2792 | /* |
| 2790 | * Polling state must be visible before we test NEED_RESCHED, | 2793 | * Polling state must be visible before we test NEED_RESCHED, |
| 2791 | * paired by resched_task() | 2794 | * paired by resched_curr() |
| 2792 | */ | 2795 | */ |
| 2793 | smp_mb__after_atomic(); | 2796 | smp_mb__after_atomic(); |
| 2794 | 2797 | ||
| @@ -2806,7 +2809,7 @@ static inline bool __must_check current_clr_polling_and_test(void) | |||
| 2806 | 2809 | ||
| 2807 | /* | 2810 | /* |
| 2808 | * Polling state must be visible before we test NEED_RESCHED, | 2811 | * Polling state must be visible before we test NEED_RESCHED, |
| 2809 | * paired by resched_task() | 2812 | * paired by resched_curr() |
| 2810 | */ | 2813 | */ |
| 2811 | smp_mb__after_atomic(); | 2814 | smp_mb__after_atomic(); |
| 2812 | 2815 | ||
| @@ -2838,7 +2841,7 @@ static inline void current_clr_polling(void) | |||
| 2838 | * TIF_NEED_RESCHED and the IPI handler, scheduler_ipi(), will also | 2841 | * TIF_NEED_RESCHED and the IPI handler, scheduler_ipi(), will also |
| 2839 | * fold. | 2842 | * fold. |
| 2840 | */ | 2843 | */ |
| 2841 | smp_mb(); /* paired with resched_task() */ | 2844 | smp_mb(); /* paired with resched_curr() */ |
| 2842 | 2845 | ||
| 2843 | preempt_fold_need_resched(); | 2846 | preempt_fold_need_resched(); |
| 2844 | } | 2847 | } |
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h index 4054b0994071..5d586a45a319 100644 --- a/include/linux/seccomp.h +++ b/include/linux/seccomp.h | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | #include <uapi/linux/seccomp.h> | 4 | #include <uapi/linux/seccomp.h> |
| 5 | 5 | ||
| 6 | #define SECCOMP_FILTER_FLAG_MASK (SECCOMP_FILTER_FLAG_TSYNC) | ||
| 7 | |||
| 6 | #ifdef CONFIG_SECCOMP | 8 | #ifdef CONFIG_SECCOMP |
| 7 | 9 | ||
| 8 | #include <linux/thread_info.h> | 10 | #include <linux/thread_info.h> |
| @@ -14,11 +16,11 @@ struct seccomp_filter; | |||
| 14 | * | 16 | * |
| 15 | * @mode: indicates one of the valid values above for controlled | 17 | * @mode: indicates one of the valid values above for controlled |
| 16 | * system calls available to a process. | 18 | * system calls available to a process. |
| 17 | * @filter: The metadata and ruleset for determining what system calls | 19 | * @filter: must always point to a valid seccomp-filter or NULL as it is |
| 18 | * are allowed for a task. | 20 | * accessed without locking during system call entry. |
| 19 | * | 21 | * |
| 20 | * @filter must only be accessed from the context of current as there | 22 | * @filter must only be accessed from the context of current as there |
| 21 | * is no locking. | 23 | * is no read locking. |
| 22 | */ | 24 | */ |
| 23 | struct seccomp { | 25 | struct seccomp { |
| 24 | int mode; | 26 | int mode; |
diff --git a/include/linux/security.h b/include/linux/security.h index 9c6b9722ff48..623f90e5f38d 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -702,6 +702,15 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 702 | * @inode points to the inode to use as a reference. | 702 | * @inode points to the inode to use as a reference. |
| 703 | * The current task must be the one that nominated @inode. | 703 | * The current task must be the one that nominated @inode. |
| 704 | * Return 0 if successful. | 704 | * Return 0 if successful. |
| 705 | * @kernel_fw_from_file: | ||
| 706 | * Load firmware from userspace (not called for built-in firmware). | ||
| 707 | * @file contains the file structure pointing to the file containing | ||
| 708 | * the firmware to load. This argument will be NULL if the firmware | ||
| 709 | * was loaded via the uevent-triggered blob-based interface exposed | ||
| 710 | * by CONFIG_FW_LOADER_USER_HELPER. | ||
| 711 | * @buf pointer to buffer containing firmware contents. | ||
| 712 | * @size length of the firmware contents. | ||
| 713 | * Return 0 if permission is granted. | ||
| 705 | * @kernel_module_request: | 714 | * @kernel_module_request: |
| 706 | * Ability to trigger the kernel to automatically upcall to userspace for | 715 | * Ability to trigger the kernel to automatically upcall to userspace for |
| 707 | * userspace to load a kernel module with the given name. | 716 | * userspace to load a kernel module with the given name. |
| @@ -1565,6 +1574,7 @@ struct security_operations { | |||
| 1565 | void (*cred_transfer)(struct cred *new, const struct cred *old); | 1574 | void (*cred_transfer)(struct cred *new, const struct cred *old); |
| 1566 | int (*kernel_act_as)(struct cred *new, u32 secid); | 1575 | int (*kernel_act_as)(struct cred *new, u32 secid); |
| 1567 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); | 1576 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); |
| 1577 | int (*kernel_fw_from_file)(struct file *file, char *buf, size_t size); | ||
| 1568 | int (*kernel_module_request)(char *kmod_name); | 1578 | int (*kernel_module_request)(char *kmod_name); |
| 1569 | int (*kernel_module_from_file)(struct file *file); | 1579 | int (*kernel_module_from_file)(struct file *file); |
| 1570 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, | 1580 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, |
| @@ -1837,6 +1847,7 @@ int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp); | |||
| 1837 | void security_transfer_creds(struct cred *new, const struct cred *old); | 1847 | void security_transfer_creds(struct cred *new, const struct cred *old); |
| 1838 | int security_kernel_act_as(struct cred *new, u32 secid); | 1848 | int security_kernel_act_as(struct cred *new, u32 secid); |
| 1839 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); | 1849 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); |
| 1850 | int security_kernel_fw_from_file(struct file *file, char *buf, size_t size); | ||
| 1840 | int security_kernel_module_request(char *kmod_name); | 1851 | int security_kernel_module_request(char *kmod_name); |
| 1841 | int security_kernel_module_from_file(struct file *file); | 1852 | int security_kernel_module_from_file(struct file *file); |
| 1842 | int security_task_fix_setuid(struct cred *new, const struct cred *old, | 1853 | int security_task_fix_setuid(struct cred *new, const struct cred *old, |
| @@ -2363,6 +2374,12 @@ static inline int security_kernel_create_files_as(struct cred *cred, | |||
| 2363 | return 0; | 2374 | return 0; |
| 2364 | } | 2375 | } |
| 2365 | 2376 | ||
| 2377 | static inline int security_kernel_fw_from_file(struct file *file, | ||
| 2378 | char *buf, size_t size) | ||
| 2379 | { | ||
| 2380 | return 0; | ||
| 2381 | } | ||
| 2382 | |||
| 2366 | static inline int security_kernel_module_request(char *kmod_name) | 2383 | static inline int security_kernel_module_request(char *kmod_name) |
| 2367 | { | 2384 | { |
| 2368 | return 0; | 2385 | return 0; |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 535f158977b9..cc359636cfa3 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
| @@ -117,6 +117,22 @@ repeat: | |||
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | /** | 119 | /** |
| 120 | * raw_read_seqcount - Read the raw seqcount | ||
| 121 | * @s: pointer to seqcount_t | ||
| 122 | * Returns: count to be passed to read_seqcount_retry | ||
| 123 | * | ||
| 124 | * raw_read_seqcount opens a read critical section of the given | ||
| 125 | * seqcount without any lockdep checking and without checking or | ||
| 126 | * masking the LSB. Calling code is responsible for handling that. | ||
| 127 | */ | ||
| 128 | static inline unsigned raw_read_seqcount(const seqcount_t *s) | ||
| 129 | { | ||
| 130 | unsigned ret = ACCESS_ONCE(s->sequence); | ||
| 131 | smp_rmb(); | ||
| 132 | return ret; | ||
| 133 | } | ||
| 134 | |||
| 135 | /** | ||
| 120 | * raw_read_seqcount_begin - start seq-read critical section w/o lockdep | 136 | * raw_read_seqcount_begin - start seq-read critical section w/o lockdep |
| 121 | * @s: pointer to seqcount_t | 137 | * @s: pointer to seqcount_t |
| 122 | * Returns: count to be passed to read_seqcount_retry | 138 | * Returns: count to be passed to read_seqcount_retry |
| @@ -164,8 +180,6 @@ static inline unsigned read_seqcount_begin(const seqcount_t *s) | |||
| 164 | static inline unsigned raw_seqcount_begin(const seqcount_t *s) | 180 | static inline unsigned raw_seqcount_begin(const seqcount_t *s) |
| 165 | { | 181 | { |
| 166 | unsigned ret = ACCESS_ONCE(s->sequence); | 182 | unsigned ret = ACCESS_ONCE(s->sequence); |
| 167 | |||
| 168 | seqcount_lockdep_reader_access(s); | ||
| 169 | smp_rmb(); | 183 | smp_rmb(); |
| 170 | return ret & ~1; | 184 | return ret & ~1; |
| 171 | } | 185 | } |
| @@ -220,6 +234,17 @@ static inline void raw_write_seqcount_end(seqcount_t *s) | |||
| 220 | } | 234 | } |
| 221 | 235 | ||
| 222 | /* | 236 | /* |
| 237 | * raw_write_seqcount_latch - redirect readers to even/odd copy | ||
| 238 | * @s: pointer to seqcount_t | ||
| 239 | */ | ||
| 240 | static inline void raw_write_seqcount_latch(seqcount_t *s) | ||
| 241 | { | ||
| 242 | smp_wmb(); /* prior stores before incrementing "sequence" */ | ||
| 243 | s->sequence++; | ||
| 244 | smp_wmb(); /* increment "sequence" before following stores */ | ||
| 245 | } | ||
| 246 | |||
| 247 | /* | ||
| 223 | * Sequence counter only version assumes that callers are using their | 248 | * Sequence counter only version assumes that callers are using their |
| 224 | * own mutexing. | 249 | * own mutexing. |
| 225 | */ | 250 | */ |
diff --git a/include/linux/seqno-fence.h b/include/linux/seqno-fence.h new file mode 100644 index 000000000000..3d6003de4b0d --- /dev/null +++ b/include/linux/seqno-fence.h | |||
| @@ -0,0 +1,116 @@ | |||
| 1 | /* | ||
| 2 | * seqno-fence, using a dma-buf to synchronize fencing | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Texas Instruments | ||
| 5 | * Copyright (C) 2012 Canonical Ltd | ||
| 6 | * Authors: | ||
| 7 | * Rob Clark <robdclark@gmail.com> | ||
| 8 | * Maarten Lankhorst <maarten.lankhorst@canonical.com> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify it | ||
| 11 | * under the terms of the GNU General Public License version 2 as published by | ||
| 12 | * the Free Software Foundation. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 17 | * more details. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __LINUX_SEQNO_FENCE_H | ||
| 21 | #define __LINUX_SEQNO_FENCE_H | ||
| 22 | |||
| 23 | #include <linux/fence.h> | ||
| 24 | #include <linux/dma-buf.h> | ||
| 25 | |||
| 26 | enum seqno_fence_condition { | ||
| 27 | SEQNO_FENCE_WAIT_GEQUAL, | ||
| 28 | SEQNO_FENCE_WAIT_NONZERO | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct seqno_fence { | ||
| 32 | struct fence base; | ||
| 33 | |||
| 34 | const struct fence_ops *ops; | ||
| 35 | struct dma_buf *sync_buf; | ||
| 36 | uint32_t seqno_ofs; | ||
| 37 | enum seqno_fence_condition condition; | ||
| 38 | }; | ||
| 39 | |||
| 40 | extern const struct fence_ops seqno_fence_ops; | ||
| 41 | |||
| 42 | /** | ||
| 43 | * to_seqno_fence - cast a fence to a seqno_fence | ||
| 44 | * @fence: fence to cast to a seqno_fence | ||
| 45 | * | ||
| 46 | * Returns NULL if the fence is not a seqno_fence, | ||
| 47 | * or the seqno_fence otherwise. | ||
| 48 | */ | ||
| 49 | static inline struct seqno_fence * | ||
| 50 | to_seqno_fence(struct fence *fence) | ||
| 51 | { | ||
| 52 | if (fence->ops != &seqno_fence_ops) | ||
| 53 | return NULL; | ||
| 54 | return container_of(fence, struct seqno_fence, base); | ||
| 55 | } | ||
| 56 | |||
| 57 | /** | ||
| 58 | * seqno_fence_init - initialize a seqno fence | ||
| 59 | * @fence: seqno_fence to initialize | ||
| 60 | * @lock: pointer to spinlock to use for fence | ||
| 61 | * @sync_buf: buffer containing the memory location to signal on | ||
| 62 | * @context: the execution context this fence is a part of | ||
| 63 | * @seqno_ofs: the offset within @sync_buf | ||
| 64 | * @seqno: the sequence # to signal on | ||
| 65 | * @ops: the fence_ops for operations on this seqno fence | ||
| 66 | * | ||
| 67 | * This function initializes a struct seqno_fence with passed parameters, | ||
| 68 | * and takes a reference on sync_buf which is released on fence destruction. | ||
| 69 | * | ||
| 70 | * A seqno_fence is a dma_fence which can complete in software when | ||
| 71 | * enable_signaling is called, but it also completes when | ||
| 72 | * (s32)((sync_buf)[seqno_ofs] - seqno) >= 0 is true | ||
| 73 | * | ||
| 74 | * The seqno_fence will take a refcount on the sync_buf until it's | ||
| 75 | * destroyed, but actual lifetime of sync_buf may be longer if one of the | ||
| 76 | * callers take a reference to it. | ||
| 77 | * | ||
| 78 | * Certain hardware have instructions to insert this type of wait condition | ||
| 79 | * in the command stream, so no intervention from software would be needed. | ||
| 80 | * This type of fence can be destroyed before completed, however a reference | ||
| 81 | * on the sync_buf dma-buf can be taken. It is encouraged to re-use the same | ||
| 82 | * dma-buf for sync_buf, since mapping or unmapping the sync_buf to the | ||
| 83 | * device's vm can be expensive. | ||
| 84 | * | ||
| 85 | * It is recommended for creators of seqno_fence to call fence_signal | ||
| 86 | * before destruction. This will prevent possible issues from wraparound at | ||
| 87 | * time of issue vs time of check, since users can check fence_is_signaled | ||
| 88 | * before submitting instructions for the hardware to wait on the fence. | ||
| 89 | * However, when ops.enable_signaling is not called, it doesn't have to be | ||
| 90 | * done as soon as possible, just before there's any real danger of seqno | ||
| 91 | * wraparound. | ||
| 92 | */ | ||
| 93 | static inline void | ||
| 94 | seqno_fence_init(struct seqno_fence *fence, spinlock_t *lock, | ||
| 95 | struct dma_buf *sync_buf, uint32_t context, | ||
| 96 | uint32_t seqno_ofs, uint32_t seqno, | ||
| 97 | enum seqno_fence_condition cond, | ||
| 98 | const struct fence_ops *ops) | ||
| 99 | { | ||
| 100 | BUG_ON(!fence || !sync_buf || !ops); | ||
| 101 | BUG_ON(!ops->wait || !ops->enable_signaling || | ||
| 102 | !ops->get_driver_name || !ops->get_timeline_name); | ||
| 103 | |||
| 104 | /* | ||
| 105 | * ops is used in fence_init for get_driver_name, so needs to be | ||
| 106 | * initialized first | ||
| 107 | */ | ||
| 108 | fence->ops = ops; | ||
| 109 | fence_init(&fence->base, &seqno_fence_ops, lock, context, seqno); | ||
| 110 | get_dma_buf(sync_buf); | ||
| 111 | fence->sync_buf = sync_buf; | ||
| 112 | fence->seqno_ofs = seqno_ofs; | ||
| 113 | fence->condition = cond; | ||
| 114 | } | ||
| 115 | |||
| 116 | #endif /* __LINUX_SEQNO_FENCE_H */ | ||
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index af47a8af6024..f93649e22c43 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
| @@ -74,8 +74,10 @@ struct uart_8250_port { | |||
| 74 | struct list_head list; /* ports on this IRQ */ | 74 | struct list_head list; /* ports on this IRQ */ |
| 75 | unsigned short capabilities; /* port capabilities */ | 75 | unsigned short capabilities; /* port capabilities */ |
| 76 | unsigned short bugs; /* port bugs */ | 76 | unsigned short bugs; /* port bugs */ |
| 77 | bool fifo_bug; /* min RX trigger if enabled */ | ||
| 77 | unsigned int tx_loadsz; /* transmit fifo load size */ | 78 | unsigned int tx_loadsz; /* transmit fifo load size */ |
| 78 | unsigned char acr; | 79 | unsigned char acr; |
| 80 | unsigned char fcr; | ||
| 79 | unsigned char ier; | 81 | unsigned char ier; |
| 80 | unsigned char lcr; | 82 | unsigned char lcr; |
| 81 | unsigned char mcr; | 83 | unsigned char mcr; |
| @@ -100,6 +102,11 @@ struct uart_8250_port { | |||
| 100 | void (*dl_write)(struct uart_8250_port *, int); | 102 | void (*dl_write)(struct uart_8250_port *, int); |
| 101 | }; | 103 | }; |
| 102 | 104 | ||
| 105 | static inline struct uart_8250_port *up_to_u8250p(struct uart_port *up) | ||
| 106 | { | ||
| 107 | return container_of(up, struct uart_8250_port, port); | ||
| 108 | } | ||
| 109 | |||
| 103 | int serial8250_register_8250_port(struct uart_8250_port *); | 110 | int serial8250_register_8250_port(struct uart_8250_port *); |
| 104 | void serial8250_unregister_port(int line); | 111 | void serial8250_unregister_port(int line); |
| 105 | void serial8250_suspend_port(int line); | 112 | void serial8250_suspend_port(int line); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 5bbb809ee197..cf3a1e789bf5 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -199,6 +199,8 @@ struct uart_port { | |||
| 199 | unsigned char suspended; | 199 | unsigned char suspended; |
| 200 | unsigned char irq_wake; | 200 | unsigned char irq_wake; |
| 201 | unsigned char unused[2]; | 201 | unsigned char unused[2]; |
| 202 | struct attribute_group *attr_group; /* port specific attributes */ | ||
| 203 | const struct attribute_group **tty_groups; /* all attributes (serial core use only) */ | ||
| 202 | void *private_data; /* generic platform data pointer */ | 204 | void *private_data; /* generic platform data pointer */ |
| 203 | }; | 205 | }; |
| 204 | 206 | ||
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h index 4723bbfa1c26..a6e555cbe05c 100644 --- a/include/linux/sfi_acpi.h +++ b/include/linux/sfi_acpi.h | |||
| @@ -63,8 +63,6 @@ | |||
| 63 | #include <linux/sfi.h> | 63 | #include <linux/sfi.h> |
| 64 | 64 | ||
| 65 | #ifdef CONFIG_SFI | 65 | #ifdef CONFIG_SFI |
| 66 | #include <acpi/acpi.h> /* FIXME: inclusion should be removed */ | ||
| 67 | |||
| 68 | extern int sfi_acpi_table_parse(char *signature, char *oem_id, | 66 | extern int sfi_acpi_table_parse(char *signature, char *oem_id, |
| 69 | char *oem_table_id, | 67 | char *oem_table_id, |
| 70 | int (*handler)(struct acpi_table_header *)); | 68 | int (*handler)(struct acpi_table_header *)); |
| @@ -78,7 +76,6 @@ static inline int __init acpi_sfi_table_parse(char *signature, | |||
| 78 | return sfi_acpi_table_parse(signature, NULL, NULL, handler); | 76 | return sfi_acpi_table_parse(signature, NULL, NULL, handler); |
| 79 | } | 77 | } |
| 80 | #else /* !CONFIG_SFI */ | 78 | #else /* !CONFIG_SFI */ |
| 81 | |||
| 82 | static inline int sfi_acpi_table_parse(char *signature, char *oem_id, | 79 | static inline int sfi_acpi_table_parse(char *signature, char *oem_id, |
| 83 | char *oem_table_id, | 80 | char *oem_table_id, |
| 84 | int (*handler)(struct acpi_table_header *)) | 81 | int (*handler)(struct acpi_table_header *)) |
diff --git a/include/linux/sh_timer.h b/include/linux/sh_timer.h index 8e1e036d6d45..64638b058076 100644 --- a/include/linux/sh_timer.h +++ b/include/linux/sh_timer.h | |||
| @@ -2,11 +2,6 @@ | |||
| 2 | #define __SH_TIMER_H__ | 2 | #define __SH_TIMER_H__ |
| 3 | 3 | ||
| 4 | struct sh_timer_config { | 4 | struct sh_timer_config { |
| 5 | char *name; | ||
| 6 | long channel_offset; | ||
| 7 | int timer_bit; | ||
| 8 | unsigned long clockevent_rating; | ||
| 9 | unsigned long clocksource_rating; | ||
| 10 | unsigned int channels_mask; | 5 | unsigned int channels_mask; |
| 11 | }; | 6 | }; |
| 12 | 7 | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index ec89301ada41..11c270551d25 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -112,8 +112,7 @@ | |||
| 112 | #define CHECKSUM_COMPLETE 2 | 112 | #define CHECKSUM_COMPLETE 2 |
| 113 | #define CHECKSUM_PARTIAL 3 | 113 | #define CHECKSUM_PARTIAL 3 |
| 114 | 114 | ||
| 115 | #define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \ | 115 | #define SKB_DATA_ALIGN(X) ALIGN(X, SMP_CACHE_BYTES) |
| 116 | ~(SMP_CACHE_BYTES - 1)) | ||
| 117 | #define SKB_WITH_OVERHEAD(X) \ | 116 | #define SKB_WITH_OVERHEAD(X) \ |
| 118 | ((X) - SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) | 117 | ((X) - SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) |
| 119 | #define SKB_MAX_ORDER(X, ORDER) \ | 118 | #define SKB_MAX_ORDER(X, ORDER) \ |
| @@ -211,18 +210,9 @@ static inline void skb_frag_size_sub(skb_frag_t *frag, int delta) | |||
| 211 | * struct skb_shared_hwtstamps - hardware time stamps | 210 | * struct skb_shared_hwtstamps - hardware time stamps |
| 212 | * @hwtstamp: hardware time stamp transformed into duration | 211 | * @hwtstamp: hardware time stamp transformed into duration |
| 213 | * since arbitrary point in time | 212 | * since arbitrary point in time |
| 214 | * @syststamp: hwtstamp transformed to system time base | ||
| 215 | * | 213 | * |
| 216 | * Software time stamps generated by ktime_get_real() are stored in | 214 | * Software time stamps generated by ktime_get_real() are stored in |
| 217 | * skb->tstamp. The relation between the different kinds of time | 215 | * skb->tstamp. |
| 218 | * stamps is as follows: | ||
| 219 | * | ||
| 220 | * syststamp and tstamp can be compared against each other in | ||
| 221 | * arbitrary combinations. The accuracy of a | ||
| 222 | * syststamp/tstamp/"syststamp from other device" comparison is | ||
| 223 | * limited by the accuracy of the transformation into system time | ||
| 224 | * base. This depends on the device driver and its underlying | ||
| 225 | * hardware. | ||
| 226 | * | 216 | * |
| 227 | * hwtstamps can only be compared against other hwtstamps from | 217 | * hwtstamps can only be compared against other hwtstamps from |
| 228 | * the same device. | 218 | * the same device. |
| @@ -232,7 +222,6 @@ static inline void skb_frag_size_sub(skb_frag_t *frag, int delta) | |||
| 232 | */ | 222 | */ |
| 233 | struct skb_shared_hwtstamps { | 223 | struct skb_shared_hwtstamps { |
| 234 | ktime_t hwtstamp; | 224 | ktime_t hwtstamp; |
| 235 | ktime_t syststamp; | ||
| 236 | }; | 225 | }; |
| 237 | 226 | ||
| 238 | /* Definitions for tx_flags in struct skb_shared_info */ | 227 | /* Definitions for tx_flags in struct skb_shared_info */ |
| @@ -240,7 +229,7 @@ enum { | |||
| 240 | /* generate hardware time stamp */ | 229 | /* generate hardware time stamp */ |
| 241 | SKBTX_HW_TSTAMP = 1 << 0, | 230 | SKBTX_HW_TSTAMP = 1 << 0, |
| 242 | 231 | ||
| 243 | /* generate software time stamp */ | 232 | /* generate software time stamp when queueing packet to NIC */ |
| 244 | SKBTX_SW_TSTAMP = 1 << 1, | 233 | SKBTX_SW_TSTAMP = 1 << 1, |
| 245 | 234 | ||
| 246 | /* device driver is going to provide hardware time stamp */ | 235 | /* device driver is going to provide hardware time stamp */ |
| @@ -258,8 +247,19 @@ enum { | |||
| 258 | * all frags to avoid possible bad checksum | 247 | * all frags to avoid possible bad checksum |
| 259 | */ | 248 | */ |
| 260 | SKBTX_SHARED_FRAG = 1 << 5, | 249 | SKBTX_SHARED_FRAG = 1 << 5, |
| 250 | |||
| 251 | /* generate software time stamp when entering packet scheduling */ | ||
| 252 | SKBTX_SCHED_TSTAMP = 1 << 6, | ||
| 253 | |||
| 254 | /* generate software timestamp on peer data acknowledgment */ | ||
| 255 | SKBTX_ACK_TSTAMP = 1 << 7, | ||
| 261 | }; | 256 | }; |
| 262 | 257 | ||
| 258 | #define SKBTX_ANY_SW_TSTAMP (SKBTX_SW_TSTAMP | \ | ||
| 259 | SKBTX_SCHED_TSTAMP | \ | ||
| 260 | SKBTX_ACK_TSTAMP) | ||
| 261 | #define SKBTX_ANY_TSTAMP (SKBTX_HW_TSTAMP | SKBTX_ANY_SW_TSTAMP) | ||
| 262 | |||
| 263 | /* | 263 | /* |
| 264 | * The callback notifies userspace to release buffers when skb DMA is done in | 264 | * The callback notifies userspace to release buffers when skb DMA is done in |
| 265 | * lower device, the skb last reference should be 0 when calling this. | 265 | * lower device, the skb last reference should be 0 when calling this. |
| @@ -286,6 +286,7 @@ struct skb_shared_info { | |||
| 286 | unsigned short gso_type; | 286 | unsigned short gso_type; |
| 287 | struct sk_buff *frag_list; | 287 | struct sk_buff *frag_list; |
| 288 | struct skb_shared_hwtstamps hwtstamps; | 288 | struct skb_shared_hwtstamps hwtstamps; |
| 289 | u32 tskey; | ||
| 289 | __be32 ip6_frag_id; | 290 | __be32 ip6_frag_id; |
| 290 | 291 | ||
| 291 | /* | 292 | /* |
| @@ -455,6 +456,7 @@ static inline u32 skb_mstamp_us_delta(const struct skb_mstamp *t1, | |||
| 455 | * @ooo_okay: allow the mapping of a socket to a queue to be changed | 456 | * @ooo_okay: allow the mapping of a socket to a queue to be changed |
| 456 | * @l4_hash: indicate hash is a canonical 4-tuple hash over transport | 457 | * @l4_hash: indicate hash is a canonical 4-tuple hash over transport |
| 457 | * ports. | 458 | * ports. |
| 459 | * @sw_hash: indicates hash was computed in software stack | ||
| 458 | * @wifi_acked_valid: wifi_acked was set | 460 | * @wifi_acked_valid: wifi_acked was set |
| 459 | * @wifi_acked: whether frame was acked on wifi or not | 461 | * @wifi_acked: whether frame was acked on wifi or not |
| 460 | * @no_fcs: Request NIC to treat last 4 bytes as Ethernet FCS | 462 | * @no_fcs: Request NIC to treat last 4 bytes as Ethernet FCS |
| @@ -562,6 +564,7 @@ struct sk_buff { | |||
| 562 | __u8 pfmemalloc:1; | 564 | __u8 pfmemalloc:1; |
| 563 | __u8 ooo_okay:1; | 565 | __u8 ooo_okay:1; |
| 564 | __u8 l4_hash:1; | 566 | __u8 l4_hash:1; |
| 567 | __u8 sw_hash:1; | ||
| 565 | __u8 wifi_acked_valid:1; | 568 | __u8 wifi_acked_valid:1; |
| 566 | __u8 wifi_acked:1; | 569 | __u8 wifi_acked:1; |
| 567 | __u8 no_fcs:1; | 570 | __u8 no_fcs:1; |
| @@ -575,7 +578,7 @@ struct sk_buff { | |||
| 575 | __u8 encap_hdr_csum:1; | 578 | __u8 encap_hdr_csum:1; |
| 576 | __u8 csum_valid:1; | 579 | __u8 csum_valid:1; |
| 577 | __u8 csum_complete_sw:1; | 580 | __u8 csum_complete_sw:1; |
| 578 | /* 3/5 bit hole (depending on ndisc_nodetype presence) */ | 581 | /* 2/4 bit hole (depending on ndisc_nodetype presence) */ |
| 579 | kmemcheck_bitfield_end(flags2); | 582 | kmemcheck_bitfield_end(flags2); |
| 580 | 583 | ||
| 581 | #if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL | 584 | #if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL |
| @@ -830,13 +833,14 @@ static inline void | |||
| 830 | skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type) | 833 | skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type) |
| 831 | { | 834 | { |
| 832 | skb->l4_hash = (type == PKT_HASH_TYPE_L4); | 835 | skb->l4_hash = (type == PKT_HASH_TYPE_L4); |
| 836 | skb->sw_hash = 0; | ||
| 833 | skb->hash = hash; | 837 | skb->hash = hash; |
| 834 | } | 838 | } |
| 835 | 839 | ||
| 836 | void __skb_get_hash(struct sk_buff *skb); | 840 | void __skb_get_hash(struct sk_buff *skb); |
| 837 | static inline __u32 skb_get_hash(struct sk_buff *skb) | 841 | static inline __u32 skb_get_hash(struct sk_buff *skb) |
| 838 | { | 842 | { |
| 839 | if (!skb->l4_hash) | 843 | if (!skb->l4_hash && !skb->sw_hash) |
| 840 | __skb_get_hash(skb); | 844 | __skb_get_hash(skb); |
| 841 | 845 | ||
| 842 | return skb->hash; | 846 | return skb->hash; |
| @@ -850,6 +854,7 @@ static inline __u32 skb_get_hash_raw(const struct sk_buff *skb) | |||
| 850 | static inline void skb_clear_hash(struct sk_buff *skb) | 854 | static inline void skb_clear_hash(struct sk_buff *skb) |
| 851 | { | 855 | { |
| 852 | skb->hash = 0; | 856 | skb->hash = 0; |
| 857 | skb->sw_hash = 0; | ||
| 853 | skb->l4_hash = 0; | 858 | skb->l4_hash = 0; |
| 854 | } | 859 | } |
| 855 | 860 | ||
| @@ -862,6 +867,7 @@ static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb) | |||
| 862 | static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from) | 867 | static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from) |
| 863 | { | 868 | { |
| 864 | to->hash = from->hash; | 869 | to->hash = from->hash; |
| 870 | to->sw_hash = from->sw_hash; | ||
| 865 | to->l4_hash = from->l4_hash; | 871 | to->l4_hash = from->l4_hash; |
| 866 | }; | 872 | }; |
| 867 | 873 | ||
| @@ -2697,6 +2703,10 @@ static inline bool skb_defer_rx_timestamp(struct sk_buff *skb) | |||
| 2697 | void skb_complete_tx_timestamp(struct sk_buff *skb, | 2703 | void skb_complete_tx_timestamp(struct sk_buff *skb, |
| 2698 | struct skb_shared_hwtstamps *hwtstamps); | 2704 | struct skb_shared_hwtstamps *hwtstamps); |
| 2699 | 2705 | ||
| 2706 | void __skb_tstamp_tx(struct sk_buff *orig_skb, | ||
| 2707 | struct skb_shared_hwtstamps *hwtstamps, | ||
| 2708 | struct sock *sk, int tstype); | ||
| 2709 | |||
| 2700 | /** | 2710 | /** |
| 2701 | * skb_tstamp_tx - queue clone of skb with send time stamps | 2711 | * skb_tstamp_tx - queue clone of skb with send time stamps |
| 2702 | * @orig_skb: the original outgoing packet | 2712 | * @orig_skb: the original outgoing packet |
| @@ -3005,7 +3015,7 @@ static inline bool skb_rx_queue_recorded(const struct sk_buff *skb) | |||
| 3005 | return skb->queue_mapping != 0; | 3015 | return skb->queue_mapping != 0; |
| 3006 | } | 3016 | } |
| 3007 | 3017 | ||
| 3008 | u16 __skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb, | 3018 | u16 __skb_tx_hash(const struct net_device *dev, struct sk_buff *skb, |
| 3009 | unsigned int num_tx_queues); | 3019 | unsigned int num_tx_queues); |
| 3010 | 3020 | ||
| 3011 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | 3021 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) |
diff --git a/include/linux/spi/cc2520.h b/include/linux/spi/cc2520.h new file mode 100644 index 000000000000..85b8ee67e937 --- /dev/null +++ b/include/linux/spi/cc2520.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* Header file for cc2520 radio driver | ||
| 2 | * | ||
| 3 | * Copyright (C) 2014 Varka Bhadram <varkab@cdac.in> | ||
| 4 | * Md.Jamal Mohiuddin <mjmohiuddin@cdac.in> | ||
| 5 | * P Sowjanya <sowjanyap@cdac.in> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __CC2520_H | ||
| 15 | #define __CC2520_H | ||
| 16 | |||
| 17 | struct cc2520_platform_data { | ||
| 18 | int fifo; | ||
| 19 | int fifop; | ||
| 20 | int cca; | ||
| 21 | int sfd; | ||
| 22 | int reset; | ||
| 23 | int vreg; | ||
| 24 | }; | ||
| 25 | |||
| 26 | #endif | ||
diff --git a/include/linux/spi/sh_msiof.h b/include/linux/spi/sh_msiof.h index 2e8db3d2d2e5..88a14d81c49e 100644 --- a/include/linux/spi/sh_msiof.h +++ b/include/linux/spi/sh_msiof.h | |||
| @@ -5,6 +5,8 @@ struct sh_msiof_spi_info { | |||
| 5 | int tx_fifo_override; | 5 | int tx_fifo_override; |
| 6 | int rx_fifo_override; | 6 | int rx_fifo_override; |
| 7 | u16 num_chipselect; | 7 | u16 num_chipselect; |
| 8 | unsigned int dma_tx_id; | ||
| 9 | unsigned int dma_rx_id; | ||
| 8 | }; | 10 | }; |
| 9 | 11 | ||
| 10 | #endif /* __SPI_SH_MSIOF_H__ */ | 12 | #endif /* __SPI_SH_MSIOF_H__ */ |
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index f9f931c89e3e..f7b9100686c3 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
| @@ -345,6 +345,43 @@ | |||
| 345 | #define SSB_SPROM4_TXPID5GH2_SHIFT 0 | 345 | #define SSB_SPROM4_TXPID5GH2_SHIFT 0 |
| 346 | #define SSB_SPROM4_TXPID5GH3 0xFF00 | 346 | #define SSB_SPROM4_TXPID5GH3 0xFF00 |
| 347 | #define SSB_SPROM4_TXPID5GH3_SHIFT 8 | 347 | #define SSB_SPROM4_TXPID5GH3_SHIFT 8 |
| 348 | |||
| 349 | /* There are 4 blocks with power info sharing the same layout */ | ||
| 350 | #define SSB_SPROM4_PWR_INFO_CORE0 0x0080 | ||
| 351 | #define SSB_SPROM4_PWR_INFO_CORE1 0x00AE | ||
| 352 | #define SSB_SPROM4_PWR_INFO_CORE2 0x00DC | ||
| 353 | #define SSB_SPROM4_PWR_INFO_CORE3 0x010A | ||
| 354 | |||
| 355 | #define SSB_SPROM4_2G_MAXP_ITSSI 0x00 /* 2 GHz ITSSI and 2 GHz Max Power */ | ||
| 356 | #define SSB_SPROM4_2G_MAXP 0x00FF | ||
| 357 | #define SSB_SPROM4_2G_ITSSI 0xFF00 | ||
| 358 | #define SSB_SPROM4_2G_ITSSI_SHIFT 8 | ||
| 359 | #define SSB_SPROM4_2G_PA_0 0x02 /* 2 GHz power amp */ | ||
| 360 | #define SSB_SPROM4_2G_PA_1 0x04 | ||
| 361 | #define SSB_SPROM4_2G_PA_2 0x06 | ||
| 362 | #define SSB_SPROM4_2G_PA_3 0x08 | ||
| 363 | #define SSB_SPROM4_5G_MAXP_ITSSI 0x0A /* 5 GHz ITSSI and 5.3 GHz Max Power */ | ||
| 364 | #define SSB_SPROM4_5G_MAXP 0x00FF | ||
| 365 | #define SSB_SPROM4_5G_ITSSI 0xFF00 | ||
| 366 | #define SSB_SPROM4_5G_ITSSI_SHIFT 8 | ||
| 367 | #define SSB_SPROM4_5GHL_MAXP 0x0C /* 5.2 GHz and 5.8 GHz Max Power */ | ||
| 368 | #define SSB_SPROM4_5GH_MAXP 0x00FF | ||
| 369 | #define SSB_SPROM4_5GL_MAXP 0xFF00 | ||
| 370 | #define SSB_SPROM4_5GL_MAXP_SHIFT 8 | ||
| 371 | #define SSB_SPROM4_5G_PA_0 0x0E /* 5.3 GHz power amp */ | ||
| 372 | #define SSB_SPROM4_5G_PA_1 0x10 | ||
| 373 | #define SSB_SPROM4_5G_PA_2 0x12 | ||
| 374 | #define SSB_SPROM4_5G_PA_3 0x14 | ||
| 375 | #define SSB_SPROM4_5GL_PA_0 0x16 /* 5.2 GHz power amp */ | ||
| 376 | #define SSB_SPROM4_5GL_PA_1 0x18 | ||
| 377 | #define SSB_SPROM4_5GL_PA_2 0x1A | ||
| 378 | #define SSB_SPROM4_5GL_PA_3 0x1C | ||
| 379 | #define SSB_SPROM4_5GH_PA_0 0x1E /* 5.8 GHz power amp */ | ||
| 380 | #define SSB_SPROM4_5GH_PA_1 0x20 | ||
| 381 | #define SSB_SPROM4_5GH_PA_2 0x22 | ||
| 382 | #define SSB_SPROM4_5GH_PA_3 0x24 | ||
| 383 | |||
| 384 | /* TODO: Make it deprecated */ | ||
| 348 | #define SSB_SPROM4_MAXP_BG 0x0080 /* Max Power BG in path 1 */ | 385 | #define SSB_SPROM4_MAXP_BG 0x0080 /* Max Power BG in path 1 */ |
| 349 | #define SSB_SPROM4_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ | 386 | #define SSB_SPROM4_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ |
| 350 | #define SSB_SPROM4_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ | 387 | #define SSB_SPROM4_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ |
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 6f27d4f957bd..cd63851b57f2 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
| @@ -112,6 +112,8 @@ struct plat_stmmacenet_data { | |||
| 112 | int riwt_off; | 112 | int riwt_off; |
| 113 | int max_speed; | 113 | int max_speed; |
| 114 | int maxmtu; | 114 | int maxmtu; |
| 115 | int multicast_filter_bins; | ||
| 116 | int unicast_filter_entries; | ||
| 115 | void (*fix_mac_speed)(void *priv, unsigned int speed); | 117 | void (*fix_mac_speed)(void *priv, unsigned int speed); |
| 116 | void (*bus_setup)(void __iomem *ioaddr); | 118 | void (*bus_setup)(void __iomem *ioaddr); |
| 117 | void *(*setup)(struct platform_device *pdev); | 119 | void *(*setup)(struct platform_device *pdev); |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index ad7dbe2cfecd..1a8959944c5f 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
| @@ -236,7 +236,7 @@ void * rpc_malloc(struct rpc_task *, size_t); | |||
| 236 | void rpc_free(void *); | 236 | void rpc_free(void *); |
| 237 | int rpciod_up(void); | 237 | int rpciod_up(void); |
| 238 | void rpciod_down(void); | 238 | void rpciod_down(void); |
| 239 | int __rpc_wait_for_completion_task(struct rpc_task *task, int (*)(void *)); | 239 | int __rpc_wait_for_completion_task(struct rpc_task *task, wait_bit_action_f *); |
| 240 | #ifdef RPC_DEBUG | 240 | #ifdef RPC_DEBUG |
| 241 | struct net; | 241 | struct net; |
| 242 | void rpc_show_tasks(struct net *); | 242 | void rpc_show_tasks(struct net *); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index b0881a0ed322..701daff5d899 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -866,4 +866,9 @@ asmlinkage long sys_process_vm_writev(pid_t pid, | |||
| 866 | asmlinkage long sys_kcmp(pid_t pid1, pid_t pid2, int type, | 866 | asmlinkage long sys_kcmp(pid_t pid1, pid_t pid2, int type, |
| 867 | unsigned long idx1, unsigned long idx2); | 867 | unsigned long idx1, unsigned long idx2); |
| 868 | asmlinkage long sys_finit_module(int fd, const char __user *uargs, int flags); | 868 | asmlinkage long sys_finit_module(int fd, const char __user *uargs, int flags); |
| 869 | asmlinkage long sys_seccomp(unsigned int op, unsigned int flags, | ||
| 870 | const char __user *uargs); | ||
| 871 | asmlinkage long sys_getrandom(char __user *buf, size_t count, | ||
| 872 | unsigned int flags); | ||
| 873 | |||
| 869 | #endif | 874 | #endif |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index a0513210798f..fa5258f322e7 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
| @@ -111,10 +111,7 @@ struct tcp_request_sock_ops; | |||
| 111 | 111 | ||
| 112 | struct tcp_request_sock { | 112 | struct tcp_request_sock { |
| 113 | struct inet_request_sock req; | 113 | struct inet_request_sock req; |
| 114 | #ifdef CONFIG_TCP_MD5SIG | ||
| 115 | /* Only used by TCP MD5 Signature so far. */ | ||
| 116 | const struct tcp_request_sock_ops *af_specific; | 114 | const struct tcp_request_sock_ops *af_specific; |
| 117 | #endif | ||
| 118 | struct sock *listener; /* needed for TFO */ | 115 | struct sock *listener; /* needed for TFO */ |
| 119 | u32 rcv_isn; | 116 | u32 rcv_isn; |
| 120 | u32 snt_isn; | 117 | u32 snt_isn; |
diff --git a/include/linux/tick.h b/include/linux/tick.h index b84773cb9f4c..059052306831 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/hrtimer.h> | 12 | #include <linux/hrtimer.h> |
| 13 | #include <linux/context_tracking_state.h> | 13 | #include <linux/context_tracking_state.h> |
| 14 | #include <linux/cpumask.h> | 14 | #include <linux/cpumask.h> |
| 15 | #include <linux/sched.h> | ||
| 15 | 16 | ||
| 16 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 17 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
| 17 | 18 | ||
| @@ -162,6 +163,7 @@ static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; } | |||
| 162 | #ifdef CONFIG_NO_HZ_FULL | 163 | #ifdef CONFIG_NO_HZ_FULL |
| 163 | extern bool tick_nohz_full_running; | 164 | extern bool tick_nohz_full_running; |
| 164 | extern cpumask_var_t tick_nohz_full_mask; | 165 | extern cpumask_var_t tick_nohz_full_mask; |
| 166 | extern cpumask_var_t housekeeping_mask; | ||
| 165 | 167 | ||
| 166 | static inline bool tick_nohz_full_enabled(void) | 168 | static inline bool tick_nohz_full_enabled(void) |
| 167 | { | 169 | { |
| @@ -181,7 +183,13 @@ static inline bool tick_nohz_full_cpu(int cpu) | |||
| 181 | 183 | ||
| 182 | extern void tick_nohz_init(void); | 184 | extern void tick_nohz_init(void); |
| 183 | extern void __tick_nohz_full_check(void); | 185 | extern void __tick_nohz_full_check(void); |
| 184 | extern void tick_nohz_full_kick(void); | 186 | extern void tick_nohz_full_kick_cpu(int cpu); |
| 187 | |||
| 188 | static inline void tick_nohz_full_kick(void) | ||
| 189 | { | ||
| 190 | tick_nohz_full_kick_cpu(smp_processor_id()); | ||
| 191 | } | ||
| 192 | |||
| 185 | extern void tick_nohz_full_kick_all(void); | 193 | extern void tick_nohz_full_kick_all(void); |
| 186 | extern void __tick_nohz_task_switch(struct task_struct *tsk); | 194 | extern void __tick_nohz_task_switch(struct task_struct *tsk); |
| 187 | #else | 195 | #else |
| @@ -189,11 +197,30 @@ static inline void tick_nohz_init(void) { } | |||
| 189 | static inline bool tick_nohz_full_enabled(void) { return false; } | 197 | static inline bool tick_nohz_full_enabled(void) { return false; } |
| 190 | static inline bool tick_nohz_full_cpu(int cpu) { return false; } | 198 | static inline bool tick_nohz_full_cpu(int cpu) { return false; } |
| 191 | static inline void __tick_nohz_full_check(void) { } | 199 | static inline void __tick_nohz_full_check(void) { } |
| 200 | static inline void tick_nohz_full_kick_cpu(int cpu) { } | ||
| 192 | static inline void tick_nohz_full_kick(void) { } | 201 | static inline void tick_nohz_full_kick(void) { } |
| 193 | static inline void tick_nohz_full_kick_all(void) { } | 202 | static inline void tick_nohz_full_kick_all(void) { } |
| 194 | static inline void __tick_nohz_task_switch(struct task_struct *tsk) { } | 203 | static inline void __tick_nohz_task_switch(struct task_struct *tsk) { } |
| 195 | #endif | 204 | #endif |
| 196 | 205 | ||
| 206 | static inline bool is_housekeeping_cpu(int cpu) | ||
| 207 | { | ||
| 208 | #ifdef CONFIG_NO_HZ_FULL | ||
| 209 | if (tick_nohz_full_enabled()) | ||
| 210 | return cpumask_test_cpu(cpu, housekeeping_mask); | ||
| 211 | #endif | ||
| 212 | return true; | ||
| 213 | } | ||
| 214 | |||
| 215 | static inline void housekeeping_affine(struct task_struct *t) | ||
| 216 | { | ||
| 217 | #ifdef CONFIG_NO_HZ_FULL | ||
| 218 | if (tick_nohz_full_enabled()) | ||
| 219 | set_cpus_allowed_ptr(t, housekeeping_mask); | ||
| 220 | |||
| 221 | #endif | ||
| 222 | } | ||
| 223 | |||
| 197 | static inline void tick_nohz_full_check(void) | 224 | static inline void tick_nohz_full_check(void) |
| 198 | { | 225 | { |
| 199 | if (tick_nohz_full_enabled()) | 226 | if (tick_nohz_full_enabled()) |
diff --git a/include/linux/time.h b/include/linux/time.h index d5d229b2e5af..8c42cf8d2444 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -4,19 +4,10 @@ | |||
| 4 | # include <linux/cache.h> | 4 | # include <linux/cache.h> |
| 5 | # include <linux/seqlock.h> | 5 | # include <linux/seqlock.h> |
| 6 | # include <linux/math64.h> | 6 | # include <linux/math64.h> |
| 7 | #include <uapi/linux/time.h> | 7 | # include <linux/time64.h> |
| 8 | 8 | ||
| 9 | extern struct timezone sys_tz; | 9 | extern struct timezone sys_tz; |
| 10 | 10 | ||
| 11 | /* Parameters used to convert the timespec values: */ | ||
| 12 | #define MSEC_PER_SEC 1000L | ||
| 13 | #define USEC_PER_MSEC 1000L | ||
| 14 | #define NSEC_PER_USEC 1000L | ||
| 15 | #define NSEC_PER_MSEC 1000000L | ||
| 16 | #define USEC_PER_SEC 1000000L | ||
| 17 | #define NSEC_PER_SEC 1000000000L | ||
| 18 | #define FSEC_PER_SEC 1000000000000000LL | ||
| 19 | |||
| 20 | #define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1) | 11 | #define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1) |
| 21 | 12 | ||
| 22 | static inline int timespec_equal(const struct timespec *a, | 13 | static inline int timespec_equal(const struct timespec *a, |
| @@ -84,13 +75,6 @@ static inline struct timespec timespec_sub(struct timespec lhs, | |||
| 84 | return ts_delta; | 75 | return ts_delta; |
| 85 | } | 76 | } |
| 86 | 77 | ||
| 87 | #define KTIME_MAX ((s64)~((u64)1 << 63)) | ||
| 88 | #if (BITS_PER_LONG == 64) | ||
| 89 | # define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) | ||
| 90 | #else | ||
| 91 | # define KTIME_SEC_MAX LONG_MAX | ||
| 92 | #endif | ||
| 93 | |||
| 94 | /* | 78 | /* |
| 95 | * Returns true if the timespec is norm, false if denorm: | 79 | * Returns true if the timespec is norm, false if denorm: |
| 96 | */ | 80 | */ |
| @@ -115,27 +99,7 @@ static inline bool timespec_valid_strict(const struct timespec *ts) | |||
| 115 | return true; | 99 | return true; |
| 116 | } | 100 | } |
| 117 | 101 | ||
| 118 | extern bool persistent_clock_exist; | 102 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); |
| 119 | |||
| 120 | static inline bool has_persistent_clock(void) | ||
| 121 | { | ||
| 122 | return persistent_clock_exist; | ||
| 123 | } | ||
| 124 | |||
| 125 | extern void read_persistent_clock(struct timespec *ts); | ||
| 126 | extern void read_boot_clock(struct timespec *ts); | ||
| 127 | extern int persistent_clock_is_local; | ||
| 128 | extern int update_persistent_clock(struct timespec now); | ||
| 129 | void timekeeping_init(void); | ||
| 130 | extern int timekeeping_suspended; | ||
| 131 | |||
| 132 | unsigned long get_seconds(void); | ||
| 133 | struct timespec current_kernel_time(void); | ||
| 134 | struct timespec __current_kernel_time(void); /* does not take xtime_lock */ | ||
| 135 | struct timespec get_monotonic_coarse(void); | ||
| 136 | void get_xtime_and_monotonic_and_sleep_offset(struct timespec *xtim, | ||
| 137 | struct timespec *wtom, struct timespec *sleep); | ||
| 138 | void timekeeping_inject_sleeptime(struct timespec *delta); | ||
| 139 | 103 | ||
| 140 | #define CURRENT_TIME (current_kernel_time()) | 104 | #define CURRENT_TIME (current_kernel_time()) |
| 141 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) | 105 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) |
| @@ -153,33 +117,14 @@ void timekeeping_inject_sleeptime(struct timespec *delta); | |||
| 153 | extern u32 (*arch_gettimeoffset)(void); | 117 | extern u32 (*arch_gettimeoffset)(void); |
| 154 | #endif | 118 | #endif |
| 155 | 119 | ||
| 156 | extern void do_gettimeofday(struct timeval *tv); | ||
| 157 | extern int do_settimeofday(const struct timespec *tv); | ||
| 158 | extern int do_sys_settimeofday(const struct timespec *tv, | ||
| 159 | const struct timezone *tz); | ||
| 160 | #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) | ||
| 161 | extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags); | ||
| 162 | struct itimerval; | 120 | struct itimerval; |
| 163 | extern int do_setitimer(int which, struct itimerval *value, | 121 | extern int do_setitimer(int which, struct itimerval *value, |
| 164 | struct itimerval *ovalue); | 122 | struct itimerval *ovalue); |
| 165 | extern unsigned int alarm_setitimer(unsigned int seconds); | ||
| 166 | extern int do_getitimer(int which, struct itimerval *value); | 123 | extern int do_getitimer(int which, struct itimerval *value); |
| 167 | extern int __getnstimeofday(struct timespec *tv); | ||
| 168 | extern void getnstimeofday(struct timespec *tv); | ||
| 169 | extern void getrawmonotonic(struct timespec *ts); | ||
| 170 | extern void getnstime_raw_and_real(struct timespec *ts_raw, | ||
| 171 | struct timespec *ts_real); | ||
| 172 | extern void getboottime(struct timespec *ts); | ||
| 173 | extern void monotonic_to_bootbased(struct timespec *ts); | ||
| 174 | extern void get_monotonic_boottime(struct timespec *ts); | ||
| 175 | 124 | ||
| 176 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | 125 | extern unsigned int alarm_setitimer(unsigned int seconds); |
| 177 | extern int timekeeping_valid_for_hres(void); | 126 | |
| 178 | extern u64 timekeeping_max_deferment(void); | 127 | extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags); |
| 179 | extern int timekeeping_inject_offset(struct timespec *ts); | ||
| 180 | extern s32 timekeeping_get_tai_offset(void); | ||
| 181 | extern void timekeeping_set_tai_offset(s32 tai_offset); | ||
| 182 | extern void timekeeping_clocktai(struct timespec *ts); | ||
| 183 | 128 | ||
| 184 | struct tms; | 129 | struct tms; |
| 185 | extern void do_sys_times(struct tms *); | 130 | extern void do_sys_times(struct tms *); |
diff --git a/include/linux/time64.h b/include/linux/time64.h new file mode 100644 index 000000000000..a3831478d9cf --- /dev/null +++ b/include/linux/time64.h | |||
| @@ -0,0 +1,190 @@ | |||
| 1 | #ifndef _LINUX_TIME64_H | ||
| 2 | #define _LINUX_TIME64_H | ||
| 3 | |||
| 4 | #include <uapi/linux/time.h> | ||
| 5 | |||
| 6 | typedef __s64 time64_t; | ||
| 7 | |||
| 8 | /* | ||
| 9 | * This wants to go into uapi/linux/time.h once we agreed about the | ||
| 10 | * userspace interfaces. | ||
| 11 | */ | ||
| 12 | #if __BITS_PER_LONG == 64 | ||
| 13 | # define timespec64 timespec | ||
| 14 | #else | ||
| 15 | struct timespec64 { | ||
| 16 | time64_t tv_sec; /* seconds */ | ||
| 17 | long tv_nsec; /* nanoseconds */ | ||
| 18 | }; | ||
| 19 | #endif | ||
| 20 | |||
| 21 | /* Parameters used to convert the timespec values: */ | ||
| 22 | #define MSEC_PER_SEC 1000L | ||
| 23 | #define USEC_PER_MSEC 1000L | ||
| 24 | #define NSEC_PER_USEC 1000L | ||
| 25 | #define NSEC_PER_MSEC 1000000L | ||
| 26 | #define USEC_PER_SEC 1000000L | ||
| 27 | #define NSEC_PER_SEC 1000000000L | ||
| 28 | #define FSEC_PER_SEC 1000000000000000LL | ||
| 29 | |||
| 30 | /* Located here for timespec[64]_valid_strict */ | ||
| 31 | #define KTIME_MAX ((s64)~((u64)1 << 63)) | ||
| 32 | #define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) | ||
| 33 | |||
| 34 | #if __BITS_PER_LONG == 64 | ||
| 35 | |||
| 36 | static inline struct timespec timespec64_to_timespec(const struct timespec64 ts64) | ||
| 37 | { | ||
| 38 | return ts64; | ||
| 39 | } | ||
| 40 | |||
| 41 | static inline struct timespec64 timespec_to_timespec64(const struct timespec ts) | ||
| 42 | { | ||
| 43 | return ts; | ||
| 44 | } | ||
| 45 | |||
| 46 | # define timespec64_equal timespec_equal | ||
| 47 | # define timespec64_compare timespec_compare | ||
| 48 | # define set_normalized_timespec64 set_normalized_timespec | ||
| 49 | # define timespec64_add_safe timespec_add_safe | ||
| 50 | # define timespec64_add timespec_add | ||
| 51 | # define timespec64_sub timespec_sub | ||
| 52 | # define timespec64_valid timespec_valid | ||
| 53 | # define timespec64_valid_strict timespec_valid_strict | ||
| 54 | # define timespec64_to_ns timespec_to_ns | ||
| 55 | # define ns_to_timespec64 ns_to_timespec | ||
| 56 | # define timespec64_add_ns timespec_add_ns | ||
| 57 | |||
| 58 | #else | ||
| 59 | |||
| 60 | static inline struct timespec timespec64_to_timespec(const struct timespec64 ts64) | ||
| 61 | { | ||
| 62 | struct timespec ret; | ||
| 63 | |||
| 64 | ret.tv_sec = (time_t)ts64.tv_sec; | ||
| 65 | ret.tv_nsec = ts64.tv_nsec; | ||
| 66 | return ret; | ||
| 67 | } | ||
| 68 | |||
| 69 | static inline struct timespec64 timespec_to_timespec64(const struct timespec ts) | ||
| 70 | { | ||
| 71 | struct timespec64 ret; | ||
| 72 | |||
| 73 | ret.tv_sec = ts.tv_sec; | ||
| 74 | ret.tv_nsec = ts.tv_nsec; | ||
| 75 | return ret; | ||
| 76 | } | ||
| 77 | |||
| 78 | static inline int timespec64_equal(const struct timespec64 *a, | ||
| 79 | const struct timespec64 *b) | ||
| 80 | { | ||
| 81 | return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); | ||
| 82 | } | ||
| 83 | |||
| 84 | /* | ||
| 85 | * lhs < rhs: return <0 | ||
| 86 | * lhs == rhs: return 0 | ||
| 87 | * lhs > rhs: return >0 | ||
| 88 | */ | ||
| 89 | static inline int timespec64_compare(const struct timespec64 *lhs, const struct timespec64 *rhs) | ||
| 90 | { | ||
| 91 | if (lhs->tv_sec < rhs->tv_sec) | ||
| 92 | return -1; | ||
| 93 | if (lhs->tv_sec > rhs->tv_sec) | ||
| 94 | return 1; | ||
| 95 | return lhs->tv_nsec - rhs->tv_nsec; | ||
| 96 | } | ||
| 97 | |||
| 98 | extern void set_normalized_timespec64(struct timespec64 *ts, time64_t sec, s64 nsec); | ||
| 99 | |||
| 100 | /* | ||
| 101 | * timespec64_add_safe assumes both values are positive and checks for | ||
| 102 | * overflow. It will return TIME_T_MAX if the returned value would be | ||
| 103 | * smaller then either of the arguments. | ||
| 104 | */ | ||
| 105 | extern struct timespec64 timespec64_add_safe(const struct timespec64 lhs, | ||
| 106 | const struct timespec64 rhs); | ||
| 107 | |||
| 108 | |||
| 109 | static inline struct timespec64 timespec64_add(struct timespec64 lhs, | ||
| 110 | struct timespec64 rhs) | ||
| 111 | { | ||
| 112 | struct timespec64 ts_delta; | ||
| 113 | set_normalized_timespec64(&ts_delta, lhs.tv_sec + rhs.tv_sec, | ||
| 114 | lhs.tv_nsec + rhs.tv_nsec); | ||
| 115 | return ts_delta; | ||
| 116 | } | ||
| 117 | |||
| 118 | /* | ||
| 119 | * sub = lhs - rhs, in normalized form | ||
| 120 | */ | ||
| 121 | static inline struct timespec64 timespec64_sub(struct timespec64 lhs, | ||
| 122 | struct timespec64 rhs) | ||
| 123 | { | ||
| 124 | struct timespec64 ts_delta; | ||
| 125 | set_normalized_timespec64(&ts_delta, lhs.tv_sec - rhs.tv_sec, | ||
| 126 | lhs.tv_nsec - rhs.tv_nsec); | ||
| 127 | return ts_delta; | ||
| 128 | } | ||
| 129 | |||
| 130 | /* | ||
| 131 | * Returns true if the timespec64 is norm, false if denorm: | ||
| 132 | */ | ||
| 133 | static inline bool timespec64_valid(const struct timespec64 *ts) | ||
| 134 | { | ||
| 135 | /* Dates before 1970 are bogus */ | ||
| 136 | if (ts->tv_sec < 0) | ||
| 137 | return false; | ||
| 138 | /* Can't have more nanoseconds then a second */ | ||
| 139 | if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC) | ||
| 140 | return false; | ||
| 141 | return true; | ||
| 142 | } | ||
| 143 | |||
| 144 | static inline bool timespec64_valid_strict(const struct timespec64 *ts) | ||
| 145 | { | ||
| 146 | if (!timespec64_valid(ts)) | ||
| 147 | return false; | ||
| 148 | /* Disallow values that could overflow ktime_t */ | ||
| 149 | if ((unsigned long long)ts->tv_sec >= KTIME_SEC_MAX) | ||
| 150 | return false; | ||
| 151 | return true; | ||
| 152 | } | ||
| 153 | |||
| 154 | /** | ||
| 155 | * timespec64_to_ns - Convert timespec64 to nanoseconds | ||
| 156 | * @ts: pointer to the timespec64 variable to be converted | ||
| 157 | * | ||
| 158 | * Returns the scalar nanosecond representation of the timespec64 | ||
| 159 | * parameter. | ||
| 160 | */ | ||
| 161 | static inline s64 timespec64_to_ns(const struct timespec64 *ts) | ||
| 162 | { | ||
| 163 | return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; | ||
| 164 | } | ||
| 165 | |||
| 166 | /** | ||
| 167 | * ns_to_timespec64 - Convert nanoseconds to timespec64 | ||
| 168 | * @nsec: the nanoseconds value to be converted | ||
| 169 | * | ||
| 170 | * Returns the timespec64 representation of the nsec parameter. | ||
| 171 | */ | ||
| 172 | extern struct timespec64 ns_to_timespec64(const s64 nsec); | ||
| 173 | |||
| 174 | /** | ||
| 175 | * timespec64_add_ns - Adds nanoseconds to a timespec64 | ||
| 176 | * @a: pointer to timespec64 to be incremented | ||
| 177 | * @ns: unsigned nanoseconds value to be added | ||
| 178 | * | ||
| 179 | * This must always be inlined because its used from the x86-64 vdso, | ||
| 180 | * which cannot call other kernel functions. | ||
| 181 | */ | ||
| 182 | static __always_inline void timespec64_add_ns(struct timespec64 *a, u64 ns) | ||
| 183 | { | ||
| 184 | a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, NSEC_PER_SEC, &ns); | ||
| 185 | a->tv_nsec = ns; | ||
| 186 | } | ||
| 187 | |||
| 188 | #endif | ||
| 189 | |||
| 190 | #endif /* _LINUX_TIME64_H */ | ||
diff --git a/include/linux/timekeeper_internal.h b/include/linux/timekeeper_internal.h index c1825eb436ed..95640dcd1899 100644 --- a/include/linux/timekeeper_internal.h +++ b/include/linux/timekeeper_internal.h | |||
| @@ -10,77 +10,100 @@ | |||
| 10 | #include <linux/jiffies.h> | 10 | #include <linux/jiffies.h> |
| 11 | #include <linux/time.h> | 11 | #include <linux/time.h> |
| 12 | 12 | ||
| 13 | /* Structure holding internal timekeeping values. */ | 13 | /** |
| 14 | struct timekeeper { | 14 | * struct tk_read_base - base structure for timekeeping readout |
| 15 | /* Current clocksource used for timekeeping. */ | 15 | * @clock: Current clocksource used for timekeeping. |
| 16 | * @read: Read function of @clock | ||
| 17 | * @mask: Bitmask for two's complement subtraction of non 64bit clocks | ||
| 18 | * @cycle_last: @clock cycle value at last update | ||
| 19 | * @mult: NTP adjusted multiplier for scaled math conversion | ||
| 20 | * @shift: Shift value for scaled math conversion | ||
| 21 | * @xtime_nsec: Shifted (fractional) nano seconds offset for readout | ||
| 22 | * @base_mono: ktime_t (nanoseconds) base time for readout | ||
| 23 | * | ||
| 24 | * This struct has size 56 byte on 64 bit. Together with a seqcount it | ||
| 25 | * occupies a single 64byte cache line. | ||
| 26 | * | ||
| 27 | * The struct is separate from struct timekeeper as it is also used | ||
| 28 | * for a fast NMI safe accessor to clock monotonic. | ||
| 29 | */ | ||
| 30 | struct tk_read_base { | ||
| 16 | struct clocksource *clock; | 31 | struct clocksource *clock; |
| 17 | /* NTP adjusted clock multiplier */ | 32 | cycle_t (*read)(struct clocksource *cs); |
| 33 | cycle_t mask; | ||
| 34 | cycle_t cycle_last; | ||
| 18 | u32 mult; | 35 | u32 mult; |
| 19 | /* The shift value of the current clocksource. */ | ||
| 20 | u32 shift; | 36 | u32 shift; |
| 21 | /* Number of clock cycles in one NTP interval. */ | 37 | u64 xtime_nsec; |
| 38 | ktime_t base_mono; | ||
| 39 | }; | ||
| 40 | |||
| 41 | /** | ||
| 42 | * struct timekeeper - Structure holding internal timekeeping values. | ||
| 43 | * @tkr: The readout base structure | ||
| 44 | * @xtime_sec: Current CLOCK_REALTIME time in seconds | ||
| 45 | * @wall_to_monotonic: CLOCK_REALTIME to CLOCK_MONOTONIC offset | ||
| 46 | * @offs_real: Offset clock monotonic -> clock realtime | ||
| 47 | * @offs_boot: Offset clock monotonic -> clock boottime | ||
| 48 | * @offs_tai: Offset clock monotonic -> clock tai | ||
| 49 | * @tai_offset: The current UTC to TAI offset in seconds | ||
| 50 | * @base_raw: Monotonic raw base time in ktime_t format | ||
| 51 | * @raw_time: Monotonic raw base time in timespec64 format | ||
| 52 | * @cycle_interval: Number of clock cycles in one NTP interval | ||
| 53 | * @xtime_interval: Number of clock shifted nano seconds in one NTP | ||
| 54 | * interval. | ||
| 55 | * @xtime_remainder: Shifted nano seconds left over when rounding | ||
| 56 | * @cycle_interval | ||
| 57 | * @raw_interval: Raw nano seconds accumulated per NTP interval. | ||
| 58 | * @ntp_error: Difference between accumulated time and NTP time in ntp | ||
| 59 | * shifted nano seconds. | ||
| 60 | * @ntp_error_shift: Shift conversion between clock shifted nano seconds and | ||
| 61 | * ntp shifted nano seconds. | ||
| 62 | * | ||
| 63 | * Note: For timespec(64) based interfaces wall_to_monotonic is what | ||
| 64 | * we need to add to xtime (or xtime corrected for sub jiffie times) | ||
| 65 | * to get to monotonic time. Monotonic is pegged at zero at system | ||
| 66 | * boot time, so wall_to_monotonic will be negative, however, we will | ||
| 67 | * ALWAYS keep the tv_nsec part positive so we can use the usual | ||
| 68 | * normalization. | ||
| 69 | * | ||
| 70 | * wall_to_monotonic is moved after resume from suspend for the | ||
| 71 | * monotonic time not to jump. We need to add total_sleep_time to | ||
| 72 | * wall_to_monotonic to get the real boot based time offset. | ||
| 73 | * | ||
| 74 | * wall_to_monotonic is no longer the boot time, getboottime must be | ||
| 75 | * used instead. | ||
| 76 | */ | ||
| 77 | struct timekeeper { | ||
| 78 | struct tk_read_base tkr; | ||
| 79 | u64 xtime_sec; | ||
| 80 | struct timespec64 wall_to_monotonic; | ||
| 81 | ktime_t offs_real; | ||
| 82 | ktime_t offs_boot; | ||
| 83 | ktime_t offs_tai; | ||
| 84 | s32 tai_offset; | ||
| 85 | ktime_t base_raw; | ||
| 86 | struct timespec64 raw_time; | ||
| 87 | |||
| 88 | /* The following members are for timekeeping internal use */ | ||
| 22 | cycle_t cycle_interval; | 89 | cycle_t cycle_interval; |
| 23 | /* Last cycle value (also stored in clock->cycle_last) */ | ||
| 24 | cycle_t cycle_last; | ||
| 25 | /* Number of clock shifted nano seconds in one NTP interval. */ | ||
| 26 | u64 xtime_interval; | 90 | u64 xtime_interval; |
| 27 | /* shifted nano seconds left over when rounding cycle_interval */ | ||
| 28 | s64 xtime_remainder; | 91 | s64 xtime_remainder; |
| 29 | /* Raw nano seconds accumulated per NTP interval. */ | ||
| 30 | u32 raw_interval; | 92 | u32 raw_interval; |
| 31 | 93 | /* The ntp_tick_length() value currently being used. | |
| 32 | /* Current CLOCK_REALTIME time in seconds */ | 94 | * This cached copy ensures we consistently apply the tick |
| 33 | u64 xtime_sec; | 95 | * length for an entire tick, as ntp_tick_length may change |
| 34 | /* Clock shifted nano seconds */ | 96 | * mid-tick, and we don't want to apply that new value to |
| 35 | u64 xtime_nsec; | 97 | * the tick in progress. |
| 36 | 98 | */ | |
| 99 | u64 ntp_tick; | ||
| 37 | /* Difference between accumulated time and NTP time in ntp | 100 | /* Difference between accumulated time and NTP time in ntp |
| 38 | * shifted nano seconds. */ | 101 | * shifted nano seconds. */ |
| 39 | s64 ntp_error; | 102 | s64 ntp_error; |
| 40 | /* Shift conversion between clock shifted nano seconds and | ||
| 41 | * ntp shifted nano seconds. */ | ||
| 42 | u32 ntp_error_shift; | 103 | u32 ntp_error_shift; |
| 43 | 104 | u32 ntp_err_mult; | |
| 44 | /* | ||
| 45 | * wall_to_monotonic is what we need to add to xtime (or xtime corrected | ||
| 46 | * for sub jiffie times) to get to monotonic time. Monotonic is pegged | ||
| 47 | * at zero at system boot time, so wall_to_monotonic will be negative, | ||
| 48 | * however, we will ALWAYS keep the tv_nsec part positive so we can use | ||
| 49 | * the usual normalization. | ||
| 50 | * | ||
| 51 | * wall_to_monotonic is moved after resume from suspend for the | ||
| 52 | * monotonic time not to jump. We need to add total_sleep_time to | ||
| 53 | * wall_to_monotonic to get the real boot based time offset. | ||
| 54 | * | ||
| 55 | * - wall_to_monotonic is no longer the boot time, getboottime must be | ||
| 56 | * used instead. | ||
| 57 | */ | ||
| 58 | struct timespec wall_to_monotonic; | ||
| 59 | /* Offset clock monotonic -> clock realtime */ | ||
| 60 | ktime_t offs_real; | ||
| 61 | /* time spent in suspend */ | ||
| 62 | struct timespec total_sleep_time; | ||
| 63 | /* Offset clock monotonic -> clock boottime */ | ||
| 64 | ktime_t offs_boot; | ||
| 65 | /* The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. */ | ||
| 66 | struct timespec raw_time; | ||
| 67 | /* The current UTC to TAI offset in seconds */ | ||
| 68 | s32 tai_offset; | ||
| 69 | /* Offset clock monotonic -> clock tai */ | ||
| 70 | ktime_t offs_tai; | ||
| 71 | |||
| 72 | }; | 105 | }; |
| 73 | 106 | ||
| 74 | static inline struct timespec tk_xtime(struct timekeeper *tk) | ||
| 75 | { | ||
| 76 | struct timespec ts; | ||
| 77 | |||
| 78 | ts.tv_sec = tk->xtime_sec; | ||
| 79 | ts.tv_nsec = (long)(tk->xtime_nsec >> tk->shift); | ||
| 80 | return ts; | ||
| 81 | } | ||
| 82 | |||
| 83 | |||
| 84 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL | 107 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL |
| 85 | 108 | ||
| 86 | extern void update_vsyscall(struct timekeeper *tk); | 109 | extern void update_vsyscall(struct timekeeper *tk); |
| @@ -89,17 +112,10 @@ extern void update_vsyscall_tz(void); | |||
| 89 | #elif defined(CONFIG_GENERIC_TIME_VSYSCALL_OLD) | 112 | #elif defined(CONFIG_GENERIC_TIME_VSYSCALL_OLD) |
| 90 | 113 | ||
| 91 | extern void update_vsyscall_old(struct timespec *ts, struct timespec *wtm, | 114 | extern void update_vsyscall_old(struct timespec *ts, struct timespec *wtm, |
| 92 | struct clocksource *c, u32 mult); | 115 | struct clocksource *c, u32 mult, |
| 116 | cycle_t cycle_last); | ||
| 93 | extern void update_vsyscall_tz(void); | 117 | extern void update_vsyscall_tz(void); |
| 94 | 118 | ||
| 95 | static inline void update_vsyscall(struct timekeeper *tk) | ||
| 96 | { | ||
| 97 | struct timespec xt; | ||
| 98 | |||
| 99 | xt = tk_xtime(tk); | ||
| 100 | update_vsyscall_old(&xt, &tk->wall_to_monotonic, tk->clock, tk->mult); | ||
| 101 | } | ||
| 102 | |||
| 103 | #else | 119 | #else |
| 104 | 120 | ||
| 105 | static inline void update_vsyscall(struct timekeeper *tk) | 121 | static inline void update_vsyscall(struct timekeeper *tk) |
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h new file mode 100644 index 000000000000..1caa6b04fdc5 --- /dev/null +++ b/include/linux/timekeeping.h | |||
| @@ -0,0 +1,209 @@ | |||
| 1 | #ifndef _LINUX_TIMEKEEPING_H | ||
| 2 | #define _LINUX_TIMEKEEPING_H | ||
| 3 | |||
| 4 | /* Included from linux/ktime.h */ | ||
| 5 | |||
| 6 | void timekeeping_init(void); | ||
| 7 | extern int timekeeping_suspended; | ||
| 8 | |||
| 9 | /* | ||
| 10 | * Get and set timeofday | ||
| 11 | */ | ||
| 12 | extern void do_gettimeofday(struct timeval *tv); | ||
| 13 | extern int do_settimeofday(const struct timespec *tv); | ||
| 14 | extern int do_sys_settimeofday(const struct timespec *tv, | ||
| 15 | const struct timezone *tz); | ||
| 16 | |||
| 17 | /* | ||
| 18 | * Kernel time accessors | ||
| 19 | */ | ||
| 20 | unsigned long get_seconds(void); | ||
| 21 | struct timespec current_kernel_time(void); | ||
| 22 | /* does not take xtime_lock */ | ||
| 23 | struct timespec __current_kernel_time(void); | ||
| 24 | |||
| 25 | /* | ||
| 26 | * timespec based interfaces | ||
| 27 | */ | ||
| 28 | struct timespec get_monotonic_coarse(void); | ||
| 29 | extern void getrawmonotonic(struct timespec *ts); | ||
| 30 | extern void ktime_get_ts64(struct timespec64 *ts); | ||
| 31 | |||
| 32 | extern int __getnstimeofday64(struct timespec64 *tv); | ||
| 33 | extern void getnstimeofday64(struct timespec64 *tv); | ||
| 34 | |||
| 35 | #if BITS_PER_LONG == 64 | ||
| 36 | static inline int __getnstimeofday(struct timespec *ts) | ||
| 37 | { | ||
| 38 | return __getnstimeofday64(ts); | ||
| 39 | } | ||
| 40 | |||
| 41 | static inline void getnstimeofday(struct timespec *ts) | ||
| 42 | { | ||
| 43 | getnstimeofday64(ts); | ||
| 44 | } | ||
| 45 | |||
| 46 | static inline void ktime_get_ts(struct timespec *ts) | ||
| 47 | { | ||
| 48 | ktime_get_ts64(ts); | ||
| 49 | } | ||
| 50 | |||
| 51 | static inline void ktime_get_real_ts(struct timespec *ts) | ||
| 52 | { | ||
| 53 | getnstimeofday64(ts); | ||
| 54 | } | ||
| 55 | |||
| 56 | #else | ||
| 57 | static inline int __getnstimeofday(struct timespec *ts) | ||
| 58 | { | ||
| 59 | struct timespec64 ts64; | ||
| 60 | int ret = __getnstimeofday64(&ts64); | ||
| 61 | |||
| 62 | *ts = timespec64_to_timespec(ts64); | ||
| 63 | return ret; | ||
| 64 | } | ||
| 65 | |||
| 66 | static inline void getnstimeofday(struct timespec *ts) | ||
| 67 | { | ||
| 68 | struct timespec64 ts64; | ||
| 69 | |||
| 70 | getnstimeofday64(&ts64); | ||
| 71 | *ts = timespec64_to_timespec(ts64); | ||
| 72 | } | ||
| 73 | |||
| 74 | static inline void ktime_get_ts(struct timespec *ts) | ||
| 75 | { | ||
| 76 | struct timespec64 ts64; | ||
| 77 | |||
| 78 | ktime_get_ts64(&ts64); | ||
| 79 | *ts = timespec64_to_timespec(ts64); | ||
| 80 | } | ||
| 81 | |||
| 82 | static inline void ktime_get_real_ts(struct timespec *ts) | ||
| 83 | { | ||
| 84 | struct timespec64 ts64; | ||
| 85 | |||
| 86 | getnstimeofday64(&ts64); | ||
| 87 | *ts = timespec64_to_timespec(ts64); | ||
| 88 | } | ||
| 89 | #endif | ||
| 90 | |||
| 91 | extern void getboottime(struct timespec *ts); | ||
| 92 | |||
| 93 | #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) | ||
| 94 | #define ktime_get_real_ts64(ts) getnstimeofday64(ts) | ||
| 95 | |||
| 96 | /* | ||
| 97 | * ktime_t based interfaces | ||
| 98 | */ | ||
| 99 | |||
| 100 | enum tk_offsets { | ||
| 101 | TK_OFFS_REAL, | ||
| 102 | TK_OFFS_BOOT, | ||
| 103 | TK_OFFS_TAI, | ||
| 104 | TK_OFFS_MAX, | ||
| 105 | }; | ||
| 106 | |||
| 107 | extern ktime_t ktime_get(void); | ||
| 108 | extern ktime_t ktime_get_with_offset(enum tk_offsets offs); | ||
| 109 | extern ktime_t ktime_mono_to_any(ktime_t tmono, enum tk_offsets offs); | ||
| 110 | extern ktime_t ktime_get_raw(void); | ||
| 111 | |||
| 112 | /** | ||
| 113 | * ktime_get_real - get the real (wall-) time in ktime_t format | ||
| 114 | */ | ||
| 115 | static inline ktime_t ktime_get_real(void) | ||
| 116 | { | ||
| 117 | return ktime_get_with_offset(TK_OFFS_REAL); | ||
| 118 | } | ||
| 119 | |||
| 120 | /** | ||
| 121 | * ktime_get_boottime - Returns monotonic time since boot in ktime_t format | ||
| 122 | * | ||
| 123 | * This is similar to CLOCK_MONTONIC/ktime_get, but also includes the | ||
| 124 | * time spent in suspend. | ||
| 125 | */ | ||
| 126 | static inline ktime_t ktime_get_boottime(void) | ||
| 127 | { | ||
| 128 | return ktime_get_with_offset(TK_OFFS_BOOT); | ||
| 129 | } | ||
| 130 | |||
| 131 | /** | ||
| 132 | * ktime_get_clocktai - Returns the TAI time of day in ktime_t format | ||
| 133 | */ | ||
| 134 | static inline ktime_t ktime_get_clocktai(void) | ||
| 135 | { | ||
| 136 | return ktime_get_with_offset(TK_OFFS_TAI); | ||
| 137 | } | ||
| 138 | |||
| 139 | /** | ||
| 140 | * ktime_mono_to_real - Convert monotonic time to clock realtime | ||
| 141 | */ | ||
| 142 | static inline ktime_t ktime_mono_to_real(ktime_t mono) | ||
| 143 | { | ||
| 144 | return ktime_mono_to_any(mono, TK_OFFS_REAL); | ||
| 145 | } | ||
| 146 | |||
| 147 | static inline u64 ktime_get_ns(void) | ||
| 148 | { | ||
| 149 | return ktime_to_ns(ktime_get()); | ||
| 150 | } | ||
| 151 | |||
| 152 | static inline u64 ktime_get_real_ns(void) | ||
| 153 | { | ||
| 154 | return ktime_to_ns(ktime_get_real()); | ||
| 155 | } | ||
| 156 | |||
| 157 | static inline u64 ktime_get_boot_ns(void) | ||
| 158 | { | ||
| 159 | return ktime_to_ns(ktime_get_boottime()); | ||
| 160 | } | ||
| 161 | |||
| 162 | static inline u64 ktime_get_raw_ns(void) | ||
| 163 | { | ||
| 164 | return ktime_to_ns(ktime_get_raw()); | ||
| 165 | } | ||
| 166 | |||
| 167 | extern u64 ktime_get_mono_fast_ns(void); | ||
| 168 | |||
| 169 | /* | ||
| 170 | * Timespec interfaces utilizing the ktime based ones | ||
| 171 | */ | ||
| 172 | static inline void get_monotonic_boottime(struct timespec *ts) | ||
| 173 | { | ||
| 174 | *ts = ktime_to_timespec(ktime_get_boottime()); | ||
| 175 | } | ||
| 176 | |||
| 177 | static inline void timekeeping_clocktai(struct timespec *ts) | ||
| 178 | { | ||
| 179 | *ts = ktime_to_timespec(ktime_get_clocktai()); | ||
| 180 | } | ||
| 181 | |||
| 182 | /* | ||
| 183 | * RTC specific | ||
| 184 | */ | ||
| 185 | extern void timekeeping_inject_sleeptime(struct timespec *delta); | ||
| 186 | |||
| 187 | /* | ||
| 188 | * PPS accessor | ||
| 189 | */ | ||
| 190 | extern void getnstime_raw_and_real(struct timespec *ts_raw, | ||
| 191 | struct timespec *ts_real); | ||
| 192 | |||
| 193 | /* | ||
| 194 | * Persistent clock related interfaces | ||
| 195 | */ | ||
| 196 | extern bool persistent_clock_exist; | ||
| 197 | extern int persistent_clock_is_local; | ||
| 198 | |||
| 199 | static inline bool has_persistent_clock(void) | ||
| 200 | { | ||
| 201 | return persistent_clock_exist; | ||
| 202 | } | ||
| 203 | |||
| 204 | extern void read_persistent_clock(struct timespec *ts); | ||
| 205 | extern void read_boot_clock(struct timespec *ts); | ||
| 206 | extern int update_persistent_clock(struct timespec now); | ||
| 207 | |||
| 208 | |||
| 209 | #endif | ||
diff --git a/include/linux/timerfd.h b/include/linux/timerfd.h index d3b57fa12225..bd36ce431e32 100644 --- a/include/linux/timerfd.h +++ b/include/linux/timerfd.h | |||
| @@ -11,6 +11,9 @@ | |||
| 11 | /* For O_CLOEXEC and O_NONBLOCK */ | 11 | /* For O_CLOEXEC and O_NONBLOCK */ |
| 12 | #include <linux/fcntl.h> | 12 | #include <linux/fcntl.h> |
| 13 | 13 | ||
| 14 | /* For _IO helpers */ | ||
| 15 | #include <linux/ioctl.h> | ||
| 16 | |||
| 14 | /* | 17 | /* |
| 15 | * CAREFUL: Check include/asm-generic/fcntl.h when defining | 18 | * CAREFUL: Check include/asm-generic/fcntl.h when defining |
| 16 | * new flags, since they might collide with O_* ones. We want | 19 | * new flags, since they might collide with O_* ones. We want |
| @@ -29,4 +32,6 @@ | |||
| 29 | /* Flags for timerfd_settime. */ | 32 | /* Flags for timerfd_settime. */ |
| 30 | #define TFD_SETTIME_FLAGS (TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET) | 33 | #define TFD_SETTIME_FLAGS (TFD_TIMER_ABSTIME | TFD_TIMER_CANCEL_ON_SET) |
| 31 | 34 | ||
| 35 | #define TFD_IOC_SET_TICKS _IOW('T', 0, u64) | ||
| 36 | |||
| 32 | #endif /* _LINUX_TIMERFD_H */ | 37 | #endif /* _LINUX_TIMERFD_H */ |
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index fff1d0976f80..8350c538b486 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h | |||
| @@ -39,6 +39,9 @@ struct tpm_class_ops { | |||
| 39 | int (*send) (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); | 40 | void (*cancel) (struct tpm_chip *chip); |
| 41 | u8 (*status) (struct tpm_chip *chip); | 41 | u8 (*status) (struct tpm_chip *chip); |
| 42 | bool (*update_timeouts)(struct tpm_chip *chip, | ||
| 43 | unsigned long *timeout_cap); | ||
| 44 | |||
| 42 | }; | 45 | }; |
| 43 | 46 | ||
| 44 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) | 47 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) |
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index 136116924d8d..ea6c9dea79e3 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h | |||
| @@ -25,6 +25,21 @@ trace_seq_init(struct trace_seq *s) | |||
| 25 | s->full = 0; | 25 | s->full = 0; |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | /** | ||
| 29 | * trace_seq_buffer_ptr - return pointer to next location in buffer | ||
| 30 | * @s: trace sequence descriptor | ||
| 31 | * | ||
| 32 | * Returns the pointer to the buffer where the next write to | ||
| 33 | * the buffer will happen. This is useful to save the location | ||
| 34 | * that is about to be written to and then return the result | ||
| 35 | * of that write. | ||
| 36 | */ | ||
| 37 | static inline unsigned char * | ||
| 38 | trace_seq_buffer_ptr(struct trace_seq *s) | ||
| 39 | { | ||
| 40 | return s->buffer + s->len; | ||
| 41 | } | ||
| 42 | |||
| 28 | /* | 43 | /* |
| 29 | * Currently only defined when tracing is enabled. | 44 | * Currently only defined when tracing is enabled. |
| 30 | */ | 45 | */ |
| @@ -36,14 +51,13 @@ int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args); | |||
| 36 | extern int | 51 | extern int |
| 37 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); | 52 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); |
| 38 | extern int trace_print_seq(struct seq_file *m, struct trace_seq *s); | 53 | extern int trace_print_seq(struct seq_file *m, struct trace_seq *s); |
| 39 | extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | 54 | extern int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, |
| 40 | size_t cnt); | 55 | int cnt); |
| 41 | extern int trace_seq_puts(struct trace_seq *s, const char *str); | 56 | extern int trace_seq_puts(struct trace_seq *s, const char *str); |
| 42 | extern int trace_seq_putc(struct trace_seq *s, unsigned char c); | 57 | extern int trace_seq_putc(struct trace_seq *s, unsigned char c); |
| 43 | extern int trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len); | 58 | extern int trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len); |
| 44 | extern int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, | 59 | extern int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, |
| 45 | size_t len); | 60 | unsigned int len); |
| 46 | extern void *trace_seq_reserve(struct trace_seq *s, size_t len); | ||
| 47 | extern int trace_seq_path(struct trace_seq *s, const struct path *path); | 61 | extern int trace_seq_path(struct trace_seq *s, const struct path *path); |
| 48 | 62 | ||
| 49 | extern int trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp, | 63 | extern int trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp, |
| @@ -71,8 +85,8 @@ static inline int trace_print_seq(struct seq_file *m, struct trace_seq *s) | |||
| 71 | { | 85 | { |
| 72 | return 0; | 86 | return 0; |
| 73 | } | 87 | } |
| 74 | static inline ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | 88 | static inline int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, |
| 75 | size_t cnt) | 89 | int cnt) |
| 76 | { | 90 | { |
| 77 | return 0; | 91 | return 0; |
| 78 | } | 92 | } |
| @@ -85,19 +99,15 @@ static inline int trace_seq_putc(struct trace_seq *s, unsigned char c) | |||
| 85 | return 0; | 99 | return 0; |
| 86 | } | 100 | } |
| 87 | static inline int | 101 | static inline int |
| 88 | trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len) | 102 | trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len) |
| 89 | { | 103 | { |
| 90 | return 0; | 104 | return 0; |
| 91 | } | 105 | } |
| 92 | static inline int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, | 106 | static inline int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, |
| 93 | size_t len) | 107 | unsigned int len) |
| 94 | { | 108 | { |
| 95 | return 0; | 109 | return 0; |
| 96 | } | 110 | } |
| 97 | static inline void *trace_seq_reserve(struct trace_seq *s, size_t len) | ||
| 98 | { | ||
| 99 | return NULL; | ||
| 100 | } | ||
| 101 | static inline int trace_seq_path(struct trace_seq *s, const struct path *path) | 111 | static inline int trace_seq_path(struct trace_seq *s, const struct path *path) |
| 102 | { | 112 | { |
| 103 | return 0; | 113 | return 0; |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 1c3316a47d7e..84132942902a 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -477,13 +477,11 @@ extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file, | |||
| 477 | unsigned int cmd, unsigned long arg); | 477 | unsigned int cmd, unsigned long arg); |
| 478 | extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg); | 478 | extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg); |
| 479 | extern void tty_default_fops(struct file_operations *fops); | 479 | extern void tty_default_fops(struct file_operations *fops); |
| 480 | extern struct tty_struct *alloc_tty_struct(void); | 480 | extern struct tty_struct *alloc_tty_struct(struct tty_driver *driver, int idx); |
| 481 | extern int tty_alloc_file(struct file *file); | 481 | extern int tty_alloc_file(struct file *file); |
| 482 | extern void tty_add_file(struct tty_struct *tty, struct file *file); | 482 | extern void tty_add_file(struct tty_struct *tty, struct file *file); |
| 483 | extern void tty_free_file(struct file *file); | 483 | extern void tty_free_file(struct file *file); |
| 484 | extern void free_tty_struct(struct tty_struct *tty); | 484 | extern void free_tty_struct(struct tty_struct *tty); |
| 485 | extern void initialize_tty_struct(struct tty_struct *tty, | ||
| 486 | struct tty_driver *driver, int idx); | ||
| 487 | extern void deinitialize_tty_struct(struct tty_struct *tty); | 485 | extern void deinitialize_tty_struct(struct tty_struct *tty); |
| 488 | extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx); | 486 | extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx); |
| 489 | extern int tty_release(struct inode *inode, struct file *filp); | 487 | extern int tty_release(struct inode *inode, struct file *filp); |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 756a60989294..e48c608a8fa8 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
| @@ -35,14 +35,14 @@ | |||
| 35 | * This routine is mandatory; if this routine is not filled in, | 35 | * This routine is mandatory; if this routine is not filled in, |
| 36 | * the attempted open will fail with ENODEV. | 36 | * the attempted open will fail with ENODEV. |
| 37 | * | 37 | * |
| 38 | * Required method. | 38 | * Required method. Called with tty lock held. |
| 39 | * | 39 | * |
| 40 | * void (*close)(struct tty_struct * tty, struct file * filp); | 40 | * void (*close)(struct tty_struct * tty, struct file * filp); |
| 41 | * | 41 | * |
| 42 | * This routine is called when a particular tty device is closed. | 42 | * This routine is called when a particular tty device is closed. |
| 43 | * Note: called even if the corresponding open() failed. | 43 | * Note: called even if the corresponding open() failed. |
| 44 | * | 44 | * |
| 45 | * Required method. | 45 | * Required method. Called with tty lock held. |
| 46 | * | 46 | * |
| 47 | * void (*shutdown)(struct tty_struct * tty); | 47 | * void (*shutdown)(struct tty_struct * tty); |
| 48 | * | 48 | * |
| @@ -172,6 +172,8 @@ | |||
| 172 | * | 172 | * |
| 173 | * Optional: | 173 | * Optional: |
| 174 | * | 174 | * |
| 175 | * Called with tty lock held. | ||
| 176 | * | ||
| 175 | * int (*break_ctl)(struct tty_struct *tty, int state); | 177 | * int (*break_ctl)(struct tty_struct *tty, int state); |
| 176 | * | 178 | * |
| 177 | * This optional routine requests the tty driver to turn on or | 179 | * This optional routine requests the tty driver to turn on or |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 7373203140e7..c330f5ef42cf 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -386,6 +386,21 @@ struct usb_composite_driver { | |||
| 386 | 386 | ||
| 387 | extern int usb_composite_probe(struct usb_composite_driver *driver); | 387 | extern int usb_composite_probe(struct usb_composite_driver *driver); |
| 388 | extern void usb_composite_unregister(struct usb_composite_driver *driver); | 388 | extern void usb_composite_unregister(struct usb_composite_driver *driver); |
| 389 | |||
| 390 | /** | ||
| 391 | * module_usb_composite_driver() - Helper macro for registering a USB gadget | ||
| 392 | * composite driver | ||
| 393 | * @__usb_composite_driver: usb_composite_driver struct | ||
| 394 | * | ||
| 395 | * Helper macro for USB gadget composite drivers which do not do anything | ||
| 396 | * special in module init/exit. This eliminates a lot of boilerplate. Each | ||
| 397 | * module may only use this macro once, and calling it replaces module_init() | ||
| 398 | * and module_exit() | ||
| 399 | */ | ||
| 400 | #define module_usb_composite_driver(__usb_composite_driver) \ | ||
| 401 | module_driver(__usb_composite_driver, usb_composite_probe, \ | ||
| 402 | usb_composite_unregister) | ||
| 403 | |||
| 389 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | 404 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); |
| 390 | extern int composite_dev_prepare(struct usb_composite_driver *composite, | 405 | extern int composite_dev_prepare(struct usb_composite_driver *composite, |
| 391 | struct usb_composite_dev *cdev); | 406 | struct usb_composite_dev *cdev); |
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h index 52f944dfe2fd..55a17b188daa 100644 --- a/include/linux/usb/quirks.h +++ b/include/linux/usb/quirks.h | |||
| @@ -30,4 +30,15 @@ | |||
| 30 | descriptor */ | 30 | descriptor */ |
| 31 | #define USB_QUIRK_DELAY_INIT 0x00000040 | 31 | #define USB_QUIRK_DELAY_INIT 0x00000040 |
| 32 | 32 | ||
| 33 | /* | ||
| 34 | * For high speed and super speed interupt endpoints, the USB 2.0 and | ||
| 35 | * USB 3.0 spec require the interval in microframes | ||
| 36 | * (1 microframe = 125 microseconds) to be calculated as | ||
| 37 | * interval = 2 ^ (bInterval-1). | ||
| 38 | * | ||
| 39 | * Devices with this quirk report their bInterval as the result of this | ||
| 40 | * calculation instead of the exponent variable used in the calculation. | ||
| 41 | */ | ||
| 42 | #define USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL 0x00000080 | ||
| 43 | |||
| 33 | #endif /* __LINUX_USB_QUIRKS_H */ | 44 | #endif /* __LINUX_USB_QUIRKS_H */ |
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h index e452ba6ec6bd..d5952bb66752 100644 --- a/include/linux/usb/renesas_usbhs.h +++ b/include/linux/usb/renesas_usbhs.h | |||
| @@ -153,6 +153,9 @@ struct renesas_usbhs_driver_param { | |||
| 153 | */ | 153 | */ |
| 154 | int pio_dma_border; /* default is 64byte */ | 154 | int pio_dma_border; /* default is 64byte */ |
| 155 | 155 | ||
| 156 | u32 type; | ||
| 157 | u32 enable_gpio; | ||
| 158 | |||
| 156 | /* | 159 | /* |
| 157 | * option: | 160 | * option: |
| 158 | */ | 161 | */ |
| @@ -160,6 +163,9 @@ struct renesas_usbhs_driver_param { | |||
| 160 | u32 has_sudmac:1; /* for SUDMAC */ | 163 | u32 has_sudmac:1; /* for SUDMAC */ |
| 161 | }; | 164 | }; |
| 162 | 165 | ||
| 166 | #define USBHS_TYPE_R8A7790 1 | ||
| 167 | #define USBHS_TYPE_R8A7791 2 | ||
| 168 | |||
| 163 | /* | 169 | /* |
| 164 | * option: | 170 | * option: |
| 165 | * | 171 | * |
diff --git a/include/linux/usb/usb338x.h b/include/linux/usb/usb338x.h new file mode 100644 index 000000000000..f92eb635b9d3 --- /dev/null +++ b/include/linux/usb/usb338x.h | |||
| @@ -0,0 +1,199 @@ | |||
| 1 | /* | ||
| 2 | * USB 338x super/high/full speed USB device controller. | ||
| 3 | * Unlike many such controllers, this one talks PCI. | ||
| 4 | * | ||
| 5 | * Copyright (C) 2002 NetChip Technology, Inc. (http://www.netchip.com) | ||
| 6 | * Copyright (C) 2003 David Brownell | ||
| 7 | * Copyright (C) 2014 Ricardo Ribalda - Qtechnology/AS | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __LINUX_USB_USB338X_H | ||
| 22 | #define __LINUX_USB_USB338X_H | ||
| 23 | |||
| 24 | #include <linux/usb/net2280.h> | ||
| 25 | |||
| 26 | /* | ||
| 27 | * Extra defined bits for net2280 registers | ||
| 28 | */ | ||
| 29 | #define SCRATCH 0x0b | ||
| 30 | |||
| 31 | #define DEFECT7374_FSM_FIELD 28 | ||
| 32 | #define SUPER_SPEED 8 | ||
| 33 | #define DMA_REQUEST_OUTSTANDING 5 | ||
| 34 | #define DMA_PAUSE_DONE_INTERRUPT 26 | ||
| 35 | #define SET_ISOCHRONOUS_DELAY 24 | ||
| 36 | #define SET_SEL 22 | ||
| 37 | #define SUPER_SPEED_MODE 8 | ||
| 38 | |||
| 39 | /*ep_cfg*/ | ||
| 40 | #define MAX_BURST_SIZE 24 | ||
| 41 | #define EP_FIFO_BYTE_COUNT 16 | ||
| 42 | #define IN_ENDPOINT_ENABLE 14 | ||
| 43 | #define IN_ENDPOINT_TYPE 12 | ||
| 44 | #define OUT_ENDPOINT_ENABLE 10 | ||
| 45 | #define OUT_ENDPOINT_TYPE 8 | ||
| 46 | |||
| 47 | struct usb338x_usb_ext_regs { | ||
| 48 | u32 usbclass; | ||
| 49 | #define DEVICE_PROTOCOL 16 | ||
| 50 | #define DEVICE_SUB_CLASS 8 | ||
| 51 | #define DEVICE_CLASS 0 | ||
| 52 | u32 ss_sel; | ||
| 53 | #define U2_SYSTEM_EXIT_LATENCY 8 | ||
| 54 | #define U1_SYSTEM_EXIT_LATENCY 0 | ||
| 55 | u32 ss_del; | ||
| 56 | #define U2_DEVICE_EXIT_LATENCY 8 | ||
| 57 | #define U1_DEVICE_EXIT_LATENCY 0 | ||
| 58 | u32 usb2lpm; | ||
| 59 | #define USB_L1_LPM_HIRD 2 | ||
| 60 | #define USB_L1_LPM_REMOTE_WAKE 1 | ||
| 61 | #define USB_L1_LPM_SUPPORT 0 | ||
| 62 | u32 usb3belt; | ||
| 63 | #define BELT_MULTIPLIER 10 | ||
| 64 | #define BEST_EFFORT_LATENCY_TOLERANCE 0 | ||
| 65 | u32 usbctl2; | ||
| 66 | #define LTM_ENABLE 7 | ||
| 67 | #define U2_ENABLE 6 | ||
| 68 | #define U1_ENABLE 5 | ||
| 69 | #define FUNCTION_SUSPEND 4 | ||
| 70 | #define USB3_CORE_ENABLE 3 | ||
| 71 | #define USB2_CORE_ENABLE 2 | ||
| 72 | #define SERIAL_NUMBER_STRING_ENABLE 0 | ||
| 73 | u32 in_timeout; | ||
| 74 | #define GPEP3_TIMEOUT 19 | ||
| 75 | #define GPEP2_TIMEOUT 18 | ||
| 76 | #define GPEP1_TIMEOUT 17 | ||
| 77 | #define GPEP0_TIMEOUT 16 | ||
| 78 | #define GPEP3_TIMEOUT_VALUE 13 | ||
| 79 | #define GPEP3_TIMEOUT_ENABLE 12 | ||
| 80 | #define GPEP2_TIMEOUT_VALUE 9 | ||
| 81 | #define GPEP2_TIMEOUT_ENABLE 8 | ||
| 82 | #define GPEP1_TIMEOUT_VALUE 5 | ||
| 83 | #define GPEP1_TIMEOUT_ENABLE 4 | ||
| 84 | #define GPEP0_TIMEOUT_VALUE 1 | ||
| 85 | #define GPEP0_TIMEOUT_ENABLE 0 | ||
| 86 | u32 isodelay; | ||
| 87 | #define ISOCHRONOUS_DELAY 0 | ||
| 88 | } __packed; | ||
| 89 | |||
| 90 | struct usb338x_fifo_regs { | ||
| 91 | /* offset 0x0500, 0x0520, 0x0540, 0x0560, 0x0580 */ | ||
| 92 | u32 ep_fifo_size_base; | ||
| 93 | #define IN_FIFO_BASE_ADDRESS 22 | ||
| 94 | #define IN_FIFO_SIZE 16 | ||
| 95 | #define OUT_FIFO_BASE_ADDRESS 6 | ||
| 96 | #define OUT_FIFO_SIZE 0 | ||
| 97 | u32 ep_fifo_out_wrptr; | ||
| 98 | u32 ep_fifo_out_rdptr; | ||
| 99 | u32 ep_fifo_in_wrptr; | ||
| 100 | u32 ep_fifo_in_rdptr; | ||
| 101 | u32 unused[3]; | ||
| 102 | } __packed; | ||
| 103 | |||
| 104 | |||
| 105 | /* Link layer */ | ||
| 106 | struct usb338x_ll_regs { | ||
| 107 | /* offset 0x700 */ | ||
| 108 | u32 ll_ltssm_ctrl1; | ||
| 109 | u32 ll_ltssm_ctrl2; | ||
| 110 | u32 ll_ltssm_ctrl3; | ||
| 111 | u32 unused[2]; | ||
| 112 | u32 ll_general_ctrl0; | ||
| 113 | u32 ll_general_ctrl1; | ||
| 114 | #define PM_U3_AUTO_EXIT 29 | ||
| 115 | #define PM_U2_AUTO_EXIT 28 | ||
| 116 | #define PM_U1_AUTO_EXIT 27 | ||
| 117 | #define PM_FORCE_U2_ENTRY 26 | ||
| 118 | #define PM_FORCE_U1_ENTRY 25 | ||
| 119 | #define PM_LGO_COLLISION_SEND_LAU 24 | ||
| 120 | #define PM_DIR_LINK_REJECT 23 | ||
| 121 | #define PM_FORCE_LINK_ACCEPT 22 | ||
| 122 | #define PM_DIR_ENTRY_U3 20 | ||
| 123 | #define PM_DIR_ENTRY_U2 19 | ||
| 124 | #define PM_DIR_ENTRY_U1 18 | ||
| 125 | #define PM_U2_ENABLE 17 | ||
| 126 | #define PM_U1_ENABLE 16 | ||
| 127 | #define SKP_THRESHOLD_ADJUST_FMW 8 | ||
| 128 | #define RESEND_DPP_ON_LRTY_FMW 7 | ||
| 129 | #define DL_BIT_VALUE_FMW 6 | ||
| 130 | #define FORCE_DL_BIT 5 | ||
| 131 | u32 ll_general_ctrl2; | ||
| 132 | #define SELECT_INVERT_LANE_POLARITY 7 | ||
| 133 | #define FORCE_INVERT_LANE_POLARITY 6 | ||
| 134 | u32 ll_general_ctrl3; | ||
| 135 | u32 ll_general_ctrl4; | ||
| 136 | u32 ll_error_gen; | ||
| 137 | } __packed; | ||
| 138 | |||
| 139 | struct usb338x_ll_lfps_regs { | ||
| 140 | /* offset 0x748 */ | ||
| 141 | u32 ll_lfps_5; | ||
| 142 | #define TIMER_LFPS_6US 16 | ||
| 143 | u32 ll_lfps_6; | ||
| 144 | #define TIMER_LFPS_80US 0 | ||
| 145 | } __packed; | ||
| 146 | |||
| 147 | struct usb338x_ll_tsn_regs { | ||
| 148 | /* offset 0x77C */ | ||
| 149 | u32 ll_tsn_counters_2; | ||
| 150 | #define HOT_TX_NORESET_TS2 24 | ||
| 151 | u32 ll_tsn_counters_3; | ||
| 152 | #define HOT_RX_RESET_TS2 0 | ||
| 153 | } __packed; | ||
| 154 | |||
| 155 | struct usb338x_ll_chi_regs { | ||
| 156 | /* offset 0x79C */ | ||
| 157 | u32 ll_tsn_chicken_bit; | ||
| 158 | #define RECOVERY_IDLE_TO_RECOVER_FMW 3 | ||
| 159 | } __packed; | ||
| 160 | |||
| 161 | /* protocol layer */ | ||
| 162 | struct usb338x_pl_regs { | ||
| 163 | /* offset 0x800 */ | ||
| 164 | u32 pl_reg_1; | ||
| 165 | u32 pl_reg_2; | ||
| 166 | u32 pl_reg_3; | ||
| 167 | u32 pl_reg_4; | ||
| 168 | u32 pl_ep_ctrl; | ||
| 169 | /* Protocol Layer Endpoint Control*/ | ||
| 170 | #define PL_EP_CTRL 0x810 | ||
| 171 | #define ENDPOINT_SELECT 0 | ||
| 172 | /* [4:0] */ | ||
| 173 | #define EP_INITIALIZED 16 | ||
| 174 | #define SEQUENCE_NUMBER_RESET 17 | ||
| 175 | #define CLEAR_ACK_ERROR_CODE 20 | ||
| 176 | u32 pl_reg_6; | ||
| 177 | u32 pl_reg_7; | ||
| 178 | u32 pl_reg_8; | ||
| 179 | u32 pl_ep_status_1; | ||
| 180 | /* Protocol Layer Endpoint Status 1*/ | ||
| 181 | #define PL_EP_STATUS_1 0x820 | ||
| 182 | #define STATE 16 | ||
| 183 | #define ACK_GOOD_NORMAL 0x11 | ||
| 184 | #define ACK_GOOD_MORE_ACKS_TO_COME 0x16 | ||
| 185 | u32 pl_ep_status_2; | ||
| 186 | u32 pl_ep_status_3; | ||
| 187 | /* Protocol Layer Endpoint Status 3*/ | ||
| 188 | #define PL_EP_STATUS_3 0x828 | ||
| 189 | #define SEQUENCE_NUMBER 0 | ||
| 190 | u32 pl_ep_status_4; | ||
| 191 | /* Protocol Layer Endpoint Status 4*/ | ||
| 192 | #define PL_EP_STATUS_4 0x82c | ||
| 193 | u32 pl_ep_cfg_4; | ||
| 194 | /* Protocol Layer Endpoint Configuration 4*/ | ||
| 195 | #define PL_EP_CFG_4 0x830 | ||
| 196 | #define NON_CTRL_IN_TOLERATE_BAD_DIR 6 | ||
| 197 | } __packed; | ||
| 198 | |||
| 199 | #endif /* __LINUX_USB_USB338X_H */ | ||
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 0662e98fef72..26088feb6608 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
| @@ -148,6 +148,9 @@ struct driver_info { | |||
| 148 | struct sk_buff *(*tx_fixup)(struct usbnet *dev, | 148 | struct sk_buff *(*tx_fixup)(struct usbnet *dev, |
| 149 | struct sk_buff *skb, gfp_t flags); | 149 | struct sk_buff *skb, gfp_t flags); |
| 150 | 150 | ||
| 151 | /* recover from timeout */ | ||
| 152 | void (*recover)(struct usbnet *dev); | ||
| 153 | |||
| 151 | /* early initialization code, can sleep. This is for minidrivers | 154 | /* early initialization code, can sleep. This is for minidrivers |
| 152 | * having 'subminidrivers' that need to do extra initialization | 155 | * having 'subminidrivers' that need to do extra initialization |
| 153 | * right after minidriver have initialized hardware. */ | 156 | * right after minidriver have initialized hardware. */ |
diff --git a/include/linux/usb/xhci_pdriver.h b/include/linux/usb/xhci_pdriver.h new file mode 100644 index 000000000000..376654b5b0f7 --- /dev/null +++ b/include/linux/usb/xhci_pdriver.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | /* | ||
| 2 | * This program is free software; you can redistribute it and/or modify | ||
| 3 | * it under the terms of the GNU General Public License version 2 as | ||
| 4 | * published by the Free Software Foundation. | ||
| 5 | * | ||
| 6 | * This program is distributed in the hope that it will be useful, but | ||
| 7 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
| 8 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 9 | * for more details. | ||
| 10 | * | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __USB_CORE_XHCI_PDRIVER_H | ||
| 14 | #define __USB_CORE_XHCI_PDRIVER_H | ||
| 15 | |||
| 16 | /** | ||
| 17 | * struct usb_xhci_pdata - platform_data for generic xhci platform driver | ||
| 18 | * | ||
| 19 | * @usb3_lpm_capable: determines if this xhci platform supports USB3 | ||
| 20 | * LPM capability | ||
| 21 | * | ||
| 22 | */ | ||
| 23 | struct usb_xhci_pdata { | ||
| 24 | unsigned usb3_lpm_capable:1; | ||
| 25 | }; | ||
| 26 | |||
| 27 | #endif /* __USB_CORE_XHCI_PDRIVER_H */ | ||
diff --git a/include/linux/verify_pefile.h b/include/linux/verify_pefile.h new file mode 100644 index 000000000000..ac34819214f9 --- /dev/null +++ b/include/linux/verify_pefile.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /* Signed PE file verification | ||
| 2 | * | ||
| 3 | * Copyright (C) 2014 Red Hat, Inc. All Rights Reserved. | ||
| 4 | * Written by David Howells (dhowells@redhat.com) | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public Licence | ||
| 8 | * as published by the Free Software Foundation; either version | ||
| 9 | * 2 of the Licence, or (at your option) any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef _LINUX_VERIFY_PEFILE_H | ||
| 13 | #define _LINUX_VERIFY_PEFILE_H | ||
| 14 | |||
| 15 | extern int verify_pefile_signature(const void *pebuf, unsigned pelen, | ||
| 16 | struct key *trusted_keyring, bool *_trusted); | ||
| 17 | |||
| 18 | #endif /* _LINUX_VERIFY_PEFILE_H */ | ||
diff --git a/include/linux/wait.h b/include/linux/wait.h index bd68819f0815..6fb1ba5f9b2f 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
| @@ -25,6 +25,7 @@ struct wait_bit_key { | |||
| 25 | void *flags; | 25 | void *flags; |
| 26 | int bit_nr; | 26 | int bit_nr; |
| 27 | #define WAIT_ATOMIC_T_BIT_NR -1 | 27 | #define WAIT_ATOMIC_T_BIT_NR -1 |
| 28 | unsigned long private; | ||
| 28 | }; | 29 | }; |
| 29 | 30 | ||
| 30 | struct wait_bit_queue { | 31 | struct wait_bit_queue { |
| @@ -141,18 +142,19 @@ __remove_wait_queue(wait_queue_head_t *head, wait_queue_t *old) | |||
| 141 | list_del(&old->task_list); | 142 | list_del(&old->task_list); |
| 142 | } | 143 | } |
| 143 | 144 | ||
| 145 | typedef int wait_bit_action_f(struct wait_bit_key *); | ||
| 144 | void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); | 146 | void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); |
| 145 | void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key); | 147 | void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key); |
| 146 | void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, void *key); | 148 | void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, void *key); |
| 147 | void __wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr); | 149 | void __wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr); |
| 148 | void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr); | 150 | void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr); |
| 149 | void __wake_up_bit(wait_queue_head_t *, void *, int); | 151 | void __wake_up_bit(wait_queue_head_t *, void *, int); |
| 150 | int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); | 152 | int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, wait_bit_action_f *, unsigned); |
| 151 | int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); | 153 | int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, wait_bit_action_f *, unsigned); |
| 152 | void wake_up_bit(void *, int); | 154 | void wake_up_bit(void *, int); |
| 153 | void wake_up_atomic_t(atomic_t *); | 155 | void wake_up_atomic_t(atomic_t *); |
| 154 | int out_of_line_wait_on_bit(void *, int, int (*)(void *), unsigned); | 156 | int out_of_line_wait_on_bit(void *, int, wait_bit_action_f *, unsigned); |
| 155 | int out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned); | 157 | int out_of_line_wait_on_bit_lock(void *, int, wait_bit_action_f *, unsigned); |
| 156 | int out_of_line_wait_on_atomic_t(atomic_t *, int (*)(atomic_t *), unsigned); | 158 | int out_of_line_wait_on_atomic_t(atomic_t *, int (*)(atomic_t *), unsigned); |
| 157 | wait_queue_head_t *bit_waitqueue(void *, int); | 159 | wait_queue_head_t *bit_waitqueue(void *, int); |
| 158 | 160 | ||
| @@ -854,11 +856,14 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | |||
| 854 | (wait)->flags = 0; \ | 856 | (wait)->flags = 0; \ |
| 855 | } while (0) | 857 | } while (0) |
| 856 | 858 | ||
| 859 | |||
| 860 | extern int bit_wait(struct wait_bit_key *); | ||
| 861 | extern int bit_wait_io(struct wait_bit_key *); | ||
| 862 | |||
| 857 | /** | 863 | /** |
| 858 | * wait_on_bit - wait for a bit to be cleared | 864 | * wait_on_bit - wait for a bit to be cleared |
| 859 | * @word: the word being waited on, a kernel virtual address | 865 | * @word: the word being waited on, a kernel virtual address |
| 860 | * @bit: the bit of the word being waited on | 866 | * @bit: the bit of the word being waited on |
| 861 | * @action: the function used to sleep, which may take special actions | ||
| 862 | * @mode: the task state to sleep in | 867 | * @mode: the task state to sleep in |
| 863 | * | 868 | * |
| 864 | * There is a standard hashed waitqueue table for generic use. This | 869 | * There is a standard hashed waitqueue table for generic use. This |
| @@ -867,9 +872,62 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | |||
| 867 | * call wait_on_bit() in threads waiting for the bit to clear. | 872 | * call wait_on_bit() in threads waiting for the bit to clear. |
| 868 | * One uses wait_on_bit() where one is waiting for the bit to clear, | 873 | * One uses wait_on_bit() where one is waiting for the bit to clear, |
| 869 | * but has no intention of setting it. | 874 | * but has no intention of setting it. |
| 875 | * Returned value will be zero if the bit was cleared, or non-zero | ||
| 876 | * if the process received a signal and the mode permitted wakeup | ||
| 877 | * on that signal. | ||
| 878 | */ | ||
| 879 | static inline int | ||
| 880 | wait_on_bit(void *word, int bit, unsigned mode) | ||
| 881 | { | ||
| 882 | if (!test_bit(bit, word)) | ||
| 883 | return 0; | ||
| 884 | return out_of_line_wait_on_bit(word, bit, | ||
| 885 | bit_wait, | ||
| 886 | mode); | ||
| 887 | } | ||
| 888 | |||
| 889 | /** | ||
| 890 | * wait_on_bit_io - wait for a bit to be cleared | ||
| 891 | * @word: the word being waited on, a kernel virtual address | ||
| 892 | * @bit: the bit of the word being waited on | ||
| 893 | * @mode: the task state to sleep in | ||
| 894 | * | ||
| 895 | * Use the standard hashed waitqueue table to wait for a bit | ||
| 896 | * to be cleared. This is similar to wait_on_bit(), but calls | ||
| 897 | * io_schedule() instead of schedule() for the actual waiting. | ||
| 898 | * | ||
| 899 | * Returned value will be zero if the bit was cleared, or non-zero | ||
| 900 | * if the process received a signal and the mode permitted wakeup | ||
| 901 | * on that signal. | ||
| 902 | */ | ||
| 903 | static inline int | ||
| 904 | wait_on_bit_io(void *word, int bit, unsigned mode) | ||
| 905 | { | ||
| 906 | if (!test_bit(bit, word)) | ||
| 907 | return 0; | ||
| 908 | return out_of_line_wait_on_bit(word, bit, | ||
| 909 | bit_wait_io, | ||
| 910 | mode); | ||
| 911 | } | ||
| 912 | |||
| 913 | /** | ||
| 914 | * wait_on_bit_action - wait for a bit to be cleared | ||
| 915 | * @word: the word being waited on, a kernel virtual address | ||
| 916 | * @bit: the bit of the word being waited on | ||
| 917 | * @action: the function used to sleep, which may take special actions | ||
| 918 | * @mode: the task state to sleep in | ||
| 919 | * | ||
| 920 | * Use the standard hashed waitqueue table to wait for a bit | ||
| 921 | * to be cleared, and allow the waiting action to be specified. | ||
| 922 | * This is like wait_on_bit() but allows fine control of how the waiting | ||
| 923 | * is done. | ||
| 924 | * | ||
| 925 | * Returned value will be zero if the bit was cleared, or non-zero | ||
| 926 | * if the process received a signal and the mode permitted wakeup | ||
| 927 | * on that signal. | ||
| 870 | */ | 928 | */ |
| 871 | static inline int | 929 | static inline int |
| 872 | wait_on_bit(void *word, int bit, int (*action)(void *), unsigned mode) | 930 | wait_on_bit_action(void *word, int bit, wait_bit_action_f *action, unsigned mode) |
| 873 | { | 931 | { |
| 874 | if (!test_bit(bit, word)) | 932 | if (!test_bit(bit, word)) |
| 875 | return 0; | 933 | return 0; |
| @@ -880,7 +938,6 @@ wait_on_bit(void *word, int bit, int (*action)(void *), unsigned mode) | |||
| 880 | * wait_on_bit_lock - wait for a bit to be cleared, when wanting to set it | 938 | * wait_on_bit_lock - wait for a bit to be cleared, when wanting to set it |
| 881 | * @word: the word being waited on, a kernel virtual address | 939 | * @word: the word being waited on, a kernel virtual address |
| 882 | * @bit: the bit of the word being waited on | 940 | * @bit: the bit of the word being waited on |
| 883 | * @action: the function used to sleep, which may take special actions | ||
| 884 | * @mode: the task state to sleep in | 941 | * @mode: the task state to sleep in |
| 885 | * | 942 | * |
| 886 | * There is a standard hashed waitqueue table for generic use. This | 943 | * There is a standard hashed waitqueue table for generic use. This |
| @@ -891,9 +948,61 @@ wait_on_bit(void *word, int bit, int (*action)(void *), unsigned mode) | |||
| 891 | * wait_on_bit() in threads waiting to be able to set the bit. | 948 | * wait_on_bit() in threads waiting to be able to set the bit. |
| 892 | * One uses wait_on_bit_lock() where one is waiting for the bit to | 949 | * One uses wait_on_bit_lock() where one is waiting for the bit to |
| 893 | * clear with the intention of setting it, and when done, clearing it. | 950 | * clear with the intention of setting it, and when done, clearing it. |
| 951 | * | ||
| 952 | * Returns zero if the bit was (eventually) found to be clear and was | ||
| 953 | * set. Returns non-zero if a signal was delivered to the process and | ||
| 954 | * the @mode allows that signal to wake the process. | ||
| 955 | */ | ||
| 956 | static inline int | ||
| 957 | wait_on_bit_lock(void *word, int bit, unsigned mode) | ||
| 958 | { | ||
| 959 | if (!test_and_set_bit(bit, word)) | ||
| 960 | return 0; | ||
| 961 | return out_of_line_wait_on_bit_lock(word, bit, bit_wait, mode); | ||
| 962 | } | ||
| 963 | |||
| 964 | /** | ||
| 965 | * wait_on_bit_lock_io - wait for a bit to be cleared, when wanting to set it | ||
| 966 | * @word: the word being waited on, a kernel virtual address | ||
| 967 | * @bit: the bit of the word being waited on | ||
| 968 | * @mode: the task state to sleep in | ||
| 969 | * | ||
| 970 | * Use the standard hashed waitqueue table to wait for a bit | ||
| 971 | * to be cleared and then to atomically set it. This is similar | ||
| 972 | * to wait_on_bit(), but calls io_schedule() instead of schedule() | ||
| 973 | * for the actual waiting. | ||
| 974 | * | ||
| 975 | * Returns zero if the bit was (eventually) found to be clear and was | ||
| 976 | * set. Returns non-zero if a signal was delivered to the process and | ||
| 977 | * the @mode allows that signal to wake the process. | ||
| 978 | */ | ||
| 979 | static inline int | ||
| 980 | wait_on_bit_lock_io(void *word, int bit, unsigned mode) | ||
| 981 | { | ||
| 982 | if (!test_and_set_bit(bit, word)) | ||
| 983 | return 0; | ||
| 984 | return out_of_line_wait_on_bit_lock(word, bit, bit_wait_io, mode); | ||
| 985 | } | ||
| 986 | |||
| 987 | /** | ||
| 988 | * wait_on_bit_lock_action - wait for a bit to be cleared, when wanting to set it | ||
| 989 | * @word: the word being waited on, a kernel virtual address | ||
| 990 | * @bit: the bit of the word being waited on | ||
| 991 | * @action: the function used to sleep, which may take special actions | ||
| 992 | * @mode: the task state to sleep in | ||
| 993 | * | ||
| 994 | * Use the standard hashed waitqueue table to wait for a bit | ||
| 995 | * to be cleared and then to set it, and allow the waiting action | ||
| 996 | * to be specified. | ||
| 997 | * This is like wait_on_bit() but allows fine control of how the waiting | ||
| 998 | * is done. | ||
| 999 | * | ||
| 1000 | * Returns zero if the bit was (eventually) found to be clear and was | ||
| 1001 | * set. Returns non-zero if a signal was delivered to the process and | ||
| 1002 | * the @mode allows that signal to wake the process. | ||
| 894 | */ | 1003 | */ |
| 895 | static inline int | 1004 | static inline int |
| 896 | wait_on_bit_lock(void *word, int bit, int (*action)(void *), unsigned mode) | 1005 | wait_on_bit_lock_action(void *word, int bit, wait_bit_action_f *action, unsigned mode) |
| 897 | { | 1006 | { |
| 898 | if (!test_and_set_bit(bit, word)) | 1007 | if (!test_and_set_bit(bit, word)) |
| 899 | return 0; | 1008 | return 0; |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 5777c13849ba..a219be961c0a 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -90,7 +90,6 @@ struct writeback_control { | |||
| 90 | * fs/fs-writeback.c | 90 | * fs/fs-writeback.c |
| 91 | */ | 91 | */ |
| 92 | struct bdi_writeback; | 92 | struct bdi_writeback; |
| 93 | int inode_wait(void *); | ||
| 94 | void writeback_inodes_sb(struct super_block *, enum wb_reason reason); | 93 | void writeback_inodes_sb(struct super_block *, enum wb_reason reason); |
| 95 | void writeback_inodes_sb_nr(struct super_block *, unsigned long nr, | 94 | void writeback_inodes_sb_nr(struct super_block *, unsigned long nr, |
| 96 | enum wb_reason reason); | 95 | enum wb_reason reason); |
| @@ -105,7 +104,7 @@ void inode_wait_for_writeback(struct inode *inode); | |||
| 105 | static inline void wait_on_inode(struct inode *inode) | 104 | static inline void wait_on_inode(struct inode *inode) |
| 106 | { | 105 | { |
| 107 | might_sleep(); | 106 | might_sleep(); |
| 108 | wait_on_bit(&inode->i_state, __I_NEW, inode_wait, TASK_UNINTERRUPTIBLE); | 107 | wait_on_bit(&inode->i_state, __I_NEW, TASK_UNINTERRUPTIBLE); |
| 109 | } | 108 | } |
| 110 | 109 | ||
| 111 | /* | 110 | /* |
diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h index 2b023471ac89..c2e570336269 100644 --- a/include/media/atmel-isi.h +++ b/include/media/atmel-isi.h | |||
| @@ -106,6 +106,8 @@ | |||
| 106 | #define ISI_DATAWIDTH_8 0x01 | 106 | #define ISI_DATAWIDTH_8 0x01 |
| 107 | #define ISI_DATAWIDTH_10 0x02 | 107 | #define ISI_DATAWIDTH_10 0x02 |
| 108 | 108 | ||
| 109 | struct v4l2_async_subdev; | ||
| 110 | |||
| 109 | struct isi_platform_data { | 111 | struct isi_platform_data { |
| 110 | u8 has_emb_sync; | 112 | u8 has_emb_sync; |
| 111 | u8 emb_crc_sync; | 113 | u8 emb_crc_sync; |
| @@ -118,6 +120,8 @@ struct isi_platform_data { | |||
| 118 | u32 frate; | 120 | u32 frate; |
| 119 | /* Using for ISI_MCK */ | 121 | /* Using for ISI_MCK */ |
| 120 | u32 mck_hz; | 122 | u32 mck_hz; |
| 123 | struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */ | ||
| 124 | int *asd_sizes; /* 0-terminated array of asd group sizes */ | ||
| 121 | }; | 125 | }; |
| 122 | 126 | ||
| 123 | #endif /* __ATMEL_ISI_H__ */ | 127 | #endif /* __ATMEL_ISI_H__ */ |
diff --git a/include/media/blackfin/ppi.h b/include/media/blackfin/ppi.h index d0697f4edf87..4900baedd55a 100644 --- a/include/media/blackfin/ppi.h +++ b/include/media/blackfin/ppi.h | |||
| @@ -83,6 +83,7 @@ struct ppi_info { | |||
| 83 | }; | 83 | }; |
| 84 | 84 | ||
| 85 | struct ppi_if { | 85 | struct ppi_if { |
| 86 | struct device *dev; | ||
| 86 | unsigned long ppi_control; | 87 | unsigned long ppi_control; |
| 87 | const struct ppi_ops *ops; | 88 | const struct ppi_ops *ops; |
| 88 | const struct ppi_info *info; | 89 | const struct ppi_info *info; |
| @@ -91,6 +92,7 @@ struct ppi_if { | |||
| 91 | void *priv; | 92 | void *priv; |
| 92 | }; | 93 | }; |
| 93 | 94 | ||
| 94 | struct ppi_if *ppi_create_instance(const struct ppi_info *info); | 95 | struct ppi_if *ppi_create_instance(struct platform_device *pdev, |
| 96 | const struct ppi_info *info); | ||
| 95 | void ppi_delete_instance(struct ppi_if *ppi); | 97 | void ppi_delete_instance(struct ppi_if *ppi); |
| 96 | #endif | 98 | #endif |
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h index e221bc74020b..d8564354debb 100644 --- a/include/media/ir-kbd-i2c.h +++ b/include/media/ir-kbd-i2c.h | |||
| @@ -20,7 +20,8 @@ struct IR_i2c { | |||
| 20 | struct delayed_work work; | 20 | struct delayed_work work; |
| 21 | char name[32]; | 21 | char name[32]; |
| 22 | char phys[32]; | 22 | char phys[32]; |
| 23 | int (*get_key)(struct IR_i2c*, u32*, u32*); | 23 | int (*get_key)(struct IR_i2c *ir, enum rc_type *protocol, |
| 24 | u32 *scancode, u8 *toggle); | ||
| 24 | }; | 25 | }; |
| 25 | 26 | ||
| 26 | enum ir_kbd_get_key_fn { | 27 | enum ir_kbd_get_key_fn { |
| @@ -44,7 +45,8 @@ struct IR_i2c_init_data { | |||
| 44 | * Specify either a function pointer or a value indicating one of | 45 | * Specify either a function pointer or a value indicating one of |
| 45 | * ir_kbd_i2c's internal get_key functions | 46 | * ir_kbd_i2c's internal get_key functions |
| 46 | */ | 47 | */ |
| 47 | int (*get_key)(struct IR_i2c*, u32*, u32*); | 48 | int (*get_key)(struct IR_i2c *ir, enum rc_type *protocol, |
| 49 | u32 *scancode, u8 *toggle); | ||
| 48 | enum ir_kbd_get_key_fn internal_get_key_func; | 50 | enum ir_kbd_get_key_fn internal_get_key_func; |
| 49 | 51 | ||
| 50 | struct rc_dev *rc_dev; | 52 | struct rc_dev *rc_dev; |
diff --git a/include/media/rc-core.h b/include/media/rc-core.h index fde142e5f25a..2c7fbca40b69 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h | |||
| @@ -26,7 +26,7 @@ extern int rc_core_debug; | |||
| 26 | #define IR_dprintk(level, fmt, ...) \ | 26 | #define IR_dprintk(level, fmt, ...) \ |
| 27 | do { \ | 27 | do { \ |
| 28 | if (rc_core_debug >= level) \ | 28 | if (rc_core_debug >= level) \ |
| 29 | pr_debug("%s: " fmt, __func__, ##__VA_ARGS__); \ | 29 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \ |
| 30 | } while (0) | 30 | } while (0) |
| 31 | 31 | ||
| 32 | enum rc_driver_type { | 32 | enum rc_driver_type { |
| @@ -74,21 +74,25 @@ enum rc_filter_type { | |||
| 74 | * @input_dev: the input child device used to communicate events to userspace | 74 | * @input_dev: the input child device used to communicate events to userspace |
| 75 | * @driver_type: specifies if protocol decoding is done in hardware or software | 75 | * @driver_type: specifies if protocol decoding is done in hardware or software |
| 76 | * @idle: used to keep track of RX state | 76 | * @idle: used to keep track of RX state |
| 77 | * @allowed_protocols: bitmask with the supported RC_BIT_* protocols for each | 77 | * @allowed_protocols: bitmask with the supported RC_BIT_* protocols |
| 78 | * filter type | 78 | * @enabled_protocols: bitmask with the enabled RC_BIT_* protocols |
| 79 | * @enabled_protocols: bitmask with the enabled RC_BIT_* protocols for each | 79 | * @allowed_wakeup_protocols: bitmask with the supported RC_BIT_* wakeup protocols |
| 80 | * filter type | 80 | * @enabled_wakeup_protocols: bitmask with the enabled RC_BIT_* wakeup protocols |
| 81 | * @scanmask: some hardware decoders are not capable of providing the full | 81 | * @scancode_filter: scancode filter |
| 82 | * @scancode_wakeup_filter: scancode wakeup filters | ||
| 83 | * @scancode_mask: some hardware decoders are not capable of providing the full | ||
| 82 | * scancode to the application. As this is a hardware limit, we can't do | 84 | * scancode to the application. As this is a hardware limit, we can't do |
| 83 | * anything with it. Yet, as the same keycode table can be used with other | 85 | * anything with it. Yet, as the same keycode table can be used with other |
| 84 | * devices, a mask is provided to allow its usage. Drivers should generally | 86 | * devices, a mask is provided to allow its usage. Drivers should generally |
| 85 | * leave this field in blank | 87 | * leave this field in blank |
| 88 | * @users: number of current users of the device | ||
| 86 | * @priv: driver-specific data | 89 | * @priv: driver-specific data |
| 87 | * @keylock: protects the remaining members of the struct | 90 | * @keylock: protects the remaining members of the struct |
| 88 | * @keypressed: whether a key is currently pressed | 91 | * @keypressed: whether a key is currently pressed |
| 89 | * @keyup_jiffies: time (in jiffies) when the current keypress should be released | 92 | * @keyup_jiffies: time (in jiffies) when the current keypress should be released |
| 90 | * @timer_keyup: timer for releasing a keypress | 93 | * @timer_keyup: timer for releasing a keypress |
| 91 | * @last_keycode: keycode of last keypress | 94 | * @last_keycode: keycode of last keypress |
| 95 | * @last_protocol: protocol of last keypress | ||
| 92 | * @last_scancode: scancode of last keypress | 96 | * @last_scancode: scancode of last keypress |
| 93 | * @last_toggle: toggle value of last command | 97 | * @last_toggle: toggle value of last command |
| 94 | * @timeout: optional time after which device stops sending data | 98 | * @timeout: optional time after which device stops sending data |
| @@ -96,7 +100,6 @@ enum rc_filter_type { | |||
| 96 | * @max_timeout: maximum timeout supported by device | 100 | * @max_timeout: maximum timeout supported by device |
| 97 | * @rx_resolution : resolution (in ns) of input sampler | 101 | * @rx_resolution : resolution (in ns) of input sampler |
| 98 | * @tx_resolution: resolution (in ns) of output sampler | 102 | * @tx_resolution: resolution (in ns) of output sampler |
| 99 | * @scancode_filters: scancode filters (indexed by enum rc_filter_type) | ||
| 100 | * @change_protocol: allow changing the protocol used on hardware decoders | 103 | * @change_protocol: allow changing the protocol used on hardware decoders |
| 101 | * @change_wakeup_protocol: allow changing the protocol used for wakeup | 104 | * @change_wakeup_protocol: allow changing the protocol used for wakeup |
| 102 | * filtering | 105 | * filtering |
| @@ -113,7 +116,7 @@ enum rc_filter_type { | |||
| 113 | * device doesn't interrupt host until it sees IR pulses | 116 | * device doesn't interrupt host until it sees IR pulses |
| 114 | * @s_learning_mode: enable wide band receiver used for learning | 117 | * @s_learning_mode: enable wide band receiver used for learning |
| 115 | * @s_carrier_report: enable carrier reports | 118 | * @s_carrier_report: enable carrier reports |
| 116 | * @s_filter: set the scancode filter | 119 | * @s_filter: set the scancode filter |
| 117 | * @s_wakeup_filter: set the wakeup scancode filter | 120 | * @s_wakeup_filter: set the wakeup scancode filter |
| 118 | */ | 121 | */ |
| 119 | struct rc_dev { | 122 | struct rc_dev { |
| @@ -131,16 +134,21 @@ struct rc_dev { | |||
| 131 | struct input_dev *input_dev; | 134 | struct input_dev *input_dev; |
| 132 | enum rc_driver_type driver_type; | 135 | enum rc_driver_type driver_type; |
| 133 | bool idle; | 136 | bool idle; |
| 134 | u64 allowed_protocols[RC_FILTER_MAX]; | 137 | u64 allowed_protocols; |
| 135 | u64 enabled_protocols[RC_FILTER_MAX]; | 138 | u64 enabled_protocols; |
| 139 | u64 allowed_wakeup_protocols; | ||
| 140 | u64 enabled_wakeup_protocols; | ||
| 141 | struct rc_scancode_filter scancode_filter; | ||
| 142 | struct rc_scancode_filter scancode_wakeup_filter; | ||
| 143 | u32 scancode_mask; | ||
| 136 | u32 users; | 144 | u32 users; |
| 137 | u32 scanmask; | ||
| 138 | void *priv; | 145 | void *priv; |
| 139 | spinlock_t keylock; | 146 | spinlock_t keylock; |
| 140 | bool keypressed; | 147 | bool keypressed; |
| 141 | unsigned long keyup_jiffies; | 148 | unsigned long keyup_jiffies; |
| 142 | struct timer_list timer_keyup; | 149 | struct timer_list timer_keyup; |
| 143 | u32 last_keycode; | 150 | u32 last_keycode; |
| 151 | enum rc_type last_protocol; | ||
| 144 | u32 last_scancode; | 152 | u32 last_scancode; |
| 145 | u8 last_toggle; | 153 | u8 last_toggle; |
| 146 | u32 timeout; | 154 | u32 timeout; |
| @@ -148,7 +156,6 @@ struct rc_dev { | |||
| 148 | u32 max_timeout; | 156 | u32 max_timeout; |
| 149 | u32 rx_resolution; | 157 | u32 rx_resolution; |
| 150 | u32 tx_resolution; | 158 | u32 tx_resolution; |
| 151 | struct rc_scancode_filter scancode_filters[RC_FILTER_MAX]; | ||
| 152 | int (*change_protocol)(struct rc_dev *dev, u64 *rc_type); | 159 | int (*change_protocol)(struct rc_dev *dev, u64 *rc_type); |
| 153 | int (*change_wakeup_protocol)(struct rc_dev *dev, u64 *rc_type); | 160 | int (*change_wakeup_protocol)(struct rc_dev *dev, u64 *rc_type); |
| 154 | int (*open)(struct rc_dev *dev); | 161 | int (*open)(struct rc_dev *dev); |
| @@ -169,42 +176,6 @@ struct rc_dev { | |||
| 169 | 176 | ||
| 170 | #define to_rc_dev(d) container_of(d, struct rc_dev, dev) | 177 | #define to_rc_dev(d) container_of(d, struct rc_dev, dev) |
| 171 | 178 | ||
| 172 | static inline bool rc_protocols_allowed(struct rc_dev *rdev, u64 protos) | ||
| 173 | { | ||
| 174 | return rdev->allowed_protocols[RC_FILTER_NORMAL] & protos; | ||
| 175 | } | ||
| 176 | |||
| 177 | /* should be called prior to registration or with mutex held */ | ||
| 178 | static inline void rc_set_allowed_protocols(struct rc_dev *rdev, u64 protos) | ||
| 179 | { | ||
| 180 | rdev->allowed_protocols[RC_FILTER_NORMAL] = protos; | ||
| 181 | } | ||
| 182 | |||
| 183 | static inline bool rc_protocols_enabled(struct rc_dev *rdev, u64 protos) | ||
| 184 | { | ||
| 185 | return rdev->enabled_protocols[RC_FILTER_NORMAL] & protos; | ||
| 186 | } | ||
| 187 | |||
| 188 | /* should be called prior to registration or with mutex held */ | ||
| 189 | static inline void rc_set_enabled_protocols(struct rc_dev *rdev, u64 protos) | ||
| 190 | { | ||
| 191 | rdev->enabled_protocols[RC_FILTER_NORMAL] = protos; | ||
| 192 | } | ||
| 193 | |||
| 194 | /* should be called prior to registration or with mutex held */ | ||
| 195 | static inline void rc_set_allowed_wakeup_protocols(struct rc_dev *rdev, | ||
| 196 | u64 protos) | ||
| 197 | { | ||
| 198 | rdev->allowed_protocols[RC_FILTER_WAKEUP] = protos; | ||
| 199 | } | ||
| 200 | |||
| 201 | /* should be called prior to registration or with mutex held */ | ||
| 202 | static inline void rc_set_enabled_wakeup_protocols(struct rc_dev *rdev, | ||
| 203 | u64 protos) | ||
| 204 | { | ||
| 205 | rdev->enabled_protocols[RC_FILTER_WAKEUP] = protos; | ||
| 206 | } | ||
| 207 | |||
| 208 | /* | 179 | /* |
| 209 | * From rc-main.c | 180 | * From rc-main.c |
| 210 | * Those functions can be used on any type of Remote Controller. They | 181 | * Those functions can be used on any type of Remote Controller. They |
| @@ -221,8 +192,8 @@ int rc_open(struct rc_dev *rdev); | |||
| 221 | void rc_close(struct rc_dev *rdev); | 192 | void rc_close(struct rc_dev *rdev); |
| 222 | 193 | ||
| 223 | void rc_repeat(struct rc_dev *dev); | 194 | void rc_repeat(struct rc_dev *dev); |
| 224 | void rc_keydown(struct rc_dev *dev, int scancode, u8 toggle); | 195 | void rc_keydown(struct rc_dev *dev, enum rc_type protocol, u32 scancode, u8 toggle); |
| 225 | void rc_keydown_notimeout(struct rc_dev *dev, int scancode, u8 toggle); | 196 | void rc_keydown_notimeout(struct rc_dev *dev, enum rc_type protocol, u32 scancode, u8 toggle); |
| 226 | void rc_keyup(struct rc_dev *dev); | 197 | void rc_keyup(struct rc_dev *dev); |
| 227 | u32 rc_g_keycode_from_table(struct rc_dev *dev, u32 scancode); | 198 | u32 rc_g_keycode_from_table(struct rc_dev *dev, u32 scancode); |
| 228 | 199 | ||
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index e5aa2409c0ea..80f951890b4c 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
| @@ -31,6 +31,7 @@ enum rc_type { | |||
| 31 | RC_TYPE_RC6_6A_32 = 16, /* Philips RC6-6A-32 protocol */ | 31 | RC_TYPE_RC6_6A_32 = 16, /* Philips RC6-6A-32 protocol */ |
| 32 | RC_TYPE_RC6_MCE = 17, /* MCE (Philips RC6-6A-32 subtype) protocol */ | 32 | RC_TYPE_RC6_MCE = 17, /* MCE (Philips RC6-6A-32 subtype) protocol */ |
| 33 | RC_TYPE_SHARP = 18, /* Sharp protocol */ | 33 | RC_TYPE_SHARP = 18, /* Sharp protocol */ |
| 34 | RC_TYPE_XMP = 19, /* XMP protocol */ | ||
| 34 | }; | 35 | }; |
| 35 | 36 | ||
| 36 | #define RC_BIT_NONE 0 | 37 | #define RC_BIT_NONE 0 |
| @@ -53,6 +54,7 @@ enum rc_type { | |||
| 53 | #define RC_BIT_RC6_6A_32 (1 << RC_TYPE_RC6_6A_32) | 54 | #define RC_BIT_RC6_6A_32 (1 << RC_TYPE_RC6_6A_32) |
| 54 | #define RC_BIT_RC6_MCE (1 << RC_TYPE_RC6_MCE) | 55 | #define RC_BIT_RC6_MCE (1 << RC_TYPE_RC6_MCE) |
| 55 | #define RC_BIT_SHARP (1 << RC_TYPE_SHARP) | 56 | #define RC_BIT_SHARP (1 << RC_TYPE_SHARP) |
| 57 | #define RC_BIT_XMP (1 << RC_TYPE_XMP) | ||
| 56 | 58 | ||
| 57 | #define RC_BIT_ALL (RC_BIT_UNKNOWN | RC_BIT_OTHER | RC_BIT_LIRC | \ | 59 | #define RC_BIT_ALL (RC_BIT_UNKNOWN | RC_BIT_OTHER | RC_BIT_LIRC | \ |
| 58 | RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ | \ | 60 | RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ | \ |
| @@ -60,7 +62,19 @@ enum rc_type { | |||
| 60 | RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20 | \ | 62 | RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20 | \ |
| 61 | RC_BIT_NEC | RC_BIT_SANYO | RC_BIT_MCE_KBD | \ | 63 | RC_BIT_NEC | RC_BIT_SANYO | RC_BIT_MCE_KBD | \ |
| 62 | RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | \ | 64 | RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | \ |
| 63 | RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE | RC_BIT_SHARP) | 65 | RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE | RC_BIT_SHARP | \ |
| 66 | RC_BIT_XMP) | ||
| 67 | |||
| 68 | |||
| 69 | #define RC_SCANCODE_UNKNOWN(x) (x) | ||
| 70 | #define RC_SCANCODE_OTHER(x) (x) | ||
| 71 | #define RC_SCANCODE_NEC(addr, cmd) (((addr) << 8) | (cmd)) | ||
| 72 | #define RC_SCANCODE_NECX(addr, cmd) (((addr) << 8) | (cmd)) | ||
| 73 | #define RC_SCANCODE_NEC32(data) ((data) & 0xffffffff) | ||
| 74 | #define RC_SCANCODE_RC5(sys, cmd) (((sys) << 8) | (cmd)) | ||
| 75 | #define RC_SCANCODE_RC5_SZ(sys, cmd) (((sys) << 8) | (cmd)) | ||
| 76 | #define RC_SCANCODE_RC6_0(sys, cmd) (((sys) << 8) | (cmd)) | ||
| 77 | #define RC_SCANCODE_RC6_6A(vendor, sys, cmd) (((vendor) << 16) | ((sys) << 8) | (cmd)) | ||
| 64 | 78 | ||
| 65 | struct rc_map_table { | 79 | struct rc_map_table { |
| 66 | u32 scancode; | 80 | u32 scancode; |
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 16f7f2606516..b7cd7a665e35 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
| @@ -36,6 +36,25 @@ struct v4l2_subscribed_event; | |||
| 36 | struct v4l2_fh; | 36 | struct v4l2_fh; |
| 37 | struct poll_table_struct; | 37 | struct poll_table_struct; |
| 38 | 38 | ||
| 39 | /** union v4l2_ctrl_ptr - A pointer to a control value. | ||
| 40 | * @p_s32: Pointer to a 32-bit signed value. | ||
| 41 | * @p_s64: Pointer to a 64-bit signed value. | ||
| 42 | * @p_u8: Pointer to a 8-bit unsigned value. | ||
| 43 | * @p_u16: Pointer to a 16-bit unsigned value. | ||
| 44 | * @p_u32: Pointer to a 32-bit unsigned value. | ||
| 45 | * @p_char: Pointer to a string. | ||
| 46 | * @p: Pointer to a compound value. | ||
| 47 | */ | ||
| 48 | union v4l2_ctrl_ptr { | ||
| 49 | s32 *p_s32; | ||
| 50 | s64 *p_s64; | ||
| 51 | u8 *p_u8; | ||
| 52 | u16 *p_u16; | ||
| 53 | u32 *p_u32; | ||
| 54 | char *p_char; | ||
| 55 | void *p; | ||
| 56 | }; | ||
| 57 | |||
| 39 | /** struct v4l2_ctrl_ops - The control operations that the driver has to provide. | 58 | /** struct v4l2_ctrl_ops - The control operations that the driver has to provide. |
| 40 | * @g_volatile_ctrl: Get a new value for this control. Generally only relevant | 59 | * @g_volatile_ctrl: Get a new value for this control. Generally only relevant |
| 41 | * for volatile (and usually read-only) controls such as a control | 60 | * for volatile (and usually read-only) controls such as a control |
| @@ -54,6 +73,23 @@ struct v4l2_ctrl_ops { | |||
| 54 | int (*s_ctrl)(struct v4l2_ctrl *ctrl); | 73 | int (*s_ctrl)(struct v4l2_ctrl *ctrl); |
| 55 | }; | 74 | }; |
| 56 | 75 | ||
| 76 | /** struct v4l2_ctrl_type_ops - The control type operations that the driver has to provide. | ||
| 77 | * @equal: return true if both values are equal. | ||
| 78 | * @init: initialize the value. | ||
| 79 | * @log: log the value. | ||
| 80 | * @validate: validate the value. Return 0 on success and a negative value otherwise. | ||
| 81 | */ | ||
| 82 | struct v4l2_ctrl_type_ops { | ||
| 83 | bool (*equal)(const struct v4l2_ctrl *ctrl, u32 idx, | ||
| 84 | union v4l2_ctrl_ptr ptr1, | ||
| 85 | union v4l2_ctrl_ptr ptr2); | ||
| 86 | void (*init)(const struct v4l2_ctrl *ctrl, u32 idx, | ||
| 87 | union v4l2_ctrl_ptr ptr); | ||
| 88 | void (*log)(const struct v4l2_ctrl *ctrl); | ||
| 89 | int (*validate)(const struct v4l2_ctrl *ctrl, u32 idx, | ||
| 90 | union v4l2_ctrl_ptr ptr); | ||
| 91 | }; | ||
| 92 | |||
| 57 | typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv); | 93 | typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv); |
| 58 | 94 | ||
| 59 | /** struct v4l2_ctrl - The control structure. | 95 | /** struct v4l2_ctrl - The control structure. |
| @@ -66,6 +102,8 @@ typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv); | |||
| 66 | * @is_new: Set when the user specified a new value for this control. It | 102 | * @is_new: Set when the user specified a new value for this control. It |
| 67 | * is also set when called from v4l2_ctrl_handler_setup. Drivers | 103 | * is also set when called from v4l2_ctrl_handler_setup. Drivers |
| 68 | * should never set this flag. | 104 | * should never set this flag. |
| 105 | * @has_changed: Set when the current value differs from the new value. Drivers | ||
| 106 | * should never use this flag. | ||
| 69 | * @is_private: If set, then this control is private to its handler and it | 107 | * @is_private: If set, then this control is private to its handler and it |
| 70 | * will not be added to any other handlers. Drivers can set | 108 | * will not be added to any other handlers. Drivers can set |
| 71 | * this flag. | 109 | * this flag. |
| @@ -73,6 +111,13 @@ typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv); | |||
| 73 | * members are in 'automatic' mode or 'manual' mode. This is | 111 | * members are in 'automatic' mode or 'manual' mode. This is |
| 74 | * used for autogain/gain type clusters. Drivers should never | 112 | * used for autogain/gain type clusters. Drivers should never |
| 75 | * set this flag directly. | 113 | * set this flag directly. |
| 114 | * @is_int: If set, then this control has a simple integer value (i.e. it | ||
| 115 | * uses ctrl->val). | ||
| 116 | * @is_string: If set, then this control has type V4L2_CTRL_TYPE_STRING. | ||
| 117 | * @is_ptr: If set, then this control is an array and/or has type >= V4L2_CTRL_COMPOUND_TYPES | ||
| 118 | * and/or has type V4L2_CTRL_TYPE_STRING. In other words, struct | ||
| 119 | * v4l2_ext_control uses field p to point to the data. | ||
| 120 | * @is_array: If set, then this control contains an N-dimensional array. | ||
| 76 | * @has_volatiles: If set, then one or more members of the cluster are volatile. | 121 | * @has_volatiles: If set, then one or more members of the cluster are volatile. |
| 77 | * Drivers should never touch this flag. | 122 | * Drivers should never touch this flag. |
| 78 | * @call_notify: If set, then call the handler's notify function whenever the | 123 | * @call_notify: If set, then call the handler's notify function whenever the |
| @@ -83,6 +128,7 @@ typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv); | |||
| 83 | * value, then the whole cluster is in manual mode. Drivers should | 128 | * value, then the whole cluster is in manual mode. Drivers should |
| 84 | * never set this flag directly. | 129 | * never set this flag directly. |
| 85 | * @ops: The control ops. | 130 | * @ops: The control ops. |
| 131 | * @type_ops: The control type ops. | ||
| 86 | * @id: The control ID. | 132 | * @id: The control ID. |
| 87 | * @name: The control name. | 133 | * @name: The control name. |
| 88 | * @type: The control type. | 134 | * @type: The control type. |
| @@ -90,6 +136,10 @@ typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv); | |||
| 90 | * @maximum: The control's maximum value. | 136 | * @maximum: The control's maximum value. |
| 91 | * @default_value: The control's default value. | 137 | * @default_value: The control's default value. |
| 92 | * @step: The control's step value for non-menu controls. | 138 | * @step: The control's step value for non-menu controls. |
| 139 | * @elems: The number of elements in the N-dimensional array. | ||
| 140 | * @elem_size: The size in bytes of the control. | ||
| 141 | * @dims: The size of each dimension. | ||
| 142 | * @nr_of_dims:The number of dimensions in @dims. | ||
| 93 | * @menu_skip_mask: The control's skip mask for menu controls. This makes it | 143 | * @menu_skip_mask: The control's skip mask for menu controls. This makes it |
| 94 | * easy to skip menu items that are not valid. If bit X is set, | 144 | * easy to skip menu items that are not valid. If bit X is set, |
| 95 | * then menu item X is skipped. Of course, this only works for | 145 | * then menu item X is skipped. Of course, this only works for |
| @@ -104,7 +154,6 @@ typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv); | |||
| 104 | * @cur: The control's current value. | 154 | * @cur: The control's current value. |
| 105 | * @val: The control's new s32 value. | 155 | * @val: The control's new s32 value. |
| 106 | * @val64: The control's new s64 value. | 156 | * @val64: The control's new s64 value. |
| 107 | * @string: The control's new string value. | ||
| 108 | * @priv: The control's private pointer. For use by the driver. It is | 157 | * @priv: The control's private pointer. For use by the driver. It is |
| 109 | * untouched by the control framework. Note that this pointer is | 158 | * untouched by the control framework. Note that this pointer is |
| 110 | * not freed when the control is deleted. Should this be needed | 159 | * not freed when the control is deleted. Should this be needed |
| @@ -121,37 +170,44 @@ struct v4l2_ctrl { | |||
| 121 | unsigned int done:1; | 170 | unsigned int done:1; |
| 122 | 171 | ||
| 123 | unsigned int is_new:1; | 172 | unsigned int is_new:1; |
| 173 | unsigned int has_changed:1; | ||
| 124 | unsigned int is_private:1; | 174 | unsigned int is_private:1; |
| 125 | unsigned int is_auto:1; | 175 | unsigned int is_auto:1; |
| 176 | unsigned int is_int:1; | ||
| 177 | unsigned int is_string:1; | ||
| 178 | unsigned int is_ptr:1; | ||
| 179 | unsigned int is_array:1; | ||
| 126 | unsigned int has_volatiles:1; | 180 | unsigned int has_volatiles:1; |
| 127 | unsigned int call_notify:1; | 181 | unsigned int call_notify:1; |
| 128 | unsigned int manual_mode_value:8; | 182 | unsigned int manual_mode_value:8; |
| 129 | 183 | ||
| 130 | const struct v4l2_ctrl_ops *ops; | 184 | const struct v4l2_ctrl_ops *ops; |
| 185 | const struct v4l2_ctrl_type_ops *type_ops; | ||
| 131 | u32 id; | 186 | u32 id; |
| 132 | const char *name; | 187 | const char *name; |
| 133 | enum v4l2_ctrl_type type; | 188 | enum v4l2_ctrl_type type; |
| 134 | s32 minimum, maximum, default_value; | 189 | s64 minimum, maximum, default_value; |
| 190 | u32 elems; | ||
| 191 | u32 elem_size; | ||
| 192 | u32 dims[V4L2_CTRL_MAX_DIMS]; | ||
| 193 | u32 nr_of_dims; | ||
| 135 | union { | 194 | union { |
| 136 | u32 step; | 195 | u64 step; |
| 137 | u32 menu_skip_mask; | 196 | u64 menu_skip_mask; |
| 138 | }; | 197 | }; |
| 139 | union { | 198 | union { |
| 140 | const char * const *qmenu; | 199 | const char * const *qmenu; |
| 141 | const s64 *qmenu_int; | 200 | const s64 *qmenu_int; |
| 142 | }; | 201 | }; |
| 143 | unsigned long flags; | 202 | unsigned long flags; |
| 144 | union { | 203 | void *priv; |
| 204 | s32 val; | ||
| 205 | struct { | ||
| 145 | s32 val; | 206 | s32 val; |
| 146 | s64 val64; | ||
| 147 | char *string; | ||
| 148 | } cur; | 207 | } cur; |
| 149 | union { | 208 | |
| 150 | s32 val; | 209 | union v4l2_ctrl_ptr p_new; |
| 151 | s64 val64; | 210 | union v4l2_ctrl_ptr p_cur; |
| 152 | char *string; | ||
| 153 | }; | ||
| 154 | void *priv; | ||
| 155 | }; | 211 | }; |
| 156 | 212 | ||
| 157 | /** struct v4l2_ctrl_ref - The control reference. | 213 | /** struct v4l2_ctrl_ref - The control reference. |
| @@ -205,6 +261,7 @@ struct v4l2_ctrl_handler { | |||
| 205 | 261 | ||
| 206 | /** struct v4l2_ctrl_config - Control configuration structure. | 262 | /** struct v4l2_ctrl_config - Control configuration structure. |
| 207 | * @ops: The control ops. | 263 | * @ops: The control ops. |
| 264 | * @type_ops: The control type ops. Only needed for compound controls. | ||
| 208 | * @id: The control ID. | 265 | * @id: The control ID. |
| 209 | * @name: The control name. | 266 | * @name: The control name. |
| 210 | * @type: The control type. | 267 | * @type: The control type. |
| @@ -212,13 +269,15 @@ struct v4l2_ctrl_handler { | |||
| 212 | * @max: The control's maximum value. | 269 | * @max: The control's maximum value. |
| 213 | * @step: The control's step value for non-menu controls. | 270 | * @step: The control's step value for non-menu controls. |
| 214 | * @def: The control's default value. | 271 | * @def: The control's default value. |
| 272 | * @dims: The size of each dimension. | ||
| 273 | * @elem_size: The size in bytes of the control. | ||
| 215 | * @flags: The control's flags. | 274 | * @flags: The control's flags. |
| 216 | * @menu_skip_mask: The control's skip mask for menu controls. This makes it | 275 | * @menu_skip_mask: The control's skip mask for menu controls. This makes it |
| 217 | * easy to skip menu items that are not valid. If bit X is set, | 276 | * easy to skip menu items that are not valid. If bit X is set, |
| 218 | * then menu item X is skipped. Of course, this only works for | 277 | * then menu item X is skipped. Of course, this only works for |
| 219 | * menus with <= 32 menu items. There are no menus that come | 278 | * menus with <= 64 menu items. There are no menus that come |
| 220 | * close to that number, so this is OK. Should we ever need more, | 279 | * close to that number, so this is OK. Should we ever need more, |
| 221 | * then this will have to be extended to a u64 or a bit array. | 280 | * then this will have to be extended to a bit array. |
| 222 | * @qmenu: A const char * array for all menu items. Array entries that are | 281 | * @qmenu: A const char * array for all menu items. Array entries that are |
| 223 | * empty strings ("") correspond to non-existing menu items (this | 282 | * empty strings ("") correspond to non-existing menu items (this |
| 224 | * is in addition to the menu_skip_mask above). The last entry | 283 | * is in addition to the menu_skip_mask above). The last entry |
| @@ -228,15 +287,18 @@ struct v4l2_ctrl_handler { | |||
| 228 | */ | 287 | */ |
| 229 | struct v4l2_ctrl_config { | 288 | struct v4l2_ctrl_config { |
| 230 | const struct v4l2_ctrl_ops *ops; | 289 | const struct v4l2_ctrl_ops *ops; |
| 290 | const struct v4l2_ctrl_type_ops *type_ops; | ||
| 231 | u32 id; | 291 | u32 id; |
| 232 | const char *name; | 292 | const char *name; |
| 233 | enum v4l2_ctrl_type type; | 293 | enum v4l2_ctrl_type type; |
| 234 | s32 min; | 294 | s64 min; |
| 235 | s32 max; | 295 | s64 max; |
| 236 | u32 step; | 296 | u64 step; |
| 237 | s32 def; | 297 | s64 def; |
| 298 | u32 dims[V4L2_CTRL_MAX_DIMS]; | ||
| 299 | u32 elem_size; | ||
| 238 | u32 flags; | 300 | u32 flags; |
| 239 | u32 menu_skip_mask; | 301 | u64 menu_skip_mask; |
| 240 | const char * const *qmenu; | 302 | const char * const *qmenu; |
| 241 | const s64 *qmenu_int; | 303 | const s64 *qmenu_int; |
| 242 | unsigned int is_private:1; | 304 | unsigned int is_private:1; |
| @@ -257,7 +319,7 @@ struct v4l2_ctrl_config { | |||
| 257 | * control framework this function will no longer be exported. | 319 | * control framework this function will no longer be exported. |
| 258 | */ | 320 | */ |
| 259 | void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, | 321 | void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, |
| 260 | s32 *min, s32 *max, s32 *step, s32 *def, u32 *flags); | 322 | s64 *min, s64 *max, u64 *step, s64 *def, u32 *flags); |
| 261 | 323 | ||
| 262 | 324 | ||
| 263 | /** v4l2_ctrl_handler_init_class() - Initialize the control handler. | 325 | /** v4l2_ctrl_handler_init_class() - Initialize the control handler. |
| @@ -307,6 +369,24 @@ int v4l2_ctrl_handler_init_class(struct v4l2_ctrl_handler *hdl, | |||
| 307 | */ | 369 | */ |
| 308 | void v4l2_ctrl_handler_free(struct v4l2_ctrl_handler *hdl); | 370 | void v4l2_ctrl_handler_free(struct v4l2_ctrl_handler *hdl); |
| 309 | 371 | ||
| 372 | /** v4l2_ctrl_lock() - Helper function to lock the handler | ||
| 373 | * associated with the control. | ||
| 374 | * @ctrl: The control to lock. | ||
| 375 | */ | ||
| 376 | static inline void v4l2_ctrl_lock(struct v4l2_ctrl *ctrl) | ||
| 377 | { | ||
| 378 | mutex_lock(ctrl->handler->lock); | ||
| 379 | } | ||
| 380 | |||
| 381 | /** v4l2_ctrl_unlock() - Helper function to unlock the handler | ||
| 382 | * associated with the control. | ||
| 383 | * @ctrl: The control to unlock. | ||
| 384 | */ | ||
| 385 | static inline void v4l2_ctrl_unlock(struct v4l2_ctrl *ctrl) | ||
| 386 | { | ||
| 387 | mutex_unlock(ctrl->handler->lock); | ||
| 388 | } | ||
| 389 | |||
| 310 | /** v4l2_ctrl_handler_setup() - Call the s_ctrl op for all controls belonging | 390 | /** v4l2_ctrl_handler_setup() - Call the s_ctrl op for all controls belonging |
| 311 | * to the handler to initialize the hardware to the current control values. | 391 | * to the handler to initialize the hardware to the current control values. |
| 312 | * @hdl: The control handler. | 392 | * @hdl: The control handler. |
| @@ -362,7 +442,7 @@ struct v4l2_ctrl *v4l2_ctrl_new_custom(struct v4l2_ctrl_handler *hdl, | |||
| 362 | */ | 442 | */ |
| 363 | struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl, | 443 | struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl, |
| 364 | const struct v4l2_ctrl_ops *ops, | 444 | const struct v4l2_ctrl_ops *ops, |
| 365 | u32 id, s32 min, s32 max, u32 step, s32 def); | 445 | u32 id, s64 min, s64 max, u64 step, s64 def); |
| 366 | 446 | ||
| 367 | /** v4l2_ctrl_new_std_menu() - Allocate and initialize a new standard V4L2 menu control. | 447 | /** v4l2_ctrl_new_std_menu() - Allocate and initialize a new standard V4L2 menu control. |
| 368 | * @hdl: The control handler. | 448 | * @hdl: The control handler. |
| @@ -372,9 +452,9 @@ struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl, | |||
| 372 | * @mask: The control's skip mask for menu controls. This makes it | 452 | * @mask: The control's skip mask for menu controls. This makes it |
| 373 | * easy to skip menu items that are not valid. If bit X is set, | 453 | * easy to skip menu items that are not valid. If bit X is set, |
| 374 | * then menu item X is skipped. Of course, this only works for | 454 | * then menu item X is skipped. Of course, this only works for |
| 375 | * menus with <= 32 menu items. There are no menus that come | 455 | * menus with <= 64 menu items. There are no menus that come |
| 376 | * close to that number, so this is OK. Should we ever need more, | 456 | * close to that number, so this is OK. Should we ever need more, |
| 377 | * then this will have to be extended to a u64 or a bit array. | 457 | * then this will have to be extended to a bit array. |
| 378 | * @def: The control's default value. | 458 | * @def: The control's default value. |
| 379 | * | 459 | * |
| 380 | * Same as v4l2_ctrl_new_std(), but @min is set to 0 and the @mask value | 460 | * Same as v4l2_ctrl_new_std(), but @min is set to 0 and the @mask value |
| @@ -384,7 +464,7 @@ struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl, | |||
| 384 | */ | 464 | */ |
| 385 | struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl, | 465 | struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl, |
| 386 | const struct v4l2_ctrl_ops *ops, | 466 | const struct v4l2_ctrl_ops *ops, |
| 387 | u32 id, s32 max, s32 mask, s32 def); | 467 | u32 id, u8 max, u64 mask, u8 def); |
| 388 | 468 | ||
| 389 | /** v4l2_ctrl_new_std_menu_items() - Create a new standard V4L2 menu control | 469 | /** v4l2_ctrl_new_std_menu_items() - Create a new standard V4L2 menu control |
| 390 | * with driver specific menu. | 470 | * with driver specific menu. |
| @@ -395,9 +475,9 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl, | |||
| 395 | * @mask: The control's skip mask for menu controls. This makes it | 475 | * @mask: The control's skip mask for menu controls. This makes it |
| 396 | * easy to skip menu items that are not valid. If bit X is set, | 476 | * easy to skip menu items that are not valid. If bit X is set, |
| 397 | * then menu item X is skipped. Of course, this only works for | 477 | * then menu item X is skipped. Of course, this only works for |
| 398 | * menus with <= 32 menu items. There are no menus that come | 478 | * menus with <= 64 menu items. There are no menus that come |
| 399 | * close to that number, so this is OK. Should we ever need more, | 479 | * close to that number, so this is OK. Should we ever need more, |
| 400 | * then this will have to be extended to a u64 or a bit array. | 480 | * then this will have to be extended to a bit array. |
| 401 | * @def: The control's default value. | 481 | * @def: The control's default value. |
| 402 | * @qmenu: The new menu. | 482 | * @qmenu: The new menu. |
| 403 | * | 483 | * |
| @@ -406,8 +486,8 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl, | |||
| 406 | * | 486 | * |
| 407 | */ | 487 | */ |
| 408 | struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(struct v4l2_ctrl_handler *hdl, | 488 | struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(struct v4l2_ctrl_handler *hdl, |
| 409 | const struct v4l2_ctrl_ops *ops, u32 id, s32 max, | 489 | const struct v4l2_ctrl_ops *ops, u32 id, u8 max, |
| 410 | s32 mask, s32 def, const char * const *qmenu); | 490 | u64 mask, u8 def, const char * const *qmenu); |
| 411 | 491 | ||
| 412 | /** v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control. | 492 | /** v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control. |
| 413 | * @hdl: The control handler. | 493 | * @hdl: The control handler. |
| @@ -424,7 +504,7 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu_items(struct v4l2_ctrl_handler *hdl, | |||
| 424 | */ | 504 | */ |
| 425 | struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct v4l2_ctrl_handler *hdl, | 505 | struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct v4l2_ctrl_handler *hdl, |
| 426 | const struct v4l2_ctrl_ops *ops, | 506 | const struct v4l2_ctrl_ops *ops, |
| 427 | u32 id, s32 max, s32 def, const s64 *qmenu_int); | 507 | u32 id, u8 max, u8 def, const s64 *qmenu_int); |
| 428 | 508 | ||
| 429 | /** v4l2_ctrl_add_ctrl() - Add a control from another handler to this handler. | 509 | /** v4l2_ctrl_add_ctrl() - Add a control from another handler to this handler. |
| 430 | * @hdl: The control handler. | 510 | * @hdl: The control handler. |
| @@ -542,6 +622,11 @@ void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active); | |||
| 542 | */ | 622 | */ |
| 543 | void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); | 623 | void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); |
| 544 | 624 | ||
| 625 | |||
| 626 | /** __v4l2_ctrl_modify_range() - Unlocked variant of v4l2_ctrl_modify_range() */ | ||
| 627 | int __v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl, | ||
| 628 | s64 min, s64 max, u64 step, s64 def); | ||
| 629 | |||
| 545 | /** v4l2_ctrl_modify_range() - Update the range of a control. | 630 | /** v4l2_ctrl_modify_range() - Update the range of a control. |
| 546 | * @ctrl: The control to update. | 631 | * @ctrl: The control to update. |
| 547 | * @min: The control's minimum value. | 632 | * @min: The control's minimum value. |
| @@ -559,25 +644,16 @@ void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); | |||
| 559 | * This function assumes that the control handler is not locked and will | 644 | * This function assumes that the control handler is not locked and will |
| 560 | * take the lock itself. | 645 | * take the lock itself. |
| 561 | */ | 646 | */ |
| 562 | int v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl, | 647 | static inline int v4l2_ctrl_modify_range(struct v4l2_ctrl *ctrl, |
| 563 | s32 min, s32 max, u32 step, s32 def); | 648 | s64 min, s64 max, u64 step, s64 def) |
| 564 | |||
| 565 | /** v4l2_ctrl_lock() - Helper function to lock the handler | ||
| 566 | * associated with the control. | ||
| 567 | * @ctrl: The control to lock. | ||
| 568 | */ | ||
| 569 | static inline void v4l2_ctrl_lock(struct v4l2_ctrl *ctrl) | ||
| 570 | { | 649 | { |
| 571 | mutex_lock(ctrl->handler->lock); | 650 | int rval; |
| 572 | } | ||
| 573 | 651 | ||
| 574 | /** v4l2_ctrl_unlock() - Helper function to unlock the handler | 652 | v4l2_ctrl_lock(ctrl); |
| 575 | * associated with the control. | 653 | rval = __v4l2_ctrl_modify_range(ctrl, min, max, step, def); |
| 576 | * @ctrl: The control to unlock. | 654 | v4l2_ctrl_unlock(ctrl); |
| 577 | */ | 655 | |
| 578 | static inline void v4l2_ctrl_unlock(struct v4l2_ctrl *ctrl) | 656 | return rval; |
| 579 | { | ||
| 580 | mutex_unlock(ctrl->handler->lock); | ||
| 581 | } | 657 | } |
| 582 | 658 | ||
| 583 | /** v4l2_ctrl_notify() - Function to set a notify callback for a control. | 659 | /** v4l2_ctrl_notify() - Function to set a notify callback for a control. |
| @@ -605,6 +681,8 @@ void v4l2_ctrl_notify(struct v4l2_ctrl *ctrl, v4l2_ctrl_notify_fnc notify, void | |||
| 605 | */ | 681 | */ |
| 606 | s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl); | 682 | s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl); |
| 607 | 683 | ||
| 684 | /** __v4l2_ctrl_s_ctrl() - Unlocked variant of v4l2_ctrl_s_ctrl(). */ | ||
| 685 | int __v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); | ||
| 608 | /** v4l2_ctrl_s_ctrl() - Helper function to set the control's value from within a driver. | 686 | /** v4l2_ctrl_s_ctrl() - Helper function to set the control's value from within a driver. |
| 609 | * @ctrl: The control. | 687 | * @ctrl: The control. |
| 610 | * @val: The new value. | 688 | * @val: The new value. |
| @@ -615,7 +693,16 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl); | |||
| 615 | * | 693 | * |
| 616 | * This function is for integer type controls only. | 694 | * This function is for integer type controls only. |
| 617 | */ | 695 | */ |
| 618 | int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); | 696 | static inline int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val) |
| 697 | { | ||
| 698 | int rval; | ||
| 699 | |||
| 700 | v4l2_ctrl_lock(ctrl); | ||
| 701 | rval = __v4l2_ctrl_s_ctrl(ctrl, val); | ||
| 702 | v4l2_ctrl_unlock(ctrl); | ||
| 703 | |||
| 704 | return rval; | ||
| 705 | } | ||
| 619 | 706 | ||
| 620 | /** v4l2_ctrl_g_ctrl_int64() - Helper function to get a 64-bit control's value from within a driver. | 707 | /** v4l2_ctrl_g_ctrl_int64() - Helper function to get a 64-bit control's value from within a driver. |
| 621 | * @ctrl: The control. | 708 | * @ctrl: The control. |
| @@ -628,6 +715,9 @@ int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); | |||
| 628 | */ | 715 | */ |
| 629 | s64 v4l2_ctrl_g_ctrl_int64(struct v4l2_ctrl *ctrl); | 716 | s64 v4l2_ctrl_g_ctrl_int64(struct v4l2_ctrl *ctrl); |
| 630 | 717 | ||
| 718 | /** __v4l2_ctrl_s_ctrl_int64() - Unlocked variant of v4l2_ctrl_s_ctrl_int64(). */ | ||
| 719 | int __v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val); | ||
| 720 | |||
| 631 | /** v4l2_ctrl_s_ctrl_int64() - Helper function to set a 64-bit control's value from within a driver. | 721 | /** v4l2_ctrl_s_ctrl_int64() - Helper function to set a 64-bit control's value from within a driver. |
| 632 | * @ctrl: The control. | 722 | * @ctrl: The control. |
| 633 | * @val: The new value. | 723 | * @val: The new value. |
| @@ -638,7 +728,40 @@ s64 v4l2_ctrl_g_ctrl_int64(struct v4l2_ctrl *ctrl); | |||
| 638 | * | 728 | * |
| 639 | * This function is for 64-bit integer type controls only. | 729 | * This function is for 64-bit integer type controls only. |
| 640 | */ | 730 | */ |
| 641 | int v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val); | 731 | static inline int v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val) |
| 732 | { | ||
| 733 | int rval; | ||
| 734 | |||
| 735 | v4l2_ctrl_lock(ctrl); | ||
| 736 | rval = __v4l2_ctrl_s_ctrl_int64(ctrl, val); | ||
| 737 | v4l2_ctrl_unlock(ctrl); | ||
| 738 | |||
| 739 | return rval; | ||
| 740 | } | ||
| 741 | |||
| 742 | /** __v4l2_ctrl_s_ctrl_string() - Unlocked variant of v4l2_ctrl_s_ctrl_string(). */ | ||
| 743 | int __v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s); | ||
| 744 | |||
| 745 | /** v4l2_ctrl_s_ctrl_string() - Helper function to set a control's string value from within a driver. | ||
| 746 | * @ctrl: The control. | ||
| 747 | * @s: The new string. | ||
| 748 | * | ||
| 749 | * This set the control's new string safely by going through the control | ||
| 750 | * framework. This function will lock the control's handler, so it cannot be | ||
| 751 | * used from within the &v4l2_ctrl_ops functions. | ||
| 752 | * | ||
| 753 | * This function is for string type controls only. | ||
| 754 | */ | ||
| 755 | static inline int v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s) | ||
| 756 | { | ||
| 757 | int rval; | ||
| 758 | |||
| 759 | v4l2_ctrl_lock(ctrl); | ||
| 760 | rval = __v4l2_ctrl_s_ctrl_string(ctrl, s); | ||
| 761 | v4l2_ctrl_unlock(ctrl); | ||
| 762 | |||
| 763 | return rval; | ||
| 764 | } | ||
| 642 | 765 | ||
| 643 | /* Internal helper functions that deal with control events. */ | 766 | /* Internal helper functions that deal with control events. */ |
| 644 | extern const struct v4l2_subscribed_event_ops v4l2_ctrl_sub_ev_ops; | 767 | extern const struct v4l2_subscribed_event_ops v4l2_ctrl_sub_ev_ops; |
| @@ -659,6 +782,7 @@ unsigned int v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait); | |||
| 659 | 782 | ||
| 660 | /* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */ | 783 | /* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */ |
| 661 | int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc); | 784 | int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc); |
| 785 | int v4l2_query_ext_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_query_ext_ctrl *qc); | ||
| 662 | int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm); | 786 | int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm); |
| 663 | int v4l2_g_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl); | 787 | int v4l2_g_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl); |
| 664 | int v4l2_s_ctrl(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl, | 788 | int v4l2_s_ctrl(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl, |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index eec6e460f649..eb76cfd47189 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
| @@ -44,8 +44,6 @@ struct v4l2_ctrl_handler; | |||
| 44 | #define V4L2_FL_REGISTERED (0) | 44 | #define V4L2_FL_REGISTERED (0) |
| 45 | /* file->private_data points to struct v4l2_fh */ | 45 | /* file->private_data points to struct v4l2_fh */ |
| 46 | #define V4L2_FL_USES_V4L2_FH (1) | 46 | #define V4L2_FL_USES_V4L2_FH (1) |
| 47 | /* Use the prio field of v4l2_fh for core priority checking */ | ||
| 48 | #define V4L2_FL_USE_FH_PRIO (2) | ||
| 49 | 47 | ||
| 50 | /* Priority helper functions */ | 48 | /* Priority helper functions */ |
| 51 | 49 | ||
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 50cf7c110a70..53605f0f9903 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
| @@ -158,6 +158,8 @@ struct v4l2_ioctl_ops { | |||
| 158 | /* Control handling */ | 158 | /* Control handling */ |
| 159 | int (*vidioc_queryctrl) (struct file *file, void *fh, | 159 | int (*vidioc_queryctrl) (struct file *file, void *fh, |
| 160 | struct v4l2_queryctrl *a); | 160 | struct v4l2_queryctrl *a); |
| 161 | int (*vidioc_query_ext_ctrl) (struct file *file, void *fh, | ||
| 162 | struct v4l2_query_ext_ctrl *a); | ||
| 161 | int (*vidioc_g_ctrl) (struct file *file, void *fh, | 163 | int (*vidioc_g_ctrl) (struct file *file, void *fh, |
| 162 | struct v4l2_control *a); | 164 | struct v4l2_control *a); |
| 163 | int (*vidioc_s_ctrl) (struct file *file, void *fh, | 165 | int (*vidioc_s_ctrl) (struct file *file, void *fh, |
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h index 12ea5a6a4331..c5f3914bc4d8 100644 --- a/include/media/v4l2-mem2mem.h +++ b/include/media/v4l2-mem2mem.h | |||
| @@ -95,6 +95,8 @@ void *v4l2_m2m_get_curr_priv(struct v4l2_m2m_dev *m2m_dev); | |||
| 95 | struct vb2_queue *v4l2_m2m_get_vq(struct v4l2_m2m_ctx *m2m_ctx, | 95 | struct vb2_queue *v4l2_m2m_get_vq(struct v4l2_m2m_ctx *m2m_ctx, |
| 96 | enum v4l2_buf_type type); | 96 | enum v4l2_buf_type type); |
| 97 | 97 | ||
| 98 | void v4l2_m2m_try_schedule(struct v4l2_m2m_ctx *m2m_ctx); | ||
| 99 | |||
| 98 | void v4l2_m2m_job_finish(struct v4l2_m2m_dev *m2m_dev, | 100 | void v4l2_m2m_job_finish(struct v4l2_m2m_dev *m2m_dev, |
| 99 | struct v4l2_m2m_ctx *m2m_ctx); | 101 | struct v4l2_m2m_ctx *m2m_ctx); |
| 100 | 102 | ||
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h index d8fb6012c10d..fb6fd4d8f4ed 100644 --- a/include/media/videobuf-dma-sg.h +++ b/include/media/videobuf-dma-sg.h | |||
| @@ -53,6 +53,9 @@ struct videobuf_dmabuf { | |||
| 53 | 53 | ||
| 54 | /* for kernel buffers */ | 54 | /* for kernel buffers */ |
| 55 | void *vaddr; | 55 | void *vaddr; |
| 56 | struct page **vaddr_pages; | ||
| 57 | dma_addr_t *dma_addr; | ||
| 58 | struct device *dev; | ||
| 56 | 59 | ||
| 57 | /* for overlay buffers (pci-pci dma) */ | 60 | /* for overlay buffers (pci-pci dma) */ |
| 58 | dma_addr_t bus_addr; | 61 | dma_addr_t bus_addr; |
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index 8fab6fa0dbfb..fc910a622451 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h | |||
| @@ -294,15 +294,19 @@ struct vb2_buffer { | |||
| 294 | * of already queued buffers in count parameter; driver | 294 | * of already queued buffers in count parameter; driver |
| 295 | * can return an error if hardware fails, in that case all | 295 | * can return an error if hardware fails, in that case all |
| 296 | * buffers that have been already given by the @buf_queue | 296 | * buffers that have been already given by the @buf_queue |
| 297 | * callback are invalidated. | 297 | * callback are to be returned by the driver by calling |
| 298 | * If there were not enough queued buffers to start | 298 | * @vb2_buffer_done(VB2_BUF_STATE_DEQUEUED). |
| 299 | * streaming, then this callback returns -ENOBUFS, and the | 299 | * If you need a minimum number of buffers before you can |
| 300 | * vb2 core will retry calling @start_streaming when a new | 300 | * start streaming, then set @min_buffers_needed in the |
| 301 | * buffer is queued. | 301 | * vb2_queue structure. If that is non-zero then |
| 302 | * start_streaming won't be called until at least that | ||
| 303 | * many buffers have been queued up by userspace. | ||
| 302 | * @stop_streaming: called when 'streaming' state must be disabled; driver | 304 | * @stop_streaming: called when 'streaming' state must be disabled; driver |
| 303 | * should stop any DMA transactions or wait until they | 305 | * should stop any DMA transactions or wait until they |
| 304 | * finish and give back all buffers it got from buf_queue() | 306 | * finish and give back all buffers it got from buf_queue() |
| 305 | * callback; may use vb2_wait_for_all_buffers() function | 307 | * callback by calling @vb2_buffer_done() with either |
| 308 | * VB2_BUF_STATE_DONE or VB2_BUF_STATE_ERROR; may use | ||
| 309 | * vb2_wait_for_all_buffers() function | ||
| 306 | * @buf_queue: passes buffer vb to the driver; driver may start | 310 | * @buf_queue: passes buffer vb to the driver; driver may start |
| 307 | * hardware operation on this buffer; driver should give | 311 | * hardware operation on this buffer; driver should give |
| 308 | * the buffer back by calling vb2_buffer_done() function; | 312 | * the buffer back by calling vb2_buffer_done() function; |
| @@ -375,6 +379,7 @@ struct v4l2_fh; | |||
| 375 | * @streaming: current streaming state | 379 | * @streaming: current streaming state |
| 376 | * @start_streaming_called: start_streaming() was called successfully and we | 380 | * @start_streaming_called: start_streaming() was called successfully and we |
| 377 | * started streaming. | 381 | * started streaming. |
| 382 | * @error: a fatal error occurred on the queue | ||
| 378 | * @fileio: file io emulator internal data, used only if emulator is active | 383 | * @fileio: file io emulator internal data, used only if emulator is active |
| 379 | * @threadio: thread io internal data, used only if thread is active | 384 | * @threadio: thread io internal data, used only if thread is active |
| 380 | */ | 385 | */ |
| @@ -411,6 +416,7 @@ struct vb2_queue { | |||
| 411 | 416 | ||
| 412 | unsigned int streaming:1; | 417 | unsigned int streaming:1; |
| 413 | unsigned int start_streaming_called:1; | 418 | unsigned int start_streaming_called:1; |
| 419 | unsigned int error:1; | ||
| 414 | 420 | ||
| 415 | struct vb2_fileio_data *fileio; | 421 | struct vb2_fileio_data *fileio; |
| 416 | struct vb2_threadio_data *threadio; | 422 | struct vb2_threadio_data *threadio; |
| @@ -444,6 +450,7 @@ int vb2_prepare_buf(struct vb2_queue *q, struct v4l2_buffer *b); | |||
| 444 | int __must_check vb2_queue_init(struct vb2_queue *q); | 450 | int __must_check vb2_queue_init(struct vb2_queue *q); |
| 445 | 451 | ||
| 446 | void vb2_queue_release(struct vb2_queue *q); | 452 | void vb2_queue_release(struct vb2_queue *q); |
| 453 | void vb2_queue_error(struct vb2_queue *q); | ||
| 447 | 454 | ||
| 448 | int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b); | 455 | int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b); |
| 449 | int vb2_expbuf(struct vb2_queue *q, struct v4l2_exportbuffer *eb); | 456 | int vb2_expbuf(struct vb2_queue *q, struct v4l2_exportbuffer *eb); |
diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h index 79b530fb2c4d..d184df1d0d41 100644 --- a/include/net/6lowpan.h +++ b/include/net/6lowpan.h | |||
| @@ -75,20 +75,6 @@ | |||
| 75 | (((a)->s6_addr[14]) == (m)[6]) && \ | 75 | (((a)->s6_addr[14]) == (m)[6]) && \ |
| 76 | (((a)->s6_addr[15]) == (m)[7])) | 76 | (((a)->s6_addr[15]) == (m)[7])) |
| 77 | 77 | ||
| 78 | /* ipv6 address is unspecified */ | ||
| 79 | #define is_addr_unspecified(a) \ | ||
| 80 | ((((a)->s6_addr32[0]) == 0) && \ | ||
| 81 | (((a)->s6_addr32[1]) == 0) && \ | ||
| 82 | (((a)->s6_addr32[2]) == 0) && \ | ||
| 83 | (((a)->s6_addr32[3]) == 0)) | ||
| 84 | |||
| 85 | /* compare ipv6 addresses prefixes */ | ||
| 86 | #define ipaddr_prefixcmp(addr1, addr2, length) \ | ||
| 87 | (memcmp(addr1, addr2, length >> 3) == 0) | ||
| 88 | |||
| 89 | /* local link, i.e. FE80::/10 */ | ||
| 90 | #define is_addr_link_local(a) (((a)->s6_addr16[0]) == htons(0xFE80)) | ||
| 91 | |||
| 92 | /* | 78 | /* |
| 93 | * check whether we can compress the IID to 16 bits, | 79 | * check whether we can compress the IID to 16 bits, |
| 94 | * it's possible for unicast adresses with first 49 bits are zero only. | 80 | * it's possible for unicast adresses with first 49 bits are zero only. |
| @@ -100,22 +86,8 @@ | |||
| 100 | (((a)->s6_addr[12]) == 0xfe) && \ | 86 | (((a)->s6_addr[12]) == 0xfe) && \ |
| 101 | (((a)->s6_addr[13]) == 0)) | 87 | (((a)->s6_addr[13]) == 0)) |
| 102 | 88 | ||
| 103 | /* multicast address */ | ||
| 104 | #define is_addr_mcast(a) (((a)->s6_addr[0]) == 0xFF) | ||
| 105 | |||
| 106 | /* check whether the 112-bit gid of the multicast address is mappable to: */ | 89 | /* check whether the 112-bit gid of the multicast address is mappable to: */ |
| 107 | 90 | ||
| 108 | /* 9 bits, for FF02::1 (all nodes) and FF02::2 (all routers) addresses only. */ | ||
| 109 | #define lowpan_is_mcast_addr_compressable(a) \ | ||
| 110 | ((((a)->s6_addr16[1]) == 0) && \ | ||
| 111 | (((a)->s6_addr16[2]) == 0) && \ | ||
| 112 | (((a)->s6_addr16[3]) == 0) && \ | ||
| 113 | (((a)->s6_addr16[4]) == 0) && \ | ||
| 114 | (((a)->s6_addr16[5]) == 0) && \ | ||
| 115 | (((a)->s6_addr16[6]) == 0) && \ | ||
| 116 | (((a)->s6_addr[14]) == 0) && \ | ||
| 117 | ((((a)->s6_addr[15]) == 1) || (((a)->s6_addr[15]) == 2))) | ||
| 118 | |||
| 119 | /* 48 bits, FFXX::00XX:XXXX:XXXX */ | 91 | /* 48 bits, FFXX::00XX:XXXX:XXXX */ |
| 120 | #define lowpan_is_mcast_addr_compressable48(a) \ | 92 | #define lowpan_is_mcast_addr_compressable48(a) \ |
| 121 | ((((a)->s6_addr16[1]) == 0) && \ | 93 | ((((a)->s6_addr16[1]) == 0) && \ |
| @@ -168,17 +140,6 @@ | |||
| 168 | #define LOWPAN_FRAGN_HEAD_SIZE 0x5 | 140 | #define LOWPAN_FRAGN_HEAD_SIZE 0x5 |
| 169 | 141 | ||
| 170 | /* | 142 | /* |
| 171 | * According IEEE802.15.4 standard: | ||
| 172 | * - MTU is 127 octets | ||
| 173 | * - maximum MHR size is 37 octets | ||
| 174 | * - MFR size is 2 octets | ||
| 175 | * | ||
| 176 | * so minimal payload size that we may guarantee is: | ||
| 177 | * MTU - MHR - MFR = 88 octets | ||
| 178 | */ | ||
| 179 | #define LOWPAN_FRAG_SIZE 88 | ||
| 180 | |||
| 181 | /* | ||
| 182 | * Values of fields within the IPHC encoding first byte | 143 | * Values of fields within the IPHC encoding first byte |
| 183 | * (C stands for compressed and I for inline) | 144 | * (C stands for compressed and I for inline) |
| 184 | */ | 145 | */ |
| @@ -279,17 +240,6 @@ static inline int lowpan_fetch_skb_u8(struct sk_buff *skb, u8 *val) | |||
| 279 | return 0; | 240 | return 0; |
| 280 | } | 241 | } |
| 281 | 242 | ||
| 282 | static inline int lowpan_fetch_skb_u16(struct sk_buff *skb, u16 *val) | ||
| 283 | { | ||
| 284 | if (unlikely(!pskb_may_pull(skb, 2))) | ||
| 285 | return -EINVAL; | ||
| 286 | |||
| 287 | *val = (skb->data[0] << 8) | skb->data[1]; | ||
| 288 | skb_pull(skb, 2); | ||
| 289 | |||
| 290 | return 0; | ||
| 291 | } | ||
| 292 | |||
| 293 | static inline bool lowpan_fetch_skb(struct sk_buff *skb, | 243 | static inline bool lowpan_fetch_skb(struct sk_buff *skb, |
| 294 | void *data, const unsigned int len) | 244 | void *data, const unsigned int len) |
| 295 | { | 245 | { |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 904777c1cd24..373000de610d 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -260,15 +260,15 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock); | |||
| 260 | 260 | ||
| 261 | /* Skb helpers */ | 261 | /* Skb helpers */ |
| 262 | struct l2cap_ctrl { | 262 | struct l2cap_ctrl { |
| 263 | unsigned int sframe:1, | 263 | __u8 sframe:1, |
| 264 | poll:1, | 264 | poll:1, |
| 265 | final:1, | 265 | final:1, |
| 266 | fcs:1, | 266 | fcs:1, |
| 267 | sar:2, | 267 | sar:2, |
| 268 | super:2; | 268 | super:2; |
| 269 | __u16 reqseq; | 269 | __u16 reqseq; |
| 270 | __u16 txseq; | 270 | __u16 txseq; |
| 271 | __u8 retries; | 271 | __u8 retries; |
| 272 | }; | 272 | }; |
| 273 | 273 | ||
| 274 | struct hci_dev; | 274 | struct hci_dev; |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 16587dcd6a91..3f8547f1c6f8 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
| @@ -81,10 +81,54 @@ | |||
| 81 | 81 | ||
| 82 | /* HCI device quirks */ | 82 | /* HCI device quirks */ |
| 83 | enum { | 83 | enum { |
| 84 | /* When this quirk is set, the HCI Reset command is send when | ||
| 85 | * closing the transport instead of when opening it. | ||
| 86 | * | ||
| 87 | * This quirk must be set before hci_register_dev is called. | ||
| 88 | */ | ||
| 84 | HCI_QUIRK_RESET_ON_CLOSE, | 89 | HCI_QUIRK_RESET_ON_CLOSE, |
| 90 | |||
| 91 | /* When this quirk is set, the device is turned into a raw-only | ||
| 92 | * device and it will stay in unconfigured state. | ||
| 93 | * | ||
| 94 | * This quirk must be set before hci_register_dev is called. | ||
| 95 | */ | ||
| 85 | HCI_QUIRK_RAW_DEVICE, | 96 | HCI_QUIRK_RAW_DEVICE, |
| 97 | |||
| 98 | /* When this quirk is set, the buffer sizes reported by | ||
| 99 | * HCI Read Buffer Size command are corrected if invalid. | ||
| 100 | * | ||
| 101 | * This quirk must be set before hci_register_dev is called. | ||
| 102 | */ | ||
| 86 | HCI_QUIRK_FIXUP_BUFFER_SIZE, | 103 | HCI_QUIRK_FIXUP_BUFFER_SIZE, |
| 104 | |||
| 105 | /* When this quirk is set, then no stored link key handling | ||
| 106 | * is performed. This is mainly due to the fact that the | ||
| 107 | * HCI Delete Stored Link Key command is advertised, but | ||
| 108 | * not supported. | ||
| 109 | * | ||
| 110 | * This quirk must be set before hci_register_dev is called. | ||
| 111 | */ | ||
| 87 | HCI_QUIRK_BROKEN_STORED_LINK_KEY, | 112 | HCI_QUIRK_BROKEN_STORED_LINK_KEY, |
| 113 | |||
| 114 | /* When this quirk is set, an external configuration step | ||
| 115 | * is required and will be indicated with the controller | ||
| 116 | * configuation. | ||
| 117 | * | ||
| 118 | * This quirk can be set before hci_register_dev is called or | ||
| 119 | * during the hdev->setup vendor callback. | ||
| 120 | */ | ||
| 121 | HCI_QUIRK_EXTERNAL_CONFIG, | ||
| 122 | |||
| 123 | /* When this quirk is set, the public Bluetooth address | ||
| 124 | * initially reported by HCI Read BD Address command | ||
| 125 | * is considered invalid. Controller configuration is | ||
| 126 | * required before this device can be used. | ||
| 127 | * | ||
| 128 | * This quirk can be set before hci_register_dev is called or | ||
| 129 | * during the hdev->setup vendor callback. | ||
| 130 | */ | ||
| 131 | HCI_QUIRK_INVALID_BDADDR, | ||
| 88 | }; | 132 | }; |
| 89 | 133 | ||
| 90 | /* HCI device flags */ | 134 | /* HCI device flags */ |
| @@ -104,24 +148,34 @@ enum { | |||
| 104 | HCI_RESET, | 148 | HCI_RESET, |
| 105 | }; | 149 | }; |
| 106 | 150 | ||
| 151 | /* BR/EDR and/or LE controller flags: the flags defined here should represent | ||
| 152 | * states configured via debugfs for debugging and testing purposes only. | ||
| 153 | */ | ||
| 154 | enum { | ||
| 155 | HCI_DUT_MODE, | ||
| 156 | HCI_FORCE_SC, | ||
| 157 | HCI_FORCE_STATIC_ADDR, | ||
| 158 | }; | ||
| 159 | |||
| 107 | /* | 160 | /* |
| 108 | * BR/EDR and/or LE controller flags: the flags defined here should represent | 161 | * BR/EDR and/or LE controller flags: the flags defined here should represent |
| 109 | * states from the controller. | 162 | * states from the controller. |
| 110 | */ | 163 | */ |
| 111 | enum { | 164 | enum { |
| 112 | HCI_SETUP, | 165 | HCI_SETUP, |
| 166 | HCI_CONFIG, | ||
| 113 | HCI_AUTO_OFF, | 167 | HCI_AUTO_OFF, |
| 114 | HCI_RFKILLED, | 168 | HCI_RFKILLED, |
| 115 | HCI_MGMT, | 169 | HCI_MGMT, |
| 116 | HCI_PAIRABLE, | 170 | HCI_BONDABLE, |
| 117 | HCI_SERVICE_CACHE, | 171 | HCI_SERVICE_CACHE, |
| 118 | HCI_DEBUG_KEYS, | 172 | HCI_KEEP_DEBUG_KEYS, |
| 119 | HCI_DUT_MODE, | 173 | HCI_USE_DEBUG_KEYS, |
| 120 | HCI_FORCE_SC, | ||
| 121 | HCI_FORCE_STATIC_ADDR, | ||
| 122 | HCI_UNREGISTER, | 174 | HCI_UNREGISTER, |
| 175 | HCI_UNCONFIGURED, | ||
| 123 | HCI_USER_CHANNEL, | 176 | HCI_USER_CHANNEL, |
| 124 | 177 | HCI_EXT_CONFIGURED, | |
| 178 | HCI_LE_ADV, | ||
| 125 | HCI_LE_SCAN, | 179 | HCI_LE_SCAN, |
| 126 | HCI_SSP_ENABLED, | 180 | HCI_SSP_ENABLED, |
| 127 | HCI_SC_ENABLED, | 181 | HCI_SC_ENABLED, |
| @@ -139,7 +193,6 @@ enum { | |||
| 139 | HCI_PERIODIC_INQ, | 193 | HCI_PERIODIC_INQ, |
| 140 | HCI_FAST_CONNECTABLE, | 194 | HCI_FAST_CONNECTABLE, |
| 141 | HCI_BREDR_ENABLED, | 195 | HCI_BREDR_ENABLED, |
| 142 | HCI_6LOWPAN_ENABLED, | ||
| 143 | HCI_LE_SCAN_INTERRUPTED, | 196 | HCI_LE_SCAN_INTERRUPTED, |
| 144 | }; | 197 | }; |
| 145 | 198 | ||
| @@ -147,34 +200,7 @@ enum { | |||
| 147 | * or the HCI device is closed. | 200 | * or the HCI device is closed. |
| 148 | */ | 201 | */ |
| 149 | #define HCI_PERSISTENT_MASK (BIT(HCI_LE_SCAN) | BIT(HCI_PERIODIC_INQ) | \ | 202 | #define HCI_PERSISTENT_MASK (BIT(HCI_LE_SCAN) | BIT(HCI_PERIODIC_INQ) | \ |
| 150 | BIT(HCI_FAST_CONNECTABLE)) | 203 | BIT(HCI_FAST_CONNECTABLE) | BIT(HCI_LE_ADV)) |
| 151 | |||
| 152 | /* HCI ioctl defines */ | ||
| 153 | #define HCIDEVUP _IOW('H', 201, int) | ||
| 154 | #define HCIDEVDOWN _IOW('H', 202, int) | ||
| 155 | #define HCIDEVRESET _IOW('H', 203, int) | ||
| 156 | #define HCIDEVRESTAT _IOW('H', 204, int) | ||
| 157 | |||
| 158 | #define HCIGETDEVLIST _IOR('H', 210, int) | ||
| 159 | #define HCIGETDEVINFO _IOR('H', 211, int) | ||
| 160 | #define HCIGETCONNLIST _IOR('H', 212, int) | ||
| 161 | #define HCIGETCONNINFO _IOR('H', 213, int) | ||
| 162 | #define HCIGETAUTHINFO _IOR('H', 215, int) | ||
| 163 | |||
| 164 | #define HCISETRAW _IOW('H', 220, int) | ||
| 165 | #define HCISETSCAN _IOW('H', 221, int) | ||
| 166 | #define HCISETAUTH _IOW('H', 222, int) | ||
| 167 | #define HCISETENCRYPT _IOW('H', 223, int) | ||
| 168 | #define HCISETPTYPE _IOW('H', 224, int) | ||
| 169 | #define HCISETLINKPOL _IOW('H', 225, int) | ||
| 170 | #define HCISETLINKMODE _IOW('H', 226, int) | ||
| 171 | #define HCISETACLMTU _IOW('H', 227, int) | ||
| 172 | #define HCISETSCOMTU _IOW('H', 228, int) | ||
| 173 | |||
| 174 | #define HCIBLOCKADDR _IOW('H', 230, int) | ||
| 175 | #define HCIUNBLOCKADDR _IOW('H', 231, int) | ||
| 176 | |||
| 177 | #define HCIINQUIRY _IOR('H', 240, int) | ||
| 178 | 204 | ||
| 179 | /* HCI timeouts */ | 205 | /* HCI timeouts */ |
| 180 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 206 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
| @@ -185,6 +211,7 @@ enum { | |||
| 185 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 211 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
| 186 | #define HCI_POWER_OFF_TIMEOUT msecs_to_jiffies(5000) /* 5 seconds */ | 212 | #define HCI_POWER_OFF_TIMEOUT msecs_to_jiffies(5000) /* 5 seconds */ |
| 187 | #define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */ | 213 | #define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */ |
| 214 | #define HCI_LE_AUTOCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | ||
| 188 | 215 | ||
| 189 | /* HCI data types */ | 216 | /* HCI data types */ |
| 190 | #define HCI_COMMAND_PKT 0x01 | 217 | #define HCI_COMMAND_PKT 0x01 |
| @@ -301,6 +328,11 @@ enum { | |||
| 301 | #define LMP_HOST_LE_BREDR 0x04 | 328 | #define LMP_HOST_LE_BREDR 0x04 |
| 302 | #define LMP_HOST_SC 0x08 | 329 | #define LMP_HOST_SC 0x08 |
| 303 | 330 | ||
| 331 | /* LE features */ | ||
| 332 | #define HCI_LE_ENCRYPTION 0x01 | ||
| 333 | #define HCI_LE_CONN_PARAM_REQ_PROC 0x02 | ||
| 334 | #define HCI_LE_PING 0x10 | ||
| 335 | |||
| 304 | /* Connection modes */ | 336 | /* Connection modes */ |
| 305 | #define HCI_CM_ACTIVE 0x0000 | 337 | #define HCI_CM_ACTIVE 0x0000 |
| 306 | #define HCI_CM_HOLD 0x0001 | 338 | #define HCI_CM_HOLD 0x0001 |
| @@ -347,17 +379,9 @@ enum { | |||
| 347 | #define HCI_LK_CHANGED_COMBINATION 0x06 | 379 | #define HCI_LK_CHANGED_COMBINATION 0x06 |
| 348 | #define HCI_LK_UNAUTH_COMBINATION_P256 0x07 | 380 | #define HCI_LK_UNAUTH_COMBINATION_P256 0x07 |
| 349 | #define HCI_LK_AUTH_COMBINATION_P256 0x08 | 381 | #define HCI_LK_AUTH_COMBINATION_P256 0x08 |
| 350 | /* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */ | ||
| 351 | #define HCI_SMP_STK 0x80 | ||
| 352 | #define HCI_SMP_STK_SLAVE 0x81 | ||
| 353 | #define HCI_SMP_LTK 0x82 | ||
| 354 | #define HCI_SMP_LTK_SLAVE 0x83 | ||
| 355 | |||
| 356 | /* Long Term Key types */ | ||
| 357 | #define HCI_LTK_UNAUTH 0x00 | ||
| 358 | #define HCI_LTK_AUTH 0x01 | ||
| 359 | 382 | ||
| 360 | /* ---- HCI Error Codes ---- */ | 383 | /* ---- HCI Error Codes ---- */ |
| 384 | #define HCI_ERROR_UNKNOWN_CONN_ID 0x02 | ||
| 361 | #define HCI_ERROR_AUTH_FAILURE 0x05 | 385 | #define HCI_ERROR_AUTH_FAILURE 0x05 |
| 362 | #define HCI_ERROR_MEMORY_EXCEEDED 0x07 | 386 | #define HCI_ERROR_MEMORY_EXCEEDED 0x07 |
| 363 | #define HCI_ERROR_CONNECTION_TIMEOUT 0x08 | 387 | #define HCI_ERROR_CONNECTION_TIMEOUT 0x08 |
| @@ -367,6 +391,7 @@ enum { | |||
| 367 | #define HCI_ERROR_REMOTE_POWER_OFF 0x15 | 391 | #define HCI_ERROR_REMOTE_POWER_OFF 0x15 |
| 368 | #define HCI_ERROR_LOCAL_HOST_TERM 0x16 | 392 | #define HCI_ERROR_LOCAL_HOST_TERM 0x16 |
| 369 | #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 | 393 | #define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18 |
| 394 | #define HCI_ERROR_INVALID_LL_PARAMS 0x1E | ||
| 370 | #define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c | 395 | #define HCI_ERROR_ADVERTISING_TIMEOUT 0x3c |
| 371 | 396 | ||
| 372 | /* Flow control modes */ | 397 | /* Flow control modes */ |
| @@ -376,6 +401,9 @@ enum { | |||
| 376 | /* The core spec defines 127 as the "not available" value */ | 401 | /* The core spec defines 127 as the "not available" value */ |
| 377 | #define HCI_TX_POWER_INVALID 127 | 402 | #define HCI_TX_POWER_INVALID 127 |
| 378 | 403 | ||
| 404 | #define HCI_ROLE_MASTER 0x00 | ||
| 405 | #define HCI_ROLE_SLAVE 0x01 | ||
| 406 | |||
| 379 | /* Extended Inquiry Response field types */ | 407 | /* Extended Inquiry Response field types */ |
| 380 | #define EIR_FLAGS 0x01 /* flags */ | 408 | #define EIR_FLAGS 0x01 /* flags */ |
| 381 | #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ | 409 | #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ |
| @@ -536,6 +564,11 @@ struct hci_cp_read_remote_version { | |||
| 536 | __le16 handle; | 564 | __le16 handle; |
| 537 | } __packed; | 565 | } __packed; |
| 538 | 566 | ||
| 567 | #define HCI_OP_READ_CLOCK_OFFSET 0x041f | ||
| 568 | struct hci_cp_read_clock_offset { | ||
| 569 | __le16 handle; | ||
| 570 | } __packed; | ||
| 571 | |||
| 539 | #define HCI_OP_SETUP_SYNC_CONN 0x0428 | 572 | #define HCI_OP_SETUP_SYNC_CONN 0x0428 |
| 540 | struct hci_cp_setup_sync_conn { | 573 | struct hci_cp_setup_sync_conn { |
| 541 | __le16 handle; | 574 | __le16 handle; |
| @@ -1041,6 +1074,8 @@ struct hci_rp_read_data_block_size { | |||
| 1041 | __le16 num_blocks; | 1074 | __le16 num_blocks; |
| 1042 | } __packed; | 1075 | } __packed; |
| 1043 | 1076 | ||
| 1077 | #define HCI_OP_READ_LOCAL_CODECS 0x100b | ||
| 1078 | |||
| 1044 | #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b | 1079 | #define HCI_OP_READ_PAGE_SCAN_ACTIVITY 0x0c1b |
| 1045 | struct hci_rp_read_page_scan_activity { | 1080 | struct hci_rp_read_page_scan_activity { |
| 1046 | __u8 status; | 1081 | __u8 status; |
| @@ -1085,6 +1120,18 @@ struct hci_rp_read_rssi { | |||
| 1085 | __s8 rssi; | 1120 | __s8 rssi; |
| 1086 | } __packed; | 1121 | } __packed; |
| 1087 | 1122 | ||
| 1123 | #define HCI_OP_READ_CLOCK 0x1407 | ||
| 1124 | struct hci_cp_read_clock { | ||
| 1125 | __le16 handle; | ||
| 1126 | __u8 which; | ||
| 1127 | } __packed; | ||
| 1128 | struct hci_rp_read_clock { | ||
| 1129 | __u8 status; | ||
| 1130 | __le16 handle; | ||
| 1131 | __le32 clock; | ||
| 1132 | __le16 accuracy; | ||
| 1133 | } __packed; | ||
| 1134 | |||
| 1088 | #define HCI_OP_READ_LOCAL_AMP_INFO 0x1409 | 1135 | #define HCI_OP_READ_LOCAL_AMP_INFO 0x1409 |
| 1089 | struct hci_rp_read_local_amp_info { | 1136 | struct hci_rp_read_local_amp_info { |
| 1090 | __u8 status; | 1137 | __u8 status; |
| @@ -1125,6 +1172,8 @@ struct hci_rp_write_remote_amp_assoc { | |||
| 1125 | __u8 phy_handle; | 1172 | __u8 phy_handle; |
| 1126 | } __packed; | 1173 | } __packed; |
| 1127 | 1174 | ||
| 1175 | #define HCI_OP_GET_MWS_TRANSPORT_CONFIG 0x140c | ||
| 1176 | |||
| 1128 | #define HCI_OP_ENABLE_DUT_MODE 0x1803 | 1177 | #define HCI_OP_ENABLE_DUT_MODE 0x1803 |
| 1129 | 1178 | ||
| 1130 | #define HCI_OP_WRITE_SSP_DEBUG_MODE 0x1804 | 1179 | #define HCI_OP_WRITE_SSP_DEBUG_MODE 0x1804 |
| @@ -1291,6 +1340,23 @@ struct hci_rp_le_read_supported_states { | |||
| 1291 | __u8 le_states[8]; | 1340 | __u8 le_states[8]; |
| 1292 | } __packed; | 1341 | } __packed; |
| 1293 | 1342 | ||
| 1343 | #define HCI_OP_LE_CONN_PARAM_REQ_REPLY 0x2020 | ||
| 1344 | struct hci_cp_le_conn_param_req_reply { | ||
| 1345 | __le16 handle; | ||
| 1346 | __le16 interval_min; | ||
| 1347 | __le16 interval_max; | ||
| 1348 | __le16 latency; | ||
| 1349 | __le16 timeout; | ||
| 1350 | __le16 min_ce_len; | ||
| 1351 | __le16 max_ce_len; | ||
| 1352 | } __packed; | ||
| 1353 | |||
| 1354 | #define HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY 0x2021 | ||
| 1355 | struct hci_cp_le_conn_param_req_neg_reply { | ||
| 1356 | __le16 handle; | ||
| 1357 | __u8 reason; | ||
| 1358 | } __packed; | ||
| 1359 | |||
| 1294 | /* ---- HCI Events ---- */ | 1360 | /* ---- HCI Events ---- */ |
| 1295 | #define HCI_EV_INQUIRY_COMPLETE 0x01 | 1361 | #define HCI_EV_INQUIRY_COMPLETE 0x01 |
| 1296 | 1362 | ||
| @@ -1654,9 +1720,6 @@ struct hci_ev_sync_train_complete { | |||
| 1654 | 1720 | ||
| 1655 | #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54 | 1721 | #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54 |
| 1656 | 1722 | ||
| 1657 | /* Low energy meta events */ | ||
| 1658 | #define LE_CONN_ROLE_MASTER 0x00 | ||
| 1659 | |||
| 1660 | #define HCI_EV_LE_CONN_COMPLETE 0x01 | 1723 | #define HCI_EV_LE_CONN_COMPLETE 0x01 |
| 1661 | struct hci_ev_le_conn_complete { | 1724 | struct hci_ev_le_conn_complete { |
| 1662 | __u8 status; | 1725 | __u8 status; |
| @@ -1670,6 +1733,15 @@ struct hci_ev_le_conn_complete { | |||
| 1670 | __u8 clk_accurancy; | 1733 | __u8 clk_accurancy; |
| 1671 | } __packed; | 1734 | } __packed; |
| 1672 | 1735 | ||
| 1736 | #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 | ||
| 1737 | struct hci_ev_le_conn_update_complete { | ||
| 1738 | __u8 status; | ||
| 1739 | __le16 handle; | ||
| 1740 | __le16 interval; | ||
| 1741 | __le16 latency; | ||
| 1742 | __le16 supervision_timeout; | ||
| 1743 | } __packed; | ||
| 1744 | |||
| 1673 | #define HCI_EV_LE_LTK_REQ 0x05 | 1745 | #define HCI_EV_LE_LTK_REQ 0x05 |
| 1674 | struct hci_ev_le_ltk_req { | 1746 | struct hci_ev_le_ltk_req { |
| 1675 | __le16 handle; | 1747 | __le16 handle; |
| @@ -1677,6 +1749,15 @@ struct hci_ev_le_ltk_req { | |||
| 1677 | __le16 ediv; | 1749 | __le16 ediv; |
| 1678 | } __packed; | 1750 | } __packed; |
| 1679 | 1751 | ||
| 1752 | #define HCI_EV_LE_REMOTE_CONN_PARAM_REQ 0x06 | ||
| 1753 | struct hci_ev_le_remote_conn_param_req { | ||
| 1754 | __le16 handle; | ||
| 1755 | __le16 interval_min; | ||
| 1756 | __le16 interval_max; | ||
| 1757 | __le16 latency; | ||
| 1758 | __le16 timeout; | ||
| 1759 | } __packed; | ||
| 1760 | |||
| 1680 | /* Advertising report event types */ | 1761 | /* Advertising report event types */ |
| 1681 | #define LE_ADV_IND 0x00 | 1762 | #define LE_ADV_IND 0x00 |
| 1682 | #define LE_ADV_DIRECT_IND 0x01 | 1763 | #define LE_ADV_DIRECT_IND 0x01 |
| @@ -1768,126 +1849,4 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) | |||
| 1768 | #define hci_handle(h) (h & 0x0fff) | 1849 | #define hci_handle(h) (h & 0x0fff) |
| 1769 | #define hci_flags(h) (h >> 12) | 1850 | #define hci_flags(h) (h >> 12) |
| 1770 | 1851 | ||
| 1771 | /* ---- HCI Sockets ---- */ | ||
| 1772 | |||
| 1773 | /* Socket options */ | ||
| 1774 | #define HCI_DATA_DIR 1 | ||
| 1775 | #define HCI_FILTER 2 | ||
| 1776 | #define HCI_TIME_STAMP 3 | ||
| 1777 | |||
| 1778 | /* CMSG flags */ | ||
| 1779 | #define HCI_CMSG_DIR 0x0001 | ||
| 1780 | #define HCI_CMSG_TSTAMP 0x0002 | ||
| 1781 | |||
| 1782 | struct sockaddr_hci { | ||
| 1783 | sa_family_t hci_family; | ||
| 1784 | unsigned short hci_dev; | ||
| 1785 | unsigned short hci_channel; | ||
| 1786 | }; | ||
| 1787 | #define HCI_DEV_NONE 0xffff | ||
| 1788 | |||
| 1789 | #define HCI_CHANNEL_RAW 0 | ||
| 1790 | #define HCI_CHANNEL_USER 1 | ||
| 1791 | #define HCI_CHANNEL_MONITOR 2 | ||
| 1792 | #define HCI_CHANNEL_CONTROL 3 | ||
| 1793 | |||
| 1794 | struct hci_filter { | ||
| 1795 | unsigned long type_mask; | ||
| 1796 | unsigned long event_mask[2]; | ||
| 1797 | __le16 opcode; | ||
| 1798 | }; | ||
| 1799 | |||
| 1800 | struct hci_ufilter { | ||
| 1801 | __u32 type_mask; | ||
| 1802 | __u32 event_mask[2]; | ||
| 1803 | __le16 opcode; | ||
| 1804 | }; | ||
| 1805 | |||
| 1806 | #define HCI_FLT_TYPE_BITS 31 | ||
| 1807 | #define HCI_FLT_EVENT_BITS 63 | ||
| 1808 | #define HCI_FLT_OGF_BITS 63 | ||
| 1809 | #define HCI_FLT_OCF_BITS 127 | ||
| 1810 | |||
| 1811 | /* ---- HCI Ioctl requests structures ---- */ | ||
| 1812 | struct hci_dev_stats { | ||
| 1813 | __u32 err_rx; | ||
| 1814 | __u32 err_tx; | ||
| 1815 | __u32 cmd_tx; | ||
| 1816 | __u32 evt_rx; | ||
| 1817 | __u32 acl_tx; | ||
| 1818 | __u32 acl_rx; | ||
| 1819 | __u32 sco_tx; | ||
| 1820 | __u32 sco_rx; | ||
| 1821 | __u32 byte_rx; | ||
| 1822 | __u32 byte_tx; | ||
| 1823 | }; | ||
| 1824 | |||
| 1825 | struct hci_dev_info { | ||
| 1826 | __u16 dev_id; | ||
| 1827 | char name[8]; | ||
| 1828 | |||
| 1829 | bdaddr_t bdaddr; | ||
| 1830 | |||
| 1831 | __u32 flags; | ||
| 1832 | __u8 type; | ||
| 1833 | |||
| 1834 | __u8 features[8]; | ||
| 1835 | |||
| 1836 | __u32 pkt_type; | ||
| 1837 | __u32 link_policy; | ||
| 1838 | __u32 link_mode; | ||
| 1839 | |||
| 1840 | __u16 acl_mtu; | ||
| 1841 | __u16 acl_pkts; | ||
| 1842 | __u16 sco_mtu; | ||
| 1843 | __u16 sco_pkts; | ||
| 1844 | |||
| 1845 | struct hci_dev_stats stat; | ||
| 1846 | }; | ||
| 1847 | |||
| 1848 | struct hci_conn_info { | ||
| 1849 | __u16 handle; | ||
| 1850 | bdaddr_t bdaddr; | ||
| 1851 | __u8 type; | ||
| 1852 | __u8 out; | ||
| 1853 | __u16 state; | ||
| 1854 | __u32 link_mode; | ||
| 1855 | }; | ||
| 1856 | |||
| 1857 | struct hci_dev_req { | ||
| 1858 | __u16 dev_id; | ||
| 1859 | __u32 dev_opt; | ||
| 1860 | }; | ||
| 1861 | |||
| 1862 | struct hci_dev_list_req { | ||
| 1863 | __u16 dev_num; | ||
| 1864 | struct hci_dev_req dev_req[0]; /* hci_dev_req structures */ | ||
| 1865 | }; | ||
| 1866 | |||
| 1867 | struct hci_conn_list_req { | ||
| 1868 | __u16 dev_id; | ||
| 1869 | __u16 conn_num; | ||
| 1870 | struct hci_conn_info conn_info[0]; | ||
| 1871 | }; | ||
| 1872 | |||
| 1873 | struct hci_conn_info_req { | ||
| 1874 | bdaddr_t bdaddr; | ||
| 1875 | __u8 type; | ||
| 1876 | struct hci_conn_info conn_info[0]; | ||
| 1877 | }; | ||
| 1878 | |||
| 1879 | struct hci_auth_info_req { | ||
| 1880 | bdaddr_t bdaddr; | ||
| 1881 | __u8 type; | ||
| 1882 | }; | ||
| 1883 | |||
| 1884 | struct hci_inquiry_req { | ||
| 1885 | __u16 dev_id; | ||
| 1886 | __u16 flags; | ||
| 1887 | __u8 lap[3]; | ||
| 1888 | __u8 length; | ||
| 1889 | __u8 num_rsp; | ||
| 1890 | }; | ||
| 1891 | #define IREQ_CACHE_FLUSH 0x0001 | ||
| 1892 | |||
| 1893 | #endif /* __HCI_H */ | 1852 | #endif /* __HCI_H */ |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index b386bf17e6c2..b5d5af3aa469 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #define __HCI_CORE_H | 26 | #define __HCI_CORE_H |
| 27 | 27 | ||
| 28 | #include <net/bluetooth/hci.h> | 28 | #include <net/bluetooth/hci.h> |
| 29 | #include <net/bluetooth/hci_sock.h> | ||
| 29 | 30 | ||
| 30 | /* HCI priority */ | 31 | /* HCI priority */ |
| 31 | #define HCI_PRIO_MAX 7 | 32 | #define HCI_PRIO_MAX 7 |
| @@ -71,6 +72,7 @@ struct discovery_state { | |||
| 71 | bdaddr_t last_adv_addr; | 72 | bdaddr_t last_adv_addr; |
| 72 | u8 last_adv_addr_type; | 73 | u8 last_adv_addr_type; |
| 73 | s8 last_adv_rssi; | 74 | s8 last_adv_rssi; |
| 75 | u32 last_adv_flags; | ||
| 74 | u8 last_adv_data[HCI_MAX_AD_LENGTH]; | 76 | u8 last_adv_data[HCI_MAX_AD_LENGTH]; |
| 75 | u8 last_adv_data_len; | 77 | u8 last_adv_data_len; |
| 76 | }; | 78 | }; |
| @@ -81,6 +83,7 @@ struct hci_conn_hash { | |||
| 81 | unsigned int amp_num; | 83 | unsigned int amp_num; |
| 82 | unsigned int sco_num; | 84 | unsigned int sco_num; |
| 83 | unsigned int le_num; | 85 | unsigned int le_num; |
| 86 | unsigned int le_num_slave; | ||
| 84 | }; | 87 | }; |
| 85 | 88 | ||
| 86 | struct bdaddr_list { | 89 | struct bdaddr_list { |
| @@ -170,6 +173,8 @@ struct hci_dev { | |||
| 170 | __u8 bus; | 173 | __u8 bus; |
| 171 | __u8 dev_type; | 174 | __u8 dev_type; |
| 172 | bdaddr_t bdaddr; | 175 | bdaddr_t bdaddr; |
| 176 | bdaddr_t setup_addr; | ||
| 177 | bdaddr_t public_addr; | ||
| 173 | bdaddr_t random_addr; | 178 | bdaddr_t random_addr; |
| 174 | bdaddr_t static_addr; | 179 | bdaddr_t static_addr; |
| 175 | __u8 adv_addr_type; | 180 | __u8 adv_addr_type; |
| @@ -198,15 +203,20 @@ struct hci_dev { | |||
| 198 | __u16 page_scan_window; | 203 | __u16 page_scan_window; |
| 199 | __u8 page_scan_type; | 204 | __u8 page_scan_type; |
| 200 | __u8 le_adv_channel_map; | 205 | __u8 le_adv_channel_map; |
| 206 | __u16 le_adv_min_interval; | ||
| 207 | __u16 le_adv_max_interval; | ||
| 201 | __u8 le_scan_type; | 208 | __u8 le_scan_type; |
| 202 | __u16 le_scan_interval; | 209 | __u16 le_scan_interval; |
| 203 | __u16 le_scan_window; | 210 | __u16 le_scan_window; |
| 204 | __u16 le_conn_min_interval; | 211 | __u16 le_conn_min_interval; |
| 205 | __u16 le_conn_max_interval; | 212 | __u16 le_conn_max_interval; |
| 213 | __u16 le_conn_latency; | ||
| 214 | __u16 le_supv_timeout; | ||
| 206 | __u16 discov_interleaved_timeout; | 215 | __u16 discov_interleaved_timeout; |
| 207 | __u16 conn_info_min_age; | 216 | __u16 conn_info_min_age; |
| 208 | __u16 conn_info_max_age; | 217 | __u16 conn_info_max_age; |
| 209 | __u8 ssp_debug_mode; | 218 | __u8 ssp_debug_mode; |
| 219 | __u32 clock; | ||
| 210 | 220 | ||
| 211 | __u16 devid_source; | 221 | __u16 devid_source; |
| 212 | __u16 devid_vendor; | 222 | __u16 devid_vendor; |
| @@ -273,7 +283,7 @@ struct hci_dev { | |||
| 273 | 283 | ||
| 274 | struct delayed_work service_cache; | 284 | struct delayed_work service_cache; |
| 275 | 285 | ||
| 276 | struct timer_list cmd_timer; | 286 | struct delayed_work cmd_timer; |
| 277 | 287 | ||
| 278 | struct work_struct rx_work; | 288 | struct work_struct rx_work; |
| 279 | struct work_struct cmd_work; | 289 | struct work_struct cmd_work; |
| @@ -299,6 +309,7 @@ struct hci_dev { | |||
| 299 | 309 | ||
| 300 | struct list_head mgmt_pending; | 310 | struct list_head mgmt_pending; |
| 301 | struct list_head blacklist; | 311 | struct list_head blacklist; |
| 312 | struct list_head whitelist; | ||
| 302 | struct list_head uuids; | 313 | struct list_head uuids; |
| 303 | struct list_head link_keys; | 314 | struct list_head link_keys; |
| 304 | struct list_head long_term_keys; | 315 | struct list_head long_term_keys; |
| @@ -307,6 +318,7 @@ struct hci_dev { | |||
| 307 | struct list_head le_white_list; | 318 | struct list_head le_white_list; |
| 308 | struct list_head le_conn_params; | 319 | struct list_head le_conn_params; |
| 309 | struct list_head pend_le_conns; | 320 | struct list_head pend_le_conns; |
| 321 | struct list_head pend_le_reports; | ||
| 310 | 322 | ||
| 311 | struct hci_dev_stats stat; | 323 | struct hci_dev_stats stat; |
| 312 | 324 | ||
| @@ -318,6 +330,7 @@ struct hci_dev { | |||
| 318 | 330 | ||
| 319 | struct rfkill *rfkill; | 331 | struct rfkill *rfkill; |
| 320 | 332 | ||
| 333 | unsigned long dbg_flags; | ||
| 321 | unsigned long dev_flags; | 334 | unsigned long dev_flags; |
| 322 | 335 | ||
| 323 | struct delayed_work le_scan_disable; | 336 | struct delayed_work le_scan_disable; |
| @@ -339,6 +352,7 @@ struct hci_dev { | |||
| 339 | int (*setup)(struct hci_dev *hdev); | 352 | int (*setup)(struct hci_dev *hdev); |
| 340 | int (*send)(struct hci_dev *hdev, struct sk_buff *skb); | 353 | int (*send)(struct hci_dev *hdev, struct sk_buff *skb); |
| 341 | void (*notify)(struct hci_dev *hdev, unsigned int evt); | 354 | void (*notify)(struct hci_dev *hdev, unsigned int evt); |
| 355 | int (*set_bdaddr)(struct hci_dev *hdev, const bdaddr_t *bdaddr); | ||
| 342 | }; | 356 | }; |
| 343 | 357 | ||
| 344 | #define HCI_PHY_HANDLE(handle) (handle & 0xff) | 358 | #define HCI_PHY_HANDLE(handle) (handle & 0xff) |
| @@ -360,13 +374,13 @@ struct hci_conn { | |||
| 360 | __u16 state; | 374 | __u16 state; |
| 361 | __u8 mode; | 375 | __u8 mode; |
| 362 | __u8 type; | 376 | __u8 type; |
| 377 | __u8 role; | ||
| 363 | bool out; | 378 | bool out; |
| 364 | __u8 attempt; | 379 | __u8 attempt; |
| 365 | __u8 dev_class[3]; | 380 | __u8 dev_class[3]; |
| 366 | __u8 features[HCI_MAX_PAGES][8]; | 381 | __u8 features[HCI_MAX_PAGES][8]; |
| 367 | __u16 pkt_type; | 382 | __u16 pkt_type; |
| 368 | __u16 link_policy; | 383 | __u16 link_policy; |
| 369 | __u32 link_mode; | ||
| 370 | __u8 key_type; | 384 | __u8 key_type; |
| 371 | __u8 auth_type; | 385 | __u8 auth_type; |
| 372 | __u8 sec_level; | 386 | __u8 sec_level; |
| @@ -377,20 +391,26 @@ struct hci_conn { | |||
| 377 | __u32 passkey_notify; | 391 | __u32 passkey_notify; |
| 378 | __u8 passkey_entered; | 392 | __u8 passkey_entered; |
| 379 | __u16 disc_timeout; | 393 | __u16 disc_timeout; |
| 394 | __u16 conn_timeout; | ||
| 380 | __u16 setting; | 395 | __u16 setting; |
| 381 | __u16 le_conn_min_interval; | 396 | __u16 le_conn_min_interval; |
| 382 | __u16 le_conn_max_interval; | 397 | __u16 le_conn_max_interval; |
| 398 | __u16 le_conn_interval; | ||
| 399 | __u16 le_conn_latency; | ||
| 400 | __u16 le_supv_timeout; | ||
| 383 | __s8 rssi; | 401 | __s8 rssi; |
| 384 | __s8 tx_power; | 402 | __s8 tx_power; |
| 385 | __s8 max_tx_power; | 403 | __s8 max_tx_power; |
| 386 | unsigned long flags; | 404 | unsigned long flags; |
| 387 | 405 | ||
| 406 | __u32 clock; | ||
| 407 | __u16 clock_accuracy; | ||
| 408 | |||
| 388 | unsigned long conn_info_timestamp; | 409 | unsigned long conn_info_timestamp; |
| 389 | 410 | ||
| 390 | __u8 remote_cap; | 411 | __u8 remote_cap; |
| 391 | __u8 remote_auth; | 412 | __u8 remote_auth; |
| 392 | __u8 remote_id; | 413 | __u8 remote_id; |
| 393 | bool flush_key; | ||
| 394 | 414 | ||
| 395 | unsigned int sent; | 415 | unsigned int sent; |
| 396 | 416 | ||
| @@ -407,7 +427,6 @@ struct hci_conn { | |||
| 407 | struct hci_dev *hdev; | 427 | struct hci_dev *hdev; |
| 408 | void *l2cap_data; | 428 | void *l2cap_data; |
| 409 | void *sco_data; | 429 | void *sco_data; |
| 410 | void *smp_conn; | ||
| 411 | struct amp_mgr *amp_mgr; | 430 | struct amp_mgr *amp_mgr; |
| 412 | 431 | ||
| 413 | struct hci_conn *link; | 432 | struct hci_conn *link; |
| @@ -428,15 +447,20 @@ struct hci_chan { | |||
| 428 | 447 | ||
| 429 | struct hci_conn_params { | 448 | struct hci_conn_params { |
| 430 | struct list_head list; | 449 | struct list_head list; |
| 450 | struct list_head action; | ||
| 431 | 451 | ||
| 432 | bdaddr_t addr; | 452 | bdaddr_t addr; |
| 433 | u8 addr_type; | 453 | u8 addr_type; |
| 434 | 454 | ||
| 435 | u16 conn_min_interval; | 455 | u16 conn_min_interval; |
| 436 | u16 conn_max_interval; | 456 | u16 conn_max_interval; |
| 457 | u16 conn_latency; | ||
| 458 | u16 supervision_timeout; | ||
| 437 | 459 | ||
| 438 | enum { | 460 | enum { |
| 439 | HCI_AUTO_CONN_DISABLED, | 461 | HCI_AUTO_CONN_DISABLED, |
| 462 | HCI_AUTO_CONN_REPORT, | ||
| 463 | HCI_AUTO_CONN_DIRECT, | ||
| 440 | HCI_AUTO_CONN_ALWAYS, | 464 | HCI_AUTO_CONN_ALWAYS, |
| 441 | HCI_AUTO_CONN_LINK_LOSS, | 465 | HCI_AUTO_CONN_LINK_LOSS, |
| 442 | } auto_connect; | 466 | } auto_connect; |
| @@ -501,8 +525,8 @@ struct inquiry_entry *hci_inquiry_cache_lookup_resolve(struct hci_dev *hdev, | |||
| 501 | int state); | 525 | int state); |
| 502 | void hci_inquiry_cache_update_resolve(struct hci_dev *hdev, | 526 | void hci_inquiry_cache_update_resolve(struct hci_dev *hdev, |
| 503 | struct inquiry_entry *ie); | 527 | struct inquiry_entry *ie); |
| 504 | bool hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data, | 528 | u32 hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data, |
| 505 | bool name_known, bool *ssp); | 529 | bool name_known); |
| 506 | void hci_inquiry_cache_flush(struct hci_dev *hdev); | 530 | void hci_inquiry_cache_flush(struct hci_dev *hdev); |
| 507 | 531 | ||
| 508 | /* ----- HCI Connections ----- */ | 532 | /* ----- HCI Connections ----- */ |
| @@ -520,7 +544,13 @@ enum { | |||
| 520 | HCI_CONN_AES_CCM, | 544 | HCI_CONN_AES_CCM, |
| 521 | HCI_CONN_POWER_SAVE, | 545 | HCI_CONN_POWER_SAVE, |
| 522 | HCI_CONN_REMOTE_OOB, | 546 | HCI_CONN_REMOTE_OOB, |
| 523 | HCI_CONN_6LOWPAN, | 547 | HCI_CONN_FLUSH_KEY, |
| 548 | HCI_CONN_ENCRYPT, | ||
| 549 | HCI_CONN_AUTH, | ||
| 550 | HCI_CONN_SECURE, | ||
| 551 | HCI_CONN_FIPS, | ||
| 552 | HCI_CONN_STK_ENCRYPT, | ||
| 553 | HCI_CONN_AUTH_INITIATOR, | ||
| 524 | }; | 554 | }; |
| 525 | 555 | ||
| 526 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) | 556 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) |
| @@ -550,6 +580,8 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c) | |||
| 550 | break; | 580 | break; |
| 551 | case LE_LINK: | 581 | case LE_LINK: |
| 552 | h->le_num++; | 582 | h->le_num++; |
| 583 | if (c->role == HCI_ROLE_SLAVE) | ||
| 584 | h->le_num_slave++; | ||
| 553 | break; | 585 | break; |
| 554 | case SCO_LINK: | 586 | case SCO_LINK: |
| 555 | case ESCO_LINK: | 587 | case ESCO_LINK: |
| @@ -574,6 +606,8 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c) | |||
| 574 | break; | 606 | break; |
| 575 | case LE_LINK: | 607 | case LE_LINK: |
| 576 | h->le_num--; | 608 | h->le_num--; |
| 609 | if (c->role == HCI_ROLE_SLAVE) | ||
| 610 | h->le_num_slave--; | ||
| 577 | break; | 611 | break; |
| 578 | case SCO_LINK: | 612 | case SCO_LINK: |
| 579 | case ESCO_LINK: | 613 | case ESCO_LINK: |
| @@ -670,7 +704,8 @@ void hci_disconnect(struct hci_conn *conn, __u8 reason); | |||
| 670 | bool hci_setup_sync(struct hci_conn *conn, __u16 handle); | 704 | bool hci_setup_sync(struct hci_conn *conn, __u16 handle); |
| 671 | void hci_sco_setup(struct hci_conn *conn, __u8 status); | 705 | void hci_sco_setup(struct hci_conn *conn, __u8 status); |
| 672 | 706 | ||
| 673 | struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst); | 707 | struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst, |
| 708 | u8 role); | ||
| 674 | int hci_conn_del(struct hci_conn *conn); | 709 | int hci_conn_del(struct hci_conn *conn); |
| 675 | void hci_conn_hash_flush(struct hci_dev *hdev); | 710 | void hci_conn_hash_flush(struct hci_dev *hdev); |
| 676 | void hci_conn_check_pending(struct hci_dev *hdev); | 711 | void hci_conn_check_pending(struct hci_dev *hdev); |
| @@ -681,14 +716,16 @@ void hci_chan_list_flush(struct hci_conn *conn); | |||
| 681 | struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle); | 716 | struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle); |
| 682 | 717 | ||
| 683 | struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst, | 718 | struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst, |
| 684 | u8 dst_type, u8 sec_level, u8 auth_type); | 719 | u8 dst_type, u8 sec_level, u16 conn_timeout, |
| 720 | u8 role); | ||
| 685 | struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst, | 721 | struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst, |
| 686 | u8 sec_level, u8 auth_type); | 722 | u8 sec_level, u8 auth_type); |
| 687 | struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst, | 723 | struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst, |
| 688 | __u16 setting); | 724 | __u16 setting); |
| 689 | int hci_conn_check_link_mode(struct hci_conn *conn); | 725 | int hci_conn_check_link_mode(struct hci_conn *conn); |
| 690 | int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); | 726 | int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); |
| 691 | int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type); | 727 | int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type, |
| 728 | bool initiator); | ||
| 692 | int hci_conn_change_link_key(struct hci_conn *conn); | 729 | int hci_conn_change_link_key(struct hci_conn *conn); |
| 693 | int hci_conn_switch_role(struct hci_conn *conn, __u8 role); | 730 | int hci_conn_switch_role(struct hci_conn *conn, __u8 role); |
| 694 | 731 | ||
| @@ -825,30 +862,25 @@ int hci_get_conn_info(struct hci_dev *hdev, void __user *arg); | |||
| 825 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); | 862 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); |
| 826 | int hci_inquiry(void __user *arg); | 863 | int hci_inquiry(void __user *arg); |
| 827 | 864 | ||
| 828 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, | 865 | struct bdaddr_list *hci_bdaddr_list_lookup(struct list_head *list, |
| 829 | bdaddr_t *bdaddr, u8 type); | 866 | bdaddr_t *bdaddr, u8 type); |
| 830 | int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 867 | int hci_bdaddr_list_add(struct list_head *list, bdaddr_t *bdaddr, u8 type); |
| 831 | int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 868 | int hci_bdaddr_list_del(struct list_head *list, bdaddr_t *bdaddr, u8 type); |
| 832 | 869 | void hci_bdaddr_list_clear(struct list_head *list); | |
| 833 | struct bdaddr_list *hci_white_list_lookup(struct hci_dev *hdev, | ||
| 834 | bdaddr_t *bdaddr, u8 type); | ||
| 835 | void hci_white_list_clear(struct hci_dev *hdev); | ||
| 836 | int hci_white_list_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | ||
| 837 | int hci_white_list_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | ||
| 838 | 870 | ||
| 839 | struct hci_conn_params *hci_conn_params_lookup(struct hci_dev *hdev, | 871 | struct hci_conn_params *hci_conn_params_lookup(struct hci_dev *hdev, |
| 840 | bdaddr_t *addr, u8 addr_type); | 872 | bdaddr_t *addr, u8 addr_type); |
| 841 | int hci_conn_params_add(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type, | 873 | struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev, |
| 842 | u8 auto_connect, u16 conn_min_interval, | 874 | bdaddr_t *addr, u8 addr_type); |
| 843 | u16 conn_max_interval); | 875 | int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type, |
| 876 | u8 auto_connect); | ||
| 844 | void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type); | 877 | void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type); |
| 845 | void hci_conn_params_clear(struct hci_dev *hdev); | 878 | void hci_conn_params_clear_all(struct hci_dev *hdev); |
| 879 | void hci_conn_params_clear_disabled(struct hci_dev *hdev); | ||
| 846 | 880 | ||
| 847 | struct bdaddr_list *hci_pend_le_conn_lookup(struct hci_dev *hdev, | 881 | struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list, |
| 848 | bdaddr_t *addr, u8 addr_type); | 882 | bdaddr_t *addr, |
| 849 | void hci_pend_le_conn_add(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type); | 883 | u8 addr_type); |
| 850 | void hci_pend_le_conn_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type); | ||
| 851 | void hci_pend_le_conns_clear(struct hci_dev *hdev); | ||
| 852 | 884 | ||
| 853 | void hci_update_background_scan(struct hci_dev *hdev); | 885 | void hci_update_background_scan(struct hci_dev *hdev); |
| 854 | 886 | ||
| @@ -856,15 +888,16 @@ void hci_uuids_clear(struct hci_dev *hdev); | |||
| 856 | 888 | ||
| 857 | void hci_link_keys_clear(struct hci_dev *hdev); | 889 | void hci_link_keys_clear(struct hci_dev *hdev); |
| 858 | struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); | 890 | struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); |
| 859 | int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, | 891 | struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, |
| 860 | bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len); | 892 | bdaddr_t *bdaddr, u8 *val, u8 type, |
| 893 | u8 pin_len, bool *persistent); | ||
| 861 | struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, __le64 rand, | 894 | struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, __le64 rand, |
| 862 | bool master); | 895 | u8 role); |
| 863 | struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, | 896 | struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, |
| 864 | u8 addr_type, u8 type, u8 authenticated, | 897 | u8 addr_type, u8 type, u8 authenticated, |
| 865 | u8 tk[16], u8 enc_size, __le16 ediv, __le64 rand); | 898 | u8 tk[16], u8 enc_size, __le16 ediv, __le64 rand); |
| 866 | struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, | 899 | struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, |
| 867 | u8 addr_type, bool master); | 900 | u8 addr_type, u8 role); |
| 868 | int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type); | 901 | int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type); |
| 869 | void hci_smp_ltks_clear(struct hci_dev *hdev); | 902 | void hci_smp_ltks_clear(struct hci_dev *hdev); |
| 870 | int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); | 903 | int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); |
| @@ -1021,7 +1054,7 @@ static inline void hci_proto_auth_cfm(struct hci_conn *conn, __u8 status) | |||
| 1021 | if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags)) | 1054 | if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags)) |
| 1022 | return; | 1055 | return; |
| 1023 | 1056 | ||
| 1024 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; | 1057 | encrypt = test_bit(HCI_CONN_ENCRYPT, &conn->flags) ? 0x01 : 0x00; |
| 1025 | l2cap_security_cfm(conn, status, encrypt); | 1058 | l2cap_security_cfm(conn, status, encrypt); |
| 1026 | 1059 | ||
| 1027 | if (conn->security_cfm_cb) | 1060 | if (conn->security_cfm_cb) |
| @@ -1062,7 +1095,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | |||
| 1062 | if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags)) | 1095 | if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags)) |
| 1063 | return; | 1096 | return; |
| 1064 | 1097 | ||
| 1065 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; | 1098 | encrypt = test_bit(HCI_CONN_ENCRYPT, &conn->flags) ? 0x01 : 0x00; |
| 1066 | 1099 | ||
| 1067 | read_lock(&hci_cb_list_lock); | 1100 | read_lock(&hci_cb_list_lock); |
| 1068 | list_for_each_entry(cb, &hci_cb_list, list) { | 1101 | list_for_each_entry(cb, &hci_cb_list, list) { |
| @@ -1147,7 +1180,7 @@ static inline bool eir_has_data_type(u8 *data, size_t data_len, u8 type) | |||
| 1147 | 1180 | ||
| 1148 | static inline bool hci_bdaddr_is_rpa(bdaddr_t *bdaddr, u8 addr_type) | 1181 | static inline bool hci_bdaddr_is_rpa(bdaddr_t *bdaddr, u8 addr_type) |
| 1149 | { | 1182 | { |
| 1150 | if (addr_type != 0x01) | 1183 | if (addr_type != ADDR_LE_DEV_RANDOM) |
| 1151 | return false; | 1184 | return false; |
| 1152 | 1185 | ||
| 1153 | if ((bdaddr->b[5] & 0xc0) == 0x40) | 1186 | if ((bdaddr->b[5] & 0xc0) == 0x40) |
| @@ -1156,6 +1189,18 @@ static inline bool hci_bdaddr_is_rpa(bdaddr_t *bdaddr, u8 addr_type) | |||
| 1156 | return false; | 1189 | return false; |
| 1157 | } | 1190 | } |
| 1158 | 1191 | ||
| 1192 | static inline bool hci_is_identity_address(bdaddr_t *addr, u8 addr_type) | ||
| 1193 | { | ||
| 1194 | if (addr_type == ADDR_LE_DEV_PUBLIC) | ||
| 1195 | return true; | ||
| 1196 | |||
| 1197 | /* Check for Random Static address type */ | ||
| 1198 | if ((addr->b[5] & 0xc0) == 0xc0) | ||
| 1199 | return true; | ||
| 1200 | |||
| 1201 | return false; | ||
| 1202 | } | ||
| 1203 | |||
| 1159 | static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev, | 1204 | static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev, |
| 1160 | bdaddr_t *bdaddr, u8 addr_type) | 1205 | bdaddr_t *bdaddr, u8 addr_type) |
| 1161 | { | 1206 | { |
| @@ -1165,6 +1210,27 @@ static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev, | |||
| 1165 | return hci_find_irk_by_rpa(hdev, bdaddr); | 1210 | return hci_find_irk_by_rpa(hdev, bdaddr); |
| 1166 | } | 1211 | } |
| 1167 | 1212 | ||
| 1213 | static inline int hci_check_conn_params(u16 min, u16 max, u16 latency, | ||
| 1214 | u16 to_multiplier) | ||
| 1215 | { | ||
| 1216 | u16 max_latency; | ||
| 1217 | |||
| 1218 | if (min > max || min < 6 || max > 3200) | ||
| 1219 | return -EINVAL; | ||
| 1220 | |||
| 1221 | if (to_multiplier < 10 || to_multiplier > 3200) | ||
| 1222 | return -EINVAL; | ||
| 1223 | |||
| 1224 | if (max >= to_multiplier * 8) | ||
| 1225 | return -EINVAL; | ||
| 1226 | |||
| 1227 | max_latency = (to_multiplier * 8 / max) - 1; | ||
| 1228 | if (latency > 499 || latency > max_latency) | ||
| 1229 | return -EINVAL; | ||
| 1230 | |||
| 1231 | return 0; | ||
| 1232 | } | ||
| 1233 | |||
| 1168 | int hci_register_cb(struct hci_cb *hcb); | 1234 | int hci_register_cb(struct hci_cb *hcb); |
| 1169 | int hci_unregister_cb(struct hci_cb *hcb); | 1235 | int hci_unregister_cb(struct hci_cb *hcb); |
| 1170 | 1236 | ||
| @@ -1185,6 +1251,7 @@ void hci_req_add(struct hci_request *req, u16 opcode, u32 plen, | |||
| 1185 | void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen, | 1251 | void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen, |
| 1186 | const void *param, u8 event); | 1252 | const void *param, u8 event); |
| 1187 | void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status); | 1253 | void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status); |
| 1254 | bool hci_req_pending(struct hci_dev *hdev); | ||
| 1188 | 1255 | ||
| 1189 | void hci_req_add_le_scan_disable(struct hci_request *req); | 1256 | void hci_req_add_le_scan_disable(struct hci_request *req); |
| 1190 | void hci_req_add_le_passive_scan(struct hci_request *req); | 1257 | void hci_req_add_le_passive_scan(struct hci_request *req); |
| @@ -1227,15 +1294,13 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event); | |||
| 1227 | #define DISCOV_BREDR_INQUIRY_LEN 0x08 | 1294 | #define DISCOV_BREDR_INQUIRY_LEN 0x08 |
| 1228 | 1295 | ||
| 1229 | int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); | 1296 | int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); |
| 1297 | int mgmt_new_settings(struct hci_dev *hdev); | ||
| 1230 | void mgmt_index_added(struct hci_dev *hdev); | 1298 | void mgmt_index_added(struct hci_dev *hdev); |
| 1231 | void mgmt_index_removed(struct hci_dev *hdev); | 1299 | void mgmt_index_removed(struct hci_dev *hdev); |
| 1232 | void mgmt_set_powered_failed(struct hci_dev *hdev, int err); | 1300 | void mgmt_set_powered_failed(struct hci_dev *hdev, int err); |
| 1233 | int mgmt_powered(struct hci_dev *hdev, u8 powered); | 1301 | int mgmt_powered(struct hci_dev *hdev, u8 powered); |
| 1302 | int mgmt_update_adv_data(struct hci_dev *hdev); | ||
| 1234 | void mgmt_discoverable_timeout(struct hci_dev *hdev); | 1303 | void mgmt_discoverable_timeout(struct hci_dev *hdev); |
| 1235 | void mgmt_discoverable(struct hci_dev *hdev, u8 discoverable); | ||
| 1236 | void mgmt_connectable(struct hci_dev *hdev, u8 connectable); | ||
| 1237 | void mgmt_advertising(struct hci_dev *hdev, u8 advertising); | ||
| 1238 | void mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status); | ||
| 1239 | void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, | 1304 | void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, |
| 1240 | bool persistent); | 1305 | bool persistent); |
| 1241 | void mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1306 | void mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
| @@ -1281,51 +1346,23 @@ void mgmt_read_local_oob_data_complete(struct hci_dev *hdev, u8 *hash192, | |||
| 1281 | u8 *randomizer192, u8 *hash256, | 1346 | u8 *randomizer192, u8 *hash256, |
| 1282 | u8 *randomizer256, u8 status); | 1347 | u8 *randomizer256, u8 status); |
| 1283 | void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1348 | void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
| 1284 | u8 addr_type, u8 *dev_class, s8 rssi, u8 cfm_name, | 1349 | u8 addr_type, u8 *dev_class, s8 rssi, u32 flags, |
| 1285 | u8 ssp, u8 *eir, u16 eir_len, u8 *scan_rsp, | 1350 | u8 *eir, u16 eir_len, u8 *scan_rsp, u8 scan_rsp_len); |
| 1286 | u8 scan_rsp_len); | ||
| 1287 | void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1351 | void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
| 1288 | u8 addr_type, s8 rssi, u8 *name, u8 name_len); | 1352 | u8 addr_type, s8 rssi, u8 *name, u8 name_len); |
| 1289 | void mgmt_discovering(struct hci_dev *hdev, u8 discovering); | 1353 | void mgmt_discovering(struct hci_dev *hdev, u8 discovering); |
| 1290 | int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | ||
| 1291 | int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | ||
| 1292 | void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent); | 1354 | void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent); |
| 1293 | void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk); | 1355 | void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk); |
| 1294 | void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk, | 1356 | void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk, |
| 1295 | bool persistent); | 1357 | bool persistent); |
| 1358 | void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr, | ||
| 1359 | u8 bdaddr_type, u8 store_hint, u16 min_interval, | ||
| 1360 | u16 max_interval, u16 latency, u16 timeout); | ||
| 1296 | void mgmt_reenable_advertising(struct hci_dev *hdev); | 1361 | void mgmt_reenable_advertising(struct hci_dev *hdev); |
| 1297 | void mgmt_smp_complete(struct hci_conn *conn, bool complete); | 1362 | void mgmt_smp_complete(struct hci_conn *conn, bool complete); |
| 1298 | 1363 | ||
| 1299 | /* HCI info for socket */ | 1364 | u8 hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency, |
| 1300 | #define hci_pi(sk) ((struct hci_pinfo *) sk) | 1365 | u16 to_multiplier); |
| 1301 | |||
| 1302 | struct hci_pinfo { | ||
| 1303 | struct bt_sock bt; | ||
| 1304 | struct hci_dev *hdev; | ||
| 1305 | struct hci_filter filter; | ||
| 1306 | __u32 cmsg_mask; | ||
| 1307 | unsigned short channel; | ||
| 1308 | }; | ||
| 1309 | |||
| 1310 | /* HCI security filter */ | ||
| 1311 | #define HCI_SFLT_MAX_OGF 5 | ||
| 1312 | |||
| 1313 | struct hci_sec_filter { | ||
| 1314 | __u32 type_mask; | ||
| 1315 | __u32 event_mask[2]; | ||
| 1316 | __u32 ocf_mask[HCI_SFLT_MAX_OGF + 1][4]; | ||
| 1317 | }; | ||
| 1318 | |||
| 1319 | /* ----- HCI requests ----- */ | ||
| 1320 | #define HCI_REQ_DONE 0 | ||
| 1321 | #define HCI_REQ_PEND 1 | ||
| 1322 | #define HCI_REQ_CANCELED 2 | ||
| 1323 | |||
| 1324 | #define hci_req_lock(d) mutex_lock(&d->req_lock) | ||
| 1325 | #define hci_req_unlock(d) mutex_unlock(&d->req_lock) | ||
| 1326 | |||
| 1327 | void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, | ||
| 1328 | u16 latency, u16 to_multiplier); | ||
| 1329 | void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand, | 1366 | void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand, |
| 1330 | __u8 ltk[16]); | 1367 | __u8 ltk[16]); |
| 1331 | 1368 | ||
diff --git a/include/net/bluetooth/hci_sock.h b/include/net/bluetooth/hci_sock.h new file mode 100644 index 000000000000..9a46d665c1b5 --- /dev/null +++ b/include/net/bluetooth/hci_sock.h | |||
| @@ -0,0 +1,175 @@ | |||
| 1 | /* | ||
| 2 | BlueZ - Bluetooth protocol stack for Linux | ||
| 3 | Copyright (C) 2000-2001 Qualcomm Incorporated | ||
| 4 | |||
| 5 | Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.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 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
| 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | ||
| 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | ||
| 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | ||
| 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 19 | |||
| 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | ||
| 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | ||
| 22 | SOFTWARE IS DISCLAIMED. | ||
| 23 | */ | ||
| 24 | |||
| 25 | #ifndef __HCI_SOCK_H | ||
| 26 | #define __HCI_SOCK_H | ||
| 27 | |||
| 28 | /* Socket options */ | ||
| 29 | #define HCI_DATA_DIR 1 | ||
| 30 | #define HCI_FILTER 2 | ||
| 31 | #define HCI_TIME_STAMP 3 | ||
| 32 | |||
| 33 | /* CMSG flags */ | ||
| 34 | #define HCI_CMSG_DIR 0x0001 | ||
| 35 | #define HCI_CMSG_TSTAMP 0x0002 | ||
| 36 | |||
| 37 | struct sockaddr_hci { | ||
| 38 | sa_family_t hci_family; | ||
| 39 | unsigned short hci_dev; | ||
| 40 | unsigned short hci_channel; | ||
| 41 | }; | ||
| 42 | #define HCI_DEV_NONE 0xffff | ||
| 43 | |||
| 44 | #define HCI_CHANNEL_RAW 0 | ||
| 45 | #define HCI_CHANNEL_USER 1 | ||
| 46 | #define HCI_CHANNEL_MONITOR 2 | ||
| 47 | #define HCI_CHANNEL_CONTROL 3 | ||
| 48 | |||
| 49 | struct hci_filter { | ||
| 50 | unsigned long type_mask; | ||
| 51 | unsigned long event_mask[2]; | ||
| 52 | __le16 opcode; | ||
| 53 | }; | ||
| 54 | |||
| 55 | struct hci_ufilter { | ||
| 56 | __u32 type_mask; | ||
| 57 | __u32 event_mask[2]; | ||
| 58 | __le16 opcode; | ||
| 59 | }; | ||
| 60 | |||
| 61 | #define HCI_FLT_TYPE_BITS 31 | ||
| 62 | #define HCI_FLT_EVENT_BITS 63 | ||
| 63 | #define HCI_FLT_OGF_BITS 63 | ||
| 64 | #define HCI_FLT_OCF_BITS 127 | ||
| 65 | |||
| 66 | /* Ioctl defines */ | ||
| 67 | #define HCIDEVUP _IOW('H', 201, int) | ||
| 68 | #define HCIDEVDOWN _IOW('H', 202, int) | ||
| 69 | #define HCIDEVRESET _IOW('H', 203, int) | ||
| 70 | #define HCIDEVRESTAT _IOW('H', 204, int) | ||
| 71 | |||
| 72 | #define HCIGETDEVLIST _IOR('H', 210, int) | ||
| 73 | #define HCIGETDEVINFO _IOR('H', 211, int) | ||
| 74 | #define HCIGETCONNLIST _IOR('H', 212, int) | ||
| 75 | #define HCIGETCONNINFO _IOR('H', 213, int) | ||
| 76 | #define HCIGETAUTHINFO _IOR('H', 215, int) | ||
| 77 | |||
| 78 | #define HCISETRAW _IOW('H', 220, int) | ||
| 79 | #define HCISETSCAN _IOW('H', 221, int) | ||
| 80 | #define HCISETAUTH _IOW('H', 222, int) | ||
| 81 | #define HCISETENCRYPT _IOW('H', 223, int) | ||
| 82 | #define HCISETPTYPE _IOW('H', 224, int) | ||
| 83 | #define HCISETLINKPOL _IOW('H', 225, int) | ||
| 84 | #define HCISETLINKMODE _IOW('H', 226, int) | ||
| 85 | #define HCISETACLMTU _IOW('H', 227, int) | ||
| 86 | #define HCISETSCOMTU _IOW('H', 228, int) | ||
| 87 | |||
| 88 | #define HCIBLOCKADDR _IOW('H', 230, int) | ||
| 89 | #define HCIUNBLOCKADDR _IOW('H', 231, int) | ||
| 90 | |||
| 91 | #define HCIINQUIRY _IOR('H', 240, int) | ||
| 92 | |||
| 93 | /* Ioctl requests structures */ | ||
| 94 | struct hci_dev_stats { | ||
| 95 | __u32 err_rx; | ||
| 96 | __u32 err_tx; | ||
| 97 | __u32 cmd_tx; | ||
| 98 | __u32 evt_rx; | ||
| 99 | __u32 acl_tx; | ||
| 100 | __u32 acl_rx; | ||
| 101 | __u32 sco_tx; | ||
| 102 | __u32 sco_rx; | ||
| 103 | __u32 byte_rx; | ||
| 104 | __u32 byte_tx; | ||
| 105 | }; | ||
| 106 | |||
| 107 | struct hci_dev_info { | ||
| 108 | __u16 dev_id; | ||
| 109 | char name[8]; | ||
| 110 | |||
| 111 | bdaddr_t bdaddr; | ||
| 112 | |||
| 113 | __u32 flags; | ||
| 114 | __u8 type; | ||
| 115 | |||
| 116 | __u8 features[8]; | ||
| 117 | |||
| 118 | __u32 pkt_type; | ||
| 119 | __u32 link_policy; | ||
| 120 | __u32 link_mode; | ||
| 121 | |||
| 122 | __u16 acl_mtu; | ||
| 123 | __u16 acl_pkts; | ||
| 124 | __u16 sco_mtu; | ||
| 125 | __u16 sco_pkts; | ||
| 126 | |||
| 127 | struct hci_dev_stats stat; | ||
| 128 | }; | ||
| 129 | |||
| 130 | struct hci_conn_info { | ||
| 131 | __u16 handle; | ||
| 132 | bdaddr_t bdaddr; | ||
| 133 | __u8 type; | ||
| 134 | __u8 out; | ||
| 135 | __u16 state; | ||
| 136 | __u32 link_mode; | ||
| 137 | }; | ||
| 138 | |||
| 139 | struct hci_dev_req { | ||
| 140 | __u16 dev_id; | ||
| 141 | __u32 dev_opt; | ||
| 142 | }; | ||
| 143 | |||
| 144 | struct hci_dev_list_req { | ||
| 145 | __u16 dev_num; | ||
| 146 | struct hci_dev_req dev_req[0]; /* hci_dev_req structures */ | ||
| 147 | }; | ||
| 148 | |||
| 149 | struct hci_conn_list_req { | ||
| 150 | __u16 dev_id; | ||
| 151 | __u16 conn_num; | ||
| 152 | struct hci_conn_info conn_info[0]; | ||
| 153 | }; | ||
| 154 | |||
| 155 | struct hci_conn_info_req { | ||
| 156 | bdaddr_t bdaddr; | ||
| 157 | __u8 type; | ||
| 158 | struct hci_conn_info conn_info[0]; | ||
| 159 | }; | ||
| 160 | |||
| 161 | struct hci_auth_info_req { | ||
| 162 | bdaddr_t bdaddr; | ||
| 163 | __u8 type; | ||
| 164 | }; | ||
| 165 | |||
| 166 | struct hci_inquiry_req { | ||
| 167 | __u16 dev_id; | ||
| 168 | __u16 flags; | ||
| 169 | __u8 lap[3]; | ||
| 170 | __u8 length; | ||
| 171 | __u8 num_rsp; | ||
| 172 | }; | ||
| 173 | #define IREQ_CACHE_FLUSH 0x0001 | ||
| 174 | |||
| 175 | #endif /* __HCI_SOCK_H */ | ||
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 4abdcb220e3a..8df15ad0d43f 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
| @@ -134,10 +134,12 @@ struct l2cap_conninfo { | |||
| 134 | #define L2CAP_FCS_CRC16 0x01 | 134 | #define L2CAP_FCS_CRC16 0x01 |
| 135 | 135 | ||
| 136 | /* L2CAP fixed channels */ | 136 | /* L2CAP fixed channels */ |
| 137 | #define L2CAP_FC_L2CAP 0x02 | 137 | #define L2CAP_FC_SIG_BREDR 0x02 |
| 138 | #define L2CAP_FC_CONNLESS 0x04 | 138 | #define L2CAP_FC_CONNLESS 0x04 |
| 139 | #define L2CAP_FC_A2MP 0x08 | 139 | #define L2CAP_FC_A2MP 0x08 |
| 140 | #define L2CAP_FC_6LOWPAN 0x3e /* reserved and temporary value */ | 140 | #define L2CAP_FC_ATT 0x10 |
| 141 | #define L2CAP_FC_SIG_LE 0x20 | ||
| 142 | #define L2CAP_FC_SMP_LE 0x40 | ||
| 141 | 143 | ||
| 142 | /* L2CAP Control Field bit masks */ | 144 | /* L2CAP Control Field bit masks */ |
| 143 | #define L2CAP_CTRL_SAR 0xC000 | 145 | #define L2CAP_CTRL_SAR 0xC000 |
| @@ -579,7 +581,7 @@ struct l2cap_chan { | |||
| 579 | struct list_head global_l; | 581 | struct list_head global_l; |
| 580 | 582 | ||
| 581 | void *data; | 583 | void *data; |
| 582 | struct l2cap_ops *ops; | 584 | const struct l2cap_ops *ops; |
| 583 | struct mutex lock; | 585 | struct mutex lock; |
| 584 | }; | 586 | }; |
| 585 | 587 | ||
| @@ -600,7 +602,12 @@ struct l2cap_ops { | |||
| 600 | void (*set_shutdown) (struct l2cap_chan *chan); | 602 | void (*set_shutdown) (struct l2cap_chan *chan); |
| 601 | long (*get_sndtimeo) (struct l2cap_chan *chan); | 603 | long (*get_sndtimeo) (struct l2cap_chan *chan); |
| 602 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, | 604 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, |
| 605 | unsigned long hdr_len, | ||
| 603 | unsigned long len, int nb); | 606 | unsigned long len, int nb); |
| 607 | int (*memcpy_fromiovec) (struct l2cap_chan *chan, | ||
| 608 | unsigned char *kdata, | ||
| 609 | struct iovec *iov, | ||
| 610 | int len); | ||
| 604 | }; | 611 | }; |
| 605 | 612 | ||
| 606 | struct l2cap_conn { | 613 | struct l2cap_conn { |
| @@ -618,11 +625,10 @@ struct l2cap_conn { | |||
| 618 | 625 | ||
| 619 | struct delayed_work info_timer; | 626 | struct delayed_work info_timer; |
| 620 | 627 | ||
| 621 | spinlock_t lock; | ||
| 622 | |||
| 623 | struct sk_buff *rx_skb; | 628 | struct sk_buff *rx_skb; |
| 624 | __u32 rx_len; | 629 | __u32 rx_len; |
| 625 | __u8 tx_ident; | 630 | __u8 tx_ident; |
| 631 | struct mutex ident_lock; | ||
| 626 | 632 | ||
| 627 | struct sk_buff_head pending_rx; | 633 | struct sk_buff_head pending_rx; |
| 628 | struct work_struct pending_rx_work; | 634 | struct work_struct pending_rx_work; |
| @@ -856,6 +862,31 @@ static inline long l2cap_chan_no_get_sndtimeo(struct l2cap_chan *chan) | |||
| 856 | return 0; | 862 | return 0; |
| 857 | } | 863 | } |
| 858 | 864 | ||
| 865 | static inline int l2cap_chan_no_memcpy_fromiovec(struct l2cap_chan *chan, | ||
| 866 | unsigned char *kdata, | ||
| 867 | struct iovec *iov, | ||
| 868 | int len) | ||
| 869 | { | ||
| 870 | /* Following is safe since for compiler definitions of kvec and | ||
| 871 | * iovec are identical, yielding the same in-core layout and alignment | ||
| 872 | */ | ||
| 873 | struct kvec *vec = (struct kvec *)iov; | ||
| 874 | |||
| 875 | while (len > 0) { | ||
| 876 | if (vec->iov_len) { | ||
| 877 | int copy = min_t(unsigned int, len, vec->iov_len); | ||
| 878 | memcpy(kdata, vec->iov_base, copy); | ||
| 879 | len -= copy; | ||
| 880 | kdata += copy; | ||
| 881 | vec->iov_base += copy; | ||
| 882 | vec->iov_len -= copy; | ||
| 883 | } | ||
| 884 | vec++; | ||
| 885 | } | ||
| 886 | |||
| 887 | return 0; | ||
| 888 | } | ||
| 889 | |||
| 859 | extern bool disable_ertm; | 890 | extern bool disable_ertm; |
| 860 | 891 | ||
| 861 | int l2cap_init_sockets(void); | 892 | int l2cap_init_sockets(void); |
| @@ -872,10 +903,9 @@ struct l2cap_chan *l2cap_chan_create(void); | |||
| 872 | void l2cap_chan_close(struct l2cap_chan *chan, int reason); | 903 | void l2cap_chan_close(struct l2cap_chan *chan, int reason); |
| 873 | int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, | 904 | int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, |
| 874 | bdaddr_t *dst, u8 dst_type); | 905 | bdaddr_t *dst, u8 dst_type); |
| 875 | int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, | 906 | int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len); |
| 876 | u32 priority); | ||
| 877 | void l2cap_chan_busy(struct l2cap_chan *chan, int busy); | 907 | void l2cap_chan_busy(struct l2cap_chan *chan, int busy); |
| 878 | int l2cap_chan_check_security(struct l2cap_chan *chan); | 908 | int l2cap_chan_check_security(struct l2cap_chan *chan, bool initiator); |
| 879 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); | 909 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); |
| 880 | int l2cap_ertm_init(struct l2cap_chan *chan); | 910 | int l2cap_ertm_init(struct l2cap_chan *chan); |
| 881 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | 911 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); |
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index bcffc9ae0c89..414cd2f9a437 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
| @@ -87,7 +87,7 @@ struct mgmt_rp_read_index_list { | |||
| 87 | #define MGMT_SETTING_CONNECTABLE 0x00000002 | 87 | #define MGMT_SETTING_CONNECTABLE 0x00000002 |
| 88 | #define MGMT_SETTING_FAST_CONNECTABLE 0x00000004 | 88 | #define MGMT_SETTING_FAST_CONNECTABLE 0x00000004 |
| 89 | #define MGMT_SETTING_DISCOVERABLE 0x00000008 | 89 | #define MGMT_SETTING_DISCOVERABLE 0x00000008 |
| 90 | #define MGMT_SETTING_PAIRABLE 0x00000010 | 90 | #define MGMT_SETTING_BONDABLE 0x00000010 |
| 91 | #define MGMT_SETTING_LINK_SECURITY 0x00000020 | 91 | #define MGMT_SETTING_LINK_SECURITY 0x00000020 |
| 92 | #define MGMT_SETTING_SSP 0x00000040 | 92 | #define MGMT_SETTING_SSP 0x00000040 |
| 93 | #define MGMT_SETTING_BREDR 0x00000080 | 93 | #define MGMT_SETTING_BREDR 0x00000080 |
| @@ -97,6 +97,7 @@ struct mgmt_rp_read_index_list { | |||
| 97 | #define MGMT_SETTING_SECURE_CONN 0x00000800 | 97 | #define MGMT_SETTING_SECURE_CONN 0x00000800 |
| 98 | #define MGMT_SETTING_DEBUG_KEYS 0x00001000 | 98 | #define MGMT_SETTING_DEBUG_KEYS 0x00001000 |
| 99 | #define MGMT_SETTING_PRIVACY 0x00002000 | 99 | #define MGMT_SETTING_PRIVACY 0x00002000 |
| 100 | #define MGMT_SETTING_CONFIGURATION 0x00004000 | ||
| 100 | 101 | ||
| 101 | #define MGMT_OP_READ_INFO 0x0004 | 102 | #define MGMT_OP_READ_INFO 0x0004 |
| 102 | #define MGMT_READ_INFO_SIZE 0 | 103 | #define MGMT_READ_INFO_SIZE 0 |
| @@ -130,7 +131,7 @@ struct mgmt_cp_set_discoverable { | |||
| 130 | 131 | ||
| 131 | #define MGMT_OP_SET_FAST_CONNECTABLE 0x0008 | 132 | #define MGMT_OP_SET_FAST_CONNECTABLE 0x0008 |
| 132 | 133 | ||
| 133 | #define MGMT_OP_SET_PAIRABLE 0x0009 | 134 | #define MGMT_OP_SET_BONDABLE 0x0009 |
| 134 | 135 | ||
| 135 | #define MGMT_OP_SET_LINK_SECURITY 0x000A | 136 | #define MGMT_OP_SET_LINK_SECURITY 0x000A |
| 136 | 137 | ||
| @@ -424,6 +425,76 @@ struct mgmt_rp_get_conn_info { | |||
| 424 | __s8 max_tx_power; | 425 | __s8 max_tx_power; |
| 425 | } __packed; | 426 | } __packed; |
| 426 | 427 | ||
| 428 | #define MGMT_OP_GET_CLOCK_INFO 0x0032 | ||
| 429 | struct mgmt_cp_get_clock_info { | ||
| 430 | struct mgmt_addr_info addr; | ||
| 431 | } __packed; | ||
| 432 | #define MGMT_GET_CLOCK_INFO_SIZE MGMT_ADDR_INFO_SIZE | ||
| 433 | struct mgmt_rp_get_clock_info { | ||
| 434 | struct mgmt_addr_info addr; | ||
| 435 | __le32 local_clock; | ||
| 436 | __le32 piconet_clock; | ||
| 437 | __le16 accuracy; | ||
| 438 | } __packed; | ||
| 439 | |||
| 440 | #define MGMT_OP_ADD_DEVICE 0x0033 | ||
| 441 | struct mgmt_cp_add_device { | ||
| 442 | struct mgmt_addr_info addr; | ||
| 443 | __u8 action; | ||
| 444 | } __packed; | ||
| 445 | #define MGMT_ADD_DEVICE_SIZE (MGMT_ADDR_INFO_SIZE + 1) | ||
| 446 | |||
| 447 | #define MGMT_OP_REMOVE_DEVICE 0x0034 | ||
| 448 | struct mgmt_cp_remove_device { | ||
| 449 | struct mgmt_addr_info addr; | ||
| 450 | } __packed; | ||
| 451 | #define MGMT_REMOVE_DEVICE_SIZE MGMT_ADDR_INFO_SIZE | ||
| 452 | |||
| 453 | struct mgmt_conn_param { | ||
| 454 | struct mgmt_addr_info addr; | ||
| 455 | __le16 min_interval; | ||
| 456 | __le16 max_interval; | ||
| 457 | __le16 latency; | ||
| 458 | __le16 timeout; | ||
| 459 | } __packed; | ||
| 460 | |||
| 461 | #define MGMT_OP_LOAD_CONN_PARAM 0x0035 | ||
| 462 | struct mgmt_cp_load_conn_param { | ||
| 463 | __le16 param_count; | ||
| 464 | struct mgmt_conn_param params[0]; | ||
| 465 | } __packed; | ||
| 466 | #define MGMT_LOAD_CONN_PARAM_SIZE 2 | ||
| 467 | |||
| 468 | #define MGMT_OP_READ_UNCONF_INDEX_LIST 0x0036 | ||
| 469 | #define MGMT_READ_UNCONF_INDEX_LIST_SIZE 0 | ||
| 470 | struct mgmt_rp_read_unconf_index_list { | ||
| 471 | __le16 num_controllers; | ||
| 472 | __le16 index[0]; | ||
| 473 | } __packed; | ||
| 474 | |||
| 475 | #define MGMT_OPTION_EXTERNAL_CONFIG 0x00000001 | ||
| 476 | #define MGMT_OPTION_PUBLIC_ADDRESS 0x00000002 | ||
| 477 | |||
| 478 | #define MGMT_OP_READ_CONFIG_INFO 0x0037 | ||
| 479 | #define MGMT_READ_CONFIG_INFO_SIZE 0 | ||
| 480 | struct mgmt_rp_read_config_info { | ||
| 481 | __le16 manufacturer; | ||
| 482 | __le32 supported_options; | ||
| 483 | __le32 missing_options; | ||
| 484 | } __packed; | ||
| 485 | |||
| 486 | #define MGMT_OP_SET_EXTERNAL_CONFIG 0x0038 | ||
| 487 | struct mgmt_cp_set_external_config { | ||
| 488 | __u8 config; | ||
| 489 | } __packed; | ||
| 490 | #define MGMT_SET_EXTERNAL_CONFIG_SIZE 1 | ||
| 491 | |||
| 492 | #define MGMT_OP_SET_PUBLIC_ADDRESS 0x0039 | ||
| 493 | struct mgmt_cp_set_public_address { | ||
| 494 | bdaddr_t bdaddr; | ||
| 495 | } __packed; | ||
| 496 | #define MGMT_SET_PUBLIC_ADDRESS_SIZE 6 | ||
| 497 | |||
| 427 | #define MGMT_EV_CMD_COMPLETE 0x0001 | 498 | #define MGMT_EV_CMD_COMPLETE 0x0001 |
| 428 | struct mgmt_ev_cmd_complete { | 499 | struct mgmt_ev_cmd_complete { |
| 429 | __le16 opcode; | 500 | __le16 opcode; |
| @@ -522,6 +593,7 @@ struct mgmt_ev_auth_failed { | |||
| 522 | 593 | ||
| 523 | #define MGMT_DEV_FOUND_CONFIRM_NAME 0x01 | 594 | #define MGMT_DEV_FOUND_CONFIRM_NAME 0x01 |
| 524 | #define MGMT_DEV_FOUND_LEGACY_PAIRING 0x02 | 595 | #define MGMT_DEV_FOUND_LEGACY_PAIRING 0x02 |
| 596 | #define MGMT_DEV_FOUND_NOT_CONNECTABLE 0x04 | ||
| 525 | 597 | ||
| 526 | #define MGMT_EV_DEVICE_FOUND 0x0012 | 598 | #define MGMT_EV_DEVICE_FOUND 0x0012 |
| 527 | struct mgmt_ev_device_found { | 599 | struct mgmt_ev_device_found { |
| @@ -578,3 +650,30 @@ struct mgmt_ev_new_csrk { | |||
| 578 | __u8 store_hint; | 650 | __u8 store_hint; |
| 579 | struct mgmt_csrk_info key; | 651 | struct mgmt_csrk_info key; |
| 580 | } __packed; | 652 | } __packed; |
| 653 | |||
| 654 | #define MGMT_EV_DEVICE_ADDED 0x001a | ||
| 655 | struct mgmt_ev_device_added { | ||
| 656 | struct mgmt_addr_info addr; | ||
| 657 | __u8 action; | ||
| 658 | } __packed; | ||
| 659 | |||
| 660 | #define MGMT_EV_DEVICE_REMOVED 0x001b | ||
| 661 | struct mgmt_ev_device_removed { | ||
| 662 | struct mgmt_addr_info addr; | ||
| 663 | } __packed; | ||
| 664 | |||
| 665 | #define MGMT_EV_NEW_CONN_PARAM 0x001c | ||
| 666 | struct mgmt_ev_new_conn_param { | ||
| 667 | struct mgmt_addr_info addr; | ||
| 668 | __u8 store_hint; | ||
| 669 | __le16 min_interval; | ||
| 670 | __le16 max_interval; | ||
| 671 | __le16 latency; | ||
| 672 | __le16 timeout; | ||
| 673 | } __packed; | ||
| 674 | |||
| 675 | #define MGMT_EV_UNCONF_INDEX_ADDED 0x001d | ||
| 676 | |||
| 677 | #define MGMT_EV_UNCONF_INDEX_REMOVED 0x001e | ||
| 678 | |||
| 679 | #define MGMT_EV_NEW_CONFIG_OPTIONS 0x001f | ||
diff --git a/include/net/bluetooth/sco.h b/include/net/bluetooth/sco.h index 2019d1a0996a..f40ddb4264fc 100644 --- a/include/net/bluetooth/sco.h +++ b/include/net/bluetooth/sco.h | |||
| @@ -27,11 +27,6 @@ | |||
| 27 | 27 | ||
| 28 | /* SCO defaults */ | 28 | /* SCO defaults */ |
| 29 | #define SCO_DEFAULT_MTU 500 | 29 | #define SCO_DEFAULT_MTU 500 |
| 30 | #define SCO_DEFAULT_FLUSH_TO 0xFFFF | ||
| 31 | |||
| 32 | #define SCO_CONN_TIMEOUT (HZ * 40) | ||
| 33 | #define SCO_DISCONN_TIMEOUT (HZ * 2) | ||
| 34 | #define SCO_CONN_IDLE_TIMEOUT (HZ * 60) | ||
| 35 | 30 | ||
| 36 | /* SCO socket address */ | 31 | /* SCO socket address */ |
| 37 | struct sockaddr_sco { | 32 | struct sockaddr_sco { |
| @@ -51,29 +46,4 @@ struct sco_conninfo { | |||
| 51 | __u8 dev_class[3]; | 46 | __u8 dev_class[3]; |
| 52 | }; | 47 | }; |
| 53 | 48 | ||
| 54 | /* ---- SCO connections ---- */ | ||
| 55 | struct sco_conn { | ||
| 56 | struct hci_conn *hcon; | ||
| 57 | |||
| 58 | spinlock_t lock; | ||
| 59 | struct sock *sk; | ||
| 60 | |||
| 61 | unsigned int mtu; | ||
| 62 | }; | ||
| 63 | |||
| 64 | #define sco_conn_lock(c) spin_lock(&c->lock); | ||
| 65 | #define sco_conn_unlock(c) spin_unlock(&c->lock); | ||
| 66 | |||
| 67 | /* ----- SCO socket info ----- */ | ||
| 68 | #define sco_pi(sk) ((struct sco_pinfo *) sk) | ||
| 69 | |||
| 70 | struct sco_pinfo { | ||
| 71 | struct bt_sock bt; | ||
| 72 | bdaddr_t src; | ||
| 73 | bdaddr_t dst; | ||
| 74 | __u32 flags; | ||
| 75 | __u16 setting; | ||
| 76 | struct sco_conn *conn; | ||
| 77 | }; | ||
| 78 | |||
| 79 | #endif /* __SCO_H */ | 49 | #endif /* __SCO_H */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index e46c437944f7..0a080c4de275 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
| @@ -2266,10 +2266,6 @@ struct cfg80211_qos_map { | |||
| 2266 | * | 2266 | * |
| 2267 | * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant). | 2267 | * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant). |
| 2268 | * | 2268 | * |
| 2269 | * @set_ringparam: Set tx and rx ring sizes. | ||
| 2270 | * | ||
| 2271 | * @get_ringparam: Get tx and rx ring current and maximum sizes. | ||
| 2272 | * | ||
| 2273 | * @tdls_mgmt: Transmit a TDLS management frame. | 2269 | * @tdls_mgmt: Transmit a TDLS management frame. |
| 2274 | * @tdls_oper: Perform a high-level TDLS operation (e.g. TDLS link setup). | 2270 | * @tdls_oper: Perform a high-level TDLS operation (e.g. TDLS link setup). |
| 2275 | * | 2271 | * |
| @@ -2278,16 +2274,6 @@ struct cfg80211_qos_map { | |||
| 2278 | * | 2274 | * |
| 2279 | * @set_noack_map: Set the NoAck Map for the TIDs. | 2275 | * @set_noack_map: Set the NoAck Map for the TIDs. |
| 2280 | * | 2276 | * |
| 2281 | * @get_et_sset_count: Ethtool API to get string-set count. | ||
| 2282 | * See @ethtool_ops.get_sset_count | ||
| 2283 | * | ||
| 2284 | * @get_et_stats: Ethtool API to get a set of u64 stats. | ||
| 2285 | * See @ethtool_ops.get_ethtool_stats | ||
| 2286 | * | ||
| 2287 | * @get_et_strings: Ethtool API to get a set of strings to describe stats | ||
| 2288 | * and perhaps other supported types of ethtool data-sets. | ||
| 2289 | * See @ethtool_ops.get_strings | ||
| 2290 | * | ||
| 2291 | * @get_channel: Get the current operating channel for the virtual interface. | 2277 | * @get_channel: Get the current operating channel for the virtual interface. |
| 2292 | * For monitor interfaces, it should return %NULL unless there's a single | 2278 | * For monitor interfaces, it should return %NULL unless there's a single |
| 2293 | * current monitoring channel. | 2279 | * current monitoring channel. |
| @@ -2315,7 +2301,12 @@ struct cfg80211_qos_map { | |||
| 2315 | * reliability. This operation can not fail. | 2301 | * reliability. This operation can not fail. |
| 2316 | * @set_coalesce: Set coalesce parameters. | 2302 | * @set_coalesce: Set coalesce parameters. |
| 2317 | * | 2303 | * |
| 2318 | * @channel_switch: initiate channel-switch procedure (with CSA) | 2304 | * @channel_switch: initiate channel-switch procedure (with CSA). Driver is |
| 2305 | * responsible for veryfing if the switch is possible. Since this is | ||
| 2306 | * inherently tricky driver may decide to disconnect an interface later | ||
| 2307 | * with cfg80211_stop_iface(). This doesn't mean driver can accept | ||
| 2308 | * everything. It should do it's best to verify requests and reject them | ||
| 2309 | * as soon as possible. | ||
| 2319 | * | 2310 | * |
| 2320 | * @set_qos_map: Set QoS mapping information to the driver | 2311 | * @set_qos_map: Set QoS mapping information to the driver |
| 2321 | * | 2312 | * |
| @@ -2503,10 +2494,6 @@ struct cfg80211_ops { | |||
| 2503 | int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant); | 2494 | int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant); |
| 2504 | int (*get_antenna)(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant); | 2495 | int (*get_antenna)(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant); |
| 2505 | 2496 | ||
| 2506 | int (*set_ringparam)(struct wiphy *wiphy, u32 tx, u32 rx); | ||
| 2507 | void (*get_ringparam)(struct wiphy *wiphy, | ||
| 2508 | u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max); | ||
| 2509 | |||
| 2510 | int (*sched_scan_start)(struct wiphy *wiphy, | 2497 | int (*sched_scan_start)(struct wiphy *wiphy, |
| 2511 | struct net_device *dev, | 2498 | struct net_device *dev, |
| 2512 | struct cfg80211_sched_scan_request *request); | 2499 | struct cfg80211_sched_scan_request *request); |
| @@ -2518,7 +2505,7 @@ struct cfg80211_ops { | |||
| 2518 | int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 2505 | int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
| 2519 | const u8 *peer, u8 action_code, u8 dialog_token, | 2506 | const u8 *peer, u8 action_code, u8 dialog_token, |
| 2520 | u16 status_code, u32 peer_capability, | 2507 | u16 status_code, u32 peer_capability, |
| 2521 | const u8 *buf, size_t len); | 2508 | bool initiator, const u8 *buf, size_t len); |
| 2522 | int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev, | 2509 | int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev, |
| 2523 | const u8 *peer, enum nl80211_tdls_operation oper); | 2510 | const u8 *peer, enum nl80211_tdls_operation oper); |
| 2524 | 2511 | ||
| @@ -2529,13 +2516,6 @@ struct cfg80211_ops { | |||
| 2529 | struct net_device *dev, | 2516 | struct net_device *dev, |
| 2530 | u16 noack_map); | 2517 | u16 noack_map); |
| 2531 | 2518 | ||
| 2532 | int (*get_et_sset_count)(struct wiphy *wiphy, | ||
| 2533 | struct net_device *dev, int sset); | ||
| 2534 | void (*get_et_stats)(struct wiphy *wiphy, struct net_device *dev, | ||
| 2535 | struct ethtool_stats *stats, u64 *data); | ||
| 2536 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, | ||
| 2537 | u32 sset, u8 *data); | ||
| 2538 | |||
| 2539 | int (*get_channel)(struct wiphy *wiphy, | 2519 | int (*get_channel)(struct wiphy *wiphy, |
| 2540 | struct wireless_dev *wdev, | 2520 | struct wireless_dev *wdev, |
| 2541 | struct cfg80211_chan_def *chandef); | 2521 | struct cfg80211_chan_def *chandef); |
| @@ -4843,6 +4823,10 @@ void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev, | |||
| 4843 | */ | 4823 | */ |
| 4844 | void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy); | 4824 | void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy); |
| 4845 | 4825 | ||
| 4826 | |||
| 4827 | /* ethtool helper */ | ||
| 4828 | void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info); | ||
| 4829 | |||
| 4846 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 4830 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
| 4847 | 4831 | ||
| 4848 | /* wiphy_printk helpers, similar to dev_printk */ | 4832 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h index a975edf21b22..597b88a94332 100644 --- a/include/net/dcbnl.h +++ b/include/net/dcbnl.h | |||
| @@ -81,8 +81,8 @@ struct dcbnl_rtnl_ops { | |||
| 81 | void (*setbcncfg)(struct net_device *, int, u32); | 81 | void (*setbcncfg)(struct net_device *, int, u32); |
| 82 | void (*getbcnrp)(struct net_device *, int, u8 *); | 82 | void (*getbcnrp)(struct net_device *, int, u8 *); |
| 83 | void (*setbcnrp)(struct net_device *, int, u8); | 83 | void (*setbcnrp)(struct net_device *, int, u8); |
| 84 | u8 (*setapp)(struct net_device *, u8, u16, u8); | 84 | int (*setapp)(struct net_device *, u8, u16, u8); |
| 85 | u8 (*getapp)(struct net_device *, u8, u16); | 85 | int (*getapp)(struct net_device *, u8, u16); |
| 86 | u8 (*getfeatcfg)(struct net_device *, int, u8 *); | 86 | u8 (*getfeatcfg)(struct net_device *, int, u8 *); |
| 87 | u8 (*setfeatcfg)(struct net_device *, int, u8); | 87 | u8 (*setfeatcfg)(struct net_device *, int, u8); |
| 88 | 88 | ||
diff --git a/include/net/flow_keys.h b/include/net/flow_keys.h index 7e64bd8bbda9..6667a054763a 100644 --- a/include/net/flow_keys.h +++ b/include/net/flow_keys.h | |||
| @@ -1,6 +1,19 @@ | |||
| 1 | #ifndef _NET_FLOW_KEYS_H | 1 | #ifndef _NET_FLOW_KEYS_H |
| 2 | #define _NET_FLOW_KEYS_H | 2 | #define _NET_FLOW_KEYS_H |
| 3 | 3 | ||
| 4 | /* struct flow_keys: | ||
| 5 | * @src: source ip address in case of IPv4 | ||
| 6 | * For IPv6 it contains 32bit hash of src address | ||
| 7 | * @dst: destination ip address in case of IPv4 | ||
| 8 | * For IPv6 it contains 32bit hash of dst address | ||
| 9 | * @ports: port numbers of Transport header | ||
| 10 | * port16[0]: src port number | ||
| 11 | * port16[1]: dst port number | ||
| 12 | * @thoff: Transport header offset | ||
| 13 | * @n_proto: Network header protocol (eg. IPv4/IPv6) | ||
| 14 | * @ip_proto: Transport header protocol (eg. TCP/UDP) | ||
| 15 | * All the members, except thoff, are in network byte order. | ||
| 16 | */ | ||
| 4 | struct flow_keys { | 17 | struct flow_keys { |
| 5 | /* (src,dst) must be grouped, in the same way than in IP header */ | 18 | /* (src,dst) must be grouped, in the same way than in IP header */ |
| 6 | __be32 src; | 19 | __be32 src; |
| @@ -10,9 +23,11 @@ struct flow_keys { | |||
| 10 | __be16 port16[2]; | 23 | __be16 port16[2]; |
| 11 | }; | 24 | }; |
| 12 | u16 thoff; | 25 | u16 thoff; |
| 26 | u16 n_proto; | ||
| 13 | u8 ip_proto; | 27 | u8 ip_proto; |
| 14 | }; | 28 | }; |
| 15 | 29 | ||
| 16 | bool skb_flow_dissect(const struct sk_buff *skb, struct flow_keys *flow); | 30 | bool skb_flow_dissect(const struct sk_buff *skb, struct flow_keys *flow); |
| 17 | __be32 skb_flow_get_ports(const struct sk_buff *skb, int thoff, u8 ip_proto); | 31 | __be32 skb_flow_get_ports(const struct sk_buff *skb, int thoff, u8 ip_proto); |
| 32 | u32 flow_hash_from_keys(struct flow_keys *keys); | ||
| 18 | #endif | 33 | #endif |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index b4956a5fcc3f..d07b1a64b4e7 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
| @@ -205,6 +205,7 @@ struct inet6_dev { | |||
| 205 | struct timer_list rs_timer; | 205 | struct timer_list rs_timer; |
| 206 | __u8 rs_probes; | 206 | __u8 rs_probes; |
| 207 | 207 | ||
| 208 | __u8 addr_gen_mode; | ||
| 208 | unsigned long tstamp; /* ipv6InterfaceTable update timestamp */ | 209 | unsigned long tstamp; /* ipv6InterfaceTable update timestamp */ |
| 209 | struct rcu_head rcu; | 210 | struct rcu_head rcu; |
| 210 | }; | 211 | }; |
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 6f59de98dabd..65a8855e99fe 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h | |||
| @@ -4,10 +4,6 @@ | |||
| 4 | #include <linux/percpu_counter.h> | 4 | #include <linux/percpu_counter.h> |
| 5 | 5 | ||
| 6 | struct netns_frags { | 6 | struct netns_frags { |
| 7 | int nqueues; | ||
| 8 | struct list_head lru_list; | ||
| 9 | spinlock_t lru_lock; | ||
| 10 | |||
| 11 | /* The percpu_counter "mem" need to be cacheline aligned. | 7 | /* The percpu_counter "mem" need to be cacheline aligned. |
| 12 | * mem.count must not share cacheline with other writers | 8 | * mem.count must not share cacheline with other writers |
| 13 | */ | 9 | */ |
| @@ -19,25 +15,49 @@ struct netns_frags { | |||
| 19 | int low_thresh; | 15 | int low_thresh; |
| 20 | }; | 16 | }; |
| 21 | 17 | ||
| 18 | /** | ||
| 19 | * fragment queue flags | ||
| 20 | * | ||
| 21 | * @INET_FRAG_FIRST_IN: first fragment has arrived | ||
| 22 | * @INET_FRAG_LAST_IN: final fragment has arrived | ||
| 23 | * @INET_FRAG_COMPLETE: frag queue has been processed and is due for destruction | ||
| 24 | * @INET_FRAG_EVICTED: frag queue is being evicted | ||
| 25 | */ | ||
| 26 | enum { | ||
| 27 | INET_FRAG_FIRST_IN = BIT(0), | ||
| 28 | INET_FRAG_LAST_IN = BIT(1), | ||
| 29 | INET_FRAG_COMPLETE = BIT(2), | ||
| 30 | INET_FRAG_EVICTED = BIT(3) | ||
| 31 | }; | ||
| 32 | |||
| 33 | /** | ||
| 34 | * struct inet_frag_queue - fragment queue | ||
| 35 | * | ||
| 36 | * @lock: spinlock protecting the queue | ||
| 37 | * @timer: queue expiration timer | ||
| 38 | * @list: hash bucket list | ||
| 39 | * @refcnt: reference count of the queue | ||
| 40 | * @fragments: received fragments head | ||
| 41 | * @fragments_tail: received fragments tail | ||
| 42 | * @stamp: timestamp of the last received fragment | ||
| 43 | * @len: total length of the original datagram | ||
| 44 | * @meat: length of received fragments so far | ||
| 45 | * @flags: fragment queue flags | ||
| 46 | * @max_size: (ipv4 only) maximum received fragment size with IP_DF set | ||
| 47 | * @net: namespace that this frag belongs to | ||
| 48 | */ | ||
| 22 | struct inet_frag_queue { | 49 | struct inet_frag_queue { |
| 23 | spinlock_t lock; | 50 | spinlock_t lock; |
| 24 | struct timer_list timer; /* when will this queue expire? */ | 51 | struct timer_list timer; |
| 25 | struct list_head lru_list; /* lru list member */ | ||
| 26 | struct hlist_node list; | 52 | struct hlist_node list; |
| 27 | atomic_t refcnt; | 53 | atomic_t refcnt; |
| 28 | struct sk_buff *fragments; /* list of received fragments */ | 54 | struct sk_buff *fragments; |
| 29 | struct sk_buff *fragments_tail; | 55 | struct sk_buff *fragments_tail; |
| 30 | ktime_t stamp; | 56 | ktime_t stamp; |
| 31 | int len; /* total length of orig datagram */ | 57 | int len; |
| 32 | int meat; | 58 | int meat; |
| 33 | __u8 last_in; /* first/last segment arrived? */ | 59 | __u8 flags; |
| 34 | |||
| 35 | #define INET_FRAG_COMPLETE 4 | ||
| 36 | #define INET_FRAG_FIRST_IN 2 | ||
| 37 | #define INET_FRAG_LAST_IN 1 | ||
| 38 | |||
| 39 | u16 max_size; | 60 | u16 max_size; |
| 40 | |||
| 41 | struct netns_frags *net; | 61 | struct netns_frags *net; |
| 42 | }; | 62 | }; |
| 43 | 63 | ||
| @@ -48,7 +68,7 @@ struct inet_frag_queue { | |||
| 48 | * rounded up (SKB_TRUELEN(0) + sizeof(struct ipq or | 68 | * rounded up (SKB_TRUELEN(0) + sizeof(struct ipq or |
| 49 | * struct frag_queue)) | 69 | * struct frag_queue)) |
| 50 | */ | 70 | */ |
| 51 | #define INETFRAGS_MAXDEPTH 128 | 71 | #define INETFRAGS_MAXDEPTH 128 |
| 52 | 72 | ||
| 53 | struct inet_frag_bucket { | 73 | struct inet_frag_bucket { |
| 54 | struct hlist_head chain; | 74 | struct hlist_head chain; |
| @@ -57,49 +77,52 @@ struct inet_frag_bucket { | |||
| 57 | 77 | ||
| 58 | struct inet_frags { | 78 | struct inet_frags { |
| 59 | struct inet_frag_bucket hash[INETFRAGS_HASHSZ]; | 79 | struct inet_frag_bucket hash[INETFRAGS_HASHSZ]; |
| 60 | /* This rwlock is a global lock (seperate per IPv4, IPv6 and | 80 | |
| 61 | * netfilter). Important to keep this on a seperate cacheline. | 81 | struct work_struct frags_work; |
| 62 | * Its primarily a rebuild protection rwlock. | 82 | unsigned int next_bucket; |
| 63 | */ | 83 | unsigned long last_rebuild_jiffies; |
| 64 | rwlock_t lock ____cacheline_aligned_in_smp; | 84 | bool rebuild; |
| 65 | int secret_interval; | ||
| 66 | struct timer_list secret_timer; | ||
| 67 | 85 | ||
| 68 | /* The first call to hashfn is responsible to initialize | 86 | /* The first call to hashfn is responsible to initialize |
| 69 | * rnd. This is best done with net_get_random_once. | 87 | * rnd. This is best done with net_get_random_once. |
| 88 | * | ||
| 89 | * rnd_seqlock is used to let hash insertion detect | ||
| 90 | * when it needs to re-lookup the hash chain to use. | ||
| 70 | */ | 91 | */ |
| 71 | u32 rnd; | 92 | u32 rnd; |
| 93 | seqlock_t rnd_seqlock; | ||
| 72 | int qsize; | 94 | int qsize; |
| 73 | 95 | ||
| 74 | unsigned int (*hashfn)(struct inet_frag_queue *); | 96 | unsigned int (*hashfn)(const struct inet_frag_queue *); |
| 75 | bool (*match)(struct inet_frag_queue *q, void *arg); | 97 | bool (*match)(const struct inet_frag_queue *q, |
| 98 | const void *arg); | ||
| 76 | void (*constructor)(struct inet_frag_queue *q, | 99 | void (*constructor)(struct inet_frag_queue *q, |
| 77 | void *arg); | 100 | const void *arg); |
| 78 | void (*destructor)(struct inet_frag_queue *); | 101 | void (*destructor)(struct inet_frag_queue *); |
| 79 | void (*skb_free)(struct sk_buff *); | 102 | void (*skb_free)(struct sk_buff *); |
| 80 | void (*frag_expire)(unsigned long data); | 103 | void (*frag_expire)(unsigned long data); |
| 104 | struct kmem_cache *frags_cachep; | ||
| 105 | const char *frags_cache_name; | ||
| 81 | }; | 106 | }; |
| 82 | 107 | ||
| 83 | void inet_frags_init(struct inet_frags *); | 108 | int inet_frags_init(struct inet_frags *); |
| 84 | void inet_frags_fini(struct inet_frags *); | 109 | void inet_frags_fini(struct inet_frags *); |
| 85 | 110 | ||
| 86 | void inet_frags_init_net(struct netns_frags *nf); | 111 | void inet_frags_init_net(struct netns_frags *nf); |
| 87 | void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f); | 112 | void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f); |
| 88 | 113 | ||
| 89 | void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f); | 114 | void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f); |
| 90 | void inet_frag_destroy(struct inet_frag_queue *q, | 115 | void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f); |
| 91 | struct inet_frags *f, int *work); | ||
| 92 | int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f, bool force); | ||
| 93 | struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, | 116 | struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, |
| 94 | struct inet_frags *f, void *key, unsigned int hash) | 117 | struct inet_frags *f, void *key, unsigned int hash); |
| 95 | __releases(&f->lock); | 118 | |
| 96 | void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q, | 119 | void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q, |
| 97 | const char *prefix); | 120 | const char *prefix); |
| 98 | 121 | ||
| 99 | static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f) | 122 | static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f) |
| 100 | { | 123 | { |
| 101 | if (atomic_dec_and_test(&q->refcnt)) | 124 | if (atomic_dec_and_test(&q->refcnt)) |
| 102 | inet_frag_destroy(q, f, NULL); | 125 | inet_frag_destroy(q, f); |
| 103 | } | 126 | } |
| 104 | 127 | ||
| 105 | /* Memory Tracking Functions. */ | 128 | /* Memory Tracking Functions. */ |
| @@ -131,9 +154,9 @@ static inline void init_frag_mem_limit(struct netns_frags *nf) | |||
| 131 | percpu_counter_init(&nf->mem, 0); | 154 | percpu_counter_init(&nf->mem, 0); |
| 132 | } | 155 | } |
| 133 | 156 | ||
| 134 | static inline int sum_frag_mem_limit(struct netns_frags *nf) | 157 | static inline unsigned int sum_frag_mem_limit(struct netns_frags *nf) |
| 135 | { | 158 | { |
| 136 | int res; | 159 | unsigned int res; |
| 137 | 160 | ||
| 138 | local_bh_disable(); | 161 | local_bh_disable(); |
| 139 | res = percpu_counter_sum_positive(&nf->mem); | 162 | res = percpu_counter_sum_positive(&nf->mem); |
| @@ -142,31 +165,6 @@ static inline int sum_frag_mem_limit(struct netns_frags *nf) | |||
| 142 | return res; | 165 | return res; |
| 143 | } | 166 | } |
| 144 | 167 | ||
| 145 | static inline void inet_frag_lru_move(struct inet_frag_queue *q) | ||
| 146 | { | ||
| 147 | spin_lock(&q->net->lru_lock); | ||
| 148 | if (!list_empty(&q->lru_list)) | ||
| 149 | list_move_tail(&q->lru_list, &q->net->lru_list); | ||
| 150 | spin_unlock(&q->net->lru_lock); | ||
| 151 | } | ||
| 152 | |||
| 153 | static inline void inet_frag_lru_del(struct inet_frag_queue *q) | ||
| 154 | { | ||
| 155 | spin_lock(&q->net->lru_lock); | ||
| 156 | list_del_init(&q->lru_list); | ||
| 157 | q->net->nqueues--; | ||
| 158 | spin_unlock(&q->net->lru_lock); | ||
| 159 | } | ||
| 160 | |||
| 161 | static inline void inet_frag_lru_add(struct netns_frags *nf, | ||
| 162 | struct inet_frag_queue *q) | ||
| 163 | { | ||
| 164 | spin_lock(&nf->lru_lock); | ||
| 165 | list_add_tail(&q->lru_list, &nf->lru_list); | ||
| 166 | q->net->nqueues++; | ||
| 167 | spin_unlock(&nf->lru_lock); | ||
| 168 | } | ||
| 169 | |||
| 170 | /* RFC 3168 support : | 168 | /* RFC 3168 support : |
| 171 | * We want to check ECN values of all fragments, do detect invalid combinations. | 169 | * We want to check ECN values of all fragments, do detect invalid combinations. |
| 172 | * In ipq->ecn, we store the OR value of each ip4_frag_ecn() fragment value. | 170 | * In ipq->ecn, we store the OR value of each ip4_frag_ecn() fragment value. |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index b1edf17bec01..a829b77523cf 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
| @@ -88,8 +88,10 @@ struct inet_request_sock { | |||
| 88 | acked : 1, | 88 | acked : 1, |
| 89 | no_srccheck: 1; | 89 | no_srccheck: 1; |
| 90 | kmemcheck_bitfield_end(flags); | 90 | kmemcheck_bitfield_end(flags); |
| 91 | struct ip_options_rcu *opt; | 91 | union { |
| 92 | struct sk_buff *pktopts; | 92 | struct ip_options_rcu *opt; |
| 93 | struct sk_buff *pktopts; | ||
| 94 | }; | ||
| 93 | u32 ir_mark; | 95 | u32 ir_mark; |
| 94 | }; | 96 | }; |
| 95 | 97 | ||
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 61474ea02152..6c566034e26d 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
| @@ -108,6 +108,7 @@ struct inet_timewait_sock { | |||
| 108 | #define tw_family __tw_common.skc_family | 108 | #define tw_family __tw_common.skc_family |
| 109 | #define tw_state __tw_common.skc_state | 109 | #define tw_state __tw_common.skc_state |
| 110 | #define tw_reuse __tw_common.skc_reuse | 110 | #define tw_reuse __tw_common.skc_reuse |
| 111 | #define tw_ipv6only __tw_common.skc_ipv6only | ||
| 111 | #define tw_bound_dev_if __tw_common.skc_bound_dev_if | 112 | #define tw_bound_dev_if __tw_common.skc_bound_dev_if |
| 112 | #define tw_node __tw_common.skc_nulls_node | 113 | #define tw_node __tw_common.skc_nulls_node |
| 113 | #define tw_bind_node __tw_common.skc_bind_node | 114 | #define tw_bind_node __tw_common.skc_bind_node |
| @@ -131,7 +132,7 @@ struct inet_timewait_sock { | |||
| 131 | __be16 tw_sport; | 132 | __be16 tw_sport; |
| 132 | kmemcheck_bitfield_begin(flags); | 133 | kmemcheck_bitfield_begin(flags); |
| 133 | /* And these are ours. */ | 134 | /* And these are ours. */ |
| 134 | unsigned int tw_ipv6only : 1, | 135 | unsigned int tw_pad0 : 1, /* 1 bit hole */ |
| 135 | tw_transparent : 1, | 136 | tw_transparent : 1, |
| 136 | tw_flowlabel : 20, | 137 | tw_flowlabel : 20, |
| 137 | tw_pad : 2, /* 2 bits hole */ | 138 | tw_pad : 2, /* 2 bits hole */ |
diff --git a/include/net/ip.h b/include/net/ip.h index 0e795df05ec9..db4a771b9ef3 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <net/route.h> | 31 | #include <net/route.h> |
| 32 | #include <net/snmp.h> | 32 | #include <net/snmp.h> |
| 33 | #include <net/flow.h> | 33 | #include <net/flow.h> |
| 34 | #include <net/flow_keys.h> | ||
| 34 | 35 | ||
| 35 | struct sock; | 36 | struct sock; |
| 36 | 37 | ||
| @@ -215,6 +216,12 @@ static inline int inet_is_local_reserved_port(struct net *net, int port) | |||
| 215 | return 0; | 216 | return 0; |
| 216 | return test_bit(port, net->ipv4.sysctl_local_reserved_ports); | 217 | return test_bit(port, net->ipv4.sysctl_local_reserved_ports); |
| 217 | } | 218 | } |
| 219 | |||
| 220 | static inline bool sysctl_dev_name_is_allowed(const char *name) | ||
| 221 | { | ||
| 222 | return strcmp(name, "default") != 0 && strcmp(name, "all") != 0; | ||
| 223 | } | ||
| 224 | |||
| 218 | #else | 225 | #else |
| 219 | static inline int inet_is_local_reserved_port(struct net *net, int port) | 226 | static inline int inet_is_local_reserved_port(struct net *net, int port) |
| 220 | { | 227 | { |
| @@ -309,16 +316,7 @@ static inline unsigned int ip_skb_dst_mtu(const struct sk_buff *skb) | |||
| 309 | } | 316 | } |
| 310 | } | 317 | } |
| 311 | 318 | ||
| 312 | #define IP_IDENTS_SZ 2048u | 319 | u32 ip_idents_reserve(u32 hash, int segs); |
| 313 | extern atomic_t *ip_idents; | ||
| 314 | |||
| 315 | static inline u32 ip_idents_reserve(u32 hash, int segs) | ||
| 316 | { | ||
| 317 | atomic_t *id_ptr = ip_idents + hash % IP_IDENTS_SZ; | ||
| 318 | |||
| 319 | return atomic_add_return(segs, id_ptr) - segs; | ||
| 320 | } | ||
| 321 | |||
| 322 | void __ip_select_ident(struct iphdr *iph, int segs); | 320 | void __ip_select_ident(struct iphdr *iph, int segs); |
| 323 | 321 | ||
| 324 | static inline void ip_select_ident_segs(struct sk_buff *skb, struct sock *sk, int segs) | 322 | static inline void ip_select_ident_segs(struct sk_buff *skb, struct sock *sk, int segs) |
| @@ -353,6 +351,19 @@ static inline __wsum inet_compute_pseudo(struct sk_buff *skb, int proto) | |||
| 353 | skb->len, proto, 0); | 351 | skb->len, proto, 0); |
| 354 | } | 352 | } |
| 355 | 353 | ||
| 354 | static inline void inet_set_txhash(struct sock *sk) | ||
| 355 | { | ||
| 356 | struct inet_sock *inet = inet_sk(sk); | ||
| 357 | struct flow_keys keys; | ||
| 358 | |||
| 359 | keys.src = inet->inet_saddr; | ||
| 360 | keys.dst = inet->inet_daddr; | ||
| 361 | keys.port16[0] = inet->inet_sport; | ||
| 362 | keys.port16[1] = inet->inet_dport; | ||
| 363 | |||
| 364 | sk->sk_txhash = flow_hash_from_keys(&keys); | ||
| 365 | } | ||
| 366 | |||
| 356 | /* | 367 | /* |
| 357 | * Map a multicast IP onto multicast MAC for type ethernet. | 368 | * Map a multicast IP onto multicast MAC for type ethernet. |
| 358 | */ | 369 | */ |
| @@ -481,7 +492,6 @@ static inline struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user) | |||
| 481 | } | 492 | } |
| 482 | #endif | 493 | #endif |
| 483 | int ip_frag_mem(struct net *net); | 494 | int ip_frag_mem(struct net *net); |
| 484 | int ip_frag_nqueues(struct net *net); | ||
| 485 | 495 | ||
| 486 | /* | 496 | /* |
| 487 | * Functions provided by ip_forward.c | 497 | * Functions provided by ip_forward.c |
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index a4daf9eb8562..8dd8cab88b87 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h | |||
| @@ -40,6 +40,7 @@ struct ip_tunnel_prl_entry { | |||
| 40 | 40 | ||
| 41 | struct ip_tunnel_dst { | 41 | struct ip_tunnel_dst { |
| 42 | struct dst_entry __rcu *dst; | 42 | struct dst_entry __rcu *dst; |
| 43 | __be32 saddr; | ||
| 43 | }; | 44 | }; |
| 44 | 45 | ||
| 45 | struct ip_tunnel { | 46 | struct ip_tunnel { |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 574337fe72dd..a2db816e8461 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <net/if_inet6.h> | 19 | #include <net/if_inet6.h> |
| 20 | #include <net/ndisc.h> | 20 | #include <net/ndisc.h> |
| 21 | #include <net/flow.h> | 21 | #include <net/flow.h> |
| 22 | #include <net/flow_keys.h> | ||
| 22 | #include <net/snmp.h> | 23 | #include <net/snmp.h> |
| 23 | 24 | ||
| 24 | #define SIN6_LEN_RFC2133 24 | 25 | #define SIN6_LEN_RFC2133 24 |
| @@ -298,11 +299,6 @@ static inline bool ipv6_accept_ra(struct inet6_dev *idev) | |||
| 298 | } | 299 | } |
| 299 | 300 | ||
| 300 | #if IS_ENABLED(CONFIG_IPV6) | 301 | #if IS_ENABLED(CONFIG_IPV6) |
| 301 | static inline int ip6_frag_nqueues(struct net *net) | ||
| 302 | { | ||
| 303 | return net->ipv6.frags.nqueues; | ||
| 304 | } | ||
| 305 | |||
| 306 | static inline int ip6_frag_mem(struct net *net) | 302 | static inline int ip6_frag_mem(struct net *net) |
| 307 | { | 303 | { |
| 308 | return sum_frag_mem_limit(&net->ipv6.frags); | 304 | return sum_frag_mem_limit(&net->ipv6.frags); |
| @@ -495,8 +491,8 @@ struct ip6_create_arg { | |||
| 495 | u8 ecn; | 491 | u8 ecn; |
| 496 | }; | 492 | }; |
| 497 | 493 | ||
| 498 | void ip6_frag_init(struct inet_frag_queue *q, void *a); | 494 | void ip6_frag_init(struct inet_frag_queue *q, const void *a); |
| 499 | bool ip6_frag_match(struct inet_frag_queue *q, void *a); | 495 | bool ip6_frag_match(const struct inet_frag_queue *q, const void *a); |
| 500 | 496 | ||
| 501 | /* | 497 | /* |
| 502 | * Equivalent of ipv4 struct ip | 498 | * Equivalent of ipv4 struct ip |
| @@ -557,24 +553,29 @@ static inline u32 __ipv6_addr_jhash(const struct in6_addr *a, const u32 initval) | |||
| 557 | static inline bool ipv6_addr_loopback(const struct in6_addr *a) | 553 | static inline bool ipv6_addr_loopback(const struct in6_addr *a) |
| 558 | { | 554 | { |
| 559 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | 555 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 |
| 560 | const unsigned long *ul = (const unsigned long *)a; | 556 | const __be64 *be = (const __be64 *)a; |
| 561 | 557 | ||
| 562 | return (ul[0] | (ul[1] ^ cpu_to_be64(1))) == 0UL; | 558 | return (be[0] | (be[1] ^ cpu_to_be64(1))) == 0UL; |
| 563 | #else | 559 | #else |
| 564 | return (a->s6_addr32[0] | a->s6_addr32[1] | | 560 | return (a->s6_addr32[0] | a->s6_addr32[1] | |
| 565 | a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0; | 561 | a->s6_addr32[2] | (a->s6_addr32[3] ^ cpu_to_be32(1))) == 0; |
| 566 | #endif | 562 | #endif |
| 567 | } | 563 | } |
| 568 | 564 | ||
| 565 | /* | ||
| 566 | * Note that we must __force cast these to unsigned long to make sparse happy, | ||
| 567 | * since all of the endian-annotated types are fixed size regardless of arch. | ||
| 568 | */ | ||
| 569 | static inline bool ipv6_addr_v4mapped(const struct in6_addr *a) | 569 | static inline bool ipv6_addr_v4mapped(const struct in6_addr *a) |
| 570 | { | 570 | { |
| 571 | return ( | 571 | return ( |
| 572 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | 572 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 |
| 573 | *(__be64 *)a | | 573 | *(unsigned long *)a | |
| 574 | #else | 574 | #else |
| 575 | (a->s6_addr32[0] | a->s6_addr32[1]) | | 575 | (__force unsigned long)(a->s6_addr32[0] | a->s6_addr32[1]) | |
| 576 | #endif | 576 | #endif |
| 577 | (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0UL; | 577 | (__force unsigned long)(a->s6_addr32[2] ^ |
| 578 | cpu_to_be32(0x0000ffff))) == 0UL; | ||
| 578 | } | 579 | } |
| 579 | 580 | ||
| 580 | /* | 581 | /* |
| @@ -684,6 +685,50 @@ static inline int ip6_sk_dst_hoplimit(struct ipv6_pinfo *np, struct flowi6 *fl6, | |||
| 684 | return hlimit; | 685 | return hlimit; |
| 685 | } | 686 | } |
| 686 | 687 | ||
| 688 | #if IS_ENABLED(CONFIG_IPV6) | ||
| 689 | static inline void ip6_set_txhash(struct sock *sk) | ||
| 690 | { | ||
| 691 | struct inet_sock *inet = inet_sk(sk); | ||
| 692 | struct ipv6_pinfo *np = inet6_sk(sk); | ||
| 693 | struct flow_keys keys; | ||
| 694 | |||
| 695 | keys.src = (__force __be32)ipv6_addr_hash(&np->saddr); | ||
| 696 | keys.dst = (__force __be32)ipv6_addr_hash(&sk->sk_v6_daddr); | ||
| 697 | keys.port16[0] = inet->inet_sport; | ||
| 698 | keys.port16[1] = inet->inet_dport; | ||
| 699 | |||
| 700 | sk->sk_txhash = flow_hash_from_keys(&keys); | ||
| 701 | } | ||
| 702 | |||
| 703 | static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb, | ||
| 704 | __be32 flowlabel, bool autolabel) | ||
| 705 | { | ||
| 706 | if (!flowlabel && (autolabel || net->ipv6.sysctl.auto_flowlabels)) { | ||
| 707 | __be32 hash; | ||
| 708 | |||
| 709 | hash = skb_get_hash(skb); | ||
| 710 | |||
| 711 | /* Since this is being sent on the wire obfuscate hash a bit | ||
| 712 | * to minimize possbility that any useful information to an | ||
| 713 | * attacker is leaked. Only lower 20 bits are relevant. | ||
| 714 | */ | ||
| 715 | hash ^= hash >> 12; | ||
| 716 | |||
| 717 | flowlabel = hash & IPV6_FLOWLABEL_MASK; | ||
| 718 | } | ||
| 719 | |||
| 720 | return flowlabel; | ||
| 721 | } | ||
| 722 | #else | ||
| 723 | static inline void ip6_set_txhash(struct sock *sk) { } | ||
| 724 | static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb, | ||
| 725 | __be32 flowlabel, bool autolabel) | ||
| 726 | { | ||
| 727 | return flowlabel; | ||
| 728 | } | ||
| 729 | #endif | ||
| 730 | |||
| 731 | |||
| 687 | /* | 732 | /* |
| 688 | * Header manipulation | 733 | * Header manipulation |
| 689 | */ | 734 | */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 421b6ecb4b2c..dae2e24616e1 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -754,20 +754,25 @@ struct ieee80211_tx_info { | |||
| 754 | }; | 754 | }; |
| 755 | 755 | ||
| 756 | /** | 756 | /** |
| 757 | * struct ieee80211_sched_scan_ies - scheduled scan IEs | 757 | * struct ieee80211_scan_ies - descriptors for different blocks of IEs |
| 758 | * | 758 | * |
| 759 | * This structure is used to pass the appropriate IEs to be used in scheduled | 759 | * This structure is used to point to different blocks of IEs in HW scan |
| 760 | * scans for all bands. It contains both the IEs passed from the userspace | 760 | * and scheduled scan. These blocks contain the IEs passed by userspace |
| 761 | * and the ones generated by mac80211. | 761 | * and the ones generated by mac80211. |
| 762 | * | 762 | * |
| 763 | * @ie: array with the IEs for each supported band | 763 | * @ies: pointers to band specific IEs. |
| 764 | * @len: array with the total length of the IEs for each band | 764 | * @len: lengths of band_specific IEs. |
| 765 | * @common_ies: IEs for all bands (especially vendor specific ones) | ||
| 766 | * @common_ie_len: length of the common_ies | ||
| 765 | */ | 767 | */ |
| 766 | struct ieee80211_sched_scan_ies { | 768 | struct ieee80211_scan_ies { |
| 767 | u8 *ie[IEEE80211_NUM_BANDS]; | 769 | const u8 *ies[IEEE80211_NUM_BANDS]; |
| 768 | size_t len[IEEE80211_NUM_BANDS]; | 770 | size_t len[IEEE80211_NUM_BANDS]; |
| 771 | const u8 *common_ies; | ||
| 772 | size_t common_ie_len; | ||
| 769 | }; | 773 | }; |
| 770 | 774 | ||
| 775 | |||
| 771 | static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb) | 776 | static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb) |
| 772 | { | 777 | { |
| 773 | return (struct ieee80211_tx_info *)skb->cb; | 778 | return (struct ieee80211_tx_info *)skb->cb; |
| @@ -1601,11 +1606,8 @@ struct ieee80211_tx_control { | |||
| 1601 | * is not enabled the default action is to disconnect when getting the | 1606 | * is not enabled the default action is to disconnect when getting the |
| 1602 | * CSA frame. | 1607 | * CSA frame. |
| 1603 | * | 1608 | * |
| 1604 | * @IEEE80211_HW_CHANGE_RUNNING_CHANCTX: The hardware can change a | 1609 | * @IEEE80211_SINGLE_HW_SCAN_ON_ALL_BANDS: The HW supports scanning on all bands |
| 1605 | * channel context on-the-fly. This is needed for channel switch | 1610 | * in one command, mac80211 doesn't have to run separate scans per band. |
| 1606 | * on single-channel hardware. It can also be used as an | ||
| 1607 | * optimization in certain channel switch cases with | ||
| 1608 | * multi-channel. | ||
| 1609 | */ | 1611 | */ |
| 1610 | enum ieee80211_hw_flags { | 1612 | enum ieee80211_hw_flags { |
| 1611 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 1613 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
| @@ -1637,7 +1639,8 @@ enum ieee80211_hw_flags { | |||
| 1637 | IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26, | 1639 | IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26, |
| 1638 | IEEE80211_HW_SUPPORTS_HT_CCK_RATES = 1<<27, | 1640 | IEEE80211_HW_SUPPORTS_HT_CCK_RATES = 1<<27, |
| 1639 | IEEE80211_HW_CHANCTX_STA_CSA = 1<<28, | 1641 | IEEE80211_HW_CHANCTX_STA_CSA = 1<<28, |
| 1640 | IEEE80211_HW_CHANGE_RUNNING_CHANCTX = 1<<29, | 1642 | /* bit 29 unused */ |
| 1643 | IEEE80211_SINGLE_HW_SCAN_ON_ALL_BANDS = 1<<30, | ||
| 1641 | }; | 1644 | }; |
| 1642 | 1645 | ||
| 1643 | /** | 1646 | /** |
| @@ -1764,6 +1767,19 @@ struct ieee80211_hw { | |||
| 1764 | }; | 1767 | }; |
| 1765 | 1768 | ||
| 1766 | /** | 1769 | /** |
| 1770 | * struct ieee80211_scan_request - hw scan request | ||
| 1771 | * | ||
| 1772 | * @ies: pointers different parts of IEs (in req.ie) | ||
| 1773 | * @req: cfg80211 request. | ||
| 1774 | */ | ||
| 1775 | struct ieee80211_scan_request { | ||
| 1776 | struct ieee80211_scan_ies ies; | ||
| 1777 | |||
| 1778 | /* Keep last */ | ||
| 1779 | struct cfg80211_scan_request req; | ||
| 1780 | }; | ||
| 1781 | |||
| 1782 | /** | ||
| 1767 | * wiphy_to_ieee80211_hw - return a mac80211 driver hw struct from a wiphy | 1783 | * wiphy_to_ieee80211_hw - return a mac80211 driver hw struct from a wiphy |
| 1768 | * | 1784 | * |
| 1769 | * @wiphy: the &struct wiphy which we want to query | 1785 | * @wiphy: the &struct wiphy which we want to query |
| @@ -2764,6 +2780,15 @@ enum ieee80211_roc_type { | |||
| 2764 | * mac80211 will transmit the frame right away. | 2780 | * mac80211 will transmit the frame right away. |
| 2765 | * The callback is optional and can (should!) sleep. | 2781 | * The callback is optional and can (should!) sleep. |
| 2766 | * | 2782 | * |
| 2783 | * @mgd_protect_tdls_discover: Protect a TDLS discovery session. After sending | ||
| 2784 | * a TDLS discovery-request, we expect a reply to arrive on the AP's | ||
| 2785 | * channel. We must stay on the channel (no PSM, scan, etc.), since a TDLS | ||
| 2786 | * setup-response is a direct packet not buffered by the AP. | ||
| 2787 | * mac80211 will call this function just before the transmission of a TDLS | ||
| 2788 | * discovery-request. The recommended period of protection is at least | ||
| 2789 | * 2 * (DTIM period). | ||
| 2790 | * The callback is optional and can sleep. | ||
| 2791 | * | ||
| 2767 | * @add_chanctx: Notifies device driver about new channel context creation. | 2792 | * @add_chanctx: Notifies device driver about new channel context creation. |
| 2768 | * @remove_chanctx: Notifies device driver about channel context destruction. | 2793 | * @remove_chanctx: Notifies device driver about channel context destruction. |
| 2769 | * @change_chanctx: Notifies device driver about channel context changes that | 2794 | * @change_chanctx: Notifies device driver about channel context changes that |
| @@ -2865,13 +2890,13 @@ struct ieee80211_ops { | |||
| 2865 | void (*set_default_unicast_key)(struct ieee80211_hw *hw, | 2890 | void (*set_default_unicast_key)(struct ieee80211_hw *hw, |
| 2866 | struct ieee80211_vif *vif, int idx); | 2891 | struct ieee80211_vif *vif, int idx); |
| 2867 | int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2892 | int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 2868 | struct cfg80211_scan_request *req); | 2893 | struct ieee80211_scan_request *req); |
| 2869 | void (*cancel_hw_scan)(struct ieee80211_hw *hw, | 2894 | void (*cancel_hw_scan)(struct ieee80211_hw *hw, |
| 2870 | struct ieee80211_vif *vif); | 2895 | struct ieee80211_vif *vif); |
| 2871 | int (*sched_scan_start)(struct ieee80211_hw *hw, | 2896 | int (*sched_scan_start)(struct ieee80211_hw *hw, |
| 2872 | struct ieee80211_vif *vif, | 2897 | struct ieee80211_vif *vif, |
| 2873 | struct cfg80211_sched_scan_request *req, | 2898 | struct cfg80211_sched_scan_request *req, |
| 2874 | struct ieee80211_sched_scan_ies *ies); | 2899 | struct ieee80211_scan_ies *ies); |
| 2875 | int (*sched_scan_stop)(struct ieee80211_hw *hw, | 2900 | int (*sched_scan_stop)(struct ieee80211_hw *hw, |
| 2876 | struct ieee80211_vif *vif); | 2901 | struct ieee80211_vif *vif); |
| 2877 | void (*sw_scan_start)(struct ieee80211_hw *hw); | 2902 | void (*sw_scan_start)(struct ieee80211_hw *hw); |
| @@ -2981,6 +3006,9 @@ struct ieee80211_ops { | |||
| 2981 | void (*mgd_prepare_tx)(struct ieee80211_hw *hw, | 3006 | void (*mgd_prepare_tx)(struct ieee80211_hw *hw, |
| 2982 | struct ieee80211_vif *vif); | 3007 | struct ieee80211_vif *vif); |
| 2983 | 3008 | ||
| 3009 | void (*mgd_protect_tdls_discover)(struct ieee80211_hw *hw, | ||
| 3010 | struct ieee80211_vif *vif); | ||
| 3011 | |||
| 2984 | int (*add_chanctx)(struct ieee80211_hw *hw, | 3012 | int (*add_chanctx)(struct ieee80211_hw *hw, |
| 2985 | struct ieee80211_chanctx_conf *ctx); | 3013 | struct ieee80211_chanctx_conf *ctx); |
| 2986 | void (*remove_chanctx)(struct ieee80211_hw *hw, | 3014 | void (*remove_chanctx)(struct ieee80211_hw *hw, |
| @@ -4524,6 +4552,40 @@ void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap, | |||
| 4524 | */ | 4552 | */ |
| 4525 | void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn); | 4553 | void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn); |
| 4526 | 4554 | ||
| 4555 | /** | ||
| 4556 | * ieee80211_start_rx_ba_session_offl - start a Rx BA session | ||
| 4557 | * | ||
| 4558 | * Some device drivers may offload part of the Rx aggregation flow including | ||
| 4559 | * AddBa/DelBa negotiation but may otherwise be incapable of full Rx | ||
| 4560 | * reordering. | ||
| 4561 | * | ||
| 4562 | * Create structures responsible for reordering so device drivers may call here | ||
| 4563 | * when they complete AddBa negotiation. | ||
| 4564 | * | ||
| 4565 | * @vif: &struct ieee80211_vif pointer from the add_interface callback | ||
| 4566 | * @addr: station mac address | ||
| 4567 | * @tid: the rx tid | ||
| 4568 | */ | ||
| 4569 | void ieee80211_start_rx_ba_session_offl(struct ieee80211_vif *vif, | ||
| 4570 | const u8 *addr, u16 tid); | ||
| 4571 | |||
| 4572 | /** | ||
| 4573 | * ieee80211_stop_rx_ba_session_offl - stop a Rx BA session | ||
| 4574 | * | ||
| 4575 | * Some device drivers may offload part of the Rx aggregation flow including | ||
| 4576 | * AddBa/DelBa negotiation but may otherwise be incapable of full Rx | ||
| 4577 | * reordering. | ||
| 4578 | * | ||
| 4579 | * Destroy structures responsible for reordering so device drivers may call here | ||
| 4580 | * when they complete DelBa negotiation. | ||
| 4581 | * | ||
| 4582 | * @vif: &struct ieee80211_vif pointer from the add_interface callback | ||
| 4583 | * @addr: station mac address | ||
| 4584 | * @tid: the rx tid | ||
| 4585 | */ | ||
| 4586 | void ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif, | ||
| 4587 | const u8 *addr, u16 tid); | ||
| 4588 | |||
| 4527 | /* Rate control API */ | 4589 | /* Rate control API */ |
| 4528 | 4590 | ||
| 4529 | /** | 4591 | /** |
| @@ -4815,4 +4877,17 @@ int ieee80211_parse_p2p_noa(const struct ieee80211_p2p_noa_attr *attr, | |||
| 4815 | */ | 4877 | */ |
| 4816 | void ieee80211_update_p2p_noa(struct ieee80211_noa_data *data, u32 tsf); | 4878 | void ieee80211_update_p2p_noa(struct ieee80211_noa_data *data, u32 tsf); |
| 4817 | 4879 | ||
| 4880 | /** | ||
| 4881 | * ieee80211_tdls_oper - request userspace to perform a TDLS operation | ||
| 4882 | * @vif: virtual interface | ||
| 4883 | * @peer: the peer's destination address | ||
| 4884 | * @oper: the requested TDLS operation | ||
| 4885 | * @reason_code: reason code for the operation, valid for TDLS teardown | ||
| 4886 | * @gfp: allocation flags | ||
| 4887 | * | ||
| 4888 | * See cfg80211_tdls_oper_request(). | ||
| 4889 | */ | ||
| 4890 | void ieee80211_tdls_oper_request(struct ieee80211_vif *vif, const u8 *peer, | ||
| 4891 | enum nl80211_tdls_operation oper, | ||
| 4892 | u16 reason_code, gfp_t gfp); | ||
| 4818 | #endif /* MAC80211_H */ | 4893 | #endif /* MAC80211_H */ |
diff --git a/include/net/mac802154.h b/include/net/mac802154.h index a591053cae63..2e67cdd19cdc 100644 --- a/include/net/mac802154.h +++ b/include/net/mac802154.h | |||
| @@ -80,6 +80,25 @@ struct ieee802154_dev { | |||
| 80 | #define IEEE802154_HW_OMIT_CKSUM 0x00000001 | 80 | #define IEEE802154_HW_OMIT_CKSUM 0x00000001 |
| 81 | /* Indicates that receiver will autorespond with ACK frames. */ | 81 | /* Indicates that receiver will autorespond with ACK frames. */ |
| 82 | #define IEEE802154_HW_AACK 0x00000002 | 82 | #define IEEE802154_HW_AACK 0x00000002 |
| 83 | /* Indicates that transceiver will support transmit power setting. */ | ||
| 84 | #define IEEE802154_HW_TXPOWER 0x00000004 | ||
| 85 | /* Indicates that transceiver will support listen before transmit. */ | ||
| 86 | #define IEEE802154_HW_LBT 0x00000008 | ||
| 87 | /* Indicates that transceiver will support cca mode setting. */ | ||
| 88 | #define IEEE802154_HW_CCA_MODE 0x00000010 | ||
| 89 | /* Indicates that transceiver will support cca ed level setting. */ | ||
| 90 | #define IEEE802154_HW_CCA_ED_LEVEL 0x00000020 | ||
| 91 | /* Indicates that transceiver will support csma (max_be, min_be, csma retries) | ||
| 92 | * settings. */ | ||
| 93 | #define IEEE802154_HW_CSMA_PARAMS 0x00000040 | ||
| 94 | /* Indicates that transceiver will support ARET frame retries setting. */ | ||
| 95 | #define IEEE802154_HW_FRAME_RETRIES 0x00000080 | ||
| 96 | |||
| 97 | /* This groups the most common CSMA support fields into one. */ | ||
| 98 | #define IEEE802154_HW_CSMA (IEEE802154_HW_CCA_MODE | \ | ||
| 99 | IEEE802154_HW_CCA_ED_LEVEL | \ | ||
| 100 | IEEE802154_HW_CSMA_PARAMS | \ | ||
| 101 | IEEE802154_HW_FRAME_RETRIES) | ||
| 83 | 102 | ||
| 84 | /* struct ieee802154_ops - callbacks from mac802154 to the driver | 103 | /* struct ieee802154_ops - callbacks from mac802154 to the driver |
| 85 | * | 104 | * |
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index 0e3d08e4b1d3..57c880378443 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
| @@ -18,7 +18,6 @@ struct nf_conntrack_ecache { | |||
| 18 | u16 ctmask; /* bitmask of ct events to be delivered */ | 18 | u16 ctmask; /* bitmask of ct events to be delivered */ |
| 19 | u16 expmask; /* bitmask of expect events to be delivered */ | 19 | u16 expmask; /* bitmask of expect events to be delivered */ |
| 20 | u32 portid; /* netlink portid of destroyer */ | 20 | u32 portid; /* netlink portid of destroyer */ |
| 21 | struct timer_list timeout; | ||
| 22 | }; | 21 | }; |
| 23 | 22 | ||
| 24 | static inline struct nf_conntrack_ecache * | 23 | static inline struct nf_conntrack_ecache * |
| @@ -216,8 +215,23 @@ void nf_conntrack_ecache_pernet_fini(struct net *net); | |||
| 216 | 215 | ||
| 217 | int nf_conntrack_ecache_init(void); | 216 | int nf_conntrack_ecache_init(void); |
| 218 | void nf_conntrack_ecache_fini(void); | 217 | void nf_conntrack_ecache_fini(void); |
| 219 | #else /* CONFIG_NF_CONNTRACK_EVENTS */ | ||
| 220 | 218 | ||
| 219 | static inline void nf_conntrack_ecache_delayed_work(struct net *net) | ||
| 220 | { | ||
| 221 | if (!delayed_work_pending(&net->ct.ecache_dwork)) { | ||
| 222 | schedule_delayed_work(&net->ct.ecache_dwork, HZ); | ||
| 223 | net->ct.ecache_dwork_pending = true; | ||
| 224 | } | ||
| 225 | } | ||
| 226 | |||
| 227 | static inline void nf_conntrack_ecache_work(struct net *net) | ||
| 228 | { | ||
| 229 | if (net->ct.ecache_dwork_pending) { | ||
| 230 | net->ct.ecache_dwork_pending = false; | ||
| 231 | mod_delayed_work(system_wq, &net->ct.ecache_dwork, 0); | ||
| 232 | } | ||
| 233 | } | ||
| 234 | #else /* CONFIG_NF_CONNTRACK_EVENTS */ | ||
| 221 | static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, | 235 | static inline void nf_conntrack_event_cache(enum ip_conntrack_events event, |
| 222 | struct nf_conn *ct) {} | 236 | struct nf_conn *ct) {} |
| 223 | static inline int nf_conntrack_eventmask_report(unsigned int eventmask, | 237 | static inline int nf_conntrack_eventmask_report(unsigned int eventmask, |
| @@ -255,6 +269,14 @@ static inline int nf_conntrack_ecache_init(void) | |||
| 255 | static inline void nf_conntrack_ecache_fini(void) | 269 | static inline void nf_conntrack_ecache_fini(void) |
| 256 | { | 270 | { |
| 257 | } | 271 | } |
| 272 | |||
| 273 | static inline void nf_conntrack_ecache_delayed_work(struct net *net) | ||
| 274 | { | ||
| 275 | } | ||
| 276 | |||
| 277 | static inline void nf_conntrack_ecache_work(struct net *net) | ||
| 278 | { | ||
| 279 | } | ||
| 258 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ | 280 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ |
| 259 | 281 | ||
| 260 | #endif /*_NF_CONNTRACK_ECACHE_H*/ | 282 | #endif /*_NF_CONNTRACK_ECACHE_H*/ |
diff --git a/include/net/netfilter/nf_log.h b/include/net/netfilter/nf_log.h index 99eac12d040b..534e1f2ac4fc 100644 --- a/include/net/netfilter/nf_log.h +++ b/include/net/netfilter/nf_log.h | |||
| @@ -12,8 +12,11 @@ | |||
| 12 | #define NF_LOG_UID 0x08 /* Log UID owning local socket */ | 12 | #define NF_LOG_UID 0x08 /* Log UID owning local socket */ |
| 13 | #define NF_LOG_MASK 0x0f | 13 | #define NF_LOG_MASK 0x0f |
| 14 | 14 | ||
| 15 | #define NF_LOG_TYPE_LOG 0x01 | 15 | enum nf_log_type { |
| 16 | #define NF_LOG_TYPE_ULOG 0x02 | 16 | NF_LOG_TYPE_LOG = 0, |
| 17 | NF_LOG_TYPE_ULOG, | ||
| 18 | NF_LOG_TYPE_MAX | ||
| 19 | }; | ||
| 17 | 20 | ||
| 18 | struct nf_loginfo { | 21 | struct nf_loginfo { |
| 19 | u_int8_t type; | 22 | u_int8_t type; |
| @@ -40,10 +43,10 @@ typedef void nf_logfn(struct net *net, | |||
| 40 | const char *prefix); | 43 | const char *prefix); |
| 41 | 44 | ||
| 42 | struct nf_logger { | 45 | struct nf_logger { |
| 43 | struct module *me; | 46 | char *name; |
| 44 | nf_logfn *logfn; | 47 | enum nf_log_type type; |
| 45 | char *name; | 48 | nf_logfn *logfn; |
| 46 | struct list_head list[NFPROTO_NUMPROTO]; | 49 | struct module *me; |
| 47 | }; | 50 | }; |
| 48 | 51 | ||
| 49 | /* Function to register/unregister log function. */ | 52 | /* Function to register/unregister log function. */ |
| @@ -58,6 +61,13 @@ int nf_log_bind_pf(struct net *net, u_int8_t pf, | |||
| 58 | const struct nf_logger *logger); | 61 | const struct nf_logger *logger); |
| 59 | void nf_log_unbind_pf(struct net *net, u_int8_t pf); | 62 | void nf_log_unbind_pf(struct net *net, u_int8_t pf); |
| 60 | 63 | ||
| 64 | int nf_logger_find_get(int pf, enum nf_log_type type); | ||
| 65 | void nf_logger_put(int pf, enum nf_log_type type); | ||
| 66 | void nf_logger_request_module(int pf, enum nf_log_type type); | ||
| 67 | |||
| 68 | #define MODULE_ALIAS_NF_LOGGER(family, type) \ | ||
| 69 | MODULE_ALIAS("nf-logger-" __stringify(family) "-" __stringify(type)) | ||
| 70 | |||
| 61 | /* Calls the registered backend logging function */ | 71 | /* Calls the registered backend logging function */ |
| 62 | __printf(8, 9) | 72 | __printf(8, 9) |
| 63 | void nf_log_packet(struct net *net, | 73 | void nf_log_packet(struct net *net, |
| @@ -69,4 +79,24 @@ void nf_log_packet(struct net *net, | |||
| 69 | const struct nf_loginfo *li, | 79 | const struct nf_loginfo *li, |
| 70 | const char *fmt, ...); | 80 | const char *fmt, ...); |
| 71 | 81 | ||
| 82 | struct nf_log_buf; | ||
| 83 | |||
| 84 | struct nf_log_buf *nf_log_buf_open(void); | ||
| 85 | __printf(2, 3) int nf_log_buf_add(struct nf_log_buf *m, const char *f, ...); | ||
| 86 | void nf_log_buf_close(struct nf_log_buf *m); | ||
| 87 | |||
| 88 | /* common logging functions */ | ||
| 89 | int nf_log_dump_udp_header(struct nf_log_buf *m, const struct sk_buff *skb, | ||
| 90 | u8 proto, int fragment, unsigned int offset); | ||
| 91 | int nf_log_dump_tcp_header(struct nf_log_buf *m, const struct sk_buff *skb, | ||
| 92 | u8 proto, int fragment, unsigned int offset, | ||
| 93 | unsigned int logflags); | ||
| 94 | void nf_log_dump_sk_uid_gid(struct nf_log_buf *m, struct sock *sk); | ||
| 95 | void nf_log_dump_packet_common(struct nf_log_buf *m, u_int8_t pf, | ||
| 96 | unsigned int hooknum, const struct sk_buff *skb, | ||
| 97 | const struct net_device *in, | ||
| 98 | const struct net_device *out, | ||
| 99 | const struct nf_loginfo *loginfo, | ||
| 100 | const char *prefix); | ||
| 101 | |||
| 72 | #endif /* _NF_LOG_H */ | 102 | #endif /* _NF_LOG_H */ |
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index 713b0b88bd5a..c4d86198d3d6 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <linux/netfilter/nfnetlink.h> | 6 | #include <linux/netfilter/nfnetlink.h> |
| 7 | #include <linux/netfilter/x_tables.h> | 7 | #include <linux/netfilter/x_tables.h> |
| 8 | #include <linux/netfilter/nf_tables.h> | 8 | #include <linux/netfilter/nf_tables.h> |
| 9 | #include <linux/u64_stats_sync.h> | ||
| 9 | #include <net/netlink.h> | 10 | #include <net/netlink.h> |
| 10 | 11 | ||
| 11 | #define NFT_JUMP_STACK_SIZE 16 | 12 | #define NFT_JUMP_STACK_SIZE 16 |
| @@ -528,8 +529,9 @@ enum nft_chain_type { | |||
| 528 | }; | 529 | }; |
| 529 | 530 | ||
| 530 | struct nft_stats { | 531 | struct nft_stats { |
| 531 | u64 bytes; | 532 | u64 bytes; |
| 532 | u64 pkts; | 533 | u64 pkts; |
| 534 | struct u64_stats_sync syncp; | ||
| 533 | }; | 535 | }; |
| 534 | 536 | ||
| 535 | #define NFT_HOOK_OPS_MAX 2 | 537 | #define NFT_HOOK_OPS_MAX 2 |
diff --git a/include/net/netfilter/xt_log.h b/include/net/netfilter/xt_log.h deleted file mode 100644 index 9d9756cca013..000000000000 --- a/include/net/netfilter/xt_log.h +++ /dev/null | |||
| @@ -1,54 +0,0 @@ | |||
| 1 | #define S_SIZE (1024 - (sizeof(unsigned int) + 1)) | ||
| 2 | |||
| 3 | struct sbuff { | ||
| 4 | unsigned int count; | ||
| 5 | char buf[S_SIZE + 1]; | ||
| 6 | }; | ||
| 7 | static struct sbuff emergency, *emergency_ptr = &emergency; | ||
| 8 | |||
| 9 | static __printf(2, 3) int sb_add(struct sbuff *m, const char *f, ...) | ||
| 10 | { | ||
| 11 | va_list args; | ||
| 12 | int len; | ||
| 13 | |||
| 14 | if (likely(m->count < S_SIZE)) { | ||
| 15 | va_start(args, f); | ||
| 16 | len = vsnprintf(m->buf + m->count, S_SIZE - m->count, f, args); | ||
| 17 | va_end(args); | ||
| 18 | if (likely(m->count + len < S_SIZE)) { | ||
| 19 | m->count += len; | ||
| 20 | return 0; | ||
| 21 | } | ||
| 22 | } | ||
| 23 | m->count = S_SIZE; | ||
| 24 | printk_once(KERN_ERR KBUILD_MODNAME " please increase S_SIZE\n"); | ||
| 25 | return -1; | ||
| 26 | } | ||
| 27 | |||
| 28 | static struct sbuff *sb_open(void) | ||
| 29 | { | ||
| 30 | struct sbuff *m = kmalloc(sizeof(*m), GFP_ATOMIC); | ||
| 31 | |||
| 32 | if (unlikely(!m)) { | ||
| 33 | local_bh_disable(); | ||
| 34 | do { | ||
| 35 | m = xchg(&emergency_ptr, NULL); | ||
| 36 | } while (!m); | ||
| 37 | } | ||
| 38 | m->count = 0; | ||
| 39 | return m; | ||
| 40 | } | ||
| 41 | |||
| 42 | static void sb_close(struct sbuff *m) | ||
| 43 | { | ||
| 44 | m->buf[m->count] = 0; | ||
| 45 | printk("%s\n", m->buf); | ||
| 46 | |||
| 47 | if (likely(m != &emergency)) | ||
| 48 | kfree(m); | ||
| 49 | else { | ||
| 50 | emergency_ptr = m; | ||
| 51 | local_bh_enable(); | ||
| 52 | } | ||
| 53 | } | ||
| 54 | |||
diff --git a/include/net/netlabel.h b/include/net/netlabel.h index 4fe018c48ed9..a4fc39bb3e4f 100644 --- a/include/net/netlabel.h +++ b/include/net/netlabel.h | |||
| @@ -139,7 +139,7 @@ struct netlbl_lsm_cache { | |||
| 139 | }; | 139 | }; |
| 140 | 140 | ||
| 141 | /** | 141 | /** |
| 142 | * struct netlbl_lsm_secattr_catmap - NetLabel LSM secattr category bitmap | 142 | * struct netlbl_lsm_catmap - NetLabel LSM secattr category bitmap |
| 143 | * @startbit: the value of the lowest order bit in the bitmap | 143 | * @startbit: the value of the lowest order bit in the bitmap |
| 144 | * @bitmap: the category bitmap | 144 | * @bitmap: the category bitmap |
| 145 | * @next: pointer to the next bitmap "node" or NULL | 145 | * @next: pointer to the next bitmap "node" or NULL |
| @@ -162,10 +162,10 @@ struct netlbl_lsm_cache { | |||
| 162 | #define NETLBL_CATMAP_SIZE (NETLBL_CATMAP_MAPSIZE * \ | 162 | #define NETLBL_CATMAP_SIZE (NETLBL_CATMAP_MAPSIZE * \ |
| 163 | NETLBL_CATMAP_MAPCNT) | 163 | NETLBL_CATMAP_MAPCNT) |
| 164 | #define NETLBL_CATMAP_BIT (NETLBL_CATMAP_MAPTYPE)0x01 | 164 | #define NETLBL_CATMAP_BIT (NETLBL_CATMAP_MAPTYPE)0x01 |
| 165 | struct netlbl_lsm_secattr_catmap { | 165 | struct netlbl_lsm_catmap { |
| 166 | u32 startbit; | 166 | u32 startbit; |
| 167 | NETLBL_CATMAP_MAPTYPE bitmap[NETLBL_CATMAP_MAPCNT]; | 167 | NETLBL_CATMAP_MAPTYPE bitmap[NETLBL_CATMAP_MAPCNT]; |
| 168 | struct netlbl_lsm_secattr_catmap *next; | 168 | struct netlbl_lsm_catmap *next; |
| 169 | }; | 169 | }; |
| 170 | 170 | ||
| 171 | /** | 171 | /** |
| @@ -209,7 +209,7 @@ struct netlbl_lsm_secattr { | |||
| 209 | struct netlbl_lsm_cache *cache; | 209 | struct netlbl_lsm_cache *cache; |
| 210 | struct { | 210 | struct { |
| 211 | struct { | 211 | struct { |
| 212 | struct netlbl_lsm_secattr_catmap *cat; | 212 | struct netlbl_lsm_catmap *cat; |
| 213 | u32 lvl; | 213 | u32 lvl; |
| 214 | } mls; | 214 | } mls; |
| 215 | u32 secid; | 215 | u32 secid; |
| @@ -258,7 +258,7 @@ static inline void netlbl_secattr_cache_free(struct netlbl_lsm_cache *cache) | |||
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | /** | 260 | /** |
| 261 | * netlbl_secattr_catmap_alloc - Allocate a LSM secattr catmap | 261 | * netlbl_catmap_alloc - Allocate a LSM secattr catmap |
| 262 | * @flags: memory allocation flags | 262 | * @flags: memory allocation flags |
| 263 | * | 263 | * |
| 264 | * Description: | 264 | * Description: |
| @@ -266,30 +266,28 @@ static inline void netlbl_secattr_cache_free(struct netlbl_lsm_cache *cache) | |||
| 266 | * on failure. | 266 | * on failure. |
| 267 | * | 267 | * |
| 268 | */ | 268 | */ |
| 269 | static inline struct netlbl_lsm_secattr_catmap *netlbl_secattr_catmap_alloc( | 269 | static inline struct netlbl_lsm_catmap *netlbl_catmap_alloc(gfp_t flags) |
| 270 | gfp_t flags) | ||
| 271 | { | 270 | { |
| 272 | return kzalloc(sizeof(struct netlbl_lsm_secattr_catmap), flags); | 271 | return kzalloc(sizeof(struct netlbl_lsm_catmap), flags); |
| 273 | } | 272 | } |
| 274 | 273 | ||
| 275 | /** | 274 | /** |
| 276 | * netlbl_secattr_catmap_free - Free a LSM secattr catmap | 275 | * netlbl_catmap_free - Free a LSM secattr catmap |
| 277 | * @catmap: the category bitmap | 276 | * @catmap: the category bitmap |
| 278 | * | 277 | * |
| 279 | * Description: | 278 | * Description: |
| 280 | * Free a LSM secattr catmap. | 279 | * Free a LSM secattr catmap. |
| 281 | * | 280 | * |
| 282 | */ | 281 | */ |
| 283 | static inline void netlbl_secattr_catmap_free( | 282 | static inline void netlbl_catmap_free(struct netlbl_lsm_catmap *catmap) |
| 284 | struct netlbl_lsm_secattr_catmap *catmap) | ||
| 285 | { | 283 | { |
| 286 | struct netlbl_lsm_secattr_catmap *iter; | 284 | struct netlbl_lsm_catmap *iter; |
| 287 | 285 | ||
| 288 | do { | 286 | while (catmap) { |
| 289 | iter = catmap; | 287 | iter = catmap; |
| 290 | catmap = catmap->next; | 288 | catmap = catmap->next; |
| 291 | kfree(iter); | 289 | kfree(iter); |
| 292 | } while (catmap); | 290 | } |
| 293 | } | 291 | } |
| 294 | 292 | ||
| 295 | /** | 293 | /** |
| @@ -321,7 +319,7 @@ static inline void netlbl_secattr_destroy(struct netlbl_lsm_secattr *secattr) | |||
| 321 | if (secattr->flags & NETLBL_SECATTR_CACHE) | 319 | if (secattr->flags & NETLBL_SECATTR_CACHE) |
| 322 | netlbl_secattr_cache_free(secattr->cache); | 320 | netlbl_secattr_cache_free(secattr->cache); |
| 323 | if (secattr->flags & NETLBL_SECATTR_MLS_CAT) | 321 | if (secattr->flags & NETLBL_SECATTR_MLS_CAT) |
| 324 | netlbl_secattr_catmap_free(secattr->attr.mls.cat); | 322 | netlbl_catmap_free(secattr->attr.mls.cat); |
| 325 | } | 323 | } |
| 326 | 324 | ||
| 327 | /** | 325 | /** |
| @@ -390,17 +388,22 @@ int netlbl_cfg_cipsov4_map_add(u32 doi, | |||
| 390 | /* | 388 | /* |
| 391 | * LSM security attribute operations | 389 | * LSM security attribute operations |
| 392 | */ | 390 | */ |
| 393 | int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap, | 391 | int netlbl_catmap_walk(struct netlbl_lsm_catmap *catmap, u32 offset); |
| 394 | u32 offset); | 392 | int netlbl_catmap_walkrng(struct netlbl_lsm_catmap *catmap, u32 offset); |
| 395 | int netlbl_secattr_catmap_walk_rng(struct netlbl_lsm_secattr_catmap *catmap, | 393 | int netlbl_catmap_getlong(struct netlbl_lsm_catmap *catmap, |
| 396 | u32 offset); | 394 | u32 *offset, |
| 397 | int netlbl_secattr_catmap_setbit(struct netlbl_lsm_secattr_catmap *catmap, | 395 | unsigned long *bitmap); |
| 398 | u32 bit, | 396 | int netlbl_catmap_setbit(struct netlbl_lsm_catmap **catmap, |
| 399 | gfp_t flags); | 397 | u32 bit, |
| 400 | int netlbl_secattr_catmap_setrng(struct netlbl_lsm_secattr_catmap *catmap, | 398 | gfp_t flags); |
| 401 | u32 start, | 399 | int netlbl_catmap_setrng(struct netlbl_lsm_catmap **catmap, |
| 402 | u32 end, | 400 | u32 start, |
| 403 | gfp_t flags); | 401 | u32 end, |
| 402 | gfp_t flags); | ||
| 403 | int netlbl_catmap_setlong(struct netlbl_lsm_catmap **catmap, | ||
| 404 | u32 offset, | ||
| 405 | unsigned long bitmap, | ||
| 406 | gfp_t flags); | ||
| 404 | 407 | ||
| 405 | /* | 408 | /* |
| 406 | * LSM protocol operations (NetLabel LSM/kernel API) | 409 | * LSM protocol operations (NetLabel LSM/kernel API) |
| @@ -492,30 +495,39 @@ static inline int netlbl_cfg_cipsov4_map_add(u32 doi, | |||
| 492 | { | 495 | { |
| 493 | return -ENOSYS; | 496 | return -ENOSYS; |
| 494 | } | 497 | } |
| 495 | static inline int netlbl_secattr_catmap_walk( | 498 | static inline int netlbl_catmap_walk(struct netlbl_lsm_catmap *catmap, |
| 496 | struct netlbl_lsm_secattr_catmap *catmap, | 499 | u32 offset) |
| 497 | u32 offset) | ||
| 498 | { | 500 | { |
| 499 | return -ENOENT; | 501 | return -ENOENT; |
| 500 | } | 502 | } |
| 501 | static inline int netlbl_secattr_catmap_walk_rng( | 503 | static inline int netlbl_catmap_walkrng(struct netlbl_lsm_catmap *catmap, |
| 502 | struct netlbl_lsm_secattr_catmap *catmap, | 504 | u32 offset) |
| 503 | u32 offset) | ||
| 504 | { | 505 | { |
| 505 | return -ENOENT; | 506 | return -ENOENT; |
| 506 | } | 507 | } |
| 507 | static inline int netlbl_secattr_catmap_setbit( | 508 | static inline int netlbl_catmap_getlong(struct netlbl_lsm_catmap *catmap, |
| 508 | struct netlbl_lsm_secattr_catmap *catmap, | 509 | u32 *offset, |
| 509 | u32 bit, | 510 | unsigned long *bitmap) |
| 510 | gfp_t flags) | ||
| 511 | { | 511 | { |
| 512 | return 0; | 512 | return 0; |
| 513 | } | 513 | } |
| 514 | static inline int netlbl_secattr_catmap_setrng( | 514 | static inline int netlbl_catmap_setbit(struct netlbl_lsm_catmap **catmap, |
| 515 | struct netlbl_lsm_secattr_catmap *catmap, | 515 | u32 bit, |
| 516 | u32 start, | 516 | gfp_t flags) |
| 517 | u32 end, | 517 | { |
| 518 | gfp_t flags) | 518 | return 0; |
| 519 | } | ||
| 520 | static inline int netlbl_catmap_setrng(struct netlbl_lsm_catmap **catmap, | ||
| 521 | u32 start, | ||
| 522 | u32 end, | ||
| 523 | gfp_t flags) | ||
| 524 | { | ||
| 525 | return 0; | ||
| 526 | } | ||
| 527 | static int netlbl_catmap_setlong(struct netlbl_lsm_catmap **catmap, | ||
| 528 | u32 offset, | ||
| 529 | unsigned long bitmap, | ||
| 530 | gfp_t flags) | ||
| 519 | { | 531 | { |
| 520 | return 0; | 532 | return 0; |
| 521 | } | 533 | } |
diff --git a/include/net/netlink.h b/include/net/netlink.h index 2b47eaadba8f..6c1076275aaa 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
| @@ -949,12 +949,12 @@ static inline int nla_put_flag(struct sk_buff *skb, int attrtype) | |||
| 949 | * nla_put_msecs - Add a msecs netlink attribute to a socket buffer | 949 | * nla_put_msecs - Add a msecs netlink attribute to a socket buffer |
| 950 | * @skb: socket buffer to add attribute to | 950 | * @skb: socket buffer to add attribute to |
| 951 | * @attrtype: attribute type | 951 | * @attrtype: attribute type |
| 952 | * @jiffies: number of msecs in jiffies | 952 | * @njiffies: number of jiffies to convert to msecs |
| 953 | */ | 953 | */ |
| 954 | static inline int nla_put_msecs(struct sk_buff *skb, int attrtype, | 954 | static inline int nla_put_msecs(struct sk_buff *skb, int attrtype, |
| 955 | unsigned long jiffies) | 955 | unsigned long njiffies) |
| 956 | { | 956 | { |
| 957 | u64 tmp = jiffies_to_msecs(jiffies); | 957 | u64 tmp = jiffies_to_msecs(njiffies); |
| 958 | return nla_put(skb, attrtype, sizeof(u64), &tmp); | 958 | return nla_put(skb, attrtype, sizeof(u64), &tmp); |
| 959 | } | 959 | } |
| 960 | 960 | ||
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index 773cce308bc6..29d6a94db54d 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
| 5 | #include <linux/list_nulls.h> | 5 | #include <linux/list_nulls.h> |
| 6 | #include <linux/atomic.h> | 6 | #include <linux/atomic.h> |
| 7 | #include <linux/workqueue.h> | ||
| 7 | #include <linux/netfilter/nf_conntrack_tcp.h> | 8 | #include <linux/netfilter/nf_conntrack_tcp.h> |
| 8 | #include <linux/seqlock.h> | 9 | #include <linux/seqlock.h> |
| 9 | 10 | ||
| @@ -73,6 +74,10 @@ struct ct_pcpu { | |||
| 73 | struct netns_ct { | 74 | struct netns_ct { |
| 74 | atomic_t count; | 75 | atomic_t count; |
| 75 | unsigned int expect_count; | 76 | unsigned int expect_count; |
| 77 | #ifdef CONFIG_NF_CONNTRACK_EVENTS | ||
| 78 | struct delayed_work ecache_dwork; | ||
| 79 | bool ecache_dwork_pending; | ||
| 80 | #endif | ||
| 76 | #ifdef CONFIG_SYSCTL | 81 | #ifdef CONFIG_SYSCTL |
| 77 | struct ctl_table_header *sysctl_header; | 82 | struct ctl_table_header *sysctl_header; |
| 78 | struct ctl_table_header *acct_sysctl_header; | 83 | struct ctl_table_header *acct_sysctl_header; |
| @@ -82,7 +87,6 @@ struct netns_ct { | |||
| 82 | #endif | 87 | #endif |
| 83 | char *slabname; | 88 | char *slabname; |
| 84 | unsigned int sysctl_log_invalid; /* Log invalid packets */ | 89 | unsigned int sysctl_log_invalid; /* Log invalid packets */ |
| 85 | unsigned int sysctl_events_retry_timeout; | ||
| 86 | int sysctl_events; | 90 | int sysctl_events; |
| 87 | int sysctl_acct; | 91 | int sysctl_acct; |
| 88 | int sysctl_auto_assign_helper; | 92 | int sysctl_auto_assign_helper; |
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index 19d3446e59d2..eade27adecf3 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
| @@ -28,6 +28,7 @@ struct netns_sysctl_ipv6 { | |||
| 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 flowlabel_consistency; |
| 31 | int auto_flowlabels; | ||
| 31 | int icmpv6_time; | 32 | int icmpv6_time; |
| 32 | int anycast_src_echo_reply; | 33 | int anycast_src_echo_reply; |
| 33 | int fwmark_reflect; | 34 | int fwmark_reflect; |
diff --git a/include/net/netns/nftables.h b/include/net/netns/nftables.h index 26a394cb91a8..eee608b12cc9 100644 --- a/include/net/netns/nftables.h +++ b/include/net/netns/nftables.h | |||
| @@ -13,8 +13,8 @@ struct netns_nftables { | |||
| 13 | struct nft_af_info *inet; | 13 | struct nft_af_info *inet; |
| 14 | struct nft_af_info *arp; | 14 | struct nft_af_info *arp; |
| 15 | struct nft_af_info *bridge; | 15 | struct nft_af_info *bridge; |
| 16 | unsigned int base_seq; | ||
| 16 | u8 gencursor; | 17 | u8 gencursor; |
| 17 | u8 genctr; | ||
| 18 | }; | 18 | }; |
| 19 | 19 | ||
| 20 | #endif | 20 | #endif |
diff --git a/include/net/netns/x_tables.h b/include/net/netns/x_tables.h index 02fe40f8c8fd..c24060ee411e 100644 --- a/include/net/netns/x_tables.h +++ b/include/net/netns/x_tables.h | |||
| @@ -15,11 +15,5 @@ struct netns_xt { | |||
| 15 | struct ebt_table *frame_filter; | 15 | struct ebt_table *frame_filter; |
| 16 | struct ebt_table *frame_nat; | 16 | struct ebt_table *frame_nat; |
| 17 | #endif | 17 | #endif |
| 18 | #if IS_ENABLED(CONFIG_IP_NF_TARGET_ULOG) | ||
| 19 | bool ulog_warn_deprecated; | ||
| 20 | #endif | ||
| 21 | #if IS_ENABLED(CONFIG_BRIDGE_EBT_ULOG) | ||
| 22 | bool ebt_ulog_warn_deprecated; | ||
| 23 | #endif | ||
| 24 | }; | 18 | }; |
| 25 | #endif | 19 | #endif |
diff --git a/include/net/nfc/digital.h b/include/net/nfc/digital.h index bdf55c3b7a19..d9a5cf7ac1c4 100644 --- a/include/net/nfc/digital.h +++ b/include/net/nfc/digital.h | |||
| @@ -49,6 +49,7 @@ enum { | |||
| 49 | NFC_DIGITAL_FRAMING_NFCA_SHORT = 0, | 49 | NFC_DIGITAL_FRAMING_NFCA_SHORT = 0, |
| 50 | NFC_DIGITAL_FRAMING_NFCA_STANDARD, | 50 | NFC_DIGITAL_FRAMING_NFCA_STANDARD, |
| 51 | NFC_DIGITAL_FRAMING_NFCA_STANDARD_WITH_CRC_A, | 51 | NFC_DIGITAL_FRAMING_NFCA_STANDARD_WITH_CRC_A, |
| 52 | NFC_DIGITAL_FRAMING_NFCA_ANTICOL_COMPLETE, | ||
| 52 | 53 | ||
| 53 | NFC_DIGITAL_FRAMING_NFCA_T1T, | 54 | NFC_DIGITAL_FRAMING_NFCA_T1T, |
| 54 | NFC_DIGITAL_FRAMING_NFCA_T2T, | 55 | NFC_DIGITAL_FRAMING_NFCA_T2T, |
| @@ -126,6 +127,15 @@ typedef void (*nfc_digital_cmd_complete_t)(struct nfc_digital_dev *ddev, | |||
| 126 | * the NFC-DEP ATR_REQ command through cb. The digital stack deducts the RF | 127 | * the NFC-DEP ATR_REQ command through cb. The digital stack deducts the RF |
| 127 | * tech by analyzing the SoD of the frame containing the ATR_REQ command. | 128 | * tech by analyzing the SoD of the frame containing the ATR_REQ command. |
| 128 | * This is an asynchronous function. | 129 | * This is an asynchronous function. |
| 130 | * @tg_listen_md: If supported, put the device in automatic listen mode with | ||
| 131 | * mode detection but without automatic anti-collision. In this mode, the | ||
| 132 | * device automatically detects the RF technology. What the actual | ||
| 133 | * RF technology is can be retrieved by calling @tg_get_rf_tech. | ||
| 134 | * The digital stack will then perform the appropriate anti-collision | ||
| 135 | * sequence. This is an asynchronous function. | ||
| 136 | * @tg_get_rf_tech: Required when @tg_listen_md is supported, unused otherwise. | ||
| 137 | * Return the RF Technology that was detected by the @tg_listen_md call. | ||
| 138 | * This is a synchronous function. | ||
| 129 | * | 139 | * |
| 130 | * @switch_rf: Turns device radio on or off. The stack does not call explicitly | 140 | * @switch_rf: Turns device radio on or off. The stack does not call explicitly |
| 131 | * switch_rf to turn the radio on. A call to in|tg_configure_hw must turn | 141 | * switch_rf to turn the radio on. A call to in|tg_configure_hw must turn |
| @@ -160,6 +170,9 @@ struct nfc_digital_ops { | |||
| 160 | struct digital_tg_mdaa_params *mdaa_params, | 170 | struct digital_tg_mdaa_params *mdaa_params, |
| 161 | u16 timeout, nfc_digital_cmd_complete_t cb, | 171 | u16 timeout, nfc_digital_cmd_complete_t cb, |
| 162 | void *arg); | 172 | void *arg); |
| 173 | int (*tg_listen_md)(struct nfc_digital_dev *ddev, u16 timeout, | ||
| 174 | nfc_digital_cmd_complete_t cb, void *arg); | ||
| 175 | int (*tg_get_rf_tech)(struct nfc_digital_dev *ddev, u8 *rf_tech); | ||
| 163 | 176 | ||
| 164 | int (*switch_rf)(struct nfc_digital_dev *ddev, bool on); | 177 | int (*switch_rf)(struct nfc_digital_dev *ddev, bool on); |
| 165 | void (*abort_cmd)(struct nfc_digital_dev *ddev); | 178 | void (*abort_cmd)(struct nfc_digital_dev *ddev); |
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index 61286db54388..7ee8f4cc610b 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
| @@ -37,6 +37,7 @@ struct nfc_hci_ops { | |||
| 37 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); | 37 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); |
| 38 | int (*start_poll) (struct nfc_hci_dev *hdev, | 38 | int (*start_poll) (struct nfc_hci_dev *hdev, |
| 39 | u32 im_protocols, u32 tm_protocols); | 39 | u32 im_protocols, u32 tm_protocols); |
| 40 | void (*stop_poll) (struct nfc_hci_dev *hdev); | ||
| 40 | int (*dep_link_up)(struct nfc_hci_dev *hdev, struct nfc_target *target, | 41 | int (*dep_link_up)(struct nfc_hci_dev *hdev, struct nfc_target *target, |
| 41 | u8 comm_mode, u8 *gb, size_t gb_len); | 42 | u8 comm_mode, u8 *gb, size_t gb_len); |
| 42 | int (*dep_link_down)(struct nfc_hci_dev *hdev); | 43 | int (*dep_link_down)(struct nfc_hci_dev *hdev); |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index 72240e5ac2c4..e21b9f9653c0 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
| @@ -136,6 +136,7 @@ void rtnl_af_unregister(struct rtnl_af_ops *ops); | |||
| 136 | 136 | ||
| 137 | 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[]); |
| 138 | struct net_device *rtnl_create_link(struct net *net, char *ifname, | 138 | struct net_device *rtnl_create_link(struct net *net, char *ifname, |
| 139 | unsigned char name_assign_type, | ||
| 139 | const struct rtnl_link_ops *ops, | 140 | const struct rtnl_link_ops *ops, |
| 140 | struct nlattr *tb[]); | 141 | struct nlattr *tb[]); |
| 141 | int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm); | 142 | int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 624f9857c83e..a3cfb8ebeb53 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
| @@ -231,7 +231,7 @@ struct qdisc_skb_cb { | |||
| 231 | unsigned int pkt_len; | 231 | unsigned int pkt_len; |
| 232 | u16 slave_dev_queue_mapping; | 232 | u16 slave_dev_queue_mapping; |
| 233 | u16 _pad; | 233 | u16 _pad; |
| 234 | unsigned char data[20]; | 234 | unsigned char data[24]; |
| 235 | }; | 235 | }; |
| 236 | 236 | ||
| 237 | static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz) | 237 | static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz) |
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 4b7cd695e431..f22538e68245 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
| @@ -118,6 +118,7 @@ typedef enum { | |||
| 118 | #define SCTP_MAX_NUM_COMMANDS 14 | 118 | #define SCTP_MAX_NUM_COMMANDS 14 |
| 119 | 119 | ||
| 120 | typedef union { | 120 | typedef union { |
| 121 | void *zero_all; /* Set to NULL to clear the entire union */ | ||
| 121 | __s32 i32; | 122 | __s32 i32; |
| 122 | __u32 u32; | 123 | __u32 u32; |
| 123 | __be32 be32; | 124 | __be32 be32; |
| @@ -154,7 +155,7 @@ typedef union { | |||
| 154 | static inline sctp_arg_t \ | 155 | static inline sctp_arg_t \ |
| 155 | SCTP_## name (type arg) \ | 156 | SCTP_## name (type arg) \ |
| 156 | { sctp_arg_t retval;\ | 157 | { sctp_arg_t retval;\ |
| 157 | memset(&retval, 0, sizeof(sctp_arg_t));\ | 158 | retval.zero_all = NULL;\ |
| 158 | retval.elt = arg;\ | 159 | retval.elt = arg;\ |
| 159 | return retval;\ | 160 | return retval;\ |
| 160 | } | 161 | } |
| @@ -191,7 +192,7 @@ static inline sctp_arg_t SCTP_NOFORCE(void) | |||
| 191 | static inline sctp_arg_t SCTP_NULL(void) | 192 | static inline sctp_arg_t SCTP_NULL(void) |
| 192 | { | 193 | { |
| 193 | sctp_arg_t retval; | 194 | sctp_arg_t retval; |
| 194 | memset(&retval, 0, sizeof(sctp_arg_t)); | 195 | retval.zero_all = NULL; |
| 195 | return retval; | 196 | return retval; |
| 196 | } | 197 | } |
| 197 | 198 | ||
| @@ -202,27 +203,49 @@ typedef struct { | |||
| 202 | 203 | ||
| 203 | typedef struct { | 204 | typedef struct { |
| 204 | sctp_cmd_t cmds[SCTP_MAX_NUM_COMMANDS]; | 205 | sctp_cmd_t cmds[SCTP_MAX_NUM_COMMANDS]; |
| 205 | __u8 next_free_slot; | 206 | sctp_cmd_t *last_used_slot; |
| 206 | __u8 next_cmd; | 207 | sctp_cmd_t *next_cmd; |
| 207 | } sctp_cmd_seq_t; | 208 | } sctp_cmd_seq_t; |
| 208 | 209 | ||
| 209 | 210 | ||
| 210 | /* Initialize a block of memory as a command sequence. | 211 | /* Initialize a block of memory as a command sequence. |
| 211 | * Return 0 if the initialization fails. | 212 | * Return 0 if the initialization fails. |
| 212 | */ | 213 | */ |
| 213 | int sctp_init_cmd_seq(sctp_cmd_seq_t *seq); | 214 | static inline int sctp_init_cmd_seq(sctp_cmd_seq_t *seq) |
| 215 | { | ||
| 216 | /* cmds[] is filled backwards to simplify the overflow BUG() check */ | ||
| 217 | seq->last_used_slot = seq->cmds + SCTP_MAX_NUM_COMMANDS; | ||
| 218 | seq->next_cmd = seq->last_used_slot; | ||
| 219 | return 1; /* We always succeed. */ | ||
| 220 | } | ||
| 221 | |||
| 214 | 222 | ||
| 215 | /* Add a command to an sctp_cmd_seq_t. | 223 | /* Add a command to an sctp_cmd_seq_t. |
| 216 | * | 224 | * |
| 217 | * Use the SCTP_* constructors defined by SCTP_ARG_CONSTRUCTOR() above | 225 | * Use the SCTP_* constructors defined by SCTP_ARG_CONSTRUCTOR() above |
| 218 | * to wrap data which goes in the obj argument. | 226 | * to wrap data which goes in the obj argument. |
| 219 | */ | 227 | */ |
| 220 | void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj); | 228 | static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, |
| 229 | sctp_arg_t obj) | ||
| 230 | { | ||
| 231 | sctp_cmd_t *cmd = seq->last_used_slot - 1; | ||
| 232 | |||
| 233 | BUG_ON(cmd < seq->cmds); | ||
| 234 | |||
| 235 | cmd->verb = verb; | ||
| 236 | cmd->obj = obj; | ||
| 237 | seq->last_used_slot = cmd; | ||
| 238 | } | ||
| 221 | 239 | ||
| 222 | /* Return the next command structure in an sctp_cmd_seq. | 240 | /* Return the next command structure in an sctp_cmd_seq. |
| 223 | * Return NULL at the end of the sequence. | 241 | * Return NULL at the end of the sequence. |
| 224 | */ | 242 | */ |
| 225 | sctp_cmd_t *sctp_next_cmd(sctp_cmd_seq_t *seq); | 243 | static inline sctp_cmd_t *sctp_next_cmd(sctp_cmd_seq_t *seq) |
| 244 | { | ||
| 245 | if (seq->next_cmd <= seq->last_used_slot) | ||
| 246 | return NULL; | ||
| 226 | 247 | ||
| 227 | #endif /* __net_sctp_command_h__ */ | 248 | return --seq->next_cmd; |
| 249 | } | ||
| 228 | 250 | ||
| 251 | #endif /* __net_sctp_command_h__ */ | ||
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 307728f622ef..8c337cd0e1e4 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
| @@ -311,7 +311,7 @@ typedef enum { | |||
| 311 | SCTP_XMIT_OK, | 311 | SCTP_XMIT_OK, |
| 312 | SCTP_XMIT_PMTU_FULL, | 312 | SCTP_XMIT_PMTU_FULL, |
| 313 | SCTP_XMIT_RWND_FULL, | 313 | SCTP_XMIT_RWND_FULL, |
| 314 | SCTP_XMIT_NAGLE_DELAY, | 314 | SCTP_XMIT_DELAY, |
| 315 | } sctp_xmit_t; | 315 | } sctp_xmit_t; |
| 316 | 316 | ||
| 317 | /* These are the commands for manipulating transports. */ | 317 | /* These are the commands for manipulating transports. */ |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 8e4de46c052e..f6e7397e799d 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
| @@ -109,6 +109,7 @@ void sctp_copy_sock(struct sock *newsk, struct sock *sk, | |||
| 109 | struct sctp_association *asoc); | 109 | struct sctp_association *asoc); |
| 110 | extern struct percpu_counter sctp_sockets_allocated; | 110 | extern struct percpu_counter sctp_sockets_allocated; |
| 111 | int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *); | 111 | int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *); |
| 112 | struct sk_buff *sctp_skb_recv_datagram(struct sock *, int, int, int *); | ||
| 112 | 113 | ||
| 113 | /* | 114 | /* |
| 114 | * sctp/primitive.c | 115 | * sctp/primitive.c |
| @@ -388,27 +389,6 @@ static inline int sctp_list_single_entry(struct list_head *head) | |||
| 388 | return (head->next != head) && (head->next == head->prev); | 389 | return (head->next != head) && (head->next == head->prev); |
| 389 | } | 390 | } |
| 390 | 391 | ||
| 391 | /* Generate a random jitter in the range of -50% ~ +50% of input RTO. */ | ||
| 392 | static inline __s32 sctp_jitter(__u32 rto) | ||
| 393 | { | ||
| 394 | static __u32 sctp_rand; | ||
| 395 | __s32 ret; | ||
| 396 | |||
| 397 | /* Avoid divide by zero. */ | ||
| 398 | if (!rto) | ||
| 399 | rto = 1; | ||
| 400 | |||
| 401 | sctp_rand += jiffies; | ||
| 402 | sctp_rand ^= (sctp_rand << 12); | ||
| 403 | sctp_rand ^= (sctp_rand >> 20); | ||
| 404 | |||
| 405 | /* Choose random number from 0 to rto, then move to -50% ~ +50% | ||
| 406 | * of rto. | ||
| 407 | */ | ||
| 408 | ret = sctp_rand % rto - (rto >> 1); | ||
| 409 | return ret; | ||
| 410 | } | ||
| 411 | |||
| 412 | /* Break down data chunks at this point. */ | 392 | /* Break down data chunks at this point. */ |
| 413 | static inline int sctp_frag_point(const struct sctp_association *asoc, int pmtu) | 393 | static inline int sctp_frag_point(const struct sctp_association *asoc, int pmtu) |
| 414 | { | 394 | { |
| @@ -574,6 +554,8 @@ static inline void sctp_v6_map_v4(union sctp_addr *addr) | |||
| 574 | static inline void sctp_v4_map_v6(union sctp_addr *addr) | 554 | static inline void sctp_v4_map_v6(union sctp_addr *addr) |
| 575 | { | 555 | { |
| 576 | addr->v6.sin6_family = AF_INET6; | 556 | addr->v6.sin6_family = AF_INET6; |
| 557 | addr->v6.sin6_flowinfo = 0; | ||
| 558 | addr->v6.sin6_scope_id = 0; | ||
| 577 | addr->v6.sin6_port = addr->v4.sin_port; | 559 | addr->v6.sin6_port = addr->v4.sin_port; |
| 578 | addr->v6.sin6_addr.s6_addr32[3] = addr->v4.sin_addr.s_addr; | 560 | addr->v6.sin6_addr.s6_addr32[3] = addr->v4.sin_addr.s_addr; |
| 579 | addr->v6.sin6_addr.s6_addr32[0] = 0; | 561 | addr->v6.sin6_addr.s6_addr32[0] = 0; |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index f38588bf3462..4ff3f67be62c 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -207,7 +207,9 @@ struct sctp_sock { | |||
| 207 | struct sctp_paddrparams paddrparam; | 207 | struct sctp_paddrparams paddrparam; |
| 208 | struct sctp_event_subscribe subscribe; | 208 | struct sctp_event_subscribe subscribe; |
| 209 | struct sctp_assocparams assocparams; | 209 | struct sctp_assocparams assocparams; |
| 210 | |||
| 210 | int user_frag; | 211 | int user_frag; |
| 212 | |||
| 211 | __u32 autoclose; | 213 | __u32 autoclose; |
| 212 | __u8 nodelay; | 214 | __u8 nodelay; |
| 213 | __u8 disable_fragments; | 215 | __u8 disable_fragments; |
| @@ -215,6 +217,8 @@ struct sctp_sock { | |||
| 215 | __u8 frag_interleave; | 217 | __u8 frag_interleave; |
| 216 | __u32 adaptation_ind; | 218 | __u32 adaptation_ind; |
| 217 | __u32 pd_point; | 219 | __u32 pd_point; |
| 220 | __u8 recvrcvinfo; | ||
| 221 | __u8 recvnxtinfo; | ||
| 218 | 222 | ||
| 219 | atomic_t pd_mode; | 223 | atomic_t pd_mode; |
| 220 | /* Receive to here while partial delivery is in effect. */ | 224 | /* Receive to here while partial delivery is in effect. */ |
| @@ -461,10 +465,6 @@ struct sctp_af { | |||
| 461 | int saddr); | 465 | int saddr); |
| 462 | void (*from_sk) (union sctp_addr *, | 466 | void (*from_sk) (union sctp_addr *, |
| 463 | struct sock *sk); | 467 | struct sock *sk); |
| 464 | void (*to_sk_saddr) (union sctp_addr *, | ||
| 465 | struct sock *sk); | ||
| 466 | void (*to_sk_daddr) (union sctp_addr *, | ||
| 467 | struct sock *sk); | ||
| 468 | void (*from_addr_param) (union sctp_addr *, | 468 | void (*from_addr_param) (union sctp_addr *, |
| 469 | union sctp_addr_param *, | 469 | union sctp_addr_param *, |
| 470 | __be16 port, int iif); | 470 | __be16 port, int iif); |
| @@ -505,7 +505,9 @@ struct sctp_pf { | |||
| 505 | int (*supported_addrs)(const struct sctp_sock *, __be16 *); | 505 | int (*supported_addrs)(const struct sctp_sock *, __be16 *); |
| 506 | struct sock *(*create_accept_sk) (struct sock *sk, | 506 | struct sock *(*create_accept_sk) (struct sock *sk, |
| 507 | struct sctp_association *asoc); | 507 | struct sctp_association *asoc); |
| 508 | void (*addr_v4map) (struct sctp_sock *, union sctp_addr *); | 508 | int (*addr_to_user)(struct sctp_sock *sk, union sctp_addr *addr); |
| 509 | void (*to_sk_saddr)(union sctp_addr *, struct sock *sk); | ||
| 510 | void (*to_sk_daddr)(union sctp_addr *, struct sock *sk); | ||
| 509 | struct sctp_af *af; | 511 | struct sctp_af *af; |
| 510 | }; | 512 | }; |
| 511 | 513 | ||
| @@ -1919,7 +1921,8 @@ struct sctp_chunk *sctp_get_ecne_prepend(struct sctp_association *asoc); | |||
| 1919 | /* A convenience structure to parse out SCTP specific CMSGs. */ | 1921 | /* A convenience structure to parse out SCTP specific CMSGs. */ |
| 1920 | typedef struct sctp_cmsgs { | 1922 | typedef struct sctp_cmsgs { |
| 1921 | struct sctp_initmsg *init; | 1923 | struct sctp_initmsg *init; |
| 1922 | struct sctp_sndrcvinfo *info; | 1924 | struct sctp_sndrcvinfo *srinfo; |
| 1925 | struct sctp_sndinfo *sinfo; | ||
| 1923 | } sctp_cmsgs_t; | 1926 | } sctp_cmsgs_t; |
| 1924 | 1927 | ||
| 1925 | /* Structure for tracking memory objects */ | 1928 | /* Structure for tracking memory objects */ |
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h index daacb32b55b5..cccdcfd14973 100644 --- a/include/net/sctp/ulpevent.h +++ b/include/net/sctp/ulpevent.h | |||
| @@ -129,7 +129,12 @@ struct sctp_ulpevent *sctp_ulpevent_make_sender_dry_event( | |||
| 129 | const struct sctp_association *asoc, gfp_t gfp); | 129 | const struct sctp_association *asoc, gfp_t gfp); |
| 130 | 130 | ||
| 131 | void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, | 131 | void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, |
| 132 | struct msghdr *); | 132 | struct msghdr *); |
| 133 | void sctp_ulpevent_read_rcvinfo(const struct sctp_ulpevent *event, | ||
| 134 | struct msghdr *); | ||
| 135 | void sctp_ulpevent_read_nxtinfo(const struct sctp_ulpevent *event, | ||
| 136 | struct msghdr *, struct sock *sk); | ||
| 137 | |||
| 133 | __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event); | 138 | __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event); |
| 134 | 139 | ||
| 135 | /* Is this event type enabled? */ | 140 | /* Is this event type enabled? */ |
| @@ -155,10 +160,3 @@ static inline int sctp_ulpevent_is_enabled(const struct sctp_ulpevent *event, | |||
| 155 | } | 160 | } |
| 156 | 161 | ||
| 157 | #endif /* __sctp_ulpevent_h__ */ | 162 | #endif /* __sctp_ulpevent_h__ */ |
| 158 | |||
| 159 | |||
| 160 | |||
| 161 | |||
| 162 | |||
| 163 | |||
| 164 | |||
diff --git a/include/net/sock.h b/include/net/sock.h index 156350745700..52fe0bc5598a 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -67,6 +67,7 @@ | |||
| 67 | #include <linux/atomic.h> | 67 | #include <linux/atomic.h> |
| 68 | #include <net/dst.h> | 68 | #include <net/dst.h> |
| 69 | #include <net/checksum.h> | 69 | #include <net/checksum.h> |
| 70 | #include <linux/net_tstamp.h> | ||
| 70 | 71 | ||
| 71 | struct cgroup; | 72 | struct cgroup; |
| 72 | struct cgroup_subsys; | 73 | struct cgroup_subsys; |
| @@ -181,7 +182,8 @@ struct sock_common { | |||
| 181 | unsigned short skc_family; | 182 | unsigned short skc_family; |
| 182 | volatile unsigned char skc_state; | 183 | volatile unsigned char skc_state; |
| 183 | unsigned char skc_reuse:4; | 184 | unsigned char skc_reuse:4; |
| 184 | unsigned char skc_reuseport:4; | 185 | unsigned char skc_reuseport:1; |
| 186 | unsigned char skc_ipv6only:1; | ||
| 185 | int skc_bound_dev_if; | 187 | int skc_bound_dev_if; |
| 186 | union { | 188 | union { |
| 187 | struct hlist_node skc_bind_node; | 189 | struct hlist_node skc_bind_node; |
| @@ -272,10 +274,13 @@ struct cg_proto; | |||
| 272 | * @sk_rcvtimeo: %SO_RCVTIMEO setting | 274 | * @sk_rcvtimeo: %SO_RCVTIMEO setting |
| 273 | * @sk_sndtimeo: %SO_SNDTIMEO setting | 275 | * @sk_sndtimeo: %SO_SNDTIMEO setting |
| 274 | * @sk_rxhash: flow hash received from netif layer | 276 | * @sk_rxhash: flow hash received from netif layer |
| 277 | * @sk_txhash: computed flow hash for use on transmit | ||
| 275 | * @sk_filter: socket filtering instructions | 278 | * @sk_filter: socket filtering instructions |
| 276 | * @sk_protinfo: private area, net family specific, when not using slab | 279 | * @sk_protinfo: private area, net family specific, when not using slab |
| 277 | * @sk_timer: sock cleanup timer | 280 | * @sk_timer: sock cleanup timer |
| 278 | * @sk_stamp: time stamp of last packet received | 281 | * @sk_stamp: time stamp of last packet received |
| 282 | * @sk_tsflags: SO_TIMESTAMPING socket options | ||
| 283 | * @sk_tskey: counter to disambiguate concurrent tstamp requests | ||
| 279 | * @sk_socket: Identd and reporting IO signals | 284 | * @sk_socket: Identd and reporting IO signals |
| 280 | * @sk_user_data: RPC layer private data | 285 | * @sk_user_data: RPC layer private data |
| 281 | * @sk_frag: cached page frag | 286 | * @sk_frag: cached page frag |
| @@ -317,6 +322,7 @@ struct sock { | |||
| 317 | #define sk_state __sk_common.skc_state | 322 | #define sk_state __sk_common.skc_state |
| 318 | #define sk_reuse __sk_common.skc_reuse | 323 | #define sk_reuse __sk_common.skc_reuse |
| 319 | #define sk_reuseport __sk_common.skc_reuseport | 324 | #define sk_reuseport __sk_common.skc_reuseport |
| 325 | #define sk_ipv6only __sk_common.skc_ipv6only | ||
| 320 | #define sk_bound_dev_if __sk_common.skc_bound_dev_if | 326 | #define sk_bound_dev_if __sk_common.skc_bound_dev_if |
| 321 | #define sk_bind_node __sk_common.skc_bind_node | 327 | #define sk_bind_node __sk_common.skc_bind_node |
| 322 | #define sk_prot __sk_common.skc_prot | 328 | #define sk_prot __sk_common.skc_prot |
| @@ -345,6 +351,7 @@ struct sock { | |||
| 345 | #ifdef CONFIG_RPS | 351 | #ifdef CONFIG_RPS |
| 346 | __u32 sk_rxhash; | 352 | __u32 sk_rxhash; |
| 347 | #endif | 353 | #endif |
| 354 | __u32 sk_txhash; | ||
| 348 | #ifdef CONFIG_NET_RX_BUSY_POLL | 355 | #ifdef CONFIG_NET_RX_BUSY_POLL |
| 349 | unsigned int sk_napi_id; | 356 | unsigned int sk_napi_id; |
| 350 | unsigned int sk_ll_usec; | 357 | unsigned int sk_ll_usec; |
| @@ -407,6 +414,8 @@ struct sock { | |||
| 407 | void *sk_protinfo; | 414 | void *sk_protinfo; |
| 408 | struct timer_list sk_timer; | 415 | struct timer_list sk_timer; |
| 409 | ktime_t sk_stamp; | 416 | ktime_t sk_stamp; |
| 417 | u16 sk_tsflags; | ||
| 418 | u32 sk_tskey; | ||
| 410 | struct socket *sk_socket; | 419 | struct socket *sk_socket; |
| 411 | void *sk_user_data; | 420 | void *sk_user_data; |
| 412 | struct page_frag sk_frag; | 421 | struct page_frag sk_frag; |
| @@ -656,6 +665,20 @@ static inline void sk_add_bind_node(struct sock *sk, | |||
| 656 | #define sk_for_each_bound(__sk, list) \ | 665 | #define sk_for_each_bound(__sk, list) \ |
| 657 | hlist_for_each_entry(__sk, list, sk_bind_node) | 666 | hlist_for_each_entry(__sk, list, sk_bind_node) |
| 658 | 667 | ||
| 668 | /** | ||
| 669 | * sk_nulls_for_each_entry_offset - iterate over a list at a given struct offset | ||
| 670 | * @tpos: the type * to use as a loop cursor. | ||
| 671 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 672 | * @head: the head for your list. | ||
| 673 | * @offset: offset of hlist_node within the struct. | ||
| 674 | * | ||
| 675 | */ | ||
| 676 | #define sk_nulls_for_each_entry_offset(tpos, pos, head, offset) \ | ||
| 677 | for (pos = (head)->first; \ | ||
| 678 | (!is_a_nulls(pos)) && \ | ||
| 679 | ({ tpos = (typeof(*tpos) *)((void *)pos - offset); 1;}); \ | ||
| 680 | pos = pos->next) | ||
| 681 | |||
| 659 | static inline struct user_namespace *sk_user_ns(struct sock *sk) | 682 | static inline struct user_namespace *sk_user_ns(struct sock *sk) |
| 660 | { | 683 | { |
| 661 | /* Careful only use this in a context where these parameters | 684 | /* Careful only use this in a context where these parameters |
| @@ -683,13 +706,7 @@ enum sock_flags { | |||
| 683 | SOCK_LOCALROUTE, /* route locally only, %SO_DONTROUTE setting */ | 706 | SOCK_LOCALROUTE, /* route locally only, %SO_DONTROUTE setting */ |
| 684 | SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */ | 707 | SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */ |
| 685 | SOCK_MEMALLOC, /* VM depends on this socket for swapping */ | 708 | SOCK_MEMALLOC, /* VM depends on this socket for swapping */ |
| 686 | SOCK_TIMESTAMPING_TX_HARDWARE, /* %SOF_TIMESTAMPING_TX_HARDWARE */ | ||
| 687 | SOCK_TIMESTAMPING_TX_SOFTWARE, /* %SOF_TIMESTAMPING_TX_SOFTWARE */ | ||
| 688 | SOCK_TIMESTAMPING_RX_HARDWARE, /* %SOF_TIMESTAMPING_RX_HARDWARE */ | ||
| 689 | SOCK_TIMESTAMPING_RX_SOFTWARE, /* %SOF_TIMESTAMPING_RX_SOFTWARE */ | 709 | SOCK_TIMESTAMPING_RX_SOFTWARE, /* %SOF_TIMESTAMPING_RX_SOFTWARE */ |
| 690 | SOCK_TIMESTAMPING_SOFTWARE, /* %SOF_TIMESTAMPING_SOFTWARE */ | ||
| 691 | SOCK_TIMESTAMPING_RAW_HARDWARE, /* %SOF_TIMESTAMPING_RAW_HARDWARE */ | ||
| 692 | SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */ | ||
| 693 | SOCK_FASYNC, /* fasync() active */ | 710 | SOCK_FASYNC, /* fasync() active */ |
| 694 | SOCK_RXQ_OVFL, | 711 | SOCK_RXQ_OVFL, |
| 695 | SOCK_ZEROCOPY, /* buffers from userspace */ | 712 | SOCK_ZEROCOPY, /* buffers from userspace */ |
| @@ -792,8 +809,7 @@ static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) | |||
| 792 | * Do not take into account this skb truesize, | 809 | * Do not take into account this skb truesize, |
| 793 | * to allow even a single big packet to come. | 810 | * to allow even a single big packet to come. |
| 794 | */ | 811 | */ |
| 795 | static inline bool sk_rcvqueues_full(const struct sock *sk, const struct sk_buff *skb, | 812 | static inline bool sk_rcvqueues_full(const struct sock *sk, unsigned int limit) |
| 796 | unsigned int limit) | ||
| 797 | { | 813 | { |
| 798 | unsigned int qsize = sk->sk_backlog.len + atomic_read(&sk->sk_rmem_alloc); | 814 | unsigned int qsize = sk->sk_backlog.len + atomic_read(&sk->sk_rmem_alloc); |
| 799 | 815 | ||
| @@ -804,7 +820,7 @@ static inline bool sk_rcvqueues_full(const struct sock *sk, const struct sk_buff | |||
| 804 | static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *skb, | 820 | static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *skb, |
| 805 | unsigned int limit) | 821 | unsigned int limit) |
| 806 | { | 822 | { |
| 807 | if (sk_rcvqueues_full(sk, skb, limit)) | 823 | if (sk_rcvqueues_full(sk, limit)) |
| 808 | return -ENOBUFS; | 824 | return -ENOBUFS; |
| 809 | 825 | ||
| 810 | __sk_add_backlog(sk, skb); | 826 | __sk_add_backlog(sk, skb); |
| @@ -1978,6 +1994,14 @@ static inline void sock_poll_wait(struct file *filp, | |||
| 1978 | } | 1994 | } |
| 1979 | } | 1995 | } |
| 1980 | 1996 | ||
| 1997 | static inline void skb_set_hash_from_sk(struct sk_buff *skb, struct sock *sk) | ||
| 1998 | { | ||
| 1999 | if (sk->sk_txhash) { | ||
| 2000 | skb->l4_hash = 1; | ||
| 2001 | skb->hash = sk->sk_txhash; | ||
| 2002 | } | ||
| 2003 | } | ||
| 2004 | |||
| 1981 | /* | 2005 | /* |
| 1982 | * Queue a received datagram if it will fit. Stream and sequenced | 2006 | * Queue a received datagram if it will fit. Stream and sequenced |
| 1983 | * protocols can't normally use this as they need to fit buffers in | 2007 | * protocols can't normally use this as they need to fit buffers in |
| @@ -1992,6 +2016,7 @@ static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) | |||
| 1992 | skb_orphan(skb); | 2016 | skb_orphan(skb); |
| 1993 | skb->sk = sk; | 2017 | skb->sk = sk; |
| 1994 | skb->destructor = sock_wfree; | 2018 | skb->destructor = sock_wfree; |
| 2019 | skb_set_hash_from_sk(skb, sk); | ||
| 1995 | /* | 2020 | /* |
| 1996 | * We used to take a refcount on sk, but following operation | 2021 | * We used to take a refcount on sk, but following operation |
| 1997 | * is enough to guarantee sk_free() wont free this sock until | 2022 | * is enough to guarantee sk_free() wont free this sock until |
| @@ -2135,21 +2160,17 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | |||
| 2135 | 2160 | ||
| 2136 | /* | 2161 | /* |
| 2137 | * generate control messages if | 2162 | * generate control messages if |
| 2138 | * - receive time stamping in software requested (SOCK_RCVTSTAMP | 2163 | * - receive time stamping in software requested |
| 2139 | * or SOCK_TIMESTAMPING_RX_SOFTWARE) | ||
| 2140 | * - software time stamp available and wanted | 2164 | * - software time stamp available and wanted |
| 2141 | * (SOCK_TIMESTAMPING_SOFTWARE) | ||
| 2142 | * - hardware time stamps available and wanted | 2165 | * - hardware time stamps available and wanted |
| 2143 | * (SOCK_TIMESTAMPING_SYS_HARDWARE or | ||
| 2144 | * SOCK_TIMESTAMPING_RAW_HARDWARE) | ||
| 2145 | */ | 2166 | */ |
| 2146 | if (sock_flag(sk, SOCK_RCVTSTAMP) || | 2167 | if (sock_flag(sk, SOCK_RCVTSTAMP) || |
| 2147 | sock_flag(sk, SOCK_TIMESTAMPING_RX_SOFTWARE) || | 2168 | (sk->sk_tsflags & SOF_TIMESTAMPING_RX_SOFTWARE) || |
| 2148 | (kt.tv64 && sock_flag(sk, SOCK_TIMESTAMPING_SOFTWARE)) || | 2169 | (kt.tv64 && |
| 2170 | (sk->sk_tsflags & SOF_TIMESTAMPING_SOFTWARE || | ||
| 2171 | skb_shinfo(skb)->tx_flags & SKBTX_ANY_SW_TSTAMP)) || | ||
| 2149 | (hwtstamps->hwtstamp.tv64 && | 2172 | (hwtstamps->hwtstamp.tv64 && |
| 2150 | sock_flag(sk, SOCK_TIMESTAMPING_RAW_HARDWARE)) || | 2173 | (sk->sk_tsflags & SOF_TIMESTAMPING_RAW_HARDWARE))) |
| 2151 | (hwtstamps->syststamp.tv64 && | ||
| 2152 | sock_flag(sk, SOCK_TIMESTAMPING_SYS_HARDWARE))) | ||
| 2153 | __sock_recv_timestamp(msg, sk, skb); | 2174 | __sock_recv_timestamp(msg, sk, skb); |
| 2154 | else | 2175 | else |
| 2155 | sk->sk_stamp = kt; | 2176 | sk->sk_stamp = kt; |
| @@ -2165,12 +2186,11 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, | |||
| 2165 | struct sk_buff *skb) | 2186 | struct sk_buff *skb) |
| 2166 | { | 2187 | { |
| 2167 | #define FLAGS_TS_OR_DROPS ((1UL << SOCK_RXQ_OVFL) | \ | 2188 | #define FLAGS_TS_OR_DROPS ((1UL << SOCK_RXQ_OVFL) | \ |
| 2168 | (1UL << SOCK_RCVTSTAMP) | \ | 2189 | (1UL << SOCK_RCVTSTAMP)) |
| 2169 | (1UL << SOCK_TIMESTAMPING_SOFTWARE) | \ | 2190 | #define TSFLAGS_ANY (SOF_TIMESTAMPING_SOFTWARE | \ |
| 2170 | (1UL << SOCK_TIMESTAMPING_RAW_HARDWARE) | \ | 2191 | SOF_TIMESTAMPING_RAW_HARDWARE) |
| 2171 | (1UL << SOCK_TIMESTAMPING_SYS_HARDWARE)) | ||
| 2172 | 2192 | ||
| 2173 | if (sk->sk_flags & FLAGS_TS_OR_DROPS) | 2193 | if (sk->sk_flags & FLAGS_TS_OR_DROPS || sk->sk_tsflags & TSFLAGS_ANY) |
| 2174 | __sock_recv_ts_and_drops(msg, sk, skb); | 2194 | __sock_recv_ts_and_drops(msg, sk, skb); |
| 2175 | else | 2195 | else |
| 2176 | sk->sk_stamp = skb->tstamp; | 2196 | sk->sk_stamp = skb->tstamp; |
| @@ -2180,8 +2200,6 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, | |||
| 2180 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped | 2200 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped |
| 2181 | * @sk: socket sending this packet | 2201 | * @sk: socket sending this packet |
| 2182 | * @tx_flags: filled with instructions for time stamping | 2202 | * @tx_flags: filled with instructions for time stamping |
| 2183 | * | ||
| 2184 | * Currently only depends on SOCK_TIMESTAMPING* flags. | ||
| 2185 | */ | 2203 | */ |
| 2186 | void sock_tx_timestamp(struct sock *sk, __u8 *tx_flags); | 2204 | void sock_tx_timestamp(struct sock *sk, __u8 *tx_flags); |
| 2187 | 2205 | ||
diff --git a/include/net/tcp.h b/include/net/tcp.h index 7286db80e8b8..dafa1cbc149b 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -411,7 +411,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, | |||
| 411 | bool fastopen); | 411 | bool fastopen); |
| 412 | int tcp_child_process(struct sock *parent, struct sock *child, | 412 | int tcp_child_process(struct sock *parent, struct sock *child, |
| 413 | struct sk_buff *skb); | 413 | struct sk_buff *skb); |
| 414 | void tcp_enter_loss(struct sock *sk, int how); | 414 | void tcp_enter_loss(struct sock *sk); |
| 415 | void tcp_clear_retrans(struct tcp_sock *tp); | 415 | void tcp_clear_retrans(struct tcp_sock *tp); |
| 416 | void tcp_update_metrics(struct sock *sk); | 416 | void tcp_update_metrics(struct sock *sk); |
| 417 | void tcp_init_metrics(struct sock *sk); | 417 | void tcp_init_metrics(struct sock *sk); |
| @@ -493,14 +493,8 @@ static inline u32 tcp_cookie_time(void) | |||
| 493 | 493 | ||
| 494 | u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th, | 494 | u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th, |
| 495 | u16 *mssp); | 495 | u16 *mssp); |
| 496 | __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, __u16 *mss); | 496 | __u32 cookie_v4_init_sequence(struct sock *sk, const struct sk_buff *skb, |
| 497 | #else | 497 | __u16 *mss); |
| 498 | static inline __u32 cookie_v4_init_sequence(struct sock *sk, | ||
| 499 | struct sk_buff *skb, | ||
| 500 | __u16 *mss) | ||
| 501 | { | ||
| 502 | return 0; | ||
| 503 | } | ||
| 504 | #endif | 498 | #endif |
| 505 | 499 | ||
| 506 | __u32 cookie_init_timestamp(struct request_sock *req); | 500 | __u32 cookie_init_timestamp(struct request_sock *req); |
| @@ -516,13 +510,6 @@ u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph, | |||
| 516 | const struct tcphdr *th, u16 *mssp); | 510 | const struct tcphdr *th, u16 *mssp); |
| 517 | __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb, | 511 | __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb, |
| 518 | __u16 *mss); | 512 | __u16 *mss); |
| 519 | #else | ||
| 520 | static inline __u32 cookie_v6_init_sequence(struct sock *sk, | ||
| 521 | struct sk_buff *skb, | ||
| 522 | __u16 *mss) | ||
| 523 | { | ||
| 524 | return 0; | ||
| 525 | } | ||
| 526 | #endif | 513 | #endif |
| 527 | /* tcp_output.c */ | 514 | /* tcp_output.c */ |
| 528 | 515 | ||
| @@ -941,7 +928,7 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk) | |||
| 941 | /* Use define here intentionally to get WARN_ON location shown at the caller */ | 928 | /* Use define here intentionally to get WARN_ON location shown at the caller */ |
| 942 | #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) | 929 | #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) |
| 943 | 930 | ||
| 944 | void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); | 931 | void tcp_enter_cwr(struct sock *sk); |
| 945 | __u32 tcp_init_cwnd(const struct tcp_sock *tp, const struct dst_entry *dst); | 932 | __u32 tcp_init_cwnd(const struct tcp_sock *tp, const struct dst_entry *dst); |
| 946 | 933 | ||
| 947 | /* The maximum number of MSS of available cwnd for which TSO defers | 934 | /* The maximum number of MSS of available cwnd for which TSO defers |
| @@ -1098,7 +1085,7 @@ static inline int tcp_full_space(const struct sock *sk) | |||
| 1098 | 1085 | ||
| 1099 | static inline void tcp_openreq_init(struct request_sock *req, | 1086 | static inline void tcp_openreq_init(struct request_sock *req, |
| 1100 | struct tcp_options_received *rx_opt, | 1087 | struct tcp_options_received *rx_opt, |
| 1101 | struct sk_buff *skb) | 1088 | struct sk_buff *skb, struct sock *sk) |
| 1102 | { | 1089 | { |
| 1103 | struct inet_request_sock *ireq = inet_rsk(req); | 1090 | struct inet_request_sock *ireq = inet_rsk(req); |
| 1104 | 1091 | ||
| @@ -1106,7 +1093,7 @@ static inline void tcp_openreq_init(struct request_sock *req, | |||
| 1106 | req->cookie_ts = 0; | 1093 | req->cookie_ts = 0; |
| 1107 | tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq; | 1094 | tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq; |
| 1108 | tcp_rsk(req)->rcv_nxt = TCP_SKB_CB(skb)->seq + 1; | 1095 | tcp_rsk(req)->rcv_nxt = TCP_SKB_CB(skb)->seq + 1; |
| 1109 | tcp_rsk(req)->snt_synack = 0; | 1096 | tcp_rsk(req)->snt_synack = tcp_time_stamp; |
| 1110 | req->mss = rx_opt->mss_clamp; | 1097 | req->mss = rx_opt->mss_clamp; |
| 1111 | req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; | 1098 | req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; |
| 1112 | ireq->tstamp_ok = rx_opt->tstamp_ok; | 1099 | ireq->tstamp_ok = rx_opt->tstamp_ok; |
| @@ -1117,6 +1104,7 @@ static inline void tcp_openreq_init(struct request_sock *req, | |||
| 1117 | ireq->ecn_ok = 0; | 1104 | ireq->ecn_ok = 0; |
| 1118 | ireq->ir_rmt_port = tcp_hdr(skb)->source; | 1105 | ireq->ir_rmt_port = tcp_hdr(skb)->source; |
| 1119 | ireq->ir_num = ntohs(tcp_hdr(skb)->dest); | 1106 | ireq->ir_num = ntohs(tcp_hdr(skb)->dest); |
| 1107 | ireq->ir_mark = inet_request_mark(sk, skb); | ||
| 1120 | } | 1108 | } |
| 1121 | 1109 | ||
| 1122 | extern void tcp_openreq_init_rwin(struct request_sock *req, | 1110 | extern void tcp_openreq_init_rwin(struct request_sock *req, |
| @@ -1585,6 +1573,11 @@ int tcp4_proc_init(void); | |||
| 1585 | void tcp4_proc_exit(void); | 1573 | void tcp4_proc_exit(void); |
| 1586 | #endif | 1574 | #endif |
| 1587 | 1575 | ||
| 1576 | int tcp_rtx_synack(struct sock *sk, struct request_sock *req); | ||
| 1577 | int tcp_conn_request(struct request_sock_ops *rsk_ops, | ||
| 1578 | const struct tcp_request_sock_ops *af_ops, | ||
| 1579 | struct sock *sk, struct sk_buff *skb); | ||
| 1580 | |||
| 1588 | /* TCP af-specific functions */ | 1581 | /* TCP af-specific functions */ |
| 1589 | struct tcp_sock_af_ops { | 1582 | struct tcp_sock_af_ops { |
| 1590 | #ifdef CONFIG_TCP_MD5SIG | 1583 | #ifdef CONFIG_TCP_MD5SIG |
| @@ -1602,6 +1595,7 @@ struct tcp_sock_af_ops { | |||
| 1602 | }; | 1595 | }; |
| 1603 | 1596 | ||
| 1604 | struct tcp_request_sock_ops { | 1597 | struct tcp_request_sock_ops { |
| 1598 | u16 mss_clamp; | ||
| 1605 | #ifdef CONFIG_TCP_MD5SIG | 1599 | #ifdef CONFIG_TCP_MD5SIG |
| 1606 | struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk, | 1600 | struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk, |
| 1607 | struct request_sock *req); | 1601 | struct request_sock *req); |
| @@ -1611,8 +1605,39 @@ struct tcp_request_sock_ops { | |||
| 1611 | const struct request_sock *req, | 1605 | const struct request_sock *req, |
| 1612 | const struct sk_buff *skb); | 1606 | const struct sk_buff *skb); |
| 1613 | #endif | 1607 | #endif |
| 1608 | void (*init_req)(struct request_sock *req, struct sock *sk, | ||
| 1609 | struct sk_buff *skb); | ||
| 1610 | #ifdef CONFIG_SYN_COOKIES | ||
| 1611 | __u32 (*cookie_init_seq)(struct sock *sk, const struct sk_buff *skb, | ||
| 1612 | __u16 *mss); | ||
| 1613 | #endif | ||
| 1614 | struct dst_entry *(*route_req)(struct sock *sk, struct flowi *fl, | ||
| 1615 | const struct request_sock *req, | ||
| 1616 | bool *strict); | ||
| 1617 | __u32 (*init_seq)(const struct sk_buff *skb); | ||
| 1618 | int (*send_synack)(struct sock *sk, struct dst_entry *dst, | ||
| 1619 | struct flowi *fl, struct request_sock *req, | ||
| 1620 | u16 queue_mapping, struct tcp_fastopen_cookie *foc); | ||
| 1621 | void (*queue_hash_add)(struct sock *sk, struct request_sock *req, | ||
| 1622 | const unsigned long timeout); | ||
| 1614 | }; | 1623 | }; |
| 1615 | 1624 | ||
| 1625 | #ifdef CONFIG_SYN_COOKIES | ||
| 1626 | static inline __u32 cookie_init_sequence(const struct tcp_request_sock_ops *ops, | ||
| 1627 | struct sock *sk, struct sk_buff *skb, | ||
| 1628 | __u16 *mss) | ||
| 1629 | { | ||
| 1630 | return ops->cookie_init_seq(sk, skb, mss); | ||
| 1631 | } | ||
| 1632 | #else | ||
| 1633 | static inline __u32 cookie_init_sequence(const struct tcp_request_sock_ops *ops, | ||
| 1634 | struct sock *sk, struct sk_buff *skb, | ||
| 1635 | __u16 *mss) | ||
| 1636 | { | ||
| 1637 | return 0; | ||
| 1638 | } | ||
| 1639 | #endif | ||
| 1640 | |||
| 1616 | int tcpv4_offload_init(void); | 1641 | int tcpv4_offload_init(void); |
| 1617 | 1642 | ||
| 1618 | void tcp_v4_init(void); | 1643 | void tcp_v4_init(void); |
diff --git a/include/net/udp.h b/include/net/udp.h index 68a1fefe3dfe..70f941368ace 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
| @@ -176,6 +176,35 @@ int udp_lib_get_port(struct sock *sk, unsigned short snum, | |||
| 176 | int (*)(const struct sock *, const struct sock *), | 176 | int (*)(const struct sock *, const struct sock *), |
| 177 | unsigned int hash2_nulladdr); | 177 | unsigned int hash2_nulladdr); |
| 178 | 178 | ||
| 179 | static inline __be16 udp_flow_src_port(struct net *net, struct sk_buff *skb, | ||
| 180 | int min, int max, bool use_eth) | ||
| 181 | { | ||
| 182 | u32 hash; | ||
| 183 | |||
| 184 | if (min >= max) { | ||
| 185 | /* Use default range */ | ||
| 186 | inet_get_local_port_range(net, &min, &max); | ||
| 187 | } | ||
| 188 | |||
| 189 | hash = skb_get_hash(skb); | ||
| 190 | if (unlikely(!hash) && use_eth) { | ||
| 191 | /* Can't find a normal hash, caller has indicated an Ethernet | ||
| 192 | * packet so use that to compute a hash. | ||
| 193 | */ | ||
| 194 | hash = jhash(skb->data, 2 * ETH_ALEN, | ||
| 195 | (__force u32) skb->protocol); | ||
| 196 | } | ||
| 197 | |||
| 198 | /* Since this is being sent on the wire obfuscate hash a bit | ||
| 199 | * to minimize possbility that any useful information to an | ||
| 200 | * attacker is leaked. Only upper 16 bits are relevant in the | ||
| 201 | * computation for 16 bit port value. | ||
| 202 | */ | ||
| 203 | hash ^= hash << 16; | ||
| 204 | |||
| 205 | return htons((((u64) hash * (max - min)) >> 32) + min); | ||
| 206 | } | ||
| 207 | |||
| 179 | /* net/ipv4/udp.c */ | 208 | /* net/ipv4/udp.c */ |
| 180 | void udp_v4_early_demux(struct sk_buff *skb); | 209 | void udp_v4_early_demux(struct sk_buff *skb); |
| 181 | int udp_get_port(struct sock *sk, unsigned short snum, | 210 | int udp_get_port(struct sock *sk, unsigned short snum, |
diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h new file mode 100644 index 000000000000..ffd69cbded35 --- /dev/null +++ b/include/net/udp_tunnel.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | #ifndef __NET_UDP_TUNNEL_H | ||
| 2 | #define __NET_UDP_TUNNEL_H | ||
| 3 | |||
| 4 | struct udp_port_cfg { | ||
| 5 | u8 family; | ||
| 6 | |||
| 7 | /* Used only for kernel-created sockets */ | ||
| 8 | union { | ||
| 9 | struct in_addr local_ip; | ||
| 10 | #if IS_ENABLED(CONFIG_IPV6) | ||
| 11 | struct in6_addr local_ip6; | ||
| 12 | #endif | ||
| 13 | }; | ||
| 14 | |||
| 15 | union { | ||
| 16 | struct in_addr peer_ip; | ||
| 17 | #if IS_ENABLED(CONFIG_IPV6) | ||
| 18 | struct in6_addr peer_ip6; | ||
| 19 | #endif | ||
| 20 | }; | ||
| 21 | |||
| 22 | __be16 local_udp_port; | ||
| 23 | __be16 peer_udp_port; | ||
| 24 | unsigned int use_udp_checksums:1, | ||
| 25 | use_udp6_tx_checksums:1, | ||
| 26 | use_udp6_rx_checksums:1; | ||
| 27 | }; | ||
| 28 | |||
| 29 | int udp_sock_create(struct net *net, struct udp_port_cfg *cfg, | ||
| 30 | struct socket **sockp); | ||
| 31 | |||
| 32 | #endif | ||
diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 12196ce661d9..d5f59f3fc35d 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h | |||
| @@ -45,8 +45,6 @@ int vxlan_xmit_skb(struct vxlan_sock *vs, | |||
| 45 | __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, | 45 | __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df, |
| 46 | __be16 src_port, __be16 dst_port, __be32 vni, bool xnet); | 46 | __be16 src_port, __be16 dst_port, __be32 vni, bool xnet); |
| 47 | 47 | ||
| 48 | __be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb); | ||
| 49 | |||
| 50 | /* IP header + UDP + VXLAN + Ethernet header */ | 48 | /* IP header + UDP + VXLAN + Ethernet header */ |
| 51 | #define VXLAN_HEADROOM (20 + 8 + 8 + 14) | 49 | #define VXLAN_HEADROOM (20 + 8 + 8 + 14) |
| 52 | /* IPv6 header + UDP + VXLAN + Ethernet header */ | 50 | /* IPv6 header + UDP + VXLAN + Ethernet header */ |
diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h index 21cdb0b7b0fb..47da53c27ffa 100644 --- a/include/ras/ras_event.h +++ b/include/ras/ras_event.h | |||
| @@ -8,6 +8,71 @@ | |||
| 8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
| 9 | #include <linux/edac.h> | 9 | #include <linux/edac.h> |
| 10 | #include <linux/ktime.h> | 10 | #include <linux/ktime.h> |
| 11 | #include <linux/aer.h> | ||
| 12 | #include <linux/cper.h> | ||
| 13 | |||
| 14 | /* | ||
| 15 | * MCE Extended Error Log trace event | ||
| 16 | * | ||
| 17 | * These events are generated when hardware detects a corrected or | ||
| 18 | * uncorrected event. | ||
| 19 | */ | ||
| 20 | |||
| 21 | /* memory trace event */ | ||
| 22 | |||
| 23 | #if defined(CONFIG_ACPI_EXTLOG) || defined(CONFIG_ACPI_EXTLOG_MODULE) | ||
| 24 | TRACE_EVENT(extlog_mem_event, | ||
| 25 | TP_PROTO(struct cper_sec_mem_err *mem, | ||
| 26 | u32 err_seq, | ||
| 27 | const uuid_le *fru_id, | ||
| 28 | const char *fru_text, | ||
| 29 | u8 sev), | ||
| 30 | |||
| 31 | TP_ARGS(mem, err_seq, fru_id, fru_text, sev), | ||
| 32 | |||
| 33 | TP_STRUCT__entry( | ||
| 34 | __field(u32, err_seq) | ||
| 35 | __field(u8, etype) | ||
| 36 | __field(u8, sev) | ||
| 37 | __field(u64, pa) | ||
| 38 | __field(u8, pa_mask_lsb) | ||
| 39 | __field_struct(uuid_le, fru_id) | ||
| 40 | __string(fru_text, fru_text) | ||
| 41 | __field_struct(struct cper_mem_err_compact, data) | ||
| 42 | ), | ||
| 43 | |||
| 44 | TP_fast_assign( | ||
| 45 | __entry->err_seq = err_seq; | ||
| 46 | if (mem->validation_bits & CPER_MEM_VALID_ERROR_TYPE) | ||
| 47 | __entry->etype = mem->error_type; | ||
| 48 | else | ||
| 49 | __entry->etype = ~0; | ||
| 50 | __entry->sev = sev; | ||
| 51 | if (mem->validation_bits & CPER_MEM_VALID_PA) | ||
| 52 | __entry->pa = mem->physical_addr; | ||
| 53 | else | ||
| 54 | __entry->pa = ~0ull; | ||
| 55 | |||
| 56 | if (mem->validation_bits & CPER_MEM_VALID_PA_MASK) | ||
| 57 | __entry->pa_mask_lsb = (u8)__ffs64(mem->physical_addr_mask); | ||
| 58 | else | ||
| 59 | __entry->pa_mask_lsb = ~0; | ||
| 60 | __entry->fru_id = *fru_id; | ||
| 61 | __assign_str(fru_text, fru_text); | ||
| 62 | cper_mem_err_pack(mem, &__entry->data); | ||
| 63 | ), | ||
| 64 | |||
| 65 | TP_printk("{%d} %s error: %s physical addr: %016llx (mask lsb: %x) %sFRU: %pUl %.20s", | ||
| 66 | __entry->err_seq, | ||
| 67 | cper_severity_str(__entry->sev), | ||
| 68 | cper_mem_err_type_str(__entry->etype), | ||
| 69 | __entry->pa, | ||
| 70 | __entry->pa_mask_lsb, | ||
| 71 | cper_mem_err_unpack(p, &__entry->data), | ||
| 72 | &__entry->fru_id, | ||
| 73 | __get_str(fru_text)) | ||
| 74 | ); | ||
| 75 | #endif | ||
| 11 | 76 | ||
| 12 | /* | 77 | /* |
| 13 | * Hardware Events Report | 78 | * Hardware Events Report |
| @@ -94,6 +159,69 @@ TRACE_EVENT(mc_event, | |||
| 94 | __get_str(driver_detail)) | 159 | __get_str(driver_detail)) |
| 95 | ); | 160 | ); |
| 96 | 161 | ||
| 162 | /* | ||
| 163 | * PCIe AER Trace event | ||
| 164 | * | ||
| 165 | * These events are generated when hardware detects a corrected or | ||
| 166 | * uncorrected event on a PCIe device. The event report has | ||
| 167 | * the following structure: | ||
| 168 | * | ||
| 169 | * char * dev_name - The name of the slot where the device resides | ||
| 170 | * ([domain:]bus:device.function). | ||
| 171 | * u32 status - Either the correctable or uncorrectable register | ||
| 172 | * indicating what error or errors have been seen | ||
| 173 | * u8 severity - error severity 0:NONFATAL 1:FATAL 2:CORRECTED | ||
| 174 | */ | ||
| 175 | |||
| 176 | #define aer_correctable_errors \ | ||
| 177 | {BIT(0), "Receiver Error"}, \ | ||
| 178 | {BIT(6), "Bad TLP"}, \ | ||
| 179 | {BIT(7), "Bad DLLP"}, \ | ||
| 180 | {BIT(8), "RELAY_NUM Rollover"}, \ | ||
| 181 | {BIT(12), "Replay Timer Timeout"}, \ | ||
| 182 | {BIT(13), "Advisory Non-Fatal"} | ||
| 183 | |||
| 184 | #define aer_uncorrectable_errors \ | ||
| 185 | {BIT(4), "Data Link Protocol"}, \ | ||
| 186 | {BIT(12), "Poisoned TLP"}, \ | ||
| 187 | {BIT(13), "Flow Control Protocol"}, \ | ||
| 188 | {BIT(14), "Completion Timeout"}, \ | ||
| 189 | {BIT(15), "Completer Abort"}, \ | ||
| 190 | {BIT(16), "Unexpected Completion"}, \ | ||
| 191 | {BIT(17), "Receiver Overflow"}, \ | ||
| 192 | {BIT(18), "Malformed TLP"}, \ | ||
| 193 | {BIT(19), "ECRC"}, \ | ||
| 194 | {BIT(20), "Unsupported Request"} | ||
| 195 | |||
| 196 | TRACE_EVENT(aer_event, | ||
| 197 | TP_PROTO(const char *dev_name, | ||
| 198 | const u32 status, | ||
| 199 | const u8 severity), | ||
| 200 | |||
| 201 | TP_ARGS(dev_name, status, severity), | ||
| 202 | |||
| 203 | TP_STRUCT__entry( | ||
| 204 | __string( dev_name, dev_name ) | ||
| 205 | __field( u32, status ) | ||
| 206 | __field( u8, severity ) | ||
| 207 | ), | ||
| 208 | |||
| 209 | TP_fast_assign( | ||
| 210 | __assign_str(dev_name, dev_name); | ||
| 211 | __entry->status = status; | ||
| 212 | __entry->severity = severity; | ||
| 213 | ), | ||
| 214 | |||
| 215 | TP_printk("%s PCIe Bus Error: severity=%s, %s\n", | ||
| 216 | __get_str(dev_name), | ||
| 217 | __entry->severity == AER_CORRECTABLE ? "Corrected" : | ||
| 218 | __entry->severity == AER_FATAL ? | ||
| 219 | "Fatal" : "Uncorrected, non-fatal", | ||
| 220 | __entry->severity == AER_CORRECTABLE ? | ||
| 221 | __print_flags(__entry->status, "|", aer_correctable_errors) : | ||
| 222 | __print_flags(__entry->status, "|", aer_uncorrectable_errors)) | ||
| 223 | ); | ||
| 224 | |||
| 97 | #endif /* _TRACE_HW_EVENT_MC_H */ | 225 | #endif /* _TRACE_HW_EVENT_MC_H */ |
| 98 | 226 | ||
| 99 | /* This part must be outside protection */ | 227 | /* This part must be outside protection */ |
diff --git a/include/scsi/libsrp.h b/include/scsi/libsrp.h deleted file mode 100644 index f4105c91af53..000000000000 --- a/include/scsi/libsrp.h +++ /dev/null | |||
| @@ -1,78 +0,0 @@ | |||
| 1 | #ifndef __LIBSRP_H__ | ||
| 2 | #define __LIBSRP_H__ | ||
| 3 | |||
| 4 | #include <linux/list.h> | ||
| 5 | #include <linux/kfifo.h> | ||
| 6 | #include <scsi/scsi_cmnd.h> | ||
| 7 | #include <scsi/scsi_host.h> | ||
| 8 | #include <scsi/srp.h> | ||
| 9 | |||
| 10 | enum iue_flags { | ||
| 11 | V_DIOVER, | ||
| 12 | V_WRITE, | ||
| 13 | V_LINKED, | ||
| 14 | V_FLYING, | ||
| 15 | }; | ||
| 16 | |||
| 17 | struct srp_buf { | ||
| 18 | dma_addr_t dma; | ||
| 19 | void *buf; | ||
| 20 | }; | ||
| 21 | |||
| 22 | struct srp_queue { | ||
| 23 | void *pool; | ||
| 24 | void *items; | ||
| 25 | struct kfifo queue; | ||
| 26 | spinlock_t lock; | ||
| 27 | }; | ||
| 28 | |||
| 29 | struct srp_target { | ||
| 30 | struct Scsi_Host *shost; | ||
| 31 | struct device *dev; | ||
| 32 | |||
| 33 | spinlock_t lock; | ||
| 34 | struct list_head cmd_queue; | ||
| 35 | |||
| 36 | size_t srp_iu_size; | ||
| 37 | struct srp_queue iu_queue; | ||
| 38 | size_t rx_ring_size; | ||
| 39 | struct srp_buf **rx_ring; | ||
| 40 | |||
| 41 | void *ldata; | ||
| 42 | }; | ||
| 43 | |||
| 44 | struct iu_entry { | ||
| 45 | struct srp_target *target; | ||
| 46 | |||
| 47 | struct list_head ilist; | ||
| 48 | dma_addr_t remote_token; | ||
| 49 | unsigned long flags; | ||
| 50 | |||
| 51 | struct srp_buf *sbuf; | ||
| 52 | }; | ||
| 53 | |||
| 54 | typedef int (srp_rdma_t)(struct scsi_cmnd *, struct scatterlist *, int, | ||
| 55 | struct srp_direct_buf *, int, | ||
| 56 | enum dma_data_direction, unsigned int); | ||
| 57 | extern int srp_target_alloc(struct srp_target *, struct device *, size_t, size_t); | ||
| 58 | extern void srp_target_free(struct srp_target *); | ||
| 59 | |||
| 60 | extern struct iu_entry *srp_iu_get(struct srp_target *); | ||
| 61 | extern void srp_iu_put(struct iu_entry *); | ||
| 62 | |||
| 63 | extern int srp_cmd_queue(struct Scsi_Host *, struct srp_cmd *, void *, u64, u64); | ||
| 64 | extern int srp_transfer_data(struct scsi_cmnd *, struct srp_cmd *, | ||
| 65 | srp_rdma_t, int, int); | ||
| 66 | |||
| 67 | |||
| 68 | static inline struct srp_target *host_to_srp_target(struct Scsi_Host *host) | ||
| 69 | { | ||
| 70 | return (struct srp_target *) host->hostdata; | ||
| 71 | } | ||
| 72 | |||
| 73 | static inline int srp_cmd_direction(struct srp_cmd *cmd) | ||
| 74 | { | ||
| 75 | return (cmd->buf_fmt >> 4) ? DMA_TO_DEVICE : DMA_FROM_DEVICE; | ||
| 76 | } | ||
| 77 | |||
| 78 | #endif | ||
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 0a4edfe8af51..e6df23cae7be 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
| @@ -332,6 +332,7 @@ static inline int scsi_status_is_good(int status) | |||
| 332 | #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ | 332 | #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ |
| 333 | #define TYPE_RBC 0x0e | 333 | #define TYPE_RBC 0x0e |
| 334 | #define TYPE_OSD 0x11 | 334 | #define TYPE_OSD 0x11 |
| 335 | #define TYPE_ZBC 0x14 | ||
| 335 | #define TYPE_NO_LUN 0x7f | 336 | #define TYPE_NO_LUN 0x7f |
| 336 | 337 | ||
| 337 | /* SCSI protocols; these are taken from SPC-3 section 7.5 */ | 338 | /* SCSI protocols; these are taken from SPC-3 section 7.5 */ |
| @@ -385,7 +386,7 @@ struct scsi_lun { | |||
| 385 | #define SCSI_W_LUN_ACCESS_CONTROL (SCSI_W_LUN_BASE + 2) | 386 | #define SCSI_W_LUN_ACCESS_CONTROL (SCSI_W_LUN_BASE + 2) |
| 386 | #define SCSI_W_LUN_TARGET_LOG_PAGE (SCSI_W_LUN_BASE + 3) | 387 | #define SCSI_W_LUN_TARGET_LOG_PAGE (SCSI_W_LUN_BASE + 3) |
| 387 | 388 | ||
| 388 | static inline int scsi_is_wlun(unsigned int lun) | 389 | static inline int scsi_is_wlun(u64 lun) |
| 389 | { | 390 | { |
| 390 | return (lun & 0xff00) == SCSI_W_LUN_BASE; | 391 | return (lun & 0xff00) == SCSI_W_LUN_BASE; |
| 391 | } | 392 | } |
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index e0ae71098144..73f349044941 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
| @@ -150,9 +150,7 @@ static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd) | |||
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); | 152 | extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); |
| 153 | extern struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *, gfp_t); | ||
| 154 | extern void scsi_put_command(struct scsi_cmnd *); | 153 | extern void scsi_put_command(struct scsi_cmnd *); |
| 155 | extern void __scsi_put_command(struct Scsi_Host *, struct scsi_cmnd *); | ||
| 156 | extern void scsi_finish_command(struct scsi_cmnd *cmd); | 154 | extern void scsi_finish_command(struct scsi_cmnd *cmd); |
| 157 | 155 | ||
| 158 | extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count, | 156 | extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count, |
| @@ -160,7 +158,6 @@ extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count, | |||
| 160 | extern void scsi_kunmap_atomic_sg(void *virt); | 158 | extern void scsi_kunmap_atomic_sg(void *virt); |
| 161 | 159 | ||
| 162 | extern int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask); | 160 | extern int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask); |
| 163 | extern void scsi_release_buffers(struct scsi_cmnd *cmd); | ||
| 164 | 161 | ||
| 165 | extern int scsi_dma_map(struct scsi_cmnd *cmd); | 162 | extern int scsi_dma_map(struct scsi_cmnd *cmd); |
| 166 | extern void scsi_dma_unmap(struct scsi_cmnd *cmd); | 163 | extern void scsi_dma_unmap(struct scsi_cmnd *cmd); |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 27ab31017f09..1a0d1842962e 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
| @@ -81,9 +81,9 @@ struct scsi_device { | |||
| 81 | struct list_head siblings; /* list of all devices on this host */ | 81 | struct list_head siblings; /* list of all devices on this host */ |
| 82 | struct list_head same_target_siblings; /* just the devices sharing same target id */ | 82 | struct list_head same_target_siblings; /* just the devices sharing same target id */ |
| 83 | 83 | ||
| 84 | /* this is now protected by the request_queue->queue_lock */ | 84 | atomic_t device_busy; /* commands actually active on LLDD */ |
| 85 | unsigned int device_busy; /* commands actually active on | 85 | atomic_t device_blocked; /* Device returned QUEUE_FULL. */ |
| 86 | * low-level. protected by queue_lock. */ | 86 | |
| 87 | spinlock_t list_lock; | 87 | spinlock_t list_lock; |
| 88 | struct list_head cmd_list; /* queue of in use SCSI Command structures */ | 88 | struct list_head cmd_list; /* queue of in use SCSI Command structures */ |
| 89 | struct list_head starved_entry; | 89 | struct list_head starved_entry; |
| @@ -98,8 +98,8 @@ struct scsi_device { | |||
| 98 | 98 | ||
| 99 | unsigned long last_queue_ramp_up; /* last queue ramp up time */ | 99 | unsigned long last_queue_ramp_up; /* last queue ramp up time */ |
| 100 | 100 | ||
| 101 | unsigned int id, lun, channel; | 101 | unsigned int id, channel; |
| 102 | 102 | u64 lun; | |
| 103 | unsigned int manufacturer; /* Manufacturer of device, for using | 103 | unsigned int manufacturer; /* Manufacturer of device, for using |
| 104 | * vendor-specific cmd's */ | 104 | * vendor-specific cmd's */ |
| 105 | unsigned sector_size; /* size in bytes */ | 105 | unsigned sector_size; /* size in bytes */ |
| @@ -127,7 +127,6 @@ struct scsi_device { | |||
| 127 | * pass settings from slave_alloc to scsi | 127 | * pass settings from slave_alloc to scsi |
| 128 | * core. */ | 128 | * core. */ |
| 129 | unsigned int eh_timeout; /* Error handling timeout */ | 129 | unsigned int eh_timeout; /* Error handling timeout */ |
| 130 | unsigned writeable:1; | ||
| 131 | unsigned removable:1; | 130 | unsigned removable:1; |
| 132 | unsigned changed:1; /* Data invalid due to media change */ | 131 | unsigned changed:1; /* Data invalid due to media change */ |
| 133 | unsigned busy:1; /* Used to prevent races */ | 132 | unsigned busy:1; /* Used to prevent races */ |
| @@ -155,6 +154,7 @@ struct scsi_device { | |||
| 155 | unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08 */ | 154 | unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08 */ |
| 156 | unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */ | 155 | unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */ |
| 157 | unsigned skip_vpd_pages:1; /* do not read VPD pages */ | 156 | unsigned skip_vpd_pages:1; /* do not read VPD pages */ |
| 157 | unsigned try_vpd_pages:1; /* attempt to read VPD pages */ | ||
| 158 | unsigned use_192_bytes_for_3f:1; /* ask for 192 bytes from page 0x3f */ | 158 | unsigned use_192_bytes_for_3f:1; /* ask for 192 bytes from page 0x3f */ |
| 159 | unsigned no_start_on_add:1; /* do not issue start on add */ | 159 | unsigned no_start_on_add:1; /* do not issue start on add */ |
| 160 | unsigned allow_restart:1; /* issue START_UNIT in error handler */ | 160 | unsigned allow_restart:1; /* issue START_UNIT in error handler */ |
| @@ -182,8 +182,6 @@ struct scsi_device { | |||
| 182 | struct list_head event_list; /* asserted events */ | 182 | struct list_head event_list; /* asserted events */ |
| 183 | struct work_struct event_work; | 183 | struct work_struct event_work; |
| 184 | 184 | ||
| 185 | unsigned int device_blocked; /* Device returned QUEUE_FULL. */ | ||
| 186 | |||
| 187 | unsigned int max_device_blocked; /* what device_blocked counts down from */ | 185 | unsigned int max_device_blocked; /* what device_blocked counts down from */ |
| 188 | #define SCSI_DEFAULT_DEVICE_BLOCKED 3 | 186 | #define SCSI_DEFAULT_DEVICE_BLOCKED 3 |
| 189 | 187 | ||
| @@ -291,14 +289,15 @@ struct scsi_target { | |||
| 291 | unsigned int expecting_lun_change:1; /* A device has reported | 289 | unsigned int expecting_lun_change:1; /* A device has reported |
| 292 | * a 3F/0E UA, other devices on | 290 | * a 3F/0E UA, other devices on |
| 293 | * the same target will also. */ | 291 | * the same target will also. */ |
| 294 | /* commands actually active on LLD. protected by host lock. */ | 292 | /* commands actually active on LLD. */ |
| 295 | unsigned int target_busy; | 293 | atomic_t target_busy; |
| 294 | atomic_t target_blocked; | ||
| 295 | |||
| 296 | /* | 296 | /* |
| 297 | * LLDs should set this in the slave_alloc host template callout. | 297 | * LLDs should set this in the slave_alloc host template callout. |
| 298 | * If set to zero then there is not limit. | 298 | * If set to zero then there is not limit. |
| 299 | */ | 299 | */ |
| 300 | unsigned int can_queue; | 300 | unsigned int can_queue; |
| 301 | unsigned int target_blocked; | ||
| 302 | unsigned int max_target_blocked; | 301 | unsigned int max_target_blocked; |
| 303 | #define SCSI_DEFAULT_TARGET_BLOCKED 3 | 302 | #define SCSI_DEFAULT_TARGET_BLOCKED 3 |
| 304 | 303 | ||
| @@ -321,9 +320,9 @@ static inline struct scsi_target *scsi_target(struct scsi_device *sdev) | |||
| 321 | dev_printk(prefix, &(starget)->dev, fmt, ##a) | 320 | dev_printk(prefix, &(starget)->dev, fmt, ##a) |
| 322 | 321 | ||
| 323 | extern struct scsi_device *__scsi_add_device(struct Scsi_Host *, | 322 | extern struct scsi_device *__scsi_add_device(struct Scsi_Host *, |
| 324 | uint, uint, uint, void *hostdata); | 323 | uint, uint, u64, void *hostdata); |
| 325 | extern int scsi_add_device(struct Scsi_Host *host, uint channel, | 324 | extern int scsi_add_device(struct Scsi_Host *host, uint channel, |
| 326 | uint target, uint lun); | 325 | uint target, u64 lun); |
| 327 | extern int scsi_register_device_handler(struct scsi_device_handler *scsi_dh); | 326 | extern int scsi_register_device_handler(struct scsi_device_handler *scsi_dh); |
| 328 | extern void scsi_remove_device(struct scsi_device *); | 327 | extern void scsi_remove_device(struct scsi_device *); |
| 329 | extern int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh); | 328 | extern int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh); |
| @@ -332,13 +331,13 @@ void scsi_attach_vpd(struct scsi_device *sdev); | |||
| 332 | extern int scsi_device_get(struct scsi_device *); | 331 | extern int scsi_device_get(struct scsi_device *); |
| 333 | extern void scsi_device_put(struct scsi_device *); | 332 | extern void scsi_device_put(struct scsi_device *); |
| 334 | extern struct scsi_device *scsi_device_lookup(struct Scsi_Host *, | 333 | extern struct scsi_device *scsi_device_lookup(struct Scsi_Host *, |
| 335 | uint, uint, uint); | 334 | uint, uint, u64); |
| 336 | extern struct scsi_device *__scsi_device_lookup(struct Scsi_Host *, | 335 | extern struct scsi_device *__scsi_device_lookup(struct Scsi_Host *, |
| 337 | uint, uint, uint); | 336 | uint, uint, u64); |
| 338 | extern struct scsi_device *scsi_device_lookup_by_target(struct scsi_target *, | 337 | extern struct scsi_device *scsi_device_lookup_by_target(struct scsi_target *, |
| 339 | uint); | 338 | u64); |
| 340 | extern struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *, | 339 | extern struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *, |
| 341 | uint); | 340 | u64); |
| 342 | extern void starget_for_each_device(struct scsi_target *, void *, | 341 | extern void starget_for_each_device(struct scsi_target *, void *, |
| 343 | void (*fn)(struct scsi_device *, void *)); | 342 | void (*fn)(struct scsi_device *, void *)); |
| 344 | extern void __starget_for_each_device(struct scsi_target *, void *, | 343 | extern void __starget_for_each_device(struct scsi_target *, void *, |
| @@ -411,13 +410,13 @@ extern void scsi_device_resume(struct scsi_device *sdev); | |||
| 411 | extern void scsi_target_quiesce(struct scsi_target *); | 410 | extern void scsi_target_quiesce(struct scsi_target *); |
| 412 | extern void scsi_target_resume(struct scsi_target *); | 411 | extern void scsi_target_resume(struct scsi_target *); |
| 413 | extern void scsi_scan_target(struct device *parent, unsigned int channel, | 412 | extern void scsi_scan_target(struct device *parent, unsigned int channel, |
| 414 | unsigned int id, unsigned int lun, int rescan); | 413 | unsigned int id, u64 lun, int rescan); |
| 415 | extern void scsi_target_reap(struct scsi_target *); | 414 | extern void scsi_target_reap(struct scsi_target *); |
| 416 | extern void scsi_target_block(struct device *); | 415 | extern void scsi_target_block(struct device *); |
| 417 | extern void scsi_target_unblock(struct device *, enum scsi_device_state); | 416 | extern void scsi_target_unblock(struct device *, enum scsi_device_state); |
| 418 | extern void scsi_remove_target(struct device *); | 417 | extern void scsi_remove_target(struct device *); |
| 419 | extern void int_to_scsilun(unsigned int, struct scsi_lun *); | 418 | extern void int_to_scsilun(u64, struct scsi_lun *); |
| 420 | extern int scsilun_to_int(struct scsi_lun *); | 419 | extern u64 scsilun_to_int(struct scsi_lun *); |
| 421 | extern const char *scsi_device_state_name(enum scsi_device_state); | 420 | extern const char *scsi_device_state_name(enum scsi_device_state); |
| 422 | extern int scsi_is_sdev_device(const struct device *); | 421 | extern int scsi_is_sdev_device(const struct device *); |
| 423 | extern int scsi_is_target_device(const struct device *); | 422 | extern int scsi_is_target_device(const struct device *); |
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h index 447d2d7466fc..183eaab7c380 100644 --- a/include/scsi/scsi_devinfo.h +++ b/include/scsi/scsi_devinfo.h | |||
| @@ -32,4 +32,9 @@ | |||
| 32 | #define BLIST_ATTACH_PQ3 0x1000000 /* Scan: Attach to PQ3 devices */ | 32 | #define BLIST_ATTACH_PQ3 0x1000000 /* Scan: Attach to PQ3 devices */ |
| 33 | #define BLIST_NO_DIF 0x2000000 /* Disable T10 PI (DIF) */ | 33 | #define BLIST_NO_DIF 0x2000000 /* Disable T10 PI (DIF) */ |
| 34 | #define BLIST_SKIP_VPD_PAGES 0x4000000 /* Ignore SBC-3 VPD pages */ | 34 | #define BLIST_SKIP_VPD_PAGES 0x4000000 /* Ignore SBC-3 VPD pages */ |
| 35 | #define BLIST_SCSI3LUN 0x8000000 /* Scan more than 256 LUNs | ||
| 36 | for sequential scan */ | ||
| 37 | #define BLIST_TRY_VPD_PAGES 0x10000000 /* Attempt to read VPD pages */ | ||
| 38 | #define BLIST_NO_RSOC 0x20000000 /* don't try to issue RSOC */ | ||
| 39 | |||
| 35 | #endif | 40 | #endif |
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h index 36c4114ed9bc..c2b759809d8a 100644 --- a/include/scsi/scsi_driver.h +++ b/include/scsi/scsi_driver.h | |||
| @@ -29,7 +29,4 @@ extern int scsi_register_interface(struct class_interface *); | |||
| 29 | #define scsi_unregister_interface(intf) \ | 29 | #define scsi_unregister_interface(intf) \ |
| 30 | class_interface_unregister(intf) | 30 | class_interface_unregister(intf) |
| 31 | 31 | ||
| 32 | int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req); | ||
| 33 | int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req); | ||
| 34 | |||
| 35 | #endif /* _SCSI_SCSI_DRIVER_H */ | 32 | #endif /* _SCSI_SCSI_DRIVER_H */ |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 94844fc77b97..ba2034779961 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <linux/workqueue.h> | 7 | #include <linux/workqueue.h> |
| 8 | #include <linux/mutex.h> | 8 | #include <linux/mutex.h> |
| 9 | #include <linux/seq_file.h> | 9 | #include <linux/seq_file.h> |
| 10 | #include <linux/blk-mq.h> | ||
| 10 | #include <scsi/scsi.h> | 11 | #include <scsi/scsi.h> |
| 11 | 12 | ||
| 12 | struct request_queue; | 13 | struct request_queue; |
| @@ -132,27 +133,6 @@ struct scsi_host_template { | |||
| 132 | int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *); | 133 | int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *); |
| 133 | 134 | ||
| 134 | /* | 135 | /* |
| 135 | * The transfer functions are used to queue a scsi command to | ||
| 136 | * the LLD. When the driver is finished processing the command | ||
| 137 | * the done callback is invoked. | ||
| 138 | * | ||
| 139 | * This is called to inform the LLD to transfer | ||
| 140 | * scsi_bufflen(cmd) bytes. scsi_sg_count(cmd) speciefies the | ||
| 141 | * number of scatterlist entried in the command and | ||
| 142 | * scsi_sglist(cmd) returns the scatterlist. | ||
| 143 | * | ||
| 144 | * return values: see queuecommand | ||
| 145 | * | ||
| 146 | * If the LLD accepts the cmd, it should set the result to an | ||
| 147 | * appropriate value when completed before calling the done function. | ||
| 148 | * | ||
| 149 | * STATUS: REQUIRED FOR TARGET DRIVERS | ||
| 150 | */ | ||
| 151 | /* TODO: rename */ | ||
| 152 | int (* transfer_response)(struct scsi_cmnd *, | ||
| 153 | void (*done)(struct scsi_cmnd *)); | ||
| 154 | |||
| 155 | /* | ||
| 156 | * This is an error handling strategy routine. You don't need to | 136 | * This is an error handling strategy routine. You don't need to |
| 157 | * define one of these if you don't want to - there is a default | 137 | * define one of these if you don't want to - there is a default |
| 158 | * routine that is present that should work in most cases. For those | 138 | * routine that is present that should work in most cases. For those |
| @@ -408,7 +388,7 @@ struct scsi_host_template { | |||
| 408 | /* | 388 | /* |
| 409 | * Set this if the host adapter has limitations beside segment count. | 389 | * Set this if the host adapter has limitations beside segment count. |
| 410 | */ | 390 | */ |
| 411 | unsigned short max_sectors; | 391 | unsigned int max_sectors; |
| 412 | 392 | ||
| 413 | /* | 393 | /* |
| 414 | * DMA scatter gather segment boundary limit. A segment crossing this | 394 | * DMA scatter gather segment boundary limit. A segment crossing this |
| @@ -531,6 +511,9 @@ struct scsi_host_template { | |||
| 531 | */ | 511 | */ |
| 532 | unsigned int cmd_size; | 512 | unsigned int cmd_size; |
| 533 | struct scsi_host_cmd_pool *cmd_pool; | 513 | struct scsi_host_cmd_pool *cmd_pool; |
| 514 | |||
| 515 | /* temporary flag to disable blk-mq I/O path */ | ||
| 516 | bool disable_blk_mq; | ||
| 534 | }; | 517 | }; |
| 535 | 518 | ||
| 536 | /* | 519 | /* |
| @@ -601,15 +584,16 @@ struct Scsi_Host { | |||
| 601 | * Area to keep a shared tag map (if needed, will be | 584 | * Area to keep a shared tag map (if needed, will be |
| 602 | * NULL if not). | 585 | * NULL if not). |
| 603 | */ | 586 | */ |
| 604 | struct blk_queue_tag *bqt; | 587 | union { |
| 588 | struct blk_queue_tag *bqt; | ||
| 589 | struct blk_mq_tag_set tag_set; | ||
| 590 | }; | ||
| 605 | 591 | ||
| 606 | /* | 592 | atomic_t host_busy; /* commands actually active on low-level */ |
| 607 | * The following two fields are protected with host_lock; | 593 | atomic_t host_blocked; |
| 608 | * however, eh routines can safely access during eh processing | 594 | |
| 609 | * without acquiring the lock. | 595 | unsigned int host_failed; /* commands that failed. |
| 610 | */ | 596 | protected by host_lock */ |
| 611 | unsigned int host_busy; /* commands actually active on low-level */ | ||
| 612 | unsigned int host_failed; /* commands that failed. */ | ||
| 613 | unsigned int host_eh_scheduled; /* EH scheduled without command */ | 597 | unsigned int host_eh_scheduled; /* EH scheduled without command */ |
| 614 | 598 | ||
| 615 | unsigned int host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */ | 599 | unsigned int host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */ |
| @@ -623,11 +607,11 @@ struct Scsi_Host { | |||
| 623 | * These three parameters can be used to allow for wide scsi, | 607 | * These three parameters can be used to allow for wide scsi, |
| 624 | * and for host adapters that support multiple busses | 608 | * and for host adapters that support multiple busses |
| 625 | * The first two should be set to 1 more than the actual max id | 609 | * The first two should be set to 1 more than the actual max id |
| 626 | * or lun (i.e. 8 for normal systems). | 610 | * or lun (e.g. 8 for SCSI parallel systems). |
| 627 | */ | 611 | */ |
| 628 | unsigned int max_id; | ||
| 629 | unsigned int max_lun; | ||
| 630 | unsigned int max_channel; | 612 | unsigned int max_channel; |
| 613 | unsigned int max_id; | ||
| 614 | u64 max_lun; | ||
| 631 | 615 | ||
| 632 | /* | 616 | /* |
| 633 | * This is a unique identifier that must be assigned so that we | 617 | * This is a unique identifier that must be assigned so that we |
| @@ -652,7 +636,7 @@ struct Scsi_Host { | |||
| 652 | short cmd_per_lun; | 636 | short cmd_per_lun; |
| 653 | short unsigned int sg_tablesize; | 637 | short unsigned int sg_tablesize; |
| 654 | short unsigned int sg_prot_tablesize; | 638 | short unsigned int sg_prot_tablesize; |
| 655 | short unsigned int max_sectors; | 639 | unsigned int max_sectors; |
| 656 | unsigned long dma_boundary; | 640 | unsigned long dma_boundary; |
| 657 | /* | 641 | /* |
| 658 | * Used to assign serial numbers to the cmds. | 642 | * Used to assign serial numbers to the cmds. |
| @@ -695,6 +679,8 @@ struct Scsi_Host { | |||
| 695 | /* The controller does not support WRITE SAME */ | 679 | /* The controller does not support WRITE SAME */ |
| 696 | unsigned no_write_same:1; | 680 | unsigned no_write_same:1; |
| 697 | 681 | ||
| 682 | unsigned use_blk_mq:1; | ||
| 683 | |||
| 698 | /* | 684 | /* |
| 699 | * Optional work queue to be utilized by the transport | 685 | * Optional work queue to be utilized by the transport |
| 700 | */ | 686 | */ |
| @@ -707,11 +693,6 @@ struct Scsi_Host { | |||
| 707 | struct workqueue_struct *tmf_work_q; | 693 | struct workqueue_struct *tmf_work_q; |
| 708 | 694 | ||
| 709 | /* | 695 | /* |
| 710 | * Host has rejected a command because it was busy. | ||
| 711 | */ | ||
| 712 | unsigned int host_blocked; | ||
| 713 | |||
| 714 | /* | ||
| 715 | * Value host_blocked counts down from | 696 | * Value host_blocked counts down from |
| 716 | */ | 697 | */ |
| 717 | unsigned int max_host_blocked; | 698 | unsigned int max_host_blocked; |
| @@ -800,6 +781,13 @@ static inline int scsi_host_in_recovery(struct Scsi_Host *shost) | |||
| 800 | shost->tmf_in_progress; | 781 | shost->tmf_in_progress; |
| 801 | } | 782 | } |
| 802 | 783 | ||
| 784 | extern bool scsi_use_blk_mq; | ||
| 785 | |||
| 786 | static inline bool shost_use_blk_mq(struct Scsi_Host *shost) | ||
| 787 | { | ||
| 788 | return shost->use_blk_mq; | ||
| 789 | } | ||
| 790 | |||
| 803 | extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *); | 791 | extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *); |
| 804 | extern void scsi_flush_work(struct Scsi_Host *); | 792 | extern void scsi_flush_work(struct Scsi_Host *); |
| 805 | 793 | ||
| @@ -816,8 +804,6 @@ extern struct Scsi_Host *scsi_host_lookup(unsigned short); | |||
| 816 | extern const char *scsi_host_state_name(enum scsi_host_state); | 804 | extern const char *scsi_host_state_name(enum scsi_host_state); |
| 817 | extern void scsi_cmd_get_serial(struct Scsi_Host *, struct scsi_cmnd *); | 805 | extern void scsi_cmd_get_serial(struct Scsi_Host *, struct scsi_cmnd *); |
| 818 | 806 | ||
| 819 | extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); | ||
| 820 | |||
| 821 | static inline int __must_check scsi_add_host(struct Scsi_Host *host, | 807 | static inline int __must_check scsi_add_host(struct Scsi_Host *host, |
| 822 | struct device *dev) | 808 | struct device *dev) |
| 823 | { | 809 | { |
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index 81dd12edc38c..cdcc90b07ecb 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h | |||
| @@ -67,7 +67,8 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) | |||
| 67 | if (!sdev->tagged_supported) | 67 | if (!sdev->tagged_supported) |
| 68 | return; | 68 | return; |
| 69 | 69 | ||
| 70 | if (!blk_queue_tagged(sdev->request_queue)) | 70 | if (!shost_use_blk_mq(sdev->host) && |
| 71 | blk_queue_tagged(sdev->request_queue)) | ||
| 71 | blk_queue_init_tags(sdev->request_queue, depth, | 72 | blk_queue_init_tags(sdev->request_queue, depth, |
| 72 | sdev->host->bqt); | 73 | sdev->host->bqt); |
| 73 | 74 | ||
| @@ -80,7 +81,8 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) | |||
| 80 | **/ | 81 | **/ |
| 81 | static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth) | 82 | static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth) |
| 82 | { | 83 | { |
| 83 | if (blk_queue_tagged(sdev->request_queue)) | 84 | if (!shost_use_blk_mq(sdev->host) && |
| 85 | blk_queue_tagged(sdev->request_queue)) | ||
| 84 | blk_queue_free_tags(sdev->request_queue); | 86 | blk_queue_free_tags(sdev->request_queue); |
| 85 | scsi_adjust_queue_depth(sdev, 0, depth); | 87 | scsi_adjust_queue_depth(sdev, 0, depth); |
| 86 | } | 88 | } |
| @@ -108,6 +110,15 @@ static inline int scsi_populate_tag_msg(struct scsi_cmnd *cmd, char *msg) | |||
| 108 | return 0; | 110 | return 0; |
| 109 | } | 111 | } |
| 110 | 112 | ||
| 113 | static inline struct scsi_cmnd *scsi_mq_find_tag(struct Scsi_Host *shost, | ||
| 114 | unsigned int hw_ctx, int tag) | ||
| 115 | { | ||
| 116 | struct request *req; | ||
| 117 | |||
| 118 | req = blk_mq_tag_to_rq(shost->tag_set.tags[hw_ctx], tag); | ||
| 119 | return req ? (struct scsi_cmnd *)req->special : NULL; | ||
| 120 | } | ||
| 121 | |||
| 111 | /** | 122 | /** |
| 112 | * scsi_find_tag - find a tagged command by device | 123 | * scsi_find_tag - find a tagged command by device |
| 113 | * @SDpnt: pointer to the ScSI device | 124 | * @SDpnt: pointer to the ScSI device |
| @@ -118,10 +129,12 @@ static inline int scsi_populate_tag_msg(struct scsi_cmnd *cmd, char *msg) | |||
| 118 | **/ | 129 | **/ |
| 119 | static inline struct scsi_cmnd *scsi_find_tag(struct scsi_device *sdev, int tag) | 130 | static inline struct scsi_cmnd *scsi_find_tag(struct scsi_device *sdev, int tag) |
| 120 | { | 131 | { |
| 121 | |||
| 122 | struct request *req; | 132 | struct request *req; |
| 123 | 133 | ||
| 124 | if (tag != SCSI_NO_TAG) { | 134 | if (tag != SCSI_NO_TAG) { |
| 135 | if (shost_use_blk_mq(sdev->host)) | ||
| 136 | return scsi_mq_find_tag(sdev->host, 0, tag); | ||
| 137 | |||
| 125 | req = blk_queue_find_tag(sdev->request_queue, tag); | 138 | req = blk_queue_find_tag(sdev->request_queue, tag); |
| 126 | return req ? (struct scsi_cmnd *)req->special : NULL; | 139 | return req ? (struct scsi_cmnd *)req->special : NULL; |
| 127 | } | 140 | } |
| @@ -130,6 +143,7 @@ static inline struct scsi_cmnd *scsi_find_tag(struct scsi_device *sdev, int tag) | |||
| 130 | return sdev->current_cmnd; | 143 | return sdev->current_cmnd; |
| 131 | } | 144 | } |
| 132 | 145 | ||
| 146 | |||
| 133 | /** | 147 | /** |
| 134 | * scsi_init_shared_tag_map - create a shared tag map | 148 | * scsi_init_shared_tag_map - create a shared tag map |
| 135 | * @shost: the host to share the tag map among all devices | 149 | * @shost: the host to share the tag map among all devices |
| @@ -138,6 +152,12 @@ static inline struct scsi_cmnd *scsi_find_tag(struct scsi_device *sdev, int tag) | |||
| 138 | static inline int scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth) | 152 | static inline int scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth) |
| 139 | { | 153 | { |
| 140 | /* | 154 | /* |
| 155 | * We always have a shared tag map around when using blk-mq. | ||
| 156 | */ | ||
| 157 | if (shost_use_blk_mq(shost)) | ||
| 158 | return 0; | ||
| 159 | |||
| 160 | /* | ||
| 141 | * If the shared tag map isn't already initialized, do it now. | 161 | * If the shared tag map isn't already initialized, do it now. |
| 142 | * This saves callers from having to check ->bqt when setting up | 162 | * This saves callers from having to check ->bqt when setting up |
| 143 | * devices on the shared host (for libata) | 163 | * devices on the shared host (for libata) |
| @@ -165,6 +185,8 @@ static inline struct scsi_cmnd *scsi_host_find_tag(struct Scsi_Host *shost, | |||
| 165 | struct request *req; | 185 | struct request *req; |
| 166 | 186 | ||
| 167 | if (tag != SCSI_NO_TAG) { | 187 | if (tag != SCSI_NO_TAG) { |
| 188 | if (shost_use_blk_mq(shost)) | ||
| 189 | return scsi_mq_find_tag(shost, 0, tag); | ||
| 168 | req = blk_map_queue_find_tag(shost->bqt, tag); | 190 | req = blk_map_queue_find_tag(shost->bqt, tag); |
| 169 | return req ? (struct scsi_cmnd *)req->special : NULL; | 191 | return req ? (struct scsi_cmnd *)req->special : NULL; |
| 170 | } | 192 | } |
diff --git a/include/scsi/scsi_tgt.h b/include/scsi/scsi_tgt.h deleted file mode 100644 index d0fefb96158f..000000000000 --- a/include/scsi/scsi_tgt.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * SCSI target definitions | ||
| 3 | */ | ||
| 4 | |||
| 5 | #include <linux/dma-mapping.h> | ||
| 6 | |||
| 7 | struct Scsi_Host; | ||
| 8 | struct scsi_cmnd; | ||
| 9 | struct scsi_lun; | ||
| 10 | |||
| 11 | extern struct Scsi_Host *scsi_tgt_cmd_to_host(struct scsi_cmnd *); | ||
| 12 | extern int scsi_tgt_alloc_queue(struct Scsi_Host *); | ||
| 13 | extern void scsi_tgt_free_queue(struct Scsi_Host *); | ||
| 14 | extern int scsi_tgt_queue_command(struct scsi_cmnd *, u64, struct scsi_lun *, u64); | ||
| 15 | extern int scsi_tgt_tsk_mgmt_request(struct Scsi_Host *, u64, int, u64, | ||
| 16 | struct scsi_lun *, void *); | ||
| 17 | extern struct scsi_cmnd *scsi_host_get_command(struct Scsi_Host *, | ||
| 18 | enum dma_data_direction, gfp_t); | ||
| 19 | extern void scsi_host_put_command(struct Scsi_Host *, struct scsi_cmnd *); | ||
| 20 | extern int scsi_tgt_it_nexus_create(struct Scsi_Host *, u64, char *); | ||
| 21 | extern int scsi_tgt_it_nexus_destroy(struct Scsi_Host *, u64); | ||
diff --git a/include/scsi/scsi_tgt_if.h b/include/scsi/scsi_tgt_if.h deleted file mode 100644 index f2ee7c238a45..000000000000 --- a/include/scsi/scsi_tgt_if.h +++ /dev/null | |||
| @@ -1,108 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * SCSI target kernel/user interface | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005 FUJITA Tomonori <tomof@acm.org> | ||
| 5 | * Copyright (C) 2005 Mike Christie <michaelc@cs.wisc.edu> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU General Public License as | ||
| 9 | * published by the Free Software Foundation; either version 2 of the | ||
| 10 | * License, or (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 20 | * 02110-1301 USA | ||
| 21 | */ | ||
| 22 | #ifndef __SCSI_TARGET_IF_H | ||
| 23 | #define __SCSI_TARGET_IF_H | ||
| 24 | |||
| 25 | /* user -> kernel */ | ||
| 26 | #define TGT_UEVENT_CMD_RSP 0x0001 | ||
| 27 | #define TGT_UEVENT_IT_NEXUS_RSP 0x0002 | ||
| 28 | #define TGT_UEVENT_TSK_MGMT_RSP 0x0003 | ||
| 29 | |||
| 30 | /* kernel -> user */ | ||
| 31 | #define TGT_KEVENT_CMD_REQ 0x1001 | ||
| 32 | #define TGT_KEVENT_CMD_DONE 0x1002 | ||
| 33 | #define TGT_KEVENT_IT_NEXUS_REQ 0x1003 | ||
| 34 | #define TGT_KEVENT_TSK_MGMT_REQ 0x1004 | ||
| 35 | |||
| 36 | struct tgt_event_hdr { | ||
| 37 | uint16_t version; | ||
| 38 | uint16_t status; | ||
| 39 | uint16_t type; | ||
| 40 | uint16_t len; | ||
| 41 | } __attribute__ ((aligned (sizeof(uint64_t)))); | ||
| 42 | |||
| 43 | struct tgt_event { | ||
| 44 | struct tgt_event_hdr hdr; | ||
| 45 | |||
| 46 | union { | ||
| 47 | /* user-> kernel */ | ||
| 48 | struct { | ||
| 49 | int host_no; | ||
| 50 | int result; | ||
| 51 | aligned_u64 itn_id; | ||
| 52 | aligned_u64 tag; | ||
| 53 | aligned_u64 uaddr; | ||
| 54 | aligned_u64 sense_uaddr; | ||
| 55 | uint32_t len; | ||
| 56 | uint32_t sense_len; | ||
| 57 | uint8_t rw; | ||
| 58 | } cmd_rsp; | ||
| 59 | struct { | ||
| 60 | int host_no; | ||
| 61 | int result; | ||
| 62 | aligned_u64 itn_id; | ||
| 63 | aligned_u64 mid; | ||
| 64 | } tsk_mgmt_rsp; | ||
| 65 | struct { | ||
| 66 | __s32 host_no; | ||
| 67 | __s32 result; | ||
| 68 | aligned_u64 itn_id; | ||
| 69 | __u32 function; | ||
| 70 | } it_nexus_rsp; | ||
| 71 | |||
| 72 | /* kernel -> user */ | ||
| 73 | struct { | ||
| 74 | int host_no; | ||
| 75 | uint32_t data_len; | ||
| 76 | aligned_u64 itn_id; | ||
| 77 | uint8_t scb[16]; | ||
| 78 | uint8_t lun[8]; | ||
| 79 | int attribute; | ||
| 80 | aligned_u64 tag; | ||
| 81 | } cmd_req; | ||
| 82 | struct { | ||
| 83 | int host_no; | ||
| 84 | int result; | ||
| 85 | aligned_u64 itn_id; | ||
| 86 | aligned_u64 tag; | ||
| 87 | } cmd_done; | ||
| 88 | struct { | ||
| 89 | int host_no; | ||
| 90 | int function; | ||
| 91 | aligned_u64 itn_id; | ||
| 92 | aligned_u64 tag; | ||
| 93 | uint8_t lun[8]; | ||
| 94 | aligned_u64 mid; | ||
| 95 | } tsk_mgmt_req; | ||
| 96 | struct { | ||
| 97 | __s32 host_no; | ||
| 98 | __u32 function; | ||
| 99 | aligned_u64 itn_id; | ||
| 100 | __u32 max_cmds; | ||
| 101 | __u8 initiator_id[16]; | ||
| 102 | } it_nexus_req; | ||
| 103 | } p; | ||
| 104 | } __attribute__ ((aligned (sizeof(uint64_t)))); | ||
| 105 | |||
| 106 | #define TGT_RING_SIZE (1UL << 16) | ||
| 107 | |||
| 108 | #endif | ||
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h index af244f4bba53..81292392adbc 100644 --- a/include/scsi/scsi_transport.h +++ b/include/scsi/scsi_transport.h | |||
| @@ -35,7 +35,7 @@ struct scsi_transport_template { | |||
| 35 | /* | 35 | /* |
| 36 | * If set, called from sysfs and legacy procfs rescanning code. | 36 | * If set, called from sysfs and legacy procfs rescanning code. |
| 37 | */ | 37 | */ |
| 38 | int (*user_scan)(struct Scsi_Host *, uint, uint, uint); | 38 | int (*user_scan)(struct Scsi_Host *, uint, uint, u64); |
| 39 | 39 | ||
| 40 | /* The size of the specific transport attribute structure (a | 40 | /* The size of the specific transport attribute structure (a |
| 41 | * space of this size will be left at the end of the | 41 | * space of this size will be left at the end of the |
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 8c79980dc8f2..007a0bc01b74 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
| @@ -131,6 +131,10 @@ enum fc_vport_state { | |||
| 131 | #define FC_PORTSPEED_8GBIT 0x10 | 131 | #define FC_PORTSPEED_8GBIT 0x10 |
| 132 | #define FC_PORTSPEED_16GBIT 0x20 | 132 | #define FC_PORTSPEED_16GBIT 0x20 |
| 133 | #define FC_PORTSPEED_32GBIT 0x40 | 133 | #define FC_PORTSPEED_32GBIT 0x40 |
| 134 | #define FC_PORTSPEED_20GBIT 0x80 | ||
| 135 | #define FC_PORTSPEED_40GBIT 0x100 | ||
| 136 | #define FC_PORTSPEED_50GBIT 0x200 | ||
| 137 | #define FC_PORTSPEED_100GBIT 0x400 | ||
| 134 | #define FC_PORTSPEED_NOT_NEGOTIATED (1 << 15) /* Speed not established */ | 138 | #define FC_PORTSPEED_NOT_NEGOTIATED (1 << 15) /* Speed not established */ |
| 135 | 139 | ||
| 136 | /* | 140 | /* |
diff --git a/include/scsi/sg.h b/include/scsi/sg.h index a9f3c6fc3f57..9859355a7cf9 100644 --- a/include/scsi/sg.h +++ b/include/scsi/sg.h | |||
| @@ -4,77 +4,34 @@ | |||
| 4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
| 5 | 5 | ||
| 6 | /* | 6 | /* |
| 7 | History: | 7 | * History: |
| 8 | Started: Aug 9 by Lawrence Foard (entropy@world.std.com), to allow user | 8 | * Started: Aug 9 by Lawrence Foard (entropy@world.std.com), to allow user |
| 9 | process control of SCSI devices. | 9 | * process control of SCSI devices. |
| 10 | Development Sponsored by Killy Corp. NY NY | 10 | * Development Sponsored by Killy Corp. NY NY |
| 11 | Original driver (sg.h): | 11 | * |
| 12 | * Copyright (C) 1992 Lawrence Foard | 12 | * Original driver (sg.h): |
| 13 | Version 2 and 3 extensions to driver: | 13 | * Copyright (C) 1992 Lawrence Foard |
| 14 | * Copyright (C) 1998 - 2006 Douglas Gilbert | 14 | * Version 2 and 3 extensions to driver: |
| 15 | 15 | * Copyright (C) 1998 - 2014 Douglas Gilbert | |
| 16 | Version: 3.5.34 (20060920) | 16 | * |
| 17 | This version is for 2.6 series kernels. | 17 | * Version: 3.5.36 (20140603) |
| 18 | 18 | * This version is for 2.6 and 3 series kernels. | |
| 19 | For a full changelog see http://www.torque.net/sg | 19 | * |
| 20 | 20 | * Documentation | |
| 21 | Map of SG verions to the Linux kernels in which they appear: | 21 | * ============= |
| 22 | ---------- ---------------------------------- | 22 | * A web site for the SG device driver can be found at: |
| 23 | original all kernels < 2.2.6 | 23 | * http://sg.danny.cz/sg [alternatively check the MAINTAINERS file] |
| 24 | 2.1.40 2.2.20 | 24 | * The documentation for the sg version 3 driver can be found at: |
| 25 | 3.0.x optional version 3 sg driver for 2.2 series | 25 | * http://sg.danny.cz/sg/p/sg_v3_ho.html |
| 26 | 3.1.17++ 2.4.0++ | 26 | * Also see: <kernel_source>/Documentation/scsi/scsi-generic.txt |
| 27 | 3.5.30++ 2.6.0++ | 27 | * |
| 28 | 28 | * For utility and test programs see: http://sg.danny.cz/sg/sg3_utils.html | |
| 29 | Major new features in SG 3.x driver (cf SG 2.x drivers) | 29 | */ |
| 30 | - SG_IO ioctl() combines function if write() and read() | ||
| 31 | - new interface (sg_io_hdr_t) but still supports old interface | ||
| 32 | - scatter/gather in user space, direct IO, and mmap supported | ||
| 33 | |||
| 34 | The normal action of this driver is to use the adapter (HBA) driver to DMA | ||
| 35 | data into kernel buffers and then use the CPU to copy the data into the | ||
| 36 | user space (vice versa for writes). That is called "indirect" IO due to | ||
| 37 | the double handling of data. There are two methods offered to remove the | ||
| 38 | redundant copy: 1) direct IO and 2) using the mmap() system call to map | ||
| 39 | the reserve buffer (this driver has one reserve buffer per fd) into the | ||
| 40 | user space. Both have their advantages. | ||
| 41 | In terms of absolute speed mmap() is faster. If speed is not a concern, | ||
| 42 | indirect IO should be fine. Read the documentation for more information. | ||
| 43 | |||
| 44 | ** N.B. To use direct IO 'echo 1 > /proc/scsi/sg/allow_dio' or | ||
| 45 | 'echo 1 > /sys/module/sg/parameters/allow_dio' is needed. | ||
| 46 | That attribute is 0 by default. ** | ||
| 47 | |||
| 48 | Historical note: this SCSI pass-through driver has been known as "sg" for | ||
| 49 | a decade. In broader kernel discussions "sg" is used to refer to scatter | ||
| 50 | gather techniques. The context should clarify which "sg" is referred to. | ||
| 51 | |||
| 52 | Documentation | ||
| 53 | ============= | ||
| 54 | A web site for the SG device driver can be found at: | ||
| 55 | http://www.torque.net/sg [alternatively check the MAINTAINERS file] | ||
| 56 | The documentation for the sg version 3 driver can be found at: | ||
| 57 | http://www.torque.net/sg/p/sg_v3_ho.html | ||
| 58 | This is a rendering from DocBook source [change the extension to "sgml" | ||
| 59 | or "xml"]. There are renderings in "ps", "pdf", "rtf" and "txt" (soon). | ||
| 60 | The SG_IO ioctl is now found in other parts kernel (e.g. the block layer). | ||
| 61 | For more information see http://www.torque.net/sg/sg_io.html | ||
| 62 | |||
| 63 | The older, version 2 documents discuss the original sg interface in detail: | ||
| 64 | http://www.torque.net/sg/p/scsi-generic.txt | ||
| 65 | http://www.torque.net/sg/p/scsi-generic_long.txt | ||
| 66 | Also available: <kernel_source>/Documentation/scsi/scsi-generic.txt | ||
| 67 | |||
| 68 | Utility and test programs are available at the sg web site. They are | ||
| 69 | packaged as sg3_utils (for the lk 2.4 and 2.6 series) and sg_utils | ||
| 70 | (for the lk 2.2 series). | ||
| 71 | */ | ||
| 72 | 30 | ||
| 73 | #ifdef __KERNEL__ | 31 | #ifdef __KERNEL__ |
| 74 | extern int sg_big_buff; /* for sysctl */ | 32 | extern int sg_big_buff; /* for sysctl */ |
| 75 | #endif | 33 | #endif |
| 76 | 34 | ||
| 77 | /* New interface introduced in the 3.x SG drivers follows */ | ||
| 78 | 35 | ||
| 79 | typedef struct sg_iovec /* same structure as used by readv() Linux system */ | 36 | typedef struct sg_iovec /* same structure as used by readv() Linux system */ |
| 80 | { /* call. It defines one scatter-gather element. */ | 37 | { /* call. It defines one scatter-gather element. */ |
| @@ -87,7 +44,7 @@ typedef struct sg_io_hdr | |||
| 87 | { | 44 | { |
| 88 | int interface_id; /* [i] 'S' for SCSI generic (required) */ | 45 | int interface_id; /* [i] 'S' for SCSI generic (required) */ |
| 89 | int dxfer_direction; /* [i] data transfer direction */ | 46 | int dxfer_direction; /* [i] data transfer direction */ |
| 90 | unsigned char cmd_len; /* [i] SCSI command length ( <= 16 bytes) */ | 47 | unsigned char cmd_len; /* [i] SCSI command length */ |
| 91 | unsigned char mx_sb_len; /* [i] max length to write to sbp */ | 48 | unsigned char mx_sb_len; /* [i] max length to write to sbp */ |
| 92 | unsigned short iovec_count; /* [i] 0 implies no scatter gather */ | 49 | unsigned short iovec_count; /* [i] 0 implies no scatter gather */ |
| 93 | unsigned int dxfer_len; /* [i] byte count of data transfer */ | 50 | unsigned int dxfer_len; /* [i] byte count of data transfer */ |
| @@ -129,6 +86,7 @@ typedef struct sg_io_hdr | |||
| 129 | #define SG_FLAG_MMAP_IO 4 /* request memory mapped IO */ | 86 | #define SG_FLAG_MMAP_IO 4 /* request memory mapped IO */ |
| 130 | #define SG_FLAG_NO_DXFER 0x10000 /* no transfer of kernel buffers to/from */ | 87 | #define SG_FLAG_NO_DXFER 0x10000 /* no transfer of kernel buffers to/from */ |
| 131 | /* user space (debug indirect IO) */ | 88 | /* user space (debug indirect IO) */ |
| 89 | #define SG_FLAG_Q_AT_TAIL 0x10 /* default is Q_AT_HEAD */ | ||
| 132 | 90 | ||
| 133 | /* following 'info' values are "or"-ed together */ | 91 | /* following 'info' values are "or"-ed together */ |
| 134 | #define SG_INFO_OK_MASK 0x1 | 92 | #define SG_INFO_OK_MASK 0x1 |
diff --git a/include/sound/control.h b/include/sound/control.h index 5358892b1b39..042613938a1d 100644 --- a/include/sound/control.h +++ b/include/sound/control.h | |||
| @@ -31,10 +31,15 @@ typedef int (snd_kcontrol_info_t) (struct snd_kcontrol * kcontrol, struct snd_ct | |||
| 31 | typedef int (snd_kcontrol_get_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); | 31 | typedef int (snd_kcontrol_get_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); |
| 32 | typedef int (snd_kcontrol_put_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); | 32 | typedef int (snd_kcontrol_put_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); |
| 33 | typedef int (snd_kcontrol_tlv_rw_t)(struct snd_kcontrol *kcontrol, | 33 | typedef int (snd_kcontrol_tlv_rw_t)(struct snd_kcontrol *kcontrol, |
| 34 | int op_flag, /* 0=read,1=write,-1=command */ | 34 | int op_flag, /* SNDRV_CTL_TLV_OP_XXX */ |
| 35 | unsigned int size, | 35 | unsigned int size, |
| 36 | unsigned int __user *tlv); | 36 | unsigned int __user *tlv); |
| 37 | 37 | ||
| 38 | enum { | ||
| 39 | SNDRV_CTL_TLV_OP_READ = 0, | ||
| 40 | SNDRV_CTL_TLV_OP_WRITE = 1, | ||
| 41 | SNDRV_CTL_TLV_OP_CMD = -1, | ||
| 42 | }; | ||
| 38 | 43 | ||
| 39 | struct snd_kcontrol_new { | 44 | struct snd_kcontrol_new { |
| 40 | snd_ctl_elem_iface_t iface; /* interface identifier */ | 45 | snd_ctl_elem_iface_t iface; /* interface identifier */ |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index d854fb31c000..6f3e10ca0e32 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
| @@ -931,10 +931,17 @@ void snd_pcm_timer_done(struct snd_pcm_substream *substream); | |||
| 931 | static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime, | 931 | static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime, |
| 932 | struct timespec *tv) | 932 | struct timespec *tv) |
| 933 | { | 933 | { |
| 934 | if (runtime->tstamp_type == SNDRV_PCM_TSTAMP_TYPE_MONOTONIC) | 934 | switch (runtime->tstamp_type) { |
| 935 | case SNDRV_PCM_TSTAMP_TYPE_MONOTONIC: | ||
| 935 | ktime_get_ts(tv); | 936 | ktime_get_ts(tv); |
| 936 | else | 937 | break; |
| 938 | case SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW: | ||
| 939 | getrawmonotonic(tv); | ||
| 940 | break; | ||
| 941 | default: | ||
| 937 | getnstimeofday(tv); | 942 | getnstimeofday(tv); |
| 943 | break; | ||
| 944 | } | ||
| 938 | } | 945 | } |
| 939 | 946 | ||
| 940 | /* | 947 | /* |
diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h index f4a706f82cb7..d76412b84b48 100644 --- a/include/sound/rcar_snd.h +++ b/include/sound/rcar_snd.h | |||
| @@ -34,6 +34,7 @@ | |||
| 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_NO_BUSIF (1 << 30) /* SSI+DMA without BUSIF */ | ||
| 37 | 38 | ||
| 38 | #define RSND_SSI(_dma_id, _pio_irq, _flags) \ | 39 | #define RSND_SSI(_dma_id, _pio_irq, _flags) \ |
| 39 | { .dma_id = _dma_id, .pio_irq = _pio_irq, .flags = _flags } | 40 | { .dma_id = _dma_id, .pio_irq = _pio_irq, .flags = _flags } |
diff --git a/include/sound/rt286.h b/include/sound/rt286.h new file mode 100644 index 000000000000..eb773d1485f2 --- /dev/null +++ b/include/sound/rt286.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/rt286.h -- Platform data for RT286 | ||
| 3 | * | ||
| 4 | * Copyright 2013 Realtek Microelectronics | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_SND_RT286_H | ||
| 12 | #define __LINUX_SND_RT286_H | ||
| 13 | |||
| 14 | struct rt286_platform_data { | ||
| 15 | bool cbj_en; /*combo jack enable*/ | ||
| 16 | bool gpio2_en; /*GPIO2 enable*/ | ||
| 17 | }; | ||
| 18 | |||
| 19 | #endif | ||
diff --git a/include/sound/rt5670.h b/include/sound/rt5670.h new file mode 100644 index 000000000000..bd311197a3b5 --- /dev/null +++ b/include/sound/rt5670.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/rt5670.h -- Platform data for RT5670 | ||
| 3 | * | ||
| 4 | * Copyright 2014 Realtek Microelectronics | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_SND_RT5670_H | ||
| 12 | #define __LINUX_SND_RT5670_H | ||
| 13 | |||
| 14 | struct rt5670_platform_data { | ||
| 15 | int jd_mode; | ||
| 16 | bool in2_diff; | ||
| 17 | |||
| 18 | bool dmic_en; | ||
| 19 | unsigned int dmic1_data_pin; | ||
| 20 | /* 0 = GPIO6; 1 = IN2P; 3 = GPIO7*/ | ||
| 21 | unsigned int dmic2_data_pin; | ||
| 22 | /* 0 = GPIO8; 1 = IN3N; */ | ||
| 23 | unsigned int dmic3_data_pin; | ||
| 24 | /* 0 = GPIO9; 1 = GPIO10; 2 = GPIO5*/ | ||
| 25 | }; | ||
| 26 | |||
| 27 | #endif | ||
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 688f2ba8009f..e8b3080d196a 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
| @@ -257,7 +257,6 @@ struct snd_soc_dai { | |||
| 257 | 257 | ||
| 258 | struct snd_soc_dapm_widget *playback_widget; | 258 | struct snd_soc_dapm_widget *playback_widget; |
| 259 | struct snd_soc_dapm_widget *capture_widget; | 259 | struct snd_soc_dapm_widget *capture_widget; |
| 260 | struct snd_soc_dapm_context dapm; | ||
| 261 | 260 | ||
| 262 | /* DAI DMA data */ | 261 | /* DAI DMA data */ |
| 263 | void *playback_dma_data; | 262 | void *playback_dma_data; |
| @@ -273,6 +272,10 @@ struct snd_soc_dai { | |||
| 273 | struct snd_soc_codec *codec; | 272 | struct snd_soc_codec *codec; |
| 274 | struct snd_soc_component *component; | 273 | struct snd_soc_component *component; |
| 275 | 274 | ||
| 275 | /* CODEC TDM slot masks and params (for fixup) */ | ||
| 276 | unsigned int tx_mask; | ||
| 277 | unsigned int rx_mask; | ||
| 278 | |||
| 276 | struct snd_soc_card *card; | 279 | struct snd_soc_card *card; |
| 277 | 280 | ||
| 278 | struct list_head list; | 281 | struct list_head list; |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 6b59471cdf44..aac04ff84eea 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
| @@ -431,7 +431,7 @@ int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, | |||
| 431 | const char *pin); | 431 | const char *pin); |
| 432 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, | 432 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, |
| 433 | const char *pin); | 433 | const char *pin); |
| 434 | void snd_soc_dapm_auto_nc_codec_pins(struct snd_soc_codec *codec); | 434 | void snd_soc_dapm_auto_nc_pins(struct snd_soc_card *card); |
| 435 | 435 | ||
| 436 | /* Mostly internal - should not normally be used */ | 436 | /* Mostly internal - should not normally be used */ |
| 437 | void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm); | 437 | void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm); |
| @@ -441,6 +441,8 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, | |||
| 441 | struct snd_soc_dapm_widget_list **list); | 441 | struct snd_soc_dapm_widget_list **list); |
| 442 | 442 | ||
| 443 | struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(struct snd_kcontrol *kcontrol); | 443 | struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(struct snd_kcontrol *kcontrol); |
| 444 | struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm( | ||
| 445 | struct snd_kcontrol *kcontrol); | ||
| 444 | 446 | ||
| 445 | /* dapm widget types */ | 447 | /* dapm widget types */ |
| 446 | enum snd_soc_dapm_type { | 448 | enum snd_soc_dapm_type { |
| @@ -524,7 +526,6 @@ struct snd_soc_dapm_widget { | |||
| 524 | const char *name; /* widget name */ | 526 | const char *name; /* widget name */ |
| 525 | const char *sname; /* stream name */ | 527 | const char *sname; /* stream name */ |
| 526 | struct snd_soc_codec *codec; | 528 | struct snd_soc_codec *codec; |
| 527 | struct snd_soc_platform *platform; | ||
| 528 | struct list_head list; | 529 | struct list_head list; |
| 529 | struct snd_soc_dapm_context *dapm; | 530 | struct snd_soc_dapm_context *dapm; |
| 530 | 531 | ||
| @@ -593,7 +594,6 @@ struct snd_soc_dapm_context { | |||
| 593 | struct device *dev; /* from parent - for debug */ | 594 | struct device *dev; /* from parent - for debug */ |
| 594 | struct snd_soc_component *component; /* parent component */ | 595 | struct snd_soc_component *component; /* parent component */ |
| 595 | struct snd_soc_codec *codec; /* parent codec */ | 596 | struct snd_soc_codec *codec; /* parent codec */ |
| 596 | struct snd_soc_platform *platform; /* parent platform */ | ||
| 597 | struct snd_soc_card *card; /* parent card */ | 597 | struct snd_soc_card *card; /* parent card */ |
| 598 | 598 | ||
| 599 | /* used during DAPM updates */ | 599 | /* used during DAPM updates */ |
| @@ -601,6 +601,8 @@ struct snd_soc_dapm_context { | |||
| 601 | struct list_head list; | 601 | struct list_head list; |
| 602 | 602 | ||
| 603 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | 603 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); |
| 604 | int (*set_bias_level)(struct snd_soc_dapm_context *dapm, | ||
| 605 | enum snd_soc_bias_level level); | ||
| 604 | 606 | ||
| 605 | #ifdef CONFIG_DEBUG_FS | 607 | #ifdef CONFIG_DEBUG_FS |
| 606 | struct dentry *debugfs_dapm; | 608 | struct dentry *debugfs_dapm; |
diff --git a/include/sound/soc.h b/include/sound/soc.h index ed9e2d7e5fdc..be6ecae247b0 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
| @@ -248,6 +248,8 @@ | |||
| 248 | .info = snd_soc_info_enum_double, \ | 248 | .info = snd_soc_info_enum_double, \ |
| 249 | .get = xhandler_get, .put = xhandler_put, \ | 249 | .get = xhandler_get, .put = xhandler_put, \ |
| 250 | .private_value = (unsigned long)&xenum } | 250 | .private_value = (unsigned long)&xenum } |
| 251 | #define SOC_VALUE_ENUM_EXT(xname, xenum, xhandler_get, xhandler_put) \ | ||
| 252 | SOC_ENUM_EXT(xname, xenum, xhandler_get, xhandler_put) | ||
| 251 | 253 | ||
| 252 | #define SND_SOC_BYTES(xname, xbase, xregs) \ | 254 | #define SND_SOC_BYTES(xname, xbase, xregs) \ |
| 253 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 255 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| @@ -270,7 +272,14 @@ | |||
| 270 | .get = xhandler_get, .put = xhandler_put, \ | 272 | .get = xhandler_get, .put = xhandler_put, \ |
| 271 | .private_value = (unsigned long)&(struct soc_bytes_ext) \ | 273 | .private_value = (unsigned long)&(struct soc_bytes_ext) \ |
| 272 | {.max = xcount} } | 274 | {.max = xcount} } |
| 273 | 275 | #define SND_SOC_BYTES_TLV(xname, xcount, xhandler_get, xhandler_put) \ | |
| 276 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | ||
| 277 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE | \ | ||
| 278 | SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK, \ | ||
| 279 | .tlv.c = (snd_soc_bytes_tlv_callback), \ | ||
| 280 | .info = snd_soc_info_bytes_ext, \ | ||
| 281 | .private_value = (unsigned long)&(struct soc_bytes_ext) \ | ||
| 282 | {.max = xcount, .get = xhandler_get, .put = xhandler_put, } } | ||
| 274 | #define SOC_SINGLE_XR_SX(xname, xregbase, xregcount, xnbits, \ | 283 | #define SOC_SINGLE_XR_SX(xname, xregbase, xregcount, xnbits, \ |
| 275 | xmin, xmax, xinvert) \ | 284 | xmin, xmax, xinvert) \ |
| 276 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 285 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
| @@ -436,6 +445,10 @@ int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, | |||
| 436 | int snd_soc_platform_trigger(struct snd_pcm_substream *substream, | 445 | int snd_soc_platform_trigger(struct snd_pcm_substream *substream, |
| 437 | int cmd, struct snd_soc_platform *platform); | 446 | int cmd, struct snd_soc_platform *platform); |
| 438 | 447 | ||
| 448 | int soc_dai_hw_params(struct snd_pcm_substream *substream, | ||
| 449 | struct snd_pcm_hw_params *params, | ||
| 450 | struct snd_soc_dai *dai); | ||
| 451 | |||
| 439 | /* Jack reporting */ | 452 | /* Jack reporting */ |
| 440 | int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type, | 453 | int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type, |
| 441 | struct snd_soc_jack *jack); | 454 | struct snd_soc_jack *jack); |
| @@ -503,10 +516,12 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, | |||
| 503 | const char *prefix); | 516 | const char *prefix); |
| 504 | struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card, | 517 | struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card, |
| 505 | const char *name); | 518 | const char *name); |
| 519 | int snd_soc_add_component_controls(struct snd_soc_component *component, | ||
| 520 | const struct snd_kcontrol_new *controls, unsigned int num_controls); | ||
| 506 | int snd_soc_add_codec_controls(struct snd_soc_codec *codec, | 521 | int snd_soc_add_codec_controls(struct snd_soc_codec *codec, |
| 507 | const struct snd_kcontrol_new *controls, int num_controls); | 522 | const struct snd_kcontrol_new *controls, unsigned int num_controls); |
| 508 | int snd_soc_add_platform_controls(struct snd_soc_platform *platform, | 523 | int snd_soc_add_platform_controls(struct snd_soc_platform *platform, |
| 509 | const struct snd_kcontrol_new *controls, int num_controls); | 524 | const struct snd_kcontrol_new *controls, unsigned int num_controls); |
| 510 | int snd_soc_add_card_controls(struct snd_soc_card *soc_card, | 525 | int snd_soc_add_card_controls(struct snd_soc_card *soc_card, |
| 511 | const struct snd_kcontrol_new *controls, int num_controls); | 526 | const struct snd_kcontrol_new *controls, int num_controls); |
| 512 | int snd_soc_add_dai_controls(struct snd_soc_dai *dai, | 527 | int snd_soc_add_dai_controls(struct snd_soc_dai *dai, |
| @@ -552,6 +567,8 @@ int snd_soc_bytes_put(struct snd_kcontrol *kcontrol, | |||
| 552 | struct snd_ctl_elem_value *ucontrol); | 567 | struct snd_ctl_elem_value *ucontrol); |
| 553 | int snd_soc_bytes_info_ext(struct snd_kcontrol *kcontrol, | 568 | int snd_soc_bytes_info_ext(struct snd_kcontrol *kcontrol, |
| 554 | struct snd_ctl_elem_info *ucontrol); | 569 | struct snd_ctl_elem_info *ucontrol); |
| 570 | int snd_soc_bytes_tlv_callback(struct snd_kcontrol *kcontrol, int op_flag, | ||
| 571 | unsigned int size, unsigned int __user *tlv); | ||
| 555 | int snd_soc_info_xr_sx(struct snd_kcontrol *kcontrol, | 572 | int snd_soc_info_xr_sx(struct snd_kcontrol *kcontrol, |
| 556 | struct snd_ctl_elem_info *uinfo); | 573 | struct snd_ctl_elem_info *uinfo); |
| 557 | int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol, | 574 | int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol, |
| @@ -677,12 +694,17 @@ struct snd_soc_component_driver { | |||
| 677 | int (*of_xlate_dai_name)(struct snd_soc_component *component, | 694 | int (*of_xlate_dai_name)(struct snd_soc_component *component, |
| 678 | struct of_phandle_args *args, | 695 | struct of_phandle_args *args, |
| 679 | const char **dai_name); | 696 | const char **dai_name); |
| 697 | void (*seq_notifier)(struct snd_soc_component *, enum snd_soc_dapm_type, | ||
| 698 | int subseq); | ||
| 699 | int (*stream_event)(struct snd_soc_component *, int event); | ||
| 680 | }; | 700 | }; |
| 681 | 701 | ||
| 682 | struct snd_soc_component { | 702 | struct snd_soc_component { |
| 683 | const char *name; | 703 | const char *name; |
| 684 | int id; | 704 | int id; |
| 705 | const char *name_prefix; | ||
| 685 | struct device *dev; | 706 | struct device *dev; |
| 707 | struct snd_soc_card *card; | ||
| 686 | 708 | ||
| 687 | unsigned int active; | 709 | unsigned int active; |
| 688 | 710 | ||
| @@ -705,18 +727,18 @@ struct snd_soc_component { | |||
| 705 | int val_bytes; | 727 | int val_bytes; |
| 706 | 728 | ||
| 707 | struct mutex io_mutex; | 729 | struct mutex io_mutex; |
| 730 | |||
| 731 | /* Don't use these, use snd_soc_component_get_dapm() */ | ||
| 732 | struct snd_soc_dapm_context dapm; | ||
| 733 | struct snd_soc_dapm_context *dapm_ptr; | ||
| 708 | }; | 734 | }; |
| 709 | 735 | ||
| 710 | /* SoC Audio Codec device */ | 736 | /* SoC Audio Codec device */ |
| 711 | struct snd_soc_codec { | 737 | struct snd_soc_codec { |
| 712 | const char *name; | ||
| 713 | const char *name_prefix; | ||
| 714 | int id; | ||
| 715 | struct device *dev; | 738 | struct device *dev; |
| 716 | const struct snd_soc_codec_driver *driver; | 739 | const struct snd_soc_codec_driver *driver; |
| 717 | 740 | ||
| 718 | struct mutex mutex; | 741 | struct mutex mutex; |
| 719 | struct snd_soc_card *card; | ||
| 720 | struct list_head list; | 742 | struct list_head list; |
| 721 | struct list_head card_list; | 743 | struct list_head card_list; |
| 722 | 744 | ||
| @@ -790,9 +812,6 @@ struct snd_soc_codec_driver { | |||
| 790 | void (*seq_notifier)(struct snd_soc_dapm_context *, | 812 | void (*seq_notifier)(struct snd_soc_dapm_context *, |
| 791 | enum snd_soc_dapm_type, int); | 813 | enum snd_soc_dapm_type, int); |
| 792 | 814 | ||
| 793 | /* codec stream completion event */ | ||
| 794 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | ||
| 795 | |||
| 796 | bool ignore_pmdown_time; /* Doesn't benefit from pmdown delay */ | 815 | bool ignore_pmdown_time; /* Doesn't benefit from pmdown delay */ |
| 797 | 816 | ||
| 798 | /* probe ordering - for components with runtime dependencies */ | 817 | /* probe ordering - for components with runtime dependencies */ |
| @@ -834,9 +853,6 @@ struct snd_soc_platform_driver { | |||
| 834 | /* platform stream compress ops */ | 853 | /* platform stream compress ops */ |
| 835 | const struct snd_compr_ops *compr_ops; | 854 | const struct snd_compr_ops *compr_ops; |
| 836 | 855 | ||
| 837 | /* platform stream completion event */ | ||
| 838 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | ||
| 839 | |||
| 840 | /* probe ordering - for components with runtime dependencies */ | 856 | /* probe ordering - for components with runtime dependencies */ |
| 841 | int probe_order; | 857 | int probe_order; |
| 842 | int remove_order; | 858 | int remove_order; |
| @@ -847,23 +863,23 @@ struct snd_soc_platform_driver { | |||
| 847 | int (*bespoke_trigger)(struct snd_pcm_substream *, int); | 863 | int (*bespoke_trigger)(struct snd_pcm_substream *, int); |
| 848 | }; | 864 | }; |
| 849 | 865 | ||
| 850 | struct snd_soc_platform { | 866 | struct snd_soc_dai_link_component { |
| 851 | const char *name; | 867 | const char *name; |
| 852 | int id; | 868 | const struct device_node *of_node; |
| 869 | const char *dai_name; | ||
| 870 | }; | ||
| 871 | |||
| 872 | struct snd_soc_platform { | ||
| 853 | struct device *dev; | 873 | struct device *dev; |
| 854 | const struct snd_soc_platform_driver *driver; | 874 | const struct snd_soc_platform_driver *driver; |
| 855 | 875 | ||
| 856 | unsigned int suspended:1; /* platform is suspended */ | 876 | unsigned int suspended:1; /* platform is suspended */ |
| 857 | unsigned int probed:1; | 877 | unsigned int probed:1; |
| 858 | 878 | ||
| 859 | struct snd_soc_card *card; | ||
| 860 | struct list_head list; | 879 | struct list_head list; |
| 861 | struct list_head card_list; | ||
| 862 | 880 | ||
| 863 | struct snd_soc_component component; | 881 | struct snd_soc_component component; |
| 864 | 882 | ||
| 865 | struct snd_soc_dapm_context dapm; | ||
| 866 | |||
| 867 | #ifdef CONFIG_DEBUG_FS | 883 | #ifdef CONFIG_DEBUG_FS |
| 868 | struct dentry *debugfs_platform_root; | 884 | struct dentry *debugfs_platform_root; |
| 869 | #endif | 885 | #endif |
| @@ -896,6 +912,10 @@ struct snd_soc_dai_link { | |||
| 896 | const struct device_node *codec_of_node; | 912 | const struct device_node *codec_of_node; |
| 897 | /* You MUST specify the DAI name within the codec */ | 913 | /* You MUST specify the DAI name within the codec */ |
| 898 | const char *codec_dai_name; | 914 | const char *codec_dai_name; |
| 915 | |||
| 916 | struct snd_soc_dai_link_component *codecs; | ||
| 917 | unsigned int num_codecs; | ||
| 918 | |||
| 899 | /* | 919 | /* |
| 900 | * You MAY specify the link's platform/PCM/DMA driver, either by | 920 | * You MAY specify the link's platform/PCM/DMA driver, either by |
| 901 | * device name, or by DT/OF node, but not both. Some forms of link | 921 | * device name, or by DT/OF node, but not both. Some forms of link |
| @@ -1047,7 +1067,6 @@ struct snd_soc_card { | |||
| 1047 | 1067 | ||
| 1048 | /* lists of probed devices belonging to this card */ | 1068 | /* lists of probed devices belonging to this card */ |
| 1049 | struct list_head codec_dev_list; | 1069 | struct list_head codec_dev_list; |
| 1050 | struct list_head platform_dev_list; | ||
| 1051 | 1070 | ||
| 1052 | struct list_head widgets; | 1071 | struct list_head widgets; |
| 1053 | struct list_head paths; | 1072 | struct list_head paths; |
| @@ -1094,6 +1113,9 @@ struct snd_soc_pcm_runtime { | |||
| 1094 | struct snd_soc_dai *codec_dai; | 1113 | struct snd_soc_dai *codec_dai; |
| 1095 | struct snd_soc_dai *cpu_dai; | 1114 | struct snd_soc_dai *cpu_dai; |
| 1096 | 1115 | ||
| 1116 | struct snd_soc_dai **codec_dais; | ||
| 1117 | unsigned int num_codecs; | ||
| 1118 | |||
| 1097 | struct delayed_work delayed_work; | 1119 | struct delayed_work delayed_work; |
| 1098 | #ifdef CONFIG_DEBUG_FS | 1120 | #ifdef CONFIG_DEBUG_FS |
| 1099 | struct dentry *debugfs_dpcm_root; | 1121 | struct dentry *debugfs_dpcm_root; |
| @@ -1119,6 +1141,9 @@ struct soc_bytes { | |||
| 1119 | 1141 | ||
| 1120 | struct soc_bytes_ext { | 1142 | struct soc_bytes_ext { |
| 1121 | int max; | 1143 | int max; |
| 1144 | /* used for TLV byte control */ | ||
| 1145 | int (*get)(unsigned int __user *bytes, unsigned int size); | ||
| 1146 | int (*put)(const unsigned int __user *bytes, unsigned int size); | ||
| 1122 | }; | 1147 | }; |
| 1123 | 1148 | ||
| 1124 | /* multi register control */ | 1149 | /* multi register control */ |
| @@ -1165,6 +1190,21 @@ static inline struct snd_soc_platform *snd_soc_component_to_platform( | |||
| 1165 | } | 1190 | } |
| 1166 | 1191 | ||
| 1167 | /** | 1192 | /** |
| 1193 | * snd_soc_dapm_to_component() - Casts a DAPM context to the component it is | ||
| 1194 | * embedded in | ||
| 1195 | * @dapm: The DAPM context to cast to the component | ||
| 1196 | * | ||
| 1197 | * This function must only be used on DAPM contexts that are known to be part of | ||
| 1198 | * a component (e.g. in a component driver). Otherwise the behavior is | ||
| 1199 | * undefined. | ||
| 1200 | */ | ||
| 1201 | static inline struct snd_soc_component *snd_soc_dapm_to_component( | ||
| 1202 | struct snd_soc_dapm_context *dapm) | ||
| 1203 | { | ||
| 1204 | return container_of(dapm, struct snd_soc_component, dapm); | ||
| 1205 | } | ||
| 1206 | |||
| 1207 | /** | ||
| 1168 | * snd_soc_dapm_to_codec() - Casts a DAPM context to the CODEC it is embedded in | 1208 | * snd_soc_dapm_to_codec() - Casts a DAPM context to the CODEC it is embedded in |
| 1169 | * @dapm: The DAPM context to cast to the CODEC | 1209 | * @dapm: The DAPM context to cast to the CODEC |
| 1170 | * | 1210 | * |
| @@ -1188,7 +1228,18 @@ static inline struct snd_soc_codec *snd_soc_dapm_to_codec( | |||
| 1188 | static inline struct snd_soc_platform *snd_soc_dapm_to_platform( | 1228 | static inline struct snd_soc_platform *snd_soc_dapm_to_platform( |
| 1189 | struct snd_soc_dapm_context *dapm) | 1229 | struct snd_soc_dapm_context *dapm) |
| 1190 | { | 1230 | { |
| 1191 | return container_of(dapm, struct snd_soc_platform, dapm); | 1231 | return snd_soc_component_to_platform(snd_soc_dapm_to_component(dapm)); |
| 1232 | } | ||
| 1233 | |||
| 1234 | /** | ||
| 1235 | * snd_soc_component_get_dapm() - Returns the DAPM context associated with a | ||
| 1236 | * component | ||
| 1237 | * @component: The component for which to get the DAPM context | ||
| 1238 | */ | ||
| 1239 | static inline struct snd_soc_dapm_context *snd_soc_component_get_dapm( | ||
| 1240 | struct snd_soc_component *component) | ||
| 1241 | { | ||
| 1242 | return component->dapm_ptr; | ||
| 1192 | } | 1243 | } |
| 1193 | 1244 | ||
| 1194 | /* codec IO */ | 1245 | /* codec IO */ |
| @@ -1261,7 +1312,6 @@ static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd) | |||
| 1261 | static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) | 1312 | static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) |
| 1262 | { | 1313 | { |
| 1263 | INIT_LIST_HEAD(&card->codec_dev_list); | 1314 | INIT_LIST_HEAD(&card->codec_dev_list); |
| 1264 | INIT_LIST_HEAD(&card->platform_dev_list); | ||
| 1265 | INIT_LIST_HEAD(&card->widgets); | 1315 | INIT_LIST_HEAD(&card->widgets); |
| 1266 | INIT_LIST_HEAD(&card->paths); | 1316 | INIT_LIST_HEAD(&card->paths); |
| 1267 | INIT_LIST_HEAD(&card->dapm_list); | 1317 | INIT_LIST_HEAD(&card->dapm_list); |
diff --git a/include/sound/tas2552-plat.h b/include/sound/tas2552-plat.h new file mode 100644 index 000000000000..65e7627ba38e --- /dev/null +++ b/include/sound/tas2552-plat.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* | ||
| 2 | * TAS2552 driver platform header | ||
| 3 | * | ||
| 4 | * Copyright (C) 2014 Texas Instruments Inc. | ||
| 5 | * | ||
| 6 | * Author: Dan Murphy <dmurphy@ti.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public License | ||
| 10 | * version 2 as published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef TAS2552_PLAT_H | ||
| 19 | #define TAS2552_PLAT_H | ||
| 20 | |||
| 21 | struct tas2552_platform_data { | ||
| 22 | int enable_gpio; | ||
| 23 | }; | ||
| 24 | |||
| 25 | #endif | ||
diff --git a/include/sound/wm8962.h b/include/sound/wm8962.h index 79e6d427b858..0af7c1674cbf 100644 --- a/include/sound/wm8962.h +++ b/include/sound/wm8962.h | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #define WM8962_GPIO_FN_MICSCD 22 | 37 | #define WM8962_GPIO_FN_MICSCD 22 |
| 38 | 38 | ||
| 39 | struct wm8962_pdata { | 39 | struct wm8962_pdata { |
| 40 | struct clk *mclk; | ||
| 40 | int gpio_base; | 41 | int gpio_base; |
| 41 | u32 gpio_init[WM8962_MAX_GPIO]; | 42 | u32 gpio_init[WM8962_MAX_GPIO]; |
| 42 | 43 | ||
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h index c75c795a377b..0194a641e4e2 100644 --- a/include/trace/events/asoc.h +++ b/include/trace/events/asoc.h | |||
| @@ -296,17 +296,17 @@ TRACE_EVENT(snd_soc_cache_sync, | |||
| 296 | TP_ARGS(codec, type, status), | 296 | TP_ARGS(codec, type, status), |
| 297 | 297 | ||
| 298 | TP_STRUCT__entry( | 298 | TP_STRUCT__entry( |
| 299 | __string( name, codec->name ) | 299 | __string( name, codec->component.name) |
| 300 | __string( status, status ) | 300 | __string( status, status ) |
| 301 | __string( type, type ) | 301 | __string( type, type ) |
| 302 | __field( int, id ) | 302 | __field( int, id ) |
| 303 | ), | 303 | ), |
| 304 | 304 | ||
| 305 | TP_fast_assign( | 305 | TP_fast_assign( |
| 306 | __assign_str(name, codec->name); | 306 | __assign_str(name, codec->component.name); |
| 307 | __assign_str(status, status); | 307 | __assign_str(status, status); |
| 308 | __assign_str(type, type); | 308 | __assign_str(type, type); |
| 309 | __entry->id = codec->id; | 309 | __entry->id = codec->component.id; |
| 310 | ), | 310 | ), |
| 311 | 311 | ||
| 312 | TP_printk("codec=%s.%d type=%s status=%s", __get_str(name), | 312 | TP_printk("codec=%s.%d type=%s status=%s", __get_str(name), |
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index b983990b4a9f..d06d44363fea 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h | |||
| @@ -587,6 +587,69 @@ TRACE_EVENT(f2fs_fallocate, | |||
| 587 | __entry->ret) | 587 | __entry->ret) |
| 588 | ); | 588 | ); |
| 589 | 589 | ||
| 590 | TRACE_EVENT(f2fs_direct_IO_enter, | ||
| 591 | |||
| 592 | TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw), | ||
| 593 | |||
| 594 | TP_ARGS(inode, offset, len, rw), | ||
| 595 | |||
| 596 | TP_STRUCT__entry( | ||
| 597 | __field(dev_t, dev) | ||
| 598 | __field(ino_t, ino) | ||
| 599 | __field(loff_t, pos) | ||
| 600 | __field(unsigned long, len) | ||
| 601 | __field(int, rw) | ||
| 602 | ), | ||
| 603 | |||
| 604 | TP_fast_assign( | ||
| 605 | __entry->dev = inode->i_sb->s_dev; | ||
| 606 | __entry->ino = inode->i_ino; | ||
| 607 | __entry->pos = offset; | ||
| 608 | __entry->len = len; | ||
| 609 | __entry->rw = rw; | ||
| 610 | ), | ||
| 611 | |||
| 612 | TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d", | ||
| 613 | show_dev_ino(__entry), | ||
| 614 | __entry->pos, | ||
| 615 | __entry->len, | ||
| 616 | __entry->rw) | ||
| 617 | ); | ||
| 618 | |||
| 619 | TRACE_EVENT(f2fs_direct_IO_exit, | ||
| 620 | |||
| 621 | TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, | ||
| 622 | int rw, int ret), | ||
| 623 | |||
| 624 | TP_ARGS(inode, offset, len, rw, ret), | ||
| 625 | |||
| 626 | TP_STRUCT__entry( | ||
| 627 | __field(dev_t, dev) | ||
| 628 | __field(ino_t, ino) | ||
| 629 | __field(loff_t, pos) | ||
| 630 | __field(unsigned long, len) | ||
| 631 | __field(int, rw) | ||
| 632 | __field(int, ret) | ||
| 633 | ), | ||
| 634 | |||
| 635 | TP_fast_assign( | ||
| 636 | __entry->dev = inode->i_sb->s_dev; | ||
| 637 | __entry->ino = inode->i_ino; | ||
| 638 | __entry->pos = offset; | ||
| 639 | __entry->len = len; | ||
| 640 | __entry->rw = rw; | ||
| 641 | __entry->ret = ret; | ||
| 642 | ), | ||
| 643 | |||
| 644 | TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu " | ||
| 645 | "rw = %d ret = %d", | ||
| 646 | show_dev_ino(__entry), | ||
| 647 | __entry->pos, | ||
| 648 | __entry->len, | ||
| 649 | __entry->rw, | ||
| 650 | __entry->ret) | ||
| 651 | ); | ||
| 652 | |||
| 590 | TRACE_EVENT(f2fs_reserve_new_block, | 653 | TRACE_EVENT(f2fs_reserve_new_block, |
| 591 | 654 | ||
| 592 | TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node), | 655 | TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node), |
| @@ -926,6 +989,30 @@ TRACE_EVENT(f2fs_issue_discard, | |||
| 926 | (unsigned long long)__entry->blkstart, | 989 | (unsigned long long)__entry->blkstart, |
| 927 | (unsigned long long)__entry->blklen) | 990 | (unsigned long long)__entry->blklen) |
| 928 | ); | 991 | ); |
| 992 | |||
| 993 | TRACE_EVENT(f2fs_issue_flush, | ||
| 994 | |||
| 995 | TP_PROTO(struct super_block *sb, bool nobarrier, bool flush_merge), | ||
| 996 | |||
| 997 | TP_ARGS(sb, nobarrier, flush_merge), | ||
| 998 | |||
| 999 | TP_STRUCT__entry( | ||
| 1000 | __field(dev_t, dev) | ||
| 1001 | __field(bool, nobarrier) | ||
| 1002 | __field(bool, flush_merge) | ||
| 1003 | ), | ||
| 1004 | |||
| 1005 | TP_fast_assign( | ||
| 1006 | __entry->dev = sb->s_dev; | ||
| 1007 | __entry->nobarrier = nobarrier; | ||
| 1008 | __entry->flush_merge = flush_merge; | ||
| 1009 | ), | ||
| 1010 | |||
| 1011 | TP_printk("dev = (%d,%d), %s %s", | ||
| 1012 | show_dev(__entry), | ||
| 1013 | __entry->nobarrier ? "skip (nobarrier)" : "issue", | ||
| 1014 | __entry->flush_merge ? " with flush_merge" : "") | ||
| 1015 | ); | ||
| 929 | #endif /* _TRACE_F2FS_H */ | 1016 | #endif /* _TRACE_F2FS_H */ |
| 930 | 1017 | ||
| 931 | /* This part must be outside protection */ | 1018 | /* This part must be outside protection */ |
diff --git a/include/trace/events/fence.h b/include/trace/events/fence.h new file mode 100644 index 000000000000..98feb1b82896 --- /dev/null +++ b/include/trace/events/fence.h | |||
| @@ -0,0 +1,128 @@ | |||
| 1 | #undef TRACE_SYSTEM | ||
| 2 | #define TRACE_SYSTEM fence | ||
| 3 | |||
| 4 | #if !defined(_TRACE_FENCE_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 5 | #define _TRACE_FENCE_H | ||
| 6 | |||
| 7 | #include <linux/tracepoint.h> | ||
| 8 | |||
| 9 | struct fence; | ||
| 10 | |||
| 11 | TRACE_EVENT(fence_annotate_wait_on, | ||
| 12 | |||
| 13 | /* fence: the fence waiting on f1, f1: the fence to be waited on. */ | ||
| 14 | TP_PROTO(struct fence *fence, struct fence *f1), | ||
| 15 | |||
| 16 | TP_ARGS(fence, f1), | ||
| 17 | |||
| 18 | TP_STRUCT__entry( | ||
| 19 | __string(driver, fence->ops->get_driver_name(fence)) | ||
| 20 | __string(timeline, fence->ops->get_driver_name(fence)) | ||
| 21 | __field(unsigned int, context) | ||
| 22 | __field(unsigned int, seqno) | ||
| 23 | |||
| 24 | __string(waiting_driver, f1->ops->get_driver_name(f1)) | ||
| 25 | __string(waiting_timeline, f1->ops->get_timeline_name(f1)) | ||
| 26 | __field(unsigned int, waiting_context) | ||
| 27 | __field(unsigned int, waiting_seqno) | ||
| 28 | ), | ||
| 29 | |||
| 30 | TP_fast_assign( | ||
| 31 | __assign_str(driver, fence->ops->get_driver_name(fence)) | ||
| 32 | __assign_str(timeline, fence->ops->get_timeline_name(fence)) | ||
| 33 | __entry->context = fence->context; | ||
| 34 | __entry->seqno = fence->seqno; | ||
| 35 | |||
| 36 | __assign_str(waiting_driver, f1->ops->get_driver_name(f1)) | ||
| 37 | __assign_str(waiting_timeline, f1->ops->get_timeline_name(f1)) | ||
| 38 | __entry->waiting_context = f1->context; | ||
| 39 | __entry->waiting_seqno = f1->seqno; | ||
| 40 | |||
| 41 | ), | ||
| 42 | |||
| 43 | TP_printk("driver=%s timeline=%s context=%u seqno=%u " \ | ||
| 44 | "waits on driver=%s timeline=%s context=%u seqno=%u", | ||
| 45 | __get_str(driver), __get_str(timeline), __entry->context, | ||
| 46 | __entry->seqno, | ||
| 47 | __get_str(waiting_driver), __get_str(waiting_timeline), | ||
| 48 | __entry->waiting_context, __entry->waiting_seqno) | ||
| 49 | ); | ||
| 50 | |||
| 51 | DECLARE_EVENT_CLASS(fence, | ||
| 52 | |||
| 53 | TP_PROTO(struct fence *fence), | ||
| 54 | |||
| 55 | TP_ARGS(fence), | ||
| 56 | |||
| 57 | TP_STRUCT__entry( | ||
| 58 | __string(driver, fence->ops->get_driver_name(fence)) | ||
| 59 | __string(timeline, fence->ops->get_timeline_name(fence)) | ||
| 60 | __field(unsigned int, context) | ||
| 61 | __field(unsigned int, seqno) | ||
| 62 | ), | ||
| 63 | |||
| 64 | TP_fast_assign( | ||
| 65 | __assign_str(driver, fence->ops->get_driver_name(fence)) | ||
| 66 | __assign_str(timeline, fence->ops->get_timeline_name(fence)) | ||
| 67 | __entry->context = fence->context; | ||
| 68 | __entry->seqno = fence->seqno; | ||
| 69 | ), | ||
| 70 | |||
| 71 | TP_printk("driver=%s timeline=%s context=%u seqno=%u", | ||
| 72 | __get_str(driver), __get_str(timeline), __entry->context, | ||
| 73 | __entry->seqno) | ||
| 74 | ); | ||
| 75 | |||
| 76 | DEFINE_EVENT(fence, fence_emit, | ||
| 77 | |||
| 78 | TP_PROTO(struct fence *fence), | ||
| 79 | |||
| 80 | TP_ARGS(fence) | ||
| 81 | ); | ||
| 82 | |||
| 83 | DEFINE_EVENT(fence, fence_init, | ||
| 84 | |||
| 85 | TP_PROTO(struct fence *fence), | ||
| 86 | |||
| 87 | TP_ARGS(fence) | ||
| 88 | ); | ||
| 89 | |||
| 90 | DEFINE_EVENT(fence, fence_destroy, | ||
| 91 | |||
| 92 | TP_PROTO(struct fence *fence), | ||
| 93 | |||
| 94 | TP_ARGS(fence) | ||
| 95 | ); | ||
| 96 | |||
| 97 | DEFINE_EVENT(fence, fence_enable_signal, | ||
| 98 | |||
| 99 | TP_PROTO(struct fence *fence), | ||
| 100 | |||
| 101 | TP_ARGS(fence) | ||
| 102 | ); | ||
| 103 | |||
| 104 | DEFINE_EVENT(fence, fence_signaled, | ||
| 105 | |||
| 106 | TP_PROTO(struct fence *fence), | ||
| 107 | |||
| 108 | TP_ARGS(fence) | ||
| 109 | ); | ||
| 110 | |||
| 111 | DEFINE_EVENT(fence, fence_wait_start, | ||
| 112 | |||
| 113 | TP_PROTO(struct fence *fence), | ||
| 114 | |||
| 115 | TP_ARGS(fence) | ||
| 116 | ); | ||
| 117 | |||
| 118 | DEFINE_EVENT(fence, fence_wait_end, | ||
| 119 | |||
| 120 | TP_PROTO(struct fence *fence), | ||
| 121 | |||
| 122 | TP_ARGS(fence) | ||
| 123 | ); | ||
| 124 | |||
| 125 | #endif /* _TRACE_FENCE_H */ | ||
| 126 | |||
| 127 | /* This part must be outside protection */ | ||
| 128 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/ras.h b/include/trace/events/ras.h deleted file mode 100644 index 1c875ad1ee5f..000000000000 --- a/include/trace/events/ras.h +++ /dev/null | |||
| @@ -1,77 +0,0 @@ | |||
| 1 | #undef TRACE_SYSTEM | ||
| 2 | #define TRACE_SYSTEM ras | ||
| 3 | |||
| 4 | #if !defined(_TRACE_AER_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 5 | #define _TRACE_AER_H | ||
| 6 | |||
| 7 | #include <linux/tracepoint.h> | ||
| 8 | #include <linux/aer.h> | ||
| 9 | |||
| 10 | |||
| 11 | /* | ||
| 12 | * PCIe AER Trace event | ||
| 13 | * | ||
| 14 | * These events are generated when hardware detects a corrected or | ||
| 15 | * uncorrected event on a PCIe device. The event report has | ||
| 16 | * the following structure: | ||
| 17 | * | ||
| 18 | * char * dev_name - The name of the slot where the device resides | ||
| 19 | * ([domain:]bus:device.function). | ||
| 20 | * u32 status - Either the correctable or uncorrectable register | ||
| 21 | * indicating what error or errors have been seen | ||
| 22 | * u8 severity - error severity 0:NONFATAL 1:FATAL 2:CORRECTED | ||
| 23 | */ | ||
| 24 | |||
| 25 | #define aer_correctable_errors \ | ||
| 26 | {BIT(0), "Receiver Error"}, \ | ||
| 27 | {BIT(6), "Bad TLP"}, \ | ||
| 28 | {BIT(7), "Bad DLLP"}, \ | ||
| 29 | {BIT(8), "RELAY_NUM Rollover"}, \ | ||
| 30 | {BIT(12), "Replay Timer Timeout"}, \ | ||
| 31 | {BIT(13), "Advisory Non-Fatal"} | ||
| 32 | |||
| 33 | #define aer_uncorrectable_errors \ | ||
| 34 | {BIT(4), "Data Link Protocol"}, \ | ||
| 35 | {BIT(12), "Poisoned TLP"}, \ | ||
| 36 | {BIT(13), "Flow Control Protocol"}, \ | ||
| 37 | {BIT(14), "Completion Timeout"}, \ | ||
| 38 | {BIT(15), "Completer Abort"}, \ | ||
| 39 | {BIT(16), "Unexpected Completion"}, \ | ||
| 40 | {BIT(17), "Receiver Overflow"}, \ | ||
| 41 | {BIT(18), "Malformed TLP"}, \ | ||
| 42 | {BIT(19), "ECRC"}, \ | ||
| 43 | {BIT(20), "Unsupported Request"} | ||
| 44 | |||
| 45 | TRACE_EVENT(aer_event, | ||
| 46 | TP_PROTO(const char *dev_name, | ||
| 47 | const u32 status, | ||
| 48 | const u8 severity), | ||
| 49 | |||
| 50 | TP_ARGS(dev_name, status, severity), | ||
| 51 | |||
| 52 | TP_STRUCT__entry( | ||
| 53 | __string( dev_name, dev_name ) | ||
| 54 | __field( u32, status ) | ||
| 55 | __field( u8, severity ) | ||
| 56 | ), | ||
| 57 | |||
| 58 | TP_fast_assign( | ||
| 59 | __assign_str(dev_name, dev_name); | ||
| 60 | __entry->status = status; | ||
| 61 | __entry->severity = severity; | ||
| 62 | ), | ||
| 63 | |||
| 64 | TP_printk("%s PCIe Bus Error: severity=%s, %s\n", | ||
| 65 | __get_str(dev_name), | ||
| 66 | __entry->severity == AER_CORRECTABLE ? "Corrected" : | ||
| 67 | __entry->severity == AER_FATAL ? | ||
| 68 | "Fatal" : "Uncorrected, non-fatal", | ||
| 69 | __entry->severity == AER_CORRECTABLE ? | ||
| 70 | __print_flags(__entry->status, "|", aer_correctable_errors) : | ||
| 71 | __print_flags(__entry->status, "|", aer_uncorrectable_errors)) | ||
| 72 | ); | ||
| 73 | |||
| 74 | #endif /* _TRACE_AER_H */ | ||
| 75 | |||
| 76 | /* This part must be outside protection */ | ||
| 77 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/tlb.h b/include/trace/events/tlb.h new file mode 100644 index 000000000000..13391d288107 --- /dev/null +++ b/include/trace/events/tlb.h | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | #undef TRACE_SYSTEM | ||
| 2 | #define TRACE_SYSTEM tlb | ||
| 3 | |||
| 4 | #if !defined(_TRACE_TLB_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 5 | #define _TRACE_TLB_H | ||
| 6 | |||
| 7 | #include <linux/mm_types.h> | ||
| 8 | #include <linux/tracepoint.h> | ||
| 9 | |||
| 10 | #define TLB_FLUSH_REASON \ | ||
| 11 | { TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" }, \ | ||
| 12 | { TLB_REMOTE_SHOOTDOWN, "remote shootdown" }, \ | ||
| 13 | { TLB_LOCAL_SHOOTDOWN, "local shootdown" }, \ | ||
| 14 | { TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" } | ||
| 15 | |||
| 16 | TRACE_EVENT(tlb_flush, | ||
| 17 | |||
| 18 | TP_PROTO(int reason, unsigned long pages), | ||
| 19 | TP_ARGS(reason, pages), | ||
| 20 | |||
| 21 | TP_STRUCT__entry( | ||
| 22 | __field( int, reason) | ||
| 23 | __field(unsigned long, pages) | ||
| 24 | ), | ||
| 25 | |||
| 26 | TP_fast_assign( | ||
| 27 | __entry->reason = reason; | ||
| 28 | __entry->pages = pages; | ||
| 29 | ), | ||
| 30 | |||
| 31 | TP_printk("pages:%ld reason:%s (%d)", | ||
| 32 | __entry->pages, | ||
| 33 | __print_symbolic(__entry->reason, TLB_FLUSH_REASON), | ||
| 34 | __entry->reason) | ||
| 35 | ); | ||
| 36 | |||
| 37 | #endif /* _TRACE_TLB_H */ | ||
| 38 | |||
| 39 | /* This part must be outside protection */ | ||
| 40 | #include <trace/define_trace.h> | ||
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 333640608087..f1afd607f043 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h | |||
| @@ -699,9 +699,13 @@ __SYSCALL(__NR_sched_setattr, sys_sched_setattr) | |||
| 699 | __SYSCALL(__NR_sched_getattr, sys_sched_getattr) | 699 | __SYSCALL(__NR_sched_getattr, sys_sched_getattr) |
| 700 | #define __NR_renameat2 276 | 700 | #define __NR_renameat2 276 |
| 701 | __SYSCALL(__NR_renameat2, sys_renameat2) | 701 | __SYSCALL(__NR_renameat2, sys_renameat2) |
| 702 | #define __NR_seccomp 277 | ||
| 703 | __SYSCALL(__NR_seccomp, sys_seccomp) | ||
| 704 | #define __NR_getrandom 278 | ||
| 705 | __SYSCALL(__NR_getrandom, sys_getrandom) | ||
| 702 | 706 | ||
| 703 | #undef __NR_syscalls | 707 | #undef __NR_syscalls |
| 704 | #define __NR_syscalls 277 | 708 | #define __NR_syscalls 279 |
| 705 | 709 | ||
| 706 | /* | 710 | /* |
| 707 | * All syscalls below here should go away really, | 711 | * All syscalls below here should go away really, |
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h index cf6714752b69..3b9ff33e1768 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h | |||
| @@ -342,6 +342,7 @@ enum { | |||
| 342 | #define __AUDIT_ARCH_64BIT 0x80000000 | 342 | #define __AUDIT_ARCH_64BIT 0x80000000 |
| 343 | #define __AUDIT_ARCH_LE 0x40000000 | 343 | #define __AUDIT_ARCH_LE 0x40000000 |
| 344 | 344 | ||
| 345 | #define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) | ||
| 345 | #define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) | 346 | #define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) |
| 346 | #define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE) | 347 | #define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE) |
| 347 | #define AUDIT_ARCH_ARMEB (EM_ARM) | 348 | #define AUDIT_ARCH_ARMEB (EM_ARM) |
diff --git a/include/uapi/linux/can/netlink.h b/include/uapi/linux/can/netlink.h index 813d11f54977..3e4323a3918d 100644 --- a/include/uapi/linux/can/netlink.h +++ b/include/uapi/linux/can/netlink.h | |||
| @@ -92,11 +92,12 @@ struct can_ctrlmode { | |||
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | #define CAN_CTRLMODE_LOOPBACK 0x01 /* Loopback mode */ | 94 | #define CAN_CTRLMODE_LOOPBACK 0x01 /* Loopback mode */ |
| 95 | #define CAN_CTRLMODE_LISTENONLY 0x02 /* Listen-only mode */ | 95 | #define CAN_CTRLMODE_LISTENONLY 0x02 /* Listen-only mode */ |
| 96 | #define CAN_CTRLMODE_3_SAMPLES 0x04 /* Triple sampling mode */ | 96 | #define CAN_CTRLMODE_3_SAMPLES 0x04 /* Triple sampling mode */ |
| 97 | #define CAN_CTRLMODE_ONE_SHOT 0x08 /* One-Shot mode */ | 97 | #define CAN_CTRLMODE_ONE_SHOT 0x08 /* One-Shot mode */ |
| 98 | #define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */ | 98 | #define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */ |
| 99 | #define CAN_CTRLMODE_FD 0x20 /* CAN FD mode */ | 99 | #define CAN_CTRLMODE_FD 0x20 /* CAN FD mode */ |
| 100 | #define CAN_CTRLMODE_PRESUME_ACK 0x40 /* Ignore missing CAN ACKs */ | ||
| 100 | 101 | ||
| 101 | /* | 102 | /* |
| 102 | * CAN device statistics | 103 | * CAN device statistics |
diff --git a/include/uapi/linux/dcbnl.h b/include/uapi/linux/dcbnl.h index 6bb43382f3f3..e711f20dc522 100644 --- a/include/uapi/linux/dcbnl.h +++ b/include/uapi/linux/dcbnl.h | |||
| @@ -148,7 +148,8 @@ struct cee_pfc { | |||
| 148 | * | 148 | * |
| 149 | * @selector: protocol identifier type | 149 | * @selector: protocol identifier type |
| 150 | * @protocol: protocol of type indicated | 150 | * @protocol: protocol of type indicated |
| 151 | * @priority: 3-bit unsigned integer indicating priority | 151 | * @priority: 3-bit unsigned integer indicating priority for IEEE |
| 152 | * 8-bit 802.1p user priority bitmap for CEE | ||
| 152 | * | 153 | * |
| 153 | * ---- | 154 | * ---- |
| 154 | * Selector field values | 155 | * Selector field values |
diff --git a/include/uapi/linux/errqueue.h b/include/uapi/linux/errqueue.h index aacd4fb7102a..07bdce1f444a 100644 --- a/include/uapi/linux/errqueue.h +++ b/include/uapi/linux/errqueue.h | |||
| @@ -22,5 +22,25 @@ struct sock_extended_err { | |||
| 22 | 22 | ||
| 23 | #define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1)) | 23 | #define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1)) |
| 24 | 24 | ||
| 25 | /** | ||
| 26 | * struct scm_timestamping - timestamps exposed through cmsg | ||
| 27 | * | ||
| 28 | * The timestamping interfaces SO_TIMESTAMPING, MSG_TSTAMP_* | ||
| 29 | * communicate network timestamps by passing this struct in a cmsg with | ||
| 30 | * recvmsg(). See Documentation/networking/timestamping.txt for details. | ||
| 31 | */ | ||
| 32 | struct scm_timestamping { | ||
| 33 | struct timespec ts[3]; | ||
| 34 | }; | ||
| 35 | |||
| 36 | /* The type of scm_timestamping, passed in sock_extended_err ee_info. | ||
| 37 | * This defines the type of ts[0]. For SCM_TSTAMP_SND only, if ts[0] | ||
| 38 | * is zero, then this is a hardware timestamp and recorded in ts[2]. | ||
| 39 | */ | ||
| 40 | enum { | ||
| 41 | SCM_TSTAMP_SND, /* driver passed skb to NIC, or HW */ | ||
| 42 | SCM_TSTAMP_SCHED, /* data entered the packet scheduler */ | ||
| 43 | SCM_TSTAMP_ACK, /* data acknowledged by peer */ | ||
| 44 | }; | ||
| 25 | 45 | ||
| 26 | #endif /* _UAPI_LINUX_ERRQUEUE_H */ | 46 | #endif /* _UAPI_LINUX_ERRQUEUE_H */ |
diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h index 40b5ca8a1b1f..25084a052a1e 100644 --- a/include/uapi/linux/fuse.h +++ b/include/uapi/linux/fuse.h | |||
| @@ -101,6 +101,7 @@ | |||
| 101 | * - add FATTR_CTIME | 101 | * - add FATTR_CTIME |
| 102 | * - add ctime and ctimensec to fuse_setattr_in | 102 | * - add ctime and ctimensec to fuse_setattr_in |
| 103 | * - add FUSE_RENAME2 request | 103 | * - add FUSE_RENAME2 request |
| 104 | * - add FUSE_NO_OPEN_SUPPORT flag | ||
| 104 | */ | 105 | */ |
| 105 | 106 | ||
| 106 | #ifndef _LINUX_FUSE_H | 107 | #ifndef _LINUX_FUSE_H |
| @@ -229,6 +230,7 @@ struct fuse_file_lock { | |||
| 229 | * FUSE_READDIRPLUS_AUTO: adaptive readdirplus | 230 | * FUSE_READDIRPLUS_AUTO: adaptive readdirplus |
| 230 | * FUSE_ASYNC_DIO: asynchronous direct I/O submission | 231 | * FUSE_ASYNC_DIO: asynchronous direct I/O submission |
| 231 | * FUSE_WRITEBACK_CACHE: use writeback cache for buffered writes | 232 | * FUSE_WRITEBACK_CACHE: use writeback cache for buffered writes |
| 233 | * FUSE_NO_OPEN_SUPPORT: kernel supports zero-message opens | ||
| 232 | */ | 234 | */ |
| 233 | #define FUSE_ASYNC_READ (1 << 0) | 235 | #define FUSE_ASYNC_READ (1 << 0) |
| 234 | #define FUSE_POSIX_LOCKS (1 << 1) | 236 | #define FUSE_POSIX_LOCKS (1 << 1) |
| @@ -247,6 +249,7 @@ struct fuse_file_lock { | |||
| 247 | #define FUSE_READDIRPLUS_AUTO (1 << 14) | 249 | #define FUSE_READDIRPLUS_AUTO (1 << 14) |
| 248 | #define FUSE_ASYNC_DIO (1 << 15) | 250 | #define FUSE_ASYNC_DIO (1 << 15) |
| 249 | #define FUSE_WRITEBACK_CACHE (1 << 16) | 251 | #define FUSE_WRITEBACK_CACHE (1 << 16) |
| 252 | #define FUSE_NO_OPEN_SUPPORT (1 << 17) | ||
| 250 | 253 | ||
| 251 | /** | 254 | /** |
| 252 | * CUSE INIT request/reply flags | 255 | * CUSE INIT request/reply flags |
diff --git a/include/uapi/linux/genwqe/genwqe_card.h b/include/uapi/linux/genwqe/genwqe_card.h index 795e957bb840..4fc065f29255 100644 --- a/include/uapi/linux/genwqe/genwqe_card.h +++ b/include/uapi/linux/genwqe/genwqe_card.h | |||
| @@ -328,6 +328,7 @@ enum genwqe_card_state { | |||
| 328 | GENWQE_CARD_UNUSED = 0, | 328 | GENWQE_CARD_UNUSED = 0, |
| 329 | GENWQE_CARD_USED = 1, | 329 | GENWQE_CARD_USED = 1, |
| 330 | GENWQE_CARD_FATAL_ERROR = 2, | 330 | GENWQE_CARD_FATAL_ERROR = 2, |
| 331 | GENWQE_CARD_RELOAD_BITSTREAM = 3, | ||
| 331 | GENWQE_CARD_STATE_MAX, | 332 | GENWQE_CARD_STATE_MAX, |
| 332 | }; | 333 | }; |
| 333 | 334 | ||
diff --git a/include/uapi/linux/i8k.h b/include/uapi/linux/i8k.h index 1c45ba505115..133d02f03c25 100644 --- a/include/uapi/linux/i8k.h +++ b/include/uapi/linux/i8k.h | |||
| @@ -34,7 +34,8 @@ | |||
| 34 | #define I8K_FAN_OFF 0 | 34 | #define I8K_FAN_OFF 0 |
| 35 | #define I8K_FAN_LOW 1 | 35 | #define I8K_FAN_LOW 1 |
| 36 | #define I8K_FAN_HIGH 2 | 36 | #define I8K_FAN_HIGH 2 |
| 37 | #define I8K_FAN_MAX I8K_FAN_HIGH | 37 | #define I8K_FAN_TURBO 3 |
| 38 | #define I8K_FAN_MAX I8K_FAN_TURBO | ||
| 38 | 39 | ||
| 39 | #define I8K_VOL_UP 1 | 40 | #define I8K_VOL_UP 1 |
| 40 | #define I8K_VOL_DOWN 2 | 41 | #define I8K_VOL_DOWN 2 |
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index b38534895db5..ff957604a721 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
| @@ -204,11 +204,17 @@ enum { | |||
| 204 | IFLA_INET6_CACHEINFO, /* time values and max reasm size */ | 204 | IFLA_INET6_CACHEINFO, /* time values and max reasm size */ |
| 205 | IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */ | 205 | IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */ |
| 206 | IFLA_INET6_TOKEN, /* device token */ | 206 | IFLA_INET6_TOKEN, /* device token */ |
| 207 | IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */ | ||
| 207 | __IFLA_INET6_MAX | 208 | __IFLA_INET6_MAX |
| 208 | }; | 209 | }; |
| 209 | 210 | ||
| 210 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) | 211 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) |
| 211 | 212 | ||
| 213 | enum in6_addr_gen_mode { | ||
| 214 | IN6_ADDR_GEN_MODE_EUI64, | ||
| 215 | IN6_ADDR_GEN_MODE_NONE, | ||
| 216 | }; | ||
| 217 | |||
| 212 | enum { | 218 | enum { |
| 213 | BRIDGE_MODE_UNSPEC, | 219 | BRIDGE_MODE_UNSPEC, |
| 214 | BRIDGE_MODE_HAIRPIN, | 220 | BRIDGE_MODE_HAIRPIN, |
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h index bac27fa05f5b..da2d668b8cf1 100644 --- a/include/uapi/linux/if_packet.h +++ b/include/uapi/linux/if_packet.h | |||
| @@ -108,7 +108,7 @@ struct tpacket_auxdata { | |||
| 108 | 108 | ||
| 109 | /* Rx and Tx ring - header status */ | 109 | /* Rx and Tx ring - header status */ |
| 110 | #define TP_STATUS_TS_SOFTWARE (1 << 29) | 110 | #define TP_STATUS_TS_SOFTWARE (1 << 29) |
| 111 | #define TP_STATUS_TS_SYS_HARDWARE (1 << 30) | 111 | #define TP_STATUS_TS_SYS_HARDWARE (1 << 30) /* deprecated, never set */ |
| 112 | #define TP_STATUS_TS_RAW_HARDWARE (1 << 31) | 112 | #define TP_STATUS_TS_RAW_HARDWARE (1 << 31) |
| 113 | 113 | ||
| 114 | /* Rx ring - feature request bits */ | 114 | /* Rx ring - feature request bits */ |
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h index 0d8e0f0342dc..22b7a69619d8 100644 --- a/include/uapi/linux/in6.h +++ b/include/uapi/linux/in6.h | |||
| @@ -233,6 +233,7 @@ struct in6_flowlabel_req { | |||
| 233 | #if 0 /* not yet */ | 233 | #if 0 /* not yet */ |
| 234 | #define IPV6_USE_MIN_MTU 63 | 234 | #define IPV6_USE_MIN_MTU 63 |
| 235 | #endif | 235 | #endif |
| 236 | #define IPV6_AUTOFLOWLABEL 64 | ||
| 236 | 237 | ||
| 237 | /* | 238 | /* |
| 238 | * Netfilter (1) | 239 | * Netfilter (1) |
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h index 593b0e32d956..efa2666f4b8a 100644 --- a/include/uapi/linux/ipv6.h +++ b/include/uapi/linux/ipv6.h | |||
| @@ -163,6 +163,7 @@ enum { | |||
| 163 | DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL, | 163 | DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL, |
| 164 | DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL, | 164 | DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL, |
| 165 | DEVCONF_SUPPRESS_FRAG_NDISC, | 165 | DEVCONF_SUPPRESS_FRAG_NDISC, |
| 166 | DEVCONF_ACCEPT_RA_FROM_LOCAL, | ||
| 166 | DEVCONF_MAX | 167 | DEVCONF_MAX |
| 167 | }; | 168 | }; |
| 168 | 169 | ||
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index e11d8f170a62..9b744af871d7 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h | |||
| @@ -399,13 +399,18 @@ struct kvm_vapic_addr { | |||
| 399 | __u64 vapic_addr; | 399 | __u64 vapic_addr; |
| 400 | }; | 400 | }; |
| 401 | 401 | ||
| 402 | /* for KVM_SET_MPSTATE */ | 402 | /* for KVM_SET_MP_STATE */ |
| 403 | 403 | ||
| 404 | /* not all states are valid on all architectures */ | ||
| 404 | #define KVM_MP_STATE_RUNNABLE 0 | 405 | #define KVM_MP_STATE_RUNNABLE 0 |
| 405 | #define KVM_MP_STATE_UNINITIALIZED 1 | 406 | #define KVM_MP_STATE_UNINITIALIZED 1 |
| 406 | #define KVM_MP_STATE_INIT_RECEIVED 2 | 407 | #define KVM_MP_STATE_INIT_RECEIVED 2 |
| 407 | #define KVM_MP_STATE_HALTED 3 | 408 | #define KVM_MP_STATE_HALTED 3 |
| 408 | #define KVM_MP_STATE_SIPI_RECEIVED 4 | 409 | #define KVM_MP_STATE_SIPI_RECEIVED 4 |
| 410 | #define KVM_MP_STATE_STOPPED 5 | ||
| 411 | #define KVM_MP_STATE_CHECK_STOP 6 | ||
| 412 | #define KVM_MP_STATE_OPERATING 7 | ||
| 413 | #define KVM_MP_STATE_LOAD 8 | ||
| 409 | 414 | ||
| 410 | struct kvm_mp_state { | 415 | struct kvm_mp_state { |
| 411 | __u32 mp_state; | 416 | __u32 mp_state; |
diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h index f53879c0f590..ff354021bb69 100644 --- a/include/uapi/linux/net_tstamp.h +++ b/include/uapi/linux/net_tstamp.h | |||
| @@ -20,9 +20,13 @@ enum { | |||
| 20 | SOF_TIMESTAMPING_SOFTWARE = (1<<4), | 20 | SOF_TIMESTAMPING_SOFTWARE = (1<<4), |
| 21 | SOF_TIMESTAMPING_SYS_HARDWARE = (1<<5), | 21 | SOF_TIMESTAMPING_SYS_HARDWARE = (1<<5), |
| 22 | SOF_TIMESTAMPING_RAW_HARDWARE = (1<<6), | 22 | SOF_TIMESTAMPING_RAW_HARDWARE = (1<<6), |
| 23 | SOF_TIMESTAMPING_MASK = | 23 | SOF_TIMESTAMPING_OPT_ID = (1<<7), |
| 24 | (SOF_TIMESTAMPING_RAW_HARDWARE - 1) | | 24 | SOF_TIMESTAMPING_TX_SCHED = (1<<8), |
| 25 | SOF_TIMESTAMPING_RAW_HARDWARE | 25 | SOF_TIMESTAMPING_TX_ACK = (1<<9), |
| 26 | |||
| 27 | SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_TX_ACK, | ||
| 28 | SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) | | ||
| 29 | SOF_TIMESTAMPING_LAST | ||
| 26 | }; | 30 | }; |
| 27 | 31 | ||
| 28 | /** | 32 | /** |
diff --git a/include/uapi/linux/netdevice.h b/include/uapi/linux/netdevice.h index fdfbd1c17065..55818543342d 100644 --- a/include/uapi/linux/netdevice.h +++ b/include/uapi/linux/netdevice.h | |||
| @@ -37,6 +37,12 @@ | |||
| 37 | #define INIT_NETDEV_GROUP 0 | 37 | #define INIT_NETDEV_GROUP 0 |
| 38 | 38 | ||
| 39 | 39 | ||
| 40 | /* interface name assignment types (sysfs name_assign_type attribute) */ | ||
| 41 | #define NET_NAME_UNKNOWN 0 /* unknown origin (not exposed to userspace) */ | ||
| 42 | #define NET_NAME_ENUM 1 /* enumerated by kernel */ | ||
| 43 | #define NET_NAME_PREDICTABLE 2 /* predictably named by the kernel */ | ||
| 44 | #define NET_NAME_USER 3 /* provided by user-space */ | ||
| 45 | #define NET_NAME_RENAMED 4 /* renamed by user-space */ | ||
| 40 | 46 | ||
| 41 | /* Media selection options. */ | 47 | /* Media selection options. */ |
| 42 | enum { | 48 | enum { |
diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h index 2a88f645a5d8..801bdd1e56e3 100644 --- a/include/uapi/linux/netfilter/nf_tables.h +++ b/include/uapi/linux/netfilter/nf_tables.h | |||
| @@ -697,6 +697,8 @@ enum nft_counter_attributes { | |||
| 697 | * @NFTA_LOG_PREFIX: prefix to prepend to log messages (NLA_STRING) | 697 | * @NFTA_LOG_PREFIX: prefix to prepend to log messages (NLA_STRING) |
| 698 | * @NFTA_LOG_SNAPLEN: length of payload to include in netlink message (NLA_U32) | 698 | * @NFTA_LOG_SNAPLEN: length of payload to include in netlink message (NLA_U32) |
| 699 | * @NFTA_LOG_QTHRESHOLD: queue threshold (NLA_U32) | 699 | * @NFTA_LOG_QTHRESHOLD: queue threshold (NLA_U32) |
| 700 | * @NFTA_LOG_LEVEL: log level (NLA_U32) | ||
| 701 | * @NFTA_LOG_FLAGS: logging flags (NLA_U32) | ||
| 700 | */ | 702 | */ |
| 701 | enum nft_log_attributes { | 703 | enum nft_log_attributes { |
| 702 | NFTA_LOG_UNSPEC, | 704 | NFTA_LOG_UNSPEC, |
| @@ -704,6 +706,8 @@ enum nft_log_attributes { | |||
| 704 | NFTA_LOG_PREFIX, | 706 | NFTA_LOG_PREFIX, |
| 705 | NFTA_LOG_SNAPLEN, | 707 | NFTA_LOG_SNAPLEN, |
| 706 | NFTA_LOG_QTHRESHOLD, | 708 | NFTA_LOG_QTHRESHOLD, |
| 709 | NFTA_LOG_LEVEL, | ||
| 710 | NFTA_LOG_FLAGS, | ||
| 707 | __NFTA_LOG_MAX | 711 | __NFTA_LOG_MAX |
| 708 | }; | 712 | }; |
| 709 | #define NFTA_LOG_MAX (__NFTA_LOG_MAX - 1) | 713 | #define NFTA_LOG_MAX (__NFTA_LOG_MAX - 1) |
diff --git a/include/uapi/linux/netfilter/xt_bpf.h b/include/uapi/linux/netfilter/xt_bpf.h index 5dda450eb55b..1fad2c27ac32 100644 --- a/include/uapi/linux/netfilter/xt_bpf.h +++ b/include/uapi/linux/netfilter/xt_bpf.h | |||
| @@ -6,12 +6,14 @@ | |||
| 6 | 6 | ||
| 7 | #define XT_BPF_MAX_NUM_INSTR 64 | 7 | #define XT_BPF_MAX_NUM_INSTR 64 |
| 8 | 8 | ||
| 9 | struct bpf_prog; | ||
| 10 | |||
| 9 | struct xt_bpf_info { | 11 | struct xt_bpf_info { |
| 10 | __u16 bpf_program_num_elem; | 12 | __u16 bpf_program_num_elem; |
| 11 | struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR]; | 13 | struct sock_filter bpf_program[XT_BPF_MAX_NUM_INSTR]; |
| 12 | 14 | ||
| 13 | /* only used in the kernel */ | 15 | /* only used in the kernel */ |
| 14 | struct sk_filter *filter __attribute__((aligned(8))); | 16 | struct bpf_prog *filter __attribute__((aligned(8))); |
| 15 | }; | 17 | }; |
| 16 | 18 | ||
| 17 | #endif /*_XT_BPF_H */ | 19 | #endif /*_XT_BPF_H */ |
diff --git a/include/uapi/linux/netfilter_bridge/Kbuild b/include/uapi/linux/netfilter_bridge/Kbuild index 348717c3a22f..0fbad8ef96de 100644 --- a/include/uapi/linux/netfilter_bridge/Kbuild +++ b/include/uapi/linux/netfilter_bridge/Kbuild | |||
| @@ -14,6 +14,5 @@ header-y += ebt_nflog.h | |||
| 14 | header-y += ebt_pkttype.h | 14 | header-y += ebt_pkttype.h |
| 15 | header-y += ebt_redirect.h | 15 | header-y += ebt_redirect.h |
| 16 | header-y += ebt_stp.h | 16 | header-y += ebt_stp.h |
| 17 | header-y += ebt_ulog.h | ||
| 18 | header-y += ebt_vlan.h | 17 | header-y += ebt_vlan.h |
| 19 | header-y += ebtables.h | 18 | header-y += ebtables.h |
diff --git a/include/uapi/linux/netfilter_bridge/ebt_ulog.h b/include/uapi/linux/netfilter_bridge/ebt_ulog.h deleted file mode 100644 index 89a6becb5269..000000000000 --- a/include/uapi/linux/netfilter_bridge/ebt_ulog.h +++ /dev/null | |||
| @@ -1,38 +0,0 @@ | |||
| 1 | #ifndef _EBT_ULOG_H | ||
| 2 | #define _EBT_ULOG_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | #define EBT_ULOG_DEFAULT_NLGROUP 0 | ||
| 7 | #define EBT_ULOG_DEFAULT_QTHRESHOLD 1 | ||
| 8 | #define EBT_ULOG_MAXNLGROUPS 32 /* hardcoded netlink max */ | ||
| 9 | #define EBT_ULOG_PREFIX_LEN 32 | ||
| 10 | #define EBT_ULOG_MAX_QLEN 50 | ||
| 11 | #define EBT_ULOG_WATCHER "ulog" | ||
| 12 | #define EBT_ULOG_VERSION 1 | ||
| 13 | |||
| 14 | struct ebt_ulog_info { | ||
| 15 | __u32 nlgroup; | ||
| 16 | unsigned int cprange; | ||
| 17 | unsigned int qthreshold; | ||
| 18 | char prefix[EBT_ULOG_PREFIX_LEN]; | ||
| 19 | }; | ||
| 20 | |||
| 21 | typedef struct ebt_ulog_packet_msg { | ||
| 22 | int version; | ||
| 23 | char indev[IFNAMSIZ]; | ||
| 24 | char outdev[IFNAMSIZ]; | ||
| 25 | char physindev[IFNAMSIZ]; | ||
| 26 | char physoutdev[IFNAMSIZ]; | ||
| 27 | char prefix[EBT_ULOG_PREFIX_LEN]; | ||
| 28 | struct timeval stamp; | ||
| 29 | unsigned long mark; | ||
| 30 | unsigned int hook; | ||
| 31 | size_t data_len; | ||
| 32 | /* The complete packet, including Ethernet header and perhaps | ||
| 33 | * the VLAN header is appended */ | ||
| 34 | unsigned char data[0] __attribute__ | ||
| 35 | ((aligned (__alignof__(struct ebt_ulog_info)))); | ||
| 36 | } ebt_ulog_packet_msg_t; | ||
| 37 | |||
| 38 | #endif /* _EBT_ULOG_H */ | ||
diff --git a/include/uapi/linux/netfilter_ipv4/Kbuild b/include/uapi/linux/netfilter_ipv4/Kbuild index fb008437dde1..ecb291df390e 100644 --- a/include/uapi/linux/netfilter_ipv4/Kbuild +++ b/include/uapi/linux/netfilter_ipv4/Kbuild | |||
| @@ -5,7 +5,6 @@ header-y += ipt_ECN.h | |||
| 5 | header-y += ipt_LOG.h | 5 | header-y += ipt_LOG.h |
| 6 | header-y += ipt_REJECT.h | 6 | header-y += ipt_REJECT.h |
| 7 | header-y += ipt_TTL.h | 7 | header-y += ipt_TTL.h |
| 8 | header-y += ipt_ULOG.h | ||
| 9 | header-y += ipt_ah.h | 8 | header-y += ipt_ah.h |
| 10 | header-y += ipt_ecn.h | 9 | header-y += ipt_ecn.h |
| 11 | header-y += ipt_ttl.h | 10 | header-y += ipt_ttl.h |
diff --git a/include/uapi/linux/netfilter_ipv4/ipt_ULOG.h b/include/uapi/linux/netfilter_ipv4/ipt_ULOG.h deleted file mode 100644 index 417aad280bcc..000000000000 --- a/include/uapi/linux/netfilter_ipv4/ipt_ULOG.h +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | /* Header file for IP tables userspace logging, Version 1.8 | ||
| 2 | * | ||
| 3 | * (C) 2000-2002 by Harald Welte <laforge@gnumonks.org> | ||
| 4 | * | ||
| 5 | * Distributed under the terms of GNU GPL */ | ||
| 6 | |||
| 7 | #ifndef _IPT_ULOG_H | ||
| 8 | #define _IPT_ULOG_H | ||
| 9 | |||
| 10 | #ifndef NETLINK_NFLOG | ||
| 11 | #define NETLINK_NFLOG 5 | ||
| 12 | #endif | ||
| 13 | |||
| 14 | #define ULOG_DEFAULT_NLGROUP 1 | ||
| 15 | #define ULOG_DEFAULT_QTHRESHOLD 1 | ||
| 16 | |||
| 17 | #define ULOG_MAC_LEN 80 | ||
| 18 | #define ULOG_PREFIX_LEN 32 | ||
| 19 | |||
| 20 | #define ULOG_MAX_QLEN 50 | ||
| 21 | /* Why 50? Well... there is a limit imposed by the slab cache 131000 | ||
| 22 | * bytes. So the multipart netlink-message has to be < 131000 bytes. | ||
| 23 | * Assuming a standard ethernet-mtu of 1500, we could define this up | ||
| 24 | * to 80... but even 50 seems to be big enough. */ | ||
| 25 | |||
| 26 | /* private data structure for each rule with a ULOG target */ | ||
| 27 | struct ipt_ulog_info { | ||
| 28 | unsigned int nl_group; | ||
| 29 | size_t copy_range; | ||
| 30 | size_t qthreshold; | ||
| 31 | char prefix[ULOG_PREFIX_LEN]; | ||
| 32 | }; | ||
| 33 | |||
| 34 | /* Format of the ULOG packets passed through netlink */ | ||
| 35 | typedef struct ulog_packet_msg { | ||
| 36 | unsigned long mark; | ||
| 37 | long timestamp_sec; | ||
| 38 | long timestamp_usec; | ||
| 39 | unsigned int hook; | ||
| 40 | char indev_name[IFNAMSIZ]; | ||
| 41 | char outdev_name[IFNAMSIZ]; | ||
| 42 | size_t data_len; | ||
| 43 | char prefix[ULOG_PREFIX_LEN]; | ||
| 44 | unsigned char mac_len; | ||
| 45 | unsigned char mac[ULOG_MAC_LEN]; | ||
| 46 | unsigned char payload[0]; | ||
| 47 | } ulog_packet_msg_t; | ||
| 48 | |||
| 49 | #endif /*_IPT_ULOG_H*/ | ||
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index be9519b52bb1..f1db15b9c041 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
| @@ -1591,6 +1591,9 @@ enum nl80211_commands { | |||
| 1591 | * creation then the new interface will be owned by the netlink socket | 1591 | * creation then the new interface will be owned by the netlink socket |
| 1592 | * that created it and will be destroyed when the socket is closed | 1592 | * that created it and will be destroyed when the socket is closed |
| 1593 | * | 1593 | * |
| 1594 | * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is | ||
| 1595 | * the TDLS link initiator. | ||
| 1596 | * | ||
| 1594 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1597 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 1595 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1598 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| 1596 | */ | 1599 | */ |
| @@ -1931,6 +1934,8 @@ enum nl80211_attrs { | |||
| 1931 | NL80211_ATTR_CSA_C_OFFSETS_TX, | 1934 | NL80211_ATTR_CSA_C_OFFSETS_TX, |
| 1932 | NL80211_ATTR_MAX_CSA_COUNTERS, | 1935 | NL80211_ATTR_MAX_CSA_COUNTERS, |
| 1933 | 1936 | ||
| 1937 | NL80211_ATTR_TDLS_INITIATOR, | ||
| 1938 | |||
| 1934 | /* add attributes here, update the policy in nl80211.c */ | 1939 | /* add attributes here, update the policy in nl80211.c */ |
| 1935 | 1940 | ||
| 1936 | __NL80211_ATTR_AFTER_LAST, | 1941 | __NL80211_ATTR_AFTER_LAST, |
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h index 0b979ee4bfc0..a794d1dd7b40 100644 --- a/include/uapi/linux/openvswitch.h +++ b/include/uapi/linux/openvswitch.h | |||
| @@ -118,6 +118,9 @@ struct ovs_vport_stats { | |||
| 118 | /* Allow last Netlink attribute to be unaligned */ | 118 | /* Allow last Netlink attribute to be unaligned */ |
| 119 | #define OVS_DP_F_UNALIGNED (1 << 0) | 119 | #define OVS_DP_F_UNALIGNED (1 << 0) |
| 120 | 120 | ||
| 121 | /* Allow datapath to associate multiple Netlink PIDs to each vport */ | ||
| 122 | #define OVS_DP_F_VPORT_PIDS (1 << 1) | ||
| 123 | |||
| 121 | /* Fixed logical ports. */ | 124 | /* Fixed logical ports. */ |
| 122 | #define OVSP_LOCAL ((__u32)0) | 125 | #define OVSP_LOCAL ((__u32)0) |
| 123 | 126 | ||
| @@ -203,9 +206,10 @@ enum ovs_vport_type { | |||
| 203 | * this is the name of the network device. Maximum length %IFNAMSIZ-1 bytes | 206 | * this is the name of the network device. Maximum length %IFNAMSIZ-1 bytes |
| 204 | * plus a null terminator. | 207 | * plus a null terminator. |
| 205 | * @OVS_VPORT_ATTR_OPTIONS: Vport-specific configuration information. | 208 | * @OVS_VPORT_ATTR_OPTIONS: Vport-specific configuration information. |
| 206 | * @OVS_VPORT_ATTR_UPCALL_PID: The Netlink socket in userspace that | 209 | * @OVS_VPORT_ATTR_UPCALL_PID: The array of Netlink socket pids in userspace |
| 207 | * OVS_PACKET_CMD_MISS upcalls will be directed to for packets received on | 210 | * among which OVS_PACKET_CMD_MISS upcalls will be distributed for packets |
| 208 | * this port. A value of zero indicates that upcalls should not be sent. | 211 | * received on this port. If this is a single-element array of value 0, |
| 212 | * upcalls should not be sent. | ||
| 209 | * @OVS_VPORT_ATTR_STATS: A &struct ovs_vport_stats giving statistics for | 213 | * @OVS_VPORT_ATTR_STATS: A &struct ovs_vport_stats giving statistics for |
| 210 | * packets sent or received through the vport. | 214 | * packets sent or received through the vport. |
| 211 | * | 215 | * |
| @@ -228,7 +232,8 @@ enum ovs_vport_attr { | |||
| 228 | OVS_VPORT_ATTR_TYPE, /* u32 OVS_VPORT_TYPE_* constant. */ | 232 | OVS_VPORT_ATTR_TYPE, /* u32 OVS_VPORT_TYPE_* constant. */ |
| 229 | OVS_VPORT_ATTR_NAME, /* string name, up to IFNAMSIZ bytes long */ | 233 | OVS_VPORT_ATTR_NAME, /* string name, up to IFNAMSIZ bytes long */ |
| 230 | OVS_VPORT_ATTR_OPTIONS, /* nested attributes, varies by vport type */ | 234 | OVS_VPORT_ATTR_OPTIONS, /* nested attributes, varies by vport type */ |
| 231 | OVS_VPORT_ATTR_UPCALL_PID, /* u32 Netlink PID to receive upcalls */ | 235 | OVS_VPORT_ATTR_UPCALL_PID, /* array of u32 Netlink socket PIDs for */ |
| 236 | /* receiving upcalls */ | ||
| 232 | OVS_VPORT_ATTR_STATS, /* struct ovs_vport_stats */ | 237 | OVS_VPORT_ATTR_STATS, /* struct ovs_vport_stats */ |
| 233 | __OVS_VPORT_ATTR_MAX | 238 | __OVS_VPORT_ATTR_MAX |
| 234 | }; | 239 | }; |
diff --git a/include/uapi/linux/random.h b/include/uapi/linux/random.h index fff3528a078f..3f93d1695e7f 100644 --- a/include/uapi/linux/random.h +++ b/include/uapi/linux/random.h | |||
| @@ -40,4 +40,13 @@ struct rand_pool_info { | |||
| 40 | __u32 buf[0]; | 40 | __u32 buf[0]; |
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | /* | ||
| 44 | * Flags for getrandom(2) | ||
| 45 | * | ||
| 46 | * GRND_NONBLOCK Don't block and return EAGAIN instead | ||
| 47 | * GRND_RANDOM Use the /dev/random pool instead of /dev/urandom | ||
| 48 | */ | ||
| 49 | #define GRND_NONBLOCK 0x0001 | ||
| 50 | #define GRND_RANDOM 0x0002 | ||
| 51 | |||
| 43 | #endif /* _UAPI_LINUX_RANDOM_H */ | 52 | #endif /* _UAPI_LINUX_RANDOM_H */ |
diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h index 266022a2be4a..ce70fe6b45df 100644 --- a/include/uapi/linux/sctp.h +++ b/include/uapi/linux/sctp.h | |||
| @@ -95,6 +95,9 @@ typedef __s32 sctp_assoc_t; | |||
| 95 | #define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */ | 95 | #define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */ |
| 96 | #define SCTP_AUTO_ASCONF 30 | 96 | #define SCTP_AUTO_ASCONF 30 |
| 97 | #define SCTP_PEER_ADDR_THLDS 31 | 97 | #define SCTP_PEER_ADDR_THLDS 31 |
| 98 | #define SCTP_RECVRCVINFO 32 | ||
| 99 | #define SCTP_RECVNXTINFO 33 | ||
| 100 | #define SCTP_DEFAULT_SNDINFO 34 | ||
| 98 | 101 | ||
| 99 | /* Internal Socket Options. Some of the sctp library functions are | 102 | /* Internal Socket Options. Some of the sctp library functions are |
| 100 | * implemented using these socket options. | 103 | * implemented using these socket options. |
| @@ -110,8 +113,14 @@ typedef __s32 sctp_assoc_t; | |||
| 110 | #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ | 113 | #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ |
| 111 | #define SCTP_GET_ASSOC_STATS 112 /* Read only */ | 114 | #define SCTP_GET_ASSOC_STATS 112 /* Read only */ |
| 112 | 115 | ||
| 113 | /* | 116 | /* These are bit fields for msghdr->msg_flags. See section 5.1. */ |
| 114 | * 5.2.1 SCTP Initiation Structure (SCTP_INIT) | 117 | /* On user space Linux, these live in <bits/socket.h> as an enum. */ |
| 118 | enum sctp_msg_flags { | ||
| 119 | MSG_NOTIFICATION = 0x8000, | ||
| 120 | #define MSG_NOTIFICATION MSG_NOTIFICATION | ||
| 121 | }; | ||
| 122 | |||
| 123 | /* 5.3.1 SCTP Initiation Structure (SCTP_INIT) | ||
| 115 | * | 124 | * |
| 116 | * This cmsghdr structure provides information for initializing new | 125 | * This cmsghdr structure provides information for initializing new |
| 117 | * SCTP associations with sendmsg(). The SCTP_INITMSG socket option | 126 | * SCTP associations with sendmsg(). The SCTP_INITMSG socket option |
| @@ -121,7 +130,6 @@ typedef __s32 sctp_assoc_t; | |||
| 121 | * cmsg_level cmsg_type cmsg_data[] | 130 | * cmsg_level cmsg_type cmsg_data[] |
| 122 | * ------------ ------------ ---------------------- | 131 | * ------------ ------------ ---------------------- |
| 123 | * IPPROTO_SCTP SCTP_INIT struct sctp_initmsg | 132 | * IPPROTO_SCTP SCTP_INIT struct sctp_initmsg |
| 124 | * | ||
| 125 | */ | 133 | */ |
| 126 | struct sctp_initmsg { | 134 | struct sctp_initmsg { |
| 127 | __u16 sinit_num_ostreams; | 135 | __u16 sinit_num_ostreams; |
| @@ -130,8 +138,7 @@ struct sctp_initmsg { | |||
| 130 | __u16 sinit_max_init_timeo; | 138 | __u16 sinit_max_init_timeo; |
| 131 | }; | 139 | }; |
| 132 | 140 | ||
| 133 | /* | 141 | /* 5.3.2 SCTP Header Information Structure (SCTP_SNDRCV) |
| 134 | * 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) | ||
| 135 | * | 142 | * |
| 136 | * This cmsghdr structure specifies SCTP options for sendmsg() and | 143 | * This cmsghdr structure specifies SCTP options for sendmsg() and |
| 137 | * describes SCTP header information about a received message through | 144 | * describes SCTP header information about a received message through |
| @@ -140,7 +147,6 @@ struct sctp_initmsg { | |||
| 140 | * cmsg_level cmsg_type cmsg_data[] | 147 | * cmsg_level cmsg_type cmsg_data[] |
| 141 | * ------------ ------------ ---------------------- | 148 | * ------------ ------------ ---------------------- |
| 142 | * IPPROTO_SCTP SCTP_SNDRCV struct sctp_sndrcvinfo | 149 | * IPPROTO_SCTP SCTP_SNDRCV struct sctp_sndrcvinfo |
| 143 | * | ||
| 144 | */ | 150 | */ |
| 145 | struct sctp_sndrcvinfo { | 151 | struct sctp_sndrcvinfo { |
| 146 | __u16 sinfo_stream; | 152 | __u16 sinfo_stream; |
| @@ -154,19 +160,74 @@ struct sctp_sndrcvinfo { | |||
| 154 | sctp_assoc_t sinfo_assoc_id; | 160 | sctp_assoc_t sinfo_assoc_id; |
| 155 | }; | 161 | }; |
| 156 | 162 | ||
| 163 | /* 5.3.4 SCTP Send Information Structure (SCTP_SNDINFO) | ||
| 164 | * | ||
| 165 | * This cmsghdr structure specifies SCTP options for sendmsg(). | ||
| 166 | * | ||
| 167 | * cmsg_level cmsg_type cmsg_data[] | ||
| 168 | * ------------ ------------ ------------------- | ||
| 169 | * IPPROTO_SCTP SCTP_SNDINFO struct sctp_sndinfo | ||
| 170 | */ | ||
| 171 | struct sctp_sndinfo { | ||
| 172 | __u16 snd_sid; | ||
| 173 | __u16 snd_flags; | ||
| 174 | __u32 snd_ppid; | ||
| 175 | __u32 snd_context; | ||
| 176 | sctp_assoc_t snd_assoc_id; | ||
| 177 | }; | ||
| 178 | |||
| 179 | /* 5.3.5 SCTP Receive Information Structure (SCTP_RCVINFO) | ||
| 180 | * | ||
| 181 | * This cmsghdr structure describes SCTP receive information | ||
| 182 | * about a received message through recvmsg(). | ||
| 183 | * | ||
| 184 | * cmsg_level cmsg_type cmsg_data[] | ||
| 185 | * ------------ ------------ ------------------- | ||
| 186 | * IPPROTO_SCTP SCTP_RCVINFO struct sctp_rcvinfo | ||
| 187 | */ | ||
| 188 | struct sctp_rcvinfo { | ||
| 189 | __u16 rcv_sid; | ||
| 190 | __u16 rcv_ssn; | ||
| 191 | __u16 rcv_flags; | ||
| 192 | __u32 rcv_ppid; | ||
| 193 | __u32 rcv_tsn; | ||
| 194 | __u32 rcv_cumtsn; | ||
| 195 | __u32 rcv_context; | ||
| 196 | sctp_assoc_t rcv_assoc_id; | ||
| 197 | }; | ||
| 198 | |||
| 199 | /* 5.3.6 SCTP Next Receive Information Structure (SCTP_NXTINFO) | ||
| 200 | * | ||
| 201 | * This cmsghdr structure describes SCTP receive information | ||
| 202 | * of the next message that will be delivered through recvmsg() | ||
| 203 | * if this information is already available when delivering | ||
| 204 | * the current message. | ||
| 205 | * | ||
| 206 | * cmsg_level cmsg_type cmsg_data[] | ||
| 207 | * ------------ ------------ ------------------- | ||
| 208 | * IPPROTO_SCTP SCTP_NXTINFO struct sctp_nxtinfo | ||
| 209 | */ | ||
| 210 | struct sctp_nxtinfo { | ||
| 211 | __u16 nxt_sid; | ||
| 212 | __u16 nxt_flags; | ||
| 213 | __u32 nxt_ppid; | ||
| 214 | __u32 nxt_length; | ||
| 215 | sctp_assoc_t nxt_assoc_id; | ||
| 216 | }; | ||
| 217 | |||
| 157 | /* | 218 | /* |
| 158 | * sinfo_flags: 16 bits (unsigned integer) | 219 | * sinfo_flags: 16 bits (unsigned integer) |
| 159 | * | 220 | * |
| 160 | * This field may contain any of the following flags and is composed of | 221 | * This field may contain any of the following flags and is composed of |
| 161 | * a bitwise OR of these values. | 222 | * a bitwise OR of these values. |
| 162 | */ | 223 | */ |
| 163 | |||
| 164 | enum sctp_sinfo_flags { | 224 | enum sctp_sinfo_flags { |
| 165 | SCTP_UNORDERED = 1, /* Send/receive message unordered. */ | 225 | SCTP_UNORDERED = (1 << 0), /* Send/receive message unordered. */ |
| 166 | SCTP_ADDR_OVER = 2, /* Override the primary destination. */ | 226 | SCTP_ADDR_OVER = (1 << 1), /* Override the primary destination. */ |
| 167 | SCTP_ABORT=4, /* Send an ABORT message to the peer. */ | 227 | SCTP_ABORT = (1 << 2), /* Send an ABORT message to the peer. */ |
| 168 | SCTP_SACK_IMMEDIATELY = 8, /* SACK should be sent without delay */ | 228 | SCTP_SACK_IMMEDIATELY = (1 << 3), /* SACK should be sent without delay. */ |
| 169 | SCTP_EOF=MSG_FIN, /* Initiate graceful shutdown process. */ | 229 | SCTP_NOTIFICATION = MSG_NOTIFICATION, /* Next message is not user msg but notification. */ |
| 230 | SCTP_EOF = MSG_FIN, /* Initiate graceful shutdown process. */ | ||
| 170 | }; | 231 | }; |
| 171 | 232 | ||
| 172 | typedef union { | 233 | typedef union { |
| @@ -177,10 +238,16 @@ typedef union { | |||
| 177 | 238 | ||
| 178 | /* These are cmsg_types. */ | 239 | /* These are cmsg_types. */ |
| 179 | typedef enum sctp_cmsg_type { | 240 | typedef enum sctp_cmsg_type { |
| 180 | SCTP_INIT, /* 5.2.1 SCTP Initiation Structure */ | 241 | SCTP_INIT, /* 5.2.1 SCTP Initiation Structure */ |
| 181 | #define SCTP_INIT SCTP_INIT | 242 | #define SCTP_INIT SCTP_INIT |
| 182 | SCTP_SNDRCV, /* 5.2.2 SCTP Header Information Structure */ | 243 | SCTP_SNDRCV, /* 5.2.2 SCTP Header Information Structure */ |
| 183 | #define SCTP_SNDRCV SCTP_SNDRCV | 244 | #define SCTP_SNDRCV SCTP_SNDRCV |
| 245 | SCTP_SNDINFO, /* 5.3.4 SCTP Send Information Structure */ | ||
| 246 | #define SCTP_SNDINFO SCTP_SNDINFO | ||
| 247 | SCTP_RCVINFO, /* 5.3.5 SCTP Receive Information Structure */ | ||
| 248 | #define SCTP_RCVINFO SCTP_RCVINFO | ||
| 249 | SCTP_NXTINFO, /* 5.3.6 SCTP Next Receive Information Structure */ | ||
| 250 | #define SCTP_NXTINFO SCTP_NXTINFO | ||
| 184 | } sctp_cmsg_t; | 251 | } sctp_cmsg_t; |
| 185 | 252 | ||
| 186 | /* | 253 | /* |
| @@ -808,13 +875,6 @@ struct sctp_assoc_stats { | |||
| 808 | __u64 sas_ictrlchunks; /* Control chunks received */ | 875 | __u64 sas_ictrlchunks; /* Control chunks received */ |
| 809 | }; | 876 | }; |
| 810 | 877 | ||
| 811 | /* These are bit fields for msghdr->msg_flags. See section 5.1. */ | ||
| 812 | /* On user space Linux, these live in <bits/socket.h> as an enum. */ | ||
| 813 | enum sctp_msg_flags { | ||
| 814 | MSG_NOTIFICATION = 0x8000, | ||
| 815 | #define MSG_NOTIFICATION MSG_NOTIFICATION | ||
| 816 | }; | ||
| 817 | |||
| 818 | /* | 878 | /* |
| 819 | * 8.1 sctp_bindx() | 879 | * 8.1 sctp_bindx() |
| 820 | * | 880 | * |
diff --git a/include/uapi/linux/seccomp.h b/include/uapi/linux/seccomp.h index ac2dc9f72973..0f238a43ff1e 100644 --- a/include/uapi/linux/seccomp.h +++ b/include/uapi/linux/seccomp.h | |||
| @@ -10,6 +10,13 @@ | |||
| 10 | #define SECCOMP_MODE_STRICT 1 /* uses hard-coded filter. */ | 10 | #define SECCOMP_MODE_STRICT 1 /* uses hard-coded filter. */ |
| 11 | #define SECCOMP_MODE_FILTER 2 /* uses user-supplied filter. */ | 11 | #define SECCOMP_MODE_FILTER 2 /* uses user-supplied filter. */ |
| 12 | 12 | ||
| 13 | /* Valid operations for seccomp syscall. */ | ||
| 14 | #define SECCOMP_SET_MODE_STRICT 0 | ||
| 15 | #define SECCOMP_SET_MODE_FILTER 1 | ||
| 16 | |||
| 17 | /* Valid flags for SECCOMP_SET_MODE_FILTER */ | ||
| 18 | #define SECCOMP_FILTER_FLAG_TSYNC 1 | ||
| 19 | |||
| 13 | /* | 20 | /* |
| 14 | * All BPF programs must return a 32-bit value. | 21 | * All BPF programs must return a 32-bit value. |
| 15 | * The bottom 16-bits are for optional return data. | 22 | * The bottom 16-bits are for optional return data. |
diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h index 99b47058816a..df6c9ab6b0cd 100644 --- a/include/uapi/linux/serial_reg.h +++ b/include/uapi/linux/serial_reg.h | |||
| @@ -88,6 +88,11 @@ | |||
| 88 | #define UART_FCR6_T_TRIGGER_30 0x30 /* Mask for transmit trigger set at 30 */ | 88 | #define UART_FCR6_T_TRIGGER_30 0x30 /* Mask for transmit trigger set at 30 */ |
| 89 | #define UART_FCR7_64BYTE 0x20 /* Go into 64 byte mode (TI16C750) */ | 89 | #define UART_FCR7_64BYTE 0x20 /* Go into 64 byte mode (TI16C750) */ |
| 90 | 90 | ||
| 91 | #define UART_FCR_R_TRIG_SHIFT 6 | ||
| 92 | #define UART_FCR_R_TRIG_BITS(x) \ | ||
| 93 | (((x) & UART_FCR_TRIGGER_MASK) >> UART_FCR_R_TRIG_SHIFT) | ||
| 94 | #define UART_FCR_R_TRIG_MAX_STATE 4 | ||
| 95 | |||
| 91 | #define UART_LCR 3 /* Out: Line Control Register */ | 96 | #define UART_LCR 3 /* Out: Line Control Register */ |
| 92 | /* | 97 | /* |
| 93 | * Note: if the word length is 5 bits (UART_LCR_WLEN5), then setting | 98 | * Note: if the word length is 5 bits (UART_LCR_WLEN5), then setting |
diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h index 6d6721341f49..43aaba1cc037 100644 --- a/include/uapi/linux/sysctl.h +++ b/include/uapi/linux/sysctl.h | |||
| @@ -568,6 +568,7 @@ enum { | |||
| 568 | NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22, | 568 | NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22, |
| 569 | NET_IPV6_PROXY_NDP=23, | 569 | NET_IPV6_PROXY_NDP=23, |
| 570 | NET_IPV6_ACCEPT_SOURCE_ROUTE=25, | 570 | NET_IPV6_ACCEPT_SOURCE_ROUTE=25, |
| 571 | NET_IPV6_ACCEPT_RA_FROM_LOCAL=26, | ||
| 571 | __NET_IPV6_MAX | 572 | __NET_IPV6_MAX |
| 572 | }; | 573 | }; |
| 573 | 574 | ||
diff --git a/include/uapi/linux/tipc_config.h b/include/uapi/linux/tipc_config.h index 41a76acbb305..876d0a14863c 100644 --- a/include/uapi/linux/tipc_config.h +++ b/include/uapi/linux/tipc_config.h | |||
| @@ -182,7 +182,7 @@ | |||
| 182 | 182 | ||
| 183 | #define TIPC_MIN_LINK_WIN 16 | 183 | #define TIPC_MIN_LINK_WIN 16 |
| 184 | #define TIPC_DEF_LINK_WIN 50 | 184 | #define TIPC_DEF_LINK_WIN 50 |
| 185 | #define TIPC_MAX_LINK_WIN 150 | 185 | #define TIPC_MAX_LINK_WIN 8191 |
| 186 | 186 | ||
| 187 | 187 | ||
| 188 | struct tipc_node_info { | 188 | struct tipc_node_info { |
diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h index 24b68c59dcf8..0154b2859fd7 100644 --- a/include/uapi/linux/usb/functionfs.h +++ b/include/uapi/linux/usb/functionfs.h | |||
| @@ -18,10 +18,9 @@ enum functionfs_flags { | |||
| 18 | FUNCTIONFS_HAS_FS_DESC = 1, | 18 | FUNCTIONFS_HAS_FS_DESC = 1, |
| 19 | FUNCTIONFS_HAS_HS_DESC = 2, | 19 | FUNCTIONFS_HAS_HS_DESC = 2, |
| 20 | FUNCTIONFS_HAS_SS_DESC = 4, | 20 | FUNCTIONFS_HAS_SS_DESC = 4, |
| 21 | FUNCTIONFS_HAS_MS_OS_DESC = 8, | ||
| 21 | }; | 22 | }; |
| 22 | 23 | ||
| 23 | #ifndef __KERNEL__ | ||
| 24 | |||
| 25 | /* Descriptor of an non-audio endpoint */ | 24 | /* Descriptor of an non-audio endpoint */ |
| 26 | struct usb_endpoint_descriptor_no_audio { | 25 | struct usb_endpoint_descriptor_no_audio { |
| 27 | __u8 bLength; | 26 | __u8 bLength; |
| @@ -41,6 +40,37 @@ struct usb_functionfs_descs_head { | |||
| 41 | __le32 hs_count; | 40 | __le32 hs_count; |
| 42 | } __attribute__((packed, deprecated)); | 41 | } __attribute__((packed, deprecated)); |
| 43 | 42 | ||
| 43 | /* MS OS Descriptor header */ | ||
| 44 | struct usb_os_desc_header { | ||
| 45 | __u8 interface; | ||
| 46 | __le32 dwLength; | ||
| 47 | __le16 bcdVersion; | ||
| 48 | __le16 wIndex; | ||
| 49 | union { | ||
| 50 | struct { | ||
| 51 | __u8 bCount; | ||
| 52 | __u8 Reserved; | ||
| 53 | }; | ||
| 54 | __le16 wCount; | ||
| 55 | }; | ||
| 56 | } __attribute__((packed)); | ||
| 57 | |||
| 58 | struct usb_ext_compat_desc { | ||
| 59 | __u8 bFirstInterfaceNumber; | ||
| 60 | __u8 Reserved1; | ||
| 61 | __u8 CompatibleID[8]; | ||
| 62 | __u8 SubCompatibleID[8]; | ||
| 63 | __u8 Reserved2[6]; | ||
| 64 | }; | ||
| 65 | |||
| 66 | struct usb_ext_prop_desc { | ||
| 67 | __le32 dwSize; | ||
| 68 | __le32 dwPropertyDataType; | ||
| 69 | __le16 wPropertyNameLength; | ||
| 70 | } __attribute__((packed)); | ||
| 71 | |||
| 72 | #ifndef __KERNEL__ | ||
| 73 | |||
| 44 | /* | 74 | /* |
| 45 | * Descriptors format: | 75 | * Descriptors format: |
| 46 | * | 76 | * |
| @@ -52,9 +82,11 @@ struct usb_functionfs_descs_head { | |||
| 52 | * | | fs_count | LE32 | number of full-speed descriptors | | 82 | * | | fs_count | LE32 | number of full-speed descriptors | |
| 53 | * | | hs_count | LE32 | number of high-speed descriptors | | 83 | * | | hs_count | LE32 | number of high-speed descriptors | |
| 54 | * | | ss_count | LE32 | number of super-speed descriptors | | 84 | * | | ss_count | LE32 | number of super-speed descriptors | |
| 85 | * | | os_count | LE32 | number of MS OS descriptors | | ||
| 55 | * | | fs_descrs | Descriptor[] | list of full-speed descriptors | | 86 | * | | fs_descrs | Descriptor[] | list of full-speed descriptors | |
| 56 | * | | hs_descrs | Descriptor[] | list of high-speed descriptors | | 87 | * | | hs_descrs | Descriptor[] | list of high-speed descriptors | |
| 57 | * | | ss_descrs | Descriptor[] | list of super-speed descriptors | | 88 | * | | ss_descrs | Descriptor[] | list of super-speed descriptors | |
| 89 | * | | os_descrs | OSDesc[] | list of MS OS descriptors | | ||
| 58 | * | 90 | * |
| 59 | * Depending on which flags are set, various fields may be missing in the | 91 | * Depending on which flags are set, various fields may be missing in the |
| 60 | * structure. Any flags that are not recognised cause the whole block to be | 92 | * structure. Any flags that are not recognised cause the whole block to be |
| @@ -81,6 +113,52 @@ struct usb_functionfs_descs_head { | |||
| 81 | * | 0 | bLength | U8 | length of the descriptor | | 113 | * | 0 | bLength | U8 | length of the descriptor | |
| 82 | * | 1 | bDescriptorType | U8 | descriptor type | | 114 | * | 1 | bDescriptorType | U8 | descriptor type | |
| 83 | * | 2 | payload | | descriptor's payload | | 115 | * | 2 | payload | | descriptor's payload | |
| 116 | * | ||
| 117 | * OSDesc[] is an array of valid MS OS Feature Descriptors which have one of | ||
| 118 | * the following formats: | ||
| 119 | * | ||
| 120 | * | off | name | type | description | | ||
| 121 | * |-----+-----------------+------+--------------------------| | ||
| 122 | * | 0 | inteface | U8 | related interface number | | ||
| 123 | * | 1 | dwLength | U32 | length of the descriptor | | ||
| 124 | * | 5 | bcdVersion | U16 | currently supported: 1 | | ||
| 125 | * | 7 | wIndex | U16 | currently supported: 4 | | ||
| 126 | * | 9 | bCount | U8 | number of ext. compat. | | ||
| 127 | * | 10 | Reserved | U8 | 0 | | ||
| 128 | * | 11 | ExtCompat[] | | list of ext. compat. d. | | ||
| 129 | * | ||
| 130 | * | off | name | type | description | | ||
| 131 | * |-----+-----------------+------+--------------------------| | ||
| 132 | * | 0 | inteface | U8 | related interface number | | ||
| 133 | * | 1 | dwLength | U32 | length of the descriptor | | ||
| 134 | * | 5 | bcdVersion | U16 | currently supported: 1 | | ||
| 135 | * | 7 | wIndex | U16 | currently supported: 5 | | ||
| 136 | * | 9 | wCount | U16 | number of ext. compat. | | ||
| 137 | * | 11 | ExtProp[] | | list of ext. prop. d. | | ||
| 138 | * | ||
| 139 | * ExtCompat[] is an array of valid Extended Compatiblity descriptors | ||
| 140 | * which have the following format: | ||
| 141 | * | ||
| 142 | * | off | name | type | description | | ||
| 143 | * |-----+-----------------------+------+-------------------------------------| | ||
| 144 | * | 0 | bFirstInterfaceNumber | U8 | index of the interface or of the 1st| | ||
| 145 | * | | | | interface in an IAD group | | ||
| 146 | * | 1 | Reserved | U8 | 0 | | ||
| 147 | * | 2 | CompatibleID | U8[8]| compatible ID string | | ||
| 148 | * | 10 | SubCompatibleID | U8[8]| subcompatible ID string | | ||
| 149 | * | 18 | Reserved | U8[6]| 0 | | ||
| 150 | * | ||
| 151 | * ExtProp[] is an array of valid Extended Properties descriptors | ||
| 152 | * which have the following format: | ||
| 153 | * | ||
| 154 | * | off | name | type | description | | ||
| 155 | * |-----+-----------------------+------+-------------------------------------| | ||
| 156 | * | 0 | dwSize | U32 | length of the descriptor | | ||
| 157 | * | 4 | dwPropertyDataType | U32 | 1..7 | | ||
| 158 | * | 8 | wPropertyNameLength | U16 | bPropertyName length (NL) | | ||
| 159 | * | 10 | bPropertyName |U8[NL]| name of this property | | ||
| 160 | * |10+NL| dwPropertyDataLength | U32 | bPropertyData length (DL) | | ||
| 161 | * |14+NL| bProperty |U8[DL]| payload of this property | | ||
| 84 | */ | 162 | */ |
| 85 | 163 | ||
| 86 | struct usb_functionfs_strings_head { | 164 | struct usb_functionfs_strings_head { |
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 2ac5597f3ee1..e946e43fb8d5 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h | |||
| @@ -61,6 +61,7 @@ | |||
| 61 | #define V4L2_CTRL_CLASS_DV 0x00a00000 /* Digital Video controls */ | 61 | #define V4L2_CTRL_CLASS_DV 0x00a00000 /* Digital Video controls */ |
| 62 | #define V4L2_CTRL_CLASS_FM_RX 0x00a10000 /* FM Receiver controls */ | 62 | #define V4L2_CTRL_CLASS_FM_RX 0x00a10000 /* FM Receiver controls */ |
| 63 | #define V4L2_CTRL_CLASS_RF_TUNER 0x00a20000 /* RF tuner controls */ | 63 | #define V4L2_CTRL_CLASS_RF_TUNER 0x00a20000 /* RF tuner controls */ |
| 64 | #define V4L2_CTRL_CLASS_DETECT 0x00a30000 /* Detection controls */ | ||
| 64 | 65 | ||
| 65 | /* User-class control IDs */ | 66 | /* User-class control IDs */ |
| 66 | 67 | ||
| @@ -756,6 +757,15 @@ enum v4l2_auto_focus_range { | |||
| 756 | #define V4L2_CID_RDS_TX_PTY (V4L2_CID_FM_TX_CLASS_BASE + 3) | 757 | #define V4L2_CID_RDS_TX_PTY (V4L2_CID_FM_TX_CLASS_BASE + 3) |
| 757 | #define V4L2_CID_RDS_TX_PS_NAME (V4L2_CID_FM_TX_CLASS_BASE + 5) | 758 | #define V4L2_CID_RDS_TX_PS_NAME (V4L2_CID_FM_TX_CLASS_BASE + 5) |
| 758 | #define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 6) | 759 | #define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 6) |
| 760 | #define V4L2_CID_RDS_TX_MONO_STEREO (V4L2_CID_FM_TX_CLASS_BASE + 7) | ||
| 761 | #define V4L2_CID_RDS_TX_ARTIFICIAL_HEAD (V4L2_CID_FM_TX_CLASS_BASE + 8) | ||
| 762 | #define V4L2_CID_RDS_TX_COMPRESSED (V4L2_CID_FM_TX_CLASS_BASE + 9) | ||
| 763 | #define V4L2_CID_RDS_TX_DYNAMIC_PTY (V4L2_CID_FM_TX_CLASS_BASE + 10) | ||
| 764 | #define V4L2_CID_RDS_TX_TRAFFIC_ANNOUNCEMENT (V4L2_CID_FM_TX_CLASS_BASE + 11) | ||
| 765 | #define V4L2_CID_RDS_TX_TRAFFIC_PROGRAM (V4L2_CID_FM_TX_CLASS_BASE + 12) | ||
| 766 | #define V4L2_CID_RDS_TX_MUSIC_SPEECH (V4L2_CID_FM_TX_CLASS_BASE + 13) | ||
| 767 | #define V4L2_CID_RDS_TX_ALT_FREQS_ENABLE (V4L2_CID_FM_TX_CLASS_BASE + 14) | ||
| 768 | #define V4L2_CID_RDS_TX_ALT_FREQS (V4L2_CID_FM_TX_CLASS_BASE + 15) | ||
| 759 | 769 | ||
| 760 | #define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 64) | 770 | #define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 64) |
| 761 | #define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 65) | 771 | #define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 65) |
| @@ -900,6 +910,12 @@ enum v4l2_deemphasis { | |||
| 900 | }; | 910 | }; |
| 901 | 911 | ||
| 902 | #define V4L2_CID_RDS_RECEPTION (V4L2_CID_FM_RX_CLASS_BASE + 2) | 912 | #define V4L2_CID_RDS_RECEPTION (V4L2_CID_FM_RX_CLASS_BASE + 2) |
| 913 | #define V4L2_CID_RDS_RX_PTY (V4L2_CID_FM_RX_CLASS_BASE + 3) | ||
| 914 | #define V4L2_CID_RDS_RX_PS_NAME (V4L2_CID_FM_RX_CLASS_BASE + 4) | ||
| 915 | #define V4L2_CID_RDS_RX_RADIO_TEXT (V4L2_CID_FM_RX_CLASS_BASE + 5) | ||
| 916 | #define V4L2_CID_RDS_RX_TRAFFIC_ANNOUNCEMENT (V4L2_CID_FM_RX_CLASS_BASE + 6) | ||
| 917 | #define V4L2_CID_RDS_RX_TRAFFIC_PROGRAM (V4L2_CID_FM_RX_CLASS_BASE + 7) | ||
| 918 | #define V4L2_CID_RDS_RX_MUSIC_SPEECH (V4L2_CID_FM_RX_CLASS_BASE + 8) | ||
| 903 | 919 | ||
| 904 | #define V4L2_CID_RF_TUNER_CLASS_BASE (V4L2_CTRL_CLASS_RF_TUNER | 0x900) | 920 | #define V4L2_CID_RF_TUNER_CLASS_BASE (V4L2_CTRL_CLASS_RF_TUNER | 0x900) |
| 905 | #define V4L2_CID_RF_TUNER_CLASS (V4L2_CTRL_CLASS_RF_TUNER | 1) | 921 | #define V4L2_CID_RF_TUNER_CLASS (V4L2_CTRL_CLASS_RF_TUNER | 1) |
| @@ -914,4 +930,20 @@ enum v4l2_deemphasis { | |||
| 914 | #define V4L2_CID_RF_TUNER_IF_GAIN (V4L2_CID_RF_TUNER_CLASS_BASE + 62) | 930 | #define V4L2_CID_RF_TUNER_IF_GAIN (V4L2_CID_RF_TUNER_CLASS_BASE + 62) |
| 915 | #define V4L2_CID_RF_TUNER_PLL_LOCK (V4L2_CID_RF_TUNER_CLASS_BASE + 91) | 931 | #define V4L2_CID_RF_TUNER_PLL_LOCK (V4L2_CID_RF_TUNER_CLASS_BASE + 91) |
| 916 | 932 | ||
| 933 | |||
| 934 | /* Detection-class control IDs defined by V4L2 */ | ||
| 935 | #define V4L2_CID_DETECT_CLASS_BASE (V4L2_CTRL_CLASS_DETECT | 0x900) | ||
| 936 | #define V4L2_CID_DETECT_CLASS (V4L2_CTRL_CLASS_DETECT | 1) | ||
| 937 | |||
| 938 | #define V4L2_CID_DETECT_MD_MODE (V4L2_CID_DETECT_CLASS_BASE + 1) | ||
| 939 | enum v4l2_detect_md_mode { | ||
| 940 | V4L2_DETECT_MD_MODE_DISABLED = 0, | ||
| 941 | V4L2_DETECT_MD_MODE_GLOBAL = 1, | ||
| 942 | V4L2_DETECT_MD_MODE_THRESHOLD_GRID = 2, | ||
| 943 | V4L2_DETECT_MD_MODE_REGION_GRID = 3, | ||
| 944 | }; | ||
| 945 | #define V4L2_CID_DETECT_MD_GLOBAL_THRESHOLD (V4L2_CID_DETECT_CLASS_BASE + 2) | ||
| 946 | #define V4L2_CID_DETECT_MD_THRESHOLD_GRID (V4L2_CID_DETECT_CLASS_BASE + 3) | ||
| 947 | #define V4L2_CID_DETECT_MD_REGION_GRID (V4L2_CID_DETECT_CLASS_BASE + 4) | ||
| 948 | |||
| 917 | #endif | 949 | #endif |
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 168ff507bf75..778a3298fb34 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h | |||
| @@ -124,6 +124,10 @@ enum v4l2_field { | |||
| 124 | (field) == V4L2_FIELD_INTERLACED_BT ||\ | 124 | (field) == V4L2_FIELD_INTERLACED_BT ||\ |
| 125 | (field) == V4L2_FIELD_SEQ_TB ||\ | 125 | (field) == V4L2_FIELD_SEQ_TB ||\ |
| 126 | (field) == V4L2_FIELD_SEQ_BT) | 126 | (field) == V4L2_FIELD_SEQ_BT) |
| 127 | #define V4L2_FIELD_HAS_T_OR_B(field) \ | ||
| 128 | ((field) == V4L2_FIELD_BOTTOM ||\ | ||
| 129 | (field) == V4L2_FIELD_TOP ||\ | ||
| 130 | (field) == V4L2_FIELD_ALTERNATE) | ||
| 127 | 131 | ||
| 128 | enum v4l2_buf_type { | 132 | enum v4l2_buf_type { |
| 129 | V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, | 133 | V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, |
| @@ -268,6 +272,7 @@ struct v4l2_capability { | |||
| 268 | #define V4L2_CAP_MODULATOR 0x00080000 /* has a modulator */ | 272 | #define V4L2_CAP_MODULATOR 0x00080000 /* has a modulator */ |
| 269 | 273 | ||
| 270 | #define V4L2_CAP_SDR_CAPTURE 0x00100000 /* Is a SDR capture device */ | 274 | #define V4L2_CAP_SDR_CAPTURE 0x00100000 /* Is a SDR capture device */ |
| 275 | #define V4L2_CAP_EXT_PIX_FORMAT 0x00200000 /* Supports the extended pixel format */ | ||
| 271 | 276 | ||
| 272 | #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ | 277 | #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ |
| 273 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ | 278 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ |
| @@ -287,6 +292,7 @@ struct v4l2_pix_format { | |||
| 287 | __u32 sizeimage; | 292 | __u32 sizeimage; |
| 288 | __u32 colorspace; /* enum v4l2_colorspace */ | 293 | __u32 colorspace; /* enum v4l2_colorspace */ |
| 289 | __u32 priv; /* private data, depends on pixelformat */ | 294 | __u32 priv; /* private data, depends on pixelformat */ |
| 295 | __u32 flags; /* format flags (V4L2_PIX_FMT_FLAG_*) */ | ||
| 290 | }; | 296 | }; |
| 291 | 297 | ||
| 292 | /* Pixel format FOURCC depth Description */ | 298 | /* Pixel format FOURCC depth Description */ |
| @@ -294,7 +300,11 @@ struct v4l2_pix_format { | |||
| 294 | /* RGB formats */ | 300 | /* RGB formats */ |
| 295 | #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */ | 301 | #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */ |
| 296 | #define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */ | 302 | #define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */ |
| 303 | #define V4L2_PIX_FMT_ARGB444 v4l2_fourcc('A', 'R', '1', '2') /* 16 aaaarrrr ggggbbbb */ | ||
| 304 | #define V4L2_PIX_FMT_XRGB444 v4l2_fourcc('X', 'R', '1', '2') /* 16 xxxxrrrr ggggbbbb */ | ||
| 297 | #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */ | 305 | #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */ |
| 306 | #define V4L2_PIX_FMT_ARGB555 v4l2_fourcc('A', 'R', '1', '5') /* 16 ARGB-1-5-5-5 */ | ||
| 307 | #define V4L2_PIX_FMT_XRGB555 v4l2_fourcc('X', 'R', '1', '5') /* 16 XRGB-1-5-5-5 */ | ||
| 298 | #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */ | 308 | #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */ |
| 299 | #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ | 309 | #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ |
| 300 | #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ | 310 | #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ |
| @@ -302,7 +312,11 @@ struct v4l2_pix_format { | |||
| 302 | #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ | 312 | #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ |
| 303 | #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ | 313 | #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ |
| 304 | #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ | 314 | #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ |
| 315 | #define V4L2_PIX_FMT_ABGR32 v4l2_fourcc('A', 'R', '2', '4') /* 32 BGRA-8-8-8-8 */ | ||
| 316 | #define V4L2_PIX_FMT_XBGR32 v4l2_fourcc('X', 'R', '2', '4') /* 32 BGRX-8-8-8-8 */ | ||
| 305 | #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */ | 317 | #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */ |
| 318 | #define V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4') /* 32 ARGB-8-8-8-8 */ | ||
| 319 | #define V4L2_PIX_FMT_XRGB32 v4l2_fourcc('B', 'X', '2', '4') /* 32 XRGB-8-8-8-8 */ | ||
| 306 | 320 | ||
| 307 | /* Grey formats */ | 321 | /* Grey formats */ |
| 308 | #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ | 322 | #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ |
| @@ -439,6 +453,15 @@ struct v4l2_pix_format { | |||
| 439 | /* SDR formats - used only for Software Defined Radio devices */ | 453 | /* SDR formats - used only for Software Defined Radio devices */ |
| 440 | #define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */ | 454 | #define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */ |
| 441 | #define V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */ | 455 | #define V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */ |
| 456 | #define V4L2_SDR_FMT_CS8 v4l2_fourcc('C', 'S', '0', '8') /* complex s8 */ | ||
| 457 | #define V4L2_SDR_FMT_CS14LE v4l2_fourcc('C', 'S', '1', '4') /* complex s14le */ | ||
| 458 | #define V4L2_SDR_FMT_RU12LE v4l2_fourcc('R', 'U', '1', '2') /* real u12le */ | ||
| 459 | |||
| 460 | /* priv field value to indicates that subsequent fields are valid. */ | ||
| 461 | #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe | ||
| 462 | |||
| 463 | /* Flags */ | ||
| 464 | #define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA 0x00000001 | ||
| 442 | 465 | ||
| 443 | /* | 466 | /* |
| 444 | * F O R M A T E N U M E R A T I O N | 467 | * F O R M A T E N U M E R A T I O N |
| @@ -744,7 +767,16 @@ struct v4l2_framebuffer { | |||
| 744 | /* FIXME: in theory we should pass something like PCI device + memory | 767 | /* FIXME: in theory we should pass something like PCI device + memory |
| 745 | * region + offset instead of some physical address */ | 768 | * region + offset instead of some physical address */ |
| 746 | void *base; | 769 | void *base; |
| 747 | struct v4l2_pix_format fmt; | 770 | struct { |
| 771 | __u32 width; | ||
| 772 | __u32 height; | ||
| 773 | __u32 pixelformat; | ||
| 774 | __u32 field; /* enum v4l2_field */ | ||
| 775 | __u32 bytesperline; /* for padding, zero if unused */ | ||
| 776 | __u32 sizeimage; | ||
| 777 | __u32 colorspace; /* enum v4l2_colorspace */ | ||
| 778 | __u32 priv; /* reserved field, set to 0 */ | ||
| 779 | } fmt; | ||
| 748 | }; | 780 | }; |
| 749 | /* Flags for the 'capability' field. Read only */ | 781 | /* Flags for the 'capability' field. Read only */ |
| 750 | #define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001 | 782 | #define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001 |
| @@ -1254,6 +1286,10 @@ struct v4l2_ext_control { | |||
| 1254 | __s32 value; | 1286 | __s32 value; |
| 1255 | __s64 value64; | 1287 | __s64 value64; |
| 1256 | char *string; | 1288 | char *string; |
| 1289 | __u8 *p_u8; | ||
| 1290 | __u16 *p_u16; | ||
| 1291 | __u32 *p_u32; | ||
| 1292 | void *ptr; | ||
| 1257 | }; | 1293 | }; |
| 1258 | } __attribute__ ((packed)); | 1294 | } __attribute__ ((packed)); |
| 1259 | 1295 | ||
| @@ -1268,6 +1304,7 @@ struct v4l2_ext_controls { | |||
| 1268 | #define V4L2_CTRL_ID_MASK (0x0fffffff) | 1304 | #define V4L2_CTRL_ID_MASK (0x0fffffff) |
| 1269 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) | 1305 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) |
| 1270 | #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) | 1306 | #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) |
| 1307 | #define V4L2_CTRL_MAX_DIMS (4) | ||
| 1271 | 1308 | ||
| 1272 | enum v4l2_ctrl_type { | 1309 | enum v4l2_ctrl_type { |
| 1273 | V4L2_CTRL_TYPE_INTEGER = 1, | 1310 | V4L2_CTRL_TYPE_INTEGER = 1, |
| @@ -1278,7 +1315,13 @@ enum v4l2_ctrl_type { | |||
| 1278 | V4L2_CTRL_TYPE_CTRL_CLASS = 6, | 1315 | V4L2_CTRL_TYPE_CTRL_CLASS = 6, |
| 1279 | V4L2_CTRL_TYPE_STRING = 7, | 1316 | V4L2_CTRL_TYPE_STRING = 7, |
| 1280 | V4L2_CTRL_TYPE_BITMASK = 8, | 1317 | V4L2_CTRL_TYPE_BITMASK = 8, |
| 1281 | V4L2_CTRL_TYPE_INTEGER_MENU = 9, | 1318 | V4L2_CTRL_TYPE_INTEGER_MENU = 9, |
| 1319 | |||
| 1320 | /* Compound types are >= 0x0100 */ | ||
| 1321 | V4L2_CTRL_COMPOUND_TYPES = 0x0100, | ||
| 1322 | V4L2_CTRL_TYPE_U8 = 0x0100, | ||
| 1323 | V4L2_CTRL_TYPE_U16 = 0x0101, | ||
| 1324 | V4L2_CTRL_TYPE_U32 = 0x0102, | ||
| 1282 | }; | 1325 | }; |
| 1283 | 1326 | ||
| 1284 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ | 1327 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ |
| @@ -1294,6 +1337,23 @@ struct v4l2_queryctrl { | |||
| 1294 | __u32 reserved[2]; | 1337 | __u32 reserved[2]; |
| 1295 | }; | 1338 | }; |
| 1296 | 1339 | ||
| 1340 | /* Used in the VIDIOC_QUERY_EXT_CTRL ioctl for querying extended controls */ | ||
| 1341 | struct v4l2_query_ext_ctrl { | ||
| 1342 | __u32 id; | ||
| 1343 | __u32 type; | ||
| 1344 | char name[32]; | ||
| 1345 | __s64 minimum; | ||
| 1346 | __s64 maximum; | ||
| 1347 | __u64 step; | ||
| 1348 | __s64 default_value; | ||
| 1349 | __u32 flags; | ||
| 1350 | __u32 elem_size; | ||
| 1351 | __u32 elems; | ||
| 1352 | __u32 nr_of_dims; | ||
| 1353 | __u32 dims[V4L2_CTRL_MAX_DIMS]; | ||
| 1354 | __u32 reserved[32]; | ||
| 1355 | }; | ||
| 1356 | |||
| 1297 | /* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */ | 1357 | /* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */ |
| 1298 | struct v4l2_querymenu { | 1358 | struct v4l2_querymenu { |
| 1299 | __u32 id; | 1359 | __u32 id; |
| @@ -1314,9 +1374,11 @@ struct v4l2_querymenu { | |||
| 1314 | #define V4L2_CTRL_FLAG_SLIDER 0x0020 | 1374 | #define V4L2_CTRL_FLAG_SLIDER 0x0020 |
| 1315 | #define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040 | 1375 | #define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040 |
| 1316 | #define V4L2_CTRL_FLAG_VOLATILE 0x0080 | 1376 | #define V4L2_CTRL_FLAG_VOLATILE 0x0080 |
| 1377 | #define V4L2_CTRL_FLAG_HAS_PAYLOAD 0x0100 | ||
| 1317 | 1378 | ||
| 1318 | /* Query flag, to be ORed with the control ID */ | 1379 | /* Query flags, to be ORed with the control ID */ |
| 1319 | #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000 | 1380 | #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000 |
| 1381 | #define V4L2_CTRL_FLAG_NEXT_COMPOUND 0x40000000 | ||
| 1320 | 1382 | ||
| 1321 | /* User-class control IDs defined by V4L2 */ | 1383 | /* User-class control IDs defined by V4L2 */ |
| 1322 | #define V4L2_CID_MAX_CTRLS 1024 | 1384 | #define V4L2_CID_MAX_CTRLS 1024 |
| @@ -1582,6 +1644,12 @@ struct v4l2_vbi_format { | |||
| 1582 | #define V4L2_VBI_UNSYNC (1 << 0) | 1644 | #define V4L2_VBI_UNSYNC (1 << 0) |
| 1583 | #define V4L2_VBI_INTERLACED (1 << 1) | 1645 | #define V4L2_VBI_INTERLACED (1 << 1) |
| 1584 | 1646 | ||
| 1647 | /* ITU-R start lines for each field */ | ||
| 1648 | #define V4L2_VBI_ITU_525_F1_START (1) | ||
| 1649 | #define V4L2_VBI_ITU_525_F2_START (264) | ||
| 1650 | #define V4L2_VBI_ITU_625_F1_START (1) | ||
| 1651 | #define V4L2_VBI_ITU_625_F2_START (314) | ||
| 1652 | |||
| 1585 | /* Sliced VBI | 1653 | /* Sliced VBI |
| 1586 | * | 1654 | * |
| 1587 | * This implements is a proposal V4L2 API to allow SLICED VBI | 1655 | * This implements is a proposal V4L2 API to allow SLICED VBI |
| @@ -1705,6 +1773,7 @@ struct v4l2_plane_pix_format { | |||
| 1705 | * @colorspace: enum v4l2_colorspace; supplemental to pixelformat | 1773 | * @colorspace: enum v4l2_colorspace; supplemental to pixelformat |
| 1706 | * @plane_fmt: per-plane information | 1774 | * @plane_fmt: per-plane information |
| 1707 | * @num_planes: number of planes for this format | 1775 | * @num_planes: number of planes for this format |
| 1776 | * @flags: format flags (V4L2_PIX_FMT_FLAG_*) | ||
| 1708 | */ | 1777 | */ |
| 1709 | struct v4l2_pix_format_mplane { | 1778 | struct v4l2_pix_format_mplane { |
| 1710 | __u32 width; | 1779 | __u32 width; |
| @@ -1715,16 +1784,19 @@ struct v4l2_pix_format_mplane { | |||
| 1715 | 1784 | ||
| 1716 | struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES]; | 1785 | struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES]; |
| 1717 | __u8 num_planes; | 1786 | __u8 num_planes; |
| 1718 | __u8 reserved[11]; | 1787 | __u8 flags; |
| 1788 | __u8 reserved[10]; | ||
| 1719 | } __attribute__ ((packed)); | 1789 | } __attribute__ ((packed)); |
| 1720 | 1790 | ||
| 1721 | /** | 1791 | /** |
| 1722 | * struct v4l2_sdr_format - SDR format definition | 1792 | * struct v4l2_sdr_format - SDR format definition |
| 1723 | * @pixelformat: little endian four character code (fourcc) | 1793 | * @pixelformat: little endian four character code (fourcc) |
| 1794 | * @buffersize: maximum size in bytes required for data | ||
| 1724 | */ | 1795 | */ |
| 1725 | struct v4l2_sdr_format { | 1796 | struct v4l2_sdr_format { |
| 1726 | __u32 pixelformat; | 1797 | __u32 pixelformat; |
| 1727 | __u8 reserved[28]; | 1798 | __u32 buffersize; |
| 1799 | __u8 reserved[24]; | ||
| 1728 | } __attribute__ ((packed)); | 1800 | } __attribute__ ((packed)); |
| 1729 | 1801 | ||
| 1730 | /** | 1802 | /** |
| @@ -1771,6 +1843,7 @@ struct v4l2_streamparm { | |||
| 1771 | #define V4L2_EVENT_CTRL 3 | 1843 | #define V4L2_EVENT_CTRL 3 |
| 1772 | #define V4L2_EVENT_FRAME_SYNC 4 | 1844 | #define V4L2_EVENT_FRAME_SYNC 4 |
| 1773 | #define V4L2_EVENT_SOURCE_CHANGE 5 | 1845 | #define V4L2_EVENT_SOURCE_CHANGE 5 |
| 1846 | #define V4L2_EVENT_MOTION_DET 6 | ||
| 1774 | #define V4L2_EVENT_PRIVATE_START 0x08000000 | 1847 | #define V4L2_EVENT_PRIVATE_START 0x08000000 |
| 1775 | 1848 | ||
| 1776 | /* Payload for V4L2_EVENT_VSYNC */ | 1849 | /* Payload for V4L2_EVENT_VSYNC */ |
| @@ -1808,6 +1881,21 @@ struct v4l2_event_src_change { | |||
| 1808 | __u32 changes; | 1881 | __u32 changes; |
| 1809 | }; | 1882 | }; |
| 1810 | 1883 | ||
| 1884 | #define V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ (1 << 0) | ||
| 1885 | |||
| 1886 | /** | ||
| 1887 | * struct v4l2_event_motion_det - motion detection event | ||
| 1888 | * @flags: if V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ is set, then the | ||
| 1889 | * frame_sequence field is valid. | ||
| 1890 | * @frame_sequence: the frame sequence number associated with this event. | ||
| 1891 | * @region_mask: which regions detected motion. | ||
| 1892 | */ | ||
| 1893 | struct v4l2_event_motion_det { | ||
| 1894 | __u32 flags; | ||
| 1895 | __u32 frame_sequence; | ||
| 1896 | __u32 region_mask; | ||
| 1897 | }; | ||
| 1898 | |||
| 1811 | struct v4l2_event { | 1899 | struct v4l2_event { |
| 1812 | __u32 type; | 1900 | __u32 type; |
| 1813 | union { | 1901 | union { |
| @@ -1815,6 +1903,7 @@ struct v4l2_event { | |||
| 1815 | struct v4l2_event_ctrl ctrl; | 1903 | struct v4l2_event_ctrl ctrl; |
| 1816 | struct v4l2_event_frame_sync frame_sync; | 1904 | struct v4l2_event_frame_sync frame_sync; |
| 1817 | struct v4l2_event_src_change src_change; | 1905 | struct v4l2_event_src_change src_change; |
| 1906 | struct v4l2_event_motion_det motion_det; | ||
| 1818 | __u8 data[64]; | 1907 | __u8 data[64]; |
| 1819 | } u; | 1908 | } u; |
| 1820 | __u32 pending; | 1909 | __u32 pending; |
| @@ -2005,6 +2094,8 @@ struct v4l2_create_buffers { | |||
| 2005 | Never use these in applications! */ | 2094 | Never use these in applications! */ |
| 2006 | #define VIDIOC_DBG_G_CHIP_INFO _IOWR('V', 102, struct v4l2_dbg_chip_info) | 2095 | #define VIDIOC_DBG_G_CHIP_INFO _IOWR('V', 102, struct v4l2_dbg_chip_info) |
| 2007 | 2096 | ||
| 2097 | #define VIDIOC_QUERY_EXT_CTRL _IOWR('V', 103, struct v4l2_query_ext_ctrl) | ||
| 2098 | |||
| 2008 | /* Reminder: when adding new ioctls please add support for them to | 2099 | /* Reminder: when adding new ioctls please add support for them to |
| 2009 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 2100 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
| 2010 | 2101 | ||
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h index 224948342f14..32168f7ffce3 100644 --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h | |||
| @@ -139,7 +139,7 @@ struct snd_hwdep_dsp_image { | |||
| 139 | * * | 139 | * * |
| 140 | *****************************************************************************/ | 140 | *****************************************************************************/ |
| 141 | 141 | ||
| 142 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 11) | 142 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 12) |
| 143 | 143 | ||
| 144 | typedef unsigned long snd_pcm_uframes_t; | 144 | typedef unsigned long snd_pcm_uframes_t; |
| 145 | typedef signed long snd_pcm_sframes_t; | 145 | typedef signed long snd_pcm_sframes_t; |
| @@ -391,7 +391,9 @@ struct snd_pcm_sw_params { | |||
| 391 | snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */ | 391 | snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */ |
| 392 | snd_pcm_uframes_t silence_size; /* silence block size */ | 392 | snd_pcm_uframes_t silence_size; /* silence block size */ |
| 393 | snd_pcm_uframes_t boundary; /* pointers wrap point */ | 393 | snd_pcm_uframes_t boundary; /* pointers wrap point */ |
| 394 | unsigned char reserved[64]; /* reserved for future */ | 394 | unsigned int proto; /* protocol version */ |
| 395 | unsigned int tstamp_type; /* timestamp type (req. proto >= 2.0.12) */ | ||
| 396 | unsigned char reserved[56]; /* reserved for future */ | ||
| 395 | }; | 397 | }; |
| 396 | 398 | ||
| 397 | struct snd_pcm_channel_info { | 399 | struct snd_pcm_channel_info { |
| @@ -462,7 +464,8 @@ struct snd_xfern { | |||
| 462 | enum { | 464 | enum { |
| 463 | SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */ | 465 | SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */ |
| 464 | SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */ | 466 | SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */ |
| 465 | SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, | 467 | SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, /* monotonic_raw (no NTP) */ |
| 468 | SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, | ||
| 466 | }; | 469 | }; |
| 467 | 470 | ||
| 468 | /* channel positions */ | 471 | /* channel positions */ |
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index a5af2a26d94f..5c1aba154b64 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h | |||
| @@ -170,6 +170,7 @@ gnttab_set_unmap_op(struct gnttab_unmap_grant_ref *unmap, phys_addr_t addr, | |||
| 170 | unmap->dev_bus_addr = 0; | 170 | unmap->dev_bus_addr = 0; |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | int arch_gnttab_init(unsigned long nr_shared, unsigned long nr_status); | ||
| 173 | int arch_gnttab_map_shared(xen_pfn_t *frames, unsigned long nr_gframes, | 174 | int arch_gnttab_map_shared(xen_pfn_t *frames, unsigned long nr_gframes, |
| 174 | unsigned long max_nr_gframes, | 175 | unsigned long max_nr_gframes, |
| 175 | void **__shared); | 176 | void **__shared); |
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h index f1331e3e7271..5cc49ea8d840 100644 --- a/include/xen/interface/platform.h +++ b/include/xen/interface/platform.h | |||
| @@ -108,11 +108,113 @@ struct xenpf_platform_quirk { | |||
| 108 | }; | 108 | }; |
| 109 | DEFINE_GUEST_HANDLE_STRUCT(xenpf_platform_quirk_t); | 109 | DEFINE_GUEST_HANDLE_STRUCT(xenpf_platform_quirk_t); |
| 110 | 110 | ||
| 111 | #define XENPF_efi_runtime_call 49 | ||
| 112 | #define XEN_EFI_get_time 1 | ||
| 113 | #define XEN_EFI_set_time 2 | ||
| 114 | #define XEN_EFI_get_wakeup_time 3 | ||
| 115 | #define XEN_EFI_set_wakeup_time 4 | ||
| 116 | #define XEN_EFI_get_next_high_monotonic_count 5 | ||
| 117 | #define XEN_EFI_get_variable 6 | ||
| 118 | #define XEN_EFI_set_variable 7 | ||
| 119 | #define XEN_EFI_get_next_variable_name 8 | ||
| 120 | #define XEN_EFI_query_variable_info 9 | ||
| 121 | #define XEN_EFI_query_capsule_capabilities 10 | ||
| 122 | #define XEN_EFI_update_capsule 11 | ||
| 123 | |||
| 124 | struct xenpf_efi_runtime_call { | ||
| 125 | uint32_t function; | ||
| 126 | /* | ||
| 127 | * This field is generally used for per sub-function flags (defined | ||
| 128 | * below), except for the XEN_EFI_get_next_high_monotonic_count case, | ||
| 129 | * where it holds the single returned value. | ||
| 130 | */ | ||
| 131 | uint32_t misc; | ||
| 132 | xen_ulong_t status; | ||
| 133 | union { | ||
| 134 | #define XEN_EFI_GET_TIME_SET_CLEARS_NS 0x00000001 | ||
| 135 | struct { | ||
| 136 | struct xenpf_efi_time { | ||
| 137 | uint16_t year; | ||
| 138 | uint8_t month; | ||
| 139 | uint8_t day; | ||
| 140 | uint8_t hour; | ||
| 141 | uint8_t min; | ||
| 142 | uint8_t sec; | ||
| 143 | uint32_t ns; | ||
| 144 | int16_t tz; | ||
| 145 | uint8_t daylight; | ||
| 146 | } time; | ||
| 147 | uint32_t resolution; | ||
| 148 | uint32_t accuracy; | ||
| 149 | } get_time; | ||
| 150 | |||
| 151 | struct xenpf_efi_time set_time; | ||
| 152 | |||
| 153 | #define XEN_EFI_GET_WAKEUP_TIME_ENABLED 0x00000001 | ||
| 154 | #define XEN_EFI_GET_WAKEUP_TIME_PENDING 0x00000002 | ||
| 155 | struct xenpf_efi_time get_wakeup_time; | ||
| 156 | |||
| 157 | #define XEN_EFI_SET_WAKEUP_TIME_ENABLE 0x00000001 | ||
| 158 | #define XEN_EFI_SET_WAKEUP_TIME_ENABLE_ONLY 0x00000002 | ||
| 159 | struct xenpf_efi_time set_wakeup_time; | ||
| 160 | |||
| 161 | #define XEN_EFI_VARIABLE_NON_VOLATILE 0x00000001 | ||
| 162 | #define XEN_EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 | ||
| 163 | #define XEN_EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 | ||
| 164 | struct { | ||
| 165 | GUEST_HANDLE(void) name; /* UCS-2/UTF-16 string */ | ||
| 166 | xen_ulong_t size; | ||
| 167 | GUEST_HANDLE(void) data; | ||
| 168 | struct xenpf_efi_guid { | ||
| 169 | uint32_t data1; | ||
| 170 | uint16_t data2; | ||
| 171 | uint16_t data3; | ||
| 172 | uint8_t data4[8]; | ||
| 173 | } vendor_guid; | ||
| 174 | } get_variable, set_variable; | ||
| 175 | |||
| 176 | struct { | ||
| 177 | xen_ulong_t size; | ||
| 178 | GUEST_HANDLE(void) name; /* UCS-2/UTF-16 string */ | ||
| 179 | struct xenpf_efi_guid vendor_guid; | ||
| 180 | } get_next_variable_name; | ||
| 181 | |||
| 182 | struct { | ||
| 183 | uint32_t attr; | ||
| 184 | uint64_t max_store_size; | ||
| 185 | uint64_t remain_store_size; | ||
| 186 | uint64_t max_size; | ||
| 187 | } query_variable_info; | ||
| 188 | |||
| 189 | struct { | ||
| 190 | GUEST_HANDLE(void) capsule_header_array; | ||
| 191 | xen_ulong_t capsule_count; | ||
| 192 | uint64_t max_capsule_size; | ||
| 193 | uint32_t reset_type; | ||
| 194 | } query_capsule_capabilities; | ||
| 195 | |||
| 196 | struct { | ||
| 197 | GUEST_HANDLE(void) capsule_header_array; | ||
| 198 | xen_ulong_t capsule_count; | ||
| 199 | uint64_t sg_list; /* machine address */ | ||
| 200 | } update_capsule; | ||
| 201 | } u; | ||
| 202 | }; | ||
| 203 | DEFINE_GUEST_HANDLE_STRUCT(xenpf_efi_runtime_call); | ||
| 204 | |||
| 205 | #define XEN_FW_EFI_VERSION 0 | ||
| 206 | #define XEN_FW_EFI_CONFIG_TABLE 1 | ||
| 207 | #define XEN_FW_EFI_VENDOR 2 | ||
| 208 | #define XEN_FW_EFI_MEM_INFO 3 | ||
| 209 | #define XEN_FW_EFI_RT_VERSION 4 | ||
| 210 | |||
| 111 | #define XENPF_firmware_info 50 | 211 | #define XENPF_firmware_info 50 |
| 112 | #define XEN_FW_DISK_INFO 1 /* from int 13 AH=08/41/48 */ | 212 | #define XEN_FW_DISK_INFO 1 /* from int 13 AH=08/41/48 */ |
| 113 | #define XEN_FW_DISK_MBR_SIGNATURE 2 /* from MBR offset 0x1b8 */ | 213 | #define XEN_FW_DISK_MBR_SIGNATURE 2 /* from MBR offset 0x1b8 */ |
| 114 | #define XEN_FW_VBEDDC_INFO 3 /* from int 10 AX=4f15 */ | 214 | #define XEN_FW_VBEDDC_INFO 3 /* from int 10 AX=4f15 */ |
| 215 | #define XEN_FW_EFI_INFO 4 /* from EFI */ | ||
| 115 | #define XEN_FW_KBD_SHIFT_FLAGS 5 /* Int16, Fn02: Get keyboard shift flags. */ | 216 | #define XEN_FW_KBD_SHIFT_FLAGS 5 /* Int16, Fn02: Get keyboard shift flags. */ |
| 217 | |||
| 116 | struct xenpf_firmware_info { | 218 | struct xenpf_firmware_info { |
| 117 | /* IN variables. */ | 219 | /* IN variables. */ |
| 118 | uint32_t type; | 220 | uint32_t type; |
| @@ -144,6 +246,26 @@ struct xenpf_firmware_info { | |||
| 144 | GUEST_HANDLE(uchar) edid; | 246 | GUEST_HANDLE(uchar) edid; |
| 145 | } vbeddc_info; /* XEN_FW_VBEDDC_INFO */ | 247 | } vbeddc_info; /* XEN_FW_VBEDDC_INFO */ |
| 146 | 248 | ||
| 249 | union xenpf_efi_info { | ||
| 250 | uint32_t version; | ||
| 251 | struct { | ||
| 252 | uint64_t addr; /* EFI_CONFIGURATION_TABLE */ | ||
| 253 | uint32_t nent; | ||
| 254 | } cfg; | ||
| 255 | struct { | ||
| 256 | uint32_t revision; | ||
| 257 | uint32_t bufsz; /* input, in bytes */ | ||
| 258 | GUEST_HANDLE(void) name; | ||
| 259 | /* UCS-2/UTF-16 string */ | ||
| 260 | } vendor; | ||
| 261 | struct { | ||
| 262 | uint64_t addr; | ||
| 263 | uint64_t size; | ||
| 264 | uint64_t attr; | ||
| 265 | uint32_t type; | ||
| 266 | } mem; | ||
| 267 | } efi_info; /* XEN_FW_EFI_INFO */ | ||
| 268 | |||
| 147 | uint8_t kbd_shift_flags; /* XEN_FW_KBD_SHIFT_FLAGS */ | 269 | uint8_t kbd_shift_flags; /* XEN_FW_KBD_SHIFT_FLAGS */ |
| 148 | } u; | 270 | } u; |
| 149 | }; | 271 | }; |
| @@ -362,6 +484,7 @@ struct xen_platform_op { | |||
| 362 | struct xenpf_read_memtype read_memtype; | 484 | struct xenpf_read_memtype read_memtype; |
| 363 | struct xenpf_microcode_update microcode; | 485 | struct xenpf_microcode_update microcode; |
| 364 | struct xenpf_platform_quirk platform_quirk; | 486 | struct xenpf_platform_quirk platform_quirk; |
| 487 | struct xenpf_efi_runtime_call efi_runtime_call; | ||
| 365 | struct xenpf_firmware_info firmware_info; | 488 | struct xenpf_firmware_info firmware_info; |
| 366 | struct xenpf_enter_acpi_sleep enter_acpi_sleep; | 489 | struct xenpf_enter_acpi_sleep enter_acpi_sleep; |
| 367 | struct xenpf_change_freq change_freq; | 490 | struct xenpf_change_freq change_freq; |
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h index 0b3149ed7eaa..7491ee5d8164 100644 --- a/include/xen/xen-ops.h +++ b/include/xen/xen-ops.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/percpu.h> | 4 | #include <linux/percpu.h> |
| 5 | #include <linux/notifier.h> | 5 | #include <linux/notifier.h> |
| 6 | #include <linux/efi.h> | ||
| 6 | #include <asm/xen/interface.h> | 7 | #include <asm/xen/interface.h> |
| 7 | 8 | ||
| 8 | DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu); | 9 | DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu); |
| @@ -35,4 +36,14 @@ int xen_unmap_domain_mfn_range(struct vm_area_struct *vma, | |||
| 35 | int numpgs, struct page **pages); | 36 | int numpgs, struct page **pages); |
| 36 | 37 | ||
| 37 | bool xen_running_on_version_or_later(unsigned int major, unsigned int minor); | 38 | bool xen_running_on_version_or_later(unsigned int major, unsigned int minor); |
| 39 | |||
| 40 | #ifdef CONFIG_XEN_EFI | ||
| 41 | extern efi_system_table_t *xen_efi_probe(void); | ||
| 42 | #else | ||
| 43 | static inline efi_system_table_t __init *xen_efi_probe(void) | ||
| 44 | { | ||
| 45 | return NULL; | ||
| 46 | } | ||
| 47 | #endif | ||
| 48 | |||
| 38 | #endif /* INCLUDE_XEN_OPS_H */ | 49 | #endif /* INCLUDE_XEN_OPS_H */ |
