aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/8250_pci.h2
-rw-r--r--include/linux/compiler-gcc.h5
-rw-r--r--include/linux/compiler-gcc3.h5
-rw-r--r--include/linux/compiler-gcc4.h8
-rw-r--r--include/linux/compiler.h8
-rw-r--r--include/linux/dcache.h21
-rw-r--r--include/linux/dma_remapping.h138
-rw-r--r--include/linux/dmar.h1
-rw-r--r--include/linux/dvb/frontend.h27
-rw-r--r--include/linux/fdtable.h2
-rw-r--r--include/linux/fs.h24
-rw-r--r--include/linux/fs_struct.h6
-rw-r--r--include/linux/generic_serial.h1
-rw-r--r--include/linux/ide.h121
-rw-r--r--include/linux/init_task.h1
-rw-r--r--include/linux/intel-iommu.h25
-rw-r--r--include/linux/interrupt.h6
-rw-r--r--include/linux/iommu.h112
-rw-r--r--include/linux/irq.h27
-rw-r--r--include/linux/irqnr.h23
-rw-r--r--include/linux/istallion.h2
-rw-r--r--include/linux/kernel_stat.h13
-rw-r--r--include/linux/kvm.h18
-rw-r--r--include/linux/kvm_host.h42
-rw-r--r--include/linux/mmc/core.h2
-rw-r--r--include/linux/mmc/host.h2
-rw-r--r--include/linux/namei.h5
-rw-r--r--include/linux/pci_ids.h2
-rw-r--r--include/linux/random.h50
-rw-r--r--include/linux/sched.h1
-rw-r--r--include/linux/security.h137
-rw-r--r--include/linux/serial.h3
-rw-r--r--include/linux/serial_8250.h3
-rw-r--r--include/linux/serial_core.h69
-rw-r--r--include/linux/spi/mmc_spi.h15
-rw-r--r--include/linux/tty.h27
-rw-r--r--include/linux/tty_driver.h6
-rw-r--r--include/linux/usb/wusb-wa.h1
-rw-r--r--include/linux/uwb.h123
-rw-r--r--include/linux/uwb/debug-cmd.h13
-rw-r--r--include/linux/uwb/debug.h82
-rw-r--r--include/linux/uwb/spec.h53
-rw-r--r--include/linux/uwb/umc.h2
-rw-r--r--include/linux/videodev2.h51
-rw-r--r--include/linux/wlp.h3
-rw-r--r--include/media/saa7146_vv.h6
-rw-r--r--include/media/soc_camera.h6
-rw-r--r--include/media/v4l2-chip-ident.h4
-rw-r--r--include/media/v4l2-common.h6
-rw-r--r--include/media/v4l2-dev.h15
-rw-r--r--include/media/v4l2-device.h2
-rw-r--r--include/media/v4l2-int-device.h2
-rw-r--r--include/media/v4l2-ioctl.h31
-rw-r--r--include/media/v4l2-subdev.h8
-rw-r--r--include/sound/tea575x-tuner.h2
55 files changed, 797 insertions, 573 deletions
diff --git a/include/linux/8250_pci.h b/include/linux/8250_pci.h
index 3209dd46ea7d..b24ff086a662 100644
--- a/include/linux/8250_pci.h
+++ b/include/linux/8250_pci.h
@@ -31,7 +31,7 @@ struct pciserial_board {
31struct serial_private; 31struct serial_private;
32 32
33struct serial_private * 33struct serial_private *
34pciserial_init_ports(struct pci_dev *dev, struct pciserial_board *board); 34pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board);
35void pciserial_remove_ports(struct serial_private *priv); 35void pciserial_remove_ports(struct serial_private *priv);
36void pciserial_suspend_ports(struct serial_private *priv); 36void pciserial_suspend_ports(struct serial_private *priv);
37void pciserial_resume_ports(struct serial_private *priv); 37void pciserial_resume_ports(struct serial_private *priv);
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 5c8351b859f0..af40f8eb86f0 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -61,3 +61,8 @@
61#define noinline __attribute__((noinline)) 61#define noinline __attribute__((noinline))
62#define __attribute_const__ __attribute__((__const__)) 62#define __attribute_const__ __attribute__((__const__))
63#define __maybe_unused __attribute__((unused)) 63#define __maybe_unused __attribute__((unused))
64
65#define __gcc_header(x) #x
66#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
67#define gcc_header(x) _gcc_header(x)
68#include gcc_header(__GNUC__)
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h
index e5eb795f78a1..8005effc04f1 100644
--- a/include/linux/compiler-gcc3.h
+++ b/include/linux/compiler-gcc3.h
@@ -2,8 +2,9 @@
2#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead." 2#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
3#endif 3#endif
4 4
5/* These definitions are for GCC v3.x. */ 5#if __GNUC_MINOR__ < 2
6#include <linux/compiler-gcc.h> 6# error Sorry, your compiler is too old - please upgrade it.
7#endif
7 8
8#if __GNUC_MINOR__ >= 3 9#if __GNUC_MINOR__ >= 3
9# define __used __attribute__((__used__)) 10# define __used __attribute__((__used__))
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 974f5b7bb205..09992718f9e8 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -2,8 +2,10 @@
2#error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead." 2#error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead."
3#endif 3#endif
4 4
5/* These definitions are for GCC v4.x. */ 5/* GCC 4.1.[01] miscompiles __weak */
6#include <linux/compiler-gcc.h> 6#if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1
7# error Your version of gcc miscompiles the __weak directive
8#endif
7 9
8#define __used __attribute__((__used__)) 10#define __used __attribute__((__used__))
9#define __must_check __attribute__((warn_unused_result)) 11#define __must_check __attribute__((warn_unused_result))
@@ -16,7 +18,7 @@
16 */ 18 */
17#define uninitialized_var(x) x = x 19#define uninitialized_var(x) x = x
18 20
19#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 3) 21#if __GNUC_MINOR__ >= 3
20/* Mark functions as cold. gcc will assume any path leading to a call 22/* Mark functions as cold. gcc will assume any path leading to a call
21 to them will be unlikely. This means a lot of manual unlikely()s 23 to them will be unlikely. This means a lot of manual unlikely()s
22 are unnecessary now for any paths leading to the usual suspects 24 are unnecessary now for any paths leading to the usual suspects
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index ea7c6be354b7..d95da1020f1c 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -36,12 +36,8 @@ extern void __chk_io_ptr(const volatile void __iomem *);
36 36
37#ifdef __KERNEL__ 37#ifdef __KERNEL__
38 38
39#if __GNUC__ >= 4 39#ifdef __GNUC__
40# include <linux/compiler-gcc4.h> 40#include <linux/compiler-gcc.h>
41#elif __GNUC__ == 3 && __GNUC_MINOR__ >= 2
42# include <linux/compiler-gcc3.h>
43#else
44# error Sorry, your compiler is too old/not recognized.
45#endif 41#endif
46 42
47#define notrace __attribute__((no_instrument_function)) 43#define notrace __attribute__((no_instrument_function))
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index a37359d0bad1..c66d22487bf8 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -75,14 +75,22 @@ full_name_hash(const unsigned char *name, unsigned int len)
75 return end_name_hash(hash); 75 return end_name_hash(hash);
76} 76}
77 77
78struct dcookie_struct; 78/*
79 79 * Try to keep struct dentry aligned on 64 byte cachelines (this will
80#define DNAME_INLINE_LEN_MIN 36 80 * give reasonable cacheline footprint with larger lines without the
81 * large memory footprint increase).
82 */
83#ifdef CONFIG_64BIT
84#define DNAME_INLINE_LEN_MIN 32 /* 192 bytes */
85#else
86#define DNAME_INLINE_LEN_MIN 40 /* 128 bytes */
87#endif
81 88
82struct dentry { 89struct dentry {
83 atomic_t d_count; 90 atomic_t d_count;
84 unsigned int d_flags; /* protected by d_lock */ 91 unsigned int d_flags; /* protected by d_lock */
85 spinlock_t d_lock; /* per dentry lock */ 92 spinlock_t d_lock; /* per dentry lock */
93 int d_mounted;
86 struct inode *d_inode; /* Where the name belongs to - NULL is 94 struct inode *d_inode; /* Where the name belongs to - NULL is
87 * negative */ 95 * negative */
88 /* 96 /*
@@ -107,10 +115,7 @@ struct dentry {
107 struct dentry_operations *d_op; 115 struct dentry_operations *d_op;
108 struct super_block *d_sb; /* The root of the dentry tree */ 116 struct super_block *d_sb; /* The root of the dentry tree */
109 void *d_fsdata; /* fs-specific data */ 117 void *d_fsdata; /* fs-specific data */
110#ifdef CONFIG_PROFILING 118
111 struct dcookie_struct *d_cookie; /* cookie, if any */
112#endif
113 int d_mounted;
114 unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ 119 unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */
115}; 120};
116 121
@@ -177,6 +182,8 @@ d_iput: no no no yes
177 182
178#define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched */ 183#define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched */
179 184
185#define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */
186
180extern spinlock_t dcache_lock; 187extern spinlock_t dcache_lock;
181extern seqlock_t rename_lock; 188extern seqlock_t rename_lock;
182 189
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h
index 952df39c989d..136f170cecc2 100644
--- a/include/linux/dma_remapping.h
+++ b/include/linux/dma_remapping.h
@@ -9,148 +9,16 @@
9#define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT) 9#define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT)
10#define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK) 10#define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK)
11 11
12#define IOVA_PFN(addr) ((addr) >> PAGE_SHIFT)
13#define DMA_32BIT_PFN IOVA_PFN(DMA_32BIT_MASK)
14#define DMA_64BIT_PFN IOVA_PFN(DMA_64BIT_MASK)
15
16
17/*
18 * 0: Present
19 * 1-11: Reserved
20 * 12-63: Context Ptr (12 - (haw-1))
21 * 64-127: Reserved
22 */
23struct root_entry {
24 u64 val;
25 u64 rsvd1;
26};
27#define ROOT_ENTRY_NR (VTD_PAGE_SIZE/sizeof(struct root_entry))
28static inline bool root_present(struct root_entry *root)
29{
30 return (root->val & 1);
31}
32static inline void set_root_present(struct root_entry *root)
33{
34 root->val |= 1;
35}
36static inline void set_root_value(struct root_entry *root, unsigned long value)
37{
38 root->val |= value & VTD_PAGE_MASK;
39}
40
41struct context_entry;
42static inline struct context_entry *
43get_context_addr_from_root(struct root_entry *root)
44{
45 return (struct context_entry *)
46 (root_present(root)?phys_to_virt(
47 root->val & VTD_PAGE_MASK) :
48 NULL);
49}
50
51/*
52 * low 64 bits:
53 * 0: present
54 * 1: fault processing disable
55 * 2-3: translation type
56 * 12-63: address space root
57 * high 64 bits:
58 * 0-2: address width
59 * 3-6: aval
60 * 8-23: domain id
61 */
62struct context_entry {
63 u64 lo;
64 u64 hi;
65};
66#define context_present(c) ((c).lo & 1)
67#define context_fault_disable(c) (((c).lo >> 1) & 1)
68#define context_translation_type(c) (((c).lo >> 2) & 3)
69#define context_address_root(c) ((c).lo & VTD_PAGE_MASK)
70#define context_address_width(c) ((c).hi & 7)
71#define context_domain_id(c) (((c).hi >> 8) & ((1 << 16) - 1))
72
73#define context_set_present(c) do {(c).lo |= 1;} while (0)
74#define context_set_fault_enable(c) \
75 do {(c).lo &= (((u64)-1) << 2) | 1;} while (0)
76#define context_set_translation_type(c, val) \
77 do { \
78 (c).lo &= (((u64)-1) << 4) | 3; \
79 (c).lo |= ((val) & 3) << 2; \
80 } while (0)
81#define CONTEXT_TT_MULTI_LEVEL 0
82#define context_set_address_root(c, val) \
83 do {(c).lo |= (val) & VTD_PAGE_MASK; } while (0)
84#define context_set_address_width(c, val) do {(c).hi |= (val) & 7;} while (0)
85#define context_set_domain_id(c, val) \
86 do {(c).hi |= ((val) & ((1 << 16) - 1)) << 8;} while (0)
87#define context_clear_entry(c) do {(c).lo = 0; (c).hi = 0;} while (0)
88
89/*
90 * 0: readable
91 * 1: writable
92 * 2-6: reserved
93 * 7: super page
94 * 8-11: available
95 * 12-63: Host physcial address
96 */
97struct dma_pte {
98 u64 val;
99};
100#define dma_clear_pte(p) do {(p).val = 0;} while (0)
101
102#define DMA_PTE_READ (1) 12#define DMA_PTE_READ (1)
103#define DMA_PTE_WRITE (2) 13#define DMA_PTE_WRITE (2)
104 14
105#define dma_set_pte_readable(p) do {(p).val |= DMA_PTE_READ;} while (0)
106#define dma_set_pte_writable(p) do {(p).val |= DMA_PTE_WRITE;} while (0)
107#define dma_set_pte_prot(p, prot) \
108 do {(p).val = ((p).val & ~3) | ((prot) & 3); } while (0)
109#define dma_pte_addr(p) ((p).val & VTD_PAGE_MASK)
110#define dma_set_pte_addr(p, addr) do {\
111 (p).val |= ((addr) & VTD_PAGE_MASK); } while (0)
112#define dma_pte_present(p) (((p).val & 3) != 0)
113
114struct intel_iommu; 15struct intel_iommu;
16struct dmar_domain;
17struct root_entry;
115 18
116struct dmar_domain {
117 int id; /* domain id */
118 struct intel_iommu *iommu; /* back pointer to owning iommu */
119
120 struct list_head devices; /* all devices' list */
121 struct iova_domain iovad; /* iova's that belong to this domain */
122
123 struct dma_pte *pgd; /* virtual address */
124 spinlock_t mapping_lock; /* page table lock */
125 int gaw; /* max guest address width */
126
127 /* adjusted guest address width, 0 is level 2 30-bit */
128 int agaw;
129
130#define DOMAIN_FLAG_MULTIPLE_DEVICES 1
131 int flags;
132};
133
134/* PCI domain-device relationship */
135struct device_domain_info {
136 struct list_head link; /* link to domain siblings */
137 struct list_head global; /* link to global list */
138 u8 bus; /* PCI bus numer */
139 u8 devfn; /* PCI devfn number */
140 struct pci_dev *dev; /* it's NULL for PCIE-to-PCI bridge */
141 struct dmar_domain *domain; /* pointer to domain */
142};
143
144extern int init_dmars(void);
145extern void free_dmar_iommu(struct intel_iommu *iommu); 19extern void free_dmar_iommu(struct intel_iommu *iommu);
20extern int iommu_calculate_agaw(struct intel_iommu *iommu);
146 21
147extern int dmar_disabled; 22extern int dmar_disabled;
148 23
149#ifndef CONFIG_DMAR_GFX_WA
150static inline void iommu_prepare_gfx_mapping(void)
151{
152 return;
153}
154#endif /* !CONFIG_DMAR_GFX_WA */
155
156#endif 24#endif
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index f1984fc3e06d..f28440784cf0 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -144,7 +144,6 @@ struct dmar_rmrr_unit {
144 list_for_each_entry(rmrr, &dmar_rmrr_units, list) 144 list_for_each_entry(rmrr, &dmar_rmrr_units, list)
145/* Intel DMAR initialization functions */ 145/* Intel DMAR initialization functions */
146extern int intel_iommu_init(void); 146extern int intel_iommu_init(void);
147extern int dmar_disabled;
148#else 147#else
149static inline int intel_iommu_init(void) 148static inline int intel_iommu_init(void)
150{ 149{
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h
index 79a8ed8e6a7d..55026b1a40bd 100644
--- a/include/linux/dvb/frontend.h
+++ b/include/linux/dvb/frontend.h
@@ -62,10 +62,11 @@ typedef enum fe_caps {
62 FE_CAN_HIERARCHY_AUTO = 0x100000, 62 FE_CAN_HIERARCHY_AUTO = 0x100000,
63 FE_CAN_8VSB = 0x200000, 63 FE_CAN_8VSB = 0x200000,
64 FE_CAN_16VSB = 0x400000, 64 FE_CAN_16VSB = 0x400000,
65 FE_HAS_EXTENDED_CAPS = 0x800000, // We need more bitspace for newer APIs, indicate this. 65 FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */
66 FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending) 66 FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */
67 FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically 67 FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
68 FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output 68 FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */
69 FE_CAN_MUTE_TS = 0x80000000 /* frontend can stop spurious TS data output */
69} fe_caps_t; 70} fe_caps_t;
70 71
71 72
@@ -121,15 +122,15 @@ typedef enum fe_sec_mini_cmd {
121 122
122 123
123typedef enum fe_status { 124typedef enum fe_status {
124 FE_HAS_SIGNAL = 0x01, /* found something above the noise level */ 125 FE_HAS_SIGNAL = 0x01, /* found something above the noise level */
125 FE_HAS_CARRIER = 0x02, /* found a DVB signal */ 126 FE_HAS_CARRIER = 0x02, /* found a DVB signal */
126 FE_HAS_VITERBI = 0x04, /* FEC is stable */ 127 FE_HAS_VITERBI = 0x04, /* FEC is stable */
127 FE_HAS_SYNC = 0x08, /* found sync bytes */ 128 FE_HAS_SYNC = 0x08, /* found sync bytes */
128 FE_HAS_LOCK = 0x10, /* everything's working... */ 129 FE_HAS_LOCK = 0x10, /* everything's working... */
129 FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */ 130 FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */
130 FE_REINIT = 0x40 /* frontend was reinitialized, */ 131 FE_REINIT = 0x40 /* frontend was reinitialized, */
131} fe_status_t; /* application is recommended to reset */ 132} fe_status_t; /* application is recommended to reset */
132 /* DiSEqC, tone and parameters */ 133 /* DiSEqC, tone and parameters */
133 134
134typedef enum fe_spectral_inversion { 135typedef enum fe_spectral_inversion {
135 INVERSION_OFF, 136 INVERSION_OFF,
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 4aab6f12cfab..09d6c5bbdddd 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -57,8 +57,6 @@ struct files_struct {
57 57
58#define files_fdtable(files) (rcu_dereference((files)->fdt)) 58#define files_fdtable(files) (rcu_dereference((files)->fdt))
59 59
60extern struct kmem_cache *filp_cachep;
61
62struct file_operations; 60struct file_operations;
63struct vfsmount; 61struct vfsmount;
64struct dentry; 62struct dentry;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 001ded4845b4..e2170ee21e18 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -21,7 +21,6 @@
21 21
22/* Fixed constants first: */ 22/* Fixed constants first: */
23#undef NR_OPEN 23#undef NR_OPEN
24extern int sysctl_nr_open;
25#define INR_OPEN 1024 /* Initial setting for nfile rlimits */ 24#define INR_OPEN 1024 /* Initial setting for nfile rlimits */
26 25
27#define BLOCK_SIZE_BITS 10 26#define BLOCK_SIZE_BITS 10
@@ -38,21 +37,13 @@ struct files_stat_struct {
38 int nr_free_files; /* read only */ 37 int nr_free_files; /* read only */
39 int max_files; /* tunable */ 38 int max_files; /* tunable */
40}; 39};
41extern struct files_stat_struct files_stat;
42extern int get_max_files(void);
43 40
44struct inodes_stat_t { 41struct inodes_stat_t {
45 int nr_inodes; 42 int nr_inodes;
46 int nr_unused; 43 int nr_unused;
47 int dummy[5]; /* padding for sysctl ABI compatibility */ 44 int dummy[5]; /* padding for sysctl ABI compatibility */
48}; 45};
49extern struct inodes_stat_t inodes_stat;
50 46
51extern int leases_enable, lease_break_time;
52
53#ifdef CONFIG_DNOTIFY
54extern int dir_notify_enable;
55#endif
56 47
57#define NR_FILE 8192 /* this can well be larger on a larger system */ 48#define NR_FILE 8192 /* this can well be larger on a larger system */
58 49
@@ -330,6 +321,15 @@ extern void __init inode_init(void);
330extern void __init inode_init_early(void); 321extern void __init inode_init_early(void);
331extern void __init files_init(unsigned long); 322extern void __init files_init(unsigned long);
332 323
324extern struct files_stat_struct files_stat;
325extern int get_max_files(void);
326extern int sysctl_nr_open;
327extern struct inodes_stat_t inodes_stat;
328extern int leases_enable, lease_break_time;
329#ifdef CONFIG_DNOTIFY
330extern int dir_notify_enable;
331#endif
332
333struct buffer_head; 333struct buffer_head;
334typedef int (get_block_t)(struct inode *inode, sector_t iblock, 334typedef int (get_block_t)(struct inode *inode, sector_t iblock,
335 struct buffer_head *bh_result, int create); 335 struct buffer_head *bh_result, int create);
@@ -1212,7 +1212,6 @@ extern void unlock_super(struct super_block *);
1212/* 1212/*
1213 * VFS helper functions.. 1213 * VFS helper functions..
1214 */ 1214 */
1215extern int vfs_permission(struct nameidata *, int);
1216extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); 1215extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
1217extern int vfs_mkdir(struct inode *, struct dentry *, int); 1216extern int vfs_mkdir(struct inode *, struct dentry *, int);
1218extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); 1217extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
@@ -1310,7 +1309,6 @@ struct file_operations {
1310 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); 1309 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
1311 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); 1310 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
1312 int (*check_flags)(int); 1311 int (*check_flags)(int);
1313 int (*dir_notify)(struct file *filp, unsigned long arg);
1314 int (*flock) (struct file *, int, struct file_lock *); 1312 int (*flock) (struct file *, int, struct file_lock *);
1315 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); 1313 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
1316 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); 1314 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
@@ -1869,7 +1867,7 @@ extern void free_write_pipe(struct file *);
1869 1867
1870extern struct file *do_filp_open(int dfd, const char *pathname, 1868extern struct file *do_filp_open(int dfd, const char *pathname,
1871 int open_flag, int mode); 1869 int open_flag, int mode);
1872extern int may_open(struct nameidata *, int, int); 1870extern int may_open(struct path *, int, int);
1873 1871
1874extern int kernel_read(struct file *, unsigned long, char *, unsigned long); 1872extern int kernel_read(struct file *, unsigned long, char *, unsigned long);
1875extern struct file * open_exec(const char *); 1873extern struct file * open_exec(const char *);
@@ -1904,6 +1902,8 @@ extern struct inode *ilookup(struct super_block *sb, unsigned long ino);
1904 1902
1905extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *); 1903extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *);
1906extern struct inode * iget_locked(struct super_block *, unsigned long); 1904extern struct inode * iget_locked(struct super_block *, unsigned long);
1905extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
1906extern int insert_inode_locked(struct inode *);
1907extern void unlock_new_inode(struct inode *); 1907extern void unlock_new_inode(struct inode *);
1908 1908
1909extern void __iget(struct inode * inode); 1909extern void __iget(struct inode * inode);
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 9e5a06e78d02..a97c053d3a9a 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -10,12 +10,6 @@ struct fs_struct {
10 struct path root, pwd; 10 struct path root, pwd;
11}; 11};
12 12
13#define INIT_FS { \
14 .count = ATOMIC_INIT(1), \
15 .lock = RW_LOCK_UNLOCKED, \
16 .umask = 0022, \
17}
18
19extern struct kmem_cache *fs_cachep; 13extern struct kmem_cache *fs_cachep;
20 14
21extern void exit_fs(struct task_struct *); 15extern void exit_fs(struct task_struct *);
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h
index 4cc913939817..fadff28505bb 100644
--- a/include/linux/generic_serial.h
+++ b/include/linux/generic_serial.h
@@ -21,7 +21,6 @@ struct real_driver {
21 void (*enable_tx_interrupts) (void *); 21 void (*enable_tx_interrupts) (void *);
22 void (*disable_rx_interrupts) (void *); 22 void (*disable_rx_interrupts) (void *);
23 void (*enable_rx_interrupts) (void *); 23 void (*enable_rx_interrupts) (void *);
24 int (*get_CD) (void *);
25 void (*shutdown_port) (void*); 24 void (*shutdown_port) (void*);
26 int (*set_real_termios) (void*); 25 int (*set_real_termios) (void*);
27 int (*chars_in_buffer) (void*); 26 int (*chars_in_buffer) (void*);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index e99c56de7f56..db5ef8ae1ab9 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -32,13 +32,6 @@
32# define SUPPORT_VLB_SYNC 1 32# define SUPPORT_VLB_SYNC 1
33#endif 33#endif
34 34
35/*
36 * Used to indicate "no IRQ", should be a value that cannot be an IRQ
37 * number.
38 */
39
40#define IDE_NO_IRQ (-1)
41
42typedef unsigned char byte; /* used everywhere */ 35typedef unsigned char byte; /* used everywhere */
43 36
44/* 37/*
@@ -403,6 +396,7 @@ enum {
403 * This is used for several packet commands (not for READ/WRITE commands). 396 * This is used for several packet commands (not for READ/WRITE commands).
404 */ 397 */
405#define IDE_PC_BUFFER_SIZE 256 398#define IDE_PC_BUFFER_SIZE 256
399#define ATAPI_WAIT_PC (60 * HZ)
406 400
407struct ide_atapi_pc { 401struct ide_atapi_pc {
408 /* actual packet bytes */ 402 /* actual packet bytes */
@@ -480,53 +474,53 @@ enum {
480 474
481 /* ide-cd */ 475 /* ide-cd */
482 /* Drive cannot eject the disc. */ 476 /* Drive cannot eject the disc. */
483 IDE_AFLAG_NO_EJECT = (1 << 3), 477 IDE_AFLAG_NO_EJECT = (1 << 1),
484 /* Drive is a pre ATAPI 1.2 drive. */ 478 /* Drive is a pre ATAPI 1.2 drive. */
485 IDE_AFLAG_PRE_ATAPI12 = (1 << 4), 479 IDE_AFLAG_PRE_ATAPI12 = (1 << 2),
486 /* TOC addresses are in BCD. */ 480 /* TOC addresses are in BCD. */
487 IDE_AFLAG_TOCADDR_AS_BCD = (1 << 5), 481 IDE_AFLAG_TOCADDR_AS_BCD = (1 << 3),
488 /* TOC track numbers are in BCD. */ 482 /* TOC track numbers are in BCD. */
489 IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 6), 483 IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 4),
490 /* 484 /*
491 * Drive does not provide data in multiples of SECTOR_SIZE 485 * Drive does not provide data in multiples of SECTOR_SIZE
492 * when more than one interrupt is needed. 486 * when more than one interrupt is needed.
493 */ 487 */
494 IDE_AFLAG_LIMIT_NFRAMES = (1 << 7), 488 IDE_AFLAG_LIMIT_NFRAMES = (1 << 5),
495 /* Saved TOC information is current. */ 489 /* Saved TOC information is current. */
496 IDE_AFLAG_TOC_VALID = (1 << 9), 490 IDE_AFLAG_TOC_VALID = (1 << 6),
497 /* We think that the drive door is locked. */ 491 /* We think that the drive door is locked. */
498 IDE_AFLAG_DOOR_LOCKED = (1 << 10), 492 IDE_AFLAG_DOOR_LOCKED = (1 << 7),
499 /* SET_CD_SPEED command is unsupported. */ 493 /* SET_CD_SPEED command is unsupported. */
500 IDE_AFLAG_NO_SPEED_SELECT = (1 << 11), 494 IDE_AFLAG_NO_SPEED_SELECT = (1 << 8),
501 IDE_AFLAG_VERTOS_300_SSD = (1 << 12), 495 IDE_AFLAG_VERTOS_300_SSD = (1 << 9),
502 IDE_AFLAG_VERTOS_600_ESD = (1 << 13), 496 IDE_AFLAG_VERTOS_600_ESD = (1 << 10),
503 IDE_AFLAG_SANYO_3CD = (1 << 14), 497 IDE_AFLAG_SANYO_3CD = (1 << 11),
504 IDE_AFLAG_FULL_CAPS_PAGE = (1 << 15), 498 IDE_AFLAG_FULL_CAPS_PAGE = (1 << 12),
505 IDE_AFLAG_PLAY_AUDIO_OK = (1 << 16), 499 IDE_AFLAG_PLAY_AUDIO_OK = (1 << 13),
506 IDE_AFLAG_LE_SPEED_FIELDS = (1 << 17), 500 IDE_AFLAG_LE_SPEED_FIELDS = (1 << 14),
507 501
508 /* ide-floppy */ 502 /* ide-floppy */
509 /* Avoid commands not supported in Clik drive */ 503 /* Avoid commands not supported in Clik drive */
510 IDE_AFLAG_CLIK_DRIVE = (1 << 19), 504 IDE_AFLAG_CLIK_DRIVE = (1 << 15),
511 /* Requires BH algorithm for packets */ 505 /* Requires BH algorithm for packets */
512 IDE_AFLAG_ZIP_DRIVE = (1 << 20), 506 IDE_AFLAG_ZIP_DRIVE = (1 << 16),
513 /* Supports format progress report */ 507 /* Supports format progress report */
514 IDE_AFLAG_SRFP = (1 << 22), 508 IDE_AFLAG_SRFP = (1 << 17),
515 509
516 /* ide-tape */ 510 /* ide-tape */
517 IDE_AFLAG_IGNORE_DSC = (1 << 23), 511 IDE_AFLAG_IGNORE_DSC = (1 << 18),
518 /* 0 When the tape position is unknown */ 512 /* 0 When the tape position is unknown */
519 IDE_AFLAG_ADDRESS_VALID = (1 << 24), 513 IDE_AFLAG_ADDRESS_VALID = (1 << 19),
520 /* Device already opened */ 514 /* Device already opened */
521 IDE_AFLAG_BUSY = (1 << 25), 515 IDE_AFLAG_BUSY = (1 << 20),
522 /* Attempt to auto-detect the current user block size */ 516 /* Attempt to auto-detect the current user block size */
523 IDE_AFLAG_DETECT_BS = (1 << 26), 517 IDE_AFLAG_DETECT_BS = (1 << 21),
524 /* Currently on a filemark */ 518 /* Currently on a filemark */
525 IDE_AFLAG_FILEMARK = (1 << 27), 519 IDE_AFLAG_FILEMARK = (1 << 22),
526 /* 0 = no tape is loaded, so we don't rewind after ejecting */ 520 /* 0 = no tape is loaded, so we don't rewind after ejecting */
527 IDE_AFLAG_MEDIUM_PRESENT = (1 << 28), 521 IDE_AFLAG_MEDIUM_PRESENT = (1 << 23),
528 522
529 IDE_AFLAG_NO_AUTOCLOSE = (1 << 29), 523 IDE_AFLAG_NO_AUTOCLOSE = (1 << 24),
530}; 524};
531 525
532/* device flags */ 526/* device flags */
@@ -565,28 +559,26 @@ enum {
565 IDE_DFLAG_NODMA = (1 << 16), 559 IDE_DFLAG_NODMA = (1 << 16),
566 /* powermanagment told us not to do anything, so sleep nicely */ 560 /* powermanagment told us not to do anything, so sleep nicely */
567 IDE_DFLAG_BLOCKED = (1 << 17), 561 IDE_DFLAG_BLOCKED = (1 << 17),
568 /* ide-scsi emulation */
569 IDE_DFLAG_SCSI = (1 << 18),
570 /* sleeping & sleep field valid */ 562 /* sleeping & sleep field valid */
571 IDE_DFLAG_SLEEPING = (1 << 19), 563 IDE_DFLAG_SLEEPING = (1 << 18),
572 IDE_DFLAG_POST_RESET = (1 << 20), 564 IDE_DFLAG_POST_RESET = (1 << 19),
573 IDE_DFLAG_UDMA33_WARNED = (1 << 21), 565 IDE_DFLAG_UDMA33_WARNED = (1 << 20),
574 IDE_DFLAG_LBA48 = (1 << 22), 566 IDE_DFLAG_LBA48 = (1 << 21),
575 /* status of write cache */ 567 /* status of write cache */
576 IDE_DFLAG_WCACHE = (1 << 23), 568 IDE_DFLAG_WCACHE = (1 << 22),
577 /* used for ignoring ATA_DF */ 569 /* used for ignoring ATA_DF */
578 IDE_DFLAG_NOWERR = (1 << 24), 570 IDE_DFLAG_NOWERR = (1 << 23),
579 /* retrying in PIO */ 571 /* retrying in PIO */
580 IDE_DFLAG_DMA_PIO_RETRY = (1 << 25), 572 IDE_DFLAG_DMA_PIO_RETRY = (1 << 24),
581 IDE_DFLAG_LBA = (1 << 26), 573 IDE_DFLAG_LBA = (1 << 25),
582 /* don't unload heads */ 574 /* don't unload heads */
583 IDE_DFLAG_NO_UNLOAD = (1 << 27), 575 IDE_DFLAG_NO_UNLOAD = (1 << 26),
584 /* heads unloaded, please don't reset port */ 576 /* heads unloaded, please don't reset port */
585 IDE_DFLAG_PARKED = (1 << 28), 577 IDE_DFLAG_PARKED = (1 << 27),
586 IDE_DFLAG_MEDIA_CHANGED = (1 << 29), 578 IDE_DFLAG_MEDIA_CHANGED = (1 << 28),
587 /* write protect */ 579 /* write protect */
588 IDE_DFLAG_WP = (1 << 30), 580 IDE_DFLAG_WP = (1 << 29),
589 IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 31), 581 IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30),
590}; 582};
591 583
592struct ide_drive_s { 584struct ide_drive_s {
@@ -610,8 +602,6 @@ struct ide_drive_s {
610 unsigned long dev_flags; 602 unsigned long dev_flags;
611 603
612 unsigned long sleep; /* sleep until this time */ 604 unsigned long sleep; /* sleep until this time */
613 unsigned long service_start; /* time we started last request */
614 unsigned long service_time; /* service time of last request */
615 unsigned long timeout; /* max time to wait for irq */ 605 unsigned long timeout; /* max time to wait for irq */
616 606
617 special_t special; /* special action flags */ 607 special_t special; /* special action flags */
@@ -879,8 +869,6 @@ typedef struct hwgroup_s {
879 869
880 /* BOOL: protects all fields below */ 870 /* BOOL: protects all fields below */
881 volatile int busy; 871 volatile int busy;
882 /* BOOL: wake us up on timer expiry */
883 unsigned int sleeping : 1;
884 /* BOOL: polling active & poll_timeout field valid */ 872 /* BOOL: polling active & poll_timeout field valid */
885 unsigned int polling : 1; 873 unsigned int polling : 1;
886 874
@@ -1258,14 +1246,11 @@ int ide_set_media_lock(ide_drive_t *, struct gendisk *, int);
1258void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *); 1246void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *);
1259void ide_retry_pc(ide_drive_t *, struct gendisk *); 1247void ide_retry_pc(ide_drive_t *, struct gendisk *);
1260 1248
1261static inline unsigned long ide_scsi_get_timeout(struct ide_atapi_pc *pc) 1249int ide_cd_expiry(ide_drive_t *);
1262{
1263 return max_t(unsigned long, WAIT_CMD, pc->timeout - jiffies);
1264}
1265 1250
1266int ide_scsi_expiry(ide_drive_t *); 1251int ide_cd_get_xferlen(struct request *);
1267 1252
1268ide_startstop_t ide_issue_pc(ide_drive_t *, unsigned int, ide_expiry_t *); 1253ide_startstop_t ide_issue_pc(ide_drive_t *);
1269 1254
1270ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); 1255ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *);
1271 1256
@@ -1287,6 +1272,26 @@ extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout);
1287 1272
1288extern void ide_timer_expiry(unsigned long); 1273extern void ide_timer_expiry(unsigned long);
1289extern irqreturn_t ide_intr(int irq, void *dev_id); 1274extern irqreturn_t ide_intr(int irq, void *dev_id);
1275
1276static inline int ide_lock_hwgroup(ide_hwgroup_t *hwgroup)
1277{
1278 if (hwgroup->busy)
1279 return 1;
1280
1281 hwgroup->busy = 1;
1282 /* for atari only */
1283 ide_get_lock(ide_intr, hwgroup);
1284
1285 return 0;
1286}
1287
1288static inline void ide_unlock_hwgroup(ide_hwgroup_t *hwgroup)
1289{
1290 /* for atari only */
1291 ide_release_lock();
1292 hwgroup->busy = 0;
1293}
1294
1290extern void do_ide_request(struct request_queue *); 1295extern void do_ide_request(struct request_queue *);
1291 1296
1292void ide_init_disk(struct gendisk *, ide_drive_t *); 1297void ide_init_disk(struct gendisk *, ide_drive_t *);
@@ -1533,6 +1538,7 @@ void ide_unregister_region(struct gendisk *);
1533void ide_undecoded_slave(ide_drive_t *); 1538void ide_undecoded_slave(ide_drive_t *);
1534 1539
1535void ide_port_apply_params(ide_hwif_t *); 1540void ide_port_apply_params(ide_hwif_t *);
1541int ide_sysfs_register_port(ide_hwif_t *);
1536 1542
1537struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **); 1543struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **);
1538void ide_host_free(struct ide_host *); 1544void ide_host_free(struct ide_host *);
@@ -1627,6 +1633,9 @@ extern struct mutex ide_cfg_mtx;
1627 1633
1628#define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0) 1634#define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0)
1629 1635
1636char *ide_media_string(ide_drive_t *);
1637
1638extern struct device_attribute ide_dev_attrs[];
1630extern struct bus_type ide_bus_type; 1639extern struct bus_type ide_bus_type;
1631extern struct class *ide_port_class; 1640extern struct class *ide_port_class;
1632 1641
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 959f5522d10a..2f3c2d4ef73b 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -12,6 +12,7 @@
12#include <net/net_namespace.h> 12#include <net/net_namespace.h>
13 13
14extern struct files_struct init_files; 14extern struct files_struct init_files;
15extern struct fs_struct init_fs;
15 16
16#define INIT_KIOCTX(name, which_mm) \ 17#define INIT_KIOCTX(name, which_mm) \
17{ \ 18{ \
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index 3d017cfd245b..c4f6c101dbcd 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -23,8 +23,6 @@
23#define _INTEL_IOMMU_H_ 23#define _INTEL_IOMMU_H_
24 24
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/msi.h>
27#include <linux/sysdev.h>
28#include <linux/iova.h> 26#include <linux/iova.h>
29#include <linux/io.h> 27#include <linux/io.h>
30#include <linux/dma_remapping.h> 28#include <linux/dma_remapping.h>
@@ -289,10 +287,10 @@ struct intel_iommu {
289 void __iomem *reg; /* Pointer to hardware regs, virtual addr */ 287 void __iomem *reg; /* Pointer to hardware regs, virtual addr */
290 u64 cap; 288 u64 cap;
291 u64 ecap; 289 u64 ecap;
292 int seg;
293 u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */ 290 u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */
294 spinlock_t register_lock; /* protect register handling */ 291 spinlock_t register_lock; /* protect register handling */
295 int seq_id; /* sequence id of the iommu */ 292 int seq_id; /* sequence id of the iommu */
293 int agaw; /* agaw of this iommu */
296 294
297#ifdef CONFIG_DMAR 295#ifdef CONFIG_DMAR
298 unsigned long *domain_ids; /* bitmap of domains */ 296 unsigned long *domain_ids; /* bitmap of domains */
@@ -302,8 +300,6 @@ struct intel_iommu {
302 300
303 unsigned int irq; 301 unsigned int irq;
304 unsigned char name[7]; /* Device Name */ 302 unsigned char name[7]; /* Device Name */
305 struct msi_msg saved_msg;
306 struct sys_device sysdev;
307 struct iommu_flush flush; 303 struct iommu_flush flush;
308#endif 304#endif
309 struct q_inval *qi; /* Queued invalidation info */ 305 struct q_inval *qi; /* Queued invalidation info */
@@ -334,25 +330,6 @@ extern int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,
334 330
335extern void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); 331extern void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
336 332
337void intel_iommu_domain_exit(struct dmar_domain *domain);
338struct dmar_domain *intel_iommu_domain_alloc(struct pci_dev *pdev);
339int intel_iommu_context_mapping(struct dmar_domain *domain,
340 struct pci_dev *pdev);
341int intel_iommu_page_mapping(struct dmar_domain *domain, dma_addr_t iova,
342 u64 hpa, size_t size, int prot);
343void intel_iommu_detach_dev(struct dmar_domain *domain, u8 bus, u8 devfn);
344struct dmar_domain *intel_iommu_find_domain(struct pci_dev *pdev);
345u64 intel_iommu_iova_to_pfn(struct dmar_domain *domain, u64 iova);
346
347#ifdef CONFIG_DMAR
348int intel_iommu_found(void);
349#else /* CONFIG_DMAR */
350static inline int intel_iommu_found(void)
351{
352 return 0;
353}
354#endif /* CONFIG_DMAR */
355
356extern void *intel_alloc_coherent(struct device *, size_t, dma_addr_t *, gfp_t); 333extern void *intel_alloc_coherent(struct device *, size_t, dma_addr_t *, gfp_t);
357extern void intel_free_coherent(struct device *, size_t, void *, dma_addr_t); 334extern void intel_free_coherent(struct device *, size_t, void *, dma_addr_t);
358extern dma_addr_t intel_map_single(struct device *, phys_addr_t, size_t, int); 335extern dma_addr_t intel_map_single(struct device *, phys_addr_t, size_t, int);
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 91f1ef8e5810..0702c4d7bdf0 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -464,4 +464,10 @@ static inline void init_irq_proc(void)
464 464
465int show_interrupts(struct seq_file *p, void *v); 465int show_interrupts(struct seq_file *p, void *v);
466 466
467struct irq_desc;
468
469extern int early_irq_init(void);
470extern int arch_early_irq_init(void);
471extern int arch_init_chip_data(struct irq_desc *desc, int cpu);
472
467#endif 473#endif
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
new file mode 100644
index 000000000000..8a7bfb1b6ca0
--- /dev/null
+++ b/include/linux/iommu.h
@@ -0,0 +1,112 @@
1/*
2 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __LINUX_IOMMU_H
20#define __LINUX_IOMMU_H
21
22#define IOMMU_READ (1)
23#define IOMMU_WRITE (2)
24
25struct device;
26
27struct iommu_domain {
28 void *priv;
29};
30
31struct iommu_ops {
32 int (*domain_init)(struct iommu_domain *domain);
33 void (*domain_destroy)(struct iommu_domain *domain);
34 int (*attach_dev)(struct iommu_domain *domain, struct device *dev);
35 void (*detach_dev)(struct iommu_domain *domain, struct device *dev);
36 int (*map)(struct iommu_domain *domain, unsigned long iova,
37 phys_addr_t paddr, size_t size, int prot);
38 void (*unmap)(struct iommu_domain *domain, unsigned long iova,
39 size_t size);
40 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain,
41 unsigned long iova);
42};
43
44#ifdef CONFIG_IOMMU_API
45
46extern void register_iommu(struct iommu_ops *ops);
47extern bool iommu_found(void);
48extern struct iommu_domain *iommu_domain_alloc(void);
49extern void iommu_domain_free(struct iommu_domain *domain);
50extern int iommu_attach_device(struct iommu_domain *domain,
51 struct device *dev);
52extern void iommu_detach_device(struct iommu_domain *domain,
53 struct device *dev);
54extern int iommu_map_range(struct iommu_domain *domain, unsigned long iova,
55 phys_addr_t paddr, size_t size, int prot);
56extern void iommu_unmap_range(struct iommu_domain *domain, unsigned long iova,
57 size_t size);
58extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
59 unsigned long iova);
60
61#else /* CONFIG_IOMMU_API */
62
63static inline void register_iommu(struct iommu_ops *ops)
64{
65}
66
67static inline bool iommu_found(void)
68{
69 return false;
70}
71
72static inline struct iommu_domain *iommu_domain_alloc(void)
73{
74 return NULL;
75}
76
77static inline void iommu_domain_free(struct iommu_domain *domain)
78{
79}
80
81static inline int iommu_attach_device(struct iommu_domain *domain,
82 struct device *dev)
83{
84 return -ENODEV;
85}
86
87static inline void iommu_detach_device(struct iommu_domain *domain,
88 struct device *dev)
89{
90}
91
92static inline int iommu_map_range(struct iommu_domain *domain,
93 unsigned long iova, phys_addr_t paddr,
94 size_t size, int prot)
95{
96 return -ENODEV;
97}
98
99static inline void iommu_unmap_range(struct iommu_domain *domain,
100 unsigned long iova, size_t size)
101{
102}
103
104static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
105 unsigned long iova)
106{
107 return 0;
108}
109
110#endif /* CONFIG_IOMMU_API */
111
112#endif /* __LINUX_IOMMU_H */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 5845bdc1ac09..f899b502f186 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -194,42 +194,23 @@ struct irq_desc {
194 const char *name; 194 const char *name;
195} ____cacheline_internodealigned_in_smp; 195} ____cacheline_internodealigned_in_smp;
196 196
197extern void early_irq_init(void);
198extern void arch_early_irq_init(void);
199extern void arch_init_chip_data(struct irq_desc *desc, int cpu);
200extern void arch_init_copy_chip_data(struct irq_desc *old_desc, 197extern void arch_init_copy_chip_data(struct irq_desc *old_desc,
201 struct irq_desc *desc, int cpu); 198 struct irq_desc *desc, int cpu);
202extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); 199extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc);
203 200
204#ifndef CONFIG_SPARSE_IRQ 201#ifndef CONFIG_SPARSE_IRQ
205extern struct irq_desc irq_desc[NR_IRQS]; 202extern struct irq_desc irq_desc[NR_IRQS];
206 203#else /* CONFIG_SPARSE_IRQ */
207static inline struct irq_desc *irq_to_desc(unsigned int irq)
208{
209 return (irq < NR_IRQS) ? irq_desc + irq : NULL;
210}
211static inline struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu)
212{
213 return irq_to_desc(irq);
214}
215
216#else
217
218extern struct irq_desc *irq_to_desc(unsigned int irq);
219extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
220extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); 204extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu);
221 205
222# define for_each_irq_desc(irq, desc) \
223 for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; irq++, desc = irq_to_desc(irq))
224# define for_each_irq_desc_reverse(irq, desc) \
225 for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; irq--, desc = irq_to_desc(irq))
226
227#define kstat_irqs_this_cpu(DESC) \ 206#define kstat_irqs_this_cpu(DESC) \
228 ((DESC)->kstat_irqs[smp_processor_id()]) 207 ((DESC)->kstat_irqs[smp_processor_id()])
229#define kstat_incr_irqs_this_cpu(irqno, DESC) \ 208#define kstat_incr_irqs_this_cpu(irqno, DESC) \
230 ((DESC)->kstat_irqs[smp_processor_id()]++) 209 ((DESC)->kstat_irqs[smp_processor_id()]++)
231 210
232#endif 211#endif /* CONFIG_SPARSE_IRQ */
212
213extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
233 214
234static inline struct irq_desc * 215static inline struct irq_desc *
235irq_remap_to_desc(unsigned int irq, struct irq_desc *desc) 216irq_remap_to_desc(unsigned int irq, struct irq_desc *desc)
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h
index 95d2b74641f5..5504a5c97836 100644
--- a/include/linux/irqnr.h
+++ b/include/linux/irqnr.h
@@ -15,20 +15,23 @@
15 15
16# define for_each_irq_desc_reverse(irq, desc) \ 16# define for_each_irq_desc_reverse(irq, desc) \
17 for (irq = nr_irqs - 1; irq >= 0; irq--) 17 for (irq = nr_irqs - 1; irq >= 0; irq--)
18#else 18#else /* CONFIG_GENERIC_HARDIRQS */
19 19
20extern int nr_irqs; 20extern int nr_irqs;
21extern struct irq_desc *irq_to_desc(unsigned int irq);
21 22
22#ifndef CONFIG_SPARSE_IRQ 23# define for_each_irq_desc(irq, desc) \
24 for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \
25 irq++, desc = irq_to_desc(irq)) \
26 if (desc)
23 27
24struct irq_desc; 28
25# define for_each_irq_desc(irq, desc) \ 29# define for_each_irq_desc_reverse(irq, desc) \
26 for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++) 30 for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \
27# define for_each_irq_desc_reverse(irq, desc) \ 31 irq--, desc = irq_to_desc(irq)) \
28 for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \ 32 if (desc)
29 irq >= 0; irq--, desc--) 33
30#endif 34#endif /* CONFIG_GENERIC_HARDIRQS */
31#endif
32 35
33#define for_each_irq_nr(irq) \ 36#define for_each_irq_nr(irq) \
34 for (irq = 0; irq < nr_irqs; irq++) 37 for (irq = 0; irq < nr_irqs; irq++)
diff --git a/include/linux/istallion.h b/include/linux/istallion.h
index 0d1840723249..7faca98c7d14 100644
--- a/include/linux/istallion.h
+++ b/include/linux/istallion.h
@@ -59,9 +59,7 @@ struct stliport {
59 unsigned int devnr; 59 unsigned int devnr;
60 int baud_base; 60 int baud_base;
61 int custom_divisor; 61 int custom_divisor;
62 int close_delay;
63 int closing_wait; 62 int closing_wait;
64 int openwaitcnt;
65 int rc; 63 int rc;
66 int argsize; 64 int argsize;
67 void *argp; 65 void *argp;
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 4ee4b3d2316f..570d20413119 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -79,10 +79,13 @@ static inline unsigned int kstat_irqs(unsigned int irq)
79} 79}
80 80
81extern unsigned long long task_delta_exec(struct task_struct *); 81extern unsigned long long task_delta_exec(struct task_struct *);
82extern void account_user_time(struct task_struct *, cputime_t); 82extern void account_user_time(struct task_struct *, cputime_t, cputime_t);
83extern void account_user_time_scaled(struct task_struct *, cputime_t); 83extern void account_system_time(struct task_struct *, int, cputime_t, cputime_t);
84extern void account_system_time(struct task_struct *, int, cputime_t); 84extern void account_steal_time(cputime_t);
85extern void account_system_time_scaled(struct task_struct *, cputime_t); 85extern void account_idle_time(cputime_t);
86extern void account_steal_time(struct task_struct *, cputime_t); 86
87extern void account_process_tick(struct task_struct *, int user);
88extern void account_steal_ticks(unsigned long ticks);
89extern void account_idle_ticks(unsigned long ticks);
87 90
88#endif /* _LINUX_KERNEL_STAT_H */ 91#endif /* _LINUX_KERNEL_STAT_H */
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index f18b86fa8655..35525ac63337 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -83,6 +83,7 @@ struct kvm_irqchip {
83#define KVM_EXIT_S390_SIEIC 13 83#define KVM_EXIT_S390_SIEIC 13
84#define KVM_EXIT_S390_RESET 14 84#define KVM_EXIT_S390_RESET 14
85#define KVM_EXIT_DCR 15 85#define KVM_EXIT_DCR 15
86#define KVM_EXIT_NMI 16
86 87
87/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ 88/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
88struct kvm_run { 89struct kvm_run {
@@ -387,6 +388,14 @@ struct kvm_trace_rec {
387#define KVM_CAP_DEVICE_ASSIGNMENT 17 388#define KVM_CAP_DEVICE_ASSIGNMENT 17
388#endif 389#endif
389#define KVM_CAP_IOMMU 18 390#define KVM_CAP_IOMMU 18
391#if defined(CONFIG_X86)
392#define KVM_CAP_DEVICE_MSI 20
393#endif
394/* Bug in KVM_SET_USER_MEMORY_REGION fixed: */
395#define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21
396#if defined(CONFIG_X86)
397#define KVM_CAP_USER_NMI 22
398#endif
390 399
391/* 400/*
392 * ioctls for VM fds 401 * ioctls for VM fds
@@ -458,6 +467,8 @@ struct kvm_trace_rec {
458#define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) 467#define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97)
459#define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) 468#define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state)
460#define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) 469#define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state)
470/* Available with KVM_CAP_NMI */
471#define KVM_NMI _IO(KVMIO, 0x9a)
461 472
462#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) 473#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
463#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) 474#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
@@ -500,10 +511,17 @@ struct kvm_assigned_irq {
500 __u32 guest_irq; 511 __u32 guest_irq;
501 __u32 flags; 512 __u32 flags;
502 union { 513 union {
514 struct {
515 __u32 addr_lo;
516 __u32 addr_hi;
517 __u32 data;
518 } guest_msi;
503 __u32 reserved[12]; 519 __u32 reserved[12];
504 }; 520 };
505}; 521};
506 522
507#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) 523#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
508 524
525#define KVM_DEV_IRQ_ASSIGN_ENABLE_MSI (1 << 0)
526
509#endif 527#endif
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index bb92be2153bc..ec49d0be7f52 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -16,6 +16,7 @@
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/preempt.h> 17#include <linux/preempt.h>
18#include <linux/marker.h> 18#include <linux/marker.h>
19#include <linux/msi.h>
19#include <asm/signal.h> 20#include <asm/signal.h>
20 21
21#include <linux/kvm.h> 22#include <linux/kvm.h>
@@ -306,9 +307,16 @@ struct kvm_assigned_dev_kernel {
306 int host_busnr; 307 int host_busnr;
307 int host_devfn; 308 int host_devfn;
308 int host_irq; 309 int host_irq;
310 bool host_irq_disabled;
309 int guest_irq; 311 int guest_irq;
310 int irq_requested; 312 struct msi_msg guest_msi;
313#define KVM_ASSIGNED_DEV_GUEST_INTX (1 << 0)
314#define KVM_ASSIGNED_DEV_GUEST_MSI (1 << 1)
315#define KVM_ASSIGNED_DEV_HOST_INTX (1 << 8)
316#define KVM_ASSIGNED_DEV_HOST_MSI (1 << 9)
317 unsigned long irq_requested_type;
311 int irq_source_id; 318 int irq_source_id;
319 int flags;
312 struct pci_dev *dev; 320 struct pci_dev *dev;
313 struct kvm *kvm; 321 struct kvm *kvm;
314}; 322};
@@ -316,18 +324,20 @@ void kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level);
316void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi); 324void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi);
317void kvm_register_irq_ack_notifier(struct kvm *kvm, 325void kvm_register_irq_ack_notifier(struct kvm *kvm,
318 struct kvm_irq_ack_notifier *kian); 326 struct kvm_irq_ack_notifier *kian);
319void kvm_unregister_irq_ack_notifier(struct kvm *kvm, 327void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian);
320 struct kvm_irq_ack_notifier *kian);
321int kvm_request_irq_source_id(struct kvm *kvm); 328int kvm_request_irq_source_id(struct kvm *kvm);
322void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); 329void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id);
323 330
324#ifdef CONFIG_DMAR 331#ifdef CONFIG_IOMMU_API
325int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn, 332int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn,
326 unsigned long npages); 333 unsigned long npages);
327int kvm_iommu_map_guest(struct kvm *kvm, 334int kvm_iommu_map_guest(struct kvm *kvm);
328 struct kvm_assigned_dev_kernel *assigned_dev);
329int kvm_iommu_unmap_guest(struct kvm *kvm); 335int kvm_iommu_unmap_guest(struct kvm *kvm);
330#else /* CONFIG_DMAR */ 336int kvm_assign_device(struct kvm *kvm,
337 struct kvm_assigned_dev_kernel *assigned_dev);
338int kvm_deassign_device(struct kvm *kvm,
339 struct kvm_assigned_dev_kernel *assigned_dev);
340#else /* CONFIG_IOMMU_API */
331static inline int kvm_iommu_map_pages(struct kvm *kvm, 341static inline int kvm_iommu_map_pages(struct kvm *kvm,
332 gfn_t base_gfn, 342 gfn_t base_gfn,
333 unsigned long npages) 343 unsigned long npages)
@@ -335,9 +345,7 @@ static inline int kvm_iommu_map_pages(struct kvm *kvm,
335 return 0; 345 return 0;
336} 346}
337 347
338static inline int kvm_iommu_map_guest(struct kvm *kvm, 348static inline int kvm_iommu_map_guest(struct kvm *kvm)
339 struct kvm_assigned_dev_kernel
340 *assigned_dev)
341{ 349{
342 return -ENODEV; 350 return -ENODEV;
343} 351}
@@ -346,7 +354,19 @@ static inline int kvm_iommu_unmap_guest(struct kvm *kvm)
346{ 354{
347 return 0; 355 return 0;
348} 356}
349#endif /* CONFIG_DMAR */ 357
358static inline int kvm_assign_device(struct kvm *kvm,
359 struct kvm_assigned_dev_kernel *assigned_dev)
360{
361 return 0;
362}
363
364static inline int kvm_deassign_device(struct kvm *kvm,
365 struct kvm_assigned_dev_kernel *assigned_dev)
366{
367 return 0;
368}
369#endif /* CONFIG_IOMMU_API */
350 370
351static inline void kvm_guest_enter(void) 371static inline void kvm_guest_enter(void)
352{ 372{
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 143cebf0586f..7ac8b500d55c 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -151,4 +151,6 @@ static inline void mmc_claim_host(struct mmc_host *host)
151 __mmc_claim_host(host, NULL); 151 __mmc_claim_host(host, NULL);
152} 152}
153 153
154extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
155
154#endif 156#endif
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index f842f234e44f..4e457256bd33 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -41,6 +41,7 @@ struct mmc_ios {
41 41
42#define MMC_BUS_WIDTH_1 0 42#define MMC_BUS_WIDTH_1 0
43#define MMC_BUS_WIDTH_4 2 43#define MMC_BUS_WIDTH_4 2
44#define MMC_BUS_WIDTH_8 3
44 45
45 unsigned char timing; /* timing specification used */ 46 unsigned char timing; /* timing specification used */
46 47
@@ -116,6 +117,7 @@ struct mmc_host {
116#define MMC_CAP_SDIO_IRQ (1 << 3) /* Can signal pending SDIO IRQs */ 117#define MMC_CAP_SDIO_IRQ (1 << 3) /* Can signal pending SDIO IRQs */
117#define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ 118#define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */
118#define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ 119#define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */
120#define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */
119 121
120 /* host specific block data */ 122 /* host specific block data */
121 unsigned int max_seg_size; /* see blk_queue_max_segment_size */ 123 unsigned int max_seg_size; /* see blk_queue_max_segment_size */
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 99eb80306dc5..fc2e03579877 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -94,4 +94,9 @@ static inline char *nd_get_link(struct nameidata *nd)
94 return nd->saved_names[nd->depth]; 94 return nd->saved_names[nd->depth];
95} 95}
96 96
97static inline void nd_terminate_link(void *name, size_t len, size_t maxlen)
98{
99 ((char *) name)[min(len, maxlen)] = '\0';
100}
101
97#endif /* _LINUX_NAMEI_H */ 102#endif /* _LINUX_NAMEI_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index b6e694454280..218c73b1e6d4 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1766,6 +1766,7 @@
1766#define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081 1766#define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081
1767#define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082 1767#define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082
1768#define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 1768#define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050
1769#define PCI_SUBDEVICE_ID_SIIG_DUAL_SERIAL 0x2530
1769 1770
1770#define PCI_VENDOR_ID_RADISYS 0x1331 1771#define PCI_VENDOR_ID_RADISYS 0x1331
1771 1772
@@ -1795,6 +1796,7 @@
1795#define PCI_DEVICE_ID_SEALEVEL_UCOMM232 0x7202 1796#define PCI_DEVICE_ID_SEALEVEL_UCOMM232 0x7202
1796#define PCI_DEVICE_ID_SEALEVEL_COMM4 0x7401 1797#define PCI_DEVICE_ID_SEALEVEL_COMM4 0x7401
1797#define PCI_DEVICE_ID_SEALEVEL_COMM8 0x7801 1798#define PCI_DEVICE_ID_SEALEVEL_COMM8 0x7801
1799#define PCI_DEVICE_ID_SEALEVEL_7803 0x7803
1798#define PCI_DEVICE_ID_SEALEVEL_UCOMM8 0x7804 1800#define PCI_DEVICE_ID_SEALEVEL_UCOMM8 0x7804
1799 1801
1800#define PCI_VENDOR_ID_HYPERCOPE 0x1365 1802#define PCI_VENDOR_ID_HYPERCOPE 0x1365
diff --git a/include/linux/random.h b/include/linux/random.h
index adbf3bd3c6b3..407ea3646f8f 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -45,56 +45,6 @@ struct rand_pool_info {
45 45
46extern void rand_initialize_irq(int irq); 46extern void rand_initialize_irq(int irq);
47 47
48struct timer_rand_state;
49#ifndef CONFIG_SPARSE_IRQ
50
51extern struct timer_rand_state *irq_timer_state[];
52
53static inline struct timer_rand_state *get_timer_rand_state(unsigned int irq)
54{
55 if (irq >= nr_irqs)
56 return NULL;
57
58 return irq_timer_state[irq];
59}
60
61static inline void set_timer_rand_state(unsigned int irq, struct timer_rand_state *state)
62{
63 if (irq >= nr_irqs)
64 return;
65
66 irq_timer_state[irq] = state;
67}
68
69#else
70
71#include <linux/irq.h>
72static inline struct timer_rand_state *get_timer_rand_state(unsigned int irq)
73{
74 struct irq_desc *desc;
75
76 desc = irq_to_desc(irq);
77
78 if (!desc)
79 return NULL;
80
81 return desc->timer_rand_state;
82}
83
84static inline void set_timer_rand_state(unsigned int irq, struct timer_rand_state *state)
85{
86 struct irq_desc *desc;
87
88 desc = irq_to_desc(irq);
89
90 if (!desc)
91 return;
92
93 desc->timer_rand_state = state;
94}
95#endif
96
97
98extern void add_input_randomness(unsigned int type, unsigned int code, 48extern void add_input_randomness(unsigned int type, unsigned int code,
99 unsigned int value); 49 unsigned int value);
100extern void add_interrupt_randomness(int irq); 50extern void add_interrupt_randomness(int irq);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 158d53d07765..38a3f4b15394 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -284,7 +284,6 @@ long io_schedule_timeout(long timeout);
284 284
285extern void cpu_init (void); 285extern void cpu_init (void);
286extern void trap_init(void); 286extern void trap_init(void);
287extern void account_process_tick(struct task_struct *task, int user);
288extern void update_process_times(int user); 287extern void update_process_times(int user);
289extern void scheduler_tick(void); 288extern void scheduler_tick(void);
290 289
diff --git a/include/linux/security.h b/include/linux/security.h
index 3416cb85e77b..b92b5e453f64 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -335,17 +335,37 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
335 * @dir contains the inode structure of the parent directory of the new link. 335 * @dir contains the inode structure of the parent directory of the new link.
336 * @new_dentry contains the dentry structure for the new link. 336 * @new_dentry contains the dentry structure for the new link.
337 * Return 0 if permission is granted. 337 * Return 0 if permission is granted.
338 * @path_link:
339 * Check permission before creating a new hard link to a file.
340 * @old_dentry contains the dentry structure for an existing link
341 * to the file.
342 * @new_dir contains the path structure of the parent directory of
343 * the new link.
344 * @new_dentry contains the dentry structure for the new link.
345 * Return 0 if permission is granted.
338 * @inode_unlink: 346 * @inode_unlink:
339 * Check the permission to remove a hard link to a file. 347 * Check the permission to remove a hard link to a file.
340 * @dir contains the inode structure of parent directory of the file. 348 * @dir contains the inode structure of parent directory of the file.
341 * @dentry contains the dentry structure for file to be unlinked. 349 * @dentry contains the dentry structure for file to be unlinked.
342 * Return 0 if permission is granted. 350 * Return 0 if permission is granted.
351 * @path_unlink:
352 * Check the permission to remove a hard link to a file.
353 * @dir contains the path structure of parent directory of the file.
354 * @dentry contains the dentry structure for file to be unlinked.
355 * Return 0 if permission is granted.
343 * @inode_symlink: 356 * @inode_symlink:
344 * Check the permission to create a symbolic link to a file. 357 * Check the permission to create a symbolic link to a file.
345 * @dir contains the inode structure of parent directory of the symbolic link. 358 * @dir contains the inode structure of parent directory of the symbolic link.
346 * @dentry contains the dentry structure of the symbolic link. 359 * @dentry contains the dentry structure of the symbolic link.
347 * @old_name contains the pathname of file. 360 * @old_name contains the pathname of file.
348 * Return 0 if permission is granted. 361 * Return 0 if permission is granted.
362 * @path_symlink:
363 * Check the permission to create a symbolic link to a file.
364 * @dir contains the path structure of parent directory of
365 * the symbolic link.
366 * @dentry contains the dentry structure of the symbolic link.
367 * @old_name contains the pathname of file.
368 * Return 0 if permission is granted.
349 * @inode_mkdir: 369 * @inode_mkdir:
350 * Check permissions to create a new directory in the existing directory 370 * Check permissions to create a new directory in the existing directory
351 * associated with inode strcture @dir. 371 * associated with inode strcture @dir.
@@ -353,11 +373,25 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
353 * @dentry contains the dentry structure of new directory. 373 * @dentry contains the dentry structure of new directory.
354 * @mode contains the mode of new directory. 374 * @mode contains the mode of new directory.
355 * Return 0 if permission is granted. 375 * Return 0 if permission is granted.
376 * @path_mkdir:
377 * Check permissions to create a new directory in the existing directory
378 * associated with path strcture @path.
379 * @dir containst the path structure of parent of the directory
380 * to be created.
381 * @dentry contains the dentry structure of new directory.
382 * @mode contains the mode of new directory.
383 * Return 0 if permission is granted.
356 * @inode_rmdir: 384 * @inode_rmdir:
357 * Check the permission to remove a directory. 385 * Check the permission to remove a directory.
358 * @dir contains the inode structure of parent of the directory to be removed. 386 * @dir contains the inode structure of parent of the directory to be removed.
359 * @dentry contains the dentry structure of directory to be removed. 387 * @dentry contains the dentry structure of directory to be removed.
360 * Return 0 if permission is granted. 388 * Return 0 if permission is granted.
389 * @path_rmdir:
390 * Check the permission to remove a directory.
391 * @dir contains the path structure of parent of the directory to be
392 * removed.
393 * @dentry contains the dentry structure of directory to be removed.
394 * Return 0 if permission is granted.
361 * @inode_mknod: 395 * @inode_mknod:
362 * Check permissions when creating a special file (or a socket or a fifo 396 * Check permissions when creating a special file (or a socket or a fifo
363 * file created via the mknod system call). Note that if mknod operation 397 * file created via the mknod system call). Note that if mknod operation
@@ -368,6 +402,15 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
368 * @mode contains the mode of the new file. 402 * @mode contains the mode of the new file.
369 * @dev contains the device number. 403 * @dev contains the device number.
370 * Return 0 if permission is granted. 404 * Return 0 if permission is granted.
405 * @path_mknod:
406 * Check permissions when creating a file. Note that this hook is called
407 * even if mknod operation is being done for a regular file.
408 * @dir contains the path structure of parent of the new file.
409 * @dentry contains the dentry structure of the new file.
410 * @mode contains the mode of the new file.
411 * @dev contains the undecoded device number. Use new_decode_dev() to get
412 * the decoded device number.
413 * Return 0 if permission is granted.
371 * @inode_rename: 414 * @inode_rename:
372 * Check for permission to rename a file or directory. 415 * Check for permission to rename a file or directory.
373 * @old_dir contains the inode structure for parent of the old link. 416 * @old_dir contains the inode structure for parent of the old link.
@@ -375,6 +418,13 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
375 * @new_dir contains the inode structure for parent of the new link. 418 * @new_dir contains the inode structure for parent of the new link.
376 * @new_dentry contains the dentry structure of the new link. 419 * @new_dentry contains the dentry structure of the new link.
377 * Return 0 if permission is granted. 420 * Return 0 if permission is granted.
421 * @path_rename:
422 * Check for permission to rename a file or directory.
423 * @old_dir contains the path structure for parent of the old link.
424 * @old_dentry contains the dentry structure of the old link.
425 * @new_dir contains the path structure for parent of the new link.
426 * @new_dentry contains the dentry structure of the new link.
427 * Return 0 if permission is granted.
378 * @inode_readlink: 428 * @inode_readlink:
379 * Check the permission to read the symbolic link. 429 * Check the permission to read the symbolic link.
380 * @dentry contains the dentry structure for the file link. 430 * @dentry contains the dentry structure for the file link.
@@ -403,6 +453,12 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
403 * @dentry contains the dentry structure for the file. 453 * @dentry contains the dentry structure for the file.
404 * @attr is the iattr structure containing the new file attributes. 454 * @attr is the iattr structure containing the new file attributes.
405 * Return 0 if permission is granted. 455 * Return 0 if permission is granted.
456 * @path_truncate:
457 * Check permission before truncating a file.
458 * @path contains the path structure for the file.
459 * @length is the new length of the file.
460 * @time_attrs is the flags passed to do_truncate().
461 * Return 0 if permission is granted.
406 * @inode_getattr: 462 * @inode_getattr:
407 * Check permission before obtaining file attributes. 463 * Check permission before obtaining file attributes.
408 * @mnt is the vfsmount where the dentry was looked up 464 * @mnt is the vfsmount where the dentry was looked up
@@ -1331,6 +1387,22 @@ struct security_operations {
1331 struct super_block *newsb); 1387 struct super_block *newsb);
1332 int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts); 1388 int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts);
1333 1389
1390#ifdef CONFIG_SECURITY_PATH
1391 int (*path_unlink) (struct path *dir, struct dentry *dentry);
1392 int (*path_mkdir) (struct path *dir, struct dentry *dentry, int mode);
1393 int (*path_rmdir) (struct path *dir, struct dentry *dentry);
1394 int (*path_mknod) (struct path *dir, struct dentry *dentry, int mode,
1395 unsigned int dev);
1396 int (*path_truncate) (struct path *path, loff_t length,
1397 unsigned int time_attrs);
1398 int (*path_symlink) (struct path *dir, struct dentry *dentry,
1399 const char *old_name);
1400 int (*path_link) (struct dentry *old_dentry, struct path *new_dir,
1401 struct dentry *new_dentry);
1402 int (*path_rename) (struct path *old_dir, struct dentry *old_dentry,
1403 struct path *new_dir, struct dentry *new_dentry);
1404#endif
1405
1334 int (*inode_alloc_security) (struct inode *inode); 1406 int (*inode_alloc_security) (struct inode *inode);
1335 void (*inode_free_security) (struct inode *inode); 1407 void (*inode_free_security) (struct inode *inode);
1336 int (*inode_init_security) (struct inode *inode, struct inode *dir, 1408 int (*inode_init_security) (struct inode *inode, struct inode *dir,
@@ -2705,6 +2777,71 @@ static inline void security_skb_classify_flow(struct sk_buff *skb, struct flowi
2705 2777
2706#endif /* CONFIG_SECURITY_NETWORK_XFRM */ 2778#endif /* CONFIG_SECURITY_NETWORK_XFRM */
2707 2779
2780#ifdef CONFIG_SECURITY_PATH
2781int security_path_unlink(struct path *dir, struct dentry *dentry);
2782int security_path_mkdir(struct path *dir, struct dentry *dentry, int mode);
2783int security_path_rmdir(struct path *dir, struct dentry *dentry);
2784int security_path_mknod(struct path *dir, struct dentry *dentry, int mode,
2785 unsigned int dev);
2786int security_path_truncate(struct path *path, loff_t length,
2787 unsigned int time_attrs);
2788int security_path_symlink(struct path *dir, struct dentry *dentry,
2789 const char *old_name);
2790int security_path_link(struct dentry *old_dentry, struct path *new_dir,
2791 struct dentry *new_dentry);
2792int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
2793 struct path *new_dir, struct dentry *new_dentry);
2794#else /* CONFIG_SECURITY_PATH */
2795static inline int security_path_unlink(struct path *dir, struct dentry *dentry)
2796{
2797 return 0;
2798}
2799
2800static inline int security_path_mkdir(struct path *dir, struct dentry *dentry,
2801 int mode)
2802{
2803 return 0;
2804}
2805
2806static inline int security_path_rmdir(struct path *dir, struct dentry *dentry)
2807{
2808 return 0;
2809}
2810
2811static inline int security_path_mknod(struct path *dir, struct dentry *dentry,
2812 int mode, unsigned int dev)
2813{
2814 return 0;
2815}
2816
2817static inline int security_path_truncate(struct path *path, loff_t length,
2818 unsigned int time_attrs)
2819{
2820 return 0;
2821}
2822
2823static inline int security_path_symlink(struct path *dir, struct dentry *dentry,
2824 const char *old_name)
2825{
2826 return 0;
2827}
2828
2829static inline int security_path_link(struct dentry *old_dentry,
2830 struct path *new_dir,
2831 struct dentry *new_dentry)
2832{
2833 return 0;
2834}
2835
2836static inline int security_path_rename(struct path *old_dir,
2837 struct dentry *old_dentry,
2838 struct path *new_dir,
2839 struct dentry *new_dentry)
2840{
2841 return 0;
2842}
2843#endif /* CONFIG_SECURITY_PATH */
2844
2708#ifdef CONFIG_KEYS 2845#ifdef CONFIG_KEYS
2709#ifdef CONFIG_SECURITY 2846#ifdef CONFIG_SECURITY
2710 2847
diff --git a/include/linux/serial.h b/include/linux/serial.h
index 1ea8d9265bf6..9136cc5608c3 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -10,8 +10,9 @@
10#ifndef _LINUX_SERIAL_H 10#ifndef _LINUX_SERIAL_H
11#define _LINUX_SERIAL_H 11#define _LINUX_SERIAL_H
12 12
13#ifdef __KERNEL__
14#include <linux/types.h> 13#include <linux/types.h>
14
15#ifdef __KERNEL__
15#include <asm/page.h> 16#include <asm/page.h>
16 17
17/* 18/*
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 3d37c94abbc8..d4d2a78ad43e 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -28,6 +28,9 @@ struct plat_serial8250_port {
28 unsigned char iotype; /* UPIO_* */ 28 unsigned char iotype; /* UPIO_* */
29 unsigned char hub6; 29 unsigned char hub6;
30 upf_t flags; /* UPF_* flags */ 30 upf_t flags; /* UPF_* flags */
31 unsigned int type; /* If UPF_FIXED_TYPE */
32 unsigned int (*serial_in)(struct uart_port *, int);
33 void (*serial_out)(struct uart_port *, int, int);
31}; 34};
32 35
33/* 36/*
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index feb3b939ec4b..b4199841f1fc 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -40,7 +40,8 @@
40#define PORT_NS16550A 14 40#define PORT_NS16550A 14
41#define PORT_XSCALE 15 41#define PORT_XSCALE 15
42#define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ 42#define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */
43#define PORT_MAX_8250 16 /* max port ID */ 43#define PORT_OCTEON 17 /* Cavium OCTEON internal UART */
44#define PORT_MAX_8250 17 /* max port ID */
44 45
45/* 46/*
46 * ARM specific type numbers. These are not currently guaranteed 47 * ARM specific type numbers. These are not currently guaranteed
@@ -248,6 +249,8 @@ struct uart_port {
248 spinlock_t lock; /* port lock */ 249 spinlock_t lock; /* port lock */
249 unsigned long iobase; /* in/out[bwl] */ 250 unsigned long iobase; /* in/out[bwl] */
250 unsigned char __iomem *membase; /* read/write[bwl] */ 251 unsigned char __iomem *membase; /* read/write[bwl] */
252 unsigned int (*serial_in)(struct uart_port *, int);
253 void (*serial_out)(struct uart_port *, int, int);
251 unsigned int irq; /* irq number */ 254 unsigned int irq; /* irq number */
252 unsigned int uartclk; /* base uart clock */ 255 unsigned int uartclk; /* base uart clock */
253 unsigned int fifosize; /* tx fifo size */ 256 unsigned int fifosize; /* tx fifo size */
@@ -293,6 +296,8 @@ struct uart_port {
293#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) 296#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16))
294#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) 297#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
295#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) 298#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
299/* The exact UART type is known and should not be probed. */
300#define UPF_FIXED_TYPE ((__force upf_t) (1 << 27))
296#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) 301#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
297#define UPF_FIXED_PORT ((__force upf_t) (1 << 29)) 302#define UPF_FIXED_PORT ((__force upf_t) (1 << 29))
298#define UPF_DEAD ((__force upf_t) (1 << 30)) 303#define UPF_DEAD ((__force upf_t) (1 << 30))
@@ -316,35 +321,13 @@ struct uart_port {
316}; 321};
317 322
318/* 323/*
319 * This is the state information which is persistent across opens.
320 * The low level driver must not to touch any elements contained
321 * within.
322 */
323struct uart_state {
324 unsigned int close_delay; /* msec */
325 unsigned int closing_wait; /* msec */
326
327#define USF_CLOSING_WAIT_INF (0)
328#define USF_CLOSING_WAIT_NONE (~0U)
329
330 int count;
331 int pm_state;
332 struct uart_info *info;
333 struct uart_port *port;
334
335 struct mutex mutex;
336};
337
338#define UART_XMIT_SIZE PAGE_SIZE
339
340typedef unsigned int __bitwise__ uif_t;
341
342/*
343 * This is the state information which is only valid when the port 324 * This is the state information which is only valid when the port
344 * is open; it may be freed by the core driver once the device has 325 * is open; it may be cleared the core driver once the device has
345 * been closed. Either the low level driver or the core can modify 326 * been closed. Either the low level driver or the core can modify
346 * stuff here. 327 * stuff here.
347 */ 328 */
329typedef unsigned int __bitwise__ uif_t;
330
348struct uart_info { 331struct uart_info {
349 struct tty_port port; 332 struct tty_port port;
350 struct circ_buf xmit; 333 struct circ_buf xmit;
@@ -366,6 +349,29 @@ struct uart_info {
366 wait_queue_head_t delta_msr_wait; 349 wait_queue_head_t delta_msr_wait;
367}; 350};
368 351
352/*
353 * This is the state information which is persistent across opens.
354 * The low level driver must not to touch any elements contained
355 * within.
356 */
357struct uart_state {
358 unsigned int close_delay; /* msec */
359 unsigned int closing_wait; /* msec */
360
361#define USF_CLOSING_WAIT_INF (0)
362#define USF_CLOSING_WAIT_NONE (~0U)
363
364 int count;
365 int pm_state;
366 struct uart_info info;
367 struct uart_port *port;
368
369 struct mutex mutex;
370};
371
372#define UART_XMIT_SIZE PAGE_SIZE
373
374
369/* number of characters left in xmit buffer before we ask for more */ 375/* number of characters left in xmit buffer before we ask for more */
370#define WAKEUP_CHARS 256 376#define WAKEUP_CHARS 256
371 377
@@ -439,8 +445,13 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port);
439#define uart_circ_chars_free(circ) \ 445#define uart_circ_chars_free(circ) \
440 (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE)) 446 (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE))
441 447
442#define uart_tx_stopped(portp) \ 448static inline int uart_tx_stopped(struct uart_port *port)
443 ((portp)->info->port.tty->stopped || (portp)->info->port.tty->hw_stopped) 449{
450 struct tty_struct *tty = port->info->port.tty;
451 if(tty->stopped || tty->hw_stopped)
452 return 1;
453 return 0;
454}
444 455
445/* 456/*
446 * The following are helper functions for the low level drivers. 457 * The following are helper functions for the low level drivers.
@@ -451,7 +462,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
451#ifdef SUPPORT_SYSRQ 462#ifdef SUPPORT_SYSRQ
452 if (port->sysrq) { 463 if (port->sysrq) {
453 if (ch && time_before(jiffies, port->sysrq)) { 464 if (ch && time_before(jiffies, port->sysrq)) {
454 handle_sysrq(ch, port->info ? port->info->port.tty : NULL); 465 handle_sysrq(ch, port->info->port.tty);
455 port->sysrq = 0; 466 port->sysrq = 0;
456 return 1; 467 return 1;
457 } 468 }
diff --git a/include/linux/spi/mmc_spi.h b/include/linux/spi/mmc_spi.h
index a3626aedaec9..0f4eb165f254 100644
--- a/include/linux/spi/mmc_spi.h
+++ b/include/linux/spi/mmc_spi.h
@@ -1,9 +1,10 @@
1#ifndef __LINUX_SPI_MMC_SPI_H 1#ifndef __LINUX_SPI_MMC_SPI_H
2#define __LINUX_SPI_MMC_SPI_H 2#define __LINUX_SPI_MMC_SPI_H
3 3
4#include <linux/device.h>
5#include <linux/spi/spi.h>
4#include <linux/interrupt.h> 6#include <linux/interrupt.h>
5 7
6struct device;
7struct mmc_host; 8struct mmc_host;
8 9
9/* Put this in platform_data of a device being used to manage an MMC/SD 10/* Put this in platform_data of a device being used to manage an MMC/SD
@@ -41,4 +42,16 @@ struct mmc_spi_platform_data {
41 void (*setpower)(struct device *, unsigned int maskval); 42 void (*setpower)(struct device *, unsigned int maskval);
42}; 43};
43 44
45#ifdef CONFIG_OF
46extern struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi);
47extern void mmc_spi_put_pdata(struct spi_device *spi);
48#else
49static inline struct mmc_spi_platform_data *
50mmc_spi_get_pdata(struct spi_device *spi)
51{
52 return spi->dev.platform_data;
53}
54static inline void mmc_spi_put_pdata(struct spi_device *spi) {}
55#endif /* CONFIG_OF */
56
44#endif /* __LINUX_SPI_MMC_SPI_H */ 57#endif /* __LINUX_SPI_MMC_SPI_H */
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 3f4954c55e53..fc39db95499f 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -180,8 +180,17 @@ struct signal_struct;
180 * until a hangup so don't use the wrong path. 180 * until a hangup so don't use the wrong path.
181 */ 181 */
182 182
183struct tty_port;
184
185struct tty_port_operations {
186 /* Return 1 if the carrier is raised */
187 int (*carrier_raised)(struct tty_port *port);
188 void (*raise_dtr_rts)(struct tty_port *port);
189};
190
183struct tty_port { 191struct tty_port {
184 struct tty_struct *tty; /* Back pointer */ 192 struct tty_struct *tty; /* Back pointer */
193 const struct tty_port_operations *ops; /* Port operations */
185 spinlock_t lock; /* Lock protecting tty field */ 194 spinlock_t lock; /* Lock protecting tty field */
186 int blocked_open; /* Waiting to open */ 195 int blocked_open; /* Waiting to open */
187 int count; /* Usage count */ 196 int count; /* Usage count */
@@ -253,6 +262,7 @@ struct tty_struct {
253 unsigned int column; 262 unsigned int column;
254 unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1; 263 unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1;
255 unsigned char closing:1; 264 unsigned char closing:1;
265 unsigned char echo_overrun:1;
256 unsigned short minimum_to_wake; 266 unsigned short minimum_to_wake;
257 unsigned long overrun_time; 267 unsigned long overrun_time;
258 int num_overrun; 268 int num_overrun;
@@ -262,11 +272,16 @@ struct tty_struct {
262 int read_tail; 272 int read_tail;
263 int read_cnt; 273 int read_cnt;
264 unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))]; 274 unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))];
275 unsigned char *echo_buf;
276 unsigned int echo_pos;
277 unsigned int echo_cnt;
265 int canon_data; 278 int canon_data;
266 unsigned long canon_head; 279 unsigned long canon_head;
267 unsigned int canon_column; 280 unsigned int canon_column;
268 struct mutex atomic_read_lock; 281 struct mutex atomic_read_lock;
269 struct mutex atomic_write_lock; 282 struct mutex atomic_write_lock;
283 struct mutex output_lock;
284 struct mutex echo_lock;
270 unsigned char *write_buf; 285 unsigned char *write_buf;
271 int write_cnt; 286 int write_cnt;
272 spinlock_t read_lock; 287 spinlock_t read_lock;
@@ -295,6 +310,7 @@ struct tty_struct {
295#define TTY_PUSH 6 /* n_tty private */ 310#define TTY_PUSH 6 /* n_tty private */
296#define TTY_CLOSING 7 /* ->close() in progress */ 311#define TTY_CLOSING 7 /* ->close() in progress */
297#define TTY_LDISC 9 /* Line discipline attached */ 312#define TTY_LDISC 9 /* Line discipline attached */
313#define TTY_LDISC_CHANGING 10 /* Line discipline changing */
298#define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ 314#define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */
299#define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ 315#define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */
300#define TTY_PTY_LOCK 16 /* pty private */ 316#define TTY_PTY_LOCK 16 /* pty private */
@@ -354,8 +370,7 @@ extern int tty_write_room(struct tty_struct *tty);
354extern void tty_driver_flush_buffer(struct tty_struct *tty); 370extern void tty_driver_flush_buffer(struct tty_struct *tty);
355extern void tty_throttle(struct tty_struct *tty); 371extern void tty_throttle(struct tty_struct *tty);
356extern void tty_unthrottle(struct tty_struct *tty); 372extern void tty_unthrottle(struct tty_struct *tty);
357extern int tty_do_resize(struct tty_struct *tty, struct tty_struct *real_tty, 373extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws);
358 struct winsize *ws);
359extern void tty_shutdown(struct tty_struct *tty); 374extern void tty_shutdown(struct tty_struct *tty);
360extern void tty_free_termios(struct tty_struct *tty); 375extern void tty_free_termios(struct tty_struct *tty);
361extern int is_current_pgrp_orphaned(void); 376extern int is_current_pgrp_orphaned(void);
@@ -421,6 +436,14 @@ extern int tty_port_alloc_xmit_buf(struct tty_port *port);
421extern void tty_port_free_xmit_buf(struct tty_port *port); 436extern void tty_port_free_xmit_buf(struct tty_port *port);
422extern struct tty_struct *tty_port_tty_get(struct tty_port *port); 437extern struct tty_struct *tty_port_tty_get(struct tty_port *port);
423extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); 438extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty);
439extern int tty_port_carrier_raised(struct tty_port *port);
440extern void tty_port_raise_dtr_rts(struct tty_port *port);
441extern void tty_port_hangup(struct tty_port *port);
442extern int tty_port_block_til_ready(struct tty_port *port,
443 struct tty_struct *tty, struct file *filp);
444extern int tty_port_close_start(struct tty_port *port,
445 struct tty_struct *tty, struct file *filp);
446extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty);
424 447
425extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); 448extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc);
426extern int tty_unregister_ldisc(int disc); 449extern int tty_unregister_ldisc(int disc);
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 78416b901589..08e088334dba 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -196,8 +196,7 @@
196 * Optional: If not provided then the write method is called under 196 * Optional: If not provided then the write method is called under
197 * the atomic write lock to keep it serialized with the ldisc. 197 * the atomic write lock to keep it serialized with the ldisc.
198 * 198 *
199 * int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, 199 * int (*resize)(struct tty_struct *tty, struct winsize *ws)
200 * unsigned int rows, unsigned int cols);
201 * 200 *
202 * Called when a termios request is issued which changes the 201 * Called when a termios request is issued which changes the
203 * requested terminal geometry. 202 * requested terminal geometry.
@@ -258,8 +257,7 @@ struct tty_operations {
258 int (*tiocmget)(struct tty_struct *tty, struct file *file); 257 int (*tiocmget)(struct tty_struct *tty, struct file *file);
259 int (*tiocmset)(struct tty_struct *tty, struct file *file, 258 int (*tiocmset)(struct tty_struct *tty, struct file *file,
260 unsigned int set, unsigned int clear); 259 unsigned int set, unsigned int clear);
261 int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, 260 int (*resize)(struct tty_struct *tty, struct winsize *ws);
262 struct winsize *ws);
263 int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew); 261 int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew);
264#ifdef CONFIG_CONSOLE_POLL 262#ifdef CONFIG_CONSOLE_POLL
265 int (*poll_init)(struct tty_driver *driver, int line, char *options); 263 int (*poll_init)(struct tty_driver *driver, int line, char *options);
diff --git a/include/linux/usb/wusb-wa.h b/include/linux/usb/wusb-wa.h
index a102561e7026..fb7c359bdfba 100644
--- a/include/linux/usb/wusb-wa.h
+++ b/include/linux/usb/wusb-wa.h
@@ -51,6 +51,7 @@ enum {
51 WUSB_REQ_GET_TIME = 25, 51 WUSB_REQ_GET_TIME = 25,
52 WUSB_REQ_SET_STREAM_IDX = 26, 52 WUSB_REQ_SET_STREAM_IDX = 26,
53 WUSB_REQ_SET_WUSB_MAS = 27, 53 WUSB_REQ_SET_WUSB_MAS = 27,
54 WUSB_REQ_CHAN_STOP = 28,
54}; 55};
55 56
56 57
diff --git a/include/linux/uwb.h b/include/linux/uwb.h
index f9ccbd9a2ced..c02128991ff7 100644
--- a/include/linux/uwb.h
+++ b/include/linux/uwb.h
@@ -30,6 +30,7 @@
30#include <linux/device.h> 30#include <linux/device.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/timer.h> 32#include <linux/timer.h>
33#include <linux/wait.h>
33#include <linux/workqueue.h> 34#include <linux/workqueue.h>
34#include <linux/uwb/spec.h> 35#include <linux/uwb/spec.h>
35 36
@@ -66,6 +67,7 @@ struct uwb_dev {
66 struct uwb_dev_addr dev_addr; 67 struct uwb_dev_addr dev_addr;
67 int beacon_slot; 68 int beacon_slot;
68 DECLARE_BITMAP(streams, UWB_NUM_STREAMS); 69 DECLARE_BITMAP(streams, UWB_NUM_STREAMS);
70 DECLARE_BITMAP(last_availability_bm, UWB_NUM_MAS);
69}; 71};
70#define to_uwb_dev(d) container_of(d, struct uwb_dev, dev) 72#define to_uwb_dev(d) container_of(d, struct uwb_dev, dev)
71 73
@@ -86,12 +88,31 @@ struct uwb_notifs_chain {
86 struct mutex mutex; 88 struct mutex mutex;
87}; 89};
88 90
91/* Beacon cache list */
92struct uwb_beca {
93 struct list_head list;
94 size_t entries;
95 struct mutex mutex;
96};
97
98/* Event handling thread. */
99struct uwbd {
100 int pid;
101 struct task_struct *task;
102 wait_queue_head_t wq;
103 struct list_head event_list;
104 spinlock_t event_list_lock;
105};
106
89/** 107/**
90 * struct uwb_mas_bm - a bitmap of all MAS in a superframe 108 * struct uwb_mas_bm - a bitmap of all MAS in a superframe
91 * @bm: a bitmap of length #UWB_NUM_MAS 109 * @bm: a bitmap of length #UWB_NUM_MAS
92 */ 110 */
93struct uwb_mas_bm { 111struct uwb_mas_bm {
94 DECLARE_BITMAP(bm, UWB_NUM_MAS); 112 DECLARE_BITMAP(bm, UWB_NUM_MAS);
113 DECLARE_BITMAP(unsafe_bm, UWB_NUM_MAS);
114 int safe;
115 int unsafe;
95}; 116};
96 117
97/** 118/**
@@ -117,14 +138,24 @@ struct uwb_mas_bm {
117 * FIXME: further target states TBD. 138 * FIXME: further target states TBD.
118 */ 139 */
119enum uwb_rsv_state { 140enum uwb_rsv_state {
120 UWB_RSV_STATE_NONE, 141 UWB_RSV_STATE_NONE = 0,
121 UWB_RSV_STATE_O_INITIATED, 142 UWB_RSV_STATE_O_INITIATED,
122 UWB_RSV_STATE_O_PENDING, 143 UWB_RSV_STATE_O_PENDING,
123 UWB_RSV_STATE_O_MODIFIED, 144 UWB_RSV_STATE_O_MODIFIED,
124 UWB_RSV_STATE_O_ESTABLISHED, 145 UWB_RSV_STATE_O_ESTABLISHED,
146 UWB_RSV_STATE_O_TO_BE_MOVED,
147 UWB_RSV_STATE_O_MOVE_EXPANDING,
148 UWB_RSV_STATE_O_MOVE_COMBINING,
149 UWB_RSV_STATE_O_MOVE_REDUCING,
125 UWB_RSV_STATE_T_ACCEPTED, 150 UWB_RSV_STATE_T_ACCEPTED,
126 UWB_RSV_STATE_T_DENIED, 151 UWB_RSV_STATE_T_DENIED,
152 UWB_RSV_STATE_T_CONFLICT,
127 UWB_RSV_STATE_T_PENDING, 153 UWB_RSV_STATE_T_PENDING,
154 UWB_RSV_STATE_T_EXPANDING_ACCEPTED,
155 UWB_RSV_STATE_T_EXPANDING_CONFLICT,
156 UWB_RSV_STATE_T_EXPANDING_PENDING,
157 UWB_RSV_STATE_T_EXPANDING_DENIED,
158 UWB_RSV_STATE_T_RESIZED,
128 159
129 UWB_RSV_STATE_LAST, 160 UWB_RSV_STATE_LAST,
130}; 161};
@@ -149,6 +180,12 @@ struct uwb_rsv_target {
149 }; 180 };
150}; 181};
151 182
183struct uwb_rsv_move {
184 struct uwb_mas_bm final_mas;
185 struct uwb_ie_drp *companion_drp_ie;
186 struct uwb_mas_bm companion_mas;
187};
188
152/* 189/*
153 * Number of streams reserved for reservations targeted at DevAddrs. 190 * Number of streams reserved for reservations targeted at DevAddrs.
154 */ 191 */
@@ -186,6 +223,7 @@ typedef void (*uwb_rsv_cb_f)(struct uwb_rsv *rsv);
186 * 223 *
187 * @status: negotiation status 224 * @status: negotiation status
188 * @stream: stream index allocated for this reservation 225 * @stream: stream index allocated for this reservation
226 * @tiebreaker: conflict tiebreaker for this reservation
189 * @mas: reserved MAS 227 * @mas: reserved MAS
190 * @drp_ie: the DRP IE 228 * @drp_ie: the DRP IE
191 * @ie_valid: true iff the DRP IE matches the reservation parameters 229 * @ie_valid: true iff the DRP IE matches the reservation parameters
@@ -201,25 +239,29 @@ struct uwb_rsv {
201 struct uwb_rc *rc; 239 struct uwb_rc *rc;
202 struct list_head rc_node; 240 struct list_head rc_node;
203 struct list_head pal_node; 241 struct list_head pal_node;
242 struct kref kref;
204 243
205 struct uwb_dev *owner; 244 struct uwb_dev *owner;
206 struct uwb_rsv_target target; 245 struct uwb_rsv_target target;
207 enum uwb_drp_type type; 246 enum uwb_drp_type type;
208 int max_mas; 247 int max_mas;
209 int min_mas; 248 int min_mas;
210 int sparsity; 249 int max_interval;
211 bool is_multicast; 250 bool is_multicast;
212 251
213 uwb_rsv_cb_f callback; 252 uwb_rsv_cb_f callback;
214 void *pal_priv; 253 void *pal_priv;
215 254
216 enum uwb_rsv_state state; 255 enum uwb_rsv_state state;
256 bool needs_release_companion_mas;
217 u8 stream; 257 u8 stream;
258 u8 tiebreaker;
218 struct uwb_mas_bm mas; 259 struct uwb_mas_bm mas;
219 struct uwb_ie_drp *drp_ie; 260 struct uwb_ie_drp *drp_ie;
261 struct uwb_rsv_move mv;
220 bool ie_valid; 262 bool ie_valid;
221 struct timer_list timer; 263 struct timer_list timer;
222 bool expired; 264 struct work_struct handle_timeout_work;
223}; 265};
224 266
225static const 267static const
@@ -261,6 +303,13 @@ struct uwb_drp_avail {
261 bool ie_valid; 303 bool ie_valid;
262}; 304};
263 305
306struct uwb_drp_backoff_win {
307 u8 window;
308 u8 n;
309 int total_expired;
310 struct timer_list timer;
311 bool can_reserve_extra_mases;
312};
264 313
265const char *uwb_rsv_state_str(enum uwb_rsv_state state); 314const char *uwb_rsv_state_str(enum uwb_rsv_state state);
266const char *uwb_rsv_type_str(enum uwb_drp_type type); 315const char *uwb_rsv_type_str(enum uwb_drp_type type);
@@ -276,6 +325,8 @@ void uwb_rsv_terminate(struct uwb_rsv *rsv);
276 325
277void uwb_rsv_accept(struct uwb_rsv *rsv, uwb_rsv_cb_f cb, void *pal_priv); 326void uwb_rsv_accept(struct uwb_rsv *rsv, uwb_rsv_cb_f cb, void *pal_priv);
278 327
328void uwb_rsv_get_usable_mas(struct uwb_rsv *orig_rsv, struct uwb_mas_bm *mas);
329
279/** 330/**
280 * Radio Control Interface instance 331 * Radio Control Interface instance
281 * 332 *
@@ -337,23 +388,33 @@ struct uwb_rc {
337 u8 ctx_roll; 388 u8 ctx_roll;
338 389
339 int beaconing; /* Beaconing state [channel number] */ 390 int beaconing; /* Beaconing state [channel number] */
391 int beaconing_forced;
340 int scanning; 392 int scanning;
341 enum uwb_scan_type scan_type:3; 393 enum uwb_scan_type scan_type:3;
342 unsigned ready:1; 394 unsigned ready:1;
343 struct uwb_notifs_chain notifs_chain; 395 struct uwb_notifs_chain notifs_chain;
396 struct uwb_beca uwb_beca;
397
398 struct uwbd uwbd;
344 399
400 struct uwb_drp_backoff_win bow;
345 struct uwb_drp_avail drp_avail; 401 struct uwb_drp_avail drp_avail;
346 struct list_head reservations; 402 struct list_head reservations;
403 struct list_head cnflt_alien_list;
404 struct uwb_mas_bm cnflt_alien_bitmap;
347 struct mutex rsvs_mutex; 405 struct mutex rsvs_mutex;
406 spinlock_t rsvs_lock;
348 struct workqueue_struct *rsv_workq; 407 struct workqueue_struct *rsv_workq;
349 struct work_struct rsv_update_work;
350 408
409 struct delayed_work rsv_update_work;
410 struct delayed_work rsv_alien_bp_work;
411 int set_drp_ie_pending;
351 struct mutex ies_mutex; 412 struct mutex ies_mutex;
352 struct uwb_rc_cmd_set_ie *ies; 413 struct uwb_rc_cmd_set_ie *ies;
353 size_t ies_capacity; 414 size_t ies_capacity;
354 415
355 spinlock_t pal_lock;
356 struct list_head pals; 416 struct list_head pals;
417 int active_pals;
357 418
358 struct uwb_dbg *dbg; 419 struct uwb_dbg *dbg;
359}; 420};
@@ -361,11 +422,19 @@ struct uwb_rc {
361 422
362/** 423/**
363 * struct uwb_pal - a UWB PAL 424 * struct uwb_pal - a UWB PAL
364 * @name: descriptive name for this PAL (wushc, wlp, etc.). 425 * @name: descriptive name for this PAL (wusbhc, wlp, etc.).
365 * @device: a device for the PAL. Used to link the PAL and the radio 426 * @device: a device for the PAL. Used to link the PAL and the radio
366 * controller in sysfs. 427 * controller in sysfs.
428 * @rc: the radio controller the PAL uses.
429 * @channel_changed: called when the channel used by the radio changes.
430 * A channel of -1 means the channel has been stopped.
367 * @new_rsv: called when a peer requests a reservation (may be NULL if 431 * @new_rsv: called when a peer requests a reservation (may be NULL if
368 * the PAL cannot accept reservation requests). 432 * the PAL cannot accept reservation requests).
433 * @channel: channel being used by the PAL; 0 if the PAL isn't using
434 * the radio; -1 if the PAL wishes to use the radio but
435 * cannot.
436 * @debugfs_dir: a debugfs directory which the PAL can use for its own
437 * debugfs files.
369 * 438 *
370 * A Protocol Adaptation Layer (PAL) is a user of the WiMedia UWB 439 * A Protocol Adaptation Layer (PAL) is a user of the WiMedia UWB
371 * radio platform (e.g., WUSB, WLP or Bluetooth UWB AMP). 440 * radio platform (e.g., WUSB, WLP or Bluetooth UWB AMP).
@@ -384,12 +453,21 @@ struct uwb_pal {
384 struct list_head node; 453 struct list_head node;
385 const char *name; 454 const char *name;
386 struct device *device; 455 struct device *device;
387 void (*new_rsv)(struct uwb_rsv *rsv); 456 struct uwb_rc *rc;
457
458 void (*channel_changed)(struct uwb_pal *pal, int channel);
459 void (*new_rsv)(struct uwb_pal *pal, struct uwb_rsv *rsv);
460
461 int channel;
462 struct dentry *debugfs_dir;
388}; 463};
389 464
390void uwb_pal_init(struct uwb_pal *pal); 465void uwb_pal_init(struct uwb_pal *pal);
391int uwb_pal_register(struct uwb_rc *rc, struct uwb_pal *pal); 466int uwb_pal_register(struct uwb_pal *pal);
392void uwb_pal_unregister(struct uwb_rc *rc, struct uwb_pal *pal); 467void uwb_pal_unregister(struct uwb_pal *pal);
468
469int uwb_radio_start(struct uwb_pal *pal);
470void uwb_radio_stop(struct uwb_pal *pal);
393 471
394/* 472/*
395 * General public API 473 * General public API
@@ -443,8 +521,6 @@ ssize_t uwb_rc_vcmd(struct uwb_rc *rc, const char *cmd_name,
443 struct uwb_rccb *cmd, size_t cmd_size, 521 struct uwb_rccb *cmd, size_t cmd_size,
444 u8 expected_type, u16 expected_event, 522 u8 expected_type, u16 expected_event,
445 struct uwb_rceb **preply); 523 struct uwb_rceb **preply);
446ssize_t uwb_rc_get_ie(struct uwb_rc *, struct uwb_rc_evt_get_ie **);
447int uwb_bg_joined(struct uwb_rc *rc);
448 524
449size_t __uwb_addr_print(char *, size_t, const unsigned char *, int); 525size_t __uwb_addr_print(char *, size_t, const unsigned char *, int);
450 526
@@ -520,6 +596,8 @@ void uwb_rc_rm(struct uwb_rc *);
520void uwb_rc_neh_grok(struct uwb_rc *, void *, size_t); 596void uwb_rc_neh_grok(struct uwb_rc *, void *, size_t);
521void uwb_rc_neh_error(struct uwb_rc *, int); 597void uwb_rc_neh_error(struct uwb_rc *, int);
522void uwb_rc_reset_all(struct uwb_rc *rc); 598void uwb_rc_reset_all(struct uwb_rc *rc);
599void uwb_rc_pre_reset(struct uwb_rc *rc);
600void uwb_rc_post_reset(struct uwb_rc *rc);
523 601
524/** 602/**
525 * uwb_rsv_is_owner - is the owner of this reservation the RC? 603 * uwb_rsv_is_owner - is the owner of this reservation the RC?
@@ -531,7 +609,9 @@ static inline bool uwb_rsv_is_owner(struct uwb_rsv *rsv)
531} 609}
532 610
533/** 611/**
534 * Events generated by UWB that can be passed to any listeners 612 * enum uwb_notifs - UWB events that can be passed to any listeners
613 * @UWB_NOTIF_ONAIR: a new neighbour has joined the beacon group.
614 * @UWB_NOTIF_OFFAIR: a neighbour has left the beacon group.
535 * 615 *
536 * Higher layers can register callback functions with the radio 616 * Higher layers can register callback functions with the radio
537 * controller using uwb_notifs_register(). The radio controller 617 * controller using uwb_notifs_register(). The radio controller
@@ -539,8 +619,6 @@ static inline bool uwb_rsv_is_owner(struct uwb_rsv *rsv)
539 * nodes when an event occurs. 619 * nodes when an event occurs.
540 */ 620 */
541enum uwb_notifs { 621enum uwb_notifs {
542 UWB_NOTIF_BG_JOIN = 0, /* radio controller joined a beacon group */
543 UWB_NOTIF_BG_LEAVE = 1, /* radio controller left a beacon group */
544 UWB_NOTIF_ONAIR, 622 UWB_NOTIF_ONAIR,
545 UWB_NOTIF_OFFAIR, 623 UWB_NOTIF_OFFAIR,
546}; 624};
@@ -652,22 +730,9 @@ static inline int edc_inc(struct edc *err_hist, u16 max_err, u16 timeframe)
652 730
653/* Information Element handling */ 731/* Information Element handling */
654 732
655/* For representing the state of writing to a buffer when iterating */
656struct uwb_buf_ctx {
657 char *buf;
658 size_t bytes, size;
659};
660
661typedef int (*uwb_ie_f)(struct uwb_dev *, const struct uwb_ie_hdr *,
662 size_t, void *);
663struct uwb_ie_hdr *uwb_ie_next(void **ptr, size_t *len); 733struct uwb_ie_hdr *uwb_ie_next(void **ptr, size_t *len);
664ssize_t uwb_ie_for_each(struct uwb_dev *uwb_dev, uwb_ie_f fn, void *data, 734int uwb_rc_ie_add(struct uwb_rc *uwb_rc, const struct uwb_ie_hdr *ies, size_t size);
665 const void *buf, size_t size); 735int uwb_rc_ie_rm(struct uwb_rc *uwb_rc, enum uwb_ie element_id);
666int uwb_ie_dump_hex(struct uwb_dev *, const struct uwb_ie_hdr *,
667 size_t, void *);
668int uwb_rc_set_ie(struct uwb_rc *, struct uwb_rc_cmd_set_ie *);
669struct uwb_ie_hdr *uwb_ie_next(void **ptr, size_t *len);
670
671 736
672/* 737/*
673 * Transmission statistics 738 * Transmission statistics
diff --git a/include/linux/uwb/debug-cmd.h b/include/linux/uwb/debug-cmd.h
index 1141f41bab5c..8da004e25628 100644
--- a/include/linux/uwb/debug-cmd.h
+++ b/include/linux/uwb/debug-cmd.h
@@ -32,6 +32,10 @@
32enum uwb_dbg_cmd_type { 32enum uwb_dbg_cmd_type {
33 UWB_DBG_CMD_RSV_ESTABLISH = 1, 33 UWB_DBG_CMD_RSV_ESTABLISH = 1,
34 UWB_DBG_CMD_RSV_TERMINATE = 2, 34 UWB_DBG_CMD_RSV_TERMINATE = 2,
35 UWB_DBG_CMD_IE_ADD = 3,
36 UWB_DBG_CMD_IE_RM = 4,
37 UWB_DBG_CMD_RADIO_START = 5,
38 UWB_DBG_CMD_RADIO_STOP = 6,
35}; 39};
36 40
37struct uwb_dbg_cmd_rsv_establish { 41struct uwb_dbg_cmd_rsv_establish {
@@ -39,18 +43,25 @@ struct uwb_dbg_cmd_rsv_establish {
39 __u8 type; 43 __u8 type;
40 __u16 max_mas; 44 __u16 max_mas;
41 __u16 min_mas; 45 __u16 min_mas;
42 __u8 sparsity; 46 __u8 max_interval;
43}; 47};
44 48
45struct uwb_dbg_cmd_rsv_terminate { 49struct uwb_dbg_cmd_rsv_terminate {
46 int index; 50 int index;
47}; 51};
48 52
53struct uwb_dbg_cmd_ie {
54 __u8 data[128];
55 int len;
56};
57
49struct uwb_dbg_cmd { 58struct uwb_dbg_cmd {
50 __u32 type; 59 __u32 type;
51 union { 60 union {
52 struct uwb_dbg_cmd_rsv_establish rsv_establish; 61 struct uwb_dbg_cmd_rsv_establish rsv_establish;
53 struct uwb_dbg_cmd_rsv_terminate rsv_terminate; 62 struct uwb_dbg_cmd_rsv_terminate rsv_terminate;
63 struct uwb_dbg_cmd_ie ie_add;
64 struct uwb_dbg_cmd_ie ie_rm;
54 }; 65 };
55}; 66};
56 67
diff --git a/include/linux/uwb/debug.h b/include/linux/uwb/debug.h
deleted file mode 100644
index a86a73fe303f..000000000000
--- a/include/linux/uwb/debug.h
+++ /dev/null
@@ -1,82 +0,0 @@
1/*
2 * Ultra Wide Band
3 * Debug Support
4 *
5 * Copyright (C) 2005-2006 Intel Corporation
6 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.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 version
10 * 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * 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 Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
21 *
22 *
23 * FIXME: doc
24 * Invoke like:
25 *
26 * #define D_LOCAL 4
27 * #include <linux/uwb/debug.h>
28 *
29 * At the end of your include files.
30 */
31#include <linux/types.h>
32
33struct device;
34extern void dump_bytes(struct device *dev, const void *_buf, size_t rsize);
35
36/* Master debug switch; !0 enables, 0 disables */
37#define D_MASTER (!0)
38
39/* Local (per-file) debug switch; #define before #including */
40#ifndef D_LOCAL
41#define D_LOCAL 0
42#endif
43
44#undef __d_printf
45#undef d_fnstart
46#undef d_fnend
47#undef d_printf
48#undef d_dump
49
50#define __d_printf(l, _tag, _dev, f, a...) \
51do { \
52 struct device *__dev = (_dev); \
53 if (D_MASTER && D_LOCAL >= (l)) { \
54 char __head[64] = ""; \
55 if (_dev != NULL) { \
56 if ((unsigned long)__dev < 4096) \
57 printk(KERN_ERR "E: Corrupt dev %p\n", \
58 __dev); \
59 else \
60 snprintf(__head, sizeof(__head), \
61 "%s %s: ", \
62 dev_driver_string(__dev), \
63 __dev->bus_id); \
64 } \
65 printk(KERN_ERR "%s%s" _tag ": " f, __head, \
66 __func__, ## a); \
67 } \
68} while (0 && _dev)
69
70#define d_fnstart(l, _dev, f, a...) \
71 __d_printf(l, " FNSTART", _dev, f, ## a)
72#define d_fnend(l, _dev, f, a...) \
73 __d_printf(l, " FNEND", _dev, f, ## a)
74#define d_printf(l, _dev, f, a...) \
75 __d_printf(l, "", _dev, f, ## a)
76#define d_dump(l, _dev, ptr, size) \
77do { \
78 struct device *__dev = _dev; \
79 if (D_MASTER && D_LOCAL >= (l)) \
80 dump_bytes(__dev, ptr, size); \
81} while (0 && _dev)
82#define d_test(l) (D_MASTER && D_LOCAL >= (l))
diff --git a/include/linux/uwb/spec.h b/include/linux/uwb/spec.h
index 198c15f8e251..b52e44f1bd33 100644
--- a/include/linux/uwb/spec.h
+++ b/include/linux/uwb/spec.h
@@ -59,6 +59,11 @@ enum { UWB_NUM_ZONES = 16 };
59#define UWB_MAS_PER_ZONE (UWB_NUM_MAS / UWB_NUM_ZONES) 59#define UWB_MAS_PER_ZONE (UWB_NUM_MAS / UWB_NUM_ZONES)
60 60
61/* 61/*
62 * Number of MAS required before a row can be considered available.
63 */
64#define UWB_USABLE_MAS_PER_ROW (UWB_NUM_ZONES - 1)
65
66/*
62 * Number of streams per DRP reservation between a pair of devices. 67 * Number of streams per DRP reservation between a pair of devices.
63 * 68 *
64 * [ECMA-368] section 16.8.6. 69 * [ECMA-368] section 16.8.6.
@@ -94,6 +99,26 @@ enum { UWB_BEACON_SLOT_LENGTH_US = 85 };
94enum { UWB_MAX_LOST_BEACONS = 3 }; 99enum { UWB_MAX_LOST_BEACONS = 3 };
95 100
96/* 101/*
102 * mDRPBackOffWinMin
103 *
104 * The minimum number of superframes to wait before trying to reserve
105 * extra MAS.
106 *
107 * [ECMA-368] section 17.16
108 */
109enum { UWB_DRP_BACKOFF_WIN_MIN = 2 };
110
111/*
112 * mDRPBackOffWinMax
113 *
114 * The maximum number of superframes to wait before trying to reserve
115 * extra MAS.
116 *
117 * [ECMA-368] section 17.16
118 */
119enum { UWB_DRP_BACKOFF_WIN_MAX = 16 };
120
121/*
97 * Length of a superframe in microseconds. 122 * Length of a superframe in microseconds.
98 */ 123 */
99#define UWB_SUPERFRAME_LENGTH_US (UWB_MAS_LENGTH_US * UWB_NUM_MAS) 124#define UWB_SUPERFRAME_LENGTH_US (UWB_MAS_LENGTH_US * UWB_NUM_MAS)
@@ -200,6 +225,12 @@ enum uwb_drp_reason {
200 UWB_DRP_REASON_MODIFIED, 225 UWB_DRP_REASON_MODIFIED,
201}; 226};
202 227
228/** Relinquish Request Reason Codes ([ECMA-368] table 113) */
229enum uwb_relinquish_req_reason {
230 UWB_RELINQUISH_REQ_REASON_NON_SPECIFIC = 0,
231 UWB_RELINQUISH_REQ_REASON_OVER_ALLOCATION,
232};
233
203/** 234/**
204 * DRP Notification Reason Codes (WHCI 0.95 [3.1.4.9]) 235 * DRP Notification Reason Codes (WHCI 0.95 [3.1.4.9])
205 */ 236 */
@@ -252,6 +283,7 @@ enum uwb_ie {
252 UWB_APP_SPEC_PROBE_IE = 15, 283 UWB_APP_SPEC_PROBE_IE = 15,
253 UWB_IDENTIFICATION_IE = 19, 284 UWB_IDENTIFICATION_IE = 19,
254 UWB_MASTER_KEY_ID_IE = 20, 285 UWB_MASTER_KEY_ID_IE = 20,
286 UWB_RELINQUISH_REQUEST_IE = 21,
255 UWB_IE_WLP = 250, /* WiMedia Logical Link Control Protocol WLP 0.99 */ 287 UWB_IE_WLP = 250, /* WiMedia Logical Link Control Protocol WLP 0.99 */
256 UWB_APP_SPEC_IE = 255, 288 UWB_APP_SPEC_IE = 255,
257}; 289};
@@ -365,6 +397,27 @@ struct uwb_ie_drp_avail {
365 DECLARE_BITMAP(bmp, UWB_NUM_MAS); 397 DECLARE_BITMAP(bmp, UWB_NUM_MAS);
366} __attribute__((packed)); 398} __attribute__((packed));
367 399
400/* Relinqish Request IE ([ECMA-368] section 16.8.19). */
401struct uwb_relinquish_request_ie {
402 struct uwb_ie_hdr hdr;
403 __le16 relinquish_req_control;
404 struct uwb_dev_addr dev_addr;
405 struct uwb_drp_alloc allocs[];
406} __attribute__((packed));
407
408static inline int uwb_ie_relinquish_req_reason_code(struct uwb_relinquish_request_ie *ie)
409{
410 return (le16_to_cpu(ie->relinquish_req_control) >> 0) & 0xf;
411}
412
413static inline void uwb_ie_relinquish_req_set_reason_code(struct uwb_relinquish_request_ie *ie,
414 int reason_code)
415{
416 u16 ctrl = le16_to_cpu(ie->relinquish_req_control);
417 ctrl = (ctrl & ~(0xf << 0)) | (reason_code << 0);
418 ie->relinquish_req_control = cpu_to_le16(ctrl);
419}
420
368/** 421/**
369 * The Vendor ID is set to an OUI that indicates the vendor of the device. 422 * The Vendor ID is set to an OUI that indicates the vendor of the device.
370 * ECMA-368 [16.8.10] 423 * ECMA-368 [16.8.10]
diff --git a/include/linux/uwb/umc.h b/include/linux/uwb/umc.h
index 36a39e34f8d7..4b4fc0f43855 100644
--- a/include/linux/uwb/umc.h
+++ b/include/linux/uwb/umc.h
@@ -89,6 +89,8 @@ struct umc_driver {
89 void (*remove)(struct umc_dev *); 89 void (*remove)(struct umc_dev *);
90 int (*suspend)(struct umc_dev *, pm_message_t state); 90 int (*suspend)(struct umc_dev *, pm_message_t state);
91 int (*resume)(struct umc_dev *); 91 int (*resume)(struct umc_dev *);
92 int (*pre_reset)(struct umc_dev *);
93 int (*post_reset)(struct umc_dev *);
92 94
93 struct device_driver driver; 95 struct device_driver driver;
94}; 96};
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 1f126e30766c..5571dbe1c0ad 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1370,25 +1370,41 @@ struct v4l2_streamparm {
1370/* 1370/*
1371 * A D V A N C E D D E B U G G I N G 1371 * A D V A N C E D D E B U G G I N G
1372 * 1372 *
1373 * NOTE: EXPERIMENTAL API 1373 * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
1374 * FOR DEBUGGING, TESTING AND INTERNAL USE ONLY!
1374 */ 1375 */
1375 1376
1376/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ 1377/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
1377 1378
1378#define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */ 1379#define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */
1379#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver ID */ 1380#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */
1380#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */ 1381#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */
1381#define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */ 1382#define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */
1382 1383
1383struct v4l2_register { 1384struct v4l2_dbg_match {
1384 __u32 match_type; /* Match type */ 1385 __u32 type; /* Match type */
1385 __u32 match_chip; /* Match this chip, meaning determined by match_type */ 1386 union { /* Match this chip, meaning determined by type */
1387 __u32 addr;
1388 char name[32];
1389 };
1390} __attribute__ ((packed));
1391
1392struct v4l2_dbg_register {
1393 struct v4l2_dbg_match match;
1394 __u32 size; /* register size in bytes */
1386 __u64 reg; 1395 __u64 reg;
1387 __u64 val; 1396 __u64 val;
1388}; 1397} __attribute__ ((packed));
1398
1399/* VIDIOC_DBG_G_CHIP_IDENT */
1400struct v4l2_dbg_chip_ident {
1401 struct v4l2_dbg_match match;
1402 __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */
1403 __u32 revision; /* chip revision, chip specific */
1404} __attribute__ ((packed));
1389 1405
1390/* VIDIOC_G_CHIP_IDENT */ 1406/* VIDIOC_G_CHIP_IDENT_OLD: Deprecated, do not use */
1391struct v4l2_chip_ident { 1407struct v4l2_chip_ident_old {
1392 __u32 match_type; /* Match type */ 1408 __u32 match_type; /* Match type */
1393 __u32 match_chip; /* Match this chip, meaning determined by match_type */ 1409 __u32 match_chip; /* Match this chip, meaning determined by match_type */
1394 __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */ 1410 __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */
@@ -1460,13 +1476,22 @@ struct v4l2_chip_ident {
1460#define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx) 1476#define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx)
1461#define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd) 1477#define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd)
1462#define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd) 1478#define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd)
1479#endif
1463 1480
1464/* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ 1481#if 1
1465#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_register) 1482/* Experimental, meant for debugging, testing and internal use.
1466#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_register) 1483 Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
1467 1484 You must be root to use these ioctls. Never use these in applications! */
1468#define VIDIOC_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_chip_ident) 1485#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
1486#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
1487
1488/* Experimental, meant for debugging, testing and internal use.
1489 Never use this ioctl in applications! */
1490#define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident)
1491/* This is deprecated and will go away in 2.6.30 */
1492#define VIDIOC_G_CHIP_IDENT_OLD _IOWR('V', 81, struct v4l2_chip_ident_old)
1469#endif 1493#endif
1494
1470#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) 1495#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
1471/* Reminder: when adding new ioctls please add support for them to 1496/* Reminder: when adding new ioctls please add support for them to
1472 drivers/media/video/v4l2-compat-ioctl32.c as well! */ 1497 drivers/media/video/v4l2-compat-ioctl32.c as well! */
diff --git a/include/linux/wlp.h b/include/linux/wlp.h
index 033545e145c7..ac95ce6606ac 100644
--- a/include/linux/wlp.h
+++ b/include/linux/wlp.h
@@ -646,6 +646,7 @@ struct wlp_wss {
646struct wlp { 646struct wlp {
647 struct mutex mutex; 647 struct mutex mutex;
648 struct uwb_rc *rc; /* UWB radio controller */ 648 struct uwb_rc *rc; /* UWB radio controller */
649 struct net_device *ndev;
649 struct uwb_pal pal; 650 struct uwb_pal pal;
650 struct wlp_eda eda; 651 struct wlp_eda eda;
651 struct wlp_uuid uuid; 652 struct wlp_uuid uuid;
@@ -675,7 +676,7 @@ struct wlp_wss_attribute {
675static struct wlp_wss_attribute wss_attr_##_name = __ATTR(_name, _mode, \ 676static struct wlp_wss_attribute wss_attr_##_name = __ATTR(_name, _mode, \
676 _show, _store) 677 _show, _store)
677 678
678extern int wlp_setup(struct wlp *, struct uwb_rc *); 679extern int wlp_setup(struct wlp *, struct uwb_rc *, struct net_device *ndev);
679extern void wlp_remove(struct wlp *); 680extern void wlp_remove(struct wlp *);
680extern ssize_t wlp_neighborhood_show(struct wlp *, char *); 681extern ssize_t wlp_neighborhood_show(struct wlp *, char *);
681extern int wlp_wss_setup(struct net_device *, struct wlp_wss *); 682extern int wlp_wss_setup(struct net_device *, struct wlp_wss *);
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h
index 6bbb0d93bb5f..c8d0b23fde29 100644
--- a/include/media/saa7146_vv.h
+++ b/include/media/saa7146_vv.h
@@ -177,9 +177,9 @@ struct saa7146_ext_vv
177 int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *); 177 int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *);
178 178
179 struct saa7146_extension_ioctls *ioctls; 179 struct saa7146_extension_ioctls *ioctls;
180 int (*ioctl)(struct saa7146_fh*, unsigned int cmd, void *arg); 180 long (*ioctl)(struct saa7146_fh *, unsigned int cmd, void *arg);
181 181
182 struct file_operations vbi_fops; 182 struct v4l2_file_operations vbi_fops;
183}; 183};
184 184
185struct saa7146_use_ops { 185struct saa7146_use_ops {
@@ -216,7 +216,7 @@ void saa7146_set_gpio(struct saa7146_dev *saa, u8 pin, u8 data);
216extern struct saa7146_use_ops saa7146_video_uops; 216extern struct saa7146_use_ops saa7146_video_uops;
217int saa7146_start_preview(struct saa7146_fh *fh); 217int saa7146_start_preview(struct saa7146_fh *fh);
218int saa7146_stop_preview(struct saa7146_fh *fh); 218int saa7146_stop_preview(struct saa7146_fh *fh);
219int saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg); 219long saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg);
220 220
221/* from saa7146_vbi.c */ 221/* from saa7146_vbi.c */
222extern struct saa7146_use_ops saa7146_vbi_uops; 222extern struct saa7146_use_ops saa7146_vbi_uops;
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 425b6a98c95c..7440d9250665 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -164,12 +164,12 @@ struct soc_camera_ops {
164 unsigned long (*query_bus_param)(struct soc_camera_device *); 164 unsigned long (*query_bus_param)(struct soc_camera_device *);
165 int (*set_bus_param)(struct soc_camera_device *, unsigned long); 165 int (*set_bus_param)(struct soc_camera_device *, unsigned long);
166 int (*get_chip_id)(struct soc_camera_device *, 166 int (*get_chip_id)(struct soc_camera_device *,
167 struct v4l2_chip_ident *); 167 struct v4l2_dbg_chip_ident *);
168 int (*set_std)(struct soc_camera_device *, v4l2_std_id *); 168 int (*set_std)(struct soc_camera_device *, v4l2_std_id *);
169 int (*enum_input)(struct soc_camera_device *, struct v4l2_input *); 169 int (*enum_input)(struct soc_camera_device *, struct v4l2_input *);
170#ifdef CONFIG_VIDEO_ADV_DEBUG 170#ifdef CONFIG_VIDEO_ADV_DEBUG
171 int (*get_register)(struct soc_camera_device *, struct v4l2_register *); 171 int (*get_register)(struct soc_camera_device *, struct v4l2_dbg_register *);
172 int (*set_register)(struct soc_camera_device *, struct v4l2_register *); 172 int (*set_register)(struct soc_camera_device *, struct v4l2_dbg_register *);
173#endif 173#endif
174 int (*get_control)(struct soc_camera_device *, struct v4l2_control *); 174 int (*get_control)(struct soc_camera_device *, struct v4l2_control *);
175 int (*set_control)(struct soc_camera_device *, struct v4l2_control *); 175 int (*set_control)(struct soc_camera_device *, struct v4l2_control *);
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index 43dbb659f1f5..9aaf652b20ef 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -2,7 +2,7 @@
2 v4l2 chip identifiers header 2 v4l2 chip identifiers header
3 3
4 This header provides a list of chip identifiers that can be returned 4 This header provides a list of chip identifiers that can be returned
5 through the VIDIOC_G_CHIP_IDENT ioctl. 5 through the VIDIOC_DBG_G_CHIP_IDENT ioctl.
6 6
7 Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl> 7 Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl>
8 8
@@ -24,7 +24,7 @@
24#ifndef V4L2_CHIP_IDENT_H_ 24#ifndef V4L2_CHIP_IDENT_H_
25#define V4L2_CHIP_IDENT_H_ 25#define V4L2_CHIP_IDENT_H_
26 26
27/* VIDIOC_G_CHIP_IDENT: identifies the actual chip installed on the board */ 27/* VIDIOC_DBG_G_CHIP_IDENT: identifies the actual chip installed on the board */
28enum { 28enum {
29 /* general idents: reserved range 0-49 */ 29 /* general idents: reserved range 0-49 */
30 V4L2_IDENT_NONE = 0, /* No chip matched */ 30 V4L2_IDENT_NONE = 0, /* No chip matched */
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index f99c866d8c37..95e74f1874e1 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -114,10 +114,10 @@ u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id);
114/* Register/chip ident helper function */ 114/* Register/chip ident helper function */
115 115
116struct i2c_client; /* forward reference */ 116struct i2c_client; /* forward reference */
117int v4l2_chip_match_i2c_client(struct i2c_client *c, u32 id_type, u32 chip_id); 117int v4l2_chip_match_i2c_client(struct i2c_client *c, const struct v4l2_dbg_match *match);
118int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_chip_ident *chip, 118int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_dbg_chip_ident *chip,
119 u32 ident, u32 revision); 119 u32 ident, u32 revision);
120int v4l2_chip_match_host(u32 id_type, u32 chip_id); 120int v4l2_chip_match_host(const struct v4l2_dbg_match *match);
121 121
122/* ------------------------------------------------------------------------- */ 122/* ------------------------------------------------------------------------- */
123 123
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 0a88d1d17d30..e36faab8459b 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -25,6 +25,7 @@
25#define VFL_TYPE_MAX 4 25#define VFL_TYPE_MAX 4
26 26
27struct v4l2_ioctl_callbacks; 27struct v4l2_ioctl_callbacks;
28struct video_device;
28struct v4l2_device; 29struct v4l2_device;
29 30
30/* Flag to mark the video_device struct as unregistered. 31/* Flag to mark the video_device struct as unregistered.
@@ -32,6 +33,18 @@ struct v4l2_device;
32 device access. It is set by video_unregister_device. */ 33 device access. It is set by video_unregister_device. */
33#define V4L2_FL_UNREGISTERED (0) 34#define V4L2_FL_UNREGISTERED (0)
34 35
36struct v4l2_file_operations {
37 struct module *owner;
38 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
39 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
40 unsigned int (*poll) (struct file *, struct poll_table_struct *);
41 long (*ioctl) (struct file *, unsigned int, unsigned long);
42 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
43 int (*mmap) (struct file *, struct vm_area_struct *);
44 int (*open) (struct file *);
45 int (*release) (struct file *);
46};
47
35/* 48/*
36 * Newer version of video_device, handled by videodev2.c 49 * Newer version of video_device, handled by videodev2.c
37 * This version moves redundant code from video device code to 50 * This version moves redundant code from video device code to
@@ -41,7 +54,7 @@ struct v4l2_device;
41struct video_device 54struct video_device
42{ 55{
43 /* device ops */ 56 /* device ops */
44 const struct file_operations *fops; 57 const struct v4l2_file_operations *fops;
45 58
46 /* sysfs */ 59 /* sysfs */
47 struct device dev; /* v4l device */ 60 struct device dev; /* v4l device */
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
index 97b283a04289..9bf4ccc93dbf 100644
--- a/include/media/v4l2-device.h
+++ b/include/media/v4l2-device.h
@@ -80,7 +80,7 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd);
80#define __v4l2_device_call_subdevs_until_err(dev, cond, o, f, args...) \ 80#define __v4l2_device_call_subdevs_until_err(dev, cond, o, f, args...) \
81({ \ 81({ \
82 struct v4l2_subdev *sd; \ 82 struct v4l2_subdev *sd; \
83 int err = 0; \ 83 long err = 0; \
84 \ 84 \
85 list_for_each_entry(sd, &(dev)->subdevs, list) { \ 85 list_for_each_entry(sd, &(dev)->subdevs, list) { \
86 if ((cond) && sd->ops->o && sd->ops->o->f) \ 86 if ((cond) && sd->ops->o && sd->ops->o->f) \
diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
index ecda3c725837..fbf585561570 100644
--- a/include/media/v4l2-int-device.h
+++ b/include/media/v4l2-int-device.h
@@ -219,7 +219,7 @@ enum v4l2_int_ioctl_num {
219 vidioc_int_reset_num, 219 vidioc_int_reset_num,
220 /* VIDIOC_INT_INIT */ 220 /* VIDIOC_INT_INIT */
221 vidioc_int_init_num, 221 vidioc_int_init_num,
222 /* VIDIOC_INT_G_CHIP_IDENT */ 222 /* VIDIOC_DBG_G_CHIP_IDENT */
223 vidioc_int_g_chip_ident_num, 223 vidioc_int_g_chip_ident_num,
224 224
225 /* 225 /*
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index fcdb58c4ce07..b01c044868d0 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -225,12 +225,12 @@ struct v4l2_ioctl_ops {
225 /* Debugging ioctls */ 225 /* Debugging ioctls */
226#ifdef CONFIG_VIDEO_ADV_DEBUG 226#ifdef CONFIG_VIDEO_ADV_DEBUG
227 int (*vidioc_g_register) (struct file *file, void *fh, 227 int (*vidioc_g_register) (struct file *file, void *fh,
228 struct v4l2_register *reg); 228 struct v4l2_dbg_register *reg);
229 int (*vidioc_s_register) (struct file *file, void *fh, 229 int (*vidioc_s_register) (struct file *file, void *fh,
230 struct v4l2_register *reg); 230 struct v4l2_dbg_register *reg);
231#endif 231#endif
232 int (*vidioc_g_chip_ident) (struct file *file, void *fh, 232 int (*vidioc_g_chip_ident) (struct file *file, void *fh,
233 struct v4l2_chip_ident *chip); 233 struct v4l2_dbg_chip_ident *chip);
234 234
235 int (*vidioc_enum_framesizes) (struct file *file, void *fh, 235 int (*vidioc_enum_framesizes) (struct file *file, void *fh,
236 struct v4l2_frmsizeenum *fsize); 236 struct v4l2_frmsizeenum *fsize);
@@ -239,7 +239,7 @@ struct v4l2_ioctl_ops {
239 struct v4l2_frmivalenum *fival); 239 struct v4l2_frmivalenum *fival);
240 240
241 /* For other private ioctls */ 241 /* For other private ioctls */
242 int (*vidioc_default) (struct file *file, void *fh, 242 long (*vidioc_default) (struct file *file, void *fh,
243 int cmd, void *arg); 243 int cmd, void *arg);
244}; 244};
245 245
@@ -277,36 +277,27 @@ extern const char *v4l2_field_names[];
277extern const char *v4l2_type_names[]; 277extern const char *v4l2_type_names[];
278 278
279/* Compatibility layer interface -- v4l1-compat module */ 279/* Compatibility layer interface -- v4l1-compat module */
280typedef int (*v4l2_kioctl)(struct file *file, 280typedef long (*v4l2_kioctl)(struct file *file,
281 unsigned int cmd, void *arg); 281 unsigned int cmd, void *arg);
282#ifdef CONFIG_VIDEO_V4L1_COMPAT 282#ifdef CONFIG_VIDEO_V4L1_COMPAT
283int v4l_compat_translate_ioctl(struct file *file, 283long v4l_compat_translate_ioctl(struct file *file,
284 int cmd, void *arg, v4l2_kioctl driver_ioctl); 284 int cmd, void *arg, v4l2_kioctl driver_ioctl);
285#else 285#else
286#define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL) 286#define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL)
287#endif 287#endif
288 288
289#ifdef CONFIG_COMPAT
289/* 32 Bits compatibility layer for 64 bits processors */ 290/* 32 Bits compatibility layer for 64 bits processors */
290extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, 291extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd,
291 unsigned long arg); 292 unsigned long arg);
293#endif
292 294
293/* Include support for obsoleted stuff */ 295/* Include support for obsoleted stuff */
294extern int video_usercopy(struct file *file, unsigned int cmd, 296extern long video_usercopy(struct file *file, unsigned int cmd,
295 unsigned long arg, v4l2_kioctl func); 297 unsigned long arg, v4l2_kioctl func);
296 298
297/* Standard handlers for V4L ioctl's */ 299/* Standard handlers for V4L ioctl's */
298 300extern long video_ioctl2(struct file *file,
299/* This prototype is used on fops.unlocked_ioctl */
300extern long __video_ioctl2(struct file *file,
301 unsigned int cmd, unsigned long arg);
302
303/* This prototype is used on fops.ioctl
304 * Since fops.ioctl enables Kernel Big Lock, it is preferred
305 * to use __video_ioctl2 instead.
306 * It should be noticed that there's no lock code inside
307 * video_ioctl2().
308 */
309extern int video_ioctl2(struct inode *inode, struct file *file,
310 unsigned int cmd, unsigned long arg); 301 unsigned int cmd, unsigned long arg);
311 302
312#endif /* _V4L2_IOCTL_H */ 303#endif /* _V4L2_IOCTL_H */
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index ceef016bb0b7..37b09e56e943 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -69,7 +69,7 @@ struct tuner_setup;
69 not yet implemented) since ops provide proper type-checking. 69 not yet implemented) since ops provide proper type-checking.
70 */ 70 */
71struct v4l2_subdev_core_ops { 71struct v4l2_subdev_core_ops {
72 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip); 72 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
73 int (*log_status)(struct v4l2_subdev *sd); 73 int (*log_status)(struct v4l2_subdev *sd);
74 int (*init)(struct v4l2_subdev *sd, u32 val); 74 int (*init)(struct v4l2_subdev *sd, u32 val);
75 int (*s_standby)(struct v4l2_subdev *sd, u32 standby); 75 int (*s_standby)(struct v4l2_subdev *sd, u32 standby);
@@ -79,10 +79,10 @@ struct v4l2_subdev_core_ops {
79 int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); 79 int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl);
80 int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); 80 int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl);
81 int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); 81 int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm);
82 int (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); 82 long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
83#ifdef CONFIG_VIDEO_ADV_DEBUG 83#ifdef CONFIG_VIDEO_ADV_DEBUG
84 int (*g_register)(struct v4l2_subdev *sd, struct v4l2_register *reg); 84 int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
85 int (*s_register)(struct v4l2_subdev *sd, struct v4l2_register *reg); 85 int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
86#endif 86#endif
87}; 87};
88 88
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
index b6870cbaf2b3..426899e529c5 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/sound/tea575x-tuner.h
@@ -36,7 +36,7 @@ struct snd_tea575x_ops {
36struct snd_tea575x { 36struct snd_tea575x {
37 struct snd_card *card; 37 struct snd_card *card;
38 struct video_device vd; /* video device */ 38 struct video_device vd; /* video device */
39 struct file_operations fops; 39 struct v4l2_file_operations fops;
40 int dev_nr; /* requested device number + 1 */ 40 int dev_nr; /* requested device number + 1 */
41 int vd_registered; /* video device is registered */ 41 int vd_registered; /* video device is registered */
42 int tea5759; /* 5759 chip is present */ 42 int tea5759; /* 5759 chip is present */