aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-02-15 16:24:37 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-15 16:24:37 -0500
commitca994a36f585432458ead9133fcfe05440edbb7b (patch)
treebe05512153a9cd5cbe1f1234bc09fd9cd388ec58 /include
parent12325280dfeba18164f9c47e226a40ab34e23ee7 (diff)
parent2504a6423b9ab4c36df78227055995644de19edb (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts: net/mac80211/debugfs_sta.c net/mac80211/sta_info.h
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acnames.h1
-rw-r--r--include/acpi/acpi_numa.h1
-rw-r--r--include/acpi/acpiosxf.h7
-rw-r--r--include/acpi/acpixf.h34
-rw-r--r--include/acpi/acrestyp.h207
-rw-r--r--include/acpi/actbl.h23
-rw-r--r--include/acpi/actbl1.h57
-rw-r--r--include/acpi/actbl3.h552
-rw-r--r--include/acpi/actypes.h12
-rw-r--r--include/acpi/apei.h4
-rw-r--r--include/asm-generic/gpio.h4
-rw-r--r--include/asm-generic/param.h13
-rw-r--r--include/drm/drm_crtc.h2
-rw-r--r--include/keys/user-type.h3
-rw-r--r--include/linux/acct.h3
-rw-r--r--include/linux/acpi.h20
-rw-r--r--include/linux/acpi_io.h3
-rw-r--r--include/linux/amba/mmci.h2
-rw-r--r--include/linux/amba/pl061.h2
-rw-r--r--include/linux/amba/pl08x.h4
-rw-r--r--include/linux/audit.h116
-rw-r--r--include/linux/bio.h66
-rw-r--r--include/linux/blkdev.h104
-rw-r--r--include/linux/capability.h4
-rw-r--r--include/linux/compiler-gcc.h5
-rw-r--r--include/linux/console.h2
-rw-r--r--include/linux/cpuidle.h7
-rw-r--r--include/linux/cred.h6
-rw-r--r--include/linux/cuda.h5
-rw-r--r--include/linux/dcache.h1
-rw-r--r--include/linux/device.h15
-rw-r--r--include/linux/digsig.h4
-rw-r--r--include/linux/display.h61
-rw-r--r--include/linux/dmaengine.h99
-rw-r--r--include/linux/dvb/frontend.h19
-rw-r--r--include/linux/dvb/version.h2
-rw-r--r--include/linux/dw_dmac.h2
-rw-r--r--include/linux/elevator.h41
-rw-r--r--include/linux/elf.h18
-rw-r--r--include/linux/fb.h14
-rw-r--r--include/linux/fs.h3
-rw-r--r--include/linux/ftrace.h77
-rw-r--r--include/linux/gfs2_ondisk.h2
-rw-r--r--include/linux/i2c/twl.h2
-rw-r--r--include/linux/if_team.h10
-rw-r--r--include/linux/init.h3
-rw-r--r--include/linux/iocontext.h136
-rw-r--r--include/linux/isdn_divertif.h4
-rw-r--r--include/linux/kexec.h2
-rw-r--r--include/linux/key.h5
-rw-r--r--include/linux/kmemleak.h8
-rw-r--r--include/linux/kref.h1
-rw-r--r--include/linux/lockd/lockd.h2
-rw-r--r--include/linux/mfd/88pm860x.h3
-rw-r--r--include/linux/mfd/abx500/ab5500.h (renamed from include/linux/mfd/ab5500/ab5500.h)0
-rw-r--r--include/linux/mfd/abx500/ab8500-gpadc.h (renamed from include/linux/mfd/ab8500/gpadc.h)0
-rw-r--r--include/linux/mfd/abx500/ab8500-gpio.h (renamed from include/linux/mfd/ab8500/gpio.h)0
-rw-r--r--include/linux/mfd/abx500/ab8500-sysctrl.h (renamed from include/linux/mfd/ab8500/sysctrl.h)0
-rw-r--r--include/linux/mfd/abx500/ab8500.h (renamed from include/linux/mfd/ab8500.h)0
-rw-r--r--include/linux/mfd/max8925.h2
-rw-r--r--include/linux/mfd/max8997.h83
-rw-r--r--include/linux/mfd/mc13xxx.h8
-rw-r--r--include/linux/mfd/mcp.h7
-rw-r--r--include/linux/mfd/s5m87xx/s5m-core.h373
-rw-r--r--include/linux/mfd/s5m87xx/s5m-pmic.h100
-rw-r--r--include/linux/mfd/s5m87xx/s5m-rtc.h84
-rw-r--r--include/linux/mfd/stmpe.h16
-rw-r--r--include/linux/mfd/ucb1x00.h5
-rw-r--r--include/linux/migrate.h14
-rw-r--r--include/linux/migrate_mode.h16
-rw-r--r--include/linux/mlx4/device.h1
-rw-r--r--include/linux/mmc/card.h23
-rw-r--r--include/linux/mmc/cd-gpio.h19
-rw-r--r--include/linux/mmc/core.h2
-rw-r--r--include/linux/mmc/dw_mmc.h1
-rw-r--r--include/linux/mmc/host.h27
-rw-r--r--include/linux/mmc/mmc.h72
-rw-r--r--include/linux/mmc/sdhci-pci-data.h18
-rw-r--r--include/linux/mmc/sdhci.h3
-rw-r--r--include/linux/mmc/sdio.h29
-rw-r--r--include/linux/mod_devicetable.h11
-rw-r--r--include/linux/module.h21
-rw-r--r--include/linux/moduleparam.h17
-rw-r--r--include/linux/mroute6.h4
-rw-r--r--include/linux/mtd/gpmi-nand.h68
-rw-r--r--include/linux/nvme.h434
-rw-r--r--include/linux/patchkey.h4
-rw-r--r--include/linux/pmu.h4
-rw-r--r--include/linux/ptrace.h15
-rw-r--r--include/linux/quota.h6
-rw-r--r--include/linux/res_counter.h11
-rw-r--r--include/linux/sched.h2
-rw-r--r--include/linux/security.h60
-rw-r--r--include/linux/serial_core.h4
-rw-r--r--include/linux/sh_dma.h4
-rw-r--r--include/linux/shmem_fs.h1
-rw-r--r--include/linux/sirfsoc_dma.h6
-rw-r--r--include/linux/snmp.h1
-rw-r--r--include/linux/sound.h4
-rw-r--r--include/linux/soundcard.h4
-rw-r--r--include/linux/sunrpc/svc_xprt.h3
-rw-r--r--include/linux/sunrpc/svcsock.h2
-rw-r--r--include/linux/suspend.h19
-rw-r--r--include/linux/swap.h2
-rw-r--r--include/linux/tty_driver.h1
-rw-r--r--include/linux/usb.h1
-rw-r--r--include/linux/videodev2.h58
-rw-r--r--include/linux/zorro_ids.h4
-rw-r--r--include/media/as3645a.h71
-rw-r--r--include/media/atmel-isi.h4
-rw-r--r--include/media/cx25840.h1
-rw-r--r--include/media/davinci/vpbe.h16
-rw-r--r--include/media/davinci/vpbe_venc.h4
-rw-r--r--include/media/media-entity.h2
-rw-r--r--include/media/omap3isp.h2
-rw-r--r--include/media/pwc-ioctl.h323
-rw-r--r--include/media/rc-map.h10
-rw-r--r--include/media/soc_camera.h2
-rw-r--r--include/media/tuner.h3
-rw-r--r--include/media/v4l2-ioctl.h4
-rw-r--r--include/net/bluetooth/bluetooth.h2
-rw-r--r--include/net/bluetooth/hci.h2
-rw-r--r--include/net/bluetooth/hci_core.h6
-rw-r--r--include/net/bluetooth/l2cap.h12
-rw-r--r--include/net/netns/generic.h1
-rw-r--r--include/net/netprio_cgroup.h1
-rw-r--r--include/net/sock.h14
-rw-r--r--include/net/tcp.h2
-rw-r--r--include/scsi/libfc.h2
-rw-r--r--include/target/target_core_backend.h65
-rw-r--r--include/target/target_core_base.h169
-rw-r--r--include/target/target_core_device.h63
-rw-r--r--include/target/target_core_fabric.h (renamed from include/target/target_core_fabric_ops.h)94
-rw-r--r--include/target/target_core_fabric_lib.h28
-rw-r--r--include/target/target_core_tmr.h35
-rw-r--r--include/target/target_core_tpg.h35
-rw-r--r--include/target/target_core_transport.h287
-rw-r--r--include/trace/events/btrfs.h203
-rw-r--r--include/video/edid.h6
-rw-r--r--include/video/omapdss.h58
-rw-r--r--include/video/sh_mipi_dsi.h21
-rw-r--r--include/video/sh_mobile_lcdc.h4
-rw-r--r--include/xen/interface/io/blkif.h40
143 files changed, 3809 insertions, 1260 deletions
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index fc1575fd4596..5b5af0d30a97 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -58,6 +58,7 @@
58#define METHOD_NAME__PRT "_PRT" 58#define METHOD_NAME__PRT "_PRT"
59#define METHOD_NAME__CRS "_CRS" 59#define METHOD_NAME__CRS "_CRS"
60#define METHOD_NAME__PRS "_PRS" 60#define METHOD_NAME__PRS "_PRS"
61#define METHOD_NAME__AEI "_AEI"
61#define METHOD_NAME__PRW "_PRW" 62#define METHOD_NAME__PRW "_PRW"
62#define METHOD_NAME__SRS "_SRS" 63#define METHOD_NAME__SRS "_SRS"
63 64
diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h
index 173972672175..451823cb8837 100644
--- a/include/acpi/acpi_numa.h
+++ b/include/acpi/acpi_numa.h
@@ -15,6 +15,7 @@ extern int pxm_to_node(int);
15extern int node_to_pxm(int); 15extern int node_to_pxm(int);
16extern void __acpi_map_pxm_to_node(int, int); 16extern void __acpi_map_pxm_to_node(int, int);
17extern int acpi_map_pxm_to_node(int); 17extern int acpi_map_pxm_to_node(int);
18extern unsigned char acpi_srat_revision;
18 19
19#endif /* CONFIG_ACPI_NUMA */ 20#endif /* CONFIG_ACPI_NUMA */
20#endif /* __ACP_NUMA_H */ 21#endif /* __ACP_NUMA_H */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 83062ed0ef2f..2fe8639b3ae7 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -238,13 +238,6 @@ acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id,
238/* 238/*
239 * Miscellaneous 239 * Miscellaneous
240 */ 240 */
241acpi_status
242acpi_os_validate_address(u8 space_id, acpi_physical_address address,
243 acpi_size length, char *name);
244acpi_status
245acpi_os_invalidate_address(u8 space_id, acpi_physical_address address,
246 acpi_size length);
247
248u64 acpi_os_get_timer(void); 241u64 acpi_os_get_timer(void);
249 242
250acpi_status acpi_os_signal(u32 function, void *info); 243acpi_status acpi_os_signal(u32 function, void *info);
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index f554a9313b43..a28da35ba45e 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 0x20110623 50#define ACPI_CA_VERSION 0x20120111
51 51
52#include "actypes.h" 52#include "actypes.h"
53#include "actbl.h" 53#include "actbl.h"
@@ -66,7 +66,7 @@ extern u8 acpi_gbl_create_osi_method;
66extern u8 acpi_gbl_use_default_register_widths; 66extern u8 acpi_gbl_use_default_register_widths;
67extern acpi_name acpi_gbl_trace_method_name; 67extern acpi_name acpi_gbl_trace_method_name;
68extern u32 acpi_gbl_trace_flags; 68extern u32 acpi_gbl_trace_flags;
69extern u32 acpi_gbl_enable_aml_debug_object; 69extern bool acpi_gbl_enable_aml_debug_object;
70extern u8 acpi_gbl_copy_dsdt_locally; 70extern u8 acpi_gbl_copy_dsdt_locally;
71extern u8 acpi_gbl_truncate_io_addresses; 71extern u8 acpi_gbl_truncate_io_addresses;
72extern u8 acpi_gbl_disable_auto_repair; 72extern u8 acpi_gbl_disable_auto_repair;
@@ -74,6 +74,7 @@ extern u8 acpi_gbl_disable_auto_repair;
74extern u32 acpi_current_gpe_count; 74extern u32 acpi_current_gpe_count;
75extern struct acpi_table_fadt acpi_gbl_FADT; 75extern struct acpi_table_fadt acpi_gbl_FADT;
76extern u8 acpi_gbl_system_awake_and_running; 76extern u8 acpi_gbl_system_awake_and_running;
77extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */
77 78
78extern u32 acpi_rsdt_forced; 79extern u32 acpi_rsdt_forced;
79/* 80/*
@@ -111,6 +112,11 @@ acpi_status acpi_install_interface(acpi_string interface_name);
111 112
112acpi_status acpi_remove_interface(acpi_string interface_name); 113acpi_status acpi_remove_interface(acpi_string interface_name);
113 114
115u32
116acpi_check_address_range(acpi_adr_space_type space_id,
117 acpi_physical_address address,
118 acpi_size length, u8 warn);
119
114/* 120/*
115 * ACPI Memory management 121 * ACPI Memory management
116 */ 122 */
@@ -276,12 +282,23 @@ acpi_status acpi_install_exception_handler(acpi_exception_handler handler);
276acpi_status acpi_install_interface_handler(acpi_interface_handler handler); 282acpi_status acpi_install_interface_handler(acpi_interface_handler handler);
277 283
278/* 284/*
279 * Event interfaces 285 * Global Lock interfaces
280 */ 286 */
281acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle); 287acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle);
282 288
283acpi_status acpi_release_global_lock(u32 handle); 289acpi_status acpi_release_global_lock(u32 handle);
284 290
291/*
292 * Interfaces to AML mutex objects
293 */
294acpi_status
295acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout);
296
297acpi_status acpi_release_mutex(acpi_handle handle, acpi_string pathname);
298
299/*
300 * Fixed Event interfaces
301 */
285acpi_status acpi_enable_event(u32 event, u32 flags); 302acpi_status acpi_enable_event(u32 event, u32 flags);
286 303
287acpi_status acpi_disable_event(u32 event, u32 flags); 304acpi_status acpi_disable_event(u32 event, u32 flags);
@@ -291,7 +308,7 @@ acpi_status acpi_clear_event(u32 event);
291acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); 308acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status);
292 309
293/* 310/*
294 * GPE Interfaces 311 * General Purpose Event (GPE) Interfaces
295 */ 312 */
296acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number); 313acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number);
297 314
@@ -346,6 +363,10 @@ acpi_get_possible_resources(acpi_handle device, struct acpi_buffer *ret_buffer);
346#endif 363#endif
347 364
348acpi_status 365acpi_status
366acpi_get_event_resources(acpi_handle device_handle,
367 struct acpi_buffer *ret_buffer);
368
369acpi_status
349acpi_walk_resources(acpi_handle device, 370acpi_walk_resources(acpi_handle device,
350 char *name, 371 char *name,
351 acpi_walk_resource_callback user_function, void *context); 372 acpi_walk_resource_callback user_function, void *context);
@@ -360,6 +381,11 @@ acpi_status
360acpi_resource_to_address64(struct acpi_resource *resource, 381acpi_resource_to_address64(struct acpi_resource *resource,
361 struct acpi_resource_address64 *out); 382 struct acpi_resource_address64 *out);
362 383
384acpi_status
385acpi_buffer_to_resource(u8 *aml_buffer,
386 u16 aml_buffer_length,
387 struct acpi_resource **resource_ptr);
388
363/* 389/*
364 * Hardware (ACPI device) interfaces 390 * Hardware (ACPI device) interfaces
365 */ 391 */
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
index 0a66cc45dd6b..3506e39a66b1 100644
--- a/include/acpi/acrestyp.h
+++ b/include/acpi/acrestyp.h
@@ -61,11 +61,14 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (6
61#define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02 61#define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02
62#define ACPI_PREFETCHABLE_MEMORY (u8) 0x03 62#define ACPI_PREFETCHABLE_MEMORY (u8) 0x03
63 63
64/*! [Begin] no source code translation */
64/* 65/*
65 * IO Attributes 66 * IO Attributes
66 * The ISA IO ranges are: n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh. 67 * The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh.
67 * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh. 68 * The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh.
68 */ 69 */
70/*! [End] no source code translation !*/
71
69#define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01 72#define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01
70#define ACPI_ISA_ONLY_RANGES (u8) 0x02 73#define ACPI_ISA_ONLY_RANGES (u8) 0x02
71#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) 74#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
@@ -81,16 +84,26 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (6
81#define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */ 84#define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */
82 85
83/* 86/*
84 * IRQ Attributes 87 * Interrupt attributes - used in multiple descriptors
85 */ 88 */
89
90/* Triggering */
91
86#define ACPI_LEVEL_SENSITIVE (u8) 0x00 92#define ACPI_LEVEL_SENSITIVE (u8) 0x00
87#define ACPI_EDGE_SENSITIVE (u8) 0x01 93#define ACPI_EDGE_SENSITIVE (u8) 0x01
88 94
95/* Polarity */
96
89#define ACPI_ACTIVE_HIGH (u8) 0x00 97#define ACPI_ACTIVE_HIGH (u8) 0x00
90#define ACPI_ACTIVE_LOW (u8) 0x01 98#define ACPI_ACTIVE_LOW (u8) 0x01
99#define ACPI_ACTIVE_BOTH (u8) 0x02
100
101/* Sharing */
91 102
92#define ACPI_EXCLUSIVE (u8) 0x00 103#define ACPI_EXCLUSIVE (u8) 0x00
93#define ACPI_SHARED (u8) 0x01 104#define ACPI_SHARED (u8) 0x01
105#define ACPI_EXCLUSIVE_AND_WAKE (u8) 0x02
106#define ACPI_SHARED_AND_WAKE (u8) 0x03
94 107
95/* 108/*
96 * DMA Attributes 109 * DMA Attributes
@@ -127,6 +140,8 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (6
127#define ACPI_POS_DECODE (u8) 0x00 140#define ACPI_POS_DECODE (u8) 0x00
128#define ACPI_SUB_DECODE (u8) 0x01 141#define ACPI_SUB_DECODE (u8) 0x01
129 142
143/* Producer/Consumer */
144
130#define ACPI_PRODUCER (u8) 0x00 145#define ACPI_PRODUCER (u8) 0x00
131#define ACPI_CONSUMER (u8) 0x01 146#define ACPI_CONSUMER (u8) 0x01
132 147
@@ -192,6 +207,21 @@ struct acpi_resource_fixed_io {
192 u8 address_length; 207 u8 address_length;
193}; 208};
194 209
210struct acpi_resource_fixed_dma {
211 u16 request_lines;
212 u16 channels;
213 u8 width;
214};
215
216/* Values for Width field above */
217
218#define ACPI_DMA_WIDTH8 0
219#define ACPI_DMA_WIDTH16 1
220#define ACPI_DMA_WIDTH32 2
221#define ACPI_DMA_WIDTH64 3
222#define ACPI_DMA_WIDTH128 4
223#define ACPI_DMA_WIDTH256 5
224
195struct acpi_resource_vendor { 225struct acpi_resource_vendor {
196 u16 byte_length; 226 u16 byte_length;
197 u8 byte_data[1]; 227 u8 byte_data[1];
@@ -329,6 +359,166 @@ struct acpi_resource_generic_register {
329 u64 address; 359 u64 address;
330}; 360};
331 361
362struct acpi_resource_gpio {
363 u8 revision_id;
364 u8 connection_type;
365 u8 producer_consumer; /* For values, see Producer/Consumer above */
366 u8 pin_config;
367 u8 sharable; /* For values, see Interrupt Attributes above */
368 u8 io_restriction;
369 u8 triggering; /* For values, see Interrupt Attributes above */
370 u8 polarity; /* For values, see Interrupt Attributes above */
371 u16 drive_strength;
372 u16 debounce_timeout;
373 u16 pin_table_length;
374 u16 vendor_length;
375 struct acpi_resource_source resource_source;
376 u16 *pin_table;
377 u8 *vendor_data;
378};
379
380/* Values for GPIO connection_type field above */
381
382#define ACPI_RESOURCE_GPIO_TYPE_INT 0
383#define ACPI_RESOURCE_GPIO_TYPE_IO 1
384
385/* Values for pin_config field above */
386
387#define ACPI_PIN_CONFIG_DEFAULT 0
388#define ACPI_PIN_CONFIG_PULLUP 1
389#define ACPI_PIN_CONFIG_PULLDOWN 2
390#define ACPI_PIN_CONFIG_NOPULL 3
391
392/* Values for io_restriction field above */
393
394#define ACPI_IO_RESTRICT_NONE 0
395#define ACPI_IO_RESTRICT_INPUT 1
396#define ACPI_IO_RESTRICT_OUTPUT 2
397#define ACPI_IO_RESTRICT_NONE_PRESERVE 3
398
399/* Common structure for I2C, SPI, and UART serial descriptors */
400
401#define ACPI_RESOURCE_SERIAL_COMMON \
402 u8 revision_id; \
403 u8 type; \
404 u8 producer_consumer; /* For values, see Producer/Consumer above */\
405 u8 slave_mode; \
406 u8 type_revision_id; \
407 u16 type_data_length; \
408 u16 vendor_length; \
409 struct acpi_resource_source resource_source; \
410 u8 *vendor_data;
411
412struct acpi_resource_common_serialbus {
413ACPI_RESOURCE_SERIAL_COMMON};
414
415/* Values for the Type field above */
416
417#define ACPI_RESOURCE_SERIAL_TYPE_I2C 1
418#define ACPI_RESOURCE_SERIAL_TYPE_SPI 2
419#define ACPI_RESOURCE_SERIAL_TYPE_UART 3
420
421/* Values for slave_mode field above */
422
423#define ACPI_CONTROLLER_INITIATED 0
424#define ACPI_DEVICE_INITIATED 1
425
426struct acpi_resource_i2c_serialbus {
427 ACPI_RESOURCE_SERIAL_COMMON u8 access_mode;
428 u16 slave_address;
429 u32 connection_speed;
430};
431
432/* Values for access_mode field above */
433
434#define ACPI_I2C_7BIT_MODE 0
435#define ACPI_I2C_10BIT_MODE 1
436
437struct acpi_resource_spi_serialbus {
438 ACPI_RESOURCE_SERIAL_COMMON u8 wire_mode;
439 u8 device_polarity;
440 u8 data_bit_length;
441 u8 clock_phase;
442 u8 clock_polarity;
443 u16 device_selection;
444 u32 connection_speed;
445};
446
447/* Values for wire_mode field above */
448
449#define ACPI_SPI_4WIRE_MODE 0
450#define ACPI_SPI_3WIRE_MODE 1
451
452/* Values for device_polarity field above */
453
454#define ACPI_SPI_ACTIVE_LOW 0
455#define ACPI_SPI_ACTIVE_HIGH 1
456
457/* Values for clock_phase field above */
458
459#define ACPI_SPI_FIRST_PHASE 0
460#define ACPI_SPI_SECOND_PHASE 1
461
462/* Values for clock_polarity field above */
463
464#define ACPI_SPI_START_LOW 0
465#define ACPI_SPI_START_HIGH 1
466
467struct acpi_resource_uart_serialbus {
468 ACPI_RESOURCE_SERIAL_COMMON u8 endian;
469 u8 data_bits;
470 u8 stop_bits;
471 u8 flow_control;
472 u8 parity;
473 u8 lines_enabled;
474 u16 rx_fifo_size;
475 u16 tx_fifo_size;
476 u32 default_baud_rate;
477};
478
479/* Values for Endian field above */
480
481#define ACPI_UART_LITTLE_ENDIAN 0
482#define ACPI_UART_BIG_ENDIAN 1
483
484/* Values for data_bits field above */
485
486#define ACPI_UART_5_DATA_BITS 0
487#define ACPI_UART_6_DATA_BITS 1
488#define ACPI_UART_7_DATA_BITS 2
489#define ACPI_UART_8_DATA_BITS 3
490#define ACPI_UART_9_DATA_BITS 4
491
492/* Values for stop_bits field above */
493
494#define ACPI_UART_NO_STOP_BITS 0
495#define ACPI_UART_1_STOP_BIT 1
496#define ACPI_UART_1P5_STOP_BITS 2
497#define ACPI_UART_2_STOP_BITS 3
498
499/* Values for flow_control field above */
500
501#define ACPI_UART_FLOW_CONTROL_NONE 0
502#define ACPI_UART_FLOW_CONTROL_HW 1
503#define ACPI_UART_FLOW_CONTROL_XON_XOFF 2
504
505/* Values for Parity field above */
506
507#define ACPI_UART_PARITY_NONE 0
508#define ACPI_UART_PARITY_EVEN 1
509#define ACPI_UART_PARITY_ODD 2
510#define ACPI_UART_PARITY_MARK 3
511#define ACPI_UART_PARITY_SPACE 4
512
513/* Values for lines_enabled bitfield above */
514
515#define ACPI_UART_CARRIER_DETECT (1<<2)
516#define ACPI_UART_RING_INDICATOR (1<<3)
517#define ACPI_UART_DATA_SET_READY (1<<4)
518#define ACPI_UART_DATA_TERMINAL_READY (1<<5)
519#define ACPI_UART_CLEAR_TO_SEND (1<<6)
520#define ACPI_UART_REQUEST_TO_SEND (1<<7)
521
332/* ACPI_RESOURCE_TYPEs */ 522/* ACPI_RESOURCE_TYPEs */
333 523
334#define ACPI_RESOURCE_TYPE_IRQ 0 524#define ACPI_RESOURCE_TYPE_IRQ 0
@@ -348,7 +538,10 @@ struct acpi_resource_generic_register {
348#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */ 538#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */
349#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15 539#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
350#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16 540#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
351#define ACPI_RESOURCE_TYPE_MAX 16 541#define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */
542#define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */
543#define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */
544#define ACPI_RESOURCE_TYPE_MAX 19
352 545
353/* Master union for resource descriptors */ 546/* Master union for resource descriptors */
354 547
@@ -358,6 +551,7 @@ union acpi_resource_data {
358 struct acpi_resource_start_dependent start_dpf; 551 struct acpi_resource_start_dependent start_dpf;
359 struct acpi_resource_io io; 552 struct acpi_resource_io io;
360 struct acpi_resource_fixed_io fixed_io; 553 struct acpi_resource_fixed_io fixed_io;
554 struct acpi_resource_fixed_dma fixed_dma;
361 struct acpi_resource_vendor vendor; 555 struct acpi_resource_vendor vendor;
362 struct acpi_resource_vendor_typed vendor_typed; 556 struct acpi_resource_vendor_typed vendor_typed;
363 struct acpi_resource_end_tag end_tag; 557 struct acpi_resource_end_tag end_tag;
@@ -370,6 +564,11 @@ union acpi_resource_data {
370 struct acpi_resource_extended_address64 ext_address64; 564 struct acpi_resource_extended_address64 ext_address64;
371 struct acpi_resource_extended_irq extended_irq; 565 struct acpi_resource_extended_irq extended_irq;
372 struct acpi_resource_generic_register generic_reg; 566 struct acpi_resource_generic_register generic_reg;
567 struct acpi_resource_gpio gpio;
568 struct acpi_resource_i2c_serialbus i2c_serial_bus;
569 struct acpi_resource_spi_serialbus spi_serial_bus;
570 struct acpi_resource_uart_serialbus uart_serial_bus;
571 struct acpi_resource_common_serialbus common_serial_bus;
373 572
374 /* Common fields */ 573 /* Common fields */
375 574
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index f1380287ed4d..8e1b92f6f650 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -255,6 +255,8 @@ struct acpi_table_fadt {
255 struct acpi_generic_address xpm_timer_block; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ 255 struct acpi_generic_address xpm_timer_block; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
256 struct acpi_generic_address xgpe0_block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */ 256 struct acpi_generic_address xgpe0_block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */
257 struct acpi_generic_address xgpe1_block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */ 257 struct acpi_generic_address xgpe1_block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */
258 struct acpi_generic_address sleep_control; /* 64-bit Sleep Control register */
259 struct acpi_generic_address sleep_status; /* 64-bit Sleep Status register */
258}; 260};
259 261
260/* Masks for FADT Boot Architecture Flags (boot_flags) */ 262/* Masks for FADT Boot Architecture Flags (boot_flags) */
@@ -264,6 +266,7 @@ struct acpi_table_fadt {
264#define ACPI_FADT_NO_VGA (1<<2) /* 02: [V4] It is not safe to probe for VGA hardware */ 266#define ACPI_FADT_NO_VGA (1<<2) /* 02: [V4] It is not safe to probe for VGA hardware */
265#define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */ 267#define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */
266#define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */ 268#define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */
269#define ACPI_FADT_NO_CMOS_RTC (1<<5) /* 05: [V5] No CMOS real-time clock present */
267 270
268#define FADT2_REVISION_ID 3 271#define FADT2_REVISION_ID 3
269 272
@@ -289,6 +292,8 @@ struct acpi_table_fadt {
289#define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */ 292#define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */
290#define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */ 293#define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */
291#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local x_aPICs must use physical dest mode (ACPI 3.0) */ 294#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local x_aPICs must use physical dest mode (ACPI 3.0) */
295#define ACPI_FADT_HW_REDUCED (1<<20) /* 20: [V5] ACPI hardware is not implemented (ACPI 5.0) */
296#define ACPI_FADT_LOW_POWER_S0 (1<<21) /* 21: [V5] S0 power savings are equal or better than S3 (ACPI 5.0) */
292 297
293/* Values for preferred_profile (Preferred Power Management Profiles) */ 298/* Values for preferred_profile (Preferred Power Management Profiles) */
294 299
@@ -299,14 +304,16 @@ enum acpi_prefered_pm_profiles {
299 PM_WORKSTATION = 3, 304 PM_WORKSTATION = 3,
300 PM_ENTERPRISE_SERVER = 4, 305 PM_ENTERPRISE_SERVER = 4,
301 PM_SOHO_SERVER = 5, 306 PM_SOHO_SERVER = 5,
302 PM_APPLIANCE_PC = 6 307 PM_APPLIANCE_PC = 6,
308 PM_PERFORMANCE_SERVER = 7,
309 PM_TABLET = 8
303}; 310};
304 311
305/* Reset to default packing */ 312/* Reset to default packing */
306 313
307#pragma pack() 314#pragma pack()
308 315
309#define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_fadt, f) 316#define ACPI_FADT_OFFSET(f) (u16) ACPI_OFFSET (struct acpi_table_fadt, f)
310 317
311/* 318/*
312 * Internal table-related structures 319 * Internal table-related structures
@@ -342,6 +349,7 @@ struct acpi_table_desc {
342 349
343#include <acpi/actbl1.h> 350#include <acpi/actbl1.h>
344#include <acpi/actbl2.h> 351#include <acpi/actbl2.h>
352#include <acpi/actbl3.h>
345 353
346/* 354/*
347 * Sizes of the various flavors of FADT. We need to look closely 355 * Sizes of the various flavors of FADT. We need to look closely
@@ -351,12 +359,15 @@ struct acpi_table_desc {
351 * FADT is the bottom line as to what the version really is. 359 * FADT is the bottom line as to what the version really is.
352 * 360 *
353 * For reference, the values below are as follows: 361 * For reference, the values below are as follows:
354 * FADT V1 size: 0x74 362 * FADT V1 size: 0x074
355 * FADT V2 size: 0x84 363 * FADT V2 size: 0x084
356 * FADT V3+ size: 0xF4 364 * FADT V3 size: 0x0F4
365 * FADT V4 size: 0x0F4
366 * FADT V5 size: 0x10C
357 */ 367 */
358#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4) 368#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4)
359#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3) 369#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3)
360#define ACPI_FADT_V3_SIZE (u32) (sizeof (struct acpi_table_fadt)) 370#define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control))
371#define ACPI_FADT_V5_SIZE (u32) (sizeof (struct acpi_table_fadt))
361 372
362#endif /* __ACTBL_H__ */ 373#endif /* __ACTBL_H__ */
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 7504bc99b29b..71e747beac8f 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -228,7 +228,8 @@ enum acpi_einj_actions {
228 ACPI_EINJ_EXECUTE_OPERATION = 5, 228 ACPI_EINJ_EXECUTE_OPERATION = 5,
229 ACPI_EINJ_CHECK_BUSY_STATUS = 6, 229 ACPI_EINJ_CHECK_BUSY_STATUS = 6,
230 ACPI_EINJ_GET_COMMAND_STATUS = 7, 230 ACPI_EINJ_GET_COMMAND_STATUS = 7,
231 ACPI_EINJ_ACTION_RESERVED = 8, /* 8 and greater are reserved */ 231 ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
232 ACPI_EINJ_ACTION_RESERVED = 9, /* 9 and greater are reserved */
232 ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ 233 ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
233}; 234};
234 235
@@ -240,7 +241,27 @@ enum acpi_einj_instructions {
240 ACPI_EINJ_WRITE_REGISTER = 2, 241 ACPI_EINJ_WRITE_REGISTER = 2,
241 ACPI_EINJ_WRITE_REGISTER_VALUE = 3, 242 ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
242 ACPI_EINJ_NOOP = 4, 243 ACPI_EINJ_NOOP = 4,
243 ACPI_EINJ_INSTRUCTION_RESERVED = 5 /* 5 and greater are reserved */ 244 ACPI_EINJ_FLUSH_CACHELINE = 5,
245 ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
246};
247
248struct acpi_einj_error_type_with_addr {
249 u32 error_type;
250 u32 vendor_struct_offset;
251 u32 flags;
252 u32 apic_id;
253 u64 address;
254 u64 range;
255 u32 pcie_id;
256};
257
258struct acpi_einj_vendor {
259 u32 length;
260 u32 pcie_id;
261 u16 vendor_id;
262 u16 device_id;
263 u8 revision_id;
264 u8 reserved[3];
244}; 265};
245 266
246/* EINJ Trigger Error Action Table */ 267/* EINJ Trigger Error Action Table */
@@ -275,6 +296,7 @@ enum acpi_einj_command_status {
275#define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9) 296#define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
276#define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10) 297#define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
277#define ACPI_EINJ_PLATFORM_FATAL (1<<11) 298#define ACPI_EINJ_PLATFORM_FATAL (1<<11)
299#define ACPI_EINJ_VENDOR_DEFINED (1<<31)
278 300
279/******************************************************************************* 301/*******************************************************************************
280 * 302 *
@@ -631,7 +653,9 @@ enum acpi_madt_type {
631 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, 653 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
632 ACPI_MADT_TYPE_LOCAL_X2APIC = 9, 654 ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
633 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, 655 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
634 ACPI_MADT_TYPE_RESERVED = 11 /* 11 and greater are reserved */ 656 ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
657 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
658 ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */
635}; 659};
636 660
637/* 661/*
@@ -752,11 +776,36 @@ struct acpi_madt_local_x2apic_nmi {
752 u8 reserved[3]; 776 u8 reserved[3];
753}; 777};
754 778
779/* 11: Generic Interrupt (ACPI 5.0) */
780
781struct acpi_madt_generic_interrupt {
782 struct acpi_subtable_header header;
783 u16 reserved; /* Reserved - must be zero */
784 u32 gic_id;
785 u32 uid;
786 u32 flags;
787 u32 parking_version;
788 u32 performance_interrupt;
789 u64 parked_address;
790 u64 base_address;
791};
792
793/* 12: Generic Distributor (ACPI 5.0) */
794
795struct acpi_madt_generic_distributor {
796 struct acpi_subtable_header header;
797 u16 reserved; /* Reserved - must be zero */
798 u32 gic_id;
799 u64 base_address;
800 u32 global_irq_base;
801 u32 reserved2; /* Reserved - must be zero */
802};
803
755/* 804/*
756 * Common flags fields for MADT subtables 805 * Common flags fields for MADT subtables
757 */ 806 */
758 807
759/* MADT Local APIC flags (lapic_flags) */ 808/* MADT Local APIC flags (lapic_flags) and GIC flags */
760 809
761#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ 810#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
762 811
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
new file mode 100644
index 000000000000..c22ce80e9535
--- /dev/null
+++ b/include/acpi/actbl3.h
@@ -0,0 +1,552 @@
1/******************************************************************************
2 *
3 * Name: actbl3.h - ACPI Table Definitions
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2011, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#ifndef __ACTBL3_H__
45#define __ACTBL3_H__
46
47/*******************************************************************************
48 *
49 * Additional ACPI Tables (3)
50 *
51 * These tables are not consumed directly by the ACPICA subsystem, but are
52 * included here to support device drivers and the AML disassembler.
53 *
54 * The tables in this file are fully defined within the ACPI specification.
55 *
56 ******************************************************************************/
57
58/*
59 * Values for description table header signatures for tables defined in this
60 * file. Useful because they make it more difficult to inadvertently type in
61 * the wrong signature.
62 */
63#define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */
64#define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for Measurement table */
65#define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table */
66#define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table */
67#define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
68#define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */
69#define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */
70#define ACPI_SIG_RASF "RASF" /* RAS Feature table */
71
72#define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */
73#define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */
74
75/* Reserved table signatures */
76
77#define ACPI_SIG_CSRT "CSRT" /* Core System Resources Table */
78#define ACPI_SIG_DBG2 "DBG2" /* Debug Port table 2 */
79#define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */
80#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
81#define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */
82
83/*
84 * All tables must be byte-packed to match the ACPI specification, since
85 * the tables are provided by the system BIOS.
86 */
87#pragma pack(1)
88
89/*
90 * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
91 * This is the only type that is even remotely portable. Anything else is not
92 * portable, so do not use any other bitfield types.
93 */
94
95/*******************************************************************************
96 *
97 * BGRT - Boot Graphics Resource Table (ACPI 5.0)
98 * Version 1
99 *
100 ******************************************************************************/
101
102struct acpi_table_bgrt {
103 struct acpi_table_header header; /* Common ACPI table header */
104 u16 version;
105 u8 status;
106 u8 image_type;
107 u64 image_address;
108 u32 image_offset_x;
109 u32 image_offset_y;
110};
111
112/*******************************************************************************
113 *
114 * DRTM - Dynamic Root of Trust for Measurement table
115 *
116 ******************************************************************************/
117
118struct acpi_table_drtm {
119 struct acpi_table_header header; /* Common ACPI table header */
120 u64 entry_base_address;
121 u64 entry_length;
122 u32 entry_address32;
123 u64 entry_address64;
124 u64 exit_address;
125 u64 log_area_address;
126 u32 log_area_length;
127 u64 arch_dependent_address;
128 u32 flags;
129};
130
131/* 1) Validated Tables List */
132
133struct acpi_drtm_vtl_list {
134 u32 validated_table_list_count;
135};
136
137/* 2) Resources List */
138
139struct acpi_drtm_resource_list {
140 u32 resource_list_count;
141};
142
143/* 3) Platform-specific Identifiers List */
144
145struct acpi_drtm_id_list {
146 u32 id_list_count;
147};
148
149/*******************************************************************************
150 *
151 * FPDT - Firmware Performance Data Table (ACPI 5.0)
152 * Version 1
153 *
154 ******************************************************************************/
155
156struct acpi_table_fpdt {
157 struct acpi_table_header header; /* Common ACPI table header */
158};
159
160/* FPDT subtable header */
161
162struct acpi_fpdt_header {
163 u16 type;
164 u8 length;
165 u8 revision;
166};
167
168/* Values for Type field above */
169
170enum acpi_fpdt_type {
171 ACPI_FPDT_TYPE_BOOT = 0,
172 ACPI_FPDT_TYPE_S3PERF = 1,
173};
174
175/*
176 * FPDT subtables
177 */
178
179/* 0: Firmware Basic Boot Performance Record */
180
181struct acpi_fpdt_boot {
182 struct acpi_fpdt_header header;
183 u8 reserved[4];
184 u64 reset_end;
185 u64 load_start;
186 u64 startup_start;
187 u64 exit_services_entry;
188 u64 exit_services_exit;
189};
190
191/* 1: S3 Performance Table Pointer Record */
192
193struct acpi_fpdt_s3pt_ptr {
194 struct acpi_fpdt_header header;
195 u8 reserved[4];
196 u64 address;
197};
198
199/*
200 * S3PT - S3 Performance Table. This table is pointed to by the
201 * FPDT S3 Pointer Record above.
202 */
203struct acpi_table_s3pt {
204 u8 signature[4]; /* "S3PT" */
205 u32 length;
206};
207
208/*
209 * S3PT Subtables
210 */
211struct acpi_s3pt_header {
212 u16 type;
213 u8 length;
214 u8 revision;
215};
216
217/* Values for Type field above */
218
219enum acpi_s3pt_type {
220 ACPI_S3PT_TYPE_RESUME = 0,
221 ACPI_S3PT_TYPE_SUSPEND = 1,
222};
223
224struct acpi_s3pt_resume {
225 struct acpi_s3pt_header header;
226 u32 resume_count;
227 u64 full_resume;
228 u64 average_resume;
229};
230
231struct acpi_s3pt_suspend {
232 struct acpi_s3pt_header header;
233 u64 suspend_start;
234 u64 suspend_end;
235};
236
237/*******************************************************************************
238 *
239 * GTDT - Generic Timer Description Table (ACPI 5.0)
240 * Version 1
241 *
242 ******************************************************************************/
243
244struct acpi_table_gtdt {
245 struct acpi_table_header header; /* Common ACPI table header */
246 u64 address;
247 u32 flags;
248 u32 secure_pl1_interrupt;
249 u32 secure_pl1_flags;
250 u32 non_secure_pl1_interrupt;
251 u32 non_secure_pl1_flags;
252 u32 virtual_timer_interrupt;
253 u32 virtual_timer_flags;
254 u32 non_secure_pl2_interrupt;
255 u32 non_secure_pl2_flags;
256};
257
258/* Values for Flags field above */
259
260#define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1
261
262/* Values for all "TimerFlags" fields above */
263
264#define ACPI_GTDT_INTERRUPT_MODE 1
265#define ACPI_GTDT_INTERRUPT_POLARITY 2
266
267/*******************************************************************************
268 *
269 * MPST - Memory Power State Table (ACPI 5.0)
270 * Version 1
271 *
272 ******************************************************************************/
273
274#define ACPI_MPST_CHANNEL_INFO \
275 u16 reserved1; \
276 u8 channel_id; \
277 u8 reserved2; \
278 u16 power_node_count;
279
280/* Main table */
281
282struct acpi_table_mpst {
283 struct acpi_table_header header; /* Common ACPI table header */
284 ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
285};
286
287/* Memory Platform Communication Channel Info */
288
289struct acpi_mpst_channel {
290 ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
291};
292
293/* Memory Power Node Structure */
294
295struct acpi_mpst_power_node {
296 u8 flags;
297 u8 reserved1;
298 u16 node_id;
299 u32 length;
300 u64 range_address;
301 u64 range_length;
302 u8 num_power_states;
303 u8 num_physical_components;
304 u16 reserved2;
305};
306
307/* Values for Flags field above */
308
309#define ACPI_MPST_ENABLED 1
310#define ACPI_MPST_POWER_MANAGED 2
311#define ACPI_MPST_HOT_PLUG_CAPABLE 4
312
313/* Memory Power State Structure (follows POWER_NODE above) */
314
315struct acpi_mpst_power_state {
316 u8 power_state;
317 u8 info_index;
318};
319
320/* Physical Component ID Structure (follows POWER_STATE above) */
321
322struct acpi_mpst_component {
323 u16 component_id;
324};
325
326/* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
327
328struct acpi_mpst_data_hdr {
329 u16 characteristics_count;
330};
331
332struct acpi_mpst_power_data {
333 u8 revision;
334 u8 flags;
335 u16 reserved1;
336 u32 average_power;
337 u32 power_saving;
338 u64 exit_latency;
339 u64 reserved2;
340};
341
342/* Values for Flags field above */
343
344#define ACPI_MPST_PRESERVE 1
345#define ACPI_MPST_AUTOENTRY 2
346#define ACPI_MPST_AUTOEXIT 4
347
348/* Shared Memory Region (not part of an ACPI table) */
349
350struct acpi_mpst_shared {
351 u32 signature;
352 u16 pcc_command;
353 u16 pcc_status;
354 u16 command_register;
355 u16 status_register;
356 u16 power_state_id;
357 u16 power_node_id;
358 u64 energy_consumed;
359 u64 average_power;
360};
361
362/*******************************************************************************
363 *
364 * PCCT - Platform Communications Channel Table (ACPI 5.0)
365 * Version 1
366 *
367 ******************************************************************************/
368
369struct acpi_table_pcct {
370 struct acpi_table_header header; /* Common ACPI table header */
371 u32 flags;
372 u32 latency;
373 u32 reserved;
374};
375
376/* Values for Flags field above */
377
378#define ACPI_PCCT_DOORBELL 1
379
380/*
381 * PCCT subtables
382 */
383
384/* 0: Generic Communications Subspace */
385
386struct acpi_pcct_subspace {
387 struct acpi_subtable_header header;
388 u8 reserved[6];
389 u64 base_address;
390 u64 length;
391 struct acpi_generic_address doorbell_register;
392 u64 preserve_mask;
393 u64 write_mask;
394};
395
396/*
397 * PCC memory structures (not part of the ACPI table)
398 */
399
400/* Shared Memory Region */
401
402struct acpi_pcct_shared_memory {
403 u32 signature;
404 u16 command;
405 u16 status;
406};
407
408/*******************************************************************************
409 *
410 * PMTT - Platform Memory Topology Table (ACPI 5.0)
411 * Version 1
412 *
413 ******************************************************************************/
414
415struct acpi_table_pmtt {
416 struct acpi_table_header header; /* Common ACPI table header */
417 u32 reserved;
418};
419
420/* Common header for PMTT subtables that follow main table */
421
422struct acpi_pmtt_header {
423 u8 type;
424 u8 reserved1;
425 u16 length;
426 u16 flags;
427 u16 reserved2;
428};
429
430/* Values for Type field above */
431
432#define ACPI_PMTT_TYPE_SOCKET 0
433#define ACPI_PMTT_TYPE_CONTROLLER 1
434#define ACPI_PMTT_TYPE_DIMM 2
435#define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */
436
437/* Values for Flags field above */
438
439#define ACPI_PMTT_TOP_LEVEL 0x0001
440#define ACPI_PMTT_PHYSICAL 0x0002
441#define ACPI_PMTT_MEMORY_TYPE 0x000C
442
443/*
444 * PMTT subtables, correspond to Type in struct acpi_pmtt_header
445 */
446
447/* 0: Socket Structure */
448
449struct acpi_pmtt_socket {
450 struct acpi_pmtt_header header;
451 u16 socket_id;
452 u16 reserved;
453};
454
455/* 1: Memory Controller subtable */
456
457struct acpi_pmtt_controller {
458 struct acpi_pmtt_header header;
459 u32 read_latency;
460 u32 write_latency;
461 u32 read_bandwidth;
462 u32 write_bandwidth;
463 u16 access_width;
464 u16 alignment;
465 u16 reserved;
466 u16 domain_count;
467};
468
469/* 1a: Proximity Domain substructure */
470
471struct acpi_pmtt_domain {
472 u32 proximity_domain;
473};
474
475/* 2: Physical Component Identifier (DIMM) */
476
477struct acpi_pmtt_physical_component {
478 struct acpi_pmtt_header header;
479 u16 component_id;
480 u16 reserved;
481 u32 memory_size;
482 u32 bios_handle;
483};
484
485/*******************************************************************************
486 *
487 * RASF - RAS Feature Table (ACPI 5.0)
488 * Version 1
489 *
490 ******************************************************************************/
491
492struct acpi_table_rasf {
493 struct acpi_table_header header; /* Common ACPI table header */
494 u8 channel_id[12];
495};
496
497/* RASF Platform Communication Channel Shared Memory Region */
498
499struct acpi_rasf_shared_memory {
500 u32 signature;
501 u16 command;
502 u16 status;
503 u64 requested_address;
504 u64 requested_length;
505 u64 actual_address;
506 u64 actual_length;
507 u16 flags;
508 u8 speed;
509};
510
511/* Masks for Flags and Speed fields above */
512
513#define ACPI_RASF_SCRUBBER_RUNNING 1
514#define ACPI_RASF_SPEED (7<<1)
515
516/* Channel Commands */
517
518enum acpi_rasf_commands {
519 ACPI_RASF_GET_RAS_CAPABILITIES = 1,
520 ACPI_RASF_GET_PATROL_PARAMETERS = 2,
521 ACPI_RASF_START_PATROL_SCRUBBER = 3,
522 ACPI_RASF_STOP_PATROL_SCRUBBER = 4
523};
524
525/* Channel Command flags */
526
527#define ACPI_RASF_GENERATE_SCI (1<<15)
528
529/* Status values */
530
531enum acpi_rasf_status {
532 ACPI_RASF_SUCCESS = 0,
533 ACPI_RASF_NOT_VALID = 1,
534 ACPI_RASF_NOT_SUPPORTED = 2,
535 ACPI_RASF_BUSY = 3,
536 ACPI_RASF_FAILED = 4,
537 ACPI_RASF_ABORTED = 5,
538 ACPI_RASF_INVALID_DATA = 6
539};
540
541/* Status flags */
542
543#define ACPI_RASF_COMMAND_COMPLETE (1)
544#define ACPI_RASF_SCI_DOORBELL (1<<1)
545#define ACPI_RASF_ERROR (1<<2)
546#define ACPI_RASF_STATUS (0x1F<<3)
547
548/* Reset to default packing */
549
550#pragma pack()
551
552#endif /* __ACTBL3_H__ */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index ed73f6705c86..d5dee7ce9474 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -712,8 +712,10 @@ typedef u8 acpi_adr_space_type;
712#define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5 712#define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5
713#define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6 713#define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6
714#define ACPI_ADR_SPACE_IPMI (acpi_adr_space_type) 7 714#define ACPI_ADR_SPACE_IPMI (acpi_adr_space_type) 7
715#define ACPI_ADR_SPACE_GPIO (acpi_adr_space_type) 8
716#define ACPI_ADR_SPACE_GSBUS (acpi_adr_space_type) 9
715 717
716#define ACPI_NUM_PREDEFINED_REGIONS 8 718#define ACPI_NUM_PREDEFINED_REGIONS 10
717 719
718/* 720/*
719 * Special Address Spaces 721 * Special Address Spaces
@@ -957,6 +959,14 @@ acpi_status(*acpi_adr_space_handler) (u32 function,
957 959
958#define ACPI_DEFAULT_HANDLER NULL 960#define ACPI_DEFAULT_HANDLER NULL
959 961
962/* Special Context data for generic_serial_bus/general_purpose_io (ACPI 5.0) */
963
964struct acpi_connection_info {
965 u8 *connection;
966 u16 length;
967 u8 access_length;
968};
969
960typedef 970typedef
961acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, 971acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle,
962 u32 function, 972 u32 function,
diff --git a/include/acpi/apei.h b/include/acpi/apei.h
index 51a527d24a8a..04f349d8da73 100644
--- a/include/acpi/apei.h
+++ b/include/acpi/apei.h
@@ -16,10 +16,10 @@
16 16
17#ifdef __KERNEL__ 17#ifdef __KERNEL__
18 18
19extern int hest_disable; 19extern bool hest_disable;
20extern int erst_disable; 20extern int erst_disable;
21#ifdef CONFIG_ACPI_APEI_GHES 21#ifdef CONFIG_ACPI_APEI_GHES
22extern int ghes_disable; 22extern bool ghes_disable;
23#else 23#else
24#define ghes_disable 1 24#define ghes_disable 1
25#endif 25#endif
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index d466c8d8826d..1ff4e221cb4d 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -177,6 +177,10 @@ extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *labe
177extern int gpio_request_array(const struct gpio *array, size_t num); 177extern int gpio_request_array(const struct gpio *array, size_t num);
178extern void gpio_free_array(const struct gpio *array, size_t num); 178extern void gpio_free_array(const struct gpio *array, size_t num);
179 179
180/* bindings for managed devices that want to request gpios */
181int devm_gpio_request(struct device *dev, unsigned gpio, const char *label);
182void devm_gpio_free(struct device *dev, unsigned int gpio);
183
180#ifdef CONFIG_GPIO_SYSFS 184#ifdef CONFIG_GPIO_SYSFS
181 185
182/* 186/*
diff --git a/include/asm-generic/param.h b/include/asm-generic/param.h
index cdf8251bfb6c..835632a3b468 100644
--- a/include/asm-generic/param.h
+++ b/include/asm-generic/param.h
@@ -1,12 +1,6 @@
1#ifndef __ASM_GENERIC_PARAM_H 1#ifndef __ASM_GENERIC_PARAM_H
2#define __ASM_GENERIC_PARAM_H 2#define __ASM_GENERIC_PARAM_H
3 3
4#ifdef __KERNEL__
5# define HZ CONFIG_HZ /* Internal kernel timer frequency */
6# define USER_HZ 100 /* some user interfaces are */
7# define CLOCKS_PER_SEC (USER_HZ) /* in "ticks" like times() */
8#endif
9
10#ifndef HZ 4#ifndef HZ
11#define HZ 100 5#define HZ 100
12#endif 6#endif
@@ -21,4 +15,11 @@
21 15
22#define MAXHOSTNAMELEN 64 /* max length of hostname */ 16#define MAXHOSTNAMELEN 64 /* max length of hostname */
23 17
18#ifdef __KERNEL__
19# undef HZ
20# define HZ CONFIG_HZ /* Internal kernel timer frequency */
21# define USER_HZ 100 /* some user interfaces are */
22# define CLOCKS_PER_SEC (USER_HZ) /* in "ticks" like times() */
23#endif
24
24#endif /* __ASM_GENERIC_PARAM_H */ 25#endif /* __ASM_GENERIC_PARAM_H */
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 63e4fce67288..4cd4be26722c 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -453,7 +453,7 @@ struct drm_encoder_funcs {
453#define DRM_CONNECTOR_MAX_UMODES 16 453#define DRM_CONNECTOR_MAX_UMODES 16
454#define DRM_CONNECTOR_MAX_PROPERTY 16 454#define DRM_CONNECTOR_MAX_PROPERTY 16
455#define DRM_CONNECTOR_LEN 32 455#define DRM_CONNECTOR_LEN 32
456#define DRM_CONNECTOR_MAX_ENCODER 2 456#define DRM_CONNECTOR_MAX_ENCODER 3
457 457
458/** 458/**
459 * drm_encoder - central DRM encoder structure 459 * drm_encoder - central DRM encoder structure
diff --git a/include/keys/user-type.h b/include/keys/user-type.h
index c37c34275a44..bc9ec1d7698c 100644
--- a/include/keys/user-type.h
+++ b/include/keys/user-type.h
@@ -17,7 +17,7 @@
17 17
18/*****************************************************************************/ 18/*****************************************************************************/
19/* 19/*
20 * the payload for a key of type "user" 20 * the payload for a key of type "user" or "logon"
21 * - once filled in and attached to a key: 21 * - once filled in and attached to a key:
22 * - the payload struct is invariant may not be changed, only replaced 22 * - the payload struct is invariant may not be changed, only replaced
23 * - the payload must be read with RCU procedures or with the key semaphore 23 * - the payload must be read with RCU procedures or with the key semaphore
@@ -33,6 +33,7 @@ struct user_key_payload {
33}; 33};
34 34
35extern struct key_type key_type_user; 35extern struct key_type key_type_user;
36extern struct key_type key_type_logon;
36 37
37extern int user_instantiate(struct key *key, const void *data, size_t datalen); 38extern int user_instantiate(struct key *key, const void *data, size_t datalen);
38extern int user_update(struct key *key, const void *data, size_t datalen); 39extern int user_update(struct key *key, const void *data, size_t datalen);
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 3e4737fa6cce..d537aa0ec414 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -146,6 +146,9 @@ extern void acct_exit_ns(struct pid_namespace *);
146 * 146 *
147 */ 147 */
148 148
149#undef ACCT_VERSION
150#undef AHZ
151
149#ifdef CONFIG_BSD_PROCESS_ACCT_V3 152#ifdef CONFIG_BSD_PROCESS_ACCT_V3
150#define ACCT_VERSION 3 153#define ACCT_VERSION 3
151#define AHZ 100 154#define AHZ 100
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 627a3a42e4d8..3f968665899b 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -310,6 +310,11 @@ extern acpi_status acpi_pci_osc_control_set(acpi_handle handle,
310 u32 *mask, u32 req); 310 u32 *mask, u32 req);
311extern void acpi_early_init(void); 311extern void acpi_early_init(void);
312 312
313extern int acpi_nvs_register(__u64 start, __u64 size);
314
315extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
316 void *data);
317
313#else /* !CONFIG_ACPI */ 318#else /* !CONFIG_ACPI */
314 319
315#define acpi_disabled 1 320#define acpi_disabled 1
@@ -352,15 +357,18 @@ static inline int acpi_table_parse(char *id,
352{ 357{
353 return -1; 358 return -1;
354} 359}
355#endif /* !CONFIG_ACPI */
356 360
357#ifdef CONFIG_ACPI_SLEEP 361static inline int acpi_nvs_register(__u64 start, __u64 size)
358int suspend_nvs_register(unsigned long start, unsigned long size);
359#else
360static inline int suspend_nvs_register(unsigned long a, unsigned long b)
361{ 362{
362 return 0; 363 return 0;
363} 364}
364#endif 365
366static inline int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
367 void *data)
368{
369 return 0;
370}
371
372#endif /* !CONFIG_ACPI */
365 373
366#endif /*_LINUX_ACPI_H*/ 374#endif /*_LINUX_ACPI_H*/
diff --git a/include/linux/acpi_io.h b/include/linux/acpi_io.h
index 4afd7102459d..b0ffa219993e 100644
--- a/include/linux/acpi_io.h
+++ b/include/linux/acpi_io.h
@@ -12,4 +12,7 @@ static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
12 12
13void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size); 13void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size);
14 14
15int acpi_os_map_generic_address(struct acpi_generic_address *addr);
16void acpi_os_unmap_generic_address(struct acpi_generic_address *addr);
17
15#endif 18#endif
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h
index 21114810c7c0..0101e9c17fa1 100644
--- a/include/linux/amba/mmci.h
+++ b/include/linux/amba/mmci.h
@@ -30,6 +30,7 @@ struct dma_chan;
30 * @cd_invert: true if the gpio_cd pin value is active low 30 * @cd_invert: true if the gpio_cd pin value is active low
31 * @capabilities: the capabilities of the block as implemented in 31 * @capabilities: the capabilities of the block as implemented in
32 * this platform, signify anything MMC_CAP_* from mmc/host.h 32 * this platform, signify anything MMC_CAP_* from mmc/host.h
33 * @capabilities2: more capabilities, MMC_CAP2_* from mmc/host.h
33 * @dma_filter: function used to select an appropriate RX and TX 34 * @dma_filter: function used to select an appropriate RX and TX
34 * DMA channel to be used for DMA, if and only if you're deploying the 35 * DMA channel to be used for DMA, if and only if you're deploying the
35 * generic DMA engine 36 * generic DMA engine
@@ -52,6 +53,7 @@ struct mmci_platform_data {
52 int gpio_cd; 53 int gpio_cd;
53 bool cd_invert; 54 bool cd_invert;
54 unsigned long capabilities; 55 unsigned long capabilities;
56 unsigned long capabilities2;
55 bool (*dma_filter)(struct dma_chan *chan, void *filter_param); 57 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
56 void *dma_rx_param; 58 void *dma_rx_param;
57 void *dma_tx_param; 59 void *dma_tx_param;
diff --git a/include/linux/amba/pl061.h b/include/linux/amba/pl061.h
index 2412af944f1f..fb83c0453489 100644
--- a/include/linux/amba/pl061.h
+++ b/include/linux/amba/pl061.h
@@ -7,7 +7,7 @@ struct pl061_platform_data {
7 unsigned gpio_base; 7 unsigned gpio_base;
8 8
9 /* number of the first IRQ. 9 /* number of the first IRQ.
10 * If the IRQ functionality in not desired this must be set to NO_IRQ. 10 * If the IRQ functionality in not desired this must be set to 0.
11 */ 11 */
12 unsigned irq_base; 12 unsigned irq_base;
13 13
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h
index 9eabffbc4e50..033f6aa670de 100644
--- a/include/linux/amba/pl08x.h
+++ b/include/linux/amba/pl08x.h
@@ -134,7 +134,7 @@ struct pl08x_txd {
134 struct dma_async_tx_descriptor tx; 134 struct dma_async_tx_descriptor tx;
135 struct list_head node; 135 struct list_head node;
136 struct list_head dsg_list; 136 struct list_head dsg_list;
137 enum dma_data_direction direction; 137 enum dma_transfer_direction direction;
138 dma_addr_t llis_bus; 138 dma_addr_t llis_bus;
139 struct pl08x_lli *llis_va; 139 struct pl08x_lli *llis_va;
140 /* Default cctl value for LLIs */ 140 /* Default cctl value for LLIs */
@@ -197,7 +197,7 @@ struct pl08x_dma_chan {
197 dma_addr_t dst_addr; 197 dma_addr_t dst_addr;
198 u32 src_cctl; 198 u32 src_cctl;
199 u32 dst_cctl; 199 u32 dst_cctl;
200 enum dma_data_direction runtime_direction; 200 enum dma_transfer_direction runtime_direction;
201 dma_cookie_t lc; 201 dma_cookie_t lc;
202 struct list_head pend_list; 202 struct list_head pend_list;
203 struct pl08x_txd *at; 203 struct pl08x_txd *at;
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 426ab9f4dd85..9ff7a2c48b50 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -26,6 +26,7 @@
26 26
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/elf-em.h> 28#include <linux/elf-em.h>
29#include <linux/ptrace.h>
29 30
30/* The netlink messages for the audit system is divided into blocks: 31/* The netlink messages for the audit system is divided into blocks:
31 * 1000 - 1099 are for commanding the audit system 32 * 1000 - 1099 are for commanding the audit system
@@ -181,6 +182,40 @@
181 * AUDIT_UNUSED_BITS is updated if need be. */ 182 * AUDIT_UNUSED_BITS is updated if need be. */
182#define AUDIT_UNUSED_BITS 0x07FFFC00 183#define AUDIT_UNUSED_BITS 0x07FFFC00
183 184
185/* AUDIT_FIELD_COMPARE rule list */
186#define AUDIT_COMPARE_UID_TO_OBJ_UID 1
187#define AUDIT_COMPARE_GID_TO_OBJ_GID 2
188#define AUDIT_COMPARE_EUID_TO_OBJ_UID 3
189#define AUDIT_COMPARE_EGID_TO_OBJ_GID 4
190#define AUDIT_COMPARE_AUID_TO_OBJ_UID 5
191#define AUDIT_COMPARE_SUID_TO_OBJ_UID 6
192#define AUDIT_COMPARE_SGID_TO_OBJ_GID 7
193#define AUDIT_COMPARE_FSUID_TO_OBJ_UID 8
194#define AUDIT_COMPARE_FSGID_TO_OBJ_GID 9
195
196#define AUDIT_COMPARE_UID_TO_AUID 10
197#define AUDIT_COMPARE_UID_TO_EUID 11
198#define AUDIT_COMPARE_UID_TO_FSUID 12
199#define AUDIT_COMPARE_UID_TO_SUID 13
200
201#define AUDIT_COMPARE_AUID_TO_FSUID 14
202#define AUDIT_COMPARE_AUID_TO_SUID 15
203#define AUDIT_COMPARE_AUID_TO_EUID 16
204
205#define AUDIT_COMPARE_EUID_TO_SUID 17
206#define AUDIT_COMPARE_EUID_TO_FSUID 18
207
208#define AUDIT_COMPARE_SUID_TO_FSUID 19
209
210#define AUDIT_COMPARE_GID_TO_EGID 20
211#define AUDIT_COMPARE_GID_TO_FSGID 21
212#define AUDIT_COMPARE_GID_TO_SGID 22
213
214#define AUDIT_COMPARE_EGID_TO_FSGID 23
215#define AUDIT_COMPARE_EGID_TO_SGID 24
216#define AUDIT_COMPARE_SGID_TO_FSGID 25
217
218#define AUDIT_MAX_FIELD_COMPARE AUDIT_COMPARE_SGID_TO_FSGID
184 219
185/* Rule fields */ 220/* Rule fields */
186 /* These are useful when checking the 221 /* These are useful when checking the
@@ -222,6 +257,9 @@
222#define AUDIT_PERM 106 257#define AUDIT_PERM 106
223#define AUDIT_DIR 107 258#define AUDIT_DIR 107
224#define AUDIT_FILETYPE 108 259#define AUDIT_FILETYPE 108
260#define AUDIT_OBJ_UID 109
261#define AUDIT_OBJ_GID 110
262#define AUDIT_FIELD_COMPARE 111
225 263
226#define AUDIT_ARG0 200 264#define AUDIT_ARG0 200
227#define AUDIT_ARG1 (AUDIT_ARG0+1) 265#define AUDIT_ARG1 (AUDIT_ARG0+1)
@@ -408,28 +446,24 @@ struct audit_field {
408 void *lsm_rule; 446 void *lsm_rule;
409}; 447};
410 448
411#define AUDITSC_INVALID 0
412#define AUDITSC_SUCCESS 1
413#define AUDITSC_FAILURE 2
414#define AUDITSC_RESULT(x) ( ((long)(x))<0?AUDITSC_FAILURE:AUDITSC_SUCCESS )
415extern int __init audit_register_class(int class, unsigned *list); 449extern int __init audit_register_class(int class, unsigned *list);
416extern int audit_classify_syscall(int abi, unsigned syscall); 450extern int audit_classify_syscall(int abi, unsigned syscall);
417extern int audit_classify_arch(int arch); 451extern int audit_classify_arch(int arch);
418#ifdef CONFIG_AUDITSYSCALL 452#ifdef CONFIG_AUDITSYSCALL
419/* These are defined in auditsc.c */ 453/* These are defined in auditsc.c */
420 /* Public API */ 454 /* Public API */
421extern void audit_finish_fork(struct task_struct *child);
422extern int audit_alloc(struct task_struct *task); 455extern int audit_alloc(struct task_struct *task);
423extern void audit_free(struct task_struct *task); 456extern void __audit_free(struct task_struct *task);
424extern void audit_syscall_entry(int arch, 457extern void __audit_syscall_entry(int arch,
425 int major, unsigned long a0, unsigned long a1, 458 int major, unsigned long a0, unsigned long a1,
426 unsigned long a2, unsigned long a3); 459 unsigned long a2, unsigned long a3);
427extern void audit_syscall_exit(int failed, long return_code); 460extern void __audit_syscall_exit(int ret_success, long ret_value);
428extern void __audit_getname(const char *name); 461extern void __audit_getname(const char *name);
429extern void audit_putname(const char *name); 462extern void audit_putname(const char *name);
430extern void __audit_inode(const char *name, const struct dentry *dentry); 463extern void __audit_inode(const char *name, const struct dentry *dentry);
431extern void __audit_inode_child(const struct dentry *dentry, 464extern void __audit_inode_child(const struct dentry *dentry,
432 const struct inode *parent); 465 const struct inode *parent);
466extern void __audit_seccomp(unsigned long syscall);
433extern void __audit_ptrace(struct task_struct *t); 467extern void __audit_ptrace(struct task_struct *t);
434 468
435static inline int audit_dummy_context(void) 469static inline int audit_dummy_context(void)
@@ -437,6 +471,27 @@ static inline int audit_dummy_context(void)
437 void *p = current->audit_context; 471 void *p = current->audit_context;
438 return !p || *(int *)p; 472 return !p || *(int *)p;
439} 473}
474static inline void audit_free(struct task_struct *task)
475{
476 if (unlikely(task->audit_context))
477 __audit_free(task);
478}
479static inline void audit_syscall_entry(int arch, int major, unsigned long a0,
480 unsigned long a1, unsigned long a2,
481 unsigned long a3)
482{
483 if (unlikely(!audit_dummy_context()))
484 __audit_syscall_entry(arch, major, a0, a1, a2, a3);
485}
486static inline void audit_syscall_exit(void *pt_regs)
487{
488 if (unlikely(current->audit_context)) {
489 int success = is_syscall_success(pt_regs);
490 int return_code = regs_return_value(pt_regs);
491
492 __audit_syscall_exit(success, return_code);
493 }
494}
440static inline void audit_getname(const char *name) 495static inline void audit_getname(const char *name)
441{ 496{
442 if (unlikely(!audit_dummy_context())) 497 if (unlikely(!audit_dummy_context()))
@@ -453,6 +508,12 @@ static inline void audit_inode_child(const struct dentry *dentry,
453} 508}
454void audit_core_dumps(long signr); 509void audit_core_dumps(long signr);
455 510
511static inline void audit_seccomp(unsigned long syscall)
512{
513 if (unlikely(!audit_dummy_context()))
514 __audit_seccomp(syscall);
515}
516
456static inline void audit_ptrace(struct task_struct *t) 517static inline void audit_ptrace(struct task_struct *t)
457{ 518{
458 if (unlikely(!audit_dummy_context())) 519 if (unlikely(!audit_dummy_context()))
@@ -463,17 +524,16 @@ static inline void audit_ptrace(struct task_struct *t)
463extern unsigned int audit_serial(void); 524extern unsigned int audit_serial(void);
464extern int auditsc_get_stamp(struct audit_context *ctx, 525extern int auditsc_get_stamp(struct audit_context *ctx,
465 struct timespec *t, unsigned int *serial); 526 struct timespec *t, unsigned int *serial);
466extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); 527extern int audit_set_loginuid(uid_t loginuid);
467#define audit_get_loginuid(t) ((t)->loginuid) 528#define audit_get_loginuid(t) ((t)->loginuid)
468#define audit_get_sessionid(t) ((t)->sessionid) 529#define audit_get_sessionid(t) ((t)->sessionid)
469extern void audit_log_task_context(struct audit_buffer *ab); 530extern void audit_log_task_context(struct audit_buffer *ab);
470extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); 531extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp);
471extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); 532extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode);
472extern int audit_bprm(struct linux_binprm *bprm); 533extern int __audit_bprm(struct linux_binprm *bprm);
473extern void audit_socketcall(int nargs, unsigned long *args); 534extern void __audit_socketcall(int nargs, unsigned long *args);
474extern int audit_sockaddr(int len, void *addr); 535extern int __audit_sockaddr(int len, void *addr);
475extern void __audit_fd_pair(int fd1, int fd2); 536extern void __audit_fd_pair(int fd1, int fd2);
476extern int audit_set_macxattr(const char *name);
477extern void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr); 537extern void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr);
478extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout); 538extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout);
479extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification); 539extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification);
@@ -499,6 +559,23 @@ static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid
499 if (unlikely(!audit_dummy_context())) 559 if (unlikely(!audit_dummy_context()))
500 __audit_ipc_set_perm(qbytes, uid, gid, mode); 560 __audit_ipc_set_perm(qbytes, uid, gid, mode);
501} 561}
562static inline int audit_bprm(struct linux_binprm *bprm)
563{
564 if (unlikely(!audit_dummy_context()))
565 return __audit_bprm(bprm);
566 return 0;
567}
568static inline void audit_socketcall(int nargs, unsigned long *args)
569{
570 if (unlikely(!audit_dummy_context()))
571 __audit_socketcall(nargs, args);
572}
573static inline int audit_sockaddr(int len, void *addr)
574{
575 if (unlikely(!audit_dummy_context()))
576 return __audit_sockaddr(len, addr);
577 return 0;
578}
502static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr) 579static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr)
503{ 580{
504 if (unlikely(!audit_dummy_context())) 581 if (unlikely(!audit_dummy_context()))
@@ -544,12 +621,11 @@ static inline void audit_mmap_fd(int fd, int flags)
544 621
545extern int audit_n_rules; 622extern int audit_n_rules;
546extern int audit_signals; 623extern int audit_signals;
547#else 624#else /* CONFIG_AUDITSYSCALL */
548#define audit_finish_fork(t)
549#define audit_alloc(t) ({ 0; }) 625#define audit_alloc(t) ({ 0; })
550#define audit_free(t) do { ; } while (0) 626#define audit_free(t) do { ; } while (0)
551#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0) 627#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0)
552#define audit_syscall_exit(f,r) do { ; } while (0) 628#define audit_syscall_exit(r) do { ; } while (0)
553#define audit_dummy_context() 1 629#define audit_dummy_context() 1
554#define audit_getname(n) do { ; } while (0) 630#define audit_getname(n) do { ; } while (0)
555#define audit_putname(n) do { ; } while (0) 631#define audit_putname(n) do { ; } while (0)
@@ -558,6 +634,7 @@ extern int audit_signals;
558#define audit_inode(n,d) do { (void)(d); } while (0) 634#define audit_inode(n,d) do { (void)(d); } while (0)
559#define audit_inode_child(i,p) do { ; } while (0) 635#define audit_inode_child(i,p) do { ; } while (0)
560#define audit_core_dumps(i) do { ; } while (0) 636#define audit_core_dumps(i) do { ; } while (0)
637#define audit_seccomp(i) do { ; } while (0)
561#define auditsc_get_stamp(c,t,s) (0) 638#define auditsc_get_stamp(c,t,s) (0)
562#define audit_get_loginuid(t) (-1) 639#define audit_get_loginuid(t) (-1)
563#define audit_get_sessionid(t) (-1) 640#define audit_get_sessionid(t) (-1)
@@ -568,7 +645,6 @@ extern int audit_signals;
568#define audit_socketcall(n,a) ((void)0) 645#define audit_socketcall(n,a) ((void)0)
569#define audit_fd_pair(n,a) ((void)0) 646#define audit_fd_pair(n,a) ((void)0)
570#define audit_sockaddr(len, addr) ({ 0; }) 647#define audit_sockaddr(len, addr) ({ 0; })
571#define audit_set_macxattr(n) do { ; } while (0)
572#define audit_mq_open(o,m,a) ((void)0) 648#define audit_mq_open(o,m,a) ((void)0)
573#define audit_mq_sendrecv(d,l,p,t) ((void)0) 649#define audit_mq_sendrecv(d,l,p,t) ((void)0)
574#define audit_mq_notify(d,n) ((void)0) 650#define audit_mq_notify(d,n) ((void)0)
@@ -579,7 +655,7 @@ extern int audit_signals;
579#define audit_ptrace(t) ((void)0) 655#define audit_ptrace(t) ((void)0)
580#define audit_n_rules 0 656#define audit_n_rules 0
581#define audit_signals 0 657#define audit_signals 0
582#endif 658#endif /* CONFIG_AUDITSYSCALL */
583 659
584#ifdef CONFIG_AUDIT 660#ifdef CONFIG_AUDIT
585/* These are defined in audit.c */ 661/* These are defined in audit.c */
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 847994aef0e9..129a9c097958 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -515,24 +515,64 @@ extern void bio_integrity_init(void);
515 515
516#else /* CONFIG_BLK_DEV_INTEGRITY */ 516#else /* CONFIG_BLK_DEV_INTEGRITY */
517 517
518#define bio_integrity(a) (0) 518static inline int bio_integrity(struct bio *bio)
519#define bioset_integrity_create(a, b) (0) 519{
520#define bio_integrity_prep(a) (0) 520 return 0;
521#define bio_integrity_enabled(a) (0) 521}
522
523static inline int bio_integrity_enabled(struct bio *bio)
524{
525 return 0;
526}
527
528static inline int bioset_integrity_create(struct bio_set *bs, int pool_size)
529{
530 return 0;
531}
532
533static inline void bioset_integrity_free (struct bio_set *bs)
534{
535 return;
536}
537
538static inline int bio_integrity_prep(struct bio *bio)
539{
540 return 0;
541}
542
543static inline void bio_integrity_free(struct bio *bio, struct bio_set *bs)
544{
545 return;
546}
547
522static inline int bio_integrity_clone(struct bio *bio, struct bio *bio_src, 548static inline int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
523 gfp_t gfp_mask, struct bio_set *bs) 549 gfp_t gfp_mask, struct bio_set *bs)
524{ 550{
525 return 0; 551 return 0;
526} 552}
527#define bioset_integrity_free(a) do { } while (0) 553
528#define bio_integrity_free(a, b) do { } while (0) 554static inline void bio_integrity_split(struct bio *bio, struct bio_pair *bp,
529#define bio_integrity_endio(a, b) do { } while (0) 555 int sectors)
530#define bio_integrity_advance(a, b) do { } while (0) 556{
531#define bio_integrity_trim(a, b, c) do { } while (0) 557 return;
532#define bio_integrity_split(a, b, c) do { } while (0) 558}
533#define bio_integrity_set_tag(a, b, c) do { } while (0) 559
534#define bio_integrity_get_tag(a, b, c) do { } while (0) 560static inline void bio_integrity_advance(struct bio *bio,
535#define bio_integrity_init(a) do { } while (0) 561 unsigned int bytes_done)
562{
563 return;
564}
565
566static inline void bio_integrity_trim(struct bio *bio, unsigned int offset,
567 unsigned int sectors)
568{
569 return;
570}
571
572static inline void bio_integrity_init(void)
573{
574 return;
575}
536 576
537#endif /* CONFIG_BLK_DEV_INTEGRITY */ 577#endif /* CONFIG_BLK_DEV_INTEGRITY */
538 578
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 94acd8172b5b..6c6a1f008065 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -111,10 +111,14 @@ struct request {
111 * Three pointers are available for the IO schedulers, if they need 111 * Three pointers are available for the IO schedulers, if they need
112 * more they have to dynamically allocate it. Flush requests are 112 * more they have to dynamically allocate it. Flush requests are
113 * never put on the IO scheduler. So let the flush fields share 113 * never put on the IO scheduler. So let the flush fields share
114 * space with the three elevator_private pointers. 114 * space with the elevator data.
115 */ 115 */
116 union { 116 union {
117 void *elevator_private[3]; 117 struct {
118 struct io_cq *icq;
119 void *priv[2];
120 } elv;
121
118 struct { 122 struct {
119 unsigned int seq; 123 unsigned int seq;
120 struct list_head list; 124 struct list_head list;
@@ -311,6 +315,12 @@ struct request_queue {
311 unsigned long queue_flags; 315 unsigned long queue_flags;
312 316
313 /* 317 /*
318 * ida allocated id for this queue. Used to index queues from
319 * ioctx.
320 */
321 int id;
322
323 /*
314 * queue needs bounce pages for pages above this limit 324 * queue needs bounce pages for pages above this limit
315 */ 325 */
316 gfp_t bounce_gfp; 326 gfp_t bounce_gfp;
@@ -351,6 +361,8 @@ struct request_queue {
351 struct timer_list timeout; 361 struct timer_list timeout;
352 struct list_head timeout_list; 362 struct list_head timeout_list;
353 363
364 struct list_head icq_list;
365
354 struct queue_limits limits; 366 struct queue_limits limits;
355 367
356 /* 368 /*
@@ -387,6 +399,9 @@ struct request_queue {
387 /* Throttle data */ 399 /* Throttle data */
388 struct throtl_data *td; 400 struct throtl_data *td;
389#endif 401#endif
402#ifdef CONFIG_LOCKDEP
403 int ioc_release_depth;
404#endif
390}; 405};
391 406
392#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ 407#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
@@ -481,6 +496,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q)
481 496
482#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) 497#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
483#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) 498#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
499#define blk_queue_dead(q) test_bit(QUEUE_FLAG_DEAD, &(q)->queue_flags)
484#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) 500#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
485#define blk_queue_noxmerges(q) \ 501#define blk_queue_noxmerges(q) \
486 test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags) 502 test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags)
@@ -660,7 +676,6 @@ extern void __blk_put_request(struct request_queue *, struct request *);
660extern struct request *blk_get_request(struct request_queue *, int, gfp_t); 676extern struct request *blk_get_request(struct request_queue *, int, gfp_t);
661extern struct request *blk_make_request(struct request_queue *, struct bio *, 677extern struct request *blk_make_request(struct request_queue *, struct bio *,
662 gfp_t); 678 gfp_t);
663extern void blk_insert_request(struct request_queue *, struct request *, int, void *);
664extern void blk_requeue_request(struct request_queue *, struct request *); 679extern void blk_requeue_request(struct request_queue *, struct request *);
665extern void blk_add_request_payload(struct request *rq, struct page *page, 680extern void blk_add_request_payload(struct request *rq, struct page *page,
666 unsigned int len); 681 unsigned int len);
@@ -675,6 +690,9 @@ extern int blk_insert_cloned_request(struct request_queue *q,
675 struct request *rq); 690 struct request *rq);
676extern void blk_delay_queue(struct request_queue *, unsigned long); 691extern void blk_delay_queue(struct request_queue *, unsigned long);
677extern void blk_recount_segments(struct request_queue *, struct bio *); 692extern void blk_recount_segments(struct request_queue *, struct bio *);
693extern int scsi_verify_blk_ioctl(struct block_device *, unsigned int);
694extern int scsi_cmd_blk_ioctl(struct block_device *, fmode_t,
695 unsigned int, void __user *);
678extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t, 696extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t,
679 unsigned int, void __user *); 697 unsigned int, void __user *);
680extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, 698extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
@@ -826,6 +844,7 @@ extern void blk_queue_io_min(struct request_queue *q, unsigned int min);
826extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt); 844extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt);
827extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); 845extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt);
828extern void blk_set_default_limits(struct queue_limits *lim); 846extern void blk_set_default_limits(struct queue_limits *lim);
847extern void blk_set_stacking_limits(struct queue_limits *lim);
829extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, 848extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
830 sector_t offset); 849 sector_t offset);
831extern int bdev_stack_limits(struct queue_limits *t, struct block_device *bdev, 850extern int bdev_stack_limits(struct queue_limits *t, struct block_device *bdev,
@@ -856,7 +875,7 @@ extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatte
856extern void blk_dump_rq_flags(struct request *, char *); 875extern void blk_dump_rq_flags(struct request *, char *);
857extern long nr_blockdev_pages(void); 876extern long nr_blockdev_pages(void);
858 877
859int blk_get_queue(struct request_queue *); 878bool __must_check blk_get_queue(struct request_queue *);
860struct request_queue *blk_alloc_queue(gfp_t); 879struct request_queue *blk_alloc_queue(gfp_t);
861struct request_queue *blk_alloc_queue_node(gfp_t, int); 880struct request_queue *blk_alloc_queue_node(gfp_t, int);
862extern void blk_put_queue(struct request_queue *); 881extern void blk_put_queue(struct request_queue *);
@@ -1279,19 +1298,70 @@ queue_max_integrity_segments(struct request_queue *q)
1279 1298
1280#else /* CONFIG_BLK_DEV_INTEGRITY */ 1299#else /* CONFIG_BLK_DEV_INTEGRITY */
1281 1300
1282#define blk_integrity_rq(rq) (0) 1301struct bio;
1283#define blk_rq_count_integrity_sg(a, b) (0) 1302struct block_device;
1284#define blk_rq_map_integrity_sg(a, b, c) (0) 1303struct gendisk;
1285#define bdev_get_integrity(a) (0) 1304struct blk_integrity;
1286#define blk_get_integrity(a) (0) 1305
1287#define blk_integrity_compare(a, b) (0) 1306static inline int blk_integrity_rq(struct request *rq)
1288#define blk_integrity_register(a, b) (0) 1307{
1289#define blk_integrity_unregister(a) do { } while (0) 1308 return 0;
1290#define blk_queue_max_integrity_segments(a, b) do { } while (0) 1309}
1291#define queue_max_integrity_segments(a) (0) 1310static inline int blk_rq_count_integrity_sg(struct request_queue *q,
1292#define blk_integrity_merge_rq(a, b, c) (0) 1311 struct bio *b)
1293#define blk_integrity_merge_bio(a, b, c) (0) 1312{
1294#define blk_integrity_is_initialized(a) (0) 1313 return 0;
1314}
1315static inline int blk_rq_map_integrity_sg(struct request_queue *q,
1316 struct bio *b,
1317 struct scatterlist *s)
1318{
1319 return 0;
1320}
1321static inline struct blk_integrity *bdev_get_integrity(struct block_device *b)
1322{
1323 return 0;
1324}
1325static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk)
1326{
1327 return NULL;
1328}
1329static inline int blk_integrity_compare(struct gendisk *a, struct gendisk *b)
1330{
1331 return 0;
1332}
1333static inline int blk_integrity_register(struct gendisk *d,
1334 struct blk_integrity *b)
1335{
1336 return 0;
1337}
1338static inline void blk_integrity_unregister(struct gendisk *d)
1339{
1340}
1341static inline void blk_queue_max_integrity_segments(struct request_queue *q,
1342 unsigned int segs)
1343{
1344}
1345static inline unsigned short queue_max_integrity_segments(struct request_queue *q)
1346{
1347 return 0;
1348}
1349static inline int blk_integrity_merge_rq(struct request_queue *rq,
1350 struct request *r1,
1351 struct request *r2)
1352{
1353 return 0;
1354}
1355static inline int blk_integrity_merge_bio(struct request_queue *rq,
1356 struct request *r,
1357 struct bio *b)
1358{
1359 return 0;
1360}
1361static inline bool blk_integrity_is_initialized(struct gendisk *g)
1362{
1363 return 0;
1364}
1295 1365
1296#endif /* CONFIG_BLK_DEV_INTEGRITY */ 1366#endif /* CONFIG_BLK_DEV_INTEGRITY */
1297 1367
diff --git a/include/linux/capability.h b/include/linux/capability.h
index a63d13d84ad8..12d52dedb229 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -380,7 +380,6 @@ struct user_namespace;
380struct user_namespace *current_user_ns(void); 380struct user_namespace *current_user_ns(void);
381 381
382extern const kernel_cap_t __cap_empty_set; 382extern const kernel_cap_t __cap_empty_set;
383extern const kernel_cap_t __cap_full_set;
384extern const kernel_cap_t __cap_init_eff_set; 383extern const kernel_cap_t __cap_init_eff_set;
385 384
386/* 385/*
@@ -544,9 +543,10 @@ extern bool has_capability(struct task_struct *t, int cap);
544extern bool has_ns_capability(struct task_struct *t, 543extern bool has_ns_capability(struct task_struct *t,
545 struct user_namespace *ns, int cap); 544 struct user_namespace *ns, int cap);
546extern bool has_capability_noaudit(struct task_struct *t, int cap); 545extern bool has_capability_noaudit(struct task_struct *t, int cap);
546extern bool has_ns_capability_noaudit(struct task_struct *t,
547 struct user_namespace *ns, int cap);
547extern bool capable(int cap); 548extern bool capable(int cap);
548extern bool ns_capable(struct user_namespace *ns, int cap); 549extern bool ns_capable(struct user_namespace *ns, int cap);
549extern bool task_ns_capable(struct task_struct *t, int cap);
550extern bool nsown_capable(int cap); 550extern bool nsown_capable(int cap);
551 551
552/* audit system wants to get cap info from files as well */ 552/* audit system wants to get cap info from files as well */
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 59e4028e833d..3fd17c249221 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -50,6 +50,11 @@
50# define inline inline __attribute__((always_inline)) 50# define inline inline __attribute__((always_inline))
51# define __inline__ __inline__ __attribute__((always_inline)) 51# define __inline__ __inline__ __attribute__((always_inline))
52# define __inline __inline __attribute__((always_inline)) 52# define __inline __inline __attribute__((always_inline))
53#else
54/* A lot of inline functions can cause havoc with function tracing */
55# define inline inline notrace
56# define __inline__ __inline__ notrace
57# define __inline __inline notrace
53#endif 58#endif
54 59
55#define __deprecated __attribute__((deprecated)) 60#define __deprecated __attribute__((deprecated))
diff --git a/include/linux/console.h b/include/linux/console.h
index 7453cfd593c8..7201ce4280ca 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -152,7 +152,7 @@ extern int braille_register_console(struct console *, int index,
152 char *console_options, char *braille_options); 152 char *console_options, char *braille_options);
153extern int braille_unregister_console(struct console *); 153extern int braille_unregister_console(struct console *);
154extern void console_sysfs_notify(void); 154extern void console_sysfs_notify(void);
155extern int console_suspend_enabled; 155extern bool console_suspend_enabled;
156 156
157/* Suspend and resume console messages over PM events */ 157/* Suspend and resume console messages over PM events */
158extern void suspend_console(void); 158extern void suspend_console(void);
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 23f81de51829..712abcc205ae 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -186,7 +186,14 @@ struct cpuidle_governor {
186extern int cpuidle_register_governor(struct cpuidle_governor *gov); 186extern int cpuidle_register_governor(struct cpuidle_governor *gov);
187extern void cpuidle_unregister_governor(struct cpuidle_governor *gov); 187extern void cpuidle_unregister_governor(struct cpuidle_governor *gov);
188 188
189#ifdef CONFIG_INTEL_IDLE
190extern int intel_idle_cpu_init(int cpu);
189#else 191#else
192static inline int intel_idle_cpu_init(int cpu) { return -1; }
193#endif
194
195#else
196static inline int intel_idle_cpu_init(int cpu) { return -1; }
190 197
191static inline int cpuidle_register_governor(struct cpuidle_governor *gov) 198static inline int cpuidle_register_governor(struct cpuidle_governor *gov)
192{return 0;} 199{return 0;}
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 40308969ed00..adadf71a7327 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -358,10 +358,12 @@ static inline void put_cred(const struct cred *_cred)
358#define current_security() (current_cred_xxx(security)) 358#define current_security() (current_cred_xxx(security))
359 359
360#ifdef CONFIG_USER_NS 360#ifdef CONFIG_USER_NS
361#define current_user_ns() (current_cred_xxx(user_ns)) 361#define current_user_ns() (current_cred_xxx(user_ns))
362#define task_user_ns(task) (task_cred_xxx((task), user_ns))
362#else 363#else
363extern struct user_namespace init_user_ns; 364extern struct user_namespace init_user_ns;
364#define current_user_ns() (&init_user_ns) 365#define current_user_ns() (&init_user_ns)
366#define task_user_ns(task) (&init_user_ns)
365#endif 367#endif
366 368
367 369
diff --git a/include/linux/cuda.h b/include/linux/cuda.h
index 6a3e6385d3f3..9f9865ff781e 100644
--- a/include/linux/cuda.h
+++ b/include/linux/cuda.h
@@ -5,6 +5,9 @@
5 * Copyright (C) 1996 Paul Mackerras. 5 * Copyright (C) 1996 Paul Mackerras.
6 */ 6 */
7 7
8#ifndef _LINUX_CUDA_H
9#define _LINUX_CUDA_H
10
8/* CUDA commands (2nd byte) */ 11/* CUDA commands (2nd byte) */
9#define CUDA_WARM_START 0 12#define CUDA_WARM_START 0
10#define CUDA_AUTOPOLL 1 13#define CUDA_AUTOPOLL 1
@@ -34,3 +37,5 @@ extern int cuda_request(struct adb_request *req,
34extern void cuda_poll(void); 37extern void cuda_poll(void);
35 38
36#endif /* __KERNEL */ 39#endif /* __KERNEL */
40
41#endif /* _LINUX_CUDA_H */
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 31f73220e7d7..d64a55b23afd 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -242,6 +242,7 @@ extern struct dentry * d_alloc(struct dentry *, const struct qstr *);
242extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *); 242extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *);
243extern struct dentry * d_splice_alias(struct inode *, struct dentry *); 243extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
244extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *); 244extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *);
245extern struct dentry *d_find_any_alias(struct inode *inode);
245extern struct dentry * d_obtain_alias(struct inode *); 246extern struct dentry * d_obtain_alias(struct inode *);
246extern void shrink_dcache_sb(struct super_block *); 247extern void shrink_dcache_sb(struct super_block *);
247extern void shrink_dcache_parent(struct dentry *); 248extern void shrink_dcache_parent(struct dentry *);
diff --git a/include/linux/device.h b/include/linux/device.h
index 5b3adb8f9588..b63fb393aa58 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -279,11 +279,11 @@ struct device *driver_find_device(struct device_driver *drv,
279 279
280/** 280/**
281 * struct subsys_interface - interfaces to device functions 281 * struct subsys_interface - interfaces to device functions
282 * @name name of the device function 282 * @name: name of the device function
283 * @subsystem subsytem of the devices to attach to 283 * @subsys: subsytem of the devices to attach to
284 * @node the list of functions registered at the subsystem 284 * @node: the list of functions registered at the subsystem
285 * @add device hookup to device function handler 285 * @add_dev: device hookup to device function handler
286 * @remove device hookup to device function handler 286 * @remove_dev: device hookup to device function handler
287 * 287 *
288 * Simple interfaces attached to a subsystem. Multiple interfaces can 288 * Simple interfaces attached to a subsystem. Multiple interfaces can
289 * attach to a subsystem and its devices. Unlike drivers, they do not 289 * attach to a subsystem and its devices. Unlike drivers, they do not
@@ -612,6 +612,7 @@ struct device_dma_parameters {
612 * @archdata: For arch-specific additions. 612 * @archdata: For arch-specific additions.
613 * @of_node: Associated device tree node. 613 * @of_node: Associated device tree node.
614 * @devt: For creating the sysfs "dev". 614 * @devt: For creating the sysfs "dev".
615 * @id: device instance
615 * @devres_lock: Spinlock to protect the resource of the device. 616 * @devres_lock: Spinlock to protect the resource of the device.
616 * @devres_head: The resources list of the device. 617 * @devres_head: The resources list of the device.
617 * @knode_class: The node used to add the device to the class list. 618 * @knode_class: The node used to add the device to the class list.
@@ -1003,6 +1004,10 @@ extern long sysfs_deprecated;
1003 * Each module may only use this macro once, and calling it replaces 1004 * Each module may only use this macro once, and calling it replaces
1004 * module_init() and module_exit(). 1005 * module_init() and module_exit().
1005 * 1006 *
1007 * @__driver: driver name
1008 * @__register: register function for this driver type
1009 * @__unregister: unregister function for this driver type
1010 *
1006 * Use this macro to construct bus specific macros for registering 1011 * Use this macro to construct bus specific macros for registering
1007 * drivers, and do not use it on its own. 1012 * drivers, and do not use it on its own.
1008 */ 1013 */
diff --git a/include/linux/digsig.h b/include/linux/digsig.h
index efae755017d7..b01558b15814 100644
--- a/include/linux/digsig.h
+++ b/include/linux/digsig.h
@@ -46,7 +46,7 @@ struct signature_hdr {
46 char mpi[0]; 46 char mpi[0];
47} __packed; 47} __packed;
48 48
49#if defined(CONFIG_DIGSIG) || defined(CONFIG_DIGSIG_MODULE) 49#if defined(CONFIG_SIGNATURE) || defined(CONFIG_SIGNATURE_MODULE)
50 50
51int digsig_verify(struct key *keyring, const char *sig, int siglen, 51int digsig_verify(struct key *keyring, const char *sig, int siglen,
52 const char *digest, int digestlen); 52 const char *digest, int digestlen);
@@ -59,6 +59,6 @@ static inline int digsig_verify(struct key *keyring, const char *sig,
59 return -EOPNOTSUPP; 59 return -EOPNOTSUPP;
60} 60}
61 61
62#endif /* CONFIG_DIGSIG */ 62#endif /* CONFIG_SIGNATURE */
63 63
64#endif /* _DIGSIG_H */ 64#endif /* _DIGSIG_H */
diff --git a/include/linux/display.h b/include/linux/display.h
deleted file mode 100644
index 3bf70d639728..000000000000
--- a/include/linux/display.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * Copyright (C) 2006 James Simmons <jsimmons@infradead.org>
3 *
4 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19 *
20 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 */
22
23#ifndef _LINUX_DISPLAY_H
24#define _LINUX_DISPLAY_H
25
26#include <linux/device.h>
27
28struct display_device;
29
30/* This structure defines all the properties of a Display. */
31struct display_driver {
32 int (*set_contrast)(struct display_device *, unsigned int);
33 int (*get_contrast)(struct display_device *);
34 void (*suspend)(struct display_device *, pm_message_t state);
35 void (*resume)(struct display_device *);
36 int (*probe)(struct display_device *, void *);
37 int (*remove)(struct display_device *);
38 int max_contrast;
39};
40
41struct display_device {
42 struct module *owner; /* Owner module */
43 struct display_driver *driver;
44 struct device *parent; /* This is the parent */
45 struct device *dev; /* This is this display device */
46 struct mutex lock;
47 void *priv_data;
48 char type[16];
49 char *name;
50 int idx;
51};
52
53extern struct display_device *display_device_register(struct display_driver *driver,
54 struct device *dev, void *devdata);
55extern void display_device_unregister(struct display_device *dev);
56
57extern int probe_edid(struct display_device *dev, void *devdata);
58
59#define to_display_device(obj) container_of(obj, struct display_device, class_dev)
60
61#endif
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 75f53f874b24..679b349d9b66 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -23,7 +23,6 @@
23 23
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/uio.h> 25#include <linux/uio.h>
26#include <linux/dma-direction.h>
27#include <linux/scatterlist.h> 26#include <linux/scatterlist.h>
28#include <linux/bitmap.h> 27#include <linux/bitmap.h>
29#include <asm/page.h> 28#include <asm/page.h>
@@ -72,11 +71,93 @@ enum dma_transaction_type {
72 DMA_ASYNC_TX, 71 DMA_ASYNC_TX,
73 DMA_SLAVE, 72 DMA_SLAVE,
74 DMA_CYCLIC, 73 DMA_CYCLIC,
74 DMA_INTERLEAVE,
75/* last transaction type for creation of the capabilities mask */
76 DMA_TX_TYPE_END,
75}; 77};
76 78
77/* last transaction type for creation of the capabilities mask */ 79/**
78#define DMA_TX_TYPE_END (DMA_CYCLIC + 1) 80 * enum dma_transfer_direction - dma transfer mode and direction indicator
81 * @DMA_MEM_TO_MEM: Async/Memcpy mode
82 * @DMA_MEM_TO_DEV: Slave mode & From Memory to Device
83 * @DMA_DEV_TO_MEM: Slave mode & From Device to Memory
84 * @DMA_DEV_TO_DEV: Slave mode & From Device to Device
85 */
86enum dma_transfer_direction {
87 DMA_MEM_TO_MEM,
88 DMA_MEM_TO_DEV,
89 DMA_DEV_TO_MEM,
90 DMA_DEV_TO_DEV,
91 DMA_TRANS_NONE,
92};
93
94/**
95 * Interleaved Transfer Request
96 * ----------------------------
97 * A chunk is collection of contiguous bytes to be transfered.
98 * The gap(in bytes) between two chunks is called inter-chunk-gap(ICG).
99 * ICGs may or maynot change between chunks.
100 * A FRAME is the smallest series of contiguous {chunk,icg} pairs,
101 * that when repeated an integral number of times, specifies the transfer.
102 * A transfer template is specification of a Frame, the number of times
103 * it is to be repeated and other per-transfer attributes.
104 *
105 * Practically, a client driver would have ready a template for each
106 * type of transfer it is going to need during its lifetime and
107 * set only 'src_start' and 'dst_start' before submitting the requests.
108 *
109 *
110 * | Frame-1 | Frame-2 | ~ | Frame-'numf' |
111 * |====....==.===...=...|====....==.===...=...| ~ |====....==.===...=...|
112 *
113 * == Chunk size
114 * ... ICG
115 */
116
117/**
118 * struct data_chunk - Element of scatter-gather list that makes a frame.
119 * @size: Number of bytes to read from source.
120 * size_dst := fn(op, size_src), so doesn't mean much for destination.
121 * @icg: Number of bytes to jump after last src/dst address of this
122 * chunk and before first src/dst address for next chunk.
123 * Ignored for dst(assumed 0), if dst_inc is true and dst_sgl is false.
124 * Ignored for src(assumed 0), if src_inc is true and src_sgl is false.
125 */
126struct data_chunk {
127 size_t size;
128 size_t icg;
129};
79 130
131/**
132 * struct dma_interleaved_template - Template to convey DMAC the transfer pattern
133 * and attributes.
134 * @src_start: Bus address of source for the first chunk.
135 * @dst_start: Bus address of destination for the first chunk.
136 * @dir: Specifies the type of Source and Destination.
137 * @src_inc: If the source address increments after reading from it.
138 * @dst_inc: If the destination address increments after writing to it.
139 * @src_sgl: If the 'icg' of sgl[] applies to Source (scattered read).
140 * Otherwise, source is read contiguously (icg ignored).
141 * Ignored if src_inc is false.
142 * @dst_sgl: If the 'icg' of sgl[] applies to Destination (scattered write).
143 * Otherwise, destination is filled contiguously (icg ignored).
144 * Ignored if dst_inc is false.
145 * @numf: Number of frames in this template.
146 * @frame_size: Number of chunks in a frame i.e, size of sgl[].
147 * @sgl: Array of {chunk,icg} pairs that make up a frame.
148 */
149struct dma_interleaved_template {
150 dma_addr_t src_start;
151 dma_addr_t dst_start;
152 enum dma_transfer_direction dir;
153 bool src_inc;
154 bool dst_inc;
155 bool src_sgl;
156 bool dst_sgl;
157 size_t numf;
158 size_t frame_size;
159 struct data_chunk sgl[0];
160};
80 161
81/** 162/**
82 * enum dma_ctrl_flags - DMA flags to augment operation preparation, 163 * enum dma_ctrl_flags - DMA flags to augment operation preparation,
@@ -269,7 +350,7 @@ enum dma_slave_buswidth {
269 * struct, if applicable. 350 * struct, if applicable.
270 */ 351 */
271struct dma_slave_config { 352struct dma_slave_config {
272 enum dma_data_direction direction; 353 enum dma_transfer_direction direction;
273 dma_addr_t src_addr; 354 dma_addr_t src_addr;
274 dma_addr_t dst_addr; 355 dma_addr_t dst_addr;
275 enum dma_slave_buswidth src_addr_width; 356 enum dma_slave_buswidth src_addr_width;
@@ -433,6 +514,7 @@ struct dma_tx_state {
433 * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio. 514 * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio.
434 * The function takes a buffer of size buf_len. The callback function will 515 * The function takes a buffer of size buf_len. The callback function will
435 * be called after period_len bytes have been transferred. 516 * be called after period_len bytes have been transferred.
517 * @device_prep_interleaved_dma: Transfer expression in a generic way.
436 * @device_control: manipulate all pending operations on a channel, returns 518 * @device_control: manipulate all pending operations on a channel, returns
437 * zero or error code 519 * zero or error code
438 * @device_tx_status: poll for transaction completion, the optional 520 * @device_tx_status: poll for transaction completion, the optional
@@ -492,11 +574,14 @@ struct dma_device {
492 574
493 struct dma_async_tx_descriptor *(*device_prep_slave_sg)( 575 struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
494 struct dma_chan *chan, struct scatterlist *sgl, 576 struct dma_chan *chan, struct scatterlist *sgl,
495 unsigned int sg_len, enum dma_data_direction direction, 577 unsigned int sg_len, enum dma_transfer_direction direction,
496 unsigned long flags); 578 unsigned long flags);
497 struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)( 579 struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)(
498 struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, 580 struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
499 size_t period_len, enum dma_data_direction direction); 581 size_t period_len, enum dma_transfer_direction direction);
582 struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)(
583 struct dma_chan *chan, struct dma_interleaved_template *xt,
584 unsigned long flags);
500 int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd, 585 int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
501 unsigned long arg); 586 unsigned long arg);
502 587
@@ -522,7 +607,7 @@ static inline int dmaengine_slave_config(struct dma_chan *chan,
522 607
523static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single( 608static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
524 struct dma_chan *chan, void *buf, size_t len, 609 struct dma_chan *chan, void *buf, size_t len,
525 enum dma_data_direction dir, unsigned long flags) 610 enum dma_transfer_direction dir, unsigned long flags)
526{ 611{
527 struct scatterlist sg; 612 struct scatterlist sg;
528 sg_init_one(&sg, buf, len); 613 sg_init_one(&sg, buf, len);
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h
index 1b1094c35e4f..cb4428ab81ed 100644
--- a/include/linux/dvb/frontend.h
+++ b/include/linux/dvb/frontend.h
@@ -72,7 +72,7 @@ typedef enum fe_caps {
72 72
73struct dvb_frontend_info { 73struct dvb_frontend_info {
74 char name[128]; 74 char name[128];
75 fe_type_t type; 75 fe_type_t type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */
76 __u32 frequency_min; 76 __u32 frequency_min;
77 __u32 frequency_max; 77 __u32 frequency_max;
78 __u32 frequency_stepsize; 78 __u32 frequency_stepsize;
@@ -181,6 +181,7 @@ typedef enum fe_transmit_mode {
181 TRANSMISSION_MODE_32K, 181 TRANSMISSION_MODE_32K,
182} fe_transmit_mode_t; 182} fe_transmit_mode_t;
183 183
184#if defined(__DVB_CORE__) || !defined (__KERNEL__)
184typedef enum fe_bandwidth { 185typedef enum fe_bandwidth {
185 BANDWIDTH_8_MHZ, 186 BANDWIDTH_8_MHZ,
186 BANDWIDTH_7_MHZ, 187 BANDWIDTH_7_MHZ,
@@ -190,7 +191,7 @@ typedef enum fe_bandwidth {
190 BANDWIDTH_10_MHZ, 191 BANDWIDTH_10_MHZ,
191 BANDWIDTH_1_712_MHZ, 192 BANDWIDTH_1_712_MHZ,
192} fe_bandwidth_t; 193} fe_bandwidth_t;
193 194#endif
194 195
195typedef enum fe_guard_interval { 196typedef enum fe_guard_interval {
196 GUARD_INTERVAL_1_32, 197 GUARD_INTERVAL_1_32,
@@ -213,6 +214,7 @@ typedef enum fe_hierarchy {
213} fe_hierarchy_t; 214} fe_hierarchy_t;
214 215
215 216
217#if defined(__DVB_CORE__) || !defined (__KERNEL__)
216struct dvb_qpsk_parameters { 218struct dvb_qpsk_parameters {
217 __u32 symbol_rate; /* symbol rate in Symbols per second */ 219 __u32 symbol_rate; /* symbol rate in Symbols per second */
218 fe_code_rate_t fec_inner; /* forward error correction (see above) */ 220 fe_code_rate_t fec_inner; /* forward error correction (see above) */
@@ -251,11 +253,11 @@ struct dvb_frontend_parameters {
251 } u; 253 } u;
252}; 254};
253 255
254
255struct dvb_frontend_event { 256struct dvb_frontend_event {
256 fe_status_t status; 257 fe_status_t status;
257 struct dvb_frontend_parameters parameters; 258 struct dvb_frontend_parameters parameters;
258}; 259};
260#endif
259 261
260/* S2API Commands */ 262/* S2API Commands */
261#define DTV_UNDEFINED 0 263#define DTV_UNDEFINED 0
@@ -316,7 +318,9 @@ struct dvb_frontend_event {
316 318
317#define DTV_DVBT2_PLP_ID 43 319#define DTV_DVBT2_PLP_ID 43
318 320
319#define DTV_MAX_COMMAND DTV_DVBT2_PLP_ID 321#define DTV_ENUM_DELSYS 44
322
323#define DTV_MAX_COMMAND DTV_ENUM_DELSYS
320 324
321typedef enum fe_pilot { 325typedef enum fe_pilot {
322 PILOT_ON, 326 PILOT_ON,
@@ -333,7 +337,7 @@ typedef enum fe_rolloff {
333 337
334typedef enum fe_delivery_system { 338typedef enum fe_delivery_system {
335 SYS_UNDEFINED, 339 SYS_UNDEFINED,
336 SYS_DVBC_ANNEX_AC, 340 SYS_DVBC_ANNEX_A,
337 SYS_DVBC_ANNEX_B, 341 SYS_DVBC_ANNEX_B,
338 SYS_DVBT, 342 SYS_DVBT,
339 SYS_DSS, 343 SYS_DSS,
@@ -350,8 +354,13 @@ typedef enum fe_delivery_system {
350 SYS_DAB, 354 SYS_DAB,
351 SYS_DVBT2, 355 SYS_DVBT2,
352 SYS_TURBO, 356 SYS_TURBO,
357 SYS_DVBC_ANNEX_C,
353} fe_delivery_system_t; 358} fe_delivery_system_t;
354 359
360
361#define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A
362
363
355struct dtv_cmds_h { 364struct dtv_cmds_h {
356 char *name; /* A display name for debugging purposes */ 365 char *name; /* A display name for debugging purposes */
357 366
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h
index 66594b1d5d7b..0559e2bd38f9 100644
--- a/include/linux/dvb/version.h
+++ b/include/linux/dvb/version.h
@@ -24,6 +24,6 @@
24#define _DVBVERSION_H_ 24#define _DVBVERSION_H_
25 25
26#define DVB_API_VERSION 5 26#define DVB_API_VERSION 5
27#define DVB_API_VERSION_MINOR 4 27#define DVB_API_VERSION_MINOR 5
28 28
29#endif /*_DVBVERSION_H_*/ 29#endif /*_DVBVERSION_H_*/
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h
index 4bfe0a2f7d50..f2c64f92c4a0 100644
--- a/include/linux/dw_dmac.h
+++ b/include/linux/dw_dmac.h
@@ -127,7 +127,7 @@ struct dw_cyclic_desc {
127 127
128struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan, 128struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan,
129 dma_addr_t buf_addr, size_t buf_len, size_t period_len, 129 dma_addr_t buf_addr, size_t buf_len, size_t period_len,
130 enum dma_data_direction direction); 130 enum dma_transfer_direction direction);
131void dw_dma_cyclic_free(struct dma_chan *chan); 131void dw_dma_cyclic_free(struct dma_chan *chan);
132int dw_dma_cyclic_start(struct dma_chan *chan); 132int dw_dma_cyclic_start(struct dma_chan *chan);
133void dw_dma_cyclic_stop(struct dma_chan *chan); 133void dw_dma_cyclic_stop(struct dma_chan *chan);
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 1d0f7a2ff73b..c24f3d7fbf1e 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -5,6 +5,8 @@
5 5
6#ifdef CONFIG_BLOCK 6#ifdef CONFIG_BLOCK
7 7
8struct io_cq;
9
8typedef int (elevator_merge_fn) (struct request_queue *, struct request **, 10typedef int (elevator_merge_fn) (struct request_queue *, struct request **,
9 struct bio *); 11 struct bio *);
10 12
@@ -24,6 +26,8 @@ typedef struct request *(elevator_request_list_fn) (struct request_queue *, stru
24typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *); 26typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *);
25typedef int (elevator_may_queue_fn) (struct request_queue *, int); 27typedef int (elevator_may_queue_fn) (struct request_queue *, int);
26 28
29typedef void (elevator_init_icq_fn) (struct io_cq *);
30typedef void (elevator_exit_icq_fn) (struct io_cq *);
27typedef int (elevator_set_req_fn) (struct request_queue *, struct request *, gfp_t); 31typedef int (elevator_set_req_fn) (struct request_queue *, struct request *, gfp_t);
28typedef void (elevator_put_req_fn) (struct request *); 32typedef void (elevator_put_req_fn) (struct request *);
29typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *); 33typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *);
@@ -56,6 +60,9 @@ struct elevator_ops
56 elevator_request_list_fn *elevator_former_req_fn; 60 elevator_request_list_fn *elevator_former_req_fn;
57 elevator_request_list_fn *elevator_latter_req_fn; 61 elevator_request_list_fn *elevator_latter_req_fn;
58 62
63 elevator_init_icq_fn *elevator_init_icq_fn; /* see iocontext.h */
64 elevator_exit_icq_fn *elevator_exit_icq_fn; /* ditto */
65
59 elevator_set_req_fn *elevator_set_req_fn; 66 elevator_set_req_fn *elevator_set_req_fn;
60 elevator_put_req_fn *elevator_put_req_fn; 67 elevator_put_req_fn *elevator_put_req_fn;
61 68
@@ -63,7 +70,6 @@ struct elevator_ops
63 70
64 elevator_init_fn *elevator_init_fn; 71 elevator_init_fn *elevator_init_fn;
65 elevator_exit_fn *elevator_exit_fn; 72 elevator_exit_fn *elevator_exit_fn;
66 void (*trim)(struct io_context *);
67}; 73};
68 74
69#define ELV_NAME_MAX (16) 75#define ELV_NAME_MAX (16)
@@ -79,11 +85,20 @@ struct elv_fs_entry {
79 */ 85 */
80struct elevator_type 86struct elevator_type
81{ 87{
82 struct list_head list; 88 /* managed by elevator core */
89 struct kmem_cache *icq_cache;
90
91 /* fields provided by elevator implementation */
83 struct elevator_ops ops; 92 struct elevator_ops ops;
93 size_t icq_size; /* see iocontext.h */
94 size_t icq_align; /* ditto */
84 struct elv_fs_entry *elevator_attrs; 95 struct elv_fs_entry *elevator_attrs;
85 char elevator_name[ELV_NAME_MAX]; 96 char elevator_name[ELV_NAME_MAX];
86 struct module *elevator_owner; 97 struct module *elevator_owner;
98
99 /* managed by elevator core */
100 char icq_cache_name[ELV_NAME_MAX + 5]; /* elvname + "_io_cq" */
101 struct list_head list;
87}; 102};
88 103
89/* 104/*
@@ -91,10 +106,9 @@ struct elevator_type
91 */ 106 */
92struct elevator_queue 107struct elevator_queue
93{ 108{
94 struct elevator_ops *ops; 109 struct elevator_type *type;
95 void *elevator_data; 110 void *elevator_data;
96 struct kobject kobj; 111 struct kobject kobj;
97 struct elevator_type *elevator_type;
98 struct mutex sysfs_lock; 112 struct mutex sysfs_lock;
99 struct hlist_head *hash; 113 struct hlist_head *hash;
100 unsigned int registered:1; 114 unsigned int registered:1;
@@ -129,7 +143,7 @@ extern void elv_drain_elevator(struct request_queue *);
129/* 143/*
130 * io scheduler registration 144 * io scheduler registration
131 */ 145 */
132extern void elv_register(struct elevator_type *); 146extern int elv_register(struct elevator_type *);
133extern void elv_unregister(struct elevator_type *); 147extern void elv_unregister(struct elevator_type *);
134 148
135/* 149/*
@@ -197,22 +211,5 @@ enum {
197 INIT_LIST_HEAD(&(rq)->csd.list); \ 211 INIT_LIST_HEAD(&(rq)->csd.list); \
198 } while (0) 212 } while (0)
199 213
200/*
201 * io context count accounting
202 */
203#define elv_ioc_count_mod(name, __val) this_cpu_add(name, __val)
204#define elv_ioc_count_inc(name) this_cpu_inc(name)
205#define elv_ioc_count_dec(name) this_cpu_dec(name)
206
207#define elv_ioc_count_read(name) \
208({ \
209 unsigned long __val = 0; \
210 int __cpu; \
211 smp_wmb(); \
212 for_each_possible_cpu(__cpu) \
213 __val += per_cpu(name, __cpu); \
214 __val; \
215})
216
217#endif /* CONFIG_BLOCK */ 214#endif /* CONFIG_BLOCK */
218#endif 215#endif
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 31f0508d7da7..999b4f52e8e5 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -7,15 +7,6 @@
7#include <asm/elf.h> 7#include <asm/elf.h>
8#endif 8#endif
9 9
10struct file;
11
12#ifndef elf_read_implies_exec
13 /* Executables for which elf_read_implies_exec() returns TRUE will
14 have the READ_IMPLIES_EXEC personality flag set automatically.
15 Override in asm/elf.h as needed. */
16# define elf_read_implies_exec(ex, have_pt_gnu_stack) 0
17#endif
18
19/* 32-bit ELF base types. */ 10/* 32-bit ELF base types. */
20typedef __u32 Elf32_Addr; 11typedef __u32 Elf32_Addr;
21typedef __u16 Elf32_Half; 12typedef __u16 Elf32_Half;
@@ -414,6 +405,13 @@ typedef struct elf64_note {
414} Elf64_Nhdr; 405} Elf64_Nhdr;
415 406
416#ifdef __KERNEL__ 407#ifdef __KERNEL__
408#ifndef elf_read_implies_exec
409 /* Executables for which elf_read_implies_exec() returns TRUE will
410 have the READ_IMPLIES_EXEC personality flag set automatically.
411 Override in asm/elf.h as needed. */
412# define elf_read_implies_exec(ex, have_pt_gnu_stack) 0
413#endif
414
417#if ELF_CLASS == ELFCLASS32 415#if ELF_CLASS == ELFCLASS32
418 416
419extern Elf32_Dyn _DYNAMIC []; 417extern Elf32_Dyn _DYNAMIC [];
@@ -437,6 +435,8 @@ extern Elf64_Dyn _DYNAMIC [];
437#endif 435#endif
438 436
439/* Optional callbacks to write extra ELF notes. */ 437/* Optional callbacks to write extra ELF notes. */
438struct file;
439
440#ifndef ARCH_HAVE_EXTRA_ELF_NOTES 440#ifndef ARCH_HAVE_EXTRA_ELF_NOTES
441static inline int elf_coredump_extra_notes_size(void) { return 0; } 441static inline int elf_coredump_extra_notes_size(void) { return 0; }
442static inline int elf_coredump_extra_notes_write(struct file *file, 442static inline int elf_coredump_extra_notes_write(struct file *file,
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 1d6836c498dd..c18122f40543 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -45,6 +45,7 @@
45#define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */ 45#define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */
46#define FB_TYPE_TEXT 3 /* Text/attributes */ 46#define FB_TYPE_TEXT 3 /* Text/attributes */
47#define FB_TYPE_VGA_PLANES 4 /* EGA/VGA planes */ 47#define FB_TYPE_VGA_PLANES 4 /* EGA/VGA planes */
48#define FB_TYPE_FOURCC 5 /* Type identified by a V4L2 FOURCC */
48 49
49#define FB_AUX_TEXT_MDA 0 /* Monochrome text */ 50#define FB_AUX_TEXT_MDA 0 /* Monochrome text */
50#define FB_AUX_TEXT_CGA 1 /* CGA/EGA/VGA Color text */ 51#define FB_AUX_TEXT_CGA 1 /* CGA/EGA/VGA Color text */
@@ -69,6 +70,7 @@
69#define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */ 70#define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */
70#define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */ 71#define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */
71#define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */ 72#define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */
73#define FB_VISUAL_FOURCC 6 /* Visual identified by a V4L2 FOURCC */
72 74
73#define FB_ACCEL_NONE 0 /* no hardware accelerator */ 75#define FB_ACCEL_NONE 0 /* no hardware accelerator */
74#define FB_ACCEL_ATARIBLITT 1 /* Atari Blitter */ 76#define FB_ACCEL_ATARIBLITT 1 /* Atari Blitter */
@@ -154,6 +156,8 @@
154 156
155#define FB_ACCEL_PUV3_UNIGFX 0xa0 /* PKUnity-v3 Unigfx */ 157#define FB_ACCEL_PUV3_UNIGFX 0xa0 /* PKUnity-v3 Unigfx */
156 158
159#define FB_CAP_FOURCC 1 /* Device supports FOURCC-based formats */
160
157struct fb_fix_screeninfo { 161struct fb_fix_screeninfo {
158 char id[16]; /* identification string eg "TT Builtin" */ 162 char id[16]; /* identification string eg "TT Builtin" */
159 unsigned long smem_start; /* Start of frame buffer mem */ 163 unsigned long smem_start; /* Start of frame buffer mem */
@@ -171,7 +175,8 @@ struct fb_fix_screeninfo {
171 __u32 mmio_len; /* Length of Memory Mapped I/O */ 175 __u32 mmio_len; /* Length of Memory Mapped I/O */
172 __u32 accel; /* Indicate to driver which */ 176 __u32 accel; /* Indicate to driver which */
173 /* specific chip/card we have */ 177 /* specific chip/card we have */
174 __u16 reserved[3]; /* Reserved for future compatibility */ 178 __u16 capabilities; /* see FB_CAP_* */
179 __u16 reserved[2]; /* Reserved for future compatibility */
175}; 180};
176 181
177/* Interpretation of offset for color fields: All offsets are from the right, 182/* Interpretation of offset for color fields: All offsets are from the right,
@@ -246,8 +251,8 @@ struct fb_var_screeninfo {
246 __u32 yoffset; /* resolution */ 251 __u32 yoffset; /* resolution */
247 252
248 __u32 bits_per_pixel; /* guess what */ 253 __u32 bits_per_pixel; /* guess what */
249 __u32 grayscale; /* != 0 Graylevels instead of colors */ 254 __u32 grayscale; /* 0 = color, 1 = grayscale, */
250 255 /* >1 = FOURCC */
251 struct fb_bitfield red; /* bitfield in fb mem if true color, */ 256 struct fb_bitfield red; /* bitfield in fb mem if true color, */
252 struct fb_bitfield green; /* else only length is significant */ 257 struct fb_bitfield green; /* else only length is significant */
253 struct fb_bitfield blue; 258 struct fb_bitfield blue;
@@ -273,7 +278,8 @@ struct fb_var_screeninfo {
273 __u32 sync; /* see FB_SYNC_* */ 278 __u32 sync; /* see FB_SYNC_* */
274 __u32 vmode; /* see FB_VMODE_* */ 279 __u32 vmode; /* see FB_VMODE_* */
275 __u32 rotate; /* angle we rotate counter clockwise */ 280 __u32 rotate; /* angle we rotate counter clockwise */
276 __u32 reserved[5]; /* Reserved for future compatibility */ 281 __u32 colorspace; /* colorspace for FOURCC-based modes */
282 __u32 reserved[4]; /* Reserved for future compatibility */
277}; 283};
278 284
279struct fb_cmap { 285struct fb_cmap {
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 4bc8169fb5a1..386da09f229d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -319,6 +319,7 @@ struct inodes_stat_t {
319#define BLKPBSZGET _IO(0x12,123) 319#define BLKPBSZGET _IO(0x12,123)
320#define BLKDISCARDZEROES _IO(0x12,124) 320#define BLKDISCARDZEROES _IO(0x12,124)
321#define BLKSECDISCARD _IO(0x12,125) 321#define BLKSECDISCARD _IO(0x12,125)
322#define BLKROTATIONAL _IO(0x12,126)
322 323
323#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ 324#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
324#define FIBMAP _IO(0x00,1) /* bmap access */ 325#define FIBMAP _IO(0x00,1) /* bmap access */
@@ -395,6 +396,7 @@ struct inodes_stat_t {
395#include <linux/rculist_bl.h> 396#include <linux/rculist_bl.h>
396#include <linux/atomic.h> 397#include <linux/atomic.h>
397#include <linux/shrinker.h> 398#include <linux/shrinker.h>
399#include <linux/migrate_mode.h>
398 400
399#include <asm/byteorder.h> 401#include <asm/byteorder.h>
400 402
@@ -525,7 +527,6 @@ enum positive_aop_returns {
525struct page; 527struct page;
526struct address_space; 528struct address_space;
527struct writeback_control; 529struct writeback_control;
528enum migrate_mode;
529 530
530struct iov_iter { 531struct iov_iter {
531 const struct iovec *iov; 532 const struct iovec *iov;
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 26eafcef75be..028e26f0bf08 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -133,6 +133,8 @@ struct ftrace_func_command {
133int ftrace_arch_code_modify_prepare(void); 133int ftrace_arch_code_modify_prepare(void);
134int ftrace_arch_code_modify_post_process(void); 134int ftrace_arch_code_modify_post_process(void);
135 135
136void ftrace_bug(int err, unsigned long ip);
137
136struct seq_file; 138struct seq_file;
137 139
138struct ftrace_probe_ops { 140struct ftrace_probe_ops {
@@ -161,7 +163,6 @@ extern int ftrace_text_reserved(void *start, void *end);
161 163
162enum { 164enum {
163 FTRACE_FL_ENABLED = (1 << 30), 165 FTRACE_FL_ENABLED = (1 << 30),
164 FTRACE_FL_FREE = (1 << 31),
165}; 166};
166 167
167#define FTRACE_FL_MASK (0x3UL << 30) 168#define FTRACE_FL_MASK (0x3UL << 30)
@@ -172,10 +173,7 @@ struct dyn_ftrace {
172 unsigned long ip; /* address of mcount call-site */ 173 unsigned long ip; /* address of mcount call-site */
173 struct dyn_ftrace *freelist; 174 struct dyn_ftrace *freelist;
174 }; 175 };
175 union { 176 unsigned long flags;
176 unsigned long flags;
177 struct dyn_ftrace *newlist;
178 };
179 struct dyn_arch_ftrace arch; 177 struct dyn_arch_ftrace arch;
180}; 178};
181 179
@@ -190,6 +188,56 @@ void ftrace_set_global_notrace(unsigned char *buf, int len, int reset);
190int register_ftrace_command(struct ftrace_func_command *cmd); 188int register_ftrace_command(struct ftrace_func_command *cmd);
191int unregister_ftrace_command(struct ftrace_func_command *cmd); 189int unregister_ftrace_command(struct ftrace_func_command *cmd);
192 190
191enum {
192 FTRACE_UPDATE_CALLS = (1 << 0),
193 FTRACE_DISABLE_CALLS = (1 << 1),
194 FTRACE_UPDATE_TRACE_FUNC = (1 << 2),
195 FTRACE_START_FUNC_RET = (1 << 3),
196 FTRACE_STOP_FUNC_RET = (1 << 4),
197};
198
199enum {
200 FTRACE_UPDATE_IGNORE,
201 FTRACE_UPDATE_MAKE_CALL,
202 FTRACE_UPDATE_MAKE_NOP,
203};
204
205enum {
206 FTRACE_ITER_FILTER = (1 << 0),
207 FTRACE_ITER_NOTRACE = (1 << 1),
208 FTRACE_ITER_PRINTALL = (1 << 2),
209 FTRACE_ITER_DO_HASH = (1 << 3),
210 FTRACE_ITER_HASH = (1 << 4),
211 FTRACE_ITER_ENABLED = (1 << 5),
212};
213
214void arch_ftrace_update_code(int command);
215
216struct ftrace_rec_iter;
217
218struct ftrace_rec_iter *ftrace_rec_iter_start(void);
219struct ftrace_rec_iter *ftrace_rec_iter_next(struct ftrace_rec_iter *iter);
220struct dyn_ftrace *ftrace_rec_iter_record(struct ftrace_rec_iter *iter);
221
222int ftrace_update_record(struct dyn_ftrace *rec, int enable);
223int ftrace_test_record(struct dyn_ftrace *rec, int enable);
224void ftrace_run_stop_machine(int command);
225int ftrace_location(unsigned long ip);
226
227extern ftrace_func_t ftrace_trace_function;
228
229int ftrace_regex_open(struct ftrace_ops *ops, int flag,
230 struct inode *inode, struct file *file);
231ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf,
232 size_t cnt, loff_t *ppos);
233ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
234 size_t cnt, loff_t *ppos);
235loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin);
236int ftrace_regex_release(struct inode *inode, struct file *file);
237
238void __init
239ftrace_set_early_filter(struct ftrace_ops *ops, char *buf, int enable);
240
193/* defined in arch */ 241/* defined in arch */
194extern int ftrace_ip_converted(unsigned long ip); 242extern int ftrace_ip_converted(unsigned long ip);
195extern int ftrace_dyn_arch_init(void *data); 243extern int ftrace_dyn_arch_init(void *data);
@@ -284,6 +332,25 @@ static inline int ftrace_text_reserved(void *start, void *end)
284{ 332{
285 return 0; 333 return 0;
286} 334}
335
336/*
337 * Again users of functions that have ftrace_ops may not
338 * have them defined when ftrace is not enabled, but these
339 * functions may still be called. Use a macro instead of inline.
340 */
341#define ftrace_regex_open(ops, flag, inod, file) ({ -ENODEV; })
342#define ftrace_set_early_filter(ops, buf, enable) do { } while (0)
343
344static inline ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf,
345 size_t cnt, loff_t *ppos) { return -ENODEV; }
346static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
347 size_t cnt, loff_t *ppos) { return -ENODEV; }
348static inline loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin)
349{
350 return -ENODEV;
351}
352static inline int
353ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; }
287#endif /* CONFIG_DYNAMIC_FTRACE */ 354#endif /* CONFIG_DYNAMIC_FTRACE */
288 355
289/* totally disable ftrace - can not re-enable after this */ 356/* totally disable ftrace - can not re-enable after this */
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index 4f4462974c14..b148087f49a6 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -22,6 +22,8 @@
22#define GFS2_LIVE_LOCK 1 22#define GFS2_LIVE_LOCK 1
23#define GFS2_TRANS_LOCK 2 23#define GFS2_TRANS_LOCK 2
24#define GFS2_RENAME_LOCK 3 24#define GFS2_RENAME_LOCK 3
25#define GFS2_CONTROL_LOCK 4
26#define GFS2_MOUNTED_LOCK 5
25 27
26/* Format numbers for various metadata types */ 28/* Format numbers for various metadata types */
27 29
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 114c0f6fc63d..78d3465251d6 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -652,10 +652,12 @@ struct twl4030_power_data {
652 unsigned num; 652 unsigned num;
653 struct twl4030_resconfig *resource_config; 653 struct twl4030_resconfig *resource_config;
654#define TWL4030_RESCONFIG_UNDEF ((u8)-1) 654#define TWL4030_RESCONFIG_UNDEF ((u8)-1)
655 bool use_poweroff; /* Board is wired for TWL poweroff */
655}; 656};
656 657
657extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); 658extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
658extern int twl4030_remove_script(u8 flags); 659extern int twl4030_remove_script(u8 flags);
660extern void twl4030_power_off(void);
659 661
660struct twl4030_codec_data { 662struct twl4030_codec_data {
661 unsigned int digimic_delay; /* in ms */ 663 unsigned int digimic_delay; /* in ms */
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index 828181fbad5d..58404b0c5010 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -46,6 +46,10 @@ struct team_port {
46 u32 speed; 46 u32 speed;
47 u8 duplex; 47 u8 duplex;
48 48
49 /* Custom gennetlink interface related flags */
50 bool changed;
51 bool removed;
52
49 struct rcu_head rcu; 53 struct rcu_head rcu;
50}; 54};
51 55
@@ -72,6 +76,10 @@ struct team_option {
72 enum team_option_type type; 76 enum team_option_type type;
73 int (*getter)(struct team *team, void *arg); 77 int (*getter)(struct team *team, void *arg);
74 int (*setter)(struct team *team, void *arg); 78 int (*setter)(struct team *team, void *arg);
79
80 /* Custom gennetlink interface related flags */
81 bool changed;
82 bool removed;
75}; 83};
76 84
77struct team_mode { 85struct team_mode {
@@ -207,6 +215,7 @@ enum {
207 TEAM_ATTR_OPTION_CHANGED, /* flag */ 215 TEAM_ATTR_OPTION_CHANGED, /* flag */
208 TEAM_ATTR_OPTION_TYPE, /* u8 */ 216 TEAM_ATTR_OPTION_TYPE, /* u8 */
209 TEAM_ATTR_OPTION_DATA, /* dynamic */ 217 TEAM_ATTR_OPTION_DATA, /* dynamic */
218 TEAM_ATTR_OPTION_REMOVED, /* flag */
210 219
211 __TEAM_ATTR_OPTION_MAX, 220 __TEAM_ATTR_OPTION_MAX,
212 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1, 221 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
@@ -227,6 +236,7 @@ enum {
227 TEAM_ATTR_PORT_LINKUP, /* flag */ 236 TEAM_ATTR_PORT_LINKUP, /* flag */
228 TEAM_ATTR_PORT_SPEED, /* u32 */ 237 TEAM_ATTR_PORT_SPEED, /* u32 */
229 TEAM_ATTR_PORT_DUPLEX, /* u8 */ 238 TEAM_ATTR_PORT_DUPLEX, /* u8 */
239 TEAM_ATTR_PORT_REMOVED, /* flag */
230 240
231 __TEAM_ATTR_PORT_MAX, 241 __TEAM_ATTR_PORT_MAX,
232 TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1, 242 TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1,
diff --git a/include/linux/init.h b/include/linux/init.h
index 9146f39cdddf..6b951095a42f 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -2,6 +2,7 @@
2#define _LINUX_INIT_H 2#define _LINUX_INIT_H
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <linux/types.h>
5 6
6/* These macros are used to mark some functions or 7/* These macros are used to mark some functions or
7 * initialized data (doesn't apply to uninitialized data) 8 * initialized data (doesn't apply to uninitialized data)
@@ -156,7 +157,7 @@ void prepare_namespace(void);
156 157
157extern void (*late_time_init)(void); 158extern void (*late_time_init)(void);
158 159
159extern int initcall_debug; 160extern bool initcall_debug;
160 161
161#endif 162#endif
162 163
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index 5037a0ad2312..7e1371c4bccf 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -3,32 +3,92 @@
3 3
4#include <linux/radix-tree.h> 4#include <linux/radix-tree.h>
5#include <linux/rcupdate.h> 5#include <linux/rcupdate.h>
6#include <linux/workqueue.h>
6 7
7struct cfq_queue; 8enum {
8struct cfq_ttime { 9 ICQ_IOPRIO_CHANGED,
9 unsigned long last_end_request; 10 ICQ_CGROUP_CHANGED,
10
11 unsigned long ttime_total;
12 unsigned long ttime_samples;
13 unsigned long ttime_mean;
14}; 11};
15 12
16struct cfq_io_context { 13/*
17 void *key; 14 * An io_cq (icq) is association between an io_context (ioc) and a
18 15 * request_queue (q). This is used by elevators which need to track
19 struct cfq_queue *cfqq[2]; 16 * information per ioc - q pair.
20 17 *
21 struct io_context *ioc; 18 * Elevator can request use of icq by setting elevator_type->icq_size and
22 19 * ->icq_align. Both size and align must be larger than that of struct
23 struct cfq_ttime ttime; 20 * io_cq and elevator can use the tail area for private information. The
24 21 * recommended way to do this is defining a struct which contains io_cq as
25 struct list_head queue_list; 22 * the first member followed by private members and using its size and
26 struct hlist_node cic_list; 23 * align. For example,
27 24 *
28 void (*dtor)(struct io_context *); /* destructor */ 25 * struct snail_io_cq {
29 void (*exit)(struct io_context *); /* called on task exit */ 26 * struct io_cq icq;
27 * int poke_snail;
28 * int feed_snail;
29 * };
30 *
31 * struct elevator_type snail_elv_type {
32 * .ops = { ... },
33 * .icq_size = sizeof(struct snail_io_cq),
34 * .icq_align = __alignof__(struct snail_io_cq),
35 * ...
36 * };
37 *
38 * If icq_size is set, block core will manage icq's. All requests will
39 * have its ->elv.icq field set before elevator_ops->elevator_set_req_fn()
40 * is called and be holding a reference to the associated io_context.
41 *
42 * Whenever a new icq is created, elevator_ops->elevator_init_icq_fn() is
43 * called and, on destruction, ->elevator_exit_icq_fn(). Both functions
44 * are called with both the associated io_context and queue locks held.
45 *
46 * Elevator is allowed to lookup icq using ioc_lookup_icq() while holding
47 * queue lock but the returned icq is valid only until the queue lock is
48 * released. Elevators can not and should not try to create or destroy
49 * icq's.
50 *
51 * As icq's are linked from both ioc and q, the locking rules are a bit
52 * complex.
53 *
54 * - ioc lock nests inside q lock.
55 *
56 * - ioc->icq_list and icq->ioc_node are protected by ioc lock.
57 * q->icq_list and icq->q_node by q lock.
58 *
59 * - ioc->icq_tree and ioc->icq_hint are protected by ioc lock, while icq
60 * itself is protected by q lock. However, both the indexes and icq
61 * itself are also RCU managed and lookup can be performed holding only
62 * the q lock.
63 *
64 * - icq's are not reference counted. They are destroyed when either the
65 * ioc or q goes away. Each request with icq set holds an extra
66 * reference to ioc to ensure it stays until the request is completed.
67 *
68 * - Linking and unlinking icq's are performed while holding both ioc and q
69 * locks. Due to the lock ordering, q exit is simple but ioc exit
70 * requires reverse-order double lock dance.
71 */
72struct io_cq {
73 struct request_queue *q;
74 struct io_context *ioc;
30 75
31 struct rcu_head rcu_head; 76 /*
77 * q_node and ioc_node link io_cq through icq_list of q and ioc
78 * respectively. Both fields are unused once ioc_exit_icq() is
79 * called and shared with __rcu_icq_cache and __rcu_head which are
80 * used for RCU free of io_cq.
81 */
82 union {
83 struct list_head q_node;
84 struct kmem_cache *__rcu_icq_cache;
85 };
86 union {
87 struct hlist_node ioc_node;
88 struct rcu_head __rcu_head;
89 };
90
91 unsigned long changed;
32}; 92};
33 93
34/* 94/*
@@ -43,11 +103,6 @@ struct io_context {
43 spinlock_t lock; 103 spinlock_t lock;
44 104
45 unsigned short ioprio; 105 unsigned short ioprio;
46 unsigned short ioprio_changed;
47
48#if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE)
49 unsigned short cgroup_changed;
50#endif
51 106
52 /* 107 /*
53 * For request batching 108 * For request batching
@@ -55,9 +110,11 @@ struct io_context {
55 int nr_batch_requests; /* Number of requests left in the batch */ 110 int nr_batch_requests; /* Number of requests left in the batch */
56 unsigned long last_waited; /* Time last woken after wait for request */ 111 unsigned long last_waited; /* Time last woken after wait for request */
57 112
58 struct radix_tree_root radix_root; 113 struct radix_tree_root icq_tree;
59 struct hlist_head cic_list; 114 struct io_cq __rcu *icq_hint;
60 void __rcu *ioc_data; 115 struct hlist_head icq_list;
116
117 struct work_struct release_work;
61}; 118};
62 119
63static inline struct io_context *ioc_task_link(struct io_context *ioc) 120static inline struct io_context *ioc_task_link(struct io_context *ioc)
@@ -76,20 +133,17 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc)
76 133
77struct task_struct; 134struct task_struct;
78#ifdef CONFIG_BLOCK 135#ifdef CONFIG_BLOCK
79int put_io_context(struct io_context *ioc); 136void put_io_context(struct io_context *ioc, struct request_queue *locked_q);
80void exit_io_context(struct task_struct *task); 137void exit_io_context(struct task_struct *task);
81struct io_context *get_io_context(gfp_t gfp_flags, int node); 138struct io_context *get_task_io_context(struct task_struct *task,
82struct io_context *alloc_io_context(gfp_t gfp_flags, int node); 139 gfp_t gfp_flags, int node);
140void ioc_ioprio_changed(struct io_context *ioc, int ioprio);
141void ioc_cgroup_changed(struct io_context *ioc);
83#else 142#else
84static inline void exit_io_context(struct task_struct *task)
85{
86}
87
88struct io_context; 143struct io_context;
89static inline int put_io_context(struct io_context *ioc) 144static inline void put_io_context(struct io_context *ioc,
90{ 145 struct request_queue *locked_q) { }
91 return 1; 146static inline void exit_io_context(struct task_struct *task) { }
92}
93#endif 147#endif
94 148
95#endif 149#endif
diff --git a/include/linux/isdn_divertif.h b/include/linux/isdn_divertif.h
index 07821ca5955f..a5a50f523807 100644
--- a/include/linux/isdn_divertif.h
+++ b/include/linux/isdn_divertif.h
@@ -10,6 +10,8 @@
10 * 10 *
11 */ 11 */
12 12
13#ifndef _LINUX_ISDN_DIVERTIF_H
14#define _LINUX_ISDN_DIVERTIF_H
13 15
14/***********************************************************/ 16/***********************************************************/
15/* magic value is also used to control version information */ 17/* magic value is also used to control version information */
@@ -45,3 +47,5 @@ typedef struct
45/*********************/ 47/*********************/
46extern int DIVERT_REG_NAME(isdn_divert_if *); 48extern int DIVERT_REG_NAME(isdn_divert_if *);
47#endif 49#endif
50
51#endif /* _LINUX_ISDN_DIVERTIF_H */
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 2fa0901219d4..0d7d6a1b172f 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -50,9 +50,11 @@
50 * note header. For kdump, the code in vmcore.c runs in the context 50 * note header. For kdump, the code in vmcore.c runs in the context
51 * of the second kernel to combine them into one note. 51 * of the second kernel to combine them into one note.
52 */ 52 */
53#ifndef KEXEC_NOTE_BYTES
53#define KEXEC_NOTE_BYTES ( (KEXEC_NOTE_HEAD_BYTES * 2) + \ 54#define KEXEC_NOTE_BYTES ( (KEXEC_NOTE_HEAD_BYTES * 2) + \
54 KEXEC_CORE_NOTE_NAME_BYTES + \ 55 KEXEC_CORE_NOTE_NAME_BYTES + \
55 KEXEC_CORE_NOTE_DESC_BYTES ) 56 KEXEC_CORE_NOTE_DESC_BYTES )
57#endif
56 58
57/* 59/*
58 * This structure is used to hold the arguments that are used when loading 60 * This structure is used to hold the arguments that are used when loading
diff --git a/include/linux/key.h b/include/linux/key.h
index 183a6af7715d..5253471cd2ea 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -271,7 +271,7 @@ extern int keyring_add_key(struct key *keyring,
271 271
272extern struct key *key_lookup(key_serial_t id); 272extern struct key *key_lookup(key_serial_t id);
273 273
274static inline key_serial_t key_serial(struct key *key) 274static inline key_serial_t key_serial(const struct key *key)
275{ 275{
276 return key ? key->serial : 0; 276 return key ? key->serial : 0;
277} 277}
@@ -293,6 +293,9 @@ static inline bool key_is_instantiated(const struct key *key)
293 (rcu_dereference_protected((KEY)->payload.rcudata, \ 293 (rcu_dereference_protected((KEY)->payload.rcudata, \
294 rwsem_is_locked(&((struct key *)(KEY))->sem))) 294 rwsem_is_locked(&((struct key *)(KEY))->sem)))
295 295
296#define rcu_assign_keypointer(KEY, PAYLOAD) \
297 (rcu_assign_pointer((KEY)->payload.rcudata, PAYLOAD))
298
296#ifdef CONFIG_SYSCTL 299#ifdef CONFIG_SYSCTL
297extern ctl_table key_sysctls[]; 300extern ctl_table key_sysctls[];
298#endif 301#endif
diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h
index 99d9a6766f7e..2a5e5548a1d2 100644
--- a/include/linux/kmemleak.h
+++ b/include/linux/kmemleak.h
@@ -26,8 +26,10 @@
26extern void kmemleak_init(void) __ref; 26extern void kmemleak_init(void) __ref;
27extern void kmemleak_alloc(const void *ptr, size_t size, int min_count, 27extern void kmemleak_alloc(const void *ptr, size_t size, int min_count,
28 gfp_t gfp) __ref; 28 gfp_t gfp) __ref;
29extern void kmemleak_alloc_percpu(const void __percpu *ptr, size_t size) __ref;
29extern void kmemleak_free(const void *ptr) __ref; 30extern void kmemleak_free(const void *ptr) __ref;
30extern void kmemleak_free_part(const void *ptr, size_t size) __ref; 31extern void kmemleak_free_part(const void *ptr, size_t size) __ref;
32extern void kmemleak_free_percpu(const void __percpu *ptr) __ref;
31extern void kmemleak_padding(const void *ptr, unsigned long offset, 33extern void kmemleak_padding(const void *ptr, unsigned long offset,
32 size_t size) __ref; 34 size_t size) __ref;
33extern void kmemleak_not_leak(const void *ptr) __ref; 35extern void kmemleak_not_leak(const void *ptr) __ref;
@@ -68,6 +70,9 @@ static inline void kmemleak_alloc_recursive(const void *ptr, size_t size,
68 gfp_t gfp) 70 gfp_t gfp)
69{ 71{
70} 72}
73static inline void kmemleak_alloc_percpu(const void __percpu *ptr, size_t size)
74{
75}
71static inline void kmemleak_free(const void *ptr) 76static inline void kmemleak_free(const void *ptr)
72{ 77{
73} 78}
@@ -77,6 +82,9 @@ static inline void kmemleak_free_part(const void *ptr, size_t size)
77static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags) 82static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags)
78{ 83{
79} 84}
85static inline void kmemleak_free_percpu(const void __percpu *ptr)
86{
87}
80static inline void kmemleak_not_leak(const void *ptr) 88static inline void kmemleak_not_leak(const void *ptr)
81{ 89{
82} 90}
diff --git a/include/linux/kref.h b/include/linux/kref.h
index abc0120b09b7..9c07dcebded7 100644
--- a/include/linux/kref.h
+++ b/include/linux/kref.h
@@ -17,6 +17,7 @@
17 17
18#include <linux/bug.h> 18#include <linux/bug.h>
19#include <linux/atomic.h> 19#include <linux/atomic.h>
20#include <linux/kernel.h>
20 21
21struct kref { 22struct kref {
22 atomic_t refcount; 23 atomic_t refcount;
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 90b0656a869e..88a114fce477 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -195,7 +195,7 @@ extern struct svc_procedure nlmsvc_procedures4[];
195#endif 195#endif
196extern int nlmsvc_grace_period; 196extern int nlmsvc_grace_period;
197extern unsigned long nlmsvc_timeout; 197extern unsigned long nlmsvc_timeout;
198extern int nsm_use_hostnames; 198extern bool nsm_use_hostnames;
199extern u32 nsm_local_state; 199extern u32 nsm_local_state;
200 200
201/* 201/*
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
index 63b4fb8e3b6f..92be3476c9f5 100644
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@ -297,10 +297,11 @@ enum {
297 297
298struct pm860x_chip { 298struct pm860x_chip {
299 struct device *dev; 299 struct device *dev;
300 struct mutex io_lock;
301 struct mutex irq_lock; 300 struct mutex irq_lock;
302 struct i2c_client *client; 301 struct i2c_client *client;
303 struct i2c_client *companion; /* companion chip client */ 302 struct i2c_client *companion; /* companion chip client */
303 struct regmap *regmap;
304 struct regmap *regmap_companion;
304 305
305 int buck3_double; /* DVC ramp slope double */ 306 int buck3_double; /* DVC ramp slope double */
306 unsigned short companion_addr; 307 unsigned short companion_addr;
diff --git a/include/linux/mfd/ab5500/ab5500.h b/include/linux/mfd/abx500/ab5500.h
index a720051ae933..a720051ae933 100644
--- a/include/linux/mfd/ab5500/ab5500.h
+++ b/include/linux/mfd/abx500/ab5500.h
diff --git a/include/linux/mfd/ab8500/gpadc.h b/include/linux/mfd/abx500/ab8500-gpadc.h
index 252966769d93..252966769d93 100644
--- a/include/linux/mfd/ab8500/gpadc.h
+++ b/include/linux/mfd/abx500/ab8500-gpadc.h
diff --git a/include/linux/mfd/ab8500/gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h
index 488a8c920a29..488a8c920a29 100644
--- a/include/linux/mfd/ab8500/gpio.h
+++ b/include/linux/mfd/abx500/ab8500-gpio.h
diff --git a/include/linux/mfd/ab8500/sysctrl.h b/include/linux/mfd/abx500/ab8500-sysctrl.h
index 10da0291f8f8..10da0291f8f8 100644
--- a/include/linux/mfd/ab8500/sysctrl.h
+++ b/include/linux/mfd/abx500/ab8500-sysctrl.h
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 838c6b487cc5..838c6b487cc5 100644
--- a/include/linux/mfd/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
diff --git a/include/linux/mfd/max8925.h b/include/linux/mfd/max8925.h
index b8e6d9449086..15b2392a56fb 100644
--- a/include/linux/mfd/max8925.h
+++ b/include/linux/mfd/max8925.h
@@ -203,6 +203,8 @@ struct max8925_chip {
203 int irq_base; 203 int irq_base;
204 int core_irq; 204 int core_irq;
205 int tsc_irq; 205 int tsc_irq;
206
207 unsigned int wakeup_flag;
206}; 208};
207 209
208struct max8925_backlight_pdata { 210struct max8925_backlight_pdata {
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h
index 0bbd13dbe336..fff590521e50 100644
--- a/include/linux/mfd/max8997.h
+++ b/include/linux/mfd/max8997.h
@@ -77,6 +77,82 @@ struct max8997_regulator_data {
77 struct regulator_init_data *initdata; 77 struct regulator_init_data *initdata;
78}; 78};
79 79
80enum max8997_muic_usb_type {
81 MAX8997_USB_HOST,
82 MAX8997_USB_DEVICE,
83};
84
85enum max8997_muic_charger_type {
86 MAX8997_CHARGER_TYPE_NONE = 0,
87 MAX8997_CHARGER_TYPE_USB,
88 MAX8997_CHARGER_TYPE_DOWNSTREAM_PORT,
89 MAX8997_CHARGER_TYPE_DEDICATED_CHG,
90 MAX8997_CHARGER_TYPE_500MA,
91 MAX8997_CHARGER_TYPE_1A,
92 MAX8997_CHARGER_TYPE_DEAD_BATTERY = 7,
93};
94
95struct max8997_muic_reg_data {
96 u8 addr;
97 u8 data;
98};
99
100/**
101 * struct max8997_muic_platform_data
102 * @usb_callback: callback function for USB
103 * inform callee of USB type (HOST or DEVICE)
104 * and attached state(true or false)
105 * @charger_callback: callback function for charger
106 * inform callee of charger_type
107 * and attached state(true or false)
108 * @deskdock_callback: callback function for desk dock
109 * inform callee of attached state(true or false)
110 * @cardock_callback: callback function for car dock
111 * inform callee of attached state(true or false)
112 * @mhl_callback: callback function for MHL (Mobile High-definition Link)
113 * inform callee of attached state(true or false)
114 * @uart_callback: callback function for JIG UART
115 * inform callee of attached state(true or false)
116 * @init_data: array of max8997_muic_reg_data
117 * used for initializing registers of MAX8997 MUIC device
118 * @num_init_data: array size of init_data
119 */
120struct max8997_muic_platform_data {
121 void (*usb_callback)(enum max8997_muic_usb_type usb_type,
122 bool attached);
123 void (*charger_callback)(bool attached,
124 enum max8997_muic_charger_type charger_type);
125 void (*deskdock_callback) (bool attached);
126 void (*cardock_callback) (bool attached);
127 void (*mhl_callback) (bool attached);
128 void (*uart_callback) (bool attached);
129
130 struct max8997_muic_reg_data *init_data;
131 int num_init_data;
132};
133
134enum max8997_led_mode {
135 MAX8997_NONE,
136 MAX8997_FLASH_MODE,
137 MAX8997_MOVIE_MODE,
138 MAX8997_FLASH_PIN_CONTROL_MODE,
139 MAX8997_MOVIE_PIN_CONTROL_MODE,
140};
141
142/**
143 * struct max8997_led_platform_data
144 * The number of LED devices for MAX8997 is two
145 * @mode: LED mode for each LED device
146 * @brightness: initial brightness for each LED device
147 * range:
148 * [0 - 31]: MAX8997_FLASH_MODE and MAX8997_FLASH_PIN_CONTROL_MODE
149 * [0 - 15]: MAX8997_MOVIE_MODE and MAX8997_MOVIE_PIN_CONTROL_MODE
150 */
151struct max8997_led_platform_data {
152 enum max8997_led_mode mode[2];
153 u8 brightness[2];
154};
155
80struct max8997_platform_data { 156struct max8997_platform_data {
81 /* IRQ */ 157 /* IRQ */
82 int irq_base; 158 int irq_base;
@@ -113,10 +189,13 @@ struct max8997_platform_data {
113 /* charge Full Timeout */ 189 /* charge Full Timeout */
114 int timeout; /* 0 (no timeout), 5, 6, 7 hours */ 190 int timeout; /* 0 (no timeout), 5, 6, 7 hours */
115 191
116 /* MUIC: Not implemented */ 192 /* ---- MUIC ---- */
193 struct max8997_muic_platform_data *muic_pdata;
194
117 /* HAPTIC: Not implemented */ 195 /* HAPTIC: Not implemented */
118 /* RTC: Not implemented */ 196 /* RTC: Not implemented */
119 /* Flash: Not implemented */ 197 /* ---- LED ---- */
198 struct max8997_led_platform_data *led_pdata;
120}; 199};
121 200
122#endif /* __LINUX_MFD_MAX8998_H */ 201#endif /* __LINUX_MFD_MAX8998_H */
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
index a98e2a316d1f..b86ee45c8b03 100644
--- a/include/linux/mfd/mc13xxx.h
+++ b/include/linux/mfd/mc13xxx.h
@@ -174,6 +174,9 @@ struct mc13xxx_platform_data {
174#define MC13XXX_ADC_MODE_MULT_CHAN 3 174#define MC13XXX_ADC_MODE_MULT_CHAN 3
175 175
176#define MC13XXX_ADC0 43 176#define MC13XXX_ADC0 43
177#define MC13XXX_ADC0_LICELLCON (1 << 0)
178#define MC13XXX_ADC0_CHRGICON (1 << 1)
179#define MC13XXX_ADC0_BATICON (1 << 2)
177#define MC13XXX_ADC0_ADREFEN (1 << 10) 180#define MC13XXX_ADC0_ADREFEN (1 << 10)
178#define MC13XXX_ADC0_TSMOD0 (1 << 12) 181#define MC13XXX_ADC0_TSMOD0 (1 << 12)
179#define MC13XXX_ADC0_TSMOD1 (1 << 13) 182#define MC13XXX_ADC0_TSMOD1 (1 << 13)
@@ -185,4 +188,9 @@ struct mc13xxx_platform_data {
185 MC13XXX_ADC0_TSMOD1 | \ 188 MC13XXX_ADC0_TSMOD1 | \
186 MC13XXX_ADC0_TSMOD2) 189 MC13XXX_ADC0_TSMOD2)
187 190
191#define MC13XXX_ADC0_CONFIG_MASK (MC13XXX_ADC0_TSMOD_MASK | \
192 MC13XXX_ADC0_LICELLCON | \
193 MC13XXX_ADC0_CHRGICON | \
194 MC13XXX_ADC0_BATICON)
195
188#endif /* ifndef __LINUX_MFD_MC13XXX_H */ 196#endif /* ifndef __LINUX_MFD_MC13XXX_H */
diff --git a/include/linux/mfd/mcp.h b/include/linux/mfd/mcp.h
index ee496708e38b..1515e64e3663 100644
--- a/include/linux/mfd/mcp.h
+++ b/include/linux/mfd/mcp.h
@@ -10,6 +10,7 @@
10#ifndef MCP_H 10#ifndef MCP_H
11#define MCP_H 11#define MCP_H
12 12
13#include <linux/mod_devicetable.h>
13#include <mach/dma.h> 14#include <mach/dma.h>
14 15
15struct mcp_ops; 16struct mcp_ops;
@@ -26,7 +27,7 @@ struct mcp {
26 dma_device_t dma_telco_rd; 27 dma_device_t dma_telco_rd;
27 dma_device_t dma_telco_wr; 28 dma_device_t dma_telco_wr;
28 struct device attached_device; 29 struct device attached_device;
29 int gpio_base; 30 const char *codec;
30}; 31};
31 32
32struct mcp_ops { 33struct mcp_ops {
@@ -44,10 +45,11 @@ void mcp_reg_write(struct mcp *, unsigned int, unsigned int);
44unsigned int mcp_reg_read(struct mcp *, unsigned int); 45unsigned int mcp_reg_read(struct mcp *, unsigned int);
45void mcp_enable(struct mcp *); 46void mcp_enable(struct mcp *);
46void mcp_disable(struct mcp *); 47void mcp_disable(struct mcp *);
48const struct mcp_device_id *mcp_get_device_id(const struct mcp *mcp);
47#define mcp_get_sclk_rate(mcp) ((mcp)->sclk_rate) 49#define mcp_get_sclk_rate(mcp) ((mcp)->sclk_rate)
48 50
49struct mcp *mcp_host_alloc(struct device *, size_t); 51struct mcp *mcp_host_alloc(struct device *, size_t);
50int mcp_host_register(struct mcp *); 52int mcp_host_register(struct mcp *, void *);
51void mcp_host_unregister(struct mcp *); 53void mcp_host_unregister(struct mcp *);
52 54
53struct mcp_driver { 55struct mcp_driver {
@@ -56,6 +58,7 @@ struct mcp_driver {
56 void (*remove)(struct mcp *); 58 void (*remove)(struct mcp *);
57 int (*suspend)(struct mcp *, pm_message_t); 59 int (*suspend)(struct mcp *, pm_message_t);
58 int (*resume)(struct mcp *); 60 int (*resume)(struct mcp *);
61 const struct mcp_device_id *id_table;
59}; 62};
60 63
61int mcp_driver_register(struct mcp_driver *); 64int mcp_driver_register(struct mcp_driver *);
diff --git a/include/linux/mfd/s5m87xx/s5m-core.h b/include/linux/mfd/s5m87xx/s5m-core.h
new file mode 100644
index 000000000000..a7480b57f92d
--- /dev/null
+++ b/include/linux/mfd/s5m87xx/s5m-core.h
@@ -0,0 +1,373 @@
1/*
2 * s5m-core.h
3 *
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd
5 * http://www.samsung.com
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14#ifndef __LINUX_MFD_S5M_CORE_H
15#define __LINUX_MFD_S5M_CORE_H
16
17#define NUM_IRQ_REGS 4
18
19enum s5m_device_type {
20 S5M8751X,
21 S5M8763X,
22 S5M8767X,
23};
24
25/* S5M8767 registers */
26enum s5m8767_reg {
27 S5M8767_REG_ID,
28 S5M8767_REG_INT1,
29 S5M8767_REG_INT2,
30 S5M8767_REG_INT3,
31 S5M8767_REG_INT1M,
32 S5M8767_REG_INT2M,
33 S5M8767_REG_INT3M,
34 S5M8767_REG_STATUS1,
35 S5M8767_REG_STATUS2,
36 S5M8767_REG_STATUS3,
37 S5M8767_REG_CTRL1,
38 S5M8767_REG_CTRL2,
39 S5M8767_REG_LOWBAT1,
40 S5M8767_REG_LOWBAT2,
41 S5M8767_REG_BUCHG,
42 S5M8767_REG_DVSRAMP,
43 S5M8767_REG_DVSTIMER2 = 0x10,
44 S5M8767_REG_DVSTIMER3,
45 S5M8767_REG_DVSTIMER4,
46 S5M8767_REG_LDO1,
47 S5M8767_REG_LDO2,
48 S5M8767_REG_LDO3,
49 S5M8767_REG_LDO4,
50 S5M8767_REG_LDO5,
51 S5M8767_REG_LDO6,
52 S5M8767_REG_LDO7,
53 S5M8767_REG_LDO8,
54 S5M8767_REG_LDO9,
55 S5M8767_REG_LDO10,
56 S5M8767_REG_LDO11,
57 S5M8767_REG_LDO12,
58 S5M8767_REG_LDO13,
59 S5M8767_REG_LDO14 = 0x20,
60 S5M8767_REG_LDO15,
61 S5M8767_REG_LDO16,
62 S5M8767_REG_LDO17,
63 S5M8767_REG_LDO18,
64 S5M8767_REG_LDO19,
65 S5M8767_REG_LDO20,
66 S5M8767_REG_LDO21,
67 S5M8767_REG_LDO22,
68 S5M8767_REG_LDO23,
69 S5M8767_REG_LDO24,
70 S5M8767_REG_LDO25,
71 S5M8767_REG_LDO26,
72 S5M8767_REG_LDO27,
73 S5M8767_REG_LDO28,
74 S5M8767_REG_UVLO = 0x31,
75 S5M8767_REG_BUCK1CTRL1,
76 S5M8767_REG_BUCK1CTRL2,
77 S5M8767_REG_BUCK2CTRL,
78 S5M8767_REG_BUCK2DVS1,
79 S5M8767_REG_BUCK2DVS2,
80 S5M8767_REG_BUCK2DVS3,
81 S5M8767_REG_BUCK2DVS4,
82 S5M8767_REG_BUCK2DVS5,
83 S5M8767_REG_BUCK2DVS6,
84 S5M8767_REG_BUCK2DVS7,
85 S5M8767_REG_BUCK2DVS8,
86 S5M8767_REG_BUCK3CTRL,
87 S5M8767_REG_BUCK3DVS1,
88 S5M8767_REG_BUCK3DVS2,
89 S5M8767_REG_BUCK3DVS3,
90 S5M8767_REG_BUCK3DVS4,
91 S5M8767_REG_BUCK3DVS5,
92 S5M8767_REG_BUCK3DVS6,
93 S5M8767_REG_BUCK3DVS7,
94 S5M8767_REG_BUCK3DVS8,
95 S5M8767_REG_BUCK4CTRL,
96 S5M8767_REG_BUCK4DVS1,
97 S5M8767_REG_BUCK4DVS2,
98 S5M8767_REG_BUCK4DVS3,
99 S5M8767_REG_BUCK4DVS4,
100 S5M8767_REG_BUCK4DVS5,
101 S5M8767_REG_BUCK4DVS6,
102 S5M8767_REG_BUCK4DVS7,
103 S5M8767_REG_BUCK4DVS8,
104 S5M8767_REG_BUCK5CTRL1,
105 S5M8767_REG_BUCK5CTRL2,
106 S5M8767_REG_BUCK5CTRL3,
107 S5M8767_REG_BUCK5CTRL4,
108 S5M8767_REG_BUCK5CTRL5,
109 S5M8767_REG_BUCK6CTRL1,
110 S5M8767_REG_BUCK6CTRL2,
111 S5M8767_REG_BUCK7CTRL1,
112 S5M8767_REG_BUCK7CTRL2,
113 S5M8767_REG_BUCK8CTRL1,
114 S5M8767_REG_BUCK8CTRL2,
115 S5M8767_REG_BUCK9CTRL1,
116 S5M8767_REG_BUCK9CTRL2,
117 S5M8767_REG_LDO1CTRL,
118 S5M8767_REG_LDO2_1CTRL,
119 S5M8767_REG_LDO2_2CTRL,
120 S5M8767_REG_LDO2_3CTRL,
121 S5M8767_REG_LDO2_4CTRL,
122 S5M8767_REG_LDO3CTRL,
123 S5M8767_REG_LDO4CTRL,
124 S5M8767_REG_LDO5CTRL,
125 S5M8767_REG_LDO6CTRL,
126 S5M8767_REG_LDO7CTRL,
127 S5M8767_REG_LDO8CTRL,
128 S5M8767_REG_LDO9CTRL,
129 S5M8767_REG_LDO10CTRL,
130 S5M8767_REG_LDO11CTRL,
131 S5M8767_REG_LDO12CTRL,
132 S5M8767_REG_LDO13CTRL,
133 S5M8767_REG_LDO14CTRL,
134 S5M8767_REG_LDO15CTRL,
135 S5M8767_REG_LDO16CTRL,
136 S5M8767_REG_LDO17CTRL,
137 S5M8767_REG_LDO18CTRL,
138 S5M8767_REG_LDO19CTRL,
139 S5M8767_REG_LDO20CTRL,
140 S5M8767_REG_LDO21CTRL,
141 S5M8767_REG_LDO22CTRL,
142 S5M8767_REG_LDO23CTRL,
143 S5M8767_REG_LDO24CTRL,
144 S5M8767_REG_LDO25CTRL,
145 S5M8767_REG_LDO26CTRL,
146 S5M8767_REG_LDO27CTRL,
147 S5M8767_REG_LDO28CTRL,
148};
149
150/* S5M8763 registers */
151enum s5m8763_reg {
152 S5M8763_REG_IRQ1,
153 S5M8763_REG_IRQ2,
154 S5M8763_REG_IRQ3,
155 S5M8763_REG_IRQ4,
156 S5M8763_REG_IRQM1,
157 S5M8763_REG_IRQM2,
158 S5M8763_REG_IRQM3,
159 S5M8763_REG_IRQM4,
160 S5M8763_REG_STATUS1,
161 S5M8763_REG_STATUS2,
162 S5M8763_REG_STATUSM1,
163 S5M8763_REG_STATUSM2,
164 S5M8763_REG_CHGR1,
165 S5M8763_REG_CHGR2,
166 S5M8763_REG_LDO_ACTIVE_DISCHARGE1,
167 S5M8763_REG_LDO_ACTIVE_DISCHARGE2,
168 S5M8763_REG_BUCK_ACTIVE_DISCHARGE3,
169 S5M8763_REG_ONOFF1,
170 S5M8763_REG_ONOFF2,
171 S5M8763_REG_ONOFF3,
172 S5M8763_REG_ONOFF4,
173 S5M8763_REG_BUCK1_VOLTAGE1,
174 S5M8763_REG_BUCK1_VOLTAGE2,
175 S5M8763_REG_BUCK1_VOLTAGE3,
176 S5M8763_REG_BUCK1_VOLTAGE4,
177 S5M8763_REG_BUCK2_VOLTAGE1,
178 S5M8763_REG_BUCK2_VOLTAGE2,
179 S5M8763_REG_BUCK3,
180 S5M8763_REG_BUCK4,
181 S5M8763_REG_LDO1_LDO2,
182 S5M8763_REG_LDO3,
183 S5M8763_REG_LDO4,
184 S5M8763_REG_LDO5,
185 S5M8763_REG_LDO6,
186 S5M8763_REG_LDO7,
187 S5M8763_REG_LDO7_LDO8,
188 S5M8763_REG_LDO9_LDO10,
189 S5M8763_REG_LDO11,
190 S5M8763_REG_LDO12,
191 S5M8763_REG_LDO13,
192 S5M8763_REG_LDO14,
193 S5M8763_REG_LDO15,
194 S5M8763_REG_LDO16,
195 S5M8763_REG_BKCHR,
196 S5M8763_REG_LBCNFG1,
197 S5M8763_REG_LBCNFG2,
198};
199
200enum s5m8767_irq {
201 S5M8767_IRQ_PWRR,
202 S5M8767_IRQ_PWRF,
203 S5M8767_IRQ_PWR1S,
204 S5M8767_IRQ_JIGR,
205 S5M8767_IRQ_JIGF,
206 S5M8767_IRQ_LOWBAT2,
207 S5M8767_IRQ_LOWBAT1,
208
209 S5M8767_IRQ_MRB,
210 S5M8767_IRQ_DVSOK2,
211 S5M8767_IRQ_DVSOK3,
212 S5M8767_IRQ_DVSOK4,
213
214 S5M8767_IRQ_RTC60S,
215 S5M8767_IRQ_RTCA1,
216 S5M8767_IRQ_RTCA2,
217 S5M8767_IRQ_SMPL,
218 S5M8767_IRQ_RTC1S,
219 S5M8767_IRQ_WTSR,
220
221 S5M8767_IRQ_NR,
222};
223
224#define S5M8767_IRQ_PWRR_MASK (1 << 0)
225#define S5M8767_IRQ_PWRF_MASK (1 << 1)
226#define S5M8767_IRQ_PWR1S_MASK (1 << 3)
227#define S5M8767_IRQ_JIGR_MASK (1 << 4)
228#define S5M8767_IRQ_JIGF_MASK (1 << 5)
229#define S5M8767_IRQ_LOWBAT2_MASK (1 << 6)
230#define S5M8767_IRQ_LOWBAT1_MASK (1 << 7)
231
232#define S5M8767_IRQ_MRB_MASK (1 << 2)
233#define S5M8767_IRQ_DVSOK2_MASK (1 << 3)
234#define S5M8767_IRQ_DVSOK3_MASK (1 << 4)
235#define S5M8767_IRQ_DVSOK4_MASK (1 << 5)
236
237#define S5M8767_IRQ_RTC60S_MASK (1 << 0)
238#define S5M8767_IRQ_RTCA1_MASK (1 << 1)
239#define S5M8767_IRQ_RTCA2_MASK (1 << 2)
240#define S5M8767_IRQ_SMPL_MASK (1 << 3)
241#define S5M8767_IRQ_RTC1S_MASK (1 << 4)
242#define S5M8767_IRQ_WTSR_MASK (1 << 5)
243
244enum s5m8763_irq {
245 S5M8763_IRQ_DCINF,
246 S5M8763_IRQ_DCINR,
247 S5M8763_IRQ_JIGF,
248 S5M8763_IRQ_JIGR,
249 S5M8763_IRQ_PWRONF,
250 S5M8763_IRQ_PWRONR,
251
252 S5M8763_IRQ_WTSREVNT,
253 S5M8763_IRQ_SMPLEVNT,
254 S5M8763_IRQ_ALARM1,
255 S5M8763_IRQ_ALARM0,
256
257 S5M8763_IRQ_ONKEY1S,
258 S5M8763_IRQ_TOPOFFR,
259 S5M8763_IRQ_DCINOVPR,
260 S5M8763_IRQ_CHGRSTF,
261 S5M8763_IRQ_DONER,
262 S5M8763_IRQ_CHGFAULT,
263
264 S5M8763_IRQ_LOBAT1,
265 S5M8763_IRQ_LOBAT2,
266
267 S5M8763_IRQ_NR,
268};
269
270#define S5M8763_IRQ_DCINF_MASK (1 << 2)
271#define S5M8763_IRQ_DCINR_MASK (1 << 3)
272#define S5M8763_IRQ_JIGF_MASK (1 << 4)
273#define S5M8763_IRQ_JIGR_MASK (1 << 5)
274#define S5M8763_IRQ_PWRONF_MASK (1 << 6)
275#define S5M8763_IRQ_PWRONR_MASK (1 << 7)
276
277#define S5M8763_IRQ_WTSREVNT_MASK (1 << 0)
278#define S5M8763_IRQ_SMPLEVNT_MASK (1 << 1)
279#define S5M8763_IRQ_ALARM1_MASK (1 << 2)
280#define S5M8763_IRQ_ALARM0_MASK (1 << 3)
281
282#define S5M8763_IRQ_ONKEY1S_MASK (1 << 0)
283#define S5M8763_IRQ_TOPOFFR_MASK (1 << 2)
284#define S5M8763_IRQ_DCINOVPR_MASK (1 << 3)
285#define S5M8763_IRQ_CHGRSTF_MASK (1 << 4)
286#define S5M8763_IRQ_DONER_MASK (1 << 5)
287#define S5M8763_IRQ_CHGFAULT_MASK (1 << 7)
288
289#define S5M8763_IRQ_LOBAT1_MASK (1 << 0)
290#define S5M8763_IRQ_LOBAT2_MASK (1 << 1)
291
292#define S5M8763_ENRAMP (1 << 4)
293
294/**
295 * struct s5m87xx_dev - s5m87xx master device for sub-drivers
296 * @dev: master device of the chip (can be used to access platform data)
297 * @i2c: i2c client private data for regulator
298 * @rtc: i2c client private data for rtc
299 * @iolock: mutex for serializing io access
300 * @irqlock: mutex for buslock
301 * @irq_base: base IRQ number for s5m87xx, required for IRQs
302 * @irq: generic IRQ number for s5m87xx
303 * @ono: power onoff IRQ number for s5m87xx
304 * @irq_masks_cur: currently active value
305 * @irq_masks_cache: cached hardware value
306 * @type: indicate which s5m87xx "variant" is used
307 */
308struct s5m87xx_dev {
309 struct device *dev;
310 struct regmap *regmap;
311 struct i2c_client *i2c;
312 struct i2c_client *rtc;
313 struct mutex iolock;
314 struct mutex irqlock;
315
316 int device_type;
317 int irq_base;
318 int irq;
319 int ono;
320 u8 irq_masks_cur[NUM_IRQ_REGS];
321 u8 irq_masks_cache[NUM_IRQ_REGS];
322 int type;
323 bool wakeup;
324};
325
326int s5m_irq_init(struct s5m87xx_dev *s5m87xx);
327void s5m_irq_exit(struct s5m87xx_dev *s5m87xx);
328int s5m_irq_resume(struct s5m87xx_dev *s5m87xx);
329
330extern int s5m_reg_read(struct s5m87xx_dev *s5m87xx, u8 reg, void *dest);
331extern int s5m_bulk_read(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf);
332extern int s5m_reg_write(struct s5m87xx_dev *s5m87xx, u8 reg, u8 value);
333extern int s5m_bulk_write(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf);
334extern int s5m_reg_update(struct s5m87xx_dev *s5m87xx, u8 reg, u8 val, u8 mask);
335
336struct s5m_platform_data {
337 struct s5m_regulator_data *regulators;
338 int device_type;
339 int num_regulators;
340
341 int irq_base;
342 int (*cfg_pmic_irq)(void);
343
344 int ono;
345 bool wakeup;
346 bool buck_voltage_lock;
347
348 int buck_gpios[3];
349 int buck2_voltage[8];
350 bool buck2_gpiodvs;
351 int buck3_voltage[8];
352 bool buck3_gpiodvs;
353 int buck4_voltage[8];
354 bool buck4_gpiodvs;
355
356 int buck_set1;
357 int buck_set2;
358 int buck_set3;
359 int buck2_enable;
360 int buck3_enable;
361 int buck4_enable;
362 int buck_default_idx;
363 int buck2_default_idx;
364 int buck3_default_idx;
365 int buck4_default_idx;
366
367 int buck_ramp_delay;
368 bool buck2_ramp_enable;
369 bool buck3_ramp_enable;
370 bool buck4_ramp_enable;
371};
372
373#endif /* __LINUX_MFD_S5M_CORE_H */
diff --git a/include/linux/mfd/s5m87xx/s5m-pmic.h b/include/linux/mfd/s5m87xx/s5m-pmic.h
new file mode 100644
index 000000000000..a72a5d27e62e
--- /dev/null
+++ b/include/linux/mfd/s5m87xx/s5m-pmic.h
@@ -0,0 +1,100 @@
1/* s5m87xx.h
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.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
11#ifndef __LINUX_MFD_S5M_PMIC_H
12#define __LINUX_MFD_S5M_PMIC_H
13
14#include <linux/regulator/machine.h>
15
16/* S5M8767 regulator ids */
17enum s5m8767_regulators {
18 S5M8767_LDO1,
19 S5M8767_LDO2,
20 S5M8767_LDO3,
21 S5M8767_LDO4,
22 S5M8767_LDO5,
23 S5M8767_LDO6,
24 S5M8767_LDO7,
25 S5M8767_LDO8,
26 S5M8767_LDO9,
27 S5M8767_LDO10,
28 S5M8767_LDO11,
29 S5M8767_LDO12,
30 S5M8767_LDO13,
31 S5M8767_LDO14,
32 S5M8767_LDO15,
33 S5M8767_LDO16,
34 S5M8767_LDO17,
35 S5M8767_LDO18,
36 S5M8767_LDO19,
37 S5M8767_LDO20,
38 S5M8767_LDO21,
39 S5M8767_LDO22,
40 S5M8767_LDO23,
41 S5M8767_LDO24,
42 S5M8767_LDO25,
43 S5M8767_LDO26,
44 S5M8767_LDO27,
45 S5M8767_LDO28,
46 S5M8767_BUCK1,
47 S5M8767_BUCK2,
48 S5M8767_BUCK3,
49 S5M8767_BUCK4,
50 S5M8767_BUCK5,
51 S5M8767_BUCK6,
52 S5M8767_BUCK7,
53 S5M8767_BUCK8,
54 S5M8767_BUCK9,
55 S5M8767_AP_EN32KHZ,
56 S5M8767_CP_EN32KHZ,
57
58 S5M8767_REG_MAX,
59};
60
61/* S5M8763 regulator ids */
62enum s5m8763_regulators {
63 S5M8763_LDO1,
64 S5M8763_LDO2,
65 S5M8763_LDO3,
66 S5M8763_LDO4,
67 S5M8763_LDO5,
68 S5M8763_LDO6,
69 S5M8763_LDO7,
70 S5M8763_LDO8,
71 S5M8763_LDO9,
72 S5M8763_LDO10,
73 S5M8763_LDO11,
74 S5M8763_LDO12,
75 S5M8763_LDO13,
76 S5M8763_LDO14,
77 S5M8763_LDO15,
78 S5M8763_LDO16,
79 S5M8763_BUCK1,
80 S5M8763_BUCK2,
81 S5M8763_BUCK3,
82 S5M8763_BUCK4,
83 S5M8763_AP_EN32KHZ,
84 S5M8763_CP_EN32KHZ,
85 S5M8763_ENCHGVI,
86 S5M8763_ESAFEUSB1,
87 S5M8763_ESAFEUSB2,
88};
89
90/**
91 * s5m87xx_regulator_data - regulator data
92 * @id: regulator id
93 * @initdata: regulator init data (contraints, supplies, ...)
94 */
95struct s5m_regulator_data {
96 int id;
97 struct regulator_init_data *initdata;
98};
99
100#endif /* __LINUX_MFD_S5M_PMIC_H */
diff --git a/include/linux/mfd/s5m87xx/s5m-rtc.h b/include/linux/mfd/s5m87xx/s5m-rtc.h
new file mode 100644
index 000000000000..6ce8da264cec
--- /dev/null
+++ b/include/linux/mfd/s5m87xx/s5m-rtc.h
@@ -0,0 +1,84 @@
1/*
2 * s5m-rtc.h
3 *
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd
5 * http://www.samsung.com
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14#ifndef __LINUX_MFD_S5M_RTC_H
15#define __LINUX_MFD_S5M_RTC_H
16
17enum s5m87xx_rtc_reg {
18 S5M87XX_RTC_SEC,
19 S5M87XX_RTC_MIN,
20 S5M87XX_RTC_HOUR,
21 S5M87XX_RTC_WEEKDAY,
22 S5M87XX_RTC_DATE,
23 S5M87XX_RTC_MONTH,
24 S5M87XX_RTC_YEAR1,
25 S5M87XX_RTC_YEAR2,
26 S5M87XX_ALARM0_SEC,
27 S5M87XX_ALARM0_MIN,
28 S5M87XX_ALARM0_HOUR,
29 S5M87XX_ALARM0_WEEKDAY,
30 S5M87XX_ALARM0_DATE,
31 S5M87XX_ALARM0_MONTH,
32 S5M87XX_ALARM0_YEAR1,
33 S5M87XX_ALARM0_YEAR2,
34 S5M87XX_ALARM1_SEC,
35 S5M87XX_ALARM1_MIN,
36 S5M87XX_ALARM1_HOUR,
37 S5M87XX_ALARM1_WEEKDAY,
38 S5M87XX_ALARM1_DATE,
39 S5M87XX_ALARM1_MONTH,
40 S5M87XX_ALARM1_YEAR1,
41 S5M87XX_ALARM1_YEAR2,
42 S5M87XX_ALARM0_CONF,
43 S5M87XX_ALARM1_CONF,
44 S5M87XX_RTC_STATUS,
45 S5M87XX_WTSR_SMPL_CNTL,
46 S5M87XX_RTC_UDR_CON,
47};
48
49#define RTC_I2C_ADDR (0x0C >> 1)
50
51#define HOUR_12 (1 << 7)
52#define HOUR_AMPM (1 << 6)
53#define HOUR_PM (1 << 5)
54#define ALARM0_STATUS (1 << 1)
55#define ALARM1_STATUS (1 << 2)
56#define UPDATE_AD (1 << 0)
57
58/* RTC Control Register */
59#define BCD_EN_SHIFT 0
60#define BCD_EN_MASK (1 << BCD_EN_SHIFT)
61#define MODEL24_SHIFT 1
62#define MODEL24_MASK (1 << MODEL24_SHIFT)
63/* RTC Update Register1 */
64#define RTC_UDR_SHIFT 0
65#define RTC_UDR_MASK (1 << RTC_UDR_SHIFT)
66/* RTC Hour register */
67#define HOUR_PM_SHIFT 6
68#define HOUR_PM_MASK (1 << HOUR_PM_SHIFT)
69/* RTC Alarm Enable */
70#define ALARM_ENABLE_SHIFT 7
71#define ALARM_ENABLE_MASK (1 << ALARM_ENABLE_SHIFT)
72
73enum {
74 RTC_SEC = 0,
75 RTC_MIN,
76 RTC_HOUR,
77 RTC_WEEKDAY,
78 RTC_DATE,
79 RTC_MONTH,
80 RTC_YEAR1,
81 RTC_YEAR2,
82};
83
84#endif /* __LINUX_MFD_S5M_RTC_H */
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h
index be1af7c42e57..ca1d7a347600 100644
--- a/include/linux/mfd/stmpe.h
+++ b/include/linux/mfd/stmpe.h
@@ -20,6 +20,8 @@ enum stmpe_block {
20}; 20};
21 21
22enum stmpe_partnum { 22enum stmpe_partnum {
23 STMPE610,
24 STMPE801,
23 STMPE811, 25 STMPE811,
24 STMPE1601, 26 STMPE1601,
25 STMPE2401, 27 STMPE2401,
@@ -50,17 +52,20 @@ enum {
50 52
51 53
52struct stmpe_variant_info; 54struct stmpe_variant_info;
55struct stmpe_client_info;
53 56
54/** 57/**
55 * struct stmpe - STMPE MFD structure 58 * struct stmpe - STMPE MFD structure
56 * @lock: lock protecting I/O operations 59 * @lock: lock protecting I/O operations
57 * @irq_lock: IRQ bus lock 60 * @irq_lock: IRQ bus lock
58 * @dev: device, mostly for dev_dbg() 61 * @dev: device, mostly for dev_dbg()
59 * @i2c: i2c client 62 * @client: client - i2c or spi
63 * @ci: client specific information
60 * @partnum: part number 64 * @partnum: part number
61 * @variant: the detected STMPE model number 65 * @variant: the detected STMPE model number
62 * @regs: list of addresses of registers which are at different addresses on 66 * @regs: list of addresses of registers which are at different addresses on
63 * different variants. Indexed by one of STMPE_IDX_*. 67 * different variants. Indexed by one of STMPE_IDX_*.
68 * @irq: irq number for stmpe
64 * @irq_base: starting IRQ number for internal IRQs 69 * @irq_base: starting IRQ number for internal IRQs
65 * @num_gpios: number of gpios, differs for variants 70 * @num_gpios: number of gpios, differs for variants
66 * @ier: cache of IER registers for bus_lock 71 * @ier: cache of IER registers for bus_lock
@@ -71,11 +76,13 @@ struct stmpe {
71 struct mutex lock; 76 struct mutex lock;
72 struct mutex irq_lock; 77 struct mutex irq_lock;
73 struct device *dev; 78 struct device *dev;
74 struct i2c_client *i2c; 79 void *client;
80 struct stmpe_client_info *ci;
75 enum stmpe_partnum partnum; 81 enum stmpe_partnum partnum;
76 struct stmpe_variant_info *variant; 82 struct stmpe_variant_info *variant;
77 const u8 *regs; 83 const u8 *regs;
78 84
85 int irq;
79 int irq_base; 86 int irq_base;
80 int num_gpios; 87 int num_gpios;
81 u8 ier[2]; 88 u8 ier[2];
@@ -183,6 +190,9 @@ struct stmpe_ts_platform_data {
183 * @autosleep_timeout: inactivity timeout in milliseconds for autosleep 190 * @autosleep_timeout: inactivity timeout in milliseconds for autosleep
184 * @irq_base: base IRQ number. %STMPE_NR_IRQS irqs will be used, or 191 * @irq_base: base IRQ number. %STMPE_NR_IRQS irqs will be used, or
185 * %STMPE_NR_INTERNAL_IRQS if the GPIO driver is not used. 192 * %STMPE_NR_INTERNAL_IRQS if the GPIO driver is not used.
193 * @irq_over_gpio: true if gpio is used to get irq
194 * @irq_gpio: gpio number over which irq will be requested (significant only if
195 * irq_over_gpio is true)
186 * @gpio: GPIO-specific platform data 196 * @gpio: GPIO-specific platform data
187 * @keypad: keypad-specific platform data 197 * @keypad: keypad-specific platform data
188 * @ts: touchscreen-specific platform data 198 * @ts: touchscreen-specific platform data
@@ -194,6 +204,8 @@ struct stmpe_platform_data {
194 unsigned int irq_trigger; 204 unsigned int irq_trigger;
195 bool irq_invert_polarity; 205 bool irq_invert_polarity;
196 bool autosleep; 206 bool autosleep;
207 bool irq_over_gpio;
208 int irq_gpio;
197 int autosleep_timeout; 209 int autosleep_timeout;
198 210
199 struct stmpe_gpio_platform_data *gpio; 211 struct stmpe_gpio_platform_data *gpio;
diff --git a/include/linux/mfd/ucb1x00.h b/include/linux/mfd/ucb1x00.h
index 4321f044d1e4..bc19e5fb7ea8 100644
--- a/include/linux/mfd/ucb1x00.h
+++ b/include/linux/mfd/ucb1x00.h
@@ -104,6 +104,9 @@
104#define UCB_MODE_DYN_VFLAG_ENA (1 << 12) 104#define UCB_MODE_DYN_VFLAG_ENA (1 << 12)
105#define UCB_MODE_AUD_OFF_CAN (1 << 13) 105#define UCB_MODE_AUD_OFF_CAN (1 << 13)
106 106
107struct ucb1x00_plat_data {
108 int gpio_base;
109};
107 110
108struct ucb1x00_irq { 111struct ucb1x00_irq {
109 void *devid; 112 void *devid;
@@ -116,7 +119,7 @@ struct ucb1x00 {
116 unsigned int irq; 119 unsigned int irq;
117 struct semaphore adc_sem; 120 struct semaphore adc_sem;
118 spinlock_t io_lock; 121 spinlock_t io_lock;
119 u16 id; 122 const struct mcp_device_id *id;
120 u16 io_dir; 123 u16 io_dir;
121 u16 io_out; 124 u16 io_out;
122 u16 adc_cr; 125 u16 adc_cr;
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index eaf867412f7a..05ed2828a553 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -3,22 +3,10 @@
3 3
4#include <linux/mm.h> 4#include <linux/mm.h>
5#include <linux/mempolicy.h> 5#include <linux/mempolicy.h>
6#include <linux/migrate_mode.h>
6 7
7typedef struct page *new_page_t(struct page *, unsigned long private, int **); 8typedef struct page *new_page_t(struct page *, unsigned long private, int **);
8 9
9/*
10 * MIGRATE_ASYNC means never block
11 * MIGRATE_SYNC_LIGHT in the current implementation means to allow blocking
12 * on most operations but not ->writepage as the potential stall time
13 * is too significant
14 * MIGRATE_SYNC will block when migrating pages
15 */
16enum migrate_mode {
17 MIGRATE_ASYNC,
18 MIGRATE_SYNC_LIGHT,
19 MIGRATE_SYNC,
20};
21
22#ifdef CONFIG_MIGRATION 10#ifdef CONFIG_MIGRATION
23#define PAGE_MIGRATION 1 11#define PAGE_MIGRATION 1
24 12
diff --git a/include/linux/migrate_mode.h b/include/linux/migrate_mode.h
new file mode 100644
index 000000000000..ebf3d89a3919
--- /dev/null
+++ b/include/linux/migrate_mode.h
@@ -0,0 +1,16 @@
1#ifndef MIGRATE_MODE_H_INCLUDED
2#define MIGRATE_MODE_H_INCLUDED
3/*
4 * MIGRATE_ASYNC means never block
5 * MIGRATE_SYNC_LIGHT in the current implementation means to allow blocking
6 * on most operations but not ->writepage as the potential stall time
7 * is too significant
8 * MIGRATE_SYNC will block when migrating pages
9 */
10enum migrate_mode {
11 MIGRATE_ASYNC,
12 MIGRATE_SYNC_LIGHT,
13 MIGRATE_SYNC,
14};
15
16#endif /* MIGRATE_MODE_H_INCLUDED */
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 5c4fe8e5bfe5..aea61905499b 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -621,6 +621,7 @@ void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac);
621int mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac); 621int mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac);
622int mlx4_get_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn); 622int mlx4_get_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn);
623void mlx4_put_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int qpn); 623void mlx4_put_eth_qp(struct mlx4_dev *dev, u8 port, u64 mac, int qpn);
624void mlx4_set_stats_bitmap(struct mlx4_dev *dev, u64 *stats_bitmap);
624 625
625int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); 626int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
626int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); 627int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index c8ef9bc54d50..9f22ba572de0 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -71,6 +71,8 @@ struct mmc_ext_csd {
71 bool hpi_en; /* HPI enablebit */ 71 bool hpi_en; /* HPI enablebit */
72 bool hpi; /* HPI support bit */ 72 bool hpi; /* HPI support bit */
73 unsigned int hpi_cmd; /* cmd used as HPI */ 73 unsigned int hpi_cmd; /* cmd used as HPI */
74 unsigned int boot_ro_lock; /* ro lock support */
75 bool boot_ro_lockable;
74 u8 raw_partition_support; /* 160 */ 76 u8 raw_partition_support; /* 160 */
75 u8 raw_erased_mem_count; /* 181 */ 77 u8 raw_erased_mem_count; /* 181 */
76 u8 raw_ext_csd_structure; /* 194 */ 78 u8 raw_ext_csd_structure; /* 194 */
@@ -110,6 +112,7 @@ struct sd_ssr {
110struct sd_switch_caps { 112struct sd_switch_caps {
111 unsigned int hs_max_dtr; 113 unsigned int hs_max_dtr;
112 unsigned int uhs_max_dtr; 114 unsigned int uhs_max_dtr;
115#define HIGH_SPEED_MAX_DTR 50000000
113#define UHS_SDR104_MAX_DTR 208000000 116#define UHS_SDR104_MAX_DTR 208000000
114#define UHS_SDR50_MAX_DTR 100000000 117#define UHS_SDR50_MAX_DTR 100000000
115#define UHS_DDR50_MAX_DTR 50000000 118#define UHS_DDR50_MAX_DTR 50000000
@@ -117,11 +120,13 @@ struct sd_switch_caps {
117#define UHS_SDR12_MAX_DTR 25000000 120#define UHS_SDR12_MAX_DTR 25000000
118 unsigned int sd3_bus_mode; 121 unsigned int sd3_bus_mode;
119#define UHS_SDR12_BUS_SPEED 0 122#define UHS_SDR12_BUS_SPEED 0
123#define HIGH_SPEED_BUS_SPEED 1
120#define UHS_SDR25_BUS_SPEED 1 124#define UHS_SDR25_BUS_SPEED 1
121#define UHS_SDR50_BUS_SPEED 2 125#define UHS_SDR50_BUS_SPEED 2
122#define UHS_SDR104_BUS_SPEED 3 126#define UHS_SDR104_BUS_SPEED 3
123#define UHS_DDR50_BUS_SPEED 4 127#define UHS_DDR50_BUS_SPEED 4
124 128
129#define SD_MODE_HIGH_SPEED (1 << HIGH_SPEED_BUS_SPEED)
125#define SD_MODE_UHS_SDR12 (1 << UHS_SDR12_BUS_SPEED) 130#define SD_MODE_UHS_SDR12 (1 << UHS_SDR12_BUS_SPEED)
126#define SD_MODE_UHS_SDR25 (1 << UHS_SDR25_BUS_SPEED) 131#define SD_MODE_UHS_SDR25 (1 << UHS_SDR25_BUS_SPEED)
127#define SD_MODE_UHS_SDR50 (1 << UHS_SDR50_BUS_SPEED) 132#define SD_MODE_UHS_SDR50 (1 << UHS_SDR50_BUS_SPEED)
@@ -184,6 +189,10 @@ struct mmc_part {
184 unsigned int part_cfg; /* partition type */ 189 unsigned int part_cfg; /* partition type */
185 char name[MAX_MMC_PART_NAME_LEN]; 190 char name[MAX_MMC_PART_NAME_LEN];
186 bool force_ro; /* to make boot parts RO by default */ 191 bool force_ro; /* to make boot parts RO by default */
192 unsigned int area_type;
193#define MMC_BLK_DATA_AREA_MAIN (1<<0)
194#define MMC_BLK_DATA_AREA_BOOT (1<<1)
195#define MMC_BLK_DATA_AREA_GP (1<<2)
187}; 196};
188 197
189/* 198/*
@@ -206,6 +215,8 @@ struct mmc_card {
206#define MMC_STATE_HIGHSPEED_DDR (1<<4) /* card is in high speed mode */ 215#define MMC_STATE_HIGHSPEED_DDR (1<<4) /* card is in high speed mode */
207#define MMC_STATE_ULTRAHIGHSPEED (1<<5) /* card is in ultra high speed mode */ 216#define MMC_STATE_ULTRAHIGHSPEED (1<<5) /* card is in ultra high speed mode */
208#define MMC_CARD_SDXC (1<<6) /* card is SDXC */ 217#define MMC_CARD_SDXC (1<<6) /* card is SDXC */
218#define MMC_CARD_REMOVED (1<<7) /* card has been removed */
219#define MMC_STATE_HIGHSPEED_200 (1<<8) /* card is in HS200 mode */
209 unsigned int quirks; /* card quirks */ 220 unsigned int quirks; /* card quirks */
210#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ 221#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */
211#define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ 222#define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */
@@ -261,12 +272,14 @@ struct mmc_card {
261 * This function fill contents in mmc_part. 272 * This function fill contents in mmc_part.
262 */ 273 */
263static inline void mmc_part_add(struct mmc_card *card, unsigned int size, 274static inline void mmc_part_add(struct mmc_card *card, unsigned int size,
264 unsigned int part_cfg, char *name, int idx, bool ro) 275 unsigned int part_cfg, char *name, int idx, bool ro,
276 int area_type)
265{ 277{
266 card->part[card->nr_parts].size = size; 278 card->part[card->nr_parts].size = size;
267 card->part[card->nr_parts].part_cfg = part_cfg; 279 card->part[card->nr_parts].part_cfg = part_cfg;
268 sprintf(card->part[card->nr_parts].name, name, idx); 280 sprintf(card->part[card->nr_parts].name, name, idx);
269 card->part[card->nr_parts].force_ro = ro; 281 card->part[card->nr_parts].force_ro = ro;
282 card->part[card->nr_parts].area_type = area_type;
270 card->nr_parts++; 283 card->nr_parts++;
271} 284}
272 285
@@ -362,18 +375,24 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
362#define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) 375#define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT)
363#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) 376#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY)
364#define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) 377#define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED)
378#define mmc_card_hs200(c) ((c)->state & MMC_STATE_HIGHSPEED_200)
365#define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) 379#define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR)
366#define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR) 380#define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR)
367#define mmc_sd_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED) 381#define mmc_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED)
382#define mmc_sd_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED)
368#define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC) 383#define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC)
384#define mmc_card_removed(c) ((c) && ((c)->state & MMC_CARD_REMOVED))
369 385
370#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) 386#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
371#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) 387#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
372#define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) 388#define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
389#define mmc_card_set_hs200(c) ((c)->state |= MMC_STATE_HIGHSPEED_200)
373#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) 390#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
374#define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR) 391#define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR)
392#define mmc_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED)
375#define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) 393#define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED)
376#define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC) 394#define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC)
395#define mmc_card_set_removed(c) ((c)->state |= MMC_CARD_REMOVED)
377 396
378/* 397/*
379 * Quirk add/remove for MMC products. 398 * Quirk add/remove for MMC products.
diff --git a/include/linux/mmc/cd-gpio.h b/include/linux/mmc/cd-gpio.h
new file mode 100644
index 000000000000..a8e469783318
--- /dev/null
+++ b/include/linux/mmc/cd-gpio.h
@@ -0,0 +1,19 @@
1/*
2 * Generic GPIO card-detect helper header
3 *
4 * Copyright (C) 2011, 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 MMC_CD_GPIO_H
12#define MMC_CD_GPIO_H
13
14struct mmc_host;
15int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio,
16 unsigned int irq, unsigned long flags);
17void mmc_cd_gpio_free(struct mmc_host *host);
18
19#endif
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 174a844a5dda..87a976cc5654 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -180,6 +180,8 @@ extern int mmc_try_claim_host(struct mmc_host *host);
180 180
181extern int mmc_flush_cache(struct mmc_card *); 181extern int mmc_flush_cache(struct mmc_card *);
182 182
183extern int mmc_detect_card_removed(struct mmc_host *host);
184
183/** 185/**
184 * mmc_claim_host - exclusively claim a host 186 * mmc_claim_host - exclusively claim a host
185 * @host: mmc host to claim 187 * @host: mmc host to claim
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index 6dc9b80568a0..e8779c6d1759 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -214,6 +214,7 @@ struct dw_mci_board {
214 unsigned int bus_hz; /* Bus speed */ 214 unsigned int bus_hz; /* Bus speed */
215 215
216 unsigned int caps; /* Capabilities */ 216 unsigned int caps; /* Capabilities */
217 unsigned int caps2; /* More capabilities */
217 /* 218 /*
218 * Override fifo depth. If 0, autodetect it from the FIFOTH register, 219 * Override fifo depth. If 0, autodetect it from the FIFOTH register,
219 * but note that this may not be reliable after a bootloader has used 220 * but note that this may not be reliable after a bootloader has used
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index a3ac9c48e5de..0beba1e5e1ed 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -56,10 +56,13 @@ struct mmc_ios {
56#define MMC_TIMING_UHS_SDR50 3 56#define MMC_TIMING_UHS_SDR50 3
57#define MMC_TIMING_UHS_SDR104 4 57#define MMC_TIMING_UHS_SDR104 4
58#define MMC_TIMING_UHS_DDR50 5 58#define MMC_TIMING_UHS_DDR50 5
59#define MMC_TIMING_MMC_HS200 6
59 60
60#define MMC_SDR_MODE 0 61#define MMC_SDR_MODE 0
61#define MMC_1_2V_DDR_MODE 1 62#define MMC_1_2V_DDR_MODE 1
62#define MMC_1_8V_DDR_MODE 2 63#define MMC_1_8V_DDR_MODE 2
64#define MMC_1_2V_SDR_MODE 3
65#define MMC_1_8V_SDR_MODE 4
63 66
64 unsigned char signal_voltage; /* signalling voltage (1.8V or 3.3V) */ 67 unsigned char signal_voltage; /* signalling voltage (1.8V or 3.3V) */
65 68
@@ -148,7 +151,9 @@ struct mmc_host_ops {
148 void (*init_card)(struct mmc_host *host, struct mmc_card *card); 151 void (*init_card)(struct mmc_host *host, struct mmc_card *card);
149 152
150 int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); 153 int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios);
151 int (*execute_tuning)(struct mmc_host *host); 154
155 /* The tuning command opcode value is different for SD and eMMC cards */
156 int (*execute_tuning)(struct mmc_host *host, u32 opcode);
152 void (*enable_preset_value)(struct mmc_host *host, bool enable); 157 void (*enable_preset_value)(struct mmc_host *host, bool enable);
153 int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); 158 int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
154 void (*hw_reset)(struct mmc_host *host); 159 void (*hw_reset)(struct mmc_host *host);
@@ -167,6 +172,11 @@ struct mmc_async_req {
167 int (*err_check) (struct mmc_card *, struct mmc_async_req *); 172 int (*err_check) (struct mmc_card *, struct mmc_async_req *);
168}; 173};
169 174
175struct mmc_hotplug {
176 unsigned int irq;
177 void *handler_priv;
178};
179
170struct mmc_host { 180struct mmc_host {
171 struct device *parent; 181 struct device *parent;
172 struct device class_dev; 182 struct device class_dev;
@@ -242,6 +252,11 @@ struct mmc_host {
242#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ 252#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */
243#define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ 253#define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */
244#define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ 254#define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */
255#define MMC_CAP2_NO_SLEEP_CMD (1 << 4) /* Don't allow sleep command */
256#define MMC_CAP2_HS200_1_8V_SDR (1 << 5) /* can support */
257#define MMC_CAP2_HS200_1_2V_SDR (1 << 6) /* can support */
258#define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \
259 MMC_CAP2_HS200_1_2V_SDR)
245 260
246 mmc_pm_flag_t pm_caps; /* supported pm features */ 261 mmc_pm_flag_t pm_caps; /* supported pm features */
247 unsigned int power_notify_type; 262 unsigned int power_notify_type;
@@ -253,10 +268,12 @@ struct mmc_host {
253 int clk_requests; /* internal reference counter */ 268 int clk_requests; /* internal reference counter */
254 unsigned int clk_delay; /* number of MCI clk hold cycles */ 269 unsigned int clk_delay; /* number of MCI clk hold cycles */
255 bool clk_gated; /* clock gated */ 270 bool clk_gated; /* clock gated */
256 struct work_struct clk_gate_work; /* delayed clock gate */ 271 struct delayed_work clk_gate_work; /* delayed clock gate */
257 unsigned int clk_old; /* old clock value cache */ 272 unsigned int clk_old; /* old clock value cache */
258 spinlock_t clk_lock; /* lock for clk fields */ 273 spinlock_t clk_lock; /* lock for clk fields */
259 struct mutex clk_gate_mutex; /* mutex for clock gating */ 274 struct mutex clk_gate_mutex; /* mutex for clock gating */
275 struct device_attribute clkgate_delay_attr;
276 unsigned long clkgate_delay;
260#endif 277#endif
261 278
262 /* host specific block data */ 279 /* host specific block data */
@@ -297,6 +314,8 @@ struct mmc_host {
297 int claim_cnt; /* "claim" nesting count */ 314 int claim_cnt; /* "claim" nesting count */
298 315
299 struct delayed_work detect; 316 struct delayed_work detect;
317 int detect_change; /* card detect flag */
318 struct mmc_hotplug hotplug;
300 319
301 const struct mmc_bus_ops *bus_ops; /* current bus driver */ 320 const struct mmc_bus_ops *bus_ops; /* current bus driver */
302 unsigned int bus_refs; /* reference counter */ 321 unsigned int bus_refs; /* reference counter */
@@ -323,6 +342,8 @@ struct mmc_host {
323 struct fault_attr fail_mmc_request; 342 struct fault_attr fail_mmc_request;
324#endif 343#endif
325 344
345 unsigned int actual_clock; /* Actual HC clock rate */
346
326 unsigned long private[0] ____cacheline_aligned; 347 unsigned long private[0] ____cacheline_aligned;
327}; 348};
328 349
@@ -396,7 +417,7 @@ static inline void mmc_set_disable_delay(struct mmc_host *host,
396} 417}
397 418
398/* Module parameter */ 419/* Module parameter */
399extern int mmc_assume_removable; 420extern bool mmc_assume_removable;
400 421
401static inline int mmc_card_is_removable(struct mmc_host *host) 422static inline int mmc_card_is_removable(struct mmc_host *host)
402{ 423{
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 0e7135697d11..fb9f6e116e1c 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -51,6 +51,7 @@
51#define MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */ 51#define MMC_READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */
52#define MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */ 52#define MMC_READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */
53#define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */ 53#define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */
54#define MMC_SEND_TUNING_BLOCK_HS200 21 /* adtc R1 */
54 55
55 /* class 3 */ 56 /* class 3 */
56#define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ 57#define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */
@@ -280,6 +281,7 @@ struct _mmc_csd {
280#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */ 281#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */
281#define EXT_CSD_SANITIZE_START 165 /* W */ 282#define EXT_CSD_SANITIZE_START 165 /* W */
282#define EXT_CSD_WR_REL_PARAM 166 /* RO */ 283#define EXT_CSD_WR_REL_PARAM 166 /* RO */
284#define EXT_CSD_BOOT_WP 173 /* R/W */
283#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ 285#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */
284#define EXT_CSD_PART_CONFIG 179 /* R/W */ 286#define EXT_CSD_PART_CONFIG 179 /* R/W */
285#define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ 287#define EXT_CSD_ERASED_MEM_CONT 181 /* RO */
@@ -321,6 +323,11 @@ struct _mmc_csd {
321 323
322#define EXT_CSD_WR_REL_PARAM_EN (1<<2) 324#define EXT_CSD_WR_REL_PARAM_EN (1<<2)
323 325
326#define EXT_CSD_BOOT_WP_B_PWR_WP_DIS (0x40)
327#define EXT_CSD_BOOT_WP_B_PERM_WP_DIS (0x10)
328#define EXT_CSD_BOOT_WP_B_PERM_WP_EN (0x04)
329#define EXT_CSD_BOOT_WP_B_PWR_WP_EN (0x01)
330
324#define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) 331#define EXT_CSD_PART_CONFIG_ACC_MASK (0x7)
325#define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) 332#define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1)
326#define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) 333#define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4)
@@ -333,13 +340,76 @@ struct _mmc_csd {
333 340
334#define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ 341#define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */
335#define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ 342#define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */
336#define EXT_CSD_CARD_TYPE_MASK 0xF /* Mask out reserved bits */ 343#define EXT_CSD_CARD_TYPE_MASK 0x3F /* Mask out reserved bits */
337#define EXT_CSD_CARD_TYPE_DDR_1_8V (1<<2) /* Card can run at 52MHz */ 344#define EXT_CSD_CARD_TYPE_DDR_1_8V (1<<2) /* Card can run at 52MHz */
338 /* DDR mode @1.8V or 3V I/O */ 345 /* DDR mode @1.8V or 3V I/O */
339#define EXT_CSD_CARD_TYPE_DDR_1_2V (1<<3) /* Card can run at 52MHz */ 346#define EXT_CSD_CARD_TYPE_DDR_1_2V (1<<3) /* Card can run at 52MHz */
340 /* DDR mode @1.2V I/O */ 347 /* DDR mode @1.2V I/O */
341#define EXT_CSD_CARD_TYPE_DDR_52 (EXT_CSD_CARD_TYPE_DDR_1_8V \ 348#define EXT_CSD_CARD_TYPE_DDR_52 (EXT_CSD_CARD_TYPE_DDR_1_8V \
342 | EXT_CSD_CARD_TYPE_DDR_1_2V) 349 | EXT_CSD_CARD_TYPE_DDR_1_2V)
350#define EXT_CSD_CARD_TYPE_SDR_1_8V (1<<4) /* Card can run at 200MHz */
351#define EXT_CSD_CARD_TYPE_SDR_1_2V (1<<5) /* Card can run at 200MHz */
352 /* SDR mode @1.2V I/O */
353
354#define EXT_CSD_CARD_TYPE_SDR_200 (EXT_CSD_CARD_TYPE_SDR_1_8V | \
355 EXT_CSD_CARD_TYPE_SDR_1_2V)
356
357#define EXT_CSD_CARD_TYPE_SDR_ALL (EXT_CSD_CARD_TYPE_SDR_200 | \
358 EXT_CSD_CARD_TYPE_52 | \
359 EXT_CSD_CARD_TYPE_26)
360
361#define EXT_CSD_CARD_TYPE_SDR_1_2V_ALL (EXT_CSD_CARD_TYPE_SDR_1_2V | \
362 EXT_CSD_CARD_TYPE_52 | \
363 EXT_CSD_CARD_TYPE_26)
364
365#define EXT_CSD_CARD_TYPE_SDR_1_8V_ALL (EXT_CSD_CARD_TYPE_SDR_1_8V | \
366 EXT_CSD_CARD_TYPE_52 | \
367 EXT_CSD_CARD_TYPE_26)
368
369#define EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_8V (EXT_CSD_CARD_TYPE_SDR_1_2V | \
370 EXT_CSD_CARD_TYPE_DDR_1_8V | \
371 EXT_CSD_CARD_TYPE_52 | \
372 EXT_CSD_CARD_TYPE_26)
373
374#define EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_8V (EXT_CSD_CARD_TYPE_SDR_1_8V | \
375 EXT_CSD_CARD_TYPE_DDR_1_8V | \
376 EXT_CSD_CARD_TYPE_52 | \
377 EXT_CSD_CARD_TYPE_26)
378
379#define EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_1_2V (EXT_CSD_CARD_TYPE_SDR_1_2V | \
380 EXT_CSD_CARD_TYPE_DDR_1_2V | \
381 EXT_CSD_CARD_TYPE_52 | \
382 EXT_CSD_CARD_TYPE_26)
383
384#define EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_1_2V (EXT_CSD_CARD_TYPE_SDR_1_8V | \
385 EXT_CSD_CARD_TYPE_DDR_1_2V | \
386 EXT_CSD_CARD_TYPE_52 | \
387 EXT_CSD_CARD_TYPE_26)
388
389#define EXT_CSD_CARD_TYPE_SDR_1_2V_DDR_52 (EXT_CSD_CARD_TYPE_SDR_1_2V | \
390 EXT_CSD_CARD_TYPE_DDR_52 | \
391 EXT_CSD_CARD_TYPE_52 | \
392 EXT_CSD_CARD_TYPE_26)
393
394#define EXT_CSD_CARD_TYPE_SDR_1_8V_DDR_52 (EXT_CSD_CARD_TYPE_SDR_1_8V | \
395 EXT_CSD_CARD_TYPE_DDR_52 | \
396 EXT_CSD_CARD_TYPE_52 | \
397 EXT_CSD_CARD_TYPE_26)
398
399#define EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_8V (EXT_CSD_CARD_TYPE_SDR_200 | \
400 EXT_CSD_CARD_TYPE_DDR_1_8V | \
401 EXT_CSD_CARD_TYPE_52 | \
402 EXT_CSD_CARD_TYPE_26)
403
404#define EXT_CSD_CARD_TYPE_SDR_ALL_DDR_1_2V (EXT_CSD_CARD_TYPE_SDR_200 | \
405 EXT_CSD_CARD_TYPE_DDR_1_2V | \
406 EXT_CSD_CARD_TYPE_52 | \
407 EXT_CSD_CARD_TYPE_26)
408
409#define EXT_CSD_CARD_TYPE_SDR_ALL_DDR_52 (EXT_CSD_CARD_TYPE_SDR_200 | \
410 EXT_CSD_CARD_TYPE_DDR_52 | \
411 EXT_CSD_CARD_TYPE_52 | \
412 EXT_CSD_CARD_TYPE_26)
343 413
344#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ 414#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */
345#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ 415#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */
diff --git a/include/linux/mmc/sdhci-pci-data.h b/include/linux/mmc/sdhci-pci-data.h
new file mode 100644
index 000000000000..8959604a13d3
--- /dev/null
+++ b/include/linux/mmc/sdhci-pci-data.h
@@ -0,0 +1,18 @@
1#ifndef LINUX_MMC_SDHCI_PCI_DATA_H
2#define LINUX_MMC_SDHCI_PCI_DATA_H
3
4struct pci_dev;
5
6struct sdhci_pci_data {
7 struct pci_dev *pdev;
8 int slotno;
9 int rst_n_gpio; /* Set to -EINVAL if unused */
10 int cd_gpio; /* Set to -EINVAL if unused */
11 int (*setup)(struct sdhci_pci_data *data);
12 void (*cleanup)(struct sdhci_pci_data *data);
13};
14
15extern struct sdhci_pci_data *(*sdhci_pci_get_data)(struct pci_dev *pdev,
16 int slotno);
17
18#endif
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index e4b69353678d..c750f85177d9 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -90,8 +90,6 @@ struct sdhci_host {
90 90
91 unsigned int quirks2; /* More deviations from spec. */ 91 unsigned int quirks2; /* More deviations from spec. */
92 92
93#define SDHCI_QUIRK2_OWN_CARD_DETECTION (1<<0)
94
95 int irq; /* Device IRQ */ 93 int irq; /* Device IRQ */
96 void __iomem *ioaddr; /* Mapped address */ 94 void __iomem *ioaddr; /* Mapped address */
97 95
@@ -121,6 +119,7 @@ struct sdhci_host {
121#define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ 119#define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */
122#define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ 120#define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */
123#define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ 121#define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */
122#define SDHCI_HS200_NEEDS_TUNING (1<<10) /* HS200 needs tuning */
124 123
125 unsigned int version; /* SDHCI spec. version */ 124 unsigned int version; /* SDHCI spec. version */
126 125
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h
index e0b1123497b9..c9fe66c58f8f 100644
--- a/include/linux/mmc/sdio.h
+++ b/include/linux/mmc/sdio.h
@@ -38,6 +38,7 @@
38 * [8:0] Byte/block count 38 * [8:0] Byte/block count
39 */ 39 */
40 40
41#define R4_18V_PRESENT (1<<24)
41#define R4_MEMORY_PRESENT (1 << 27) 42#define R4_MEMORY_PRESENT (1 << 27)
42 43
43/* 44/*
@@ -85,6 +86,7 @@
85#define SDIO_SD_REV_1_01 0 /* SD Physical Spec Version 1.01 */ 86#define SDIO_SD_REV_1_01 0 /* SD Physical Spec Version 1.01 */
86#define SDIO_SD_REV_1_10 1 /* SD Physical Spec Version 1.10 */ 87#define SDIO_SD_REV_1_10 1 /* SD Physical Spec Version 1.10 */
87#define SDIO_SD_REV_2_00 2 /* SD Physical Spec Version 2.00 */ 88#define SDIO_SD_REV_2_00 2 /* SD Physical Spec Version 2.00 */
89#define SDIO_SD_REV_3_00 3 /* SD Physical Spev Version 3.00 */
88 90
89#define SDIO_CCCR_IOEx 0x02 91#define SDIO_CCCR_IOEx 0x02
90#define SDIO_CCCR_IORx 0x03 92#define SDIO_CCCR_IORx 0x03
@@ -134,8 +136,31 @@
134#define SDIO_CCCR_SPEED 0x13 136#define SDIO_CCCR_SPEED 0x13
135 137
136#define SDIO_SPEED_SHS 0x01 /* Supports High-Speed mode */ 138#define SDIO_SPEED_SHS 0x01 /* Supports High-Speed mode */
137#define SDIO_SPEED_EHS 0x02 /* Enable High-Speed mode */ 139#define SDIO_SPEED_BSS_SHIFT 1
138 140#define SDIO_SPEED_BSS_MASK (7<<SDIO_SPEED_BSS_SHIFT)
141#define SDIO_SPEED_SDR12 (0<<SDIO_SPEED_BSS_SHIFT)
142#define SDIO_SPEED_SDR25 (1<<SDIO_SPEED_BSS_SHIFT)
143#define SDIO_SPEED_SDR50 (2<<SDIO_SPEED_BSS_SHIFT)
144#define SDIO_SPEED_SDR104 (3<<SDIO_SPEED_BSS_SHIFT)
145#define SDIO_SPEED_DDR50 (4<<SDIO_SPEED_BSS_SHIFT)
146#define SDIO_SPEED_EHS SDIO_SPEED_SDR25 /* Enable High-Speed */
147
148#define SDIO_CCCR_UHS 0x14
149#define SDIO_UHS_SDR50 0x01
150#define SDIO_UHS_SDR104 0x02
151#define SDIO_UHS_DDR50 0x04
152
153#define SDIO_CCCR_DRIVE_STRENGTH 0x15
154#define SDIO_SDTx_MASK 0x07
155#define SDIO_DRIVE_SDTA (1<<0)
156#define SDIO_DRIVE_SDTC (1<<1)
157#define SDIO_DRIVE_SDTD (1<<2)
158#define SDIO_DRIVE_DTSx_MASK 0x03
159#define SDIO_DRIVE_DTSx_SHIFT 4
160#define SDIO_DTSx_SET_TYPE_B (0 << SDIO_DRIVE_DTSx_SHIFT)
161#define SDIO_DTSx_SET_TYPE_A (1 << SDIO_DRIVE_DTSx_SHIFT)
162#define SDIO_DTSx_SET_TYPE_C (2 << SDIO_DRIVE_DTSx_SHIFT)
163#define SDIO_DTSx_SET_TYPE_D (3 << SDIO_DRIVE_DTSx_SHIFT)
139/* 164/*
140 * Function Basic Registers (FBR) 165 * Function Basic Registers (FBR)
141 */ 166 */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 83ac0713ed0a..b29e7f6f8fa5 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -436,6 +436,17 @@ struct spi_device_id {
436 __attribute__((aligned(sizeof(kernel_ulong_t)))); 436 __attribute__((aligned(sizeof(kernel_ulong_t))));
437}; 437};
438 438
439/* mcp */
440
441#define MCP_NAME_SIZE 20
442#define MCP_MODULE_PREFIX "mcp:"
443
444struct mcp_device_id {
445 char name[MCP_NAME_SIZE];
446 kernel_ulong_t driver_data /* Data private to the driver */
447 __attribute__((aligned(sizeof(kernel_ulong_t))));
448};
449
439/* dmi */ 450/* dmi */
440enum dmi_field { 451enum dmi_field {
441 DMI_NONE, 452 DMI_NONE,
diff --git a/include/linux/module.h b/include/linux/module.h
index 3cb7839a60b9..4598bf03e98b 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -205,6 +205,20 @@ enum module_state
205 MODULE_STATE_GOING, 205 MODULE_STATE_GOING,
206}; 206};
207 207
208/**
209 * struct module_ref - per cpu module reference counts
210 * @incs: number of module get on this cpu
211 * @decs: number of module put on this cpu
212 *
213 * We force an alignment on 8 or 16 bytes, so that alloc_percpu()
214 * put @incs/@decs in same cache line, with no extra memory cost,
215 * since alloc_percpu() is fine grained.
216 */
217struct module_ref {
218 unsigned long incs;
219 unsigned long decs;
220} __attribute((aligned(2 * sizeof(unsigned long))));
221
208struct module 222struct module
209{ 223{
210 enum module_state state; 224 enum module_state state;
@@ -347,10 +361,7 @@ struct module
347 /* Destruction function. */ 361 /* Destruction function. */
348 void (*exit)(void); 362 void (*exit)(void);
349 363
350 struct module_ref { 364 struct module_ref __percpu *refptr;
351 unsigned int incs;
352 unsigned int decs;
353 } __percpu *refptr;
354#endif 365#endif
355 366
356#ifdef CONFIG_CONSTRUCTORS 367#ifdef CONFIG_CONSTRUCTORS
@@ -434,7 +445,7 @@ extern void __module_put_and_exit(struct module *mod, long code)
434#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code); 445#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code);
435 446
436#ifdef CONFIG_MODULE_UNLOAD 447#ifdef CONFIG_MODULE_UNLOAD
437unsigned int module_refcount(struct module *mod); 448unsigned long module_refcount(struct module *mod);
438void __symbol_put(const char *symbol); 449void __symbol_put(const char *symbol);
439#define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x) 450#define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x)
440void symbol_put_addr(void *addr); 451void symbol_put_addr(void *addr);
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 7939f636c8ba..c47f4d60db0b 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -350,23 +350,23 @@ extern int param_set_charp(const char *val, const struct kernel_param *kp);
350extern int param_get_charp(char *buffer, const struct kernel_param *kp); 350extern int param_get_charp(char *buffer, const struct kernel_param *kp);
351#define param_check_charp(name, p) __param_check(name, p, char *) 351#define param_check_charp(name, p) __param_check(name, p, char *)
352 352
353/* For historical reasons "bool" parameters can be (unsigned) "int". */ 353/* We used to allow int as well as bool. We're taking that away! */
354extern struct kernel_param_ops param_ops_bool; 354extern struct kernel_param_ops param_ops_bool;
355extern int param_set_bool(const char *val, const struct kernel_param *kp); 355extern int param_set_bool(const char *val, const struct kernel_param *kp);
356extern int param_get_bool(char *buffer, const struct kernel_param *kp); 356extern int param_get_bool(char *buffer, const struct kernel_param *kp);
357#define param_check_bool(name, p) \ 357#define param_check_bool(name, p) __param_check(name, p, bool)
358 static inline void __check_##name(void) \
359 { \
360 BUILD_BUG_ON(!__same_type((p), bool *) && \
361 !__same_type((p), unsigned int *) && \
362 !__same_type((p), int *)); \
363 }
364 358
365extern struct kernel_param_ops param_ops_invbool; 359extern struct kernel_param_ops param_ops_invbool;
366extern int param_set_invbool(const char *val, const struct kernel_param *kp); 360extern int param_set_invbool(const char *val, const struct kernel_param *kp);
367extern int param_get_invbool(char *buffer, const struct kernel_param *kp); 361extern int param_get_invbool(char *buffer, const struct kernel_param *kp);
368#define param_check_invbool(name, p) __param_check(name, p, bool) 362#define param_check_invbool(name, p) __param_check(name, p, bool)
369 363
364/* An int, which can only be set like a bool (though it shows as an int). */
365extern struct kernel_param_ops param_ops_bint;
366extern int param_set_bint(const char *val, const struct kernel_param *kp);
367#define param_get_bint param_get_int
368#define param_check_bint param_check_int
369
370/** 370/**
371 * module_param_array - a parameter which is an array of some type 371 * module_param_array - a parameter which is an array of some type
372 * @name: the name of the array variable 372 * @name: the name of the array variable
@@ -395,6 +395,7 @@ extern int param_get_invbool(char *buffer, const struct kernel_param *kp);
395 * module_param_named() for why this might be necessary. 395 * module_param_named() for why this might be necessary.
396 */ 396 */
397#define module_param_array_named(name, array, type, nump, perm) \ 397#define module_param_array_named(name, array, type, nump, perm) \
398 param_check_##type(name, &(array)[0]); \
398 static const struct kparam_array __param_arr_##name \ 399 static const struct kparam_array __param_arr_##name \
399 = { .max = ARRAY_SIZE(array), .num = nump, \ 400 = { .max = ARRAY_SIZE(array), .num = nump, \
400 .ops = &param_ops_##type, \ 401 .ops = &param_ops_##type, \
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index a3759cb0ac10..6d8c7251eb8d 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -43,9 +43,11 @@ typedef unsigned short mifi_t;
43typedef __u32 if_mask; 43typedef __u32 if_mask;
44#define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */ 44#define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */
45 45
46#if !defined(__KERNEL__) && !defined(DIV_ROUND_UP) 46#if !defined(__KERNEL__)
47#if !defined(DIV_ROUND_UP)
47#define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y)) 48#define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y))
48#endif 49#endif
50#endif
49 51
50typedef struct if_set { 52typedef struct if_set {
51 if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)]; 53 if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];
diff --git a/include/linux/mtd/gpmi-nand.h b/include/linux/mtd/gpmi-nand.h
new file mode 100644
index 000000000000..69b6dbf46b5e
--- /dev/null
+++ b/include/linux/mtd/gpmi-nand.h
@@ -0,0 +1,68 @@
1/*
2 * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License 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 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#ifndef __MACH_MXS_GPMI_NAND_H__
20#define __MACH_MXS_GPMI_NAND_H__
21
22/* The size of the resources is fixed. */
23#define GPMI_NAND_RES_SIZE 6
24
25/* Resource names for the GPMI NAND driver. */
26#define GPMI_NAND_GPMI_REGS_ADDR_RES_NAME "GPMI NAND GPMI Registers"
27#define GPMI_NAND_GPMI_INTERRUPT_RES_NAME "GPMI NAND GPMI Interrupt"
28#define GPMI_NAND_BCH_REGS_ADDR_RES_NAME "GPMI NAND BCH Registers"
29#define GPMI_NAND_BCH_INTERRUPT_RES_NAME "GPMI NAND BCH Interrupt"
30#define GPMI_NAND_DMA_CHANNELS_RES_NAME "GPMI NAND DMA Channels"
31#define GPMI_NAND_DMA_INTERRUPT_RES_NAME "GPMI NAND DMA Interrupt"
32
33/**
34 * struct gpmi_nand_platform_data - GPMI NAND driver platform data.
35 *
36 * This structure communicates platform-specific information to the GPMI NAND
37 * driver that can't be expressed as resources.
38 *
39 * @platform_init: A pointer to a function the driver will call to
40 * initialize the platform (e.g., set up the pin mux).
41 * @min_prop_delay_in_ns: Minimum propagation delay of GPMI signals to and
42 * from the NAND Flash device, in nanoseconds.
43 * @max_prop_delay_in_ns: Maximum propagation delay of GPMI signals to and
44 * from the NAND Flash device, in nanoseconds.
45 * @max_chip_count: The maximum number of chips for which the driver
46 * should configure the hardware. This value most
47 * likely reflects the number of pins that are
48 * connected to a NAND Flash device. If this is
49 * greater than the SoC hardware can support, the
50 * driver will print a message and fail to initialize.
51 * @partitions: An optional pointer to an array of partition
52 * descriptions.
53 * @partition_count: The number of elements in the partitions array.
54 */
55struct gpmi_nand_platform_data {
56 /* SoC hardware information. */
57 int (*platform_init)(void);
58
59 /* NAND Flash information. */
60 unsigned int min_prop_delay_in_ns;
61 unsigned int max_prop_delay_in_ns;
62 unsigned int max_chip_count;
63
64 /* Medium information. */
65 struct mtd_partition *partitions;
66 unsigned partition_count;
67};
68#endif
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
new file mode 100644
index 000000000000..9490a00529f4
--- /dev/null
+++ b/include/linux/nvme.h
@@ -0,0 +1,434 @@
1/*
2 * Definitions for the NVM Express interface
3 * Copyright (c) 2011, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#ifndef _LINUX_NVME_H
20#define _LINUX_NVME_H
21
22#include <linux/types.h>
23
24struct nvme_bar {
25 __u64 cap; /* Controller Capabilities */
26 __u32 vs; /* Version */
27 __u32 intms; /* Interrupt Mask Set */
28 __u32 intmc; /* Interrupt Mask Clear */
29 __u32 cc; /* Controller Configuration */
30 __u32 rsvd1; /* Reserved */
31 __u32 csts; /* Controller Status */
32 __u32 rsvd2; /* Reserved */
33 __u32 aqa; /* Admin Queue Attributes */
34 __u64 asq; /* Admin SQ Base Address */
35 __u64 acq; /* Admin CQ Base Address */
36};
37
38#define NVME_CAP_TIMEOUT(cap) (((cap) >> 24) & 0xff)
39#define NVME_CAP_STRIDE(cap) (((cap) >> 32) & 0xf)
40
41enum {
42 NVME_CC_ENABLE = 1 << 0,
43 NVME_CC_CSS_NVM = 0 << 4,
44 NVME_CC_MPS_SHIFT = 7,
45 NVME_CC_ARB_RR = 0 << 11,
46 NVME_CC_ARB_WRRU = 1 << 11,
47 NVME_CC_ARB_VS = 7 << 11,
48 NVME_CC_SHN_NONE = 0 << 14,
49 NVME_CC_SHN_NORMAL = 1 << 14,
50 NVME_CC_SHN_ABRUPT = 2 << 14,
51 NVME_CC_IOSQES = 6 << 16,
52 NVME_CC_IOCQES = 4 << 20,
53 NVME_CSTS_RDY = 1 << 0,
54 NVME_CSTS_CFS = 1 << 1,
55 NVME_CSTS_SHST_NORMAL = 0 << 2,
56 NVME_CSTS_SHST_OCCUR = 1 << 2,
57 NVME_CSTS_SHST_CMPLT = 2 << 2,
58};
59
60struct nvme_id_power_state {
61 __le16 max_power; /* centiwatts */
62 __u16 rsvd2;
63 __le32 entry_lat; /* microseconds */
64 __le32 exit_lat; /* microseconds */
65 __u8 read_tput;
66 __u8 read_lat;
67 __u8 write_tput;
68 __u8 write_lat;
69 __u8 rsvd16[16];
70};
71
72#define NVME_VS(major, minor) (major << 16 | minor)
73
74struct nvme_id_ctrl {
75 __le16 vid;
76 __le16 ssvid;
77 char sn[20];
78 char mn[40];
79 char fr[8];
80 __u8 rab;
81 __u8 ieee[3];
82 __u8 mic;
83 __u8 mdts;
84 __u8 rsvd78[178];
85 __le16 oacs;
86 __u8 acl;
87 __u8 aerl;
88 __u8 frmw;
89 __u8 lpa;
90 __u8 elpe;
91 __u8 npss;
92 __u8 rsvd264[248];
93 __u8 sqes;
94 __u8 cqes;
95 __u8 rsvd514[2];
96 __le32 nn;
97 __le16 oncs;
98 __le16 fuses;
99 __u8 fna;
100 __u8 vwc;
101 __le16 awun;
102 __le16 awupf;
103 __u8 rsvd530[1518];
104 struct nvme_id_power_state psd[32];
105 __u8 vs[1024];
106};
107
108struct nvme_lbaf {
109 __le16 ms;
110 __u8 ds;
111 __u8 rp;
112};
113
114struct nvme_id_ns {
115 __le64 nsze;
116 __le64 ncap;
117 __le64 nuse;
118 __u8 nsfeat;
119 __u8 nlbaf;
120 __u8 flbas;
121 __u8 mc;
122 __u8 dpc;
123 __u8 dps;
124 __u8 rsvd30[98];
125 struct nvme_lbaf lbaf[16];
126 __u8 rsvd192[192];
127 __u8 vs[3712];
128};
129
130enum {
131 NVME_NS_FEAT_THIN = 1 << 0,
132 NVME_LBAF_RP_BEST = 0,
133 NVME_LBAF_RP_BETTER = 1,
134 NVME_LBAF_RP_GOOD = 2,
135 NVME_LBAF_RP_DEGRADED = 3,
136};
137
138struct nvme_lba_range_type {
139 __u8 type;
140 __u8 attributes;
141 __u8 rsvd2[14];
142 __u64 slba;
143 __u64 nlb;
144 __u8 guid[16];
145 __u8 rsvd48[16];
146};
147
148enum {
149 NVME_LBART_TYPE_FS = 0x01,
150 NVME_LBART_TYPE_RAID = 0x02,
151 NVME_LBART_TYPE_CACHE = 0x03,
152 NVME_LBART_TYPE_SWAP = 0x04,
153
154 NVME_LBART_ATTRIB_TEMP = 1 << 0,
155 NVME_LBART_ATTRIB_HIDE = 1 << 1,
156};
157
158/* I/O commands */
159
160enum nvme_opcode {
161 nvme_cmd_flush = 0x00,
162 nvme_cmd_write = 0x01,
163 nvme_cmd_read = 0x02,
164 nvme_cmd_write_uncor = 0x04,
165 nvme_cmd_compare = 0x05,
166 nvme_cmd_dsm = 0x09,
167};
168
169struct nvme_common_command {
170 __u8 opcode;
171 __u8 flags;
172 __u16 command_id;
173 __le32 nsid;
174 __u32 cdw2[2];
175 __le64 metadata;
176 __le64 prp1;
177 __le64 prp2;
178 __u32 cdw10[6];
179};
180
181struct nvme_rw_command {
182 __u8 opcode;
183 __u8 flags;
184 __u16 command_id;
185 __le32 nsid;
186 __u64 rsvd2;
187 __le64 metadata;
188 __le64 prp1;
189 __le64 prp2;
190 __le64 slba;
191 __le16 length;
192 __le16 control;
193 __le32 dsmgmt;
194 __le32 reftag;
195 __le16 apptag;
196 __le16 appmask;
197};
198
199enum {
200 NVME_RW_LR = 1 << 15,
201 NVME_RW_FUA = 1 << 14,
202 NVME_RW_DSM_FREQ_UNSPEC = 0,
203 NVME_RW_DSM_FREQ_TYPICAL = 1,
204 NVME_RW_DSM_FREQ_RARE = 2,
205 NVME_RW_DSM_FREQ_READS = 3,
206 NVME_RW_DSM_FREQ_WRITES = 4,
207 NVME_RW_DSM_FREQ_RW = 5,
208 NVME_RW_DSM_FREQ_ONCE = 6,
209 NVME_RW_DSM_FREQ_PREFETCH = 7,
210 NVME_RW_DSM_FREQ_TEMP = 8,
211 NVME_RW_DSM_LATENCY_NONE = 0 << 4,
212 NVME_RW_DSM_LATENCY_IDLE = 1 << 4,
213 NVME_RW_DSM_LATENCY_NORM = 2 << 4,
214 NVME_RW_DSM_LATENCY_LOW = 3 << 4,
215 NVME_RW_DSM_SEQ_REQ = 1 << 6,
216 NVME_RW_DSM_COMPRESSED = 1 << 7,
217};
218
219/* Admin commands */
220
221enum nvme_admin_opcode {
222 nvme_admin_delete_sq = 0x00,
223 nvme_admin_create_sq = 0x01,
224 nvme_admin_get_log_page = 0x02,
225 nvme_admin_delete_cq = 0x04,
226 nvme_admin_create_cq = 0x05,
227 nvme_admin_identify = 0x06,
228 nvme_admin_abort_cmd = 0x08,
229 nvme_admin_set_features = 0x09,
230 nvme_admin_get_features = 0x0a,
231 nvme_admin_async_event = 0x0c,
232 nvme_admin_activate_fw = 0x10,
233 nvme_admin_download_fw = 0x11,
234 nvme_admin_format_nvm = 0x80,
235 nvme_admin_security_send = 0x81,
236 nvme_admin_security_recv = 0x82,
237};
238
239enum {
240 NVME_QUEUE_PHYS_CONTIG = (1 << 0),
241 NVME_CQ_IRQ_ENABLED = (1 << 1),
242 NVME_SQ_PRIO_URGENT = (0 << 1),
243 NVME_SQ_PRIO_HIGH = (1 << 1),
244 NVME_SQ_PRIO_MEDIUM = (2 << 1),
245 NVME_SQ_PRIO_LOW = (3 << 1),
246 NVME_FEAT_ARBITRATION = 0x01,
247 NVME_FEAT_POWER_MGMT = 0x02,
248 NVME_FEAT_LBA_RANGE = 0x03,
249 NVME_FEAT_TEMP_THRESH = 0x04,
250 NVME_FEAT_ERR_RECOVERY = 0x05,
251 NVME_FEAT_VOLATILE_WC = 0x06,
252 NVME_FEAT_NUM_QUEUES = 0x07,
253 NVME_FEAT_IRQ_COALESCE = 0x08,
254 NVME_FEAT_IRQ_CONFIG = 0x09,
255 NVME_FEAT_WRITE_ATOMIC = 0x0a,
256 NVME_FEAT_ASYNC_EVENT = 0x0b,
257 NVME_FEAT_SW_PROGRESS = 0x0c,
258};
259
260struct nvme_identify {
261 __u8 opcode;
262 __u8 flags;
263 __u16 command_id;
264 __le32 nsid;
265 __u64 rsvd2[2];
266 __le64 prp1;
267 __le64 prp2;
268 __le32 cns;
269 __u32 rsvd11[5];
270};
271
272struct nvme_features {
273 __u8 opcode;
274 __u8 flags;
275 __u16 command_id;
276 __le32 nsid;
277 __u64 rsvd2[2];
278 __le64 prp1;
279 __le64 prp2;
280 __le32 fid;
281 __le32 dword11;
282 __u32 rsvd12[4];
283};
284
285struct nvme_create_cq {
286 __u8 opcode;
287 __u8 flags;
288 __u16 command_id;
289 __u32 rsvd1[5];
290 __le64 prp1;
291 __u64 rsvd8;
292 __le16 cqid;
293 __le16 qsize;
294 __le16 cq_flags;
295 __le16 irq_vector;
296 __u32 rsvd12[4];
297};
298
299struct nvme_create_sq {
300 __u8 opcode;
301 __u8 flags;
302 __u16 command_id;
303 __u32 rsvd1[5];
304 __le64 prp1;
305 __u64 rsvd8;
306 __le16 sqid;
307 __le16 qsize;
308 __le16 sq_flags;
309 __le16 cqid;
310 __u32 rsvd12[4];
311};
312
313struct nvme_delete_queue {
314 __u8 opcode;
315 __u8 flags;
316 __u16 command_id;
317 __u32 rsvd1[9];
318 __le16 qid;
319 __u16 rsvd10;
320 __u32 rsvd11[5];
321};
322
323struct nvme_download_firmware {
324 __u8 opcode;
325 __u8 flags;
326 __u16 command_id;
327 __u32 rsvd1[5];
328 __le64 prp1;
329 __le64 prp2;
330 __le32 numd;
331 __le32 offset;
332 __u32 rsvd12[4];
333};
334
335struct nvme_command {
336 union {
337 struct nvme_common_command common;
338 struct nvme_rw_command rw;
339 struct nvme_identify identify;
340 struct nvme_features features;
341 struct nvme_create_cq create_cq;
342 struct nvme_create_sq create_sq;
343 struct nvme_delete_queue delete_queue;
344 struct nvme_download_firmware dlfw;
345 };
346};
347
348enum {
349 NVME_SC_SUCCESS = 0x0,
350 NVME_SC_INVALID_OPCODE = 0x1,
351 NVME_SC_INVALID_FIELD = 0x2,
352 NVME_SC_CMDID_CONFLICT = 0x3,
353 NVME_SC_DATA_XFER_ERROR = 0x4,
354 NVME_SC_POWER_LOSS = 0x5,
355 NVME_SC_INTERNAL = 0x6,
356 NVME_SC_ABORT_REQ = 0x7,
357 NVME_SC_ABORT_QUEUE = 0x8,
358 NVME_SC_FUSED_FAIL = 0x9,
359 NVME_SC_FUSED_MISSING = 0xa,
360 NVME_SC_INVALID_NS = 0xb,
361 NVME_SC_LBA_RANGE = 0x80,
362 NVME_SC_CAP_EXCEEDED = 0x81,
363 NVME_SC_NS_NOT_READY = 0x82,
364 NVME_SC_CQ_INVALID = 0x100,
365 NVME_SC_QID_INVALID = 0x101,
366 NVME_SC_QUEUE_SIZE = 0x102,
367 NVME_SC_ABORT_LIMIT = 0x103,
368 NVME_SC_ABORT_MISSING = 0x104,
369 NVME_SC_ASYNC_LIMIT = 0x105,
370 NVME_SC_FIRMWARE_SLOT = 0x106,
371 NVME_SC_FIRMWARE_IMAGE = 0x107,
372 NVME_SC_INVALID_VECTOR = 0x108,
373 NVME_SC_INVALID_LOG_PAGE = 0x109,
374 NVME_SC_INVALID_FORMAT = 0x10a,
375 NVME_SC_BAD_ATTRIBUTES = 0x180,
376 NVME_SC_WRITE_FAULT = 0x280,
377 NVME_SC_READ_ERROR = 0x281,
378 NVME_SC_GUARD_CHECK = 0x282,
379 NVME_SC_APPTAG_CHECK = 0x283,
380 NVME_SC_REFTAG_CHECK = 0x284,
381 NVME_SC_COMPARE_FAILED = 0x285,
382 NVME_SC_ACCESS_DENIED = 0x286,
383};
384
385struct nvme_completion {
386 __le32 result; /* Used by admin commands to return data */
387 __u32 rsvd;
388 __le16 sq_head; /* how much of this queue may be reclaimed */
389 __le16 sq_id; /* submission queue that generated this entry */
390 __u16 command_id; /* of the command which completed */
391 __le16 status; /* did the command fail, and if so, why? */
392};
393
394struct nvme_user_io {
395 __u8 opcode;
396 __u8 flags;
397 __u16 control;
398 __u16 nblocks;
399 __u16 rsvd;
400 __u64 metadata;
401 __u64 addr;
402 __u64 slba;
403 __u32 dsmgmt;
404 __u32 reftag;
405 __u16 apptag;
406 __u16 appmask;
407};
408
409struct nvme_admin_cmd {
410 __u8 opcode;
411 __u8 flags;
412 __u16 rsvd1;
413 __u32 nsid;
414 __u32 cdw2;
415 __u32 cdw3;
416 __u64 metadata;
417 __u64 addr;
418 __u32 metadata_len;
419 __u32 data_len;
420 __u32 cdw10;
421 __u32 cdw11;
422 __u32 cdw12;
423 __u32 cdw13;
424 __u32 cdw14;
425 __u32 cdw15;
426 __u32 timeout_ms;
427 __u32 result;
428};
429
430#define NVME_IOCTL_ID _IO('N', 0x40)
431#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
432#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
433
434#endif /* _LINUX_NVME_H */
diff --git a/include/linux/patchkey.h b/include/linux/patchkey.h
index d974a6e92372..aefda0ec6e62 100644
--- a/include/linux/patchkey.h
+++ b/include/linux/patchkey.h
@@ -32,7 +32,8 @@
32# else 32# else
33# error "could not determine byte order" 33# error "could not determine byte order"
34# endif 34# endif
35#elif defined(__BYTE_ORDER) 35#else
36#if defined(__BYTE_ORDER)
36# if __BYTE_ORDER == __BIG_ENDIAN 37# if __BYTE_ORDER == __BIG_ENDIAN
37# define _PATCHKEY(id) (0xfd00|id) 38# define _PATCHKEY(id) (0xfd00|id)
38# elif __BYTE_ORDER == __LITTLE_ENDIAN 39# elif __BYTE_ORDER == __LITTLE_ENDIAN
@@ -41,5 +42,6 @@
41# error "could not determine byte order" 42# error "could not determine byte order"
42# endif 43# endif
43#endif 44#endif
45#endif
44 46
45#endif /* _LINUX_PATCHKEY_H */ 47#endif /* _LINUX_PATCHKEY_H */
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index cafe98d96948..84e6a55a1202 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -6,6 +6,8 @@
6 * Copyright (C) 1998 Paul Mackerras. 6 * Copyright (C) 1998 Paul Mackerras.
7 */ 7 */
8 8
9#ifndef _LINUX_PMU_H
10#define _LINUX_PMU_H
9 11
10#define PMU_DRIVER_VERSION 2 12#define PMU_DRIVER_VERSION 2
11 13
@@ -207,3 +209,5 @@ extern int pmu_sys_suspended;
207#endif 209#endif
208 210
209#endif /* __KERNEL__ */ 211#endif /* __KERNEL__ */
212
213#endif /* _LINUX_PMU_H */
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 800f113bea66..c2f1f6a5fcb8 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -112,6 +112,7 @@
112 112
113#include <linux/compiler.h> /* For unlikely. */ 113#include <linux/compiler.h> /* For unlikely. */
114#include <linux/sched.h> /* For struct task_struct. */ 114#include <linux/sched.h> /* For struct task_struct. */
115#include <linux/err.h> /* for IS_ERR_VALUE */
115 116
116 117
117extern long arch_ptrace(struct task_struct *child, long request, 118extern long arch_ptrace(struct task_struct *child, long request,
@@ -127,8 +128,9 @@ extern void __ptrace_link(struct task_struct *child,
127 struct task_struct *new_parent); 128 struct task_struct *new_parent);
128extern void __ptrace_unlink(struct task_struct *child); 129extern void __ptrace_unlink(struct task_struct *child);
129extern void exit_ptrace(struct task_struct *tracer); 130extern void exit_ptrace(struct task_struct *tracer);
130#define PTRACE_MODE_READ 1 131#define PTRACE_MODE_READ 0x01
131#define PTRACE_MODE_ATTACH 2 132#define PTRACE_MODE_ATTACH 0x02
133#define PTRACE_MODE_NOAUDIT 0x04
132/* Returns 0 on success, -errno on denial. */ 134/* Returns 0 on success, -errno on denial. */
133extern int __ptrace_may_access(struct task_struct *task, unsigned int mode); 135extern int __ptrace_may_access(struct task_struct *task, unsigned int mode);
134/* Returns true on success, false on denial. */ 136/* Returns true on success, false on denial. */
@@ -265,6 +267,15 @@ static inline void ptrace_release_task(struct task_struct *task)
265#define force_successful_syscall_return() do { } while (0) 267#define force_successful_syscall_return() do { } while (0)
266#endif 268#endif
267 269
270#ifndef is_syscall_success
271/*
272 * On most systems we can tell if a syscall is a success based on if the retval
273 * is an error value. On some systems like ia64 and powerpc they have different
274 * indicators of success/failure and must define their own.
275 */
276#define is_syscall_success(regs) (!IS_ERR_VALUE((unsigned long)(regs_return_value(regs))))
277#endif
278
268/* 279/*
269 * <asm/ptrace.h> should define the following things inside #ifdef __KERNEL__. 280 * <asm/ptrace.h> should define the following things inside #ifdef __KERNEL__.
270 * 281 *
diff --git a/include/linux/quota.h b/include/linux/quota.h
index cb7855699037..c09fa042b5ea 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -230,7 +230,11 @@ struct mem_dqinfo {
230struct super_block; 230struct super_block;
231 231
232#define DQF_MASK 0xffff /* Mask for format specific flags */ 232#define DQF_MASK 0xffff /* Mask for format specific flags */
233#define DQF_INFO_DIRTY_B 16 233#define DQF_GETINFO_MASK 0x1ffff /* Mask for flags passed to userspace */
234#define DQF_SETINFO_MASK 0xffff /* Mask for flags modifiable from userspace */
235#define DQF_SYS_FILE_B 16
236#define DQF_SYS_FILE (1 << DQF_SYS_FILE_B) /* Quota file stored as system file */
237#define DQF_INFO_DIRTY_B 31
234#define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */ 238#define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */
235 239
236extern void mark_info_dirty(struct super_block *sb, int type); 240extern void mark_info_dirty(struct super_block *sb, int type);
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h
index c9d625ca659e..da81af086eaf 100644
--- a/include/linux/res_counter.h
+++ b/include/linux/res_counter.h
@@ -109,12 +109,18 @@ void res_counter_init(struct res_counter *counter, struct res_counter *parent);
109 * 109 *
110 * returns 0 on success and <0 if the counter->usage will exceed the 110 * returns 0 on success and <0 if the counter->usage will exceed the
111 * counter->limit _locked call expects the counter->lock to be taken 111 * counter->limit _locked call expects the counter->lock to be taken
112 *
113 * charge_nofail works the same, except that it charges the resource
114 * counter unconditionally, and returns < 0 if the after the current
115 * charge we are over limit.
112 */ 116 */
113 117
114int __must_check res_counter_charge_locked(struct res_counter *counter, 118int __must_check res_counter_charge_locked(struct res_counter *counter,
115 unsigned long val); 119 unsigned long val);
116int __must_check res_counter_charge(struct res_counter *counter, 120int __must_check res_counter_charge(struct res_counter *counter,
117 unsigned long val, struct res_counter **limit_fail_at); 121 unsigned long val, struct res_counter **limit_fail_at);
122int __must_check res_counter_charge_nofail(struct res_counter *counter,
123 unsigned long val, struct res_counter **limit_fail_at);
118 124
119/* 125/*
120 * uncharge - tell that some portion of the resource is released 126 * uncharge - tell that some portion of the resource is released
@@ -142,7 +148,10 @@ static inline unsigned long long res_counter_margin(struct res_counter *cnt)
142 unsigned long flags; 148 unsigned long flags;
143 149
144 spin_lock_irqsave(&cnt->lock, flags); 150 spin_lock_irqsave(&cnt->lock, flags);
145 margin = cnt->limit - cnt->usage; 151 if (cnt->limit > cnt->usage)
152 margin = cnt->limit - cnt->usage;
153 else
154 margin = 0;
146 spin_unlock_irqrestore(&cnt->lock, flags); 155 spin_unlock_irqrestore(&cnt->lock, flags);
147 return margin; 156 return margin;
148} 157}
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4032ec1cf836..513f52459872 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2088,7 +2088,7 @@ extern int sched_setscheduler_nocheck(struct task_struct *, int,
2088extern struct task_struct *idle_task(int cpu); 2088extern struct task_struct *idle_task(int cpu);
2089/** 2089/**
2090 * is_idle_task - is the specified task an idle task? 2090 * is_idle_task - is the specified task an idle task?
2091 * @tsk: the task in question. 2091 * @p: the task in question.
2092 */ 2092 */
2093static inline bool is_idle_task(struct task_struct *p) 2093static inline bool is_idle_task(struct task_struct *p)
2094{ 2094{
diff --git a/include/linux/security.h b/include/linux/security.h
index 0ccceb9b1046..83c18e8c846d 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -54,8 +54,8 @@ struct user_namespace;
54 * These functions are in security/capability.c and are used 54 * These functions are in security/capability.c and are used
55 * as the default capabilities functions 55 * as the default capabilities functions
56 */ 56 */
57extern int cap_capable(struct task_struct *tsk, const struct cred *cred, 57extern int cap_capable(const struct cred *cred, struct user_namespace *ns,
58 struct user_namespace *ns, int cap, int audit); 58 int cap, int audit);
59extern int cap_settime(const struct timespec *ts, const struct timezone *tz); 59extern int cap_settime(const struct timespec *ts, const struct timezone *tz);
60extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode); 60extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode);
61extern int cap_ptrace_traceme(struct task_struct *parent); 61extern int cap_ptrace_traceme(struct task_struct *parent);
@@ -96,7 +96,6 @@ struct xfrm_user_sec_ctx;
96struct seq_file; 96struct seq_file;
97 97
98extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); 98extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
99extern int cap_netlink_recv(struct sk_buff *skb, int cap);
100 99
101void reset_security_ops(void); 100void reset_security_ops(void);
102 101
@@ -799,12 +798,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
799 * @skb contains the sk_buff structure for the netlink message. 798 * @skb contains the sk_buff structure for the netlink message.
800 * Return 0 if the information was successfully saved and message 799 * Return 0 if the information was successfully saved and message
801 * is allowed to be transmitted. 800 * is allowed to be transmitted.
802 * @netlink_recv:
803 * Check permission before processing the received netlink message in
804 * @skb.
805 * @skb contains the sk_buff structure for the netlink message.
806 * @cap indicates the capability required
807 * Return 0 if permission is granted.
808 * 801 *
809 * Security hooks for Unix domain networking. 802 * Security hooks for Unix domain networking.
810 * 803 *
@@ -1268,7 +1261,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1268 * @capable: 1261 * @capable:
1269 * Check whether the @tsk process has the @cap capability in the indicated 1262 * Check whether the @tsk process has the @cap capability in the indicated
1270 * credentials. 1263 * credentials.
1271 * @tsk contains the task_struct for the process.
1272 * @cred contains the credentials to use. 1264 * @cred contains the credentials to use.
1273 * @ns contains the user namespace we want the capability in 1265 * @ns contains the user namespace we want the capability in
1274 * @cap contains the capability <include/linux/capability.h>. 1266 * @cap contains the capability <include/linux/capability.h>.
@@ -1392,8 +1384,8 @@ struct security_operations {
1392 const kernel_cap_t *effective, 1384 const kernel_cap_t *effective,
1393 const kernel_cap_t *inheritable, 1385 const kernel_cap_t *inheritable,
1394 const kernel_cap_t *permitted); 1386 const kernel_cap_t *permitted);
1395 int (*capable) (struct task_struct *tsk, const struct cred *cred, 1387 int (*capable) (const struct cred *cred, struct user_namespace *ns,
1396 struct user_namespace *ns, int cap, int audit); 1388 int cap, int audit);
1397 int (*quotactl) (int cmds, int type, int id, struct super_block *sb); 1389 int (*quotactl) (int cmds, int type, int id, struct super_block *sb);
1398 int (*quota_on) (struct dentry *dentry); 1390 int (*quota_on) (struct dentry *dentry);
1399 int (*syslog) (int type); 1391 int (*syslog) (int type);
@@ -1563,7 +1555,6 @@ struct security_operations {
1563 struct sembuf *sops, unsigned nsops, int alter); 1555 struct sembuf *sops, unsigned nsops, int alter);
1564 1556
1565 int (*netlink_send) (struct sock *sk, struct sk_buff *skb); 1557 int (*netlink_send) (struct sock *sk, struct sk_buff *skb);
1566 int (*netlink_recv) (struct sk_buff *skb, int cap);
1567 1558
1568 void (*d_instantiate) (struct dentry *dentry, struct inode *inode); 1559 void (*d_instantiate) (struct dentry *dentry, struct inode *inode);
1569 1560
@@ -1675,12 +1666,10 @@ int security_capset(struct cred *new, const struct cred *old,
1675 const kernel_cap_t *effective, 1666 const kernel_cap_t *effective,
1676 const kernel_cap_t *inheritable, 1667 const kernel_cap_t *inheritable,
1677 const kernel_cap_t *permitted); 1668 const kernel_cap_t *permitted);
1678int security_capable(struct user_namespace *ns, const struct cred *cred, 1669int security_capable(const struct cred *cred, struct user_namespace *ns,
1679 int cap);
1680int security_real_capable(struct task_struct *tsk, struct user_namespace *ns,
1681 int cap); 1670 int cap);
1682int security_real_capable_noaudit(struct task_struct *tsk, 1671int security_capable_noaudit(const struct cred *cred, struct user_namespace *ns,
1683 struct user_namespace *ns, int cap); 1672 int cap);
1684int security_quotactl(int cmds, int type, int id, struct super_block *sb); 1673int security_quotactl(int cmds, int type, int id, struct super_block *sb);
1685int security_quota_on(struct dentry *dentry); 1674int security_quota_on(struct dentry *dentry);
1686int security_syslog(int type); 1675int security_syslog(int type);
@@ -1817,7 +1806,6 @@ void security_d_instantiate(struct dentry *dentry, struct inode *inode);
1817int security_getprocattr(struct task_struct *p, char *name, char **value); 1806int security_getprocattr(struct task_struct *p, char *name, char **value);
1818int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size); 1807int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size);
1819int security_netlink_send(struct sock *sk, struct sk_buff *skb); 1808int security_netlink_send(struct sock *sk, struct sk_buff *skb);
1820int security_netlink_recv(struct sk_buff *skb, int cap);
1821int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen); 1809int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen);
1822int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid); 1810int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid);
1823void security_release_secctx(char *secdata, u32 seclen); 1811void security_release_secctx(char *secdata, u32 seclen);
@@ -1875,32 +1863,15 @@ static inline int security_capset(struct cred *new,
1875 return cap_capset(new, old, effective, inheritable, permitted); 1863 return cap_capset(new, old, effective, inheritable, permitted);
1876} 1864}
1877 1865
1878static inline int security_capable(struct user_namespace *ns, 1866static inline int security_capable(const struct cred *cred,
1879 const struct cred *cred, int cap) 1867 struct user_namespace *ns, int cap)
1880{
1881 return cap_capable(current, cred, ns, cap, SECURITY_CAP_AUDIT);
1882}
1883
1884static inline int security_real_capable(struct task_struct *tsk, struct user_namespace *ns, int cap)
1885{ 1868{
1886 int ret; 1869 return cap_capable(cred, ns, cap, SECURITY_CAP_AUDIT);
1887
1888 rcu_read_lock();
1889 ret = cap_capable(tsk, __task_cred(tsk), ns, cap, SECURITY_CAP_AUDIT);
1890 rcu_read_unlock();
1891 return ret;
1892} 1870}
1893 1871
1894static inline 1872static inline int security_capable_noaudit(const struct cred *cred,
1895int security_real_capable_noaudit(struct task_struct *tsk, struct user_namespace *ns, int cap) 1873 struct user_namespace *ns, int cap) {
1896{ 1874 return cap_capable(cred, ns, cap, SECURITY_CAP_NOAUDIT);
1897 int ret;
1898
1899 rcu_read_lock();
1900 ret = cap_capable(tsk, __task_cred(tsk), ns, cap,
1901 SECURITY_CAP_NOAUDIT);
1902 rcu_read_unlock();
1903 return ret;
1904} 1875}
1905 1876
1906static inline int security_quotactl(int cmds, int type, int id, 1877static inline int security_quotactl(int cmds, int type, int id,
@@ -2517,11 +2488,6 @@ static inline int security_netlink_send(struct sock *sk, struct sk_buff *skb)
2517 return cap_netlink_send(sk, skb); 2488 return cap_netlink_send(sk, skb);
2518} 2489}
2519 2490
2520static inline int security_netlink_recv(struct sk_buff *skb, int cap)
2521{
2522 return cap_netlink_recv(skb, cap);
2523}
2524
2525static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) 2491static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
2526{ 2492{
2527 return -EOPNOTSUPP; 2493 return -EOPNOTSUPP;
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index b67305e3ad57..c91ace70c21d 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -207,6 +207,10 @@
207/* Xilinx PSS UART */ 207/* Xilinx PSS UART */
208#define PORT_XUARTPS 98 208#define PORT_XUARTPS 98
209 209
210/* Atheros AR933X SoC */
211#define PORT_AR933X 99
212
213
210#ifdef __KERNEL__ 214#ifdef __KERNEL__
211 215
212#include <linux/compiler.h> 216#include <linux/compiler.h>
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h
index cb2dd118cc0f..8cd7fe59cf1a 100644
--- a/include/linux/sh_dma.h
+++ b/include/linux/sh_dma.h
@@ -30,7 +30,7 @@ struct sh_desc {
30 struct sh_dmae_regs hw; 30 struct sh_dmae_regs hw;
31 struct list_head node; 31 struct list_head node;
32 struct dma_async_tx_descriptor async_tx; 32 struct dma_async_tx_descriptor async_tx;
33 enum dma_data_direction direction; 33 enum dma_transfer_direction direction;
34 dma_cookie_t cookie; 34 dma_cookie_t cookie;
35 size_t partial; 35 size_t partial;
36 int chunks; 36 int chunks;
@@ -48,6 +48,7 @@ struct sh_dmae_channel {
48 unsigned int offset; 48 unsigned int offset;
49 unsigned int dmars; 49 unsigned int dmars;
50 unsigned int dmars_bit; 50 unsigned int dmars_bit;
51 unsigned int chclr_offset;
51}; 52};
52 53
53struct sh_dmae_pdata { 54struct sh_dmae_pdata {
@@ -68,6 +69,7 @@ struct sh_dmae_pdata {
68 unsigned int dmaor_is_32bit:1; 69 unsigned int dmaor_is_32bit:1;
69 unsigned int needs_tend_set:1; 70 unsigned int needs_tend_set:1;
70 unsigned int no_dmars:1; 71 unsigned int no_dmars:1;
72 unsigned int chclr_present:1;
71}; 73};
72 74
73/* DMA register */ 75/* DMA register */
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index e4c711c6f321..79ab2555b3b0 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -48,6 +48,7 @@ extern struct file *shmem_file_setup(const char *name,
48 loff_t size, unsigned long flags); 48 loff_t size, unsigned long flags);
49extern int shmem_zero_setup(struct vm_area_struct *); 49extern int shmem_zero_setup(struct vm_area_struct *);
50extern int shmem_lock(struct file *file, int lock, struct user_struct *user); 50extern int shmem_lock(struct file *file, int lock, struct user_struct *user);
51extern void shmem_unlock_mapping(struct address_space *mapping);
51extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, 52extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
52 pgoff_t index, gfp_t gfp_mask); 53 pgoff_t index, gfp_t gfp_mask);
53extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end); 54extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end);
diff --git a/include/linux/sirfsoc_dma.h b/include/linux/sirfsoc_dma.h
new file mode 100644
index 000000000000..29d959333d81
--- /dev/null
+++ b/include/linux/sirfsoc_dma.h
@@ -0,0 +1,6 @@
1#ifndef _SIRFSOC_DMA_H_
2#define _SIRFSOC_DMA_H_
3
4bool sirfsoc_dma_filter_id(struct dma_chan *chan, void *chan_id);
5
6#endif
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index e16557a357e5..c1241c428179 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -192,7 +192,6 @@ enum
192 LINUX_MIB_TCPPARTIALUNDO, /* TCPPartialUndo */ 192 LINUX_MIB_TCPPARTIALUNDO, /* TCPPartialUndo */
193 LINUX_MIB_TCPDSACKUNDO, /* TCPDSACKUndo */ 193 LINUX_MIB_TCPDSACKUNDO, /* TCPDSACKUndo */
194 LINUX_MIB_TCPLOSSUNDO, /* TCPLossUndo */ 194 LINUX_MIB_TCPLOSSUNDO, /* TCPLossUndo */
195 LINUX_MIB_TCPLOSS, /* TCPLoss */
196 LINUX_MIB_TCPLOSTRETRANSMIT, /* TCPLostRetransmit */ 195 LINUX_MIB_TCPLOSTRETRANSMIT, /* TCPLostRetransmit */
197 LINUX_MIB_TCPRENOFAILURES, /* TCPRenoFailures */ 196 LINUX_MIB_TCPRENOFAILURES, /* TCPRenoFailures */
198 LINUX_MIB_TCPSACKFAILURES, /* TCPSackFailures */ 197 LINUX_MIB_TCPSACKFAILURES, /* TCPSackFailures */
diff --git a/include/linux/sound.h b/include/linux/sound.h
index 44dcf0570432..fae20ba01fbf 100644
--- a/include/linux/sound.h
+++ b/include/linux/sound.h
@@ -1,3 +1,5 @@
1#ifndef _LINUX_SOUND_H
2#define _LINUX_SOUND_H
1 3
2/* 4/*
3 * Minor numbers for the sound driver. 5 * Minor numbers for the sound driver.
@@ -42,3 +44,5 @@ extern void unregister_sound_mixer(int unit);
42extern void unregister_sound_midi(int unit); 44extern void unregister_sound_midi(int unit);
43extern void unregister_sound_dsp(int unit); 45extern void unregister_sound_dsp(int unit);
44#endif /* __KERNEL__ */ 46#endif /* __KERNEL__ */
47
48#endif /* _LINUX_SOUND_H */
diff --git a/include/linux/soundcard.h b/include/linux/soundcard.h
index fe204fe39f7c..dfcf86f013a9 100644
--- a/include/linux/soundcard.h
+++ b/include/linux/soundcard.h
@@ -198,7 +198,8 @@ typedef struct seq_event_rec {
198# else 198# else
199# error "could not determine byte order" 199# error "could not determine byte order"
200# endif 200# endif
201#elif defined(__BYTE_ORDER) 201#else
202# if defined(__BYTE_ORDER)
202# if __BYTE_ORDER == __BIG_ENDIAN 203# if __BYTE_ORDER == __BIG_ENDIAN
203# define AFMT_S16_NE AFMT_S16_BE 204# define AFMT_S16_NE AFMT_S16_BE
204# elif __BYTE_ORDER == __LITTLE_ENDIAN 205# elif __BYTE_ORDER == __LITTLE_ENDIAN
@@ -206,6 +207,7 @@ typedef struct seq_event_rec {
206# else 207# else
207# error "could not determine byte order" 208# error "could not determine byte order"
208# endif 209# endif
210# endif
209#endif 211#endif
210 212
211/* 213/*
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 8620f79658d4..dfa900948af7 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -109,7 +109,7 @@ static inline int register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u
109 109
110int svc_reg_xprt_class(struct svc_xprt_class *); 110int svc_reg_xprt_class(struct svc_xprt_class *);
111void svc_unreg_xprt_class(struct svc_xprt_class *); 111void svc_unreg_xprt_class(struct svc_xprt_class *);
112void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *, 112void svc_xprt_init(struct net *, struct svc_xprt_class *, struct svc_xprt *,
113 struct svc_serv *); 113 struct svc_serv *);
114int svc_create_xprt(struct svc_serv *, const char *, struct net *, 114int svc_create_xprt(struct svc_serv *, const char *, struct net *,
115 const int, const unsigned short, int); 115 const int, const unsigned short, int);
@@ -118,7 +118,6 @@ void svc_xprt_received(struct svc_xprt *);
118void svc_xprt_put(struct svc_xprt *xprt); 118void svc_xprt_put(struct svc_xprt *xprt);
119void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt); 119void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt);
120void svc_close_xprt(struct svc_xprt *xprt); 120void svc_close_xprt(struct svc_xprt *xprt);
121void svc_delete_xprt(struct svc_xprt *xprt);
122int svc_port_is_privileged(struct sockaddr *sin); 121int svc_port_is_privileged(struct sockaddr *sin);
123int svc_print_xprts(char *buf, int maxlen); 122int svc_print_xprts(char *buf, int maxlen);
124struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, 123struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name,
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 85c50b40759d..c84e9741cb2a 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -34,7 +34,7 @@ struct svc_sock {
34/* 34/*
35 * Function prototypes. 35 * Function prototypes.
36 */ 36 */
37void svc_close_all(struct list_head *); 37void svc_close_all(struct svc_serv *);
38int svc_recv(struct svc_rqst *, long); 38int svc_recv(struct svc_rqst *, long);
39int svc_send(struct svc_rqst *); 39int svc_send(struct svc_rqst *);
40void svc_drop(struct svc_rqst *); 40void svc_drop(struct svc_rqst *);
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 95040cc33107..91784a4f8608 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -357,14 +357,29 @@ extern bool pm_save_wakeup_count(unsigned int count);
357 357
358static inline void lock_system_sleep(void) 358static inline void lock_system_sleep(void)
359{ 359{
360 freezer_do_not_count(); 360 current->flags |= PF_FREEZER_SKIP;
361 mutex_lock(&pm_mutex); 361 mutex_lock(&pm_mutex);
362} 362}
363 363
364static inline void unlock_system_sleep(void) 364static inline void unlock_system_sleep(void)
365{ 365{
366 /*
367 * Don't use freezer_count() because we don't want the call to
368 * try_to_freeze() here.
369 *
370 * Reason:
371 * Fundamentally, we just don't need it, because freezing condition
372 * doesn't come into effect until we release the pm_mutex lock,
373 * since the freezer always works with pm_mutex held.
374 *
375 * More importantly, in the case of hibernation,
376 * unlock_system_sleep() gets called in snapshot_read() and
377 * snapshot_write() when the freezing condition is still in effect.
378 * Which means, if we use try_to_freeze() here, it would make them
379 * enter the refrigerator, thus causing hibernation to lockup.
380 */
381 current->flags &= ~PF_FREEZER_SKIP;
366 mutex_unlock(&pm_mutex); 382 mutex_unlock(&pm_mutex);
367 freezer_count();
368} 383}
369 384
370#else /* !CONFIG_PM_SLEEP */ 385#else /* !CONFIG_PM_SLEEP */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 06061a7f8e69..3e60228e7299 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -273,7 +273,7 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order)
273#endif 273#endif
274 274
275extern int page_evictable(struct page *page, struct vm_area_struct *vma); 275extern int page_evictable(struct page *page, struct vm_area_struct *vma);
276extern void scan_mapping_unevictable_pages(struct address_space *); 276extern void check_move_unevictable_pages(struct page **, int nr_pages);
277 277
278extern unsigned long scan_unevictable_pages; 278extern unsigned long scan_unevictable_pages;
279extern int scan_unevictable_handler(struct ctl_table *, int, 279extern int scan_unevictable_handler(struct ctl_table *, int,
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index ecdaeb98b293..5cf685086dd3 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -312,7 +312,6 @@ struct tty_driver {
312 */ 312 */
313 struct tty_struct **ttys; 313 struct tty_struct **ttys;
314 struct ktermios **termios; 314 struct ktermios **termios;
315 struct ktermios **termios_locked;
316 void *driver_state; 315 void *driver_state;
317 316
318 /* 317 /*
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 27a4e16d2bf1..69d845739bc2 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1073,6 +1073,7 @@ typedef void (*usb_complete_t)(struct urb *);
1073 * which the host controller driver should use in preference to the 1073 * which the host controller driver should use in preference to the
1074 * transfer_buffer. 1074 * transfer_buffer.
1075 * @sg: scatter gather buffer list 1075 * @sg: scatter gather buffer list
1076 * @num_mapped_sgs: (internal) number of mapped sg entries
1076 * @num_sgs: number of entries in the sg list 1077 * @num_sgs: number of entries in the sg list
1077 * @transfer_buffer_length: How big is transfer_buffer. The transfer may 1078 * @transfer_buffer_length: How big is transfer_buffer. The transfer may
1078 * be broken up into chunks according to the current maximum packet 1079 * be broken up into chunks according to the current maximum packet
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 4b752d5ee80e..5e11f8a1f867 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -343,6 +343,8 @@ struct v4l2_pix_format {
343#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */ 343#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */
344#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ 344#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */
345#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ 345#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
346#define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */
347#define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */
346 348
347/* two non contiguous planes - one Y, one Cr + Cb interleaved */ 349/* two non contiguous planes - one Y, one Cr + Cb interleaved */
348#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ 350#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
@@ -401,6 +403,7 @@ struct v4l2_pix_format {
401#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ 403#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
402#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ 404#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
403#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ 405#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
406#define V4L2_PIX_FMT_JL2005BCD v4l2_fourcc('J', 'L', '2', '0') /* compressed RGGB bayer */
404#define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */ 407#define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
405#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ 408#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
406#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ 409#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
@@ -742,6 +745,48 @@ struct v4l2_crop {
742 struct v4l2_rect c; 745 struct v4l2_rect c;
743}; 746};
744 747
748/* Hints for adjustments of selection rectangle */
749#define V4L2_SEL_FLAG_GE 0x00000001
750#define V4L2_SEL_FLAG_LE 0x00000002
751
752/* Selection targets */
753
754/* current cropping area */
755#define V4L2_SEL_TGT_CROP_ACTIVE 0
756/* default cropping area */
757#define V4L2_SEL_TGT_CROP_DEFAULT 1
758/* cropping bounds */
759#define V4L2_SEL_TGT_CROP_BOUNDS 2
760/* current composing area */
761#define V4L2_SEL_TGT_COMPOSE_ACTIVE 256
762/* default composing area */
763#define V4L2_SEL_TGT_COMPOSE_DEFAULT 257
764/* composing bounds */
765#define V4L2_SEL_TGT_COMPOSE_BOUNDS 258
766/* current composing area plus all padding pixels */
767#define V4L2_SEL_TGT_COMPOSE_PADDED 259
768
769/**
770 * struct v4l2_selection - selection info
771 * @type: buffer type (do not use *_MPLANE types)
772 * @target: selection target, used to choose one of possible rectangles
773 * @flags: constraints flags
774 * @r: coordinates of selection window
775 * @reserved: for future use, rounds structure size to 64 bytes, set to zero
776 *
777 * Hardware may use multiple helper window to process a video stream.
778 * The structure is used to exchange this selection areas between
779 * an application and a driver.
780 */
781struct v4l2_selection {
782 __u32 type;
783 __u32 target;
784 __u32 flags;
785 struct v4l2_rect r;
786 __u32 reserved[9];
787};
788
789
745/* 790/*
746 * A N A L O G V I D E O S T A N D A R D 791 * A N A L O G V I D E O S T A N D A R D
747 */ 792 */
@@ -1131,6 +1176,7 @@ struct v4l2_querymenu {
1131#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000 1176#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
1132 1177
1133/* User-class control IDs defined by V4L2 */ 1178/* User-class control IDs defined by V4L2 */
1179#define V4L2_CID_MAX_CTRLS 1024
1134#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900) 1180#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
1135#define V4L2_CID_USER_BASE V4L2_CID_BASE 1181#define V4L2_CID_USER_BASE V4L2_CID_BASE
1136/* IDs reserved for driver specific controls */ 1182/* IDs reserved for driver specific controls */
@@ -1204,10 +1250,10 @@ enum v4l2_colorfx {
1204#define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39) 1250#define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39)
1205#define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40) 1251#define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40)
1206 1252
1207/* last CID + 1 */ 1253#define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41)
1208#define V4L2_CID_LASTP1 (V4L2_CID_BASE+41)
1209 1254
1210/* Minimum number of buffer neede by the device */ 1255/* last CID + 1 */
1256#define V4L2_CID_LASTP1 (V4L2_CID_BASE+42)
1211 1257
1212/* MPEG-class control IDs defined by V4L2 */ 1258/* MPEG-class control IDs defined by V4L2 */
1213#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 1259#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
@@ -1682,6 +1728,8 @@ enum v4l2_flash_strobe_source {
1682#define V4L2_FLASH_FAULT_TIMEOUT (1 << 1) 1728#define V4L2_FLASH_FAULT_TIMEOUT (1 << 1)
1683#define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2) 1729#define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2)
1684#define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3) 1730#define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3)
1731#define V4L2_FLASH_FAULT_OVER_CURRENT (1 << 4)
1732#define V4L2_FLASH_FAULT_INDICATOR (1 << 5)
1685 1733
1686#define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11) 1734#define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11)
1687#define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12) 1735#define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12)
@@ -2255,6 +2303,10 @@ struct v4l2_create_buffers {
2255#define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers) 2303#define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers)
2256#define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer) 2304#define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer)
2257 2305
2306/* Experimental selection API */
2307#define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection)
2308#define VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection)
2309
2258/* Reminder: when adding new ioctls please add support for them to 2310/* Reminder: when adding new ioctls please add support for them to
2259 drivers/media/video/v4l2-compat-ioctl32.c as well! */ 2311 drivers/media/video/v4l2-compat-ioctl32.c as well! */
2260 2312
diff --git a/include/linux/zorro_ids.h b/include/linux/zorro_ids.h
index 7e749088910d..74bc53bcfdcf 100644
--- a/include/linux/zorro_ids.h
+++ b/include/linux/zorro_ids.h
@@ -360,8 +360,8 @@
360#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM ZORRO_ID(VILLAGE_TRONIC, 0x0B, 0) 360#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM ZORRO_ID(VILLAGE_TRONIC, 0x0B, 0)
361#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG ZORRO_ID(VILLAGE_TRONIC, 0x0C, 0) 361#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG ZORRO_ID(VILLAGE_TRONIC, 0x0C, 0)
362#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_SEGMENTED_MODE ZORRO_ID(VILLAGE_TRONIC, 0x0D, 0) 362#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_SEGMENTED_MODE ZORRO_ID(VILLAGE_TRONIC, 0x0D, 0)
363#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_MEM1 ZORRO_ID(VILLAGE_TRONIC, 0x15, 0) 363#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM1 ZORRO_ID(VILLAGE_TRONIC, 0x15, 0)
364#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_MEM2 ZORRO_ID(VILLAGE_TRONIC, 0x16, 0) 364#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM2 ZORRO_ID(VILLAGE_TRONIC, 0x16, 0)
365#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_REG ZORRO_ID(VILLAGE_TRONIC, 0x17, 0) 365#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_REG ZORRO_ID(VILLAGE_TRONIC, 0x17, 0)
366#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3 ZORRO_ID(VILLAGE_TRONIC, 0x18, 0) 366#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3 ZORRO_ID(VILLAGE_TRONIC, 0x18, 0)
367#define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE ZORRO_ID(VILLAGE_TRONIC, 0xC9, 0) 367#define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE ZORRO_ID(VILLAGE_TRONIC, 0xC9, 0)
diff --git a/include/media/as3645a.h b/include/media/as3645a.h
new file mode 100644
index 000000000000..5075496d2c9e
--- /dev/null
+++ b/include/media/as3645a.h
@@ -0,0 +1,71 @@
1/*
2 * include/media/as3645a.h
3 *
4 * Copyright (C) 2008-2011 Nokia Corporation
5 *
6 * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 *
22 */
23
24#ifndef __AS3645A_H__
25#define __AS3645A_H__
26
27#include <media/v4l2-subdev.h>
28
29#define AS3645A_NAME "as3645a"
30#define AS3645A_I2C_ADDR (0x60 >> 1) /* W:0x60, R:0x61 */
31
32#define AS3645A_FLASH_TIMEOUT_MIN 100000 /* us */
33#define AS3645A_FLASH_TIMEOUT_MAX 850000
34#define AS3645A_FLASH_TIMEOUT_STEP 50000
35
36#define AS3645A_FLASH_INTENSITY_MIN 200 /* mA */
37#define AS3645A_FLASH_INTENSITY_MAX_1LED 500
38#define AS3645A_FLASH_INTENSITY_MAX_2LEDS 400
39#define AS3645A_FLASH_INTENSITY_STEP 20
40
41#define AS3645A_TORCH_INTENSITY_MIN 20 /* mA */
42#define AS3645A_TORCH_INTENSITY_MAX 160
43#define AS3645A_TORCH_INTENSITY_STEP 20
44
45#define AS3645A_INDICATOR_INTENSITY_MIN 0 /* uA */
46#define AS3645A_INDICATOR_INTENSITY_MAX 10000
47#define AS3645A_INDICATOR_INTENSITY_STEP 2500
48
49/*
50 * as3645a_platform_data - Flash controller platform data
51 * @set_power: Set power callback
52 * @vref: VREF offset (0=0V, 1=+0.3V, 2=-0.3V, 3=+0.6V)
53 * @peak: Inductor peak current limit (0=1.25A, 1=1.5A, 2=1.75A, 3=2.0A)
54 * @ext_strobe: True if external flash strobe can be used
55 * @flash_max_current: Max flash current (mA, <= AS3645A_FLASH_INTENSITY_MAX)
56 * @torch_max_current: Max torch current (mA, >= AS3645A_TORCH_INTENSITY_MAX)
57 * @timeout_max: Max flash timeout (us, <= AS3645A_FLASH_TIMEOUT_MAX)
58 */
59struct as3645a_platform_data {
60 int (*set_power)(struct v4l2_subdev *subdev, int on);
61 unsigned int vref;
62 unsigned int peak;
63 bool ext_strobe;
64
65 /* Flash and torch currents and timeout limits */
66 unsigned int flash_max_current;
67 unsigned int torch_max_current;
68 unsigned int timeout_max;
69};
70
71#endif /* __AS3645A_H__ */
diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h
index 26cece595121..656823075709 100644
--- a/include/media/atmel-isi.h
+++ b/include/media/atmel-isi.h
@@ -110,10 +110,12 @@ struct isi_platform_data {
110 u8 hsync_act_low; 110 u8 hsync_act_low;
111 u8 vsync_act_low; 111 u8 vsync_act_low;
112 u8 pclk_act_falling; 112 u8 pclk_act_falling;
113 u8 isi_full_mode; 113 u8 full_mode;
114 u32 data_width_flags; 114 u32 data_width_flags;
115 /* Using for ISI_CFG1 */ 115 /* Using for ISI_CFG1 */
116 u32 frate; 116 u32 frate;
117 /* Using for ISI_MCK */
118 u32 mck_hz;
117}; 119};
118 120
119#endif /* __ATMEL_ISI_H__ */ 121#endif /* __ATMEL_ISI_H__ */
diff --git a/include/media/cx25840.h b/include/media/cx25840.h
index 46d1a141208e..783c5bdd63eb 100644
--- a/include/media/cx25840.h
+++ b/include/media/cx25840.h
@@ -85,6 +85,7 @@ enum cx25840_video_input {
85 CX25840_NONE1_CH3 = 0x800000c0, 85 CX25840_NONE1_CH3 = 0x800000c0,
86 CX25840_SVIDEO_ON = 0x80000100, 86 CX25840_SVIDEO_ON = 0x80000100,
87 CX25840_COMPONENT_ON = 0x80000200, 87 CX25840_COMPONENT_ON = 0x80000200,
88 CX25840_DIF_ON = 0x80000400,
88}; 89};
89 90
90enum cx25840_audio_input { 91enum cx25840_audio_input {
diff --git a/include/media/davinci/vpbe.h b/include/media/davinci/vpbe.h
index 8b11fb037980..8bc1b3c0e679 100644
--- a/include/media/davinci/vpbe.h
+++ b/include/media/davinci/vpbe.h
@@ -63,6 +63,7 @@ struct vpbe_output {
63 * output basis. If per mode is needed, we may have to move this to 63 * output basis. If per mode is needed, we may have to move this to
64 * mode_info structure 64 * mode_info structure
65 */ 65 */
66 enum v4l2_mbus_pixelcode if_params;
66}; 67};
67 68
68/* encoder configuration info */ 69/* encoder configuration info */
@@ -74,6 +75,15 @@ struct encoder_config_info {
74 struct i2c_board_info board_info; 75 struct i2c_board_info board_info;
75}; 76};
76 77
78/*amplifier configuration info */
79struct amp_config_info {
80 char module_name[32];
81 /* Is this an i2c device ? */
82 unsigned int is_i2c:1;
83 /* i2c subdevice board info */
84 struct i2c_board_info board_info;
85};
86
77/* structure for defining vpbe display subsystem components */ 87/* structure for defining vpbe display subsystem components */
78struct vpbe_config { 88struct vpbe_config {
79 char module_name[32]; 89 char module_name[32];
@@ -84,6 +94,8 @@ struct vpbe_config {
84 /* external encoder information goes here */ 94 /* external encoder information goes here */
85 int num_ext_encoders; 95 int num_ext_encoders;
86 struct encoder_config_info *ext_encoders; 96 struct encoder_config_info *ext_encoders;
97 /* amplifier information goes here */
98 struct amp_config_info *amp;
87 int num_outputs; 99 int num_outputs;
88 /* Order is venc outputs followed by LCD and then external encoders */ 100 /* Order is venc outputs followed by LCD and then external encoders */
89 struct vpbe_output *outputs; 101 struct vpbe_output *outputs;
@@ -158,6 +170,8 @@ struct vpbe_device {
158 struct v4l2_subdev **encoders; 170 struct v4l2_subdev **encoders;
159 /* current encoder index */ 171 /* current encoder index */
160 int current_sd_index; 172 int current_sd_index;
173 /* external amplifier v4l2 subdevice */
174 struct v4l2_subdev *amp;
161 struct mutex lock; 175 struct mutex lock;
162 /* device initialized */ 176 /* device initialized */
163 int initialized; 177 int initialized;
@@ -165,6 +179,8 @@ struct vpbe_device {
165 struct clk *dac_clk; 179 struct clk *dac_clk;
166 /* osd_device pointer */ 180 /* osd_device pointer */
167 struct osd_state *osd_device; 181 struct osd_state *osd_device;
182 /* venc device pointer */
183 struct venc_platform_data *venc_device;
168 /* 184 /*
169 * fields below are accessed by users of vpbe_device. Not the 185 * fields below are accessed by users of vpbe_device. Not the
170 * ones above 186 * ones above
diff --git a/include/media/davinci/vpbe_venc.h b/include/media/davinci/vpbe_venc.h
index 426c205831a2..6b57334f4029 100644
--- a/include/media/davinci/vpbe_venc.h
+++ b/include/media/davinci/vpbe_venc.h
@@ -29,10 +29,14 @@
29 29
30struct venc_platform_data { 30struct venc_platform_data {
31 enum vpbe_version venc_type; 31 enum vpbe_version venc_type;
32 int (*setup_pinmux)(enum v4l2_mbus_pixelcode if_type,
33 int field);
32 int (*setup_clock)(enum vpbe_enc_timings_type type, 34 int (*setup_clock)(enum vpbe_enc_timings_type type,
33 unsigned int mode); 35 unsigned int mode);
36 int (*setup_if_config)(enum v4l2_mbus_pixelcode pixcode);
34 /* Number of LCD outputs supported */ 37 /* Number of LCD outputs supported */
35 int num_lcd_outputs; 38 int num_lcd_outputs;
39 struct vpbe_if_params *lcd_if_params;
36}; 40};
37 41
38enum venc_ioctls { 42enum venc_ioctls {
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index cd8bca63a502..29e7bba78ffe 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -98,7 +98,7 @@ struct media_entity {
98 98
99 /* Sub-device specifications */ 99 /* Sub-device specifications */
100 /* Nothing needed yet */ 100 /* Nothing needed yet */
101 }; 101 } info;
102}; 102};
103 103
104static inline u32 media_entity_type(struct media_entity *entity) 104static inline u32 media_entity_type(struct media_entity *entity)
diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h
index e917b1da6577..042849a34640 100644
--- a/include/media/omap3isp.h
+++ b/include/media/omap3isp.h
@@ -58,7 +58,7 @@ enum {
58 * ISP_LANE_SHIFT_4 - CAMEXT[13:4] -> CAM[9:0] 58 * ISP_LANE_SHIFT_4 - CAMEXT[13:4] -> CAM[9:0]
59 * ISP_LANE_SHIFT_6 - CAMEXT[13:6] -> CAM[7:0] 59 * ISP_LANE_SHIFT_6 - CAMEXT[13:6] -> CAM[7:0]
60 * @clk_pol: Pixel clock polarity 60 * @clk_pol: Pixel clock polarity
61 * 0 - Non Inverted, 1 - Inverted 61 * 0 - Sample on rising edge, 1 - Sample on falling edge
62 * @hs_pol: Horizontal synchronization polarity 62 * @hs_pol: Horizontal synchronization polarity
63 * 0 - Active high, 1 - Active low 63 * 0 - Active high, 1 - Active low
64 * @vs_pol: Vertical synchronization polarity 64 * @vs_pol: Vertical synchronization polarity
diff --git a/include/media/pwc-ioctl.h b/include/media/pwc-ioctl.h
deleted file mode 100644
index 1ed1e616fe33..000000000000
--- a/include/media/pwc-ioctl.h
+++ /dev/null
@@ -1,323 +0,0 @@
1#ifndef PWC_IOCTL_H
2#define PWC_IOCTL_H
3
4/* (C) 2001-2004 Nemosoft Unv.
5 (C) 2004-2006 Luc Saillard (luc@saillard.org)
6
7 NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx
8 driver and thus may have bugs that are not present in the original version.
9 Please send bug reports and support requests to <luc@saillard.org>.
10 The decompression routines have been implemented by reverse-engineering the
11 Nemosoft binary pwcx module. Caveat emptor.
12
13 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26*/
27
28/* This is pwc-ioctl.h belonging to PWC 10.0.10
29 It contains structures and defines to communicate from user space
30 directly to the driver.
31 */
32
33/*
34 Changes
35 2001/08/03 Alvarado Added ioctl constants to access methods for
36 changing white balance and red/blue gains
37 2002/12/15 G. H. Fernandez-Toribio VIDIOCGREALSIZE
38 2003/12/13 Nemosft Unv. Some modifications to make interfacing to
39 PWCX easier
40 2006/01/01 Luc Saillard Add raw format definition
41 */
42
43/* These are private ioctl() commands, specific for the Philips webcams.
44 They contain functions not found in other webcams, and settings not
45 specified in the Video4Linux API.
46
47 The #define names are built up like follows:
48 VIDIOC VIDeo IOCtl prefix
49 PWC Philps WebCam
50 G optional: Get
51 S optional: Set
52 ... the function
53 */
54
55#include <linux/types.h>
56
57/* Enumeration of image sizes */
58#define PSZ_SQCIF 0x00
59#define PSZ_QSIF 0x01
60#define PSZ_QCIF 0x02
61#define PSZ_SIF 0x03
62#define PSZ_CIF 0x04
63#define PSZ_VGA 0x05
64#define PSZ_MAX 6
65
66
67/* The frame rate is encoded in the video_window.flags parameter using
68 the upper 16 bits, since some flags are defined nowadays. The following
69 defines provide a mask and shift to filter out this value.
70 This value can also be passing using the private flag when using v4l2 and
71 VIDIOC_S_FMT ioctl.
72
73 In 'Snapshot' mode the camera freezes its automatic exposure and colour
74 balance controls.
75 */
76#define PWC_FPS_SHIFT 16
77#define PWC_FPS_MASK 0x00FF0000
78#define PWC_FPS_FRMASK 0x003F0000
79#define PWC_FPS_SNAPSHOT 0x00400000
80#define PWC_QLT_MASK 0x03000000
81#define PWC_QLT_SHIFT 24
82
83
84/* structure for transferring x & y coordinates */
85struct pwc_coord
86{
87 int x, y; /* guess what */
88 int size; /* size, or offset */
89};
90
91
92/* Used with VIDIOCPWCPROBE */
93struct pwc_probe
94{
95 char name[32];
96 int type;
97};
98
99struct pwc_serial
100{
101 char serial[30]; /* String with serial number. Contains terminating 0 */
102};
103
104/* pwc_whitebalance.mode values */
105#define PWC_WB_INDOOR 0
106#define PWC_WB_OUTDOOR 1
107#define PWC_WB_FL 2
108#define PWC_WB_MANUAL 3
109#define PWC_WB_AUTO 4
110
111/* Used with VIDIOCPWC[SG]AWB (Auto White Balance).
112 Set mode to one of the PWC_WB_* values above.
113 *red and *blue are the respective gains of these colour components inside
114 the camera; range 0..65535
115 When 'mode' == PWC_WB_MANUAL, 'manual_red' and 'manual_blue' are set or read;
116 otherwise undefined.
117 'read_red' and 'read_blue' are read-only.
118*/
119struct pwc_whitebalance
120{
121 int mode;
122 int manual_red, manual_blue; /* R/W */
123 int read_red, read_blue; /* R/O */
124};
125
126/*
127 'control_speed' and 'control_delay' are used in automatic whitebalance mode,
128 and tell the camera how fast it should react to changes in lighting, and
129 with how much delay. Valid values are 0..65535.
130*/
131struct pwc_wb_speed
132{
133 int control_speed;
134 int control_delay;
135
136};
137
138/* Used with VIDIOCPWC[SG]LED */
139struct pwc_leds
140{
141 int led_on; /* Led on-time; range = 0..25000 */
142 int led_off; /* Led off-time; range = 0..25000 */
143};
144
145/* Image size (used with GREALSIZE) */
146struct pwc_imagesize
147{
148 int width;
149 int height;
150};
151
152/* Defines and structures for Motorized Pan & Tilt */
153#define PWC_MPT_PAN 0x01
154#define PWC_MPT_TILT 0x02
155#define PWC_MPT_TIMEOUT 0x04 /* for status */
156
157/* Set angles; when absolute != 0, the angle is absolute and the
158 driver calculates the relative offset for you. This can only
159 be used with VIDIOCPWCSANGLE; VIDIOCPWCGANGLE always returns
160 absolute angles.
161 */
162struct pwc_mpt_angles
163{
164 int absolute; /* write-only */
165 int pan; /* degrees * 100 */
166 int tilt; /* degress * 100 */
167};
168
169/* Range of angles of the camera, both horizontally and vertically.
170 */
171struct pwc_mpt_range
172{
173 int pan_min, pan_max; /* degrees * 100 */
174 int tilt_min, tilt_max;
175};
176
177struct pwc_mpt_status
178{
179 int status;
180 int time_pan;
181 int time_tilt;
182};
183
184
185/* This is used for out-of-kernel decompression. With it, you can get
186 all the necessary information to initialize and use the decompressor
187 routines in standalone applications.
188 */
189struct pwc_video_command
190{
191 int type; /* camera type (645, 675, 730, etc.) */
192 int release; /* release number */
193
194 int size; /* one of PSZ_* */
195 int alternate;
196 int command_len; /* length of USB video command */
197 unsigned char command_buf[13]; /* Actual USB video command */
198 int bandlength; /* >0 = compressed */
199 int frame_size; /* Size of one (un)compressed frame */
200};
201
202/* Flags for PWCX subroutines. Not all modules honour all flags. */
203#define PWCX_FLAG_PLANAR 0x0001
204#define PWCX_FLAG_BAYER 0x0008
205
206
207/* IOCTL definitions */
208
209 /* Restore user settings */
210#define VIDIOCPWCRUSER _IO('v', 192)
211 /* Save user settings */
212#define VIDIOCPWCSUSER _IO('v', 193)
213 /* Restore factory settings */
214#define VIDIOCPWCFACTORY _IO('v', 194)
215
216 /* You can manipulate the compression factor. A compression preference of 0
217 means use uncompressed modes when available; 1 is low compression, 2 is
218 medium and 3 is high compression preferred. Of course, the higher the
219 compression, the lower the bandwidth used but more chance of artefacts
220 in the image. The driver automatically chooses a higher compression when
221 the preferred mode is not available.
222 */
223 /* Set preferred compression quality (0 = uncompressed, 3 = highest compression) */
224#define VIDIOCPWCSCQUAL _IOW('v', 195, int)
225 /* Get preferred compression quality */
226#define VIDIOCPWCGCQUAL _IOR('v', 195, int)
227
228
229/* Retrieve serial number of camera */
230#define VIDIOCPWCGSERIAL _IOR('v', 198, struct pwc_serial)
231
232 /* This is a probe function; since so many devices are supported, it
233 becomes difficult to include all the names in programs that want to
234 check for the enhanced Philips stuff. So in stead, try this PROBE;
235 it returns a structure with the original name, and the corresponding
236 Philips type.
237 To use, fill the structure with zeroes, call PROBE and if that succeeds,
238 compare the name with that returned from VIDIOCGCAP; they should be the
239 same. If so, you can be assured it is a Philips (OEM) cam and the type
240 is valid.
241 */
242#define VIDIOCPWCPROBE _IOR('v', 199, struct pwc_probe)
243
244 /* Set AGC (Automatic Gain Control); int < 0 = auto, 0..65535 = fixed */
245#define VIDIOCPWCSAGC _IOW('v', 200, int)
246 /* Get AGC; int < 0 = auto; >= 0 = fixed, range 0..65535 */
247#define VIDIOCPWCGAGC _IOR('v', 200, int)
248 /* Set shutter speed; int < 0 = auto; >= 0 = fixed, range 0..65535 */
249#define VIDIOCPWCSSHUTTER _IOW('v', 201, int)
250
251 /* Color compensation (Auto White Balance) */
252#define VIDIOCPWCSAWB _IOW('v', 202, struct pwc_whitebalance)
253#define VIDIOCPWCGAWB _IOR('v', 202, struct pwc_whitebalance)
254
255 /* Auto WB speed */
256#define VIDIOCPWCSAWBSPEED _IOW('v', 203, struct pwc_wb_speed)
257#define VIDIOCPWCGAWBSPEED _IOR('v', 203, struct pwc_wb_speed)
258
259 /* LEDs on/off/blink; int range 0..65535 */
260#define VIDIOCPWCSLED _IOW('v', 205, struct pwc_leds)
261#define VIDIOCPWCGLED _IOR('v', 205, struct pwc_leds)
262
263 /* Contour (sharpness); int < 0 = auto, 0..65536 = fixed */
264#define VIDIOCPWCSCONTOUR _IOW('v', 206, int)
265#define VIDIOCPWCGCONTOUR _IOR('v', 206, int)
266
267 /* Backlight compensation; 0 = off, otherwise on */
268#define VIDIOCPWCSBACKLIGHT _IOW('v', 207, int)
269#define VIDIOCPWCGBACKLIGHT _IOR('v', 207, int)
270
271 /* Flickerless mode; = 0 off, otherwise on */
272#define VIDIOCPWCSFLICKER _IOW('v', 208, int)
273#define VIDIOCPWCGFLICKER _IOR('v', 208, int)
274
275 /* Dynamic noise reduction; 0 off, 3 = high noise reduction */
276#define VIDIOCPWCSDYNNOISE _IOW('v', 209, int)
277#define VIDIOCPWCGDYNNOISE _IOR('v', 209, int)
278
279 /* Real image size as used by the camera; tells you whether or not there's a gray border around the image */
280#define VIDIOCPWCGREALSIZE _IOR('v', 210, struct pwc_imagesize)
281
282 /* Motorized pan & tilt functions */
283#define VIDIOCPWCMPTRESET _IOW('v', 211, int)
284#define VIDIOCPWCMPTGRANGE _IOR('v', 211, struct pwc_mpt_range)
285#define VIDIOCPWCMPTSANGLE _IOW('v', 212, struct pwc_mpt_angles)
286#define VIDIOCPWCMPTGANGLE _IOR('v', 212, struct pwc_mpt_angles)
287#define VIDIOCPWCMPTSTATUS _IOR('v', 213, struct pwc_mpt_status)
288
289 /* Get the USB set-video command; needed for initializing libpwcx */
290#define VIDIOCPWCGVIDCMD _IOR('v', 215, struct pwc_video_command)
291struct pwc_table_init_buffer {
292 int len;
293 char *buffer;
294
295};
296#define VIDIOCPWCGVIDTABLE _IOR('v', 216, struct pwc_table_init_buffer)
297
298/*
299 * This is private command used when communicating with v4l2.
300 * In the future all private ioctl will be remove/replace to
301 * use interface offer by v4l2.
302 */
303
304#define V4L2_CID_PRIVATE_SAVE_USER (V4L2_CID_PRIVATE_BASE + 0)
305#define V4L2_CID_PRIVATE_RESTORE_USER (V4L2_CID_PRIVATE_BASE + 1)
306#define V4L2_CID_PRIVATE_RESTORE_FACTORY (V4L2_CID_PRIVATE_BASE + 2)
307#define V4L2_CID_PRIVATE_COLOUR_MODE (V4L2_CID_PRIVATE_BASE + 3)
308#define V4L2_CID_PRIVATE_AUTOCONTOUR (V4L2_CID_PRIVATE_BASE + 4)
309#define V4L2_CID_PRIVATE_CONTOUR (V4L2_CID_PRIVATE_BASE + 5)
310#define V4L2_CID_PRIVATE_BACKLIGHT (V4L2_CID_PRIVATE_BASE + 6)
311#define V4L2_CID_PRIVATE_FLICKERLESS (V4L2_CID_PRIVATE_BASE + 7)
312#define V4L2_CID_PRIVATE_NOISE_REDUCTION (V4L2_CID_PRIVATE_BASE + 8)
313
314struct pwc_raw_frame {
315 __le16 type; /* type of the webcam */
316 __le16 vbandlength; /* Size of 4lines compressed (used by the decompressor) */
317 __u8 cmd[4]; /* the four byte of the command (in case of nala,
318 only the first 3 bytes is filled) */
319 __u8 rawframe[0]; /* frame_size = H/4*vbandlength */
320} __attribute__ ((packed));
321
322
323#endif
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 26a3bd0fe57c..f688bde61228 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -18,13 +18,15 @@
18#define RC_TYPE_JVC (1 << 3) /* JVC protocol */ 18#define RC_TYPE_JVC (1 << 3) /* JVC protocol */
19#define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ 19#define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */
20#define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ 20#define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */
21#define RC_TYPE_SANYO (1 << 6) /* Sanyo protocol */
21#define RC_TYPE_MCE_KBD (1 << 29) /* RC6-ish MCE keyboard/mouse */ 22#define RC_TYPE_MCE_KBD (1 << 29) /* RC6-ish MCE keyboard/mouse */
22#define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ 23#define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */
23#define RC_TYPE_OTHER (1u << 31) 24#define RC_TYPE_OTHER (1u << 31)
24 25
25#define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \ 26#define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \
26 RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \ 27 RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \
27 RC_TYPE_RC5_SZ | RC_TYPE_MCE_KBD | RC_TYPE_OTHER) 28 RC_TYPE_RC5_SZ | RC_TYPE_SANYO | RC_TYPE_MCE_KBD | \
29 RC_TYPE_OTHER)
28 30
29struct rc_map_table { 31struct rc_map_table {
30 u32 scancode; 32 u32 scancode;
@@ -145,7 +147,7 @@ void rc_map_init(void);
145#define RC_MAP_TREKSTOR "rc-trekstor" 147#define RC_MAP_TREKSTOR "rc-trekstor"
146#define RC_MAP_TT_1500 "rc-tt-1500" 148#define RC_MAP_TT_1500 "rc-tt-1500"
147#define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027" 149#define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027"
148#define RC_MAP_VIDEOMATE_M1F "rc-videomate-m1f" 150#define RC_MAP_VIDEOMATE_K100 "rc-videomate-k100"
149#define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" 151#define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350"
150#define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" 152#define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr"
151#define RC_MAP_WINFAST "rc-winfast" 153#define RC_MAP_WINFAST "rc-winfast"
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 5fb2c3d10c05..b5c2b6cb0d81 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -94,7 +94,7 @@ struct soc_camera_host_ops {
94 struct soc_camera_device *); 94 struct soc_camera_device *);
95 int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *); 95 int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *);
96 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *); 96 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *);
97 int (*set_bus_param)(struct soc_camera_device *, __u32); 97 int (*set_bus_param)(struct soc_camera_device *);
98 int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); 98 int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
99 int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); 99 int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
100 int (*enum_fsizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *); 100 int (*enum_fsizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *);
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 89c290b69a5c..29e1920e7339 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -127,7 +127,6 @@
127#define TUNER_PHILIPS_FMD1216MEX_MK3 78 127#define TUNER_PHILIPS_FMD1216MEX_MK3 78
128#define TUNER_PHILIPS_FM1216MK5 79 128#define TUNER_PHILIPS_FM1216MK5 79
129#define TUNER_PHILIPS_FQ1216LME_MK3 80 /* Active loopthrough, no FM */ 129#define TUNER_PHILIPS_FQ1216LME_MK3 80 /* Active loopthrough, no FM */
130#define TUNER_XC4000 81 /* Xceive Silicon Tuner */
131 130
132#define TUNER_PARTSNIC_PTI_5NF05 81 131#define TUNER_PARTSNIC_PTI_5NF05 81
133#define TUNER_PHILIPS_CU1216L 82 132#define TUNER_PHILIPS_CU1216L 82
@@ -136,6 +135,8 @@
136#define TUNER_PHILIPS_FQ1236_MK5 85 /* NTSC, TDA9885, no FM radio */ 135#define TUNER_PHILIPS_FQ1236_MK5 85 /* NTSC, TDA9885, no FM radio */
137#define TUNER_TENA_TNF_5337 86 136#define TUNER_TENA_TNF_5337 86
138 137
138#define TUNER_XC4000 87 /* Xceive Silicon Tuner */
139
139/* tv card specific */ 140/* tv card specific */
140#define TDA9887_PRESENT (1<<0) 141#define TDA9887_PRESENT (1<<0)
141#define TDA9887_PORT1_INACTIVE (1<<1) 142#define TDA9887_PORT1_INACTIVE (1<<1)
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 4d1c74ad4c84..3f5d60fc5df6 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -196,6 +196,10 @@ struct v4l2_ioctl_ops {
196 struct v4l2_crop *a); 196 struct v4l2_crop *a);
197 int (*vidioc_s_crop) (struct file *file, void *fh, 197 int (*vidioc_s_crop) (struct file *file, void *fh,
198 struct v4l2_crop *a); 198 struct v4l2_crop *a);
199 int (*vidioc_g_selection) (struct file *file, void *fh,
200 struct v4l2_selection *s);
201 int (*vidioc_s_selection) (struct file *file, void *fh,
202 struct v4l2_selection *s);
199 /* Compression ioctls */ 203 /* Compression ioctls */
200 int (*vidioc_g_jpegcomp) (struct file *file, void *fh, 204 int (*vidioc_g_jpegcomp) (struct file *file, void *fh,
201 struct v4l2_jpegcompression *a); 205 struct v4l2_jpegcompression *a);
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index abaad6ed9b83..4a82ca0bb0b2 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -256,4 +256,6 @@ void l2cap_exit(void);
256int sco_init(void); 256int sco_init(void);
257void sco_exit(void); 257void sco_exit(void);
258 258
259void bt_sock_reclassify_lock(struct sock *sk, int proto);
260
259#endif /* __BLUETOOTH_H */ 261#endif /* __BLUETOOTH_H */
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 5b2fed5eebf2..00596e816b4d 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -1388,6 +1388,6 @@ struct hci_inquiry_req {
1388}; 1388};
1389#define IREQ_CACHE_FLUSH 0x0001 1389#define IREQ_CACHE_FLUSH 0x0001
1390 1390
1391extern int enable_hs; 1391extern bool enable_hs;
1392 1392
1393#endif /* __HCI_H */ 1393#endif /* __HCI_H */
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index ea9231f4935f..453893b3120e 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -540,7 +540,7 @@ void hci_conn_put_device(struct hci_conn *conn);
540static inline void hci_conn_hold(struct hci_conn *conn) 540static inline void hci_conn_hold(struct hci_conn *conn)
541{ 541{
542 atomic_inc(&conn->refcnt); 542 atomic_inc(&conn->refcnt);
543 cancel_delayed_work_sync(&conn->disc_work); 543 cancel_delayed_work(&conn->disc_work);
544} 544}
545 545
546static inline void hci_conn_put(struct hci_conn *conn) 546static inline void hci_conn_put(struct hci_conn *conn)
@@ -559,9 +559,9 @@ static inline void hci_conn_put(struct hci_conn *conn)
559 } else { 559 } else {
560 timeo = msecs_to_jiffies(10); 560 timeo = msecs_to_jiffies(10);
561 } 561 }
562 cancel_delayed_work_sync(&conn->disc_work); 562 cancel_delayed_work(&conn->disc_work);
563 queue_delayed_work(conn->hdev->workqueue, 563 queue_delayed_work(conn->hdev->workqueue,
564 &conn->disc_work, jiffies + timeo); 564 &conn->disc_work, timeo);
565 } 565 }
566} 566}
567 567
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 68f589150692..b1664ed884e6 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -611,7 +611,7 @@ static inline void l2cap_set_timer(struct l2cap_chan *chan,
611{ 611{
612 BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout); 612 BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout);
613 613
614 if (!__cancel_delayed_work(work)) 614 if (!cancel_delayed_work(work))
615 l2cap_chan_hold(chan); 615 l2cap_chan_hold(chan);
616 schedule_delayed_work(work, timeout); 616 schedule_delayed_work(work, timeout);
617} 617}
@@ -619,20 +619,20 @@ static inline void l2cap_set_timer(struct l2cap_chan *chan,
619static inline void l2cap_clear_timer(struct l2cap_chan *chan, 619static inline void l2cap_clear_timer(struct l2cap_chan *chan,
620 struct delayed_work *work) 620 struct delayed_work *work)
621{ 621{
622 if (__cancel_delayed_work(work)) 622 if (cancel_delayed_work(work))
623 l2cap_chan_put(chan); 623 l2cap_chan_put(chan);
624} 624}
625 625
626#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t)) 626#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t))
627#define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer) 627#define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer)
628#define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \ 628#define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \
629 L2CAP_DEFAULT_RETRANS_TO); 629 msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO));
630#define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer) 630#define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer)
631#define __set_monitor_timer(c) l2cap_set_timer(c, &c->monitor_timer, \ 631#define __set_monitor_timer(c) l2cap_set_timer(c, &c->monitor_timer, \
632 L2CAP_DEFAULT_MONITOR_TO); 632 msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO));
633#define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer) 633#define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer)
634#define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \ 634#define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \
635 L2CAP_DEFAULT_ACK_TO); 635 msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO));
636#define __clear_ack_timer(c) l2cap_clear_timer(c, &c->ack_timer) 636#define __clear_ack_timer(c) l2cap_clear_timer(c, &c->ack_timer)
637 637
638static inline int __seq_offset(struct l2cap_chan *chan, __u16 seq1, __u16 seq2) 638static inline int __seq_offset(struct l2cap_chan *chan, __u16 seq1, __u16 seq2)
@@ -834,7 +834,7 @@ int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid);
834struct l2cap_chan *l2cap_chan_create(struct sock *sk); 834struct l2cap_chan *l2cap_chan_create(struct sock *sk);
835void l2cap_chan_close(struct l2cap_chan *chan, int reason); 835void l2cap_chan_close(struct l2cap_chan *chan, int reason);
836void l2cap_chan_destroy(struct l2cap_chan *chan); 836void l2cap_chan_destroy(struct l2cap_chan *chan);
837inline int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, 837int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
838 bdaddr_t *dst); 838 bdaddr_t *dst);
839int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, 839int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len,
840 u32 priority); 840 u32 priority);
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h
index 3419bf5cd154..d55f43443335 100644
--- a/include/net/netns/generic.h
+++ b/include/net/netns/generic.h
@@ -41,6 +41,7 @@ static inline void *net_generic(const struct net *net, int id)
41 ptr = ng->ptr[id - 1]; 41 ptr = ng->ptr[id - 1];
42 rcu_read_unlock(); 42 rcu_read_unlock();
43 43
44 BUG_ON(!ptr);
44 return ptr; 45 return ptr;
45} 46}
46#endif 47#endif
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index e503b87c4c1b..7b2d43139c8e 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -13,7 +13,6 @@
13 13
14#ifndef _NETPRIO_CGROUP_H 14#ifndef _NETPRIO_CGROUP_H
15#define _NETPRIO_CGROUP_H 15#define _NETPRIO_CGROUP_H
16#include <linux/module.h>
17#include <linux/cgroup.h> 16#include <linux/cgroup.h>
18#include <linux/hardirq.h> 17#include <linux/hardirq.h>
19#include <linux/rcupdate.h> 18#include <linux/rcupdate.h>
diff --git a/include/net/sock.h b/include/net/sock.h
index bb972d254dff..91c1c8baf020 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -55,6 +55,7 @@
55#include <linux/uaccess.h> 55#include <linux/uaccess.h>
56#include <linux/memcontrol.h> 56#include <linux/memcontrol.h>
57#include <linux/res_counter.h> 57#include <linux/res_counter.h>
58#include <linux/jump_label.h>
58 59
59#include <linux/filter.h> 60#include <linux/filter.h>
60#include <linux/rculist_nulls.h> 61#include <linux/rculist_nulls.h>
@@ -226,6 +227,7 @@ struct cg_proto;
226 * @sk_ack_backlog: current listen backlog 227 * @sk_ack_backlog: current listen backlog
227 * @sk_max_ack_backlog: listen backlog set in listen() 228 * @sk_max_ack_backlog: listen backlog set in listen()
228 * @sk_priority: %SO_PRIORITY setting 229 * @sk_priority: %SO_PRIORITY setting
230 * @sk_cgrp_prioidx: socket group's priority map index
229 * @sk_type: socket type (%SOCK_STREAM, etc) 231 * @sk_type: socket type (%SOCK_STREAM, etc)
230 * @sk_protocol: which protocol this socket belongs in this network family 232 * @sk_protocol: which protocol this socket belongs in this network family
231 * @sk_peer_pid: &struct pid for this socket's peer 233 * @sk_peer_pid: &struct pid for this socket's peer
@@ -921,7 +923,7 @@ inline void sk_refcnt_debug_release(const struct sock *sk)
921#define sk_refcnt_debug_release(sk) do { } while (0) 923#define sk_refcnt_debug_release(sk) do { } while (0)
922#endif /* SOCK_REFCNT_DEBUG */ 924#endif /* SOCK_REFCNT_DEBUG */
923 925
924#ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM 926#if defined(CONFIG_CGROUP_MEM_RES_CTLR_KMEM) && defined(CONFIG_NET)
925extern struct jump_label_key memcg_socket_limit_enabled; 927extern struct jump_label_key memcg_socket_limit_enabled;
926static inline struct cg_proto *parent_cg_proto(struct proto *proto, 928static inline struct cg_proto *parent_cg_proto(struct proto *proto,
927 struct cg_proto *cg_proto) 929 struct cg_proto *cg_proto)
@@ -1007,9 +1009,8 @@ static inline void memcg_memory_allocated_add(struct cg_proto *prot,
1007 struct res_counter *fail; 1009 struct res_counter *fail;
1008 int ret; 1010 int ret;
1009 1011
1010 ret = res_counter_charge(prot->memory_allocated, 1012 ret = res_counter_charge_nofail(prot->memory_allocated,
1011 amt << PAGE_SHIFT, &fail); 1013 amt << PAGE_SHIFT, &fail);
1012
1013 if (ret < 0) 1014 if (ret < 0)
1014 *parent_status = OVER_LIMIT; 1015 *parent_status = OVER_LIMIT;
1015} 1016}
@@ -1053,12 +1054,11 @@ sk_memory_allocated_add(struct sock *sk, int amt, int *parent_status)
1053} 1054}
1054 1055
1055static inline void 1056static inline void
1056sk_memory_allocated_sub(struct sock *sk, int amt, int parent_status) 1057sk_memory_allocated_sub(struct sock *sk, int amt)
1057{ 1058{
1058 struct proto *prot = sk->sk_prot; 1059 struct proto *prot = sk->sk_prot;
1059 1060
1060 if (mem_cgroup_sockets_enabled && sk->sk_cgrp && 1061 if (mem_cgroup_sockets_enabled && sk->sk_cgrp)
1061 parent_status != OVER_LIMIT) /* Otherwise was uncharged already */
1062 memcg_memory_allocated_sub(sk->sk_cgrp, amt); 1062 memcg_memory_allocated_sub(sk->sk_cgrp, amt);
1063 1063
1064 atomic_long_sub(amt, prot->memory_allocated); 1064 atomic_long_sub(amt, prot->memory_allocated);
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 0118ea999f67..d49db0113a06 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -311,6 +311,8 @@ extern struct proto tcp_prot;
311#define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) 311#define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val)
312#define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val) 312#define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val)
313 313
314extern void tcp_init_mem(struct net *net);
315
314extern void tcp_v4_err(struct sk_buff *skb, u32); 316extern void tcp_v4_err(struct sk_buff *skb, u32);
315 317
316extern void tcp_shutdown (struct sock *sk, int how); 318extern void tcp_shutdown (struct sock *sk, int how);
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 5d1a758e0595..6a3922fe0be0 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -857,7 +857,7 @@ struct fc_lport {
857 enum fc_lport_state state; 857 enum fc_lport_state state;
858 unsigned long boot_time; 858 unsigned long boot_time;
859 struct fc_host_statistics host_stats; 859 struct fc_host_statistics host_stats;
860 struct fcoe_dev_stats *dev_stats; 860 struct fcoe_dev_stats __percpu *dev_stats;
861 u8 retry_count; 861 u8 retry_count;
862 862
863 /* Fabric information */ 863 /* Fabric information */
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
new file mode 100644
index 000000000000..4866499bdeeb
--- /dev/null
+++ b/include/target/target_core_backend.h
@@ -0,0 +1,65 @@
1#ifndef TARGET_CORE_BACKEND_H
2#define TARGET_CORE_BACKEND_H
3
4#define TRANSPORT_PLUGIN_PHBA_PDEV 1
5#define TRANSPORT_PLUGIN_VHBA_PDEV 2
6#define TRANSPORT_PLUGIN_VHBA_VDEV 3
7
8struct se_subsystem_api {
9 struct list_head sub_api_list;
10
11 char name[16];
12 struct module *owner;
13
14 u8 transport_type;
15
16 unsigned int fua_write_emulated : 1;
17 unsigned int write_cache_emulated : 1;
18
19 int (*attach_hba)(struct se_hba *, u32);
20 void (*detach_hba)(struct se_hba *);
21 int (*pmode_enable_hba)(struct se_hba *, unsigned long);
22 void *(*allocate_virtdevice)(struct se_hba *, const char *);
23 struct se_device *(*create_virtdevice)(struct se_hba *,
24 struct se_subsystem_dev *, void *);
25 void (*free_device)(void *);
26 int (*transport_complete)(struct se_task *task);
27 struct se_task *(*alloc_task)(unsigned char *cdb);
28 int (*do_task)(struct se_task *);
29 int (*do_discard)(struct se_device *, sector_t, u32);
30 void (*do_sync_cache)(struct se_task *);
31 void (*free_task)(struct se_task *);
32 ssize_t (*check_configfs_dev_params)(struct se_hba *,
33 struct se_subsystem_dev *);
34 ssize_t (*set_configfs_dev_params)(struct se_hba *,
35 struct se_subsystem_dev *, const char *, ssize_t);
36 ssize_t (*show_configfs_dev_params)(struct se_hba *,
37 struct se_subsystem_dev *, char *);
38 u32 (*get_device_rev)(struct se_device *);
39 u32 (*get_device_type)(struct se_device *);
40 sector_t (*get_blocks)(struct se_device *);
41 unsigned char *(*get_sense_buffer)(struct se_task *);
42};
43
44int transport_subsystem_register(struct se_subsystem_api *);
45void transport_subsystem_release(struct se_subsystem_api *);
46
47struct se_device *transport_add_device_to_core_hba(struct se_hba *,
48 struct se_subsystem_api *, struct se_subsystem_dev *, u32,
49 void *, struct se_dev_limits *, const char *, const char *);
50
51void transport_complete_sync_cache(struct se_cmd *, int);
52void transport_complete_task(struct se_task *, int);
53
54void target_get_task_cdb(struct se_task *, unsigned char *);
55
56void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *);
57int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *);
58int transport_set_vpd_ident_type(struct t10_vpd *, unsigned char *);
59int transport_set_vpd_ident(struct t10_vpd *, unsigned char *);
60
61/* core helpers also used by command snooping in pscsi */
62void *transport_kmap_first_data_page(struct se_cmd *);
63void transport_kunmap_first_data_page(struct se_cmd *);
64
65#endif /* TARGET_CORE_BACKEND_H */
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 6873c7dd9145..daf532bc721a 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -10,6 +10,7 @@
10#include <net/tcp.h> 10#include <net/tcp.h>
11 11
12#define TARGET_CORE_MOD_VERSION "v4.1.0-rc1-ml" 12#define TARGET_CORE_MOD_VERSION "v4.1.0-rc1-ml"
13#define TARGET_CORE_VERSION TARGET_CORE_MOD_VERSION
13 14
14/* Maximum Number of LUNs per Target Portal Group */ 15/* Maximum Number of LUNs per Target Portal Group */
15/* Don't raise above 511 or REPORT_LUNS needs to handle >1 page */ 16/* Don't raise above 511 or REPORT_LUNS needs to handle >1 page */
@@ -34,6 +35,7 @@
34#define TRANSPORT_SENSE_BUFFER SCSI_SENSE_BUFFERSIZE 35#define TRANSPORT_SENSE_BUFFER SCSI_SENSE_BUFFERSIZE
35/* Used by transport_send_check_condition_and_sense() */ 36/* Used by transport_send_check_condition_and_sense() */
36#define SPC_SENSE_KEY_OFFSET 2 37#define SPC_SENSE_KEY_OFFSET 2
38#define SPC_ADD_SENSE_LEN_OFFSET 7
37#define SPC_ASC_KEY_OFFSET 12 39#define SPC_ASC_KEY_OFFSET 12
38#define SPC_ASCQ_KEY_OFFSET 13 40#define SPC_ASCQ_KEY_OFFSET 13
39#define TRANSPORT_IQN_LEN 224 41#define TRANSPORT_IQN_LEN 224
@@ -53,6 +55,72 @@
53/* Used by transport_get_inquiry_vpd_device_ident() */ 55/* Used by transport_get_inquiry_vpd_device_ident() */
54#define INQUIRY_VPD_DEVICE_IDENTIFIER_LEN 254 56#define INQUIRY_VPD_DEVICE_IDENTIFIER_LEN 254
55 57
58/* Attempts before moving from SHORT to LONG */
59#define PYX_TRANSPORT_WINDOW_CLOSED_THRESHOLD 3
60#define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_SHORT 3 /* In milliseconds */
61#define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_LONG 10 /* In milliseconds */
62
63#define PYX_TRANSPORT_STATUS_INTERVAL 5 /* In seconds */
64
65/*
66 * struct se_subsystem_dev->su_dev_flags
67*/
68#define SDF_FIRMWARE_VPD_UNIT_SERIAL 0x00000001
69#define SDF_EMULATED_VPD_UNIT_SERIAL 0x00000002
70#define SDF_USING_UDEV_PATH 0x00000004
71#define SDF_USING_ALIAS 0x00000008
72
73/*
74 * struct se_device->dev_flags
75 */
76#define DF_READ_ONLY 0x00000001
77#define DF_SPC2_RESERVATIONS 0x00000002
78#define DF_SPC2_RESERVATIONS_WITH_ISID 0x00000004
79
80/* struct se_dev_attrib sanity values */
81/* Default max_unmap_lba_count */
82#define DA_MAX_UNMAP_LBA_COUNT 0
83/* Default max_unmap_block_desc_count */
84#define DA_MAX_UNMAP_BLOCK_DESC_COUNT 0
85/* Default unmap_granularity */
86#define DA_UNMAP_GRANULARITY_DEFAULT 0
87/* Default unmap_granularity_alignment */
88#define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT 0
89/* Emulation for Direct Page Out */
90#define DA_EMULATE_DPO 0
91/* Emulation for Forced Unit Access WRITEs */
92#define DA_EMULATE_FUA_WRITE 1
93/* Emulation for Forced Unit Access READs */
94#define DA_EMULATE_FUA_READ 0
95/* Emulation for WriteCache and SYNCHRONIZE_CACHE */
96#define DA_EMULATE_WRITE_CACHE 0
97/* Emulation for UNIT ATTENTION Interlock Control */
98#define DA_EMULATE_UA_INTLLCK_CTRL 0
99/* Emulation for TASK_ABORTED status (TAS) by default */
100#define DA_EMULATE_TAS 1
101/* Emulation for Thin Provisioning UNMAP using block/blk-lib.c:blkdev_issue_discard() */
102#define DA_EMULATE_TPU 0
103/*
104 * Emulation for Thin Provisioning WRITE_SAME w/ UNMAP=1 bit using
105 * block/blk-lib.c:blkdev_issue_discard()
106 */
107#define DA_EMULATE_TPWS 0
108/* No Emulation for PSCSI by default */
109#define DA_EMULATE_RESERVATIONS 0
110/* No Emulation for PSCSI by default */
111#define DA_EMULATE_ALUA 0
112/* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */
113#define DA_ENFORCE_PR_ISIDS 1
114#define DA_STATUS_MAX_SECTORS_MIN 16
115#define DA_STATUS_MAX_SECTORS_MAX 8192
116/* By default don't report non-rotating (solid state) medium */
117#define DA_IS_NONROT 0
118/* Queue Algorithm Modifier default for restricted reordering in control mode page */
119#define DA_EMULATE_REST_REORD 0
120
121#define SE_MODE_PAGE_BUF 512
122
123
56/* struct se_hba->hba_flags */ 124/* struct se_hba->hba_flags */
57enum hba_flags_table { 125enum hba_flags_table {
58 HBA_FLAGS_INTERNAL_USE = 0x01, 126 HBA_FLAGS_INTERNAL_USE = 0x01,
@@ -71,11 +139,12 @@ enum transport_tpg_type_table {
71 TRANSPORT_TPG_TYPE_DISCOVERY = 1, 139 TRANSPORT_TPG_TYPE_DISCOVERY = 1,
72}; 140};
73 141
74/* Used for generate timer flags */ 142/* struct se_task->task_flags */
75enum se_task_flags { 143enum se_task_flags {
76 TF_ACTIVE = (1 << 0), 144 TF_ACTIVE = (1 << 0),
77 TF_SENT = (1 << 1), 145 TF_SENT = (1 << 1),
78 TF_REQUEST_STOP = (1 << 2), 146 TF_REQUEST_STOP = (1 << 2),
147 TF_HAS_SENSE = (1 << 3),
79}; 148};
80 149
81/* Special transport agnostic struct se_cmd->t_states */ 150/* Special transport agnostic struct se_cmd->t_states */
@@ -158,9 +227,38 @@ enum tcm_sense_reason_table {
158 TCM_RESERVATION_CONFLICT = 0x10, 227 TCM_RESERVATION_CONFLICT = 0x10,
159}; 228};
160 229
230enum target_sc_flags_table {
231 TARGET_SCF_BIDI_OP = 0x01,
232 TARGET_SCF_ACK_KREF = 0x02,
233};
234
235/* fabric independent task management function values */
236enum tcm_tmreq_table {
237 TMR_ABORT_TASK = 1,
238 TMR_ABORT_TASK_SET = 2,
239 TMR_CLEAR_ACA = 3,
240 TMR_CLEAR_TASK_SET = 4,
241 TMR_LUN_RESET = 5,
242 TMR_TARGET_WARM_RESET = 6,
243 TMR_TARGET_COLD_RESET = 7,
244 TMR_FABRIC_TMR = 255,
245};
246
247/* fabric independent task management response values */
248enum tcm_tmrsp_table {
249 TMR_FUNCTION_COMPLETE = 0,
250 TMR_TASK_DOES_NOT_EXIST = 1,
251 TMR_LUN_DOES_NOT_EXIST = 2,
252 TMR_TASK_STILL_ALLEGIANT = 3,
253 TMR_TASK_FAILOVER_NOT_SUPPORTED = 4,
254 TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED = 5,
255 TMR_FUNCTION_AUTHORIZATION_FAILED = 6,
256 TMR_FUNCTION_REJECTED = 255,
257};
258
161struct se_obj { 259struct se_obj {
162 atomic_t obj_access_count; 260 atomic_t obj_access_count;
163} ____cacheline_aligned; 261};
164 262
165/* 263/*
166 * Used by TCM Core internally to signal if ALUA emulation is enabled or 264 * Used by TCM Core internally to signal if ALUA emulation is enabled or
@@ -207,7 +305,7 @@ struct t10_alua {
207 struct config_group alua_tg_pt_gps_group; 305 struct config_group alua_tg_pt_gps_group;
208 int (*alua_state_check)(struct se_cmd *, unsigned char *, u8 *); 306 int (*alua_state_check)(struct se_cmd *, unsigned char *, u8 *);
209 struct list_head tg_pt_gps_list; 307 struct list_head tg_pt_gps_list;
210} ____cacheline_aligned; 308};
211 309
212struct t10_alua_lu_gp { 310struct t10_alua_lu_gp {
213 u16 lu_gp_id; 311 u16 lu_gp_id;
@@ -218,7 +316,7 @@ struct t10_alua_lu_gp {
218 struct config_group lu_gp_group; 316 struct config_group lu_gp_group;
219 struct list_head lu_gp_node; 317 struct list_head lu_gp_node;
220 struct list_head lu_gp_mem_list; 318 struct list_head lu_gp_mem_list;
221} ____cacheline_aligned; 319};
222 320
223struct t10_alua_lu_gp_member { 321struct t10_alua_lu_gp_member {
224 bool lu_gp_assoc; 322 bool lu_gp_assoc;
@@ -227,7 +325,7 @@ struct t10_alua_lu_gp_member {
227 struct t10_alua_lu_gp *lu_gp; 325 struct t10_alua_lu_gp *lu_gp;
228 struct se_device *lu_gp_mem_dev; 326 struct se_device *lu_gp_mem_dev;
229 struct list_head lu_gp_mem_list; 327 struct list_head lu_gp_mem_list;
230} ____cacheline_aligned; 328};
231 329
232struct t10_alua_tg_pt_gp { 330struct t10_alua_tg_pt_gp {
233 u16 tg_pt_gp_id; 331 u16 tg_pt_gp_id;
@@ -250,7 +348,7 @@ struct t10_alua_tg_pt_gp {
250 struct config_group tg_pt_gp_group; 348 struct config_group tg_pt_gp_group;
251 struct list_head tg_pt_gp_list; 349 struct list_head tg_pt_gp_list;
252 struct list_head tg_pt_gp_mem_list; 350 struct list_head tg_pt_gp_mem_list;
253} ____cacheline_aligned; 351};
254 352
255struct t10_alua_tg_pt_gp_member { 353struct t10_alua_tg_pt_gp_member {
256 bool tg_pt_gp_assoc; 354 bool tg_pt_gp_assoc;
@@ -259,7 +357,7 @@ struct t10_alua_tg_pt_gp_member {
259 struct t10_alua_tg_pt_gp *tg_pt_gp; 357 struct t10_alua_tg_pt_gp *tg_pt_gp;
260 struct se_port *tg_pt; 358 struct se_port *tg_pt;
261 struct list_head tg_pt_gp_mem_list; 359 struct list_head tg_pt_gp_mem_list;
262} ____cacheline_aligned; 360};
263 361
264struct t10_vpd { 362struct t10_vpd {
265 unsigned char device_identifier[INQUIRY_VPD_DEVICE_IDENTIFIER_LEN]; 363 unsigned char device_identifier[INQUIRY_VPD_DEVICE_IDENTIFIER_LEN];
@@ -269,7 +367,7 @@ struct t10_vpd {
269 u32 association; 367 u32 association;
270 u32 device_identifier_type; 368 u32 device_identifier_type;
271 struct list_head vpd_list; 369 struct list_head vpd_list;
272} ____cacheline_aligned; 370};
273 371
274struct t10_wwn { 372struct t10_wwn {
275 char vendor[8]; 373 char vendor[8];
@@ -280,7 +378,7 @@ struct t10_wwn {
280 struct se_subsystem_dev *t10_sub_dev; 378 struct se_subsystem_dev *t10_sub_dev;
281 struct config_group t10_wwn_group; 379 struct config_group t10_wwn_group;
282 struct list_head t10_vpd_list; 380 struct list_head t10_vpd_list;
283} ____cacheline_aligned; 381};
284 382
285 383
286/* 384/*
@@ -333,7 +431,7 @@ struct t10_pr_registration {
333 struct list_head pr_reg_aptpl_list; 431 struct list_head pr_reg_aptpl_list;
334 struct list_head pr_reg_atp_list; 432 struct list_head pr_reg_atp_list;
335 struct list_head pr_reg_atp_mem_list; 433 struct list_head pr_reg_atp_mem_list;
336} ____cacheline_aligned; 434};
337 435
338/* 436/*
339 * This set of function pointer ops is set based upon SPC3_PERSISTENT_RESERVATIONS, 437 * This set of function pointer ops is set based upon SPC3_PERSISTENT_RESERVATIONS,
@@ -374,20 +472,20 @@ struct t10_reservation {
374 struct list_head registration_list; 472 struct list_head registration_list;
375 struct list_head aptpl_reg_list; 473 struct list_head aptpl_reg_list;
376 struct t10_reservation_ops pr_ops; 474 struct t10_reservation_ops pr_ops;
377} ____cacheline_aligned; 475};
378 476
379struct se_queue_req { 477struct se_queue_req {
380 int state; 478 int state;
381 struct se_cmd *cmd; 479 struct se_cmd *cmd;
382 struct list_head qr_list; 480 struct list_head qr_list;
383} ____cacheline_aligned; 481};
384 482
385struct se_queue_obj { 483struct se_queue_obj {
386 atomic_t queue_cnt; 484 atomic_t queue_cnt;
387 spinlock_t cmd_queue_lock; 485 spinlock_t cmd_queue_lock;
388 struct list_head qobj_list; 486 struct list_head qobj_list;
389 wait_queue_head_t thread_wq; 487 wait_queue_head_t thread_wq;
390} ____cacheline_aligned; 488};
391 489
392struct se_task { 490struct se_task {
393 unsigned long long task_lba; 491 unsigned long long task_lba;
@@ -397,16 +495,14 @@ struct se_task {
397 struct scatterlist *task_sg; 495 struct scatterlist *task_sg;
398 u32 task_sg_nents; 496 u32 task_sg_nents;
399 u16 task_flags; 497 u16 task_flags;
400 u8 task_sense;
401 u8 task_scsi_status; 498 u8 task_scsi_status;
402 int task_error_status;
403 enum dma_data_direction task_data_direction; 499 enum dma_data_direction task_data_direction;
404 atomic_t task_state_active;
405 struct list_head t_list; 500 struct list_head t_list;
406 struct list_head t_execute_list; 501 struct list_head t_execute_list;
407 struct list_head t_state_list; 502 struct list_head t_state_list;
503 bool t_state_active;
408 struct completion task_stop_comp; 504 struct completion task_stop_comp;
409} ____cacheline_aligned; 505};
410 506
411struct se_cmd { 507struct se_cmd {
412 /* SAM response code being sent to initiator */ 508 /* SAM response code being sent to initiator */
@@ -451,6 +547,7 @@ struct se_cmd {
451 struct list_head se_queue_node; 547 struct list_head se_queue_node;
452 struct list_head se_cmd_list; 548 struct list_head se_cmd_list;
453 struct completion cmd_wait_comp; 549 struct completion cmd_wait_comp;
550 struct kref cmd_kref;
454 struct target_core_fabric_ops *se_tfo; 551 struct target_core_fabric_ops *se_tfo;
455 int (*execute_task)(struct se_task *); 552 int (*execute_task)(struct se_task *);
456 void (*transport_complete_callback)(struct se_cmd *); 553 void (*transport_complete_callback)(struct se_cmd *);
@@ -492,7 +589,7 @@ struct se_cmd {
492 struct list_head t_task_list; 589 struct list_head t_task_list;
493 u32 t_task_list_num; 590 u32 t_task_list_num;
494 591
495} ____cacheline_aligned; 592};
496 593
497struct se_tmr_req { 594struct se_tmr_req {
498 /* Task Management function to be preformed */ 595 /* Task Management function to be preformed */
@@ -510,7 +607,7 @@ struct se_tmr_req {
510 struct se_device *tmr_dev; 607 struct se_device *tmr_dev;
511 struct se_lun *tmr_lun; 608 struct se_lun *tmr_lun;
512 struct list_head tmr_list; 609 struct list_head tmr_list;
513} ____cacheline_aligned; 610};
514 611
515struct se_ua { 612struct se_ua {
516 u8 ua_asc; 613 u8 ua_asc;
@@ -518,7 +615,7 @@ struct se_ua {
518 struct se_node_acl *ua_nacl; 615 struct se_node_acl *ua_nacl;
519 struct list_head ua_dev_list; 616 struct list_head ua_dev_list;
520 struct list_head ua_nacl_list; 617 struct list_head ua_nacl_list;
521} ____cacheline_aligned; 618};
522 619
523struct se_node_acl { 620struct se_node_acl {
524 char initiatorname[TRANSPORT_IQN_LEN]; 621 char initiatorname[TRANSPORT_IQN_LEN];
@@ -545,7 +642,7 @@ struct se_node_acl {
545 struct config_group *acl_default_groups[5]; 642 struct config_group *acl_default_groups[5];
546 struct list_head acl_list; 643 struct list_head acl_list;
547 struct list_head acl_sess_list; 644 struct list_head acl_sess_list;
548} ____cacheline_aligned; 645};
549 646
550struct se_session { 647struct se_session {
551 unsigned sess_tearing_down:1; 648 unsigned sess_tearing_down:1;
@@ -558,7 +655,7 @@ struct se_session {
558 struct list_head sess_cmd_list; 655 struct list_head sess_cmd_list;
559 struct list_head sess_wait_list; 656 struct list_head sess_wait_list;
560 spinlock_t sess_cmd_lock; 657 spinlock_t sess_cmd_lock;
561} ____cacheline_aligned; 658};
562 659
563struct se_device; 660struct se_device;
564struct se_transform_info; 661struct se_transform_info;
@@ -578,7 +675,7 @@ struct se_lun_acl {
578 struct list_head lacl_list; 675 struct list_head lacl_list;
579 struct config_group se_lun_group; 676 struct config_group se_lun_group;
580 struct se_ml_stat_grps ml_stat_grps; 677 struct se_ml_stat_grps ml_stat_grps;
581} ____cacheline_aligned; 678};
582 679
583struct se_dev_entry { 680struct se_dev_entry {
584 bool def_pr_registered; 681 bool def_pr_registered;
@@ -603,7 +700,7 @@ struct se_dev_entry {
603 struct se_lun *se_lun; 700 struct se_lun *se_lun;
604 struct list_head alua_port_list; 701 struct list_head alua_port_list;
605 struct list_head ua_list; 702 struct list_head ua_list;
606} ____cacheline_aligned; 703};
607 704
608struct se_dev_limits { 705struct se_dev_limits {
609 /* Max supported HW queue depth */ 706 /* Max supported HW queue depth */
@@ -612,7 +709,7 @@ struct se_dev_limits {
612 u32 queue_depth; 709 u32 queue_depth;
613 /* From include/linux/blkdev.h for the other HW/SW limits. */ 710 /* From include/linux/blkdev.h for the other HW/SW limits. */
614 struct queue_limits limits; 711 struct queue_limits limits;
615} ____cacheline_aligned; 712};
616 713
617struct se_dev_attrib { 714struct se_dev_attrib {
618 int emulate_dpo; 715 int emulate_dpo;
@@ -641,7 +738,7 @@ struct se_dev_attrib {
641 u32 unmap_granularity_alignment; 738 u32 unmap_granularity_alignment;
642 struct se_subsystem_dev *da_sub_dev; 739 struct se_subsystem_dev *da_sub_dev;
643 struct config_group da_group; 740 struct config_group da_group;
644} ____cacheline_aligned; 741};
645 742
646struct se_dev_stat_grps { 743struct se_dev_stat_grps {
647 struct config_group stat_group; 744 struct config_group stat_group;
@@ -674,7 +771,7 @@ struct se_subsystem_dev {
674 struct config_group se_dev_pr_group; 771 struct config_group se_dev_pr_group;
675 /* For target_core_stat.c groups */ 772 /* For target_core_stat.c groups */
676 struct se_dev_stat_grps dev_stat_grps; 773 struct se_dev_stat_grps dev_stat_grps;
677} ____cacheline_aligned; 774};
678 775
679struct se_device { 776struct se_device {
680 /* RELATIVE TARGET PORT IDENTIFER Counter */ 777 /* RELATIVE TARGET PORT IDENTIFER Counter */
@@ -685,7 +782,6 @@ struct se_device {
685 u32 dev_port_count; 782 u32 dev_port_count;
686 /* See transport_device_status_table */ 783 /* See transport_device_status_table */
687 u32 dev_status; 784 u32 dev_status;
688 u32 dev_tcq_window_closed;
689 /* Physical device queue depth */ 785 /* Physical device queue depth */
690 u32 queue_depth; 786 u32 queue_depth;
691 /* Used for SPC-2 reservations enforce of ISIDs */ 787 /* Used for SPC-2 reservations enforce of ISIDs */
@@ -702,7 +798,6 @@ struct se_device {
702 spinlock_t stats_lock; 798 spinlock_t stats_lock;
703 /* Active commands on this virtual SE device */ 799 /* Active commands on this virtual SE device */
704 atomic_t simple_cmds; 800 atomic_t simple_cmds;
705 atomic_t depth_left;
706 atomic_t dev_ordered_id; 801 atomic_t dev_ordered_id;
707 atomic_t execute_tasks; 802 atomic_t execute_tasks;
708 atomic_t dev_ordered_sync; 803 atomic_t dev_ordered_sync;
@@ -740,7 +835,7 @@ struct se_device {
740 struct se_subsystem_api *transport; 835 struct se_subsystem_api *transport;
741 /* Linked list for struct se_hba struct se_device list */ 836 /* Linked list for struct se_hba struct se_device list */
742 struct list_head dev_list; 837 struct list_head dev_list;
743} ____cacheline_aligned; 838};
744 839
745struct se_hba { 840struct se_hba {
746 u16 hba_tpgt; 841 u16 hba_tpgt;
@@ -759,7 +854,7 @@ struct se_hba {
759 struct config_group hba_group; 854 struct config_group hba_group;
760 struct mutex hba_access_mutex; 855 struct mutex hba_access_mutex;
761 struct se_subsystem_api *transport; 856 struct se_subsystem_api *transport;
762} ____cacheline_aligned; 857};
763 858
764struct se_port_stat_grps { 859struct se_port_stat_grps {
765 struct config_group stat_group; 860 struct config_group stat_group;
@@ -785,13 +880,13 @@ struct se_lun {
785 struct se_port *lun_sep; 880 struct se_port *lun_sep;
786 struct config_group lun_group; 881 struct config_group lun_group;
787 struct se_port_stat_grps port_stat_grps; 882 struct se_port_stat_grps port_stat_grps;
788} ____cacheline_aligned; 883};
789 884
790struct scsi_port_stats { 885struct scsi_port_stats {
791 u64 cmd_pdus; 886 u64 cmd_pdus;
792 u64 tx_data_octets; 887 u64 tx_data_octets;
793 u64 rx_data_octets; 888 u64 rx_data_octets;
794} ____cacheline_aligned; 889};
795 890
796struct se_port { 891struct se_port {
797 /* RELATIVE TARGET PORT IDENTIFER */ 892 /* RELATIVE TARGET PORT IDENTIFER */
@@ -811,12 +906,12 @@ struct se_port {
811 struct se_portal_group *sep_tpg; 906 struct se_portal_group *sep_tpg;
812 struct list_head sep_alua_list; 907 struct list_head sep_alua_list;
813 struct list_head sep_list; 908 struct list_head sep_list;
814} ____cacheline_aligned; 909};
815 910
816struct se_tpg_np { 911struct se_tpg_np {
817 struct se_portal_group *tpg_np_parent; 912 struct se_portal_group *tpg_np_parent;
818 struct config_group tpg_np_group; 913 struct config_group tpg_np_group;
819} ____cacheline_aligned; 914};
820 915
821struct se_portal_group { 916struct se_portal_group {
822 /* Type of target portal group, see transport_tpg_type_table */ 917 /* Type of target portal group, see transport_tpg_type_table */
@@ -849,13 +944,13 @@ struct se_portal_group {
849 struct config_group tpg_acl_group; 944 struct config_group tpg_acl_group;
850 struct config_group tpg_attrib_group; 945 struct config_group tpg_attrib_group;
851 struct config_group tpg_param_group; 946 struct config_group tpg_param_group;
852} ____cacheline_aligned; 947};
853 948
854struct se_wwn { 949struct se_wwn {
855 struct target_fabric_configfs *wwn_tf; 950 struct target_fabric_configfs *wwn_tf;
856 struct config_group wwn_group; 951 struct config_group wwn_group;
857 struct config_group *wwn_default_groups[2]; 952 struct config_group *wwn_default_groups[2];
858 struct config_group fabric_stat_group; 953 struct config_group fabric_stat_group;
859} ____cacheline_aligned; 954};
860 955
861#endif /* TARGET_CORE_BASE_H */ 956#endif /* TARGET_CORE_BASE_H */
diff --git a/include/target/target_core_device.h b/include/target/target_core_device.h
deleted file mode 100644
index 2be31ff8763b..000000000000
--- a/include/target/target_core_device.h
+++ /dev/null
@@ -1,63 +0,0 @@
1#ifndef TARGET_CORE_DEVICE_H
2#define TARGET_CORE_DEVICE_H
3
4extern int transport_lookup_cmd_lun(struct se_cmd *, u32);
5extern int transport_lookup_tmr_lun(struct se_cmd *, u32);
6extern struct se_dev_entry *core_get_se_deve_from_rtpi(
7 struct se_node_acl *, u16);
8extern int core_free_device_list_for_node(struct se_node_acl *,
9 struct se_portal_group *);
10extern void core_dec_lacl_count(struct se_node_acl *, struct se_cmd *);
11extern void core_update_device_list_access(u32, u32, struct se_node_acl *);
12extern int core_update_device_list_for_node(struct se_lun *, struct se_lun_acl *, u32,
13 u32, struct se_node_acl *,
14 struct se_portal_group *, int);
15extern void core_clear_lun_from_tpg(struct se_lun *, struct se_portal_group *);
16extern int core_dev_export(struct se_device *, struct se_portal_group *,
17 struct se_lun *);
18extern void core_dev_unexport(struct se_device *, struct se_portal_group *,
19 struct se_lun *);
20extern int target_report_luns(struct se_task *);
21extern void se_release_device_for_hba(struct se_device *);
22extern void se_release_vpd_for_dev(struct se_device *);
23extern void se_clear_dev_ports(struct se_device *);
24extern int se_free_virtual_device(struct se_device *, struct se_hba *);
25extern int se_dev_check_online(struct se_device *);
26extern int se_dev_check_shutdown(struct se_device *);
27extern void se_dev_set_default_attribs(struct se_device *, struct se_dev_limits *);
28extern int se_dev_set_task_timeout(struct se_device *, u32);
29extern int se_dev_set_max_unmap_lba_count(struct se_device *, u32);
30extern int se_dev_set_max_unmap_block_desc_count(struct se_device *, u32);
31extern int se_dev_set_unmap_granularity(struct se_device *, u32);
32extern int se_dev_set_unmap_granularity_alignment(struct se_device *, u32);
33extern int se_dev_set_emulate_dpo(struct se_device *, int);
34extern int se_dev_set_emulate_fua_write(struct se_device *, int);
35extern int se_dev_set_emulate_fua_read(struct se_device *, int);
36extern int se_dev_set_emulate_write_cache(struct se_device *, int);
37extern int se_dev_set_emulate_ua_intlck_ctrl(struct se_device *, int);
38extern int se_dev_set_emulate_tas(struct se_device *, int);
39extern int se_dev_set_emulate_tpu(struct se_device *, int);
40extern int se_dev_set_emulate_tpws(struct se_device *, int);
41extern int se_dev_set_enforce_pr_isids(struct se_device *, int);
42extern int se_dev_set_is_nonrot(struct se_device *, int);
43extern int se_dev_set_emulate_rest_reord(struct se_device *dev, int);
44extern int se_dev_set_queue_depth(struct se_device *, u32);
45extern int se_dev_set_max_sectors(struct se_device *, u32);
46extern int se_dev_set_optimal_sectors(struct se_device *, u32);
47extern int se_dev_set_block_size(struct se_device *, u32);
48extern struct se_lun *core_dev_add_lun(struct se_portal_group *, struct se_hba *,
49 struct se_device *, u32);
50extern int core_dev_del_lun(struct se_portal_group *, u32);
51extern struct se_lun *core_get_lun_from_tpg(struct se_portal_group *, u32);
52extern struct se_lun_acl *core_dev_init_initiator_node_lun_acl(struct se_portal_group *,
53 u32, char *, int *);
54extern int core_dev_add_initiator_node_lun_acl(struct se_portal_group *,
55 struct se_lun_acl *, u32, u32);
56extern int core_dev_del_initiator_node_lun_acl(struct se_portal_group *,
57 struct se_lun *, struct se_lun_acl *);
58extern void core_dev_free_initiator_node_lun_acl(struct se_portal_group *,
59 struct se_lun_acl *lacl);
60extern int core_dev_setup_virtual_lun0(void);
61extern void core_dev_release_virtual_lun0(void);
62
63#endif /* TARGET_CORE_DEVICE_H */
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric.h
index 0256825f923d..523e8bc104d4 100644
--- a/include/target/target_core_fabric_ops.h
+++ b/include/target/target_core_fabric.h
@@ -1,5 +1,5 @@
1/* Defined in target_core_configfs.h */ 1#ifndef TARGET_CORE_FABRIC_H
2struct target_fabric_configfs; 2#define TARGET_CORE_FABRIC_H
3 3
4struct target_core_fabric_ops { 4struct target_core_fabric_ops {
5 struct configfs_subsystem *tf_subsys; 5 struct configfs_subsystem *tf_subsys;
@@ -52,10 +52,6 @@ struct target_core_fabric_ops {
52 * Returning 0 will signal a descriptor has not been released. 52 * Returning 0 will signal a descriptor has not been released.
53 */ 53 */
54 int (*check_stop_free)(struct se_cmd *); 54 int (*check_stop_free)(struct se_cmd *);
55 /*
56 * Optional check for active I/O shutdown
57 */
58 int (*check_release_cmd)(struct se_cmd *);
59 void (*release_cmd)(struct se_cmd *); 55 void (*release_cmd)(struct se_cmd *);
60 /* 56 /*
61 * Called with spin_lock_bh(struct se_portal_group->session_lock held. 57 * Called with spin_lock_bh(struct se_portal_group->session_lock held.
@@ -103,3 +99,89 @@ struct target_core_fabric_ops {
103 struct config_group *, const char *); 99 struct config_group *, const char *);
104 void (*fabric_drop_nodeacl)(struct se_node_acl *); 100 void (*fabric_drop_nodeacl)(struct se_node_acl *);
105}; 101};
102
103struct se_session *transport_init_session(void);
104void __transport_register_session(struct se_portal_group *,
105 struct se_node_acl *, struct se_session *, void *);
106void transport_register_session(struct se_portal_group *,
107 struct se_node_acl *, struct se_session *, void *);
108void transport_free_session(struct se_session *);
109void transport_deregister_session_configfs(struct se_session *);
110void transport_deregister_session(struct se_session *);
111
112
113void transport_init_se_cmd(struct se_cmd *, struct target_core_fabric_ops *,
114 struct se_session *, u32, int, int, unsigned char *);
115int transport_lookup_cmd_lun(struct se_cmd *, u32);
116int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *);
117int target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *,
118 unsigned char *, u32, u32, int, int, int);
119int transport_handle_cdb_direct(struct se_cmd *);
120int transport_generic_handle_cdb_map(struct se_cmd *);
121int transport_generic_handle_data(struct se_cmd *);
122int transport_generic_map_mem_to_cmd(struct se_cmd *cmd,
123 struct scatterlist *, u32, struct scatterlist *, u32);
124void transport_do_task_sg_chain(struct se_cmd *);
125int transport_generic_new_cmd(struct se_cmd *);
126
127void transport_generic_process_write(struct se_cmd *);
128
129void transport_generic_free_cmd(struct se_cmd *, int);
130
131bool transport_wait_for_tasks(struct se_cmd *);
132int transport_check_aborted_status(struct se_cmd *, int);
133int transport_send_check_condition_and_sense(struct se_cmd *, u8, int);
134
135void target_get_sess_cmd(struct se_session *, struct se_cmd *, bool);
136int target_put_sess_cmd(struct se_session *, struct se_cmd *);
137void target_splice_sess_cmd_list(struct se_session *);
138void target_wait_for_sess_cmds(struct se_session *, int);
139
140int core_alua_check_nonop_delay(struct se_cmd *);
141
142struct se_tmr_req *core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
143void core_tmr_release_req(struct se_tmr_req *);
144int transport_generic_handle_tmr(struct se_cmd *);
145int transport_lookup_tmr_lun(struct se_cmd *, u32);
146
147struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *,
148 unsigned char *);
149void core_tpg_clear_object_luns(struct se_portal_group *);
150struct se_node_acl *core_tpg_add_initiator_node_acl(struct se_portal_group *,
151 struct se_node_acl *, const char *, u32);
152int core_tpg_del_initiator_node_acl(struct se_portal_group *,
153 struct se_node_acl *, int);
154int core_tpg_set_initiator_node_queue_depth(struct se_portal_group *,
155 unsigned char *, u32, int);
156int core_tpg_register(struct target_core_fabric_ops *, struct se_wwn *,
157 struct se_portal_group *, void *, int);
158int core_tpg_deregister(struct se_portal_group *);
159
160/* SAS helpers */
161u8 sas_get_fabric_proto_ident(struct se_portal_group *);
162u32 sas_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *,
163 struct t10_pr_registration *, int *, unsigned char *);
164u32 sas_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *,
165 struct t10_pr_registration *, int *);
166char *sas_parse_pr_out_transport_id(struct se_portal_group *, const char *,
167 u32 *, char **);
168
169/* FC helpers */
170u8 fc_get_fabric_proto_ident(struct se_portal_group *);
171u32 fc_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *,
172 struct t10_pr_registration *, int *, unsigned char *);
173u32 fc_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *,
174 struct t10_pr_registration *, int *);
175char *fc_parse_pr_out_transport_id(struct se_portal_group *, const char *,
176 u32 *, char **);
177
178/* iSCSI helpers */
179u8 iscsi_get_fabric_proto_ident(struct se_portal_group *);
180u32 iscsi_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *,
181 struct t10_pr_registration *, int *, unsigned char *);
182u32 iscsi_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *,
183 struct t10_pr_registration *, int *);
184char *iscsi_parse_pr_out_transport_id(struct se_portal_group *, const char *,
185 u32 *, char **);
186
187#endif /* TARGET_CORE_FABRICH */
diff --git a/include/target/target_core_fabric_lib.h b/include/target/target_core_fabric_lib.h
deleted file mode 100644
index c2f8d0e3a03b..000000000000
--- a/include/target/target_core_fabric_lib.h
+++ /dev/null
@@ -1,28 +0,0 @@
1#ifndef TARGET_CORE_FABRIC_LIB_H
2#define TARGET_CORE_FABRIC_LIB_H
3
4extern u8 sas_get_fabric_proto_ident(struct se_portal_group *);
5extern u32 sas_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *,
6 struct t10_pr_registration *, int *, unsigned char *);
7extern u32 sas_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *,
8 struct t10_pr_registration *, int *);
9extern char *sas_parse_pr_out_transport_id(struct se_portal_group *,
10 const char *, u32 *, char **);
11
12extern u8 fc_get_fabric_proto_ident(struct se_portal_group *);
13extern u32 fc_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *,
14 struct t10_pr_registration *, int *, unsigned char *);
15extern u32 fc_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *,
16 struct t10_pr_registration *, int *);
17extern char *fc_parse_pr_out_transport_id(struct se_portal_group *,
18 const char *, u32 *, char **);
19
20extern u8 iscsi_get_fabric_proto_ident(struct se_portal_group *);
21extern u32 iscsi_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *,
22 struct t10_pr_registration *, int *, unsigned char *);
23extern u32 iscsi_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *,
24 struct t10_pr_registration *, int *);
25extern char *iscsi_parse_pr_out_transport_id(struct se_portal_group *,
26 const char *, u32 *, char **);
27
28#endif /* TARGET_CORE_FABRIC_LIB_H */
diff --git a/include/target/target_core_tmr.h b/include/target/target_core_tmr.h
deleted file mode 100644
index d5876e17d3fb..000000000000
--- a/include/target/target_core_tmr.h
+++ /dev/null
@@ -1,35 +0,0 @@
1#ifndef TARGET_CORE_TMR_H
2#define TARGET_CORE_TMR_H
3
4/* fabric independent task management function values */
5enum tcm_tmreq_table {
6 TMR_ABORT_TASK = 1,
7 TMR_ABORT_TASK_SET = 2,
8 TMR_CLEAR_ACA = 3,
9 TMR_CLEAR_TASK_SET = 4,
10 TMR_LUN_RESET = 5,
11 TMR_TARGET_WARM_RESET = 6,
12 TMR_TARGET_COLD_RESET = 7,
13 TMR_FABRIC_TMR = 255,
14};
15
16/* fabric independent task management response values */
17enum tcm_tmrsp_table {
18 TMR_FUNCTION_COMPLETE = 0,
19 TMR_TASK_DOES_NOT_EXIST = 1,
20 TMR_LUN_DOES_NOT_EXIST = 2,
21 TMR_TASK_STILL_ALLEGIANT = 3,
22 TMR_TASK_FAILOVER_NOT_SUPPORTED = 4,
23 TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED = 5,
24 TMR_FUNCTION_AUTHORIZATION_FAILED = 6,
25 TMR_FUNCTION_REJECTED = 255,
26};
27
28extern struct kmem_cache *se_tmr_req_cache;
29
30extern struct se_tmr_req *core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
31extern void core_tmr_release_req(struct se_tmr_req *);
32extern int core_tmr_lun_reset(struct se_device *, struct se_tmr_req *,
33 struct list_head *, struct se_cmd *);
34
35#endif /* TARGET_CORE_TMR_H */
diff --git a/include/target/target_core_tpg.h b/include/target/target_core_tpg.h
deleted file mode 100644
index 77e18729c4c1..000000000000
--- a/include/target/target_core_tpg.h
+++ /dev/null
@@ -1,35 +0,0 @@
1#ifndef TARGET_CORE_TPG_H
2#define TARGET_CORE_TPG_H
3
4extern struct se_node_acl *__core_tpg_get_initiator_node_acl(struct se_portal_group *tpg,
5 const char *);
6extern struct se_node_acl *core_tpg_get_initiator_node_acl(struct se_portal_group *tpg,
7 unsigned char *);
8extern void core_tpg_add_node_to_devs(struct se_node_acl *,
9 struct se_portal_group *);
10extern struct se_node_acl *core_tpg_check_initiator_node_acl(
11 struct se_portal_group *,
12 unsigned char *);
13extern void core_tpg_wait_for_nacl_pr_ref(struct se_node_acl *);
14extern void core_tpg_wait_for_mib_ref(struct se_node_acl *);
15extern void core_tpg_clear_object_luns(struct se_portal_group *);
16extern struct se_node_acl *core_tpg_add_initiator_node_acl(
17 struct se_portal_group *,
18 struct se_node_acl *,
19 const char *, u32);
20extern int core_tpg_del_initiator_node_acl(struct se_portal_group *,
21 struct se_node_acl *, int);
22extern int core_tpg_set_initiator_node_queue_depth(struct se_portal_group *,
23 unsigned char *, u32, int);
24extern int core_tpg_register(struct target_core_fabric_ops *,
25 struct se_wwn *,
26 struct se_portal_group *, void *,
27 int);
28extern int core_tpg_deregister(struct se_portal_group *);
29extern struct se_lun *core_tpg_pre_addlun(struct se_portal_group *, u32);
30extern int core_tpg_post_addlun(struct se_portal_group *, struct se_lun *, u32,
31 void *);
32extern struct se_lun *core_tpg_pre_dellun(struct se_portal_group *, u32, int *);
33extern int core_tpg_post_dellun(struct se_portal_group *, struct se_lun *);
34
35#endif /* TARGET_CORE_TPG_H */
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h
deleted file mode 100644
index dac4f2d859fd..000000000000
--- a/include/target/target_core_transport.h
+++ /dev/null
@@ -1,287 +0,0 @@
1#ifndef TARGET_CORE_TRANSPORT_H
2#define TARGET_CORE_TRANSPORT_H
3
4#define TARGET_CORE_VERSION TARGET_CORE_MOD_VERSION
5
6/* Attempts before moving from SHORT to LONG */
7#define PYX_TRANSPORT_WINDOW_CLOSED_THRESHOLD 3
8#define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_SHORT 3 /* In milliseconds */
9#define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_LONG 10 /* In milliseconds */
10
11#define PYX_TRANSPORT_STATUS_INTERVAL 5 /* In seconds */
12
13#define TRANSPORT_PLUGIN_PHBA_PDEV 1
14#define TRANSPORT_PLUGIN_VHBA_PDEV 2
15#define TRANSPORT_PLUGIN_VHBA_VDEV 3
16
17/*
18 * struct se_subsystem_dev->su_dev_flags
19*/
20#define SDF_FIRMWARE_VPD_UNIT_SERIAL 0x00000001
21#define SDF_EMULATED_VPD_UNIT_SERIAL 0x00000002
22#define SDF_USING_UDEV_PATH 0x00000004
23#define SDF_USING_ALIAS 0x00000008
24
25/*
26 * struct se_device->dev_flags
27 */
28#define DF_READ_ONLY 0x00000001
29#define DF_SPC2_RESERVATIONS 0x00000002
30#define DF_SPC2_RESERVATIONS_WITH_ISID 0x00000004
31
32/* struct se_dev_attrib sanity values */
33/* Default max_unmap_lba_count */
34#define DA_MAX_UNMAP_LBA_COUNT 0
35/* Default max_unmap_block_desc_count */
36#define DA_MAX_UNMAP_BLOCK_DESC_COUNT 0
37/* Default unmap_granularity */
38#define DA_UNMAP_GRANULARITY_DEFAULT 0
39/* Default unmap_granularity_alignment */
40#define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT 0
41/* Emulation for Direct Page Out */
42#define DA_EMULATE_DPO 0
43/* Emulation for Forced Unit Access WRITEs */
44#define DA_EMULATE_FUA_WRITE 1
45/* Emulation for Forced Unit Access READs */
46#define DA_EMULATE_FUA_READ 0
47/* Emulation for WriteCache and SYNCHRONIZE_CACHE */
48#define DA_EMULATE_WRITE_CACHE 0
49/* Emulation for UNIT ATTENTION Interlock Control */
50#define DA_EMULATE_UA_INTLLCK_CTRL 0
51/* Emulation for TASK_ABORTED status (TAS) by default */
52#define DA_EMULATE_TAS 1
53/* Emulation for Thin Provisioning UNMAP using block/blk-lib.c:blkdev_issue_discard() */
54#define DA_EMULATE_TPU 0
55/*
56 * Emulation for Thin Provisioning WRITE_SAME w/ UNMAP=1 bit using
57 * block/blk-lib.c:blkdev_issue_discard()
58 */
59#define DA_EMULATE_TPWS 0
60/* No Emulation for PSCSI by default */
61#define DA_EMULATE_RESERVATIONS 0
62/* No Emulation for PSCSI by default */
63#define DA_EMULATE_ALUA 0
64/* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */
65#define DA_ENFORCE_PR_ISIDS 1
66#define DA_STATUS_MAX_SECTORS_MIN 16
67#define DA_STATUS_MAX_SECTORS_MAX 8192
68/* By default don't report non-rotating (solid state) medium */
69#define DA_IS_NONROT 0
70/* Queue Algorithm Modifier default for restricted reordering in control mode page */
71#define DA_EMULATE_REST_REORD 0
72
73#define SE_MODE_PAGE_BUF 512
74
75#define MOD_MAX_SECTORS(ms, bs) (ms % (PAGE_SIZE / bs))
76
77struct se_subsystem_api;
78
79extern int init_se_kmem_caches(void);
80extern void release_se_kmem_caches(void);
81extern u32 scsi_get_new_index(scsi_index_t);
82extern void transport_init_queue_obj(struct se_queue_obj *);
83extern void transport_subsystem_check_init(void);
84extern int transport_subsystem_register(struct se_subsystem_api *);
85extern void transport_subsystem_release(struct se_subsystem_api *);
86extern void transport_load_plugins(void);
87extern struct se_session *transport_init_session(void);
88extern void __transport_register_session(struct se_portal_group *,
89 struct se_node_acl *,
90 struct se_session *, void *);
91extern void transport_register_session(struct se_portal_group *,
92 struct se_node_acl *,
93 struct se_session *, void *);
94extern void transport_free_session(struct se_session *);
95extern void transport_deregister_session_configfs(struct se_session *);
96extern void transport_deregister_session(struct se_session *);
97extern void transport_cmd_finish_abort(struct se_cmd *, int);
98extern void transport_complete_sync_cache(struct se_cmd *, int);
99extern void transport_complete_task(struct se_task *, int);
100extern void transport_add_task_to_execute_queue(struct se_task *,
101 struct se_task *,
102 struct se_device *);
103extern void transport_remove_task_from_execute_queue(struct se_task *,
104 struct se_device *);
105extern void __transport_remove_task_from_execute_queue(struct se_task *,
106 struct se_device *);
107unsigned char *transport_dump_cmd_direction(struct se_cmd *);
108extern void transport_dump_dev_state(struct se_device *, char *, int *);
109extern void transport_dump_dev_info(struct se_device *, struct se_lun *,
110 unsigned long long, char *, int *);
111extern void transport_dump_vpd_proto_id(struct t10_vpd *,
112 unsigned char *, int);
113extern void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *);
114extern int transport_dump_vpd_assoc(struct t10_vpd *,
115 unsigned char *, int);
116extern int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *);
117extern int transport_dump_vpd_ident_type(struct t10_vpd *,
118 unsigned char *, int);
119extern int transport_set_vpd_ident_type(struct t10_vpd *, unsigned char *);
120extern int transport_dump_vpd_ident(struct t10_vpd *,
121 unsigned char *, int);
122extern int transport_set_vpd_ident(struct t10_vpd *, unsigned char *);
123extern struct se_device *transport_add_device_to_core_hba(struct se_hba *,
124 struct se_subsystem_api *,
125 struct se_subsystem_dev *, u32,
126 void *, struct se_dev_limits *,
127 const char *, const char *);
128extern void transport_init_se_cmd(struct se_cmd *,
129 struct target_core_fabric_ops *,
130 struct se_session *, u32, int, int,
131 unsigned char *);
132void *transport_kmap_first_data_page(struct se_cmd *cmd);
133void transport_kunmap_first_data_page(struct se_cmd *cmd);
134extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *);
135extern int transport_handle_cdb_direct(struct se_cmd *);
136extern int transport_generic_handle_cdb_map(struct se_cmd *);
137extern int transport_generic_handle_data(struct se_cmd *);
138extern int transport_generic_handle_tmr(struct se_cmd *);
139extern bool target_stop_task(struct se_task *task, unsigned long *flags);
140extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32,
141 struct scatterlist *, u32);
142extern int transport_clear_lun_from_sessions(struct se_lun *);
143extern bool transport_wait_for_tasks(struct se_cmd *);
144extern int transport_check_aborted_status(struct se_cmd *, int);
145extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int);
146extern void transport_send_task_abort(struct se_cmd *);
147extern void transport_release_cmd(struct se_cmd *);
148extern void transport_generic_free_cmd(struct se_cmd *, int);
149extern void target_get_sess_cmd(struct se_session *, struct se_cmd *);
150extern int target_put_sess_cmd(struct se_session *, struct se_cmd *);
151extern void target_splice_sess_cmd_list(struct se_session *);
152extern void target_wait_for_sess_cmds(struct se_session *, int);
153extern void transport_generic_wait_for_cmds(struct se_cmd *, int);
154extern void transport_do_task_sg_chain(struct se_cmd *);
155extern void transport_generic_process_write(struct se_cmd *);
156extern int transport_generic_new_cmd(struct se_cmd *);
157extern int transport_generic_do_tmr(struct se_cmd *);
158/* From target_core_alua.c */
159extern int core_alua_check_nonop_delay(struct se_cmd *);
160/* From target_core_cdb.c */
161extern int transport_emulate_control_cdb(struct se_task *);
162extern void target_get_task_cdb(struct se_task *task, unsigned char *cdb);
163
164/*
165 * Each se_transport_task_t can have N number of possible struct se_task's
166 * for the storage transport(s) to possibly execute.
167 * Used primarily for splitting up CDBs that exceed the physical storage
168 * HBA's maximum sector count per task.
169 */
170struct se_mem {
171 struct page *se_page;
172 u32 se_len;
173 u32 se_off;
174 struct list_head se_list;
175} ____cacheline_aligned;
176
177/*
178 * Each type of disk transport supported MUST have a template defined
179 * within its .h file.
180 */
181struct se_subsystem_api {
182 /*
183 * The Name. :-)
184 */
185 char name[16];
186 /*
187 * Transport Type.
188 */
189 u8 transport_type;
190
191 unsigned int fua_write_emulated : 1;
192 unsigned int write_cache_emulated : 1;
193
194 /*
195 * struct module for struct se_hba references
196 */
197 struct module *owner;
198 /*
199 * Used for global se_subsystem_api list_head
200 */
201 struct list_head sub_api_list;
202 /*
203 * attach_hba():
204 */
205 int (*attach_hba)(struct se_hba *, u32);
206 /*
207 * detach_hba():
208 */
209 void (*detach_hba)(struct se_hba *);
210 /*
211 * pmode_hba(): Used for TCM/pSCSI subsystem plugin HBA ->
212 * Linux/SCSI struct Scsi_Host passthrough
213 */
214 int (*pmode_enable_hba)(struct se_hba *, unsigned long);
215 /*
216 * allocate_virtdevice():
217 */
218 void *(*allocate_virtdevice)(struct se_hba *, const char *);
219 /*
220 * create_virtdevice(): Only for Virtual HBAs
221 */
222 struct se_device *(*create_virtdevice)(struct se_hba *,
223 struct se_subsystem_dev *, void *);
224 /*
225 * free_device():
226 */
227 void (*free_device)(void *);
228
229 /*
230 * transport_complete():
231 *
232 * Use transport_generic_complete() for majority of DAS transport
233 * drivers. Provided out of convenience.
234 */
235 int (*transport_complete)(struct se_task *task);
236 struct se_task *(*alloc_task)(unsigned char *cdb);
237 /*
238 * do_task():
239 */
240 int (*do_task)(struct se_task *);
241 /*
242 * Used by virtual subsystem plugins IBLOCK and FILEIO to emulate
243 * UNMAP and WRITE_SAME_* w/ UNMAP=1 <-> Linux/Block Discard
244 */
245 int (*do_discard)(struct se_device *, sector_t, u32);
246 /*
247 * Used by virtual subsystem plugins IBLOCK and FILEIO to emulate
248 * SYNCHRONIZE_CACHE_* <-> Linux/Block blkdev_issue_flush()
249 */
250 void (*do_sync_cache)(struct se_task *);
251 /*
252 * free_task():
253 */
254 void (*free_task)(struct se_task *);
255 /*
256 * check_configfs_dev_params():
257 */
258 ssize_t (*check_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *);
259 /*
260 * set_configfs_dev_params():
261 */
262 ssize_t (*set_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *,
263 const char *, ssize_t);
264 /*
265 * show_configfs_dev_params():
266 */
267 ssize_t (*show_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *,
268 char *);
269 /*
270 * get_device_rev():
271 */
272 u32 (*get_device_rev)(struct se_device *);
273 /*
274 * get_device_type():
275 */
276 u32 (*get_device_type)(struct se_device *);
277 /*
278 * Get the sector_t from a subsystem backstore..
279 */
280 sector_t (*get_blocks)(struct se_device *);
281 /*
282 * get_sense_buffer():
283 */
284 unsigned char *(*get_sense_buffer)(struct se_task *);
285} ____cacheline_aligned;
286
287#endif /* TARGET_CORE_TRANSPORT_H */
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index b31702ac15be..84f3001a568d 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -16,6 +16,8 @@ struct btrfs_delayed_ref_node;
16struct btrfs_delayed_tree_ref; 16struct btrfs_delayed_tree_ref;
17struct btrfs_delayed_data_ref; 17struct btrfs_delayed_data_ref;
18struct btrfs_delayed_ref_head; 18struct btrfs_delayed_ref_head;
19struct btrfs_block_group_cache;
20struct btrfs_free_cluster;
19struct map_lookup; 21struct map_lookup;
20struct extent_buffer; 22struct extent_buffer;
21 23
@@ -44,6 +46,17 @@ struct extent_buffer;
44 obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \ 46 obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \
45 (obj <= BTRFS_CSUM_TREE_OBJECTID )) ? __show_root_type(obj) : "-" 47 (obj <= BTRFS_CSUM_TREE_OBJECTID )) ? __show_root_type(obj) : "-"
46 48
49#define BTRFS_GROUP_FLAGS \
50 { BTRFS_BLOCK_GROUP_DATA, "DATA"}, \
51 { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \
52 { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \
53 { BTRFS_BLOCK_GROUP_RAID0, "RAID0"}, \
54 { BTRFS_BLOCK_GROUP_RAID1, "RAID1"}, \
55 { BTRFS_BLOCK_GROUP_DUP, "DUP"}, \
56 { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}
57
58#define BTRFS_UUID_SIZE 16
59
47TRACE_EVENT(btrfs_transaction_commit, 60TRACE_EVENT(btrfs_transaction_commit,
48 61
49 TP_PROTO(struct btrfs_root *root), 62 TP_PROTO(struct btrfs_root *root),
@@ -621,6 +634,34 @@ TRACE_EVENT(btrfs_cow_block,
621 __entry->cow_level) 634 __entry->cow_level)
622); 635);
623 636
637TRACE_EVENT(btrfs_space_reservation,
638
639 TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val,
640 u64 bytes, int reserve),
641
642 TP_ARGS(fs_info, type, val, bytes, reserve),
643
644 TP_STRUCT__entry(
645 __array( u8, fsid, BTRFS_UUID_SIZE )
646 __string( type, type )
647 __field( u64, val )
648 __field( u64, bytes )
649 __field( int, reserve )
650 ),
651
652 TP_fast_assign(
653 memcpy(__entry->fsid, fs_info->fsid, BTRFS_UUID_SIZE);
654 __assign_str(type, type);
655 __entry->val = val;
656 __entry->bytes = bytes;
657 __entry->reserve = reserve;
658 ),
659
660 TP_printk("%pU: %s: %Lu %s %Lu", __entry->fsid, __get_str(type),
661 __entry->val, __entry->reserve ? "reserve" : "release",
662 __entry->bytes)
663);
664
624DECLARE_EVENT_CLASS(btrfs__reserved_extent, 665DECLARE_EVENT_CLASS(btrfs__reserved_extent,
625 666
626 TP_PROTO(struct btrfs_root *root, u64 start, u64 len), 667 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
@@ -659,6 +700,168 @@ DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_free,
659 TP_ARGS(root, start, len) 700 TP_ARGS(root, start, len)
660); 701);
661 702
703TRACE_EVENT(find_free_extent,
704
705 TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
706 u64 data),
707
708 TP_ARGS(root, num_bytes, empty_size, data),
709
710 TP_STRUCT__entry(
711 __field( u64, root_objectid )
712 __field( u64, num_bytes )
713 __field( u64, empty_size )
714 __field( u64, data )
715 ),
716
717 TP_fast_assign(
718 __entry->root_objectid = root->root_key.objectid;
719 __entry->num_bytes = num_bytes;
720 __entry->empty_size = empty_size;
721 __entry->data = data;
722 ),
723
724 TP_printk("root = %Lu(%s), len = %Lu, empty_size = %Lu, "
725 "flags = %Lu(%s)", show_root_type(__entry->root_objectid),
726 __entry->num_bytes, __entry->empty_size, __entry->data,
727 __print_flags((unsigned long)__entry->data, "|",
728 BTRFS_GROUP_FLAGS))
729);
730
731DECLARE_EVENT_CLASS(btrfs__reserve_extent,
732
733 TP_PROTO(struct btrfs_root *root,
734 struct btrfs_block_group_cache *block_group, u64 start,
735 u64 len),
736
737 TP_ARGS(root, block_group, start, len),
738
739 TP_STRUCT__entry(
740 __field( u64, root_objectid )
741 __field( u64, bg_objectid )
742 __field( u64, flags )
743 __field( u64, start )
744 __field( u64, len )
745 ),
746
747 TP_fast_assign(
748 __entry->root_objectid = root->root_key.objectid;
749 __entry->bg_objectid = block_group->key.objectid;
750 __entry->flags = block_group->flags;
751 __entry->start = start;
752 __entry->len = len;
753 ),
754
755 TP_printk("root = %Lu(%s), block_group = %Lu, flags = %Lu(%s), "
756 "start = %Lu, len = %Lu",
757 show_root_type(__entry->root_objectid), __entry->bg_objectid,
758 __entry->flags, __print_flags((unsigned long)__entry->flags,
759 "|", BTRFS_GROUP_FLAGS),
760 __entry->start, __entry->len)
761);
762
763DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent,
764
765 TP_PROTO(struct btrfs_root *root,
766 struct btrfs_block_group_cache *block_group, u64 start,
767 u64 len),
768
769 TP_ARGS(root, block_group, start, len)
770);
771
772DEFINE_EVENT(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
773
774 TP_PROTO(struct btrfs_root *root,
775 struct btrfs_block_group_cache *block_group, u64 start,
776 u64 len),
777
778 TP_ARGS(root, block_group, start, len)
779);
780
781TRACE_EVENT(btrfs_find_cluster,
782
783 TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start,
784 u64 bytes, u64 empty_size, u64 min_bytes),
785
786 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
787
788 TP_STRUCT__entry(
789 __field( u64, bg_objectid )
790 __field( u64, flags )
791 __field( u64, start )
792 __field( u64, bytes )
793 __field( u64, empty_size )
794 __field( u64, min_bytes )
795 ),
796
797 TP_fast_assign(
798 __entry->bg_objectid = block_group->key.objectid;
799 __entry->flags = block_group->flags;
800 __entry->start = start;
801 __entry->bytes = bytes;
802 __entry->empty_size = empty_size;
803 __entry->min_bytes = min_bytes;
804 ),
805
806 TP_printk("block_group = %Lu, flags = %Lu(%s), start = %Lu, len = %Lu,"
807 " empty_size = %Lu, min_bytes = %Lu", __entry->bg_objectid,
808 __entry->flags,
809 __print_flags((unsigned long)__entry->flags, "|",
810 BTRFS_GROUP_FLAGS), __entry->start,
811 __entry->bytes, __entry->empty_size, __entry->min_bytes)
812);
813
814TRACE_EVENT(btrfs_failed_cluster_setup,
815
816 TP_PROTO(struct btrfs_block_group_cache *block_group),
817
818 TP_ARGS(block_group),
819
820 TP_STRUCT__entry(
821 __field( u64, bg_objectid )
822 ),
823
824 TP_fast_assign(
825 __entry->bg_objectid = block_group->key.objectid;
826 ),
827
828 TP_printk("block_group = %Lu", __entry->bg_objectid)
829);
830
831TRACE_EVENT(btrfs_setup_cluster,
832
833 TP_PROTO(struct btrfs_block_group_cache *block_group,
834 struct btrfs_free_cluster *cluster, u64 size, int bitmap),
835
836 TP_ARGS(block_group, cluster, size, bitmap),
837
838 TP_STRUCT__entry(
839 __field( u64, bg_objectid )
840 __field( u64, flags )
841 __field( u64, start )
842 __field( u64, max_size )
843 __field( u64, size )
844 __field( int, bitmap )
845 ),
846
847 TP_fast_assign(
848 __entry->bg_objectid = block_group->key.objectid;
849 __entry->flags = block_group->flags;
850 __entry->start = cluster->window_start;
851 __entry->max_size = cluster->max_size;
852 __entry->size = size;
853 __entry->bitmap = bitmap;
854 ),
855
856 TP_printk("block_group = %Lu, flags = %Lu(%s), window_start = %Lu, "
857 "size = %Lu, max_size = %Lu, bitmap = %d",
858 __entry->bg_objectid,
859 __entry->flags,
860 __print_flags((unsigned long)__entry->flags, "|",
861 BTRFS_GROUP_FLAGS), __entry->start,
862 __entry->size, __entry->max_size, __entry->bitmap)
863);
864
662#endif /* _TRACE_BTRFS_H */ 865#endif /* _TRACE_BTRFS_H */
663 866
664/* This part must be outside protection */ 867/* This part must be outside protection */
diff --git a/include/video/edid.h b/include/video/edid.h
index 928c342b33d6..c5f198704912 100644
--- a/include/video/edid.h
+++ b/include/video/edid.h
@@ -1,16 +1,14 @@
1#ifndef __linux_video_edid_h__ 1#ifndef __linux_video_edid_h__
2#define __linux_video_edid_h__ 2#define __linux_video_edid_h__
3 3
4#if !defined(__KERNEL__) || defined(CONFIG_X86)
5
6struct edid_info { 4struct edid_info {
7 unsigned char dummy[128]; 5 unsigned char dummy[128];
8}; 6};
9 7
10#ifdef __KERNEL__ 8#ifdef __KERNEL__
9#ifdef CONFIG_X86
11extern struct edid_info edid_info; 10extern struct edid_info edid_info;
12#endif /* __KERNEL__ */ 11#endif
13
14#endif 12#endif
15 13
16#endif /* __linux_video_edid_h__ */ 14#endif /* __linux_video_edid_h__ */
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 378c7ed6760b..062b3b24ff10 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -200,6 +200,10 @@ enum omap_dss_clk_source {
200 OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI, /* OMAP4: PLL2_CLK2 */ 200 OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI, /* OMAP4: PLL2_CLK2 */
201}; 201};
202 202
203enum omap_hdmi_flags {
204 OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP = 1 << 0,
205};
206
203/* RFBI */ 207/* RFBI */
204 208
205struct rfbi_timings { 209struct rfbi_timings {
@@ -294,8 +298,8 @@ int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
294 u16 len); 298 u16 len);
295int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel); 299int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel);
296int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel); 300int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel);
297int dsi_video_mode_enable(struct omap_dss_device *dssdev, int channel); 301int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel);
298void dsi_video_mode_disable(struct omap_dss_device *dssdev, int channel); 302void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel);
299 303
300/* Board specific data */ 304/* Board specific data */
301struct omap_dss_board_info { 305struct omap_dss_board_info {
@@ -309,6 +313,8 @@ struct omap_dss_board_info {
309 313
310/* Init with the board info */ 314/* Init with the board info */
311extern int omap_display_init(struct omap_dss_board_info *board_data); 315extern int omap_display_init(struct omap_dss_board_info *board_data);
316/* HDMI mux init*/
317extern int omap_hdmi_init(enum omap_hdmi_flags flags);
312 318
313struct omap_display_platform_data { 319struct omap_display_platform_data {
314 struct omap_dss_board_info *board_data; 320 struct omap_dss_board_info *board_data;
@@ -352,8 +358,6 @@ struct omap_dss_cpr_coefs {
352}; 358};
353 359
354struct omap_overlay_info { 360struct omap_overlay_info {
355 bool enabled;
356
357 u32 paddr; 361 u32 paddr;
358 u32 p_uv_addr; /* for NV12 format */ 362 u32 p_uv_addr; /* for NV12 format */
359 u16 screen_width; 363 u16 screen_width;
@@ -385,11 +389,21 @@ struct omap_overlay {
385 389
386 /* dynamic fields */ 390 /* dynamic fields */
387 struct omap_overlay_manager *manager; 391 struct omap_overlay_manager *manager;
388 struct omap_overlay_info info;
389 392
390 bool manager_changed; 393 /*
391 /* if true, info has been changed, but not applied() yet */ 394 * The following functions do not block:
392 bool info_dirty; 395 *
396 * is_enabled
397 * set_overlay_info
398 * get_overlay_info
399 *
400 * The rest of the functions may block and cannot be called from
401 * interrupt context
402 */
403
404 int (*enable)(struct omap_overlay *ovl);
405 int (*disable)(struct omap_overlay *ovl);
406 bool (*is_enabled)(struct omap_overlay *ovl);
393 407
394 int (*set_manager)(struct omap_overlay *ovl, 408 int (*set_manager)(struct omap_overlay *ovl,
395 struct omap_overlay_manager *mgr); 409 struct omap_overlay_manager *mgr);
@@ -418,23 +432,27 @@ struct omap_overlay_manager_info {
418 432
419struct omap_overlay_manager { 433struct omap_overlay_manager {
420 struct kobject kobj; 434 struct kobject kobj;
421 struct list_head list;
422 435
423 /* static fields */ 436 /* static fields */
424 const char *name; 437 const char *name;
425 enum omap_channel id; 438 enum omap_channel id;
426 enum omap_overlay_manager_caps caps; 439 enum omap_overlay_manager_caps caps;
427 int num_overlays; 440 struct list_head overlays;
428 struct omap_overlay **overlays;
429 enum omap_display_type supported_displays; 441 enum omap_display_type supported_displays;
430 442
431 /* dynamic fields */ 443 /* dynamic fields */
432 struct omap_dss_device *device; 444 struct omap_dss_device *device;
433 struct omap_overlay_manager_info info;
434 445
435 bool device_changed; 446 /*
436 /* if true, info has been changed but not applied() yet */ 447 * The following functions do not block:
437 bool info_dirty; 448 *
449 * set_manager_info
450 * get_manager_info
451 * apply
452 *
453 * The rest of the functions may block and cannot be called from
454 * interrupt context
455 */
438 456
439 int (*set_device)(struct omap_overlay_manager *mgr, 457 int (*set_device)(struct omap_overlay_manager *mgr,
440 struct omap_dss_device *dssdev); 458 struct omap_dss_device *dssdev);
@@ -448,9 +466,6 @@ struct omap_overlay_manager {
448 int (*apply)(struct omap_overlay_manager *mgr); 466 int (*apply)(struct omap_overlay_manager *mgr);
449 int (*wait_for_go)(struct omap_overlay_manager *mgr); 467 int (*wait_for_go)(struct omap_overlay_manager *mgr);
450 int (*wait_for_vsync)(struct omap_overlay_manager *mgr); 468 int (*wait_for_vsync)(struct omap_overlay_manager *mgr);
451
452 int (*enable)(struct omap_overlay_manager *mgr);
453 int (*disable)(struct omap_overlay_manager *mgr);
454}; 469};
455 470
456struct omap_dss_device { 471struct omap_dss_device {
@@ -662,12 +677,7 @@ void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
662 bool enable); 677 bool enable);
663int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable); 678int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable);
664 679
665int omap_dsi_prepare_update(struct omap_dss_device *dssdev, 680int omap_dsi_update(struct omap_dss_device *dssdev, int channel,
666 u16 *x, u16 *y, u16 *w, u16 *h,
667 bool enlarge_update_area);
668int omap_dsi_update(struct omap_dss_device *dssdev,
669 int channel,
670 u16 x, u16 y, u16 w, u16 h,
671 void (*callback)(int, void *), void *data); 681 void (*callback)(int, void *), void *data);
672int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel); 682int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel);
673int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id); 683int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id);
diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h
index 6cb95c977de9..434d56b4a1a5 100644
--- a/include/video/sh_mipi_dsi.h
+++ b/include/video/sh_mipi_dsi.h
@@ -28,14 +28,33 @@ enum sh_mipi_dsi_data_fmt {
28struct sh_mobile_lcdc_chan_cfg; 28struct sh_mobile_lcdc_chan_cfg;
29 29
30#define SH_MIPI_DSI_HSABM (1 << 0) 30#define SH_MIPI_DSI_HSABM (1 << 0)
31#define SH_MIPI_DSI_HSPBM (1 << 1) 31#define SH_MIPI_DSI_HBPBM (1 << 1)
32#define SH_MIPI_DSI_HFPBM (1 << 2)
33#define SH_MIPI_DSI_BL2E (1 << 3)
34#define SH_MIPI_DSI_VSEE (1 << 4)
35#define SH_MIPI_DSI_HSEE (1 << 5)
36#define SH_MIPI_DSI_HSAE (1 << 6)
37
38#define SH_MIPI_DSI_HSbyteCLK (1 << 24)
39#define SH_MIPI_DSI_HS6divCLK (1 << 25)
40#define SH_MIPI_DSI_HS4divCLK (1 << 26)
41
42#define SH_MIPI_DSI_SYNC_PULSES_MODE (SH_MIPI_DSI_VSEE | \
43 SH_MIPI_DSI_HSEE | \
44 SH_MIPI_DSI_HSAE)
45#define SH_MIPI_DSI_SYNC_EVENTS_MODE (0)
46#define SH_MIPI_DSI_SYNC_BURST_MODE (SH_MIPI_DSI_BL2E)
32 47
33struct sh_mipi_dsi_info { 48struct sh_mipi_dsi_info {
34 enum sh_mipi_dsi_data_fmt data_format; 49 enum sh_mipi_dsi_data_fmt data_format;
35 struct sh_mobile_lcdc_chan_cfg *lcd_chan; 50 struct sh_mobile_lcdc_chan_cfg *lcd_chan;
51 int lane;
36 unsigned long flags; 52 unsigned long flags;
37 u32 clksrc; 53 u32 clksrc;
38 unsigned int vsynw_offset; 54 unsigned int vsynw_offset;
55 int (*set_dot_clock)(struct platform_device *pdev,
56 void __iomem *base,
57 int enable);
39}; 58};
40 59
41#endif 60#endif
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
index 8101b726b48a..fe30b759c51e 100644
--- a/include/video/sh_mobile_lcdc.h
+++ b/include/video/sh_mobile_lcdc.h
@@ -174,7 +174,8 @@ struct sh_mobile_lcdc_bl_info {
174 174
175struct sh_mobile_lcdc_chan_cfg { 175struct sh_mobile_lcdc_chan_cfg {
176 int chan; 176 int chan;
177 int bpp; 177 int fourcc;
178 int colorspace;
178 int interface_type; /* selects RGBn or SYSn I/F, see above */ 179 int interface_type; /* selects RGBn or SYSn I/F, see above */
179 int clock_divider; 180 int clock_divider;
180 unsigned long flags; /* LCDC_FLAGS_... */ 181 unsigned long flags; /* LCDC_FLAGS_... */
@@ -184,7 +185,6 @@ struct sh_mobile_lcdc_chan_cfg {
184 struct sh_mobile_lcdc_board_cfg board_cfg; 185 struct sh_mobile_lcdc_board_cfg board_cfg;
185 struct sh_mobile_lcdc_bl_info bl_info; 186 struct sh_mobile_lcdc_bl_info bl_info;
186 struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */ 187 struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
187 int nonstd;
188 struct sh_mobile_meram_cfg *meram_cfg; 188 struct sh_mobile_meram_cfg *meram_cfg;
189}; 189};
190 190
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h
index 9324488f23f0..ee338bfde18b 100644
--- a/include/xen/interface/io/blkif.h
+++ b/include/xen/interface/io/blkif.h
@@ -84,6 +84,21 @@ typedef uint64_t blkif_sector_t;
84 * e07154r6-Data_Set_Management_Proposal_for_ATA-ACS2.doc 84 * e07154r6-Data_Set_Management_Proposal_for_ATA-ACS2.doc
85 * http://www.seagate.com/staticfiles/support/disc/manuals/ 85 * http://www.seagate.com/staticfiles/support/disc/manuals/
86 * Interface%20manuals/100293068c.pdf 86 * Interface%20manuals/100293068c.pdf
87 * The backend can optionally provide three extra XenBus attributes to
88 * further optimize the discard functionality:
89 * 'discard-aligment' - Devices that support discard functionality may
90 * internally allocate space in units that are bigger than the exported
91 * logical block size. The discard-alignment parameter indicates how many bytes
92 * the beginning of the partition is offset from the internal allocation unit's
93 * natural alignment.
94 * 'discard-granularity' - Devices that support discard functionality may
95 * internally allocate space using units that are bigger than the logical block
96 * size. The discard-granularity parameter indicates the size of the internal
97 * allocation unit in bytes if reported by the device. Otherwise the
98 * discard-granularity will be set to match the device's physical block size.
99 * 'discard-secure' - All copies of the discarded sectors (potentially created
100 * by garbage collection) must also be erased. To use this feature, the flag
101 * BLKIF_DISCARD_SECURE must be set in the blkif_request_trim.
87 */ 102 */
88#define BLKIF_OP_DISCARD 5 103#define BLKIF_OP_DISCARD 5
89 104
@@ -95,6 +110,12 @@ typedef uint64_t blkif_sector_t;
95#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11 110#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
96 111
97struct blkif_request_rw { 112struct blkif_request_rw {
113 uint8_t nr_segments; /* number of segments */
114 blkif_vdev_t handle; /* only for read/write requests */
115#ifdef CONFIG_X86_64
116 uint32_t _pad1; /* offsetof(blkif_request,u.rw.id) == 8 */
117#endif
118 uint64_t id; /* private guest value, echoed in resp */
98 blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */ 119 blkif_sector_t sector_number;/* start sector idx on disk (r/w only) */
99 struct blkif_request_segment { 120 struct blkif_request_segment {
100 grant_ref_t gref; /* reference to I/O buffer frame */ 121 grant_ref_t gref; /* reference to I/O buffer frame */
@@ -102,23 +123,28 @@ struct blkif_request_rw {
102 /* @last_sect: last sector in frame to transfer (inclusive). */ 123 /* @last_sect: last sector in frame to transfer (inclusive). */
103 uint8_t first_sect, last_sect; 124 uint8_t first_sect, last_sect;
104 } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; 125 } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
105}; 126} __attribute__((__packed__));
106 127
107struct blkif_request_discard { 128struct blkif_request_discard {
129 uint8_t flag; /* BLKIF_DISCARD_SECURE or zero. */
130#define BLKIF_DISCARD_SECURE (1<<0) /* ignored if discard-secure=0 */
131 blkif_vdev_t _pad1; /* only for read/write requests */
132#ifdef CONFIG_X86_64
133 uint32_t _pad2; /* offsetof(blkif_req..,u.discard.id)==8*/
134#endif
135 uint64_t id; /* private guest value, echoed in resp */
108 blkif_sector_t sector_number; 136 blkif_sector_t sector_number;
109 uint64_t nr_sectors; 137 uint64_t nr_sectors;
110}; 138 uint8_t _pad3;
139} __attribute__((__packed__));
111 140
112struct blkif_request { 141struct blkif_request {
113 uint8_t operation; /* BLKIF_OP_??? */ 142 uint8_t operation; /* BLKIF_OP_??? */
114 uint8_t nr_segments; /* number of segments */
115 blkif_vdev_t handle; /* only for read/write requests */
116 uint64_t id; /* private guest value, echoed in resp */
117 union { 143 union {
118 struct blkif_request_rw rw; 144 struct blkif_request_rw rw;
119 struct blkif_request_discard discard; 145 struct blkif_request_discard discard;
120 } u; 146 } u;
121}; 147} __attribute__((__packed__));
122 148
123struct blkif_response { 149struct blkif_response {
124 uint64_t id; /* copied from request */ 150 uint64_t id; /* copied from request */