diff options
| author | NeilBrown <neilb@suse.de> | 2010-05-21 18:31:36 -0400 |
|---|---|---|
| committer | NeilBrown <neilb@suse.de> | 2010-05-21 18:31:36 -0400 |
| commit | 19fdb9eefb21b72edbc365b838502780c392bad6 (patch) | |
| tree | deae04c48532d6eab64ed4b0396737bb854b5506 /include | |
| parent | be6800a73aa2f3dc14744c3b80e676d189789f04 (diff) | |
| parent | 3ff195b011d7decf501a4d55aeed312731094796 (diff) | |
Merge commit '3ff195b011d7decf501a4d55aeed312731094796' into for-linus
Conflicts:
drivers/md/md.c
- Resolved conflict in md_update_sb
- Added extra 'NULL' arg to new instance of sysfs_get_dirent.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'include')
435 files changed, 11034 insertions, 2775 deletions
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 5b2e5e80ecb0..5958d7845bd5 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h | |||
| @@ -87,7 +87,7 @@ | |||
| 87 | #define AE_NO_GLOBAL_LOCK (acpi_status) (0x0017 | AE_CODE_ENVIRONMENTAL) | 87 | #define AE_NO_GLOBAL_LOCK (acpi_status) (0x0017 | AE_CODE_ENVIRONMENTAL) |
| 88 | #define AE_ABORT_METHOD (acpi_status) (0x0018 | AE_CODE_ENVIRONMENTAL) | 88 | #define AE_ABORT_METHOD (acpi_status) (0x0018 | AE_CODE_ENVIRONMENTAL) |
| 89 | #define AE_SAME_HANDLER (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL) | 89 | #define AE_SAME_HANDLER (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL) |
| 90 | #define AE_WAKE_ONLY_GPE (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL) | 90 | #define AE_NO_HANDLER (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL) |
| 91 | #define AE_OWNER_ID_LIMIT (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL) | 91 | #define AE_OWNER_ID_LIMIT (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL) |
| 92 | 92 | ||
| 93 | #define AE_CODE_ENV_MAX 0x001B | 93 | #define AE_CODE_ENV_MAX 0x001B |
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index d7726685797e..5e952262d6ee 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h | |||
| @@ -206,6 +206,7 @@ | |||
| 206 | #define ACPI_WARNING(plist) acpi_warning plist | 206 | #define ACPI_WARNING(plist) acpi_warning plist |
| 207 | #define ACPI_EXCEPTION(plist) acpi_exception plist | 207 | #define ACPI_EXCEPTION(plist) acpi_exception plist |
| 208 | #define ACPI_ERROR(plist) acpi_error plist | 208 | #define ACPI_ERROR(plist) acpi_error plist |
| 209 | #define ACPI_DEBUG_OBJECT(obj,l,i) acpi_ex_do_debug_object(obj,l,i) | ||
| 209 | 210 | ||
| 210 | #else | 211 | #else |
| 211 | 212 | ||
| @@ -215,6 +216,7 @@ | |||
| 215 | #define ACPI_WARNING(plist) | 216 | #define ACPI_WARNING(plist) |
| 216 | #define ACPI_EXCEPTION(plist) | 217 | #define ACPI_EXCEPTION(plist) |
| 217 | #define ACPI_ERROR(plist) | 218 | #define ACPI_ERROR(plist) |
| 219 | #define ACPI_DEBUG_OBJECT(obj,l,i) | ||
| 218 | 220 | ||
| 219 | #endif /* ACPI_NO_ERROR_MESSAGES */ | 221 | #endif /* ACPI_NO_ERROR_MESSAGES */ |
| 220 | 222 | ||
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 3a4767c01c5f..4f7b44866b76 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
| @@ -65,6 +65,8 @@ | |||
| 65 | #define ACPI_VIDEO_HID "LNXVIDEO" | 65 | #define ACPI_VIDEO_HID "LNXVIDEO" |
| 66 | #define ACPI_BAY_HID "LNXIOBAY" | 66 | #define ACPI_BAY_HID "LNXIOBAY" |
| 67 | #define ACPI_DOCK_HID "LNXDOCK" | 67 | #define ACPI_DOCK_HID "LNXDOCK" |
| 68 | /* Quirk for broken IBM BIOSes */ | ||
| 69 | #define ACPI_SMBUS_IBM_HID "SMBUSIBM" | ||
| 68 | 70 | ||
| 69 | /* | 71 | /* |
| 70 | * For fixed hardware buttons, we fabricate acpi_devices with HID | 72 | * For fixed hardware buttons, we fabricate acpi_devices with HID |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index b396854b83b0..29bf945143e8 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
| @@ -233,8 +233,8 @@ acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, | |||
| 233 | * Interim function needed for PCI IRQ routing | 233 | * Interim function needed for PCI IRQ routing |
| 234 | */ | 234 | */ |
| 235 | void | 235 | void |
| 236 | acpi_os_derive_pci_id(acpi_handle rhandle, | 236 | acpi_os_derive_pci_id(acpi_handle device, |
| 237 | acpi_handle chandle, struct acpi_pci_id **pci_id); | 237 | acpi_handle region, struct acpi_pci_id **pci_id); |
| 238 | 238 | ||
| 239 | /* | 239 | /* |
| 240 | * Miscellaneous | 240 | * Miscellaneous |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 4447a0461bae..0e4ab1fe5966 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
| @@ -47,7 +47,7 @@ | |||
| 47 | 47 | ||
| 48 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 48 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
| 49 | 49 | ||
| 50 | #define ACPI_CA_VERSION 0x20100121 | 50 | #define ACPI_CA_VERSION 0x20100428 |
| 51 | 51 | ||
| 52 | #include "actypes.h" | 52 | #include "actypes.h" |
| 53 | #include "actbl.h" | 53 | #include "actbl.h" |
| @@ -67,6 +67,8 @@ extern u8 acpi_gbl_leave_wake_gpes_disabled; | |||
| 67 | extern u8 acpi_gbl_use_default_register_widths; | 67 | extern u8 acpi_gbl_use_default_register_widths; |
| 68 | extern acpi_name acpi_gbl_trace_method_name; | 68 | extern acpi_name acpi_gbl_trace_method_name; |
| 69 | extern u32 acpi_gbl_trace_flags; | 69 | extern u32 acpi_gbl_trace_flags; |
| 70 | extern u8 acpi_gbl_enable_aml_debug_object; | ||
| 71 | extern u8 acpi_gbl_copy_dsdt_locally; | ||
| 70 | 72 | ||
| 71 | extern u32 acpi_current_gpe_count; | 73 | extern u32 acpi_current_gpe_count; |
| 72 | extern struct acpi_table_fadt acpi_gbl_FADT; | 74 | extern struct acpi_table_fadt acpi_gbl_FADT; |
| @@ -164,7 +166,7 @@ acpi_get_devices(const char *HID, | |||
| 164 | void *context, void **return_value); | 166 | void *context, void **return_value); |
| 165 | 167 | ||
| 166 | acpi_status | 168 | acpi_status |
| 167 | acpi_get_name(acpi_handle handle, | 169 | acpi_get_name(acpi_handle object, |
| 168 | u32 name_type, struct acpi_buffer *ret_path_ptr); | 170 | u32 name_type, struct acpi_buffer *ret_path_ptr); |
| 169 | 171 | ||
| 170 | acpi_status | 172 | acpi_status |
| @@ -172,14 +174,12 @@ acpi_get_handle(acpi_handle parent, | |||
| 172 | acpi_string pathname, acpi_handle * ret_handle); | 174 | acpi_string pathname, acpi_handle * ret_handle); |
| 173 | 175 | ||
| 174 | acpi_status | 176 | acpi_status |
| 175 | acpi_attach_data(acpi_handle obj_handle, | 177 | acpi_attach_data(acpi_handle object, acpi_object_handler handler, void *data); |
| 176 | acpi_object_handler handler, void *data); | ||
| 177 | 178 | ||
| 178 | acpi_status | 179 | acpi_status acpi_detach_data(acpi_handle object, acpi_object_handler handler); |
| 179 | acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler); | ||
| 180 | 180 | ||
| 181 | acpi_status | 181 | acpi_status |
| 182 | acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data); | 182 | acpi_get_data(acpi_handle object, acpi_object_handler handler, void **data); |
| 183 | 183 | ||
| 184 | acpi_status | 184 | acpi_status |
| 185 | acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags); | 185 | acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags); |
| @@ -201,7 +201,7 @@ acpi_evaluate_object_typed(acpi_handle object, | |||
| 201 | acpi_object_type return_type); | 201 | acpi_object_type return_type); |
| 202 | 202 | ||
| 203 | acpi_status | 203 | acpi_status |
| 204 | acpi_get_object_info(acpi_handle handle, | 204 | acpi_get_object_info(acpi_handle object, |
| 205 | struct acpi_device_info **return_buffer); | 205 | struct acpi_device_info **return_buffer); |
| 206 | 206 | ||
| 207 | acpi_status acpi_install_method(u8 *buffer); | 207 | acpi_status acpi_install_method(u8 *buffer); |
| @@ -283,16 +283,17 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); | |||
| 283 | */ | 283 | */ |
| 284 | acpi_status acpi_set_gpe(acpi_handle gpe_device, u32 gpe_number, u8 action); | 284 | acpi_status acpi_set_gpe(acpi_handle gpe_device, u32 gpe_number, u8 action); |
| 285 | 285 | ||
| 286 | acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 type); | 286 | acpi_status |
| 287 | acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type); | ||
| 287 | 288 | ||
| 288 | acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 type); | 289 | acpi_status |
| 290 | acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 gpe_type); | ||
| 289 | 291 | ||
| 290 | acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); | 292 | acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number); |
| 291 | 293 | ||
| 292 | acpi_status | 294 | acpi_status |
| 293 | acpi_get_gpe_status(acpi_handle gpe_device, | 295 | acpi_get_gpe_status(acpi_handle gpe_device, |
| 294 | u32 gpe_number, | 296 | u32 gpe_number, acpi_event_status *event_status); |
| 295 | u32 flags, acpi_event_status * event_status); | ||
| 296 | 297 | ||
| 297 | acpi_status acpi_disable_all_gpes(void); | 298 | acpi_status acpi_disable_all_gpes(void); |
| 298 | 299 | ||
| @@ -315,33 +316,29 @@ acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource, | |||
| 315 | void *context); | 316 | void *context); |
| 316 | 317 | ||
| 317 | acpi_status | 318 | acpi_status |
| 318 | acpi_get_vendor_resource(acpi_handle device_handle, | 319 | acpi_get_vendor_resource(acpi_handle device, |
| 319 | char *name, | 320 | char *name, |
| 320 | struct acpi_vendor_uuid *uuid, | 321 | struct acpi_vendor_uuid *uuid, |
| 321 | struct acpi_buffer *ret_buffer); | 322 | struct acpi_buffer *ret_buffer); |
| 322 | 323 | ||
| 323 | acpi_status | 324 | acpi_status |
| 324 | acpi_get_current_resources(acpi_handle device_handle, | 325 | acpi_get_current_resources(acpi_handle device, struct acpi_buffer *ret_buffer); |
| 325 | struct acpi_buffer *ret_buffer); | ||
| 326 | 326 | ||
| 327 | #ifdef ACPI_FUTURE_USAGE | 327 | #ifdef ACPI_FUTURE_USAGE |
| 328 | acpi_status | 328 | acpi_status |
| 329 | acpi_get_possible_resources(acpi_handle device_handle, | 329 | acpi_get_possible_resources(acpi_handle device, struct acpi_buffer *ret_buffer); |
| 330 | struct acpi_buffer *ret_buffer); | ||
| 331 | #endif | 330 | #endif |
| 332 | 331 | ||
| 333 | acpi_status | 332 | acpi_status |
| 334 | acpi_walk_resources(acpi_handle device_handle, | 333 | acpi_walk_resources(acpi_handle device, |
| 335 | char *name, | 334 | char *name, |
| 336 | acpi_walk_resource_callback user_function, void *context); | 335 | acpi_walk_resource_callback user_function, void *context); |
| 337 | 336 | ||
| 338 | acpi_status | 337 | acpi_status |
| 339 | acpi_set_current_resources(acpi_handle device_handle, | 338 | acpi_set_current_resources(acpi_handle device, struct acpi_buffer *in_buffer); |
| 340 | struct acpi_buffer *in_buffer); | ||
| 341 | 339 | ||
| 342 | acpi_status | 340 | acpi_status |
| 343 | acpi_get_irq_routing_table(acpi_handle bus_device_handle, | 341 | acpi_get_irq_routing_table(acpi_handle device, struct acpi_buffer *ret_buffer); |
| 344 | struct acpi_buffer *ret_buffer); | ||
| 345 | 342 | ||
| 346 | acpi_status | 343 | acpi_status |
| 347 | acpi_resource_to_address64(struct acpi_resource *resource, | 344 | acpi_resource_to_address64(struct acpi_resource *resource, |
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 5b02e307bff3..95f4d0ef4819 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h | |||
| @@ -69,6 +69,7 @@ | |||
| 69 | #define ACPI_SIG_IBFT "IBFT" /* i_sCSI Boot Firmware Table */ | 69 | #define ACPI_SIG_IBFT "IBFT" /* i_sCSI Boot Firmware Table */ |
| 70 | #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */ | 70 | #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */ |
| 71 | #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ | 71 | #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ |
| 72 | #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */ | ||
| 72 | #define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */ | 73 | #define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */ |
| 73 | #define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ | 74 | #define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ |
| 74 | #define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */ | 75 | #define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */ |
| @@ -679,6 +680,32 @@ struct acpi_mcfg_allocation { | |||
| 679 | 680 | ||
| 680 | /******************************************************************************* | 681 | /******************************************************************************* |
| 681 | * | 682 | * |
| 683 | * MCHI - Management Controller Host Interface Table | ||
| 684 | * Version 1 | ||
| 685 | * | ||
| 686 | * Conforms to "Management Component Transport Protocol (MCTP) Host | ||
| 687 | * Interface Specification", Revision 1.0.0a, October 13, 2009 | ||
| 688 | * | ||
| 689 | ******************************************************************************/ | ||
| 690 | |||
| 691 | struct acpi_table_mchi { | ||
| 692 | struct acpi_table_header header; /* Common ACPI table header */ | ||
| 693 | u8 interface_type; | ||
| 694 | u8 protocol; | ||
| 695 | u64 protocol_data; | ||
| 696 | u8 interrupt_type; | ||
| 697 | u8 gpe; | ||
| 698 | u8 pci_device_flag; | ||
| 699 | u32 global_interrupt; | ||
| 700 | struct acpi_generic_address control_register; | ||
| 701 | u8 pci_segment; | ||
| 702 | u8 pci_bus; | ||
| 703 | u8 pci_device; | ||
| 704 | u8 pci_function; | ||
| 705 | }; | ||
| 706 | |||
| 707 | /******************************************************************************* | ||
| 708 | * | ||
| 682 | * SPCR - Serial Port Console Redirection table | 709 | * SPCR - Serial Port Console Redirection table |
| 683 | * Version 1 | 710 | * Version 1 |
| 684 | * | 711 | * |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 3f08e64962f8..bade172cad47 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
| @@ -663,44 +663,42 @@ typedef u32 acpi_event_status; | |||
| 663 | #define ACPI_GPE_MAX 0xFF | 663 | #define ACPI_GPE_MAX 0xFF |
| 664 | #define ACPI_NUM_GPE 256 | 664 | #define ACPI_NUM_GPE 256 |
| 665 | 665 | ||
| 666 | /* Actions for acpi_set_gpe */ | ||
| 667 | |||
| 666 | #define ACPI_GPE_ENABLE 0 | 668 | #define ACPI_GPE_ENABLE 0 |
| 667 | #define ACPI_GPE_DISABLE 1 | 669 | #define ACPI_GPE_DISABLE 1 |
| 668 | 670 | ||
| 671 | /* gpe_types for acpi_enable_gpe and acpi_disable_gpe */ | ||
| 672 | |||
| 673 | #define ACPI_GPE_TYPE_WAKE (u8) 0x01 | ||
| 674 | #define ACPI_GPE_TYPE_RUNTIME (u8) 0x02 | ||
| 675 | #define ACPI_GPE_TYPE_WAKE_RUN (u8) 0x03 | ||
| 676 | |||
| 669 | /* | 677 | /* |
| 670 | * GPE info flags - Per GPE | 678 | * GPE info flags - Per GPE |
| 671 | * +-+-+-+---+-+-+-+ | 679 | * +-------+---+-+-+ |
| 672 | * |7|6|5|4:3|2|1|0| | 680 | * | 7:4 |3:2|1|0| |
| 673 | * +-+-+-+---+-+-+-+ | 681 | * +-------+---+-+-+ |
| 674 | * | | | | | | | | 682 | * | | | | |
| 675 | * | | | | | | +--- Interrupt type: Edge or Level Triggered | 683 | * | | | +--- Interrupt type: edge or level triggered |
| 676 | * | | | | | +--- GPE can wake the system | 684 | * | | +----- GPE can wake the system |
| 677 | * | | | | +--- Unused | 685 | * | +-------- Type of dispatch:to method, handler, or none |
| 678 | * | | | +--- Type of dispatch -- to method, handler, or none | 686 | * +-------------- <Reserved> |
| 679 | * | | +--- Unused | ||
| 680 | * | +--- Unused | ||
| 681 | * +--- Unused | ||
| 682 | */ | 687 | */ |
| 683 | #define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01 | 688 | #define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01 |
| 684 | #define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01 | 689 | #define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01 |
| 685 | #define ACPI_GPE_EDGE_TRIGGERED (u8) 0x00 | 690 | #define ACPI_GPE_EDGE_TRIGGERED (u8) 0x00 |
| 686 | 691 | ||
| 687 | #define ACPI_GPE_TYPE_MASK (u8) 0x06 | ||
| 688 | #define ACPI_GPE_TYPE_WAKE_RUN (u8) 0x06 | ||
| 689 | #define ACPI_GPE_TYPE_WAKE (u8) 0x02 | ||
| 690 | #define ACPI_GPE_TYPE_RUNTIME (u8) 0x04 /* Default */ | ||
| 691 | #define ACPI_GPE_CAN_WAKE (u8) 0x02 | 692 | #define ACPI_GPE_CAN_WAKE (u8) 0x02 |
| 692 | 693 | ||
| 693 | #define ACPI_GPE_DISPATCH_MASK (u8) 0x18 | 694 | #define ACPI_GPE_DISPATCH_MASK (u8) 0x0C |
| 694 | #define ACPI_GPE_DISPATCH_HANDLER (u8) 0x08 | 695 | #define ACPI_GPE_DISPATCH_HANDLER (u8) 0x04 |
| 695 | #define ACPI_GPE_DISPATCH_METHOD (u8) 0x10 | 696 | #define ACPI_GPE_DISPATCH_METHOD (u8) 0x08 |
| 696 | #define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 /* Default */ | 697 | #define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 |
| 697 | 698 | ||
| 698 | /* | 699 | /* |
| 699 | * Flags for GPE and Lock interfaces | 700 | * Flags for GPE and Lock interfaces |
| 700 | */ | 701 | */ |
| 701 | #define ACPI_EVENT_WAKE_ENABLE 0x2 /* acpi_gpe_enable */ | ||
| 702 | #define ACPI_EVENT_WAKE_DISABLE 0x2 /* acpi_gpe_disable */ | ||
| 703 | |||
| 704 | #define ACPI_NOT_ISR 0x1 | 702 | #define ACPI_NOT_ISR 0x1 |
| 705 | #define ACPI_ISR 0x0 | 703 | #define ACPI_ISR 0x0 |
| 706 | 704 | ||
| @@ -953,7 +951,7 @@ acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, | |||
| 953 | #define ACPI_REGION_DEACTIVATE 1 | 951 | #define ACPI_REGION_DEACTIVATE 1 |
| 954 | 952 | ||
| 955 | typedef | 953 | typedef |
| 956 | acpi_status(*acpi_walk_callback) (acpi_handle obj_handle, | 954 | acpi_status(*acpi_walk_callback) (acpi_handle object, |
| 957 | u32 nesting_level, | 955 | u32 nesting_level, |
| 958 | void *context, void **return_value); | 956 | void *context, void **return_value); |
| 959 | 957 | ||
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 1172c27adadf..86825ddbe14e 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
| @@ -320,8 +320,16 @@ static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit) | |||
| 320 | 320 | ||
| 321 | #endif /* CONFIG_CPU_FREQ */ | 321 | #endif /* CONFIG_CPU_FREQ */ |
| 322 | 322 | ||
| 323 | /* in processor_pdc.c */ | 323 | /* in processor_core.c */ |
| 324 | void acpi_processor_set_pdc(acpi_handle handle); | 324 | void acpi_processor_set_pdc(acpi_handle handle); |
| 325 | #ifdef CONFIG_SMP | ||
| 326 | int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id); | ||
| 327 | #else | ||
| 328 | static inline int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id) | ||
| 329 | { | ||
| 330 | return -1; | ||
| 331 | } | ||
| 332 | #endif | ||
| 325 | 333 | ||
| 326 | /* in processor_throttling.c */ | 334 | /* in processor_throttling.c */ |
| 327 | int acpi_processor_tstate_has_changed(struct acpi_processor *pr); | 335 | int acpi_processor_tstate_has_changed(struct acpi_processor *pr); |
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h index c99c64dc5f3d..c33749f95b32 100644 --- a/include/asm-generic/atomic.h +++ b/include/asm-generic/atomic.h | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | * Atomically reads the value of @v. Note that the guaranteed | 33 | * Atomically reads the value of @v. Note that the guaranteed |
| 34 | * useful range of an atomic_t is only 24 bits. | 34 | * useful range of an atomic_t is only 24 bits. |
| 35 | */ | 35 | */ |
| 36 | #define atomic_read(v) ((v)->counter) | 36 | #define atomic_read(v) (*(volatile int *)&(v)->counter) |
| 37 | 37 | ||
| 38 | /** | 38 | /** |
| 39 | * atomic_set - set atomic variable | 39 | * atomic_set - set atomic variable |
diff --git a/include/asm-generic/bitops/arch_hweight.h b/include/asm-generic/bitops/arch_hweight.h new file mode 100644 index 000000000000..6a211f40665c --- /dev/null +++ b/include/asm-generic/bitops/arch_hweight.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | #ifndef _ASM_GENERIC_BITOPS_ARCH_HWEIGHT_H_ | ||
| 2 | #define _ASM_GENERIC_BITOPS_ARCH_HWEIGHT_H_ | ||
| 3 | |||
| 4 | #include <asm/types.h> | ||
| 5 | |||
| 6 | static inline unsigned int __arch_hweight32(unsigned int w) | ||
| 7 | { | ||
| 8 | return __sw_hweight32(w); | ||
| 9 | } | ||
| 10 | |||
| 11 | static inline unsigned int __arch_hweight16(unsigned int w) | ||
| 12 | { | ||
| 13 | return __sw_hweight16(w); | ||
| 14 | } | ||
| 15 | |||
| 16 | static inline unsigned int __arch_hweight8(unsigned int w) | ||
| 17 | { | ||
| 18 | return __sw_hweight8(w); | ||
| 19 | } | ||
| 20 | |||
| 21 | static inline unsigned long __arch_hweight64(__u64 w) | ||
| 22 | { | ||
| 23 | return __sw_hweight64(w); | ||
| 24 | } | ||
| 25 | #endif /* _ASM_GENERIC_BITOPS_HWEIGHT_H_ */ | ||
diff --git a/include/asm-generic/bitops/const_hweight.h b/include/asm-generic/bitops/const_hweight.h new file mode 100644 index 000000000000..fa2a50b7ee66 --- /dev/null +++ b/include/asm-generic/bitops/const_hweight.h | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | #ifndef _ASM_GENERIC_BITOPS_CONST_HWEIGHT_H_ | ||
| 2 | #define _ASM_GENERIC_BITOPS_CONST_HWEIGHT_H_ | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Compile time versions of __arch_hweightN() | ||
| 6 | */ | ||
| 7 | #define __const_hweight8(w) \ | ||
| 8 | ( (!!((w) & (1ULL << 0))) + \ | ||
| 9 | (!!((w) & (1ULL << 1))) + \ | ||
| 10 | (!!((w) & (1ULL << 2))) + \ | ||
| 11 | (!!((w) & (1ULL << 3))) + \ | ||
| 12 | (!!((w) & (1ULL << 4))) + \ | ||
| 13 | (!!((w) & (1ULL << 5))) + \ | ||
| 14 | (!!((w) & (1ULL << 6))) + \ | ||
| 15 | (!!((w) & (1ULL << 7))) ) | ||
| 16 | |||
| 17 | #define __const_hweight16(w) (__const_hweight8(w) + __const_hweight8((w) >> 8 )) | ||
| 18 | #define __const_hweight32(w) (__const_hweight16(w) + __const_hweight16((w) >> 16)) | ||
| 19 | #define __const_hweight64(w) (__const_hweight32(w) + __const_hweight32((w) >> 32)) | ||
| 20 | |||
| 21 | /* | ||
| 22 | * Generic interface. | ||
| 23 | */ | ||
| 24 | #define hweight8(w) (__builtin_constant_p(w) ? __const_hweight8(w) : __arch_hweight8(w)) | ||
| 25 | #define hweight16(w) (__builtin_constant_p(w) ? __const_hweight16(w) : __arch_hweight16(w)) | ||
| 26 | #define hweight32(w) (__builtin_constant_p(w) ? __const_hweight32(w) : __arch_hweight32(w)) | ||
| 27 | #define hweight64(w) (__builtin_constant_p(w) ? __const_hweight64(w) : __arch_hweight64(w)) | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Interface for known constant arguments | ||
| 31 | */ | ||
| 32 | #define HWEIGHT8(w) (BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + __const_hweight8(w)) | ||
| 33 | #define HWEIGHT16(w) (BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + __const_hweight16(w)) | ||
| 34 | #define HWEIGHT32(w) (BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + __const_hweight32(w)) | ||
| 35 | #define HWEIGHT64(w) (BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + __const_hweight64(w)) | ||
| 36 | |||
| 37 | /* | ||
| 38 | * Type invariant interface to the compile time constant hweight functions. | ||
| 39 | */ | ||
| 40 | #define HWEIGHT(w) HWEIGHT64((u64)w) | ||
| 41 | |||
| 42 | #endif /* _ASM_GENERIC_BITOPS_CONST_HWEIGHT_H_ */ | ||
diff --git a/include/asm-generic/bitops/hweight.h b/include/asm-generic/bitops/hweight.h index fbbc383771da..a94d6519c7ed 100644 --- a/include/asm-generic/bitops/hweight.h +++ b/include/asm-generic/bitops/hweight.h | |||
| @@ -1,11 +1,7 @@ | |||
| 1 | #ifndef _ASM_GENERIC_BITOPS_HWEIGHT_H_ | 1 | #ifndef _ASM_GENERIC_BITOPS_HWEIGHT_H_ |
| 2 | #define _ASM_GENERIC_BITOPS_HWEIGHT_H_ | 2 | #define _ASM_GENERIC_BITOPS_HWEIGHT_H_ |
| 3 | 3 | ||
| 4 | #include <asm/types.h> | 4 | #include <asm-generic/bitops/arch_hweight.h> |
| 5 | 5 | #include <asm-generic/bitops/const_hweight.h> | |
| 6 | extern unsigned int hweight32(unsigned int w); | ||
| 7 | extern unsigned int hweight16(unsigned int w); | ||
| 8 | extern unsigned int hweight8(unsigned int w); | ||
| 9 | extern unsigned long hweight64(__u64 w); | ||
| 10 | 6 | ||
| 11 | #endif /* _ASM_GENERIC_BITOPS_HWEIGHT_H_ */ | 7 | #endif /* _ASM_GENERIC_BITOPS_HWEIGHT_H_ */ |
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h index e694263445f7..69206957b72c 100644 --- a/include/asm-generic/dma-mapping-common.h +++ b/include/asm-generic/dma-mapping-common.h | |||
| @@ -131,7 +131,7 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev, | |||
| 131 | debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir); | 131 | debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir); |
| 132 | 132 | ||
| 133 | } else | 133 | } else |
| 134 | dma_sync_single_for_cpu(dev, addr, size, dir); | 134 | dma_sync_single_for_cpu(dev, addr + offset, size, dir); |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | static inline void dma_sync_single_range_for_device(struct device *dev, | 137 | static inline void dma_sync_single_range_for_device(struct device *dev, |
| @@ -148,7 +148,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev, | |||
| 148 | debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir); | 148 | debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir); |
| 149 | 149 | ||
| 150 | } else | 150 | } else |
| 151 | dma_sync_single_for_device(dev, addr, size, dir); | 151 | dma_sync_single_for_device(dev, addr + offset, size, dir); |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | static inline void | 154 | static inline void |
diff --git a/include/asm-generic/pci-dma-compat.h b/include/asm-generic/pci-dma-compat.h index 37b3706226e7..1437b7da09b2 100644 --- a/include/asm-generic/pci-dma-compat.h +++ b/include/asm-generic/pci-dma-compat.h | |||
| @@ -6,9 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/dma-mapping.h> | 7 | #include <linux/dma-mapping.h> |
| 8 | 8 | ||
| 9 | /* note pci_set_dma_mask isn't here, since it's a public function | ||
| 10 | * exported from drivers/pci, use dma_supported instead */ | ||
| 11 | |||
| 12 | static inline int | 9 | static inline int |
| 13 | pci_dma_supported(struct pci_dev *hwdev, u64 mask) | 10 | pci_dma_supported(struct pci_dev *hwdev, u64 mask) |
| 14 | { | 11 | { |
| @@ -104,4 +101,16 @@ pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr) | |||
| 104 | return dma_mapping_error(&pdev->dev, dma_addr); | 101 | return dma_mapping_error(&pdev->dev, dma_addr); |
| 105 | } | 102 | } |
| 106 | 103 | ||
| 104 | #ifdef CONFIG_PCI | ||
| 105 | static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) | ||
| 106 | { | ||
| 107 | return dma_set_mask(&dev->dev, mask); | ||
| 108 | } | ||
| 109 | |||
| 110 | static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) | ||
| 111 | { | ||
| 112 | return dma_set_coherent_mask(&dev->dev, mask); | ||
| 113 | } | ||
| 114 | #endif | ||
| 115 | |||
| 107 | #endif | 116 | #endif |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 4a3c4e441027..2f3b3a00b7a3 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
| @@ -55,6 +55,7 @@ | |||
| 55 | #include <linux/mm.h> | 55 | #include <linux/mm.h> |
| 56 | #include <linux/cdev.h> | 56 | #include <linux/cdev.h> |
| 57 | #include <linux/mutex.h> | 57 | #include <linux/mutex.h> |
| 58 | #include <linux/slab.h> | ||
| 58 | #if defined(__alpha__) || defined(__powerpc__) | 59 | #if defined(__alpha__) || defined(__powerpc__) |
| 59 | #include <asm/pgtable.h> /* For pte_wrprotect */ | 60 | #include <asm/pgtable.h> /* For pte_wrprotect */ |
| 60 | #endif | 61 | #endif |
| @@ -1545,39 +1546,7 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map) | |||
| 1545 | { | 1546 | { |
| 1546 | } | 1547 | } |
| 1547 | 1548 | ||
| 1548 | 1549 | #include "drm_mem_util.h" | |
| 1549 | static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) | ||
| 1550 | { | ||
| 1551 | if (size != 0 && nmemb > ULONG_MAX / size) | ||
| 1552 | return NULL; | ||
| 1553 | |||
| 1554 | if (size * nmemb <= PAGE_SIZE) | ||
| 1555 | return kcalloc(nmemb, size, GFP_KERNEL); | ||
| 1556 | |||
| 1557 | return __vmalloc(size * nmemb, | ||
| 1558 | GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL); | ||
| 1559 | } | ||
| 1560 | |||
| 1561 | /* Modeled after cairo's malloc_ab, it's like calloc but without the zeroing. */ | ||
| 1562 | static __inline__ void *drm_malloc_ab(size_t nmemb, size_t size) | ||
| 1563 | { | ||
| 1564 | if (size != 0 && nmemb > ULONG_MAX / size) | ||
| 1565 | return NULL; | ||
| 1566 | |||
| 1567 | if (size * nmemb <= PAGE_SIZE) | ||
| 1568 | return kmalloc(nmemb * size, GFP_KERNEL); | ||
| 1569 | |||
| 1570 | return __vmalloc(size * nmemb, | ||
| 1571 | GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL); | ||
| 1572 | } | ||
| 1573 | |||
| 1574 | static __inline void drm_free_large(void *ptr) | ||
| 1575 | { | ||
| 1576 | if (!is_vmalloc_addr(ptr)) | ||
| 1577 | return kfree(ptr); | ||
| 1578 | |||
| 1579 | vfree(ptr); | ||
| 1580 | } | ||
| 1581 | /*@}*/ | 1550 | /*@}*/ |
| 1582 | 1551 | ||
| 1583 | #endif /* __KERNEL__ */ | 1552 | #endif /* __KERNEL__ */ |
diff --git a/include/drm/drm_mem_util.h b/include/drm/drm_mem_util.h new file mode 100644 index 000000000000..6bd325fedc87 --- /dev/null +++ b/include/drm/drm_mem_util.h | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | /* | ||
| 2 | * Copyright © 2008 Intel Corporation | ||
| 3 | * | ||
| 4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 5 | * copy of this software and associated documentation files (the "Software"), | ||
| 6 | * to deal in the Software without restriction, including without limitation | ||
| 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 9 | * Software is furnished to do so, subject to the following conditions: | ||
| 10 | * | ||
| 11 | * The above copyright notice and this permission notice (including the next | ||
| 12 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 13 | * Software. | ||
| 14 | * | ||
| 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 18 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
| 21 | * IN THE SOFTWARE. | ||
| 22 | * | ||
| 23 | * Authors: | ||
| 24 | * Jesse Barnes <jbarnes@virtuousgeek.org> | ||
| 25 | * | ||
| 26 | */ | ||
| 27 | #ifndef _DRM_MEM_UTIL_H_ | ||
| 28 | #define _DRM_MEM_UTIL_H_ | ||
| 29 | |||
| 30 | #include <linux/vmalloc.h> | ||
| 31 | |||
| 32 | static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) | ||
| 33 | { | ||
| 34 | if (size != 0 && nmemb > ULONG_MAX / size) | ||
| 35 | return NULL; | ||
| 36 | |||
| 37 | if (size * nmemb <= PAGE_SIZE) | ||
| 38 | return kcalloc(nmemb, size, GFP_KERNEL); | ||
| 39 | |||
| 40 | return __vmalloc(size * nmemb, | ||
| 41 | GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL); | ||
| 42 | } | ||
| 43 | |||
| 44 | /* Modeled after cairo's malloc_ab, it's like calloc but without the zeroing. */ | ||
| 45 | static __inline__ void *drm_malloc_ab(size_t nmemb, size_t size) | ||
| 46 | { | ||
| 47 | if (size != 0 && nmemb > ULONG_MAX / size) | ||
| 48 | return NULL; | ||
| 49 | |||
| 50 | if (size * nmemb <= PAGE_SIZE) | ||
| 51 | return kmalloc(nmemb * size, GFP_KERNEL); | ||
| 52 | |||
| 53 | return __vmalloc(size * nmemb, | ||
| 54 | GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL); | ||
| 55 | } | ||
| 56 | |||
| 57 | static __inline void drm_free_large(void *ptr) | ||
| 58 | { | ||
| 59 | if (!is_vmalloc_addr(ptr)) | ||
| 60 | return kfree(ptr); | ||
| 61 | |||
| 62 | vfree(ptr); | ||
| 63 | } | ||
| 64 | |||
| 65 | #endif | ||
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index 676104b7818c..2d428b088cc8 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | {0x1002, 0x3150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ | 6 | {0x1002, 0x3150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ |
| 7 | {0x1002, 0x3152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 7 | {0x1002, 0x3152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 8 | {0x1002, 0x3154, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 8 | {0x1002, 0x3154, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 9 | {0x1002, 0x3155, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 9 | {0x1002, 0x3E50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ | 10 | {0x1002, 0x3E50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ |
| 10 | {0x1002, 0x3E54, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ | 11 | {0x1002, 0x3E54, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ |
| 11 | {0x1002, 0x4136, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS100|RADEON_IS_IGP}, \ | 12 | {0x1002, 0x4136, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS100|RADEON_IS_IGP}, \ |
| @@ -410,6 +411,7 @@ | |||
| 410 | {0x1002, 0x9712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 411 | {0x1002, 0x9712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
| 411 | {0x1002, 0x9713, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 412 | {0x1002, 0x9713, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
| 412 | {0x1002, 0x9714, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 413 | {0x1002, 0x9714, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
| 414 | {0x1002, 0x9715, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
| 413 | {0, 0, 0} | 415 | {0, 0, 0} |
| 414 | 416 | ||
| 415 | #define r128_PCI_IDS \ | 417 | #define r128_PCI_IDS \ |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index e3f1b4a4b601..6b9db917e717 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
| @@ -115,7 +115,6 @@ struct ttm_backend { | |||
| 115 | struct ttm_backend_func *func; | 115 | struct ttm_backend_func *func; |
| 116 | }; | 116 | }; |
| 117 | 117 | ||
| 118 | #define TTM_PAGE_FLAG_VMALLOC (1 << 0) | ||
| 119 | #define TTM_PAGE_FLAG_USER (1 << 1) | 118 | #define TTM_PAGE_FLAG_USER (1 << 1) |
| 120 | #define TTM_PAGE_FLAG_USER_DIRTY (1 << 2) | 119 | #define TTM_PAGE_FLAG_USER_DIRTY (1 << 2) |
| 121 | #define TTM_PAGE_FLAG_WRITE (1 << 3) | 120 | #define TTM_PAGE_FLAG_WRITE (1 << 3) |
| @@ -790,34 +789,6 @@ extern void ttm_bo_unreserve(struct ttm_buffer_object *bo); | |||
| 790 | extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, | 789 | extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, |
| 791 | bool interruptible); | 790 | bool interruptible); |
| 792 | 791 | ||
| 793 | /** | ||
| 794 | * ttm_bo_block_reservation | ||
| 795 | * | ||
| 796 | * @bo: A pointer to a struct ttm_buffer_object. | ||
| 797 | * @interruptible: Use interruptible sleep when waiting. | ||
| 798 | * @no_wait: Don't sleep, but rather return -EBUSY. | ||
| 799 | * | ||
| 800 | * Block reservation for validation by simply reserving the buffer. | ||
| 801 | * This is intended for single buffer use only without eviction, | ||
| 802 | * and thus needs no deadlock protection. | ||
| 803 | * | ||
| 804 | * Returns: | ||
| 805 | * -EBUSY: If no_wait == 1 and the buffer is already reserved. | ||
| 806 | * -ERESTARTSYS: If interruptible == 1 and the process received a signal | ||
| 807 | * while sleeping. | ||
| 808 | */ | ||
| 809 | extern int ttm_bo_block_reservation(struct ttm_buffer_object *bo, | ||
| 810 | bool interruptible, bool no_wait); | ||
| 811 | |||
| 812 | /** | ||
| 813 | * ttm_bo_unblock_reservation | ||
| 814 | * | ||
| 815 | * @bo: A pointer to a struct ttm_buffer_object. | ||
| 816 | * | ||
| 817 | * Unblocks reservation leaving lru lists untouched. | ||
| 818 | */ | ||
| 819 | extern void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo); | ||
| 820 | |||
| 821 | /* | 792 | /* |
| 822 | * ttm_bo_util.c | 793 | * ttm_bo_util.c |
| 823 | */ | 794 | */ |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index e2ea0b2159cd..2fc8e14cc24a 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -94,6 +94,7 @@ header-y += if_ppp.h | |||
| 94 | header-y += if_slip.h | 94 | header-y += if_slip.h |
| 95 | header-y += if_strip.h | 95 | header-y += if_strip.h |
| 96 | header-y += if_tun.h | 96 | header-y += if_tun.h |
| 97 | header-y += if_x25.h | ||
| 97 | header-y += in_route.h | 98 | header-y += in_route.h |
| 98 | header-y += ioctl.h | 99 | header-y += ioctl.h |
| 99 | header-y += ip6_tunnel.h | 100 | header-y += ip6_tunnel.h |
diff --git a/include/linux/acct.h b/include/linux/acct.h index 882dc7248766..3e4737fa6cce 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h | |||
| @@ -121,16 +121,15 @@ struct vfsmount; | |||
| 121 | struct super_block; | 121 | struct super_block; |
| 122 | struct pacct_struct; | 122 | struct pacct_struct; |
| 123 | struct pid_namespace; | 123 | struct pid_namespace; |
| 124 | extern int acct_parm[]; /* for sysctl */ | ||
| 124 | extern void acct_auto_close_mnt(struct vfsmount *m); | 125 | extern void acct_auto_close_mnt(struct vfsmount *m); |
| 125 | extern void acct_auto_close(struct super_block *sb); | 126 | extern void acct_auto_close(struct super_block *sb); |
| 126 | extern void acct_init_pacct(struct pacct_struct *pacct); | ||
| 127 | extern void acct_collect(long exitcode, int group_dead); | 127 | extern void acct_collect(long exitcode, int group_dead); |
| 128 | extern void acct_process(void); | 128 | extern void acct_process(void); |
| 129 | extern void acct_exit_ns(struct pid_namespace *); | 129 | extern void acct_exit_ns(struct pid_namespace *); |
| 130 | #else | 130 | #else |
| 131 | #define acct_auto_close_mnt(x) do { } while (0) | 131 | #define acct_auto_close_mnt(x) do { } while (0) |
| 132 | #define acct_auto_close(x) do { } while (0) | 132 | #define acct_auto_close(x) do { } while (0) |
| 133 | #define acct_init_pacct(x) do { } while (0) | ||
| 134 | #define acct_collect(x,y) do { } while (0) | 133 | #define acct_collect(x,y) do { } while (0) |
| 135 | #define acct_process() do { } while (0) | 134 | #define acct_process() do { } while (0) |
| 136 | #define acct_exit_ns(ns) do { } while (0) | 135 | #define acct_exit_ns(ns) do { } while (0) |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index b926afe8c03e..3da73f5f0ae9 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -116,11 +116,12 @@ extern unsigned long acpi_realmode_flags; | |||
| 116 | 116 | ||
| 117 | int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity); | 117 | int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity); |
| 118 | int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); | 118 | int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); |
| 119 | int acpi_isa_irq_to_gsi (unsigned isa_irq, u32 *gsi); | ||
| 119 | 120 | ||
| 120 | #ifdef CONFIG_X86_IO_APIC | 121 | #ifdef CONFIG_X86_IO_APIC |
| 121 | extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity); | 122 | extern int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity); |
| 122 | #else | 123 | #else |
| 123 | #define acpi_get_override_irq(bus, trigger, polarity) (-1) | 124 | #define acpi_get_override_irq(gsi, trigger, polarity) (-1) |
| 124 | #endif | 125 | #endif |
| 125 | /* | 126 | /* |
| 126 | * This function undoes the effect of one call to acpi_register_gsi(). | 127 | * This function undoes the effect of one call to acpi_register_gsi(). |
diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h new file mode 100644 index 000000000000..f7dd576dd5a4 --- /dev/null +++ b/include/linux/ahci_platform.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | /* | ||
| 2 | * AHCI SATA platform driver | ||
| 3 | * | ||
| 4 | * Copyright 2004-2005 Red Hat, Inc. | ||
| 5 | * Jeff Garzik <jgarzik@pobox.com> | ||
| 6 | * Copyright 2010 MontaVista Software, LLC. | ||
| 7 | * Anton Vorontsov <avorontsov@ru.mvista.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 12 | * any later version. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _AHCI_PLATFORM_H | ||
| 16 | #define _AHCI_PLATFORM_H | ||
| 17 | |||
| 18 | struct device; | ||
| 19 | struct ata_port_info; | ||
| 20 | |||
| 21 | struct ahci_platform_data { | ||
| 22 | int (*init)(struct device *dev); | ||
| 23 | void (*exit)(struct device *dev); | ||
| 24 | const struct ata_port_info *ata_port_info; | ||
| 25 | unsigned int force_port_map; | ||
| 26 | unsigned int mask_port_map; | ||
| 27 | }; | ||
| 28 | |||
| 29 | #endif /* _AHCI_PLATFORM_H */ | ||
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 6816be6c3f77..8b1038607831 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
| @@ -14,6 +14,9 @@ | |||
| 14 | #ifndef ASMARM_AMBA_H | 14 | #ifndef ASMARM_AMBA_H |
| 15 | #define ASMARM_AMBA_H | 15 | #define ASMARM_AMBA_H |
| 16 | 16 | ||
| 17 | #include <linux/device.h> | ||
| 18 | #include <linux/resource.h> | ||
| 19 | |||
| 17 | #define AMBA_NR_IRQS 2 | 20 | #define AMBA_NR_IRQS 2 |
| 18 | 21 | ||
| 19 | struct amba_device { | 22 | struct amba_device { |
diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h index 29c0448265cf..ca16c3801a1e 100644 --- a/include/linux/amba/clcd.h +++ b/include/linux/amba/clcd.h | |||
| @@ -21,22 +21,21 @@ | |||
| 21 | #define CLCD_UBAS 0x00000010 | 21 | #define CLCD_UBAS 0x00000010 |
| 22 | #define CLCD_LBAS 0x00000014 | 22 | #define CLCD_LBAS 0x00000014 |
| 23 | 23 | ||
| 24 | #if !defined(CONFIG_ARCH_VERSATILE) && !defined(CONFIG_ARCH_REALVIEW) | 24 | #define CLCD_PL110_IENB 0x00000018 |
| 25 | #define CLCD_IENB 0x00000018 | 25 | #define CLCD_PL110_CNTL 0x0000001c |
| 26 | #define CLCD_CNTL 0x0000001c | 26 | #define CLCD_PL110_STAT 0x00000020 |
| 27 | #else | 27 | #define CLCD_PL110_INTR 0x00000024 |
| 28 | /* | 28 | #define CLCD_PL110_UCUR 0x00000028 |
| 29 | * Someone rearranged these two registers on the Versatile | 29 | #define CLCD_PL110_LCUR 0x0000002C |
| 30 | * platform... | 30 | |
| 31 | */ | 31 | #define CLCD_PL111_CNTL 0x00000018 |
| 32 | #define CLCD_IENB 0x0000001c | 32 | #define CLCD_PL111_IENB 0x0000001c |
| 33 | #define CLCD_CNTL 0x00000018 | 33 | #define CLCD_PL111_RIS 0x00000020 |
| 34 | #endif | 34 | #define CLCD_PL111_MIS 0x00000024 |
| 35 | 35 | #define CLCD_PL111_ICR 0x00000028 | |
| 36 | #define CLCD_STAT 0x00000020 | 36 | #define CLCD_PL111_UCUR 0x0000002c |
| 37 | #define CLCD_INTR 0x00000024 | 37 | #define CLCD_PL111_LCUR 0x00000030 |
| 38 | #define CLCD_UCUR 0x00000028 | 38 | |
| 39 | #define CLCD_LCUR 0x0000002C | ||
| 40 | #define CLCD_PALL 0x00000200 | 39 | #define CLCD_PALL 0x00000200 |
| 41 | #define CLCD_PALETTE 0x00000200 | 40 | #define CLCD_PALETTE 0x00000200 |
| 42 | 41 | ||
| @@ -147,6 +146,8 @@ struct clcd_fb { | |||
| 147 | struct clcd_board *board; | 146 | struct clcd_board *board; |
| 148 | void *board_data; | 147 | void *board_data; |
| 149 | void __iomem *regs; | 148 | void __iomem *regs; |
| 149 | u16 off_ienb; | ||
| 150 | u16 off_cntl; | ||
| 150 | u32 clcd_cntl; | 151 | u32 clcd_cntl; |
| 151 | u32 cmap[16]; | 152 | u32 cmap[16]; |
| 152 | }; | 153 | }; |
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h index 6b4241748dda..7e466fe72025 100644 --- a/include/linux/amba/mmci.h +++ b/include/linux/amba/mmci.h | |||
| @@ -6,8 +6,29 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/mmc/host.h> | 7 | #include <linux/mmc/host.h> |
| 8 | 8 | ||
| 9 | /** | ||
| 10 | * struct mmci_platform_data - platform configuration for the MMCI | ||
| 11 | * (also known as PL180) block. | ||
| 12 | * @f_max: the maximum operational frequency for this host in this | ||
| 13 | * platform configuration. When this is specified it takes precedence | ||
| 14 | * over the module parameter for the same frequency. | ||
| 15 | * @ocr_mask: available voltages on the 4 pins from the block, this | ||
| 16 | * is ignored if a regulator is used, see the MMC_VDD_* masks in | ||
| 17 | * mmc/host.h | ||
| 18 | * @translate_vdd: a callback function to translate a MMC_VDD_* | ||
| 19 | * mask into a value to be binary or:ed and written into the | ||
| 20 | * MMCIPWR register of the block | ||
| 21 | * @status: if no GPIO read function was given to the block in | ||
| 22 | * gpio_wp (below) this function will be called to determine | ||
| 23 | * whether a card is present in the MMC slot or not | ||
| 24 | * @gpio_wp: read this GPIO pin to see if the card is write protected | ||
| 25 | * @gpio_cd: read this GPIO pin to detect card insertion | ||
| 26 | * @capabilities: the capabilities of the block as implemented in | ||
| 27 | * this platform, signify anything MMC_CAP_* from mmc/host.h | ||
| 28 | */ | ||
| 9 | struct mmci_platform_data { | 29 | struct mmci_platform_data { |
| 10 | unsigned int ocr_mask; /* available voltages */ | 30 | unsigned int f_max; |
| 31 | unsigned int ocr_mask; | ||
| 11 | u32 (*translate_vdd)(struct device *, unsigned int); | 32 | u32 (*translate_vdd)(struct device *, unsigned int); |
| 12 | unsigned int (*status)(struct device *); | 33 | unsigned int (*status)(struct device *); |
| 13 | int gpio_wp; | 34 | int gpio_wp; |
diff --git a/include/linux/amba/pl061.h b/include/linux/amba/pl061.h index b4fbd9862606..5ddd9ad4b19c 100644 --- a/include/linux/amba/pl061.h +++ b/include/linux/amba/pl061.h | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | #include <linux/types.h> | ||
| 2 | |||
| 1 | /* platform data for the PL061 GPIO driver */ | 3 | /* platform data for the PL061 GPIO driver */ |
| 2 | 4 | ||
| 3 | struct pl061_platform_data { | 5 | struct pl061_platform_data { |
diff --git a/include/linux/ata.h b/include/linux/ata.h index b4c85e2adef5..fe6e681a9d74 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -467,7 +467,7 @@ enum ata_ioctls { | |||
| 467 | 467 | ||
| 468 | /* core structures */ | 468 | /* core structures */ |
| 469 | 469 | ||
| 470 | struct ata_prd { | 470 | struct ata_bmdma_prd { |
| 471 | __le32 addr; | 471 | __le32 addr; |
| 472 | __le32 flags_len; | 472 | __le32 flags_len; |
| 473 | }; | 473 | }; |
| @@ -1025,8 +1025,8 @@ static inline int ata_ok(u8 status) | |||
| 1025 | 1025 | ||
| 1026 | static inline int lba_28_ok(u64 block, u32 n_block) | 1026 | static inline int lba_28_ok(u64 block, u32 n_block) |
| 1027 | { | 1027 | { |
| 1028 | /* check the ending block number */ | 1028 | /* check the ending block number: must be LESS THAN 0x0fffffff */ |
| 1029 | return ((block + n_block) < ((u64)1 << 28)) && (n_block <= 256); | 1029 | return ((block + n_block) < ((1 << 28) - 1)) && (n_block <= 256); |
| 1030 | } | 1030 | } |
| 1031 | 1031 | ||
| 1032 | static inline int lba_48_ok(u64 block, u32 n_block) | 1032 | static inline int lba_48_ok(u64 block, u32 n_block) |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index fcbc26af00e4..bd0e3c6f323f 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
| @@ -101,6 +101,7 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent, | |||
| 101 | const char *fmt, ...); | 101 | const char *fmt, ...); |
| 102 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); | 102 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); |
| 103 | void bdi_unregister(struct backing_dev_info *bdi); | 103 | void bdi_unregister(struct backing_dev_info *bdi); |
| 104 | int bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int); | ||
| 104 | void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb, | 105 | void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb, |
| 105 | long nr_pages); | 106 | long nr_pages); |
| 106 | int bdi_writeback_task(struct bdi_writeback *wb); | 107 | int bdi_writeback_task(struct bdi_writeback *wb); |
| @@ -246,6 +247,7 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio); | |||
| 246 | #endif | 247 | #endif |
| 247 | 248 | ||
| 248 | extern struct backing_dev_info default_backing_dev_info; | 249 | extern struct backing_dev_info default_backing_dev_info; |
| 250 | extern struct backing_dev_info noop_backing_dev_info; | ||
| 249 | void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page); | 251 | void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page); |
| 250 | 252 | ||
| 251 | int writeback_in_progress(struct backing_dev_info *bdi); | 253 | int writeback_in_progress(struct backing_dev_info *bdi); |
diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 8c4f884db6b4..4a3d52e545e1 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h | |||
| @@ -36,18 +36,18 @@ struct backlight_device; | |||
| 36 | struct fb_info; | 36 | struct fb_info; |
| 37 | 37 | ||
| 38 | struct backlight_ops { | 38 | struct backlight_ops { |
| 39 | const unsigned int options; | 39 | unsigned int options; |
| 40 | 40 | ||
| 41 | #define BL_CORE_SUSPENDRESUME (1 << 0) | 41 | #define BL_CORE_SUSPENDRESUME (1 << 0) |
| 42 | 42 | ||
| 43 | /* Notify the backlight driver some property has changed */ | 43 | /* Notify the backlight driver some property has changed */ |
| 44 | int (* const update_status)(struct backlight_device *); | 44 | int (*update_status)(struct backlight_device *); |
| 45 | /* Return the current backlight brightness (accounting for power, | 45 | /* Return the current backlight brightness (accounting for power, |
| 46 | fb_blank etc.) */ | 46 | fb_blank etc.) */ |
| 47 | int (* const get_brightness)(struct backlight_device *); | 47 | int (*get_brightness)(struct backlight_device *); |
| 48 | /* Check if given framebuffer device is the one bound to this backlight; | 48 | /* Check if given framebuffer device is the one bound to this backlight; |
| 49 | return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ | 49 | return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ |
| 50 | int (* const check_fb)(struct fb_info *); | 50 | int (*check_fb)(struct backlight_device *, struct fb_info *); |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | /* This structure defines all the properties of a backlight */ | 53 | /* This structure defines all the properties of a backlight */ |
| @@ -103,7 +103,8 @@ static inline void backlight_update_status(struct backlight_device *bd) | |||
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | extern struct backlight_device *backlight_device_register(const char *name, | 105 | extern struct backlight_device *backlight_device_register(const char *name, |
| 106 | struct device *dev, void *devdata, const struct backlight_ops *ops); | 106 | struct device *dev, void *devdata, const struct backlight_ops *ops, |
| 107 | const struct backlight_properties *props); | ||
| 107 | extern void backlight_device_unregister(struct backlight_device *bd); | 108 | extern void backlight_device_unregister(struct backlight_device *bd); |
| 108 | extern void backlight_force_update(struct backlight_device *bd, | 109 | extern void backlight_force_update(struct backlight_device *bd, |
| 109 | enum backlight_update_reason reason); | 110 | enum backlight_update_reason reason); |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index b79389879238..fc68053378ce 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
| @@ -10,6 +10,11 @@ | |||
| 10 | #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) | 10 | #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) |
| 11 | #endif | 11 | #endif |
| 12 | 12 | ||
| 13 | extern unsigned int __sw_hweight8(unsigned int w); | ||
| 14 | extern unsigned int __sw_hweight16(unsigned int w); | ||
| 15 | extern unsigned int __sw_hweight32(unsigned int w); | ||
| 16 | extern unsigned long __sw_hweight64(__u64 w); | ||
| 17 | |||
| 13 | /* | 18 | /* |
| 14 | * Include this here because some architectures need generic_ffs/fls in | 19 | * Include this here because some architectures need generic_ffs/fls in |
| 15 | * scope | 20 | * scope |
| @@ -21,9 +26,6 @@ | |||
| 21 | (bit) < (size); \ | 26 | (bit) < (size); \ |
| 22 | (bit) = find_next_bit((addr), (size), (bit) + 1)) | 27 | (bit) = find_next_bit((addr), (size), (bit) + 1)) |
| 23 | 28 | ||
| 24 | /* Temporary */ | ||
| 25 | #define for_each_bit(bit, addr, size) for_each_set_bit(bit, addr, size) | ||
| 26 | |||
| 27 | static __inline__ int get_bitmask_order(unsigned int count) | 29 | static __inline__ int get_bitmask_order(unsigned int count) |
| 28 | { | 30 | { |
| 29 | int order; | 31 | int order; |
| @@ -47,31 +49,6 @@ static inline unsigned long hweight_long(unsigned long w) | |||
| 47 | return sizeof(w) == 4 ? hweight32(w) : hweight64(w); | 49 | return sizeof(w) == 4 ? hweight32(w) : hweight64(w); |
| 48 | } | 50 | } |
| 49 | 51 | ||
| 50 | /* | ||
| 51 | * Clearly slow versions of the hweightN() functions, their benefit is | ||
| 52 | * of course compile time evaluation of constant arguments. | ||
| 53 | */ | ||
| 54 | #define HWEIGHT8(w) \ | ||
| 55 | ( BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + \ | ||
| 56 | (!!((w) & (1ULL << 0))) + \ | ||
| 57 | (!!((w) & (1ULL << 1))) + \ | ||
| 58 | (!!((w) & (1ULL << 2))) + \ | ||
| 59 | (!!((w) & (1ULL << 3))) + \ | ||
| 60 | (!!((w) & (1ULL << 4))) + \ | ||
| 61 | (!!((w) & (1ULL << 5))) + \ | ||
| 62 | (!!((w) & (1ULL << 6))) + \ | ||
| 63 | (!!((w) & (1ULL << 7))) ) | ||
| 64 | |||
| 65 | #define HWEIGHT16(w) (HWEIGHT8(w) + HWEIGHT8((w) >> 8)) | ||
| 66 | #define HWEIGHT32(w) (HWEIGHT16(w) + HWEIGHT16((w) >> 16)) | ||
| 67 | #define HWEIGHT64(w) (HWEIGHT32(w) + HWEIGHT32((w) >> 32)) | ||
| 68 | |||
| 69 | /* | ||
| 70 | * Type invariant version that simply casts things to the | ||
| 71 | * largest type. | ||
| 72 | */ | ||
| 73 | #define HWEIGHT(w) HWEIGHT64((u64)(w)) | ||
| 74 | |||
| 75 | /** | 52 | /** |
| 76 | * rol32 - rotate a 32-bit value left | 53 | * rol32 - rotate a 32-bit value left |
| 77 | * @word: value to rotate | 54 | * @word: value to rotate |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index ebd22dbed861..6690e8bae7bb 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -158,7 +158,6 @@ enum rq_flag_bits { | |||
| 158 | struct request { | 158 | struct request { |
| 159 | struct list_head queuelist; | 159 | struct list_head queuelist; |
| 160 | struct call_single_data csd; | 160 | struct call_single_data csd; |
| 161 | int cpu; | ||
| 162 | 161 | ||
| 163 | struct request_queue *q; | 162 | struct request_queue *q; |
| 164 | 163 | ||
| @@ -166,9 +165,11 @@ struct request { | |||
| 166 | enum rq_cmd_type_bits cmd_type; | 165 | enum rq_cmd_type_bits cmd_type; |
| 167 | unsigned long atomic_flags; | 166 | unsigned long atomic_flags; |
| 168 | 167 | ||
| 168 | int cpu; | ||
| 169 | |||
| 169 | /* the following two fields are internal, NEVER access directly */ | 170 | /* the following two fields are internal, NEVER access directly */ |
| 170 | sector_t __sector; /* sector cursor */ | ||
| 171 | unsigned int __data_len; /* total data len */ | 171 | unsigned int __data_len; /* total data len */ |
| 172 | sector_t __sector; /* sector cursor */ | ||
| 172 | 173 | ||
| 173 | struct bio *bio; | 174 | struct bio *bio; |
| 174 | struct bio *biotail; | 175 | struct bio *biotail; |
| @@ -201,20 +202,20 @@ struct request { | |||
| 201 | 202 | ||
| 202 | unsigned short ioprio; | 203 | unsigned short ioprio; |
| 203 | 204 | ||
| 205 | int ref_count; | ||
| 206 | |||
| 204 | void *special; /* opaque pointer available for LLD use */ | 207 | void *special; /* opaque pointer available for LLD use */ |
| 205 | char *buffer; /* kaddr of the current segment if available */ | 208 | char *buffer; /* kaddr of the current segment if available */ |
| 206 | 209 | ||
| 207 | int tag; | 210 | int tag; |
| 208 | int errors; | 211 | int errors; |
| 209 | 212 | ||
| 210 | int ref_count; | ||
| 211 | |||
| 212 | /* | 213 | /* |
| 213 | * when request is used as a packet command carrier | 214 | * when request is used as a packet command carrier |
| 214 | */ | 215 | */ |
| 215 | unsigned short cmd_len; | ||
| 216 | unsigned char __cmd[BLK_MAX_CDB]; | 216 | unsigned char __cmd[BLK_MAX_CDB]; |
| 217 | unsigned char *cmd; | 217 | unsigned char *cmd; |
| 218 | unsigned short cmd_len; | ||
| 218 | 219 | ||
| 219 | unsigned int extra_len; /* length of alignment and padding */ | 220 | unsigned int extra_len; /* length of alignment and padding */ |
| 220 | unsigned int sense_len; | 221 | unsigned int sense_len; |
| @@ -921,26 +922,7 @@ extern void blk_cleanup_queue(struct request_queue *); | |||
| 921 | extern void blk_queue_make_request(struct request_queue *, make_request_fn *); | 922 | extern void blk_queue_make_request(struct request_queue *, make_request_fn *); |
| 922 | extern void blk_queue_bounce_limit(struct request_queue *, u64); | 923 | extern void blk_queue_bounce_limit(struct request_queue *, u64); |
| 923 | extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); | 924 | extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); |
| 924 | |||
| 925 | /* Temporary compatibility wrapper */ | ||
| 926 | static inline void blk_queue_max_sectors(struct request_queue *q, unsigned int max) | ||
| 927 | { | ||
| 928 | blk_queue_max_hw_sectors(q, max); | ||
| 929 | } | ||
| 930 | |||
| 931 | extern void blk_queue_max_segments(struct request_queue *, unsigned short); | 925 | extern void blk_queue_max_segments(struct request_queue *, unsigned short); |
| 932 | |||
| 933 | static inline void blk_queue_max_phys_segments(struct request_queue *q, unsigned short max) | ||
| 934 | { | ||
| 935 | blk_queue_max_segments(q, max); | ||
| 936 | } | ||
| 937 | |||
| 938 | static inline void blk_queue_max_hw_segments(struct request_queue *q, unsigned short max) | ||
| 939 | { | ||
| 940 | blk_queue_max_segments(q, max); | ||
| 941 | } | ||
| 942 | |||
| 943 | |||
| 944 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); | 926 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); |
| 945 | extern void blk_queue_max_discard_sectors(struct request_queue *q, | 927 | extern void blk_queue_max_discard_sectors(struct request_queue *q, |
| 946 | unsigned int max_discard_sectors); | 928 | unsigned int max_discard_sectors); |
| @@ -1030,11 +1012,6 @@ static inline int sb_issue_discard(struct super_block *sb, | |||
| 1030 | 1012 | ||
| 1031 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); | 1013 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); |
| 1032 | 1014 | ||
| 1033 | #define MAX_PHYS_SEGMENTS 128 | ||
| 1034 | #define MAX_HW_SEGMENTS 128 | ||
| 1035 | #define SAFE_MAX_SECTORS 255 | ||
| 1036 | #define MAX_SEGMENT_SIZE 65536 | ||
| 1037 | |||
| 1038 | enum blk_default_limits { | 1015 | enum blk_default_limits { |
| 1039 | BLK_MAX_SEGMENTS = 128, | 1016 | BLK_MAX_SEGMENTS = 128, |
| 1040 | BLK_SAFE_MAX_SECTORS = 255, | 1017 | BLK_SAFE_MAX_SECTORS = 255, |
diff --git a/include/linux/caif/caif_socket.h b/include/linux/caif/caif_socket.h new file mode 100644 index 000000000000..2a61eb1beb85 --- /dev/null +++ b/include/linux/caif/caif_socket.h | |||
| @@ -0,0 +1,165 @@ | |||
| 1 | /* linux/caif_socket.h | ||
| 2 | * CAIF Definitions for CAIF socket and network layer | ||
| 3 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 4 | * Author: Sjur Brendeland/ sjur.brandeland@stericsson.com | ||
| 5 | * License terms: GNU General Public License (GPL) version 2 | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef _LINUX_CAIF_SOCKET_H | ||
| 9 | #define _LINUX_CAIF_SOCKET_H | ||
| 10 | |||
| 11 | #include <linux/types.h> | ||
| 12 | |||
| 13 | #ifdef __KERNEL__ | ||
| 14 | #include <linux/socket.h> | ||
| 15 | #else | ||
| 16 | #include <sys/socket.h> | ||
| 17 | #endif | ||
| 18 | |||
| 19 | /** | ||
| 20 | * enum caif_link_selector - Physical Link Selection. | ||
| 21 | * @CAIF_LINK_HIGH_BANDW: Physical interface for high-bandwidth | ||
| 22 | * traffic. | ||
| 23 | * @CAIF_LINK_LOW_LATENCY: Physical interface for low-latency | ||
| 24 | * traffic. | ||
| 25 | * | ||
| 26 | * CAIF Link Layers can register their link properties. | ||
| 27 | * This enum is used for choosing between CAIF Link Layers when | ||
| 28 | * setting up CAIF Channels when multiple CAIF Link Layers exists. | ||
| 29 | */ | ||
| 30 | enum caif_link_selector { | ||
| 31 | CAIF_LINK_HIGH_BANDW, | ||
| 32 | CAIF_LINK_LOW_LATENCY | ||
| 33 | }; | ||
| 34 | |||
| 35 | /** | ||
| 36 | * enum caif_channel_priority - CAIF channel priorities. | ||
| 37 | * | ||
| 38 | * @CAIF_PRIO_MIN: Min priority for a channel. | ||
| 39 | * @CAIF_PRIO_LOW: Low-priority channel. | ||
| 40 | * @CAIF_PRIO_NORMAL: Normal/default priority level. | ||
| 41 | * @CAIF_PRIO_HIGH: High priority level | ||
| 42 | * @CAIF_PRIO_MAX: Max priority for channel | ||
| 43 | * | ||
| 44 | * Priority can be set on CAIF Channels in order to | ||
| 45 | * prioritize between traffic on different CAIF Channels. | ||
| 46 | * These priority levels are recommended, but the priority value | ||
| 47 | * is not restricted to the values defined in this enum, any value | ||
| 48 | * between CAIF_PRIO_MIN and CAIF_PRIO_MAX could be used. | ||
| 49 | */ | ||
| 50 | enum caif_channel_priority { | ||
| 51 | CAIF_PRIO_MIN = 0x01, | ||
| 52 | CAIF_PRIO_LOW = 0x04, | ||
| 53 | CAIF_PRIO_NORMAL = 0x0f, | ||
| 54 | CAIF_PRIO_HIGH = 0x14, | ||
| 55 | CAIF_PRIO_MAX = 0x1F | ||
| 56 | }; | ||
| 57 | |||
| 58 | /** | ||
| 59 | * enum caif_protocol_type - CAIF Channel type. | ||
| 60 | * @CAIFPROTO_AT: Classic AT channel. | ||
| 61 | * @CAIFPROTO_DATAGRAM: Datagram channel. | ||
| 62 | * @CAIFPROTO_DATAGRAM_LOOP: Datagram loopback channel, used for testing. | ||
| 63 | * @CAIFPROTO_UTIL: Utility (Psock) channel. | ||
| 64 | * @CAIFPROTO_RFM: Remote File Manager | ||
| 65 | * | ||
| 66 | * This enum defines the CAIF Channel type to be used. This defines | ||
| 67 | * the service to connect to on the modem. | ||
| 68 | */ | ||
| 69 | enum caif_protocol_type { | ||
| 70 | CAIFPROTO_AT, | ||
| 71 | CAIFPROTO_DATAGRAM, | ||
| 72 | CAIFPROTO_DATAGRAM_LOOP, | ||
| 73 | CAIFPROTO_UTIL, | ||
| 74 | CAIFPROTO_RFM, | ||
| 75 | _CAIFPROTO_MAX | ||
| 76 | }; | ||
| 77 | #define CAIFPROTO_MAX _CAIFPROTO_MAX | ||
| 78 | |||
| 79 | /** | ||
| 80 | * enum caif_at_type - AT Service Endpoint | ||
| 81 | * @CAIF_ATTYPE_PLAIN: Connects to a plain vanilla AT channel. | ||
| 82 | */ | ||
| 83 | enum caif_at_type { | ||
| 84 | CAIF_ATTYPE_PLAIN = 2 | ||
| 85 | }; | ||
| 86 | |||
| 87 | /** | ||
| 88 | * struct sockaddr_caif - the sockaddr structure for CAIF sockets. | ||
| 89 | * @family: Address family number, must be AF_CAIF. | ||
| 90 | * @u: Union of address data 'switched' by family. | ||
| 91 | * : | ||
| 92 | * @u.at: Applies when family = CAIFPROTO_AT. | ||
| 93 | * | ||
| 94 | * @u.at.type: Type of AT link to set up (enum caif_at_type). | ||
| 95 | * | ||
| 96 | * @u.util: Applies when family = CAIFPROTO_UTIL | ||
| 97 | * | ||
| 98 | * @u.util.service: Utility service name. | ||
| 99 | * | ||
| 100 | * @u.dgm: Applies when family = CAIFPROTO_DATAGRAM | ||
| 101 | * | ||
| 102 | * @u.dgm.connection_id: Datagram connection id. | ||
| 103 | * | ||
| 104 | * @u.dgm.nsapi: NSAPI of the PDP-Context. | ||
| 105 | * | ||
| 106 | * @u.rfm: Applies when family = CAIFPROTO_RFM | ||
| 107 | * | ||
| 108 | * @u.rfm.connection_id: Connection ID for RFM. | ||
| 109 | * | ||
| 110 | * @u.rfm.volume: Volume to mount. | ||
| 111 | * | ||
| 112 | * Description: | ||
| 113 | * This structure holds the connect parameters used for setting up a | ||
| 114 | * CAIF Channel. It defines the service to connect to on the modem. | ||
| 115 | */ | ||
| 116 | struct sockaddr_caif { | ||
| 117 | sa_family_t family; | ||
| 118 | union { | ||
| 119 | struct { | ||
| 120 | __u8 type; /* type: enum caif_at_type */ | ||
| 121 | } at; /* CAIFPROTO_AT */ | ||
| 122 | struct { | ||
| 123 | char service[16]; | ||
| 124 | } util; /* CAIFPROTO_UTIL */ | ||
| 125 | union { | ||
| 126 | __u32 connection_id; | ||
| 127 | __u8 nsapi; | ||
| 128 | } dgm; /* CAIFPROTO_DATAGRAM(_LOOP)*/ | ||
| 129 | struct { | ||
| 130 | __u32 connection_id; | ||
| 131 | char volume[16]; | ||
| 132 | } rfm; /* CAIFPROTO_RFM */ | ||
| 133 | } u; | ||
| 134 | }; | ||
| 135 | |||
| 136 | /** | ||
| 137 | * enum caif_socket_opts - CAIF option values for getsockopt and setsockopt. | ||
| 138 | * | ||
| 139 | * @CAIFSO_LINK_SELECT: Selector used if multiple CAIF Link layers are | ||
| 140 | * available. Either a high bandwidth | ||
| 141 | * link can be selected (CAIF_LINK_HIGH_BANDW) or | ||
| 142 | * or a low latency link (CAIF_LINK_LOW_LATENCY). | ||
| 143 | * This option is of type __u32. | ||
| 144 | * Alternatively SO_BINDTODEVICE can be used. | ||
| 145 | * | ||
| 146 | * @CAIFSO_REQ_PARAM: Used to set the request parameters for a | ||
| 147 | * utility channel. (maximum 256 bytes). This | ||
| 148 | * option must be set before connecting. | ||
| 149 | * | ||
| 150 | * @CAIFSO_RSP_PARAM: Gets the response parameters for a utility | ||
| 151 | * channel. (maximum 256 bytes). This option | ||
| 152 | * is valid after a successful connect. | ||
| 153 | * | ||
| 154 | * | ||
| 155 | * This enum defines the CAIF Socket options to be used on a socket | ||
| 156 | * of type PF_CAIF. | ||
| 157 | * | ||
| 158 | */ | ||
| 159 | enum caif_socket_opts { | ||
| 160 | CAIFSO_LINK_SELECT = 127, | ||
| 161 | CAIFSO_REQ_PARAM = 128, | ||
| 162 | CAIFSO_RSP_PARAM = 129, | ||
| 163 | }; | ||
| 164 | |||
| 165 | #endif /* _LINUX_CAIF_SOCKET_H */ | ||
diff --git a/include/linux/caif/if_caif.h b/include/linux/caif/if_caif.h new file mode 100644 index 000000000000..5e7eed4edf51 --- /dev/null +++ b/include/linux/caif/if_caif.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 3 | * Author: Sjur Brendeland/ sjur.brandeland@stericsson.com | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef IF_CAIF_H_ | ||
| 8 | #define IF_CAIF_H_ | ||
| 9 | #include <linux/sockios.h> | ||
| 10 | #include <linux/types.h> | ||
| 11 | #include <linux/socket.h> | ||
| 12 | |||
| 13 | /** | ||
| 14 | * enum ifla_caif - CAIF NetlinkRT parameters. | ||
| 15 | * @IFLA_CAIF_IPV4_CONNID: Connection ID for IPv4 PDP Context. | ||
| 16 | * The type of attribute is NLA_U32. | ||
| 17 | * @IFLA_CAIF_IPV6_CONNID: Connection ID for IPv6 PDP Context. | ||
| 18 | * The type of attribute is NLA_U32. | ||
| 19 | * @IFLA_CAIF_LOOPBACK: If different from zero, device is doing loopback | ||
| 20 | * The type of attribute is NLA_U8. | ||
| 21 | * | ||
| 22 | * When using RT Netlink to create, destroy or configure a CAIF IP interface, | ||
| 23 | * enum ifla_caif is used to specify the configuration attributes. | ||
| 24 | */ | ||
| 25 | enum ifla_caif { | ||
| 26 | __IFLA_CAIF_UNSPEC, | ||
| 27 | IFLA_CAIF_IPV4_CONNID, | ||
| 28 | IFLA_CAIF_IPV6_CONNID, | ||
| 29 | IFLA_CAIF_LOOPBACK, | ||
| 30 | __IFLA_CAIF_MAX | ||
| 31 | }; | ||
| 32 | #define IFLA_CAIF_MAX (__IFLA_CAIF_MAX-1) | ||
| 33 | |||
| 34 | #endif /*IF_CAIF_H_*/ | ||
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 6e5a7f00223d..cc0bb4961669 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #ifndef CAN_DEV_H | 14 | #ifndef CAN_DEV_H |
| 15 | #define CAN_DEV_H | 15 | #define CAN_DEV_H |
| 16 | 16 | ||
| 17 | #include <linux/can.h> | ||
| 17 | #include <linux/can/netlink.h> | 18 | #include <linux/can/netlink.h> |
| 18 | #include <linux/can/error.h> | 19 | #include <linux/can/error.h> |
| 19 | 20 | ||
diff --git a/include/linux/can/platform/mcp251x.h b/include/linux/can/platform/mcp251x.h index 1448177d86d5..dba28268e651 100644 --- a/include/linux/can/platform/mcp251x.h +++ b/include/linux/can/platform/mcp251x.h | |||
| @@ -26,8 +26,8 @@ | |||
| 26 | struct mcp251x_platform_data { | 26 | struct mcp251x_platform_data { |
| 27 | unsigned long oscillator_frequency; | 27 | unsigned long oscillator_frequency; |
| 28 | int model; | 28 | int model; |
| 29 | #define CAN_MCP251X_MCP2510 0 | 29 | #define CAN_MCP251X_MCP2510 0x2510 |
| 30 | #define CAN_MCP251X_MCP2515 1 | 30 | #define CAN_MCP251X_MCP2515 0x2515 |
| 31 | int (*board_specific_setup)(struct spi_device *spi); | 31 | int (*board_specific_setup)(struct spi_device *spi); |
| 32 | int (*transceiver_enable)(int enable); | 32 | int (*transceiver_enable)(int enable); |
| 33 | int (*power_enable) (int enable); | 33 | int (*power_enable) (int enable); |
diff --git a/include/linux/can/platform/sja1000.h b/include/linux/can/platform/sja1000.h index 01ee2aeb048d..96f8fcc78d78 100644 --- a/include/linux/can/platform/sja1000.h +++ b/include/linux/can/platform/sja1000.h | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | #define OCR_TX_SHIFT 2 | 26 | #define OCR_TX_SHIFT 2 |
| 27 | 27 | ||
| 28 | struct sja1000_platform_data { | 28 | struct sja1000_platform_data { |
| 29 | u32 clock; /* CAN bus oscillator frequency in Hz */ | 29 | u32 osc_freq; /* CAN bus oscillator frequency in Hz */ |
| 30 | 30 | ||
| 31 | u8 ocr; /* output control register */ | 31 | u8 ocr; /* output control register */ |
| 32 | u8 cdr; /* clock divider register */ | 32 | u8 cdr; /* clock divider register */ |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index c9bbcb2a75ae..8f78073d7caa 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -37,16 +37,24 @@ extern void cgroup_post_fork(struct task_struct *p); | |||
| 37 | extern void cgroup_exit(struct task_struct *p, int run_callbacks); | 37 | extern void cgroup_exit(struct task_struct *p, int run_callbacks); |
| 38 | extern int cgroupstats_build(struct cgroupstats *stats, | 38 | extern int cgroupstats_build(struct cgroupstats *stats, |
| 39 | struct dentry *dentry); | 39 | struct dentry *dentry); |
| 40 | extern int cgroup_load_subsys(struct cgroup_subsys *ss); | ||
| 41 | extern void cgroup_unload_subsys(struct cgroup_subsys *ss); | ||
| 40 | 42 | ||
| 41 | extern const struct file_operations proc_cgroup_operations; | 43 | extern const struct file_operations proc_cgroup_operations; |
| 42 | 44 | ||
| 43 | /* Define the enumeration of all cgroup subsystems */ | 45 | /* Define the enumeration of all builtin cgroup subsystems */ |
| 44 | #define SUBSYS(_x) _x ## _subsys_id, | 46 | #define SUBSYS(_x) _x ## _subsys_id, |
| 45 | enum cgroup_subsys_id { | 47 | enum cgroup_subsys_id { |
| 46 | #include <linux/cgroup_subsys.h> | 48 | #include <linux/cgroup_subsys.h> |
| 47 | CGROUP_SUBSYS_COUNT | 49 | CGROUP_BUILTIN_SUBSYS_COUNT |
| 48 | }; | 50 | }; |
| 49 | #undef SUBSYS | 51 | #undef SUBSYS |
| 52 | /* | ||
| 53 | * This define indicates the maximum number of subsystems that can be loaded | ||
| 54 | * at once. We limit to this many since cgroupfs_root has subsys_bits to keep | ||
| 55 | * track of all of them. | ||
| 56 | */ | ||
| 57 | #define CGROUP_SUBSYS_COUNT (BITS_PER_BYTE*sizeof(unsigned long)) | ||
| 50 | 58 | ||
| 51 | /* Per-subsystem/per-cgroup state maintained by the system. */ | 59 | /* Per-subsystem/per-cgroup state maintained by the system. */ |
| 52 | struct cgroup_subsys_state { | 60 | struct cgroup_subsys_state { |
| @@ -76,6 +84,12 @@ enum { | |||
| 76 | CSS_REMOVED, /* This CSS is dead */ | 84 | CSS_REMOVED, /* This CSS is dead */ |
| 77 | }; | 85 | }; |
| 78 | 86 | ||
| 87 | /* Caller must verify that the css is not for root cgroup */ | ||
| 88 | static inline void __css_get(struct cgroup_subsys_state *css, int count) | ||
| 89 | { | ||
| 90 | atomic_add(count, &css->refcnt); | ||
| 91 | } | ||
| 92 | |||
| 79 | /* | 93 | /* |
| 80 | * Call css_get() to hold a reference on the css; it can be used | 94 | * Call css_get() to hold a reference on the css; it can be used |
| 81 | * for a reference obtained via: | 95 | * for a reference obtained via: |
| @@ -87,7 +101,7 @@ static inline void css_get(struct cgroup_subsys_state *css) | |||
| 87 | { | 101 | { |
| 88 | /* We don't need to reference count the root state */ | 102 | /* We don't need to reference count the root state */ |
| 89 | if (!test_bit(CSS_ROOT, &css->flags)) | 103 | if (!test_bit(CSS_ROOT, &css->flags)) |
| 90 | atomic_inc(&css->refcnt); | 104 | __css_get(css, 1); |
| 91 | } | 105 | } |
| 92 | 106 | ||
| 93 | static inline bool css_is_removed(struct cgroup_subsys_state *css) | 107 | static inline bool css_is_removed(struct cgroup_subsys_state *css) |
| @@ -118,11 +132,11 @@ static inline bool css_tryget(struct cgroup_subsys_state *css) | |||
| 118 | * css_get() or css_tryget() | 132 | * css_get() or css_tryget() |
| 119 | */ | 133 | */ |
| 120 | 134 | ||
| 121 | extern void __css_put(struct cgroup_subsys_state *css); | 135 | extern void __css_put(struct cgroup_subsys_state *css, int count); |
| 122 | static inline void css_put(struct cgroup_subsys_state *css) | 136 | static inline void css_put(struct cgroup_subsys_state *css) |
| 123 | { | 137 | { |
| 124 | if (!test_bit(CSS_ROOT, &css->flags)) | 138 | if (!test_bit(CSS_ROOT, &css->flags)) |
| 125 | __css_put(css); | 139 | __css_put(css, 1); |
| 126 | } | 140 | } |
| 127 | 141 | ||
| 128 | /* bits in struct cgroup flags field */ | 142 | /* bits in struct cgroup flags field */ |
| @@ -221,6 +235,10 @@ struct cgroup { | |||
| 221 | 235 | ||
| 222 | /* For RCU-protected deletion */ | 236 | /* For RCU-protected deletion */ |
| 223 | struct rcu_head rcu_head; | 237 | struct rcu_head rcu_head; |
| 238 | |||
| 239 | /* List of events which userspace want to recieve */ | ||
| 240 | struct list_head event_list; | ||
| 241 | spinlock_t event_list_lock; | ||
| 224 | }; | 242 | }; |
| 225 | 243 | ||
| 226 | /* | 244 | /* |
| @@ -258,7 +276,8 @@ struct css_set { | |||
| 258 | /* | 276 | /* |
| 259 | * Set of subsystem states, one for each subsystem. This array | 277 | * Set of subsystem states, one for each subsystem. This array |
| 260 | * is immutable after creation apart from the init_css_set | 278 | * is immutable after creation apart from the init_css_set |
| 261 | * during subsystem registration (at boot time). | 279 | * during subsystem registration (at boot time) and modular subsystem |
| 280 | * loading/unloading. | ||
| 262 | */ | 281 | */ |
| 263 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; | 282 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; |
| 264 | 283 | ||
| @@ -363,6 +382,23 @@ struct cftype { | |||
| 363 | int (*trigger)(struct cgroup *cgrp, unsigned int event); | 382 | int (*trigger)(struct cgroup *cgrp, unsigned int event); |
| 364 | 383 | ||
| 365 | int (*release)(struct inode *inode, struct file *file); | 384 | int (*release)(struct inode *inode, struct file *file); |
| 385 | |||
| 386 | /* | ||
| 387 | * register_event() callback will be used to add new userspace | ||
| 388 | * waiter for changes related to the cftype. Implement it if | ||
| 389 | * you want to provide this functionality. Use eventfd_signal() | ||
| 390 | * on eventfd to send notification to userspace. | ||
| 391 | */ | ||
| 392 | int (*register_event)(struct cgroup *cgrp, struct cftype *cft, | ||
| 393 | struct eventfd_ctx *eventfd, const char *args); | ||
| 394 | /* | ||
| 395 | * unregister_event() callback will be called when userspace | ||
| 396 | * closes the eventfd or on cgroup removing. | ||
| 397 | * This callback must be implemented, if you want provide | ||
| 398 | * notification functionality. | ||
| 399 | */ | ||
| 400 | int (*unregister_event)(struct cgroup *cgrp, struct cftype *cft, | ||
| 401 | struct eventfd_ctx *eventfd); | ||
| 366 | }; | 402 | }; |
| 367 | 403 | ||
| 368 | struct cgroup_scanner { | 404 | struct cgroup_scanner { |
| @@ -428,6 +464,8 @@ struct cgroup_subsys { | |||
| 428 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 464 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
| 429 | int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 465 | int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
| 430 | struct task_struct *tsk, bool threadgroup); | 466 | struct task_struct *tsk, bool threadgroup); |
| 467 | void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | ||
| 468 | struct task_struct *tsk, bool threadgroup); | ||
| 431 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 469 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
| 432 | struct cgroup *old_cgrp, struct task_struct *tsk, | 470 | struct cgroup *old_cgrp, struct task_struct *tsk, |
| 433 | bool threadgroup); | 471 | bool threadgroup); |
| @@ -472,6 +510,9 @@ struct cgroup_subsys { | |||
| 472 | /* used when use_id == true */ | 510 | /* used when use_id == true */ |
| 473 | struct idr idr; | 511 | struct idr idr; |
| 474 | spinlock_t id_lock; | 512 | spinlock_t id_lock; |
| 513 | |||
| 514 | /* should be defined only by modular subsystems */ | ||
| 515 | struct module *module; | ||
| 475 | }; | 516 | }; |
| 476 | 517 | ||
| 477 | #define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys; | 518 | #define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys; |
| @@ -489,6 +530,7 @@ static inline struct cgroup_subsys_state *task_subsys_state( | |||
| 489 | { | 530 | { |
| 490 | return rcu_dereference_check(task->cgroups->subsys[subsys_id], | 531 | return rcu_dereference_check(task->cgroups->subsys[subsys_id], |
| 491 | rcu_read_lock_held() || | 532 | rcu_read_lock_held() || |
| 533 | lockdep_is_held(&task->alloc_lock) || | ||
| 492 | cgroup_lock_is_held()); | 534 | cgroup_lock_is_held()); |
| 493 | } | 535 | } |
| 494 | 536 | ||
diff --git a/include/linux/circ_buf.h b/include/linux/circ_buf.h index a2ed0591fb19..90f2471dc6f2 100644 --- a/include/linux/circ_buf.h +++ b/include/linux/circ_buf.h | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | /* | ||
| 2 | * See Documentation/circular-buffers.txt for more information. | ||
| 3 | */ | ||
| 4 | |||
| 1 | #ifndef _LINUX_CIRC_BUF_H | 5 | #ifndef _LINUX_CIRC_BUF_H |
| 2 | #define _LINUX_CIRC_BUF_H 1 | 6 | #define _LINUX_CIRC_BUF_H 1 |
| 3 | 7 | ||
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 0cf725bdd2a1..fc53492b6ad7 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
| @@ -73,6 +73,7 @@ enum clock_event_nofitiers { | |||
| 73 | * @list: list head for the management code | 73 | * @list: list head for the management code |
| 74 | * @mode: operating mode assigned by the management code | 74 | * @mode: operating mode assigned by the management code |
| 75 | * @next_event: local storage for the next event in oneshot mode | 75 | * @next_event: local storage for the next event in oneshot mode |
| 76 | * @retries: number of forced programming retries | ||
| 76 | */ | 77 | */ |
| 77 | struct clock_event_device { | 78 | struct clock_event_device { |
| 78 | const char *name; | 79 | const char *name; |
| @@ -93,6 +94,7 @@ struct clock_event_device { | |||
| 93 | struct list_head list; | 94 | struct list_head list; |
| 94 | enum clock_event_mode mode; | 95 | enum clock_event_mode mode; |
| 95 | ktime_t next_event; | 96 | ktime_t next_event; |
| 97 | unsigned long retries; | ||
| 96 | }; | 98 | }; |
| 97 | 99 | ||
| 98 | /* | 100 | /* |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 4bca8b60cdf7..5ea3c60c160c 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
| @@ -273,7 +273,6 @@ static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift) | |||
| 273 | } | 273 | } |
| 274 | 274 | ||
| 275 | 275 | ||
| 276 | /* used to install a new clocksource */ | ||
| 277 | extern int clocksource_register(struct clocksource*); | 276 | extern int clocksource_register(struct clocksource*); |
| 278 | extern void clocksource_unregister(struct clocksource*); | 277 | extern void clocksource_unregister(struct clocksource*); |
| 279 | extern void clocksource_touch_watchdog(void); | 278 | extern void clocksource_touch_watchdog(void); |
| @@ -287,6 +286,24 @@ extern void clocksource_mark_unstable(struct clocksource *cs); | |||
| 287 | extern void | 286 | extern void |
| 288 | clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec); | 287 | clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec); |
| 289 | 288 | ||
| 289 | /* | ||
| 290 | * Don't call __clocksource_register_scale directly, use | ||
| 291 | * clocksource_register_hz/khz | ||
| 292 | */ | ||
| 293 | extern int | ||
| 294 | __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq); | ||
| 295 | |||
| 296 | static inline int clocksource_register_hz(struct clocksource *cs, u32 hz) | ||
| 297 | { | ||
| 298 | return __clocksource_register_scale(cs, 1, hz); | ||
| 299 | } | ||
| 300 | |||
| 301 | static inline int clocksource_register_khz(struct clocksource *cs, u32 khz) | ||
| 302 | { | ||
| 303 | return __clocksource_register_scale(cs, 1000, khz); | ||
| 304 | } | ||
| 305 | |||
| 306 | |||
| 290 | static inline void | 307 | static inline void |
| 291 | clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec) | 308 | clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec) |
| 292 | { | 309 | { |
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index 5b5d4731f956..8859e2ede9fe 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | #define MAX_CODADEVS 5 /* how many do we allow */ | 7 | #define MAX_CODADEVS 5 /* how many do we allow */ |
| 8 | 8 | ||
| 9 | #ifdef __KERNEL__ | 9 | #ifdef __KERNEL__ |
| 10 | #include <linux/backing-dev.h> | ||
| 11 | |||
| 10 | struct kstatfs; | 12 | struct kstatfs; |
| 11 | 13 | ||
| 12 | /* communication pending/processing queues */ | 14 | /* communication pending/processing queues */ |
| @@ -17,6 +19,7 @@ struct venus_comm { | |||
| 17 | struct list_head vc_processing; | 19 | struct list_head vc_processing; |
| 18 | int vc_inuse; | 20 | int vc_inuse; |
| 19 | struct super_block *vc_sb; | 21 | struct super_block *vc_sb; |
| 22 | struct backing_dev_info bdi; | ||
| 20 | }; | 23 | }; |
| 21 | 24 | ||
| 22 | 25 | ||
diff --git a/include/linux/compat.h b/include/linux/compat.h index ef68119a4fd2..717c691ecd8e 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | typedef __compat_uid32_t compat_uid_t; | 23 | typedef __compat_uid32_t compat_uid_t; |
| 24 | typedef __compat_gid32_t compat_gid_t; | 24 | typedef __compat_gid32_t compat_gid_t; |
| 25 | 25 | ||
| 26 | struct compat_sel_arg_struct; | ||
| 26 | struct rusage; | 27 | struct rusage; |
| 27 | 28 | ||
| 28 | struct compat_itimerspec { | 29 | struct compat_itimerspec { |
| @@ -249,6 +250,8 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, | |||
| 249 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | 250 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, |
| 250 | struct compat_timeval __user *tvp); | 251 | struct compat_timeval __user *tvp); |
| 251 | 252 | ||
| 253 | asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg); | ||
| 254 | |||
| 252 | asmlinkage long compat_sys_wait4(compat_pid_t pid, | 255 | asmlinkage long compat_sys_wait4(compat_pid_t pid, |
| 253 | compat_uint_t __user *stat_addr, int options, | 256 | compat_uint_t __user *stat_addr, int options, |
| 254 | struct compat_rusage __user *ru); | 257 | struct compat_rusage __user *ru); |
diff --git a/include/linux/coredump.h b/include/linux/coredump.h index b3c91d7cede4..8ba66a9d9022 100644 --- a/include/linux/coredump.h +++ b/include/linux/coredump.h | |||
| @@ -16,6 +16,8 @@ static inline int dump_write(struct file *file, const void *addr, int nr) | |||
| 16 | 16 | ||
| 17 | static inline int dump_seek(struct file *file, loff_t off) | 17 | static inline int dump_seek(struct file *file, loff_t off) |
| 18 | { | 18 | { |
| 19 | int ret = 1; | ||
| 20 | |||
| 19 | if (file->f_op->llseek && file->f_op->llseek != no_llseek) { | 21 | if (file->f_op->llseek && file->f_op->llseek != no_llseek) { |
| 20 | if (file->f_op->llseek(file, off, SEEK_CUR) < 0) | 22 | if (file->f_op->llseek(file, off, SEEK_CUR) < 0) |
| 21 | return 0; | 23 | return 0; |
| @@ -29,13 +31,15 @@ static inline int dump_seek(struct file *file, loff_t off) | |||
| 29 | 31 | ||
| 30 | if (n > PAGE_SIZE) | 32 | if (n > PAGE_SIZE) |
| 31 | n = PAGE_SIZE; | 33 | n = PAGE_SIZE; |
| 32 | if (!dump_write(file, buf, n)) | 34 | if (!dump_write(file, buf, n)) { |
| 33 | return 0; | 35 | ret = 0; |
| 36 | break; | ||
| 37 | } | ||
| 34 | off -= n; | 38 | off -= n; |
| 35 | } | 39 | } |
| 36 | free_page((unsigned long)buf); | 40 | free_page((unsigned long)buf); |
| 37 | } | 41 | } |
| 38 | return 1; | 42 | return ret; |
| 39 | } | 43 | } |
| 40 | 44 | ||
| 41 | #endif /* _LINUX_COREDUMP_H */ | 45 | #endif /* _LINUX_COREDUMP_H */ |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 4de02b10007f..9f15150ce8d6 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -278,6 +278,27 @@ struct freq_attr { | |||
| 278 | ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count); | 278 | ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count); |
| 279 | }; | 279 | }; |
| 280 | 280 | ||
| 281 | #define cpufreq_freq_attr_ro(_name) \ | ||
| 282 | static struct freq_attr _name = \ | ||
| 283 | __ATTR(_name, 0444, show_##_name, NULL) | ||
| 284 | |||
| 285 | #define cpufreq_freq_attr_ro_perm(_name, _perm) \ | ||
| 286 | static struct freq_attr _name = \ | ||
| 287 | __ATTR(_name, _perm, show_##_name, NULL) | ||
| 288 | |||
| 289 | #define cpufreq_freq_attr_ro_old(_name) \ | ||
| 290 | static struct freq_attr _name##_old = \ | ||
| 291 | __ATTR(_name, 0444, show_##_name##_old, NULL) | ||
| 292 | |||
| 293 | #define cpufreq_freq_attr_rw(_name) \ | ||
| 294 | static struct freq_attr _name = \ | ||
| 295 | __ATTR(_name, 0644, show_##_name, store_##_name) | ||
| 296 | |||
| 297 | #define cpufreq_freq_attr_rw_old(_name) \ | ||
| 298 | static struct freq_attr _name##_old = \ | ||
| 299 | __ATTR(_name, 0644, show_##_name##_old, store_##_name##_old) | ||
| 300 | |||
| 301 | |||
| 281 | struct global_attr { | 302 | struct global_attr { |
| 282 | struct attribute attr; | 303 | struct attribute attr; |
| 283 | ssize_t (*show)(struct kobject *kobj, | 304 | ssize_t (*show)(struct kobject *kobj, |
| @@ -286,6 +307,15 @@ struct global_attr { | |||
| 286 | const char *c, size_t count); | 307 | const char *c, size_t count); |
| 287 | }; | 308 | }; |
| 288 | 309 | ||
| 310 | #define define_one_global_ro(_name) \ | ||
| 311 | static struct global_attr _name = \ | ||
| 312 | __ATTR(_name, 0444, show_##_name, NULL) | ||
| 313 | |||
| 314 | #define define_one_global_rw(_name) \ | ||
| 315 | static struct global_attr _name = \ | ||
| 316 | __ATTR(_name, 0644, show_##_name, store_##_name) | ||
| 317 | |||
| 318 | |||
| 289 | /********************************************************************* | 319 | /********************************************************************* |
| 290 | * CPUFREQ 2.6. INTERFACE * | 320 | * CPUFREQ 2.6. INTERFACE * |
| 291 | *********************************************************************/ | 321 | *********************************************************************/ |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index a5740fc4d04b..a73454aec333 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
| @@ -21,8 +21,7 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */ | |||
| 21 | extern int cpuset_init(void); | 21 | extern int cpuset_init(void); |
| 22 | extern void cpuset_init_smp(void); | 22 | extern void cpuset_init_smp(void); |
| 23 | extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); | 23 | extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); |
| 24 | extern void cpuset_cpus_allowed_locked(struct task_struct *p, | 24 | extern int cpuset_cpus_allowed_fallback(struct task_struct *p); |
| 25 | struct cpumask *mask); | ||
| 26 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); | 25 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); |
| 27 | #define cpuset_current_mems_allowed (current->mems_allowed) | 26 | #define cpuset_current_mems_allowed (current->mems_allowed) |
| 28 | void cpuset_init_current_mems_allowed(void); | 27 | void cpuset_init_current_mems_allowed(void); |
| @@ -69,9 +68,6 @@ struct seq_file; | |||
| 69 | extern void cpuset_task_status_allowed(struct seq_file *m, | 68 | extern void cpuset_task_status_allowed(struct seq_file *m, |
| 70 | struct task_struct *task); | 69 | struct task_struct *task); |
| 71 | 70 | ||
| 72 | extern void cpuset_lock(void); | ||
| 73 | extern void cpuset_unlock(void); | ||
| 74 | |||
| 75 | extern int cpuset_mem_spread_node(void); | 71 | extern int cpuset_mem_spread_node(void); |
| 76 | 72 | ||
| 77 | static inline int cpuset_do_page_mem_spread(void) | 73 | static inline int cpuset_do_page_mem_spread(void) |
| @@ -105,10 +101,11 @@ static inline void cpuset_cpus_allowed(struct task_struct *p, | |||
| 105 | { | 101 | { |
| 106 | cpumask_copy(mask, cpu_possible_mask); | 102 | cpumask_copy(mask, cpu_possible_mask); |
| 107 | } | 103 | } |
| 108 | static inline void cpuset_cpus_allowed_locked(struct task_struct *p, | 104 | |
| 109 | struct cpumask *mask) | 105 | static inline int cpuset_cpus_allowed_fallback(struct task_struct *p) |
| 110 | { | 106 | { |
| 111 | cpumask_copy(mask, cpu_possible_mask); | 107 | cpumask_copy(&p->cpus_allowed, cpu_possible_mask); |
| 108 | return cpumask_any(cpu_active_mask); | ||
| 112 | } | 109 | } |
| 113 | 110 | ||
| 114 | static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) | 111 | static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) |
| @@ -157,9 +154,6 @@ static inline void cpuset_task_status_allowed(struct seq_file *m, | |||
| 157 | { | 154 | { |
| 158 | } | 155 | } |
| 159 | 156 | ||
| 160 | static inline void cpuset_lock(void) {} | ||
| 161 | static inline void cpuset_unlock(void) {} | ||
| 162 | |||
| 163 | static inline int cpuset_mem_spread_node(void) | 157 | static inline int cpuset_mem_spread_node(void) |
| 164 | { | 158 | { |
| 165 | return 0; | 159 | return 0; |
diff --git a/include/linux/cred.h b/include/linux/cred.h index 4db09f89b637..52507c3e1387 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
| @@ -280,7 +280,7 @@ static inline void put_cred(const struct cred *_cred) | |||
| 280 | * task or by holding tasklist_lock to prevent it from being unlinked. | 280 | * task or by holding tasklist_lock to prevent it from being unlinked. |
| 281 | */ | 281 | */ |
| 282 | #define __task_cred(task) \ | 282 | #define __task_cred(task) \ |
| 283 | ((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_is_held(&tasklist_lock)))) | 283 | ((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_tasklist_lock_is_held()))) |
| 284 | 284 | ||
| 285 | /** | 285 | /** |
| 286 | * get_task_cred - Get another task's objective credentials | 286 | * get_task_cred - Get another task's objective credentials |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 30b93b2a01a4..eebb617c17d8 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -186,6 +186,8 @@ d_iput: no no no yes | |||
| 186 | 186 | ||
| 187 | #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 /* Parent inode is watched by some fsnotify listener */ | 187 | #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 /* Parent inode is watched by some fsnotify listener */ |
| 188 | 188 | ||
| 189 | #define DCACHE_CANT_MOUNT 0x0100 | ||
| 190 | |||
| 189 | extern spinlock_t dcache_lock; | 191 | extern spinlock_t dcache_lock; |
| 190 | extern seqlock_t rename_lock; | 192 | extern seqlock_t rename_lock; |
| 191 | 193 | ||
| @@ -358,6 +360,18 @@ static inline int d_unlinked(struct dentry *dentry) | |||
| 358 | return d_unhashed(dentry) && !IS_ROOT(dentry); | 360 | return d_unhashed(dentry) && !IS_ROOT(dentry); |
| 359 | } | 361 | } |
| 360 | 362 | ||
| 363 | static inline int cant_mount(struct dentry *dentry) | ||
| 364 | { | ||
| 365 | return (dentry->d_flags & DCACHE_CANT_MOUNT); | ||
| 366 | } | ||
| 367 | |||
| 368 | static inline void dont_mount(struct dentry *dentry) | ||
| 369 | { | ||
| 370 | spin_lock(&dentry->d_lock); | ||
| 371 | dentry->d_flags |= DCACHE_CANT_MOUNT; | ||
| 372 | spin_unlock(&dentry->d_lock); | ||
| 373 | } | ||
| 374 | |||
| 361 | static inline struct dentry *dget_parent(struct dentry *dentry) | 375 | static inline struct dentry *dget_parent(struct dentry *dentry) |
| 362 | { | 376 | { |
| 363 | struct dentry *ret; | 377 | struct dentry *ret; |
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h index b7cdbb4373df..8723491f7dfd 100644 --- a/include/linux/dcbnl.h +++ b/include/linux/dcbnl.h | |||
| @@ -22,8 +22,6 @@ | |||
| 22 | 22 | ||
| 23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
| 24 | 24 | ||
| 25 | #define DCB_PROTO_VERSION 1 | ||
| 26 | |||
| 27 | struct dcbmsg { | 25 | struct dcbmsg { |
| 28 | __u8 dcb_family; | 26 | __u8 dcb_family; |
| 29 | __u8 cmd; | 27 | __u8 cmd; |
diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h index 8c243aaa86a7..597692f1fc8d 100644 --- a/include/linux/debugobjects.h +++ b/include/linux/debugobjects.h | |||
| @@ -20,12 +20,14 @@ struct debug_obj_descr; | |||
| 20 | * struct debug_obj - representaion of an tracked object | 20 | * struct debug_obj - representaion of an tracked object |
| 21 | * @node: hlist node to link the object into the tracker list | 21 | * @node: hlist node to link the object into the tracker list |
| 22 | * @state: tracked object state | 22 | * @state: tracked object state |
| 23 | * @astate: current active state | ||
| 23 | * @object: pointer to the real object | 24 | * @object: pointer to the real object |
| 24 | * @descr: pointer to an object type specific debug description structure | 25 | * @descr: pointer to an object type specific debug description structure |
| 25 | */ | 26 | */ |
| 26 | struct debug_obj { | 27 | struct debug_obj { |
| 27 | struct hlist_node node; | 28 | struct hlist_node node; |
| 28 | enum debug_obj_state state; | 29 | enum debug_obj_state state; |
| 30 | unsigned int astate; | ||
| 29 | void *object; | 31 | void *object; |
| 30 | struct debug_obj_descr *descr; | 32 | struct debug_obj_descr *descr; |
| 31 | }; | 33 | }; |
| @@ -60,6 +62,15 @@ extern void debug_object_deactivate(void *addr, struct debug_obj_descr *descr); | |||
| 60 | extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr); | 62 | extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr); |
| 61 | extern void debug_object_free (void *addr, struct debug_obj_descr *descr); | 63 | extern void debug_object_free (void *addr, struct debug_obj_descr *descr); |
| 62 | 64 | ||
| 65 | /* | ||
| 66 | * Active state: | ||
| 67 | * - Set at 0 upon initialization. | ||
| 68 | * - Must return to 0 before deactivation. | ||
| 69 | */ | ||
| 70 | extern void | ||
| 71 | debug_object_active_state(void *addr, struct debug_obj_descr *descr, | ||
| 72 | unsigned int expect, unsigned int next); | ||
| 73 | |||
| 63 | extern void debug_objects_early_init(void); | 74 | extern void debug_objects_early_init(void); |
| 64 | extern void debug_objects_mem_init(void); | 75 | extern void debug_objects_mem_init(void); |
| 65 | #else | 76 | #else |
diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h index 5032b9a31ae7..ad5ec1d0475e 100644 --- a/include/linux/decompress/mm.h +++ b/include/linux/decompress/mm.h | |||
| @@ -14,11 +14,21 @@ | |||
| 14 | 14 | ||
| 15 | /* Code active when included from pre-boot environment: */ | 15 | /* Code active when included from pre-boot environment: */ |
| 16 | 16 | ||
| 17 | /* | ||
| 18 | * Some architectures want to ensure there is no local data in their | ||
| 19 | * pre-boot environment, so that data can arbitarily relocated (via | ||
| 20 | * GOT references). This is achieved by defining STATIC_RW_DATA to | ||
| 21 | * be null. | ||
| 22 | */ | ||
| 23 | #ifndef STATIC_RW_DATA | ||
| 24 | #define STATIC_RW_DATA static | ||
| 25 | #endif | ||
| 26 | |||
| 17 | /* A trivial malloc implementation, adapted from | 27 | /* A trivial malloc implementation, adapted from |
| 18 | * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994 | 28 | * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994 |
| 19 | */ | 29 | */ |
| 20 | static unsigned long malloc_ptr; | 30 | STATIC_RW_DATA unsigned long malloc_ptr; |
| 21 | static int malloc_count; | 31 | STATIC_RW_DATA int malloc_count; |
| 22 | 32 | ||
| 23 | static void *malloc(int size) | 33 | static void *malloc(int size) |
| 24 | { | 34 | { |
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h index 5076fe0c8a96..6cee17c22313 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #define _LINUX_DELAYACCT_H | 18 | #define _LINUX_DELAYACCT_H |
| 19 | 19 | ||
| 20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
| 21 | #include <linux/slab.h> | ||
| 21 | 22 | ||
| 22 | /* | 23 | /* |
| 23 | * Per-task flags relevant to delay accounting | 24 | * Per-task flags relevant to delay accounting |
diff --git a/include/linux/device.h b/include/linux/device.h index b30527db3ac0..7bb9f426f3e6 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
| 23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
| 24 | #include <linux/pm.h> | 24 | #include <linux/pm.h> |
| 25 | #include <linux/semaphore.h> | ||
| 26 | #include <asm/atomic.h> | 25 | #include <asm/atomic.h> |
| 27 | #include <asm/device.h> | 26 | #include <asm/device.h> |
| 28 | 27 | ||
| @@ -106,7 +105,7 @@ extern int bus_unregister_notifier(struct bus_type *bus, | |||
| 106 | 105 | ||
| 107 | /* All 4 notifers below get called with the target struct device * | 106 | /* All 4 notifers below get called with the target struct device * |
| 108 | * as an argument. Note that those functions are likely to be called | 107 | * as an argument. Note that those functions are likely to be called |
| 109 | * with the device semaphore held in the core, so be careful. | 108 | * with the device lock held in the core, so be careful. |
| 110 | */ | 109 | */ |
| 111 | #define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */ | 110 | #define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */ |
| 112 | #define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */ | 111 | #define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */ |
| @@ -203,6 +202,9 @@ struct class { | |||
| 203 | int (*suspend)(struct device *dev, pm_message_t state); | 202 | int (*suspend)(struct device *dev, pm_message_t state); |
| 204 | int (*resume)(struct device *dev); | 203 | int (*resume)(struct device *dev); |
| 205 | 204 | ||
| 205 | const struct kobj_ns_type_operations *ns_type; | ||
| 206 | const void *(*namespace)(struct device *dev); | ||
| 207 | |||
| 206 | const struct dev_pm_ops *pm; | 208 | const struct dev_pm_ops *pm; |
| 207 | 209 | ||
| 208 | struct class_private *p; | 210 | struct class_private *p; |
| @@ -251,8 +253,10 @@ extern struct device *class_find_device(struct class *class, | |||
| 251 | 253 | ||
| 252 | struct class_attribute { | 254 | struct class_attribute { |
| 253 | struct attribute attr; | 255 | struct attribute attr; |
| 254 | ssize_t (*show)(struct class *class, char *buf); | 256 | ssize_t (*show)(struct class *class, struct class_attribute *attr, |
| 255 | ssize_t (*store)(struct class *class, const char *buf, size_t count); | 257 | char *buf); |
| 258 | ssize_t (*store)(struct class *class, struct class_attribute *attr, | ||
| 259 | const char *buf, size_t count); | ||
| 256 | }; | 260 | }; |
| 257 | 261 | ||
| 258 | #define CLASS_ATTR(_name, _mode, _show, _store) \ | 262 | #define CLASS_ATTR(_name, _mode, _show, _store) \ |
| @@ -263,6 +267,23 @@ extern int __must_check class_create_file(struct class *class, | |||
| 263 | extern void class_remove_file(struct class *class, | 267 | extern void class_remove_file(struct class *class, |
| 264 | const struct class_attribute *attr); | 268 | const struct class_attribute *attr); |
| 265 | 269 | ||
| 270 | /* Simple class attribute that is just a static string */ | ||
| 271 | |||
| 272 | struct class_attribute_string { | ||
| 273 | struct class_attribute attr; | ||
| 274 | char *str; | ||
| 275 | }; | ||
| 276 | |||
| 277 | /* Currently read-only only */ | ||
| 278 | #define _CLASS_ATTR_STRING(_name, _mode, _str) \ | ||
| 279 | { __ATTR(_name, _mode, show_class_attr_string, NULL), _str } | ||
| 280 | #define CLASS_ATTR_STRING(_name, _mode, _str) \ | ||
| 281 | struct class_attribute_string class_attr_##_name = \ | ||
| 282 | _CLASS_ATTR_STRING(_name, _mode, _str) | ||
| 283 | |||
| 284 | extern ssize_t show_class_attr_string(struct class *class, struct class_attribute *attr, | ||
| 285 | char *buf); | ||
| 286 | |||
| 266 | struct class_interface { | 287 | struct class_interface { |
| 267 | struct list_head node; | 288 | struct list_head node; |
| 268 | struct class *class; | 289 | struct class *class; |
| @@ -385,7 +406,7 @@ struct device { | |||
| 385 | const char *init_name; /* initial name of the device */ | 406 | const char *init_name; /* initial name of the device */ |
| 386 | struct device_type *type; | 407 | struct device_type *type; |
| 387 | 408 | ||
| 388 | struct semaphore sem; /* semaphore to synchronize calls to | 409 | struct mutex mutex; /* mutex to synchronize calls to |
| 389 | * its driver. | 410 | * its driver. |
| 390 | */ | 411 | */ |
| 391 | 412 | ||
| @@ -432,6 +453,10 @@ struct device { | |||
| 432 | 453 | ||
| 433 | static inline const char *dev_name(const struct device *dev) | 454 | static inline const char *dev_name(const struct device *dev) |
| 434 | { | 455 | { |
| 456 | /* Use the init name until the kobject becomes available */ | ||
| 457 | if (dev->init_name) | ||
| 458 | return dev->init_name; | ||
| 459 | |||
| 435 | return kobject_name(&dev->kobj); | 460 | return kobject_name(&dev->kobj); |
| 436 | } | 461 | } |
| 437 | 462 | ||
| @@ -489,6 +514,21 @@ static inline bool device_async_suspend_enabled(struct device *dev) | |||
| 489 | return !!dev->power.async_suspend; | 514 | return !!dev->power.async_suspend; |
| 490 | } | 515 | } |
| 491 | 516 | ||
| 517 | static inline void device_lock(struct device *dev) | ||
| 518 | { | ||
| 519 | mutex_lock(&dev->mutex); | ||
| 520 | } | ||
| 521 | |||
| 522 | static inline int device_trylock(struct device *dev) | ||
| 523 | { | ||
| 524 | return mutex_trylock(&dev->mutex); | ||
| 525 | } | ||
| 526 | |||
| 527 | static inline void device_unlock(struct device *dev) | ||
| 528 | { | ||
| 529 | mutex_unlock(&dev->mutex); | ||
| 530 | } | ||
| 531 | |||
| 492 | void driver_init(void); | 532 | void driver_init(void); |
| 493 | 533 | ||
| 494 | /* | 534 | /* |
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h index c30879cf93bc..96e87693d933 100644 --- a/include/linux/dm9000.h +++ b/include/linux/dm9000.h | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | #define DM9000_PLATF_NO_EEPROM (0x0010) | 23 | #define DM9000_PLATF_NO_EEPROM (0x0010) |
| 24 | #define DM9000_PLATF_SIMPLE_PHY (0x0020) /* Use NSR to find LinkStatus */ | 24 | #define DM9000_PLATF_SIMPLE_PHY (0x0020) /* Use NSR to find LinkStatus */ |
| 25 | 25 | ||
| 26 | /* platfrom data for platfrom device structure's platfrom_data field */ | 26 | /* platform data for platform device structure's platform_data field */ |
| 27 | 27 | ||
| 28 | struct dm9000_plat_data { | 28 | struct dm9000_plat_data { |
| 29 | unsigned int flags; | 29 | unsigned int flags; |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 91b761846061..ca32ed78b057 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
| @@ -127,6 +127,14 @@ static inline u64 dma_get_mask(struct device *dev) | |||
| 127 | return DMA_BIT_MASK(32); | 127 | return DMA_BIT_MASK(32); |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | static inline int dma_set_coherent_mask(struct device *dev, u64 mask) | ||
| 131 | { | ||
| 132 | if (!dma_supported(dev, mask)) | ||
| 133 | return -EIO; | ||
| 134 | dev->coherent_dma_mask = mask; | ||
| 135 | return 0; | ||
| 136 | } | ||
| 137 | |||
| 130 | extern u64 dma_get_required_mask(struct device *dev); | 138 | extern u64 dma_get_required_mask(struct device *dev); |
| 131 | 139 | ||
| 132 | static inline unsigned int dma_get_max_seg_size(struct device *dev) | 140 | static inline unsigned int dma_get_max_seg_size(struct device *dev) |
| @@ -232,4 +240,20 @@ struct dma_attrs; | |||
| 232 | 240 | ||
| 233 | #endif /* CONFIG_HAVE_DMA_ATTRS */ | 241 | #endif /* CONFIG_HAVE_DMA_ATTRS */ |
| 234 | 242 | ||
| 243 | #ifdef CONFIG_NEED_DMA_MAP_STATE | ||
| 244 | #define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME | ||
| 245 | #define DEFINE_DMA_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME | ||
| 246 | #define dma_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME) | ||
| 247 | #define dma_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL)) | ||
| 248 | #define dma_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME) | ||
| 249 | #define dma_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL)) | ||
| 250 | #else | ||
| 251 | #define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME) | ||
| 252 | #define DEFINE_DMA_UNMAP_LEN(LEN_NAME) | ||
| 253 | #define dma_unmap_addr(PTR, ADDR_NAME) (0) | ||
| 254 | #define dma_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0) | ||
| 255 | #define dma_unmap_len(PTR, LEN_NAME) (0) | ||
| 256 | #define dma_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) | ||
| 257 | #endif | ||
| 258 | |||
| 235 | #endif | 259 | #endif |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index 78962272338a..4341b1a97a34 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
| @@ -56,7 +56,7 @@ extern const char *drbd_buildtag(void); | |||
| 56 | #define REL_VERSION "8.3.7" | 56 | #define REL_VERSION "8.3.7" |
| 57 | #define API_VERSION 88 | 57 | #define API_VERSION 88 |
| 58 | #define PRO_VERSION_MIN 86 | 58 | #define PRO_VERSION_MIN 86 |
| 59 | #define PRO_VERSION_MAX 91 | 59 | #define PRO_VERSION_MAX 92 |
| 60 | 60 | ||
| 61 | 61 | ||
| 62 | enum drbd_io_error_p { | 62 | enum drbd_io_error_p { |
diff --git a/include/linux/drbd_nl.h b/include/linux/drbd_nl.h index a4d82f895994..f7431a4ca608 100644 --- a/include/linux/drbd_nl.h +++ b/include/linux/drbd_nl.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #endif | 12 | #endif |
| 13 | 13 | ||
| 14 | NL_PACKET(primary, 1, | 14 | NL_PACKET(primary, 1, |
| 15 | NL_BIT( 1, T_MAY_IGNORE, overwrite_peer) | 15 | NL_BIT( 1, T_MAY_IGNORE, primary_force) |
| 16 | ) | 16 | ) |
| 17 | 17 | ||
| 18 | NL_PACKET(secondary, 2, ) | 18 | NL_PACKET(secondary, 2, ) |
| @@ -63,6 +63,7 @@ NL_PACKET(net_conf, 5, | |||
| 63 | NL_BIT( 41, T_MAY_IGNORE, always_asbp) | 63 | NL_BIT( 41, T_MAY_IGNORE, always_asbp) |
| 64 | NL_BIT( 61, T_MAY_IGNORE, no_cork) | 64 | NL_BIT( 61, T_MAY_IGNORE, no_cork) |
| 65 | NL_BIT( 62, T_MANDATORY, auto_sndbuf_size) | 65 | NL_BIT( 62, T_MANDATORY, auto_sndbuf_size) |
| 66 | NL_BIT( 70, T_MANDATORY, dry_run) | ||
| 66 | ) | 67 | ) |
| 67 | 68 | ||
| 68 | NL_PACKET(disconnect, 6, ) | 69 | NL_PACKET(disconnect, 6, ) |
diff --git a/include/linux/elf.h b/include/linux/elf.h index 597858418051..4d608014753a 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
| @@ -394,6 +394,7 @@ typedef struct elf64_shdr { | |||
| 394 | #define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */ | 394 | #define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */ |
| 395 | #define NT_S390_CTRS 0x304 /* s390 control registers */ | 395 | #define NT_S390_CTRS 0x304 /* s390 control registers */ |
| 396 | #define NT_S390_PREFIX 0x305 /* s390 prefix register */ | 396 | #define NT_S390_PREFIX 0x305 /* s390 prefix register */ |
| 397 | #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ | ||
| 397 | 398 | ||
| 398 | 399 | ||
| 399 | /* Note header in a PT_NOTE section */ | 400 | /* Note header in a PT_NOTE section */ |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index cca1c3de140d..276b40a16835 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
| @@ -61,6 +61,13 @@ struct ethtool_drvinfo { | |||
| 61 | /* For PCI devices, use pci_name(pci_dev). */ | 61 | /* For PCI devices, use pci_name(pci_dev). */ |
| 62 | char reserved1[32]; | 62 | char reserved1[32]; |
| 63 | char reserved2[12]; | 63 | char reserved2[12]; |
| 64 | /* | ||
| 65 | * Some struct members below are filled in | ||
| 66 | * using ops->get_sset_count(). Obtaining | ||
| 67 | * this info from ethtool_drvinfo is now | ||
| 68 | * deprecated; Use ETHTOOL_GSSET_INFO | ||
| 69 | * instead. | ||
| 70 | */ | ||
| 64 | __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */ | 71 | __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */ |
| 65 | __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ | 72 | __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ |
| 66 | __u32 testinfo_len; | 73 | __u32 testinfo_len; |
| @@ -253,6 +260,17 @@ struct ethtool_gstrings { | |||
| 253 | __u8 data[0]; | 260 | __u8 data[0]; |
| 254 | }; | 261 | }; |
| 255 | 262 | ||
| 263 | struct ethtool_sset_info { | ||
| 264 | __u32 cmd; /* ETHTOOL_GSSET_INFO */ | ||
| 265 | __u32 reserved; | ||
| 266 | __u64 sset_mask; /* input: each bit selects an sset to query */ | ||
| 267 | /* output: each bit a returned sset */ | ||
| 268 | __u32 data[0]; /* ETH_SS_xxx count, in order, based on bits | ||
| 269 | in sset_mask. One bit implies one | ||
| 270 | __u32, two bits implies two | ||
| 271 | __u32's, etc. */ | ||
| 272 | }; | ||
| 273 | |||
| 256 | enum ethtool_test_flags { | 274 | enum ethtool_test_flags { |
| 257 | ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */ | 275 | ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */ |
| 258 | ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */ | 276 | ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */ |
| @@ -292,6 +310,7 @@ struct ethtool_perm_addr { | |||
| 292 | enum ethtool_flags { | 310 | enum ethtool_flags { |
| 293 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ | 311 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ |
| 294 | ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ | 312 | ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ |
| 313 | ETH_FLAG_RXHASH = (1 << 28), | ||
| 295 | }; | 314 | }; |
| 296 | 315 | ||
| 297 | /* The following structures are for supporting RX network flow | 316 | /* The following structures are for supporting RX network flow |
| @@ -472,12 +491,12 @@ void ethtool_ntuple_flush(struct net_device *dev); | |||
| 472 | * get_ufo: Report whether UDP fragmentation offload is enabled | 491 | * get_ufo: Report whether UDP fragmentation offload is enabled |
| 473 | * set_ufo: Turn UDP fragmentation offload on or off | 492 | * set_ufo: Turn UDP fragmentation offload on or off |
| 474 | * self_test: Run specified self-tests | 493 | * self_test: Run specified self-tests |
| 475 | * get_strings: Return a set of strings that describe the requested objects | 494 | * get_strings: Return a set of strings that describe the requested objects |
| 476 | * phys_id: Identify the device | 495 | * phys_id: Identify the device |
| 477 | * get_stats: Return statistics about the device | 496 | * get_stats: Return statistics about the device |
| 478 | * get_flags: get 32-bit flags bitmap | 497 | * get_flags: get 32-bit flags bitmap |
| 479 | * set_flags: set 32-bit flags bitmap | 498 | * set_flags: set 32-bit flags bitmap |
| 480 | * | 499 | * |
| 481 | * Description: | 500 | * Description: |
| 482 | * | 501 | * |
| 483 | * get_settings: | 502 | * get_settings: |
| @@ -513,14 +532,20 @@ struct ethtool_ops { | |||
| 513 | int (*nway_reset)(struct net_device *); | 532 | int (*nway_reset)(struct net_device *); |
| 514 | u32 (*get_link)(struct net_device *); | 533 | u32 (*get_link)(struct net_device *); |
| 515 | int (*get_eeprom_len)(struct net_device *); | 534 | int (*get_eeprom_len)(struct net_device *); |
| 516 | int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); | 535 | int (*get_eeprom)(struct net_device *, |
| 517 | int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); | 536 | struct ethtool_eeprom *, u8 *); |
| 537 | int (*set_eeprom)(struct net_device *, | ||
| 538 | struct ethtool_eeprom *, u8 *); | ||
| 518 | int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *); | 539 | int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *); |
| 519 | int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *); | 540 | int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *); |
| 520 | void (*get_ringparam)(struct net_device *, struct ethtool_ringparam *); | 541 | void (*get_ringparam)(struct net_device *, |
| 521 | int (*set_ringparam)(struct net_device *, struct ethtool_ringparam *); | 542 | struct ethtool_ringparam *); |
| 522 | void (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*); | 543 | int (*set_ringparam)(struct net_device *, |
| 523 | int (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*); | 544 | struct ethtool_ringparam *); |
| 545 | void (*get_pauseparam)(struct net_device *, | ||
| 546 | struct ethtool_pauseparam*); | ||
| 547 | int (*set_pauseparam)(struct net_device *, | ||
| 548 | struct ethtool_pauseparam*); | ||
| 524 | u32 (*get_rx_csum)(struct net_device *); | 549 | u32 (*get_rx_csum)(struct net_device *); |
| 525 | int (*set_rx_csum)(struct net_device *, u32); | 550 | int (*set_rx_csum)(struct net_device *, u32); |
| 526 | u32 (*get_tx_csum)(struct net_device *); | 551 | u32 (*get_tx_csum)(struct net_device *); |
| @@ -532,21 +557,24 @@ struct ethtool_ops { | |||
| 532 | void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); | 557 | void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); |
| 533 | void (*get_strings)(struct net_device *, u32 stringset, u8 *); | 558 | void (*get_strings)(struct net_device *, u32 stringset, u8 *); |
| 534 | int (*phys_id)(struct net_device *, u32); | 559 | int (*phys_id)(struct net_device *, u32); |
| 535 | void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *); | 560 | void (*get_ethtool_stats)(struct net_device *, |
| 561 | struct ethtool_stats *, u64 *); | ||
| 536 | int (*begin)(struct net_device *); | 562 | int (*begin)(struct net_device *); |
| 537 | void (*complete)(struct net_device *); | 563 | void (*complete)(struct net_device *); |
| 538 | u32 (*get_ufo)(struct net_device *); | 564 | u32 (*get_ufo)(struct net_device *); |
| 539 | int (*set_ufo)(struct net_device *, u32); | 565 | int (*set_ufo)(struct net_device *, u32); |
| 540 | u32 (*get_flags)(struct net_device *); | 566 | u32 (*get_flags)(struct net_device *); |
| 541 | int (*set_flags)(struct net_device *, u32); | 567 | int (*set_flags)(struct net_device *, u32); |
| 542 | u32 (*get_priv_flags)(struct net_device *); | 568 | u32 (*get_priv_flags)(struct net_device *); |
| 543 | int (*set_priv_flags)(struct net_device *, u32); | 569 | int (*set_priv_flags)(struct net_device *, u32); |
| 544 | int (*get_sset_count)(struct net_device *, int); | 570 | int (*get_sset_count)(struct net_device *, int); |
| 545 | int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); | 571 | int (*get_rxnfc)(struct net_device *, |
| 572 | struct ethtool_rxnfc *, void *); | ||
| 546 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 573 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
| 547 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | 574 | int (*flash_device)(struct net_device *, struct ethtool_flash *); |
| 548 | int (*reset)(struct net_device *, u32 *); | 575 | int (*reset)(struct net_device *, u32 *); |
| 549 | int (*set_rx_ntuple)(struct net_device *, struct ethtool_rx_ntuple *); | 576 | int (*set_rx_ntuple)(struct net_device *, |
| 577 | struct ethtool_rx_ntuple *); | ||
| 550 | int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); | 578 | int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); |
| 551 | }; | 579 | }; |
| 552 | #endif /* __KERNEL__ */ | 580 | #endif /* __KERNEL__ */ |
| @@ -558,29 +586,29 @@ struct ethtool_ops { | |||
| 558 | #define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */ | 586 | #define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */ |
| 559 | #define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */ | 587 | #define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */ |
| 560 | #define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */ | 588 | #define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options. */ |
| 561 | #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */ | 589 | #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */ |
| 562 | #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */ | 590 | #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */ |
| 563 | #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */ | 591 | #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */ |
| 564 | #define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */ | 592 | #define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */ |
| 565 | #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */ | 593 | #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */ |
| 566 | #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */ | 594 | #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */ |
| 567 | #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */ | 595 | #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */ |
| 568 | #define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */ | 596 | #define ETHTOOL_SCOALESCE 0x0000000f /* Set coalesce config. */ |
| 569 | #define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */ | 597 | #define ETHTOOL_GRINGPARAM 0x00000010 /* Get ring parameters */ |
| 570 | #define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */ | 598 | #define ETHTOOL_SRINGPARAM 0x00000011 /* Set ring parameters. */ |
| 571 | #define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */ | 599 | #define ETHTOOL_GPAUSEPARAM 0x00000012 /* Get pause parameters */ |
| 572 | #define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */ | 600 | #define ETHTOOL_SPAUSEPARAM 0x00000013 /* Set pause parameters. */ |
| 573 | #define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */ | 601 | #define ETHTOOL_GRXCSUM 0x00000014 /* Get RX hw csum enable (ethtool_value) */ |
| 574 | #define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */ | 602 | #define ETHTOOL_SRXCSUM 0x00000015 /* Set RX hw csum enable (ethtool_value) */ |
| 575 | #define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */ | 603 | #define ETHTOOL_GTXCSUM 0x00000016 /* Get TX hw csum enable (ethtool_value) */ |
| 576 | #define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */ | 604 | #define ETHTOOL_STXCSUM 0x00000017 /* Set TX hw csum enable (ethtool_value) */ |
| 577 | #define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable | 605 | #define ETHTOOL_GSG 0x00000018 /* Get scatter-gather enable |
| 578 | * (ethtool_value) */ | 606 | * (ethtool_value) */ |
| 579 | #define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable | 607 | #define ETHTOOL_SSG 0x00000019 /* Set scatter-gather enable |
| 580 | * (ethtool_value). */ | 608 | * (ethtool_value). */ |
| 581 | #define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */ | 609 | #define ETHTOOL_TEST 0x0000001a /* execute NIC self-test. */ |
| 582 | #define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */ | 610 | #define ETHTOOL_GSTRINGS 0x0000001b /* get specified string set */ |
| 583 | #define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */ | 611 | #define ETHTOOL_PHYS_ID 0x0000001c /* identify the NIC */ |
| 584 | #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */ | 612 | #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */ |
| 585 | #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ | 613 | #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ |
| 586 | #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ | 614 | #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ |
| @@ -591,24 +619,24 @@ struct ethtool_ops { | |||
| 591 | #define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */ | 619 | #define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */ |
| 592 | #define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */ | 620 | #define ETHTOOL_GFLAGS 0x00000025 /* Get flags bitmap(ethtool_value) */ |
| 593 | #define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */ | 621 | #define ETHTOOL_SFLAGS 0x00000026 /* Set flags bitmap(ethtool_value) */ |
| 594 | #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */ | 622 | #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */ |
| 595 | #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */ | 623 | #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */ |
| 596 | 624 | ||
| 597 | #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */ | 625 | #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */ |
| 598 | #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ | 626 | #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ |
| 599 | #define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */ | 627 | #define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */ |
| 600 | #define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */ | 628 | #define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */ |
| 601 | #define ETHTOOL_GRXRINGS 0x0000002d /* Get RX rings available for LB */ | 629 | #define ETHTOOL_GRXRINGS 0x0000002d /* Get RX rings available for LB */ |
| 602 | #define ETHTOOL_GRXCLSRLCNT 0x0000002e /* Get RX class rule count */ | 630 | #define ETHTOOL_GRXCLSRLCNT 0x0000002e /* Get RX class rule count */ |
| 603 | #define ETHTOOL_GRXCLSRULE 0x0000002f /* Get RX classification rule */ | 631 | #define ETHTOOL_GRXCLSRULE 0x0000002f /* Get RX classification rule */ |
| 604 | #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */ | 632 | #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */ |
| 605 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ | 633 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ |
| 606 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ | 634 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ |
| 607 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ | 635 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ |
| 608 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ | 636 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ |
| 609 | |||
| 610 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ | 637 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ |
| 611 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ | 638 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ |
| 639 | #define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */ | ||
| 612 | 640 | ||
| 613 | /* compatibility with older code */ | 641 | /* compatibility with older code */ |
| 614 | #define SPARC_ETH_GSET ETHTOOL_GSET | 642 | #define SPARC_ETH_GSET ETHTOOL_GSET |
| @@ -617,18 +645,18 @@ struct ethtool_ops { | |||
| 617 | /* Indicates what features are supported by the interface. */ | 645 | /* Indicates what features are supported by the interface. */ |
| 618 | #define SUPPORTED_10baseT_Half (1 << 0) | 646 | #define SUPPORTED_10baseT_Half (1 << 0) |
| 619 | #define SUPPORTED_10baseT_Full (1 << 1) | 647 | #define SUPPORTED_10baseT_Full (1 << 1) |
| 620 | #define SUPPORTED_100baseT_Half (1 << 2) | 648 | #define SUPPORTED_100baseT_Half (1 << 2) |
| 621 | #define SUPPORTED_100baseT_Full (1 << 3) | 649 | #define SUPPORTED_100baseT_Full (1 << 3) |
| 622 | #define SUPPORTED_1000baseT_Half (1 << 4) | 650 | #define SUPPORTED_1000baseT_Half (1 << 4) |
| 623 | #define SUPPORTED_1000baseT_Full (1 << 5) | 651 | #define SUPPORTED_1000baseT_Full (1 << 5) |
| 624 | #define SUPPORTED_Autoneg (1 << 6) | 652 | #define SUPPORTED_Autoneg (1 << 6) |
| 625 | #define SUPPORTED_TP (1 << 7) | 653 | #define SUPPORTED_TP (1 << 7) |
| 626 | #define SUPPORTED_AUI (1 << 8) | 654 | #define SUPPORTED_AUI (1 << 8) |
| 627 | #define SUPPORTED_MII (1 << 9) | 655 | #define SUPPORTED_MII (1 << 9) |
| 628 | #define SUPPORTED_FIBRE (1 << 10) | 656 | #define SUPPORTED_FIBRE (1 << 10) |
| 629 | #define SUPPORTED_BNC (1 << 11) | 657 | #define SUPPORTED_BNC (1 << 11) |
| 630 | #define SUPPORTED_10000baseT_Full (1 << 12) | 658 | #define SUPPORTED_10000baseT_Full (1 << 12) |
| 631 | #define SUPPORTED_Pause (1 << 13) | 659 | #define SUPPORTED_Pause (1 << 13) |
| 632 | #define SUPPORTED_Asym_Pause (1 << 14) | 660 | #define SUPPORTED_Asym_Pause (1 << 14) |
| 633 | #define SUPPORTED_2500baseX_Full (1 << 15) | 661 | #define SUPPORTED_2500baseX_Full (1 << 15) |
| 634 | #define SUPPORTED_Backplane (1 << 16) | 662 | #define SUPPORTED_Backplane (1 << 16) |
| @@ -638,8 +666,8 @@ struct ethtool_ops { | |||
| 638 | #define SUPPORTED_10000baseR_FEC (1 << 20) | 666 | #define SUPPORTED_10000baseR_FEC (1 << 20) |
| 639 | 667 | ||
| 640 | /* Indicates what features are advertised by the interface. */ | 668 | /* Indicates what features are advertised by the interface. */ |
| 641 | #define ADVERTISED_10baseT_Half (1 << 0) | 669 | #define ADVERTISED_10baseT_Half (1 << 0) |
| 642 | #define ADVERTISED_10baseT_Full (1 << 1) | 670 | #define ADVERTISED_10baseT_Full (1 << 1) |
| 643 | #define ADVERTISED_100baseT_Half (1 << 2) | 671 | #define ADVERTISED_100baseT_Half (1 << 2) |
| 644 | #define ADVERTISED_100baseT_Full (1 << 3) | 672 | #define ADVERTISED_100baseT_Full (1 << 3) |
| 645 | #define ADVERTISED_1000baseT_Half (1 << 4) | 673 | #define ADVERTISED_1000baseT_Half (1 << 4) |
| @@ -678,12 +706,12 @@ struct ethtool_ops { | |||
| 678 | #define DUPLEX_FULL 0x01 | 706 | #define DUPLEX_FULL 0x01 |
| 679 | 707 | ||
| 680 | /* Which connector port. */ | 708 | /* Which connector port. */ |
| 681 | #define PORT_TP 0x00 | 709 | #define PORT_TP 0x00 |
| 682 | #define PORT_AUI 0x01 | 710 | #define PORT_AUI 0x01 |
| 683 | #define PORT_MII 0x02 | 711 | #define PORT_MII 0x02 |
| 684 | #define PORT_FIBRE 0x03 | 712 | #define PORT_FIBRE 0x03 |
| 685 | #define PORT_BNC 0x04 | 713 | #define PORT_BNC 0x04 |
| 686 | #define PORT_DA 0x05 | 714 | #define PORT_DA 0x05 |
| 687 | #define PORT_NONE 0xef | 715 | #define PORT_NONE 0xef |
| 688 | #define PORT_OTHER 0xff | 716 | #define PORT_OTHER 0xff |
| 689 | 717 | ||
| @@ -697,7 +725,7 @@ struct ethtool_ops { | |||
| 697 | /* Enable or disable autonegotiation. If this is set to enable, | 725 | /* Enable or disable autonegotiation. If this is set to enable, |
| 698 | * the forced link modes above are completely ignored. | 726 | * the forced link modes above are completely ignored. |
| 699 | */ | 727 | */ |
| 700 | #define AUTONEG_DISABLE 0x00 | 728 | #define AUTONEG_DISABLE 0x00 |
| 701 | #define AUTONEG_ENABLE 0x01 | 729 | #define AUTONEG_ENABLE 0x01 |
| 702 | 730 | ||
| 703 | /* Mode MDI or MDI-X */ | 731 | /* Mode MDI or MDI-X */ |
| @@ -728,8 +756,8 @@ struct ethtool_ops { | |||
| 728 | #define AH_V6_FLOW 0x0b | 756 | #define AH_V6_FLOW 0x0b |
| 729 | #define ESP_V6_FLOW 0x0c | 757 | #define ESP_V6_FLOW 0x0c |
| 730 | #define IP_USER_FLOW 0x0d | 758 | #define IP_USER_FLOW 0x0d |
| 731 | #define IPV4_FLOW 0x10 | 759 | #define IPV4_FLOW 0x10 |
| 732 | #define IPV6_FLOW 0x11 | 760 | #define IPV6_FLOW 0x11 |
| 733 | 761 | ||
| 734 | /* L3-L4 network traffic flow hash options */ | 762 | /* L3-L4 network traffic flow hash options */ |
| 735 | #define RXH_L2DA (1 << 1) | 763 | #define RXH_L2DA (1 << 1) |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index cac84b006667..5f494b465097 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
| @@ -565,17 +565,17 @@ enum { | |||
| 565 | 565 | ||
| 566 | static inline int ext3_test_inode_state(struct inode *inode, int bit) | 566 | static inline int ext3_test_inode_state(struct inode *inode, int bit) |
| 567 | { | 567 | { |
| 568 | return test_bit(bit, &EXT3_I(inode)->i_state); | 568 | return test_bit(bit, &EXT3_I(inode)->i_state_flags); |
| 569 | } | 569 | } |
| 570 | 570 | ||
| 571 | static inline void ext3_set_inode_state(struct inode *inode, int bit) | 571 | static inline void ext3_set_inode_state(struct inode *inode, int bit) |
| 572 | { | 572 | { |
| 573 | set_bit(bit, &EXT3_I(inode)->i_state); | 573 | set_bit(bit, &EXT3_I(inode)->i_state_flags); |
| 574 | } | 574 | } |
| 575 | 575 | ||
| 576 | static inline void ext3_clear_inode_state(struct inode *inode, int bit) | 576 | static inline void ext3_clear_inode_state(struct inode *inode, int bit) |
| 577 | { | 577 | { |
| 578 | clear_bit(bit, &EXT3_I(inode)->i_state); | 578 | clear_bit(bit, &EXT3_I(inode)->i_state_flags); |
| 579 | } | 579 | } |
| 580 | #else | 580 | #else |
| 581 | /* Assume that user mode programs are passing in an ext3fs superblock, not | 581 | /* Assume that user mode programs are passing in an ext3fs superblock, not |
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index 7679acdb519a..f42c098aed8d 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h | |||
| @@ -87,7 +87,7 @@ struct ext3_inode_info { | |||
| 87 | * near to their parent directory's inode. | 87 | * near to their parent directory's inode. |
| 88 | */ | 88 | */ |
| 89 | __u32 i_block_group; | 89 | __u32 i_block_group; |
| 90 | unsigned long i_state; /* Dynamic state flags for ext3 */ | 90 | unsigned long i_state_flags; /* Dynamic state flags for ext3 */ |
| 91 | 91 | ||
| 92 | /* block reservation info */ | 92 | /* block reservation info */ |
| 93 | struct ext3_block_alloc_info *i_block_alloc_info; | 93 | struct ext3_block_alloc_info *i_block_alloc_info; |
diff --git a/include/linux/filter.h b/include/linux/filter.h index 29a0e3db9f43..151f5d703b7e 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
| @@ -123,7 +123,8 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ | |||
| 123 | #define SKF_AD_NLATTR_NEST 16 | 123 | #define SKF_AD_NLATTR_NEST 16 |
| 124 | #define SKF_AD_MARK 20 | 124 | #define SKF_AD_MARK 20 |
| 125 | #define SKF_AD_QUEUE 24 | 125 | #define SKF_AD_QUEUE 24 |
| 126 | #define SKF_AD_MAX 28 | 126 | #define SKF_AD_HATYPE 28 |
| 127 | #define SKF_AD_MAX 32 | ||
| 127 | #define SKF_NET_OFF (-0x100000) | 128 | #define SKF_NET_OFF (-0x100000) |
| 128 | #define SKF_LL_OFF (-0x200000) | 129 | #define SKF_LL_OFF (-0x200000) |
| 129 | 130 | ||
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index 40b11013408e..68f883b30a53 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
| @@ -1,21 +1,26 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Char device interface. | 2 | * Char device interface. |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2005-2006 Kristian Hoegsberg <krh@bitplanet.net> | 4 | * Copyright (C) 2005-2007 Kristian Hoegsberg <krh@bitplanet.net> |
| 5 | * | 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | * it under the terms of the GNU General Public License as published by | 7 | * copy of this software and associated documentation files (the "Software"), |
| 8 | * the Free Software Foundation; either version 2 of the License, or | 8 | * to deal in the Software without restriction, including without limitation |
| 9 | * (at your option) any later version. | 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 | * | 10 | * and/or sell copies of the Software, and to permit persons to whom the |
| 11 | * This program is distributed in the hope that it will be useful, | 11 | * Software is furnished to do so, subject to the following conditions: |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * The above copyright notice and this permission notice (including the next |
| 14 | * GNU General Public License for more details. | 14 | * paragraph) shall be included in all copies or substantial portions of the |
| 15 | * | 15 | * Software. |
| 16 | * You should have received a copy of the GNU General Public License | 16 | * |
| 17 | * along with this program; if not, write to the Free Software Foundation, | 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 20 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 21 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 22 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 23 | * DEALINGS IN THE SOFTWARE. | ||
| 19 | */ | 24 | */ |
| 20 | 25 | ||
| 21 | #ifndef _LINUX_FIREWIRE_CDEV_H | 26 | #ifndef _LINUX_FIREWIRE_CDEV_H |
| @@ -438,7 +443,7 @@ struct fw_cdev_remove_descriptor { | |||
| 438 | * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE | 443 | * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE |
| 439 | * @header_size: Header size to strip for receive contexts | 444 | * @header_size: Header size to strip for receive contexts |
| 440 | * @channel: Channel to bind to | 445 | * @channel: Channel to bind to |
| 441 | * @speed: Speed to transmit at | 446 | * @speed: Speed for transmit contexts |
| 442 | * @closure: To be returned in &fw_cdev_event_iso_interrupt | 447 | * @closure: To be returned in &fw_cdev_event_iso_interrupt |
| 443 | * @handle: Handle to context, written back by kernel | 448 | * @handle: Handle to context, written back by kernel |
| 444 | * | 449 | * |
| @@ -451,6 +456,9 @@ struct fw_cdev_remove_descriptor { | |||
| 451 | * If a context was successfully created, the kernel writes back a handle to the | 456 | * If a context was successfully created, the kernel writes back a handle to the |
| 452 | * context, which must be passed in for subsequent operations on that context. | 457 | * context, which must be passed in for subsequent operations on that context. |
| 453 | * | 458 | * |
| 459 | * For receive contexts, @header_size must be at least 4 and must be a multiple | ||
| 460 | * of 4. | ||
| 461 | * | ||
| 454 | * Note that the effect of a @header_size > 4 depends on | 462 | * Note that the effect of a @header_size > 4 depends on |
| 455 | * &fw_cdev_get_info.version, as documented at &fw_cdev_event_iso_interrupt. | 463 | * &fw_cdev_get_info.version, as documented at &fw_cdev_event_iso_interrupt. |
| 456 | */ | 464 | */ |
| @@ -481,10 +489,34 @@ struct fw_cdev_create_iso_context { | |||
| 481 | * | 489 | * |
| 482 | * &struct fw_cdev_iso_packet is used to describe isochronous packet queues. | 490 | * &struct fw_cdev_iso_packet is used to describe isochronous packet queues. |
| 483 | * | 491 | * |
| 484 | * Use the FW_CDEV_ISO_ macros to fill in @control. The sy and tag fields are | 492 | * Use the FW_CDEV_ISO_ macros to fill in @control. |
| 485 | * specified by IEEE 1394a and IEC 61883. | 493 | * |
| 486 | * | 494 | * For transmit packets, the header length must be a multiple of 4 and specifies |
| 487 | * FIXME - finish this documentation | 495 | * the numbers of bytes in @header that will be prepended to the packet's |
| 496 | * payload; these bytes are copied into the kernel and will not be accessed | ||
| 497 | * after the ioctl has returned. The sy and tag fields are copied to the iso | ||
| 498 | * packet header (these fields are specified by IEEE 1394a and IEC 61883-1). | ||
| 499 | * The skip flag specifies that no packet is to be sent in a frame; when using | ||
| 500 | * this, all other fields except the interrupt flag must be zero. | ||
| 501 | * | ||
| 502 | * For receive packets, the header length must be a multiple of the context's | ||
| 503 | * header size; if the header length is larger than the context's header size, | ||
| 504 | * multiple packets are queued for this entry. The sy and tag fields are | ||
| 505 | * ignored. If the sync flag is set, the context drops all packets until | ||
| 506 | * a packet with a matching sy field is received (the sync value to wait for is | ||
| 507 | * specified in the &fw_cdev_start_iso structure). The payload length defines | ||
| 508 | * how many payload bytes can be received for one packet (in addition to payload | ||
| 509 | * quadlets that have been defined as headers and are stripped and returned in | ||
| 510 | * the &fw_cdev_event_iso_interrupt structure). If more bytes are received, the | ||
| 511 | * additional bytes are dropped. If less bytes are received, the remaining | ||
| 512 | * bytes in this part of the payload buffer will not be written to, not even by | ||
| 513 | * the next packet, i.e., packets received in consecutive frames will not | ||
| 514 | * necessarily be consecutive in memory. If an entry has queued multiple | ||
| 515 | * packets, the payload length is divided equally among them. | ||
| 516 | * | ||
| 517 | * When a packet with the interrupt flag set has been completed, the | ||
| 518 | * &fw_cdev_event_iso_interrupt event will be sent. An entry that has queued | ||
| 519 | * multiple receive packets is completed when its last packet is completed. | ||
| 488 | */ | 520 | */ |
| 489 | struct fw_cdev_iso_packet { | 521 | struct fw_cdev_iso_packet { |
| 490 | __u32 control; | 522 | __u32 control; |
| @@ -501,7 +533,7 @@ struct fw_cdev_iso_packet { | |||
| 501 | * Queue a number of isochronous packets for reception or transmission. | 533 | * Queue a number of isochronous packets for reception or transmission. |
| 502 | * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs, | 534 | * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs, |
| 503 | * which describe how to transmit from or receive into a contiguous region | 535 | * which describe how to transmit from or receive into a contiguous region |
| 504 | * of a mmap()'ed payload buffer. As part of the packet descriptors, | 536 | * of a mmap()'ed payload buffer. As part of transmit packet descriptors, |
| 505 | * a series of headers can be supplied, which will be prepended to the | 537 | * a series of headers can be supplied, which will be prepended to the |
| 506 | * payload during DMA. | 538 | * payload during DMA. |
| 507 | * | 539 | * |
| @@ -620,8 +652,8 @@ struct fw_cdev_get_cycle_timer2 { | |||
| 620 | * instead of allocated. | 652 | * instead of allocated. |
| 621 | * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event concludes this operation. | 653 | * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event concludes this operation. |
| 622 | * | 654 | * |
| 623 | * To summarize, %FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE allocates iso resources | 655 | * To summarize, %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE allocates iso resources |
| 624 | * for the lifetime of the fd or handle. | 656 | * for the lifetime of the fd or @handle. |
| 625 | * In contrast, %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE allocates iso resources | 657 | * In contrast, %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE allocates iso resources |
| 626 | * for the duration of a bus generation. | 658 | * for the duration of a bus generation. |
| 627 | * | 659 | * |
diff --git a/include/linux/firewire-constants.h b/include/linux/firewire-constants.h index b316770a43fd..9b4bb5fbba4b 100644 --- a/include/linux/firewire-constants.h +++ b/include/linux/firewire-constants.h | |||
| @@ -1,3 +1,28 @@ | |||
| 1 | /* | ||
| 2 | * IEEE 1394 constants. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005-2007 Kristian Hoegsberg <krh@bitplanet.net> | ||
| 5 | * | ||
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 7 | * copy of this software and associated documentation files (the "Software"), | ||
| 8 | * to deal in the Software without restriction, including without limitation | ||
| 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 10 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 11 | * Software is furnished to do so, subject to the following conditions: | ||
| 12 | * | ||
| 13 | * The above copyright notice and this permission notice (including the next | ||
| 14 | * paragraph) shall be included in all copies or substantial portions of the | ||
| 15 | * Software. | ||
| 16 | * | ||
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 20 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 21 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 22 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 23 | * DEALINGS IN THE SOFTWARE. | ||
| 24 | */ | ||
| 25 | |||
| 1 | #ifndef _LINUX_FIREWIRE_CONSTANTS_H | 26 | #ifndef _LINUX_FIREWIRE_CONSTANTS_H |
| 2 | #define _LINUX_FIREWIRE_CONSTANTS_H | 27 | #define _LINUX_FIREWIRE_CONSTANTS_H |
| 3 | 28 | ||
| @@ -21,7 +46,7 @@ | |||
| 21 | #define EXTCODE_WRAP_ADD 0x6 | 46 | #define EXTCODE_WRAP_ADD 0x6 |
| 22 | #define EXTCODE_VENDOR_DEPENDENT 0x7 | 47 | #define EXTCODE_VENDOR_DEPENDENT 0x7 |
| 23 | 48 | ||
| 24 | /* Juju specific tcodes */ | 49 | /* Linux firewire-core (Juju) specific tcodes */ |
| 25 | #define TCODE_LOCK_MASK_SWAP (0x10 | EXTCODE_MASK_SWAP) | 50 | #define TCODE_LOCK_MASK_SWAP (0x10 | EXTCODE_MASK_SWAP) |
| 26 | #define TCODE_LOCK_COMPARE_SWAP (0x10 | EXTCODE_COMPARE_SWAP) | 51 | #define TCODE_LOCK_COMPARE_SWAP (0x10 | EXTCODE_COMPARE_SWAP) |
| 27 | #define TCODE_LOCK_FETCH_ADD (0x10 | EXTCODE_FETCH_ADD) | 52 | #define TCODE_LOCK_FETCH_ADD (0x10 | EXTCODE_FETCH_ADD) |
| @@ -36,7 +61,7 @@ | |||
| 36 | #define RCODE_TYPE_ERROR 0x6 | 61 | #define RCODE_TYPE_ERROR 0x6 |
| 37 | #define RCODE_ADDRESS_ERROR 0x7 | 62 | #define RCODE_ADDRESS_ERROR 0x7 |
| 38 | 63 | ||
| 39 | /* Juju specific rcodes */ | 64 | /* Linux firewire-core (Juju) specific rcodes */ |
| 40 | #define RCODE_SEND_ERROR 0x10 | 65 | #define RCODE_SEND_ERROR 0x10 |
| 41 | #define RCODE_CANCELLED 0x11 | 66 | #define RCODE_CANCELLED 0x11 |
| 42 | #define RCODE_BUSY 0x12 | 67 | #define RCODE_BUSY 0x12 |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 043811f0d277..53d1e6c4f848 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | struct firmware { | 12 | struct firmware { |
| 13 | size_t size; | 13 | size_t size; |
| 14 | const u8 *data; | 14 | const u8 *data; |
| 15 | struct page **pages; | ||
| 15 | }; | 16 | }; |
| 16 | 17 | ||
| 17 | struct device; | 18 | struct device; |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 5a361f85cfec..da7e52b099f3 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
| @@ -64,9 +64,12 @@ extern bool freeze_task(struct task_struct *p, bool sig_only); | |||
| 64 | extern void cancel_freezing(struct task_struct *p); | 64 | extern void cancel_freezing(struct task_struct *p); |
| 65 | 65 | ||
| 66 | #ifdef CONFIG_CGROUP_FREEZER | 66 | #ifdef CONFIG_CGROUP_FREEZER |
| 67 | extern int cgroup_frozen(struct task_struct *task); | 67 | extern int cgroup_freezing_or_frozen(struct task_struct *task); |
| 68 | #else /* !CONFIG_CGROUP_FREEZER */ | 68 | #else /* !CONFIG_CGROUP_FREEZER */ |
| 69 | static inline int cgroup_frozen(struct task_struct *task) { return 0; } | 69 | static inline int cgroup_freezing_or_frozen(struct task_struct *task) |
| 70 | { | ||
| 71 | return 0; | ||
| 72 | } | ||
| 70 | #endif /* !CONFIG_CGROUP_FREEZER */ | 73 | #endif /* !CONFIG_CGROUP_FREEZER */ |
| 71 | 74 | ||
| 72 | /* | 75 | /* |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 10b8dedcd18b..4079ef99900f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -1280,10 +1280,12 @@ static inline int lock_may_write(struct inode *inode, loff_t start, | |||
| 1280 | 1280 | ||
| 1281 | 1281 | ||
| 1282 | struct fasync_struct { | 1282 | struct fasync_struct { |
| 1283 | int magic; | 1283 | spinlock_t fa_lock; |
| 1284 | int fa_fd; | 1284 | int magic; |
| 1285 | struct fasync_struct *fa_next; /* singly linked list */ | 1285 | int fa_fd; |
| 1286 | struct file *fa_file; | 1286 | struct fasync_struct *fa_next; /* singly linked list */ |
| 1287 | struct file *fa_file; | ||
| 1288 | struct rcu_head fa_rcu; | ||
| 1287 | }; | 1289 | }; |
| 1288 | 1290 | ||
| 1289 | #define FASYNC_MAGIC 0x4601 | 1291 | #define FASYNC_MAGIC 0x4601 |
| @@ -1292,8 +1294,6 @@ struct fasync_struct { | |||
| 1292 | extern int fasync_helper(int, struct file *, int, struct fasync_struct **); | 1294 | extern int fasync_helper(int, struct file *, int, struct fasync_struct **); |
| 1293 | /* can be called from interrupts */ | 1295 | /* can be called from interrupts */ |
| 1294 | extern void kill_fasync(struct fasync_struct **, int, int); | 1296 | extern void kill_fasync(struct fasync_struct **, int, int); |
| 1295 | /* only for net: no internal synchronization */ | ||
| 1296 | extern void __kill_fasync(struct fasync_struct *, int, int); | ||
| 1297 | 1297 | ||
| 1298 | extern int __f_setown(struct file *filp, struct pid *, enum pid_type, int force); | 1298 | extern int __f_setown(struct file *filp, struct pid *, enum pid_type, int force); |
| 1299 | extern int f_setown(struct file *filp, unsigned long arg, int force); | 1299 | extern int f_setown(struct file *filp, unsigned long arg, int force); |
| @@ -2212,6 +2212,7 @@ extern int generic_segment_checks(const struct iovec *iov, | |||
| 2212 | /* fs/block_dev.c */ | 2212 | /* fs/block_dev.c */ |
| 2213 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, | 2213 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, |
| 2214 | unsigned long nr_segs, loff_t pos); | 2214 | unsigned long nr_segs, loff_t pos); |
| 2215 | extern int blkdev_fsync(struct file *filp, struct dentry *dentry, int datasync); | ||
| 2215 | 2216 | ||
| 2216 | /* fs/splice.c */ | 2217 | /* fs/splice.c */ |
| 2217 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, | 2218 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, |
| @@ -2314,8 +2315,9 @@ extern int vfs_fstatat(int , char __user *, struct kstat *, int); | |||
| 2314 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | 2315 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, |
| 2315 | unsigned long arg); | 2316 | unsigned long arg); |
| 2316 | extern int __generic_block_fiemap(struct inode *inode, | 2317 | extern int __generic_block_fiemap(struct inode *inode, |
| 2317 | struct fiemap_extent_info *fieinfo, u64 start, | 2318 | struct fiemap_extent_info *fieinfo, |
| 2318 | u64 len, get_block_t *get_block); | 2319 | loff_t start, loff_t len, |
| 2320 | get_block_t *get_block); | ||
| 2319 | extern int generic_block_fiemap(struct inode *inode, | 2321 | extern int generic_block_fiemap(struct inode *inode, |
| 2320 | struct fiemap_extent_info *fieinfo, u64 start, | 2322 | struct fiemap_extent_info *fieinfo, u64 start, |
| 2321 | u64 len, get_block_t *get_block); | 2323 | u64 len, get_block_t *get_block); |
| @@ -2360,6 +2362,8 @@ extern void simple_release_fs(struct vfsmount **mount, int *count); | |||
| 2360 | 2362 | ||
| 2361 | extern ssize_t simple_read_from_buffer(void __user *to, size_t count, | 2363 | extern ssize_t simple_read_from_buffer(void __user *to, size_t count, |
| 2362 | loff_t *ppos, const void *from, size_t available); | 2364 | loff_t *ppos, const void *from, size_t available); |
| 2365 | extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, | ||
| 2366 | const void __user *from, size_t count); | ||
| 2363 | 2367 | ||
| 2364 | extern int simple_fsync(struct file *, struct dentry *, int); | 2368 | extern int simple_fsync(struct file *, struct dentry *, int); |
| 2365 | 2369 | ||
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index 7be0c6fbe880..c57db27ac861 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h | |||
| @@ -105,7 +105,7 @@ struct fscache_operation { | |||
| 105 | /* operation releaser */ | 105 | /* operation releaser */ |
| 106 | fscache_operation_release_t release; | 106 | fscache_operation_release_t release; |
| 107 | 107 | ||
| 108 | #ifdef CONFIG_SLOW_WORK_PROC | 108 | #ifdef CONFIG_SLOW_WORK_DEBUG |
| 109 | const char *name; /* operation name */ | 109 | const char *name; /* operation name */ |
| 110 | const char *state; /* operation state */ | 110 | const char *state; /* operation state */ |
| 111 | #define fscache_set_op_name(OP, N) do { (OP)->name = (N); } while(0) | 111 | #define fscache_set_op_name(OP, N) do { (OP)->name = (N); } while(0) |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index df8fd9a3b214..01755909ce81 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/inotify.h> | 15 | #include <linux/inotify.h> |
| 16 | #include <linux/fsnotify_backend.h> | 16 | #include <linux/fsnotify_backend.h> |
| 17 | #include <linux/audit.h> | 17 | #include <linux/audit.h> |
| 18 | #include <linux/slab.h> | ||
| 18 | 19 | ||
| 19 | /* | 20 | /* |
| 20 | * fsnotify_d_instantiate - instantiate a dentry for inode | 21 | * fsnotify_d_instantiate - instantiate a dentry for inode |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 01e6adea07ec..41e46330d9be 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -82,9 +82,13 @@ void clear_ftrace_function(void); | |||
| 82 | extern void ftrace_stub(unsigned long a0, unsigned long a1); | 82 | extern void ftrace_stub(unsigned long a0, unsigned long a1); |
| 83 | 83 | ||
| 84 | #else /* !CONFIG_FUNCTION_TRACER */ | 84 | #else /* !CONFIG_FUNCTION_TRACER */ |
| 85 | # define register_ftrace_function(ops) do { } while (0) | 85 | /* |
| 86 | # define unregister_ftrace_function(ops) do { } while (0) | 86 | * (un)register_ftrace_function must be a macro since the ops parameter |
| 87 | # define clear_ftrace_function(ops) do { } while (0) | 87 | * must not be evaluated. |
| 88 | */ | ||
| 89 | #define register_ftrace_function(ops) ({ 0; }) | ||
| 90 | #define unregister_ftrace_function(ops) ({ 0; }) | ||
| 91 | static inline void clear_ftrace_function(void) { } | ||
| 88 | static inline void ftrace_kill(void) { } | 92 | static inline void ftrace_kill(void) { } |
| 89 | static inline void ftrace_stop(void) { } | 93 | static inline void ftrace_stop(void) { } |
| 90 | static inline void ftrace_start(void) { } | 94 | static inline void ftrace_start(void) { } |
| @@ -237,11 +241,13 @@ extern int skip_trace(unsigned long ip); | |||
| 237 | extern void ftrace_disable_daemon(void); | 241 | extern void ftrace_disable_daemon(void); |
| 238 | extern void ftrace_enable_daemon(void); | 242 | extern void ftrace_enable_daemon(void); |
| 239 | #else | 243 | #else |
| 240 | # define skip_trace(ip) ({ 0; }) | 244 | static inline int skip_trace(unsigned long ip) { return 0; } |
| 241 | # define ftrace_force_update() ({ 0; }) | 245 | static inline int ftrace_force_update(void) { return 0; } |
| 242 | # define ftrace_set_filter(buf, len, reset) do { } while (0) | 246 | static inline void ftrace_set_filter(unsigned char *buf, int len, int reset) |
| 243 | # define ftrace_disable_daemon() do { } while (0) | 247 | { |
| 244 | # define ftrace_enable_daemon() do { } while (0) | 248 | } |
| 249 | static inline void ftrace_disable_daemon(void) { } | ||
| 250 | static inline void ftrace_enable_daemon(void) { } | ||
| 245 | static inline void ftrace_release_mod(struct module *mod) {} | 251 | static inline void ftrace_release_mod(struct module *mod) {} |
| 246 | static inline int register_ftrace_command(struct ftrace_func_command *cmd) | 252 | static inline int register_ftrace_command(struct ftrace_func_command *cmd) |
| 247 | { | 253 | { |
| @@ -314,16 +320,16 @@ static inline void __ftrace_enabled_restore(int enabled) | |||
| 314 | extern void time_hardirqs_on(unsigned long a0, unsigned long a1); | 320 | extern void time_hardirqs_on(unsigned long a0, unsigned long a1); |
| 315 | extern void time_hardirqs_off(unsigned long a0, unsigned long a1); | 321 | extern void time_hardirqs_off(unsigned long a0, unsigned long a1); |
| 316 | #else | 322 | #else |
| 317 | # define time_hardirqs_on(a0, a1) do { } while (0) | 323 | static inline void time_hardirqs_on(unsigned long a0, unsigned long a1) { } |
| 318 | # define time_hardirqs_off(a0, a1) do { } while (0) | 324 | static inline void time_hardirqs_off(unsigned long a0, unsigned long a1) { } |
| 319 | #endif | 325 | #endif |
| 320 | 326 | ||
| 321 | #ifdef CONFIG_PREEMPT_TRACER | 327 | #ifdef CONFIG_PREEMPT_TRACER |
| 322 | extern void trace_preempt_on(unsigned long a0, unsigned long a1); | 328 | extern void trace_preempt_on(unsigned long a0, unsigned long a1); |
| 323 | extern void trace_preempt_off(unsigned long a0, unsigned long a1); | 329 | extern void trace_preempt_off(unsigned long a0, unsigned long a1); |
| 324 | #else | 330 | #else |
| 325 | # define trace_preempt_on(a0, a1) do { } while (0) | 331 | static inline void trace_preempt_on(unsigned long a0, unsigned long a1) { } |
| 326 | # define trace_preempt_off(a0, a1) do { } while (0) | 332 | static inline void trace_preempt_off(unsigned long a0, unsigned long a1) { } |
| 327 | #endif | 333 | #endif |
| 328 | 334 | ||
| 329 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | 335 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD |
| @@ -352,6 +358,10 @@ struct ftrace_graph_ret { | |||
| 352 | int depth; | 358 | int depth; |
| 353 | }; | 359 | }; |
| 354 | 360 | ||
| 361 | /* Type of the callback handlers for tracing function graph*/ | ||
| 362 | typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return */ | ||
| 363 | typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */ | ||
| 364 | |||
| 355 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 365 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
| 356 | 366 | ||
| 357 | /* for init task */ | 367 | /* for init task */ |
| @@ -400,10 +410,6 @@ extern char __irqentry_text_end[]; | |||
| 400 | 410 | ||
| 401 | #define FTRACE_RETFUNC_DEPTH 50 | 411 | #define FTRACE_RETFUNC_DEPTH 50 |
| 402 | #define FTRACE_RETSTACK_ALLOC_SIZE 32 | 412 | #define FTRACE_RETSTACK_ALLOC_SIZE 32 |
| 403 | /* Type of the callback handlers for tracing function graph*/ | ||
| 404 | typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return */ | ||
| 405 | typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */ | ||
| 406 | |||
| 407 | extern int register_ftrace_graph(trace_func_graph_ret_t retfunc, | 413 | extern int register_ftrace_graph(trace_func_graph_ret_t retfunc, |
| 408 | trace_func_graph_ent_t entryfunc); | 414 | trace_func_graph_ent_t entryfunc); |
| 409 | 415 | ||
| @@ -441,6 +447,13 @@ static inline void unpause_graph_tracing(void) | |||
| 441 | static inline void ftrace_graph_init_task(struct task_struct *t) { } | 447 | static inline void ftrace_graph_init_task(struct task_struct *t) { } |
| 442 | static inline void ftrace_graph_exit_task(struct task_struct *t) { } | 448 | static inline void ftrace_graph_exit_task(struct task_struct *t) { } |
| 443 | 449 | ||
| 450 | static inline int register_ftrace_graph(trace_func_graph_ret_t retfunc, | ||
| 451 | trace_func_graph_ent_t entryfunc) | ||
| 452 | { | ||
| 453 | return -1; | ||
| 454 | } | ||
| 455 | static inline void unregister_ftrace_graph(void) { } | ||
| 456 | |||
| 444 | static inline int task_curr_ret_stack(struct task_struct *tsk) | 457 | static inline int task_curr_ret_stack(struct task_struct *tsk) |
| 445 | { | 458 | { |
| 446 | return -1; | 459 | return -1; |
| @@ -492,7 +505,9 @@ static inline int test_tsk_trace_graph(struct task_struct *tsk) | |||
| 492 | return tsk->trace & TSK_TRACE_FL_GRAPH; | 505 | return tsk->trace & TSK_TRACE_FL_GRAPH; |
| 493 | } | 506 | } |
| 494 | 507 | ||
| 495 | extern int ftrace_dump_on_oops; | 508 | enum ftrace_dump_mode; |
| 509 | |||
| 510 | extern enum ftrace_dump_mode ftrace_dump_on_oops; | ||
| 496 | 511 | ||
| 497 | #ifdef CONFIG_PREEMPT | 512 | #ifdef CONFIG_PREEMPT |
| 498 | #define INIT_TRACE_RECURSION .trace_recursion = 0, | 513 | #define INIT_TRACE_RECURSION .trace_recursion = 0, |
| @@ -504,18 +519,6 @@ extern int ftrace_dump_on_oops; | |||
| 504 | #define INIT_TRACE_RECURSION | 519 | #define INIT_TRACE_RECURSION |
| 505 | #endif | 520 | #endif |
| 506 | 521 | ||
| 507 | #ifdef CONFIG_HW_BRANCH_TRACER | ||
| 508 | |||
| 509 | void trace_hw_branch(u64 from, u64 to); | ||
| 510 | void trace_hw_branch_oops(void); | ||
| 511 | |||
| 512 | #else /* CONFIG_HW_BRANCH_TRACER */ | ||
| 513 | |||
| 514 | static inline void trace_hw_branch(u64 from, u64 to) {} | ||
| 515 | static inline void trace_hw_branch_oops(void) {} | ||
| 516 | |||
| 517 | #endif /* CONFIG_HW_BRANCH_TRACER */ | ||
| 518 | |||
| 519 | #ifdef CONFIG_FTRACE_SYSCALLS | 522 | #ifdef CONFIG_FTRACE_SYSCALLS |
| 520 | 523 | ||
| 521 | unsigned long arch_syscall_addr(int nr); | 524 | unsigned long arch_syscall_addr(int nr); |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 6b7c444ab8f6..c082f223e2fe 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -25,6 +25,9 @@ const char *ftrace_print_flags_seq(struct trace_seq *p, const char *delim, | |||
| 25 | const char *ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val, | 25 | const char *ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val, |
| 26 | const struct trace_print_flags *symbol_array); | 26 | const struct trace_print_flags *symbol_array); |
| 27 | 27 | ||
| 28 | const char *ftrace_print_hex_seq(struct trace_seq *p, | ||
| 29 | const unsigned char *buf, int len); | ||
| 30 | |||
| 28 | /* | 31 | /* |
| 29 | * The trace entry - the most basic unit of tracing. This is what | 32 | * The trace entry - the most basic unit of tracing. This is what |
| 30 | * is printed in the end as a single line in the trace output, such as: | 33 | * is printed in the end as a single line in the trace output, such as: |
| @@ -58,6 +61,7 @@ struct trace_iterator { | |||
| 58 | /* The below is zeroed out in pipe_read */ | 61 | /* The below is zeroed out in pipe_read */ |
| 59 | struct trace_seq seq; | 62 | struct trace_seq seq; |
| 60 | struct trace_entry *ent; | 63 | struct trace_entry *ent; |
| 64 | unsigned long lost_events; | ||
| 61 | int leftover; | 65 | int leftover; |
| 62 | int cpu; | 66 | int cpu; |
| 63 | u64 ts; | 67 | u64 ts; |
| @@ -131,12 +135,12 @@ struct ftrace_event_call { | |||
| 131 | void *mod; | 135 | void *mod; |
| 132 | void *data; | 136 | void *data; |
| 133 | 137 | ||
| 134 | int profile_count; | 138 | int perf_refcount; |
| 135 | int (*profile_enable)(struct ftrace_event_call *); | 139 | int (*perf_event_enable)(struct ftrace_event_call *); |
| 136 | void (*profile_disable)(struct ftrace_event_call *); | 140 | void (*perf_event_disable)(struct ftrace_event_call *); |
| 137 | }; | 141 | }; |
| 138 | 142 | ||
| 139 | #define FTRACE_MAX_PROFILE_SIZE 2048 | 143 | #define PERF_MAX_TRACE_SIZE 2048 |
| 140 | 144 | ||
| 141 | #define MAX_FILTER_PRED 32 | 145 | #define MAX_FILTER_PRED 32 |
| 142 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ | 146 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ |
| @@ -187,22 +191,25 @@ do { \ | |||
| 187 | 191 | ||
| 188 | #ifdef CONFIG_PERF_EVENTS | 192 | #ifdef CONFIG_PERF_EVENTS |
| 189 | struct perf_event; | 193 | struct perf_event; |
| 190 | extern int ftrace_profile_enable(int event_id); | 194 | |
| 191 | extern void ftrace_profile_disable(int event_id); | 195 | DECLARE_PER_CPU(struct pt_regs, perf_trace_regs); |
| 196 | |||
| 197 | extern int perf_trace_enable(int event_id); | ||
| 198 | extern void perf_trace_disable(int event_id); | ||
| 192 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, | 199 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, |
| 193 | char *filter_str); | 200 | char *filter_str); |
| 194 | extern void ftrace_profile_free_filter(struct perf_event *event); | 201 | extern void ftrace_profile_free_filter(struct perf_event *event); |
| 195 | extern void * | 202 | extern void * |
| 196 | ftrace_perf_buf_prepare(int size, unsigned short type, int *rctxp, | 203 | perf_trace_buf_prepare(int size, unsigned short type, int *rctxp, |
| 197 | unsigned long *irq_flags); | 204 | unsigned long *irq_flags); |
| 198 | 205 | ||
| 199 | static inline void | 206 | static inline void |
| 200 | ftrace_perf_buf_submit(void *raw_data, int size, int rctx, u64 addr, | 207 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, |
| 201 | u64 count, unsigned long irq_flags) | 208 | u64 count, unsigned long irq_flags, struct pt_regs *regs) |
| 202 | { | 209 | { |
| 203 | struct trace_entry *entry = raw_data; | 210 | struct trace_entry *entry = raw_data; |
| 204 | 211 | ||
| 205 | perf_tp_event(entry->type, addr, count, raw_data, size); | 212 | perf_tp_event(entry->type, addr, count, raw_data, size, regs); |
| 206 | perf_swevent_put_recursion_context(rctx); | 213 | perf_swevent_put_recursion_context(rctx); |
| 207 | local_irq_restore(irq_flags); | 214 | local_irq_restore(irq_flags); |
| 208 | } | 215 | } |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 48e68da097f6..361d1cc288d0 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
| 17 | #include <linux/device.h> | 17 | #include <linux/device.h> |
| 18 | #include <linux/timer.h> | 18 | #include <linux/timer.h> |
| 19 | #include <linux/slab.h> | ||
| 19 | 20 | ||
| 20 | struct gameport { | 21 | struct gameport { |
| 21 | 22 | ||
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h index b834ef6d59fa..61549b26ad6f 100644 --- a/include/linux/genetlink.h +++ b/include/linux/genetlink.h | |||
| @@ -80,4 +80,12 @@ enum { | |||
| 80 | 80 | ||
| 81 | #define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1) | 81 | #define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1) |
| 82 | 82 | ||
| 83 | #ifdef __KERNEL__ | ||
| 84 | |||
| 85 | /* All generic netlink requests are serialized by a global lock. */ | ||
| 86 | extern void genl_lock(void); | ||
| 87 | extern void genl_unlock(void); | ||
| 88 | |||
| 89 | #endif /* __KERNEL__ */ | ||
| 90 | |||
| 83 | #endif /* __LINUX_GENERIC_NETLINK_H */ | 91 | #endif /* __LINUX_GENERIC_NETLINK_H */ |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 56b50514ab25..5f2f4c4d8fb0 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -109,7 +109,7 @@ struct hd_struct { | |||
| 109 | }; | 109 | }; |
| 110 | 110 | ||
| 111 | #define GENHD_FL_REMOVABLE 1 | 111 | #define GENHD_FL_REMOVABLE 1 |
| 112 | #define GENHD_FL_DRIVERFS 2 | 112 | /* 2 is unused */ |
| 113 | #define GENHD_FL_MEDIA_CHANGE_NOTIFY 4 | 113 | #define GENHD_FL_MEDIA_CHANGE_NOTIFY 4 |
| 114 | #define GENHD_FL_CD 8 | 114 | #define GENHD_FL_CD 8 |
| 115 | #define GENHD_FL_UP 16 | 115 | #define GENHD_FL_UP 16 |
diff --git a/include/linux/hil.h b/include/linux/hil.h index 13352d7d0caf..523785a9de70 100644 --- a/include/linux/hil.h +++ b/include/linux/hil.h | |||
| @@ -168,14 +168,14 @@ enum hil_command { | |||
| 168 | HIL_CMD_PR6 = 0x45, /* Prompt6 */ | 168 | HIL_CMD_PR6 = 0x45, /* Prompt6 */ |
| 169 | HIL_CMD_PR7 = 0x46, /* Prompt7 */ | 169 | HIL_CMD_PR7 = 0x46, /* Prompt7 */ |
| 170 | HIL_CMD_PRM = 0x47, /* Prompt (General Purpose) */ | 170 | HIL_CMD_PRM = 0x47, /* Prompt (General Purpose) */ |
| 171 | HIL_CMD_AK1 = 0x48, /* Acknowlege1 */ | 171 | HIL_CMD_AK1 = 0x48, /* Acknowledge1 */ |
| 172 | HIL_CMD_AK2 = 0x49, /* Acknowlege2 */ | 172 | HIL_CMD_AK2 = 0x49, /* Acknowledge2 */ |
| 173 | HIL_CMD_AK3 = 0x4a, /* Acknowlege3 */ | 173 | HIL_CMD_AK3 = 0x4a, /* Acknowledge3 */ |
| 174 | HIL_CMD_AK4 = 0x4b, /* Acknowlege4 */ | 174 | HIL_CMD_AK4 = 0x4b, /* Acknowledge4 */ |
| 175 | HIL_CMD_AK5 = 0x4c, /* Acknowlege5 */ | 175 | HIL_CMD_AK5 = 0x4c, /* Acknowledge5 */ |
| 176 | HIL_CMD_AK6 = 0x4d, /* Acknowlege6 */ | 176 | HIL_CMD_AK6 = 0x4d, /* Acknowledge6 */ |
| 177 | HIL_CMD_AK7 = 0x4e, /* Acknowlege7 */ | 177 | HIL_CMD_AK7 = 0x4e, /* Acknowledge7 */ |
| 178 | HIL_CMD_ACK = 0x4f, /* Acknowlege (General Purpose) */ | 178 | HIL_CMD_ACK = 0x4f, /* Acknowledge (General Purpose) */ |
| 179 | 179 | ||
| 180 | /* 0x50 to 0x78 reserved for future use */ | 180 | /* 0x50 to 0x78 reserved for future use */ |
| 181 | /* 0x80 to 0xEF device-specific commands */ | 181 | /* 0x80 to 0xEF device-specific commands */ |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 5d86fb2309d2..fd0c1b857d3d 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
| @@ -422,6 +422,8 @@ extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, | |||
| 422 | 422 | ||
| 423 | extern int schedule_hrtimeout_range(ktime_t *expires, unsigned long delta, | 423 | extern int schedule_hrtimeout_range(ktime_t *expires, unsigned long delta, |
| 424 | const enum hrtimer_mode mode); | 424 | const enum hrtimer_mode mode); |
| 425 | extern int schedule_hrtimeout_range_clock(ktime_t *expires, | ||
| 426 | unsigned long delta, const enum hrtimer_mode mode, int clock); | ||
| 425 | extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode); | 427 | extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode); |
| 426 | 428 | ||
| 427 | /* Soft interrupt function to run the hrtimer queues: */ | 429 | /* Soft interrupt function to run the hrtimer queues: */ |
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index 5977b724f7c6..a2d6ea49ec56 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
| @@ -9,9 +9,22 @@ enum { | |||
| 9 | }; | 9 | }; |
| 10 | 10 | ||
| 11 | enum { | 11 | enum { |
| 12 | HW_BREAKPOINT_R = 1, | 12 | HW_BREAKPOINT_EMPTY = 0, |
| 13 | HW_BREAKPOINT_W = 2, | 13 | HW_BREAKPOINT_R = 1, |
| 14 | HW_BREAKPOINT_X = 4, | 14 | HW_BREAKPOINT_W = 2, |
| 15 | HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W, | ||
| 16 | HW_BREAKPOINT_X = 4, | ||
| 17 | HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X, | ||
| 18 | }; | ||
| 19 | |||
| 20 | enum bp_type_idx { | ||
| 21 | TYPE_INST = 0, | ||
| 22 | #ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS | ||
| 23 | TYPE_DATA = 0, | ||
| 24 | #else | ||
| 25 | TYPE_DATA = 1, | ||
| 26 | #endif | ||
| 27 | TYPE_MAX | ||
| 15 | }; | 28 | }; |
| 16 | 29 | ||
| 17 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
| @@ -34,6 +47,12 @@ static inline void hw_breakpoint_init(struct perf_event_attr *attr) | |||
| 34 | attr->sample_period = 1; | 47 | attr->sample_period = 1; |
| 35 | } | 48 | } |
| 36 | 49 | ||
| 50 | static inline void ptrace_breakpoint_init(struct perf_event_attr *attr) | ||
| 51 | { | ||
| 52 | hw_breakpoint_init(attr); | ||
| 53 | attr->exclude_kernel = 1; | ||
| 54 | } | ||
| 55 | |||
| 37 | static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) | 56 | static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) |
| 38 | { | 57 | { |
| 39 | return bp->attr.bp_addr; | 58 | return bp->attr.bp_addr; |
| @@ -66,14 +85,14 @@ register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | |||
| 66 | perf_overflow_handler_t triggered, | 85 | perf_overflow_handler_t triggered, |
| 67 | int cpu); | 86 | int cpu); |
| 68 | 87 | ||
| 69 | extern struct perf_event ** | 88 | extern struct perf_event * __percpu * |
| 70 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | 89 | register_wide_hw_breakpoint(struct perf_event_attr *attr, |
| 71 | perf_overflow_handler_t triggered); | 90 | perf_overflow_handler_t triggered); |
| 72 | 91 | ||
| 73 | extern int register_perf_hw_breakpoint(struct perf_event *bp); | 92 | extern int register_perf_hw_breakpoint(struct perf_event *bp); |
| 74 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); | 93 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); |
| 75 | extern void unregister_hw_breakpoint(struct perf_event *bp); | 94 | extern void unregister_hw_breakpoint(struct perf_event *bp); |
| 76 | extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); | 95 | extern void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events); |
| 77 | 96 | ||
| 78 | extern int dbg_reserve_bp_slot(struct perf_event *bp); | 97 | extern int dbg_reserve_bp_slot(struct perf_event *bp); |
| 79 | extern int dbg_release_bp_slot(struct perf_event *bp); | 98 | extern int dbg_release_bp_slot(struct perf_event *bp); |
| @@ -100,7 +119,7 @@ static inline struct perf_event * | |||
| 100 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | 119 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, |
| 101 | perf_overflow_handler_t triggered, | 120 | perf_overflow_handler_t triggered, |
| 102 | int cpu) { return NULL; } | 121 | int cpu) { return NULL; } |
| 103 | static inline struct perf_event ** | 122 | static inline struct perf_event * __percpu * |
| 104 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | 123 | register_wide_hw_breakpoint(struct perf_event_attr *attr, |
| 105 | perf_overflow_handler_t triggered) { return NULL; } | 124 | perf_overflow_handler_t triggered) { return NULL; } |
| 106 | static inline int | 125 | static inline int |
| @@ -109,7 +128,7 @@ static inline int | |||
| 109 | __register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } | 128 | __register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } |
| 110 | static inline void unregister_hw_breakpoint(struct perf_event *bp) { } | 129 | static inline void unregister_hw_breakpoint(struct perf_event *bp) { } |
| 111 | static inline void | 130 | static inline void |
| 112 | unregister_wide_hw_breakpoint(struct perf_event **cpu_events) { } | 131 | unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events) { } |
| 113 | static inline int | 132 | static inline int |
| 114 | reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; } | 133 | reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; } |
| 115 | static inline void release_bp_slot(struct perf_event *bp) { } | 134 | static inline void release_bp_slot(struct perf_event *bp) { } |
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h index 111334f5b922..4f98148c11c3 100644 --- a/include/linux/i2c-algo-bit.h +++ b/include/linux/i2c-algo-bit.h | |||
| @@ -36,6 +36,8 @@ struct i2c_algo_bit_data { | |||
| 36 | void (*setscl) (void *data, int state); | 36 | void (*setscl) (void *data, int state); |
| 37 | int (*getsda) (void *data); | 37 | int (*getsda) (void *data); |
| 38 | int (*getscl) (void *data); | 38 | int (*getscl) (void *data); |
| 39 | int (*pre_xfer) (struct i2c_adapter *); | ||
| 40 | void (*post_xfer) (struct i2c_adapter *); | ||
| 39 | 41 | ||
| 40 | /* local settings */ | 42 | /* local settings */ |
| 41 | int udelay; /* half clock cycle time in us, | 43 | int udelay; /* half clock cycle time in us, |
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h new file mode 100644 index 000000000000..78ebf507ce56 --- /dev/null +++ b/include/linux/i2c-omap.h | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #ifndef __I2C_OMAP_H__ | ||
| 2 | #define __I2C_OMAP_H__ | ||
| 3 | |||
| 4 | struct omap_i2c_bus_platform_data { | ||
| 5 | u32 clkrate; | ||
| 6 | void (*set_mpu_wkup_lat)(struct device *dev, long set); | ||
| 7 | }; | ||
| 8 | |||
| 9 | #endif | ||
diff --git a/include/linux/i2c-xiic.h b/include/linux/i2c-xiic.h new file mode 100644 index 000000000000..4f9f2256a97e --- /dev/null +++ b/include/linux/i2c-xiic.h | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | /* | ||
| 2 | * i2c-xiic.h | ||
| 3 | * Copyright (c) 2009 Intel Corporation | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | /* Supports: | ||
| 20 | * Xilinx IIC | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef _LINUX_I2C_XIIC_H | ||
| 24 | #define _LINUX_I2C_XIIC_H | ||
| 25 | |||
| 26 | /** | ||
| 27 | * struct xiic_i2c_platform_data - Platform data of the Xilinx I2C driver | ||
| 28 | * @num_devices: Number of devices that shall be added when the driver | ||
| 29 | * is probed. | ||
| 30 | * @devices: The actuall devices to add. | ||
| 31 | * | ||
| 32 | * This purpose of this platform data struct is to be able to provide a number | ||
| 33 | * of devices that should be added to the I2C bus. The reason is that sometimes | ||
| 34 | * the I2C board info is not enough, a new PCI board can for instance be | ||
| 35 | * plugged into a standard PC, and the bus number might be unknown at | ||
| 36 | * early init time. | ||
| 37 | */ | ||
| 38 | struct xiic_i2c_platform_data { | ||
| 39 | u8 num_devices; | ||
| 40 | struct i2c_board_info const *devices; | ||
| 41 | }; | ||
| 42 | |||
| 43 | #endif /* _LINUX_I2C_XIIC_H */ | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 0a5da639b327..6ed1d59bfb1e 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -355,6 +355,8 @@ struct i2c_adapter { | |||
| 355 | int nr; | 355 | int nr; |
| 356 | char name[48]; | 356 | char name[48]; |
| 357 | struct completion dev_released; | 357 | struct completion dev_released; |
| 358 | |||
| 359 | struct list_head userspace_clients; | ||
| 358 | }; | 360 | }; |
| 359 | #define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) | 361 | #define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) |
| 360 | 362 | ||
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index fb6784e86d5f..6de90bfc6acd 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
| @@ -496,7 +496,7 @@ struct twl4030_madc_platform_data { | |||
| 496 | int irq_line; | 496 | int irq_line; |
| 497 | }; | 497 | }; |
| 498 | 498 | ||
| 499 | /* Boards have uniqe mappings of {row, col} --> keycode. | 499 | /* Boards have unique mappings of {row, col} --> keycode. |
| 500 | * Column and row are 8 bits each, but range only from 0..7. | 500 | * Column and row are 8 bits each, but range only from 0..7. |
| 501 | * a PERSISTENT_KEY is "always on" and never reported. | 501 | * a PERSISTENT_KEY is "always on" and never reported. |
| 502 | */ | 502 | */ |
| @@ -569,9 +569,9 @@ struct twl4030_codec_data { | |||
| 569 | struct twl4030_codec_audio_data *audio; | 569 | struct twl4030_codec_audio_data *audio; |
| 570 | struct twl4030_codec_vibra_data *vibra; | 570 | struct twl4030_codec_vibra_data *vibra; |
| 571 | 571 | ||
| 572 | /* twl6030 */ | 572 | /* twl6040 */ |
| 573 | int audpwron_gpio; /* audio power-on gpio */ | 573 | int audpwron_gpio; /* audio power-on gpio */ |
| 574 | int naudint_irq; /* audio interrupt */ | 574 | int naudint_irq; /* audio interrupt */ |
| 575 | }; | 575 | }; |
| 576 | 576 | ||
| 577 | struct twl4030_platform_data { | 577 | struct twl4030_platform_data { |
| @@ -664,15 +664,15 @@ static inline int twl4030charger_usb_en(int enable) { return 0; } | |||
| 664 | #define TWL4030_REG_VUSB3V1 19 | 664 | #define TWL4030_REG_VUSB3V1 19 |
| 665 | 665 | ||
| 666 | /* TWL6030 SMPS/LDO's */ | 666 | /* TWL6030 SMPS/LDO's */ |
| 667 | /* EXTERNAL dc-to-dc buck convertor contollable via SR */ | 667 | /* EXTERNAL dc-to-dc buck convertor controllable via SR */ |
| 668 | #define TWL6030_REG_VDD1 30 | 668 | #define TWL6030_REG_VDD1 30 |
| 669 | #define TWL6030_REG_VDD2 31 | 669 | #define TWL6030_REG_VDD2 31 |
| 670 | #define TWL6030_REG_VDD3 32 | 670 | #define TWL6030_REG_VDD3 32 |
| 671 | 671 | ||
| 672 | /* Non SR compliant dc-to-dc buck convertors */ | 672 | /* Non SR compliant dc-to-dc buck convertors */ |
| 673 | #define TWL6030_REG_VMEM 33 | 673 | #define TWL6030_REG_VMEM 33 |
| 674 | #define TWL6030_REG_V2V1 34 | 674 | #define TWL6030_REG_V2V1 34 |
| 675 | #define TWL6030_REG_V1V29 35 | 675 | #define TWL6030_REG_V1V29 35 |
| 676 | #define TWL6030_REG_V1V8 36 | 676 | #define TWL6030_REG_V1V8 36 |
| 677 | 677 | ||
| 678 | /* EXTERNAL LDOs */ | 678 | /* EXTERNAL LDOs */ |
diff --git a/include/linux/i2o.h b/include/linux/i2o.h index 87018dc5527d..9e7a12d6385d 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h | |||
| @@ -782,7 +782,6 @@ extern int i2o_exec_lct_get(struct i2o_controller *); | |||
| 782 | #define to_i2o_driver(drv) container_of(drv,struct i2o_driver, driver) | 782 | #define to_i2o_driver(drv) container_of(drv,struct i2o_driver, driver) |
| 783 | #define to_i2o_device(dev) container_of(dev, struct i2o_device, device) | 783 | #define to_i2o_device(dev) container_of(dev, struct i2o_device, device) |
| 784 | #define to_i2o_controller(dev) container_of(dev, struct i2o_controller, device) | 784 | #define to_i2o_controller(dev) container_of(dev, struct i2o_controller, device) |
| 785 | #define kobj_to_i2o_device(kobj) to_i2o_device(container_of(kobj, struct device, kobj)) | ||
| 786 | 785 | ||
| 787 | /** | 786 | /** |
| 788 | * i2o_out_to_virt - Turn an I2O message to a virtual address | 787 | * i2o_out_to_virt - Turn an I2O message to a virtual address |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 97e6ab435184..3239d1c10acb 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
| @@ -1169,6 +1169,7 @@ extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout); | |||
| 1169 | extern void ide_timer_expiry(unsigned long); | 1169 | extern void ide_timer_expiry(unsigned long); |
| 1170 | extern irqreturn_t ide_intr(int irq, void *dev_id); | 1170 | extern irqreturn_t ide_intr(int irq, void *dev_id); |
| 1171 | extern void do_ide_request(struct request_queue *); | 1171 | extern void do_ide_request(struct request_queue *); |
| 1172 | extern void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq); | ||
| 1172 | 1173 | ||
| 1173 | void ide_init_disk(struct gendisk *, ide_drive_t *); | 1174 | void ide_init_disk(struct gendisk *, ide_drive_t *); |
| 1174 | 1175 | ||
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 19984958ab7b..97b2eae6a22c 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
| @@ -876,6 +876,7 @@ struct ieee80211_ht_cap { | |||
| 876 | #define IEEE80211_HT_CAP_SGI_40 0x0040 | 876 | #define IEEE80211_HT_CAP_SGI_40 0x0040 |
| 877 | #define IEEE80211_HT_CAP_TX_STBC 0x0080 | 877 | #define IEEE80211_HT_CAP_TX_STBC 0x0080 |
| 878 | #define IEEE80211_HT_CAP_RX_STBC 0x0300 | 878 | #define IEEE80211_HT_CAP_RX_STBC 0x0300 |
| 879 | #define IEEE80211_HT_CAP_RX_STBC_SHIFT 8 | ||
| 879 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 | 880 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 |
| 880 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 | 881 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 |
| 881 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 | 882 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 |
| @@ -1211,6 +1212,8 @@ enum ieee80211_category { | |||
| 1211 | WLAN_CATEGORY_SA_QUERY = 8, | 1212 | WLAN_CATEGORY_SA_QUERY = 8, |
| 1212 | WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9, | 1213 | WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9, |
| 1213 | WLAN_CATEGORY_WMM = 17, | 1214 | WLAN_CATEGORY_WMM = 17, |
| 1215 | WLAN_CATEGORY_MESH_PLINK = 30, /* Pending ANA approval */ | ||
| 1216 | WLAN_CATEGORY_MESH_PATH_SEL = 32, /* Pending ANA approval */ | ||
| 1214 | WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, | 1217 | WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, |
| 1215 | WLAN_CATEGORY_VENDOR_SPECIFIC = 127, | 1218 | WLAN_CATEGORY_VENDOR_SPECIFIC = 127, |
| 1216 | }; | 1219 | }; |
| @@ -1324,7 +1327,6 @@ enum ieee80211_back_actioncode { | |||
| 1324 | enum ieee80211_back_parties { | 1327 | enum ieee80211_back_parties { |
| 1325 | WLAN_BACK_RECIPIENT = 0, | 1328 | WLAN_BACK_RECIPIENT = 0, |
| 1326 | WLAN_BACK_INITIATOR = 1, | 1329 | WLAN_BACK_INITIATOR = 1, |
| 1327 | WLAN_BACK_TIMER = 2, | ||
| 1328 | }; | 1330 | }; |
| 1329 | 1331 | ||
| 1330 | /* SA Query action */ | 1332 | /* SA Query action */ |
diff --git a/include/linux/if.h b/include/linux/if.h index 3a9f410a296b..be350e62a905 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
| @@ -71,6 +71,8 @@ | |||
| 71 | * release skb->dst | 71 | * release skb->dst |
| 72 | */ | 72 | */ |
| 73 | #define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */ | 73 | #define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */ |
| 74 | #define IFF_IN_NETPOLL 0x1000 /* whether we are processing netpoll */ | ||
| 75 | #define IFF_DISABLE_NETPOLL 0x2000 /* disable netpoll at run-time */ | ||
| 74 | 76 | ||
| 75 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 77 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
| 76 | #define IF_GET_PROTO 0x0002 | 78 | #define IF_GET_PROTO 0x0002 |
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index e80b7f88f7c6..6d722f41ee7c 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
| @@ -90,6 +90,7 @@ | |||
| 90 | 90 | ||
| 91 | #define ARPHRD_PHONET 820 /* PhoNet media type */ | 91 | #define ARPHRD_PHONET 820 /* PhoNet media type */ |
| 92 | #define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ | 92 | #define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ |
| 93 | #define ARPHRD_CAIF 822 /* CAIF media type */ | ||
| 93 | 94 | ||
| 94 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ | 95 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ |
| 95 | #define ARPHRD_NONE 0xFFFE /* zero header length */ | 96 | #define ARPHRD_NONE 0xFFFE /* zero header length */ |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 299b4121f914..bed7a4682b90 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
| @@ -109,6 +109,7 @@ | |||
| 109 | #define ETH_P_TRAILER 0x001C /* Trailer switch tagging */ | 109 | #define ETH_P_TRAILER 0x001C /* Trailer switch tagging */ |
| 110 | #define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */ | 110 | #define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */ |
| 111 | #define ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */ | 111 | #define ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */ |
| 112 | #define ETH_P_CAIF 0x00F7 /* ST-Ericsson CAIF protocol */ | ||
| 112 | 113 | ||
| 113 | /* | 114 | /* |
| 114 | * This is an Ethernet frame header. | 115 | * This is an Ethernet frame header. |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index c9bf92cd7653..85c812db5a3f 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
| @@ -37,6 +37,38 @@ struct rtnl_link_stats { | |||
| 37 | __u32 tx_compressed; | 37 | __u32 tx_compressed; |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | struct rtnl_link_stats64 { | ||
| 41 | __u64 rx_packets; /* total packets received */ | ||
| 42 | __u64 tx_packets; /* total packets transmitted */ | ||
| 43 | __u64 rx_bytes; /* total bytes received */ | ||
| 44 | __u64 tx_bytes; /* total bytes transmitted */ | ||
| 45 | __u64 rx_errors; /* bad packets received */ | ||
| 46 | __u64 tx_errors; /* packet transmit problems */ | ||
| 47 | __u64 rx_dropped; /* no space in linux buffers */ | ||
| 48 | __u64 tx_dropped; /* no space available in linux */ | ||
| 49 | __u64 multicast; /* multicast packets received */ | ||
| 50 | __u64 collisions; | ||
| 51 | |||
| 52 | /* detailed rx_errors: */ | ||
| 53 | __u64 rx_length_errors; | ||
| 54 | __u64 rx_over_errors; /* receiver ring buff overflow */ | ||
| 55 | __u64 rx_crc_errors; /* recved pkt with crc error */ | ||
| 56 | __u64 rx_frame_errors; /* recv'd frame alignment error */ | ||
| 57 | __u64 rx_fifo_errors; /* recv'r fifo overrun */ | ||
| 58 | __u64 rx_missed_errors; /* receiver missed packet */ | ||
| 59 | |||
| 60 | /* detailed tx_errors */ | ||
| 61 | __u64 tx_aborted_errors; | ||
| 62 | __u64 tx_carrier_errors; | ||
| 63 | __u64 tx_fifo_errors; | ||
| 64 | __u64 tx_heartbeat_errors; | ||
| 65 | __u64 tx_window_errors; | ||
| 66 | |||
| 67 | /* for cslip etc */ | ||
| 68 | __u64 rx_compressed; | ||
| 69 | __u64 tx_compressed; | ||
| 70 | }; | ||
| 71 | |||
| 40 | /* The struct should be in sync with struct ifmap */ | 72 | /* The struct should be in sync with struct ifmap */ |
| 41 | struct rtnl_link_ifmap { | 73 | struct rtnl_link_ifmap { |
| 42 | __u64 mem_start; | 74 | __u64 mem_start; |
| @@ -79,10 +111,10 @@ enum { | |||
| 79 | IFLA_NET_NS_PID, | 111 | IFLA_NET_NS_PID, |
| 80 | IFLA_IFALIAS, | 112 | IFLA_IFALIAS, |
| 81 | IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */ | 113 | IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */ |
| 82 | IFLA_VF_MAC, /* Hardware queue specific attributes */ | 114 | IFLA_VFINFO_LIST, |
| 83 | IFLA_VF_VLAN, | 115 | IFLA_STATS64, |
| 84 | IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */ | 116 | IFLA_VF_PORTS, |
| 85 | IFLA_VFINFO, | 117 | IFLA_PORT_SELF, |
| 86 | __IFLA_MAX | 118 | __IFLA_MAX |
| 87 | }; | 119 | }; |
| 88 | 120 | ||
| @@ -203,6 +235,24 @@ enum macvlan_mode { | |||
| 203 | 235 | ||
| 204 | /* SR-IOV virtual function managment section */ | 236 | /* SR-IOV virtual function managment section */ |
| 205 | 237 | ||
| 238 | enum { | ||
| 239 | IFLA_VF_INFO_UNSPEC, | ||
| 240 | IFLA_VF_INFO, | ||
| 241 | __IFLA_VF_INFO_MAX, | ||
| 242 | }; | ||
| 243 | |||
| 244 | #define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1) | ||
| 245 | |||
| 246 | enum { | ||
| 247 | IFLA_VF_UNSPEC, | ||
| 248 | IFLA_VF_MAC, /* Hardware queue specific attributes */ | ||
| 249 | IFLA_VF_VLAN, | ||
| 250 | IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */ | ||
| 251 | __IFLA_VF_MAX, | ||
| 252 | }; | ||
| 253 | |||
| 254 | #define IFLA_VF_MAX (__IFLA_VF_MAX - 1) | ||
| 255 | |||
| 206 | struct ifla_vf_mac { | 256 | struct ifla_vf_mac { |
| 207 | __u32 vf; | 257 | __u32 vf; |
| 208 | __u8 mac[32]; /* MAX_ADDR_LEN */ | 258 | __u8 mac[32]; /* MAX_ADDR_LEN */ |
| @@ -226,4 +276,77 @@ struct ifla_vf_info { | |||
| 226 | __u32 qos; | 276 | __u32 qos; |
| 227 | __u32 tx_rate; | 277 | __u32 tx_rate; |
| 228 | }; | 278 | }; |
| 279 | |||
| 280 | /* VF ports management section | ||
| 281 | * | ||
| 282 | * Nested layout of set/get msg is: | ||
| 283 | * | ||
| 284 | * [IFLA_NUM_VF] | ||
| 285 | * [IFLA_VF_PORTS] | ||
| 286 | * [IFLA_VF_PORT] | ||
| 287 | * [IFLA_PORT_*], ... | ||
| 288 | * [IFLA_VF_PORT] | ||
| 289 | * [IFLA_PORT_*], ... | ||
| 290 | * ... | ||
| 291 | * [IFLA_PORT_SELF] | ||
| 292 | * [IFLA_PORT_*], ... | ||
| 293 | */ | ||
| 294 | |||
| 295 | enum { | ||
| 296 | IFLA_VF_PORT_UNSPEC, | ||
| 297 | IFLA_VF_PORT, /* nest */ | ||
| 298 | __IFLA_VF_PORT_MAX, | ||
| 299 | }; | ||
| 300 | |||
| 301 | #define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1) | ||
| 302 | |||
| 303 | enum { | ||
| 304 | IFLA_PORT_UNSPEC, | ||
| 305 | IFLA_PORT_VF, /* __u32 */ | ||
| 306 | IFLA_PORT_PROFILE, /* string */ | ||
| 307 | IFLA_PORT_VSI_TYPE, /* 802.1Qbg (pre-)standard VDP */ | ||
| 308 | IFLA_PORT_INSTANCE_UUID, /* binary UUID */ | ||
| 309 | IFLA_PORT_HOST_UUID, /* binary UUID */ | ||
| 310 | IFLA_PORT_REQUEST, /* __u8 */ | ||
| 311 | IFLA_PORT_RESPONSE, /* __u16, output only */ | ||
| 312 | __IFLA_PORT_MAX, | ||
| 313 | }; | ||
| 314 | |||
| 315 | #define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1) | ||
| 316 | |||
| 317 | #define PORT_PROFILE_MAX 40 | ||
| 318 | #define PORT_UUID_MAX 16 | ||
| 319 | #define PORT_SELF_VF -1 | ||
| 320 | |||
| 321 | enum { | ||
| 322 | PORT_REQUEST_PREASSOCIATE = 0, | ||
| 323 | PORT_REQUEST_PREASSOCIATE_RR, | ||
| 324 | PORT_REQUEST_ASSOCIATE, | ||
| 325 | PORT_REQUEST_DISASSOCIATE, | ||
| 326 | }; | ||
| 327 | |||
| 328 | enum { | ||
| 329 | PORT_VDP_RESPONSE_SUCCESS = 0, | ||
| 330 | PORT_VDP_RESPONSE_INVALID_FORMAT, | ||
| 331 | PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES, | ||
| 332 | PORT_VDP_RESPONSE_UNUSED_VTID, | ||
| 333 | PORT_VDP_RESPONSE_VTID_VIOLATION, | ||
| 334 | PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION, | ||
| 335 | PORT_VDP_RESPONSE_OUT_OF_SYNC, | ||
| 336 | /* 0x08-0xFF reserved for future VDP use */ | ||
| 337 | PORT_PROFILE_RESPONSE_SUCCESS = 0x100, | ||
| 338 | PORT_PROFILE_RESPONSE_INPROGRESS, | ||
| 339 | PORT_PROFILE_RESPONSE_INVALID, | ||
| 340 | PORT_PROFILE_RESPONSE_BADSTATE, | ||
| 341 | PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES, | ||
| 342 | PORT_PROFILE_RESPONSE_ERROR, | ||
| 343 | }; | ||
| 344 | |||
| 345 | struct ifla_port_vsi { | ||
| 346 | __u8 vsi_mgr_id; | ||
| 347 | __u8 vsi_type_id[3]; | ||
| 348 | __u8 vsi_type_version; | ||
| 349 | __u8 pad[3]; | ||
| 350 | }; | ||
| 351 | |||
| 229 | #endif /* _LINUX_IF_LINK_H */ | 352 | #endif /* _LINUX_IF_LINK_H */ |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index b78a712247da..9ea047aca795 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
| @@ -85,6 +85,7 @@ extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, | |||
| 85 | struct net_device *dev); | 85 | struct net_device *dev); |
| 86 | 86 | ||
| 87 | 87 | ||
| 88 | extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *); | 88 | extern struct sk_buff *(*macvlan_handle_frame_hook)(struct macvlan_port *, |
| 89 | struct sk_buff *); | ||
| 89 | 90 | ||
| 90 | #endif /* _LINUX_IF_MACVLAN_H */ | 91 | #endif /* _LINUX_IF_MACVLAN_H */ |
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index aa57a5f993fc..6ac23ef1801a 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h | |||
| @@ -47,6 +47,7 @@ struct sockaddr_ll { | |||
| 47 | #define PACKET_TX_RING 13 | 47 | #define PACKET_TX_RING 13 |
| 48 | #define PACKET_LOSS 14 | 48 | #define PACKET_LOSS 14 |
| 49 | #define PACKET_VNET_HDR 15 | 49 | #define PACKET_VNET_HDR 15 |
| 50 | #define PACKET_TX_TIMESTAMP 16 | ||
| 50 | 51 | ||
| 51 | struct tpacket_stats { | 52 | struct tpacket_stats { |
| 52 | unsigned int tp_packets; | 53 | unsigned int tp_packets; |
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h index c58baea4a25b..184bc5566207 100644 --- a/include/linux/if_pppol2tp.h +++ b/include/linux/if_pppol2tp.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * Linux PPP over L2TP (PPPoL2TP) Socket Implementation (RFC 2661) | 2 | * Linux PPP over L2TP (PPPoL2TP) Socket Implementation (RFC 2661) |
| 3 | * | 3 | * |
| 4 | * This file supplies definitions required by the PPP over L2TP driver | 4 | * This file supplies definitions required by the PPP over L2TP driver |
| 5 | * (pppol2tp.c). All version information wrt this file is located in pppol2tp.c | 5 | * (l2tp_ppp.c). All version information wrt this file is located in l2tp_ppp.c |
| 6 | * | 6 | * |
| 7 | * License: | 7 | * License: |
| 8 | * This program is free software; you can redistribute it and/or | 8 | * This program is free software; you can redistribute it and/or |
| @@ -35,6 +35,20 @@ struct pppol2tp_addr { | |||
| 35 | __u16 d_tunnel, d_session; /* For sending outgoing packets */ | 35 | __u16 d_tunnel, d_session; /* For sending outgoing packets */ |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 | ||
| 39 | * bits. So we need a different sockaddr structure. | ||
| 40 | */ | ||
| 41 | struct pppol2tpv3_addr { | ||
| 42 | pid_t pid; /* pid that owns the fd. | ||
| 43 | * 0 => current */ | ||
| 44 | int fd; /* FD of UDP or IP socket to use */ | ||
| 45 | |||
| 46 | struct sockaddr_in addr; /* IP address and port to send to */ | ||
| 47 | |||
| 48 | __u32 s_tunnel, s_session; /* For matching incoming packets */ | ||
| 49 | __u32 d_tunnel, d_session; /* For sending outgoing packets */ | ||
| 50 | }; | ||
| 51 | |||
| 38 | /* Socket options: | 52 | /* Socket options: |
| 39 | * DEBUG - bitmask of debug message categories | 53 | * DEBUG - bitmask of debug message categories |
| 40 | * SENDSEQ - 0 => don't send packets with sequence numbers | 54 | * SENDSEQ - 0 => don't send packets with sequence numbers |
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h index 90b5fae5d714..a6577af0c4e6 100644 --- a/include/linux/if_pppox.h +++ b/include/linux/if_pppox.h | |||
| @@ -72,6 +72,15 @@ struct sockaddr_pppol2tp { | |||
| 72 | struct pppol2tp_addr pppol2tp; | 72 | struct pppol2tp_addr pppol2tp; |
| 73 | }__attribute__ ((packed)); | 73 | }__attribute__ ((packed)); |
| 74 | 74 | ||
| 75 | /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 | ||
| 76 | * bits. So we need a different sockaddr structure. | ||
| 77 | */ | ||
| 78 | struct sockaddr_pppol2tpv3 { | ||
| 79 | sa_family_t sa_family; /* address family, AF_PPPOX */ | ||
| 80 | unsigned int sa_protocol; /* protocol identifier */ | ||
| 81 | struct pppol2tpv3_addr pppol2tp; | ||
| 82 | } __attribute__ ((packed)); | ||
| 83 | |||
| 75 | /********************************************************************* | 84 | /********************************************************************* |
| 76 | * | 85 | * |
| 77 | * ioctl interface for defining forwarding of connections | 86 | * ioctl interface for defining forwarding of connections |
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 1350a246893a..06b1829731fd 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
| @@ -51,6 +51,8 @@ | |||
| 51 | #define TUNSETSNDBUF _IOW('T', 212, int) | 51 | #define TUNSETSNDBUF _IOW('T', 212, int) |
| 52 | #define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog) | 52 | #define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog) |
| 53 | #define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog) | 53 | #define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog) |
| 54 | #define TUNGETVNETHDRSZ _IOR('T', 215, int) | ||
| 55 | #define TUNSETVNETHDRSZ _IOW('T', 216, int) | ||
| 54 | 56 | ||
| 55 | /* TUNSETIFF ifr flags */ | 57 | /* TUNSETIFF ifr flags */ |
| 56 | #define IFF_TUN 0x0001 | 58 | #define IFF_TUN 0x0001 |
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index 1822d635be6b..16b92d008bed 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _IF_TUNNEL_H_ | 2 | #define _IF_TUNNEL_H_ |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <asm/byteorder.h> | ||
| 5 | 6 | ||
| 6 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
| 7 | #include <linux/ip.h> | 8 | #include <linux/ip.h> |
diff --git a/include/linux/if_x25.h b/include/linux/if_x25.h new file mode 100644 index 000000000000..897765f5feb8 --- /dev/null +++ b/include/linux/if_x25.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* | ||
| 2 | * Linux X.25 packet to device interface | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _IF_X25_H | ||
| 16 | #define _IF_X25_H | ||
| 17 | |||
| 18 | #include <linux/types.h> | ||
| 19 | |||
| 20 | /* Documentation/networking/x25-iface.txt */ | ||
| 21 | #define X25_IFACE_DATA 0x00 | ||
| 22 | #define X25_IFACE_CONNECT 0x01 | ||
| 23 | #define X25_IFACE_DISCONNECT 0x02 | ||
| 24 | #define X25_IFACE_PARAMS 0x03 | ||
| 25 | |||
| 26 | #endif /* _IF_X25_H */ | ||
diff --git a/include/linux/in6.h b/include/linux/in6.h index bd55c6e46b2e..c4bf46f764bf 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h | |||
| @@ -221,10 +221,10 @@ struct in6_flowlabel_req { | |||
| 221 | #define IPV6_RTHDR 57 | 221 | #define IPV6_RTHDR 57 |
| 222 | #define IPV6_RECVDSTOPTS 58 | 222 | #define IPV6_RECVDSTOPTS 58 |
| 223 | #define IPV6_DSTOPTS 59 | 223 | #define IPV6_DSTOPTS 59 |
| 224 | #if 0 /* not yet */ | ||
| 225 | #define IPV6_RECVPATHMTU 60 | 224 | #define IPV6_RECVPATHMTU 60 |
| 226 | #define IPV6_PATHMTU 61 | 225 | #define IPV6_PATHMTU 61 |
| 227 | #define IPV6_DONTFRAG 62 | 226 | #define IPV6_DONTFRAG 62 |
| 227 | #if 0 /* not yet */ | ||
| 228 | #define IPV6_USE_MIN_MTU 63 | 228 | #define IPV6_USE_MIN_MTU 63 |
| 229 | #endif | 229 | #endif |
| 230 | 230 | ||
| @@ -265,6 +265,9 @@ struct in6_flowlabel_req { | |||
| 265 | #define IPV6_PREFER_SRC_CGA 0x0008 | 265 | #define IPV6_PREFER_SRC_CGA 0x0008 |
| 266 | #define IPV6_PREFER_SRC_NONCGA 0x0800 | 266 | #define IPV6_PREFER_SRC_NONCGA 0x0800 |
| 267 | 267 | ||
| 268 | /* RFC5082: Generalized Ttl Security Mechanism */ | ||
| 269 | #define IPV6_MINHOPCOUNT 73 | ||
| 270 | |||
| 268 | /* | 271 | /* |
| 269 | * Multicast Routing: | 272 | * Multicast Routing: |
| 270 | * see include/linux/mroute6.h. | 273 | * see include/linux/mroute6.h. |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index abec69b63d7e..7996fc2c9ba9 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -32,14 +32,6 @@ extern struct fs_struct init_fs; | |||
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | extern struct nsproxy init_nsproxy; | 34 | extern struct nsproxy init_nsproxy; |
| 35 | #define INIT_NSPROXY(nsproxy) { \ | ||
| 36 | .pid_ns = &init_pid_ns, \ | ||
| 37 | .count = ATOMIC_INIT(1), \ | ||
| 38 | .uts_ns = &init_uts_ns, \ | ||
| 39 | .mnt_ns = NULL, \ | ||
| 40 | INIT_NET_NS(net_ns) \ | ||
| 41 | INIT_IPC_NS(ipc_ns) \ | ||
| 42 | } | ||
| 43 | 35 | ||
| 44 | #define INIT_SIGHAND(sighand) { \ | 36 | #define INIT_SIGHAND(sighand) { \ |
| 45 | .count = ATOMIC_INIT(1), \ | 37 | .count = ATOMIC_INIT(1), \ |
| @@ -57,7 +49,6 @@ extern struct group_info init_groups; | |||
| 57 | { .first = &init_task.pids[PIDTYPE_PGID].node }, \ | 49 | { .first = &init_task.pids[PIDTYPE_PGID].node }, \ |
| 58 | { .first = &init_task.pids[PIDTYPE_SID].node }, \ | 50 | { .first = &init_task.pids[PIDTYPE_SID].node }, \ |
| 59 | }, \ | 51 | }, \ |
| 60 | .rcu = RCU_HEAD_INIT, \ | ||
| 61 | .level = 0, \ | 52 | .level = 0, \ |
| 62 | .numbers = { { \ | 53 | .numbers = { { \ |
| 63 | .nr = 0, \ | 54 | .nr = 0, \ |
diff --git a/include/linux/input.h b/include/linux/input.h index dc24effb6d0e..83524e4f3290 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
| @@ -58,10 +58,10 @@ struct input_absinfo { | |||
| 58 | 58 | ||
| 59 | #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ | 59 | #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ |
| 60 | #define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ | 60 | #define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ |
| 61 | #define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */ | 61 | #define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */ |
| 62 | #define EVIOCSREP _IOW('E', 0x03, int[2]) /* set repeat settings */ | 62 | #define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */ |
| 63 | #define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ | 63 | #define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */ |
| 64 | #define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */ | 64 | #define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */ |
| 65 | 65 | ||
| 66 | #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ | 66 | #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ |
| 67 | #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ | 67 | #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ |
| @@ -806,6 +806,7 @@ struct input_absinfo { | |||
| 806 | #define BUS_HOST 0x19 | 806 | #define BUS_HOST 0x19 |
| 807 | #define BUS_GSC 0x1A | 807 | #define BUS_GSC 0x1A |
| 808 | #define BUS_ATARI 0x1B | 808 | #define BUS_ATARI 0x1B |
| 809 | #define BUS_SPI 0x1C | ||
| 809 | 810 | ||
| 810 | /* | 811 | /* |
| 811 | * MT_TOOL types | 812 | * MT_TOOL types |
| @@ -1142,8 +1143,10 @@ struct input_dev { | |||
| 1142 | unsigned int keycodemax; | 1143 | unsigned int keycodemax; |
| 1143 | unsigned int keycodesize; | 1144 | unsigned int keycodesize; |
| 1144 | void *keycode; | 1145 | void *keycode; |
| 1145 | int (*setkeycode)(struct input_dev *dev, int scancode, int keycode); | 1146 | int (*setkeycode)(struct input_dev *dev, |
| 1146 | int (*getkeycode)(struct input_dev *dev, int scancode, int *keycode); | 1147 | unsigned int scancode, unsigned int keycode); |
| 1148 | int (*getkeycode)(struct input_dev *dev, | ||
| 1149 | unsigned int scancode, unsigned int *keycode); | ||
| 1147 | 1150 | ||
| 1148 | struct ff_device *ff; | 1151 | struct ff_device *ff; |
| 1149 | 1152 | ||
| @@ -1415,8 +1418,10 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min | |||
| 1415 | dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); | 1418 | dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); |
| 1416 | } | 1419 | } |
| 1417 | 1420 | ||
| 1418 | int input_get_keycode(struct input_dev *dev, int scancode, int *keycode); | 1421 | int input_get_keycode(struct input_dev *dev, |
| 1419 | int input_set_keycode(struct input_dev *dev, int scancode, int keycode); | 1422 | unsigned int scancode, unsigned int *keycode); |
| 1423 | int input_set_keycode(struct input_dev *dev, | ||
| 1424 | unsigned int scancode, unsigned int keycode); | ||
| 1420 | 1425 | ||
| 1421 | extern struct class input_class; | 1426 | extern struct class input_class; |
| 1422 | 1427 | ||
diff --git a/include/linux/input/ad714x.h b/include/linux/input/ad714x.h new file mode 100644 index 000000000000..0cbe5e81482e --- /dev/null +++ b/include/linux/input/ad714x.h | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | /* | ||
| 2 | * include/linux/input/ad714x.h | ||
| 3 | * | ||
| 4 | * AD714x is very flexible, it can be used as buttons, scrollwheel, | ||
| 5 | * slider, touchpad at the same time. That depends on the boards. | ||
| 6 | * The platform_data for the device's "struct device" holds this | ||
| 7 | * information. | ||
| 8 | * | ||
| 9 | * Copyright 2009 Analog Devices Inc. | ||
| 10 | * | ||
| 11 | * Licensed under the GPL-2 or later. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __LINUX_INPUT_AD714X_H__ | ||
| 15 | #define __LINUX_INPUT_AD714X_H__ | ||
| 16 | |||
| 17 | #define STAGE_NUM 12 | ||
| 18 | #define STAGE_CFGREG_NUM 8 | ||
| 19 | #define SYS_CFGREG_NUM 8 | ||
| 20 | |||
| 21 | /* board information which need be initialized in arch/mach... */ | ||
| 22 | struct ad714x_slider_plat { | ||
| 23 | int start_stage; | ||
| 24 | int end_stage; | ||
| 25 | int max_coord; | ||
| 26 | }; | ||
| 27 | |||
| 28 | struct ad714x_wheel_plat { | ||
| 29 | int start_stage; | ||
| 30 | int end_stage; | ||
| 31 | int max_coord; | ||
| 32 | }; | ||
| 33 | |||
| 34 | struct ad714x_touchpad_plat { | ||
| 35 | int x_start_stage; | ||
| 36 | int x_end_stage; | ||
| 37 | int x_max_coord; | ||
| 38 | |||
| 39 | int y_start_stage; | ||
| 40 | int y_end_stage; | ||
| 41 | int y_max_coord; | ||
| 42 | }; | ||
| 43 | |||
| 44 | struct ad714x_button_plat { | ||
| 45 | int keycode; | ||
| 46 | unsigned short l_mask; | ||
| 47 | unsigned short h_mask; | ||
| 48 | }; | ||
| 49 | |||
| 50 | struct ad714x_platform_data { | ||
| 51 | int slider_num; | ||
| 52 | int wheel_num; | ||
| 53 | int touchpad_num; | ||
| 54 | int button_num; | ||
| 55 | struct ad714x_slider_plat *slider; | ||
| 56 | struct ad714x_wheel_plat *wheel; | ||
| 57 | struct ad714x_touchpad_plat *touchpad; | ||
| 58 | struct ad714x_button_plat *button; | ||
| 59 | unsigned short stage_cfg_reg[STAGE_NUM][STAGE_CFGREG_NUM]; | ||
| 60 | unsigned short sys_cfg_reg[SYS_CFGREG_NUM]; | ||
| 61 | }; | ||
| 62 | |||
| 63 | #endif | ||
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h index 3bd018baae20..c964cd7f436a 100644 --- a/include/linux/input/matrix_keypad.h +++ b/include/linux/input/matrix_keypad.h | |||
| @@ -44,6 +44,7 @@ struct matrix_keymap_data { | |||
| 44 | * @active_low: gpio polarity | 44 | * @active_low: gpio polarity |
| 45 | * @wakeup: controls whether the device should be set up as wakeup | 45 | * @wakeup: controls whether the device should be set up as wakeup |
| 46 | * source | 46 | * source |
| 47 | * @no_autorepeat: disable key autorepeat | ||
| 47 | * | 48 | * |
| 48 | * This structure represents platform-specific data that use used by | 49 | * This structure represents platform-specific data that use used by |
| 49 | * matrix_keypad driver to perform proper initialization. | 50 | * matrix_keypad driver to perform proper initialization. |
| @@ -64,6 +65,7 @@ struct matrix_keypad_platform_data { | |||
| 64 | 65 | ||
| 65 | bool active_low; | 66 | bool active_low; |
| 66 | bool wakeup; | 67 | bool wakeup; |
| 68 | bool no_autorepeat; | ||
| 67 | }; | 69 | }; |
| 68 | 70 | ||
| 69 | /** | 71 | /** |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 75f3f00ac1e5..5137db3317f9 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
| @@ -39,7 +39,8 @@ | |||
| 39 | * These flags used only by the kernel as part of the | 39 | * These flags used only by the kernel as part of the |
| 40 | * irq handling routines. | 40 | * irq handling routines. |
| 41 | * | 41 | * |
| 42 | * IRQF_DISABLED - keep irqs disabled when calling the action handler | 42 | * IRQF_DISABLED - keep irqs disabled when calling the action handler. |
| 43 | * DEPRECATED. This flag is a NOOP and scheduled to be removed | ||
| 43 | * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator | 44 | * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator |
| 44 | * IRQF_SHARED - allow sharing the irq among several devices | 45 | * IRQF_SHARED - allow sharing the irq among several devices |
| 45 | * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur | 46 | * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur |
| @@ -77,6 +78,18 @@ enum { | |||
| 77 | IRQTF_AFFINITY, | 78 | IRQTF_AFFINITY, |
| 78 | }; | 79 | }; |
| 79 | 80 | ||
| 81 | /** | ||
| 82 | * These values can be returned by request_any_context_irq() and | ||
| 83 | * describe the context the interrupt will be run in. | ||
| 84 | * | ||
| 85 | * IRQC_IS_HARDIRQ - interrupt runs in hardirq context | ||
| 86 | * IRQC_IS_NESTED - interrupt runs in a nested threaded context | ||
| 87 | */ | ||
| 88 | enum { | ||
| 89 | IRQC_IS_HARDIRQ = 0, | ||
| 90 | IRQC_IS_NESTED, | ||
| 91 | }; | ||
| 92 | |||
| 80 | typedef irqreturn_t (*irq_handler_t)(int, void *); | 93 | typedef irqreturn_t (*irq_handler_t)(int, void *); |
| 81 | 94 | ||
| 82 | /** | 95 | /** |
| @@ -120,6 +133,10 @@ request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, | |||
| 120 | return request_threaded_irq(irq, handler, NULL, flags, name, dev); | 133 | return request_threaded_irq(irq, handler, NULL, flags, name, dev); |
| 121 | } | 134 | } |
| 122 | 135 | ||
| 136 | extern int __must_check | ||
| 137 | request_any_context_irq(unsigned int irq, irq_handler_t handler, | ||
| 138 | unsigned long flags, const char *name, void *dev_id); | ||
| 139 | |||
| 123 | extern void exit_irq_thread(void); | 140 | extern void exit_irq_thread(void); |
| 124 | #else | 141 | #else |
| 125 | 142 | ||
| @@ -141,6 +158,13 @@ request_threaded_irq(unsigned int irq, irq_handler_t handler, | |||
| 141 | return request_irq(irq, handler, flags, name, dev); | 158 | return request_irq(irq, handler, flags, name, dev); |
| 142 | } | 159 | } |
| 143 | 160 | ||
| 161 | static inline int __must_check | ||
| 162 | request_any_context_irq(unsigned int irq, irq_handler_t handler, | ||
| 163 | unsigned long flags, const char *name, void *dev_id) | ||
| 164 | { | ||
| 165 | return request_irq(irq, handler, flags, name, dev_id); | ||
| 166 | } | ||
| 167 | |||
| 144 | static inline void exit_irq_thread(void) { } | 168 | static inline void exit_irq_thread(void) { } |
| 145 | #endif | 169 | #endif |
| 146 | 170 | ||
| @@ -209,6 +233,7 @@ extern int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask); | |||
| 209 | extern int irq_can_set_affinity(unsigned int irq); | 233 | extern int irq_can_set_affinity(unsigned int irq); |
| 210 | extern int irq_select_affinity(unsigned int irq); | 234 | extern int irq_select_affinity(unsigned int irq); |
| 211 | 235 | ||
| 236 | extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m); | ||
| 212 | #else /* CONFIG_SMP */ | 237 | #else /* CONFIG_SMP */ |
| 213 | 238 | ||
| 214 | static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) | 239 | static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) |
| @@ -223,6 +248,11 @@ static inline int irq_can_set_affinity(unsigned int irq) | |||
| 223 | 248 | ||
| 224 | static inline int irq_select_affinity(unsigned int irq) { return 0; } | 249 | static inline int irq_select_affinity(unsigned int irq) { return 0; } |
| 225 | 250 | ||
| 251 | static inline int irq_set_affinity_hint(unsigned int irq, | ||
| 252 | const struct cpumask *m) | ||
| 253 | { | ||
| 254 | return -EINVAL; | ||
| 255 | } | ||
| 226 | #endif /* CONFIG_SMP && CONFIG_GENERIC_HARDIRQS */ | 256 | #endif /* CONFIG_SMP && CONFIG_GENERIC_HARDIRQS */ |
| 227 | 257 | ||
| 228 | #ifdef CONFIG_GENERIC_HARDIRQS | 258 | #ifdef CONFIG_GENERIC_HARDIRQS |
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index 97eb928b4924..25085ddd955f 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #define _LINUX_IO_MAPPING_H | 19 | #define _LINUX_IO_MAPPING_H |
| 20 | 20 | ||
| 21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
| 22 | #include <linux/slab.h> | ||
| 22 | #include <asm/io.h> | 23 | #include <asm/io.h> |
| 23 | #include <asm/page.h> | 24 | #include <asm/page.h> |
| 24 | #include <asm/iomap.h> | 25 | #include <asm/iomap.h> |
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index 1195a806fe0c..a0bb301afac0 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h | |||
| @@ -42,7 +42,7 @@ struct io_context { | |||
| 42 | unsigned short ioprio; | 42 | unsigned short ioprio; |
| 43 | unsigned short ioprio_changed; | 43 | unsigned short ioprio_changed; |
| 44 | 44 | ||
| 45 | #ifdef CONFIG_BLK_CGROUP | 45 | #if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE) |
| 46 | unsigned short cgroup_changed; | 46 | unsigned short cgroup_changed; |
| 47 | #endif | 47 | #endif |
| 48 | 48 | ||
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 3af4ffd591b9..be22ad83689c 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
| @@ -37,9 +37,9 @@ struct iommu_ops { | |||
| 37 | int (*attach_dev)(struct iommu_domain *domain, struct device *dev); | 37 | int (*attach_dev)(struct iommu_domain *domain, struct device *dev); |
| 38 | void (*detach_dev)(struct iommu_domain *domain, struct device *dev); | 38 | void (*detach_dev)(struct iommu_domain *domain, struct device *dev); |
| 39 | int (*map)(struct iommu_domain *domain, unsigned long iova, | 39 | int (*map)(struct iommu_domain *domain, unsigned long iova, |
| 40 | phys_addr_t paddr, size_t size, int prot); | 40 | phys_addr_t paddr, int gfp_order, int prot); |
| 41 | void (*unmap)(struct iommu_domain *domain, unsigned long iova, | 41 | int (*unmap)(struct iommu_domain *domain, unsigned long iova, |
| 42 | size_t size); | 42 | int gfp_order); |
| 43 | phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, | 43 | phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, |
| 44 | unsigned long iova); | 44 | unsigned long iova); |
| 45 | int (*domain_has_cap)(struct iommu_domain *domain, | 45 | int (*domain_has_cap)(struct iommu_domain *domain, |
| @@ -56,10 +56,10 @@ extern int iommu_attach_device(struct iommu_domain *domain, | |||
| 56 | struct device *dev); | 56 | struct device *dev); |
| 57 | extern void iommu_detach_device(struct iommu_domain *domain, | 57 | extern void iommu_detach_device(struct iommu_domain *domain, |
| 58 | struct device *dev); | 58 | struct device *dev); |
| 59 | extern int iommu_map_range(struct iommu_domain *domain, unsigned long iova, | 59 | extern int iommu_map(struct iommu_domain *domain, unsigned long iova, |
| 60 | phys_addr_t paddr, size_t size, int prot); | 60 | phys_addr_t paddr, int gfp_order, int prot); |
| 61 | extern void iommu_unmap_range(struct iommu_domain *domain, unsigned long iova, | 61 | extern int iommu_unmap(struct iommu_domain *domain, unsigned long iova, |
| 62 | size_t size); | 62 | int gfp_order); |
| 63 | extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | 63 | extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, |
| 64 | unsigned long iova); | 64 | unsigned long iova); |
| 65 | extern int iommu_domain_has_cap(struct iommu_domain *domain, | 65 | extern int iommu_domain_has_cap(struct iommu_domain *domain, |
| @@ -96,16 +96,16 @@ static inline void iommu_detach_device(struct iommu_domain *domain, | |||
| 96 | { | 96 | { |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | static inline int iommu_map_range(struct iommu_domain *domain, | 99 | static inline int iommu_map(struct iommu_domain *domain, unsigned long iova, |
| 100 | unsigned long iova, phys_addr_t paddr, | 100 | phys_addr_t paddr, int gfp_order, int prot) |
| 101 | size_t size, int prot) | ||
| 102 | { | 101 | { |
| 103 | return -ENODEV; | 102 | return -ENODEV; |
| 104 | } | 103 | } |
| 105 | 104 | ||
| 106 | static inline void iommu_unmap_range(struct iommu_domain *domain, | 105 | static inline int iommu_unmap(struct iommu_domain *domain, unsigned long iova, |
| 107 | unsigned long iova, size_t size) | 106 | int gfp_order) |
| 108 | { | 107 | { |
| 108 | return -ENODEV; | ||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | 111 | static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index dda98410d588..26fad187d661 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
| @@ -34,22 +34,24 @@ struct resource_list { | |||
| 34 | */ | 34 | */ |
| 35 | #define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */ | 35 | #define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */ |
| 36 | 36 | ||
| 37 | #define IORESOURCE_TYPE_BITS 0x00000f00 /* Resource type */ | 37 | #define IORESOURCE_TYPE_BITS 0x00001f00 /* Resource type */ |
| 38 | #define IORESOURCE_IO 0x00000100 | 38 | #define IORESOURCE_IO 0x00000100 |
| 39 | #define IORESOURCE_MEM 0x00000200 | 39 | #define IORESOURCE_MEM 0x00000200 |
| 40 | #define IORESOURCE_IRQ 0x00000400 | 40 | #define IORESOURCE_IRQ 0x00000400 |
| 41 | #define IORESOURCE_DMA 0x00000800 | 41 | #define IORESOURCE_DMA 0x00000800 |
| 42 | #define IORESOURCE_BUS 0x00001000 | ||
| 42 | 43 | ||
| 43 | #define IORESOURCE_PREFETCH 0x00001000 /* No side effects */ | 44 | #define IORESOURCE_PREFETCH 0x00002000 /* No side effects */ |
| 44 | #define IORESOURCE_READONLY 0x00002000 | 45 | #define IORESOURCE_READONLY 0x00004000 |
| 45 | #define IORESOURCE_CACHEABLE 0x00004000 | 46 | #define IORESOURCE_CACHEABLE 0x00008000 |
| 46 | #define IORESOURCE_RANGELENGTH 0x00008000 | 47 | #define IORESOURCE_RANGELENGTH 0x00010000 |
| 47 | #define IORESOURCE_SHADOWABLE 0x00010000 | 48 | #define IORESOURCE_SHADOWABLE 0x00020000 |
| 48 | 49 | ||
| 49 | #define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */ | 50 | #define IORESOURCE_SIZEALIGN 0x00040000 /* size indicates alignment */ |
| 50 | #define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */ | 51 | #define IORESOURCE_STARTALIGN 0x00080000 /* start field is alignment */ |
| 51 | 52 | ||
| 52 | #define IORESOURCE_MEM_64 0x00100000 | 53 | #define IORESOURCE_MEM_64 0x00100000 |
| 54 | #define IORESOURCE_WINDOW 0x00200000 /* forwarded by bridge */ | ||
| 53 | 55 | ||
| 54 | #define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ | 56 | #define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ |
| 55 | #define IORESOURCE_DISABLED 0x10000000 | 57 | #define IORESOURCE_DISABLED 0x10000000 |
| @@ -110,12 +112,14 @@ struct resource_list { | |||
| 110 | extern struct resource ioport_resource; | 112 | extern struct resource ioport_resource; |
| 111 | extern struct resource iomem_resource; | 113 | extern struct resource iomem_resource; |
| 112 | 114 | ||
| 115 | extern struct resource *request_resource_conflict(struct resource *root, struct resource *new); | ||
| 113 | extern int request_resource(struct resource *root, struct resource *new); | 116 | extern int request_resource(struct resource *root, struct resource *new); |
| 114 | extern int release_resource(struct resource *new); | 117 | extern int release_resource(struct resource *new); |
| 115 | void release_child_resources(struct resource *new); | 118 | void release_child_resources(struct resource *new); |
| 116 | extern void reserve_region_with_split(struct resource *root, | 119 | extern void reserve_region_with_split(struct resource *root, |
| 117 | resource_size_t start, resource_size_t end, | 120 | resource_size_t start, resource_size_t end, |
| 118 | const char *name); | 121 | const char *name); |
| 122 | extern struct resource *insert_resource_conflict(struct resource *parent, struct resource *new); | ||
| 119 | extern int insert_resource(struct resource *parent, struct resource *new); | 123 | extern int insert_resource(struct resource *parent, struct resource *new); |
| 120 | extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new); | 124 | extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new); |
| 121 | extern int allocate_resource(struct resource *root, struct resource *new, | 125 | extern int allocate_resource(struct resource *root, struct resource *new, |
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index 07baa38bce37..51952989ad42 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h | |||
| @@ -62,11 +62,6 @@ extern struct ipc_namespace init_ipc_ns; | |||
| 62 | extern atomic_t nr_ipc_ns; | 62 | extern atomic_t nr_ipc_ns; |
| 63 | 63 | ||
| 64 | extern spinlock_t mq_lock; | 64 | extern spinlock_t mq_lock; |
| 65 | #if defined(CONFIG_POSIX_MQUEUE) || defined(CONFIG_SYSVIPC) | ||
| 66 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, | ||
| 67 | #else | ||
| 68 | #define INIT_IPC_NS(ns) | ||
| 69 | #endif | ||
| 70 | 65 | ||
| 71 | #ifdef CONFIG_SYSVIPC | 66 | #ifdef CONFIG_SYSVIPC |
| 72 | extern int register_ipcns_notifier(struct ipc_namespace *); | 67 | extern int register_ipcns_notifier(struct ipc_namespace *); |
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h index f7c9c75a2775..4b48318ac542 100644 --- a/include/linux/ipmi_smi.h +++ b/include/linux/ipmi_smi.h | |||
| @@ -39,7 +39,6 @@ | |||
| 39 | #include <linux/module.h> | 39 | #include <linux/module.h> |
| 40 | #include <linux/device.h> | 40 | #include <linux/device.h> |
| 41 | #include <linux/platform_device.h> | 41 | #include <linux/platform_device.h> |
| 42 | #include <linux/ipmi_smi.h> | ||
| 43 | 42 | ||
| 44 | /* This files describes the interface for IPMI system management interface | 43 | /* This files describes the interface for IPMI system management interface |
| 45 | drivers to bind into the IPMI message handler. */ | 44 | drivers to bind into the IPMI message handler. */ |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index e0cc9a7db2b5..99e1ab7e3eec 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
| @@ -21,6 +21,10 @@ struct in6_pktinfo { | |||
| 21 | int ipi6_ifindex; | 21 | int ipi6_ifindex; |
| 22 | }; | 22 | }; |
| 23 | 23 | ||
| 24 | struct ip6_mtuinfo { | ||
| 25 | struct sockaddr_in6 ip6m_addr; | ||
| 26 | __u32 ip6m_mtu; | ||
| 27 | }; | ||
| 24 | 28 | ||
| 25 | struct in6_ifreq { | 29 | struct in6_ifreq { |
| 26 | struct in6_addr ifr6_addr; | 30 | struct in6_addr ifr6_addr; |
| @@ -250,9 +254,11 @@ struct inet6_skb_parm { | |||
| 250 | 254 | ||
| 251 | #define IP6SKB_XFRM_TRANSFORMED 1 | 255 | #define IP6SKB_XFRM_TRANSFORMED 1 |
| 252 | #define IP6SKB_FORWARDED 2 | 256 | #define IP6SKB_FORWARDED 2 |
| 257 | #define IP6SKB_REROUTED 4 | ||
| 253 | }; | 258 | }; |
| 254 | 259 | ||
| 255 | #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) | 260 | #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) |
| 261 | #define IP6CBMTU(skb) ((struct ip6_mtuinfo *)((skb)->cb)) | ||
| 256 | 262 | ||
| 257 | static inline int inet6_iif(const struct sk_buff *skb) | 263 | static inline int inet6_iif(const struct sk_buff *skb) |
| 258 | { | 264 | { |
| @@ -334,21 +340,25 @@ struct ipv6_pinfo { | |||
| 334 | dstopts:1, | 340 | dstopts:1, |
| 335 | odstopts:1, | 341 | odstopts:1, |
| 336 | rxflow:1, | 342 | rxflow:1, |
| 337 | rxtclass:1; | 343 | rxtclass:1, |
| 344 | rxpmtu:1; | ||
| 338 | } bits; | 345 | } bits; |
| 339 | __u16 all; | 346 | __u16 all; |
| 340 | } rxopt; | 347 | } rxopt; |
| 341 | 348 | ||
| 342 | /* sockopt flags */ | 349 | /* sockopt flags */ |
| 343 | __u8 recverr:1, | 350 | __u16 recverr:1, |
| 344 | sndflow:1, | 351 | sndflow:1, |
| 345 | pmtudisc:2, | 352 | pmtudisc:2, |
| 346 | ipv6only:1, | 353 | ipv6only:1, |
| 347 | srcprefs:3; /* 001: prefer temporary address | 354 | srcprefs:3, /* 001: prefer temporary address |
| 348 | * 010: prefer public address | 355 | * 010: prefer public address |
| 349 | * 100: prefer care-of address | 356 | * 100: prefer care-of address |
| 350 | */ | 357 | */ |
| 358 | dontfrag:1; | ||
| 359 | __u8 min_hopcount; | ||
| 351 | __u8 tclass; | 360 | __u8 tclass; |
| 361 | __u8 padding; | ||
| 352 | 362 | ||
| 353 | __u32 dst_cookie; | 363 | __u32 dst_cookie; |
| 354 | 364 | ||
| @@ -358,6 +368,7 @@ struct ipv6_pinfo { | |||
| 358 | 368 | ||
| 359 | struct ipv6_txoptions *opt; | 369 | struct ipv6_txoptions *opt; |
| 360 | struct sk_buff *pktoptions; | 370 | struct sk_buff *pktoptions; |
| 371 | struct sk_buff *rxpmtu; | ||
| 361 | struct { | 372 | struct { |
| 362 | struct ipv6_txoptions *opt; | 373 | struct ipv6_txoptions *opt; |
| 363 | u8 hop_limit; | 374 | u8 hop_limit; |
| @@ -372,6 +383,7 @@ struct raw6_sock { | |||
| 372 | __u32 checksum; /* perform checksum */ | 383 | __u32 checksum; /* perform checksum */ |
| 373 | __u32 offset; /* checksum offset */ | 384 | __u32 offset; /* checksum offset */ |
| 374 | struct icmp6_filter filter; | 385 | struct icmp6_filter filter; |
| 386 | __u32 ip6mr_table; | ||
| 375 | /* ipv6_pinfo has to be the last member of raw6_sock, see inet6_sk_generic */ | 387 | /* ipv6_pinfo has to be the last member of raw6_sock, see inet6_sk_generic */ |
| 376 | struct ipv6_pinfo inet6; | 388 | struct ipv6_pinfo inet6; |
| 377 | }; | 389 | }; |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 707ab122e2e6..c03243ad84b4 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
| @@ -195,6 +195,7 @@ struct irq_desc { | |||
| 195 | raw_spinlock_t lock; | 195 | raw_spinlock_t lock; |
| 196 | #ifdef CONFIG_SMP | 196 | #ifdef CONFIG_SMP |
| 197 | cpumask_var_t affinity; | 197 | cpumask_var_t affinity; |
| 198 | const struct cpumask *affinity_hint; | ||
| 198 | unsigned int node; | 199 | unsigned int node; |
| 199 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 200 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
| 200 | cpumask_var_t pending_mask; | 201 | cpumask_var_t pending_mask; |
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h index 6092487e2950..d2e4042f8f5e 100644 --- a/include/linux/iscsi_ibft.h +++ b/include/linux/iscsi_ibft.h | |||
| @@ -42,9 +42,13 @@ extern struct ibft_table_header *ibft_addr; | |||
| 42 | * mapped address is set in the ibft_addr variable. | 42 | * mapped address is set in the ibft_addr variable. |
| 43 | */ | 43 | */ |
| 44 | #ifdef CONFIG_ISCSI_IBFT_FIND | 44 | #ifdef CONFIG_ISCSI_IBFT_FIND |
| 45 | extern void __init reserve_ibft_region(void); | 45 | unsigned long find_ibft_region(unsigned long *sizep); |
| 46 | #else | 46 | #else |
| 47 | static inline void reserve_ibft_region(void) { } | 47 | static inline unsigned long find_ibft_region(unsigned long *sizep) |
| 48 | { | ||
| 49 | *sizep = 0; | ||
| 50 | return 0; | ||
| 51 | } | ||
| 48 | #endif | 52 | #endif |
| 49 | 53 | ||
| 50 | #endif /* ISCSI_IBFT_H */ | 54 | #endif /* ISCSI_IBFT_H */ |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index f3aa59cb675d..516a2a27e87a 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <linux/mutex.h> | 31 | #include <linux/mutex.h> |
| 32 | #include <linux/timer.h> | 32 | #include <linux/timer.h> |
| 33 | #include <linux/lockdep.h> | 33 | #include <linux/lockdep.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | 35 | ||
| 35 | #define journal_oom_retry 1 | 36 | #define journal_oom_retry 1 |
| 36 | 37 | ||
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 1ec876358180..a4d2e9f7088a 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/bit_spinlock.h> | 30 | #include <linux/bit_spinlock.h> |
| 31 | #include <linux/mutex.h> | 31 | #include <linux/mutex.h> |
| 32 | #include <linux/timer.h> | 32 | #include <linux/timer.h> |
| 33 | #include <linux/slab.h> | ||
| 33 | #endif | 34 | #endif |
| 34 | 35 | ||
| 35 | #define journal_oom_retry 1 | 36 | #define journal_oom_retry 1 |
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h index 2b32d638147d..0874ab59ffef 100644 --- a/include/linux/jffs2.h +++ b/include/linux/jffs2.h | |||
| @@ -215,8 +215,8 @@ union jffs2_node_union | |||
| 215 | 215 | ||
| 216 | /* Data payload for device nodes. */ | 216 | /* Data payload for device nodes. */ |
| 217 | union jffs2_device_node { | 217 | union jffs2_device_node { |
| 218 | jint16_t old; | 218 | jint16_t old_id; |
| 219 | jint32_t new; | 219 | jint32_t new_id; |
| 220 | }; | 220 | }; |
| 221 | 221 | ||
| 222 | #endif /* __LINUX_JFFS2_H__ */ | 222 | #endif /* __LINUX_JFFS2_H__ */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 7f0707463360..fc33af911852 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | /* | 4 | /* |
| 5 | * 'kernel.h' contains some often-used function prototypes etc | 5 | * 'kernel.h' contains some often-used function prototypes etc |
| 6 | */ | 6 | */ |
| 7 | #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) | ||
| 8 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) | ||
| 7 | 9 | ||
| 8 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
| 9 | 11 | ||
| @@ -37,8 +39,8 @@ extern const char linux_proc_banner[]; | |||
| 37 | 39 | ||
| 38 | #define STACK_MAGIC 0xdeadbeef | 40 | #define STACK_MAGIC 0xdeadbeef |
| 39 | 41 | ||
| 40 | #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) | 42 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) |
| 41 | #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) | 43 | #define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask)) |
| 42 | #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) | 44 | #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) |
| 43 | #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) | 45 | #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) |
| 44 | 46 | ||
| @@ -426,7 +428,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 426 | .burst = DEFAULT_RATELIMIT_BURST, \ | 428 | .burst = DEFAULT_RATELIMIT_BURST, \ |
| 427 | }; \ | 429 | }; \ |
| 428 | \ | 430 | \ |
| 429 | if (!__ratelimit(&_rs)) \ | 431 | if (__ratelimit(&_rs)) \ |
| 430 | printk(fmt, ##__VA_ARGS__); \ | 432 | printk(fmt, ##__VA_ARGS__); \ |
| 431 | }) | 433 | }) |
| 432 | #else | 434 | #else |
| @@ -490,6 +492,13 @@ static inline void tracing_off(void) { } | |||
| 490 | static inline void tracing_off_permanent(void) { } | 492 | static inline void tracing_off_permanent(void) { } |
| 491 | static inline int tracing_is_on(void) { return 0; } | 493 | static inline int tracing_is_on(void) { return 0; } |
| 492 | #endif | 494 | #endif |
| 495 | |||
| 496 | enum ftrace_dump_mode { | ||
| 497 | DUMP_NONE, | ||
| 498 | DUMP_ALL, | ||
| 499 | DUMP_ORIG, | ||
| 500 | }; | ||
| 501 | |||
| 493 | #ifdef CONFIG_TRACING | 502 | #ifdef CONFIG_TRACING |
| 494 | extern void tracing_start(void); | 503 | extern void tracing_start(void); |
| 495 | extern void tracing_stop(void); | 504 | extern void tracing_stop(void); |
| @@ -571,7 +580,7 @@ __ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap); | |||
| 571 | extern int | 580 | extern int |
| 572 | __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); | 581 | __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); |
| 573 | 582 | ||
| 574 | extern void ftrace_dump(void); | 583 | extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); |
| 575 | #else | 584 | #else |
| 576 | static inline void | 585 | static inline void |
| 577 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } | 586 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } |
| @@ -592,7 +601,7 @@ ftrace_vprintk(const char *fmt, va_list ap) | |||
| 592 | { | 601 | { |
| 593 | return 0; | 602 | return 0; |
| 594 | } | 603 | } |
| 595 | static inline void ftrace_dump(void) { } | 604 | static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } |
| 596 | #endif /* CONFIG_TRACING */ | 605 | #endif /* CONFIG_TRACING */ |
| 597 | 606 | ||
| 598 | /* | 607 | /* |
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index bc0fc795bd35..9fad0527344f 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h | |||
| @@ -86,7 +86,8 @@ union { \ | |||
| 86 | */ | 86 | */ |
| 87 | #define INIT_KFIFO(name) \ | 87 | #define INIT_KFIFO(name) \ |
| 88 | name = __kfifo_initializer(sizeof(name##kfifo_buffer) - \ | 88 | name = __kfifo_initializer(sizeof(name##kfifo_buffer) - \ |
| 89 | sizeof(struct kfifo), name##kfifo_buffer) | 89 | sizeof(struct kfifo), \ |
| 90 | name##kfifo_buffer + sizeof(struct kfifo)) | ||
| 90 | 91 | ||
| 91 | /** | 92 | /** |
| 92 | * DEFINE_KFIFO - macro to define and initialize a kfifo | 93 | * DEFINE_KFIFO - macro to define and initialize a kfifo |
| @@ -102,8 +103,6 @@ union { \ | |||
| 102 | unsigned char name##kfifo_buffer[size]; \ | 103 | unsigned char name##kfifo_buffer[size]; \ |
| 103 | struct kfifo name = __kfifo_initializer(size, name##kfifo_buffer) | 104 | struct kfifo name = __kfifo_initializer(size, name##kfifo_buffer) |
| 104 | 105 | ||
| 105 | #undef __kfifo_initializer | ||
| 106 | |||
| 107 | extern void kfifo_init(struct kfifo *fifo, void *buffer, | 106 | extern void kfifo_init(struct kfifo *fifo, void *buffer, |
| 108 | unsigned int size); | 107 | unsigned int size); |
| 109 | extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size, | 108 | extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size, |
| @@ -202,7 +201,7 @@ static inline __must_check unsigned int kfifo_avail(struct kfifo *fifo) | |||
| 202 | * @n: the length of the data to be added. | 201 | * @n: the length of the data to be added. |
| 203 | * @lock: pointer to the spinlock to use for locking. | 202 | * @lock: pointer to the spinlock to use for locking. |
| 204 | * | 203 | * |
| 205 | * This function copies at most @len bytes from the @from buffer into | 204 | * This function copies at most @n bytes from the @from buffer into |
| 206 | * the FIFO depending on the free space, and returns the number of | 205 | * the FIFO depending on the free space, and returns the number of |
| 207 | * bytes copied. | 206 | * bytes copied. |
| 208 | */ | 207 | */ |
| @@ -228,7 +227,7 @@ static inline unsigned int kfifo_in_locked(struct kfifo *fifo, | |||
| 228 | * @n: the size of the destination buffer. | 227 | * @n: the size of the destination buffer. |
| 229 | * @lock: pointer to the spinlock to use for locking. | 228 | * @lock: pointer to the spinlock to use for locking. |
| 230 | * | 229 | * |
| 231 | * This function copies at most @len bytes from the FIFO into the | 230 | * This function copies at most @n bytes from the FIFO into the |
| 232 | * @to buffer and returns the number of copied bytes. | 231 | * @to buffer and returns the number of copied bytes. |
| 233 | */ | 232 | */ |
| 234 | static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo, | 233 | static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo, |
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 384ca8bbf1ac..facb27fe7de0 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #define KMOD_PATH_LEN 256 | 27 | #define KMOD_PATH_LEN 256 |
| 28 | 28 | ||
| 29 | #ifdef CONFIG_MODULES | 29 | #ifdef CONFIG_MODULES |
| 30 | extern char modprobe_path[]; /* for sysctl */ | ||
| 30 | /* modprobe exit status on success, -ve on error. Return value | 31 | /* modprobe exit status on success, -ve on error. Return value |
| 31 | * usually useless though. */ | 32 | * usually useless though. */ |
| 32 | extern int __request_module(bool wait, const char *name, ...) \ | 33 | extern int __request_module(bool wait, const char *name, ...) \ |
diff --git a/include/linux/kobj_map.h b/include/linux/kobj_map.h index 73717ed9ea79..18ca75ffcc5a 100644 --- a/include/linux/kobj_map.h +++ b/include/linux/kobj_map.h | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | /* | ||
| 2 | * kobj_map.h | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _KOBJ_MAP_H_ | ||
| 6 | #define _KOBJ_MAP_H_ | ||
| 7 | |||
| 1 | #include <linux/mutex.h> | 8 | #include <linux/mutex.h> |
| 2 | 9 | ||
| 3 | typedef struct kobject *kobj_probe_t(dev_t, int *, void *); | 10 | typedef struct kobject *kobj_probe_t(dev_t, int *, void *); |
| @@ -8,3 +15,5 @@ int kobj_map(struct kobj_map *, dev_t, unsigned long, struct module *, | |||
| 8 | void kobj_unmap(struct kobj_map *, dev_t, unsigned long); | 15 | void kobj_unmap(struct kobj_map *, dev_t, unsigned long); |
| 9 | struct kobject *kobj_lookup(struct kobj_map *, dev_t, int *); | 16 | struct kobject *kobj_lookup(struct kobj_map *, dev_t, int *); |
| 10 | struct kobj_map *kobj_map_init(kobj_probe_t *, struct mutex *); | 17 | struct kobj_map *kobj_map_init(kobj_probe_t *, struct mutex *); |
| 18 | |||
| 19 | #endif /* _KOBJ_MAP_H_ */ | ||
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 58ae8e00fcdd..d9456f69904f 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
| @@ -106,8 +106,10 @@ extern char *kobject_get_path(struct kobject *kobj, gfp_t flag); | |||
| 106 | 106 | ||
| 107 | struct kobj_type { | 107 | struct kobj_type { |
| 108 | void (*release)(struct kobject *kobj); | 108 | void (*release)(struct kobject *kobj); |
| 109 | struct sysfs_ops *sysfs_ops; | 109 | const struct sysfs_ops *sysfs_ops; |
| 110 | struct attribute **default_attrs; | 110 | struct attribute **default_attrs; |
| 111 | const struct kobj_ns_type_operations *(*child_ns_type)(struct kobject *kobj); | ||
| 112 | const void *(*namespace)(struct kobject *kobj); | ||
| 111 | }; | 113 | }; |
| 112 | 114 | ||
| 113 | struct kobj_uevent_env { | 115 | struct kobj_uevent_env { |
| @@ -118,9 +120,9 @@ struct kobj_uevent_env { | |||
| 118 | }; | 120 | }; |
| 119 | 121 | ||
| 120 | struct kset_uevent_ops { | 122 | struct kset_uevent_ops { |
| 121 | int (*filter)(struct kset *kset, struct kobject *kobj); | 123 | int (* const filter)(struct kset *kset, struct kobject *kobj); |
| 122 | const char *(*name)(struct kset *kset, struct kobject *kobj); | 124 | const char *(* const name)(struct kset *kset, struct kobject *kobj); |
| 123 | int (*uevent)(struct kset *kset, struct kobject *kobj, | 125 | int (* const uevent)(struct kset *kset, struct kobject *kobj, |
| 124 | struct kobj_uevent_env *env); | 126 | struct kobj_uevent_env *env); |
| 125 | }; | 127 | }; |
| 126 | 128 | ||
| @@ -132,7 +134,31 @@ struct kobj_attribute { | |||
| 132 | const char *buf, size_t count); | 134 | const char *buf, size_t count); |
| 133 | }; | 135 | }; |
| 134 | 136 | ||
| 135 | extern struct sysfs_ops kobj_sysfs_ops; | 137 | extern const struct sysfs_ops kobj_sysfs_ops; |
| 138 | |||
| 139 | enum kobj_ns_type { | ||
| 140 | KOBJ_NS_TYPE_NONE = 0, | ||
| 141 | KOBJ_NS_TYPES | ||
| 142 | }; | ||
| 143 | |||
| 144 | struct sock; | ||
| 145 | struct kobj_ns_type_operations { | ||
| 146 | enum kobj_ns_type type; | ||
| 147 | const void *(*current_ns)(void); | ||
| 148 | const void *(*netlink_ns)(struct sock *sk); | ||
| 149 | const void *(*initial_ns)(void); | ||
| 150 | }; | ||
| 151 | |||
| 152 | int kobj_ns_type_register(const struct kobj_ns_type_operations *ops); | ||
| 153 | int kobj_ns_type_registered(enum kobj_ns_type type); | ||
| 154 | const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent); | ||
| 155 | const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj); | ||
| 156 | |||
| 157 | const void *kobj_ns_current(enum kobj_ns_type type); | ||
| 158 | const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk); | ||
| 159 | const void *kobj_ns_initial(enum kobj_ns_type type); | ||
| 160 | void kobj_ns_exit(enum kobj_ns_type type, const void *ns); | ||
| 161 | |||
| 136 | 162 | ||
| 137 | /** | 163 | /** |
| 138 | * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem. | 164 | * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem. |
| @@ -155,14 +181,14 @@ struct kset { | |||
| 155 | struct list_head list; | 181 | struct list_head list; |
| 156 | spinlock_t list_lock; | 182 | spinlock_t list_lock; |
| 157 | struct kobject kobj; | 183 | struct kobject kobj; |
| 158 | struct kset_uevent_ops *uevent_ops; | 184 | const struct kset_uevent_ops *uevent_ops; |
| 159 | }; | 185 | }; |
| 160 | 186 | ||
| 161 | extern void kset_init(struct kset *kset); | 187 | extern void kset_init(struct kset *kset); |
| 162 | extern int __must_check kset_register(struct kset *kset); | 188 | extern int __must_check kset_register(struct kset *kset); |
| 163 | extern void kset_unregister(struct kset *kset); | 189 | extern void kset_unregister(struct kset *kset); |
| 164 | extern struct kset * __must_check kset_create_and_add(const char *name, | 190 | extern struct kset * __must_check kset_create_and_add(const char *name, |
| 165 | struct kset_uevent_ops *u, | 191 | const struct kset_uevent_ops *u, |
| 166 | struct kobject *parent_kobj); | 192 | struct kobject *parent_kobj); |
| 167 | 193 | ||
| 168 | static inline struct kset *to_kset(struct kobject *kobj) | 194 | static inline struct kset *to_kset(struct kobject *kobj) |
diff --git a/include/linux/kref.h b/include/linux/kref.h index b0cb0ebad9e6..6cc38fc07ab7 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * kref.c - library routines for handling generic reference counted objects | 2 | * kref.h - library routines for handling generic reference counted objects |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com> | 4 | * Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com> |
| 5 | * Copyright (C) 2004 IBM Corp. | 5 | * Copyright (C) 2004 IBM Corp. |
| @@ -21,7 +21,6 @@ struct kref { | |||
| 21 | atomic_t refcount; | 21 | atomic_t refcount; |
| 22 | }; | 22 | }; |
| 23 | 23 | ||
| 24 | void kref_set(struct kref *kref, int num); | ||
| 25 | void kref_init(struct kref *kref); | 24 | void kref_init(struct kref *kref); |
| 26 | void kref_get(struct kref *kref); | 25 | void kref_get(struct kref *kref); |
| 27 | int kref_put(struct kref *kref, void (*release) (struct kref *kref)); | 26 | int kref_put(struct kref *kref, void (*release) (struct kref *kref)); |
diff --git a/include/linux/ks8842.h b/include/linux/ks8842.h new file mode 100644 index 000000000000..da0341b8ca0a --- /dev/null +++ b/include/linux/ks8842.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * ks8842.h KS8842 platform data struct definition | ||
| 3 | * Copyright (c) 2010 Intel Corporation | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef _LINUX_KS8842_H | ||
| 20 | #define _LINUX_KS8842_H | ||
| 21 | |||
| 22 | #include <linux/if_ether.h> | ||
| 23 | |||
| 24 | /** | ||
| 25 | * struct ks8842_platform_data - Platform data of the KS8842 network driver | ||
| 26 | * @macaddr: The MAC address of the device, set to all 0:s to use the on in | ||
| 27 | * the chip. | ||
| 28 | * | ||
| 29 | */ | ||
| 30 | struct ks8842_platform_data { | ||
| 31 | u8 macaddr[ETH_ALEN]; | ||
| 32 | }; | ||
| 33 | |||
| 34 | #endif | ||
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index ce5983225be4..e1ceaa9b36bb 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
| @@ -130,7 +130,7 @@ static inline ktime_t timeval_to_ktime(struct timeval tv) | |||
| 130 | /* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */ | 130 | /* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */ |
| 131 | #define ktime_to_ns(kt) ((kt).tv64) | 131 | #define ktime_to_ns(kt) ((kt).tv64) |
| 132 | 132 | ||
| 133 | #else | 133 | #else /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */ |
| 134 | 134 | ||
| 135 | /* | 135 | /* |
| 136 | * Helper macros/inlines to get the ktime_t math right in the timespec | 136 | * Helper macros/inlines to get the ktime_t math right in the timespec |
| @@ -275,7 +275,7 @@ static inline s64 ktime_to_ns(const ktime_t kt) | |||
| 275 | return (s64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec; | 275 | return (s64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec; |
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | #endif | 278 | #endif /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */ |
| 279 | 279 | ||
| 280 | /** | 280 | /** |
| 281 | * ktime_equal - Compares two ktime_t variables to see if they are equal | 281 | * ktime_equal - Compares two ktime_t variables to see if they are equal |
| @@ -295,6 +295,12 @@ static inline s64 ktime_to_us(const ktime_t kt) | |||
| 295 | return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec; | 295 | return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec; |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | static inline s64 ktime_to_ms(const ktime_t kt) | ||
| 299 | { | ||
| 300 | struct timeval tv = ktime_to_timeval(kt); | ||
| 301 | return (s64) tv.tv_sec * MSEC_PER_SEC + tv.tv_usec / USEC_PER_MSEC; | ||
| 302 | } | ||
| 303 | |||
| 298 | static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier) | 304 | static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier) |
| 299 | { | 305 | { |
| 300 | return ktime_to_us(ktime_sub(later, earlier)); | 306 | return ktime_to_us(ktime_sub(later, earlier)); |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index a3fd0f91d943..169d07758ee5 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -54,7 +54,7 @@ extern struct kmem_cache *kvm_vcpu_cache; | |||
| 54 | */ | 54 | */ |
| 55 | struct kvm_io_bus { | 55 | struct kvm_io_bus { |
| 56 | int dev_count; | 56 | int dev_count; |
| 57 | #define NR_IOBUS_DEVS 6 | 57 | #define NR_IOBUS_DEVS 200 |
| 58 | struct kvm_io_device *devs[NR_IOBUS_DEVS]; | 58 | struct kvm_io_device *devs[NR_IOBUS_DEVS]; |
| 59 | }; | 59 | }; |
| 60 | 60 | ||
| @@ -119,6 +119,11 @@ struct kvm_memory_slot { | |||
| 119 | int user_alloc; | 119 | int user_alloc; |
| 120 | }; | 120 | }; |
| 121 | 121 | ||
| 122 | static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot) | ||
| 123 | { | ||
| 124 | return ALIGN(memslot->npages, BITS_PER_LONG) / 8; | ||
| 125 | } | ||
| 126 | |||
| 122 | struct kvm_kernel_irq_routing_entry { | 127 | struct kvm_kernel_irq_routing_entry { |
| 123 | u32 gsi; | 128 | u32 gsi; |
| 124 | u32 type; | 129 | u32 type; |
diff --git a/include/linux/l2tp.h b/include/linux/l2tp.h new file mode 100644 index 000000000000..4bdb31df8e72 --- /dev/null +++ b/include/linux/l2tp.h | |||
| @@ -0,0 +1,163 @@ | |||
| 1 | /* | ||
| 2 | * L2TP-over-IP socket for L2TPv3. | ||
| 3 | * | ||
| 4 | * Author: James Chapman <jchapman@katalix.com> | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef _LINUX_L2TP_H_ | ||
| 8 | #define _LINUX_L2TP_H_ | ||
| 9 | |||
| 10 | #include <linux/types.h> | ||
| 11 | #ifdef __KERNEL__ | ||
| 12 | #include <linux/socket.h> | ||
| 13 | #include <linux/in.h> | ||
| 14 | #else | ||
| 15 | #include <netinet/in.h> | ||
| 16 | #endif | ||
| 17 | |||
| 18 | #define IPPROTO_L2TP 115 | ||
| 19 | |||
| 20 | /** | ||
| 21 | * struct sockaddr_l2tpip - the sockaddr structure for L2TP-over-IP sockets | ||
| 22 | * @l2tp_family: address family number AF_L2TPIP. | ||
| 23 | * @l2tp_addr: protocol specific address information | ||
| 24 | * @l2tp_conn_id: connection id of tunnel | ||
| 25 | */ | ||
| 26 | #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ | ||
| 27 | struct sockaddr_l2tpip { | ||
| 28 | /* The first fields must match struct sockaddr_in */ | ||
| 29 | sa_family_t l2tp_family; /* AF_INET */ | ||
| 30 | __be16 l2tp_unused; /* INET port number (unused) */ | ||
| 31 | struct in_addr l2tp_addr; /* Internet address */ | ||
| 32 | |||
| 33 | __u32 l2tp_conn_id; /* Connection ID of tunnel */ | ||
| 34 | |||
| 35 | /* Pad to size of `struct sockaddr'. */ | ||
| 36 | unsigned char __pad[sizeof(struct sockaddr) - sizeof(sa_family_t) - | ||
| 37 | sizeof(__be16) - sizeof(struct in_addr) - | ||
| 38 | sizeof(__u32)]; | ||
| 39 | }; | ||
| 40 | |||
| 41 | /***************************************************************************** | ||
| 42 | * NETLINK_GENERIC netlink family. | ||
| 43 | *****************************************************************************/ | ||
| 44 | |||
| 45 | /* | ||
| 46 | * Commands. | ||
| 47 | * Valid TLVs of each command are:- | ||
| 48 | * TUNNEL_CREATE - CONN_ID, pw_type, netns, ifname, ipinfo, udpinfo, udpcsum, vlanid | ||
| 49 | * TUNNEL_DELETE - CONN_ID | ||
| 50 | * TUNNEL_MODIFY - CONN_ID, udpcsum | ||
| 51 | * TUNNEL_GETSTATS - CONN_ID, (stats) | ||
| 52 | * TUNNEL_GET - CONN_ID, (...) | ||
| 53 | * SESSION_CREATE - SESSION_ID, PW_TYPE, offset, data_seq, cookie, peer_cookie, offset, l2spec | ||
| 54 | * SESSION_DELETE - SESSION_ID | ||
| 55 | * SESSION_MODIFY - SESSION_ID, data_seq | ||
| 56 | * SESSION_GET - SESSION_ID, (...) | ||
| 57 | * SESSION_GETSTATS - SESSION_ID, (stats) | ||
| 58 | * | ||
| 59 | */ | ||
| 60 | enum { | ||
| 61 | L2TP_CMD_NOOP, | ||
| 62 | L2TP_CMD_TUNNEL_CREATE, | ||
| 63 | L2TP_CMD_TUNNEL_DELETE, | ||
| 64 | L2TP_CMD_TUNNEL_MODIFY, | ||
| 65 | L2TP_CMD_TUNNEL_GET, | ||
| 66 | L2TP_CMD_SESSION_CREATE, | ||
| 67 | L2TP_CMD_SESSION_DELETE, | ||
| 68 | L2TP_CMD_SESSION_MODIFY, | ||
| 69 | L2TP_CMD_SESSION_GET, | ||
| 70 | __L2TP_CMD_MAX, | ||
| 71 | }; | ||
| 72 | |||
| 73 | #define L2TP_CMD_MAX (__L2TP_CMD_MAX - 1) | ||
| 74 | |||
| 75 | /* | ||
| 76 | * ATTR types defined for L2TP | ||
| 77 | */ | ||
| 78 | enum { | ||
| 79 | L2TP_ATTR_NONE, /* no data */ | ||
| 80 | L2TP_ATTR_PW_TYPE, /* u16, enum l2tp_pwtype */ | ||
| 81 | L2TP_ATTR_ENCAP_TYPE, /* u16, enum l2tp_encap_type */ | ||
| 82 | L2TP_ATTR_OFFSET, /* u16 */ | ||
| 83 | L2TP_ATTR_DATA_SEQ, /* u16 */ | ||
| 84 | L2TP_ATTR_L2SPEC_TYPE, /* u8, enum l2tp_l2spec_type */ | ||
| 85 | L2TP_ATTR_L2SPEC_LEN, /* u8, enum l2tp_l2spec_type */ | ||
| 86 | L2TP_ATTR_PROTO_VERSION, /* u8 */ | ||
| 87 | L2TP_ATTR_IFNAME, /* string */ | ||
| 88 | L2TP_ATTR_CONN_ID, /* u32 */ | ||
| 89 | L2TP_ATTR_PEER_CONN_ID, /* u32 */ | ||
| 90 | L2TP_ATTR_SESSION_ID, /* u32 */ | ||
| 91 | L2TP_ATTR_PEER_SESSION_ID, /* u32 */ | ||
| 92 | L2TP_ATTR_UDP_CSUM, /* u8 */ | ||
| 93 | L2TP_ATTR_VLAN_ID, /* u16 */ | ||
| 94 | L2TP_ATTR_COOKIE, /* 0, 4 or 8 bytes */ | ||
| 95 | L2TP_ATTR_PEER_COOKIE, /* 0, 4 or 8 bytes */ | ||
| 96 | L2TP_ATTR_DEBUG, /* u32 */ | ||
| 97 | L2TP_ATTR_RECV_SEQ, /* u8 */ | ||
| 98 | L2TP_ATTR_SEND_SEQ, /* u8 */ | ||
| 99 | L2TP_ATTR_LNS_MODE, /* u8 */ | ||
| 100 | L2TP_ATTR_USING_IPSEC, /* u8 */ | ||
| 101 | L2TP_ATTR_RECV_TIMEOUT, /* msec */ | ||
| 102 | L2TP_ATTR_FD, /* int */ | ||
| 103 | L2TP_ATTR_IP_SADDR, /* u32 */ | ||
| 104 | L2TP_ATTR_IP_DADDR, /* u32 */ | ||
| 105 | L2TP_ATTR_UDP_SPORT, /* u16 */ | ||
| 106 | L2TP_ATTR_UDP_DPORT, /* u16 */ | ||
| 107 | L2TP_ATTR_MTU, /* u16 */ | ||
| 108 | L2TP_ATTR_MRU, /* u16 */ | ||
| 109 | L2TP_ATTR_STATS, /* nested */ | ||
| 110 | __L2TP_ATTR_MAX, | ||
| 111 | }; | ||
| 112 | |||
| 113 | #define L2TP_ATTR_MAX (__L2TP_ATTR_MAX - 1) | ||
| 114 | |||
| 115 | /* Nested in L2TP_ATTR_STATS */ | ||
| 116 | enum { | ||
| 117 | L2TP_ATTR_STATS_NONE, /* no data */ | ||
| 118 | L2TP_ATTR_TX_PACKETS, /* u64 */ | ||
| 119 | L2TP_ATTR_TX_BYTES, /* u64 */ | ||
| 120 | L2TP_ATTR_TX_ERRORS, /* u64 */ | ||
| 121 | L2TP_ATTR_RX_PACKETS, /* u64 */ | ||
| 122 | L2TP_ATTR_RX_BYTES, /* u64 */ | ||
| 123 | L2TP_ATTR_RX_SEQ_DISCARDS, /* u64 */ | ||
| 124 | L2TP_ATTR_RX_OOS_PACKETS, /* u64 */ | ||
| 125 | L2TP_ATTR_RX_ERRORS, /* u64 */ | ||
| 126 | __L2TP_ATTR_STATS_MAX, | ||
| 127 | }; | ||
| 128 | |||
| 129 | #define L2TP_ATTR_STATS_MAX (__L2TP_ATTR_STATS_MAX - 1) | ||
| 130 | |||
| 131 | enum l2tp_pwtype { | ||
| 132 | L2TP_PWTYPE_NONE = 0x0000, | ||
| 133 | L2TP_PWTYPE_ETH_VLAN = 0x0004, | ||
| 134 | L2TP_PWTYPE_ETH = 0x0005, | ||
| 135 | L2TP_PWTYPE_PPP = 0x0007, | ||
| 136 | L2TP_PWTYPE_PPP_AC = 0x0008, | ||
| 137 | L2TP_PWTYPE_IP = 0x000b, | ||
| 138 | __L2TP_PWTYPE_MAX | ||
| 139 | }; | ||
| 140 | |||
| 141 | enum l2tp_l2spec_type { | ||
| 142 | L2TP_L2SPECTYPE_NONE, | ||
| 143 | L2TP_L2SPECTYPE_DEFAULT, | ||
| 144 | }; | ||
| 145 | |||
| 146 | enum l2tp_encap_type { | ||
| 147 | L2TP_ENCAPTYPE_UDP, | ||
| 148 | L2TP_ENCAPTYPE_IP, | ||
| 149 | }; | ||
| 150 | |||
| 151 | enum l2tp_seqmode { | ||
| 152 | L2TP_SEQ_NONE = 0, | ||
| 153 | L2TP_SEQ_IP = 1, | ||
| 154 | L2TP_SEQ_ALL = 2, | ||
| 155 | }; | ||
| 156 | |||
| 157 | /* | ||
| 158 | * NETLINK_GENERIC related info | ||
| 159 | */ | ||
| 160 | #define L2TP_GENL_NAME "l2tp" | ||
| 161 | #define L2TP_GENL_VERSION 0x1 | ||
| 162 | |||
| 163 | #endif | ||
diff --git a/include/linux/lcm.h b/include/linux/lcm.h new file mode 100644 index 000000000000..7bf01d779b45 --- /dev/null +++ b/include/linux/lcm.h | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | #ifndef _LCM_H | ||
| 2 | #define _LCM_H | ||
| 3 | |||
| 4 | #include <linux/compiler.h> | ||
| 5 | |||
| 6 | unsigned long lcm(unsigned long a, unsigned long b) __attribute_const__; | ||
| 7 | |||
| 8 | #endif /* _LCM_H */ | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index f8ea71e6d0e2..ee84e7e12039 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -146,6 +146,7 @@ enum { | |||
| 146 | ATA_DFLAG_SLEEPING = (1 << 15), /* device is sleeping */ | 146 | ATA_DFLAG_SLEEPING = (1 << 15), /* device is sleeping */ |
| 147 | ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ | 147 | ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ |
| 148 | ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */ | 148 | ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */ |
| 149 | ATA_DFLAG_UNLOCK_HPA = (1 << 18), /* unlock HPA */ | ||
| 149 | ATA_DFLAG_INIT_MASK = (1 << 24) - 1, | 150 | ATA_DFLAG_INIT_MASK = (1 << 24) - 1, |
| 150 | 151 | ||
| 151 | ATA_DFLAG_DETACH = (1 << 24), | 152 | ATA_DFLAG_DETACH = (1 << 24), |
| @@ -201,12 +202,6 @@ enum { | |||
| 201 | ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity | 202 | ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity |
| 202 | * led */ | 203 | * led */ |
| 203 | 204 | ||
| 204 | /* The following flag belongs to ap->pflags but is kept in | ||
| 205 | * ap->flags because it's referenced in many LLDs and will be | ||
| 206 | * removed in not-too-distant future. | ||
| 207 | */ | ||
| 208 | ATA_FLAG_DISABLED = (1 << 23), /* port is disabled, ignore it */ | ||
| 209 | |||
| 210 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ | 205 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ |
| 211 | 206 | ||
| 212 | 207 | ||
| @@ -255,12 +250,13 @@ enum { | |||
| 255 | ATA_TMOUT_INTERNAL_QUICK = 5000, | 250 | ATA_TMOUT_INTERNAL_QUICK = 5000, |
| 256 | ATA_TMOUT_MAX_PARK = 30000, | 251 | ATA_TMOUT_MAX_PARK = 30000, |
| 257 | 252 | ||
| 258 | /* FIXME: GoVault needs 2s but we can't afford that without | 253 | /* |
| 259 | * parallel probing. 800ms is enough for iVDR disk | 254 | * GoVault needs 2s and iVDR disk HHD424020F7SV00 800ms. 2s |
| 260 | * HHD424020F7SV00. Increase to 2secs when parallel probing | 255 | * is too much without parallel probing. Use 2s if parallel |
| 261 | * is in place. | 256 | * probing is available, 800ms otherwise. |
| 262 | */ | 257 | */ |
| 263 | ATA_TMOUT_FF_WAIT = 800, | 258 | ATA_TMOUT_FF_WAIT_LONG = 2000, |
| 259 | ATA_TMOUT_FF_WAIT = 800, | ||
| 264 | 260 | ||
| 265 | /* Spec mandates to wait for ">= 2ms" before checking status | 261 | /* Spec mandates to wait for ">= 2ms" before checking status |
| 266 | * after reset. We wait 150ms, because that was the magic | 262 | * after reset. We wait 150ms, because that was the magic |
| @@ -720,15 +716,15 @@ struct ata_port { | |||
| 720 | unsigned int print_id; /* user visible unique port ID */ | 716 | unsigned int print_id; /* user visible unique port ID */ |
| 721 | unsigned int port_no; /* 0 based port no. inside the host */ | 717 | unsigned int port_no; /* 0 based port no. inside the host */ |
| 722 | 718 | ||
| 723 | struct ata_prd *prd; /* our SG list */ | ||
| 724 | dma_addr_t prd_dma; /* and its DMA mapping */ | ||
| 725 | |||
| 726 | #ifdef CONFIG_ATA_SFF | 719 | #ifdef CONFIG_ATA_SFF |
| 727 | struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */ | 720 | struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */ |
| 728 | #endif /* CONFIG_ATA_SFF */ | ||
| 729 | |||
| 730 | u8 ctl; /* cache of ATA control register */ | 721 | u8 ctl; /* cache of ATA control register */ |
| 731 | u8 last_ctl; /* Cache last written value */ | 722 | u8 last_ctl; /* Cache last written value */ |
| 723 | struct delayed_work sff_pio_task; | ||
| 724 | struct ata_bmdma_prd *bmdma_prd; /* BMDMA SG list */ | ||
| 725 | dma_addr_t bmdma_prd_dma; /* and its DMA mapping */ | ||
| 726 | #endif /* CONFIG_ATA_SFF */ | ||
| 727 | |||
| 732 | unsigned int pio_mask; | 728 | unsigned int pio_mask; |
| 733 | unsigned int mwdma_mask; | 729 | unsigned int mwdma_mask; |
| 734 | unsigned int udma_mask; | 730 | unsigned int udma_mask; |
| @@ -750,8 +746,6 @@ struct ata_port { | |||
| 750 | struct ata_host *host; | 746 | struct ata_host *host; |
| 751 | struct device *dev; | 747 | struct device *dev; |
| 752 | 748 | ||
| 753 | void *port_task_data; | ||
| 754 | struct delayed_work port_task; | ||
| 755 | struct delayed_work hotplug_task; | 749 | struct delayed_work hotplug_task; |
| 756 | struct work_struct scsi_rescan_task; | 750 | struct work_struct scsi_rescan_task; |
| 757 | 751 | ||
| @@ -848,6 +842,7 @@ struct ata_port_operations { | |||
| 848 | * SFF / taskfile oriented ops | 842 | * SFF / taskfile oriented ops |
| 849 | */ | 843 | */ |
| 850 | void (*sff_dev_select)(struct ata_port *ap, unsigned int device); | 844 | void (*sff_dev_select)(struct ata_port *ap, unsigned int device); |
| 845 | void (*sff_set_devctl)(struct ata_port *ap, u8 ctl); | ||
| 851 | u8 (*sff_check_status)(struct ata_port *ap); | 846 | u8 (*sff_check_status)(struct ata_port *ap); |
| 852 | u8 (*sff_check_altstatus)(struct ata_port *ap); | 847 | u8 (*sff_check_altstatus)(struct ata_port *ap); |
| 853 | void (*sff_tf_load)(struct ata_port *ap, const struct ata_taskfile *tf); | 848 | void (*sff_tf_load)(struct ata_port *ap, const struct ata_taskfile *tf); |
| @@ -856,16 +851,15 @@ struct ata_port_operations { | |||
| 856 | const struct ata_taskfile *tf); | 851 | const struct ata_taskfile *tf); |
| 857 | unsigned int (*sff_data_xfer)(struct ata_device *dev, | 852 | unsigned int (*sff_data_xfer)(struct ata_device *dev, |
| 858 | unsigned char *buf, unsigned int buflen, int rw); | 853 | unsigned char *buf, unsigned int buflen, int rw); |
| 859 | u8 (*sff_irq_on)(struct ata_port *); | 854 | void (*sff_irq_on)(struct ata_port *); |
| 860 | bool (*sff_irq_check)(struct ata_port *); | 855 | bool (*sff_irq_check)(struct ata_port *); |
| 861 | void (*sff_irq_clear)(struct ata_port *); | 856 | void (*sff_irq_clear)(struct ata_port *); |
| 857 | void (*sff_drain_fifo)(struct ata_queued_cmd *qc); | ||
| 862 | 858 | ||
| 863 | void (*bmdma_setup)(struct ata_queued_cmd *qc); | 859 | void (*bmdma_setup)(struct ata_queued_cmd *qc); |
| 864 | void (*bmdma_start)(struct ata_queued_cmd *qc); | 860 | void (*bmdma_start)(struct ata_queued_cmd *qc); |
| 865 | void (*bmdma_stop)(struct ata_queued_cmd *qc); | 861 | void (*bmdma_stop)(struct ata_queued_cmd *qc); |
| 866 | u8 (*bmdma_status)(struct ata_port *ap); | 862 | u8 (*bmdma_status)(struct ata_port *ap); |
| 867 | |||
| 868 | void (*drain_fifo)(struct ata_queued_cmd *qc); | ||
| 869 | #endif /* CONFIG_ATA_SFF */ | 863 | #endif /* CONFIG_ATA_SFF */ |
| 870 | 864 | ||
| 871 | ssize_t (*em_show)(struct ata_port *ap, char *buf); | 865 | ssize_t (*em_show)(struct ata_port *ap, char *buf); |
| @@ -934,7 +928,6 @@ static inline int ata_port_is_dummy(struct ata_port *ap) | |||
| 934 | return ap->ops == &ata_dummy_port_ops; | 928 | return ap->ops == &ata_dummy_port_ops; |
| 935 | } | 929 | } |
| 936 | 930 | ||
| 937 | extern void ata_port_probe(struct ata_port *); | ||
| 938 | extern int sata_set_spd(struct ata_link *link); | 931 | extern int sata_set_spd(struct ata_link *link); |
| 939 | extern int ata_std_prereset(struct ata_link *link, unsigned long deadline); | 932 | extern int ata_std_prereset(struct ata_link *link, unsigned long deadline); |
| 940 | extern int ata_wait_after_reset(struct ata_link *link, unsigned long deadline, | 933 | extern int ata_wait_after_reset(struct ata_link *link, unsigned long deadline, |
| @@ -949,7 +942,6 @@ extern int sata_link_hardreset(struct ata_link *link, | |||
| 949 | extern int sata_std_hardreset(struct ata_link *link, unsigned int *class, | 942 | extern int sata_std_hardreset(struct ata_link *link, unsigned int *class, |
| 950 | unsigned long deadline); | 943 | unsigned long deadline); |
| 951 | extern void ata_std_postreset(struct ata_link *link, unsigned int *classes); | 944 | extern void ata_std_postreset(struct ata_link *link, unsigned int *classes); |
| 952 | extern void ata_port_disable(struct ata_port *); | ||
| 953 | 945 | ||
| 954 | extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); | 946 | extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); |
| 955 | extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, | 947 | extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, |
| @@ -1005,7 +997,6 @@ extern unsigned long ata_xfer_mode2mask(u8 xfer_mode); | |||
| 1005 | extern int ata_xfer_mode2shift(unsigned long xfer_mode); | 997 | extern int ata_xfer_mode2shift(unsigned long xfer_mode); |
| 1006 | extern const char *ata_mode_string(unsigned long xfer_mask); | 998 | extern const char *ata_mode_string(unsigned long xfer_mask); |
| 1007 | extern unsigned long ata_id_xfermask(const u16 *id); | 999 | extern unsigned long ata_id_xfermask(const u16 *id); |
| 1008 | extern int ata_port_start(struct ata_port *ap); | ||
| 1009 | extern int ata_std_qc_defer(struct ata_queued_cmd *qc); | 1000 | extern int ata_std_qc_defer(struct ata_queued_cmd *qc); |
| 1010 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); | 1001 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); |
| 1011 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | 1002 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, |
| @@ -1038,9 +1029,6 @@ extern int ata_cable_sata(struct ata_port *ap); | |||
| 1038 | extern int ata_cable_ignore(struct ata_port *ap); | 1029 | extern int ata_cable_ignore(struct ata_port *ap); |
| 1039 | extern int ata_cable_unknown(struct ata_port *ap); | 1030 | extern int ata_cable_unknown(struct ata_port *ap); |
| 1040 | 1031 | ||
| 1041 | extern void ata_pio_queue_task(struct ata_port *ap, void *data, | ||
| 1042 | unsigned long delay); | ||
| 1043 | |||
| 1044 | /* Timing helpers */ | 1032 | /* Timing helpers */ |
| 1045 | extern unsigned int ata_pio_need_iordy(const struct ata_device *); | 1033 | extern unsigned int ata_pio_need_iordy(const struct ata_device *); |
| 1046 | extern const struct ata_timing *ata_timing_find_mode(u8 xfer_mode); | 1034 | extern const struct ata_timing *ata_timing_find_mode(u8 xfer_mode); |
| @@ -1442,7 +1430,11 @@ static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf) | |||
| 1442 | { | 1430 | { |
| 1443 | memset(tf, 0, sizeof(*tf)); | 1431 | memset(tf, 0, sizeof(*tf)); |
| 1444 | 1432 | ||
| 1433 | #ifdef CONFIG_ATA_SFF | ||
| 1445 | tf->ctl = dev->link->ap->ctl; | 1434 | tf->ctl = dev->link->ap->ctl; |
| 1435 | #else | ||
| 1436 | tf->ctl = ATA_DEVCTL_OBS; | ||
| 1437 | #endif | ||
| 1446 | if (dev->devno == 0) | 1438 | if (dev->devno == 0) |
| 1447 | tf->device = ATA_DEVICE_OBS; | 1439 | tf->device = ATA_DEVICE_OBS; |
| 1448 | else | 1440 | else |
| @@ -1577,8 +1569,6 @@ extern const struct ata_port_operations ata_bmdma32_port_ops; | |||
| 1577 | .sg_tablesize = LIBATA_MAX_PRD, \ | 1569 | .sg_tablesize = LIBATA_MAX_PRD, \ |
| 1578 | .dma_boundary = ATA_DMA_BOUNDARY | 1570 | .dma_boundary = ATA_DMA_BOUNDARY |
| 1579 | 1571 | ||
| 1580 | extern void ata_sff_qc_prep(struct ata_queued_cmd *qc); | ||
| 1581 | extern void ata_sff_dumb_qc_prep(struct ata_queued_cmd *qc); | ||
| 1582 | extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device); | 1572 | extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device); |
| 1583 | extern u8 ata_sff_check_status(struct ata_port *ap); | 1573 | extern u8 ata_sff_check_status(struct ata_port *ap); |
| 1584 | extern void ata_sff_pause(struct ata_port *ap); | 1574 | extern void ata_sff_pause(struct ata_port *ap); |
| @@ -1596,10 +1586,11 @@ extern unsigned int ata_sff_data_xfer32(struct ata_device *dev, | |||
| 1596 | unsigned char *buf, unsigned int buflen, int rw); | 1586 | unsigned char *buf, unsigned int buflen, int rw); |
| 1597 | extern unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev, | 1587 | extern unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev, |
| 1598 | unsigned char *buf, unsigned int buflen, int rw); | 1588 | unsigned char *buf, unsigned int buflen, int rw); |
| 1599 | extern u8 ata_sff_irq_on(struct ata_port *ap); | 1589 | extern void ata_sff_irq_on(struct ata_port *ap); |
| 1600 | extern void ata_sff_irq_clear(struct ata_port *ap); | 1590 | extern void ata_sff_irq_clear(struct ata_port *ap); |
| 1601 | extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, | 1591 | extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, |
| 1602 | u8 status, int in_wq); | 1592 | u8 status, int in_wq); |
| 1593 | extern void ata_sff_queue_pio_task(struct ata_port *ap, unsigned long delay); | ||
| 1603 | extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc); | 1594 | extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc); |
| 1604 | extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc); | 1595 | extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc); |
| 1605 | extern unsigned int ata_sff_host_intr(struct ata_port *ap, | 1596 | extern unsigned int ata_sff_host_intr(struct ata_port *ap, |
| @@ -1620,21 +1611,8 @@ extern int sata_sff_hardreset(struct ata_link *link, unsigned int *class, | |||
| 1620 | extern void ata_sff_postreset(struct ata_link *link, unsigned int *classes); | 1611 | extern void ata_sff_postreset(struct ata_link *link, unsigned int *classes); |
| 1621 | extern void ata_sff_drain_fifo(struct ata_queued_cmd *qc); | 1612 | extern void ata_sff_drain_fifo(struct ata_queued_cmd *qc); |
| 1622 | extern void ata_sff_error_handler(struct ata_port *ap); | 1613 | extern void ata_sff_error_handler(struct ata_port *ap); |
| 1623 | extern void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc); | ||
| 1624 | extern int ata_sff_port_start(struct ata_port *ap); | ||
| 1625 | extern int ata_sff_port_start32(struct ata_port *ap); | ||
| 1626 | extern void ata_sff_std_ports(struct ata_ioports *ioaddr); | 1614 | extern void ata_sff_std_ports(struct ata_ioports *ioaddr); |
| 1627 | extern unsigned long ata_bmdma_mode_filter(struct ata_device *dev, | ||
| 1628 | unsigned long xfer_mask); | ||
| 1629 | extern void ata_bmdma_setup(struct ata_queued_cmd *qc); | ||
| 1630 | extern void ata_bmdma_start(struct ata_queued_cmd *qc); | ||
| 1631 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | ||
| 1632 | extern u8 ata_bmdma_status(struct ata_port *ap); | ||
| 1633 | extern void ata_bus_reset(struct ata_port *ap); | ||
| 1634 | |||
| 1635 | #ifdef CONFIG_PCI | 1615 | #ifdef CONFIG_PCI |
| 1636 | extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev); | ||
| 1637 | extern int ata_pci_bmdma_init(struct ata_host *host); | ||
| 1638 | extern int ata_pci_sff_init_host(struct ata_host *host); | 1616 | extern int ata_pci_sff_init_host(struct ata_host *host); |
| 1639 | extern int ata_pci_sff_prepare_host(struct pci_dev *pdev, | 1617 | extern int ata_pci_sff_prepare_host(struct pci_dev *pdev, |
| 1640 | const struct ata_port_info * const * ppi, | 1618 | const struct ata_port_info * const * ppi, |
| @@ -1647,6 +1625,23 @@ extern int ata_pci_sff_init_one(struct pci_dev *pdev, | |||
| 1647 | struct scsi_host_template *sht, void *host_priv, int hflags); | 1625 | struct scsi_host_template *sht, void *host_priv, int hflags); |
| 1648 | #endif /* CONFIG_PCI */ | 1626 | #endif /* CONFIG_PCI */ |
| 1649 | 1627 | ||
| 1628 | extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc); | ||
| 1629 | extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc); | ||
| 1630 | extern void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc); | ||
| 1631 | extern void ata_bmdma_error_handler(struct ata_port *ap); | ||
| 1632 | extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc); | ||
| 1633 | extern void ata_bmdma_setup(struct ata_queued_cmd *qc); | ||
| 1634 | extern void ata_bmdma_start(struct ata_queued_cmd *qc); | ||
| 1635 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | ||
| 1636 | extern u8 ata_bmdma_status(struct ata_port *ap); | ||
| 1637 | extern int ata_bmdma_port_start(struct ata_port *ap); | ||
| 1638 | extern int ata_bmdma_port_start32(struct ata_port *ap); | ||
| 1639 | |||
| 1640 | #ifdef CONFIG_PCI | ||
| 1641 | extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev); | ||
| 1642 | extern void ata_pci_bmdma_init(struct ata_host *host); | ||
| 1643 | #endif /* CONFIG_PCI */ | ||
| 1644 | |||
| 1650 | /** | 1645 | /** |
| 1651 | * ata_sff_busy_wait - Wait for a port status register | 1646 | * ata_sff_busy_wait - Wait for a port status register |
| 1652 | * @ap: Port to wait for. | 1647 | * @ap: Port to wait for. |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 10206a87da19..06aed8305bf3 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
| @@ -12,6 +12,10 @@ | |||
| 12 | struct task_struct; | 12 | struct task_struct; |
| 13 | struct lockdep_map; | 13 | struct lockdep_map; |
| 14 | 14 | ||
| 15 | /* for sysctl */ | ||
| 16 | extern int prove_locking; | ||
| 17 | extern int lock_stat; | ||
| 18 | |||
| 15 | #ifdef CONFIG_LOCKDEP | 19 | #ifdef CONFIG_LOCKDEP |
| 16 | 20 | ||
| 17 | #include <linux/linkage.h> | 21 | #include <linux/linkage.h> |
| @@ -40,6 +44,8 @@ struct lock_class_key { | |||
| 40 | struct lockdep_subclass_key subkeys[MAX_LOCKDEP_SUBCLASSES]; | 44 | struct lockdep_subclass_key subkeys[MAX_LOCKDEP_SUBCLASSES]; |
| 41 | }; | 45 | }; |
| 42 | 46 | ||
| 47 | extern struct lock_class_key __lockdep_no_validate__; | ||
| 48 | |||
| 43 | #define LOCKSTAT_POINTS 4 | 49 | #define LOCKSTAT_POINTS 4 |
| 44 | 50 | ||
| 45 | /* | 51 | /* |
| @@ -266,6 +272,9 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name, | |||
| 266 | #define lockdep_set_subclass(lock, sub) \ | 272 | #define lockdep_set_subclass(lock, sub) \ |
| 267 | lockdep_init_map(&(lock)->dep_map, #lock, \ | 273 | lockdep_init_map(&(lock)->dep_map, #lock, \ |
| 268 | (lock)->dep_map.key, sub) | 274 | (lock)->dep_map.key, sub) |
| 275 | |||
| 276 | #define lockdep_set_novalidate_class(lock) \ | ||
| 277 | lockdep_set_class(lock, &__lockdep_no_validate__) | ||
| 269 | /* | 278 | /* |
| 270 | * Compare locking classes | 279 | * Compare locking classes |
| 271 | */ | 280 | */ |
| @@ -350,6 +359,9 @@ static inline void lockdep_on(void) | |||
| 350 | #define lockdep_set_class_and_subclass(lock, key, sub) \ | 359 | #define lockdep_set_class_and_subclass(lock, key, sub) \ |
| 351 | do { (void)(key); } while (0) | 360 | do { (void)(key); } while (0) |
| 352 | #define lockdep_set_subclass(lock, sub) do { } while (0) | 361 | #define lockdep_set_subclass(lock, sub) do { } while (0) |
| 362 | |||
| 363 | #define lockdep_set_novalidate_class(lock) do { } while (0) | ||
| 364 | |||
| 353 | /* | 365 | /* |
| 354 | * We don't define lockdep_match_class() and lockdep_match_key() for !LOCKDEP | 366 | * We don't define lockdep_match_class() and lockdep_match_key() for !LOCKDEP |
| 355 | * case since the result is not well defined and the caller should rather | 367 | * case since the result is not well defined and the caller should rather |
diff --git a/include/linux/lru_cache.h b/include/linux/lru_cache.h index 3a2b2d9b0472..de48d167568b 100644 --- a/include/linux/lru_cache.h +++ b/include/linux/lru_cache.h | |||
| @@ -64,7 +64,7 @@ For crash recovery after replication node failure, | |||
| 64 | usually the condition is softened to regions that _may_ have been target of | 64 | usually the condition is softened to regions that _may_ have been target of |
| 65 | in-flight WRITE IO, e.g. by only lazily clearing the on-disk write-intent | 65 | in-flight WRITE IO, e.g. by only lazily clearing the on-disk write-intent |
| 66 | bitmap, trading frequency of meta data transactions against amount of | 66 | bitmap, trading frequency of meta data transactions against amount of |
| 67 | (possibly unneccessary) resync traffic. | 67 | (possibly unnecessary) resync traffic. |
| 68 | 68 | ||
| 69 | If we set a hard limit on the area that may be "hot" at any given time, we | 69 | If we set a hard limit on the area that may be "hot" at any given time, we |
| 70 | limit the amount of resync traffic needed for crash recovery. | 70 | limit the amount of resync traffic needed for crash recovery. |
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h index f78f83d7663f..6907251d5200 100644 --- a/include/linux/lsm_audit.h +++ b/include/linux/lsm_audit.h | |||
| @@ -33,7 +33,7 @@ struct common_audit_data { | |||
| 33 | #define LSM_AUDIT_DATA_IPC 4 | 33 | #define LSM_AUDIT_DATA_IPC 4 |
| 34 | #define LSM_AUDIT_DATA_TASK 5 | 34 | #define LSM_AUDIT_DATA_TASK 5 |
| 35 | #define LSM_AUDIT_DATA_KEY 6 | 35 | #define LSM_AUDIT_DATA_KEY 6 |
| 36 | #define LSM_AUDIT_NO_AUDIT 7 | 36 | #define LSM_AUDIT_DATA_NONE 7 |
| 37 | #define LSM_AUDIT_DATA_KMOD 8 | 37 | #define LSM_AUDIT_DATA_KMOD 8 |
| 38 | struct task_struct *tsk; | 38 | struct task_struct *tsk; |
| 39 | union { | 39 | union { |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 1f9b119f4ace..44301c6affa8 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
| @@ -124,7 +124,6 @@ static inline bool mem_cgroup_disabled(void) | |||
| 124 | return false; | 124 | return false; |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | extern bool mem_cgroup_oom_called(struct task_struct *task); | ||
| 128 | void mem_cgroup_update_file_mapped(struct page *page, int val); | 127 | void mem_cgroup_update_file_mapped(struct page *page, int val); |
| 129 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | 128 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, |
| 130 | gfp_t gfp_mask, int nid, | 129 | gfp_t gfp_mask, int nid, |
| @@ -258,11 +257,6 @@ static inline bool mem_cgroup_disabled(void) | |||
| 258 | return true; | 257 | return true; |
| 259 | } | 258 | } |
| 260 | 259 | ||
| 261 | static inline bool mem_cgroup_oom_called(struct task_struct *task) | ||
| 262 | { | ||
| 263 | return false; | ||
| 264 | } | ||
| 265 | |||
| 266 | static inline int | 260 | static inline int |
| 267 | mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg) | 261 | mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg) |
| 268 | { | 262 | { |
diff --git a/include/linux/memory.h b/include/linux/memory.h index 1adfe779eb99..85582e1bcee9 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
| @@ -36,6 +36,8 @@ struct memory_block { | |||
| 36 | struct sys_device sysdev; | 36 | struct sys_device sysdev; |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | int arch_get_memory_phys_device(unsigned long start_pfn); | ||
| 40 | |||
| 39 | /* These states are exposed to userspace as text strings in sysfs */ | 41 | /* These states are exposed to userspace as text strings in sysfs */ |
| 40 | #define MEM_ONLINE (1<<0) /* exposed to userspace */ | 42 | #define MEM_ONLINE (1<<0) /* exposed to userspace */ |
| 41 | #define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */ | 43 | #define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */ |
diff --git a/include/linux/meye.h b/include/linux/meye.h index 12010ace1f04..0dd49954f746 100644 --- a/include/linux/meye.h +++ b/include/linux/meye.h | |||
| @@ -44,17 +44,17 @@ struct meye_params { | |||
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| 46 | /* query the extended parameters */ | 46 | /* query the extended parameters */ |
| 47 | #define MEYEIOC_G_PARAMS _IOR ('v', BASE_VIDIOCPRIVATE+0, struct meye_params) | 47 | #define MEYEIOC_G_PARAMS _IOR ('v', BASE_VIDIOC_PRIVATE+0, struct meye_params) |
| 48 | /* set the extended parameters */ | 48 | /* set the extended parameters */ |
| 49 | #define MEYEIOC_S_PARAMS _IOW ('v', BASE_VIDIOCPRIVATE+1, struct meye_params) | 49 | #define MEYEIOC_S_PARAMS _IOW ('v', BASE_VIDIOC_PRIVATE+1, struct meye_params) |
| 50 | /* queue a buffer for mjpeg capture */ | 50 | /* queue a buffer for mjpeg capture */ |
| 51 | #define MEYEIOC_QBUF_CAPT _IOW ('v', BASE_VIDIOCPRIVATE+2, int) | 51 | #define MEYEIOC_QBUF_CAPT _IOW ('v', BASE_VIDIOC_PRIVATE+2, int) |
| 52 | /* sync a previously queued mjpeg buffer */ | 52 | /* sync a previously queued mjpeg buffer */ |
| 53 | #define MEYEIOC_SYNC _IOWR('v', BASE_VIDIOCPRIVATE+3, int) | 53 | #define MEYEIOC_SYNC _IOWR('v', BASE_VIDIOC_PRIVATE+3, int) |
| 54 | /* get a still uncompressed snapshot */ | 54 | /* get a still uncompressed snapshot */ |
| 55 | #define MEYEIOC_STILLCAPT _IO ('v', BASE_VIDIOCPRIVATE+4) | 55 | #define MEYEIOC_STILLCAPT _IO ('v', BASE_VIDIOC_PRIVATE+4) |
| 56 | /* get a jpeg compressed snapshot */ | 56 | /* get a jpeg compressed snapshot */ |
| 57 | #define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOCPRIVATE+5, int) | 57 | #define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOC_PRIVATE+5, int) |
| 58 | 58 | ||
| 59 | /* V4L2 private controls */ | 59 | /* V4L2 private controls */ |
| 60 | #define V4L2_CID_AGC V4L2_CID_PRIVATE_BASE | 60 | #define V4L2_CID_AGC V4L2_CID_PRIVATE_BASE |
diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h new file mode 100644 index 000000000000..0ab61320ffa8 --- /dev/null +++ b/include/linux/mfd/davinci_voicecodec.h | |||
| @@ -0,0 +1,126 @@ | |||
| 1 | /* | ||
| 2 | * DaVinci Voice Codec Core Interface for TI platforms | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Texas Instruments, Inc | ||
| 5 | * | ||
| 6 | * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef __LINUX_MFD_DAVINCI_VOICECODEC_H_ | ||
| 24 | #define __LINUX_MFD_DAVINIC_VOICECODEC_H_ | ||
| 25 | |||
| 26 | #include <linux/kernel.h> | ||
| 27 | #include <linux/platform_device.h> | ||
| 28 | #include <linux/mfd/core.h> | ||
| 29 | |||
| 30 | #include <mach/edma.h> | ||
| 31 | |||
| 32 | /* | ||
| 33 | * Register values. | ||
| 34 | */ | ||
| 35 | #define DAVINCI_VC_PID 0x00 | ||
| 36 | #define DAVINCI_VC_CTRL 0x04 | ||
| 37 | #define DAVINCI_VC_INTEN 0x08 | ||
| 38 | #define DAVINCI_VC_INTSTATUS 0x0c | ||
| 39 | #define DAVINCI_VC_INTCLR 0x10 | ||
| 40 | #define DAVINCI_VC_EMUL_CTRL 0x14 | ||
| 41 | #define DAVINCI_VC_RFIFO 0x20 | ||
| 42 | #define DAVINCI_VC_WFIFO 0x24 | ||
| 43 | #define DAVINCI_VC_FIFOSTAT 0x28 | ||
| 44 | #define DAVINCI_VC_TST_CTRL 0x2C | ||
| 45 | #define DAVINCI_VC_REG05 0x94 | ||
| 46 | #define DAVINCI_VC_REG09 0xA4 | ||
| 47 | #define DAVINCI_VC_REG12 0xB0 | ||
| 48 | |||
| 49 | /* DAVINCI_VC_CTRL bit fields */ | ||
| 50 | #define DAVINCI_VC_CTRL_MASK 0x5500 | ||
| 51 | #define DAVINCI_VC_CTRL_RSTADC BIT(0) | ||
| 52 | #define DAVINCI_VC_CTRL_RSTDAC BIT(1) | ||
| 53 | #define DAVINCI_VC_CTRL_RD_BITS_8 BIT(4) | ||
| 54 | #define DAVINCI_VC_CTRL_RD_UNSIGNED BIT(5) | ||
| 55 | #define DAVINCI_VC_CTRL_WD_BITS_8 BIT(6) | ||
| 56 | #define DAVINCI_VC_CTRL_WD_UNSIGNED BIT(7) | ||
| 57 | #define DAVINCI_VC_CTRL_RFIFOEN BIT(8) | ||
| 58 | #define DAVINCI_VC_CTRL_RFIFOCL BIT(9) | ||
| 59 | #define DAVINCI_VC_CTRL_RFIFOMD_WORD_1 BIT(10) | ||
| 60 | #define DAVINCI_VC_CTRL_WFIFOEN BIT(12) | ||
| 61 | #define DAVINCI_VC_CTRL_WFIFOCL BIT(13) | ||
| 62 | #define DAVINCI_VC_CTRL_WFIFOMD_WORD_1 BIT(14) | ||
| 63 | |||
| 64 | /* DAVINCI_VC_INT bit fields */ | ||
| 65 | #define DAVINCI_VC_INT_MASK 0x3F | ||
| 66 | #define DAVINCI_VC_INT_RDRDY_MASK BIT(0) | ||
| 67 | #define DAVINCI_VC_INT_RERROVF_MASK BIT(1) | ||
| 68 | #define DAVINCI_VC_INT_RERRUDR_MASK BIT(2) | ||
| 69 | #define DAVINCI_VC_INT_WDREQ_MASK BIT(3) | ||
| 70 | #define DAVINCI_VC_INT_WERROVF_MASKBIT BIT(4) | ||
| 71 | #define DAVINCI_VC_INT_WERRUDR_MASK BIT(5) | ||
| 72 | |||
| 73 | /* DAVINCI_VC_REG05 bit fields */ | ||
| 74 | #define DAVINCI_VC_REG05_PGA_GAIN 0x07 | ||
| 75 | |||
| 76 | /* DAVINCI_VC_REG09 bit fields */ | ||
| 77 | #define DAVINCI_VC_REG09_MUTE 0x40 | ||
| 78 | #define DAVINCI_VC_REG09_DIG_ATTEN 0x3F | ||
| 79 | |||
| 80 | /* DAVINCI_VC_REG12 bit fields */ | ||
| 81 | #define DAVINCI_VC_REG12_POWER_ALL_ON 0xFD | ||
| 82 | #define DAVINCI_VC_REG12_POWER_ALL_OFF 0x00 | ||
| 83 | |||
| 84 | #define DAVINCI_VC_CELLS 2 | ||
| 85 | |||
| 86 | enum davinci_vc_cells { | ||
| 87 | DAVINCI_VC_VCIF_CELL, | ||
| 88 | DAVINCI_VC_CQ93VC_CELL, | ||
| 89 | }; | ||
| 90 | |||
| 91 | struct davinci_vcif { | ||
| 92 | struct platform_device *pdev; | ||
| 93 | u32 dma_tx_channel; | ||
| 94 | u32 dma_rx_channel; | ||
| 95 | dma_addr_t dma_tx_addr; | ||
| 96 | dma_addr_t dma_rx_addr; | ||
| 97 | }; | ||
| 98 | |||
| 99 | struct cq93vc { | ||
| 100 | struct platform_device *pdev; | ||
| 101 | struct snd_soc_codec *codec; | ||
| 102 | u32 sysclk; | ||
| 103 | }; | ||
| 104 | |||
| 105 | struct davinci_vc; | ||
| 106 | |||
| 107 | struct davinci_vc { | ||
| 108 | /* Device data */ | ||
| 109 | struct device *dev; | ||
| 110 | struct platform_device *pdev; | ||
| 111 | struct clk *clk; | ||
| 112 | |||
| 113 | /* Memory resources */ | ||
| 114 | void __iomem *base; | ||
| 115 | resource_size_t pbase; | ||
| 116 | size_t base_size; | ||
| 117 | |||
| 118 | /* MFD cells */ | ||
| 119 | struct mfd_cell cells[DAVINCI_VC_CELLS]; | ||
| 120 | |||
| 121 | /* Client devices */ | ||
| 122 | struct davinci_vcif davinci_vcif; | ||
| 123 | struct cq93vc cq93vc; | ||
| 124 | }; | ||
| 125 | |||
| 126 | #endif | ||
diff --git a/include/linux/mfd/wm8350/audio.h b/include/linux/mfd/wm8350/audio.h index d899dc0223ba..a95141eafce3 100644 --- a/include/linux/mfd/wm8350/audio.h +++ b/include/linux/mfd/wm8350/audio.h | |||
| @@ -492,6 +492,8 @@ | |||
| 492 | */ | 492 | */ |
| 493 | #define WM8350_JACK_L_LVL 0x0800 | 493 | #define WM8350_JACK_L_LVL 0x0800 |
| 494 | #define WM8350_JACK_R_LVL 0x0400 | 494 | #define WM8350_JACK_R_LVL 0x0400 |
| 495 | #define WM8350_JACK_MICSCD_LVL 0x0200 | ||
| 496 | #define WM8350_JACK_MICSD_LVL 0x0100 | ||
| 495 | 497 | ||
| 496 | /* | 498 | /* |
| 497 | * WM8350 Platform setup | 499 | * WM8350 Platform setup |
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h index b06ff2846748..de79baee4925 100644 --- a/include/linux/mfd/wm8994/core.h +++ b/include/linux/mfd/wm8994/core.h | |||
| @@ -15,14 +15,38 @@ | |||
| 15 | #ifndef __MFD_WM8994_CORE_H__ | 15 | #ifndef __MFD_WM8994_CORE_H__ |
| 16 | #define __MFD_WM8994_CORE_H__ | 16 | #define __MFD_WM8994_CORE_H__ |
| 17 | 17 | ||
| 18 | #include <linux/interrupt.h> | ||
| 19 | |||
| 18 | struct regulator_dev; | 20 | struct regulator_dev; |
| 19 | struct regulator_bulk_data; | 21 | struct regulator_bulk_data; |
| 20 | 22 | ||
| 21 | #define WM8994_NUM_GPIO_REGS 11 | 23 | #define WM8994_NUM_GPIO_REGS 11 |
| 22 | #define WM8994_NUM_LDO_REGS 2 | 24 | #define WM8994_NUM_LDO_REGS 2 |
| 25 | #define WM8994_NUM_IRQ_REGS 2 | ||
| 26 | |||
| 27 | #define WM8994_IRQ_TEMP_SHUT 0 | ||
| 28 | #define WM8994_IRQ_MIC1_DET 1 | ||
| 29 | #define WM8994_IRQ_MIC1_SHRT 2 | ||
| 30 | #define WM8994_IRQ_MIC2_DET 3 | ||
| 31 | #define WM8994_IRQ_MIC2_SHRT 4 | ||
| 32 | #define WM8994_IRQ_FLL1_LOCK 5 | ||
| 33 | #define WM8994_IRQ_FLL2_LOCK 6 | ||
| 34 | #define WM8994_IRQ_SRC1_LOCK 7 | ||
| 35 | #define WM8994_IRQ_SRC2_LOCK 8 | ||
| 36 | #define WM8994_IRQ_AIF1DRC1_SIG_DET 9 | ||
| 37 | #define WM8994_IRQ_AIF1DRC2_SIG_DET 10 | ||
| 38 | #define WM8994_IRQ_AIF2DRC_SIG_DET 11 | ||
| 39 | #define WM8994_IRQ_FIFOS_ERR 12 | ||
| 40 | #define WM8994_IRQ_WSEQ_DONE 13 | ||
| 41 | #define WM8994_IRQ_DCS_DONE 14 | ||
| 42 | #define WM8994_IRQ_TEMP_WARN 15 | ||
| 43 | |||
| 44 | /* GPIOs in the chip are numbered from 1-11 */ | ||
| 45 | #define WM8994_IRQ_GPIO(x) (x + WM8994_IRQ_TEMP_WARN) | ||
| 23 | 46 | ||
| 24 | struct wm8994 { | 47 | struct wm8994 { |
| 25 | struct mutex io_lock; | 48 | struct mutex io_lock; |
| 49 | struct mutex irq_lock; | ||
| 26 | 50 | ||
| 27 | struct device *dev; | 51 | struct device *dev; |
| 28 | int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, | 52 | int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, |
| @@ -33,6 +57,11 @@ struct wm8994 { | |||
| 33 | void *control_data; | 57 | void *control_data; |
| 34 | 58 | ||
| 35 | int gpio_base; | 59 | int gpio_base; |
| 60 | int irq_base; | ||
| 61 | |||
| 62 | int irq; | ||
| 63 | u16 irq_masks_cur[WM8994_NUM_IRQ_REGS]; | ||
| 64 | u16 irq_masks_cache[WM8994_NUM_IRQ_REGS]; | ||
| 36 | 65 | ||
| 37 | /* Used over suspend/resume */ | 66 | /* Used over suspend/resume */ |
| 38 | u16 ldo_regs[WM8994_NUM_LDO_REGS]; | 67 | u16 ldo_regs[WM8994_NUM_LDO_REGS]; |
| @@ -51,4 +80,26 @@ int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg, | |||
| 51 | int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, | 80 | int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, |
| 52 | int count, u16 *buf); | 81 | int count, u16 *buf); |
| 53 | 82 | ||
| 83 | |||
| 84 | /* Helper to save on boilerplate */ | ||
| 85 | static inline int wm8994_request_irq(struct wm8994 *wm8994, int irq, | ||
| 86 | irq_handler_t handler, const char *name, | ||
| 87 | void *data) | ||
| 88 | { | ||
| 89 | if (!wm8994->irq_base) | ||
| 90 | return -EINVAL; | ||
| 91 | return request_threaded_irq(wm8994->irq_base + irq, NULL, handler, | ||
| 92 | IRQF_TRIGGER_RISING, name, | ||
| 93 | data); | ||
| 94 | } | ||
| 95 | static inline void wm8994_free_irq(struct wm8994 *wm8994, int irq, void *data) | ||
| 96 | { | ||
| 97 | if (!wm8994->irq_base) | ||
| 98 | return; | ||
| 99 | free_irq(wm8994->irq_base + irq, data); | ||
| 100 | } | ||
| 101 | |||
| 102 | int wm8994_irq_init(struct wm8994 *wm8994); | ||
| 103 | void wm8994_irq_exit(struct wm8994 *wm8994); | ||
| 104 | |||
| 54 | #endif | 105 | #endif |
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index 70d6a8687dc5..5c51f367c061 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h | |||
| @@ -70,6 +70,7 @@ struct wm8994_pdata { | |||
| 70 | 70 | ||
| 71 | struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; | 71 | struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; |
| 72 | 72 | ||
| 73 | int irq_base; /** Base IRQ number for WM8994, required for IRQs */ | ||
| 73 | 74 | ||
| 74 | int num_drc_cfgs; | 75 | int num_drc_cfgs; |
| 75 | struct wm8994_drc_cfg *drc_cfgs; | 76 | struct wm8994_drc_cfg *drc_cfgs; |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index e92d1bfdb330..7a7f9c1e679a 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -123,8 +123,8 @@ enum { | |||
| 123 | MLX4_OPCODE_RDMA_READ = 0x10, | 123 | MLX4_OPCODE_RDMA_READ = 0x10, |
| 124 | MLX4_OPCODE_ATOMIC_CS = 0x11, | 124 | MLX4_OPCODE_ATOMIC_CS = 0x11, |
| 125 | MLX4_OPCODE_ATOMIC_FA = 0x12, | 125 | MLX4_OPCODE_ATOMIC_FA = 0x12, |
| 126 | MLX4_OPCODE_ATOMIC_MASK_CS = 0x14, | 126 | MLX4_OPCODE_MASKED_ATOMIC_CS = 0x14, |
| 127 | MLX4_OPCODE_ATOMIC_MASK_FA = 0x15, | 127 | MLX4_OPCODE_MASKED_ATOMIC_FA = 0x15, |
| 128 | MLX4_OPCODE_BIND_MW = 0x18, | 128 | MLX4_OPCODE_BIND_MW = 0x18, |
| 129 | MLX4_OPCODE_FMR = 0x19, | 129 | MLX4_OPCODE_FMR = 0x19, |
| 130 | MLX4_OPCODE_LOCAL_INVAL = 0x1b, | 130 | MLX4_OPCODE_LOCAL_INVAL = 0x1b, |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 9f29d86e5dc9..7abe64326f72 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
| @@ -285,6 +285,13 @@ struct mlx4_wqe_atomic_seg { | |||
| 285 | __be64 compare; | 285 | __be64 compare; |
| 286 | }; | 286 | }; |
| 287 | 287 | ||
| 288 | struct mlx4_wqe_masked_atomic_seg { | ||
| 289 | __be64 swap_add; | ||
| 290 | __be64 compare; | ||
| 291 | __be64 swap_add_mask; | ||
| 292 | __be64 compare_mask; | ||
| 293 | }; | ||
| 294 | |||
| 288 | struct mlx4_wqe_data_seg { | 295 | struct mlx4_wqe_data_seg { |
| 289 | __be32 byte_count; | 296 | __be32 byte_count; |
| 290 | __be32 lkey; | 297 | __be32 lkey; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 3899395a03de..fb19bb92b809 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -19,7 +19,6 @@ struct anon_vma; | |||
| 19 | struct file_ra_state; | 19 | struct file_ra_state; |
| 20 | struct user_struct; | 20 | struct user_struct; |
| 21 | struct writeback_control; | 21 | struct writeback_control; |
| 22 | struct rlimit; | ||
| 23 | 22 | ||
| 24 | #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ | 23 | #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ |
| 25 | extern unsigned long max_mapnr; | 24 | extern unsigned long max_mapnr; |
| @@ -783,8 +782,8 @@ struct mm_walk { | |||
| 783 | int (*pmd_entry)(pmd_t *, unsigned long, unsigned long, struct mm_walk *); | 782 | int (*pmd_entry)(pmd_t *, unsigned long, unsigned long, struct mm_walk *); |
| 784 | int (*pte_entry)(pte_t *, unsigned long, unsigned long, struct mm_walk *); | 783 | int (*pte_entry)(pte_t *, unsigned long, unsigned long, struct mm_walk *); |
| 785 | int (*pte_hole)(unsigned long, unsigned long, struct mm_walk *); | 784 | int (*pte_hole)(unsigned long, unsigned long, struct mm_walk *); |
| 786 | int (*hugetlb_entry)(pte_t *, unsigned long, unsigned long, | 785 | int (*hugetlb_entry)(pte_t *, unsigned long, |
| 787 | struct mm_walk *); | 786 | unsigned long, unsigned long, struct mm_walk *); |
| 788 | struct mm_struct *mm; | 787 | struct mm_struct *mm; |
| 789 | void *private; | 788 | void *private; |
| 790 | }; | 789 | }; |
| @@ -971,7 +970,13 @@ static inline void setmax_mm_hiwater_rss(unsigned long *maxrss, | |||
| 971 | *maxrss = hiwater_rss; | 970 | *maxrss = hiwater_rss; |
| 972 | } | 971 | } |
| 973 | 972 | ||
| 973 | #if defined(SPLIT_RSS_COUNTING) | ||
| 974 | void sync_mm_rss(struct task_struct *task, struct mm_struct *mm); | 974 | void sync_mm_rss(struct task_struct *task, struct mm_struct *mm); |
| 975 | #else | ||
| 976 | static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm) | ||
| 977 | { | ||
| 978 | } | ||
| 979 | #endif | ||
| 975 | 980 | ||
| 976 | /* | 981 | /* |
| 977 | * A callback you can register to apply pressure to ageable caches. | 982 | * A callback you can register to apply pressure to ageable caches. |
| @@ -1443,9 +1448,6 @@ int vmemmap_populate_basepages(struct page *start_page, | |||
| 1443 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); | 1448 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); |
| 1444 | void vmemmap_populate_print_last(void); | 1449 | void vmemmap_populate_print_last(void); |
| 1445 | 1450 | ||
| 1446 | extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim, | ||
| 1447 | size_t size); | ||
| 1448 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); | ||
| 1449 | 1451 | ||
| 1450 | enum mf_flags { | 1452 | enum mf_flags { |
| 1451 | MF_COUNT_INCREASED = 1 << 0, | 1453 | MF_COUNT_INCREASED = 1 << 0, |
| @@ -1459,5 +1461,7 @@ extern void shake_page(struct page *p, int access); | |||
| 1459 | extern atomic_long_t mce_bad_pages; | 1461 | extern atomic_long_t mce_bad_pages; |
| 1460 | extern int soft_offline_page(struct page *page, int flags); | 1462 | extern int soft_offline_page(struct page *page, int flags); |
| 1461 | 1463 | ||
| 1464 | extern void dump_page(struct page *page); | ||
| 1465 | |||
| 1462 | #endif /* __KERNEL__ */ | 1466 | #endif /* __KERNEL__ */ |
| 1463 | #endif /* _LINUX_MM_H */ | 1467 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 048b46270aa5..b8bb9a6a1f37 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -203,7 +203,7 @@ enum { | |||
| 203 | NR_MM_COUNTERS | 203 | NR_MM_COUNTERS |
| 204 | }; | 204 | }; |
| 205 | 205 | ||
| 206 | #if USE_SPLIT_PTLOCKS | 206 | #if USE_SPLIT_PTLOCKS && defined(CONFIG_MMU) |
| 207 | #define SPLIT_RSS_COUNTING | 207 | #define SPLIT_RSS_COUNTING |
| 208 | struct mm_rss_stat { | 208 | struct mm_rss_stat { |
| 209 | atomic_long_t count[NR_MM_COUNTERS]; | 209 | atomic_long_t count[NR_MM_COUNTERS]; |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index c02c8db73701..8a49cbf0376d 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
| @@ -268,6 +268,7 @@ struct _mmc_csd { | |||
| 268 | 268 | ||
| 269 | #define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ | 269 | #define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ |
| 270 | #define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ | 270 | #define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ |
| 271 | #define EXT_CSD_CARD_TYPE_MASK 0x3 /* Mask out reserved and DDR bits */ | ||
| 271 | 272 | ||
| 272 | #define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ | 273 | #define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ |
| 273 | #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ | 274 | #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ |
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h index 0ebaef577ff5..329a8faa6e37 100644 --- a/include/linux/mmc/sdio.h +++ b/include/linux/mmc/sdio.h | |||
| @@ -94,6 +94,8 @@ | |||
| 94 | 94 | ||
| 95 | #define SDIO_BUS_WIDTH_1BIT 0x00 | 95 | #define SDIO_BUS_WIDTH_1BIT 0x00 |
| 96 | #define SDIO_BUS_WIDTH_4BIT 0x02 | 96 | #define SDIO_BUS_WIDTH_4BIT 0x02 |
| 97 | #define SDIO_BUS_ECSI 0x20 /* Enable continuous SPI interrupt */ | ||
| 98 | #define SDIO_BUS_SCSI 0x40 /* Support continuous SPI interrupt */ | ||
| 97 | 99 | ||
| 98 | #define SDIO_BUS_ASYNC_INT 0x20 | 100 | #define SDIO_BUS_ASYNC_INT 0x20 |
| 99 | 101 | ||
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index bc209d8b7b5c..cf9e458e96b0 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -342,7 +342,7 @@ struct zone { | |||
| 342 | * prev_priority holds the scanning priority for this zone. It is | 342 | * prev_priority holds the scanning priority for this zone. It is |
| 343 | * defined as the scanning priority at which we achieved our reclaim | 343 | * defined as the scanning priority at which we achieved our reclaim |
| 344 | * target at the previous try_to_free_pages() or balance_pgdat() | 344 | * target at the previous try_to_free_pages() or balance_pgdat() |
| 345 | * invokation. | 345 | * invocation. |
| 346 | * | 346 | * |
| 347 | * We use prev_priority as a measure of how much stress page reclaim is | 347 | * We use prev_priority as a measure of how much stress page reclaim is |
| 348 | * under - it drives the swappiness decision: whether to unmap mapped | 348 | * under - it drives the swappiness decision: whether to unmap mapped |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index f58e9d836f32..007fbaafead0 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -474,4 +474,39 @@ struct platform_device_id { | |||
| 474 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | 474 | __attribute__((aligned(sizeof(kernel_ulong_t)))); |
| 475 | }; | 475 | }; |
| 476 | 476 | ||
| 477 | #define MDIO_MODULE_PREFIX "mdio:" | ||
| 478 | |||
| 479 | #define MDIO_ID_FMT "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d" | ||
| 480 | #define MDIO_ID_ARGS(_id) \ | ||
| 481 | (_id)>>31, ((_id)>>30) & 1, ((_id)>>29) & 1, ((_id)>>28) & 1, \ | ||
| 482 | ((_id)>>27) & 1, ((_id)>>26) & 1, ((_id)>>25) & 1, ((_id)>>24) & 1, \ | ||
| 483 | ((_id)>>23) & 1, ((_id)>>22) & 1, ((_id)>>21) & 1, ((_id)>>20) & 1, \ | ||
| 484 | ((_id)>>19) & 1, ((_id)>>18) & 1, ((_id)>>17) & 1, ((_id)>>16) & 1, \ | ||
| 485 | ((_id)>>15) & 1, ((_id)>>14) & 1, ((_id)>>13) & 1, ((_id)>>12) & 1, \ | ||
| 486 | ((_id)>>11) & 1, ((_id)>>10) & 1, ((_id)>>9) & 1, ((_id)>>8) & 1, \ | ||
| 487 | ((_id)>>7) & 1, ((_id)>>6) & 1, ((_id)>>5) & 1, ((_id)>>4) & 1, \ | ||
| 488 | ((_id)>>3) & 1, ((_id)>>2) & 1, ((_id)>>1) & 1, (_id) & 1 | ||
| 489 | |||
| 490 | /** | ||
| 491 | * struct mdio_device_id - identifies PHY devices on an MDIO/MII bus | ||
| 492 | * @phy_id: The result of | ||
| 493 | * (mdio_read(&MII_PHYSID1) << 16 | mdio_read(&PHYSID2)) & @phy_id_mask | ||
| 494 | * for this PHY type | ||
| 495 | * @phy_id_mask: Defines the significant bits of @phy_id. A value of 0 | ||
| 496 | * is used to terminate an array of struct mdio_device_id. | ||
| 497 | */ | ||
| 498 | struct mdio_device_id { | ||
| 499 | __u32 phy_id; | ||
| 500 | __u32 phy_id_mask; | ||
| 501 | }; | ||
| 502 | |||
| 503 | struct zorro_device_id { | ||
| 504 | __u32 id; /* Device ID or ZORRO_WILDCARD */ | ||
| 505 | kernel_ulong_t driver_data; /* Data private to the driver */ | ||
| 506 | }; | ||
| 507 | |||
| 508 | #define ZORRO_WILDCARD (0xffffffff) /* not official */ | ||
| 509 | |||
| 510 | #define ZORRO_DEVICE_MODALIAS_FMT "zorro:i%08X" | ||
| 511 | |||
| 477 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 512 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/module.h b/include/linux/module.h index dd618eb026aa..6914fcad4673 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -175,6 +175,7 @@ struct notifier_block; | |||
| 175 | 175 | ||
| 176 | #ifdef CONFIG_MODULES | 176 | #ifdef CONFIG_MODULES |
| 177 | 177 | ||
| 178 | extern int modules_disabled; /* for sysctl */ | ||
| 178 | /* Get/put a kernel symbol (calls must be symmetric) */ | 179 | /* Get/put a kernel symbol (calls must be symmetric) */ |
| 179 | void *__symbol_get(const char *symbol); | 180 | void *__symbol_get(const char *symbol); |
| 180 | void *__symbol_get_gpl(const char *symbol); | 181 | void *__symbol_get_gpl(const char *symbol); |
| @@ -329,8 +330,11 @@ struct module | |||
| 329 | struct module_notes_attrs *notes_attrs; | 330 | struct module_notes_attrs *notes_attrs; |
| 330 | #endif | 331 | #endif |
| 331 | 332 | ||
| 333 | #ifdef CONFIG_SMP | ||
| 332 | /* Per-cpu data. */ | 334 | /* Per-cpu data. */ |
| 333 | void *percpu; | 335 | void __percpu *percpu; |
| 336 | unsigned int percpu_size; | ||
| 337 | #endif | ||
| 334 | 338 | ||
| 335 | /* The command line arguments (may be mangled). People like | 339 | /* The command line arguments (may be mangled). People like |
| 336 | keeping pointers to this stuff */ | 340 | keeping pointers to this stuff */ |
| @@ -364,7 +368,8 @@ struct module | |||
| 364 | void (*exit)(void); | 368 | void (*exit)(void); |
| 365 | 369 | ||
| 366 | struct module_ref { | 370 | struct module_ref { |
| 367 | int count; | 371 | unsigned int incs; |
| 372 | unsigned int decs; | ||
| 368 | } __percpu *refptr; | 373 | } __percpu *refptr; |
| 369 | #endif | 374 | #endif |
| 370 | 375 | ||
| @@ -391,6 +396,7 @@ static inline int module_is_live(struct module *mod) | |||
| 391 | struct module *__module_text_address(unsigned long addr); | 396 | struct module *__module_text_address(unsigned long addr); |
| 392 | struct module *__module_address(unsigned long addr); | 397 | struct module *__module_address(unsigned long addr); |
| 393 | bool is_module_address(unsigned long addr); | 398 | bool is_module_address(unsigned long addr); |
| 399 | bool is_module_percpu_address(unsigned long addr); | ||
| 394 | bool is_module_text_address(unsigned long addr); | 400 | bool is_module_text_address(unsigned long addr); |
| 395 | 401 | ||
| 396 | static inline int within_module_core(unsigned long addr, struct module *mod) | 402 | static inline int within_module_core(unsigned long addr, struct module *mod) |
| @@ -458,9 +464,8 @@ static inline void __module_get(struct module *module) | |||
| 458 | { | 464 | { |
| 459 | if (module) { | 465 | if (module) { |
| 460 | preempt_disable(); | 466 | preempt_disable(); |
| 461 | __this_cpu_inc(module->refptr->count); | 467 | __this_cpu_inc(module->refptr->incs); |
| 462 | trace_module_get(module, _THIS_IP_, | 468 | trace_module_get(module, _THIS_IP_); |
| 463 | __this_cpu_read(module->refptr->count)); | ||
| 464 | preempt_enable(); | 469 | preempt_enable(); |
| 465 | } | 470 | } |
| 466 | } | 471 | } |
| @@ -473,11 +478,9 @@ static inline int try_module_get(struct module *module) | |||
| 473 | preempt_disable(); | 478 | preempt_disable(); |
| 474 | 479 | ||
| 475 | if (likely(module_is_live(module))) { | 480 | if (likely(module_is_live(module))) { |
| 476 | __this_cpu_inc(module->refptr->count); | 481 | __this_cpu_inc(module->refptr->incs); |
| 477 | trace_module_get(module, _THIS_IP_, | 482 | trace_module_get(module, _THIS_IP_); |
| 478 | __this_cpu_read(module->refptr->count)); | 483 | } else |
| 479 | } | ||
| 480 | else | ||
| 481 | ret = 0; | 484 | ret = 0; |
| 482 | 485 | ||
| 483 | preempt_enable(); | 486 | preempt_enable(); |
| @@ -562,6 +565,11 @@ static inline bool is_module_address(unsigned long addr) | |||
| 562 | return false; | 565 | return false; |
| 563 | } | 566 | } |
| 564 | 567 | ||
| 568 | static inline bool is_module_percpu_address(unsigned long addr) | ||
| 569 | { | ||
| 570 | return false; | ||
| 571 | } | ||
| 572 | |||
| 565 | static inline bool is_module_text_address(unsigned long addr) | 573 | static inline bool is_module_text_address(unsigned long addr) |
| 566 | { | 574 | { |
| 567 | return false; | 575 | return false; |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index c5f3d53548e2..fa04b246c9ae 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
| @@ -27,7 +27,8 @@ | |||
| 27 | #define MRT_DEL_MFC (MRT_BASE+5) /* Delete a multicast forwarding entry */ | 27 | #define MRT_DEL_MFC (MRT_BASE+5) /* Delete a multicast forwarding entry */ |
| 28 | #define MRT_VERSION (MRT_BASE+6) /* Get the kernel multicast version */ | 28 | #define MRT_VERSION (MRT_BASE+6) /* Get the kernel multicast version */ |
| 29 | #define MRT_ASSERT (MRT_BASE+7) /* Activate PIM assert mode */ | 29 | #define MRT_ASSERT (MRT_BASE+7) /* Activate PIM assert mode */ |
| 30 | #define MRT_PIM (MRT_BASE+8) /* enable PIM code */ | 30 | #define MRT_PIM (MRT_BASE+8) /* enable PIM code */ |
| 31 | #define MRT_TABLE (MRT_BASE+9) /* Specify mroute table ID */ | ||
| 31 | 32 | ||
| 32 | #define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */ | 33 | #define SIOCGETVIFCNT SIOCPROTOPRIVATE /* IP protocol privates */ |
| 33 | #define SIOCGETSGCNT (SIOCPROTOPRIVATE+1) | 34 | #define SIOCGETSGCNT (SIOCPROTOPRIVATE+1) |
| @@ -191,10 +192,7 @@ struct vif_device { | |||
| 191 | #define VIFF_STATIC 0x8000 | 192 | #define VIFF_STATIC 0x8000 |
| 192 | 193 | ||
| 193 | struct mfc_cache { | 194 | struct mfc_cache { |
| 194 | struct mfc_cache *next; /* Next entry on cache line */ | 195 | struct list_head list; |
| 195 | #ifdef CONFIG_NET_NS | ||
| 196 | struct net *mfc_net; | ||
| 197 | #endif | ||
| 198 | __be32 mfc_mcastgrp; /* Group the entry belongs to */ | 196 | __be32 mfc_mcastgrp; /* Group the entry belongs to */ |
| 199 | __be32 mfc_origin; /* Source of packet */ | 197 | __be32 mfc_origin; /* Source of packet */ |
| 200 | vifi_t mfc_parent; /* Source interface */ | 198 | vifi_t mfc_parent; /* Source interface */ |
| @@ -217,18 +215,6 @@ struct mfc_cache { | |||
| 217 | } mfc_un; | 215 | } mfc_un; |
| 218 | }; | 216 | }; |
| 219 | 217 | ||
| 220 | static inline | ||
| 221 | struct net *mfc_net(const struct mfc_cache *mfc) | ||
| 222 | { | ||
| 223 | return read_pnet(&mfc->mfc_net); | ||
| 224 | } | ||
| 225 | |||
| 226 | static inline | ||
| 227 | void mfc_net_set(struct mfc_cache *mfc, struct net *net) | ||
| 228 | { | ||
| 229 | write_pnet(&mfc->mfc_net, hold_net(net)); | ||
| 230 | } | ||
| 231 | |||
| 232 | #define MFC_STATIC 1 | 218 | #define MFC_STATIC 1 |
| 233 | #define MFC_NOTIFY 2 | 219 | #define MFC_NOTIFY 2 |
| 234 | 220 | ||
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index 2caa1a8e525d..6091ab77f388 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
| @@ -24,7 +24,8 @@ | |||
| 24 | #define MRT6_DEL_MFC (MRT6_BASE+5) /* Delete a multicast forwarding entry */ | 24 | #define MRT6_DEL_MFC (MRT6_BASE+5) /* Delete a multicast forwarding entry */ |
| 25 | #define MRT6_VERSION (MRT6_BASE+6) /* Get the kernel multicast version */ | 25 | #define MRT6_VERSION (MRT6_BASE+6) /* Get the kernel multicast version */ |
| 26 | #define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */ | 26 | #define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */ |
| 27 | #define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */ | 27 | #define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */ |
| 28 | #define MRT6_TABLE (MRT6_BASE+9) /* Specify mroute table ID */ | ||
| 28 | 29 | ||
| 29 | #define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */ | 30 | #define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */ |
| 30 | #define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1) | 31 | #define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1) |
| @@ -182,10 +183,7 @@ struct mif_device { | |||
| 182 | #define VIFF_STATIC 0x8000 | 183 | #define VIFF_STATIC 0x8000 |
| 183 | 184 | ||
| 184 | struct mfc6_cache { | 185 | struct mfc6_cache { |
| 185 | struct mfc6_cache *next; /* Next entry on cache line */ | 186 | struct list_head list; |
| 186 | #ifdef CONFIG_NET_NS | ||
| 187 | struct net *mfc6_net; | ||
| 188 | #endif | ||
| 189 | struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */ | 187 | struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */ |
| 190 | struct in6_addr mf6c_origin; /* Source of packet */ | 188 | struct in6_addr mf6c_origin; /* Source of packet */ |
| 191 | mifi_t mf6c_parent; /* Source interface */ | 189 | mifi_t mf6c_parent; /* Source interface */ |
| @@ -208,18 +206,6 @@ struct mfc6_cache { | |||
| 208 | } mfc_un; | 206 | } mfc_un; |
| 209 | }; | 207 | }; |
| 210 | 208 | ||
| 211 | static inline | ||
| 212 | struct net *mfc6_net(const struct mfc6_cache *mfc) | ||
| 213 | { | ||
| 214 | return read_pnet(&mfc->mfc6_net); | ||
| 215 | } | ||
| 216 | |||
| 217 | static inline | ||
| 218 | void mfc6_net_set(struct mfc6_cache *mfc, struct net *net) | ||
| 219 | { | ||
| 220 | write_pnet(&mfc->mfc6_net, hold_net(net)); | ||
| 221 | } | ||
| 222 | |||
| 223 | #define MFC_STATIC 1 | 209 | #define MFC_STATIC 1 |
| 224 | #define MFC_NOTIFY 2 | 210 | #define MFC_NOTIFY 2 |
| 225 | 211 | ||
| @@ -244,14 +230,17 @@ extern int ip6mr_get_route(struct net *net, struct sk_buff *skb, | |||
| 244 | struct rtmsg *rtm, int nowait); | 230 | struct rtmsg *rtm, int nowait); |
| 245 | 231 | ||
| 246 | #ifdef CONFIG_IPV6_MROUTE | 232 | #ifdef CONFIG_IPV6_MROUTE |
| 247 | static inline struct sock *mroute6_socket(struct net *net) | 233 | extern struct sock *mroute6_socket(struct net *net, struct sk_buff *skb); |
| 248 | { | ||
| 249 | return net->ipv6.mroute6_sk; | ||
| 250 | } | ||
| 251 | extern int ip6mr_sk_done(struct sock *sk); | 234 | extern int ip6mr_sk_done(struct sock *sk); |
| 252 | #else | 235 | #else |
| 253 | static inline struct sock *mroute6_socket(struct net *net) { return NULL; } | 236 | static inline struct sock *mroute6_socket(struct net *net, struct sk_buff *skb) |
| 254 | static inline int ip6mr_sk_done(struct sock *sk) { return 0; } | 237 | { |
| 238 | return NULL; | ||
| 239 | } | ||
| 240 | static inline int ip6mr_sk_done(struct sock *sk) | ||
| 241 | { | ||
| 242 | return 0; | ||
| 243 | } | ||
| 255 | #endif | 244 | #endif |
| 256 | #endif | 245 | #endif |
| 257 | 246 | ||
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index ce38f1caa5e1..34066e65fdeb 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #define MSDOS_DPB_BITS 4 /* log2(MSDOS_DPB) */ | 15 | #define MSDOS_DPB_BITS 4 /* log2(MSDOS_DPB) */ |
| 16 | #define MSDOS_DPS (SECTOR_SIZE / sizeof(struct msdos_dir_entry)) | 16 | #define MSDOS_DPS (SECTOR_SIZE / sizeof(struct msdos_dir_entry)) |
| 17 | #define MSDOS_DPS_BITS 4 /* log2(MSDOS_DPS) */ | 17 | #define MSDOS_DPS_BITS 4 /* log2(MSDOS_DPS) */ |
| 18 | #define MSDOS_LONGNAME 256 /* maximum name length */ | ||
| 18 | #define CF_LE_W(v) le16_to_cpu(v) | 19 | #define CF_LE_W(v) le16_to_cpu(v) |
| 19 | #define CF_LE_L(v) le32_to_cpu(v) | 20 | #define CF_LE_L(v) le32_to_cpu(v) |
| 20 | #define CT_LE_W(v) cpu_to_le16(v) | 21 | #define CT_LE_W(v) cpu_to_le16(v) |
| @@ -47,8 +48,8 @@ | |||
| 47 | #define DELETED_FLAG 0xe5 /* marks file as deleted when in name[0] */ | 48 | #define DELETED_FLAG 0xe5 /* marks file as deleted when in name[0] */ |
| 48 | #define IS_FREE(n) (!*(n) || *(n) == DELETED_FLAG) | 49 | #define IS_FREE(n) (!*(n) || *(n) == DELETED_FLAG) |
| 49 | 50 | ||
| 51 | #define FAT_LFN_LEN 255 /* maximum long name length */ | ||
| 50 | #define MSDOS_NAME 11 /* maximum name length */ | 52 | #define MSDOS_NAME 11 /* maximum name length */ |
| 51 | #define MSDOS_LONGNAME 256 /* maximum name length */ | ||
| 52 | #define MSDOS_SLOTS 21 /* max # of slots for short and long names */ | 53 | #define MSDOS_SLOTS 21 /* max # of slots for short and long names */ |
| 53 | #define MSDOS_DOT ". " /* ".", padded to MSDOS_NAME chars */ | 54 | #define MSDOS_DOT ". " /* ".", padded to MSDOS_NAME chars */ |
| 54 | #define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */ | 55 | #define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */ |
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h index 8b4aa0523db7..b481ccd7ff3c 100644 --- a/include/linux/mtd/blktrans.h +++ b/include/linux/mtd/blktrans.h | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | #define __MTD_TRANS_H__ | 9 | #define __MTD_TRANS_H__ |
| 10 | 10 | ||
| 11 | #include <linux/mutex.h> | 11 | #include <linux/mutex.h> |
| 12 | #include <linux/kref.h> | ||
| 13 | #include <linux/sysfs.h> | ||
| 12 | 14 | ||
| 13 | struct hd_geometry; | 15 | struct hd_geometry; |
| 14 | struct mtd_info; | 16 | struct mtd_info; |
| @@ -24,11 +26,16 @@ struct mtd_blktrans_dev { | |||
| 24 | int devnum; | 26 | int devnum; |
| 25 | unsigned long size; | 27 | unsigned long size; |
| 26 | int readonly; | 28 | int readonly; |
| 27 | void *blkcore_priv; /* gendisk in 2.5, devfs_handle in 2.4 */ | 29 | int open; |
| 30 | struct kref ref; | ||
| 31 | struct gendisk *disk; | ||
| 32 | struct attribute_group *disk_attributes; | ||
| 33 | struct task_struct *thread; | ||
| 34 | struct request_queue *rq; | ||
| 35 | spinlock_t queue_lock; | ||
| 36 | void *priv; | ||
| 28 | }; | 37 | }; |
| 29 | 38 | ||
| 30 | struct blkcore_priv; /* Differs for 2.4 and 2.5 kernels; private */ | ||
| 31 | |||
| 32 | struct mtd_blktrans_ops { | 39 | struct mtd_blktrans_ops { |
| 33 | char *name; | 40 | char *name; |
| 34 | int major; | 41 | int major; |
| @@ -60,8 +67,6 @@ struct mtd_blktrans_ops { | |||
| 60 | struct list_head devs; | 67 | struct list_head devs; |
| 61 | struct list_head list; | 68 | struct list_head list; |
| 62 | struct module *owner; | 69 | struct module *owner; |
| 63 | |||
| 64 | struct mtd_blkcore_priv *blkcore_priv; | ||
| 65 | }; | 70 | }; |
| 66 | 71 | ||
| 67 | extern int register_mtd_blktrans(struct mtd_blktrans_ops *tr); | 72 | extern int register_mtd_blktrans(struct mtd_blktrans_ops *tr); |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index df89f4275232..574d9ee066f1 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
| @@ -253,6 +253,7 @@ struct cfi_bri_query { | |||
| 253 | #define P_ID_MITSUBISHI_STD 0x0100 | 253 | #define P_ID_MITSUBISHI_STD 0x0100 |
| 254 | #define P_ID_MITSUBISHI_EXT 0x0101 | 254 | #define P_ID_MITSUBISHI_EXT 0x0101 |
| 255 | #define P_ID_SST_PAGE 0x0102 | 255 | #define P_ID_SST_PAGE 0x0102 |
| 256 | #define P_ID_SST_OLD 0x0701 | ||
| 256 | #define P_ID_INTEL_PERFORMANCE 0x0200 | 257 | #define P_ID_INTEL_PERFORMANCE 0x0200 |
| 257 | #define P_ID_INTEL_DATA 0x0210 | 258 | #define P_ID_INTEL_DATA 0x0210 |
| 258 | #define P_ID_RESERVED 0xffff | 259 | #define P_ID_RESERVED 0xffff |
| @@ -297,7 +298,7 @@ static inline uint32_t cfi_build_cmd_addr(uint32_t cmd_ofs, | |||
| 297 | * and 32bit devices on 16 bit busses | 298 | * and 32bit devices on 16 bit busses |
| 298 | * set the low bit of the alternating bit sequence of the address. | 299 | * set the low bit of the alternating bit sequence of the address. |
| 299 | */ | 300 | */ |
| 300 | if (((type * interleave) > bankwidth) && ((uint8_t)cmd_ofs == 0xaa)) | 301 | if (((type * interleave) > bankwidth) && ((cmd_ofs & 0xff) == 0xaa)) |
| 301 | addr |= (type >> 1)*interleave; | 302 | addr |= (type >> 1)*interleave; |
| 302 | 303 | ||
| 303 | return addr; | 304 | return addr; |
| @@ -515,14 +516,25 @@ struct cfi_fixup { | |||
| 515 | void* param; | 516 | void* param; |
| 516 | }; | 517 | }; |
| 517 | 518 | ||
| 518 | #define CFI_MFR_ANY 0xffff | 519 | #define CFI_MFR_ANY 0xFFFF |
| 519 | #define CFI_ID_ANY 0xffff | 520 | #define CFI_ID_ANY 0xFFFF |
| 520 | 521 | #define CFI_MFR_CONTINUATION 0x007F | |
| 521 | #define CFI_MFR_AMD 0x0001 | 522 | |
| 522 | #define CFI_MFR_INTEL 0x0089 | 523 | #define CFI_MFR_AMD 0x0001 |
| 523 | #define CFI_MFR_ATMEL 0x001F | 524 | #define CFI_MFR_ATMEL 0x001F |
| 524 | #define CFI_MFR_SAMSUNG 0x00EC | 525 | #define CFI_MFR_EON 0x001C |
| 525 | #define CFI_MFR_ST 0x0020 /* STMicroelectronics */ | 526 | #define CFI_MFR_FUJITSU 0x0004 |
| 527 | #define CFI_MFR_HYUNDAI 0x00AD | ||
| 528 | #define CFI_MFR_INTEL 0x0089 | ||
| 529 | #define CFI_MFR_MACRONIX 0x00C2 | ||
| 530 | #define CFI_MFR_NEC 0x0010 | ||
| 531 | #define CFI_MFR_PMC 0x009D | ||
| 532 | #define CFI_MFR_SAMSUNG 0x00EC | ||
| 533 | #define CFI_MFR_SHARP 0x00B0 | ||
| 534 | #define CFI_MFR_SST 0x00BF | ||
| 535 | #define CFI_MFR_ST 0x0020 /* STMicroelectronics */ | ||
| 536 | #define CFI_MFR_TOSHIBA 0x0098 | ||
| 537 | #define CFI_MFR_WINBOND 0x00DA | ||
| 526 | 538 | ||
| 527 | void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups); | 539 | void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups); |
| 528 | 540 | ||
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h index d0bf422ae374..f43e9b49b751 100644 --- a/include/linux/mtd/flashchip.h +++ b/include/linux/mtd/flashchip.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | * has asm/spinlock.h, or 2.4, which has linux/spinlock.h | 15 | * has asm/spinlock.h, or 2.4, which has linux/spinlock.h |
| 16 | */ | 16 | */ |
| 17 | #include <linux/sched.h> | 17 | #include <linux/sched.h> |
| 18 | #include <linux/mutex.h> | ||
| 18 | 19 | ||
| 19 | typedef enum { | 20 | typedef enum { |
| 20 | FL_READY, | 21 | FL_READY, |
| @@ -74,8 +75,7 @@ struct flchip { | |||
| 74 | unsigned int erase_suspended:1; | 75 | unsigned int erase_suspended:1; |
| 75 | unsigned long in_progress_block_addr; | 76 | unsigned long in_progress_block_addr; |
| 76 | 77 | ||
| 77 | spinlock_t *mutex; | 78 | struct mutex mutex; |
| 78 | spinlock_t _spinlock; /* We do it like this because sometimes they'll be shared. */ | ||
| 79 | wait_queue_head_t wq; /* Wait on here when we're waiting for the chip | 79 | wait_queue_head_t wq; /* Wait on here when we're waiting for the chip |
| 80 | to be ready */ | 80 | to be ready */ |
| 81 | int word_write_time; | 81 | int word_write_time; |
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index b981b8772217..de89eca864ce 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
| 8 | #include <linux/list.h> | 8 | #include <linux/list.h> |
| 9 | #include <linux/string.h> | 9 | #include <linux/string.h> |
| 10 | #include <linux/bug.h> | ||
| 10 | 11 | ||
| 11 | #include <linux/mtd/compatmac.h> | 12 | #include <linux/mtd/compatmac.h> |
| 12 | 13 | ||
| @@ -386,6 +387,8 @@ static inline map_word inline_map_read(struct map_info *map, unsigned long ofs) | |||
| 386 | #endif | 387 | #endif |
| 387 | else if (map_bankwidth_is_large(map)) | 388 | else if (map_bankwidth_is_large(map)) |
| 388 | memcpy_fromio(r.x, map->virt+ofs, map->bankwidth); | 389 | memcpy_fromio(r.x, map->virt+ofs, map->bankwidth); |
| 390 | else | ||
| 391 | BUG(); | ||
| 389 | 392 | ||
| 390 | return r; | 393 | return r; |
| 391 | } | 394 | } |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 0f32a9b6ff55..5326435a7571 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | 20 | ||
| 21 | #define MTD_CHAR_MAJOR 90 | 21 | #define MTD_CHAR_MAJOR 90 |
| 22 | #define MTD_BLOCK_MAJOR 31 | 22 | #define MTD_BLOCK_MAJOR 31 |
| 23 | #define MAX_MTD_DEVICES 32 | ||
| 24 | 23 | ||
| 25 | #define MTD_ERASE_PENDING 0x01 | 24 | #define MTD_ERASE_PENDING 0x01 |
| 26 | #define MTD_ERASING 0x02 | 25 | #define MTD_ERASING 0x02 |
| @@ -61,9 +60,7 @@ struct mtd_erase_region_info { | |||
| 61 | * MTD_OOB_PLACE: oob data are placed at the given offset | 60 | * MTD_OOB_PLACE: oob data are placed at the given offset |
| 62 | * MTD_OOB_AUTO: oob data are automatically placed at the free areas | 61 | * MTD_OOB_AUTO: oob data are automatically placed at the free areas |
| 63 | * which are defined by the ecclayout | 62 | * which are defined by the ecclayout |
| 64 | * MTD_OOB_RAW: mode to read raw data+oob in one chunk. The oob data | 63 | * MTD_OOB_RAW: mode to read oob and data without doing ECC checking |
| 65 | * is inserted into the data. Thats a raw image of the | ||
| 66 | * flash contents. | ||
| 67 | */ | 64 | */ |
| 68 | typedef enum { | 65 | typedef enum { |
| 69 | MTD_OOB_PLACE, | 66 | MTD_OOB_PLACE, |
| @@ -290,8 +287,9 @@ extern int add_mtd_device(struct mtd_info *mtd); | |||
| 290 | extern int del_mtd_device (struct mtd_info *mtd); | 287 | extern int del_mtd_device (struct mtd_info *mtd); |
| 291 | 288 | ||
| 292 | extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); | 289 | extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); |
| 290 | extern int __get_mtd_device(struct mtd_info *mtd); | ||
| 291 | extern void __put_mtd_device(struct mtd_info *mtd); | ||
| 293 | extern struct mtd_info *get_mtd_device_nm(const char *name); | 292 | extern struct mtd_info *get_mtd_device_nm(const char *name); |
| 294 | |||
| 295 | extern void put_mtd_device(struct mtd_info *mtd); | 293 | extern void put_mtd_device(struct mtd_info *mtd); |
| 296 | 294 | ||
| 297 | 295 | ||
diff --git a/include/linux/mtd/mtdram.h b/include/linux/mtd/mtdram.h index 04fdc07b7353..68891313875d 100644 --- a/include/linux/mtd/mtdram.h +++ b/include/linux/mtd/mtdram.h | |||
| @@ -3,6 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/mtd/mtd.h> | 4 | #include <linux/mtd/mtd.h> |
| 5 | int mtdram_init_device(struct mtd_info *mtd, void *mapped_address, | 5 | int mtdram_init_device(struct mtd_info *mtd, void *mapped_address, |
| 6 | unsigned long size, char *name); | 6 | unsigned long size, char *name); |
| 7 | 7 | ||
| 8 | #endif /* __MTD_MTDRAM_H__ */ | 8 | #endif /* __MTD_MTDRAM_H__ */ |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index ccab9dfc5217..a81b185e23a7 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -25,11 +25,13 @@ | |||
| 25 | #include <linux/mtd/bbm.h> | 25 | #include <linux/mtd/bbm.h> |
| 26 | 26 | ||
| 27 | struct mtd_info; | 27 | struct mtd_info; |
| 28 | struct nand_flash_dev; | ||
| 28 | /* Scan and identify a NAND device */ | 29 | /* Scan and identify a NAND device */ |
| 29 | extern int nand_scan (struct mtd_info *mtd, int max_chips); | 30 | extern int nand_scan (struct mtd_info *mtd, int max_chips); |
| 30 | /* Separate phases of nand_scan(), allowing board driver to intervene | 31 | /* Separate phases of nand_scan(), allowing board driver to intervene |
| 31 | * and override command or ECC setup according to flash type */ | 32 | * and override command or ECC setup according to flash type */ |
| 32 | extern int nand_scan_ident(struct mtd_info *mtd, int max_chips); | 33 | extern int nand_scan_ident(struct mtd_info *mtd, int max_chips, |
| 34 | struct nand_flash_dev *table); | ||
| 33 | extern int nand_scan_tail(struct mtd_info *mtd); | 35 | extern int nand_scan_tail(struct mtd_info *mtd); |
| 34 | 36 | ||
| 35 | /* Free resources held by the NAND device */ | 37 | /* Free resources held by the NAND device */ |
| @@ -38,6 +40,12 @@ extern void nand_release (struct mtd_info *mtd); | |||
| 38 | /* Internal helper for board drivers which need to override command function */ | 40 | /* Internal helper for board drivers which need to override command function */ |
| 39 | extern void nand_wait_ready(struct mtd_info *mtd); | 41 | extern void nand_wait_ready(struct mtd_info *mtd); |
| 40 | 42 | ||
| 43 | /* locks all blockes present in the device */ | ||
| 44 | extern int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len); | ||
| 45 | |||
| 46 | /* unlocks specified locked blockes */ | ||
| 47 | extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len); | ||
| 48 | |||
| 41 | /* The maximum number of NAND chips in an array */ | 49 | /* The maximum number of NAND chips in an array */ |
| 42 | #define NAND_MAX_CHIPS 8 | 50 | #define NAND_MAX_CHIPS 8 |
| 43 | 51 | ||
| @@ -45,7 +53,7 @@ extern void nand_wait_ready(struct mtd_info *mtd); | |||
| 45 | * is supported now. If you add a chip with bigger oobsize/page | 53 | * is supported now. If you add a chip with bigger oobsize/page |
| 46 | * adjust this accordingly. | 54 | * adjust this accordingly. |
| 47 | */ | 55 | */ |
| 48 | #define NAND_MAX_OOBSIZE 128 | 56 | #define NAND_MAX_OOBSIZE 256 |
| 49 | #define NAND_MAX_PAGESIZE 4096 | 57 | #define NAND_MAX_PAGESIZE 4096 |
| 50 | 58 | ||
| 51 | /* | 59 | /* |
| @@ -82,6 +90,10 @@ extern void nand_wait_ready(struct mtd_info *mtd); | |||
| 82 | #define NAND_CMD_ERASE2 0xd0 | 90 | #define NAND_CMD_ERASE2 0xd0 |
| 83 | #define NAND_CMD_RESET 0xff | 91 | #define NAND_CMD_RESET 0xff |
| 84 | 92 | ||
| 93 | #define NAND_CMD_LOCK 0x2a | ||
| 94 | #define NAND_CMD_UNLOCK1 0x23 | ||
| 95 | #define NAND_CMD_UNLOCK2 0x24 | ||
| 96 | |||
| 85 | /* Extended commands for large page devices */ | 97 | /* Extended commands for large page devices */ |
| 86 | #define NAND_CMD_READSTART 0x30 | 98 | #define NAND_CMD_READSTART 0x30 |
| 87 | #define NAND_CMD_RNDOUTSTART 0xE0 | 99 | #define NAND_CMD_RNDOUTSTART 0xE0 |
| @@ -169,6 +181,14 @@ typedef enum { | |||
| 169 | #define NAND_NO_READRDY 0x00000100 | 181 | #define NAND_NO_READRDY 0x00000100 |
| 170 | /* Chip does not allow subpage writes */ | 182 | /* Chip does not allow subpage writes */ |
| 171 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 | 183 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 |
| 184 | /* Chip stores bad block marker on the last page of the eraseblock */ | ||
| 185 | #define NAND_BB_LAST_PAGE 0x00000400 | ||
| 186 | |||
| 187 | /* Device is one of 'new' xD cards that expose fake nand command set */ | ||
| 188 | #define NAND_BROKEN_XD 0x00000400 | ||
| 189 | |||
| 190 | /* Device behaves just like nand, but is readonly */ | ||
| 191 | #define NAND_ROM 0x00000800 | ||
| 172 | 192 | ||
| 173 | /* Options valid for Samsung large page devices */ | 193 | /* Options valid for Samsung large page devices */ |
| 174 | #define NAND_SAMSUNG_LP_OPTIONS \ | 194 | #define NAND_SAMSUNG_LP_OPTIONS \ |
| @@ -391,6 +411,7 @@ struct nand_chip { | |||
| 391 | int subpagesize; | 411 | int subpagesize; |
| 392 | uint8_t cellinfo; | 412 | uint8_t cellinfo; |
| 393 | int badblockpos; | 413 | int badblockpos; |
| 414 | int badblockbits; | ||
| 394 | 415 | ||
| 395 | flstate_t state; | 416 | flstate_t state; |
| 396 | 417 | ||
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 5509eb06b326..c26ff86ad08a 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
| @@ -125,6 +125,9 @@ struct onenand_chip { | |||
| 125 | flstate_t state; | 125 | flstate_t state; |
| 126 | unsigned char *page_buf; | 126 | unsigned char *page_buf; |
| 127 | unsigned char *oob_buf; | 127 | unsigned char *oob_buf; |
| 128 | #ifdef CONFIG_MTD_ONENAND_VERIFY_WRITE | ||
| 129 | unsigned char *verify_buf; | ||
| 130 | #endif | ||
| 128 | 131 | ||
| 129 | int subpagesize; | 132 | int subpagesize; |
| 130 | struct nand_ecclayout *ecclayout; | 133 | struct nand_ecclayout *ecclayout; |
| @@ -175,10 +178,14 @@ struct onenand_chip { | |||
| 175 | #define ONENAND_HAS_CONT_LOCK (0x0001) | 178 | #define ONENAND_HAS_CONT_LOCK (0x0001) |
| 176 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) | 179 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) |
| 177 | #define ONENAND_HAS_2PLANE (0x0004) | 180 | #define ONENAND_HAS_2PLANE (0x0004) |
| 181 | #define ONENAND_HAS_4KB_PAGE (0x0008) | ||
| 178 | #define ONENAND_SKIP_UNLOCK_CHECK (0x0100) | 182 | #define ONENAND_SKIP_UNLOCK_CHECK (0x0100) |
| 179 | #define ONENAND_PAGEBUF_ALLOC (0x1000) | 183 | #define ONENAND_PAGEBUF_ALLOC (0x1000) |
| 180 | #define ONENAND_OOBBUF_ALLOC (0x2000) | 184 | #define ONENAND_OOBBUF_ALLOC (0x2000) |
| 181 | 185 | ||
| 186 | #define ONENAND_IS_4KB_PAGE(this) \ | ||
| 187 | (this->options & ONENAND_HAS_4KB_PAGE) | ||
| 188 | |||
| 182 | /* | 189 | /* |
| 183 | * OneNAND Flash Manufacturer ID Codes | 190 | * OneNAND Flash Manufacturer ID Codes |
| 184 | */ | 191 | */ |
| @@ -205,6 +212,8 @@ struct mtd_partition; | |||
| 205 | 212 | ||
| 206 | struct onenand_platform_data { | 213 | struct onenand_platform_data { |
| 207 | void (*mmcontrol)(struct mtd_info *mtd, int sync_read); | 214 | void (*mmcontrol)(struct mtd_info *mtd, int sync_read); |
| 215 | int (*read_bufferram)(struct mtd_info *mtd, int area, | ||
| 216 | unsigned char *buffer, int offset, size_t count); | ||
| 208 | struct mtd_partition *parts; | 217 | struct mtd_partition *parts; |
| 209 | unsigned int nr_parts; | 218 | unsigned int nr_parts; |
| 210 | }; | 219 | }; |
diff --git a/include/linux/mtd/sh_flctl.h b/include/linux/mtd/sh_flctl.h index ab77609ec337..9cf4c4c79555 100644 --- a/include/linux/mtd/sh_flctl.h +++ b/include/linux/mtd/sh_flctl.h | |||
| @@ -93,8 +93,6 @@ | |||
| 93 | #define INIT_FL4ECCRESULT_VAL 0x03FF03FF | 93 | #define INIT_FL4ECCRESULT_VAL 0x03FF03FF |
| 94 | #define LOOP_TIMEOUT_MAX 0x00010000 | 94 | #define LOOP_TIMEOUT_MAX 0x00010000 |
| 95 | 95 | ||
| 96 | #define mtd_to_flctl(mtd) container_of(mtd, struct sh_flctl, mtd) | ||
| 97 | |||
| 98 | struct sh_flctl { | 96 | struct sh_flctl { |
| 99 | struct mtd_info mtd; | 97 | struct mtd_info mtd; |
| 100 | struct nand_chip chip; | 98 | struct nand_chip chip; |
| @@ -125,4 +123,9 @@ struct sh_flctl_platform_data { | |||
| 125 | unsigned has_hwecc:1; | 123 | unsigned has_hwecc:1; |
| 126 | }; | 124 | }; |
| 127 | 125 | ||
| 126 | static inline struct sh_flctl *mtd_to_flctl(struct mtd_info *mtdinfo) | ||
| 127 | { | ||
| 128 | return container_of(mtdinfo, struct sh_flctl, mtd); | ||
| 129 | } | ||
| 130 | |||
| 128 | #endif /* __SH_FLCTL_H__ */ | 131 | #endif /* __SH_FLCTL_H__ */ |
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h index 6330fc76b00f..5ec9ca671687 100644 --- a/include/linux/ncp_fs_sb.h +++ b/include/linux/ncp_fs_sb.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/ncp_mount.h> | 12 | #include <linux/ncp_mount.h> |
| 13 | #include <linux/net.h> | 13 | #include <linux/net.h> |
| 14 | #include <linux/mutex.h> | 14 | #include <linux/mutex.h> |
| 15 | #include <linux/backing-dev.h> | ||
| 15 | 16 | ||
| 16 | #ifdef __KERNEL__ | 17 | #ifdef __KERNEL__ |
| 17 | 18 | ||
| @@ -127,6 +128,7 @@ struct ncp_server { | |||
| 127 | size_t len; | 128 | size_t len; |
| 128 | __u8 data[128]; | 129 | __u8 data[128]; |
| 129 | } unexpected_packet; | 130 | } unexpected_packet; |
| 131 | struct backing_dev_info bdi; | ||
| 130 | }; | 132 | }; |
| 131 | 133 | ||
| 132 | extern void ncp_tcp_rcv_proc(struct work_struct *work); | 134 | extern void ncp_tcp_rcv_proc(struct work_struct *work); |
diff --git a/include/linux/net.h b/include/linux/net.h index 4157b5d42bd6..2b4deeeb8646 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -59,6 +59,7 @@ typedef enum { | |||
| 59 | #include <linux/wait.h> | 59 | #include <linux/wait.h> |
| 60 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ | 60 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ |
| 61 | #include <linux/kmemcheck.h> | 61 | #include <linux/kmemcheck.h> |
| 62 | #include <linux/rcupdate.h> | ||
| 62 | 63 | ||
| 63 | struct poll_table_struct; | 64 | struct poll_table_struct; |
| 64 | struct pipe_inode_info; | 65 | struct pipe_inode_info; |
| @@ -116,6 +117,12 @@ enum sock_shutdown_cmd { | |||
| 116 | SHUT_RDWR = 2, | 117 | SHUT_RDWR = 2, |
| 117 | }; | 118 | }; |
| 118 | 119 | ||
| 120 | struct socket_wq { | ||
| 121 | wait_queue_head_t wait; | ||
| 122 | struct fasync_struct *fasync_list; | ||
| 123 | struct rcu_head rcu; | ||
| 124 | } ____cacheline_aligned_in_smp; | ||
| 125 | |||
| 119 | /** | 126 | /** |
| 120 | * struct socket - general BSD socket | 127 | * struct socket - general BSD socket |
| 121 | * @state: socket state (%SS_CONNECTED, etc) | 128 | * @state: socket state (%SS_CONNECTED, etc) |
| @@ -135,11 +142,8 @@ struct socket { | |||
| 135 | kmemcheck_bitfield_end(type); | 142 | kmemcheck_bitfield_end(type); |
| 136 | 143 | ||
| 137 | unsigned long flags; | 144 | unsigned long flags; |
| 138 | /* | 145 | |
| 139 | * Please keep fasync_list & wait fields in the same cache line | 146 | struct socket_wq *wq; |
| 140 | */ | ||
| 141 | struct fasync_struct *fasync_list; | ||
| 142 | wait_queue_head_t wait; | ||
| 143 | 147 | ||
| 144 | struct file *file; | 148 | struct file *file; |
| 145 | struct sock *sk; | 149 | struct sock *sk; |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c79a88be7c33..a1bff6518166 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <linux/if_link.h> | 31 | #include <linux/if_link.h> |
| 32 | 32 | ||
| 33 | #ifdef __KERNEL__ | 33 | #ifdef __KERNEL__ |
| 34 | #include <linux/pm_qos_params.h> | ||
| 34 | #include <linux/timer.h> | 35 | #include <linux/timer.h> |
| 35 | #include <linux/delay.h> | 36 | #include <linux/delay.h> |
| 36 | #include <linux/mm.h> | 37 | #include <linux/mm.h> |
| @@ -218,34 +219,6 @@ struct neighbour; | |||
| 218 | struct neigh_parms; | 219 | struct neigh_parms; |
| 219 | struct sk_buff; | 220 | struct sk_buff; |
| 220 | 221 | ||
| 221 | struct netif_rx_stats { | ||
| 222 | unsigned total; | ||
| 223 | unsigned dropped; | ||
| 224 | unsigned time_squeeze; | ||
| 225 | unsigned cpu_collision; | ||
| 226 | }; | ||
| 227 | |||
| 228 | DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat); | ||
| 229 | |||
| 230 | struct dev_addr_list { | ||
| 231 | struct dev_addr_list *next; | ||
| 232 | u8 da_addr[MAX_ADDR_LEN]; | ||
| 233 | u8 da_addrlen; | ||
| 234 | u8 da_synced; | ||
| 235 | int da_users; | ||
| 236 | int da_gusers; | ||
| 237 | }; | ||
| 238 | |||
| 239 | /* | ||
| 240 | * We tag multicasts with these structures. | ||
| 241 | */ | ||
| 242 | |||
| 243 | #define dev_mc_list dev_addr_list | ||
| 244 | #define dmi_addr da_addr | ||
| 245 | #define dmi_addrlen da_addrlen | ||
| 246 | #define dmi_users da_users | ||
| 247 | #define dmi_gusers da_gusers | ||
| 248 | |||
| 249 | struct netdev_hw_addr { | 222 | struct netdev_hw_addr { |
| 250 | struct list_head list; | 223 | struct list_head list; |
| 251 | unsigned char addr[MAX_ADDR_LEN]; | 224 | unsigned char addr[MAX_ADDR_LEN]; |
| @@ -254,8 +227,10 @@ struct netdev_hw_addr { | |||
| 254 | #define NETDEV_HW_ADDR_T_SAN 2 | 227 | #define NETDEV_HW_ADDR_T_SAN 2 |
| 255 | #define NETDEV_HW_ADDR_T_SLAVE 3 | 228 | #define NETDEV_HW_ADDR_T_SLAVE 3 |
| 256 | #define NETDEV_HW_ADDR_T_UNICAST 4 | 229 | #define NETDEV_HW_ADDR_T_UNICAST 4 |
| 230 | #define NETDEV_HW_ADDR_T_MULTICAST 5 | ||
| 257 | int refcount; | 231 | int refcount; |
| 258 | bool synced; | 232 | bool synced; |
| 233 | bool global_use; | ||
| 259 | struct rcu_head rcu_head; | 234 | struct rcu_head rcu_head; |
| 260 | }; | 235 | }; |
| 261 | 236 | ||
| @@ -264,16 +239,20 @@ struct netdev_hw_addr_list { | |||
| 264 | int count; | 239 | int count; |
| 265 | }; | 240 | }; |
| 266 | 241 | ||
| 267 | #define netdev_uc_count(dev) ((dev)->uc.count) | 242 | #define netdev_hw_addr_list_count(l) ((l)->count) |
| 268 | #define netdev_uc_empty(dev) ((dev)->uc.count == 0) | 243 | #define netdev_hw_addr_list_empty(l) (netdev_hw_addr_list_count(l) == 0) |
| 269 | #define netdev_for_each_uc_addr(ha, dev) \ | 244 | #define netdev_hw_addr_list_for_each(ha, l) \ |
| 270 | list_for_each_entry(ha, &dev->uc.list, list) | 245 | list_for_each_entry(ha, &(l)->list, list) |
| 271 | 246 | ||
| 272 | #define netdev_mc_count(dev) ((dev)->mc_count) | 247 | #define netdev_uc_count(dev) netdev_hw_addr_list_count(&(dev)->uc) |
| 273 | #define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0) | 248 | #define netdev_uc_empty(dev) netdev_hw_addr_list_empty(&(dev)->uc) |
| 249 | #define netdev_for_each_uc_addr(ha, dev) \ | ||
| 250 | netdev_hw_addr_list_for_each(ha, &(dev)->uc) | ||
| 274 | 251 | ||
| 275 | #define netdev_for_each_mc_addr(mclist, dev) \ | 252 | #define netdev_mc_count(dev) netdev_hw_addr_list_count(&(dev)->mc) |
| 276 | for (mclist = dev->mc_list; mclist; mclist = mclist->next) | 253 | #define netdev_mc_empty(dev) netdev_hw_addr_list_empty(&(dev)->mc) |
| 254 | #define netdev_for_each_mc_addr(ha, dev) \ | ||
| 255 | netdev_hw_addr_list_for_each(ha, &(dev)->mc) | ||
| 277 | 256 | ||
| 278 | struct hh_cache { | 257 | struct hh_cache { |
| 279 | struct hh_cache *hh_next; /* Next entry */ | 258 | struct hh_cache *hh_next; /* Next entry */ |
| @@ -530,6 +509,85 @@ struct netdev_queue { | |||
| 530 | unsigned long tx_dropped; | 509 | unsigned long tx_dropped; |
| 531 | } ____cacheline_aligned_in_smp; | 510 | } ____cacheline_aligned_in_smp; |
| 532 | 511 | ||
| 512 | #ifdef CONFIG_RPS | ||
| 513 | /* | ||
| 514 | * This structure holds an RPS map which can be of variable length. The | ||
| 515 | * map is an array of CPUs. | ||
| 516 | */ | ||
| 517 | struct rps_map { | ||
| 518 | unsigned int len; | ||
| 519 | struct rcu_head rcu; | ||
| 520 | u16 cpus[0]; | ||
| 521 | }; | ||
| 522 | #define RPS_MAP_SIZE(_num) (sizeof(struct rps_map) + (_num * sizeof(u16))) | ||
| 523 | |||
| 524 | /* | ||
| 525 | * The rps_dev_flow structure contains the mapping of a flow to a CPU and the | ||
| 526 | * tail pointer for that CPU's input queue at the time of last enqueue. | ||
| 527 | */ | ||
| 528 | struct rps_dev_flow { | ||
| 529 | u16 cpu; | ||
| 530 | u16 fill; | ||
| 531 | unsigned int last_qtail; | ||
| 532 | }; | ||
| 533 | |||
| 534 | /* | ||
| 535 | * The rps_dev_flow_table structure contains a table of flow mappings. | ||
| 536 | */ | ||
| 537 | struct rps_dev_flow_table { | ||
| 538 | unsigned int mask; | ||
| 539 | struct rcu_head rcu; | ||
| 540 | struct work_struct free_work; | ||
| 541 | struct rps_dev_flow flows[0]; | ||
| 542 | }; | ||
| 543 | #define RPS_DEV_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_dev_flow_table) + \ | ||
| 544 | (_num * sizeof(struct rps_dev_flow))) | ||
| 545 | |||
| 546 | /* | ||
| 547 | * The rps_sock_flow_table contains mappings of flows to the last CPU | ||
| 548 | * on which they were processed by the application (set in recvmsg). | ||
| 549 | */ | ||
| 550 | struct rps_sock_flow_table { | ||
| 551 | unsigned int mask; | ||
| 552 | u16 ents[0]; | ||
| 553 | }; | ||
| 554 | #define RPS_SOCK_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_sock_flow_table) + \ | ||
| 555 | (_num * sizeof(u16))) | ||
| 556 | |||
| 557 | #define RPS_NO_CPU 0xffff | ||
| 558 | |||
| 559 | static inline void rps_record_sock_flow(struct rps_sock_flow_table *table, | ||
| 560 | u32 hash) | ||
| 561 | { | ||
| 562 | if (table && hash) { | ||
| 563 | unsigned int cpu, index = hash & table->mask; | ||
| 564 | |||
| 565 | /* We only give a hint, preemption can change cpu under us */ | ||
| 566 | cpu = raw_smp_processor_id(); | ||
| 567 | |||
| 568 | if (table->ents[index] != cpu) | ||
| 569 | table->ents[index] = cpu; | ||
| 570 | } | ||
| 571 | } | ||
| 572 | |||
| 573 | static inline void rps_reset_sock_flow(struct rps_sock_flow_table *table, | ||
| 574 | u32 hash) | ||
| 575 | { | ||
| 576 | if (table && hash) | ||
| 577 | table->ents[hash & table->mask] = RPS_NO_CPU; | ||
| 578 | } | ||
| 579 | |||
| 580 | extern struct rps_sock_flow_table *rps_sock_flow_table; | ||
| 581 | |||
| 582 | /* This structure contains an instance of an RX queue. */ | ||
| 583 | struct netdev_rx_queue { | ||
| 584 | struct rps_map *rps_map; | ||
| 585 | struct rps_dev_flow_table *rps_flow_table; | ||
| 586 | struct kobject kobj; | ||
| 587 | struct netdev_rx_queue *first; | ||
| 588 | atomic_t count; | ||
| 589 | } ____cacheline_aligned_in_smp; | ||
| 590 | #endif /* CONFIG_RPS */ | ||
| 533 | 591 | ||
| 534 | /* | 592 | /* |
| 535 | * This structure defines the management hooks for network devices. | 593 | * This structure defines the management hooks for network devices. |
| @@ -629,6 +687,9 @@ struct netdev_queue { | |||
| 629 | * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate); | 687 | * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate); |
| 630 | * int (*ndo_get_vf_config)(struct net_device *dev, | 688 | * int (*ndo_get_vf_config)(struct net_device *dev, |
| 631 | * int vf, struct ifla_vf_info *ivf); | 689 | * int vf, struct ifla_vf_info *ivf); |
| 690 | * int (*ndo_set_vf_port)(struct net_device *dev, int vf, | ||
| 691 | * struct nlattr *port[]); | ||
| 692 | * int (*ndo_get_vf_port)(struct net_device *dev, int vf, struct sk_buff *skb); | ||
| 632 | */ | 693 | */ |
| 633 | #define HAVE_NET_DEVICE_OPS | 694 | #define HAVE_NET_DEVICE_OPS |
| 634 | struct net_device_ops { | 695 | struct net_device_ops { |
| @@ -667,6 +728,7 @@ struct net_device_ops { | |||
| 667 | unsigned short vid); | 728 | unsigned short vid); |
| 668 | #ifdef CONFIG_NET_POLL_CONTROLLER | 729 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 669 | void (*ndo_poll_controller)(struct net_device *dev); | 730 | void (*ndo_poll_controller)(struct net_device *dev); |
| 731 | void (*ndo_netpoll_cleanup)(struct net_device *dev); | ||
| 670 | #endif | 732 | #endif |
| 671 | int (*ndo_set_vf_mac)(struct net_device *dev, | 733 | int (*ndo_set_vf_mac)(struct net_device *dev, |
| 672 | int queue, u8 *mac); | 734 | int queue, u8 *mac); |
| @@ -677,6 +739,11 @@ struct net_device_ops { | |||
| 677 | int (*ndo_get_vf_config)(struct net_device *dev, | 739 | int (*ndo_get_vf_config)(struct net_device *dev, |
| 678 | int vf, | 740 | int vf, |
| 679 | struct ifla_vf_info *ivf); | 741 | struct ifla_vf_info *ivf); |
| 742 | int (*ndo_set_vf_port)(struct net_device *dev, | ||
| 743 | int vf, | ||
| 744 | struct nlattr *port[]); | ||
| 745 | int (*ndo_get_vf_port)(struct net_device *dev, | ||
| 746 | int vf, struct sk_buff *skb); | ||
| 680 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | 747 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) |
| 681 | int (*ndo_fcoe_enable)(struct net_device *dev); | 748 | int (*ndo_fcoe_enable)(struct net_device *dev); |
| 682 | int (*ndo_fcoe_disable)(struct net_device *dev); | 749 | int (*ndo_fcoe_disable)(struct net_device *dev); |
| @@ -711,6 +778,9 @@ struct net_device { | |||
| 711 | * the interface. | 778 | * the interface. |
| 712 | */ | 779 | */ |
| 713 | char name[IFNAMSIZ]; | 780 | char name[IFNAMSIZ]; |
| 781 | |||
| 782 | struct pm_qos_request_list *pm_qos_req; | ||
| 783 | |||
| 714 | /* device name hash chain */ | 784 | /* device name hash chain */ |
| 715 | struct hlist_node name_hlist; | 785 | struct hlist_node name_hlist; |
| 716 | /* snmp alias */ | 786 | /* snmp alias */ |
| @@ -764,6 +834,7 @@ struct net_device { | |||
| 764 | #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ | 834 | #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ |
| 765 | #define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ | 835 | #define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ |
| 766 | #define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */ | 836 | #define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */ |
| 837 | #define NETIF_F_RXHASH (1 << 28) /* Receive hashing offload */ | ||
| 767 | 838 | ||
| 768 | /* Segmentation offload features */ | 839 | /* Segmentation offload features */ |
| 769 | #define NETIF_F_GSO_SHIFT 16 | 840 | #define NETIF_F_GSO_SHIFT 16 |
| @@ -820,7 +891,7 @@ struct net_device { | |||
| 820 | unsigned char operstate; /* RFC2863 operstate */ | 891 | unsigned char operstate; /* RFC2863 operstate */ |
| 821 | unsigned char link_mode; /* mapping policy to operstate */ | 892 | unsigned char link_mode; /* mapping policy to operstate */ |
| 822 | 893 | ||
| 823 | unsigned mtu; /* interface MTU value */ | 894 | unsigned int mtu; /* interface MTU value */ |
| 824 | unsigned short type; /* interface hardware type */ | 895 | unsigned short type; /* interface hardware type */ |
| 825 | unsigned short hard_header_len; /* hardware hdr length */ | 896 | unsigned short hard_header_len; /* hardware hdr length */ |
| 826 | 897 | ||
| @@ -840,12 +911,10 @@ struct net_device { | |||
| 840 | unsigned char addr_len; /* hardware address length */ | 911 | unsigned char addr_len; /* hardware address length */ |
| 841 | unsigned short dev_id; /* for shared network cards */ | 912 | unsigned short dev_id; /* for shared network cards */ |
| 842 | 913 | ||
| 843 | struct netdev_hw_addr_list uc; /* Secondary unicast | ||
| 844 | mac addresses */ | ||
| 845 | int uc_promisc; | ||
| 846 | spinlock_t addr_list_lock; | 914 | spinlock_t addr_list_lock; |
| 847 | struct dev_addr_list *mc_list; /* Multicast mac addresses */ | 915 | struct netdev_hw_addr_list uc; /* Unicast mac addresses */ |
| 848 | int mc_count; /* Number of installed mcasts */ | 916 | struct netdev_hw_addr_list mc; /* Multicast mac addresses */ |
| 917 | int uc_promisc; | ||
| 849 | unsigned int promiscuity; | 918 | unsigned int promiscuity; |
| 850 | unsigned int allmulti; | 919 | unsigned int allmulti; |
| 851 | 920 | ||
| @@ -878,6 +947,15 @@ struct net_device { | |||
| 878 | 947 | ||
| 879 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | 948 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ |
| 880 | 949 | ||
| 950 | #ifdef CONFIG_RPS | ||
| 951 | struct kset *queues_kset; | ||
| 952 | |||
| 953 | struct netdev_rx_queue *_rx; | ||
| 954 | |||
| 955 | /* Number of RX queues allocated at alloc_netdev_mq() time */ | ||
| 956 | unsigned int num_rx_queues; | ||
| 957 | #endif | ||
| 958 | |||
| 881 | struct netdev_queue rx_queue; | 959 | struct netdev_queue rx_queue; |
| 882 | 960 | ||
| 883 | struct netdev_queue *_tx ____cacheline_aligned_in_smp; | 961 | struct netdev_queue *_tx ____cacheline_aligned_in_smp; |
| @@ -1306,19 +1384,44 @@ static inline int unregister_gifconf(unsigned int family) | |||
| 1306 | } | 1384 | } |
| 1307 | 1385 | ||
| 1308 | /* | 1386 | /* |
| 1309 | * Incoming packets are placed on per-cpu queues so that | 1387 | * Incoming packets are placed on per-cpu queues |
| 1310 | * no locking is needed. | ||
| 1311 | */ | 1388 | */ |
| 1312 | struct softnet_data { | 1389 | struct softnet_data { |
| 1313 | struct Qdisc *output_queue; | 1390 | struct Qdisc *output_queue; |
| 1314 | struct sk_buff_head input_pkt_queue; | 1391 | struct Qdisc **output_queue_tailp; |
| 1315 | struct list_head poll_list; | 1392 | struct list_head poll_list; |
| 1316 | struct sk_buff *completion_queue; | 1393 | struct sk_buff *completion_queue; |
| 1317 | 1394 | struct sk_buff_head process_queue; | |
| 1395 | |||
| 1396 | /* stats */ | ||
| 1397 | unsigned int processed; | ||
| 1398 | unsigned int time_squeeze; | ||
| 1399 | unsigned int cpu_collision; | ||
| 1400 | unsigned int received_rps; | ||
| 1401 | |||
| 1402 | #ifdef CONFIG_RPS | ||
| 1403 | struct softnet_data *rps_ipi_list; | ||
| 1404 | |||
| 1405 | /* Elements below can be accessed between CPUs for RPS */ | ||
| 1406 | struct call_single_data csd ____cacheline_aligned_in_smp; | ||
| 1407 | struct softnet_data *rps_ipi_next; | ||
| 1408 | unsigned int cpu; | ||
| 1409 | unsigned int input_queue_head; | ||
| 1410 | #endif | ||
| 1411 | unsigned dropped; | ||
| 1412 | struct sk_buff_head input_pkt_queue; | ||
| 1318 | struct napi_struct backlog; | 1413 | struct napi_struct backlog; |
| 1319 | }; | 1414 | }; |
| 1320 | 1415 | ||
| 1321 | DECLARE_PER_CPU(struct softnet_data,softnet_data); | 1416 | static inline void input_queue_head_add(struct softnet_data *sd, |
| 1417 | unsigned int len) | ||
| 1418 | { | ||
| 1419 | #ifdef CONFIG_RPS | ||
| 1420 | sd->input_queue_head += len; | ||
| 1421 | #endif | ||
| 1422 | } | ||
| 1423 | |||
| 1424 | DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data); | ||
| 1322 | 1425 | ||
| 1323 | #define HAVE_NETIF_QUEUE | 1426 | #define HAVE_NETIF_QUEUE |
| 1324 | 1427 | ||
| @@ -1945,6 +2048,22 @@ extern struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, | |||
| 1945 | extern int register_netdev(struct net_device *dev); | 2048 | extern int register_netdev(struct net_device *dev); |
| 1946 | extern void unregister_netdev(struct net_device *dev); | 2049 | extern void unregister_netdev(struct net_device *dev); |
| 1947 | 2050 | ||
| 2051 | /* General hardware address lists handling functions */ | ||
| 2052 | extern int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list, | ||
| 2053 | struct netdev_hw_addr_list *from_list, | ||
| 2054 | int addr_len, unsigned char addr_type); | ||
| 2055 | extern void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list, | ||
| 2056 | struct netdev_hw_addr_list *from_list, | ||
| 2057 | int addr_len, unsigned char addr_type); | ||
| 2058 | extern int __hw_addr_sync(struct netdev_hw_addr_list *to_list, | ||
| 2059 | struct netdev_hw_addr_list *from_list, | ||
| 2060 | int addr_len); | ||
| 2061 | extern void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, | ||
| 2062 | struct netdev_hw_addr_list *from_list, | ||
| 2063 | int addr_len); | ||
| 2064 | extern void __hw_addr_flush(struct netdev_hw_addr_list *list); | ||
| 2065 | extern void __hw_addr_init(struct netdev_hw_addr_list *list); | ||
| 2066 | |||
| 1948 | /* Functions used for device addresses handling */ | 2067 | /* Functions used for device addresses handling */ |
| 1949 | extern int dev_addr_add(struct net_device *dev, unsigned char *addr, | 2068 | extern int dev_addr_add(struct net_device *dev, unsigned char *addr, |
| 1950 | unsigned char addr_type); | 2069 | unsigned char addr_type); |
| @@ -1956,26 +2075,34 @@ extern int dev_addr_add_multiple(struct net_device *to_dev, | |||
| 1956 | extern int dev_addr_del_multiple(struct net_device *to_dev, | 2075 | extern int dev_addr_del_multiple(struct net_device *to_dev, |
| 1957 | struct net_device *from_dev, | 2076 | struct net_device *from_dev, |
| 1958 | unsigned char addr_type); | 2077 | unsigned char addr_type); |
| 2078 | extern void dev_addr_flush(struct net_device *dev); | ||
| 2079 | extern int dev_addr_init(struct net_device *dev); | ||
| 2080 | |||
| 2081 | /* Functions used for unicast addresses handling */ | ||
| 2082 | extern int dev_uc_add(struct net_device *dev, unsigned char *addr); | ||
| 2083 | extern int dev_uc_del(struct net_device *dev, unsigned char *addr); | ||
| 2084 | extern int dev_uc_sync(struct net_device *to, struct net_device *from); | ||
| 2085 | extern void dev_uc_unsync(struct net_device *to, struct net_device *from); | ||
| 2086 | extern void dev_uc_flush(struct net_device *dev); | ||
| 2087 | extern void dev_uc_init(struct net_device *dev); | ||
| 2088 | |||
| 2089 | /* Functions used for multicast addresses handling */ | ||
| 2090 | extern int dev_mc_add(struct net_device *dev, unsigned char *addr); | ||
| 2091 | extern int dev_mc_add_global(struct net_device *dev, unsigned char *addr); | ||
| 2092 | extern int dev_mc_del(struct net_device *dev, unsigned char *addr); | ||
| 2093 | extern int dev_mc_del_global(struct net_device *dev, unsigned char *addr); | ||
| 2094 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); | ||
| 2095 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); | ||
| 2096 | extern void dev_mc_flush(struct net_device *dev); | ||
| 2097 | extern void dev_mc_init(struct net_device *dev); | ||
| 1959 | 2098 | ||
| 1960 | /* Functions used for secondary unicast and multicast support */ | 2099 | /* Functions used for secondary unicast and multicast support */ |
| 1961 | extern void dev_set_rx_mode(struct net_device *dev); | 2100 | extern void dev_set_rx_mode(struct net_device *dev); |
| 1962 | extern void __dev_set_rx_mode(struct net_device *dev); | 2101 | extern void __dev_set_rx_mode(struct net_device *dev); |
| 1963 | extern int dev_unicast_delete(struct net_device *dev, void *addr); | ||
| 1964 | extern int dev_unicast_add(struct net_device *dev, void *addr); | ||
| 1965 | extern int dev_unicast_sync(struct net_device *to, struct net_device *from); | ||
| 1966 | extern void dev_unicast_unsync(struct net_device *to, struct net_device *from); | ||
| 1967 | extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all); | ||
| 1968 | extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly); | ||
| 1969 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); | ||
| 1970 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); | ||
| 1971 | extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all); | ||
| 1972 | extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); | ||
| 1973 | extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count); | ||
| 1974 | extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count); | ||
| 1975 | extern int dev_set_promiscuity(struct net_device *dev, int inc); | 2102 | extern int dev_set_promiscuity(struct net_device *dev, int inc); |
| 1976 | extern int dev_set_allmulti(struct net_device *dev, int inc); | 2103 | extern int dev_set_allmulti(struct net_device *dev, int inc); |
| 1977 | extern void netdev_state_change(struct net_device *dev); | 2104 | extern void netdev_state_change(struct net_device *dev); |
| 1978 | extern void netdev_bonding_change(struct net_device *dev, | 2105 | extern int netdev_bonding_change(struct net_device *dev, |
| 1979 | unsigned long event); | 2106 | unsigned long event); |
| 1980 | extern void netdev_features_change(struct net_device *dev); | 2107 | extern void netdev_features_change(struct net_device *dev); |
| 1981 | /* Load a device via the kmod */ | 2108 | /* Load a device via the kmod */ |
| @@ -1985,6 +2112,7 @@ extern const struct net_device_stats *dev_get_stats(struct net_device *dev); | |||
| 1985 | extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats); | 2112 | extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats); |
| 1986 | 2113 | ||
| 1987 | extern int netdev_max_backlog; | 2114 | extern int netdev_max_backlog; |
| 2115 | extern int netdev_tstamp_prequeue; | ||
| 1988 | extern int weight_p; | 2116 | extern int weight_p; |
| 1989 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); | 2117 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); |
| 1990 | extern int skb_checksum_help(struct sk_buff *skb); | 2118 | extern int skb_checksum_help(struct sk_buff *skb); |
| @@ -2045,54 +2173,14 @@ static inline void netif_set_gso_max_size(struct net_device *dev, | |||
| 2045 | dev->gso_max_size = size; | 2173 | dev->gso_max_size = size; |
| 2046 | } | 2174 | } |
| 2047 | 2175 | ||
| 2048 | static inline void skb_bond_set_mac_by_master(struct sk_buff *skb, | 2176 | extern int __skb_bond_should_drop(struct sk_buff *skb, |
| 2049 | struct net_device *master) | 2177 | struct net_device *master); |
| 2050 | { | ||
| 2051 | if (skb->pkt_type == PACKET_HOST) { | ||
| 2052 | u16 *dest = (u16 *) eth_hdr(skb)->h_dest; | ||
| 2053 | |||
| 2054 | memcpy(dest, master->dev_addr, ETH_ALEN); | ||
| 2055 | } | ||
| 2056 | } | ||
| 2057 | 2178 | ||
| 2058 | /* On bonding slaves other than the currently active slave, suppress | 2179 | static inline int skb_bond_should_drop(struct sk_buff *skb, |
| 2059 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and | 2180 | struct net_device *master) |
| 2060 | * ARP on active-backup slaves with arp_validate enabled. | 2181 | { |
| 2061 | */ | 2182 | if (master) |
| 2062 | static inline int skb_bond_should_drop(struct sk_buff *skb) | 2183 | return __skb_bond_should_drop(skb, master); |
| 2063 | { | ||
| 2064 | struct net_device *dev = skb->dev; | ||
| 2065 | struct net_device *master = dev->master; | ||
| 2066 | |||
| 2067 | if (master) { | ||
| 2068 | if (master->priv_flags & IFF_MASTER_ARPMON) | ||
| 2069 | dev->last_rx = jiffies; | ||
| 2070 | |||
| 2071 | if ((master->priv_flags & IFF_MASTER_ALB) && master->br_port) { | ||
| 2072 | /* Do address unmangle. The local destination address | ||
| 2073 | * will be always the one master has. Provides the right | ||
| 2074 | * functionality in a bridge. | ||
| 2075 | */ | ||
| 2076 | skb_bond_set_mac_by_master(skb, master); | ||
| 2077 | } | ||
| 2078 | |||
| 2079 | if (dev->priv_flags & IFF_SLAVE_INACTIVE) { | ||
| 2080 | if ((dev->priv_flags & IFF_SLAVE_NEEDARP) && | ||
| 2081 | skb->protocol == __cpu_to_be16(ETH_P_ARP)) | ||
| 2082 | return 0; | ||
| 2083 | |||
| 2084 | if (master->priv_flags & IFF_MASTER_ALB) { | ||
| 2085 | if (skb->pkt_type != PACKET_BROADCAST && | ||
| 2086 | skb->pkt_type != PACKET_MULTICAST) | ||
| 2087 | return 0; | ||
| 2088 | } | ||
| 2089 | if (master->priv_flags & IFF_MASTER_8023AD && | ||
| 2090 | skb->protocol == __cpu_to_be16(ETH_P_SLOW)) | ||
| 2091 | return 0; | ||
| 2092 | |||
| 2093 | return 1; | ||
| 2094 | } | ||
| 2095 | } | ||
| 2096 | return 0; | 2184 | return 0; |
| 2097 | } | 2185 | } |
| 2098 | 2186 | ||
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index a5a63e41b8af..48767cd16453 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
| @@ -16,6 +16,7 @@ header-y += xt_RATEEST.h | |||
| 16 | header-y += xt_SECMARK.h | 16 | header-y += xt_SECMARK.h |
| 17 | header-y += xt_TCPMSS.h | 17 | header-y += xt_TCPMSS.h |
| 18 | header-y += xt_TCPOPTSTRIP.h | 18 | header-y += xt_TCPOPTSTRIP.h |
| 19 | header-y += xt_TEE.h | ||
| 19 | header-y += xt_TPROXY.h | 20 | header-y += xt_TPROXY.h |
| 20 | header-y += xt_comment.h | 21 | header-y += xt_comment.h |
| 21 | header-y += xt_connbytes.h | 22 | header-y += xt_connbytes.h |
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index c608677dda60..14e6d32002c4 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
| @@ -113,6 +113,7 @@ struct ip_conntrack_stat { | |||
| 113 | unsigned int expect_new; | 113 | unsigned int expect_new; |
| 114 | unsigned int expect_create; | 114 | unsigned int expect_create; |
| 115 | unsigned int expect_delete; | 115 | unsigned int expect_delete; |
| 116 | unsigned int search_restart; | ||
| 116 | }; | 117 | }; |
| 117 | 118 | ||
| 118 | /* call to create an explicit dependency on nf_conntrack. */ | 119 | /* call to create an explicit dependency on nf_conntrack. */ |
diff --git a/include/linux/netfilter/nf_conntrack_tuple_common.h b/include/linux/netfilter/nf_conntrack_tuple_common.h index 8e145f0d61cb..2ea22b018a87 100644 --- a/include/linux/netfilter/nf_conntrack_tuple_common.h +++ b/include/linux/netfilter/nf_conntrack_tuple_common.h | |||
| @@ -1,8 +1,7 @@ | |||
| 1 | #ifndef _NF_CONNTRACK_TUPLE_COMMON_H | 1 | #ifndef _NF_CONNTRACK_TUPLE_COMMON_H |
| 2 | #define _NF_CONNTRACK_TUPLE_COMMON_H | 2 | #define _NF_CONNTRACK_TUPLE_COMMON_H |
| 3 | 3 | ||
| 4 | enum ip_conntrack_dir | 4 | enum ip_conntrack_dir { |
| 5 | { | ||
| 6 | IP_CT_DIR_ORIGINAL, | 5 | IP_CT_DIR_ORIGINAL, |
| 7 | IP_CT_DIR_REPLY, | 6 | IP_CT_DIR_REPLY, |
| 8 | IP_CT_DIR_MAX | 7 | IP_CT_DIR_MAX |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 53923868c9bd..361d6b5630ee 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
| @@ -76,7 +76,7 @@ extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); | |||
| 76 | extern int nfnetlink_has_listeners(struct net *net, unsigned int group); | 76 | extern int nfnetlink_has_listeners(struct net *net, unsigned int group); |
| 77 | extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, | 77 | extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, |
| 78 | int echo, gfp_t flags); | 78 | int echo, gfp_t flags); |
| 79 | extern void nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error); | 79 | extern int nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error); |
| 80 | extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags); | 80 | extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags); |
| 81 | 81 | ||
| 82 | extern void nfnl_lock(void); | 82 | extern void nfnl_lock(void); |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 84c7c928e9eb..c2ee5d8550cf 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
| @@ -1,9 +1,10 @@ | |||
| 1 | #ifndef _X_TABLES_H | 1 | #ifndef _X_TABLES_H |
| 2 | #define _X_TABLES_H | 2 | #define _X_TABLES_H |
| 3 | 3 | #include <linux/kernel.h> | |
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | #define XT_FUNCTION_MAXNAMELEN 30 | 6 | #define XT_FUNCTION_MAXNAMELEN 30 |
| 7 | #define XT_EXTENSION_MAXNAMELEN 29 | ||
| 7 | #define XT_TABLE_MAXNAMELEN 32 | 8 | #define XT_TABLE_MAXNAMELEN 32 |
| 8 | 9 | ||
| 9 | struct xt_entry_match { | 10 | struct xt_entry_match { |
| @@ -12,8 +13,7 @@ struct xt_entry_match { | |||
| 12 | __u16 match_size; | 13 | __u16 match_size; |
| 13 | 14 | ||
| 14 | /* Used by userspace */ | 15 | /* Used by userspace */ |
| 15 | char name[XT_FUNCTION_MAXNAMELEN-1]; | 16 | char name[XT_EXTENSION_MAXNAMELEN]; |
| 16 | |||
| 17 | __u8 revision; | 17 | __u8 revision; |
| 18 | } user; | 18 | } user; |
| 19 | struct { | 19 | struct { |
| @@ -36,8 +36,7 @@ struct xt_entry_target { | |||
| 36 | __u16 target_size; | 36 | __u16 target_size; |
| 37 | 37 | ||
| 38 | /* Used by userspace */ | 38 | /* Used by userspace */ |
| 39 | char name[XT_FUNCTION_MAXNAMELEN-1]; | 39 | char name[XT_EXTENSION_MAXNAMELEN]; |
| 40 | |||
| 41 | __u8 revision; | 40 | __u8 revision; |
| 42 | } user; | 41 | } user; |
| 43 | struct { | 42 | struct { |
| @@ -70,8 +69,7 @@ struct xt_standard_target { | |||
| 70 | /* The argument to IPT_SO_GET_REVISION_*. Returns highest revision | 69 | /* The argument to IPT_SO_GET_REVISION_*. Returns highest revision |
| 71 | * kernel supports, if >= revision. */ | 70 | * kernel supports, if >= revision. */ |
| 72 | struct xt_get_revision { | 71 | struct xt_get_revision { |
| 73 | char name[XT_FUNCTION_MAXNAMELEN-1]; | 72 | char name[XT_EXTENSION_MAXNAMELEN]; |
| 74 | |||
| 75 | __u8 revision; | 73 | __u8 revision; |
| 76 | }; | 74 | }; |
| 77 | 75 | ||
| @@ -93,7 +91,7 @@ struct _xt_align { | |||
| 93 | __u64 u64; | 91 | __u64 u64; |
| 94 | }; | 92 | }; |
| 95 | 93 | ||
| 96 | #define XT_ALIGN(s) ALIGN((s), __alignof__(struct _xt_align)) | 94 | #define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align)) |
| 97 | 95 | ||
| 98 | /* Standard return verdict, or do jump. */ | 96 | /* Standard return verdict, or do jump. */ |
| 99 | #define XT_STANDARD_TARGET "" | 97 | #define XT_STANDARD_TARGET "" |
| @@ -185,40 +183,53 @@ struct xt_counters_info { | |||
| 185 | #include <linux/netdevice.h> | 183 | #include <linux/netdevice.h> |
| 186 | 184 | ||
| 187 | /** | 185 | /** |
| 188 | * struct xt_match_param - parameters for match extensions' match functions | 186 | * struct xt_action_param - parameters for matches/targets |
| 189 | * | 187 | * |
| 188 | * @match: the match extension | ||
| 189 | * @target: the target extension | ||
| 190 | * @matchinfo: per-match data | ||
| 191 | * @targetinfo: per-target data | ||
| 190 | * @in: input netdevice | 192 | * @in: input netdevice |
| 191 | * @out: output netdevice | 193 | * @out: output netdevice |
| 192 | * @match: struct xt_match through which this function was invoked | ||
| 193 | * @matchinfo: per-match data | ||
| 194 | * @fragoff: packet is a fragment, this is the data offset | 194 | * @fragoff: packet is a fragment, this is the data offset |
| 195 | * @thoff: position of transport header relative to skb->data | 195 | * @thoff: position of transport header relative to skb->data |
| 196 | * @hook: hook number given packet came from | 196 | * @hook: hook number given packet came from |
| 197 | * @family: Actual NFPROTO_* through which the function is invoked | 197 | * @family: Actual NFPROTO_* through which the function is invoked |
| 198 | * (helpful when match->family == NFPROTO_UNSPEC) | 198 | * (helpful when match->family == NFPROTO_UNSPEC) |
| 199 | * | ||
| 200 | * Fields written to by extensions: | ||
| 201 | * | ||
| 199 | * @hotdrop: drop packet if we had inspection problems | 202 | * @hotdrop: drop packet if we had inspection problems |
| 203 | * Network namespace obtainable using dev_net(in/out) | ||
| 200 | */ | 204 | */ |
| 201 | struct xt_match_param { | 205 | struct xt_action_param { |
| 206 | union { | ||
| 207 | const struct xt_match *match; | ||
| 208 | const struct xt_target *target; | ||
| 209 | }; | ||
| 210 | union { | ||
| 211 | const void *matchinfo, *targinfo; | ||
| 212 | }; | ||
| 202 | const struct net_device *in, *out; | 213 | const struct net_device *in, *out; |
| 203 | const struct xt_match *match; | ||
| 204 | const void *matchinfo; | ||
| 205 | int fragoff; | 214 | int fragoff; |
| 206 | unsigned int thoff; | 215 | unsigned int thoff; |
| 207 | unsigned int hooknum; | 216 | unsigned int hooknum; |
| 208 | u_int8_t family; | 217 | u_int8_t family; |
| 209 | bool *hotdrop; | 218 | bool hotdrop; |
| 210 | }; | 219 | }; |
| 211 | 220 | ||
| 212 | /** | 221 | /** |
| 213 | * struct xt_mtchk_param - parameters for match extensions' | 222 | * struct xt_mtchk_param - parameters for match extensions' |
| 214 | * checkentry functions | 223 | * checkentry functions |
| 215 | * | 224 | * |
| 225 | * @net: network namespace through which the check was invoked | ||
| 216 | * @table: table the rule is tried to be inserted into | 226 | * @table: table the rule is tried to be inserted into |
| 217 | * @entryinfo: the family-specific rule data | 227 | * @entryinfo: the family-specific rule data |
| 218 | * (struct ipt_ip, ip6t_ip, ebt_entry) | 228 | * (struct ipt_ip, ip6t_ip, arpt_arp or (note) ebt_entry) |
| 219 | * @match: struct xt_match through which this function was invoked | 229 | * @match: struct xt_match through which this function was invoked |
| 220 | * @matchinfo: per-match data | 230 | * @matchinfo: per-match data |
| 221 | * @hook_mask: via which hooks the new rule is reachable | 231 | * @hook_mask: via which hooks the new rule is reachable |
| 232 | * Other fields as above. | ||
| 222 | */ | 233 | */ |
| 223 | struct xt_mtchk_param { | 234 | struct xt_mtchk_param { |
| 224 | struct net *net; | 235 | struct net *net; |
| @@ -230,7 +241,10 @@ struct xt_mtchk_param { | |||
| 230 | u_int8_t family; | 241 | u_int8_t family; |
| 231 | }; | 242 | }; |
| 232 | 243 | ||
| 233 | /* Match destructor parameters */ | 244 | /** |
| 245 | * struct xt_mdtor_param - match destructor parameters | ||
| 246 | * Fields as above. | ||
| 247 | */ | ||
| 234 | struct xt_mtdtor_param { | 248 | struct xt_mtdtor_param { |
| 235 | struct net *net; | 249 | struct net *net; |
| 236 | const struct xt_match *match; | 250 | const struct xt_match *match; |
| @@ -239,23 +253,6 @@ struct xt_mtdtor_param { | |||
| 239 | }; | 253 | }; |
| 240 | 254 | ||
| 241 | /** | 255 | /** |
| 242 | * struct xt_target_param - parameters for target extensions' target functions | ||
| 243 | * | ||
| 244 | * @hooknum: hook through which this target was invoked | ||
| 245 | * @target: struct xt_target through which this function was invoked | ||
| 246 | * @targinfo: per-target data | ||
| 247 | * | ||
| 248 | * Other fields see above. | ||
| 249 | */ | ||
| 250 | struct xt_target_param { | ||
| 251 | const struct net_device *in, *out; | ||
| 252 | const struct xt_target *target; | ||
| 253 | const void *targinfo; | ||
| 254 | unsigned int hooknum; | ||
| 255 | u_int8_t family; | ||
| 256 | }; | ||
| 257 | |||
| 258 | /** | ||
| 259 | * struct xt_tgchk_param - parameters for target extensions' | 256 | * struct xt_tgchk_param - parameters for target extensions' |
| 260 | * checkentry functions | 257 | * checkentry functions |
| 261 | * | 258 | * |
| @@ -285,7 +282,7 @@ struct xt_tgdtor_param { | |||
| 285 | struct xt_match { | 282 | struct xt_match { |
| 286 | struct list_head list; | 283 | struct list_head list; |
| 287 | 284 | ||
| 288 | const char name[XT_FUNCTION_MAXNAMELEN-1]; | 285 | const char name[XT_EXTENSION_MAXNAMELEN]; |
| 289 | u_int8_t revision; | 286 | u_int8_t revision; |
| 290 | 287 | ||
| 291 | /* Return true or false: return FALSE and set *hotdrop = 1 to | 288 | /* Return true or false: return FALSE and set *hotdrop = 1 to |
| @@ -294,10 +291,10 @@ struct xt_match { | |||
| 294 | non-linear skb, using skb_header_pointer and | 291 | non-linear skb, using skb_header_pointer and |
| 295 | skb_ip_make_writable. */ | 292 | skb_ip_make_writable. */ |
| 296 | bool (*match)(const struct sk_buff *skb, | 293 | bool (*match)(const struct sk_buff *skb, |
| 297 | const struct xt_match_param *); | 294 | struct xt_action_param *); |
| 298 | 295 | ||
| 299 | /* Called when user tries to insert an entry of this type. */ | 296 | /* Called when user tries to insert an entry of this type. */ |
| 300 | bool (*checkentry)(const struct xt_mtchk_param *); | 297 | int (*checkentry)(const struct xt_mtchk_param *); |
| 301 | 298 | ||
| 302 | /* Called when entry of this type deleted. */ | 299 | /* Called when entry of this type deleted. */ |
| 303 | void (*destroy)(const struct xt_mtdtor_param *); | 300 | void (*destroy)(const struct xt_mtdtor_param *); |
| @@ -309,9 +306,6 @@ struct xt_match { | |||
| 309 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 306 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
| 310 | struct module *me; | 307 | struct module *me; |
| 311 | 308 | ||
| 312 | /* Free to use by each match */ | ||
| 313 | unsigned long data; | ||
| 314 | |||
| 315 | const char *table; | 309 | const char *table; |
| 316 | unsigned int matchsize; | 310 | unsigned int matchsize; |
| 317 | #ifdef CONFIG_COMPAT | 311 | #ifdef CONFIG_COMPAT |
| @@ -327,19 +321,20 @@ struct xt_match { | |||
| 327 | struct xt_target { | 321 | struct xt_target { |
| 328 | struct list_head list; | 322 | struct list_head list; |
| 329 | 323 | ||
| 330 | const char name[XT_FUNCTION_MAXNAMELEN-1]; | 324 | const char name[XT_EXTENSION_MAXNAMELEN]; |
| 325 | u_int8_t revision; | ||
| 331 | 326 | ||
| 332 | /* Returns verdict. Argument order changed since 2.6.9, as this | 327 | /* Returns verdict. Argument order changed since 2.6.9, as this |
| 333 | must now handle non-linear skbs, using skb_copy_bits and | 328 | must now handle non-linear skbs, using skb_copy_bits and |
| 334 | skb_ip_make_writable. */ | 329 | skb_ip_make_writable. */ |
| 335 | unsigned int (*target)(struct sk_buff *skb, | 330 | unsigned int (*target)(struct sk_buff *skb, |
| 336 | const struct xt_target_param *); | 331 | const struct xt_action_param *); |
| 337 | 332 | ||
| 338 | /* Called when user tries to insert an entry of this type: | 333 | /* Called when user tries to insert an entry of this type: |
| 339 | hook_mask is a bitmask of hooks from which it can be | 334 | hook_mask is a bitmask of hooks from which it can be |
| 340 | called. */ | 335 | called. */ |
| 341 | /* Should return true or false. */ | 336 | /* Should return true or false, or an error code (-Exxxx). */ |
| 342 | bool (*checkentry)(const struct xt_tgchk_param *); | 337 | int (*checkentry)(const struct xt_tgchk_param *); |
| 343 | 338 | ||
| 344 | /* Called when entry of this type deleted. */ | 339 | /* Called when entry of this type deleted. */ |
| 345 | void (*destroy)(const struct xt_tgdtor_param *); | 340 | void (*destroy)(const struct xt_tgdtor_param *); |
| @@ -360,7 +355,6 @@ struct xt_target { | |||
| 360 | unsigned short proto; | 355 | unsigned short proto; |
| 361 | 356 | ||
| 362 | unsigned short family; | 357 | unsigned short family; |
| 363 | u_int8_t revision; | ||
| 364 | }; | 358 | }; |
| 365 | 359 | ||
| 366 | /* Furniture shopping... */ | 360 | /* Furniture shopping... */ |
| @@ -398,6 +392,13 @@ struct xt_table_info { | |||
| 398 | unsigned int hook_entry[NF_INET_NUMHOOKS]; | 392 | unsigned int hook_entry[NF_INET_NUMHOOKS]; |
| 399 | unsigned int underflow[NF_INET_NUMHOOKS]; | 393 | unsigned int underflow[NF_INET_NUMHOOKS]; |
| 400 | 394 | ||
| 395 | /* | ||
| 396 | * Number of user chains. Since tables cannot have loops, at most | ||
| 397 | * @stacksize jumps (number of user chains) can possibly be made. | ||
| 398 | */ | ||
| 399 | unsigned int stacksize; | ||
| 400 | unsigned int *stackptr; | ||
| 401 | void ***jumpstack; | ||
| 401 | /* ipt_entry tables: one per CPU */ | 402 | /* ipt_entry tables: one per CPU */ |
| 402 | /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */ | 403 | /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */ |
| 403 | void *entries[1]; | 404 | void *entries[1]; |
| @@ -433,6 +434,8 @@ extern struct xt_table_info *xt_replace_table(struct xt_table *table, | |||
| 433 | 434 | ||
| 434 | extern struct xt_match *xt_find_match(u8 af, const char *name, u8 revision); | 435 | extern struct xt_match *xt_find_match(u8 af, const char *name, u8 revision); |
| 435 | extern struct xt_target *xt_find_target(u8 af, const char *name, u8 revision); | 436 | extern struct xt_target *xt_find_target(u8 af, const char *name, u8 revision); |
| 437 | extern struct xt_match *xt_request_find_match(u8 af, const char *name, | ||
| 438 | u8 revision); | ||
| 436 | extern struct xt_target *xt_request_find_target(u8 af, const char *name, | 439 | extern struct xt_target *xt_request_find_target(u8 af, const char *name, |
| 437 | u8 revision); | 440 | u8 revision); |
| 438 | extern int xt_find_revision(u8 af, const char *name, u8 revision, | 441 | extern int xt_find_revision(u8 af, const char *name, u8 revision, |
| @@ -598,7 +601,7 @@ struct _compat_xt_align { | |||
| 598 | compat_u64 u64; | 601 | compat_u64 u64; |
| 599 | }; | 602 | }; |
| 600 | 603 | ||
| 601 | #define COMPAT_XT_ALIGN(s) ALIGN((s), __alignof__(struct _compat_xt_align)) | 604 | #define COMPAT_XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _compat_xt_align)) |
| 602 | 605 | ||
| 603 | extern void xt_compat_lock(u_int8_t af); | 606 | extern void xt_compat_lock(u_int8_t af); |
| 604 | extern void xt_compat_unlock(u_int8_t af); | 607 | extern void xt_compat_unlock(u_int8_t af); |
diff --git a/include/linux/netfilter/xt_CONNMARK.h b/include/linux/netfilter/xt_CONNMARK.h index 0a8545866752..2f2e48ec8023 100644 --- a/include/linux/netfilter/xt_CONNMARK.h +++ b/include/linux/netfilter/xt_CONNMARK.h | |||
| @@ -1,26 +1,6 @@ | |||
| 1 | #ifndef _XT_CONNMARK_H_target | 1 | #ifndef _XT_CONNMARK_H_target |
| 2 | #define _XT_CONNMARK_H_target | 2 | #define _XT_CONNMARK_H_target |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/netfilter/xt_connmark.h> |
| 5 | |||
| 6 | /* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com> | ||
| 7 | * by Henrik Nordstrom <hno@marasystems.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | */ | ||
| 14 | |||
| 15 | enum { | ||
| 16 | XT_CONNMARK_SET = 0, | ||
| 17 | XT_CONNMARK_SAVE, | ||
| 18 | XT_CONNMARK_RESTORE | ||
| 19 | }; | ||
| 20 | |||
| 21 | struct xt_connmark_tginfo1 { | ||
| 22 | __u32 ctmark, ctmask, nfmask; | ||
| 23 | __u8 mode; | ||
| 24 | }; | ||
| 25 | 5 | ||
| 26 | #endif /*_XT_CONNMARK_H_target*/ | 6 | #endif /*_XT_CONNMARK_H_target*/ |
diff --git a/include/linux/netfilter/xt_MARK.h b/include/linux/netfilter/xt_MARK.h index bc9561bdef79..41c456deba22 100644 --- a/include/linux/netfilter/xt_MARK.h +++ b/include/linux/netfilter/xt_MARK.h | |||
| @@ -1,10 +1,6 @@ | |||
| 1 | #ifndef _XT_MARK_H_target | 1 | #ifndef _XT_MARK_H_target |
| 2 | #define _XT_MARK_H_target | 2 | #define _XT_MARK_H_target |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/netfilter/xt_mark.h> |
| 5 | |||
| 6 | struct xt_mark_tginfo2 { | ||
| 7 | __u32 mark, mask; | ||
| 8 | }; | ||
| 9 | 5 | ||
| 10 | #endif /*_XT_MARK_H_target */ | 6 | #endif /*_XT_MARK_H_target */ |
diff --git a/include/linux/netfilter/xt_TEE.h b/include/linux/netfilter/xt_TEE.h new file mode 100644 index 000000000000..5c21d5c829af --- /dev/null +++ b/include/linux/netfilter/xt_TEE.h | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #ifndef _XT_TEE_TARGET_H | ||
| 2 | #define _XT_TEE_TARGET_H | ||
| 3 | |||
| 4 | struct xt_tee_tginfo { | ||
| 5 | union nf_inet_addr gw; | ||
| 6 | char oif[16]; | ||
| 7 | |||
| 8 | /* used internally by the kernel */ | ||
| 9 | struct xt_tee_priv *priv __attribute__((aligned(8))); | ||
| 10 | }; | ||
| 11 | |||
| 12 | #endif /* _XT_TEE_TARGET_H */ | ||
diff --git a/include/linux/netfilter/xt_connmark.h b/include/linux/netfilter/xt_connmark.h index 619e47cde01a..efc17a8305fb 100644 --- a/include/linux/netfilter/xt_connmark.h +++ b/include/linux/netfilter/xt_connmark.h | |||
| @@ -12,6 +12,17 @@ | |||
| 12 | * (at your option) any later version. | 12 | * (at your option) any later version. |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | enum { | ||
| 16 | XT_CONNMARK_SET = 0, | ||
| 17 | XT_CONNMARK_SAVE, | ||
| 18 | XT_CONNMARK_RESTORE | ||
| 19 | }; | ||
| 20 | |||
| 21 | struct xt_connmark_tginfo1 { | ||
| 22 | __u32 ctmark, ctmask, nfmask; | ||
| 23 | __u8 mode; | ||
| 24 | }; | ||
| 25 | |||
| 15 | struct xt_connmark_mtinfo1 { | 26 | struct xt_connmark_mtinfo1 { |
| 16 | __u32 mark, mask; | 27 | __u32 mark, mask; |
| 17 | __u8 invert; | 28 | __u8 invert; |
diff --git a/include/linux/netfilter/xt_mark.h b/include/linux/netfilter/xt_mark.h index 6607c8f38ea5..ecadc40d5cde 100644 --- a/include/linux/netfilter/xt_mark.h +++ b/include/linux/netfilter/xt_mark.h | |||
| @@ -3,6 +3,10 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | struct xt_mark_tginfo2 { | ||
| 7 | __u32 mark, mask; | ||
| 8 | }; | ||
| 9 | |||
| 6 | struct xt_mark_mtinfo1 { | 10 | struct xt_mark_mtinfo1 { |
| 7 | __u32 mark, mask; | 11 | __u32 mark, mask; |
| 8 | __u8 invert; | 12 | __u8 invert; |
diff --git a/include/linux/netfilter/xt_recent.h b/include/linux/netfilter/xt_recent.h index d2c276609925..83318e01425e 100644 --- a/include/linux/netfilter/xt_recent.h +++ b/include/linux/netfilter/xt_recent.h | |||
| @@ -9,6 +9,7 @@ enum { | |||
| 9 | XT_RECENT_UPDATE = 1 << 2, | 9 | XT_RECENT_UPDATE = 1 << 2, |
| 10 | XT_RECENT_REMOVE = 1 << 3, | 10 | XT_RECENT_REMOVE = 1 << 3, |
| 11 | XT_RECENT_TTL = 1 << 4, | 11 | XT_RECENT_TTL = 1 << 4, |
| 12 | XT_RECENT_REAP = 1 << 5, | ||
| 12 | 13 | ||
| 13 | XT_RECENT_SOURCE = 0, | 14 | XT_RECENT_SOURCE = 0, |
| 14 | XT_RECENT_DEST = 1, | 15 | XT_RECENT_DEST = 1, |
| @@ -16,6 +17,12 @@ enum { | |||
| 16 | XT_RECENT_NAME_LEN = 200, | 17 | XT_RECENT_NAME_LEN = 200, |
| 17 | }; | 18 | }; |
| 18 | 19 | ||
| 20 | /* Only allowed with --rcheck and --update */ | ||
| 21 | #define XT_RECENT_MODIFIERS (XT_RECENT_TTL|XT_RECENT_REAP) | ||
| 22 | |||
| 23 | #define XT_RECENT_VALID_FLAGS (XT_RECENT_CHECK|XT_RECENT_SET|XT_RECENT_UPDATE|\ | ||
| 24 | XT_RECENT_REMOVE|XT_RECENT_TTL|XT_RECENT_REAP) | ||
| 25 | |||
| 19 | struct xt_recent_mtinfo { | 26 | struct xt_recent_mtinfo { |
| 20 | __u32 seconds; | 27 | __u32 seconds; |
| 21 | __u32 hit_count; | 28 | __u32 hit_count; |
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index f8105e54716a..0ddd161f3b06 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h | |||
| @@ -41,10 +41,10 @@ enum nf_br_hook_priorities { | |||
| 41 | 41 | ||
| 42 | #define BRNF_PKT_TYPE 0x01 | 42 | #define BRNF_PKT_TYPE 0x01 |
| 43 | #define BRNF_BRIDGED_DNAT 0x02 | 43 | #define BRNF_BRIDGED_DNAT 0x02 |
| 44 | #define BRNF_DONT_TAKE_PARENT 0x04 | 44 | #define BRNF_BRIDGED 0x04 |
| 45 | #define BRNF_BRIDGED 0x08 | 45 | #define BRNF_NF_BRIDGE_PREROUTING 0x08 |
| 46 | #define BRNF_NF_BRIDGE_PREROUTING 0x10 | 46 | #define BRNF_8021Q 0x10 |
| 47 | 47 | #define BRNF_PPPoE 0x20 | |
| 48 | 48 | ||
| 49 | /* Only used in br_forward.c */ | 49 | /* Only used in br_forward.c */ |
| 50 | extern int nf_bridge_copy_header(struct sk_buff *skb); | 50 | extern int nf_bridge_copy_header(struct sk_buff *skb); |
| @@ -68,6 +68,27 @@ static inline unsigned int nf_bridge_encap_header_len(const struct sk_buff *skb) | |||
| 68 | } | 68 | } |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | static inline unsigned int nf_bridge_mtu_reduction(const struct sk_buff *skb) | ||
| 72 | { | ||
| 73 | if (unlikely(skb->nf_bridge->mask & BRNF_PPPoE)) | ||
| 74 | return PPPOE_SES_HLEN; | ||
| 75 | return 0; | ||
| 76 | } | ||
| 77 | |||
| 78 | extern int br_handle_frame_finish(struct sk_buff *skb); | ||
| 79 | /* Only used in br_device.c */ | ||
| 80 | static inline int br_nf_pre_routing_finish_bridge_slow(struct sk_buff *skb) | ||
| 81 | { | ||
| 82 | struct nf_bridge_info *nf_bridge = skb->nf_bridge; | ||
| 83 | |||
| 84 | skb_pull(skb, ETH_HLEN); | ||
| 85 | nf_bridge->mask ^= BRNF_BRIDGED_DNAT; | ||
| 86 | skb_copy_to_linear_data_offset(skb, -(ETH_HLEN-ETH_ALEN), | ||
| 87 | skb->nf_bridge->data, ETH_HLEN-ETH_ALEN); | ||
| 88 | skb->dev = nf_bridge->physindev; | ||
| 89 | return br_handle_frame_finish(skb); | ||
| 90 | } | ||
| 91 | |||
| 71 | /* This is called by the IP fragmenting code and it ensures there is | 92 | /* This is called by the IP fragmenting code and it ensures there is |
| 72 | * enough room for the encapsulating header (if there is one). */ | 93 | * enough room for the encapsulating header (if there is one). */ |
| 73 | static inline unsigned int nf_bridge_pad(const struct sk_buff *skb) | 94 | static inline unsigned int nf_bridge_pad(const struct sk_buff *skb) |
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index d654873aa25a..1f7e300094cd 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
| @@ -59,6 +59,7 @@ | |||
| 59 | enum nf_ip6_hook_priorities { | 59 | enum nf_ip6_hook_priorities { |
| 60 | NF_IP6_PRI_FIRST = INT_MIN, | 60 | NF_IP6_PRI_FIRST = INT_MIN, |
| 61 | NF_IP6_PRI_CONNTRACK_DEFRAG = -400, | 61 | NF_IP6_PRI_CONNTRACK_DEFRAG = -400, |
| 62 | NF_IP6_PRI_RAW = -300, | ||
| 62 | NF_IP6_PRI_SELINUX_FIRST = -225, | 63 | NF_IP6_PRI_SELINUX_FIRST = -225, |
| 63 | NF_IP6_PRI_CONNTRACK = -200, | 64 | NF_IP6_PRI_CONNTRACK = -200, |
| 64 | NF_IP6_PRI_MANGLE = -150, | 65 | NF_IP6_PRI_MANGLE = -150, |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index e5ba03d783c6..18442ff19c07 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
| @@ -316,10 +316,6 @@ extern int ip6t_ext_hdr(u8 nexthdr); | |||
| 316 | extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, | 316 | extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, |
| 317 | int target, unsigned short *fragoff); | 317 | int target, unsigned short *fragoff); |
| 318 | 318 | ||
| 319 | extern int ip6_masked_addrcmp(const struct in6_addr *addr1, | ||
| 320 | const struct in6_addr *mask, | ||
| 321 | const struct in6_addr *addr2); | ||
| 322 | |||
| 323 | #define IP6T_ALIGN(s) XT_ALIGN(s) | 319 | #define IP6T_ALIGN(s) XT_ALIGN(s) |
| 324 | 320 | ||
| 325 | #ifdef CONFIG_COMPAT | 321 | #ifdef CONFIG_COMPAT |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index fde27c017326..6eaca5e1e8ca 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
| @@ -188,7 +188,7 @@ extern int netlink_has_listeners(struct sock *sk, unsigned int group); | |||
| 188 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); | 188 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); |
| 189 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, | 189 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, |
| 190 | __u32 group, gfp_t allocation); | 190 | __u32 group, gfp_t allocation); |
| 191 | extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); | 191 | extern int netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); |
| 192 | extern int netlink_register_notifier(struct notifier_block *nb); | 192 | extern int netlink_register_notifier(struct notifier_block *nb); |
| 193 | extern int netlink_unregister_notifier(struct notifier_block *nb); | 193 | extern int netlink_unregister_notifier(struct notifier_block *nb); |
| 194 | 194 | ||
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index a765ea898549..e9e231215865 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | struct netpoll { | 15 | struct netpoll { |
| 16 | struct net_device *dev; | 16 | struct net_device *dev; |
| 17 | struct net_device *real_dev; | ||
| 17 | char dev_name[IFNAMSIZ]; | 18 | char dev_name[IFNAMSIZ]; |
| 18 | const char *name; | 19 | const char *name; |
| 19 | void (*rx_hook)(struct netpoll *, int, char *, int); | 20 | void (*rx_hook)(struct netpoll *, int, char *, int); |
| @@ -36,8 +37,11 @@ struct netpoll_info { | |||
| 36 | struct sk_buff_head txq; | 37 | struct sk_buff_head txq; |
| 37 | 38 | ||
| 38 | struct delayed_work tx_work; | 39 | struct delayed_work tx_work; |
| 40 | |||
| 41 | struct netpoll *netpoll; | ||
| 39 | }; | 42 | }; |
| 40 | 43 | ||
| 44 | void netpoll_poll_dev(struct net_device *dev); | ||
| 41 | void netpoll_poll(struct netpoll *np); | 45 | void netpoll_poll(struct netpoll *np); |
| 42 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); | 46 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); |
| 43 | void netpoll_print_options(struct netpoll *np); | 47 | void netpoll_print_options(struct netpoll *np); |
| @@ -47,22 +51,23 @@ int netpoll_trap(void); | |||
| 47 | void netpoll_set_trap(int trap); | 51 | void netpoll_set_trap(int trap); |
| 48 | void netpoll_cleanup(struct netpoll *np); | 52 | void netpoll_cleanup(struct netpoll *np); |
| 49 | int __netpoll_rx(struct sk_buff *skb); | 53 | int __netpoll_rx(struct sk_buff *skb); |
| 54 | void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); | ||
| 50 | 55 | ||
| 51 | 56 | ||
| 52 | #ifdef CONFIG_NETPOLL | 57 | #ifdef CONFIG_NETPOLL |
| 53 | static inline int netpoll_rx(struct sk_buff *skb) | 58 | static inline bool netpoll_rx(struct sk_buff *skb) |
| 54 | { | 59 | { |
| 55 | struct netpoll_info *npinfo = skb->dev->npinfo; | 60 | struct netpoll_info *npinfo = skb->dev->npinfo; |
| 56 | unsigned long flags; | 61 | unsigned long flags; |
| 57 | int ret = 0; | 62 | bool ret = false; |
| 58 | 63 | ||
| 59 | if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) | 64 | if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) |
| 60 | return 0; | 65 | return false; |
| 61 | 66 | ||
| 62 | spin_lock_irqsave(&npinfo->rx_lock, flags); | 67 | spin_lock_irqsave(&npinfo->rx_lock, flags); |
| 63 | /* check rx_flags again with the lock held */ | 68 | /* check rx_flags again with the lock held */ |
| 64 | if (npinfo->rx_flags && __netpoll_rx(skb)) | 69 | if (npinfo->rx_flags && __netpoll_rx(skb)) |
| 65 | ret = 1; | 70 | ret = true; |
| 66 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); | 71 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); |
| 67 | 72 | ||
| 68 | return ret; | 73 | return ret; |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 1a0b85aa151e..77c2ae53431c 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -209,6 +209,7 @@ struct nfs_inode { | |||
| 209 | #define NFS_INO_FLUSHING (4) /* inode is flushing out data */ | 209 | #define NFS_INO_FLUSHING (4) /* inode is flushing out data */ |
| 210 | #define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ | 210 | #define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ |
| 211 | #define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ | 211 | #define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ |
| 212 | #define NFS_INO_COMMIT (7) /* inode is committing unstable writes */ | ||
| 212 | 213 | ||
| 213 | static inline struct nfs_inode *NFS_I(const struct inode *inode) | 214 | static inline struct nfs_inode *NFS_I(const struct inode *inode) |
| 214 | { | 215 | { |
| @@ -355,6 +356,20 @@ extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struc | |||
| 355 | extern u64 nfs_compat_user_ino64(u64 fileid); | 356 | extern u64 nfs_compat_user_ino64(u64 fileid); |
| 356 | extern void nfs_fattr_init(struct nfs_fattr *fattr); | 357 | extern void nfs_fattr_init(struct nfs_fattr *fattr); |
| 357 | 358 | ||
| 359 | extern struct nfs_fattr *nfs_alloc_fattr(void); | ||
| 360 | |||
| 361 | static inline void nfs_free_fattr(const struct nfs_fattr *fattr) | ||
| 362 | { | ||
| 363 | kfree(fattr); | ||
| 364 | } | ||
| 365 | |||
| 366 | extern struct nfs_fh *nfs_alloc_fhandle(void); | ||
| 367 | |||
| 368 | static inline void nfs_free_fhandle(const struct nfs_fh *fh) | ||
| 369 | { | ||
| 370 | kfree(fh); | ||
| 371 | } | ||
| 372 | |||
| 358 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ | 373 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ |
| 359 | extern __be32 root_nfs_parse_addr(char *name); /*__init*/ | 374 | extern __be32 root_nfs_parse_addr(char *name); /*__init*/ |
| 360 | extern unsigned long nfs_inc_attr_generation_counter(void); | 375 | extern unsigned long nfs_inc_attr_generation_counter(void); |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 717a5e54eb1d..d6e10a4c06e5 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -44,7 +44,6 @@ struct nfs_client { | |||
| 44 | 44 | ||
| 45 | #ifdef CONFIG_NFS_V4 | 45 | #ifdef CONFIG_NFS_V4 |
| 46 | u64 cl_clientid; /* constant */ | 46 | u64 cl_clientid; /* constant */ |
| 47 | nfs4_verifier cl_confirm; | ||
| 48 | unsigned long cl_state; | 47 | unsigned long cl_state; |
| 49 | 48 | ||
| 50 | struct rb_root cl_openowner_id; | 49 | struct rb_root cl_openowner_id; |
| @@ -176,6 +175,7 @@ struct nfs_server { | |||
| 176 | #define NFS_CAP_ATIME (1U << 11) | 175 | #define NFS_CAP_ATIME (1U << 11) |
| 177 | #define NFS_CAP_CTIME (1U << 12) | 176 | #define NFS_CAP_CTIME (1U << 12) |
| 178 | #define NFS_CAP_MTIME (1U << 13) | 177 | #define NFS_CAP_MTIME (1U << 13) |
| 178 | #define NFS_CAP_POSIX_LOCK (1U << 14) | ||
| 179 | 179 | ||
| 180 | 180 | ||
| 181 | /* maximum number of slots to use */ | 181 | /* maximum number of slots to use */ |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 89b28812ec24..51914d7d6cc4 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -386,8 +386,8 @@ struct nfs_removeargs { | |||
| 386 | 386 | ||
| 387 | struct nfs_removeres { | 387 | struct nfs_removeres { |
| 388 | const struct nfs_server *server; | 388 | const struct nfs_server *server; |
| 389 | struct nfs_fattr *dir_attr; | ||
| 389 | struct nfs4_change_info cinfo; | 390 | struct nfs4_change_info cinfo; |
| 390 | struct nfs_fattr dir_attr; | ||
| 391 | struct nfs4_sequence_res seq_res; | 391 | struct nfs4_sequence_res seq_res; |
| 392 | }; | 392 | }; |
| 393 | 393 | ||
| @@ -824,6 +824,11 @@ struct nfs4_setclientid { | |||
| 824 | u32 sc_cb_ident; | 824 | u32 sc_cb_ident; |
| 825 | }; | 825 | }; |
| 826 | 826 | ||
| 827 | struct nfs4_setclientid_res { | ||
| 828 | u64 clientid; | ||
| 829 | nfs4_verifier confirm; | ||
| 830 | }; | ||
| 831 | |||
| 827 | struct nfs4_statfs_arg { | 832 | struct nfs4_statfs_arg { |
| 828 | const struct nfs_fh * fh; | 833 | const struct nfs_fh * fh; |
| 829 | const u32 * bitmask; | 834 | const u32 * bitmask; |
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index 65e333afaee4..80d55bbc5365 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h | |||
| @@ -40,12 +40,12 @@ struct nfs_fhbase_old { | |||
| 40 | * This is the new flexible, extensible style NFSv2/v3 file handle. | 40 | * This is the new flexible, extensible style NFSv2/v3 file handle. |
| 41 | * by Neil Brown <neilb@cse.unsw.edu.au> - March 2000 | 41 | * by Neil Brown <neilb@cse.unsw.edu.au> - March 2000 |
| 42 | * | 42 | * |
| 43 | * The file handle is seens as a list of 4byte words. | 43 | * The file handle starts with a sequence of four-byte words. |
| 44 | * The first word contains a version number (1) and four descriptor bytes | 44 | * The first word contains a version number (1) and three descriptor bytes |
| 45 | * that tell how the remaining 3 variable length fields should be handled. | 45 | * that tell how the remaining 3 variable length fields should be handled. |
| 46 | * These three bytes are auth_type, fsid_type and fileid_type. | 46 | * These three bytes are auth_type, fsid_type and fileid_type. |
| 47 | * | 47 | * |
| 48 | * All 4byte values are in host-byte-order. | 48 | * All four-byte values are in host-byte-order. |
| 49 | * | 49 | * |
| 50 | * The auth_type field specifies how the filehandle can be authenticated | 50 | * The auth_type field specifies how the filehandle can be authenticated |
| 51 | * This might allow a file to be confirmed to be in a writable part of a | 51 | * This might allow a file to be confirmed to be in a writable part of a |
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h index 640702e97457..8c2c6116e788 100644 --- a/include/linux/nilfs2_fs.h +++ b/include/linux/nilfs2_fs.h | |||
| @@ -199,16 +199,15 @@ struct nilfs_super_block { | |||
| 199 | __le32 s_creator_os; /* OS */ | 199 | __le32 s_creator_os; /* OS */ |
| 200 | __le16 s_def_resuid; /* Default uid for reserved blocks */ | 200 | __le16 s_def_resuid; /* Default uid for reserved blocks */ |
| 201 | __le16 s_def_resgid; /* Default gid for reserved blocks */ | 201 | __le16 s_def_resgid; /* Default gid for reserved blocks */ |
| 202 | __le32 s_first_ino; /* First non-reserved inode */ | 202 | __le32 s_first_ino; /* First non-reserved inode */ |
| 203 | 203 | ||
| 204 | __le16 s_inode_size; /* Size of an inode */ | 204 | __le16 s_inode_size; /* Size of an inode */ |
| 205 | __le16 s_dat_entry_size; /* Size of a dat entry */ | 205 | __le16 s_dat_entry_size; /* Size of a dat entry */ |
| 206 | __le16 s_checkpoint_size; /* Size of a checkpoint */ | 206 | __le16 s_checkpoint_size; /* Size of a checkpoint */ |
| 207 | __le16 s_segment_usage_size; /* Size of a segment usage */ | 207 | __le16 s_segment_usage_size; /* Size of a segment usage */ |
| 208 | 208 | ||
| 209 | __u8 s_uuid[16]; /* 128-bit uuid for volume */ | 209 | __u8 s_uuid[16]; /* 128-bit uuid for volume */ |
| 210 | char s_volume_name[16]; /* volume name */ | 210 | char s_volume_name[80]; /* volume name */ |
| 211 | char s_last_mounted[64]; /* directory where last mounted */ | ||
| 212 | 211 | ||
| 213 | __le32 s_c_interval; /* Commit interval of segment */ | 212 | __le32 s_c_interval; /* Commit interval of segment */ |
| 214 | __le32 s_c_block_max; /* Threshold of data amount for | 213 | __le32 s_c_block_max; /* Threshold of data amount for |
| @@ -377,6 +376,7 @@ union nilfs_binfo { | |||
| 377 | * @ss_nfinfo: number of finfo structures | 376 | * @ss_nfinfo: number of finfo structures |
| 378 | * @ss_sumbytes: total size of segment summary in bytes | 377 | * @ss_sumbytes: total size of segment summary in bytes |
| 379 | * @ss_pad: padding | 378 | * @ss_pad: padding |
| 379 | * @ss_cno: checkpoint number | ||
| 380 | */ | 380 | */ |
| 381 | struct nilfs_segment_summary { | 381 | struct nilfs_segment_summary { |
| 382 | __le32 ss_datasum; | 382 | __le32 ss_datasum; |
| @@ -391,6 +391,7 @@ struct nilfs_segment_summary { | |||
| 391 | __le32 ss_nfinfo; | 391 | __le32 ss_nfinfo; |
| 392 | __le32 ss_sumbytes; | 392 | __le32 ss_sumbytes; |
| 393 | __le32 ss_pad; | 393 | __le32 ss_pad; |
| 394 | __le64 ss_cno; | ||
| 394 | /* array of finfo structures */ | 395 | /* array of finfo structures */ |
| 395 | }; | 396 | }; |
| 396 | 397 | ||
| @@ -437,10 +438,10 @@ struct nilfs_palloc_group_desc { | |||
| 437 | 438 | ||
| 438 | /** | 439 | /** |
| 439 | * struct nilfs_dat_entry - disk address translation entry | 440 | * struct nilfs_dat_entry - disk address translation entry |
| 440 | * @dt_blocknr: block number | 441 | * @de_blocknr: block number |
| 441 | * @dt_start: start checkpoint number | 442 | * @de_start: start checkpoint number |
| 442 | * @dt_end: end checkpoint number | 443 | * @de_end: end checkpoint number |
| 443 | * @dt_rsv: reserved for future use | 444 | * @de_rsv: reserved for future use |
| 444 | */ | 445 | */ |
| 445 | struct nilfs_dat_entry { | 446 | struct nilfs_dat_entry { |
| 446 | __le64 de_blocknr; | 447 | __le64 de_blocknr; |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 28ba20fda3e2..b7c77f9712f4 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
| @@ -52,6 +52,8 @@ | |||
| 52 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT, | 52 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT, |
| 53 | * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, | 53 | * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, |
| 54 | * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. | 54 | * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. |
| 55 | * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL | ||
| 56 | * instead, the support here is for backward compatibility only. | ||
| 55 | * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request | 57 | * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request |
| 56 | * or rename notification. Has attributes %NL80211_ATTR_WIPHY and | 58 | * or rename notification. Has attributes %NL80211_ATTR_WIPHY and |
| 57 | * %NL80211_ATTR_WIPHY_NAME. | 59 | * %NL80211_ATTR_WIPHY_NAME. |
| @@ -323,6 +325,21 @@ | |||
| 323 | * the TX command and %NL80211_ATTR_FRAME includes the contents of the | 325 | * the TX command and %NL80211_ATTR_FRAME includes the contents of the |
| 324 | * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged | 326 | * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged |
| 325 | * the frame. | 327 | * the frame. |
| 328 | * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command | ||
| 329 | * is used to configure connection quality monitoring notification trigger | ||
| 330 | * levels. | ||
| 331 | * @NL80211_CMD_NOTIFY_CQM: Connection quality monitor notification. This | ||
| 332 | * command is used as an event to indicate the that a trigger level was | ||
| 333 | * reached. | ||
| 334 | * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ | ||
| 335 | * and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed | ||
| 336 | * by %NL80211_ATTR_IFINDEX) shall operate on. | ||
| 337 | * In case multiple channels are supported by the device, the mechanism | ||
| 338 | * with which it switches channels is implementation-defined. | ||
| 339 | * When a monitor interface is given, it can only switch channel while | ||
| 340 | * no other interfaces are operating to avoid disturbing the operation | ||
| 341 | * of any other interfaces, and other interfaces will again take | ||
| 342 | * precedence when they are used. | ||
| 326 | * | 343 | * |
| 327 | * @NL80211_CMD_MAX: highest used command number | 344 | * @NL80211_CMD_MAX: highest used command number |
| 328 | * @__NL80211_CMD_AFTER_LAST: internal use | 345 | * @__NL80211_CMD_AFTER_LAST: internal use |
| @@ -419,6 +436,11 @@ enum nl80211_commands { | |||
| 419 | NL80211_CMD_SET_POWER_SAVE, | 436 | NL80211_CMD_SET_POWER_SAVE, |
| 420 | NL80211_CMD_GET_POWER_SAVE, | 437 | NL80211_CMD_GET_POWER_SAVE, |
| 421 | 438 | ||
| 439 | NL80211_CMD_SET_CQM, | ||
| 440 | NL80211_CMD_NOTIFY_CQM, | ||
| 441 | |||
| 442 | NL80211_CMD_SET_CHANNEL, | ||
| 443 | |||
| 422 | /* add new commands above here */ | 444 | /* add new commands above here */ |
| 423 | 445 | ||
| 424 | /* used to define NL80211_CMD_MAX below */ | 446 | /* used to define NL80211_CMD_MAX below */ |
| @@ -691,6 +713,18 @@ enum nl80211_commands { | |||
| 691 | * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was | 713 | * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was |
| 692 | * acknowledged by the recipient. | 714 | * acknowledged by the recipient. |
| 693 | * | 715 | * |
| 716 | * @NL80211_ATTR_CQM: connection quality monitor configuration in a | ||
| 717 | * nested attribute with %NL80211_ATTR_CQM_* sub-attributes. | ||
| 718 | * | ||
| 719 | * @NL80211_ATTR_LOCAL_STATE_CHANGE: Flag attribute to indicate that a command | ||
| 720 | * is requesting a local authentication/association state change without | ||
| 721 | * invoking actual management frame exchange. This can be used with | ||
| 722 | * NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE, | ||
| 723 | * NL80211_CMD_DISASSOCIATE. | ||
| 724 | * | ||
| 725 | * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations | ||
| 726 | * connected to this BSS. | ||
| 727 | * | ||
| 694 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 728 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 695 | * @__NL80211_ATTR_AFTER_LAST: internal use | 729 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| 696 | */ | 730 | */ |
| @@ -842,6 +876,12 @@ enum nl80211_attrs { | |||
| 842 | 876 | ||
| 843 | NL80211_ATTR_PS_STATE, | 877 | NL80211_ATTR_PS_STATE, |
| 844 | 878 | ||
| 879 | NL80211_ATTR_CQM, | ||
| 880 | |||
| 881 | NL80211_ATTR_LOCAL_STATE_CHANGE, | ||
| 882 | |||
| 883 | NL80211_ATTR_AP_ISOLATE, | ||
| 884 | |||
| 845 | /* add attributes here, update the policy in nl80211.c */ | 885 | /* add attributes here, update the policy in nl80211.c */ |
| 846 | 886 | ||
| 847 | __NL80211_ATTR_AFTER_LAST, | 887 | __NL80211_ATTR_AFTER_LAST, |
| @@ -1583,4 +1623,40 @@ enum nl80211_ps_state { | |||
| 1583 | NL80211_PS_ENABLED, | 1623 | NL80211_PS_ENABLED, |
| 1584 | }; | 1624 | }; |
| 1585 | 1625 | ||
| 1626 | /** | ||
| 1627 | * enum nl80211_attr_cqm - connection quality monitor attributes | ||
| 1628 | * @__NL80211_ATTR_CQM_INVALID: invalid | ||
| 1629 | * @NL80211_ATTR_CQM_RSSI_THOLD: RSSI threshold in dBm. This value specifies | ||
| 1630 | * the threshold for the RSSI level at which an event will be sent. Zero | ||
| 1631 | * to disable. | ||
| 1632 | * @NL80211_ATTR_CQM_RSSI_HYST: RSSI hysteresis in dBm. This value specifies | ||
| 1633 | * the minimum amount the RSSI level must change after an event before a | ||
| 1634 | * new event may be issued (to reduce effects of RSSI oscillation). | ||
| 1635 | * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event | ||
| 1636 | * @__NL80211_ATTR_CQM_AFTER_LAST: internal | ||
| 1637 | * @NL80211_ATTR_CQM_MAX: highest key attribute | ||
| 1638 | */ | ||
| 1639 | enum nl80211_attr_cqm { | ||
| 1640 | __NL80211_ATTR_CQM_INVALID, | ||
| 1641 | NL80211_ATTR_CQM_RSSI_THOLD, | ||
| 1642 | NL80211_ATTR_CQM_RSSI_HYST, | ||
| 1643 | NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, | ||
| 1644 | |||
| 1645 | /* keep last */ | ||
| 1646 | __NL80211_ATTR_CQM_AFTER_LAST, | ||
| 1647 | NL80211_ATTR_CQM_MAX = __NL80211_ATTR_CQM_AFTER_LAST - 1 | ||
| 1648 | }; | ||
| 1649 | |||
| 1650 | /** | ||
| 1651 | * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event | ||
| 1652 | * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW - The RSSI level is lower than the | ||
| 1653 | * configured threshold | ||
| 1654 | * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH - The RSSI is higher than the | ||
| 1655 | * configured threshold | ||
| 1656 | */ | ||
| 1657 | enum nl80211_cqm_rssi_threshold_event { | ||
| 1658 | NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, | ||
| 1659 | NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, | ||
| 1660 | }; | ||
| 1661 | |||
| 1586 | #endif /* __LINUX_NL80211_H */ | 1662 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index c4fa64b585ff..dba35e413371 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
| @@ -483,7 +483,7 @@ static inline int num_node_state(enum node_states state) | |||
| 483 | type *name = kmalloc(sizeof(*name), gfp_flags) | 483 | type *name = kmalloc(sizeof(*name), gfp_flags) |
| 484 | #define NODEMASK_FREE(m) kfree(m) | 484 | #define NODEMASK_FREE(m) kfree(m) |
| 485 | #else | 485 | #else |
| 486 | #define NODEMASK_ALLOC(type, name, gfp_flags) type _name, *name = &_name | 486 | #define NODEMASK_ALLOC(type, name, gfp_flags) type _##name, *name = &_##name |
| 487 | #define NODEMASK_FREE(m) do {} while (0) | 487 | #define NODEMASK_FREE(m) do {} while (0) |
| 488 | #endif | 488 | #endif |
| 489 | 489 | ||
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index fee6c2f68075..7c3609622334 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
| @@ -182,7 +182,10 @@ static inline int notifier_to_errno(int ret) | |||
| 182 | * VC switch chains (for loadable kernel svgalib VC switch helpers) etc... | 182 | * VC switch chains (for loadable kernel svgalib VC switch helpers) etc... |
| 183 | */ | 183 | */ |
| 184 | 184 | ||
| 185 | /* netdevice notifier chain */ | 185 | /* netdevice notifier chain. Please remember to update the rtnetlink |
| 186 | * notification exclusion list in rtnetlink_event() when adding new | ||
| 187 | * types. | ||
| 188 | */ | ||
| 186 | #define NETDEV_UP 0x0001 /* For now you can't veto a device up/down */ | 189 | #define NETDEV_UP 0x0001 /* For now you can't veto a device up/down */ |
| 187 | #define NETDEV_DOWN 0x0002 | 190 | #define NETDEV_DOWN 0x0002 |
| 188 | #define NETDEV_REBOOT 0x0003 /* Tell a protocol stack a network interface | 191 | #define NETDEV_REBOOT 0x0003 /* Tell a protocol stack a network interface |
| @@ -199,10 +202,11 @@ static inline int notifier_to_errno(int ret) | |||
| 199 | #define NETDEV_FEAT_CHANGE 0x000B | 202 | #define NETDEV_FEAT_CHANGE 0x000B |
| 200 | #define NETDEV_BONDING_FAILOVER 0x000C | 203 | #define NETDEV_BONDING_FAILOVER 0x000C |
| 201 | #define NETDEV_PRE_UP 0x000D | 204 | #define NETDEV_PRE_UP 0x000D |
| 202 | #define NETDEV_BONDING_OLDTYPE 0x000E | 205 | #define NETDEV_PRE_TYPE_CHANGE 0x000E |
| 203 | #define NETDEV_BONDING_NEWTYPE 0x000F | 206 | #define NETDEV_POST_TYPE_CHANGE 0x000F |
| 204 | #define NETDEV_POST_INIT 0x0010 | 207 | #define NETDEV_POST_INIT 0x0010 |
| 205 | #define NETDEV_UNREGISTER_BATCH 0x0011 | 208 | #define NETDEV_UNREGISTER_BATCH 0x0011 |
| 209 | #define NETDEV_BONDING_DESLAVE 0x0012 | ||
| 206 | 210 | ||
| 207 | #define SYS_DOWN 0x0001 /* Notify of system down */ | 211 | #define SYS_DOWN 0x0001 /* Notify of system down */ |
| 208 | #define SYS_RESTART SYS_DOWN | 212 | #define SYS_RESTART SYS_DOWN |
diff --git a/include/linux/of.h b/include/linux/of.h index f6d9cbc39c9c..a367e19bb3af 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -127,7 +127,7 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size) | |||
| 127 | 127 | ||
| 128 | /* Default string compare functions, Allow arch asm/prom.h to override */ | 128 | /* Default string compare functions, Allow arch asm/prom.h to override */ |
| 129 | #if !defined(of_compat_cmp) | 129 | #if !defined(of_compat_cmp) |
| 130 | #define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l)) | 130 | #define of_compat_cmp(s1, s2, l) strcasecmp((s1), (s2)) |
| 131 | #define of_prop_cmp(s1, s2) strcmp((s1), (s2)) | 131 | #define of_prop_cmp(s1, s2) strcmp((s1), (s2)) |
| 132 | #define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) | 132 | #define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) |
| 133 | #endif | 133 | #endif |
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index b0e4eb126236..aef22ae2af47 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
| @@ -39,6 +39,7 @@ enum { | |||
| 39 | PCG_CACHE, /* charged as cache */ | 39 | PCG_CACHE, /* charged as cache */ |
| 40 | PCG_USED, /* this object is in use. */ | 40 | PCG_USED, /* this object is in use. */ |
| 41 | PCG_ACCT_LRU, /* page has been accounted for */ | 41 | PCG_ACCT_LRU, /* page has been accounted for */ |
| 42 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ | ||
| 42 | }; | 43 | }; |
| 43 | 44 | ||
| 44 | #define TESTPCGFLAG(uname, lname) \ | 45 | #define TESTPCGFLAG(uname, lname) \ |
| @@ -73,6 +74,11 @@ CLEARPCGFLAG(AcctLRU, ACCT_LRU) | |||
| 73 | TESTPCGFLAG(AcctLRU, ACCT_LRU) | 74 | TESTPCGFLAG(AcctLRU, ACCT_LRU) |
| 74 | TESTCLEARPCGFLAG(AcctLRU, ACCT_LRU) | 75 | TESTCLEARPCGFLAG(AcctLRU, ACCT_LRU) |
| 75 | 76 | ||
| 77 | |||
| 78 | SETPCGFLAG(FileMapped, FILE_MAPPED) | ||
| 79 | CLEARPCGFLAG(FileMapped, FILE_MAPPED) | ||
| 80 | TESTPCGFLAG(FileMapped, FILE_MAPPED) | ||
| 81 | |||
| 76 | static inline int page_cgroup_nid(struct page_cgroup *pc) | 82 | static inline int page_cgroup_nid(struct page_cgroup *pc) |
| 77 | { | 83 | { |
| 78 | return page_to_nid(pc->page); | 84 | return page_to_nid(pc->page); |
| @@ -118,6 +124,8 @@ static inline void __init page_cgroup_init_flatmem(void) | |||
| 118 | #include <linux/swap.h> | 124 | #include <linux/swap.h> |
| 119 | 125 | ||
| 120 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | 126 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP |
| 127 | extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent, | ||
| 128 | unsigned short old, unsigned short new); | ||
| 121 | extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); | 129 | extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); |
| 122 | extern unsigned short lookup_swap_cgroup(swp_entry_t ent); | 130 | extern unsigned short lookup_swap_cgroup(swp_entry_t ent); |
| 123 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); | 131 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); |
diff --git a/include/linux/pci-dma.h b/include/linux/pci-dma.h new file mode 100644 index 000000000000..549a041f9c08 --- /dev/null +++ b/include/linux/pci-dma.h | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #ifndef _LINUX_PCI_DMA_H | ||
| 2 | #define _LINUX_PCI_DMA_H | ||
| 3 | |||
| 4 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) DEFINE_DMA_UNMAP_ADDR(ADDR_NAME); | ||
| 5 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) DEFINE_DMA_UNMAP_LEN(LEN_NAME); | ||
| 6 | #define pci_unmap_addr dma_unmap_addr | ||
| 7 | #define pci_unmap_addr_set dma_unmap_addr_set | ||
| 8 | #define pci_unmap_len dma_unmap_len | ||
| 9 | #define pci_unmap_len_set dma_unmap_len_set | ||
| 10 | |||
| 11 | #endif | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index cd5809a5963e..a788fa12ff31 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -769,8 +769,6 @@ int pci_try_set_mwi(struct pci_dev *dev); | |||
| 769 | void pci_clear_mwi(struct pci_dev *dev); | 769 | void pci_clear_mwi(struct pci_dev *dev); |
| 770 | void pci_intx(struct pci_dev *dev, int enable); | 770 | void pci_intx(struct pci_dev *dev, int enable); |
| 771 | void pci_msi_off(struct pci_dev *dev); | 771 | void pci_msi_off(struct pci_dev *dev); |
| 772 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); | ||
| 773 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); | ||
| 774 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); | 772 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); |
| 775 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); | 773 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); |
| 776 | int pcix_get_max_mmrbc(struct pci_dev *dev); | 774 | int pcix_get_max_mmrbc(struct pci_dev *dev); |
| @@ -904,6 +902,7 @@ int pci_set_vga_state(struct pci_dev *pdev, bool decode, | |||
| 904 | unsigned int command_bits, bool change_bridge); | 902 | unsigned int command_bits, bool change_bridge); |
| 905 | /* kmem_cache style wrapper around pci_alloc_consistent() */ | 903 | /* kmem_cache style wrapper around pci_alloc_consistent() */ |
| 906 | 904 | ||
| 905 | #include <linux/pci-dma.h> | ||
| 907 | #include <linux/dmapool.h> | 906 | #include <linux/dmapool.h> |
| 908 | 907 | ||
| 909 | #define pci_pool dma_pool | 908 | #define pci_pool dma_pool |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index c8f302991b66..c4c3d68be19a 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
| @@ -442,7 +442,10 @@ | |||
| 442 | #define PCI_EXP_LNKCTL_LABIE 0x0800 /* Lnk Autonomous Bandwidth Interrupt Enable */ | 442 | #define PCI_EXP_LNKCTL_LABIE 0x0800 /* Lnk Autonomous Bandwidth Interrupt Enable */ |
| 443 | #define PCI_EXP_LNKSTA 18 /* Link Status */ | 443 | #define PCI_EXP_LNKSTA 18 /* Link Status */ |
| 444 | #define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */ | 444 | #define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */ |
| 445 | #define PCI_EXP_LNKSTA_CLS_2_5GB 0x01 /* Current Link Speed 2.5GT/s */ | ||
| 446 | #define PCI_EXP_LNKSTA_CLS_5_0GB 0x02 /* Current Link Speed 5.0GT/s */ | ||
| 445 | #define PCI_EXP_LNKSTA_NLW 0x03f0 /* Nogotiated Link Width */ | 447 | #define PCI_EXP_LNKSTA_NLW 0x03f0 /* Nogotiated Link Width */ |
| 448 | #define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */ | ||
| 446 | #define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */ | 449 | #define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */ |
| 447 | #define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */ | 450 | #define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */ |
| 448 | #define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */ | 451 | #define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */ |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index a93e5bfdccb8..d3a38d687104 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
| @@ -2,10 +2,10 @@ | |||
| 2 | #define __LINUX_PERCPU_H | 2 | #define __LINUX_PERCPU_H |
| 3 | 3 | ||
| 4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
| 5 | #include <linux/slab.h> /* For kmalloc() */ | ||
| 6 | #include <linux/smp.h> | 5 | #include <linux/smp.h> |
| 7 | #include <linux/cpumask.h> | 6 | #include <linux/cpumask.h> |
| 8 | #include <linux/pfn.h> | 7 | #include <linux/pfn.h> |
| 8 | #include <linux/init.h> | ||
| 9 | 9 | ||
| 10 | #include <asm/percpu.h> | 10 | #include <asm/percpu.h> |
| 11 | 11 | ||
| @@ -135,9 +135,7 @@ extern int __init pcpu_page_first_chunk(size_t reserved_size, | |||
| 135 | #define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) | 135 | #define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) |
| 136 | 136 | ||
| 137 | extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align); | 137 | extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align); |
| 138 | extern void __percpu *__alloc_percpu(size_t size, size_t align); | 138 | extern bool is_kernel_percpu_address(unsigned long addr); |
| 139 | extern void free_percpu(void __percpu *__pdata); | ||
| 140 | extern phys_addr_t per_cpu_ptr_to_phys(void *addr); | ||
| 141 | 139 | ||
| 142 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA | 140 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA |
| 143 | extern void __init setup_per_cpu_areas(void); | 141 | extern void __init setup_per_cpu_areas(void); |
| @@ -147,25 +145,10 @@ extern void __init setup_per_cpu_areas(void); | |||
| 147 | 145 | ||
| 148 | #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) | 146 | #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) |
| 149 | 147 | ||
| 150 | static inline void __percpu *__alloc_percpu(size_t size, size_t align) | 148 | /* can't distinguish from other static vars, always false */ |
| 149 | static inline bool is_kernel_percpu_address(unsigned long addr) | ||
| 151 | { | 150 | { |
| 152 | /* | 151 | return false; |
| 153 | * Can't easily make larger alignment work with kmalloc. WARN | ||
| 154 | * on it. Larger alignment should only be used for module | ||
| 155 | * percpu sections on SMP for which this path isn't used. | ||
| 156 | */ | ||
| 157 | WARN_ON_ONCE(align > SMP_CACHE_BYTES); | ||
| 158 | return kzalloc(size, GFP_KERNEL); | ||
| 159 | } | ||
| 160 | |||
| 161 | static inline void free_percpu(void __percpu *p) | ||
| 162 | { | ||
| 163 | kfree(p); | ||
| 164 | } | ||
| 165 | |||
| 166 | static inline phys_addr_t per_cpu_ptr_to_phys(void *addr) | ||
| 167 | { | ||
| 168 | return __pa(addr); | ||
| 169 | } | 152 | } |
| 170 | 153 | ||
| 171 | static inline void __init setup_per_cpu_areas(void) { } | 154 | static inline void __init setup_per_cpu_areas(void) { } |
| @@ -177,6 +160,10 @@ static inline void *pcpu_lpage_remapped(void *kaddr) | |||
| 177 | 160 | ||
| 178 | #endif /* CONFIG_SMP */ | 161 | #endif /* CONFIG_SMP */ |
| 179 | 162 | ||
| 163 | extern void __percpu *__alloc_percpu(size_t size, size_t align); | ||
| 164 | extern void free_percpu(void __percpu *__pdata); | ||
| 165 | extern phys_addr_t per_cpu_ptr_to_phys(void *addr); | ||
| 166 | |||
| 180 | #define alloc_percpu(type) \ | 167 | #define alloc_percpu(type) \ |
| 181 | (typeof(type) __percpu *)__alloc_percpu(sizeof(type), __alignof__(type)) | 168 | (typeof(type) __percpu *)__alloc_percpu(sizeof(type), __alignof__(type)) |
| 182 | 169 | ||
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 7b18b4fd5df7..3fd5c82e0e18 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -203,8 +203,19 @@ struct perf_event_attr { | |||
| 203 | enable_on_exec : 1, /* next exec enables */ | 203 | enable_on_exec : 1, /* next exec enables */ |
| 204 | task : 1, /* trace fork/exit */ | 204 | task : 1, /* trace fork/exit */ |
| 205 | watermark : 1, /* wakeup_watermark */ | 205 | watermark : 1, /* wakeup_watermark */ |
| 206 | 206 | /* | |
| 207 | __reserved_1 : 49; | 207 | * precise_ip: |
| 208 | * | ||
| 209 | * 0 - SAMPLE_IP can have arbitrary skid | ||
| 210 | * 1 - SAMPLE_IP must have constant skid | ||
| 211 | * 2 - SAMPLE_IP requested to have 0 skid | ||
| 212 | * 3 - SAMPLE_IP must have 0 skid | ||
| 213 | * | ||
| 214 | * See also PERF_RECORD_MISC_EXACT_IP | ||
| 215 | */ | ||
| 216 | precise_ip : 2, /* skid constraint */ | ||
| 217 | |||
| 218 | __reserved_1 : 47; | ||
| 208 | 219 | ||
| 209 | union { | 220 | union { |
| 210 | __u32 wakeup_events; /* wakeup every n events */ | 221 | __u32 wakeup_events; /* wakeup every n events */ |
| @@ -287,11 +298,24 @@ struct perf_event_mmap_page { | |||
| 287 | __u64 data_tail; /* user-space written tail */ | 298 | __u64 data_tail; /* user-space written tail */ |
| 288 | }; | 299 | }; |
| 289 | 300 | ||
| 290 | #define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) | 301 | #define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0) |
| 291 | #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) | 302 | #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) |
| 292 | #define PERF_RECORD_MISC_KERNEL (1 << 0) | 303 | #define PERF_RECORD_MISC_KERNEL (1 << 0) |
| 293 | #define PERF_RECORD_MISC_USER (2 << 0) | 304 | #define PERF_RECORD_MISC_USER (2 << 0) |
| 294 | #define PERF_RECORD_MISC_HYPERVISOR (3 << 0) | 305 | #define PERF_RECORD_MISC_HYPERVISOR (3 << 0) |
| 306 | #define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0) | ||
| 307 | #define PERF_RECORD_MISC_GUEST_USER (5 << 0) | ||
| 308 | |||
| 309 | /* | ||
| 310 | * Indicates that the content of PERF_SAMPLE_IP points to | ||
| 311 | * the actual instruction that triggered the event. See also | ||
| 312 | * perf_event_attr::precise_ip. | ||
| 313 | */ | ||
| 314 | #define PERF_RECORD_MISC_EXACT_IP (1 << 14) | ||
| 315 | /* | ||
| 316 | * Reserve the last bit to indicate some extended misc field | ||
| 317 | */ | ||
| 318 | #define PERF_RECORD_MISC_EXT_RESERVED (1 << 15) | ||
| 295 | 319 | ||
| 296 | struct perf_event_header { | 320 | struct perf_event_header { |
| 297 | __u32 type; | 321 | __u32 type; |
| @@ -439,6 +463,12 @@ enum perf_callchain_context { | |||
| 439 | # include <asm/perf_event.h> | 463 | # include <asm/perf_event.h> |
| 440 | #endif | 464 | #endif |
| 441 | 465 | ||
| 466 | struct perf_guest_info_callbacks { | ||
| 467 | int (*is_in_guest) (void); | ||
| 468 | int (*is_user_mode) (void); | ||
| 469 | unsigned long (*get_guest_ip) (void); | ||
| 470 | }; | ||
| 471 | |||
| 442 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 472 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
| 443 | #include <asm/hw_breakpoint.h> | 473 | #include <asm/hw_breakpoint.h> |
| 444 | #endif | 474 | #endif |
| @@ -452,6 +482,8 @@ enum perf_callchain_context { | |||
| 452 | #include <linux/fs.h> | 482 | #include <linux/fs.h> |
| 453 | #include <linux/pid_namespace.h> | 483 | #include <linux/pid_namespace.h> |
| 454 | #include <linux/workqueue.h> | 484 | #include <linux/workqueue.h> |
| 485 | #include <linux/ftrace.h> | ||
| 486 | #include <linux/cpu.h> | ||
| 455 | #include <asm/atomic.h> | 487 | #include <asm/atomic.h> |
| 456 | 488 | ||
| 457 | #define PERF_MAX_STACK_DEPTH 255 | 489 | #define PERF_MAX_STACK_DEPTH 255 |
| @@ -466,6 +498,17 @@ struct perf_raw_record { | |||
| 466 | void *data; | 498 | void *data; |
| 467 | }; | 499 | }; |
| 468 | 500 | ||
| 501 | struct perf_branch_entry { | ||
| 502 | __u64 from; | ||
| 503 | __u64 to; | ||
| 504 | __u64 flags; | ||
| 505 | }; | ||
| 506 | |||
| 507 | struct perf_branch_stack { | ||
| 508 | __u64 nr; | ||
| 509 | struct perf_branch_entry entries[0]; | ||
| 510 | }; | ||
| 511 | |||
| 469 | struct task_struct; | 512 | struct task_struct; |
| 470 | 513 | ||
| 471 | /** | 514 | /** |
| @@ -487,9 +530,8 @@ struct hw_perf_event { | |||
| 487 | struct hrtimer hrtimer; | 530 | struct hrtimer hrtimer; |
| 488 | }; | 531 | }; |
| 489 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 532 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
| 490 | union { /* breakpoint */ | 533 | /* breakpoint */ |
| 491 | struct arch_hw_breakpoint info; | 534 | struct arch_hw_breakpoint info; |
| 492 | }; | ||
| 493 | #endif | 535 | #endif |
| 494 | }; | 536 | }; |
| 495 | atomic64_t prev_count; | 537 | atomic64_t prev_count; |
| @@ -505,6 +547,8 @@ struct hw_perf_event { | |||
| 505 | 547 | ||
| 506 | struct perf_event; | 548 | struct perf_event; |
| 507 | 549 | ||
| 550 | #define PERF_EVENT_TXN_STARTED 1 | ||
| 551 | |||
| 508 | /** | 552 | /** |
| 509 | * struct pmu - generic performance monitoring unit | 553 | * struct pmu - generic performance monitoring unit |
| 510 | */ | 554 | */ |
| @@ -515,6 +559,16 @@ struct pmu { | |||
| 515 | void (*stop) (struct perf_event *event); | 559 | void (*stop) (struct perf_event *event); |
| 516 | void (*read) (struct perf_event *event); | 560 | void (*read) (struct perf_event *event); |
| 517 | void (*unthrottle) (struct perf_event *event); | 561 | void (*unthrottle) (struct perf_event *event); |
| 562 | |||
| 563 | /* | ||
| 564 | * group events scheduling is treated as a transaction, | ||
| 565 | * add group events as a whole and perform one schedulability test. | ||
| 566 | * If test fails, roll back the whole group | ||
| 567 | */ | ||
| 568 | |||
| 569 | void (*start_txn) (const struct pmu *pmu); | ||
| 570 | void (*cancel_txn) (const struct pmu *pmu); | ||
| 571 | int (*commit_txn) (const struct pmu *pmu); | ||
| 518 | }; | 572 | }; |
| 519 | 573 | ||
| 520 | /** | 574 | /** |
| @@ -570,6 +624,14 @@ enum perf_group_flag { | |||
| 570 | PERF_GROUP_SOFTWARE = 0x1, | 624 | PERF_GROUP_SOFTWARE = 0x1, |
| 571 | }; | 625 | }; |
| 572 | 626 | ||
| 627 | #define SWEVENT_HLIST_BITS 8 | ||
| 628 | #define SWEVENT_HLIST_SIZE (1 << SWEVENT_HLIST_BITS) | ||
| 629 | |||
| 630 | struct swevent_hlist { | ||
| 631 | struct hlist_head heads[SWEVENT_HLIST_SIZE]; | ||
| 632 | struct rcu_head rcu_head; | ||
| 633 | }; | ||
| 634 | |||
| 573 | /** | 635 | /** |
| 574 | * struct perf_event - performance event kernel representation: | 636 | * struct perf_event - performance event kernel representation: |
| 575 | */ | 637 | */ |
| @@ -578,6 +640,7 @@ struct perf_event { | |||
| 578 | struct list_head group_entry; | 640 | struct list_head group_entry; |
| 579 | struct list_head event_entry; | 641 | struct list_head event_entry; |
| 580 | struct list_head sibling_list; | 642 | struct list_head sibling_list; |
| 643 | struct hlist_node hlist_entry; | ||
| 581 | int nr_siblings; | 644 | int nr_siblings; |
| 582 | int group_flags; | 645 | int group_flags; |
| 583 | struct perf_event *group_leader; | 646 | struct perf_event *group_leader; |
| @@ -725,6 +788,9 @@ struct perf_cpu_context { | |||
| 725 | int active_oncpu; | 788 | int active_oncpu; |
| 726 | int max_pertask; | 789 | int max_pertask; |
| 727 | int exclusive; | 790 | int exclusive; |
| 791 | struct swevent_hlist *swevent_hlist; | ||
| 792 | struct mutex hlist_mutex; | ||
| 793 | int hlist_refcount; | ||
| 728 | 794 | ||
| 729 | /* | 795 | /* |
| 730 | * Recursion avoidance: | 796 | * Recursion avoidance: |
| @@ -768,9 +834,6 @@ extern void perf_disable(void); | |||
| 768 | extern void perf_enable(void); | 834 | extern void perf_enable(void); |
| 769 | extern int perf_event_task_disable(void); | 835 | extern int perf_event_task_disable(void); |
| 770 | extern int perf_event_task_enable(void); | 836 | extern int perf_event_task_enable(void); |
| 771 | extern int hw_perf_group_sched_in(struct perf_event *group_leader, | ||
| 772 | struct perf_cpu_context *cpuctx, | ||
| 773 | struct perf_event_context *ctx); | ||
| 774 | extern void perf_event_update_userpage(struct perf_event *event); | 837 | extern void perf_event_update_userpage(struct perf_event *event); |
| 775 | extern int perf_event_release_kernel(struct perf_event *event); | 838 | extern int perf_event_release_kernel(struct perf_event *event); |
| 776 | extern struct perf_event * | 839 | extern struct perf_event * |
| @@ -802,6 +865,13 @@ struct perf_sample_data { | |||
| 802 | struct perf_raw_record *raw; | 865 | struct perf_raw_record *raw; |
| 803 | }; | 866 | }; |
| 804 | 867 | ||
| 868 | static inline | ||
| 869 | void perf_sample_data_init(struct perf_sample_data *data, u64 addr) | ||
| 870 | { | ||
| 871 | data->addr = addr; | ||
| 872 | data->raw = NULL; | ||
| 873 | } | ||
| 874 | |||
| 805 | extern void perf_output_sample(struct perf_output_handle *handle, | 875 | extern void perf_output_sample(struct perf_output_handle *handle, |
| 806 | struct perf_event_header *header, | 876 | struct perf_event_header *header, |
| 807 | struct perf_sample_data *data, | 877 | struct perf_sample_data *data, |
| @@ -834,11 +904,56 @@ extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; | |||
| 834 | 904 | ||
| 835 | extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); | 905 | extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); |
| 836 | 906 | ||
| 907 | extern void | ||
| 908 | perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip); | ||
| 909 | |||
| 910 | /* | ||
| 911 | * Take a snapshot of the regs. Skip ip and frame pointer to | ||
| 912 | * the nth caller. We only need a few of the regs: | ||
| 913 | * - ip for PERF_SAMPLE_IP | ||
| 914 | * - cs for user_mode() tests | ||
| 915 | * - bp for callchains | ||
| 916 | * - eflags, for future purposes, just in case | ||
| 917 | */ | ||
| 918 | static inline void perf_fetch_caller_regs(struct pt_regs *regs, int skip) | ||
| 919 | { | ||
| 920 | unsigned long ip; | ||
| 921 | |||
| 922 | memset(regs, 0, sizeof(*regs)); | ||
| 923 | |||
| 924 | switch (skip) { | ||
| 925 | case 1 : | ||
| 926 | ip = CALLER_ADDR0; | ||
| 927 | break; | ||
| 928 | case 2 : | ||
| 929 | ip = CALLER_ADDR1; | ||
| 930 | break; | ||
| 931 | case 3 : | ||
| 932 | ip = CALLER_ADDR2; | ||
| 933 | break; | ||
| 934 | case 4: | ||
| 935 | ip = CALLER_ADDR3; | ||
| 936 | break; | ||
| 937 | /* No need to support further for now */ | ||
| 938 | default: | ||
| 939 | ip = 0; | ||
| 940 | } | ||
| 941 | |||
| 942 | return perf_arch_fetch_caller_regs(regs, ip, skip); | ||
| 943 | } | ||
| 944 | |||
| 837 | static inline void | 945 | static inline void |
| 838 | perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr) | 946 | perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr) |
| 839 | { | 947 | { |
| 840 | if (atomic_read(&perf_swevent_enabled[event_id])) | 948 | if (atomic_read(&perf_swevent_enabled[event_id])) { |
| 949 | struct pt_regs hot_regs; | ||
| 950 | |||
| 951 | if (!regs) { | ||
| 952 | perf_fetch_caller_regs(&hot_regs, 1); | ||
| 953 | regs = &hot_regs; | ||
| 954 | } | ||
| 841 | __perf_sw_event(event_id, nr, nmi, regs, addr); | 955 | __perf_sw_event(event_id, nr, nmi, regs, addr); |
| 956 | } | ||
| 842 | } | 957 | } |
| 843 | 958 | ||
| 844 | extern void __perf_event_mmap(struct vm_area_struct *vma); | 959 | extern void __perf_event_mmap(struct vm_area_struct *vma); |
| @@ -849,6 +964,10 @@ static inline void perf_event_mmap(struct vm_area_struct *vma) | |||
| 849 | __perf_event_mmap(vma); | 964 | __perf_event_mmap(vma); |
| 850 | } | 965 | } |
| 851 | 966 | ||
| 967 | extern struct perf_guest_info_callbacks *perf_guest_cbs; | ||
| 968 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | ||
| 969 | extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | ||
| 970 | |||
| 852 | extern void perf_event_comm(struct task_struct *tsk); | 971 | extern void perf_event_comm(struct task_struct *tsk); |
| 853 | extern void perf_event_fork(struct task_struct *tsk); | 972 | extern void perf_event_fork(struct task_struct *tsk); |
| 854 | 973 | ||
| @@ -858,8 +977,24 @@ extern int sysctl_perf_event_paranoid; | |||
| 858 | extern int sysctl_perf_event_mlock; | 977 | extern int sysctl_perf_event_mlock; |
| 859 | extern int sysctl_perf_event_sample_rate; | 978 | extern int sysctl_perf_event_sample_rate; |
| 860 | 979 | ||
| 980 | static inline bool perf_paranoid_tracepoint_raw(void) | ||
| 981 | { | ||
| 982 | return sysctl_perf_event_paranoid > -1; | ||
| 983 | } | ||
| 984 | |||
| 985 | static inline bool perf_paranoid_cpu(void) | ||
| 986 | { | ||
| 987 | return sysctl_perf_event_paranoid > 0; | ||
| 988 | } | ||
| 989 | |||
| 990 | static inline bool perf_paranoid_kernel(void) | ||
| 991 | { | ||
| 992 | return sysctl_perf_event_paranoid > 1; | ||
| 993 | } | ||
| 994 | |||
| 861 | extern void perf_event_init(void); | 995 | extern void perf_event_init(void); |
| 862 | extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, int entry_size); | 996 | extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, |
| 997 | int entry_size, struct pt_regs *regs); | ||
| 863 | extern void perf_bp_event(struct perf_event *event, void *data); | 998 | extern void perf_bp_event(struct perf_event *event, void *data); |
| 864 | 999 | ||
| 865 | #ifndef perf_misc_flags | 1000 | #ifndef perf_misc_flags |
| @@ -902,6 +1037,11 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, | |||
| 902 | static inline void | 1037 | static inline void |
| 903 | perf_bp_event(struct perf_event *event, void *data) { } | 1038 | perf_bp_event(struct perf_event *event, void *data) { } |
| 904 | 1039 | ||
| 1040 | static inline int perf_register_guest_info_callbacks | ||
| 1041 | (struct perf_guest_info_callbacks *callbacks) { return 0; } | ||
| 1042 | static inline int perf_unregister_guest_info_callbacks | ||
| 1043 | (struct perf_guest_info_callbacks *callbacks) { return 0; } | ||
| 1044 | |||
| 905 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } | 1045 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } |
| 906 | static inline void perf_event_comm(struct task_struct *tsk) { } | 1046 | static inline void perf_event_comm(struct task_struct *tsk) { } |
| 907 | static inline void perf_event_fork(struct task_struct *tsk) { } | 1047 | static inline void perf_event_fork(struct task_struct *tsk) { } |
| @@ -915,5 +1055,21 @@ static inline void perf_event_disable(struct perf_event *event) { } | |||
| 915 | #define perf_output_put(handle, x) \ | 1055 | #define perf_output_put(handle, x) \ |
| 916 | perf_output_copy((handle), &(x), sizeof(x)) | 1056 | perf_output_copy((handle), &(x), sizeof(x)) |
| 917 | 1057 | ||
| 1058 | /* | ||
| 1059 | * This has to have a higher priority than migration_notifier in sched.c. | ||
| 1060 | */ | ||
| 1061 | #define perf_cpu_notifier(fn) \ | ||
| 1062 | do { \ | ||
| 1063 | static struct notifier_block fn##_nb __cpuinitdata = \ | ||
| 1064 | { .notifier_call = fn, .priority = 20 }; \ | ||
| 1065 | fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \ | ||
| 1066 | (void *)(unsigned long)smp_processor_id()); \ | ||
| 1067 | fn(&fn##_nb, (unsigned long)CPU_STARTING, \ | ||
| 1068 | (void *)(unsigned long)smp_processor_id()); \ | ||
| 1069 | fn(&fn##_nb, (unsigned long)CPU_ONLINE, \ | ||
| 1070 | (void *)(unsigned long)smp_processor_id()); \ | ||
| 1071 | register_cpu_notifier(&fn##_nb); \ | ||
| 1072 | } while (0) | ||
| 1073 | |||
| 918 | #endif /* __KERNEL__ */ | 1074 | #endif /* __KERNEL__ */ |
| 919 | #endif /* _LINUX_PERF_EVENT_H */ | 1075 | #endif /* _LINUX_PERF_EVENT_H */ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 14d7fdf6a90a..987e111f7b11 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/mii.h> | 24 | #include <linux/mii.h> |
| 25 | #include <linux/timer.h> | 25 | #include <linux/timer.h> |
| 26 | #include <linux/workqueue.h> | 26 | #include <linux/workqueue.h> |
| 27 | #include <linux/mod_devicetable.h> | ||
| 27 | 28 | ||
| 28 | #include <asm/atomic.h> | 29 | #include <asm/atomic.h> |
| 29 | 30 | ||
| @@ -81,6 +82,10 @@ typedef enum { | |||
| 81 | */ | 82 | */ |
| 82 | #define MII_BUS_ID_SIZE (20 - 3) | 83 | #define MII_BUS_ID_SIZE (20 - 3) |
| 83 | 84 | ||
| 85 | /* Or MII_ADDR_C45 into regnum for read/write on mii_bus to enable the 21 bit | ||
| 86 | IEEE 802.3ae clause 45 addressing mode used by 10GIGE phy chips. */ | ||
| 87 | #define MII_ADDR_C45 (1<<30) | ||
| 88 | |||
| 84 | /* | 89 | /* |
| 85 | * The Bus class for PHYs. Devices which provide access to | 90 | * The Bus class for PHYs. Devices which provide access to |
| 86 | * PHYs should register using this structure | 91 | * PHYs should register using this structure |
| @@ -127,8 +132,8 @@ int mdiobus_register(struct mii_bus *bus); | |||
| 127 | void mdiobus_unregister(struct mii_bus *bus); | 132 | void mdiobus_unregister(struct mii_bus *bus); |
| 128 | void mdiobus_free(struct mii_bus *bus); | 133 | void mdiobus_free(struct mii_bus *bus); |
| 129 | struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr); | 134 | struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr); |
| 130 | int mdiobus_read(struct mii_bus *bus, int addr, u16 regnum); | 135 | int mdiobus_read(struct mii_bus *bus, int addr, u32 regnum); |
| 131 | int mdiobus_write(struct mii_bus *bus, int addr, u16 regnum, u16 val); | 136 | int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val); |
| 132 | 137 | ||
| 133 | 138 | ||
| 134 | #define PHY_INTERRUPT_DISABLED 0x0 | 139 | #define PHY_INTERRUPT_DISABLED 0x0 |
| @@ -422,7 +427,7 @@ struct phy_fixup { | |||
| 422 | * because the bus read/write functions may wait for an interrupt | 427 | * because the bus read/write functions may wait for an interrupt |
| 423 | * to conclude the operation. | 428 | * to conclude the operation. |
| 424 | */ | 429 | */ |
| 425 | static inline int phy_read(struct phy_device *phydev, u16 regnum) | 430 | static inline int phy_read(struct phy_device *phydev, u32 regnum) |
| 426 | { | 431 | { |
| 427 | return mdiobus_read(phydev->bus, phydev->addr, regnum); | 432 | return mdiobus_read(phydev->bus, phydev->addr, regnum); |
| 428 | } | 433 | } |
| @@ -437,7 +442,7 @@ static inline int phy_read(struct phy_device *phydev, u16 regnum) | |||
| 437 | * because the bus read/write functions may wait for an interrupt | 442 | * because the bus read/write functions may wait for an interrupt |
| 438 | * to conclude the operation. | 443 | * to conclude the operation. |
| 439 | */ | 444 | */ |
| 440 | static inline int phy_write(struct phy_device *phydev, u16 regnum, u16 val) | 445 | static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val) |
| 441 | { | 446 | { |
| 442 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); | 447 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); |
| 443 | } | 448 | } |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 71ff887ca44e..5417944d3687 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -21,7 +21,7 @@ struct platform_device { | |||
| 21 | u32 num_resources; | 21 | u32 num_resources; |
| 22 | struct resource * resource; | 22 | struct resource * resource; |
| 23 | 23 | ||
| 24 | struct platform_device_id *id_entry; | 24 | const struct platform_device_id *id_entry; |
| 25 | 25 | ||
| 26 | /* arch specific additions */ | 26 | /* arch specific additions */ |
| 27 | struct pdev_archdata archdata; | 27 | struct pdev_archdata archdata; |
| @@ -44,12 +44,14 @@ extern int platform_get_irq_byname(struct platform_device *, const char *); | |||
| 44 | extern int platform_add_devices(struct platform_device **, int); | 44 | extern int platform_add_devices(struct platform_device **, int); |
| 45 | 45 | ||
| 46 | extern struct platform_device *platform_device_register_simple(const char *, int id, | 46 | extern struct platform_device *platform_device_register_simple(const char *, int id, |
| 47 | struct resource *, unsigned int); | 47 | const struct resource *, unsigned int); |
| 48 | extern struct platform_device *platform_device_register_data(struct device *, | 48 | extern struct platform_device *platform_device_register_data(struct device *, |
| 49 | const char *, int, const void *, size_t); | 49 | const char *, int, const void *, size_t); |
| 50 | 50 | ||
| 51 | extern struct platform_device *platform_device_alloc(const char *name, int id); | 51 | extern struct platform_device *platform_device_alloc(const char *name, int id); |
| 52 | extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); | 52 | extern int platform_device_add_resources(struct platform_device *pdev, |
| 53 | const struct resource *res, | ||
| 54 | unsigned int num); | ||
| 53 | extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); | 55 | extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); |
| 54 | extern int platform_device_add(struct platform_device *pdev); | 56 | extern int platform_device_add(struct platform_device *pdev); |
| 55 | extern void platform_device_del(struct platform_device *pdev); | 57 | extern void platform_device_del(struct platform_device *pdev); |
| @@ -62,7 +64,7 @@ struct platform_driver { | |||
| 62 | int (*suspend)(struct platform_device *, pm_message_t state); | 64 | int (*suspend)(struct platform_device *, pm_message_t state); |
| 63 | int (*resume)(struct platform_device *); | 65 | int (*resume)(struct platform_device *); |
| 64 | struct device_driver driver; | 66 | struct device_driver driver; |
| 65 | struct platform_device_id *id_table; | 67 | const struct platform_device_id *id_table; |
| 66 | }; | 68 | }; |
| 67 | 69 | ||
| 68 | extern int platform_driver_register(struct platform_driver *); | 70 | extern int platform_driver_register(struct platform_driver *); |
| @@ -77,6 +79,11 @@ extern int platform_driver_probe(struct platform_driver *driver, | |||
| 77 | #define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) | 79 | #define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) |
| 78 | #define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) | 80 | #define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) |
| 79 | 81 | ||
| 82 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, | ||
| 83 | int (*probe)(struct platform_device *), | ||
| 84 | struct resource *res, unsigned int n_res, | ||
| 85 | const void *data, size_t size); | ||
| 86 | |||
| 80 | /* early platform driver interface */ | 87 | /* early platform driver interface */ |
| 81 | struct early_platform_driver { | 88 | struct early_platform_driver { |
| 82 | const char *class_str; | 89 | const char *class_str; |
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h index d74f75ed1e47..8ba440e5eb7f 100644 --- a/include/linux/pm_qos_params.h +++ b/include/linux/pm_qos_params.h | |||
| @@ -14,12 +14,14 @@ | |||
| 14 | #define PM_QOS_NUM_CLASSES 4 | 14 | #define PM_QOS_NUM_CLASSES 4 |
| 15 | #define PM_QOS_DEFAULT_VALUE -1 | 15 | #define PM_QOS_DEFAULT_VALUE -1 |
| 16 | 16 | ||
| 17 | int pm_qos_add_requirement(int qos, char *name, s32 value); | 17 | struct pm_qos_request_list; |
| 18 | int pm_qos_update_requirement(int qos, char *name, s32 new_value); | ||
| 19 | void pm_qos_remove_requirement(int qos, char *name); | ||
| 20 | 18 | ||
| 21 | int pm_qos_requirement(int qos); | 19 | struct pm_qos_request_list *pm_qos_add_request(int pm_qos_class, s32 value); |
| 20 | void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req, | ||
| 21 | s32 new_value); | ||
| 22 | void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req); | ||
| 22 | 23 | ||
| 23 | int pm_qos_add_notifier(int qos, struct notifier_block *notifier); | 24 | int pm_qos_request(int pm_qos_class); |
| 24 | int pm_qos_remove_notifier(int qos, struct notifier_block *notifier); | 25 | int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier); |
| 26 | int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier); | ||
| 25 | 27 | ||
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index b776db737244..6e81888c6222 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
| @@ -30,6 +30,9 @@ extern void pm_runtime_enable(struct device *dev); | |||
| 30 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); | 30 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); |
| 31 | extern void pm_runtime_allow(struct device *dev); | 31 | extern void pm_runtime_allow(struct device *dev); |
| 32 | extern void pm_runtime_forbid(struct device *dev); | 32 | extern void pm_runtime_forbid(struct device *dev); |
| 33 | extern int pm_generic_runtime_idle(struct device *dev); | ||
| 34 | extern int pm_generic_runtime_suspend(struct device *dev); | ||
| 35 | extern int pm_generic_runtime_resume(struct device *dev); | ||
| 33 | 36 | ||
| 34 | static inline bool pm_children_suspended(struct device *dev) | 37 | static inline bool pm_children_suspended(struct device *dev) |
| 35 | { | 38 | { |
| @@ -96,6 +99,10 @@ static inline bool device_run_wake(struct device *dev) { return false; } | |||
| 96 | static inline void device_set_run_wake(struct device *dev, bool enable) {} | 99 | static inline void device_set_run_wake(struct device *dev, bool enable) {} |
| 97 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } | 100 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } |
| 98 | 101 | ||
| 102 | static inline int pm_generic_runtime_idle(struct device *dev) { return 0; } | ||
| 103 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | ||
| 104 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | ||
| 105 | |||
| 99 | #endif /* !CONFIG_PM_RUNTIME */ | 106 | #endif /* !CONFIG_PM_RUNTIME */ |
| 100 | 107 | ||
| 101 | static inline int pm_runtime_get(struct device *dev) | 108 | static inline int pm_runtime_get(struct device *dev) |
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h index 0aae7776185e..22d64c18056c 100644 --- a/include/linux/pm_wakeup.h +++ b/include/linux/pm_wakeup.h | |||
| @@ -25,32 +25,34 @@ | |||
| 25 | # error "please don't include this file directly" | 25 | # error "please don't include this file directly" |
| 26 | #endif | 26 | #endif |
| 27 | 27 | ||
| 28 | #include <linux/types.h> | ||
| 29 | |||
| 28 | #ifdef CONFIG_PM | 30 | #ifdef CONFIG_PM |
| 29 | 31 | ||
| 30 | /* changes to device_may_wakeup take effect on the next pm state change. | 32 | /* changes to device_may_wakeup take effect on the next pm state change. |
| 31 | * by default, devices should wakeup if they can. | 33 | * by default, devices should wakeup if they can. |
| 32 | */ | 34 | */ |
| 33 | static inline void device_init_wakeup(struct device *dev, int val) | 35 | static inline void device_init_wakeup(struct device *dev, bool val) |
| 34 | { | 36 | { |
| 35 | dev->power.can_wakeup = dev->power.should_wakeup = !!val; | 37 | dev->power.can_wakeup = dev->power.should_wakeup = val; |
| 36 | } | 38 | } |
| 37 | 39 | ||
| 38 | static inline void device_set_wakeup_capable(struct device *dev, int val) | 40 | static inline void device_set_wakeup_capable(struct device *dev, bool capable) |
| 39 | { | 41 | { |
| 40 | dev->power.can_wakeup = !!val; | 42 | dev->power.can_wakeup = capable; |
| 41 | } | 43 | } |
| 42 | 44 | ||
| 43 | static inline int device_can_wakeup(struct device *dev) | 45 | static inline bool device_can_wakeup(struct device *dev) |
| 44 | { | 46 | { |
| 45 | return dev->power.can_wakeup; | 47 | return dev->power.can_wakeup; |
| 46 | } | 48 | } |
| 47 | 49 | ||
| 48 | static inline void device_set_wakeup_enable(struct device *dev, int val) | 50 | static inline void device_set_wakeup_enable(struct device *dev, bool enable) |
| 49 | { | 51 | { |
| 50 | dev->power.should_wakeup = !!val; | 52 | dev->power.should_wakeup = enable; |
| 51 | } | 53 | } |
| 52 | 54 | ||
| 53 | static inline int device_may_wakeup(struct device *dev) | 55 | static inline bool device_may_wakeup(struct device *dev) |
| 54 | { | 56 | { |
| 55 | return dev->power.can_wakeup && dev->power.should_wakeup; | 57 | return dev->power.can_wakeup && dev->power.should_wakeup; |
| 56 | } | 58 | } |
| @@ -58,20 +60,28 @@ static inline int device_may_wakeup(struct device *dev) | |||
| 58 | #else /* !CONFIG_PM */ | 60 | #else /* !CONFIG_PM */ |
| 59 | 61 | ||
| 60 | /* For some reason the next two routines work even without CONFIG_PM */ | 62 | /* For some reason the next two routines work even without CONFIG_PM */ |
| 61 | static inline void device_init_wakeup(struct device *dev, int val) | 63 | static inline void device_init_wakeup(struct device *dev, bool val) |
| 62 | { | 64 | { |
| 63 | dev->power.can_wakeup = !!val; | 65 | dev->power.can_wakeup = val; |
| 64 | } | 66 | } |
| 65 | 67 | ||
| 66 | static inline void device_set_wakeup_capable(struct device *dev, int val) { } | 68 | static inline void device_set_wakeup_capable(struct device *dev, bool capable) |
| 69 | { | ||
| 70 | } | ||
| 67 | 71 | ||
| 68 | static inline int device_can_wakeup(struct device *dev) | 72 | static inline bool device_can_wakeup(struct device *dev) |
| 69 | { | 73 | { |
| 70 | return dev->power.can_wakeup; | 74 | return dev->power.can_wakeup; |
| 71 | } | 75 | } |
| 72 | 76 | ||
| 73 | #define device_set_wakeup_enable(dev, val) do {} while (0) | 77 | static inline void device_set_wakeup_enable(struct device *dev, bool enable) |
| 74 | #define device_may_wakeup(dev) 0 | 78 | { |
| 79 | } | ||
| 80 | |||
| 81 | static inline bool device_may_wakeup(struct device *dev) | ||
| 82 | { | ||
| 83 | return false; | ||
| 84 | } | ||
| 75 | 85 | ||
| 76 | #endif /* !CONFIG_PM */ | 86 | #endif /* !CONFIG_PM */ |
| 77 | 87 | ||
diff --git a/include/linux/poison.h b/include/linux/poison.h index 2110a81c5e2a..34066ffd893d 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h | |||
| @@ -48,6 +48,15 @@ | |||
| 48 | #define POISON_FREE 0x6b /* for use-after-free poisoning */ | 48 | #define POISON_FREE 0x6b /* for use-after-free poisoning */ |
| 49 | #define POISON_END 0xa5 /* end-byte of poisoning */ | 49 | #define POISON_END 0xa5 /* end-byte of poisoning */ |
| 50 | 50 | ||
| 51 | /********** mm/hugetlb.c **********/ | ||
| 52 | /* | ||
| 53 | * Private mappings of hugetlb pages use this poisoned value for | ||
| 54 | * page->mapping. The core VM should not be doing anything with this mapping | ||
| 55 | * but futex requires the existence of some page->mapping value even though it | ||
| 56 | * is unused if PAGE_MAPPING_ANON is set. | ||
| 57 | */ | ||
| 58 | #define HUGETLB_POISON ((void *)(0x00300300 + POISON_POINTER_DELTA + PAGE_MAPPING_ANON)) | ||
| 59 | |||
| 51 | /********** arch/$ARCH/mm/init.c **********/ | 60 | /********** arch/$ARCH/mm/init.c **********/ |
| 52 | #define POISON_FREE_INITMEM 0xcc | 61 | #define POISON_FREE_INITMEM 0xcc |
| 53 | 62 | ||
diff --git a/include/linux/poll.h b/include/linux/poll.h index 6673743946f7..600cc1fde64d 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h | |||
| @@ -10,8 +10,10 @@ | |||
| 10 | #include <linux/wait.h> | 10 | #include <linux/wait.h> |
| 11 | #include <linux/string.h> | 11 | #include <linux/string.h> |
| 12 | #include <linux/fs.h> | 12 | #include <linux/fs.h> |
| 13 | #include <linux/sysctl.h> | ||
| 13 | #include <asm/uaccess.h> | 14 | #include <asm/uaccess.h> |
| 14 | 15 | ||
| 16 | extern struct ctl_table epoll_table[]; /* for sysctl */ | ||
| 15 | /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating | 17 | /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating |
| 16 | additional memory. */ | 18 | additional memory. */ |
| 17 | #define MAX_STACK_ALLOC 832 | 19 | #define MAX_STACK_ALLOC 832 |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index b5d096d3a9be..ebd2b8fb00d0 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
| @@ -82,6 +82,7 @@ enum power_supply_property { | |||
| 82 | POWER_SUPPLY_PROP_PRESENT, | 82 | POWER_SUPPLY_PROP_PRESENT, |
| 83 | POWER_SUPPLY_PROP_ONLINE, | 83 | POWER_SUPPLY_PROP_ONLINE, |
| 84 | POWER_SUPPLY_PROP_TECHNOLOGY, | 84 | POWER_SUPPLY_PROP_TECHNOLOGY, |
| 85 | POWER_SUPPLY_PROP_CYCLE_COUNT, | ||
| 85 | POWER_SUPPLY_PROP_VOLTAGE_MAX, | 86 | POWER_SUPPLY_PROP_VOLTAGE_MAX, |
| 86 | POWER_SUPPLY_PROP_VOLTAGE_MIN, | 87 | POWER_SUPPLY_PROP_VOLTAGE_MIN, |
| 87 | POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, | 88 | POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, |
diff --git a/include/linux/ppp_channel.h b/include/linux/ppp_channel.h index 0d3fa63e90ea..bff98ec1bfed 100644 --- a/include/linux/ppp_channel.h +++ b/include/linux/ppp_channel.h | |||
| @@ -72,6 +72,9 @@ extern int ppp_channel_index(struct ppp_channel *); | |||
| 72 | /* Get the unit number associated with a channel, or -1 if none */ | 72 | /* Get the unit number associated with a channel, or -1 if none */ |
| 73 | extern int ppp_unit_number(struct ppp_channel *); | 73 | extern int ppp_unit_number(struct ppp_channel *); |
| 74 | 74 | ||
| 75 | /* Get the device name associated with a channel, or NULL if none */ | ||
| 76 | extern char *ppp_dev_name(struct ppp_channel *); | ||
| 77 | |||
| 75 | /* | 78 | /* |
| 76 | * SMP locking notes: | 79 | * SMP locking notes: |
| 77 | * The channel code must ensure that when it calls ppp_unregister_channel, | 80 | * The channel code must ensure that when it calls ppp_unregister_channel, |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index c5eab89da51e..4272521e29e9 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
| @@ -264,6 +264,9 @@ static inline void user_enable_single_step(struct task_struct *task) | |||
| 264 | static inline void user_disable_single_step(struct task_struct *task) | 264 | static inline void user_disable_single_step(struct task_struct *task) |
| 265 | { | 265 | { |
| 266 | } | 266 | } |
| 267 | #else | ||
| 268 | extern void user_enable_single_step(struct task_struct *); | ||
| 269 | extern void user_disable_single_step(struct task_struct *); | ||
| 267 | #endif /* arch_has_single_step */ | 270 | #endif /* arch_has_single_step */ |
| 268 | 271 | ||
| 269 | #ifndef arch_has_block_step | 272 | #ifndef arch_has_block_step |
| @@ -291,6 +294,8 @@ static inline void user_enable_block_step(struct task_struct *task) | |||
| 291 | { | 294 | { |
| 292 | BUG(); /* This can never be called. */ | 295 | BUG(); /* This can never be called. */ |
| 293 | } | 296 | } |
| 297 | #else | ||
| 298 | extern void user_enable_block_step(struct task_struct *); | ||
| 294 | #endif /* arch_has_block_step */ | 299 | #endif /* arch_has_block_step */ |
| 295 | 300 | ||
| 296 | #ifdef ARCH_HAS_USER_SINGLE_STEP_INFO | 301 | #ifdef ARCH_HAS_USER_SINGLE_STEP_INFO |
| @@ -340,18 +345,6 @@ static inline void user_single_step_siginfo(struct task_struct *tsk, | |||
| 340 | #define arch_ptrace_stop(code, info) do { } while (0) | 345 | #define arch_ptrace_stop(code, info) do { } while (0) |
| 341 | #endif | 346 | #endif |
| 342 | 347 | ||
| 343 | #ifndef arch_ptrace_untrace | ||
| 344 | /* | ||
| 345 | * Do machine-specific work before untracing child. | ||
| 346 | * | ||
| 347 | * This is called for a normal detach as well as from ptrace_exit() | ||
| 348 | * when the tracing task dies. | ||
| 349 | * | ||
| 350 | * Called with write_lock(&tasklist_lock) held. | ||
| 351 | */ | ||
| 352 | #define arch_ptrace_untrace(task) do { } while (0) | ||
| 353 | #endif | ||
| 354 | |||
| 355 | extern int task_current_syscall(struct task_struct *target, long *callno, | 348 | extern int task_current_syscall(struct task_struct *target, long *callno, |
| 356 | unsigned long args[6], unsigned int maxargs, | 349 | unsigned long args[6], unsigned int maxargs, |
| 357 | unsigned long *sp, unsigned long *pc); | 350 | unsigned long *sp, unsigned long *pc); |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index c5da74918096..55ca73cf25e5 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
| @@ -121,6 +121,13 @@ do { \ | |||
| 121 | * (Note, rcu_assign_pointer and rcu_dereference are not needed to control | 121 | * (Note, rcu_assign_pointer and rcu_dereference are not needed to control |
| 122 | * access to data items when inserting into or looking up from the radix tree) | 122 | * access to data items when inserting into or looking up from the radix tree) |
| 123 | * | 123 | * |
| 124 | * Note that the value returned by radix_tree_tag_get() may not be relied upon | ||
| 125 | * if only the RCU read lock is held. Functions to set/clear tags and to | ||
| 126 | * delete nodes running concurrently with it may affect its result such that | ||
| 127 | * two consecutive reads in the same locked section may return different | ||
| 128 | * values. If reliability is required, modification functions must also be | ||
| 129 | * excluded from concurrency. | ||
| 130 | * | ||
| 124 | * radix_tree_tagged is able to be called without locking or RCU. | 131 | * radix_tree_tagged is able to be called without locking or RCU. |
| 125 | */ | 132 | */ |
| 126 | 133 | ||
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index 4e768dda87b0..8600508c77a6 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
| @@ -20,4 +20,6 @@ extern const struct file_operations ramfs_file_operations; | |||
| 20 | extern const struct vm_operations_struct generic_file_vm_ops; | 20 | extern const struct vm_operations_struct generic_file_vm_ops; |
| 21 | extern int __init init_rootfs(void); | 21 | extern int __init init_rootfs(void); |
| 22 | 22 | ||
| 23 | int ramfs_fill_super(struct super_block *sb, void *data, int silent); | ||
| 24 | |||
| 23 | #endif | 25 | #endif |
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index 9c295411d01f..fe1872e5b37e 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h | |||
| @@ -25,10 +25,10 @@ | |||
| 25 | 25 | ||
| 26 | Some example of insert and search follows here. The search is a plain | 26 | Some example of insert and search follows here. The search is a plain |
| 27 | normal search over an ordered tree. The insert instead must be implemented | 27 | normal search over an ordered tree. The insert instead must be implemented |
| 28 | int two steps: as first thing the code must insert the element in | 28 | in two steps: First, the code must insert the element in order as a red leaf |
| 29 | order as a red leaf in the tree, then the support library function | 29 | in the tree, and then the support library function rb_insert_color() must |
| 30 | rb_insert_color() must be called. Such function will do the | 30 | be called. Such function will do the not trivial work to rebalance the |
| 31 | not trivial work to rebalance the rbtree if necessary. | 31 | rbtree, if necessary. |
| 32 | 32 | ||
| 33 | ----------------------------------------------------------------------- | 33 | ----------------------------------------------------------------------- |
| 34 | static inline struct page * rb_search_page_cache(struct inode * inode, | 34 | static inline struct page * rb_search_page_cache(struct inode * inode, |
| @@ -110,6 +110,7 @@ struct rb_node | |||
| 110 | struct rb_root | 110 | struct rb_root |
| 111 | { | 111 | { |
| 112 | struct rb_node *rb_node; | 112 | struct rb_node *rb_node; |
| 113 | void (*augment_cb)(struct rb_node *node); | ||
| 113 | }; | 114 | }; |
| 114 | 115 | ||
| 115 | 116 | ||
| @@ -129,7 +130,9 @@ static inline void rb_set_color(struct rb_node *rb, int color) | |||
| 129 | rb->rb_parent_color = (rb->rb_parent_color & ~1) | color; | 130 | rb->rb_parent_color = (rb->rb_parent_color & ~1) | color; |
| 130 | } | 131 | } |
| 131 | 132 | ||
| 132 | #define RB_ROOT (struct rb_root) { NULL, } | 133 | #define RB_ROOT (struct rb_root) { NULL, NULL, } |
| 134 | #define RB_AUGMENT_ROOT(x) (struct rb_root) { NULL, x} | ||
| 135 | |||
| 133 | #define rb_entry(ptr, type, member) container_of(ptr, type, member) | 136 | #define rb_entry(ptr, type, member) container_of(ptr, type, member) |
| 134 | 137 | ||
| 135 | #define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) | 138 | #define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 2c9b46cff3d7..4ec3b38ce9c5 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
| @@ -428,5 +428,47 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
| 428 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 428 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ |
| 429 | pos = rcu_dereference_raw(pos->next)) | 429 | pos = rcu_dereference_raw(pos->next)) |
| 430 | 430 | ||
| 431 | /** | ||
| 432 | * hlist_for_each_entry_rcu_bh - iterate over rcu list of given type | ||
| 433 | * @tpos: the type * to use as a loop cursor. | ||
| 434 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 435 | * @head: the head for your list. | ||
| 436 | * @member: the name of the hlist_node within the struct. | ||
| 437 | * | ||
| 438 | * This list-traversal primitive may safely run concurrently with | ||
| 439 | * the _rcu list-mutation primitives such as hlist_add_head_rcu() | ||
| 440 | * as long as the traversal is guarded by rcu_read_lock(). | ||
| 441 | */ | ||
| 442 | #define hlist_for_each_entry_rcu_bh(tpos, pos, head, member) \ | ||
| 443 | for (pos = rcu_dereference_bh((head)->first); \ | ||
| 444 | pos && ({ prefetch(pos->next); 1; }) && \ | ||
| 445 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | ||
| 446 | pos = rcu_dereference_bh(pos->next)) | ||
| 447 | |||
| 448 | /** | ||
| 449 | * hlist_for_each_entry_continue_rcu - iterate over a hlist continuing after current point | ||
| 450 | * @tpos: the type * to use as a loop cursor. | ||
| 451 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 452 | * @member: the name of the hlist_node within the struct. | ||
| 453 | */ | ||
| 454 | #define hlist_for_each_entry_continue_rcu(tpos, pos, member) \ | ||
| 455 | for (pos = rcu_dereference((pos)->next); \ | ||
| 456 | pos && ({ prefetch(pos->next); 1; }) && \ | ||
| 457 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | ||
| 458 | pos = rcu_dereference(pos->next)) | ||
| 459 | |||
| 460 | /** | ||
| 461 | * hlist_for_each_entry_continue_rcu_bh - iterate over a hlist continuing after current point | ||
| 462 | * @tpos: the type * to use as a loop cursor. | ||
| 463 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
| 464 | * @member: the name of the hlist_node within the struct. | ||
| 465 | */ | ||
| 466 | #define hlist_for_each_entry_continue_rcu_bh(tpos, pos, member) \ | ||
| 467 | for (pos = rcu_dereference_bh((pos)->next); \ | ||
| 468 | pos && ({ prefetch(pos->next); 1; }) && \ | ||
| 469 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | ||
| 470 | pos = rcu_dereference_bh(pos->next)) | ||
| 471 | |||
| 472 | |||
| 431 | #endif /* __KERNEL__ */ | 473 | #endif /* __KERNEL__ */ |
| 432 | #endif | 474 | #endif |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index c84373626336..b653b4aaa8a6 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -41,6 +41,10 @@ | |||
| 41 | #include <linux/lockdep.h> | 41 | #include <linux/lockdep.h> |
| 42 | #include <linux/completion.h> | 42 | #include <linux/completion.h> |
| 43 | 43 | ||
| 44 | #ifdef CONFIG_RCU_TORTURE_TEST | ||
| 45 | extern int rcutorture_runnable; /* for sysctl */ | ||
| 46 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ | ||
| 47 | |||
| 44 | /** | 48 | /** |
| 45 | * struct rcu_head - callback structure for use with RCU | 49 | * struct rcu_head - callback structure for use with RCU |
| 46 | * @next: next update requests in a list | 50 | * @next: next update requests in a list |
| @@ -52,8 +56,6 @@ struct rcu_head { | |||
| 52 | }; | 56 | }; |
| 53 | 57 | ||
| 54 | /* Exported common interfaces */ | 58 | /* Exported common interfaces */ |
| 55 | extern void synchronize_rcu_bh(void); | ||
| 56 | extern void synchronize_sched(void); | ||
| 57 | extern void rcu_barrier(void); | 59 | extern void rcu_barrier(void); |
| 58 | extern void rcu_barrier_bh(void); | 60 | extern void rcu_barrier_bh(void); |
| 59 | extern void rcu_barrier_sched(void); | 61 | extern void rcu_barrier_sched(void); |
| @@ -62,8 +64,6 @@ extern int sched_expedited_torture_stats(char *page); | |||
| 62 | 64 | ||
| 63 | /* Internal to kernel */ | 65 | /* Internal to kernel */ |
| 64 | extern void rcu_init(void); | 66 | extern void rcu_init(void); |
| 65 | extern int rcu_scheduler_active; | ||
| 66 | extern void rcu_scheduler_starting(void); | ||
| 67 | 67 | ||
| 68 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 68 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
| 69 | #include <linux/rcutree.h> | 69 | #include <linux/rcutree.h> |
| @@ -79,6 +79,14 @@ extern void rcu_scheduler_starting(void); | |||
| 79 | (ptr)->next = NULL; (ptr)->func = NULL; \ | 79 | (ptr)->next = NULL; (ptr)->func = NULL; \ |
| 80 | } while (0) | 80 | } while (0) |
| 81 | 81 | ||
| 82 | static inline void init_rcu_head_on_stack(struct rcu_head *head) | ||
| 83 | { | ||
| 84 | } | ||
| 85 | |||
| 86 | static inline void destroy_rcu_head_on_stack(struct rcu_head *head) | ||
| 87 | { | ||
| 88 | } | ||
| 89 | |||
| 82 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 90 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 83 | 91 | ||
| 84 | extern struct lockdep_map rcu_lock_map; | 92 | extern struct lockdep_map rcu_lock_map; |
| @@ -97,53 +105,62 @@ extern struct lockdep_map rcu_sched_lock_map; | |||
| 97 | # define rcu_read_release_sched() \ | 105 | # define rcu_read_release_sched() \ |
| 98 | lock_release(&rcu_sched_lock_map, 1, _THIS_IP_) | 106 | lock_release(&rcu_sched_lock_map, 1, _THIS_IP_) |
| 99 | 107 | ||
| 108 | extern int debug_lockdep_rcu_enabled(void); | ||
| 109 | |||
| 100 | /** | 110 | /** |
| 101 | * rcu_read_lock_held - might we be in RCU read-side critical section? | 111 | * rcu_read_lock_held - might we be in RCU read-side critical section? |
| 102 | * | 112 | * |
| 103 | * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in | 113 | * If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an RCU |
| 104 | * an RCU read-side critical section. In absence of CONFIG_PROVE_LOCKING, | 114 | * read-side critical section. In absence of CONFIG_DEBUG_LOCK_ALLOC, |
| 105 | * this assumes we are in an RCU read-side critical section unless it can | 115 | * this assumes we are in an RCU read-side critical section unless it can |
| 106 | * prove otherwise. | 116 | * prove otherwise. |
| 117 | * | ||
| 118 | * Check debug_lockdep_rcu_enabled() to prevent false positives during boot | ||
| 119 | * and while lockdep is disabled. | ||
| 107 | */ | 120 | */ |
| 108 | static inline int rcu_read_lock_held(void) | 121 | static inline int rcu_read_lock_held(void) |
| 109 | { | 122 | { |
| 110 | if (debug_locks) | 123 | if (!debug_lockdep_rcu_enabled()) |
| 111 | return lock_is_held(&rcu_lock_map); | 124 | return 1; |
| 112 | return 1; | 125 | return lock_is_held(&rcu_lock_map); |
| 113 | } | 126 | } |
| 114 | 127 | ||
| 115 | /** | 128 | /* |
| 116 | * rcu_read_lock_bh_held - might we be in RCU-bh read-side critical section? | 129 | * rcu_read_lock_bh_held() is defined out of line to avoid #include-file |
| 117 | * | 130 | * hell. |
| 118 | * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in | ||
| 119 | * an RCU-bh read-side critical section. In absence of CONFIG_PROVE_LOCKING, | ||
| 120 | * this assumes we are in an RCU-bh read-side critical section unless it can | ||
| 121 | * prove otherwise. | ||
| 122 | */ | 131 | */ |
| 123 | static inline int rcu_read_lock_bh_held(void) | 132 | extern int rcu_read_lock_bh_held(void); |
| 124 | { | ||
| 125 | if (debug_locks) | ||
| 126 | return lock_is_held(&rcu_bh_lock_map); | ||
| 127 | return 1; | ||
| 128 | } | ||
| 129 | 133 | ||
| 130 | /** | 134 | /** |
| 131 | * rcu_read_lock_sched_held - might we be in RCU-sched read-side critical section? | 135 | * rcu_read_lock_sched_held - might we be in RCU-sched read-side critical section? |
| 132 | * | 136 | * |
| 133 | * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in an | 137 | * If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an |
| 134 | * RCU-sched read-side critical section. In absence of CONFIG_PROVE_LOCKING, | 138 | * RCU-sched read-side critical section. In absence of |
| 135 | * this assumes we are in an RCU-sched read-side critical section unless it | 139 | * CONFIG_DEBUG_LOCK_ALLOC, this assumes we are in an RCU-sched read-side |
| 136 | * can prove otherwise. Note that disabling of preemption (including | 140 | * critical section unless it can prove otherwise. Note that disabling |
| 137 | * disabling irqs) counts as an RCU-sched read-side critical section. | 141 | * of preemption (including disabling irqs) counts as an RCU-sched |
| 142 | * read-side critical section. | ||
| 143 | * | ||
| 144 | * Check debug_lockdep_rcu_enabled() to prevent false positives during boot | ||
| 145 | * and while lockdep is disabled. | ||
| 138 | */ | 146 | */ |
| 147 | #ifdef CONFIG_PREEMPT | ||
| 139 | static inline int rcu_read_lock_sched_held(void) | 148 | static inline int rcu_read_lock_sched_held(void) |
| 140 | { | 149 | { |
| 141 | int lockdep_opinion = 0; | 150 | int lockdep_opinion = 0; |
| 142 | 151 | ||
| 152 | if (!debug_lockdep_rcu_enabled()) | ||
| 153 | return 1; | ||
| 143 | if (debug_locks) | 154 | if (debug_locks) |
| 144 | lockdep_opinion = lock_is_held(&rcu_sched_lock_map); | 155 | lockdep_opinion = lock_is_held(&rcu_sched_lock_map); |
| 145 | return lockdep_opinion || preempt_count() != 0 || !rcu_scheduler_active; | 156 | return lockdep_opinion || preempt_count() != 0 || irqs_disabled(); |
| 157 | } | ||
| 158 | #else /* #ifdef CONFIG_PREEMPT */ | ||
| 159 | static inline int rcu_read_lock_sched_held(void) | ||
| 160 | { | ||
| 161 | return 1; | ||
| 146 | } | 162 | } |
| 163 | #endif /* #else #ifdef CONFIG_PREEMPT */ | ||
| 147 | 164 | ||
| 148 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 165 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
| 149 | 166 | ||
| @@ -164,38 +181,104 @@ static inline int rcu_read_lock_bh_held(void) | |||
| 164 | return 1; | 181 | return 1; |
| 165 | } | 182 | } |
| 166 | 183 | ||
| 184 | #ifdef CONFIG_PREEMPT | ||
| 185 | static inline int rcu_read_lock_sched_held(void) | ||
| 186 | { | ||
| 187 | return preempt_count() != 0 || irqs_disabled(); | ||
| 188 | } | ||
| 189 | #else /* #ifdef CONFIG_PREEMPT */ | ||
| 167 | static inline int rcu_read_lock_sched_held(void) | 190 | static inline int rcu_read_lock_sched_held(void) |
| 168 | { | 191 | { |
| 169 | return preempt_count() != 0 || !rcu_scheduler_active; | 192 | return 1; |
| 170 | } | 193 | } |
| 194 | #endif /* #else #ifdef CONFIG_PREEMPT */ | ||
| 171 | 195 | ||
| 172 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 196 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
| 173 | 197 | ||
| 174 | #ifdef CONFIG_PROVE_RCU | 198 | #ifdef CONFIG_PROVE_RCU |
| 175 | 199 | ||
| 200 | extern int rcu_my_thread_group_empty(void); | ||
| 201 | |||
| 202 | #define __do_rcu_dereference_check(c) \ | ||
| 203 | do { \ | ||
| 204 | static bool __warned; \ | ||
| 205 | if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \ | ||
| 206 | __warned = true; \ | ||
| 207 | lockdep_rcu_dereference(__FILE__, __LINE__); \ | ||
| 208 | } \ | ||
| 209 | } while (0) | ||
| 210 | |||
| 176 | /** | 211 | /** |
| 177 | * rcu_dereference_check - rcu_dereference with debug checking | 212 | * rcu_dereference_check - rcu_dereference with debug checking |
| 213 | * @p: The pointer to read, prior to dereferencing | ||
| 214 | * @c: The conditions under which the dereference will take place | ||
| 215 | * | ||
| 216 | * Do an rcu_dereference(), but check that the conditions under which the | ||
| 217 | * dereference will take place are correct. Typically the conditions indicate | ||
| 218 | * the various locking conditions that should be held at that point. The check | ||
| 219 | * should return true if the conditions are satisfied. | ||
| 220 | * | ||
| 221 | * For example: | ||
| 222 | * | ||
| 223 | * bar = rcu_dereference_check(foo->bar, rcu_read_lock_held() || | ||
| 224 | * lockdep_is_held(&foo->lock)); | ||
| 225 | * | ||
| 226 | * could be used to indicate to lockdep that foo->bar may only be dereferenced | ||
| 227 | * if either the RCU read lock is held, or that the lock required to replace | ||
| 228 | * the bar struct at foo->bar is held. | ||
| 178 | * | 229 | * |
| 179 | * Do an rcu_dereference(), but check that the context is correct. | 230 | * Note that the list of conditions may also include indications of when a lock |
| 180 | * For example, rcu_dereference_check(gp, rcu_read_lock_held()) to | 231 | * need not be held, for example during initialisation or destruction of the |
| 181 | * ensure that the rcu_dereference_check() executes within an RCU | 232 | * target struct: |
| 182 | * read-side critical section. It is also possible to check for | 233 | * |
| 183 | * locks being held, for example, by using lockdep_is_held(). | 234 | * bar = rcu_dereference_check(foo->bar, rcu_read_lock_held() || |
| 235 | * lockdep_is_held(&foo->lock) || | ||
| 236 | * atomic_read(&foo->usage) == 0); | ||
| 184 | */ | 237 | */ |
| 185 | #define rcu_dereference_check(p, c) \ | 238 | #define rcu_dereference_check(p, c) \ |
| 186 | ({ \ | 239 | ({ \ |
| 187 | if (debug_locks && !(c)) \ | 240 | __do_rcu_dereference_check(c); \ |
| 188 | lockdep_rcu_dereference(__FILE__, __LINE__); \ | ||
| 189 | rcu_dereference_raw(p); \ | 241 | rcu_dereference_raw(p); \ |
| 190 | }) | 242 | }) |
| 191 | 243 | ||
| 244 | /** | ||
| 245 | * rcu_dereference_protected - fetch RCU pointer when updates prevented | ||
| 246 | * | ||
| 247 | * Return the value of the specified RCU-protected pointer, but omit | ||
| 248 | * both the smp_read_barrier_depends() and the ACCESS_ONCE(). This | ||
| 249 | * is useful in cases where update-side locks prevent the value of the | ||
| 250 | * pointer from changing. Please note that this primitive does -not- | ||
| 251 | * prevent the compiler from repeating this reference or combining it | ||
| 252 | * with other references, so it should not be used without protection | ||
| 253 | * of appropriate locks. | ||
| 254 | */ | ||
| 255 | #define rcu_dereference_protected(p, c) \ | ||
| 256 | ({ \ | ||
| 257 | __do_rcu_dereference_check(c); \ | ||
| 258 | (p); \ | ||
| 259 | }) | ||
| 260 | |||
| 192 | #else /* #ifdef CONFIG_PROVE_RCU */ | 261 | #else /* #ifdef CONFIG_PROVE_RCU */ |
| 193 | 262 | ||
| 194 | #define rcu_dereference_check(p, c) rcu_dereference_raw(p) | 263 | #define rcu_dereference_check(p, c) rcu_dereference_raw(p) |
| 264 | #define rcu_dereference_protected(p, c) (p) | ||
| 195 | 265 | ||
| 196 | #endif /* #else #ifdef CONFIG_PROVE_RCU */ | 266 | #endif /* #else #ifdef CONFIG_PROVE_RCU */ |
| 197 | 267 | ||
| 198 | /** | 268 | /** |
| 269 | * rcu_access_pointer - fetch RCU pointer with no dereferencing | ||
| 270 | * | ||
| 271 | * Return the value of the specified RCU-protected pointer, but omit the | ||
| 272 | * smp_read_barrier_depends() and keep the ACCESS_ONCE(). This is useful | ||
| 273 | * when the value of this pointer is accessed, but the pointer is not | ||
| 274 | * dereferenced, for example, when testing an RCU-protected pointer against | ||
| 275 | * NULL. This may also be used in cases where update-side locks prevent | ||
| 276 | * the value of the pointer from changing, but rcu_dereference_protected() | ||
| 277 | * is a lighter-weight primitive for this use case. | ||
| 278 | */ | ||
| 279 | #define rcu_access_pointer(p) ACCESS_ONCE(p) | ||
| 280 | |||
| 281 | /** | ||
| 199 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. | 282 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. |
| 200 | * | 283 | * |
| 201 | * When synchronize_rcu() is invoked on one CPU while other CPUs | 284 | * When synchronize_rcu() is invoked on one CPU while other CPUs |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index a5195875480a..e2e893144a84 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
| @@ -29,6 +29,10 @@ | |||
| 29 | 29 | ||
| 30 | void rcu_sched_qs(int cpu); | 30 | void rcu_sched_qs(int cpu); |
| 31 | void rcu_bh_qs(int cpu); | 31 | void rcu_bh_qs(int cpu); |
| 32 | static inline void rcu_note_context_switch(int cpu) | ||
| 33 | { | ||
| 34 | rcu_sched_qs(cpu); | ||
| 35 | } | ||
| 32 | 36 | ||
| 33 | #define __rcu_read_lock() preempt_disable() | 37 | #define __rcu_read_lock() preempt_disable() |
| 34 | #define __rcu_read_unlock() preempt_enable() | 38 | #define __rcu_read_unlock() preempt_enable() |
| @@ -60,8 +64,6 @@ static inline long rcu_batches_completed_bh(void) | |||
| 60 | return 0; | 64 | return 0; |
| 61 | } | 65 | } |
| 62 | 66 | ||
| 63 | extern int rcu_expedited_torture_stats(char *page); | ||
| 64 | |||
| 65 | static inline void rcu_force_quiescent_state(void) | 67 | static inline void rcu_force_quiescent_state(void) |
| 66 | { | 68 | { |
| 67 | } | 69 | } |
| @@ -74,7 +76,17 @@ static inline void rcu_sched_force_quiescent_state(void) | |||
| 74 | { | 76 | { |
| 75 | } | 77 | } |
| 76 | 78 | ||
| 77 | #define synchronize_rcu synchronize_sched | 79 | extern void synchronize_sched(void); |
| 80 | |||
| 81 | static inline void synchronize_rcu(void) | ||
| 82 | { | ||
| 83 | synchronize_sched(); | ||
| 84 | } | ||
| 85 | |||
| 86 | static inline void synchronize_rcu_bh(void) | ||
| 87 | { | ||
| 88 | synchronize_sched(); | ||
| 89 | } | ||
| 78 | 90 | ||
| 79 | static inline void synchronize_rcu_expedited(void) | 91 | static inline void synchronize_rcu_expedited(void) |
| 80 | { | 92 | { |
| @@ -114,4 +126,17 @@ static inline int rcu_preempt_depth(void) | |||
| 114 | return 0; | 126 | return 0; |
| 115 | } | 127 | } |
| 116 | 128 | ||
| 129 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 130 | |||
| 131 | extern int rcu_scheduler_active __read_mostly; | ||
| 132 | extern void rcu_scheduler_starting(void); | ||
| 133 | |||
| 134 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
| 135 | |||
| 136 | static inline void rcu_scheduler_starting(void) | ||
| 137 | { | ||
| 138 | } | ||
| 139 | |||
| 140 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
| 141 | |||
| 117 | #endif /* __LINUX_RCUTINY_H */ | 142 | #endif /* __LINUX_RCUTINY_H */ |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 42cc3a04779e..c0ed1c056f29 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
| @@ -34,8 +34,8 @@ struct notifier_block; | |||
| 34 | 34 | ||
| 35 | extern void rcu_sched_qs(int cpu); | 35 | extern void rcu_sched_qs(int cpu); |
| 36 | extern void rcu_bh_qs(int cpu); | 36 | extern void rcu_bh_qs(int cpu); |
| 37 | extern void rcu_note_context_switch(int cpu); | ||
| 37 | extern int rcu_needs_cpu(int cpu); | 38 | extern int rcu_needs_cpu(int cpu); |
| 38 | extern int rcu_expedited_torture_stats(char *page); | ||
| 39 | 39 | ||
| 40 | #ifdef CONFIG_TREE_PREEMPT_RCU | 40 | #ifdef CONFIG_TREE_PREEMPT_RCU |
| 41 | 41 | ||
| @@ -86,6 +86,8 @@ static inline void __rcu_read_unlock_bh(void) | |||
| 86 | 86 | ||
| 87 | extern void call_rcu_sched(struct rcu_head *head, | 87 | extern void call_rcu_sched(struct rcu_head *head, |
| 88 | void (*func)(struct rcu_head *rcu)); | 88 | void (*func)(struct rcu_head *rcu)); |
| 89 | extern void synchronize_rcu_bh(void); | ||
| 90 | extern void synchronize_sched(void); | ||
| 89 | extern void synchronize_rcu_expedited(void); | 91 | extern void synchronize_rcu_expedited(void); |
| 90 | 92 | ||
| 91 | static inline void synchronize_rcu_bh_expedited(void) | 93 | static inline void synchronize_rcu_bh_expedited(void) |
| @@ -120,4 +122,7 @@ static inline int rcu_blocking_is_gp(void) | |||
| 120 | return num_online_cpus() == 1; | 122 | return num_online_cpus() == 1; |
| 121 | } | 123 | } |
| 122 | 124 | ||
| 125 | extern void rcu_scheduler_starting(void); | ||
| 126 | extern int rcu_scheduler_active __read_mostly; | ||
| 127 | |||
| 123 | #endif /* __LINUX_RCUTREE_H */ | 128 | #endif /* __LINUX_RCUTREE_H */ |
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 988e55fe649b..3005d5a7fce5 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
| @@ -64,6 +64,7 @@ extern void kernel_restart(char *cmd); | |||
| 64 | extern void kernel_halt(void); | 64 | extern void kernel_halt(void); |
| 65 | extern void kernel_power_off(void); | 65 | extern void kernel_power_off(void); |
| 66 | 66 | ||
| 67 | extern int C_A_D; /* for sysctl */ | ||
| 67 | void ctrl_alt_del(void); | 68 | void ctrl_alt_del(void); |
| 68 | 69 | ||
| 69 | #define POWEROFF_CMD_PATH_LEN 256 | 70 | #define POWEROFF_CMD_PATH_LEN 256 |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 28c9fd020d39..ebd747265294 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -183,9 +183,13 @@ static inline struct regulator *__must_check regulator_get(struct device *dev, | |||
| 183 | { | 183 | { |
| 184 | /* Nothing except the stubbed out regulator API should be | 184 | /* Nothing except the stubbed out regulator API should be |
| 185 | * looking at the value except to check if it is an error | 185 | * looking at the value except to check if it is an error |
| 186 | * value so the actual return value doesn't matter. | 186 | * value. Drivers are free to handle NULL specifically by |
| 187 | * skipping all regulator API calls, but they don't have to. | ||
| 188 | * Drivers which don't, should make sure they properly handle | ||
| 189 | * corner cases of the API, such as regulator_get_voltage() | ||
| 190 | * returning 0. | ||
| 187 | */ | 191 | */ |
| 188 | return (struct regulator *)id; | 192 | return NULL; |
| 189 | } | 193 | } |
| 190 | static inline void regulator_put(struct regulator *regulator) | 194 | static inline void regulator_put(struct regulator *regulator) |
| 191 | { | 195 | { |
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index 99928dce37ea..7fa02b4af838 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h | |||
| @@ -70,6 +70,11 @@ int reiserfs_security_write(struct reiserfs_transaction_handle *th, | |||
| 70 | void reiserfs_security_free(struct reiserfs_security_handle *sec); | 70 | void reiserfs_security_free(struct reiserfs_security_handle *sec); |
| 71 | #endif | 71 | #endif |
| 72 | 72 | ||
| 73 | static inline int reiserfs_xattrs_initialized(struct super_block *sb) | ||
| 74 | { | ||
| 75 | return REISERFS_SB(sb)->priv_root != NULL; | ||
| 76 | } | ||
| 77 | |||
| 73 | #define xattr_size(size) ((size) + sizeof(struct reiserfs_xattr_header)) | 78 | #define xattr_size(size) ((size) + sizeof(struct reiserfs_xattr_header)) |
| 74 | static inline loff_t reiserfs_xattr_nblocks(struct inode *inode, loff_t size) | 79 | static inline loff_t reiserfs_xattr_nblocks(struct inode *inode, loff_t size) |
| 75 | { | 80 | { |
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 97059d08a626..4f82326eb294 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | /** | 29 | /** |
| 30 | * enum rfkill_type - type of rfkill switch. | 30 | * enum rfkill_type - type of rfkill switch. |
| 31 | * | 31 | * |
| 32 | * @RFKILL_TYPE_ALL: toggles all switches (userspace only) | 32 | * @RFKILL_TYPE_ALL: toggles all switches (requests only - not a switch type) |
| 33 | * @RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device. | 33 | * @RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device. |
| 34 | * @RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device. | 34 | * @RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device. |
| 35 | * @RFKILL_TYPE_UWB: switch is on a ultra wideband device. | 35 | * @RFKILL_TYPE_UWB: switch is on a ultra wideband device. |
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 5fcc31ed5771..25b4f686d918 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
| @@ -120,12 +120,16 @@ int ring_buffer_write(struct ring_buffer *buffer, | |||
| 120 | unsigned long length, void *data); | 120 | unsigned long length, void *data); |
| 121 | 121 | ||
| 122 | struct ring_buffer_event * | 122 | struct ring_buffer_event * |
| 123 | ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts); | 123 | ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts, |
| 124 | unsigned long *lost_events); | ||
| 124 | struct ring_buffer_event * | 125 | struct ring_buffer_event * |
| 125 | ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts); | 126 | ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts, |
| 127 | unsigned long *lost_events); | ||
| 126 | 128 | ||
| 127 | struct ring_buffer_iter * | 129 | struct ring_buffer_iter * |
| 128 | ring_buffer_read_start(struct ring_buffer *buffer, int cpu); | 130 | ring_buffer_read_prepare(struct ring_buffer *buffer, int cpu); |
| 131 | void ring_buffer_read_prepare_sync(void); | ||
| 132 | void ring_buffer_read_start(struct ring_buffer_iter *iter); | ||
| 129 | void ring_buffer_read_finish(struct ring_buffer_iter *iter); | 133 | void ring_buffer_read_finish(struct ring_buffer_iter *iter); |
| 130 | 134 | ||
| 131 | struct ring_buffer_event * | 135 | struct ring_buffer_event * |
diff --git a/include/linux/rtc-v3020.h b/include/linux/rtc-v3020.h index 8ba646e610d9..e55d82cebf80 100644 --- a/include/linux/rtc-v3020.h +++ b/include/linux/rtc-v3020.h | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | struct v3020_platform_data { | 15 | struct v3020_platform_data { |
| 16 | int leftshift; /* (1<<(leftshift)) & readl() */ | 16 | int leftshift; /* (1<<(leftshift)) & readl() */ |
| 17 | 17 | ||
| 18 | int use_gpio:1; | 18 | unsigned int use_gpio:1; |
| 19 | unsigned int gpio_cs; | 19 | unsigned int gpio_cs; |
| 20 | unsigned int gpio_wr; | 20 | unsigned int gpio_wr; |
| 21 | unsigned int gpio_rd; | 21 | unsigned int gpio_rd; |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 60f88a7fb13d..14dbc83ded20 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
| @@ -238,6 +238,12 @@ static inline bool is_leap_year(unsigned int year) | |||
| 238 | return (!(year % 4) && (year % 100)) || !(year % 400); | 238 | return (!(year % 4) && (year % 100)) || !(year % 400); |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | #ifdef CONFIG_RTC_HCTOSYS | ||
| 242 | extern int rtc_hctosys_ret; | ||
| 243 | #else | ||
| 244 | #define rtc_hctosys_ret -ENODEV | ||
| 245 | #endif | ||
| 246 | |||
| 241 | #endif /* __KERNEL__ */ | 247 | #endif /* __KERNEL__ */ |
| 242 | 248 | ||
| 243 | #endif /* _LINUX_RTC_H_ */ | 249 | #endif /* _LINUX_RTC_H_ */ |
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h index 281d8fd775e8..8d522ffeda33 100644 --- a/include/linux/rtmutex.h +++ b/include/linux/rtmutex.h | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | #include <linux/plist.h> | 16 | #include <linux/plist.h> |
| 17 | #include <linux/spinlock_types.h> | 17 | #include <linux/spinlock_types.h> |
| 18 | 18 | ||
| 19 | extern int max_lock_depth; /* for sysctl */ | ||
| 20 | |||
| 19 | /** | 21 | /** |
| 20 | * The rt_mutex structure | 22 | * The rt_mutex structure |
| 21 | * | 23 | * |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index d1c7c90e9cd4..fbc8cb0d48c3 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
| @@ -7,6 +7,13 @@ | |||
| 7 | #include <linux/if_addr.h> | 7 | #include <linux/if_addr.h> |
| 8 | #include <linux/neighbour.h> | 8 | #include <linux/neighbour.h> |
| 9 | 9 | ||
| 10 | /* rtnetlink families. Values up to 127 are reserved for real address | ||
| 11 | * families, values above 128 may be used arbitrarily. | ||
| 12 | */ | ||
| 13 | #define RTNL_FAMILY_IPMR 128 | ||
| 14 | #define RTNL_FAMILY_IP6MR 129 | ||
| 15 | #define RTNL_FAMILY_MAX 129 | ||
| 16 | |||
| 10 | /**** | 17 | /**** |
| 11 | * Routing/neighbour discovery messages. | 18 | * Routing/neighbour discovery messages. |
| 12 | ****/ | 19 | ****/ |
diff --git a/include/linux/rwlock.h b/include/linux/rwlock.h index 71e0b00b6f2c..bc2994ed66e1 100644 --- a/include/linux/rwlock.h +++ b/include/linux/rwlock.h | |||
| @@ -29,25 +29,25 @@ do { \ | |||
| 29 | #endif | 29 | #endif |
| 30 | 30 | ||
| 31 | #ifdef CONFIG_DEBUG_SPINLOCK | 31 | #ifdef CONFIG_DEBUG_SPINLOCK |
| 32 | extern void do_raw_read_lock(rwlock_t *lock); | 32 | extern void do_raw_read_lock(rwlock_t *lock) __acquires(lock); |
| 33 | #define do_raw_read_lock_flags(lock, flags) do_raw_read_lock(lock) | 33 | #define do_raw_read_lock_flags(lock, flags) do_raw_read_lock(lock) |
| 34 | extern int do_raw_read_trylock(rwlock_t *lock); | 34 | extern int do_raw_read_trylock(rwlock_t *lock); |
| 35 | extern void do_raw_read_unlock(rwlock_t *lock); | 35 | extern void do_raw_read_unlock(rwlock_t *lock) __releases(lock); |
| 36 | extern void do_raw_write_lock(rwlock_t *lock); | 36 | extern void do_raw_write_lock(rwlock_t *lock) __acquires(lock); |
| 37 | #define do_raw_write_lock_flags(lock, flags) do_raw_write_lock(lock) | 37 | #define do_raw_write_lock_flags(lock, flags) do_raw_write_lock(lock) |
| 38 | extern int do_raw_write_trylock(rwlock_t *lock); | 38 | extern int do_raw_write_trylock(rwlock_t *lock); |
| 39 | extern void do_raw_write_unlock(rwlock_t *lock); | 39 | extern void do_raw_write_unlock(rwlock_t *lock) __releases(lock); |
| 40 | #else | 40 | #else |
| 41 | # define do_raw_read_lock(rwlock) arch_read_lock(&(rwlock)->raw_lock) | 41 | # define do_raw_read_lock(rwlock) do {__acquire(lock); arch_read_lock(&(rwlock)->raw_lock); } while (0) |
| 42 | # define do_raw_read_lock_flags(lock, flags) \ | 42 | # define do_raw_read_lock_flags(lock, flags) \ |
| 43 | arch_read_lock_flags(&(lock)->raw_lock, *(flags)) | 43 | do {__acquire(lock); arch_read_lock_flags(&(lock)->raw_lock, *(flags)); } while (0) |
| 44 | # define do_raw_read_trylock(rwlock) arch_read_trylock(&(rwlock)->raw_lock) | 44 | # define do_raw_read_trylock(rwlock) arch_read_trylock(&(rwlock)->raw_lock) |
| 45 | # define do_raw_read_unlock(rwlock) arch_read_unlock(&(rwlock)->raw_lock) | 45 | # define do_raw_read_unlock(rwlock) do {arch_read_unlock(&(rwlock)->raw_lock); __release(lock); } while (0) |
| 46 | # define do_raw_write_lock(rwlock) arch_write_lock(&(rwlock)->raw_lock) | 46 | # define do_raw_write_lock(rwlock) do {__acquire(lock); arch_write_lock(&(rwlock)->raw_lock); } while (0) |
| 47 | # define do_raw_write_lock_flags(lock, flags) \ | 47 | # define do_raw_write_lock_flags(lock, flags) \ |
| 48 | arch_write_lock_flags(&(lock)->raw_lock, *(flags)) | 48 | do {__acquire(lock); arch_write_lock_flags(&(lock)->raw_lock, *(flags)); } while (0) |
| 49 | # define do_raw_write_trylock(rwlock) arch_write_trylock(&(rwlock)->raw_lock) | 49 | # define do_raw_write_trylock(rwlock) arch_write_trylock(&(rwlock)->raw_lock) |
| 50 | # define do_raw_write_unlock(rwlock) arch_write_unlock(&(rwlock)->raw_lock) | 50 | # define do_raw_write_unlock(rwlock) do {arch_write_unlock(&(rwlock)->raw_lock); __release(lock); } while (0) |
| 51 | #endif | 51 | #endif |
| 52 | 52 | ||
| 53 | #define read_can_lock(rwlock) arch_read_can_lock(&(rwlock)->raw_lock) | 53 | #define read_can_lock(rwlock) arch_read_can_lock(&(rwlock)->raw_lock) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 46c6f8d5dc06..b55e988988b5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -99,7 +99,6 @@ struct futex_pi_state; | |||
| 99 | struct robust_list_head; | 99 | struct robust_list_head; |
| 100 | struct bio_list; | 100 | struct bio_list; |
| 101 | struct fs_struct; | 101 | struct fs_struct; |
| 102 | struct bts_context; | ||
| 103 | struct perf_event_context; | 102 | struct perf_event_context; |
| 104 | 103 | ||
| 105 | /* | 104 | /* |
| @@ -258,6 +257,10 @@ extern spinlock_t mmlist_lock; | |||
| 258 | 257 | ||
| 259 | struct task_struct; | 258 | struct task_struct; |
| 260 | 259 | ||
| 260 | #ifdef CONFIG_PROVE_RCU | ||
| 261 | extern int lockdep_tasklist_lock_is_held(void); | ||
| 262 | #endif /* #ifdef CONFIG_PROVE_RCU */ | ||
| 263 | |||
| 261 | extern void sched_init(void); | 264 | extern void sched_init(void); |
| 262 | extern void sched_init_smp(void); | 265 | extern void sched_init_smp(void); |
| 263 | extern asmlinkage void schedule_tail(struct task_struct *prev); | 266 | extern asmlinkage void schedule_tail(struct task_struct *prev); |
| @@ -271,11 +274,17 @@ extern cpumask_var_t nohz_cpu_mask; | |||
| 271 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) | 274 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) |
| 272 | extern int select_nohz_load_balancer(int cpu); | 275 | extern int select_nohz_load_balancer(int cpu); |
| 273 | extern int get_nohz_load_balancer(void); | 276 | extern int get_nohz_load_balancer(void); |
| 277 | extern int nohz_ratelimit(int cpu); | ||
| 274 | #else | 278 | #else |
| 275 | static inline int select_nohz_load_balancer(int cpu) | 279 | static inline int select_nohz_load_balancer(int cpu) |
| 276 | { | 280 | { |
| 277 | return 0; | 281 | return 0; |
| 278 | } | 282 | } |
| 283 | |||
| 284 | static inline int nohz_ratelimit(int cpu) | ||
| 285 | { | ||
| 286 | return 0; | ||
| 287 | } | ||
| 279 | #endif | 288 | #endif |
| 280 | 289 | ||
| 281 | /* | 290 | /* |
| @@ -950,6 +959,7 @@ struct sched_domain { | |||
| 950 | char *name; | 959 | char *name; |
| 951 | #endif | 960 | #endif |
| 952 | 961 | ||
| 962 | unsigned int span_weight; | ||
| 953 | /* | 963 | /* |
| 954 | * Span of all CPUs in this domain. | 964 | * Span of all CPUs in this domain. |
| 955 | * | 965 | * |
| @@ -1022,12 +1032,17 @@ struct sched_domain; | |||
| 1022 | #define WF_SYNC 0x01 /* waker goes to sleep after wakup */ | 1032 | #define WF_SYNC 0x01 /* waker goes to sleep after wakup */ |
| 1023 | #define WF_FORK 0x02 /* child wakeup after fork */ | 1033 | #define WF_FORK 0x02 /* child wakeup after fork */ |
| 1024 | 1034 | ||
| 1035 | #define ENQUEUE_WAKEUP 1 | ||
| 1036 | #define ENQUEUE_WAKING 2 | ||
| 1037 | #define ENQUEUE_HEAD 4 | ||
| 1038 | |||
| 1039 | #define DEQUEUE_SLEEP 1 | ||
| 1040 | |||
| 1025 | struct sched_class { | 1041 | struct sched_class { |
| 1026 | const struct sched_class *next; | 1042 | const struct sched_class *next; |
| 1027 | 1043 | ||
| 1028 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup, | 1044 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int flags); |
| 1029 | bool head); | 1045 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags); |
| 1030 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); | ||
| 1031 | void (*yield_task) (struct rq *rq); | 1046 | void (*yield_task) (struct rq *rq); |
| 1032 | 1047 | ||
| 1033 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); | 1048 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); |
| @@ -1036,7 +1051,8 @@ struct sched_class { | |||
| 1036 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); | 1051 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); |
| 1037 | 1052 | ||
| 1038 | #ifdef CONFIG_SMP | 1053 | #ifdef CONFIG_SMP |
| 1039 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); | 1054 | int (*select_task_rq)(struct rq *rq, struct task_struct *p, |
| 1055 | int sd_flag, int flags); | ||
| 1040 | 1056 | ||
| 1041 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); | 1057 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); |
| 1042 | void (*post_schedule) (struct rq *this_rq); | 1058 | void (*post_schedule) (struct rq *this_rq); |
| @@ -1073,36 +1089,8 @@ struct load_weight { | |||
| 1073 | unsigned long weight, inv_weight; | 1089 | unsigned long weight, inv_weight; |
| 1074 | }; | 1090 | }; |
| 1075 | 1091 | ||
| 1076 | /* | ||
| 1077 | * CFS stats for a schedulable entity (task, task-group etc) | ||
| 1078 | * | ||
| 1079 | * Current field usage histogram: | ||
| 1080 | * | ||
| 1081 | * 4 se->block_start | ||
| 1082 | * 4 se->run_node | ||
| 1083 | * 4 se->sleep_start | ||
| 1084 | * 6 se->load.weight | ||
| 1085 | */ | ||
| 1086 | struct sched_entity { | ||
| 1087 | struct load_weight load; /* for load-balancing */ | ||
| 1088 | struct rb_node run_node; | ||
| 1089 | struct list_head group_node; | ||
| 1090 | unsigned int on_rq; | ||
| 1091 | |||
| 1092 | u64 exec_start; | ||
| 1093 | u64 sum_exec_runtime; | ||
| 1094 | u64 vruntime; | ||
| 1095 | u64 prev_sum_exec_runtime; | ||
| 1096 | |||
| 1097 | u64 last_wakeup; | ||
| 1098 | u64 avg_overlap; | ||
| 1099 | |||
| 1100 | u64 nr_migrations; | ||
| 1101 | |||
| 1102 | u64 start_runtime; | ||
| 1103 | u64 avg_wakeup; | ||
| 1104 | |||
| 1105 | #ifdef CONFIG_SCHEDSTATS | 1092 | #ifdef CONFIG_SCHEDSTATS |
| 1093 | struct sched_statistics { | ||
| 1106 | u64 wait_start; | 1094 | u64 wait_start; |
| 1107 | u64 wait_max; | 1095 | u64 wait_max; |
| 1108 | u64 wait_count; | 1096 | u64 wait_count; |
| @@ -1134,6 +1122,24 @@ struct sched_entity { | |||
| 1134 | u64 nr_wakeups_affine_attempts; | 1122 | u64 nr_wakeups_affine_attempts; |
| 1135 | u64 nr_wakeups_passive; | 1123 | u64 nr_wakeups_passive; |
| 1136 | u64 nr_wakeups_idle; | 1124 | u64 nr_wakeups_idle; |
| 1125 | }; | ||
| 1126 | #endif | ||
| 1127 | |||
| 1128 | struct sched_entity { | ||
| 1129 | struct load_weight load; /* for load-balancing */ | ||
| 1130 | struct rb_node run_node; | ||
| 1131 | struct list_head group_node; | ||
| 1132 | unsigned int on_rq; | ||
| 1133 | |||
| 1134 | u64 exec_start; | ||
| 1135 | u64 sum_exec_runtime; | ||
| 1136 | u64 vruntime; | ||
| 1137 | u64 prev_sum_exec_runtime; | ||
| 1138 | |||
| 1139 | u64 nr_migrations; | ||
| 1140 | |||
| 1141 | #ifdef CONFIG_SCHEDSTATS | ||
| 1142 | struct sched_statistics statistics; | ||
| 1137 | #endif | 1143 | #endif |
| 1138 | 1144 | ||
| 1139 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1145 | #ifdef CONFIG_FAIR_GROUP_SCHED |
| @@ -1268,12 +1274,6 @@ struct task_struct { | |||
| 1268 | struct list_head ptraced; | 1274 | struct list_head ptraced; |
| 1269 | struct list_head ptrace_entry; | 1275 | struct list_head ptrace_entry; |
| 1270 | 1276 | ||
| 1271 | /* | ||
| 1272 | * This is the tracer handle for the ptrace BTS extension. | ||
| 1273 | * This field actually belongs to the ptracer task. | ||
| 1274 | */ | ||
| 1275 | struct bts_context *bts; | ||
| 1276 | |||
| 1277 | /* PID/PID hash table linkage. */ | 1277 | /* PID/PID hash table linkage. */ |
| 1278 | struct pid_link pids[PIDTYPE_MAX]; | 1278 | struct pid_link pids[PIDTYPE_MAX]; |
| 1279 | struct list_head thread_group; | 1279 | struct list_head thread_group; |
| @@ -1473,7 +1473,7 @@ struct task_struct { | |||
| 1473 | 1473 | ||
| 1474 | struct list_head *scm_work_list; | 1474 | struct list_head *scm_work_list; |
| 1475 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 1475 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
| 1476 | /* Index of current stored adress in ret_stack */ | 1476 | /* Index of current stored address in ret_stack */ |
| 1477 | int curr_ret_stack; | 1477 | int curr_ret_stack; |
| 1478 | /* Stack of return addresses for return function tracing */ | 1478 | /* Stack of return addresses for return function tracing */ |
| 1479 | struct ftrace_ret_stack *ret_stack; | 1479 | struct ftrace_ret_stack *ret_stack; |
| @@ -1493,7 +1493,6 @@ struct task_struct { | |||
| 1493 | /* bitmask of trace recursion */ | 1493 | /* bitmask of trace recursion */ |
| 1494 | unsigned long trace_recursion; | 1494 | unsigned long trace_recursion; |
| 1495 | #endif /* CONFIG_TRACING */ | 1495 | #endif /* CONFIG_TRACING */ |
| 1496 | unsigned long stack_start; | ||
| 1497 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */ | 1496 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */ |
| 1498 | struct memcg_batch_info { | 1497 | struct memcg_batch_info { |
| 1499 | int do_batch; /* incremented when batch uncharge started */ | 1498 | int do_batch; /* incremented when batch uncharge started */ |
| @@ -1843,6 +1842,7 @@ extern void sched_clock_idle_sleep_event(void); | |||
| 1843 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); | 1842 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); |
| 1844 | 1843 | ||
| 1845 | #ifdef CONFIG_HOTPLUG_CPU | 1844 | #ifdef CONFIG_HOTPLUG_CPU |
| 1845 | extern void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p); | ||
| 1846 | extern void idle_task_exit(void); | 1846 | extern void idle_task_exit(void); |
| 1847 | #else | 1847 | #else |
| 1848 | static inline void idle_task_exit(void) {} | 1848 | static inline void idle_task_exit(void) {} |
| @@ -2119,10 +2119,8 @@ extern void set_task_comm(struct task_struct *tsk, char *from); | |||
| 2119 | extern char *get_task_comm(char *to, struct task_struct *tsk); | 2119 | extern char *get_task_comm(char *to, struct task_struct *tsk); |
| 2120 | 2120 | ||
| 2121 | #ifdef CONFIG_SMP | 2121 | #ifdef CONFIG_SMP |
| 2122 | extern void wait_task_context_switch(struct task_struct *p); | ||
| 2123 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); | 2122 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); |
| 2124 | #else | 2123 | #else |
| 2125 | static inline void wait_task_context_switch(struct task_struct *p) {} | ||
| 2126 | static inline unsigned long wait_task_inactive(struct task_struct *p, | 2124 | static inline unsigned long wait_task_inactive(struct task_struct *p, |
| 2127 | long match_state) | 2125 | long match_state) |
| 2128 | { | 2126 | { |
| @@ -2391,9 +2389,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times); | |||
| 2391 | 2389 | ||
| 2392 | static inline void thread_group_cputime_init(struct signal_struct *sig) | 2390 | static inline void thread_group_cputime_init(struct signal_struct *sig) |
| 2393 | { | 2391 | { |
| 2394 | sig->cputimer.cputime = INIT_CPUTIME; | ||
| 2395 | spin_lock_init(&sig->cputimer.lock); | 2392 | spin_lock_init(&sig->cputimer.lock); |
| 2396 | sig->cputimer.running = 0; | ||
| 2397 | } | 2393 | } |
| 2398 | 2394 | ||
| 2399 | static inline void thread_group_cputime_free(struct signal_struct *sig) | 2395 | static inline void thread_group_cputime_free(struct signal_struct *sig) |
diff --git a/include/linux/security.h b/include/linux/security.h index 233d20b52c1b..0c8819170463 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
| 34 | #include <linux/key.h> | 34 | #include <linux/key.h> |
| 35 | #include <linux/xfrm.h> | 35 | #include <linux/xfrm.h> |
| 36 | #include <linux/gfp.h> | 36 | #include <linux/slab.h> |
| 37 | #include <net/flow.h> | 37 | #include <net/flow.h> |
| 38 | 38 | ||
| 39 | /* Maximum number of letters for an LSM name string */ | 39 | /* Maximum number of letters for an LSM name string */ |
| @@ -267,49 +267,16 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 267 | * @orig the original mount data copied from userspace. | 267 | * @orig the original mount data copied from userspace. |
| 268 | * @copy copied data which will be passed to the security module. | 268 | * @copy copied data which will be passed to the security module. |
| 269 | * Returns 0 if the copy was successful. | 269 | * Returns 0 if the copy was successful. |
| 270 | * @sb_check_sb: | ||
| 271 | * Check permission before the device with superblock @mnt->sb is mounted | ||
| 272 | * on the mount point named by @nd. | ||
| 273 | * @mnt contains the vfsmount for device being mounted. | ||
| 274 | * @path contains the path for the mount point. | ||
| 275 | * Return 0 if permission is granted. | ||
| 276 | * @sb_umount: | 270 | * @sb_umount: |
| 277 | * Check permission before the @mnt file system is unmounted. | 271 | * Check permission before the @mnt file system is unmounted. |
| 278 | * @mnt contains the mounted file system. | 272 | * @mnt contains the mounted file system. |
| 279 | * @flags contains the unmount flags, e.g. MNT_FORCE. | 273 | * @flags contains the unmount flags, e.g. MNT_FORCE. |
| 280 | * Return 0 if permission is granted. | 274 | * Return 0 if permission is granted. |
| 281 | * @sb_umount_close: | ||
| 282 | * Close any files in the @mnt mounted filesystem that are held open by | ||
| 283 | * the security module. This hook is called during an umount operation | ||
| 284 | * prior to checking whether the filesystem is still busy. | ||
| 285 | * @mnt contains the mounted filesystem. | ||
| 286 | * @sb_umount_busy: | ||
| 287 | * Handle a failed umount of the @mnt mounted filesystem, e.g. re-opening | ||
| 288 | * any files that were closed by umount_close. This hook is called during | ||
| 289 | * an umount operation if the umount fails after a call to the | ||
| 290 | * umount_close hook. | ||
| 291 | * @mnt contains the mounted filesystem. | ||
| 292 | * @sb_post_remount: | ||
| 293 | * Update the security module's state when a filesystem is remounted. | ||
| 294 | * This hook is only called if the remount was successful. | ||
| 295 | * @mnt contains the mounted file system. | ||
| 296 | * @flags contains the new filesystem flags. | ||
| 297 | * @data contains the filesystem-specific data. | ||
| 298 | * @sb_post_addmount: | ||
| 299 | * Update the security module's state when a filesystem is mounted. | ||
| 300 | * This hook is called any time a mount is successfully grafetd to | ||
| 301 | * the tree. | ||
| 302 | * @mnt contains the mounted filesystem. | ||
| 303 | * @mountpoint contains the path for the mount point. | ||
| 304 | * @sb_pivotroot: | 275 | * @sb_pivotroot: |
| 305 | * Check permission before pivoting the root filesystem. | 276 | * Check permission before pivoting the root filesystem. |
| 306 | * @old_path contains the path for the new location of the current root (put_old). | 277 | * @old_path contains the path for the new location of the current root (put_old). |
| 307 | * @new_path contains the path for the new root (new_root). | 278 | * @new_path contains the path for the new root (new_root). |
| 308 | * Return 0 if permission is granted. | 279 | * Return 0 if permission is granted. |
| 309 | * @sb_post_pivotroot: | ||
| 310 | * Update module state after a successful pivot. | ||
| 311 | * @old_path contains the path for the old root. | ||
| 312 | * @new_path contains the path for the new root. | ||
| 313 | * @sb_set_mnt_opts: | 280 | * @sb_set_mnt_opts: |
| 314 | * Set the security relevant mount options used for a superblock | 281 | * Set the security relevant mount options used for a superblock |
| 315 | * @sb the superblock to set security mount options for | 282 | * @sb the superblock to set security mount options for |
| @@ -511,12 +478,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 511 | * @mnt is the vfsmount where the dentry was looked up | 478 | * @mnt is the vfsmount where the dentry was looked up |
| 512 | * @dentry contains the dentry structure for the file. | 479 | * @dentry contains the dentry structure for the file. |
| 513 | * Return 0 if permission is granted. | 480 | * Return 0 if permission is granted. |
| 514 | * @inode_delete: | ||
| 515 | * @inode contains the inode structure for deleted inode. | ||
| 516 | * This hook is called when a deleted inode is released (i.e. an inode | ||
| 517 | * with no hard links has its use count drop to zero). A security module | ||
| 518 | * can use this hook to release any persistent label associated with the | ||
| 519 | * inode. | ||
| 520 | * @inode_setxattr: | 481 | * @inode_setxattr: |
| 521 | * Check permission before setting the extended attributes | 482 | * Check permission before setting the extended attributes |
| 522 | * @value identified by @name for @dentry. | 483 | * @value identified by @name for @dentry. |
| @@ -691,10 +652,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 691 | * @old points to the original credentials. | 652 | * @old points to the original credentials. |
| 692 | * @gfp indicates the atomicity of any memory allocations. | 653 | * @gfp indicates the atomicity of any memory allocations. |
| 693 | * Prepare a new set of credentials by copying the data from the old set. | 654 | * Prepare a new set of credentials by copying the data from the old set. |
| 694 | * @cred_commit: | ||
| 695 | * @new points to the new credentials. | ||
| 696 | * @old points to the original credentials. | ||
| 697 | * Install a new set of credentials. | ||
| 698 | * @cred_transfer: | 655 | * @cred_transfer: |
| 699 | * @new points to the new credentials. | 656 | * @new points to the new credentials. |
| 700 | * @old points to the original credentials. | 657 | * @old points to the original credentials. |
| @@ -717,18 +674,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 717 | * userspace to load a kernel module with the given name. | 674 | * userspace to load a kernel module with the given name. |
| 718 | * @kmod_name name of the module requested by the kernel | 675 | * @kmod_name name of the module requested by the kernel |
| 719 | * Return 0 if successful. | 676 | * Return 0 if successful. |
| 720 | * @task_setuid: | ||
| 721 | * Check permission before setting one or more of the user identity | ||
| 722 | * attributes of the current process. The @flags parameter indicates | ||
| 723 | * which of the set*uid system calls invoked this hook and how to | ||
| 724 | * interpret the @id0, @id1, and @id2 parameters. See the LSM_SETID | ||
| 725 | * definitions at the beginning of this file for the @flags values and | ||
| 726 | * their meanings. | ||
| 727 | * @id0 contains a uid. | ||
| 728 | * @id1 contains a uid. | ||
| 729 | * @id2 contains a uid. | ||
| 730 | * @flags contains one of the LSM_SETID_* values. | ||
| 731 | * Return 0 if permission is granted. | ||
| 732 | * @task_fix_setuid: | 677 | * @task_fix_setuid: |
| 733 | * Update the module's state after setting one or more of the user | 678 | * Update the module's state after setting one or more of the user |
| 734 | * identity attributes of the current process. The @flags parameter | 679 | * identity attributes of the current process. The @flags parameter |
| @@ -738,18 +683,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 738 | * @old is the set of credentials that are being replaces | 683 | * @old is the set of credentials that are being replaces |
| 739 | * @flags contains one of the LSM_SETID_* values. | 684 | * @flags contains one of the LSM_SETID_* values. |
| 740 | * Return 0 on success. | 685 | * Return 0 on success. |
| 741 | * @task_setgid: | ||
| 742 | * Check permission before setting one or more of the group identity | ||
| 743 | * attributes of the current process. The @flags parameter indicates | ||
| 744 | * which of the set*gid system calls invoked this hook and how to | ||
| 745 | * interpret the @id0, @id1, and @id2 parameters. See the LSM_SETID | ||
| 746 | * definitions at the beginning of this file for the @flags values and | ||
| 747 | * their meanings. | ||
| 748 | * @id0 contains a gid. | ||
| 749 | * @id1 contains a gid. | ||
| 750 | * @id2 contains a gid. | ||
| 751 | * @flags contains one of the LSM_SETID_* values. | ||
| 752 | * Return 0 if permission is granted. | ||
| 753 | * @task_setpgid: | 686 | * @task_setpgid: |
| 754 | * Check permission before setting the process group identifier of the | 687 | * Check permission before setting the process group identifier of the |
| 755 | * process @p to @pgid. | 688 | * process @p to @pgid. |
| @@ -771,11 +704,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 771 | * @p contains the task_struct for the process and place is into @secid. | 704 | * @p contains the task_struct for the process and place is into @secid. |
| 772 | * In case of failure, @secid will be set to zero. | 705 | * In case of failure, @secid will be set to zero. |
| 773 | * | 706 | * |
| 774 | * @task_setgroups: | ||
| 775 | * Check permission before setting the supplementary group set of the | ||
| 776 | * current process. | ||
| 777 | * @group_info contains the new group information. | ||
| 778 | * Return 0 if permission is granted. | ||
| 779 | * @task_setnice: | 707 | * @task_setnice: |
| 780 | * Check permission before setting the nice value of @p to @nice. | 708 | * Check permission before setting the nice value of @p to @nice. |
| 781 | * @p contains the task_struct of process. | 709 | * @p contains the task_struct of process. |
| @@ -1139,13 +1067,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1139 | * Return the length of the string (including terminating NUL) or -ve if | 1067 | * Return the length of the string (including terminating NUL) or -ve if |
| 1140 | * an error. | 1068 | * an error. |
| 1141 | * May also return 0 (and a NULL buffer pointer) if there is no label. | 1069 | * May also return 0 (and a NULL buffer pointer) if there is no label. |
| 1142 | * @key_session_to_parent: | ||
| 1143 | * Forcibly assign the session keyring from a process to its parent | ||
| 1144 | * process. | ||
| 1145 | * @cred: Pointer to process's credentials | ||
| 1146 | * @parent_cred: Pointer to parent process's credentials | ||
| 1147 | * @keyring: Proposed new session keyring | ||
| 1148 | * Return 0 if permission is granted, -ve error otherwise. | ||
| 1149 | * | 1070 | * |
| 1150 | * Security hooks affecting all System V IPC operations. | 1071 | * Security hooks affecting all System V IPC operations. |
| 1151 | * | 1072 | * |
| @@ -1333,13 +1254,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1333 | * @cap contains the capability <include/linux/capability.h>. | 1254 | * @cap contains the capability <include/linux/capability.h>. |
| 1334 | * @audit: Whether to write an audit message or not | 1255 | * @audit: Whether to write an audit message or not |
| 1335 | * Return 0 if the capability is granted for @tsk. | 1256 | * Return 0 if the capability is granted for @tsk. |
| 1336 | * @acct: | ||
| 1337 | * Check permission before enabling or disabling process accounting. If | ||
| 1338 | * accounting is being enabled, then @file refers to the open file used to | ||
| 1339 | * store accounting records. If accounting is being disabled, then @file | ||
| 1340 | * is NULL. | ||
| 1341 | * @file contains the file structure for the accounting file (may be NULL). | ||
| 1342 | * Return 0 if permission is granted. | ||
| 1343 | * @sysctl: | 1257 | * @sysctl: |
| 1344 | * Check permission before accessing the @table sysctl variable in the | 1258 | * Check permission before accessing the @table sysctl variable in the |
| 1345 | * manner specified by @op. | 1259 | * manner specified by @op. |
| @@ -1462,7 +1376,6 @@ struct security_operations { | |||
| 1462 | const kernel_cap_t *permitted); | 1376 | const kernel_cap_t *permitted); |
| 1463 | int (*capable) (struct task_struct *tsk, const struct cred *cred, | 1377 | int (*capable) (struct task_struct *tsk, const struct cred *cred, |
| 1464 | int cap, int audit); | 1378 | int cap, int audit); |
| 1465 | int (*acct) (struct file *file); | ||
| 1466 | int (*sysctl) (struct ctl_table *table, int op); | 1379 | int (*sysctl) (struct ctl_table *table, int op); |
| 1467 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); | 1380 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); |
| 1468 | int (*quota_on) (struct dentry *dentry); | 1381 | int (*quota_on) (struct dentry *dentry); |
| @@ -1484,18 +1397,9 @@ struct security_operations { | |||
| 1484 | int (*sb_statfs) (struct dentry *dentry); | 1397 | int (*sb_statfs) (struct dentry *dentry); |
| 1485 | int (*sb_mount) (char *dev_name, struct path *path, | 1398 | int (*sb_mount) (char *dev_name, struct path *path, |
| 1486 | char *type, unsigned long flags, void *data); | 1399 | char *type, unsigned long flags, void *data); |
| 1487 | int (*sb_check_sb) (struct vfsmount *mnt, struct path *path); | ||
| 1488 | int (*sb_umount) (struct vfsmount *mnt, int flags); | 1400 | int (*sb_umount) (struct vfsmount *mnt, int flags); |
| 1489 | void (*sb_umount_close) (struct vfsmount *mnt); | ||
| 1490 | void (*sb_umount_busy) (struct vfsmount *mnt); | ||
| 1491 | void (*sb_post_remount) (struct vfsmount *mnt, | ||
| 1492 | unsigned long flags, void *data); | ||
| 1493 | void (*sb_post_addmount) (struct vfsmount *mnt, | ||
| 1494 | struct path *mountpoint); | ||
| 1495 | int (*sb_pivotroot) (struct path *old_path, | 1401 | int (*sb_pivotroot) (struct path *old_path, |
| 1496 | struct path *new_path); | 1402 | struct path *new_path); |
| 1497 | void (*sb_post_pivotroot) (struct path *old_path, | ||
| 1498 | struct path *new_path); | ||
| 1499 | int (*sb_set_mnt_opts) (struct super_block *sb, | 1403 | int (*sb_set_mnt_opts) (struct super_block *sb, |
| 1500 | struct security_mnt_opts *opts); | 1404 | struct security_mnt_opts *opts); |
| 1501 | void (*sb_clone_mnt_opts) (const struct super_block *oldsb, | 1405 | void (*sb_clone_mnt_opts) (const struct super_block *oldsb, |
| @@ -1544,7 +1448,6 @@ struct security_operations { | |||
| 1544 | int (*inode_permission) (struct inode *inode, int mask); | 1448 | int (*inode_permission) (struct inode *inode, int mask); |
| 1545 | int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); | 1449 | int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); |
| 1546 | int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); | 1450 | int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); |
| 1547 | void (*inode_delete) (struct inode *inode); | ||
| 1548 | int (*inode_setxattr) (struct dentry *dentry, const char *name, | 1451 | int (*inode_setxattr) (struct dentry *dentry, const char *name, |
| 1549 | const void *value, size_t size, int flags); | 1452 | const void *value, size_t size, int flags); |
| 1550 | void (*inode_post_setxattr) (struct dentry *dentry, const char *name, | 1453 | void (*inode_post_setxattr) (struct dentry *dentry, const char *name, |
| @@ -1585,20 +1488,16 @@ struct security_operations { | |||
| 1585 | void (*cred_free) (struct cred *cred); | 1488 | void (*cred_free) (struct cred *cred); |
| 1586 | int (*cred_prepare)(struct cred *new, const struct cred *old, | 1489 | int (*cred_prepare)(struct cred *new, const struct cred *old, |
| 1587 | gfp_t gfp); | 1490 | gfp_t gfp); |
| 1588 | void (*cred_commit)(struct cred *new, const struct cred *old); | ||
| 1589 | void (*cred_transfer)(struct cred *new, const struct cred *old); | 1491 | void (*cred_transfer)(struct cred *new, const struct cred *old); |
| 1590 | int (*kernel_act_as)(struct cred *new, u32 secid); | 1492 | int (*kernel_act_as)(struct cred *new, u32 secid); |
| 1591 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); | 1493 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); |
| 1592 | int (*kernel_module_request)(char *kmod_name); | 1494 | int (*kernel_module_request)(char *kmod_name); |
| 1593 | int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); | ||
| 1594 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, | 1495 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, |
| 1595 | int flags); | 1496 | int flags); |
| 1596 | int (*task_setgid) (gid_t id0, gid_t id1, gid_t id2, int flags); | ||
| 1597 | int (*task_setpgid) (struct task_struct *p, pid_t pgid); | 1497 | int (*task_setpgid) (struct task_struct *p, pid_t pgid); |
| 1598 | int (*task_getpgid) (struct task_struct *p); | 1498 | int (*task_getpgid) (struct task_struct *p); |
| 1599 | int (*task_getsid) (struct task_struct *p); | 1499 | int (*task_getsid) (struct task_struct *p); |
| 1600 | void (*task_getsecid) (struct task_struct *p, u32 *secid); | 1500 | void (*task_getsecid) (struct task_struct *p, u32 *secid); |
| 1601 | int (*task_setgroups) (struct group_info *group_info); | ||
| 1602 | int (*task_setnice) (struct task_struct *p, int nice); | 1501 | int (*task_setnice) (struct task_struct *p, int nice); |
| 1603 | int (*task_setioprio) (struct task_struct *p, int ioprio); | 1502 | int (*task_setioprio) (struct task_struct *p, int ioprio); |
| 1604 | int (*task_getioprio) (struct task_struct *p); | 1503 | int (*task_getioprio) (struct task_struct *p); |
| @@ -1728,9 +1627,6 @@ struct security_operations { | |||
| 1728 | const struct cred *cred, | 1627 | const struct cred *cred, |
| 1729 | key_perm_t perm); | 1628 | key_perm_t perm); |
| 1730 | int (*key_getsecurity)(struct key *key, char **_buffer); | 1629 | int (*key_getsecurity)(struct key *key, char **_buffer); |
| 1731 | int (*key_session_to_parent)(const struct cred *cred, | ||
| 1732 | const struct cred *parent_cred, | ||
| 1733 | struct key *key); | ||
| 1734 | #endif /* CONFIG_KEYS */ | 1630 | #endif /* CONFIG_KEYS */ |
| 1735 | 1631 | ||
| 1736 | #ifdef CONFIG_AUDIT | 1632 | #ifdef CONFIG_AUDIT |
| @@ -1761,7 +1657,6 @@ int security_capset(struct cred *new, const struct cred *old, | |||
| 1761 | int security_capable(int cap); | 1657 | int security_capable(int cap); |
| 1762 | int security_real_capable(struct task_struct *tsk, int cap); | 1658 | int security_real_capable(struct task_struct *tsk, int cap); |
| 1763 | int security_real_capable_noaudit(struct task_struct *tsk, int cap); | 1659 | int security_real_capable_noaudit(struct task_struct *tsk, int cap); |
| 1764 | int security_acct(struct file *file); | ||
| 1765 | int security_sysctl(struct ctl_table *table, int op); | 1660 | int security_sysctl(struct ctl_table *table, int op); |
| 1766 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); | 1661 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); |
| 1767 | int security_quota_on(struct dentry *dentry); | 1662 | int security_quota_on(struct dentry *dentry); |
| @@ -1783,14 +1678,8 @@ int security_sb_show_options(struct seq_file *m, struct super_block *sb); | |||
| 1783 | int security_sb_statfs(struct dentry *dentry); | 1678 | int security_sb_statfs(struct dentry *dentry); |
| 1784 | int security_sb_mount(char *dev_name, struct path *path, | 1679 | int security_sb_mount(char *dev_name, struct path *path, |
| 1785 | char *type, unsigned long flags, void *data); | 1680 | char *type, unsigned long flags, void *data); |
| 1786 | int security_sb_check_sb(struct vfsmount *mnt, struct path *path); | ||
| 1787 | int security_sb_umount(struct vfsmount *mnt, int flags); | 1681 | int security_sb_umount(struct vfsmount *mnt, int flags); |
| 1788 | void security_sb_umount_close(struct vfsmount *mnt); | ||
| 1789 | void security_sb_umount_busy(struct vfsmount *mnt); | ||
| 1790 | void security_sb_post_remount(struct vfsmount *mnt, unsigned long flags, void *data); | ||
| 1791 | void security_sb_post_addmount(struct vfsmount *mnt, struct path *mountpoint); | ||
| 1792 | int security_sb_pivotroot(struct path *old_path, struct path *new_path); | 1682 | int security_sb_pivotroot(struct path *old_path, struct path *new_path); |
| 1793 | void security_sb_post_pivotroot(struct path *old_path, struct path *new_path); | ||
| 1794 | int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); | 1683 | int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); |
| 1795 | void security_sb_clone_mnt_opts(const struct super_block *oldsb, | 1684 | void security_sb_clone_mnt_opts(const struct super_block *oldsb, |
| 1796 | struct super_block *newsb); | 1685 | struct super_block *newsb); |
| @@ -1816,7 +1705,6 @@ int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); | |||
| 1816 | int security_inode_permission(struct inode *inode, int mask); | 1705 | int security_inode_permission(struct inode *inode, int mask); |
| 1817 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr); | 1706 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr); |
| 1818 | int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); | 1707 | int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); |
| 1819 | void security_inode_delete(struct inode *inode); | ||
| 1820 | int security_inode_setxattr(struct dentry *dentry, const char *name, | 1708 | int security_inode_setxattr(struct dentry *dentry, const char *name, |
| 1821 | const void *value, size_t size, int flags); | 1709 | const void *value, size_t size, int flags); |
| 1822 | void security_inode_post_setxattr(struct dentry *dentry, const char *name, | 1710 | void security_inode_post_setxattr(struct dentry *dentry, const char *name, |
| @@ -1850,20 +1738,16 @@ int security_task_create(unsigned long clone_flags); | |||
| 1850 | int security_cred_alloc_blank(struct cred *cred, gfp_t gfp); | 1738 | int security_cred_alloc_blank(struct cred *cred, gfp_t gfp); |
| 1851 | void security_cred_free(struct cred *cred); | 1739 | void security_cred_free(struct cred *cred); |
| 1852 | int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp); | 1740 | int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp); |
| 1853 | void security_commit_creds(struct cred *new, const struct cred *old); | ||
| 1854 | void security_transfer_creds(struct cred *new, const struct cred *old); | 1741 | void security_transfer_creds(struct cred *new, const struct cred *old); |
| 1855 | int security_kernel_act_as(struct cred *new, u32 secid); | 1742 | int security_kernel_act_as(struct cred *new, u32 secid); |
| 1856 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); | 1743 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); |
| 1857 | int security_kernel_module_request(char *kmod_name); | 1744 | int security_kernel_module_request(char *kmod_name); |
| 1858 | int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); | ||
| 1859 | int security_task_fix_setuid(struct cred *new, const struct cred *old, | 1745 | int security_task_fix_setuid(struct cred *new, const struct cred *old, |
| 1860 | int flags); | 1746 | int flags); |
| 1861 | int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, int flags); | ||
| 1862 | int security_task_setpgid(struct task_struct *p, pid_t pgid); | 1747 | int security_task_setpgid(struct task_struct *p, pid_t pgid); |
| 1863 | int security_task_getpgid(struct task_struct *p); | 1748 | int security_task_getpgid(struct task_struct *p); |
| 1864 | int security_task_getsid(struct task_struct *p); | 1749 | int security_task_getsid(struct task_struct *p); |
| 1865 | void security_task_getsecid(struct task_struct *p, u32 *secid); | 1750 | void security_task_getsecid(struct task_struct *p, u32 *secid); |
| 1866 | int security_task_setgroups(struct group_info *group_info); | ||
| 1867 | int security_task_setnice(struct task_struct *p, int nice); | 1751 | int security_task_setnice(struct task_struct *p, int nice); |
| 1868 | int security_task_setioprio(struct task_struct *p, int ioprio); | 1752 | int security_task_setioprio(struct task_struct *p, int ioprio); |
| 1869 | int security_task_getioprio(struct task_struct *p); | 1753 | int security_task_getioprio(struct task_struct *p); |
| @@ -1990,11 +1874,6 @@ int security_real_capable_noaudit(struct task_struct *tsk, int cap) | |||
| 1990 | return ret; | 1874 | return ret; |
| 1991 | } | 1875 | } |
| 1992 | 1876 | ||
| 1993 | static inline int security_acct(struct file *file) | ||
| 1994 | { | ||
| 1995 | return 0; | ||
| 1996 | } | ||
| 1997 | |||
| 1998 | static inline int security_sysctl(struct ctl_table *table, int op) | 1877 | static inline int security_sysctl(struct ctl_table *table, int op) |
| 1999 | { | 1878 | { |
| 2000 | return 0; | 1879 | return 0; |
| @@ -2099,41 +1978,17 @@ static inline int security_sb_mount(char *dev_name, struct path *path, | |||
| 2099 | return 0; | 1978 | return 0; |
| 2100 | } | 1979 | } |
| 2101 | 1980 | ||
| 2102 | static inline int security_sb_check_sb(struct vfsmount *mnt, | ||
| 2103 | struct path *path) | ||
| 2104 | { | ||
| 2105 | return 0; | ||
| 2106 | } | ||
| 2107 | |||
| 2108 | static inline int security_sb_umount(struct vfsmount *mnt, int flags) | 1981 | static inline int security_sb_umount(struct vfsmount *mnt, int flags) |
| 2109 | { | 1982 | { |
| 2110 | return 0; | 1983 | return 0; |
| 2111 | } | 1984 | } |
| 2112 | 1985 | ||
| 2113 | static inline void security_sb_umount_close(struct vfsmount *mnt) | ||
| 2114 | { } | ||
| 2115 | |||
| 2116 | static inline void security_sb_umount_busy(struct vfsmount *mnt) | ||
| 2117 | { } | ||
| 2118 | |||
| 2119 | static inline void security_sb_post_remount(struct vfsmount *mnt, | ||
| 2120 | unsigned long flags, void *data) | ||
| 2121 | { } | ||
| 2122 | |||
| 2123 | static inline void security_sb_post_addmount(struct vfsmount *mnt, | ||
| 2124 | struct path *mountpoint) | ||
| 2125 | { } | ||
| 2126 | |||
| 2127 | static inline int security_sb_pivotroot(struct path *old_path, | 1986 | static inline int security_sb_pivotroot(struct path *old_path, |
| 2128 | struct path *new_path) | 1987 | struct path *new_path) |
| 2129 | { | 1988 | { |
| 2130 | return 0; | 1989 | return 0; |
| 2131 | } | 1990 | } |
| 2132 | 1991 | ||
| 2133 | static inline void security_sb_post_pivotroot(struct path *old_path, | ||
| 2134 | struct path *new_path) | ||
| 2135 | { } | ||
| 2136 | |||
| 2137 | static inline int security_sb_set_mnt_opts(struct super_block *sb, | 1992 | static inline int security_sb_set_mnt_opts(struct super_block *sb, |
| 2138 | struct security_mnt_opts *opts) | 1993 | struct security_mnt_opts *opts) |
| 2139 | { | 1994 | { |
| @@ -2249,9 +2104,6 @@ static inline int security_inode_getattr(struct vfsmount *mnt, | |||
| 2249 | return 0; | 2104 | return 0; |
| 2250 | } | 2105 | } |
| 2251 | 2106 | ||
| 2252 | static inline void security_inode_delete(struct inode *inode) | ||
| 2253 | { } | ||
| 2254 | |||
| 2255 | static inline int security_inode_setxattr(struct dentry *dentry, | 2107 | static inline int security_inode_setxattr(struct dentry *dentry, |
| 2256 | const char *name, const void *value, size_t size, int flags) | 2108 | const char *name, const void *value, size_t size, int flags) |
| 2257 | { | 2109 | { |
| @@ -2398,11 +2250,6 @@ static inline int security_prepare_creds(struct cred *new, | |||
| 2398 | return 0; | 2250 | return 0; |
| 2399 | } | 2251 | } |
| 2400 | 2252 | ||
| 2401 | static inline void security_commit_creds(struct cred *new, | ||
| 2402 | const struct cred *old) | ||
| 2403 | { | ||
| 2404 | } | ||
| 2405 | |||
| 2406 | static inline void security_transfer_creds(struct cred *new, | 2253 | static inline void security_transfer_creds(struct cred *new, |
| 2407 | const struct cred *old) | 2254 | const struct cred *old) |
| 2408 | { | 2255 | { |
| @@ -2424,12 +2271,6 @@ static inline int security_kernel_module_request(char *kmod_name) | |||
| 2424 | return 0; | 2271 | return 0; |
| 2425 | } | 2272 | } |
| 2426 | 2273 | ||
| 2427 | static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, | ||
| 2428 | int flags) | ||
| 2429 | { | ||
| 2430 | return 0; | ||
| 2431 | } | ||
| 2432 | |||
| 2433 | static inline int security_task_fix_setuid(struct cred *new, | 2274 | static inline int security_task_fix_setuid(struct cred *new, |
| 2434 | const struct cred *old, | 2275 | const struct cred *old, |
| 2435 | int flags) | 2276 | int flags) |
| @@ -2437,12 +2278,6 @@ static inline int security_task_fix_setuid(struct cred *new, | |||
| 2437 | return cap_task_fix_setuid(new, old, flags); | 2278 | return cap_task_fix_setuid(new, old, flags); |
| 2438 | } | 2279 | } |
| 2439 | 2280 | ||
| 2440 | static inline int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, | ||
| 2441 | int flags) | ||
| 2442 | { | ||
| 2443 | return 0; | ||
| 2444 | } | ||
| 2445 | |||
| 2446 | static inline int security_task_setpgid(struct task_struct *p, pid_t pgid) | 2281 | static inline int security_task_setpgid(struct task_struct *p, pid_t pgid) |
| 2447 | { | 2282 | { |
| 2448 | return 0; | 2283 | return 0; |
| @@ -2463,11 +2298,6 @@ static inline void security_task_getsecid(struct task_struct *p, u32 *secid) | |||
| 2463 | *secid = 0; | 2298 | *secid = 0; |
| 2464 | } | 2299 | } |
| 2465 | 2300 | ||
| 2466 | static inline int security_task_setgroups(struct group_info *group_info) | ||
| 2467 | { | ||
| 2468 | return 0; | ||
| 2469 | } | ||
| 2470 | |||
| 2471 | static inline int security_task_setnice(struct task_struct *p, int nice) | 2301 | static inline int security_task_setnice(struct task_struct *p, int nice) |
| 2472 | { | 2302 | { |
| 2473 | return cap_task_setnice(p, nice); | 2303 | return cap_task_setnice(p, nice); |
| @@ -3064,9 +2894,6 @@ void security_key_free(struct key *key); | |||
| 3064 | int security_key_permission(key_ref_t key_ref, | 2894 | int security_key_permission(key_ref_t key_ref, |
| 3065 | const struct cred *cred, key_perm_t perm); | 2895 | const struct cred *cred, key_perm_t perm); |
| 3066 | int security_key_getsecurity(struct key *key, char **_buffer); | 2896 | int security_key_getsecurity(struct key *key, char **_buffer); |
| 3067 | int security_key_session_to_parent(const struct cred *cred, | ||
| 3068 | const struct cred *parent_cred, | ||
| 3069 | struct key *key); | ||
| 3070 | 2897 | ||
| 3071 | #else | 2898 | #else |
| 3072 | 2899 | ||
| @@ -3094,13 +2921,6 @@ static inline int security_key_getsecurity(struct key *key, char **_buffer) | |||
| 3094 | return 0; | 2921 | return 0; |
| 3095 | } | 2922 | } |
| 3096 | 2923 | ||
| 3097 | static inline int security_key_session_to_parent(const struct cred *cred, | ||
| 3098 | const struct cred *parent_cred, | ||
| 3099 | struct key *key) | ||
| 3100 | { | ||
| 3101 | return 0; | ||
| 3102 | } | ||
| 3103 | |||
| 3104 | #endif | 2924 | #endif |
| 3105 | #endif /* CONFIG_KEYS */ | 2925 | #endif /* CONFIG_KEYS */ |
| 3106 | 2926 | ||
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 8c3dd36fe91a..78dd1e7120a9 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -491,9 +491,13 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status) | |||
| 491 | { | 491 | { |
| 492 | struct uart_state *state = uport->state; | 492 | struct uart_state *state = uport->state; |
| 493 | struct tty_port *port = &state->port; | 493 | struct tty_port *port = &state->port; |
| 494 | struct tty_ldisc *ld = tty_ldisc_ref(port->tty); | ||
| 495 | struct timespec ts; | ||
| 494 | 496 | ||
| 495 | uport->icount.dcd++; | 497 | if (ld && ld->ops->dcd_change) |
| 498 | getnstimeofday(&ts); | ||
| 496 | 499 | ||
| 500 | uport->icount.dcd++; | ||
| 497 | #ifdef CONFIG_HARD_PPS | 501 | #ifdef CONFIG_HARD_PPS |
| 498 | if ((uport->flags & UPF_HARDPPS_CD) && status) | 502 | if ((uport->flags & UPF_HARDPPS_CD) && status) |
| 499 | hardpps(); | 503 | hardpps(); |
| @@ -505,6 +509,11 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status) | |||
| 505 | else if (port->tty) | 509 | else if (port->tty) |
| 506 | tty_hangup(port->tty); | 510 | tty_hangup(port->tty); |
| 507 | } | 511 | } |
| 512 | |||
| 513 | if (ld && ld->ops->dcd_change) | ||
| 514 | ld->ops->dcd_change(port->tty, status, &ts); | ||
| 515 | if (ld) | ||
| 516 | tty_ldisc_deref(ld); | ||
| 508 | } | 517 | } |
| 509 | 518 | ||
| 510 | /** | 519 | /** |
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index 1b177d29a7f0..f5364a1de68b 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
| @@ -2,7 +2,9 @@ | |||
| 2 | #define __LINUX_SERIAL_SCI_H | 2 | #define __LINUX_SERIAL_SCI_H |
| 3 | 3 | ||
| 4 | #include <linux/serial_core.h> | 4 | #include <linux/serial_core.h> |
| 5 | #ifdef CONFIG_SERIAL_SH_SCI_DMA | ||
| 5 | #include <asm/dmaengine.h> | 6 | #include <asm/dmaengine.h> |
| 7 | #endif | ||
| 6 | 8 | ||
| 7 | /* | 9 | /* |
| 8 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) | 10 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) |
| @@ -30,8 +32,10 @@ struct plat_sci_port { | |||
| 30 | upf_t flags; /* UPF_* flags */ | 32 | upf_t flags; /* UPF_* flags */ |
| 31 | char *clk; /* clock string */ | 33 | char *clk; /* clock string */ |
| 32 | struct device *dma_dev; | 34 | struct device *dma_dev; |
| 33 | enum sh_dmae_slave_chan_id dma_slave_tx; | 35 | #ifdef CONFIG_SERIAL_SH_SCI_DMA |
| 34 | enum sh_dmae_slave_chan_id dma_slave_rx; | 36 | unsigned int dma_slave_tx; |
| 37 | unsigned int dma_slave_rx; | ||
| 38 | #endif | ||
| 35 | }; | 39 | }; |
| 36 | 40 | ||
| 37 | #endif /* __LINUX_SERIAL_SCI_H */ | 41 | #endif /* __LINUX_SERIAL_SCI_H */ |
diff --git a/include/linux/serio.h b/include/linux/serio.h index 64b473066b9a..b5552568178d 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
| @@ -196,5 +196,6 @@ static inline void serio_continue_rx(struct serio *serio) | |||
| 196 | #define SERIO_TOUCHIT213 0x38 | 196 | #define SERIO_TOUCHIT213 0x38 |
| 197 | #define SERIO_W8001 0x39 | 197 | #define SERIO_W8001 0x39 |
| 198 | #define SERIO_DYNAPRO 0x3a | 198 | #define SERIO_DYNAPRO 0x3a |
| 199 | #define SERIO_HAMPSHIRE 0x3b | ||
| 199 | 200 | ||
| 200 | #endif | 201 | #endif |
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h new file mode 100644 index 000000000000..1636d1e2a5f1 --- /dev/null +++ b/include/linux/sh_clk.h | |||
| @@ -0,0 +1,150 @@ | |||
| 1 | #ifndef __SH_CLOCK_H | ||
| 2 | #define __SH_CLOCK_H | ||
| 3 | |||
| 4 | #include <linux/list.h> | ||
| 5 | #include <linux/seq_file.h> | ||
| 6 | #include <linux/cpufreq.h> | ||
| 7 | #include <linux/clk.h> | ||
| 8 | #include <linux/err.h> | ||
| 9 | |||
| 10 | struct clk; | ||
| 11 | |||
| 12 | struct clk_ops { | ||
| 13 | void (*init)(struct clk *clk); | ||
| 14 | int (*enable)(struct clk *clk); | ||
| 15 | void (*disable)(struct clk *clk); | ||
| 16 | unsigned long (*recalc)(struct clk *clk); | ||
| 17 | int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id); | ||
| 18 | int (*set_parent)(struct clk *clk, struct clk *parent); | ||
| 19 | long (*round_rate)(struct clk *clk, unsigned long rate); | ||
| 20 | }; | ||
| 21 | |||
| 22 | struct clk { | ||
| 23 | struct list_head node; | ||
| 24 | const char *name; | ||
| 25 | int id; | ||
| 26 | |||
| 27 | struct clk *parent; | ||
| 28 | struct clk_ops *ops; | ||
| 29 | |||
| 30 | struct list_head children; | ||
| 31 | struct list_head sibling; /* node for children */ | ||
| 32 | |||
| 33 | int usecount; | ||
| 34 | |||
| 35 | unsigned long rate; | ||
| 36 | unsigned long flags; | ||
| 37 | |||
| 38 | void __iomem *enable_reg; | ||
| 39 | unsigned int enable_bit; | ||
| 40 | |||
| 41 | unsigned long arch_flags; | ||
| 42 | void *priv; | ||
| 43 | struct dentry *dentry; | ||
| 44 | struct cpufreq_frequency_table *freq_table; | ||
| 45 | }; | ||
| 46 | |||
| 47 | #define CLK_ENABLE_ON_INIT (1 << 0) | ||
| 48 | |||
| 49 | /* drivers/sh/clk.c */ | ||
| 50 | unsigned long followparent_recalc(struct clk *); | ||
| 51 | void recalculate_root_clocks(void); | ||
| 52 | void propagate_rate(struct clk *); | ||
| 53 | int clk_reparent(struct clk *child, struct clk *parent); | ||
| 54 | int clk_register(struct clk *); | ||
| 55 | void clk_unregister(struct clk *); | ||
| 56 | void clk_enable_init_clocks(void); | ||
| 57 | |||
| 58 | /** | ||
| 59 | * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter | ||
| 60 | * @clk: clock source | ||
| 61 | * @rate: desired clock rate in Hz | ||
| 62 | * @algo_id: algorithm id to be passed down to ops->set_rate | ||
| 63 | * | ||
| 64 | * Returns success (0) or negative errno. | ||
| 65 | */ | ||
| 66 | int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id); | ||
| 67 | |||
| 68 | enum clk_sh_algo_id { | ||
| 69 | NO_CHANGE = 0, | ||
| 70 | |||
| 71 | IUS_N1_N1, | ||
| 72 | IUS_322, | ||
| 73 | IUS_522, | ||
| 74 | IUS_N11, | ||
| 75 | |||
| 76 | SB_N1, | ||
| 77 | |||
| 78 | SB3_N1, | ||
| 79 | SB3_32, | ||
| 80 | SB3_43, | ||
| 81 | SB3_54, | ||
| 82 | |||
| 83 | BP_N1, | ||
| 84 | |||
| 85 | IP_N1, | ||
| 86 | }; | ||
| 87 | |||
| 88 | struct clk_div_mult_table { | ||
| 89 | unsigned int *divisors; | ||
| 90 | unsigned int nr_divisors; | ||
| 91 | unsigned int *multipliers; | ||
| 92 | unsigned int nr_multipliers; | ||
| 93 | }; | ||
| 94 | |||
| 95 | struct cpufreq_frequency_table; | ||
| 96 | void clk_rate_table_build(struct clk *clk, | ||
| 97 | struct cpufreq_frequency_table *freq_table, | ||
| 98 | int nr_freqs, | ||
| 99 | struct clk_div_mult_table *src_table, | ||
| 100 | unsigned long *bitmap); | ||
| 101 | |||
| 102 | long clk_rate_table_round(struct clk *clk, | ||
| 103 | struct cpufreq_frequency_table *freq_table, | ||
| 104 | unsigned long rate); | ||
| 105 | |||
| 106 | int clk_rate_table_find(struct clk *clk, | ||
| 107 | struct cpufreq_frequency_table *freq_table, | ||
| 108 | unsigned long rate); | ||
| 109 | |||
| 110 | #define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \ | ||
| 111 | { \ | ||
| 112 | .parent = _parent, \ | ||
| 113 | .enable_reg = (void __iomem *)_enable_reg, \ | ||
| 114 | .enable_bit = _enable_bit, \ | ||
| 115 | .flags = _flags, \ | ||
| 116 | } | ||
| 117 | |||
| 118 | int sh_clk_mstp32_register(struct clk *clks, int nr); | ||
| 119 | |||
| 120 | #define SH_CLK_DIV4(_parent, _reg, _shift, _div_bitmap, _flags) \ | ||
| 121 | { \ | ||
| 122 | .parent = _parent, \ | ||
| 123 | .enable_reg = (void __iomem *)_reg, \ | ||
| 124 | .enable_bit = _shift, \ | ||
| 125 | .arch_flags = _div_bitmap, \ | ||
| 126 | .flags = _flags, \ | ||
| 127 | } | ||
| 128 | |||
| 129 | struct clk_div4_table { | ||
| 130 | struct clk_div_mult_table *div_mult_table; | ||
| 131 | void (*kick)(struct clk *clk); | ||
| 132 | }; | ||
| 133 | |||
| 134 | int sh_clk_div4_register(struct clk *clks, int nr, | ||
| 135 | struct clk_div4_table *table); | ||
| 136 | int sh_clk_div4_enable_register(struct clk *clks, int nr, | ||
| 137 | struct clk_div4_table *table); | ||
| 138 | int sh_clk_div4_reparent_register(struct clk *clks, int nr, | ||
| 139 | struct clk_div4_table *table); | ||
| 140 | |||
| 141 | #define SH_CLK_DIV6(_parent, _reg, _flags) \ | ||
| 142 | { \ | ||
| 143 | .parent = _parent, \ | ||
| 144 | .enable_reg = (void __iomem *)_reg, \ | ||
| 145 | .flags = _flags, \ | ||
| 146 | } | ||
| 147 | |||
| 148 | int sh_clk_div6_register(struct clk *clks, int nr); | ||
| 149 | |||
| 150 | #endif /* __SH_CLOCK_H */ | ||
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h new file mode 100644 index 000000000000..b08cd4efa15c --- /dev/null +++ b/include/linux/sh_dma.h | |||
| @@ -0,0 +1,102 @@ | |||
| 1 | /* | ||
| 2 | * Header for the new SH dmaengine driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | #ifndef SH_DMA_H | ||
| 11 | #define SH_DMA_H | ||
| 12 | |||
| 13 | #include <linux/list.h> | ||
| 14 | #include <linux/dmaengine.h> | ||
| 15 | |||
| 16 | /* Used by slave DMA clients to request DMA to/from a specific peripheral */ | ||
| 17 | struct sh_dmae_slave { | ||
| 18 | unsigned int slave_id; /* Set by the platform */ | ||
| 19 | struct device *dma_dev; /* Set by the platform */ | ||
| 20 | const struct sh_dmae_slave_config *config; /* Set by the driver */ | ||
| 21 | }; | ||
| 22 | |||
| 23 | struct sh_dmae_regs { | ||
| 24 | u32 sar; /* SAR / source address */ | ||
| 25 | u32 dar; /* DAR / destination address */ | ||
| 26 | u32 tcr; /* TCR / transfer count */ | ||
| 27 | }; | ||
| 28 | |||
| 29 | struct sh_desc { | ||
| 30 | struct sh_dmae_regs hw; | ||
| 31 | struct list_head node; | ||
| 32 | struct dma_async_tx_descriptor async_tx; | ||
| 33 | enum dma_data_direction direction; | ||
| 34 | dma_cookie_t cookie; | ||
| 35 | size_t partial; | ||
| 36 | int chunks; | ||
| 37 | int mark; | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct sh_dmae_slave_config { | ||
| 41 | unsigned int slave_id; | ||
| 42 | dma_addr_t addr; | ||
| 43 | u32 chcr; | ||
| 44 | char mid_rid; | ||
| 45 | }; | ||
| 46 | |||
| 47 | struct sh_dmae_channel { | ||
| 48 | unsigned int offset; | ||
| 49 | unsigned int dmars; | ||
| 50 | unsigned int dmars_bit; | ||
| 51 | }; | ||
| 52 | |||
| 53 | struct sh_dmae_pdata { | ||
| 54 | const struct sh_dmae_slave_config *slave; | ||
| 55 | int slave_num; | ||
| 56 | const struct sh_dmae_channel *channel; | ||
| 57 | int channel_num; | ||
| 58 | unsigned int ts_low_shift; | ||
| 59 | unsigned int ts_low_mask; | ||
| 60 | unsigned int ts_high_shift; | ||
| 61 | unsigned int ts_high_mask; | ||
| 62 | const unsigned int *ts_shift; | ||
| 63 | int ts_shift_num; | ||
| 64 | u16 dmaor_init; | ||
| 65 | }; | ||
| 66 | |||
| 67 | /* DMA register */ | ||
| 68 | #define SAR 0x00 | ||
| 69 | #define DAR 0x04 | ||
| 70 | #define TCR 0x08 | ||
| 71 | #define CHCR 0x0C | ||
| 72 | #define DMAOR 0x40 | ||
| 73 | |||
| 74 | /* DMAOR definitions */ | ||
| 75 | #define DMAOR_AE 0x00000004 | ||
| 76 | #define DMAOR_NMIF 0x00000002 | ||
| 77 | #define DMAOR_DME 0x00000001 | ||
| 78 | |||
| 79 | /* Definitions for the SuperH DMAC */ | ||
| 80 | #define REQ_L 0x00000000 | ||
| 81 | #define REQ_E 0x00080000 | ||
| 82 | #define RACK_H 0x00000000 | ||
| 83 | #define RACK_L 0x00040000 | ||
| 84 | #define ACK_R 0x00000000 | ||
| 85 | #define ACK_W 0x00020000 | ||
| 86 | #define ACK_H 0x00000000 | ||
| 87 | #define ACK_L 0x00010000 | ||
| 88 | #define DM_INC 0x00004000 | ||
| 89 | #define DM_DEC 0x00008000 | ||
| 90 | #define DM_FIX 0x0000c000 | ||
| 91 | #define SM_INC 0x00001000 | ||
| 92 | #define SM_DEC 0x00002000 | ||
| 93 | #define SM_FIX 0x00003000 | ||
| 94 | #define RS_IN 0x00000200 | ||
| 95 | #define RS_OUT 0x00000300 | ||
| 96 | #define TS_BLK 0x00000040 | ||
| 97 | #define TM_BUR 0x00000020 | ||
| 98 | #define CHCR_DE 0x00000001 | ||
| 99 | #define CHCR_TE 0x00000002 | ||
| 100 | #define CHCR_IE 0x00000004 | ||
| 101 | |||
| 102 | #endif | ||
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h index 51d288d8ac88..0d6cd38e673d 100644 --- a/include/linux/sh_intc.h +++ b/include/linux/sh_intc.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef __SH_INTC_H | 1 | #ifndef __SH_INTC_H |
| 2 | #define __SH_INTC_H | 2 | #define __SH_INTC_H |
| 3 | 3 | ||
| 4 | #include <linux/ioport.h> | ||
| 5 | |||
| 4 | typedef unsigned char intc_enum; | 6 | typedef unsigned char intc_enum; |
| 5 | 7 | ||
| 6 | struct intc_vect { | 8 | struct intc_vect { |
| @@ -21,6 +23,9 @@ struct intc_group { | |||
| 21 | struct intc_mask_reg { | 23 | struct intc_mask_reg { |
| 22 | unsigned long set_reg, clr_reg, reg_width; | 24 | unsigned long set_reg, clr_reg, reg_width; |
| 23 | intc_enum enum_ids[32]; | 25 | intc_enum enum_ids[32]; |
| 26 | #ifdef CONFIG_INTC_BALANCING | ||
| 27 | unsigned long dist_reg; | ||
| 28 | #endif | ||
| 24 | #ifdef CONFIG_SMP | 29 | #ifdef CONFIG_SMP |
| 25 | unsigned long smp; | 30 | unsigned long smp; |
| 26 | #endif | 31 | #endif |
| @@ -39,8 +44,14 @@ struct intc_sense_reg { | |||
| 39 | intc_enum enum_ids[16]; | 44 | intc_enum enum_ids[16]; |
| 40 | }; | 45 | }; |
| 41 | 46 | ||
| 47 | #ifdef CONFIG_INTC_BALANCING | ||
| 48 | #define INTC_SMP_BALANCING(reg) .dist_reg = (reg) | ||
| 49 | #else | ||
| 50 | #define INTC_SMP_BALANCING(reg) | ||
| 51 | #endif | ||
| 52 | |||
| 42 | #ifdef CONFIG_SMP | 53 | #ifdef CONFIG_SMP |
| 43 | #define INTC_SMP(stride, nr) .smp = (stride) | ((nr) << 8) | 54 | #define INTC_SMP(stride, nr) .smp = (stride) | ((nr) << 8) |
| 44 | #else | 55 | #else |
| 45 | #define INTC_SMP(stride, nr) | 56 | #define INTC_SMP(stride, nr) |
| 46 | #endif | 57 | #endif |
| @@ -71,6 +82,8 @@ struct intc_hw_desc { | |||
| 71 | 82 | ||
| 72 | struct intc_desc { | 83 | struct intc_desc { |
| 73 | char *name; | 84 | char *name; |
| 85 | struct resource *resource; | ||
| 86 | unsigned int num_resources; | ||
| 74 | intc_enum force_enable; | 87 | intc_enum force_enable; |
| 75 | intc_enum force_disable; | 88 | intc_enum force_disable; |
| 76 | struct intc_hw_desc hw; | 89 | struct intc_hw_desc hw; |
| @@ -92,9 +105,18 @@ struct intc_desc symbol __initdata = { \ | |||
| 92 | prio_regs, sense_regs, ack_regs), \ | 105 | prio_regs, sense_regs, ack_regs), \ |
| 93 | } | 106 | } |
| 94 | 107 | ||
| 95 | void __init register_intc_controller(struct intc_desc *desc); | 108 | int __init register_intc_controller(struct intc_desc *desc); |
| 96 | int intc_set_priority(unsigned int irq, unsigned int prio); | 109 | int intc_set_priority(unsigned int irq, unsigned int prio); |
| 97 | 110 | ||
| 111 | #ifdef CONFIG_INTC_USERIMASK | ||
| 112 | int register_intc_userimask(unsigned long addr); | ||
| 113 | #else | ||
| 114 | static inline int register_intc_userimask(unsigned long addr) | ||
| 115 | { | ||
| 116 | return 0; | ||
| 117 | } | ||
| 118 | #endif | ||
| 119 | |||
| 98 | int reserve_irq_vector(unsigned int irq); | 120 | int reserve_irq_vector(unsigned int irq); |
| 99 | void reserve_irq_legacy(void); | 121 | void reserve_irq_legacy(void); |
| 100 | 122 | ||
diff --git a/include/linux/signal.h b/include/linux/signal.h index ab9272cc270c..fcd2b14b1932 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
| 8 | #include <linux/list.h> | 8 | #include <linux/list.h> |
| 9 | 9 | ||
| 10 | /* for sysctl */ | ||
| 11 | extern int print_fatal_signals; | ||
| 10 | /* | 12 | /* |
| 11 | * Real Time signals may be queued. | 13 | * Real Time signals may be queued. |
| 12 | */ | 14 | */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 03f816a9b659..7cdfb4d52847 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -187,12 +187,8 @@ union skb_shared_tx { | |||
| 187 | * the end of the header data, ie. at skb->end. | 187 | * the end of the header data, ie. at skb->end. |
| 188 | */ | 188 | */ |
| 189 | struct skb_shared_info { | 189 | struct skb_shared_info { |
| 190 | atomic_t dataref; | ||
| 191 | unsigned short nr_frags; | 190 | unsigned short nr_frags; |
| 192 | unsigned short gso_size; | 191 | unsigned short gso_size; |
| 193 | #ifdef CONFIG_HAS_DMA | ||
| 194 | dma_addr_t dma_head; | ||
| 195 | #endif | ||
| 196 | /* Warning: this field is not always filled in (UFO)! */ | 192 | /* Warning: this field is not always filled in (UFO)! */ |
| 197 | unsigned short gso_segs; | 193 | unsigned short gso_segs; |
| 198 | unsigned short gso_type; | 194 | unsigned short gso_type; |
| @@ -200,10 +196,13 @@ struct skb_shared_info { | |||
| 200 | union skb_shared_tx tx_flags; | 196 | union skb_shared_tx tx_flags; |
| 201 | struct sk_buff *frag_list; | 197 | struct sk_buff *frag_list; |
| 202 | struct skb_shared_hwtstamps hwtstamps; | 198 | struct skb_shared_hwtstamps hwtstamps; |
| 199 | |||
| 200 | /* | ||
| 201 | * Warning : all fields before dataref are cleared in __alloc_skb() | ||
| 202 | */ | ||
| 203 | atomic_t dataref; | ||
| 204 | |||
| 203 | skb_frag_t frags[MAX_SKB_FRAGS]; | 205 | skb_frag_t frags[MAX_SKB_FRAGS]; |
| 204 | #ifdef CONFIG_HAS_DMA | ||
| 205 | dma_addr_t dma_maps[MAX_SKB_FRAGS]; | ||
| 206 | #endif | ||
| 207 | /* Intermediate layers must ensure that destructor_arg | 206 | /* Intermediate layers must ensure that destructor_arg |
| 208 | * remains valid until skb destructor */ | 207 | * remains valid until skb destructor */ |
| 209 | void * destructor_arg; | 208 | void * destructor_arg; |
| @@ -265,7 +264,7 @@ typedef unsigned char *sk_buff_data_t; | |||
| 265 | * @transport_header: Transport layer header | 264 | * @transport_header: Transport layer header |
| 266 | * @network_header: Network layer header | 265 | * @network_header: Network layer header |
| 267 | * @mac_header: Link layer header | 266 | * @mac_header: Link layer header |
| 268 | * @_skb_dst: destination entry | 267 | * @_skb_refdst: destination entry (with norefcount bit) |
| 269 | * @sp: the security path, used for xfrm | 268 | * @sp: the security path, used for xfrm |
| 270 | * @cb: Control buffer. Free for use by every layer. Put private vars here | 269 | * @cb: Control buffer. Free for use by every layer. Put private vars here |
| 271 | * @len: Length of actual data | 270 | * @len: Length of actual data |
| @@ -300,6 +299,7 @@ typedef unsigned char *sk_buff_data_t; | |||
| 300 | * @nfct_reasm: netfilter conntrack re-assembly pointer | 299 | * @nfct_reasm: netfilter conntrack re-assembly pointer |
| 301 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c | 300 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c |
| 302 | * @skb_iif: ifindex of device we arrived on | 301 | * @skb_iif: ifindex of device we arrived on |
| 302 | * @rxhash: the packet hash computed on receive | ||
| 303 | * @queue_mapping: Queue mapping for multiqueue devices | 303 | * @queue_mapping: Queue mapping for multiqueue devices |
| 304 | * @tc_index: Traffic control index | 304 | * @tc_index: Traffic control index |
| 305 | * @tc_verd: traffic control verdict | 305 | * @tc_verd: traffic control verdict |
| @@ -328,7 +328,7 @@ struct sk_buff { | |||
| 328 | */ | 328 | */ |
| 329 | char cb[48] __aligned(8); | 329 | char cb[48] __aligned(8); |
| 330 | 330 | ||
| 331 | unsigned long _skb_dst; | 331 | unsigned long _skb_refdst; |
| 332 | #ifdef CONFIG_XFRM | 332 | #ifdef CONFIG_XFRM |
| 333 | struct sec_path *sp; | 333 | struct sec_path *sp; |
| 334 | #endif | 334 | #endif |
| @@ -375,6 +375,8 @@ struct sk_buff { | |||
| 375 | #endif | 375 | #endif |
| 376 | #endif | 376 | #endif |
| 377 | 377 | ||
| 378 | __u32 rxhash; | ||
| 379 | |||
| 378 | kmemcheck_bitfield_begin(flags2); | 380 | kmemcheck_bitfield_begin(flags2); |
| 379 | __u16 queue_mapping:16; | 381 | __u16 queue_mapping:16; |
| 380 | #ifdef CONFIG_IPV6_NDISC_NODETYPE | 382 | #ifdef CONFIG_IPV6_NDISC_NODETYPE |
| @@ -417,14 +419,64 @@ struct sk_buff { | |||
| 417 | 419 | ||
| 418 | #include <asm/system.h> | 420 | #include <asm/system.h> |
| 419 | 421 | ||
| 422 | /* | ||
| 423 | * skb might have a dst pointer attached, refcounted or not. | ||
| 424 | * _skb_refdst low order bit is set if refcount was _not_ taken | ||
| 425 | */ | ||
| 426 | #define SKB_DST_NOREF 1UL | ||
| 427 | #define SKB_DST_PTRMASK ~(SKB_DST_NOREF) | ||
| 428 | |||
| 429 | /** | ||
| 430 | * skb_dst - returns skb dst_entry | ||
| 431 | * @skb: buffer | ||
| 432 | * | ||
| 433 | * Returns skb dst_entry, regardless of reference taken or not. | ||
| 434 | */ | ||
| 420 | static inline struct dst_entry *skb_dst(const struct sk_buff *skb) | 435 | static inline struct dst_entry *skb_dst(const struct sk_buff *skb) |
| 421 | { | 436 | { |
| 422 | return (struct dst_entry *)skb->_skb_dst; | 437 | /* If refdst was not refcounted, check we still are in a |
| 438 | * rcu_read_lock section | ||
| 439 | */ | ||
| 440 | WARN_ON((skb->_skb_refdst & SKB_DST_NOREF) && | ||
| 441 | !rcu_read_lock_held() && | ||
| 442 | !rcu_read_lock_bh_held()); | ||
| 443 | return (struct dst_entry *)(skb->_skb_refdst & SKB_DST_PTRMASK); | ||
| 423 | } | 444 | } |
| 424 | 445 | ||
| 446 | /** | ||
| 447 | * skb_dst_set - sets skb dst | ||
| 448 | * @skb: buffer | ||
| 449 | * @dst: dst entry | ||
| 450 | * | ||
| 451 | * Sets skb dst, assuming a reference was taken on dst and should | ||
| 452 | * be released by skb_dst_drop() | ||
| 453 | */ | ||
| 425 | static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst) | 454 | static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst) |
| 426 | { | 455 | { |
| 427 | skb->_skb_dst = (unsigned long)dst; | 456 | skb->_skb_refdst = (unsigned long)dst; |
| 457 | } | ||
| 458 | |||
| 459 | /** | ||
| 460 | * skb_dst_set_noref - sets skb dst, without a reference | ||
| 461 | * @skb: buffer | ||
| 462 | * @dst: dst entry | ||
| 463 | * | ||
| 464 | * Sets skb dst, assuming a reference was not taken on dst | ||
| 465 | * skb_dst_drop() should not dst_release() this dst | ||
| 466 | */ | ||
| 467 | static inline void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst) | ||
| 468 | { | ||
| 469 | WARN_ON(!rcu_read_lock_held() && !rcu_read_lock_bh_held()); | ||
| 470 | skb->_skb_refdst = (unsigned long)dst | SKB_DST_NOREF; | ||
| 471 | } | ||
| 472 | |||
| 473 | /** | ||
| 474 | * skb_dst_is_noref - Test if skb dst isnt refcounted | ||
| 475 | * @skb: buffer | ||
| 476 | */ | ||
| 477 | static inline bool skb_dst_is_noref(const struct sk_buff *skb) | ||
| 478 | { | ||
| 479 | return (skb->_skb_refdst & SKB_DST_NOREF) && skb_dst(skb); | ||
| 428 | } | 480 | } |
| 429 | 481 | ||
| 430 | static inline struct rtable *skb_rtable(const struct sk_buff *skb) | 482 | static inline struct rtable *skb_rtable(const struct sk_buff *skb) |
| @@ -473,11 +525,6 @@ extern int skb_cow_data(struct sk_buff *skb, int tailbits, | |||
| 473 | struct sk_buff **trailer); | 525 | struct sk_buff **trailer); |
| 474 | extern int skb_pad(struct sk_buff *skb, int pad); | 526 | extern int skb_pad(struct sk_buff *skb, int pad); |
| 475 | #define dev_kfree_skb(a) consume_skb(a) | 527 | #define dev_kfree_skb(a) consume_skb(a) |
| 476 | #define dev_consume_skb(a) kfree_skb_clean(a) | ||
| 477 | extern void skb_over_panic(struct sk_buff *skb, int len, | ||
| 478 | void *here); | ||
| 479 | extern void skb_under_panic(struct sk_buff *skb, int len, | ||
| 480 | void *here); | ||
| 481 | 528 | ||
| 482 | extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, | 529 | extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, |
| 483 | int getfrag(void *from, char *to, int offset, | 530 | int getfrag(void *from, char *to, int offset, |
| @@ -1136,6 +1183,11 @@ static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len) | |||
| 1136 | return skb->data += len; | 1183 | return skb->data += len; |
| 1137 | } | 1184 | } |
| 1138 | 1185 | ||
| 1186 | static inline unsigned char *skb_pull_inline(struct sk_buff *skb, unsigned int len) | ||
| 1187 | { | ||
| 1188 | return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len); | ||
| 1189 | } | ||
| 1190 | |||
| 1139 | extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); | 1191 | extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); |
| 1140 | 1192 | ||
| 1141 | static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) | 1193 | static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) |
| @@ -1359,9 +1411,12 @@ static inline int skb_network_offset(const struct sk_buff *skb) | |||
| 1359 | * | 1411 | * |
| 1360 | * Various parts of the networking layer expect at least 32 bytes of | 1412 | * Various parts of the networking layer expect at least 32 bytes of |
| 1361 | * headroom, you should not reduce this. | 1413 | * headroom, you should not reduce this. |
| 1414 | * With RPS, we raised NET_SKB_PAD to 64 so that get_rps_cpus() fetches span | ||
| 1415 | * a 64 bytes aligned block to fit modern (>= 64 bytes) cache line sizes | ||
| 1416 | * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) | ||
| 1362 | */ | 1417 | */ |
| 1363 | #ifndef NET_SKB_PAD | 1418 | #ifndef NET_SKB_PAD |
| 1364 | #define NET_SKB_PAD 32 | 1419 | #define NET_SKB_PAD 64 |
| 1365 | #endif | 1420 | #endif |
| 1366 | 1421 | ||
| 1367 | extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); | 1422 | extern int ___pskb_trim(struct sk_buff *skb, unsigned int len); |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 488446289cab..49d1247cd6d9 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -106,6 +106,7 @@ int kmem_cache_shrink(struct kmem_cache *); | |||
| 106 | void kmem_cache_free(struct kmem_cache *, void *); | 106 | void kmem_cache_free(struct kmem_cache *, void *); |
| 107 | unsigned int kmem_cache_size(struct kmem_cache *); | 107 | unsigned int kmem_cache_size(struct kmem_cache *); |
| 108 | const char *kmem_cache_name(struct kmem_cache *); | 108 | const char *kmem_cache_name(struct kmem_cache *); |
| 109 | int kern_ptr_validate(const void *ptr, unsigned long size); | ||
| 109 | int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); | 110 | int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); |
| 110 | 111 | ||
| 111 | /* | 112 | /* |
diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h index 8a060a7040d8..bb947dd1fba9 100644 --- a/include/linux/smb_fs_sb.h +++ b/include/linux/smb_fs_sb.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #define _SMB_FS_SB | 10 | #define _SMB_FS_SB |
| 11 | 11 | ||
| 12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| 13 | #include <linux/backing-dev.h> | ||
| 13 | #include <linux/smb.h> | 14 | #include <linux/smb.h> |
| 14 | 15 | ||
| 15 | /* | 16 | /* |
| @@ -74,6 +75,8 @@ struct smb_sb_info { | |||
| 74 | struct smb_ops *ops; | 75 | struct smb_ops *ops; |
| 75 | 76 | ||
| 76 | struct super_block *super_block; | 77 | struct super_block *super_block; |
| 78 | |||
| 79 | struct backing_dev_info bdi; | ||
| 77 | }; | 80 | }; |
| 78 | 81 | ||
| 79 | static inline int | 82 | static inline int |
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index e28f5a0182e8..52797714ade7 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
| @@ -100,6 +100,7 @@ enum | |||
| 100 | ICMP6_MIB_INMSGS, /* InMsgs */ | 100 | ICMP6_MIB_INMSGS, /* InMsgs */ |
| 101 | ICMP6_MIB_INERRORS, /* InErrors */ | 101 | ICMP6_MIB_INERRORS, /* InErrors */ |
| 102 | ICMP6_MIB_OUTMSGS, /* OutMsgs */ | 102 | ICMP6_MIB_OUTMSGS, /* OutMsgs */ |
| 103 | ICMP6_MIB_OUTERRORS, /* OutErrors */ | ||
| 103 | __ICMP6_MIB_MAX | 104 | __ICMP6_MIB_MAX |
| 104 | }; | 105 | }; |
| 105 | 106 | ||
| @@ -225,6 +226,9 @@ enum | |||
| 225 | LINUX_MIB_SACKSHIFTED, | 226 | LINUX_MIB_SACKSHIFTED, |
| 226 | LINUX_MIB_SACKMERGED, | 227 | LINUX_MIB_SACKMERGED, |
| 227 | LINUX_MIB_SACKSHIFTFALLBACK, | 228 | LINUX_MIB_SACKSHIFTFALLBACK, |
| 229 | LINUX_MIB_TCPBACKLOGDROP, | ||
| 230 | LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */ | ||
| 231 | LINUX_MIB_TCPDEFERACCEPTDROP, | ||
| 228 | __LINUX_MIB_MAX | 232 | __LINUX_MIB_MAX |
| 229 | }; | 233 | }; |
| 230 | 234 | ||
diff --git a/include/linux/socket.h b/include/linux/socket.h index 7b3aae2052a6..032a19eb61b1 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
| @@ -189,7 +189,8 @@ struct ucred { | |||
| 189 | #define AF_ISDN 34 /* mISDN sockets */ | 189 | #define AF_ISDN 34 /* mISDN sockets */ |
| 190 | #define AF_PHONET 35 /* Phonet sockets */ | 190 | #define AF_PHONET 35 /* Phonet sockets */ |
| 191 | #define AF_IEEE802154 36 /* IEEE802154 sockets */ | 191 | #define AF_IEEE802154 36 /* IEEE802154 sockets */ |
| 192 | #define AF_MAX 37 /* For now.. */ | 192 | #define AF_CAIF 37 /* CAIF sockets */ |
| 193 | #define AF_MAX 38 /* For now.. */ | ||
| 193 | 194 | ||
| 194 | /* Protocol families, same as address families. */ | 195 | /* Protocol families, same as address families. */ |
| 195 | #define PF_UNSPEC AF_UNSPEC | 196 | #define PF_UNSPEC AF_UNSPEC |
| @@ -229,6 +230,7 @@ struct ucred { | |||
| 229 | #define PF_ISDN AF_ISDN | 230 | #define PF_ISDN AF_ISDN |
| 230 | #define PF_PHONET AF_PHONET | 231 | #define PF_PHONET AF_PHONET |
| 231 | #define PF_IEEE802154 AF_IEEE802154 | 232 | #define PF_IEEE802154 AF_IEEE802154 |
| 233 | #define PF_CAIF AF_CAIF | ||
| 232 | #define PF_MAX AF_MAX | 234 | #define PF_MAX AF_MAX |
| 233 | 235 | ||
| 234 | /* Maximum queue length specifiable by listen. */ | 236 | /* Maximum queue length specifiable by listen. */ |
| @@ -255,6 +257,7 @@ struct ucred { | |||
| 255 | #define MSG_ERRQUEUE 0x2000 /* Fetch message from error queue */ | 257 | #define MSG_ERRQUEUE 0x2000 /* Fetch message from error queue */ |
| 256 | #define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */ | 258 | #define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */ |
| 257 | #define MSG_MORE 0x8000 /* Sender will send more */ | 259 | #define MSG_MORE 0x8000 /* Sender will send more */ |
| 260 | #define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */ | ||
| 258 | 261 | ||
| 259 | #define MSG_EOF MSG_FIN | 262 | #define MSG_EOF MSG_FIN |
| 260 | 263 | ||
| @@ -300,6 +303,7 @@ struct ucred { | |||
| 300 | #define SOL_PNPIPE 275 | 303 | #define SOL_PNPIPE 275 |
| 301 | #define SOL_RDS 276 | 304 | #define SOL_RDS 276 |
| 302 | #define SOL_IUCV 277 | 305 | #define SOL_IUCV 277 |
| 306 | #define SOL_CAIF 278 | ||
| 303 | 307 | ||
| 304 | /* IPX options */ | 308 | /* IPX options */ |
| 305 | #define IPX_TYPE 1 | 309 | #define IPX_TYPE 1 |
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index 51948eb6927a..b4ae570d3c98 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
| @@ -12,7 +12,7 @@ enum ads7846_filter { | |||
| 12 | }; | 12 | }; |
| 13 | 13 | ||
| 14 | struct ads7846_platform_data { | 14 | struct ads7846_platform_data { |
| 15 | u16 model; /* 7843, 7845, 7846. */ | 15 | u16 model; /* 7843, 7845, 7846, 7873. */ |
| 16 | u16 vref_delay_usecs; /* 0 for external vref; etc */ | 16 | u16 vref_delay_usecs; /* 0 for external vref; etc */ |
| 17 | u16 vref_mv; /* external vref value, milliVolts */ | 17 | u16 vref_mv; /* external vref value, milliVolts */ |
| 18 | bool keep_vref_on; /* set to keep vref on for differential | 18 | bool keep_vref_on; /* set to keep vref on for differential |
| @@ -53,5 +53,6 @@ struct ads7846_platform_data { | |||
| 53 | int (*filter) (void *filter_data, int data_idx, int *val); | 53 | int (*filter) (void *filter_data, int data_idx, int *val); |
| 54 | void (*filter_cleanup)(void *filter_data); | 54 | void (*filter_cleanup)(void *filter_data); |
| 55 | void (*wait_for_sync)(void); | 55 | void (*wait_for_sync)(void); |
| 56 | bool wakeup; | ||
| 56 | }; | 57 | }; |
| 57 | 58 | ||
diff --git a/include/linux/spi/l4f00242t03.h b/include/linux/spi/l4f00242t03.h new file mode 100644 index 000000000000..aee1dbda4edc --- /dev/null +++ b/include/linux/spi/l4f00242t03.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* | ||
| 2 | * l4f00242t03.h -- Platform glue for Epson L4F00242T03 LCD | ||
| 3 | * | ||
| 4 | * Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com> | ||
| 5 | * Based on Marek Vasut work in lms283gf05.h | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef _INCLUDE_LINUX_SPI_L4F00242T03_H_ | ||
| 22 | #define _INCLUDE_LINUX_SPI_L4F00242T03_H_ | ||
| 23 | |||
| 24 | struct l4f00242t03_pdata { | ||
| 25 | unsigned int reset_gpio; | ||
| 26 | unsigned int data_enable_gpio; | ||
| 27 | const char *io_supply; /* will be set to 1.8 V */ | ||
| 28 | const char *core_supply; /* will be set to 2.8 V */ | ||
| 29 | }; | ||
| 30 | |||
| 31 | #endif /* _INCLUDE_LINUX_SPI_L4F00242T03_H_ */ | ||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 97b60b37f445..af56071b06f9 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | #include <linux/device.h> | 22 | #include <linux/device.h> |
| 23 | #include <linux/mod_devicetable.h> | 23 | #include <linux/mod_devicetable.h> |
| 24 | #include <linux/slab.h> | ||
| 24 | 25 | ||
| 25 | /* | 26 | /* |
| 26 | * INTERFACES between SPI master-side drivers and SPI infrastructure. | 27 | * INTERFACES between SPI master-side drivers and SPI infrastructure. |
diff --git a/include/linux/spi/wl12xx.h b/include/linux/spi/wl12xx.h index aed64ed3dc8a..a223ecbc71ef 100644 --- a/include/linux/spi/wl12xx.h +++ b/include/linux/spi/wl12xx.h | |||
| @@ -26,6 +26,8 @@ | |||
| 26 | 26 | ||
| 27 | struct wl12xx_platform_data { | 27 | struct wl12xx_platform_data { |
| 28 | void (*set_power)(bool enable); | 28 | void (*set_power)(bool enable); |
| 29 | /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ | ||
| 30 | int irq; | ||
| 29 | bool use_eeprom; | 31 | bool use_eeprom; |
| 30 | }; | 32 | }; |
| 31 | 33 | ||
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 86088213334a..89fac6a3f78b 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
| @@ -128,19 +128,21 @@ static inline void smp_mb__after_lock(void) { smp_mb(); } | |||
| 128 | #define raw_spin_unlock_wait(lock) arch_spin_unlock_wait(&(lock)->raw_lock) | 128 | #define raw_spin_unlock_wait(lock) arch_spin_unlock_wait(&(lock)->raw_lock) |
| 129 | 129 | ||
| 130 | #ifdef CONFIG_DEBUG_SPINLOCK | 130 | #ifdef CONFIG_DEBUG_SPINLOCK |
| 131 | extern void do_raw_spin_lock(raw_spinlock_t *lock); | 131 | extern void do_raw_spin_lock(raw_spinlock_t *lock) __acquires(lock); |
| 132 | #define do_raw_spin_lock_flags(lock, flags) do_raw_spin_lock(lock) | 132 | #define do_raw_spin_lock_flags(lock, flags) do_raw_spin_lock(lock) |
| 133 | extern int do_raw_spin_trylock(raw_spinlock_t *lock); | 133 | extern int do_raw_spin_trylock(raw_spinlock_t *lock); |
| 134 | extern void do_raw_spin_unlock(raw_spinlock_t *lock); | 134 | extern void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock); |
| 135 | #else | 135 | #else |
| 136 | static inline void do_raw_spin_lock(raw_spinlock_t *lock) | 136 | static inline void do_raw_spin_lock(raw_spinlock_t *lock) __acquires(lock) |
| 137 | { | 137 | { |
| 138 | __acquire(lock); | ||
| 138 | arch_spin_lock(&lock->raw_lock); | 139 | arch_spin_lock(&lock->raw_lock); |
| 139 | } | 140 | } |
| 140 | 141 | ||
| 141 | static inline void | 142 | static inline void |
| 142 | do_raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long *flags) | 143 | do_raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long *flags) __acquires(lock) |
| 143 | { | 144 | { |
| 145 | __acquire(lock); | ||
| 144 | arch_spin_lock_flags(&lock->raw_lock, *flags); | 146 | arch_spin_lock_flags(&lock->raw_lock, *flags); |
| 145 | } | 147 | } |
| 146 | 148 | ||
| @@ -149,9 +151,10 @@ static inline int do_raw_spin_trylock(raw_spinlock_t *lock) | |||
| 149 | return arch_spin_trylock(&(lock)->raw_lock); | 151 | return arch_spin_trylock(&(lock)->raw_lock); |
| 150 | } | 152 | } |
| 151 | 153 | ||
| 152 | static inline void do_raw_spin_unlock(raw_spinlock_t *lock) | 154 | static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) |
| 153 | { | 155 | { |
| 154 | arch_spin_unlock(&lock->raw_lock); | 156 | arch_spin_unlock(&lock->raw_lock); |
| 157 | __release(lock); | ||
| 155 | } | 158 | } |
| 156 | #endif | 159 | #endif |
| 157 | 160 | ||
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 4d5ecb222af9..4d5d2f546dbf 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
| @@ -27,6 +27,8 @@ | |||
| 27 | #ifndef _LINUX_SRCU_H | 27 | #ifndef _LINUX_SRCU_H |
| 28 | #define _LINUX_SRCU_H | 28 | #define _LINUX_SRCU_H |
| 29 | 29 | ||
| 30 | #include <linux/mutex.h> | ||
| 31 | |||
| 30 | struct srcu_struct_array { | 32 | struct srcu_struct_array { |
| 31 | int c[2]; | 33 | int c[2]; |
| 32 | }; | 34 | }; |
| @@ -84,8 +86,8 @@ long srcu_batches_completed(struct srcu_struct *sp); | |||
| 84 | /** | 86 | /** |
| 85 | * srcu_read_lock_held - might we be in SRCU read-side critical section? | 87 | * srcu_read_lock_held - might we be in SRCU read-side critical section? |
| 86 | * | 88 | * |
| 87 | * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in | 89 | * If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an SRCU |
| 88 | * an SRCU read-side critical section. In absence of CONFIG_PROVE_LOCKING, | 90 | * read-side critical section. In absence of CONFIG_DEBUG_LOCK_ALLOC, |
| 89 | * this assumes we are in an SRCU read-side critical section unless it can | 91 | * this assumes we are in an SRCU read-side critical section unless it can |
| 90 | * prove otherwise. | 92 | * prove otherwise. |
| 91 | */ | 93 | */ |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 24f988547361..a2608bff9c78 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
| @@ -305,6 +305,7 @@ struct ssb_bus { | |||
| 305 | /* ID information about the Chip. */ | 305 | /* ID information about the Chip. */ |
| 306 | u16 chip_id; | 306 | u16 chip_id; |
| 307 | u16 chip_rev; | 307 | u16 chip_rev; |
| 308 | u16 sprom_offset; | ||
| 308 | u16 sprom_size; /* number of words in sprom */ | 309 | u16 sprom_size; /* number of words in sprom */ |
| 309 | u8 chip_package; | 310 | u8 chip_package; |
| 310 | 311 | ||
| @@ -394,6 +395,9 @@ extern int ssb_bus_sdiobus_register(struct ssb_bus *bus, | |||
| 394 | 395 | ||
| 395 | extern void ssb_bus_unregister(struct ssb_bus *bus); | 396 | extern void ssb_bus_unregister(struct ssb_bus *bus); |
| 396 | 397 | ||
| 398 | /* Does the device have an SPROM? */ | ||
| 399 | extern bool ssb_is_sprom_available(struct ssb_bus *bus); | ||
| 400 | |||
| 397 | /* Set a fallback SPROM. | 401 | /* Set a fallback SPROM. |
| 398 | * See kdoc at the function definition for complete documentation. */ | 402 | * See kdoc at the function definition for complete documentation. */ |
| 399 | extern int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom); | 403 | extern int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom); |
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h index 4e27acf0a92f..2cdf249b4e5f 100644 --- a/include/linux/ssb/ssb_driver_chipcommon.h +++ b/include/linux/ssb/ssb_driver_chipcommon.h | |||
| @@ -53,6 +53,7 @@ | |||
| 53 | #define SSB_CHIPCO_CAP_64BIT 0x08000000 /* 64-bit Backplane */ | 53 | #define SSB_CHIPCO_CAP_64BIT 0x08000000 /* 64-bit Backplane */ |
| 54 | #define SSB_CHIPCO_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */ | 54 | #define SSB_CHIPCO_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */ |
| 55 | #define SSB_CHIPCO_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */ | 55 | #define SSB_CHIPCO_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */ |
| 56 | #define SSB_CHIPCO_CAP_SPROM 0x40000000 /* SPROM present */ | ||
| 56 | #define SSB_CHIPCO_CORECTL 0x0008 | 57 | #define SSB_CHIPCO_CORECTL 0x0008 |
| 57 | #define SSB_CHIPCO_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */ | 58 | #define SSB_CHIPCO_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */ |
| 58 | #define SSB_CHIPCO_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */ | 59 | #define SSB_CHIPCO_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */ |
| @@ -385,6 +386,7 @@ | |||
| 385 | 386 | ||
| 386 | 387 | ||
| 387 | /** Chip specific Chip-Status register contents. */ | 388 | /** Chip specific Chip-Status register contents. */ |
| 389 | #define SSB_CHIPCO_CHST_4322_SPROM_EXISTS 0x00000040 /* SPROM present */ | ||
| 388 | #define SSB_CHIPCO_CHST_4325_SPROM_OTP_SEL 0x00000003 | 390 | #define SSB_CHIPCO_CHST_4325_SPROM_OTP_SEL 0x00000003 |
| 389 | #define SSB_CHIPCO_CHST_4325_DEFCIS_SEL 0 /* OTP is powered up, use def. CIS, no SPROM */ | 391 | #define SSB_CHIPCO_CHST_4325_DEFCIS_SEL 0 /* OTP is powered up, use def. CIS, no SPROM */ |
| 390 | #define SSB_CHIPCO_CHST_4325_SPROM_SEL 1 /* OTP is powered up, SPROM is present */ | 392 | #define SSB_CHIPCO_CHST_4325_SPROM_SEL 1 /* OTP is powered up, SPROM is present */ |
| @@ -398,6 +400,18 @@ | |||
| 398 | #define SSB_CHIPCO_CHST_4325_RCAL_VALUE_SHIFT 4 | 400 | #define SSB_CHIPCO_CHST_4325_RCAL_VALUE_SHIFT 4 |
| 399 | #define SSB_CHIPCO_CHST_4325_PMUTOP_2B 0x00000200 /* 1 for 2b, 0 for to 2a */ | 401 | #define SSB_CHIPCO_CHST_4325_PMUTOP_2B 0x00000200 /* 1 for 2b, 0 for to 2a */ |
| 400 | 402 | ||
| 403 | /** Macros to determine SPROM presence based on Chip-Status register. */ | ||
| 404 | #define SSB_CHIPCO_CHST_4312_SPROM_PRESENT(status) \ | ||
| 405 | ((status & SSB_CHIPCO_CHST_4325_SPROM_OTP_SEL) != \ | ||
| 406 | SSB_CHIPCO_CHST_4325_OTP_SEL) | ||
| 407 | #define SSB_CHIPCO_CHST_4322_SPROM_PRESENT(status) \ | ||
| 408 | (status & SSB_CHIPCO_CHST_4322_SPROM_EXISTS) | ||
| 409 | #define SSB_CHIPCO_CHST_4325_SPROM_PRESENT(status) \ | ||
| 410 | (((status & SSB_CHIPCO_CHST_4325_SPROM_OTP_SEL) != \ | ||
| 411 | SSB_CHIPCO_CHST_4325_DEFCIS_SEL) && \ | ||
| 412 | ((status & SSB_CHIPCO_CHST_4325_SPROM_OTP_SEL) != \ | ||
| 413 | SSB_CHIPCO_CHST_4325_OTP_SEL)) | ||
| 414 | |||
| 401 | 415 | ||
| 402 | 416 | ||
| 403 | /** Clockcontrol masks and values **/ | 417 | /** Clockcontrol masks and values **/ |
| @@ -564,6 +578,7 @@ struct ssb_chipcommon_pmu { | |||
| 564 | struct ssb_chipcommon { | 578 | struct ssb_chipcommon { |
| 565 | struct ssb_device *dev; | 579 | struct ssb_device *dev; |
| 566 | u32 capabilities; | 580 | u32 capabilities; |
| 581 | u32 status; | ||
| 567 | /* Fast Powerup Delay constant */ | 582 | /* Fast Powerup Delay constant */ |
| 568 | u16 fast_pwrup_delay; | 583 | u16 fast_pwrup_delay; |
| 569 | struct ssb_chipcommon_pmu pmu; | 584 | struct ssb_chipcommon_pmu pmu; |
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index 9ae9082eaeb4..a6d5225b9275 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
| @@ -170,26 +170,27 @@ | |||
| 170 | #define SSB_SPROMSIZE_WORDS_R4 220 | 170 | #define SSB_SPROMSIZE_WORDS_R4 220 |
| 171 | #define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16)) | 171 | #define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16)) |
| 172 | #define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16)) | 172 | #define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16)) |
| 173 | #define SSB_SPROM_BASE 0x1000 | 173 | #define SSB_SPROM_BASE1 0x1000 |
| 174 | #define SSB_SPROM_REVISION 0x107E | 174 | #define SSB_SPROM_BASE31 0x0800 |
| 175 | #define SSB_SPROM_REVISION 0x007E | ||
| 175 | #define SSB_SPROM_REVISION_REV 0x00FF /* SPROM Revision number */ | 176 | #define SSB_SPROM_REVISION_REV 0x00FF /* SPROM Revision number */ |
| 176 | #define SSB_SPROM_REVISION_CRC 0xFF00 /* SPROM CRC8 value */ | 177 | #define SSB_SPROM_REVISION_CRC 0xFF00 /* SPROM CRC8 value */ |
| 177 | #define SSB_SPROM_REVISION_CRC_SHIFT 8 | 178 | #define SSB_SPROM_REVISION_CRC_SHIFT 8 |
| 178 | 179 | ||
| 179 | /* SPROM Revision 1 */ | 180 | /* SPROM Revision 1 */ |
| 180 | #define SSB_SPROM1_SPID 0x1004 /* Subsystem Product ID for PCI */ | 181 | #define SSB_SPROM1_SPID 0x0004 /* Subsystem Product ID for PCI */ |
| 181 | #define SSB_SPROM1_SVID 0x1006 /* Subsystem Vendor ID for PCI */ | 182 | #define SSB_SPROM1_SVID 0x0006 /* Subsystem Vendor ID for PCI */ |
| 182 | #define SSB_SPROM1_PID 0x1008 /* Product ID for PCI */ | 183 | #define SSB_SPROM1_PID 0x0008 /* Product ID for PCI */ |
| 183 | #define SSB_SPROM1_IL0MAC 0x1048 /* 6 bytes MAC address for 802.11b/g */ | 184 | #define SSB_SPROM1_IL0MAC 0x0048 /* 6 bytes MAC address for 802.11b/g */ |
| 184 | #define SSB_SPROM1_ET0MAC 0x104E /* 6 bytes MAC address for Ethernet */ | 185 | #define SSB_SPROM1_ET0MAC 0x004E /* 6 bytes MAC address for Ethernet */ |
| 185 | #define SSB_SPROM1_ET1MAC 0x1054 /* 6 bytes MAC address for 802.11a */ | 186 | #define SSB_SPROM1_ET1MAC 0x0054 /* 6 bytes MAC address for 802.11a */ |
| 186 | #define SSB_SPROM1_ETHPHY 0x105A /* Ethernet PHY settings */ | 187 | #define SSB_SPROM1_ETHPHY 0x005A /* Ethernet PHY settings */ |
| 187 | #define SSB_SPROM1_ETHPHY_ET0A 0x001F /* MII Address for enet0 */ | 188 | #define SSB_SPROM1_ETHPHY_ET0A 0x001F /* MII Address for enet0 */ |
| 188 | #define SSB_SPROM1_ETHPHY_ET1A 0x03E0 /* MII Address for enet1 */ | 189 | #define SSB_SPROM1_ETHPHY_ET1A 0x03E0 /* MII Address for enet1 */ |
| 189 | #define SSB_SPROM1_ETHPHY_ET1A_SHIFT 5 | 190 | #define SSB_SPROM1_ETHPHY_ET1A_SHIFT 5 |
| 190 | #define SSB_SPROM1_ETHPHY_ET0M (1<<14) /* MDIO for enet0 */ | 191 | #define SSB_SPROM1_ETHPHY_ET0M (1<<14) /* MDIO for enet0 */ |
| 191 | #define SSB_SPROM1_ETHPHY_ET1M (1<<15) /* MDIO for enet1 */ | 192 | #define SSB_SPROM1_ETHPHY_ET1M (1<<15) /* MDIO for enet1 */ |
| 192 | #define SSB_SPROM1_BINF 0x105C /* Board info */ | 193 | #define SSB_SPROM1_BINF 0x005C /* Board info */ |
| 193 | #define SSB_SPROM1_BINF_BREV 0x00FF /* Board Revision */ | 194 | #define SSB_SPROM1_BINF_BREV 0x00FF /* Board Revision */ |
| 194 | #define SSB_SPROM1_BINF_CCODE 0x0F00 /* Country Code */ | 195 | #define SSB_SPROM1_BINF_CCODE 0x0F00 /* Country Code */ |
| 195 | #define SSB_SPROM1_BINF_CCODE_SHIFT 8 | 196 | #define SSB_SPROM1_BINF_CCODE_SHIFT 8 |
| @@ -197,63 +198,63 @@ | |||
| 197 | #define SSB_SPROM1_BINF_ANTBG_SHIFT 12 | 198 | #define SSB_SPROM1_BINF_ANTBG_SHIFT 12 |
| 198 | #define SSB_SPROM1_BINF_ANTA 0xC000 /* Available A-PHY antennas */ | 199 | #define SSB_SPROM1_BINF_ANTA 0xC000 /* Available A-PHY antennas */ |
| 199 | #define SSB_SPROM1_BINF_ANTA_SHIFT 14 | 200 | #define SSB_SPROM1_BINF_ANTA_SHIFT 14 |
| 200 | #define SSB_SPROM1_PA0B0 0x105E | 201 | #define SSB_SPROM1_PA0B0 0x005E |
| 201 | #define SSB_SPROM1_PA0B1 0x1060 | 202 | #define SSB_SPROM1_PA0B1 0x0060 |
| 202 | #define SSB_SPROM1_PA0B2 0x1062 | 203 | #define SSB_SPROM1_PA0B2 0x0062 |
| 203 | #define SSB_SPROM1_GPIOA 0x1064 /* General Purpose IO pins 0 and 1 */ | 204 | #define SSB_SPROM1_GPIOA 0x0064 /* General Purpose IO pins 0 and 1 */ |
| 204 | #define SSB_SPROM1_GPIOA_P0 0x00FF /* Pin 0 */ | 205 | #define SSB_SPROM1_GPIOA_P0 0x00FF /* Pin 0 */ |
| 205 | #define SSB_SPROM1_GPIOA_P1 0xFF00 /* Pin 1 */ | 206 | #define SSB_SPROM1_GPIOA_P1 0xFF00 /* Pin 1 */ |
| 206 | #define SSB_SPROM1_GPIOA_P1_SHIFT 8 | 207 | #define SSB_SPROM1_GPIOA_P1_SHIFT 8 |
| 207 | #define SSB_SPROM1_GPIOB 0x1066 /* General Purpuse IO pins 2 and 3 */ | 208 | #define SSB_SPROM1_GPIOB 0x0066 /* General Purpuse IO pins 2 and 3 */ |
| 208 | #define SSB_SPROM1_GPIOB_P2 0x00FF /* Pin 2 */ | 209 | #define SSB_SPROM1_GPIOB_P2 0x00FF /* Pin 2 */ |
| 209 | #define SSB_SPROM1_GPIOB_P3 0xFF00 /* Pin 3 */ | 210 | #define SSB_SPROM1_GPIOB_P3 0xFF00 /* Pin 3 */ |
| 210 | #define SSB_SPROM1_GPIOB_P3_SHIFT 8 | 211 | #define SSB_SPROM1_GPIOB_P3_SHIFT 8 |
| 211 | #define SSB_SPROM1_MAXPWR 0x1068 /* Power Amplifier Max Power */ | 212 | #define SSB_SPROM1_MAXPWR 0x0068 /* Power Amplifier Max Power */ |
| 212 | #define SSB_SPROM1_MAXPWR_BG 0x00FF /* B-PHY and G-PHY (in dBm Q5.2) */ | 213 | #define SSB_SPROM1_MAXPWR_BG 0x00FF /* B-PHY and G-PHY (in dBm Q5.2) */ |
| 213 | #define SSB_SPROM1_MAXPWR_A 0xFF00 /* A-PHY (in dBm Q5.2) */ | 214 | #define SSB_SPROM1_MAXPWR_A 0xFF00 /* A-PHY (in dBm Q5.2) */ |
| 214 | #define SSB_SPROM1_MAXPWR_A_SHIFT 8 | 215 | #define SSB_SPROM1_MAXPWR_A_SHIFT 8 |
| 215 | #define SSB_SPROM1_PA1B0 0x106A | 216 | #define SSB_SPROM1_PA1B0 0x006A |
| 216 | #define SSB_SPROM1_PA1B1 0x106C | 217 | #define SSB_SPROM1_PA1B1 0x006C |
| 217 | #define SSB_SPROM1_PA1B2 0x106E | 218 | #define SSB_SPROM1_PA1B2 0x006E |
| 218 | #define SSB_SPROM1_ITSSI 0x1070 /* Idle TSSI Target */ | 219 | #define SSB_SPROM1_ITSSI 0x0070 /* Idle TSSI Target */ |
| 219 | #define SSB_SPROM1_ITSSI_BG 0x00FF /* B-PHY and G-PHY*/ | 220 | #define SSB_SPROM1_ITSSI_BG 0x00FF /* B-PHY and G-PHY*/ |
| 220 | #define SSB_SPROM1_ITSSI_A 0xFF00 /* A-PHY */ | 221 | #define SSB_SPROM1_ITSSI_A 0xFF00 /* A-PHY */ |
| 221 | #define SSB_SPROM1_ITSSI_A_SHIFT 8 | 222 | #define SSB_SPROM1_ITSSI_A_SHIFT 8 |
| 222 | #define SSB_SPROM1_BFLLO 0x1072 /* Boardflags (low 16 bits) */ | 223 | #define SSB_SPROM1_BFLLO 0x0072 /* Boardflags (low 16 bits) */ |
| 223 | #define SSB_SPROM1_AGAIN 0x1074 /* Antenna Gain (in dBm Q5.2) */ | 224 | #define SSB_SPROM1_AGAIN 0x0074 /* Antenna Gain (in dBm Q5.2) */ |
| 224 | #define SSB_SPROM1_AGAIN_BG 0x00FF /* B-PHY and G-PHY */ | 225 | #define SSB_SPROM1_AGAIN_BG 0x00FF /* B-PHY and G-PHY */ |
| 225 | #define SSB_SPROM1_AGAIN_BG_SHIFT 0 | 226 | #define SSB_SPROM1_AGAIN_BG_SHIFT 0 |
| 226 | #define SSB_SPROM1_AGAIN_A 0xFF00 /* A-PHY */ | 227 | #define SSB_SPROM1_AGAIN_A 0xFF00 /* A-PHY */ |
| 227 | #define SSB_SPROM1_AGAIN_A_SHIFT 8 | 228 | #define SSB_SPROM1_AGAIN_A_SHIFT 8 |
| 228 | 229 | ||
| 229 | /* SPROM Revision 2 (inherits from rev 1) */ | 230 | /* SPROM Revision 2 (inherits from rev 1) */ |
| 230 | #define SSB_SPROM2_BFLHI 0x1038 /* Boardflags (high 16 bits) */ | 231 | #define SSB_SPROM2_BFLHI 0x0038 /* Boardflags (high 16 bits) */ |
| 231 | #define SSB_SPROM2_MAXP_A 0x103A /* A-PHY Max Power */ | 232 | #define SSB_SPROM2_MAXP_A 0x003A /* A-PHY Max Power */ |
| 232 | #define SSB_SPROM2_MAXP_A_HI 0x00FF /* Max Power High */ | 233 | #define SSB_SPROM2_MAXP_A_HI 0x00FF /* Max Power High */ |
| 233 | #define SSB_SPROM2_MAXP_A_LO 0xFF00 /* Max Power Low */ | 234 | #define SSB_SPROM2_MAXP_A_LO 0xFF00 /* Max Power Low */ |
| 234 | #define SSB_SPROM2_MAXP_A_LO_SHIFT 8 | 235 | #define SSB_SPROM2_MAXP_A_LO_SHIFT 8 |
| 235 | #define SSB_SPROM2_PA1LOB0 0x103C /* A-PHY PowerAmplifier Low Settings */ | 236 | #define SSB_SPROM2_PA1LOB0 0x003C /* A-PHY PowerAmplifier Low Settings */ |
| 236 | #define SSB_SPROM2_PA1LOB1 0x103E /* A-PHY PowerAmplifier Low Settings */ | 237 | #define SSB_SPROM2_PA1LOB1 0x003E /* A-PHY PowerAmplifier Low Settings */ |
| 237 | #define SSB_SPROM2_PA1LOB2 0x1040 /* A-PHY PowerAmplifier Low Settings */ | 238 | #define SSB_SPROM2_PA1LOB2 0x0040 /* A-PHY PowerAmplifier Low Settings */ |
| 238 | #define SSB_SPROM2_PA1HIB0 0x1042 /* A-PHY PowerAmplifier High Settings */ | 239 | #define SSB_SPROM2_PA1HIB0 0x0042 /* A-PHY PowerAmplifier High Settings */ |
| 239 | #define SSB_SPROM2_PA1HIB1 0x1044 /* A-PHY PowerAmplifier High Settings */ | 240 | #define SSB_SPROM2_PA1HIB1 0x0044 /* A-PHY PowerAmplifier High Settings */ |
| 240 | #define SSB_SPROM2_PA1HIB2 0x1046 /* A-PHY PowerAmplifier High Settings */ | 241 | #define SSB_SPROM2_PA1HIB2 0x0046 /* A-PHY PowerAmplifier High Settings */ |
| 241 | #define SSB_SPROM2_OPO 0x1078 /* OFDM Power Offset from CCK Level */ | 242 | #define SSB_SPROM2_OPO 0x0078 /* OFDM Power Offset from CCK Level */ |
| 242 | #define SSB_SPROM2_OPO_VALUE 0x00FF | 243 | #define SSB_SPROM2_OPO_VALUE 0x00FF |
| 243 | #define SSB_SPROM2_OPO_UNUSED 0xFF00 | 244 | #define SSB_SPROM2_OPO_UNUSED 0xFF00 |
| 244 | #define SSB_SPROM2_CCODE 0x107C /* Two char Country Code */ | 245 | #define SSB_SPROM2_CCODE 0x007C /* Two char Country Code */ |
| 245 | 246 | ||
| 246 | /* SPROM Revision 3 (inherits most data from rev 2) */ | 247 | /* SPROM Revision 3 (inherits most data from rev 2) */ |
| 247 | #define SSB_SPROM3_IL0MAC 0x104A /* 6 bytes MAC address for 802.11b/g */ | 248 | #define SSB_SPROM3_OFDMAPO 0x002C /* A-PHY OFDM Mid Power Offset (4 bytes, BigEndian) */ |
| 248 | #define SSB_SPROM3_OFDMAPO 0x102C /* A-PHY OFDM Mid Power Offset (4 bytes, BigEndian) */ | 249 | #define SSB_SPROM3_OFDMALPO 0x0030 /* A-PHY OFDM Low Power Offset (4 bytes, BigEndian) */ |
| 249 | #define SSB_SPROM3_OFDMALPO 0x1030 /* A-PHY OFDM Low Power Offset (4 bytes, BigEndian) */ | 250 | #define SSB_SPROM3_OFDMAHPO 0x0034 /* A-PHY OFDM High Power Offset (4 bytes, BigEndian) */ |
| 250 | #define SSB_SPROM3_OFDMAHPO 0x1034 /* A-PHY OFDM High Power Offset (4 bytes, BigEndian) */ | 251 | #define SSB_SPROM3_GPIOLDC 0x0042 /* GPIO LED Powersave Duty Cycle (4 bytes, BigEndian) */ |
| 251 | #define SSB_SPROM3_GPIOLDC 0x1042 /* GPIO LED Powersave Duty Cycle (4 bytes, BigEndian) */ | ||
| 252 | #define SSB_SPROM3_GPIOLDC_OFF 0x0000FF00 /* Off Count */ | 252 | #define SSB_SPROM3_GPIOLDC_OFF 0x0000FF00 /* Off Count */ |
| 253 | #define SSB_SPROM3_GPIOLDC_OFF_SHIFT 8 | 253 | #define SSB_SPROM3_GPIOLDC_OFF_SHIFT 8 |
| 254 | #define SSB_SPROM3_GPIOLDC_ON 0x00FF0000 /* On Count */ | 254 | #define SSB_SPROM3_GPIOLDC_ON 0x00FF0000 /* On Count */ |
| 255 | #define SSB_SPROM3_GPIOLDC_ON_SHIFT 16 | 255 | #define SSB_SPROM3_GPIOLDC_ON_SHIFT 16 |
| 256 | #define SSB_SPROM3_CCKPO 0x1078 /* CCK Power Offset */ | 256 | #define SSB_SPROM3_IL0MAC 0x004A /* 6 bytes MAC address for 802.11b/g */ |
| 257 | #define SSB_SPROM3_CCKPO 0x0078 /* CCK Power Offset */ | ||
| 257 | #define SSB_SPROM3_CCKPO_1M 0x000F /* 1M Rate PO */ | 258 | #define SSB_SPROM3_CCKPO_1M 0x000F /* 1M Rate PO */ |
| 258 | #define SSB_SPROM3_CCKPO_2M 0x00F0 /* 2M Rate PO */ | 259 | #define SSB_SPROM3_CCKPO_2M 0x00F0 /* 2M Rate PO */ |
| 259 | #define SSB_SPROM3_CCKPO_2M_SHIFT 4 | 260 | #define SSB_SPROM3_CCKPO_2M_SHIFT 4 |
| @@ -264,100 +265,100 @@ | |||
| 264 | #define SSB_SPROM3_OFDMGPO 0x107A /* G-PHY OFDM Power Offset (4 bytes, BigEndian) */ | 265 | #define SSB_SPROM3_OFDMGPO 0x107A /* G-PHY OFDM Power Offset (4 bytes, BigEndian) */ |
| 265 | 266 | ||
| 266 | /* SPROM Revision 4 */ | 267 | /* SPROM Revision 4 */ |
| 267 | #define SSB_SPROM4_IL0MAC 0x104C /* 6 byte MAC address for a/b/g/n */ | 268 | #define SSB_SPROM4_BFLLO 0x0044 /* Boardflags (low 16 bits) */ |
| 268 | #define SSB_SPROM4_ETHPHY 0x105A /* Ethernet PHY settings ?? */ | 269 | #define SSB_SPROM4_BFLHI 0x0046 /* Board Flags Hi */ |
| 270 | #define SSB_SPROM4_IL0MAC 0x004C /* 6 byte MAC address for a/b/g/n */ | ||
| 271 | #define SSB_SPROM4_CCODE 0x0052 /* Country Code (2 bytes) */ | ||
| 272 | #define SSB_SPROM4_GPIOA 0x0056 /* Gen. Purpose IO # 0 and 1 */ | ||
| 273 | #define SSB_SPROM4_GPIOA_P0 0x00FF /* Pin 0 */ | ||
| 274 | #define SSB_SPROM4_GPIOA_P1 0xFF00 /* Pin 1 */ | ||
| 275 | #define SSB_SPROM4_GPIOA_P1_SHIFT 8 | ||
| 276 | #define SSB_SPROM4_GPIOB 0x0058 /* Gen. Purpose IO # 2 and 3 */ | ||
| 277 | #define SSB_SPROM4_GPIOB_P2 0x00FF /* Pin 2 */ | ||
| 278 | #define SSB_SPROM4_GPIOB_P3 0xFF00 /* Pin 3 */ | ||
| 279 | #define SSB_SPROM4_GPIOB_P3_SHIFT 8 | ||
| 280 | #define SSB_SPROM4_ETHPHY 0x005A /* Ethernet PHY settings ?? */ | ||
| 269 | #define SSB_SPROM4_ETHPHY_ET0A 0x001F /* MII Address for enet0 */ | 281 | #define SSB_SPROM4_ETHPHY_ET0A 0x001F /* MII Address for enet0 */ |
| 270 | #define SSB_SPROM4_ETHPHY_ET1A 0x03E0 /* MII Address for enet1 */ | 282 | #define SSB_SPROM4_ETHPHY_ET1A 0x03E0 /* MII Address for enet1 */ |
| 271 | #define SSB_SPROM4_ETHPHY_ET1A_SHIFT 5 | 283 | #define SSB_SPROM4_ETHPHY_ET1A_SHIFT 5 |
| 272 | #define SSB_SPROM4_ETHPHY_ET0M (1<<14) /* MDIO for enet0 */ | 284 | #define SSB_SPROM4_ETHPHY_ET0M (1<<14) /* MDIO for enet0 */ |
| 273 | #define SSB_SPROM4_ETHPHY_ET1M (1<<15) /* MDIO for enet1 */ | 285 | #define SSB_SPROM4_ETHPHY_ET1M (1<<15) /* MDIO for enet1 */ |
| 274 | #define SSB_SPROM4_CCODE 0x1052 /* Country Code (2 bytes) */ | 286 | #define SSB_SPROM4_ANTAVAIL 0x005D /* Antenna available bitfields */ |
| 275 | #define SSB_SPROM4_ANTAVAIL 0x105D /* Antenna available bitfields */ | 287 | #define SSB_SPROM4_ANTAVAIL_A 0x00FF /* A-PHY bitfield */ |
| 276 | #define SSB_SPROM4_ANTAVAIL_A 0x00FF /* A-PHY bitfield */ | 288 | #define SSB_SPROM4_ANTAVAIL_A_SHIFT 0 |
| 277 | #define SSB_SPROM4_ANTAVAIL_A_SHIFT 0 | 289 | #define SSB_SPROM4_ANTAVAIL_BG 0xFF00 /* B-PHY and G-PHY bitfield */ |
| 278 | #define SSB_SPROM4_ANTAVAIL_BG 0xFF00 /* B-PHY and G-PHY bitfield */ | 290 | #define SSB_SPROM4_ANTAVAIL_BG_SHIFT 8 |
| 279 | #define SSB_SPROM4_ANTAVAIL_BG_SHIFT 8 | 291 | #define SSB_SPROM4_AGAIN01 0x005E /* Antenna Gain (in dBm Q5.2) */ |
| 280 | #define SSB_SPROM4_BFLLO 0x1044 /* Boardflags (low 16 bits) */ | ||
| 281 | #define SSB_SPROM4_AGAIN01 0x105E /* Antenna Gain (in dBm Q5.2) */ | ||
| 282 | #define SSB_SPROM4_AGAIN0 0x00FF /* Antenna 0 */ | 292 | #define SSB_SPROM4_AGAIN0 0x00FF /* Antenna 0 */ |
| 283 | #define SSB_SPROM4_AGAIN0_SHIFT 0 | 293 | #define SSB_SPROM4_AGAIN0_SHIFT 0 |
| 284 | #define SSB_SPROM4_AGAIN1 0xFF00 /* Antenna 1 */ | 294 | #define SSB_SPROM4_AGAIN1 0xFF00 /* Antenna 1 */ |
| 285 | #define SSB_SPROM4_AGAIN1_SHIFT 8 | 295 | #define SSB_SPROM4_AGAIN1_SHIFT 8 |
| 286 | #define SSB_SPROM4_AGAIN23 0x1060 | 296 | #define SSB_SPROM4_AGAIN23 0x0060 |
| 287 | #define SSB_SPROM4_AGAIN2 0x00FF /* Antenna 2 */ | 297 | #define SSB_SPROM4_AGAIN2 0x00FF /* Antenna 2 */ |
| 288 | #define SSB_SPROM4_AGAIN2_SHIFT 0 | 298 | #define SSB_SPROM4_AGAIN2_SHIFT 0 |
| 289 | #define SSB_SPROM4_AGAIN3 0xFF00 /* Antenna 3 */ | 299 | #define SSB_SPROM4_AGAIN3 0xFF00 /* Antenna 3 */ |
| 290 | #define SSB_SPROM4_AGAIN3_SHIFT 8 | 300 | #define SSB_SPROM4_AGAIN3_SHIFT 8 |
| 291 | #define SSB_SPROM4_BFLHI 0x1046 /* Board Flags Hi */ | 301 | #define SSB_SPROM4_MAXP_BG 0x0080 /* Max Power BG in path 1 */ |
| 292 | #define SSB_SPROM4_MAXP_BG 0x1080 /* Max Power BG in path 1 */ | ||
| 293 | #define SSB_SPROM4_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ | 302 | #define SSB_SPROM4_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ |
| 294 | #define SSB_SPROM4_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ | 303 | #define SSB_SPROM4_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ |
| 295 | #define SSB_SPROM4_ITSSI_BG_SHIFT 8 | 304 | #define SSB_SPROM4_ITSSI_BG_SHIFT 8 |
| 296 | #define SSB_SPROM4_MAXP_A 0x108A /* Max Power A in path 1 */ | 305 | #define SSB_SPROM4_MAXP_A 0x008A /* Max Power A in path 1 */ |
| 297 | #define SSB_SPROM4_MAXP_A_MASK 0x00FF /* Mask for Max Power A */ | 306 | #define SSB_SPROM4_MAXP_A_MASK 0x00FF /* Mask for Max Power A */ |
| 298 | #define SSB_SPROM4_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */ | 307 | #define SSB_SPROM4_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */ |
| 299 | #define SSB_SPROM4_ITSSI_A_SHIFT 8 | 308 | #define SSB_SPROM4_ITSSI_A_SHIFT 8 |
| 300 | #define SSB_SPROM4_GPIOA 0x1056 /* Gen. Purpose IO # 0 and 1 */ | 309 | #define SSB_SPROM4_PA0B0 0x0082 /* The paXbY locations are */ |
| 301 | #define SSB_SPROM4_GPIOA_P0 0x00FF /* Pin 0 */ | 310 | #define SSB_SPROM4_PA0B1 0x0084 /* only guesses */ |
| 302 | #define SSB_SPROM4_GPIOA_P1 0xFF00 /* Pin 1 */ | 311 | #define SSB_SPROM4_PA0B2 0x0086 |
| 303 | #define SSB_SPROM4_GPIOA_P1_SHIFT 8 | 312 | #define SSB_SPROM4_PA1B0 0x008E |
| 304 | #define SSB_SPROM4_GPIOB 0x1058 /* Gen. Purpose IO # 2 and 3 */ | 313 | #define SSB_SPROM4_PA1B1 0x0090 |
| 305 | #define SSB_SPROM4_GPIOB_P2 0x00FF /* Pin 2 */ | 314 | #define SSB_SPROM4_PA1B2 0x0092 |
| 306 | #define SSB_SPROM4_GPIOB_P3 0xFF00 /* Pin 3 */ | ||
| 307 | #define SSB_SPROM4_GPIOB_P3_SHIFT 8 | ||
| 308 | #define SSB_SPROM4_PA0B0 0x1082 /* The paXbY locations are */ | ||
| 309 | #define SSB_SPROM4_PA0B1 0x1084 /* only guesses */ | ||
| 310 | #define SSB_SPROM4_PA0B2 0x1086 | ||
| 311 | #define SSB_SPROM4_PA1B0 0x108E | ||
| 312 | #define SSB_SPROM4_PA1B1 0x1090 | ||
| 313 | #define SSB_SPROM4_PA1B2 0x1092 | ||
| 314 | 315 | ||
| 315 | /* SPROM Revision 5 (inherits most data from rev 4) */ | 316 | /* SPROM Revision 5 (inherits most data from rev 4) */ |
| 316 | #define SSB_SPROM5_BFLLO 0x104A /* Boardflags (low 16 bits) */ | 317 | #define SSB_SPROM5_CCODE 0x0044 /* Country Code (2 bytes) */ |
| 317 | #define SSB_SPROM5_BFLHI 0x104C /* Board Flags Hi */ | 318 | #define SSB_SPROM5_BFLLO 0x004A /* Boardflags (low 16 bits) */ |
| 318 | #define SSB_SPROM5_IL0MAC 0x1052 /* 6 byte MAC address for a/b/g/n */ | 319 | #define SSB_SPROM5_BFLHI 0x004C /* Board Flags Hi */ |
| 319 | #define SSB_SPROM5_CCODE 0x1044 /* Country Code (2 bytes) */ | 320 | #define SSB_SPROM5_IL0MAC 0x0052 /* 6 byte MAC address for a/b/g/n */ |
| 320 | #define SSB_SPROM5_GPIOA 0x1076 /* Gen. Purpose IO # 0 and 1 */ | 321 | #define SSB_SPROM5_GPIOA 0x0076 /* Gen. Purpose IO # 0 and 1 */ |
| 321 | #define SSB_SPROM5_GPIOA_P0 0x00FF /* Pin 0 */ | 322 | #define SSB_SPROM5_GPIOA_P0 0x00FF /* Pin 0 */ |
| 322 | #define SSB_SPROM5_GPIOA_P1 0xFF00 /* Pin 1 */ | 323 | #define SSB_SPROM5_GPIOA_P1 0xFF00 /* Pin 1 */ |
| 323 | #define SSB_SPROM5_GPIOA_P1_SHIFT 8 | 324 | #define SSB_SPROM5_GPIOA_P1_SHIFT 8 |
| 324 | #define SSB_SPROM5_GPIOB 0x1078 /* Gen. Purpose IO # 2 and 3 */ | 325 | #define SSB_SPROM5_GPIOB 0x0078 /* Gen. Purpose IO # 2 and 3 */ |
| 325 | #define SSB_SPROM5_GPIOB_P2 0x00FF /* Pin 2 */ | 326 | #define SSB_SPROM5_GPIOB_P2 0x00FF /* Pin 2 */ |
| 326 | #define SSB_SPROM5_GPIOB_P3 0xFF00 /* Pin 3 */ | 327 | #define SSB_SPROM5_GPIOB_P3 0xFF00 /* Pin 3 */ |
| 327 | #define SSB_SPROM5_GPIOB_P3_SHIFT 8 | 328 | #define SSB_SPROM5_GPIOB_P3_SHIFT 8 |
| 328 | 329 | ||
| 329 | /* SPROM Revision 8 */ | 330 | /* SPROM Revision 8 */ |
| 330 | #define SSB_SPROM8_BOARDREV 0x1082 /* Board revision */ | 331 | #define SSB_SPROM8_BOARDREV 0x0082 /* Board revision */ |
| 331 | #define SSB_SPROM8_BFLLO 0x1084 /* Board flags (bits 0-15) */ | 332 | #define SSB_SPROM8_BFLLO 0x0084 /* Board flags (bits 0-15) */ |
| 332 | #define SSB_SPROM8_BFLHI 0x1086 /* Board flags (bits 16-31) */ | 333 | #define SSB_SPROM8_BFLHI 0x0086 /* Board flags (bits 16-31) */ |
| 333 | #define SSB_SPROM8_BFL2LO 0x1088 /* Board flags (bits 32-47) */ | 334 | #define SSB_SPROM8_BFL2LO 0x0088 /* Board flags (bits 32-47) */ |
| 334 | #define SSB_SPROM8_BFL2HI 0x108A /* Board flags (bits 48-63) */ | 335 | #define SSB_SPROM8_BFL2HI 0x008A /* Board flags (bits 48-63) */ |
| 335 | #define SSB_SPROM8_IL0MAC 0x108C /* 6 byte MAC address */ | 336 | #define SSB_SPROM8_IL0MAC 0x008C /* 6 byte MAC address */ |
| 336 | #define SSB_SPROM8_CCODE 0x1092 /* 2 byte country code */ | 337 | #define SSB_SPROM8_CCODE 0x0092 /* 2 byte country code */ |
| 337 | #define SSB_SPROM8_ANTAVAIL 0x109C /* Antenna available bitfields*/ | 338 | #define SSB_SPROM8_GPIOA 0x0096 /*Gen. Purpose IO # 0 and 1 */ |
| 338 | #define SSB_SPROM8_ANTAVAIL_A 0xFF00 /* A-PHY bitfield */ | 339 | #define SSB_SPROM8_GPIOA_P0 0x00FF /* Pin 0 */ |
| 339 | #define SSB_SPROM8_ANTAVAIL_A_SHIFT 8 | 340 | #define SSB_SPROM8_GPIOA_P1 0xFF00 /* Pin 1 */ |
| 340 | #define SSB_SPROM8_ANTAVAIL_BG 0x00FF /* B-PHY and G-PHY bitfield */ | 341 | #define SSB_SPROM8_GPIOA_P1_SHIFT 8 |
| 341 | #define SSB_SPROM8_ANTAVAIL_BG_SHIFT 0 | 342 | #define SSB_SPROM8_GPIOB 0x0098 /* Gen. Purpose IO # 2 and 3 */ |
| 342 | #define SSB_SPROM8_AGAIN01 0x109E /* Antenna Gain (in dBm Q5.2) */ | 343 | #define SSB_SPROM8_GPIOB_P2 0x00FF /* Pin 2 */ |
| 344 | #define SSB_SPROM8_GPIOB_P3 0xFF00 /* Pin 3 */ | ||
| 345 | #define SSB_SPROM8_GPIOB_P3_SHIFT 8 | ||
| 346 | #define SSB_SPROM8_ANTAVAIL 0x009C /* Antenna available bitfields*/ | ||
| 347 | #define SSB_SPROM8_ANTAVAIL_A 0xFF00 /* A-PHY bitfield */ | ||
| 348 | #define SSB_SPROM8_ANTAVAIL_A_SHIFT 8 | ||
| 349 | #define SSB_SPROM8_ANTAVAIL_BG 0x00FF /* B-PHY and G-PHY bitfield */ | ||
| 350 | #define SSB_SPROM8_ANTAVAIL_BG_SHIFT 0 | ||
| 351 | #define SSB_SPROM8_AGAIN01 0x009E /* Antenna Gain (in dBm Q5.2) */ | ||
| 343 | #define SSB_SPROM8_AGAIN0 0x00FF /* Antenna 0 */ | 352 | #define SSB_SPROM8_AGAIN0 0x00FF /* Antenna 0 */ |
| 344 | #define SSB_SPROM8_AGAIN0_SHIFT 0 | 353 | #define SSB_SPROM8_AGAIN0_SHIFT 0 |
| 345 | #define SSB_SPROM8_AGAIN1 0xFF00 /* Antenna 1 */ | 354 | #define SSB_SPROM8_AGAIN1 0xFF00 /* Antenna 1 */ |
| 346 | #define SSB_SPROM8_AGAIN1_SHIFT 8 | 355 | #define SSB_SPROM8_AGAIN1_SHIFT 8 |
| 347 | #define SSB_SPROM8_AGAIN23 0x10A0 | 356 | #define SSB_SPROM8_AGAIN23 0x00A0 |
| 348 | #define SSB_SPROM8_AGAIN2 0x00FF /* Antenna 2 */ | 357 | #define SSB_SPROM8_AGAIN2 0x00FF /* Antenna 2 */ |
| 349 | #define SSB_SPROM8_AGAIN2_SHIFT 0 | 358 | #define SSB_SPROM8_AGAIN2_SHIFT 0 |
| 350 | #define SSB_SPROM8_AGAIN3 0xFF00 /* Antenna 3 */ | 359 | #define SSB_SPROM8_AGAIN3 0xFF00 /* Antenna 3 */ |
| 351 | #define SSB_SPROM8_AGAIN3_SHIFT 8 | 360 | #define SSB_SPROM8_AGAIN3_SHIFT 8 |
| 352 | #define SSB_SPROM8_GPIOA 0x1096 /*Gen. Purpose IO # 0 and 1 */ | 361 | #define SSB_SPROM8_RSSIPARM2G 0x00A4 /* RSSI params for 2GHz */ |
| 353 | #define SSB_SPROM8_GPIOA_P0 0x00FF /* Pin 0 */ | ||
| 354 | #define SSB_SPROM8_GPIOA_P1 0xFF00 /* Pin 1 */ | ||
| 355 | #define SSB_SPROM8_GPIOA_P1_SHIFT 8 | ||
| 356 | #define SSB_SPROM8_GPIOB 0x1098 /* Gen. Purpose IO # 2 and 3 */ | ||
| 357 | #define SSB_SPROM8_GPIOB_P2 0x00FF /* Pin 2 */ | ||
| 358 | #define SSB_SPROM8_GPIOB_P3 0xFF00 /* Pin 3 */ | ||
| 359 | #define SSB_SPROM8_GPIOB_P3_SHIFT 8 | ||
| 360 | #define SSB_SPROM8_RSSIPARM2G 0x10A4 /* RSSI params for 2GHz */ | ||
| 361 | #define SSB_SPROM8_RSSISMF2G 0x000F | 362 | #define SSB_SPROM8_RSSISMF2G 0x000F |
| 362 | #define SSB_SPROM8_RSSISMC2G 0x00F0 | 363 | #define SSB_SPROM8_RSSISMC2G 0x00F0 |
| 363 | #define SSB_SPROM8_RSSISMC2G_SHIFT 4 | 364 | #define SSB_SPROM8_RSSISMC2G_SHIFT 4 |
| @@ -365,7 +366,7 @@ | |||
| 365 | #define SSB_SPROM8_RSSISAV2G_SHIFT 8 | 366 | #define SSB_SPROM8_RSSISAV2G_SHIFT 8 |
| 366 | #define SSB_SPROM8_BXA2G 0x1800 | 367 | #define SSB_SPROM8_BXA2G 0x1800 |
| 367 | #define SSB_SPROM8_BXA2G_SHIFT 11 | 368 | #define SSB_SPROM8_BXA2G_SHIFT 11 |
| 368 | #define SSB_SPROM8_RSSIPARM5G 0x10A6 /* RSSI params for 5GHz */ | 369 | #define SSB_SPROM8_RSSIPARM5G 0x00A6 /* RSSI params for 5GHz */ |
| 369 | #define SSB_SPROM8_RSSISMF5G 0x000F | 370 | #define SSB_SPROM8_RSSISMF5G 0x000F |
| 370 | #define SSB_SPROM8_RSSISMC5G 0x00F0 | 371 | #define SSB_SPROM8_RSSISMC5G 0x00F0 |
| 371 | #define SSB_SPROM8_RSSISMC5G_SHIFT 4 | 372 | #define SSB_SPROM8_RSSISMC5G_SHIFT 4 |
| @@ -373,47 +374,47 @@ | |||
| 373 | #define SSB_SPROM8_RSSISAV5G_SHIFT 8 | 374 | #define SSB_SPROM8_RSSISAV5G_SHIFT 8 |
| 374 | #define SSB_SPROM8_BXA5G 0x1800 | 375 | #define SSB_SPROM8_BXA5G 0x1800 |
| 375 | #define SSB_SPROM8_BXA5G_SHIFT 11 | 376 | #define SSB_SPROM8_BXA5G_SHIFT 11 |
| 376 | #define SSB_SPROM8_TRI25G 0x10A8 /* TX isolation 2.4&5.3GHz */ | 377 | #define SSB_SPROM8_TRI25G 0x00A8 /* TX isolation 2.4&5.3GHz */ |
| 377 | #define SSB_SPROM8_TRI2G 0x00FF /* TX isolation 2.4GHz */ | 378 | #define SSB_SPROM8_TRI2G 0x00FF /* TX isolation 2.4GHz */ |
| 378 | #define SSB_SPROM8_TRI5G 0xFF00 /* TX isolation 5.3GHz */ | 379 | #define SSB_SPROM8_TRI5G 0xFF00 /* TX isolation 5.3GHz */ |
| 379 | #define SSB_SPROM8_TRI5G_SHIFT 8 | 380 | #define SSB_SPROM8_TRI5G_SHIFT 8 |
| 380 | #define SSB_SPROM8_TRI5GHL 0x10AA /* TX isolation 5.2/5.8GHz */ | 381 | #define SSB_SPROM8_TRI5GHL 0x00AA /* TX isolation 5.2/5.8GHz */ |
| 381 | #define SSB_SPROM8_TRI5GL 0x00FF /* TX isolation 5.2GHz */ | 382 | #define SSB_SPROM8_TRI5GL 0x00FF /* TX isolation 5.2GHz */ |
| 382 | #define SSB_SPROM8_TRI5GH 0xFF00 /* TX isolation 5.8GHz */ | 383 | #define SSB_SPROM8_TRI5GH 0xFF00 /* TX isolation 5.8GHz */ |
| 383 | #define SSB_SPROM8_TRI5GH_SHIFT 8 | 384 | #define SSB_SPROM8_TRI5GH_SHIFT 8 |
| 384 | #define SSB_SPROM8_RXPO 0x10AC /* RX power offsets */ | 385 | #define SSB_SPROM8_RXPO 0x00AC /* RX power offsets */ |
| 385 | #define SSB_SPROM8_RXPO2G 0x00FF /* 2GHz RX power offset */ | 386 | #define SSB_SPROM8_RXPO2G 0x00FF /* 2GHz RX power offset */ |
| 386 | #define SSB_SPROM8_RXPO5G 0xFF00 /* 5GHz RX power offset */ | 387 | #define SSB_SPROM8_RXPO5G 0xFF00 /* 5GHz RX power offset */ |
| 387 | #define SSB_SPROM8_RXPO5G_SHIFT 8 | 388 | #define SSB_SPROM8_RXPO5G_SHIFT 8 |
| 388 | #define SSB_SPROM8_MAXP_BG 0x10C0 /* Max Power 2GHz in path 1 */ | 389 | #define SSB_SPROM8_MAXP_BG 0x00C0 /* Max Power 2GHz in path 1 */ |
| 389 | #define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power 2GHz */ | 390 | #define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power 2GHz */ |
| 390 | #define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ | 391 | #define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ |
| 391 | #define SSB_SPROM8_ITSSI_BG_SHIFT 8 | 392 | #define SSB_SPROM8_ITSSI_BG_SHIFT 8 |
| 392 | #define SSB_SPROM8_PA0B0 0x10C2 /* 2GHz power amp settings */ | 393 | #define SSB_SPROM8_PA0B0 0x00C2 /* 2GHz power amp settings */ |
| 393 | #define SSB_SPROM8_PA0B1 0x10C4 | 394 | #define SSB_SPROM8_PA0B1 0x00C4 |
| 394 | #define SSB_SPROM8_PA0B2 0x10C6 | 395 | #define SSB_SPROM8_PA0B2 0x00C6 |
| 395 | #define SSB_SPROM8_MAXP_A 0x10C8 /* Max Power 5.3GHz */ | 396 | #define SSB_SPROM8_MAXP_A 0x00C8 /* Max Power 5.3GHz */ |
| 396 | #define SSB_SPROM8_MAXP_A_MASK 0x00FF /* Mask for Max Power 5.3GHz */ | 397 | #define SSB_SPROM8_MAXP_A_MASK 0x00FF /* Mask for Max Power 5.3GHz */ |
| 397 | #define SSB_SPROM8_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */ | 398 | #define SSB_SPROM8_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */ |
| 398 | #define SSB_SPROM8_ITSSI_A_SHIFT 8 | 399 | #define SSB_SPROM8_ITSSI_A_SHIFT 8 |
| 399 | #define SSB_SPROM8_MAXP_AHL 0x10CA /* Max Power 5.2/5.8GHz */ | 400 | #define SSB_SPROM8_MAXP_AHL 0x00CA /* Max Power 5.2/5.8GHz */ |
| 400 | #define SSB_SPROM8_MAXP_AH_MASK 0x00FF /* Mask for Max Power 5.8GHz */ | 401 | #define SSB_SPROM8_MAXP_AH_MASK 0x00FF /* Mask for Max Power 5.8GHz */ |
| 401 | #define SSB_SPROM8_MAXP_AL_MASK 0xFF00 /* Mask for Max Power 5.2GHz */ | 402 | #define SSB_SPROM8_MAXP_AL_MASK 0xFF00 /* Mask for Max Power 5.2GHz */ |
| 402 | #define SSB_SPROM8_MAXP_AL_SHIFT 8 | 403 | #define SSB_SPROM8_MAXP_AL_SHIFT 8 |
| 403 | #define SSB_SPROM8_PA1B0 0x10CC /* 5.3GHz power amp settings */ | 404 | #define SSB_SPROM8_PA1B0 0x00CC /* 5.3GHz power amp settings */ |
| 404 | #define SSB_SPROM8_PA1B1 0x10CE | 405 | #define SSB_SPROM8_PA1B1 0x00CE |
| 405 | #define SSB_SPROM8_PA1B2 0x10D0 | 406 | #define SSB_SPROM8_PA1B2 0x00D0 |
| 406 | #define SSB_SPROM8_PA1LOB0 0x10D2 /* 5.2GHz power amp settings */ | 407 | #define SSB_SPROM8_PA1LOB0 0x00D2 /* 5.2GHz power amp settings */ |
| 407 | #define SSB_SPROM8_PA1LOB1 0x10D4 | 408 | #define SSB_SPROM8_PA1LOB1 0x00D4 |
| 408 | #define SSB_SPROM8_PA1LOB2 0x10D6 | 409 | #define SSB_SPROM8_PA1LOB2 0x00D6 |
| 409 | #define SSB_SPROM8_PA1HIB0 0x10D8 /* 5.8GHz power amp settings */ | 410 | #define SSB_SPROM8_PA1HIB0 0x00D8 /* 5.8GHz power amp settings */ |
| 410 | #define SSB_SPROM8_PA1HIB1 0x10DA | 411 | #define SSB_SPROM8_PA1HIB1 0x00DA |
| 411 | #define SSB_SPROM8_PA1HIB2 0x10DC | 412 | #define SSB_SPROM8_PA1HIB2 0x00DC |
| 412 | #define SSB_SPROM8_CCK2GPO 0x1140 /* CCK power offset */ | 413 | #define SSB_SPROM8_CCK2GPO 0x0140 /* CCK power offset */ |
| 413 | #define SSB_SPROM8_OFDM2GPO 0x1142 /* 2.4GHz OFDM power offset */ | 414 | #define SSB_SPROM8_OFDM2GPO 0x0142 /* 2.4GHz OFDM power offset */ |
| 414 | #define SSB_SPROM8_OFDM5GPO 0x1146 /* 5.3GHz OFDM power offset */ | 415 | #define SSB_SPROM8_OFDM5GPO 0x0146 /* 5.3GHz OFDM power offset */ |
| 415 | #define SSB_SPROM8_OFDM5GLPO 0x114A /* 5.2GHz OFDM power offset */ | 416 | #define SSB_SPROM8_OFDM5GLPO 0x014A /* 5.2GHz OFDM power offset */ |
| 416 | #define SSB_SPROM8_OFDM5GHPO 0x114E /* 5.8GHz OFDM power offset */ | 417 | #define SSB_SPROM8_OFDM5GHPO 0x014E /* 5.8GHz OFDM power offset */ |
| 417 | 418 | ||
| 418 | /* Values for SSB_SPROM1_BINF_CCODE */ | 419 | /* Values for SSB_SPROM1_BINF_CCODE */ |
| 419 | enum { | 420 | enum { |
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 32bfd1a8a48d..632ff7c03280 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
| @@ -33,6 +33,7 @@ struct plat_stmmacenet_data { | |||
| 33 | int bus_id; | 33 | int bus_id; |
| 34 | int pbl; | 34 | int pbl; |
| 35 | int has_gmac; | 35 | int has_gmac; |
| 36 | int enh_desc; | ||
| 36 | void (*fix_mac_speed)(void *priv, unsigned int speed); | 37 | void (*fix_mac_speed)(void *priv, unsigned int speed); |
| 37 | void (*bus_setup)(unsigned long ioaddr); | 38 | void (*bus_setup)(unsigned long ioaddr); |
| 38 | #ifdef CONFIG_STM_DRIVERS | 39 | #ifdef CONFIG_STM_DRIVERS |
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index baba3a23a814..6b524a0d02e4 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h | |||
| @@ -1,13 +1,101 @@ | |||
| 1 | #ifndef _LINUX_STOP_MACHINE | 1 | #ifndef _LINUX_STOP_MACHINE |
| 2 | #define _LINUX_STOP_MACHINE | 2 | #define _LINUX_STOP_MACHINE |
| 3 | /* "Bogolock": stop the entire machine, disable interrupts. This is a | 3 | |
| 4 | very heavy lock, which is equivalent to grabbing every spinlock | ||
| 5 | (and more). So the "read" side to such a lock is anything which | ||
| 6 | disables preeempt. */ | ||
| 7 | #include <linux/cpu.h> | 4 | #include <linux/cpu.h> |
| 8 | #include <linux/cpumask.h> | 5 | #include <linux/cpumask.h> |
| 6 | #include <linux/list.h> | ||
| 9 | #include <asm/system.h> | 7 | #include <asm/system.h> |
| 10 | 8 | ||
| 9 | /* | ||
| 10 | * stop_cpu[s]() is simplistic per-cpu maximum priority cpu | ||
| 11 | * monopolization mechanism. The caller can specify a non-sleeping | ||
| 12 | * function to be executed on a single or multiple cpus preempting all | ||
| 13 | * other processes and monopolizing those cpus until it finishes. | ||
| 14 | * | ||
| 15 | * Resources for this mechanism are preallocated when a cpu is brought | ||
| 16 | * up and requests are guaranteed to be served as long as the target | ||
| 17 | * cpus are online. | ||
| 18 | */ | ||
| 19 | typedef int (*cpu_stop_fn_t)(void *arg); | ||
| 20 | |||
| 21 | #ifdef CONFIG_SMP | ||
| 22 | |||
| 23 | struct cpu_stop_work { | ||
| 24 | struct list_head list; /* cpu_stopper->works */ | ||
| 25 | cpu_stop_fn_t fn; | ||
| 26 | void *arg; | ||
| 27 | struct cpu_stop_done *done; | ||
| 28 | }; | ||
| 29 | |||
| 30 | int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg); | ||
| 31 | void stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg, | ||
| 32 | struct cpu_stop_work *work_buf); | ||
| 33 | int stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg); | ||
| 34 | int try_stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg); | ||
| 35 | |||
| 36 | #else /* CONFIG_SMP */ | ||
| 37 | |||
| 38 | #include <linux/workqueue.h> | ||
| 39 | |||
| 40 | struct cpu_stop_work { | ||
| 41 | struct work_struct work; | ||
| 42 | cpu_stop_fn_t fn; | ||
| 43 | void *arg; | ||
| 44 | }; | ||
| 45 | |||
| 46 | static inline int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg) | ||
| 47 | { | ||
| 48 | int ret = -ENOENT; | ||
| 49 | preempt_disable(); | ||
| 50 | if (cpu == smp_processor_id()) | ||
| 51 | ret = fn(arg); | ||
| 52 | preempt_enable(); | ||
| 53 | return ret; | ||
| 54 | } | ||
| 55 | |||
| 56 | static void stop_one_cpu_nowait_workfn(struct work_struct *work) | ||
| 57 | { | ||
| 58 | struct cpu_stop_work *stwork = | ||
| 59 | container_of(work, struct cpu_stop_work, work); | ||
| 60 | preempt_disable(); | ||
| 61 | stwork->fn(stwork->arg); | ||
| 62 | preempt_enable(); | ||
| 63 | } | ||
| 64 | |||
| 65 | static inline void stop_one_cpu_nowait(unsigned int cpu, | ||
| 66 | cpu_stop_fn_t fn, void *arg, | ||
| 67 | struct cpu_stop_work *work_buf) | ||
| 68 | { | ||
| 69 | if (cpu == smp_processor_id()) { | ||
| 70 | INIT_WORK(&work_buf->work, stop_one_cpu_nowait_workfn); | ||
| 71 | work_buf->fn = fn; | ||
| 72 | work_buf->arg = arg; | ||
| 73 | schedule_work(&work_buf->work); | ||
| 74 | } | ||
| 75 | } | ||
| 76 | |||
| 77 | static inline int stop_cpus(const struct cpumask *cpumask, | ||
| 78 | cpu_stop_fn_t fn, void *arg) | ||
| 79 | { | ||
| 80 | if (cpumask_test_cpu(raw_smp_processor_id(), cpumask)) | ||
| 81 | return stop_one_cpu(raw_smp_processor_id(), fn, arg); | ||
| 82 | return -ENOENT; | ||
| 83 | } | ||
| 84 | |||
| 85 | static inline int try_stop_cpus(const struct cpumask *cpumask, | ||
| 86 | cpu_stop_fn_t fn, void *arg) | ||
| 87 | { | ||
| 88 | return stop_cpus(cpumask, fn, arg); | ||
| 89 | } | ||
| 90 | |||
| 91 | #endif /* CONFIG_SMP */ | ||
| 92 | |||
| 93 | /* | ||
| 94 | * stop_machine "Bogolock": stop the entire machine, disable | ||
| 95 | * interrupts. This is a very heavy lock, which is equivalent to | ||
| 96 | * grabbing every spinlock (and more). So the "read" side to such a | ||
| 97 | * lock is anything which disables preeempt. | ||
| 98 | */ | ||
| 11 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) | 99 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) |
| 12 | 100 | ||
| 13 | /** | 101 | /** |
| @@ -36,24 +124,7 @@ int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); | |||
| 36 | */ | 124 | */ |
| 37 | int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); | 125 | int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); |
| 38 | 126 | ||
| 39 | /** | 127 | #else /* CONFIG_STOP_MACHINE && CONFIG_SMP */ |
| 40 | * stop_machine_create: create all stop_machine threads | ||
| 41 | * | ||
| 42 | * Description: This causes all stop_machine threads to be created before | ||
| 43 | * stop_machine actually gets called. This can be used by subsystems that | ||
| 44 | * need a non failing stop_machine infrastructure. | ||
| 45 | */ | ||
| 46 | int stop_machine_create(void); | ||
| 47 | |||
| 48 | /** | ||
| 49 | * stop_machine_destroy: destroy all stop_machine threads | ||
| 50 | * | ||
| 51 | * Description: This causes all stop_machine threads which were created with | ||
| 52 | * stop_machine_create to be destroyed again. | ||
| 53 | */ | ||
| 54 | void stop_machine_destroy(void); | ||
| 55 | |||
| 56 | #else | ||
| 57 | 128 | ||
| 58 | static inline int stop_machine(int (*fn)(void *), void *data, | 129 | static inline int stop_machine(int (*fn)(void *), void *data, |
| 59 | const struct cpumask *cpus) | 130 | const struct cpumask *cpus) |
| @@ -65,8 +136,5 @@ static inline int stop_machine(int (*fn)(void *), void *data, | |||
| 65 | return ret; | 136 | return ret; |
| 66 | } | 137 | } |
| 67 | 138 | ||
| 68 | static inline int stop_machine_create(void) { return 0; } | 139 | #endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */ |
| 69 | static inline void stop_machine_destroy(void) { } | 140 | #endif /* _LINUX_STOP_MACHINE */ |
| 70 | |||
| 71 | #endif /* CONFIG_SMP */ | ||
| 72 | #endif /* _LINUX_STOP_MACHINE */ | ||
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 996df4dac7d4..87d7ec0bf779 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
| @@ -54,6 +54,7 @@ struct rpc_cred { | |||
| 54 | #define RPCAUTH_CRED_NEW 0 | 54 | #define RPCAUTH_CRED_NEW 0 |
| 55 | #define RPCAUTH_CRED_UPTODATE 1 | 55 | #define RPCAUTH_CRED_UPTODATE 1 |
| 56 | #define RPCAUTH_CRED_HASHED 2 | 56 | #define RPCAUTH_CRED_HASHED 2 |
| 57 | #define RPCAUTH_CRED_NEGATIVE 3 | ||
| 57 | 58 | ||
| 58 | #define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 | 59 | #define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 |
| 59 | 60 | ||
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h index d48d4e605f74..671538d25bc1 100644 --- a/include/linux/sunrpc/auth_gss.h +++ b/include/linux/sunrpc/auth_gss.h | |||
| @@ -82,6 +82,7 @@ struct gss_cred { | |||
| 82 | enum rpc_gss_svc gc_service; | 82 | enum rpc_gss_svc gc_service; |
| 83 | struct gss_cl_ctx *gc_ctx; | 83 | struct gss_cl_ctx *gc_ctx; |
| 84 | struct gss_upcall_msg *gc_upcall; | 84 | struct gss_upcall_msg *gc_upcall; |
| 85 | unsigned long gc_upcall_timestamp; | ||
| 85 | unsigned char gc_machine_cred : 1; | 86 | unsigned char gc_machine_cred : 1; |
| 86 | }; | 87 | }; |
| 87 | 88 | ||
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h index d7152b451e21..7c91260c44a9 100644 --- a/include/linux/sunrpc/bc_xprt.h +++ b/include/linux/sunrpc/bc_xprt.h | |||
| @@ -36,7 +36,6 @@ struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); | |||
| 36 | void xprt_free_bc_request(struct rpc_rqst *req); | 36 | void xprt_free_bc_request(struct rpc_rqst *req); |
| 37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); | 37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); |
| 38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); | 38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); |
| 39 | void bc_release_request(struct rpc_task *); | ||
| 40 | int bc_send(struct rpc_rqst *req); | 39 | int bc_send(struct rpc_rqst *req); |
| 41 | 40 | ||
| 42 | /* | 41 | /* |
| @@ -59,6 +58,10 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | |||
| 59 | { | 58 | { |
| 60 | return 0; | 59 | return 0; |
| 61 | } | 60 | } |
| 61 | |||
| 62 | static inline void xprt_free_bc_request(struct rpc_rqst *req) | ||
| 63 | { | ||
| 64 | } | ||
| 62 | #endif /* CONFIG_NFS_V4_1 */ | 65 | #endif /* CONFIG_NFS_V4_1 */ |
| 63 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ | 66 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ |
| 64 | 67 | ||
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 03f33330ece2..5d8048beb051 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
| @@ -35,7 +35,8 @@ int gss_import_sec_context( | |||
| 35 | const void* input_token, | 35 | const void* input_token, |
| 36 | size_t bufsize, | 36 | size_t bufsize, |
| 37 | struct gss_api_mech *mech, | 37 | struct gss_api_mech *mech, |
| 38 | struct gss_ctx **ctx_id); | 38 | struct gss_ctx **ctx_id, |
| 39 | gfp_t gfp_mask); | ||
| 39 | u32 gss_get_mic( | 40 | u32 gss_get_mic( |
| 40 | struct gss_ctx *ctx_id, | 41 | struct gss_ctx *ctx_id, |
| 41 | struct xdr_buf *message, | 42 | struct xdr_buf *message, |
| @@ -80,6 +81,8 @@ struct gss_api_mech { | |||
| 80 | /* pseudoflavors supported by this mechanism: */ | 81 | /* pseudoflavors supported by this mechanism: */ |
| 81 | int gm_pf_num; | 82 | int gm_pf_num; |
| 82 | struct pf_desc * gm_pfs; | 83 | struct pf_desc * gm_pfs; |
| 84 | /* Should the following be a callback operation instead? */ | ||
| 85 | const char *gm_upcall_enctypes; | ||
| 83 | }; | 86 | }; |
| 84 | 87 | ||
| 85 | /* and must provide the following operations: */ | 88 | /* and must provide the following operations: */ |
| @@ -87,7 +90,8 @@ struct gss_api_ops { | |||
| 87 | int (*gss_import_sec_context)( | 90 | int (*gss_import_sec_context)( |
| 88 | const void *input_token, | 91 | const void *input_token, |
| 89 | size_t bufsize, | 92 | size_t bufsize, |
| 90 | struct gss_ctx *ctx_id); | 93 | struct gss_ctx *ctx_id, |
| 94 | gfp_t gfp_mask); | ||
| 91 | u32 (*gss_get_mic)( | 95 | u32 (*gss_get_mic)( |
| 92 | struct gss_ctx *ctx_id, | 96 | struct gss_ctx *ctx_id, |
| 93 | struct xdr_buf *message, | 97 | struct xdr_buf *message, |
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h index e7bbdba474d5..5af2931cf58d 100644 --- a/include/linux/sunrpc/gss_krb5.h +++ b/include/linux/sunrpc/gss_krb5.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * Adapted from MIT Kerberos 5-1.2.1 lib/include/krb5.h, | 4 | * Adapted from MIT Kerberos 5-1.2.1 lib/include/krb5.h, |
| 5 | * lib/gssapi/krb5/gssapiP_krb5.h, and others | 5 | * lib/gssapi/krb5/gssapiP_krb5.h, and others |
| 6 | * | 6 | * |
| 7 | * Copyright (c) 2000 The Regents of the University of Michigan. | 7 | * Copyright (c) 2000-2008 The Regents of the University of Michigan. |
| 8 | * All rights reserved. | 8 | * All rights reserved. |
| 9 | * | 9 | * |
| 10 | * Andy Adamson <andros@umich.edu> | 10 | * Andy Adamson <andros@umich.edu> |
| @@ -36,17 +36,86 @@ | |||
| 36 | * | 36 | * |
| 37 | */ | 37 | */ |
| 38 | 38 | ||
| 39 | #include <linux/crypto.h> | ||
| 39 | #include <linux/sunrpc/auth_gss.h> | 40 | #include <linux/sunrpc/auth_gss.h> |
| 40 | #include <linux/sunrpc/gss_err.h> | 41 | #include <linux/sunrpc/gss_err.h> |
| 41 | #include <linux/sunrpc/gss_asn1.h> | 42 | #include <linux/sunrpc/gss_asn1.h> |
| 42 | 43 | ||
| 44 | /* Length of constant used in key derivation */ | ||
| 45 | #define GSS_KRB5_K5CLENGTH (5) | ||
| 46 | |||
| 47 | /* Maximum key length (in bytes) for the supported crypto algorithms*/ | ||
| 48 | #define GSS_KRB5_MAX_KEYLEN (32) | ||
| 49 | |||
| 50 | /* Maximum checksum function output for the supported crypto algorithms */ | ||
| 51 | #define GSS_KRB5_MAX_CKSUM_LEN (20) | ||
| 52 | |||
| 53 | /* Maximum blocksize for the supported crypto algorithms */ | ||
| 54 | #define GSS_KRB5_MAX_BLOCKSIZE (16) | ||
| 55 | |||
| 56 | struct krb5_ctx; | ||
| 57 | |||
| 58 | struct gss_krb5_enctype { | ||
| 59 | const u32 etype; /* encryption (key) type */ | ||
| 60 | const u32 ctype; /* checksum type */ | ||
| 61 | const char *name; /* "friendly" name */ | ||
| 62 | const char *encrypt_name; /* crypto encrypt name */ | ||
| 63 | const char *cksum_name; /* crypto checksum name */ | ||
| 64 | const u16 signalg; /* signing algorithm */ | ||
| 65 | const u16 sealalg; /* sealing algorithm */ | ||
| 66 | const u32 blocksize; /* encryption blocksize */ | ||
| 67 | const u32 conflen; /* confounder length | ||
| 68 | (normally the same as | ||
| 69 | the blocksize) */ | ||
| 70 | const u32 cksumlength; /* checksum length */ | ||
| 71 | const u32 keyed_cksum; /* is it a keyed cksum? */ | ||
| 72 | const u32 keybytes; /* raw key len, in bytes */ | ||
| 73 | const u32 keylength; /* final key len, in bytes */ | ||
| 74 | u32 (*encrypt) (struct crypto_blkcipher *tfm, | ||
| 75 | void *iv, void *in, void *out, | ||
| 76 | int length); /* encryption function */ | ||
| 77 | u32 (*decrypt) (struct crypto_blkcipher *tfm, | ||
| 78 | void *iv, void *in, void *out, | ||
| 79 | int length); /* decryption function */ | ||
| 80 | u32 (*mk_key) (const struct gss_krb5_enctype *gk5e, | ||
| 81 | struct xdr_netobj *in, | ||
| 82 | struct xdr_netobj *out); /* complete key generation */ | ||
| 83 | u32 (*encrypt_v2) (struct krb5_ctx *kctx, u32 offset, | ||
| 84 | struct xdr_buf *buf, int ec, | ||
| 85 | struct page **pages); /* v2 encryption function */ | ||
| 86 | u32 (*decrypt_v2) (struct krb5_ctx *kctx, u32 offset, | ||
| 87 | struct xdr_buf *buf, u32 *headskip, | ||
| 88 | u32 *tailskip); /* v2 decryption function */ | ||
| 89 | }; | ||
| 90 | |||
| 91 | /* krb5_ctx flags definitions */ | ||
| 92 | #define KRB5_CTX_FLAG_INITIATOR 0x00000001 | ||
| 93 | #define KRB5_CTX_FLAG_CFX 0x00000002 | ||
| 94 | #define KRB5_CTX_FLAG_ACCEPTOR_SUBKEY 0x00000004 | ||
| 95 | |||
| 43 | struct krb5_ctx { | 96 | struct krb5_ctx { |
| 44 | int initiate; /* 1 = initiating, 0 = accepting */ | 97 | int initiate; /* 1 = initiating, 0 = accepting */ |
| 98 | u32 enctype; | ||
| 99 | u32 flags; | ||
| 100 | const struct gss_krb5_enctype *gk5e; /* enctype-specific info */ | ||
| 45 | struct crypto_blkcipher *enc; | 101 | struct crypto_blkcipher *enc; |
| 46 | struct crypto_blkcipher *seq; | 102 | struct crypto_blkcipher *seq; |
| 103 | struct crypto_blkcipher *acceptor_enc; | ||
| 104 | struct crypto_blkcipher *initiator_enc; | ||
| 105 | struct crypto_blkcipher *acceptor_enc_aux; | ||
| 106 | struct crypto_blkcipher *initiator_enc_aux; | ||
| 107 | u8 Ksess[GSS_KRB5_MAX_KEYLEN]; /* session key */ | ||
| 108 | u8 cksum[GSS_KRB5_MAX_KEYLEN]; | ||
| 47 | s32 endtime; | 109 | s32 endtime; |
| 48 | u32 seq_send; | 110 | u32 seq_send; |
| 111 | u64 seq_send64; | ||
| 49 | struct xdr_netobj mech_used; | 112 | struct xdr_netobj mech_used; |
| 113 | u8 initiator_sign[GSS_KRB5_MAX_KEYLEN]; | ||
| 114 | u8 acceptor_sign[GSS_KRB5_MAX_KEYLEN]; | ||
| 115 | u8 initiator_seal[GSS_KRB5_MAX_KEYLEN]; | ||
| 116 | u8 acceptor_seal[GSS_KRB5_MAX_KEYLEN]; | ||
| 117 | u8 initiator_integ[GSS_KRB5_MAX_KEYLEN]; | ||
| 118 | u8 acceptor_integ[GSS_KRB5_MAX_KEYLEN]; | ||
| 50 | }; | 119 | }; |
| 51 | 120 | ||
| 52 | extern spinlock_t krb5_seq_lock; | 121 | extern spinlock_t krb5_seq_lock; |
| @@ -57,6 +126,18 @@ extern spinlock_t krb5_seq_lock; | |||
| 57 | #define KG_TOK_MIC_MSG 0x0101 | 126 | #define KG_TOK_MIC_MSG 0x0101 |
| 58 | #define KG_TOK_WRAP_MSG 0x0201 | 127 | #define KG_TOK_WRAP_MSG 0x0201 |
| 59 | 128 | ||
| 129 | #define KG2_TOK_INITIAL 0x0101 | ||
| 130 | #define KG2_TOK_RESPONSE 0x0202 | ||
| 131 | #define KG2_TOK_MIC 0x0404 | ||
| 132 | #define KG2_TOK_WRAP 0x0504 | ||
| 133 | |||
| 134 | #define KG2_TOKEN_FLAG_SENTBYACCEPTOR 0x01 | ||
| 135 | #define KG2_TOKEN_FLAG_SEALED 0x02 | ||
| 136 | #define KG2_TOKEN_FLAG_ACCEPTORSUBKEY 0x04 | ||
| 137 | |||
| 138 | #define KG2_RESP_FLAG_ERROR 0x0001 | ||
| 139 | #define KG2_RESP_FLAG_DELEG_OK 0x0002 | ||
| 140 | |||
| 60 | enum sgn_alg { | 141 | enum sgn_alg { |
| 61 | SGN_ALG_DES_MAC_MD5 = 0x0000, | 142 | SGN_ALG_DES_MAC_MD5 = 0x0000, |
| 62 | SGN_ALG_MD2_5 = 0x0001, | 143 | SGN_ALG_MD2_5 = 0x0001, |
| @@ -81,6 +162,9 @@ enum seal_alg { | |||
| 81 | #define CKSUMTYPE_RSA_MD5_DES 0x0008 | 162 | #define CKSUMTYPE_RSA_MD5_DES 0x0008 |
| 82 | #define CKSUMTYPE_NIST_SHA 0x0009 | 163 | #define CKSUMTYPE_NIST_SHA 0x0009 |
| 83 | #define CKSUMTYPE_HMAC_SHA1_DES3 0x000c | 164 | #define CKSUMTYPE_HMAC_SHA1_DES3 0x000c |
| 165 | #define CKSUMTYPE_HMAC_SHA1_96_AES128 0x000f | ||
| 166 | #define CKSUMTYPE_HMAC_SHA1_96_AES256 0x0010 | ||
| 167 | #define CKSUMTYPE_HMAC_MD5_ARCFOUR -138 /* Microsoft md5 hmac cksumtype */ | ||
| 84 | 168 | ||
| 85 | /* from gssapi_err_krb5.h */ | 169 | /* from gssapi_err_krb5.h */ |
| 86 | #define KG_CCACHE_NOMATCH (39756032L) | 170 | #define KG_CCACHE_NOMATCH (39756032L) |
| @@ -111,11 +195,56 @@ enum seal_alg { | |||
| 111 | #define ENCTYPE_DES3_CBC_RAW 0x0006 /* DES-3 cbc mode raw */ | 195 | #define ENCTYPE_DES3_CBC_RAW 0x0006 /* DES-3 cbc mode raw */ |
| 112 | #define ENCTYPE_DES_HMAC_SHA1 0x0008 | 196 | #define ENCTYPE_DES_HMAC_SHA1 0x0008 |
| 113 | #define ENCTYPE_DES3_CBC_SHA1 0x0010 | 197 | #define ENCTYPE_DES3_CBC_SHA1 0x0010 |
| 198 | #define ENCTYPE_AES128_CTS_HMAC_SHA1_96 0x0011 | ||
| 199 | #define ENCTYPE_AES256_CTS_HMAC_SHA1_96 0x0012 | ||
| 200 | #define ENCTYPE_ARCFOUR_HMAC 0x0017 | ||
| 201 | #define ENCTYPE_ARCFOUR_HMAC_EXP 0x0018 | ||
| 114 | #define ENCTYPE_UNKNOWN 0x01ff | 202 | #define ENCTYPE_UNKNOWN 0x01ff |
| 115 | 203 | ||
| 116 | s32 | 204 | /* |
| 117 | make_checksum(char *, char *header, int hdrlen, struct xdr_buf *body, | 205 | * Constants used for key derivation |
| 118 | int body_offset, struct xdr_netobj *cksum); | 206 | */ |
| 207 | /* for 3DES */ | ||
| 208 | #define KG_USAGE_SEAL (22) | ||
| 209 | #define KG_USAGE_SIGN (23) | ||
| 210 | #define KG_USAGE_SEQ (24) | ||
| 211 | |||
| 212 | /* from rfc3961 */ | ||
| 213 | #define KEY_USAGE_SEED_CHECKSUM (0x99) | ||
| 214 | #define KEY_USAGE_SEED_ENCRYPTION (0xAA) | ||
| 215 | #define KEY_USAGE_SEED_INTEGRITY (0x55) | ||
| 216 | |||
| 217 | /* from rfc4121 */ | ||
| 218 | #define KG_USAGE_ACCEPTOR_SEAL (22) | ||
| 219 | #define KG_USAGE_ACCEPTOR_SIGN (23) | ||
| 220 | #define KG_USAGE_INITIATOR_SEAL (24) | ||
| 221 | #define KG_USAGE_INITIATOR_SIGN (25) | ||
| 222 | |||
| 223 | /* | ||
| 224 | * This compile-time check verifies that we will not exceed the | ||
| 225 | * slack space allotted by the client and server auth_gss code | ||
| 226 | * before they call gss_wrap(). | ||
| 227 | */ | ||
| 228 | #define GSS_KRB5_MAX_SLACK_NEEDED \ | ||
| 229 | (GSS_KRB5_TOK_HDR_LEN /* gss token header */ \ | ||
| 230 | + GSS_KRB5_MAX_CKSUM_LEN /* gss token checksum */ \ | ||
| 231 | + GSS_KRB5_MAX_BLOCKSIZE /* confounder */ \ | ||
| 232 | + GSS_KRB5_MAX_BLOCKSIZE /* possible padding */ \ | ||
| 233 | + GSS_KRB5_TOK_HDR_LEN /* encrypted hdr in v2 token */\ | ||
| 234 | + GSS_KRB5_MAX_CKSUM_LEN /* encryption hmac */ \ | ||
| 235 | + 4 + 4 /* RPC verifier */ \ | ||
| 236 | + GSS_KRB5_TOK_HDR_LEN \ | ||
| 237 | + GSS_KRB5_MAX_CKSUM_LEN) | ||
| 238 | |||
| 239 | u32 | ||
| 240 | make_checksum(struct krb5_ctx *kctx, char *header, int hdrlen, | ||
| 241 | struct xdr_buf *body, int body_offset, u8 *cksumkey, | ||
| 242 | unsigned int usage, struct xdr_netobj *cksumout); | ||
| 243 | |||
| 244 | u32 | ||
| 245 | make_checksum_v2(struct krb5_ctx *, char *header, int hdrlen, | ||
| 246 | struct xdr_buf *body, int body_offset, u8 *key, | ||
| 247 | unsigned int usage, struct xdr_netobj *cksum); | ||
| 119 | 248 | ||
| 120 | u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *, | 249 | u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *, |
| 121 | struct xdr_netobj *); | 250 | struct xdr_netobj *); |
| @@ -149,11 +278,54 @@ gss_decrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *inbuf, | |||
| 149 | int offset); | 278 | int offset); |
| 150 | 279 | ||
| 151 | s32 | 280 | s32 |
| 152 | krb5_make_seq_num(struct crypto_blkcipher *key, | 281 | krb5_make_seq_num(struct krb5_ctx *kctx, |
| 282 | struct crypto_blkcipher *key, | ||
| 153 | int direction, | 283 | int direction, |
| 154 | u32 seqnum, unsigned char *cksum, unsigned char *buf); | 284 | u32 seqnum, unsigned char *cksum, unsigned char *buf); |
| 155 | 285 | ||
| 156 | s32 | 286 | s32 |
| 157 | krb5_get_seq_num(struct crypto_blkcipher *key, | 287 | krb5_get_seq_num(struct krb5_ctx *kctx, |
| 158 | unsigned char *cksum, | 288 | unsigned char *cksum, |
| 159 | unsigned char *buf, int *direction, u32 *seqnum); | 289 | unsigned char *buf, int *direction, u32 *seqnum); |
| 290 | |||
| 291 | int | ||
| 292 | xdr_extend_head(struct xdr_buf *buf, unsigned int base, unsigned int shiftlen); | ||
| 293 | |||
| 294 | u32 | ||
| 295 | krb5_derive_key(const struct gss_krb5_enctype *gk5e, | ||
| 296 | const struct xdr_netobj *inkey, | ||
| 297 | struct xdr_netobj *outkey, | ||
| 298 | const struct xdr_netobj *in_constant, | ||
| 299 | gfp_t gfp_mask); | ||
| 300 | |||
| 301 | u32 | ||
| 302 | gss_krb5_des3_make_key(const struct gss_krb5_enctype *gk5e, | ||
| 303 | struct xdr_netobj *randombits, | ||
| 304 | struct xdr_netobj *key); | ||
| 305 | |||
| 306 | u32 | ||
| 307 | gss_krb5_aes_make_key(const struct gss_krb5_enctype *gk5e, | ||
| 308 | struct xdr_netobj *randombits, | ||
| 309 | struct xdr_netobj *key); | ||
| 310 | |||
| 311 | u32 | ||
| 312 | gss_krb5_aes_encrypt(struct krb5_ctx *kctx, u32 offset, | ||
| 313 | struct xdr_buf *buf, int ec, | ||
| 314 | struct page **pages); | ||
| 315 | |||
| 316 | u32 | ||
| 317 | gss_krb5_aes_decrypt(struct krb5_ctx *kctx, u32 offset, | ||
| 318 | struct xdr_buf *buf, u32 *plainoffset, | ||
| 319 | u32 *plainlen); | ||
| 320 | |||
| 321 | int | ||
| 322 | krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, | ||
| 323 | struct crypto_blkcipher *cipher, | ||
| 324 | unsigned char *cksum); | ||
| 325 | |||
| 326 | int | ||
| 327 | krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, | ||
| 328 | struct crypto_blkcipher *cipher, | ||
| 329 | s32 seqnum); | ||
| 330 | void | ||
| 331 | gss_krb5_make_confounder(char *p, u32 conflen); | ||
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h index 77f78e56c481..b6edbc0ea83d 100644 --- a/include/linux/sunrpc/metrics.h +++ b/include/linux/sunrpc/metrics.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #define _LINUX_SUNRPC_METRICS_H | 26 | #define _LINUX_SUNRPC_METRICS_H |
| 27 | 27 | ||
| 28 | #include <linux/seq_file.h> | 28 | #include <linux/seq_file.h> |
| 29 | #include <linux/ktime.h> | ||
| 29 | 30 | ||
| 30 | #define RPC_IOSTATS_VERS "1.0" | 31 | #define RPC_IOSTATS_VERS "1.0" |
| 31 | 32 | ||
| @@ -58,9 +59,9 @@ struct rpc_iostats { | |||
| 58 | * and the total time the request spent from init to release | 59 | * and the total time the request spent from init to release |
| 59 | * are measured. | 60 | * are measured. |
| 60 | */ | 61 | */ |
| 61 | unsigned long long om_queue, /* jiffies queued for xmit */ | 62 | ktime_t om_queue, /* queued for xmit */ |
| 62 | om_rtt, /* jiffies for RPC RTT */ | 63 | om_rtt, /* RPC RTT */ |
| 63 | om_execute; /* jiffies for RPC execution */ | 64 | om_execute; /* RPC execution */ |
| 64 | } ____cacheline_aligned; | 65 | } ____cacheline_aligned; |
| 65 | 66 | ||
| 66 | struct rpc_task; | 67 | struct rpc_task; |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 7bc7fd5291ce..7be4f3a6d246 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #define _LINUX_SUNRPC_SCHED_H_ | 10 | #define _LINUX_SUNRPC_SCHED_H_ |
| 11 | 11 | ||
| 12 | #include <linux/timer.h> | 12 | #include <linux/timer.h> |
| 13 | #include <linux/ktime.h> | ||
| 13 | #include <linux/sunrpc/types.h> | 14 | #include <linux/sunrpc/types.h> |
| 14 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
| 15 | #include <linux/wait.h> | 16 | #include <linux/wait.h> |
| @@ -40,21 +41,15 @@ struct rpc_wait { | |||
| 40 | * This is the RPC task struct | 41 | * This is the RPC task struct |
| 41 | */ | 42 | */ |
| 42 | struct rpc_task { | 43 | struct rpc_task { |
| 43 | #ifdef RPC_DEBUG | ||
| 44 | unsigned long tk_magic; /* 0xf00baa */ | ||
| 45 | #endif | ||
| 46 | atomic_t tk_count; /* Reference count */ | 44 | atomic_t tk_count; /* Reference count */ |
| 47 | struct list_head tk_task; /* global list of tasks */ | 45 | struct list_head tk_task; /* global list of tasks */ |
| 48 | struct rpc_clnt * tk_client; /* RPC client */ | 46 | struct rpc_clnt * tk_client; /* RPC client */ |
| 49 | struct rpc_rqst * tk_rqstp; /* RPC request */ | 47 | struct rpc_rqst * tk_rqstp; /* RPC request */ |
| 50 | int tk_status; /* result of last operation */ | ||
| 51 | 48 | ||
| 52 | /* | 49 | /* |
| 53 | * RPC call state | 50 | * RPC call state |
| 54 | */ | 51 | */ |
| 55 | struct rpc_message tk_msg; /* RPC call info */ | 52 | struct rpc_message tk_msg; /* RPC call info */ |
| 56 | __u8 tk_garb_retry; | ||
| 57 | __u8 tk_cred_retry; | ||
| 58 | 53 | ||
| 59 | /* | 54 | /* |
| 60 | * callback to be executed after waking up | 55 | * callback to be executed after waking up |
| @@ -67,7 +62,6 @@ struct rpc_task { | |||
| 67 | void * tk_calldata; | 62 | void * tk_calldata; |
| 68 | 63 | ||
| 69 | unsigned long tk_timeout; /* timeout for rpc_sleep() */ | 64 | unsigned long tk_timeout; /* timeout for rpc_sleep() */ |
| 70 | unsigned short tk_flags; /* misc flags */ | ||
| 71 | unsigned long tk_runstate; /* Task run status */ | 65 | unsigned long tk_runstate; /* Task run status */ |
| 72 | struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could | 66 | struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could |
| 73 | * be any workqueue | 67 | * be any workqueue |
| @@ -78,17 +72,19 @@ struct rpc_task { | |||
| 78 | struct rpc_wait tk_wait; /* RPC wait */ | 72 | struct rpc_wait tk_wait; /* RPC wait */ |
| 79 | } u; | 73 | } u; |
| 80 | 74 | ||
| 81 | unsigned short tk_timeouts; /* maj timeouts */ | 75 | ktime_t tk_start; /* RPC task init timestamp */ |
| 82 | size_t tk_bytes_sent; /* total bytes sent */ | ||
| 83 | unsigned long tk_start; /* RPC task init timestamp */ | ||
| 84 | long tk_rtt; /* round-trip time (jiffies) */ | ||
| 85 | 76 | ||
| 86 | pid_t tk_owner; /* Process id for batching tasks */ | 77 | pid_t tk_owner; /* Process id for batching tasks */ |
| 87 | unsigned char tk_priority : 2;/* Task priority */ | 78 | int tk_status; /* result of last operation */ |
| 79 | unsigned short tk_flags; /* misc flags */ | ||
| 80 | unsigned short tk_timeouts; /* maj timeouts */ | ||
| 88 | 81 | ||
| 89 | #ifdef RPC_DEBUG | 82 | #ifdef RPC_DEBUG |
| 90 | unsigned short tk_pid; /* debugging aid */ | 83 | unsigned short tk_pid; /* debugging aid */ |
| 91 | #endif | 84 | #endif |
| 85 | unsigned char tk_priority : 2,/* Task priority */ | ||
| 86 | tk_garb_retry : 2, | ||
| 87 | tk_cred_retry : 2; | ||
| 92 | }; | 88 | }; |
| 93 | #define tk_xprt tk_client->cl_xprt | 89 | #define tk_xprt tk_client->cl_xprt |
| 94 | 90 | ||
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index f5cc0898bc53..35cf2e8cd7c6 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
| @@ -1,7 +1,10 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * include/linux/sunrpc/xdr.h | 2 | * XDR standard data types and function declarations |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> | 4 | * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> |
| 5 | * | ||
| 6 | * Based on: | ||
| 7 | * RFC 4506 "XDR: External Data Representation Standard", May 2006 | ||
| 5 | */ | 8 | */ |
| 6 | 9 | ||
| 7 | #ifndef _SUNRPC_XDR_H_ | 10 | #ifndef _SUNRPC_XDR_H_ |
| @@ -62,7 +65,6 @@ struct xdr_buf { | |||
| 62 | 65 | ||
| 63 | unsigned int buflen, /* Total length of storage buffer */ | 66 | unsigned int buflen, /* Total length of storage buffer */ |
| 64 | len; /* Length of XDR encoded message */ | 67 | len; /* Length of XDR encoded message */ |
| 65 | |||
| 66 | }; | 68 | }; |
| 67 | 69 | ||
| 68 | /* | 70 | /* |
| @@ -178,7 +180,7 @@ struct xdr_array2_desc { | |||
| 178 | }; | 180 | }; |
| 179 | 181 | ||
| 180 | extern int xdr_decode_array2(struct xdr_buf *buf, unsigned int base, | 182 | extern int xdr_decode_array2(struct xdr_buf *buf, unsigned int base, |
| 181 | struct xdr_array2_desc *desc); | 183 | struct xdr_array2_desc *desc); |
| 182 | extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base, | 184 | extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base, |
| 183 | struct xdr_array2_desc *desc); | 185 | struct xdr_array2_desc *desc); |
| 184 | 186 | ||
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 6f9457a75b8f..b51470302399 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/socket.h> | 13 | #include <linux/socket.h> |
| 14 | #include <linux/in.h> | 14 | #include <linux/in.h> |
| 15 | #include <linux/kref.h> | 15 | #include <linux/kref.h> |
| 16 | #include <linux/ktime.h> | ||
| 16 | #include <linux/sunrpc/sched.h> | 17 | #include <linux/sunrpc/sched.h> |
| 17 | #include <linux/sunrpc/xdr.h> | 18 | #include <linux/sunrpc/xdr.h> |
| 18 | #include <linux/sunrpc/msg_prot.h> | 19 | #include <linux/sunrpc/msg_prot.h> |
| @@ -65,8 +66,6 @@ struct rpc_rqst { | |||
| 65 | struct rpc_task * rq_task; /* RPC task data */ | 66 | struct rpc_task * rq_task; /* RPC task data */ |
| 66 | __be32 rq_xid; /* request XID */ | 67 | __be32 rq_xid; /* request XID */ |
| 67 | int rq_cong; /* has incremented xprt->cong */ | 68 | int rq_cong; /* has incremented xprt->cong */ |
| 68 | int rq_reply_bytes_recvd; /* number of reply */ | ||
| 69 | /* bytes received */ | ||
| 70 | u32 rq_seqno; /* gss seq no. used on req. */ | 69 | u32 rq_seqno; /* gss seq no. used on req. */ |
| 71 | int rq_enc_pages_num; | 70 | int rq_enc_pages_num; |
| 72 | struct page **rq_enc_pages; /* scratch pages for use by | 71 | struct page **rq_enc_pages; /* scratch pages for use by |
| @@ -77,12 +76,16 @@ struct rpc_rqst { | |||
| 77 | __u32 * rq_buffer; /* XDR encode buffer */ | 76 | __u32 * rq_buffer; /* XDR encode buffer */ |
| 78 | size_t rq_callsize, | 77 | size_t rq_callsize, |
| 79 | rq_rcvsize; | 78 | rq_rcvsize; |
| 79 | size_t rq_xmit_bytes_sent; /* total bytes sent */ | ||
| 80 | size_t rq_reply_bytes_recvd; /* total reply bytes */ | ||
| 81 | /* received */ | ||
| 80 | 82 | ||
| 81 | struct xdr_buf rq_private_buf; /* The receive buffer | 83 | struct xdr_buf rq_private_buf; /* The receive buffer |
| 82 | * used in the softirq. | 84 | * used in the softirq. |
| 83 | */ | 85 | */ |
| 84 | unsigned long rq_majortimeo; /* major timeout alarm */ | 86 | unsigned long rq_majortimeo; /* major timeout alarm */ |
| 85 | unsigned long rq_timeout; /* Current timeout value */ | 87 | unsigned long rq_timeout; /* Current timeout value */ |
| 88 | ktime_t rq_rtt; /* round-trip time */ | ||
| 86 | unsigned int rq_retries; /* # of retries */ | 89 | unsigned int rq_retries; /* # of retries */ |
| 87 | unsigned int rq_connect_cookie; | 90 | unsigned int rq_connect_cookie; |
| 88 | /* A cookie used to track the | 91 | /* A cookie used to track the |
| @@ -94,7 +97,7 @@ struct rpc_rqst { | |||
| 94 | */ | 97 | */ |
| 95 | u32 rq_bytes_sent; /* Bytes we have sent */ | 98 | u32 rq_bytes_sent; /* Bytes we have sent */ |
| 96 | 99 | ||
| 97 | unsigned long rq_xtime; /* when transmitted */ | 100 | ktime_t rq_xtime; /* transmit time stamp */ |
| 98 | int rq_ntrans; | 101 | int rq_ntrans; |
| 99 | 102 | ||
| 100 | #if defined(CONFIG_NFS_V4_1) | 103 | #if defined(CONFIG_NFS_V4_1) |
| @@ -174,8 +177,7 @@ struct rpc_xprt { | |||
| 174 | /* | 177 | /* |
| 175 | * Connection of transports | 178 | * Connection of transports |
| 176 | */ | 179 | */ |
| 177 | unsigned long connect_timeout, | 180 | unsigned long bind_timeout, |
| 178 | bind_timeout, | ||
| 179 | reestablish_timeout; | 181 | reestablish_timeout; |
| 180 | unsigned int connect_cookie; /* A cookie that gets bumped | 182 | unsigned int connect_cookie; /* A cookie that gets bumped |
| 181 | every time the transport | 183 | every time the transport |
| @@ -294,7 +296,6 @@ void xprt_set_retrans_timeout_rtt(struct rpc_task *task); | |||
| 294 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); | 296 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); |
| 295 | void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action); | 297 | void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action); |
| 296 | void xprt_write_space(struct rpc_xprt *xprt); | 298 | void xprt_write_space(struct rpc_xprt *xprt); |
| 297 | void xprt_update_rtt(struct rpc_task *task); | ||
| 298 | void xprt_adjust_cwnd(struct rpc_task *task, int result); | 299 | void xprt_adjust_cwnd(struct rpc_task *task, int result); |
| 299 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); | 300 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); |
| 300 | void xprt_complete_rqst(struct rpc_task *task, int copied); | 301 | void xprt_complete_rqst(struct rpc_task *task, int copied); |
diff --git a/include/linux/swap.h b/include/linux/swap.h index a2602a8207a6..1f59d9340c4d 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -355,6 +355,7 @@ static inline void disable_swap_token(void) | |||
| 355 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 355 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
| 356 | extern void | 356 | extern void |
| 357 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); | 357 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); |
| 358 | extern int mem_cgroup_count_swap_user(swp_entry_t ent, struct page **pagep); | ||
| 358 | #else | 359 | #else |
| 359 | static inline void | 360 | static inline void |
| 360 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) | 361 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) |
| @@ -485,6 +486,14 @@ mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | |||
| 485 | { | 486 | { |
| 486 | } | 487 | } |
| 487 | 488 | ||
| 489 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | ||
| 490 | static inline int | ||
| 491 | mem_cgroup_count_swap_user(swp_entry_t ent, struct page **pagep) | ||
| 492 | { | ||
| 493 | return 0; | ||
| 494 | } | ||
| 495 | #endif | ||
| 496 | |||
| 488 | #endif /* CONFIG_SWAP */ | 497 | #endif /* CONFIG_SWAP */ |
| 489 | #endif /* __KERNEL__*/ | 498 | #endif /* __KERNEL__*/ |
| 490 | #endif /* _LINUX_SWAP_H */ | 499 | #endif /* _LINUX_SWAP_H */ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 8126f239edf0..057929b0a651 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -23,6 +23,7 @@ struct kexec_segment; | |||
| 23 | struct linux_dirent; | 23 | struct linux_dirent; |
| 24 | struct linux_dirent64; | 24 | struct linux_dirent64; |
| 25 | struct list_head; | 25 | struct list_head; |
| 26 | struct mmap_arg_struct; | ||
| 26 | struct msgbuf; | 27 | struct msgbuf; |
| 27 | struct msghdr; | 28 | struct msghdr; |
| 28 | struct mmsghdr; | 29 | struct mmsghdr; |
| @@ -30,10 +31,13 @@ struct msqid_ds; | |||
| 30 | struct new_utsname; | 31 | struct new_utsname; |
| 31 | struct nfsctl_arg; | 32 | struct nfsctl_arg; |
| 32 | struct __old_kernel_stat; | 33 | struct __old_kernel_stat; |
| 34 | struct oldold_utsname; | ||
| 35 | struct old_utsname; | ||
| 33 | struct pollfd; | 36 | struct pollfd; |
| 34 | struct rlimit; | 37 | struct rlimit; |
| 35 | struct rusage; | 38 | struct rusage; |
| 36 | struct sched_param; | 39 | struct sched_param; |
| 40 | struct sel_arg_struct; | ||
| 37 | struct semaphore; | 41 | struct semaphore; |
| 38 | struct sembuf; | 42 | struct sembuf; |
| 39 | struct shmid_ds; | 43 | struct shmid_ds; |
| @@ -101,18 +105,18 @@ struct perf_event_attr; | |||
| 101 | 105 | ||
| 102 | #ifdef CONFIG_PERF_EVENTS | 106 | #ifdef CONFIG_PERF_EVENTS |
| 103 | 107 | ||
| 104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | 108 | #define TRACE_SYS_ENTER_PERF_INIT(sname) \ |
| 105 | .profile_enable = prof_sysenter_enable, \ | 109 | .perf_event_enable = perf_sysenter_enable, \ |
| 106 | .profile_disable = prof_sysenter_disable, | 110 | .perf_event_disable = perf_sysenter_disable, |
| 107 | 111 | ||
| 108 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ | 112 | #define TRACE_SYS_EXIT_PERF_INIT(sname) \ |
| 109 | .profile_enable = prof_sysexit_enable, \ | 113 | .perf_event_enable = perf_sysexit_enable, \ |
| 110 | .profile_disable = prof_sysexit_disable, | 114 | .perf_event_disable = perf_sysexit_disable, |
| 111 | #else | 115 | #else |
| 112 | #define TRACE_SYS_ENTER_PROFILE(sname) | 116 | #define TRACE_SYS_ENTER_PERF(sname) |
| 113 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) | 117 | #define TRACE_SYS_ENTER_PERF_INIT(sname) |
| 114 | #define TRACE_SYS_EXIT_PROFILE(sname) | 118 | #define TRACE_SYS_EXIT_PERF(sname) |
| 115 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) | 119 | #define TRACE_SYS_EXIT_PERF_INIT(sname) |
| 116 | #endif /* CONFIG_PERF_EVENTS */ | 120 | #endif /* CONFIG_PERF_EVENTS */ |
| 117 | 121 | ||
| 118 | #ifdef CONFIG_FTRACE_SYSCALLS | 122 | #ifdef CONFIG_FTRACE_SYSCALLS |
| @@ -149,7 +153,7 @@ struct perf_event_attr; | |||
| 149 | .regfunc = reg_event_syscall_enter, \ | 153 | .regfunc = reg_event_syscall_enter, \ |
| 150 | .unregfunc = unreg_event_syscall_enter, \ | 154 | .unregfunc = unreg_event_syscall_enter, \ |
| 151 | .data = (void *)&__syscall_meta_##sname,\ | 155 | .data = (void *)&__syscall_meta_##sname,\ |
| 152 | TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | 156 | TRACE_SYS_ENTER_PERF_INIT(sname) \ |
| 153 | } | 157 | } |
| 154 | 158 | ||
| 155 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 159 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
| @@ -171,7 +175,7 @@ struct perf_event_attr; | |||
| 171 | .regfunc = reg_event_syscall_exit, \ | 175 | .regfunc = reg_event_syscall_exit, \ |
| 172 | .unregfunc = unreg_event_syscall_exit, \ | 176 | .unregfunc = unreg_event_syscall_exit, \ |
| 173 | .data = (void *)&__syscall_meta_##sname,\ | 177 | .data = (void *)&__syscall_meta_##sname,\ |
| 174 | TRACE_SYS_EXIT_PROFILE_INIT(sname) \ | 178 | TRACE_SYS_EXIT_PERF_INIT(sname) \ |
| 175 | } | 179 | } |
| 176 | 180 | ||
| 177 | #define SYSCALL_METADATA(sname, nb) \ | 181 | #define SYSCALL_METADATA(sname, nb) \ |
| @@ -638,6 +642,7 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, | |||
| 638 | long timeout); | 642 | long timeout); |
| 639 | asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, | 643 | asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, |
| 640 | fd_set __user *exp, struct timeval __user *tvp); | 644 | fd_set __user *exp, struct timeval __user *tvp); |
| 645 | asmlinkage long sys_old_select(struct sel_arg_struct __user *arg); | ||
| 641 | asmlinkage long sys_epoll_create(int size); | 646 | asmlinkage long sys_epoll_create(int size); |
| 642 | asmlinkage long sys_epoll_create1(int flags); | 647 | asmlinkage long sys_epoll_create1(int flags); |
| 643 | asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, | 648 | asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, |
| @@ -652,6 +657,8 @@ asmlinkage long sys_gethostname(char __user *name, int len); | |||
| 652 | asmlinkage long sys_sethostname(char __user *name, int len); | 657 | asmlinkage long sys_sethostname(char __user *name, int len); |
| 653 | asmlinkage long sys_setdomainname(char __user *name, int len); | 658 | asmlinkage long sys_setdomainname(char __user *name, int len); |
| 654 | asmlinkage long sys_newuname(struct new_utsname __user *name); | 659 | asmlinkage long sys_newuname(struct new_utsname __user *name); |
| 660 | asmlinkage long sys_uname(struct old_utsname __user *); | ||
| 661 | asmlinkage long sys_olduname(struct oldold_utsname __user *); | ||
| 655 | 662 | ||
| 656 | asmlinkage long sys_getrlimit(unsigned int resource, | 663 | asmlinkage long sys_getrlimit(unsigned int resource, |
| 657 | struct rlimit __user *rlim); | 664 | struct rlimit __user *rlim); |
| @@ -681,6 +688,8 @@ asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg); | |||
| 681 | asmlinkage long sys_shmget(key_t key, size_t size, int flag); | 688 | asmlinkage long sys_shmget(key_t key, size_t size, int flag); |
| 682 | asmlinkage long sys_shmdt(char __user *shmaddr); | 689 | asmlinkage long sys_shmdt(char __user *shmaddr); |
| 683 | asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); | 690 | asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); |
| 691 | asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second, | ||
| 692 | unsigned long third, void __user *ptr, long fifth); | ||
| 684 | 693 | ||
| 685 | asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); | 694 | asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); |
| 686 | asmlinkage long sys_mq_unlink(const char __user *name); | 695 | asmlinkage long sys_mq_unlink(const char __user *name); |
| @@ -836,4 +845,6 @@ asmlinkage long sys_perf_event_open( | |||
| 836 | asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len, | 845 | asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len, |
| 837 | unsigned long prot, unsigned long flags, | 846 | unsigned long prot, unsigned long flags, |
| 838 | unsigned long fd, unsigned long pgoff); | 847 | unsigned long fd, unsigned long pgoff); |
| 848 | asmlinkage long sys_old_mmap(struct mmap_arg_struct __user *arg); | ||
| 849 | |||
| 839 | #endif | 850 | #endif |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index f66014c90c9f..7bb5cb64f3b8 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
| @@ -980,6 +980,8 @@ extern int proc_doulongvec_minmax(struct ctl_table *, int, | |||
| 980 | void __user *, size_t *, loff_t *); | 980 | void __user *, size_t *, loff_t *); |
| 981 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, | 981 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, |
| 982 | void __user *, size_t *, loff_t *); | 982 | void __user *, size_t *, loff_t *); |
| 983 | extern int proc_do_large_bitmap(struct ctl_table *, int, | ||
| 984 | void __user *, size_t *, loff_t *); | ||
| 983 | 985 | ||
| 984 | /* | 986 | /* |
| 985 | * Register a set of sysctl names by calling register_sysctl_table | 987 | * Register a set of sysctl names by calling register_sysctl_table |
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h index f395bb3fa2f2..1154c29f4101 100644 --- a/include/linux/sysdev.h +++ b/include/linux/sysdev.h | |||
| @@ -27,10 +27,12 @@ | |||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | struct sys_device; | 29 | struct sys_device; |
| 30 | struct sysdev_class_attribute; | ||
| 30 | 31 | ||
| 31 | struct sysdev_class { | 32 | struct sysdev_class { |
| 32 | const char *name; | 33 | const char *name; |
| 33 | struct list_head drivers; | 34 | struct list_head drivers; |
| 35 | struct sysdev_class_attribute **attrs; | ||
| 34 | 36 | ||
| 35 | /* Default operations for these types of devices */ | 37 | /* Default operations for these types of devices */ |
| 36 | int (*shutdown)(struct sys_device *); | 38 | int (*shutdown)(struct sys_device *); |
| @@ -41,8 +43,10 @@ struct sysdev_class { | |||
| 41 | 43 | ||
| 42 | struct sysdev_class_attribute { | 44 | struct sysdev_class_attribute { |
| 43 | struct attribute attr; | 45 | struct attribute attr; |
| 44 | ssize_t (*show)(struct sysdev_class *, char *); | 46 | ssize_t (*show)(struct sysdev_class *, struct sysdev_class_attribute *, |
| 45 | ssize_t (*store)(struct sysdev_class *, const char *, size_t); | 47 | char *); |
| 48 | ssize_t (*store)(struct sysdev_class *, struct sysdev_class_attribute *, | ||
| 49 | const char *, size_t); | ||
| 46 | }; | 50 | }; |
| 47 | 51 | ||
| 48 | #define _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ | 52 | #define _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ |
| @@ -119,6 +123,19 @@ struct sysdev_attribute { | |||
| 119 | extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); | 123 | extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); |
| 120 | extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); | 124 | extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); |
| 121 | 125 | ||
| 126 | /* Create/remove NULL terminated attribute list */ | ||
| 127 | static inline int | ||
| 128 | sysdev_create_files(struct sys_device *d, struct sysdev_attribute **a) | ||
| 129 | { | ||
| 130 | return sysfs_create_files(&d->kobj, (const struct attribute **)a); | ||
| 131 | } | ||
| 132 | |||
| 133 | static inline void | ||
| 134 | sysdev_remove_files(struct sys_device *d, struct sysdev_attribute **a) | ||
| 135 | { | ||
| 136 | return sysfs_remove_files(&d->kobj, (const struct attribute **)a); | ||
| 137 | } | ||
| 138 | |||
| 122 | struct sysdev_ext_attribute { | 139 | struct sysdev_ext_attribute { |
| 123 | struct sysdev_attribute attr; | 140 | struct sysdev_attribute attr; |
| 124 | void *var; | 141 | void *var; |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index cfa83083a2d4..1885d21b0c80 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
| @@ -15,10 +15,12 @@ | |||
| 15 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
| 16 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
| 17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
| 18 | #include <linux/lockdep.h> | ||
| 18 | #include <asm/atomic.h> | 19 | #include <asm/atomic.h> |
| 19 | 20 | ||
| 20 | struct kobject; | 21 | struct kobject; |
| 21 | struct module; | 22 | struct module; |
| 23 | enum kobj_ns_type; | ||
| 22 | 24 | ||
| 23 | /* FIXME | 25 | /* FIXME |
| 24 | * The *owner field is no longer used. | 26 | * The *owner field is no longer used. |
| @@ -29,8 +31,33 @@ struct attribute { | |||
| 29 | const char *name; | 31 | const char *name; |
| 30 | struct module *owner; | 32 | struct module *owner; |
| 31 | mode_t mode; | 33 | mode_t mode; |
| 34 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 35 | struct lock_class_key *key; | ||
| 36 | struct lock_class_key skey; | ||
| 37 | #endif | ||
| 32 | }; | 38 | }; |
| 33 | 39 | ||
| 40 | /** | ||
| 41 | * sysfs_attr_init - initialize a dynamically allocated sysfs attribute | ||
| 42 | * @attr: struct attribute to initialize | ||
| 43 | * | ||
| 44 | * Initialize a dynamically allocated struct attribute so we can | ||
| 45 | * make lockdep happy. This is a new requirement for attributes | ||
| 46 | * and initially this is only needed when lockdep is enabled. | ||
| 47 | * Lockdep gives a nice error when your attribute is added to | ||
| 48 | * sysfs if you don't have this. | ||
| 49 | */ | ||
| 50 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 51 | #define sysfs_attr_init(attr) \ | ||
| 52 | do { \ | ||
| 53 | static struct lock_class_key __key; \ | ||
| 54 | \ | ||
| 55 | (attr)->key = &__key; \ | ||
| 56 | } while(0) | ||
| 57 | #else | ||
| 58 | #define sysfs_attr_init(attr) do {} while(0) | ||
| 59 | #endif | ||
| 60 | |||
| 34 | struct attribute_group { | 61 | struct attribute_group { |
| 35 | const char *name; | 62 | const char *name; |
| 36 | mode_t (*is_visible)(struct kobject *, | 63 | mode_t (*is_visible)(struct kobject *, |
| @@ -74,6 +101,18 @@ struct bin_attribute { | |||
| 74 | struct vm_area_struct *vma); | 101 | struct vm_area_struct *vma); |
| 75 | }; | 102 | }; |
| 76 | 103 | ||
| 104 | /** | ||
| 105 | * sysfs_bin_attr_init - initialize a dynamically allocated bin_attribute | ||
| 106 | * @attr: struct bin_attribute to initialize | ||
| 107 | * | ||
| 108 | * Initialize a dynamically allocated struct bin_attribute so we | ||
| 109 | * can make lockdep happy. This is a new requirement for | ||
| 110 | * attributes and initially this is only needed when lockdep is | ||
| 111 | * enabled. Lockdep gives a nice error when your attribute is | ||
| 112 | * added to sysfs if you don't have this. | ||
| 113 | */ | ||
| 114 | #define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr) | ||
| 115 | |||
| 77 | struct sysfs_ops { | 116 | struct sysfs_ops { |
| 78 | ssize_t (*show)(struct kobject *, struct attribute *,char *); | 117 | ssize_t (*show)(struct kobject *, struct attribute *,char *); |
| 79 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); | 118 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); |
| @@ -94,9 +133,12 @@ int __must_check sysfs_move_dir(struct kobject *kobj, | |||
| 94 | 133 | ||
| 95 | int __must_check sysfs_create_file(struct kobject *kobj, | 134 | int __must_check sysfs_create_file(struct kobject *kobj, |
| 96 | const struct attribute *attr); | 135 | const struct attribute *attr); |
| 136 | int __must_check sysfs_create_files(struct kobject *kobj, | ||
| 137 | const struct attribute **attr); | ||
| 97 | int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, | 138 | int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, |
| 98 | mode_t mode); | 139 | mode_t mode); |
| 99 | void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); | 140 | void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); |
| 141 | void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); | ||
| 100 | 142 | ||
| 101 | int __must_check sysfs_create_bin_file(struct kobject *kobj, | 143 | int __must_check sysfs_create_bin_file(struct kobject *kobj, |
| 102 | const struct bin_attribute *attr); | 144 | const struct bin_attribute *attr); |
| @@ -110,6 +152,9 @@ int __must_check sysfs_create_link_nowarn(struct kobject *kobj, | |||
| 110 | const char *name); | 152 | const char *name); |
| 111 | void sysfs_remove_link(struct kobject *kobj, const char *name); | 153 | void sysfs_remove_link(struct kobject *kobj, const char *name); |
| 112 | 154 | ||
| 155 | int sysfs_rename_link(struct kobject *kobj, struct kobject *target, | ||
| 156 | const char *old_name, const char *new_name); | ||
| 157 | |||
| 113 | int __must_check sysfs_create_group(struct kobject *kobj, | 158 | int __must_check sysfs_create_group(struct kobject *kobj, |
| 114 | const struct attribute_group *grp); | 159 | const struct attribute_group *grp); |
| 115 | int sysfs_update_group(struct kobject *kobj, | 160 | int sysfs_update_group(struct kobject *kobj, |
| @@ -124,10 +169,14 @@ void sysfs_remove_file_from_group(struct kobject *kobj, | |||
| 124 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); | 169 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); |
| 125 | void sysfs_notify_dirent(struct sysfs_dirent *sd); | 170 | void sysfs_notify_dirent(struct sysfs_dirent *sd); |
| 126 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, | 171 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, |
| 172 | const void *ns, | ||
| 127 | const unsigned char *name); | 173 | const unsigned char *name); |
| 128 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); | 174 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); |
| 129 | void sysfs_put(struct sysfs_dirent *sd); | 175 | void sysfs_put(struct sysfs_dirent *sd); |
| 130 | void sysfs_printk_last_file(void); | 176 | void sysfs_printk_last_file(void); |
| 177 | |||
| 178 | void sysfs_exit_ns(enum kobj_ns_type type, const void *tag); | ||
| 179 | |||
| 131 | int __must_check sysfs_init(void); | 180 | int __must_check sysfs_init(void); |
| 132 | 181 | ||
| 133 | #else /* CONFIG_SYSFS */ | 182 | #else /* CONFIG_SYSFS */ |
| @@ -164,6 +213,12 @@ static inline int sysfs_create_file(struct kobject *kobj, | |||
| 164 | return 0; | 213 | return 0; |
| 165 | } | 214 | } |
| 166 | 215 | ||
| 216 | static inline int sysfs_create_files(struct kobject *kobj, | ||
| 217 | const struct attribute **attr) | ||
| 218 | { | ||
| 219 | return 0; | ||
| 220 | } | ||
| 221 | |||
| 167 | static inline int sysfs_chmod_file(struct kobject *kobj, | 222 | static inline int sysfs_chmod_file(struct kobject *kobj, |
| 168 | struct attribute *attr, mode_t mode) | 223 | struct attribute *attr, mode_t mode) |
| 169 | { | 224 | { |
| @@ -175,6 +230,11 @@ static inline void sysfs_remove_file(struct kobject *kobj, | |||
| 175 | { | 230 | { |
| 176 | } | 231 | } |
| 177 | 232 | ||
| 233 | static inline void sysfs_remove_files(struct kobject *kobj, | ||
| 234 | const struct attribute **attr) | ||
| 235 | { | ||
| 236 | } | ||
| 237 | |||
| 178 | static inline int sysfs_create_bin_file(struct kobject *kobj, | 238 | static inline int sysfs_create_bin_file(struct kobject *kobj, |
| 179 | const struct bin_attribute *attr) | 239 | const struct bin_attribute *attr) |
| 180 | { | 240 | { |
| @@ -203,6 +263,12 @@ static inline void sysfs_remove_link(struct kobject *kobj, const char *name) | |||
| 203 | { | 263 | { |
| 204 | } | 264 | } |
| 205 | 265 | ||
| 266 | static inline int sysfs_rename_link(struct kobject *k, struct kobject *t, | ||
| 267 | const char *old_name, const char *new_name) | ||
| 268 | { | ||
| 269 | return 0; | ||
| 270 | } | ||
| 271 | |||
| 206 | static inline int sysfs_create_group(struct kobject *kobj, | 272 | static inline int sysfs_create_group(struct kobject *kobj, |
| 207 | const struct attribute_group *grp) | 273 | const struct attribute_group *grp) |
| 208 | { | 274 | { |
| @@ -240,6 +306,7 @@ static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) | |||
| 240 | } | 306 | } |
| 241 | static inline | 307 | static inline |
| 242 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, | 308 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, |
| 309 | const void *ns, | ||
| 243 | const unsigned char *name) | 310 | const unsigned char *name) |
| 244 | { | 311 | { |
| 245 | return NULL; | 312 | return NULL; |
| @@ -252,6 +319,10 @@ static inline void sysfs_put(struct sysfs_dirent *sd) | |||
| 252 | { | 319 | { |
| 253 | } | 320 | } |
| 254 | 321 | ||
| 322 | static inline void sysfs_exit_ns(enum kobj_ns_type type, const void *tag) | ||
| 323 | { | ||
| 324 | } | ||
| 325 | |||
| 255 | static inline int __must_check sysfs_init(void) | 326 | static inline int __must_check sysfs_init(void) |
| 256 | { | 327 | { |
| 257 | return 0; | 328 | return 0; |
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index 99adcdc0d3ca..4496322e28dd 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h | |||
| @@ -39,41 +39,34 @@ struct sysrq_key_op { | |||
| 39 | 39 | ||
| 40 | #ifdef CONFIG_MAGIC_SYSRQ | 40 | #ifdef CONFIG_MAGIC_SYSRQ |
| 41 | 41 | ||
| 42 | extern int sysrq_on(void); | ||
| 43 | |||
| 44 | /* | ||
| 45 | * Do not use this one directly: | ||
| 46 | */ | ||
| 47 | extern int __sysrq_enabled; | ||
| 48 | |||
| 49 | /* Generic SysRq interface -- you may call it from any device driver, supplying | 42 | /* Generic SysRq interface -- you may call it from any device driver, supplying |
| 50 | * ASCII code of the key, pointer to registers and kbd/tty structs (if they | 43 | * ASCII code of the key, pointer to registers and kbd/tty structs (if they |
| 51 | * are available -- else NULL's). | 44 | * are available -- else NULL's). |
| 52 | */ | 45 | */ |
| 53 | 46 | ||
| 54 | void handle_sysrq(int key, struct tty_struct *tty); | 47 | void handle_sysrq(int key, struct tty_struct *tty); |
| 55 | void __handle_sysrq(int key, struct tty_struct *tty, int check_mask); | ||
| 56 | int register_sysrq_key(int key, struct sysrq_key_op *op); | 48 | int register_sysrq_key(int key, struct sysrq_key_op *op); |
| 57 | int unregister_sysrq_key(int key, struct sysrq_key_op *op); | 49 | int unregister_sysrq_key(int key, struct sysrq_key_op *op); |
| 58 | struct sysrq_key_op *__sysrq_get_key_op(int key); | 50 | struct sysrq_key_op *__sysrq_get_key_op(int key); |
| 59 | 51 | ||
| 52 | int sysrq_toggle_support(int enable_mask); | ||
| 53 | |||
| 60 | #else | 54 | #else |
| 61 | 55 | ||
| 62 | static inline int sysrq_on(void) | 56 | static inline void handle_sysrq(int key, struct tty_struct *tty) |
| 63 | { | 57 | { |
| 64 | return 0; | ||
| 65 | } | 58 | } |
| 66 | static inline int __reterr(void) | 59 | |
| 60 | static inline int register_sysrq_key(int key, struct sysrq_key_op *op) | ||
| 67 | { | 61 | { |
| 68 | return -EINVAL; | 62 | return -EINVAL; |
| 69 | } | 63 | } |
| 70 | static inline void handle_sysrq(int key, struct tty_struct *tty) | 64 | |
| 65 | static inline int unregister_sysrq_key(int key, struct sysrq_key_op *op) | ||
| 71 | { | 66 | { |
| 67 | return -EINVAL; | ||
| 72 | } | 68 | } |
| 73 | 69 | ||
| 74 | #define register_sysrq_key(ig,nore) __reterr() | ||
| 75 | #define unregister_sysrq_key(ig,nore) __reterr() | ||
| 76 | |||
| 77 | #endif | 70 | #endif |
| 78 | 71 | ||
| 79 | #endif /* _LINUX_SYSRQ_H */ | 72 | #endif /* _LINUX_SYSRQ_H */ |
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h index 3398f4553269..58de6edf751f 100644 --- a/include/linux/taskstats_kern.h +++ b/include/linux/taskstats_kern.h | |||
| @@ -9,16 +9,12 @@ | |||
| 9 | 9 | ||
| 10 | #include <linux/taskstats.h> | 10 | #include <linux/taskstats.h> |
| 11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | 13 | ||
| 13 | #ifdef CONFIG_TASKSTATS | 14 | #ifdef CONFIG_TASKSTATS |
| 14 | extern struct kmem_cache *taskstats_cache; | 15 | extern struct kmem_cache *taskstats_cache; |
| 15 | extern struct mutex taskstats_exit_mutex; | 16 | extern struct mutex taskstats_exit_mutex; |
| 16 | 17 | ||
| 17 | static inline void taskstats_tgid_init(struct signal_struct *sig) | ||
| 18 | { | ||
| 19 | sig->stats = NULL; | ||
| 20 | } | ||
| 21 | |||
| 22 | static inline void taskstats_tgid_free(struct signal_struct *sig) | 18 | static inline void taskstats_tgid_free(struct signal_struct *sig) |
| 23 | { | 19 | { |
| 24 | if (sig->stats) | 20 | if (sig->stats) |
| @@ -30,8 +26,6 @@ extern void taskstats_init_early(void); | |||
| 30 | #else | 26 | #else |
| 31 | static inline void taskstats_exit(struct task_struct *tsk, int group_dead) | 27 | static inline void taskstats_exit(struct task_struct *tsk, int group_dead) |
| 32 | {} | 28 | {} |
| 33 | static inline void taskstats_tgid_init(struct signal_struct *sig) | ||
| 34 | {} | ||
| 35 | static inline void taskstats_tgid_free(struct signal_struct *sig) | 29 | static inline void taskstats_tgid_free(struct signal_struct *sig) |
| 36 | {} | 30 | {} |
| 37 | static inline void taskstats_init_early(void) | 31 | static inline void taskstats_init_early(void) |
diff --git a/include/linux/tca6416_keypad.h b/include/linux/tca6416_keypad.h new file mode 100644 index 000000000000..7bd266f3525c --- /dev/null +++ b/include/linux/tca6416_keypad.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * tca6416 keypad platform support | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Texas Instruments | ||
| 5 | * | ||
| 6 | * Author: Sriramakrishnan <srk@ti.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef _TCA6416_KEYS_H | ||
| 14 | #define _TCA6416_KEYS_H | ||
| 15 | |||
| 16 | #include <linux/types.h> | ||
| 17 | |||
| 18 | struct tca6416_button { | ||
| 19 | /* Configuration parameters */ | ||
| 20 | int code; /* input event code (KEY_*, SW_*) */ | ||
| 21 | int active_low; | ||
| 22 | int type; /* input event type (EV_KEY, EV_SW) */ | ||
| 23 | }; | ||
| 24 | |||
| 25 | struct tca6416_keys_platform_data { | ||
| 26 | struct tca6416_button *buttons; | ||
| 27 | int nbuttons; | ||
| 28 | unsigned int rep:1; /* enable input subsystem auto repeat */ | ||
| 29 | uint16_t pinmask; | ||
| 30 | uint16_t invert; | ||
| 31 | int irq_is_gpio; | ||
| 32 | int use_polling; /* use polling if Interrupt is not connected*/ | ||
| 33 | }; | ||
| 34 | #endif | ||
diff --git a/include/linux/tick.h b/include/linux/tick.h index d2ae79e21be3..b232ccc0ee29 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
| @@ -42,6 +42,7 @@ enum tick_nohz_mode { | |||
| 42 | * @idle_waketime: Time when the idle was interrupted | 42 | * @idle_waketime: Time when the idle was interrupted |
| 43 | * @idle_exittime: Time when the idle state was left | 43 | * @idle_exittime: Time when the idle state was left |
| 44 | * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped | 44 | * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped |
| 45 | * @iowait_sleeptime: Sum of the time slept in idle with sched tick stopped, with IO outstanding | ||
| 45 | * @sleep_length: Duration of the current idle sleep | 46 | * @sleep_length: Duration of the current idle sleep |
| 46 | * @do_timer_lst: CPU was the last one doing do_timer before going idle | 47 | * @do_timer_lst: CPU was the last one doing do_timer before going idle |
| 47 | */ | 48 | */ |
| @@ -60,7 +61,7 @@ struct tick_sched { | |||
| 60 | ktime_t idle_waketime; | 61 | ktime_t idle_waketime; |
| 61 | ktime_t idle_exittime; | 62 | ktime_t idle_exittime; |
| 62 | ktime_t idle_sleeptime; | 63 | ktime_t idle_sleeptime; |
| 63 | ktime_t idle_lastupdate; | 64 | ktime_t iowait_sleeptime; |
| 64 | ktime_t sleep_length; | 65 | ktime_t sleep_length; |
| 65 | unsigned long last_jiffies; | 66 | unsigned long last_jiffies; |
| 66 | unsigned long next_jiffies; | 67 | unsigned long next_jiffies; |
| @@ -124,6 +125,7 @@ extern void tick_nohz_stop_sched_tick(int inidle); | |||
| 124 | extern void tick_nohz_restart_sched_tick(void); | 125 | extern void tick_nohz_restart_sched_tick(void); |
| 125 | extern ktime_t tick_nohz_get_sleep_length(void); | 126 | extern ktime_t tick_nohz_get_sleep_length(void); |
| 126 | extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); | 127 | extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); |
| 128 | extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time); | ||
| 127 | # else | 129 | # else |
| 128 | static inline void tick_nohz_stop_sched_tick(int inidle) { } | 130 | static inline void tick_nohz_stop_sched_tick(int inidle) { } |
| 129 | static inline void tick_nohz_restart_sched_tick(void) { } | 131 | static inline void tick_nohz_restart_sched_tick(void) { } |
| @@ -134,6 +136,7 @@ static inline ktime_t tick_nohz_get_sleep_length(void) | |||
| 134 | return len; | 136 | return len; |
| 135 | } | 137 | } |
| 136 | static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; } | 138 | static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; } |
| 139 | static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; } | ||
| 137 | # endif /* !NO_HZ */ | 140 | # endif /* !NO_HZ */ |
| 138 | 141 | ||
| 139 | #endif | 142 | #endif |
diff --git a/include/linux/time.h b/include/linux/time.h index 6e026e45a179..ea3559f0b3f2 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -150,7 +150,6 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | |||
| 150 | extern int timekeeping_valid_for_hres(void); | 150 | extern int timekeeping_valid_for_hres(void); |
| 151 | extern u64 timekeeping_max_deferment(void); | 151 | extern u64 timekeeping_max_deferment(void); |
| 152 | extern void update_wall_time(void); | 152 | extern void update_wall_time(void); |
| 153 | extern void update_xtime_cache(u64 nsec); | ||
| 154 | extern void timekeeping_leap_insert(int leapsecond); | 153 | extern void timekeeping_leap_insert(int leapsecond); |
| 155 | 154 | ||
| 156 | struct tms; | 155 | struct tms; |
diff --git a/include/linux/timer.h b/include/linux/timer.h index a2d1eb6cb3f0..ea965b857a50 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
| @@ -10,13 +10,19 @@ | |||
| 10 | struct tvec_base; | 10 | struct tvec_base; |
| 11 | 11 | ||
| 12 | struct timer_list { | 12 | struct timer_list { |
| 13 | /* | ||
| 14 | * All fields that change during normal runtime grouped to the | ||
| 15 | * same cacheline | ||
| 16 | */ | ||
| 13 | struct list_head entry; | 17 | struct list_head entry; |
| 14 | unsigned long expires; | 18 | unsigned long expires; |
| 19 | struct tvec_base *base; | ||
| 15 | 20 | ||
| 16 | void (*function)(unsigned long); | 21 | void (*function)(unsigned long); |
| 17 | unsigned long data; | 22 | unsigned long data; |
| 18 | 23 | ||
| 19 | struct tvec_base *base; | 24 | int slack; |
| 25 | |||
| 20 | #ifdef CONFIG_TIMER_STATS | 26 | #ifdef CONFIG_TIMER_STATS |
| 21 | void *start_site; | 27 | void *start_site; |
| 22 | char start_comm[16]; | 28 | char start_comm[16]; |
| @@ -165,6 +171,8 @@ extern int mod_timer(struct timer_list *timer, unsigned long expires); | |||
| 165 | extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); | 171 | extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); |
| 166 | extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires); | 172 | extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires); |
| 167 | 173 | ||
| 174 | extern void set_timer_slack(struct timer_list *time, int slack_hz); | ||
| 175 | |||
| 168 | #define TIMER_NOT_PINNED 0 | 176 | #define TIMER_NOT_PINNED 0 |
| 169 | #define TIMER_PINNED 1 | 177 | #define TIMER_PINNED 1 |
| 170 | /* | 178 | /* |
diff --git a/include/linux/timex.h b/include/linux/timex.h index 7a082b32d8e1..32d852f8cbe4 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
| @@ -232,13 +232,11 @@ struct timex { | |||
| 232 | */ | 232 | */ |
| 233 | extern unsigned long tick_usec; /* USER_HZ period (usec) */ | 233 | extern unsigned long tick_usec; /* USER_HZ period (usec) */ |
| 234 | extern unsigned long tick_nsec; /* ACTHZ period (nsec) */ | 234 | extern unsigned long tick_nsec; /* ACTHZ period (nsec) */ |
| 235 | extern int tickadj; /* amount of adjustment per tick */ | ||
| 236 | 235 | ||
| 237 | /* | 236 | /* |
| 238 | * phase-lock loop variables | 237 | * phase-lock loop variables |
| 239 | */ | 238 | */ |
| 240 | extern int time_status; /* clock synchronization status bits */ | 239 | extern int time_status; /* clock synchronization status bits */ |
| 241 | extern long time_adjust; /* The amount of adjtime left */ | ||
| 242 | 240 | ||
| 243 | extern void ntp_init(void); | 241 | extern void ntp_init(void); |
| 244 | extern void ntp_clear(void); | 242 | extern void ntp_clear(void); |
| @@ -271,9 +269,6 @@ extern void second_overflow(void); | |||
| 271 | extern void update_ntp_one_tick(void); | 269 | extern void update_ntp_one_tick(void); |
| 272 | extern int do_adjtimex(struct timex *); | 270 | extern int do_adjtimex(struct timex *); |
| 273 | 271 | ||
| 274 | /* Don't use! Compatibility define for existing users. */ | ||
| 275 | #define tickadj (500/HZ ? : 1) | ||
| 276 | |||
| 277 | int read_current_timer(unsigned long *timer_val); | 272 | int read_current_timer(unsigned long *timer_val); |
| 278 | 273 | ||
| 279 | /* The clock frequency of the i8253/i8254 PIT */ | 274 | /* The clock frequency of the i8253/i8254 PIT */ |
diff --git a/include/linux/tipc.h b/include/linux/tipc.h index 3d92396639de..181c8d0e6f73 100644 --- a/include/linux/tipc.h +++ b/include/linux/tipc.h | |||
| @@ -107,7 +107,7 @@ static inline unsigned int tipc_node(__u32 addr) | |||
| 107 | * Message importance levels | 107 | * Message importance levels |
| 108 | */ | 108 | */ |
| 109 | 109 | ||
| 110 | #define TIPC_LOW_IMPORTANCE 0 /* default */ | 110 | #define TIPC_LOW_IMPORTANCE 0 |
| 111 | #define TIPC_MEDIUM_IMPORTANCE 1 | 111 | #define TIPC_MEDIUM_IMPORTANCE 1 |
| 112 | #define TIPC_HIGH_IMPORTANCE 2 | 112 | #define TIPC_HIGH_IMPORTANCE 2 |
| 113 | #define TIPC_CRITICAL_IMPORTANCE 3 | 113 | #define TIPC_CRITICAL_IMPORTANCE 3 |
| @@ -127,23 +127,17 @@ static inline unsigned int tipc_node(__u32 addr) | |||
| 127 | * TIPC topology subscription service definitions | 127 | * TIPC topology subscription service definitions |
| 128 | */ | 128 | */ |
| 129 | 129 | ||
| 130 | #define TIPC_SUB_PORTS 0x01 /* filter for port availability */ | 130 | #define TIPC_SUB_SERVICE 0x00 /* Filter for service availability */ |
| 131 | #define TIPC_SUB_SERVICE 0x02 /* filter for service availability */ | 131 | #define TIPC_SUB_PORTS 0x01 /* Filter for port availability */ |
| 132 | #define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */ | 132 | #define TIPC_SUB_CANCEL 0x04 /* Cancel a subscription */ |
| 133 | #if 0 | ||
| 134 | /* The following filter options are not currently implemented */ | ||
| 135 | #define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */ | ||
| 136 | #define TIPC_SUB_NO_UNBIND_EVTS 0x08 /* filter out "withdraw" events */ | ||
| 137 | #define TIPC_SUB_SINGLE_EVT 0x10 /* expire after first event */ | ||
| 138 | #endif | ||
| 139 | 133 | ||
| 140 | #define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */ | 134 | #define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */ |
| 141 | 135 | ||
| 142 | struct tipc_subscr { | 136 | struct tipc_subscr { |
| 143 | struct tipc_name_seq seq; /* name sequence of interest */ | 137 | struct tipc_name_seq seq; /* NBO. Name sequence of interest */ |
| 144 | __u32 timeout; /* subscription duration (in ms) */ | 138 | __u32 timeout; /* NBO. Subscription duration (in ms) */ |
| 145 | __u32 filter; /* bitmask of filter options */ | 139 | __u32 filter; /* NBO. Bitmask of filter options */ |
| 146 | char usr_handle[8]; /* available for subscriber use */ | 140 | char usr_handle[8]; /* Opaque. Available for subscriber use */ |
| 147 | }; | 141 | }; |
| 148 | 142 | ||
| 149 | #define TIPC_PUBLISHED 1 /* publication event */ | 143 | #define TIPC_PUBLISHED 1 /* publication event */ |
| @@ -151,11 +145,11 @@ struct tipc_subscr { | |||
| 151 | #define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */ | 145 | #define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */ |
| 152 | 146 | ||
| 153 | struct tipc_event { | 147 | struct tipc_event { |
| 154 | __u32 event; /* event type */ | 148 | __u32 event; /* NBO. Event type, as defined above */ |
| 155 | __u32 found_lower; /* matching name seq instances */ | 149 | __u32 found_lower; /* NBO. Matching name seq instances */ |
| 156 | __u32 found_upper; /* " " " " */ | 150 | __u32 found_upper; /* " " " " " */ |
| 157 | struct tipc_portid port; /* associated port */ | 151 | struct tipc_portid port; /* NBO. Associated port */ |
| 158 | struct tipc_subscr s; /* associated subscription */ | 152 | struct tipc_subscr s; /* Original, associated subscription */ |
| 159 | }; | 153 | }; |
| 160 | 154 | ||
| 161 | /* | 155 | /* |
| @@ -188,7 +182,7 @@ struct sockaddr_tipc { | |||
| 188 | struct tipc_name_seq nameseq; | 182 | struct tipc_name_seq nameseq; |
| 189 | struct { | 183 | struct { |
| 190 | struct tipc_name name; | 184 | struct tipc_name name; |
| 191 | __u32 domain; /* 0: own zone */ | 185 | __u32 domain; |
| 192 | } name; | 186 | } name; |
| 193 | } addr; | 187 | } addr; |
| 194 | }; | 188 | }; |
| @@ -206,7 +200,7 @@ struct sockaddr_tipc { | |||
| 206 | */ | 200 | */ |
| 207 | 201 | ||
| 208 | #define TIPC_IMPORTANCE 127 /* Default: TIPC_LOW_IMPORTANCE */ | 202 | #define TIPC_IMPORTANCE 127 /* Default: TIPC_LOW_IMPORTANCE */ |
| 209 | #define TIPC_SRC_DROPPABLE 128 /* Default: 0 (resend congested msg) */ | 203 | #define TIPC_SRC_DROPPABLE 128 /* Default: based on socket type */ |
| 210 | #define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */ | 204 | #define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */ |
| 211 | #define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */ | 205 | #define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */ |
| 212 | #define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */ | 206 | #define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */ |
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h index 2bc6fa4adeb5..9cde86c32412 100644 --- a/include/linux/tipc_config.h +++ b/include/linux/tipc_config.h | |||
| @@ -74,6 +74,7 @@ | |||
| 74 | #define TIPC_CMD_SHOW_NAME_TABLE 0x0005 /* tx name_tbl_query, rx ultra_string */ | 74 | #define TIPC_CMD_SHOW_NAME_TABLE 0x0005 /* tx name_tbl_query, rx ultra_string */ |
| 75 | #define TIPC_CMD_SHOW_PORTS 0x0006 /* tx none, rx ultra_string */ | 75 | #define TIPC_CMD_SHOW_PORTS 0x0006 /* tx none, rx ultra_string */ |
| 76 | #define TIPC_CMD_SHOW_LINK_STATS 0x000B /* tx link_name, rx ultra_string */ | 76 | #define TIPC_CMD_SHOW_LINK_STATS 0x000B /* tx link_name, rx ultra_string */ |
| 77 | #define TIPC_CMD_SHOW_STATS 0x000F /* tx unsigned, rx ultra_string */ | ||
| 77 | 78 | ||
| 78 | #if 0 | 79 | #if 0 |
| 79 | #define TIPC_CMD_SHOW_PORT_STATS 0x0008 /* tx port_ref, rx ultra_string */ | 80 | #define TIPC_CMD_SHOW_PORT_STATS 0x0008 /* tx port_ref, rx ultra_string */ |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index f59604ed0ec6..1d85f9a6a199 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -33,6 +33,65 @@ struct tracepoint { | |||
| 33 | * Keep in sync with vmlinux.lds.h. | 33 | * Keep in sync with vmlinux.lds.h. |
| 34 | */ | 34 | */ |
| 35 | 35 | ||
| 36 | /* | ||
| 37 | * Connect a probe to a tracepoint. | ||
| 38 | * Internal API, should not be used directly. | ||
| 39 | */ | ||
| 40 | extern int tracepoint_probe_register(const char *name, void *probe); | ||
| 41 | |||
| 42 | /* | ||
| 43 | * Disconnect a probe from a tracepoint. | ||
| 44 | * Internal API, should not be used directly. | ||
| 45 | */ | ||
| 46 | extern int tracepoint_probe_unregister(const char *name, void *probe); | ||
| 47 | |||
| 48 | extern int tracepoint_probe_register_noupdate(const char *name, void *probe); | ||
| 49 | extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe); | ||
| 50 | extern void tracepoint_probe_update_all(void); | ||
| 51 | |||
| 52 | struct tracepoint_iter { | ||
| 53 | struct module *module; | ||
| 54 | struct tracepoint *tracepoint; | ||
| 55 | }; | ||
| 56 | |||
| 57 | extern void tracepoint_iter_start(struct tracepoint_iter *iter); | ||
| 58 | extern void tracepoint_iter_next(struct tracepoint_iter *iter); | ||
| 59 | extern void tracepoint_iter_stop(struct tracepoint_iter *iter); | ||
| 60 | extern void tracepoint_iter_reset(struct tracepoint_iter *iter); | ||
| 61 | extern int tracepoint_get_iter_range(struct tracepoint **tracepoint, | ||
| 62 | struct tracepoint *begin, struct tracepoint *end); | ||
| 63 | |||
| 64 | /* | ||
| 65 | * tracepoint_synchronize_unregister must be called between the last tracepoint | ||
| 66 | * probe unregistration and the end of module exit to make sure there is no | ||
| 67 | * caller executing a probe when it is freed. | ||
| 68 | */ | ||
| 69 | static inline void tracepoint_synchronize_unregister(void) | ||
| 70 | { | ||
| 71 | synchronize_sched(); | ||
| 72 | } | ||
| 73 | |||
| 74 | #define PARAMS(args...) args | ||
| 75 | |||
| 76 | #ifdef CONFIG_TRACEPOINTS | ||
| 77 | extern void tracepoint_update_probe_range(struct tracepoint *begin, | ||
| 78 | struct tracepoint *end); | ||
| 79 | #else | ||
| 80 | static inline void tracepoint_update_probe_range(struct tracepoint *begin, | ||
| 81 | struct tracepoint *end) | ||
| 82 | { } | ||
| 83 | #endif /* CONFIG_TRACEPOINTS */ | ||
| 84 | |||
| 85 | #endif /* _LINUX_TRACEPOINT_H */ | ||
| 86 | |||
| 87 | /* | ||
| 88 | * Note: we keep the TRACE_EVENT and DECLARE_TRACE outside the include | ||
| 89 | * file ifdef protection. | ||
| 90 | * This is due to the way trace events work. If a file includes two | ||
| 91 | * trace event headers under one "CREATE_TRACE_POINTS" the first include | ||
| 92 | * will override the TRACE_EVENT and break the second include. | ||
| 93 | */ | ||
| 94 | |||
| 36 | #ifndef DECLARE_TRACE | 95 | #ifndef DECLARE_TRACE |
| 37 | 96 | ||
| 38 | #define TP_PROTO(args...) args | 97 | #define TP_PROTO(args...) args |
| @@ -49,7 +108,7 @@ struct tracepoint { | |||
| 49 | void **it_func; \ | 108 | void **it_func; \ |
| 50 | \ | 109 | \ |
| 51 | rcu_read_lock_sched_notrace(); \ | 110 | rcu_read_lock_sched_notrace(); \ |
| 52 | it_func = rcu_dereference((tp)->funcs); \ | 111 | it_func = rcu_dereference_sched((tp)->funcs); \ |
| 53 | if (it_func) { \ | 112 | if (it_func) { \ |
| 54 | do { \ | 113 | do { \ |
| 55 | ((void(*)(proto))(*it_func))(args); \ | 114 | ((void(*)(proto))(*it_func))(args); \ |
| @@ -96,9 +155,6 @@ struct tracepoint { | |||
| 96 | #define EXPORT_TRACEPOINT_SYMBOL(name) \ | 155 | #define EXPORT_TRACEPOINT_SYMBOL(name) \ |
| 97 | EXPORT_SYMBOL(__tracepoint_##name) | 156 | EXPORT_SYMBOL(__tracepoint_##name) |
| 98 | 157 | ||
| 99 | extern void tracepoint_update_probe_range(struct tracepoint *begin, | ||
| 100 | struct tracepoint *end); | ||
| 101 | |||
| 102 | #else /* !CONFIG_TRACEPOINTS */ | 158 | #else /* !CONFIG_TRACEPOINTS */ |
| 103 | #define DECLARE_TRACE(name, proto, args) \ | 159 | #define DECLARE_TRACE(name, proto, args) \ |
| 104 | static inline void _do_trace_##name(struct tracepoint *tp, proto) \ | 160 | static inline void _do_trace_##name(struct tracepoint *tp, proto) \ |
| @@ -119,61 +175,9 @@ extern void tracepoint_update_probe_range(struct tracepoint *begin, | |||
| 119 | #define EXPORT_TRACEPOINT_SYMBOL_GPL(name) | 175 | #define EXPORT_TRACEPOINT_SYMBOL_GPL(name) |
| 120 | #define EXPORT_TRACEPOINT_SYMBOL(name) | 176 | #define EXPORT_TRACEPOINT_SYMBOL(name) |
| 121 | 177 | ||
| 122 | static inline void tracepoint_update_probe_range(struct tracepoint *begin, | ||
| 123 | struct tracepoint *end) | ||
| 124 | { } | ||
| 125 | #endif /* CONFIG_TRACEPOINTS */ | 178 | #endif /* CONFIG_TRACEPOINTS */ |
| 126 | #endif /* DECLARE_TRACE */ | 179 | #endif /* DECLARE_TRACE */ |
| 127 | 180 | ||
| 128 | /* | ||
| 129 | * Connect a probe to a tracepoint. | ||
| 130 | * Internal API, should not be used directly. | ||
| 131 | */ | ||
| 132 | extern int tracepoint_probe_register(const char *name, void *probe); | ||
| 133 | |||
| 134 | /* | ||
| 135 | * Disconnect a probe from a tracepoint. | ||
| 136 | * Internal API, should not be used directly. | ||
| 137 | */ | ||
| 138 | extern int tracepoint_probe_unregister(const char *name, void *probe); | ||
| 139 | |||
| 140 | extern int tracepoint_probe_register_noupdate(const char *name, void *probe); | ||
| 141 | extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe); | ||
| 142 | extern void tracepoint_probe_update_all(void); | ||
| 143 | |||
| 144 | struct tracepoint_iter { | ||
| 145 | struct module *module; | ||
| 146 | struct tracepoint *tracepoint; | ||
| 147 | }; | ||
| 148 | |||
| 149 | extern void tracepoint_iter_start(struct tracepoint_iter *iter); | ||
| 150 | extern void tracepoint_iter_next(struct tracepoint_iter *iter); | ||
| 151 | extern void tracepoint_iter_stop(struct tracepoint_iter *iter); | ||
| 152 | extern void tracepoint_iter_reset(struct tracepoint_iter *iter); | ||
| 153 | extern int tracepoint_get_iter_range(struct tracepoint **tracepoint, | ||
| 154 | struct tracepoint *begin, struct tracepoint *end); | ||
| 155 | |||
| 156 | /* | ||
| 157 | * tracepoint_synchronize_unregister must be called between the last tracepoint | ||
| 158 | * probe unregistration and the end of module exit to make sure there is no | ||
| 159 | * caller executing a probe when it is freed. | ||
| 160 | */ | ||
| 161 | static inline void tracepoint_synchronize_unregister(void) | ||
| 162 | { | ||
| 163 | synchronize_sched(); | ||
| 164 | } | ||
| 165 | |||
| 166 | #define PARAMS(args...) args | ||
| 167 | |||
| 168 | #endif /* _LINUX_TRACEPOINT_H */ | ||
| 169 | |||
| 170 | /* | ||
| 171 | * Note: we keep the TRACE_EVENT outside the include file ifdef protection. | ||
| 172 | * This is due to the way trace events work. If a file includes two | ||
| 173 | * trace event headers under one "CREATE_TRACE_POINTS" the first include | ||
| 174 | * will override the TRACE_EVENT and break the second include. | ||
| 175 | */ | ||
| 176 | |||
| 177 | #ifndef TRACE_EVENT | 181 | #ifndef TRACE_EVENT |
| 178 | /* | 182 | /* |
| 179 | * For use with the TRACE_EVENT macro: | 183 | * For use with the TRACE_EVENT macro: |
diff --git a/include/linux/tty.h b/include/linux/tty.h index d96e5882f129..bb44fa9ae135 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | */ | 23 | */ |
| 24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ | 24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ |
| 25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ | 25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ |
| 26 | #define NR_LDISCS 20 | 26 | #define NR_LDISCS 21 |
| 27 | 27 | ||
| 28 | /* line disciplines */ | 28 | /* line disciplines */ |
| 29 | #define N_TTY 0 | 29 | #define N_TTY 0 |
| @@ -46,8 +46,8 @@ | |||
| 46 | #define N_GIGASET_M101 16 /* Siemens Gigaset M101 serial DECT adapter */ | 46 | #define N_GIGASET_M101 16 /* Siemens Gigaset M101 serial DECT adapter */ |
| 47 | #define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */ | 47 | #define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */ |
| 48 | #define N_PPS 18 /* Pulse per Second */ | 48 | #define N_PPS 18 /* Pulse per Second */ |
| 49 | |||
| 50 | #define N_V253 19 /* Codec control over voice modem */ | 49 | #define N_V253 19 /* Codec control over voice modem */ |
| 50 | #define N_CAIF 20 /* CAIF protocol for talking to modems */ | ||
| 51 | 51 | ||
| 52 | /* | 52 | /* |
| 53 | * This character is the same as _POSIX_VDISABLE: it cannot be used as | 53 | * This character is the same as _POSIX_VDISABLE: it cannot be used as |
| @@ -70,12 +70,13 @@ struct tty_buffer { | |||
| 70 | 70 | ||
| 71 | /* | 71 | /* |
| 72 | * We default to dicing tty buffer allocations to this many characters | 72 | * We default to dicing tty buffer allocations to this many characters |
| 73 | * in order to avoid multiple page allocations. We assume tty_buffer itself | 73 | * in order to avoid multiple page allocations. We know the size of |
| 74 | * is under 256 bytes. See tty_buffer_find for the allocation logic this | 74 | * tty_buffer itself but it must also be taken into account that the |
| 75 | * must match | 75 | * the buffer is 256 byte aligned. See tty_buffer_find for the allocation |
| 76 | * logic this must match | ||
| 76 | */ | 77 | */ |
| 77 | 78 | ||
| 78 | #define TTY_BUFFER_PAGE ((PAGE_SIZE - 256) / 2) | 79 | #define TTY_BUFFER_PAGE (((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~0xFF) |
| 79 | 80 | ||
| 80 | 81 | ||
| 81 | struct tty_bufhead { | 82 | struct tty_bufhead { |
| @@ -223,6 +224,7 @@ struct tty_port { | |||
| 223 | wait_queue_head_t close_wait; /* Close waiters */ | 224 | wait_queue_head_t close_wait; /* Close waiters */ |
| 224 | wait_queue_head_t delta_msr_wait; /* Modem status change */ | 225 | wait_queue_head_t delta_msr_wait; /* Modem status change */ |
| 225 | unsigned long flags; /* TTY flags ASY_*/ | 226 | unsigned long flags; /* TTY flags ASY_*/ |
| 227 | unsigned char console:1; /* port is a console */ | ||
| 226 | struct mutex mutex; /* Locking */ | 228 | struct mutex mutex; /* Locking */ |
| 227 | struct mutex buf_mutex; /* Buffer alloc lock */ | 229 | struct mutex buf_mutex; /* Buffer alloc lock */ |
| 228 | unsigned char *xmit_buf; /* Optional buffer */ | 230 | unsigned char *xmit_buf; /* Optional buffer */ |
| @@ -514,6 +516,7 @@ extern void tty_ldisc_enable(struct tty_struct *tty); | |||
| 514 | 516 | ||
| 515 | /* n_tty.c */ | 517 | /* n_tty.c */ |
| 516 | extern struct tty_ldisc_ops tty_ldisc_N_TTY; | 518 | extern struct tty_ldisc_ops tty_ldisc_N_TTY; |
| 519 | extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops); | ||
| 517 | 520 | ||
| 518 | /* tty_audit.c */ | 521 | /* tty_audit.c */ |
| 519 | #ifdef CONFIG_AUDIT | 522 | #ifdef CONFIG_AUDIT |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 0c4ee9b88f85..526d66f066a3 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
| @@ -99,6 +99,12 @@ | |||
| 99 | * cease I/O to the tty driver. Can sleep. The driver should | 99 | * cease I/O to the tty driver. Can sleep. The driver should |
| 100 | * seek to perform this action quickly but should wait until | 100 | * seek to perform this action quickly but should wait until |
| 101 | * any pending driver I/O is completed. | 101 | * any pending driver I/O is completed. |
| 102 | * | ||
| 103 | * void (*dcd_change)(struct tty_struct *tty, unsigned int status, | ||
| 104 | * struct timespec *ts) | ||
| 105 | * | ||
| 106 | * Tells the discipline that the DCD pin has changed its status and | ||
| 107 | * the relative timestamp. Pointer ts can be NULL. | ||
| 102 | */ | 108 | */ |
| 103 | 109 | ||
| 104 | #include <linux/fs.h> | 110 | #include <linux/fs.h> |
| @@ -136,6 +142,8 @@ struct tty_ldisc_ops { | |||
| 136 | void (*receive_buf)(struct tty_struct *, const unsigned char *cp, | 142 | void (*receive_buf)(struct tty_struct *, const unsigned char *cp, |
| 137 | char *fp, int count); | 143 | char *fp, int count); |
| 138 | void (*write_wakeup)(struct tty_struct *); | 144 | void (*write_wakeup)(struct tty_struct *); |
| 145 | void (*dcd_change)(struct tty_struct *, unsigned int, | ||
| 146 | struct timespec *); | ||
| 139 | 147 | ||
| 140 | struct module *owner; | 148 | struct module *owner; |
| 141 | 149 | ||
diff --git a/include/linux/types.h b/include/linux/types.h index c42724f8c802..23d237a075e2 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
| @@ -188,12 +188,12 @@ typedef u32 phys_addr_t; | |||
| 188 | typedef phys_addr_t resource_size_t; | 188 | typedef phys_addr_t resource_size_t; |
| 189 | 189 | ||
| 190 | typedef struct { | 190 | typedef struct { |
| 191 | volatile int counter; | 191 | int counter; |
| 192 | } atomic_t; | 192 | } atomic_t; |
| 193 | 193 | ||
| 194 | #ifdef CONFIG_64BIT | 194 | #ifdef CONFIG_64BIT |
| 195 | typedef struct { | 195 | typedef struct { |
| 196 | volatile long counter; | 196 | long counter; |
| 197 | } atomic64_t; | 197 | } atomic64_t; |
| 198 | #endif | 198 | #endif |
| 199 | 199 | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index 3492abf82e75..d5922a877994 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -45,27 +45,14 @@ struct wusb_dev; | |||
| 45 | 45 | ||
| 46 | struct ep_device; | 46 | struct ep_device; |
| 47 | 47 | ||
| 48 | /* For SS devices */ | ||
| 49 | /** | ||
| 50 | * struct usb_host_ss_ep_comp - Valid for SuperSpeed devices only | ||
| 51 | * @desc: endpoint companion descriptor, wMaxPacketSize in native byteorder | ||
| 52 | * @extra: descriptors following this endpoint companion descriptor | ||
| 53 | * @extralen: how many bytes of "extra" are valid | ||
| 54 | */ | ||
| 55 | struct usb_host_ss_ep_comp { | ||
| 56 | struct usb_ss_ep_comp_descriptor desc; | ||
| 57 | unsigned char *extra; /* Extra descriptors */ | ||
| 58 | int extralen; | ||
| 59 | }; | ||
| 60 | |||
| 61 | /** | 48 | /** |
| 62 | * struct usb_host_endpoint - host-side endpoint descriptor and queue | 49 | * struct usb_host_endpoint - host-side endpoint descriptor and queue |
| 63 | * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder | 50 | * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder |
| 51 | * @ss_ep_comp: SuperSpeed companion descriptor for this endpoint | ||
| 64 | * @urb_list: urbs queued to this endpoint; maintained by usbcore | 52 | * @urb_list: urbs queued to this endpoint; maintained by usbcore |
| 65 | * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) | 53 | * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) |
| 66 | * with one or more transfer descriptors (TDs) per urb | 54 | * with one or more transfer descriptors (TDs) per urb |
| 67 | * @ep_dev: ep_device for sysfs info | 55 | * @ep_dev: ep_device for sysfs info |
| 68 | * @ss_ep_comp: companion descriptor information for this endpoint | ||
| 69 | * @extra: descriptors following this endpoint in the configuration | 56 | * @extra: descriptors following this endpoint in the configuration |
| 70 | * @extralen: how many bytes of "extra" are valid | 57 | * @extralen: how many bytes of "extra" are valid |
| 71 | * @enabled: URBs may be submitted to this endpoint | 58 | * @enabled: URBs may be submitted to this endpoint |
| @@ -74,11 +61,11 @@ struct usb_host_ss_ep_comp { | |||
| 74 | * descriptor within an active interface in a given USB configuration. | 61 | * descriptor within an active interface in a given USB configuration. |
| 75 | */ | 62 | */ |
| 76 | struct usb_host_endpoint { | 63 | struct usb_host_endpoint { |
| 77 | struct usb_endpoint_descriptor desc; | 64 | struct usb_endpoint_descriptor desc; |
| 65 | struct usb_ss_ep_comp_descriptor ss_ep_comp; | ||
| 78 | struct list_head urb_list; | 66 | struct list_head urb_list; |
| 79 | void *hcpriv; | 67 | void *hcpriv; |
| 80 | struct ep_device *ep_dev; /* For sysfs info */ | 68 | struct ep_device *ep_dev; /* For sysfs info */ |
| 81 | struct usb_host_ss_ep_comp *ss_ep_comp; /* For SS devices */ | ||
| 82 | 69 | ||
| 83 | unsigned char *extra; /* Extra descriptors */ | 70 | unsigned char *extra; /* Extra descriptors */ |
| 84 | int extralen; | 71 | int extralen; |
| @@ -109,8 +96,8 @@ enum usb_interface_condition { | |||
| 109 | /** | 96 | /** |
| 110 | * struct usb_interface - what usb device drivers talk to | 97 | * struct usb_interface - what usb device drivers talk to |
| 111 | * @altsetting: array of interface structures, one for each alternate | 98 | * @altsetting: array of interface structures, one for each alternate |
| 112 | * setting that may be selected. Each one includes a set of | 99 | * setting that may be selected. Each one includes a set of |
| 113 | * endpoint configurations. They will be in no particular order. | 100 | * endpoint configurations. They will be in no particular order. |
| 114 | * @cur_altsetting: the current altsetting. | 101 | * @cur_altsetting: the current altsetting. |
| 115 | * @num_altsetting: number of altsettings defined. | 102 | * @num_altsetting: number of altsettings defined. |
| 116 | * @intf_assoc: interface association descriptor | 103 | * @intf_assoc: interface association descriptor |
| @@ -197,8 +184,6 @@ struct usb_interface { | |||
| 197 | struct work_struct reset_ws; /* for resets in atomic context */ | 184 | struct work_struct reset_ws; /* for resets in atomic context */ |
| 198 | }; | 185 | }; |
| 199 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) | 186 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) |
| 200 | #define interface_to_usbdev(intf) \ | ||
| 201 | container_of(intf->dev.parent, struct usb_device, dev) | ||
| 202 | 187 | ||
| 203 | static inline void *usb_get_intfdata(struct usb_interface *intf) | 188 | static inline void *usb_get_intfdata(struct usb_interface *intf) |
| 204 | { | 189 | { |
| @@ -215,7 +200,7 @@ void usb_put_intf(struct usb_interface *intf); | |||
| 215 | 200 | ||
| 216 | /* this maximum is arbitrary */ | 201 | /* this maximum is arbitrary */ |
| 217 | #define USB_MAXINTERFACES 32 | 202 | #define USB_MAXINTERFACES 32 |
| 218 | #define USB_MAXIADS USB_MAXINTERFACES/2 | 203 | #define USB_MAXIADS (USB_MAXINTERFACES/2) |
| 219 | 204 | ||
| 220 | /** | 205 | /** |
| 221 | * struct usb_interface_cache - long-term representation of a device interface | 206 | * struct usb_interface_cache - long-term representation of a device interface |
| @@ -425,7 +410,6 @@ struct usb_tt; | |||
| 425 | * @connect_time: time device was first connected | 410 | * @connect_time: time device was first connected |
| 426 | * @do_remote_wakeup: remote wakeup should be enabled | 411 | * @do_remote_wakeup: remote wakeup should be enabled |
| 427 | * @reset_resume: needs reset instead of resume | 412 | * @reset_resume: needs reset instead of resume |
| 428 | * @autosuspend_disabled: autosuspend disabled by the user | ||
| 429 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB | 413 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB |
| 430 | * specific data for the device. | 414 | * specific data for the device. |
| 431 | * @slot_id: Slot ID assigned by xHCI | 415 | * @slot_id: Slot ID assigned by xHCI |
| @@ -436,7 +420,7 @@ struct usb_tt; | |||
| 436 | */ | 420 | */ |
| 437 | struct usb_device { | 421 | struct usb_device { |
| 438 | int devnum; | 422 | int devnum; |
| 439 | char devpath [16]; | 423 | char devpath[16]; |
| 440 | u32 route; | 424 | u32 route; |
| 441 | enum usb_device_state state; | 425 | enum usb_device_state state; |
| 442 | enum usb_device_speed speed; | 426 | enum usb_device_speed speed; |
| @@ -469,7 +453,7 @@ struct usb_device { | |||
| 469 | unsigned persist_enabled:1; | 453 | unsigned persist_enabled:1; |
| 470 | unsigned have_langid:1; | 454 | unsigned have_langid:1; |
| 471 | unsigned authorized:1; | 455 | unsigned authorized:1; |
| 472 | unsigned authenticated:1; | 456 | unsigned authenticated:1; |
| 473 | unsigned wusb:1; | 457 | unsigned wusb:1; |
| 474 | int string_langid; | 458 | int string_langid; |
| 475 | 459 | ||
| @@ -501,20 +485,24 @@ struct usb_device { | |||
| 501 | 485 | ||
| 502 | unsigned do_remote_wakeup:1; | 486 | unsigned do_remote_wakeup:1; |
| 503 | unsigned reset_resume:1; | 487 | unsigned reset_resume:1; |
| 504 | unsigned autosuspend_disabled:1; | ||
| 505 | #endif | 488 | #endif |
| 506 | struct wusb_dev *wusb_dev; | 489 | struct wusb_dev *wusb_dev; |
| 507 | int slot_id; | 490 | int slot_id; |
| 508 | }; | 491 | }; |
| 509 | #define to_usb_device(d) container_of(d, struct usb_device, dev) | 492 | #define to_usb_device(d) container_of(d, struct usb_device, dev) |
| 510 | 493 | ||
| 494 | static inline struct usb_device *interface_to_usbdev(struct usb_interface *intf) | ||
| 495 | { | ||
| 496 | return to_usb_device(intf->dev.parent); | ||
| 497 | } | ||
| 498 | |||
| 511 | extern struct usb_device *usb_get_dev(struct usb_device *dev); | 499 | extern struct usb_device *usb_get_dev(struct usb_device *dev); |
| 512 | extern void usb_put_dev(struct usb_device *dev); | 500 | extern void usb_put_dev(struct usb_device *dev); |
| 513 | 501 | ||
| 514 | /* USB device locking */ | 502 | /* USB device locking */ |
| 515 | #define usb_lock_device(udev) down(&(udev)->dev.sem) | 503 | #define usb_lock_device(udev) device_lock(&(udev)->dev) |
| 516 | #define usb_unlock_device(udev) up(&(udev)->dev.sem) | 504 | #define usb_unlock_device(udev) device_unlock(&(udev)->dev) |
| 517 | #define usb_trylock_device(udev) down_trylock(&(udev)->dev.sem) | 505 | #define usb_trylock_device(udev) device_trylock(&(udev)->dev) |
| 518 | extern int usb_lock_device_for_reset(struct usb_device *udev, | 506 | extern int usb_lock_device_for_reset(struct usb_device *udev, |
| 519 | const struct usb_interface *iface); | 507 | const struct usb_interface *iface); |
| 520 | 508 | ||
| @@ -522,12 +510,11 @@ extern int usb_lock_device_for_reset(struct usb_device *udev, | |||
| 522 | extern int usb_reset_device(struct usb_device *dev); | 510 | extern int usb_reset_device(struct usb_device *dev); |
| 523 | extern void usb_queue_reset_device(struct usb_interface *dev); | 511 | extern void usb_queue_reset_device(struct usb_interface *dev); |
| 524 | 512 | ||
| 525 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | ||
| 526 | 513 | ||
| 527 | /* USB autosuspend and autoresume */ | 514 | /* USB autosuspend and autoresume */ |
| 528 | #ifdef CONFIG_USB_SUSPEND | 515 | #ifdef CONFIG_USB_SUSPEND |
| 529 | extern int usb_enable_autosuspend(struct usb_device *udev); | 516 | extern void usb_enable_autosuspend(struct usb_device *udev); |
| 530 | extern int usb_disable_autosuspend(struct usb_device *udev); | 517 | extern void usb_disable_autosuspend(struct usb_device *udev); |
| 531 | 518 | ||
| 532 | extern int usb_autopm_get_interface(struct usb_interface *intf); | 519 | extern int usb_autopm_get_interface(struct usb_interface *intf); |
| 533 | extern void usb_autopm_put_interface(struct usb_interface *intf); | 520 | extern void usb_autopm_put_interface(struct usb_interface *intf); |
| @@ -572,6 +559,16 @@ static inline void usb_mark_last_busy(struct usb_device *udev) | |||
| 572 | /* for drivers using iso endpoints */ | 559 | /* for drivers using iso endpoints */ |
| 573 | extern int usb_get_current_frame_number(struct usb_device *usb_dev); | 560 | extern int usb_get_current_frame_number(struct usb_device *usb_dev); |
| 574 | 561 | ||
| 562 | /* Sets up a group of bulk endpoints to support multiple stream IDs. */ | ||
| 563 | extern int usb_alloc_streams(struct usb_interface *interface, | ||
| 564 | struct usb_host_endpoint **eps, unsigned int num_eps, | ||
| 565 | unsigned int num_streams, gfp_t mem_flags); | ||
| 566 | |||
| 567 | /* Reverts a group of bulk endpoints back to not using stream IDs. */ | ||
| 568 | extern void usb_free_streams(struct usb_interface *interface, | ||
| 569 | struct usb_host_endpoint **eps, unsigned int num_eps, | ||
| 570 | gfp_t mem_flags); | ||
| 571 | |||
| 575 | /* used these for multi-interface device registration */ | 572 | /* used these for multi-interface device registration */ |
| 576 | extern int usb_driver_claim_interface(struct usb_driver *driver, | 573 | extern int usb_driver_claim_interface(struct usb_driver *driver, |
| 577 | struct usb_interface *iface, void *priv); | 574 | struct usb_interface *iface, void *priv); |
| @@ -667,7 +664,7 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size) | |||
| 667 | * This macro is used to create a struct usb_device_id that matches a | 664 | * This macro is used to create a struct usb_device_id that matches a |
| 668 | * specific device. | 665 | * specific device. |
| 669 | */ | 666 | */ |
| 670 | #define USB_DEVICE(vend,prod) \ | 667 | #define USB_DEVICE(vend, prod) \ |
| 671 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, \ | 668 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, \ |
| 672 | .idVendor = (vend), \ | 669 | .idVendor = (vend), \ |
| 673 | .idProduct = (prod) | 670 | .idProduct = (prod) |
| @@ -958,17 +955,25 @@ extern int usb_disabled(void); | |||
| 958 | #define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame | 955 | #define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame |
| 959 | * ignored */ | 956 | * ignored */ |
| 960 | #define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ | 957 | #define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ |
| 961 | #define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */ | ||
| 962 | #define URB_NO_FSBR 0x0020 /* UHCI-specific */ | 958 | #define URB_NO_FSBR 0x0020 /* UHCI-specific */ |
| 963 | #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ | 959 | #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ |
| 964 | #define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt | 960 | #define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt |
| 965 | * needed */ | 961 | * needed */ |
| 966 | #define URB_FREE_BUFFER 0x0100 /* Free transfer buffer with the URB */ | 962 | #define URB_FREE_BUFFER 0x0100 /* Free transfer buffer with the URB */ |
| 967 | 963 | ||
| 964 | /* The following flags are used internally by usbcore and HCDs */ | ||
| 968 | #define URB_DIR_IN 0x0200 /* Transfer from device to host */ | 965 | #define URB_DIR_IN 0x0200 /* Transfer from device to host */ |
| 969 | #define URB_DIR_OUT 0 | 966 | #define URB_DIR_OUT 0 |
| 970 | #define URB_DIR_MASK URB_DIR_IN | 967 | #define URB_DIR_MASK URB_DIR_IN |
| 971 | 968 | ||
| 969 | #define URB_DMA_MAP_SINGLE 0x00010000 /* Non-scatter-gather mapping */ | ||
| 970 | #define URB_DMA_MAP_PAGE 0x00020000 /* HCD-unsupported S-G */ | ||
| 971 | #define URB_DMA_MAP_SG 0x00040000 /* HCD-supported S-G */ | ||
| 972 | #define URB_MAP_LOCAL 0x00080000 /* HCD-local-memory mapping */ | ||
| 973 | #define URB_SETUP_MAP_SINGLE 0x00100000 /* Setup packet DMA mapped */ | ||
| 974 | #define URB_SETUP_MAP_LOCAL 0x00200000 /* HCD-local setup packet */ | ||
| 975 | #define URB_DMA_SG_COMBINED 0x00400000 /* S-G entries were combined */ | ||
| 976 | |||
| 972 | struct usb_iso_packet_descriptor { | 977 | struct usb_iso_packet_descriptor { |
| 973 | unsigned int offset; | 978 | unsigned int offset; |
| 974 | unsigned int length; /* expected length */ | 979 | unsigned int length; /* expected length */ |
| @@ -1045,17 +1050,14 @@ typedef void (*usb_complete_t)(struct urb *); | |||
| 1045 | * @setup_packet: Only used for control transfers, this points to eight bytes | 1050 | * @setup_packet: Only used for control transfers, this points to eight bytes |
| 1046 | * of setup data. Control transfers always start by sending this data | 1051 | * of setup data. Control transfers always start by sending this data |
| 1047 | * to the device. Then transfer_buffer is read or written, if needed. | 1052 | * to the device. Then transfer_buffer is read or written, if needed. |
| 1048 | * @setup_dma: For control transfers with URB_NO_SETUP_DMA_MAP set, the | 1053 | * @setup_dma: DMA pointer for the setup packet. The caller must not use |
| 1049 | * device driver has provided this DMA address for the setup packet. | 1054 | * this field; setup_packet must point to a valid buffer. |
| 1050 | * The host controller driver should use this in preference to | ||
| 1051 | * setup_packet, but the HCD may chose to ignore the address if it must | ||
| 1052 | * copy the setup packet into internal structures. Therefore, setup_packet | ||
| 1053 | * must always point to a valid buffer. | ||
| 1054 | * @start_frame: Returns the initial frame for isochronous transfers. | 1055 | * @start_frame: Returns the initial frame for isochronous transfers. |
| 1055 | * @number_of_packets: Lists the number of ISO transfer buffers. | 1056 | * @number_of_packets: Lists the number of ISO transfer buffers. |
| 1056 | * @interval: Specifies the polling interval for interrupt or isochronous | 1057 | * @interval: Specifies the polling interval for interrupt or isochronous |
| 1057 | * transfers. The units are frames (milliseconds) for full and low | 1058 | * transfers. The units are frames (milliseconds) for full and low |
| 1058 | * speed devices, and microframes (1/8 millisecond) for highspeed ones. | 1059 | * speed devices, and microframes (1/8 millisecond) for highspeed |
| 1060 | * and SuperSpeed devices. | ||
| 1059 | * @error_count: Returns the number of ISO transfers that reported errors. | 1061 | * @error_count: Returns the number of ISO transfers that reported errors. |
| 1060 | * @context: For use in completion functions. This normally points to | 1062 | * @context: For use in completion functions. This normally points to |
| 1061 | * request-specific driver context. | 1063 | * request-specific driver context. |
| @@ -1081,13 +1083,14 @@ typedef void (*usb_complete_t)(struct urb *); | |||
| 1081 | * bounce buffer or talking to an IOMMU), | 1083 | * bounce buffer or talking to an IOMMU), |
| 1082 | * although they're cheap on commodity x86 and ppc hardware. | 1084 | * although they're cheap on commodity x86 and ppc hardware. |
| 1083 | * | 1085 | * |
| 1084 | * Alternatively, drivers may pass the URB_NO_xxx_DMA_MAP transfer flags, | 1086 | * Alternatively, drivers may pass the URB_NO_TRANSFER_DMA_MAP transfer flag, |
| 1085 | * which tell the host controller driver that no such mapping is needed since | 1087 | * which tells the host controller driver that no such mapping is needed for |
| 1088 | * the transfer_buffer since | ||
| 1086 | * the device driver is DMA-aware. For example, a device driver might | 1089 | * the device driver is DMA-aware. For example, a device driver might |
| 1087 | * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map(). | 1090 | * allocate a DMA buffer with usb_alloc_coherent() or call usb_buffer_map(). |
| 1088 | * When these transfer flags are provided, host controller drivers will | 1091 | * When this transfer flag is provided, host controller drivers will |
| 1089 | * attempt to use the dma addresses found in the transfer_dma and/or | 1092 | * attempt to use the dma address found in the transfer_dma |
| 1090 | * setup_dma fields rather than determining a dma address themselves. | 1093 | * field rather than determining a dma address themselves. |
| 1091 | * | 1094 | * |
| 1092 | * Note that transfer_buffer must still be set if the controller | 1095 | * Note that transfer_buffer must still be set if the controller |
| 1093 | * does not support DMA (as indicated by bus.uses_dma) and when talking | 1096 | * does not support DMA (as indicated by bus.uses_dma) and when talking |
| @@ -1110,11 +1113,9 @@ typedef void (*usb_complete_t)(struct urb *); | |||
| 1110 | * should always terminate with a short packet, even if it means adding an | 1113 | * should always terminate with a short packet, even if it means adding an |
| 1111 | * extra zero length packet. | 1114 | * extra zero length packet. |
| 1112 | * | 1115 | * |
| 1113 | * Control URBs must provide a setup_packet. The setup_packet and | 1116 | * Control URBs must provide a valid pointer in the setup_packet field. |
| 1114 | * transfer_buffer may each be mapped for DMA or not, independently of | 1117 | * Unlike the transfer_buffer, the setup_packet may not be mapped for DMA |
| 1115 | * the other. The transfer_flags bits URB_NO_TRANSFER_DMA_MAP and | 1118 | * beforehand. |
| 1116 | * URB_NO_SETUP_DMA_MAP indicate which buffers have already been mapped. | ||
| 1117 | * URB_NO_SETUP_DMA_MAP is ignored for non-control URBs. | ||
| 1118 | * | 1119 | * |
| 1119 | * Interrupt URBs must provide an interval, saying how often (in milliseconds | 1120 | * Interrupt URBs must provide an interval, saying how often (in milliseconds |
| 1120 | * or, for highspeed devices, 125 microsecond units) | 1121 | * or, for highspeed devices, 125 microsecond units) |
| @@ -1185,14 +1186,15 @@ struct urb { | |||
| 1185 | * current owner */ | 1186 | * current owner */ |
| 1186 | struct list_head anchor_list; /* the URB may be anchored */ | 1187 | struct list_head anchor_list; /* the URB may be anchored */ |
| 1187 | struct usb_anchor *anchor; | 1188 | struct usb_anchor *anchor; |
| 1188 | struct usb_device *dev; /* (in) pointer to associated device */ | 1189 | struct usb_device *dev; /* (in) pointer to associated device */ |
| 1189 | struct usb_host_endpoint *ep; /* (internal) pointer to endpoint */ | 1190 | struct usb_host_endpoint *ep; /* (internal) pointer to endpoint */ |
| 1190 | unsigned int pipe; /* (in) pipe information */ | 1191 | unsigned int pipe; /* (in) pipe information */ |
| 1192 | unsigned int stream_id; /* (in) stream ID */ | ||
| 1191 | int status; /* (return) non-ISO status */ | 1193 | int status; /* (return) non-ISO status */ |
| 1192 | unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ | 1194 | unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ |
| 1193 | void *transfer_buffer; /* (in) associated data buffer */ | 1195 | void *transfer_buffer; /* (in) associated data buffer */ |
| 1194 | dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ | 1196 | dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ |
| 1195 | struct usb_sg_request *sg; /* (in) scatter gather buffer list */ | 1197 | struct scatterlist *sg; /* (in) scatter gather buffer list */ |
| 1196 | int num_sgs; /* (in) number of entries in the sg list */ | 1198 | int num_sgs; /* (in) number of entries in the sg list */ |
| 1197 | u32 transfer_buffer_length; /* (in) data buffer length */ | 1199 | u32 transfer_buffer_length; /* (in) data buffer length */ |
| 1198 | u32 actual_length; /* (return) actual transfer length */ | 1200 | u32 actual_length; /* (return) actual transfer length */ |
| @@ -1286,9 +1288,16 @@ static inline void usb_fill_bulk_urb(struct urb *urb, | |||
| 1286 | * | 1288 | * |
| 1287 | * Initializes a interrupt urb with the proper information needed to submit | 1289 | * Initializes a interrupt urb with the proper information needed to submit |
| 1288 | * it to a device. | 1290 | * it to a device. |
| 1289 | * Note that high speed interrupt endpoints use a logarithmic encoding of | 1291 | * |
| 1290 | * the endpoint interval, and express polling intervals in microframes | 1292 | * Note that High Speed and SuperSpeed interrupt endpoints use a logarithmic |
| 1291 | * (eight per millisecond) rather than in frames (one per millisecond). | 1293 | * encoding of the endpoint interval, and express polling intervals in |
| 1294 | * microframes (eight per millisecond) rather than in frames (one per | ||
| 1295 | * millisecond). | ||
| 1296 | * | ||
| 1297 | * Wireless USB also uses the logarithmic encoding, but specifies it in units of | ||
| 1298 | * 128us instead of 125us. For Wireless USB devices, the interval is passed | ||
| 1299 | * through to the host controller, rather than being translated into microframe | ||
| 1300 | * units. | ||
| 1292 | */ | 1301 | */ |
| 1293 | static inline void usb_fill_int_urb(struct urb *urb, | 1302 | static inline void usb_fill_int_urb(struct urb *urb, |
| 1294 | struct usb_device *dev, | 1303 | struct usb_device *dev, |
| @@ -1305,7 +1314,7 @@ static inline void usb_fill_int_urb(struct urb *urb, | |||
| 1305 | urb->transfer_buffer_length = buffer_length; | 1314 | urb->transfer_buffer_length = buffer_length; |
| 1306 | urb->complete = complete_fn; | 1315 | urb->complete = complete_fn; |
| 1307 | urb->context = context; | 1316 | urb->context = context; |
| 1308 | if (dev->speed == USB_SPEED_HIGH) | 1317 | if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER) |
| 1309 | urb->interval = 1 << (interval - 1); | 1318 | urb->interval = 1 << (interval - 1); |
| 1310 | else | 1319 | else |
| 1311 | urb->interval = interval; | 1320 | urb->interval = interval; |
| @@ -1358,9 +1367,9 @@ static inline int usb_urb_dir_out(struct urb *urb) | |||
| 1358 | return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT; | 1367 | return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT; |
| 1359 | } | 1368 | } |
| 1360 | 1369 | ||
| 1361 | void *usb_buffer_alloc(struct usb_device *dev, size_t size, | 1370 | void *usb_alloc_coherent(struct usb_device *dev, size_t size, |
| 1362 | gfp_t mem_flags, dma_addr_t *dma); | 1371 | gfp_t mem_flags, dma_addr_t *dma); |
| 1363 | void usb_buffer_free(struct usb_device *dev, size_t size, | 1372 | void usb_free_coherent(struct usb_device *dev, size_t size, |
| 1364 | void *addr, dma_addr_t dma); | 1373 | void *addr, dma_addr_t dma); |
| 1365 | 1374 | ||
| 1366 | #if 0 | 1375 | #if 0 |
| @@ -1447,8 +1456,6 @@ struct usb_sg_request { | |||
| 1447 | 1456 | ||
| 1448 | struct usb_device *dev; | 1457 | struct usb_device *dev; |
| 1449 | int pipe; | 1458 | int pipe; |
| 1450 | struct scatterlist *sg; | ||
| 1451 | int nents; | ||
| 1452 | 1459 | ||
| 1453 | int entries; | 1460 | int entries; |
| 1454 | struct urb **urbs; | 1461 | struct urb **urbs; |
| @@ -1516,23 +1523,31 @@ static inline unsigned int __create_pipe(struct usb_device *dev, | |||
| 1516 | } | 1523 | } |
| 1517 | 1524 | ||
| 1518 | /* Create various pipes... */ | 1525 | /* Create various pipes... */ |
| 1519 | #define usb_sndctrlpipe(dev,endpoint) \ | 1526 | #define usb_sndctrlpipe(dev, endpoint) \ |
| 1520 | ((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint)) | 1527 | ((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint)) |
| 1521 | #define usb_rcvctrlpipe(dev,endpoint) \ | 1528 | #define usb_rcvctrlpipe(dev, endpoint) \ |
| 1522 | ((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) | 1529 | ((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) |
| 1523 | #define usb_sndisocpipe(dev,endpoint) \ | 1530 | #define usb_sndisocpipe(dev, endpoint) \ |
| 1524 | ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint)) | 1531 | ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint)) |
| 1525 | #define usb_rcvisocpipe(dev,endpoint) \ | 1532 | #define usb_rcvisocpipe(dev, endpoint) \ |
| 1526 | ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) | 1533 | ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) |
| 1527 | #define usb_sndbulkpipe(dev,endpoint) \ | 1534 | #define usb_sndbulkpipe(dev, endpoint) \ |
| 1528 | ((PIPE_BULK << 30) | __create_pipe(dev, endpoint)) | 1535 | ((PIPE_BULK << 30) | __create_pipe(dev, endpoint)) |
| 1529 | #define usb_rcvbulkpipe(dev,endpoint) \ | 1536 | #define usb_rcvbulkpipe(dev, endpoint) \ |
| 1530 | ((PIPE_BULK << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) | 1537 | ((PIPE_BULK << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) |
| 1531 | #define usb_sndintpipe(dev,endpoint) \ | 1538 | #define usb_sndintpipe(dev, endpoint) \ |
| 1532 | ((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint)) | 1539 | ((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint)) |
| 1533 | #define usb_rcvintpipe(dev,endpoint) \ | 1540 | #define usb_rcvintpipe(dev, endpoint) \ |
| 1534 | ((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) | 1541 | ((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) |
| 1535 | 1542 | ||
| 1543 | static inline struct usb_host_endpoint * | ||
| 1544 | usb_pipe_endpoint(struct usb_device *dev, unsigned int pipe) | ||
| 1545 | { | ||
| 1546 | struct usb_host_endpoint **eps; | ||
| 1547 | eps = usb_pipein(pipe) ? dev->ep_in : dev->ep_out; | ||
| 1548 | return eps[usb_pipeendpoint(pipe)]; | ||
| 1549 | } | ||
| 1550 | |||
| 1536 | /*-------------------------------------------------------------------------*/ | 1551 | /*-------------------------------------------------------------------------*/ |
| 1537 | 1552 | ||
| 1538 | static inline __u16 | 1553 | static inline __u16 |
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild index 29fd73b0bffc..51410e0200cf 100644 --- a/include/linux/usb/Kbuild +++ b/include/linux/usb/Kbuild | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | header-y += audio.h | 1 | header-y += audio.h |
| 2 | header-y += cdc.h | 2 | header-y += cdc.h |
| 3 | header-y += ch9.h | 3 | header-y += ch9.h |
| 4 | header-y += ch11.h | ||
| 4 | header-y += gadgetfs.h | 5 | header-y += gadgetfs.h |
| 5 | header-y += midi.h | 6 | header-y += midi.h |
| 6 | header-y += g_printer.h | 7 | header-y += g_printer.h |
diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h index baf41c8616e9..ba99af275a31 100644 --- a/include/linux/usb/atmel_usba_udc.h +++ b/include/linux/usb/atmel_usba_udc.h | |||
| @@ -15,7 +15,7 @@ struct usba_ep_data { | |||
| 15 | 15 | ||
| 16 | struct usba_platform_data { | 16 | struct usba_platform_data { |
| 17 | int vbus_pin; | 17 | int vbus_pin; |
| 18 | int vbus_pin_inverted; | 18 | int vbus_pin_inverted; |
| 19 | int num_ep; | 19 | int num_ep; |
| 20 | struct usba_ep_data ep[0]; | 20 | struct usba_ep_data ep[0]; |
| 21 | }; | 21 | }; |
diff --git a/include/linux/usb/audio-v2.h b/include/linux/usb/audio-v2.h new file mode 100644 index 000000000000..2389f93a28b5 --- /dev/null +++ b/include/linux/usb/audio-v2.h | |||
| @@ -0,0 +1,378 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2010 Daniel Mack <daniel@caiaq.de> | ||
| 3 | * | ||
| 4 | * This software is distributed under the terms of the GNU General Public | ||
| 5 | * License ("GPL") version 2, as published by the Free Software Foundation. | ||
| 6 | * | ||
| 7 | * This file holds USB constants and structures defined | ||
| 8 | * by the USB Device Class Definition for Audio Devices in version 2.0. | ||
| 9 | * Comments below reference relevant sections of the documents contained | ||
| 10 | * in http://www.usb.org/developers/devclass_docs/Audio2.0_final.zip | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __LINUX_USB_AUDIO_V2_H | ||
| 14 | #define __LINUX_USB_AUDIO_V2_H | ||
| 15 | |||
| 16 | #include <linux/types.h> | ||
| 17 | |||
| 18 | /* v1.0 and v2.0 of this standard have many things in common. For the rest | ||
| 19 | * of the definitions, please refer to audio.h */ | ||
| 20 | |||
| 21 | /* 4.7.2.1 Clock Source Descriptor */ | ||
| 22 | |||
| 23 | struct uac_clock_source_descriptor { | ||
| 24 | __u8 bLength; | ||
| 25 | __u8 bDescriptorType; | ||
| 26 | __u8 bDescriptorSubtype; | ||
| 27 | __u8 bClockID; | ||
| 28 | __u8 bmAttributes; | ||
| 29 | __u8 bmControls; | ||
| 30 | __u8 bAssocTerminal; | ||
| 31 | __u8 iClockSource; | ||
| 32 | } __attribute__((packed)); | ||
| 33 | |||
| 34 | /* 4.7.2.2 Clock Source Descriptor */ | ||
| 35 | |||
| 36 | struct uac_clock_selector_descriptor { | ||
| 37 | __u8 bLength; | ||
| 38 | __u8 bDescriptorType; | ||
| 39 | __u8 bDescriptorSubtype; | ||
| 40 | __u8 bClockID; | ||
| 41 | __u8 bNrInPins; | ||
| 42 | __u8 bmControls; | ||
| 43 | __u8 baCSourceID[]; | ||
| 44 | } __attribute__((packed)); | ||
| 45 | |||
| 46 | /* 4.7.2.4 Input terminal descriptor */ | ||
| 47 | |||
| 48 | struct uac2_input_terminal_descriptor { | ||
| 49 | __u8 bLength; | ||
| 50 | __u8 bDescriptorType; | ||
| 51 | __u8 bDescriptorSubtype; | ||
| 52 | __u8 bTerminalID; | ||
| 53 | __u16 wTerminalType; | ||
| 54 | __u8 bAssocTerminal; | ||
| 55 | __u8 bCSourceID; | ||
| 56 | __u8 bNrChannels; | ||
| 57 | __u32 bmChannelConfig; | ||
| 58 | __u8 iChannelNames; | ||
| 59 | __u16 bmControls; | ||
| 60 | __u8 iTerminal; | ||
| 61 | } __attribute__((packed)); | ||
| 62 | |||
| 63 | /* 4.7.2.5 Output terminal descriptor */ | ||
| 64 | |||
| 65 | struct uac2_output_terminal_descriptor { | ||
| 66 | __u8 bLength; | ||
| 67 | __u8 bDescriptorType; | ||
| 68 | __u8 bDescriptorSubtype; | ||
| 69 | __u8 bTerminalID; | ||
| 70 | __u16 wTerminalType; | ||
| 71 | __u8 bAssocTerminal; | ||
| 72 | __u8 bSourceID; | ||
| 73 | __u8 bCSourceID; | ||
| 74 | __u16 bmControls; | ||
| 75 | __u8 iTerminal; | ||
| 76 | } __attribute__((packed)); | ||
| 77 | |||
| 78 | |||
| 79 | |||
| 80 | /* 4.7.2.8 Feature Unit Descriptor */ | ||
| 81 | |||
| 82 | struct uac2_feature_unit_descriptor { | ||
| 83 | __u8 bLength; | ||
| 84 | __u8 bDescriptorType; | ||
| 85 | __u8 bDescriptorSubtype; | ||
| 86 | __u8 bUnitID; | ||
| 87 | __u8 bSourceID; | ||
| 88 | /* bmaControls is actually u32, | ||
| 89 | * but u8 is needed for the hybrid parser */ | ||
| 90 | __u8 bmaControls[0]; /* variable length */ | ||
| 91 | } __attribute__((packed)); | ||
| 92 | |||
| 93 | /* 4.9.2 Class-Specific AS Interface Descriptor */ | ||
| 94 | |||
| 95 | struct uac_as_header_descriptor_v2 { | ||
| 96 | __u8 bLength; | ||
| 97 | __u8 bDescriptorType; | ||
| 98 | __u8 bDescriptorSubtype; | ||
| 99 | __u8 bTerminalLink; | ||
| 100 | __u8 bmControls; | ||
| 101 | __u8 bFormatType; | ||
| 102 | __u32 bmFormats; | ||
| 103 | __u8 bNrChannels; | ||
| 104 | __u32 bmChannelConfig; | ||
| 105 | __u8 iChannelNames; | ||
| 106 | } __attribute__((packed)); | ||
| 107 | |||
| 108 | /* 6.1 Interrupt Data Message */ | ||
| 109 | |||
| 110 | #define UAC2_INTERRUPT_DATA_MSG_VENDOR (1 << 0) | ||
| 111 | #define UAC2_INTERRUPT_DATA_MSG_EP (1 << 1) | ||
| 112 | |||
| 113 | struct uac2_interrupt_data_msg { | ||
| 114 | __u8 bInfo; | ||
| 115 | __u8 bAttribute; | ||
| 116 | __le16 wValue; | ||
| 117 | __le16 wIndex; | ||
| 118 | } __attribute__((packed)); | ||
| 119 | |||
| 120 | /* A.7 Audio Function Category Codes */ | ||
| 121 | #define UAC2_FUNCTION_SUBCLASS_UNDEFINED 0x00 | ||
| 122 | #define UAC2_FUNCTION_DESKTOP_SPEAKER 0x01 | ||
| 123 | #define UAC2_FUNCTION_HOME_THEATER 0x02 | ||
| 124 | #define UAC2_FUNCTION_MICROPHONE 0x03 | ||
| 125 | #define UAC2_FUNCTION_HEADSET 0x04 | ||
| 126 | #define UAC2_FUNCTION_TELEPHONE 0x05 | ||
| 127 | #define UAC2_FUNCTION_CONVERTER 0x06 | ||
| 128 | #define UAC2_FUNCTION_SOUND_RECORDER 0x07 | ||
| 129 | #define UAC2_FUNCTION_IO_BOX 0x08 | ||
| 130 | #define UAC2_FUNCTION_MUSICAL_INSTRUMENT 0x09 | ||
| 131 | #define UAC2_FUNCTION_PRO_AUDIO 0x0a | ||
| 132 | #define UAC2_FUNCTION_AUDIO_VIDEO 0x0b | ||
| 133 | #define UAC2_FUNCTION_CONTROL_PANEL 0x0c | ||
| 134 | #define UAC2_FUNCTION_OTHER 0xff | ||
| 135 | |||
| 136 | /* A.9 Audio Class-Specific AC Interface Descriptor Subtypes */ | ||
| 137 | /* see audio.h for the rest, which is identical to v1 */ | ||
| 138 | #define UAC2_EFFECT_UNIT 0x07 | ||
| 139 | #define UAC2_PROCESSING_UNIT_V2 0x08 | ||
| 140 | #define UAC2_EXTENSION_UNIT_V2 0x09 | ||
| 141 | #define UAC2_CLOCK_SOURCE 0x0a | ||
| 142 | #define UAC2_CLOCK_SELECTOR 0x0b | ||
| 143 | #define UAC2_CLOCK_MULTIPLIER 0x0c | ||
| 144 | #define UAC2_SAMPLE_RATE_CONVERTER 0x0d | ||
| 145 | |||
| 146 | /* A.10 Audio Class-Specific AS Interface Descriptor Subtypes */ | ||
| 147 | /* see audio.h for the rest, which is identical to v1 */ | ||
| 148 | #define UAC2_ENCODER 0x03 | ||
| 149 | #define UAC2_DECODER 0x04 | ||
| 150 | |||
| 151 | /* A.11 Effect Unit Effect Types */ | ||
| 152 | #define UAC2_EFFECT_UNDEFINED 0x00 | ||
| 153 | #define UAC2_EFFECT_PARAM_EQ 0x01 | ||
| 154 | #define UAC2_EFFECT_REVERB 0x02 | ||
| 155 | #define UAC2_EFFECT_MOD_DELAY 0x03 | ||
| 156 | #define UAC2_EFFECT_DYN_RANGE_COMP 0x04 | ||
| 157 | |||
| 158 | /* A.12 Processing Unit Process Types */ | ||
| 159 | #define UAC2_PROCESS_UNDEFINED 0x00 | ||
| 160 | #define UAC2_PROCESS_UP_DOWNMIX 0x01 | ||
| 161 | #define UAC2_PROCESS_DOLBY_PROLOCIC 0x02 | ||
| 162 | #define UAC2_PROCESS_STEREO_EXTENDER 0x03 | ||
| 163 | |||
| 164 | /* A.14 Audio Class-Specific Request Codes */ | ||
| 165 | #define UAC2_CS_CUR 0x01 | ||
| 166 | #define UAC2_CS_RANGE 0x02 | ||
| 167 | #define UAC2_CS_MEM 0x03 | ||
| 168 | |||
| 169 | /* A.15 Encoder Type Codes */ | ||
| 170 | #define UAC2_ENCODER_UNDEFINED 0x00 | ||
| 171 | #define UAC2_ENCODER_OTHER 0x01 | ||
| 172 | #define UAC2_ENCODER_MPEG 0x02 | ||
| 173 | #define UAC2_ENCODER_AC3 0x03 | ||
| 174 | #define UAC2_ENCODER_WMA 0x04 | ||
| 175 | #define UAC2_ENCODER_DTS 0x05 | ||
| 176 | |||
| 177 | /* A.16 Decoder Type Codes */ | ||
| 178 | #define UAC2_DECODER_UNDEFINED 0x00 | ||
| 179 | #define UAC2_DECODER_OTHER 0x01 | ||
| 180 | #define UAC2_DECODER_MPEG 0x02 | ||
| 181 | #define UAC2_DECODER_AC3 0x03 | ||
| 182 | #define UAC2_DECODER_WMA 0x04 | ||
| 183 | #define UAC2_DECODER_DTS 0x05 | ||
| 184 | |||
| 185 | /* A.17.1 Clock Source Control Selectors */ | ||
| 186 | #define UAC2_CS_UNDEFINED 0x00 | ||
| 187 | #define UAC2_CS_CONTROL_SAM_FREQ 0x01 | ||
| 188 | #define UAC2_CS_CONTROL_CLOCK_VALID 0x02 | ||
| 189 | |||
| 190 | /* A.17.2 Clock Selector Control Selectors */ | ||
| 191 | #define UAC2_CX_UNDEFINED 0x00 | ||
| 192 | #define UAC2_CX_CLOCK_SELECTOR 0x01 | ||
| 193 | |||
| 194 | /* A.17.3 Clock Multiplier Control Selectors */ | ||
| 195 | #define UAC2_CM_UNDEFINED 0x00 | ||
| 196 | #define UAC2_CM_NUMERATOR 0x01 | ||
| 197 | #define UAC2_CM_DENOMINTATOR 0x02 | ||
| 198 | |||
| 199 | /* A.17.4 Terminal Control Selectors */ | ||
| 200 | #define UAC2_TE_UNDEFINED 0x00 | ||
| 201 | #define UAC2_TE_COPY_PROTECT 0x01 | ||
| 202 | #define UAC2_TE_CONNECTOR 0x02 | ||
| 203 | #define UAC2_TE_OVERLOAD 0x03 | ||
| 204 | #define UAC2_TE_CLUSTER 0x04 | ||
| 205 | #define UAC2_TE_UNDERFLOW 0x05 | ||
| 206 | #define UAC2_TE_OVERFLOW 0x06 | ||
| 207 | #define UAC2_TE_LATENCY 0x07 | ||
| 208 | |||
| 209 | /* A.17.5 Mixer Control Selectors */ | ||
| 210 | #define UAC2_MU_UNDEFINED 0x00 | ||
| 211 | #define UAC2_MU_MIXER 0x01 | ||
| 212 | #define UAC2_MU_CLUSTER 0x02 | ||
| 213 | #define UAC2_MU_UNDERFLOW 0x03 | ||
| 214 | #define UAC2_MU_OVERFLOW 0x04 | ||
| 215 | #define UAC2_MU_LATENCY 0x05 | ||
| 216 | |||
| 217 | /* A.17.6 Selector Control Selectors */ | ||
| 218 | #define UAC2_SU_UNDEFINED 0x00 | ||
| 219 | #define UAC2_SU_SELECTOR 0x01 | ||
| 220 | #define UAC2_SU_LATENCY 0x02 | ||
| 221 | |||
| 222 | /* A.17.7 Feature Unit Control Selectors */ | ||
| 223 | /* see audio.h for the rest, which is identical to v1 */ | ||
| 224 | #define UAC2_FU_INPUT_GAIN 0x0b | ||
| 225 | #define UAC2_FU_INPUT_GAIN_PAD 0x0c | ||
| 226 | #define UAC2_FU_PHASE_INVERTER 0x0d | ||
| 227 | #define UAC2_FU_UNDERFLOW 0x0e | ||
| 228 | #define UAC2_FU_OVERFLOW 0x0f | ||
| 229 | #define UAC2_FU_LATENCY 0x10 | ||
| 230 | |||
| 231 | /* A.17.8.1 Parametric Equalizer Section Effect Unit Control Selectors */ | ||
| 232 | #define UAC2_PE_UNDEFINED 0x00 | ||
| 233 | #define UAC2_PE_ENABLE 0x01 | ||
| 234 | #define UAC2_PE_CENTERFREQ 0x02 | ||
| 235 | #define UAC2_PE_QFACTOR 0x03 | ||
| 236 | #define UAC2_PE_GAIN 0x04 | ||
| 237 | #define UAC2_PE_UNDERFLOW 0x05 | ||
| 238 | #define UAC2_PE_OVERFLOW 0x06 | ||
| 239 | #define UAC2_PE_LATENCY 0x07 | ||
| 240 | |||
| 241 | /* A.17.8.2 Reverberation Effect Unit Control Selectors */ | ||
| 242 | #define UAC2_RV_UNDEFINED 0x00 | ||
| 243 | #define UAC2_RV_ENABLE 0x01 | ||
| 244 | #define UAC2_RV_TYPE 0x02 | ||
| 245 | #define UAC2_RV_LEVEL 0x03 | ||
| 246 | #define UAC2_RV_TIME 0x04 | ||
| 247 | #define UAC2_RV_FEEDBACK 0x05 | ||
| 248 | #define UAC2_RV_PREDELAY 0x06 | ||
| 249 | #define UAC2_RV_DENSITY 0x07 | ||
| 250 | #define UAC2_RV_HIFREQ_ROLLOFF 0x08 | ||
| 251 | #define UAC2_RV_UNDERFLOW 0x09 | ||
| 252 | #define UAC2_RV_OVERFLOW 0x0a | ||
| 253 | #define UAC2_RV_LATENCY 0x0b | ||
| 254 | |||
| 255 | /* A.17.8.3 Modulation Delay Effect Control Selectors */ | ||
| 256 | #define UAC2_MD_UNDEFINED 0x00 | ||
| 257 | #define UAC2_MD_ENABLE 0x01 | ||
| 258 | #define UAC2_MD_BALANCE 0x02 | ||
| 259 | #define UAC2_MD_RATE 0x03 | ||
| 260 | #define UAC2_MD_DEPTH 0x04 | ||
| 261 | #define UAC2_MD_TIME 0x05 | ||
| 262 | #define UAC2_MD_FEEDBACK 0x06 | ||
| 263 | #define UAC2_MD_UNDERFLOW 0x07 | ||
| 264 | #define UAC2_MD_OVERFLOW 0x08 | ||
| 265 | #define UAC2_MD_LATENCY 0x09 | ||
| 266 | |||
| 267 | /* A.17.8.4 Dynamic Range Compressor Effect Unit Control Selectors */ | ||
| 268 | #define UAC2_DR_UNDEFINED 0x00 | ||
| 269 | #define UAC2_DR_ENABLE 0x01 | ||
| 270 | #define UAC2_DR_COMPRESSION_RATE 0x02 | ||
| 271 | #define UAC2_DR_MAXAMPL 0x03 | ||
| 272 | #define UAC2_DR_THRESHOLD 0x04 | ||
| 273 | #define UAC2_DR_ATTACK_TIME 0x05 | ||
| 274 | #define UAC2_DR_RELEASE_TIME 0x06 | ||
| 275 | #define UAC2_DR_UNDEFLOW 0x07 | ||
| 276 | #define UAC2_DR_OVERFLOW 0x08 | ||
| 277 | #define UAC2_DR_LATENCY 0x09 | ||
| 278 | |||
| 279 | /* A.17.9.1 Up/Down-mix Processing Unit Control Selectors */ | ||
| 280 | #define UAC2_UD_UNDEFINED 0x00 | ||
| 281 | #define UAC2_UD_ENABLE 0x01 | ||
| 282 | #define UAC2_UD_MODE_SELECT 0x02 | ||
| 283 | #define UAC2_UD_CLUSTER 0x03 | ||
| 284 | #define UAC2_UD_UNDERFLOW 0x04 | ||
| 285 | #define UAC2_UD_OVERFLOW 0x05 | ||
| 286 | #define UAC2_UD_LATENCY 0x06 | ||
| 287 | |||
| 288 | /* A.17.9.2 Dolby Prologic[tm] Processing Unit Control Selectors */ | ||
| 289 | #define UAC2_DP_UNDEFINED 0x00 | ||
| 290 | #define UAC2_DP_ENABLE 0x01 | ||
| 291 | #define UAC2_DP_MODE_SELECT 0x02 | ||
| 292 | #define UAC2_DP_CLUSTER 0x03 | ||
| 293 | #define UAC2_DP_UNDERFFLOW 0x04 | ||
| 294 | #define UAC2_DP_OVERFLOW 0x05 | ||
| 295 | #define UAC2_DP_LATENCY 0x06 | ||
| 296 | |||
| 297 | /* A.17.9.3 Stereo Expander Processing Unit Control Selectors */ | ||
| 298 | #define UAC2_ST_EXT_UNDEFINED 0x00 | ||
| 299 | #define UAC2_ST_EXT_ENABLE 0x01 | ||
| 300 | #define UAC2_ST_EXT_WIDTH 0x02 | ||
| 301 | #define UAC2_ST_EXT_UNDEFLOW 0x03 | ||
| 302 | #define UAC2_ST_EXT_OVERFLOW 0x04 | ||
| 303 | #define UAC2_ST_EXT_LATENCY 0x05 | ||
| 304 | |||
| 305 | /* A.17.10 Extension Unit Control Selectors */ | ||
| 306 | #define UAC2_XU_UNDEFINED 0x00 | ||
| 307 | #define UAC2_XU_ENABLE 0x01 | ||
| 308 | #define UAC2_XU_CLUSTER 0x02 | ||
| 309 | #define UAC2_XU_UNDERFLOW 0x03 | ||
| 310 | #define UAC2_XU_OVERFLOW 0x04 | ||
| 311 | #define UAC2_XU_LATENCY 0x05 | ||
| 312 | |||
| 313 | /* A.17.11 AudioStreaming Interface Control Selectors */ | ||
| 314 | #define UAC2_AS_UNDEFINED 0x00 | ||
| 315 | #define UAC2_AS_ACT_ALT_SETTING 0x01 | ||
| 316 | #define UAC2_AS_VAL_ALT_SETTINGS 0x02 | ||
| 317 | #define UAC2_AS_AUDIO_DATA_FORMAT 0x03 | ||
| 318 | |||
| 319 | /* A.17.12 Encoder Control Selectors */ | ||
| 320 | #define UAC2_EN_UNDEFINED 0x00 | ||
| 321 | #define UAC2_EN_BIT_RATE 0x01 | ||
| 322 | #define UAC2_EN_QUALITY 0x02 | ||
| 323 | #define UAC2_EN_VBR 0x03 | ||
| 324 | #define UAC2_EN_TYPE 0x04 | ||
| 325 | #define UAC2_EN_UNDERFLOW 0x05 | ||
| 326 | #define UAC2_EN_OVERFLOW 0x06 | ||
| 327 | #define UAC2_EN_ENCODER_ERROR 0x07 | ||
| 328 | #define UAC2_EN_PARAM1 0x08 | ||
| 329 | #define UAC2_EN_PARAM2 0x09 | ||
| 330 | #define UAC2_EN_PARAM3 0x0a | ||
| 331 | #define UAC2_EN_PARAM4 0x0b | ||
| 332 | #define UAC2_EN_PARAM5 0x0c | ||
| 333 | #define UAC2_EN_PARAM6 0x0d | ||
| 334 | #define UAC2_EN_PARAM7 0x0e | ||
| 335 | #define UAC2_EN_PARAM8 0x0f | ||
| 336 | |||
| 337 | /* A.17.13.1 MPEG Decoder Control Selectors */ | ||
| 338 | #define UAC2_MPEG_UNDEFINED 0x00 | ||
| 339 | #define UAC2_MPEG_DUAL_CHANNEL 0x01 | ||
| 340 | #define UAC2_MPEG_SECOND_STEREO 0x02 | ||
| 341 | #define UAC2_MPEG_MULTILINGUAL 0x03 | ||
| 342 | #define UAC2_MPEG_DYN_RANGE 0x04 | ||
| 343 | #define UAC2_MPEG_SCALING 0x05 | ||
| 344 | #define UAC2_MPEG_HILO_SCALING 0x06 | ||
| 345 | #define UAC2_MPEG_UNDERFLOW 0x07 | ||
| 346 | #define UAC2_MPEG_OVERFLOW 0x08 | ||
| 347 | #define UAC2_MPEG_DECODER_ERROR 0x09 | ||
| 348 | |||
| 349 | /* A17.13.2 AC3 Decoder Control Selectors */ | ||
| 350 | #define UAC2_AC3_UNDEFINED 0x00 | ||
| 351 | #define UAC2_AC3_MODE 0x01 | ||
| 352 | #define UAC2_AC3_DYN_RANGE 0x02 | ||
| 353 | #define UAC2_AC3_SCALING 0x03 | ||
| 354 | #define UAC2_AC3_HILO_SCALING 0x04 | ||
| 355 | #define UAC2_AC3_UNDERFLOW 0x05 | ||
| 356 | #define UAC2_AC3_OVERFLOW 0x06 | ||
| 357 | #define UAC2_AC3_DECODER_ERROR 0x07 | ||
| 358 | |||
| 359 | /* A17.13.3 WMA Decoder Control Selectors */ | ||
| 360 | #define UAC2_WMA_UNDEFINED 0x00 | ||
| 361 | #define UAC2_WMA_UNDERFLOW 0x01 | ||
| 362 | #define UAC2_WMA_OVERFLOW 0x02 | ||
| 363 | #define UAC2_WMA_DECODER_ERROR 0x03 | ||
| 364 | |||
| 365 | /* A17.13.4 DTS Decoder Control Selectors */ | ||
| 366 | #define UAC2_DTS_UNDEFINED 0x00 | ||
| 367 | #define UAC2_DTS_UNDERFLOW 0x01 | ||
| 368 | #define UAC2_DTS_OVERFLOW 0x02 | ||
| 369 | #define UAC2_DTS_DECODER_ERROR 0x03 | ||
| 370 | |||
| 371 | /* A17.14 Endpoint Control Selectors */ | ||
| 372 | #define UAC2_EP_CS_UNDEFINED 0x00 | ||
| 373 | #define UAC2_EP_CS_PITCH 0x01 | ||
| 374 | #define UAC2_EP_CS_DATA_OVERRUN 0x02 | ||
| 375 | #define UAC2_EP_CS_DATA_UNDERRUN 0x03 | ||
| 376 | |||
| 377 | #endif /* __LINUX_USB_AUDIO_V2_H */ | ||
| 378 | |||
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h index 6bb293684eb8..5d646c388752 100644 --- a/include/linux/usb/audio.h +++ b/include/linux/usb/audio.h | |||
| @@ -13,6 +13,9 @@ | |||
| 13 | * Comments below reference relevant sections of that document: | 13 | * Comments below reference relevant sections of that document: |
| 14 | * | 14 | * |
| 15 | * http://www.usb.org/developers/devclass_docs/audio10.pdf | 15 | * http://www.usb.org/developers/devclass_docs/audio10.pdf |
| 16 | * | ||
| 17 | * Types and defines in this file are either specific to version 1.0 of | ||
| 18 | * this standard or common for newer versions. | ||
| 16 | */ | 19 | */ |
| 17 | 20 | ||
| 18 | #ifndef __LINUX_USB_AUDIO_H | 21 | #ifndef __LINUX_USB_AUDIO_H |
| @@ -20,14 +23,15 @@ | |||
| 20 | 23 | ||
| 21 | #include <linux/types.h> | 24 | #include <linux/types.h> |
| 22 | 25 | ||
| 26 | /* bInterfaceProtocol values to denote the version of the standard used */ | ||
| 27 | #define UAC_VERSION_1 0x00 | ||
| 28 | #define UAC_VERSION_2 0x20 | ||
| 29 | |||
| 23 | /* A.2 Audio Interface Subclass Codes */ | 30 | /* A.2 Audio Interface Subclass Codes */ |
| 24 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 | 31 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 |
| 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 | 32 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 |
| 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 | 33 | #define USB_SUBCLASS_MIDISTREAMING 0x03 |
| 27 | 34 | ||
| 28 | #define UAC_VERSION_1 0x00 | ||
| 29 | #define UAC_VERSION_2 0x20 | ||
| 30 | |||
| 31 | /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ | 35 | /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ |
| 32 | #define UAC_HEADER 0x01 | 36 | #define UAC_HEADER 0x01 |
| 33 | #define UAC_INPUT_TERMINAL 0x02 | 37 | #define UAC_INPUT_TERMINAL 0x02 |
| @@ -38,15 +42,6 @@ | |||
| 38 | #define UAC_PROCESSING_UNIT_V1 0x07 | 42 | #define UAC_PROCESSING_UNIT_V1 0x07 |
| 39 | #define UAC_EXTENSION_UNIT_V1 0x08 | 43 | #define UAC_EXTENSION_UNIT_V1 0x08 |
| 40 | 44 | ||
| 41 | /* UAC v2.0 types */ | ||
| 42 | #define UAC_EFFECT_UNIT 0x07 | ||
| 43 | #define UAC_PROCESSING_UNIT_V2 0x08 | ||
| 44 | #define UAC_EXTENSION_UNIT_V2 0x09 | ||
| 45 | #define UAC_CLOCK_SOURCE 0x0a | ||
| 46 | #define UAC_CLOCK_SELECTOR 0x0b | ||
| 47 | #define UAC_CLOCK_MULTIPLIER 0x0c | ||
| 48 | #define UAC_SAMPLE_RATE_CONVERTER 0x0d | ||
| 49 | |||
| 50 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ | 45 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ |
| 51 | #define UAC_AS_GENERAL 0x01 | 46 | #define UAC_AS_GENERAL 0x01 |
| 52 | #define UAC_FORMAT_TYPE 0x02 | 47 | #define UAC_FORMAT_TYPE 0x02 |
| @@ -78,10 +73,6 @@ | |||
| 78 | 73 | ||
| 79 | #define UAC_GET_STAT 0xff | 74 | #define UAC_GET_STAT 0xff |
| 80 | 75 | ||
| 81 | /* Audio class v2.0 handles all the parameter calls differently */ | ||
| 82 | #define UAC2_CS_CUR 0x01 | ||
| 83 | #define UAC2_CS_RANGE 0x02 | ||
| 84 | |||
| 85 | /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ | 76 | /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ |
| 86 | #define UAC_MS_HEADER 0x01 | 77 | #define UAC_MS_HEADER 0x01 |
| 87 | #define UAC_MIDI_IN_JACK 0x02 | 78 | #define UAC_MIDI_IN_JACK 0x02 |
| @@ -110,7 +101,7 @@ struct uac_ac_header_descriptor_v1 { | |||
| 110 | #define UAC_DT_AC_HEADER_SIZE(n) (8 + (n)) | 101 | #define UAC_DT_AC_HEADER_SIZE(n) (8 + (n)) |
| 111 | 102 | ||
| 112 | /* As above, but more useful for defining your own descriptors: */ | 103 | /* As above, but more useful for defining your own descriptors: */ |
| 113 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ | 104 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ |
| 114 | struct uac_ac_header_descriptor_v1_##n { \ | 105 | struct uac_ac_header_descriptor_v1_##n { \ |
| 115 | __u8 bLength; \ | 106 | __u8 bLength; \ |
| 116 | __u8 bDescriptorType; \ | 107 | __u8 bDescriptorType; \ |
| @@ -178,7 +169,7 @@ struct uac_output_terminal_descriptor_v1 { | |||
| 178 | #define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) | 169 | #define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) |
| 179 | 170 | ||
| 180 | /* As above, but more useful for defining your own descriptors: */ | 171 | /* As above, but more useful for defining your own descriptors: */ |
| 181 | #define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch) \ | 172 | #define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch) \ |
| 182 | struct uac_feature_unit_descriptor_##ch { \ | 173 | struct uac_feature_unit_descriptor_##ch { \ |
| 183 | __u8 bLength; \ | 174 | __u8 bLength; \ |
| 184 | __u8 bDescriptorType; \ | 175 | __u8 bDescriptorType; \ |
| @@ -190,6 +181,156 @@ struct uac_feature_unit_descriptor_##ch { \ | |||
| 190 | __u8 iFeature; \ | 181 | __u8 iFeature; \ |
| 191 | } __attribute__ ((packed)) | 182 | } __attribute__ ((packed)) |
| 192 | 183 | ||
| 184 | /* 4.3.2.3 Mixer Unit Descriptor */ | ||
| 185 | struct uac_mixer_unit_descriptor { | ||
| 186 | __u8 bLength; | ||
| 187 | __u8 bDescriptorType; | ||
| 188 | __u8 bDescriptorSubtype; | ||
| 189 | __u8 bUnitID; | ||
| 190 | __u8 bNrInPins; | ||
| 191 | __u8 baSourceID[]; | ||
| 192 | } __attribute__ ((packed)); | ||
| 193 | |||
| 194 | static inline __u8 uac_mixer_unit_bNrChannels(struct uac_mixer_unit_descriptor *desc) | ||
| 195 | { | ||
| 196 | return desc->baSourceID[desc->bNrInPins]; | ||
| 197 | } | ||
| 198 | |||
| 199 | static inline __u32 uac_mixer_unit_wChannelConfig(struct uac_mixer_unit_descriptor *desc, | ||
| 200 | int protocol) | ||
| 201 | { | ||
| 202 | if (protocol == UAC_VERSION_1) | ||
| 203 | return (desc->baSourceID[desc->bNrInPins + 2] << 8) | | ||
| 204 | desc->baSourceID[desc->bNrInPins + 1]; | ||
| 205 | else | ||
| 206 | return (desc->baSourceID[desc->bNrInPins + 4] << 24) | | ||
| 207 | (desc->baSourceID[desc->bNrInPins + 3] << 16) | | ||
| 208 | (desc->baSourceID[desc->bNrInPins + 2] << 8) | | ||
| 209 | (desc->baSourceID[desc->bNrInPins + 1]); | ||
| 210 | } | ||
| 211 | |||
| 212 | static inline __u8 uac_mixer_unit_iChannelNames(struct uac_mixer_unit_descriptor *desc, | ||
| 213 | int protocol) | ||
| 214 | { | ||
| 215 | return (protocol == UAC_VERSION_1) ? | ||
| 216 | desc->baSourceID[desc->bNrInPins + 3] : | ||
| 217 | desc->baSourceID[desc->bNrInPins + 5]; | ||
| 218 | } | ||
| 219 | |||
| 220 | static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *desc, | ||
| 221 | int protocol) | ||
| 222 | { | ||
| 223 | return (protocol == UAC_VERSION_1) ? | ||
| 224 | &desc->baSourceID[desc->bNrInPins + 4] : | ||
| 225 | &desc->baSourceID[desc->bNrInPins + 6]; | ||
| 226 | } | ||
| 227 | |||
| 228 | static inline __u8 uac_mixer_unit_iMixer(struct uac_mixer_unit_descriptor *desc) | ||
| 229 | { | ||
| 230 | __u8 *raw = (__u8 *) desc; | ||
| 231 | return raw[desc->bLength - 1]; | ||
| 232 | } | ||
| 233 | |||
| 234 | /* 4.3.2.4 Selector Unit Descriptor */ | ||
| 235 | struct uac_selector_unit_descriptor { | ||
| 236 | __u8 bLength; | ||
| 237 | __u8 bDescriptorType; | ||
| 238 | __u8 bDescriptorSubtype; | ||
| 239 | __u8 bUintID; | ||
| 240 | __u8 bNrInPins; | ||
| 241 | __u8 baSourceID[]; | ||
| 242 | } __attribute__ ((packed)); | ||
| 243 | |||
| 244 | static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc) | ||
| 245 | { | ||
| 246 | __u8 *raw = (__u8 *) desc; | ||
| 247 | return raw[9 + desc->bLength - 1]; | ||
| 248 | } | ||
| 249 | |||
| 250 | /* 4.3.2.5 Feature Unit Descriptor */ | ||
| 251 | struct uac_feature_unit_descriptor { | ||
| 252 | __u8 bLength; | ||
| 253 | __u8 bDescriptorType; | ||
| 254 | __u8 bDescriptorSubtype; | ||
| 255 | __u8 bUnitID; | ||
| 256 | __u8 bSourceID; | ||
| 257 | __u8 bControlSize; | ||
| 258 | __u8 bmaControls[0]; /* variable length */ | ||
| 259 | } __attribute__((packed)); | ||
| 260 | |||
| 261 | static inline __u8 uac_feature_unit_iFeature(struct uac_feature_unit_descriptor *desc) | ||
| 262 | { | ||
| 263 | __u8 *raw = (__u8 *) desc; | ||
| 264 | return raw[desc->bLength - 1]; | ||
| 265 | } | ||
| 266 | |||
| 267 | /* 4.3.2.6 Processing Unit Descriptors */ | ||
| 268 | struct uac_processing_unit_descriptor { | ||
| 269 | __u8 bLength; | ||
| 270 | __u8 bDescriptorType; | ||
| 271 | __u8 bDescriptorSubtype; | ||
| 272 | __u8 bUnitID; | ||
| 273 | __u16 wProcessType; | ||
| 274 | __u8 bNrInPins; | ||
| 275 | __u8 baSourceID[]; | ||
| 276 | } __attribute__ ((packed)); | ||
| 277 | |||
| 278 | static inline __u8 uac_processing_unit_bNrChannels(struct uac_processing_unit_descriptor *desc) | ||
| 279 | { | ||
| 280 | return desc->baSourceID[desc->bNrInPins]; | ||
| 281 | } | ||
| 282 | |||
| 283 | static inline __u32 uac_processing_unit_wChannelConfig(struct uac_processing_unit_descriptor *desc, | ||
| 284 | int protocol) | ||
| 285 | { | ||
| 286 | if (protocol == UAC_VERSION_1) | ||
| 287 | return (desc->baSourceID[desc->bNrInPins + 2] << 8) | | ||
| 288 | desc->baSourceID[desc->bNrInPins + 1]; | ||
| 289 | else | ||
| 290 | return (desc->baSourceID[desc->bNrInPins + 4] << 24) | | ||
| 291 | (desc->baSourceID[desc->bNrInPins + 3] << 16) | | ||
| 292 | (desc->baSourceID[desc->bNrInPins + 2] << 8) | | ||
| 293 | (desc->baSourceID[desc->bNrInPins + 1]); | ||
| 294 | } | ||
| 295 | |||
| 296 | static inline __u8 uac_processing_unit_iChannelNames(struct uac_processing_unit_descriptor *desc, | ||
| 297 | int protocol) | ||
| 298 | { | ||
| 299 | return (protocol == UAC_VERSION_1) ? | ||
| 300 | desc->baSourceID[desc->bNrInPins + 3] : | ||
| 301 | desc->baSourceID[desc->bNrInPins + 5]; | ||
| 302 | } | ||
| 303 | |||
| 304 | static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_descriptor *desc, | ||
| 305 | int protocol) | ||
| 306 | { | ||
| 307 | return (protocol == UAC_VERSION_1) ? | ||
| 308 | desc->baSourceID[desc->bNrInPins + 4] : | ||
| 309 | desc->baSourceID[desc->bNrInPins + 6]; | ||
| 310 | } | ||
| 311 | |||
| 312 | static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc, | ||
| 313 | int protocol) | ||
| 314 | { | ||
| 315 | return (protocol == UAC_VERSION_1) ? | ||
| 316 | &desc->baSourceID[desc->bNrInPins + 5] : | ||
| 317 | &desc->baSourceID[desc->bNrInPins + 7]; | ||
| 318 | } | ||
| 319 | |||
| 320 | static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc, | ||
| 321 | int protocol) | ||
| 322 | { | ||
| 323 | __u8 control_size = uac_processing_unit_bControlSize(desc, protocol); | ||
| 324 | return desc->baSourceID[desc->bNrInPins + control_size]; | ||
| 325 | } | ||
| 326 | |||
| 327 | static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc, | ||
| 328 | int protocol) | ||
| 329 | { | ||
| 330 | __u8 control_size = uac_processing_unit_bControlSize(desc, protocol); | ||
| 331 | return &desc->baSourceID[desc->bNrInPins + control_size + 1]; | ||
| 332 | } | ||
| 333 | |||
| 193 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | 334 | /* 4.5.2 Class-Specific AS Interface Descriptor */ |
| 194 | struct uac_as_header_descriptor_v1 { | 335 | struct uac_as_header_descriptor_v1 { |
| 195 | __u8 bLength; /* in bytes: 7 */ | 336 | __u8 bLength; /* in bytes: 7 */ |
| @@ -200,19 +341,6 @@ struct uac_as_header_descriptor_v1 { | |||
| 200 | __le16 wFormatTag; /* The Audio Data Format */ | 341 | __le16 wFormatTag; /* The Audio Data Format */ |
| 201 | } __attribute__ ((packed)); | 342 | } __attribute__ ((packed)); |
| 202 | 343 | ||
| 203 | struct uac_as_header_descriptor_v2 { | ||
| 204 | __u8 bLength; | ||
| 205 | __u8 bDescriptorType; | ||
| 206 | __u8 bDescriptorSubtype; | ||
| 207 | __u8 bTerminalLink; | ||
| 208 | __u8 bmControls; | ||
| 209 | __u8 bFormatType; | ||
| 210 | __u32 bmFormats; | ||
| 211 | __u8 bNrChannels; | ||
| 212 | __u32 bmChannelConfig; | ||
| 213 | __u8 iChannelNames; | ||
| 214 | } __attribute__((packed)); | ||
| 215 | |||
| 216 | #define UAC_DT_AS_HEADER_SIZE 7 | 344 | #define UAC_DT_AS_HEADER_SIZE 7 |
| 217 | 345 | ||
| 218 | /* Formats - A.1.1 Audio Data Format Type I Codes */ | 346 | /* Formats - A.1.1 Audio Data Format Type I Codes */ |
| @@ -250,7 +378,7 @@ struct uac_format_type_i_discrete_descriptor { | |||
| 250 | __u8 tSamFreq[][3]; | 378 | __u8 tSamFreq[][3]; |
| 251 | } __attribute__ ((packed)); | 379 | } __attribute__ ((packed)); |
| 252 | 380 | ||
| 253 | #define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n) \ | 381 | #define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n) \ |
| 254 | struct uac_format_type_i_discrete_descriptor_##n { \ | 382 | struct uac_format_type_i_discrete_descriptor_##n { \ |
| 255 | __u8 bLength; \ | 383 | __u8 bLength; \ |
| 256 | __u8 bDescriptorType; \ | 384 | __u8 bDescriptorType; \ |
| @@ -269,15 +397,14 @@ struct uac_format_type_i_ext_descriptor { | |||
| 269 | __u8 bLength; | 397 | __u8 bLength; |
| 270 | __u8 bDescriptorType; | 398 | __u8 bDescriptorType; |
| 271 | __u8 bDescriptorSubtype; | 399 | __u8 bDescriptorSubtype; |
| 272 | __u8 bSubslotSize; | ||
| 273 | __u8 bFormatType; | 400 | __u8 bFormatType; |
| 401 | __u8 bSubslotSize; | ||
| 274 | __u8 bBitResolution; | 402 | __u8 bBitResolution; |
| 275 | __u8 bHeaderLength; | 403 | __u8 bHeaderLength; |
| 276 | __u8 bControlSize; | 404 | __u8 bControlSize; |
| 277 | __u8 bSideBandProtocol; | 405 | __u8 bSideBandProtocol; |
| 278 | } __attribute__((packed)); | 406 | } __attribute__((packed)); |
| 279 | 407 | ||
| 280 | |||
| 281 | /* Formats - Audio Data Format Type I Codes */ | 408 | /* Formats - Audio Data Format Type I Codes */ |
| 282 | 409 | ||
| 283 | #define UAC_FORMAT_TYPE_II_MPEG 0x1001 | 410 | #define UAC_FORMAT_TYPE_II_MPEG 0x1001 |
| @@ -329,38 +456,15 @@ struct uac_iso_endpoint_descriptor { | |||
| 329 | __u8 bmAttributes; | 456 | __u8 bmAttributes; |
| 330 | __u8 bLockDelayUnits; | 457 | __u8 bLockDelayUnits; |
| 331 | __le16 wLockDelay; | 458 | __le16 wLockDelay; |
| 332 | }; | 459 | } __attribute__((packed)); |
| 333 | #define UAC_ISO_ENDPOINT_DESC_SIZE 7 | 460 | #define UAC_ISO_ENDPOINT_DESC_SIZE 7 |
| 334 | 461 | ||
| 335 | #define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01 | 462 | #define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01 |
| 336 | #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 | 463 | #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 |
| 337 | #define UAC_EP_CS_ATTR_FILL_MAX 0x80 | 464 | #define UAC_EP_CS_ATTR_FILL_MAX 0x80 |
| 338 | 465 | ||
| 339 | /* Audio class v2.0: CLOCK_SOURCE descriptor */ | ||
| 340 | |||
| 341 | struct uac_clock_source_descriptor { | ||
| 342 | __u8 bLength; | ||
| 343 | __u8 bDescriptorType; | ||
| 344 | __u8 bDescriptorSubtype; | ||
| 345 | __u8 bClockID; | ||
| 346 | __u8 bmAttributes; | ||
| 347 | __u8 bmControls; | ||
| 348 | __u8 bAssocTerminal; | ||
| 349 | __u8 iClockSource; | ||
| 350 | } __attribute__((packed)); | ||
| 351 | |||
| 352 | /* A.10.2 Feature Unit Control Selectors */ | 466 | /* A.10.2 Feature Unit Control Selectors */ |
| 353 | 467 | ||
| 354 | struct uac_feature_unit_descriptor { | ||
| 355 | __u8 bLength; | ||
| 356 | __u8 bDescriptorType; | ||
| 357 | __u8 bDescriptorSubtype; | ||
| 358 | __u8 bUnitID; | ||
| 359 | __u8 bSourceID; | ||
| 360 | __u8 bControlSize; | ||
| 361 | __u8 controls[0]; /* variable length */ | ||
| 362 | } __attribute__((packed)); | ||
| 363 | |||
| 364 | #define UAC_FU_CONTROL_UNDEFINED 0x00 | 468 | #define UAC_FU_CONTROL_UNDEFINED 0x00 |
| 365 | #define UAC_MUTE_CONTROL 0x01 | 469 | #define UAC_MUTE_CONTROL 0x01 |
| 366 | #define UAC_VOLUME_CONTROL 0x02 | 470 | #define UAC_VOLUME_CONTROL 0x02 |
| @@ -384,6 +488,21 @@ struct uac_feature_unit_descriptor { | |||
| 384 | #define UAC_FU_BASS_BOOST (1 << (UAC_BASS_BOOST_CONTROL - 1)) | 488 | #define UAC_FU_BASS_BOOST (1 << (UAC_BASS_BOOST_CONTROL - 1)) |
| 385 | #define UAC_FU_LOUDNESS (1 << (UAC_LOUDNESS_CONTROL - 1)) | 489 | #define UAC_FU_LOUDNESS (1 << (UAC_LOUDNESS_CONTROL - 1)) |
| 386 | 490 | ||
| 491 | /* status word format (3.7.1.1) */ | ||
| 492 | |||
| 493 | #define UAC1_STATUS_TYPE_ORIG_MASK 0x0f | ||
| 494 | #define UAC1_STATUS_TYPE_ORIG_AUDIO_CONTROL_IF 0x0 | ||
| 495 | #define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_IF 0x1 | ||
| 496 | #define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_EP 0x2 | ||
| 497 | |||
| 498 | #define UAC1_STATUS_TYPE_IRQ_PENDING (1 << 7) | ||
| 499 | #define UAC1_STATUS_TYPE_MEM_CHANGED (1 << 6) | ||
| 500 | |||
| 501 | struct uac1_status_word { | ||
| 502 | __u8 bStatusType; | ||
| 503 | __u8 bOriginator; | ||
| 504 | } __attribute__((packed)); | ||
| 505 | |||
| 387 | #ifdef __KERNEL__ | 506 | #ifdef __KERNEL__ |
| 388 | 507 | ||
| 389 | struct usb_audio_control { | 508 | struct usb_audio_control { |
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h index c24124a42ce5..c117a68d04a7 100644 --- a/include/linux/usb/cdc.h +++ b/include/linux/usb/cdc.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #define USB_CDC_SUBCLASS_MDLM 0x0a | 18 | #define USB_CDC_SUBCLASS_MDLM 0x0a |
| 19 | #define USB_CDC_SUBCLASS_OBEX 0x0b | 19 | #define USB_CDC_SUBCLASS_OBEX 0x0b |
| 20 | #define USB_CDC_SUBCLASS_EEM 0x0c | 20 | #define USB_CDC_SUBCLASS_EEM 0x0c |
| 21 | #define USB_CDC_SUBCLASS_NCM 0x0d | ||
| 21 | 22 | ||
| 22 | #define USB_CDC_PROTO_NONE 0 | 23 | #define USB_CDC_PROTO_NONE 0 |
| 23 | 24 | ||
| @@ -49,6 +50,7 @@ | |||
| 49 | #define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */ | 50 | #define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */ |
| 50 | #define USB_CDC_DMM_TYPE 0x14 | 51 | #define USB_CDC_DMM_TYPE 0x14 |
| 51 | #define USB_CDC_OBEX_TYPE 0x15 | 52 | #define USB_CDC_OBEX_TYPE 0x15 |
| 53 | #define USB_CDC_NCM_TYPE 0x1a | ||
| 52 | 54 | ||
| 53 | /* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ | 55 | /* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ |
| 54 | struct usb_cdc_header_desc { | 56 | struct usb_cdc_header_desc { |
| @@ -174,6 +176,15 @@ struct usb_cdc_obex_desc { | |||
| 174 | __le16 bcdVersion; | 176 | __le16 bcdVersion; |
| 175 | } __attribute__ ((packed)); | 177 | } __attribute__ ((packed)); |
| 176 | 178 | ||
| 179 | /* "NCM Control Model Functional Descriptor" */ | ||
| 180 | struct usb_cdc_ncm_desc { | ||
| 181 | __u8 bLength; | ||
| 182 | __u8 bDescriptorType; | ||
| 183 | __u8 bDescriptorSubType; | ||
| 184 | |||
| 185 | __le16 bcdNcmVersion; | ||
| 186 | __u8 bmNetworkCapabilities; | ||
| 187 | } __attribute__ ((packed)); | ||
| 177 | /*-------------------------------------------------------------------------*/ | 188 | /*-------------------------------------------------------------------------*/ |
| 178 | 189 | ||
| 179 | /* | 190 | /* |
| @@ -197,6 +208,17 @@ struct usb_cdc_obex_desc { | |||
| 197 | #define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42 | 208 | #define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42 |
| 198 | #define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43 | 209 | #define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43 |
| 199 | #define USB_CDC_GET_ETHERNET_STATISTIC 0x44 | 210 | #define USB_CDC_GET_ETHERNET_STATISTIC 0x44 |
| 211 | #define USB_CDC_GET_NTB_PARAMETERS 0x80 | ||
| 212 | #define USB_CDC_GET_NET_ADDRESS 0x81 | ||
| 213 | #define USB_CDC_SET_NET_ADDRESS 0x82 | ||
| 214 | #define USB_CDC_GET_NTB_FORMAT 0x83 | ||
| 215 | #define USB_CDC_SET_NTB_FORMAT 0x84 | ||
| 216 | #define USB_CDC_GET_NTB_INPUT_SIZE 0x85 | ||
| 217 | #define USB_CDC_SET_NTB_INPUT_SIZE 0x86 | ||
| 218 | #define USB_CDC_GET_MAX_DATAGRAM_SIZE 0x87 | ||
| 219 | #define USB_CDC_SET_MAX_DATAGRAM_SIZE 0x88 | ||
| 220 | #define USB_CDC_GET_CRC_MODE 0x89 | ||
| 221 | #define USB_CDC_SET_CRC_MODE 0x8a | ||
| 200 | 222 | ||
| 201 | /* Line Coding Structure from CDC spec 6.2.13 */ | 223 | /* Line Coding Structure from CDC spec 6.2.13 */ |
| 202 | struct usb_cdc_line_coding { | 224 | struct usb_cdc_line_coding { |
| @@ -247,4 +269,76 @@ struct usb_cdc_notification { | |||
| 247 | __le16 wLength; | 269 | __le16 wLength; |
| 248 | } __attribute__ ((packed)); | 270 | } __attribute__ ((packed)); |
| 249 | 271 | ||
| 272 | /*-------------------------------------------------------------------------*/ | ||
| 273 | |||
| 274 | /* | ||
| 275 | * Class Specific structures and constants | ||
| 276 | * | ||
| 277 | * CDC NCM parameter structure, CDC NCM subclass 6.2.1 | ||
| 278 | * | ||
| 279 | */ | ||
| 280 | |||
| 281 | struct usb_cdc_ncm_ntb_parameter { | ||
| 282 | __le16 wLength; | ||
| 283 | __le16 bmNtbFormatSupported; | ||
| 284 | __le32 dwNtbInMaxSize; | ||
| 285 | __le16 wNdpInDivisor; | ||
| 286 | __le16 wNdpInPayloadRemainder; | ||
| 287 | __le16 wNdpInAlignment; | ||
| 288 | __le16 wPadding1; | ||
| 289 | __le32 dwNtbOutMaxSize; | ||
| 290 | __le16 wNdpOutDivisor; | ||
| 291 | __le16 wNdpOutPayloadRemainder; | ||
| 292 | __le16 wNdpOutAlignment; | ||
| 293 | __le16 wPadding2; | ||
| 294 | } __attribute__ ((packed)); | ||
| 295 | |||
| 296 | /* | ||
| 297 | * CDC NCM transfer headers, CDC NCM subclass 3.2 | ||
| 298 | */ | ||
| 299 | |||
| 300 | #define NCM_NTH16_SIGN 0x484D434E /* NCMH */ | ||
| 301 | #define NCM_NTH32_SIGN 0x686D636E /* ncmh */ | ||
| 302 | |||
| 303 | struct usb_cdc_ncm_nth16 { | ||
| 304 | __le32 dwSignature; | ||
| 305 | __le16 wHeaderLength; | ||
| 306 | __le16 wSequence; | ||
| 307 | __le16 wBlockLength; | ||
| 308 | __le16 wFpIndex; | ||
| 309 | } __attribute__ ((packed)); | ||
| 310 | |||
| 311 | struct usb_cdc_ncm_nth32 { | ||
| 312 | __le32 dwSignature; | ||
| 313 | __le16 wHeaderLength; | ||
| 314 | __le16 wSequence; | ||
| 315 | __le32 dwBlockLength; | ||
| 316 | __le32 dwFpIndex; | ||
| 317 | } __attribute__ ((packed)); | ||
| 318 | |||
| 319 | /* | ||
| 320 | * CDC NCM datagram pointers, CDC NCM subclass 3.3 | ||
| 321 | */ | ||
| 322 | |||
| 323 | #define NCM_NDP16_CRC_SIGN 0x314D434E /* NCM1 */ | ||
| 324 | #define NCM_NDP16_NOCRC_SIGN 0x304D434E /* NCM0 */ | ||
| 325 | #define NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */ | ||
| 326 | #define NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */ | ||
| 327 | |||
| 328 | struct usb_cdc_ncm_ndp16 { | ||
| 329 | __le32 dwSignature; | ||
| 330 | __le16 wLength; | ||
| 331 | __le16 wNextFpIndex; | ||
| 332 | __u8 data[0]; | ||
| 333 | } __attribute__ ((packed)); | ||
| 334 | |||
| 335 | struct usb_cdc_ncm_ndp32 { | ||
| 336 | __le32 dwSignature; | ||
| 337 | __le16 wLength; | ||
| 338 | __le16 wReserved6; | ||
| 339 | __le32 dwNextFpIndex; | ||
| 340 | __le32 dwReserved12; | ||
| 341 | __u8 data[0]; | ||
| 342 | } __attribute__ ((packed)); | ||
| 343 | |||
| 250 | #endif /* __LINUX_USB_CDC_H */ | 344 | #endif /* __LINUX_USB_CDC_H */ |
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h new file mode 100644 index 000000000000..119194c85d10 --- /dev/null +++ b/include/linux/usb/ch11.h | |||
| @@ -0,0 +1,167 @@ | |||
| 1 | /* | ||
| 2 | * This file holds Hub protocol constants and data structures that are | ||
| 3 | * defined in chapter 11 (Hub Specification) of the USB 2.0 specification. | ||
| 4 | * | ||
| 5 | * It is used/shared between the USB core, the HCDs and couple of other USB | ||
| 6 | * drivers. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __LINUX_CH11_H | ||
| 10 | #define __LINUX_CH11_H | ||
| 11 | |||
| 12 | #include <linux/types.h> /* __u8 etc */ | ||
| 13 | |||
| 14 | /* | ||
| 15 | * Hub request types | ||
| 16 | */ | ||
| 17 | |||
| 18 | #define USB_RT_HUB (USB_TYPE_CLASS | USB_RECIP_DEVICE) | ||
| 19 | #define USB_RT_PORT (USB_TYPE_CLASS | USB_RECIP_OTHER) | ||
| 20 | |||
| 21 | /* | ||
| 22 | * Hub class requests | ||
| 23 | * See USB 2.0 spec Table 11-16 | ||
| 24 | */ | ||
| 25 | #define HUB_CLEAR_TT_BUFFER 8 | ||
| 26 | #define HUB_RESET_TT 9 | ||
| 27 | #define HUB_GET_TT_STATE 10 | ||
| 28 | #define HUB_STOP_TT 11 | ||
| 29 | |||
| 30 | /* | ||
| 31 | * Hub Class feature numbers | ||
| 32 | * See USB 2.0 spec Table 11-17 | ||
| 33 | */ | ||
| 34 | #define C_HUB_LOCAL_POWER 0 | ||
| 35 | #define C_HUB_OVER_CURRENT 1 | ||
| 36 | |||
| 37 | /* | ||
| 38 | * Port feature numbers | ||
| 39 | * See USB 2.0 spec Table 11-17 | ||
| 40 | */ | ||
| 41 | #define USB_PORT_FEAT_CONNECTION 0 | ||
| 42 | #define USB_PORT_FEAT_ENABLE 1 | ||
| 43 | #define USB_PORT_FEAT_SUSPEND 2 /* L2 suspend */ | ||
| 44 | #define USB_PORT_FEAT_OVER_CURRENT 3 | ||
| 45 | #define USB_PORT_FEAT_RESET 4 | ||
| 46 | #define USB_PORT_FEAT_L1 5 /* L1 suspend */ | ||
| 47 | #define USB_PORT_FEAT_POWER 8 | ||
| 48 | #define USB_PORT_FEAT_LOWSPEED 9 /* Should never be used */ | ||
| 49 | #define USB_PORT_FEAT_C_CONNECTION 16 | ||
| 50 | #define USB_PORT_FEAT_C_ENABLE 17 | ||
| 51 | #define USB_PORT_FEAT_C_SUSPEND 18 | ||
| 52 | #define USB_PORT_FEAT_C_OVER_CURRENT 19 | ||
| 53 | #define USB_PORT_FEAT_C_RESET 20 | ||
| 54 | #define USB_PORT_FEAT_TEST 21 | ||
| 55 | #define USB_PORT_FEAT_INDICATOR 22 | ||
| 56 | #define USB_PORT_FEAT_C_PORT_L1 23 | ||
| 57 | |||
| 58 | /* | ||
| 59 | * Hub Status and Hub Change results | ||
| 60 | * See USB 2.0 spec Table 11-19 and Table 11-20 | ||
| 61 | */ | ||
| 62 | struct usb_port_status { | ||
| 63 | __le16 wPortStatus; | ||
| 64 | __le16 wPortChange; | ||
| 65 | } __attribute__ ((packed)); | ||
| 66 | |||
| 67 | /* | ||
| 68 | * wPortStatus bit field | ||
| 69 | * See USB 2.0 spec Table 11-21 | ||
| 70 | */ | ||
| 71 | #define USB_PORT_STAT_CONNECTION 0x0001 | ||
| 72 | #define USB_PORT_STAT_ENABLE 0x0002 | ||
| 73 | #define USB_PORT_STAT_SUSPEND 0x0004 | ||
| 74 | #define USB_PORT_STAT_OVERCURRENT 0x0008 | ||
| 75 | #define USB_PORT_STAT_RESET 0x0010 | ||
| 76 | #define USB_PORT_STAT_L1 0x0020 | ||
| 77 | /* bits 6 to 7 are reserved */ | ||
| 78 | #define USB_PORT_STAT_POWER 0x0100 | ||
| 79 | #define USB_PORT_STAT_LOW_SPEED 0x0200 | ||
| 80 | #define USB_PORT_STAT_HIGH_SPEED 0x0400 | ||
| 81 | #define USB_PORT_STAT_TEST 0x0800 | ||
| 82 | #define USB_PORT_STAT_INDICATOR 0x1000 | ||
| 83 | /* bits 13 to 15 are reserved */ | ||
| 84 | #define USB_PORT_STAT_SUPER_SPEED 0x8000 /* Linux-internal */ | ||
| 85 | |||
| 86 | /* | ||
| 87 | * wPortChange bit field | ||
| 88 | * See USB 2.0 spec Table 11-22 | ||
| 89 | * Bits 0 to 4 shown, bits 5 to 15 are reserved | ||
| 90 | */ | ||
| 91 | #define USB_PORT_STAT_C_CONNECTION 0x0001 | ||
| 92 | #define USB_PORT_STAT_C_ENABLE 0x0002 | ||
| 93 | #define USB_PORT_STAT_C_SUSPEND 0x0004 | ||
| 94 | #define USB_PORT_STAT_C_OVERCURRENT 0x0008 | ||
| 95 | #define USB_PORT_STAT_C_RESET 0x0010 | ||
| 96 | #define USB_PORT_STAT_C_L1 0x0020 | ||
| 97 | |||
| 98 | /* | ||
| 99 | * wHubCharacteristics (masks) | ||
| 100 | * See USB 2.0 spec Table 11-13, offset 3 | ||
| 101 | */ | ||
| 102 | #define HUB_CHAR_LPSM 0x0003 /* D1 .. D0 */ | ||
| 103 | #define HUB_CHAR_COMPOUND 0x0004 /* D2 */ | ||
| 104 | #define HUB_CHAR_OCPM 0x0018 /* D4 .. D3 */ | ||
| 105 | #define HUB_CHAR_TTTT 0x0060 /* D6 .. D5 */ | ||
| 106 | #define HUB_CHAR_PORTIND 0x0080 /* D7 */ | ||
| 107 | |||
| 108 | struct usb_hub_status { | ||
| 109 | __le16 wHubStatus; | ||
| 110 | __le16 wHubChange; | ||
| 111 | } __attribute__ ((packed)); | ||
| 112 | |||
| 113 | /* | ||
| 114 | * Hub Status & Hub Change bit masks | ||
| 115 | * See USB 2.0 spec Table 11-19 and Table 11-20 | ||
| 116 | * Bits 0 and 1 for wHubStatus and wHubChange | ||
| 117 | * Bits 2 to 15 are reserved for both | ||
| 118 | */ | ||
| 119 | #define HUB_STATUS_LOCAL_POWER 0x0001 | ||
| 120 | #define HUB_STATUS_OVERCURRENT 0x0002 | ||
| 121 | #define HUB_CHANGE_LOCAL_POWER 0x0001 | ||
| 122 | #define HUB_CHANGE_OVERCURRENT 0x0002 | ||
| 123 | |||
| 124 | |||
| 125 | /* | ||
| 126 | * Hub descriptor | ||
| 127 | * See USB 2.0 spec Table 11-13 | ||
| 128 | */ | ||
| 129 | |||
| 130 | #define USB_DT_HUB (USB_TYPE_CLASS | 0x09) | ||
| 131 | #define USB_DT_HUB_NONVAR_SIZE 7 | ||
| 132 | |||
| 133 | struct usb_hub_descriptor { | ||
| 134 | __u8 bDescLength; | ||
| 135 | __u8 bDescriptorType; | ||
| 136 | __u8 bNbrPorts; | ||
| 137 | __le16 wHubCharacteristics; | ||
| 138 | __u8 bPwrOn2PwrGood; | ||
| 139 | __u8 bHubContrCurrent; | ||
| 140 | /* add 1 bit for hub status change; round to bytes */ | ||
| 141 | __u8 DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8]; | ||
| 142 | __u8 PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8]; | ||
| 143 | } __attribute__ ((packed)); | ||
| 144 | |||
| 145 | |||
| 146 | /* port indicator status selectors, tables 11-7 and 11-25 */ | ||
| 147 | #define HUB_LED_AUTO 0 | ||
| 148 | #define HUB_LED_AMBER 1 | ||
| 149 | #define HUB_LED_GREEN 2 | ||
| 150 | #define HUB_LED_OFF 3 | ||
| 151 | |||
| 152 | enum hub_led_mode { | ||
| 153 | INDICATOR_AUTO = 0, | ||
| 154 | INDICATOR_CYCLE, | ||
| 155 | /* software blinks for attention: software, hardware, reserved */ | ||
| 156 | INDICATOR_GREEN_BLINK, INDICATOR_GREEN_BLINK_OFF, | ||
| 157 | INDICATOR_AMBER_BLINK, INDICATOR_AMBER_BLINK_OFF, | ||
| 158 | INDICATOR_ALT_BLINK, INDICATOR_ALT_BLINK_OFF | ||
| 159 | } __attribute__ ((packed)); | ||
| 160 | |||
| 161 | /* Transaction Translator Think Times, in bits */ | ||
| 162 | #define HUB_TTTT_8_BITS 0x00 | ||
| 163 | #define HUB_TTTT_16_BITS 0x20 | ||
| 164 | #define HUB_TTTT_24_BITS 0x40 | ||
| 165 | #define HUB_TTTT_32_BITS 0x60 | ||
| 166 | |||
| 167 | #endif /* __LINUX_CH11_H */ | ||
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index e58369ff8168..da2ed77d3e8d 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
| @@ -191,6 +191,8 @@ struct usb_ctrlrequest { | |||
| 191 | #define USB_DT_WIRE_ADAPTER 0x21 | 191 | #define USB_DT_WIRE_ADAPTER 0x21 |
| 192 | #define USB_DT_RPIPE 0x22 | 192 | #define USB_DT_RPIPE 0x22 |
| 193 | #define USB_DT_CS_RADIO_CONTROL 0x23 | 193 | #define USB_DT_CS_RADIO_CONTROL 0x23 |
| 194 | /* From the T10 UAS specification */ | ||
| 195 | #define USB_DT_PIPE_USAGE 0x24 | ||
| 194 | /* From the USB 3.0 spec */ | 196 | /* From the USB 3.0 spec */ |
| 195 | #define USB_DT_SS_ENDPOINT_COMP 0x30 | 197 | #define USB_DT_SS_ENDPOINT_COMP 0x30 |
| 196 | 198 | ||
| @@ -475,7 +477,7 @@ static inline int usb_endpoint_xfer_isoc( | |||
| 475 | static inline int usb_endpoint_is_bulk_in( | 477 | static inline int usb_endpoint_is_bulk_in( |
| 476 | const struct usb_endpoint_descriptor *epd) | 478 | const struct usb_endpoint_descriptor *epd) |
| 477 | { | 479 | { |
| 478 | return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd)); | 480 | return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd); |
| 479 | } | 481 | } |
| 480 | 482 | ||
| 481 | /** | 483 | /** |
| @@ -488,7 +490,7 @@ static inline int usb_endpoint_is_bulk_in( | |||
| 488 | static inline int usb_endpoint_is_bulk_out( | 490 | static inline int usb_endpoint_is_bulk_out( |
| 489 | const struct usb_endpoint_descriptor *epd) | 491 | const struct usb_endpoint_descriptor *epd) |
| 490 | { | 492 | { |
| 491 | return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd)); | 493 | return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd); |
| 492 | } | 494 | } |
| 493 | 495 | ||
| 494 | /** | 496 | /** |
| @@ -501,7 +503,7 @@ static inline int usb_endpoint_is_bulk_out( | |||
| 501 | static inline int usb_endpoint_is_int_in( | 503 | static inline int usb_endpoint_is_int_in( |
| 502 | const struct usb_endpoint_descriptor *epd) | 504 | const struct usb_endpoint_descriptor *epd) |
| 503 | { | 505 | { |
| 504 | return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd)); | 506 | return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd); |
| 505 | } | 507 | } |
| 506 | 508 | ||
| 507 | /** | 509 | /** |
| @@ -514,7 +516,7 @@ static inline int usb_endpoint_is_int_in( | |||
| 514 | static inline int usb_endpoint_is_int_out( | 516 | static inline int usb_endpoint_is_int_out( |
| 515 | const struct usb_endpoint_descriptor *epd) | 517 | const struct usb_endpoint_descriptor *epd) |
| 516 | { | 518 | { |
| 517 | return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd)); | 519 | return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd); |
| 518 | } | 520 | } |
| 519 | 521 | ||
| 520 | /** | 522 | /** |
| @@ -527,7 +529,7 @@ static inline int usb_endpoint_is_int_out( | |||
| 527 | static inline int usb_endpoint_is_isoc_in( | 529 | static inline int usb_endpoint_is_isoc_in( |
| 528 | const struct usb_endpoint_descriptor *epd) | 530 | const struct usb_endpoint_descriptor *epd) |
| 529 | { | 531 | { |
| 530 | return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd)); | 532 | return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd); |
| 531 | } | 533 | } |
| 532 | 534 | ||
| 533 | /** | 535 | /** |
| @@ -540,7 +542,7 @@ static inline int usb_endpoint_is_isoc_in( | |||
| 540 | static inline int usb_endpoint_is_isoc_out( | 542 | static inline int usb_endpoint_is_isoc_out( |
| 541 | const struct usb_endpoint_descriptor *epd) | 543 | const struct usb_endpoint_descriptor *epd) |
| 542 | { | 544 | { |
| 543 | return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd)); | 545 | return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd); |
| 544 | } | 546 | } |
| 545 | 547 | ||
| 546 | /*-------------------------------------------------------------------------*/ | 548 | /*-------------------------------------------------------------------------*/ |
| @@ -556,6 +558,8 @@ struct usb_ss_ep_comp_descriptor { | |||
| 556 | } __attribute__ ((packed)); | 558 | } __attribute__ ((packed)); |
| 557 | 559 | ||
| 558 | #define USB_DT_SS_EP_COMP_SIZE 6 | 560 | #define USB_DT_SS_EP_COMP_SIZE 6 |
| 561 | /* Bits 4:0 of bmAttributes if this is a bulk endpoint */ | ||
| 562 | #define USB_SS_MAX_STREAMS(p) (1 << (p & 0x1f)) | ||
| 559 | 563 | ||
| 560 | /*-------------------------------------------------------------------------*/ | 564 | /*-------------------------------------------------------------------------*/ |
| 561 | 565 | ||
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 738ea1a691cb..139353efad34 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -326,6 +326,7 @@ struct usb_composite_dev { | |||
| 326 | 326 | ||
| 327 | /* private: */ | 327 | /* private: */ |
| 328 | /* internals */ | 328 | /* internals */ |
| 329 | unsigned int suspended:1; | ||
| 329 | struct usb_device_descriptor desc; | 330 | struct usb_device_descriptor desc; |
| 330 | struct list_head configs; | 331 | struct list_head configs; |
| 331 | struct usb_composite_driver *driver; | 332 | struct usb_composite_driver *driver; |
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h index af4b86f3aca3..80287af2a738 100644 --- a/include/linux/usb/ehci_def.h +++ b/include/linux/usb/ehci_def.h | |||
| @@ -45,7 +45,7 @@ struct ehci_caps { | |||
| 45 | #define HCC_CANPARK(p) ((p)&(1 << 2)) /* true: can park on async qh */ | 45 | #define HCC_CANPARK(p) ((p)&(1 << 2)) /* true: can park on async qh */ |
| 46 | #define HCC_PGM_FRAMELISTLEN(p) ((p)&(1 << 1)) /* true: periodic_size changes*/ | 46 | #define HCC_PGM_FRAMELISTLEN(p) ((p)&(1 << 1)) /* true: periodic_size changes*/ |
| 47 | #define HCC_64BIT_ADDR(p) ((p)&(1)) /* true: can use 64-bit addr */ | 47 | #define HCC_64BIT_ADDR(p) ((p)&(1)) /* true: can use 64-bit addr */ |
| 48 | u8 portroute [8]; /* nibbles for routing - offset 0xC */ | 48 | u8 portroute[8]; /* nibbles for routing - offset 0xC */ |
| 49 | } __attribute__ ((packed)); | 49 | } __attribute__ ((packed)); |
| 50 | 50 | ||
| 51 | 51 | ||
| @@ -92,14 +92,14 @@ struct ehci_regs { | |||
| 92 | /* ASYNCLISTADDR: offset 0x18 */ | 92 | /* ASYNCLISTADDR: offset 0x18 */ |
| 93 | u32 async_next; /* address of next async queue head */ | 93 | u32 async_next; /* address of next async queue head */ |
| 94 | 94 | ||
| 95 | u32 reserved [9]; | 95 | u32 reserved[9]; |
| 96 | 96 | ||
| 97 | /* CONFIGFLAG: offset 0x40 */ | 97 | /* CONFIGFLAG: offset 0x40 */ |
| 98 | u32 configured_flag; | 98 | u32 configured_flag; |
| 99 | #define FLAG_CF (1<<0) /* true: we'll support "high speed" */ | 99 | #define FLAG_CF (1<<0) /* true: we'll support "high speed" */ |
| 100 | 100 | ||
| 101 | /* PORTSC: offset 0x44 */ | 101 | /* PORTSC: offset 0x44 */ |
| 102 | u32 port_status [0]; /* up to N_PORTS */ | 102 | u32 port_status[0]; /* up to N_PORTS */ |
| 103 | /* 31:23 reserved */ | 103 | /* 31:23 reserved */ |
| 104 | #define PORT_WKOC_E (1<<22) /* wake on overcurrent (enable) */ | 104 | #define PORT_WKOC_E (1<<22) /* wake on overcurrent (enable) */ |
| 105 | #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ | 105 | #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ |
diff --git a/include/linux/usb/functionfs.h b/include/linux/usb/functionfs.h new file mode 100644 index 000000000000..a34a2a043b21 --- /dev/null +++ b/include/linux/usb/functionfs.h | |||
| @@ -0,0 +1,199 @@ | |||
| 1 | #ifndef __LINUX_FUNCTIONFS_H__ | ||
| 2 | #define __LINUX_FUNCTIONFS_H__ 1 | ||
| 3 | |||
| 4 | |||
| 5 | #include <linux/types.h> | ||
| 6 | #include <linux/ioctl.h> | ||
| 7 | |||
| 8 | #include <linux/usb/ch9.h> | ||
| 9 | |||
| 10 | |||
| 11 | enum { | ||
| 12 | FUNCTIONFS_DESCRIPTORS_MAGIC = 1, | ||
| 13 | FUNCTIONFS_STRINGS_MAGIC = 2 | ||
| 14 | }; | ||
| 15 | |||
| 16 | |||
| 17 | #ifndef __KERNEL__ | ||
| 18 | |||
| 19 | /* Descriptor of an non-audio endpoint */ | ||
| 20 | struct usb_endpoint_descriptor_no_audio { | ||
| 21 | __u8 bLength; | ||
| 22 | __u8 bDescriptorType; | ||
| 23 | |||
| 24 | __u8 bEndpointAddress; | ||
| 25 | __u8 bmAttributes; | ||
| 26 | __le16 wMaxPacketSize; | ||
| 27 | __u8 bInterval; | ||
| 28 | } __attribute__((packed)); | ||
| 29 | |||
| 30 | |||
| 31 | /* | ||
| 32 | * All numbers must be in little endian order. | ||
| 33 | */ | ||
| 34 | |||
| 35 | struct usb_functionfs_descs_head { | ||
| 36 | __le32 magic; | ||
| 37 | __le32 length; | ||
| 38 | __le32 fs_count; | ||
| 39 | __le32 hs_count; | ||
| 40 | } __attribute__((packed)); | ||
| 41 | |||
| 42 | /* | ||
| 43 | * Descriptors format: | ||
| 44 | * | ||
| 45 | * | off | name | type | description | | ||
| 46 | * |-----+-----------+--------------+--------------------------------------| | ||
| 47 | * | 0 | magic | LE32 | FUNCTIONFS_{FS,HS}_DESCRIPTORS_MAGIC | | ||
| 48 | * | 4 | lenght | LE32 | length of the whole data chunk | | ||
| 49 | * | 8 | fs_count | LE32 | number of full-speed descriptors | | ||
| 50 | * | 12 | hs_count | LE32 | number of high-speed descriptors | | ||
| 51 | * | 16 | fs_descrs | Descriptor[] | list of full-speed descriptors | | ||
| 52 | * | | hs_descrs | Descriptor[] | list of high-speed descriptors | | ||
| 53 | * | ||
| 54 | * descs are just valid USB descriptors and have the following format: | ||
| 55 | * | ||
| 56 | * | off | name | type | description | | ||
| 57 | * |-----+-----------------+------+--------------------------| | ||
| 58 | * | 0 | bLength | U8 | length of the descriptor | | ||
| 59 | * | 1 | bDescriptorType | U8 | descriptor type | | ||
| 60 | * | 2 | payload | | descriptor's payload | | ||
| 61 | */ | ||
| 62 | |||
| 63 | struct usb_functionfs_strings_head { | ||
| 64 | __le32 magic; | ||
| 65 | __le32 length; | ||
| 66 | __le32 str_count; | ||
| 67 | __le32 lang_count; | ||
| 68 | } __attribute__((packed)); | ||
| 69 | |||
| 70 | /* | ||
| 71 | * Strings format: | ||
| 72 | * | ||
| 73 | * | off | name | type | description | | ||
| 74 | * |-----+------------+-----------------------+----------------------------| | ||
| 75 | * | 0 | magic | LE32 | FUNCTIONFS_STRINGS_MAGIC | | ||
| 76 | * | 4 | length | LE32 | length of the data chunk | | ||
| 77 | * | 8 | str_count | LE32 | number of strings | | ||
| 78 | * | 12 | lang_count | LE32 | number of languages | | ||
| 79 | * | 16 | stringtab | StringTab[lang_count] | table of strings per lang | | ||
| 80 | * | ||
| 81 | * For each language there is one stringtab entry (ie. there are lang_count | ||
| 82 | * stringtab entires). Each StringTab has following format: | ||
| 83 | * | ||
| 84 | * | off | name | type | description | | ||
| 85 | * |-----+---------+-------------------+------------------------------------| | ||
| 86 | * | 0 | lang | LE16 | language code | | ||
| 87 | * | 2 | strings | String[str_count] | array of strings in given language | | ||
| 88 | * | ||
| 89 | * For each string ther is one strings entry (ie. there are str_count | ||
| 90 | * string entries). Each String is a NUL terminated string encoded in | ||
| 91 | * UTF-8. | ||
| 92 | */ | ||
| 93 | |||
| 94 | #endif | ||
| 95 | |||
| 96 | |||
| 97 | /* | ||
| 98 | * Events are delivered on the ep0 file descriptor, when the user mode driver | ||
| 99 | * reads from this file descriptor after writing the descriptors. Don't | ||
| 100 | * stop polling this descriptor. | ||
| 101 | */ | ||
| 102 | |||
| 103 | enum usb_functionfs_event_type { | ||
| 104 | FUNCTIONFS_BIND, | ||
| 105 | FUNCTIONFS_UNBIND, | ||
| 106 | |||
| 107 | FUNCTIONFS_ENABLE, | ||
| 108 | FUNCTIONFS_DISABLE, | ||
| 109 | |||
| 110 | FUNCTIONFS_SETUP, | ||
| 111 | |||
| 112 | FUNCTIONFS_SUSPEND, | ||
| 113 | FUNCTIONFS_RESUME | ||
| 114 | }; | ||
| 115 | |||
| 116 | /* NOTE: this structure must stay the same size and layout on | ||
| 117 | * both 32-bit and 64-bit kernels. | ||
| 118 | */ | ||
| 119 | struct usb_functionfs_event { | ||
| 120 | union { | ||
| 121 | /* SETUP: packet; DATA phase i/o precedes next event | ||
| 122 | *(setup.bmRequestType & USB_DIR_IN) flags direction */ | ||
| 123 | struct usb_ctrlrequest setup; | ||
| 124 | } __attribute__((packed)) u; | ||
| 125 | |||
| 126 | /* enum usb_functionfs_event_type */ | ||
| 127 | __u8 type; | ||
| 128 | __u8 _pad[3]; | ||
| 129 | } __attribute__((packed)); | ||
| 130 | |||
| 131 | |||
| 132 | /* Endpoint ioctls */ | ||
| 133 | /* The same as in gadgetfs */ | ||
| 134 | |||
| 135 | /* IN transfers may be reported to the gadget driver as complete | ||
| 136 | * when the fifo is loaded, before the host reads the data; | ||
| 137 | * OUT transfers may be reported to the host's "client" driver as | ||
| 138 | * complete when they're sitting in the FIFO unread. | ||
| 139 | * THIS returns how many bytes are "unclaimed" in the endpoint fifo | ||
| 140 | * (needed for precise fault handling, when the hardware allows it) | ||
| 141 | */ | ||
| 142 | #define FUNCTIONFS_FIFO_STATUS _IO('g', 1) | ||
| 143 | |||
| 144 | /* discards any unclaimed data in the fifo. */ | ||
| 145 | #define FUNCTIONFS_FIFO_FLUSH _IO('g', 2) | ||
| 146 | |||
| 147 | /* resets endpoint halt+toggle; used to implement set_interface. | ||
| 148 | * some hardware (like pxa2xx) can't support this. | ||
| 149 | */ | ||
| 150 | #define FUNCTIONFS_CLEAR_HALT _IO('g', 3) | ||
| 151 | |||
| 152 | /* Specific for functionfs */ | ||
| 153 | |||
| 154 | /* | ||
| 155 | * Returns reverse mapping of an interface. Called on EP0. If there | ||
| 156 | * is no such interface returns -EDOM. If function is not active | ||
| 157 | * returns -ENODEV. | ||
| 158 | */ | ||
| 159 | #define FUNCTIONFS_INTERFACE_REVMAP _IO('g', 128) | ||
| 160 | |||
| 161 | /* | ||
| 162 | * Returns real bEndpointAddress of an endpoint. If function is not | ||
| 163 | * active returns -ENODEV. | ||
| 164 | */ | ||
| 165 | #define FUNCTIONFS_ENDPOINT_REVMAP _IO('g', 129) | ||
| 166 | |||
| 167 | |||
| 168 | #ifdef __KERNEL__ | ||
| 169 | |||
| 170 | struct ffs_data; | ||
| 171 | struct usb_composite_dev; | ||
| 172 | struct usb_configuration; | ||
| 173 | |||
| 174 | |||
| 175 | static int functionfs_init(void) __attribute__((warn_unused_result)); | ||
| 176 | static void functionfs_cleanup(void); | ||
| 177 | |||
| 178 | static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev) | ||
| 179 | __attribute__((warn_unused_result, nonnull)); | ||
| 180 | static void functionfs_unbind(struct ffs_data *ffs) | ||
| 181 | __attribute__((nonnull)); | ||
| 182 | |||
| 183 | static int functionfs_add(struct usb_composite_dev *cdev, | ||
| 184 | struct usb_configuration *c, | ||
| 185 | struct ffs_data *ffs) | ||
| 186 | __attribute__((warn_unused_result, nonnull)); | ||
| 187 | |||
| 188 | |||
| 189 | static int functionfs_ready_callback(struct ffs_data *ffs) | ||
| 190 | __attribute__((warn_unused_result, nonnull)); | ||
| 191 | static void functionfs_closed_callback(struct ffs_data *ffs) | ||
| 192 | __attribute__((nonnull)); | ||
| 193 | static int functionfs_check_dev_callback(const char *dev_name) | ||
| 194 | __attribute__((warn_unused_result, nonnull)); | ||
| 195 | |||
| 196 | |||
| 197 | #endif | ||
| 198 | |||
| 199 | #endif | ||
diff --git a/include/linux/usb/g_hid.h b/include/linux/usb/g_hid.h new file mode 100644 index 000000000000..50f5745df28c --- /dev/null +++ b/include/linux/usb/g_hid.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | /* | ||
| 2 | * g_hid.h -- Header file for USB HID gadget driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Fabien Chouteau <fabien.chouteau@barco.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __LINUX_USB_G_HID_H | ||
| 22 | #define __LINUX_USB_G_HID_H | ||
| 23 | |||
| 24 | struct hidg_func_descriptor { | ||
| 25 | unsigned char subclass; | ||
| 26 | unsigned char protocol; | ||
| 27 | unsigned short report_length; | ||
| 28 | unsigned short report_desc_length; | ||
| 29 | unsigned char report_desc[]; | ||
| 30 | }; | ||
| 31 | |||
| 32 | #endif /* __LINUX_USB_G_HID_H */ | ||
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index bbf45d500b6d..d3ef42d7d2f0 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | #ifndef __LINUX_USB_GADGET_H | 15 | #ifndef __LINUX_USB_GADGET_H |
| 16 | #define __LINUX_USB_GADGET_H | 16 | #define __LINUX_USB_GADGET_H |
| 17 | 17 | ||
| 18 | #include <linux/slab.h> | ||
| 19 | |||
| 18 | struct usb_ep; | 20 | struct usb_ep; |
| 19 | 21 | ||
| 20 | /** | 22 | /** |
| @@ -492,9 +494,13 @@ static inline void set_gadget_data(struct usb_gadget *gadget, void *data) | |||
| 492 | { dev_set_drvdata(&gadget->dev, data); } | 494 | { dev_set_drvdata(&gadget->dev, data); } |
| 493 | static inline void *get_gadget_data(struct usb_gadget *gadget) | 495 | static inline void *get_gadget_data(struct usb_gadget *gadget) |
| 494 | { return dev_get_drvdata(&gadget->dev); } | 496 | { return dev_get_drvdata(&gadget->dev); } |
| 497 | static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev) | ||
| 498 | { | ||
| 499 | return container_of(dev, struct usb_gadget, dev); | ||
| 500 | } | ||
| 495 | 501 | ||
| 496 | /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */ | 502 | /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */ |
| 497 | #define gadget_for_each_ep(tmp,gadget) \ | 503 | #define gadget_for_each_ep(tmp, gadget) \ |
| 498 | list_for_each_entry(tmp, &(gadget)->ep_list, ep_list) | 504 | list_for_each_entry(tmp, &(gadget)->ep_list, ep_list) |
| 499 | 505 | ||
| 500 | 506 | ||
diff --git a/include/linux/usb/gadgetfs.h b/include/linux/usb/gadgetfs.h index 612102e4d75e..0bb12e0d4f8f 100644 --- a/include/linux/usb/gadgetfs.h +++ b/include/linux/usb/gadgetfs.h | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | #define __LINUX_USB_GADGETFS_H | 19 | #define __LINUX_USB_GADGETFS_H |
| 20 | 20 | ||
| 21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
| 22 | #include <asm/ioctl.h> | 22 | #include <linux/ioctl.h> |
| 23 | 23 | ||
| 24 | #include <linux/usb/ch9.h> | 24 | #include <linux/usb/ch9.h> |
| 25 | 25 | ||
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h new file mode 100644 index 000000000000..2e3a4ea1a3da --- /dev/null +++ b/include/linux/usb/hcd.h | |||
| @@ -0,0 +1,625 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2001-2002 by David Brownell | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify it | ||
| 5 | * under the terms of the GNU General Public License as published by the | ||
| 6 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 7 | * option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, but | ||
| 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
| 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| 12 | * for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software Foundation, | ||
| 16 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __USB_CORE_HCD_H | ||
| 20 | #define __USB_CORE_HCD_H | ||
| 21 | |||
| 22 | #ifdef __KERNEL__ | ||
| 23 | |||
| 24 | #include <linux/rwsem.h> | ||
| 25 | |||
| 26 | #define MAX_TOPO_LEVEL 6 | ||
| 27 | |||
| 28 | /* This file contains declarations of usbcore internals that are mostly | ||
| 29 | * used or exposed by Host Controller Drivers. | ||
| 30 | */ | ||
| 31 | |||
| 32 | /* | ||
| 33 | * USB Packet IDs (PIDs) | ||
| 34 | */ | ||
| 35 | #define USB_PID_EXT 0xf0 /* USB 2.0 LPM ECN */ | ||
| 36 | #define USB_PID_OUT 0xe1 | ||
| 37 | #define USB_PID_ACK 0xd2 | ||
| 38 | #define USB_PID_DATA0 0xc3 | ||
| 39 | #define USB_PID_PING 0xb4 /* USB 2.0 */ | ||
| 40 | #define USB_PID_SOF 0xa5 | ||
| 41 | #define USB_PID_NYET 0x96 /* USB 2.0 */ | ||
| 42 | #define USB_PID_DATA2 0x87 /* USB 2.0 */ | ||
| 43 | #define USB_PID_SPLIT 0x78 /* USB 2.0 */ | ||
| 44 | #define USB_PID_IN 0x69 | ||
| 45 | #define USB_PID_NAK 0x5a | ||
| 46 | #define USB_PID_DATA1 0x4b | ||
| 47 | #define USB_PID_PREAMBLE 0x3c /* Token mode */ | ||
| 48 | #define USB_PID_ERR 0x3c /* USB 2.0: handshake mode */ | ||
| 49 | #define USB_PID_SETUP 0x2d | ||
| 50 | #define USB_PID_STALL 0x1e | ||
| 51 | #define USB_PID_MDATA 0x0f /* USB 2.0 */ | ||
| 52 | |||
| 53 | /*-------------------------------------------------------------------------*/ | ||
| 54 | |||
| 55 | /* | ||
| 56 | * USB Host Controller Driver (usb_hcd) framework | ||
| 57 | * | ||
| 58 | * Since "struct usb_bus" is so thin, you can't share much code in it. | ||
| 59 | * This framework is a layer over that, and should be more sharable. | ||
| 60 | * | ||
| 61 | * @authorized_default: Specifies if new devices are authorized to | ||
| 62 | * connect by default or they require explicit | ||
| 63 | * user space authorization; this bit is settable | ||
| 64 | * through /sys/class/usb_host/X/authorized_default. | ||
| 65 | * For the rest is RO, so we don't lock to r/w it. | ||
| 66 | */ | ||
| 67 | |||
| 68 | /*-------------------------------------------------------------------------*/ | ||
| 69 | |||
| 70 | struct usb_hcd { | ||
| 71 | |||
| 72 | /* | ||
| 73 | * housekeeping | ||
| 74 | */ | ||
| 75 | struct usb_bus self; /* hcd is-a bus */ | ||
| 76 | struct kref kref; /* reference counter */ | ||
| 77 | |||
| 78 | const char *product_desc; /* product/vendor string */ | ||
| 79 | char irq_descr[24]; /* driver + bus # */ | ||
| 80 | |||
| 81 | struct timer_list rh_timer; /* drives root-hub polling */ | ||
| 82 | struct urb *status_urb; /* the current status urb */ | ||
| 83 | #ifdef CONFIG_USB_SUSPEND | ||
| 84 | struct work_struct wakeup_work; /* for remote wakeup */ | ||
| 85 | #endif | ||
| 86 | |||
| 87 | /* | ||
| 88 | * hardware info/state | ||
| 89 | */ | ||
| 90 | const struct hc_driver *driver; /* hw-specific hooks */ | ||
| 91 | |||
| 92 | /* Flags that need to be manipulated atomically */ | ||
| 93 | unsigned long flags; | ||
| 94 | #define HCD_FLAG_HW_ACCESSIBLE 0x00000001 | ||
| 95 | #define HCD_FLAG_SAW_IRQ 0x00000002 | ||
| 96 | |||
| 97 | unsigned rh_registered:1;/* is root hub registered? */ | ||
| 98 | |||
| 99 | /* The next flag is a stopgap, to be removed when all the HCDs | ||
| 100 | * support the new root-hub polling mechanism. */ | ||
| 101 | unsigned uses_new_polling:1; | ||
| 102 | unsigned poll_rh:1; /* poll for rh status? */ | ||
| 103 | unsigned poll_pending:1; /* status has changed? */ | ||
| 104 | unsigned wireless:1; /* Wireless USB HCD */ | ||
| 105 | unsigned authorized_default:1; | ||
| 106 | unsigned has_tt:1; /* Integrated TT in root hub */ | ||
| 107 | |||
| 108 | int irq; /* irq allocated */ | ||
| 109 | void __iomem *regs; /* device memory/io */ | ||
| 110 | u64 rsrc_start; /* memory/io resource start */ | ||
| 111 | u64 rsrc_len; /* memory/io resource length */ | ||
| 112 | unsigned power_budget; /* in mA, 0 = no limit */ | ||
| 113 | |||
| 114 | /* bandwidth_mutex should be taken before adding or removing | ||
| 115 | * any new bus bandwidth constraints: | ||
| 116 | * 1. Before adding a configuration for a new device. | ||
| 117 | * 2. Before removing the configuration to put the device into | ||
| 118 | * the addressed state. | ||
| 119 | * 3. Before selecting a different configuration. | ||
| 120 | * 4. Before selecting an alternate interface setting. | ||
| 121 | * | ||
| 122 | * bandwidth_mutex should be dropped after a successful control message | ||
| 123 | * to the device, or resetting the bandwidth after a failed attempt. | ||
| 124 | */ | ||
| 125 | struct mutex bandwidth_mutex; | ||
| 126 | |||
| 127 | |||
| 128 | #define HCD_BUFFER_POOLS 4 | ||
| 129 | struct dma_pool *pool[HCD_BUFFER_POOLS]; | ||
| 130 | |||
| 131 | int state; | ||
| 132 | # define __ACTIVE 0x01 | ||
| 133 | # define __SUSPEND 0x04 | ||
| 134 | # define __TRANSIENT 0x80 | ||
| 135 | |||
| 136 | # define HC_STATE_HALT 0 | ||
| 137 | # define HC_STATE_RUNNING (__ACTIVE) | ||
| 138 | # define HC_STATE_QUIESCING (__SUSPEND|__TRANSIENT|__ACTIVE) | ||
| 139 | # define HC_STATE_RESUMING (__SUSPEND|__TRANSIENT) | ||
| 140 | # define HC_STATE_SUSPENDED (__SUSPEND) | ||
| 141 | |||
| 142 | #define HC_IS_RUNNING(state) ((state) & __ACTIVE) | ||
| 143 | #define HC_IS_SUSPENDED(state) ((state) & __SUSPEND) | ||
| 144 | |||
| 145 | /* more shared queuing code would be good; it should support | ||
| 146 | * smarter scheduling, handle transaction translators, etc; | ||
| 147 | * input size of periodic table to an interrupt scheduler. | ||
| 148 | * (ohci 32, uhci 1024, ehci 256/512/1024). | ||
| 149 | */ | ||
| 150 | |||
| 151 | /* The HC driver's private data is stored at the end of | ||
| 152 | * this structure. | ||
| 153 | */ | ||
| 154 | unsigned long hcd_priv[0] | ||
| 155 | __attribute__ ((aligned(sizeof(unsigned long)))); | ||
| 156 | }; | ||
| 157 | |||
| 158 | /* 2.4 does this a bit differently ... */ | ||
| 159 | static inline struct usb_bus *hcd_to_bus(struct usb_hcd *hcd) | ||
| 160 | { | ||
| 161 | return &hcd->self; | ||
| 162 | } | ||
| 163 | |||
| 164 | static inline struct usb_hcd *bus_to_hcd(struct usb_bus *bus) | ||
| 165 | { | ||
| 166 | return container_of(bus, struct usb_hcd, self); | ||
| 167 | } | ||
| 168 | |||
| 169 | struct hcd_timeout { /* timeouts we allocate */ | ||
| 170 | struct list_head timeout_list; | ||
| 171 | struct timer_list timer; | ||
| 172 | }; | ||
| 173 | |||
| 174 | /*-------------------------------------------------------------------------*/ | ||
| 175 | |||
| 176 | |||
| 177 | struct hc_driver { | ||
| 178 | const char *description; /* "ehci-hcd" etc */ | ||
| 179 | const char *product_desc; /* product/vendor string */ | ||
| 180 | size_t hcd_priv_size; /* size of private data */ | ||
| 181 | |||
| 182 | /* irq handler */ | ||
| 183 | irqreturn_t (*irq) (struct usb_hcd *hcd); | ||
| 184 | |||
| 185 | int flags; | ||
| 186 | #define HCD_MEMORY 0x0001 /* HC regs use memory (else I/O) */ | ||
| 187 | #define HCD_LOCAL_MEM 0x0002 /* HC needs local memory */ | ||
| 188 | #define HCD_USB11 0x0010 /* USB 1.1 */ | ||
| 189 | #define HCD_USB2 0x0020 /* USB 2.0 */ | ||
| 190 | #define HCD_USB3 0x0040 /* USB 3.0 */ | ||
| 191 | #define HCD_MASK 0x0070 | ||
| 192 | |||
| 193 | /* called to init HCD and root hub */ | ||
| 194 | int (*reset) (struct usb_hcd *hcd); | ||
| 195 | int (*start) (struct usb_hcd *hcd); | ||
| 196 | |||
| 197 | /* NOTE: these suspend/resume calls relate to the HC as | ||
| 198 | * a whole, not just the root hub; they're for PCI bus glue. | ||
| 199 | */ | ||
| 200 | /* called after suspending the hub, before entering D3 etc */ | ||
| 201 | int (*pci_suspend)(struct usb_hcd *hcd); | ||
| 202 | |||
| 203 | /* called after entering D0 (etc), before resuming the hub */ | ||
| 204 | int (*pci_resume)(struct usb_hcd *hcd, bool hibernated); | ||
| 205 | |||
| 206 | /* cleanly make HCD stop writing memory and doing I/O */ | ||
| 207 | void (*stop) (struct usb_hcd *hcd); | ||
| 208 | |||
| 209 | /* shutdown HCD */ | ||
| 210 | void (*shutdown) (struct usb_hcd *hcd); | ||
| 211 | |||
| 212 | /* return current frame number */ | ||
| 213 | int (*get_frame_number) (struct usb_hcd *hcd); | ||
| 214 | |||
| 215 | /* manage i/o requests, device state */ | ||
| 216 | int (*urb_enqueue)(struct usb_hcd *hcd, | ||
| 217 | struct urb *urb, gfp_t mem_flags); | ||
| 218 | int (*urb_dequeue)(struct usb_hcd *hcd, | ||
| 219 | struct urb *urb, int status); | ||
| 220 | |||
| 221 | /* hw synch, freeing endpoint resources that urb_dequeue can't */ | ||
| 222 | void (*endpoint_disable)(struct usb_hcd *hcd, | ||
| 223 | struct usb_host_endpoint *ep); | ||
| 224 | |||
| 225 | /* (optional) reset any endpoint state such as sequence number | ||
| 226 | and current window */ | ||
| 227 | void (*endpoint_reset)(struct usb_hcd *hcd, | ||
| 228 | struct usb_host_endpoint *ep); | ||
| 229 | |||
| 230 | /* root hub support */ | ||
| 231 | int (*hub_status_data) (struct usb_hcd *hcd, char *buf); | ||
| 232 | int (*hub_control) (struct usb_hcd *hcd, | ||
| 233 | u16 typeReq, u16 wValue, u16 wIndex, | ||
| 234 | char *buf, u16 wLength); | ||
| 235 | int (*bus_suspend)(struct usb_hcd *); | ||
| 236 | int (*bus_resume)(struct usb_hcd *); | ||
| 237 | int (*start_port_reset)(struct usb_hcd *, unsigned port_num); | ||
| 238 | |||
| 239 | /* force handover of high-speed port to full-speed companion */ | ||
| 240 | void (*relinquish_port)(struct usb_hcd *, int); | ||
| 241 | /* has a port been handed over to a companion? */ | ||
| 242 | int (*port_handed_over)(struct usb_hcd *, int); | ||
| 243 | |||
| 244 | /* CLEAR_TT_BUFFER completion callback */ | ||
| 245 | void (*clear_tt_buffer_complete)(struct usb_hcd *, | ||
| 246 | struct usb_host_endpoint *); | ||
| 247 | |||
| 248 | /* xHCI specific functions */ | ||
| 249 | /* Called by usb_alloc_dev to alloc HC device structures */ | ||
| 250 | int (*alloc_dev)(struct usb_hcd *, struct usb_device *); | ||
| 251 | /* Called by usb_disconnect to free HC device structures */ | ||
| 252 | void (*free_dev)(struct usb_hcd *, struct usb_device *); | ||
| 253 | /* Change a group of bulk endpoints to support multiple stream IDs */ | ||
| 254 | int (*alloc_streams)(struct usb_hcd *hcd, struct usb_device *udev, | ||
| 255 | struct usb_host_endpoint **eps, unsigned int num_eps, | ||
| 256 | unsigned int num_streams, gfp_t mem_flags); | ||
| 257 | /* Reverts a group of bulk endpoints back to not using stream IDs. | ||
| 258 | * Can fail if we run out of memory. | ||
| 259 | */ | ||
| 260 | int (*free_streams)(struct usb_hcd *hcd, struct usb_device *udev, | ||
| 261 | struct usb_host_endpoint **eps, unsigned int num_eps, | ||
| 262 | gfp_t mem_flags); | ||
| 263 | |||
| 264 | /* Bandwidth computation functions */ | ||
| 265 | /* Note that add_endpoint() can only be called once per endpoint before | ||
| 266 | * check_bandwidth() or reset_bandwidth() must be called. | ||
| 267 | * drop_endpoint() can only be called once per endpoint also. | ||
| 268 | * A call to xhci_drop_endpoint() followed by a call to | ||
| 269 | * xhci_add_endpoint() will add the endpoint to the schedule with | ||
| 270 | * possibly new parameters denoted by a different endpoint descriptor | ||
| 271 | * in usb_host_endpoint. A call to xhci_add_endpoint() followed by a | ||
| 272 | * call to xhci_drop_endpoint() is not allowed. | ||
| 273 | */ | ||
| 274 | /* Allocate endpoint resources and add them to a new schedule */ | ||
| 275 | int (*add_endpoint)(struct usb_hcd *, struct usb_device *, | ||
| 276 | struct usb_host_endpoint *); | ||
| 277 | /* Drop an endpoint from a new schedule */ | ||
| 278 | int (*drop_endpoint)(struct usb_hcd *, struct usb_device *, | ||
| 279 | struct usb_host_endpoint *); | ||
| 280 | /* Check that a new hardware configuration, set using | ||
| 281 | * endpoint_enable and endpoint_disable, does not exceed bus | ||
| 282 | * bandwidth. This must be called before any set configuration | ||
| 283 | * or set interface requests are sent to the device. | ||
| 284 | */ | ||
| 285 | int (*check_bandwidth)(struct usb_hcd *, struct usb_device *); | ||
| 286 | /* Reset the device schedule to the last known good schedule, | ||
| 287 | * which was set from a previous successful call to | ||
| 288 | * check_bandwidth(). This reverts any add_endpoint() and | ||
| 289 | * drop_endpoint() calls since that last successful call. | ||
| 290 | * Used for when a check_bandwidth() call fails due to resource | ||
| 291 | * or bandwidth constraints. | ||
| 292 | */ | ||
| 293 | void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); | ||
| 294 | /* Returns the hardware-chosen device address */ | ||
| 295 | int (*address_device)(struct usb_hcd *, struct usb_device *udev); | ||
| 296 | /* Notifies the HCD after a hub descriptor is fetched. | ||
| 297 | * Will block. | ||
| 298 | */ | ||
| 299 | int (*update_hub_device)(struct usb_hcd *, struct usb_device *hdev, | ||
| 300 | struct usb_tt *tt, gfp_t mem_flags); | ||
| 301 | int (*reset_device)(struct usb_hcd *, struct usb_device *); | ||
| 302 | }; | ||
| 303 | |||
| 304 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); | ||
| 305 | extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb, | ||
| 306 | int status); | ||
| 307 | extern void usb_hcd_unlink_urb_from_ep(struct usb_hcd *hcd, struct urb *urb); | ||
| 308 | |||
| 309 | extern int usb_hcd_submit_urb(struct urb *urb, gfp_t mem_flags); | ||
| 310 | extern int usb_hcd_unlink_urb(struct urb *urb, int status); | ||
| 311 | extern void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, | ||
| 312 | int status); | ||
| 313 | extern void usb_hcd_flush_endpoint(struct usb_device *udev, | ||
| 314 | struct usb_host_endpoint *ep); | ||
| 315 | extern void usb_hcd_disable_endpoint(struct usb_device *udev, | ||
| 316 | struct usb_host_endpoint *ep); | ||
| 317 | extern void usb_hcd_reset_endpoint(struct usb_device *udev, | ||
| 318 | struct usb_host_endpoint *ep); | ||
| 319 | extern void usb_hcd_synchronize_unlinks(struct usb_device *udev); | ||
| 320 | extern int usb_hcd_alloc_bandwidth(struct usb_device *udev, | ||
| 321 | struct usb_host_config *new_config, | ||
| 322 | struct usb_host_interface *old_alt, | ||
| 323 | struct usb_host_interface *new_alt); | ||
| 324 | extern int usb_hcd_get_frame_number(struct usb_device *udev); | ||
| 325 | |||
| 326 | extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver, | ||
| 327 | struct device *dev, const char *bus_name); | ||
| 328 | extern struct usb_hcd *usb_get_hcd(struct usb_hcd *hcd); | ||
| 329 | extern void usb_put_hcd(struct usb_hcd *hcd); | ||
| 330 | extern int usb_add_hcd(struct usb_hcd *hcd, | ||
| 331 | unsigned int irqnum, unsigned long irqflags); | ||
| 332 | extern void usb_remove_hcd(struct usb_hcd *hcd); | ||
| 333 | |||
| 334 | struct platform_device; | ||
| 335 | extern void usb_hcd_platform_shutdown(struct platform_device *dev); | ||
| 336 | |||
| 337 | #ifdef CONFIG_PCI | ||
| 338 | struct pci_dev; | ||
| 339 | struct pci_device_id; | ||
| 340 | extern int usb_hcd_pci_probe(struct pci_dev *dev, | ||
| 341 | const struct pci_device_id *id); | ||
| 342 | extern void usb_hcd_pci_remove(struct pci_dev *dev); | ||
| 343 | extern void usb_hcd_pci_shutdown(struct pci_dev *dev); | ||
| 344 | |||
| 345 | #ifdef CONFIG_PM_SLEEP | ||
| 346 | extern const struct dev_pm_ops usb_hcd_pci_pm_ops; | ||
| 347 | #endif | ||
| 348 | #endif /* CONFIG_PCI */ | ||
| 349 | |||
| 350 | /* pci-ish (pdev null is ok) buffer alloc/mapping support */ | ||
| 351 | int hcd_buffer_create(struct usb_hcd *hcd); | ||
| 352 | void hcd_buffer_destroy(struct usb_hcd *hcd); | ||
| 353 | |||
| 354 | void *hcd_buffer_alloc(struct usb_bus *bus, size_t size, | ||
| 355 | gfp_t mem_flags, dma_addr_t *dma); | ||
| 356 | void hcd_buffer_free(struct usb_bus *bus, size_t size, | ||
| 357 | void *addr, dma_addr_t dma); | ||
| 358 | |||
| 359 | /* generic bus glue, needed for host controllers that don't use PCI */ | ||
| 360 | extern irqreturn_t usb_hcd_irq(int irq, void *__hcd); | ||
| 361 | |||
| 362 | extern void usb_hc_died(struct usb_hcd *hcd); | ||
| 363 | extern void usb_hcd_poll_rh_status(struct usb_hcd *hcd); | ||
| 364 | |||
| 365 | /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ | ||
| 366 | #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) | ||
| 367 | #define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep))) | ||
| 368 | #define usb_settoggle(dev, ep, out, bit) \ | ||
| 369 | ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | \ | ||
| 370 | ((bit) << (ep))) | ||
| 371 | |||
| 372 | /* -------------------------------------------------------------------------- */ | ||
| 373 | |||
| 374 | /* Enumeration is only for the hub driver, or HCD virtual root hubs */ | ||
| 375 | extern struct usb_device *usb_alloc_dev(struct usb_device *parent, | ||
| 376 | struct usb_bus *, unsigned port); | ||
| 377 | extern int usb_new_device(struct usb_device *dev); | ||
| 378 | extern void usb_disconnect(struct usb_device **); | ||
| 379 | |||
| 380 | extern int usb_get_configuration(struct usb_device *dev); | ||
| 381 | extern void usb_destroy_configuration(struct usb_device *dev); | ||
| 382 | |||
| 383 | /*-------------------------------------------------------------------------*/ | ||
| 384 | |||
| 385 | /* | ||
| 386 | * HCD Root Hub support | ||
| 387 | */ | ||
| 388 | |||
| 389 | #include <linux/usb/ch11.h> | ||
| 390 | |||
| 391 | /* | ||
| 392 | * As of USB 2.0, full/low speed devices are segregated into trees. | ||
| 393 | * One type grows from USB 1.1 host controllers (OHCI, UHCI etc). | ||
| 394 | * The other type grows from high speed hubs when they connect to | ||
| 395 | * full/low speed devices using "Transaction Translators" (TTs). | ||
| 396 | * | ||
| 397 | * TTs should only be known to the hub driver, and high speed bus | ||
| 398 | * drivers (only EHCI for now). They affect periodic scheduling and | ||
| 399 | * sometimes control/bulk error recovery. | ||
| 400 | */ | ||
| 401 | |||
| 402 | struct usb_device; | ||
| 403 | |||
| 404 | struct usb_tt { | ||
| 405 | struct usb_device *hub; /* upstream highspeed hub */ | ||
| 406 | int multi; /* true means one TT per port */ | ||
| 407 | unsigned think_time; /* think time in ns */ | ||
| 408 | |||
| 409 | /* for control/bulk error recovery (CLEAR_TT_BUFFER) */ | ||
| 410 | spinlock_t lock; | ||
| 411 | struct list_head clear_list; /* of usb_tt_clear */ | ||
| 412 | struct work_struct clear_work; | ||
| 413 | }; | ||
| 414 | |||
| 415 | struct usb_tt_clear { | ||
| 416 | struct list_head clear_list; | ||
| 417 | unsigned tt; | ||
| 418 | u16 devinfo; | ||
| 419 | struct usb_hcd *hcd; | ||
| 420 | struct usb_host_endpoint *ep; | ||
| 421 | }; | ||
| 422 | |||
| 423 | extern int usb_hub_clear_tt_buffer(struct urb *urb); | ||
| 424 | extern void usb_ep0_reinit(struct usb_device *); | ||
| 425 | |||
| 426 | /* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */ | ||
| 427 | #define DeviceRequest \ | ||
| 428 | ((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8) | ||
| 429 | #define DeviceOutRequest \ | ||
| 430 | ((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8) | ||
| 431 | |||
| 432 | #define InterfaceRequest \ | ||
| 433 | ((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8) | ||
| 434 | |||
| 435 | #define EndpointRequest \ | ||
| 436 | ((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8) | ||
| 437 | #define EndpointOutRequest \ | ||
| 438 | ((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8) | ||
| 439 | |||
| 440 | /* class requests from the USB 2.0 hub spec, table 11-15 */ | ||
| 441 | /* GetBusState and SetHubDescriptor are optional, omitted */ | ||
| 442 | #define ClearHubFeature (0x2000 | USB_REQ_CLEAR_FEATURE) | ||
| 443 | #define ClearPortFeature (0x2300 | USB_REQ_CLEAR_FEATURE) | ||
| 444 | #define GetHubDescriptor (0xa000 | USB_REQ_GET_DESCRIPTOR) | ||
| 445 | #define GetHubStatus (0xa000 | USB_REQ_GET_STATUS) | ||
| 446 | #define GetPortStatus (0xa300 | USB_REQ_GET_STATUS) | ||
| 447 | #define SetHubFeature (0x2000 | USB_REQ_SET_FEATURE) | ||
| 448 | #define SetPortFeature (0x2300 | USB_REQ_SET_FEATURE) | ||
| 449 | |||
| 450 | |||
| 451 | /*-------------------------------------------------------------------------*/ | ||
| 452 | |||
| 453 | /* | ||
| 454 | * Generic bandwidth allocation constants/support | ||
| 455 | */ | ||
| 456 | #define FRAME_TIME_USECS 1000L | ||
| 457 | #define BitTime(bytecount) (7 * 8 * bytecount / 6) /* with integer truncation */ | ||
| 458 | /* Trying not to use worst-case bit-stuffing | ||
| 459 | * of (7/6 * 8 * bytecount) = 9.33 * bytecount */ | ||
| 460 | /* bytecount = data payload byte count */ | ||
| 461 | |||
| 462 | #define NS_TO_US(ns) ((ns + 500L) / 1000L) | ||
| 463 | /* convert & round nanoseconds to microseconds */ | ||
| 464 | |||
| 465 | |||
| 466 | /* | ||
| 467 | * Full/low speed bandwidth allocation constants/support. | ||
| 468 | */ | ||
| 469 | #define BW_HOST_DELAY 1000L /* nanoseconds */ | ||
| 470 | #define BW_HUB_LS_SETUP 333L /* nanoseconds */ | ||
| 471 | /* 4 full-speed bit times (est.) */ | ||
| 472 | |||
| 473 | #define FRAME_TIME_BITS 12000L /* frame = 1 millisecond */ | ||
| 474 | #define FRAME_TIME_MAX_BITS_ALLOC (90L * FRAME_TIME_BITS / 100L) | ||
| 475 | #define FRAME_TIME_MAX_USECS_ALLOC (90L * FRAME_TIME_USECS / 100L) | ||
| 476 | |||
| 477 | /* | ||
| 478 | * Ceiling [nano/micro]seconds (typical) for that many bytes at high speed | ||
| 479 | * ISO is a bit less, no ACK ... from USB 2.0 spec, 5.11.3 (and needed | ||
| 480 | * to preallocate bandwidth) | ||
| 481 | */ | ||
| 482 | #define USB2_HOST_DELAY 5 /* nsec, guess */ | ||
| 483 | #define HS_NSECS(bytes) (((55 * 8 * 2083) \ | ||
| 484 | + (2083UL * (3 + BitTime(bytes))))/1000 \ | ||
| 485 | + USB2_HOST_DELAY) | ||
| 486 | #define HS_NSECS_ISO(bytes) (((38 * 8 * 2083) \ | ||
| 487 | + (2083UL * (3 + BitTime(bytes))))/1000 \ | ||
| 488 | + USB2_HOST_DELAY) | ||
| 489 | #define HS_USECS(bytes) NS_TO_US(HS_NSECS(bytes)) | ||
| 490 | #define HS_USECS_ISO(bytes) NS_TO_US(HS_NSECS_ISO(bytes)) | ||
| 491 | |||
| 492 | extern long usb_calc_bus_time(int speed, int is_input, | ||
| 493 | int isoc, int bytecount); | ||
| 494 | |||
| 495 | /*-------------------------------------------------------------------------*/ | ||
| 496 | |||
| 497 | extern void usb_set_device_state(struct usb_device *udev, | ||
| 498 | enum usb_device_state new_state); | ||
| 499 | |||
| 500 | /*-------------------------------------------------------------------------*/ | ||
| 501 | |||
| 502 | /* exported only within usbcore */ | ||
| 503 | |||
| 504 | extern struct list_head usb_bus_list; | ||
| 505 | extern struct mutex usb_bus_list_lock; | ||
| 506 | extern wait_queue_head_t usb_kill_urb_queue; | ||
| 507 | |||
| 508 | extern int usb_find_interface_driver(struct usb_device *dev, | ||
| 509 | struct usb_interface *interface); | ||
| 510 | |||
| 511 | #define usb_endpoint_out(ep_dir) (!((ep_dir) & USB_DIR_IN)) | ||
| 512 | |||
| 513 | #ifdef CONFIG_PM | ||
| 514 | extern void usb_root_hub_lost_power(struct usb_device *rhdev); | ||
| 515 | extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg); | ||
| 516 | extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg); | ||
| 517 | #endif /* CONFIG_PM */ | ||
| 518 | |||
| 519 | #ifdef CONFIG_USB_SUSPEND | ||
| 520 | extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd); | ||
| 521 | #else | ||
| 522 | static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) | ||
| 523 | { | ||
| 524 | return; | ||
| 525 | } | ||
| 526 | #endif /* CONFIG_USB_SUSPEND */ | ||
| 527 | |||
| 528 | |||
| 529 | /* | ||
| 530 | * USB device fs stuff | ||
| 531 | */ | ||
| 532 | |||
| 533 | #ifdef CONFIG_USB_DEVICEFS | ||
| 534 | |||
| 535 | /* | ||
| 536 | * these are expected to be called from the USB core/hub thread | ||
| 537 | * with the kernel lock held | ||
| 538 | */ | ||
| 539 | extern void usbfs_update_special(void); | ||
| 540 | extern int usbfs_init(void); | ||
| 541 | extern void usbfs_cleanup(void); | ||
| 542 | |||
| 543 | #else /* CONFIG_USB_DEVICEFS */ | ||
| 544 | |||
| 545 | static inline void usbfs_update_special(void) {} | ||
| 546 | static inline int usbfs_init(void) { return 0; } | ||
| 547 | static inline void usbfs_cleanup(void) { } | ||
| 548 | |||
| 549 | #endif /* CONFIG_USB_DEVICEFS */ | ||
| 550 | |||
| 551 | /*-------------------------------------------------------------------------*/ | ||
| 552 | |||
| 553 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) | ||
| 554 | |||
| 555 | struct usb_mon_operations { | ||
| 556 | void (*urb_submit)(struct usb_bus *bus, struct urb *urb); | ||
| 557 | void (*urb_submit_error)(struct usb_bus *bus, struct urb *urb, int err); | ||
| 558 | void (*urb_complete)(struct usb_bus *bus, struct urb *urb, int status); | ||
| 559 | /* void (*urb_unlink)(struct usb_bus *bus, struct urb *urb); */ | ||
| 560 | }; | ||
| 561 | |||
| 562 | extern struct usb_mon_operations *mon_ops; | ||
| 563 | |||
| 564 | static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb) | ||
| 565 | { | ||
| 566 | if (bus->monitored) | ||
| 567 | (*mon_ops->urb_submit)(bus, urb); | ||
| 568 | } | ||
| 569 | |||
| 570 | static inline void usbmon_urb_submit_error(struct usb_bus *bus, struct urb *urb, | ||
| 571 | int error) | ||
| 572 | { | ||
| 573 | if (bus->monitored) | ||
| 574 | (*mon_ops->urb_submit_error)(bus, urb, error); | ||
| 575 | } | ||
| 576 | |||
| 577 | static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb, | ||
| 578 | int status) | ||
| 579 | { | ||
| 580 | if (bus->monitored) | ||
| 581 | (*mon_ops->urb_complete)(bus, urb, status); | ||
| 582 | } | ||
| 583 | |||
| 584 | int usb_mon_register(struct usb_mon_operations *ops); | ||
| 585 | void usb_mon_deregister(void); | ||
| 586 | |||
| 587 | #else | ||
| 588 | |||
| 589 | static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb) {} | ||
| 590 | static inline void usbmon_urb_submit_error(struct usb_bus *bus, struct urb *urb, | ||
| 591 | int error) {} | ||
| 592 | static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb, | ||
| 593 | int status) {} | ||
| 594 | |||
| 595 | #endif /* CONFIG_USB_MON || CONFIG_USB_MON_MODULE */ | ||
| 596 | |||
| 597 | /*-------------------------------------------------------------------------*/ | ||
| 598 | |||
| 599 | /* hub.h ... DeviceRemovable in 2.4.2-ac11, gone in 2.4.10 */ | ||
| 600 | /* bleech -- resurfaced in 2.4.11 or 2.4.12 */ | ||
| 601 | #define bitmap DeviceRemovable | ||
| 602 | |||
| 603 | |||
| 604 | /*-------------------------------------------------------------------------*/ | ||
| 605 | |||
| 606 | /* random stuff */ | ||
| 607 | |||
| 608 | #define RUN_CONTEXT (in_irq() ? "in_irq" \ | ||
| 609 | : (in_interrupt() ? "in_interrupt" : "can sleep")) | ||
| 610 | |||
| 611 | |||
| 612 | /* This rwsem is for use only by the hub driver and ehci-hcd. | ||
| 613 | * Nobody else should touch it. | ||
| 614 | */ | ||
| 615 | extern struct rw_semaphore ehci_cf_port_reset_rwsem; | ||
| 616 | |||
| 617 | /* Keep track of which host controller drivers are loaded */ | ||
| 618 | #define USB_UHCI_LOADED 0 | ||
| 619 | #define USB_OHCI_LOADED 1 | ||
| 620 | #define USB_EHCI_LOADED 2 | ||
| 621 | extern unsigned long usb_hcds_loaded; | ||
| 622 | |||
| 623 | #endif /* __KERNEL__ */ | ||
| 624 | |||
| 625 | #endif /* __USB_CORE_HCD_H */ | ||
diff --git a/include/linux/usb/langwell_udc.h b/include/linux/usb/langwell_udc.h index c949178a6530..2d2d1bbad9d2 100644 --- a/include/linux/usb/langwell_udc.h +++ b/include/linux/usb/langwell_udc.h | |||
| @@ -181,7 +181,7 @@ struct langwell_op_regs { | |||
| 181 | #define PORTS_PIC (BIT(15) | BIT(14)) /* port indicator control */ | 181 | #define PORTS_PIC (BIT(15) | BIT(14)) /* port indicator control */ |
| 182 | #define PORTS_PO BIT(13) /* port owner */ | 182 | #define PORTS_PO BIT(13) /* port owner */ |
| 183 | #define PORTS_PP BIT(12) /* port power */ | 183 | #define PORTS_PP BIT(12) /* port power */ |
| 184 | #define PORTS_LS (BIT(11) | BIT(10)) /* line status */ | 184 | #define PORTS_LS (BIT(11) | BIT(10)) /* line status */ |
| 185 | #define PORTS_SLP BIT(9) /* suspend using L1 */ | 185 | #define PORTS_SLP BIT(9) /* suspend using L1 */ |
| 186 | #define PORTS_PR BIT(8) /* port reset */ | 186 | #define PORTS_PR BIT(8) /* port reset */ |
| 187 | #define PORTS_SUSP BIT(7) /* suspend */ | 187 | #define PORTS_SUSP BIT(7) /* suspend */ |
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index 7acef0234c0e..ee2dd1d506ed 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h | |||
| @@ -22,12 +22,47 @@ enum musb_mode { | |||
| 22 | 22 | ||
| 23 | struct clk; | 23 | struct clk; |
| 24 | 24 | ||
| 25 | enum musb_fifo_style { | ||
| 26 | FIFO_RXTX, | ||
| 27 | FIFO_TX, | ||
| 28 | FIFO_RX | ||
| 29 | } __attribute__ ((packed)); | ||
| 30 | |||
| 31 | enum musb_buf_mode { | ||
| 32 | BUF_SINGLE, | ||
| 33 | BUF_DOUBLE | ||
| 34 | } __attribute__ ((packed)); | ||
| 35 | |||
| 36 | struct musb_fifo_cfg { | ||
| 37 | u8 hw_ep_num; | ||
| 38 | enum musb_fifo_style style; | ||
| 39 | enum musb_buf_mode mode; | ||
| 40 | u16 maxpacket; | ||
| 41 | }; | ||
| 42 | |||
| 43 | #define MUSB_EP_FIFO(ep, st, m, pkt) \ | ||
| 44 | { \ | ||
| 45 | .hw_ep_num = ep, \ | ||
| 46 | .style = st, \ | ||
| 47 | .mode = m, \ | ||
| 48 | .maxpacket = pkt, \ | ||
| 49 | } | ||
| 50 | |||
| 51 | #define MUSB_EP_FIFO_SINGLE(ep, st, pkt) \ | ||
| 52 | MUSB_EP_FIFO(ep, st, BUF_SINGLE, pkt) | ||
| 53 | |||
| 54 | #define MUSB_EP_FIFO_DOUBLE(ep, st, pkt) \ | ||
| 55 | MUSB_EP_FIFO(ep, st, BUF_DOUBLE, pkt) | ||
| 56 | |||
| 25 | struct musb_hdrc_eps_bits { | 57 | struct musb_hdrc_eps_bits { |
| 26 | const char name[16]; | 58 | const char name[16]; |
| 27 | u8 bits; | 59 | u8 bits; |
| 28 | }; | 60 | }; |
| 29 | 61 | ||
| 30 | struct musb_hdrc_config { | 62 | struct musb_hdrc_config { |
| 63 | struct musb_fifo_cfg *fifo_cfg; /* board fifo configuration */ | ||
| 64 | unsigned fifo_cfg_size; /* size of the fifo configuration */ | ||
| 65 | |||
| 31 | /* MUSB configuration-specific details */ | 66 | /* MUSB configuration-specific details */ |
| 32 | unsigned multipoint:1; /* multipoint device */ | 67 | unsigned multipoint:1; /* multipoint device */ |
| 33 | unsigned dyn_fifo:1 __deprecated; /* supports dynamic fifo sizing */ | 68 | unsigned dyn_fifo:1 __deprecated; /* supports dynamic fifo sizing */ |
| @@ -51,8 +86,9 @@ struct musb_hdrc_config { | |||
| 51 | 86 | ||
| 52 | struct musb_hdrc_eps_bits *eps_bits __deprecated; | 87 | struct musb_hdrc_eps_bits *eps_bits __deprecated; |
| 53 | #ifdef CONFIG_BLACKFIN | 88 | #ifdef CONFIG_BLACKFIN |
| 54 | /* A GPIO controlling VRSEL in Blackfin */ | 89 | /* A GPIO controlling VRSEL in Blackfin */ |
| 55 | unsigned int gpio_vrsel; | 90 | unsigned int gpio_vrsel; |
| 91 | unsigned int gpio_vrsel_active; | ||
| 56 | #endif | 92 | #endif |
| 57 | 93 | ||
| 58 | }; | 94 | }; |
diff --git a/include/linux/usb/ncm.h b/include/linux/usb/ncm.h new file mode 100644 index 000000000000..006d1064c8b2 --- /dev/null +++ b/include/linux/usb/ncm.h | |||
| @@ -0,0 +1,114 @@ | |||
| 1 | /* | ||
| 2 | * USB CDC NCM auxiliary definitions | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef __LINUX_USB_NCM_H | ||
| 6 | #define __LINUX_USB_NCM_H | ||
| 7 | |||
| 8 | #include <linux/types.h> | ||
| 9 | #include <linux/usb/cdc.h> | ||
| 10 | #include <asm/unaligned.h> | ||
| 11 | |||
| 12 | #define NCM_NTB_MIN_IN_SIZE 2048 | ||
| 13 | #define NCM_NTB_MIN_OUT_SIZE 2048 | ||
| 14 | |||
| 15 | #define NCM_CONTROL_TIMEOUT (5 * 1000) | ||
| 16 | |||
| 17 | /* bmNetworkCapabilities */ | ||
| 18 | |||
| 19 | #define NCM_NCAP_ETH_FILTER (1 << 0) | ||
| 20 | #define NCM_NCAP_NET_ADDRESS (1 << 1) | ||
| 21 | #define NCM_NCAP_ENCAP_COMM (1 << 2) | ||
| 22 | #define NCM_NCAP_MAX_DGRAM (1 << 3) | ||
| 23 | #define NCM_NCAP_CRC_MODE (1 << 4) | ||
| 24 | |||
| 25 | /* | ||
| 26 | * Here are options for NCM Datagram Pointer table (NDP) parser. | ||
| 27 | * There are 2 different formats: NDP16 and NDP32 in the spec (ch. 3), | ||
| 28 | * in NDP16 offsets and sizes fields are 1 16bit word wide, | ||
| 29 | * in NDP32 -- 2 16bit words wide. Also signatures are different. | ||
| 30 | * To make the parser code the same, put the differences in the structure, | ||
| 31 | * and switch pointers to the structures when the format is changed. | ||
| 32 | */ | ||
| 33 | |||
| 34 | struct ndp_parser_opts { | ||
| 35 | u32 nth_sign; | ||
| 36 | u32 ndp_sign; | ||
| 37 | unsigned nth_size; | ||
| 38 | unsigned ndp_size; | ||
| 39 | unsigned ndplen_align; | ||
| 40 | /* sizes in u16 units */ | ||
| 41 | unsigned dgram_item_len; /* index or length */ | ||
| 42 | unsigned block_length; | ||
| 43 | unsigned fp_index; | ||
| 44 | unsigned reserved1; | ||
| 45 | unsigned reserved2; | ||
| 46 | unsigned next_fp_index; | ||
| 47 | }; | ||
| 48 | |||
| 49 | #define INIT_NDP16_OPTS { \ | ||
| 50 | .nth_sign = NCM_NTH16_SIGN, \ | ||
| 51 | .ndp_sign = NCM_NDP16_NOCRC_SIGN, \ | ||
| 52 | .nth_size = sizeof(struct usb_cdc_ncm_nth16), \ | ||
| 53 | .ndp_size = sizeof(struct usb_cdc_ncm_ndp16), \ | ||
| 54 | .ndplen_align = 4, \ | ||
| 55 | .dgram_item_len = 1, \ | ||
| 56 | .block_length = 1, \ | ||
| 57 | .fp_index = 1, \ | ||
| 58 | .reserved1 = 0, \ | ||
| 59 | .reserved2 = 0, \ | ||
| 60 | .next_fp_index = 1, \ | ||
| 61 | } | ||
| 62 | |||
| 63 | |||
| 64 | #define INIT_NDP32_OPTS { \ | ||
| 65 | .nth_sign = NCM_NTH32_SIGN, \ | ||
| 66 | .ndp_sign = NCM_NDP32_NOCRC_SIGN, \ | ||
| 67 | .nth_size = sizeof(struct usb_cdc_ncm_nth32), \ | ||
| 68 | .ndp_size = sizeof(struct usb_cdc_ncm_ndp32), \ | ||
| 69 | .ndplen_align = 8, \ | ||
| 70 | .dgram_item_len = 2, \ | ||
| 71 | .block_length = 2, \ | ||
| 72 | .fp_index = 2, \ | ||
| 73 | .reserved1 = 1, \ | ||
| 74 | .reserved2 = 2, \ | ||
| 75 | .next_fp_index = 2, \ | ||
| 76 | } | ||
| 77 | |||
| 78 | static inline void put_ncm(__le16 **p, unsigned size, unsigned val) | ||
| 79 | { | ||
| 80 | switch (size) { | ||
| 81 | case 1: | ||
| 82 | put_unaligned_le16((u16)val, *p); | ||
| 83 | break; | ||
| 84 | case 2: | ||
| 85 | put_unaligned_le32((u32)val, *p); | ||
| 86 | |||
| 87 | break; | ||
| 88 | default: | ||
| 89 | BUG(); | ||
| 90 | } | ||
| 91 | |||
| 92 | *p += size; | ||
| 93 | } | ||
| 94 | |||
| 95 | static inline unsigned get_ncm(__le16 **p, unsigned size) | ||
| 96 | { | ||
| 97 | unsigned tmp; | ||
| 98 | |||
| 99 | switch (size) { | ||
| 100 | case 1: | ||
| 101 | tmp = get_unaligned_le16(*p); | ||
| 102 | break; | ||
| 103 | case 2: | ||
| 104 | tmp = get_unaligned_le32(*p); | ||
| 105 | break; | ||
| 106 | default: | ||
| 107 | BUG(); | ||
| 108 | } | ||
| 109 | |||
| 110 | *p += size; | ||
| 111 | return tmp; | ||
| 112 | } | ||
| 113 | |||
| 114 | #endif /* __LINUX_USB_NCM_H */ | ||
diff --git a/include/linux/usb/net2280.h b/include/linux/usb/net2280.h index 96ca549a778d..148b8fa5b1a2 100644 --- a/include/linux/usb/net2280.h +++ b/include/linux/usb/net2280.h | |||
| @@ -353,7 +353,7 @@ struct net2280_dma_regs { /* [11.7] */ | |||
| 353 | #define DMA_TRANSACTION_DONE_INTERRUPT 24 | 353 | #define DMA_TRANSACTION_DONE_INTERRUPT 24 |
| 354 | #define DMA_ABORT 1 | 354 | #define DMA_ABORT 1 |
| 355 | #define DMA_START 0 | 355 | #define DMA_START 0 |
| 356 | u32 _unused0 [2]; | 356 | u32 _unused0[2]; |
| 357 | /* offset 0x0190, 0x01b0, 0x01d0, 0x01f0, */ | 357 | /* offset 0x0190, 0x01b0, 0x01d0, 0x01f0, */ |
| 358 | u32 dmacount; | 358 | u32 dmacount; |
| 359 | #define VALID_BIT 31 | 359 | #define VALID_BIT 31 |
| @@ -374,7 +374,7 @@ struct net2280_dep_regs { /* [11.8] */ | |||
| 374 | u32 dep_cfg; | 374 | u32 dep_cfg; |
| 375 | /* offset 0x0204, 0x0214, 0x224, 0x234, 0x244 */ | 375 | /* offset 0x0204, 0x0214, 0x224, 0x234, 0x244 */ |
| 376 | u32 dep_rsp; | 376 | u32 dep_rsp; |
| 377 | u32 _unused [2]; | 377 | u32 _unused[2]; |
| 378 | } __attribute__ ((packed)); | 378 | } __attribute__ ((packed)); |
| 379 | 379 | ||
| 380 | /* configurable endpoint registers, BAR0 + 0x0300 ... array of seven structs | 380 | /* configurable endpoint registers, BAR0 + 0x0300 ... array of seven structs |
| @@ -437,7 +437,7 @@ struct net2280_ep_regs { /* [11.9] */ | |||
| 437 | /* offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 */ | 437 | /* offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 */ |
| 438 | u32 ep_avail; | 438 | u32 ep_avail; |
| 439 | u32 ep_data; | 439 | u32 ep_data; |
| 440 | u32 _unused0 [2]; | 440 | u32 _unused0[2]; |
| 441 | } __attribute__ ((packed)); | 441 | } __attribute__ ((packed)); |
| 442 | 442 | ||
| 443 | #endif /* __LINUX_USB_NET2280_H */ | 443 | #endif /* __LINUX_USB_NET2280_H */ |
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h index 0a555dd131fc..16b7f3347545 100644 --- a/include/linux/usb/quirks.h +++ b/include/linux/usb/quirks.h | |||
| @@ -22,4 +22,8 @@ | |||
| 22 | /*device will morph if reset, don't use reset for handling errors */ | 22 | /*device will morph if reset, don't use reset for handling errors */ |
| 23 | #define USB_QUIRK_RESET_MORPHS 0x00000010 | 23 | #define USB_QUIRK_RESET_MORPHS 0x00000010 |
| 24 | 24 | ||
| 25 | /* device has more interface descriptions than the bNumInterfaces count, | ||
| 26 | and can't handle talking to these interfaces */ | ||
| 27 | #define USB_QUIRK_HONOR_BNUMINTERFACES 0x00000020 | ||
| 28 | |||
| 25 | #endif /* __LINUX_USB_QUIRKS_H */ | 29 | #endif /* __LINUX_USB_QUIRKS_H */ |
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h index 1ef1ebc2b04f..05ef52861988 100644 --- a/include/linux/usb/rndis_host.h +++ b/include/linux/usb/rndis_host.h | |||
| @@ -34,10 +34,10 @@ | |||
| 34 | struct rndis_msg_hdr { | 34 | struct rndis_msg_hdr { |
| 35 | __le32 msg_type; /* RNDIS_MSG_* */ | 35 | __le32 msg_type; /* RNDIS_MSG_* */ |
| 36 | __le32 msg_len; | 36 | __le32 msg_len; |
| 37 | // followed by data that varies between messages | 37 | /* followed by data that varies between messages */ |
| 38 | __le32 request_id; | 38 | __le32 request_id; |
| 39 | __le32 status; | 39 | __le32 status; |
| 40 | // ... and more | 40 | /* ... and more */ |
| 41 | } __attribute__ ((packed)); | 41 | } __attribute__ ((packed)); |
| 42 | 42 | ||
| 43 | /* MS-Windows uses this strange size, but RNDIS spec says 1024 minimum */ | 43 | /* MS-Windows uses this strange size, but RNDIS spec says 1024 minimum */ |
| @@ -92,67 +92,67 @@ struct rndis_msg_hdr { | |||
| 92 | 92 | ||
| 93 | struct rndis_data_hdr { | 93 | struct rndis_data_hdr { |
| 94 | __le32 msg_type; /* RNDIS_MSG_PACKET */ | 94 | __le32 msg_type; /* RNDIS_MSG_PACKET */ |
| 95 | __le32 msg_len; // rndis_data_hdr + data_len + pad | 95 | __le32 msg_len; /* rndis_data_hdr + data_len + pad */ |
| 96 | __le32 data_offset; // 36 -- right after header | 96 | __le32 data_offset; /* 36 -- right after header */ |
| 97 | __le32 data_len; // ... real packet size | 97 | __le32 data_len; /* ... real packet size */ |
| 98 | 98 | ||
| 99 | __le32 oob_data_offset; // zero | 99 | __le32 oob_data_offset; /* zero */ |
| 100 | __le32 oob_data_len; // zero | 100 | __le32 oob_data_len; /* zero */ |
| 101 | __le32 num_oob; // zero | 101 | __le32 num_oob; /* zero */ |
| 102 | __le32 packet_data_offset; // zero | 102 | __le32 packet_data_offset; /* zero */ |
| 103 | 103 | ||
| 104 | __le32 packet_data_len; // zero | 104 | __le32 packet_data_len; /* zero */ |
| 105 | __le32 vc_handle; // zero | 105 | __le32 vc_handle; /* zero */ |
| 106 | __le32 reserved; // zero | 106 | __le32 reserved; /* zero */ |
| 107 | } __attribute__ ((packed)); | 107 | } __attribute__ ((packed)); |
| 108 | 108 | ||
| 109 | struct rndis_init { /* OUT */ | 109 | struct rndis_init { /* OUT */ |
| 110 | // header and: | 110 | /* header and: */ |
| 111 | __le32 msg_type; /* RNDIS_MSG_INIT */ | 111 | __le32 msg_type; /* RNDIS_MSG_INIT */ |
| 112 | __le32 msg_len; // 24 | 112 | __le32 msg_len; /* 24 */ |
| 113 | __le32 request_id; | 113 | __le32 request_id; |
| 114 | __le32 major_version; // of rndis (1.0) | 114 | __le32 major_version; /* of rndis (1.0) */ |
| 115 | __le32 minor_version; | 115 | __le32 minor_version; |
| 116 | __le32 max_transfer_size; | 116 | __le32 max_transfer_size; |
| 117 | } __attribute__ ((packed)); | 117 | } __attribute__ ((packed)); |
| 118 | 118 | ||
| 119 | struct rndis_init_c { /* IN */ | 119 | struct rndis_init_c { /* IN */ |
| 120 | // header and: | 120 | /* header and: */ |
| 121 | __le32 msg_type; /* RNDIS_MSG_INIT_C */ | 121 | __le32 msg_type; /* RNDIS_MSG_INIT_C */ |
| 122 | __le32 msg_len; | 122 | __le32 msg_len; |
| 123 | __le32 request_id; | 123 | __le32 request_id; |
| 124 | __le32 status; | 124 | __le32 status; |
| 125 | __le32 major_version; // of rndis (1.0) | 125 | __le32 major_version; /* of rndis (1.0) */ |
| 126 | __le32 minor_version; | 126 | __le32 minor_version; |
| 127 | __le32 device_flags; | 127 | __le32 device_flags; |
| 128 | __le32 medium; // zero == 802.3 | 128 | __le32 medium; /* zero == 802.3 */ |
| 129 | __le32 max_packets_per_message; | 129 | __le32 max_packets_per_message; |
| 130 | __le32 max_transfer_size; | 130 | __le32 max_transfer_size; |
| 131 | __le32 packet_alignment; // max 7; (1<<n) bytes | 131 | __le32 packet_alignment; /* max 7; (1<<n) bytes */ |
| 132 | __le32 af_list_offset; // zero | 132 | __le32 af_list_offset; /* zero */ |
| 133 | __le32 af_list_size; // zero | 133 | __le32 af_list_size; /* zero */ |
| 134 | } __attribute__ ((packed)); | 134 | } __attribute__ ((packed)); |
| 135 | 135 | ||
| 136 | struct rndis_halt { /* OUT (no reply) */ | 136 | struct rndis_halt { /* OUT (no reply) */ |
| 137 | // header and: | 137 | /* header and: */ |
| 138 | __le32 msg_type; /* RNDIS_MSG_HALT */ | 138 | __le32 msg_type; /* RNDIS_MSG_HALT */ |
| 139 | __le32 msg_len; | 139 | __le32 msg_len; |
| 140 | __le32 request_id; | 140 | __le32 request_id; |
| 141 | } __attribute__ ((packed)); | 141 | } __attribute__ ((packed)); |
| 142 | 142 | ||
| 143 | struct rndis_query { /* OUT */ | 143 | struct rndis_query { /* OUT */ |
| 144 | // header and: | 144 | /* header and: */ |
| 145 | __le32 msg_type; /* RNDIS_MSG_QUERY */ | 145 | __le32 msg_type; /* RNDIS_MSG_QUERY */ |
| 146 | __le32 msg_len; | 146 | __le32 msg_len; |
| 147 | __le32 request_id; | 147 | __le32 request_id; |
| 148 | __le32 oid; | 148 | __le32 oid; |
| 149 | __le32 len; | 149 | __le32 len; |
| 150 | __le32 offset; | 150 | __le32 offset; |
| 151 | /*?*/ __le32 handle; // zero | 151 | /*?*/ __le32 handle; /* zero */ |
| 152 | } __attribute__ ((packed)); | 152 | } __attribute__ ((packed)); |
| 153 | 153 | ||
| 154 | struct rndis_query_c { /* IN */ | 154 | struct rndis_query_c { /* IN */ |
| 155 | // header and: | 155 | /* header and: */ |
| 156 | __le32 msg_type; /* RNDIS_MSG_QUERY_C */ | 156 | __le32 msg_type; /* RNDIS_MSG_QUERY_C */ |
| 157 | __le32 msg_len; | 157 | __le32 msg_len; |
| 158 | __le32 request_id; | 158 | __le32 request_id; |
| @@ -162,18 +162,18 @@ struct rndis_query_c { /* IN */ | |||
| 162 | } __attribute__ ((packed)); | 162 | } __attribute__ ((packed)); |
| 163 | 163 | ||
| 164 | struct rndis_set { /* OUT */ | 164 | struct rndis_set { /* OUT */ |
| 165 | // header and: | 165 | /* header and: */ |
| 166 | __le32 msg_type; /* RNDIS_MSG_SET */ | 166 | __le32 msg_type; /* RNDIS_MSG_SET */ |
| 167 | __le32 msg_len; | 167 | __le32 msg_len; |
| 168 | __le32 request_id; | 168 | __le32 request_id; |
| 169 | __le32 oid; | 169 | __le32 oid; |
| 170 | __le32 len; | 170 | __le32 len; |
| 171 | __le32 offset; | 171 | __le32 offset; |
| 172 | /*?*/ __le32 handle; // zero | 172 | /*?*/ __le32 handle; /* zero */ |
| 173 | } __attribute__ ((packed)); | 173 | } __attribute__ ((packed)); |
| 174 | 174 | ||
| 175 | struct rndis_set_c { /* IN */ | 175 | struct rndis_set_c { /* IN */ |
| 176 | // header and: | 176 | /* header and: */ |
| 177 | __le32 msg_type; /* RNDIS_MSG_SET_C */ | 177 | __le32 msg_type; /* RNDIS_MSG_SET_C */ |
| 178 | __le32 msg_len; | 178 | __le32 msg_len; |
| 179 | __le32 request_id; | 179 | __le32 request_id; |
| @@ -181,14 +181,14 @@ struct rndis_set_c { /* IN */ | |||
| 181 | } __attribute__ ((packed)); | 181 | } __attribute__ ((packed)); |
| 182 | 182 | ||
| 183 | struct rndis_reset { /* IN */ | 183 | struct rndis_reset { /* IN */ |
| 184 | // header and: | 184 | /* header and: */ |
| 185 | __le32 msg_type; /* RNDIS_MSG_RESET */ | 185 | __le32 msg_type; /* RNDIS_MSG_RESET */ |
| 186 | __le32 msg_len; | 186 | __le32 msg_len; |
| 187 | __le32 reserved; | 187 | __le32 reserved; |
| 188 | } __attribute__ ((packed)); | 188 | } __attribute__ ((packed)); |
| 189 | 189 | ||
| 190 | struct rndis_reset_c { /* OUT */ | 190 | struct rndis_reset_c { /* OUT */ |
| 191 | // header and: | 191 | /* header and: */ |
| 192 | __le32 msg_type; /* RNDIS_MSG_RESET_C */ | 192 | __le32 msg_type; /* RNDIS_MSG_RESET_C */ |
| 193 | __le32 msg_len; | 193 | __le32 msg_len; |
| 194 | __le32 status; | 194 | __le32 status; |
| @@ -196,7 +196,7 @@ struct rndis_reset_c { /* OUT */ | |||
| 196 | } __attribute__ ((packed)); | 196 | } __attribute__ ((packed)); |
| 197 | 197 | ||
| 198 | struct rndis_indicate { /* IN (unrequested) */ | 198 | struct rndis_indicate { /* IN (unrequested) */ |
| 199 | // header and: | 199 | /* header and: */ |
| 200 | __le32 msg_type; /* RNDIS_MSG_INDICATE */ | 200 | __le32 msg_type; /* RNDIS_MSG_INDICATE */ |
| 201 | __le32 msg_len; | 201 | __le32 msg_len; |
| 202 | __le32 status; | 202 | __le32 status; |
| @@ -208,14 +208,14 @@ struct rndis_indicate { /* IN (unrequested) */ | |||
| 208 | } __attribute__ ((packed)); | 208 | } __attribute__ ((packed)); |
| 209 | 209 | ||
| 210 | struct rndis_keepalive { /* OUT (optionally IN) */ | 210 | struct rndis_keepalive { /* OUT (optionally IN) */ |
| 211 | // header and: | 211 | /* header and: */ |
| 212 | __le32 msg_type; /* RNDIS_MSG_KEEPALIVE */ | 212 | __le32 msg_type; /* RNDIS_MSG_KEEPALIVE */ |
| 213 | __le32 msg_len; | 213 | __le32 msg_len; |
| 214 | __le32 request_id; | 214 | __le32 request_id; |
| 215 | } __attribute__ ((packed)); | 215 | } __attribute__ ((packed)); |
| 216 | 216 | ||
| 217 | struct rndis_keepalive_c { /* IN (optionally OUT) */ | 217 | struct rndis_keepalive_c { /* IN (optionally OUT) */ |
| 218 | // header and: | 218 | /* header and: */ |
| 219 | __le32 msg_type; /* RNDIS_MSG_KEEPALIVE_C */ | 219 | __le32 msg_type; /* RNDIS_MSG_KEEPALIVE_C */ |
| 220 | __le32 msg_len; | 220 | __le32 msg_len; |
| 221 | __le32 request_id; | 221 | __le32 request_id; |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 0a458b861933..84a4c44c208b 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
| @@ -35,6 +35,9 @@ enum port_dev_state { | |||
| 35 | PORT_UNREGISTERING, | 35 | PORT_UNREGISTERING, |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | /* USB serial flags */ | ||
| 39 | #define USB_SERIAL_WRITE_BUSY 0 | ||
| 40 | |||
| 38 | /** | 41 | /** |
| 39 | * usb_serial_port: structure for the specific ports of a device. | 42 | * usb_serial_port: structure for the specific ports of a device. |
| 40 | * @serial: pointer back to the struct usb_serial owner of this port. | 43 | * @serial: pointer back to the struct usb_serial owner of this port. |
| @@ -49,7 +52,7 @@ enum port_dev_state { | |||
| 49 | * @interrupt_out_size: the size of the interrupt_out_buffer, in bytes. | 52 | * @interrupt_out_size: the size of the interrupt_out_buffer, in bytes. |
| 50 | * @interrupt_out_urb: pointer to the interrupt out struct urb for this port. | 53 | * @interrupt_out_urb: pointer to the interrupt out struct urb for this port. |
| 51 | * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe | 54 | * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe |
| 52 | * for this port. | 55 | * for this port. |
| 53 | * @bulk_in_buffer: pointer to the bulk in buffer for this port. | 56 | * @bulk_in_buffer: pointer to the bulk in buffer for this port. |
| 54 | * @bulk_in_size: the size of the bulk_in_buffer, in bytes. | 57 | * @bulk_in_size: the size of the bulk_in_buffer, in bytes. |
| 55 | * @read_urb: pointer to the bulk in struct urb for this port. | 58 | * @read_urb: pointer to the bulk in struct urb for this port. |
| @@ -60,13 +63,17 @@ enum port_dev_state { | |||
| 60 | * @write_urb: pointer to the bulk out struct urb for this port. | 63 | * @write_urb: pointer to the bulk out struct urb for this port. |
| 61 | * @write_fifo: kfifo used to buffer outgoing data | 64 | * @write_fifo: kfifo used to buffer outgoing data |
| 62 | * @write_urb_busy: port`s writing status | 65 | * @write_urb_busy: port`s writing status |
| 66 | * @bulk_out_buffers: pointers to the bulk out buffers for this port | ||
| 67 | * @write_urbs: pointers to the bulk out urbs for this port | ||
| 68 | * @write_urbs_free: status bitmap the for bulk out urbs | ||
| 69 | * @tx_bytes: number of bytes currently in host stack queues | ||
| 63 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this | 70 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this |
| 64 | * port. | 71 | * port. |
| 72 | * @flags: usb serial port flags | ||
| 65 | * @write_wait: a wait_queue_head_t used by the port. | 73 | * @write_wait: a wait_queue_head_t used by the port. |
| 66 | * @work: work queue entry for the line discipline waking up. | 74 | * @work: work queue entry for the line discipline waking up. |
| 67 | * @throttled: nonzero if the read urb is inactive to throttle the device | 75 | * @throttled: nonzero if the read urb is inactive to throttle the device |
| 68 | * @throttle_req: nonzero if the tty wants to throttle us | 76 | * @throttle_req: nonzero if the tty wants to throttle us |
| 69 | * @console: attached usb serial console | ||
| 70 | * @dev: pointer to the serial device | 77 | * @dev: pointer to the serial device |
| 71 | * | 78 | * |
| 72 | * This structure is used by the usb-serial core and drivers for the specific | 79 | * This structure is used by the usb-serial core and drivers for the specific |
| @@ -97,16 +104,19 @@ struct usb_serial_port { | |||
| 97 | struct urb *write_urb; | 104 | struct urb *write_urb; |
| 98 | struct kfifo write_fifo; | 105 | struct kfifo write_fifo; |
| 99 | int write_urb_busy; | 106 | int write_urb_busy; |
| 107 | |||
| 108 | unsigned char *bulk_out_buffers[2]; | ||
| 109 | struct urb *write_urbs[2]; | ||
| 110 | unsigned long write_urbs_free; | ||
| 100 | __u8 bulk_out_endpointAddress; | 111 | __u8 bulk_out_endpointAddress; |
| 101 | 112 | ||
| 102 | int tx_bytes_flight; | 113 | int tx_bytes; |
| 103 | int urbs_in_flight; | ||
| 104 | 114 | ||
| 115 | unsigned long flags; | ||
| 105 | wait_queue_head_t write_wait; | 116 | wait_queue_head_t write_wait; |
| 106 | struct work_struct work; | 117 | struct work_struct work; |
| 107 | char throttled; | 118 | char throttled; |
| 108 | char throttle_req; | 119 | char throttle_req; |
| 109 | char console; | ||
| 110 | unsigned long sysrq; /* sysrq timeout */ | 120 | unsigned long sysrq; /* sysrq timeout */ |
| 111 | struct device dev; | 121 | struct device dev; |
| 112 | enum port_dev_state dev_state; | 122 | enum port_dev_state dev_state; |
| @@ -181,6 +191,8 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data) | |||
| 181 | * @id_table: pointer to a list of usb_device_id structures that define all | 191 | * @id_table: pointer to a list of usb_device_id structures that define all |
| 182 | * of the devices this structure can support. | 192 | * of the devices this structure can support. |
| 183 | * @num_ports: the number of different ports this device will have. | 193 | * @num_ports: the number of different ports this device will have. |
| 194 | * @bulk_in_size: bytes to allocate for bulk-in buffer (0 = end-point size) | ||
| 195 | * @bulk_out_size: bytes to allocate for bulk-out buffer (0 = end-point size) | ||
| 184 | * @calc_num_ports: pointer to a function to determine how many ports this | 196 | * @calc_num_ports: pointer to a function to determine how many ports this |
| 185 | * device has dynamically. It will be called after the probe() | 197 | * device has dynamically. It will be called after the probe() |
| 186 | * callback is called, but before attach() | 198 | * callback is called, but before attach() |
| @@ -223,7 +235,9 @@ struct usb_serial_driver { | |||
| 223 | struct device_driver driver; | 235 | struct device_driver driver; |
| 224 | struct usb_driver *usb_driver; | 236 | struct usb_driver *usb_driver; |
| 225 | struct usb_dynids dynids; | 237 | struct usb_dynids dynids; |
| 226 | int max_in_flight_urbs; | 238 | |
| 239 | size_t bulk_in_size; | ||
| 240 | size_t bulk_out_size; | ||
| 227 | 241 | ||
| 228 | int (*probe)(struct usb_serial *serial, const struct usb_device_id *id); | 242 | int (*probe)(struct usb_serial *serial, const struct usb_device_id *id); |
| 229 | int (*attach)(struct usb_serial *serial); | 243 | int (*attach)(struct usb_serial *serial); |
| @@ -269,6 +283,11 @@ struct usb_serial_driver { | |||
| 269 | void (*write_int_callback)(struct urb *urb); | 283 | void (*write_int_callback)(struct urb *urb); |
| 270 | void (*read_bulk_callback)(struct urb *urb); | 284 | void (*read_bulk_callback)(struct urb *urb); |
| 271 | void (*write_bulk_callback)(struct urb *urb); | 285 | void (*write_bulk_callback)(struct urb *urb); |
| 286 | /* Called by the generic read bulk callback */ | ||
| 287 | void (*process_read_urb)(struct urb *urb); | ||
| 288 | /* Called by the generic write implementation */ | ||
| 289 | int (*prepare_write_buffer)(struct usb_serial_port *port, | ||
| 290 | void *dest, size_t size); | ||
| 272 | }; | 291 | }; |
| 273 | #define to_usb_serial_driver(d) \ | 292 | #define to_usb_serial_driver(d) \ |
| 274 | container_of(d, struct usb_serial_driver, driver) | 293 | container_of(d, struct usb_serial_driver, driver) |
| @@ -318,8 +337,11 @@ extern void usb_serial_generic_disconnect(struct usb_serial *serial); | |||
| 318 | extern void usb_serial_generic_release(struct usb_serial *serial); | 337 | extern void usb_serial_generic_release(struct usb_serial *serial); |
| 319 | extern int usb_serial_generic_register(int debug); | 338 | extern int usb_serial_generic_register(int debug); |
| 320 | extern void usb_serial_generic_deregister(void); | 339 | extern void usb_serial_generic_deregister(void); |
| 321 | extern void usb_serial_generic_resubmit_read_urb(struct usb_serial_port *port, | 340 | extern int usb_serial_generic_submit_read_urb(struct usb_serial_port *port, |
| 322 | gfp_t mem_flags); | 341 | gfp_t mem_flags); |
| 342 | extern void usb_serial_generic_process_read_urb(struct urb *urb); | ||
| 343 | extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port, | ||
| 344 | void *dest, size_t size); | ||
| 323 | extern int usb_serial_handle_sysrq_char(struct tty_struct *tty, | 345 | extern int usb_serial_handle_sysrq_char(struct tty_struct *tty, |
| 324 | struct usb_serial_port *port, | 346 | struct usb_serial_port *port, |
| 325 | unsigned int ch); | 347 | unsigned int ch); |
diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h index 20675c6ebc4d..2369d07c3c87 100644 --- a/include/linux/usb/ulpi.h +++ b/include/linux/usb/ulpi.h | |||
| @@ -1,6 +1,146 @@ | |||
| 1 | /* | ||
| 2 | * ulpi.h -- ULPI defines and function prorotypes | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Nokia Corporation | ||
| 5 | * | ||
| 6 | * This software is distributed under the terms of the GNU General | ||
| 7 | * Public License ("GPL") as published by the Free Software Foundation, | ||
| 8 | * version 2 of that License. | ||
| 9 | */ | ||
| 10 | |||
| 1 | #ifndef __LINUX_USB_ULPI_H | 11 | #ifndef __LINUX_USB_ULPI_H |
| 2 | #define __LINUX_USB_ULPI_H | 12 | #define __LINUX_USB_ULPI_H |
| 3 | 13 | ||
| 14 | /*-------------------------------------------------------------------------*/ | ||
| 15 | |||
| 16 | /* | ||
| 17 | * Macros for Set and Clear | ||
| 18 | * See ULPI 1.1 specification to find the registers with Set and Clear offsets | ||
| 19 | */ | ||
| 20 | #define ULPI_SET(a) (a + 1) | ||
| 21 | #define ULPI_CLR(a) (a + 2) | ||
| 22 | |||
| 23 | /*-------------------------------------------------------------------------*/ | ||
| 24 | |||
| 25 | /* | ||
| 26 | * Register Map | ||
| 27 | */ | ||
| 28 | #define ULPI_VENDOR_ID_LOW 0x00 | ||
| 29 | #define ULPI_VENDOR_ID_HIGH 0x01 | ||
| 30 | #define ULPI_PRODUCT_ID_LOW 0x02 | ||
| 31 | #define ULPI_PRODUCT_ID_HIGH 0x03 | ||
| 32 | #define ULPI_FUNC_CTRL 0x04 | ||
| 33 | #define ULPI_IFC_CTRL 0x07 | ||
| 34 | #define ULPI_OTG_CTRL 0x0a | ||
| 35 | #define ULPI_USB_INT_EN_RISE 0x0d | ||
| 36 | #define ULPI_USB_INT_EN_FALL 0x10 | ||
| 37 | #define ULPI_USB_INT_STS 0x13 | ||
| 38 | #define ULPI_USB_INT_LATCH 0x14 | ||
| 39 | #define ULPI_DEBUG 0x15 | ||
| 40 | #define ULPI_SCRATCH 0x16 | ||
| 41 | /* Optional Carkit Registers */ | ||
| 42 | #define ULPI_CARCIT_CTRL 0x19 | ||
| 43 | #define ULPI_CARCIT_INT_DELAY 0x1c | ||
| 44 | #define ULPI_CARCIT_INT_EN 0x1d | ||
| 45 | #define ULPI_CARCIT_INT_STS 0x20 | ||
| 46 | #define ULPI_CARCIT_INT_LATCH 0x21 | ||
| 47 | #define ULPI_CARCIT_PLS_CTRL 0x22 | ||
| 48 | /* Other Optional Registers */ | ||
| 49 | #define ULPI_TX_POS_WIDTH 0x25 | ||
| 50 | #define ULPI_TX_NEG_WIDTH 0x26 | ||
| 51 | #define ULPI_POLARITY_RECOVERY 0x27 | ||
| 52 | /* Access Extended Register Set */ | ||
| 53 | #define ULPI_ACCESS_EXTENDED 0x2f | ||
| 54 | /* Vendor Specific */ | ||
| 55 | #define ULPI_VENDOR_SPECIFIC 0x30 | ||
| 56 | /* Extended Registers */ | ||
| 57 | #define ULPI_EXT_VENDOR_SPECIFIC 0x80 | ||
| 58 | |||
| 59 | /*-------------------------------------------------------------------------*/ | ||
| 60 | |||
| 61 | /* Function Control */ | ||
| 62 | #define ULPI_FUNC_CTRL_XCVRSEL (1 << 0) | ||
| 63 | #define ULPI_FUNC_CTRL_XCVRSEL_MASK (3 << 0) | ||
| 64 | #define ULPI_FUNC_CTRL_HIGH_SPEED (0 << 0) | ||
| 65 | #define ULPI_FUNC_CTRL_FULL_SPEED (1 << 0) | ||
| 66 | #define ULPI_FUNC_CTRL_LOW_SPEED (2 << 0) | ||
| 67 | #define ULPI_FUNC_CTRL_FS4LS (3 << 0) | ||
| 68 | #define ULPI_FUNC_CTRL_TERMSELECT (1 << 2) | ||
| 69 | #define ULPI_FUNC_CTRL_OPMODE (1 << 3) | ||
| 70 | #define ULPI_FUNC_CTRL_OPMODE_MASK (3 << 3) | ||
| 71 | #define ULPI_FUNC_CTRL_OPMODE_NORMAL (0 << 3) | ||
| 72 | #define ULPI_FUNC_CTRL_OPMODE_NONDRIVING (1 << 3) | ||
| 73 | #define ULPI_FUNC_CTRL_OPMODE_DISABLE_NRZI (2 << 3) | ||
| 74 | #define ULPI_FUNC_CTRL_OPMODE_NOSYNC_NOEOP (3 << 3) | ||
| 75 | #define ULPI_FUNC_CTRL_RESET (1 << 5) | ||
| 76 | #define ULPI_FUNC_CTRL_SUSPENDM (1 << 6) | ||
| 77 | |||
| 78 | /* Interface Control */ | ||
| 79 | #define ULPI_IFC_CTRL_6_PIN_SERIAL_MODE (1 << 0) | ||
| 80 | #define ULPI_IFC_CTRL_3_PIN_SERIAL_MODE (1 << 1) | ||
| 81 | #define ULPI_IFC_CTRL_CARKITMODE (1 << 2) | ||
| 82 | #define ULPI_IFC_CTRL_CLOCKSUSPENDM (1 << 3) | ||
| 83 | #define ULPI_IFC_CTRL_AUTORESUME (1 << 4) | ||
| 84 | #define ULPI_IFC_CTRL_EXTERNAL_VBUS (1 << 5) | ||
| 85 | #define ULPI_IFC_CTRL_PASSTHRU (1 << 6) | ||
| 86 | #define ULPI_IFC_CTRL_PROTECT_IFC_DISABLE (1 << 7) | ||
| 87 | |||
| 88 | /* OTG Control */ | ||
| 89 | #define ULPI_OTG_CTRL_ID_PULLUP (1 << 0) | ||
| 90 | #define ULPI_OTG_CTRL_DP_PULLDOWN (1 << 1) | ||
| 91 | #define ULPI_OTG_CTRL_DM_PULLDOWN (1 << 2) | ||
| 92 | #define ULPI_OTG_CTRL_DISCHRGVBUS (1 << 3) | ||
| 93 | #define ULPI_OTG_CTRL_CHRGVBUS (1 << 4) | ||
| 94 | #define ULPI_OTG_CTRL_DRVVBUS (1 << 5) | ||
| 95 | #define ULPI_OTG_CTRL_DRVVBUS_EXT (1 << 6) | ||
| 96 | #define ULPI_OTG_CTRL_EXTVBUSIND (1 << 7) | ||
| 97 | |||
| 98 | /* USB Interrupt Enable Rising, | ||
| 99 | * USB Interrupt Enable Falling, | ||
| 100 | * USB Interrupt Status and | ||
| 101 | * USB Interrupt Latch | ||
| 102 | */ | ||
| 103 | #define ULPI_INT_HOST_DISCONNECT (1 << 0) | ||
| 104 | #define ULPI_INT_VBUS_VALID (1 << 1) | ||
| 105 | #define ULPI_INT_SESS_VALID (1 << 2) | ||
| 106 | #define ULPI_INT_SESS_END (1 << 3) | ||
| 107 | #define ULPI_INT_IDGRD (1 << 4) | ||
| 108 | |||
| 109 | /* Debug */ | ||
| 110 | #define ULPI_DEBUG_LINESTATE0 (1 << 0) | ||
| 111 | #define ULPI_DEBUG_LINESTATE1 (1 << 1) | ||
| 112 | |||
| 113 | /* Carkit Control */ | ||
| 114 | #define ULPI_CARKIT_CTRL_CARKITPWR (1 << 0) | ||
| 115 | #define ULPI_CARKIT_CTRL_IDGNDDRV (1 << 1) | ||
| 116 | #define ULPI_CARKIT_CTRL_TXDEN (1 << 2) | ||
| 117 | #define ULPI_CARKIT_CTRL_RXDEN (1 << 3) | ||
| 118 | #define ULPI_CARKIT_CTRL_SPKLEFTEN (1 << 4) | ||
| 119 | #define ULPI_CARKIT_CTRL_SPKRIGHTEN (1 << 5) | ||
| 120 | #define ULPI_CARKIT_CTRL_MICEN (1 << 6) | ||
| 121 | |||
| 122 | /* Carkit Interrupt Enable */ | ||
| 123 | #define ULPI_CARKIT_INT_EN_IDFLOAT_RISE (1 << 0) | ||
| 124 | #define ULPI_CARKIT_INT_EN_IDFLOAT_FALL (1 << 1) | ||
| 125 | #define ULPI_CARKIT_INT_EN_CARINTDET (1 << 2) | ||
| 126 | #define ULPI_CARKIT_INT_EN_DP_RISE (1 << 3) | ||
| 127 | #define ULPI_CARKIT_INT_EN_DP_FALL (1 << 4) | ||
| 128 | |||
| 129 | /* Carkit Interrupt Status and | ||
| 130 | * Carkit Interrupt Latch | ||
| 131 | */ | ||
| 132 | #define ULPI_CARKIT_INT_IDFLOAT (1 << 0) | ||
| 133 | #define ULPI_CARKIT_INT_CARINTDET (1 << 1) | ||
| 134 | #define ULPI_CARKIT_INT_DP (1 << 2) | ||
| 135 | |||
| 136 | /* Carkit Pulse Control*/ | ||
| 137 | #define ULPI_CARKIT_PLS_CTRL_TXPLSEN (1 << 0) | ||
| 138 | #define ULPI_CARKIT_PLS_CTRL_RXPLSEN (1 << 1) | ||
| 139 | #define ULPI_CARKIT_PLS_CTRL_SPKRLEFT_BIASEN (1 << 2) | ||
| 140 | #define ULPI_CARKIT_PLS_CTRL_SPKRRIGHT_BIASEN (1 << 3) | ||
| 141 | |||
| 142 | /*-------------------------------------------------------------------------*/ | ||
| 143 | |||
| 4 | struct otg_transceiver *otg_ulpi_create(struct otg_io_access_ops *ops, | 144 | struct otg_transceiver *otg_ulpi_create(struct otg_io_access_ops *ops, |
| 5 | unsigned int flags); | 145 | unsigned int flags); |
| 6 | 146 | ||
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index df1e83dd9a54..7ae27a473818 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
| @@ -43,7 +43,7 @@ struct usbnet { | |||
| 43 | /* protocol/interface state */ | 43 | /* protocol/interface state */ |
| 44 | struct net_device *net; | 44 | struct net_device *net; |
| 45 | int msg_enable; | 45 | int msg_enable; |
| 46 | unsigned long data [5]; | 46 | unsigned long data[5]; |
| 47 | u32 xid; | 47 | u32 xid; |
| 48 | u32 hard_mtu; /* count any extra framing */ | 48 | u32 hard_mtu; /* count any extra framing */ |
| 49 | size_t rx_urb_size; /* size for rx urbs */ | 49 | size_t rx_urb_size; /* size for rx urbs */ |
| @@ -148,8 +148,8 @@ struct driver_info { | |||
| 148 | * much everything except custom framing and chip-specific stuff. | 148 | * much everything except custom framing and chip-specific stuff. |
| 149 | */ | 149 | */ |
| 150 | extern int usbnet_probe(struct usb_interface *, const struct usb_device_id *); | 150 | extern int usbnet_probe(struct usb_interface *, const struct usb_device_id *); |
| 151 | extern int usbnet_suspend (struct usb_interface *, pm_message_t ); | 151 | extern int usbnet_suspend(struct usb_interface *, pm_message_t); |
| 152 | extern int usbnet_resume (struct usb_interface *); | 152 | extern int usbnet_resume(struct usb_interface *); |
| 153 | extern void usbnet_disconnect(struct usb_interface *); | 153 | extern void usbnet_disconnect(struct usb_interface *); |
| 154 | 154 | ||
| 155 | 155 | ||
| @@ -165,8 +165,8 @@ struct cdc_state { | |||
| 165 | struct usb_interface *data; | 165 | struct usb_interface *data; |
| 166 | }; | 166 | }; |
| 167 | 167 | ||
| 168 | extern int usbnet_generic_cdc_bind (struct usbnet *, struct usb_interface *); | 168 | extern int usbnet_generic_cdc_bind(struct usbnet *, struct usb_interface *); |
| 169 | extern void usbnet_cdc_unbind (struct usbnet *, struct usb_interface *); | 169 | extern void usbnet_cdc_unbind(struct usbnet *, struct usb_interface *); |
| 170 | 170 | ||
| 171 | /* CDC and RNDIS support the same host-chosen packet filters for IN transfers */ | 171 | /* CDC and RNDIS support the same host-chosen packet filters for IN transfers */ |
| 172 | #define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \ | 172 | #define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \ |
| @@ -189,29 +189,31 @@ struct skb_data { /* skb->cb is one of these */ | |||
| 189 | size_t length; | 189 | size_t length; |
| 190 | }; | 190 | }; |
| 191 | 191 | ||
| 192 | extern int usbnet_open (struct net_device *net); | 192 | extern int usbnet_open(struct net_device *net); |
| 193 | extern int usbnet_stop (struct net_device *net); | 193 | extern int usbnet_stop(struct net_device *net); |
| 194 | extern netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | 194 | extern netdev_tx_t usbnet_start_xmit(struct sk_buff *skb, |
| 195 | struct net_device *net); | 195 | struct net_device *net); |
| 196 | extern void usbnet_tx_timeout (struct net_device *net); | 196 | extern void usbnet_tx_timeout(struct net_device *net); |
| 197 | extern int usbnet_change_mtu (struct net_device *net, int new_mtu); | 197 | extern int usbnet_change_mtu(struct net_device *net, int new_mtu); |
| 198 | 198 | ||
| 199 | extern int usbnet_get_endpoints(struct usbnet *, struct usb_interface *); | 199 | extern int usbnet_get_endpoints(struct usbnet *, struct usb_interface *); |
| 200 | extern int usbnet_get_ethernet_addr(struct usbnet *, int); | 200 | extern int usbnet_get_ethernet_addr(struct usbnet *, int); |
| 201 | extern void usbnet_defer_kevent (struct usbnet *, int); | 201 | extern void usbnet_defer_kevent(struct usbnet *, int); |
| 202 | extern void usbnet_skb_return (struct usbnet *, struct sk_buff *); | 202 | extern void usbnet_skb_return(struct usbnet *, struct sk_buff *); |
| 203 | extern void usbnet_unlink_rx_urbs(struct usbnet *); | 203 | extern void usbnet_unlink_rx_urbs(struct usbnet *); |
| 204 | 204 | ||
| 205 | extern void usbnet_pause_rx(struct usbnet *); | 205 | extern void usbnet_pause_rx(struct usbnet *); |
| 206 | extern void usbnet_resume_rx(struct usbnet *); | 206 | extern void usbnet_resume_rx(struct usbnet *); |
| 207 | extern void usbnet_purge_paused_rxq(struct usbnet *); | 207 | extern void usbnet_purge_paused_rxq(struct usbnet *); |
| 208 | 208 | ||
| 209 | extern int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd); | 209 | extern int usbnet_get_settings(struct net_device *net, |
| 210 | extern int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd); | 210 | struct ethtool_cmd *cmd); |
| 211 | extern u32 usbnet_get_link (struct net_device *net); | 211 | extern int usbnet_set_settings(struct net_device *net, |
| 212 | extern u32 usbnet_get_msglevel (struct net_device *); | 212 | struct ethtool_cmd *cmd); |
| 213 | extern void usbnet_set_msglevel (struct net_device *, u32); | 213 | extern u32 usbnet_get_link(struct net_device *net); |
| 214 | extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); | 214 | extern u32 usbnet_get_msglevel(struct net_device *); |
| 215 | extern void usbnet_set_msglevel(struct net_device *, u32); | ||
| 216 | extern void usbnet_get_drvinfo(struct net_device *, struct ethtool_drvinfo *); | ||
| 215 | extern int usbnet_nway_reset(struct net_device *net); | 217 | extern int usbnet_nway_reset(struct net_device *net); |
| 216 | 218 | ||
| 217 | #endif /* __LINUX_USB_USBNET_H */ | 219 | #endif /* __LINUX_USB_USBNET_H */ |
diff --git a/include/linux/usb/wusb-wa.h b/include/linux/usb/wusb-wa.h index fb7c359bdfba..f9dec37f617b 100644 --- a/include/linux/usb/wusb-wa.h +++ b/include/linux/usb/wusb-wa.h | |||
| @@ -87,7 +87,7 @@ enum rpipe_crs { | |||
| 87 | * FIXME: explain rpipes | 87 | * FIXME: explain rpipes |
| 88 | */ | 88 | */ |
| 89 | struct usb_rpipe_descriptor { | 89 | struct usb_rpipe_descriptor { |
| 90 | u8 bLength; | 90 | u8 bLength; |
| 91 | u8 bDescriptorType; | 91 | u8 bDescriptorType; |
| 92 | __le16 wRPipeIndex; | 92 | __le16 wRPipeIndex; |
| 93 | __le16 wRequests; | 93 | __le16 wRequests; |
diff --git a/include/linux/via-core.h b/include/linux/via-core.h new file mode 100644 index 000000000000..7ffb521e1a7a --- /dev/null +++ b/include/linux/via-core.h | |||
| @@ -0,0 +1,219 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 1998-2009 VIA Technologies, Inc. All Rights Reserved. | ||
| 3 | * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved. | ||
| 4 | * Copyright 2009-2010 Jonathan Corbet <corbet@lwn.net> | ||
| 5 | * Copyright 2010 Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU General Public | ||
| 9 | * License as published by the Free Software Foundation; | ||
| 10 | * either version 2, or (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even | ||
| 14 | * the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
| 15 | * A PARTICULAR PURPOSE.See the GNU General Public License | ||
| 16 | * for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., | ||
| 21 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef __VIA_CORE_H__ | ||
| 25 | #define __VIA_CORE_H__ | ||
| 26 | #include <linux/types.h> | ||
| 27 | #include <linux/io.h> | ||
| 28 | #include <linux/spinlock.h> | ||
| 29 | #include <linux/pci.h> | ||
| 30 | |||
| 31 | /* | ||
| 32 | * A description of each known serial I2C/GPIO port. | ||
| 33 | */ | ||
| 34 | enum via_port_type { | ||
| 35 | VIA_PORT_NONE = 0, | ||
| 36 | VIA_PORT_I2C, | ||
| 37 | VIA_PORT_GPIO, | ||
| 38 | }; | ||
| 39 | |||
| 40 | enum via_port_mode { | ||
| 41 | VIA_MODE_OFF = 0, | ||
| 42 | VIA_MODE_I2C, /* Used as I2C port */ | ||
| 43 | VIA_MODE_GPIO, /* Two GPIO ports */ | ||
| 44 | }; | ||
| 45 | |||
| 46 | enum viafb_i2c_adap { | ||
| 47 | VIA_PORT_26 = 0, | ||
| 48 | VIA_PORT_31, | ||
| 49 | VIA_PORT_25, | ||
| 50 | VIA_PORT_2C, | ||
| 51 | VIA_PORT_3D, | ||
| 52 | }; | ||
| 53 | #define VIAFB_NUM_PORTS 5 | ||
| 54 | |||
| 55 | struct via_port_cfg { | ||
| 56 | enum via_port_type type; | ||
| 57 | enum via_port_mode mode; | ||
| 58 | u16 io_port; | ||
| 59 | u8 ioport_index; | ||
| 60 | }; | ||
| 61 | |||
| 62 | /* | ||
| 63 | * This is the global viafb "device" containing stuff needed by | ||
| 64 | * all subdevs. | ||
| 65 | */ | ||
| 66 | struct viafb_dev { | ||
| 67 | struct pci_dev *pdev; | ||
| 68 | int chip_type; | ||
| 69 | struct via_port_cfg *port_cfg; | ||
| 70 | /* | ||
| 71 | * Spinlock for access to device registers. Not yet | ||
| 72 | * globally used. | ||
| 73 | */ | ||
| 74 | spinlock_t reg_lock; | ||
| 75 | /* | ||
| 76 | * The framebuffer MMIO region. Little, if anything, touches | ||
| 77 | * this memory directly, and certainly nothing outside of the | ||
| 78 | * framebuffer device itself. We *do* have to be able to allocate | ||
| 79 | * chunks of this memory for other devices, though. | ||
| 80 | */ | ||
| 81 | unsigned long fbmem_start; | ||
| 82 | long fbmem_len; | ||
| 83 | void __iomem *fbmem; | ||
| 84 | #if defined(CONFIG_FB_VIA_CAMERA) || defined(CONFIG_FB_VIA_CAMERA_MODULE) | ||
| 85 | long camera_fbmem_offset; | ||
| 86 | long camera_fbmem_size; | ||
| 87 | #endif | ||
| 88 | /* | ||
| 89 | * The MMIO region for device registers. | ||
| 90 | */ | ||
| 91 | unsigned long engine_start; | ||
| 92 | unsigned long engine_len; | ||
| 93 | void __iomem *engine_mmio; | ||
| 94 | |||
| 95 | }; | ||
| 96 | |||
| 97 | /* | ||
| 98 | * Interrupt management. | ||
| 99 | */ | ||
| 100 | |||
| 101 | void viafb_irq_enable(u32 mask); | ||
| 102 | void viafb_irq_disable(u32 mask); | ||
| 103 | |||
| 104 | /* | ||
| 105 | * The global interrupt control register and its bits. | ||
| 106 | */ | ||
| 107 | #define VDE_INTERRUPT 0x200 /* Video interrupt flags/masks */ | ||
| 108 | #define VDE_I_DVISENSE 0x00000001 /* DVI sense int status */ | ||
| 109 | #define VDE_I_VBLANK 0x00000002 /* Vertical blank status */ | ||
| 110 | #define VDE_I_MCCFI 0x00000004 /* MCE compl. frame int status */ | ||
| 111 | #define VDE_I_VSYNC 0x00000008 /* VGA VSYNC int status */ | ||
| 112 | #define VDE_I_DMA0DDONE 0x00000010 /* DMA 0 descr done */ | ||
| 113 | #define VDE_I_DMA0TDONE 0x00000020 /* DMA 0 transfer done */ | ||
| 114 | #define VDE_I_DMA1DDONE 0x00000040 /* DMA 1 descr done */ | ||
| 115 | #define VDE_I_DMA1TDONE 0x00000080 /* DMA 1 transfer done */ | ||
| 116 | #define VDE_I_C1AV 0x00000100 /* Cap Eng 1 act vid end */ | ||
| 117 | #define VDE_I_HQV0 0x00000200 /* First HQV engine */ | ||
| 118 | #define VDE_I_HQV1 0x00000400 /* Second HQV engine */ | ||
| 119 | #define VDE_I_HQV1EN 0x00000800 /* Second HQV engine enable */ | ||
| 120 | #define VDE_I_C0AV 0x00001000 /* Cap Eng 0 act vid end */ | ||
| 121 | #define VDE_I_C0VBI 0x00002000 /* Cap Eng 0 VBI end */ | ||
| 122 | #define VDE_I_C1VBI 0x00004000 /* Cap Eng 1 VBI end */ | ||
| 123 | #define VDE_I_VSYNC2 0x00008000 /* Sec. Disp. VSYNC */ | ||
| 124 | #define VDE_I_DVISNSEN 0x00010000 /* DVI sense enable */ | ||
| 125 | #define VDE_I_VSYNC2EN 0x00020000 /* Sec Disp VSYNC enable */ | ||
| 126 | #define VDE_I_MCCFIEN 0x00040000 /* MC comp frame int mask enable */ | ||
| 127 | #define VDE_I_VSYNCEN 0x00080000 /* VSYNC enable */ | ||
| 128 | #define VDE_I_DMA0DDEN 0x00100000 /* DMA 0 descr done enable */ | ||
| 129 | #define VDE_I_DMA0TDEN 0x00200000 /* DMA 0 trans done enable */ | ||
| 130 | #define VDE_I_DMA1DDEN 0x00400000 /* DMA 1 descr done enable */ | ||
| 131 | #define VDE_I_DMA1TDEN 0x00800000 /* DMA 1 trans done enable */ | ||
| 132 | #define VDE_I_C1AVEN 0x01000000 /* cap 1 act vid end enable */ | ||
| 133 | #define VDE_I_HQV0EN 0x02000000 /* First hqv engine enable */ | ||
| 134 | #define VDE_I_C1VBIEN 0x04000000 /* Cap 1 VBI end enable */ | ||
| 135 | #define VDE_I_LVDSSI 0x08000000 /* LVDS sense interrupt */ | ||
| 136 | #define VDE_I_C0AVEN 0x10000000 /* Cap 0 act vid end enable */ | ||
| 137 | #define VDE_I_C0VBIEN 0x20000000 /* Cap 0 VBI end enable */ | ||
| 138 | #define VDE_I_LVDSSIEN 0x40000000 /* LVDS Sense enable */ | ||
| 139 | #define VDE_I_ENABLE 0x80000000 /* Global interrupt enable */ | ||
| 140 | |||
| 141 | /* | ||
| 142 | * DMA management. | ||
| 143 | */ | ||
| 144 | int viafb_request_dma(void); | ||
| 145 | void viafb_release_dma(void); | ||
| 146 | /* void viafb_dma_copy_out(unsigned int offset, dma_addr_t paddr, int len); */ | ||
| 147 | int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg); | ||
| 148 | |||
| 149 | /* | ||
| 150 | * DMA Controller registers. | ||
| 151 | */ | ||
| 152 | #define VDMA_MR0 0xe00 /* Mod reg 0 */ | ||
| 153 | #define VDMA_MR_CHAIN 0x01 /* Chaining mode */ | ||
| 154 | #define VDMA_MR_TDIE 0x02 /* Transfer done int enable */ | ||
| 155 | #define VDMA_CSR0 0xe04 /* Control/status */ | ||
| 156 | #define VDMA_C_ENABLE 0x01 /* DMA Enable */ | ||
| 157 | #define VDMA_C_START 0x02 /* Start a transfer */ | ||
| 158 | #define VDMA_C_ABORT 0x04 /* Abort a transfer */ | ||
| 159 | #define VDMA_C_DONE 0x08 /* Transfer is done */ | ||
| 160 | #define VDMA_MARL0 0xe20 /* Mem addr low */ | ||
| 161 | #define VDMA_MARH0 0xe24 /* Mem addr high */ | ||
| 162 | #define VDMA_DAR0 0xe28 /* Device address */ | ||
| 163 | #define VDMA_DQWCR0 0xe2c /* Count (16-byte) */ | ||
| 164 | #define VDMA_TMR0 0xe30 /* Tile mode reg */ | ||
| 165 | #define VDMA_DPRL0 0xe34 /* Not sure */ | ||
| 166 | #define VDMA_DPR_IN 0x08 /* Inbound transfer to FB */ | ||
| 167 | #define VDMA_DPRH0 0xe38 | ||
| 168 | #define VDMA_PMR0 (0xe00 + 0x134) /* Pitch mode */ | ||
| 169 | |||
| 170 | /* | ||
| 171 | * Useful stuff that probably belongs somewhere global. | ||
| 172 | */ | ||
| 173 | #define VGA_WIDTH 640 | ||
| 174 | #define VGA_HEIGHT 480 | ||
| 175 | |||
| 176 | /* | ||
| 177 | * Indexed port operations. Note that these are all multi-op | ||
| 178 | * functions; every invocation will be racy if you're not holding | ||
| 179 | * reg_lock. | ||
| 180 | */ | ||
| 181 | |||
| 182 | #define VIAStatus 0x3DA /* Non-indexed port */ | ||
| 183 | #define VIACR 0x3D4 | ||
| 184 | #define VIASR 0x3C4 | ||
| 185 | #define VIAGR 0x3CE | ||
| 186 | #define VIAAR 0x3C0 | ||
| 187 | |||
| 188 | static inline u8 via_read_reg(u16 port, u8 index) | ||
| 189 | { | ||
| 190 | outb(index, port); | ||
| 191 | return inb(port + 1); | ||
| 192 | } | ||
| 193 | |||
| 194 | static inline void via_write_reg(u16 port, u8 index, u8 data) | ||
| 195 | { | ||
| 196 | outb(index, port); | ||
| 197 | outb(data, port + 1); | ||
| 198 | } | ||
| 199 | |||
| 200 | static inline void via_write_reg_mask(u16 port, u8 index, u8 data, u8 mask) | ||
| 201 | { | ||
| 202 | u8 old; | ||
| 203 | |||
| 204 | outb(index, port); | ||
| 205 | old = inb(port + 1); | ||
| 206 | outb((data & mask) | (old & ~mask), port + 1); | ||
| 207 | } | ||
| 208 | |||
| 209 | #define VIA_MISC_REG_READ 0x03CC | ||
| 210 | #define VIA_MISC_REG_WRITE 0x03C2 | ||
| 211 | |||
| 212 | static inline void via_write_misc_reg_mask(u8 data, u8 mask) | ||
| 213 | { | ||
| 214 | u8 old = inb(VIA_MISC_REG_READ); | ||
| 215 | outb((data & mask) | (old & ~mask), VIA_MISC_REG_WRITE); | ||
| 216 | } | ||
| 217 | |||
| 218 | |||
| 219 | #endif /* __VIA_CORE_H__ */ | ||
diff --git a/include/linux/via-gpio.h b/include/linux/via-gpio.h new file mode 100644 index 000000000000..8281aea3dd6d --- /dev/null +++ b/include/linux/via-gpio.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | /* | ||
| 2 | * Support for viafb GPIO ports. | ||
| 3 | * | ||
| 4 | * Copyright 2009 Jonathan Corbet <corbet@lwn.net> | ||
| 5 | * Distributable under version 2 of the GNU General Public License. | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef __VIA_GPIO_H__ | ||
| 9 | #define __VIA_GPIO_H__ | ||
| 10 | |||
| 11 | extern int viafb_gpio_lookup(const char *name); | ||
| 12 | extern int viafb_gpio_init(void); | ||
| 13 | extern void viafb_gpio_exit(void); | ||
| 14 | #endif | ||
diff --git a/include/linux/via_i2c.h b/include/linux/via_i2c.h new file mode 100644 index 000000000000..44532e468c05 --- /dev/null +++ b/include/linux/via_i2c.h | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 1998-2009 VIA Technologies, Inc. All Rights Reserved. | ||
| 3 | * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved. | ||
| 4 | |||
| 5 | * This program is free software; you can redistribute it and/or | ||
| 6 | * modify it under the terms of the GNU General Public | ||
| 7 | * License as published by the Free Software Foundation; | ||
| 8 | * either version 2, or (at your option) any later version. | ||
| 9 | |||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even | ||
| 12 | * the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
| 13 | * A PARTICULAR PURPOSE.See the GNU General Public License | ||
| 14 | * for more details. | ||
| 15 | |||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., | ||
| 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 20 | */ | ||
| 21 | #ifndef __VIA_I2C_H__ | ||
| 22 | #define __VIA_I2C_H__ | ||
| 23 | |||
| 24 | #include <linux/i2c.h> | ||
| 25 | #include <linux/i2c-algo-bit.h> | ||
| 26 | |||
| 27 | struct via_i2c_stuff { | ||
| 28 | u16 i2c_port; /* GPIO or I2C port */ | ||
| 29 | u16 is_active; /* Being used as I2C? */ | ||
| 30 | struct i2c_adapter adapter; | ||
| 31 | struct i2c_algo_bit_data algo; | ||
| 32 | }; | ||
| 33 | |||
| 34 | |||
| 35 | int viafb_i2c_readbyte(u8 adap, u8 slave_addr, u8 index, u8 *pdata); | ||
| 36 | int viafb_i2c_writebyte(u8 adap, u8 slave_addr, u8 index, u8 data); | ||
| 37 | int viafb_i2c_readbytes(u8 adap, u8 slave_addr, u8 index, u8 *buff, int buff_len); | ||
| 38 | struct i2c_adapter *viafb_find_i2c_adapter(enum viafb_i2c_adap which); | ||
| 39 | |||
| 40 | extern int viafb_i2c_init(void); | ||
| 41 | extern void viafb_i2c_exit(void); | ||
| 42 | #endif /* __VIA_I2C_H__ */ | ||
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 3793d168b44d..047f7e6edb86 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
| @@ -160,16 +160,6 @@ enum v4l2_buf_type { | |||
| 160 | V4L2_BUF_TYPE_PRIVATE = 0x80, | 160 | V4L2_BUF_TYPE_PRIVATE = 0x80, |
| 161 | }; | 161 | }; |
| 162 | 162 | ||
| 163 | enum v4l2_ctrl_type { | ||
| 164 | V4L2_CTRL_TYPE_INTEGER = 1, | ||
| 165 | V4L2_CTRL_TYPE_BOOLEAN = 2, | ||
| 166 | V4L2_CTRL_TYPE_MENU = 3, | ||
| 167 | V4L2_CTRL_TYPE_BUTTON = 4, | ||
| 168 | V4L2_CTRL_TYPE_INTEGER64 = 5, | ||
| 169 | V4L2_CTRL_TYPE_CTRL_CLASS = 6, | ||
| 170 | V4L2_CTRL_TYPE_STRING = 7, | ||
| 171 | }; | ||
| 172 | |||
| 173 | enum v4l2_tuner_type { | 163 | enum v4l2_tuner_type { |
| 174 | V4L2_TUNER_RADIO = 1, | 164 | V4L2_TUNER_RADIO = 1, |
| 175 | V4L2_TUNER_ANALOG_TV = 2, | 165 | V4L2_TUNER_ANALOG_TV = 2, |
| @@ -294,6 +284,8 @@ struct v4l2_pix_format { | |||
| 294 | 284 | ||
| 295 | /* Grey formats */ | 285 | /* Grey formats */ |
| 296 | #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ | 286 | #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ |
| 287 | #define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */ | ||
| 288 | #define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */ | ||
| 297 | #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ | 289 | #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ |
| 298 | #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ | 290 | #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ |
| 299 | 291 | ||
| @@ -369,6 +361,7 @@ struct v4l2_pix_format { | |||
| 369 | #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ | 361 | #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ |
| 370 | #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ | 362 | #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ |
| 371 | #define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ | 363 | #define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ |
| 364 | #define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ | ||
| 372 | 365 | ||
| 373 | /* | 366 | /* |
| 374 | * F O R M A T E N U M E R A T I O N | 367 | * F O R M A T E N U M E R A T I O N |
| @@ -549,6 +542,8 @@ struct v4l2_buffer { | |||
| 549 | #define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */ | 542 | #define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */ |
| 550 | #define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */ | 543 | #define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */ |
| 551 | #define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */ | 544 | #define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */ |
| 545 | /* Buffer is ready, but the data contained within is corrupted. */ | ||
| 546 | #define V4L2_BUF_FLAG_ERROR 0x0040 | ||
| 552 | #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ | 547 | #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ |
| 553 | #define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */ | 548 | #define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */ |
| 554 | 549 | ||
| @@ -939,6 +934,16 @@ struct v4l2_ext_controls { | |||
| 939 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) | 934 | #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) |
| 940 | #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) | 935 | #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) |
| 941 | 936 | ||
| 937 | enum v4l2_ctrl_type { | ||
| 938 | V4L2_CTRL_TYPE_INTEGER = 1, | ||
| 939 | V4L2_CTRL_TYPE_BOOLEAN = 2, | ||
| 940 | V4L2_CTRL_TYPE_MENU = 3, | ||
| 941 | V4L2_CTRL_TYPE_BUTTON = 4, | ||
| 942 | V4L2_CTRL_TYPE_INTEGER64 = 5, | ||
| 943 | V4L2_CTRL_TYPE_CTRL_CLASS = 6, | ||
| 944 | V4L2_CTRL_TYPE_STRING = 7, | ||
| 945 | }; | ||
| 946 | |||
| 942 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ | 947 | /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ |
| 943 | struct v4l2_queryctrl { | 948 | struct v4l2_queryctrl { |
| 944 | __u32 id; | 949 | __u32 id; |
| @@ -1023,14 +1028,24 @@ enum v4l2_colorfx { | |||
| 1023 | V4L2_COLORFX_NONE = 0, | 1028 | V4L2_COLORFX_NONE = 0, |
| 1024 | V4L2_COLORFX_BW = 1, | 1029 | V4L2_COLORFX_BW = 1, |
| 1025 | V4L2_COLORFX_SEPIA = 2, | 1030 | V4L2_COLORFX_SEPIA = 2, |
| 1031 | V4L2_COLORFX_NEGATIVE = 3, | ||
| 1032 | V4L2_COLORFX_EMBOSS = 4, | ||
| 1033 | V4L2_COLORFX_SKETCH = 5, | ||
| 1034 | V4L2_COLORFX_SKY_BLUE = 6, | ||
| 1035 | V4L2_COLORFX_GRASS_GREEN = 7, | ||
| 1036 | V4L2_COLORFX_SKIN_WHITEN = 8, | ||
| 1037 | V4L2_COLORFX_VIVID = 9, | ||
| 1026 | }; | 1038 | }; |
| 1027 | #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) | 1039 | #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) |
| 1028 | #define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) | 1040 | #define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) |
| 1029 | 1041 | ||
| 1030 | #define V4L2_CID_ROTATE (V4L2_CID_BASE+34) | 1042 | #define V4L2_CID_ROTATE (V4L2_CID_BASE+34) |
| 1031 | #define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35) | 1043 | #define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35) |
| 1044 | |||
| 1045 | #define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36) | ||
| 1046 | |||
| 1032 | /* last CID + 1 */ | 1047 | /* last CID + 1 */ |
| 1033 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+36) | 1048 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+37) |
| 1034 | 1049 | ||
| 1035 | /* MPEG-class control IDs defined by V4L2 */ | 1050 | /* MPEG-class control IDs defined by V4L2 */ |
| 1036 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | 1051 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) |
| @@ -1276,6 +1291,9 @@ enum v4l2_exposure_auto_type { | |||
| 1276 | 1291 | ||
| 1277 | #define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16) | 1292 | #define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16) |
| 1278 | 1293 | ||
| 1294 | #define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17) | ||
| 1295 | #define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18) | ||
| 1296 | |||
| 1279 | /* FM Modulator class control IDs */ | 1297 | /* FM Modulator class control IDs */ |
| 1280 | #define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900) | 1298 | #define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900) |
| 1281 | #define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1) | 1299 | #define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1) |
| @@ -1621,6 +1639,38 @@ struct v4l2_streamparm { | |||
| 1621 | }; | 1639 | }; |
| 1622 | 1640 | ||
| 1623 | /* | 1641 | /* |
| 1642 | * E V E N T S | ||
| 1643 | */ | ||
| 1644 | |||
| 1645 | #define V4L2_EVENT_ALL 0 | ||
| 1646 | #define V4L2_EVENT_VSYNC 1 | ||
| 1647 | #define V4L2_EVENT_EOS 2 | ||
| 1648 | #define V4L2_EVENT_PRIVATE_START 0x08000000 | ||
| 1649 | |||
| 1650 | /* Payload for V4L2_EVENT_VSYNC */ | ||
| 1651 | struct v4l2_event_vsync { | ||
| 1652 | /* Can be V4L2_FIELD_ANY, _NONE, _TOP or _BOTTOM */ | ||
| 1653 | __u8 field; | ||
| 1654 | } __attribute__ ((packed)); | ||
| 1655 | |||
| 1656 | struct v4l2_event { | ||
| 1657 | __u32 type; | ||
| 1658 | union { | ||
| 1659 | struct v4l2_event_vsync vsync; | ||
| 1660 | __u8 data[64]; | ||
| 1661 | } u; | ||
| 1662 | __u32 pending; | ||
| 1663 | __u32 sequence; | ||
| 1664 | struct timespec timestamp; | ||
| 1665 | __u32 reserved[9]; | ||
| 1666 | }; | ||
| 1667 | |||
| 1668 | struct v4l2_event_subscription { | ||
| 1669 | __u32 type; | ||
| 1670 | __u32 reserved[7]; | ||
| 1671 | }; | ||
| 1672 | |||
| 1673 | /* | ||
| 1624 | * A D V A N C E D D E B U G G I N G | 1674 | * A D V A N C E D D E B U G G I N G |
| 1625 | * | 1675 | * |
| 1626 | * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS! | 1676 | * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS! |
| @@ -1742,6 +1792,9 @@ struct v4l2_dbg_chip_ident { | |||
| 1742 | #define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct v4l2_dv_preset) | 1792 | #define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct v4l2_dv_preset) |
| 1743 | #define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings) | 1793 | #define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings) |
| 1744 | #define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings) | 1794 | #define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings) |
| 1795 | #define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event) | ||
| 1796 | #define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription) | ||
| 1797 | #define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription) | ||
| 1745 | 1798 | ||
| 1746 | /* Reminder: when adding new ioctls please add support for them to | 1799 | /* Reminder: when adding new ioctls please add support for them to |
| 1747 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 1800 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index f508c651e53d..40d1709bdbf4 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
| @@ -98,6 +98,7 @@ struct virtio_device { | |||
| 98 | void *priv; | 98 | void *priv; |
| 99 | }; | 99 | }; |
| 100 | 100 | ||
| 101 | #define dev_to_virtio(dev) container_of(dev, struct virtio_device, dev) | ||
| 101 | int register_virtio_device(struct virtio_device *dev); | 102 | int register_virtio_device(struct virtio_device *dev); |
| 102 | void unregister_virtio_device(struct virtio_device *dev); | 103 | void unregister_virtio_device(struct virtio_device *dev); |
| 103 | 104 | ||
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h index 332275080083..5cf11765146b 100644 --- a/include/linux/virtio_9p.h +++ b/include/linux/virtio_9p.h | |||
| @@ -5,4 +5,16 @@ | |||
| 5 | #include <linux/virtio_ids.h> | 5 | #include <linux/virtio_ids.h> |
| 6 | #include <linux/virtio_config.h> | 6 | #include <linux/virtio_config.h> |
| 7 | 7 | ||
| 8 | /* The feature bitmap for virtio 9P */ | ||
| 9 | |||
| 10 | /* The mount point is specified in a config variable */ | ||
| 11 | #define VIRTIO_9P_MOUNT_TAG 0 | ||
| 12 | |||
| 13 | struct virtio_9p_config { | ||
| 14 | /* length of the tag name */ | ||
| 15 | __u16 tag_len; | ||
| 16 | /* non-NULL terminated tag name */ | ||
| 17 | __u8 tag[0]; | ||
| 18 | } __attribute__((packed)); | ||
| 19 | |||
| 8 | #endif /* _LINUX_VIRTIO_9P_H */ | 20 | #endif /* _LINUX_VIRTIO_9P_H */ |
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h index ae4f039515b4..92228a8fbcbc 100644 --- a/include/linux/virtio_console.h +++ b/include/linux/virtio_console.h | |||
| @@ -12,37 +12,14 @@ | |||
| 12 | 12 | ||
| 13 | /* Feature bits */ | 13 | /* Feature bits */ |
| 14 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ | 14 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ |
| 15 | #define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */ | ||
| 16 | 15 | ||
| 17 | struct virtio_console_config { | 16 | struct virtio_console_config { |
| 18 | /* colums of the screens */ | 17 | /* colums of the screens */ |
| 19 | __u16 cols; | 18 | __u16 cols; |
| 20 | /* rows of the screens */ | 19 | /* rows of the screens */ |
| 21 | __u16 rows; | 20 | __u16 rows; |
| 22 | /* max. number of ports this device can hold */ | ||
| 23 | __u32 max_nr_ports; | ||
| 24 | /* number of ports added so far */ | ||
| 25 | __u32 nr_ports; | ||
| 26 | } __attribute__((packed)); | 21 | } __attribute__((packed)); |
| 27 | 22 | ||
| 28 | /* | ||
| 29 | * A message that's passed between the Host and the Guest for a | ||
| 30 | * particular port. | ||
| 31 | */ | ||
| 32 | struct virtio_console_control { | ||
| 33 | __u32 id; /* Port number */ | ||
| 34 | __u16 event; /* The kind of control event (see below) */ | ||
| 35 | __u16 value; /* Extra information for the key */ | ||
| 36 | }; | ||
| 37 | |||
| 38 | /* Some events for control messages */ | ||
| 39 | #define VIRTIO_CONSOLE_PORT_READY 0 | ||
| 40 | #define VIRTIO_CONSOLE_CONSOLE_PORT 1 | ||
| 41 | #define VIRTIO_CONSOLE_RESIZE 2 | ||
| 42 | #define VIRTIO_CONSOLE_PORT_OPEN 3 | ||
| 43 | #define VIRTIO_CONSOLE_PORT_NAME 4 | ||
| 44 | #define VIRTIO_CONSOLE_PORT_REMOVE 5 | ||
| 45 | |||
| 46 | #ifdef __KERNEL__ | 23 | #ifdef __KERNEL__ |
| 47 | int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); | 24 | int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); |
| 48 | #endif /* __KERNEL__ */ | 25 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/vt.h b/include/linux/vt.h index 778b7b2a47d4..d5dd0bc408fd 100644 --- a/include/linux/vt.h +++ b/include/linux/vt.h | |||
| @@ -27,7 +27,7 @@ struct vt_mode { | |||
| 27 | #define VT_SETMODE 0x5602 /* set mode of active vt */ | 27 | #define VT_SETMODE 0x5602 /* set mode of active vt */ |
| 28 | #define VT_AUTO 0x00 /* auto vt switching */ | 28 | #define VT_AUTO 0x00 /* auto vt switching */ |
| 29 | #define VT_PROCESS 0x01 /* process controls switching */ | 29 | #define VT_PROCESS 0x01 /* process controls switching */ |
| 30 | #define VT_PROCESS_AUTO 0x02 /* process is notified of switching */ | 30 | #define VT_ACKACQ 0x02 /* acknowledge switch */ |
| 31 | 31 | ||
| 32 | struct vt_stat { | 32 | struct vt_stat { |
| 33 | unsigned short v_active; /* active vt */ | 33 | unsigned short v_active; /* active vt */ |
| @@ -38,7 +38,6 @@ struct vt_stat { | |||
| 38 | #define VT_SENDSIG 0x5604 /* signal to send to bitmask of vts */ | 38 | #define VT_SENDSIG 0x5604 /* signal to send to bitmask of vts */ |
| 39 | 39 | ||
| 40 | #define VT_RELDISP 0x5605 /* release display */ | 40 | #define VT_RELDISP 0x5605 /* release display */ |
| 41 | #define VT_ACKACQ 0x02 /* acknowledge switch */ | ||
| 42 | 41 | ||
| 43 | #define VT_ACTIVATE 0x5606 /* make vt active */ | 42 | #define VT_ACTIVATE 0x5606 /* make vt active */ |
| 44 | #define VT_WAITACTIVE 0x5607 /* wait for vt active */ | 43 | #define VT_WAITACTIVE 0x5607 /* wait for vt active */ |
diff --git a/include/linux/wait.h b/include/linux/wait.h index a48e16b77d5e..0836ccc57121 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
| @@ -127,12 +127,26 @@ static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new) | |||
| 127 | /* | 127 | /* |
| 128 | * Used for wake-one threads: | 128 | * Used for wake-one threads: |
| 129 | */ | 129 | */ |
| 130 | static inline void __add_wait_queue_exclusive(wait_queue_head_t *q, | ||
| 131 | wait_queue_t *wait) | ||
| 132 | { | ||
| 133 | wait->flags |= WQ_FLAG_EXCLUSIVE; | ||
| 134 | __add_wait_queue(q, wait); | ||
| 135 | } | ||
| 136 | |||
| 130 | static inline void __add_wait_queue_tail(wait_queue_head_t *head, | 137 | static inline void __add_wait_queue_tail(wait_queue_head_t *head, |
| 131 | wait_queue_t *new) | 138 | wait_queue_t *new) |
| 132 | { | 139 | { |
| 133 | list_add_tail(&new->task_list, &head->task_list); | 140 | list_add_tail(&new->task_list, &head->task_list); |
| 134 | } | 141 | } |
| 135 | 142 | ||
| 143 | static inline void __add_wait_queue_tail_exclusive(wait_queue_head_t *q, | ||
| 144 | wait_queue_t *wait) | ||
| 145 | { | ||
| 146 | wait->flags |= WQ_FLAG_EXCLUSIVE; | ||
| 147 | __add_wait_queue_tail(q, wait); | ||
| 148 | } | ||
| 149 | |||
| 136 | static inline void __remove_wait_queue(wait_queue_head_t *head, | 150 | static inline void __remove_wait_queue(wait_queue_head_t *head, |
| 137 | wait_queue_t *old) | 151 | wait_queue_t *old) |
| 138 | { | 152 | { |
| @@ -362,6 +376,155 @@ do { \ | |||
| 362 | __ret; \ | 376 | __ret; \ |
| 363 | }) | 377 | }) |
| 364 | 378 | ||
| 379 | |||
| 380 | #define __wait_event_interruptible_locked(wq, condition, exclusive, irq) \ | ||
| 381 | ({ \ | ||
| 382 | int __ret = 0; \ | ||
| 383 | DEFINE_WAIT(__wait); \ | ||
| 384 | if (exclusive) \ | ||
| 385 | __wait.flags |= WQ_FLAG_EXCLUSIVE; \ | ||
| 386 | do { \ | ||
| 387 | if (likely(list_empty(&__wait.task_list))) \ | ||
| 388 | __add_wait_queue_tail(&(wq), &__wait); \ | ||
| 389 | set_current_state(TASK_INTERRUPTIBLE); \ | ||
| 390 | if (signal_pending(current)) { \ | ||
| 391 | __ret = -ERESTARTSYS; \ | ||
| 392 | break; \ | ||
| 393 | } \ | ||
| 394 | if (irq) \ | ||
| 395 | spin_unlock_irq(&(wq).lock); \ | ||
| 396 | else \ | ||
| 397 | spin_unlock(&(wq).lock); \ | ||
| 398 | schedule(); \ | ||
| 399 | if (irq) \ | ||
| 400 | spin_lock_irq(&(wq).lock); \ | ||
| 401 | else \ | ||
| 402 | spin_lock(&(wq).lock); \ | ||
| 403 | } while (!(condition)); \ | ||
| 404 | __remove_wait_queue(&(wq), &__wait); \ | ||
| 405 | __set_current_state(TASK_RUNNING); \ | ||
| 406 | __ret; \ | ||
| 407 | }) | ||
| 408 | |||
| 409 | |||
| 410 | /** | ||
| 411 | * wait_event_interruptible_locked - sleep until a condition gets true | ||
| 412 | * @wq: the waitqueue to wait on | ||
| 413 | * @condition: a C expression for the event to wait for | ||
| 414 | * | ||
| 415 | * The process is put to sleep (TASK_INTERRUPTIBLE) until the | ||
| 416 | * @condition evaluates to true or a signal is received. | ||
| 417 | * The @condition is checked each time the waitqueue @wq is woken up. | ||
| 418 | * | ||
| 419 | * It must be called with wq.lock being held. This spinlock is | ||
| 420 | * unlocked while sleeping but @condition testing is done while lock | ||
| 421 | * is held and when this macro exits the lock is held. | ||
| 422 | * | ||
| 423 | * The lock is locked/unlocked using spin_lock()/spin_unlock() | ||
| 424 | * functions which must match the way they are locked/unlocked outside | ||
| 425 | * of this macro. | ||
| 426 | * | ||
| 427 | * wake_up_locked() has to be called after changing any variable that could | ||
| 428 | * change the result of the wait condition. | ||
| 429 | * | ||
| 430 | * The function will return -ERESTARTSYS if it was interrupted by a | ||
| 431 | * signal and 0 if @condition evaluated to true. | ||
| 432 | */ | ||
| 433 | #define wait_event_interruptible_locked(wq, condition) \ | ||
| 434 | ((condition) \ | ||
| 435 | ? 0 : __wait_event_interruptible_locked(wq, condition, 0, 0)) | ||
| 436 | |||
| 437 | /** | ||
| 438 | * wait_event_interruptible_locked_irq - sleep until a condition gets true | ||
| 439 | * @wq: the waitqueue to wait on | ||
| 440 | * @condition: a C expression for the event to wait for | ||
| 441 | * | ||
| 442 | * The process is put to sleep (TASK_INTERRUPTIBLE) until the | ||
| 443 | * @condition evaluates to true or a signal is received. | ||
| 444 | * The @condition is checked each time the waitqueue @wq is woken up. | ||
| 445 | * | ||
| 446 | * It must be called with wq.lock being held. This spinlock is | ||
| 447 | * unlocked while sleeping but @condition testing is done while lock | ||
| 448 | * is held and when this macro exits the lock is held. | ||
| 449 | * | ||
| 450 | * The lock is locked/unlocked using spin_lock_irq()/spin_unlock_irq() | ||
| 451 | * functions which must match the way they are locked/unlocked outside | ||
| 452 | * of this macro. | ||
| 453 | * | ||
| 454 | * wake_up_locked() has to be called after changing any variable that could | ||
| 455 | * change the result of the wait condition. | ||
| 456 | * | ||
| 457 | * The function will return -ERESTARTSYS if it was interrupted by a | ||
| 458 | * signal and 0 if @condition evaluated to true. | ||
| 459 | */ | ||
| 460 | #define wait_event_interruptible_locked_irq(wq, condition) \ | ||
| 461 | ((condition) \ | ||
| 462 | ? 0 : __wait_event_interruptible_locked(wq, condition, 0, 1)) | ||
| 463 | |||
| 464 | /** | ||
| 465 | * wait_event_interruptible_exclusive_locked - sleep exclusively until a condition gets true | ||
| 466 | * @wq: the waitqueue to wait on | ||
| 467 | * @condition: a C expression for the event to wait for | ||
| 468 | * | ||
| 469 | * The process is put to sleep (TASK_INTERRUPTIBLE) until the | ||
| 470 | * @condition evaluates to true or a signal is received. | ||
| 471 | * The @condition is checked each time the waitqueue @wq is woken up. | ||
| 472 | * | ||
| 473 | * It must be called with wq.lock being held. This spinlock is | ||
| 474 | * unlocked while sleeping but @condition testing is done while lock | ||
| 475 | * is held and when this macro exits the lock is held. | ||
| 476 | * | ||
| 477 | * The lock is locked/unlocked using spin_lock()/spin_unlock() | ||
| 478 | * functions which must match the way they are locked/unlocked outside | ||
| 479 | * of this macro. | ||
| 480 | * | ||
| 481 | * The process is put on the wait queue with an WQ_FLAG_EXCLUSIVE flag | ||
| 482 | * set thus when other process waits process on the list if this | ||
| 483 | * process is awaken further processes are not considered. | ||
| 484 | * | ||
| 485 | * wake_up_locked() has to be called after changing any variable that could | ||
| 486 | * change the result of the wait condition. | ||
| 487 | * | ||
| 488 | * The function will return -ERESTARTSYS if it was interrupted by a | ||
| 489 | * signal and 0 if @condition evaluated to true. | ||
| 490 | */ | ||
| 491 | #define wait_event_interruptible_exclusive_locked(wq, condition) \ | ||
| 492 | ((condition) \ | ||
| 493 | ? 0 : __wait_event_interruptible_locked(wq, condition, 1, 0)) | ||
| 494 | |||
| 495 | /** | ||
| 496 | * wait_event_interruptible_exclusive_locked_irq - sleep until a condition gets true | ||
| 497 | * @wq: the waitqueue to wait on | ||
| 498 | * @condition: a C expression for the event to wait for | ||
| 499 | * | ||
| 500 | * The process is put to sleep (TASK_INTERRUPTIBLE) until the | ||
| 501 | * @condition evaluates to true or a signal is received. | ||
| 502 | * The @condition is checked each time the waitqueue @wq is woken up. | ||
| 503 | * | ||
| 504 | * It must be called with wq.lock being held. This spinlock is | ||
| 505 | * unlocked while sleeping but @condition testing is done while lock | ||
| 506 | * is held and when this macro exits the lock is held. | ||
| 507 | * | ||
| 508 | * The lock is locked/unlocked using spin_lock_irq()/spin_unlock_irq() | ||
| 509 | * functions which must match the way they are locked/unlocked outside | ||
| 510 | * of this macro. | ||
| 511 | * | ||
| 512 | * The process is put on the wait queue with an WQ_FLAG_EXCLUSIVE flag | ||
| 513 | * set thus when other process waits process on the list if this | ||
| 514 | * process is awaken further processes are not considered. | ||
| 515 | * | ||
| 516 | * wake_up_locked() has to be called after changing any variable that could | ||
| 517 | * change the result of the wait condition. | ||
| 518 | * | ||
| 519 | * The function will return -ERESTARTSYS if it was interrupted by a | ||
| 520 | * signal and 0 if @condition evaluated to true. | ||
| 521 | */ | ||
| 522 | #define wait_event_interruptible_exclusive_locked_irq(wq, condition) \ | ||
| 523 | ((condition) \ | ||
| 524 | ? 0 : __wait_event_interruptible_locked(wq, condition, 1, 1)) | ||
| 525 | |||
| 526 | |||
| 527 | |||
| 365 | #define __wait_event_killable(wq, condition, ret) \ | 528 | #define __wait_event_killable(wq, condition, ret) \ |
| 366 | do { \ | 529 | do { \ |
| 367 | DEFINE_WAIT(__wait); \ | 530 | DEFINE_WAIT(__wait); \ |
| @@ -404,25 +567,6 @@ do { \ | |||
| 404 | }) | 567 | }) |
| 405 | 568 | ||
| 406 | /* | 569 | /* |
| 407 | * Must be called with the spinlock in the wait_queue_head_t held. | ||
| 408 | */ | ||
| 409 | static inline void add_wait_queue_exclusive_locked(wait_queue_head_t *q, | ||
| 410 | wait_queue_t * wait) | ||
| 411 | { | ||
| 412 | wait->flags |= WQ_FLAG_EXCLUSIVE; | ||
| 413 | __add_wait_queue_tail(q, wait); | ||
| 414 | } | ||
| 415 | |||
| 416 | /* | ||
| 417 | * Must be called with the spinlock in the wait_queue_head_t held. | ||
| 418 | */ | ||
| 419 | static inline void remove_wait_queue_locked(wait_queue_head_t *q, | ||
| 420 | wait_queue_t * wait) | ||
| 421 | { | ||
| 422 | __remove_wait_queue(q, wait); | ||
| 423 | } | ||
| 424 | |||
| 425 | /* | ||
| 426 | * These are the old interfaces to sleep waiting for an event. | 570 | * These are the old interfaces to sleep waiting for an event. |
| 427 | * They are racy. DO NOT use them, use the wait_event* interfaces above. | 571 | * They are racy. DO NOT use them, use the wait_event* interfaces above. |
| 428 | * We plan to remove these interfaces. | 572 | * We plan to remove these interfaces. |
diff --git a/include/linux/wimax/debug.h b/include/linux/wimax/debug.h index db8096e88533..57031b4d12f2 100644 --- a/include/linux/wimax/debug.h +++ b/include/linux/wimax/debug.h | |||
| @@ -155,6 +155,7 @@ | |||
| 155 | 155 | ||
| 156 | #include <linux/types.h> | 156 | #include <linux/types.h> |
| 157 | #include <linux/device.h> | 157 | #include <linux/device.h> |
| 158 | #include <linux/slab.h> | ||
| 158 | 159 | ||
| 159 | 160 | ||
| 160 | /* Backend stuff */ | 161 | /* Backend stuff */ |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index 5b4c6c772a9b..e6827eedf18b 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
| @@ -346,6 +346,8 @@ | |||
| 346 | #define SIOCIWFIRST 0x8B00 | 346 | #define SIOCIWFIRST 0x8B00 |
| 347 | #define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */ | 347 | #define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */ |
| 348 | #define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST) | 348 | #define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST) |
| 349 | #define IW_HANDLER(id, func) \ | ||
| 350 | [IW_IOCTL_IDX(id)] = func | ||
| 349 | 351 | ||
| 350 | /* Odd : get (world access), even : set (root access) */ | 352 | /* Odd : get (world access), even : set (root access) */ |
| 351 | #define IW_IS_SET(cmd) (!((cmd) & 0x1)) | 353 | #define IW_IS_SET(cmd) (!((cmd) & 0x1)) |
| @@ -648,7 +650,7 @@ | |||
| 648 | * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */ | 650 | * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */ |
| 649 | #define IW_EVENT_CAPA_BASE(cmd) ((cmd >= SIOCIWFIRSTPRIV) ? \ | 651 | #define IW_EVENT_CAPA_BASE(cmd) ((cmd >= SIOCIWFIRSTPRIV) ? \ |
| 650 | (cmd - SIOCIWFIRSTPRIV + 0x60) : \ | 652 | (cmd - SIOCIWFIRSTPRIV + 0x60) : \ |
| 651 | (cmd - SIOCSIWCOMMIT)) | 653 | (cmd - SIOCIWFIRST)) |
| 652 | #define IW_EVENT_CAPA_INDEX(cmd) (IW_EVENT_CAPA_BASE(cmd) >> 5) | 654 | #define IW_EVENT_CAPA_INDEX(cmd) (IW_EVENT_CAPA_BASE(cmd) >> 5) |
| 653 | #define IW_EVENT_CAPA_MASK(cmd) (1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F)) | 655 | #define IW_EVENT_CAPA_MASK(cmd) (1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F)) |
| 654 | /* Event capability constants - event autogenerated by the kernel | 656 | /* Event capability constants - event autogenerated by the kernel |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 76e8903cd204..36520ded3e06 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -34,6 +34,9 @@ struct writeback_control { | |||
| 34 | enum writeback_sync_modes sync_mode; | 34 | enum writeback_sync_modes sync_mode; |
| 35 | unsigned long *older_than_this; /* If !NULL, only write back inodes | 35 | unsigned long *older_than_this; /* If !NULL, only write back inodes |
| 36 | older than this */ | 36 | older than this */ |
| 37 | unsigned long wb_start; /* Time writeback_inodes_wb was | ||
| 38 | called. This is needed to avoid | ||
| 39 | extra jobs and livelock */ | ||
| 37 | long nr_to_write; /* Write this many pages, and decrement | 40 | long nr_to_write; /* Write this many pages, and decrement |
| 38 | this for each page written */ | 41 | this for each page written */ |
| 39 | long pages_skipped; /* Pages which were not written */ | 42 | long pages_skipped; /* Pages which were not written */ |
diff --git a/include/linux/zorro.h b/include/linux/zorro.h index 913bfc226dda..7bf9db525e9e 100644 --- a/include/linux/zorro.h +++ b/include/linux/zorro.h | |||
| @@ -38,8 +38,6 @@ | |||
| 38 | typedef __u32 zorro_id; | 38 | typedef __u32 zorro_id; |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | #define ZORRO_WILDCARD (0xffffffff) /* not official */ | ||
| 42 | |||
| 43 | /* Include the ID list */ | 41 | /* Include the ID list */ |
| 44 | #include <linux/zorro_ids.h> | 42 | #include <linux/zorro_ids.h> |
| 45 | 43 | ||
| @@ -116,6 +114,7 @@ struct ConfigDev { | |||
| 116 | 114 | ||
| 117 | #include <linux/init.h> | 115 | #include <linux/init.h> |
| 118 | #include <linux/ioport.h> | 116 | #include <linux/ioport.h> |
| 117 | #include <linux/mod_devicetable.h> | ||
| 119 | 118 | ||
| 120 | #include <asm/zorro.h> | 119 | #include <asm/zorro.h> |
| 121 | 120 | ||
| @@ -142,29 +141,10 @@ struct zorro_dev { | |||
| 142 | * Zorro bus | 141 | * Zorro bus |
| 143 | */ | 142 | */ |
| 144 | 143 | ||
| 145 | struct zorro_bus { | ||
| 146 | struct list_head devices; /* list of devices on this bus */ | ||
| 147 | unsigned int num_resources; /* number of resources */ | ||
| 148 | struct resource resources[4]; /* address space routed to this bus */ | ||
| 149 | struct device dev; | ||
| 150 | char name[10]; | ||
| 151 | }; | ||
| 152 | |||
| 153 | extern struct zorro_bus zorro_bus; /* single Zorro bus */ | ||
| 154 | extern struct bus_type zorro_bus_type; | 144 | extern struct bus_type zorro_bus_type; |
| 155 | 145 | ||
| 156 | 146 | ||
| 157 | /* | 147 | /* |
| 158 | * Zorro device IDs | ||
| 159 | */ | ||
| 160 | |||
| 161 | struct zorro_device_id { | ||
| 162 | zorro_id id; /* Device ID or ZORRO_WILDCARD */ | ||
| 163 | unsigned long driver_data; /* Data private to the driver */ | ||
| 164 | }; | ||
| 165 | |||
| 166 | |||
| 167 | /* | ||
| 168 | * Zorro device drivers | 148 | * Zorro device drivers |
| 169 | */ | 149 | */ |
| 170 | 150 | ||
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h index f456534dcaf9..fd882261225e 100644 --- a/include/math-emu/op-common.h +++ b/include/math-emu/op-common.h | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | _FP_FRAC_DECL_##wc(X) | 29 | _FP_FRAC_DECL_##wc(X) |
| 30 | 30 | ||
| 31 | /* | 31 | /* |
| 32 | * Finish truely unpacking a native fp value by classifying the kind | 32 | * Finish truly unpacking a native fp value by classifying the kind |
| 33 | * of fp value and normalizing both the exponent and the fraction. | 33 | * of fp value and normalizing both the exponent and the fraction. |
| 34 | */ | 34 | */ |
| 35 | 35 | ||
diff --git a/include/media/ak881x.h b/include/media/ak881x.h new file mode 100644 index 000000000000..b7f2add5ce7b --- /dev/null +++ b/include/media/ak881x.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* | ||
| 2 | * Header for AK8813 / AK8814 TV-ecoders from Asahi Kasei Microsystems Co., Ltd. (AKM) | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010, Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
| 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 AK881X_H | ||
| 12 | #define AK881X_H | ||
| 13 | |||
| 14 | #define AK881X_IF_MODE_MASK (3 << 0) | ||
| 15 | #define AK881X_IF_MODE_BT656 (0 << 0) | ||
| 16 | #define AK881X_IF_MODE_MASTER (1 << 0) | ||
| 17 | #define AK881X_IF_MODE_SLAVE (2 << 0) | ||
| 18 | #define AK881X_FIELD (1 << 2) | ||
| 19 | #define AK881X_COMPONENT (1 << 3) | ||
| 20 | |||
| 21 | struct ak881x_pdata { | ||
| 22 | unsigned long flags; | ||
| 23 | }; | ||
| 24 | |||
| 25 | #endif | ||
diff --git a/include/media/davinci/vpfe_capture.h b/include/media/davinci/vpfe_capture.h index d863e5e8426d..cc973ed845a7 100644 --- a/include/media/davinci/vpfe_capture.h +++ b/include/media/davinci/vpfe_capture.h | |||
| @@ -94,6 +94,8 @@ struct vpfe_config { | |||
| 94 | /* vpfe clock */ | 94 | /* vpfe clock */ |
| 95 | struct clk *vpssclk; | 95 | struct clk *vpssclk; |
| 96 | struct clk *slaveclk; | 96 | struct clk *slaveclk; |
| 97 | /* Function for Clearing the interrupt */ | ||
| 98 | void (*clr_intr)(int vdint); | ||
| 97 | }; | 99 | }; |
| 98 | 100 | ||
| 99 | struct vpfe_device { | 101 | struct vpfe_device { |
| @@ -165,7 +167,7 @@ struct vpfe_device { | |||
| 165 | u8 started; | 167 | u8 started; |
| 166 | /* | 168 | /* |
| 167 | * offset where second field starts from the starting of the | 169 | * offset where second field starts from the starting of the |
| 168 | * buffer for field seperated YCbCr formats | 170 | * buffer for field separated YCbCr formats |
| 169 | */ | 171 | */ |
| 170 | u32 field_off; | 172 | u32 field_off; |
| 171 | }; | 173 | }; |
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index c66298062d39..528050e39ad9 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
| @@ -50,6 +50,10 @@ struct card_ir { | |||
| 50 | struct ir_input_state ir; | 50 | struct ir_input_state ir; |
| 51 | char name[32]; | 51 | char name[32]; |
| 52 | char phys[32]; | 52 | char phys[32]; |
| 53 | int users; | ||
| 54 | |||
| 55 | u32 running:1; | ||
| 56 | struct ir_dev_props props; | ||
| 53 | 57 | ||
| 54 | /* Usual gpio signalling */ | 58 | /* Usual gpio signalling */ |
| 55 | 59 | ||
| @@ -79,6 +83,9 @@ struct card_ir { | |||
| 79 | /* NEC decoding */ | 83 | /* NEC decoding */ |
| 80 | u32 nec_gpio; | 84 | u32 nec_gpio; |
| 81 | struct tasklet_struct tlet; | 85 | struct tasklet_struct tlet; |
| 86 | |||
| 87 | /* IR core raw decoding */ | ||
| 88 | u32 raw_decode; | ||
| 82 | }; | 89 | }; |
| 83 | 90 | ||
| 84 | /* Routines from ir-functions.c */ | 91 | /* Routines from ir-functions.c */ |
| @@ -97,71 +104,4 @@ u32 ir_rc5_decode(unsigned int code); | |||
| 97 | void ir_rc5_timer_end(unsigned long data); | 104 | void ir_rc5_timer_end(unsigned long data); |
| 98 | void ir_rc5_timer_keyup(unsigned long data); | 105 | void ir_rc5_timer_keyup(unsigned long data); |
| 99 | 106 | ||
| 100 | /* scancode->keycode map tables from ir-keymaps.c */ | ||
| 101 | |||
| 102 | extern struct ir_scancode_table ir_codes_empty_table; | ||
| 103 | extern struct ir_scancode_table ir_codes_avermedia_table; | ||
| 104 | extern struct ir_scancode_table ir_codes_avermedia_dvbt_table; | ||
| 105 | extern struct ir_scancode_table ir_codes_avermedia_m135a_table; | ||
| 106 | extern struct ir_scancode_table ir_codes_avermedia_cardbus_table; | ||
| 107 | extern struct ir_scancode_table ir_codes_apac_viewcomp_table; | ||
| 108 | extern struct ir_scancode_table ir_codes_pixelview_table; | ||
| 109 | extern struct ir_scancode_table ir_codes_pixelview_new_table; | ||
| 110 | extern struct ir_scancode_table ir_codes_nebula_table; | ||
| 111 | extern struct ir_scancode_table ir_codes_dntv_live_dvb_t_table; | ||
| 112 | extern struct ir_scancode_table ir_codes_iodata_bctv7e_table; | ||
| 113 | extern struct ir_scancode_table ir_codes_adstech_dvb_t_pci_table; | ||
| 114 | extern struct ir_scancode_table ir_codes_msi_tvanywhere_table; | ||
| 115 | extern struct ir_scancode_table ir_codes_cinergy_1400_table; | ||
| 116 | extern struct ir_scancode_table ir_codes_avertv_303_table; | ||
| 117 | extern struct ir_scancode_table ir_codes_dntv_live_dvbt_pro_table; | ||
| 118 | extern struct ir_scancode_table ir_codes_em_terratec_table; | ||
| 119 | extern struct ir_scancode_table ir_codes_pinnacle_grey_table; | ||
| 120 | extern struct ir_scancode_table ir_codes_flyvideo_table; | ||
| 121 | extern struct ir_scancode_table ir_codes_flydvb_table; | ||
| 122 | extern struct ir_scancode_table ir_codes_cinergy_table; | ||
| 123 | extern struct ir_scancode_table ir_codes_eztv_table; | ||
| 124 | extern struct ir_scancode_table ir_codes_avermedia_table; | ||
| 125 | extern struct ir_scancode_table ir_codes_videomate_tv_pvr_table; | ||
| 126 | extern struct ir_scancode_table ir_codes_manli_table; | ||
| 127 | extern struct ir_scancode_table ir_codes_gotview7135_table; | ||
| 128 | extern struct ir_scancode_table ir_codes_purpletv_table; | ||
| 129 | extern struct ir_scancode_table ir_codes_pctv_sedna_table; | ||
| 130 | extern struct ir_scancode_table ir_codes_pv951_table; | ||
| 131 | extern struct ir_scancode_table ir_codes_rc5_tv_table; | ||
| 132 | extern struct ir_scancode_table ir_codes_winfast_table; | ||
| 133 | extern struct ir_scancode_table ir_codes_pinnacle_color_table; | ||
| 134 | extern struct ir_scancode_table ir_codes_hauppauge_new_table; | ||
| 135 | extern struct ir_scancode_table ir_codes_rc5_hauppauge_new_table; | ||
| 136 | extern struct ir_scancode_table ir_codes_npgtech_table; | ||
| 137 | extern struct ir_scancode_table ir_codes_norwood_table; | ||
| 138 | extern struct ir_scancode_table ir_codes_proteus_2309_table; | ||
| 139 | extern struct ir_scancode_table ir_codes_budget_ci_old_table; | ||
| 140 | extern struct ir_scancode_table ir_codes_asus_pc39_table; | ||
| 141 | extern struct ir_scancode_table ir_codes_encore_enltv_table; | ||
| 142 | extern struct ir_scancode_table ir_codes_encore_enltv2_table; | ||
| 143 | extern struct ir_scancode_table ir_codes_tt_1500_table; | ||
| 144 | extern struct ir_scancode_table ir_codes_fusionhdtv_mce_table; | ||
| 145 | extern struct ir_scancode_table ir_codes_behold_table; | ||
| 146 | extern struct ir_scancode_table ir_codes_behold_columbus_table; | ||
| 147 | extern struct ir_scancode_table ir_codes_pinnacle_pctv_hd_table; | ||
| 148 | extern struct ir_scancode_table ir_codes_genius_tvgo_a11mce_table; | ||
| 149 | extern struct ir_scancode_table ir_codes_powercolor_real_angel_table; | ||
| 150 | extern struct ir_scancode_table ir_codes_avermedia_a16d_table; | ||
| 151 | extern struct ir_scancode_table ir_codes_encore_enltv_fm53_table; | ||
| 152 | extern struct ir_scancode_table ir_codes_real_audio_220_32_keys_table; | ||
| 153 | extern struct ir_scancode_table ir_codes_msi_tvanywhere_plus_table; | ||
| 154 | extern struct ir_scancode_table ir_codes_ati_tv_wonder_hd_600_table; | ||
| 155 | extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table; | ||
| 156 | extern struct ir_scancode_table ir_codes_kaiomy_table; | ||
| 157 | extern struct ir_scancode_table ir_codes_dm1105_nec_table; | ||
| 158 | extern struct ir_scancode_table ir_codes_tevii_nec_table; | ||
| 159 | extern struct ir_scancode_table ir_codes_tbs_nec_table; | ||
| 160 | extern struct ir_scancode_table ir_codes_evga_indtube_table; | ||
| 161 | extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; | ||
| 162 | extern struct ir_scancode_table ir_codes_videomate_s350_table; | ||
| 163 | extern struct ir_scancode_table ir_codes_gadmei_rm008z_table; | ||
| 164 | extern struct ir_scancode_table ir_codes_nec_terratec_cinergy_xs_table; | ||
| 165 | extern struct ir_scancode_table ir_codes_winfast_usbii_deluxe_table; | ||
| 166 | extern struct ir_scancode_table ir_codes_kworld_315u_table; | ||
| 167 | #endif | 107 | #endif |
diff --git a/include/media/ir-core.h b/include/media/ir-core.h index 61c223bc3953..ad1303f20e00 100644 --- a/include/media/ir-core.h +++ b/include/media/ir-core.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Remote Controller core header | 2 | * Remote Controller core header |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2009-2010 by Mauro Carvalho Chehab <mchehab@redhat.com> | ||
| 5 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation version 2 of the License. | 8 | * the Free Software Foundation version 2 of the License. |
| @@ -14,61 +16,133 @@ | |||
| 14 | #ifndef _IR_CORE | 16 | #ifndef _IR_CORE |
| 15 | #define _IR_CORE | 17 | #define _IR_CORE |
| 16 | 18 | ||
| 17 | #include <linux/input.h> | ||
| 18 | #include <linux/spinlock.h> | 19 | #include <linux/spinlock.h> |
| 20 | #include <linux/kfifo.h> | ||
| 21 | #include <linux/time.h> | ||
| 22 | #include <linux/timer.h> | ||
| 23 | #include <media/rc-map.h> | ||
| 19 | 24 | ||
| 20 | extern int ir_core_debug; | 25 | extern int ir_core_debug; |
| 21 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ | 26 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ |
| 22 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | 27 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) |
| 23 | 28 | ||
| 24 | #define IR_TYPE_UNKNOWN 0 | 29 | enum rc_driver_type { |
| 25 | #define IR_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */ | 30 | RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */ |
| 26 | #define IR_TYPE_PD (1 << 1) /* Pulse distance encoded IR */ | 31 | RC_DRIVER_IR_RAW, /* Needs a Infra-Red pulse/space decoder */ |
| 27 | #define IR_TYPE_NEC (1 << 2) | ||
| 28 | #define IR_TYPE_OTHER (((u64)1) << 63l) | ||
| 29 | |||
| 30 | struct ir_scancode { | ||
| 31 | u16 scancode; | ||
| 32 | u32 keycode; | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct ir_scancode_table { | ||
| 36 | struct ir_scancode *scan; | ||
| 37 | int size; | ||
| 38 | u64 ir_type; | ||
| 39 | spinlock_t lock; | ||
| 40 | }; | 32 | }; |
| 41 | 33 | ||
| 34 | /** | ||
| 35 | * struct ir_dev_props - Allow caller drivers to set special properties | ||
| 36 | * @driver_type: specifies if the driver or hardware have already a decoder, | ||
| 37 | * or if it needs to use the IR raw event decoders to produce a scancode | ||
| 38 | * @allowed_protos: bitmask with the supported IR_TYPE_* protocols | ||
| 39 | * @scanmask: some hardware decoders are not capable of providing the full | ||
| 40 | * scancode to the application. As this is a hardware limit, we can't do | ||
| 41 | * anything with it. Yet, as the same keycode table can be used with other | ||
| 42 | * devices, a mask is provided to allow its usage. Drivers should generally | ||
| 43 | * leave this field in blank | ||
| 44 | * @priv: driver-specific data, to be used on the callbacks | ||
| 45 | * @change_protocol: allow changing the protocol used on hardware decoders | ||
| 46 | * @open: callback to allow drivers to enable polling/irq when IR input device | ||
| 47 | * is opened. | ||
| 48 | * @close: callback to allow drivers to disable polling/irq when IR input device | ||
| 49 | * is opened. | ||
| 50 | */ | ||
| 42 | struct ir_dev_props { | 51 | struct ir_dev_props { |
| 43 | unsigned long allowed_protos; | 52 | enum rc_driver_type driver_type; |
| 44 | void *priv; | 53 | unsigned long allowed_protos; |
| 45 | int (*change_protocol)(void *priv, u64 ir_type); | 54 | u32 scanmask; |
| 55 | void *priv; | ||
| 56 | int (*change_protocol)(void *priv, u64 ir_type); | ||
| 57 | int (*open)(void *priv); | ||
| 58 | void (*close)(void *priv); | ||
| 46 | }; | 59 | }; |
| 47 | 60 | ||
| 48 | |||
| 49 | struct ir_input_dev { | 61 | struct ir_input_dev { |
| 50 | struct input_dev *dev; /* Input device*/ | 62 | struct device dev; /* device */ |
| 63 | char *driver_name; /* Name of the driver module */ | ||
| 51 | struct ir_scancode_table rc_tab; /* scan/key table */ | 64 | struct ir_scancode_table rc_tab; /* scan/key table */ |
| 52 | unsigned long devno; /* device number */ | 65 | unsigned long devno; /* device number */ |
| 53 | struct attribute_group attr; /* IR attributes */ | ||
| 54 | struct device *class_dev; /* virtual class dev */ | ||
| 55 | const struct ir_dev_props *props; /* Device properties */ | 66 | const struct ir_dev_props *props; /* Device properties */ |
| 67 | struct ir_raw_event_ctrl *raw; /* for raw pulse/space events */ | ||
| 68 | struct input_dev *input_dev; /* the input device associated with this device */ | ||
| 69 | |||
| 70 | /* key info - needed by IR keycode handlers */ | ||
| 71 | spinlock_t keylock; /* protects the below members */ | ||
| 72 | bool keypressed; /* current state */ | ||
| 73 | unsigned long keyup_jiffies; /* when should the current keypress be released? */ | ||
| 74 | struct timer_list timer_keyup; /* timer for releasing a keypress */ | ||
| 75 | u32 last_keycode; /* keycode of last command */ | ||
| 76 | u32 last_scancode; /* scancode of last command */ | ||
| 77 | u8 last_toggle; /* toggle of last command */ | ||
| 56 | }; | 78 | }; |
| 57 | #define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr) | ||
| 58 | 79 | ||
| 59 | /* Routines from ir-keytable.c */ | 80 | enum raw_event_type { |
| 81 | IR_SPACE = (1 << 0), | ||
| 82 | IR_PULSE = (1 << 1), | ||
| 83 | IR_START_EVENT = (1 << 2), | ||
| 84 | IR_STOP_EVENT = (1 << 3), | ||
| 85 | }; | ||
| 60 | 86 | ||
| 61 | u32 ir_g_keycode_from_table(struct input_dev *input_dev, | 87 | #define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr) |
| 62 | u32 scancode); | ||
| 63 | 88 | ||
| 64 | int ir_input_register(struct input_dev *dev, | 89 | /* From ir-keytable.c */ |
| 90 | int __ir_input_register(struct input_dev *dev, | ||
| 65 | const struct ir_scancode_table *ir_codes, | 91 | const struct ir_scancode_table *ir_codes, |
| 66 | const struct ir_dev_props *props); | 92 | const struct ir_dev_props *props, |
| 93 | const char *driver_name); | ||
| 94 | |||
| 95 | static inline int ir_input_register(struct input_dev *dev, | ||
| 96 | const char *map_name, | ||
| 97 | const struct ir_dev_props *props, | ||
| 98 | const char *driver_name) { | ||
| 99 | struct ir_scancode_table *ir_codes; | ||
| 100 | struct ir_input_dev *ir_dev; | ||
| 101 | int rc; | ||
| 102 | |||
| 103 | if (!map_name) | ||
| 104 | return -EINVAL; | ||
| 105 | |||
| 106 | ir_codes = get_rc_map(map_name); | ||
| 107 | if (!ir_codes) | ||
| 108 | return -EINVAL; | ||
| 109 | |||
| 110 | rc = __ir_input_register(dev, ir_codes, props, driver_name); | ||
| 111 | if (rc < 0) | ||
| 112 | return -EINVAL; | ||
| 113 | |||
| 114 | ir_dev = input_get_drvdata(dev); | ||
| 115 | |||
| 116 | if (!rc && ir_dev->props && ir_dev->props->change_protocol) | ||
| 117 | rc = ir_dev->props->change_protocol(ir_dev->props->priv, | ||
| 118 | ir_codes->ir_type); | ||
| 119 | |||
| 120 | return rc; | ||
| 121 | } | ||
| 122 | |||
| 67 | void ir_input_unregister(struct input_dev *input_dev); | 123 | void ir_input_unregister(struct input_dev *input_dev); |
| 68 | 124 | ||
| 69 | /* Routines from ir-sysfs.c */ | 125 | void ir_repeat(struct input_dev *dev); |
| 126 | void ir_keydown(struct input_dev *dev, int scancode, u8 toggle); | ||
| 127 | u32 ir_g_keycode_from_table(struct input_dev *input_dev, u32 scancode); | ||
| 128 | |||
| 129 | /* From ir-raw-event.c */ | ||
| 130 | |||
| 131 | struct ir_raw_event { | ||
| 132 | unsigned pulse:1; | ||
| 133 | unsigned duration:31; | ||
| 134 | }; | ||
| 135 | |||
| 136 | #define IR_MAX_DURATION 0x7FFFFFFF /* a bit more than 2 seconds */ | ||
| 70 | 137 | ||
| 71 | int ir_register_class(struct input_dev *input_dev); | 138 | void ir_raw_event_handle(struct input_dev *input_dev); |
| 72 | void ir_unregister_class(struct input_dev *input_dev); | 139 | int ir_raw_event_store(struct input_dev *input_dev, struct ir_raw_event *ev); |
| 140 | int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type); | ||
| 141 | static inline void ir_raw_event_reset(struct input_dev *input_dev) | ||
| 142 | { | ||
| 143 | struct ir_raw_event ev = { .pulse = false, .duration = 0 }; | ||
| 144 | ir_raw_event_store(input_dev, &ev); | ||
| 145 | ir_raw_event_handle(input_dev); | ||
| 146 | } | ||
| 73 | 147 | ||
| 74 | #endif | 148 | #endif /* _IR_CORE */ |
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h index 9142936603cc..0506e45c9a4f 100644 --- a/include/media/ir-kbd-i2c.h +++ b/include/media/ir-kbd-i2c.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | struct IR_i2c; | 6 | struct IR_i2c; |
| 7 | 7 | ||
| 8 | struct IR_i2c { | 8 | struct IR_i2c { |
| 9 | struct ir_scancode_table *ir_codes; | 9 | char *ir_codes; |
| 10 | 10 | ||
| 11 | struct i2c_client *c; | 11 | struct i2c_client *c; |
| 12 | struct input_dev *input; | 12 | struct input_dev *input; |
| @@ -34,9 +34,9 @@ enum ir_kbd_get_key_fn { | |||
| 34 | 34 | ||
| 35 | /* Can be passed when instantiating an ir_video i2c device */ | 35 | /* Can be passed when instantiating an ir_video i2c device */ |
| 36 | struct IR_i2c_init_data { | 36 | struct IR_i2c_init_data { |
| 37 | struct ir_scancode_table *ir_codes; | 37 | char *ir_codes; |
| 38 | const char *name; | 38 | const char *name; |
| 39 | u64 type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */ | 39 | u64 type; /* IR_TYPE_RC5, etc */ |
| 40 | /* | 40 | /* |
| 41 | * Specify either a function pointer or a value indicating one of | 41 | * Specify either a function pointer or a value indicating one of |
| 42 | * ir_kbd_i2c's internal get_key functions | 42 | * ir_kbd_i2c's internal get_key functions |
diff --git a/include/media/rc-map.h b/include/media/rc-map.h new file mode 100644 index 000000000000..5833966a7100 --- /dev/null +++ b/include/media/rc-map.h | |||
| @@ -0,0 +1,121 @@ | |||
| 1 | /* | ||
| 2 | * rc-map.h - define RC map names used by RC drivers | ||
| 3 | * | ||
| 4 | * Copyright (c) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #include <linux/input.h> | ||
| 13 | |||
| 14 | #define IR_TYPE_UNKNOWN 0 | ||
| 15 | #define IR_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */ | ||
| 16 | #define IR_TYPE_NEC (1 << 1) | ||
| 17 | #define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ | ||
| 18 | #define IR_TYPE_JVC (1 << 3) /* JVC protocol */ | ||
| 19 | #define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ | ||
| 20 | #define IR_TYPE_OTHER (1u << 31) | ||
| 21 | |||
| 22 | struct ir_scancode { | ||
| 23 | u32 scancode; | ||
| 24 | u32 keycode; | ||
| 25 | }; | ||
| 26 | |||
| 27 | struct ir_scancode_table { | ||
| 28 | struct ir_scancode *scan; | ||
| 29 | unsigned int size; /* Max number of entries */ | ||
| 30 | unsigned int len; /* Used number of entries */ | ||
| 31 | unsigned int alloc; /* Size of *scan in bytes */ | ||
| 32 | u64 ir_type; | ||
| 33 | char *name; | ||
| 34 | spinlock_t lock; | ||
| 35 | }; | ||
| 36 | |||
| 37 | struct rc_keymap { | ||
| 38 | struct list_head list; | ||
| 39 | struct ir_scancode_table map; | ||
| 40 | }; | ||
| 41 | |||
| 42 | /* Routines from rc-map.c */ | ||
| 43 | |||
| 44 | int ir_register_map(struct rc_keymap *map); | ||
| 45 | void ir_unregister_map(struct rc_keymap *map); | ||
| 46 | struct ir_scancode_table *get_rc_map(const char *name); | ||
| 47 | void rc_map_init(void); | ||
| 48 | |||
| 49 | /* Names of the several keytables defined in-kernel */ | ||
| 50 | |||
| 51 | #define RC_MAP_ADSTECH_DVB_T_PCI "rc-adstech-dvb-t-pci" | ||
| 52 | #define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp" | ||
| 53 | #define RC_MAP_ASUS_PC39 "rc-asus-pc39" | ||
| 54 | #define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600" | ||
| 55 | #define RC_MAP_AVERMEDIA_A16D "rc-avermedia-a16d" | ||
| 56 | #define RC_MAP_AVERMEDIA_CARDBUS "rc-avermedia-cardbus" | ||
| 57 | #define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt" | ||
| 58 | #define RC_MAP_AVERMEDIA_M135A_RM_JX "rc-avermedia-m135a-rm-jx" | ||
| 59 | #define RC_MAP_AVERMEDIA "rc-avermedia" | ||
| 60 | #define RC_MAP_AVERTV_303 "rc-avertv-303" | ||
| 61 | #define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus" | ||
| 62 | #define RC_MAP_BEHOLD "rc-behold" | ||
| 63 | #define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old" | ||
| 64 | #define RC_MAP_CINERGY_1400 "rc-cinergy-1400" | ||
| 65 | #define RC_MAP_CINERGY "rc-cinergy" | ||
| 66 | #define RC_MAP_DM1105_NEC "rc-dm1105-nec" | ||
| 67 | #define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro" | ||
| 68 | #define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t" | ||
| 69 | #define RC_MAP_EMPTY "rc-empty" | ||
| 70 | #define RC_MAP_EM_TERRATEC "rc-em-terratec" | ||
| 71 | #define RC_MAP_ENCORE_ENLTV2 "rc-encore-enltv2" | ||
| 72 | #define RC_MAP_ENCORE_ENLTV_FM53 "rc-encore-enltv-fm53" | ||
| 73 | #define RC_MAP_ENCORE_ENLTV "rc-encore-enltv" | ||
| 74 | #define RC_MAP_EVGA_INDTUBE "rc-evga-indtube" | ||
| 75 | #define RC_MAP_EZTV "rc-eztv" | ||
| 76 | #define RC_MAP_FLYDVB "rc-flydvb" | ||
| 77 | #define RC_MAP_FLYVIDEO "rc-flyvideo" | ||
| 78 | #define RC_MAP_FUSIONHDTV_MCE "rc-fusionhdtv-mce" | ||
| 79 | #define RC_MAP_GADMEI_RM008Z "rc-gadmei-rm008z" | ||
| 80 | #define RC_MAP_GENIUS_TVGO_A11MCE "rc-genius-tvgo-a11mce" | ||
| 81 | #define RC_MAP_GOTVIEW7135 "rc-gotview7135" | ||
| 82 | #define RC_MAP_HAUPPAUGE_NEW "rc-hauppauge-new" | ||
| 83 | #define RC_MAP_IMON_MCE "rc-imon-mce" | ||
| 84 | #define RC_MAP_IMON_PAD "rc-imon-pad" | ||
| 85 | #define RC_MAP_IODATA_BCTV7E "rc-iodata-bctv7e" | ||
| 86 | #define RC_MAP_KAIOMY "rc-kaiomy" | ||
| 87 | #define RC_MAP_KWORLD_315U "rc-kworld-315u" | ||
| 88 | #define RC_MAP_KWORLD_PLUS_TV_ANALOG "rc-kworld-plus-tv-analog" | ||
| 89 | #define RC_MAP_MANLI "rc-manli" | ||
| 90 | #define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" | ||
| 91 | #define RC_MAP_MSI_TVANYWHERE "rc-msi-tvanywhere" | ||
| 92 | #define RC_MAP_NEBULA "rc-nebula" | ||
| 93 | #define RC_MAP_NEC_TERRATEC_CINERGY_XS "rc-nec-terratec-cinergy-xs" | ||
| 94 | #define RC_MAP_NORWOOD "rc-norwood" | ||
| 95 | #define RC_MAP_NPGTECH "rc-npgtech" | ||
| 96 | #define RC_MAP_PCTV_SEDNA "rc-pctv-sedna" | ||
| 97 | #define RC_MAP_PINNACLE_COLOR "rc-pinnacle-color" | ||
| 98 | #define RC_MAP_PINNACLE_GREY "rc-pinnacle-grey" | ||
| 99 | #define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd" | ||
| 100 | #define RC_MAP_PIXELVIEW_NEW "rc-pixelview-new" | ||
| 101 | #define RC_MAP_PIXELVIEW "rc-pixelview" | ||
| 102 | #define RC_MAP_PIXELVIEW_MK12 "rc-pixelview-mk12" | ||
| 103 | #define RC_MAP_POWERCOLOR_REAL_ANGEL "rc-powercolor-real-angel" | ||
| 104 | #define RC_MAP_PROTEUS_2309 "rc-proteus-2309" | ||
| 105 | #define RC_MAP_PURPLETV "rc-purpletv" | ||
| 106 | #define RC_MAP_PV951 "rc-pv951" | ||
| 107 | #define RC_MAP_RC5_HAUPPAUGE_NEW "rc-rc5-hauppauge-new" | ||
| 108 | #define RC_MAP_RC5_TV "rc-rc5-tv" | ||
| 109 | #define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys" | ||
| 110 | #define RC_MAP_TBS_NEC "rc-tbs-nec" | ||
| 111 | #define RC_MAP_TERRATEC_CINERGY_XS "rc-terratec-cinergy-xs" | ||
| 112 | #define RC_MAP_TEVII_NEC "rc-tevii-nec" | ||
| 113 | #define RC_MAP_TT_1500 "rc-tt-1500" | ||
| 114 | #define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" | ||
| 115 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" | ||
| 116 | #define RC_MAP_WINFAST "rc-winfast" | ||
| 117 | #define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe" | ||
| 118 | /* | ||
| 119 | * Please, do not just append newer Remote Controller names at the end. | ||
| 120 | * The names should be ordered in alphabetical order | ||
| 121 | */ | ||
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h index b9da1f5591e7..4aeff96ff7d8 100644 --- a/include/media/saa7146_vv.h +++ b/include/media/saa7146_vv.h | |||
| @@ -188,7 +188,6 @@ void saa7146_buffer_timeout(unsigned long data); | |||
| 188 | void saa7146_dma_free(struct saa7146_dev* dev,struct videobuf_queue *q, | 188 | void saa7146_dma_free(struct saa7146_dev* dev,struct videobuf_queue *q, |
| 189 | struct saa7146_buf *buf); | 189 | struct saa7146_buf *buf); |
| 190 | 190 | ||
| 191 | int saa7146_vv_devinit(struct saa7146_dev *dev); | ||
| 192 | int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv); | 191 | int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv); |
| 193 | int saa7146_vv_release(struct saa7146_dev* dev); | 192 | int saa7146_vv_release(struct saa7146_dev* dev); |
| 194 | 193 | ||
diff --git a/include/media/sh_vou.h b/include/media/sh_vou.h new file mode 100644 index 000000000000..a3ef30242b00 --- /dev/null +++ b/include/media/sh_vou.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* | ||
| 2 | * SuperH Video Output Unit (VOU) driver header | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010, Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | #ifndef SH_VOU_H | ||
| 11 | #define SH_VOU_H | ||
| 12 | |||
| 13 | #include <linux/i2c.h> | ||
| 14 | |||
| 15 | /* Bus flags */ | ||
| 16 | #define SH_VOU_PCLK_FALLING (1 << 0) | ||
| 17 | #define SH_VOU_HSYNC_LOW (1 << 1) | ||
| 18 | #define SH_VOU_VSYNC_LOW (1 << 2) | ||
| 19 | |||
| 20 | enum sh_vou_bus_fmt { | ||
| 21 | SH_VOU_BUS_8BIT, | ||
| 22 | SH_VOU_BUS_16BIT, | ||
| 23 | SH_VOU_BUS_BT656, | ||
| 24 | }; | ||
| 25 | |||
| 26 | struct sh_vou_pdata { | ||
| 27 | enum sh_vou_bus_fmt bus_fmt; | ||
| 28 | int i2c_adap; | ||
| 29 | struct i2c_board_info *board_info; | ||
| 30 | unsigned long flags; | ||
| 31 | char *module_name; | ||
| 32 | }; | ||
| 33 | |||
| 34 | #endif | ||
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 9d69f01b6fa2..c9a5bbfa6ab5 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
| @@ -266,8 +266,8 @@ static inline unsigned long soc_camera_bus_param_compatible( | |||
| 266 | common_flags; | 266 | common_flags; |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | static inline void soc_camera_limit_side(unsigned int *start, | 269 | static inline void soc_camera_limit_side(int *start, int *length, |
| 270 | unsigned int *length, unsigned int start_min, | 270 | unsigned int start_min, |
| 271 | unsigned int length_min, unsigned int length_max) | 271 | unsigned int length_min, unsigned int length_max) |
| 272 | { | 272 | { |
| 273 | if (*length < length_min) | 273 | if (*length < length_min) |
| @@ -284,4 +284,12 @@ static inline void soc_camera_limit_side(unsigned int *start, | |||
| 284 | extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, | 284 | extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, |
| 285 | unsigned long flags); | 285 | unsigned long flags); |
| 286 | 286 | ||
| 287 | /* This is only temporary here - until v4l2-subdev begins to link to video_device */ | ||
| 288 | #include <linux/i2c.h> | ||
| 289 | static inline struct video_device *soc_camera_i2c_to_vdev(struct i2c_client *client) | ||
| 290 | { | ||
| 291 | struct soc_camera_device *icd = client->dev.platform_data; | ||
| 292 | return icd->vdev; | ||
| 293 | } | ||
| 294 | |||
| 287 | #endif | 295 | #endif |
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 56abf21dd786..21b4428c12ab 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
| @@ -25,6 +25,10 @@ | |||
| 25 | #define V4L2_CHIP_IDENT_H_ | 25 | #define V4L2_CHIP_IDENT_H_ |
| 26 | 26 | ||
| 27 | /* VIDIOC_DBG_G_CHIP_IDENT: identifies the actual chip installed on the board */ | 27 | /* VIDIOC_DBG_G_CHIP_IDENT: identifies the actual chip installed on the board */ |
| 28 | |||
| 29 | /* KEEP THIS LIST ORDERED BY ID! | ||
| 30 | Otherwise it will be hard to see which ranges are already in use when | ||
| 31 | adding support to a new chip family. */ | ||
| 28 | enum { | 32 | enum { |
| 29 | /* general idents: reserved range 0-49 */ | 33 | /* general idents: reserved range 0-49 */ |
| 30 | V4L2_IDENT_NONE = 0, /* No chip matched */ | 34 | V4L2_IDENT_NONE = 0, /* No chip matched */ |
| @@ -77,17 +81,14 @@ enum { | |||
| 77 | V4L2_IDENT_CX23417 = 417, | 81 | V4L2_IDENT_CX23417 = 417, |
| 78 | V4L2_IDENT_CX23418 = 418, | 82 | V4L2_IDENT_CX23418 = 418, |
| 79 | 83 | ||
| 80 | /* module au0828 */ | ||
| 81 | V4L2_IDENT_AU0828 = 828, | ||
| 82 | |||
| 83 | /* module indycam: just ident 2000 */ | ||
| 84 | V4L2_IDENT_INDYCAM = 2000, | ||
| 85 | |||
| 86 | /* module bt819: reserved range 810-819 */ | 84 | /* module bt819: reserved range 810-819 */ |
| 87 | V4L2_IDENT_BT815A = 815, | 85 | V4L2_IDENT_BT815A = 815, |
| 88 | V4L2_IDENT_BT817A = 817, | 86 | V4L2_IDENT_BT817A = 817, |
| 89 | V4L2_IDENT_BT819A = 819, | 87 | V4L2_IDENT_BT819A = 819, |
| 90 | 88 | ||
| 89 | /* module au0828 */ | ||
| 90 | V4L2_IDENT_AU0828 = 828, | ||
| 91 | |||
| 91 | /* module bt856: just ident 856 */ | 92 | /* module bt856: just ident 856 */ |
| 92 | V4L2_IDENT_BT856 = 856, | 93 | V4L2_IDENT_BT856 = 856, |
| 93 | 94 | ||
| @@ -99,6 +100,9 @@ enum { | |||
| 99 | V4L2_IDENT_KS0127 = 1127, | 100 | V4L2_IDENT_KS0127 = 1127, |
| 100 | V4L2_IDENT_KS0127B = 1128, | 101 | V4L2_IDENT_KS0127B = 1128, |
| 101 | 102 | ||
| 103 | /* module indycam: just ident 2000 */ | ||
| 104 | V4L2_IDENT_INDYCAM = 2000, | ||
| 105 | |||
| 102 | /* module vp27smpx: just ident 2700 */ | 106 | /* module vp27smpx: just ident 2700 */ |
| 103 | V4L2_IDENT_VP27SMPX = 2700, | 107 | V4L2_IDENT_VP27SMPX = 2700, |
| 104 | 108 | ||
| @@ -162,20 +166,21 @@ enum { | |||
| 162 | /* module saa7706h: just ident 7706 */ | 166 | /* module saa7706h: just ident 7706 */ |
| 163 | V4L2_IDENT_SAA7706H = 7706, | 167 | V4L2_IDENT_SAA7706H = 7706, |
| 164 | 168 | ||
| 169 | /* module mt9v011, just ident 8243 */ | ||
| 170 | V4L2_IDENT_MT9V011 = 8243, | ||
| 171 | |||
| 165 | /* module wm8739: just ident 8739 */ | 172 | /* module wm8739: just ident 8739 */ |
| 166 | V4L2_IDENT_WM8739 = 8739, | 173 | V4L2_IDENT_WM8739 = 8739, |
| 167 | 174 | ||
| 168 | /* module wm8775: just ident 8775 */ | 175 | /* module wm8775: just ident 8775 */ |
| 169 | V4L2_IDENT_WM8775 = 8775, | 176 | V4L2_IDENT_WM8775 = 8775, |
| 170 | 177 | ||
| 171 | /* module tda9840: just ident 9840 */ | ||
| 172 | V4L2_IDENT_TDA9840 = 9840, | ||
| 173 | |||
| 174 | /* module cafe_ccic, just ident 8801 */ | 178 | /* module cafe_ccic, just ident 8801 */ |
| 175 | V4L2_IDENT_CAFE = 8801, | 179 | V4L2_IDENT_CAFE = 8801, |
| 176 | 180 | ||
| 177 | /* module mt9v011, just ident 8243 */ | 181 | /* AKM AK8813/AK8814 */ |
| 178 | V4L2_IDENT_MT9V011 = 8243, | 182 | V4L2_IDENT_AK8813 = 8813, |
| 183 | V4L2_IDENT_AK8814 = 8814, | ||
| 179 | 184 | ||
| 180 | /* module cx23885 and cx25840 */ | 185 | /* module cx23885 and cx25840 */ |
| 181 | V4L2_IDENT_CX23885 = 8850, | 186 | V4L2_IDENT_CX23885 = 8850, |
| @@ -186,6 +191,9 @@ enum { | |||
| 186 | V4L2_IDENT_CX23888_AV = 8881, /* Integrated A/V decoder */ | 191 | V4L2_IDENT_CX23888_AV = 8881, /* Integrated A/V decoder */ |
| 187 | V4L2_IDENT_CX23888_IR = 8882, /* Integrated infrared controller */ | 192 | V4L2_IDENT_CX23888_IR = 8882, /* Integrated infrared controller */ |
| 188 | 193 | ||
| 194 | /* module tda9840: just ident 9840 */ | ||
| 195 | V4L2_IDENT_TDA9840 = 9840, | ||
| 196 | |||
| 189 | /* module tw9910: just ident 9910 */ | 197 | /* module tw9910: just ident 9910 */ |
| 190 | V4L2_IDENT_TW9910 = 9910, | 198 | V4L2_IDENT_TW9910 = 9910, |
| 191 | 199 | ||
| @@ -198,72 +206,70 @@ enum { | |||
| 198 | V4L2_IDENT_CX23101 = 23101, | 206 | V4L2_IDENT_CX23101 = 23101, |
| 199 | V4L2_IDENT_CX23102 = 23102, | 207 | V4L2_IDENT_CX23102 = 23102, |
| 200 | 208 | ||
| 201 | /* module msp3400: reserved range 34000-34999 and 44000-44999 */ | 209 | /* module msp3400: reserved range 34000-34999 for msp34xx */ |
| 202 | V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only | 210 | V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only |
| 203 | use internally (tveeprom.c). */ | 211 | use internally (tveeprom.c). */ |
| 204 | 212 | ||
| 205 | V4L2_IDENT_MSP3400B = 34002, | 213 | V4L2_IDENT_MSP3400B = 34002, |
| 206 | V4L2_IDENT_MSP3410B = 34102, | ||
| 207 | |||
| 208 | V4L2_IDENT_MSP3400C = 34003, | 214 | V4L2_IDENT_MSP3400C = 34003, |
| 209 | V4L2_IDENT_MSP3410C = 34103, | ||
| 210 | |||
| 211 | V4L2_IDENT_MSP3400D = 34004, | 215 | V4L2_IDENT_MSP3400D = 34004, |
| 212 | V4L2_IDENT_MSP3410D = 34104, | 216 | V4L2_IDENT_MSP3400G = 34007, |
| 217 | V4L2_IDENT_MSP3401G = 34017, | ||
| 218 | V4L2_IDENT_MSP3402G = 34027, | ||
| 213 | V4L2_IDENT_MSP3405D = 34054, | 219 | V4L2_IDENT_MSP3405D = 34054, |
| 214 | V4L2_IDENT_MSP3415D = 34154, | 220 | V4L2_IDENT_MSP3405G = 34057, |
| 215 | V4L2_IDENT_MSP3407D = 34074, | 221 | V4L2_IDENT_MSP3407D = 34074, |
| 216 | V4L2_IDENT_MSP3417D = 34174, | 222 | V4L2_IDENT_MSP3407G = 34077, |
| 217 | 223 | ||
| 218 | V4L2_IDENT_MSP3400G = 34007, | 224 | V4L2_IDENT_MSP3410B = 34102, |
| 225 | V4L2_IDENT_MSP3410C = 34103, | ||
| 226 | V4L2_IDENT_MSP3410D = 34104, | ||
| 219 | V4L2_IDENT_MSP3410G = 34107, | 227 | V4L2_IDENT_MSP3410G = 34107, |
| 220 | V4L2_IDENT_MSP3420G = 34207, | ||
| 221 | V4L2_IDENT_MSP3430G = 34307, | ||
| 222 | V4L2_IDENT_MSP3440G = 34407, | ||
| 223 | V4L2_IDENT_MSP3450G = 34507, | ||
| 224 | V4L2_IDENT_MSP3460G = 34607, | ||
| 225 | |||
| 226 | V4L2_IDENT_MSP3401G = 34017, | ||
| 227 | V4L2_IDENT_MSP3411G = 34117, | 228 | V4L2_IDENT_MSP3411G = 34117, |
| 228 | V4L2_IDENT_MSP3421G = 34217, | ||
| 229 | V4L2_IDENT_MSP3431G = 34317, | ||
| 230 | V4L2_IDENT_MSP3441G = 34417, | ||
| 231 | V4L2_IDENT_MSP3451G = 34517, | ||
| 232 | V4L2_IDENT_MSP3461G = 34617, | ||
| 233 | |||
| 234 | V4L2_IDENT_MSP3402G = 34027, | ||
| 235 | V4L2_IDENT_MSP3412G = 34127, | 229 | V4L2_IDENT_MSP3412G = 34127, |
| 236 | V4L2_IDENT_MSP3422G = 34227, | 230 | V4L2_IDENT_MSP3415D = 34154, |
| 237 | V4L2_IDENT_MSP3442G = 34427, | ||
| 238 | V4L2_IDENT_MSP3452G = 34527, | ||
| 239 | |||
| 240 | V4L2_IDENT_MSP3405G = 34057, | ||
| 241 | V4L2_IDENT_MSP3415G = 34157, | 231 | V4L2_IDENT_MSP3415G = 34157, |
| 242 | V4L2_IDENT_MSP3425G = 34257, | 232 | V4L2_IDENT_MSP3417D = 34174, |
| 243 | V4L2_IDENT_MSP3435G = 34357, | ||
| 244 | V4L2_IDENT_MSP3445G = 34457, | ||
| 245 | V4L2_IDENT_MSP3455G = 34557, | ||
| 246 | V4L2_IDENT_MSP3465G = 34657, | ||
| 247 | |||
| 248 | V4L2_IDENT_MSP3407G = 34077, | ||
| 249 | V4L2_IDENT_MSP3417G = 34177, | 233 | V4L2_IDENT_MSP3417G = 34177, |
| 234 | |||
| 235 | V4L2_IDENT_MSP3420G = 34207, | ||
| 236 | V4L2_IDENT_MSP3421G = 34217, | ||
| 237 | V4L2_IDENT_MSP3422G = 34227, | ||
| 238 | V4L2_IDENT_MSP3425G = 34257, | ||
| 250 | V4L2_IDENT_MSP3427G = 34277, | 239 | V4L2_IDENT_MSP3427G = 34277, |
| 240 | |||
| 241 | V4L2_IDENT_MSP3430G = 34307, | ||
| 242 | V4L2_IDENT_MSP3431G = 34317, | ||
| 243 | V4L2_IDENT_MSP3435G = 34357, | ||
| 251 | V4L2_IDENT_MSP3437G = 34377, | 244 | V4L2_IDENT_MSP3437G = 34377, |
| 245 | |||
| 246 | V4L2_IDENT_MSP3440G = 34407, | ||
| 247 | V4L2_IDENT_MSP3441G = 34417, | ||
| 248 | V4L2_IDENT_MSP3442G = 34427, | ||
| 249 | V4L2_IDENT_MSP3445G = 34457, | ||
| 252 | V4L2_IDENT_MSP3447G = 34477, | 250 | V4L2_IDENT_MSP3447G = 34477, |
| 251 | |||
| 252 | V4L2_IDENT_MSP3450G = 34507, | ||
| 253 | V4L2_IDENT_MSP3451G = 34517, | ||
| 254 | V4L2_IDENT_MSP3452G = 34527, | ||
| 255 | V4L2_IDENT_MSP3455G = 34557, | ||
| 253 | V4L2_IDENT_MSP3457G = 34577, | 256 | V4L2_IDENT_MSP3457G = 34577, |
| 257 | |||
| 258 | V4L2_IDENT_MSP3460G = 34607, | ||
| 259 | V4L2_IDENT_MSP3461G = 34617, | ||
| 260 | V4L2_IDENT_MSP3465G = 34657, | ||
| 254 | V4L2_IDENT_MSP3467G = 34677, | 261 | V4L2_IDENT_MSP3467G = 34677, |
| 255 | 262 | ||
| 256 | /* module msp3400: reserved range 34000-34999 and 44000-44999 */ | 263 | /* module msp3400: reserved range 44000-44999 for msp44xx */ |
| 257 | V4L2_IDENT_MSP4400G = 44007, | 264 | V4L2_IDENT_MSP4400G = 44007, |
| 258 | V4L2_IDENT_MSP4410G = 44107, | ||
| 259 | V4L2_IDENT_MSP4420G = 44207, | ||
| 260 | V4L2_IDENT_MSP4440G = 44407, | ||
| 261 | V4L2_IDENT_MSP4450G = 44507, | ||
| 262 | |||
| 263 | V4L2_IDENT_MSP4408G = 44087, | 265 | V4L2_IDENT_MSP4408G = 44087, |
| 266 | V4L2_IDENT_MSP4410G = 44107, | ||
| 264 | V4L2_IDENT_MSP4418G = 44187, | 267 | V4L2_IDENT_MSP4418G = 44187, |
| 268 | V4L2_IDENT_MSP4420G = 44207, | ||
| 265 | V4L2_IDENT_MSP4428G = 44287, | 269 | V4L2_IDENT_MSP4428G = 44287, |
| 270 | V4L2_IDENT_MSP4440G = 44407, | ||
| 266 | V4L2_IDENT_MSP4448G = 44487, | 271 | V4L2_IDENT_MSP4448G = 44487, |
| 272 | V4L2_IDENT_MSP4450G = 44507, | ||
| 267 | V4L2_IDENT_MSP4458G = 44587, | 273 | V4L2_IDENT_MSP4458G = 44587, |
| 268 | 274 | ||
| 269 | /* Micron CMOS sensor chips: 45000-45099 */ | 275 | /* Micron CMOS sensor chips: 45000-45099 */ |
| @@ -282,20 +288,27 @@ enum { | |||
| 282 | /* HV7131R CMOS sensor: just ident 46000 */ | 288 | /* HV7131R CMOS sensor: just ident 46000 */ |
| 283 | V4L2_IDENT_HV7131R = 46000, | 289 | V4L2_IDENT_HV7131R = 46000, |
| 284 | 290 | ||
| 291 | /* Sharp RJ54N1CB0C, 0xCB0C = 51980 */ | ||
| 292 | V4L2_IDENT_RJ54N1CB0C = 51980, | ||
| 293 | |||
| 294 | /* module m52790: just ident 52790 */ | ||
| 295 | V4L2_IDENT_M52790 = 52790, | ||
| 296 | |||
| 285 | /* module cs53132a: just ident 53132 */ | 297 | /* module cs53132a: just ident 53132 */ |
| 286 | V4L2_IDENT_CS53l32A = 53132, | 298 | V4L2_IDENT_CS53l32A = 53132, |
| 287 | 299 | ||
| 300 | /* modules upd61151 MPEG2 encoder: just ident 54000 */ | ||
| 301 | V4L2_IDENT_UPD61161 = 54000, | ||
| 302 | /* modules upd61152 MPEG2 encoder with AC3: just ident 54001 */ | ||
| 303 | V4L2_IDENT_UPD61162 = 54001, | ||
| 304 | |||
| 288 | /* module upd64031a: just ident 64031 */ | 305 | /* module upd64031a: just ident 64031 */ |
| 289 | V4L2_IDENT_UPD64031A = 64031, | 306 | V4L2_IDENT_UPD64031A = 64031, |
| 290 | 307 | ||
| 291 | /* module upd64083: just ident 64083 */ | 308 | /* module upd64083: just ident 64083 */ |
| 292 | V4L2_IDENT_UPD64083 = 64083, | 309 | V4L2_IDENT_UPD64083 = 64083, |
| 293 | 310 | ||
| 294 | /* module m52790: just ident 52790 */ | 311 | /* Don't just add new IDs at the end: KEEP THIS LIST ORDERED BY ID! */ |
| 295 | V4L2_IDENT_M52790 = 52790, | ||
| 296 | |||
| 297 | /* Sharp RJ54N1CB0C, 0xCB0C = 51980 */ | ||
| 298 | V4L2_IDENT_RJ54N1CB0C = 51980, | ||
| 299 | }; | 312 | }; |
| 300 | 313 | ||
| 301 | #endif | 314 | #endif |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 1c7b259f341c..98b32645e5a7 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
| @@ -85,13 +85,13 @@ | |||
| 85 | struct v4l2_prio_state { | 85 | struct v4l2_prio_state { |
| 86 | atomic_t prios[4]; | 86 | atomic_t prios[4]; |
| 87 | }; | 87 | }; |
| 88 | int v4l2_prio_init(struct v4l2_prio_state *global); | 88 | void v4l2_prio_init(struct v4l2_prio_state *global); |
| 89 | int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local, | 89 | int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local, |
| 90 | enum v4l2_priority new); | 90 | enum v4l2_priority new); |
| 91 | int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local); | 91 | void v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local); |
| 92 | int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local); | 92 | void v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority local); |
| 93 | enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global); | 93 | enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global); |
| 94 | int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local); | 94 | int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local); |
| 95 | 95 | ||
| 96 | /* ------------------------------------------------------------------------- */ | 96 | /* ------------------------------------------------------------------------- */ |
| 97 | 97 | ||
| @@ -184,6 +184,25 @@ const unsigned short *v4l2_i2c_tuner_addrs(enum v4l2_i2c_tuner_type type); | |||
| 184 | 184 | ||
| 185 | /* ------------------------------------------------------------------------- */ | 185 | /* ------------------------------------------------------------------------- */ |
| 186 | 186 | ||
| 187 | /* SPI Helper functions */ | ||
| 188 | #if defined(CONFIG_SPI) | ||
| 189 | |||
| 190 | #include <linux/spi/spi.h> | ||
| 191 | |||
| 192 | struct spi_device; | ||
| 193 | |||
| 194 | /* Load an spi module and return an initialized v4l2_subdev struct. | ||
| 195 | The client_type argument is the name of the chip that's on the adapter. */ | ||
| 196 | struct v4l2_subdev *v4l2_spi_new_subdev(struct v4l2_device *v4l2_dev, | ||
| 197 | struct spi_master *master, struct spi_board_info *info); | ||
| 198 | |||
| 199 | /* Initialize an v4l2_subdev with data from an spi_device struct */ | ||
| 200 | void v4l2_spi_subdev_init(struct v4l2_subdev *sd, struct spi_device *spi, | ||
| 201 | const struct v4l2_subdev_ops *ops); | ||
| 202 | #endif | ||
| 203 | |||
| 204 | /* ------------------------------------------------------------------------- */ | ||
| 205 | |||
| 187 | /* Note: these remaining ioctls/structs should be removed as well, but they are | 206 | /* Note: these remaining ioctls/structs should be removed as well, but they are |
| 188 | still used in tuner-simple.c (TUNER_SET_CONFIG), cx18/ivtv (RESET) and | 207 | still used in tuner-simple.c (TUNER_SET_CONFIG), cx18/ivtv (RESET) and |
| 189 | v4l2-int-device.h (v4l2_routing). To remove these ioctls some more cleanup | 208 | v4l2-int-device.h (v4l2_routing). To remove these ioctls some more cleanup |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index 2dee93892ea2..bebe44b03e0f 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
| @@ -32,6 +32,7 @@ struct v4l2_device; | |||
| 32 | Drivers can clear this flag if they want to block all future | 32 | Drivers can clear this flag if they want to block all future |
| 33 | device access. It is cleared by video_unregister_device. */ | 33 | device access. It is cleared by video_unregister_device. */ |
| 34 | #define V4L2_FL_REGISTERED (0) | 34 | #define V4L2_FL_REGISTERED (0) |
| 35 | #define V4L2_FL_USES_V4L2_FH (1) | ||
| 35 | 36 | ||
| 36 | struct v4l2_file_operations { | 37 | struct v4l2_file_operations { |
| 37 | struct module *owner; | 38 | struct module *owner; |
| @@ -77,6 +78,10 @@ struct video_device | |||
| 77 | /* attribute to differentiate multiple indices on one physical device */ | 78 | /* attribute to differentiate multiple indices on one physical device */ |
| 78 | int index; | 79 | int index; |
| 79 | 80 | ||
| 81 | /* V4L2 file handles */ | ||
| 82 | spinlock_t fh_lock; /* Lock for all v4l2_fhs */ | ||
| 83 | struct list_head fh_list; /* List of struct v4l2_fh */ | ||
| 84 | |||
| 80 | int debug; /* Activates debug level*/ | 85 | int debug; /* Activates debug level*/ |
| 81 | 86 | ||
| 82 | /* Video standard vars */ | 87 | /* Video standard vars */ |
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h new file mode 100644 index 000000000000..3b86177c8cd2 --- /dev/null +++ b/include/media/v4l2-event.h | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | /* | ||
| 2 | * v4l2-event.h | ||
| 3 | * | ||
| 4 | * V4L2 events. | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009--2010 Nokia Corporation. | ||
| 7 | * | ||
| 8 | * Contact: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or | ||
| 11 | * modify it under the terms of the GNU General Public License | ||
| 12 | * version 2 as published by the Free Software Foundation. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, but | ||
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 17 | * General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 22 | * 02110-1301 USA | ||
| 23 | */ | ||
| 24 | |||
| 25 | #ifndef V4L2_EVENT_H | ||
| 26 | #define V4L2_EVENT_H | ||
| 27 | |||
| 28 | #include <linux/types.h> | ||
| 29 | #include <linux/videodev2.h> | ||
| 30 | #include <linux/wait.h> | ||
| 31 | |||
| 32 | struct v4l2_fh; | ||
| 33 | struct video_device; | ||
| 34 | |||
| 35 | struct v4l2_kevent { | ||
| 36 | struct list_head list; | ||
| 37 | struct v4l2_event event; | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct v4l2_subscribed_event { | ||
| 41 | struct list_head list; | ||
| 42 | u32 type; | ||
| 43 | }; | ||
| 44 | |||
| 45 | struct v4l2_events { | ||
| 46 | wait_queue_head_t wait; | ||
| 47 | struct list_head subscribed; /* Subscribed events */ | ||
| 48 | struct list_head free; /* Events ready for use */ | ||
| 49 | struct list_head available; /* Dequeueable event */ | ||
| 50 | unsigned int navailable; | ||
| 51 | unsigned int nallocated; /* Number of allocated events */ | ||
| 52 | u32 sequence; | ||
| 53 | }; | ||
| 54 | |||
| 55 | int v4l2_event_init(struct v4l2_fh *fh); | ||
| 56 | int v4l2_event_alloc(struct v4l2_fh *fh, unsigned int n); | ||
| 57 | void v4l2_event_free(struct v4l2_fh *fh); | ||
| 58 | int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event, | ||
| 59 | int nonblocking); | ||
| 60 | void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev); | ||
| 61 | int v4l2_event_pending(struct v4l2_fh *fh); | ||
| 62 | int v4l2_event_subscribe(struct v4l2_fh *fh, | ||
| 63 | struct v4l2_event_subscription *sub); | ||
| 64 | int v4l2_event_unsubscribe(struct v4l2_fh *fh, | ||
| 65 | struct v4l2_event_subscription *sub); | ||
| 66 | |||
| 67 | #endif /* V4L2_EVENT_H */ | ||
diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h new file mode 100644 index 000000000000..1d72dde320bf --- /dev/null +++ b/include/media/v4l2-fh.h | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | /* | ||
| 2 | * v4l2-fh.h | ||
| 3 | * | ||
| 4 | * V4L2 file handle. Store per file handle data for the V4L2 | ||
| 5 | * framework. Using file handles is optional for the drivers. | ||
| 6 | * | ||
| 7 | * Copyright (C) 2009--2010 Nokia Corporation. | ||
| 8 | * | ||
| 9 | * Contact: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or | ||
| 12 | * modify it under the terms of the GNU General Public License | ||
| 13 | * version 2 as published by the Free Software Foundation. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, but | ||
| 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 18 | * General Public License for more details. | ||
| 19 | * | ||
| 20 | * You should have received a copy of the GNU General Public License | ||
| 21 | * along with this program; if not, write to the Free Software | ||
| 22 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 23 | * 02110-1301 USA | ||
| 24 | */ | ||
| 25 | |||
| 26 | #ifndef V4L2_FH_H | ||
| 27 | #define V4L2_FH_H | ||
| 28 | |||
| 29 | #include <linux/list.h> | ||
| 30 | |||
| 31 | struct video_device; | ||
| 32 | struct v4l2_events; | ||
| 33 | |||
| 34 | struct v4l2_fh { | ||
| 35 | struct list_head list; | ||
| 36 | struct video_device *vdev; | ||
| 37 | struct v4l2_events *events; /* events, pending and subscribed */ | ||
| 38 | }; | ||
| 39 | |||
| 40 | /* | ||
| 41 | * Initialise the file handle. Parts of the V4L2 framework using the | ||
| 42 | * file handles should be initialised in this function. Must be called | ||
| 43 | * from driver's v4l2_file_operations->open() handler if the driver | ||
| 44 | * uses v4l2_fh. | ||
| 45 | */ | ||
| 46 | int v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev); | ||
| 47 | /* | ||
| 48 | * Add the fh to the list of file handles on a video_device. The file | ||
| 49 | * handle must be initialised first. | ||
| 50 | */ | ||
| 51 | void v4l2_fh_add(struct v4l2_fh *fh); | ||
| 52 | /* | ||
| 53 | * Remove file handle from the list of file handles. Must be called in | ||
| 54 | * v4l2_file_operations->release() handler if the driver uses v4l2_fh. | ||
| 55 | */ | ||
| 56 | void v4l2_fh_del(struct v4l2_fh *fh); | ||
| 57 | /* | ||
| 58 | * Release resources related to a file handle. Parts of the V4L2 | ||
| 59 | * framework using the v4l2_fh must release their resources here, too. | ||
| 60 | * Must be called in v4l2_file_operations->release() handler if the | ||
| 61 | * driver uses v4l2_fh. | ||
| 62 | */ | ||
| 63 | void v4l2_fh_exit(struct v4l2_fh *fh); | ||
| 64 | |||
| 65 | #endif /* V4L2_EVENT_H */ | ||
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index e8ba0f2efbae..06daa6e8e051 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
| @@ -21,6 +21,8 @@ | |||
| 21 | #include <linux/videodev2.h> | 21 | #include <linux/videodev2.h> |
| 22 | #endif | 22 | #endif |
| 23 | 23 | ||
| 24 | struct v4l2_fh; | ||
| 25 | |||
| 24 | struct v4l2_ioctl_ops { | 26 | struct v4l2_ioctl_ops { |
| 25 | /* ioctl callbacks */ | 27 | /* ioctl callbacks */ |
| 26 | 28 | ||
| @@ -254,6 +256,11 @@ struct v4l2_ioctl_ops { | |||
| 254 | int (*vidioc_g_dv_timings) (struct file *file, void *fh, | 256 | int (*vidioc_g_dv_timings) (struct file *file, void *fh, |
| 255 | struct v4l2_dv_timings *timings); | 257 | struct v4l2_dv_timings *timings); |
| 256 | 258 | ||
| 259 | int (*vidioc_subscribe_event) (struct v4l2_fh *fh, | ||
| 260 | struct v4l2_event_subscription *sub); | ||
| 261 | int (*vidioc_unsubscribe_event)(struct v4l2_fh *fh, | ||
| 262 | struct v4l2_event_subscription *sub); | ||
| 263 | |||
| 257 | /* For other private ioctls */ | 264 | /* For other private ioctls */ |
| 258 | long (*vidioc_default) (struct file *file, void *fh, | 265 | long (*vidioc_default) (struct file *file, void *fh, |
| 259 | int cmd, void *arg); | 266 | int cmd, void *arg); |
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h new file mode 100644 index 000000000000..8d149f1c58d0 --- /dev/null +++ b/include/media/v4l2-mem2mem.h | |||
| @@ -0,0 +1,201 @@ | |||
| 1 | /* | ||
| 2 | * Memory-to-memory device framework for Video for Linux 2. | ||
| 3 | * | ||
| 4 | * Helper functions for devices that use memory buffers for both source | ||
| 5 | * and destination. | ||
| 6 | * | ||
| 7 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
| 8 | * Pawel Osciak, <p.osciak@samsung.com> | ||
| 9 | * Marek Szyprowski, <m.szyprowski@samsung.com> | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify | ||
| 12 | * it under the terms of the GNU General Public License as published by the | ||
| 13 | * Free Software Foundation; either version 2 of the | ||
| 14 | * License, or (at your option) any later version | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef _MEDIA_V4L2_MEM2MEM_H | ||
| 18 | #define _MEDIA_V4L2_MEM2MEM_H | ||
| 19 | |||
| 20 | #include <media/videobuf-core.h> | ||
| 21 | |||
| 22 | /** | ||
| 23 | * struct v4l2_m2m_ops - mem-to-mem device driver callbacks | ||
| 24 | * @device_run: required. Begin the actual job (transaction) inside this | ||
| 25 | * callback. | ||
| 26 | * The job does NOT have to end before this callback returns | ||
| 27 | * (and it will be the usual case). When the job finishes, | ||
| 28 | * v4l2_m2m_job_finish() has to be called. | ||
| 29 | * @job_ready: optional. Should return 0 if the driver does not have a job | ||
| 30 | * fully prepared to run yet (i.e. it will not be able to finish a | ||
| 31 | * transaction without sleeping). If not provided, it will be | ||
| 32 | * assumed that one source and one destination buffer are all | ||
| 33 | * that is required for the driver to perform one full transaction. | ||
| 34 | * This method may not sleep. | ||
| 35 | * @job_abort: required. Informs the driver that it has to abort the currently | ||
| 36 | * running transaction as soon as possible (i.e. as soon as it can | ||
| 37 | * stop the device safely; e.g. in the next interrupt handler), | ||
| 38 | * even if the transaction would not have been finished by then. | ||
| 39 | * After the driver performs the necessary steps, it has to call | ||
| 40 | * v4l2_m2m_job_finish() (as if the transaction ended normally). | ||
| 41 | * This function does not have to (and will usually not) wait | ||
| 42 | * until the device enters a state when it can be stopped. | ||
| 43 | */ | ||
| 44 | struct v4l2_m2m_ops { | ||
| 45 | void (*device_run)(void *priv); | ||
| 46 | int (*job_ready)(void *priv); | ||
| 47 | void (*job_abort)(void *priv); | ||
| 48 | }; | ||
| 49 | |||
| 50 | struct v4l2_m2m_dev; | ||
| 51 | |||
| 52 | struct v4l2_m2m_queue_ctx { | ||
| 53 | /* private: internal use only */ | ||
| 54 | struct videobuf_queue q; | ||
| 55 | |||
| 56 | /* Queue for buffers ready to be processed as soon as this | ||
| 57 | * instance receives access to the device */ | ||
| 58 | struct list_head rdy_queue; | ||
| 59 | u8 num_rdy; | ||
| 60 | }; | ||
| 61 | |||
| 62 | struct v4l2_m2m_ctx { | ||
| 63 | /* private: internal use only */ | ||
| 64 | struct v4l2_m2m_dev *m2m_dev; | ||
| 65 | |||
| 66 | /* Capture (output to memory) queue context */ | ||
| 67 | struct v4l2_m2m_queue_ctx cap_q_ctx; | ||
| 68 | |||
| 69 | /* Output (input from memory) queue context */ | ||
| 70 | struct v4l2_m2m_queue_ctx out_q_ctx; | ||
| 71 | |||
| 72 | /* For device job queue */ | ||
| 73 | struct list_head queue; | ||
| 74 | unsigned long job_flags; | ||
| 75 | |||
| 76 | /* Instance private data */ | ||
| 77 | void *priv; | ||
| 78 | }; | ||
| 79 | |||
| 80 | void *v4l2_m2m_get_curr_priv(struct v4l2_m2m_dev *m2m_dev); | ||
| 81 | |||
| 82 | struct videobuf_queue *v4l2_m2m_get_vq(struct v4l2_m2m_ctx *m2m_ctx, | ||
| 83 | enum v4l2_buf_type type); | ||
| 84 | |||
| 85 | void v4l2_m2m_job_finish(struct v4l2_m2m_dev *m2m_dev, | ||
| 86 | struct v4l2_m2m_ctx *m2m_ctx); | ||
| 87 | |||
| 88 | int v4l2_m2m_reqbufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | ||
| 89 | struct v4l2_requestbuffers *reqbufs); | ||
| 90 | |||
| 91 | int v4l2_m2m_querybuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | ||
| 92 | struct v4l2_buffer *buf); | ||
| 93 | |||
| 94 | int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | ||
| 95 | struct v4l2_buffer *buf); | ||
| 96 | int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | ||
| 97 | struct v4l2_buffer *buf); | ||
| 98 | |||
| 99 | int v4l2_m2m_streamon(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | ||
| 100 | enum v4l2_buf_type type); | ||
| 101 | int v4l2_m2m_streamoff(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | ||
| 102 | enum v4l2_buf_type type); | ||
| 103 | |||
| 104 | unsigned int v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | ||
| 105 | struct poll_table_struct *wait); | ||
| 106 | |||
| 107 | int v4l2_m2m_mmap(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | ||
| 108 | struct vm_area_struct *vma); | ||
| 109 | |||
| 110 | struct v4l2_m2m_dev *v4l2_m2m_init(struct v4l2_m2m_ops *m2m_ops); | ||
| 111 | void v4l2_m2m_release(struct v4l2_m2m_dev *m2m_dev); | ||
| 112 | |||
| 113 | struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(void *priv, struct v4l2_m2m_dev *m2m_dev, | ||
| 114 | void (*vq_init)(void *priv, struct videobuf_queue *, | ||
| 115 | enum v4l2_buf_type)); | ||
| 116 | void v4l2_m2m_ctx_release(struct v4l2_m2m_ctx *m2m_ctx); | ||
| 117 | |||
| 118 | void v4l2_m2m_buf_queue(struct v4l2_m2m_ctx *m2m_ctx, struct videobuf_queue *vq, | ||
| 119 | struct videobuf_buffer *vb); | ||
| 120 | |||
| 121 | /** | ||
| 122 | * v4l2_m2m_num_src_bufs_ready() - return the number of source buffers ready for | ||
| 123 | * use | ||
| 124 | */ | ||
| 125 | static inline | ||
| 126 | unsigned int v4l2_m2m_num_src_bufs_ready(struct v4l2_m2m_ctx *m2m_ctx) | ||
| 127 | { | ||
| 128 | return m2m_ctx->cap_q_ctx.num_rdy; | ||
| 129 | } | ||
| 130 | |||
| 131 | /** | ||
| 132 | * v4l2_m2m_num_src_bufs_ready() - return the number of destination buffers | ||
| 133 | * ready for use | ||
| 134 | */ | ||
| 135 | static inline | ||
| 136 | unsigned int v4l2_m2m_num_dst_bufs_ready(struct v4l2_m2m_ctx *m2m_ctx) | ||
| 137 | { | ||
| 138 | return m2m_ctx->out_q_ctx.num_rdy; | ||
| 139 | } | ||
| 140 | |||
| 141 | void *v4l2_m2m_next_buf(struct v4l2_m2m_ctx *m2m_ctx, enum v4l2_buf_type type); | ||
| 142 | |||
| 143 | /** | ||
| 144 | * v4l2_m2m_next_src_buf() - return next source buffer from the list of ready | ||
| 145 | * buffers | ||
| 146 | */ | ||
| 147 | static inline void *v4l2_m2m_next_src_buf(struct v4l2_m2m_ctx *m2m_ctx) | ||
| 148 | { | ||
| 149 | return v4l2_m2m_next_buf(m2m_ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT); | ||
| 150 | } | ||
| 151 | |||
| 152 | /** | ||
| 153 | * v4l2_m2m_next_dst_buf() - return next destination buffer from the list of | ||
| 154 | * ready buffers | ||
| 155 | */ | ||
| 156 | static inline void *v4l2_m2m_next_dst_buf(struct v4l2_m2m_ctx *m2m_ctx) | ||
| 157 | { | ||
| 158 | return v4l2_m2m_next_buf(m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE); | ||
| 159 | } | ||
| 160 | |||
| 161 | /** | ||
| 162 | * v4l2_m2m_get_src_vq() - return videobuf_queue for source buffers | ||
| 163 | */ | ||
| 164 | static inline | ||
| 165 | struct videobuf_queue *v4l2_m2m_get_src_vq(struct v4l2_m2m_ctx *m2m_ctx) | ||
| 166 | { | ||
| 167 | return v4l2_m2m_get_vq(m2m_ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT); | ||
| 168 | } | ||
| 169 | |||
| 170 | /** | ||
| 171 | * v4l2_m2m_get_dst_vq() - return videobuf_queue for destination buffers | ||
| 172 | */ | ||
| 173 | static inline | ||
| 174 | struct videobuf_queue *v4l2_m2m_get_dst_vq(struct v4l2_m2m_ctx *m2m_ctx) | ||
| 175 | { | ||
| 176 | return v4l2_m2m_get_vq(m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE); | ||
| 177 | } | ||
| 178 | |||
| 179 | void *v4l2_m2m_buf_remove(struct v4l2_m2m_ctx *m2m_ctx, | ||
| 180 | enum v4l2_buf_type type); | ||
| 181 | |||
| 182 | /** | ||
| 183 | * v4l2_m2m_src_buf_remove() - take off a source buffer from the list of ready | ||
| 184 | * buffers and return it | ||
| 185 | */ | ||
| 186 | static inline void *v4l2_m2m_src_buf_remove(struct v4l2_m2m_ctx *m2m_ctx) | ||
| 187 | { | ||
| 188 | return v4l2_m2m_buf_remove(m2m_ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT); | ||
| 189 | } | ||
| 190 | |||
| 191 | /** | ||
| 192 | * v4l2_m2m_dst_buf_remove() - take off a destination buffer from the list of | ||
| 193 | * ready buffers and return it | ||
| 194 | */ | ||
| 195 | static inline void *v4l2_m2m_dst_buf_remove(struct v4l2_m2m_ctx *m2m_ctx) | ||
| 196 | { | ||
| 197 | return v4l2_m2m_buf_remove(m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE); | ||
| 198 | } | ||
| 199 | |||
| 200 | #endif /* _MEDIA_V4L2_MEM2MEM_H */ | ||
| 201 | |||
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 2bcdca0a57fc..a88889355ae0 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
| @@ -184,28 +184,6 @@ struct v4l2_subdev_audio_ops { | |||
| 184 | }; | 184 | }; |
| 185 | 185 | ||
| 186 | /* | 186 | /* |
| 187 | decode_vbi_line: video decoders that support sliced VBI need to implement | ||
| 188 | this ioctl. Field p of the v4l2_sliced_vbi_line struct is set to the | ||
| 189 | start of the VBI data that was generated by the decoder. The driver | ||
| 190 | then parses the sliced VBI data and sets the other fields in the | ||
| 191 | struct accordingly. The pointer p is updated to point to the start of | ||
| 192 | the payload which can be copied verbatim into the data field of the | ||
| 193 | v4l2_sliced_vbi_data struct. If no valid VBI data was found, then the | ||
| 194 | type field is set to 0 on return. | ||
| 195 | |||
| 196 | s_vbi_data: used to generate VBI signals on a video signal. | ||
| 197 | v4l2_sliced_vbi_data is filled with the data packets that should be | ||
| 198 | output. Note that if you set the line field to 0, then that VBI signal | ||
| 199 | is disabled. If no valid VBI data was found, then the type field is | ||
| 200 | set to 0 on return. | ||
| 201 | |||
| 202 | g_vbi_data: used to obtain the sliced VBI packet from a readback register. | ||
| 203 | Not all video decoders support this. If no data is available because | ||
| 204 | the readback register contains invalid or erroneous data -EIO is | ||
| 205 | returned. Note that you must fill in the 'id' member and the 'field' | ||
| 206 | member (to determine whether CC data from the first or second field | ||
| 207 | should be obtained). | ||
| 208 | |||
| 209 | s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by | 187 | s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by |
| 210 | video input devices. | 188 | video input devices. |
| 211 | 189 | ||
| @@ -243,10 +221,6 @@ struct v4l2_subdev_audio_ops { | |||
| 243 | struct v4l2_subdev_video_ops { | 221 | struct v4l2_subdev_video_ops { |
| 244 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); | 222 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); |
| 245 | int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags); | 223 | int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags); |
| 246 | int (*decode_vbi_line)(struct v4l2_subdev *sd, struct v4l2_decode_vbi_line *vbi_line); | ||
| 247 | int (*s_vbi_data)(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_data *vbi_data); | ||
| 248 | int (*g_vbi_data)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_data *vbi_data); | ||
| 249 | int (*g_sliced_vbi_cap)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_cap *cap); | ||
| 250 | int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); | 224 | int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); |
| 251 | int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); | 225 | int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); |
| 252 | int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); | 226 | int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); |
| @@ -262,6 +236,8 @@ struct v4l2_subdev_video_ops { | |||
| 262 | int (*s_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); | 236 | int (*s_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); |
| 263 | int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); | 237 | int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); |
| 264 | int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); | 238 | int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); |
| 239 | int (*enum_dv_presets) (struct v4l2_subdev *sd, | ||
| 240 | struct v4l2_dv_enum_preset *preset); | ||
| 265 | int (*s_dv_preset)(struct v4l2_subdev *sd, | 241 | int (*s_dv_preset)(struct v4l2_subdev *sd, |
| 266 | struct v4l2_dv_preset *preset); | 242 | struct v4l2_dv_preset *preset); |
| 267 | int (*query_dv_preset)(struct v4l2_subdev *sd, | 243 | int (*query_dv_preset)(struct v4l2_subdev *sd, |
| @@ -280,6 +256,45 @@ struct v4l2_subdev_video_ops { | |||
| 280 | struct v4l2_mbus_framefmt *fmt); | 256 | struct v4l2_mbus_framefmt *fmt); |
| 281 | }; | 257 | }; |
| 282 | 258 | ||
| 259 | /* | ||
| 260 | decode_vbi_line: video decoders that support sliced VBI need to implement | ||
| 261 | this ioctl. Field p of the v4l2_sliced_vbi_line struct is set to the | ||
| 262 | start of the VBI data that was generated by the decoder. The driver | ||
| 263 | then parses the sliced VBI data and sets the other fields in the | ||
| 264 | struct accordingly. The pointer p is updated to point to the start of | ||
| 265 | the payload which can be copied verbatim into the data field of the | ||
| 266 | v4l2_sliced_vbi_data struct. If no valid VBI data was found, then the | ||
| 267 | type field is set to 0 on return. | ||
| 268 | |||
| 269 | s_vbi_data: used to generate VBI signals on a video signal. | ||
| 270 | v4l2_sliced_vbi_data is filled with the data packets that should be | ||
| 271 | output. Note that if you set the line field to 0, then that VBI signal | ||
| 272 | is disabled. If no valid VBI data was found, then the type field is | ||
| 273 | set to 0 on return. | ||
| 274 | |||
| 275 | g_vbi_data: used to obtain the sliced VBI packet from a readback register. | ||
| 276 | Not all video decoders support this. If no data is available because | ||
| 277 | the readback register contains invalid or erroneous data -EIO is | ||
| 278 | returned. Note that you must fill in the 'id' member and the 'field' | ||
| 279 | member (to determine whether CC data from the first or second field | ||
| 280 | should be obtained). | ||
| 281 | |||
| 282 | s_raw_fmt: setup the video encoder/decoder for raw VBI. | ||
| 283 | |||
| 284 | g_sliced_fmt: retrieve the current sliced VBI settings. | ||
| 285 | |||
| 286 | s_sliced_fmt: setup the sliced VBI settings. | ||
| 287 | */ | ||
| 288 | struct v4l2_subdev_vbi_ops { | ||
| 289 | int (*decode_vbi_line)(struct v4l2_subdev *sd, struct v4l2_decode_vbi_line *vbi_line); | ||
| 290 | int (*s_vbi_data)(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_data *vbi_data); | ||
| 291 | int (*g_vbi_data)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_data *vbi_data); | ||
| 292 | int (*g_sliced_vbi_cap)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_cap *cap); | ||
| 293 | int (*s_raw_fmt)(struct v4l2_subdev *sd, struct v4l2_vbi_format *fmt); | ||
| 294 | int (*g_sliced_fmt)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt); | ||
| 295 | int (*s_sliced_fmt)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt); | ||
| 296 | }; | ||
| 297 | |||
| 283 | /** | 298 | /** |
| 284 | * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations | 299 | * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations |
| 285 | * @g_skip_top_lines: number of lines at the top of the image to be skipped. | 300 | * @g_skip_top_lines: number of lines at the top of the image to be skipped. |
| @@ -379,6 +394,7 @@ struct v4l2_subdev_ops { | |||
| 379 | const struct v4l2_subdev_tuner_ops *tuner; | 394 | const struct v4l2_subdev_tuner_ops *tuner; |
| 380 | const struct v4l2_subdev_audio_ops *audio; | 395 | const struct v4l2_subdev_audio_ops *audio; |
| 381 | const struct v4l2_subdev_video_ops *video; | 396 | const struct v4l2_subdev_video_ops *video; |
| 397 | const struct v4l2_subdev_vbi_ops *vbi; | ||
| 382 | const struct v4l2_subdev_ir_ops *ir; | 398 | const struct v4l2_subdev_ir_ops *ir; |
| 383 | const struct v4l2_subdev_sensor_ops *sensor; | 399 | const struct v4l2_subdev_sensor_ops *sensor; |
| 384 | }; | 400 | }; |
| @@ -387,6 +403,8 @@ struct v4l2_subdev_ops { | |||
| 387 | 403 | ||
| 388 | /* Set this flag if this subdev is a i2c device. */ | 404 | /* Set this flag if this subdev is a i2c device. */ |
| 389 | #define V4L2_SUBDEV_FL_IS_I2C (1U << 0) | 405 | #define V4L2_SUBDEV_FL_IS_I2C (1U << 0) |
| 406 | /* Set this flag if this subdev is a spi device. */ | ||
| 407 | #define V4L2_SUBDEV_FL_IS_SPI (1U << 1) | ||
| 390 | 408 | ||
| 391 | /* Each instance of a subdev driver should create this struct, either | 409 | /* Each instance of a subdev driver should create this struct, either |
| 392 | stand-alone or embedded in a larger struct. | 410 | stand-alone or embedded in a larger struct. |
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h index 316fdccdcaa0..f91a736c133d 100644 --- a/include/media/videobuf-core.h +++ b/include/media/videobuf-core.h | |||
| @@ -127,30 +127,16 @@ struct videobuf_queue_ops { | |||
| 127 | struct videobuf_qtype_ops { | 127 | struct videobuf_qtype_ops { |
| 128 | u32 magic; | 128 | u32 magic; |
| 129 | 129 | ||
| 130 | void *(*alloc) (size_t size); | 130 | struct videobuf_buffer *(*alloc)(size_t size); |
| 131 | void *(*vmalloc) (struct videobuf_buffer *buf); | 131 | void *(*vaddr) (struct videobuf_buffer *buf); |
| 132 | int (*iolock) (struct videobuf_queue* q, | 132 | int (*iolock) (struct videobuf_queue *q, |
| 133 | struct videobuf_buffer *vb, | 133 | struct videobuf_buffer *vb, |
| 134 | struct v4l2_framebuffer *fbuf); | 134 | struct v4l2_framebuffer *fbuf); |
| 135 | int (*mmap) (struct videobuf_queue *q, | 135 | int (*sync) (struct videobuf_queue *q, |
| 136 | unsigned int *count, | ||
| 137 | unsigned int *size, | ||
| 138 | enum v4l2_memory memory); | ||
| 139 | int (*sync) (struct videobuf_queue* q, | ||
| 140 | struct videobuf_buffer *buf); | 136 | struct videobuf_buffer *buf); |
| 141 | int (*video_copy_to_user)(struct videobuf_queue *q, | ||
| 142 | char __user *data, | ||
| 143 | size_t count, | ||
| 144 | int nonblocking); | ||
| 145 | int (*copy_stream) (struct videobuf_queue *q, | ||
| 146 | char __user *data, | ||
| 147 | size_t count, | ||
| 148 | size_t pos, | ||
| 149 | int vbihack, | ||
| 150 | int nonblocking); | ||
| 151 | int (*mmap_free) (struct videobuf_queue *q); | ||
| 152 | int (*mmap_mapper) (struct videobuf_queue *q, | 137 | int (*mmap_mapper) (struct videobuf_queue *q, |
| 153 | struct vm_area_struct *vma); | 138 | struct videobuf_buffer *buf, |
| 139 | struct vm_area_struct *vma); | ||
| 154 | }; | 140 | }; |
| 155 | 141 | ||
| 156 | struct videobuf_queue { | 142 | struct videobuf_queue { |
| @@ -171,7 +157,6 @@ struct videobuf_queue { | |||
| 171 | 157 | ||
| 172 | unsigned int streaming:1; | 158 | unsigned int streaming:1; |
| 173 | unsigned int reading:1; | 159 | unsigned int reading:1; |
| 174 | unsigned int is_mmapped:1; | ||
| 175 | 160 | ||
| 176 | /* capture via mmap() + ioctl(QBUF/DQBUF) */ | 161 | /* capture via mmap() + ioctl(QBUF/DQBUF) */ |
| 177 | struct list_head stream; | 162 | struct list_head stream; |
| @@ -185,14 +170,14 @@ struct videobuf_queue { | |||
| 185 | }; | 170 | }; |
| 186 | 171 | ||
| 187 | int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); | 172 | int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr); |
| 188 | int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb, | 173 | int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb, |
| 189 | struct v4l2_framebuffer *fbuf); | 174 | struct v4l2_framebuffer *fbuf); |
| 190 | 175 | ||
| 191 | void *videobuf_alloc(struct videobuf_queue* q); | 176 | struct videobuf_buffer *videobuf_alloc(struct videobuf_queue *q); |
| 192 | 177 | ||
| 193 | /* Used on videobuf-dvb */ | 178 | /* Used on videobuf-dvb */ |
| 194 | void *videobuf_queue_to_vmalloc (struct videobuf_queue* q, | 179 | void *videobuf_queue_to_vaddr(struct videobuf_queue *q, |
| 195 | struct videobuf_buffer *buf); | 180 | struct videobuf_buffer *buf); |
| 196 | 181 | ||
| 197 | void videobuf_queue_core_init(struct videobuf_queue *q, | 182 | void videobuf_queue_core_init(struct videobuf_queue *q, |
| 198 | const struct videobuf_queue_ops *ops, | 183 | const struct videobuf_queue_ops *ops, |
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h index 53e72f787175..a195f3b9c00a 100644 --- a/include/media/videobuf-dma-sg.h +++ b/include/media/videobuf-dma-sg.h | |||
| @@ -17,6 +17,8 @@ | |||
| 17 | * it under the terms of the GNU General Public License as published by | 17 | * it under the terms of the GNU General Public License as published by |
| 18 | * the Free Software Foundation; either version 2 | 18 | * the Free Software Foundation; either version 2 |
| 19 | */ | 19 | */ |
| 20 | #ifndef _VIDEOBUF_DMA_SG_H | ||
| 21 | #define _VIDEOBUF_DMA_SG_H | ||
| 20 | 22 | ||
| 21 | #include <media/videobuf-core.h> | 23 | #include <media/videobuf-core.h> |
| 22 | 24 | ||
| @@ -27,14 +29,14 @@ | |||
| 27 | * block (NULL on errors). Memory for the scatterlist is allocated | 29 | * block (NULL on errors). Memory for the scatterlist is allocated |
| 28 | * using kmalloc. The caller must free the memory. | 30 | * using kmalloc. The caller must free the memory. |
| 29 | */ | 31 | */ |
| 30 | struct scatterlist* videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages); | 32 | struct scatterlist *videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages); |
| 31 | 33 | ||
| 32 | /* | 34 | /* |
| 33 | * Return a scatterlist for a an array of userpages (NULL on errors). | 35 | * Return a scatterlist for a an array of userpages (NULL on errors). |
| 34 | * Memory for the scatterlist is allocated using kmalloc. The caller | 36 | * Memory for the scatterlist is allocated using kmalloc. The caller |
| 35 | * must free the memory. | 37 | * must free the memory. |
| 36 | */ | 38 | */ |
| 37 | struct scatterlist* videobuf_pages_to_sg(struct page **pages, int nr_pages, | 39 | struct scatterlist *videobuf_pages_to_sg(struct page **pages, int nr_pages, |
| 38 | int offset); | 40 | int offset); |
| 39 | 41 | ||
| 40 | /* --------------------------------------------------------------------- */ | 42 | /* --------------------------------------------------------------------- */ |
| @@ -78,8 +80,7 @@ struct videobuf_dmabuf { | |||
| 78 | int direction; | 80 | int direction; |
| 79 | }; | 81 | }; |
| 80 | 82 | ||
| 81 | struct videobuf_dma_sg_memory | 83 | struct videobuf_dma_sg_memory { |
| 82 | { | ||
| 83 | u32 magic; | 84 | u32 magic; |
| 84 | 85 | ||
| 85 | /* for mmap'ed buffers */ | 86 | /* for mmap'ed buffers */ |
| @@ -95,14 +96,13 @@ int videobuf_dma_init_overlay(struct videobuf_dmabuf *dma, int direction, | |||
| 95 | dma_addr_t addr, int nr_pages); | 96 | dma_addr_t addr, int nr_pages); |
| 96 | int videobuf_dma_free(struct videobuf_dmabuf *dma); | 97 | int videobuf_dma_free(struct videobuf_dmabuf *dma); |
| 97 | 98 | ||
| 98 | int videobuf_dma_map(struct videobuf_queue* q,struct videobuf_dmabuf *dma); | 99 | int videobuf_dma_map(struct videobuf_queue *q, struct videobuf_dmabuf *dma); |
| 99 | int videobuf_dma_sync(struct videobuf_queue* q,struct videobuf_dmabuf *dma); | 100 | int videobuf_dma_unmap(struct videobuf_queue *q, struct videobuf_dmabuf *dma); |
| 100 | int videobuf_dma_unmap(struct videobuf_queue* q,struct videobuf_dmabuf *dma); | 101 | struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf); |
| 101 | struct videobuf_dmabuf *videobuf_to_dma (struct videobuf_buffer *buf); | ||
| 102 | 102 | ||
| 103 | void *videobuf_sg_alloc(size_t size); | 103 | void *videobuf_sg_alloc(size_t size); |
| 104 | 104 | ||
| 105 | void videobuf_queue_sg_init(struct videobuf_queue* q, | 105 | void videobuf_queue_sg_init(struct videobuf_queue *q, |
| 106 | const struct videobuf_queue_ops *ops, | 106 | const struct videobuf_queue_ops *ops, |
| 107 | struct device *dev, | 107 | struct device *dev, |
| 108 | spinlock_t *irqlock, | 108 | spinlock_t *irqlock, |
| @@ -111,9 +111,11 @@ void videobuf_queue_sg_init(struct videobuf_queue* q, | |||
| 111 | unsigned int msize, | 111 | unsigned int msize, |
| 112 | void *priv); | 112 | void *priv); |
| 113 | 113 | ||
| 114 | /*FIXME: these variants are used only on *-alsa code, where videobuf is | 114 | /*FIXME: these variants are used only on *-alsa code, where videobuf is |
| 115 | * used without queue | 115 | * used without queue |
| 116 | */ | 116 | */ |
| 117 | int videobuf_sg_dma_map(struct device *dev, struct videobuf_dmabuf *dma); | 117 | int videobuf_sg_dma_map(struct device *dev, struct videobuf_dmabuf *dma); |
| 118 | int videobuf_sg_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma); | 118 | int videobuf_sg_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma); |
| 119 | 119 | ||
| 120 | #endif /* _VIDEOBUF_DMA_SG_H */ | ||
| 121 | |||
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h index 4b419a257a7d..851eb1a2ff2a 100644 --- a/include/media/videobuf-vmalloc.h +++ b/include/media/videobuf-vmalloc.h | |||
| @@ -19,17 +19,17 @@ | |||
| 19 | 19 | ||
| 20 | /* --------------------------------------------------------------------- */ | 20 | /* --------------------------------------------------------------------- */ |
| 21 | 21 | ||
| 22 | struct videobuf_vmalloc_memory | 22 | struct videobuf_vmalloc_memory { |
| 23 | { | ||
| 24 | u32 magic; | 23 | u32 magic; |
| 25 | 24 | ||
| 26 | void *vmalloc; | 25 | void *vmalloc; |
| 27 | 26 | ||
| 28 | /* remap_vmalloc_range seems to need to run after mmap() on some cases */ | 27 | /* remap_vmalloc_range seems to need to run |
| 28 | * after mmap() on some cases */ | ||
| 29 | struct vm_area_struct *vma; | 29 | struct vm_area_struct *vma; |
| 30 | }; | 30 | }; |
| 31 | 31 | ||
| 32 | void videobuf_queue_vmalloc_init(struct videobuf_queue* q, | 32 | void videobuf_queue_vmalloc_init(struct videobuf_queue *q, |
| 33 | const struct videobuf_queue_ops *ops, | 33 | const struct videobuf_queue_ops *ops, |
| 34 | struct device *dev, | 34 | struct device *dev, |
| 35 | spinlock_t *irqlock, | 35 | spinlock_t *irqlock, |
| @@ -38,8 +38,8 @@ void videobuf_queue_vmalloc_init(struct videobuf_queue* q, | |||
| 38 | unsigned int msize, | 38 | unsigned int msize, |
| 39 | void *priv); | 39 | void *priv); |
| 40 | 40 | ||
| 41 | void *videobuf_to_vmalloc (struct videobuf_buffer *buf); | 41 | void *videobuf_to_vmalloc(struct videobuf_buffer *buf); |
| 42 | 42 | ||
| 43 | void videobuf_vmalloc_free (struct videobuf_buffer *buf); | 43 | void videobuf_vmalloc_free(struct videobuf_buffer *buf); |
| 44 | 44 | ||
| 45 | #endif | 45 | #endif |
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index 52e1fff709e4..4f3760afc20f 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h | |||
| @@ -32,13 +32,13 @@ | |||
| 32 | /** enum p9_proto_versions - 9P protocol versions | 32 | /** enum p9_proto_versions - 9P protocol versions |
| 33 | * @p9_proto_legacy: 9P Legacy mode, pre-9P2000.u | 33 | * @p9_proto_legacy: 9P Legacy mode, pre-9P2000.u |
| 34 | * @p9_proto_2000u: 9P2000.u extension | 34 | * @p9_proto_2000u: 9P2000.u extension |
| 35 | * @p9_proto_2010L: 9P2010.L extension | 35 | * @p9_proto_2000L: 9P2000.L extension |
| 36 | */ | 36 | */ |
| 37 | 37 | ||
| 38 | enum p9_proto_versions{ | 38 | enum p9_proto_versions{ |
| 39 | p9_proto_legacy = 0, | 39 | p9_proto_legacy = 0, |
| 40 | p9_proto_2000u = 1, | 40 | p9_proto_2000u = 1, |
| 41 | p9_proto_2010L = 2, | 41 | p9_proto_2000L = 2, |
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | 44 | ||
| @@ -54,6 +54,7 @@ enum p9_proto_versions{ | |||
| 54 | 54 | ||
| 55 | enum p9_trans_status { | 55 | enum p9_trans_status { |
| 56 | Connected, | 56 | Connected, |
| 57 | BeginDisconnect, | ||
| 57 | Disconnected, | 58 | Disconnected, |
| 58 | Hung, | 59 | Hung, |
| 59 | }; | 60 | }; |
| @@ -198,6 +199,7 @@ int p9_client_version(struct p9_client *); | |||
| 198 | struct p9_client *p9_client_create(const char *dev_name, char *options); | 199 | struct p9_client *p9_client_create(const char *dev_name, char *options); |
| 199 | void p9_client_destroy(struct p9_client *clnt); | 200 | void p9_client_destroy(struct p9_client *clnt); |
| 200 | void p9_client_disconnect(struct p9_client *clnt); | 201 | void p9_client_disconnect(struct p9_client *clnt); |
| 202 | void p9_client_begin_disconnect(struct p9_client *clnt); | ||
| 201 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, | 203 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, |
| 202 | char *uname, u32 n_uname, char *aname); | 204 | char *uname, u32 n_uname, char *aname); |
| 203 | struct p9_fid *p9_client_auth(struct p9_client *clnt, char *uname, | 205 | struct p9_fid *p9_client_auth(struct p9_client *clnt, char *uname, |
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 1614d78c60ed..20725e213aee 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
| @@ -30,7 +30,7 @@ struct unix_skb_parms { | |||
| 30 | #endif | 30 | #endif |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | #define UNIXCB(skb) (*(struct unix_skb_parms*)&((skb)->cb)) | 33 | #define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb)) |
| 34 | #define UNIXCREDS(skb) (&UNIXCB((skb)).creds) | 34 | #define UNIXCREDS(skb) (&UNIXCB((skb)).creds) |
| 35 | #define UNIXSID(skb) (&UNIXCB((skb)).secid) | 35 | #define UNIXSID(skb) (&UNIXCB((skb)).secid) |
| 36 | 36 | ||
| @@ -45,21 +45,23 @@ struct unix_skb_parms { | |||
| 45 | struct unix_sock { | 45 | struct unix_sock { |
| 46 | /* WARNING: sk has to be the first member */ | 46 | /* WARNING: sk has to be the first member */ |
| 47 | struct sock sk; | 47 | struct sock sk; |
| 48 | struct unix_address *addr; | 48 | struct unix_address *addr; |
| 49 | struct dentry *dentry; | 49 | struct dentry *dentry; |
| 50 | struct vfsmount *mnt; | 50 | struct vfsmount *mnt; |
| 51 | struct mutex readlock; | 51 | struct mutex readlock; |
| 52 | struct sock *peer; | 52 | struct sock *peer; |
| 53 | struct sock *other; | 53 | struct sock *other; |
| 54 | struct list_head link; | 54 | struct list_head link; |
| 55 | atomic_long_t inflight; | 55 | atomic_long_t inflight; |
| 56 | spinlock_t lock; | 56 | spinlock_t lock; |
| 57 | unsigned int gc_candidate : 1; | 57 | unsigned int gc_candidate : 1; |
| 58 | unsigned int gc_maybe_cycle : 1; | 58 | unsigned int gc_maybe_cycle : 1; |
| 59 | wait_queue_head_t peer_wait; | 59 | struct socket_wq peer_wq; |
| 60 | }; | 60 | }; |
| 61 | #define unix_sk(__sk) ((struct unix_sock *)__sk) | 61 | #define unix_sk(__sk) ((struct unix_sock *)__sk) |
| 62 | 62 | ||
| 63 | #define peer_wait peer_wq.wait | ||
| 64 | |||
| 63 | #ifdef CONFIG_SYSCTL | 65 | #ifdef CONFIG_SYSCTL |
| 64 | extern int unix_sysctl_register(struct net *net); | 66 | extern int unix_sysctl_register(struct net *net); |
| 65 | extern void unix_sysctl_unregister(struct net *net); | 67 | extern void unix_sysctl_unregister(struct net *net); |
diff --git a/include/net/ax25.h b/include/net/ax25.h index 717e2192d521..206d22297ac3 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/spinlock.h> | 10 | #include <linux/spinlock.h> |
| 11 | #include <linux/timer.h> | 11 | #include <linux/timer.h> |
| 12 | #include <linux/list.h> | 12 | #include <linux/list.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <asm/atomic.h> | 14 | #include <asm/atomic.h> |
| 14 | 15 | ||
| 15 | #define AX25_T1CLAMPLO 1 | 16 | #define AX25_T1CLAMPLO 1 |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 04a6908e38d2..ff77e8f882f1 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -176,6 +176,6 @@ extern void hci_sock_cleanup(void); | |||
| 176 | extern int bt_sysfs_init(void); | 176 | extern int bt_sysfs_init(void); |
| 177 | extern void bt_sysfs_cleanup(void); | 177 | extern void bt_sysfs_cleanup(void); |
| 178 | 178 | ||
| 179 | extern struct class *bt_class; | 179 | extern struct dentry *bt_debugfs; |
| 180 | 180 | ||
| 181 | #endif /* __BLUETOOTH_H */ | 181 | #endif /* __BLUETOOTH_H */ |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index ce3c99e5fa25..e42f6ed5421c 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -107,6 +107,8 @@ struct hci_dev { | |||
| 107 | unsigned long acl_last_tx; | 107 | unsigned long acl_last_tx; |
| 108 | unsigned long sco_last_tx; | 108 | unsigned long sco_last_tx; |
| 109 | 109 | ||
| 110 | struct workqueue_struct *workqueue; | ||
| 111 | |||
| 110 | struct tasklet_struct cmd_task; | 112 | struct tasklet_struct cmd_task; |
| 111 | struct tasklet_struct rx_task; | 113 | struct tasklet_struct rx_task; |
| 112 | struct tasklet_struct tx_task; | 114 | struct tasklet_struct tx_task; |
| @@ -636,8 +638,8 @@ int hci_register_notifier(struct notifier_block *nb); | |||
| 636 | int hci_unregister_notifier(struct notifier_block *nb); | 638 | int hci_unregister_notifier(struct notifier_block *nb); |
| 637 | 639 | ||
| 638 | int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param); | 640 | int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param); |
| 639 | int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags); | 641 | void hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags); |
| 640 | int hci_send_sco(struct hci_conn *conn, struct sk_buff *skb); | 642 | void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb); |
| 641 | 643 | ||
| 642 | void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode); | 644 | void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode); |
| 643 | 645 | ||
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 17a689f27a6a..7c695bfd853c 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
| @@ -30,11 +30,12 @@ | |||
| 30 | #define L2CAP_DEFAULT_MIN_MTU 48 | 30 | #define L2CAP_DEFAULT_MIN_MTU 48 |
| 31 | #define L2CAP_DEFAULT_FLUSH_TO 0xffff | 31 | #define L2CAP_DEFAULT_FLUSH_TO 0xffff |
| 32 | #define L2CAP_DEFAULT_TX_WINDOW 63 | 32 | #define L2CAP_DEFAULT_TX_WINDOW 63 |
| 33 | #define L2CAP_DEFAULT_NUM_TO_ACK (L2CAP_DEFAULT_TX_WINDOW/5) | ||
| 34 | #define L2CAP_DEFAULT_MAX_TX 3 | 33 | #define L2CAP_DEFAULT_MAX_TX 3 |
| 35 | #define L2CAP_DEFAULT_RETRANS_TO 1000 /* 1 second */ | 34 | #define L2CAP_DEFAULT_RETRANS_TO 1000 /* 1 second */ |
| 36 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ | 35 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ |
| 37 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 672 | 36 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 672 |
| 37 | #define L2CAP_DEFAULT_ACK_TO 200 | ||
| 38 | #define L2CAP_LOCAL_BUSY_TRIES 12 | ||
| 38 | 39 | ||
| 39 | #define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ | 40 | #define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ |
| 40 | #define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ | 41 | #define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ |
| @@ -55,6 +56,8 @@ struct l2cap_options { | |||
| 55 | __u16 flush_to; | 56 | __u16 flush_to; |
| 56 | __u8 mode; | 57 | __u8 mode; |
| 57 | __u8 fcs; | 58 | __u8 fcs; |
| 59 | __u8 max_tx; | ||
| 60 | __u16 txwin_size; | ||
| 58 | }; | 61 | }; |
| 59 | 62 | ||
| 60 | #define L2CAP_CONNINFO 0x02 | 63 | #define L2CAP_CONNINFO 0x02 |
| @@ -292,6 +295,7 @@ struct l2cap_conn { | |||
| 292 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) | 295 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) |
| 293 | #define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue) | 296 | #define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue) |
| 294 | #define SREJ_QUEUE(sk) (&l2cap_pi(sk)->srej_queue) | 297 | #define SREJ_QUEUE(sk) (&l2cap_pi(sk)->srej_queue) |
| 298 | #define BUSY_QUEUE(sk) (&l2cap_pi(sk)->busy_queue) | ||
| 295 | #define SREJ_LIST(sk) (&l2cap_pi(sk)->srej_l.list) | 299 | #define SREJ_LIST(sk) (&l2cap_pi(sk)->srej_l.list) |
| 296 | 300 | ||
| 297 | struct srej_list { | 301 | struct srej_list { |
| @@ -320,7 +324,7 @@ struct l2cap_pinfo { | |||
| 320 | __u8 conf_req[64]; | 324 | __u8 conf_req[64]; |
| 321 | __u8 conf_len; | 325 | __u8 conf_len; |
| 322 | __u8 conf_state; | 326 | __u8 conf_state; |
| 323 | __u8 conn_state; | 327 | __u16 conn_state; |
| 324 | 328 | ||
| 325 | __u8 next_tx_seq; | 329 | __u8 next_tx_seq; |
| 326 | __u8 expected_ack_seq; | 330 | __u8 expected_ack_seq; |
| @@ -328,27 +332,35 @@ struct l2cap_pinfo { | |||
| 328 | __u8 buffer_seq; | 332 | __u8 buffer_seq; |
| 329 | __u8 buffer_seq_srej; | 333 | __u8 buffer_seq_srej; |
| 330 | __u8 srej_save_reqseq; | 334 | __u8 srej_save_reqseq; |
| 335 | __u8 frames_sent; | ||
| 331 | __u8 unacked_frames; | 336 | __u8 unacked_frames; |
| 332 | __u8 retry_count; | 337 | __u8 retry_count; |
| 333 | __u8 num_to_ack; | 338 | __u8 num_acked; |
| 334 | __u16 sdu_len; | 339 | __u16 sdu_len; |
| 335 | __u16 partial_sdu_len; | 340 | __u16 partial_sdu_len; |
| 336 | struct sk_buff *sdu; | 341 | struct sk_buff *sdu; |
| 337 | 342 | ||
| 338 | __u8 ident; | 343 | __u8 ident; |
| 339 | 344 | ||
| 345 | __u8 tx_win; | ||
| 346 | __u8 max_tx; | ||
| 340 | __u8 remote_tx_win; | 347 | __u8 remote_tx_win; |
| 341 | __u8 remote_max_tx; | 348 | __u8 remote_max_tx; |
| 342 | __u16 retrans_timeout; | 349 | __u16 retrans_timeout; |
| 343 | __u16 monitor_timeout; | 350 | __u16 monitor_timeout; |
| 344 | __u16 max_pdu_size; | 351 | __u16 remote_mps; |
| 352 | __u16 mps; | ||
| 345 | 353 | ||
| 346 | __le16 sport; | 354 | __le16 sport; |
| 347 | 355 | ||
| 356 | spinlock_t send_lock; | ||
| 348 | struct timer_list retrans_timer; | 357 | struct timer_list retrans_timer; |
| 349 | struct timer_list monitor_timer; | 358 | struct timer_list monitor_timer; |
| 359 | struct timer_list ack_timer; | ||
| 350 | struct sk_buff_head tx_queue; | 360 | struct sk_buff_head tx_queue; |
| 351 | struct sk_buff_head srej_queue; | 361 | struct sk_buff_head srej_queue; |
| 362 | struct sk_buff_head busy_queue; | ||
| 363 | struct work_struct busy_work; | ||
| 352 | struct srej_list srej_l; | 364 | struct srej_list srej_l; |
| 353 | struct l2cap_conn *conn; | 365 | struct l2cap_conn *conn; |
| 354 | struct sock *next_c; | 366 | struct sock *next_c; |
| @@ -367,19 +379,24 @@ struct l2cap_pinfo { | |||
| 367 | #define L2CAP_CONF_MAX_CONF_REQ 2 | 379 | #define L2CAP_CONF_MAX_CONF_REQ 2 |
| 368 | #define L2CAP_CONF_MAX_CONF_RSP 2 | 380 | #define L2CAP_CONF_MAX_CONF_RSP 2 |
| 369 | 381 | ||
| 370 | #define L2CAP_CONN_SAR_SDU 0x01 | 382 | #define L2CAP_CONN_SAR_SDU 0x0001 |
| 371 | #define L2CAP_CONN_SREJ_SENT 0x02 | 383 | #define L2CAP_CONN_SREJ_SENT 0x0002 |
| 372 | #define L2CAP_CONN_WAIT_F 0x04 | 384 | #define L2CAP_CONN_WAIT_F 0x0004 |
| 373 | #define L2CAP_CONN_SREJ_ACT 0x08 | 385 | #define L2CAP_CONN_SREJ_ACT 0x0008 |
| 374 | #define L2CAP_CONN_SEND_PBIT 0x10 | 386 | #define L2CAP_CONN_SEND_PBIT 0x0010 |
| 375 | #define L2CAP_CONN_REMOTE_BUSY 0x20 | 387 | #define L2CAP_CONN_REMOTE_BUSY 0x0020 |
| 376 | #define L2CAP_CONN_LOCAL_BUSY 0x40 | 388 | #define L2CAP_CONN_LOCAL_BUSY 0x0040 |
| 377 | #define L2CAP_CONN_REJ_ACT 0x80 | 389 | #define L2CAP_CONN_REJ_ACT 0x0080 |
| 390 | #define L2CAP_CONN_SEND_FBIT 0x0100 | ||
| 391 | #define L2CAP_CONN_RNR_SENT 0x0200 | ||
| 392 | #define L2CAP_CONN_SAR_RETRY 0x0400 | ||
| 378 | 393 | ||
| 379 | #define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \ | 394 | #define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \ |
| 380 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); | 395 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); |
| 381 | #define __mod_monitor_timer() mod_timer(&l2cap_pi(sk)->monitor_timer, \ | 396 | #define __mod_monitor_timer() mod_timer(&l2cap_pi(sk)->monitor_timer, \ |
| 382 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO)); | 397 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO)); |
| 398 | #define __mod_ack_timer() mod_timer(&l2cap_pi(sk)->ack_timer, \ | ||
| 399 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); | ||
| 383 | 400 | ||
| 384 | static inline int l2cap_tx_window_full(struct sock *sk) | 401 | static inline int l2cap_tx_window_full(struct sock *sk) |
| 385 | { | 402 | { |
diff --git a/include/net/caif/caif_dev.h b/include/net/caif/caif_dev.h new file mode 100644 index 000000000000..318ab9478a44 --- /dev/null +++ b/include/net/caif/caif_dev.h | |||
| @@ -0,0 +1,103 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 3 | * Author: Sjur Brendeland/ sjur.brandeland@stericsson.com | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef CAIF_DEV_H_ | ||
| 8 | #define CAIF_DEV_H_ | ||
| 9 | |||
| 10 | #include <net/caif/caif_layer.h> | ||
| 11 | #include <net/caif/cfcnfg.h> | ||
| 12 | #include <linux/caif/caif_socket.h> | ||
| 13 | #include <linux/if.h> | ||
| 14 | |||
| 15 | /** | ||
| 16 | * struct caif_param - CAIF parameters. | ||
| 17 | * @size: Length of data | ||
| 18 | * @data: Binary Data Blob | ||
| 19 | */ | ||
| 20 | struct caif_param { | ||
| 21 | u16 size; | ||
| 22 | u8 data[256]; | ||
| 23 | }; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * struct caif_connect_request - Request data for CAIF channel setup. | ||
| 27 | * @protocol: Type of CAIF protocol to use (at, datagram etc) | ||
| 28 | * @sockaddr: Socket address to connect. | ||
| 29 | * @priority: Priority of the connection. | ||
| 30 | * @link_selector: Link selector (high bandwidth or low latency) | ||
| 31 | * @link_name: Name of the CAIF Link Layer to use. | ||
| 32 | * @param: Connect Request parameters (CAIF_SO_REQ_PARAM). | ||
| 33 | * | ||
| 34 | * This struct is used when connecting a CAIF channel. | ||
| 35 | * It contains all CAIF channel configuration options. | ||
| 36 | */ | ||
| 37 | struct caif_connect_request { | ||
| 38 | enum caif_protocol_type protocol; | ||
| 39 | struct sockaddr_caif sockaddr; | ||
| 40 | enum caif_channel_priority priority; | ||
| 41 | enum caif_link_selector link_selector; | ||
| 42 | char link_name[16]; | ||
| 43 | struct caif_param param; | ||
| 44 | }; | ||
| 45 | |||
| 46 | /** | ||
| 47 | * caif_connect_client - Connect a client to CAIF Core Stack. | ||
| 48 | * @config: Channel setup parameters, specifying what address | ||
| 49 | * to connect on the Modem. | ||
| 50 | * @client_layer: User implementation of client layer. This layer | ||
| 51 | * MUST have receive and control callback functions | ||
| 52 | * implemented. | ||
| 53 | * | ||
| 54 | * This function connects a CAIF channel. The Client must implement | ||
| 55 | * the struct cflayer. This layer represents the Client layer and holds | ||
| 56 | * receive functions and control callback functions. Control callback | ||
| 57 | * function will receive information about connect/disconnect responses, | ||
| 58 | * flow control etc (see enum caif_control). | ||
| 59 | * E.g. CAIF Socket will call this function for each socket it connects | ||
| 60 | * and have one client_layer instance for each socket. | ||
| 61 | */ | ||
| 62 | int caif_connect_client(struct caif_connect_request *config, | ||
| 63 | struct cflayer *client_layer); | ||
| 64 | |||
| 65 | /** | ||
| 66 | * caif_disconnect_client - Disconnects a client from the CAIF stack. | ||
| 67 | * | ||
| 68 | * @client_layer: Client layer to be removed. | ||
| 69 | */ | ||
| 70 | int caif_disconnect_client(struct cflayer *client_layer); | ||
| 71 | |||
| 72 | /** | ||
| 73 | * caif_release_client - Release adaptation layer reference to client. | ||
| 74 | * | ||
| 75 | * @client_layer: Client layer. | ||
| 76 | * | ||
| 77 | * Releases a client/adaptation layer use of the caif stack. | ||
| 78 | * This function must be used after caif_disconnect_client to | ||
| 79 | * decrease the reference count of the service layer. | ||
| 80 | */ | ||
| 81 | void caif_release_client(struct cflayer *client_layer); | ||
| 82 | |||
| 83 | /** | ||
| 84 | * connect_req_to_link_param - Translate configuration parameters | ||
| 85 | * from socket format to internal format. | ||
| 86 | * @cnfg: Pointer to configuration handler | ||
| 87 | * @con_req: Configuration parameters supplied in function | ||
| 88 | * caif_connect_client | ||
| 89 | * @channel_setup_param: Parameters supplied to the CAIF Core stack for | ||
| 90 | * setting up channels. | ||
| 91 | * | ||
| 92 | */ | ||
| 93 | int connect_req_to_link_param(struct cfcnfg *cnfg, | ||
| 94 | struct caif_connect_request *con_req, | ||
| 95 | struct cfctrl_link_param *channel_setup_param); | ||
| 96 | |||
| 97 | /** | ||
| 98 | * get_caif_conf() - Get the configuration handler. | ||
| 99 | */ | ||
| 100 | struct cfcnfg *get_caif_conf(void); | ||
| 101 | |||
| 102 | |||
| 103 | #endif /* CAIF_DEV_H_ */ | ||
diff --git a/include/net/caif/caif_device.h b/include/net/caif/caif_device.h new file mode 100644 index 000000000000..d02f044adb8a --- /dev/null +++ b/include/net/caif/caif_device.h | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 3 | * Author: Sjur Brendeland/ sjur.brandeland@stericsson.com | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef CAIF_DEVICE_H_ | ||
| 8 | #define CAIF_DEVICE_H_ | ||
| 9 | #include <linux/kernel.h> | ||
| 10 | #include <linux/net.h> | ||
| 11 | #include <linux/netdevice.h> | ||
| 12 | #include <linux/caif/caif_socket.h> | ||
| 13 | #include <net/caif/caif_device.h> | ||
| 14 | |||
| 15 | /** | ||
| 16 | * struct caif_dev_common - data shared between CAIF drivers and stack. | ||
| 17 | * @flowctrl: Flow Control callback function. This function is | ||
| 18 | * supplied by CAIF Core Stack and is used by CAIF | ||
| 19 | * Link Layer to send flow-stop to CAIF Core. | ||
| 20 | * The flow information will be distributed to all | ||
| 21 | * clients of CAIF. | ||
| 22 | * | ||
| 23 | * @link_select: Profile of device, either high-bandwidth or | ||
| 24 | * low-latency. This member is set by CAIF Link | ||
| 25 | * Layer Device in order to indicate if this device | ||
| 26 | * is a high bandwidth or low latency device. | ||
| 27 | * | ||
| 28 | * @use_frag: CAIF Frames may be fragmented. | ||
| 29 | * Is set by CAIF Link Layer in order to indicate if the | ||
| 30 | * interface receives fragmented frames that must be | ||
| 31 | * assembled by CAIF Core Layer. | ||
| 32 | * | ||
| 33 | * @use_fcs: Indicate if Frame CheckSum (fcs) is used. | ||
| 34 | * Is set if the physical interface is | ||
| 35 | * using Frame Checksum on the CAIF Frames. | ||
| 36 | * | ||
| 37 | * @use_stx: Indicate STart of frame eXtension (stx) in use. | ||
| 38 | * Is set if the CAIF Link Layer expects | ||
| 39 | * CAIF Frames to start with the STX byte. | ||
| 40 | * | ||
| 41 | * This structure is shared between the CAIF drivers and the CAIF stack. | ||
| 42 | * It is used by the device to register its behavior. | ||
| 43 | * CAIF Core layer must set the member flowctrl in order to supply | ||
| 44 | * CAIF Link Layer with the flow control function. | ||
| 45 | * | ||
| 46 | */ | ||
| 47 | struct caif_dev_common { | ||
| 48 | void (*flowctrl)(struct net_device *net, int on); | ||
| 49 | enum caif_link_selector link_select; | ||
| 50 | int use_frag; | ||
| 51 | int use_fcs; | ||
| 52 | int use_stx; | ||
| 53 | }; | ||
| 54 | |||
| 55 | #endif /* CAIF_DEVICE_H_ */ | ||
diff --git a/include/net/caif/caif_layer.h b/include/net/caif/caif_layer.h new file mode 100644 index 000000000000..25c472f0e5b8 --- /dev/null +++ b/include/net/caif/caif_layer.h | |||
| @@ -0,0 +1,283 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 3 | * Author: Sjur Brendeland / sjur.brandeland@stericsson.com | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef CAIF_LAYER_H_ | ||
| 8 | #define CAIF_LAYER_H_ | ||
| 9 | |||
| 10 | #include <linux/list.h> | ||
| 11 | |||
| 12 | struct cflayer; | ||
| 13 | struct cfpkt; | ||
| 14 | struct cfpktq; | ||
| 15 | struct caif_payload_info; | ||
| 16 | struct caif_packet_funcs; | ||
| 17 | |||
| 18 | #define CAIF_MAX_FRAMESIZE 4096 | ||
| 19 | #define CAIF_MAX_PAYLOAD_SIZE (4096 - 64) | ||
| 20 | #define CAIF_NEEDED_HEADROOM (10) | ||
| 21 | #define CAIF_NEEDED_TAILROOM (2) | ||
| 22 | |||
| 23 | #define CAIF_LAYER_NAME_SZ 16 | ||
| 24 | #define CAIF_SUCCESS 1 | ||
| 25 | #define CAIF_FAILURE 0 | ||
| 26 | |||
| 27 | /** | ||
| 28 | * caif_assert() - Assert function for CAIF. | ||
| 29 | * @assert: expression to evaluate. | ||
| 30 | * | ||
| 31 | * This function will print a error message and a do WARN_ON if the | ||
| 32 | * assertion failes. Normally this will do a stack up at the current location. | ||
| 33 | */ | ||
| 34 | #define caif_assert(assert) \ | ||
| 35 | do { \ | ||
| 36 | if (!(assert)) { \ | ||
| 37 | pr_err("caif:Assert detected:'%s'\n", #assert); \ | ||
| 38 | WARN_ON(!(assert)); \ | ||
| 39 | } \ | ||
| 40 | } while (0) | ||
| 41 | |||
| 42 | |||
| 43 | /** | ||
| 44 | * enum caif_ctrlcmd - CAIF Stack Control Signaling sent in layer.ctrlcmd(). | ||
| 45 | * | ||
| 46 | * @CAIF_CTRLCMD_FLOW_OFF_IND: Flow Control is OFF, transmit function | ||
| 47 | * should stop sending data | ||
| 48 | * | ||
| 49 | * @CAIF_CTRLCMD_FLOW_ON_IND: Flow Control is ON, transmit function | ||
| 50 | * can start sending data | ||
| 51 | * | ||
| 52 | * @CAIF_CTRLCMD_REMOTE_SHUTDOWN_IND: Remote end modem has decided to close | ||
| 53 | * down channel | ||
| 54 | * | ||
| 55 | * @CAIF_CTRLCMD_INIT_RSP: Called initially when the layer below | ||
| 56 | * has finished initialization | ||
| 57 | * | ||
| 58 | * @CAIF_CTRLCMD_DEINIT_RSP: Called when de-initialization is | ||
| 59 | * complete | ||
| 60 | * | ||
| 61 | * @CAIF_CTRLCMD_INIT_FAIL_RSP: Called if initialization fails | ||
| 62 | * | ||
| 63 | * @_CAIF_CTRLCMD_PHYIF_FLOW_OFF_IND: CAIF Link layer temporarily cannot | ||
| 64 | * send more packets. | ||
| 65 | * @_CAIF_CTRLCMD_PHYIF_FLOW_ON_IND: Called if CAIF Link layer is able | ||
| 66 | * to send packets again. | ||
| 67 | * @_CAIF_CTRLCMD_PHYIF_DOWN_IND: Called if CAIF Link layer is going | ||
| 68 | * down. | ||
| 69 | * | ||
| 70 | * These commands are sent upwards in the CAIF stack to the CAIF Client. | ||
| 71 | * They are used for signaling originating from the modem or CAIF Link Layer. | ||
| 72 | * These are either responses (*_RSP) or events (*_IND). | ||
| 73 | */ | ||
| 74 | enum caif_ctrlcmd { | ||
| 75 | CAIF_CTRLCMD_FLOW_OFF_IND, | ||
| 76 | CAIF_CTRLCMD_FLOW_ON_IND, | ||
| 77 | CAIF_CTRLCMD_REMOTE_SHUTDOWN_IND, | ||
| 78 | CAIF_CTRLCMD_INIT_RSP, | ||
| 79 | CAIF_CTRLCMD_DEINIT_RSP, | ||
| 80 | CAIF_CTRLCMD_INIT_FAIL_RSP, | ||
| 81 | _CAIF_CTRLCMD_PHYIF_FLOW_OFF_IND, | ||
| 82 | _CAIF_CTRLCMD_PHYIF_FLOW_ON_IND, | ||
| 83 | _CAIF_CTRLCMD_PHYIF_DOWN_IND, | ||
| 84 | }; | ||
| 85 | |||
| 86 | /** | ||
| 87 | * enum caif_modemcmd - Modem Control Signaling, sent from CAIF Client | ||
| 88 | * to the CAIF Link Layer or modem. | ||
| 89 | * | ||
| 90 | * @CAIF_MODEMCMD_FLOW_ON_REQ: Flow Control is ON, transmit function | ||
| 91 | * can start sending data. | ||
| 92 | * | ||
| 93 | * @CAIF_MODEMCMD_FLOW_OFF_REQ: Flow Control is OFF, transmit function | ||
| 94 | * should stop sending data. | ||
| 95 | * | ||
| 96 | * @_CAIF_MODEMCMD_PHYIF_USEFULL: Notify physical layer that it is in use | ||
| 97 | * | ||
| 98 | * @_CAIF_MODEMCMD_PHYIF_USELESS: Notify physical layer that it is | ||
| 99 | * no longer in use. | ||
| 100 | * | ||
| 101 | * These are requests sent 'downwards' in the stack. | ||
| 102 | * Flow ON, OFF can be indicated to the modem. | ||
| 103 | */ | ||
| 104 | enum caif_modemcmd { | ||
| 105 | CAIF_MODEMCMD_FLOW_ON_REQ = 0, | ||
| 106 | CAIF_MODEMCMD_FLOW_OFF_REQ = 1, | ||
| 107 | _CAIF_MODEMCMD_PHYIF_USEFULL = 3, | ||
| 108 | _CAIF_MODEMCMD_PHYIF_USELESS = 4 | ||
| 109 | }; | ||
| 110 | |||
| 111 | /** | ||
| 112 | * enum caif_direction - CAIF Packet Direction. | ||
| 113 | * Indicate if a packet is to be sent out or to be received in. | ||
| 114 | * @CAIF_DIR_IN: Incoming packet received. | ||
| 115 | * @CAIF_DIR_OUT: Outgoing packet to be transmitted. | ||
| 116 | */ | ||
| 117 | enum caif_direction { | ||
| 118 | CAIF_DIR_IN = 0, | ||
| 119 | CAIF_DIR_OUT = 1 | ||
| 120 | }; | ||
| 121 | |||
| 122 | /** | ||
| 123 | * struct cflayer - CAIF Stack layer. | ||
| 124 | * Defines the framework for the CAIF Core Stack. | ||
| 125 | * @up: Pointer up to the layer above. | ||
| 126 | * @dn: Pointer down to the layer below. | ||
| 127 | * @node: List node used when layer participate in a list. | ||
| 128 | * @receive: Packet receive function. | ||
| 129 | * @transmit: Packet transmit funciton. | ||
| 130 | * @ctrlcmd: Used for control signalling upwards in the stack. | ||
| 131 | * @modemcmd: Used for control signaling downwards in the stack. | ||
| 132 | * @prio: Priority of this layer. | ||
| 133 | * @id: The identity of this layer | ||
| 134 | * @type: The type of this layer | ||
| 135 | * @name: Name of the layer. | ||
| 136 | * | ||
| 137 | * This structure defines the layered structure in CAIF. | ||
| 138 | * | ||
| 139 | * It defines CAIF layering structure, used by all CAIF Layers and the | ||
| 140 | * layers interfacing CAIF. | ||
| 141 | * | ||
| 142 | * In order to integrate with CAIF an adaptation layer on top of the CAIF stack | ||
| 143 | * and PHY layer below the CAIF stack | ||
| 144 | * must be implemented. These layer must follow the design principles below. | ||
| 145 | * | ||
| 146 | * Principles for layering of protocol layers: | ||
| 147 | * - All layers must use this structure. If embedding it, then place this | ||
| 148 | * structure first in the layer specific structure. | ||
| 149 | * | ||
| 150 | * - Each layer should not depend on any others layer private data. | ||
| 151 | * | ||
| 152 | * - In order to send data upwards do | ||
| 153 | * layer->up->receive(layer->up, packet); | ||
| 154 | * | ||
| 155 | * - In order to send data downwards do | ||
| 156 | * layer->dn->transmit(layer->dn, info, packet); | ||
| 157 | */ | ||
| 158 | struct cflayer { | ||
| 159 | struct cflayer *up; | ||
| 160 | struct cflayer *dn; | ||
| 161 | struct list_head node; | ||
| 162 | |||
| 163 | /* | ||
| 164 | * receive() - Receive Function. | ||
| 165 | * Contract: Each layer must implement a receive function passing the | ||
| 166 | * CAIF packets upwards in the stack. | ||
| 167 | * Packet handling rules: | ||
| 168 | * - The CAIF packet (cfpkt) cannot be accessed after | ||
| 169 | * passing it to the next layer using up->receive(). | ||
| 170 | * - If parsing of the packet fails, the packet must be | ||
| 171 | * destroyed and -1 returned from the function. | ||
| 172 | * - If parsing succeeds (and above layers return OK) then | ||
| 173 | * the function must return a value > 0. | ||
| 174 | * | ||
| 175 | * Returns result < 0 indicates an error, 0 or positive value | ||
| 176 | * indicates success. | ||
| 177 | * | ||
| 178 | * @layr: Pointer to the current layer the receive function is | ||
| 179 | * implemented for (this pointer). | ||
| 180 | * @cfpkt: Pointer to CaifPacket to be handled. | ||
| 181 | */ | ||
| 182 | int (*receive)(struct cflayer *layr, struct cfpkt *cfpkt); | ||
| 183 | |||
| 184 | /* | ||
| 185 | * transmit() - Transmit Function. | ||
| 186 | * Contract: Each layer must implement a transmit function passing the | ||
| 187 | * CAIF packet downwards in the stack. | ||
| 188 | * Packet handling rules: | ||
| 189 | * - The CAIF packet (cfpkt) ownership is passed to the | ||
| 190 | * transmit function. This means that the the packet | ||
| 191 | * cannot be accessed after passing it to the below | ||
| 192 | * layer using dn->transmit(). | ||
| 193 | * | ||
| 194 | * - If transmit fails, however, the ownership is returned | ||
| 195 | * to thecaller. The caller of "dn->transmit()" must | ||
| 196 | * destroy or resend packet. | ||
| 197 | * | ||
| 198 | * - Return value less than zero means error, zero or | ||
| 199 | * greater than zero means OK. | ||
| 200 | * | ||
| 201 | * result < 0 indicates an error, 0 or positive value | ||
| 202 | * indicate success. | ||
| 203 | * | ||
| 204 | * @layr: Pointer to the current layer the receive function | ||
| 205 | * isimplemented for (this pointer). | ||
| 206 | * @cfpkt: Pointer to CaifPacket to be handled. | ||
| 207 | */ | ||
| 208 | int (*transmit) (struct cflayer *layr, struct cfpkt *cfpkt); | ||
| 209 | |||
| 210 | /* | ||
| 211 | * cttrlcmd() - Control Function upwards in CAIF Stack. | ||
| 212 | * Used for signaling responses (CAIF_CTRLCMD_*_RSP) | ||
| 213 | * and asynchronous events from the modem (CAIF_CTRLCMD_*_IND) | ||
| 214 | * | ||
| 215 | * @layr: Pointer to the current layer the receive function | ||
| 216 | * is implemented for (this pointer). | ||
| 217 | * @ctrl: Control Command. | ||
| 218 | */ | ||
| 219 | void (*ctrlcmd) (struct cflayer *layr, enum caif_ctrlcmd ctrl, | ||
| 220 | int phyid); | ||
| 221 | |||
| 222 | /* | ||
| 223 | * modemctrl() - Control Function used for controlling the modem. | ||
| 224 | * Used to signal down-wards in the CAIF stack. | ||
| 225 | * Returns 0 on success, < 0 upon failure. | ||
| 226 | * | ||
| 227 | * @layr: Pointer to the current layer the receive function | ||
| 228 | * is implemented for (this pointer). | ||
| 229 | * @ctrl: Control Command. | ||
| 230 | */ | ||
| 231 | int (*modemcmd) (struct cflayer *layr, enum caif_modemcmd ctrl); | ||
| 232 | |||
| 233 | unsigned short prio; | ||
| 234 | unsigned int id; | ||
| 235 | unsigned int type; | ||
| 236 | char name[CAIF_LAYER_NAME_SZ]; | ||
| 237 | }; | ||
| 238 | |||
| 239 | /** | ||
| 240 | * layer_set_up() - Set the up pointer for a specified layer. | ||
| 241 | * @layr: Layer where up pointer shall be set. | ||
| 242 | * @above: Layer above. | ||
| 243 | */ | ||
| 244 | #define layer_set_up(layr, above) ((layr)->up = (struct cflayer *)(above)) | ||
| 245 | |||
| 246 | /** | ||
| 247 | * layer_set_dn() - Set the down pointer for a specified layer. | ||
| 248 | * @layr: Layer where down pointer shall be set. | ||
| 249 | * @below: Layer below. | ||
| 250 | */ | ||
| 251 | #define layer_set_dn(layr, below) ((layr)->dn = (struct cflayer *)(below)) | ||
| 252 | |||
| 253 | /** | ||
| 254 | * struct dev_info - Physical Device info information about physical layer. | ||
| 255 | * @dev: Pointer to native physical device. | ||
| 256 | * @id: Physical ID of the physical connection used by the | ||
| 257 | * logical CAIF connection. Used by service layers to | ||
| 258 | * identify their physical id to Caif MUX (CFMUXL)so | ||
| 259 | * that the MUX can add the correct physical ID to the | ||
| 260 | * packet. | ||
| 261 | */ | ||
| 262 | struct dev_info { | ||
| 263 | void *dev; | ||
| 264 | unsigned int id; | ||
| 265 | }; | ||
| 266 | |||
| 267 | /** | ||
| 268 | * struct caif_payload_info - Payload information embedded in packet (sk_buff). | ||
| 269 | * | ||
| 270 | * @dev_info: Information about the receiving device. | ||
| 271 | * | ||
| 272 | * @hdr_len: Header length, used to align pay load on 32bit boundary. | ||
| 273 | * | ||
| 274 | * @channel_id: Channel ID of the logical CAIF connection. | ||
| 275 | * Used by mux to insert channel id into the caif packet. | ||
| 276 | */ | ||
| 277 | struct caif_payload_info { | ||
| 278 | struct dev_info *dev_info; | ||
| 279 | unsigned short hdr_len; | ||
| 280 | unsigned short channel_id; | ||
| 281 | }; | ||
| 282 | |||
| 283 | #endif /* CAIF_LAYER_H_ */ | ||
diff --git a/include/net/caif/cfcnfg.h b/include/net/caif/cfcnfg.h new file mode 100644 index 000000000000..9fc2fc20b884 --- /dev/null +++ b/include/net/caif/cfcnfg.h | |||
| @@ -0,0 +1,140 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 3 | * Author: Sjur Brendeland/sjur.brandeland@stericsson.com | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef CFCNFG_H_ | ||
| 8 | #define CFCNFG_H_ | ||
| 9 | #include <linux/spinlock.h> | ||
| 10 | #include <net/caif/caif_layer.h> | ||
| 11 | #include <net/caif/cfctrl.h> | ||
| 12 | |||
| 13 | struct cfcnfg; | ||
| 14 | |||
| 15 | /** | ||
| 16 | * enum cfcnfg_phy_type - Types of physical layers defined in CAIF Stack | ||
| 17 | * | ||
| 18 | * @CFPHYTYPE_FRAG: Fragmented frames physical interface. | ||
| 19 | * @CFPHYTYPE_CAIF: Generic CAIF physical interface | ||
| 20 | */ | ||
| 21 | enum cfcnfg_phy_type { | ||
| 22 | CFPHYTYPE_FRAG = 1, | ||
| 23 | CFPHYTYPE_CAIF, | ||
| 24 | CFPHYTYPE_MAX | ||
| 25 | }; | ||
| 26 | |||
| 27 | /** | ||
| 28 | * enum cfcnfg_phy_preference - Physical preference HW Abstraction | ||
| 29 | * | ||
| 30 | * @CFPHYPREF_UNSPECIFIED: Default physical interface | ||
| 31 | * | ||
| 32 | * @CFPHYPREF_LOW_LAT: Default physical interface for low-latency | ||
| 33 | * traffic | ||
| 34 | * @CFPHYPREF_HIGH_BW: Default physical interface for high-bandwidth | ||
| 35 | * traffic | ||
| 36 | * @CFPHYPREF_LOOP: TEST only Loopback interface simulating modem | ||
| 37 | * responses. | ||
| 38 | * | ||
| 39 | */ | ||
| 40 | enum cfcnfg_phy_preference { | ||
| 41 | CFPHYPREF_UNSPECIFIED, | ||
| 42 | CFPHYPREF_LOW_LAT, | ||
| 43 | CFPHYPREF_HIGH_BW, | ||
| 44 | CFPHYPREF_LOOP | ||
| 45 | }; | ||
| 46 | |||
| 47 | /** | ||
| 48 | * cfcnfg_create() - Create the CAIF configuration object. | ||
| 49 | */ | ||
| 50 | struct cfcnfg *cfcnfg_create(void); | ||
| 51 | |||
| 52 | /** | ||
| 53 | * cfcnfg_remove() - Remove the CFCNFG object | ||
| 54 | * @cfg: config object | ||
| 55 | */ | ||
| 56 | void cfcnfg_remove(struct cfcnfg *cfg); | ||
| 57 | |||
| 58 | /** | ||
| 59 | * cfcnfg_add_phy_layer() - Adds a physical layer to the CAIF stack. | ||
| 60 | * @cnfg: Pointer to a CAIF configuration object, created by | ||
| 61 | * cfcnfg_create(). | ||
| 62 | * @phy_type: Specifies the type of physical interface, e.g. | ||
| 63 | * CFPHYTYPE_FRAG. | ||
| 64 | * @dev: Pointer to link layer device | ||
| 65 | * @phy_layer: Specify the physical layer. The transmit function | ||
| 66 | * MUST be set in the structure. | ||
| 67 | * @phyid: The assigned physical ID for this layer, used in | ||
| 68 | * cfcnfg_add_adapt_layer to specify PHY for the link. | ||
| 69 | * @pref: The phy (link layer) preference. | ||
| 70 | * @fcs: Specify if checksum is used in CAIF Framing Layer. | ||
| 71 | * @stx: Specify if Start Of Frame eXtention is used. | ||
| 72 | */ | ||
| 73 | |||
| 74 | void | ||
| 75 | cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type, | ||
| 76 | void *dev, struct cflayer *phy_layer, u16 *phyid, | ||
| 77 | enum cfcnfg_phy_preference pref, | ||
| 78 | bool fcs, bool stx); | ||
| 79 | |||
| 80 | /** | ||
| 81 | * cfcnfg_del_phy_layer - Deletes an phy layer from the CAIF stack. | ||
| 82 | * | ||
| 83 | * @cnfg: Pointer to a CAIF configuration object, created by | ||
| 84 | * cfcnfg_create(). | ||
| 85 | * @phy_layer: Adaptation layer to be removed. | ||
| 86 | */ | ||
| 87 | int cfcnfg_del_phy_layer(struct cfcnfg *cnfg, struct cflayer *phy_layer); | ||
| 88 | |||
| 89 | /** | ||
| 90 | * cfcnfg_disconn_adapt_layer - Disconnects an adaptation layer. | ||
| 91 | * | ||
| 92 | * @cnfg: Pointer to a CAIF configuration object, created by | ||
| 93 | * cfcnfg_create(). | ||
| 94 | * @adap_layer: Adaptation layer to be removed. | ||
| 95 | */ | ||
| 96 | int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, | ||
| 97 | struct cflayer *adap_layer); | ||
| 98 | |||
| 99 | /** | ||
| 100 | * cfcnfg_release_adap_layer - Used by client to release the adaptation layer. | ||
| 101 | * | ||
| 102 | * @adap_layer: Adaptation layer. | ||
| 103 | */ | ||
| 104 | void cfcnfg_release_adap_layer(struct cflayer *adap_layer); | ||
| 105 | |||
| 106 | /** | ||
| 107 | * cfcnfg_add_adaptation_layer - Add an adaptation layer to the CAIF stack. | ||
| 108 | * | ||
| 109 | * The adaptation Layer is where the interface to application or higher-level | ||
| 110 | * driver functionality is implemented. | ||
| 111 | * | ||
| 112 | * @cnfg: Pointer to a CAIF configuration object, created by | ||
| 113 | * cfcnfg_create(). | ||
| 114 | * @param: Link setup parameters. | ||
| 115 | * @adap_layer: Specify the adaptation layer; the receive and | ||
| 116 | * flow-control functions MUST be set in the structure. | ||
| 117 | * | ||
| 118 | */ | ||
| 119 | int cfcnfg_add_adaptation_layer(struct cfcnfg *cnfg, | ||
| 120 | struct cfctrl_link_param *param, | ||
| 121 | struct cflayer *adap_layer); | ||
| 122 | |||
| 123 | /** | ||
| 124 | * cfcnfg_get_phyid() - Get physical ID, given type. | ||
| 125 | * Returns one of the physical interfaces matching the given type. | ||
| 126 | * Zero if no match is found. | ||
| 127 | * @cnfg: Configuration object | ||
| 128 | * @phy_pref: Caif Link Layer preference | ||
| 129 | */ | ||
| 130 | struct dev_info *cfcnfg_get_phyid(struct cfcnfg *cnfg, | ||
| 131 | enum cfcnfg_phy_preference phy_pref); | ||
| 132 | |||
| 133 | /** | ||
| 134 | * cfcnfg_get_named() - Get the Physical Identifier of CAIF Link Layer | ||
| 135 | * @cnfg: Configuration object | ||
| 136 | * @name: Name of the Physical Layer (Caif Link Layer) | ||
| 137 | */ | ||
| 138 | int cfcnfg_get_named(struct cfcnfg *cnfg, char *name); | ||
| 139 | |||
| 140 | #endif /* CFCNFG_H_ */ | ||
diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h new file mode 100644 index 000000000000..997603f2bf4c --- /dev/null +++ b/include/net/caif/cfctrl.h | |||
| @@ -0,0 +1,139 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 3 | * Author: Sjur Brendeland/sjur.brandeland@stericsson.com | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef CFCTRL_H_ | ||
| 8 | #define CFCTRL_H_ | ||
| 9 | #include <net/caif/caif_layer.h> | ||
| 10 | #include <net/caif/cfsrvl.h> | ||
| 11 | |||
| 12 | /* CAIF Control packet commands */ | ||
| 13 | enum cfctrl_cmd { | ||
| 14 | CFCTRL_CMD_LINK_SETUP = 0, | ||
| 15 | CFCTRL_CMD_LINK_DESTROY = 1, | ||
| 16 | CFCTRL_CMD_LINK_ERR = 2, | ||
| 17 | CFCTRL_CMD_ENUM = 3, | ||
| 18 | CFCTRL_CMD_SLEEP = 4, | ||
| 19 | CFCTRL_CMD_WAKE = 5, | ||
| 20 | CFCTRL_CMD_LINK_RECONF = 6, | ||
| 21 | CFCTRL_CMD_START_REASON = 7, | ||
| 22 | CFCTRL_CMD_RADIO_SET = 8, | ||
| 23 | CFCTRL_CMD_MODEM_SET = 9, | ||
| 24 | CFCTRL_CMD_MASK = 0xf | ||
| 25 | }; | ||
| 26 | |||
| 27 | /* Channel types */ | ||
| 28 | enum cfctrl_srv { | ||
| 29 | CFCTRL_SRV_DECM = 0, | ||
| 30 | CFCTRL_SRV_VEI = 1, | ||
| 31 | CFCTRL_SRV_VIDEO = 2, | ||
| 32 | CFCTRL_SRV_DBG = 3, | ||
| 33 | CFCTRL_SRV_DATAGRAM = 4, | ||
| 34 | CFCTRL_SRV_RFM = 5, | ||
| 35 | CFCTRL_SRV_UTIL = 6, | ||
| 36 | CFCTRL_SRV_MASK = 0xf | ||
| 37 | }; | ||
| 38 | |||
| 39 | #define CFCTRL_RSP_BIT 0x20 | ||
| 40 | #define CFCTRL_ERR_BIT 0x10 | ||
| 41 | |||
| 42 | struct cfctrl_rsp { | ||
| 43 | void (*linksetup_rsp)(struct cflayer *layer, u8 linkid, | ||
| 44 | enum cfctrl_srv serv, u8 phyid, | ||
| 45 | struct cflayer *adapt_layer); | ||
| 46 | void (*linkdestroy_rsp)(struct cflayer *layer, u8 linkid); | ||
| 47 | void (*linkerror_ind)(void); | ||
| 48 | void (*enum_rsp)(void); | ||
| 49 | void (*sleep_rsp)(void); | ||
| 50 | void (*wake_rsp)(void); | ||
| 51 | void (*restart_rsp)(void); | ||
| 52 | void (*radioset_rsp)(void); | ||
| 53 | void (*reject_rsp)(struct cflayer *layer, u8 linkid, | ||
| 54 | struct cflayer *client_layer);; | ||
| 55 | }; | ||
| 56 | |||
| 57 | /* Link Setup Parameters for CAIF-Links. */ | ||
| 58 | struct cfctrl_link_param { | ||
| 59 | enum cfctrl_srv linktype;/* (T3,T0) Type of Channel */ | ||
| 60 | u8 priority; /* (P4,P0) Priority of the channel */ | ||
| 61 | u8 phyid; /* (U2-U0) Physical interface to connect */ | ||
| 62 | u8 endpoint; /* (E1,E0) Endpoint for data channels */ | ||
| 63 | u8 chtype; /* (H1,H0) Channel-Type, applies to | ||
| 64 | * VEI, DEBUG */ | ||
| 65 | union { | ||
| 66 | struct { | ||
| 67 | u8 connid; /* (D7,D0) Video LinkId */ | ||
| 68 | } video; | ||
| 69 | |||
| 70 | struct { | ||
| 71 | u32 connid; /* (N31,Ngit0) Connection ID used | ||
| 72 | * for Datagram */ | ||
| 73 | } datagram; | ||
| 74 | |||
| 75 | struct { | ||
| 76 | u32 connid; /* Connection ID used for RFM */ | ||
| 77 | char volume[20]; /* Volume to mount for RFM */ | ||
| 78 | } rfm; /* Configuration for RFM */ | ||
| 79 | |||
| 80 | struct { | ||
| 81 | u16 fifosize_kb; /* Psock FIFO size in KB */ | ||
| 82 | u16 fifosize_bufs; /* Psock # signal buffers */ | ||
| 83 | char name[16]; /* Name of the PSOCK service */ | ||
| 84 | u8 params[255]; /* Link setup Parameters> */ | ||
| 85 | u16 paramlen; /* Length of Link Setup | ||
| 86 | * Parameters */ | ||
| 87 | } utility; /* Configuration for Utility Links (Psock) */ | ||
| 88 | } u; | ||
| 89 | }; | ||
| 90 | |||
| 91 | /* This structure is used internally in CFCTRL */ | ||
| 92 | struct cfctrl_request_info { | ||
| 93 | int sequence_no; | ||
| 94 | enum cfctrl_cmd cmd; | ||
| 95 | u8 channel_id; | ||
| 96 | struct cfctrl_link_param param; | ||
| 97 | struct cfctrl_request_info *next; | ||
| 98 | struct cflayer *client_layer; | ||
| 99 | }; | ||
| 100 | |||
| 101 | struct cfctrl { | ||
| 102 | struct cfsrvl serv; | ||
| 103 | struct cfctrl_rsp res; | ||
| 104 | atomic_t req_seq_no; | ||
| 105 | atomic_t rsp_seq_no; | ||
| 106 | struct cfctrl_request_info *first_req; | ||
| 107 | /* Protects from simultaneous access to first_req list */ | ||
| 108 | spinlock_t info_list_lock; | ||
| 109 | #ifndef CAIF_NO_LOOP | ||
| 110 | u8 loop_linkid; | ||
| 111 | int loop_linkused[256]; | ||
| 112 | /* Protects simultaneous access to loop_linkid and loop_linkused */ | ||
| 113 | spinlock_t loop_linkid_lock; | ||
| 114 | #endif | ||
| 115 | |||
| 116 | }; | ||
| 117 | |||
| 118 | void cfctrl_enum_req(struct cflayer *cfctrl, u8 physlinkid); | ||
| 119 | int cfctrl_linkup_request(struct cflayer *cfctrl, | ||
| 120 | struct cfctrl_link_param *param, | ||
| 121 | struct cflayer *user_layer); | ||
| 122 | int cfctrl_linkdown_req(struct cflayer *cfctrl, u8 linkid, | ||
| 123 | struct cflayer *client); | ||
| 124 | void cfctrl_sleep_req(struct cflayer *cfctrl); | ||
| 125 | void cfctrl_wake_req(struct cflayer *cfctrl); | ||
| 126 | void cfctrl_getstartreason_req(struct cflayer *cfctrl); | ||
| 127 | struct cflayer *cfctrl_create(void); | ||
| 128 | void cfctrl_set_dnlayer(struct cflayer *this, struct cflayer *dn); | ||
| 129 | void cfctrl_set_uplayer(struct cflayer *this, struct cflayer *up); | ||
| 130 | struct cfctrl_rsp *cfctrl_get_respfuncs(struct cflayer *layer); | ||
| 131 | bool cfctrl_req_eq(struct cfctrl_request_info *r1, | ||
| 132 | struct cfctrl_request_info *r2); | ||
| 133 | void cfctrl_insert_req(struct cfctrl *ctrl, | ||
| 134 | struct cfctrl_request_info *req); | ||
| 135 | struct cfctrl_request_info *cfctrl_remove_req(struct cfctrl *ctrl, | ||
| 136 | struct cfctrl_request_info *req); | ||
| 137 | void cfctrl_cancel_req(struct cflayer *layr, struct cflayer *adap_layer); | ||
| 138 | |||
| 139 | #endif /* CFCTRL_H_ */ | ||
diff --git a/include/net/caif/cffrml.h b/include/net/caif/cffrml.h new file mode 100644 index 000000000000..3f14d2e1ce61 --- /dev/null +++ b/include/net/caif/cffrml.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 3 | * Author: Sjur Brendeland/sjur.brandeland@stericsson.com | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef CFFRML_H_ | ||
| 8 | #define CFFRML_H_ | ||
| 9 | #include <net/caif/caif_layer.h> | ||
| 10 | |||
| 11 | struct cffrml; | ||
| 12 | struct cflayer *cffrml_create(u16 phyid, bool DoFCS); | ||
| 13 | void cffrml_set_uplayer(struct cflayer *this, struct cflayer *up); | ||
| 14 | void cffrml_set_dnlayer(struct cflayer *this, struct cflayer *dn); | ||
| 15 | |||
| 16 | #endif /* CFFRML_H_ */ | ||
diff --git a/include/net/caif/cfmuxl.h b/include/net/caif/cfmuxl.h new file mode 100644 index 000000000000..4e1b4f33423e --- /dev/null +++ b/include/net/caif/cfmuxl.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 3 | * Author: Sjur Brendeland/sjur.brandeland@stericsson.com | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef CFMUXL_H_ | ||
| 8 | #define CFMUXL_H_ | ||
| 9 | #include <net/caif/caif_layer.h> | ||
| 10 | |||
| 11 | struct cfsrvl; | ||
| 12 | struct cffrml; | ||
| 13 | |||
| 14 | struct cflayer *cfmuxl_create(void); | ||
| 15 | int cfmuxl_set_uplayer(struct cflayer *layr, struct cflayer *up, u8 linkid); | ||
| 16 | struct cflayer *cfmuxl_remove_dnlayer(struct cflayer *layr, u8 phyid); | ||
| 17 | int cfmuxl_set_dnlayer(struct cflayer *layr, struct cflayer *up, u8 phyid); | ||
| 18 | struct cflayer *cfmuxl_remove_uplayer(struct cflayer *layr, u8 linkid); | ||
| 19 | bool cfmuxl_is_phy_inuse(struct cflayer *layr, u8 phyid); | ||
| 20 | u8 cfmuxl_get_phyid(struct cflayer *layr, u8 channel_id); | ||
| 21 | |||
| 22 | #endif /* CFMUXL_H_ */ | ||
diff --git a/include/net/caif/cfpkt.h b/include/net/caif/cfpkt.h new file mode 100644 index 000000000000..fbc681beff52 --- /dev/null +++ b/include/net/caif/cfpkt.h | |||
| @@ -0,0 +1,274 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 3 | * Author: Sjur Brendeland/sjur.brandeland@stericsson.com | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef CFPKT_H_ | ||
| 8 | #define CFPKT_H_ | ||
| 9 | #include <net/caif/caif_layer.h> | ||
| 10 | #include <linux/types.h> | ||
| 11 | struct cfpkt; | ||
| 12 | |||
| 13 | /* Create a CAIF packet. | ||
| 14 | * len: Length of packet to be created | ||
| 15 | * @return New packet. | ||
| 16 | */ | ||
| 17 | struct cfpkt *cfpkt_create(u16 len); | ||
| 18 | |||
| 19 | /* Create a CAIF packet. | ||
| 20 | * data Data to copy. | ||
| 21 | * len Length of packet to be created | ||
| 22 | * @return New packet. | ||
| 23 | */ | ||
| 24 | struct cfpkt *cfpkt_create_uplink(const unsigned char *data, unsigned int len); | ||
| 25 | /* | ||
| 26 | * Destroy a CAIF Packet. | ||
| 27 | * pkt Packet to be destoyed. | ||
| 28 | */ | ||
| 29 | void cfpkt_destroy(struct cfpkt *pkt); | ||
| 30 | |||
| 31 | /* | ||
| 32 | * Extract header from packet. | ||
| 33 | * | ||
| 34 | * pkt Packet to extract header data from. | ||
| 35 | * data Pointer to copy the header data into. | ||
| 36 | * len Length of head data to copy. | ||
| 37 | * @return zero on success and error code upon failure | ||
| 38 | */ | ||
| 39 | int cfpkt_extr_head(struct cfpkt *pkt, void *data, u16 len); | ||
| 40 | |||
| 41 | /* | ||
| 42 | * Peek header from packet. | ||
| 43 | * Reads data from packet without changing packet. | ||
| 44 | * | ||
| 45 | * pkt Packet to extract header data from. | ||
| 46 | * data Pointer to copy the header data into. | ||
| 47 | * len Length of head data to copy. | ||
| 48 | * @return zero on success and error code upon failure | ||
| 49 | */ | ||
| 50 | int cfpkt_peek_head(struct cfpkt *pkt, void *data, u16 len); | ||
| 51 | |||
| 52 | /* | ||
| 53 | * Extract header from trailer (end of packet). | ||
| 54 | * | ||
| 55 | * pkt Packet to extract header data from. | ||
| 56 | * data Pointer to copy the trailer data into. | ||
| 57 | * len Length of header data to copy. | ||
| 58 | * @return zero on success and error code upon failure | ||
| 59 | */ | ||
| 60 | int cfpkt_extr_trail(struct cfpkt *pkt, void *data, u16 len); | ||
| 61 | |||
| 62 | /* | ||
| 63 | * Add header to packet. | ||
| 64 | * | ||
| 65 | * | ||
| 66 | * pkt Packet to add header data to. | ||
| 67 | * data Pointer to data to copy into the header. | ||
| 68 | * len Length of header data to copy. | ||
| 69 | * @return zero on success and error code upon failure | ||
| 70 | */ | ||
| 71 | int cfpkt_add_head(struct cfpkt *pkt, const void *data, u16 len); | ||
| 72 | |||
| 73 | /* | ||
| 74 | * Add trailer to packet. | ||
| 75 | * | ||
| 76 | * | ||
| 77 | * pkt Packet to add trailer data to. | ||
| 78 | * data Pointer to data to copy into the trailer. | ||
| 79 | * len Length of trailer data to copy. | ||
| 80 | * @return zero on success and error code upon failure | ||
| 81 | */ | ||
| 82 | int cfpkt_add_trail(struct cfpkt *pkt, const void *data, u16 len); | ||
| 83 | |||
| 84 | /* | ||
| 85 | * Pad trailer on packet. | ||
| 86 | * Moves data pointer in packet, no content copied. | ||
| 87 | * | ||
| 88 | * pkt Packet in which to pad trailer. | ||
| 89 | * len Length of padding to add. | ||
| 90 | * @return zero on success and error code upon failure | ||
| 91 | */ | ||
| 92 | int cfpkt_pad_trail(struct cfpkt *pkt, u16 len); | ||
| 93 | |||
| 94 | /* | ||
| 95 | * Add a single byte to packet body (tail). | ||
| 96 | * | ||
| 97 | * pkt Packet in which to add byte. | ||
| 98 | * data Byte to add. | ||
| 99 | * @return zero on success and error code upon failure | ||
| 100 | */ | ||
| 101 | int cfpkt_addbdy(struct cfpkt *pkt, const u8 data); | ||
| 102 | |||
| 103 | /* | ||
| 104 | * Add a data to packet body (tail). | ||
| 105 | * | ||
| 106 | * pkt Packet in which to add data. | ||
| 107 | * data Pointer to data to copy into the packet body. | ||
| 108 | * len Length of data to add. | ||
| 109 | * @return zero on success and error code upon failure | ||
| 110 | */ | ||
| 111 | int cfpkt_add_body(struct cfpkt *pkt, const void *data, u16 len); | ||
| 112 | |||
| 113 | /* | ||
| 114 | * Checks whether there are more data to process in packet. | ||
| 115 | * pkt Packet to check. | ||
| 116 | * @return true if more data are available in packet false otherwise | ||
| 117 | */ | ||
| 118 | bool cfpkt_more(struct cfpkt *pkt); | ||
| 119 | |||
| 120 | /* | ||
| 121 | * Checks whether the packet is erroneous, | ||
| 122 | * i.e. if it has been attempted to extract more data than available in packet | ||
| 123 | * or writing more data than has been allocated in cfpkt_create(). | ||
| 124 | * pkt Packet to check. | ||
| 125 | * @return true on error false otherwise | ||
| 126 | */ | ||
| 127 | bool cfpkt_erroneous(struct cfpkt *pkt); | ||
| 128 | |||
| 129 | /* | ||
| 130 | * Get the packet length. | ||
| 131 | * pkt Packet to get length from. | ||
| 132 | * @return Number of bytes in packet. | ||
| 133 | */ | ||
| 134 | u16 cfpkt_getlen(struct cfpkt *pkt); | ||
| 135 | |||
| 136 | /* | ||
| 137 | * Set the packet length, by adjusting the trailer pointer according to length. | ||
| 138 | * pkt Packet to set length. | ||
| 139 | * len Packet length. | ||
| 140 | * @return Number of bytes in packet. | ||
| 141 | */ | ||
| 142 | int cfpkt_setlen(struct cfpkt *pkt, u16 len); | ||
| 143 | |||
| 144 | /* | ||
| 145 | * cfpkt_append - Appends a packet's data to another packet. | ||
| 146 | * dstpkt: Packet to append data into, WILL BE FREED BY THIS FUNCTION | ||
| 147 | * addpkt: Packet to be appended and automatically released, | ||
| 148 | * WILL BE FREED BY THIS FUNCTION. | ||
| 149 | * expectlen: Packet's expected total length. This should be considered | ||
| 150 | * as a hint. | ||
| 151 | * NB: Input packets will be destroyed after appending and cannot be used | ||
| 152 | * after calling this function. | ||
| 153 | * @return The new appended packet. | ||
| 154 | */ | ||
| 155 | struct cfpkt *cfpkt_append(struct cfpkt *dstpkt, struct cfpkt *addpkt, | ||
| 156 | u16 expectlen); | ||
| 157 | |||
| 158 | /* | ||
| 159 | * cfpkt_split - Split a packet into two packets at the specified split point. | ||
| 160 | * pkt: Packet to be split (will contain the first part of the data on exit) | ||
| 161 | * pos: Position to split packet in two parts. | ||
| 162 | * @return The new packet, containing the second part of the data. | ||
| 163 | */ | ||
| 164 | struct cfpkt *cfpkt_split(struct cfpkt *pkt, u16 pos); | ||
| 165 | |||
| 166 | /* | ||
| 167 | * Iteration function, iterates the packet buffers from start to end. | ||
| 168 | * | ||
| 169 | * Checksum iteration function used to iterate buffers | ||
| 170 | * (we may have packets consisting of a chain of buffers) | ||
| 171 | * pkt: Packet to calculate checksum for | ||
| 172 | * iter_func: Function pointer to iteration function | ||
| 173 | * chks: Checksum calculated so far. | ||
| 174 | * buf: Pointer to the buffer to checksum | ||
| 175 | * len: Length of buf. | ||
| 176 | * data: Initial checksum value. | ||
| 177 | * @return Checksum of buffer. | ||
| 178 | */ | ||
| 179 | |||
| 180 | u16 cfpkt_iterate(struct cfpkt *pkt, | ||
| 181 | u16 (*iter_func)(u16 chks, void *buf, u16 len), | ||
| 182 | u16 data); | ||
| 183 | |||
| 184 | /* Append by giving user access to packet buffer | ||
| 185 | * cfpkt Packet to append to | ||
| 186 | * buf Buffer inside pkt that user shall copy data into | ||
| 187 | * buflen Length of buffer and number of bytes added to packet | ||
| 188 | * @return 0 on error, 1 on success | ||
| 189 | */ | ||
| 190 | int cfpkt_raw_append(struct cfpkt *cfpkt, void **buf, unsigned int buflen); | ||
| 191 | |||
| 192 | /* Extract by giving user access to packet buffer | ||
| 193 | * cfpkt Packet to extract from | ||
| 194 | * buf Buffer inside pkt that user shall copy data from | ||
| 195 | * buflen Length of buffer and number of bytes removed from packet | ||
| 196 | * @return 0 on error, 1 on success | ||
| 197 | */ | ||
| 198 | int cfpkt_raw_extract(struct cfpkt *cfpkt, void **buf, unsigned int buflen); | ||
| 199 | |||
| 200 | /* Map from a "native" packet (e.g. Linux Socket Buffer) to a CAIF packet. | ||
| 201 | * dir - Direction indicating whether this packet is to be sent or received. | ||
| 202 | * nativepkt - The native packet to be transformed to a CAIF packet | ||
| 203 | * @return The mapped CAIF Packet CFPKT. | ||
| 204 | */ | ||
| 205 | struct cfpkt *cfpkt_fromnative(enum caif_direction dir, void *nativepkt); | ||
| 206 | |||
| 207 | /* Map from a CAIF packet to a "native" packet (e.g. Linux Socket Buffer). | ||
| 208 | * pkt - The CAIF packet to be transformed into a "native" packet. | ||
| 209 | * @return The native packet transformed from a CAIF packet. | ||
| 210 | */ | ||
| 211 | void *cfpkt_tonative(struct cfpkt *pkt); | ||
| 212 | |||
| 213 | /* | ||
| 214 | * Insert a packet in the packet queue. | ||
| 215 | * pktq Packet queue to insert into | ||
| 216 | * pkt Packet to be inserted in queue | ||
| 217 | * prio Priority of packet | ||
| 218 | */ | ||
| 219 | void cfpkt_queue(struct cfpktq *pktq, struct cfpkt *pkt, | ||
| 220 | unsigned short prio); | ||
| 221 | |||
| 222 | /* | ||
| 223 | * Remove a packet from the packet queue. | ||
| 224 | * pktq Packet queue to fetch packets from. | ||
| 225 | * @return Dequeued packet. | ||
| 226 | */ | ||
| 227 | struct cfpkt *cfpkt_dequeue(struct cfpktq *pktq); | ||
| 228 | |||
| 229 | /* | ||
| 230 | * Peek into a packet from the packet queue. | ||
| 231 | * pktq Packet queue to fetch packets from. | ||
| 232 | * @return Peeked packet. | ||
| 233 | */ | ||
| 234 | struct cfpkt *cfpkt_qpeek(struct cfpktq *pktq); | ||
| 235 | |||
| 236 | /* | ||
| 237 | * Initiates the packet queue. | ||
| 238 | * @return Pointer to new packet queue. | ||
| 239 | */ | ||
| 240 | struct cfpktq *cfpktq_create(void); | ||
| 241 | |||
| 242 | /* | ||
| 243 | * Get the number of packets in the queue. | ||
| 244 | * pktq Packet queue to fetch count from. | ||
| 245 | * @return Number of packets in queue. | ||
| 246 | */ | ||
| 247 | int cfpkt_qcount(struct cfpktq *pktq); | ||
| 248 | |||
| 249 | /* | ||
| 250 | * Put content of packet into buffer for debuging purposes. | ||
| 251 | * pkt Packet to copy data from | ||
| 252 | * buf Buffer to copy data into | ||
| 253 | * buflen Length of data to copy | ||
| 254 | * @return Pointer to copied data | ||
| 255 | */ | ||
| 256 | char *cfpkt_log_pkt(struct cfpkt *pkt, char *buf, int buflen); | ||
| 257 | |||
| 258 | /* | ||
| 259 | * Clones a packet and releases the original packet. | ||
| 260 | * This is used for taking ownership of a packet e.g queueing. | ||
| 261 | * pkt Packet to clone and release. | ||
| 262 | * @return Cloned packet. | ||
| 263 | */ | ||
| 264 | struct cfpkt *cfpkt_clone_release(struct cfpkt *pkt); | ||
| 265 | |||
| 266 | |||
| 267 | /* | ||
| 268 | * Returns packet information for a packet. | ||
| 269 | * pkt Packet to get info from; | ||
| 270 | * @return Packet information | ||
| 271 | */ | ||
| 272 | struct caif_payload_info *cfpkt_info(struct cfpkt *pkt); | ||
| 273 | /*! @} */ | ||
| 274 | #endif /* CFPKT_H_ */ | ||
diff --git a/include/net/caif/cfserl.h b/include/net/caif/cfserl.h new file mode 100644 index 000000000000..b8374321b362 --- /dev/null +++ b/include/net/caif/cfserl.h | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 3 | * Author: Sjur Brendeland/sjur.brandeland@stericsson.com | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef CFSERL_H_ | ||
| 8 | #define CFSERL_H_ | ||
| 9 | #include <net/caif/caif_layer.h> | ||
| 10 | |||
| 11 | struct cflayer *cfserl_create(int type, int instance, bool use_stx); | ||
| 12 | #endif /* CFSERL_H_ */ | ||
diff --git a/include/net/caif/cfsrvl.h b/include/net/caif/cfsrvl.h new file mode 100644 index 000000000000..2dc9eb193ecf --- /dev/null +++ b/include/net/caif/cfsrvl.h | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson AB 2010 | ||
| 3 | * Author: Sjur Brendeland/sjur.brandeland@stericsson.com | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef CFSRVL_H_ | ||
| 8 | #define CFSRVL_H_ | ||
| 9 | #include <linux/list.h> | ||
| 10 | #include <linux/stddef.h> | ||
| 11 | #include <linux/types.h> | ||
| 12 | #include <linux/kref.h> | ||
| 13 | |||
| 14 | struct cfsrvl { | ||
| 15 | struct cflayer layer; | ||
| 16 | bool open; | ||
| 17 | bool phy_flow_on; | ||
| 18 | bool modem_flow_on; | ||
| 19 | struct dev_info dev_info; | ||
| 20 | struct kref ref; | ||
| 21 | }; | ||
| 22 | |||
| 23 | void cfsrvl_release(struct kref *kref); | ||
| 24 | struct cflayer *cfvei_create(u8 linkid, struct dev_info *dev_info); | ||
| 25 | struct cflayer *cfdgml_create(u8 linkid, struct dev_info *dev_info); | ||
| 26 | struct cflayer *cfutill_create(u8 linkid, struct dev_info *dev_info); | ||
| 27 | struct cflayer *cfvidl_create(u8 linkid, struct dev_info *dev_info); | ||
| 28 | struct cflayer *cfrfml_create(u8 linkid, struct dev_info *dev_info); | ||
| 29 | struct cflayer *cfdbgl_create(u8 linkid, struct dev_info *dev_info); | ||
| 30 | bool cfsrvl_phyid_match(struct cflayer *layer, int phyid); | ||
| 31 | void cfservl_destroy(struct cflayer *layer); | ||
| 32 | void cfsrvl_init(struct cfsrvl *service, | ||
| 33 | u8 channel_id, | ||
| 34 | struct dev_info *dev_info); | ||
| 35 | bool cfsrvl_ready(struct cfsrvl *service, int *err); | ||
| 36 | u8 cfsrvl_getphyid(struct cflayer *layer); | ||
| 37 | |||
| 38 | static inline void cfsrvl_get(struct cflayer *layr) | ||
| 39 | { | ||
| 40 | struct cfsrvl *s; | ||
| 41 | if (layr == NULL) | ||
| 42 | return; | ||
| 43 | s = container_of(layr, struct cfsrvl, layer); | ||
| 44 | kref_get(&s->ref); | ||
| 45 | } | ||
| 46 | |||
| 47 | static inline void cfsrvl_put(struct cflayer *layr) | ||
| 48 | { | ||
| 49 | struct cfsrvl *s; | ||
| 50 | if (layr == NULL) | ||
| 51 | return; | ||
| 52 | s = container_of(layr, struct cfsrvl, layer); | ||
| 53 | kref_put(&s->ref, cfsrvl_release); | ||
| 54 | } | ||
| 55 | |||
| 56 | #endif /* CFSRVL_H_ */ | ||
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 3d134a1fb96b..b44a2e5321a3 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
| @@ -511,6 +511,7 @@ struct mpath_info { | |||
| 511 | * @basic_rates: basic rates in IEEE 802.11 format | 511 | * @basic_rates: basic rates in IEEE 802.11 format |
| 512 | * (or NULL for no change) | 512 | * (or NULL for no change) |
| 513 | * @basic_rates_len: number of basic rates | 513 | * @basic_rates_len: number of basic rates |
| 514 | * @ap_isolate: do not forward packets between connected stations | ||
| 514 | */ | 515 | */ |
| 515 | struct bss_parameters { | 516 | struct bss_parameters { |
| 516 | int use_cts_prot; | 517 | int use_cts_prot; |
| @@ -518,6 +519,7 @@ struct bss_parameters { | |||
| 518 | int use_short_slot_time; | 519 | int use_short_slot_time; |
| 519 | u8 *basic_rates; | 520 | u8 *basic_rates; |
| 520 | u8 basic_rates_len; | 521 | u8 basic_rates_len; |
| 522 | int ap_isolate; | ||
| 521 | }; | 523 | }; |
| 522 | 524 | ||
| 523 | struct mesh_config { | 525 | struct mesh_config { |
| @@ -704,6 +706,10 @@ struct cfg80211_crypto_settings { | |||
| 704 | * @key_len: length of WEP key for shared key authentication | 706 | * @key_len: length of WEP key for shared key authentication |
| 705 | * @key_idx: index of WEP key for shared key authentication | 707 | * @key_idx: index of WEP key for shared key authentication |
| 706 | * @key: WEP key for shared key authentication | 708 | * @key: WEP key for shared key authentication |
| 709 | * @local_state_change: This is a request for a local state only, i.e., no | ||
| 710 | * Authentication frame is to be transmitted and authentication state is | ||
| 711 | * to be changed without having to wait for a response from the peer STA | ||
| 712 | * (AP). | ||
| 707 | */ | 713 | */ |
| 708 | struct cfg80211_auth_request { | 714 | struct cfg80211_auth_request { |
| 709 | struct cfg80211_bss *bss; | 715 | struct cfg80211_bss *bss; |
| @@ -712,6 +718,7 @@ struct cfg80211_auth_request { | |||
| 712 | enum nl80211_auth_type auth_type; | 718 | enum nl80211_auth_type auth_type; |
| 713 | const u8 *key; | 719 | const u8 *key; |
| 714 | u8 key_len, key_idx; | 720 | u8 key_len, key_idx; |
| 721 | bool local_state_change; | ||
| 715 | }; | 722 | }; |
| 716 | 723 | ||
| 717 | /** | 724 | /** |
| @@ -744,12 +751,15 @@ struct cfg80211_assoc_request { | |||
| 744 | * @ie: Extra IEs to add to Deauthentication frame or %NULL | 751 | * @ie: Extra IEs to add to Deauthentication frame or %NULL |
| 745 | * @ie_len: Length of ie buffer in octets | 752 | * @ie_len: Length of ie buffer in octets |
| 746 | * @reason_code: The reason code for the deauthentication | 753 | * @reason_code: The reason code for the deauthentication |
| 754 | * @local_state_change: This is a request for a local state only, i.e., no | ||
| 755 | * Deauthentication frame is to be transmitted. | ||
| 747 | */ | 756 | */ |
| 748 | struct cfg80211_deauth_request { | 757 | struct cfg80211_deauth_request { |
| 749 | struct cfg80211_bss *bss; | 758 | struct cfg80211_bss *bss; |
| 750 | const u8 *ie; | 759 | const u8 *ie; |
| 751 | size_t ie_len; | 760 | size_t ie_len; |
| 752 | u16 reason_code; | 761 | u16 reason_code; |
| 762 | bool local_state_change; | ||
| 753 | }; | 763 | }; |
| 754 | 764 | ||
| 755 | /** | 765 | /** |
| @@ -762,12 +772,15 @@ struct cfg80211_deauth_request { | |||
| 762 | * @ie: Extra IEs to add to Disassociation frame or %NULL | 772 | * @ie: Extra IEs to add to Disassociation frame or %NULL |
| 763 | * @ie_len: Length of ie buffer in octets | 773 | * @ie_len: Length of ie buffer in octets |
| 764 | * @reason_code: The reason code for the disassociation | 774 | * @reason_code: The reason code for the disassociation |
| 775 | * @local_state_change: This is a request for a local state only, i.e., no | ||
| 776 | * Disassociation frame is to be transmitted. | ||
| 765 | */ | 777 | */ |
| 766 | struct cfg80211_disassoc_request { | 778 | struct cfg80211_disassoc_request { |
| 767 | struct cfg80211_bss *bss; | 779 | struct cfg80211_bss *bss; |
| 768 | const u8 *ie; | 780 | const u8 *ie; |
| 769 | size_t ie_len; | 781 | size_t ie_len; |
| 770 | u16 reason_code; | 782 | u16 reason_code; |
| 783 | bool local_state_change; | ||
| 771 | }; | 784 | }; |
| 772 | 785 | ||
| 773 | /** | 786 | /** |
| @@ -953,7 +966,11 @@ struct cfg80211_pmksa { | |||
| 953 | * | 966 | * |
| 954 | * @set_txq_params: Set TX queue parameters | 967 | * @set_txq_params: Set TX queue parameters |
| 955 | * | 968 | * |
| 956 | * @set_channel: Set channel | 969 | * @set_channel: Set channel for a given wireless interface. Some devices |
| 970 | * may support multi-channel operation (by channel hopping) so cfg80211 | ||
| 971 | * doesn't verify much. Note, however, that the passed netdev may be | ||
| 972 | * %NULL as well if the user requested changing the channel for the | ||
| 973 | * device itself, or for a monitor interface. | ||
| 957 | * | 974 | * |
| 958 | * @scan: Request to do a scan. If returning zero, the scan request is given | 975 | * @scan: Request to do a scan. If returning zero, the scan request is given |
| 959 | * the driver, and will be valid until passed to cfg80211_scan_done(). | 976 | * the driver, and will be valid until passed to cfg80211_scan_done(). |
| @@ -1007,6 +1024,9 @@ struct cfg80211_pmksa { | |||
| 1007 | * RSN IE. It allows for faster roaming between WPA2 BSSIDs. | 1024 | * RSN IE. It allows for faster roaming between WPA2 BSSIDs. |
| 1008 | * @del_pmksa: Delete a cached PMKID. | 1025 | * @del_pmksa: Delete a cached PMKID. |
| 1009 | * @flush_pmksa: Flush all cached PMKIDs. | 1026 | * @flush_pmksa: Flush all cached PMKIDs. |
| 1027 | * @set_power_mgmt: Configure WLAN power management. A timeout value of -1 | ||
| 1028 | * allows the driver to adjust the dynamic ps timeout value. | ||
| 1029 | * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. | ||
| 1010 | * | 1030 | * |
| 1011 | */ | 1031 | */ |
| 1012 | struct cfg80211_ops { | 1032 | struct cfg80211_ops { |
| @@ -1079,7 +1099,7 @@ struct cfg80211_ops { | |||
| 1079 | int (*set_txq_params)(struct wiphy *wiphy, | 1099 | int (*set_txq_params)(struct wiphy *wiphy, |
| 1080 | struct ieee80211_txq_params *params); | 1100 | struct ieee80211_txq_params *params); |
| 1081 | 1101 | ||
| 1082 | int (*set_channel)(struct wiphy *wiphy, | 1102 | int (*set_channel)(struct wiphy *wiphy, struct net_device *dev, |
| 1083 | struct ieee80211_channel *chan, | 1103 | struct ieee80211_channel *chan, |
| 1084 | enum nl80211_channel_type channel_type); | 1104 | enum nl80211_channel_type channel_type); |
| 1085 | 1105 | ||
| @@ -1152,6 +1172,10 @@ struct cfg80211_ops { | |||
| 1152 | 1172 | ||
| 1153 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 1173 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
| 1154 | bool enabled, int timeout); | 1174 | bool enabled, int timeout); |
| 1175 | |||
| 1176 | int (*set_cqm_rssi_config)(struct wiphy *wiphy, | ||
| 1177 | struct net_device *dev, | ||
| 1178 | s32 rssi_thold, u32 rssi_hyst); | ||
| 1155 | }; | 1179 | }; |
| 1156 | 1180 | ||
| 1157 | /* | 1181 | /* |
| @@ -1441,6 +1465,8 @@ struct cfg80211_cached_keys; | |||
| 1441 | * @list: (private) Used to collect the interfaces | 1465 | * @list: (private) Used to collect the interfaces |
| 1442 | * @netdev: (private) Used to reference back to the netdev | 1466 | * @netdev: (private) Used to reference back to the netdev |
| 1443 | * @current_bss: (private) Used by the internal configuration code | 1467 | * @current_bss: (private) Used by the internal configuration code |
| 1468 | * @channel: (private) Used by the internal configuration code to track | ||
| 1469 | * user-set AP, monitor and WDS channels for wireless extensions | ||
| 1444 | * @bssid: (private) Used by the internal configuration code | 1470 | * @bssid: (private) Used by the internal configuration code |
| 1445 | * @ssid: (private) Used by the internal configuration code | 1471 | * @ssid: (private) Used by the internal configuration code |
| 1446 | * @ssid_len: (private) Used by the internal configuration code | 1472 | * @ssid_len: (private) Used by the internal configuration code |
| @@ -1487,6 +1513,7 @@ struct wireless_dev { | |||
| 1487 | struct cfg80211_internal_bss *authtry_bsses[MAX_AUTH_BSSES]; | 1513 | struct cfg80211_internal_bss *authtry_bsses[MAX_AUTH_BSSES]; |
| 1488 | struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; | 1514 | struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; |
| 1489 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | 1515 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ |
| 1516 | struct ieee80211_channel *channel; | ||
| 1490 | 1517 | ||
| 1491 | bool ps; | 1518 | bool ps; |
| 1492 | int ps_timeout; | 1519 | int ps_timeout; |
| @@ -1627,7 +1654,7 @@ struct ieee80211_radiotap_iterator { | |||
| 1627 | const struct ieee80211_radiotap_namespace *current_namespace; | 1654 | const struct ieee80211_radiotap_namespace *current_namespace; |
| 1628 | 1655 | ||
| 1629 | unsigned char *_arg, *_next_ns_data; | 1656 | unsigned char *_arg, *_next_ns_data; |
| 1630 | uint32_t *_next_bitmap; | 1657 | __le32 *_next_bitmap; |
| 1631 | 1658 | ||
| 1632 | unsigned char *this_arg; | 1659 | unsigned char *this_arg; |
| 1633 | int this_arg_index; | 1660 | int this_arg_index; |
| @@ -2337,4 +2364,18 @@ bool cfg80211_rx_action(struct net_device *dev, int freq, const u8 *buf, | |||
| 2337 | void cfg80211_action_tx_status(struct net_device *dev, u64 cookie, | 2364 | void cfg80211_action_tx_status(struct net_device *dev, u64 cookie, |
| 2338 | const u8 *buf, size_t len, bool ack, gfp_t gfp); | 2365 | const u8 *buf, size_t len, bool ack, gfp_t gfp); |
| 2339 | 2366 | ||
| 2367 | |||
| 2368 | /** | ||
| 2369 | * cfg80211_cqm_rssi_notify - connection quality monitoring rssi event | ||
| 2370 | * @dev: network device | ||
| 2371 | * @rssi_event: the triggered RSSI event | ||
| 2372 | * @gfp: context flags | ||
| 2373 | * | ||
| 2374 | * This function is called when a configured connection quality monitoring | ||
| 2375 | * rssi threshold reached event occurs. | ||
| 2376 | */ | ||
| 2377 | void cfg80211_cqm_rssi_notify(struct net_device *dev, | ||
| 2378 | enum nl80211_cqm_rssi_threshold_event rssi_event, | ||
| 2379 | gfp_t gfp); | ||
| 2380 | |||
| 2340 | #endif /* __NET_CFG80211_H */ | 2381 | #endif /* __NET_CFG80211_H */ |
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h index 52da6c3dd50d..bbcde3238e58 100644 --- a/include/net/dn_fib.h +++ b/include/net/dn_fib.h | |||
| @@ -50,10 +50,6 @@ struct dn_fib_info { | |||
| 50 | __le16 fib_prefsrc; | 50 | __le16 fib_prefsrc; |
| 51 | __u32 fib_priority; | 51 | __u32 fib_priority; |
| 52 | __u32 fib_metrics[RTAX_MAX]; | 52 | __u32 fib_metrics[RTAX_MAX]; |
| 53 | #define dn_fib_mtu fib_metrics[RTAX_MTU-1] | ||
| 54 | #define dn_fib_window fib_metrics[RTAX_WINDOW-1] | ||
| 55 | #define dn_fib_rtt fib_metrics[RTAX_RTT-1] | ||
| 56 | #define dn_fib_advmss fib_metrics[RTAX_ADVMSS-1] | ||
| 57 | int fib_nhs; | 53 | int fib_nhs; |
| 58 | int fib_power; | 54 | int fib_power; |
| 59 | struct dn_fib_nh fib_nh[0]; | 55 | struct dn_fib_nh fib_nh[0]; |
diff --git a/include/net/dst.h b/include/net/dst.h index ce078cda6b74..612069beda73 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -168,6 +168,12 @@ static inline void dst_use(struct dst_entry *dst, unsigned long time) | |||
| 168 | dst->lastuse = time; | 168 | dst->lastuse = time; |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | static inline void dst_use_noref(struct dst_entry *dst, unsigned long time) | ||
| 172 | { | ||
| 173 | dst->__use++; | ||
| 174 | dst->lastuse = time; | ||
| 175 | } | ||
| 176 | |||
| 171 | static inline | 177 | static inline |
| 172 | struct dst_entry * dst_clone(struct dst_entry * dst) | 178 | struct dst_entry * dst_clone(struct dst_entry * dst) |
| 173 | { | 179 | { |
| @@ -177,11 +183,67 @@ struct dst_entry * dst_clone(struct dst_entry * dst) | |||
| 177 | } | 183 | } |
| 178 | 184 | ||
| 179 | extern void dst_release(struct dst_entry *dst); | 185 | extern void dst_release(struct dst_entry *dst); |
| 186 | |||
| 187 | static inline void refdst_drop(unsigned long refdst) | ||
| 188 | { | ||
| 189 | if (!(refdst & SKB_DST_NOREF)) | ||
| 190 | dst_release((struct dst_entry *)(refdst & SKB_DST_PTRMASK)); | ||
| 191 | } | ||
| 192 | |||
| 193 | /** | ||
| 194 | * skb_dst_drop - drops skb dst | ||
| 195 | * @skb: buffer | ||
| 196 | * | ||
| 197 | * Drops dst reference count if a reference was taken. | ||
| 198 | */ | ||
| 180 | static inline void skb_dst_drop(struct sk_buff *skb) | 199 | static inline void skb_dst_drop(struct sk_buff *skb) |
| 181 | { | 200 | { |
| 182 | if (skb->_skb_dst) | 201 | if (skb->_skb_refdst) { |
| 183 | dst_release(skb_dst(skb)); | 202 | refdst_drop(skb->_skb_refdst); |
| 184 | skb->_skb_dst = 0UL; | 203 | skb->_skb_refdst = 0UL; |
| 204 | } | ||
| 205 | } | ||
| 206 | |||
| 207 | static inline void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb) | ||
| 208 | { | ||
| 209 | nskb->_skb_refdst = oskb->_skb_refdst; | ||
| 210 | if (!(nskb->_skb_refdst & SKB_DST_NOREF)) | ||
| 211 | dst_clone(skb_dst(nskb)); | ||
| 212 | } | ||
| 213 | |||
| 214 | /** | ||
| 215 | * skb_dst_force - makes sure skb dst is refcounted | ||
| 216 | * @skb: buffer | ||
| 217 | * | ||
| 218 | * If dst is not yet refcounted, let's do it | ||
| 219 | */ | ||
| 220 | static inline void skb_dst_force(struct sk_buff *skb) | ||
| 221 | { | ||
| 222 | if (skb_dst_is_noref(skb)) { | ||
| 223 | WARN_ON(!rcu_read_lock_held()); | ||
| 224 | skb->_skb_refdst &= ~SKB_DST_NOREF; | ||
| 225 | dst_clone(skb_dst(skb)); | ||
| 226 | } | ||
| 227 | } | ||
| 228 | |||
| 229 | |||
| 230 | /** | ||
| 231 | * skb_tunnel_rx - prepare skb for rx reinsert | ||
| 232 | * @skb: buffer | ||
| 233 | * @dev: tunnel device | ||
| 234 | * | ||
| 235 | * After decapsulation, packet is going to re-enter (netif_rx()) our stack, | ||
| 236 | * so make some cleanups, and perform accounting. | ||
| 237 | */ | ||
| 238 | static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) | ||
| 239 | { | ||
| 240 | skb->dev = dev; | ||
| 241 | /* TODO : stats should be SMP safe */ | ||
| 242 | dev->stats.rx_packets++; | ||
| 243 | dev->stats.rx_bytes += skb->len; | ||
| 244 | skb->rxhash = 0; | ||
| 245 | skb_dst_drop(skb); | ||
| 246 | nf_reset(skb); | ||
| 185 | } | 247 | } |
| 186 | 248 | ||
| 187 | /* Children define the path of the packet through the | 249 | /* Children define the path of the packet through the |
| @@ -225,21 +287,6 @@ static inline void dst_confirm(struct dst_entry *dst) | |||
| 225 | neigh_confirm(dst->neighbour); | 287 | neigh_confirm(dst->neighbour); |
| 226 | } | 288 | } |
| 227 | 289 | ||
| 228 | static inline void dst_negative_advice(struct dst_entry **dst_p, | ||
| 229 | struct sock *sk) | ||
| 230 | { | ||
| 231 | struct dst_entry * dst = *dst_p; | ||
| 232 | if (dst && dst->ops->negative_advice) { | ||
| 233 | *dst_p = dst->ops->negative_advice(dst); | ||
| 234 | |||
| 235 | if (dst != *dst_p) { | ||
| 236 | extern void sk_reset_txq(struct sock *sk); | ||
| 237 | |||
| 238 | sk_reset_txq(sk); | ||
| 239 | } | ||
| 240 | } | ||
| 241 | } | ||
| 242 | |||
| 243 | static inline void dst_link_failure(struct sk_buff *skb) | 290 | static inline void dst_link_failure(struct sk_buff *skb) |
| 244 | { | 291 | { |
| 245 | struct dst_entry *dst = skb_dst(skb); | 292 | struct dst_entry *dst = skb_dst(skb); |
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index c07ac9650ebc..e8923bc20f9f 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define __NET_FIB_RULES_H | 2 | #define __NET_FIB_RULES_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/slab.h> | ||
| 5 | #include <linux/netdevice.h> | 6 | #include <linux/netdevice.h> |
| 6 | #include <linux/fib_rules.h> | 7 | #include <linux/fib_rules.h> |
| 7 | #include <net/flow.h> | 8 | #include <net/flow.h> |
| @@ -103,7 +104,7 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla) | |||
| 103 | return frh->table; | 104 | return frh->table; |
| 104 | } | 105 | } |
| 105 | 106 | ||
| 106 | extern struct fib_rules_ops *fib_rules_register(struct fib_rules_ops *, struct net *); | 107 | extern struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *, struct net *); |
| 107 | extern void fib_rules_unregister(struct fib_rules_ops *); | 108 | extern void fib_rules_unregister(struct fib_rules_ops *); |
| 108 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); | 109 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); |
| 109 | 110 | ||
| @@ -113,4 +114,5 @@ extern int fib_rules_lookup(struct fib_rules_ops *, | |||
| 113 | extern int fib_default_rule_add(struct fib_rules_ops *, | 114 | extern int fib_default_rule_add(struct fib_rules_ops *, |
| 114 | u32 pref, u32 table, | 115 | u32 pref, u32 table, |
| 115 | u32 flags); | 116 | u32 flags); |
| 117 | extern u32 fib_default_rule_pref(struct fib_rules_ops *ops); | ||
| 116 | #endif | 118 | #endif |
diff --git a/include/net/flow.h b/include/net/flow.h index 809970b7dfee..bb08692a20b0 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
| @@ -86,11 +86,26 @@ struct flowi { | |||
| 86 | 86 | ||
| 87 | struct net; | 87 | struct net; |
| 88 | struct sock; | 88 | struct sock; |
| 89 | typedef int (*flow_resolve_t)(struct net *net, struct flowi *key, u16 family, | 89 | struct flow_cache_ops; |
| 90 | u8 dir, void **objp, atomic_t **obj_refp); | 90 | |
| 91 | struct flow_cache_object { | ||
| 92 | const struct flow_cache_ops *ops; | ||
| 93 | }; | ||
| 94 | |||
| 95 | struct flow_cache_ops { | ||
| 96 | struct flow_cache_object *(*get)(struct flow_cache_object *); | ||
| 97 | int (*check)(struct flow_cache_object *); | ||
| 98 | void (*delete)(struct flow_cache_object *); | ||
| 99 | }; | ||
| 100 | |||
| 101 | typedef struct flow_cache_object *(*flow_resolve_t)( | ||
| 102 | struct net *net, struct flowi *key, u16 family, | ||
| 103 | u8 dir, struct flow_cache_object *oldobj, void *ctx); | ||
| 104 | |||
| 105 | extern struct flow_cache_object *flow_cache_lookup( | ||
| 106 | struct net *net, struct flowi *key, u16 family, | ||
| 107 | u8 dir, flow_resolve_t resolver, void *ctx); | ||
| 91 | 108 | ||
| 92 | extern void *flow_cache_lookup(struct net *net, struct flowi *key, u16 family, | ||
| 93 | u8 dir, flow_resolve_t resolver); | ||
| 94 | extern void flow_cache_flush(void); | 109 | extern void flow_cache_flush(void); |
| 95 | extern atomic_t flow_cache_genid; | 110 | extern atomic_t flow_cache_genid; |
| 96 | 111 | ||
diff --git a/include/net/icmp.h b/include/net/icmp.h index 15b3dfe9fce8..6e991e0d0d6f 100644 --- a/include/net/icmp.h +++ b/include/net/icmp.h | |||
| @@ -48,15 +48,4 @@ extern void icmp_out_count(struct net *net, unsigned char type); | |||
| 48 | /* Move into dst.h ? */ | 48 | /* Move into dst.h ? */ |
| 49 | extern int xrlim_allow(struct dst_entry *dst, int timeout); | 49 | extern int xrlim_allow(struct dst_entry *dst, int timeout); |
| 50 | 50 | ||
| 51 | struct raw_sock { | ||
| 52 | /* inet_sock has to be the first member */ | ||
| 53 | struct inet_sock inet; | ||
| 54 | struct icmp_filter filter; | ||
| 55 | }; | ||
| 56 | |||
| 57 | static inline struct raw_sock *raw_sk(const struct sock *sk) | ||
| 58 | { | ||
| 59 | return (struct raw_sock *)sk; | ||
| 60 | } | ||
| 61 | |||
| 62 | #endif /* _ICMP_H */ | 51 | #endif /* _ICMP_H */ |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index 545d8b059bef..f95ff8d9aa47 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
| @@ -32,6 +32,13 @@ | |||
| 32 | 32 | ||
| 33 | #ifdef __KERNEL__ | 33 | #ifdef __KERNEL__ |
| 34 | 34 | ||
| 35 | enum { | ||
| 36 | INET6_IFADDR_STATE_DAD, | ||
| 37 | INET6_IFADDR_STATE_POSTDAD, | ||
| 38 | INET6_IFADDR_STATE_UP, | ||
| 39 | INET6_IFADDR_STATE_DEAD, | ||
| 40 | }; | ||
| 41 | |||
| 35 | struct inet6_ifaddr { | 42 | struct inet6_ifaddr { |
| 36 | struct in6_addr addr; | 43 | struct in6_addr addr; |
| 37 | __u32 prefix_len; | 44 | __u32 prefix_len; |
| @@ -40,6 +47,9 @@ struct inet6_ifaddr { | |||
| 40 | __u32 prefered_lft; | 47 | __u32 prefered_lft; |
| 41 | atomic_t refcnt; | 48 | atomic_t refcnt; |
| 42 | spinlock_t lock; | 49 | spinlock_t lock; |
| 50 | spinlock_t state_lock; | ||
| 51 | |||
| 52 | int state; | ||
| 43 | 53 | ||
| 44 | __u8 probes; | 54 | __u8 probes; |
| 45 | __u8 flags; | 55 | __u8 flags; |
| @@ -54,16 +64,15 @@ struct inet6_ifaddr { | |||
| 54 | struct inet6_dev *idev; | 64 | struct inet6_dev *idev; |
| 55 | struct rt6_info *rt; | 65 | struct rt6_info *rt; |
| 56 | 66 | ||
| 57 | struct inet6_ifaddr *lst_next; /* next addr in addr_lst */ | 67 | struct hlist_node addr_lst; |
| 58 | struct inet6_ifaddr *if_next; /* next addr in inet6_dev */ | 68 | struct list_head if_list; |
| 59 | 69 | ||
| 60 | #ifdef CONFIG_IPV6_PRIVACY | 70 | #ifdef CONFIG_IPV6_PRIVACY |
| 61 | struct inet6_ifaddr *tmp_next; /* next addr in tempaddr_lst */ | 71 | struct list_head tmp_list; |
| 62 | struct inet6_ifaddr *ifpub; | 72 | struct inet6_ifaddr *ifpub; |
| 63 | int regen_count; | 73 | int regen_count; |
| 64 | #endif | 74 | #endif |
| 65 | 75 | struct rcu_head rcu; | |
| 66 | int dead; | ||
| 67 | }; | 76 | }; |
| 68 | 77 | ||
| 69 | struct ip6_sf_socklist { | 78 | struct ip6_sf_socklist { |
| @@ -151,9 +160,9 @@ struct ipv6_devstat { | |||
| 151 | }; | 160 | }; |
| 152 | 161 | ||
| 153 | struct inet6_dev { | 162 | struct inet6_dev { |
| 154 | struct net_device *dev; | 163 | struct net_device *dev; |
| 155 | 164 | ||
| 156 | struct inet6_ifaddr *addr_list; | 165 | struct list_head addr_list; |
| 157 | 166 | ||
| 158 | struct ifmcaddr6 *mc_list; | 167 | struct ifmcaddr6 *mc_list; |
| 159 | struct ifmcaddr6 *mc_tomb; | 168 | struct ifmcaddr6 *mc_tomb; |
| @@ -175,7 +184,7 @@ struct inet6_dev { | |||
| 175 | #ifdef CONFIG_IPV6_PRIVACY | 184 | #ifdef CONFIG_IPV6_PRIVACY |
| 176 | u8 rndid[8]; | 185 | u8 rndid[8]; |
| 177 | struct timer_list regen_timer; | 186 | struct timer_list regen_timer; |
| 178 | struct inet6_ifaddr *tempaddr_list; | 187 | struct list_head tempaddr_list; |
| 179 | #endif | 188 | #endif |
| 180 | 189 | ||
| 181 | struct neigh_parms *nd_parms; | 190 | struct neigh_parms *nd_parms; |
diff --git a/include/net/inet6_connection_sock.h b/include/net/inet6_connection_sock.h index f13ddc2543b1..aae08f686633 100644 --- a/include/net/inet6_connection_sock.h +++ b/include/net/inet6_connection_sock.h | |||
| @@ -38,5 +38,5 @@ extern void inet6_csk_reqsk_queue_hash_add(struct sock *sk, | |||
| 38 | 38 | ||
| 39 | extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); | 39 | extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); |
| 40 | 40 | ||
| 41 | extern int inet6_csk_xmit(struct sk_buff *skb, int ipfragok); | 41 | extern int inet6_csk_xmit(struct sk_buff *skb); |
| 42 | #endif /* _INET6_CONNECTION_SOCK_H */ | 42 | #endif /* _INET6_CONNECTION_SOCK_H */ |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index 696d6e4ce68a..b6d3b55da19b 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
| @@ -36,9 +36,8 @@ struct tcp_congestion_ops; | |||
| 36 | * (i.e. things that depend on the address family) | 36 | * (i.e. things that depend on the address family) |
| 37 | */ | 37 | */ |
| 38 | struct inet_connection_sock_af_ops { | 38 | struct inet_connection_sock_af_ops { |
| 39 | int (*queue_xmit)(struct sk_buff *skb, int ipfragok); | 39 | int (*queue_xmit)(struct sk_buff *skb); |
| 40 | void (*send_check)(struct sock *sk, int len, | 40 | void (*send_check)(struct sock *sk, struct sk_buff *skb); |
| 41 | struct sk_buff *skb); | ||
| 42 | int (*rebuild_header)(struct sock *sk); | 41 | int (*rebuild_header)(struct sock *sk); |
| 43 | int (*conn_request)(struct sock *sk, struct sk_buff *skb); | 42 | int (*conn_request)(struct sock *sk, struct sk_buff *skb); |
| 44 | struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, | 43 | struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 83fd34437cf1..1653de515cee 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/string.h> | 21 | #include <linux/string.h> |
| 22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
| 23 | #include <linux/jhash.h> | 23 | #include <linux/jhash.h> |
| 24 | #include <linux/netdevice.h> | ||
| 24 | 25 | ||
| 25 | #include <net/flow.h> | 26 | #include <net/flow.h> |
| 26 | #include <net/sock.h> | 27 | #include <net/sock.h> |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 79f67eae8a7e..a066fdd50da6 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
| @@ -224,7 +224,9 @@ static inline | |||
| 224 | struct net *twsk_net(const struct inet_timewait_sock *twsk) | 224 | struct net *twsk_net(const struct inet_timewait_sock *twsk) |
| 225 | { | 225 | { |
| 226 | #ifdef CONFIG_NET_NS | 226 | #ifdef CONFIG_NET_NS |
| 227 | return rcu_dereference(twsk->tw_net); | 227 | return rcu_dereference_raw(twsk->tw_net); /* protected by locking, */ |
| 228 | /* reference counting, */ | ||
| 229 | /* initialization, or RCU. */ | ||
| 228 | #else | 230 | #else |
| 229 | return &init_net; | 231 | return &init_net; |
| 230 | #endif | 232 | #endif |
diff --git a/include/net/ip.h b/include/net/ip.h index 503994a38ed1..63548f0a44b1 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
| @@ -101,7 +101,7 @@ extern int ip_do_nat(struct sk_buff *skb); | |||
| 101 | extern void ip_send_check(struct iphdr *ip); | 101 | extern void ip_send_check(struct iphdr *ip); |
| 102 | extern int __ip_local_out(struct sk_buff *skb); | 102 | extern int __ip_local_out(struct sk_buff *skb); |
| 103 | extern int ip_local_out(struct sk_buff *skb); | 103 | extern int ip_local_out(struct sk_buff *skb); |
| 104 | extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok); | 104 | extern int ip_queue_xmit(struct sk_buff *skb); |
| 105 | extern void ip_init(void); | 105 | extern void ip_init(void); |
| 106 | extern int ip_append_data(struct sock *sk, | 106 | extern int ip_append_data(struct sock *sk, |
| 107 | int getfrag(void *from, char *to, int offset, int len, | 107 | int getfrag(void *from, char *to, int offset, int len, |
| @@ -184,6 +184,12 @@ extern struct local_ports { | |||
| 184 | } sysctl_local_ports; | 184 | } sysctl_local_ports; |
| 185 | extern void inet_get_local_port_range(int *low, int *high); | 185 | extern void inet_get_local_port_range(int *low, int *high); |
| 186 | 186 | ||
| 187 | extern unsigned long *sysctl_local_reserved_ports; | ||
| 188 | static inline int inet_is_reserved_local_port(int port) | ||
| 189 | { | ||
| 190 | return test_bit(port, sysctl_local_reserved_ports); | ||
| 191 | } | ||
| 192 | |||
| 187 | extern int sysctl_ip_default_ttl; | 193 | extern int sysctl_ip_default_ttl; |
| 188 | extern int sysctl_ip_nonlocal_bind; | 194 | extern int sysctl_ip_nonlocal_bind; |
| 189 | 195 | ||
| @@ -393,6 +399,7 @@ extern int ip_options_rcv_srr(struct sk_buff *skb); | |||
| 393 | * Functions provided by ip_sockglue.c | 399 | * Functions provided by ip_sockglue.c |
| 394 | */ | 400 | */ |
| 395 | 401 | ||
| 402 | extern int ip_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); | ||
| 396 | extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); | 403 | extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb); |
| 397 | extern int ip_cmsg_send(struct net *net, | 404 | extern int ip_cmsg_send(struct net *net, |
| 398 | struct msghdr *msg, struct ipcm_cookie *ipc); | 405 | struct msghdr *msg, struct ipcm_cookie *ipc); |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 86f46c49e318..4b1dc1161c37 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
| @@ -88,34 +88,37 @@ struct rt6_info { | |||
| 88 | struct dst_entry dst; | 88 | struct dst_entry dst; |
| 89 | } u; | 89 | } u; |
| 90 | 90 | ||
| 91 | struct inet6_dev *rt6i_idev; | ||
| 92 | |||
| 93 | #define rt6i_dev u.dst.dev | 91 | #define rt6i_dev u.dst.dev |
| 94 | #define rt6i_nexthop u.dst.neighbour | 92 | #define rt6i_nexthop u.dst.neighbour |
| 95 | #define rt6i_expires u.dst.expires | 93 | #define rt6i_expires u.dst.expires |
| 96 | 94 | ||
| 95 | /* | ||
| 96 | * Tail elements of dst_entry (__refcnt etc.) | ||
| 97 | * and these elements (rarely used in hot path) are in | ||
| 98 | * the same cache line. | ||
| 99 | */ | ||
| 100 | struct fib6_table *rt6i_table; | ||
| 97 | struct fib6_node *rt6i_node; | 101 | struct fib6_node *rt6i_node; |
| 98 | 102 | ||
| 99 | struct in6_addr rt6i_gateway; | 103 | struct in6_addr rt6i_gateway; |
| 100 | |||
| 101 | u32 rt6i_flags; | ||
| 102 | u32 rt6i_metric; | ||
| 103 | atomic_t rt6i_ref; | ||
| 104 | 104 | ||
| 105 | /* more non-fragment space at head required */ | 105 | atomic_t rt6i_ref; |
| 106 | unsigned short rt6i_nfheader_len; | ||
| 107 | |||
| 108 | u8 rt6i_protocol; | ||
| 109 | 106 | ||
| 110 | struct fib6_table *rt6i_table; | 107 | /* These are in a separate cache line. */ |
| 108 | struct rt6key rt6i_dst ____cacheline_aligned_in_smp; | ||
| 109 | u32 rt6i_flags; | ||
| 110 | struct rt6key rt6i_src; | ||
| 111 | u32 rt6i_metric; | ||
| 111 | 112 | ||
| 112 | struct rt6key rt6i_dst; | 113 | struct inet6_dev *rt6i_idev; |
| 113 | 114 | ||
| 114 | #ifdef CONFIG_XFRM | 115 | #ifdef CONFIG_XFRM |
| 115 | u32 rt6i_flow_cache_genid; | 116 | u32 rt6i_flow_cache_genid; |
| 116 | #endif | 117 | #endif |
| 118 | /* more non-fragment space at head required */ | ||
| 119 | unsigned short rt6i_nfheader_len; | ||
| 117 | 120 | ||
| 118 | struct rt6key rt6i_src; | 121 | u8 rt6i_protocol; |
| 119 | }; | 122 | }; |
| 120 | 123 | ||
| 121 | static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) | 124 | static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 4a808de7c0f6..278312c95f96 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
| @@ -37,6 +37,24 @@ struct route_info { | |||
| 37 | #define RT6_LOOKUP_F_SRCPREF_PUBLIC 0x00000010 | 37 | #define RT6_LOOKUP_F_SRCPREF_PUBLIC 0x00000010 |
| 38 | #define RT6_LOOKUP_F_SRCPREF_COA 0x00000020 | 38 | #define RT6_LOOKUP_F_SRCPREF_COA 0x00000020 |
| 39 | 39 | ||
| 40 | /* | ||
| 41 | * rt6_srcprefs2flags() and rt6_flags2srcprefs() translate | ||
| 42 | * between IPV6_ADDR_PREFERENCES socket option values | ||
| 43 | * IPV6_PREFER_SRC_TMP = 0x1 | ||
| 44 | * IPV6_PREFER_SRC_PUBLIC = 0x2 | ||
| 45 | * IPV6_PREFER_SRC_COA = 0x4 | ||
| 46 | * and above RT6_LOOKUP_F_SRCPREF_xxx flags. | ||
| 47 | */ | ||
| 48 | static inline int rt6_srcprefs2flags(unsigned int srcprefs) | ||
| 49 | { | ||
| 50 | /* No need to bitmask because srcprefs have only 3 bits. */ | ||
| 51 | return srcprefs << 3; | ||
| 52 | } | ||
| 53 | |||
| 54 | static inline unsigned int rt6_flags2srcprefs(int flags) | ||
| 55 | { | ||
| 56 | return (flags >> 3) & 7; | ||
| 57 | } | ||
| 40 | 58 | ||
| 41 | extern void ip6_route_input(struct sk_buff *skb); | 59 | extern void ip6_route_input(struct sk_buff *skb); |
| 42 | 60 | ||
| @@ -134,9 +152,9 @@ static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst, | |||
| 134 | static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst, | 152 | static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst, |
| 135 | struct in6_addr *daddr, struct in6_addr *saddr) | 153 | struct in6_addr *daddr, struct in6_addr *saddr) |
| 136 | { | 154 | { |
| 137 | write_lock(&sk->sk_dst_lock); | 155 | spin_lock(&sk->sk_dst_lock); |
| 138 | __ip6_dst_store(sk, dst, daddr, saddr); | 156 | __ip6_dst_store(sk, dst, daddr, saddr); |
| 139 | write_unlock(&sk->sk_dst_lock); | 157 | spin_unlock(&sk->sk_dst_lock); |
| 140 | } | 158 | } |
| 141 | 159 | ||
| 142 | static inline int ipv6_unicast_destination(struct sk_buff *skb) | 160 | static inline int ipv6_unicast_destination(struct sk_buff *skb) |
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index 83b4e008b16d..fbf9d1cda27b 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | struct ip6_tnl { | 15 | struct ip6_tnl { |
| 16 | struct ip6_tnl *next; /* next tunnel in list */ | 16 | struct ip6_tnl *next; /* next tunnel in list */ |
| 17 | struct net_device *dev; /* virtual device associated with tunnel */ | 17 | struct net_device *dev; /* virtual device associated with tunnel */ |
| 18 | int recursion; /* depth of hard_start_xmit recursion */ | ||
| 19 | struct ip6_tnl_parm parms; /* tunnel configuration parameters */ | 18 | struct ip6_tnl_parm parms; /* tunnel configuration parameters */ |
| 20 | struct flowi fl; /* flowi template for xmit */ | 19 | struct flowi fl; /* flowi template for xmit */ |
| 21 | struct dst_entry *dst_cache; /* cached dst */ | 20 | struct dst_entry *dst_cache; /* cached dst */ |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index e72fb10ce573..eba5cc00325a 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
| @@ -422,7 +422,7 @@ static inline int __ipv6_addr_diff(const void *token1, const void *token2, int a | |||
| 422 | for (i = 0; i < addrlen; i++) { | 422 | for (i = 0; i < addrlen; i++) { |
| 423 | __be32 xb = a1[i] ^ a2[i]; | 423 | __be32 xb = a1[i] ^ a2[i]; |
| 424 | if (xb) | 424 | if (xb) |
| 425 | return i * 32 + 32 - fls(ntohl(xb)); | 425 | return i * 32 + 31 - __fls(ntohl(xb)); |
| 426 | } | 426 | } |
| 427 | 427 | ||
| 428 | /* | 428 | /* |
| @@ -482,8 +482,7 @@ extern int ip6_rcv_finish(struct sk_buff *skb); | |||
| 482 | extern int ip6_xmit(struct sock *sk, | 482 | extern int ip6_xmit(struct sock *sk, |
| 483 | struct sk_buff *skb, | 483 | struct sk_buff *skb, |
| 484 | struct flowi *fl, | 484 | struct flowi *fl, |
| 485 | struct ipv6_txoptions *opt, | 485 | struct ipv6_txoptions *opt); |
| 486 | int ipfragok); | ||
| 487 | 486 | ||
| 488 | extern int ip6_nd_hdr(struct sock *sk, | 487 | extern int ip6_nd_hdr(struct sock *sk, |
| 489 | struct sk_buff *skb, | 488 | struct sk_buff *skb, |
| @@ -504,7 +503,8 @@ extern int ip6_append_data(struct sock *sk, | |||
| 504 | struct ipv6_txoptions *opt, | 503 | struct ipv6_txoptions *opt, |
| 505 | struct flowi *fl, | 504 | struct flowi *fl, |
| 506 | struct rt6_info *rt, | 505 | struct rt6_info *rt, |
| 507 | unsigned int flags); | 506 | unsigned int flags, |
| 507 | int dontfrag); | ||
| 508 | 508 | ||
| 509 | extern int ip6_push_pending_frames(struct sock *sk); | 509 | extern int ip6_push_pending_frames(struct sock *sk); |
| 510 | 510 | ||
| @@ -578,9 +578,11 @@ extern int ip6_datagram_connect(struct sock *sk, | |||
| 578 | struct sockaddr *addr, int addr_len); | 578 | struct sockaddr *addr, int addr_len); |
| 579 | 579 | ||
| 580 | extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); | 580 | extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len); |
| 581 | extern int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len); | ||
| 581 | extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, | 582 | extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port, |
| 582 | u32 info, u8 *payload); | 583 | u32 info, u8 *payload); |
| 583 | extern void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info); | 584 | extern void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info); |
| 585 | extern void ipv6_local_rxpmtu(struct sock *sk, struct flowi *fl, u32 mtu); | ||
| 584 | 586 | ||
| 585 | extern int inet6_release(struct socket *sock); | 587 | extern int inet6_release(struct socket *sock); |
| 586 | extern int inet6_bind(struct socket *sock, struct sockaddr *uaddr, | 588 | extern int inet6_bind(struct socket *sock, struct sockaddr *uaddr, |
diff --git a/include/net/ipx.h b/include/net/ipx.h index a14121dd1932..ef51a668ba19 100644 --- a/include/net/ipx.h +++ b/include/net/ipx.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <net/datalink.h> | 13 | #include <net/datalink.h> |
| 14 | #include <linux/ipx.h> | 14 | #include <linux/ipx.h> |
| 15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
| 16 | #include <linux/slab.h> | ||
| 16 | 17 | ||
| 17 | struct ipx_address { | 18 | struct ipx_address { |
| 18 | __be32 net; | 19 | __be32 net; |
diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h index 0788c23d2828..11aee7a2972a 100644 --- a/include/net/irda/irttp.h +++ b/include/net/irda/irttp.h | |||
| @@ -97,7 +97,7 @@ | |||
| 97 | #define TTP_MAX_SDU_SIZE 0x01 | 97 | #define TTP_MAX_SDU_SIZE 0x01 |
| 98 | 98 | ||
| 99 | /* | 99 | /* |
| 100 | * This structure contains all data assosiated with one instance of a TTP | 100 | * This structure contains all data associated with one instance of a TTP |
| 101 | * connection. | 101 | * connection. |
| 102 | */ | 102 | */ |
| 103 | struct tsap_cb { | 103 | struct tsap_cb { |
diff --git a/include/net/iucv/iucv.h b/include/net/iucv/iucv.h index 5e310c8d8e2f..205a3360156e 100644 --- a/include/net/iucv/iucv.h +++ b/include/net/iucv/iucv.h | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | */ | 28 | */ |
| 29 | 29 | ||
| 30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | #include <asm/debug.h> | 32 | #include <asm/debug.h> |
| 32 | 33 | ||
| 33 | /* | 34 | /* |
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index b2b98f3fa265..3afdb21cc31d 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h | |||
| @@ -323,7 +323,7 @@ typedef int (*iw_handler)(struct net_device *dev, struct iw_request_info *info, | |||
| 323 | struct iw_handler_def { | 323 | struct iw_handler_def { |
| 324 | 324 | ||
| 325 | /* Array of handlers for standard ioctls | 325 | /* Array of handlers for standard ioctls |
| 326 | * We will call dev->wireless_handlers->standard[ioctl - SIOCSIWCOMMIT] | 326 | * We will call dev->wireless_handlers->standard[ioctl - SIOCIWFIRST] |
| 327 | */ | 327 | */ |
| 328 | const iw_handler * standard; | 328 | const iw_handler * standard; |
| 329 | /* Number of handlers defined (more precisely, index of the | 329 | /* Number of handlers defined (more precisely, index of the |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 80eb7cc42ce9..5be900d19660 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -144,6 +144,8 @@ struct ieee80211_low_level_stats { | |||
| 144 | * new beacon (beaconing modes) | 144 | * new beacon (beaconing modes) |
| 145 | * @BSS_CHANGED_BEACON_ENABLED: Beaconing should be | 145 | * @BSS_CHANGED_BEACON_ENABLED: Beaconing should be |
| 146 | * enabled/disabled (beaconing modes) | 146 | * enabled/disabled (beaconing modes) |
| 147 | * @BSS_CHANGED_CQM: Connection quality monitor config changed | ||
| 148 | * @BSS_CHANGED_IBSS: IBSS join status changed | ||
| 147 | */ | 149 | */ |
| 148 | enum ieee80211_bss_change { | 150 | enum ieee80211_bss_change { |
| 149 | BSS_CHANGED_ASSOC = 1<<0, | 151 | BSS_CHANGED_ASSOC = 1<<0, |
| @@ -156,6 +158,10 @@ enum ieee80211_bss_change { | |||
| 156 | BSS_CHANGED_BSSID = 1<<7, | 158 | BSS_CHANGED_BSSID = 1<<7, |
| 157 | BSS_CHANGED_BEACON = 1<<8, | 159 | BSS_CHANGED_BEACON = 1<<8, |
| 158 | BSS_CHANGED_BEACON_ENABLED = 1<<9, | 160 | BSS_CHANGED_BEACON_ENABLED = 1<<9, |
| 161 | BSS_CHANGED_CQM = 1<<10, | ||
| 162 | BSS_CHANGED_IBSS = 1<<11, | ||
| 163 | |||
| 164 | /* when adding here, make sure to change ieee80211_reconfig */ | ||
| 159 | }; | 165 | }; |
| 160 | 166 | ||
| 161 | /** | 167 | /** |
| @@ -165,6 +171,8 @@ enum ieee80211_bss_change { | |||
| 165 | * to that BSS) that can change during the lifetime of the BSS. | 171 | * to that BSS) that can change during the lifetime of the BSS. |
| 166 | * | 172 | * |
| 167 | * @assoc: association status | 173 | * @assoc: association status |
| 174 | * @ibss_joined: indicates whether this station is part of an IBSS | ||
| 175 | * or not | ||
| 168 | * @aid: association ID number, valid only when @assoc is true | 176 | * @aid: association ID number, valid only when @assoc is true |
| 169 | * @use_cts_prot: use CTS protection | 177 | * @use_cts_prot: use CTS protection |
| 170 | * @use_short_preamble: use 802.11b short preamble; | 178 | * @use_short_preamble: use 802.11b short preamble; |
| @@ -183,13 +191,19 @@ enum ieee80211_bss_change { | |||
| 183 | * the current band. | 191 | * the current band. |
| 184 | * @bssid: The BSSID for this BSS | 192 | * @bssid: The BSSID for this BSS |
| 185 | * @enable_beacon: whether beaconing should be enabled or not | 193 | * @enable_beacon: whether beaconing should be enabled or not |
| 194 | * @channel_type: Channel type for this BSS -- the hardware might be | ||
| 195 | * configured for HT40+ while this BSS only uses no-HT, for | ||
| 196 | * example. | ||
| 186 | * @ht_operation_mode: HT operation mode (like in &struct ieee80211_ht_info). | 197 | * @ht_operation_mode: HT operation mode (like in &struct ieee80211_ht_info). |
| 187 | * This field is only valid when the channel type is one of the HT types. | 198 | * This field is only valid when the channel type is one of the HT types. |
| 199 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value | ||
| 200 | * implies disabled | ||
| 201 | * @cqm_rssi_hyst: Connection quality monitor RSSI hysteresis | ||
| 188 | */ | 202 | */ |
| 189 | struct ieee80211_bss_conf { | 203 | struct ieee80211_bss_conf { |
| 190 | const u8 *bssid; | 204 | const u8 *bssid; |
| 191 | /* association related data */ | 205 | /* association related data */ |
| 192 | bool assoc; | 206 | bool assoc, ibss_joined; |
| 193 | u16 aid; | 207 | u16 aid; |
| 194 | /* erp related data */ | 208 | /* erp related data */ |
| 195 | bool use_cts_prot; | 209 | bool use_cts_prot; |
| @@ -202,6 +216,9 @@ struct ieee80211_bss_conf { | |||
| 202 | u64 timestamp; | 216 | u64 timestamp; |
| 203 | u32 basic_rates; | 217 | u32 basic_rates; |
| 204 | u16 ht_operation_mode; | 218 | u16 ht_operation_mode; |
| 219 | s32 cqm_rssi_thold; | ||
| 220 | u32 cqm_rssi_hyst; | ||
| 221 | enum nl80211_channel_type channel_type; | ||
| 205 | }; | 222 | }; |
| 206 | 223 | ||
| 207 | /** | 224 | /** |
| @@ -267,6 +284,9 @@ struct ieee80211_bss_conf { | |||
| 267 | * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 | 284 | * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 |
| 268 | * MLME command (internal to mac80211 to figure out whether to send TX | 285 | * MLME command (internal to mac80211 to figure out whether to send TX |
| 269 | * status to user space) | 286 | * status to user space) |
| 287 | * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame | ||
| 288 | * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this | ||
| 289 | * frame and selects the maximum number of streams that it can use. | ||
| 270 | */ | 290 | */ |
| 271 | enum mac80211_tx_control_flags { | 291 | enum mac80211_tx_control_flags { |
| 272 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), | 292 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), |
| @@ -290,6 +310,9 @@ enum mac80211_tx_control_flags { | |||
| 290 | IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), | 310 | IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), |
| 291 | IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20), | 311 | IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20), |
| 292 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), | 312 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), |
| 313 | IEEE80211_TX_CTL_LDPC = BIT(22), | ||
| 314 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), | ||
| 315 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | ||
| 293 | }; | 316 | }; |
| 294 | 317 | ||
| 295 | /** | 318 | /** |
| @@ -388,11 +411,11 @@ struct ieee80211_tx_rate { | |||
| 388 | * @status: union for status data | 411 | * @status: union for status data |
| 389 | * @driver_data: array of driver_data pointers | 412 | * @driver_data: array of driver_data pointers |
| 390 | * @ampdu_ack_len: number of acked aggregated frames. | 413 | * @ampdu_ack_len: number of acked aggregated frames. |
| 391 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 414 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. |
| 392 | * @ampdu_ack_map: block ack bit map for the aggregation. | 415 | * @ampdu_ack_map: block ack bit map for the aggregation. |
| 393 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 416 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. |
| 394 | * @ampdu_len: number of aggregated frames. | 417 | * @ampdu_len: number of aggregated frames. |
| 395 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 418 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. |
| 396 | * @ack_signal: signal strength of the ACK frame | 419 | * @ack_signal: signal strength of the ACK frame |
| 397 | */ | 420 | */ |
| 398 | struct ieee80211_tx_info { | 421 | struct ieee80211_tx_info { |
| @@ -543,7 +566,6 @@ enum mac80211_rx_flags { | |||
| 543 | * @signal: signal strength when receiving this frame, either in dBm, in dB or | 566 | * @signal: signal strength when receiving this frame, either in dBm, in dB or |
| 544 | * unspecified depending on the hardware capabilities flags | 567 | * unspecified depending on the hardware capabilities flags |
| 545 | * @IEEE80211_HW_SIGNAL_* | 568 | * @IEEE80211_HW_SIGNAL_* |
| 546 | * @noise: noise when receiving this frame, in dBm. | ||
| 547 | * @antenna: antenna used | 569 | * @antenna: antenna used |
| 548 | * @rate_idx: index of data rate into band's supported rates or MCS index if | 570 | * @rate_idx: index of data rate into band's supported rates or MCS index if |
| 549 | * HT rates are use (RX_FLAG_HT) | 571 | * HT rates are use (RX_FLAG_HT) |
| @@ -554,7 +576,6 @@ struct ieee80211_rx_status { | |||
| 554 | enum ieee80211_band band; | 576 | enum ieee80211_band band; |
| 555 | int freq; | 577 | int freq; |
| 556 | int signal; | 578 | int signal; |
| 557 | int noise; | ||
| 558 | int antenna; | 579 | int antenna; |
| 559 | int rate_idx; | 580 | int rate_idx; |
| 560 | int flag; | 581 | int flag; |
| @@ -580,11 +601,15 @@ struct ieee80211_rx_status { | |||
| 580 | * may turn the device off as much as possible. Typically, this flag will | 601 | * may turn the device off as much as possible. Typically, this flag will |
| 581 | * be set when an interface is set UP but not associated or scanning, but | 602 | * be set when an interface is set UP but not associated or scanning, but |
| 582 | * it can also be unset in that case when monitor interfaces are active. | 603 | * it can also be unset in that case when monitor interfaces are active. |
| 604 | * @IEEE80211_CONF_QOS: Enable 802.11e QoS also know as WMM (Wireless | ||
| 605 | * Multimedia). On some drivers (iwlwifi is one of know) we have | ||
| 606 | * to enable/disable QoS explicitly. | ||
| 583 | */ | 607 | */ |
| 584 | enum ieee80211_conf_flags { | 608 | enum ieee80211_conf_flags { |
| 585 | IEEE80211_CONF_MONITOR = (1<<0), | 609 | IEEE80211_CONF_MONITOR = (1<<0), |
| 586 | IEEE80211_CONF_PS = (1<<1), | 610 | IEEE80211_CONF_PS = (1<<1), |
| 587 | IEEE80211_CONF_IDLE = (1<<2), | 611 | IEEE80211_CONF_IDLE = (1<<2), |
| 612 | IEEE80211_CONF_QOS = (1<<3), | ||
| 588 | }; | 613 | }; |
| 589 | 614 | ||
| 590 | 615 | ||
| @@ -599,6 +624,7 @@ enum ieee80211_conf_flags { | |||
| 599 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed | 624 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed |
| 600 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed | 625 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed |
| 601 | * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed | 626 | * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed |
| 627 | * @IEEE80211_CONF_CHANGE_QOS: Quality of service was enabled or disabled | ||
| 602 | */ | 628 | */ |
| 603 | enum ieee80211_conf_changed { | 629 | enum ieee80211_conf_changed { |
| 604 | IEEE80211_CONF_CHANGE_SMPS = BIT(1), | 630 | IEEE80211_CONF_CHANGE_SMPS = BIT(1), |
| @@ -609,6 +635,7 @@ enum ieee80211_conf_changed { | |||
| 609 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), | 635 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), |
| 610 | IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7), | 636 | IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7), |
| 611 | IEEE80211_CONF_CHANGE_IDLE = BIT(8), | 637 | IEEE80211_CONF_CHANGE_IDLE = BIT(8), |
| 638 | IEEE80211_CONF_CHANGE_QOS = BIT(9), | ||
| 612 | }; | 639 | }; |
| 613 | 640 | ||
| 614 | /** | 641 | /** |
| @@ -649,6 +676,9 @@ enum ieee80211_smps_mode { | |||
| 649 | * @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the | 676 | * @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the |
| 650 | * powersave documentation below. This variable is valid only when | 677 | * powersave documentation below. This variable is valid only when |
| 651 | * the CONF_PS flag is set. | 678 | * the CONF_PS flag is set. |
| 679 | * @dynamic_ps_forced_timeout: The dynamic powersave timeout (in ms) configured | ||
| 680 | * by cfg80211 (essentially, wext) If set, this value overrules the value | ||
| 681 | * chosen by mac80211 based on ps qos network latency. | ||
| 652 | * | 682 | * |
| 653 | * @power_level: requested transmit power (in dBm) | 683 | * @power_level: requested transmit power (in dBm) |
| 654 | * | 684 | * |
| @@ -668,7 +698,7 @@ enum ieee80211_smps_mode { | |||
| 668 | */ | 698 | */ |
| 669 | struct ieee80211_conf { | 699 | struct ieee80211_conf { |
| 670 | u32 flags; | 700 | u32 flags; |
| 671 | int power_level, dynamic_ps_timeout; | 701 | int power_level, dynamic_ps_timeout, dynamic_ps_forced_timeout; |
| 672 | int max_sleep_period; | 702 | int max_sleep_period; |
| 673 | 703 | ||
| 674 | u16 listen_interval; | 704 | u16 listen_interval; |
| @@ -682,6 +712,28 @@ struct ieee80211_conf { | |||
| 682 | }; | 712 | }; |
| 683 | 713 | ||
| 684 | /** | 714 | /** |
| 715 | * struct ieee80211_channel_switch - holds the channel switch data | ||
| 716 | * | ||
| 717 | * The information provided in this structure is required for channel switch | ||
| 718 | * operation. | ||
| 719 | * | ||
| 720 | * @timestamp: value in microseconds of the 64-bit Time Synchronization | ||
| 721 | * Function (TSF) timer when the frame containing the channel switch | ||
| 722 | * announcement was received. This is simply the rx.mactime parameter | ||
| 723 | * the driver passed into mac80211. | ||
| 724 | * @block_tx: Indicates whether transmission must be blocked before the | ||
| 725 | * scheduled channel switch, as indicated by the AP. | ||
| 726 | * @channel: the new channel to switch to | ||
| 727 | * @count: the number of TBTT's until the channel switch event | ||
| 728 | */ | ||
| 729 | struct ieee80211_channel_switch { | ||
| 730 | u64 timestamp; | ||
| 731 | bool block_tx; | ||
| 732 | struct ieee80211_channel *channel; | ||
| 733 | u8 count; | ||
| 734 | }; | ||
| 735 | |||
| 736 | /** | ||
| 685 | * struct ieee80211_vif - per-interface data | 737 | * struct ieee80211_vif - per-interface data |
| 686 | * | 738 | * |
| 687 | * Data in this structure is continually present for driver | 739 | * Data in this structure is continually present for driver |
| @@ -779,6 +831,7 @@ struct ieee80211_key_conf { | |||
| 779 | u8 iv_len; | 831 | u8 iv_len; |
| 780 | u8 hw_key_idx; | 832 | u8 hw_key_idx; |
| 781 | u8 flags; | 833 | u8 flags; |
| 834 | u8 *ap_addr; | ||
| 782 | s8 keyidx; | 835 | s8 keyidx; |
| 783 | u8 keylen; | 836 | u8 keylen; |
| 784 | u8 key[0]; | 837 | u8 key[0]; |
| @@ -907,10 +960,6 @@ enum ieee80211_tkip_key_type { | |||
| 907 | * one milliwatt. This is the preferred method since it is standardized | 960 | * one milliwatt. This is the preferred method since it is standardized |
| 908 | * between different devices. @max_signal does not need to be set. | 961 | * between different devices. @max_signal does not need to be set. |
| 909 | * | 962 | * |
| 910 | * @IEEE80211_HW_NOISE_DBM: | ||
| 911 | * Hardware can provide noise (radio interference) values in units dBm, | ||
| 912 | * decibel difference from one milliwatt. | ||
| 913 | * | ||
| 914 | * @IEEE80211_HW_SPECTRUM_MGMT: | 963 | * @IEEE80211_HW_SPECTRUM_MGMT: |
| 915 | * Hardware supports spectrum management defined in 802.11h | 964 | * Hardware supports spectrum management defined in 802.11h |
| 916 | * Measurement, Channel Switch, Quieting, TPC | 965 | * Measurement, Channel Switch, Quieting, TPC |
| @@ -954,6 +1003,17 @@ enum ieee80211_tkip_key_type { | |||
| 954 | * Hardware can provide ack status reports of Tx frames to | 1003 | * Hardware can provide ack status reports of Tx frames to |
| 955 | * the stack. | 1004 | * the stack. |
| 956 | * | 1005 | * |
| 1006 | * @IEEE80211_HW_CONNECTION_MONITOR: | ||
| 1007 | * The hardware performs its own connection monitoring, including | ||
| 1008 | * periodic keep-alives to the AP and probing the AP on beacon loss. | ||
| 1009 | * When this flag is set, signaling beacon-loss will cause an immediate | ||
| 1010 | * change to disassociated state. | ||
| 1011 | * | ||
| 1012 | * @IEEE80211_HW_SUPPORTS_CQM_RSSI: | ||
| 1013 | * Hardware can do connection quality monitoring - i.e. it can monitor | ||
| 1014 | * connection quality related parameters, such as the RSSI level and | ||
| 1015 | * provide notifications if configured trigger levels are reached. | ||
| 1016 | * | ||
| 957 | */ | 1017 | */ |
| 958 | enum ieee80211_hw_flags { | 1018 | enum ieee80211_hw_flags { |
| 959 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 1019 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
| @@ -963,7 +1023,7 @@ enum ieee80211_hw_flags { | |||
| 963 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, | 1023 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, |
| 964 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, | 1024 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, |
| 965 | IEEE80211_HW_SIGNAL_DBM = 1<<6, | 1025 | IEEE80211_HW_SIGNAL_DBM = 1<<6, |
| 966 | IEEE80211_HW_NOISE_DBM = 1<<7, | 1026 | /* use this hole */ |
| 967 | IEEE80211_HW_SPECTRUM_MGMT = 1<<8, | 1027 | IEEE80211_HW_SPECTRUM_MGMT = 1<<8, |
| 968 | IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, | 1028 | IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, |
| 969 | IEEE80211_HW_SUPPORTS_PS = 1<<10, | 1029 | IEEE80211_HW_SUPPORTS_PS = 1<<10, |
| @@ -975,6 +1035,8 @@ enum ieee80211_hw_flags { | |||
| 975 | IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS = 1<<16, | 1035 | IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS = 1<<16, |
| 976 | IEEE80211_HW_SUPPORTS_UAPSD = 1<<17, | 1036 | IEEE80211_HW_SUPPORTS_UAPSD = 1<<17, |
| 977 | IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, | 1037 | IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, |
| 1038 | IEEE80211_HW_CONNECTION_MONITOR = 1<<19, | ||
| 1039 | IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, | ||
| 978 | }; | 1040 | }; |
| 979 | 1041 | ||
| 980 | /** | 1042 | /** |
| @@ -1591,6 +1653,11 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1591 | * @flush: Flush all pending frames from the hardware queue, making sure | 1653 | * @flush: Flush all pending frames from the hardware queue, making sure |
| 1592 | * that the hardware queues are empty. If the parameter @drop is set | 1654 | * that the hardware queues are empty. If the parameter @drop is set |
| 1593 | * to %true, pending frames may be dropped. The callback can sleep. | 1655 | * to %true, pending frames may be dropped. The callback can sleep. |
| 1656 | * | ||
| 1657 | * @channel_switch: Drivers that need (or want) to offload the channel | ||
| 1658 | * switch operation for CSAs received from the AP may implement this | ||
| 1659 | * callback. They must then call ieee80211_chswitch_done() to indicate | ||
| 1660 | * completion of the channel switch. | ||
| 1594 | */ | 1661 | */ |
| 1595 | struct ieee80211_ops { | 1662 | struct ieee80211_ops { |
| 1596 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1663 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
| @@ -1606,7 +1673,7 @@ struct ieee80211_ops { | |||
| 1606 | struct ieee80211_bss_conf *info, | 1673 | struct ieee80211_bss_conf *info, |
| 1607 | u32 changed); | 1674 | u32 changed); |
| 1608 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, | 1675 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, |
| 1609 | int mc_count, struct dev_addr_list *mc_list); | 1676 | struct netdev_hw_addr_list *mc_list); |
| 1610 | void (*configure_filter)(struct ieee80211_hw *hw, | 1677 | void (*configure_filter)(struct ieee80211_hw *hw, |
| 1611 | unsigned int changed_flags, | 1678 | unsigned int changed_flags, |
| 1612 | unsigned int *total_flags, | 1679 | unsigned int *total_flags, |
| @@ -1621,7 +1688,7 @@ struct ieee80211_ops { | |||
| 1621 | struct ieee80211_key_conf *conf, | 1688 | struct ieee80211_key_conf *conf, |
| 1622 | struct ieee80211_sta *sta, | 1689 | struct ieee80211_sta *sta, |
| 1623 | u32 iv32, u16 *phase1key); | 1690 | u32 iv32, u16 *phase1key); |
| 1624 | int (*hw_scan)(struct ieee80211_hw *hw, | 1691 | int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 1625 | struct cfg80211_scan_request *req); | 1692 | struct cfg80211_scan_request *req); |
| 1626 | void (*sw_scan_start)(struct ieee80211_hw *hw); | 1693 | void (*sw_scan_start)(struct ieee80211_hw *hw); |
| 1627 | void (*sw_scan_complete)(struct ieee80211_hw *hw); | 1694 | void (*sw_scan_complete)(struct ieee80211_hw *hw); |
| @@ -1646,13 +1713,16 @@ struct ieee80211_ops { | |||
| 1646 | struct ieee80211_vif *vif, | 1713 | struct ieee80211_vif *vif, |
| 1647 | enum ieee80211_ampdu_mlme_action action, | 1714 | enum ieee80211_ampdu_mlme_action action, |
| 1648 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); | 1715 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); |
| 1649 | 1716 | int (*get_survey)(struct ieee80211_hw *hw, int idx, | |
| 1717 | struct survey_info *survey); | ||
| 1650 | void (*rfkill_poll)(struct ieee80211_hw *hw); | 1718 | void (*rfkill_poll)(struct ieee80211_hw *hw); |
| 1651 | void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); | 1719 | void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); |
| 1652 | #ifdef CONFIG_NL80211_TESTMODE | 1720 | #ifdef CONFIG_NL80211_TESTMODE |
| 1653 | int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); | 1721 | int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); |
| 1654 | #endif | 1722 | #endif |
| 1655 | void (*flush)(struct ieee80211_hw *hw, bool drop); | 1723 | void (*flush)(struct ieee80211_hw *hw, bool drop); |
| 1724 | void (*channel_switch)(struct ieee80211_hw *hw, | ||
| 1725 | struct ieee80211_channel_switch *ch_switch); | ||
| 1656 | }; | 1726 | }; |
| 1657 | 1727 | ||
| 1658 | /** | 1728 | /** |
| @@ -1802,7 +1872,10 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw); | |||
| 1802 | * ieee80211_rx - receive frame | 1872 | * ieee80211_rx - receive frame |
| 1803 | * | 1873 | * |
| 1804 | * Use this function to hand received frames to mac80211. The receive | 1874 | * Use this function to hand received frames to mac80211. The receive |
| 1805 | * buffer in @skb must start with an IEEE 802.11 header. | 1875 | * buffer in @skb must start with an IEEE 802.11 header. In case of a |
| 1876 | * paged @skb is used, the driver is recommended to put the ieee80211 | ||
| 1877 | * header of the frame on the linear part of the @skb to avoid memory | ||
| 1878 | * allocation and/or memcpy by the stack. | ||
| 1806 | * | 1879 | * |
| 1807 | * This function may not be called in IRQ context. Calls to this function | 1880 | * This function may not be called in IRQ context. Calls to this function |
| 1808 | * for a single hardware must be synchronized against each other. Calls to | 1881 | * for a single hardware must be synchronized against each other. Calls to |
| @@ -2364,12 +2437,52 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | |||
| 2364 | * | 2437 | * |
| 2365 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 2438 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| 2366 | * | 2439 | * |
| 2367 | * When beacon filtering is enabled with IEEE80211_HW_BEACON_FILTERING and | 2440 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING and |
| 2368 | * IEEE80211_CONF_PS is set, the driver needs to inform whenever the | 2441 | * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the |
| 2369 | * hardware is not receiving beacons with this function. | 2442 | * hardware is not receiving beacons with this function. |
| 2370 | */ | 2443 | */ |
| 2371 | void ieee80211_beacon_loss(struct ieee80211_vif *vif); | 2444 | void ieee80211_beacon_loss(struct ieee80211_vif *vif); |
| 2372 | 2445 | ||
| 2446 | /** | ||
| 2447 | * ieee80211_connection_loss - inform hardware has lost connection to the AP | ||
| 2448 | * | ||
| 2449 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
| 2450 | * | ||
| 2451 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING, and | ||
| 2452 | * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver | ||
| 2453 | * needs to inform if the connection to the AP has been lost. | ||
| 2454 | * | ||
| 2455 | * This function will cause immediate change to disassociated state, | ||
| 2456 | * without connection recovery attempts. | ||
| 2457 | */ | ||
| 2458 | void ieee80211_connection_loss(struct ieee80211_vif *vif); | ||
| 2459 | |||
| 2460 | /** | ||
| 2461 | * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring | ||
| 2462 | * rssi threshold triggered | ||
| 2463 | * | ||
| 2464 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
| 2465 | * @rssi_event: the RSSI trigger event type | ||
| 2466 | * @gfp: context flags | ||
| 2467 | * | ||
| 2468 | * When the %IEEE80211_HW_SUPPORTS_CQM_RSSI is set, and a connection quality | ||
| 2469 | * monitoring is configured with an rssi threshold, the driver will inform | ||
| 2470 | * whenever the rssi level reaches the threshold. | ||
| 2471 | */ | ||
| 2472 | void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, | ||
| 2473 | enum nl80211_cqm_rssi_threshold_event rssi_event, | ||
| 2474 | gfp_t gfp); | ||
| 2475 | |||
| 2476 | /** | ||
| 2477 | * ieee80211_chswitch_done - Complete channel switch process | ||
| 2478 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
| 2479 | * @success: make the channel switch successful or not | ||
| 2480 | * | ||
| 2481 | * Complete the channel switch post-process: set the new operational channel | ||
| 2482 | * and wake up the suspended queues. | ||
| 2483 | */ | ||
| 2484 | void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success); | ||
| 2485 | |||
| 2373 | /* Rate control API */ | 2486 | /* Rate control API */ |
| 2374 | 2487 | ||
| 2375 | /** | 2488 | /** |
| @@ -2426,7 +2539,8 @@ struct rate_control_ops { | |||
| 2426 | struct ieee80211_sta *sta, void *priv_sta); | 2539 | struct ieee80211_sta *sta, void *priv_sta); |
| 2427 | void (*rate_update)(void *priv, struct ieee80211_supported_band *sband, | 2540 | void (*rate_update)(void *priv, struct ieee80211_supported_band *sband, |
| 2428 | struct ieee80211_sta *sta, | 2541 | struct ieee80211_sta *sta, |
| 2429 | void *priv_sta, u32 changed); | 2542 | void *priv_sta, u32 changed, |
| 2543 | enum nl80211_channel_type oper_chan_type); | ||
| 2430 | void (*free_sta)(void *priv, struct ieee80211_sta *sta, | 2544 | void (*free_sta)(void *priv, struct ieee80211_sta *sta, |
| 2431 | void *priv_sta); | 2545 | void *priv_sta); |
| 2432 | 2546 | ||
diff --git a/include/net/mld.h b/include/net/mld.h new file mode 100644 index 000000000000..467143cd4e2f --- /dev/null +++ b/include/net/mld.h | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | #ifndef LINUX_MLD_H | ||
| 2 | #define LINUX_MLD_H | ||
| 3 | |||
| 4 | #include <linux/in6.h> | ||
| 5 | #include <linux/icmpv6.h> | ||
| 6 | |||
| 7 | /* MLDv1 Query/Report/Done */ | ||
| 8 | struct mld_msg { | ||
| 9 | struct icmp6hdr mld_hdr; | ||
| 10 | struct in6_addr mld_mca; | ||
| 11 | }; | ||
| 12 | |||
| 13 | #define mld_type mld_hdr.icmp6_type | ||
| 14 | #define mld_code mld_hdr.icmp6_code | ||
| 15 | #define mld_cksum mld_hdr.icmp6_cksum | ||
| 16 | #define mld_maxdelay mld_hdr.icmp6_maxdelay | ||
| 17 | #define mld_reserved mld_hdr.icmp6_dataun.un_data16[1] | ||
| 18 | |||
| 19 | /* Multicast Listener Discovery version 2 headers */ | ||
| 20 | /* MLDv2 Report */ | ||
| 21 | struct mld2_grec { | ||
| 22 | __u8 grec_type; | ||
| 23 | __u8 grec_auxwords; | ||
| 24 | __be16 grec_nsrcs; | ||
| 25 | struct in6_addr grec_mca; | ||
| 26 | struct in6_addr grec_src[0]; | ||
| 27 | }; | ||
| 28 | |||
| 29 | struct mld2_report { | ||
| 30 | struct icmp6hdr mld2r_hdr; | ||
| 31 | struct mld2_grec mld2r_grec[0]; | ||
| 32 | }; | ||
| 33 | |||
| 34 | #define mld2r_type mld2r_hdr.icmp6_type | ||
| 35 | #define mld2r_resv1 mld2r_hdr.icmp6_code | ||
| 36 | #define mld2r_cksum mld2r_hdr.icmp6_cksum | ||
| 37 | #define mld2r_resv2 mld2r_hdr.icmp6_dataun.un_data16[0] | ||
| 38 | #define mld2r_ngrec mld2r_hdr.icmp6_dataun.un_data16[1] | ||
| 39 | |||
| 40 | /* MLDv2 Query */ | ||
| 41 | struct mld2_query { | ||
| 42 | struct icmp6hdr mld2q_hdr; | ||
| 43 | struct in6_addr mld2q_mca; | ||
| 44 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
| 45 | __u8 mld2q_qrv:3, | ||
| 46 | mld2q_suppress:1, | ||
| 47 | mld2q_resv2:4; | ||
| 48 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
| 49 | __u8 mld2q_resv2:4, | ||
| 50 | mld2q_suppress:1, | ||
| 51 | mld2q_qrv:3; | ||
| 52 | #else | ||
| 53 | #error "Please fix <asm/byteorder.h>" | ||
| 54 | #endif | ||
| 55 | __u8 mld2q_qqic; | ||
| 56 | __be16 mld2q_nsrcs; | ||
| 57 | struct in6_addr mld2q_srcs[0]; | ||
| 58 | }; | ||
| 59 | |||
| 60 | #define mld2q_type mld2q_hdr.icmp6_type | ||
| 61 | #define mld2q_code mld2q_hdr.icmp6_code | ||
| 62 | #define mld2q_cksum mld2q_hdr.icmp6_cksum | ||
| 63 | #define mld2q_mrc mld2q_hdr.icmp6_maxdelay | ||
| 64 | #define mld2q_resv1 mld2q_hdr.icmp6_dataun.un_data16[1] | ||
| 65 | |||
| 66 | /* Max Response Code */ | ||
| 67 | #define MLDV2_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value)) | ||
| 68 | #define MLDV2_EXP(thresh, nbmant, nbexp, value) \ | ||
| 69 | ((value) < (thresh) ? (value) : \ | ||
| 70 | ((MLDV2_MASK(value, nbmant) | (1<<(nbmant))) << \ | ||
| 71 | (MLDV2_MASK((value) >> (nbmant), nbexp) + (nbexp)))) | ||
| 72 | |||
| 73 | #define MLDV2_MRC(value) MLDV2_EXP(0x8000, 12, 3, value) | ||
| 74 | |||
| 75 | #endif | ||
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index da1d58be31b7..eb21340a573b 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
| @@ -299,6 +299,20 @@ static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) | |||
| 299 | return 0; | 299 | return 0; |
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | #ifdef CONFIG_BRIDGE_NETFILTER | ||
| 303 | static inline int neigh_hh_bridge(struct hh_cache *hh, struct sk_buff *skb) | ||
| 304 | { | ||
| 305 | unsigned seq, hh_alen; | ||
| 306 | |||
| 307 | do { | ||
| 308 | seq = read_seqbegin(&hh->hh_lock); | ||
| 309 | hh_alen = HH_DATA_ALIGN(ETH_HLEN); | ||
| 310 | memcpy(skb->data - hh_alen, hh->hh_data, ETH_ALEN + hh_alen - ETH_HLEN); | ||
| 311 | } while (read_seqretry(&hh->hh_lock, seq)); | ||
| 312 | return 0; | ||
| 313 | } | ||
| 314 | #endif | ||
| 315 | |||
| 302 | static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb) | 316 | static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb) |
| 303 | { | 317 | { |
| 304 | unsigned seq; | 318 | unsigned seq; |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 82b7be4db89a..bd10a7908993 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -100,14 +100,9 @@ struct net { | |||
| 100 | extern struct net init_net; | 100 | extern struct net init_net; |
| 101 | 101 | ||
| 102 | #ifdef CONFIG_NET | 102 | #ifdef CONFIG_NET |
| 103 | #define INIT_NET_NS(net_ns) .net_ns = &init_net, | ||
| 104 | |||
| 105 | extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns); | 103 | extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns); |
| 106 | 104 | ||
| 107 | #else /* CONFIG_NET */ | 105 | #else /* CONFIG_NET */ |
| 108 | |||
| 109 | #define INIT_NET_NS(net_ns) | ||
| 110 | |||
| 111 | static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) | 106 | static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) |
| 112 | { | 107 | { |
| 113 | /* There is nothing to copy so this is a noop */ | 108 | /* There is nothing to copy so this is a noop */ |
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index 2d2a1f9a61d8..32d15bd6efa3 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef _NF_CONNTRACK_EXTEND_H | 1 | #ifndef _NF_CONNTRACK_EXTEND_H |
| 2 | #define _NF_CONNTRACK_EXTEND_H | 2 | #define _NF_CONNTRACK_EXTEND_H |
| 3 | 3 | ||
| 4 | #include <linux/slab.h> | ||
| 5 | |||
| 4 | #include <net/netfilter/nf_conntrack.h> | 6 | #include <net/netfilter/nf_conntrack.h> |
| 5 | 7 | ||
| 6 | enum nf_ct_ext_id { | 8 | enum nf_ct_ext_id { |
diff --git a/include/net/netlabel.h b/include/net/netlabel.h index 60ebbc1fef46..9db401a8b4d9 100644 --- a/include/net/netlabel.h +++ b/include/net/netlabel.h | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #define _NETLABEL_H | 31 | #define _NETLABEL_H |
| 32 | 32 | ||
| 33 | #include <linux/types.h> | 33 | #include <linux/types.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | #include <linux/net.h> | 35 | #include <linux/net.h> |
| 35 | #include <linux/skbuff.h> | 36 | #include <linux/skbuff.h> |
| 36 | #include <linux/in.h> | 37 | #include <linux/in.h> |
diff --git a/include/net/netlink.h b/include/net/netlink.h index f82e463c875a..4fc05b58503e 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
| @@ -945,7 +945,11 @@ static inline u64 nla_get_u64(const struct nlattr *nla) | |||
| 945 | */ | 945 | */ |
| 946 | static inline __be64 nla_get_be64(const struct nlattr *nla) | 946 | static inline __be64 nla_get_be64(const struct nlattr *nla) |
| 947 | { | 947 | { |
| 948 | return *(__be64 *) nla_data(nla); | 948 | __be64 tmp; |
| 949 | |||
| 950 | nla_memcpy(&tmp, nla, sizeof(tmp)); | ||
| 951 | |||
| 952 | return tmp; | ||
| 949 | } | 953 | } |
| 950 | 954 | ||
| 951 | /** | 955 | /** |
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h index ff4982ab84b6..81a31c0db3e7 100644 --- a/include/net/netns/generic.h +++ b/include/net/netns/generic.h | |||
| @@ -14,11 +14,8 @@ | |||
| 14 | * The rules are simple: | 14 | * The rules are simple: |
| 15 | * 1. set pernet_operations->id. After register_pernet_device you | 15 | * 1. set pernet_operations->id. After register_pernet_device you |
| 16 | * will have the id of your private pointer. | 16 | * will have the id of your private pointer. |
| 17 | * 2. Either set pernet_operations->size (to have the code allocate and | 17 | * 2. set pernet_operations->size to have the code allocate and free |
| 18 | * free a private structure pointed to from struct net ) or | 18 | * a private structure pointed to from struct net. |
| 19 | * call net_assign_generic() to put the private data on the struct | ||
| 20 | * net (most preferably this should be done in the ->init callback | ||
| 21 | * of the ops registered); | ||
| 22 | * 3. do not change this pointer while the net is alive; | 19 | * 3. do not change this pointer while the net is alive; |
| 23 | * 4. do not try to have any private reference on the net_generic object. | 20 | * 4. do not try to have any private reference on the net_generic object. |
| 24 | * | 21 | * |
| @@ -46,6 +43,4 @@ static inline void *net_generic(struct net *net, int id) | |||
| 46 | 43 | ||
| 47 | return ptr; | 44 | return ptr; |
| 48 | } | 45 | } |
| 49 | |||
| 50 | extern int net_assign_generic(struct net *net, int id, void *data); | ||
| 51 | #endif | 46 | #endif |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 2764994c9136..d68c3f121774 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
| @@ -55,19 +55,14 @@ struct netns_ipv4 { | |||
| 55 | int sysctl_rt_cache_rebuild_count; | 55 | int sysctl_rt_cache_rebuild_count; |
| 56 | int current_rt_cache_rebuild_count; | 56 | int current_rt_cache_rebuild_count; |
| 57 | 57 | ||
| 58 | struct timer_list rt_secret_timer; | ||
| 59 | atomic_t rt_genid; | 58 | atomic_t rt_genid; |
| 60 | 59 | ||
| 61 | #ifdef CONFIG_IP_MROUTE | 60 | #ifdef CONFIG_IP_MROUTE |
| 62 | struct sock *mroute_sk; | 61 | #ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES |
| 63 | struct mfc_cache **mfc_cache_array; | 62 | struct mr_table *mrt; |
| 64 | struct vif_device *vif_table; | 63 | #else |
| 65 | int maxvif; | 64 | struct list_head mr_tables; |
| 66 | atomic_t cache_resolve_queue_len; | 65 | struct fib_rules_ops *mr_rules_ops; |
| 67 | int mroute_do_assert; | ||
| 68 | int mroute_do_pim; | ||
| 69 | #if defined(CONFIG_IP_PIMSM_V1) || defined(CONFIG_IP_PIMSM_V2) | ||
| 70 | int mroute_reg_vif_num; | ||
| 71 | #endif | 66 | #endif |
| 72 | #endif | 67 | #endif |
| 73 | }; | 68 | }; |
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index 1f11ebc22151..81abfcb2eb4e 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
| @@ -59,15 +59,11 @@ struct netns_ipv6 { | |||
| 59 | struct sock *tcp_sk; | 59 | struct sock *tcp_sk; |
| 60 | struct sock *igmp_sk; | 60 | struct sock *igmp_sk; |
| 61 | #ifdef CONFIG_IPV6_MROUTE | 61 | #ifdef CONFIG_IPV6_MROUTE |
| 62 | struct sock *mroute6_sk; | 62 | #ifndef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES |
| 63 | struct mfc6_cache **mfc6_cache_array; | 63 | struct mr6_table *mrt6; |
| 64 | struct mif_device *vif6_table; | 64 | #else |
| 65 | int maxvif; | 65 | struct list_head mr6_tables; |
| 66 | atomic_t cache_resolve_queue_len; | 66 | struct fib_rules_ops *mr6_rules_ops; |
| 67 | int mroute_do_assert; | ||
| 68 | int mroute_do_pim; | ||
| 69 | #ifdef CONFIG_IPV6_PIMSM_V2 | ||
| 70 | int mroute_reg_vif_num; | ||
| 71 | #endif | 67 | #endif |
| 72 | #endif | 68 | #endif |
| 73 | }; | 69 | }; |
diff --git a/include/net/netrom.h b/include/net/netrom.h index ab170a60e7d3..f0793c1cb5f8 100644 --- a/include/net/netrom.h +++ b/include/net/netrom.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | #include <linux/netrom.h> | 10 | #include <linux/netrom.h> |
| 11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
| 12 | #include <linux/slab.h> | ||
| 12 | #include <net/sock.h> | 13 | #include <net/sock.h> |
| 13 | 14 | ||
| 14 | #define NR_NETWORK_LEN 15 | 15 | #define NR_NETWORK_LEN 15 |
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index b6cdc33b39c1..9d4d87cc970e 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
| @@ -12,7 +12,7 @@ struct qdisc_walker { | |||
| 12 | int (*fn)(struct Qdisc *, unsigned long cl, struct qdisc_walker *); | 12 | int (*fn)(struct Qdisc *, unsigned long cl, struct qdisc_walker *); |
| 13 | }; | 13 | }; |
| 14 | 14 | ||
| 15 | #define QDISC_ALIGNTO 32 | 15 | #define QDISC_ALIGNTO 64 |
| 16 | #define QDISC_ALIGN(len) (((len) + QDISC_ALIGNTO-1) & ~(QDISC_ALIGNTO-1)) | 16 | #define QDISC_ALIGN(len) (((len) + QDISC_ALIGNTO-1) & ~(QDISC_ALIGNTO-1)) |
| 17 | 17 | ||
| 18 | static inline void *qdisc_priv(struct Qdisc *q) | 18 | static inline void *qdisc_priv(struct Qdisc *q) |
diff --git a/include/net/raw.h b/include/net/raw.h index 6c14a656357a..43c57502659b 100644 --- a/include/net/raw.h +++ b/include/net/raw.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | #include <net/protocol.h> | 21 | #include <net/protocol.h> |
| 22 | #include <linux/icmp.h> | ||
| 22 | 23 | ||
| 23 | extern struct proto raw_prot; | 24 | extern struct proto raw_prot; |
| 24 | 25 | ||
| @@ -56,4 +57,16 @@ int raw_seq_open(struct inode *ino, struct file *file, | |||
| 56 | void raw_hash_sk(struct sock *sk); | 57 | void raw_hash_sk(struct sock *sk); |
| 57 | void raw_unhash_sk(struct sock *sk); | 58 | void raw_unhash_sk(struct sock *sk); |
| 58 | 59 | ||
| 60 | struct raw_sock { | ||
| 61 | /* inet_sock has to be the first member */ | ||
| 62 | struct inet_sock inet; | ||
| 63 | struct icmp_filter filter; | ||
| 64 | u32 ipmr_table; | ||
| 65 | }; | ||
| 66 | |||
| 67 | static inline struct raw_sock *raw_sk(const struct sock *sk) | ||
| 68 | { | ||
| 69 | return (struct raw_sock *)sk; | ||
| 70 | } | ||
| 71 | |||
| 59 | #endif /* _RAW_H */ | 72 | #endif /* _RAW_H */ |
diff --git a/include/net/route.h b/include/net/route.h index 2c9fba7f7731..af6cf4b4c9dc 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
| @@ -112,7 +112,22 @@ extern void rt_cache_flush_batch(void); | |||
| 112 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); | 112 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); |
| 113 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); | 113 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); |
| 114 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); | 114 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); |
| 115 | extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin); | 115 | |
| 116 | extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src, | ||
| 117 | u8 tos, struct net_device *devin, bool noref); | ||
| 118 | |||
| 119 | static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src, | ||
| 120 | u8 tos, struct net_device *devin) | ||
| 121 | { | ||
| 122 | return ip_route_input_common(skb, dst, src, tos, devin, false); | ||
| 123 | } | ||
| 124 | |||
| 125 | static inline int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src, | ||
| 126 | u8 tos, struct net_device *devin) | ||
| 127 | { | ||
| 128 | return ip_route_input_common(skb, dst, src, tos, devin, true); | ||
| 129 | } | ||
| 130 | |||
| 116 | extern unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu, struct net_device *dev); | 131 | extern unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu, struct net_device *dev); |
| 117 | extern void ip_rt_send_redirect(struct sk_buff *skb); | 132 | extern void ip_rt_send_redirect(struct sk_buff *skb); |
| 118 | 133 | ||
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 67dc08eaaa45..03ca5d826757 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
| @@ -73,6 +73,7 @@ struct Qdisc { | |||
| 73 | struct sk_buff_head q; | 73 | struct sk_buff_head q; |
| 74 | struct gnet_stats_basic_packed bstats; | 74 | struct gnet_stats_basic_packed bstats; |
| 75 | struct gnet_stats_queue qstats; | 75 | struct gnet_stats_queue qstats; |
| 76 | struct rcu_head rcu_head; | ||
| 76 | }; | 77 | }; |
| 77 | 78 | ||
| 78 | struct Qdisc_class_ops { | 79 | struct Qdisc_class_ops { |
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 8be5135ff7aa..2c55a7ea20af 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
| @@ -107,6 +107,7 @@ typedef enum { | |||
| 107 | SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */ | 107 | SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */ |
| 108 | SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ | 108 | SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ |
| 109 | SCTP_CMD_SEND_MSG, /* Send the whole use message */ | 109 | SCTP_CMD_SEND_MSG, /* Send the whole use message */ |
| 110 | SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */ | ||
| 110 | SCTP_CMD_LAST | 111 | SCTP_CMD_LAST |
| 111 | } sctp_verb_t; | 112 | } sctp_verb_t; |
| 112 | 113 | ||
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 78740ec57d5d..65946bc43d00 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
| @@ -128,6 +128,7 @@ extern int sctp_register_pf(struct sctp_pf *, sa_family_t); | |||
| 128 | int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb); | 128 | int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb); |
| 129 | int sctp_inet_listen(struct socket *sock, int backlog); | 129 | int sctp_inet_listen(struct socket *sock, int backlog); |
| 130 | void sctp_write_space(struct sock *sk); | 130 | void sctp_write_space(struct sock *sk); |
| 131 | void sctp_data_ready(struct sock *sk, int len); | ||
| 131 | unsigned int sctp_poll(struct file *file, struct socket *sock, | 132 | unsigned int sctp_poll(struct file *file, struct socket *sock, |
| 132 | poll_table *wait); | 133 | poll_table *wait); |
| 133 | void sctp_sock_rfree(struct sk_buff *skb); | 134 | void sctp_sock_rfree(struct sk_buff *skb); |
| @@ -268,7 +269,7 @@ enum { | |||
| 268 | #define SCTP_MIB_MAX __SCTP_MIB_MAX | 269 | #define SCTP_MIB_MAX __SCTP_MIB_MAX |
| 269 | struct sctp_mib { | 270 | struct sctp_mib { |
| 270 | unsigned long mibs[SCTP_MIB_MAX]; | 271 | unsigned long mibs[SCTP_MIB_MAX]; |
| 271 | } __SNMP_MIB_ALIGN__; | 272 | }; |
| 272 | 273 | ||
| 273 | 274 | ||
| 274 | /* Print debugging messages. */ | 275 | /* Print debugging messages. */ |
| @@ -546,7 +547,7 @@ for (pos = chunk->subh.fwdtsn_hdr->skip;\ | |||
| 546 | #define WORD_ROUND(s) (((s)+3)&~3) | 547 | #define WORD_ROUND(s) (((s)+3)&~3) |
| 547 | 548 | ||
| 548 | /* Make a new instance of type. */ | 549 | /* Make a new instance of type. */ |
| 549 | #define t_new(type, flags) (type *)kmalloc(sizeof(type), flags) | 550 | #define t_new(type, flags) (type *)kzalloc(sizeof(type), flags) |
| 550 | 551 | ||
| 551 | /* Compare two timevals. */ | 552 | /* Compare two timevals. */ |
| 552 | #define tv_lt(s, t) \ | 553 | #define tv_lt(s, t) \ |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 851c813adb3a..4088c89a9055 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
| @@ -279,6 +279,7 @@ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype, | |||
| 279 | /* 2nd level prototypes */ | 279 | /* 2nd level prototypes */ |
| 280 | void sctp_generate_t3_rtx_event(unsigned long peer); | 280 | void sctp_generate_t3_rtx_event(unsigned long peer); |
| 281 | void sctp_generate_heartbeat_event(unsigned long peer); | 281 | void sctp_generate_heartbeat_event(unsigned long peer); |
| 282 | void sctp_generate_proto_unreach_event(unsigned long peer); | ||
| 282 | 283 | ||
| 283 | void sctp_ootb_pkt_free(struct sctp_packet *); | 284 | void sctp_ootb_pkt_free(struct sctp_packet *); |
| 284 | 285 | ||
| @@ -437,7 +438,7 @@ sctp_vtag_verify_either(const struct sctp_chunk *chunk, | |||
| 437 | */ | 438 | */ |
| 438 | if ((!sctp_test_T_bit(chunk) && | 439 | if ((!sctp_test_T_bit(chunk) && |
| 439 | (ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag)) || | 440 | (ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag)) || |
| 440 | (sctp_test_T_bit(chunk) && | 441 | (sctp_test_T_bit(chunk) && asoc->c.peer_vtag && |
| 441 | (ntohl(chunk->sctp_hdr->vtag) == asoc->c.peer_vtag))) { | 442 | (ntohl(chunk->sctp_hdr->vtag) == asoc->c.peer_vtag))) { |
| 442 | return 1; | 443 | return 1; |
| 443 | } | 444 | } |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index ff3017744711..6173c619913a 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -643,17 +643,15 @@ struct sctp_pf { | |||
| 643 | struct sctp_datamsg { | 643 | struct sctp_datamsg { |
| 644 | /* Chunks waiting to be submitted to lower layer. */ | 644 | /* Chunks waiting to be submitted to lower layer. */ |
| 645 | struct list_head chunks; | 645 | struct list_head chunks; |
| 646 | /* Chunks that have been transmitted. */ | ||
| 647 | size_t msg_size; | ||
| 648 | /* Reference counting. */ | 646 | /* Reference counting. */ |
| 649 | atomic_t refcnt; | 647 | atomic_t refcnt; |
| 650 | /* When is this message no longer interesting to the peer? */ | 648 | /* When is this message no longer interesting to the peer? */ |
| 651 | unsigned long expires_at; | 649 | unsigned long expires_at; |
| 652 | /* Did the messenge fail to send? */ | 650 | /* Did the messenge fail to send? */ |
| 653 | int send_error; | 651 | int send_error; |
| 654 | char send_failed; | 652 | u8 send_failed:1, |
| 655 | /* Control whether chunks from this message can be abandoned. */ | 653 | can_abandon:1, /* can chunks from this message can be abandoned. */ |
| 656 | char can_abandon; | 654 | can_delay; /* should this message be Nagle delayed */ |
| 657 | }; | 655 | }; |
| 658 | 656 | ||
| 659 | struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *, | 657 | struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *, |
| @@ -757,7 +755,6 @@ struct sctp_chunk { | |||
| 757 | #define SCTP_NEED_FRTX 0x1 | 755 | #define SCTP_NEED_FRTX 0x1 |
| 758 | #define SCTP_DONT_FRTX 0x2 | 756 | #define SCTP_DONT_FRTX 0x2 |
| 759 | __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ | 757 | __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ |
| 760 | resent:1, /* Has this chunk ever been resent. */ | ||
| 761 | has_tsn:1, /* Does this chunk have a TSN yet? */ | 758 | has_tsn:1, /* Does this chunk have a TSN yet? */ |
| 762 | has_ssn:1, /* Does this chunk have a SSN yet? */ | 759 | has_ssn:1, /* Does this chunk have a SSN yet? */ |
| 763 | singleton:1, /* Only chunk in the packet? */ | 760 | singleton:1, /* Only chunk in the packet? */ |
| @@ -778,6 +775,7 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len, | |||
| 778 | struct iovec *data); | 775 | struct iovec *data); |
| 779 | void sctp_chunk_free(struct sctp_chunk *); | 776 | void sctp_chunk_free(struct sctp_chunk *); |
| 780 | void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); | 777 | void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); |
| 778 | void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data); | ||
| 781 | struct sctp_chunk *sctp_chunkify(struct sk_buff *, | 779 | struct sctp_chunk *sctp_chunkify(struct sk_buff *, |
| 782 | const struct sctp_association *, | 780 | const struct sctp_association *, |
| 783 | struct sock *); | 781 | struct sock *); |
| @@ -878,7 +876,30 @@ struct sctp_transport { | |||
| 878 | 876 | ||
| 879 | /* Reference counting. */ | 877 | /* Reference counting. */ |
| 880 | atomic_t refcnt; | 878 | atomic_t refcnt; |
| 881 | int dead; | 879 | int dead:1, |
| 880 | /* RTO-Pending : A flag used to track if one of the DATA | ||
| 881 | * chunks sent to this address is currently being | ||
| 882 | * used to compute a RTT. If this flag is 0, | ||
| 883 | * the next DATA chunk sent to this destination | ||
| 884 | * should be used to compute a RTT and this flag | ||
| 885 | * should be set. Every time the RTT | ||
| 886 | * calculation completes (i.e. the DATA chunk | ||
| 887 | * is SACK'd) clear this flag. | ||
| 888 | */ | ||
| 889 | rto_pending:1, | ||
| 890 | |||
| 891 | /* | ||
| 892 | * hb_sent : a flag that signals that we have a pending | ||
| 893 | * heartbeat. | ||
| 894 | */ | ||
| 895 | hb_sent:1, | ||
| 896 | |||
| 897 | /* Is the Path MTU update pending on this tranport */ | ||
| 898 | pmtu_pending:1, | ||
| 899 | |||
| 900 | /* Is this structure kfree()able? */ | ||
| 901 | malloced:1; | ||
| 902 | |||
| 882 | 903 | ||
| 883 | /* This is the peer's IP address and port. */ | 904 | /* This is the peer's IP address and port. */ |
| 884 | union sctp_addr ipaddr; | 905 | union sctp_addr ipaddr; |
| @@ -908,22 +929,6 @@ struct sctp_transport { | |||
| 908 | /* SRTT : The current smoothed round trip time. */ | 929 | /* SRTT : The current smoothed round trip time. */ |
| 909 | __u32 srtt; | 930 | __u32 srtt; |
| 910 | 931 | ||
| 911 | /* RTO-Pending : A flag used to track if one of the DATA | ||
| 912 | * chunks sent to this address is currently being | ||
| 913 | * used to compute a RTT. If this flag is 0, | ||
| 914 | * the next DATA chunk sent to this destination | ||
| 915 | * should be used to compute a RTT and this flag | ||
| 916 | * should be set. Every time the RTT | ||
| 917 | * calculation completes (i.e. the DATA chunk | ||
| 918 | * is SACK'd) clear this flag. | ||
| 919 | * hb_sent : a flag that signals that we have a pending heartbeat. | ||
| 920 | */ | ||
| 921 | __u8 rto_pending; | ||
| 922 | __u8 hb_sent; | ||
| 923 | |||
| 924 | /* Flag to track the current fast recovery state */ | ||
| 925 | __u8 fast_recovery; | ||
| 926 | |||
| 927 | /* | 932 | /* |
| 928 | * These are the congestion stats. | 933 | * These are the congestion stats. |
| 929 | */ | 934 | */ |
| @@ -943,9 +948,6 @@ struct sctp_transport { | |||
| 943 | 948 | ||
| 944 | __u32 burst_limited; /* Holds old cwnd when max.burst is applied */ | 949 | __u32 burst_limited; /* Holds old cwnd when max.burst is applied */ |
| 945 | 950 | ||
| 946 | /* TSN marking the fast recovery exit point */ | ||
| 947 | __u32 fast_recovery_exit; | ||
| 948 | |||
| 949 | /* Destination */ | 951 | /* Destination */ |
| 950 | struct dst_entry *dst; | 952 | struct dst_entry *dst; |
| 951 | /* Source address. */ | 953 | /* Source address. */ |
| @@ -976,9 +978,6 @@ struct sctp_transport { | |||
| 976 | */ | 978 | */ |
| 977 | __u16 pathmaxrxt; | 979 | __u16 pathmaxrxt; |
| 978 | 980 | ||
| 979 | /* is the Path MTU update pending on this tranport */ | ||
| 980 | __u8 pmtu_pending; | ||
| 981 | |||
| 982 | /* PMTU : The current known path MTU. */ | 981 | /* PMTU : The current known path MTU. */ |
| 983 | __u32 pathmtu; | 982 | __u32 pathmtu; |
| 984 | 983 | ||
| @@ -1009,6 +1008,9 @@ struct sctp_transport { | |||
| 1009 | /* Heartbeat timer is per destination. */ | 1008 | /* Heartbeat timer is per destination. */ |
| 1010 | struct timer_list hb_timer; | 1009 | struct timer_list hb_timer; |
| 1011 | 1010 | ||
| 1011 | /* Timer to handle ICMP proto unreachable envets */ | ||
| 1012 | struct timer_list proto_unreach_timer; | ||
| 1013 | |||
| 1012 | /* Since we're using per-destination retransmission timers | 1014 | /* Since we're using per-destination retransmission timers |
| 1013 | * (see above), we're also using per-destination "transmitted" | 1015 | * (see above), we're also using per-destination "transmitted" |
| 1014 | * queues. This probably ought to be a private struct | 1016 | * queues. This probably ought to be a private struct |
| @@ -1022,8 +1024,6 @@ struct sctp_transport { | |||
| 1022 | /* This is the list of transports that have chunks to send. */ | 1024 | /* This is the list of transports that have chunks to send. */ |
| 1023 | struct list_head send_ready; | 1025 | struct list_head send_ready; |
| 1024 | 1026 | ||
| 1025 | int malloced; /* Is this structure kfree()able? */ | ||
| 1026 | |||
| 1027 | /* State information saved for SFR_CACC algorithm. The key | 1027 | /* State information saved for SFR_CACC algorithm. The key |
| 1028 | * idea in SFR_CACC is to maintain state at the sender on a | 1028 | * idea in SFR_CACC is to maintain state at the sender on a |
| 1029 | * per-destination basis when a changeover happens. | 1029 | * per-destination basis when a changeover happens. |
| @@ -1065,7 +1065,7 @@ void sctp_transport_route(struct sctp_transport *, union sctp_addr *, | |||
| 1065 | struct sctp_sock *); | 1065 | struct sctp_sock *); |
| 1066 | void sctp_transport_pmtu(struct sctp_transport *); | 1066 | void sctp_transport_pmtu(struct sctp_transport *); |
| 1067 | void sctp_transport_free(struct sctp_transport *); | 1067 | void sctp_transport_free(struct sctp_transport *); |
| 1068 | void sctp_transport_reset_timers(struct sctp_transport *, int); | 1068 | void sctp_transport_reset_timers(struct sctp_transport *); |
| 1069 | void sctp_transport_hold(struct sctp_transport *); | 1069 | void sctp_transport_hold(struct sctp_transport *); |
| 1070 | void sctp_transport_put(struct sctp_transport *); | 1070 | void sctp_transport_put(struct sctp_transport *); |
| 1071 | void sctp_transport_update_rto(struct sctp_transport *, __u32); | 1071 | void sctp_transport_update_rto(struct sctp_transport *, __u32); |
| @@ -1719,6 +1719,12 @@ struct sctp_association { | |||
| 1719 | /* Highest TSN that is acknowledged by incoming SACKs. */ | 1719 | /* Highest TSN that is acknowledged by incoming SACKs. */ |
| 1720 | __u32 highest_sacked; | 1720 | __u32 highest_sacked; |
| 1721 | 1721 | ||
| 1722 | /* TSN marking the fast recovery exit point */ | ||
| 1723 | __u32 fast_recovery_exit; | ||
| 1724 | |||
| 1725 | /* Flag to track the current fast recovery state */ | ||
| 1726 | __u8 fast_recovery; | ||
| 1727 | |||
| 1722 | /* The number of unacknowledged data chunks. Reported through | 1728 | /* The number of unacknowledged data chunks. Reported through |
| 1723 | * the SCTP_STATUS sockopt. | 1729 | * the SCTP_STATUS sockopt. |
| 1724 | */ | 1730 | */ |
diff --git a/include/net/snmp.h b/include/net/snmp.h index 692ee0061dc4..92456f1035f5 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
| @@ -52,26 +52,11 @@ struct snmp_mib { | |||
| 52 | * count on the 20Gb/s + networks people expect in a few years time! | 52 | * count on the 20Gb/s + networks people expect in a few years time! |
| 53 | */ | 53 | */ |
| 54 | 54 | ||
| 55 | /* | ||
| 56 | * The rule for padding: | ||
| 57 | * Best is power of two because then the right structure can be found by a | ||
| 58 | * simple shift. The structure should be always cache line aligned. | ||
| 59 | * gcc needs n=alignto(cachelinesize, popcnt(sizeof(bla_mib))) shift/add | ||
| 60 | * instructions to emulate multiply in case it is not power-of-two. | ||
| 61 | * Currently n is always <=3 for all sizes so simple cache line alignment | ||
| 62 | * is enough. | ||
| 63 | * | ||
| 64 | * The best solution would be a global CPU local area , especially on 64 | ||
| 65 | * and 128byte cacheline machine it makes a *lot* of sense -AK | ||
| 66 | */ | ||
| 67 | |||
| 68 | #define __SNMP_MIB_ALIGN__ ____cacheline_aligned | ||
| 69 | |||
| 70 | /* IPstats */ | 55 | /* IPstats */ |
| 71 | #define IPSTATS_MIB_MAX __IPSTATS_MIB_MAX | 56 | #define IPSTATS_MIB_MAX __IPSTATS_MIB_MAX |
| 72 | struct ipstats_mib { | 57 | struct ipstats_mib { |
| 73 | unsigned long mibs[IPSTATS_MIB_MAX]; | 58 | unsigned long mibs[IPSTATS_MIB_MAX]; |
| 74 | } __SNMP_MIB_ALIGN__; | 59 | }; |
| 75 | 60 | ||
| 76 | /* ICMP */ | 61 | /* ICMP */ |
| 77 | #define ICMP_MIB_DUMMY __ICMP_MIB_MAX | 62 | #define ICMP_MIB_DUMMY __ICMP_MIB_MAX |
| @@ -79,36 +64,36 @@ struct ipstats_mib { | |||
| 79 | 64 | ||
| 80 | struct icmp_mib { | 65 | struct icmp_mib { |
| 81 | unsigned long mibs[ICMP_MIB_MAX]; | 66 | unsigned long mibs[ICMP_MIB_MAX]; |
| 82 | } __SNMP_MIB_ALIGN__; | 67 | }; |
| 83 | 68 | ||
| 84 | #define ICMPMSG_MIB_MAX __ICMPMSG_MIB_MAX | 69 | #define ICMPMSG_MIB_MAX __ICMPMSG_MIB_MAX |
| 85 | struct icmpmsg_mib { | 70 | struct icmpmsg_mib { |
| 86 | unsigned long mibs[ICMPMSG_MIB_MAX]; | 71 | unsigned long mibs[ICMPMSG_MIB_MAX]; |
| 87 | } __SNMP_MIB_ALIGN__; | 72 | }; |
| 88 | 73 | ||
| 89 | /* ICMP6 (IPv6-ICMP) */ | 74 | /* ICMP6 (IPv6-ICMP) */ |
| 90 | #define ICMP6_MIB_MAX __ICMP6_MIB_MAX | 75 | #define ICMP6_MIB_MAX __ICMP6_MIB_MAX |
| 91 | struct icmpv6_mib { | 76 | struct icmpv6_mib { |
| 92 | unsigned long mibs[ICMP6_MIB_MAX]; | 77 | unsigned long mibs[ICMP6_MIB_MAX]; |
| 93 | } __SNMP_MIB_ALIGN__; | 78 | }; |
| 94 | 79 | ||
| 95 | #define ICMP6MSG_MIB_MAX __ICMP6MSG_MIB_MAX | 80 | #define ICMP6MSG_MIB_MAX __ICMP6MSG_MIB_MAX |
| 96 | struct icmpv6msg_mib { | 81 | struct icmpv6msg_mib { |
| 97 | unsigned long mibs[ICMP6MSG_MIB_MAX]; | 82 | unsigned long mibs[ICMP6MSG_MIB_MAX]; |
| 98 | } __SNMP_MIB_ALIGN__; | 83 | }; |
| 99 | 84 | ||
| 100 | 85 | ||
| 101 | /* TCP */ | 86 | /* TCP */ |
| 102 | #define TCP_MIB_MAX __TCP_MIB_MAX | 87 | #define TCP_MIB_MAX __TCP_MIB_MAX |
| 103 | struct tcp_mib { | 88 | struct tcp_mib { |
| 104 | unsigned long mibs[TCP_MIB_MAX]; | 89 | unsigned long mibs[TCP_MIB_MAX]; |
| 105 | } __SNMP_MIB_ALIGN__; | 90 | }; |
| 106 | 91 | ||
| 107 | /* UDP */ | 92 | /* UDP */ |
| 108 | #define UDP_MIB_MAX __UDP_MIB_MAX | 93 | #define UDP_MIB_MAX __UDP_MIB_MAX |
| 109 | struct udp_mib { | 94 | struct udp_mib { |
| 110 | unsigned long mibs[UDP_MIB_MAX]; | 95 | unsigned long mibs[UDP_MIB_MAX]; |
| 111 | } __SNMP_MIB_ALIGN__; | 96 | }; |
| 112 | 97 | ||
| 113 | /* Linux */ | 98 | /* Linux */ |
| 114 | #define LINUX_MIB_MAX __LINUX_MIB_MAX | 99 | #define LINUX_MIB_MAX __LINUX_MIB_MAX |
| @@ -148,6 +133,8 @@ struct linux_xfrm_mib { | |||
| 148 | __this_cpu_add(mib[0]->mibs[field], addend) | 133 | __this_cpu_add(mib[0]->mibs[field], addend) |
| 149 | #define SNMP_ADD_STATS_USER(mib, field, addend) \ | 134 | #define SNMP_ADD_STATS_USER(mib, field, addend) \ |
| 150 | this_cpu_add(mib[1]->mibs[field], addend) | 135 | this_cpu_add(mib[1]->mibs[field], addend) |
| 136 | #define SNMP_ADD_STATS(mib, field, addend) \ | ||
| 137 | this_cpu_add(mib[0]->mibs[field], addend) | ||
| 151 | /* | 138 | /* |
| 152 | * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr" | 139 | * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr" |
| 153 | * to make @ptr a non-percpu pointer. | 140 | * to make @ptr a non-percpu pointer. |
diff --git a/include/net/sock.h b/include/net/sock.h index 6cb1676e409a..5697caf8cc76 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -51,6 +51,7 @@ | |||
| 51 | #include <linux/skbuff.h> /* struct sk_buff */ | 51 | #include <linux/skbuff.h> /* struct sk_buff */ |
| 52 | #include <linux/mm.h> | 52 | #include <linux/mm.h> |
| 53 | #include <linux/security.h> | 53 | #include <linux/security.h> |
| 54 | #include <linux/slab.h> | ||
| 54 | 55 | ||
| 55 | #include <linux/filter.h> | 56 | #include <linux/filter.h> |
| 56 | #include <linux/rculist_nulls.h> | 57 | #include <linux/rculist_nulls.h> |
| @@ -73,7 +74,7 @@ | |||
| 73 | printk(KERN_DEBUG msg); } while (0) | 74 | printk(KERN_DEBUG msg); } while (0) |
| 74 | #else | 75 | #else |
| 75 | /* Validate arguments and do nothing */ | 76 | /* Validate arguments and do nothing */ |
| 76 | static void inline int __attribute__ ((format (printf, 2, 3))) | 77 | static inline void __attribute__ ((format (printf, 2, 3))) |
| 77 | SOCK_DEBUG(struct sock *sk, const char *msg, ...) | 78 | SOCK_DEBUG(struct sock *sk, const char *msg, ...) |
| 78 | { | 79 | { |
| 79 | } | 80 | } |
| @@ -158,7 +159,7 @@ struct sock_common { | |||
| 158 | * @sk_userlocks: %SO_SNDBUF and %SO_RCVBUF settings | 159 | * @sk_userlocks: %SO_SNDBUF and %SO_RCVBUF settings |
| 159 | * @sk_lock: synchronizer | 160 | * @sk_lock: synchronizer |
| 160 | * @sk_rcvbuf: size of receive buffer in bytes | 161 | * @sk_rcvbuf: size of receive buffer in bytes |
| 161 | * @sk_sleep: sock wait queue | 162 | * @sk_wq: sock wait queue and async head |
| 162 | * @sk_dst_cache: destination cache | 163 | * @sk_dst_cache: destination cache |
| 163 | * @sk_dst_lock: destination cache lock | 164 | * @sk_dst_lock: destination cache lock |
| 164 | * @sk_policy: flow policy | 165 | * @sk_policy: flow policy |
| @@ -176,6 +177,7 @@ struct sock_common { | |||
| 176 | * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings | 177 | * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings |
| 177 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets | 178 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets |
| 178 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) | 179 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) |
| 180 | * @sk_route_nocaps: forbidden route capabilities (e.g NETIF_F_GSO_MASK) | ||
| 179 | * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) | 181 | * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) |
| 180 | * @sk_gso_max_size: Maximum GSO segment size to build | 182 | * @sk_gso_max_size: Maximum GSO segment size to build |
| 181 | * @sk_lingertime: %SO_LINGER l_linger setting | 183 | * @sk_lingertime: %SO_LINGER l_linger setting |
| @@ -197,6 +199,7 @@ struct sock_common { | |||
| 197 | * @sk_rcvlowat: %SO_RCVLOWAT setting | 199 | * @sk_rcvlowat: %SO_RCVLOWAT setting |
| 198 | * @sk_rcvtimeo: %SO_RCVTIMEO setting | 200 | * @sk_rcvtimeo: %SO_RCVTIMEO setting |
| 199 | * @sk_sndtimeo: %SO_SNDTIMEO setting | 201 | * @sk_sndtimeo: %SO_SNDTIMEO setting |
| 202 | * @sk_rxhash: flow hash received from netif layer | ||
| 200 | * @sk_filter: socket filtering instructions | 203 | * @sk_filter: socket filtering instructions |
| 201 | * @sk_protinfo: private area, net family specific, when not using slab | 204 | * @sk_protinfo: private area, net family specific, when not using slab |
| 202 | * @sk_timer: sock cleanup timer | 205 | * @sk_timer: sock cleanup timer |
| @@ -253,13 +256,14 @@ struct sock { | |||
| 253 | struct { | 256 | struct { |
| 254 | struct sk_buff *head; | 257 | struct sk_buff *head; |
| 255 | struct sk_buff *tail; | 258 | struct sk_buff *tail; |
| 259 | int len; | ||
| 256 | } sk_backlog; | 260 | } sk_backlog; |
| 257 | wait_queue_head_t *sk_sleep; | 261 | struct socket_wq *sk_wq; |
| 258 | struct dst_entry *sk_dst_cache; | 262 | struct dst_entry *sk_dst_cache; |
| 259 | #ifdef CONFIG_XFRM | 263 | #ifdef CONFIG_XFRM |
| 260 | struct xfrm_policy *sk_policy[2]; | 264 | struct xfrm_policy *sk_policy[2]; |
| 261 | #endif | 265 | #endif |
| 262 | rwlock_t sk_dst_lock; | 266 | spinlock_t sk_dst_lock; |
| 263 | atomic_t sk_rmem_alloc; | 267 | atomic_t sk_rmem_alloc; |
| 264 | atomic_t sk_wmem_alloc; | 268 | atomic_t sk_wmem_alloc; |
| 265 | atomic_t sk_omem_alloc; | 269 | atomic_t sk_omem_alloc; |
| @@ -273,9 +277,13 @@ struct sock { | |||
| 273 | int sk_forward_alloc; | 277 | int sk_forward_alloc; |
| 274 | gfp_t sk_allocation; | 278 | gfp_t sk_allocation; |
| 275 | int sk_route_caps; | 279 | int sk_route_caps; |
| 280 | int sk_route_nocaps; | ||
| 276 | int sk_gso_type; | 281 | int sk_gso_type; |
| 277 | unsigned int sk_gso_max_size; | 282 | unsigned int sk_gso_max_size; |
| 278 | int sk_rcvlowat; | 283 | int sk_rcvlowat; |
| 284 | #ifdef CONFIG_RPS | ||
| 285 | __u32 sk_rxhash; | ||
| 286 | #endif | ||
| 279 | unsigned long sk_flags; | 287 | unsigned long sk_flags; |
| 280 | unsigned long sk_lingertime; | 288 | unsigned long sk_lingertime; |
| 281 | struct sk_buff_head sk_error_queue; | 289 | struct sk_buff_head sk_error_queue; |
| @@ -589,23 +597,81 @@ static inline int sk_stream_memory_free(struct sock *sk) | |||
| 589 | return sk->sk_wmem_queued < sk->sk_sndbuf; | 597 | return sk->sk_wmem_queued < sk->sk_sndbuf; |
| 590 | } | 598 | } |
| 591 | 599 | ||
| 592 | /* The per-socket spinlock must be held here. */ | 600 | /* OOB backlog add */ |
| 593 | static inline void sk_add_backlog(struct sock *sk, struct sk_buff *skb) | 601 | static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) |
| 594 | { | 602 | { |
| 595 | if (!sk->sk_backlog.tail) { | 603 | /* dont let skb dst not refcounted, we are going to leave rcu lock */ |
| 596 | sk->sk_backlog.head = sk->sk_backlog.tail = skb; | 604 | skb_dst_force(skb); |
| 597 | } else { | 605 | |
| 606 | if (!sk->sk_backlog.tail) | ||
| 607 | sk->sk_backlog.head = skb; | ||
| 608 | else | ||
| 598 | sk->sk_backlog.tail->next = skb; | 609 | sk->sk_backlog.tail->next = skb; |
| 599 | sk->sk_backlog.tail = skb; | 610 | |
| 600 | } | 611 | sk->sk_backlog.tail = skb; |
| 601 | skb->next = NULL; | 612 | skb->next = NULL; |
| 602 | } | 613 | } |
| 603 | 614 | ||
| 615 | /* | ||
| 616 | * Take into account size of receive queue and backlog queue | ||
| 617 | */ | ||
| 618 | static inline bool sk_rcvqueues_full(const struct sock *sk, const struct sk_buff *skb) | ||
| 619 | { | ||
| 620 | unsigned int qsize = sk->sk_backlog.len + atomic_read(&sk->sk_rmem_alloc); | ||
| 621 | |||
| 622 | return qsize + skb->truesize > sk->sk_rcvbuf; | ||
| 623 | } | ||
| 624 | |||
| 625 | /* The per-socket spinlock must be held here. */ | ||
| 626 | static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *skb) | ||
| 627 | { | ||
| 628 | if (sk_rcvqueues_full(sk, skb)) | ||
| 629 | return -ENOBUFS; | ||
| 630 | |||
| 631 | __sk_add_backlog(sk, skb); | ||
| 632 | sk->sk_backlog.len += skb->truesize; | ||
| 633 | return 0; | ||
| 634 | } | ||
| 635 | |||
| 604 | static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) | 636 | static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) |
| 605 | { | 637 | { |
| 606 | return sk->sk_backlog_rcv(sk, skb); | 638 | return sk->sk_backlog_rcv(sk, skb); |
| 607 | } | 639 | } |
| 608 | 640 | ||
| 641 | static inline void sock_rps_record_flow(const struct sock *sk) | ||
| 642 | { | ||
| 643 | #ifdef CONFIG_RPS | ||
| 644 | struct rps_sock_flow_table *sock_flow_table; | ||
| 645 | |||
| 646 | rcu_read_lock(); | ||
| 647 | sock_flow_table = rcu_dereference(rps_sock_flow_table); | ||
| 648 | rps_record_sock_flow(sock_flow_table, sk->sk_rxhash); | ||
| 649 | rcu_read_unlock(); | ||
| 650 | #endif | ||
| 651 | } | ||
| 652 | |||
| 653 | static inline void sock_rps_reset_flow(const struct sock *sk) | ||
| 654 | { | ||
| 655 | #ifdef CONFIG_RPS | ||
| 656 | struct rps_sock_flow_table *sock_flow_table; | ||
| 657 | |||
| 658 | rcu_read_lock(); | ||
| 659 | sock_flow_table = rcu_dereference(rps_sock_flow_table); | ||
| 660 | rps_reset_sock_flow(sock_flow_table, sk->sk_rxhash); | ||
| 661 | rcu_read_unlock(); | ||
| 662 | #endif | ||
| 663 | } | ||
| 664 | |||
| 665 | static inline void sock_rps_save_rxhash(struct sock *sk, u32 rxhash) | ||
| 666 | { | ||
| 667 | #ifdef CONFIG_RPS | ||
| 668 | if (unlikely(sk->sk_rxhash != rxhash)) { | ||
| 669 | sock_rps_reset_flow(sk); | ||
| 670 | sk->sk_rxhash = rxhash; | ||
| 671 | } | ||
| 672 | #endif | ||
| 673 | } | ||
| 674 | |||
| 609 | #define sk_wait_event(__sk, __timeo, __condition) \ | 675 | #define sk_wait_event(__sk, __timeo, __condition) \ |
| 610 | ({ int __rc; \ | 676 | ({ int __rc; \ |
| 611 | release_sock(__sk); \ | 677 | release_sock(__sk); \ |
| @@ -960,6 +1026,16 @@ extern void release_sock(struct sock *sk); | |||
| 960 | SINGLE_DEPTH_NESTING) | 1026 | SINGLE_DEPTH_NESTING) |
| 961 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) | 1027 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) |
| 962 | 1028 | ||
| 1029 | static inline void lock_sock_bh(struct sock *sk) | ||
| 1030 | { | ||
| 1031 | spin_lock_bh(&sk->sk_lock.slock); | ||
| 1032 | } | ||
| 1033 | |||
| 1034 | static inline void unlock_sock_bh(struct sock *sk) | ||
| 1035 | { | ||
| 1036 | spin_unlock_bh(&sk->sk_lock.slock); | ||
| 1037 | } | ||
| 1038 | |||
| 963 | extern struct sock *sk_alloc(struct net *net, int family, | 1039 | extern struct sock *sk_alloc(struct net *net, int family, |
| 964 | gfp_t priority, | 1040 | gfp_t priority, |
| 965 | struct proto *prot); | 1041 | struct proto *prot); |
| @@ -1146,6 +1222,10 @@ static inline void sk_set_socket(struct sock *sk, struct socket *sock) | |||
| 1146 | sk->sk_socket = sock; | 1222 | sk->sk_socket = sock; |
| 1147 | } | 1223 | } |
| 1148 | 1224 | ||
| 1225 | static inline wait_queue_head_t *sk_sleep(struct sock *sk) | ||
| 1226 | { | ||
| 1227 | return &sk->sk_wq->wait; | ||
| 1228 | } | ||
| 1149 | /* Detach socket from process context. | 1229 | /* Detach socket from process context. |
| 1150 | * Announce socket dead, detach it from wait queue and inode. | 1230 | * Announce socket dead, detach it from wait queue and inode. |
| 1151 | * Note that parent inode held reference count on this struct sock, | 1231 | * Note that parent inode held reference count on this struct sock, |
| @@ -1158,14 +1238,14 @@ static inline void sock_orphan(struct sock *sk) | |||
| 1158 | write_lock_bh(&sk->sk_callback_lock); | 1238 | write_lock_bh(&sk->sk_callback_lock); |
| 1159 | sock_set_flag(sk, SOCK_DEAD); | 1239 | sock_set_flag(sk, SOCK_DEAD); |
| 1160 | sk_set_socket(sk, NULL); | 1240 | sk_set_socket(sk, NULL); |
| 1161 | sk->sk_sleep = NULL; | 1241 | sk->sk_wq = NULL; |
| 1162 | write_unlock_bh(&sk->sk_callback_lock); | 1242 | write_unlock_bh(&sk->sk_callback_lock); |
| 1163 | } | 1243 | } |
| 1164 | 1244 | ||
| 1165 | static inline void sock_graft(struct sock *sk, struct socket *parent) | 1245 | static inline void sock_graft(struct sock *sk, struct socket *parent) |
| 1166 | { | 1246 | { |
| 1167 | write_lock_bh(&sk->sk_callback_lock); | 1247 | write_lock_bh(&sk->sk_callback_lock); |
| 1168 | sk->sk_sleep = &parent->wait; | 1248 | rcu_assign_pointer(sk->sk_wq, parent->wq); |
| 1169 | parent->sk = sk; | 1249 | parent->sk = sk; |
| 1170 | sk_set_socket(sk, parent); | 1250 | sk_set_socket(sk, parent); |
| 1171 | security_sock_graft(sk, parent); | 1251 | security_sock_graft(sk, parent); |
| @@ -1178,7 +1258,9 @@ extern unsigned long sock_i_ino(struct sock *sk); | |||
| 1178 | static inline struct dst_entry * | 1258 | static inline struct dst_entry * |
| 1179 | __sk_dst_get(struct sock *sk) | 1259 | __sk_dst_get(struct sock *sk) |
| 1180 | { | 1260 | { |
| 1181 | return sk->sk_dst_cache; | 1261 | return rcu_dereference_check(sk->sk_dst_cache, rcu_read_lock_held() || |
| 1262 | sock_owned_by_user(sk) || | ||
| 1263 | lockdep_is_held(&sk->sk_lock.slock)); | ||
| 1182 | } | 1264 | } |
| 1183 | 1265 | ||
| 1184 | static inline struct dst_entry * | 1266 | static inline struct dst_entry * |
| @@ -1186,50 +1268,65 @@ sk_dst_get(struct sock *sk) | |||
| 1186 | { | 1268 | { |
| 1187 | struct dst_entry *dst; | 1269 | struct dst_entry *dst; |
| 1188 | 1270 | ||
| 1189 | read_lock(&sk->sk_dst_lock); | 1271 | rcu_read_lock(); |
| 1190 | dst = sk->sk_dst_cache; | 1272 | dst = rcu_dereference(sk->sk_dst_cache); |
| 1191 | if (dst) | 1273 | if (dst) |
| 1192 | dst_hold(dst); | 1274 | dst_hold(dst); |
| 1193 | read_unlock(&sk->sk_dst_lock); | 1275 | rcu_read_unlock(); |
| 1194 | return dst; | 1276 | return dst; |
| 1195 | } | 1277 | } |
| 1196 | 1278 | ||
| 1279 | extern void sk_reset_txq(struct sock *sk); | ||
| 1280 | |||
| 1281 | static inline void dst_negative_advice(struct sock *sk) | ||
| 1282 | { | ||
| 1283 | struct dst_entry *ndst, *dst = __sk_dst_get(sk); | ||
| 1284 | |||
| 1285 | if (dst && dst->ops->negative_advice) { | ||
| 1286 | ndst = dst->ops->negative_advice(dst); | ||
| 1287 | |||
| 1288 | if (ndst != dst) { | ||
| 1289 | rcu_assign_pointer(sk->sk_dst_cache, ndst); | ||
| 1290 | sk_reset_txq(sk); | ||
| 1291 | } | ||
| 1292 | } | ||
| 1293 | } | ||
| 1294 | |||
| 1197 | static inline void | 1295 | static inline void |
| 1198 | __sk_dst_set(struct sock *sk, struct dst_entry *dst) | 1296 | __sk_dst_set(struct sock *sk, struct dst_entry *dst) |
| 1199 | { | 1297 | { |
| 1200 | struct dst_entry *old_dst; | 1298 | struct dst_entry *old_dst; |
| 1201 | 1299 | ||
| 1202 | sk_tx_queue_clear(sk); | 1300 | sk_tx_queue_clear(sk); |
| 1203 | old_dst = sk->sk_dst_cache; | 1301 | /* |
| 1204 | sk->sk_dst_cache = dst; | 1302 | * This can be called while sk is owned by the caller only, |
| 1303 | * with no state that can be checked in a rcu_dereference_check() cond | ||
| 1304 | */ | ||
| 1305 | old_dst = rcu_dereference_raw(sk->sk_dst_cache); | ||
| 1306 | rcu_assign_pointer(sk->sk_dst_cache, dst); | ||
| 1205 | dst_release(old_dst); | 1307 | dst_release(old_dst); |
| 1206 | } | 1308 | } |
| 1207 | 1309 | ||
| 1208 | static inline void | 1310 | static inline void |
| 1209 | sk_dst_set(struct sock *sk, struct dst_entry *dst) | 1311 | sk_dst_set(struct sock *sk, struct dst_entry *dst) |
| 1210 | { | 1312 | { |
| 1211 | write_lock(&sk->sk_dst_lock); | 1313 | spin_lock(&sk->sk_dst_lock); |
| 1212 | __sk_dst_set(sk, dst); | 1314 | __sk_dst_set(sk, dst); |
| 1213 | write_unlock(&sk->sk_dst_lock); | 1315 | spin_unlock(&sk->sk_dst_lock); |
| 1214 | } | 1316 | } |
| 1215 | 1317 | ||
| 1216 | static inline void | 1318 | static inline void |
| 1217 | __sk_dst_reset(struct sock *sk) | 1319 | __sk_dst_reset(struct sock *sk) |
| 1218 | { | 1320 | { |
| 1219 | struct dst_entry *old_dst; | 1321 | __sk_dst_set(sk, NULL); |
| 1220 | |||
| 1221 | sk_tx_queue_clear(sk); | ||
| 1222 | old_dst = sk->sk_dst_cache; | ||
| 1223 | sk->sk_dst_cache = NULL; | ||
| 1224 | dst_release(old_dst); | ||
| 1225 | } | 1322 | } |
| 1226 | 1323 | ||
| 1227 | static inline void | 1324 | static inline void |
| 1228 | sk_dst_reset(struct sock *sk) | 1325 | sk_dst_reset(struct sock *sk) |
| 1229 | { | 1326 | { |
| 1230 | write_lock(&sk->sk_dst_lock); | 1327 | spin_lock(&sk->sk_dst_lock); |
| 1231 | __sk_dst_reset(sk); | 1328 | __sk_dst_reset(sk); |
| 1232 | write_unlock(&sk->sk_dst_lock); | 1329 | spin_unlock(&sk->sk_dst_lock); |
| 1233 | } | 1330 | } |
| 1234 | 1331 | ||
| 1235 | extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie); | 1332 | extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie); |
| @@ -1243,6 +1340,12 @@ static inline int sk_can_gso(const struct sock *sk) | |||
| 1243 | 1340 | ||
| 1244 | extern void sk_setup_caps(struct sock *sk, struct dst_entry *dst); | 1341 | extern void sk_setup_caps(struct sock *sk, struct dst_entry *dst); |
| 1245 | 1342 | ||
| 1343 | static inline void sk_nocaps_add(struct sock *sk, int flags) | ||
| 1344 | { | ||
| 1345 | sk->sk_route_nocaps |= flags; | ||
| 1346 | sk->sk_route_caps &= ~flags; | ||
| 1347 | } | ||
| 1348 | |||
| 1246 | static inline int skb_copy_to_page(struct sock *sk, char __user *from, | 1349 | static inline int skb_copy_to_page(struct sock *sk, char __user *from, |
| 1247 | struct sk_buff *skb, struct page *page, | 1350 | struct sk_buff *skb, struct page *page, |
| 1248 | int off, int copy) | 1351 | int off, int copy) |
| @@ -1300,12 +1403,12 @@ static inline int sk_has_allocations(const struct sock *sk) | |||
| 1300 | } | 1403 | } |
| 1301 | 1404 | ||
| 1302 | /** | 1405 | /** |
| 1303 | * sk_has_sleeper - check if there are any waiting processes | 1406 | * wq_has_sleeper - check if there are any waiting processes |
| 1304 | * @sk: socket | 1407 | * @sk: struct socket_wq |
| 1305 | * | 1408 | * |
| 1306 | * Returns true if socket has waiting processes | 1409 | * Returns true if socket_wq has waiting processes |
| 1307 | * | 1410 | * |
| 1308 | * The purpose of the sk_has_sleeper and sock_poll_wait is to wrap the memory | 1411 | * The purpose of the wq_has_sleeper and sock_poll_wait is to wrap the memory |
| 1309 | * barrier call. They were added due to the race found within the tcp code. | 1412 | * barrier call. They were added due to the race found within the tcp code. |
| 1310 | * | 1413 | * |
| 1311 | * Consider following tcp code paths: | 1414 | * Consider following tcp code paths: |
| @@ -1318,9 +1421,10 @@ static inline int sk_has_allocations(const struct sock *sk) | |||
| 1318 | * ... ... | 1421 | * ... ... |
| 1319 | * tp->rcv_nxt check sock_def_readable | 1422 | * tp->rcv_nxt check sock_def_readable |
| 1320 | * ... { | 1423 | * ... { |
| 1321 | * schedule ... | 1424 | * schedule rcu_read_lock(); |
| 1322 | * if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) | 1425 | * wq = rcu_dereference(sk->sk_wq); |
| 1323 | * wake_up_interruptible(sk->sk_sleep) | 1426 | * if (wq && waitqueue_active(&wq->wait)) |
| 1427 | * wake_up_interruptible(&wq->wait) | ||
| 1324 | * ... | 1428 | * ... |
| 1325 | * } | 1429 | * } |
| 1326 | * | 1430 | * |
| @@ -1329,19 +1433,18 @@ static inline int sk_has_allocations(const struct sock *sk) | |||
| 1329 | * could then endup calling schedule and sleep forever if there are no more | 1433 | * could then endup calling schedule and sleep forever if there are no more |
| 1330 | * data on the socket. | 1434 | * data on the socket. |
| 1331 | * | 1435 | * |
| 1332 | * The sk_has_sleeper is always called right after a call to read_lock, so we | ||
| 1333 | * can use smp_mb__after_lock barrier. | ||
| 1334 | */ | 1436 | */ |
| 1335 | static inline int sk_has_sleeper(struct sock *sk) | 1437 | static inline bool wq_has_sleeper(struct socket_wq *wq) |
| 1336 | { | 1438 | { |
| 1439 | |||
| 1337 | /* | 1440 | /* |
| 1338 | * We need to be sure we are in sync with the | 1441 | * We need to be sure we are in sync with the |
| 1339 | * add_wait_queue modifications to the wait queue. | 1442 | * add_wait_queue modifications to the wait queue. |
| 1340 | * | 1443 | * |
| 1341 | * This memory barrier is paired in the sock_poll_wait. | 1444 | * This memory barrier is paired in the sock_poll_wait. |
| 1342 | */ | 1445 | */ |
| 1343 | smp_mb__after_lock(); | 1446 | smp_mb(); |
| 1344 | return sk->sk_sleep && waitqueue_active(sk->sk_sleep); | 1447 | return wq && waitqueue_active(&wq->wait); |
| 1345 | } | 1448 | } |
| 1346 | 1449 | ||
| 1347 | /** | 1450 | /** |
| @@ -1350,7 +1453,7 @@ static inline int sk_has_sleeper(struct sock *sk) | |||
| 1350 | * @wait_address: socket wait queue | 1453 | * @wait_address: socket wait queue |
| 1351 | * @p: poll_table | 1454 | * @p: poll_table |
| 1352 | * | 1455 | * |
| 1353 | * See the comments in the sk_has_sleeper function. | 1456 | * See the comments in the wq_has_sleeper function. |
| 1354 | */ | 1457 | */ |
| 1355 | static inline void sock_poll_wait(struct file *filp, | 1458 | static inline void sock_poll_wait(struct file *filp, |
| 1356 | wait_queue_head_t *wait_address, poll_table *p) | 1459 | wait_queue_head_t *wait_address, poll_table *p) |
| @@ -1361,7 +1464,7 @@ static inline void sock_poll_wait(struct file *filp, | |||
| 1361 | * We need to be sure we are in sync with the | 1464 | * We need to be sure we are in sync with the |
| 1362 | * socket flags modification. | 1465 | * socket flags modification. |
| 1363 | * | 1466 | * |
| 1364 | * This memory barrier is paired in the sk_has_sleeper. | 1467 | * This memory barrier is paired in the wq_has_sleeper. |
| 1365 | */ | 1468 | */ |
| 1366 | smp_mb(); | 1469 | smp_mb(); |
| 1367 | } | 1470 | } |
| @@ -1543,7 +1646,24 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | |||
| 1543 | sk->sk_stamp = kt; | 1646 | sk->sk_stamp = kt; |
| 1544 | } | 1647 | } |
| 1545 | 1648 | ||
| 1546 | extern void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, struct sk_buff *skb); | 1649 | extern void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, |
| 1650 | struct sk_buff *skb); | ||
| 1651 | |||
| 1652 | static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, | ||
| 1653 | struct sk_buff *skb) | ||
| 1654 | { | ||
| 1655 | #define FLAGS_TS_OR_DROPS ((1UL << SOCK_RXQ_OVFL) | \ | ||
| 1656 | (1UL << SOCK_RCVTSTAMP) | \ | ||
| 1657 | (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE) | \ | ||
| 1658 | (1UL << SOCK_TIMESTAMPING_SOFTWARE) | \ | ||
| 1659 | (1UL << SOCK_TIMESTAMPING_RAW_HARDWARE) | \ | ||
| 1660 | (1UL << SOCK_TIMESTAMPING_SYS_HARDWARE)) | ||
| 1661 | |||
| 1662 | if (sk->sk_flags & FLAGS_TS_OR_DROPS) | ||
| 1663 | __sock_recv_ts_and_drops(msg, sk, skb); | ||
| 1664 | else | ||
| 1665 | sk->sk_stamp = skb->tstamp; | ||
| 1666 | } | ||
| 1547 | 1667 | ||
| 1548 | /** | 1668 | /** |
| 1549 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped | 1669 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 56f0aec40ed6..a1449144848a 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -294,6 +294,7 @@ extern struct proto tcp_prot; | |||
| 294 | #define TCP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.tcp_statistics, field) | 294 | #define TCP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->mib.tcp_statistics, field) |
| 295 | #define TCP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->mib.tcp_statistics, field) | 295 | #define TCP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->mib.tcp_statistics, field) |
| 296 | #define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) | 296 | #define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) |
| 297 | #define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val) | ||
| 297 | 298 | ||
| 298 | extern void tcp_v4_err(struct sk_buff *skb, u32); | 299 | extern void tcp_v4_err(struct sk_buff *skb, u32); |
| 299 | 300 | ||
| @@ -423,7 +424,7 @@ extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); | |||
| 423 | * TCP v4 functions exported for the inet6 API | 424 | * TCP v4 functions exported for the inet6 API |
| 424 | */ | 425 | */ |
| 425 | 426 | ||
| 426 | extern void tcp_v4_send_check(struct sock *sk, int len, | 427 | extern void tcp_v4_send_check(struct sock *sk, |
| 427 | struct sk_buff *skb); | 428 | struct sk_buff *skb); |
| 428 | 429 | ||
| 429 | extern int tcp_v4_conn_request(struct sock *sk, | 430 | extern int tcp_v4_conn_request(struct sock *sk, |
| @@ -939,7 +940,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb) | |||
| 939 | 940 | ||
| 940 | tp->ucopy.memory = 0; | 941 | tp->ucopy.memory = 0; |
| 941 | } else if (skb_queue_len(&tp->ucopy.prequeue) == 1) { | 942 | } else if (skb_queue_len(&tp->ucopy.prequeue) == 1) { |
| 942 | wake_up_interruptible_poll(sk->sk_sleep, | 943 | wake_up_interruptible_sync_poll(sk_sleep(sk), |
| 943 | POLLIN | POLLRDNORM | POLLRDBAND); | 944 | POLLIN | POLLRDNORM | POLLRDBAND); |
| 944 | if (!inet_csk_ack_scheduled(sk)) | 945 | if (!inet_csk_ack_scheduled(sk)) |
| 945 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK, | 946 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK, |
| @@ -1032,6 +1033,14 @@ static inline int keepalive_probes(const struct tcp_sock *tp) | |||
| 1032 | return tp->keepalive_probes ? : sysctl_tcp_keepalive_probes; | 1033 | return tp->keepalive_probes ? : sysctl_tcp_keepalive_probes; |
| 1033 | } | 1034 | } |
| 1034 | 1035 | ||
| 1036 | static inline u32 keepalive_time_elapsed(const struct tcp_sock *tp) | ||
| 1037 | { | ||
| 1038 | const struct inet_connection_sock *icsk = &tp->inet_conn; | ||
| 1039 | |||
| 1040 | return min_t(u32, tcp_time_stamp - icsk->icsk_ack.lrcvtime, | ||
| 1041 | tcp_time_stamp - tp->rcv_tstamp); | ||
| 1042 | } | ||
| 1043 | |||
| 1035 | static inline int tcp_fin_time(const struct sock *sk) | 1044 | static inline int tcp_fin_time(const struct sock *sk) |
| 1036 | { | 1045 | { |
| 1037 | int fin_timeout = tcp_sk(sk)->linger2 ? : sysctl_tcp_fin_timeout; | 1046 | int fin_timeout = tcp_sk(sk)->linger2 ? : sysctl_tcp_fin_timeout; |
| @@ -1197,30 +1206,15 @@ extern int tcp_v4_md5_do_del(struct sock *sk, | |||
| 1197 | extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *); | 1206 | extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *); |
| 1198 | extern void tcp_free_md5sig_pool(void); | 1207 | extern void tcp_free_md5sig_pool(void); |
| 1199 | 1208 | ||
| 1200 | extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu); | 1209 | extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void); |
| 1201 | extern void __tcp_put_md5sig_pool(void); | 1210 | extern void tcp_put_md5sig_pool(void); |
| 1211 | |||
| 1202 | extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *); | 1212 | extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *); |
| 1203 | extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *, | 1213 | extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *, |
| 1204 | unsigned header_len); | 1214 | unsigned header_len); |
| 1205 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, | 1215 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, |
| 1206 | struct tcp_md5sig_key *key); | 1216 | struct tcp_md5sig_key *key); |
| 1207 | 1217 | ||
| 1208 | static inline | ||
| 1209 | struct tcp_md5sig_pool *tcp_get_md5sig_pool(void) | ||
| 1210 | { | ||
| 1211 | int cpu = get_cpu(); | ||
| 1212 | struct tcp_md5sig_pool *ret = __tcp_get_md5sig_pool(cpu); | ||
| 1213 | if (!ret) | ||
| 1214 | put_cpu(); | ||
| 1215 | return ret; | ||
| 1216 | } | ||
| 1217 | |||
| 1218 | static inline void tcp_put_md5sig_pool(void) | ||
| 1219 | { | ||
| 1220 | __tcp_put_md5sig_pool(); | ||
| 1221 | put_cpu(); | ||
| 1222 | } | ||
| 1223 | |||
| 1224 | /* write queue abstraction */ | 1218 | /* write queue abstraction */ |
| 1225 | static inline void tcp_write_queue_purge(struct sock *sk) | 1219 | static inline void tcp_write_queue_purge(struct sock *sk) |
| 1226 | { | 1220 | { |
diff --git a/include/net/tipc/tipc.h b/include/net/tipc/tipc.h index 9566608c88cf..15af6dca0b49 100644 --- a/include/net/tipc/tipc.h +++ b/include/net/tipc/tipc.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * include/net/tipc/tipc.h: Main include file for TIPC users | 2 | * include/net/tipc/tipc.h: Main include file for TIPC users |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2003-2006, Ericsson AB | 4 | * Copyright (c) 2003-2006, Ericsson AB |
| 5 | * Copyright (c) 2005, Wind River Systems | 5 | * Copyright (c) 2005,2010 Wind River Systems |
| 6 | * All rights reserved. | 6 | * All rights reserved. |
| 7 | * | 7 | * |
| 8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without |
| @@ -126,7 +126,7 @@ int tipc_createport(unsigned int tipc_user, | |||
| 126 | tipc_msg_event message_cb, | 126 | tipc_msg_event message_cb, |
| 127 | tipc_named_msg_event named_message_cb, | 127 | tipc_named_msg_event named_message_cb, |
| 128 | tipc_conn_msg_event conn_message_cb, | 128 | tipc_conn_msg_event conn_message_cb, |
| 129 | tipc_continue_event continue_event_cb,/* May be zero */ | 129 | tipc_continue_event continue_event_cb, |
| 130 | u32 *portref); | 130 | u32 *portref); |
| 131 | 131 | ||
| 132 | int tipc_deleteport(u32 portref); | 132 | int tipc_deleteport(u32 portref); |
| @@ -145,13 +145,13 @@ int tipc_set_portunreturnable(u32 portref, unsigned int isunreturnable); | |||
| 145 | int tipc_publish(u32 portref, unsigned int scope, | 145 | int tipc_publish(u32 portref, unsigned int scope, |
| 146 | struct tipc_name_seq const *name_seq); | 146 | struct tipc_name_seq const *name_seq); |
| 147 | int tipc_withdraw(u32 portref, unsigned int scope, | 147 | int tipc_withdraw(u32 portref, unsigned int scope, |
| 148 | struct tipc_name_seq const *name_seq); /* 0: all */ | 148 | struct tipc_name_seq const *name_seq); |
| 149 | 149 | ||
| 150 | int tipc_connect2port(u32 portref, struct tipc_portid const *port); | 150 | int tipc_connect2port(u32 portref, struct tipc_portid const *port); |
| 151 | 151 | ||
| 152 | int tipc_disconnect(u32 portref); | 152 | int tipc_disconnect(u32 portref); |
| 153 | 153 | ||
| 154 | int tipc_shutdown(u32 ref); /* Sends SHUTDOWN msg */ | 154 | int tipc_shutdown(u32 ref); |
| 155 | 155 | ||
| 156 | int tipc_isconnected(u32 portref, int *isconnected); | 156 | int tipc_isconnected(u32 portref, int *isconnected); |
| 157 | 157 | ||
| @@ -176,7 +176,7 @@ int tipc_send_buf(u32 portref, | |||
| 176 | 176 | ||
| 177 | int tipc_send2name(u32 portref, | 177 | int tipc_send2name(u32 portref, |
| 178 | struct tipc_name const *name, | 178 | struct tipc_name const *name, |
| 179 | u32 domain, /* 0:own zone */ | 179 | u32 domain, |
| 180 | unsigned int num_sect, | 180 | unsigned int num_sect, |
| 181 | struct iovec const *msg_sect); | 181 | struct iovec const *msg_sect); |
| 182 | 182 | ||
| @@ -188,7 +188,7 @@ int tipc_send_buf2name(u32 portref, | |||
| 188 | 188 | ||
| 189 | int tipc_forward2name(u32 portref, | 189 | int tipc_forward2name(u32 portref, |
| 190 | struct tipc_name const *name, | 190 | struct tipc_name const *name, |
| 191 | u32 domain, /*0: own zone */ | 191 | u32 domain, |
| 192 | unsigned int section_count, | 192 | unsigned int section_count, |
| 193 | struct iovec const *msg_sect, | 193 | struct iovec const *msg_sect, |
| 194 | struct tipc_portid const *origin, | 194 | struct tipc_portid const *origin, |
| @@ -228,14 +228,14 @@ int tipc_forward_buf2port(u32 portref, | |||
| 228 | 228 | ||
| 229 | int tipc_multicast(u32 portref, | 229 | int tipc_multicast(u32 portref, |
| 230 | struct tipc_name_seq const *seq, | 230 | struct tipc_name_seq const *seq, |
| 231 | u32 domain, /* 0:own zone */ | 231 | u32 domain, /* currently unused */ |
| 232 | unsigned int section_count, | 232 | unsigned int section_count, |
| 233 | struct iovec const *msg); | 233 | struct iovec const *msg); |
| 234 | 234 | ||
| 235 | #if 0 | 235 | #if 0 |
| 236 | int tipc_multicast_buf(u32 portref, | 236 | int tipc_multicast_buf(u32 portref, |
| 237 | struct tipc_name_seq const *seq, | 237 | struct tipc_name_seq const *seq, |
| 238 | u32 domain, /* 0:own zone */ | 238 | u32 domain, |
| 239 | void *buf, | 239 | void *buf, |
| 240 | unsigned int size); | 240 | unsigned int size); |
| 241 | #endif | 241 | #endif |
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h index d65381cad0fc..42a0eb68b7b6 100644 --- a/include/net/transp_v6.h +++ b/include/net/transp_v6.h | |||
| @@ -44,7 +44,8 @@ extern int datagram_send_ctl(struct net *net, | |||
| 44 | struct msghdr *msg, | 44 | struct msghdr *msg, |
| 45 | struct flowi *fl, | 45 | struct flowi *fl, |
| 46 | struct ipv6_txoptions *opt, | 46 | struct ipv6_txoptions *opt, |
| 47 | int *hlimit, int *tclass); | 47 | int *hlimit, int *tclass, |
| 48 | int *dontfrag); | ||
| 48 | 49 | ||
| 49 | #define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006) | 50 | #define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006) |
| 50 | 51 | ||
diff --git a/include/net/x25.h b/include/net/x25.h index 9baa07dc7d17..1479cb4a41fc 100644 --- a/include/net/x25.h +++ b/include/net/x25.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #ifndef _X25_H | 10 | #ifndef _X25_H |
| 11 | #define _X25_H | 11 | #define _X25_H |
| 12 | #include <linux/x25.h> | 12 | #include <linux/x25.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <net/sock.h> | 14 | #include <net/sock.h> |
| 14 | 15 | ||
| 15 | #define X25_ADDR_LEN 16 | 16 | #define X25_ADDR_LEN 16 |
| @@ -79,8 +80,6 @@ enum { | |||
| 79 | #define X25_DEFAULT_PACKET_SIZE X25_PS128 /* Default Packet Size */ | 80 | #define X25_DEFAULT_PACKET_SIZE X25_PS128 /* Default Packet Size */ |
| 80 | #define X25_DEFAULT_THROUGHPUT 0x0A /* Deafult Throughput */ | 81 | #define X25_DEFAULT_THROUGHPUT 0x0A /* Deafult Throughput */ |
| 81 | #define X25_DEFAULT_REVERSE 0x00 /* Default Reverse Charging */ | 82 | #define X25_DEFAULT_REVERSE 0x00 /* Default Reverse Charging */ |
| 82 | #define X25_DENY_ACCPT_APPRV 0x01 /* Default value */ | ||
| 83 | #define X25_ALLOW_ACCPT_APPRV 0x00 /* Control enabled */ | ||
| 84 | 83 | ||
| 85 | #define X25_SMODULUS 8 | 84 | #define X25_SMODULUS 8 |
| 86 | #define X25_EMODULUS 128 | 85 | #define X25_EMODULUS 128 |
| @@ -112,6 +111,11 @@ enum { | |||
| 112 | #define X25_MAX_AE_LEN 40 /* Max num of semi-octets in AE - OSI Nw */ | 111 | #define X25_MAX_AE_LEN 40 /* Max num of semi-octets in AE - OSI Nw */ |
| 113 | #define X25_MAX_DTE_FACIL_LEN 21 /* Max length of DTE facility params */ | 112 | #define X25_MAX_DTE_FACIL_LEN 21 /* Max length of DTE facility params */ |
| 114 | 113 | ||
| 114 | /* Bitset in x25_sock->flags for misc flags */ | ||
| 115 | #define X25_Q_BIT_FLAG 0 | ||
| 116 | #define X25_INTERRUPT_FLAG 1 | ||
| 117 | #define X25_ACCPT_APPRV_FLAG 2 | ||
| 118 | |||
| 115 | /** | 119 | /** |
| 116 | * struct x25_route - x25 routing entry | 120 | * struct x25_route - x25 routing entry |
| 117 | * @node - entry in x25_list_lock | 121 | * @node - entry in x25_list_lock |
| @@ -145,10 +149,11 @@ struct x25_sock { | |||
| 145 | struct x25_address source_addr, dest_addr; | 149 | struct x25_address source_addr, dest_addr; |
| 146 | struct x25_neigh *neighbour; | 150 | struct x25_neigh *neighbour; |
| 147 | unsigned int lci, cudmatchlength; | 151 | unsigned int lci, cudmatchlength; |
| 148 | unsigned char state, condition, qbitincl, intflag, accptapprv; | 152 | unsigned char state, condition; |
| 149 | unsigned short vs, vr, va, vl; | 153 | unsigned short vs, vr, va, vl; |
| 150 | unsigned long t2, t21, t22, t23; | 154 | unsigned long t2, t21, t22, t23; |
| 151 | unsigned short fraglen; | 155 | unsigned short fraglen; |
| 156 | unsigned long flags; | ||
| 152 | struct sk_buff_head ack_queue; | 157 | struct sk_buff_head ack_queue; |
| 153 | struct sk_buff_head fragment_queue; | 158 | struct sk_buff_head fragment_queue; |
| 154 | struct sk_buff_head interrupt_in_queue; | 159 | struct sk_buff_head interrupt_in_queue; |
| @@ -182,6 +187,10 @@ extern int sysctl_x25_clear_request_timeout; | |||
| 182 | extern int sysctl_x25_ack_holdback_timeout; | 187 | extern int sysctl_x25_ack_holdback_timeout; |
| 183 | extern int sysctl_x25_forward; | 188 | extern int sysctl_x25_forward; |
| 184 | 189 | ||
| 190 | extern int x25_parse_address_block(struct sk_buff *skb, | ||
| 191 | struct x25_address *called_addr, | ||
| 192 | struct x25_address *calling_addr); | ||
| 193 | |||
| 185 | extern int x25_addr_ntoa(unsigned char *, struct x25_address *, | 194 | extern int x25_addr_ntoa(unsigned char *, struct x25_address *, |
| 186 | struct x25_address *); | 195 | struct x25_address *); |
| 187 | extern int x25_addr_aton(unsigned char *, struct x25_address *, | 196 | extern int x25_addr_aton(unsigned char *, struct x25_address *, |
diff --git a/include/net/x25device.h b/include/net/x25device.h index 1415bcf93980..1fa08b49f1c2 100644 --- a/include/net/x25device.h +++ b/include/net/x25device.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/if_ether.h> | 4 | #include <linux/if_ether.h> |
| 5 | #include <linux/if_packet.h> | 5 | #include <linux/if_packet.h> |
| 6 | #include <linux/if_x25.h> | ||
| 6 | #include <linux/skbuff.h> | 7 | #include <linux/skbuff.h> |
| 7 | 8 | ||
| 8 | static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev) | 9 | static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev) |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index a7df3275b860..1913af67c43d 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/in6.h> | 12 | #include <linux/in6.h> |
| 13 | #include <linux/mutex.h> | 13 | #include <linux/mutex.h> |
| 14 | #include <linux/audit.h> | 14 | #include <linux/audit.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | 16 | ||
| 16 | #include <net/sock.h> | 17 | #include <net/sock.h> |
| 17 | #include <net/dst.h> | 18 | #include <net/dst.h> |
| @@ -19,6 +20,7 @@ | |||
| 19 | #include <net/route.h> | 20 | #include <net/route.h> |
| 20 | #include <net/ipv6.h> | 21 | #include <net/ipv6.h> |
| 21 | #include <net/ip6_fib.h> | 22 | #include <net/ip6_fib.h> |
| 23 | #include <net/flow.h> | ||
| 22 | 24 | ||
| 23 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
| 24 | 26 | ||
| @@ -266,7 +268,6 @@ struct xfrm_policy_afinfo { | |||
| 266 | xfrm_address_t *saddr, | 268 | xfrm_address_t *saddr, |
| 267 | xfrm_address_t *daddr); | 269 | xfrm_address_t *daddr); |
| 268 | int (*get_saddr)(struct net *net, xfrm_address_t *saddr, xfrm_address_t *daddr); | 270 | int (*get_saddr)(struct net *net, xfrm_address_t *saddr, xfrm_address_t *daddr); |
| 269 | struct dst_entry *(*find_bundle)(struct flowi *fl, struct xfrm_policy *policy); | ||
| 270 | void (*decode_session)(struct sk_buff *skb, | 271 | void (*decode_session)(struct sk_buff *skb, |
| 271 | struct flowi *fl, | 272 | struct flowi *fl, |
| 272 | int reverse); | 273 | int reverse); |
| @@ -275,7 +276,8 @@ struct xfrm_policy_afinfo { | |||
| 275 | struct dst_entry *dst, | 276 | struct dst_entry *dst, |
| 276 | int nfheader_len); | 277 | int nfheader_len); |
| 277 | int (*fill_dst)(struct xfrm_dst *xdst, | 278 | int (*fill_dst)(struct xfrm_dst *xdst, |
| 278 | struct net_device *dev); | 279 | struct net_device *dev, |
| 280 | struct flowi *fl); | ||
| 279 | }; | 281 | }; |
| 280 | 282 | ||
| 281 | extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); | 283 | extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); |
| @@ -480,13 +482,14 @@ struct xfrm_policy { | |||
| 480 | atomic_t refcnt; | 482 | atomic_t refcnt; |
| 481 | struct timer_list timer; | 483 | struct timer_list timer; |
| 482 | 484 | ||
| 485 | struct flow_cache_object flo; | ||
| 486 | atomic_t genid; | ||
| 483 | u32 priority; | 487 | u32 priority; |
| 484 | u32 index; | 488 | u32 index; |
| 485 | struct xfrm_mark mark; | 489 | struct xfrm_mark mark; |
| 486 | struct xfrm_selector selector; | 490 | struct xfrm_selector selector; |
| 487 | struct xfrm_lifetime_cfg lft; | 491 | struct xfrm_lifetime_cfg lft; |
| 488 | struct xfrm_lifetime_cur curlft; | 492 | struct xfrm_lifetime_cur curlft; |
| 489 | struct dst_entry *bundles; | ||
| 490 | struct xfrm_policy_walk_entry walk; | 493 | struct xfrm_policy_walk_entry walk; |
| 491 | u8 type; | 494 | u8 type; |
| 492 | u8 action; | 495 | u8 action; |
| @@ -733,19 +736,12 @@ static inline void xfrm_pol_put(struct xfrm_policy *policy) | |||
| 733 | xfrm_policy_destroy(policy); | 736 | xfrm_policy_destroy(policy); |
| 734 | } | 737 | } |
| 735 | 738 | ||
| 736 | #ifdef CONFIG_XFRM_SUB_POLICY | ||
| 737 | static inline void xfrm_pols_put(struct xfrm_policy **pols, int npols) | 739 | static inline void xfrm_pols_put(struct xfrm_policy **pols, int npols) |
| 738 | { | 740 | { |
| 739 | int i; | 741 | int i; |
| 740 | for (i = npols - 1; i >= 0; --i) | 742 | for (i = npols - 1; i >= 0; --i) |
| 741 | xfrm_pol_put(pols[i]); | 743 | xfrm_pol_put(pols[i]); |
| 742 | } | 744 | } |
| 743 | #else | ||
| 744 | static inline void xfrm_pols_put(struct xfrm_policy **pols, int npols) | ||
| 745 | { | ||
| 746 | xfrm_pol_put(pols[0]); | ||
| 747 | } | ||
| 748 | #endif | ||
| 749 | 745 | ||
| 750 | extern void __xfrm_state_destroy(struct xfrm_state *); | 746 | extern void __xfrm_state_destroy(struct xfrm_state *); |
| 751 | 747 | ||
| @@ -876,11 +872,15 @@ struct xfrm_dst { | |||
| 876 | struct rt6_info rt6; | 872 | struct rt6_info rt6; |
| 877 | } u; | 873 | } u; |
| 878 | struct dst_entry *route; | 874 | struct dst_entry *route; |
| 875 | struct flow_cache_object flo; | ||
| 876 | struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX]; | ||
| 877 | int num_pols, num_xfrms; | ||
| 879 | #ifdef CONFIG_XFRM_SUB_POLICY | 878 | #ifdef CONFIG_XFRM_SUB_POLICY |
| 880 | struct flowi *origin; | 879 | struct flowi *origin; |
| 881 | struct xfrm_selector *partner; | 880 | struct xfrm_selector *partner; |
| 882 | #endif | 881 | #endif |
| 883 | u32 genid; | 882 | u32 xfrm_genid; |
| 883 | u32 policy_genid; | ||
| 884 | u32 route_mtu_cached; | 884 | u32 route_mtu_cached; |
| 885 | u32 child_mtu_cached; | 885 | u32 child_mtu_cached; |
| 886 | u32 route_cookie; | 886 | u32 route_cookie; |
| @@ -890,6 +890,7 @@ struct xfrm_dst { | |||
| 890 | #ifdef CONFIG_XFRM | 890 | #ifdef CONFIG_XFRM |
| 891 | static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) | 891 | static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) |
| 892 | { | 892 | { |
| 893 | xfrm_pols_put(xdst->pols, xdst->num_pols); | ||
| 893 | dst_release(xdst->route); | 894 | dst_release(xdst->route); |
| 894 | if (likely(xdst->u.dst.xfrm)) | 895 | if (likely(xdst->u.dst.xfrm)) |
| 895 | xfrm_state_put(xdst->u.dst.xfrm); | 896 | xfrm_state_put(xdst->u.dst.xfrm); |
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index 75fa3530345b..57d8d0393567 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h | |||
| @@ -85,6 +85,7 @@ typedef struct config_req_t { | |||
| 85 | #define CONF_ENABLE_IRQ 0x01 | 85 | #define CONF_ENABLE_IRQ 0x01 |
| 86 | #define CONF_ENABLE_DMA 0x02 | 86 | #define CONF_ENABLE_DMA 0x02 |
| 87 | #define CONF_ENABLE_SPKR 0x04 | 87 | #define CONF_ENABLE_SPKR 0x04 |
| 88 | #define CONF_ENABLE_PULSE_IRQ 0x08 | ||
| 88 | #define CONF_VALID_CLIENT 0x100 | 89 | #define CONF_VALID_CLIENT 0x100 |
| 89 | 90 | ||
| 90 | /* IntType field */ | 91 | /* IntType field */ |
| @@ -113,25 +114,7 @@ typedef struct io_req_t { | |||
| 113 | #define IO_DATA_PATH_WIDTH_16 0x08 | 114 | #define IO_DATA_PATH_WIDTH_16 0x08 |
| 114 | #define IO_DATA_PATH_WIDTH_AUTO 0x10 | 115 | #define IO_DATA_PATH_WIDTH_AUTO 0x10 |
| 115 | 116 | ||
| 116 | /* For RequestIRQ and ReleaseIRQ */ | ||
| 117 | typedef struct irq_req_t { | ||
| 118 | u_int Attributes; | ||
| 119 | u_int AssignedIRQ; | ||
| 120 | irq_handler_t Handler; | ||
| 121 | } irq_req_t; | ||
| 122 | |||
| 123 | /* Attributes for RequestIRQ and ReleaseIRQ */ | ||
| 124 | #define IRQ_TYPE 0x03 | ||
| 125 | #define IRQ_TYPE_EXCLUSIVE 0x00 | ||
| 126 | #define IRQ_TYPE_TIME 0x01 | ||
| 127 | #define IRQ_TYPE_DYNAMIC_SHARING 0x02 | ||
| 128 | #define IRQ_FORCED_PULSE 0x04 | ||
| 129 | #define IRQ_FIRST_SHARED 0x08 /* unused */ | ||
| 130 | #define IRQ_HANDLE_PRESENT 0x10 /* unused */ | ||
| 131 | #define IRQ_PULSE_ALLOCATED 0x100 | ||
| 132 | |||
| 133 | /* Bits in IRQInfo1 field */ | 117 | /* Bits in IRQInfo1 field */ |
| 134 | #define IRQ_MASK 0x0f | ||
| 135 | #define IRQ_NMI_ID 0x01 | 118 | #define IRQ_NMI_ID 0x01 |
| 136 | #define IRQ_IOCK_ID 0x02 | 119 | #define IRQ_IOCK_ID 0x02 |
| 137 | #define IRQ_BERR_ID 0x04 | 120 | #define IRQ_BERR_ID 0x04 |
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index d57847f2f6c1..c180165fbd3e 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #ifdef __KERNEL__ | 26 | #ifdef __KERNEL__ |
| 27 | #include <linux/device.h> | 27 | #include <linux/device.h> |
| 28 | #include <pcmcia/ss.h> | 28 | #include <pcmcia/ss.h> |
| 29 | #include <asm/atomic.h> | ||
| 29 | 30 | ||
| 30 | /* | 31 | /* |
| 31 | * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus | 32 | * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus |
| @@ -61,15 +62,6 @@ struct pcmcia_driver { | |||
| 61 | int pcmcia_register_driver(struct pcmcia_driver *driver); | 62 | int pcmcia_register_driver(struct pcmcia_driver *driver); |
| 62 | void pcmcia_unregister_driver(struct pcmcia_driver *driver); | 63 | void pcmcia_unregister_driver(struct pcmcia_driver *driver); |
| 63 | 64 | ||
| 64 | /* Some drivers use dev_node_t to store char or block device information. | ||
| 65 | * Don't use this in new drivers, though. | ||
| 66 | */ | ||
| 67 | typedef struct dev_node_t { | ||
| 68 | char dev_name[DEV_NAME_LEN]; | ||
| 69 | u_short major, minor; | ||
| 70 | struct dev_node_t *next; | ||
| 71 | } dev_node_t; | ||
| 72 | |||
| 73 | struct pcmcia_device { | 65 | struct pcmcia_device { |
| 74 | /* the socket and the device_no [for multifunction devices] | 66 | /* the socket and the device_no [for multifunction devices] |
| 75 | uniquely define a pcmcia_device */ | 67 | uniquely define a pcmcia_device */ |
| @@ -87,17 +79,16 @@ struct pcmcia_device { | |||
| 87 | struct list_head socket_device_list; | 79 | struct list_head socket_device_list; |
| 88 | 80 | ||
| 89 | /* deprecated, will be cleaned up soon */ | 81 | /* deprecated, will be cleaned up soon */ |
| 90 | dev_node_t *dev_node; | ||
| 91 | u_int open; | 82 | u_int open; |
| 92 | io_req_t io; | 83 | io_req_t io; |
| 93 | irq_req_t irq; | ||
| 94 | config_req_t conf; | 84 | config_req_t conf; |
| 95 | window_handle_t win; | 85 | window_handle_t win; |
| 96 | 86 | ||
| 97 | /* Is the device suspended, or in the process of | 87 | /* device setup */ |
| 98 | * being removed? */ | 88 | unsigned int irq; |
| 89 | |||
| 90 | /* Is the device suspended? */ | ||
| 99 | u16 suspended:1; | 91 | u16 suspended:1; |
| 100 | u16 _removed:1; | ||
| 101 | 92 | ||
| 102 | /* Flags whether io, irq, win configurations were | 93 | /* Flags whether io, irq, win configurations were |
| 103 | * requested, and whether the configuration is "locked" */ | 94 | * requested, and whether the configuration is "locked" */ |
| @@ -115,7 +106,7 @@ struct pcmcia_device { | |||
| 115 | u16 has_card_id:1; | 106 | u16 has_card_id:1; |
| 116 | u16 has_func_id:1; | 107 | u16 has_func_id:1; |
| 117 | 108 | ||
| 118 | u16 reserved:3; | 109 | u16 reserved:4; |
| 119 | 110 | ||
| 120 | u8 func_id; | 111 | u8 func_id; |
| 121 | u16 manf_id; | 112 | u16 manf_id; |
| @@ -192,7 +183,20 @@ int pcmcia_access_configuration_register(struct pcmcia_device *p_dev, | |||
| 192 | 183 | ||
| 193 | /* device configuration */ | 184 | /* device configuration */ |
| 194 | int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); | 185 | int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); |
| 195 | int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); | 186 | |
| 187 | int __must_check | ||
| 188 | __pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev, | ||
| 189 | irq_handler_t handler); | ||
| 190 | static inline __must_check __deprecated int | ||
| 191 | pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev, | ||
| 192 | irq_handler_t handler) | ||
| 193 | { | ||
| 194 | return __pcmcia_request_exclusive_irq(p_dev, handler); | ||
| 195 | } | ||
| 196 | |||
| 197 | int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev, | ||
| 198 | irq_handler_t handler); | ||
| 199 | |||
| 196 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, | 200 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, |
| 197 | config_req_t *req); | 201 | config_req_t *req); |
| 198 | 202 | ||
diff --git a/include/pcmcia/mem_op.h b/include/pcmcia/mem_op.h deleted file mode 100644 index 0fa06e5d5376..000000000000 --- a/include/pcmcia/mem_op.h +++ /dev/null | |||
| @@ -1,116 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * mem_op.h | ||
| 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 | * The initial developer of the original code is David A. Hinds | ||
| 9 | * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds | ||
| 10 | * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. | ||
| 11 | * | ||
| 12 | * (C) 1999 David A. Hinds | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _LINUX_MEM_OP_H | ||
| 16 | #define _LINUX_MEM_OP_H | ||
| 17 | |||
| 18 | #include <linux/io.h> | ||
| 19 | #include <asm/uaccess.h> | ||
| 20 | |||
| 21 | /* | ||
| 22 | If UNSAFE_MEMCPY is defined, we use the (optimized) system routines | ||
| 23 | to copy between a card and kernel memory. These routines do 32-bit | ||
| 24 | operations which may not work with all PCMCIA controllers. The | ||
| 25 | safe versions defined here will do only 8-bit and 16-bit accesses. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #ifdef UNSAFE_MEMCPY | ||
| 29 | |||
| 30 | #define copy_from_pc memcpy_fromio | ||
| 31 | #define copy_to_pc memcpy_toio | ||
| 32 | |||
| 33 | static inline void copy_pc_to_user(void *to, const void *from, size_t n) | ||
| 34 | { | ||
| 35 | size_t odd = (n & 3); | ||
| 36 | n -= odd; | ||
| 37 | while (n) { | ||
| 38 | put_user(__raw_readl(from), (int *)to); | ||
| 39 | (char *)from += 4; (char *)to += 4; n -= 4; | ||
| 40 | } | ||
| 41 | while (odd--) | ||
| 42 | put_user(readb((char *)from++), (char *)to++); | ||
| 43 | } | ||
| 44 | |||
| 45 | static inline void copy_user_to_pc(void *to, const void *from, size_t n) | ||
| 46 | { | ||
| 47 | int l; | ||
| 48 | char c; | ||
| 49 | size_t odd = (n & 3); | ||
| 50 | n -= odd; | ||
| 51 | while (n) { | ||
| 52 | get_user(l, (int *)from); | ||
| 53 | __raw_writel(l, to); | ||
| 54 | (char *)to += 4; (char *)from += 4; n -= 4; | ||
| 55 | } | ||
| 56 | while (odd--) { | ||
| 57 | get_user(c, (char *)from++); | ||
| 58 | writeb(c, (char *)to++); | ||
| 59 | } | ||
| 60 | } | ||
| 61 | |||
| 62 | #else /* UNSAFE_MEMCPY */ | ||
| 63 | |||
| 64 | static inline void copy_from_pc(void *to, void __iomem *from, size_t n) | ||
| 65 | { | ||
| 66 | __u16 *t = to; | ||
| 67 | __u16 __iomem *f = from; | ||
| 68 | size_t odd = (n & 1); | ||
| 69 | for (n >>= 1; n; n--) | ||
| 70 | *t++ = __raw_readw(f++); | ||
| 71 | if (odd) | ||
| 72 | *(__u8 *)t = readb(f); | ||
| 73 | } | ||
| 74 | |||
| 75 | static inline void copy_to_pc(void __iomem *to, const void *from, size_t n) | ||
| 76 | { | ||
| 77 | __u16 __iomem *t = to; | ||
| 78 | const __u16 *f = from; | ||
| 79 | size_t odd = (n & 1); | ||
| 80 | for (n >>= 1; n ; n--) | ||
| 81 | __raw_writew(*f++, t++); | ||
| 82 | if (odd) | ||
| 83 | writeb(*(__u8 *)f, t); | ||
| 84 | } | ||
| 85 | |||
| 86 | static inline void copy_pc_to_user(void __user *to, void __iomem *from, size_t n) | ||
| 87 | { | ||
| 88 | __u16 __user *t = to; | ||
| 89 | __u16 __iomem *f = from; | ||
| 90 | size_t odd = (n & 1); | ||
| 91 | for (n >>= 1; n ; n--) | ||
| 92 | put_user(__raw_readw(f++), t++); | ||
| 93 | if (odd) | ||
| 94 | put_user(readb(f), (char __user *)t); | ||
| 95 | } | ||
| 96 | |||
| 97 | static inline void copy_user_to_pc(void __iomem *to, void __user *from, size_t n) | ||
| 98 | { | ||
| 99 | __u16 __user *f = from; | ||
| 100 | __u16 __iomem *t = to; | ||
| 101 | short s; | ||
| 102 | char c; | ||
| 103 | size_t odd = (n & 1); | ||
| 104 | for (n >>= 1; n; n--) { | ||
| 105 | get_user(s, f++); | ||
| 106 | __raw_writew(s, t++); | ||
| 107 | } | ||
| 108 | if (odd) { | ||
| 109 | get_user(c, (char __user *)f); | ||
| 110 | writeb(c, t); | ||
| 111 | } | ||
| 112 | } | ||
| 113 | |||
| 114 | #endif /* UNSAFE_MEMCPY */ | ||
| 115 | |||
| 116 | #endif /* _LINUX_MEM_OP_H */ | ||
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index 32896a773910..764281b29218 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h | |||
| @@ -141,10 +141,6 @@ struct pcmcia_socket { | |||
| 141 | u_short lock_count; | 141 | u_short lock_count; |
| 142 | pccard_mem_map cis_mem; | 142 | pccard_mem_map cis_mem; |
| 143 | void __iomem *cis_virt; | 143 | void __iomem *cis_virt; |
| 144 | struct { | ||
| 145 | u_int AssignedIRQ; | ||
| 146 | u_int Config; | ||
| 147 | } irq; | ||
| 148 | io_window_t io[MAX_IO_WIN]; | 144 | io_window_t io[MAX_IO_WIN]; |
| 149 | pccard_mem_map win[MAX_WIN]; | 145 | pccard_mem_map win[MAX_WIN]; |
| 150 | struct list_head cis_cache; | 146 | struct list_head cis_cache; |
| @@ -224,18 +220,19 @@ struct pcmcia_socket { | |||
| 224 | 220 | ||
| 225 | /* 16-bit state: */ | 221 | /* 16-bit state: */ |
| 226 | struct { | 222 | struct { |
| 227 | /* PCMCIA card is present in socket */ | ||
| 228 | u8 present:1; | ||
| 229 | /* "master" ioctl is used */ | 223 | /* "master" ioctl is used */ |
| 230 | u8 busy:1; | 224 | u8 busy:1; |
| 231 | /* pcmcia module is being unloaded */ | ||
| 232 | u8 dead:1; | ||
| 233 | /* the PCMCIA card consists of two pseudo devices */ | 225 | /* the PCMCIA card consists of two pseudo devices */ |
| 234 | u8 has_pfc:1; | 226 | u8 has_pfc:1; |
| 235 | 227 | ||
| 236 | u8 reserved:4; | 228 | u8 reserved:6; |
| 237 | } pcmcia_state; | 229 | } pcmcia_state; |
| 238 | 230 | ||
| 231 | /* non-zero if PCMCIA card is present */ | ||
| 232 | atomic_t present; | ||
| 233 | |||
| 234 | /* IRQ to be used by PCMCIA devices. May not be IRQ 0. */ | ||
| 235 | unsigned int pcmcia_irq; | ||
| 239 | 236 | ||
| 240 | #ifdef CONFIG_PCMCIA_IOCTL | 237 | #ifdef CONFIG_PCMCIA_IOCTL |
| 241 | struct user_info_t *user; | 238 | struct user_info_t *user; |
| @@ -277,12 +274,6 @@ extern struct pccard_resource_ops pccard_nonstatic_ops; | |||
| 277 | #endif | 274 | #endif |
| 278 | 275 | ||
| 279 | 276 | ||
| 280 | /* socket drivers are expected to use these callbacks in their .drv struct */ | ||
| 281 | extern int pcmcia_socket_dev_suspend(struct device *dev); | ||
| 282 | extern void pcmcia_socket_dev_early_resume(struct device *dev); | ||
| 283 | extern void pcmcia_socket_dev_late_resume(struct device *dev); | ||
| 284 | extern int pcmcia_socket_dev_resume(struct device *dev); | ||
| 285 | |||
| 286 | /* socket drivers use this callback in their IRQ handler */ | 277 | /* socket drivers use this callback in their IRQ handler */ |
| 287 | extern void pcmcia_parse_events(struct pcmcia_socket *socket, | 278 | extern void pcmcia_parse_events(struct pcmcia_socket *socket, |
| 288 | unsigned int events); | 279 | unsigned int events); |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index a585e0f92bc3..310d31474034 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
| @@ -136,6 +136,7 @@ struct ib_device_attr { | |||
| 136 | int max_qp_init_rd_atom; | 136 | int max_qp_init_rd_atom; |
| 137 | int max_ee_init_rd_atom; | 137 | int max_ee_init_rd_atom; |
| 138 | enum ib_atomic_cap atomic_cap; | 138 | enum ib_atomic_cap atomic_cap; |
| 139 | enum ib_atomic_cap masked_atomic_cap; | ||
| 139 | int max_ee; | 140 | int max_ee; |
| 140 | int max_rdd; | 141 | int max_rdd; |
| 141 | int max_mw; | 142 | int max_mw; |
| @@ -467,6 +468,8 @@ enum ib_wc_opcode { | |||
| 467 | IB_WC_LSO, | 468 | IB_WC_LSO, |
| 468 | IB_WC_LOCAL_INV, | 469 | IB_WC_LOCAL_INV, |
| 469 | IB_WC_FAST_REG_MR, | 470 | IB_WC_FAST_REG_MR, |
| 471 | IB_WC_MASKED_COMP_SWAP, | ||
| 472 | IB_WC_MASKED_FETCH_ADD, | ||
| 470 | /* | 473 | /* |
| 471 | * Set value of IB_WC_RECV so consumers can test if a completion is a | 474 | * Set value of IB_WC_RECV so consumers can test if a completion is a |
| 472 | * receive by testing (opcode & IB_WC_RECV). | 475 | * receive by testing (opcode & IB_WC_RECV). |
| @@ -689,6 +692,8 @@ enum ib_wr_opcode { | |||
| 689 | IB_WR_RDMA_READ_WITH_INV, | 692 | IB_WR_RDMA_READ_WITH_INV, |
| 690 | IB_WR_LOCAL_INV, | 693 | IB_WR_LOCAL_INV, |
| 691 | IB_WR_FAST_REG_MR, | 694 | IB_WR_FAST_REG_MR, |
| 695 | IB_WR_MASKED_ATOMIC_CMP_AND_SWP, | ||
| 696 | IB_WR_MASKED_ATOMIC_FETCH_AND_ADD, | ||
| 692 | }; | 697 | }; |
| 693 | 698 | ||
| 694 | enum ib_send_flags { | 699 | enum ib_send_flags { |
| @@ -731,6 +736,8 @@ struct ib_send_wr { | |||
| 731 | u64 remote_addr; | 736 | u64 remote_addr; |
| 732 | u64 compare_add; | 737 | u64 compare_add; |
| 733 | u64 swap; | 738 | u64 swap; |
| 739 | u64 compare_add_mask; | ||
| 740 | u64 swap_mask; | ||
| 734 | u32 rkey; | 741 | u32 rkey; |
| 735 | } atomic; | 742 | } atomic; |
| 736 | struct { | 743 | struct { |
diff --git a/include/scsi/Kbuild b/include/scsi/Kbuild index b3a0ee6b2f1c..f2b94918994d 100644 --- a/include/scsi/Kbuild +++ b/include/scsi/Kbuild | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | header-y += scsi.h | ||
| 2 | header-y += scsi_netlink.h | 1 | header-y += scsi_netlink.h |
| 3 | header-y += scsi_netlink_fc.h | 2 | header-y += scsi_netlink_fc.h |
| 4 | header-y += scsi_bsg_fc.h | 3 | header-y += scsi_bsg_fc.h |
diff --git a/include/scsi/fc/fc_fcp.h b/include/scsi/fc/fc_fcp.h index 747e2c7d88d6..8e9b222251c2 100644 --- a/include/scsi/fc/fc_fcp.h +++ b/include/scsi/fc/fc_fcp.h | |||
| @@ -76,6 +76,7 @@ struct fcp_cmnd32 { | |||
| 76 | #define FCP_PTA_HEADQ 1 /* head of queue task attribute */ | 76 | #define FCP_PTA_HEADQ 1 /* head of queue task attribute */ |
| 77 | #define FCP_PTA_ORDERED 2 /* ordered task attribute */ | 77 | #define FCP_PTA_ORDERED 2 /* ordered task attribute */ |
| 78 | #define FCP_PTA_ACA 4 /* auto. contigent allegiance */ | 78 | #define FCP_PTA_ACA 4 /* auto. contigent allegiance */ |
| 79 | #define FCP_PTA_MASK 7 /* mask for task attribute field */ | ||
| 79 | #define FCP_PRI_SHIFT 3 /* priority field starts in bit 3 */ | 80 | #define FCP_PRI_SHIFT 3 /* priority field starts in bit 3 */ |
| 80 | #define FCP_PRI_RESVD_MASK 0x80 /* reserved bits in priority field */ | 81 | #define FCP_PRI_RESVD_MASK 0x80 /* reserved bits in priority field */ |
| 81 | 82 | ||
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h index 8eb0a0fc0a71..9b4867c9c2d2 100644 --- a/include/scsi/fc_encode.h +++ b/include/scsi/fc_encode.h | |||
| @@ -74,7 +74,7 @@ static inline void fc_adisc_fill(struct fc_lport *lport, struct fc_frame *fp) | |||
| 74 | adisc->adisc_cmd = ELS_ADISC; | 74 | adisc->adisc_cmd = ELS_ADISC; |
| 75 | put_unaligned_be64(lport->wwpn, &adisc->adisc_wwpn); | 75 | put_unaligned_be64(lport->wwpn, &adisc->adisc_wwpn); |
| 76 | put_unaligned_be64(lport->wwnn, &adisc->adisc_wwnn); | 76 | put_unaligned_be64(lport->wwnn, &adisc->adisc_wwnn); |
| 77 | hton24(adisc->adisc_port_id, fc_host_port_id(lport->host)); | 77 | hton24(adisc->adisc_port_id, lport->port_id); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | /** | 80 | /** |
| @@ -127,15 +127,13 @@ static inline int fc_ct_fill(struct fc_lport *lport, | |||
| 127 | 127 | ||
| 128 | case FC_NS_RFT_ID: | 128 | case FC_NS_RFT_ID: |
| 129 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft)); | 129 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft)); |
| 130 | hton24(ct->payload.rft.fid.fp_fid, | 130 | hton24(ct->payload.rft.fid.fp_fid, lport->port_id); |
| 131 | fc_host_port_id(lport->host)); | ||
| 132 | ct->payload.rft.fts = lport->fcts; | 131 | ct->payload.rft.fts = lport->fcts; |
| 133 | break; | 132 | break; |
| 134 | 133 | ||
| 135 | case FC_NS_RFF_ID: | 134 | case FC_NS_RFF_ID: |
| 136 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rff_id)); | 135 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rff_id)); |
| 137 | hton24(ct->payload.rff.fr_fid.fp_fid, | 136 | hton24(ct->payload.rff.fr_fid.fp_fid, lport->port_id); |
| 138 | fc_host_port_id(lport->host)); | ||
| 139 | ct->payload.rff.fr_type = FC_TYPE_FCP; | 137 | ct->payload.rff.fr_type = FC_TYPE_FCP; |
| 140 | if (lport->service_params & FCP_SPPF_INIT_FCN) | 138 | if (lport->service_params & FCP_SPPF_INIT_FCN) |
| 141 | ct->payload.rff.fr_feat = FCP_FEAT_INIT; | 139 | ct->payload.rff.fr_feat = FCP_FEAT_INIT; |
| @@ -145,16 +143,14 @@ static inline int fc_ct_fill(struct fc_lport *lport, | |||
| 145 | 143 | ||
| 146 | case FC_NS_RNN_ID: | 144 | case FC_NS_RNN_ID: |
| 147 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rn_id)); | 145 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rn_id)); |
| 148 | hton24(ct->payload.rn.fr_fid.fp_fid, | 146 | hton24(ct->payload.rn.fr_fid.fp_fid, lport->port_id); |
| 149 | fc_host_port_id(lport->host)); | ||
| 150 | put_unaligned_be64(lport->wwnn, &ct->payload.rn.fr_wwn); | 147 | put_unaligned_be64(lport->wwnn, &ct->payload.rn.fr_wwn); |
| 151 | break; | 148 | break; |
| 152 | 149 | ||
| 153 | case FC_NS_RSPN_ID: | 150 | case FC_NS_RSPN_ID: |
| 154 | len = strnlen(fc_host_symbolic_name(lport->host), 255); | 151 | len = strnlen(fc_host_symbolic_name(lport->host), 255); |
| 155 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rspn) + len); | 152 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rspn) + len); |
| 156 | hton24(ct->payload.spn.fr_fid.fp_fid, | 153 | hton24(ct->payload.spn.fr_fid.fp_fid, lport->port_id); |
| 157 | fc_host_port_id(lport->host)); | ||
| 158 | strncpy(ct->payload.spn.fr_name, | 154 | strncpy(ct->payload.spn.fr_name, |
| 159 | fc_host_symbolic_name(lport->host), len); | 155 | fc_host_symbolic_name(lport->host), len); |
| 160 | ct->payload.spn.fr_name_len = len; | 156 | ct->payload.spn.fr_name_len = len; |
| @@ -268,7 +264,7 @@ static inline void fc_logo_fill(struct fc_lport *lport, struct fc_frame *fp) | |||
| 268 | logo = fc_frame_payload_get(fp, sizeof(*logo)); | 264 | logo = fc_frame_payload_get(fp, sizeof(*logo)); |
| 269 | memset(logo, 0, sizeof(*logo)); | 265 | memset(logo, 0, sizeof(*logo)); |
| 270 | logo->fl_cmd = ELS_LOGO; | 266 | logo->fl_cmd = ELS_LOGO; |
| 271 | hton24(logo->fl_n_port_id, fc_host_port_id(lport->host)); | 267 | hton24(logo->fl_n_port_id, lport->port_id); |
| 272 | logo->fl_n_port_wwn = htonll(lport->wwpn); | 268 | logo->fl_n_port_wwn = htonll(lport->wwpn); |
| 273 | } | 269 | } |
| 274 | 270 | ||
| @@ -295,7 +291,7 @@ static inline void fc_rec_fill(struct fc_lport *lport, struct fc_frame *fp) | |||
| 295 | rec = fc_frame_payload_get(fp, sizeof(*rec)); | 291 | rec = fc_frame_payload_get(fp, sizeof(*rec)); |
| 296 | memset(rec, 0, sizeof(*rec)); | 292 | memset(rec, 0, sizeof(*rec)); |
| 297 | rec->rec_cmd = ELS_REC; | 293 | rec->rec_cmd = ELS_REC; |
| 298 | hton24(rec->rec_s_id, fc_host_port_id(lport->host)); | 294 | hton24(rec->rec_s_id, lport->port_id); |
| 299 | rec->rec_ox_id = htons(ep->oxid); | 295 | rec->rec_ox_id = htons(ep->oxid); |
| 300 | rec->rec_rx_id = htons(ep->rxid); | 296 | rec->rec_rx_id = htons(ep->rxid); |
| 301 | } | 297 | } |
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 4b912eee33e5..7495c0ba67ee 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
| @@ -47,13 +47,18 @@ | |||
| 47 | #define ntohll(x) be64_to_cpu(x) | 47 | #define ntohll(x) be64_to_cpu(x) |
| 48 | #define htonll(x) cpu_to_be64(x) | 48 | #define htonll(x) cpu_to_be64(x) |
| 49 | 49 | ||
| 50 | #define ntoh24(p) (((p)[0] << 16) | ((p)[1] << 8) | ((p)[2])) | ||
| 51 | 50 | ||
| 52 | #define hton24(p, v) do { \ | 51 | static inline u32 ntoh24(const u8 *p) |
| 53 | p[0] = (((v) >> 16) & 0xFF); \ | 52 | { |
| 54 | p[1] = (((v) >> 8) & 0xFF); \ | 53 | return (p[0] << 16) | (p[1] << 8) | p[2]; |
| 55 | p[2] = ((v) & 0xFF); \ | 54 | } |
| 56 | } while (0) | 55 | |
| 56 | static inline void hton24(u8 *p, u32 v) | ||
| 57 | { | ||
| 58 | p[0] = (v >> 16) & 0xff; | ||
| 59 | p[1] = (v >> 8) & 0xff; | ||
| 60 | p[2] = v & 0xff; | ||
| 61 | } | ||
| 57 | 62 | ||
| 58 | /** | 63 | /** |
| 59 | * enum fc_lport_state - Local port states | 64 | * enum fc_lport_state - Local port states |
| @@ -775,6 +780,7 @@ struct fc_disc { | |||
| 775 | * @dev_stats: FCoE device stats (TODO: libfc should not be | 780 | * @dev_stats: FCoE device stats (TODO: libfc should not be |
| 776 | * FCoE aware) | 781 | * FCoE aware) |
| 777 | * @retry_count: Number of retries in the current state | 782 | * @retry_count: Number of retries in the current state |
| 783 | * @port_id: FC Port ID | ||
| 778 | * @wwpn: World Wide Port Name | 784 | * @wwpn: World Wide Port Name |
| 779 | * @wwnn: World Wide Node Name | 785 | * @wwnn: World Wide Node Name |
| 780 | * @service_params: Common service parameters | 786 | * @service_params: Common service parameters |
| @@ -821,6 +827,7 @@ struct fc_lport { | |||
| 821 | u8 retry_count; | 827 | u8 retry_count; |
| 822 | 828 | ||
| 823 | /* Fabric information */ | 829 | /* Fabric information */ |
| 830 | u32 port_id; | ||
| 824 | u64 wwpn; | 831 | u64 wwpn; |
| 825 | u64 wwnn; | 832 | u64 wwnn; |
| 826 | unsigned int service_params; | 833 | unsigned int service_params; |
| @@ -918,15 +925,6 @@ static inline void fc_lport_free_stats(struct fc_lport *lport) | |||
| 918 | } | 925 | } |
| 919 | 926 | ||
| 920 | /** | 927 | /** |
| 921 | * fc_lport_get_stats() - Get a local port's statistics | ||
| 922 | * @lport: The local port whose statistics are to be retreived | ||
| 923 | */ | ||
| 924 | static inline struct fcoe_dev_stats *fc_lport_get_stats(struct fc_lport *lport) | ||
| 925 | { | ||
| 926 | return per_cpu_ptr(lport->dev_stats, smp_processor_id()); | ||
| 927 | } | ||
| 928 | |||
| 929 | /** | ||
| 930 | * lport_priv() - Return the private data from a local port | 928 | * lport_priv() - Return the private data from a local port |
| 931 | * @lport: The local port whose private data is to be retreived | 929 | * @lport: The local port whose private data is to be retreived |
| 932 | */ | 930 | */ |
| @@ -1053,7 +1051,6 @@ void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id); | |||
| 1053 | * Functions for fc_functions_template | 1051 | * Functions for fc_functions_template |
| 1054 | */ | 1052 | */ |
| 1055 | void fc_get_host_speed(struct Scsi_Host *); | 1053 | void fc_get_host_speed(struct Scsi_Host *); |
| 1056 | void fc_get_host_port_type(struct Scsi_Host *); | ||
| 1057 | void fc_get_host_port_state(struct Scsi_Host *); | 1054 | void fc_get_host_port_state(struct Scsi_Host *); |
| 1058 | void fc_set_rport_loss_tmo(struct fc_rport *, u32 timeout); | 1055 | void fc_set_rport_loss_tmo(struct fc_rport *, u32 timeout); |
| 1059 | struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *); | 1056 | struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *); |
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index c603f4a7e7fc..ec13f51531f8 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h | |||
| @@ -29,6 +29,8 @@ | |||
| 29 | #include <scsi/fc/fc_fcoe.h> | 29 | #include <scsi/fc/fc_fcoe.h> |
| 30 | #include <scsi/libfc.h> | 30 | #include <scsi/libfc.h> |
| 31 | 31 | ||
| 32 | #define FCOE_MAX_CMD_LEN 16 /* Supported CDB length */ | ||
| 33 | |||
| 32 | /* | 34 | /* |
| 33 | * FIP tunable parameters. | 35 | * FIP tunable parameters. |
| 34 | */ | 36 | */ |
| @@ -65,14 +67,12 @@ enum fip_state { | |||
| 65 | * @port_ka_time: time of next port keep-alive. | 67 | * @port_ka_time: time of next port keep-alive. |
| 66 | * @ctlr_ka_time: time of next controller keep-alive. | 68 | * @ctlr_ka_time: time of next controller keep-alive. |
| 67 | * @timer: timer struct used for all delayed events. | 69 | * @timer: timer struct used for all delayed events. |
| 68 | * @link_work: &work_struct for doing FCF selection. | 70 | * @timer_work: &work_struct for doing keep-alives and resets. |
| 69 | * @recv_work: &work_struct for receiving FIP frames. | 71 | * @recv_work: &work_struct for receiving FIP frames. |
| 70 | * @fip_recv_list: list of received FIP frames. | 72 | * @fip_recv_list: list of received FIP frames. |
| 71 | * @user_mfs: configured maximum FC frame size, including FC header. | 73 | * @user_mfs: configured maximum FC frame size, including FC header. |
| 72 | * @flogi_oxid: exchange ID of most recent fabric login. | 74 | * @flogi_oxid: exchange ID of most recent fabric login. |
| 73 | * @flogi_count: number of FLOGI attempts in AUTO mode. | 75 | * @flogi_count: number of FLOGI attempts in AUTO mode. |
| 74 | * @link: current link status for libfc. | ||
| 75 | * @last_link: last link state reported to libfc. | ||
| 76 | * @map_dest: use the FC_MAP mode for destination MAC addresses. | 76 | * @map_dest: use the FC_MAP mode for destination MAC addresses. |
| 77 | * @spma: supports SPMA server-provided MACs mode | 77 | * @spma: supports SPMA server-provided MACs mode |
| 78 | * @send_ctlr_ka: need to send controller keep alive | 78 | * @send_ctlr_ka: need to send controller keep alive |
| @@ -100,14 +100,12 @@ struct fcoe_ctlr { | |||
| 100 | unsigned long port_ka_time; | 100 | unsigned long port_ka_time; |
| 101 | unsigned long ctlr_ka_time; | 101 | unsigned long ctlr_ka_time; |
| 102 | struct timer_list timer; | 102 | struct timer_list timer; |
| 103 | struct work_struct link_work; | 103 | struct work_struct timer_work; |
| 104 | struct work_struct recv_work; | 104 | struct work_struct recv_work; |
| 105 | struct sk_buff_head fip_recv_list; | 105 | struct sk_buff_head fip_recv_list; |
| 106 | u16 user_mfs; | 106 | u16 user_mfs; |
| 107 | u16 flogi_oxid; | 107 | u16 flogi_oxid; |
| 108 | u8 flogi_count; | 108 | u8 flogi_count; |
| 109 | u8 link; | ||
| 110 | u8 last_link; | ||
| 111 | u8 reset_req; | 109 | u8 reset_req; |
| 112 | u8 map_dest; | 110 | u8 map_dest; |
| 113 | u8 spma; | 111 | u8 spma; |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index ff92b46f5153..ae5196aae1a5 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
| @@ -338,7 +338,8 @@ struct iscsi_host { | |||
| 338 | extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth, | 338 | extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth, |
| 339 | int reason); | 339 | int reason); |
| 340 | extern int iscsi_eh_abort(struct scsi_cmnd *sc); | 340 | extern int iscsi_eh_abort(struct scsi_cmnd *sc); |
| 341 | extern int iscsi_eh_target_reset(struct scsi_cmnd *sc); | 341 | extern int iscsi_eh_recover_target(struct scsi_cmnd *sc); |
| 342 | extern int iscsi_eh_session_reset(struct scsi_cmnd *sc); | ||
| 342 | extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); | 343 | extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); |
| 343 | extern int iscsi_queuecommand(struct scsi_cmnd *sc, | 344 | extern int iscsi_queuecommand(struct scsi_cmnd *sc, |
| 344 | void (*done)(struct scsi_cmnd *)); | 345 | void (*done)(struct scsi_cmnd *)); |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 9eaa3f05f954..3b586859669c 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <scsi/scsi_cmnd.h> | 36 | #include <scsi/scsi_cmnd.h> |
| 37 | #include <scsi/scsi_transport_sas.h> | 37 | #include <scsi/scsi_transport_sas.h> |
| 38 | #include <linux/scatterlist.h> | 38 | #include <linux/scatterlist.h> |
| 39 | #include <linux/slab.h> | ||
| 39 | 40 | ||
| 40 | struct block_device; | 41 | struct block_device; |
| 41 | 42 | ||
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 8b4deca996ad..9ae5c613131b 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
| @@ -114,6 +114,7 @@ struct scsi_cmnd; | |||
| 114 | #define READ_12 0xa8 | 114 | #define READ_12 0xa8 |
| 115 | #define WRITE_12 0xaa | 115 | #define WRITE_12 0xaa |
| 116 | #define WRITE_VERIFY_12 0xae | 116 | #define WRITE_VERIFY_12 0xae |
| 117 | #define VERIFY_12 0xaf | ||
| 117 | #define SEARCH_HIGH_12 0xb0 | 118 | #define SEARCH_HIGH_12 0xb0 |
| 118 | #define SEARCH_EQUAL_12 0xb1 | 119 | #define SEARCH_EQUAL_12 0xb1 |
| 119 | #define SEARCH_LOW_12 0xb2 | 120 | #define SEARCH_LOW_12 0xb2 |
| @@ -134,6 +135,7 @@ struct scsi_cmnd; | |||
| 134 | #define MO_SET_TARGET_PGS 0x0a | 135 | #define MO_SET_TARGET_PGS 0x0a |
| 135 | /* values for variable length command */ | 136 | /* values for variable length command */ |
| 136 | #define READ_32 0x09 | 137 | #define READ_32 0x09 |
| 138 | #define VERIFY_32 0x0a | ||
| 137 | #define WRITE_32 0x0b | 139 | #define WRITE_32 0x0b |
| 138 | #define WRITE_SAME_32 0x0d | 140 | #define WRITE_SAME_32 0x0d |
| 139 | 141 | ||
| @@ -423,6 +425,7 @@ static inline int scsi_is_wlun(unsigned int lun) | |||
| 423 | #define ADD_TO_MLQUEUE 0x2006 | 425 | #define ADD_TO_MLQUEUE 0x2006 |
| 424 | #define TIMEOUT_ERROR 0x2007 | 426 | #define TIMEOUT_ERROR 0x2007 |
| 425 | #define SCSI_RETURN_NOT_HANDLED 0x2008 | 427 | #define SCSI_RETURN_NOT_HANDLED 0x2008 |
| 428 | #define FAST_IO_FAIL 0x2009 | ||
| 426 | 429 | ||
| 427 | /* | 430 | /* |
| 428 | * Midlevel queue return values. | 431 | * Midlevel queue return values. |
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 8e86a94faf06..87d81b3ce564 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
| @@ -807,6 +807,6 @@ void fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number, | |||
| 807 | struct fc_vport *fc_vport_create(struct Scsi_Host *shost, int channel, | 807 | struct fc_vport *fc_vport_create(struct Scsi_Host *shost, int channel, |
| 808 | struct fc_vport_identifiers *); | 808 | struct fc_vport_identifiers *); |
| 809 | int fc_vport_terminate(struct fc_vport *vport); | 809 | int fc_vport_terminate(struct fc_vport *vport); |
| 810 | void fc_block_scsi_eh(struct scsi_cmnd *cmnd); | 810 | int fc_block_scsi_eh(struct scsi_cmnd *cmnd); |
| 811 | 811 | ||
| 812 | #endif /* SCSI_TRANSPORT_FC_H */ | 812 | #endif /* SCSI_TRANSPORT_FC_H */ |
diff --git a/include/scsi/sg.h b/include/scsi/sg.h index 934ae389671d..a9f3c6fc3f57 100644 --- a/include/scsi/sg.h +++ b/include/scsi/sg.h | |||
| @@ -70,6 +70,9 @@ Major new features in SG 3.x driver (cf SG 2.x drivers) | |||
| 70 | (for the lk 2.2 series). | 70 | (for the lk 2.2 series). |
| 71 | */ | 71 | */ |
| 72 | 72 | ||
| 73 | #ifdef __KERNEL__ | ||
| 74 | extern int sg_big_buff; /* for sysctl */ | ||
| 75 | #endif | ||
| 73 | 76 | ||
| 74 | /* New interface introduced in the 3.x SG drivers follows */ | 77 | /* New interface introduced in the 3.x SG drivers follows */ |
| 75 | 78 | ||
diff --git a/include/sound/ak4113.h b/include/sound/ak4113.h index 8988edae1609..2609048c1d44 100644 --- a/include/sound/ak4113.h +++ b/include/sound/ak4113.h | |||
| @@ -307,7 +307,7 @@ struct ak4113 { | |||
| 307 | 307 | ||
| 308 | int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, | 308 | int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, |
| 309 | ak4113_write_t *write, | 309 | ak4113_write_t *write, |
| 310 | const unsigned char pgm[AK4113_WRITABLE_REGS], | 310 | const unsigned char *pgm, |
| 311 | void *private_data, struct ak4113 **r_ak4113); | 311 | void *private_data, struct ak4113 **r_ak4113); |
| 312 | void snd_ak4113_reg_write(struct ak4113 *ak4113, unsigned char reg, | 312 | void snd_ak4113_reg_write(struct ak4113 *ak4113, unsigned char reg, |
| 313 | unsigned char mask, unsigned char val); | 313 | unsigned char mask, unsigned char val); |
diff --git a/include/sound/asound.h b/include/sound/asound.h index 1f57bb92eb5a..9f1eecf99e6b 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
| @@ -544,7 +544,7 @@ struct snd_rawmidi_status { | |||
| 544 | * Timer section - /dev/snd/timer | 544 | * Timer section - /dev/snd/timer |
| 545 | */ | 545 | */ |
| 546 | 546 | ||
| 547 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5) | 547 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6) |
| 548 | 548 | ||
| 549 | enum { | 549 | enum { |
| 550 | SNDRV_TIMER_CLASS_NONE = -1, | 550 | SNDRV_TIMER_CLASS_NONE = -1, |
| @@ -574,7 +574,7 @@ enum { | |||
| 574 | #define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */ | 574 | #define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */ |
| 575 | 575 | ||
| 576 | struct snd_timer_id { | 576 | struct snd_timer_id { |
| 577 | int dev_class; | 577 | int dev_class; |
| 578 | int dev_sclass; | 578 | int dev_sclass; |
| 579 | int card; | 579 | int card; |
| 580 | int device; | 580 | int device; |
| @@ -762,7 +762,7 @@ struct snd_ctl_elem_id { | |||
| 762 | snd_ctl_elem_iface_t iface; /* interface identifier */ | 762 | snd_ctl_elem_iface_t iface; /* interface identifier */ |
| 763 | unsigned int device; /* device/client number */ | 763 | unsigned int device; /* device/client number */ |
| 764 | unsigned int subdevice; /* subdevice (substream) number */ | 764 | unsigned int subdevice; /* subdevice (substream) number */ |
| 765 | unsigned char name[44]; /* ASCII name of item */ | 765 | unsigned char name[44]; /* ASCII name of item */ |
| 766 | unsigned int index; /* index of item */ | 766 | unsigned int index; /* index of item */ |
| 767 | }; | 767 | }; |
| 768 | 768 | ||
| @@ -809,7 +809,7 @@ struct snd_ctl_elem_info { | |||
| 809 | struct snd_ctl_elem_value { | 809 | struct snd_ctl_elem_value { |
| 810 | struct snd_ctl_elem_id id; /* W: element ID */ | 810 | struct snd_ctl_elem_id id; /* W: element ID */ |
| 811 | unsigned int indirect: 1; /* W: indirect access - obsoleted */ | 811 | unsigned int indirect: 1; /* W: indirect access - obsoleted */ |
| 812 | union { | 812 | union { |
| 813 | union { | 813 | union { |
| 814 | long value[128]; | 814 | long value[128]; |
| 815 | long *value_ptr; /* obsoleted */ | 815 | long *value_ptr; /* obsoleted */ |
| @@ -827,15 +827,15 @@ struct snd_ctl_elem_value { | |||
| 827 | unsigned char *data_ptr; /* obsoleted */ | 827 | unsigned char *data_ptr; /* obsoleted */ |
| 828 | } bytes; | 828 | } bytes; |
| 829 | struct snd_aes_iec958 iec958; | 829 | struct snd_aes_iec958 iec958; |
| 830 | } value; /* RO */ | 830 | } value; /* RO */ |
| 831 | struct timespec tstamp; | 831 | struct timespec tstamp; |
| 832 | unsigned char reserved[128-sizeof(struct timespec)]; | 832 | unsigned char reserved[128-sizeof(struct timespec)]; |
| 833 | }; | 833 | }; |
| 834 | 834 | ||
| 835 | struct snd_ctl_tlv { | 835 | struct snd_ctl_tlv { |
| 836 | unsigned int numid; /* control element numeric identification */ | 836 | unsigned int numid; /* control element numeric identification */ |
| 837 | unsigned int length; /* in bytes aligned to 4 */ | 837 | unsigned int length; /* in bytes aligned to 4 */ |
| 838 | unsigned int tlv[0]; /* first TLV */ | 838 | unsigned int tlv[0]; /* first TLV */ |
| 839 | }; | 839 | }; |
| 840 | 840 | ||
| 841 | #define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int) | 841 | #define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int) |
| @@ -886,8 +886,8 @@ struct snd_ctl_event { | |||
| 886 | unsigned int mask; | 886 | unsigned int mask; |
| 887 | struct snd_ctl_elem_id id; | 887 | struct snd_ctl_elem_id id; |
| 888 | } elem; | 888 | } elem; |
| 889 | unsigned char data8[60]; | 889 | unsigned char data8[60]; |
| 890 | } data; | 890 | } data; |
| 891 | }; | 891 | }; |
| 892 | 892 | ||
| 893 | /* | 893 | /* |
diff --git a/include/sound/es1688.h b/include/sound/es1688.h index 10fcf1465810..3ec7ecbe2502 100644 --- a/include/sound/es1688.h +++ b/include/sound/es1688.h | |||
| @@ -44,7 +44,6 @@ struct snd_es1688 { | |||
| 44 | unsigned char pad; | 44 | unsigned char pad; |
| 45 | unsigned int dma_size; | 45 | unsigned int dma_size; |
| 46 | 46 | ||
| 47 | struct snd_card *card; | ||
| 48 | struct snd_pcm *pcm; | 47 | struct snd_pcm *pcm; |
| 49 | struct snd_pcm_substream *playback_substream; | 48 | struct snd_pcm_substream *playback_substream; |
| 50 | struct snd_pcm_substream *capture_substream; | 49 | struct snd_pcm_substream *capture_substream; |
| @@ -108,14 +107,16 @@ struct snd_es1688 { | |||
| 108 | void snd_es1688_mixer_write(struct snd_es1688 *chip, unsigned char reg, unsigned char data); | 107 | void snd_es1688_mixer_write(struct snd_es1688 *chip, unsigned char reg, unsigned char data); |
| 109 | 108 | ||
| 110 | int snd_es1688_create(struct snd_card *card, | 109 | int snd_es1688_create(struct snd_card *card, |
| 110 | struct snd_es1688 *chip, | ||
| 111 | unsigned long port, | 111 | unsigned long port, |
| 112 | unsigned long mpu_port, | 112 | unsigned long mpu_port, |
| 113 | int irq, | 113 | int irq, |
| 114 | int mpu_irq, | 114 | int mpu_irq, |
| 115 | int dma8, | 115 | int dma8, |
| 116 | unsigned short hardware, | 116 | unsigned short hardware); |
| 117 | struct snd_es1688 ** rchip); | 117 | int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device, |
| 118 | int snd_es1688_pcm(struct snd_es1688 *chip, int device, struct snd_pcm ** rpcm); | 118 | struct snd_pcm **rpcm); |
| 119 | int snd_es1688_mixer(struct snd_es1688 *chip); | 119 | int snd_es1688_mixer(struct snd_card *card, struct snd_es1688 *chip); |
| 120 | int snd_es1688_reset(struct snd_es1688 *chip); | ||
| 120 | 121 | ||
| 121 | #endif /* __SOUND_ES1688_H */ | 122 | #endif /* __SOUND_ES1688_H */ |
diff --git a/include/sound/info.h b/include/sound/info.h index 112e8949e1a7..4e94cf1ff762 100644 --- a/include/sound/info.h +++ b/include/sound/info.h | |||
| @@ -51,18 +51,18 @@ struct snd_info_entry_ops { | |||
| 51 | unsigned short mode, void **file_private_data); | 51 | unsigned short mode, void **file_private_data); |
| 52 | int (*release)(struct snd_info_entry *entry, | 52 | int (*release)(struct snd_info_entry *entry, |
| 53 | unsigned short mode, void *file_private_data); | 53 | unsigned short mode, void *file_private_data); |
| 54 | long (*read)(struct snd_info_entry *entry, void *file_private_data, | 54 | ssize_t (*read)(struct snd_info_entry *entry, void *file_private_data, |
| 55 | struct file *file, char __user *buf, | 55 | struct file *file, char __user *buf, |
| 56 | unsigned long count, unsigned long pos); | 56 | size_t count, loff_t pos); |
| 57 | long (*write)(struct snd_info_entry *entry, void *file_private_data, | 57 | ssize_t (*write)(struct snd_info_entry *entry, void *file_private_data, |
| 58 | struct file *file, const char __user *buf, | 58 | struct file *file, const char __user *buf, |
| 59 | unsigned long count, unsigned long pos); | 59 | size_t count, loff_t pos); |
| 60 | long long (*llseek)(struct snd_info_entry *entry, | 60 | loff_t (*llseek)(struct snd_info_entry *entry, |
| 61 | void *file_private_data, struct file *file, | 61 | void *file_private_data, struct file *file, |
| 62 | long long offset, int orig); | 62 | loff_t offset, int orig); |
| 63 | unsigned int(*poll)(struct snd_info_entry *entry, | 63 | unsigned int (*poll)(struct snd_info_entry *entry, |
| 64 | void *file_private_data, struct file *file, | 64 | void *file_private_data, struct file *file, |
| 65 | poll_table *wait); | 65 | poll_table *wait); |
| 66 | int (*ioctl)(struct snd_info_entry *entry, void *file_private_data, | 66 | int (*ioctl)(struct snd_info_entry *entry, void *file_private_data, |
| 67 | struct file *file, unsigned int cmd, unsigned long arg); | 67 | struct file *file, unsigned int cmd, unsigned long arg); |
| 68 | int (*mmap)(struct snd_info_entry *entry, void *file_private_data, | 68 | int (*mmap)(struct snd_info_entry *entry, void *file_private_data, |
diff --git a/include/sound/jack.h b/include/sound/jack.h index f236e426a706..d90b9fa32707 100644 --- a/include/sound/jack.h +++ b/include/sound/jack.h | |||
| @@ -42,6 +42,11 @@ enum snd_jack_types { | |||
| 42 | SND_JACK_MECHANICAL = 0x0008, /* If detected separately */ | 42 | SND_JACK_MECHANICAL = 0x0008, /* If detected separately */ |
| 43 | SND_JACK_VIDEOOUT = 0x0010, | 43 | SND_JACK_VIDEOOUT = 0x0010, |
| 44 | SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT, | 44 | SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT, |
| 45 | |||
| 46 | /* Kept separate from switches to facilitate implementation */ | ||
| 47 | SND_JACK_BTN_0 = 0x4000, | ||
| 48 | SND_JACK_BTN_1 = 0x2000, | ||
| 49 | SND_JACK_BTN_2 = 0x1000, | ||
| 45 | }; | 50 | }; |
| 46 | 51 | ||
| 47 | struct snd_jack { | 52 | struct snd_jack { |
| @@ -50,6 +55,7 @@ struct snd_jack { | |||
| 50 | int type; | 55 | int type; |
| 51 | const char *id; | 56 | const char *id; |
| 52 | char name[100]; | 57 | char name[100]; |
| 58 | unsigned int key[3]; /* Keep in sync with definitions above */ | ||
| 53 | void *private_data; | 59 | void *private_data; |
| 54 | void (*private_free)(struct snd_jack *); | 60 | void (*private_free)(struct snd_jack *); |
| 55 | }; | 61 | }; |
| @@ -59,6 +65,8 @@ struct snd_jack { | |||
| 59 | int snd_jack_new(struct snd_card *card, const char *id, int type, | 65 | int snd_jack_new(struct snd_card *card, const char *id, int type, |
| 60 | struct snd_jack **jack); | 66 | struct snd_jack **jack); |
| 61 | void snd_jack_set_parent(struct snd_jack *jack, struct device *parent); | 67 | void snd_jack_set_parent(struct snd_jack *jack, struct device *parent); |
| 68 | int snd_jack_set_key(struct snd_jack *jack, enum snd_jack_types type, | ||
| 69 | int keytype); | ||
| 62 | 70 | ||
| 63 | void snd_jack_report(struct snd_jack *jack, int status); | 71 | void snd_jack_report(struct snd_jack *jack, int status); |
| 64 | 72 | ||
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 8b611a561985..dd76cdede64d 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/poll.h> | 29 | #include <linux/poll.h> |
| 30 | #include <linux/mm.h> | 30 | #include <linux/mm.h> |
| 31 | #include <linux/bitops.h> | 31 | #include <linux/bitops.h> |
| 32 | #include <linux/pm_qos_params.h> | ||
| 32 | 33 | ||
| 33 | #define snd_pcm_substream_chip(substream) ((substream)->private_data) | 34 | #define snd_pcm_substream_chip(substream) ((substream)->private_data) |
| 34 | #define snd_pcm_chip(pcm) ((pcm)->private_data) | 35 | #define snd_pcm_chip(pcm) ((pcm)->private_data) |
| @@ -365,7 +366,7 @@ struct snd_pcm_substream { | |||
| 365 | int number; | 366 | int number; |
| 366 | char name[32]; /* substream name */ | 367 | char name[32]; /* substream name */ |
| 367 | int stream; /* stream (direction) */ | 368 | int stream; /* stream (direction) */ |
| 368 | char latency_id[20]; /* latency identifier */ | 369 | struct pm_qos_request_list *latency_pm_qos_req; /* pm_qos request */ |
| 369 | size_t buffer_bytes_max; /* limit ring buffer size */ | 370 | size_t buffer_bytes_max; /* limit ring buffer size */ |
| 370 | struct snd_dma_buffer dma_buffer; | 371 | struct snd_dma_buffer dma_buffer; |
| 371 | unsigned int dma_buf_id; | 372 | unsigned int dma_buf_id; |
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 061f16d4c878..377693a14385 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
| @@ -182,6 +182,12 @@ struct snd_soc_dai_ops { | |||
| 182 | struct snd_soc_dai *); | 182 | struct snd_soc_dai *); |
| 183 | int (*trigger)(struct snd_pcm_substream *, int, | 183 | int (*trigger)(struct snd_pcm_substream *, int, |
| 184 | struct snd_soc_dai *); | 184 | struct snd_soc_dai *); |
| 185 | /* | ||
| 186 | * For hardware based FIFO caused delay reporting. | ||
| 187 | * Optional. | ||
| 188 | */ | ||
| 189 | snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *, | ||
| 190 | struct snd_soc_dai *); | ||
| 185 | }; | 191 | }; |
| 186 | 192 | ||
| 187 | /* | 193 | /* |
| @@ -215,11 +221,9 @@ struct snd_soc_dai { | |||
| 215 | unsigned int symmetric_rates:1; | 221 | unsigned int symmetric_rates:1; |
| 216 | 222 | ||
| 217 | /* DAI runtime info */ | 223 | /* DAI runtime info */ |
| 218 | struct snd_pcm_runtime *runtime; | ||
| 219 | struct snd_soc_codec *codec; | 224 | struct snd_soc_codec *codec; |
| 220 | unsigned int active; | 225 | unsigned int active; |
| 221 | unsigned char pop_wait:1; | 226 | unsigned char pop_wait:1; |
| 222 | void *dma_data; | ||
| 223 | 227 | ||
| 224 | /* DAI private data */ | 228 | /* DAI private data */ |
| 225 | void *private_data; | 229 | void *private_data; |
| @@ -230,4 +234,21 @@ struct snd_soc_dai { | |||
| 230 | struct list_head list; | 234 | struct list_head list; |
| 231 | }; | 235 | }; |
| 232 | 236 | ||
| 237 | static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai, | ||
| 238 | const struct snd_pcm_substream *ss) | ||
| 239 | { | ||
| 240 | return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ? | ||
| 241 | dai->playback.dma_data : dai->capture.dma_data; | ||
| 242 | } | ||
| 243 | |||
| 244 | static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai, | ||
| 245 | const struct snd_pcm_substream *ss, | ||
| 246 | void *data) | ||
| 247 | { | ||
| 248 | if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
| 249 | dai->playback.dma_data = data; | ||
| 250 | else | ||
| 251 | dai->capture.dma_data = data; | ||
| 252 | } | ||
| 253 | |||
| 233 | #endif | 254 | #endif |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index c0922a034223..66ff4c124dbd 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
| @@ -339,6 +339,9 @@ int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, const char *pin); | |||
| 339 | int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin); | 339 | int snd_soc_dapm_nc_pin(struct snd_soc_codec *codec, const char *pin); |
| 340 | int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin); | 340 | int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, const char *pin); |
| 341 | int snd_soc_dapm_sync(struct snd_soc_codec *codec); | 341 | int snd_soc_dapm_sync(struct snd_soc_codec *codec); |
| 342 | int snd_soc_dapm_force_enable_pin(struct snd_soc_codec *codec, | ||
| 343 | const char *pin); | ||
| 344 | int snd_soc_dapm_ignore_suspend(struct snd_soc_codec *codec, const char *pin); | ||
| 342 | 345 | ||
| 343 | /* dapm widget types */ | 346 | /* dapm widget types */ |
| 344 | enum snd_soc_dapm_type { | 347 | enum snd_soc_dapm_type { |
| @@ -425,9 +428,8 @@ struct snd_soc_dapm_widget { | |||
| 425 | unsigned char connected:1; /* connected codec pin */ | 428 | unsigned char connected:1; /* connected codec pin */ |
| 426 | unsigned char new:1; /* cnew complete */ | 429 | unsigned char new:1; /* cnew complete */ |
| 427 | unsigned char ext:1; /* has external widgets */ | 430 | unsigned char ext:1; /* has external widgets */ |
| 428 | unsigned char muted:1; /* muted for pop reduction */ | 431 | unsigned char force:1; /* force state */ |
| 429 | unsigned char suspend:1; /* was active before suspend */ | 432 | unsigned char ignore_suspend:1; /* kept enabled over suspend */ |
| 430 | unsigned char pmdown:1; /* waiting for timeout */ | ||
| 431 | 433 | ||
| 432 | int (*power_check)(struct snd_soc_dapm_widget *w); | 434 | int (*power_check)(struct snd_soc_dapm_widget *w); |
| 433 | 435 | ||
diff --git a/include/sound/soc.h b/include/sound/soc.h index 5d234a8c2506..697e7ffe39d7 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 18 | #include <linux/notifier.h> | ||
| 18 | #include <linux/workqueue.h> | 19 | #include <linux/workqueue.h> |
| 19 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
| 20 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
| @@ -29,10 +30,10 @@ | |||
| 29 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ | 30 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ |
| 30 | ((unsigned long)&(struct soc_mixer_control) \ | 31 | ((unsigned long)&(struct soc_mixer_control) \ |
| 31 | {.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \ | 32 | {.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \ |
| 32 | .invert = xinvert}) | 33 | .platform_max = xmax, .invert = xinvert}) |
| 33 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ | 34 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ |
| 34 | ((unsigned long)&(struct soc_mixer_control) \ | 35 | ((unsigned long)&(struct soc_mixer_control) \ |
| 35 | {.reg = xreg, .max = xmax, .invert = xinvert}) | 36 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) |
| 36 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ | 37 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ |
| 37 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 38 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| 38 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 39 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
| @@ -52,14 +53,14 @@ | |||
| 52 | .put = snd_soc_put_volsw, \ | 53 | .put = snd_soc_put_volsw, \ |
| 53 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 54 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 54 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 55 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ |
| 55 | .max = xmax, .invert = xinvert} } | 56 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 56 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ | 57 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ |
| 57 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 58 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
| 58 | .info = snd_soc_info_volsw_2r, \ | 59 | .info = snd_soc_info_volsw_2r, \ |
| 59 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ | 60 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ |
| 60 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 61 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 61 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 62 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ |
| 62 | .max = xmax, .invert = xinvert} } | 63 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 63 | #define SOC_DOUBLE_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert, tlv_array) \ | 64 | #define SOC_DOUBLE_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert, tlv_array) \ |
| 64 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 65 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
| 65 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 66 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
| @@ -69,7 +70,7 @@ | |||
| 69 | .put = snd_soc_put_volsw, \ | 70 | .put = snd_soc_put_volsw, \ |
| 70 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 71 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 71 | {.reg = xreg, .shift = shift_left, .rshift = shift_right,\ | 72 | {.reg = xreg, .shift = shift_left, .rshift = shift_right,\ |
| 72 | .max = xmax, .invert = xinvert} } | 73 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 73 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ | 74 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ |
| 74 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 75 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
| 75 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 76 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
| @@ -79,7 +80,7 @@ | |||
| 79 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ | 80 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ |
| 80 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 81 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 81 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 82 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ |
| 82 | .max = xmax, .invert = xinvert} } | 83 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 83 | #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ | 84 | #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ |
| 84 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 85 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
| 85 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 86 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
| @@ -88,7 +89,8 @@ | |||
| 88 | .info = snd_soc_info_volsw_s8, .get = snd_soc_get_volsw_s8, \ | 89 | .info = snd_soc_info_volsw_s8, .get = snd_soc_get_volsw_s8, \ |
| 89 | .put = snd_soc_put_volsw_s8, \ | 90 | .put = snd_soc_put_volsw_s8, \ |
| 90 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 91 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 91 | {.reg = xreg, .min = xmin, .max = xmax} } | 92 | {.reg = xreg, .min = xmin, .max = xmax, \ |
| 93 | .platform_max = xmax} } | ||
| 92 | #define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \ | 94 | #define SOC_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmax, xtexts) \ |
| 93 | { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ | 95 | { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ |
| 94 | .max = xmax, .texts = xtexts } | 96 | .max = xmax, .texts = xtexts } |
| @@ -125,7 +127,7 @@ | |||
| 125 | .get = xhandler_get, .put = xhandler_put, \ | 127 | .get = xhandler_get, .put = xhandler_put, \ |
| 126 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 128 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 127 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 129 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ |
| 128 | .max = xmax, .invert = xinvert} } | 130 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 129 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ | 131 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ |
| 130 | xhandler_get, xhandler_put, tlv_array) \ | 132 | xhandler_get, xhandler_put, tlv_array) \ |
| 131 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 133 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| @@ -145,7 +147,7 @@ | |||
| 145 | .get = xhandler_get, .put = xhandler_put, \ | 147 | .get = xhandler_get, .put = xhandler_put, \ |
| 146 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 148 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 147 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 149 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ |
| 148 | .max = xmax, .invert = xinvert} } | 150 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 149 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ | 151 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ |
| 150 | xhandler_get, xhandler_put, tlv_array) \ | 152 | xhandler_get, xhandler_put, tlv_array) \ |
| 151 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 153 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
| @@ -156,7 +158,7 @@ | |||
| 156 | .get = xhandler_get, .put = xhandler_put, \ | 158 | .get = xhandler_get, .put = xhandler_put, \ |
| 157 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 159 | .private_value = (unsigned long)&(struct soc_mixer_control) \ |
| 158 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 160 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ |
| 159 | .max = xmax, .invert = xinvert} } | 161 | .max = xmax, .platform_max = xmax, .invert = xinvert} } |
| 160 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ | 162 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ |
| 161 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 163 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| 162 | .info = snd_soc_info_bool_ext, \ | 164 | .info = snd_soc_info_bool_ext, \ |
| @@ -212,6 +214,7 @@ struct snd_soc_dai_mode; | |||
| 212 | struct snd_soc_pcm_runtime; | 214 | struct snd_soc_pcm_runtime; |
| 213 | struct snd_soc_dai; | 215 | struct snd_soc_dai; |
| 214 | struct snd_soc_platform; | 216 | struct snd_soc_platform; |
| 217 | struct snd_soc_dai_link; | ||
| 215 | struct snd_soc_codec; | 218 | struct snd_soc_codec; |
| 216 | struct soc_enum; | 219 | struct soc_enum; |
| 217 | struct snd_soc_ac97_ops; | 220 | struct snd_soc_ac97_ops; |
| @@ -260,6 +263,10 @@ int snd_soc_jack_new(struct snd_soc_card *card, const char *id, int type, | |||
| 260 | void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); | 263 | void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); |
| 261 | int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, | 264 | int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, |
| 262 | struct snd_soc_jack_pin *pins); | 265 | struct snd_soc_jack_pin *pins); |
| 266 | void snd_soc_jack_notifier_register(struct snd_soc_jack *jack, | ||
| 267 | struct notifier_block *nb); | ||
| 268 | void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack, | ||
| 269 | struct notifier_block *nb); | ||
| 263 | #ifdef CONFIG_GPIOLIB | 270 | #ifdef CONFIG_GPIOLIB |
| 264 | int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, | 271 | int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, |
| 265 | struct snd_soc_jack_gpio *gpios); | 272 | struct snd_soc_jack_gpio *gpios); |
| @@ -320,6 +327,8 @@ int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol, | |||
| 320 | struct snd_ctl_elem_value *ucontrol); | 327 | struct snd_ctl_elem_value *ucontrol); |
| 321 | int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, | 328 | int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, |
| 322 | struct snd_ctl_elem_value *ucontrol); | 329 | struct snd_ctl_elem_value *ucontrol); |
| 330 | int snd_soc_limit_volume(struct snd_soc_codec *codec, | ||
| 331 | const char *name, int max); | ||
| 323 | 332 | ||
| 324 | /** | 333 | /** |
| 325 | * struct snd_soc_jack_pin - Describes a pin to update based on jack detection | 334 | * struct snd_soc_jack_pin - Describes a pin to update based on jack detection |
| @@ -363,6 +372,7 @@ struct snd_soc_jack { | |||
| 363 | struct snd_soc_card *card; | 372 | struct snd_soc_card *card; |
| 364 | struct list_head pins; | 373 | struct list_head pins; |
| 365 | int status; | 374 | int status; |
| 375 | struct blocking_notifier_head notifier; | ||
| 366 | }; | 376 | }; |
| 367 | 377 | ||
| 368 | /* SoC PCM stream information */ | 378 | /* SoC PCM stream information */ |
| @@ -374,7 +384,8 @@ struct snd_soc_pcm_stream { | |||
| 374 | unsigned int rate_max; /* max rate */ | 384 | unsigned int rate_max; /* max rate */ |
| 375 | unsigned int channels_min; /* min channels */ | 385 | unsigned int channels_min; /* min channels */ |
| 376 | unsigned int channels_max; /* max channels */ | 386 | unsigned int channels_max; /* max channels */ |
| 377 | unsigned int active:1; /* stream is in use */ | 387 | unsigned int active; /* stream is in use */ |
| 388 | void *dma_data; /* used by platform code */ | ||
| 378 | }; | 389 | }; |
| 379 | 390 | ||
| 380 | /* SoC audio ops */ | 391 | /* SoC audio ops */ |
| @@ -406,7 +417,7 @@ struct snd_soc_codec { | |||
| 406 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ | 417 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ |
| 407 | unsigned int active; | 418 | unsigned int active; |
| 408 | unsigned int pcm_devs; | 419 | unsigned int pcm_devs; |
| 409 | void *private_data; | 420 | void *drvdata; |
| 410 | 421 | ||
| 411 | /* codec IO */ | 422 | /* codec IO */ |
| 412 | void *control_data; /* codec control (i2c/3wire) data */ | 423 | void *control_data; /* codec control (i2c/3wire) data */ |
| @@ -461,14 +472,21 @@ struct snd_soc_platform { | |||
| 461 | 472 | ||
| 462 | int (*probe)(struct platform_device *pdev); | 473 | int (*probe)(struct platform_device *pdev); |
| 463 | int (*remove)(struct platform_device *pdev); | 474 | int (*remove)(struct platform_device *pdev); |
| 464 | int (*suspend)(struct snd_soc_dai *dai); | 475 | int (*suspend)(struct snd_soc_dai_link *dai_link); |
| 465 | int (*resume)(struct snd_soc_dai *dai); | 476 | int (*resume)(struct snd_soc_dai_link *dai_link); |
| 466 | 477 | ||
| 467 | /* pcm creation and destruction */ | 478 | /* pcm creation and destruction */ |
| 468 | int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, | 479 | int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, |
| 469 | struct snd_pcm *); | 480 | struct snd_pcm *); |
| 470 | void (*pcm_free)(struct snd_pcm *); | 481 | void (*pcm_free)(struct snd_pcm *); |
| 471 | 482 | ||
| 483 | /* | ||
| 484 | * For platform caused delay reporting. | ||
| 485 | * Optional. | ||
| 486 | */ | ||
| 487 | snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *, | ||
| 488 | struct snd_soc_dai *); | ||
| 489 | |||
| 472 | /* platform stream ops */ | 490 | /* platform stream ops */ |
| 473 | struct snd_pcm_ops *pcm_ops; | 491 | struct snd_pcm_ops *pcm_ops; |
| 474 | }; | 492 | }; |
| @@ -488,6 +506,9 @@ struct snd_soc_dai_link { | |||
| 488 | /* codec/machine specific init - e.g. add machine controls */ | 506 | /* codec/machine specific init - e.g. add machine controls */ |
| 489 | int (*init)(struct snd_soc_codec *codec); | 507 | int (*init)(struct snd_soc_codec *codec); |
| 490 | 508 | ||
| 509 | /* Keep DAI active over suspend */ | ||
| 510 | unsigned int ignore_suspend:1; | ||
| 511 | |||
| 491 | /* Symmetry requirements */ | 512 | /* Symmetry requirements */ |
| 492 | unsigned int symmetric_rates:1; | 513 | unsigned int symmetric_rates:1; |
| 493 | 514 | ||
| @@ -552,7 +573,7 @@ struct snd_soc_pcm_runtime { | |||
| 552 | 573 | ||
| 553 | /* mixer control */ | 574 | /* mixer control */ |
| 554 | struct soc_mixer_control { | 575 | struct soc_mixer_control { |
| 555 | int min, max; | 576 | int min, max, platform_max; |
| 556 | unsigned int reg, rreg, shift, rshift, invert; | 577 | unsigned int reg, rreg, shift, rshift, invert; |
| 557 | }; | 578 | }; |
| 558 | 579 | ||
| @@ -582,6 +603,17 @@ static inline unsigned int snd_soc_write(struct snd_soc_codec *codec, | |||
| 582 | return codec->write(codec, reg, val); | 603 | return codec->write(codec, reg, val); |
| 583 | } | 604 | } |
| 584 | 605 | ||
| 606 | static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec, | ||
| 607 | void *data) | ||
| 608 | { | ||
| 609 | codec->drvdata = data; | ||
| 610 | } | ||
| 611 | |||
| 612 | static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec) | ||
| 613 | { | ||
| 614 | return codec->drvdata; | ||
| 615 | } | ||
| 616 | |||
| 585 | #include <sound/soc-dai.h> | 617 | #include <sound/soc-dai.h> |
| 586 | 618 | ||
| 587 | #endif | 619 | #endif |
diff --git a/include/sound/tlv320aic3x.h b/include/sound/tlv320aic3x.h new file mode 100644 index 000000000000..b1a5f34e5cfa --- /dev/null +++ b/include/sound/tlv320aic3x.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* | ||
| 2 | * Platform data for Texas Instruments TLV320AIC3x codec | ||
| 3 | * | ||
| 4 | * Author: Jarkko Nikula <jhnikula@gmail.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | #ifndef __TLV320AIC3x_H__ | ||
| 11 | #define __TLV320AIC3x_H__ | ||
| 12 | |||
| 13 | struct aic3x_pdata { | ||
| 14 | int gpio_reset; /* < 0 if not used */ | ||
| 15 | }; | ||
| 16 | |||
| 17 | #endif \ No newline at end of file | ||
diff --git a/include/sound/tlv320dac33-plat.h b/include/sound/tlv320dac33-plat.h index ac0665264bdf..3f428d53195b 100644 --- a/include/sound/tlv320dac33-plat.h +++ b/include/sound/tlv320dac33-plat.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | struct tlv320dac33_platform_data { | 16 | struct tlv320dac33_platform_data { |
| 17 | int power_gpio; | 17 | int power_gpio; |
| 18 | int keep_bclk; /* Keep the BCLK running in FIFO modes */ | ||
| 18 | u8 burst_bclkdiv; | 19 | u8 burst_bclkdiv; |
| 19 | }; | 20 | }; |
| 20 | 21 | ||
diff --git a/include/sound/uda134x.h b/include/sound/uda134x.h index 475ef8bb7dcd..509efb050176 100644 --- a/include/sound/uda134x.h +++ b/include/sound/uda134x.h | |||
| @@ -21,6 +21,7 @@ struct uda134x_platform_data { | |||
| 21 | #define UDA134X_UDA1340 1 | 21 | #define UDA134X_UDA1340 1 |
| 22 | #define UDA134X_UDA1341 2 | 22 | #define UDA134X_UDA1341 2 |
| 23 | #define UDA134X_UDA1344 3 | 23 | #define UDA134X_UDA1344 3 |
| 24 | #define UDA134X_UDA1345 4 | ||
| 24 | }; | 25 | }; |
| 25 | 26 | ||
| 26 | #endif /* _UDA134X_H */ | 27 | #endif /* _UDA134X_H */ |
diff --git a/include/sound/version.h b/include/sound/version.h index 7fed23442db8..bf69a5b7e65f 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
| @@ -1,3 +1,3 @@ | |||
| 1 | /* include/version.h */ | 1 | /* include/version.h */ |
| 2 | #define CONFIG_SND_VERSION "1.0.22.1" | 2 | #define CONFIG_SND_VERSION "1.0.23" |
| 3 | #define CONFIG_SND_DATE "" | 3 | #define CONFIG_SND_DATE "" |
diff --git a/include/sound/wm8903.h b/include/sound/wm8903.h new file mode 100644 index 000000000000..b4a0db2307ef --- /dev/null +++ b/include/sound/wm8903.h | |||
| @@ -0,0 +1,249 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/wm8903.h -- Platform data for WM8903 | ||
| 3 | * | ||
| 4 | * Copyright 2010 Wolfson Microelectronics. PLC. | ||
| 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_WM8903_H | ||
| 12 | #define __LINUX_SND_WM8903_H | ||
| 13 | |||
| 14 | /* Used to enable configuration of a GPIO to all zeros */ | ||
| 15 | #define WM8903_GPIO_NO_CONFIG 0x8000 | ||
| 16 | |||
| 17 | /* | ||
| 18 | * R6 (0x06) - Mic Bias Control 0 | ||
| 19 | */ | ||
| 20 | #define WM8903_MICDET_HYST_ENA 0x0080 /* MICDET_HYST_ENA */ | ||
| 21 | #define WM8903_MICDET_HYST_ENA_MASK 0x0080 /* MICDET_HYST_ENA */ | ||
| 22 | #define WM8903_MICDET_HYST_ENA_SHIFT 7 /* MICDET_HYST_ENA */ | ||
| 23 | #define WM8903_MICDET_HYST_ENA_WIDTH 1 /* MICDET_HYST_ENA */ | ||
| 24 | #define WM8903_MICDET_THR_MASK 0x0070 /* MICDET_THR - [6:4] */ | ||
| 25 | #define WM8903_MICDET_THR_SHIFT 4 /* MICDET_THR - [6:4] */ | ||
| 26 | #define WM8903_MICDET_THR_WIDTH 3 /* MICDET_THR - [6:4] */ | ||
| 27 | #define WM8903_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */ | ||
| 28 | #define WM8903_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */ | ||
| 29 | #define WM8903_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */ | ||
| 30 | #define WM8903_MICDET_ENA 0x0002 /* MICDET_ENA */ | ||
| 31 | #define WM8903_MICDET_ENA_MASK 0x0002 /* MICDET_ENA */ | ||
| 32 | #define WM8903_MICDET_ENA_SHIFT 1 /* MICDET_ENA */ | ||
| 33 | #define WM8903_MICDET_ENA_WIDTH 1 /* MICDET_ENA */ | ||
| 34 | #define WM8903_MICBIAS_ENA 0x0001 /* MICBIAS_ENA */ | ||
| 35 | #define WM8903_MICBIAS_ENA_MASK 0x0001 /* MICBIAS_ENA */ | ||
| 36 | #define WM8903_MICBIAS_ENA_SHIFT 0 /* MICBIAS_ENA */ | ||
| 37 | #define WM8903_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */ | ||
| 38 | |||
| 39 | /* | ||
| 40 | * R116 (0x74) - GPIO Control 1 | ||
| 41 | */ | ||
| 42 | #define WM8903_GP1_FN_MASK 0x1F00 /* GP1_FN - [12:8] */ | ||
| 43 | #define WM8903_GP1_FN_SHIFT 8 /* GP1_FN - [12:8] */ | ||
| 44 | #define WM8903_GP1_FN_WIDTH 5 /* GP1_FN - [12:8] */ | ||
| 45 | #define WM8903_GP1_DIR 0x0080 /* GP1_DIR */ | ||
| 46 | #define WM8903_GP1_DIR_MASK 0x0080 /* GP1_DIR */ | ||
| 47 | #define WM8903_GP1_DIR_SHIFT 7 /* GP1_DIR */ | ||
| 48 | #define WM8903_GP1_DIR_WIDTH 1 /* GP1_DIR */ | ||
| 49 | #define WM8903_GP1_OP_CFG 0x0040 /* GP1_OP_CFG */ | ||
| 50 | #define WM8903_GP1_OP_CFG_MASK 0x0040 /* GP1_OP_CFG */ | ||
| 51 | #define WM8903_GP1_OP_CFG_SHIFT 6 /* GP1_OP_CFG */ | ||
| 52 | #define WM8903_GP1_OP_CFG_WIDTH 1 /* GP1_OP_CFG */ | ||
| 53 | #define WM8903_GP1_IP_CFG 0x0020 /* GP1_IP_CFG */ | ||
| 54 | #define WM8903_GP1_IP_CFG_MASK 0x0020 /* GP1_IP_CFG */ | ||
| 55 | #define WM8903_GP1_IP_CFG_SHIFT 5 /* GP1_IP_CFG */ | ||
| 56 | #define WM8903_GP1_IP_CFG_WIDTH 1 /* GP1_IP_CFG */ | ||
| 57 | #define WM8903_GP1_LVL 0x0010 /* GP1_LVL */ | ||
| 58 | #define WM8903_GP1_LVL_MASK 0x0010 /* GP1_LVL */ | ||
| 59 | #define WM8903_GP1_LVL_SHIFT 4 /* GP1_LVL */ | ||
| 60 | #define WM8903_GP1_LVL_WIDTH 1 /* GP1_LVL */ | ||
| 61 | #define WM8903_GP1_PD 0x0008 /* GP1_PD */ | ||
| 62 | #define WM8903_GP1_PD_MASK 0x0008 /* GP1_PD */ | ||
| 63 | #define WM8903_GP1_PD_SHIFT 3 /* GP1_PD */ | ||
| 64 | #define WM8903_GP1_PD_WIDTH 1 /* GP1_PD */ | ||
| 65 | #define WM8903_GP1_PU 0x0004 /* GP1_PU */ | ||
| 66 | #define WM8903_GP1_PU_MASK 0x0004 /* GP1_PU */ | ||
| 67 | #define WM8903_GP1_PU_SHIFT 2 /* GP1_PU */ | ||
| 68 | #define WM8903_GP1_PU_WIDTH 1 /* GP1_PU */ | ||
| 69 | #define WM8903_GP1_INTMODE 0x0002 /* GP1_INTMODE */ | ||
| 70 | #define WM8903_GP1_INTMODE_MASK 0x0002 /* GP1_INTMODE */ | ||
| 71 | #define WM8903_GP1_INTMODE_SHIFT 1 /* GP1_INTMODE */ | ||
| 72 | #define WM8903_GP1_INTMODE_WIDTH 1 /* GP1_INTMODE */ | ||
| 73 | #define WM8903_GP1_DB 0x0001 /* GP1_DB */ | ||
| 74 | #define WM8903_GP1_DB_MASK 0x0001 /* GP1_DB */ | ||
| 75 | #define WM8903_GP1_DB_SHIFT 0 /* GP1_DB */ | ||
| 76 | #define WM8903_GP1_DB_WIDTH 1 /* GP1_DB */ | ||
| 77 | |||
| 78 | /* | ||
| 79 | * R117 (0x75) - GPIO Control 2 | ||
| 80 | */ | ||
| 81 | #define WM8903_GP2_FN_MASK 0x1F00 /* GP2_FN - [12:8] */ | ||
| 82 | #define WM8903_GP2_FN_SHIFT 8 /* GP2_FN - [12:8] */ | ||
| 83 | #define WM8903_GP2_FN_WIDTH 5 /* GP2_FN - [12:8] */ | ||
| 84 | #define WM8903_GP2_DIR 0x0080 /* GP2_DIR */ | ||
| 85 | #define WM8903_GP2_DIR_MASK 0x0080 /* GP2_DIR */ | ||
| 86 | #define WM8903_GP2_DIR_SHIFT 7 /* GP2_DIR */ | ||
| 87 | #define WM8903_GP2_DIR_WIDTH 1 /* GP2_DIR */ | ||
| 88 | #define WM8903_GP2_OP_CFG 0x0040 /* GP2_OP_CFG */ | ||
| 89 | #define WM8903_GP2_OP_CFG_MASK 0x0040 /* GP2_OP_CFG */ | ||
| 90 | #define WM8903_GP2_OP_CFG_SHIFT 6 /* GP2_OP_CFG */ | ||
| 91 | #define WM8903_GP2_OP_CFG_WIDTH 1 /* GP2_OP_CFG */ | ||
| 92 | #define WM8903_GP2_IP_CFG 0x0020 /* GP2_IP_CFG */ | ||
| 93 | #define WM8903_GP2_IP_CFG_MASK 0x0020 /* GP2_IP_CFG */ | ||
| 94 | #define WM8903_GP2_IP_CFG_SHIFT 5 /* GP2_IP_CFG */ | ||
| 95 | #define WM8903_GP2_IP_CFG_WIDTH 1 /* GP2_IP_CFG */ | ||
| 96 | #define WM8903_GP2_LVL 0x0010 /* GP2_LVL */ | ||
| 97 | #define WM8903_GP2_LVL_MASK 0x0010 /* GP2_LVL */ | ||
| 98 | #define WM8903_GP2_LVL_SHIFT 4 /* GP2_LVL */ | ||
| 99 | #define WM8903_GP2_LVL_WIDTH 1 /* GP2_LVL */ | ||
| 100 | #define WM8903_GP2_PD 0x0008 /* GP2_PD */ | ||
| 101 | #define WM8903_GP2_PD_MASK 0x0008 /* GP2_PD */ | ||
| 102 | #define WM8903_GP2_PD_SHIFT 3 /* GP2_PD */ | ||
| 103 | #define WM8903_GP2_PD_WIDTH 1 /* GP2_PD */ | ||
| 104 | #define WM8903_GP2_PU 0x0004 /* GP2_PU */ | ||
| 105 | #define WM8903_GP2_PU_MASK 0x0004 /* GP2_PU */ | ||
| 106 | #define WM8903_GP2_PU_SHIFT 2 /* GP2_PU */ | ||
| 107 | #define WM8903_GP2_PU_WIDTH 1 /* GP2_PU */ | ||
| 108 | #define WM8903_GP2_INTMODE 0x0002 /* GP2_INTMODE */ | ||
| 109 | #define WM8903_GP2_INTMODE_MASK 0x0002 /* GP2_INTMODE */ | ||
| 110 | #define WM8903_GP2_INTMODE_SHIFT 1 /* GP2_INTMODE */ | ||
| 111 | #define WM8903_GP2_INTMODE_WIDTH 1 /* GP2_INTMODE */ | ||
| 112 | #define WM8903_GP2_DB 0x0001 /* GP2_DB */ | ||
| 113 | #define WM8903_GP2_DB_MASK 0x0001 /* GP2_DB */ | ||
| 114 | #define WM8903_GP2_DB_SHIFT 0 /* GP2_DB */ | ||
| 115 | #define WM8903_GP2_DB_WIDTH 1 /* GP2_DB */ | ||
| 116 | |||
| 117 | /* | ||
| 118 | * R118 (0x76) - GPIO Control 3 | ||
| 119 | */ | ||
| 120 | #define WM8903_GP3_FN_MASK 0x1F00 /* GP3_FN - [12:8] */ | ||
| 121 | #define WM8903_GP3_FN_SHIFT 8 /* GP3_FN - [12:8] */ | ||
| 122 | #define WM8903_GP3_FN_WIDTH 5 /* GP3_FN - [12:8] */ | ||
| 123 | #define WM8903_GP3_DIR 0x0080 /* GP3_DIR */ | ||
| 124 | #define WM8903_GP3_DIR_MASK 0x0080 /* GP3_DIR */ | ||
| 125 | #define WM8903_GP3_DIR_SHIFT 7 /* GP3_DIR */ | ||
| 126 | #define WM8903_GP3_DIR_WIDTH 1 /* GP3_DIR */ | ||
| 127 | #define WM8903_GP3_OP_CFG 0x0040 /* GP3_OP_CFG */ | ||
| 128 | #define WM8903_GP3_OP_CFG_MASK 0x0040 /* GP3_OP_CFG */ | ||
| 129 | #define WM8903_GP3_OP_CFG_SHIFT 6 /* GP3_OP_CFG */ | ||
| 130 | #define WM8903_GP3_OP_CFG_WIDTH 1 /* GP3_OP_CFG */ | ||
| 131 | #define WM8903_GP3_IP_CFG 0x0020 /* GP3_IP_CFG */ | ||
| 132 | #define WM8903_GP3_IP_CFG_MASK 0x0020 /* GP3_IP_CFG */ | ||
| 133 | #define WM8903_GP3_IP_CFG_SHIFT 5 /* GP3_IP_CFG */ | ||
| 134 | #define WM8903_GP3_IP_CFG_WIDTH 1 /* GP3_IP_CFG */ | ||
| 135 | #define WM8903_GP3_LVL 0x0010 /* GP3_LVL */ | ||
| 136 | #define WM8903_GP3_LVL_MASK 0x0010 /* GP3_LVL */ | ||
| 137 | #define WM8903_GP3_LVL_SHIFT 4 /* GP3_LVL */ | ||
| 138 | #define WM8903_GP3_LVL_WIDTH 1 /* GP3_LVL */ | ||
| 139 | #define WM8903_GP3_PD 0x0008 /* GP3_PD */ | ||
| 140 | #define WM8903_GP3_PD_MASK 0x0008 /* GP3_PD */ | ||
| 141 | #define WM8903_GP3_PD_SHIFT 3 /* GP3_PD */ | ||
| 142 | #define WM8903_GP3_PD_WIDTH 1 /* GP3_PD */ | ||
| 143 | #define WM8903_GP3_PU 0x0004 /* GP3_PU */ | ||
| 144 | #define WM8903_GP3_PU_MASK 0x0004 /* GP3_PU */ | ||
| 145 | #define WM8903_GP3_PU_SHIFT 2 /* GP3_PU */ | ||
| 146 | #define WM8903_GP3_PU_WIDTH 1 /* GP3_PU */ | ||
| 147 | #define WM8903_GP3_INTMODE 0x0002 /* GP3_INTMODE */ | ||
| 148 | #define WM8903_GP3_INTMODE_MASK 0x0002 /* GP3_INTMODE */ | ||
| 149 | #define WM8903_GP3_INTMODE_SHIFT 1 /* GP3_INTMODE */ | ||
| 150 | #define WM8903_GP3_INTMODE_WIDTH 1 /* GP3_INTMODE */ | ||
| 151 | #define WM8903_GP3_DB 0x0001 /* GP3_DB */ | ||
| 152 | #define WM8903_GP3_DB_MASK 0x0001 /* GP3_DB */ | ||
| 153 | #define WM8903_GP3_DB_SHIFT 0 /* GP3_DB */ | ||
| 154 | #define WM8903_GP3_DB_WIDTH 1 /* GP3_DB */ | ||
| 155 | |||
| 156 | /* | ||
| 157 | * R119 (0x77) - GPIO Control 4 | ||
| 158 | */ | ||
| 159 | #define WM8903_GP4_FN_MASK 0x1F00 /* GP4_FN - [12:8] */ | ||
| 160 | #define WM8903_GP4_FN_SHIFT 8 /* GP4_FN - [12:8] */ | ||
| 161 | #define WM8903_GP4_FN_WIDTH 5 /* GP4_FN - [12:8] */ | ||
| 162 | #define WM8903_GP4_DIR 0x0080 /* GP4_DIR */ | ||
| 163 | #define WM8903_GP4_DIR_MASK 0x0080 /* GP4_DIR */ | ||
| 164 | #define WM8903_GP4_DIR_SHIFT 7 /* GP4_DIR */ | ||
| 165 | #define WM8903_GP4_DIR_WIDTH 1 /* GP4_DIR */ | ||
| 166 | #define WM8903_GP4_OP_CFG 0x0040 /* GP4_OP_CFG */ | ||
| 167 | #define WM8903_GP4_OP_CFG_MASK 0x0040 /* GP4_OP_CFG */ | ||
| 168 | #define WM8903_GP4_OP_CFG_SHIFT 6 /* GP4_OP_CFG */ | ||
| 169 | #define WM8903_GP4_OP_CFG_WIDTH 1 /* GP4_OP_CFG */ | ||
| 170 | #define WM8903_GP4_IP_CFG 0x0020 /* GP4_IP_CFG */ | ||
| 171 | #define WM8903_GP4_IP_CFG_MASK 0x0020 /* GP4_IP_CFG */ | ||
| 172 | #define WM8903_GP4_IP_CFG_SHIFT 5 /* GP4_IP_CFG */ | ||
| 173 | #define WM8903_GP4_IP_CFG_WIDTH 1 /* GP4_IP_CFG */ | ||
| 174 | #define WM8903_GP4_LVL 0x0010 /* GP4_LVL */ | ||
| 175 | #define WM8903_GP4_LVL_MASK 0x0010 /* GP4_LVL */ | ||
| 176 | #define WM8903_GP4_LVL_SHIFT 4 /* GP4_LVL */ | ||
| 177 | #define WM8903_GP4_LVL_WIDTH 1 /* GP4_LVL */ | ||
| 178 | #define WM8903_GP4_PD 0x0008 /* GP4_PD */ | ||
| 179 | #define WM8903_GP4_PD_MASK 0x0008 /* GP4_PD */ | ||
| 180 | #define WM8903_GP4_PD_SHIFT 3 /* GP4_PD */ | ||
| 181 | #define WM8903_GP4_PD_WIDTH 1 /* GP4_PD */ | ||
| 182 | #define WM8903_GP4_PU 0x0004 /* GP4_PU */ | ||
| 183 | #define WM8903_GP4_PU_MASK 0x0004 /* GP4_PU */ | ||
| 184 | #define WM8903_GP4_PU_SHIFT 2 /* GP4_PU */ | ||
| 185 | #define WM8903_GP4_PU_WIDTH 1 /* GP4_PU */ | ||
| 186 | #define WM8903_GP4_INTMODE 0x0002 /* GP4_INTMODE */ | ||
| 187 | #define WM8903_GP4_INTMODE_MASK 0x0002 /* GP4_INTMODE */ | ||
| 188 | #define WM8903_GP4_INTMODE_SHIFT 1 /* GP4_INTMODE */ | ||
| 189 | #define WM8903_GP4_INTMODE_WIDTH 1 /* GP4_INTMODE */ | ||
| 190 | #define WM8903_GP4_DB 0x0001 /* GP4_DB */ | ||
| 191 | #define WM8903_GP4_DB_MASK 0x0001 /* GP4_DB */ | ||
| 192 | #define WM8903_GP4_DB_SHIFT 0 /* GP4_DB */ | ||
| 193 | #define WM8903_GP4_DB_WIDTH 1 /* GP4_DB */ | ||
| 194 | |||
| 195 | /* | ||
| 196 | * R120 (0x78) - GPIO Control 5 | ||
| 197 | */ | ||
| 198 | #define WM8903_GP5_FN_MASK 0x1F00 /* GP5_FN - [12:8] */ | ||
| 199 | #define WM8903_GP5_FN_SHIFT 8 /* GP5_FN - [12:8] */ | ||
| 200 | #define WM8903_GP5_FN_WIDTH 5 /* GP5_FN - [12:8] */ | ||
| 201 | #define WM8903_GP5_DIR 0x0080 /* GP5_DIR */ | ||
| 202 | #define WM8903_GP5_DIR_MASK 0x0080 /* GP5_DIR */ | ||
| 203 | #define WM8903_GP5_DIR_SHIFT 7 /* GP5_DIR */ | ||
| 204 | #define WM8903_GP5_DIR_WIDTH 1 /* GP5_DIR */ | ||
| 205 | #define WM8903_GP5_OP_CFG 0x0040 /* GP5_OP_CFG */ | ||
| 206 | #define WM8903_GP5_OP_CFG_MASK 0x0040 /* GP5_OP_CFG */ | ||
| 207 | #define WM8903_GP5_OP_CFG_SHIFT 6 /* GP5_OP_CFG */ | ||
| 208 | #define WM8903_GP5_OP_CFG_WIDTH 1 /* GP5_OP_CFG */ | ||
| 209 | #define WM8903_GP5_IP_CFG 0x0020 /* GP5_IP_CFG */ | ||
| 210 | #define WM8903_GP5_IP_CFG_MASK 0x0020 /* GP5_IP_CFG */ | ||
| 211 | #define WM8903_GP5_IP_CFG_SHIFT 5 /* GP5_IP_CFG */ | ||
| 212 | #define WM8903_GP5_IP_CFG_WIDTH 1 /* GP5_IP_CFG */ | ||
| 213 | #define WM8903_GP5_LVL 0x0010 /* GP5_LVL */ | ||
| 214 | #define WM8903_GP5_LVL_MASK 0x0010 /* GP5_LVL */ | ||
| 215 | #define WM8903_GP5_LVL_SHIFT 4 /* GP5_LVL */ | ||
| 216 | #define WM8903_GP5_LVL_WIDTH 1 /* GP5_LVL */ | ||
| 217 | #define WM8903_GP5_PD 0x0008 /* GP5_PD */ | ||
| 218 | #define WM8903_GP5_PD_MASK 0x0008 /* GP5_PD */ | ||
| 219 | #define WM8903_GP5_PD_SHIFT 3 /* GP5_PD */ | ||
| 220 | #define WM8903_GP5_PD_WIDTH 1 /* GP5_PD */ | ||
| 221 | #define WM8903_GP5_PU 0x0004 /* GP5_PU */ | ||
| 222 | #define WM8903_GP5_PU_MASK 0x0004 /* GP5_PU */ | ||
| 223 | #define WM8903_GP5_PU_SHIFT 2 /* GP5_PU */ | ||
| 224 | #define WM8903_GP5_PU_WIDTH 1 /* GP5_PU */ | ||
| 225 | #define WM8903_GP5_INTMODE 0x0002 /* GP5_INTMODE */ | ||
| 226 | #define WM8903_GP5_INTMODE_MASK 0x0002 /* GP5_INTMODE */ | ||
| 227 | #define WM8903_GP5_INTMODE_SHIFT 1 /* GP5_INTMODE */ | ||
| 228 | #define WM8903_GP5_INTMODE_WIDTH 1 /* GP5_INTMODE */ | ||
| 229 | #define WM8903_GP5_DB 0x0001 /* GP5_DB */ | ||
| 230 | #define WM8903_GP5_DB_MASK 0x0001 /* GP5_DB */ | ||
| 231 | #define WM8903_GP5_DB_SHIFT 0 /* GP5_DB */ | ||
| 232 | #define WM8903_GP5_DB_WIDTH 1 /* GP5_DB */ | ||
| 233 | |||
| 234 | struct wm8903_platform_data { | ||
| 235 | bool irq_active_low; /* Set if IRQ active low, default high */ | ||
| 236 | |||
| 237 | /* Default register value for R6 (Mic bias), used to configure | ||
| 238 | * microphone detection. In conjunction with gpio_cfg this | ||
| 239 | * can be used to route the microphone status signals out onto | ||
| 240 | * the GPIOs for use with snd_soc_jack_add_gpios(). | ||
| 241 | */ | ||
| 242 | u16 micdet_cfg; | ||
| 243 | |||
| 244 | int micdet_delay; /* Delay after microphone detection (ms) */ | ||
| 245 | |||
| 246 | u32 gpio_cfg[5]; /* Default register values for GPIO pin mux */ | ||
| 247 | }; | ||
| 248 | |||
| 249 | #endif | ||
diff --git a/include/sound/wm8904.h b/include/sound/wm8904.h index d66575a601be..898be3a8db9a 100644 --- a/include/sound/wm8904.h +++ b/include/sound/wm8904.h | |||
| @@ -15,8 +15,111 @@ | |||
| 15 | #ifndef __MFD_WM8994_PDATA_H__ | 15 | #ifndef __MFD_WM8994_PDATA_H__ |
| 16 | #define __MFD_WM8994_PDATA_H__ | 16 | #define __MFD_WM8994_PDATA_H__ |
| 17 | 17 | ||
| 18 | #define WM8904_DRC_REGS 4 | 18 | /* Used to enable configuration of a GPIO to all zeros */ |
| 19 | #define WM8904_EQ_REGS 25 | 19 | #define WM8904_GPIO_NO_CONFIG 0x8000 |
| 20 | |||
| 21 | /* | ||
| 22 | * R6 (0x06) - Mic Bias Control 0 | ||
| 23 | */ | ||
| 24 | #define WM8904_MICDET_THR_MASK 0x0070 /* MICDET_THR - [6:4] */ | ||
| 25 | #define WM8904_MICDET_THR_SHIFT 4 /* MICDET_THR - [6:4] */ | ||
| 26 | #define WM8904_MICDET_THR_WIDTH 3 /* MICDET_THR - [6:4] */ | ||
| 27 | #define WM8904_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */ | ||
| 28 | #define WM8904_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */ | ||
| 29 | #define WM8904_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */ | ||
| 30 | #define WM8904_MICDET_ENA 0x0002 /* MICDET_ENA */ | ||
| 31 | #define WM8904_MICDET_ENA_MASK 0x0002 /* MICDET_ENA */ | ||
| 32 | #define WM8904_MICDET_ENA_SHIFT 1 /* MICDET_ENA */ | ||
| 33 | #define WM8904_MICDET_ENA_WIDTH 1 /* MICDET_ENA */ | ||
| 34 | #define WM8904_MICBIAS_ENA 0x0001 /* MICBIAS_ENA */ | ||
| 35 | #define WM8904_MICBIAS_ENA_MASK 0x0001 /* MICBIAS_ENA */ | ||
| 36 | #define WM8904_MICBIAS_ENA_SHIFT 0 /* MICBIAS_ENA */ | ||
| 37 | #define WM8904_MICBIAS_ENA_WIDTH 1 /* MICBIAS_ENA */ | ||
| 38 | |||
| 39 | /* | ||
| 40 | * R7 (0x07) - Mic Bias Control 1 | ||
| 41 | */ | ||
| 42 | #define WM8904_MIC_DET_FILTER_ENA 0x8000 /* MIC_DET_FILTER_ENA */ | ||
| 43 | #define WM8904_MIC_DET_FILTER_ENA_MASK 0x8000 /* MIC_DET_FILTER_ENA */ | ||
| 44 | #define WM8904_MIC_DET_FILTER_ENA_SHIFT 15 /* MIC_DET_FILTER_ENA */ | ||
| 45 | #define WM8904_MIC_DET_FILTER_ENA_WIDTH 1 /* MIC_DET_FILTER_ENA */ | ||
| 46 | #define WM8904_MIC_SHORT_FILTER_ENA 0x4000 /* MIC_SHORT_FILTER_ENA */ | ||
| 47 | #define WM8904_MIC_SHORT_FILTER_ENA_MASK 0x4000 /* MIC_SHORT_FILTER_ENA */ | ||
| 48 | #define WM8904_MIC_SHORT_FILTER_ENA_SHIFT 14 /* MIC_SHORT_FILTER_ENA */ | ||
| 49 | #define WM8904_MIC_SHORT_FILTER_ENA_WIDTH 1 /* MIC_SHORT_FILTER_ENA */ | ||
| 50 | #define WM8904_MICBIAS_SEL_MASK 0x0007 /* MICBIAS_SEL - [2:0] */ | ||
| 51 | #define WM8904_MICBIAS_SEL_SHIFT 0 /* MICBIAS_SEL - [2:0] */ | ||
| 52 | #define WM8904_MICBIAS_SEL_WIDTH 3 /* MICBIAS_SEL - [2:0] */ | ||
| 53 | |||
| 54 | |||
| 55 | /* | ||
| 56 | * R121 (0x79) - GPIO Control 1 | ||
| 57 | */ | ||
| 58 | #define WM8904_GPIO1_PU 0x0020 /* GPIO1_PU */ | ||
| 59 | #define WM8904_GPIO1_PU_MASK 0x0020 /* GPIO1_PU */ | ||
| 60 | #define WM8904_GPIO1_PU_SHIFT 5 /* GPIO1_PU */ | ||
| 61 | #define WM8904_GPIO1_PU_WIDTH 1 /* GPIO1_PU */ | ||
| 62 | #define WM8904_GPIO1_PD 0x0010 /* GPIO1_PD */ | ||
| 63 | #define WM8904_GPIO1_PD_MASK 0x0010 /* GPIO1_PD */ | ||
| 64 | #define WM8904_GPIO1_PD_SHIFT 4 /* GPIO1_PD */ | ||
| 65 | #define WM8904_GPIO1_PD_WIDTH 1 /* GPIO1_PD */ | ||
| 66 | #define WM8904_GPIO1_SEL_MASK 0x000F /* GPIO1_SEL - [3:0] */ | ||
| 67 | #define WM8904_GPIO1_SEL_SHIFT 0 /* GPIO1_SEL - [3:0] */ | ||
| 68 | #define WM8904_GPIO1_SEL_WIDTH 4 /* GPIO1_SEL - [3:0] */ | ||
| 69 | |||
| 70 | /* | ||
| 71 | * R122 (0x7A) - GPIO Control 2 | ||
| 72 | */ | ||
| 73 | #define WM8904_GPIO2_PU 0x0020 /* GPIO2_PU */ | ||
| 74 | #define WM8904_GPIO2_PU_MASK 0x0020 /* GPIO2_PU */ | ||
| 75 | #define WM8904_GPIO2_PU_SHIFT 5 /* GPIO2_PU */ | ||
| 76 | #define WM8904_GPIO2_PU_WIDTH 1 /* GPIO2_PU */ | ||
| 77 | #define WM8904_GPIO2_PD 0x0010 /* GPIO2_PD */ | ||
| 78 | #define WM8904_GPIO2_PD_MASK 0x0010 /* GPIO2_PD */ | ||
| 79 | #define WM8904_GPIO2_PD_SHIFT 4 /* GPIO2_PD */ | ||
| 80 | #define WM8904_GPIO2_PD_WIDTH 1 /* GPIO2_PD */ | ||
| 81 | #define WM8904_GPIO2_SEL_MASK 0x000F /* GPIO2_SEL - [3:0] */ | ||
| 82 | #define WM8904_GPIO2_SEL_SHIFT 0 /* GPIO2_SEL - [3:0] */ | ||
| 83 | #define WM8904_GPIO2_SEL_WIDTH 4 /* GPIO2_SEL - [3:0] */ | ||
| 84 | |||
| 85 | /* | ||
| 86 | * R123 (0x7B) - GPIO Control 3 | ||
| 87 | */ | ||
| 88 | #define WM8904_GPIO3_PU 0x0020 /* GPIO3_PU */ | ||
| 89 | #define WM8904_GPIO3_PU_MASK 0x0020 /* GPIO3_PU */ | ||
| 90 | #define WM8904_GPIO3_PU_SHIFT 5 /* GPIO3_PU */ | ||
| 91 | #define WM8904_GPIO3_PU_WIDTH 1 /* GPIO3_PU */ | ||
| 92 | #define WM8904_GPIO3_PD 0x0010 /* GPIO3_PD */ | ||
| 93 | #define WM8904_GPIO3_PD_MASK 0x0010 /* GPIO3_PD */ | ||
| 94 | #define WM8904_GPIO3_PD_SHIFT 4 /* GPIO3_PD */ | ||
| 95 | #define WM8904_GPIO3_PD_WIDTH 1 /* GPIO3_PD */ | ||
| 96 | #define WM8904_GPIO3_SEL_MASK 0x000F /* GPIO3_SEL - [3:0] */ | ||
| 97 | #define WM8904_GPIO3_SEL_SHIFT 0 /* GPIO3_SEL - [3:0] */ | ||
| 98 | #define WM8904_GPIO3_SEL_WIDTH 4 /* GPIO3_SEL - [3:0] */ | ||
| 99 | |||
| 100 | /* | ||
| 101 | * R124 (0x7C) - GPIO Control 4 | ||
| 102 | */ | ||
| 103 | #define WM8904_GPI7_ENA 0x0200 /* GPI7_ENA */ | ||
| 104 | #define WM8904_GPI7_ENA_MASK 0x0200 /* GPI7_ENA */ | ||
| 105 | #define WM8904_GPI7_ENA_SHIFT 9 /* GPI7_ENA */ | ||
| 106 | #define WM8904_GPI7_ENA_WIDTH 1 /* GPI7_ENA */ | ||
| 107 | #define WM8904_GPI8_ENA 0x0100 /* GPI8_ENA */ | ||
| 108 | #define WM8904_GPI8_ENA_MASK 0x0100 /* GPI8_ENA */ | ||
| 109 | #define WM8904_GPI8_ENA_SHIFT 8 /* GPI8_ENA */ | ||
| 110 | #define WM8904_GPI8_ENA_WIDTH 1 /* GPI8_ENA */ | ||
| 111 | #define WM8904_GPIO_BCLK_MODE_ENA 0x0080 /* GPIO_BCLK_MODE_ENA */ | ||
| 112 | #define WM8904_GPIO_BCLK_MODE_ENA_MASK 0x0080 /* GPIO_BCLK_MODE_ENA */ | ||
| 113 | #define WM8904_GPIO_BCLK_MODE_ENA_SHIFT 7 /* GPIO_BCLK_MODE_ENA */ | ||
| 114 | #define WM8904_GPIO_BCLK_MODE_ENA_WIDTH 1 /* GPIO_BCLK_MODE_ENA */ | ||
| 115 | #define WM8904_GPIO_BCLK_SEL_MASK 0x000F /* GPIO_BCLK_SEL - [3:0] */ | ||
| 116 | #define WM8904_GPIO_BCLK_SEL_SHIFT 0 /* GPIO_BCLK_SEL - [3:0] */ | ||
| 117 | #define WM8904_GPIO_BCLK_SEL_WIDTH 4 /* GPIO_BCLK_SEL - [3:0] */ | ||
| 118 | |||
| 119 | #define WM8904_MIC_REGS 2 | ||
| 120 | #define WM8904_GPIO_REGS 4 | ||
| 121 | #define WM8904_DRC_REGS 4 | ||
| 122 | #define WM8904_EQ_REGS 25 | ||
| 20 | 123 | ||
| 21 | /** | 124 | /** |
| 22 | * DRC configurations are specified with a label and a set of register | 125 | * DRC configurations are specified with a label and a set of register |
| @@ -52,6 +155,9 @@ struct wm8904_pdata { | |||
| 52 | 155 | ||
| 53 | int num_retune_mobile_cfgs; | 156 | int num_retune_mobile_cfgs; |
| 54 | struct wm8904_retune_mobile_cfg *retune_mobile_cfgs; | 157 | struct wm8904_retune_mobile_cfg *retune_mobile_cfgs; |
| 158 | |||
| 159 | u32 gpio_cfg[WM8904_GPIO_REGS]; | ||
| 160 | u32 mic_cfg[WM8904_MIC_REGS]; | ||
| 55 | }; | 161 | }; |
| 56 | 162 | ||
| 57 | #endif | 163 | #endif |
diff --git a/include/sound/wm8960.h b/include/sound/wm8960.h new file mode 100644 index 000000000000..74e9a95529c5 --- /dev/null +++ b/include/sound/wm8960.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* | ||
| 2 | * wm8960.h -- WM8960 Soc Audio driver platform data | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _WM8960_PDATA_H | ||
| 10 | #define _WM8960_PDATA_H | ||
| 11 | |||
| 12 | #define WM8960_DRES_400R 0 | ||
| 13 | #define WM8960_DRES_200R 1 | ||
| 14 | #define WM8960_DRES_600R 2 | ||
| 15 | #define WM8960_DRES_150R 3 | ||
| 16 | #define WM8960_DRES_MAX 3 | ||
| 17 | |||
| 18 | struct wm8960_data { | ||
| 19 | bool capless; /* Headphone outputs configured in capless mode */ | ||
| 20 | |||
| 21 | int dres; /* Discharge resistance for headphone outputs */ | ||
| 22 | }; | ||
| 23 | |||
| 24 | #endif | ||
diff --git a/include/sound/wm9090.h b/include/sound/wm9090.h new file mode 100644 index 000000000000..3718928cde1a --- /dev/null +++ b/include/sound/wm9090.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/wm9090.h -- Platform data for WM9090 | ||
| 3 | * | ||
| 4 | * Copyright 2009, 2010 Wolfson Microelectronics. PLC. | ||
| 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_WM9090_H | ||
| 12 | #define __LINUX_SND_WM9090_H | ||
| 13 | |||
| 14 | struct wm9090_platform_data { | ||
| 15 | /* Line inputs 1 & 2 can optionally be differential */ | ||
| 16 | unsigned int lin1_diff:1; | ||
| 17 | unsigned int lin2_diff:1; | ||
| 18 | |||
| 19 | /* AGC configuration. This is intended to protect the speaker | ||
| 20 | * against overdriving and will therefore depend on the | ||
| 21 | * hardware setup with incorrect runtime configuration | ||
| 22 | * potentially causing hardware damage. | ||
| 23 | */ | ||
| 24 | unsigned int agc_ena:1; | ||
| 25 | u16 agc[3]; | ||
| 26 | }; | ||
| 27 | |||
| 28 | #endif | ||
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h index 5acfb1eb4df9..1dfab5401511 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h | |||
| @@ -65,6 +65,10 @@ | |||
| 65 | 65 | ||
| 66 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 66 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 67 | 67 | ||
| 68 | /* Make all open coded DECLARE_TRACE nops */ | ||
| 69 | #undef DECLARE_TRACE | ||
| 70 | #define DECLARE_TRACE(name, proto, args) | ||
| 71 | |||
| 68 | #ifdef CONFIG_EVENT_TRACING | 72 | #ifdef CONFIG_EVENT_TRACING |
| 69 | #include <trace/ftrace.h> | 73 | #include <trace/ftrace.h> |
| 70 | #endif | 74 | #endif |
| @@ -75,6 +79,7 @@ | |||
| 75 | #undef DEFINE_EVENT | 79 | #undef DEFINE_EVENT |
| 76 | #undef DEFINE_EVENT_PRINT | 80 | #undef DEFINE_EVENT_PRINT |
| 77 | #undef TRACE_HEADER_MULTI_READ | 81 | #undef TRACE_HEADER_MULTI_READ |
| 82 | #undef DECLARE_TRACE | ||
| 78 | 83 | ||
| 79 | /* Only undef what we defined in this file */ | 84 | /* Only undef what we defined in this file */ |
| 80 | #ifdef UNDEF_TRACE_INCLUDE_FILE | 85 | #ifdef UNDEF_TRACE_INCLUDE_FILE |
diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 5fb72733331e..d870a918559c 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h | |||
| @@ -40,6 +40,16 @@ DECLARE_EVENT_CLASS(block_rq_with_error, | |||
| 40 | __entry->nr_sector, __entry->errors) | 40 | __entry->nr_sector, __entry->errors) |
| 41 | ); | 41 | ); |
| 42 | 42 | ||
| 43 | /** | ||
| 44 | * block_rq_abort - abort block operation request | ||
| 45 | * @q: queue containing the block operation request | ||
| 46 | * @rq: block IO operation request | ||
| 47 | * | ||
| 48 | * Called immediately after pending block IO operation request @rq in | ||
| 49 | * queue @q is aborted. The fields in the operation request @rq | ||
| 50 | * can be examined to determine which device and sectors the pending | ||
| 51 | * operation would access. | ||
| 52 | */ | ||
| 43 | DEFINE_EVENT(block_rq_with_error, block_rq_abort, | 53 | DEFINE_EVENT(block_rq_with_error, block_rq_abort, |
| 44 | 54 | ||
| 45 | TP_PROTO(struct request_queue *q, struct request *rq), | 55 | TP_PROTO(struct request_queue *q, struct request *rq), |
| @@ -47,6 +57,15 @@ DEFINE_EVENT(block_rq_with_error, block_rq_abort, | |||
| 47 | TP_ARGS(q, rq) | 57 | TP_ARGS(q, rq) |
| 48 | ); | 58 | ); |
| 49 | 59 | ||
| 60 | /** | ||
| 61 | * block_rq_requeue - place block IO request back on a queue | ||
| 62 | * @q: queue holding operation | ||
| 63 | * @rq: block IO operation request | ||
| 64 | * | ||
| 65 | * The block operation request @rq is being placed back into queue | ||
| 66 | * @q. For some reason the request was not completed and needs to be | ||
| 67 | * put back in the queue. | ||
| 68 | */ | ||
| 50 | DEFINE_EVENT(block_rq_with_error, block_rq_requeue, | 69 | DEFINE_EVENT(block_rq_with_error, block_rq_requeue, |
| 51 | 70 | ||
| 52 | TP_PROTO(struct request_queue *q, struct request *rq), | 71 | TP_PROTO(struct request_queue *q, struct request *rq), |
| @@ -54,6 +73,17 @@ DEFINE_EVENT(block_rq_with_error, block_rq_requeue, | |||
| 54 | TP_ARGS(q, rq) | 73 | TP_ARGS(q, rq) |
| 55 | ); | 74 | ); |
| 56 | 75 | ||
| 76 | /** | ||
| 77 | * block_rq_complete - block IO operation completed by device driver | ||
| 78 | * @q: queue containing the block operation request | ||
| 79 | * @rq: block operations request | ||
| 80 | * | ||
| 81 | * The block_rq_complete tracepoint event indicates that some portion | ||
| 82 | * of operation request has been completed by the device driver. If | ||
| 83 | * the @rq->bio is %NULL, then there is absolutely no additional work to | ||
| 84 | * do for the request. If @rq->bio is non-NULL then there is | ||
| 85 | * additional work required to complete the request. | ||
| 86 | */ | ||
| 57 | DEFINE_EVENT(block_rq_with_error, block_rq_complete, | 87 | DEFINE_EVENT(block_rq_with_error, block_rq_complete, |
| 58 | 88 | ||
| 59 | TP_PROTO(struct request_queue *q, struct request *rq), | 89 | TP_PROTO(struct request_queue *q, struct request *rq), |
| @@ -95,6 +125,16 @@ DECLARE_EVENT_CLASS(block_rq, | |||
| 95 | __entry->nr_sector, __entry->comm) | 125 | __entry->nr_sector, __entry->comm) |
| 96 | ); | 126 | ); |
| 97 | 127 | ||
| 128 | /** | ||
| 129 | * block_rq_insert - insert block operation request into queue | ||
| 130 | * @q: target queue | ||
| 131 | * @rq: block IO operation request | ||
| 132 | * | ||
| 133 | * Called immediately before block operation request @rq is inserted | ||
| 134 | * into queue @q. The fields in the operation request @rq struct can | ||
| 135 | * be examined to determine which device and sectors the pending | ||
| 136 | * operation would access. | ||
| 137 | */ | ||
| 98 | DEFINE_EVENT(block_rq, block_rq_insert, | 138 | DEFINE_EVENT(block_rq, block_rq_insert, |
| 99 | 139 | ||
| 100 | TP_PROTO(struct request_queue *q, struct request *rq), | 140 | TP_PROTO(struct request_queue *q, struct request *rq), |
| @@ -102,6 +142,14 @@ DEFINE_EVENT(block_rq, block_rq_insert, | |||
| 102 | TP_ARGS(q, rq) | 142 | TP_ARGS(q, rq) |
| 103 | ); | 143 | ); |
| 104 | 144 | ||
| 145 | /** | ||
| 146 | * block_rq_issue - issue pending block IO request operation to device driver | ||
| 147 | * @q: queue holding operation | ||
| 148 | * @rq: block IO operation operation request | ||
| 149 | * | ||
| 150 | * Called when block operation request @rq from queue @q is sent to a | ||
| 151 | * device driver for processing. | ||
| 152 | */ | ||
| 105 | DEFINE_EVENT(block_rq, block_rq_issue, | 153 | DEFINE_EVENT(block_rq, block_rq_issue, |
| 106 | 154 | ||
| 107 | TP_PROTO(struct request_queue *q, struct request *rq), | 155 | TP_PROTO(struct request_queue *q, struct request *rq), |
| @@ -109,6 +157,17 @@ DEFINE_EVENT(block_rq, block_rq_issue, | |||
| 109 | TP_ARGS(q, rq) | 157 | TP_ARGS(q, rq) |
| 110 | ); | 158 | ); |
| 111 | 159 | ||
| 160 | /** | ||
| 161 | * block_bio_bounce - used bounce buffer when processing block operation | ||
| 162 | * @q: queue holding the block operation | ||
| 163 | * @bio: block operation | ||
| 164 | * | ||
| 165 | * A bounce buffer was used to handle the block operation @bio in @q. | ||
| 166 | * This occurs when hardware limitations prevent a direct transfer of | ||
| 167 | * data between the @bio data memory area and the IO device. Use of a | ||
| 168 | * bounce buffer requires extra copying of data and decreases | ||
| 169 | * performance. | ||
| 170 | */ | ||
| 112 | TRACE_EVENT(block_bio_bounce, | 171 | TRACE_EVENT(block_bio_bounce, |
| 113 | 172 | ||
| 114 | TP_PROTO(struct request_queue *q, struct bio *bio), | 173 | TP_PROTO(struct request_queue *q, struct bio *bio), |
| @@ -138,6 +197,14 @@ TRACE_EVENT(block_bio_bounce, | |||
| 138 | __entry->nr_sector, __entry->comm) | 197 | __entry->nr_sector, __entry->comm) |
| 139 | ); | 198 | ); |
| 140 | 199 | ||
| 200 | /** | ||
| 201 | * block_bio_complete - completed all work on the block operation | ||
| 202 | * @q: queue holding the block operation | ||
| 203 | * @bio: block operation completed | ||
| 204 | * | ||
| 205 | * This tracepoint indicates there is no further work to do on this | ||
| 206 | * block IO operation @bio. | ||
| 207 | */ | ||
| 141 | TRACE_EVENT(block_bio_complete, | 208 | TRACE_EVENT(block_bio_complete, |
| 142 | 209 | ||
| 143 | TP_PROTO(struct request_queue *q, struct bio *bio), | 210 | TP_PROTO(struct request_queue *q, struct bio *bio), |
| @@ -193,6 +260,14 @@ DECLARE_EVENT_CLASS(block_bio, | |||
| 193 | __entry->nr_sector, __entry->comm) | 260 | __entry->nr_sector, __entry->comm) |
| 194 | ); | 261 | ); |
| 195 | 262 | ||
| 263 | /** | ||
| 264 | * block_bio_backmerge - merging block operation to the end of an existing operation | ||
| 265 | * @q: queue holding operation | ||
| 266 | * @bio: new block operation to merge | ||
| 267 | * | ||
| 268 | * Merging block request @bio to the end of an existing block request | ||
| 269 | * in queue @q. | ||
| 270 | */ | ||
| 196 | DEFINE_EVENT(block_bio, block_bio_backmerge, | 271 | DEFINE_EVENT(block_bio, block_bio_backmerge, |
| 197 | 272 | ||
| 198 | TP_PROTO(struct request_queue *q, struct bio *bio), | 273 | TP_PROTO(struct request_queue *q, struct bio *bio), |
| @@ -200,6 +275,14 @@ DEFINE_EVENT(block_bio, block_bio_backmerge, | |||
| 200 | TP_ARGS(q, bio) | 275 | TP_ARGS(q, bio) |
| 201 | ); | 276 | ); |
| 202 | 277 | ||
| 278 | /** | ||
| 279 | * block_bio_frontmerge - merging block operation to the beginning of an existing operation | ||
| 280 | * @q: queue holding operation | ||
| 281 | * @bio: new block operation to merge | ||
| 282 | * | ||
| 283 | * Merging block IO operation @bio to the beginning of an existing block | ||
| 284 | * operation in queue @q. | ||
| 285 | */ | ||
| 203 | DEFINE_EVENT(block_bio, block_bio_frontmerge, | 286 | DEFINE_EVENT(block_bio, block_bio_frontmerge, |
| 204 | 287 | ||
| 205 | TP_PROTO(struct request_queue *q, struct bio *bio), | 288 | TP_PROTO(struct request_queue *q, struct bio *bio), |
| @@ -207,6 +290,13 @@ DEFINE_EVENT(block_bio, block_bio_frontmerge, | |||
| 207 | TP_ARGS(q, bio) | 290 | TP_ARGS(q, bio) |
| 208 | ); | 291 | ); |
| 209 | 292 | ||
| 293 | /** | ||
| 294 | * block_bio_queue - putting new block IO operation in queue | ||
| 295 | * @q: queue holding operation | ||
| 296 | * @bio: new block operation | ||
| 297 | * | ||
| 298 | * About to place the block IO operation @bio into queue @q. | ||
| 299 | */ | ||
| 210 | DEFINE_EVENT(block_bio, block_bio_queue, | 300 | DEFINE_EVENT(block_bio, block_bio_queue, |
| 211 | 301 | ||
| 212 | TP_PROTO(struct request_queue *q, struct bio *bio), | 302 | TP_PROTO(struct request_queue *q, struct bio *bio), |
| @@ -243,6 +333,15 @@ DECLARE_EVENT_CLASS(block_get_rq, | |||
| 243 | __entry->nr_sector, __entry->comm) | 333 | __entry->nr_sector, __entry->comm) |
| 244 | ); | 334 | ); |
| 245 | 335 | ||
| 336 | /** | ||
| 337 | * block_getrq - get a free request entry in queue for block IO operations | ||
| 338 | * @q: queue for operations | ||
| 339 | * @bio: pending block IO operation | ||
| 340 | * @rw: low bit indicates a read (%0) or a write (%1) | ||
| 341 | * | ||
| 342 | * A request struct for queue @q has been allocated to handle the | ||
| 343 | * block IO operation @bio. | ||
| 344 | */ | ||
| 246 | DEFINE_EVENT(block_get_rq, block_getrq, | 345 | DEFINE_EVENT(block_get_rq, block_getrq, |
| 247 | 346 | ||
| 248 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), | 347 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), |
| @@ -250,6 +349,17 @@ DEFINE_EVENT(block_get_rq, block_getrq, | |||
| 250 | TP_ARGS(q, bio, rw) | 349 | TP_ARGS(q, bio, rw) |
| 251 | ); | 350 | ); |
| 252 | 351 | ||
| 352 | /** | ||
| 353 | * block_sleeprq - waiting to get a free request entry in queue for block IO operation | ||
| 354 | * @q: queue for operation | ||
| 355 | * @bio: pending block IO operation | ||
| 356 | * @rw: low bit indicates a read (%0) or a write (%1) | ||
| 357 | * | ||
| 358 | * In the case where a request struct cannot be provided for queue @q | ||
| 359 | * the process needs to wait for an request struct to become | ||
| 360 | * available. This tracepoint event is generated each time the | ||
| 361 | * process goes to sleep waiting for request struct become available. | ||
| 362 | */ | ||
| 253 | DEFINE_EVENT(block_get_rq, block_sleeprq, | 363 | DEFINE_EVENT(block_get_rq, block_sleeprq, |
| 254 | 364 | ||
| 255 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), | 365 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), |
| @@ -257,6 +367,14 @@ DEFINE_EVENT(block_get_rq, block_sleeprq, | |||
| 257 | TP_ARGS(q, bio, rw) | 367 | TP_ARGS(q, bio, rw) |
| 258 | ); | 368 | ); |
| 259 | 369 | ||
| 370 | /** | ||
| 371 | * block_plug - keep operations requests in request queue | ||
| 372 | * @q: request queue to plug | ||
| 373 | * | ||
| 374 | * Plug the request queue @q. Do not allow block operation requests | ||
| 375 | * to be sent to the device driver. Instead, accumulate requests in | ||
| 376 | * the queue to improve throughput performance of the block device. | ||
| 377 | */ | ||
| 260 | TRACE_EVENT(block_plug, | 378 | TRACE_EVENT(block_plug, |
| 261 | 379 | ||
| 262 | TP_PROTO(struct request_queue *q), | 380 | TP_PROTO(struct request_queue *q), |
| @@ -293,6 +411,13 @@ DECLARE_EVENT_CLASS(block_unplug, | |||
| 293 | TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) | 411 | TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) |
| 294 | ); | 412 | ); |
| 295 | 413 | ||
| 414 | /** | ||
| 415 | * block_unplug_timer - timed release of operations requests in queue to device driver | ||
| 416 | * @q: request queue to unplug | ||
| 417 | * | ||
| 418 | * Unplug the request queue @q because a timer expired and allow block | ||
| 419 | * operation requests to be sent to the device driver. | ||
| 420 | */ | ||
| 296 | DEFINE_EVENT(block_unplug, block_unplug_timer, | 421 | DEFINE_EVENT(block_unplug, block_unplug_timer, |
| 297 | 422 | ||
| 298 | TP_PROTO(struct request_queue *q), | 423 | TP_PROTO(struct request_queue *q), |
| @@ -300,6 +425,13 @@ DEFINE_EVENT(block_unplug, block_unplug_timer, | |||
| 300 | TP_ARGS(q) | 425 | TP_ARGS(q) |
| 301 | ); | 426 | ); |
| 302 | 427 | ||
| 428 | /** | ||
| 429 | * block_unplug_io - release of operations requests in request queue | ||
| 430 | * @q: request queue to unplug | ||
| 431 | * | ||
| 432 | * Unplug request queue @q because device driver is scheduled to work | ||
| 433 | * on elements in the request queue. | ||
| 434 | */ | ||
| 303 | DEFINE_EVENT(block_unplug, block_unplug_io, | 435 | DEFINE_EVENT(block_unplug, block_unplug_io, |
| 304 | 436 | ||
| 305 | TP_PROTO(struct request_queue *q), | 437 | TP_PROTO(struct request_queue *q), |
| @@ -307,6 +439,17 @@ DEFINE_EVENT(block_unplug, block_unplug_io, | |||
| 307 | TP_ARGS(q) | 439 | TP_ARGS(q) |
| 308 | ); | 440 | ); |
| 309 | 441 | ||
| 442 | /** | ||
| 443 | * block_split - split a single bio struct into two bio structs | ||
| 444 | * @q: queue containing the bio | ||
| 445 | * @bio: block operation being split | ||
| 446 | * @new_sector: The starting sector for the new bio | ||
| 447 | * | ||
| 448 | * The bio request @bio in request queue @q needs to be split into two | ||
| 449 | * bio requests. The newly created @bio request starts at | ||
| 450 | * @new_sector. This split may be required due to hardware limitation | ||
| 451 | * such as operation crossing device boundaries in a RAID system. | ||
| 452 | */ | ||
| 310 | TRACE_EVENT(block_split, | 453 | TRACE_EVENT(block_split, |
| 311 | 454 | ||
| 312 | TP_PROTO(struct request_queue *q, struct bio *bio, | 455 | TP_PROTO(struct request_queue *q, struct bio *bio, |
| @@ -337,6 +480,16 @@ TRACE_EVENT(block_split, | |||
| 337 | __entry->comm) | 480 | __entry->comm) |
| 338 | ); | 481 | ); |
| 339 | 482 | ||
| 483 | /** | ||
| 484 | * block_remap - map request for a partition to the raw device | ||
| 485 | * @q: queue holding the operation | ||
| 486 | * @bio: revised operation | ||
| 487 | * @dev: device for the operation | ||
| 488 | * @from: original sector for the operation | ||
| 489 | * | ||
| 490 | * An operation for a partition on a block device has been mapped to the | ||
| 491 | * raw block device. | ||
| 492 | */ | ||
| 340 | TRACE_EVENT(block_remap, | 493 | TRACE_EVENT(block_remap, |
| 341 | 494 | ||
| 342 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, | 495 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, |
| @@ -370,6 +523,17 @@ TRACE_EVENT(block_remap, | |||
| 370 | (unsigned long long)__entry->old_sector) | 523 | (unsigned long long)__entry->old_sector) |
| 371 | ); | 524 | ); |
| 372 | 525 | ||
| 526 | /** | ||
| 527 | * block_rq_remap - map request for a block operation request | ||
| 528 | * @q: queue holding the operation | ||
| 529 | * @rq: block IO operation request | ||
| 530 | * @dev: device for the operation | ||
| 531 | * @from: original sector for the operation | ||
| 532 | * | ||
| 533 | * The block operation request @rq in @q has been remapped. The block | ||
| 534 | * operation request @rq holds the current information and @from hold | ||
| 535 | * the original sector. | ||
| 536 | */ | ||
| 373 | TRACE_EVENT(block_rq_remap, | 537 | TRACE_EVENT(block_rq_remap, |
| 374 | 538 | ||
| 375 | TP_PROTO(struct request_queue *q, struct request *rq, dev_t dev, | 539 | TP_PROTO(struct request_queue *q, struct request *rq, dev_t dev, |
diff --git a/include/trace/events/lock.h b/include/trace/events/lock.h index 5c1dcfc16c60..2821b86de63b 100644 --- a/include/trace/events/lock.h +++ b/include/trace/events/lock.h | |||
| @@ -35,15 +35,15 @@ TRACE_EVENT(lock_acquire, | |||
| 35 | __get_str(name)) | 35 | __get_str(name)) |
| 36 | ); | 36 | ); |
| 37 | 37 | ||
| 38 | TRACE_EVENT(lock_release, | 38 | DECLARE_EVENT_CLASS(lock, |
| 39 | 39 | ||
| 40 | TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip), | 40 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), |
| 41 | 41 | ||
| 42 | TP_ARGS(lock, nested, ip), | 42 | TP_ARGS(lock, ip), |
| 43 | 43 | ||
| 44 | TP_STRUCT__entry( | 44 | TP_STRUCT__entry( |
| 45 | __string(name, lock->name) | 45 | __string( name, lock->name ) |
| 46 | __field(void *, lockdep_addr) | 46 | __field( void *, lockdep_addr ) |
| 47 | ), | 47 | ), |
| 48 | 48 | ||
| 49 | TP_fast_assign( | 49 | TP_fast_assign( |
| @@ -51,51 +51,30 @@ TRACE_EVENT(lock_release, | |||
| 51 | __entry->lockdep_addr = lock; | 51 | __entry->lockdep_addr = lock; |
| 52 | ), | 52 | ), |
| 53 | 53 | ||
| 54 | TP_printk("%p %s", | 54 | TP_printk("%p %s", __entry->lockdep_addr, __get_str(name)) |
| 55 | __entry->lockdep_addr, __get_str(name)) | ||
| 56 | ); | 55 | ); |
| 57 | 56 | ||
| 58 | #ifdef CONFIG_LOCK_STAT | 57 | DEFINE_EVENT(lock, lock_release, |
| 59 | |||
| 60 | TRACE_EVENT(lock_contended, | ||
| 61 | 58 | ||
| 62 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), | 59 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), |
| 63 | 60 | ||
| 64 | TP_ARGS(lock, ip), | 61 | TP_ARGS(lock, ip) |
| 62 | ); | ||
| 65 | 63 | ||
| 66 | TP_STRUCT__entry( | 64 | #ifdef CONFIG_LOCK_STAT |
| 67 | __string(name, lock->name) | ||
| 68 | __field(void *, lockdep_addr) | ||
| 69 | ), | ||
| 70 | 65 | ||
| 71 | TP_fast_assign( | 66 | DEFINE_EVENT(lock, lock_contended, |
| 72 | __assign_str(name, lock->name); | ||
| 73 | __entry->lockdep_addr = lock; | ||
| 74 | ), | ||
| 75 | 67 | ||
| 76 | TP_printk("%p %s", | 68 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), |
| 77 | __entry->lockdep_addr, __get_str(name)) | ||
| 78 | ); | ||
| 79 | 69 | ||
| 80 | TRACE_EVENT(lock_acquired, | 70 | TP_ARGS(lock, ip) |
| 81 | TP_PROTO(struct lockdep_map *lock, unsigned long ip, s64 waittime), | 71 | ); |
| 82 | 72 | ||
| 83 | TP_ARGS(lock, ip, waittime), | 73 | DEFINE_EVENT(lock, lock_acquired, |
| 84 | 74 | ||
| 85 | TP_STRUCT__entry( | 75 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), |
| 86 | __string(name, lock->name) | ||
| 87 | __field(s64, wait_nsec) | ||
| 88 | __field(void *, lockdep_addr) | ||
| 89 | ), | ||
| 90 | 76 | ||
| 91 | TP_fast_assign( | 77 | TP_ARGS(lock, ip) |
| 92 | __assign_str(name, lock->name); | ||
| 93 | __entry->wait_nsec = waittime; | ||
| 94 | __entry->lockdep_addr = lock; | ||
| 95 | ), | ||
| 96 | TP_printk("%p %s (%llu ns)", __entry->lockdep_addr, | ||
| 97 | __get_str(name), | ||
| 98 | __entry->wait_nsec) | ||
| 99 | ); | 78 | ); |
| 100 | 79 | ||
| 101 | #endif | 80 | #endif |
diff --git a/include/trace/events/module.h b/include/trace/events/module.h index 4b0f48ba16a6..c7bb2f0482fe 100644 --- a/include/trace/events/module.h +++ b/include/trace/events/module.h | |||
| @@ -51,11 +51,14 @@ TRACE_EVENT(module_free, | |||
| 51 | TP_printk("%s", __get_str(name)) | 51 | TP_printk("%s", __get_str(name)) |
| 52 | ); | 52 | ); |
| 53 | 53 | ||
| 54 | #ifdef CONFIG_MODULE_UNLOAD | ||
| 55 | /* trace_module_get/put are only used if CONFIG_MODULE_UNLOAD is defined */ | ||
| 56 | |||
| 54 | DECLARE_EVENT_CLASS(module_refcnt, | 57 | DECLARE_EVENT_CLASS(module_refcnt, |
| 55 | 58 | ||
| 56 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 59 | TP_PROTO(struct module *mod, unsigned long ip), |
| 57 | 60 | ||
| 58 | TP_ARGS(mod, ip, refcnt), | 61 | TP_ARGS(mod, ip), |
| 59 | 62 | ||
| 60 | TP_STRUCT__entry( | 63 | TP_STRUCT__entry( |
| 61 | __field( unsigned long, ip ) | 64 | __field( unsigned long, ip ) |
| @@ -65,7 +68,7 @@ DECLARE_EVENT_CLASS(module_refcnt, | |||
| 65 | 68 | ||
| 66 | TP_fast_assign( | 69 | TP_fast_assign( |
| 67 | __entry->ip = ip; | 70 | __entry->ip = ip; |
| 68 | __entry->refcnt = refcnt; | 71 | __entry->refcnt = __this_cpu_read(mod->refptr->incs) + __this_cpu_read(mod->refptr->decs); |
| 69 | __assign_str(name, mod->name); | 72 | __assign_str(name, mod->name); |
| 70 | ), | 73 | ), |
| 71 | 74 | ||
| @@ -75,17 +78,18 @@ DECLARE_EVENT_CLASS(module_refcnt, | |||
| 75 | 78 | ||
| 76 | DEFINE_EVENT(module_refcnt, module_get, | 79 | DEFINE_EVENT(module_refcnt, module_get, |
| 77 | 80 | ||
| 78 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 81 | TP_PROTO(struct module *mod, unsigned long ip), |
| 79 | 82 | ||
| 80 | TP_ARGS(mod, ip, refcnt) | 83 | TP_ARGS(mod, ip) |
| 81 | ); | 84 | ); |
| 82 | 85 | ||
| 83 | DEFINE_EVENT(module_refcnt, module_put, | 86 | DEFINE_EVENT(module_refcnt, module_put, |
| 84 | 87 | ||
| 85 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 88 | TP_PROTO(struct module *mod, unsigned long ip), |
| 86 | 89 | ||
| 87 | TP_ARGS(mod, ip, refcnt) | 90 | TP_ARGS(mod, ip) |
| 88 | ); | 91 | ); |
| 92 | #endif /* CONFIG_MODULE_UNLOAD */ | ||
| 89 | 93 | ||
| 90 | TRACE_EVENT(module_request, | 94 | TRACE_EVENT(module_request, |
| 91 | 95 | ||
diff --git a/include/trace/events/napi.h b/include/trace/events/napi.h index a8989c4547e7..188deca2f3c7 100644 --- a/include/trace/events/napi.h +++ b/include/trace/events/napi.h | |||
| @@ -1,4 +1,7 @@ | |||
| 1 | #ifndef _TRACE_NAPI_H_ | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM napi | ||
| 3 | |||
| 4 | #if !defined(_TRACE_NAPI_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 2 | #define _TRACE_NAPI_H_ | 5 | #define _TRACE_NAPI_H_ |
| 3 | 6 | ||
| 4 | #include <linux/netdevice.h> | 7 | #include <linux/netdevice.h> |
| @@ -8,4 +11,7 @@ DECLARE_TRACE(napi_poll, | |||
| 8 | TP_PROTO(struct napi_struct *napi), | 11 | TP_PROTO(struct napi_struct *napi), |
| 9 | TP_ARGS(napi)); | 12 | TP_ARGS(napi)); |
| 10 | 13 | ||
| 11 | #endif | 14 | #endif /* _TRACE_NAPI_H_ */ |
| 15 | |||
| 16 | /* This part must be outside protection */ | ||
| 17 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index cfceb0b73e20..4f733ecea46e 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
| @@ -51,15 +51,12 @@ TRACE_EVENT(sched_kthread_stop_ret, | |||
| 51 | 51 | ||
| 52 | /* | 52 | /* |
| 53 | * Tracepoint for waiting on task to unschedule: | 53 | * Tracepoint for waiting on task to unschedule: |
| 54 | * | ||
| 55 | * (NOTE: the 'rq' argument is not used by generic trace events, | ||
| 56 | * but used by the latency tracer plugin. ) | ||
| 57 | */ | 54 | */ |
| 58 | TRACE_EVENT(sched_wait_task, | 55 | TRACE_EVENT(sched_wait_task, |
| 59 | 56 | ||
| 60 | TP_PROTO(struct rq *rq, struct task_struct *p), | 57 | TP_PROTO(struct task_struct *p), |
| 61 | 58 | ||
| 62 | TP_ARGS(rq, p), | 59 | TP_ARGS(p), |
| 63 | 60 | ||
| 64 | TP_STRUCT__entry( | 61 | TP_STRUCT__entry( |
| 65 | __array( char, comm, TASK_COMM_LEN ) | 62 | __array( char, comm, TASK_COMM_LEN ) |
| @@ -79,15 +76,12 @@ TRACE_EVENT(sched_wait_task, | |||
| 79 | 76 | ||
| 80 | /* | 77 | /* |
| 81 | * Tracepoint for waking up a task: | 78 | * Tracepoint for waking up a task: |
| 82 | * | ||
| 83 | * (NOTE: the 'rq' argument is not used by generic trace events, | ||
| 84 | * but used by the latency tracer plugin. ) | ||
| 85 | */ | 79 | */ |
| 86 | DECLARE_EVENT_CLASS(sched_wakeup_template, | 80 | DECLARE_EVENT_CLASS(sched_wakeup_template, |
| 87 | 81 | ||
| 88 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | 82 | TP_PROTO(struct task_struct *p, int success), |
| 89 | 83 | ||
| 90 | TP_ARGS(rq, p, success), | 84 | TP_ARGS(p, success), |
| 91 | 85 | ||
| 92 | TP_STRUCT__entry( | 86 | TP_STRUCT__entry( |
| 93 | __array( char, comm, TASK_COMM_LEN ) | 87 | __array( char, comm, TASK_COMM_LEN ) |
| @@ -111,31 +105,25 @@ DECLARE_EVENT_CLASS(sched_wakeup_template, | |||
| 111 | ); | 105 | ); |
| 112 | 106 | ||
| 113 | DEFINE_EVENT(sched_wakeup_template, sched_wakeup, | 107 | DEFINE_EVENT(sched_wakeup_template, sched_wakeup, |
| 114 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | 108 | TP_PROTO(struct task_struct *p, int success), |
| 115 | TP_ARGS(rq, p, success)); | 109 | TP_ARGS(p, success)); |
| 116 | 110 | ||
| 117 | /* | 111 | /* |
| 118 | * Tracepoint for waking up a new task: | 112 | * Tracepoint for waking up a new task: |
| 119 | * | ||
| 120 | * (NOTE: the 'rq' argument is not used by generic trace events, | ||
| 121 | * but used by the latency tracer plugin. ) | ||
| 122 | */ | 113 | */ |
| 123 | DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new, | 114 | DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new, |
| 124 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | 115 | TP_PROTO(struct task_struct *p, int success), |
| 125 | TP_ARGS(rq, p, success)); | 116 | TP_ARGS(p, success)); |
| 126 | 117 | ||
| 127 | /* | 118 | /* |
| 128 | * Tracepoint for task switches, performed by the scheduler: | 119 | * Tracepoint for task switches, performed by the scheduler: |
| 129 | * | ||
| 130 | * (NOTE: the 'rq' argument is not used by generic trace events, | ||
| 131 | * but used by the latency tracer plugin. ) | ||
| 132 | */ | 120 | */ |
| 133 | TRACE_EVENT(sched_switch, | 121 | TRACE_EVENT(sched_switch, |
| 134 | 122 | ||
| 135 | TP_PROTO(struct rq *rq, struct task_struct *prev, | 123 | TP_PROTO(struct task_struct *prev, |
| 136 | struct task_struct *next), | 124 | struct task_struct *next), |
| 137 | 125 | ||
| 138 | TP_ARGS(rq, prev, next), | 126 | TP_ARGS(prev, next), |
| 139 | 127 | ||
| 140 | TP_STRUCT__entry( | 128 | TP_STRUCT__entry( |
| 141 | __array( char, prev_comm, TASK_COMM_LEN ) | 129 | __array( char, prev_comm, TASK_COMM_LEN ) |
diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h new file mode 100644 index 000000000000..25fbefdf2f2e --- /dev/null +++ b/include/trace/events/scsi.h | |||
| @@ -0,0 +1,345 @@ | |||
| 1 | #undef TRACE_SYSTEM | ||
| 2 | #define TRACE_SYSTEM scsi | ||
| 3 | |||
| 4 | #if !defined(_TRACE_SCSI_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 5 | #define _TRACE_SCSI_H | ||
| 6 | |||
| 7 | #include <scsi/scsi_cmnd.h> | ||
| 8 | #include <scsi/scsi_host.h> | ||
| 9 | #include <linux/tracepoint.h> | ||
| 10 | #include <linux/trace_seq.h> | ||
| 11 | |||
| 12 | #define scsi_opcode_name(opcode) { opcode, #opcode } | ||
| 13 | #define show_opcode_name(val) \ | ||
| 14 | __print_symbolic(val, \ | ||
| 15 | scsi_opcode_name(TEST_UNIT_READY), \ | ||
| 16 | scsi_opcode_name(REZERO_UNIT), \ | ||
| 17 | scsi_opcode_name(REQUEST_SENSE), \ | ||
| 18 | scsi_opcode_name(FORMAT_UNIT), \ | ||
| 19 | scsi_opcode_name(READ_BLOCK_LIMITS), \ | ||
| 20 | scsi_opcode_name(REASSIGN_BLOCKS), \ | ||
| 21 | scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \ | ||
| 22 | scsi_opcode_name(READ_6), \ | ||
| 23 | scsi_opcode_name(WRITE_6), \ | ||
| 24 | scsi_opcode_name(SEEK_6), \ | ||
| 25 | scsi_opcode_name(READ_REVERSE), \ | ||
| 26 | scsi_opcode_name(WRITE_FILEMARKS), \ | ||
| 27 | scsi_opcode_name(SPACE), \ | ||
| 28 | scsi_opcode_name(INQUIRY), \ | ||
| 29 | scsi_opcode_name(RECOVER_BUFFERED_DATA), \ | ||
| 30 | scsi_opcode_name(MODE_SELECT), \ | ||
| 31 | scsi_opcode_name(RESERVE), \ | ||
| 32 | scsi_opcode_name(RELEASE), \ | ||
| 33 | scsi_opcode_name(COPY), \ | ||
| 34 | scsi_opcode_name(ERASE), \ | ||
| 35 | scsi_opcode_name(MODE_SENSE), \ | ||
| 36 | scsi_opcode_name(START_STOP), \ | ||
| 37 | scsi_opcode_name(RECEIVE_DIAGNOSTIC), \ | ||
| 38 | scsi_opcode_name(SEND_DIAGNOSTIC), \ | ||
| 39 | scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \ | ||
| 40 | scsi_opcode_name(SET_WINDOW), \ | ||
| 41 | scsi_opcode_name(READ_CAPACITY), \ | ||
| 42 | scsi_opcode_name(READ_10), \ | ||
| 43 | scsi_opcode_name(WRITE_10), \ | ||
| 44 | scsi_opcode_name(SEEK_10), \ | ||
| 45 | scsi_opcode_name(POSITION_TO_ELEMENT), \ | ||
| 46 | scsi_opcode_name(WRITE_VERIFY), \ | ||
| 47 | scsi_opcode_name(VERIFY), \ | ||
| 48 | scsi_opcode_name(SEARCH_HIGH), \ | ||
| 49 | scsi_opcode_name(SEARCH_EQUAL), \ | ||
| 50 | scsi_opcode_name(SEARCH_LOW), \ | ||
| 51 | scsi_opcode_name(SET_LIMITS), \ | ||
| 52 | scsi_opcode_name(PRE_FETCH), \ | ||
| 53 | scsi_opcode_name(READ_POSITION), \ | ||
| 54 | scsi_opcode_name(SYNCHRONIZE_CACHE), \ | ||
| 55 | scsi_opcode_name(LOCK_UNLOCK_CACHE), \ | ||
| 56 | scsi_opcode_name(READ_DEFECT_DATA), \ | ||
| 57 | scsi_opcode_name(MEDIUM_SCAN), \ | ||
| 58 | scsi_opcode_name(COMPARE), \ | ||
| 59 | scsi_opcode_name(COPY_VERIFY), \ | ||
| 60 | scsi_opcode_name(WRITE_BUFFER), \ | ||
| 61 | scsi_opcode_name(READ_BUFFER), \ | ||
| 62 | scsi_opcode_name(UPDATE_BLOCK), \ | ||
| 63 | scsi_opcode_name(READ_LONG), \ | ||
| 64 | scsi_opcode_name(WRITE_LONG), \ | ||
| 65 | scsi_opcode_name(CHANGE_DEFINITION), \ | ||
| 66 | scsi_opcode_name(WRITE_SAME), \ | ||
| 67 | scsi_opcode_name(UNMAP), \ | ||
| 68 | scsi_opcode_name(READ_TOC), \ | ||
| 69 | scsi_opcode_name(LOG_SELECT), \ | ||
| 70 | scsi_opcode_name(LOG_SENSE), \ | ||
| 71 | scsi_opcode_name(XDWRITEREAD_10), \ | ||
| 72 | scsi_opcode_name(MODE_SELECT_10), \ | ||
| 73 | scsi_opcode_name(RESERVE_10), \ | ||
| 74 | scsi_opcode_name(RELEASE_10), \ | ||
| 75 | scsi_opcode_name(MODE_SENSE_10), \ | ||
| 76 | scsi_opcode_name(PERSISTENT_RESERVE_IN), \ | ||
| 77 | scsi_opcode_name(PERSISTENT_RESERVE_OUT), \ | ||
| 78 | scsi_opcode_name(VARIABLE_LENGTH_CMD), \ | ||
| 79 | scsi_opcode_name(REPORT_LUNS), \ | ||
| 80 | scsi_opcode_name(MAINTENANCE_IN), \ | ||
| 81 | scsi_opcode_name(MAINTENANCE_OUT), \ | ||
| 82 | scsi_opcode_name(MOVE_MEDIUM), \ | ||
| 83 | scsi_opcode_name(EXCHANGE_MEDIUM), \ | ||
| 84 | scsi_opcode_name(READ_12), \ | ||
| 85 | scsi_opcode_name(WRITE_12), \ | ||
| 86 | scsi_opcode_name(WRITE_VERIFY_12), \ | ||
| 87 | scsi_opcode_name(SEARCH_HIGH_12), \ | ||
| 88 | scsi_opcode_name(SEARCH_EQUAL_12), \ | ||
| 89 | scsi_opcode_name(SEARCH_LOW_12), \ | ||
| 90 | scsi_opcode_name(READ_ELEMENT_STATUS), \ | ||
| 91 | scsi_opcode_name(SEND_VOLUME_TAG), \ | ||
| 92 | scsi_opcode_name(WRITE_LONG_2), \ | ||
| 93 | scsi_opcode_name(READ_16), \ | ||
| 94 | scsi_opcode_name(WRITE_16), \ | ||
| 95 | scsi_opcode_name(VERIFY_16), \ | ||
| 96 | scsi_opcode_name(WRITE_SAME_16), \ | ||
| 97 | scsi_opcode_name(SERVICE_ACTION_IN), \ | ||
| 98 | scsi_opcode_name(SAI_READ_CAPACITY_16), \ | ||
| 99 | scsi_opcode_name(SAI_GET_LBA_STATUS), \ | ||
| 100 | scsi_opcode_name(MI_REPORT_TARGET_PGS), \ | ||
| 101 | scsi_opcode_name(MO_SET_TARGET_PGS), \ | ||
| 102 | scsi_opcode_name(READ_32), \ | ||
| 103 | scsi_opcode_name(WRITE_32), \ | ||
| 104 | scsi_opcode_name(WRITE_SAME_32), \ | ||
| 105 | scsi_opcode_name(ATA_16), \ | ||
| 106 | scsi_opcode_name(ATA_12)) | ||
| 107 | |||
| 108 | #define scsi_hostbyte_name(result) { result, #result } | ||
| 109 | #define show_hostbyte_name(val) \ | ||
| 110 | __print_symbolic(val, \ | ||
| 111 | scsi_hostbyte_name(DID_OK), \ | ||
| 112 | scsi_hostbyte_name(DID_NO_CONNECT), \ | ||
| 113 | scsi_hostbyte_name(DID_BUS_BUSY), \ | ||
| 114 | scsi_hostbyte_name(DID_TIME_OUT), \ | ||
| 115 | scsi_hostbyte_name(DID_BAD_TARGET), \ | ||
| 116 | scsi_hostbyte_name(DID_ABORT), \ | ||
| 117 | scsi_hostbyte_name(DID_PARITY), \ | ||
| 118 | scsi_hostbyte_name(DID_ERROR), \ | ||
| 119 | scsi_hostbyte_name(DID_RESET), \ | ||
| 120 | scsi_hostbyte_name(DID_BAD_INTR), \ | ||
| 121 | scsi_hostbyte_name(DID_PASSTHROUGH), \ | ||
| 122 | scsi_hostbyte_name(DID_SOFT_ERROR), \ | ||
| 123 | scsi_hostbyte_name(DID_IMM_RETRY), \ | ||
| 124 | scsi_hostbyte_name(DID_REQUEUE), \ | ||
| 125 | scsi_hostbyte_name(DID_TRANSPORT_DISRUPTED), \ | ||
| 126 | scsi_hostbyte_name(DID_TRANSPORT_FAILFAST)) | ||
| 127 | |||
| 128 | #define scsi_driverbyte_name(result) { result, #result } | ||
| 129 | #define show_driverbyte_name(val) \ | ||
| 130 | __print_symbolic(val, \ | ||
| 131 | scsi_driverbyte_name(DRIVER_OK), \ | ||
| 132 | scsi_driverbyte_name(DRIVER_BUSY), \ | ||
| 133 | scsi_driverbyte_name(DRIVER_SOFT), \ | ||
| 134 | scsi_driverbyte_name(DRIVER_MEDIA), \ | ||
| 135 | scsi_driverbyte_name(DRIVER_ERROR), \ | ||
| 136 | scsi_driverbyte_name(DRIVER_INVALID), \ | ||
| 137 | scsi_driverbyte_name(DRIVER_TIMEOUT), \ | ||
| 138 | scsi_driverbyte_name(DRIVER_HARD), \ | ||
| 139 | scsi_driverbyte_name(DRIVER_SENSE)) | ||
| 140 | |||
| 141 | #define scsi_msgbyte_name(result) { result, #result } | ||
| 142 | #define show_msgbyte_name(val) \ | ||
| 143 | __print_symbolic(val, \ | ||
| 144 | scsi_msgbyte_name(COMMAND_COMPLETE), \ | ||
| 145 | scsi_msgbyte_name(EXTENDED_MESSAGE), \ | ||
| 146 | scsi_msgbyte_name(SAVE_POINTERS), \ | ||
| 147 | scsi_msgbyte_name(RESTORE_POINTERS), \ | ||
| 148 | scsi_msgbyte_name(DISCONNECT), \ | ||
| 149 | scsi_msgbyte_name(INITIATOR_ERROR), \ | ||
| 150 | scsi_msgbyte_name(ABORT_TASK_SET), \ | ||
| 151 | scsi_msgbyte_name(MESSAGE_REJECT), \ | ||
| 152 | scsi_msgbyte_name(NOP), \ | ||
| 153 | scsi_msgbyte_name(MSG_PARITY_ERROR), \ | ||
| 154 | scsi_msgbyte_name(LINKED_CMD_COMPLETE), \ | ||
| 155 | scsi_msgbyte_name(LINKED_FLG_CMD_COMPLETE), \ | ||
| 156 | scsi_msgbyte_name(TARGET_RESET), \ | ||
| 157 | scsi_msgbyte_name(ABORT_TASK), \ | ||
| 158 | scsi_msgbyte_name(CLEAR_TASK_SET), \ | ||
| 159 | scsi_msgbyte_name(INITIATE_RECOVERY), \ | ||
| 160 | scsi_msgbyte_name(RELEASE_RECOVERY), \ | ||
| 161 | scsi_msgbyte_name(CLEAR_ACA), \ | ||
| 162 | scsi_msgbyte_name(LOGICAL_UNIT_RESET), \ | ||
| 163 | scsi_msgbyte_name(SIMPLE_QUEUE_TAG), \ | ||
| 164 | scsi_msgbyte_name(HEAD_OF_QUEUE_TAG), \ | ||
| 165 | scsi_msgbyte_name(ORDERED_QUEUE_TAG), \ | ||
| 166 | scsi_msgbyte_name(IGNORE_WIDE_RESIDUE), \ | ||
| 167 | scsi_msgbyte_name(ACA), \ | ||
| 168 | scsi_msgbyte_name(QAS_REQUEST), \ | ||
| 169 | scsi_msgbyte_name(BUS_DEVICE_RESET), \ | ||
| 170 | scsi_msgbyte_name(ABORT)) | ||
| 171 | |||
| 172 | #define scsi_statusbyte_name(result) { result, #result } | ||
| 173 | #define show_statusbyte_name(val) \ | ||
| 174 | __print_symbolic(val, \ | ||
| 175 | scsi_statusbyte_name(SAM_STAT_GOOD), \ | ||
| 176 | scsi_statusbyte_name(SAM_STAT_CHECK_CONDITION), \ | ||
| 177 | scsi_statusbyte_name(SAM_STAT_CONDITION_MET), \ | ||
| 178 | scsi_statusbyte_name(SAM_STAT_BUSY), \ | ||
| 179 | scsi_statusbyte_name(SAM_STAT_INTERMEDIATE), \ | ||
| 180 | scsi_statusbyte_name(SAM_STAT_INTERMEDIATE_CONDITION_MET), \ | ||
| 181 | scsi_statusbyte_name(SAM_STAT_RESERVATION_CONFLICT), \ | ||
| 182 | scsi_statusbyte_name(SAM_STAT_COMMAND_TERMINATED), \ | ||
| 183 | scsi_statusbyte_name(SAM_STAT_TASK_SET_FULL), \ | ||
| 184 | scsi_statusbyte_name(SAM_STAT_ACA_ACTIVE), \ | ||
| 185 | scsi_statusbyte_name(SAM_STAT_TASK_ABORTED)) | ||
| 186 | |||
| 187 | const char *scsi_trace_parse_cdb(struct trace_seq*, unsigned char*, int); | ||
| 188 | #define __parse_cdb(cdb, len) scsi_trace_parse_cdb(p, cdb, len) | ||
| 189 | |||
| 190 | TRACE_EVENT(scsi_dispatch_cmd_start, | ||
| 191 | |||
| 192 | TP_PROTO(struct scsi_cmnd *cmd), | ||
| 193 | |||
| 194 | TP_ARGS(cmd), | ||
| 195 | |||
| 196 | TP_STRUCT__entry( | ||
| 197 | __field( unsigned int, host_no ) | ||
| 198 | __field( unsigned int, channel ) | ||
| 199 | __field( unsigned int, id ) | ||
| 200 | __field( unsigned int, lun ) | ||
| 201 | __field( unsigned int, opcode ) | ||
| 202 | __field( unsigned int, cmd_len ) | ||
| 203 | __field( unsigned int, data_sglen ) | ||
| 204 | __field( unsigned int, prot_sglen ) | ||
| 205 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) | ||
| 206 | ), | ||
| 207 | |||
| 208 | TP_fast_assign( | ||
| 209 | __entry->host_no = cmd->device->host->host_no; | ||
| 210 | __entry->channel = cmd->device->channel; | ||
| 211 | __entry->id = cmd->device->id; | ||
| 212 | __entry->lun = cmd->device->lun; | ||
| 213 | __entry->opcode = cmd->cmnd[0]; | ||
| 214 | __entry->cmd_len = cmd->cmd_len; | ||
| 215 | __entry->data_sglen = scsi_sg_count(cmd); | ||
| 216 | __entry->prot_sglen = scsi_prot_sg_count(cmd); | ||
| 217 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); | ||
| 218 | ), | ||
| 219 | |||
| 220 | TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ | ||
| 221 | " cmnd=(%s %s raw=%s)", | ||
| 222 | __entry->host_no, __entry->channel, __entry->id, | ||
| 223 | __entry->lun, __entry->data_sglen, __entry->prot_sglen, | ||
| 224 | show_opcode_name(__entry->opcode), | ||
| 225 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), | ||
| 226 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len)) | ||
| 227 | ); | ||
| 228 | |||
| 229 | TRACE_EVENT(scsi_dispatch_cmd_error, | ||
| 230 | |||
| 231 | TP_PROTO(struct scsi_cmnd *cmd, int rtn), | ||
| 232 | |||
| 233 | TP_ARGS(cmd, rtn), | ||
| 234 | |||
| 235 | TP_STRUCT__entry( | ||
| 236 | __field( unsigned int, host_no ) | ||
| 237 | __field( unsigned int, channel ) | ||
| 238 | __field( unsigned int, id ) | ||
| 239 | __field( unsigned int, lun ) | ||
| 240 | __field( int, rtn ) | ||
| 241 | __field( unsigned int, opcode ) | ||
| 242 | __field( unsigned int, cmd_len ) | ||
| 243 | __field( unsigned int, data_sglen ) | ||
| 244 | __field( unsigned int, prot_sglen ) | ||
| 245 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) | ||
| 246 | ), | ||
| 247 | |||
| 248 | TP_fast_assign( | ||
| 249 | __entry->host_no = cmd->device->host->host_no; | ||
| 250 | __entry->channel = cmd->device->channel; | ||
| 251 | __entry->id = cmd->device->id; | ||
| 252 | __entry->lun = cmd->device->lun; | ||
| 253 | __entry->rtn = rtn; | ||
| 254 | __entry->opcode = cmd->cmnd[0]; | ||
| 255 | __entry->cmd_len = cmd->cmd_len; | ||
| 256 | __entry->data_sglen = scsi_sg_count(cmd); | ||
| 257 | __entry->prot_sglen = scsi_prot_sg_count(cmd); | ||
| 258 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); | ||
| 259 | ), | ||
| 260 | |||
| 261 | TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ | ||
| 262 | " cmnd=(%s %s raw=%s) rtn=%d", | ||
| 263 | __entry->host_no, __entry->channel, __entry->id, | ||
| 264 | __entry->lun, __entry->data_sglen, __entry->prot_sglen, | ||
| 265 | show_opcode_name(__entry->opcode), | ||
| 266 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), | ||
| 267 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), | ||
| 268 | __entry->rtn) | ||
| 269 | ); | ||
| 270 | |||
| 271 | DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template, | ||
| 272 | |||
| 273 | TP_PROTO(struct scsi_cmnd *cmd), | ||
| 274 | |||
| 275 | TP_ARGS(cmd), | ||
| 276 | |||
| 277 | TP_STRUCT__entry( | ||
| 278 | __field( unsigned int, host_no ) | ||
| 279 | __field( unsigned int, channel ) | ||
| 280 | __field( unsigned int, id ) | ||
| 281 | __field( unsigned int, lun ) | ||
| 282 | __field( int, result ) | ||
| 283 | __field( unsigned int, opcode ) | ||
| 284 | __field( unsigned int, cmd_len ) | ||
| 285 | __field( unsigned int, data_sglen ) | ||
| 286 | __field( unsigned int, prot_sglen ) | ||
| 287 | __dynamic_array(unsigned char, cmnd, cmd->cmd_len) | ||
| 288 | ), | ||
| 289 | |||
| 290 | TP_fast_assign( | ||
| 291 | __entry->host_no = cmd->device->host->host_no; | ||
| 292 | __entry->channel = cmd->device->channel; | ||
| 293 | __entry->id = cmd->device->id; | ||
| 294 | __entry->lun = cmd->device->lun; | ||
| 295 | __entry->result = cmd->result; | ||
| 296 | __entry->opcode = cmd->cmnd[0]; | ||
| 297 | __entry->cmd_len = cmd->cmd_len; | ||
| 298 | __entry->data_sglen = scsi_sg_count(cmd); | ||
| 299 | __entry->prot_sglen = scsi_prot_sg_count(cmd); | ||
| 300 | memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); | ||
| 301 | ), | ||
| 302 | |||
| 303 | TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u " \ | ||
| 304 | "prot_sgl=%u cmnd=(%s %s raw=%s) result=(driver=%s host=%s " \ | ||
| 305 | "message=%s status=%s)", | ||
| 306 | __entry->host_no, __entry->channel, __entry->id, | ||
| 307 | __entry->lun, __entry->data_sglen, __entry->prot_sglen, | ||
| 308 | show_opcode_name(__entry->opcode), | ||
| 309 | __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), | ||
| 310 | __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), | ||
| 311 | show_driverbyte_name(((__entry->result) >> 24) & 0xff), | ||
| 312 | show_hostbyte_name(((__entry->result) >> 16) & 0xff), | ||
| 313 | show_msgbyte_name(((__entry->result) >> 8) & 0xff), | ||
| 314 | show_statusbyte_name(__entry->result & 0xff)) | ||
| 315 | ); | ||
| 316 | |||
| 317 | DEFINE_EVENT(scsi_cmd_done_timeout_template, scsi_dispatch_cmd_done, | ||
| 318 | TP_PROTO(struct scsi_cmnd *cmd), | ||
| 319 | TP_ARGS(cmd)); | ||
| 320 | |||
| 321 | DEFINE_EVENT(scsi_cmd_done_timeout_template, scsi_dispatch_cmd_timeout, | ||
| 322 | TP_PROTO(struct scsi_cmnd *cmd), | ||
| 323 | TP_ARGS(cmd)); | ||
| 324 | |||
| 325 | TRACE_EVENT(scsi_eh_wakeup, | ||
| 326 | |||
| 327 | TP_PROTO(struct Scsi_Host *shost), | ||
| 328 | |||
| 329 | TP_ARGS(shost), | ||
| 330 | |||
| 331 | TP_STRUCT__entry( | ||
| 332 | __field( unsigned int, host_no ) | ||
| 333 | ), | ||
| 334 | |||
| 335 | TP_fast_assign( | ||
| 336 | __entry->host_no = shost->host_no; | ||
| 337 | ), | ||
| 338 | |||
| 339 | TP_printk("host_no=%u", __entry->host_no) | ||
| 340 | ); | ||
| 341 | |||
| 342 | #endif /* _TRACE_SCSI_H */ | ||
| 343 | |||
| 344 | /* This part must be outside protection */ | ||
| 345 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/signal.h b/include/trace/events/signal.h index a510b75ac304..814566c99d29 100644 --- a/include/trace/events/signal.h +++ b/include/trace/events/signal.h | |||
| @@ -100,18 +100,7 @@ TRACE_EVENT(signal_deliver, | |||
| 100 | __entry->sa_handler, __entry->sa_flags) | 100 | __entry->sa_handler, __entry->sa_flags) |
| 101 | ); | 101 | ); |
| 102 | 102 | ||
| 103 | /** | 103 | DECLARE_EVENT_CLASS(signal_queue_overflow, |
| 104 | * signal_overflow_fail - called when signal queue is overflow | ||
| 105 | * @sig: signal number | ||
| 106 | * @group: signal to process group or not (bool) | ||
| 107 | * @info: pointer to struct siginfo | ||
| 108 | * | ||
| 109 | * Kernel fails to generate 'sig' signal with 'info' siginfo, because | ||
| 110 | * siginfo queue is overflow, and the signal is dropped. | ||
| 111 | * 'group' is not 0 if the signal will be sent to a process group. | ||
| 112 | * 'sig' is always one of RT signals. | ||
| 113 | */ | ||
| 114 | TRACE_EVENT(signal_overflow_fail, | ||
| 115 | 104 | ||
| 116 | TP_PROTO(int sig, int group, struct siginfo *info), | 105 | TP_PROTO(int sig, int group, struct siginfo *info), |
| 117 | 106 | ||
| @@ -135,6 +124,24 @@ TRACE_EVENT(signal_overflow_fail, | |||
| 135 | ); | 124 | ); |
| 136 | 125 | ||
| 137 | /** | 126 | /** |
| 127 | * signal_overflow_fail - called when signal queue is overflow | ||
| 128 | * @sig: signal number | ||
| 129 | * @group: signal to process group or not (bool) | ||
| 130 | * @info: pointer to struct siginfo | ||
| 131 | * | ||
| 132 | * Kernel fails to generate 'sig' signal with 'info' siginfo, because | ||
| 133 | * siginfo queue is overflow, and the signal is dropped. | ||
| 134 | * 'group' is not 0 if the signal will be sent to a process group. | ||
| 135 | * 'sig' is always one of RT signals. | ||
| 136 | */ | ||
| 137 | DEFINE_EVENT(signal_queue_overflow, signal_overflow_fail, | ||
| 138 | |||
| 139 | TP_PROTO(int sig, int group, struct siginfo *info), | ||
| 140 | |||
| 141 | TP_ARGS(sig, group, info) | ||
| 142 | ); | ||
| 143 | |||
| 144 | /** | ||
| 138 | * signal_lose_info - called when siginfo is lost | 145 | * signal_lose_info - called when siginfo is lost |
| 139 | * @sig: signal number | 146 | * @sig: signal number |
| 140 | * @group: signal to process group or not (bool) | 147 | * @group: signal to process group or not (bool) |
| @@ -145,28 +152,13 @@ TRACE_EVENT(signal_overflow_fail, | |||
| 145 | * 'group' is not 0 if the signal will be sent to a process group. | 152 | * 'group' is not 0 if the signal will be sent to a process group. |
| 146 | * 'sig' is always one of non-RT signals. | 153 | * 'sig' is always one of non-RT signals. |
| 147 | */ | 154 | */ |
| 148 | TRACE_EVENT(signal_lose_info, | 155 | DEFINE_EVENT(signal_queue_overflow, signal_lose_info, |
| 149 | 156 | ||
| 150 | TP_PROTO(int sig, int group, struct siginfo *info), | 157 | TP_PROTO(int sig, int group, struct siginfo *info), |
| 151 | 158 | ||
| 152 | TP_ARGS(sig, group, info), | 159 | TP_ARGS(sig, group, info) |
| 153 | |||
| 154 | TP_STRUCT__entry( | ||
| 155 | __field( int, sig ) | ||
| 156 | __field( int, group ) | ||
| 157 | __field( int, errno ) | ||
| 158 | __field( int, code ) | ||
| 159 | ), | ||
| 160 | |||
| 161 | TP_fast_assign( | ||
| 162 | __entry->sig = sig; | ||
| 163 | __entry->group = group; | ||
| 164 | TP_STORE_SIGINFO(__entry, info); | ||
| 165 | ), | ||
| 166 | |||
| 167 | TP_printk("sig=%d group=%d errno=%d code=%d", | ||
| 168 | __entry->sig, __entry->group, __entry->errno, __entry->code) | ||
| 169 | ); | 160 | ); |
| 161 | |||
| 170 | #endif /* _TRACE_SIGNAL_H */ | 162 | #endif /* _TRACE_SIGNAL_H */ |
| 171 | 163 | ||
| 172 | /* This part must be outside protection */ | 164 | /* This part must be outside protection */ |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 0804cd594803..88c59c13ea7b 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
| @@ -154,9 +154,11 @@ | |||
| 154 | * | 154 | * |
| 155 | * field = (typeof(field))entry; | 155 | * field = (typeof(field))entry; |
| 156 | * | 156 | * |
| 157 | * p = get_cpu_var(ftrace_event_seq); | 157 | * p = &get_cpu_var(ftrace_event_seq); |
| 158 | * trace_seq_init(p); | 158 | * trace_seq_init(p); |
| 159 | * ret = trace_seq_printf(s, <TP_printk> "\n"); | 159 | * ret = trace_seq_printf(s, "%s: ", <call>); |
| 160 | * if (ret) | ||
| 161 | * ret = trace_seq_printf(s, <TP_printk> "\n"); | ||
| 160 | * put_cpu(); | 162 | * put_cpu(); |
| 161 | * if (!ret) | 163 | * if (!ret) |
| 162 | * return TRACE_TYPE_PARTIAL_LINE; | 164 | * return TRACE_TYPE_PARTIAL_LINE; |
| @@ -198,6 +200,9 @@ | |||
| 198 | ftrace_print_symbols_seq(p, value, symbols); \ | 200 | ftrace_print_symbols_seq(p, value, symbols); \ |
| 199 | }) | 201 | }) |
| 200 | 202 | ||
| 203 | #undef __print_hex | ||
| 204 | #define __print_hex(buf, buf_len) ftrace_print_hex_seq(p, buf, buf_len) | ||
| 205 | |||
| 201 | #undef DECLARE_EVENT_CLASS | 206 | #undef DECLARE_EVENT_CLASS |
| 202 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 207 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| 203 | static notrace enum print_line_t \ | 208 | static notrace enum print_line_t \ |
| @@ -401,18 +406,18 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
| 401 | #undef DEFINE_EVENT | 406 | #undef DEFINE_EVENT |
| 402 | #define DEFINE_EVENT(template, name, proto, args) \ | 407 | #define DEFINE_EVENT(template, name, proto, args) \ |
| 403 | \ | 408 | \ |
| 404 | static void ftrace_profile_##name(proto); \ | 409 | static void perf_trace_##name(proto); \ |
| 405 | \ | 410 | \ |
| 406 | static notrace int \ | 411 | static notrace int \ |
| 407 | ftrace_profile_enable_##name(struct ftrace_event_call *unused) \ | 412 | perf_trace_enable_##name(struct ftrace_event_call *unused) \ |
| 408 | { \ | 413 | { \ |
| 409 | return register_trace_##name(ftrace_profile_##name); \ | 414 | return register_trace_##name(perf_trace_##name); \ |
| 410 | } \ | 415 | } \ |
| 411 | \ | 416 | \ |
| 412 | static notrace void \ | 417 | static notrace void \ |
| 413 | ftrace_profile_disable_##name(struct ftrace_event_call *unused) \ | 418 | perf_trace_disable_##name(struct ftrace_event_call *unused) \ |
| 414 | { \ | 419 | { \ |
| 415 | unregister_trace_##name(ftrace_profile_##name); \ | 420 | unregister_trace_##name(perf_trace_##name); \ |
| 416 | } | 421 | } |
| 417 | 422 | ||
| 418 | #undef DEFINE_EVENT_PRINT | 423 | #undef DEFINE_EVENT_PRINT |
| @@ -450,38 +455,38 @@ ftrace_profile_disable_##name(struct ftrace_event_call *unused) \ | |||
| 450 | * | 455 | * |
| 451 | * static void ftrace_raw_event_<call>(proto) | 456 | * static void ftrace_raw_event_<call>(proto) |
| 452 | * { | 457 | * { |
| 458 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; | ||
| 453 | * struct ring_buffer_event *event; | 459 | * struct ring_buffer_event *event; |
| 454 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 | 460 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 |
| 455 | * struct ring_buffer *buffer; | 461 | * struct ring_buffer *buffer; |
| 456 | * unsigned long irq_flags; | 462 | * unsigned long irq_flags; |
| 463 | * int __data_size; | ||
| 457 | * int pc; | 464 | * int pc; |
| 458 | * | 465 | * |
| 459 | * local_save_flags(irq_flags); | 466 | * local_save_flags(irq_flags); |
| 460 | * pc = preempt_count(); | 467 | * pc = preempt_count(); |
| 461 | * | 468 | * |
| 469 | * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args); | ||
| 470 | * | ||
| 462 | * event = trace_current_buffer_lock_reserve(&buffer, | 471 | * event = trace_current_buffer_lock_reserve(&buffer, |
| 463 | * event_<call>.id, | 472 | * event_<call>.id, |
| 464 | * sizeof(struct ftrace_raw_<call>), | 473 | * sizeof(*entry) + __data_size, |
| 465 | * irq_flags, pc); | 474 | * irq_flags, pc); |
| 466 | * if (!event) | 475 | * if (!event) |
| 467 | * return; | 476 | * return; |
| 468 | * entry = ring_buffer_event_data(event); | 477 | * entry = ring_buffer_event_data(event); |
| 469 | * | 478 | * |
| 470 | * <assign>; <-- Here we assign the entries by the __field and | 479 | * { <assign>; } <-- Here we assign the entries by the __field and |
| 471 | * __array macros. | 480 | * __array macros. |
| 472 | * | 481 | * |
| 473 | * trace_current_buffer_unlock_commit(buffer, event, irq_flags, pc); | 482 | * if (!filter_current_check_discard(buffer, event_call, entry, event)) |
| 483 | * trace_current_buffer_unlock_commit(buffer, | ||
| 484 | * event, irq_flags, pc); | ||
| 474 | * } | 485 | * } |
| 475 | * | 486 | * |
| 476 | * static int ftrace_raw_reg_event_<call>(struct ftrace_event_call *unused) | 487 | * static int ftrace_raw_reg_event_<call>(struct ftrace_event_call *unused) |
| 477 | * { | 488 | * { |
| 478 | * int ret; | 489 | * return register_trace_<call>(ftrace_raw_event_<call>); |
| 479 | * | ||
| 480 | * ret = register_trace_<call>(ftrace_raw_event_<call>); | ||
| 481 | * if (!ret) | ||
| 482 | * pr_info("event trace: Could not activate trace point " | ||
| 483 | * "probe to <call>"); | ||
| 484 | * return ret; | ||
| 485 | * } | 490 | * } |
| 486 | * | 491 | * |
| 487 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) | 492 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) |
| @@ -493,6 +498,8 @@ ftrace_profile_disable_##name(struct ftrace_event_call *unused) \ | |||
| 493 | * .trace = ftrace_raw_output_<call>, <-- stage 2 | 498 | * .trace = ftrace_raw_output_<call>, <-- stage 2 |
| 494 | * }; | 499 | * }; |
| 495 | * | 500 | * |
| 501 | * static const char print_fmt_<call>[] = <TP_printk>; | ||
| 502 | * | ||
| 496 | * static struct ftrace_event_call __used | 503 | * static struct ftrace_event_call __used |
| 497 | * __attribute__((__aligned__(4))) | 504 | * __attribute__((__aligned__(4))) |
| 498 | * __attribute__((section("_ftrace_events"))) event_<call> = { | 505 | * __attribute__((section("_ftrace_events"))) event_<call> = { |
| @@ -501,18 +508,20 @@ ftrace_profile_disable_##name(struct ftrace_event_call *unused) \ | |||
| 501 | * .raw_init = trace_event_raw_init, | 508 | * .raw_init = trace_event_raw_init, |
| 502 | * .regfunc = ftrace_reg_event_<call>, | 509 | * .regfunc = ftrace_reg_event_<call>, |
| 503 | * .unregfunc = ftrace_unreg_event_<call>, | 510 | * .unregfunc = ftrace_unreg_event_<call>, |
| 511 | * .print_fmt = print_fmt_<call>, | ||
| 512 | * .define_fields = ftrace_define_fields_<call>, | ||
| 504 | * } | 513 | * } |
| 505 | * | 514 | * |
| 506 | */ | 515 | */ |
| 507 | 516 | ||
| 508 | #ifdef CONFIG_PERF_EVENTS | 517 | #ifdef CONFIG_PERF_EVENTS |
| 509 | 518 | ||
| 510 | #define _TRACE_PROFILE_INIT(call) \ | 519 | #define _TRACE_PERF_INIT(call) \ |
| 511 | .profile_enable = ftrace_profile_enable_##call, \ | 520 | .perf_event_enable = perf_trace_enable_##call, \ |
| 512 | .profile_disable = ftrace_profile_disable_##call, | 521 | .perf_event_disable = perf_trace_disable_##call, |
| 513 | 522 | ||
| 514 | #else | 523 | #else |
| 515 | #define _TRACE_PROFILE_INIT(call) | 524 | #define _TRACE_PERF_INIT(call) |
| 516 | #endif /* CONFIG_PERF_EVENTS */ | 525 | #endif /* CONFIG_PERF_EVENTS */ |
| 517 | 526 | ||
| 518 | #undef __entry | 527 | #undef __entry |
| @@ -569,7 +578,6 @@ ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ | |||
| 569 | return; \ | 578 | return; \ |
| 570 | entry = ring_buffer_event_data(event); \ | 579 | entry = ring_buffer_event_data(event); \ |
| 571 | \ | 580 | \ |
| 572 | \ | ||
| 573 | tstruct \ | 581 | tstruct \ |
| 574 | \ | 582 | \ |
| 575 | { assign; } \ | 583 | { assign; } \ |
| @@ -638,7 +646,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
| 638 | .unregfunc = ftrace_raw_unreg_event_##call, \ | 646 | .unregfunc = ftrace_raw_unreg_event_##call, \ |
| 639 | .print_fmt = print_fmt_##template, \ | 647 | .print_fmt = print_fmt_##template, \ |
| 640 | .define_fields = ftrace_define_fields_##template, \ | 648 | .define_fields = ftrace_define_fields_##template, \ |
| 641 | _TRACE_PROFILE_INIT(call) \ | 649 | _TRACE_PERF_INIT(call) \ |
| 642 | } | 650 | } |
| 643 | 651 | ||
| 644 | #undef DEFINE_EVENT_PRINT | 652 | #undef DEFINE_EVENT_PRINT |
| @@ -657,18 +665,18 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
| 657 | .unregfunc = ftrace_raw_unreg_event_##call, \ | 665 | .unregfunc = ftrace_raw_unreg_event_##call, \ |
| 658 | .print_fmt = print_fmt_##call, \ | 666 | .print_fmt = print_fmt_##call, \ |
| 659 | .define_fields = ftrace_define_fields_##template, \ | 667 | .define_fields = ftrace_define_fields_##template, \ |
| 660 | _TRACE_PROFILE_INIT(call) \ | 668 | _TRACE_PERF_INIT(call) \ |
| 661 | } | 669 | } |
| 662 | 670 | ||
| 663 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 671 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 664 | 672 | ||
| 665 | /* | 673 | /* |
| 666 | * Define the insertion callback to profile events | 674 | * Define the insertion callback to perf events |
| 667 | * | 675 | * |
| 668 | * The job is very similar to ftrace_raw_event_<call> except that we don't | 676 | * The job is very similar to ftrace_raw_event_<call> except that we don't |
| 669 | * insert in the ring buffer but in a perf counter. | 677 | * insert in the ring buffer but in a perf counter. |
| 670 | * | 678 | * |
| 671 | * static void ftrace_profile_<call>(proto) | 679 | * static void ftrace_perf_<call>(proto) |
| 672 | * { | 680 | * { |
| 673 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; | 681 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; |
| 674 | * struct ftrace_event_call *event_call = &event_<call>; | 682 | * struct ftrace_event_call *event_call = &event_<call>; |
| @@ -699,9 +707,9 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
| 699 | * __cpu = smp_processor_id(); | 707 | * __cpu = smp_processor_id(); |
| 700 | * | 708 | * |
| 701 | * if (in_nmi()) | 709 | * if (in_nmi()) |
| 702 | * trace_buf = rcu_dereference(perf_trace_buf_nmi); | 710 | * trace_buf = rcu_dereference_sched(perf_trace_buf_nmi); |
| 703 | * else | 711 | * else |
| 704 | * trace_buf = rcu_dereference(perf_trace_buf); | 712 | * trace_buf = rcu_dereference_sched(perf_trace_buf); |
| 705 | * | 713 | * |
| 706 | * if (!trace_buf) | 714 | * if (!trace_buf) |
| 707 | * goto end; | 715 | * goto end; |
| @@ -757,8 +765,8 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
| 757 | #undef DECLARE_EVENT_CLASS | 765 | #undef DECLARE_EVENT_CLASS |
| 758 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 766 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| 759 | static notrace void \ | 767 | static notrace void \ |
| 760 | ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \ | 768 | perf_trace_templ_##call(struct ftrace_event_call *event_call, \ |
| 761 | proto) \ | 769 | struct pt_regs *__regs, proto) \ |
| 762 | { \ | 770 | { \ |
| 763 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 771 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
| 764 | struct ftrace_raw_##call *entry; \ | 772 | struct ftrace_raw_##call *entry; \ |
| @@ -773,10 +781,10 @@ ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \ | |||
| 773 | sizeof(u64)); \ | 781 | sizeof(u64)); \ |
| 774 | __entry_size -= sizeof(u32); \ | 782 | __entry_size -= sizeof(u32); \ |
| 775 | \ | 783 | \ |
| 776 | if (WARN_ONCE(__entry_size > FTRACE_MAX_PROFILE_SIZE, \ | 784 | if (WARN_ONCE(__entry_size > PERF_MAX_TRACE_SIZE, \ |
| 777 | "profile buffer not large enough")) \ | 785 | "profile buffer not large enough")) \ |
| 778 | return; \ | 786 | return; \ |
| 779 | entry = (struct ftrace_raw_##call *)ftrace_perf_buf_prepare( \ | 787 | entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \ |
| 780 | __entry_size, event_call->id, &rctx, &irq_flags); \ | 788 | __entry_size, event_call->id, &rctx, &irq_flags); \ |
| 781 | if (!entry) \ | 789 | if (!entry) \ |
| 782 | return; \ | 790 | return; \ |
| @@ -784,17 +792,22 @@ ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \ | |||
| 784 | \ | 792 | \ |
| 785 | { assign; } \ | 793 | { assign; } \ |
| 786 | \ | 794 | \ |
| 787 | ftrace_perf_buf_submit(entry, __entry_size, rctx, __addr, \ | 795 | perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ |
| 788 | __count, irq_flags); \ | 796 | __count, irq_flags, __regs); \ |
| 789 | } | 797 | } |
| 790 | 798 | ||
| 791 | #undef DEFINE_EVENT | 799 | #undef DEFINE_EVENT |
| 792 | #define DEFINE_EVENT(template, call, proto, args) \ | 800 | #define DEFINE_EVENT(template, call, proto, args) \ |
| 793 | static notrace void ftrace_profile_##call(proto) \ | 801 | static notrace void perf_trace_##call(proto) \ |
| 794 | { \ | 802 | { \ |
| 795 | struct ftrace_event_call *event_call = &event_##call; \ | 803 | struct ftrace_event_call *event_call = &event_##call; \ |
| 796 | \ | 804 | struct pt_regs *__regs = &get_cpu_var(perf_trace_regs); \ |
| 797 | ftrace_profile_templ_##template(event_call, args); \ | 805 | \ |
| 806 | perf_fetch_caller_regs(__regs, 1); \ | ||
| 807 | \ | ||
| 808 | perf_trace_templ_##template(event_call, __regs, args); \ | ||
| 809 | \ | ||
| 810 | put_cpu_var(perf_trace_regs); \ | ||
| 798 | } | 811 | } |
| 799 | 812 | ||
| 800 | #undef DEFINE_EVENT_PRINT | 813 | #undef DEFINE_EVENT_PRINT |
diff --git a/include/trace/syscall.h b/include/trace/syscall.h index 0387100752f0..e5e5f48dbfb3 100644 --- a/include/trace/syscall.h +++ b/include/trace/syscall.h | |||
| @@ -47,10 +47,10 @@ enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags); | |||
| 47 | #endif | 47 | #endif |
| 48 | 48 | ||
| 49 | #ifdef CONFIG_PERF_EVENTS | 49 | #ifdef CONFIG_PERF_EVENTS |
| 50 | int prof_sysenter_enable(struct ftrace_event_call *call); | 50 | int perf_sysenter_enable(struct ftrace_event_call *call); |
| 51 | void prof_sysenter_disable(struct ftrace_event_call *call); | 51 | void perf_sysenter_disable(struct ftrace_event_call *call); |
| 52 | int prof_sysexit_enable(struct ftrace_event_call *call); | 52 | int perf_sysexit_enable(struct ftrace_event_call *call); |
| 53 | void prof_sysexit_disable(struct ftrace_event_call *call); | 53 | void perf_sysexit_disable(struct ftrace_event_call *call); |
| 54 | #endif | 54 | #endif |
| 55 | 55 | ||
| 56 | #endif /* _TRACE_SYSCALL_H */ | 56 | #endif /* _TRACE_SYSCALL_H */ |
diff --git a/include/video/broadsheetfb.h b/include/video/broadsheetfb.h index a758534c0272..548d28f4ec67 100644 --- a/include/video/broadsheetfb.h +++ b/include/video/broadsheetfb.h | |||
| @@ -29,11 +29,19 @@ | |||
| 29 | #define BS_CMD_UPD_FULL 0x33 | 29 | #define BS_CMD_UPD_FULL 0x33 |
| 30 | #define BS_CMD_UPD_GDRV_CLR 0x37 | 30 | #define BS_CMD_UPD_GDRV_CLR 0x37 |
| 31 | 31 | ||
| 32 | /* Broadsheet register interface defines */ | ||
| 33 | #define BS_REG_REV 0x00 | ||
| 34 | #define BS_REG_PRC 0x02 | ||
| 35 | |||
| 32 | /* Broadsheet pin interface specific defines */ | 36 | /* Broadsheet pin interface specific defines */ |
| 33 | #define BS_CS 0x01 | 37 | #define BS_CS 0x01 |
| 34 | #define BS_DC 0x02 | 38 | #define BS_DC 0x02 |
| 35 | #define BS_WR 0x03 | 39 | #define BS_WR 0x03 |
| 36 | 40 | ||
| 41 | /* Broadsheet IO interface specific defines */ | ||
| 42 | #define BS_MMIO_CMD 0x01 | ||
| 43 | #define BS_MMIO_DATA 0x02 | ||
| 44 | |||
| 37 | /* struct used by broadsheet. board specific stuff comes from *board */ | 45 | /* struct used by broadsheet. board specific stuff comes from *board */ |
| 38 | struct broadsheetfb_par { | 46 | struct broadsheetfb_par { |
| 39 | struct fb_info *info; | 47 | struct fb_info *info; |
| @@ -41,6 +49,8 @@ struct broadsheetfb_par { | |||
| 41 | void (*write_reg)(struct broadsheetfb_par *, u16 reg, u16 val); | 49 | void (*write_reg)(struct broadsheetfb_par *, u16 reg, u16 val); |
| 42 | u16 (*read_reg)(struct broadsheetfb_par *, u16 reg); | 50 | u16 (*read_reg)(struct broadsheetfb_par *, u16 reg); |
| 43 | wait_queue_head_t waitq; | 51 | wait_queue_head_t waitq; |
| 52 | int panel_index; | ||
| 53 | struct mutex io_lock; | ||
| 44 | }; | 54 | }; |
| 45 | 55 | ||
| 46 | /* board specific routines */ | 56 | /* board specific routines */ |
| @@ -48,12 +58,17 @@ struct broadsheet_board { | |||
| 48 | struct module *owner; | 58 | struct module *owner; |
| 49 | int (*init)(struct broadsheetfb_par *); | 59 | int (*init)(struct broadsheetfb_par *); |
| 50 | int (*wait_for_rdy)(struct broadsheetfb_par *); | 60 | int (*wait_for_rdy)(struct broadsheetfb_par *); |
| 51 | void (*set_ctl)(struct broadsheetfb_par *, unsigned char, u8); | ||
| 52 | void (*set_hdb)(struct broadsheetfb_par *, u16); | ||
| 53 | u16 (*get_hdb)(struct broadsheetfb_par *); | ||
| 54 | void (*cleanup)(struct broadsheetfb_par *); | 61 | void (*cleanup)(struct broadsheetfb_par *); |
| 55 | int (*get_panel_type)(void); | 62 | int (*get_panel_type)(void); |
| 56 | int (*setup_irq)(struct fb_info *); | 63 | int (*setup_irq)(struct fb_info *); |
| 57 | }; | ||
| 58 | 64 | ||
| 65 | /* Functions for boards that use GPIO */ | ||
| 66 | void (*set_ctl)(struct broadsheetfb_par *, unsigned char, u8); | ||
| 67 | void (*set_hdb)(struct broadsheetfb_par *, u16); | ||
| 68 | u16 (*get_hdb)(struct broadsheetfb_par *); | ||
| 69 | |||
| 70 | /* Functions for boards that have specialized MMIO */ | ||
| 71 | void (*mmio_write)(struct broadsheetfb_par *, int type, u16); | ||
| 72 | u16 (*mmio_read)(struct broadsheetfb_par *); | ||
| 73 | }; | ||
| 59 | #endif | 74 | #endif |
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h index b9763badbd77..43e2d7d33976 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | #include <linux/mutex.h> | 39 | #include <linux/mutex.h> |
| 40 | #include <linux/completion.h> | 40 | #include <linux/completion.h> |
| 41 | #include <linux/init.h> | 41 | #include <linux/init.h> |
| 42 | #include <linux/slab.h> | ||
| 42 | #include <xen/interface/xen.h> | 43 | #include <xen/interface/xen.h> |
| 43 | #include <xen/interface/grant_table.h> | 44 | #include <xen/interface/grant_table.h> |
| 44 | #include <xen/interface/io/xenbus.h> | 45 | #include <xen/interface/io/xenbus.h> |
