diff options
Diffstat (limited to 'include/linux')
192 files changed, 3799 insertions, 2164 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 831c4634162c..97319a8fc1e0 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -118,6 +118,7 @@ header-y += eventpoll.h | |||
118 | header-y += ext2_fs.h | 118 | header-y += ext2_fs.h |
119 | header-y += fadvise.h | 119 | header-y += fadvise.h |
120 | header-y += falloc.h | 120 | header-y += falloc.h |
121 | header-y += fanotify.h | ||
121 | header-y += fb.h | 122 | header-y += fb.h |
122 | header-y += fcntl.h | 123 | header-y += fcntl.h |
123 | header-y += fd.h | 124 | header-y += fd.h |
@@ -326,10 +327,6 @@ header-y += serio.h | |||
326 | header-y += shm.h | 327 | header-y += shm.h |
327 | header-y += signal.h | 328 | header-y += signal.h |
328 | header-y += signalfd.h | 329 | header-y += signalfd.h |
329 | header-y += smb.h | ||
330 | header-y += smb_fs.h | ||
331 | header-y += smb_mount.h | ||
332 | header-y += smbno.h | ||
333 | header-y += snmp.h | 330 | header-y += snmp.h |
334 | header-y += socket.h | 331 | header-y += socket.h |
335 | header-y += sockios.h | 332 | header-y += sockios.h |
@@ -372,7 +369,6 @@ header-y += veth.h | |||
372 | header-y += vhost.h | 369 | header-y += vhost.h |
373 | header-y += videodev.h | 370 | header-y += videodev.h |
374 | header-y += videodev2.h | 371 | header-y += videodev2.h |
375 | header-y += videotext.h | ||
376 | header-y += virtio_9p.h | 372 | header-y += virtio_9p.h |
377 | header-y += virtio_balloon.h | 373 | header-y += virtio_balloon.h |
378 | header-y += virtio_blk.h | 374 | header-y += virtio_blk.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index c227757feb06..fa7ed6a983d0 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -219,7 +219,7 @@ static inline int acpi_video_display_switch_support(void) | |||
219 | 219 | ||
220 | extern int acpi_blacklisted(void); | 220 | extern int acpi_blacklisted(void); |
221 | extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); | 221 | extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); |
222 | extern int acpi_osi_setup(char *str); | 222 | extern void acpi_osi_setup(char *str); |
223 | 223 | ||
224 | #ifdef CONFIG_ACPI_NUMA | 224 | #ifdef CONFIG_ACPI_NUMA |
225 | int acpi_get_pxm(acpi_handle handle); | 225 | int acpi_get_pxm(acpi_handle handle); |
@@ -245,8 +245,6 @@ int acpi_check_resource_conflict(const struct resource *res); | |||
245 | 245 | ||
246 | int acpi_check_region(resource_size_t start, resource_size_t n, | 246 | int acpi_check_region(resource_size_t start, resource_size_t n, |
247 | const char *name); | 247 | const char *name); |
248 | int acpi_check_mem_region(resource_size_t start, resource_size_t n, | ||
249 | const char *name); | ||
250 | 248 | ||
251 | int acpi_resources_are_enforced(void); | 249 | int acpi_resources_are_enforced(void); |
252 | 250 | ||
@@ -256,6 +254,15 @@ void __init acpi_old_suspend_ordering(void); | |||
256 | void __init acpi_nvs_nosave(void); | 254 | void __init acpi_nvs_nosave(void); |
257 | #endif /* CONFIG_PM_SLEEP */ | 255 | #endif /* CONFIG_PM_SLEEP */ |
258 | 256 | ||
257 | #ifdef CONFIG_ACPI_SLEEP | ||
258 | int suspend_nvs_register(unsigned long start, unsigned long size); | ||
259 | #else | ||
260 | static inline int suspend_nvs_register(unsigned long a, unsigned long b) | ||
261 | { | ||
262 | return 0; | ||
263 | } | ||
264 | #endif | ||
265 | |||
259 | struct acpi_osc_context { | 266 | struct acpi_osc_context { |
260 | char *uuid_str; /* uuid string */ | 267 | char *uuid_str; /* uuid string */ |
261 | int rev; | 268 | int rev; |
@@ -308,6 +315,9 @@ extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, | |||
308 | u32 *mask, u32 req); | 315 | u32 *mask, u32 req); |
309 | extern void acpi_early_init(void); | 316 | extern void acpi_early_init(void); |
310 | 317 | ||
318 | int acpi_os_map_generic_address(struct acpi_generic_address *addr); | ||
319 | void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); | ||
320 | |||
311 | #else /* !CONFIG_ACPI */ | 321 | #else /* !CONFIG_ACPI */ |
312 | 322 | ||
313 | #define acpi_disabled 1 | 323 | #define acpi_disabled 1 |
@@ -344,12 +354,6 @@ static inline int acpi_check_region(resource_size_t start, resource_size_t n, | |||
344 | return 0; | 354 | return 0; |
345 | } | 355 | } |
346 | 356 | ||
347 | static inline int acpi_check_mem_region(resource_size_t start, | ||
348 | resource_size_t n, const char *name) | ||
349 | { | ||
350 | return 0; | ||
351 | } | ||
352 | |||
353 | struct acpi_table_header; | 357 | struct acpi_table_header; |
354 | static inline int acpi_table_parse(char *id, | 358 | static inline int acpi_table_parse(char *id, |
355 | int (*handler)(struct acpi_table_header *)) | 359 | int (*handler)(struct acpi_table_header *)) |
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h new file mode 100644 index 000000000000..521a0f8974ac --- /dev/null +++ b/include/linux/amba/pl08x.h | |||
@@ -0,0 +1,222 @@ | |||
1 | /* | ||
2 | * linux/amba/pl08x.h - ARM PrimeCell DMA Controller driver | ||
3 | * | ||
4 | * Copyright (C) 2005 ARM Ltd | ||
5 | * Copyright (C) 2010 ST-Ericsson SA | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * pl08x information required by platform code | ||
12 | * | ||
13 | * Please credit ARM.com | ||
14 | * Documentation: ARM DDI 0196D | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef AMBA_PL08X_H | ||
19 | #define AMBA_PL08X_H | ||
20 | |||
21 | /* We need sizes of structs from this header */ | ||
22 | #include <linux/dmaengine.h> | ||
23 | #include <linux/interrupt.h> | ||
24 | |||
25 | /** | ||
26 | * struct pl08x_channel_data - data structure to pass info between | ||
27 | * platform and PL08x driver regarding channel configuration | ||
28 | * @bus_id: name of this device channel, not just a device name since | ||
29 | * devices may have more than one channel e.g. "foo_tx" | ||
30 | * @min_signal: the minimum DMA signal number to be muxed in for this | ||
31 | * channel (for platforms supporting muxed signals). If you have | ||
32 | * static assignments, make sure this is set to the assigned signal | ||
33 | * number, PL08x have 16 possible signals in number 0 thru 15 so | ||
34 | * when these are not enough they often get muxed (in hardware) | ||
35 | * disabling simultaneous use of the same channel for two devices. | ||
36 | * @max_signal: the maximum DMA signal number to be muxed in for | ||
37 | * the channel. Set to the same as min_signal for | ||
38 | * devices with static assignments | ||
39 | * @muxval: a number usually used to poke into some mux regiser to | ||
40 | * mux in the signal to this channel | ||
41 | * @cctl_opt: default options for the channel control register | ||
42 | * @addr: source/target address in physical memory for this DMA channel, | ||
43 | * can be the address of a FIFO register for burst requests for example. | ||
44 | * This can be left undefined if the PrimeCell API is used for configuring | ||
45 | * this. | ||
46 | * @circular_buffer: whether the buffer passed in is circular and | ||
47 | * shall simply be looped round round (like a record baby round | ||
48 | * round round round) | ||
49 | * @single: the device connected to this channel will request single | ||
50 | * DMA transfers, not bursts. (Bursts are default.) | ||
51 | */ | ||
52 | struct pl08x_channel_data { | ||
53 | char *bus_id; | ||
54 | int min_signal; | ||
55 | int max_signal; | ||
56 | u32 muxval; | ||
57 | u32 cctl; | ||
58 | u32 ccfg; | ||
59 | dma_addr_t addr; | ||
60 | bool circular_buffer; | ||
61 | bool single; | ||
62 | }; | ||
63 | |||
64 | /** | ||
65 | * Struct pl08x_bus_data - information of source or destination | ||
66 | * busses for a transfer | ||
67 | * @addr: current address | ||
68 | * @maxwidth: the maximum width of a transfer on this bus | ||
69 | * @buswidth: the width of this bus in bytes: 1, 2 or 4 | ||
70 | * @fill_bytes: bytes required to fill to the next bus memory | ||
71 | * boundary | ||
72 | */ | ||
73 | struct pl08x_bus_data { | ||
74 | dma_addr_t addr; | ||
75 | u8 maxwidth; | ||
76 | u8 buswidth; | ||
77 | u32 fill_bytes; | ||
78 | }; | ||
79 | |||
80 | /** | ||
81 | * struct pl08x_phy_chan - holder for the physical channels | ||
82 | * @id: physical index to this channel | ||
83 | * @lock: a lock to use when altering an instance of this struct | ||
84 | * @signal: the physical signal (aka channel) serving this | ||
85 | * physical channel right now | ||
86 | * @serving: the virtual channel currently being served by this | ||
87 | * physical channel | ||
88 | */ | ||
89 | struct pl08x_phy_chan { | ||
90 | unsigned int id; | ||
91 | void __iomem *base; | ||
92 | spinlock_t lock; | ||
93 | int signal; | ||
94 | struct pl08x_dma_chan *serving; | ||
95 | u32 csrc; | ||
96 | u32 cdst; | ||
97 | u32 clli; | ||
98 | u32 cctl; | ||
99 | u32 ccfg; | ||
100 | }; | ||
101 | |||
102 | /** | ||
103 | * struct pl08x_txd - wrapper for struct dma_async_tx_descriptor | ||
104 | * @llis_bus: DMA memory address (physical) start for the LLIs | ||
105 | * @llis_va: virtual memory address start for the LLIs | ||
106 | */ | ||
107 | struct pl08x_txd { | ||
108 | struct dma_async_tx_descriptor tx; | ||
109 | struct list_head node; | ||
110 | enum dma_data_direction direction; | ||
111 | struct pl08x_bus_data srcbus; | ||
112 | struct pl08x_bus_data dstbus; | ||
113 | int len; | ||
114 | dma_addr_t llis_bus; | ||
115 | void *llis_va; | ||
116 | struct pl08x_channel_data *cd; | ||
117 | bool active; | ||
118 | /* | ||
119 | * Settings to be put into the physical channel when we | ||
120 | * trigger this txd | ||
121 | */ | ||
122 | u32 csrc; | ||
123 | u32 cdst; | ||
124 | u32 clli; | ||
125 | u32 cctl; | ||
126 | }; | ||
127 | |||
128 | /** | ||
129 | * struct pl08x_dma_chan_state - holds the PL08x specific virtual | ||
130 | * channel states | ||
131 | * @PL08X_CHAN_IDLE: the channel is idle | ||
132 | * @PL08X_CHAN_RUNNING: the channel has allocated a physical transport | ||
133 | * channel and is running a transfer on it | ||
134 | * @PL08X_CHAN_PAUSED: the channel has allocated a physical transport | ||
135 | * channel, but the transfer is currently paused | ||
136 | * @PL08X_CHAN_WAITING: the channel is waiting for a physical transport | ||
137 | * channel to become available (only pertains to memcpy channels) | ||
138 | */ | ||
139 | enum pl08x_dma_chan_state { | ||
140 | PL08X_CHAN_IDLE, | ||
141 | PL08X_CHAN_RUNNING, | ||
142 | PL08X_CHAN_PAUSED, | ||
143 | PL08X_CHAN_WAITING, | ||
144 | }; | ||
145 | |||
146 | /** | ||
147 | * struct pl08x_dma_chan - this structure wraps a DMA ENGINE channel | ||
148 | * @chan: wrappped abstract channel | ||
149 | * @phychan: the physical channel utilized by this channel, if there is one | ||
150 | * @tasklet: tasklet scheduled by the IRQ to handle actual work etc | ||
151 | * @name: name of channel | ||
152 | * @cd: channel platform data | ||
153 | * @runtime_addr: address for RX/TX according to the runtime config | ||
154 | * @runtime_direction: current direction of this channel according to | ||
155 | * runtime config | ||
156 | * @lc: last completed transaction on this channel | ||
157 | * @desc_list: queued transactions pending on this channel | ||
158 | * @at: active transaction on this channel | ||
159 | * @lockflags: sometimes we let a lock last between two function calls, | ||
160 | * especially prep/submit, and then we need to store the IRQ flags | ||
161 | * in the channel state, here | ||
162 | * @lock: a lock for this channel data | ||
163 | * @host: a pointer to the host (internal use) | ||
164 | * @state: whether the channel is idle, paused, running etc | ||
165 | * @slave: whether this channel is a device (slave) or for memcpy | ||
166 | * @waiting: a TX descriptor on this channel which is waiting for | ||
167 | * a physical channel to become available | ||
168 | */ | ||
169 | struct pl08x_dma_chan { | ||
170 | struct dma_chan chan; | ||
171 | struct pl08x_phy_chan *phychan; | ||
172 | struct tasklet_struct tasklet; | ||
173 | char *name; | ||
174 | struct pl08x_channel_data *cd; | ||
175 | dma_addr_t runtime_addr; | ||
176 | enum dma_data_direction runtime_direction; | ||
177 | atomic_t last_issued; | ||
178 | dma_cookie_t lc; | ||
179 | struct list_head desc_list; | ||
180 | struct pl08x_txd *at; | ||
181 | unsigned long lockflags; | ||
182 | spinlock_t lock; | ||
183 | void *host; | ||
184 | enum pl08x_dma_chan_state state; | ||
185 | bool slave; | ||
186 | struct pl08x_txd *waiting; | ||
187 | }; | ||
188 | |||
189 | /** | ||
190 | * struct pl08x_platform_data - the platform configuration for the | ||
191 | * PL08x PrimeCells. | ||
192 | * @slave_channels: the channels defined for the different devices on the | ||
193 | * platform, all inclusive, including multiplexed channels. The available | ||
194 | * physical channels will be multiplexed around these signals as they | ||
195 | * are requested, just enumerate all possible channels. | ||
196 | * @get_signal: request a physical signal to be used for a DMA | ||
197 | * transfer immediately: if there is some multiplexing or similar blocking | ||
198 | * the use of the channel the transfer can be denied by returning | ||
199 | * less than zero, else it returns the allocated signal number | ||
200 | * @put_signal: indicate to the platform that this physical signal is not | ||
201 | * running any DMA transfer and multiplexing can be recycled | ||
202 | * @bus_bit_lli: Bit[0] of the address indicated which AHB bus master the | ||
203 | * LLI addresses are on 0/1 Master 1/2. | ||
204 | */ | ||
205 | struct pl08x_platform_data { | ||
206 | struct pl08x_channel_data *slave_channels; | ||
207 | unsigned int num_slave_channels; | ||
208 | struct pl08x_channel_data memcpy_channel; | ||
209 | int (*get_signal)(struct pl08x_dma_chan *); | ||
210 | void (*put_signal)(struct pl08x_dma_chan *); | ||
211 | }; | ||
212 | |||
213 | #ifdef CONFIG_AMBA_PL08X | ||
214 | bool pl08x_filter_id(struct dma_chan *chan, void *chan_id); | ||
215 | #else | ||
216 | static inline bool pl08x_filter_id(struct dma_chan *chan, void *chan_id) | ||
217 | { | ||
218 | return false; | ||
219 | } | ||
220 | #endif | ||
221 | |||
222 | #endif /* AMBA_PL08X_H */ | ||
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index a8e4e832cdbb..475f8c42c0e9 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
@@ -427,8 +427,10 @@ extern rwlock_t vcc_sklist_lock; | |||
427 | 427 | ||
428 | #define ATM_SKB(skb) (((struct atm_skb_data *) (skb)->cb)) | 428 | #define ATM_SKB(skb) (((struct atm_skb_data *) (skb)->cb)) |
429 | 429 | ||
430 | struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops, | 430 | struct atm_dev *atm_dev_register(const char *type, struct device *parent, |
431 | int number,unsigned long *flags); /* number == -1: pick first available */ | 431 | const struct atmdev_ops *ops, |
432 | int number, /* -1 == pick first available */ | ||
433 | unsigned long *flags); | ||
432 | struct atm_dev *atm_dev_lookup(int number); | 434 | struct atm_dev *atm_dev_lookup(int number); |
433 | void atm_dev_deregister(struct atm_dev *dev); | 435 | void atm_dev_deregister(struct atm_dev *dev); |
434 | 436 | ||
diff --git a/include/linux/atomic.h b/include/linux/atomic.h new file mode 100644 index 000000000000..96c038e43d66 --- /dev/null +++ b/include/linux/atomic.h | |||
@@ -0,0 +1,37 @@ | |||
1 | #ifndef _LINUX_ATOMIC_H | ||
2 | #define _LINUX_ATOMIC_H | ||
3 | #include <asm/atomic.h> | ||
4 | |||
5 | /** | ||
6 | * atomic_inc_not_zero_hint - increment if not null | ||
7 | * @v: pointer of type atomic_t | ||
8 | * @hint: probable value of the atomic before the increment | ||
9 | * | ||
10 | * This version of atomic_inc_not_zero() gives a hint of probable | ||
11 | * value of the atomic. This helps processor to not read the memory | ||
12 | * before doing the atomic read/modify/write cycle, lowering | ||
13 | * number of bus transactions on some arches. | ||
14 | * | ||
15 | * Returns: 0 if increment was not done, 1 otherwise. | ||
16 | */ | ||
17 | #ifndef atomic_inc_not_zero_hint | ||
18 | static inline int atomic_inc_not_zero_hint(atomic_t *v, int hint) | ||
19 | { | ||
20 | int val, c = hint; | ||
21 | |||
22 | /* sanity test, should be removed by compiler if hint is a constant */ | ||
23 | if (!hint) | ||
24 | return atomic_inc_not_zero(v); | ||
25 | |||
26 | do { | ||
27 | val = atomic_cmpxchg(v, c, c + 1); | ||
28 | if (val == c) | ||
29 | return 1; | ||
30 | c = val; | ||
31 | } while (c); | ||
32 | |||
33 | return 0; | ||
34 | } | ||
35 | #endif | ||
36 | |||
37 | #endif /* _LINUX_ATOMIC_H */ | ||
diff --git a/include/linux/audit.h b/include/linux/audit.h index e24afabc548f..8b5c0620abf9 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -102,6 +102,7 @@ | |||
102 | #define AUDIT_EOE 1320 /* End of multi-record event */ | 102 | #define AUDIT_EOE 1320 /* End of multi-record event */ |
103 | #define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */ | 103 | #define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */ |
104 | #define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */ | 104 | #define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */ |
105 | #define AUDIT_MMAP 1323 /* Record showing descriptor and flags in mmap */ | ||
105 | 106 | ||
106 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | 107 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ |
107 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | 108 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ |
@@ -478,6 +479,7 @@ extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, | |||
478 | const struct cred *new, | 479 | const struct cred *new, |
479 | const struct cred *old); | 480 | const struct cred *old); |
480 | extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); | 481 | extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); |
482 | extern void __audit_mmap_fd(int fd, int flags); | ||
481 | 483 | ||
482 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) | 484 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) |
483 | { | 485 | { |
@@ -531,6 +533,12 @@ static inline void audit_log_capset(pid_t pid, const struct cred *new, | |||
531 | __audit_log_capset(pid, new, old); | 533 | __audit_log_capset(pid, new, old); |
532 | } | 534 | } |
533 | 535 | ||
536 | static inline void audit_mmap_fd(int fd, int flags) | ||
537 | { | ||
538 | if (unlikely(!audit_dummy_context())) | ||
539 | __audit_mmap_fd(fd, flags); | ||
540 | } | ||
541 | |||
534 | extern int audit_n_rules; | 542 | extern int audit_n_rules; |
535 | extern int audit_signals; | 543 | extern int audit_signals; |
536 | #else | 544 | #else |
@@ -564,6 +572,7 @@ extern int audit_signals; | |||
564 | #define audit_mq_getsetattr(d,s) ((void)0) | 572 | #define audit_mq_getsetattr(d,s) ((void)0) |
565 | #define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) | 573 | #define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) |
566 | #define audit_log_capset(pid, ncr, ocr) ((void)0) | 574 | #define audit_log_capset(pid, ncr, ocr) ((void)0) |
575 | #define audit_mmap_fd(fd, flags) ((void)0) | ||
567 | #define audit_ptrace(t) ((void)0) | 576 | #define audit_ptrace(t) ((void)0) |
568 | #define audit_n_rules 0 | 577 | #define audit_n_rules 0 |
569 | #define audit_signals 0 | 578 | #define audit_signals 0 |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 35b00746c712..4ce34fa937d4 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -111,6 +111,7 @@ void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi); | |||
111 | 111 | ||
112 | extern spinlock_t bdi_lock; | 112 | extern spinlock_t bdi_lock; |
113 | extern struct list_head bdi_list; | 113 | extern struct list_head bdi_list; |
114 | extern struct list_head bdi_pending_list; | ||
114 | 115 | ||
115 | static inline int wb_has_dirty_io(struct bdi_writeback *wb) | 116 | static inline int wb_has_dirty_io(struct bdi_writeback *wb) |
116 | { | 117 | { |
@@ -285,7 +286,7 @@ enum { | |||
285 | void clear_bdi_congested(struct backing_dev_info *bdi, int sync); | 286 | void clear_bdi_congested(struct backing_dev_info *bdi, int sync); |
286 | void set_bdi_congested(struct backing_dev_info *bdi, int sync); | 287 | void set_bdi_congested(struct backing_dev_info *bdi, int sync); |
287 | long congestion_wait(int sync, long timeout); | 288 | long congestion_wait(int sync, long timeout); |
288 | 289 | long wait_iff_congested(struct zone *zone, int sync, long timeout); | |
289 | 290 | ||
290 | static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) | 291 | static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) |
291 | { | 292 | { |
diff --git a/include/linux/basic_mmio_gpio.h b/include/linux/basic_mmio_gpio.h new file mode 100644 index 000000000000..198087a16fc4 --- /dev/null +++ b/include/linux/basic_mmio_gpio.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Basic memory-mapped GPIO controllers. | ||
3 | * | ||
4 | * Copyright 2008 MontaVista Software, Inc. | ||
5 | * Copyright 2008,2010 Anton Vorontsov <cbouatmailru@gmail.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef __BASIC_MMIO_GPIO_H | ||
14 | #define __BASIC_MMIO_GPIO_H | ||
15 | |||
16 | struct bgpio_pdata { | ||
17 | int base; | ||
18 | }; | ||
19 | |||
20 | #endif /* __BASIC_MMIO_GPIO_H */ | ||
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index a065612fc928..64a7114a9394 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -29,6 +29,7 @@ struct linux_binprm{ | |||
29 | char buf[BINPRM_BUF_SIZE]; | 29 | char buf[BINPRM_BUF_SIZE]; |
30 | #ifdef CONFIG_MMU | 30 | #ifdef CONFIG_MMU |
31 | struct vm_area_struct *vma; | 31 | struct vm_area_struct *vma; |
32 | unsigned long vma_pages; | ||
32 | #else | 33 | #else |
33 | # define MAX_ARG_PAGES 32 | 34 | # define MAX_ARG_PAGES 32 |
34 | struct page *page[MAX_ARG_PAGES]; | 35 | struct page *page[MAX_ARG_PAGES]; |
@@ -59,6 +60,10 @@ struct linux_binprm{ | |||
59 | unsigned long loader, exec; | 60 | unsigned long loader, exec; |
60 | }; | 61 | }; |
61 | 62 | ||
63 | extern void acct_arg_size(struct linux_binprm *bprm, unsigned long pages); | ||
64 | extern struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, | ||
65 | int write); | ||
66 | |||
62 | #define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0 | 67 | #define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0 |
63 | #define BINPRM_FLAGS_ENFORCE_NONDUMP (1 << BINPRM_FLAGS_ENFORCE_NONDUMP_BIT) | 68 | #define BINPRM_FLAGS_ENFORCE_NONDUMP (1 << BINPRM_FLAGS_ENFORCE_NONDUMP_BIT) |
64 | 69 | ||
diff --git a/include/linux/bio.h b/include/linux/bio.h index ba679992d39b..35dcdb3589bc 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -66,10 +66,6 @@ | |||
66 | #define bio_offset(bio) bio_iovec((bio))->bv_offset | 66 | #define bio_offset(bio) bio_iovec((bio))->bv_offset |
67 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) | 67 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) |
68 | #define bio_sectors(bio) ((bio)->bi_size >> 9) | 68 | #define bio_sectors(bio) ((bio)->bi_size >> 9) |
69 | #define bio_empty_barrier(bio) \ | ||
70 | ((bio->bi_rw & REQ_HARDBARRIER) && \ | ||
71 | !bio_has_data(bio) && \ | ||
72 | !(bio->bi_rw & REQ_DISCARD)) | ||
73 | 69 | ||
74 | static inline unsigned int bio_cur_bytes(struct bio *bio) | 70 | static inline unsigned int bio_cur_bytes(struct bio *bio) |
75 | { | 71 | { |
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 0437ab6bb54c..46ad5197537a 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
@@ -122,7 +122,6 @@ enum rq_flag_bits { | |||
122 | __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ | 122 | __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ |
123 | __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ | 123 | __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ |
124 | 124 | ||
125 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | ||
126 | __REQ_SYNC, /* request is sync (sync write or read) */ | 125 | __REQ_SYNC, /* request is sync (sync write or read) */ |
127 | __REQ_META, /* metadata io request */ | 126 | __REQ_META, /* metadata io request */ |
128 | __REQ_DISCARD, /* request to discard sectors */ | 127 | __REQ_DISCARD, /* request to discard sectors */ |
@@ -159,7 +158,6 @@ enum rq_flag_bits { | |||
159 | #define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV) | 158 | #define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV) |
160 | #define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT) | 159 | #define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT) |
161 | #define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER) | 160 | #define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER) |
162 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | ||
163 | #define REQ_SYNC (1 << __REQ_SYNC) | 161 | #define REQ_SYNC (1 << __REQ_SYNC) |
164 | #define REQ_META (1 << __REQ_META) | 162 | #define REQ_META (1 << __REQ_META) |
165 | #define REQ_DISCARD (1 << __REQ_DISCARD) | 163 | #define REQ_DISCARD (1 << __REQ_DISCARD) |
@@ -168,8 +166,8 @@ enum rq_flag_bits { | |||
168 | #define REQ_FAILFAST_MASK \ | 166 | #define REQ_FAILFAST_MASK \ |
169 | (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) | 167 | (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) |
170 | #define REQ_COMMON_MASK \ | 168 | #define REQ_COMMON_MASK \ |
171 | (REQ_WRITE | REQ_FAILFAST_MASK | REQ_HARDBARRIER | REQ_SYNC | \ | 169 | (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_DISCARD | \ |
172 | REQ_META | REQ_DISCARD | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) | 170 | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) |
173 | #define REQ_CLONE_MASK REQ_COMMON_MASK | 171 | #define REQ_CLONE_MASK REQ_COMMON_MASK |
174 | 172 | ||
175 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) | 173 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 646b462d04df..36ab42c9bb99 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -250,7 +250,7 @@ struct queue_limits { | |||
250 | 250 | ||
251 | unsigned char misaligned; | 251 | unsigned char misaligned; |
252 | unsigned char discard_misaligned; | 252 | unsigned char discard_misaligned; |
253 | unsigned char no_cluster; | 253 | unsigned char cluster; |
254 | signed char discard_zeroes_data; | 254 | signed char discard_zeroes_data; |
255 | }; | 255 | }; |
256 | 256 | ||
@@ -380,7 +380,6 @@ struct request_queue | |||
380 | #endif | 380 | #endif |
381 | }; | 381 | }; |
382 | 382 | ||
383 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ | ||
384 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ | 383 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ |
385 | #define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ | 384 | #define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ |
386 | #define QUEUE_FLAG_SYNCFULL 3 /* read queue has been filled */ | 385 | #define QUEUE_FLAG_SYNCFULL 3 /* read queue has been filled */ |
@@ -403,7 +402,6 @@ struct request_queue | |||
403 | #define QUEUE_FLAG_SECDISCARD 19 /* supports SECDISCARD */ | 402 | #define QUEUE_FLAG_SECDISCARD 19 /* supports SECDISCARD */ |
404 | 403 | ||
405 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | 404 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ |
406 | (1 << QUEUE_FLAG_CLUSTER) | \ | ||
407 | (1 << QUEUE_FLAG_STACKABLE) | \ | 405 | (1 << QUEUE_FLAG_STACKABLE) | \ |
408 | (1 << QUEUE_FLAG_SAME_COMP) | \ | 406 | (1 << QUEUE_FLAG_SAME_COMP) | \ |
409 | (1 << QUEUE_FLAG_ADD_RANDOM)) | 407 | (1 << QUEUE_FLAG_ADD_RANDOM)) |
@@ -510,6 +508,11 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) | |||
510 | 508 | ||
511 | #define rq_data_dir(rq) ((rq)->cmd_flags & 1) | 509 | #define rq_data_dir(rq) ((rq)->cmd_flags & 1) |
512 | 510 | ||
511 | static inline unsigned int blk_queue_cluster(struct request_queue *q) | ||
512 | { | ||
513 | return q->limits.cluster; | ||
514 | } | ||
515 | |||
513 | /* | 516 | /* |
514 | * We regard a request as sync, if either a read or a sync write | 517 | * We regard a request as sync, if either a read or a sync write |
515 | */ | 518 | */ |
@@ -552,8 +555,7 @@ static inline void blk_clear_queue_full(struct request_queue *q, int sync) | |||
552 | * it already be started by driver. | 555 | * it already be started by driver. |
553 | */ | 556 | */ |
554 | #define RQ_NOMERGE_FLAGS \ | 557 | #define RQ_NOMERGE_FLAGS \ |
555 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER | \ | 558 | (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA) |
556 | REQ_FLUSH | REQ_FUA) | ||
557 | #define rq_mergeable(rq) \ | 559 | #define rq_mergeable(rq) \ |
558 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ | 560 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ |
559 | (((rq)->cmd_flags & REQ_DISCARD) || \ | 561 | (((rq)->cmd_flags & REQ_DISCARD) || \ |
@@ -806,6 +808,7 @@ extern struct request_queue *blk_init_allocated_queue(struct request_queue *, | |||
806 | extern void blk_cleanup_queue(struct request_queue *); | 808 | extern void blk_cleanup_queue(struct request_queue *); |
807 | extern void blk_queue_make_request(struct request_queue *, make_request_fn *); | 809 | extern void blk_queue_make_request(struct request_queue *, make_request_fn *); |
808 | extern void blk_queue_bounce_limit(struct request_queue *, u64); | 810 | extern void blk_queue_bounce_limit(struct request_queue *, u64); |
811 | extern void blk_limits_max_hw_sectors(struct queue_limits *, unsigned int); | ||
809 | extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); | 812 | extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); |
810 | extern void blk_queue_max_segments(struct request_queue *, unsigned short); | 813 | extern void blk_queue_max_segments(struct request_queue *, unsigned short); |
811 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); | 814 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); |
@@ -891,6 +894,14 @@ static inline int sb_issue_discard(struct super_block *sb, sector_t block, | |||
891 | nr_blocks << (sb->s_blocksize_bits - 9), | 894 | nr_blocks << (sb->s_blocksize_bits - 9), |
892 | gfp_mask, flags); | 895 | gfp_mask, flags); |
893 | } | 896 | } |
897 | static inline int sb_issue_zeroout(struct super_block *sb, sector_t block, | ||
898 | sector_t nr_blocks, gfp_t gfp_mask) | ||
899 | { | ||
900 | return blkdev_issue_zeroout(sb->s_bdev, | ||
901 | block << (sb->s_blocksize_bits - 9), | ||
902 | nr_blocks << (sb->s_blocksize_bits - 9), | ||
903 | gfp_mask); | ||
904 | } | ||
894 | 905 | ||
895 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); | 906 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); |
896 | 907 | ||
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 266ab9291232..499dfe982a0e 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -105,6 +105,8 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | |||
105 | 105 | ||
106 | #define alloc_bootmem(x) \ | 106 | #define alloc_bootmem(x) \ |
107 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 107 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
108 | #define alloc_bootmem_align(x, align) \ | ||
109 | __alloc_bootmem(x, align, __pa(MAX_DMA_ADDRESS)) | ||
108 | #define alloc_bootmem_nopanic(x) \ | 110 | #define alloc_bootmem_nopanic(x) \ |
109 | __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 111 | __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
110 | #define alloc_bootmem_pages(x) \ | 112 | #define alloc_bootmem_pages(x) \ |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index dd1b25b2641c..68d1fe7b877c 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -212,7 +212,6 @@ int generic_write_end(struct file *, struct address_space *, | |||
212 | loff_t, unsigned, unsigned, | 212 | loff_t, unsigned, unsigned, |
213 | struct page *, void *); | 213 | struct page *, void *); |
214 | void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); | 214 | void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); |
215 | int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); | ||
216 | int cont_write_begin(struct file *, struct address_space *, loff_t, | 215 | int cont_write_begin(struct file *, struct address_space *, loff_t, |
217 | unsigned, unsigned, struct page **, void **, | 216 | unsigned, unsigned, struct page **, void **, |
218 | get_block_t *, loff_t *); | 217 | get_block_t *, loff_t *); |
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h index f22b2e941686..72c72bfccb88 100644 --- a/include/linux/ceph/libceph.h +++ b/include/linux/ceph/libceph.h | |||
@@ -227,9 +227,10 @@ extern int ceph_open_session(struct ceph_client *client); | |||
227 | extern void ceph_release_page_vector(struct page **pages, int num_pages); | 227 | extern void ceph_release_page_vector(struct page **pages, int num_pages); |
228 | 228 | ||
229 | extern struct page **ceph_get_direct_page_vector(const char __user *data, | 229 | extern struct page **ceph_get_direct_page_vector(const char __user *data, |
230 | int num_pages, | 230 | int num_pages, |
231 | loff_t off, size_t len); | 231 | bool write_page); |
232 | extern void ceph_put_page_vector(struct page **pages, int num_pages); | 232 | extern void ceph_put_page_vector(struct page **pages, int num_pages, |
233 | bool dirty); | ||
233 | extern void ceph_release_page_vector(struct page **pages, int num_pages); | 234 | extern void ceph_release_page_vector(struct page **pages, int num_pages); |
234 | extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags); | 235 | extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags); |
235 | extern int ceph_copy_user_to_page_vector(struct page **pages, | 236 | extern int ceph_copy_user_to_page_vector(struct page **pages, |
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index 5956d62c3057..a108b425fee2 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
@@ -82,6 +82,7 @@ struct ceph_msg { | |||
82 | struct ceph_buffer *middle; | 82 | struct ceph_buffer *middle; |
83 | struct page **pages; /* data payload. NOT OWNER. */ | 83 | struct page **pages; /* data payload. NOT OWNER. */ |
84 | unsigned nr_pages; /* size of page array */ | 84 | unsigned nr_pages; /* size of page array */ |
85 | unsigned page_alignment; /* io offset in first page */ | ||
85 | struct ceph_pagelist *pagelist; /* instead of pages */ | 86 | struct ceph_pagelist *pagelist; /* instead of pages */ |
86 | struct list_head list_head; | 87 | struct list_head list_head; |
87 | struct kref kref; | 88 | struct kref kref; |
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index 6c91fb032c39..a1af29648fb5 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
@@ -79,6 +79,7 @@ struct ceph_osd_request { | |||
79 | struct ceph_file_layout r_file_layout; | 79 | struct ceph_file_layout r_file_layout; |
80 | struct ceph_snap_context *r_snapc; /* snap context for writes */ | 80 | struct ceph_snap_context *r_snapc; /* snap context for writes */ |
81 | unsigned r_num_pages; /* size of page array (follows) */ | 81 | unsigned r_num_pages; /* size of page array (follows) */ |
82 | unsigned r_page_alignment; /* io offset in first page */ | ||
82 | struct page **r_pages; /* pages for data payload */ | 83 | struct page **r_pages; /* pages for data payload */ |
83 | int r_pages_from_pool; | 84 | int r_pages_from_pool; |
84 | int r_own_pages; /* if true, i own page list */ | 85 | int r_own_pages; /* if true, i own page list */ |
@@ -194,7 +195,8 @@ extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, | |||
194 | int do_sync, u32 truncate_seq, | 195 | int do_sync, u32 truncate_seq, |
195 | u64 truncate_size, | 196 | u64 truncate_size, |
196 | struct timespec *mtime, | 197 | struct timespec *mtime, |
197 | bool use_mempool, int num_reply); | 198 | bool use_mempool, int num_reply, |
199 | int page_align); | ||
198 | 200 | ||
199 | static inline void ceph_osdc_get_request(struct ceph_osd_request *req) | 201 | static inline void ceph_osdc_get_request(struct ceph_osd_request *req) |
200 | { | 202 | { |
@@ -218,7 +220,8 @@ extern int ceph_osdc_readpages(struct ceph_osd_client *osdc, | |||
218 | struct ceph_file_layout *layout, | 220 | struct ceph_file_layout *layout, |
219 | u64 off, u64 *plen, | 221 | u64 off, u64 *plen, |
220 | u32 truncate_seq, u64 truncate_size, | 222 | u32 truncate_seq, u64 truncate_size, |
221 | struct page **pages, int nr_pages); | 223 | struct page **pages, int nr_pages, |
224 | int page_align); | ||
222 | 225 | ||
223 | extern int ceph_osdc_writepages(struct ceph_osd_client *osdc, | 226 | extern int ceph_osdc_writepages(struct ceph_osd_client *osdc, |
224 | struct ceph_vino vino, | 227 | struct ceph_vino vino, |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 709dfb901d11..ed4ba111bc8d 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -154,6 +154,10 @@ enum { | |||
154 | * A thread in rmdir() is wating for this cgroup. | 154 | * A thread in rmdir() is wating for this cgroup. |
155 | */ | 155 | */ |
156 | CGRP_WAIT_ON_RMDIR, | 156 | CGRP_WAIT_ON_RMDIR, |
157 | /* | ||
158 | * Clone cgroup values when creating a new child cgroup | ||
159 | */ | ||
160 | CGRP_CLONE_CHILDREN, | ||
157 | }; | 161 | }; |
158 | 162 | ||
159 | /* which pidlist file are we talking about? */ | 163 | /* which pidlist file are we talking about? */ |
diff --git a/include/linux/cnt32_to_63.h b/include/linux/cnt32_to_63.h index 7605fdd1eb65..e3d8bf26e5eb 100644 --- a/include/linux/cnt32_to_63.h +++ b/include/linux/cnt32_to_63.h | |||
@@ -61,13 +61,31 @@ union cnt32_to_63 { | |||
61 | * | 61 | * |
62 | * 2) this code must not be preempted for a duration longer than the | 62 | * 2) this code must not be preempted for a duration longer than the |
63 | * 32-bit counter half period minus the longest period between two | 63 | * 32-bit counter half period minus the longest period between two |
64 | * calls to this code. | 64 | * calls to this code; |
65 | * | 65 | * |
66 | * Those requirements ensure proper update to the state bit in memory. | 66 | * Those requirements ensure proper update to the state bit in memory. |
67 | * This is usually not a problem in practice, but if it is then a kernel | 67 | * This is usually not a problem in practice, but if it is then a kernel |
68 | * timer should be scheduled to manage for this code to be executed often | 68 | * timer should be scheduled to manage for this code to be executed often |
69 | * enough. | 69 | * enough. |
70 | * | 70 | * |
71 | * And finally: | ||
72 | * | ||
73 | * 3) the cnt_lo argument must be seen as a globally incrementing value, | ||
74 | * meaning that it should be a direct reference to the counter data which | ||
75 | * can be evaluated according to a specific ordering within the macro, | ||
76 | * and not the result of a previous evaluation stored in a variable. | ||
77 | * | ||
78 | * For example, this is wrong: | ||
79 | * | ||
80 | * u32 partial = get_hw_count(); | ||
81 | * u64 full = cnt32_to_63(partial); | ||
82 | * return full; | ||
83 | * | ||
84 | * This is fine: | ||
85 | * | ||
86 | * u64 full = cnt32_to_63(get_hw_count()); | ||
87 | * return full; | ||
88 | * | ||
71 | * Note that the top bit (bit 63) in the returned value should be considered | 89 | * Note that the top bit (bit 63) in the returned value should be considered |
72 | * as garbage. It is not cleared here because callers are likely to use a | 90 | * as garbage. It is not cleared here because callers are likely to use a |
73 | * multiplier on the returned value which can get rid of the top bit | 91 | * multiplier on the returned value which can get rid of the top bit |
diff --git a/include/linux/completion.h b/include/linux/completion.h index 51e3145196f6..36d57f74cd01 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/wait.h> | 11 | #include <linux/wait.h> |
12 | 12 | ||
13 | /** | 13 | /* |
14 | * struct completion - structure used to maintain state for a "completion" | 14 | * struct completion - structure used to maintain state for a "completion" |
15 | * | 15 | * |
16 | * This is the opaque structure used to maintain the state for a "completion". | 16 | * This is the opaque structure used to maintain the state for a "completion". |
@@ -34,7 +34,7 @@ struct completion { | |||
34 | ({ init_completion(&work); work; }) | 34 | ({ init_completion(&work); work; }) |
35 | 35 | ||
36 | /** | 36 | /** |
37 | * DECLARE_COMPLETION: - declare and initialize a completion structure | 37 | * DECLARE_COMPLETION - declare and initialize a completion structure |
38 | * @work: identifier for the completion structure | 38 | * @work: identifier for the completion structure |
39 | * | 39 | * |
40 | * This macro declares and initializes a completion structure. Generally used | 40 | * This macro declares and initializes a completion structure. Generally used |
@@ -50,7 +50,7 @@ struct completion { | |||
50 | * are on the kernel stack: | 50 | * are on the kernel stack: |
51 | */ | 51 | */ |
52 | /** | 52 | /** |
53 | * DECLARE_COMPLETION_ONSTACK: - declare and initialize a completion structure | 53 | * DECLARE_COMPLETION_ONSTACK - declare and initialize a completion structure |
54 | * @work: identifier for the completion structure | 54 | * @work: identifier for the completion structure |
55 | * | 55 | * |
56 | * This macro declares and initializes a completion structure on the kernel | 56 | * This macro declares and initializes a completion structure on the kernel |
@@ -64,7 +64,7 @@ struct completion { | |||
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * init_completion: - Initialize a dynamically allocated completion | 67 | * init_completion - Initialize a dynamically allocated completion |
68 | * @x: completion structure that is to be initialized | 68 | * @x: completion structure that is to be initialized |
69 | * | 69 | * |
70 | * This inline function will initialize a dynamically created completion | 70 | * This inline function will initialize a dynamically created completion |
@@ -92,7 +92,7 @@ extern void complete(struct completion *); | |||
92 | extern void complete_all(struct completion *); | 92 | extern void complete_all(struct completion *); |
93 | 93 | ||
94 | /** | 94 | /** |
95 | * INIT_COMPLETION: - reinitialize a completion structure | 95 | * INIT_COMPLETION - reinitialize a completion structure |
96 | * @x: completion structure to be reinitialized | 96 | * @x: completion structure to be reinitialized |
97 | * | 97 | * |
98 | * This macro should be used to reinitialize a completion structure so it can | 98 | * This macro should be used to reinitialize a completion structure so it can |
diff --git a/include/linux/connector.h b/include/linux/connector.h index 3a779ffba60b..7e8ca75d2dad 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -88,12 +88,6 @@ struct cn_queue_dev { | |||
88 | unsigned char name[CN_CBQ_NAMELEN]; | 88 | unsigned char name[CN_CBQ_NAMELEN]; |
89 | 89 | ||
90 | struct workqueue_struct *cn_queue; | 90 | struct workqueue_struct *cn_queue; |
91 | /* Sent to kevent to create cn_queue only when needed */ | ||
92 | struct work_struct wq_creation; | ||
93 | /* Tell if the wq_creation job is pending/completed */ | ||
94 | atomic_t wq_requested; | ||
95 | /* Wait for cn_queue to be created */ | ||
96 | wait_queue_head_t wq_created; | ||
97 | 91 | ||
98 | struct list_head queue_list; | 92 | struct list_head queue_list; |
99 | spinlock_t queue_lock; | 93 | spinlock_t queue_lock; |
@@ -141,8 +135,6 @@ int cn_netlink_send(struct cn_msg *, u32, gfp_t); | |||
141 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(struct cn_msg *, struct netlink_skb_parms *)); | 135 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(struct cn_msg *, struct netlink_skb_parms *)); |
142 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); | 136 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); |
143 | 137 | ||
144 | int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work); | ||
145 | |||
146 | struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); | 138 | struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); |
147 | void cn_queue_free_dev(struct cn_queue_dev *dev); | 139 | void cn_queue_free_dev(struct cn_queue_dev *dev); |
148 | 140 | ||
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 4823af64e9db..5f09323ee880 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -10,11 +10,6 @@ | |||
10 | * | 10 | * |
11 | * CPUs are exported via sysfs in the class/cpu/devices/ | 11 | * CPUs are exported via sysfs in the class/cpu/devices/ |
12 | * directory. | 12 | * directory. |
13 | * | ||
14 | * Per-cpu interfaces can be implemented using a struct device_interface. | ||
15 | * See the following for how to do this: | ||
16 | * - drivers/base/intf.c | ||
17 | * - Documentation/driver-model/interface.txt | ||
18 | */ | 13 | */ |
19 | #ifndef _LINUX_CPU_H_ | 14 | #ifndef _LINUX_CPU_H_ |
20 | #define _LINUX_CPU_H_ | 15 | #define _LINUX_CPU_H_ |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 7187bd8a75f6..749f01ccd26e 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -462,7 +462,8 @@ struct dccp_ackvec; | |||
462 | * @dccps_hc_rx_insert_options - receiver wants to add options when acking | 462 | * @dccps_hc_rx_insert_options - receiver wants to add options when acking |
463 | * @dccps_hc_tx_insert_options - sender wants to add options when sending | 463 | * @dccps_hc_tx_insert_options - sender wants to add options when sending |
464 | * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3) | 464 | * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3) |
465 | * @dccps_xmit_timer - timer for when CCID is not ready to send | 465 | * @dccps_xmitlet - tasklet scheduled by the TX CCID to dequeue data packets |
466 | * @dccps_xmit_timer - used by the TX CCID to delay sending (rate-based pacing) | ||
466 | * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) | 467 | * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) |
467 | */ | 468 | */ |
468 | struct dccp_sock { | 469 | struct dccp_sock { |
@@ -502,6 +503,7 @@ struct dccp_sock { | |||
502 | __u8 dccps_hc_rx_insert_options:1; | 503 | __u8 dccps_hc_rx_insert_options:1; |
503 | __u8 dccps_hc_tx_insert_options:1; | 504 | __u8 dccps_hc_tx_insert_options:1; |
504 | __u8 dccps_server_timewait:1; | 505 | __u8 dccps_server_timewait:1; |
506 | struct tasklet_struct dccps_xmitlet; | ||
505 | struct timer_list dccps_xmit_timer; | 507 | struct timer_list dccps_xmit_timer; |
506 | }; | 508 | }; |
507 | 509 | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index e2106495cc11..8cd00ad98d37 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -64,13 +64,15 @@ enum dma_transaction_type { | |||
64 | DMA_PQ_VAL, | 64 | DMA_PQ_VAL, |
65 | DMA_MEMSET, | 65 | DMA_MEMSET, |
66 | DMA_INTERRUPT, | 66 | DMA_INTERRUPT, |
67 | DMA_SG, | ||
67 | DMA_PRIVATE, | 68 | DMA_PRIVATE, |
68 | DMA_ASYNC_TX, | 69 | DMA_ASYNC_TX, |
69 | DMA_SLAVE, | 70 | DMA_SLAVE, |
71 | DMA_CYCLIC, | ||
70 | }; | 72 | }; |
71 | 73 | ||
72 | /* last transaction type for creation of the capabilities mask */ | 74 | /* last transaction type for creation of the capabilities mask */ |
73 | #define DMA_TX_TYPE_END (DMA_SLAVE + 1) | 75 | #define DMA_TX_TYPE_END (DMA_CYCLIC + 1) |
74 | 76 | ||
75 | 77 | ||
76 | /** | 78 | /** |
@@ -119,12 +121,15 @@ enum dma_ctrl_flags { | |||
119 | * configuration data in statically from the platform). An additional | 121 | * configuration data in statically from the platform). An additional |
120 | * argument of struct dma_slave_config must be passed in with this | 122 | * argument of struct dma_slave_config must be passed in with this |
121 | * command. | 123 | * command. |
124 | * @FSLDMA_EXTERNAL_START: this command will put the Freescale DMA controller | ||
125 | * into external start mode. | ||
122 | */ | 126 | */ |
123 | enum dma_ctrl_cmd { | 127 | enum dma_ctrl_cmd { |
124 | DMA_TERMINATE_ALL, | 128 | DMA_TERMINATE_ALL, |
125 | DMA_PAUSE, | 129 | DMA_PAUSE, |
126 | DMA_RESUME, | 130 | DMA_RESUME, |
127 | DMA_SLAVE_CONFIG, | 131 | DMA_SLAVE_CONFIG, |
132 | FSLDMA_EXTERNAL_START, | ||
128 | }; | 133 | }; |
129 | 134 | ||
130 | /** | 135 | /** |
@@ -316,14 +321,14 @@ struct dma_async_tx_descriptor { | |||
316 | dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); | 321 | dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); |
317 | dma_async_tx_callback callback; | 322 | dma_async_tx_callback callback; |
318 | void *callback_param; | 323 | void *callback_param; |
319 | #ifndef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH | 324 | #ifdef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH |
320 | struct dma_async_tx_descriptor *next; | 325 | struct dma_async_tx_descriptor *next; |
321 | struct dma_async_tx_descriptor *parent; | 326 | struct dma_async_tx_descriptor *parent; |
322 | spinlock_t lock; | 327 | spinlock_t lock; |
323 | #endif | 328 | #endif |
324 | }; | 329 | }; |
325 | 330 | ||
326 | #ifdef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH | 331 | #ifndef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH |
327 | static inline void txd_lock(struct dma_async_tx_descriptor *txd) | 332 | static inline void txd_lock(struct dma_async_tx_descriptor *txd) |
328 | { | 333 | { |
329 | } | 334 | } |
@@ -422,6 +427,9 @@ struct dma_tx_state { | |||
422 | * @device_prep_dma_memset: prepares a memset operation | 427 | * @device_prep_dma_memset: prepares a memset operation |
423 | * @device_prep_dma_interrupt: prepares an end of chain interrupt operation | 428 | * @device_prep_dma_interrupt: prepares an end of chain interrupt operation |
424 | * @device_prep_slave_sg: prepares a slave dma operation | 429 | * @device_prep_slave_sg: prepares a slave dma operation |
430 | * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio. | ||
431 | * The function takes a buffer of size buf_len. The callback function will | ||
432 | * be called after period_len bytes have been transferred. | ||
425 | * @device_control: manipulate all pending operations on a channel, returns | 433 | * @device_control: manipulate all pending operations on a channel, returns |
426 | * zero or error code | 434 | * zero or error code |
427 | * @device_tx_status: poll for transaction completion, the optional | 435 | * @device_tx_status: poll for transaction completion, the optional |
@@ -473,11 +481,19 @@ struct dma_device { | |||
473 | unsigned long flags); | 481 | unsigned long flags); |
474 | struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( | 482 | struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( |
475 | struct dma_chan *chan, unsigned long flags); | 483 | struct dma_chan *chan, unsigned long flags); |
484 | struct dma_async_tx_descriptor *(*device_prep_dma_sg)( | ||
485 | struct dma_chan *chan, | ||
486 | struct scatterlist *dst_sg, unsigned int dst_nents, | ||
487 | struct scatterlist *src_sg, unsigned int src_nents, | ||
488 | unsigned long flags); | ||
476 | 489 | ||
477 | struct dma_async_tx_descriptor *(*device_prep_slave_sg)( | 490 | struct dma_async_tx_descriptor *(*device_prep_slave_sg)( |
478 | struct dma_chan *chan, struct scatterlist *sgl, | 491 | struct dma_chan *chan, struct scatterlist *sgl, |
479 | unsigned int sg_len, enum dma_data_direction direction, | 492 | unsigned int sg_len, enum dma_data_direction direction, |
480 | unsigned long flags); | 493 | unsigned long flags); |
494 | struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)( | ||
495 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, | ||
496 | size_t period_len, enum dma_data_direction direction); | ||
481 | int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd, | 497 | int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd, |
482 | unsigned long arg); | 498 | unsigned long arg); |
483 | 499 | ||
@@ -487,6 +503,40 @@ struct dma_device { | |||
487 | void (*device_issue_pending)(struct dma_chan *chan); | 503 | void (*device_issue_pending)(struct dma_chan *chan); |
488 | }; | 504 | }; |
489 | 505 | ||
506 | static inline int dmaengine_device_control(struct dma_chan *chan, | ||
507 | enum dma_ctrl_cmd cmd, | ||
508 | unsigned long arg) | ||
509 | { | ||
510 | return chan->device->device_control(chan, cmd, arg); | ||
511 | } | ||
512 | |||
513 | static inline int dmaengine_slave_config(struct dma_chan *chan, | ||
514 | struct dma_slave_config *config) | ||
515 | { | ||
516 | return dmaengine_device_control(chan, DMA_SLAVE_CONFIG, | ||
517 | (unsigned long)config); | ||
518 | } | ||
519 | |||
520 | static inline int dmaengine_terminate_all(struct dma_chan *chan) | ||
521 | { | ||
522 | return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); | ||
523 | } | ||
524 | |||
525 | static inline int dmaengine_pause(struct dma_chan *chan) | ||
526 | { | ||
527 | return dmaengine_device_control(chan, DMA_PAUSE, 0); | ||
528 | } | ||
529 | |||
530 | static inline int dmaengine_resume(struct dma_chan *chan) | ||
531 | { | ||
532 | return dmaengine_device_control(chan, DMA_RESUME, 0); | ||
533 | } | ||
534 | |||
535 | static inline int dmaengine_submit(struct dma_async_tx_descriptor *desc) | ||
536 | { | ||
537 | return desc->tx_submit(desc); | ||
538 | } | ||
539 | |||
490 | static inline bool dmaengine_check_align(u8 align, size_t off1, size_t off2, size_t len) | 540 | static inline bool dmaengine_check_align(u8 align, size_t off1, size_t off2, size_t len) |
491 | { | 541 | { |
492 | size_t mask; | 542 | size_t mask; |
@@ -606,11 +656,11 @@ static inline void net_dmaengine_put(void) | |||
606 | #ifdef CONFIG_ASYNC_TX_DMA | 656 | #ifdef CONFIG_ASYNC_TX_DMA |
607 | #define async_dmaengine_get() dmaengine_get() | 657 | #define async_dmaengine_get() dmaengine_get() |
608 | #define async_dmaengine_put() dmaengine_put() | 658 | #define async_dmaengine_put() dmaengine_put() |
609 | #ifdef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH | 659 | #ifndef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH |
610 | #define async_dma_find_channel(type) dma_find_channel(DMA_ASYNC_TX) | 660 | #define async_dma_find_channel(type) dma_find_channel(DMA_ASYNC_TX) |
611 | #else | 661 | #else |
612 | #define async_dma_find_channel(type) dma_find_channel(type) | 662 | #define async_dma_find_channel(type) dma_find_channel(type) |
613 | #endif /* CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH */ | 663 | #endif /* CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH */ |
614 | #else | 664 | #else |
615 | static inline void async_dmaengine_get(void) | 665 | static inline void async_dmaengine_get(void) |
616 | { | 666 | { |
@@ -774,6 +824,8 @@ enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie); | |||
774 | #ifdef CONFIG_DMA_ENGINE | 824 | #ifdef CONFIG_DMA_ENGINE |
775 | enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); | 825 | enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); |
776 | void dma_issue_pending_all(void); | 826 | void dma_issue_pending_all(void); |
827 | struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param); | ||
828 | void dma_release_channel(struct dma_chan *chan); | ||
777 | #else | 829 | #else |
778 | static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) | 830 | static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) |
779 | { | 831 | { |
@@ -781,7 +833,14 @@ static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descript | |||
781 | } | 833 | } |
782 | static inline void dma_issue_pending_all(void) | 834 | static inline void dma_issue_pending_all(void) |
783 | { | 835 | { |
784 | do { } while (0); | 836 | } |
837 | static inline struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, | ||
838 | dma_filter_fn fn, void *fn_param) | ||
839 | { | ||
840 | return NULL; | ||
841 | } | ||
842 | static inline void dma_release_channel(struct dma_chan *chan) | ||
843 | { | ||
785 | } | 844 | } |
786 | #endif | 845 | #endif |
787 | 846 | ||
@@ -792,8 +851,6 @@ void dma_async_device_unregister(struct dma_device *device); | |||
792 | void dma_run_dependencies(struct dma_async_tx_descriptor *tx); | 851 | void dma_run_dependencies(struct dma_async_tx_descriptor *tx); |
793 | struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type); | 852 | struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type); |
794 | #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) | 853 | #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) |
795 | struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param); | ||
796 | void dma_release_channel(struct dma_chan *chan); | ||
797 | 854 | ||
798 | /* --- Helper iov-locking functions --- */ | 855 | /* --- Helper iov-locking functions --- */ |
799 | 856 | ||
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index a7d9dc21391d..7b776d71d36d 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -175,10 +175,21 @@ static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev) | |||
175 | return 0; | 175 | return 0; |
176 | } | 176 | } |
177 | 177 | ||
178 | #define enable_intr_remapping(mode) (-1) | ||
179 | #define disable_intr_remapping() (0) | ||
180 | #define reenable_intr_remapping(mode) (0) | ||
181 | #define intr_remapping_enabled (0) | 178 | #define intr_remapping_enabled (0) |
179 | |||
180 | static inline int enable_intr_remapping(int eim) | ||
181 | { | ||
182 | return -1; | ||
183 | } | ||
184 | |||
185 | static inline void disable_intr_remapping(void) | ||
186 | { | ||
187 | } | ||
188 | |||
189 | static inline int reenable_intr_remapping(int eim) | ||
190 | { | ||
191 | return 0; | ||
192 | } | ||
182 | #endif | 193 | #endif |
183 | 194 | ||
184 | /* Can't use the common MSI interrupt functions | 195 | /* Can't use the common MSI interrupt functions |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index 9b2a0158f399..ef44c7a0638c 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
@@ -53,7 +53,7 @@ | |||
53 | 53 | ||
54 | 54 | ||
55 | extern const char *drbd_buildtag(void); | 55 | extern const char *drbd_buildtag(void); |
56 | #define REL_VERSION "8.3.9rc2" | 56 | #define REL_VERSION "8.3.9" |
57 | #define API_VERSION 88 | 57 | #define API_VERSION 88 |
58 | #define PRO_VERSION_MIN 86 | 58 | #define PRO_VERSION_MIN 86 |
59 | #define PRO_VERSION_MAX 95 | 59 | #define PRO_VERSION_MAX 95 |
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h index 63531a6b4d2a..6c6133f76e16 100644 --- a/include/linux/fanotify.h +++ b/include/linux/fanotify.h | |||
@@ -6,18 +6,19 @@ | |||
6 | /* the following events that user-space can register for */ | 6 | /* the following events that user-space can register for */ |
7 | #define FAN_ACCESS 0x00000001 /* File was accessed */ | 7 | #define FAN_ACCESS 0x00000001 /* File was accessed */ |
8 | #define FAN_MODIFY 0x00000002 /* File was modified */ | 8 | #define FAN_MODIFY 0x00000002 /* File was modified */ |
9 | #define FAN_CLOSE_WRITE 0x00000008 /* Unwrittable file closed */ | 9 | #define FAN_CLOSE_WRITE 0x00000008 /* Writtable file closed */ |
10 | #define FAN_CLOSE_NOWRITE 0x00000010 /* Writtable file closed */ | 10 | #define FAN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */ |
11 | #define FAN_OPEN 0x00000020 /* File was opened */ | 11 | #define FAN_OPEN 0x00000020 /* File was opened */ |
12 | 12 | ||
13 | #define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */ | ||
14 | |||
15 | /* FIXME currently Q's have no limit.... */ | ||
16 | #define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ | 13 | #define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ |
17 | 14 | ||
18 | #define FAN_OPEN_PERM 0x00010000 /* File open in perm check */ | 15 | #define FAN_OPEN_PERM 0x00010000 /* File open in perm check */ |
19 | #define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */ | 16 | #define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */ |
20 | 17 | ||
18 | #define FAN_ONDIR 0x40000000 /* event occurred against dir */ | ||
19 | |||
20 | #define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */ | ||
21 | |||
21 | /* helper events */ | 22 | /* helper events */ |
22 | #define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */ | 23 | #define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */ |
23 | 24 | ||
@@ -25,7 +26,19 @@ | |||
25 | #define FAN_CLOEXEC 0x00000001 | 26 | #define FAN_CLOEXEC 0x00000001 |
26 | #define FAN_NONBLOCK 0x00000002 | 27 | #define FAN_NONBLOCK 0x00000002 |
27 | 28 | ||
28 | #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK) | 29 | /* These are NOT bitwise flags. Both bits are used togther. */ |
30 | #define FAN_CLASS_NOTIF 0x00000000 | ||
31 | #define FAN_CLASS_CONTENT 0x00000004 | ||
32 | #define FAN_CLASS_PRE_CONTENT 0x00000008 | ||
33 | #define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \ | ||
34 | FAN_CLASS_PRE_CONTENT) | ||
35 | |||
36 | #define FAN_UNLIMITED_QUEUE 0x00000010 | ||
37 | #define FAN_UNLIMITED_MARKS 0x00000020 | ||
38 | |||
39 | #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \ | ||
40 | FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\ | ||
41 | FAN_UNLIMITED_MARKS) | ||
29 | 42 | ||
30 | /* flags used for fanotify_modify_mark() */ | 43 | /* flags used for fanotify_modify_mark() */ |
31 | #define FAN_MARK_ADD 0x00000001 | 44 | #define FAN_MARK_ADD 0x00000001 |
@@ -36,6 +49,10 @@ | |||
36 | #define FAN_MARK_IGNORED_MASK 0x00000020 | 49 | #define FAN_MARK_IGNORED_MASK 0x00000020 |
37 | #define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 | 50 | #define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 |
38 | #define FAN_MARK_FLUSH 0x00000080 | 51 | #define FAN_MARK_FLUSH 0x00000080 |
52 | #ifdef __KERNEL__ | ||
53 | /* not valid from userspace, only kernel internal */ | ||
54 | #define FAN_MARK_ONDIR 0x00000100 | ||
55 | #endif | ||
39 | 56 | ||
40 | #define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ | 57 | #define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ |
41 | FAN_MARK_REMOVE |\ | 58 | FAN_MARK_REMOVE |\ |
@@ -43,7 +60,8 @@ | |||
43 | FAN_MARK_ONLYDIR |\ | 60 | FAN_MARK_ONLYDIR |\ |
44 | FAN_MARK_MOUNT |\ | 61 | FAN_MARK_MOUNT |\ |
45 | FAN_MARK_IGNORED_MASK |\ | 62 | FAN_MARK_IGNORED_MASK |\ |
46 | FAN_MARK_IGNORED_SURV_MODIFY) | 63 | FAN_MARK_IGNORED_SURV_MODIFY |\ |
64 | FAN_MARK_FLUSH) | ||
47 | 65 | ||
48 | /* | 66 | /* |
49 | * All of the events - we build the list by hand so that we can add flags in | 67 | * All of the events - we build the list by hand so that we can add flags in |
@@ -65,24 +83,28 @@ | |||
65 | FAN_ALL_PERM_EVENTS |\ | 83 | FAN_ALL_PERM_EVENTS |\ |
66 | FAN_Q_OVERFLOW) | 84 | FAN_Q_OVERFLOW) |
67 | 85 | ||
68 | #define FANOTIFY_METADATA_VERSION 2 | 86 | #define FANOTIFY_METADATA_VERSION 3 |
69 | 87 | ||
70 | struct fanotify_event_metadata { | 88 | struct fanotify_event_metadata { |
71 | __u32 event_len; | 89 | __u32 event_len; |
72 | __u32 vers; | 90 | __u8 vers; |
73 | __u64 mask; | 91 | __u8 reserved; |
92 | __u16 metadata_len; | ||
93 | __aligned_u64 mask; | ||
74 | __s32 fd; | 94 | __s32 fd; |
75 | __s32 pid; | 95 | __s32 pid; |
76 | } __attribute__ ((packed)); | 96 | }; |
77 | 97 | ||
78 | struct fanotify_response { | 98 | struct fanotify_response { |
79 | __s32 fd; | 99 | __s32 fd; |
80 | __u32 response; | 100 | __u32 response; |
81 | } __attribute__ ((packed)); | 101 | }; |
82 | 102 | ||
83 | /* Legit userspace responses to a _PERM event */ | 103 | /* Legit userspace responses to a _PERM event */ |
84 | #define FAN_ALLOW 0x01 | 104 | #define FAN_ALLOW 0x01 |
85 | #define FAN_DENY 0x02 | 105 | #define FAN_DENY 0x02 |
106 | /* No fd set in event */ | ||
107 | #define FAN_NOFD -1 | ||
86 | 108 | ||
87 | /* Helper functions to deal with fanotify_event_metadata buffers */ | 109 | /* Helper functions to deal with fanotify_event_metadata buffers */ |
88 | #define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata)) | 110 | #define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata)) |
diff --git a/include/linux/fb.h b/include/linux/fb.h index f0268deca658..d1631d37e9e0 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -931,6 +931,8 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) { | |||
931 | #define fb_writel sbus_writel | 931 | #define fb_writel sbus_writel |
932 | #define fb_writeq sbus_writeq | 932 | #define fb_writeq sbus_writeq |
933 | #define fb_memset sbus_memset_io | 933 | #define fb_memset sbus_memset_io |
934 | #define fb_memcpy_fromfb sbus_memcpy_fromio | ||
935 | #define fb_memcpy_tofb sbus_memcpy_toio | ||
934 | 936 | ||
935 | #elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) || defined(__bfin__) | 937 | #elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) || defined(__bfin__) |
936 | 938 | ||
@@ -943,6 +945,8 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) { | |||
943 | #define fb_writel __raw_writel | 945 | #define fb_writel __raw_writel |
944 | #define fb_writeq __raw_writeq | 946 | #define fb_writeq __raw_writeq |
945 | #define fb_memset memset_io | 947 | #define fb_memset memset_io |
948 | #define fb_memcpy_fromfb memcpy_fromio | ||
949 | #define fb_memcpy_tofb memcpy_toio | ||
946 | 950 | ||
947 | #else | 951 | #else |
948 | 952 | ||
@@ -955,6 +959,8 @@ static inline struct apertures_struct *alloc_apertures(unsigned int max_num) { | |||
955 | #define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b)) | 959 | #define fb_writel(b,addr) (*(volatile u32 *) (addr) = (b)) |
956 | #define fb_writeq(b,addr) (*(volatile u64 *) (addr) = (b)) | 960 | #define fb_writeq(b,addr) (*(volatile u64 *) (addr) = (b)) |
957 | #define fb_memset memset | 961 | #define fb_memset memset |
962 | #define fb_memcpy_fromfb memcpy | ||
963 | #define fb_memcpy_tofb memcpy | ||
958 | 964 | ||
959 | #endif | 965 | #endif |
960 | 966 | ||
@@ -1116,6 +1122,7 @@ extern const struct fb_videomode *fb_find_best_display(const struct fb_monspecs | |||
1116 | 1122 | ||
1117 | /* drivers/video/fbcmap.c */ | 1123 | /* drivers/video/fbcmap.c */ |
1118 | extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); | 1124 | extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); |
1125 | extern int fb_alloc_cmap_gfp(struct fb_cmap *cmap, int len, int transp, gfp_t flags); | ||
1119 | extern void fb_dealloc_cmap(struct fb_cmap *cmap); | 1126 | extern void fb_dealloc_cmap(struct fb_cmap *cmap); |
1120 | extern int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to); | 1127 | extern int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to); |
1121 | extern int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to); | 1128 | extern int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4f34ff6e5558..090f0eacde29 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/limits.h> | 9 | #include <linux/limits.h> |
10 | #include <linux/ioctl.h> | 10 | #include <linux/ioctl.h> |
11 | #include <linux/blk_types.h> | 11 | #include <linux/blk_types.h> |
12 | #include <linux/types.h> | ||
12 | 13 | ||
13 | /* | 14 | /* |
14 | * It's silly to have NR_OPEN bigger than NR_FILE, but you can change | 15 | * It's silly to have NR_OPEN bigger than NR_FILE, but you can change |
@@ -32,11 +33,17 @@ | |||
32 | #define SEEK_END 2 /* seek relative to end of file */ | 33 | #define SEEK_END 2 /* seek relative to end of file */ |
33 | #define SEEK_MAX SEEK_END | 34 | #define SEEK_MAX SEEK_END |
34 | 35 | ||
36 | struct fstrim_range { | ||
37 | __u64 start; | ||
38 | __u64 len; | ||
39 | __u64 minlen; | ||
40 | }; | ||
41 | |||
35 | /* And dynamically-tunable limits and defaults: */ | 42 | /* And dynamically-tunable limits and defaults: */ |
36 | struct files_stat_struct { | 43 | struct files_stat_struct { |
37 | int nr_files; /* read only */ | 44 | unsigned long nr_files; /* read only */ |
38 | int nr_free_files; /* read only */ | 45 | unsigned long nr_free_files; /* read only */ |
39 | int max_files; /* tunable */ | 46 | unsigned long max_files; /* tunable */ |
40 | }; | 47 | }; |
41 | 48 | ||
42 | struct inodes_stat_t { | 49 | struct inodes_stat_t { |
@@ -92,6 +99,9 @@ struct inodes_stat_t { | |||
92 | /* Expect random access pattern */ | 99 | /* Expect random access pattern */ |
93 | #define FMODE_RANDOM ((__force fmode_t)0x1000) | 100 | #define FMODE_RANDOM ((__force fmode_t)0x1000) |
94 | 101 | ||
102 | /* File is huge (eg. /dev/kmem): treat loff_t as unsigned */ | ||
103 | #define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000) | ||
104 | |||
95 | /* File was opened by fanotify and shouldn't generate fanotify events */ | 105 | /* File was opened by fanotify and shouldn't generate fanotify events */ |
96 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) | 106 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) |
97 | 107 | ||
@@ -231,6 +241,7 @@ struct inodes_stat_t { | |||
231 | #define S_NOCMTIME 128 /* Do not update file c/mtime */ | 241 | #define S_NOCMTIME 128 /* Do not update file c/mtime */ |
232 | #define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ | 242 | #define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ |
233 | #define S_PRIVATE 512 /* Inode is fs-internal */ | 243 | #define S_PRIVATE 512 /* Inode is fs-internal */ |
244 | #define S_IMA 1024 /* Inode has an associated IMA struct */ | ||
234 | 245 | ||
235 | /* | 246 | /* |
236 | * Note that nosuid etc flags are inode-specific: setting some file-system | 247 | * Note that nosuid etc flags are inode-specific: setting some file-system |
@@ -265,6 +276,7 @@ struct inodes_stat_t { | |||
265 | #define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME) | 276 | #define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME) |
266 | #define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) | 277 | #define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) |
267 | #define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) | 278 | #define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) |
279 | #define IS_IMA(inode) ((inode)->i_flags & S_IMA) | ||
268 | 280 | ||
269 | /* the read-only stuff doesn't really belong here, but any other place is | 281 | /* the read-only stuff doesn't really belong here, but any other place is |
270 | probably as bad and I don't want to create yet another include file. */ | 282 | probably as bad and I don't want to create yet another include file. */ |
@@ -312,6 +324,7 @@ struct inodes_stat_t { | |||
312 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ | 324 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ |
313 | #define FIFREEZE _IOWR('X', 119, int) /* Freeze */ | 325 | #define FIFREEZE _IOWR('X', 119, int) /* Freeze */ |
314 | #define FITHAW _IOWR('X', 120, int) /* Thaw */ | 326 | #define FITHAW _IOWR('X', 120, int) /* Thaw */ |
327 | #define FITRIM _IOWR('X', 121, struct fstrim_range) /* Trim */ | ||
315 | 328 | ||
316 | #define FS_IOC_GETFLAGS _IOR('f', 1, long) | 329 | #define FS_IOC_GETFLAGS _IOR('f', 1, long) |
317 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) | 330 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) |
@@ -400,7 +413,7 @@ extern void __init inode_init_early(void); | |||
400 | extern void __init files_init(unsigned long); | 413 | extern void __init files_init(unsigned long); |
401 | 414 | ||
402 | extern struct files_stat_struct files_stat; | 415 | extern struct files_stat_struct files_stat; |
403 | extern int get_max_files(void); | 416 | extern unsigned long get_max_files(void); |
404 | extern int sysctl_nr_open; | 417 | extern int sysctl_nr_open; |
405 | extern struct inodes_stat_t inodes_stat; | 418 | extern struct inodes_stat_t inodes_stat; |
406 | extern int leases_enable, lease_break_time; | 419 | extern int leases_enable, lease_break_time; |
@@ -589,6 +602,7 @@ struct address_space_operations { | |||
589 | sector_t (*bmap)(struct address_space *, sector_t); | 602 | sector_t (*bmap)(struct address_space *, sector_t); |
590 | void (*invalidatepage) (struct page *, unsigned long); | 603 | void (*invalidatepage) (struct page *, unsigned long); |
591 | int (*releasepage) (struct page *, gfp_t); | 604 | int (*releasepage) (struct page *, gfp_t); |
605 | void (*freepage)(struct page *); | ||
592 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 606 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, |
593 | loff_t offset, unsigned long nr_segs); | 607 | loff_t offset, unsigned long nr_segs); |
594 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, | 608 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, |
@@ -720,7 +734,8 @@ struct posix_acl; | |||
720 | 734 | ||
721 | struct inode { | 735 | struct inode { |
722 | struct hlist_node i_hash; | 736 | struct hlist_node i_hash; |
723 | struct list_head i_list; /* backing dev IO list */ | 737 | struct list_head i_wb_list; /* backing dev IO list */ |
738 | struct list_head i_lru; /* inode LRU list */ | ||
724 | struct list_head i_sb_list; | 739 | struct list_head i_sb_list; |
725 | struct list_head i_dentry; | 740 | struct list_head i_dentry; |
726 | unsigned long i_ino; | 741 | unsigned long i_ino; |
@@ -772,6 +787,10 @@ struct inode { | |||
772 | 787 | ||
773 | unsigned int i_flags; | 788 | unsigned int i_flags; |
774 | 789 | ||
790 | #ifdef CONFIG_IMA | ||
791 | /* protected by i_lock */ | ||
792 | unsigned int i_readcount; /* struct files open RO */ | ||
793 | #endif | ||
775 | atomic_t i_writecount; | 794 | atomic_t i_writecount; |
776 | #ifdef CONFIG_SECURITY | 795 | #ifdef CONFIG_SECURITY |
777 | void *i_security; | 796 | void *i_security; |
@@ -783,6 +802,11 @@ struct inode { | |||
783 | void *i_private; /* fs or device private pointer */ | 802 | void *i_private; /* fs or device private pointer */ |
784 | }; | 803 | }; |
785 | 804 | ||
805 | static inline int inode_unhashed(struct inode *inode) | ||
806 | { | ||
807 | return hlist_unhashed(&inode->i_hash); | ||
808 | } | ||
809 | |||
786 | /* | 810 | /* |
787 | * inode->i_mutex nesting subclasses for the lock validator: | 811 | * inode->i_mutex nesting subclasses for the lock validator: |
788 | * | 812 | * |
@@ -1033,7 +1057,6 @@ struct lock_manager_operations { | |||
1033 | int (*fl_compare_owner)(struct file_lock *, struct file_lock *); | 1057 | int (*fl_compare_owner)(struct file_lock *, struct file_lock *); |
1034 | void (*fl_notify)(struct file_lock *); /* unblock callback */ | 1058 | void (*fl_notify)(struct file_lock *); /* unblock callback */ |
1035 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); | 1059 | int (*fl_grant)(struct file_lock *, struct file_lock *, int); |
1036 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | ||
1037 | void (*fl_release_private)(struct file_lock *); | 1060 | void (*fl_release_private)(struct file_lock *); |
1038 | void (*fl_break)(struct file_lock *); | 1061 | void (*fl_break)(struct file_lock *); |
1039 | int (*fl_mylease)(struct file_lock *, struct file_lock *); | 1062 | int (*fl_mylease)(struct file_lock *, struct file_lock *); |
@@ -1106,7 +1129,9 @@ extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); | |||
1106 | extern int fcntl_getlease(struct file *filp); | 1129 | extern int fcntl_getlease(struct file *filp); |
1107 | 1130 | ||
1108 | /* fs/locks.c */ | 1131 | /* fs/locks.c */ |
1132 | void locks_free_lock(struct file_lock *fl); | ||
1109 | extern void locks_init_lock(struct file_lock *); | 1133 | extern void locks_init_lock(struct file_lock *); |
1134 | extern struct file_lock * locks_alloc_lock(void); | ||
1110 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); | 1135 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); |
1111 | extern void __locks_copy_lock(struct file_lock *, const struct file_lock *); | 1136 | extern void __locks_copy_lock(struct file_lock *, const struct file_lock *); |
1112 | extern void locks_remove_posix(struct file *, fl_owner_t); | 1137 | extern void locks_remove_posix(struct file *, fl_owner_t); |
@@ -1295,6 +1320,11 @@ struct fasync_struct { | |||
1295 | 1320 | ||
1296 | /* SMP safe fasync helpers: */ | 1321 | /* SMP safe fasync helpers: */ |
1297 | extern int fasync_helper(int, struct file *, int, struct fasync_struct **); | 1322 | extern int fasync_helper(int, struct file *, int, struct fasync_struct **); |
1323 | extern struct fasync_struct *fasync_insert_entry(int, struct file *, struct fasync_struct **, struct fasync_struct *); | ||
1324 | extern int fasync_remove_entry(struct file *, struct fasync_struct **); | ||
1325 | extern struct fasync_struct *fasync_alloc(void); | ||
1326 | extern void fasync_free(struct fasync_struct *); | ||
1327 | |||
1298 | /* can be called from interrupts */ | 1328 | /* can be called from interrupts */ |
1299 | extern void kill_fasync(struct fasync_struct **, int, int); | 1329 | extern void kill_fasync(struct fasync_struct **, int, int); |
1300 | 1330 | ||
@@ -1633,16 +1663,17 @@ struct super_operations { | |||
1633 | * | 1663 | * |
1634 | * Q: What is the difference between I_WILL_FREE and I_FREEING? | 1664 | * Q: What is the difference between I_WILL_FREE and I_FREEING? |
1635 | */ | 1665 | */ |
1636 | #define I_DIRTY_SYNC 1 | 1666 | #define I_DIRTY_SYNC (1 << 0) |
1637 | #define I_DIRTY_DATASYNC 2 | 1667 | #define I_DIRTY_DATASYNC (1 << 1) |
1638 | #define I_DIRTY_PAGES 4 | 1668 | #define I_DIRTY_PAGES (1 << 2) |
1639 | #define __I_NEW 3 | 1669 | #define __I_NEW 3 |
1640 | #define I_NEW (1 << __I_NEW) | 1670 | #define I_NEW (1 << __I_NEW) |
1641 | #define I_WILL_FREE 16 | 1671 | #define I_WILL_FREE (1 << 4) |
1642 | #define I_FREEING 32 | 1672 | #define I_FREEING (1 << 5) |
1643 | #define I_CLEAR 64 | 1673 | #define I_CLEAR (1 << 6) |
1644 | #define __I_SYNC 7 | 1674 | #define __I_SYNC 7 |
1645 | #define I_SYNC (1 << __I_SYNC) | 1675 | #define I_SYNC (1 << __I_SYNC) |
1676 | #define I_REFERENCED (1 << 8) | ||
1646 | 1677 | ||
1647 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) | 1678 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) |
1648 | 1679 | ||
@@ -1734,12 +1765,15 @@ static inline void file_accessed(struct file *file) | |||
1734 | } | 1765 | } |
1735 | 1766 | ||
1736 | int sync_inode(struct inode *inode, struct writeback_control *wbc); | 1767 | int sync_inode(struct inode *inode, struct writeback_control *wbc); |
1768 | int sync_inode_metadata(struct inode *inode, int wait); | ||
1737 | 1769 | ||
1738 | struct file_system_type { | 1770 | struct file_system_type { |
1739 | const char *name; | 1771 | const char *name; |
1740 | int fs_flags; | 1772 | int fs_flags; |
1741 | int (*get_sb) (struct file_system_type *, int, | 1773 | int (*get_sb) (struct file_system_type *, int, |
1742 | const char *, void *, struct vfsmount *); | 1774 | const char *, void *, struct vfsmount *); |
1775 | struct dentry *(*mount) (struct file_system_type *, int, | ||
1776 | const char *, void *); | ||
1743 | void (*kill_sb) (struct super_block *); | 1777 | void (*kill_sb) (struct super_block *); |
1744 | struct module *owner; | 1778 | struct module *owner; |
1745 | struct file_system_type * next; | 1779 | struct file_system_type * next; |
@@ -1755,17 +1789,25 @@ struct file_system_type { | |||
1755 | struct lock_class_key i_alloc_sem_key; | 1789 | struct lock_class_key i_alloc_sem_key; |
1756 | }; | 1790 | }; |
1757 | 1791 | ||
1758 | extern int get_sb_ns(struct file_system_type *fs_type, int flags, void *data, | 1792 | extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags, |
1759 | int (*fill_super)(struct super_block *, void *, int), | 1793 | void *data, int (*fill_super)(struct super_block *, void *, int)); |
1760 | struct vfsmount *mnt); | 1794 | extern struct dentry *mount_bdev(struct file_system_type *fs_type, |
1795 | int flags, const char *dev_name, void *data, | ||
1796 | int (*fill_super)(struct super_block *, void *, int)); | ||
1761 | extern int get_sb_bdev(struct file_system_type *fs_type, | 1797 | extern int get_sb_bdev(struct file_system_type *fs_type, |
1762 | int flags, const char *dev_name, void *data, | 1798 | int flags, const char *dev_name, void *data, |
1763 | int (*fill_super)(struct super_block *, void *, int), | 1799 | int (*fill_super)(struct super_block *, void *, int), |
1764 | struct vfsmount *mnt); | 1800 | struct vfsmount *mnt); |
1801 | extern struct dentry *mount_single(struct file_system_type *fs_type, | ||
1802 | int flags, void *data, | ||
1803 | int (*fill_super)(struct super_block *, void *, int)); | ||
1765 | extern int get_sb_single(struct file_system_type *fs_type, | 1804 | extern int get_sb_single(struct file_system_type *fs_type, |
1766 | int flags, void *data, | 1805 | int flags, void *data, |
1767 | int (*fill_super)(struct super_block *, void *, int), | 1806 | int (*fill_super)(struct super_block *, void *, int), |
1768 | struct vfsmount *mnt); | 1807 | struct vfsmount *mnt); |
1808 | extern struct dentry *mount_nodev(struct file_system_type *fs_type, | ||
1809 | int flags, void *data, | ||
1810 | int (*fill_super)(struct super_block *, void *, int)); | ||
1769 | extern int get_sb_nodev(struct file_system_type *fs_type, | 1811 | extern int get_sb_nodev(struct file_system_type *fs_type, |
1770 | int flags, void *data, | 1812 | int flags, void *data, |
1771 | int (*fill_super)(struct super_block *, void *, int), | 1813 | int (*fill_super)(struct super_block *, void *, int), |
@@ -1781,9 +1823,8 @@ struct super_block *sget(struct file_system_type *type, | |||
1781 | int (*test)(struct super_block *,void *), | 1823 | int (*test)(struct super_block *,void *), |
1782 | int (*set)(struct super_block *,void *), | 1824 | int (*set)(struct super_block *,void *), |
1783 | void *data); | 1825 | void *data); |
1784 | extern int get_sb_pseudo(struct file_system_type *, char *, | 1826 | extern struct dentry *mount_pseudo(struct file_system_type *, char *, |
1785 | const struct super_operations *ops, unsigned long, | 1827 | const struct super_operations *ops, unsigned long); |
1786 | struct vfsmount *mnt); | ||
1787 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | 1828 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); |
1788 | 1829 | ||
1789 | static inline void sb_mark_dirty(struct super_block *sb) | 1830 | static inline void sb_mark_dirty(struct super_block *sb) |
@@ -1826,6 +1867,7 @@ extern int current_umask(void); | |||
1826 | /* /sys/fs */ | 1867 | /* /sys/fs */ |
1827 | extern struct kobject *fs_kobj; | 1868 | extern struct kobject *fs_kobj; |
1828 | 1869 | ||
1870 | #define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK) | ||
1829 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); | 1871 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); |
1830 | 1872 | ||
1831 | #define FLOCK_VERIFY_READ 1 | 1873 | #define FLOCK_VERIFY_READ 1 |
@@ -2078,7 +2120,6 @@ extern int check_disk_change(struct block_device *); | |||
2078 | extern int __invalidate_device(struct block_device *); | 2120 | extern int __invalidate_device(struct block_device *); |
2079 | extern int invalidate_partition(struct gendisk *, int); | 2121 | extern int invalidate_partition(struct gendisk *, int); |
2080 | #endif | 2122 | #endif |
2081 | extern int invalidate_inodes(struct super_block *); | ||
2082 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 2123 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
2083 | pgoff_t start, pgoff_t end); | 2124 | pgoff_t start, pgoff_t end); |
2084 | 2125 | ||
@@ -2162,7 +2203,7 @@ extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); | |||
2162 | 2203 | ||
2163 | extern int inode_init_always(struct super_block *, struct inode *); | 2204 | extern int inode_init_always(struct super_block *, struct inode *); |
2164 | extern void inode_init_once(struct inode *); | 2205 | extern void inode_init_once(struct inode *); |
2165 | extern void inode_add_to_lists(struct super_block *, struct inode *); | 2206 | extern void ihold(struct inode * inode); |
2166 | extern void iput(struct inode *); | 2207 | extern void iput(struct inode *); |
2167 | extern struct inode * igrab(struct inode *); | 2208 | extern struct inode * igrab(struct inode *); |
2168 | extern ino_t iunique(struct super_block *, ino_t); | 2209 | extern ino_t iunique(struct super_block *, ino_t); |
@@ -2182,11 +2223,11 @@ extern struct inode * iget_locked(struct super_block *, unsigned long); | |||
2182 | extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *); | 2223 | extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *); |
2183 | extern int insert_inode_locked(struct inode *); | 2224 | extern int insert_inode_locked(struct inode *); |
2184 | extern void unlock_new_inode(struct inode *); | 2225 | extern void unlock_new_inode(struct inode *); |
2226 | extern unsigned int get_next_ino(void); | ||
2185 | 2227 | ||
2186 | extern void __iget(struct inode * inode); | 2228 | extern void __iget(struct inode * inode); |
2187 | extern void iget_failed(struct inode *); | 2229 | extern void iget_failed(struct inode *); |
2188 | extern void end_writeback(struct inode *); | 2230 | extern void end_writeback(struct inode *); |
2189 | extern void destroy_inode(struct inode *); | ||
2190 | extern void __destroy_inode(struct inode *); | 2231 | extern void __destroy_inode(struct inode *); |
2191 | extern struct inode *new_inode(struct super_block *); | 2232 | extern struct inode *new_inode(struct super_block *); |
2192 | extern int should_remove_suid(struct dentry *); | 2233 | extern int should_remove_suid(struct dentry *); |
@@ -2194,9 +2235,11 @@ extern int file_remove_suid(struct file *); | |||
2194 | 2235 | ||
2195 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); | 2236 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); |
2196 | extern void remove_inode_hash(struct inode *); | 2237 | extern void remove_inode_hash(struct inode *); |
2197 | static inline void insert_inode_hash(struct inode *inode) { | 2238 | static inline void insert_inode_hash(struct inode *inode) |
2239 | { | ||
2198 | __insert_inode_hash(inode, inode->i_ino); | 2240 | __insert_inode_hash(inode, inode->i_ino); |
2199 | } | 2241 | } |
2242 | extern void inode_sb_list_add(struct inode *inode); | ||
2200 | 2243 | ||
2201 | #ifdef CONFIG_BLOCK | 2244 | #ifdef CONFIG_BLOCK |
2202 | extern void submit_bio(int, struct bio *); | 2245 | extern void submit_bio(int, struct bio *); |
@@ -2479,7 +2522,10 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf, | |||
2479 | struct ctl_table; | 2522 | struct ctl_table; |
2480 | int proc_nr_files(struct ctl_table *table, int write, | 2523 | int proc_nr_files(struct ctl_table *table, int write, |
2481 | void __user *buffer, size_t *lenp, loff_t *ppos); | 2524 | void __user *buffer, size_t *lenp, loff_t *ppos); |
2482 | 2525 | int proc_nr_dentry(struct ctl_table *table, int write, | |
2526 | void __user *buffer, size_t *lenp, loff_t *ppos); | ||
2527 | int proc_nr_inodes(struct ctl_table *table, int write, | ||
2528 | void __user *buffer, size_t *lenp, loff_t *ppos); | ||
2483 | int __init get_filesystem_list(char *buf); | 2529 | int __init get_filesystem_list(char *buf); |
2484 | 2530 | ||
2485 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) | 2531 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) |
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h index fc295d7ea463..781d4671415f 100644 --- a/include/linux/fsl-diu-fb.h +++ b/include/linux/fsl-diu-fb.h | |||
@@ -54,7 +54,6 @@ struct aoi_display_offset { | |||
54 | }; | 54 | }; |
55 | 55 | ||
56 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) | 56 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) |
57 | #define MFB_WAIT_FOR_VSYNC _IOW('F', 0x20, u_int32_t) | ||
58 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) | 57 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) |
59 | 58 | ||
60 | #define MFB_SET_ALPHA 0x80014d00 | 59 | #define MFB_SET_ALPHA 0x80014d00 |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 59d0df43ff9d..b10bcdeaef76 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -26,12 +26,12 @@ static inline void fsnotify_d_instantiate(struct dentry *dentry, | |||
26 | } | 26 | } |
27 | 27 | ||
28 | /* Notify this dentry's parent about a child's events. */ | 28 | /* Notify this dentry's parent about a child's events. */ |
29 | static inline void fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | 29 | static inline int fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) |
30 | { | 30 | { |
31 | if (!dentry) | 31 | if (!dentry) |
32 | dentry = path->dentry; | 32 | dentry = path->dentry; |
33 | 33 | ||
34 | __fsnotify_parent(path, dentry, mask); | 34 | return __fsnotify_parent(path, dentry, mask); |
35 | } | 35 | } |
36 | 36 | ||
37 | /* simple call site for access decisions */ | 37 | /* simple call site for access decisions */ |
@@ -40,6 +40,7 @@ static inline int fsnotify_perm(struct file *file, int mask) | |||
40 | struct path *path = &file->f_path; | 40 | struct path *path = &file->f_path; |
41 | struct inode *inode = path->dentry->d_inode; | 41 | struct inode *inode = path->dentry->d_inode; |
42 | __u32 fsnotify_mask = 0; | 42 | __u32 fsnotify_mask = 0; |
43 | int ret; | ||
43 | 44 | ||
44 | if (file->f_mode & FMODE_NONOTIFY) | 45 | if (file->f_mode & FMODE_NONOTIFY) |
45 | return 0; | 46 | return 0; |
@@ -52,6 +53,10 @@ static inline int fsnotify_perm(struct file *file, int mask) | |||
52 | else | 53 | else |
53 | BUG(); | 54 | BUG(); |
54 | 55 | ||
56 | ret = fsnotify_parent(path, NULL, fsnotify_mask); | ||
57 | if (ret) | ||
58 | return ret; | ||
59 | |||
55 | return fsnotify(inode, fsnotify_mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); | 60 | return fsnotify(inode, fsnotify_mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); |
56 | } | 61 | } |
57 | 62 | ||
@@ -93,8 +98,8 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
93 | old_dir_mask |= FS_DN_RENAME; | 98 | old_dir_mask |= FS_DN_RENAME; |
94 | 99 | ||
95 | if (isdir) { | 100 | if (isdir) { |
96 | old_dir_mask |= FS_IN_ISDIR; | 101 | old_dir_mask |= FS_ISDIR; |
97 | new_dir_mask |= FS_IN_ISDIR; | 102 | new_dir_mask |= FS_ISDIR; |
98 | } | 103 | } |
99 | 104 | ||
100 | fsnotify(old_dir, old_dir_mask, old_dir, FSNOTIFY_EVENT_INODE, old_name, fs_cookie); | 105 | fsnotify(old_dir, old_dir_mask, old_dir, FSNOTIFY_EVENT_INODE, old_name, fs_cookie); |
@@ -132,7 +137,7 @@ static inline void fsnotify_nameremove(struct dentry *dentry, int isdir) | |||
132 | __u32 mask = FS_DELETE; | 137 | __u32 mask = FS_DELETE; |
133 | 138 | ||
134 | if (isdir) | 139 | if (isdir) |
135 | mask |= FS_IN_ISDIR; | 140 | mask |= FS_ISDIR; |
136 | 141 | ||
137 | fsnotify_parent(NULL, dentry, mask); | 142 | fsnotify_parent(NULL, dentry, mask); |
138 | } | 143 | } |
@@ -174,7 +179,7 @@ static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct | |||
174 | */ | 179 | */ |
175 | static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | 180 | static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) |
176 | { | 181 | { |
177 | __u32 mask = (FS_CREATE | FS_IN_ISDIR); | 182 | __u32 mask = (FS_CREATE | FS_ISDIR); |
178 | struct inode *d_inode = dentry->d_inode; | 183 | struct inode *d_inode = dentry->d_inode; |
179 | 184 | ||
180 | audit_inode_child(dentry, inode); | 185 | audit_inode_child(dentry, inode); |
@@ -192,7 +197,7 @@ static inline void fsnotify_access(struct file *file) | |||
192 | __u32 mask = FS_ACCESS; | 197 | __u32 mask = FS_ACCESS; |
193 | 198 | ||
194 | if (S_ISDIR(inode->i_mode)) | 199 | if (S_ISDIR(inode->i_mode)) |
195 | mask |= FS_IN_ISDIR; | 200 | mask |= FS_ISDIR; |
196 | 201 | ||
197 | if (!(file->f_mode & FMODE_NONOTIFY)) { | 202 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
198 | fsnotify_parent(path, NULL, mask); | 203 | fsnotify_parent(path, NULL, mask); |
@@ -210,7 +215,7 @@ static inline void fsnotify_modify(struct file *file) | |||
210 | __u32 mask = FS_MODIFY; | 215 | __u32 mask = FS_MODIFY; |
211 | 216 | ||
212 | if (S_ISDIR(inode->i_mode)) | 217 | if (S_ISDIR(inode->i_mode)) |
213 | mask |= FS_IN_ISDIR; | 218 | mask |= FS_ISDIR; |
214 | 219 | ||
215 | if (!(file->f_mode & FMODE_NONOTIFY)) { | 220 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
216 | fsnotify_parent(path, NULL, mask); | 221 | fsnotify_parent(path, NULL, mask); |
@@ -228,12 +233,10 @@ static inline void fsnotify_open(struct file *file) | |||
228 | __u32 mask = FS_OPEN; | 233 | __u32 mask = FS_OPEN; |
229 | 234 | ||
230 | if (S_ISDIR(inode->i_mode)) | 235 | if (S_ISDIR(inode->i_mode)) |
231 | mask |= FS_IN_ISDIR; | 236 | mask |= FS_ISDIR; |
232 | 237 | ||
233 | if (!(file->f_mode & FMODE_NONOTIFY)) { | 238 | fsnotify_parent(path, NULL, mask); |
234 | fsnotify_parent(path, NULL, mask); | 239 | fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); |
235 | fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); | ||
236 | } | ||
237 | } | 240 | } |
238 | 241 | ||
239 | /* | 242 | /* |
@@ -247,7 +250,7 @@ static inline void fsnotify_close(struct file *file) | |||
247 | __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE; | 250 | __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE; |
248 | 251 | ||
249 | if (S_ISDIR(inode->i_mode)) | 252 | if (S_ISDIR(inode->i_mode)) |
250 | mask |= FS_IN_ISDIR; | 253 | mask |= FS_ISDIR; |
251 | 254 | ||
252 | if (!(file->f_mode & FMODE_NONOTIFY)) { | 255 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
253 | fsnotify_parent(path, NULL, mask); | 256 | fsnotify_parent(path, NULL, mask); |
@@ -264,7 +267,7 @@ static inline void fsnotify_xattr(struct dentry *dentry) | |||
264 | __u32 mask = FS_ATTRIB; | 267 | __u32 mask = FS_ATTRIB; |
265 | 268 | ||
266 | if (S_ISDIR(inode->i_mode)) | 269 | if (S_ISDIR(inode->i_mode)) |
267 | mask |= FS_IN_ISDIR; | 270 | mask |= FS_ISDIR; |
268 | 271 | ||
269 | fsnotify_parent(NULL, dentry, mask); | 272 | fsnotify_parent(NULL, dentry, mask); |
270 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 273 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); |
@@ -299,7 +302,7 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid) | |||
299 | 302 | ||
300 | if (mask) { | 303 | if (mask) { |
301 | if (S_ISDIR(inode->i_mode)) | 304 | if (S_ISDIR(inode->i_mode)) |
302 | mask |= FS_IN_ISDIR; | 305 | mask |= FS_ISDIR; |
303 | 306 | ||
304 | fsnotify_parent(NULL, dentry, mask); | 307 | fsnotify_parent(NULL, dentry, mask); |
305 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 308 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index e40190d16878..7380763595d3 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -45,7 +45,7 @@ | |||
45 | #define FS_ACCESS_PERM 0x00020000 /* access event in a permissions hook */ | 45 | #define FS_ACCESS_PERM 0x00020000 /* access event in a permissions hook */ |
46 | 46 | ||
47 | #define FS_EXCL_UNLINK 0x04000000 /* do not send events if object is unlinked */ | 47 | #define FS_EXCL_UNLINK 0x04000000 /* do not send events if object is unlinked */ |
48 | #define FS_IN_ISDIR 0x40000000 /* event occurred against dir */ | 48 | #define FS_ISDIR 0x40000000 /* event occurred against dir */ |
49 | #define FS_IN_ONESHOT 0x80000000 /* only send event once */ | 49 | #define FS_IN_ONESHOT 0x80000000 /* only send event once */ |
50 | 50 | ||
51 | #define FS_DN_RENAME 0x10000000 /* file renamed */ | 51 | #define FS_DN_RENAME 0x10000000 /* file renamed */ |
@@ -64,13 +64,15 @@ | |||
64 | 64 | ||
65 | #define FS_MOVE (FS_MOVED_FROM | FS_MOVED_TO) | 65 | #define FS_MOVE (FS_MOVED_FROM | FS_MOVED_TO) |
66 | 66 | ||
67 | #define ALL_FSNOTIFY_PERM_EVENTS (FS_OPEN_PERM | FS_ACCESS_PERM) | ||
68 | |||
67 | #define ALL_FSNOTIFY_EVENTS (FS_ACCESS | FS_MODIFY | FS_ATTRIB | \ | 69 | #define ALL_FSNOTIFY_EVENTS (FS_ACCESS | FS_MODIFY | FS_ATTRIB | \ |
68 | FS_CLOSE_WRITE | FS_CLOSE_NOWRITE | FS_OPEN | \ | 70 | FS_CLOSE_WRITE | FS_CLOSE_NOWRITE | FS_OPEN | \ |
69 | FS_MOVED_FROM | FS_MOVED_TO | FS_CREATE | \ | 71 | FS_MOVED_FROM | FS_MOVED_TO | FS_CREATE | \ |
70 | FS_DELETE | FS_DELETE_SELF | FS_MOVE_SELF | \ | 72 | FS_DELETE | FS_DELETE_SELF | FS_MOVE_SELF | \ |
71 | FS_UNMOUNT | FS_Q_OVERFLOW | FS_IN_IGNORED | \ | 73 | FS_UNMOUNT | FS_Q_OVERFLOW | FS_IN_IGNORED | \ |
72 | FS_OPEN_PERM | FS_ACCESS_PERM | FS_EXCL_UNLINK | \ | 74 | FS_OPEN_PERM | FS_ACCESS_PERM | FS_EXCL_UNLINK | \ |
73 | FS_IN_ISDIR | FS_IN_ONESHOT | FS_DN_RENAME | \ | 75 | FS_ISDIR | FS_IN_ONESHOT | FS_DN_RENAME | \ |
74 | FS_DN_MULTISHOT | FS_EVENT_ON_CHILD) | 76 | FS_DN_MULTISHOT | FS_EVENT_ON_CHILD) |
75 | 77 | ||
76 | struct fsnotify_group; | 78 | struct fsnotify_group; |
@@ -129,6 +131,14 @@ struct fsnotify_group { | |||
129 | wait_queue_head_t notification_waitq; /* read() on the notification file blocks on this waitq */ | 131 | wait_queue_head_t notification_waitq; /* read() on the notification file blocks on this waitq */ |
130 | unsigned int q_len; /* events on the queue */ | 132 | unsigned int q_len; /* events on the queue */ |
131 | unsigned int max_events; /* maximum events allowed on the list */ | 133 | unsigned int max_events; /* maximum events allowed on the list */ |
134 | /* | ||
135 | * Valid fsnotify group priorities. Events are send in order from highest | ||
136 | * priority to lowest priority. We default to the lowest priority. | ||
137 | */ | ||
138 | #define FS_PRIO_0 0 /* normal notifiers, no permissions */ | ||
139 | #define FS_PRIO_1 1 /* fanotify content based access control */ | ||
140 | #define FS_PRIO_2 2 /* fanotify pre-content access */ | ||
141 | unsigned int priority; | ||
132 | 142 | ||
133 | /* stores all fastpath marks assoc with this group so they can be cleaned on unregister */ | 143 | /* stores all fastpath marks assoc with this group so they can be cleaned on unregister */ |
134 | spinlock_t mark_lock; /* protect marks_list */ | 144 | spinlock_t mark_lock; /* protect marks_list */ |
@@ -156,9 +166,11 @@ struct fsnotify_group { | |||
156 | struct mutex access_mutex; | 166 | struct mutex access_mutex; |
157 | struct list_head access_list; | 167 | struct list_head access_list; |
158 | wait_queue_head_t access_waitq; | 168 | wait_queue_head_t access_waitq; |
159 | bool bypass_perm; /* protected by access_mutex */ | 169 | atomic_t bypass_perm; |
160 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ | 170 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ |
161 | int f_flags; | 171 | int f_flags; |
172 | unsigned int max_marks; | ||
173 | struct user_struct *user; | ||
162 | } fanotify_data; | 174 | } fanotify_data; |
163 | #endif /* CONFIG_FANOTIFY */ | 175 | #endif /* CONFIG_FANOTIFY */ |
164 | }; | 176 | }; |
@@ -275,8 +287,8 @@ struct fsnotify_mark { | |||
275 | struct fsnotify_inode_mark i; | 287 | struct fsnotify_inode_mark i; |
276 | struct fsnotify_vfsmount_mark m; | 288 | struct fsnotify_vfsmount_mark m; |
277 | }; | 289 | }; |
278 | __u32 ignored_mask; /* events types to ignore */ | ||
279 | struct list_head free_g_list; /* tmp list used when freeing this mark */ | 290 | struct list_head free_g_list; /* tmp list used when freeing this mark */ |
291 | __u32 ignored_mask; /* events types to ignore */ | ||
280 | #define FSNOTIFY_MARK_FLAG_INODE 0x01 | 292 | #define FSNOTIFY_MARK_FLAG_INODE 0x01 |
281 | #define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02 | 293 | #define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02 |
282 | #define FSNOTIFY_MARK_FLAG_OBJECT_PINNED 0x04 | 294 | #define FSNOTIFY_MARK_FLAG_OBJECT_PINNED 0x04 |
@@ -294,7 +306,7 @@ struct fsnotify_mark { | |||
294 | /* main fsnotify call to send events */ | 306 | /* main fsnotify call to send events */ |
295 | extern int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | 307 | extern int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, |
296 | const unsigned char *name, u32 cookie); | 308 | const unsigned char *name, u32 cookie); |
297 | extern void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask); | 309 | extern int __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask); |
298 | extern void __fsnotify_inode_delete(struct inode *inode); | 310 | extern void __fsnotify_inode_delete(struct inode *inode); |
299 | extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt); | 311 | extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt); |
300 | extern u32 fsnotify_get_cookie(void); | 312 | extern u32 fsnotify_get_cookie(void); |
@@ -423,8 +435,10 @@ static inline int fsnotify(struct inode *to_tell, __u32 mask, void *data, int da | |||
423 | return 0; | 435 | return 0; |
424 | } | 436 | } |
425 | 437 | ||
426 | static inline void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | 438 | static inline int __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) |
427 | {} | 439 | { |
440 | return 0; | ||
441 | } | ||
428 | 442 | ||
429 | static inline void __fsnotify_inode_delete(struct inode *inode) | 443 | static inline void __fsnotify_inode_delete(struct inode *inode) |
430 | {} | 444 | {} |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 975609cb8548..f54adfcbec9c 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -9,6 +9,32 @@ | |||
9 | 9 | ||
10 | struct vm_area_struct; | 10 | struct vm_area_struct; |
11 | 11 | ||
12 | /* Plain integer GFP bitmasks. Do not use this directly. */ | ||
13 | #define ___GFP_DMA 0x01u | ||
14 | #define ___GFP_HIGHMEM 0x02u | ||
15 | #define ___GFP_DMA32 0x04u | ||
16 | #define ___GFP_MOVABLE 0x08u | ||
17 | #define ___GFP_WAIT 0x10u | ||
18 | #define ___GFP_HIGH 0x20u | ||
19 | #define ___GFP_IO 0x40u | ||
20 | #define ___GFP_FS 0x80u | ||
21 | #define ___GFP_COLD 0x100u | ||
22 | #define ___GFP_NOWARN 0x200u | ||
23 | #define ___GFP_REPEAT 0x400u | ||
24 | #define ___GFP_NOFAIL 0x800u | ||
25 | #define ___GFP_NORETRY 0x1000u | ||
26 | #define ___GFP_COMP 0x4000u | ||
27 | #define ___GFP_ZERO 0x8000u | ||
28 | #define ___GFP_NOMEMALLOC 0x10000u | ||
29 | #define ___GFP_HARDWALL 0x20000u | ||
30 | #define ___GFP_THISNODE 0x40000u | ||
31 | #define ___GFP_RECLAIMABLE 0x80000u | ||
32 | #ifdef CONFIG_KMEMCHECK | ||
33 | #define ___GFP_NOTRACK 0x200000u | ||
34 | #else | ||
35 | #define ___GFP_NOTRACK 0 | ||
36 | #endif | ||
37 | |||
12 | /* | 38 | /* |
13 | * GFP bitmasks.. | 39 | * GFP bitmasks.. |
14 | * | 40 | * |
@@ -18,10 +44,10 @@ struct vm_area_struct; | |||
18 | * without the underscores and use them consistently. The definitions here may | 44 | * without the underscores and use them consistently. The definitions here may |
19 | * be used in bit comparisons. | 45 | * be used in bit comparisons. |
20 | */ | 46 | */ |
21 | #define __GFP_DMA ((__force gfp_t)0x01u) | 47 | #define __GFP_DMA ((__force gfp_t)___GFP_DMA) |
22 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) | 48 | #define __GFP_HIGHMEM ((__force gfp_t)___GFP_HIGHMEM) |
23 | #define __GFP_DMA32 ((__force gfp_t)0x04u) | 49 | #define __GFP_DMA32 ((__force gfp_t)___GFP_DMA32) |
24 | #define __GFP_MOVABLE ((__force gfp_t)0x08u) /* Page is movable */ | 50 | #define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* Page is movable */ |
25 | #define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE) | 51 | #define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE) |
26 | /* | 52 | /* |
27 | * Action modifiers - doesn't change the zoning | 53 | * Action modifiers - doesn't change the zoning |
@@ -38,27 +64,22 @@ struct vm_area_struct; | |||
38 | * __GFP_MOVABLE: Flag that this page will be movable by the page migration | 64 | * __GFP_MOVABLE: Flag that this page will be movable by the page migration |
39 | * mechanism or reclaimed | 65 | * mechanism or reclaimed |
40 | */ | 66 | */ |
41 | #define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */ | 67 | #define __GFP_WAIT ((__force gfp_t)___GFP_WAIT) /* Can wait and reschedule? */ |
42 | #define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */ | 68 | #define __GFP_HIGH ((__force gfp_t)___GFP_HIGH) /* Should access emergency pools? */ |
43 | #define __GFP_IO ((__force gfp_t)0x40u) /* Can start physical IO? */ | 69 | #define __GFP_IO ((__force gfp_t)___GFP_IO) /* Can start physical IO? */ |
44 | #define __GFP_FS ((__force gfp_t)0x80u) /* Can call down to low-level FS? */ | 70 | #define __GFP_FS ((__force gfp_t)___GFP_FS) /* Can call down to low-level FS? */ |
45 | #define __GFP_COLD ((__force gfp_t)0x100u) /* Cache-cold page required */ | 71 | #define __GFP_COLD ((__force gfp_t)___GFP_COLD) /* Cache-cold page required */ |
46 | #define __GFP_NOWARN ((__force gfp_t)0x200u) /* Suppress page allocation failure warning */ | 72 | #define __GFP_NOWARN ((__force gfp_t)___GFP_NOWARN) /* Suppress page allocation failure warning */ |
47 | #define __GFP_REPEAT ((__force gfp_t)0x400u) /* See above */ | 73 | #define __GFP_REPEAT ((__force gfp_t)___GFP_REPEAT) /* See above */ |
48 | #define __GFP_NOFAIL ((__force gfp_t)0x800u) /* See above */ | 74 | #define __GFP_NOFAIL ((__force gfp_t)___GFP_NOFAIL) /* See above */ |
49 | #define __GFP_NORETRY ((__force gfp_t)0x1000u)/* See above */ | 75 | #define __GFP_NORETRY ((__force gfp_t)___GFP_NORETRY) /* See above */ |
50 | #define __GFP_COMP ((__force gfp_t)0x4000u)/* Add compound page metadata */ | 76 | #define __GFP_COMP ((__force gfp_t)___GFP_COMP) /* Add compound page metadata */ |
51 | #define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */ | 77 | #define __GFP_ZERO ((__force gfp_t)___GFP_ZERO) /* Return zeroed page on success */ |
52 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ | 78 | #define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC) /* Don't use emergency reserves */ |
53 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ | 79 | #define __GFP_HARDWALL ((__force gfp_t)___GFP_HARDWALL) /* Enforce hardwall cpuset memory allocs */ |
54 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ | 80 | #define __GFP_THISNODE ((__force gfp_t)___GFP_THISNODE)/* No fallback, no policies */ |
55 | #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */ | 81 | #define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ |
56 | 82 | #define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */ | |
57 | #ifdef CONFIG_KMEMCHECK | ||
58 | #define __GFP_NOTRACK ((__force gfp_t)0x200000u) /* Don't track with kmemcheck */ | ||
59 | #else | ||
60 | #define __GFP_NOTRACK ((__force gfp_t)0) | ||
61 | #endif | ||
62 | 83 | ||
63 | /* | 84 | /* |
64 | * This may seem redundant, but it's a way of annotating false positives vs. | 85 | * This may seem redundant, but it's a way of annotating false positives vs. |
@@ -186,14 +207,14 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags) | |||
186 | #endif | 207 | #endif |
187 | 208 | ||
188 | #define GFP_ZONE_TABLE ( \ | 209 | #define GFP_ZONE_TABLE ( \ |
189 | (ZONE_NORMAL << 0 * ZONES_SHIFT) \ | 210 | (ZONE_NORMAL << 0 * ZONES_SHIFT) \ |
190 | | (OPT_ZONE_DMA << __GFP_DMA * ZONES_SHIFT) \ | 211 | | (OPT_ZONE_DMA << ___GFP_DMA * ZONES_SHIFT) \ |
191 | | (OPT_ZONE_HIGHMEM << __GFP_HIGHMEM * ZONES_SHIFT) \ | 212 | | (OPT_ZONE_HIGHMEM << ___GFP_HIGHMEM * ZONES_SHIFT) \ |
192 | | (OPT_ZONE_DMA32 << __GFP_DMA32 * ZONES_SHIFT) \ | 213 | | (OPT_ZONE_DMA32 << ___GFP_DMA32 * ZONES_SHIFT) \ |
193 | | (ZONE_NORMAL << __GFP_MOVABLE * ZONES_SHIFT) \ | 214 | | (ZONE_NORMAL << ___GFP_MOVABLE * ZONES_SHIFT) \ |
194 | | (OPT_ZONE_DMA << (__GFP_MOVABLE | __GFP_DMA) * ZONES_SHIFT) \ | 215 | | (OPT_ZONE_DMA << (___GFP_MOVABLE | ___GFP_DMA) * ZONES_SHIFT) \ |
195 | | (ZONE_MOVABLE << (__GFP_MOVABLE | __GFP_HIGHMEM) * ZONES_SHIFT)\ | 216 | | (ZONE_MOVABLE << (___GFP_MOVABLE | ___GFP_HIGHMEM) * ZONES_SHIFT) \ |
196 | | (OPT_ZONE_DMA32 << (__GFP_MOVABLE | __GFP_DMA32) * ZONES_SHIFT)\ | 217 | | (OPT_ZONE_DMA32 << (___GFP_MOVABLE | ___GFP_DMA32) * ZONES_SHIFT) \ |
197 | ) | 218 | ) |
198 | 219 | ||
199 | /* | 220 | /* |
@@ -203,20 +224,20 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags) | |||
203 | * allowed. | 224 | * allowed. |
204 | */ | 225 | */ |
205 | #define GFP_ZONE_BAD ( \ | 226 | #define GFP_ZONE_BAD ( \ |
206 | 1 << (__GFP_DMA | __GFP_HIGHMEM) \ | 227 | 1 << (___GFP_DMA | ___GFP_HIGHMEM) \ |
207 | | 1 << (__GFP_DMA | __GFP_DMA32) \ | 228 | | 1 << (___GFP_DMA | ___GFP_DMA32) \ |
208 | | 1 << (__GFP_DMA32 | __GFP_HIGHMEM) \ | 229 | | 1 << (___GFP_DMA32 | ___GFP_HIGHMEM) \ |
209 | | 1 << (__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM) \ | 230 | | 1 << (___GFP_DMA | ___GFP_DMA32 | ___GFP_HIGHMEM) \ |
210 | | 1 << (__GFP_MOVABLE | __GFP_HIGHMEM | __GFP_DMA) \ | 231 | | 1 << (___GFP_MOVABLE | ___GFP_HIGHMEM | ___GFP_DMA) \ |
211 | | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA) \ | 232 | | 1 << (___GFP_MOVABLE | ___GFP_DMA32 | ___GFP_DMA) \ |
212 | | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_HIGHMEM) \ | 233 | | 1 << (___GFP_MOVABLE | ___GFP_DMA32 | ___GFP_HIGHMEM) \ |
213 | | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA | __GFP_HIGHMEM)\ | 234 | | 1 << (___GFP_MOVABLE | ___GFP_DMA32 | ___GFP_DMA | ___GFP_HIGHMEM) \ |
214 | ) | 235 | ) |
215 | 236 | ||
216 | static inline enum zone_type gfp_zone(gfp_t flags) | 237 | static inline enum zone_type gfp_zone(gfp_t flags) |
217 | { | 238 | { |
218 | enum zone_type z; | 239 | enum zone_type z; |
219 | int bit = flags & GFP_ZONEMASK; | 240 | int bit = (__force int) (flags & GFP_ZONEMASK); |
220 | 241 | ||
221 | z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) & | 242 | z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) & |
222 | ((1 << ZONES_SHIFT) - 1); | 243 | ((1 << ZONES_SHIFT) - 1); |
@@ -339,7 +360,7 @@ void drain_local_pages(void *dummy); | |||
339 | 360 | ||
340 | extern gfp_t gfp_allowed_mask; | 361 | extern gfp_t gfp_allowed_mask; |
341 | 362 | ||
342 | extern void set_gfp_allowed_mask(gfp_t mask); | 363 | extern void pm_restrict_gfp_mask(void); |
343 | extern gfp_t clear_gfp_allowed_mask(gfp_t mask); | 364 | extern void pm_restore_gfp_mask(void); |
344 | 365 | ||
345 | #endif /* __LINUX_GFP_H */ | 366 | #endif /* __LINUX_GFP_H */ |
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h index ce73a30113b4..dd1a56fbe924 100644 --- a/include/linux/gpio_keys.h +++ b/include/linux/gpio_keys.h | |||
@@ -16,6 +16,8 @@ struct gpio_keys_button { | |||
16 | struct gpio_keys_platform_data { | 16 | struct gpio_keys_platform_data { |
17 | struct gpio_keys_button *buttons; | 17 | struct gpio_keys_button *buttons; |
18 | int nbuttons; | 18 | int nbuttons; |
19 | unsigned int poll_interval; /* polling interval in msecs - | ||
20 | for polling driver only */ | ||
19 | unsigned int rep:1; /* enable input subsystem auto repeat */ | 21 | unsigned int rep:1; /* enable input subsystem auto repeat */ |
20 | int (*enable)(struct device *dev); | 22 | int (*enable)(struct device *dev); |
21 | void (*disable)(struct device *dev); | 23 | void (*disable)(struct device *dev); |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 8a389b608ce3..32f9fd6619b4 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -2,9 +2,6 @@ | |||
2 | #define LINUX_HARDIRQ_H | 2 | #define LINUX_HARDIRQ_H |
3 | 3 | ||
4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
5 | #ifdef CONFIG_PREEMPT | ||
6 | #include <linux/smp_lock.h> | ||
7 | #endif | ||
8 | #include <linux/lockdep.h> | 5 | #include <linux/lockdep.h> |
9 | #include <linux/ftrace_irq.h> | 6 | #include <linux/ftrace_irq.h> |
10 | #include <asm/hardirq.h> | 7 | #include <asm/hardirq.h> |
@@ -96,11 +93,16 @@ | |||
96 | */ | 93 | */ |
97 | #define in_nmi() (preempt_count() & NMI_MASK) | 94 | #define in_nmi() (preempt_count() & NMI_MASK) |
98 | 95 | ||
96 | #if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL) | ||
97 | # include <linux/sched.h> | ||
98 | # define PREEMPT_INATOMIC_BASE (current->lock_depth >= 0) | ||
99 | #else | ||
100 | # define PREEMPT_INATOMIC_BASE 0 | ||
101 | #endif | ||
102 | |||
99 | #if defined(CONFIG_PREEMPT) | 103 | #if defined(CONFIG_PREEMPT) |
100 | # define PREEMPT_INATOMIC_BASE kernel_locked() | ||
101 | # define PREEMPT_CHECK_OFFSET 1 | 104 | # define PREEMPT_CHECK_OFFSET 1 |
102 | #else | 105 | #else |
103 | # define PREEMPT_INATOMIC_BASE 0 | ||
104 | # define PREEMPT_CHECK_OFFSET 0 | 106 | # define PREEMPT_CHECK_OFFSET 0 |
105 | #endif | 107 | #endif |
106 | 108 | ||
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index e3060ef85b6d..b676c585574e 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
6 | #include <linux/mm.h> | 6 | #include <linux/mm.h> |
7 | #include <linux/uaccess.h> | 7 | #include <linux/uaccess.h> |
8 | #include <linux/hardirq.h> | ||
8 | 9 | ||
9 | #include <asm/cacheflush.h> | 10 | #include <asm/cacheflush.h> |
10 | 11 | ||
@@ -28,18 +29,6 @@ static inline void invalidate_kernel_vmap_range(void *vaddr, int size) | |||
28 | 29 | ||
29 | #include <asm/kmap_types.h> | 30 | #include <asm/kmap_types.h> |
30 | 31 | ||
31 | #ifdef CONFIG_DEBUG_HIGHMEM | ||
32 | |||
33 | void debug_kmap_atomic(enum km_type type); | ||
34 | |||
35 | #else | ||
36 | |||
37 | static inline void debug_kmap_atomic(enum km_type type) | ||
38 | { | ||
39 | } | ||
40 | |||
41 | #endif | ||
42 | |||
43 | #ifdef CONFIG_HIGHMEM | 32 | #ifdef CONFIG_HIGHMEM |
44 | #include <asm/highmem.h> | 33 | #include <asm/highmem.h> |
45 | 34 | ||
@@ -66,19 +55,19 @@ static inline void kunmap(struct page *page) | |||
66 | { | 55 | { |
67 | } | 56 | } |
68 | 57 | ||
69 | static inline void *kmap_atomic(struct page *page, enum km_type idx) | 58 | static inline void *__kmap_atomic(struct page *page) |
70 | { | 59 | { |
71 | pagefault_disable(); | 60 | pagefault_disable(); |
72 | return page_address(page); | 61 | return page_address(page); |
73 | } | 62 | } |
74 | #define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx) | 63 | #define kmap_atomic_prot(page, prot) __kmap_atomic(page) |
75 | 64 | ||
76 | static inline void kunmap_atomic_notypecheck(void *addr, enum km_type idx) | 65 | static inline void __kunmap_atomic(void *addr) |
77 | { | 66 | { |
78 | pagefault_enable(); | 67 | pagefault_enable(); |
79 | } | 68 | } |
80 | 69 | ||
81 | #define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) | 70 | #define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn)) |
82 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) | 71 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) |
83 | 72 | ||
84 | #define kmap_flush_unused() do {} while(0) | 73 | #define kmap_flush_unused() do {} while(0) |
@@ -86,12 +75,50 @@ static inline void kunmap_atomic_notypecheck(void *addr, enum km_type idx) | |||
86 | 75 | ||
87 | #endif /* CONFIG_HIGHMEM */ | 76 | #endif /* CONFIG_HIGHMEM */ |
88 | 77 | ||
89 | /* Prevent people trying to call kunmap_atomic() as if it were kunmap() */ | 78 | #if defined(CONFIG_HIGHMEM) || defined(CONFIG_X86_32) |
90 | /* kunmap_atomic() should get the return value of kmap_atomic, not the page. */ | 79 | |
91 | #define kunmap_atomic(addr, idx) do { \ | 80 | DECLARE_PER_CPU(int, __kmap_atomic_idx); |
92 | BUILD_BUG_ON(__same_type((addr), struct page *)); \ | 81 | |
93 | kunmap_atomic_notypecheck((addr), (idx)); \ | 82 | static inline int kmap_atomic_idx_push(void) |
94 | } while (0) | 83 | { |
84 | int idx = __get_cpu_var(__kmap_atomic_idx)++; | ||
85 | #ifdef CONFIG_DEBUG_HIGHMEM | ||
86 | WARN_ON_ONCE(in_irq() && !irqs_disabled()); | ||
87 | BUG_ON(idx > KM_TYPE_NR); | ||
88 | #endif | ||
89 | return idx; | ||
90 | } | ||
91 | |||
92 | static inline int kmap_atomic_idx(void) | ||
93 | { | ||
94 | return __get_cpu_var(__kmap_atomic_idx) - 1; | ||
95 | } | ||
96 | |||
97 | static inline int kmap_atomic_idx_pop(void) | ||
98 | { | ||
99 | int idx = --__get_cpu_var(__kmap_atomic_idx); | ||
100 | #ifdef CONFIG_DEBUG_HIGHMEM | ||
101 | BUG_ON(idx < 0); | ||
102 | #endif | ||
103 | return idx; | ||
104 | } | ||
105 | |||
106 | #endif | ||
107 | |||
108 | /* | ||
109 | * Make both: kmap_atomic(page, idx) and kmap_atomic(page) work. | ||
110 | */ | ||
111 | #define kmap_atomic(page, args...) __kmap_atomic(page) | ||
112 | |||
113 | /* | ||
114 | * Prevent people trying to call kunmap_atomic() as if it were kunmap() | ||
115 | * kunmap_atomic() should get the return value of kmap_atomic, not the page. | ||
116 | */ | ||
117 | #define kunmap_atomic(addr, args...) \ | ||
118 | do { \ | ||
119 | BUILD_BUG_ON(__same_type((addr), struct page *)); \ | ||
120 | __kunmap_atomic(addr); \ | ||
121 | } while (0) | ||
95 | 122 | ||
96 | /* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ | 123 | /* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ |
97 | #ifndef clear_user_highpage | 124 | #ifndef clear_user_highpage |
@@ -201,8 +228,8 @@ static inline void copy_user_highpage(struct page *to, struct page *from, | |||
201 | vfrom = kmap_atomic(from, KM_USER0); | 228 | vfrom = kmap_atomic(from, KM_USER0); |
202 | vto = kmap_atomic(to, KM_USER1); | 229 | vto = kmap_atomic(to, KM_USER1); |
203 | copy_user_page(vto, vfrom, vaddr, to); | 230 | copy_user_page(vto, vfrom, vaddr, to); |
204 | kunmap_atomic(vfrom, KM_USER0); | ||
205 | kunmap_atomic(vto, KM_USER1); | 231 | kunmap_atomic(vto, KM_USER1); |
232 | kunmap_atomic(vfrom, KM_USER0); | ||
206 | } | 233 | } |
207 | 234 | ||
208 | #endif | 235 | #endif |
@@ -214,8 +241,8 @@ static inline void copy_highpage(struct page *to, struct page *from) | |||
214 | vfrom = kmap_atomic(from, KM_USER0); | 241 | vfrom = kmap_atomic(from, KM_USER0); |
215 | vto = kmap_atomic(to, KM_USER1); | 242 | vto = kmap_atomic(to, KM_USER1); |
216 | copy_page(vto, vfrom); | 243 | copy_page(vto, vfrom); |
217 | kunmap_atomic(vfrom, KM_USER0); | ||
218 | kunmap_atomic(vto, KM_USER1); | 244 | kunmap_atomic(vto, KM_USER1); |
245 | kunmap_atomic(vfrom, KM_USER0); | ||
219 | } | 246 | } |
220 | 247 | ||
221 | #endif /* _LINUX_HIGHMEM_H */ | 248 | #endif /* _LINUX_HIGHMEM_H */ |
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index a2d6ea49ec56..d1e55fed2c7d 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
@@ -33,6 +33,8 @@ enum bp_type_idx { | |||
33 | 33 | ||
34 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 34 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
35 | 35 | ||
36 | extern int __init init_hw_breakpoint(void); | ||
37 | |||
36 | static inline void hw_breakpoint_init(struct perf_event_attr *attr) | 38 | static inline void hw_breakpoint_init(struct perf_event_attr *attr) |
37 | { | 39 | { |
38 | memset(attr, 0, sizeof(*attr)); | 40 | memset(attr, 0, sizeof(*attr)); |
@@ -108,6 +110,8 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp) | |||
108 | 110 | ||
109 | #else /* !CONFIG_HAVE_HW_BREAKPOINT */ | 111 | #else /* !CONFIG_HAVE_HW_BREAKPOINT */ |
110 | 112 | ||
113 | static inline int __init init_hw_breakpoint(void) { return 0; } | ||
114 | |||
111 | static inline struct perf_event * | 115 | static inline struct perf_event * |
112 | register_user_hw_breakpoint(struct perf_event_attr *attr, | 116 | register_user_hw_breakpoint(struct perf_event_attr *attr, |
113 | perf_overflow_handler_t triggered, | 117 | perf_overflow_handler_t triggered, |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index e844a0b18695..4bef5c557160 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -32,28 +32,6 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | /* --- Bit algorithm adapters */ | 34 | /* --- Bit algorithm adapters */ |
35 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ | ||
36 | #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ | ||
37 | #define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */ | ||
38 | #define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ | 35 | #define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ |
39 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ | ||
40 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ | ||
41 | #define I2C_HW_B_CX23885 0x010022 /* conexant 23885 based tv cards (bus1) */ | ||
42 | #define I2C_HW_B_AU0828 0x010023 /* auvitek au0828 usb bridge */ | ||
43 | #define I2C_HW_B_CX231XX 0x010024 /* Conexant CX231XX USB based cards */ | ||
44 | #define I2C_HW_B_HDPVR 0x010025 /* Hauppauge HD PVR */ | ||
45 | |||
46 | /* --- SGI adapters */ | ||
47 | #define I2C_HW_SGI_VINO 0x160000 | ||
48 | |||
49 | /* --- SMBus only adapters */ | ||
50 | #define I2C_HW_SMBUS_W9968CF 0x04000d | ||
51 | #define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */ | ||
52 | #define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ | ||
53 | #define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */ | ||
54 | |||
55 | /* --- Miscellaneous adapters */ | ||
56 | #define I2C_HW_SAA7146 0x060000 /* SAA7146 video decoder bus */ | ||
57 | #define I2C_HW_SAA7134 0x090000 /* SAA7134 video decoder bus */ | ||
58 | 36 | ||
59 | #endif /* LINUX_I2C_ID_H */ | 37 | #endif /* LINUX_I2C_ID_H */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 1f66fa06a97c..56cfe23ffb39 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -353,7 +353,7 @@ struct i2c_algorithm { | |||
353 | */ | 353 | */ |
354 | struct i2c_adapter { | 354 | struct i2c_adapter { |
355 | struct module *owner; | 355 | struct module *owner; |
356 | unsigned int id; | 356 | unsigned int id __deprecated; |
357 | unsigned int class; /* classes to allow probing for */ | 357 | unsigned int class; /* classes to allow probing for */ |
358 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ | 358 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ |
359 | void *algo_data; | 359 | void *algo_data; |
@@ -407,8 +407,6 @@ void i2c_unlock_adapter(struct i2c_adapter *); | |||
407 | 407 | ||
408 | /* i2c adapter classes (bitmask) */ | 408 | /* i2c adapter classes (bitmask) */ |
409 | #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ | 409 | #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ |
410 | #define I2C_CLASS_TV_ANALOG (1<<1) /* bttv + friends */ | ||
411 | #define I2C_CLASS_TV_DIGITAL (1<<2) /* dvb cards */ | ||
412 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ | 410 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ |
413 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ | 411 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ |
414 | 412 | ||
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h index 269181b8f623..cec17cf6cac2 100644 --- a/include/linux/i2c/adp5588.h +++ b/include/linux/i2c/adp5588.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Analog Devices ADP5588 I/O Expander and QWERTY Keypad Controller | 2 | * Analog Devices ADP5588 I/O Expander and QWERTY Keypad Controller |
3 | * | 3 | * |
4 | * Copyright 2009 Analog Devices Inc. | 4 | * Copyright 2009-2010 Analog Devices Inc. |
5 | * | 5 | * |
6 | * Licensed under the GPL-2 or later. | 6 | * Licensed under the GPL-2 or later. |
7 | */ | 7 | */ |
@@ -74,6 +74,33 @@ | |||
74 | 74 | ||
75 | #define ADP5588_DEVICE_ID_MASK 0xF | 75 | #define ADP5588_DEVICE_ID_MASK 0xF |
76 | 76 | ||
77 | /* Configuration Register1 */ | ||
78 | #define ADP5588_AUTO_INC (1 << 7) | ||
79 | #define ADP5588_GPIEM_CFG (1 << 6) | ||
80 | #define ADP5588_OVR_FLOW_M (1 << 5) | ||
81 | #define ADP5588_INT_CFG (1 << 4) | ||
82 | #define ADP5588_OVR_FLOW_IEN (1 << 3) | ||
83 | #define ADP5588_K_LCK_IM (1 << 2) | ||
84 | #define ADP5588_GPI_IEN (1 << 1) | ||
85 | #define ADP5588_KE_IEN (1 << 0) | ||
86 | |||
87 | /* Interrupt Status Register */ | ||
88 | #define ADP5588_CMP2_INT (1 << 5) | ||
89 | #define ADP5588_CMP1_INT (1 << 4) | ||
90 | #define ADP5588_OVR_FLOW_INT (1 << 3) | ||
91 | #define ADP5588_K_LCK_INT (1 << 2) | ||
92 | #define ADP5588_GPI_INT (1 << 1) | ||
93 | #define ADP5588_KE_INT (1 << 0) | ||
94 | |||
95 | /* Key Lock and Event Counter Register */ | ||
96 | #define ADP5588_K_LCK_EN (1 << 6) | ||
97 | #define ADP5588_LCK21 0x30 | ||
98 | #define ADP5588_KEC 0xF | ||
99 | |||
100 | #define ADP5588_MAXGPIO 18 | ||
101 | #define ADP5588_BANK(offs) ((offs) >> 3) | ||
102 | #define ADP5588_BIT(offs) (1u << ((offs) & 0x7)) | ||
103 | |||
77 | /* Put one of these structures in i2c_board_info platform_data */ | 104 | /* Put one of these structures in i2c_board_info platform_data */ |
78 | 105 | ||
79 | #define ADP5588_KEYMAPSIZE 80 | 106 | #define ADP5588_KEYMAPSIZE 80 |
@@ -126,9 +153,12 @@ struct adp5588_kpad_platform_data { | |||
126 | const struct adp5588_gpio_platform_data *gpio_data; | 153 | const struct adp5588_gpio_platform_data *gpio_data; |
127 | }; | 154 | }; |
128 | 155 | ||
156 | struct i2c_client; /* forward declaration */ | ||
157 | |||
129 | struct adp5588_gpio_platform_data { | 158 | struct adp5588_gpio_platform_data { |
130 | unsigned gpio_start; /* GPIO Chip base # */ | 159 | int gpio_start; /* GPIO Chip base # */ |
131 | unsigned pullup_dis_mask; /* Pull-Up Disable Mask */ | 160 | unsigned irq_base; /* interrupt base # */ |
161 | unsigned pullup_dis_mask; /* Pull-Up Disable Mask */ | ||
132 | int (*setup)(struct i2c_client *client, | 162 | int (*setup)(struct i2c_client *client, |
133 | int gpio, unsigned ngpio, | 163 | int gpio, unsigned ngpio, |
134 | void *context); | 164 | void *context); |
diff --git a/include/linux/i2c/apds990x.h b/include/linux/i2c/apds990x.h new file mode 100644 index 000000000000..d186fcc5d257 --- /dev/null +++ b/include/linux/i2c/apds990x.h | |||
@@ -0,0 +1,79 @@ | |||
1 | /* | ||
2 | * This file is part of the APDS990x sensor driver. | ||
3 | * Chip is combined proximity and ambient light sensor. | ||
4 | * | ||
5 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | ||
6 | * | ||
7 | * Contact: Samu Onkalo <samu.p.onkalo@nokia.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * version 2 as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
21 | * 02110-1301 USA | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #ifndef __APDS990X_H__ | ||
26 | #define __APDS990X_H__ | ||
27 | |||
28 | |||
29 | #define APDS_IRLED_CURR_12mA 0x3 | ||
30 | #define APDS_IRLED_CURR_25mA 0x2 | ||
31 | #define APDS_IRLED_CURR_50mA 0x1 | ||
32 | #define APDS_IRLED_CURR_100mA 0x0 | ||
33 | |||
34 | /** | ||
35 | * struct apds990x_chip_factors - defines effect of the cover window | ||
36 | * @ga: Total glass attenuation | ||
37 | * @cf1: clear channel factor 1 for raw to lux conversion | ||
38 | * @irf1: IR channel factor 1 for raw to lux conversion | ||
39 | * @cf2: clear channel factor 2 for raw to lux conversion | ||
40 | * @irf2: IR channel factor 2 for raw to lux conversion | ||
41 | * @df: device factor for conversion formulas | ||
42 | * | ||
43 | * Structure for tuning ALS calculation to match with environment. | ||
44 | * Values depend on the material above the sensor and the sensor | ||
45 | * itself. If the GA is zero, driver will use uncovered sensor default values | ||
46 | * format: decimal value * APDS_PARAM_SCALE except df which is plain integer. | ||
47 | */ | ||
48 | #define APDS_PARAM_SCALE 4096 | ||
49 | struct apds990x_chip_factors { | ||
50 | int ga; | ||
51 | int cf1; | ||
52 | int irf1; | ||
53 | int cf2; | ||
54 | int irf2; | ||
55 | int df; | ||
56 | }; | ||
57 | |||
58 | /** | ||
59 | * struct apds990x_platform_data - platform data for apsd990x.c driver | ||
60 | * @cf: chip factor data | ||
61 | * @pddrive: IR-led driving current | ||
62 | * @ppcount: number of IR pulses used for proximity estimation | ||
63 | * @setup_resources: interrupt line setup call back function | ||
64 | * @release_resources: interrupt line release call back function | ||
65 | * | ||
66 | * Proximity detection result depends heavily on correct ppcount, pdrive | ||
67 | * and cover window. | ||
68 | * | ||
69 | */ | ||
70 | |||
71 | struct apds990x_platform_data { | ||
72 | struct apds990x_chip_factors cf; | ||
73 | u8 pdrive; | ||
74 | u8 ppcount; | ||
75 | int (*setup_resources)(void); | ||
76 | int (*release_resources)(void); | ||
77 | }; | ||
78 | |||
79 | #endif | ||
diff --git a/include/linux/i2c/bh1770glc.h b/include/linux/i2c/bh1770glc.h new file mode 100644 index 000000000000..8b5e2df36c72 --- /dev/null +++ b/include/linux/i2c/bh1770glc.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * This file is part of the ROHM BH1770GLC / OSRAM SFH7770 sensor driver. | ||
3 | * Chip is combined proximity and ambient light sensor. | ||
4 | * | ||
5 | * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | ||
6 | * | ||
7 | * Contact: Samu Onkalo <samu.p.onkalo@nokia.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * version 2 as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
21 | * 02110-1301 USA | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #ifndef __BH1770_H__ | ||
26 | #define __BH1770_H__ | ||
27 | |||
28 | /** | ||
29 | * struct bh1770_platform_data - platform data for bh1770glc driver | ||
30 | * @led_def_curr: IR led driving current. | ||
31 | * @glass_attenuation: Attenuation factor for covering window. | ||
32 | * @setup_resources: Call back for interrupt line setup function | ||
33 | * @release_resources: Call back for interrupte line release function | ||
34 | * | ||
35 | * Example of glass attenuation: 16384 * 385 / 100 means attenuation factor | ||
36 | * of 3.85. i.e. light_above_sensor = light_above_cover_window / 3.85 | ||
37 | */ | ||
38 | |||
39 | struct bh1770_platform_data { | ||
40 | #define BH1770_LED_5mA 0 | ||
41 | #define BH1770_LED_10mA 1 | ||
42 | #define BH1770_LED_20mA 2 | ||
43 | #define BH1770_LED_50mA 3 | ||
44 | #define BH1770_LED_100mA 4 | ||
45 | #define BH1770_LED_150mA 5 | ||
46 | #define BH1770_LED_200mA 6 | ||
47 | __u8 led_def_curr; | ||
48 | #define BH1770_NEUTRAL_GA 16384 /* 16384 / 16384 = 1 */ | ||
49 | __u32 glass_attenuation; | ||
50 | int (*setup_resources)(void); | ||
51 | int (*release_resources)(void); | ||
52 | }; | ||
53 | #endif | ||
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 4793d8a7f480..c760991b354a 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -141,6 +141,16 @@ | |||
141 | #define TWL6030_CHARGER_CTRL_INT_MASK 0x10 | 141 | #define TWL6030_CHARGER_CTRL_INT_MASK 0x10 |
142 | #define TWL6030_CHARGER_FAULT_INT_MASK 0x60 | 142 | #define TWL6030_CHARGER_FAULT_INT_MASK 0x60 |
143 | 143 | ||
144 | #define TWL6030_MMCCTRL 0xEE | ||
145 | #define VMMC_AUTO_OFF (0x1 << 3) | ||
146 | #define SW_FC (0x1 << 2) | ||
147 | #define STS_MMC 0x1 | ||
148 | |||
149 | #define TWL6030_CFG_INPUT_PUPD3 0xF2 | ||
150 | #define MMC_PU (0x1 << 3) | ||
151 | #define MMC_PD (0x1 << 2) | ||
152 | |||
153 | |||
144 | 154 | ||
145 | #define TWL4030_CLASS_ID 0x4030 | 155 | #define TWL4030_CLASS_ID 0x4030 |
146 | #define TWL6030_CLASS_ID 0x6030 | 156 | #define TWL6030_CLASS_ID 0x6030 |
@@ -173,6 +183,27 @@ int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | |||
173 | int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); | 183 | int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); |
174 | int twl6030_interrupt_mask(u8 bit_mask, u8 offset); | 184 | int twl6030_interrupt_mask(u8 bit_mask, u8 offset); |
175 | 185 | ||
186 | /* Card detect Configuration for MMC1 Controller on OMAP4 */ | ||
187 | #ifdef CONFIG_TWL4030_CORE | ||
188 | int twl6030_mmc_card_detect_config(void); | ||
189 | #else | ||
190 | static inline int twl6030_mmc_card_detect_config(void) | ||
191 | { | ||
192 | pr_debug("twl6030_mmc_card_detect_config not supported\n"); | ||
193 | return 0; | ||
194 | } | ||
195 | #endif | ||
196 | |||
197 | /* MMC1 Controller on OMAP4 uses Phoenix irq for Card detect */ | ||
198 | #ifdef CONFIG_TWL4030_CORE | ||
199 | int twl6030_mmc_card_detect(struct device *dev, int slot); | ||
200 | #else | ||
201 | static inline int twl6030_mmc_card_detect(struct device *dev, int slot) | ||
202 | { | ||
203 | pr_debug("Call back twl6030_mmc_card_detect not supported\n"); | ||
204 | return -EIO; | ||
205 | } | ||
206 | #endif | ||
176 | /*----------------------------------------------------------------------*/ | 207 | /*----------------------------------------------------------------------*/ |
177 | 208 | ||
178 | /* | 209 | /* |
@@ -357,6 +388,52 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset); | |||
357 | 388 | ||
358 | /*----------------------------------------------------------------------*/ | 389 | /*----------------------------------------------------------------------*/ |
359 | 390 | ||
391 | /* | ||
392 | * PM Master module register offsets (use TWL4030_MODULE_PM_MASTER) | ||
393 | */ | ||
394 | |||
395 | #define TWL4030_PM_MASTER_CFG_P1_TRANSITION 0x00 | ||
396 | #define TWL4030_PM_MASTER_CFG_P2_TRANSITION 0x01 | ||
397 | #define TWL4030_PM_MASTER_CFG_P3_TRANSITION 0x02 | ||
398 | #define TWL4030_PM_MASTER_CFG_P123_TRANSITION 0x03 | ||
399 | #define TWL4030_PM_MASTER_STS_BOOT 0x04 | ||
400 | #define TWL4030_PM_MASTER_CFG_BOOT 0x05 | ||
401 | #define TWL4030_PM_MASTER_SHUNDAN 0x06 | ||
402 | #define TWL4030_PM_MASTER_BOOT_BCI 0x07 | ||
403 | #define TWL4030_PM_MASTER_CFG_PWRANA1 0x08 | ||
404 | #define TWL4030_PM_MASTER_CFG_PWRANA2 0x09 | ||
405 | #define TWL4030_PM_MASTER_BACKUP_MISC_STS 0x0b | ||
406 | #define TWL4030_PM_MASTER_BACKUP_MISC_CFG 0x0c | ||
407 | #define TWL4030_PM_MASTER_BACKUP_MISC_TST 0x0d | ||
408 | #define TWL4030_PM_MASTER_PROTECT_KEY 0x0e | ||
409 | #define TWL4030_PM_MASTER_STS_HW_CONDITIONS 0x0f | ||
410 | #define TWL4030_PM_MASTER_P1_SW_EVENTS 0x10 | ||
411 | #define TWL4030_PM_MASTER_P2_SW_EVENTS 0x11 | ||
412 | #define TWL4030_PM_MASTER_P3_SW_EVENTS 0x12 | ||
413 | #define TWL4030_PM_MASTER_STS_P123_STATE 0x13 | ||
414 | #define TWL4030_PM_MASTER_PB_CFG 0x14 | ||
415 | #define TWL4030_PM_MASTER_PB_WORD_MSB 0x15 | ||
416 | #define TWL4030_PM_MASTER_PB_WORD_LSB 0x16 | ||
417 | #define TWL4030_PM_MASTER_SEQ_ADD_W2P 0x1c | ||
418 | #define TWL4030_PM_MASTER_SEQ_ADD_P2A 0x1d | ||
419 | #define TWL4030_PM_MASTER_SEQ_ADD_A2W 0x1e | ||
420 | #define TWL4030_PM_MASTER_SEQ_ADD_A2S 0x1f | ||
421 | #define TWL4030_PM_MASTER_SEQ_ADD_S2A12 0x20 | ||
422 | #define TWL4030_PM_MASTER_SEQ_ADD_S2A3 0x21 | ||
423 | #define TWL4030_PM_MASTER_SEQ_ADD_WARM 0x22 | ||
424 | #define TWL4030_PM_MASTER_MEMORY_ADDRESS 0x23 | ||
425 | #define TWL4030_PM_MASTER_MEMORY_DATA 0x24 | ||
426 | |||
427 | #define TWL4030_PM_MASTER_KEY_CFG1 0xc0 | ||
428 | #define TWL4030_PM_MASTER_KEY_CFG2 0x0c | ||
429 | |||
430 | #define TWL4030_PM_MASTER_KEY_TST1 0xe0 | ||
431 | #define TWL4030_PM_MASTER_KEY_TST2 0x0e | ||
432 | |||
433 | #define TWL4030_PM_MASTER_GLOBAL_TST 0xb6 | ||
434 | |||
435 | /*----------------------------------------------------------------------*/ | ||
436 | |||
360 | /* Power bus message definitions */ | 437 | /* Power bus message definitions */ |
361 | 438 | ||
362 | /* The TWL4030/5030 splits its power-management resources (the various | 439 | /* The TWL4030/5030 splits its power-management resources (the various |
diff --git a/include/linux/idr.h b/include/linux/idr.h index 928ae712709f..13a801f3d028 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -81,6 +81,7 @@ struct idr { | |||
81 | #define _idr_rc_to_errno(rc) ((rc) == -1 ? -EAGAIN : -ENOSPC) | 81 | #define _idr_rc_to_errno(rc) ((rc) == -1 ? -EAGAIN : -ENOSPC) |
82 | 82 | ||
83 | /** | 83 | /** |
84 | * DOC: idr sync | ||
84 | * idr synchronization (stolen from radix-tree.h) | 85 | * idr synchronization (stolen from radix-tree.h) |
85 | * | 86 | * |
86 | * idr_find() is able to be called locklessly, using RCU. The caller must | 87 | * idr_find() is able to be called locklessly, using RCU. The caller must |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index c2f3a72712ce..635e1faec412 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -339,6 +339,31 @@ static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) | |||
339 | } | 339 | } |
340 | } | 340 | } |
341 | 341 | ||
342 | /** | ||
343 | * vlan_get_protocol - get protocol EtherType. | ||
344 | * @skb: skbuff to query | ||
345 | * | ||
346 | * Returns the EtherType of the packet, regardless of whether it is | ||
347 | * vlan encapsulated (normal or hardware accelerated) or not. | ||
348 | */ | ||
349 | static inline __be16 vlan_get_protocol(const struct sk_buff *skb) | ||
350 | { | ||
351 | __be16 protocol = 0; | ||
352 | |||
353 | if (vlan_tx_tag_present(skb) || | ||
354 | skb->protocol != cpu_to_be16(ETH_P_8021Q)) | ||
355 | protocol = skb->protocol; | ||
356 | else { | ||
357 | __be16 proto, *protop; | ||
358 | protop = skb_header_pointer(skb, offsetof(struct vlan_ethhdr, | ||
359 | h_vlan_encapsulated_proto), | ||
360 | sizeof(proto), &proto); | ||
361 | if (likely(protop)) | ||
362 | protocol = *protop; | ||
363 | } | ||
364 | |||
365 | return protocol; | ||
366 | } | ||
342 | #endif /* __KERNEL__ */ | 367 | #endif /* __KERNEL__ */ |
343 | 368 | ||
344 | /* VLAN IOCTLs are found in sockios.h */ | 369 | /* VLAN IOCTLs are found in sockios.h */ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 2fea6c8ef6ba..1f8c06ce0fa6 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -29,6 +29,8 @@ extern struct fs_struct init_fs; | |||
29 | .running = 0, \ | 29 | .running = 0, \ |
30 | .lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \ | 30 | .lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \ |
31 | }, \ | 31 | }, \ |
32 | .cred_guard_mutex = \ | ||
33 | __MUTEX_INITIALIZER(sig.cred_guard_mutex), \ | ||
32 | } | 34 | } |
33 | 35 | ||
34 | extern struct nsproxy init_nsproxy; | 36 | extern struct nsproxy init_nsproxy; |
@@ -145,8 +147,6 @@ extern struct cred init_cred; | |||
145 | .group_leader = &tsk, \ | 147 | .group_leader = &tsk, \ |
146 | RCU_INIT_POINTER(.real_cred, &init_cred), \ | 148 | RCU_INIT_POINTER(.real_cred, &init_cred), \ |
147 | RCU_INIT_POINTER(.cred, &init_cred), \ | 149 | RCU_INIT_POINTER(.cred, &init_cred), \ |
148 | .cred_guard_mutex = \ | ||
149 | __MUTEX_INITIALIZER(tsk.cred_guard_mutex), \ | ||
150 | .comm = "swapper", \ | 150 | .comm = "swapper", \ |
151 | .thread = INIT_THREAD, \ | 151 | .thread = INIT_THREAD, \ |
152 | .fs = &init_fs, \ | 152 | .fs = &init_fs, \ |
diff --git a/include/linux/input.h b/include/linux/input.h index 51af441f3a21..9777668883be 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -47,6 +47,25 @@ struct input_id { | |||
47 | __u16 version; | 47 | __u16 version; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | /** | ||
51 | * struct input_absinfo - used by EVIOCGABS/EVIOCSABS ioctls | ||
52 | * @value: latest reported value for the axis. | ||
53 | * @minimum: specifies minimum value for the axis. | ||
54 | * @maximum: specifies maximum value for the axis. | ||
55 | * @fuzz: specifies fuzz value that is used to filter noise from | ||
56 | * the event stream. | ||
57 | * @flat: values that are within this value will be discarded by | ||
58 | * joydev interface and reported as 0 instead. | ||
59 | * @resolution: specifies resolution for the values reported for | ||
60 | * the axis. | ||
61 | * | ||
62 | * Note that input core does not clamp reported values to the | ||
63 | * [minimum, maximum] limits, such task is left to userspace. | ||
64 | * | ||
65 | * Resolution for main axes (ABS_X, ABS_Y, ABS_Z) is reported in | ||
66 | * units per millimeter (units/mm), resolution for rotational axes | ||
67 | * (ABS_RX, ABS_RY, ABS_RZ) is reported in units per radian. | ||
68 | */ | ||
50 | struct input_absinfo { | 69 | struct input_absinfo { |
51 | __s32 value; | 70 | __s32 value; |
52 | __s32 minimum; | 71 | __s32 minimum; |
@@ -85,8 +104,10 @@ struct input_keymap_entry { | |||
85 | #define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */ | 104 | #define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */ |
86 | #define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */ | 105 | #define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */ |
87 | 106 | ||
88 | #define EVIOCGKEYCODE _IOR('E', 0x04, struct input_keymap_entry) /* get keycode */ | 107 | #define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */ |
89 | #define EVIOCSKEYCODE _IOW('E', 0x04, struct input_keymap_entry) /* set keycode */ | 108 | #define EVIOCGKEYCODE_V2 _IOR('E', 0x04, struct input_keymap_entry) |
109 | #define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */ | ||
110 | #define EVIOCSKEYCODE_V2 _IOW('E', 0x04, struct input_keymap_entry) | ||
90 | 111 | ||
91 | #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ | 112 | #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ |
92 | #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ | 113 | #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ |
@@ -624,6 +645,10 @@ struct input_keymap_entry { | |||
624 | #define KEY_CAMERA_FOCUS 0x210 | 645 | #define KEY_CAMERA_FOCUS 0x210 |
625 | #define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ | 646 | #define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ |
626 | 647 | ||
648 | #define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */ | ||
649 | #define KEY_TOUCHPAD_ON 0x213 | ||
650 | #define KEY_TOUCHPAD_OFF 0x214 | ||
651 | |||
627 | #define BTN_TRIGGER_HAPPY 0x2c0 | 652 | #define BTN_TRIGGER_HAPPY 0x2c0 |
628 | #define BTN_TRIGGER_HAPPY1 0x2c0 | 653 | #define BTN_TRIGGER_HAPPY1 0x2c0 |
629 | #define BTN_TRIGGER_HAPPY2 0x2c1 | 654 | #define BTN_TRIGGER_HAPPY2 0x2c1 |
@@ -1130,7 +1155,7 @@ struct input_mt_slot { | |||
1130 | * of tracked contacts | 1155 | * of tracked contacts |
1131 | * @mtsize: number of MT slots the device uses | 1156 | * @mtsize: number of MT slots the device uses |
1132 | * @slot: MT slot currently being transmitted | 1157 | * @slot: MT slot currently being transmitted |
1133 | * @absinfo: array of &struct absinfo elements holding information | 1158 | * @absinfo: array of &struct input_absinfo elements holding information |
1134 | * about absolute axes (current value, min, max, flat, fuzz, | 1159 | * about absolute axes (current value, min, max, flat, fuzz, |
1135 | * resolution) | 1160 | * resolution) |
1136 | * @key: reflects current state of device's keys/buttons | 1161 | * @key: reflects current state of device's keys/buttons |
@@ -1406,6 +1431,8 @@ static inline void input_set_drvdata(struct input_dev *dev, void *data) | |||
1406 | int __must_check input_register_device(struct input_dev *); | 1431 | int __must_check input_register_device(struct input_dev *); |
1407 | void input_unregister_device(struct input_dev *); | 1432 | void input_unregister_device(struct input_dev *); |
1408 | 1433 | ||
1434 | void input_reset_device(struct input_dev *); | ||
1435 | |||
1409 | int __must_check input_register_handler(struct input_handler *); | 1436 | int __must_check input_register_handler(struct input_handler *); |
1410 | void input_unregister_handler(struct input_handler *); | 1437 | void input_unregister_handler(struct input_handler *); |
1411 | 1438 | ||
@@ -1421,7 +1448,7 @@ void input_release_device(struct input_handle *); | |||
1421 | int input_open_device(struct input_handle *); | 1448 | int input_open_device(struct input_handle *); |
1422 | void input_close_device(struct input_handle *); | 1449 | void input_close_device(struct input_handle *); |
1423 | 1450 | ||
1424 | int input_flush_device(struct input_handle* handle, struct file* file); | 1451 | int input_flush_device(struct input_handle *handle, struct file *file); |
1425 | 1452 | ||
1426 | void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); | 1453 | void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); |
1427 | void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value); | 1454 | void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value); |
diff --git a/include/linux/intel_mid_dma.h b/include/linux/intel_mid_dma.h index d9d08b6269b6..10496bd24c5c 100644 --- a/include/linux/intel_mid_dma.h +++ b/include/linux/intel_mid_dma.h | |||
@@ -27,14 +27,7 @@ | |||
27 | 27 | ||
28 | #include <linux/dmaengine.h> | 28 | #include <linux/dmaengine.h> |
29 | 29 | ||
30 | /*DMA transaction width, src and dstn width would be same | 30 | #define DMA_PREP_CIRCULAR_LIST (1 << 10) |
31 | The DMA length must be width aligned, | ||
32 | for 32 bit width the length must be 32 bit (4bytes) aligned only*/ | ||
33 | enum intel_mid_dma_width { | ||
34 | LNW_DMA_WIDTH_8BIT = 0x0, | ||
35 | LNW_DMA_WIDTH_16BIT = 0x1, | ||
36 | LNW_DMA_WIDTH_32BIT = 0x2, | ||
37 | }; | ||
38 | 31 | ||
39 | /*DMA mode configurations*/ | 32 | /*DMA mode configurations*/ |
40 | enum intel_mid_dma_mode { | 33 | enum intel_mid_dma_mode { |
@@ -69,18 +62,15 @@ enum intel_mid_dma_msize { | |||
69 | * @cfg_mode: DMA data transfer mode (per-per/mem-per/mem-mem) | 62 | * @cfg_mode: DMA data transfer mode (per-per/mem-per/mem-mem) |
70 | * @src_msize: Source DMA burst size | 63 | * @src_msize: Source DMA burst size |
71 | * @dst_msize: Dst DMA burst size | 64 | * @dst_msize: Dst DMA burst size |
65 | * @per_addr: Periphral address | ||
72 | * @device_instance: DMA peripheral device instance, we can have multiple | 66 | * @device_instance: DMA peripheral device instance, we can have multiple |
73 | * peripheral device connected to single DMAC | 67 | * peripheral device connected to single DMAC |
74 | */ | 68 | */ |
75 | struct intel_mid_dma_slave { | 69 | struct intel_mid_dma_slave { |
76 | enum dma_data_direction dirn; | ||
77 | enum intel_mid_dma_width src_width; /*width of DMA src txn*/ | ||
78 | enum intel_mid_dma_width dst_width; /*width of DMA dst txn*/ | ||
79 | enum intel_mid_dma_hs_mode hs_mode; /*handshaking*/ | 70 | enum intel_mid_dma_hs_mode hs_mode; /*handshaking*/ |
80 | enum intel_mid_dma_mode cfg_mode; /*mode configuration*/ | 71 | enum intel_mid_dma_mode cfg_mode; /*mode configuration*/ |
81 | enum intel_mid_dma_msize src_msize; /*size if src burst*/ | ||
82 | enum intel_mid_dma_msize dst_msize; /*size of dst burst*/ | ||
83 | unsigned int device_instance; /*0, 1 for periphral instance*/ | 72 | unsigned int device_instance; /*0, 1 for periphral instance*/ |
73 | struct dma_slave_config dma_slave; | ||
84 | }; | 74 | }; |
85 | 75 | ||
86 | #endif /*__INTEL_MID_DMA_H__*/ | 76 | #endif /*__INTEL_MID_DMA_H__*/ |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 01b281646251..79d0c4f6d071 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -410,7 +410,7 @@ extern void open_softirq(int nr, void (*action)(struct softirq_action *)); | |||
410 | extern void softirq_init(void); | 410 | extern void softirq_init(void); |
411 | static inline void __raise_softirq_irqoff(unsigned int nr) | 411 | static inline void __raise_softirq_irqoff(unsigned int nr) |
412 | { | 412 | { |
413 | trace_softirq_raise((struct softirq_action *)(unsigned long)nr, NULL); | 413 | trace_softirq_raise(nr); |
414 | or_softirq_pending(1UL << nr); | 414 | or_softirq_pending(1UL << nr); |
415 | } | 415 | } |
416 | 416 | ||
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index 7fb592793738..8cdcc2a199ad 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
@@ -81,8 +81,7 @@ io_mapping_free(struct io_mapping *mapping) | |||
81 | /* Atomic map/unmap */ | 81 | /* Atomic map/unmap */ |
82 | static inline void __iomem * | 82 | static inline void __iomem * |
83 | io_mapping_map_atomic_wc(struct io_mapping *mapping, | 83 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
84 | unsigned long offset, | 84 | unsigned long offset) |
85 | int slot) | ||
86 | { | 85 | { |
87 | resource_size_t phys_addr; | 86 | resource_size_t phys_addr; |
88 | unsigned long pfn; | 87 | unsigned long pfn; |
@@ -90,13 +89,13 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping, | |||
90 | BUG_ON(offset >= mapping->size); | 89 | BUG_ON(offset >= mapping->size); |
91 | phys_addr = mapping->base + offset; | 90 | phys_addr = mapping->base + offset; |
92 | pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); | 91 | pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); |
93 | return iomap_atomic_prot_pfn(pfn, slot, mapping->prot); | 92 | return iomap_atomic_prot_pfn(pfn, mapping->prot); |
94 | } | 93 | } |
95 | 94 | ||
96 | static inline void | 95 | static inline void |
97 | io_mapping_unmap_atomic(void __iomem *vaddr, int slot) | 96 | io_mapping_unmap_atomic(void __iomem *vaddr) |
98 | { | 97 | { |
99 | iounmap_atomic(vaddr, slot); | 98 | iounmap_atomic(vaddr); |
100 | } | 99 | } |
101 | 100 | ||
102 | static inline void __iomem * | 101 | static inline void __iomem * |
@@ -137,14 +136,13 @@ io_mapping_free(struct io_mapping *mapping) | |||
137 | /* Atomic map/unmap */ | 136 | /* Atomic map/unmap */ |
138 | static inline void __iomem * | 137 | static inline void __iomem * |
139 | io_mapping_map_atomic_wc(struct io_mapping *mapping, | 138 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
140 | unsigned long offset, | 139 | unsigned long offset) |
141 | int slot) | ||
142 | { | 140 | { |
143 | return ((char __force __iomem *) mapping) + offset; | 141 | return ((char __force __iomem *) mapping) + offset; |
144 | } | 142 | } |
145 | 143 | ||
146 | static inline void | 144 | static inline void |
147 | io_mapping_unmap_atomic(void __iomem *vaddr, int slot) | 145 | io_mapping_unmap_atomic(void __iomem *vaddr) |
148 | { | 146 | { |
149 | } | 147 | } |
150 | 148 | ||
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index 3e70b21884a9..b2eee896dcbc 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h | |||
@@ -76,7 +76,6 @@ int put_io_context(struct io_context *ioc); | |||
76 | void exit_io_context(struct task_struct *task); | 76 | void exit_io_context(struct task_struct *task); |
77 | struct io_context *get_io_context(gfp_t gfp_flags, int node); | 77 | struct io_context *get_io_context(gfp_t gfp_flags, int node); |
78 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node); | 78 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node); |
79 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); | ||
80 | #else | 79 | #else |
81 | static inline void exit_io_context(struct task_struct *task) | 80 | static inline void exit_io_context(struct task_struct *task) |
82 | { | 81 | { |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index b22790268b64..e9bb22cba764 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -123,6 +123,7 @@ extern void reserve_region_with_split(struct resource *root, | |||
123 | extern struct resource *insert_resource_conflict(struct resource *parent, struct resource *new); | 123 | extern struct resource *insert_resource_conflict(struct resource *parent, struct resource *new); |
124 | extern int insert_resource(struct resource *parent, struct resource *new); | 124 | extern int insert_resource(struct resource *parent, struct resource *new); |
125 | extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new); | 125 | extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new); |
126 | extern void arch_remove_reservations(struct resource *avail); | ||
126 | extern int allocate_resource(struct resource *root, struct resource *new, | 127 | extern int allocate_resource(struct resource *root, struct resource *new, |
127 | resource_size_t size, resource_size_t min, | 128 | resource_size_t size, resource_size_t min, |
128 | resource_size_t max, resource_size_t align, | 129 | resource_size_t max, resource_size_t align, |
diff --git a/include/linux/irq.h b/include/linux/irq.h index e9639115dff1..abde2527c699 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -412,6 +412,11 @@ static inline void irq_free_desc(unsigned int irq) | |||
412 | irq_free_descs(irq, 1); | 412 | irq_free_descs(irq, 1); |
413 | } | 413 | } |
414 | 414 | ||
415 | static inline int irq_reserve_irq(unsigned int irq) | ||
416 | { | ||
417 | return irq_reserve_irqs(irq, 1); | ||
418 | } | ||
419 | |||
415 | #endif /* CONFIG_GENERIC_HARDIRQS */ | 420 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
416 | 421 | ||
417 | #endif /* !CONFIG_S390 */ | 422 | #endif /* !CONFIG_S390 */ |
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index 05aa8c23483f..3bc4dcab6e82 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h | |||
@@ -43,7 +43,7 @@ unsigned int irq_get_next_irq(unsigned int offset); | |||
43 | else | 43 | else |
44 | 44 | ||
45 | #ifdef CONFIG_SMP | 45 | #ifdef CONFIG_SMP |
46 | #define irq_node(irq) (irq_to_desc(irq)->node) | 46 | #define irq_node(irq) (irq_get_irq_data(irq)->node) |
47 | #else | 47 | #else |
48 | #define irq_node(irq) 0 | 48 | #define irq_node(irq) 0 |
49 | #endif | 49 | #endif |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 0b52924a0cb6..2ae86aa21fce 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -395,7 +395,7 @@ struct jbd2_inode { | |||
395 | struct inode *i_vfs_inode; | 395 | struct inode *i_vfs_inode; |
396 | 396 | ||
397 | /* Flags of inode [j_list_lock] */ | 397 | /* Flags of inode [j_list_lock] */ |
398 | unsigned int i_flags; | 398 | unsigned long i_flags; |
399 | }; | 399 | }; |
400 | 400 | ||
401 | struct jbd2_revoke_table_s; | 401 | struct jbd2_revoke_table_s; |
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index b67cb180e6e9..7880f18e4b86 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _LINUX_JUMP_LABEL_H | 1 | #ifndef _LINUX_JUMP_LABEL_H |
2 | #define _LINUX_JUMP_LABEL_H | 2 | #define _LINUX_JUMP_LABEL_H |
3 | 3 | ||
4 | #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_HAVE_ARCH_JUMP_LABEL) | 4 | #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) |
5 | # include <asm/jump_label.h> | 5 | # include <asm/jump_label.h> |
6 | # define HAVE_JUMP_LABEL | 6 | # define HAVE_JUMP_LABEL |
7 | #endif | 7 | #endif |
@@ -18,6 +18,8 @@ struct module; | |||
18 | extern struct jump_entry __start___jump_table[]; | 18 | extern struct jump_entry __start___jump_table[]; |
19 | extern struct jump_entry __stop___jump_table[]; | 19 | extern struct jump_entry __stop___jump_table[]; |
20 | 20 | ||
21 | extern void jump_label_lock(void); | ||
22 | extern void jump_label_unlock(void); | ||
21 | extern void arch_jump_label_transform(struct jump_entry *entry, | 23 | extern void arch_jump_label_transform(struct jump_entry *entry, |
22 | enum jump_label_type type); | 24 | enum jump_label_type type); |
23 | extern void arch_jump_label_text_poke_early(jump_label_t addr); | 25 | extern void arch_jump_label_text_poke_early(jump_label_t addr); |
@@ -59,6 +61,9 @@ static inline int jump_label_text_reserved(void *start, void *end) | |||
59 | return 0; | 61 | return 0; |
60 | } | 62 | } |
61 | 63 | ||
64 | static inline void jump_label_lock(void) {} | ||
65 | static inline void jump_label_unlock(void) {} | ||
66 | |||
62 | #endif | 67 | #endif |
63 | 68 | ||
64 | #define COND_STMT(key, stmt) \ | 69 | #define COND_STMT(key, stmt) \ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index edef168a0406..b6de9a6f7018 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -17,13 +17,11 @@ | |||
17 | #include <linux/bitops.h> | 17 | #include <linux/bitops.h> |
18 | #include <linux/log2.h> | 18 | #include <linux/log2.h> |
19 | #include <linux/typecheck.h> | 19 | #include <linux/typecheck.h> |
20 | #include <linux/printk.h> | ||
20 | #include <linux/dynamic_debug.h> | 21 | #include <linux/dynamic_debug.h> |
21 | #include <asm/byteorder.h> | 22 | #include <asm/byteorder.h> |
22 | #include <asm/bug.h> | 23 | #include <asm/bug.h> |
23 | 24 | ||
24 | extern const char linux_banner[]; | ||
25 | extern const char linux_proc_banner[]; | ||
26 | |||
27 | #define USHRT_MAX ((u16)(~0U)) | 25 | #define USHRT_MAX ((u16)(~0U)) |
28 | #define SHRT_MAX ((s16)(USHRT_MAX>>1)) | 26 | #define SHRT_MAX ((s16)(USHRT_MAX>>1)) |
29 | #define SHRT_MIN ((s16)(-SHRT_MAX - 1)) | 27 | #define SHRT_MIN ((s16)(-SHRT_MAX - 1)) |
@@ -60,7 +58,7 @@ extern const char linux_proc_banner[]; | |||
60 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 58 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
61 | #define roundup(x, y) ( \ | 59 | #define roundup(x, y) ( \ |
62 | { \ | 60 | { \ |
63 | typeof(y) __y = y; \ | 61 | const typeof(y) __y = y; \ |
64 | (((x) + (__y - 1)) / __y) * __y; \ | 62 | (((x) + (__y - 1)) / __y) * __y; \ |
65 | } \ | 63 | } \ |
66 | ) | 64 | ) |
@@ -110,31 +108,6 @@ extern const char linux_proc_banner[]; | |||
110 | */ | 108 | */ |
111 | #define lower_32_bits(n) ((u32)(n)) | 109 | #define lower_32_bits(n) ((u32)(n)) |
112 | 110 | ||
113 | #define KERN_EMERG "<0>" /* system is unusable */ | ||
114 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | ||
115 | #define KERN_CRIT "<2>" /* critical conditions */ | ||
116 | #define KERN_ERR "<3>" /* error conditions */ | ||
117 | #define KERN_WARNING "<4>" /* warning conditions */ | ||
118 | #define KERN_NOTICE "<5>" /* normal but significant condition */ | ||
119 | #define KERN_INFO "<6>" /* informational */ | ||
120 | #define KERN_DEBUG "<7>" /* debug-level messages */ | ||
121 | |||
122 | /* Use the default kernel loglevel */ | ||
123 | #define KERN_DEFAULT "<d>" | ||
124 | /* | ||
125 | * Annotation for a "continued" line of log printout (only done after a | ||
126 | * line that had no enclosing \n). Only to be used by core/arch code | ||
127 | * during early bootup (a continued line is not SMP-safe otherwise). | ||
128 | */ | ||
129 | #define KERN_CONT "<c>" | ||
130 | |||
131 | extern int console_printk[]; | ||
132 | |||
133 | #define console_loglevel (console_printk[0]) | ||
134 | #define default_message_loglevel (console_printk[1]) | ||
135 | #define minimum_console_loglevel (console_printk[2]) | ||
136 | #define default_console_loglevel (console_printk[3]) | ||
137 | |||
138 | struct completion; | 111 | struct completion; |
139 | struct pt_regs; | 112 | struct pt_regs; |
140 | struct user; | 113 | struct user; |
@@ -173,6 +146,11 @@ extern int _cond_resched(void); | |||
173 | (__x < 0) ? -__x : __x; \ | 146 | (__x < 0) ? -__x : __x; \ |
174 | }) | 147 | }) |
175 | 148 | ||
149 | #define abs64(x) ({ \ | ||
150 | s64 __x = (x); \ | ||
151 | (__x < 0) ? -__x : __x; \ | ||
152 | }) | ||
153 | |||
176 | #ifdef CONFIG_PROVE_LOCKING | 154 | #ifdef CONFIG_PROVE_LOCKING |
177 | void might_fault(void); | 155 | void might_fault(void); |
178 | #else | 156 | #else |
@@ -182,11 +160,6 @@ static inline void might_fault(void) | |||
182 | } | 160 | } |
183 | #endif | 161 | #endif |
184 | 162 | ||
185 | struct va_format { | ||
186 | const char *fmt; | ||
187 | va_list *va; | ||
188 | }; | ||
189 | |||
190 | extern struct atomic_notifier_head panic_notifier_list; | 163 | extern struct atomic_notifier_head panic_notifier_list; |
191 | extern long (*panic_blink)(int state); | 164 | extern long (*panic_blink)(int state); |
192 | NORET_TYPE void panic(const char * fmt, ...) | 165 | NORET_TYPE void panic(const char * fmt, ...) |
@@ -203,10 +176,10 @@ extern unsigned long simple_strtoul(const char *,char **,unsigned int); | |||
203 | extern long simple_strtol(const char *,char **,unsigned int); | 176 | extern long simple_strtol(const char *,char **,unsigned int); |
204 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); | 177 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); |
205 | extern long long simple_strtoll(const char *,char **,unsigned int); | 178 | extern long long simple_strtoll(const char *,char **,unsigned int); |
206 | extern int strict_strtoul(const char *, unsigned int, unsigned long *); | 179 | extern int __must_check strict_strtoul(const char *, unsigned int, unsigned long *); |
207 | extern int strict_strtol(const char *, unsigned int, long *); | 180 | extern int __must_check strict_strtol(const char *, unsigned int, long *); |
208 | extern int strict_strtoull(const char *, unsigned int, unsigned long long *); | 181 | extern int __must_check strict_strtoull(const char *, unsigned int, unsigned long long *); |
209 | extern int strict_strtoll(const char *, unsigned int, long long *); | 182 | extern int __must_check strict_strtoll(const char *, unsigned int, long long *); |
210 | extern int sprintf(char * buf, const char * fmt, ...) | 183 | extern int sprintf(char * buf, const char * fmt, ...) |
211 | __attribute__ ((format (printf, 2, 3))); | 184 | __attribute__ ((format (printf, 2, 3))); |
212 | extern int vsprintf(char *buf, const char *, va_list) | 185 | extern int vsprintf(char *buf, const char *, va_list) |
@@ -240,109 +213,8 @@ extern int func_ptr_is_kernel_text(void *ptr); | |||
240 | struct pid; | 213 | struct pid; |
241 | extern struct pid *session_of_pgrp(struct pid *pgrp); | 214 | extern struct pid *session_of_pgrp(struct pid *pgrp); |
242 | 215 | ||
243 | /* | ||
244 | * FW_BUG | ||
245 | * Add this to a message where you are sure the firmware is buggy or behaves | ||
246 | * really stupid or out of spec. Be aware that the responsible BIOS developer | ||
247 | * should be able to fix this issue or at least get a concrete idea of the | ||
248 | * problem by reading your message without the need of looking at the kernel | ||
249 | * code. | ||
250 | * | ||
251 | * Use it for definite and high priority BIOS bugs. | ||
252 | * | ||
253 | * FW_WARN | ||
254 | * Use it for not that clear (e.g. could the kernel messed up things already?) | ||
255 | * and medium priority BIOS bugs. | ||
256 | * | ||
257 | * FW_INFO | ||
258 | * Use this one if you want to tell the user or vendor about something | ||
259 | * suspicious, but generally harmless related to the firmware. | ||
260 | * | ||
261 | * Use it for information or very low priority BIOS bugs. | ||
262 | */ | ||
263 | #define FW_BUG "[Firmware Bug]: " | ||
264 | #define FW_WARN "[Firmware Warn]: " | ||
265 | #define FW_INFO "[Firmware Info]: " | ||
266 | |||
267 | /* | ||
268 | * HW_ERR | ||
269 | * Add this to a message for hardware errors, so that user can report | ||
270 | * it to hardware vendor instead of LKML or software vendor. | ||
271 | */ | ||
272 | #define HW_ERR "[Hardware Error]: " | ||
273 | |||
274 | #ifdef CONFIG_PRINTK | ||
275 | asmlinkage int vprintk(const char *fmt, va_list args) | ||
276 | __attribute__ ((format (printf, 1, 0))); | ||
277 | asmlinkage int printk(const char * fmt, ...) | ||
278 | __attribute__ ((format (printf, 1, 2))) __cold; | ||
279 | |||
280 | extern int __printk_ratelimit(const char *func); | ||
281 | #define printk_ratelimit() __printk_ratelimit(__func__) | ||
282 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
283 | unsigned int interval_msec); | ||
284 | |||
285 | extern int printk_delay_msec; | ||
286 | |||
287 | /* | ||
288 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
289 | */ | ||
290 | #define printk_once(x...) ({ \ | ||
291 | static bool __print_once; \ | ||
292 | \ | ||
293 | if (!__print_once) { \ | ||
294 | __print_once = true; \ | ||
295 | printk(x); \ | ||
296 | } \ | ||
297 | }) | ||
298 | |||
299 | void log_buf_kexec_setup(void); | ||
300 | #else | ||
301 | static inline int vprintk(const char *s, va_list args) | ||
302 | __attribute__ ((format (printf, 1, 0))); | ||
303 | static inline int vprintk(const char *s, va_list args) { return 0; } | ||
304 | static inline int printk(const char *s, ...) | ||
305 | __attribute__ ((format (printf, 1, 2))); | ||
306 | static inline int __cold printk(const char *s, ...) { return 0; } | ||
307 | static inline int printk_ratelimit(void) { return 0; } | ||
308 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
309 | unsigned int interval_msec) \ | ||
310 | { return false; } | ||
311 | |||
312 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
313 | #define printk_once(x...) printk(x) | ||
314 | |||
315 | static inline void log_buf_kexec_setup(void) | ||
316 | { | ||
317 | } | ||
318 | #endif | ||
319 | |||
320 | /* | ||
321 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
322 | * gcc's format and side-effect checking. | ||
323 | */ | ||
324 | static inline __attribute__ ((format (printf, 1, 2))) | ||
325 | int no_printk(const char *s, ...) { return 0; } | ||
326 | |||
327 | extern int printk_needs_cpu(int cpu); | ||
328 | extern void printk_tick(void); | ||
329 | |||
330 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | ||
331 | early_printk(const char *fmt, ...); | ||
332 | |||
333 | unsigned long int_sqrt(unsigned long); | 216 | unsigned long int_sqrt(unsigned long); |
334 | 217 | ||
335 | static inline void console_silent(void) | ||
336 | { | ||
337 | console_loglevel = 0; | ||
338 | } | ||
339 | |||
340 | static inline void console_verbose(void) | ||
341 | { | ||
342 | if (console_loglevel) | ||
343 | console_loglevel = 15; | ||
344 | } | ||
345 | |||
346 | extern void bust_spinlocks(int yes); | 218 | extern void bust_spinlocks(int yes); |
347 | extern void wake_up_klogd(void); | 219 | extern void wake_up_klogd(void); |
348 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ | 220 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ |
@@ -379,22 +251,6 @@ extern enum system_states { | |||
379 | #define TAINT_CRAP 10 | 251 | #define TAINT_CRAP 10 |
380 | #define TAINT_FIRMWARE_WORKAROUND 11 | 252 | #define TAINT_FIRMWARE_WORKAROUND 11 |
381 | 253 | ||
382 | extern void dump_stack(void) __cold; | ||
383 | |||
384 | enum { | ||
385 | DUMP_PREFIX_NONE, | ||
386 | DUMP_PREFIX_ADDRESS, | ||
387 | DUMP_PREFIX_OFFSET | ||
388 | }; | ||
389 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
390 | int rowsize, int groupsize, | ||
391 | char *linebuf, size_t linebuflen, bool ascii); | ||
392 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
393 | int prefix_type, int rowsize, int groupsize, | ||
394 | const void *buf, size_t len, bool ascii); | ||
395 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
396 | const void *buf, size_t len); | ||
397 | |||
398 | extern const char hex_asc[]; | 254 | extern const char hex_asc[]; |
399 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] | 255 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] |
400 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] | 256 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] |
@@ -408,94 +264,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
408 | 264 | ||
409 | extern int hex_to_bin(char ch); | 265 | extern int hex_to_bin(char ch); |
410 | 266 | ||
411 | #ifndef pr_fmt | ||
412 | #define pr_fmt(fmt) fmt | ||
413 | #endif | ||
414 | |||
415 | #define pr_emerg(fmt, ...) \ | ||
416 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
417 | #define pr_alert(fmt, ...) \ | ||
418 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
419 | #define pr_crit(fmt, ...) \ | ||
420 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
421 | #define pr_err(fmt, ...) \ | ||
422 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
423 | #define pr_warning(fmt, ...) \ | ||
424 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
425 | #define pr_warn pr_warning | ||
426 | #define pr_notice(fmt, ...) \ | ||
427 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
428 | #define pr_info(fmt, ...) \ | ||
429 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
430 | #define pr_cont(fmt, ...) \ | ||
431 | printk(KERN_CONT fmt, ##__VA_ARGS__) | ||
432 | |||
433 | /* pr_devel() should produce zero code unless DEBUG is defined */ | ||
434 | #ifdef DEBUG | ||
435 | #define pr_devel(fmt, ...) \ | ||
436 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
437 | #else | ||
438 | #define pr_devel(fmt, ...) \ | ||
439 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
440 | #endif | ||
441 | |||
442 | /* If you are writing a driver, please use dev_dbg instead */ | ||
443 | #if defined(DEBUG) | ||
444 | #define pr_debug(fmt, ...) \ | ||
445 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
446 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
447 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ | ||
448 | #define pr_debug(fmt, ...) \ | ||
449 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | ||
450 | #else | ||
451 | #define pr_debug(fmt, ...) \ | ||
452 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
453 | #endif | ||
454 | |||
455 | /* | ||
456 | * ratelimited messages with local ratelimit_state, | ||
457 | * no local ratelimit_state used in the !PRINTK case | ||
458 | */ | ||
459 | #ifdef CONFIG_PRINTK | ||
460 | #define printk_ratelimited(fmt, ...) ({ \ | ||
461 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
462 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
463 | DEFAULT_RATELIMIT_BURST); \ | ||
464 | \ | ||
465 | if (__ratelimit(&_rs)) \ | ||
466 | printk(fmt, ##__VA_ARGS__); \ | ||
467 | }) | ||
468 | #else | ||
469 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
470 | #define printk_ratelimited printk | ||
471 | #endif | ||
472 | |||
473 | #define pr_emerg_ratelimited(fmt, ...) \ | ||
474 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
475 | #define pr_alert_ratelimited(fmt, ...) \ | ||
476 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
477 | #define pr_crit_ratelimited(fmt, ...) \ | ||
478 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
479 | #define pr_err_ratelimited(fmt, ...) \ | ||
480 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
481 | #define pr_warning_ratelimited(fmt, ...) \ | ||
482 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
483 | #define pr_warn_ratelimited pr_warning_ratelimited | ||
484 | #define pr_notice_ratelimited(fmt, ...) \ | ||
485 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
486 | #define pr_info_ratelimited(fmt, ...) \ | ||
487 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
488 | /* no pr_cont_ratelimited, don't do that... */ | ||
489 | /* If you are writing a driver, please use dev_dbg instead */ | ||
490 | #if defined(DEBUG) | ||
491 | #define pr_debug_ratelimited(fmt, ...) \ | ||
492 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
493 | #else | ||
494 | #define pr_debug_ratelimited(fmt, ...) \ | ||
495 | ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ | ||
496 | ##__VA_ARGS__); 0; }) | ||
497 | #endif | ||
498 | |||
499 | /* | 267 | /* |
500 | * General tracing related utility functions - trace_printk(), | 268 | * General tracing related utility functions - trace_printk(), |
501 | * tracing_on/tracing_off and tracing_start()/tracing_stop | 269 | * tracing_on/tracing_off and tracing_start()/tracing_stop |
@@ -651,6 +419,24 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } | |||
651 | (void) (&_max1 == &_max2); \ | 419 | (void) (&_max1 == &_max2); \ |
652 | _max1 > _max2 ? _max1 : _max2; }) | 420 | _max1 > _max2 ? _max1 : _max2; }) |
653 | 421 | ||
422 | #define min3(x, y, z) ({ \ | ||
423 | typeof(x) _min1 = (x); \ | ||
424 | typeof(y) _min2 = (y); \ | ||
425 | typeof(z) _min3 = (z); \ | ||
426 | (void) (&_min1 == &_min2); \ | ||
427 | (void) (&_min1 == &_min3); \ | ||
428 | _min1 < _min2 ? (_min1 < _min3 ? _min1 : _min3) : \ | ||
429 | (_min2 < _min3 ? _min2 : _min3); }) | ||
430 | |||
431 | #define max3(x, y, z) ({ \ | ||
432 | typeof(x) _max1 = (x); \ | ||
433 | typeof(y) _max2 = (y); \ | ||
434 | typeof(z) _max3 = (z); \ | ||
435 | (void) (&_max1 == &_max2); \ | ||
436 | (void) (&_max1 == &_max3); \ | ||
437 | _max1 > _max2 ? (_max1 > _max3 ? _max1 : _max3) : \ | ||
438 | (_max2 > _max3 ? _max2 : _max3); }) | ||
439 | |||
654 | /** | 440 | /** |
655 | * min_not_zero - return the minimum that is _not_ zero, unless both are zero | 441 | * min_not_zero - return the minimum that is _not_ zero, unless both are zero |
656 | * @x: value1 | 442 | * @x: value1 |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index c059044bc6dc..ad54c846911b 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -33,6 +33,7 @@ struct kernel_stat { | |||
33 | #ifndef CONFIG_GENERIC_HARDIRQS | 33 | #ifndef CONFIG_GENERIC_HARDIRQS |
34 | unsigned int irqs[NR_IRQS]; | 34 | unsigned int irqs[NR_IRQS]; |
35 | #endif | 35 | #endif |
36 | unsigned long irqs_sum; | ||
36 | unsigned int softirqs[NR_SOFTIRQS]; | 37 | unsigned int softirqs[NR_SOFTIRQS]; |
37 | }; | 38 | }; |
38 | 39 | ||
@@ -54,6 +55,7 @@ static inline void kstat_incr_irqs_this_cpu(unsigned int irq, | |||
54 | struct irq_desc *desc) | 55 | struct irq_desc *desc) |
55 | { | 56 | { |
56 | kstat_this_cpu.irqs[irq]++; | 57 | kstat_this_cpu.irqs[irq]++; |
58 | kstat_this_cpu.irqs_sum++; | ||
57 | } | 59 | } |
58 | 60 | ||
59 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | 61 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) |
@@ -65,8 +67,9 @@ static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | |||
65 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); | 67 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); |
66 | #define kstat_irqs_this_cpu(DESC) \ | 68 | #define kstat_irqs_this_cpu(DESC) \ |
67 | ((DESC)->kstat_irqs[smp_processor_id()]) | 69 | ((DESC)->kstat_irqs[smp_processor_id()]) |
68 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ | 70 | #define kstat_incr_irqs_this_cpu(irqno, DESC) do {\ |
69 | ((DESC)->kstat_irqs[smp_processor_id()]++) | 71 | ((DESC)->kstat_irqs[smp_processor_id()]++);\ |
72 | kstat_this_cpu.irqs_sum++; } while (0) | ||
70 | 73 | ||
71 | #endif | 74 | #endif |
72 | 75 | ||
@@ -83,6 +86,7 @@ static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) | |||
83 | /* | 86 | /* |
84 | * Number of interrupts per specific IRQ source, since bootup | 87 | * Number of interrupts per specific IRQ source, since bootup |
85 | */ | 88 | */ |
89 | #ifndef CONFIG_GENERIC_HARDIRQS | ||
86 | static inline unsigned int kstat_irqs(unsigned int irq) | 90 | static inline unsigned int kstat_irqs(unsigned int irq) |
87 | { | 91 | { |
88 | unsigned int sum = 0; | 92 | unsigned int sum = 0; |
@@ -93,7 +97,17 @@ static inline unsigned int kstat_irqs(unsigned int irq) | |||
93 | 97 | ||
94 | return sum; | 98 | return sum; |
95 | } | 99 | } |
100 | #else | ||
101 | extern unsigned int kstat_irqs(unsigned int irq); | ||
102 | #endif | ||
96 | 103 | ||
104 | /* | ||
105 | * Number of interrupts per cpu, since bootup | ||
106 | */ | ||
107 | static inline unsigned int kstat_cpu_irqs_sum(unsigned int cpu) | ||
108 | { | ||
109 | return kstat_cpu(cpu).irqs_sum; | ||
110 | } | ||
97 | 111 | ||
98 | /* | 112 | /* |
99 | * Lock/unlock the current runqueue - to extract task statistics: | 113 | * Lock/unlock the current runqueue - to extract task statistics: |
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index 62dbee554f60..10308c6a3d1c 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h | |||
@@ -172,7 +172,13 @@ struct kfifo_rec_ptr_2 __STRUCT_KFIFO_PTR(unsigned char, 2, void); | |||
172 | 172 | ||
173 | 173 | ||
174 | static inline unsigned int __must_check | 174 | static inline unsigned int __must_check |
175 | __kfifo_must_check_helper(unsigned int val) | 175 | __kfifo_uint_must_check_helper(unsigned int val) |
176 | { | ||
177 | return val; | ||
178 | } | ||
179 | |||
180 | static inline int __must_check | ||
181 | __kfifo_int_must_check_helper(int val) | ||
176 | { | 182 | { |
177 | return val; | 183 | return val; |
178 | } | 184 | } |
@@ -267,7 +273,7 @@ __kfifo_must_check_helper(unsigned int val) | |||
267 | * @fifo: address of the fifo to be used | 273 | * @fifo: address of the fifo to be used |
268 | */ | 274 | */ |
269 | #define kfifo_avail(fifo) \ | 275 | #define kfifo_avail(fifo) \ |
270 | __kfifo_must_check_helper( \ | 276 | __kfifo_uint_must_check_helper( \ |
271 | ({ \ | 277 | ({ \ |
272 | typeof((fifo) + 1) __tmpq = (fifo); \ | 278 | typeof((fifo) + 1) __tmpq = (fifo); \ |
273 | const size_t __recsize = sizeof(*__tmpq->rectype); \ | 279 | const size_t __recsize = sizeof(*__tmpq->rectype); \ |
@@ -300,7 +306,7 @@ __kfifo_must_check_helper( \ | |||
300 | * This function returns the size of the next fifo record in number of bytes. | 306 | * This function returns the size of the next fifo record in number of bytes. |
301 | */ | 307 | */ |
302 | #define kfifo_peek_len(fifo) \ | 308 | #define kfifo_peek_len(fifo) \ |
303 | __kfifo_must_check_helper( \ | 309 | __kfifo_uint_must_check_helper( \ |
304 | ({ \ | 310 | ({ \ |
305 | typeof((fifo) + 1) __tmp = (fifo); \ | 311 | typeof((fifo) + 1) __tmp = (fifo); \ |
306 | const size_t __recsize = sizeof(*__tmp->rectype); \ | 312 | const size_t __recsize = sizeof(*__tmp->rectype); \ |
@@ -323,7 +329,7 @@ __kfifo_must_check_helper( \ | |||
323 | * Return 0 if no error, otherwise an error code. | 329 | * Return 0 if no error, otherwise an error code. |
324 | */ | 330 | */ |
325 | #define kfifo_alloc(fifo, size, gfp_mask) \ | 331 | #define kfifo_alloc(fifo, size, gfp_mask) \ |
326 | __kfifo_must_check_helper( \ | 332 | __kfifo_int_must_check_helper( \ |
327 | ({ \ | 333 | ({ \ |
328 | typeof((fifo) + 1) __tmp = (fifo); \ | 334 | typeof((fifo) + 1) __tmp = (fifo); \ |
329 | struct __kfifo *__kfifo = &__tmp->kfifo; \ | 335 | struct __kfifo *__kfifo = &__tmp->kfifo; \ |
@@ -419,7 +425,7 @@ __kfifo_must_check_helper( \ | |||
419 | * writer, you don't need extra locking to use these macro. | 425 | * writer, you don't need extra locking to use these macro. |
420 | */ | 426 | */ |
421 | #define kfifo_get(fifo, val) \ | 427 | #define kfifo_get(fifo, val) \ |
422 | __kfifo_must_check_helper( \ | 428 | __kfifo_uint_must_check_helper( \ |
423 | ({ \ | 429 | ({ \ |
424 | typeof((fifo) + 1) __tmp = (fifo); \ | 430 | typeof((fifo) + 1) __tmp = (fifo); \ |
425 | typeof((val) + 1) __val = (val); \ | 431 | typeof((val) + 1) __val = (val); \ |
@@ -460,7 +466,7 @@ __kfifo_must_check_helper( \ | |||
460 | * writer, you don't need extra locking to use these macro. | 466 | * writer, you don't need extra locking to use these macro. |
461 | */ | 467 | */ |
462 | #define kfifo_peek(fifo, val) \ | 468 | #define kfifo_peek(fifo, val) \ |
463 | __kfifo_must_check_helper( \ | 469 | __kfifo_uint_must_check_helper( \ |
464 | ({ \ | 470 | ({ \ |
465 | typeof((fifo) + 1) __tmp = (fifo); \ | 471 | typeof((fifo) + 1) __tmp = (fifo); \ |
466 | typeof((val) + 1) __val = (val); \ | 472 | typeof((val) + 1) __val = (val); \ |
@@ -552,7 +558,7 @@ __kfifo_must_check_helper( \ | |||
552 | * writer, you don't need extra locking to use these macro. | 558 | * writer, you don't need extra locking to use these macro. |
553 | */ | 559 | */ |
554 | #define kfifo_out(fifo, buf, n) \ | 560 | #define kfifo_out(fifo, buf, n) \ |
555 | __kfifo_must_check_helper( \ | 561 | __kfifo_uint_must_check_helper( \ |
556 | ({ \ | 562 | ({ \ |
557 | typeof((fifo) + 1) __tmp = (fifo); \ | 563 | typeof((fifo) + 1) __tmp = (fifo); \ |
558 | typeof((buf) + 1) __buf = (buf); \ | 564 | typeof((buf) + 1) __buf = (buf); \ |
@@ -580,7 +586,7 @@ __kfifo_must_check_helper( \ | |||
580 | * copied. | 586 | * copied. |
581 | */ | 587 | */ |
582 | #define kfifo_out_spinlocked(fifo, buf, n, lock) \ | 588 | #define kfifo_out_spinlocked(fifo, buf, n, lock) \ |
583 | __kfifo_must_check_helper( \ | 589 | __kfifo_uint_must_check_helper( \ |
584 | ({ \ | 590 | ({ \ |
585 | unsigned long __flags; \ | 591 | unsigned long __flags; \ |
586 | unsigned int __ret; \ | 592 | unsigned int __ret; \ |
@@ -609,7 +615,7 @@ __kfifo_must_check_helper( \ | |||
609 | * writer, you don't need extra locking to use these macro. | 615 | * writer, you don't need extra locking to use these macro. |
610 | */ | 616 | */ |
611 | #define kfifo_from_user(fifo, from, len, copied) \ | 617 | #define kfifo_from_user(fifo, from, len, copied) \ |
612 | __kfifo_must_check_helper( \ | 618 | __kfifo_uint_must_check_helper( \ |
613 | ({ \ | 619 | ({ \ |
614 | typeof((fifo) + 1) __tmp = (fifo); \ | 620 | typeof((fifo) + 1) __tmp = (fifo); \ |
615 | const void __user *__from = (from); \ | 621 | const void __user *__from = (from); \ |
@@ -637,7 +643,7 @@ __kfifo_must_check_helper( \ | |||
637 | * writer, you don't need extra locking to use these macro. | 643 | * writer, you don't need extra locking to use these macro. |
638 | */ | 644 | */ |
639 | #define kfifo_to_user(fifo, to, len, copied) \ | 645 | #define kfifo_to_user(fifo, to, len, copied) \ |
640 | __kfifo_must_check_helper( \ | 646 | __kfifo_uint_must_check_helper( \ |
641 | ({ \ | 647 | ({ \ |
642 | typeof((fifo) + 1) __tmp = (fifo); \ | 648 | typeof((fifo) + 1) __tmp = (fifo); \ |
643 | void __user *__to = (to); \ | 649 | void __user *__to = (to); \ |
@@ -764,7 +770,7 @@ __kfifo_must_check_helper( \ | |||
764 | * writer, you don't need extra locking to use these macro. | 770 | * writer, you don't need extra locking to use these macro. |
765 | */ | 771 | */ |
766 | #define kfifo_out_peek(fifo, buf, n) \ | 772 | #define kfifo_out_peek(fifo, buf, n) \ |
767 | __kfifo_must_check_helper( \ | 773 | __kfifo_uint_must_check_helper( \ |
768 | ({ \ | 774 | ({ \ |
769 | typeof((fifo) + 1) __tmp = (fifo); \ | 775 | typeof((fifo) + 1) __tmp = (fifo); \ |
770 | typeof((buf) + 1) __buf = (buf); \ | 776 | typeof((buf) + 1) __buf = (buf); \ |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index cc96f0f23e04..092e4250a458 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
@@ -35,16 +35,6 @@ struct pt_regs; | |||
35 | */ | 35 | */ |
36 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); | 36 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); |
37 | 37 | ||
38 | /** | ||
39 | * kgdb_disable_hw_debug - (optional) Disable hardware debugging hook | ||
40 | * @regs: Current &struct pt_regs. | ||
41 | * | ||
42 | * This function will be called if the particular architecture must | ||
43 | * disable hardware debugging while it is processing gdb packets or | ||
44 | * handling exception. | ||
45 | */ | ||
46 | extern void kgdb_disable_hw_debug(struct pt_regs *regs); | ||
47 | |||
48 | struct tasklet_struct; | 38 | struct tasklet_struct; |
49 | struct task_struct; | 39 | struct task_struct; |
50 | struct uart_port; | 40 | struct uart_port; |
@@ -243,6 +233,8 @@ extern void kgdb_arch_late(void); | |||
243 | * breakpoint. | 233 | * breakpoint. |
244 | * @remove_hw_breakpoint: Allow an architecture to specify how to remove a | 234 | * @remove_hw_breakpoint: Allow an architecture to specify how to remove a |
245 | * hardware breakpoint. | 235 | * hardware breakpoint. |
236 | * @disable_hw_break: Allow an architecture to specify how to disable | ||
237 | * hardware breakpoints for a single cpu. | ||
246 | * @remove_all_hw_break: Allow an architecture to specify how to remove all | 238 | * @remove_all_hw_break: Allow an architecture to specify how to remove all |
247 | * hardware breakpoints. | 239 | * hardware breakpoints. |
248 | * @correct_hw_break: Allow an architecture to specify how to correct the | 240 | * @correct_hw_break: Allow an architecture to specify how to correct the |
@@ -256,6 +248,7 @@ struct kgdb_arch { | |||
256 | int (*remove_breakpoint)(unsigned long, char *); | 248 | int (*remove_breakpoint)(unsigned long, char *); |
257 | int (*set_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); | 249 | int (*set_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); |
258 | int (*remove_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); | 250 | int (*remove_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); |
251 | void (*disable_hw_break)(struct pt_regs *regs); | ||
259 | void (*remove_all_hw_break)(void); | 252 | void (*remove_all_hw_break)(void); |
260 | void (*correct_hw_break)(void); | 253 | void (*correct_hw_break)(void); |
261 | }; | 254 | }; |
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 685ea65eb803..ce0775aa64c3 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
@@ -81,16 +81,41 @@ struct kthread_work { | |||
81 | #define DEFINE_KTHREAD_WORK(work, fn) \ | 81 | #define DEFINE_KTHREAD_WORK(work, fn) \ |
82 | struct kthread_work work = KTHREAD_WORK_INIT(work, fn) | 82 | struct kthread_work work = KTHREAD_WORK_INIT(work, fn) |
83 | 83 | ||
84 | static inline void init_kthread_worker(struct kthread_worker *worker) | 84 | /* |
85 | { | 85 | * kthread_worker.lock and kthread_work.done need their own lockdep class |
86 | *worker = (struct kthread_worker)KTHREAD_WORKER_INIT(*worker); | 86 | * keys if they are defined on stack with lockdep enabled. Use the |
87 | } | 87 | * following macros when defining them on stack. |
88 | 88 | */ | |
89 | static inline void init_kthread_work(struct kthread_work *work, | 89 | #ifdef CONFIG_LOCKDEP |
90 | kthread_work_func_t fn) | 90 | # define KTHREAD_WORKER_INIT_ONSTACK(worker) \ |
91 | { | 91 | ({ init_kthread_worker(&worker); worker; }) |
92 | *work = (struct kthread_work)KTHREAD_WORK_INIT(*work, fn); | 92 | # define DEFINE_KTHREAD_WORKER_ONSTACK(worker) \ |
93 | } | 93 | struct kthread_worker worker = KTHREAD_WORKER_INIT_ONSTACK(worker) |
94 | # define KTHREAD_WORK_INIT_ONSTACK(work, fn) \ | ||
95 | ({ init_kthread_work((&work), fn); work; }) | ||
96 | # define DEFINE_KTHREAD_WORK_ONSTACK(work, fn) \ | ||
97 | struct kthread_work work = KTHREAD_WORK_INIT_ONSTACK(work, fn) | ||
98 | #else | ||
99 | # define DEFINE_KTHREAD_WORKER_ONSTACK(worker) DEFINE_KTHREAD_WORKER(worker) | ||
100 | # define DEFINE_KTHREAD_WORK_ONSTACK(work, fn) DEFINE_KTHREAD_WORK(work, fn) | ||
101 | #endif | ||
102 | |||
103 | extern void __init_kthread_worker(struct kthread_worker *worker, | ||
104 | const char *name, struct lock_class_key *key); | ||
105 | |||
106 | #define init_kthread_worker(worker) \ | ||
107 | do { \ | ||
108 | static struct lock_class_key __key; \ | ||
109 | __init_kthread_worker((worker), "("#worker")->lock", &__key); \ | ||
110 | } while (0) | ||
111 | |||
112 | #define init_kthread_work(work, fn) \ | ||
113 | do { \ | ||
114 | memset((work), 0, sizeof(struct kthread_work)); \ | ||
115 | INIT_LIST_HEAD(&(work)->node); \ | ||
116 | (work)->func = (fn); \ | ||
117 | init_waitqueue_head(&(work)->done); \ | ||
118 | } while (0) | ||
94 | 119 | ||
95 | int kthread_worker_fn(void *worker_ptr); | 120 | int kthread_worker_fn(void *worker_ptr); |
96 | 121 | ||
diff --git a/include/linux/leds-lp5521.h b/include/linux/leds-lp5521.h new file mode 100644 index 000000000000..38368d785f08 --- /dev/null +++ b/include/linux/leds-lp5521.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * LP5521 LED chip driver. | ||
3 | * | ||
4 | * Copyright (C) 2010 Nokia Corporation | ||
5 | * | ||
6 | * Contact: Samu Onkalo <samu.p.onkalo@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __LINUX_LP5521_H | ||
24 | #define __LINUX_LP5521_H | ||
25 | |||
26 | /* See Documentation/leds/leds-lp5521.txt */ | ||
27 | |||
28 | struct lp5521_led_config { | ||
29 | u8 chan_nr; | ||
30 | u8 led_current; /* mA x10, 0 if led is not connected */ | ||
31 | u8 max_current; | ||
32 | }; | ||
33 | |||
34 | #define LP5521_CLOCK_AUTO 0 | ||
35 | #define LP5521_CLOCK_INT 1 | ||
36 | #define LP5521_CLOCK_EXT 2 | ||
37 | |||
38 | struct lp5521_platform_data { | ||
39 | struct lp5521_led_config *led_config; | ||
40 | u8 num_channels; | ||
41 | u8 clock_mode; | ||
42 | int (*setup_resources)(void); | ||
43 | void (*release_resources)(void); | ||
44 | void (*enable)(bool state); | ||
45 | }; | ||
46 | |||
47 | #endif /* __LINUX_LP5521_H */ | ||
diff --git a/include/linux/leds-lp5523.h b/include/linux/leds-lp5523.h new file mode 100644 index 000000000000..796747637b80 --- /dev/null +++ b/include/linux/leds-lp5523.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * LP5523 LED Driver | ||
3 | * | ||
4 | * Copyright (C) 2010 Nokia Corporation | ||
5 | * | ||
6 | * Contact: Samu Onkalo <samu.p.onkalo@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __LINUX_LP5523_H | ||
24 | #define __LINUX_LP5523_H | ||
25 | |||
26 | /* See Documentation/leds/leds-lp5523.txt */ | ||
27 | |||
28 | struct lp5523_led_config { | ||
29 | u8 chan_nr; | ||
30 | u8 led_current; /* mA x10, 0 if led is not connected */ | ||
31 | u8 max_current; | ||
32 | }; | ||
33 | |||
34 | #define LP5523_CLOCK_AUTO 0 | ||
35 | #define LP5523_CLOCK_INT 1 | ||
36 | #define LP5523_CLOCK_EXT 2 | ||
37 | |||
38 | struct lp5523_platform_data { | ||
39 | struct lp5523_led_config *led_config; | ||
40 | u8 num_channels; | ||
41 | u8 clock_mode; | ||
42 | int (*setup_resources)(void); | ||
43 | void (*release_resources)(void); | ||
44 | void (*enable)(bool state); | ||
45 | }; | ||
46 | |||
47 | #endif /* __LINUX_LP5523_H */ | ||
diff --git a/include/linux/leds.h b/include/linux/leds.h index ba6986a11663..0f19df9e37b0 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
17 | #include <linux/rwsem.h> | 17 | #include <linux/rwsem.h> |
18 | #include <linux/timer.h> | ||
18 | 19 | ||
19 | struct device; | 20 | struct device; |
20 | /* | 21 | /* |
@@ -45,10 +46,14 @@ struct led_classdev { | |||
45 | /* Get LED brightness level */ | 46 | /* Get LED brightness level */ |
46 | enum led_brightness (*brightness_get)(struct led_classdev *led_cdev); | 47 | enum led_brightness (*brightness_get)(struct led_classdev *led_cdev); |
47 | 48 | ||
48 | /* Activate hardware accelerated blink, delays are in | 49 | /* |
49 | * miliseconds and if none is provided then a sensible default | 50 | * Activate hardware accelerated blink, delays are in milliseconds |
50 | * should be chosen. The call can adjust the timings if it can't | 51 | * and if both are zero then a sensible default should be chosen. |
51 | * match the values specified exactly. */ | 52 | * The call should adjust the timings in that case and if it can't |
53 | * match the values specified exactly. | ||
54 | * Deactivate blinking again when the brightness is set to a fixed | ||
55 | * value via the brightness_set() callback. | ||
56 | */ | ||
52 | int (*blink_set)(struct led_classdev *led_cdev, | 57 | int (*blink_set)(struct led_classdev *led_cdev, |
53 | unsigned long *delay_on, | 58 | unsigned long *delay_on, |
54 | unsigned long *delay_off); | 59 | unsigned long *delay_off); |
@@ -57,6 +62,10 @@ struct led_classdev { | |||
57 | struct list_head node; /* LED Device list */ | 62 | struct list_head node; /* LED Device list */ |
58 | const char *default_trigger; /* Trigger to use */ | 63 | const char *default_trigger; /* Trigger to use */ |
59 | 64 | ||
65 | unsigned long blink_delay_on, blink_delay_off; | ||
66 | struct timer_list blink_timer; | ||
67 | int blink_brightness; | ||
68 | |||
60 | #ifdef CONFIG_LEDS_TRIGGERS | 69 | #ifdef CONFIG_LEDS_TRIGGERS |
61 | /* Protects the trigger data below */ | 70 | /* Protects the trigger data below */ |
62 | struct rw_semaphore trigger_lock; | 71 | struct rw_semaphore trigger_lock; |
@@ -73,6 +82,36 @@ extern void led_classdev_unregister(struct led_classdev *led_cdev); | |||
73 | extern void led_classdev_suspend(struct led_classdev *led_cdev); | 82 | extern void led_classdev_suspend(struct led_classdev *led_cdev); |
74 | extern void led_classdev_resume(struct led_classdev *led_cdev); | 83 | extern void led_classdev_resume(struct led_classdev *led_cdev); |
75 | 84 | ||
85 | /** | ||
86 | * led_blink_set - set blinking with software fallback | ||
87 | * @led_cdev: the LED to start blinking | ||
88 | * @delay_on: the time it should be on (in ms) | ||
89 | * @delay_off: the time it should ble off (in ms) | ||
90 | * | ||
91 | * This function makes the LED blink, attempting to use the | ||
92 | * hardware acceleration if possible, but falling back to | ||
93 | * software blinking if there is no hardware blinking or if | ||
94 | * the LED refuses the passed values. | ||
95 | * | ||
96 | * Note that if software blinking is active, simply calling | ||
97 | * led_cdev->brightness_set() will not stop the blinking, | ||
98 | * use led_classdev_brightness_set() instead. | ||
99 | */ | ||
100 | extern void led_blink_set(struct led_classdev *led_cdev, | ||
101 | unsigned long *delay_on, | ||
102 | unsigned long *delay_off); | ||
103 | /** | ||
104 | * led_brightness_set - set LED brightness | ||
105 | * @led_cdev: the LED to set | ||
106 | * @brightness: the brightness to set it to | ||
107 | * | ||
108 | * Set an LED's brightness, and, if necessary, cancel the | ||
109 | * software blink timer that implements blinking when the | ||
110 | * hardware doesn't. | ||
111 | */ | ||
112 | extern void led_brightness_set(struct led_classdev *led_cdev, | ||
113 | enum led_brightness brightness); | ||
114 | |||
76 | /* | 115 | /* |
77 | * LED Triggers | 116 | * LED Triggers |
78 | */ | 117 | */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 15b77b8dc7e1..d947b1231662 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -986,7 +986,7 @@ extern void ata_host_init(struct ata_host *, struct device *, | |||
986 | unsigned long, struct ata_port_operations *); | 986 | unsigned long, struct ata_port_operations *); |
987 | extern int ata_scsi_detect(struct scsi_host_template *sht); | 987 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
988 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 988 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
989 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 989 | extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd); |
990 | extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev, | 990 | extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev, |
991 | int cmd, void __user *arg); | 991 | int cmd, void __user *arg); |
992 | extern void ata_sas_port_destroy(struct ata_port *); | 992 | extern void ata_sas_port_destroy(struct ata_port *); |
diff --git a/include/linux/list.h b/include/linux/list.h index 88a000617d77..9a5f8a71810c 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -636,6 +636,12 @@ static inline void hlist_add_after(struct hlist_node *n, | |||
636 | next->next->pprev = &next->next; | 636 | next->next->pprev = &next->next; |
637 | } | 637 | } |
638 | 638 | ||
639 | /* after that we'll appear to be on some hlist and hlist_del will work */ | ||
640 | static inline void hlist_add_fake(struct hlist_node *n) | ||
641 | { | ||
642 | n->pprev = &n->next; | ||
643 | } | ||
644 | |||
639 | /* | 645 | /* |
640 | * Move a list from one list head to another. Fixup the pprev | 646 | * Move a list from one list head to another. Fixup the pprev |
641 | * reference of the first entry if it exists. | 647 | * reference of the first entry if it exists. |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index a34dea46b629..2dee05e5119a 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -43,6 +43,7 @@ struct nlm_host { | |||
43 | struct sockaddr_storage h_addr; /* peer address */ | 43 | struct sockaddr_storage h_addr; /* peer address */ |
44 | size_t h_addrlen; | 44 | size_t h_addrlen; |
45 | struct sockaddr_storage h_srcaddr; /* our address (optional) */ | 45 | struct sockaddr_storage h_srcaddr; /* our address (optional) */ |
46 | size_t h_srcaddrlen; | ||
46 | struct rpc_clnt *h_rpcclnt; /* RPC client to talk to peer */ | 47 | struct rpc_clnt *h_rpcclnt; /* RPC client to talk to peer */ |
47 | char *h_name; /* remote hostname */ | 48 | char *h_name; /* remote hostname */ |
48 | u32 h_version; /* interface version */ | 49 | u32 h_version; /* interface version */ |
diff --git a/include/linux/magic.h b/include/linux/magic.h index eb9800f05782..ff690d05f129 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
@@ -57,5 +57,6 @@ | |||
57 | 57 | ||
58 | #define DEVPTS_SUPER_MAGIC 0x1cd1 | 58 | #define DEVPTS_SUPER_MAGIC 0x1cd1 |
59 | #define SOCKFS_MAGIC 0x534F434B | 59 | #define SOCKFS_MAGIC 0x534F434B |
60 | #define V9FS_MAGIC 0x01021997 | ||
60 | 61 | ||
61 | #endif /* __LINUX_MAGIC_H__ */ | 62 | #endif /* __LINUX_MAGIC_H__ */ |
diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h index d0f08018335d..dd3c34ebca9a 100644 --- a/include/linux/marvell_phy.h +++ b/include/linux/marvell_phy.h | |||
@@ -11,8 +11,9 @@ | |||
11 | #define MARVELL_PHY_ID_88E1118 0x01410e10 | 11 | #define MARVELL_PHY_ID_88E1118 0x01410e10 |
12 | #define MARVELL_PHY_ID_88E1121R 0x01410cb0 | 12 | #define MARVELL_PHY_ID_88E1121R 0x01410cb0 |
13 | #define MARVELL_PHY_ID_88E1145 0x01410cd0 | 13 | #define MARVELL_PHY_ID_88E1145 0x01410cd0 |
14 | #define MARVELL_PHY_ID_88E1149R 0x01410e50 | ||
14 | #define MARVELL_PHY_ID_88E1240 0x01410e30 | 15 | #define MARVELL_PHY_ID_88E1240 0x01410e30 |
15 | #define MARVELL_PHY_ID_88EC048 0x01410e90 | 16 | #define MARVELL_PHY_ID_88E1318S 0x01410e90 |
16 | 17 | ||
17 | /* struct phy_device dev_flags definitions */ | 18 | /* struct phy_device dev_flags definitions */ |
18 | #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 | 19 | #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 |
diff --git a/include/linux/math64.h b/include/linux/math64.h index c87f1528703a..23fcdfcba81b 100644 --- a/include/linux/math64.h +++ b/include/linux/math64.h | |||
@@ -35,6 +35,14 @@ static inline u64 div64_u64(u64 dividend, u64 divisor) | |||
35 | return dividend / divisor; | 35 | return dividend / divisor; |
36 | } | 36 | } |
37 | 37 | ||
38 | /** | ||
39 | * div64_s64 - signed 64bit divide with 64bit divisor | ||
40 | */ | ||
41 | static inline s64 div64_s64(s64 dividend, s64 divisor) | ||
42 | { | ||
43 | return dividend / divisor; | ||
44 | } | ||
45 | |||
38 | #elif BITS_PER_LONG == 32 | 46 | #elif BITS_PER_LONG == 32 |
39 | 47 | ||
40 | #ifndef div_u64_rem | 48 | #ifndef div_u64_rem |
@@ -53,6 +61,10 @@ extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder); | |||
53 | extern u64 div64_u64(u64 dividend, u64 divisor); | 61 | extern u64 div64_u64(u64 dividend, u64 divisor); |
54 | #endif | 62 | #endif |
55 | 63 | ||
64 | #ifndef div64_s64 | ||
65 | extern s64 div64_s64(s64 dividend, s64 divisor); | ||
66 | #endif | ||
67 | |||
56 | #endif /* BITS_PER_LONG */ | 68 | #endif /* BITS_PER_LONG */ |
57 | 69 | ||
58 | /** | 70 | /** |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 864035fb8f8a..31c237a00c48 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -70,6 +70,10 @@ extern void online_page(struct page *page); | |||
70 | extern int online_pages(unsigned long, unsigned long); | 70 | extern int online_pages(unsigned long, unsigned long); |
71 | extern void __offline_isolated_pages(unsigned long, unsigned long); | 71 | extern void __offline_isolated_pages(unsigned long, unsigned long); |
72 | 72 | ||
73 | #ifdef CONFIG_MEMORY_HOTREMOVE | ||
74 | extern bool is_pageblock_removable_nolock(struct page *page); | ||
75 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | ||
76 | |||
73 | /* reasonably generic interface to expand the physical pages in a zone */ | 77 | /* reasonably generic interface to expand the physical pages in a zone */ |
74 | extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, | 78 | extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, |
75 | unsigned long nr_pages); | 79 | unsigned long nr_pages); |
@@ -157,6 +161,9 @@ extern void register_page_bootmem_info_node(struct pglist_data *pgdat); | |||
157 | extern void put_page_bootmem(struct page *page); | 161 | extern void put_page_bootmem(struct page *page); |
158 | #endif | 162 | #endif |
159 | 163 | ||
164 | void lock_memory_hotplug(void); | ||
165 | void unlock_memory_hotplug(void); | ||
166 | |||
160 | #else /* ! CONFIG_MEMORY_HOTPLUG */ | 167 | #else /* ! CONFIG_MEMORY_HOTPLUG */ |
161 | /* | 168 | /* |
162 | * Stub functions for when hotplug is off | 169 | * Stub functions for when hotplug is off |
@@ -188,6 +195,9 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) | |||
188 | { | 195 | { |
189 | } | 196 | } |
190 | 197 | ||
198 | static inline void lock_memory_hotplug(void) {} | ||
199 | static inline void unlock_memory_hotplug(void) {} | ||
200 | |||
191 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ | 201 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ |
192 | 202 | ||
193 | #ifdef CONFIG_MEMORY_HOTREMOVE | 203 | #ifdef CONFIG_MEMORY_HOTREMOVE |
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h index bfd23bef7363..4db1fbd8969e 100644 --- a/include/linux/mfd/88pm860x.h +++ b/include/linux/mfd/88pm860x.h | |||
@@ -138,7 +138,7 @@ enum { | |||
138 | PM8607_ID_RG_MAX, | 138 | PM8607_ID_RG_MAX, |
139 | }; | 139 | }; |
140 | 140 | ||
141 | #define PM8607_VERSION (0x40) /* 8607 chip ID */ | 141 | /* 8607 chip ID is 0x40 or 0x50 */ |
142 | #define PM8607_VERSION_MASK (0xF0) /* 8607 chip ID mask */ | 142 | #define PM8607_VERSION_MASK (0xF0) /* 8607 chip ID mask */ |
143 | 143 | ||
144 | /* Interrupt Registers */ | 144 | /* Interrupt Registers */ |
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h index f5cec4500f38..d63b6050b183 100644 --- a/include/linux/mfd/ab8500.h +++ b/include/linux/mfd/ab8500.h | |||
@@ -10,6 +10,29 @@ | |||
10 | #include <linux/device.h> | 10 | #include <linux/device.h> |
11 | 11 | ||
12 | /* | 12 | /* |
13 | * AB8500 bank addresses | ||
14 | */ | ||
15 | #define AB8500_SYS_CTRL1_BLOCK 0x1 | ||
16 | #define AB8500_SYS_CTRL2_BLOCK 0x2 | ||
17 | #define AB8500_REGU_CTRL1 0x3 | ||
18 | #define AB8500_REGU_CTRL2 0x4 | ||
19 | #define AB8500_USB 0x5 | ||
20 | #define AB8500_TVOUT 0x6 | ||
21 | #define AB8500_DBI 0x7 | ||
22 | #define AB8500_ECI_AV_ACC 0x8 | ||
23 | #define AB8500_RESERVED 0x9 | ||
24 | #define AB8500_GPADC 0xA | ||
25 | #define AB8500_CHARGER 0xB | ||
26 | #define AB8500_GAS_GAUGE 0xC | ||
27 | #define AB8500_AUDIO 0xD | ||
28 | #define AB8500_INTERRUPT 0xE | ||
29 | #define AB8500_RTC 0xF | ||
30 | #define AB8500_MISC 0x10 | ||
31 | #define AB8500_DEBUG 0x12 | ||
32 | #define AB8500_PROD_TEST 0x13 | ||
33 | #define AB8500_OTP_EMUL 0x15 | ||
34 | |||
35 | /* | ||
13 | * Interrupts | 36 | * Interrupts |
14 | */ | 37 | */ |
15 | 38 | ||
@@ -99,6 +122,7 @@ struct ab8500 { | |||
99 | int revision; | 122 | int revision; |
100 | int irq_base; | 123 | int irq_base; |
101 | int irq; | 124 | int irq; |
125 | u8 chip_id; | ||
102 | 126 | ||
103 | int (*write) (struct ab8500 *a8500, u16 addr, u8 data); | 127 | int (*write) (struct ab8500 *a8500, u16 addr, u8 data); |
104 | int (*read) (struct ab8500 *a8500, u16 addr); | 128 | int (*read) (struct ab8500 *a8500, u16 addr); |
@@ -124,10 +148,6 @@ struct ab8500_platform_data { | |||
124 | struct regulator_init_data *regulator[AB8500_NUM_REGULATORS]; | 148 | struct regulator_init_data *regulator[AB8500_NUM_REGULATORS]; |
125 | }; | 149 | }; |
126 | 150 | ||
127 | extern int ab8500_write(struct ab8500 *a8500, u16 addr, u8 data); | ||
128 | extern int ab8500_read(struct ab8500 *a8500, u16 addr); | ||
129 | extern int ab8500_set_bits(struct ab8500 *a8500, u16 addr, u8 mask, u8 data); | ||
130 | |||
131 | extern int __devinit ab8500_init(struct ab8500 *ab8500); | 151 | extern int __devinit ab8500_init(struct ab8500 *ab8500); |
132 | extern int __devexit ab8500_exit(struct ab8500 *ab8500); | 152 | extern int __devexit ab8500_exit(struct ab8500 *ab8500); |
133 | 153 | ||
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h index 390726fcbcb1..67bd6f7ecf32 100644 --- a/include/linux/mfd/abx500.h +++ b/include/linux/mfd/abx500.h | |||
@@ -6,8 +6,7 @@ | |||
6 | * | 6 | * |
7 | * ABX500 core access functions. | 7 | * ABX500 core access functions. |
8 | * The abx500 interface is used for the Analog Baseband chip | 8 | * The abx500 interface is used for the Analog Baseband chip |
9 | * ab3100, ab3550, ab5500 and possibly comming. It is not used for | 9 | * ab3100, ab3550, ab5500, and ab8500. |
10 | * ab4500 and ab8500 since they are another family of chip. | ||
11 | * | 10 | * |
12 | * Author: Mattias Wallin <mattias.wallin@stericsson.com> | 11 | * Author: Mattias Wallin <mattias.wallin@stericsson.com> |
13 | * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> | 12 | * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> |
@@ -230,4 +229,5 @@ struct abx500_ops { | |||
230 | }; | 229 | }; |
231 | 230 | ||
232 | int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops); | 231 | int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops); |
232 | void abx500_remove_ops(struct device *dev); | ||
233 | #endif | 233 | #endif |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index 11d740b8831d..cb93d80aa642 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
@@ -44,6 +44,9 @@ struct mfd_cell { | |||
44 | */ | 44 | */ |
45 | int num_resources; | 45 | int num_resources; |
46 | const struct resource *resources; | 46 | const struct resource *resources; |
47 | |||
48 | /* don't check for resource conflicts */ | ||
49 | bool ignore_resource_conflicts; | ||
47 | }; | 50 | }; |
48 | 51 | ||
49 | extern int mfd_add_devices(struct device *parent, int id, | 52 | extern int mfd_add_devices(struct device *parent, int id, |
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h index 6dc75b3e2d33..7363dea6bbcd 100644 --- a/include/linux/mfd/max8998-private.h +++ b/include/linux/mfd/max8998-private.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * max8698.h - Voltage regulator driver for the Maxim 8998 | 2 | * max8998.h - Voltage regulator driver for the Maxim 8998 |
3 | * | 3 | * |
4 | * Copyright (C) 2009-2010 Samsung Electrnoics | 4 | * Copyright (C) 2009-2010 Samsung Electrnoics |
5 | * Kyungmin Park <kyungmin.park@samsung.com> | 5 | * Kyungmin Park <kyungmin.park@samsung.com> |
@@ -23,6 +23,8 @@ | |||
23 | #ifndef __LINUX_MFD_MAX8998_PRIV_H | 23 | #ifndef __LINUX_MFD_MAX8998_PRIV_H |
24 | #define __LINUX_MFD_MAX8998_PRIV_H | 24 | #define __LINUX_MFD_MAX8998_PRIV_H |
25 | 25 | ||
26 | #define MAX8998_NUM_IRQ_REGS 4 | ||
27 | |||
26 | /* MAX 8998 registers */ | 28 | /* MAX 8998 registers */ |
27 | enum { | 29 | enum { |
28 | MAX8998_REG_IRQ1, | 30 | MAX8998_REG_IRQ1, |
@@ -46,12 +48,12 @@ enum { | |||
46 | MAX8998_REG_ONOFF2, | 48 | MAX8998_REG_ONOFF2, |
47 | MAX8998_REG_ONOFF3, | 49 | MAX8998_REG_ONOFF3, |
48 | MAX8998_REG_ONOFF4, | 50 | MAX8998_REG_ONOFF4, |
49 | MAX8998_REG_BUCK1_DVSARM1, | 51 | MAX8998_REG_BUCK1_VOLTAGE1, |
50 | MAX8998_REG_BUCK1_DVSARM2, | 52 | MAX8998_REG_BUCK1_VOLTAGE2, |
51 | MAX8998_REG_BUCK1_DVSARM3, | 53 | MAX8998_REG_BUCK1_VOLTAGE3, |
52 | MAX8998_REG_BUCK1_DVSARM4, | 54 | MAX8998_REG_BUCK1_VOLTAGE4, |
53 | MAX8998_REG_BUCK2_DVSINT1, | 55 | MAX8998_REG_BUCK2_VOLTAGE1, |
54 | MAX8998_REG_BUCK2_DVSINT2, | 56 | MAX8998_REG_BUCK2_VOLTAGE2, |
55 | MAX8998_REG_BUCK3, | 57 | MAX8998_REG_BUCK3, |
56 | MAX8998_REG_BUCK4, | 58 | MAX8998_REG_BUCK4, |
57 | MAX8998_REG_LDO2_LDO3, | 59 | MAX8998_REG_LDO2_LDO3, |
@@ -72,41 +74,102 @@ enum { | |||
72 | MAX8998_REG_LBCNFG2, | 74 | MAX8998_REG_LBCNFG2, |
73 | }; | 75 | }; |
74 | 76 | ||
77 | /* IRQ definitions */ | ||
78 | enum { | ||
79 | MAX8998_IRQ_DCINF, | ||
80 | MAX8998_IRQ_DCINR, | ||
81 | MAX8998_IRQ_JIGF, | ||
82 | MAX8998_IRQ_JIGR, | ||
83 | MAX8998_IRQ_PWRONF, | ||
84 | MAX8998_IRQ_PWRONR, | ||
85 | |||
86 | MAX8998_IRQ_WTSREVNT, | ||
87 | MAX8998_IRQ_SMPLEVNT, | ||
88 | MAX8998_IRQ_ALARM1, | ||
89 | MAX8998_IRQ_ALARM0, | ||
90 | |||
91 | MAX8998_IRQ_ONKEY1S, | ||
92 | MAX8998_IRQ_TOPOFFR, | ||
93 | MAX8998_IRQ_DCINOVPR, | ||
94 | MAX8998_IRQ_CHGRSTF, | ||
95 | MAX8998_IRQ_DONER, | ||
96 | MAX8998_IRQ_CHGFAULT, | ||
97 | |||
98 | MAX8998_IRQ_LOBAT1, | ||
99 | MAX8998_IRQ_LOBAT2, | ||
100 | |||
101 | MAX8998_IRQ_NR, | ||
102 | }; | ||
103 | |||
104 | /* MAX8998 various variants */ | ||
105 | enum { | ||
106 | TYPE_MAX8998 = 0, /* Default */ | ||
107 | TYPE_LP3974, /* National version of MAX8998 */ | ||
108 | TYPE_LP3979, /* Added AVS */ | ||
109 | }; | ||
110 | |||
111 | #define MAX8998_IRQ_DCINF_MASK (1 << 2) | ||
112 | #define MAX8998_IRQ_DCINR_MASK (1 << 3) | ||
113 | #define MAX8998_IRQ_JIGF_MASK (1 << 4) | ||
114 | #define MAX8998_IRQ_JIGR_MASK (1 << 5) | ||
115 | #define MAX8998_IRQ_PWRONF_MASK (1 << 6) | ||
116 | #define MAX8998_IRQ_PWRONR_MASK (1 << 7) | ||
117 | |||
118 | #define MAX8998_IRQ_WTSREVNT_MASK (1 << 0) | ||
119 | #define MAX8998_IRQ_SMPLEVNT_MASK (1 << 1) | ||
120 | #define MAX8998_IRQ_ALARM1_MASK (1 << 2) | ||
121 | #define MAX8998_IRQ_ALARM0_MASK (1 << 3) | ||
122 | |||
123 | #define MAX8998_IRQ_ONKEY1S_MASK (1 << 0) | ||
124 | #define MAX8998_IRQ_TOPOFFR_MASK (1 << 2) | ||
125 | #define MAX8998_IRQ_DCINOVPR_MASK (1 << 3) | ||
126 | #define MAX8998_IRQ_CHGRSTF_MASK (1 << 4) | ||
127 | #define MAX8998_IRQ_DONER_MASK (1 << 5) | ||
128 | #define MAX8998_IRQ_CHGFAULT_MASK (1 << 7) | ||
129 | |||
130 | #define MAX8998_IRQ_LOBAT1_MASK (1 << 0) | ||
131 | #define MAX8998_IRQ_LOBAT2_MASK (1 << 1) | ||
132 | |||
133 | #define MAX8998_ENRAMP (1 << 4) | ||
134 | |||
75 | /** | 135 | /** |
76 | * struct max8998_dev - max8998 master device for sub-drivers | 136 | * struct max8998_dev - max8998 master device for sub-drivers |
77 | * @dev: master device of the chip (can be used to access platform data) | 137 | * @dev: master device of the chip (can be used to access platform data) |
78 | * @i2c_client: i2c client private data | 138 | * @i2c: i2c client private data for regulator |
79 | * @dev_read(): chip register read function | 139 | * @rtc: i2c client private data for rtc |
80 | * @dev_write(): chip register write function | ||
81 | * @dev_update(): chip register update function | ||
82 | * @iolock: mutex for serializing io access | 140 | * @iolock: mutex for serializing io access |
141 | * @irqlock: mutex for buslock | ||
142 | * @irq_base: base IRQ number for max8998, required for IRQs | ||
143 | * @irq: generic IRQ number for max8998 | ||
144 | * @ono: power onoff IRQ number for max8998 | ||
145 | * @irq_masks_cur: currently active value | ||
146 | * @irq_masks_cache: cached hardware value | ||
147 | * @type: indicate which max8998 "variant" is used | ||
83 | */ | 148 | */ |
84 | |||
85 | struct max8998_dev { | 149 | struct max8998_dev { |
86 | struct device *dev; | 150 | struct device *dev; |
87 | struct i2c_client *i2c_client; | 151 | struct i2c_client *i2c; |
88 | int (*dev_read)(struct max8998_dev *max8998, u8 reg, u8 *dest); | 152 | struct i2c_client *rtc; |
89 | int (*dev_write)(struct max8998_dev *max8998, u8 reg, u8 val); | ||
90 | int (*dev_update)(struct max8998_dev *max8998, u8 reg, u8 val, u8 mask); | ||
91 | struct mutex iolock; | 153 | struct mutex iolock; |
154 | struct mutex irqlock; | ||
155 | |||
156 | int irq_base; | ||
157 | int irq; | ||
158 | int ono; | ||
159 | u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS]; | ||
160 | u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS]; | ||
161 | int type; | ||
92 | }; | 162 | }; |
93 | 163 | ||
94 | static inline int max8998_read_reg(struct max8998_dev *max8998, u8 reg, | 164 | int max8998_irq_init(struct max8998_dev *max8998); |
95 | u8 *value) | 165 | void max8998_irq_exit(struct max8998_dev *max8998); |
96 | { | 166 | |
97 | return max8998->dev_read(max8998, reg, value); | 167 | extern int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest); |
98 | } | 168 | extern int max8998_bulk_read(struct i2c_client *i2c, u8 reg, int count, |
99 | 169 | u8 *buf); | |
100 | static inline int max8998_write_reg(struct max8998_dev *max8998, u8 reg, | 170 | extern int max8998_write_reg(struct i2c_client *i2c, u8 reg, u8 value); |
101 | u8 value) | 171 | extern int max8998_bulk_write(struct i2c_client *i2c, u8 reg, int count, |
102 | { | 172 | u8 *buf); |
103 | return max8998->dev_write(max8998, reg, value); | 173 | extern int max8998_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask); |
104 | } | ||
105 | |||
106 | static inline int max8998_update_reg(struct max8998_dev *max8998, u8 reg, | ||
107 | u8 value, u8 mask) | ||
108 | { | ||
109 | return max8998->dev_update(max8998, reg, value, mask); | ||
110 | } | ||
111 | 174 | ||
112 | #endif /* __LINUX_MFD_MAX8998_PRIV_H */ | 175 | #endif /* __LINUX_MFD_MAX8998_PRIV_H */ |
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h index 1d3601a2d853..f8c9f884aff2 100644 --- a/include/linux/mfd/max8998.h +++ b/include/linux/mfd/max8998.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * max8698.h - Voltage regulator driver for the Maxim 8998 | 2 | * max8998.h - Voltage regulator driver for the Maxim 8998 |
3 | * | 3 | * |
4 | * Copyright (C) 2009-2010 Samsung Electrnoics | 4 | * Copyright (C) 2009-2010 Samsung Electrnoics |
5 | * Kyungmin Park <kyungmin.park@samsung.com> | 5 | * Kyungmin Park <kyungmin.park@samsung.com> |
@@ -66,13 +66,28 @@ struct max8998_regulator_data { | |||
66 | 66 | ||
67 | /** | 67 | /** |
68 | * struct max8998_board - packages regulator init data | 68 | * struct max8998_board - packages regulator init data |
69 | * @num_regulators: number of regultors used | ||
70 | * @regulators: array of defined regulators | 69 | * @regulators: array of defined regulators |
70 | * @num_regulators: number of regultors used | ||
71 | * @irq_base: base IRQ number for max8998, required for IRQs | ||
72 | * @ono: power onoff IRQ number for max8998 | ||
73 | * @buck1_max_voltage1: BUCK1 maximum alowed voltage register 1 | ||
74 | * @buck1_max_voltage2: BUCK1 maximum alowed voltage register 2 | ||
75 | * @buck2_max_voltage: BUCK2 maximum alowed voltage | ||
76 | * @buck1_set1: BUCK1 gpio pin 1 to set output voltage | ||
77 | * @buck1_set2: BUCK1 gpio pin 2 to set output voltage | ||
78 | * @buck2_set3: BUCK2 gpio pin to set output voltage | ||
71 | */ | 79 | */ |
72 | |||
73 | struct max8998_platform_data { | 80 | struct max8998_platform_data { |
74 | int num_regulators; | ||
75 | struct max8998_regulator_data *regulators; | 81 | struct max8998_regulator_data *regulators; |
82 | int num_regulators; | ||
83 | int irq_base; | ||
84 | int ono; | ||
85 | int buck1_max_voltage1; | ||
86 | int buck1_max_voltage2; | ||
87 | int buck2_max_voltage; | ||
88 | int buck1_set1; | ||
89 | int buck1_set2; | ||
90 | int buck2_set3; | ||
76 | }; | 91 | }; |
77 | 92 | ||
78 | #endif /* __LINUX_MFD_MAX8998_H */ | 93 | #endif /* __LINUX_MFD_MAX8998_H */ |
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h index 0fa44fb8dd26..b4c741e352c2 100644 --- a/include/linux/mfd/mc13783.h +++ b/include/linux/mfd/mc13783.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2009 Pengutronix | 2 | * Copyright 2009-2010 Pengutronix |
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | 3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it under | 5 | * This program is free software; you can redistribute it and/or modify it under |
@@ -9,48 +9,83 @@ | |||
9 | #ifndef __LINUX_MFD_MC13783_H | 9 | #ifndef __LINUX_MFD_MC13783_H |
10 | #define __LINUX_MFD_MC13783_H | 10 | #define __LINUX_MFD_MC13783_H |
11 | 11 | ||
12 | #include <linux/interrupt.h> | 12 | #include <linux/mfd/mc13xxx.h> |
13 | 13 | ||
14 | struct mc13783; | 14 | struct mc13783; |
15 | 15 | ||
16 | void mc13783_lock(struct mc13783 *mc13783); | 16 | struct mc13xxx *mc13783_to_mc13xxx(struct mc13783 *mc13783); |
17 | void mc13783_unlock(struct mc13783 *mc13783); | ||
18 | 17 | ||
19 | int mc13783_reg_read(struct mc13783 *mc13783, unsigned int offset, u32 *val); | 18 | static inline void mc13783_lock(struct mc13783 *mc13783) |
20 | int mc13783_reg_write(struct mc13783 *mc13783, unsigned int offset, u32 val); | 19 | { |
21 | int mc13783_reg_rmw(struct mc13783 *mc13783, unsigned int offset, | 20 | mc13xxx_lock(mc13783_to_mc13xxx(mc13783)); |
22 | u32 mask, u32 val); | 21 | } |
22 | |||
23 | static inline void mc13783_unlock(struct mc13783 *mc13783) | ||
24 | { | ||
25 | mc13xxx_unlock(mc13783_to_mc13xxx(mc13783)); | ||
26 | } | ||
27 | |||
28 | static inline int mc13783_reg_read(struct mc13783 *mc13783, | ||
29 | unsigned int offset, u32 *val) | ||
30 | { | ||
31 | return mc13xxx_reg_read(mc13783_to_mc13xxx(mc13783), offset, val); | ||
32 | } | ||
33 | |||
34 | static inline int mc13783_reg_write(struct mc13783 *mc13783, | ||
35 | unsigned int offset, u32 val) | ||
36 | { | ||
37 | return mc13xxx_reg_write(mc13783_to_mc13xxx(mc13783), offset, val); | ||
38 | } | ||
39 | |||
40 | static inline int mc13783_reg_rmw(struct mc13783 *mc13783, | ||
41 | unsigned int offset, u32 mask, u32 val) | ||
42 | { | ||
43 | return mc13xxx_reg_rmw(mc13783_to_mc13xxx(mc13783), offset, mask, val); | ||
44 | } | ||
23 | 45 | ||
24 | int mc13783_get_flags(struct mc13783 *mc13783); | 46 | static inline int mc13783_get_flags(struct mc13783 *mc13783) |
47 | { | ||
48 | return mc13xxx_get_flags(mc13783_to_mc13xxx(mc13783)); | ||
49 | } | ||
25 | 50 | ||
26 | int mc13783_irq_request(struct mc13783 *mc13783, int irq, | 51 | static inline int mc13783_irq_request(struct mc13783 *mc13783, int irq, |
27 | irq_handler_t handler, const char *name, void *dev); | 52 | irq_handler_t handler, const char *name, void *dev) |
28 | int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq, | 53 | { |
29 | irq_handler_t handler, const char *name, void *dev); | 54 | return mc13xxx_irq_request(mc13783_to_mc13xxx(mc13783), irq, |
30 | int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev); | 55 | handler, name, dev); |
56 | } | ||
31 | 57 | ||
32 | int mc13783_irq_mask(struct mc13783 *mc13783, int irq); | 58 | static inline int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq, |
33 | int mc13783_irq_unmask(struct mc13783 *mc13783, int irq); | 59 | irq_handler_t handler, const char *name, void *dev) |
34 | int mc13783_irq_status(struct mc13783 *mc13783, int irq, | 60 | { |
35 | int *enabled, int *pending); | 61 | return mc13xxx_irq_request_nounmask(mc13783_to_mc13xxx(mc13783), irq, |
36 | int mc13783_irq_ack(struct mc13783 *mc13783, int irq); | 62 | handler, name, dev); |
63 | } | ||
37 | 64 | ||
38 | static inline int mc13783_mask(struct mc13783 *mc13783, int irq) __deprecated; | 65 | static inline int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev) |
39 | static inline int mc13783_mask(struct mc13783 *mc13783, int irq) | ||
40 | { | 66 | { |
41 | return mc13783_irq_mask(mc13783, irq); | 67 | return mc13xxx_irq_free(mc13783_to_mc13xxx(mc13783), irq, dev); |
42 | } | 68 | } |
43 | 69 | ||
44 | static inline int mc13783_unmask(struct mc13783 *mc13783, int irq) __deprecated; | 70 | static inline int mc13783_irq_mask(struct mc13783 *mc13783, int irq) |
45 | static inline int mc13783_unmask(struct mc13783 *mc13783, int irq) | ||
46 | { | 71 | { |
47 | return mc13783_irq_unmask(mc13783, irq); | 72 | return mc13xxx_irq_mask(mc13783_to_mc13xxx(mc13783), irq); |
48 | } | 73 | } |
49 | 74 | ||
50 | static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq) __deprecated; | 75 | static inline int mc13783_irq_unmask(struct mc13783 *mc13783, int irq) |
51 | static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq) | ||
52 | { | 76 | { |
53 | return mc13783_irq_ack(mc13783, irq); | 77 | return mc13xxx_irq_unmask(mc13783_to_mc13xxx(mc13783), irq); |
78 | } | ||
79 | static inline int mc13783_irq_status(struct mc13783 *mc13783, int irq, | ||
80 | int *enabled, int *pending) | ||
81 | { | ||
82 | return mc13xxx_irq_status(mc13783_to_mc13xxx(mc13783), | ||
83 | irq, enabled, pending); | ||
84 | } | ||
85 | |||
86 | static inline int mc13783_irq_ack(struct mc13783 *mc13783, int irq) | ||
87 | { | ||
88 | return mc13xxx_irq_ack(mc13783_to_mc13xxx(mc13783), irq); | ||
54 | } | 89 | } |
55 | 90 | ||
56 | #define MC13783_ADC0 43 | 91 | #define MC13783_ADC0 43 |
@@ -66,96 +101,18 @@ static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq) | |||
66 | MC13783_ADC0_TSMOD1 | \ | 101 | MC13783_ADC0_TSMOD1 | \ |
67 | MC13783_ADC0_TSMOD2) | 102 | MC13783_ADC0_TSMOD2) |
68 | 103 | ||
69 | struct mc13783_led_platform_data { | 104 | #define mc13783_regulator_init_data mc13xxx_regulator_init_data |
70 | #define MC13783_LED_MD 0 | 105 | #define mc13783_regulator_platform_data mc13xxx_regulator_platform_data |
71 | #define MC13783_LED_AD 1 | 106 | #define mc13783_led_platform_data mc13xxx_led_platform_data |
72 | #define MC13783_LED_KP 2 | 107 | #define mc13783_leds_platform_data mc13xxx_leds_platform_data |
73 | #define MC13783_LED_R1 3 | 108 | |
74 | #define MC13783_LED_G1 4 | 109 | #define mc13783_platform_data mc13xxx_platform_data |
75 | #define MC13783_LED_B1 5 | 110 | #define MC13783_USE_TOUCHSCREEN MC13XXX_USE_TOUCHSCREEN |
76 | #define MC13783_LED_R2 6 | 111 | #define MC13783_USE_CODEC MC13XXX_USE_CODEC |
77 | #define MC13783_LED_G2 7 | 112 | #define MC13783_USE_ADC MC13XXX_USE_ADC |
78 | #define MC13783_LED_B2 8 | 113 | #define MC13783_USE_RTC MC13XXX_USE_RTC |
79 | #define MC13783_LED_R3 9 | 114 | #define MC13783_USE_REGULATOR MC13XXX_USE_REGULATOR |
80 | #define MC13783_LED_G3 10 | 115 | #define MC13783_USE_LED MC13XXX_USE_LED |
81 | #define MC13783_LED_B3 11 | ||
82 | #define MC13783_LED_MAX MC13783_LED_B3 | ||
83 | int id; | ||
84 | const char *name; | ||
85 | const char *default_trigger; | ||
86 | |||
87 | /* Three or two bits current selection depending on the led */ | ||
88 | char max_current; | ||
89 | }; | ||
90 | |||
91 | struct mc13783_leds_platform_data { | ||
92 | int num_leds; | ||
93 | struct mc13783_led_platform_data *led; | ||
94 | |||
95 | #define MC13783_LED_TRIODE_MD (1 << 0) | ||
96 | #define MC13783_LED_TRIODE_AD (1 << 1) | ||
97 | #define MC13783_LED_TRIODE_KP (1 << 2) | ||
98 | #define MC13783_LED_BOOST_EN (1 << 3) | ||
99 | #define MC13783_LED_TC1HALF (1 << 4) | ||
100 | #define MC13783_LED_SLEWLIMTC (1 << 5) | ||
101 | #define MC13783_LED_SLEWLIMBL (1 << 6) | ||
102 | #define MC13783_LED_TRIODE_TC1 (1 << 7) | ||
103 | #define MC13783_LED_TRIODE_TC2 (1 << 8) | ||
104 | #define MC13783_LED_TRIODE_TC3 (1 << 9) | ||
105 | int flags; | ||
106 | |||
107 | #define MC13783_LED_AB_DISABLED 0 | ||
108 | #define MC13783_LED_AB_MD1 1 | ||
109 | #define MC13783_LED_AB_MD12 2 | ||
110 | #define MC13783_LED_AB_MD123 3 | ||
111 | #define MC13783_LED_AB_MD1234 4 | ||
112 | #define MC13783_LED_AB_MD1234_AD1 5 | ||
113 | #define MC13783_LED_AB_MD1234_AD12 6 | ||
114 | #define MC13783_LED_AB_MD1_AD 7 | ||
115 | char abmode; | ||
116 | |||
117 | #define MC13783_LED_ABREF_200MV 0 | ||
118 | #define MC13783_LED_ABREF_400MV 1 | ||
119 | #define MC13783_LED_ABREF_600MV 2 | ||
120 | #define MC13783_LED_ABREF_800MV 3 | ||
121 | char abref; | ||
122 | |||
123 | #define MC13783_LED_PERIOD_10MS 0 | ||
124 | #define MC13783_LED_PERIOD_100MS 1 | ||
125 | #define MC13783_LED_PERIOD_500MS 2 | ||
126 | #define MC13783_LED_PERIOD_2S 3 | ||
127 | char bl_period; | ||
128 | char tc1_period; | ||
129 | char tc2_period; | ||
130 | char tc3_period; | ||
131 | }; | ||
132 | |||
133 | /* to be cleaned up */ | ||
134 | struct regulator_init_data; | ||
135 | |||
136 | struct mc13783_regulator_init_data { | ||
137 | int id; | ||
138 | struct regulator_init_data *init_data; | ||
139 | }; | ||
140 | |||
141 | struct mc13783_regulator_platform_data { | ||
142 | int num_regulators; | ||
143 | struct mc13783_regulator_init_data *regulators; | ||
144 | }; | ||
145 | |||
146 | struct mc13783_platform_data { | ||
147 | int num_regulators; | ||
148 | struct mc13783_regulator_init_data *regulators; | ||
149 | struct mc13783_leds_platform_data *leds; | ||
150 | |||
151 | #define MC13783_USE_TOUCHSCREEN (1 << 0) | ||
152 | #define MC13783_USE_CODEC (1 << 1) | ||
153 | #define MC13783_USE_ADC (1 << 2) | ||
154 | #define MC13783_USE_RTC (1 << 3) | ||
155 | #define MC13783_USE_REGULATOR (1 << 4) | ||
156 | #define MC13783_USE_LED (1 << 5) | ||
157 | unsigned int flags; | ||
158 | }; | ||
159 | 116 | ||
160 | #define MC13783_ADC_MODE_TS 1 | 117 | #define MC13783_ADC_MODE_TS 1 |
161 | #define MC13783_ADC_MODE_SINGLE_CHAN 2 | 118 | #define MC13783_ADC_MODE_SINGLE_CHAN 2 |
@@ -199,46 +156,46 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, | |||
199 | #define MC13783_REGU_PWGT1SPI 31 | 156 | #define MC13783_REGU_PWGT1SPI 31 |
200 | #define MC13783_REGU_PWGT2SPI 32 | 157 | #define MC13783_REGU_PWGT2SPI 32 |
201 | 158 | ||
202 | #define MC13783_IRQ_ADCDONE 0 | 159 | #define MC13783_IRQ_ADCDONE MC13XXX_IRQ_ADCDONE |
203 | #define MC13783_IRQ_ADCBISDONE 1 | 160 | #define MC13783_IRQ_ADCBISDONE MC13XXX_IRQ_ADCBISDONE |
204 | #define MC13783_IRQ_TS 2 | 161 | #define MC13783_IRQ_TS MC13XXX_IRQ_TS |
205 | #define MC13783_IRQ_WHIGH 3 | 162 | #define MC13783_IRQ_WHIGH 3 |
206 | #define MC13783_IRQ_WLOW 4 | 163 | #define MC13783_IRQ_WLOW 4 |
207 | #define MC13783_IRQ_CHGDET 6 | 164 | #define MC13783_IRQ_CHGDET MC13XXX_IRQ_CHGDET |
208 | #define MC13783_IRQ_CHGOV 7 | 165 | #define MC13783_IRQ_CHGOV 7 |
209 | #define MC13783_IRQ_CHGREV 8 | 166 | #define MC13783_IRQ_CHGREV MC13XXX_IRQ_CHGREV |
210 | #define MC13783_IRQ_CHGSHORT 9 | 167 | #define MC13783_IRQ_CHGSHORT MC13XXX_IRQ_CHGSHORT |
211 | #define MC13783_IRQ_CCCV 10 | 168 | #define MC13783_IRQ_CCCV MC13XXX_IRQ_CCCV |
212 | #define MC13783_IRQ_CHGCURR 11 | 169 | #define MC13783_IRQ_CHGCURR MC13XXX_IRQ_CHGCURR |
213 | #define MC13783_IRQ_BPON 12 | 170 | #define MC13783_IRQ_BPON MC13XXX_IRQ_BPON |
214 | #define MC13783_IRQ_LOBATL 13 | 171 | #define MC13783_IRQ_LOBATL MC13XXX_IRQ_LOBATL |
215 | #define MC13783_IRQ_LOBATH 14 | 172 | #define MC13783_IRQ_LOBATH MC13XXX_IRQ_LOBATH |
216 | #define MC13783_IRQ_UDP 15 | 173 | #define MC13783_IRQ_UDP 15 |
217 | #define MC13783_IRQ_USB 16 | 174 | #define MC13783_IRQ_USB 16 |
218 | #define MC13783_IRQ_ID 19 | 175 | #define MC13783_IRQ_ID 19 |
219 | #define MC13783_IRQ_SE1 21 | 176 | #define MC13783_IRQ_SE1 21 |
220 | #define MC13783_IRQ_CKDET 22 | 177 | #define MC13783_IRQ_CKDET 22 |
221 | #define MC13783_IRQ_UDM 23 | 178 | #define MC13783_IRQ_UDM 23 |
222 | #define MC13783_IRQ_1HZ 24 | 179 | #define MC13783_IRQ_1HZ MC13XXX_IRQ_1HZ |
223 | #define MC13783_IRQ_TODA 25 | 180 | #define MC13783_IRQ_TODA MC13XXX_IRQ_TODA |
224 | #define MC13783_IRQ_ONOFD1 27 | 181 | #define MC13783_IRQ_ONOFD1 27 |
225 | #define MC13783_IRQ_ONOFD2 28 | 182 | #define MC13783_IRQ_ONOFD2 28 |
226 | #define MC13783_IRQ_ONOFD3 29 | 183 | #define MC13783_IRQ_ONOFD3 29 |
227 | #define MC13783_IRQ_SYSRST 30 | 184 | #define MC13783_IRQ_SYSRST MC13XXX_IRQ_SYSRST |
228 | #define MC13783_IRQ_RTCRST 31 | 185 | #define MC13783_IRQ_RTCRST MC13XXX_IRQ_RTCRST |
229 | #define MC13783_IRQ_PC 32 | 186 | #define MC13783_IRQ_PC MC13XXX_IRQ_PC |
230 | #define MC13783_IRQ_WARM 33 | 187 | #define MC13783_IRQ_WARM MC13XXX_IRQ_WARM |
231 | #define MC13783_IRQ_MEMHLD 34 | 188 | #define MC13783_IRQ_MEMHLD MC13XXX_IRQ_MEMHLD |
232 | #define MC13783_IRQ_PWRRDY 35 | 189 | #define MC13783_IRQ_PWRRDY 35 |
233 | #define MC13783_IRQ_THWARNL 36 | 190 | #define MC13783_IRQ_THWARNL MC13XXX_IRQ_THWARNL |
234 | #define MC13783_IRQ_THWARNH 37 | 191 | #define MC13783_IRQ_THWARNH MC13XXX_IRQ_THWARNH |
235 | #define MC13783_IRQ_CLK 38 | 192 | #define MC13783_IRQ_CLK MC13XXX_IRQ_CLK |
236 | #define MC13783_IRQ_SEMAF 39 | 193 | #define MC13783_IRQ_SEMAF 39 |
237 | #define MC13783_IRQ_MC2B 41 | 194 | #define MC13783_IRQ_MC2B 41 |
238 | #define MC13783_IRQ_HSDET 42 | 195 | #define MC13783_IRQ_HSDET 42 |
239 | #define MC13783_IRQ_HSL 43 | 196 | #define MC13783_IRQ_HSL 43 |
240 | #define MC13783_IRQ_ALSPTH 44 | 197 | #define MC13783_IRQ_ALSPTH 44 |
241 | #define MC13783_IRQ_AHSSHORT 45 | 198 | #define MC13783_IRQ_AHSSHORT 45 |
242 | #define MC13783_NUM_IRQ 46 | 199 | #define MC13783_NUM_IRQ MC13XXX_NUM_IRQ |
243 | 200 | ||
244 | #endif /* __LINUX_MFD_MC13783_H */ | 201 | #endif /* ifndef __LINUX_MFD_MC13783_H */ |
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h new file mode 100644 index 000000000000..a1d391b40e68 --- /dev/null +++ b/include/linux/mfd/mc13xxx.h | |||
@@ -0,0 +1,154 @@ | |||
1 | /* | ||
2 | * Copyright 2009-2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #ifndef __LINUX_MFD_MC13XXX_H | ||
10 | #define __LINUX_MFD_MC13XXX_H | ||
11 | |||
12 | #include <linux/interrupt.h> | ||
13 | |||
14 | struct mc13xxx; | ||
15 | |||
16 | void mc13xxx_lock(struct mc13xxx *mc13xxx); | ||
17 | void mc13xxx_unlock(struct mc13xxx *mc13xxx); | ||
18 | |||
19 | int mc13xxx_reg_read(struct mc13xxx *mc13xxx, unsigned int offset, u32 *val); | ||
20 | int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val); | ||
21 | int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset, | ||
22 | u32 mask, u32 val); | ||
23 | |||
24 | int mc13xxx_get_flags(struct mc13xxx *mc13xxx); | ||
25 | |||
26 | int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq, | ||
27 | irq_handler_t handler, const char *name, void *dev); | ||
28 | int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq, | ||
29 | irq_handler_t handler, const char *name, void *dev); | ||
30 | int mc13xxx_irq_free(struct mc13xxx *mc13xxx, int irq, void *dev); | ||
31 | |||
32 | int mc13xxx_irq_mask(struct mc13xxx *mc13xxx, int irq); | ||
33 | int mc13xxx_irq_unmask(struct mc13xxx *mc13xxx, int irq); | ||
34 | int mc13xxx_irq_status(struct mc13xxx *mc13xxx, int irq, | ||
35 | int *enabled, int *pending); | ||
36 | int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq); | ||
37 | |||
38 | int mc13xxx_get_flags(struct mc13xxx *mc13xxx); | ||
39 | |||
40 | #define MC13XXX_IRQ_ADCDONE 0 | ||
41 | #define MC13XXX_IRQ_ADCBISDONE 1 | ||
42 | #define MC13XXX_IRQ_TS 2 | ||
43 | #define MC13XXX_IRQ_CHGDET 6 | ||
44 | #define MC13XXX_IRQ_CHGREV 8 | ||
45 | #define MC13XXX_IRQ_CHGSHORT 9 | ||
46 | #define MC13XXX_IRQ_CCCV 10 | ||
47 | #define MC13XXX_IRQ_CHGCURR 11 | ||
48 | #define MC13XXX_IRQ_BPON 12 | ||
49 | #define MC13XXX_IRQ_LOBATL 13 | ||
50 | #define MC13XXX_IRQ_LOBATH 14 | ||
51 | #define MC13XXX_IRQ_1HZ 24 | ||
52 | #define MC13XXX_IRQ_TODA 25 | ||
53 | #define MC13XXX_IRQ_SYSRST 30 | ||
54 | #define MC13XXX_IRQ_RTCRST 31 | ||
55 | #define MC13XXX_IRQ_PC 32 | ||
56 | #define MC13XXX_IRQ_WARM 33 | ||
57 | #define MC13XXX_IRQ_MEMHLD 34 | ||
58 | #define MC13XXX_IRQ_THWARNL 36 | ||
59 | #define MC13XXX_IRQ_THWARNH 37 | ||
60 | #define MC13XXX_IRQ_CLK 38 | ||
61 | |||
62 | #define MC13XXX_NUM_IRQ 46 | ||
63 | |||
64 | struct regulator_init_data; | ||
65 | |||
66 | struct mc13xxx_regulator_init_data { | ||
67 | int id; | ||
68 | struct regulator_init_data *init_data; | ||
69 | }; | ||
70 | |||
71 | struct mc13xxx_regulator_platform_data { | ||
72 | int num_regulators; | ||
73 | struct mc13xxx_regulator_init_data *regulators; | ||
74 | }; | ||
75 | |||
76 | struct mc13xxx_led_platform_data { | ||
77 | #define MC13783_LED_MD 0 | ||
78 | #define MC13783_LED_AD 1 | ||
79 | #define MC13783_LED_KP 2 | ||
80 | #define MC13783_LED_R1 3 | ||
81 | #define MC13783_LED_G1 4 | ||
82 | #define MC13783_LED_B1 5 | ||
83 | #define MC13783_LED_R2 6 | ||
84 | #define MC13783_LED_G2 7 | ||
85 | #define MC13783_LED_B2 8 | ||
86 | #define MC13783_LED_R3 9 | ||
87 | #define MC13783_LED_G3 10 | ||
88 | #define MC13783_LED_B3 11 | ||
89 | #define MC13783_LED_MAX MC13783_LED_B3 | ||
90 | int id; | ||
91 | const char *name; | ||
92 | const char *default_trigger; | ||
93 | |||
94 | /* Three or two bits current selection depending on the led */ | ||
95 | char max_current; | ||
96 | }; | ||
97 | |||
98 | struct mc13xxx_leds_platform_data { | ||
99 | int num_leds; | ||
100 | struct mc13xxx_led_platform_data *led; | ||
101 | |||
102 | #define MC13783_LED_TRIODE_MD (1 << 0) | ||
103 | #define MC13783_LED_TRIODE_AD (1 << 1) | ||
104 | #define MC13783_LED_TRIODE_KP (1 << 2) | ||
105 | #define MC13783_LED_BOOST_EN (1 << 3) | ||
106 | #define MC13783_LED_TC1HALF (1 << 4) | ||
107 | #define MC13783_LED_SLEWLIMTC (1 << 5) | ||
108 | #define MC13783_LED_SLEWLIMBL (1 << 6) | ||
109 | #define MC13783_LED_TRIODE_TC1 (1 << 7) | ||
110 | #define MC13783_LED_TRIODE_TC2 (1 << 8) | ||
111 | #define MC13783_LED_TRIODE_TC3 (1 << 9) | ||
112 | int flags; | ||
113 | |||
114 | #define MC13783_LED_AB_DISABLED 0 | ||
115 | #define MC13783_LED_AB_MD1 1 | ||
116 | #define MC13783_LED_AB_MD12 2 | ||
117 | #define MC13783_LED_AB_MD123 3 | ||
118 | #define MC13783_LED_AB_MD1234 4 | ||
119 | #define MC13783_LED_AB_MD1234_AD1 5 | ||
120 | #define MC13783_LED_AB_MD1234_AD12 6 | ||
121 | #define MC13783_LED_AB_MD1_AD 7 | ||
122 | char abmode; | ||
123 | |||
124 | #define MC13783_LED_ABREF_200MV 0 | ||
125 | #define MC13783_LED_ABREF_400MV 1 | ||
126 | #define MC13783_LED_ABREF_600MV 2 | ||
127 | #define MC13783_LED_ABREF_800MV 3 | ||
128 | char abref; | ||
129 | |||
130 | #define MC13783_LED_PERIOD_10MS 0 | ||
131 | #define MC13783_LED_PERIOD_100MS 1 | ||
132 | #define MC13783_LED_PERIOD_500MS 2 | ||
133 | #define MC13783_LED_PERIOD_2S 3 | ||
134 | char bl_period; | ||
135 | char tc1_period; | ||
136 | char tc2_period; | ||
137 | char tc3_period; | ||
138 | }; | ||
139 | |||
140 | struct mc13xxx_platform_data { | ||
141 | #define MC13XXX_USE_TOUCHSCREEN (1 << 0) | ||
142 | #define MC13XXX_USE_CODEC (1 << 1) | ||
143 | #define MC13XXX_USE_ADC (1 << 2) | ||
144 | #define MC13XXX_USE_RTC (1 << 3) | ||
145 | #define MC13XXX_USE_REGULATOR (1 << 4) | ||
146 | #define MC13XXX_USE_LED (1 << 5) | ||
147 | unsigned int flags; | ||
148 | |||
149 | int num_regulators; | ||
150 | struct mc13xxx_regulator_init_data *regulators; | ||
151 | struct mc13xxx_leds_platform_data *leds; | ||
152 | }; | ||
153 | |||
154 | #endif /* ifndef __LINUX_MFD_MC13XXX_H */ | ||
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h index ad411a78870c..50d4a047118d 100644 --- a/include/linux/mfd/pcf50633/core.h +++ b/include/linux/mfd/pcf50633/core.h | |||
@@ -227,4 +227,11 @@ static inline struct pcf50633 *dev_to_pcf50633(struct device *dev) | |||
227 | return dev_get_drvdata(dev); | 227 | return dev_get_drvdata(dev); |
228 | } | 228 | } |
229 | 229 | ||
230 | int pcf50633_irq_init(struct pcf50633 *pcf, int irq); | ||
231 | void pcf50633_irq_free(struct pcf50633 *pcf); | ||
232 | #ifdef CONFIG_PM | ||
233 | int pcf50633_irq_suspend(struct pcf50633 *pcf); | ||
234 | int pcf50633_irq_resume(struct pcf50633 *pcf); | ||
235 | #endif | ||
236 | |||
230 | #endif | 237 | #endif |
diff --git a/include/linux/mfd/sh_mobile_sdhi.h b/include/linux/mfd/sh_mobile_sdhi.h index 49067802a6d7..c981b959760f 100644 --- a/include/linux/mfd/sh_mobile_sdhi.h +++ b/include/linux/mfd/sh_mobile_sdhi.h | |||
@@ -7,8 +7,10 @@ struct sh_mobile_sdhi_info { | |||
7 | int dma_slave_tx; | 7 | int dma_slave_tx; |
8 | int dma_slave_rx; | 8 | int dma_slave_rx; |
9 | unsigned long tmio_flags; | 9 | unsigned long tmio_flags; |
10 | unsigned long tmio_caps; | ||
10 | u32 tmio_ocr_mask; /* available MMC voltages */ | 11 | u32 tmio_ocr_mask; /* available MMC voltages */ |
11 | void (*set_pwr)(struct platform_device *pdev, int state); | 12 | void (*set_pwr)(struct platform_device *pdev, int state); |
13 | int (*get_cd)(struct platform_device *pdev); | ||
12 | }; | 14 | }; |
13 | 15 | ||
14 | #endif /* __SH_MOBILE_SDHI_H__ */ | 16 | #endif /* __SH_MOBILE_SDHI_H__ */ |
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h index 39ca7588659b..e762c270d8d4 100644 --- a/include/linux/mfd/stmpe.h +++ b/include/linux/mfd/stmpe.h | |||
@@ -112,13 +112,19 @@ struct stmpe_keypad_platform_data { | |||
112 | bool no_autorepeat; | 112 | bool no_autorepeat; |
113 | }; | 113 | }; |
114 | 114 | ||
115 | #define STMPE_GPIO_NOREQ_811_TOUCH (0xf0) | ||
116 | |||
115 | /** | 117 | /** |
116 | * struct stmpe_gpio_platform_data - STMPE GPIO platform data | 118 | * struct stmpe_gpio_platform_data - STMPE GPIO platform data |
117 | * @gpio_base: first gpio number assigned. A maximum of | 119 | * @gpio_base: first gpio number assigned. A maximum of |
118 | * %STMPE_NR_GPIOS GPIOs will be allocated. | 120 | * %STMPE_NR_GPIOS GPIOs will be allocated. |
121 | * @norequest_mask: bitmask specifying which GPIOs should _not_ be | ||
122 | * requestable due to different usage (e.g. touch, keypad) | ||
123 | * STMPE_GPIO_NOREQ_* macros can be used here. | ||
119 | */ | 124 | */ |
120 | struct stmpe_gpio_platform_data { | 125 | struct stmpe_gpio_platform_data { |
121 | int gpio_base; | 126 | int gpio_base; |
127 | unsigned norequest_mask; | ||
122 | void (*setup)(struct stmpe *stmpe, unsigned gpio_base); | 128 | void (*setup)(struct stmpe *stmpe, unsigned gpio_base); |
123 | void (*remove)(struct stmpe *stmpe, unsigned gpio_base); | 129 | void (*remove)(struct stmpe *stmpe, unsigned gpio_base); |
124 | }; | 130 | }; |
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index f07425bc3dcd..085f041197dc 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
@@ -52,6 +52,11 @@ | |||
52 | 52 | ||
53 | /* tmio MMC platform flags */ | 53 | /* tmio MMC platform flags */ |
54 | #define TMIO_MMC_WRPROTECT_DISABLE (1 << 0) | 54 | #define TMIO_MMC_WRPROTECT_DISABLE (1 << 0) |
55 | /* | ||
56 | * Some controllers can support a 2-byte block size when the bus width | ||
57 | * is configured in 4-bit mode. | ||
58 | */ | ||
59 | #define TMIO_MMC_BLKSZ_2BYTES (1 << 1) | ||
55 | 60 | ||
56 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); | 61 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); |
57 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); | 62 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); |
@@ -74,6 +79,7 @@ struct tmio_mmc_data { | |||
74 | struct tmio_mmc_dma *dma; | 79 | struct tmio_mmc_dma *dma; |
75 | void (*set_pwr)(struct platform_device *host, int state); | 80 | void (*set_pwr)(struct platform_device *host, int state); |
76 | void (*set_clk_div)(struct platform_device *host, int state); | 81 | void (*set_clk_div)(struct platform_device *host, int state); |
82 | int (*get_cd)(struct platform_device *host); | ||
77 | }; | 83 | }; |
78 | 84 | ||
79 | /* | 85 | /* |
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h index 772b3ae640af..b6bab1b04e25 100644 --- a/include/linux/mfd/tps6586x.h +++ b/include/linux/mfd/tps6586x.h | |||
@@ -18,6 +18,36 @@ enum { | |||
18 | TPS6586X_ID_LDO_RTC, | 18 | TPS6586X_ID_LDO_RTC, |
19 | }; | 19 | }; |
20 | 20 | ||
21 | enum { | ||
22 | TPS6586X_INT_PLDO_0, | ||
23 | TPS6586X_INT_PLDO_1, | ||
24 | TPS6586X_INT_PLDO_2, | ||
25 | TPS6586X_INT_PLDO_3, | ||
26 | TPS6586X_INT_PLDO_4, | ||
27 | TPS6586X_INT_PLDO_5, | ||
28 | TPS6586X_INT_PLDO_6, | ||
29 | TPS6586X_INT_PLDO_7, | ||
30 | TPS6586X_INT_COMP_DET, | ||
31 | TPS6586X_INT_ADC, | ||
32 | TPS6586X_INT_PLDO_8, | ||
33 | TPS6586X_INT_PLDO_9, | ||
34 | TPS6586X_INT_PSM_0, | ||
35 | TPS6586X_INT_PSM_1, | ||
36 | TPS6586X_INT_PSM_2, | ||
37 | TPS6586X_INT_PSM_3, | ||
38 | TPS6586X_INT_RTC_ALM1, | ||
39 | TPS6586X_INT_ACUSB_OVP, | ||
40 | TPS6586X_INT_USB_DET, | ||
41 | TPS6586X_INT_AC_DET, | ||
42 | TPS6586X_INT_BAT_DET, | ||
43 | TPS6586X_INT_CHG_STAT, | ||
44 | TPS6586X_INT_CHG_TEMP, | ||
45 | TPS6586X_INT_PP, | ||
46 | TPS6586X_INT_RESUME, | ||
47 | TPS6586X_INT_LOW_SYS, | ||
48 | TPS6586X_INT_RTC_ALM2, | ||
49 | }; | ||
50 | |||
21 | struct tps6586x_subdev_info { | 51 | struct tps6586x_subdev_info { |
22 | int id; | 52 | int id; |
23 | const char *name; | 53 | const char *name; |
@@ -29,6 +59,7 @@ struct tps6586x_platform_data { | |||
29 | struct tps6586x_subdev_info *subdevs; | 59 | struct tps6586x_subdev_info *subdevs; |
30 | 60 | ||
31 | int gpio_base; | 61 | int gpio_base; |
62 | int irq_base; | ||
32 | }; | 63 | }; |
33 | 64 | ||
34 | /* | 65 | /* |
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h index eb5bd4e0e03c..a1239c48b41a 100644 --- a/include/linux/mfd/wm831x/core.h +++ b/include/linux/mfd/wm831x/core.h | |||
@@ -238,6 +238,15 @@ struct regulator_dev; | |||
238 | 238 | ||
239 | #define WM831X_NUM_IRQ_REGS 5 | 239 | #define WM831X_NUM_IRQ_REGS 5 |
240 | 240 | ||
241 | enum wm831x_parent { | ||
242 | WM8310 = 0x8310, | ||
243 | WM8311 = 0x8311, | ||
244 | WM8312 = 0x8312, | ||
245 | WM8320 = 0x8320, | ||
246 | WM8321 = 0x8321, | ||
247 | WM8325 = 0x8325, | ||
248 | }; | ||
249 | |||
241 | struct wm831x { | 250 | struct wm831x { |
242 | struct mutex io_lock; | 251 | struct mutex io_lock; |
243 | 252 | ||
@@ -285,6 +294,9 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg, | |||
285 | int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg, | 294 | int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg, |
286 | int count, u16 *buf); | 295 | int count, u16 *buf); |
287 | 296 | ||
297 | int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq); | ||
298 | void wm831x_device_exit(struct wm831x *wm831x); | ||
299 | int wm831x_device_suspend(struct wm831x *wm831x); | ||
288 | int wm831x_irq_init(struct wm831x *wm831x, int irq); | 300 | int wm831x_irq_init(struct wm831x *wm831x, int irq); |
289 | void wm831x_irq_exit(struct wm831x *wm831x); | 301 | void wm831x_irq_exit(struct wm831x *wm831x); |
290 | 302 | ||
diff --git a/include/linux/mfd/wm8350/audio.h b/include/linux/mfd/wm8350/audio.h index a95141eafce3..bd581c6fa085 100644 --- a/include/linux/mfd/wm8350/audio.h +++ b/include/linux/mfd/wm8350/audio.h | |||
@@ -522,9 +522,6 @@ | |||
522 | #define WM8350_MCLK_SEL_PLL_32K 3 | 522 | #define WM8350_MCLK_SEL_PLL_32K 3 |
523 | #define WM8350_MCLK_SEL_MCLK 5 | 523 | #define WM8350_MCLK_SEL_MCLK 5 |
524 | 524 | ||
525 | #define WM8350_MCLK_DIR_OUT 0 | ||
526 | #define WM8350_MCLK_DIR_IN 1 | ||
527 | |||
528 | /* clock divider id's */ | 525 | /* clock divider id's */ |
529 | #define WM8350_ADC_CLKDIV 0 | 526 | #define WM8350_ADC_CLKDIV 0 |
530 | #define WM8350_DAC_CLKDIV 1 | 527 | #define WM8350_DAC_CLKDIV 1 |
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index 5c51f367c061..add8a1b8bcf0 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h | |||
@@ -29,7 +29,7 @@ struct wm8994_ldo_pdata { | |||
29 | #define WM8994_CONFIGURE_GPIO 0x8000 | 29 | #define WM8994_CONFIGURE_GPIO 0x8000 |
30 | 30 | ||
31 | #define WM8994_DRC_REGS 5 | 31 | #define WM8994_DRC_REGS 5 |
32 | #define WM8994_EQ_REGS 19 | 32 | #define WM8994_EQ_REGS 20 |
33 | 33 | ||
34 | /** | 34 | /** |
35 | * DRC configurations are specified with a label and a set of register | 35 | * DRC configurations are specified with a label and a set of register |
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h index 78a1b9671752..9a18667c13cc 100644 --- a/include/linux/mlx4/cmd.h +++ b/include/linux/mlx4/cmd.h | |||
@@ -58,6 +58,7 @@ enum { | |||
58 | MLX4_CMD_SENSE_PORT = 0x4d, | 58 | MLX4_CMD_SENSE_PORT = 0x4d, |
59 | MLX4_CMD_HW_HEALTH_CHECK = 0x50, | 59 | MLX4_CMD_HW_HEALTH_CHECK = 0x50, |
60 | MLX4_CMD_SET_PORT = 0xc, | 60 | MLX4_CMD_SET_PORT = 0xc, |
61 | MLX4_CMD_SET_NODE = 0x5a, | ||
61 | MLX4_CMD_ACCESS_DDR = 0x2e, | 62 | MLX4_CMD_ACCESS_DDR = 0x2e, |
62 | MLX4_CMD_MAP_ICM = 0xffa, | 63 | MLX4_CMD_MAP_ICM = 0xffa, |
63 | MLX4_CMD_UNMAP_ICM = 0xff9, | 64 | MLX4_CMD_UNMAP_ICM = 0xff9, |
@@ -141,6 +142,7 @@ enum { | |||
141 | MLX4_SET_PORT_MAC_TABLE = 0x2, | 142 | MLX4_SET_PORT_MAC_TABLE = 0x2, |
142 | MLX4_SET_PORT_VLAN_TABLE = 0x3, | 143 | MLX4_SET_PORT_VLAN_TABLE = 0x3, |
143 | MLX4_SET_PORT_PRIO_MAP = 0x4, | 144 | MLX4_SET_PORT_PRIO_MAP = 0x4, |
145 | MLX4_SET_PORT_GID_TABLE = 0x5, | ||
144 | }; | 146 | }; |
145 | 147 | ||
146 | struct mlx4_dev; | 148 | struct mlx4_dev; |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 7338654c02b4..a7b15bc7648e 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -67,7 +67,8 @@ enum { | |||
67 | MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, | 67 | MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, |
68 | MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19, | 68 | MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19, |
69 | MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20, | 69 | MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20, |
70 | MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21 | 70 | MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21, |
71 | MLX4_DEV_CAP_FLAG_IBOE = 1 << 30 | ||
71 | }; | 72 | }; |
72 | 73 | ||
73 | enum { | 74 | enum { |
@@ -171,6 +172,10 @@ enum { | |||
171 | MLX4_NUM_FEXCH = 64 * 1024, | 172 | MLX4_NUM_FEXCH = 64 * 1024, |
172 | }; | 173 | }; |
173 | 174 | ||
175 | enum { | ||
176 | MLX4_MAX_FAST_REG_PAGES = 511, | ||
177 | }; | ||
178 | |||
174 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) | 179 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) |
175 | { | 180 | { |
176 | return (major << 32) | (minor << 16) | subminor; | 181 | return (major << 32) | (minor << 16) | subminor; |
@@ -379,6 +384,27 @@ struct mlx4_av { | |||
379 | u8 dgid[16]; | 384 | u8 dgid[16]; |
380 | }; | 385 | }; |
381 | 386 | ||
387 | struct mlx4_eth_av { | ||
388 | __be32 port_pd; | ||
389 | u8 reserved1; | ||
390 | u8 smac_idx; | ||
391 | u16 reserved2; | ||
392 | u8 reserved3; | ||
393 | u8 gid_index; | ||
394 | u8 stat_rate; | ||
395 | u8 hop_limit; | ||
396 | __be32 sl_tclass_flowlabel; | ||
397 | u8 dgid[16]; | ||
398 | u32 reserved4[2]; | ||
399 | __be16 vlan; | ||
400 | u8 mac[6]; | ||
401 | }; | ||
402 | |||
403 | union mlx4_ext_av { | ||
404 | struct mlx4_av ib; | ||
405 | struct mlx4_eth_av eth; | ||
406 | }; | ||
407 | |||
382 | struct mlx4_dev { | 408 | struct mlx4_dev { |
383 | struct pci_dev *pdev; | 409 | struct pci_dev *pdev; |
384 | unsigned long flags; | 410 | unsigned long flags; |
@@ -407,6 +433,12 @@ struct mlx4_init_port_param { | |||
407 | if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \ | 433 | if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \ |
408 | ~(dev)->caps.port_mask) & 1 << ((port) - 1)) | 434 | ~(dev)->caps.port_mask) & 1 << ((port) - 1)) |
409 | 435 | ||
436 | #define mlx4_foreach_ib_transport_port(port, dev) \ | ||
437 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ | ||
438 | if (((dev)->caps.port_mask & 1 << ((port) - 1)) || \ | ||
439 | ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE)) | ||
440 | |||
441 | |||
410 | int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, | 442 | int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, |
411 | struct mlx4_buf *buf); | 443 | struct mlx4_buf *buf); |
412 | void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); | 444 | void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); |
@@ -474,6 +506,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]); | |||
474 | int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index); | 506 | int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index); |
475 | void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index); | 507 | void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index); |
476 | 508 | ||
509 | int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); | ||
477 | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); | 510 | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); |
478 | void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index); | 511 | void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index); |
479 | 512 | ||
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h index 53c5fdb6eac4..f407cd4bfb34 100644 --- a/include/linux/mlx4/driver.h +++ b/include/linux/mlx4/driver.h | |||
@@ -44,15 +44,24 @@ enum mlx4_dev_event { | |||
44 | MLX4_DEV_EVENT_PORT_REINIT, | 44 | MLX4_DEV_EVENT_PORT_REINIT, |
45 | }; | 45 | }; |
46 | 46 | ||
47 | enum mlx4_protocol { | ||
48 | MLX4_PROTOCOL_IB, | ||
49 | MLX4_PROTOCOL_EN, | ||
50 | }; | ||
51 | |||
47 | struct mlx4_interface { | 52 | struct mlx4_interface { |
48 | void * (*add) (struct mlx4_dev *dev); | 53 | void * (*add) (struct mlx4_dev *dev); |
49 | void (*remove)(struct mlx4_dev *dev, void *context); | 54 | void (*remove)(struct mlx4_dev *dev, void *context); |
50 | void (*event) (struct mlx4_dev *dev, void *context, | 55 | void (*event) (struct mlx4_dev *dev, void *context, |
51 | enum mlx4_dev_event event, int port); | 56 | enum mlx4_dev_event event, int port); |
57 | void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); | ||
52 | struct list_head list; | 58 | struct list_head list; |
59 | enum mlx4_protocol protocol; | ||
53 | }; | 60 | }; |
54 | 61 | ||
55 | int mlx4_register_interface(struct mlx4_interface *intf); | 62 | int mlx4_register_interface(struct mlx4_interface *intf); |
56 | void mlx4_unregister_interface(struct mlx4_interface *intf); | 63 | void mlx4_unregister_interface(struct mlx4_interface *intf); |
57 | 64 | ||
65 | void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); | ||
66 | |||
58 | #endif /* MLX4_DRIVER_H */ | 67 | #endif /* MLX4_DRIVER_H */ |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 7abe64326f72..0eeb2a1a867c 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
@@ -109,10 +109,11 @@ struct mlx4_qp_path { | |||
109 | __be32 tclass_flowlabel; | 109 | __be32 tclass_flowlabel; |
110 | u8 rgid[16]; | 110 | u8 rgid[16]; |
111 | u8 sched_queue; | 111 | u8 sched_queue; |
112 | u8 snooper_flags; | 112 | u8 vlan_index; |
113 | u8 reserved3[2]; | 113 | u8 reserved3[2]; |
114 | u8 counter_index; | 114 | u8 counter_index; |
115 | u8 reserved4[7]; | 115 | u8 reserved4; |
116 | u8 dmac[6]; | ||
116 | }; | 117 | }; |
117 | 118 | ||
118 | struct mlx4_qp_context { | 119 | struct mlx4_qp_context { |
@@ -166,6 +167,7 @@ enum { | |||
166 | MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5, | 167 | MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5, |
167 | MLX4_WQE_CTRL_INS_VLAN = 1 << 6, | 168 | MLX4_WQE_CTRL_INS_VLAN = 1 << 6, |
168 | MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7, | 169 | MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7, |
170 | MLX4_WQE_CTRL_FORCE_LOOPBACK = 1 << 0, | ||
169 | }; | 171 | }; |
170 | 172 | ||
171 | struct mlx4_wqe_ctrl_seg { | 173 | struct mlx4_wqe_ctrl_seg { |
@@ -219,7 +221,8 @@ struct mlx4_wqe_datagram_seg { | |||
219 | __be32 av[8]; | 221 | __be32 av[8]; |
220 | __be32 dqpn; | 222 | __be32 dqpn; |
221 | __be32 qkey; | 223 | __be32 qkey; |
222 | __be32 reservd[2]; | 224 | __be16 vlan; |
225 | u8 mac[6]; | ||
223 | }; | 226 | }; |
224 | 227 | ||
225 | struct mlx4_wqe_lso_seg { | 228 | struct mlx4_wqe_lso_seg { |
diff --git a/include/linux/mm.h b/include/linux/mm.h index a4c66846fb8f..721f451c3029 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -144,6 +144,7 @@ extern pgprot_t protection_map[16]; | |||
144 | #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ | 144 | #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ |
145 | #define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ | 145 | #define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ |
146 | #define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ | 146 | #define FAULT_FLAG_MKWRITE 0x04 /* Fault was mkwrite of existing pte */ |
147 | #define FAULT_FLAG_ALLOW_RETRY 0x08 /* Retry fault if blocking */ | ||
147 | 148 | ||
148 | /* | 149 | /* |
149 | * This interface is used by x86 PAT code to identify a pfn mapping that is | 150 | * This interface is used by x86 PAT code to identify a pfn mapping that is |
@@ -497,8 +498,8 @@ static inline void set_compound_order(struct page *page, unsigned long order) | |||
497 | #define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) | 498 | #define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) |
498 | #define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) | 499 | #define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) |
499 | 500 | ||
500 | /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allcator */ | 501 | /* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allocator */ |
501 | #ifdef NODE_NOT_IN_PAGEFLAGS | 502 | #ifdef NODE_NOT_IN_PAGE_FLAGS |
502 | #define ZONEID_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT) | 503 | #define ZONEID_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT) |
503 | #define ZONEID_PGOFF ((SECTIONS_PGOFF < ZONES_PGOFF)? \ | 504 | #define ZONEID_PGOFF ((SECTIONS_PGOFF < ZONES_PGOFF)? \ |
504 | SECTIONS_PGOFF : ZONES_PGOFF) | 505 | SECTIONS_PGOFF : ZONES_PGOFF) |
@@ -723,6 +724,7 @@ static inline int page_mapped(struct page *page) | |||
723 | 724 | ||
724 | #define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ | 725 | #define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ |
725 | #define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ | 726 | #define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ |
727 | #define VM_FAULT_RETRY 0x0400 /* ->fault blocked, must retry */ | ||
726 | 728 | ||
727 | #define VM_FAULT_HWPOISON_LARGE_MASK 0xf000 /* encodes hpage index for large hwpoison */ | 729 | #define VM_FAULT_HWPOISON_LARGE_MASK 0xf000 /* encodes hpage index for large hwpoison */ |
728 | 730 | ||
@@ -868,6 +870,7 @@ int __set_page_dirty_no_writeback(struct page *page); | |||
868 | int redirty_page_for_writepage(struct writeback_control *wbc, | 870 | int redirty_page_for_writepage(struct writeback_control *wbc, |
869 | struct page *page); | 871 | struct page *page); |
870 | void account_page_dirtied(struct page *page, struct address_space *mapping); | 872 | void account_page_dirtied(struct page *page, struct address_space *mapping); |
873 | void account_page_writeback(struct page *page); | ||
871 | int set_page_dirty(struct page *page); | 874 | int set_page_dirty(struct page *page); |
872 | int set_page_dirty_lock(struct page *page); | 875 | int set_page_dirty_lock(struct page *page); |
873 | int clear_page_dirty_for_io(struct page *page); | 876 | int clear_page_dirty_for_io(struct page *page); |
@@ -1031,7 +1034,15 @@ extern void unregister_shrinker(struct shrinker *); | |||
1031 | 1034 | ||
1032 | int vma_wants_writenotify(struct vm_area_struct *vma); | 1035 | int vma_wants_writenotify(struct vm_area_struct *vma); |
1033 | 1036 | ||
1034 | extern pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl); | 1037 | extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr, |
1038 | spinlock_t **ptl); | ||
1039 | static inline pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr, | ||
1040 | spinlock_t **ptl) | ||
1041 | { | ||
1042 | pte_t *ptep; | ||
1043 | __cond_lock(*ptl, ptep = __get_locked_pte(mm, addr, ptl)); | ||
1044 | return ptep; | ||
1045 | } | ||
1035 | 1046 | ||
1036 | #ifdef __PAGETABLE_PUD_FOLDED | 1047 | #ifdef __PAGETABLE_PUD_FOLDED |
1037 | static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, | 1048 | static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index cb57d657ce4d..bb7288a782fd 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -310,6 +310,8 @@ struct mm_struct { | |||
310 | #ifdef CONFIG_MMU_NOTIFIER | 310 | #ifdef CONFIG_MMU_NOTIFIER |
311 | struct mmu_notifier_mm *mmu_notifier_mm; | 311 | struct mmu_notifier_mm *mmu_notifier_mm; |
312 | #endif | 312 | #endif |
313 | /* How many tasks sharing this mm are OOM_DISABLE */ | ||
314 | atomic_t oom_disable_count; | ||
313 | }; | 315 | }; |
314 | 316 | ||
315 | /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ | 317 | /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 6b7525099e56..8ce082781ccb 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -48,6 +48,7 @@ struct mmc_ext_csd { | |||
48 | unsigned int sa_timeout; /* Units: 100ns */ | 48 | unsigned int sa_timeout; /* Units: 100ns */ |
49 | unsigned int hs_max_dtr; | 49 | unsigned int hs_max_dtr; |
50 | unsigned int sectors; | 50 | unsigned int sectors; |
51 | unsigned int card_type; | ||
51 | unsigned int hc_erase_size; /* In sectors */ | 52 | unsigned int hc_erase_size; /* In sectors */ |
52 | unsigned int hc_erase_timeout; /* In milliseconds */ | 53 | unsigned int hc_erase_timeout; /* In milliseconds */ |
53 | unsigned int sec_trim_mult; /* Secure trim multiplier */ | 54 | unsigned int sec_trim_mult; /* Secure trim multiplier */ |
@@ -113,6 +114,7 @@ struct mmc_card { | |||
113 | #define MMC_STATE_READONLY (1<<1) /* card is read-only */ | 114 | #define MMC_STATE_READONLY (1<<1) /* card is read-only */ |
114 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ | 115 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ |
115 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ | 116 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ |
117 | #define MMC_STATE_HIGHSPEED_DDR (1<<4) /* card is in high speed mode */ | ||
116 | unsigned int quirks; /* card quirks */ | 118 | unsigned int quirks; /* card quirks */ |
117 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ | 119 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ |
118 | #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ | 120 | #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */ |
@@ -154,11 +156,13 @@ struct mmc_card { | |||
154 | #define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) | 156 | #define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) |
155 | #define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) | 157 | #define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) |
156 | #define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) | 158 | #define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) |
159 | #define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR) | ||
157 | 160 | ||
158 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) | 161 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) |
159 | #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) | 162 | #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) |
160 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) | 163 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) |
161 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) | 164 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) |
165 | #define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR) | ||
162 | 166 | ||
163 | static inline int mmc_card_lenient_fn0(const struct mmc_card *c) | 167 | static inline int mmc_card_lenient_fn0(const struct mmc_card *c) |
164 | { | 168 | { |
@@ -173,6 +177,8 @@ static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c) | |||
173 | #define mmc_card_name(c) ((c)->cid.prod_name) | 177 | #define mmc_card_name(c) ((c)->cid.prod_name) |
174 | #define mmc_card_id(c) (dev_name(&(c)->dev)) | 178 | #define mmc_card_id(c) (dev_name(&(c)->dev)) |
175 | 179 | ||
180 | #define mmc_dev_to_card(d) container_of(d, struct mmc_card, dev) | ||
181 | |||
176 | #define mmc_list_to_card(l) container_of(l, struct mmc_card, node) | 182 | #define mmc_list_to_card(l) container_of(l, struct mmc_card, node) |
177 | #define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev) | 183 | #define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev) |
178 | #define mmc_set_drvdata(c,d) dev_set_drvdata(&(c)->dev, d) | 184 | #define mmc_set_drvdata(c,d) dev_set_drvdata(&(c)->dev, d) |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 7429033acb66..64e013f1cfb8 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -153,6 +153,8 @@ extern int mmc_can_secure_erase_trim(struct mmc_card *card); | |||
153 | extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, | 153 | extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, |
154 | unsigned int nr); | 154 | unsigned int nr); |
155 | 155 | ||
156 | extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); | ||
157 | |||
156 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); | 158 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); |
157 | extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); | 159 | extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); |
158 | 160 | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 1575b52c3bfa..30f6fad99a58 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -50,6 +50,12 @@ struct mmc_ios { | |||
50 | #define MMC_TIMING_LEGACY 0 | 50 | #define MMC_TIMING_LEGACY 0 |
51 | #define MMC_TIMING_MMC_HS 1 | 51 | #define MMC_TIMING_MMC_HS 1 |
52 | #define MMC_TIMING_SD_HS 2 | 52 | #define MMC_TIMING_SD_HS 2 |
53 | |||
54 | unsigned char ddr; /* dual data rate used */ | ||
55 | |||
56 | #define MMC_SDR_MODE 0 | ||
57 | #define MMC_1_2V_DDR_MODE 1 | ||
58 | #define MMC_1_8V_DDR_MODE 2 | ||
53 | }; | 59 | }; |
54 | 60 | ||
55 | struct mmc_host_ops { | 61 | struct mmc_host_ops { |
@@ -123,6 +129,7 @@ struct mmc_host { | |||
123 | const struct mmc_host_ops *ops; | 129 | const struct mmc_host_ops *ops; |
124 | unsigned int f_min; | 130 | unsigned int f_min; |
125 | unsigned int f_max; | 131 | unsigned int f_max; |
132 | unsigned int f_init; | ||
126 | u32 ocr_avail; | 133 | u32 ocr_avail; |
127 | struct notifier_block pm_notify; | 134 | struct notifier_block pm_notify; |
128 | 135 | ||
@@ -157,13 +164,17 @@ struct mmc_host { | |||
157 | #define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ | 164 | #define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ |
158 | #define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ | 165 | #define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ |
159 | #define MMC_CAP_ERASE (1 << 10) /* Allow erase/trim commands */ | 166 | #define MMC_CAP_ERASE (1 << 10) /* Allow erase/trim commands */ |
167 | #define MMC_CAP_1_8V_DDR (1 << 11) /* can support */ | ||
168 | /* DDR mode at 1.8V */ | ||
169 | #define MMC_CAP_1_2V_DDR (1 << 12) /* can support */ | ||
170 | /* DDR mode at 1.2V */ | ||
171 | #define MMC_CAP_POWER_OFF_CARD (1 << 13) /* Can power off after boot */ | ||
160 | 172 | ||
161 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 173 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
162 | 174 | ||
163 | /* host specific block data */ | 175 | /* host specific block data */ |
164 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 176 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |
165 | unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */ | 177 | unsigned short max_segs; /* see blk_queue_max_segments */ |
166 | unsigned short max_phys_segs; /* see blk_queue_max_phys_segments */ | ||
167 | unsigned short unused; | 178 | unsigned short unused; |
168 | unsigned int max_req_size; /* maximum number of bytes in one req */ | 179 | unsigned int max_req_size; /* maximum number of bytes in one req */ |
169 | unsigned int max_blk_size; /* maximum size of one mmc block */ | 180 | unsigned int max_blk_size; /* maximum size of one mmc block */ |
@@ -212,6 +223,10 @@ struct mmc_host { | |||
212 | struct led_trigger *led; /* activity led */ | 223 | struct led_trigger *led; /* activity led */ |
213 | #endif | 224 | #endif |
214 | 225 | ||
226 | #ifdef CONFIG_REGULATOR | ||
227 | bool regulator_enabled; /* regulator state */ | ||
228 | #endif | ||
229 | |||
215 | struct dentry *debugfs_root; | 230 | struct dentry *debugfs_root; |
216 | 231 | ||
217 | unsigned long private[0] ____cacheline_aligned; | 232 | unsigned long private[0] ____cacheline_aligned; |
@@ -236,8 +251,8 @@ static inline void *mmc_priv(struct mmc_host *host) | |||
236 | extern int mmc_suspend_host(struct mmc_host *); | 251 | extern int mmc_suspend_host(struct mmc_host *); |
237 | extern int mmc_resume_host(struct mmc_host *); | 252 | extern int mmc_resume_host(struct mmc_host *); |
238 | 253 | ||
239 | extern void mmc_power_save_host(struct mmc_host *host); | 254 | extern int mmc_power_save_host(struct mmc_host *host); |
240 | extern void mmc_power_restore_host(struct mmc_host *host); | 255 | extern int mmc_power_restore_host(struct mmc_host *host); |
241 | 256 | ||
242 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); | 257 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); |
243 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); | 258 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); |
@@ -250,8 +265,24 @@ static inline void mmc_signal_sdio_irq(struct mmc_host *host) | |||
250 | 265 | ||
251 | struct regulator; | 266 | struct regulator; |
252 | 267 | ||
268 | #ifdef CONFIG_REGULATOR | ||
253 | int mmc_regulator_get_ocrmask(struct regulator *supply); | 269 | int mmc_regulator_get_ocrmask(struct regulator *supply); |
254 | int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit); | 270 | int mmc_regulator_set_ocr(struct mmc_host *mmc, |
271 | struct regulator *supply, | ||
272 | unsigned short vdd_bit); | ||
273 | #else | ||
274 | static inline int mmc_regulator_get_ocrmask(struct regulator *supply) | ||
275 | { | ||
276 | return 0; | ||
277 | } | ||
278 | |||
279 | static inline int mmc_regulator_set_ocr(struct mmc_host *mmc, | ||
280 | struct regulator *supply, | ||
281 | unsigned short vdd_bit) | ||
282 | { | ||
283 | return 0; | ||
284 | } | ||
285 | #endif | ||
255 | 286 | ||
256 | int mmc_card_awake(struct mmc_host *host); | 287 | int mmc_card_awake(struct mmc_host *host); |
257 | int mmc_card_sleep(struct mmc_host *host); | 288 | int mmc_card_sleep(struct mmc_host *host); |
@@ -268,5 +299,13 @@ static inline void mmc_set_disable_delay(struct mmc_host *host, | |||
268 | host->disable_delay = disable_delay; | 299 | host->disable_delay = disable_delay; |
269 | } | 300 | } |
270 | 301 | ||
302 | /* Module parameter */ | ||
303 | extern int mmc_assume_removable; | ||
304 | |||
305 | static inline int mmc_card_is_removable(struct mmc_host *host) | ||
306 | { | ||
307 | return !(host->caps & MMC_CAP_NONREMOVABLE) && mmc_assume_removable; | ||
308 | } | ||
309 | |||
271 | #endif | 310 | #endif |
272 | 311 | ||
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index dd11ae51fb68..956fbd877692 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -277,11 +277,19 @@ struct _mmc_csd { | |||
277 | 277 | ||
278 | #define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ | 278 | #define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ |
279 | #define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ | 279 | #define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ |
280 | #define EXT_CSD_CARD_TYPE_MASK 0x3 /* Mask out reserved and DDR bits */ | 280 | #define EXT_CSD_CARD_TYPE_MASK 0xF /* Mask out reserved bits */ |
281 | #define EXT_CSD_CARD_TYPE_DDR_1_8V (1<<2) /* Card can run at 52MHz */ | ||
282 | /* DDR mode @1.8V or 3V I/O */ | ||
283 | #define EXT_CSD_CARD_TYPE_DDR_1_2V (1<<3) /* Card can run at 52MHz */ | ||
284 | /* DDR mode @1.2V I/O */ | ||
285 | #define EXT_CSD_CARD_TYPE_DDR_52 (EXT_CSD_CARD_TYPE_DDR_1_8V \ | ||
286 | | EXT_CSD_CARD_TYPE_DDR_1_2V) | ||
281 | 287 | ||
282 | #define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ | 288 | #define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ |
283 | #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ | 289 | #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ |
284 | #define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */ | 290 | #define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */ |
291 | #define EXT_CSD_DDR_BUS_WIDTH_4 5 /* Card is in 4 bit DDR mode */ | ||
292 | #define EXT_CSD_DDR_BUS_WIDTH_8 6 /* Card is in 8 bit DDR mode */ | ||
285 | 293 | ||
286 | #define EXT_CSD_SEC_ER_EN BIT(0) | 294 | #define EXT_CSD_SEC_ER_EN BIT(0) |
287 | #define EXT_CSD_SEC_BD_BLK_EN BIT(2) | 295 | #define EXT_CSD_SEC_BD_BLK_EN BIT(2) |
diff --git a/include/linux/sdhci-pltfm.h b/include/linux/mmc/sdhci-pltfm.h index 0239bd70241e..548d59d404cb 100644 --- a/include/linux/sdhci-pltfm.h +++ b/include/linux/mmc/sdhci-pltfm.h | |||
@@ -28,7 +28,7 @@ struct sdhci_host; | |||
28 | struct sdhci_pltfm_data { | 28 | struct sdhci_pltfm_data { |
29 | struct sdhci_ops *ops; | 29 | struct sdhci_ops *ops; |
30 | unsigned int quirks; | 30 | unsigned int quirks; |
31 | int (*init)(struct sdhci_host *host); | 31 | int (*init)(struct sdhci_host *host, struct sdhci_pltfm_data *pdata); |
32 | void (*exit)(struct sdhci_host *host); | 32 | void (*exit)(struct sdhci_host *host); |
33 | }; | 33 | }; |
34 | 34 | ||
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h new file mode 100644 index 000000000000..1fdc673f2396 --- /dev/null +++ b/include/linux/mmc/sdhci.h | |||
@@ -0,0 +1,144 @@ | |||
1 | /* | ||
2 | * linux/include/linux/mmc/sdhci.h - Secure Digital Host Controller Interface | ||
3 | * | ||
4 | * Copyright (C) 2005-2008 Pierre Ossman, All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or (at | ||
9 | * your option) any later version. | ||
10 | */ | ||
11 | #ifndef __SDHCI_H | ||
12 | #define __SDHCI_H | ||
13 | |||
14 | #include <linux/scatterlist.h> | ||
15 | #include <linux/compiler.h> | ||
16 | #include <linux/types.h> | ||
17 | #include <linux/io.h> | ||
18 | #include <linux/mmc/host.h> | ||
19 | |||
20 | struct sdhci_host { | ||
21 | /* Data set by hardware interface driver */ | ||
22 | const char *hw_name; /* Hardware bus name */ | ||
23 | |||
24 | unsigned int quirks; /* Deviations from spec. */ | ||
25 | |||
26 | /* Controller doesn't honor resets unless we touch the clock register */ | ||
27 | #define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1<<0) | ||
28 | /* Controller has bad caps bits, but really supports DMA */ | ||
29 | #define SDHCI_QUIRK_FORCE_DMA (1<<1) | ||
30 | /* Controller doesn't like to be reset when there is no card inserted. */ | ||
31 | #define SDHCI_QUIRK_NO_CARD_NO_RESET (1<<2) | ||
32 | /* Controller doesn't like clearing the power reg before a change */ | ||
33 | #define SDHCI_QUIRK_SINGLE_POWER_WRITE (1<<3) | ||
34 | /* Controller has flaky internal state so reset it on each ios change */ | ||
35 | #define SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS (1<<4) | ||
36 | /* Controller has an unusable DMA engine */ | ||
37 | #define SDHCI_QUIRK_BROKEN_DMA (1<<5) | ||
38 | /* Controller has an unusable ADMA engine */ | ||
39 | #define SDHCI_QUIRK_BROKEN_ADMA (1<<6) | ||
40 | /* Controller can only DMA from 32-bit aligned addresses */ | ||
41 | #define SDHCI_QUIRK_32BIT_DMA_ADDR (1<<7) | ||
42 | /* Controller can only DMA chunk sizes that are a multiple of 32 bits */ | ||
43 | #define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<8) | ||
44 | /* Controller can only ADMA chunks that are a multiple of 32 bits */ | ||
45 | #define SDHCI_QUIRK_32BIT_ADMA_SIZE (1<<9) | ||
46 | /* Controller needs to be reset after each request to stay stable */ | ||
47 | #define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<10) | ||
48 | /* Controller needs voltage and power writes to happen separately */ | ||
49 | #define SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER (1<<11) | ||
50 | /* Controller provides an incorrect timeout value for transfers */ | ||
51 | #define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL (1<<12) | ||
52 | /* Controller has an issue with buffer bits for small transfers */ | ||
53 | #define SDHCI_QUIRK_BROKEN_SMALL_PIO (1<<13) | ||
54 | /* Controller does not provide transfer-complete interrupt when not busy */ | ||
55 | #define SDHCI_QUIRK_NO_BUSY_IRQ (1<<14) | ||
56 | /* Controller has unreliable card detection */ | ||
57 | #define SDHCI_QUIRK_BROKEN_CARD_DETECTION (1<<15) | ||
58 | /* Controller reports inverted write-protect state */ | ||
59 | #define SDHCI_QUIRK_INVERTED_WRITE_PROTECT (1<<16) | ||
60 | /* Controller has nonstandard clock management */ | ||
61 | #define SDHCI_QUIRK_NONSTANDARD_CLOCK (1<<17) | ||
62 | /* Controller does not like fast PIO transfers */ | ||
63 | #define SDHCI_QUIRK_PIO_NEEDS_DELAY (1<<18) | ||
64 | /* Controller losing signal/interrupt enable states after reset */ | ||
65 | #define SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET (1<<19) | ||
66 | /* Controller has to be forced to use block size of 2048 bytes */ | ||
67 | #define SDHCI_QUIRK_FORCE_BLK_SZ_2048 (1<<20) | ||
68 | /* Controller cannot do multi-block transfers */ | ||
69 | #define SDHCI_QUIRK_NO_MULTIBLOCK (1<<21) | ||
70 | /* Controller can only handle 1-bit data transfers */ | ||
71 | #define SDHCI_QUIRK_FORCE_1_BIT_DATA (1<<22) | ||
72 | /* Controller needs 10ms delay between applying power and clock */ | ||
73 | #define SDHCI_QUIRK_DELAY_AFTER_POWER (1<<23) | ||
74 | /* Controller uses SDCLK instead of TMCLK for data timeouts */ | ||
75 | #define SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK (1<<24) | ||
76 | /* Controller reports wrong base clock capability */ | ||
77 | #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN (1<<25) | ||
78 | /* Controller cannot support End Attribute in NOP ADMA descriptor */ | ||
79 | #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC (1<<26) | ||
80 | /* Controller is missing device caps. Use caps provided by host */ | ||
81 | #define SDHCI_QUIRK_MISSING_CAPS (1<<27) | ||
82 | /* Controller uses Auto CMD12 command to stop the transfer */ | ||
83 | #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28) | ||
84 | /* Controller doesn't have HISPD bit field in HI-SPEED SD card */ | ||
85 | #define SDHCI_QUIRK_NO_HISPD_BIT (1<<29) | ||
86 | |||
87 | int irq; /* Device IRQ */ | ||
88 | void __iomem *ioaddr; /* Mapped address */ | ||
89 | |||
90 | const struct sdhci_ops *ops; /* Low level hw interface */ | ||
91 | |||
92 | struct regulator *vmmc; /* Power regulator */ | ||
93 | |||
94 | /* Internal data */ | ||
95 | struct mmc_host *mmc; /* MMC structure */ | ||
96 | u64 dma_mask; /* custom DMA mask */ | ||
97 | |||
98 | #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) | ||
99 | struct led_classdev led; /* LED control */ | ||
100 | char led_name[32]; | ||
101 | #endif | ||
102 | |||
103 | spinlock_t lock; /* Mutex */ | ||
104 | |||
105 | int flags; /* Host attributes */ | ||
106 | #define SDHCI_USE_SDMA (1<<0) /* Host is SDMA capable */ | ||
107 | #define SDHCI_USE_ADMA (1<<1) /* Host is ADMA capable */ | ||
108 | #define SDHCI_REQ_USE_DMA (1<<2) /* Use DMA for this req. */ | ||
109 | #define SDHCI_DEVICE_DEAD (1<<3) /* Device unresponsive */ | ||
110 | |||
111 | unsigned int version; /* SDHCI spec. version */ | ||
112 | |||
113 | unsigned int max_clk; /* Max possible freq (MHz) */ | ||
114 | unsigned int timeout_clk; /* Timeout freq (KHz) */ | ||
115 | |||
116 | unsigned int clock; /* Current clock (MHz) */ | ||
117 | u8 pwr; /* Current voltage */ | ||
118 | |||
119 | struct mmc_request *mrq; /* Current request */ | ||
120 | struct mmc_command *cmd; /* Current command */ | ||
121 | struct mmc_data *data; /* Current data request */ | ||
122 | unsigned int data_early:1; /* Data finished before cmd */ | ||
123 | |||
124 | struct sg_mapping_iter sg_miter; /* SG state for PIO */ | ||
125 | unsigned int blocks; /* remaining PIO blocks */ | ||
126 | |||
127 | int sg_count; /* Mapped sg entries */ | ||
128 | |||
129 | u8 *adma_desc; /* ADMA descriptor table */ | ||
130 | u8 *align_buffer; /* Bounce buffer */ | ||
131 | |||
132 | dma_addr_t adma_addr; /* Mapped ADMA descr. table */ | ||
133 | dma_addr_t align_addr; /* Mapped bounce buffer */ | ||
134 | |||
135 | struct tasklet_struct card_tasklet; /* Tasklet structures */ | ||
136 | struct tasklet_struct finish_tasklet; | ||
137 | |||
138 | struct timer_list timer; /* Timer for timeouts */ | ||
139 | |||
140 | unsigned int caps; /* Alternative capabilities */ | ||
141 | |||
142 | unsigned long private[0] ____cacheline_aligned; | ||
143 | }; | ||
144 | #endif /* __SDHCI_H */ | ||
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index d4a2ebbdab4b..5c99da1078aa 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
@@ -34,6 +34,7 @@ | |||
34 | struct sh_mmcif_plat_data { | 34 | struct sh_mmcif_plat_data { |
35 | void (*set_pwr)(struct platform_device *pdev, int state); | 35 | void (*set_pwr)(struct platform_device *pdev, int state); |
36 | void (*down_pwr)(struct platform_device *pdev); | 36 | void (*down_pwr)(struct platform_device *pdev); |
37 | int (*get_cd)(struct platform_device *pdef); | ||
37 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ | 38 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ |
38 | unsigned long caps; | 39 | unsigned long caps; |
39 | u32 ocr; | 40 | u32 ocr; |
@@ -58,19 +59,19 @@ struct sh_mmcif_plat_data { | |||
58 | #define MMCIF_CE_HOST_STS2 0x0000004C | 59 | #define MMCIF_CE_HOST_STS2 0x0000004C |
59 | #define MMCIF_CE_VERSION 0x0000007C | 60 | #define MMCIF_CE_VERSION 0x0000007C |
60 | 61 | ||
61 | extern inline u32 sh_mmcif_readl(void __iomem *addr, int reg) | 62 | static inline u32 sh_mmcif_readl(void __iomem *addr, int reg) |
62 | { | 63 | { |
63 | return readl(addr + reg); | 64 | return readl(addr + reg); |
64 | } | 65 | } |
65 | 66 | ||
66 | extern inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val) | 67 | static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val) |
67 | { | 68 | { |
68 | writel(val, addr + reg); | 69 | writel(val, addr + reg); |
69 | } | 70 | } |
70 | 71 | ||
71 | #define SH_MMCIF_BBS 512 /* boot block size */ | 72 | #define SH_MMCIF_BBS 512 /* boot block size */ |
72 | 73 | ||
73 | extern inline void sh_mmcif_boot_cmd_send(void __iomem *base, | 74 | static inline void sh_mmcif_boot_cmd_send(void __iomem *base, |
74 | unsigned long cmd, unsigned long arg) | 75 | unsigned long cmd, unsigned long arg) |
75 | { | 76 | { |
76 | sh_mmcif_writel(base, MMCIF_CE_INT, 0); | 77 | sh_mmcif_writel(base, MMCIF_CE_INT, 0); |
@@ -78,7 +79,7 @@ extern inline void sh_mmcif_boot_cmd_send(void __iomem *base, | |||
78 | sh_mmcif_writel(base, MMCIF_CE_CMD_SET, cmd); | 79 | sh_mmcif_writel(base, MMCIF_CE_CMD_SET, cmd); |
79 | } | 80 | } |
80 | 81 | ||
81 | extern inline int sh_mmcif_boot_cmd_poll(void __iomem *base, unsigned long mask) | 82 | static inline int sh_mmcif_boot_cmd_poll(void __iomem *base, unsigned long mask) |
82 | { | 83 | { |
83 | unsigned long tmp; | 84 | unsigned long tmp; |
84 | int cnt; | 85 | int cnt; |
@@ -94,14 +95,14 @@ extern inline int sh_mmcif_boot_cmd_poll(void __iomem *base, unsigned long mask) | |||
94 | return -1; | 95 | return -1; |
95 | } | 96 | } |
96 | 97 | ||
97 | extern inline int sh_mmcif_boot_cmd(void __iomem *base, | 98 | static inline int sh_mmcif_boot_cmd(void __iomem *base, |
98 | unsigned long cmd, unsigned long arg) | 99 | unsigned long cmd, unsigned long arg) |
99 | { | 100 | { |
100 | sh_mmcif_boot_cmd_send(base, cmd, arg); | 101 | sh_mmcif_boot_cmd_send(base, cmd, arg); |
101 | return sh_mmcif_boot_cmd_poll(base, 0x00010000); | 102 | return sh_mmcif_boot_cmd_poll(base, 0x00010000); |
102 | } | 103 | } |
103 | 104 | ||
104 | extern inline int sh_mmcif_boot_do_read_single(void __iomem *base, | 105 | static inline int sh_mmcif_boot_do_read_single(void __iomem *base, |
105 | unsigned int block_nr, | 106 | unsigned int block_nr, |
106 | unsigned long *buf) | 107 | unsigned long *buf) |
107 | { | 108 | { |
@@ -124,7 +125,7 @@ extern inline int sh_mmcif_boot_do_read_single(void __iomem *base, | |||
124 | return 0; | 125 | return 0; |
125 | } | 126 | } |
126 | 127 | ||
127 | extern inline int sh_mmcif_boot_do_read(void __iomem *base, | 128 | static inline int sh_mmcif_boot_do_read(void __iomem *base, |
128 | unsigned long first_block, | 129 | unsigned long first_block, |
129 | unsigned long nr_blocks, | 130 | unsigned long nr_blocks, |
130 | void *buf) | 131 | void *buf) |
@@ -142,7 +143,7 @@ extern inline int sh_mmcif_boot_do_read(void __iomem *base, | |||
142 | return ret; | 143 | return ret; |
143 | } | 144 | } |
144 | 145 | ||
145 | extern inline void sh_mmcif_boot_init(void __iomem *base) | 146 | static inline void sh_mmcif_boot_init(void __iomem *base) |
146 | { | 147 | { |
147 | unsigned long tmp; | 148 | unsigned long tmp; |
148 | 149 | ||
@@ -176,7 +177,7 @@ extern inline void sh_mmcif_boot_init(void __iomem *base) | |||
176 | sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); | 177 | sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); |
177 | } | 178 | } |
178 | 179 | ||
179 | extern inline void sh_mmcif_boot_slurp(void __iomem *base, | 180 | static inline void sh_mmcif_boot_slurp(void __iomem *base, |
180 | unsigned char *buf, | 181 | unsigned char *buf, |
181 | unsigned long no_bytes) | 182 | unsigned long no_bytes) |
182 | { | 183 | { |
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index 4e02ee2b071e..43dcfbdc39de 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h | |||
@@ -227,7 +227,7 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | |||
227 | 227 | ||
228 | /* | 228 | /* |
229 | * These two macros will sometime replace ptep_clear_flush. | 229 | * These two macros will sometime replace ptep_clear_flush. |
230 | * ptep_clear_flush is impleemnted as macro itself, so this also is | 230 | * ptep_clear_flush is implemented as macro itself, so this also is |
231 | * implemented as a macro until ptep_clear_flush will converted to an | 231 | * implemented as a macro until ptep_clear_flush will converted to an |
232 | * inline function, to diminish the risk of compilation failure. The | 232 | * inline function, to diminish the risk of compilation failure. The |
233 | * invalidate_page method over time can be moved outside the PT lock | 233 | * invalidate_page method over time can be moved outside the PT lock |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 3984c4eb41fd..39c24ebe9cfd 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -104,6 +104,8 @@ enum zone_stat_item { | |||
104 | NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ | 104 | NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ |
105 | NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ | 105 | NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ |
106 | NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */ | 106 | NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */ |
107 | NR_DIRTIED, /* page dirtyings since bootup */ | ||
108 | NR_WRITTEN, /* page writings since bootup */ | ||
107 | #ifdef CONFIG_NUMA | 109 | #ifdef CONFIG_NUMA |
108 | NUMA_HIT, /* allocated in intended node */ | 110 | NUMA_HIT, /* allocated in intended node */ |
109 | NUMA_MISS, /* allocated in non intended node */ | 111 | NUMA_MISS, /* allocated in non intended node */ |
@@ -421,6 +423,9 @@ struct zone { | |||
421 | typedef enum { | 423 | typedef enum { |
422 | ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */ | 424 | ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */ |
423 | ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */ | 425 | ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */ |
426 | ZONE_CONGESTED, /* zone has many dirty pages backed by | ||
427 | * a congested BDI | ||
428 | */ | ||
424 | } zone_flags_t; | 429 | } zone_flags_t; |
425 | 430 | ||
426 | static inline void zone_set_flag(struct zone *zone, zone_flags_t flag) | 431 | static inline void zone_set_flag(struct zone *zone, zone_flags_t flag) |
@@ -438,6 +443,11 @@ static inline void zone_clear_flag(struct zone *zone, zone_flags_t flag) | |||
438 | clear_bit(flag, &zone->flags); | 443 | clear_bit(flag, &zone->flags); |
439 | } | 444 | } |
440 | 445 | ||
446 | static inline int zone_is_reclaim_congested(const struct zone *zone) | ||
447 | { | ||
448 | return test_bit(ZONE_CONGESTED, &zone->flags); | ||
449 | } | ||
450 | |||
441 | static inline int zone_is_reclaim_locked(const struct zone *zone) | 451 | static inline int zone_is_reclaim_locked(const struct zone *zone) |
442 | { | 452 | { |
443 | return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); | 453 | return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); |
diff --git a/include/linux/module.h b/include/linux/module.h index b29e7458b966..7575bbbdf2a2 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -517,7 +517,7 @@ static inline void __module_get(struct module *module) | |||
517 | #define symbol_put_addr(p) do { } while(0) | 517 | #define symbol_put_addr(p) do { } while(0) |
518 | 518 | ||
519 | #endif /* CONFIG_MODULE_UNLOAD */ | 519 | #endif /* CONFIG_MODULE_UNLOAD */ |
520 | int use_module(struct module *a, struct module *b); | 520 | int ref_module(struct module *a, struct module *b); |
521 | 521 | ||
522 | /* This is a #define so the string doesn't get put in every .o file */ | 522 | /* This is a #define so the string doesn't get put in every .o file */ |
523 | #define module_name(mod) \ | 523 | #define module_name(mod) \ |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 9d2f1837b3d8..112adf8bd47d 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -21,8 +21,8 @@ | |||
21 | #define __module_cat(a,b) ___module_cat(a,b) | 21 | #define __module_cat(a,b) ___module_cat(a,b) |
22 | #define __MODULE_INFO(tag, name, info) \ | 22 | #define __MODULE_INFO(tag, name, info) \ |
23 | static const char __module_cat(name,__LINE__)[] \ | 23 | static const char __module_cat(name,__LINE__)[] \ |
24 | __used \ | 24 | __used __attribute__((section(".modinfo"), unused, aligned(1))) \ |
25 | __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info | 25 | = __stringify(tag) "=" info |
26 | #else /* !MODULE */ | 26 | #else /* !MODULE */ |
27 | #define __MODULE_INFO(tag, name, info) | 27 | #define __MODULE_INFO(tag, name, info) |
28 | #endif | 28 | #endif |
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index 7fa20beb2ab9..57cc0e63714f 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h | |||
@@ -84,7 +84,7 @@ struct nand_bbt_descr { | |||
84 | #define NAND_BBT_PERCHIP 0x00000080 | 84 | #define NAND_BBT_PERCHIP 0x00000080 |
85 | /* bbt has a version counter at offset veroffs */ | 85 | /* bbt has a version counter at offset veroffs */ |
86 | #define NAND_BBT_VERSION 0x00000100 | 86 | #define NAND_BBT_VERSION 0x00000100 |
87 | /* Create a bbt if none axists */ | 87 | /* Create a bbt if none exists */ |
88 | #define NAND_BBT_CREATE 0x00000200 | 88 | #define NAND_BBT_CREATE 0x00000200 |
89 | /* Search good / bad pattern through all pages of a block */ | 89 | /* Search good / bad pattern through all pages of a block */ |
90 | #define NAND_BBT_SCANALLPAGES 0x00000400 | 90 | #define NAND_BBT_SCANALLPAGES 0x00000400 |
@@ -102,6 +102,8 @@ struct nand_bbt_descr { | |||
102 | #define NAND_BBT_SCANBYTE1AND6 0x00100000 | 102 | #define NAND_BBT_SCANBYTE1AND6 0x00100000 |
103 | /* The nand_bbt_descr was created dynamicaly and must be freed */ | 103 | /* The nand_bbt_descr was created dynamicaly and must be freed */ |
104 | #define NAND_BBT_DYNAMICSTRUCT 0x00200000 | 104 | #define NAND_BBT_DYNAMICSTRUCT 0x00200000 |
105 | /* The bad block table does not OOB for marker */ | ||
106 | #define NAND_BBT_NO_OOB 0x00400000 | ||
105 | 107 | ||
106 | /* The maximum number of blocks to scan for a bbt */ | 108 | /* The maximum number of blocks to scan for a bbt */ |
107 | #define NAND_BBT_SCAN_MAXBLOCKS 4 | 109 | #define NAND_BBT_SCAN_MAXBLOCKS 4 |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index d2118b0eac9a..4dd0c2cd7659 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
@@ -289,6 +289,7 @@ struct cfi_private { | |||
289 | must be of the same type. */ | 289 | must be of the same type. */ |
290 | int mfr, id; | 290 | int mfr, id; |
291 | int numchips; | 291 | int numchips; |
292 | map_word sector_erase_cmd; | ||
292 | unsigned long chipshift; /* Because they're of the same type */ | 293 | unsigned long chipshift; /* Because they're of the same type */ |
293 | const char *im_name; /* inter_module name for cmdset_setup */ | 294 | const char *im_name; /* inter_module name for cmdset_setup */ |
294 | struct flchip chips[0]; /* per-chip data structure for each chip */ | 295 | struct flchip chips[0]; /* per-chip data structure for each chip */ |
diff --git a/include/linux/mtd/fsmc.h b/include/linux/mtd/fsmc.h new file mode 100644 index 000000000000..5d2556700ec2 --- /dev/null +++ b/include/linux/mtd/fsmc.h | |||
@@ -0,0 +1,181 @@ | |||
1 | /* | ||
2 | * incude/mtd/fsmc.h | ||
3 | * | ||
4 | * ST Microelectronics | ||
5 | * Flexible Static Memory Controller (FSMC) | ||
6 | * platform data interface and header file | ||
7 | * | ||
8 | * Copyright © 2010 ST Microelectronics | ||
9 | * Vipin Kumar <vipin.kumar@st.com> | ||
10 | * | ||
11 | * This file is licensed under the terms of the GNU General Public | ||
12 | * License version 2. This program is licensed "as is" without any | ||
13 | * warranty of any kind, whether express or implied. | ||
14 | */ | ||
15 | |||
16 | #ifndef __MTD_FSMC_H | ||
17 | #define __MTD_FSMC_H | ||
18 | |||
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/mtd/physmap.h> | ||
21 | #include <linux/types.h> | ||
22 | #include <linux/mtd/partitions.h> | ||
23 | #include <asm/param.h> | ||
24 | |||
25 | #define FSMC_NAND_BW8 1 | ||
26 | #define FSMC_NAND_BW16 2 | ||
27 | |||
28 | /* | ||
29 | * The placement of the Command Latch Enable (CLE) and | ||
30 | * Address Latch Enable (ALE) is twised around in the | ||
31 | * SPEAR310 implementation. | ||
32 | */ | ||
33 | #if defined(CONFIG_MACH_SPEAR310) | ||
34 | #define PLAT_NAND_CLE (1 << 17) | ||
35 | #define PLAT_NAND_ALE (1 << 16) | ||
36 | #else | ||
37 | #define PLAT_NAND_CLE (1 << 16) | ||
38 | #define PLAT_NAND_ALE (1 << 17) | ||
39 | #endif | ||
40 | |||
41 | #define FSMC_MAX_NOR_BANKS 4 | ||
42 | #define FSMC_MAX_NAND_BANKS 4 | ||
43 | |||
44 | #define FSMC_FLASH_WIDTH8 1 | ||
45 | #define FSMC_FLASH_WIDTH16 2 | ||
46 | |||
47 | struct fsmc_nor_bank_regs { | ||
48 | uint32_t ctrl; | ||
49 | uint32_t ctrl_tim; | ||
50 | }; | ||
51 | |||
52 | /* ctrl register definitions */ | ||
53 | #define BANK_ENABLE (1 << 0) | ||
54 | #define MUXED (1 << 1) | ||
55 | #define NOR_DEV (2 << 2) | ||
56 | #define WIDTH_8 (0 << 4) | ||
57 | #define WIDTH_16 (1 << 4) | ||
58 | #define RSTPWRDWN (1 << 6) | ||
59 | #define WPROT (1 << 7) | ||
60 | #define WRT_ENABLE (1 << 12) | ||
61 | #define WAIT_ENB (1 << 13) | ||
62 | |||
63 | /* ctrl_tim register definitions */ | ||
64 | |||
65 | struct fsms_nand_bank_regs { | ||
66 | uint32_t pc; | ||
67 | uint32_t sts; | ||
68 | uint32_t comm; | ||
69 | uint32_t attrib; | ||
70 | uint32_t ioata; | ||
71 | uint32_t ecc1; | ||
72 | uint32_t ecc2; | ||
73 | uint32_t ecc3; | ||
74 | }; | ||
75 | |||
76 | #define FSMC_NOR_REG_SIZE 0x40 | ||
77 | |||
78 | struct fsmc_regs { | ||
79 | struct fsmc_nor_bank_regs nor_bank_regs[FSMC_MAX_NOR_BANKS]; | ||
80 | uint8_t reserved_1[0x40 - 0x20]; | ||
81 | struct fsms_nand_bank_regs bank_regs[FSMC_MAX_NAND_BANKS]; | ||
82 | uint8_t reserved_2[0xfe0 - 0xc0]; | ||
83 | uint32_t peripid0; /* 0xfe0 */ | ||
84 | uint32_t peripid1; /* 0xfe4 */ | ||
85 | uint32_t peripid2; /* 0xfe8 */ | ||
86 | uint32_t peripid3; /* 0xfec */ | ||
87 | uint32_t pcellid0; /* 0xff0 */ | ||
88 | uint32_t pcellid1; /* 0xff4 */ | ||
89 | uint32_t pcellid2; /* 0xff8 */ | ||
90 | uint32_t pcellid3; /* 0xffc */ | ||
91 | }; | ||
92 | |||
93 | #define FSMC_BUSY_WAIT_TIMEOUT (1 * HZ) | ||
94 | |||
95 | /* pc register definitions */ | ||
96 | #define FSMC_RESET (1 << 0) | ||
97 | #define FSMC_WAITON (1 << 1) | ||
98 | #define FSMC_ENABLE (1 << 2) | ||
99 | #define FSMC_DEVTYPE_NAND (1 << 3) | ||
100 | #define FSMC_DEVWID_8 (0 << 4) | ||
101 | #define FSMC_DEVWID_16 (1 << 4) | ||
102 | #define FSMC_ECCEN (1 << 6) | ||
103 | #define FSMC_ECCPLEN_512 (0 << 7) | ||
104 | #define FSMC_ECCPLEN_256 (1 << 7) | ||
105 | #define FSMC_TCLR_1 (1 << 9) | ||
106 | #define FSMC_TAR_1 (1 << 13) | ||
107 | |||
108 | /* sts register definitions */ | ||
109 | #define FSMC_CODE_RDY (1 << 15) | ||
110 | |||
111 | /* comm register definitions */ | ||
112 | #define FSMC_TSET_0 (0 << 0) | ||
113 | #define FSMC_TWAIT_6 (6 << 8) | ||
114 | #define FSMC_THOLD_4 (4 << 16) | ||
115 | #define FSMC_THIZ_1 (1 << 24) | ||
116 | |||
117 | /* peripid2 register definitions */ | ||
118 | #define FSMC_REVISION_MSK (0xf) | ||
119 | #define FSMC_REVISION_SHFT (0x4) | ||
120 | |||
121 | #define FSMC_VER1 1 | ||
122 | #define FSMC_VER2 2 | ||
123 | #define FSMC_VER3 3 | ||
124 | #define FSMC_VER4 4 | ||
125 | #define FSMC_VER5 5 | ||
126 | #define FSMC_VER6 6 | ||
127 | #define FSMC_VER7 7 | ||
128 | #define FSMC_VER8 8 | ||
129 | |||
130 | static inline uint32_t get_fsmc_version(struct fsmc_regs *regs) | ||
131 | { | ||
132 | return (readl(®s->peripid2) >> FSMC_REVISION_SHFT) & | ||
133 | FSMC_REVISION_MSK; | ||
134 | } | ||
135 | |||
136 | /* | ||
137 | * There are 13 bytes of ecc for every 512 byte block in FSMC version 8 | ||
138 | * and it has to be read consecutively and immediately after the 512 | ||
139 | * byte data block for hardware to generate the error bit offsets | ||
140 | * Managing the ecc bytes in the following way is easier. This way is | ||
141 | * similar to oobfree structure maintained already in u-boot nand driver | ||
142 | */ | ||
143 | #define MAX_ECCPLACE_ENTRIES 32 | ||
144 | |||
145 | struct fsmc_nand_eccplace { | ||
146 | uint8_t offset; | ||
147 | uint8_t length; | ||
148 | }; | ||
149 | |||
150 | struct fsmc_eccplace { | ||
151 | struct fsmc_nand_eccplace eccplace[MAX_ECCPLACE_ENTRIES]; | ||
152 | }; | ||
153 | |||
154 | /** | ||
155 | * fsmc_nand_platform_data - platform specific NAND controller config | ||
156 | * @partitions: partition table for the platform, use a default fallback | ||
157 | * if this is NULL | ||
158 | * @nr_partitions: the number of partitions in the previous entry | ||
159 | * @options: different options for the driver | ||
160 | * @width: bus width | ||
161 | * @bank: default bank | ||
162 | * @select_bank: callback to select a certain bank, this is | ||
163 | * platform-specific. If the controller only supports one bank | ||
164 | * this may be set to NULL | ||
165 | */ | ||
166 | struct fsmc_nand_platform_data { | ||
167 | struct mtd_partition *partitions; | ||
168 | unsigned int nr_partitions; | ||
169 | unsigned int options; | ||
170 | unsigned int width; | ||
171 | unsigned int bank; | ||
172 | void (*select_bank)(uint32_t bank, uint32_t busw); | ||
173 | }; | ||
174 | |||
175 | extern int __init fsmc_nor_init(struct platform_device *pdev, | ||
176 | unsigned long base, uint32_t bank, uint32_t width); | ||
177 | extern void __init fsmc_init_board_info(struct platform_device *pdev, | ||
178 | struct mtd_partition *partitions, unsigned int nr_partitions, | ||
179 | unsigned int width); | ||
180 | |||
181 | #endif /* __MTD_FSMC_H */ | ||
diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h index 64ee53ce95a9..02cd5f9b79b8 100644 --- a/include/linux/mtd/inftl.h +++ b/include/linux/mtd/inftl.h | |||
@@ -37,14 +37,14 @@ struct INFTLrecord { | |||
37 | __u16 firstEUN; | 37 | __u16 firstEUN; |
38 | __u16 lastEUN; | 38 | __u16 lastEUN; |
39 | __u16 numfreeEUNs; | 39 | __u16 numfreeEUNs; |
40 | __u16 LastFreeEUN; /* To speed up finding a free EUN */ | 40 | __u16 LastFreeEUN; /* To speed up finding a free EUN */ |
41 | int head,sect,cyl; | 41 | int head,sect,cyl; |
42 | __u16 *PUtable; /* Physical Unit Table */ | 42 | __u16 *PUtable; /* Physical Unit Table */ |
43 | __u16 *VUtable; /* Virtual Unit Table */ | 43 | __u16 *VUtable; /* Virtual Unit Table */ |
44 | unsigned int nb_blocks; /* number of physical blocks */ | 44 | unsigned int nb_blocks; /* number of physical blocks */ |
45 | unsigned int nb_boot_blocks; /* number of blocks used by the bios */ | 45 | unsigned int nb_boot_blocks; /* number of blocks used by the bios */ |
46 | struct erase_info instr; | 46 | struct erase_info instr; |
47 | struct nand_ecclayout oobinfo; | 47 | struct nand_ecclayout oobinfo; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | int INFTL_mount(struct INFTLrecord *s); | 50 | int INFTL_mount(struct INFTLrecord *s); |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 8485e42a9b09..fe8d77ebec13 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -110,6 +110,21 @@ struct mtd_oob_ops { | |||
110 | uint8_t *oobbuf; | 110 | uint8_t *oobbuf; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | #define MTD_MAX_OOBFREE_ENTRIES_LARGE 32 | ||
114 | #define MTD_MAX_ECCPOS_ENTRIES_LARGE 448 | ||
115 | /* | ||
116 | * Internal ECC layout control structure. For historical reasons, there is a | ||
117 | * similar, smaller struct nand_ecclayout_user (in mtd-abi.h) that is retained | ||
118 | * for export to user-space via the ECCGETLAYOUT ioctl. | ||
119 | * nand_ecclayout should be expandable in the future simply by the above macros. | ||
120 | */ | ||
121 | struct nand_ecclayout { | ||
122 | __u32 eccbytes; | ||
123 | __u32 eccpos[MTD_MAX_ECCPOS_ENTRIES_LARGE]; | ||
124 | __u32 oobavail; | ||
125 | struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES_LARGE]; | ||
126 | }; | ||
127 | |||
113 | struct mtd_info { | 128 | struct mtd_info { |
114 | u_char type; | 129 | u_char type; |
115 | uint32_t flags; | 130 | uint32_t flags; |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 102e12c58cb3..63e17d01fde9 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -27,15 +27,17 @@ | |||
27 | struct mtd_info; | 27 | struct mtd_info; |
28 | struct nand_flash_dev; | 28 | struct nand_flash_dev; |
29 | /* Scan and identify a NAND device */ | 29 | /* Scan and identify a NAND device */ |
30 | extern int nand_scan (struct mtd_info *mtd, int max_chips); | 30 | extern int nand_scan(struct mtd_info *mtd, int max_chips); |
31 | /* Separate phases of nand_scan(), allowing board driver to intervene | 31 | /* |
32 | * and override command or ECC setup according to flash type */ | 32 | * Separate phases of nand_scan(), allowing board driver to intervene |
33 | * and override command or ECC setup according to flash type. | ||
34 | */ | ||
33 | extern int nand_scan_ident(struct mtd_info *mtd, int max_chips, | 35 | extern int nand_scan_ident(struct mtd_info *mtd, int max_chips, |
34 | struct nand_flash_dev *table); | 36 | struct nand_flash_dev *table); |
35 | extern int nand_scan_tail(struct mtd_info *mtd); | 37 | extern int nand_scan_tail(struct mtd_info *mtd); |
36 | 38 | ||
37 | /* Free resources held by the NAND device */ | 39 | /* Free resources held by the NAND device */ |
38 | extern void nand_release (struct mtd_info *mtd); | 40 | extern void nand_release(struct mtd_info *mtd); |
39 | 41 | ||
40 | /* Internal helper for board drivers which need to override command function */ | 42 | /* Internal helper for board drivers which need to override command function */ |
41 | extern void nand_wait_ready(struct mtd_info *mtd); | 43 | extern void nand_wait_ready(struct mtd_info *mtd); |
@@ -49,12 +51,13 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len); | |||
49 | /* The maximum number of NAND chips in an array */ | 51 | /* The maximum number of NAND chips in an array */ |
50 | #define NAND_MAX_CHIPS 8 | 52 | #define NAND_MAX_CHIPS 8 |
51 | 53 | ||
52 | /* This constant declares the max. oobsize / page, which | 54 | /* |
55 | * This constant declares the max. oobsize / page, which | ||
53 | * is supported now. If you add a chip with bigger oobsize/page | 56 | * is supported now. If you add a chip with bigger oobsize/page |
54 | * adjust this accordingly. | 57 | * adjust this accordingly. |
55 | */ | 58 | */ |
56 | #define NAND_MAX_OOBSIZE 256 | 59 | #define NAND_MAX_OOBSIZE 576 |
57 | #define NAND_MAX_PAGESIZE 4096 | 60 | #define NAND_MAX_PAGESIZE 8192 |
58 | 61 | ||
59 | /* | 62 | /* |
60 | * Constants for hardware specific CLE/ALE/NCE function | 63 | * Constants for hardware specific CLE/ALE/NCE function |
@@ -88,6 +91,7 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len); | |||
88 | #define NAND_CMD_RNDIN 0x85 | 91 | #define NAND_CMD_RNDIN 0x85 |
89 | #define NAND_CMD_READID 0x90 | 92 | #define NAND_CMD_READID 0x90 |
90 | #define NAND_CMD_ERASE2 0xd0 | 93 | #define NAND_CMD_ERASE2 0xd0 |
94 | #define NAND_CMD_PARAM 0xec | ||
91 | #define NAND_CMD_RESET 0xff | 95 | #define NAND_CMD_RESET 0xff |
92 | 96 | ||
93 | #define NAND_CMD_LOCK 0x2a | 97 | #define NAND_CMD_LOCK 0x2a |
@@ -152,9 +156,10 @@ typedef enum { | |||
152 | #define NAND_GET_DEVICE 0x80 | 156 | #define NAND_GET_DEVICE 0x80 |
153 | 157 | ||
154 | 158 | ||
155 | /* Option constants for bizarre disfunctionality and real | 159 | /* |
156 | * features | 160 | * Option constants for bizarre disfunctionality and real |
157 | */ | 161 | * features. |
162 | */ | ||
158 | /* Chip can not auto increment pages */ | 163 | /* Chip can not auto increment pages */ |
159 | #define NAND_NO_AUTOINCR 0x00000001 | 164 | #define NAND_NO_AUTOINCR 0x00000001 |
160 | /* Buswitdh is 16 bit */ | 165 | /* Buswitdh is 16 bit */ |
@@ -165,19 +170,27 @@ typedef enum { | |||
165 | #define NAND_CACHEPRG 0x00000008 | 170 | #define NAND_CACHEPRG 0x00000008 |
166 | /* Chip has copy back function */ | 171 | /* Chip has copy back function */ |
167 | #define NAND_COPYBACK 0x00000010 | 172 | #define NAND_COPYBACK 0x00000010 |
168 | /* AND Chip which has 4 banks and a confusing page / block | 173 | /* |
169 | * assignment. See Renesas datasheet for further information */ | 174 | * AND Chip which has 4 banks and a confusing page / block |
175 | * assignment. See Renesas datasheet for further information. | ||
176 | */ | ||
170 | #define NAND_IS_AND 0x00000020 | 177 | #define NAND_IS_AND 0x00000020 |
171 | /* Chip has a array of 4 pages which can be read without | 178 | /* |
172 | * additional ready /busy waits */ | 179 | * Chip has a array of 4 pages which can be read without |
180 | * additional ready /busy waits. | ||
181 | */ | ||
173 | #define NAND_4PAGE_ARRAY 0x00000040 | 182 | #define NAND_4PAGE_ARRAY 0x00000040 |
174 | /* Chip requires that BBT is periodically rewritten to prevent | 183 | /* |
184 | * Chip requires that BBT is periodically rewritten to prevent | ||
175 | * bits from adjacent blocks from 'leaking' in altering data. | 185 | * bits from adjacent blocks from 'leaking' in altering data. |
176 | * This happens with the Renesas AG-AND chips, possibly others. */ | 186 | * This happens with the Renesas AG-AND chips, possibly others. |
187 | */ | ||
177 | #define BBT_AUTO_REFRESH 0x00000080 | 188 | #define BBT_AUTO_REFRESH 0x00000080 |
178 | /* Chip does not require ready check on read. True | 189 | /* |
190 | * Chip does not require ready check on read. True | ||
179 | * for all large page devices, as they do not support | 191 | * for all large page devices, as they do not support |
180 | * autoincrement.*/ | 192 | * autoincrement. |
193 | */ | ||
181 | #define NAND_NO_READRDY 0x00000100 | 194 | #define NAND_NO_READRDY 0x00000100 |
182 | /* Chip does not allow subpage writes */ | 195 | /* Chip does not allow subpage writes */ |
183 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 | 196 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 |
@@ -205,16 +218,27 @@ typedef enum { | |||
205 | #define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) | 218 | #define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) |
206 | 219 | ||
207 | /* Non chip related options */ | 220 | /* Non chip related options */ |
208 | /* Use a flash based bad block table. This option is passed to the | 221 | /* |
209 | * default bad block table function. */ | 222 | * Use a flash based bad block table. OOB identifier is saved in OOB area. |
223 | * This option is passed to the default bad block table function. | ||
224 | */ | ||
210 | #define NAND_USE_FLASH_BBT 0x00010000 | 225 | #define NAND_USE_FLASH_BBT 0x00010000 |
211 | /* This option skips the bbt scan during initialization. */ | 226 | /* This option skips the bbt scan during initialization. */ |
212 | #define NAND_SKIP_BBTSCAN 0x00020000 | 227 | #define NAND_SKIP_BBTSCAN 0x00020000 |
213 | /* This option is defined if the board driver allocates its own buffers | 228 | /* |
214 | (e.g. because it needs them DMA-coherent */ | 229 | * This option is defined if the board driver allocates its own buffers |
230 | * (e.g. because it needs them DMA-coherent). | ||
231 | */ | ||
215 | #define NAND_OWN_BUFFERS 0x00040000 | 232 | #define NAND_OWN_BUFFERS 0x00040000 |
216 | /* Chip may not exist, so silence any errors in scan */ | 233 | /* Chip may not exist, so silence any errors in scan */ |
217 | #define NAND_SCAN_SILENT_NODEV 0x00080000 | 234 | #define NAND_SCAN_SILENT_NODEV 0x00080000 |
235 | /* | ||
236 | * If passed additionally to NAND_USE_FLASH_BBT then BBT code will not touch | ||
237 | * the OOB area. | ||
238 | */ | ||
239 | #define NAND_USE_FLASH_BBT_NO_OOB 0x00100000 | ||
240 | /* Create an empty BBT with no vendor information if the BBT is available */ | ||
241 | #define NAND_CREATE_EMPTY_BBT 0x00200000 | ||
218 | 242 | ||
219 | /* Options set by nand scan */ | 243 | /* Options set by nand scan */ |
220 | /* Nand scan has allocated controller struct */ | 244 | /* Nand scan has allocated controller struct */ |
@@ -227,15 +251,80 @@ typedef enum { | |||
227 | /* Keep gcc happy */ | 251 | /* Keep gcc happy */ |
228 | struct nand_chip; | 252 | struct nand_chip; |
229 | 253 | ||
254 | struct nand_onfi_params { | ||
255 | /* rev info and features block */ | ||
256 | /* 'O' 'N' 'F' 'I' */ | ||
257 | u8 sig[4]; | ||
258 | __le16 revision; | ||
259 | __le16 features; | ||
260 | __le16 opt_cmd; | ||
261 | u8 reserved[22]; | ||
262 | |||
263 | /* manufacturer information block */ | ||
264 | char manufacturer[12]; | ||
265 | char model[20]; | ||
266 | u8 jedec_id; | ||
267 | __le16 date_code; | ||
268 | u8 reserved2[13]; | ||
269 | |||
270 | /* memory organization block */ | ||
271 | __le32 byte_per_page; | ||
272 | __le16 spare_bytes_per_page; | ||
273 | __le32 data_bytes_per_ppage; | ||
274 | __le16 spare_bytes_per_ppage; | ||
275 | __le32 pages_per_block; | ||
276 | __le32 blocks_per_lun; | ||
277 | u8 lun_count; | ||
278 | u8 addr_cycles; | ||
279 | u8 bits_per_cell; | ||
280 | __le16 bb_per_lun; | ||
281 | __le16 block_endurance; | ||
282 | u8 guaranteed_good_blocks; | ||
283 | __le16 guaranteed_block_endurance; | ||
284 | u8 programs_per_page; | ||
285 | u8 ppage_attr; | ||
286 | u8 ecc_bits; | ||
287 | u8 interleaved_bits; | ||
288 | u8 interleaved_ops; | ||
289 | u8 reserved3[13]; | ||
290 | |||
291 | /* electrical parameter block */ | ||
292 | u8 io_pin_capacitance_max; | ||
293 | __le16 async_timing_mode; | ||
294 | __le16 program_cache_timing_mode; | ||
295 | __le16 t_prog; | ||
296 | __le16 t_bers; | ||
297 | __le16 t_r; | ||
298 | __le16 t_ccs; | ||
299 | __le16 src_sync_timing_mode; | ||
300 | __le16 src_ssync_features; | ||
301 | __le16 clk_pin_capacitance_typ; | ||
302 | __le16 io_pin_capacitance_typ; | ||
303 | __le16 input_pin_capacitance_typ; | ||
304 | u8 input_pin_capacitance_max; | ||
305 | u8 driver_strenght_support; | ||
306 | __le16 t_int_r; | ||
307 | __le16 t_ald; | ||
308 | u8 reserved4[7]; | ||
309 | |||
310 | /* vendor */ | ||
311 | u8 reserved5[90]; | ||
312 | |||
313 | __le16 crc; | ||
314 | } __attribute__((packed)); | ||
315 | |||
316 | #define ONFI_CRC_BASE 0x4F4E | ||
317 | |||
230 | /** | 318 | /** |
231 | * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices | 319 | * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices |
232 | * @lock: protection lock | 320 | * @lock: protection lock |
233 | * @active: the mtd device which holds the controller currently | 321 | * @active: the mtd device which holds the controller currently |
234 | * @wq: wait queue to sleep on if a NAND operation is in progress | 322 | * @wq: wait queue to sleep on if a NAND operation is in |
235 | * used instead of the per chip wait queue when a hw controller is available | 323 | * progress used instead of the per chip wait queue |
324 | * when a hw controller is available. | ||
236 | */ | 325 | */ |
237 | struct nand_hw_control { | 326 | struct nand_hw_control { |
238 | spinlock_t lock; | 327 | spinlock_t lock; |
239 | struct nand_chip *active; | 328 | struct nand_chip *active; |
240 | wait_queue_head_t wq; | 329 | wait_queue_head_t wq; |
241 | }; | 330 | }; |
@@ -256,51 +345,42 @@ struct nand_hw_control { | |||
256 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) | 345 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) |
257 | * @read_page_raw: function to read a raw page without ECC | 346 | * @read_page_raw: function to read a raw page without ECC |
258 | * @write_page_raw: function to write a raw page without ECC | 347 | * @write_page_raw: function to write a raw page without ECC |
259 | * @read_page: function to read a page according to the ecc generator requirements | 348 | * @read_page: function to read a page according to the ecc generator |
349 | * requirements. | ||
260 | * @read_subpage: function to read parts of the page covered by ECC. | 350 | * @read_subpage: function to read parts of the page covered by ECC. |
261 | * @write_page: function to write a page according to the ecc generator requirements | 351 | * @write_page: function to write a page according to the ecc generator |
352 | * requirements. | ||
262 | * @read_oob: function to read chip OOB data | 353 | * @read_oob: function to read chip OOB data |
263 | * @write_oob: function to write chip OOB data | 354 | * @write_oob: function to write chip OOB data |
264 | */ | 355 | */ |
265 | struct nand_ecc_ctrl { | 356 | struct nand_ecc_ctrl { |
266 | nand_ecc_modes_t mode; | 357 | nand_ecc_modes_t mode; |
267 | int steps; | 358 | int steps; |
268 | int size; | 359 | int size; |
269 | int bytes; | 360 | int bytes; |
270 | int total; | 361 | int total; |
271 | int prepad; | 362 | int prepad; |
272 | int postpad; | 363 | int postpad; |
273 | struct nand_ecclayout *layout; | 364 | struct nand_ecclayout *layout; |
274 | void (*hwctl)(struct mtd_info *mtd, int mode); | 365 | void (*hwctl)(struct mtd_info *mtd, int mode); |
275 | int (*calculate)(struct mtd_info *mtd, | 366 | int (*calculate)(struct mtd_info *mtd, const uint8_t *dat, |
276 | const uint8_t *dat, | 367 | uint8_t *ecc_code); |
277 | uint8_t *ecc_code); | 368 | int (*correct)(struct mtd_info *mtd, uint8_t *dat, uint8_t *read_ecc, |
278 | int (*correct)(struct mtd_info *mtd, uint8_t *dat, | 369 | uint8_t *calc_ecc); |
279 | uint8_t *read_ecc, | 370 | int (*read_page_raw)(struct mtd_info *mtd, struct nand_chip *chip, |
280 | uint8_t *calc_ecc); | 371 | uint8_t *buf, int page); |
281 | int (*read_page_raw)(struct mtd_info *mtd, | 372 | void (*write_page_raw)(struct mtd_info *mtd, struct nand_chip *chip, |
282 | struct nand_chip *chip, | 373 | const uint8_t *buf); |
283 | uint8_t *buf, int page); | 374 | int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip, |
284 | void (*write_page_raw)(struct mtd_info *mtd, | 375 | uint8_t *buf, int page); |
285 | struct nand_chip *chip, | 376 | int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip, |
286 | const uint8_t *buf); | 377 | uint32_t offs, uint32_t len, uint8_t *buf); |
287 | int (*read_page)(struct mtd_info *mtd, | 378 | void (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, |
288 | struct nand_chip *chip, | 379 | const uint8_t *buf); |
289 | uint8_t *buf, int page); | 380 | int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page, |
290 | int (*read_subpage)(struct mtd_info *mtd, | 381 | int sndcmd); |
291 | struct nand_chip *chip, | 382 | int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip, |
292 | uint32_t offs, uint32_t len, | 383 | int page); |
293 | uint8_t *buf); | ||
294 | void (*write_page)(struct mtd_info *mtd, | ||
295 | struct nand_chip *chip, | ||
296 | const uint8_t *buf); | ||
297 | int (*read_oob)(struct mtd_info *mtd, | ||
298 | struct nand_chip *chip, | ||
299 | int page, | ||
300 | int sndcmd); | ||
301 | int (*write_oob)(struct mtd_info *mtd, | ||
302 | struct nand_chip *chip, | ||
303 | int page); | ||
304 | }; | 384 | }; |
305 | 385 | ||
306 | /** | 386 | /** |
@@ -320,102 +400,132 @@ struct nand_buffers { | |||
320 | 400 | ||
321 | /** | 401 | /** |
322 | * struct nand_chip - NAND Private Flash Chip Data | 402 | * struct nand_chip - NAND Private Flash Chip Data |
323 | * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device | 403 | * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the |
324 | * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device | 404 | * flash device |
405 | * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the | ||
406 | * flash device. | ||
325 | * @read_byte: [REPLACEABLE] read one byte from the chip | 407 | * @read_byte: [REPLACEABLE] read one byte from the chip |
326 | * @read_word: [REPLACEABLE] read one word from the chip | 408 | * @read_word: [REPLACEABLE] read one word from the chip |
327 | * @write_buf: [REPLACEABLE] write data from the buffer to the chip | 409 | * @write_buf: [REPLACEABLE] write data from the buffer to the chip |
328 | * @read_buf: [REPLACEABLE] read data from the chip into the buffer | 410 | * @read_buf: [REPLACEABLE] read data from the chip into the buffer |
329 | * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data | 411 | * @verify_buf: [REPLACEABLE] verify buffer contents against the chip |
412 | * data. | ||
330 | * @select_chip: [REPLACEABLE] select chip nr | 413 | * @select_chip: [REPLACEABLE] select chip nr |
331 | * @block_bad: [REPLACEABLE] check, if the block is bad | 414 | * @block_bad: [REPLACEABLE] check, if the block is bad |
332 | * @block_markbad: [REPLACEABLE] mark the block bad | 415 | * @block_markbad: [REPLACEABLE] mark the block bad |
333 | * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific funtion for controlling | 416 | * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific funtion for controlling |
334 | * ALE/CLE/nCE. Also used to write command and address | 417 | * ALE/CLE/nCE. Also used to write command and address |
335 | * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line | 418 | * @init_size: [BOARDSPECIFIC] hardwarespecific funtion for setting |
336 | * If set to NULL no access to ready/busy is available and the ready/busy information | 419 | * mtd->oobsize, mtd->writesize and so on. |
337 | * is read from the chip status register | 420 | * @id_data contains the 8 bytes values of NAND_CMD_READID. |
338 | * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip | 421 | * Return with the bus width. |
339 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready | 422 | * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing |
423 | * device ready/busy line. If set to NULL no access to | ||
424 | * ready/busy is available and the ready/busy information | ||
425 | * is read from the chip status register. | ||
426 | * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing | ||
427 | * commands to the chip. | ||
428 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on | ||
429 | * ready. | ||
340 | * @ecc: [BOARDSPECIFIC] ecc control ctructure | 430 | * @ecc: [BOARDSPECIFIC] ecc control ctructure |
341 | * @buffers: buffer structure for read/write | 431 | * @buffers: buffer structure for read/write |
342 | * @hwcontrol: platform-specific hardware control structure | 432 | * @hwcontrol: platform-specific hardware control structure |
343 | * @ops: oob operation operands | 433 | * @ops: oob operation operands |
344 | * @erase_cmd: [INTERN] erase command write function, selectable due to AND support | 434 | * @erase_cmd: [INTERN] erase command write function, selectable due |
435 | * to AND support. | ||
345 | * @scan_bbt: [REPLACEABLE] function to scan bad block table | 436 | * @scan_bbt: [REPLACEABLE] function to scan bad block table |
346 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) | 437 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering |
438 | * data from array to read regs (tR). | ||
347 | * @state: [INTERN] the current state of the NAND device | 439 | * @state: [INTERN] the current state of the NAND device |
348 | * @oob_poi: poison value buffer | 440 | * @oob_poi: poison value buffer |
349 | * @page_shift: [INTERN] number of address bits in a page (column address bits) | 441 | * @page_shift: [INTERN] number of address bits in a page (column |
442 | * address bits). | ||
350 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock | 443 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock |
351 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry | 444 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry |
352 | * @chip_shift: [INTERN] number of address bits in one chip | 445 | * @chip_shift: [INTERN] number of address bits in one chip |
353 | * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about | 446 | * @options: [BOARDSPECIFIC] various chip options. They can partly |
354 | * special functionality. See the defines for further explanation | 447 | * be set to inform nand_scan about special functionality. |
355 | * @badblockpos: [INTERN] position of the bad block marker in the oob area | 448 | * See the defines for further explanation. |
449 | * @badblockpos: [INTERN] position of the bad block marker in the oob | ||
450 | * area. | ||
356 | * @cellinfo: [INTERN] MLC/multichip data from chip ident | 451 | * @cellinfo: [INTERN] MLC/multichip data from chip ident |
357 | * @numchips: [INTERN] number of physical chips | 452 | * @numchips: [INTERN] number of physical chips |
358 | * @chipsize: [INTERN] the size of one chip for multichip arrays | 453 | * @chipsize: [INTERN] the size of one chip for multichip arrays |
359 | * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 | 454 | * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 |
360 | * @pagebuf: [INTERN] holds the pagenumber which is currently in data_buf | 455 | * @pagebuf: [INTERN] holds the pagenumber which is currently in |
456 | * data_buf. | ||
361 | * @subpagesize: [INTERN] holds the subpagesize | 457 | * @subpagesize: [INTERN] holds the subpagesize |
458 | * @onfi_version: [INTERN] holds the chip ONFI version (BCD encoded), | ||
459 | * non 0 if ONFI supported. | ||
460 | * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is | ||
461 | * supported, 0 otherwise. | ||
362 | * @ecclayout: [REPLACEABLE] the default ecc placement scheme | 462 | * @ecclayout: [REPLACEABLE] the default ecc placement scheme |
363 | * @bbt: [INTERN] bad block table pointer | 463 | * @bbt: [INTERN] bad block table pointer |
364 | * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup | 464 | * @bbt_td: [REPLACEABLE] bad block table descriptor for flash |
465 | * lookup. | ||
365 | * @bbt_md: [REPLACEABLE] bad block table mirror descriptor | 466 | * @bbt_md: [REPLACEABLE] bad block table mirror descriptor |
366 | * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan | 467 | * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial |
367 | * @controller: [REPLACEABLE] a pointer to a hardware controller structure | 468 | * bad block scan. |
368 | * which is shared among multiple independend devices | 469 | * @controller: [REPLACEABLE] a pointer to a hardware controller |
470 | * structure which is shared among multiple independend | ||
471 | * devices. | ||
369 | * @priv: [OPTIONAL] pointer to private chip date | 472 | * @priv: [OPTIONAL] pointer to private chip date |
370 | * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks | 473 | * @errstat: [OPTIONAL] hardware specific function to perform |
371 | * (determine if errors are correctable) | 474 | * additional error status checks (determine if errors are |
475 | * correctable). | ||
372 | * @write_page: [REPLACEABLE] High-level page write function | 476 | * @write_page: [REPLACEABLE] High-level page write function |
373 | */ | 477 | */ |
374 | 478 | ||
375 | struct nand_chip { | 479 | struct nand_chip { |
376 | void __iomem *IO_ADDR_R; | 480 | void __iomem *IO_ADDR_R; |
377 | void __iomem *IO_ADDR_W; | 481 | void __iomem *IO_ADDR_W; |
378 | 482 | ||
379 | uint8_t (*read_byte)(struct mtd_info *mtd); | 483 | uint8_t (*read_byte)(struct mtd_info *mtd); |
380 | u16 (*read_word)(struct mtd_info *mtd); | 484 | u16 (*read_word)(struct mtd_info *mtd); |
381 | void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); | 485 | void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); |
382 | void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); | 486 | void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); |
383 | int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); | 487 | int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); |
384 | void (*select_chip)(struct mtd_info *mtd, int chip); | 488 | void (*select_chip)(struct mtd_info *mtd, int chip); |
385 | int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); | 489 | int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); |
386 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); | 490 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); |
387 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, | 491 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl); |
388 | unsigned int ctrl); | 492 | int (*init_size)(struct mtd_info *mtd, struct nand_chip *this, |
389 | int (*dev_ready)(struct mtd_info *mtd); | 493 | u8 *id_data); |
390 | void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr); | 494 | int (*dev_ready)(struct mtd_info *mtd); |
391 | int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this); | 495 | void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, |
392 | void (*erase_cmd)(struct mtd_info *mtd, int page); | 496 | int page_addr); |
393 | int (*scan_bbt)(struct mtd_info *mtd); | 497 | int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this); |
394 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); | 498 | void (*erase_cmd)(struct mtd_info *mtd, int page); |
395 | int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, | 499 | int (*scan_bbt)(struct mtd_info *mtd); |
396 | const uint8_t *buf, int page, int cached, int raw); | 500 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, |
397 | 501 | int status, int page); | |
398 | int chip_delay; | 502 | int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, |
399 | unsigned int options; | 503 | const uint8_t *buf, int page, int cached, int raw); |
400 | 504 | ||
401 | int page_shift; | 505 | int chip_delay; |
402 | int phys_erase_shift; | 506 | unsigned int options; |
403 | int bbt_erase_shift; | 507 | |
404 | int chip_shift; | 508 | int page_shift; |
405 | int numchips; | 509 | int phys_erase_shift; |
406 | uint64_t chipsize; | 510 | int bbt_erase_shift; |
407 | int pagemask; | 511 | int chip_shift; |
408 | int pagebuf; | 512 | int numchips; |
409 | int subpagesize; | 513 | uint64_t chipsize; |
410 | uint8_t cellinfo; | 514 | int pagemask; |
411 | int badblockpos; | 515 | int pagebuf; |
412 | int badblockbits; | 516 | int subpagesize; |
413 | 517 | uint8_t cellinfo; | |
414 | flstate_t state; | 518 | int badblockpos; |
415 | 519 | int badblockbits; | |
416 | uint8_t *oob_poi; | 520 | |
417 | struct nand_hw_control *controller; | 521 | int onfi_version; |
418 | struct nand_ecclayout *ecclayout; | 522 | struct nand_onfi_params onfi_params; |
523 | |||
524 | flstate_t state; | ||
525 | |||
526 | uint8_t *oob_poi; | ||
527 | struct nand_hw_control *controller; | ||
528 | struct nand_ecclayout *ecclayout; | ||
419 | 529 | ||
420 | struct nand_ecc_ctrl ecc; | 530 | struct nand_ecc_ctrl ecc; |
421 | struct nand_buffers *buffers; | 531 | struct nand_buffers *buffers; |
@@ -423,13 +533,13 @@ struct nand_chip { | |||
423 | 533 | ||
424 | struct mtd_oob_ops ops; | 534 | struct mtd_oob_ops ops; |
425 | 535 | ||
426 | uint8_t *bbt; | 536 | uint8_t *bbt; |
427 | struct nand_bbt_descr *bbt_td; | 537 | struct nand_bbt_descr *bbt_td; |
428 | struct nand_bbt_descr *bbt_md; | 538 | struct nand_bbt_descr *bbt_md; |
429 | 539 | ||
430 | struct nand_bbt_descr *badblock_pattern; | 540 | struct nand_bbt_descr *badblock_pattern; |
431 | 541 | ||
432 | void *priv; | 542 | void *priv; |
433 | }; | 543 | }; |
434 | 544 | ||
435 | /* | 545 | /* |
@@ -473,7 +583,7 @@ struct nand_flash_dev { | |||
473 | */ | 583 | */ |
474 | struct nand_manufacturers { | 584 | struct nand_manufacturers { |
475 | int id; | 585 | int id; |
476 | char * name; | 586 | char *name; |
477 | }; | 587 | }; |
478 | 588 | ||
479 | extern struct nand_flash_dev nand_flash_ids[]; | 589 | extern struct nand_flash_dev nand_flash_ids[]; |
@@ -486,7 +596,7 @@ extern int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt); | |||
486 | extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, | 596 | extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, |
487 | int allowbbt); | 597 | int allowbbt); |
488 | extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, | 598 | extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, |
489 | size_t * retlen, uint8_t * buf); | 599 | size_t *retlen, uint8_t *buf); |
490 | 600 | ||
491 | /** | 601 | /** |
492 | * struct platform_nand_chip - chip level device structure | 602 | * struct platform_nand_chip - chip level device structure |
@@ -502,17 +612,16 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
502 | * @priv: hardware controller specific settings | 612 | * @priv: hardware controller specific settings |
503 | */ | 613 | */ |
504 | struct platform_nand_chip { | 614 | struct platform_nand_chip { |
505 | int nr_chips; | 615 | int nr_chips; |
506 | int chip_offset; | 616 | int chip_offset; |
507 | int nr_partitions; | 617 | int nr_partitions; |
508 | struct mtd_partition *partitions; | 618 | struct mtd_partition *partitions; |
509 | struct nand_ecclayout *ecclayout; | 619 | struct nand_ecclayout *ecclayout; |
510 | int chip_delay; | 620 | int chip_delay; |
511 | unsigned int options; | 621 | unsigned int options; |
512 | const char **part_probe_types; | 622 | const char **part_probe_types; |
513 | void (*set_parts)(uint64_t size, | 623 | void (*set_parts)(uint64_t size, struct platform_nand_chip *chip); |
514 | struct platform_nand_chip *chip); | 624 | void *priv; |
515 | void *priv; | ||
516 | }; | 625 | }; |
517 | 626 | ||
518 | /* Keep gcc happy */ | 627 | /* Keep gcc happy */ |
@@ -534,18 +643,15 @@ struct platform_device; | |||
534 | * All fields are optional and depend on the hardware driver requirements | 643 | * All fields are optional and depend on the hardware driver requirements |
535 | */ | 644 | */ |
536 | struct platform_nand_ctrl { | 645 | struct platform_nand_ctrl { |
537 | int (*probe)(struct platform_device *pdev); | 646 | int (*probe)(struct platform_device *pdev); |
538 | void (*remove)(struct platform_device *pdev); | 647 | void (*remove)(struct platform_device *pdev); |
539 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); | 648 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); |
540 | int (*dev_ready)(struct mtd_info *mtd); | 649 | int (*dev_ready)(struct mtd_info *mtd); |
541 | void (*select_chip)(struct mtd_info *mtd, int chip); | 650 | void (*select_chip)(struct mtd_info *mtd, int chip); |
542 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, | 651 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl); |
543 | unsigned int ctrl); | 652 | void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); |
544 | void (*write_buf)(struct mtd_info *mtd, | 653 | void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); |
545 | const uint8_t *buf, int len); | 654 | void *priv; |
546 | void (*read_buf)(struct mtd_info *mtd, | ||
547 | uint8_t *buf, int len); | ||
548 | void *priv; | ||
549 | }; | 655 | }; |
550 | 656 | ||
551 | /** | 657 | /** |
@@ -554,8 +660,8 @@ struct platform_nand_ctrl { | |||
554 | * @ctrl: controller level device structure | 660 | * @ctrl: controller level device structure |
555 | */ | 661 | */ |
556 | struct platform_nand_data { | 662 | struct platform_nand_data { |
557 | struct platform_nand_chip chip; | 663 | struct platform_nand_chip chip; |
558 | struct platform_nand_ctrl ctrl; | 664 | struct platform_nand_ctrl ctrl; |
559 | }; | 665 | }; |
560 | 666 | ||
561 | /* Some helpers to access the data structures */ | 667 | /* Some helpers to access the data structures */ |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 274b6196091d..2b54316591d2 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -39,7 +39,7 @@ struct mtd_partition { | |||
39 | uint64_t size; /* partition size */ | 39 | uint64_t size; /* partition size */ |
40 | uint64_t offset; /* offset within the master MTD space */ | 40 | uint64_t offset; /* offset within the master MTD space */ |
41 | uint32_t mask_flags; /* master MTD flags to mask out for this partition */ | 41 | uint32_t mask_flags; /* master MTD flags to mask out for this partition */ |
42 | struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/ | 42 | struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only) */ |
43 | }; | 43 | }; |
44 | 44 | ||
45 | #define MTDPART_OFS_NXTBLK (-2) | 45 | #define MTDPART_OFS_NXTBLK (-2) |
@@ -89,4 +89,9 @@ static inline int mtd_has_cmdlinepart(void) { return 1; } | |||
89 | static inline int mtd_has_cmdlinepart(void) { return 0; } | 89 | static inline int mtd_has_cmdlinepart(void) { return 0; } |
90 | #endif | 90 | #endif |
91 | 91 | ||
92 | int mtd_is_master(struct mtd_info *mtd); | ||
93 | int mtd_add_partition(struct mtd_info *master, char *name, | ||
94 | long long offset, long long length); | ||
95 | int mtd_del_partition(struct mtd_info *master, int partno); | ||
96 | |||
92 | #endif | 97 | #endif |
diff --git a/include/linux/mtd/super.h b/include/linux/mtd/super.h index 4016dd6fe336..f456230f9330 100644 --- a/include/linux/mtd/super.h +++ b/include/linux/mtd/super.h | |||
@@ -18,10 +18,9 @@ | |||
18 | #include <linux/fs.h> | 18 | #include <linux/fs.h> |
19 | #include <linux/mount.h> | 19 | #include <linux/mount.h> |
20 | 20 | ||
21 | extern int get_sb_mtd(struct file_system_type *fs_type, int flags, | 21 | extern struct dentry *mount_mtd(struct file_system_type *fs_type, int flags, |
22 | const char *dev_name, void *data, | 22 | const char *dev_name, void *data, |
23 | int (*fill_super)(struct super_block *, void *, int), | 23 | int (*fill_super)(struct super_block *, void *, int)); |
24 | struct vfsmount *mnt); | ||
25 | extern void kill_mtd_super(struct super_block *sb); | 24 | extern void kill_mtd_super(struct super_block *sb); |
26 | 25 | ||
27 | 26 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index fcd3dda86322..d8fd2c23a1b9 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -585,15 +585,15 @@ static inline void rps_reset_sock_flow(struct rps_sock_flow_table *table, | |||
585 | table->ents[hash & table->mask] = RPS_NO_CPU; | 585 | table->ents[hash & table->mask] = RPS_NO_CPU; |
586 | } | 586 | } |
587 | 587 | ||
588 | extern struct rps_sock_flow_table *rps_sock_flow_table; | 588 | extern struct rps_sock_flow_table __rcu *rps_sock_flow_table; |
589 | 589 | ||
590 | /* This structure contains an instance of an RX queue. */ | 590 | /* This structure contains an instance of an RX queue. */ |
591 | struct netdev_rx_queue { | 591 | struct netdev_rx_queue { |
592 | struct rps_map *rps_map; | 592 | struct rps_map __rcu *rps_map; |
593 | struct rps_dev_flow_table *rps_flow_table; | 593 | struct rps_dev_flow_table __rcu *rps_flow_table; |
594 | struct kobject kobj; | 594 | struct kobject kobj; |
595 | struct netdev_rx_queue *first; | 595 | struct netdev_rx_queue *first; |
596 | atomic_t count; | 596 | atomic_t count; |
597 | } ____cacheline_aligned_in_smp; | 597 | } ____cacheline_aligned_in_smp; |
598 | #endif /* CONFIG_RPS */ | 598 | #endif /* CONFIG_RPS */ |
599 | 599 | ||
@@ -944,7 +944,7 @@ struct net_device { | |||
944 | /* Protocol specific pointers */ | 944 | /* Protocol specific pointers */ |
945 | 945 | ||
946 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 946 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
947 | struct vlan_group *vlgrp; /* VLAN group */ | 947 | struct vlan_group __rcu *vlgrp; /* VLAN group */ |
948 | #endif | 948 | #endif |
949 | #ifdef CONFIG_NET_DSA | 949 | #ifdef CONFIG_NET_DSA |
950 | void *dsa_ptr; /* dsa specific data */ | 950 | void *dsa_ptr; /* dsa specific data */ |
@@ -952,7 +952,7 @@ struct net_device { | |||
952 | void *atalk_ptr; /* AppleTalk link */ | 952 | void *atalk_ptr; /* AppleTalk link */ |
953 | struct in_device __rcu *ip_ptr; /* IPv4 specific data */ | 953 | struct in_device __rcu *ip_ptr; /* IPv4 specific data */ |
954 | void *dn_ptr; /* DECnet specific data */ | 954 | void *dn_ptr; /* DECnet specific data */ |
955 | void *ip6_ptr; /* IPv6 specific data */ | 955 | struct inet6_dev __rcu *ip6_ptr; /* IPv6 specific data */ |
956 | void *ec_ptr; /* Econet specific data */ | 956 | void *ec_ptr; /* Econet specific data */ |
957 | void *ax25_ptr; /* AX.25 specific data */ | 957 | void *ax25_ptr; /* AX.25 specific data */ |
958 | struct wireless_dev *ieee80211_ptr; /* IEEE 802.11 specific data, | 958 | struct wireless_dev *ieee80211_ptr; /* IEEE 802.11 specific data, |
@@ -1072,7 +1072,7 @@ struct net_device { | |||
1072 | struct pcpu_dstats __percpu *dstats; /* dummy stats */ | 1072 | struct pcpu_dstats __percpu *dstats; /* dummy stats */ |
1073 | }; | 1073 | }; |
1074 | /* GARP */ | 1074 | /* GARP */ |
1075 | struct garp_port *garp_port; | 1075 | struct garp_port __rcu *garp_port; |
1076 | 1076 | ||
1077 | /* class/net/name entry */ | 1077 | /* class/net/name entry */ |
1078 | struct device dev; | 1078 | struct device dev; |
@@ -1554,6 +1554,11 @@ static inline void netif_tx_wake_all_queues(struct net_device *dev) | |||
1554 | 1554 | ||
1555 | static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue) | 1555 | static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue) |
1556 | { | 1556 | { |
1557 | if (WARN_ON(!dev_queue)) { | ||
1558 | printk(KERN_INFO "netif_stop_queue() cannot be called before " | ||
1559 | "register_netdev()"); | ||
1560 | return; | ||
1561 | } | ||
1557 | set_bit(__QUEUE_STATE_XOFF, &dev_queue->state); | 1562 | set_bit(__QUEUE_STATE_XOFF, &dev_queue->state); |
1558 | } | 1563 | } |
1559 | 1564 | ||
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 89341c32631a..03317c8d4077 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -215,7 +215,7 @@ NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sk_buff *skb, | |||
215 | int ret; | 215 | int ret; |
216 | 216 | ||
217 | if (!cond || | 217 | if (!cond || |
218 | (ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN) == 1)) | 218 | ((ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN)) == 1)) |
219 | ret = okfn(skb); | 219 | ret = okfn(skb); |
220 | return ret; | 220 | return ret; |
221 | } | 221 | } |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 123566912d73..e2b9e63afa68 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -70,7 +70,7 @@ struct nlmsghdr { | |||
70 | Check NLM_F_EXCL | 70 | Check NLM_F_EXCL |
71 | */ | 71 | */ |
72 | 72 | ||
73 | #define NLMSG_ALIGNTO 4 | 73 | #define NLMSG_ALIGNTO 4U |
74 | #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) | 74 | #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) |
75 | #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) | 75 | #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) |
76 | #define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN)) | 76 | #define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN)) |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index bba26684acdc..29d504d5d1c3 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -401,6 +401,7 @@ extern const struct inode_operations nfs3_file_inode_operations; | |||
401 | #endif /* CONFIG_NFS_V3 */ | 401 | #endif /* CONFIG_NFS_V3 */ |
402 | extern const struct file_operations nfs_file_operations; | 402 | extern const struct file_operations nfs_file_operations; |
403 | extern const struct address_space_operations nfs_file_aops; | 403 | extern const struct address_space_operations nfs_file_aops; |
404 | extern const struct address_space_operations nfs_dir_aops; | ||
404 | 405 | ||
405 | static inline struct nfs_open_context *nfs_file_open_context(struct file *filp) | 406 | static inline struct nfs_open_context *nfs_file_open_context(struct file *filp) |
406 | { | 407 | { |
@@ -593,12 +594,6 @@ nfs_fileid_to_ino_t(u64 fileid) | |||
593 | return ino; | 594 | return ino; |
594 | } | 595 | } |
595 | 596 | ||
596 | #define nfs_wait_event(clnt, wq, condition) \ | ||
597 | ({ \ | ||
598 | int __retval = wait_event_killable(wq, condition); \ | ||
599 | __retval; \ | ||
600 | }) | ||
601 | |||
602 | #define NFS_JUKEBOX_RETRY_TIME (5 * HZ) | 597 | #define NFS_JUKEBOX_RETRY_TIME (5 * HZ) |
603 | 598 | ||
604 | #endif /* __KERNEL__ */ | 599 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index f8b60e7f4c44..d55cee73f634 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
@@ -29,6 +29,7 @@ | |||
29 | */ | 29 | */ |
30 | enum { | 30 | enum { |
31 | PG_BUSY = 0, | 31 | PG_BUSY = 0, |
32 | PG_MAPPED, | ||
32 | PG_CLEAN, | 33 | PG_CLEAN, |
33 | PG_NEED_COMMIT, | 34 | PG_NEED_COMMIT, |
34 | PG_NEED_RESCHED, | 35 | PG_NEED_RESCHED, |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index ba6cc8f223c9..80f07198a31a 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -483,6 +483,7 @@ struct nfs_entry { | |||
483 | int eof; | 483 | int eof; |
484 | struct nfs_fh * fh; | 484 | struct nfs_fh * fh; |
485 | struct nfs_fattr * fattr; | 485 | struct nfs_fattr * fattr; |
486 | unsigned char d_type; | ||
486 | }; | 487 | }; |
487 | 488 | ||
488 | /* | 489 | /* |
diff --git a/include/linux/node.h b/include/linux/node.h index 06292dac3eab..1466945cc9ef 100644 --- a/include/linux/node.h +++ b/include/linux/node.h | |||
@@ -10,11 +10,6 @@ | |||
10 | * | 10 | * |
11 | * Nodes are exported via driverfs in the class/node/devices/ | 11 | * Nodes are exported via driverfs in the class/node/devices/ |
12 | * directory. | 12 | * directory. |
13 | * | ||
14 | * Per-node interfaces can be implemented using a struct device_interface. | ||
15 | * See the following for how to do this: | ||
16 | * - drivers/base/intf.c | ||
17 | * - Documentation/driver-model/interface.txt | ||
18 | */ | 13 | */ |
19 | #ifndef _LINUX_NODE_H_ | 14 | #ifndef _LINUX_NODE_H_ |
20 | #define _LINUX_NODE_H_ | 15 | #define _LINUX_NODE_H_ |
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 5bb13b3db84d..b02195dfc1b0 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -59,8 +59,6 @@ static inline void ClearPageCgroup##uname(struct page_cgroup *pc) \ | |||
59 | static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \ | 59 | static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \ |
60 | { return test_and_clear_bit(PCG_##lname, &pc->flags); } | 60 | { return test_and_clear_bit(PCG_##lname, &pc->flags); } |
61 | 61 | ||
62 | TESTPCGFLAG(Locked, LOCK) | ||
63 | |||
64 | /* Cache flag is set only once (at allocation) */ | 62 | /* Cache flag is set only once (at allocation) */ |
65 | TESTPCGFLAG(Cache, CACHE) | 63 | TESTPCGFLAG(Cache, CACHE) |
66 | CLEARPCGFLAG(Cache, CACHE) | 64 | CLEARPCGFLAG(Cache, CACHE) |
@@ -104,6 +102,11 @@ static inline void unlock_page_cgroup(struct page_cgroup *pc) | |||
104 | bit_spin_unlock(PCG_LOCK, &pc->flags); | 102 | bit_spin_unlock(PCG_LOCK, &pc->flags); |
105 | } | 103 | } |
106 | 104 | ||
105 | static inline int page_is_cgroup_locked(struct page_cgroup *pc) | ||
106 | { | ||
107 | return bit_spin_is_locked(PCG_LOCK, &pc->flags); | ||
108 | } | ||
109 | |||
107 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 110 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
108 | struct page_cgroup; | 111 | struct page_cgroup; |
109 | 112 | ||
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h index e8c06122be36..19ef95d293ae 100644 --- a/include/linux/pageblock-flags.h +++ b/include/linux/pageblock-flags.h | |||
@@ -67,7 +67,8 @@ void set_pageblock_flags_group(struct page *page, unsigned long flags, | |||
67 | 67 | ||
68 | #define get_pageblock_flags(page) \ | 68 | #define get_pageblock_flags(page) \ |
69 | get_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1) | 69 | get_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1) |
70 | #define set_pageblock_flags(page) \ | 70 | #define set_pageblock_flags(page, flags) \ |
71 | set_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1) | 71 | set_pageblock_flags_group(page, flags, \ |
72 | 0, NR_PAGEBLOCK_BITS-1) | ||
72 | 73 | ||
73 | #endif /* PAGEBLOCK_FLAGS_H */ | 74 | #endif /* PAGEBLOCK_FLAGS_H */ |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index e12cdc6d79ee..2d1ffe3cf1ee 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -299,6 +299,8 @@ static inline pgoff_t linear_page_index(struct vm_area_struct *vma, | |||
299 | extern void __lock_page(struct page *page); | 299 | extern void __lock_page(struct page *page); |
300 | extern int __lock_page_killable(struct page *page); | 300 | extern int __lock_page_killable(struct page *page); |
301 | extern void __lock_page_nosync(struct page *page); | 301 | extern void __lock_page_nosync(struct page *page); |
302 | extern int __lock_page_or_retry(struct page *page, struct mm_struct *mm, | ||
303 | unsigned int flags); | ||
302 | extern void unlock_page(struct page *page); | 304 | extern void unlock_page(struct page *page); |
303 | 305 | ||
304 | static inline void __set_page_locked(struct page *page) | 306 | static inline void __set_page_locked(struct page *page) |
@@ -351,6 +353,17 @@ static inline void lock_page_nosync(struct page *page) | |||
351 | } | 353 | } |
352 | 354 | ||
353 | /* | 355 | /* |
356 | * lock_page_or_retry - Lock the page, unless this would block and the | ||
357 | * caller indicated that it can handle a retry. | ||
358 | */ | ||
359 | static inline int lock_page_or_retry(struct page *page, struct mm_struct *mm, | ||
360 | unsigned int flags) | ||
361 | { | ||
362 | might_sleep(); | ||
363 | return trylock_page(page) || __lock_page_or_retry(page, mm, flags); | ||
364 | } | ||
365 | |||
366 | /* | ||
354 | * This is exported only for wait_on_page_locked/wait_on_page_writeback. | 367 | * This is exported only for wait_on_page_locked/wait_on_page_writeback. |
355 | * Never use this directly! | 368 | * Never use this directly! |
356 | */ | 369 | */ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index c8d95e369ff4..7454408c41b6 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -541,7 +541,7 @@ struct pci_error_handlers { | |||
541 | struct module; | 541 | struct module; |
542 | struct pci_driver { | 542 | struct pci_driver { |
543 | struct list_head node; | 543 | struct list_head node; |
544 | char *name; | 544 | const char *name; |
545 | const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */ | 545 | const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */ |
546 | int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ | 546 | int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ |
547 | void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ | 547 | void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ |
@@ -819,6 +819,9 @@ pci_power_t pci_target_state(struct pci_dev *dev); | |||
819 | int pci_prepare_to_sleep(struct pci_dev *dev); | 819 | int pci_prepare_to_sleep(struct pci_dev *dev); |
820 | int pci_back_from_sleep(struct pci_dev *dev); | 820 | int pci_back_from_sleep(struct pci_dev *dev); |
821 | bool pci_dev_run_wake(struct pci_dev *dev); | 821 | bool pci_dev_run_wake(struct pci_dev *dev); |
822 | bool pci_check_pme_status(struct pci_dev *dev); | ||
823 | void pci_wakeup_event(struct pci_dev *dev); | ||
824 | void pci_pme_wakeup_bus(struct pci_bus *bus); | ||
822 | 825 | ||
823 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | 826 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
824 | bool enable) | 827 | bool enable) |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index b4c3d1b50037..cb845c16ad7d 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -767,6 +767,8 @@ | |||
767 | #define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000 | 767 | #define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000 |
768 | #define PCI_DEVICE_ID_ELSA_QS3000 0x3000 | 768 | #define PCI_DEVICE_ID_ELSA_QS3000 0x3000 |
769 | 769 | ||
770 | #define PCI_VENDOR_ID_STMICRO 0x104A | ||
771 | |||
770 | #define PCI_VENDOR_ID_BUSLOGIC 0x104B | 772 | #define PCI_VENDOR_ID_BUSLOGIC 0x104B |
771 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 | 773 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 |
772 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040 | 774 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040 |
@@ -1251,6 +1253,8 @@ | |||
1251 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348 | 1253 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348 |
1252 | #define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C | 1254 | #define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C |
1253 | #define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E | 1255 | #define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E |
1256 | #define PCI_DEVICE_ID_NVIDIA_MCP55_BRIDGE_V0 0x0360 | ||
1257 | #define PCI_DEVICE_ID_NVIDIA_MCP55_BRIDGE_V4 0x0364 | ||
1254 | #define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 | 1258 | #define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 |
1255 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7 | 1259 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7 |
1256 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SMBUS 0x03EB | 1260 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SMBUS 0x03EB |
@@ -2043,6 +2047,7 @@ | |||
2043 | #define PCI_DEVICE_ID_AFAVLAB_P030 0x2182 | 2047 | #define PCI_DEVICE_ID_AFAVLAB_P030 0x2182 |
2044 | #define PCI_SUBDEVICE_ID_AFAVLAB_P061 0x2150 | 2048 | #define PCI_SUBDEVICE_ID_AFAVLAB_P061 0x2150 |
2045 | 2049 | ||
2050 | #define PCI_VENDOR_ID_BCM_GVC 0x14a4 | ||
2046 | #define PCI_VENDOR_ID_BROADCOM 0x14e4 | 2051 | #define PCI_VENDOR_ID_BROADCOM 0x14e4 |
2047 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 | 2052 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 |
2048 | #define PCI_DEVICE_ID_TIGON3_5752M 0x1601 | 2053 | #define PCI_DEVICE_ID_TIGON3_5752M 0x1601 |
@@ -2430,6 +2435,14 @@ | |||
2430 | #define PCI_DEVICE_ID_INTEL_82375 0x0482 | 2435 | #define PCI_DEVICE_ID_INTEL_82375 0x0482 |
2431 | #define PCI_DEVICE_ID_INTEL_82424 0x0483 | 2436 | #define PCI_DEVICE_ID_INTEL_82424 0x0483 |
2432 | #define PCI_DEVICE_ID_INTEL_82378 0x0484 | 2437 | #define PCI_DEVICE_ID_INTEL_82378 0x0484 |
2438 | #define PCI_DEVICE_ID_INTEL_MRST_SD0 0x0807 | ||
2439 | #define PCI_DEVICE_ID_INTEL_MRST_SD1 0x0808 | ||
2440 | #define PCI_DEVICE_ID_INTEL_MFD_SD 0x0820 | ||
2441 | #define PCI_DEVICE_ID_INTEL_MFD_SDIO1 0x0821 | ||
2442 | #define PCI_DEVICE_ID_INTEL_MFD_SDIO2 0x0822 | ||
2443 | #define PCI_DEVICE_ID_INTEL_MFD_EMMC0 0x0823 | ||
2444 | #define PCI_DEVICE_ID_INTEL_MFD_EMMC1 0x0824 | ||
2445 | #define PCI_DEVICE_ID_INTEL_MRST_SD2 0x084F | ||
2433 | #define PCI_DEVICE_ID_INTEL_I960 0x0960 | 2446 | #define PCI_DEVICE_ID_INTEL_I960 0x0960 |
2434 | #define PCI_DEVICE_ID_INTEL_I960RM 0x0962 | 2447 | #define PCI_DEVICE_ID_INTEL_I960RM 0x0962 |
2435 | #define PCI_DEVICE_ID_INTEL_8257X_SOL 0x1062 | 2448 | #define PCI_DEVICE_ID_INTEL_8257X_SOL 0x1062 |
@@ -2451,9 +2464,11 @@ | |||
2451 | #define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 | 2464 | #define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 |
2452 | #define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 | 2465 | #define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 |
2453 | #define PCI_DEVICE_ID_INTEL_IOAT 0x1a38 | 2466 | #define PCI_DEVICE_ID_INTEL_IOAT 0x1a38 |
2454 | #define PCI_DEVICE_ID_INTEL_CPT_SMBUS 0x1c22 | 2467 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22 |
2455 | #define PCI_DEVICE_ID_INTEL_CPT_LPC_MIN 0x1c41 | 2468 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN 0x1c41 |
2456 | #define PCI_DEVICE_ID_INTEL_CPT_LPC_MAX 0x1c5f | 2469 | #define PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX 0x1c5f |
2470 | #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 | ||
2471 | #define PCI_DEVICE_ID_INTEL_PATSBURG_LPC 0x1d40 | ||
2457 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 | 2472 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 |
2458 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 | 2473 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 |
2459 | #define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 | 2474 | #define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 |
@@ -2662,9 +2677,9 @@ | |||
2662 | #define PCI_DEVICE_ID_INTEL_ICH10_3 0x3a1a | 2677 | #define PCI_DEVICE_ID_INTEL_ICH10_3 0x3a1a |
2663 | #define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30 | 2678 | #define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30 |
2664 | #define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 | 2679 | #define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 |
2665 | #define PCI_DEVICE_ID_INTEL_PCH_LPC_MIN 0x3b00 | 2680 | #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MIN 0x3b00 |
2666 | #define PCI_DEVICE_ID_INTEL_PCH_LPC_MAX 0x3b1f | 2681 | #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MAX 0x3b1f |
2667 | #define PCI_DEVICE_ID_INTEL_PCH_SMBUS 0x3b30 | 2682 | #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS 0x3b30 |
2668 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f | 2683 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f |
2669 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 | 2684 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 |
2670 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 | 2685 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 |
@@ -2673,8 +2688,8 @@ | |||
2673 | #define PCI_DEVICE_ID_INTEL_5400_FBD0 0x4035 | 2688 | #define PCI_DEVICE_ID_INTEL_5400_FBD0 0x4035 |
2674 | #define PCI_DEVICE_ID_INTEL_5400_FBD1 0x4036 | 2689 | #define PCI_DEVICE_ID_INTEL_5400_FBD1 0x4036 |
2675 | #define PCI_DEVICE_ID_INTEL_IOAT_SCNB 0x65ff | 2690 | #define PCI_DEVICE_ID_INTEL_IOAT_SCNB 0x65ff |
2676 | #define PCI_DEVICE_ID_INTEL_TOLAPAI_0 0x5031 | 2691 | #define PCI_DEVICE_ID_INTEL_EP80579_0 0x5031 |
2677 | #define PCI_DEVICE_ID_INTEL_TOLAPAI_1 0x5032 | 2692 | #define PCI_DEVICE_ID_INTEL_EP80579_1 0x5032 |
2678 | #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 | 2693 | #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 |
2679 | #define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 | 2694 | #define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 |
2680 | #define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 | 2695 | #define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 455b9ccdfca7..af83076c31a6 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -300,12 +300,14 @@ | |||
300 | #define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ | 300 | #define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ |
301 | #define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */ | 301 | #define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */ |
302 | 302 | ||
303 | /* MSI-X registers (these are at offset PCI_MSIX_FLAGS) */ | 303 | /* MSI-X registers */ |
304 | #define PCI_MSIX_FLAGS 2 | 304 | #define PCI_MSIX_FLAGS 2 |
305 | #define PCI_MSIX_FLAGS_QSIZE 0x7FF | 305 | #define PCI_MSIX_FLAGS_QSIZE 0x7FF |
306 | #define PCI_MSIX_FLAGS_ENABLE (1 << 15) | 306 | #define PCI_MSIX_FLAGS_ENABLE (1 << 15) |
307 | #define PCI_MSIX_FLAGS_MASKALL (1 << 14) | 307 | #define PCI_MSIX_FLAGS_MASKALL (1 << 14) |
308 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) | 308 | #define PCI_MSIX_TABLE 4 |
309 | #define PCI_MSIX_PBA 8 | ||
310 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) | ||
309 | 311 | ||
310 | /* CompactPCI Hotswap Register */ | 312 | /* CompactPCI Hotswap Register */ |
311 | 313 | ||
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 018db9a62ffe..27ef6b190ea6 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
@@ -148,18 +148,6 @@ | |||
148 | DEFINE_PER_CPU_SECTION(type, name, "..readmostly") | 148 | DEFINE_PER_CPU_SECTION(type, name, "..readmostly") |
149 | 149 | ||
150 | /* | 150 | /* |
151 | * Declaration/definition used for large per-CPU variables that must be | ||
152 | * aligned to something larger than the pagesize. | ||
153 | */ | ||
154 | #define DECLARE_PER_CPU_MULTIPAGE_ALIGNED(type, name, size) \ | ||
155 | DECLARE_PER_CPU_SECTION(type, name, "..page_aligned") \ | ||
156 | __aligned(size) | ||
157 | |||
158 | #define DEFINE_PER_CPU_MULTIPAGE_ALIGNED(type, name, size) \ | ||
159 | DEFINE_PER_CPU_SECTION(type, name, "..page_aligned") \ | ||
160 | __aligned(size) | ||
161 | |||
162 | /* | ||
163 | * Intermodule exports for per-CPU variables. sparse forgets about | 151 | * Intermodule exports for per-CPU variables. sparse forgets about |
164 | * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to | 152 | * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to |
165 | * noop if __CHECKER__. | 153 | * noop if __CHECKER__. |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index 8a7d510ffa9c..46f6ba56fa91 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
@@ -78,6 +78,11 @@ static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) | |||
78 | return 1; | 78 | return 1; |
79 | } | 79 | } |
80 | 80 | ||
81 | static inline int percpu_counter_initialized(struct percpu_counter *fbc) | ||
82 | { | ||
83 | return (fbc->counters != NULL); | ||
84 | } | ||
85 | |||
81 | #else | 86 | #else |
82 | 87 | ||
83 | struct percpu_counter { | 88 | struct percpu_counter { |
@@ -143,6 +148,11 @@ static inline s64 percpu_counter_sum(struct percpu_counter *fbc) | |||
143 | return percpu_counter_read(fbc); | 148 | return percpu_counter_read(fbc); |
144 | } | 149 | } |
145 | 150 | ||
151 | static inline int percpu_counter_initialized(struct percpu_counter *fbc) | ||
152 | { | ||
153 | return 1; | ||
154 | } | ||
155 | |||
146 | #endif /* CONFIG_SMP */ | 156 | #endif /* CONFIG_SMP */ |
147 | 157 | ||
148 | static inline void percpu_counter_inc(struct percpu_counter *fbc) | 158 | static inline void percpu_counter_inc(struct percpu_counter *fbc) |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 057bf22a8323..4f1279e105ee 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -747,6 +747,16 @@ struct perf_event { | |||
747 | u64 tstamp_running; | 747 | u64 tstamp_running; |
748 | u64 tstamp_stopped; | 748 | u64 tstamp_stopped; |
749 | 749 | ||
750 | /* | ||
751 | * timestamp shadows the actual context timing but it can | ||
752 | * be safely used in NMI interrupt context. It reflects the | ||
753 | * context time as it was when the event was last scheduled in. | ||
754 | * | ||
755 | * ctx_time already accounts for ctx->timestamp. Therefore to | ||
756 | * compute ctx_time for a sample, simply add perf_clock(). | ||
757 | */ | ||
758 | u64 shadow_ctx_time; | ||
759 | |||
750 | struct perf_event_attr attr; | 760 | struct perf_event_attr attr; |
751 | struct hw_perf_event hw; | 761 | struct hw_perf_event hw; |
752 | 762 | ||
@@ -840,6 +850,7 @@ struct perf_event_context { | |||
840 | int nr_active; | 850 | int nr_active; |
841 | int is_active; | 851 | int is_active; |
842 | int nr_stat; | 852 | int nr_stat; |
853 | int rotate_disable; | ||
843 | atomic_t refcount; | 854 | atomic_t refcount; |
844 | struct task_struct *task; | 855 | struct task_struct *task; |
845 | 856 | ||
@@ -876,6 +887,7 @@ struct perf_cpu_context { | |||
876 | int exclusive; | 887 | int exclusive; |
877 | struct list_head rotation_list; | 888 | struct list_head rotation_list; |
878 | int jiffies_interval; | 889 | int jiffies_interval; |
890 | struct pmu *active_pmu; | ||
879 | }; | 891 | }; |
880 | 892 | ||
881 | struct perf_output_handle { | 893 | struct perf_output_handle { |
@@ -898,20 +910,6 @@ extern int perf_num_counters(void); | |||
898 | extern const char *perf_pmu_name(void); | 910 | extern const char *perf_pmu_name(void); |
899 | extern void __perf_event_task_sched_in(struct task_struct *task); | 911 | extern void __perf_event_task_sched_in(struct task_struct *task); |
900 | extern void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); | 912 | extern void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); |
901 | |||
902 | extern atomic_t perf_task_events; | ||
903 | |||
904 | static inline void perf_event_task_sched_in(struct task_struct *task) | ||
905 | { | ||
906 | COND_STMT(&perf_task_events, __perf_event_task_sched_in(task)); | ||
907 | } | ||
908 | |||
909 | static inline | ||
910 | void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) | ||
911 | { | ||
912 | COND_STMT(&perf_task_events, __perf_event_task_sched_out(task, next)); | ||
913 | } | ||
914 | |||
915 | extern int perf_event_init_task(struct task_struct *child); | 913 | extern int perf_event_init_task(struct task_struct *child); |
916 | extern void perf_event_exit_task(struct task_struct *child); | 914 | extern void perf_event_exit_task(struct task_struct *child); |
917 | extern void perf_event_free_task(struct task_struct *task); | 915 | extern void perf_event_free_task(struct task_struct *task); |
@@ -1020,6 +1018,21 @@ have_event: | |||
1020 | __perf_sw_event(event_id, nr, nmi, regs, addr); | 1018 | __perf_sw_event(event_id, nr, nmi, regs, addr); |
1021 | } | 1019 | } |
1022 | 1020 | ||
1021 | extern atomic_t perf_task_events; | ||
1022 | |||
1023 | static inline void perf_event_task_sched_in(struct task_struct *task) | ||
1024 | { | ||
1025 | COND_STMT(&perf_task_events, __perf_event_task_sched_in(task)); | ||
1026 | } | ||
1027 | |||
1028 | static inline | ||
1029 | void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) | ||
1030 | { | ||
1031 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0); | ||
1032 | |||
1033 | COND_STMT(&perf_task_events, __perf_event_task_sched_out(task, next)); | ||
1034 | } | ||
1035 | |||
1023 | extern void perf_event_mmap(struct vm_area_struct *vma); | 1036 | extern void perf_event_mmap(struct vm_area_struct *vma); |
1024 | extern struct perf_guest_info_callbacks *perf_guest_cbs; | 1037 | extern struct perf_guest_info_callbacks *perf_guest_cbs; |
1025 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | 1038 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |
diff --git a/include/linux/phy.h b/include/linux/phy.h index a6e047a04f79..7da5fa845959 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -472,11 +472,7 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val) | |||
472 | int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); | 472 | int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); |
473 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | 473 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); |
474 | int phy_device_register(struct phy_device *phy); | 474 | int phy_device_register(struct phy_device *phy); |
475 | int phy_clear_interrupt(struct phy_device *phydev); | ||
476 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); | ||
477 | int phy_init_hw(struct phy_device *phydev); | 475 | int phy_init_hw(struct phy_device *phydev); |
478 | int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | ||
479 | u32 flags, phy_interface_t interface); | ||
480 | struct phy_device * phy_attach(struct net_device *dev, | 476 | struct phy_device * phy_attach(struct net_device *dev, |
481 | const char *bus_id, u32 flags, phy_interface_t interface); | 477 | const char *bus_id, u32 flags, phy_interface_t interface); |
482 | struct phy_device *phy_find_first(struct mii_bus *bus); | 478 | struct phy_device *phy_find_first(struct mii_bus *bus); |
@@ -492,17 +488,12 @@ void phy_start(struct phy_device *phydev); | |||
492 | void phy_stop(struct phy_device *phydev); | 488 | void phy_stop(struct phy_device *phydev); |
493 | int phy_start_aneg(struct phy_device *phydev); | 489 | int phy_start_aneg(struct phy_device *phydev); |
494 | 490 | ||
495 | void phy_sanitize_settings(struct phy_device *phydev); | ||
496 | int phy_stop_interrupts(struct phy_device *phydev); | 491 | int phy_stop_interrupts(struct phy_device *phydev); |
497 | int phy_enable_interrupts(struct phy_device *phydev); | ||
498 | int phy_disable_interrupts(struct phy_device *phydev); | ||
499 | 492 | ||
500 | static inline int phy_read_status(struct phy_device *phydev) { | 493 | static inline int phy_read_status(struct phy_device *phydev) { |
501 | return phydev->drv->read_status(phydev); | 494 | return phydev->drv->read_status(phydev); |
502 | } | 495 | } |
503 | 496 | ||
504 | int genphy_config_advert(struct phy_device *phydev); | ||
505 | int genphy_setup_forced(struct phy_device *phydev); | ||
506 | int genphy_restart_aneg(struct phy_device *phydev); | 497 | int genphy_restart_aneg(struct phy_device *phydev); |
507 | int genphy_config_aneg(struct phy_device *phydev); | 498 | int genphy_config_aneg(struct phy_device *phydev); |
508 | int genphy_update_link(struct phy_device *phydev); | 499 | int genphy_update_link(struct phy_device *phydev); |
@@ -511,8 +502,6 @@ int genphy_suspend(struct phy_device *phydev); | |||
511 | int genphy_resume(struct phy_device *phydev); | 502 | int genphy_resume(struct phy_device *phydev); |
512 | void phy_driver_unregister(struct phy_driver *drv); | 503 | void phy_driver_unregister(struct phy_driver *drv); |
513 | int phy_driver_register(struct phy_driver *new_driver); | 504 | int phy_driver_register(struct phy_driver *new_driver); |
514 | void phy_prepare_link(struct phy_device *phydev, | ||
515 | void (*adjust_link)(struct net_device *)); | ||
516 | void phy_state_machine(struct work_struct *work); | 505 | void phy_state_machine(struct work_struct *work); |
517 | void phy_start_machine(struct phy_device *phydev, | 506 | void phy_start_machine(struct phy_device *phydev, |
518 | void (*handler)(struct net_device *)); | 507 | void (*handler)(struct net_device *)); |
@@ -523,7 +512,6 @@ int phy_mii_ioctl(struct phy_device *phydev, | |||
523 | struct ifreq *ifr, int cmd); | 512 | struct ifreq *ifr, int cmd); |
524 | int phy_start_interrupts(struct phy_device *phydev); | 513 | int phy_start_interrupts(struct phy_device *phydev); |
525 | void phy_print_status(struct phy_device *phydev); | 514 | void phy_print_status(struct phy_device *phydev); |
526 | struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id); | ||
527 | void phy_device_free(struct phy_device *phydev); | 515 | void phy_device_free(struct phy_device *phydev); |
528 | 516 | ||
529 | int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, | 517 | int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, |
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 445796945ac9..bb27d7ec2fb9 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
@@ -160,5 +160,6 @@ void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); | |||
160 | 160 | ||
161 | /* for F_SETPIPE_SZ and F_GETPIPE_SZ */ | 161 | /* for F_SETPIPE_SZ and F_GETPIPE_SZ */ |
162 | long pipe_fcntl(struct file *, unsigned int, unsigned long arg); | 162 | long pipe_fcntl(struct file *, unsigned int, unsigned long arg); |
163 | struct pipe_inode_info *get_pipe_info(struct file *file); | ||
163 | 164 | ||
164 | #endif | 165 | #endif |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 3ec2358f8692..d19f1cca7f74 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -77,7 +77,8 @@ static inline void device_set_run_wake(struct device *dev, bool enable) | |||
77 | 77 | ||
78 | static inline bool pm_runtime_suspended(struct device *dev) | 78 | static inline bool pm_runtime_suspended(struct device *dev) |
79 | { | 79 | { |
80 | return dev->power.runtime_status == RPM_SUSPENDED; | 80 | return dev->power.runtime_status == RPM_SUSPENDED |
81 | && !dev->power.disable_depth; | ||
81 | } | 82 | } |
82 | 83 | ||
83 | static inline void pm_runtime_mark_last_busy(struct device *dev) | 84 | static inline void pm_runtime_mark_last_busy(struct device *dev) |
diff --git a/include/linux/poll.h b/include/linux/poll.h index 600cc1fde64d..56e76af78102 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h | |||
@@ -73,6 +73,8 @@ extern void poll_initwait(struct poll_wqueues *pwq); | |||
73 | extern void poll_freewait(struct poll_wqueues *pwq); | 73 | extern void poll_freewait(struct poll_wqueues *pwq); |
74 | extern int poll_schedule_timeout(struct poll_wqueues *pwq, int state, | 74 | extern int poll_schedule_timeout(struct poll_wqueues *pwq, int state, |
75 | ktime_t *expires, unsigned long slack); | 75 | ktime_t *expires, unsigned long slack); |
76 | extern long select_estimate_accuracy(struct timespec *tv); | ||
77 | |||
76 | 78 | ||
77 | static inline int poll_schedule(struct poll_wqueues *pwq, int state) | 79 | static inline int poll_schedule(struct poll_wqueues *pwq, int state) |
78 | { | 80 | { |
diff --git a/include/linux/printk.h b/include/linux/printk.h new file mode 100644 index 000000000000..b772ca5fbdf0 --- /dev/null +++ b/include/linux/printk.h | |||
@@ -0,0 +1,248 @@ | |||
1 | #ifndef __KERNEL_PRINTK__ | ||
2 | #define __KERNEL_PRINTK__ | ||
3 | |||
4 | extern const char linux_banner[]; | ||
5 | extern const char linux_proc_banner[]; | ||
6 | |||
7 | #define KERN_EMERG "<0>" /* system is unusable */ | ||
8 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | ||
9 | #define KERN_CRIT "<2>" /* critical conditions */ | ||
10 | #define KERN_ERR "<3>" /* error conditions */ | ||
11 | #define KERN_WARNING "<4>" /* warning conditions */ | ||
12 | #define KERN_NOTICE "<5>" /* normal but significant condition */ | ||
13 | #define KERN_INFO "<6>" /* informational */ | ||
14 | #define KERN_DEBUG "<7>" /* debug-level messages */ | ||
15 | |||
16 | /* Use the default kernel loglevel */ | ||
17 | #define KERN_DEFAULT "<d>" | ||
18 | /* | ||
19 | * Annotation for a "continued" line of log printout (only done after a | ||
20 | * line that had no enclosing \n). Only to be used by core/arch code | ||
21 | * during early bootup (a continued line is not SMP-safe otherwise). | ||
22 | */ | ||
23 | #define KERN_CONT "<c>" | ||
24 | |||
25 | extern int console_printk[]; | ||
26 | |||
27 | #define console_loglevel (console_printk[0]) | ||
28 | #define default_message_loglevel (console_printk[1]) | ||
29 | #define minimum_console_loglevel (console_printk[2]) | ||
30 | #define default_console_loglevel (console_printk[3]) | ||
31 | |||
32 | struct va_format { | ||
33 | const char *fmt; | ||
34 | va_list *va; | ||
35 | }; | ||
36 | |||
37 | /* | ||
38 | * FW_BUG | ||
39 | * Add this to a message where you are sure the firmware is buggy or behaves | ||
40 | * really stupid or out of spec. Be aware that the responsible BIOS developer | ||
41 | * should be able to fix this issue or at least get a concrete idea of the | ||
42 | * problem by reading your message without the need of looking at the kernel | ||
43 | * code. | ||
44 | * | ||
45 | * Use it for definite and high priority BIOS bugs. | ||
46 | * | ||
47 | * FW_WARN | ||
48 | * Use it for not that clear (e.g. could the kernel messed up things already?) | ||
49 | * and medium priority BIOS bugs. | ||
50 | * | ||
51 | * FW_INFO | ||
52 | * Use this one if you want to tell the user or vendor about something | ||
53 | * suspicious, but generally harmless related to the firmware. | ||
54 | * | ||
55 | * Use it for information or very low priority BIOS bugs. | ||
56 | */ | ||
57 | #define FW_BUG "[Firmware Bug]: " | ||
58 | #define FW_WARN "[Firmware Warn]: " | ||
59 | #define FW_INFO "[Firmware Info]: " | ||
60 | |||
61 | /* | ||
62 | * HW_ERR | ||
63 | * Add this to a message for hardware errors, so that user can report | ||
64 | * it to hardware vendor instead of LKML or software vendor. | ||
65 | */ | ||
66 | #define HW_ERR "[Hardware Error]: " | ||
67 | |||
68 | #ifdef CONFIG_PRINTK | ||
69 | asmlinkage int vprintk(const char *fmt, va_list args) | ||
70 | __attribute__ ((format (printf, 1, 0))); | ||
71 | asmlinkage int printk(const char * fmt, ...) | ||
72 | __attribute__ ((format (printf, 1, 2))) __cold; | ||
73 | |||
74 | /* | ||
75 | * Please don't use printk_ratelimit(), because it shares ratelimiting state | ||
76 | * with all other unrelated printk_ratelimit() callsites. Instead use | ||
77 | * printk_ratelimited() or plain old __ratelimit(). | ||
78 | */ | ||
79 | extern int __printk_ratelimit(const char *func); | ||
80 | #define printk_ratelimit() __printk_ratelimit(__func__) | ||
81 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
82 | unsigned int interval_msec); | ||
83 | |||
84 | extern int printk_delay_msec; | ||
85 | extern int dmesg_restrict; | ||
86 | |||
87 | /* | ||
88 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
89 | */ | ||
90 | #define printk_once(x...) ({ \ | ||
91 | static bool __print_once; \ | ||
92 | \ | ||
93 | if (!__print_once) { \ | ||
94 | __print_once = true; \ | ||
95 | printk(x); \ | ||
96 | } \ | ||
97 | }) | ||
98 | |||
99 | void log_buf_kexec_setup(void); | ||
100 | #else | ||
101 | static inline int vprintk(const char *s, va_list args) | ||
102 | __attribute__ ((format (printf, 1, 0))); | ||
103 | static inline int vprintk(const char *s, va_list args) { return 0; } | ||
104 | static inline int printk(const char *s, ...) | ||
105 | __attribute__ ((format (printf, 1, 2))); | ||
106 | static inline int __cold printk(const char *s, ...) { return 0; } | ||
107 | static inline int printk_ratelimit(void) { return 0; } | ||
108 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
109 | unsigned int interval_msec) \ | ||
110 | { return false; } | ||
111 | |||
112 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
113 | #define printk_once(x...) printk(x) | ||
114 | |||
115 | static inline void log_buf_kexec_setup(void) | ||
116 | { | ||
117 | } | ||
118 | #endif | ||
119 | |||
120 | /* | ||
121 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
122 | * gcc's format and side-effect checking. | ||
123 | */ | ||
124 | static inline __attribute__ ((format (printf, 1, 2))) | ||
125 | int no_printk(const char *s, ...) { return 0; } | ||
126 | |||
127 | extern int printk_needs_cpu(int cpu); | ||
128 | extern void printk_tick(void); | ||
129 | |||
130 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | ||
131 | early_printk(const char *fmt, ...); | ||
132 | |||
133 | static inline void console_silent(void) | ||
134 | { | ||
135 | console_loglevel = 0; | ||
136 | } | ||
137 | |||
138 | static inline void console_verbose(void) | ||
139 | { | ||
140 | if (console_loglevel) | ||
141 | console_loglevel = 15; | ||
142 | } | ||
143 | |||
144 | extern void dump_stack(void) __cold; | ||
145 | |||
146 | enum { | ||
147 | DUMP_PREFIX_NONE, | ||
148 | DUMP_PREFIX_ADDRESS, | ||
149 | DUMP_PREFIX_OFFSET | ||
150 | }; | ||
151 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
152 | int rowsize, int groupsize, | ||
153 | char *linebuf, size_t linebuflen, bool ascii); | ||
154 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
155 | int prefix_type, int rowsize, int groupsize, | ||
156 | const void *buf, size_t len, bool ascii); | ||
157 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
158 | const void *buf, size_t len); | ||
159 | |||
160 | #ifndef pr_fmt | ||
161 | #define pr_fmt(fmt) fmt | ||
162 | #endif | ||
163 | |||
164 | #define pr_emerg(fmt, ...) \ | ||
165 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
166 | #define pr_alert(fmt, ...) \ | ||
167 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
168 | #define pr_crit(fmt, ...) \ | ||
169 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
170 | #define pr_err(fmt, ...) \ | ||
171 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
172 | #define pr_warning(fmt, ...) \ | ||
173 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
174 | #define pr_warn pr_warning | ||
175 | #define pr_notice(fmt, ...) \ | ||
176 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
177 | #define pr_info(fmt, ...) \ | ||
178 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
179 | #define pr_cont(fmt, ...) \ | ||
180 | printk(KERN_CONT fmt, ##__VA_ARGS__) | ||
181 | |||
182 | /* pr_devel() should produce zero code unless DEBUG is defined */ | ||
183 | #ifdef DEBUG | ||
184 | #define pr_devel(fmt, ...) \ | ||
185 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
186 | #else | ||
187 | #define pr_devel(fmt, ...) \ | ||
188 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
189 | #endif | ||
190 | |||
191 | /* If you are writing a driver, please use dev_dbg instead */ | ||
192 | #if defined(DEBUG) | ||
193 | #define pr_debug(fmt, ...) \ | ||
194 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
195 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
196 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ | ||
197 | #define pr_debug(fmt, ...) \ | ||
198 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | ||
199 | #else | ||
200 | #define pr_debug(fmt, ...) \ | ||
201 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
202 | #endif | ||
203 | |||
204 | /* | ||
205 | * ratelimited messages with local ratelimit_state, | ||
206 | * no local ratelimit_state used in the !PRINTK case | ||
207 | */ | ||
208 | #ifdef CONFIG_PRINTK | ||
209 | #define printk_ratelimited(fmt, ...) ({ \ | ||
210 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
211 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
212 | DEFAULT_RATELIMIT_BURST); \ | ||
213 | \ | ||
214 | if (__ratelimit(&_rs)) \ | ||
215 | printk(fmt, ##__VA_ARGS__); \ | ||
216 | }) | ||
217 | #else | ||
218 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
219 | #define printk_ratelimited printk | ||
220 | #endif | ||
221 | |||
222 | #define pr_emerg_ratelimited(fmt, ...) \ | ||
223 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
224 | #define pr_alert_ratelimited(fmt, ...) \ | ||
225 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
226 | #define pr_crit_ratelimited(fmt, ...) \ | ||
227 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
228 | #define pr_err_ratelimited(fmt, ...) \ | ||
229 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
230 | #define pr_warning_ratelimited(fmt, ...) \ | ||
231 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
232 | #define pr_warn_ratelimited pr_warning_ratelimited | ||
233 | #define pr_notice_ratelimited(fmt, ...) \ | ||
234 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
235 | #define pr_info_ratelimited(fmt, ...) \ | ||
236 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
237 | /* no pr_cont_ratelimited, don't do that... */ | ||
238 | /* If you are writing a driver, please use dev_dbg instead */ | ||
239 | #if defined(DEBUG) | ||
240 | #define pr_debug_ratelimited(fmt, ...) \ | ||
241 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
242 | #else | ||
243 | #define pr_debug_ratelimited(fmt, ...) \ | ||
244 | ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ | ||
245 | ##__VA_ARGS__); 0; }) | ||
246 | #endif | ||
247 | |||
248 | #endif | ||
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 4272521e29e9..092a04f874a8 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -100,7 +100,8 @@ | |||
100 | #include <linux/sched.h> /* For struct task_struct. */ | 100 | #include <linux/sched.h> /* For struct task_struct. */ |
101 | 101 | ||
102 | 102 | ||
103 | extern long arch_ptrace(struct task_struct *child, long request, long addr, long data); | 103 | extern long arch_ptrace(struct task_struct *child, long request, |
104 | unsigned long addr, unsigned long data); | ||
104 | extern int ptrace_traceme(void); | 105 | extern int ptrace_traceme(void); |
105 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); | 106 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); |
106 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); | 107 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); |
@@ -108,7 +109,8 @@ extern int ptrace_attach(struct task_struct *tsk); | |||
108 | extern int ptrace_detach(struct task_struct *, unsigned int); | 109 | extern int ptrace_detach(struct task_struct *, unsigned int); |
109 | extern void ptrace_disable(struct task_struct *); | 110 | extern void ptrace_disable(struct task_struct *); |
110 | extern int ptrace_check_attach(struct task_struct *task, int kill); | 111 | extern int ptrace_check_attach(struct task_struct *task, int kill); |
111 | extern int ptrace_request(struct task_struct *child, long request, long addr, long data); | 112 | extern int ptrace_request(struct task_struct *child, long request, |
113 | unsigned long addr, unsigned long data); | ||
112 | extern void ptrace_notify(int exit_code); | 114 | extern void ptrace_notify(int exit_code); |
113 | extern void __ptrace_link(struct task_struct *child, | 115 | extern void __ptrace_link(struct task_struct *child, |
114 | struct task_struct *new_parent); | 116 | struct task_struct *new_parent); |
@@ -132,8 +134,10 @@ static inline void ptrace_unlink(struct task_struct *child) | |||
132 | __ptrace_unlink(child); | 134 | __ptrace_unlink(child); |
133 | } | 135 | } |
134 | 136 | ||
135 | int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data); | 137 | int generic_ptrace_peekdata(struct task_struct *tsk, unsigned long addr, |
136 | int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data); | 138 | unsigned long data); |
139 | int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr, | ||
140 | unsigned long data); | ||
137 | 141 | ||
138 | /** | 142 | /** |
139 | * task_ptrace - return %PT_* flags that apply to a task | 143 | * task_ptrace - return %PT_* flags that apply to a task |
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h index 01b3d759f1fc..e031e1a486d9 100644 --- a/include/linux/pwm_backlight.h +++ b/include/linux/pwm_backlight.h | |||
@@ -8,6 +8,7 @@ struct platform_pwm_backlight_data { | |||
8 | int pwm_id; | 8 | int pwm_id; |
9 | unsigned int max_brightness; | 9 | unsigned int max_brightness; |
10 | unsigned int dft_brightness; | 10 | unsigned int dft_brightness; |
11 | unsigned int lth_brightness; | ||
11 | unsigned int pwm_period_ns; | 12 | unsigned int pwm_period_ns; |
12 | int (*init)(struct device *dev); | 13 | int (*init)(struct device *dev); |
13 | int (*notify)(struct device *dev, int brightness); | 14 | int (*notify)(struct device *dev, int brightness); |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index a39cbed9ee17..ab2baa5c4884 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -34,19 +34,13 @@ | |||
34 | * needed for RCU lookups (because root->height is unreliable). The only | 34 | * needed for RCU lookups (because root->height is unreliable). The only |
35 | * time callers need worry about this is when doing a lookup_slot under | 35 | * time callers need worry about this is when doing a lookup_slot under |
36 | * RCU. | 36 | * RCU. |
37 | * | ||
38 | * Indirect pointer in fact is also used to tag the last pointer of a node | ||
39 | * when it is shrunk, before we rcu free the node. See shrink code for | ||
40 | * details. | ||
37 | */ | 41 | */ |
38 | #define RADIX_TREE_INDIRECT_PTR 1 | 42 | #define RADIX_TREE_INDIRECT_PTR 1 |
39 | #define RADIX_TREE_RETRY ((void *)-1UL) | ||
40 | |||
41 | static inline void *radix_tree_ptr_to_indirect(void *ptr) | ||
42 | { | ||
43 | return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR); | ||
44 | } | ||
45 | 43 | ||
46 | static inline void *radix_tree_indirect_to_ptr(void *ptr) | ||
47 | { | ||
48 | return (void *)((unsigned long)ptr & ~RADIX_TREE_INDIRECT_PTR); | ||
49 | } | ||
50 | #define radix_tree_indirect_to_ptr(ptr) \ | 44 | #define radix_tree_indirect_to_ptr(ptr) \ |
51 | radix_tree_indirect_to_ptr((void __force *)(ptr)) | 45 | radix_tree_indirect_to_ptr((void __force *)(ptr)) |
52 | 46 | ||
@@ -140,16 +134,29 @@ do { \ | |||
140 | * removed. | 134 | * removed. |
141 | * | 135 | * |
142 | * For use with radix_tree_lookup_slot(). Caller must hold tree at least read | 136 | * For use with radix_tree_lookup_slot(). Caller must hold tree at least read |
143 | * locked across slot lookup and dereference. More likely, will be used with | 137 | * locked across slot lookup and dereference. Not required if write lock is |
144 | * radix_tree_replace_slot(), as well, so caller will hold tree write locked. | 138 | * held (ie. items cannot be concurrently inserted). |
139 | * | ||
140 | * radix_tree_deref_retry must be used to confirm validity of the pointer if | ||
141 | * only the read lock is held. | ||
145 | */ | 142 | */ |
146 | static inline void *radix_tree_deref_slot(void **pslot) | 143 | static inline void *radix_tree_deref_slot(void **pslot) |
147 | { | 144 | { |
148 | void *ret = rcu_dereference(*pslot); | 145 | return rcu_dereference(*pslot); |
149 | if (unlikely(radix_tree_is_indirect_ptr(ret))) | ||
150 | ret = RADIX_TREE_RETRY; | ||
151 | return ret; | ||
152 | } | 146 | } |
147 | |||
148 | /** | ||
149 | * radix_tree_deref_retry - check radix_tree_deref_slot | ||
150 | * @arg: pointer returned by radix_tree_deref_slot | ||
151 | * Returns: 0 if retry is not required, otherwise retry is required | ||
152 | * | ||
153 | * radix_tree_deref_retry must be used with radix_tree_deref_slot. | ||
154 | */ | ||
155 | static inline int radix_tree_deref_retry(void *arg) | ||
156 | { | ||
157 | return unlikely((unsigned long)arg & RADIX_TREE_INDIRECT_PTR); | ||
158 | } | ||
159 | |||
153 | /** | 160 | /** |
154 | * radix_tree_replace_slot - replace item in a slot | 161 | * radix_tree_replace_slot - replace item in a slot |
155 | * @pslot: pointer to slot, returned by radix_tree_lookup_slot | 162 | * @pslot: pointer to slot, returned by radix_tree_lookup_slot |
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index e7320b5e82fb..3a8f0c9b2933 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
@@ -3,8 +3,8 @@ | |||
3 | 3 | ||
4 | struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir, | 4 | struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir, |
5 | int mode, dev_t dev); | 5 | int mode, dev_t dev); |
6 | extern int ramfs_get_sb(struct file_system_type *fs_type, | 6 | extern struct dentry *ramfs_mount(struct file_system_type *fs_type, |
7 | int flags, const char *dev_name, void *data, struct vfsmount *mnt); | 7 | int flags, const char *dev_name, void *data); |
8 | 8 | ||
9 | #ifndef CONFIG_MMU | 9 | #ifndef CONFIG_MMU |
10 | extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); | 10 | extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); |
diff --git a/include/linux/ramoops.h b/include/linux/ramoops.h new file mode 100644 index 000000000000..0ae68a2c1212 --- /dev/null +++ b/include/linux/ramoops.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef __RAMOOPS_H | ||
2 | #define __RAMOOPS_H | ||
3 | |||
4 | /* | ||
5 | * Ramoops platform data | ||
6 | * @mem_size memory size for ramoops | ||
7 | * @mem_address physical memory address to contain ramoops | ||
8 | */ | ||
9 | |||
10 | struct ramoops_platform_data { | ||
11 | unsigned long mem_size; | ||
12 | unsigned long mem_address; | ||
13 | }; | ||
14 | |||
15 | #endif | ||
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h index 8f69d09a41a5..03ff67b0cdf5 100644 --- a/include/linux/ratelimit.h +++ b/include/linux/ratelimit.h | |||
@@ -36,6 +36,8 @@ static inline void ratelimit_state_init(struct ratelimit_state *rs, | |||
36 | rs->begin = 0; | 36 | rs->begin = 0; |
37 | } | 37 | } |
38 | 38 | ||
39 | extern struct ratelimit_state printk_ratelimit_state; | ||
40 | |||
39 | extern int ___ratelimit(struct ratelimit_state *rs, const char *func); | 41 | extern int ___ratelimit(struct ratelimit_state *rs, const char *func); |
40 | #define __ratelimit(state) ___ratelimit(state, __func__) | 42 | #define __ratelimit(state) ___ratelimit(state, __func__) |
41 | 43 | ||
diff --git a/include/linux/regulator/lp3972.h b/include/linux/regulator/lp3972.h new file mode 100644 index 000000000000..9bb7389b7a1e --- /dev/null +++ b/include/linux/regulator/lp3972.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * National Semiconductors LP3972 PMIC chip client interface | ||
3 | * | ||
4 | * Based on lp3971.h | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef __LINUX_REGULATOR_LP3972_H | ||
22 | #define __LINUX_REGULATOR_LP3972_H | ||
23 | |||
24 | #include <linux/regulator/machine.h> | ||
25 | |||
26 | #define LP3972_LDO1 0 | ||
27 | #define LP3972_LDO2 1 | ||
28 | #define LP3972_LDO3 2 | ||
29 | #define LP3972_LDO4 3 | ||
30 | #define LP3972_LDO5 4 | ||
31 | |||
32 | #define LP3972_DCDC1 5 | ||
33 | #define LP3972_DCDC2 6 | ||
34 | #define LP3972_DCDC3 7 | ||
35 | |||
36 | #define LP3972_NUM_REGULATORS 8 | ||
37 | |||
38 | struct lp3972_regulator_subdev { | ||
39 | int id; | ||
40 | struct regulator_init_data *initdata; | ||
41 | }; | ||
42 | |||
43 | struct lp3972_platform_data { | ||
44 | int num_regulators; | ||
45 | struct lp3972_regulator_subdev *regulators; | ||
46 | }; | ||
47 | |||
48 | #endif | ||
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index e2980287245e..761c745b9c24 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -189,10 +189,15 @@ int regulator_suspend_prepare(suspend_state_t state); | |||
189 | 189 | ||
190 | #ifdef CONFIG_REGULATOR | 190 | #ifdef CONFIG_REGULATOR |
191 | void regulator_has_full_constraints(void); | 191 | void regulator_has_full_constraints(void); |
192 | void regulator_use_dummy_regulator(void); | ||
192 | #else | 193 | #else |
193 | static inline void regulator_has_full_constraints(void) | 194 | static inline void regulator_has_full_constraints(void) |
194 | { | 195 | { |
195 | } | 196 | } |
197 | |||
198 | static inline void regulator_use_dummy_regulator(void) | ||
199 | { | ||
200 | } | ||
196 | #endif | 201 | #endif |
197 | 202 | ||
198 | #endif | 203 | #endif |
diff --git a/include/linux/regulator/max8952.h b/include/linux/regulator/max8952.h new file mode 100644 index 000000000000..45e42855ad05 --- /dev/null +++ b/include/linux/regulator/max8952.h | |||
@@ -0,0 +1,135 @@ | |||
1 | /* | ||
2 | * max8952.h - Voltage regulation for the Maxim 8952 | ||
3 | * | ||
4 | * Copyright (C) 2010 Samsung Electrnoics | ||
5 | * MyungJoo Ham <myungjoo.ham@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #ifndef REGULATOR_MAX8952 | ||
23 | #define REGULATOR_MAX8952 | ||
24 | |||
25 | #include <linux/regulator/machine.h> | ||
26 | |||
27 | enum { | ||
28 | MAX8952_DVS_MODE0, | ||
29 | MAX8952_DVS_MODE1, | ||
30 | MAX8952_DVS_MODE2, | ||
31 | MAX8952_DVS_MODE3, | ||
32 | }; | ||
33 | |||
34 | enum { | ||
35 | MAX8952_DVS_770mV = 0, | ||
36 | MAX8952_DVS_780mV, | ||
37 | MAX8952_DVS_790mV, | ||
38 | MAX8952_DVS_800mV, | ||
39 | MAX8952_DVS_810mV, | ||
40 | MAX8952_DVS_820mV, | ||
41 | MAX8952_DVS_830mV, | ||
42 | MAX8952_DVS_840mV, | ||
43 | MAX8952_DVS_850mV, | ||
44 | MAX8952_DVS_860mV, | ||
45 | MAX8952_DVS_870mV, | ||
46 | MAX8952_DVS_880mV, | ||
47 | MAX8952_DVS_890mV, | ||
48 | MAX8952_DVS_900mV, | ||
49 | MAX8952_DVS_910mV, | ||
50 | MAX8952_DVS_920mV, | ||
51 | MAX8952_DVS_930mV, | ||
52 | MAX8952_DVS_940mV, | ||
53 | MAX8952_DVS_950mV, | ||
54 | MAX8952_DVS_960mV, | ||
55 | MAX8952_DVS_970mV, | ||
56 | MAX8952_DVS_980mV, | ||
57 | MAX8952_DVS_990mV, | ||
58 | MAX8952_DVS_1000mV, | ||
59 | MAX8952_DVS_1010mV, | ||
60 | MAX8952_DVS_1020mV, | ||
61 | MAX8952_DVS_1030mV, | ||
62 | MAX8952_DVS_1040mV, | ||
63 | MAX8952_DVS_1050mV, | ||
64 | MAX8952_DVS_1060mV, | ||
65 | MAX8952_DVS_1070mV, | ||
66 | MAX8952_DVS_1080mV, | ||
67 | MAX8952_DVS_1090mV, | ||
68 | MAX8952_DVS_1100mV, | ||
69 | MAX8952_DVS_1110mV, | ||
70 | MAX8952_DVS_1120mV, | ||
71 | MAX8952_DVS_1130mV, | ||
72 | MAX8952_DVS_1140mV, | ||
73 | MAX8952_DVS_1150mV, | ||
74 | MAX8952_DVS_1160mV, | ||
75 | MAX8952_DVS_1170mV, | ||
76 | MAX8952_DVS_1180mV, | ||
77 | MAX8952_DVS_1190mV, | ||
78 | MAX8952_DVS_1200mV, | ||
79 | MAX8952_DVS_1210mV, | ||
80 | MAX8952_DVS_1220mV, | ||
81 | MAX8952_DVS_1230mV, | ||
82 | MAX8952_DVS_1240mV, | ||
83 | MAX8952_DVS_1250mV, | ||
84 | MAX8952_DVS_1260mV, | ||
85 | MAX8952_DVS_1270mV, | ||
86 | MAX8952_DVS_1280mV, | ||
87 | MAX8952_DVS_1290mV, | ||
88 | MAX8952_DVS_1300mV, | ||
89 | MAX8952_DVS_1310mV, | ||
90 | MAX8952_DVS_1320mV, | ||
91 | MAX8952_DVS_1330mV, | ||
92 | MAX8952_DVS_1340mV, | ||
93 | MAX8952_DVS_1350mV, | ||
94 | MAX8952_DVS_1360mV, | ||
95 | MAX8952_DVS_1370mV, | ||
96 | MAX8952_DVS_1380mV, | ||
97 | MAX8952_DVS_1390mV, | ||
98 | MAX8952_DVS_1400mV, | ||
99 | }; | ||
100 | |||
101 | enum { | ||
102 | MAX8952_SYNC_FREQ_26MHZ, /* Default */ | ||
103 | MAX8952_SYNC_FREQ_13MHZ, | ||
104 | MAX8952_SYNC_FREQ_19_2MHZ, | ||
105 | }; | ||
106 | |||
107 | enum { | ||
108 | MAX8952_RAMP_32mV_us = 0, /* Default */ | ||
109 | MAX8952_RAMP_16mV_us, | ||
110 | MAX8952_RAMP_8mV_us, | ||
111 | MAX8952_RAMP_4mV_us, | ||
112 | MAX8952_RAMP_2mV_us, | ||
113 | MAX8952_RAMP_1mV_us, | ||
114 | MAX8952_RAMP_0_5mV_us, | ||
115 | MAX8952_RAMP_0_25mV_us, | ||
116 | }; | ||
117 | |||
118 | #define MAX8952_NUM_DVS_MODE 4 | ||
119 | |||
120 | struct max8952_platform_data { | ||
121 | int gpio_vid0; | ||
122 | int gpio_vid1; | ||
123 | int gpio_en; | ||
124 | |||
125 | u8 default_mode; | ||
126 | u8 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */ | ||
127 | |||
128 | u8 sync_freq; | ||
129 | u8 ramp_speed; | ||
130 | |||
131 | struct regulator_init_data reg_data; | ||
132 | }; | ||
133 | |||
134 | |||
135 | #endif /* REGULATOR_MAX8952 */ | ||
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 91a4177e60ce..c21072adbfad 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <asm/unaligned.h> | 22 | #include <asm/unaligned.h> |
23 | #include <linux/bitops.h> | 23 | #include <linux/bitops.h> |
24 | #include <linux/proc_fs.h> | 24 | #include <linux/proc_fs.h> |
25 | #include <linux/smp_lock.h> | ||
26 | #include <linux/buffer_head.h> | 25 | #include <linux/buffer_head.h> |
27 | #include <linux/reiserfs_fs_i.h> | 26 | #include <linux/reiserfs_fs_i.h> |
28 | #include <linux/reiserfs_fs_sb.h> | 27 | #include <linux/reiserfs_fs_sb.h> |
@@ -2072,6 +2071,8 @@ void sd_attrs_to_i_attrs(__u16 sd_attrs, struct inode *inode); | |||
2072 | void i_attrs_to_sd_attrs(struct inode *inode, __u16 * sd_attrs); | 2071 | void i_attrs_to_sd_attrs(struct inode *inode, __u16 * sd_attrs); |
2073 | int reiserfs_setattr(struct dentry *dentry, struct iattr *attr); | 2072 | int reiserfs_setattr(struct dentry *dentry, struct iattr *attr); |
2074 | 2073 | ||
2074 | int __reiserfs_write_begin(struct page *page, unsigned from, unsigned len); | ||
2075 | |||
2075 | /* namei.c */ | 2076 | /* namei.c */ |
2076 | void set_de_name_and_namelen(struct reiserfs_dir_entry *de); | 2077 | void set_de_name_and_namelen(struct reiserfs_dir_entry *de); |
2077 | int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, | 2078 | int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, |
diff --git a/include/linux/resource.h b/include/linux/resource.h index 88d36f9145ba..d01c96c1966e 100644 --- a/include/linux/resource.h +++ b/include/linux/resource.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_RESOURCE_H | 2 | #define _LINUX_RESOURCE_H |
3 | 3 | ||
4 | #include <linux/time.h> | 4 | #include <linux/time.h> |
5 | #include <linux/types.h> | ||
5 | 6 | ||
6 | /* | 7 | /* |
7 | * Resource control/accounting header file for linux | 8 | * Resource control/accounting header file for linux |
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 25b4f686d918..8d3a2486544d 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -62,18 +62,6 @@ enum ring_buffer_type { | |||
62 | unsigned ring_buffer_event_length(struct ring_buffer_event *event); | 62 | unsigned ring_buffer_event_length(struct ring_buffer_event *event); |
63 | void *ring_buffer_event_data(struct ring_buffer_event *event); | 63 | void *ring_buffer_event_data(struct ring_buffer_event *event); |
64 | 64 | ||
65 | /** | ||
66 | * ring_buffer_event_time_delta - return the delta timestamp of the event | ||
67 | * @event: the event to get the delta timestamp of | ||
68 | * | ||
69 | * The delta timestamp is the 27 bit timestamp since the last event. | ||
70 | */ | ||
71 | static inline unsigned | ||
72 | ring_buffer_event_time_delta(struct ring_buffer_event *event) | ||
73 | { | ||
74 | return event->time_delta; | ||
75 | } | ||
76 | |||
77 | /* | 65 | /* |
78 | * ring_buffer_discard_commit will remove an event that has not | 66 | * ring_buffer_discard_commit will remove an event that has not |
79 | * ben committed yet. If this is used, then ring_buffer_unlock_commit | 67 | * ben committed yet. If this is used, then ring_buffer_unlock_commit |
diff --git a/include/linux/rio.h b/include/linux/rio.h index bd6eb0ed34a7..0bed941f9b13 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h | |||
@@ -67,6 +67,7 @@ | |||
67 | #define RIO_PW_MSG_SIZE 64 | 67 | #define RIO_PW_MSG_SIZE 64 |
68 | 68 | ||
69 | extern struct bus_type rio_bus_type; | 69 | extern struct bus_type rio_bus_type; |
70 | extern struct device rio_bus; | ||
70 | extern struct list_head rio_devices; /* list of all devices */ | 71 | extern struct list_head rio_devices; /* list of all devices */ |
71 | 72 | ||
72 | struct rio_mport; | 73 | struct rio_mport; |
@@ -98,6 +99,7 @@ union rio_pw_msg; | |||
98 | * @riores: RIO resources this device owns | 99 | * @riores: RIO resources this device owns |
99 | * @pwcback: port-write callback function for this device | 100 | * @pwcback: port-write callback function for this device |
100 | * @destid: Network destination ID | 101 | * @destid: Network destination ID |
102 | * @prev: Previous RIO device connected to the current one | ||
101 | */ | 103 | */ |
102 | struct rio_dev { | 104 | struct rio_dev { |
103 | struct list_head global_list; /* node in list of all RIO devices */ | 105 | struct list_head global_list; /* node in list of all RIO devices */ |
@@ -111,7 +113,7 @@ struct rio_dev { | |||
111 | u16 asm_rev; | 113 | u16 asm_rev; |
112 | u16 efptr; | 114 | u16 efptr; |
113 | u32 pef; | 115 | u32 pef; |
114 | u32 swpinfo; /* Only used for switches */ | 116 | u32 swpinfo; |
115 | u32 src_ops; | 117 | u32 src_ops; |
116 | u32 dst_ops; | 118 | u32 dst_ops; |
117 | u32 comp_tag; | 119 | u32 comp_tag; |
@@ -124,6 +126,7 @@ struct rio_dev { | |||
124 | struct resource riores[RIO_MAX_DEV_RESOURCES]; | 126 | struct resource riores[RIO_MAX_DEV_RESOURCES]; |
125 | int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); | 127 | int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); |
126 | u16 destid; | 128 | u16 destid; |
129 | struct rio_dev *prev; | ||
127 | }; | 130 | }; |
128 | 131 | ||
129 | #define rio_dev_g(n) list_entry(n, struct rio_dev, global_list) | 132 | #define rio_dev_g(n) list_entry(n, struct rio_dev, global_list) |
@@ -174,6 +177,7 @@ enum rio_phy_type { | |||
174 | * @index: Port index, unique among all port interfaces of the same type | 177 | * @index: Port index, unique among all port interfaces of the same type |
175 | * @sys_size: RapidIO common transport system size | 178 | * @sys_size: RapidIO common transport system size |
176 | * @phy_type: RapidIO phy type | 179 | * @phy_type: RapidIO phy type |
180 | * @phys_efptr: RIO port extended features pointer | ||
177 | * @name: Port name string | 181 | * @name: Port name string |
178 | * @priv: Master port private data | 182 | * @priv: Master port private data |
179 | */ | 183 | */ |
@@ -195,6 +199,7 @@ struct rio_mport { | |||
195 | * 1 - Large size, 65536 devices. | 199 | * 1 - Large size, 65536 devices. |
196 | */ | 200 | */ |
197 | enum rio_phy_type phy_type; /* RapidIO phy type */ | 201 | enum rio_phy_type phy_type; /* RapidIO phy type */ |
202 | u32 phys_efptr; | ||
198 | unsigned char name[40]; | 203 | unsigned char name[40]; |
199 | void *priv; /* Master port private data */ | 204 | void *priv; /* Master port private data */ |
200 | }; | 205 | }; |
@@ -215,9 +220,14 @@ struct rio_net { | |||
215 | unsigned char id; /* RIO network ID */ | 220 | unsigned char id; /* RIO network ID */ |
216 | }; | 221 | }; |
217 | 222 | ||
223 | /* Definitions used by switch sysfs initialization callback */ | ||
224 | #define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */ | ||
225 | #define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */ | ||
226 | |||
218 | /** | 227 | /** |
219 | * struct rio_switch - RIO switch info | 228 | * struct rio_switch - RIO switch info |
220 | * @node: Node in global list of switches | 229 | * @node: Node in global list of switches |
230 | * @rdev: Associated RIO device structure | ||
221 | * @switchid: Switch ID that is unique across a network | 231 | * @switchid: Switch ID that is unique across a network |
222 | * @hopcount: Hopcount to this switch | 232 | * @hopcount: Hopcount to this switch |
223 | * @destid: Associated destid in the path | 233 | * @destid: Associated destid in the path |
@@ -230,9 +240,12 @@ struct rio_net { | |||
230 | * @get_domain: Callback for switch-specific domain get function | 240 | * @get_domain: Callback for switch-specific domain get function |
231 | * @em_init: Callback for switch-specific error management initialization function | 241 | * @em_init: Callback for switch-specific error management initialization function |
232 | * @em_handle: Callback for switch-specific error management handler function | 242 | * @em_handle: Callback for switch-specific error management handler function |
243 | * @sw_sysfs: Callback that initializes switch-specific sysfs attributes | ||
244 | * @nextdev: Array of per-port pointers to the next attached device | ||
233 | */ | 245 | */ |
234 | struct rio_switch { | 246 | struct rio_switch { |
235 | struct list_head node; | 247 | struct list_head node; |
248 | struct rio_dev *rdev; | ||
236 | u16 switchid; | 249 | u16 switchid; |
237 | u16 hopcount; | 250 | u16 hopcount; |
238 | u16 destid; | 251 | u16 destid; |
@@ -250,6 +263,8 @@ struct rio_switch { | |||
250 | u8 *sw_domain); | 263 | u8 *sw_domain); |
251 | int (*em_init) (struct rio_dev *dev); | 264 | int (*em_init) (struct rio_dev *dev); |
252 | int (*em_handle) (struct rio_dev *dev, u8 swport); | 265 | int (*em_handle) (struct rio_dev *dev, u8 swport); |
266 | int (*sw_sysfs) (struct rio_dev *dev, int create); | ||
267 | struct rio_dev *nextdev[0]; | ||
253 | }; | 268 | }; |
254 | 269 | ||
255 | /* Low-level architecture-dependent routines */ | 270 | /* Low-level architecture-dependent routines */ |
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h index db50e1c288b7..ee7b6ada188f 100644 --- a/include/linux/rio_ids.h +++ b/include/linux/rio_ids.h | |||
@@ -34,5 +34,7 @@ | |||
34 | #define RIO_DID_IDTCPS16 0x035b | 34 | #define RIO_DID_IDTCPS16 0x035b |
35 | #define RIO_DID_IDTCPS6Q 0x035f | 35 | #define RIO_DID_IDTCPS6Q 0x035f |
36 | #define RIO_DID_IDTCPS10Q 0x035e | 36 | #define RIO_DID_IDTCPS10Q 0x035e |
37 | #define RIO_DID_IDTCPS1848 0x0374 | ||
38 | #define RIO_DID_IDTCPS1616 0x0379 | ||
37 | 39 | ||
38 | #endif /* LINUX_RIO_IDS_H */ | 40 | #endif /* LINUX_RIO_IDS_H */ |
diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h index aedee0489fb4..d63dcbaea169 100644 --- a/include/linux/rio_regs.h +++ b/include/linux/rio_regs.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #define RIO_PEF_MEMORY 0x40000000 /* [I] MMIO */ | 33 | #define RIO_PEF_MEMORY 0x40000000 /* [I] MMIO */ |
34 | #define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */ | 34 | #define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */ |
35 | #define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */ | 35 | #define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */ |
36 | #define RIO_PEF_MULTIPORT 0x08000000 /* [VI, 2.1] Multiport */ | ||
36 | #define RIO_PEF_INB_MBOX 0x00f00000 /* [II] Mailboxes */ | 37 | #define RIO_PEF_INB_MBOX 0x00f00000 /* [II] Mailboxes */ |
37 | #define RIO_PEF_INB_MBOX0 0x00800000 /* [II] Mailbox 0 */ | 38 | #define RIO_PEF_INB_MBOX0 0x00800000 /* [II] Mailbox 0 */ |
38 | #define RIO_PEF_INB_MBOX1 0x00400000 /* [II] Mailbox 1 */ | 39 | #define RIO_PEF_INB_MBOX1 0x00400000 /* [II] Mailbox 1 */ |
@@ -51,6 +52,7 @@ | |||
51 | #define RIO_SWP_INFO_PORT_TOTAL_MASK 0x0000ff00 /* [I] Total number of ports */ | 52 | #define RIO_SWP_INFO_PORT_TOTAL_MASK 0x0000ff00 /* [I] Total number of ports */ |
52 | #define RIO_SWP_INFO_PORT_NUM_MASK 0x000000ff /* [I] Maintenance transaction port number */ | 53 | #define RIO_SWP_INFO_PORT_NUM_MASK 0x000000ff /* [I] Maintenance transaction port number */ |
53 | #define RIO_GET_TOTAL_PORTS(x) ((x & RIO_SWP_INFO_PORT_TOTAL_MASK) >> 8) | 54 | #define RIO_GET_TOTAL_PORTS(x) ((x & RIO_SWP_INFO_PORT_TOTAL_MASK) >> 8) |
55 | #define RIO_GET_PORT_NUM(x) (x & RIO_SWP_INFO_PORT_NUM_MASK) | ||
54 | 56 | ||
55 | #define RIO_SRC_OPS_CAR 0x18 /* [I] Source Operations CAR */ | 57 | #define RIO_SRC_OPS_CAR 0x18 /* [I] Source Operations CAR */ |
56 | #define RIO_SRC_OPS_READ 0x00008000 /* [I] Read op */ | 58 | #define RIO_SRC_OPS_READ 0x00008000 /* [I] Read op */ |
@@ -159,6 +161,7 @@ | |||
159 | #define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */ | 161 | #define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */ |
160 | 162 | ||
161 | #define RIO_STD_RTE_CONF_DESTID_SEL_CSR 0x70 | 163 | #define RIO_STD_RTE_CONF_DESTID_SEL_CSR 0x70 |
164 | #define RIO_STD_RTE_CONF_EXTCFGEN 0x80000000 | ||
162 | #define RIO_STD_RTE_CONF_PORT_SEL_CSR 0x74 | 165 | #define RIO_STD_RTE_CONF_PORT_SEL_CSR 0x74 |
163 | #define RIO_STD_RTE_DEFAULT_PORT 0x78 | 166 | #define RIO_STD_RTE_DEFAULT_PORT 0x78 |
164 | 167 | ||
@@ -222,15 +225,17 @@ | |||
222 | #define RIO_PORT_GEN_MASTER 0x40000000 | 225 | #define RIO_PORT_GEN_MASTER 0x40000000 |
223 | #define RIO_PORT_GEN_DISCOVERED 0x20000000 | 226 | #define RIO_PORT_GEN_DISCOVERED 0x20000000 |
224 | #define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */ | 227 | #define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */ |
228 | #define RIO_MNT_REQ_CMD_RD 0x03 /* Reset-device command */ | ||
229 | #define RIO_MNT_REQ_CMD_IS 0x04 /* Input-status command */ | ||
225 | #define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */ | 230 | #define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */ |
226 | #define RIO_PORT_N_MNT_RSP_RVAL 0x80000000 /* Response Valid */ | 231 | #define RIO_PORT_N_MNT_RSP_RVAL 0x80000000 /* Response Valid */ |
227 | #define RIO_PORT_N_MNT_RSP_ASTAT 0x000003e0 /* ackID Status */ | 232 | #define RIO_PORT_N_MNT_RSP_ASTAT 0x000007e0 /* ackID Status */ |
228 | #define RIO_PORT_N_MNT_RSP_LSTAT 0x0000001f /* Link Status */ | 233 | #define RIO_PORT_N_MNT_RSP_LSTAT 0x0000001f /* Link Status */ |
229 | #define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */ | 234 | #define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */ |
230 | #define RIO_PORT_N_ACK_CLEAR 0x80000000 | 235 | #define RIO_PORT_N_ACK_CLEAR 0x80000000 |
231 | #define RIO_PORT_N_ACK_INBOUND 0x1f000000 | 236 | #define RIO_PORT_N_ACK_INBOUND 0x3f000000 |
232 | #define RIO_PORT_N_ACK_OUTSTAND 0x00001f00 | 237 | #define RIO_PORT_N_ACK_OUTSTAND 0x00003f00 |
233 | #define RIO_PORT_N_ACK_OUTBOUND 0x0000001f | 238 | #define RIO_PORT_N_ACK_OUTBOUND 0x0000003f |
234 | #define RIO_PORT_N_ERR_STS_CSR(x) (0x0058 + x*0x20) | 239 | #define RIO_PORT_N_ERR_STS_CSR(x) (0x0058 + x*0x20) |
235 | #define RIO_PORT_N_ERR_STS_PW_OUT_ES 0x00010000 /* Output Error-stopped */ | 240 | #define RIO_PORT_N_ERR_STS_PW_OUT_ES 0x00010000 /* Output Error-stopped */ |
236 | #define RIO_PORT_N_ERR_STS_PW_INP_ES 0x00000100 /* Input Error-stopped */ | 241 | #define RIO_PORT_N_ERR_STS_PW_INP_ES 0x00000100 /* Input Error-stopped */ |
@@ -238,7 +243,6 @@ | |||
238 | #define RIO_PORT_N_ERR_STS_PORT_ERR 0x00000004 | 243 | #define RIO_PORT_N_ERR_STS_PORT_ERR 0x00000004 |
239 | #define RIO_PORT_N_ERR_STS_PORT_OK 0x00000002 | 244 | #define RIO_PORT_N_ERR_STS_PORT_OK 0x00000002 |
240 | #define RIO_PORT_N_ERR_STS_PORT_UNINIT 0x00000001 | 245 | #define RIO_PORT_N_ERR_STS_PORT_UNINIT 0x00000001 |
241 | #define RIO_PORT_N_ERR_STS_CLR_MASK 0x07120204 | ||
242 | #define RIO_PORT_N_CTL_CSR(x) (0x005c + x*0x20) | 246 | #define RIO_PORT_N_CTL_CSR(x) (0x005c + x*0x20) |
243 | #define RIO_PORT_N_CTL_PWIDTH 0xc0000000 | 247 | #define RIO_PORT_N_CTL_PWIDTH 0xc0000000 |
244 | #define RIO_PORT_N_CTL_PWIDTH_1 0x00000000 | 248 | #define RIO_PORT_N_CTL_PWIDTH_1 0x00000000 |
@@ -261,6 +265,10 @@ | |||
261 | #define RIO_EM_EFB_HEADER 0x000 /* Error Management Extensions Block Header */ | 265 | #define RIO_EM_EFB_HEADER 0x000 /* Error Management Extensions Block Header */ |
262 | #define RIO_EM_LTL_ERR_DETECT 0x008 /* Logical/Transport Layer Error Detect CSR */ | 266 | #define RIO_EM_LTL_ERR_DETECT 0x008 /* Logical/Transport Layer Error Detect CSR */ |
263 | #define RIO_EM_LTL_ERR_EN 0x00c /* Logical/Transport Layer Error Enable CSR */ | 267 | #define RIO_EM_LTL_ERR_EN 0x00c /* Logical/Transport Layer Error Enable CSR */ |
268 | #define REM_LTL_ERR_ILLTRAN 0x08000000 /* Illegal Transaction decode */ | ||
269 | #define REM_LTL_ERR_UNSOLR 0x00800000 /* Unsolicited Response */ | ||
270 | #define REM_LTL_ERR_UNSUPTR 0x00400000 /* Unsupported Transaction */ | ||
271 | #define REM_LTL_ERR_IMPSPEC 0x000000ff /* Implementation Specific */ | ||
264 | #define RIO_EM_LTL_HIADDR_CAP 0x010 /* Logical/Transport Layer High Address Capture CSR */ | 272 | #define RIO_EM_LTL_HIADDR_CAP 0x010 /* Logical/Transport Layer High Address Capture CSR */ |
265 | #define RIO_EM_LTL_ADDR_CAP 0x014 /* Logical/Transport Layer Address Capture CSR */ | 273 | #define RIO_EM_LTL_ADDR_CAP 0x014 /* Logical/Transport Layer Address Capture CSR */ |
266 | #define RIO_EM_LTL_DEVID_CAP 0x018 /* Logical/Transport Layer Device ID Capture CSR */ | 274 | #define RIO_EM_LTL_DEVID_CAP 0x018 /* Logical/Transport Layer Device ID Capture CSR */ |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 31b2fd75dcba..bb83c0da2071 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -25,8 +25,8 @@ | |||
25 | * pointing to this anon_vma once its vma list is empty. | 25 | * pointing to this anon_vma once its vma list is empty. |
26 | */ | 26 | */ |
27 | struct anon_vma { | 27 | struct anon_vma { |
28 | spinlock_t lock; /* Serialize access to vma list */ | ||
29 | struct anon_vma *root; /* Root of this anon_vma tree */ | 28 | struct anon_vma *root; /* Root of this anon_vma tree */ |
29 | spinlock_t lock; /* Serialize access to vma list */ | ||
30 | #if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION) | 30 | #if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION) |
31 | 31 | ||
32 | /* | 32 | /* |
@@ -205,9 +205,20 @@ int try_to_unmap_one(struct page *, struct vm_area_struct *, | |||
205 | /* | 205 | /* |
206 | * Called from mm/filemap_xip.c to unmap empty zero page | 206 | * Called from mm/filemap_xip.c to unmap empty zero page |
207 | */ | 207 | */ |
208 | pte_t *page_check_address(struct page *, struct mm_struct *, | 208 | pte_t *__page_check_address(struct page *, struct mm_struct *, |
209 | unsigned long, spinlock_t **, int); | 209 | unsigned long, spinlock_t **, int); |
210 | 210 | ||
211 | static inline pte_t *page_check_address(struct page *page, struct mm_struct *mm, | ||
212 | unsigned long address, | ||
213 | spinlock_t **ptlp, int sync) | ||
214 | { | ||
215 | pte_t *ptep; | ||
216 | |||
217 | __cond_lock(*ptlp, ptep = __page_check_address(page, mm, address, | ||
218 | ptlp, sync)); | ||
219 | return ptep; | ||
220 | } | ||
221 | |||
211 | /* | 222 | /* |
212 | * Used by swapoff to help locate where page is expected in vma. | 223 | * Used by swapoff to help locate where page is expected in vma. |
213 | */ | 224 | */ |
@@ -230,7 +241,20 @@ int try_to_munlock(struct page *); | |||
230 | /* | 241 | /* |
231 | * Called by memory-failure.c to kill processes. | 242 | * Called by memory-failure.c to kill processes. |
232 | */ | 243 | */ |
233 | struct anon_vma *page_lock_anon_vma(struct page *page); | 244 | struct anon_vma *__page_lock_anon_vma(struct page *page); |
245 | |||
246 | static inline struct anon_vma *page_lock_anon_vma(struct page *page) | ||
247 | { | ||
248 | struct anon_vma *anon_vma; | ||
249 | |||
250 | __cond_lock(RCU, anon_vma = __page_lock_anon_vma(page)); | ||
251 | |||
252 | /* (void) is needed to make gcc happy */ | ||
253 | (void) __cond_lock(&anon_vma->root->lock, anon_vma); | ||
254 | |||
255 | return anon_vma; | ||
256 | } | ||
257 | |||
234 | void page_unlock_anon_vma(struct anon_vma *anon_vma); | 258 | void page_unlock_anon_vma(struct anon_vma *anon_vma); |
235 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | 259 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); |
236 | 260 | ||
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index d42f274418b8..bbad657a3725 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -6,7 +6,6 @@ | |||
6 | #include <linux/if_link.h> | 6 | #include <linux/if_link.h> |
7 | #include <linux/if_addr.h> | 7 | #include <linux/if_addr.h> |
8 | #include <linux/neighbour.h> | 8 | #include <linux/neighbour.h> |
9 | #include <linux/netdevice.h> | ||
10 | 9 | ||
11 | /* rtnetlink families. Values up to 127 are reserved for real address | 10 | /* rtnetlink families. Values up to 127 are reserved for real address |
12 | * families, values above 128 may be used arbitrarily. | 11 | * families, values above 128 may be used arbitrarily. |
@@ -606,6 +605,7 @@ struct tcamsg { | |||
606 | #ifdef __KERNEL__ | 605 | #ifdef __KERNEL__ |
607 | 606 | ||
608 | #include <linux/mutex.h> | 607 | #include <linux/mutex.h> |
608 | #include <linux/netdevice.h> | ||
609 | 609 | ||
610 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) | 610 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) |
611 | { | 611 | { |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 56154bbb8da9..223874538b33 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -143,7 +143,7 @@ extern unsigned long nr_iowait_cpu(int cpu); | |||
143 | extern unsigned long this_cpu_load(void); | 143 | extern unsigned long this_cpu_load(void); |
144 | 144 | ||
145 | 145 | ||
146 | extern void calc_global_load(void); | 146 | extern void calc_global_load(unsigned long ticks); |
147 | 147 | ||
148 | extern unsigned long get_parent_ip(unsigned long addr); | 148 | extern unsigned long get_parent_ip(unsigned long addr); |
149 | 149 | ||
@@ -626,6 +626,10 @@ struct signal_struct { | |||
626 | 626 | ||
627 | int oom_adj; /* OOM kill score adjustment (bit shift) */ | 627 | int oom_adj; /* OOM kill score adjustment (bit shift) */ |
628 | int oom_score_adj; /* OOM kill score adjustment */ | 628 | int oom_score_adj; /* OOM kill score adjustment */ |
629 | |||
630 | struct mutex cred_guard_mutex; /* guard against foreign influences on | ||
631 | * credential calculations | ||
632 | * (notably. ptrace) */ | ||
629 | }; | 633 | }; |
630 | 634 | ||
631 | /* Context switch must be unlocked if interrupts are to be enabled */ | 635 | /* Context switch must be unlocked if interrupts are to be enabled */ |
@@ -668,6 +672,9 @@ struct user_struct { | |||
668 | atomic_t inotify_watches; /* How many inotify watches does this user have? */ | 672 | atomic_t inotify_watches; /* How many inotify watches does this user have? */ |
669 | atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ | 673 | atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ |
670 | #endif | 674 | #endif |
675 | #ifdef CONFIG_FANOTIFY | ||
676 | atomic_t fanotify_listeners; | ||
677 | #endif | ||
671 | #ifdef CONFIG_EPOLL | 678 | #ifdef CONFIG_EPOLL |
672 | atomic_t epoll_watches; /* The number of file descriptors currently watched */ | 679 | atomic_t epoll_watches; /* The number of file descriptors currently watched */ |
673 | #endif | 680 | #endif |
@@ -855,6 +862,7 @@ struct sched_group { | |||
855 | * single CPU. | 862 | * single CPU. |
856 | */ | 863 | */ |
857 | unsigned int cpu_power, cpu_power_orig; | 864 | unsigned int cpu_power, cpu_power_orig; |
865 | unsigned int group_weight; | ||
858 | 866 | ||
859 | /* | 867 | /* |
860 | * The CPUs this group covers. | 868 | * The CPUs this group covers. |
@@ -1076,7 +1084,7 @@ struct sched_class { | |||
1076 | struct task_struct *task); | 1084 | struct task_struct *task); |
1077 | 1085 | ||
1078 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1086 | #ifdef CONFIG_FAIR_GROUP_SCHED |
1079 | void (*moved_group) (struct task_struct *p, int on_rq); | 1087 | void (*task_move_group) (struct task_struct *p, int on_rq); |
1080 | #endif | 1088 | #endif |
1081 | }; | 1089 | }; |
1082 | 1090 | ||
@@ -1305,9 +1313,6 @@ struct task_struct { | |||
1305 | * credentials (COW) */ | 1313 | * credentials (COW) */ |
1306 | const struct cred __rcu *cred; /* effective (overridable) subjective task | 1314 | const struct cred __rcu *cred; /* effective (overridable) subjective task |
1307 | * credentials (COW) */ | 1315 | * credentials (COW) */ |
1308 | struct mutex cred_guard_mutex; /* guard against foreign influences on | ||
1309 | * credential calculations | ||
1310 | * (notably. ptrace) */ | ||
1311 | struct cred *replacement_session_keyring; /* for KEYCTL_SESSION_TO_PARENT */ | 1316 | struct cred *replacement_session_keyring; /* for KEYCTL_SESSION_TO_PARENT */ |
1312 | 1317 | ||
1313 | char comm[TASK_COMM_LEN]; /* executable name excluding path | 1318 | char comm[TASK_COMM_LEN]; /* executable name excluding path |
@@ -1706,7 +1711,6 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
1706 | #define PF_DUMPCORE 0x00000200 /* dumped core */ | 1711 | #define PF_DUMPCORE 0x00000200 /* dumped core */ |
1707 | #define PF_SIGNALED 0x00000400 /* killed by a signal */ | 1712 | #define PF_SIGNALED 0x00000400 /* killed by a signal */ |
1708 | #define PF_MEMALLOC 0x00000800 /* Allocating memory */ | 1713 | #define PF_MEMALLOC 0x00000800 /* Allocating memory */ |
1709 | #define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ | ||
1710 | #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ | 1714 | #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ |
1711 | #define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ | 1715 | #define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ |
1712 | #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ | 1716 | #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ |
@@ -2237,9 +2241,16 @@ static inline void task_unlock(struct task_struct *p) | |||
2237 | spin_unlock(&p->alloc_lock); | 2241 | spin_unlock(&p->alloc_lock); |
2238 | } | 2242 | } |
2239 | 2243 | ||
2240 | extern struct sighand_struct *lock_task_sighand(struct task_struct *tsk, | 2244 | extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk, |
2241 | unsigned long *flags); | 2245 | unsigned long *flags); |
2242 | 2246 | ||
2247 | #define lock_task_sighand(tsk, flags) \ | ||
2248 | ({ struct sighand_struct *__ss; \ | ||
2249 | __cond_lock(&(tsk)->sighand->siglock, \ | ||
2250 | (__ss = __lock_task_sighand(tsk, flags))); \ | ||
2251 | __ss; \ | ||
2252 | }) \ | ||
2253 | |||
2243 | static inline void unlock_task_sighand(struct task_struct *tsk, | 2254 | static inline void unlock_task_sighand(struct task_struct *tsk, |
2244 | unsigned long *flags) | 2255 | unsigned long *flags) |
2245 | { | 2256 | { |
diff --git a/include/linux/security.h b/include/linux/security.h index b8246a8df7d2..fd4d55fb8845 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -77,7 +77,6 @@ extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, | |||
77 | extern int cap_task_setscheduler(struct task_struct *p); | 77 | extern int cap_task_setscheduler(struct task_struct *p); |
78 | extern int cap_task_setioprio(struct task_struct *p, int ioprio); | 78 | extern int cap_task_setioprio(struct task_struct *p, int ioprio); |
79 | extern int cap_task_setnice(struct task_struct *p, int nice); | 79 | extern int cap_task_setnice(struct task_struct *p, int nice); |
80 | extern int cap_syslog(int type, bool from_file); | ||
81 | extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); | 80 | extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); |
82 | 81 | ||
83 | struct msghdr; | 82 | struct msghdr; |
@@ -1388,7 +1387,7 @@ struct security_operations { | |||
1388 | int (*sysctl) (struct ctl_table *table, int op); | 1387 | int (*sysctl) (struct ctl_table *table, int op); |
1389 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); | 1388 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); |
1390 | int (*quota_on) (struct dentry *dentry); | 1389 | int (*quota_on) (struct dentry *dentry); |
1391 | int (*syslog) (int type, bool from_file); | 1390 | int (*syslog) (int type); |
1392 | int (*settime) (struct timespec *ts, struct timezone *tz); | 1391 | int (*settime) (struct timespec *ts, struct timezone *tz); |
1393 | int (*vm_enough_memory) (struct mm_struct *mm, long pages); | 1392 | int (*vm_enough_memory) (struct mm_struct *mm, long pages); |
1394 | 1393 | ||
@@ -1671,7 +1670,7 @@ int security_real_capable_noaudit(struct task_struct *tsk, int cap); | |||
1671 | int security_sysctl(struct ctl_table *table, int op); | 1670 | int security_sysctl(struct ctl_table *table, int op); |
1672 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); | 1671 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); |
1673 | int security_quota_on(struct dentry *dentry); | 1672 | int security_quota_on(struct dentry *dentry); |
1674 | int security_syslog(int type, bool from_file); | 1673 | int security_syslog(int type); |
1675 | int security_settime(struct timespec *ts, struct timezone *tz); | 1674 | int security_settime(struct timespec *ts, struct timezone *tz); |
1676 | int security_vm_enough_memory(long pages); | 1675 | int security_vm_enough_memory(long pages); |
1677 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); | 1676 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); |
@@ -1901,9 +1900,9 @@ static inline int security_quota_on(struct dentry *dentry) | |||
1901 | return 0; | 1900 | return 0; |
1902 | } | 1901 | } |
1903 | 1902 | ||
1904 | static inline int security_syslog(int type, bool from_file) | 1903 | static inline int security_syslog(int type) |
1905 | { | 1904 | { |
1906 | return cap_syslog(type, from_file); | 1905 | return 0; |
1907 | } | 1906 | } |
1908 | 1907 | ||
1909 | static inline int security_settime(struct timespec *ts, struct timezone *tz) | 1908 | static inline int security_settime(struct timespec *ts, struct timezone *tz) |
diff --git a/include/linux/semaphore.h b/include/linux/semaphore.h index 5310d27abd2a..39fa04966aa8 100644 --- a/include/linux/semaphore.h +++ b/include/linux/semaphore.h | |||
@@ -29,9 +29,6 @@ struct semaphore { | |||
29 | #define DEFINE_SEMAPHORE(name) \ | 29 | #define DEFINE_SEMAPHORE(name) \ |
30 | struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) | 30 | struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) |
31 | 31 | ||
32 | #define DECLARE_MUTEX(name) \ | ||
33 | struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) | ||
34 | |||
35 | static inline void sema_init(struct semaphore *sem, int val) | 32 | static inline void sema_init(struct semaphore *sem, int val) |
36 | { | 33 | { |
37 | static struct lock_class_key __key; | 34 | static struct lock_class_key __key; |
@@ -39,9 +36,6 @@ static inline void sema_init(struct semaphore *sem, int val) | |||
39 | lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0); | 36 | lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0); |
40 | } | 37 | } |
41 | 38 | ||
42 | #define init_MUTEX(sem) sema_init(sem, 1) | ||
43 | #define init_MUTEX_LOCKED(sem) sema_init(sem, 0) | ||
44 | |||
45 | extern void down(struct semaphore *sem); | 39 | extern void down(struct semaphore *sem); |
46 | extern int __must_check down_interruptible(struct semaphore *sem); | 40 | extern int __must_check down_interruptible(struct semaphore *sem); |
47 | extern int __must_check down_killable(struct semaphore *sem); | 41 | extern int __must_check down_killable(struct semaphore *sem); |
diff --git a/include/linux/sfi.h b/include/linux/sfi.h index 0299b4ce63db..7f770c638e99 100644 --- a/include/linux/sfi.h +++ b/include/linux/sfi.h | |||
@@ -70,9 +70,6 @@ | |||
70 | #define SFI_SIG_APIC "APIC" | 70 | #define SFI_SIG_APIC "APIC" |
71 | #define SFI_SIG_XSDT "XSDT" | 71 | #define SFI_SIG_XSDT "XSDT" |
72 | #define SFI_SIG_WAKE "WAKE" | 72 | #define SFI_SIG_WAKE "WAKE" |
73 | #define SFI_SIG_SPIB "SPIB" | ||
74 | #define SFI_SIG_I2CB "I2CB" | ||
75 | #define SFI_SIG_GPEM "GPEM" | ||
76 | #define SFI_SIG_DEVS "DEVS" | 73 | #define SFI_SIG_DEVS "DEVS" |
77 | #define SFI_SIG_GPIO "GPIO" | 74 | #define SFI_SIG_GPIO "GPIO" |
78 | 75 | ||
@@ -168,27 +165,6 @@ struct sfi_gpio_table_entry { | |||
168 | char pin_name[16]; | 165 | char pin_name[16]; |
169 | } __packed; | 166 | } __packed; |
170 | 167 | ||
171 | struct sfi_spi_table_entry { | ||
172 | u16 host_num; /* attached to host 0, 1...*/ | ||
173 | u16 cs; /* chip select */ | ||
174 | u16 irq_info; | ||
175 | char name[16]; | ||
176 | u8 dev_info[10]; | ||
177 | } __packed; | ||
178 | |||
179 | struct sfi_i2c_table_entry { | ||
180 | u16 host_num; | ||
181 | u16 addr; /* slave addr */ | ||
182 | u16 irq_info; | ||
183 | char name[16]; | ||
184 | u8 dev_info[10]; | ||
185 | } __packed; | ||
186 | |||
187 | struct sfi_gpe_table_entry { | ||
188 | u16 logical_id; /* logical id */ | ||
189 | u16 phys_id; /* physical GPE id */ | ||
190 | } __packed; | ||
191 | |||
192 | typedef int (*sfi_table_handler) (struct sfi_table_header *table); | 168 | typedef int (*sfi_table_handler) (struct sfi_table_header *table); |
193 | 169 | ||
194 | #ifdef CONFIG_SFI | 170 | #ifdef CONFIG_SFI |
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h index 4dca992f3093..9a52f72527dc 100644 --- a/include/linux/sh_clk.h +++ b/include/linux/sh_clk.h | |||
@@ -19,11 +19,13 @@ struct clk_mapping { | |||
19 | }; | 19 | }; |
20 | 20 | ||
21 | struct clk_ops { | 21 | struct clk_ops { |
22 | #ifdef CONFIG_SH_CLK_CPG_LEGACY | ||
22 | void (*init)(struct clk *clk); | 23 | void (*init)(struct clk *clk); |
24 | #endif | ||
23 | int (*enable)(struct clk *clk); | 25 | int (*enable)(struct clk *clk); |
24 | void (*disable)(struct clk *clk); | 26 | void (*disable)(struct clk *clk); |
25 | unsigned long (*recalc)(struct clk *clk); | 27 | unsigned long (*recalc)(struct clk *clk); |
26 | int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id); | 28 | int (*set_rate)(struct clk *clk, unsigned long rate); |
27 | int (*set_parent)(struct clk *clk, struct clk *parent); | 29 | int (*set_parent)(struct clk *clk, struct clk *parent); |
28 | long (*round_rate)(struct clk *clk, unsigned long rate); | 30 | long (*round_rate)(struct clk *clk, unsigned long rate); |
29 | }; | 31 | }; |
@@ -67,36 +69,6 @@ int clk_register(struct clk *); | |||
67 | void clk_unregister(struct clk *); | 69 | void clk_unregister(struct clk *); |
68 | void clk_enable_init_clocks(void); | 70 | void clk_enable_init_clocks(void); |
69 | 71 | ||
70 | /** | ||
71 | * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter | ||
72 | * @clk: clock source | ||
73 | * @rate: desired clock rate in Hz | ||
74 | * @algo_id: algorithm id to be passed down to ops->set_rate | ||
75 | * | ||
76 | * Returns success (0) or negative errno. | ||
77 | */ | ||
78 | int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id); | ||
79 | |||
80 | enum clk_sh_algo_id { | ||
81 | NO_CHANGE = 0, | ||
82 | |||
83 | IUS_N1_N1, | ||
84 | IUS_322, | ||
85 | IUS_522, | ||
86 | IUS_N11, | ||
87 | |||
88 | SB_N1, | ||
89 | |||
90 | SB3_N1, | ||
91 | SB3_32, | ||
92 | SB3_43, | ||
93 | SB3_54, | ||
94 | |||
95 | BP_N1, | ||
96 | |||
97 | IP_N1, | ||
98 | }; | ||
99 | |||
100 | struct clk_div_mult_table { | 72 | struct clk_div_mult_table { |
101 | unsigned int *divisors; | 73 | unsigned int *divisors; |
102 | unsigned int nr_divisors; | 74 | unsigned int nr_divisors; |
@@ -122,6 +94,10 @@ int clk_rate_table_find(struct clk *clk, | |||
122 | long clk_rate_div_range_round(struct clk *clk, unsigned int div_min, | 94 | long clk_rate_div_range_round(struct clk *clk, unsigned int div_min, |
123 | unsigned int div_max, unsigned long rate); | 95 | unsigned int div_max, unsigned long rate); |
124 | 96 | ||
97 | long clk_round_parent(struct clk *clk, unsigned long target, | ||
98 | unsigned long *best_freq, unsigned long *parent_freq, | ||
99 | unsigned int div_min, unsigned int div_max); | ||
100 | |||
125 | #define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \ | 101 | #define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \ |
126 | { \ | 102 | { \ |
127 | .parent = _parent, \ | 103 | .parent = _parent, \ |
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h index b4f183a31f13..5812fefbcedf 100644 --- a/include/linux/sh_intc.h +++ b/include/linux/sh_intc.h | |||
@@ -79,7 +79,7 @@ struct intc_hw_desc { | |||
79 | unsigned int nr_subgroups; | 79 | unsigned int nr_subgroups; |
80 | }; | 80 | }; |
81 | 81 | ||
82 | #define _INTC_ARRAY(a) a, a == NULL ? 0 : sizeof(a)/sizeof(*a) | 82 | #define _INTC_ARRAY(a) a, __same_type(a, NULL) ? 0 : sizeof(a)/sizeof(*a) |
83 | 83 | ||
84 | #define INTC_HW_DESC(vectors, groups, mask_regs, \ | 84 | #define INTC_HW_DESC(vectors, groups, mask_regs, \ |
85 | prio_regs, sense_regs, ack_regs) \ | 85 | prio_regs, sense_regs, ack_regs) \ |
@@ -129,7 +129,4 @@ static inline int register_intc_userimask(unsigned long addr) | |||
129 | } | 129 | } |
130 | #endif | 130 | #endif |
131 | 131 | ||
132 | int reserve_irq_vector(unsigned int irq); | ||
133 | void reserve_irq_legacy(void); | ||
134 | |||
135 | #endif /* __SH_INTC_H */ | 132 | #endif /* __SH_INTC_H */ |
diff --git a/include/linux/sh_timer.h b/include/linux/sh_timer.h index 864bd56bd3b0..4d9dcd138315 100644 --- a/include/linux/sh_timer.h +++ b/include/linux/sh_timer.h | |||
@@ -5,7 +5,6 @@ struct sh_timer_config { | |||
5 | char *name; | 5 | char *name; |
6 | long channel_offset; | 6 | long channel_offset; |
7 | int timer_bit; | 7 | int timer_bit; |
8 | char *clk; | ||
9 | unsigned long clockevent_rating; | 8 | unsigned long clockevent_rating; |
10 | unsigned long clocksource_rating; | 9 | unsigned long clocksource_rating; |
11 | }; | 10 | }; |
diff --git a/include/linux/smb.h b/include/linux/smb.h deleted file mode 100644 index 82fefddc5987..000000000000 --- a/include/linux/smb.h +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | /* | ||
2 | * smb.h | ||
3 | * | ||
4 | * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke | ||
5 | * Copyright (C) 1997 by Volker Lendecke | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_SMB_H | ||
10 | #define _LINUX_SMB_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | #include <linux/magic.h> | ||
14 | #ifdef __KERNEL__ | ||
15 | #include <linux/time.h> | ||
16 | #endif | ||
17 | |||
18 | enum smb_protocol { | ||
19 | SMB_PROTOCOL_NONE, | ||
20 | SMB_PROTOCOL_CORE, | ||
21 | SMB_PROTOCOL_COREPLUS, | ||
22 | SMB_PROTOCOL_LANMAN1, | ||
23 | SMB_PROTOCOL_LANMAN2, | ||
24 | SMB_PROTOCOL_NT1 | ||
25 | }; | ||
26 | |||
27 | enum smb_case_hndl { | ||
28 | SMB_CASE_DEFAULT, | ||
29 | SMB_CASE_LOWER, | ||
30 | SMB_CASE_UPPER | ||
31 | }; | ||
32 | |||
33 | struct smb_dskattr { | ||
34 | __u16 total; | ||
35 | __u16 allocblocks; | ||
36 | __u16 blocksize; | ||
37 | __u16 free; | ||
38 | }; | ||
39 | |||
40 | struct smb_conn_opt { | ||
41 | |||
42 | /* The socket */ | ||
43 | unsigned int fd; | ||
44 | |||
45 | enum smb_protocol protocol; | ||
46 | enum smb_case_hndl case_handling; | ||
47 | |||
48 | /* Connection-Options */ | ||
49 | |||
50 | __u32 max_xmit; | ||
51 | __u16 server_uid; | ||
52 | __u16 tid; | ||
53 | |||
54 | /* The following are LANMAN 1.0 options */ | ||
55 | __u16 secmode; | ||
56 | __u16 maxmux; | ||
57 | __u16 maxvcs; | ||
58 | __u16 rawmode; | ||
59 | __u32 sesskey; | ||
60 | |||
61 | /* The following are NT LM 0.12 options */ | ||
62 | __u32 maxraw; | ||
63 | __u32 capabilities; | ||
64 | __s16 serverzone; | ||
65 | }; | ||
66 | |||
67 | #ifdef __KERNEL__ | ||
68 | |||
69 | #define SMB_NLS_MAXNAMELEN 20 | ||
70 | struct smb_nls_codepage { | ||
71 | char local_name[SMB_NLS_MAXNAMELEN]; | ||
72 | char remote_name[SMB_NLS_MAXNAMELEN]; | ||
73 | }; | ||
74 | |||
75 | |||
76 | #define SMB_MAXNAMELEN 255 | ||
77 | #define SMB_MAXPATHLEN 1024 | ||
78 | |||
79 | /* | ||
80 | * Contains all relevant data on a SMB networked file. | ||
81 | */ | ||
82 | struct smb_fattr { | ||
83 | __u16 attr; | ||
84 | |||
85 | unsigned long f_ino; | ||
86 | umode_t f_mode; | ||
87 | nlink_t f_nlink; | ||
88 | uid_t f_uid; | ||
89 | gid_t f_gid; | ||
90 | dev_t f_rdev; | ||
91 | loff_t f_size; | ||
92 | struct timespec f_atime; | ||
93 | struct timespec f_mtime; | ||
94 | struct timespec f_ctime; | ||
95 | unsigned long f_blocks; | ||
96 | int f_unix; | ||
97 | }; | ||
98 | |||
99 | enum smb_conn_state { | ||
100 | CONN_VALID, /* everything's fine */ | ||
101 | CONN_INVALID, /* Something went wrong, but did not | ||
102 | try to reconnect yet. */ | ||
103 | CONN_RETRIED, /* Tried a reconnection, but was refused */ | ||
104 | CONN_RETRYING /* Currently trying to reconnect */ | ||
105 | }; | ||
106 | |||
107 | #define SMB_HEADER_LEN 37 /* includes everything up to, but not | ||
108 | * including smb_bcc */ | ||
109 | |||
110 | #define SMB_INITIAL_PACKET_SIZE 4000 | ||
111 | #define SMB_MAX_PACKET_SIZE 32768 | ||
112 | |||
113 | /* reserve this much space for trans2 parameters. Shouldn't have to be more | ||
114 | than 10 or so, but OS/2 seems happier like this. */ | ||
115 | #define SMB_TRANS2_MAX_PARAM 64 | ||
116 | |||
117 | #endif | ||
118 | #endif | ||
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h deleted file mode 100644 index 923cd8a247b1..000000000000 --- a/include/linux/smb_fs.h +++ /dev/null | |||
@@ -1,153 +0,0 @@ | |||
1 | /* | ||
2 | * smb_fs.h | ||
3 | * | ||
4 | * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke | ||
5 | * Copyright (C) 1997 by Volker Lendecke | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_SMB_FS_H | ||
10 | #define _LINUX_SMB_FS_H | ||
11 | |||
12 | #include <linux/smb.h> | ||
13 | |||
14 | /* | ||
15 | * ioctl commands | ||
16 | */ | ||
17 | #define SMB_IOC_GETMOUNTUID _IOR('u', 1, __kernel_old_uid_t) | ||
18 | #define SMB_IOC_NEWCONN _IOW('u', 2, struct smb_conn_opt) | ||
19 | |||
20 | /* __kernel_uid_t can never change, so we have to use __kernel_uid32_t */ | ||
21 | #define SMB_IOC_GETMOUNTUID32 _IOR('u', 3, __kernel_uid32_t) | ||
22 | |||
23 | |||
24 | #ifdef __KERNEL__ | ||
25 | #include <linux/smb_fs_i.h> | ||
26 | #include <linux/smb_fs_sb.h> | ||
27 | |||
28 | #include <linux/fs.h> | ||
29 | #include <linux/pagemap.h> | ||
30 | #include <linux/vmalloc.h> | ||
31 | #include <linux/smb_mount.h> | ||
32 | #include <linux/jiffies.h> | ||
33 | #include <asm/unaligned.h> | ||
34 | |||
35 | static inline struct smb_sb_info *SMB_SB(struct super_block *sb) | ||
36 | { | ||
37 | return sb->s_fs_info; | ||
38 | } | ||
39 | |||
40 | static inline struct smb_inode_info *SMB_I(struct inode *inode) | ||
41 | { | ||
42 | return container_of(inode, struct smb_inode_info, vfs_inode); | ||
43 | } | ||
44 | |||
45 | /* macro names are short for word, double-word, long value (?) */ | ||
46 | #define WVAL(buf, pos) (get_unaligned_le16((u8 *)(buf) + (pos))) | ||
47 | #define DVAL(buf, pos) (get_unaligned_le32((u8 *)(buf) + (pos))) | ||
48 | #define LVAL(buf, pos) (get_unaligned_le64((u8 *)(buf) + (pos))) | ||
49 | |||
50 | #define WSET(buf, pos, val) put_unaligned_le16((val), (u8 *)(buf) + (pos)) | ||
51 | #define DSET(buf, pos, val) put_unaligned_le32((val), (u8 *)(buf) + (pos)) | ||
52 | #define LSET(buf, pos, val) put_unaligned_le64((val), (u8 *)(buf) + (pos)) | ||
53 | |||
54 | /* where to find the base of the SMB packet proper */ | ||
55 | #define smb_base(buf) ((u8 *)(((u8 *)(buf))+4)) | ||
56 | |||
57 | /* | ||
58 | * Flags for the in-memory inode | ||
59 | */ | ||
60 | #define SMB_F_LOCALWRITE 0x02 /* file modified locally */ | ||
61 | |||
62 | |||
63 | /* NT1 protocol capability bits */ | ||
64 | #define SMB_CAP_RAW_MODE 0x00000001 | ||
65 | #define SMB_CAP_MPX_MODE 0x00000002 | ||
66 | #define SMB_CAP_UNICODE 0x00000004 | ||
67 | #define SMB_CAP_LARGE_FILES 0x00000008 | ||
68 | #define SMB_CAP_NT_SMBS 0x00000010 | ||
69 | #define SMB_CAP_RPC_REMOTE_APIS 0x00000020 | ||
70 | #define SMB_CAP_STATUS32 0x00000040 | ||
71 | #define SMB_CAP_LEVEL_II_OPLOCKS 0x00000080 | ||
72 | #define SMB_CAP_LOCK_AND_READ 0x00000100 | ||
73 | #define SMB_CAP_NT_FIND 0x00000200 | ||
74 | #define SMB_CAP_DFS 0x00001000 | ||
75 | #define SMB_CAP_LARGE_READX 0x00004000 | ||
76 | #define SMB_CAP_LARGE_WRITEX 0x00008000 | ||
77 | #define SMB_CAP_UNIX 0x00800000 /* unofficial ... */ | ||
78 | |||
79 | |||
80 | /* | ||
81 | * This is the time we allow an inode, dentry or dir cache to live. It is bad | ||
82 | * for performance to have shorter ttl on an inode than on the cache. It can | ||
83 | * cause refresh on each inode for a dir listing ... one-by-one | ||
84 | */ | ||
85 | #define SMB_MAX_AGE(server) (((server)->mnt->ttl * HZ) / 1000) | ||
86 | |||
87 | static inline void | ||
88 | smb_age_dentry(struct smb_sb_info *server, struct dentry *dentry) | ||
89 | { | ||
90 | dentry->d_time = jiffies - SMB_MAX_AGE(server); | ||
91 | } | ||
92 | |||
93 | struct smb_cache_head { | ||
94 | time_t mtime; /* unused */ | ||
95 | unsigned long time; /* cache age */ | ||
96 | unsigned long end; /* last valid fpos in cache */ | ||
97 | int eof; | ||
98 | }; | ||
99 | |||
100 | #define SMB_DIRCACHE_SIZE ((int)(PAGE_CACHE_SIZE/sizeof(struct dentry *))) | ||
101 | union smb_dir_cache { | ||
102 | struct smb_cache_head head; | ||
103 | struct dentry *dentry[SMB_DIRCACHE_SIZE]; | ||
104 | }; | ||
105 | |||
106 | #define SMB_FIRSTCACHE_SIZE ((int)((SMB_DIRCACHE_SIZE * \ | ||
107 | sizeof(struct dentry *) - sizeof(struct smb_cache_head)) / \ | ||
108 | sizeof(struct dentry *))) | ||
109 | |||
110 | #define SMB_DIRCACHE_START (SMB_DIRCACHE_SIZE - SMB_FIRSTCACHE_SIZE) | ||
111 | |||
112 | struct smb_cache_control { | ||
113 | struct smb_cache_head head; | ||
114 | struct page *page; | ||
115 | union smb_dir_cache *cache; | ||
116 | unsigned long fpos, ofs; | ||
117 | int filled, valid, idx; | ||
118 | }; | ||
119 | |||
120 | #define SMB_OPS_NUM_STATIC 5 | ||
121 | struct smb_ops { | ||
122 | int (*read)(struct inode *inode, loff_t offset, int count, | ||
123 | char *data); | ||
124 | int (*write)(struct inode *inode, loff_t offset, int count, const | ||
125 | char *data); | ||
126 | int (*readdir)(struct file *filp, void *dirent, filldir_t filldir, | ||
127 | struct smb_cache_control *ctl); | ||
128 | |||
129 | int (*getattr)(struct smb_sb_info *server, struct dentry *dir, | ||
130 | struct smb_fattr *fattr); | ||
131 | /* int (*setattr)(...); */ /* setattr is really icky! */ | ||
132 | |||
133 | int (*truncate)(struct inode *inode, loff_t length); | ||
134 | |||
135 | |||
136 | /* --- --- --- end of "static" entries --- --- --- */ | ||
137 | |||
138 | int (*convert)(unsigned char *output, int olen, | ||
139 | const unsigned char *input, int ilen, | ||
140 | struct nls_table *nls_from, | ||
141 | struct nls_table *nls_to); | ||
142 | }; | ||
143 | |||
144 | static inline int | ||
145 | smb_is_open(struct inode *i) | ||
146 | { | ||
147 | return (SMB_I(i)->open == server_from_inode(i)->generation); | ||
148 | } | ||
149 | |||
150 | extern void smb_install_null_ops(struct smb_ops *); | ||
151 | #endif /* __KERNEL__ */ | ||
152 | |||
153 | #endif /* _LINUX_SMB_FS_H */ | ||
diff --git a/include/linux/smb_fs_i.h b/include/linux/smb_fs_i.h deleted file mode 100644 index 8ccf4eca2c3d..000000000000 --- a/include/linux/smb_fs_i.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * smb_fs_i.h | ||
3 | * | ||
4 | * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke | ||
5 | * Copyright (C) 1997 by Volker Lendecke | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_SMB_FS_I | ||
10 | #define _LINUX_SMB_FS_I | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | #include <linux/fs.h> | ||
14 | |||
15 | /* | ||
16 | * smb fs inode data (in memory only) | ||
17 | */ | ||
18 | struct smb_inode_info { | ||
19 | |||
20 | /* | ||
21 | * file handles are local to a connection. A file is open if | ||
22 | * (open == generation). | ||
23 | */ | ||
24 | unsigned int open; /* open generation */ | ||
25 | __u16 fileid; /* What id to handle a file with? */ | ||
26 | __u16 attr; /* Attribute fields, DOS value */ | ||
27 | |||
28 | __u16 access; /* Access mode */ | ||
29 | __u16 flags; | ||
30 | unsigned long oldmtime; /* last time refreshed */ | ||
31 | unsigned long closed; /* timestamp when closed */ | ||
32 | unsigned openers; /* number of fileid users */ | ||
33 | |||
34 | struct inode vfs_inode; /* must be at the end */ | ||
35 | }; | ||
36 | |||
37 | #endif | ||
diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h deleted file mode 100644 index bb947dd1fba9..000000000000 --- a/include/linux/smb_fs_sb.h +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | /* | ||
2 | * smb_fs_sb.h | ||
3 | * | ||
4 | * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke | ||
5 | * Copyright (C) 1997 by Volker Lendecke | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef _SMB_FS_SB | ||
10 | #define _SMB_FS_SB | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | #include <linux/backing-dev.h> | ||
14 | #include <linux/smb.h> | ||
15 | |||
16 | /* | ||
17 | * Upper limit on the total number of active smb_request structs. | ||
18 | */ | ||
19 | #define MAX_REQUEST_HARD 256 | ||
20 | |||
21 | enum smb_receive_state { | ||
22 | SMB_RECV_START, /* No data read, looking for length + sig */ | ||
23 | SMB_RECV_HEADER, /* Reading the header data */ | ||
24 | SMB_RECV_HCOMPLETE, /* Done with the header */ | ||
25 | SMB_RECV_PARAM, /* Reading parameter words */ | ||
26 | SMB_RECV_DATA, /* Reading data bytes */ | ||
27 | SMB_RECV_END, /* End of request */ | ||
28 | SMB_RECV_DROP, /* Dropping this SMB */ | ||
29 | SMB_RECV_REQUEST, /* Received a request and not a reply */ | ||
30 | }; | ||
31 | |||
32 | /* structure access macros */ | ||
33 | #define server_from_inode(inode) SMB_SB((inode)->i_sb) | ||
34 | #define server_from_dentry(dentry) SMB_SB((dentry)->d_sb) | ||
35 | #define SB_of(server) ((server)->super_block) | ||
36 | |||
37 | struct smb_sb_info { | ||
38 | /* List of all smbfs superblocks */ | ||
39 | struct list_head entry; | ||
40 | |||
41 | enum smb_conn_state state; | ||
42 | struct file * sock_file; | ||
43 | int conn_error; | ||
44 | enum smb_receive_state rstate; | ||
45 | |||
46 | atomic_t nr_requests; | ||
47 | struct list_head xmitq; | ||
48 | struct list_head recvq; | ||
49 | u16 mid; | ||
50 | |||
51 | struct smb_mount_data_kernel *mnt; | ||
52 | |||
53 | /* Connections are counted. Each time a new socket arrives, | ||
54 | * generation is incremented. | ||
55 | */ | ||
56 | unsigned int generation; | ||
57 | struct pid *conn_pid; | ||
58 | struct smb_conn_opt opt; | ||
59 | wait_queue_head_t conn_wq; | ||
60 | int conn_complete; | ||
61 | struct semaphore sem; | ||
62 | |||
63 | unsigned char header[SMB_HEADER_LEN + 20*2 + 2]; | ||
64 | u32 header_len; | ||
65 | u32 smb_len; | ||
66 | u32 smb_read; | ||
67 | |||
68 | /* We use our own data_ready callback, but need the original one */ | ||
69 | void *data_ready; | ||
70 | |||
71 | /* nls pointers for codepage conversions */ | ||
72 | struct nls_table *remote_nls; | ||
73 | struct nls_table *local_nls; | ||
74 | |||
75 | struct smb_ops *ops; | ||
76 | |||
77 | struct super_block *super_block; | ||
78 | |||
79 | struct backing_dev_info bdi; | ||
80 | }; | ||
81 | |||
82 | static inline int | ||
83 | smb_lock_server_interruptible(struct smb_sb_info *server) | ||
84 | { | ||
85 | return down_interruptible(&(server->sem)); | ||
86 | } | ||
87 | |||
88 | static inline void | ||
89 | smb_lock_server(struct smb_sb_info *server) | ||
90 | { | ||
91 | down(&(server->sem)); | ||
92 | } | ||
93 | |||
94 | static inline void | ||
95 | smb_unlock_server(struct smb_sb_info *server) | ||
96 | { | ||
97 | up(&(server->sem)); | ||
98 | } | ||
99 | |||
100 | #endif | ||
diff --git a/include/linux/smb_mount.h b/include/linux/smb_mount.h deleted file mode 100644 index d10f00cb5703..000000000000 --- a/include/linux/smb_mount.h +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | /* | ||
2 | * smb_mount.h | ||
3 | * | ||
4 | * Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke | ||
5 | * Copyright (C) 1997 by Volker Lendecke | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_SMB_MOUNT_H | ||
10 | #define _LINUX_SMB_MOUNT_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | #define SMB_MOUNT_VERSION 6 | ||
15 | |||
16 | struct smb_mount_data { | ||
17 | int version; | ||
18 | __kernel_uid_t mounted_uid; /* Who may umount() this filesystem? */ | ||
19 | __kernel_uid_t uid; | ||
20 | __kernel_gid_t gid; | ||
21 | __kernel_mode_t file_mode; | ||
22 | __kernel_mode_t dir_mode; | ||
23 | }; | ||
24 | |||
25 | |||
26 | #ifdef __KERNEL__ | ||
27 | |||
28 | /* "vers" in big-endian */ | ||
29 | #define SMB_MOUNT_ASCII 0x76657273 | ||
30 | |||
31 | #define SMB_MOUNT_OLDVERSION 6 | ||
32 | #undef SMB_MOUNT_VERSION | ||
33 | #define SMB_MOUNT_VERSION 7 | ||
34 | |||
35 | /* flags */ | ||
36 | #define SMB_MOUNT_WIN95 0x0001 /* Win 95 server */ | ||
37 | #define SMB_MOUNT_OLDATTR 0x0002 /* Use core getattr (Win 95 speedup) */ | ||
38 | #define SMB_MOUNT_DIRATTR 0x0004 /* Use find_first for getattr */ | ||
39 | #define SMB_MOUNT_CASE 0x0008 /* Be case sensitive */ | ||
40 | #define SMB_MOUNT_UNICODE 0x0010 /* Server talks unicode */ | ||
41 | #define SMB_MOUNT_UID 0x0020 /* Use user specified uid */ | ||
42 | #define SMB_MOUNT_GID 0x0040 /* Use user specified gid */ | ||
43 | #define SMB_MOUNT_FMODE 0x0080 /* Use user specified file mode */ | ||
44 | #define SMB_MOUNT_DMODE 0x0100 /* Use user specified dir mode */ | ||
45 | |||
46 | struct smb_mount_data_kernel { | ||
47 | int version; | ||
48 | |||
49 | uid_t mounted_uid; /* Who may umount() this filesystem? */ | ||
50 | uid_t uid; | ||
51 | gid_t gid; | ||
52 | mode_t file_mode; | ||
53 | mode_t dir_mode; | ||
54 | |||
55 | u32 flags; | ||
56 | |||
57 | /* maximum age in jiffies (inode, dentry and dircache) */ | ||
58 | int ttl; | ||
59 | |||
60 | struct smb_nls_codepage codepage; | ||
61 | }; | ||
62 | |||
63 | #endif | ||
64 | |||
65 | #endif | ||
diff --git a/include/linux/smbno.h b/include/linux/smbno.h deleted file mode 100644 index f99e02d9ffe2..000000000000 --- a/include/linux/smbno.h +++ /dev/null | |||
@@ -1,363 +0,0 @@ | |||
1 | #ifndef _SMBNO_H_ | ||
2 | #define _SMBNO_H_ | ||
3 | |||
4 | /* these define the attribute byte as seen by DOS */ | ||
5 | #define aRONLY (1L<<0) | ||
6 | #define aHIDDEN (1L<<1) | ||
7 | #define aSYSTEM (1L<<2) | ||
8 | #define aVOLID (1L<<3) | ||
9 | #define aDIR (1L<<4) | ||
10 | #define aARCH (1L<<5) | ||
11 | |||
12 | /* error classes */ | ||
13 | #define SUCCESS 0 /* The request was successful. */ | ||
14 | #define ERRDOS 0x01 /* Error is from the core DOS operating system set. */ | ||
15 | #define ERRSRV 0x02 /* Error is generated by the server network file manager.*/ | ||
16 | #define ERRHRD 0x03 /* Error is an hardware error. */ | ||
17 | #define ERRCMD 0xFF /* Command was not in the "SMB" format. */ | ||
18 | |||
19 | /* SMB X/Open error codes for the ERRdos error class */ | ||
20 | |||
21 | #define ERRbadfunc 1 /* Invalid function (or system call) */ | ||
22 | #define ERRbadfile 2 /* File not found (pathname error) */ | ||
23 | #define ERRbadpath 3 /* Directory not found */ | ||
24 | #define ERRnofids 4 /* Too many open files */ | ||
25 | #define ERRnoaccess 5 /* Access denied */ | ||
26 | #define ERRbadfid 6 /* Invalid fid */ | ||
27 | #define ERRbadmcb 7 /* Memory control blocks destroyed */ | ||
28 | #define ERRnomem 8 /* Out of memory */ | ||
29 | #define ERRbadmem 9 /* Invalid memory block address */ | ||
30 | #define ERRbadenv 10 /* Invalid environment */ | ||
31 | #define ERRbadformat 11 /* Invalid format */ | ||
32 | #define ERRbadaccess 12 /* Invalid open mode */ | ||
33 | #define ERRbaddata 13 /* Invalid data (only from ioctl call) */ | ||
34 | #define ERRres 14 /* reserved */ | ||
35 | #define ERRbaddrive 15 /* Invalid drive */ | ||
36 | #define ERRremcd 16 /* Attempt to delete current directory */ | ||
37 | #define ERRdiffdevice 17 /* rename/move across different filesystems */ | ||
38 | #define ERRnofiles 18 /* no more files found in file search */ | ||
39 | #define ERRbadshare 32 /* Share mode on file conflict with open mode */ | ||
40 | #define ERRlock 33 /* Lock request conflicts with existing lock */ | ||
41 | #define ERRfilexists 80 /* File in operation already exists */ | ||
42 | #define ERRbadpipe 230 /* Named pipe invalid */ | ||
43 | #define ERRpipebusy 231 /* All instances of pipe are busy */ | ||
44 | #define ERRpipeclosing 232 /* named pipe close in progress */ | ||
45 | #define ERRnotconnected 233 /* No process on other end of named pipe */ | ||
46 | #define ERRmoredata 234 /* More data to be returned */ | ||
47 | |||
48 | #define ERROR_INVALID_PARAMETER 87 | ||
49 | #define ERROR_DISK_FULL 112 | ||
50 | #define ERROR_INVALID_NAME 123 | ||
51 | #define ERROR_DIR_NOT_EMPTY 145 | ||
52 | #define ERROR_NOT_LOCKED 158 | ||
53 | #define ERROR_ALREADY_EXISTS 183 /* see also 80 ? */ | ||
54 | #define ERROR_EAS_DIDNT_FIT 275 /* Extended attributes didn't fit */ | ||
55 | #define ERROR_EAS_NOT_SUPPORTED 282 /* Extended attributes not supported */ | ||
56 | |||
57 | /* Error codes for the ERRSRV class */ | ||
58 | |||
59 | #define ERRerror 1 /* Non specific error code */ | ||
60 | #define ERRbadpw 2 /* Bad password */ | ||
61 | #define ERRbadtype 3 /* reserved */ | ||
62 | #define ERRaccess 4 /* No permissions to do the requested operation */ | ||
63 | #define ERRinvnid 5 /* tid invalid */ | ||
64 | #define ERRinvnetname 6 /* Invalid servername */ | ||
65 | #define ERRinvdevice 7 /* Invalid device */ | ||
66 | #define ERRqfull 49 /* Print queue full */ | ||
67 | #define ERRqtoobig 50 /* Queued item too big */ | ||
68 | #define ERRinvpfid 52 /* Invalid print file in smb_fid */ | ||
69 | #define ERRsmbcmd 64 /* Unrecognised command */ | ||
70 | #define ERRsrverror 65 /* smb server internal error */ | ||
71 | #define ERRfilespecs 67 /* fid and pathname invalid combination */ | ||
72 | #define ERRbadlink 68 /* reserved */ | ||
73 | #define ERRbadpermits 69 /* Access specified for a file is not valid */ | ||
74 | #define ERRbadpid 70 /* reserved */ | ||
75 | #define ERRsetattrmode 71 /* attribute mode invalid */ | ||
76 | #define ERRpaused 81 /* Message server paused */ | ||
77 | #define ERRmsgoff 82 /* Not receiving messages */ | ||
78 | #define ERRnoroom 83 /* No room for message */ | ||
79 | #define ERRrmuns 87 /* too many remote usernames */ | ||
80 | #define ERRtimeout 88 /* operation timed out */ | ||
81 | #define ERRnoresource 89 /* No resources currently available for request. */ | ||
82 | #define ERRtoomanyuids 90 /* too many userids */ | ||
83 | #define ERRbaduid 91 /* bad userid */ | ||
84 | #define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */ | ||
85 | #define ERRuseSTD 251 /* temporarily unable to use raw mode, use std.mode */ | ||
86 | #define ERRcontMPX 252 /* resume MPX mode */ | ||
87 | #define ERRbadPW /* reserved */ | ||
88 | #define ERRnosupport 0xFFFF | ||
89 | |||
90 | /* Error codes for the ERRHRD class */ | ||
91 | |||
92 | #define ERRnowrite 19 /* read only media */ | ||
93 | #define ERRbadunit 20 /* Unknown device */ | ||
94 | #define ERRnotready 21 /* Drive not ready */ | ||
95 | #define ERRbadcmd 22 /* Unknown command */ | ||
96 | #define ERRdata 23 /* Data (CRC) error */ | ||
97 | #define ERRbadreq 24 /* Bad request structure length */ | ||
98 | #define ERRseek 25 | ||
99 | #define ERRbadmedia 26 | ||
100 | #define ERRbadsector 27 | ||
101 | #define ERRnopaper 28 | ||
102 | #define ERRwrite 29 /* write fault */ | ||
103 | #define ERRread 30 /* read fault */ | ||
104 | #define ERRgeneral 31 /* General hardware failure */ | ||
105 | #define ERRwrongdisk 34 | ||
106 | #define ERRFCBunavail 35 | ||
107 | #define ERRsharebufexc 36 /* share buffer exceeded */ | ||
108 | #define ERRdiskfull 39 | ||
109 | |||
110 | /* | ||
111 | * Access modes when opening a file | ||
112 | */ | ||
113 | #define SMB_ACCMASK 0x0003 | ||
114 | #define SMB_O_RDONLY 0x0000 | ||
115 | #define SMB_O_WRONLY 0x0001 | ||
116 | #define SMB_O_RDWR 0x0002 | ||
117 | |||
118 | /* offsets into message for common items */ | ||
119 | #define smb_com 8 | ||
120 | #define smb_rcls 9 | ||
121 | #define smb_reh 10 | ||
122 | #define smb_err 11 | ||
123 | #define smb_flg 13 | ||
124 | #define smb_flg2 14 | ||
125 | #define smb_reb 13 | ||
126 | #define smb_tid 28 | ||
127 | #define smb_pid 30 | ||
128 | #define smb_uid 32 | ||
129 | #define smb_mid 34 | ||
130 | #define smb_wct 36 | ||
131 | #define smb_vwv 37 | ||
132 | #define smb_vwv0 37 | ||
133 | #define smb_vwv1 39 | ||
134 | #define smb_vwv2 41 | ||
135 | #define smb_vwv3 43 | ||
136 | #define smb_vwv4 45 | ||
137 | #define smb_vwv5 47 | ||
138 | #define smb_vwv6 49 | ||
139 | #define smb_vwv7 51 | ||
140 | #define smb_vwv8 53 | ||
141 | #define smb_vwv9 55 | ||
142 | #define smb_vwv10 57 | ||
143 | #define smb_vwv11 59 | ||
144 | #define smb_vwv12 61 | ||
145 | #define smb_vwv13 63 | ||
146 | #define smb_vwv14 65 | ||
147 | |||
148 | /* these are the trans2 sub fields for primary requests */ | ||
149 | #define smb_tpscnt smb_vwv0 | ||
150 | #define smb_tdscnt smb_vwv1 | ||
151 | #define smb_mprcnt smb_vwv2 | ||
152 | #define smb_mdrcnt smb_vwv3 | ||
153 | #define smb_msrcnt smb_vwv4 | ||
154 | #define smb_flags smb_vwv5 | ||
155 | #define smb_timeout smb_vwv6 | ||
156 | #define smb_pscnt smb_vwv9 | ||
157 | #define smb_psoff smb_vwv10 | ||
158 | #define smb_dscnt smb_vwv11 | ||
159 | #define smb_dsoff smb_vwv12 | ||
160 | #define smb_suwcnt smb_vwv13 | ||
161 | #define smb_setup smb_vwv14 | ||
162 | #define smb_setup0 smb_setup | ||
163 | #define smb_setup1 (smb_setup+2) | ||
164 | #define smb_setup2 (smb_setup+4) | ||
165 | |||
166 | /* these are for the secondary requests */ | ||
167 | #define smb_spscnt smb_vwv2 | ||
168 | #define smb_spsoff smb_vwv3 | ||
169 | #define smb_spsdisp smb_vwv4 | ||
170 | #define smb_sdscnt smb_vwv5 | ||
171 | #define smb_sdsoff smb_vwv6 | ||
172 | #define smb_sdsdisp smb_vwv7 | ||
173 | #define smb_sfid smb_vwv8 | ||
174 | |||
175 | /* and these for responses */ | ||
176 | #define smb_tprcnt smb_vwv0 | ||
177 | #define smb_tdrcnt smb_vwv1 | ||
178 | #define smb_prcnt smb_vwv3 | ||
179 | #define smb_proff smb_vwv4 | ||
180 | #define smb_prdisp smb_vwv5 | ||
181 | #define smb_drcnt smb_vwv6 | ||
182 | #define smb_droff smb_vwv7 | ||
183 | #define smb_drdisp smb_vwv8 | ||
184 | |||
185 | /* the complete */ | ||
186 | #define SMBmkdir 0x00 /* create directory */ | ||
187 | #define SMBrmdir 0x01 /* delete directory */ | ||
188 | #define SMBopen 0x02 /* open file */ | ||
189 | #define SMBcreate 0x03 /* create file */ | ||
190 | #define SMBclose 0x04 /* close file */ | ||
191 | #define SMBflush 0x05 /* flush file */ | ||
192 | #define SMBunlink 0x06 /* delete file */ | ||
193 | #define SMBmv 0x07 /* rename file */ | ||
194 | #define SMBgetatr 0x08 /* get file attributes */ | ||
195 | #define SMBsetatr 0x09 /* set file attributes */ | ||
196 | #define SMBread 0x0A /* read from file */ | ||
197 | #define SMBwrite 0x0B /* write to file */ | ||
198 | #define SMBlock 0x0C /* lock byte range */ | ||
199 | #define SMBunlock 0x0D /* unlock byte range */ | ||
200 | #define SMBctemp 0x0E /* create temporary file */ | ||
201 | #define SMBmknew 0x0F /* make new file */ | ||
202 | #define SMBchkpth 0x10 /* check directory path */ | ||
203 | #define SMBexit 0x11 /* process exit */ | ||
204 | #define SMBlseek 0x12 /* seek */ | ||
205 | #define SMBtcon 0x70 /* tree connect */ | ||
206 | #define SMBtconX 0x75 /* tree connect and X*/ | ||
207 | #define SMBtdis 0x71 /* tree disconnect */ | ||
208 | #define SMBnegprot 0x72 /* negotiate protocol */ | ||
209 | #define SMBdskattr 0x80 /* get disk attributes */ | ||
210 | #define SMBsearch 0x81 /* search directory */ | ||
211 | #define SMBsplopen 0xC0 /* open print spool file */ | ||
212 | #define SMBsplwr 0xC1 /* write to print spool file */ | ||
213 | #define SMBsplclose 0xC2 /* close print spool file */ | ||
214 | #define SMBsplretq 0xC3 /* return print queue */ | ||
215 | #define SMBsends 0xD0 /* send single block message */ | ||
216 | #define SMBsendb 0xD1 /* send broadcast message */ | ||
217 | #define SMBfwdname 0xD2 /* forward user name */ | ||
218 | #define SMBcancelf 0xD3 /* cancel forward */ | ||
219 | #define SMBgetmac 0xD4 /* get machine name */ | ||
220 | #define SMBsendstrt 0xD5 /* send start of multi-block message */ | ||
221 | #define SMBsendend 0xD6 /* send end of multi-block message */ | ||
222 | #define SMBsendtxt 0xD7 /* send text of multi-block message */ | ||
223 | |||
224 | /* Core+ protocol */ | ||
225 | #define SMBlockread 0x13 /* Lock a range and read */ | ||
226 | #define SMBwriteunlock 0x14 /* Unlock a range then write */ | ||
227 | #define SMBreadbraw 0x1a /* read a block of data with no smb header */ | ||
228 | #define SMBwritebraw 0x1d /* write a block of data with no smb header */ | ||
229 | #define SMBwritec 0x20 /* secondary write request */ | ||
230 | #define SMBwriteclose 0x2c /* write a file then close it */ | ||
231 | |||
232 | /* dos extended protocol */ | ||
233 | #define SMBreadBraw 0x1A /* read block raw */ | ||
234 | #define SMBreadBmpx 0x1B /* read block multiplexed */ | ||
235 | #define SMBreadBs 0x1C /* read block (secondary response) */ | ||
236 | #define SMBwriteBraw 0x1D /* write block raw */ | ||
237 | #define SMBwriteBmpx 0x1E /* write block multiplexed */ | ||
238 | #define SMBwriteBs 0x1F /* write block (secondary request) */ | ||
239 | #define SMBwriteC 0x20 /* write complete response */ | ||
240 | #define SMBsetattrE 0x22 /* set file attributes expanded */ | ||
241 | #define SMBgetattrE 0x23 /* get file attributes expanded */ | ||
242 | #define SMBlockingX 0x24 /* lock/unlock byte ranges and X */ | ||
243 | #define SMBtrans 0x25 /* transaction - name, bytes in/out */ | ||
244 | #define SMBtranss 0x26 /* transaction (secondary request/response) */ | ||
245 | #define SMBioctl 0x27 /* IOCTL */ | ||
246 | #define SMBioctls 0x28 /* IOCTL (secondary request/response) */ | ||
247 | #define SMBcopy 0x29 /* copy */ | ||
248 | #define SMBmove 0x2A /* move */ | ||
249 | #define SMBecho 0x2B /* echo */ | ||
250 | #define SMBopenX 0x2D /* open and X */ | ||
251 | #define SMBreadX 0x2E /* read and X */ | ||
252 | #define SMBwriteX 0x2F /* write and X */ | ||
253 | #define SMBsesssetupX 0x73 /* Session Set Up & X (including User Logon) */ | ||
254 | #define SMBtconX 0x75 /* tree connect and X */ | ||
255 | #define SMBffirst 0x82 /* find first */ | ||
256 | #define SMBfunique 0x83 /* find unique */ | ||
257 | #define SMBfclose 0x84 /* find close */ | ||
258 | #define SMBinvalid 0xFE /* invalid command */ | ||
259 | |||
260 | |||
261 | /* Extended 2.0 protocol */ | ||
262 | #define SMBtrans2 0x32 /* TRANS2 protocol set */ | ||
263 | #define SMBtranss2 0x33 /* TRANS2 protocol set, secondary command */ | ||
264 | #define SMBfindclose 0x34 /* Terminate a TRANSACT2_FINDFIRST */ | ||
265 | #define SMBfindnclose 0x35 /* Terminate a TRANSACT2_FINDNOTIFYFIRST */ | ||
266 | #define SMBulogoffX 0x74 /* user logoff */ | ||
267 | |||
268 | /* these are the TRANS2 sub commands */ | ||
269 | #define TRANSACT2_OPEN 0 | ||
270 | #define TRANSACT2_FINDFIRST 1 | ||
271 | #define TRANSACT2_FINDNEXT 2 | ||
272 | #define TRANSACT2_QFSINFO 3 | ||
273 | #define TRANSACT2_SETFSINFO 4 | ||
274 | #define TRANSACT2_QPATHINFO 5 | ||
275 | #define TRANSACT2_SETPATHINFO 6 | ||
276 | #define TRANSACT2_QFILEINFO 7 | ||
277 | #define TRANSACT2_SETFILEINFO 8 | ||
278 | #define TRANSACT2_FSCTL 9 | ||
279 | #define TRANSACT2_IOCTL 10 | ||
280 | #define TRANSACT2_FINDNOTIFYFIRST 11 | ||
281 | #define TRANSACT2_FINDNOTIFYNEXT 12 | ||
282 | #define TRANSACT2_MKDIR 13 | ||
283 | |||
284 | /* Information Levels - Shared? */ | ||
285 | #define SMB_INFO_STANDARD 1 | ||
286 | #define SMB_INFO_QUERY_EA_SIZE 2 | ||
287 | #define SMB_INFO_QUERY_EAS_FROM_LIST 3 | ||
288 | #define SMB_INFO_QUERY_ALL_EAS 4 | ||
289 | #define SMB_INFO_IS_NAME_VALID 6 | ||
290 | |||
291 | /* Information Levels - TRANSACT2_FINDFIRST */ | ||
292 | #define SMB_FIND_FILE_DIRECTORY_INFO 0x101 | ||
293 | #define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102 | ||
294 | #define SMB_FIND_FILE_NAMES_INFO 0x103 | ||
295 | #define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104 | ||
296 | |||
297 | /* Information Levels - TRANSACT2_QPATHINFO */ | ||
298 | #define SMB_QUERY_FILE_BASIC_INFO 0x101 | ||
299 | #define SMB_QUERY_FILE_STANDARD_INFO 0x102 | ||
300 | #define SMB_QUERY_FILE_EA_INFO 0x103 | ||
301 | #define SMB_QUERY_FILE_NAME_INFO 0x104 | ||
302 | #define SMB_QUERY_FILE_ALL_INFO 0x107 | ||
303 | #define SMB_QUERY_FILE_ALT_NAME_INFO 0x108 | ||
304 | #define SMB_QUERY_FILE_STREAM_INFO 0x109 | ||
305 | #define SMB_QUERY_FILE_COMPRESSION_INFO 0x10b | ||
306 | |||
307 | /* Information Levels - TRANSACT2_SETFILEINFO */ | ||
308 | #define SMB_SET_FILE_BASIC_INFO 0x101 | ||
309 | #define SMB_SET_FILE_DISPOSITION_INFO 0x102 | ||
310 | #define SMB_SET_FILE_ALLOCATION_INFO 0x103 | ||
311 | #define SMB_SET_FILE_END_OF_FILE_INFO 0x104 | ||
312 | |||
313 | /* smb_flg field flags */ | ||
314 | #define SMB_FLAGS_SUPPORT_LOCKREAD 0x01 | ||
315 | #define SMB_FLAGS_CLIENT_BUF_AVAIL 0x02 | ||
316 | #define SMB_FLAGS_RESERVED 0x04 | ||
317 | #define SMB_FLAGS_CASELESS_PATHNAMES 0x08 | ||
318 | #define SMB_FLAGS_CANONICAL_PATHNAMES 0x10 | ||
319 | #define SMB_FLAGS_REQUEST_OPLOCK 0x20 | ||
320 | #define SMB_FLAGS_REQUEST_BATCH_OPLOCK 0x40 | ||
321 | #define SMB_FLAGS_REPLY 0x80 | ||
322 | |||
323 | /* smb_flg2 field flags (samba-2.2.0/source/include/smb.h) */ | ||
324 | #define SMB_FLAGS2_LONG_PATH_COMPONENTS 0x0001 | ||
325 | #define SMB_FLAGS2_EXTENDED_ATTRIBUTES 0x0002 | ||
326 | #define SMB_FLAGS2_DFS_PATHNAMES 0x1000 | ||
327 | #define SMB_FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000 | ||
328 | #define SMB_FLAGS2_32_BIT_ERROR_CODES 0x4000 | ||
329 | #define SMB_FLAGS2_UNICODE_STRINGS 0x8000 | ||
330 | |||
331 | |||
332 | /* | ||
333 | * UNIX stuff (from samba trans2.h) | ||
334 | */ | ||
335 | #define MIN_UNIX_INFO_LEVEL 0x200 | ||
336 | #define MAX_UNIX_INFO_LEVEL 0x2FF | ||
337 | #define SMB_FIND_FILE_UNIX 0x202 | ||
338 | #define SMB_QUERY_FILE_UNIX_BASIC 0x200 | ||
339 | #define SMB_QUERY_FILE_UNIX_LINK 0x201 | ||
340 | #define SMB_QUERY_FILE_UNIX_HLINK 0x202 | ||
341 | #define SMB_SET_FILE_UNIX_BASIC 0x200 | ||
342 | #define SMB_SET_FILE_UNIX_LINK 0x201 | ||
343 | #define SMB_SET_FILE_UNIX_HLINK 0x203 | ||
344 | #define SMB_QUERY_CIFS_UNIX_INFO 0x200 | ||
345 | |||
346 | /* values which means "don't change it" */ | ||
347 | #define SMB_MODE_NO_CHANGE 0xFFFFFFFF | ||
348 | #define SMB_UID_NO_CHANGE 0xFFFFFFFF | ||
349 | #define SMB_GID_NO_CHANGE 0xFFFFFFFF | ||
350 | #define SMB_TIME_NO_CHANGE 0xFFFFFFFFFFFFFFFFULL | ||
351 | #define SMB_SIZE_NO_CHANGE 0xFFFFFFFFFFFFFFFFULL | ||
352 | |||
353 | /* UNIX filetype mappings. */ | ||
354 | #define UNIX_TYPE_FILE 0 | ||
355 | #define UNIX_TYPE_DIR 1 | ||
356 | #define UNIX_TYPE_SYMLINK 2 | ||
357 | #define UNIX_TYPE_CHARDEV 3 | ||
358 | #define UNIX_TYPE_BLKDEV 4 | ||
359 | #define UNIX_TYPE_FIFO 5 | ||
360 | #define UNIX_TYPE_SOCKET 6 | ||
361 | #define UNIX_TYPE_UNKNOWN 0xFFFFFFFF | ||
362 | |||
363 | #endif /* _SMBNO_H_ */ | ||
diff --git a/include/linux/smp.h b/include/linux/smp.h index cfa2d20e35f1..6dc95cac6b3d 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -13,9 +13,10 @@ | |||
13 | 13 | ||
14 | extern void cpu_idle(void); | 14 | extern void cpu_idle(void); |
15 | 15 | ||
16 | typedef void (*smp_call_func_t)(void *info); | ||
16 | struct call_single_data { | 17 | struct call_single_data { |
17 | struct list_head list; | 18 | struct list_head list; |
18 | void (*func) (void *info); | 19 | smp_call_func_t func; |
19 | void *info; | 20 | void *info; |
20 | u16 flags; | 21 | u16 flags; |
21 | u16 priv; | 22 | u16 priv; |
@@ -24,8 +25,8 @@ struct call_single_data { | |||
24 | /* total number of cpus in this system (may exceed NR_CPUS) */ | 25 | /* total number of cpus in this system (may exceed NR_CPUS) */ |
25 | extern unsigned int total_cpus; | 26 | extern unsigned int total_cpus; |
26 | 27 | ||
27 | int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, | 28 | int smp_call_function_single(int cpuid, smp_call_func_t func, void *info, |
28 | int wait); | 29 | int wait); |
29 | 30 | ||
30 | #ifdef CONFIG_SMP | 31 | #ifdef CONFIG_SMP |
31 | 32 | ||
@@ -69,15 +70,15 @@ extern void smp_cpus_done(unsigned int max_cpus); | |||
69 | /* | 70 | /* |
70 | * Call a function on all other processors | 71 | * Call a function on all other processors |
71 | */ | 72 | */ |
72 | int smp_call_function(void(*func)(void *info), void *info, int wait); | 73 | int smp_call_function(smp_call_func_t func, void *info, int wait); |
73 | void smp_call_function_many(const struct cpumask *mask, | 74 | void smp_call_function_many(const struct cpumask *mask, |
74 | void (*func)(void *info), void *info, bool wait); | 75 | smp_call_func_t func, void *info, bool wait); |
75 | 76 | ||
76 | void __smp_call_function_single(int cpuid, struct call_single_data *data, | 77 | void __smp_call_function_single(int cpuid, struct call_single_data *data, |
77 | int wait); | 78 | int wait); |
78 | 79 | ||
79 | int smp_call_function_any(const struct cpumask *mask, | 80 | int smp_call_function_any(const struct cpumask *mask, |
80 | void (*func)(void *info), void *info, int wait); | 81 | smp_call_func_t func, void *info, int wait); |
81 | 82 | ||
82 | /* | 83 | /* |
83 | * Generic and arch helpers | 84 | * Generic and arch helpers |
@@ -94,7 +95,7 @@ void ipi_call_unlock_irq(void); | |||
94 | /* | 95 | /* |
95 | * Call a function on all processors | 96 | * Call a function on all processors |
96 | */ | 97 | */ |
97 | int on_each_cpu(void (*func) (void *info), void *info, int wait); | 98 | int on_each_cpu(smp_call_func_t func, void *info, int wait); |
98 | 99 | ||
99 | #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ | 100 | #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ |
100 | #define MSG_ALL 0x8001 | 101 | #define MSG_ALL 0x8001 |
@@ -122,7 +123,7 @@ static inline void smp_send_stop(void) { } | |||
122 | * These macros fold the SMP functionality into a single CPU system | 123 | * These macros fold the SMP functionality into a single CPU system |
123 | */ | 124 | */ |
124 | #define raw_smp_processor_id() 0 | 125 | #define raw_smp_processor_id() 0 |
125 | static inline int up_smp_call_function(void (*func)(void *), void *info) | 126 | static inline int up_smp_call_function(smp_call_func_t func, void *info) |
126 | { | 127 | { |
127 | return 0; | 128 | return 0; |
128 | } | 129 | } |
@@ -143,7 +144,7 @@ static inline void smp_send_reschedule(int cpu) { } | |||
143 | static inline void init_call_single_data(void) { } | 144 | static inline void init_call_single_data(void) { } |
144 | 145 | ||
145 | static inline int | 146 | static inline int |
146 | smp_call_function_any(const struct cpumask *mask, void (*func)(void *info), | 147 | smp_call_function_any(const struct cpumask *mask, smp_call_func_t func, |
147 | void *info, int wait) | 148 | void *info, int wait) |
148 | { | 149 | { |
149 | return smp_call_function_single(0, func, info, wait); | 150 | return smp_call_function_single(0, func, info, wait); |
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h index 291f721144c2..3a1988202731 100644 --- a/include/linux/smp_lock.h +++ b/include/linux/smp_lock.h | |||
@@ -4,8 +4,6 @@ | |||
4 | #ifdef CONFIG_LOCK_KERNEL | 4 | #ifdef CONFIG_LOCK_KERNEL |
5 | #include <linux/sched.h> | 5 | #include <linux/sched.h> |
6 | 6 | ||
7 | #define kernel_locked() (current->lock_depth >= 0) | ||
8 | |||
9 | extern int __lockfunc __reacquire_kernel_lock(void); | 7 | extern int __lockfunc __reacquire_kernel_lock(void); |
10 | extern void __lockfunc __release_kernel_lock(void); | 8 | extern void __lockfunc __release_kernel_lock(void); |
11 | 9 | ||
@@ -58,7 +56,6 @@ static inline void cycle_kernel_lock(void) | |||
58 | #define lock_kernel() | 56 | #define lock_kernel() |
59 | #define unlock_kernel() | 57 | #define unlock_kernel() |
60 | #define cycle_kernel_lock() do { } while(0) | 58 | #define cycle_kernel_lock() do { } while(0) |
61 | #define kernel_locked() 1 | ||
62 | #endif /* CONFIG_BKL */ | 59 | #endif /* CONFIG_BKL */ |
63 | 60 | ||
64 | #define release_kernel_lock(task) do { } while(0) | 61 | #define release_kernel_lock(task) do { } while(0) |
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index ebb0c80ffd6e..12b2b18e50c1 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
@@ -230,6 +230,7 @@ enum | |||
230 | LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */ | 230 | LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */ |
231 | LINUX_MIB_TCPDEFERACCEPTDROP, | 231 | LINUX_MIB_TCPDEFERACCEPTDROP, |
232 | LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */ | 232 | LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */ |
233 | LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */ | ||
233 | __LINUX_MIB_MAX | 234 | __LINUX_MIB_MAX |
234 | }; | 235 | }; |
235 | 236 | ||
diff --git a/include/linux/socket.h b/include/linux/socket.h index 5146b50202ce..86b652fabf6e 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -322,7 +322,7 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata, | |||
322 | int offset, | 322 | int offset, |
323 | unsigned int len, __wsum *csump); | 323 | unsigned int len, __wsum *csump); |
324 | 324 | ||
325 | extern long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); | 325 | extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); |
326 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); | 326 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); |
327 | extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, | 327 | extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, |
328 | int offset, int len); | 328 | int offset, int len); |
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h new file mode 100644 index 000000000000..d85c52f294a0 --- /dev/null +++ b/include/linux/spi/74x164.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef LINUX_SPI_74X164_H | ||
2 | #define LINUX_SPI_74X164_H | ||
3 | |||
4 | #define GEN_74X164_DRIVER_NAME "74x164" | ||
5 | |||
6 | struct gen_74x164_chip_platform_data { | ||
7 | /* number assigned to the first GPIO */ | ||
8 | unsigned base; | ||
9 | }; | ||
10 | |||
11 | #endif | ||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 92e52a1e6af3..b4d7710bc38d 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -204,6 +204,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
204 | /** | 204 | /** |
205 | * struct spi_master - interface to SPI master controller | 205 | * struct spi_master - interface to SPI master controller |
206 | * @dev: device interface to this driver | 206 | * @dev: device interface to this driver |
207 | * @list: link with the global spi_master list | ||
207 | * @bus_num: board-specific (and often SOC-specific) identifier for a | 208 | * @bus_num: board-specific (and often SOC-specific) identifier for a |
208 | * given SPI controller. | 209 | * given SPI controller. |
209 | * @num_chipselect: chipselects are used to distinguish individual | 210 | * @num_chipselect: chipselects are used to distinguish individual |
@@ -238,6 +239,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
238 | struct spi_master { | 239 | struct spi_master { |
239 | struct device dev; | 240 | struct device dev; |
240 | 241 | ||
242 | struct list_head list; | ||
243 | |||
241 | /* other than negative (== assign one dynamically), bus_num is fully | 244 | /* other than negative (== assign one dynamically), bus_num is fully |
242 | * board-specific. usually that simplifies to being SOC-specific. | 245 | * board-specific. usually that simplifies to being SOC-specific. |
243 | * example: one SOC has three SPI controllers, numbered 0..2, | 246 | * example: one SOC has three SPI controllers, numbered 0..2, |
diff --git a/include/linux/ssb/ssb_driver_gige.h b/include/linux/ssb/ssb_driver_gige.h index 942e38736901..eba52a100533 100644 --- a/include/linux/ssb/ssb_driver_gige.h +++ b/include/linux/ssb/ssb_driver_gige.h | |||
@@ -96,16 +96,21 @@ static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev) | |||
96 | return 0; | 96 | return 0; |
97 | } | 97 | } |
98 | 98 | ||
99 | extern char * nvram_get(const char *name); | 99 | #ifdef CONFIG_BCM47XX |
100 | #include <asm/mach-bcm47xx/nvram.h> | ||
100 | /* Get the device MAC address */ | 101 | /* Get the device MAC address */ |
101 | static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr) | 102 | static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr) |
102 | { | 103 | { |
103 | #ifdef CONFIG_BCM47XX | 104 | char buf[20]; |
104 | char *res = nvram_get("et0macaddr"); | 105 | if (nvram_getenv("et0macaddr", buf, sizeof(buf)) < 0) |
105 | if (res) | 106 | return; |
106 | memcpy(macaddr, res, 6); | 107 | nvram_parse_macaddr(buf, macaddr); |
107 | #endif | ||
108 | } | 108 | } |
109 | #else | ||
110 | static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr) | ||
111 | { | ||
112 | } | ||
113 | #endif | ||
109 | 114 | ||
110 | extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev, | 115 | extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev, |
111 | struct pci_dev *pdev); | 116 | struct pci_dev *pdev); |
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index bbdb680ffbe9..aea0d438e3c7 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
@@ -82,18 +82,28 @@ struct svc_xprt { | |||
82 | struct net *xpt_net; | 82 | struct net *xpt_net; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | static inline void register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) | 85 | static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) |
86 | { | 86 | { |
87 | spin_lock(&xpt->xpt_lock); | 87 | spin_lock(&xpt->xpt_lock); |
88 | list_add(&u->list, &xpt->xpt_users); | 88 | list_del_init(&u->list); |
89 | spin_unlock(&xpt->xpt_lock); | 89 | spin_unlock(&xpt->xpt_lock); |
90 | } | 90 | } |
91 | 91 | ||
92 | static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) | 92 | static inline int register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) |
93 | { | 93 | { |
94 | spin_lock(&xpt->xpt_lock); | 94 | spin_lock(&xpt->xpt_lock); |
95 | list_del_init(&u->list); | 95 | if (test_bit(XPT_CLOSE, &xpt->xpt_flags)) { |
96 | /* | ||
97 | * The connection is about to be deleted soon (or, | ||
98 | * worse, may already be deleted--in which case we've | ||
99 | * already notified the xpt_users). | ||
100 | */ | ||
101 | spin_unlock(&xpt->xpt_lock); | ||
102 | return -ENOTCONN; | ||
103 | } | ||
104 | list_add(&u->list, &xpt->xpt_users); | ||
96 | spin_unlock(&xpt->xpt_lock); | 105 | spin_unlock(&xpt->xpt_lock); |
106 | return 0; | ||
97 | } | 107 | } |
98 | 108 | ||
99 | int svc_reg_xprt_class(struct svc_xprt_class *); | 109 | int svc_reg_xprt_class(struct svc_xprt_class *); |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 26697514c5ec..0e288e3c37be 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -258,23 +258,6 @@ static inline int hibernate(void) { return -ENOSYS; } | |||
258 | static inline bool system_entering_hibernation(void) { return false; } | 258 | static inline bool system_entering_hibernation(void) { return false; } |
259 | #endif /* CONFIG_HIBERNATION */ | 259 | #endif /* CONFIG_HIBERNATION */ |
260 | 260 | ||
261 | #ifdef CONFIG_SUSPEND_NVS | ||
262 | extern int suspend_nvs_register(unsigned long start, unsigned long size); | ||
263 | extern int suspend_nvs_alloc(void); | ||
264 | extern void suspend_nvs_free(void); | ||
265 | extern void suspend_nvs_save(void); | ||
266 | extern void suspend_nvs_restore(void); | ||
267 | #else /* CONFIG_SUSPEND_NVS */ | ||
268 | static inline int suspend_nvs_register(unsigned long a, unsigned long b) | ||
269 | { | ||
270 | return 0; | ||
271 | } | ||
272 | static inline int suspend_nvs_alloc(void) { return 0; } | ||
273 | static inline void suspend_nvs_free(void) {} | ||
274 | static inline void suspend_nvs_save(void) {} | ||
275 | static inline void suspend_nvs_restore(void) {} | ||
276 | #endif /* CONFIG_SUSPEND_NVS */ | ||
277 | |||
278 | #ifdef CONFIG_PM_SLEEP | 261 | #ifdef CONFIG_PM_SLEEP |
279 | void save_processor_state(void); | 262 | void save_processor_state(void); |
280 | void restore_processor_state(void); | 263 | void restore_processor_state(void); |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 7cdd63366f88..eba53e71d2cc 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -271,8 +271,18 @@ extern void scan_mapping_unevictable_pages(struct address_space *); | |||
271 | extern unsigned long scan_unevictable_pages; | 271 | extern unsigned long scan_unevictable_pages; |
272 | extern int scan_unevictable_handler(struct ctl_table *, int, | 272 | extern int scan_unevictable_handler(struct ctl_table *, int, |
273 | void __user *, size_t *, loff_t *); | 273 | void __user *, size_t *, loff_t *); |
274 | #ifdef CONFIG_NUMA | ||
274 | extern int scan_unevictable_register_node(struct node *node); | 275 | extern int scan_unevictable_register_node(struct node *node); |
275 | extern void scan_unevictable_unregister_node(struct node *node); | 276 | extern void scan_unevictable_unregister_node(struct node *node); |
277 | #else | ||
278 | static inline int scan_unevictable_register_node(struct node *node) | ||
279 | { | ||
280 | return 0; | ||
281 | } | ||
282 | static inline void scan_unevictable_unregister_node(struct node *node) | ||
283 | { | ||
284 | } | ||
285 | #endif | ||
276 | 286 | ||
277 | extern int kswapd_run(int nid); | 287 | extern int kswapd_run(int nid); |
278 | extern void kswapd_stop(int nid); | 288 | extern void kswapd_stop(int nid); |
diff --git a/include/linux/synclink.h b/include/linux/synclink.h index 0ff2779c44d0..2e7d81c4e5ad 100644 --- a/include/linux/synclink.h +++ b/include/linux/synclink.h | |||
@@ -126,6 +126,7 @@ | |||
126 | #define MGSL_MODE_BISYNC 4 | 126 | #define MGSL_MODE_BISYNC 4 |
127 | #define MGSL_MODE_RAW 6 | 127 | #define MGSL_MODE_RAW 6 |
128 | #define MGSL_MODE_BASE_CLOCK 7 | 128 | #define MGSL_MODE_BASE_CLOCK 7 |
129 | #define MGSL_MODE_XSYNC 8 | ||
129 | 130 | ||
130 | #define MGSL_BUS_TYPE_ISA 1 | 131 | #define MGSL_BUS_TYPE_ISA 1 |
131 | #define MGSL_BUS_TYPE_EISA 2 | 132 | #define MGSL_BUS_TYPE_EISA 2 |
@@ -290,6 +291,10 @@ struct gpio_desc { | |||
290 | #define MGSL_IOCSGPIO _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc) | 291 | #define MGSL_IOCSGPIO _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc) |
291 | #define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc) | 292 | #define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc) |
292 | #define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc) | 293 | #define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc) |
294 | #define MGSL_IOCSXSYNC _IO(MGSL_MAGIC_IOC, 19) | ||
295 | #define MGSL_IOCGXSYNC _IO(MGSL_MAGIC_IOC, 20) | ||
296 | #define MGSL_IOCSXCTRL _IO(MGSL_MAGIC_IOC, 21) | ||
297 | #define MGSL_IOCGXCTRL _IO(MGSL_MAGIC_IOC, 22) | ||
293 | 298 | ||
294 | #ifdef __KERNEL__ | 299 | #ifdef __KERNEL__ |
295 | /* provide 32 bit ioctl compatibility on 64 bit systems */ | 300 | /* provide 32 bit ioctl compatibility on 64 bit systems */ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index e6319d18a55d..cacc27a0e285 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -701,7 +701,8 @@ asmlinkage long sys_nfsservctl(int cmd, | |||
701 | asmlinkage long sys_syslog(int type, char __user *buf, int len); | 701 | asmlinkage long sys_syslog(int type, char __user *buf, int len); |
702 | asmlinkage long sys_uselib(const char __user *library); | 702 | asmlinkage long sys_uselib(const char __user *library); |
703 | asmlinkage long sys_ni_syscall(void); | 703 | asmlinkage long sys_ni_syscall(void); |
704 | asmlinkage long sys_ptrace(long request, long pid, long addr, long data); | 704 | asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, |
705 | unsigned long data); | ||
705 | 706 | ||
706 | asmlinkage long sys_add_key(const char __user *_type, | 707 | asmlinkage long sys_add_key(const char __user *_type, |
707 | const char __user *_description, | 708 | const char __user *_description, |
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h index 341dddb55090..2466e550a41d 100644 --- a/include/linux/taskstats.h +++ b/include/linux/taskstats.h | |||
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | 35 | ||
36 | #define TASKSTATS_VERSION 7 | 36 | #define TASKSTATS_VERSION 8 |
37 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN | 37 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN |
38 | * in linux/sched.h */ | 38 | * in linux/sched.h */ |
39 | 39 | ||
@@ -188,6 +188,7 @@ enum { | |||
188 | TASKSTATS_TYPE_STATS, /* taskstats structure */ | 188 | TASKSTATS_TYPE_STATS, /* taskstats structure */ |
189 | TASKSTATS_TYPE_AGGR_PID, /* contains pid + stats */ | 189 | TASKSTATS_TYPE_AGGR_PID, /* contains pid + stats */ |
190 | TASKSTATS_TYPE_AGGR_TGID, /* contains tgid + stats */ | 190 | TASKSTATS_TYPE_AGGR_TGID, /* contains tgid + stats */ |
191 | TASKSTATS_TYPE_NULL, /* contains nothing */ | ||
191 | __TASKSTATS_TYPE_MAX, | 192 | __TASKSTATS_TYPE_MAX, |
192 | }; | 193 | }; |
193 | 194 | ||
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h new file mode 100644 index 000000000000..4c7be2263011 --- /dev/null +++ b/include/linux/ti_wilink_st.h | |||
@@ -0,0 +1,400 @@ | |||
1 | /* | ||
2 | * Shared Transport Header file | ||
3 | * To be included by the protocol stack drivers for | ||
4 | * Texas Instruments BT,FM and GPS combo chip drivers | ||
5 | * and also serves the sub-modules of the shared transport driver. | ||
6 | * | ||
7 | * Copyright (C) 2009-2010 Texas Instruments | ||
8 | * Author: Pavan Savoy <pavan_savoy@ti.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #ifndef TI_WILINK_ST_H | ||
26 | #define TI_WILINK_ST_H | ||
27 | |||
28 | /** | ||
29 | * enum kim_gpio_state - Few protocols such as FM have ACTIVE LOW | ||
30 | * gpio states for their chip/core enable gpios | ||
31 | */ | ||
32 | enum kim_gpio_state { | ||
33 | KIM_GPIO_INACTIVE, | ||
34 | KIM_GPIO_ACTIVE, | ||
35 | }; | ||
36 | |||
37 | /** | ||
38 | * enum proto-type - The protocol on WiLink chips which share a | ||
39 | * common physical interface like UART. | ||
40 | */ | ||
41 | enum proto_type { | ||
42 | ST_BT, | ||
43 | ST_FM, | ||
44 | ST_GPS, | ||
45 | ST_MAX, | ||
46 | }; | ||
47 | |||
48 | /** | ||
49 | * struct st_proto_s - Per Protocol structure from BT/FM/GPS to ST | ||
50 | * @type: type of the protocol being registered among the | ||
51 | * available proto_type(BT, FM, GPS the protocol which share TTY). | ||
52 | * @recv: the receiver callback pointing to a function in the | ||
53 | * protocol drivers called by the ST driver upon receiving | ||
54 | * relevant data. | ||
55 | * @match_packet: reserved for future use, to make ST more generic | ||
56 | * @reg_complete_cb: callback handler pointing to a function in protocol | ||
57 | * handler called by ST when the pending registrations are complete. | ||
58 | * The registrations are marked pending, in situations when fw | ||
59 | * download is in progress. | ||
60 | * @write: pointer to function in ST provided to protocol drivers from ST, | ||
61 | * to be made use when protocol drivers have data to send to TTY. | ||
62 | * @priv_data: privdate data holder for the protocol drivers, sent | ||
63 | * from the protocol drivers during registration, and sent back on | ||
64 | * reg_complete_cb and recv. | ||
65 | */ | ||
66 | struct st_proto_s { | ||
67 | enum proto_type type; | ||
68 | long (*recv) (void *, struct sk_buff *); | ||
69 | unsigned char (*match_packet) (const unsigned char *data); | ||
70 | void (*reg_complete_cb) (void *, char data); | ||
71 | long (*write) (struct sk_buff *skb); | ||
72 | void *priv_data; | ||
73 | }; | ||
74 | |||
75 | extern long st_register(struct st_proto_s *); | ||
76 | extern long st_unregister(enum proto_type); | ||
77 | |||
78 | |||
79 | /* | ||
80 | * header information used by st_core.c | ||
81 | */ | ||
82 | |||
83 | /* states of protocol list */ | ||
84 | #define ST_NOTEMPTY 1 | ||
85 | #define ST_EMPTY 0 | ||
86 | |||
87 | /* | ||
88 | * possible st_states | ||
89 | */ | ||
90 | #define ST_INITIALIZING 1 | ||
91 | #define ST_REG_IN_PROGRESS 2 | ||
92 | #define ST_REG_PENDING 3 | ||
93 | #define ST_WAITING_FOR_RESP 4 | ||
94 | |||
95 | /** | ||
96 | * struct st_data_s - ST core internal structure | ||
97 | * @st_state: different states of ST like initializing, registration | ||
98 | * in progress, this is mainly used to return relevant err codes | ||
99 | * when protocol drivers are registering. It is also used to track | ||
100 | * the recv function, as in during fw download only HCI events | ||
101 | * can occur , where as during other times other events CH8, CH9 | ||
102 | * can occur. | ||
103 | * @tty: tty provided by the TTY core for line disciplines. | ||
104 | * @tx_skb: If for some reason the tty's write returns lesser bytes written | ||
105 | * then to maintain the rest of data to be written on next instance. | ||
106 | * This needs to be protected, hence the lock inside wakeup func. | ||
107 | * @tx_state: if the data is being written onto the TTY and protocol driver | ||
108 | * wants to send more, queue up data and mark that there is | ||
109 | * more data to send. | ||
110 | * @list: the list of protocols registered, only MAX can exist, one protocol | ||
111 | * can register only once. | ||
112 | * @rx_state: states to be maintained inside st's tty receive | ||
113 | * @rx_count: count to be maintained inside st's tty receieve | ||
114 | * @rx_skb: the skb where all data for a protocol gets accumulated, | ||
115 | * since tty might not call receive when a complete event packet | ||
116 | * is received, the states, count and the skb needs to be maintained. | ||
117 | * @txq: the list of skbs which needs to be sent onto the TTY. | ||
118 | * @tx_waitq: if the chip is not in AWAKE state, the skbs needs to be queued | ||
119 | * up in here, PM(WAKEUP_IND) data needs to be sent and then the skbs | ||
120 | * from waitq can be moved onto the txq. | ||
121 | * Needs locking too. | ||
122 | * @lock: the lock to protect skbs, queues, and ST states. | ||
123 | * @protos_registered: count of the protocols registered, also when 0 the | ||
124 | * chip enable gpio can be toggled, and when it changes to 1 the fw | ||
125 | * needs to be downloaded to initialize chip side ST. | ||
126 | * @ll_state: the various PM states the chip can be, the states are notified | ||
127 | * to us, when the chip sends relevant PM packets(SLEEP_IND, WAKE_IND). | ||
128 | * @kim_data: reference to the parent encapsulating structure. | ||
129 | * | ||
130 | */ | ||
131 | struct st_data_s { | ||
132 | unsigned long st_state; | ||
133 | struct tty_struct *tty; | ||
134 | struct sk_buff *tx_skb; | ||
135 | #define ST_TX_SENDING 1 | ||
136 | #define ST_TX_WAKEUP 2 | ||
137 | unsigned long tx_state; | ||
138 | struct st_proto_s *list[ST_MAX]; | ||
139 | unsigned long rx_state; | ||
140 | unsigned long rx_count; | ||
141 | struct sk_buff *rx_skb; | ||
142 | struct sk_buff_head txq, tx_waitq; | ||
143 | spinlock_t lock; | ||
144 | unsigned char protos_registered; | ||
145 | unsigned long ll_state; | ||
146 | void *kim_data; | ||
147 | }; | ||
148 | |||
149 | /** | ||
150 | * st_int_write - | ||
151 | * point this to tty->driver->write or tty->ops->write | ||
152 | * depending upon the kernel version | ||
153 | */ | ||
154 | int st_int_write(struct st_data_s*, const unsigned char*, int); | ||
155 | |||
156 | /** | ||
157 | * st_write - | ||
158 | * internal write function, passed onto protocol drivers | ||
159 | * via the write function ptr of protocol struct | ||
160 | */ | ||
161 | long st_write(struct sk_buff *); | ||
162 | |||
163 | /* function to be called from ST-LL */ | ||
164 | void st_ll_send_frame(enum proto_type, struct sk_buff *); | ||
165 | |||
166 | /* internal wake up function */ | ||
167 | void st_tx_wakeup(struct st_data_s *st_data); | ||
168 | |||
169 | /* init, exit entry funcs called from KIM */ | ||
170 | int st_core_init(struct st_data_s **); | ||
171 | void st_core_exit(struct st_data_s *); | ||
172 | |||
173 | /* ask for reference from KIM */ | ||
174 | void st_kim_ref(struct st_data_s **, int); | ||
175 | |||
176 | #define GPS_STUB_TEST | ||
177 | #ifdef GPS_STUB_TEST | ||
178 | int gps_chrdrv_stub_write(const unsigned char*, int); | ||
179 | void gps_chrdrv_stub_init(void); | ||
180 | #endif | ||
181 | |||
182 | /* | ||
183 | * header information used by st_kim.c | ||
184 | */ | ||
185 | |||
186 | /* time in msec to wait for | ||
187 | * line discipline to be installed | ||
188 | */ | ||
189 | #define LDISC_TIME 500 | ||
190 | #define CMD_RESP_TIME 500 | ||
191 | #define MAKEWORD(a, b) ((unsigned short)(((unsigned char)(a)) \ | ||
192 | | ((unsigned short)((unsigned char)(b))) << 8)) | ||
193 | |||
194 | #define GPIO_HIGH 1 | ||
195 | #define GPIO_LOW 0 | ||
196 | |||
197 | /* the Power-On-Reset logic, requires to attempt | ||
198 | * to download firmware onto chip more than once | ||
199 | * since the self-test for chip takes a while | ||
200 | */ | ||
201 | #define POR_RETRY_COUNT 5 | ||
202 | |||
203 | /** | ||
204 | * struct chip_version - save the chip version | ||
205 | */ | ||
206 | struct chip_version { | ||
207 | unsigned short full; | ||
208 | unsigned short chip; | ||
209 | unsigned short min_ver; | ||
210 | unsigned short maj_ver; | ||
211 | }; | ||
212 | |||
213 | /** | ||
214 | * struct kim_data_s - the KIM internal data, embedded as the | ||
215 | * platform's drv data. One for each ST device in the system. | ||
216 | * @uim_pid: KIM needs to communicate with UIM to request to install | ||
217 | * the ldisc by opening UART when protocol drivers register. | ||
218 | * @kim_pdev: the platform device added in one of the board-XX.c file | ||
219 | * in arch/XX/ directory, 1 for each ST device. | ||
220 | * @kim_rcvd: completion handler to notify when data was received, | ||
221 | * mainly used during fw download, which involves multiple send/wait | ||
222 | * for each of the HCI-VS commands. | ||
223 | * @ldisc_installed: completion handler to notify that the UIM accepted | ||
224 | * the request to install ldisc, notify from tty_open which suggests | ||
225 | * the ldisc was properly installed. | ||
226 | * @resp_buffer: data buffer for the .bts fw file name. | ||
227 | * @fw_entry: firmware class struct to request/release the fw. | ||
228 | * @gpios: the list of core/chip enable gpios for BT, FM and GPS cores. | ||
229 | * @rx_state: the rx state for kim's receive func during fw download. | ||
230 | * @rx_count: the rx count for the kim's receive func during fw download. | ||
231 | * @rx_skb: all of fw data might not come at once, and hence data storage for | ||
232 | * whole of the fw response, only HCI_EVENTs and hence diff from ST's | ||
233 | * response. | ||
234 | * @rfkill: rfkill data for each of the cores to be registered with rfkill. | ||
235 | * @rf_protos: proto types of the data registered with rfkill sub-system. | ||
236 | * @core_data: ST core's data, which mainly is the tty's disc_data | ||
237 | * @version: chip version available via a sysfs entry. | ||
238 | * | ||
239 | */ | ||
240 | struct kim_data_s { | ||
241 | long uim_pid; | ||
242 | struct platform_device *kim_pdev; | ||
243 | struct completion kim_rcvd, ldisc_installed; | ||
244 | char resp_buffer[30]; | ||
245 | const struct firmware *fw_entry; | ||
246 | long gpios[ST_MAX]; | ||
247 | unsigned long rx_state; | ||
248 | unsigned long rx_count; | ||
249 | struct sk_buff *rx_skb; | ||
250 | struct rfkill *rfkill[ST_MAX]; | ||
251 | enum proto_type rf_protos[ST_MAX]; | ||
252 | struct st_data_s *core_data; | ||
253 | struct chip_version version; | ||
254 | }; | ||
255 | |||
256 | /** | ||
257 | * functions called when 1 of the protocol drivers gets | ||
258 | * registered, these need to communicate with UIM to request | ||
259 | * ldisc installed, read chip_version, download relevant fw | ||
260 | */ | ||
261 | long st_kim_start(void *); | ||
262 | long st_kim_stop(void *); | ||
263 | |||
264 | void st_kim_recv(void *, const unsigned char *, long count); | ||
265 | void st_kim_chip_toggle(enum proto_type, enum kim_gpio_state); | ||
266 | void st_kim_complete(void *); | ||
267 | void kim_st_list_protocols(struct st_data_s *, void *); | ||
268 | |||
269 | /* | ||
270 | * BTS headers | ||
271 | */ | ||
272 | #define ACTION_SEND_COMMAND 1 | ||
273 | #define ACTION_WAIT_EVENT 2 | ||
274 | #define ACTION_SERIAL 3 | ||
275 | #define ACTION_DELAY 4 | ||
276 | #define ACTION_RUN_SCRIPT 5 | ||
277 | #define ACTION_REMARKS 6 | ||
278 | |||
279 | /** | ||
280 | * struct bts_header - the fw file is NOT binary which can | ||
281 | * be sent onto TTY as is. The .bts is more a script | ||
282 | * file which has different types of actions. | ||
283 | * Each such action needs to be parsed by the KIM and | ||
284 | * relevant procedure to be called. | ||
285 | */ | ||
286 | struct bts_header { | ||
287 | u32 magic; | ||
288 | u32 version; | ||
289 | u8 future[24]; | ||
290 | u8 actions[0]; | ||
291 | } __attribute__ ((packed)); | ||
292 | |||
293 | /** | ||
294 | * struct bts_action - Each .bts action has its own type of | ||
295 | * data. | ||
296 | */ | ||
297 | struct bts_action { | ||
298 | u16 type; | ||
299 | u16 size; | ||
300 | u8 data[0]; | ||
301 | } __attribute__ ((packed)); | ||
302 | |||
303 | struct bts_action_send { | ||
304 | u8 data[0]; | ||
305 | } __attribute__ ((packed)); | ||
306 | |||
307 | struct bts_action_wait { | ||
308 | u32 msec; | ||
309 | u32 size; | ||
310 | u8 data[0]; | ||
311 | } __attribute__ ((packed)); | ||
312 | |||
313 | struct bts_action_delay { | ||
314 | u32 msec; | ||
315 | } __attribute__ ((packed)); | ||
316 | |||
317 | struct bts_action_serial { | ||
318 | u32 baud; | ||
319 | u32 flow_control; | ||
320 | } __attribute__ ((packed)); | ||
321 | |||
322 | /** | ||
323 | * struct hci_command - the HCI-VS for intrepreting | ||
324 | * the change baud rate of host-side UART, which | ||
325 | * needs to be ignored, since UIM would do that | ||
326 | * when it receives request from KIM for ldisc installation. | ||
327 | */ | ||
328 | struct hci_command { | ||
329 | u8 prefix; | ||
330 | u16 opcode; | ||
331 | u8 plen; | ||
332 | u32 speed; | ||
333 | } __attribute__ ((packed)); | ||
334 | |||
335 | /* | ||
336 | * header information used by st_ll.c | ||
337 | */ | ||
338 | |||
339 | /* ST LL receiver states */ | ||
340 | #define ST_W4_PACKET_TYPE 0 | ||
341 | #define ST_BT_W4_EVENT_HDR 1 | ||
342 | #define ST_BT_W4_ACL_HDR 2 | ||
343 | #define ST_BT_W4_SCO_HDR 3 | ||
344 | #define ST_BT_W4_DATA 4 | ||
345 | #define ST_FM_W4_EVENT_HDR 5 | ||
346 | #define ST_GPS_W4_EVENT_HDR 6 | ||
347 | |||
348 | /* ST LL state machines */ | ||
349 | #define ST_LL_ASLEEP 0 | ||
350 | #define ST_LL_ASLEEP_TO_AWAKE 1 | ||
351 | #define ST_LL_AWAKE 2 | ||
352 | #define ST_LL_AWAKE_TO_ASLEEP 3 | ||
353 | #define ST_LL_INVALID 4 | ||
354 | |||
355 | /* different PM notifications coming from chip */ | ||
356 | #define LL_SLEEP_IND 0x30 | ||
357 | #define LL_SLEEP_ACK 0x31 | ||
358 | #define LL_WAKE_UP_IND 0x32 | ||
359 | #define LL_WAKE_UP_ACK 0x33 | ||
360 | |||
361 | /* initialize and de-init ST LL */ | ||
362 | long st_ll_init(struct st_data_s *); | ||
363 | long st_ll_deinit(struct st_data_s *); | ||
364 | |||
365 | /** | ||
366 | * enable/disable ST LL along with KIM start/stop | ||
367 | * called by ST Core | ||
368 | */ | ||
369 | void st_ll_enable(struct st_data_s *); | ||
370 | void st_ll_disable(struct st_data_s *); | ||
371 | |||
372 | /** | ||
373 | * various funcs used by ST core to set/get the various PM states | ||
374 | * of the chip. | ||
375 | */ | ||
376 | unsigned long st_ll_getstate(struct st_data_s *); | ||
377 | unsigned long st_ll_sleep_state(struct st_data_s *, unsigned char); | ||
378 | void st_ll_wakeup(struct st_data_s *); | ||
379 | |||
380 | /* | ||
381 | * header information used by st_core.c for FM and GPS | ||
382 | * packet parsing, the bluetooth headers are already available | ||
383 | * at net/bluetooth/ | ||
384 | */ | ||
385 | |||
386 | struct fm_event_hdr { | ||
387 | u8 plen; | ||
388 | } __attribute__ ((packed)); | ||
389 | |||
390 | #define FM_MAX_FRAME_SIZE 0xFF /* TODO: */ | ||
391 | #define FM_EVENT_HDR_SIZE 1 /* size of fm_event_hdr */ | ||
392 | #define ST_FM_CH8_PKT 0x8 | ||
393 | |||
394 | /* gps stuff */ | ||
395 | struct gps_event_hdr { | ||
396 | u8 opcode; | ||
397 | u16 plen; | ||
398 | } __attribute__ ((packed)); | ||
399 | |||
400 | #endif /* TI_WILINK_ST_H */ | ||
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index 10db0102a890..3a2e66d88a32 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -150,7 +150,7 @@ static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step) | |||
150 | * | 150 | * |
151 | * Return %LSM_UNSAFE_* bits applied to an exec because of tracing. | 151 | * Return %LSM_UNSAFE_* bits applied to an exec because of tracing. |
152 | * | 152 | * |
153 | * @task->cred_guard_mutex is held by the caller through the do_execve(). | 153 | * @task->signal->cred_guard_mutex is held by the caller through the do_execve(). |
154 | */ | 154 | */ |
155 | static inline int tracehook_unsafe_exec(struct task_struct *task) | 155 | static inline int tracehook_unsafe_exec(struct task_struct *task) |
156 | { | 156 | { |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 86be0cdeb11b..54e4eaaa0561 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/tty_driver.h> | 13 | #include <linux/tty_driver.h> |
14 | #include <linux/tty_ldisc.h> | 14 | #include <linux/tty_ldisc.h> |
15 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
16 | #include <linux/smp_lock.h> | ||
17 | 16 | ||
18 | #include <asm/system.h> | 17 | #include <asm/system.h> |
19 | 18 | ||
@@ -50,6 +49,7 @@ | |||
50 | #define N_V253 19 /* Codec control over voice modem */ | 49 | #define N_V253 19 /* Codec control over voice modem */ |
51 | #define N_CAIF 20 /* CAIF protocol for talking to modems */ | 50 | #define N_CAIF 20 /* CAIF protocol for talking to modems */ |
52 | #define N_GSM0710 21 /* GSM 0710 Mux */ | 51 | #define N_GSM0710 21 /* GSM 0710 Mux */ |
52 | #define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */ | ||
53 | 53 | ||
54 | /* | 54 | /* |
55 | * This character is the same as _POSIX_VDISABLE: it cannot be used as | 55 | * This character is the same as _POSIX_VDISABLE: it cannot be used as |
@@ -366,6 +366,7 @@ struct tty_file_private { | |||
366 | #define TTY_HUPPED 18 /* Post driver->hangup() */ | 366 | #define TTY_HUPPED 18 /* Post driver->hangup() */ |
367 | #define TTY_FLUSHING 19 /* Flushing to ldisc in progress */ | 367 | #define TTY_FLUSHING 19 /* Flushing to ldisc in progress */ |
368 | #define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */ | 368 | #define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */ |
369 | #define TTY_HUPPING 21 /* ->hangup() in progress */ | ||
369 | 370 | ||
370 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) | 371 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) |
371 | 372 | ||
@@ -540,8 +541,8 @@ extern void tty_audit_exit(void); | |||
540 | extern void tty_audit_fork(struct signal_struct *sig); | 541 | extern void tty_audit_fork(struct signal_struct *sig); |
541 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); | 542 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); |
542 | extern void tty_audit_push(struct tty_struct *tty); | 543 | extern void tty_audit_push(struct tty_struct *tty); |
543 | extern void tty_audit_push_task(struct task_struct *tsk, | 544 | extern int tty_audit_push_task(struct task_struct *tsk, |
544 | uid_t loginuid, u32 sessionid); | 545 | uid_t loginuid, u32 sessionid); |
545 | #else | 546 | #else |
546 | static inline void tty_audit_add_data(struct tty_struct *tty, | 547 | static inline void tty_audit_add_data(struct tty_struct *tty, |
547 | unsigned char *data, size_t size) | 548 | unsigned char *data, size_t size) |
@@ -559,9 +560,10 @@ static inline void tty_audit_fork(struct signal_struct *sig) | |||
559 | static inline void tty_audit_push(struct tty_struct *tty) | 560 | static inline void tty_audit_push(struct tty_struct *tty) |
560 | { | 561 | { |
561 | } | 562 | } |
562 | static inline void tty_audit_push_task(struct task_struct *tsk, | 563 | static inline int tty_audit_push_task(struct task_struct *tsk, |
563 | uid_t loginuid, u32 sessionid) | 564 | uid_t loginuid, u32 sessionid) |
564 | { | 565 | { |
566 | return 0; | ||
565 | } | 567 | } |
566 | #endif | 568 | #endif |
567 | 569 | ||
diff --git a/include/linux/types.h b/include/linux/types.h index 357dbc19606f..c2a9eb44f2fa 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -121,15 +121,7 @@ typedef __u64 u_int64_t; | |||
121 | typedef __s64 int64_t; | 121 | typedef __s64 int64_t; |
122 | #endif | 122 | #endif |
123 | 123 | ||
124 | /* | 124 | /* this is a special 64bit data type that is 8-byte aligned */ |
125 | * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid | ||
126 | * common 32/64-bit compat problems. | ||
127 | * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other | ||
128 | * architectures) and to 8-byte boundaries on 64-bit architetures. The new | ||
129 | * aligned_64 type enforces 8-byte alignment so that structs containing | ||
130 | * aligned_64 values have the same alignment on 32-bit and 64-bit architectures. | ||
131 | * No conversions are necessary between 32-bit user-space and a 64-bit kernel. | ||
132 | */ | ||
133 | #define aligned_u64 __u64 __attribute__((aligned(8))) | 125 | #define aligned_u64 __u64 __attribute__((aligned(8))) |
134 | #define aligned_be64 __be64 __attribute__((aligned(8))) | 126 | #define aligned_be64 __be64 __attribute__((aligned(8))) |
135 | #define aligned_le64 __le64 __attribute__((aligned(8))) | 127 | #define aligned_le64 __le64 __attribute__((aligned(8))) |
@@ -186,7 +178,15 @@ typedef __u64 __bitwise __be64; | |||
186 | typedef __u16 __bitwise __sum16; | 178 | typedef __u16 __bitwise __sum16; |
187 | typedef __u32 __bitwise __wsum; | 179 | typedef __u32 __bitwise __wsum; |
188 | 180 | ||
189 | /* this is a special 64bit data type that is 8-byte aligned */ | 181 | /* |
182 | * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid | ||
183 | * common 32/64-bit compat problems. | ||
184 | * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other | ||
185 | * architectures) and to 8-byte boundaries on 64-bit architetures. The new | ||
186 | * aligned_64 type enforces 8-byte alignment so that structs containing | ||
187 | * aligned_64 values have the same alignment on 32-bit and 64-bit architectures. | ||
188 | * No conversions are necessary between 32-bit user-space and a 64-bit kernel. | ||
189 | */ | ||
190 | #define __aligned_u64 __u64 __attribute__((aligned(8))) | 190 | #define __aligned_u64 __u64 __attribute__((aligned(8))) |
191 | #define __aligned_be64 __be64 __attribute__((aligned(8))) | 191 | #define __aligned_be64 __be64 __attribute__((aligned(8))) |
192 | #define __aligned_le64 __le64 __attribute__((aligned(8))) | 192 | #define __aligned_le64 __le64 __attribute__((aligned(8))) |
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h index d6188e5a52df..665517c05eaf 100644 --- a/include/linux/uio_driver.h +++ b/include/linux/uio_driver.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright(C) 2005, Benedikt Spranger <b.spranger@linutronix.de> | 4 | * Copyright(C) 2005, Benedikt Spranger <b.spranger@linutronix.de> |
5 | * Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de> | 5 | * Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de> |
6 | * Copyright(C) 2006, Hans J. Koch <hjk@linutronix.de> | 6 | * Copyright(C) 2006, Hans J. Koch <hjk@hansjkoch.de> |
7 | * Copyright(C) 2006, Greg Kroah-Hartman <greg@kroah.com> | 7 | * Copyright(C) 2006, Greg Kroah-Hartman <greg@kroah.com> |
8 | * | 8 | * |
9 | * Userspace IO driver. | 9 | * Userspace IO driver. |
diff --git a/include/linux/unaligned/packed_struct.h b/include/linux/unaligned/packed_struct.h index 2498bb9fe002..c9a6abd972a1 100644 --- a/include/linux/unaligned/packed_struct.h +++ b/include/linux/unaligned/packed_struct.h | |||
@@ -3,9 +3,9 @@ | |||
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | 5 | ||
6 | struct __una_u16 { u16 x __attribute__((packed)); }; | 6 | struct __una_u16 { u16 x; } __attribute__((packed)); |
7 | struct __una_u32 { u32 x __attribute__((packed)); }; | 7 | struct __una_u32 { u32 x; } __attribute__((packed)); |
8 | struct __una_u64 { u64 x __attribute__((packed)); }; | 8 | struct __una_u64 { u64 x; } __attribute__((packed)); |
9 | 9 | ||
10 | static inline u16 __get_unaligned_cpu16(const void *p) | 10 | static inline u16 __get_unaligned_cpu16(const void *p) |
11 | { | 11 | { |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 35fe6ab222bb..a28eb2592577 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -313,6 +313,10 @@ struct usb_bus { | |||
313 | int busnum; /* Bus number (in order of reg) */ | 313 | int busnum; /* Bus number (in order of reg) */ |
314 | const char *bus_name; /* stable id (PCI slot_name etc) */ | 314 | const char *bus_name; /* stable id (PCI slot_name etc) */ |
315 | u8 uses_dma; /* Does the host controller use DMA? */ | 315 | u8 uses_dma; /* Does the host controller use DMA? */ |
316 | u8 uses_pio_for_control; /* | ||
317 | * Does the host controller use PIO | ||
318 | * for control transfers? | ||
319 | */ | ||
316 | u8 otg_port; /* 0, or number of OTG/HNP port */ | 320 | u8 otg_port; /* 0, or number of OTG/HNP port */ |
317 | unsigned is_b_host:1; /* true during some HNP roleswitches */ | 321 | unsigned is_b_host:1; /* true during some HNP roleswitches */ |
318 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ | 322 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ |
@@ -797,7 +801,7 @@ struct usbdrv_wrap { | |||
797 | * @disconnect: Called when the interface is no longer accessible, usually | 801 | * @disconnect: Called when the interface is no longer accessible, usually |
798 | * because its device has been (or is being) disconnected or the | 802 | * because its device has been (or is being) disconnected or the |
799 | * driver module is being unloaded. | 803 | * driver module is being unloaded. |
800 | * @ioctl: Used for drivers that want to talk to userspace through | 804 | * @unlocked_ioctl: Used for drivers that want to talk to userspace through |
801 | * the "usbfs" filesystem. This lets devices provide ways to | 805 | * the "usbfs" filesystem. This lets devices provide ways to |
802 | * expose information to user space regardless of where they | 806 | * expose information to user space regardless of where they |
803 | * do (or don't) show up otherwise in the filesystem. | 807 | * do (or don't) show up otherwise in the filesystem. |
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index ee2dd1d506ed..2387f9fc8138 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h | |||
@@ -89,6 +89,8 @@ struct musb_hdrc_config { | |||
89 | /* A GPIO controlling VRSEL in Blackfin */ | 89 | /* A GPIO controlling VRSEL in Blackfin */ |
90 | unsigned int gpio_vrsel; | 90 | unsigned int gpio_vrsel; |
91 | unsigned int gpio_vrsel_active; | 91 | unsigned int gpio_vrsel_active; |
92 | /* musb CLKIN in Blackfin in MHZ */ | ||
93 | unsigned char clkin; | ||
92 | #endif | 94 | #endif |
93 | 95 | ||
94 | }; | 96 | }; |
diff --git a/include/linux/via-core.h b/include/linux/via-core.h index 7ffb521e1a7a..38bffd8ccca5 100644 --- a/include/linux/via-core.h +++ b/include/linux/via-core.h | |||
@@ -81,7 +81,7 @@ struct viafb_dev { | |||
81 | unsigned long fbmem_start; | 81 | unsigned long fbmem_start; |
82 | long fbmem_len; | 82 | long fbmem_len; |
83 | void __iomem *fbmem; | 83 | void __iomem *fbmem; |
84 | #if defined(CONFIG_FB_VIA_CAMERA) || defined(CONFIG_FB_VIA_CAMERA_MODULE) | 84 | #if defined(CONFIG_VIDEO_VIA_CAMERA) || defined(CONFIG_VIDEO_VIA_CAMERA_MODULE) |
85 | long camera_fbmem_offset; | 85 | long camera_fbmem_offset; |
86 | long camera_fbmem_size; | 86 | long camera_fbmem_size; |
87 | #endif | 87 | #endif |
@@ -138,6 +138,7 @@ void viafb_irq_disable(u32 mask); | |||
138 | #define VDE_I_LVDSSIEN 0x40000000 /* LVDS Sense enable */ | 138 | #define VDE_I_LVDSSIEN 0x40000000 /* LVDS Sense enable */ |
139 | #define VDE_I_ENABLE 0x80000000 /* Global interrupt enable */ | 139 | #define VDE_I_ENABLE 0x80000000 /* Global interrupt enable */ |
140 | 140 | ||
141 | #if defined(CONFIG_VIDEO_VIA_CAMERA) || defined(CONFIG_VIDEO_VIA_CAMERA_MODULE) | ||
141 | /* | 142 | /* |
142 | * DMA management. | 143 | * DMA management. |
143 | */ | 144 | */ |
@@ -172,6 +173,7 @@ int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg); | |||
172 | */ | 173 | */ |
173 | #define VGA_WIDTH 640 | 174 | #define VGA_WIDTH 640 |
174 | #define VGA_HEIGHT 480 | 175 | #define VGA_HEIGHT 480 |
176 | #endif /* CONFIG_VIDEO_VIA_CAMERA */ | ||
175 | 177 | ||
176 | /* | 178 | /* |
177 | * Indexed port operations. Note that these are all multi-op | 179 | * Indexed port operations. Note that these are all multi-op |
diff --git a/include/linux/video_output.h b/include/linux/video_output.h index 2fb46bc9340d..ed5cdeb3604d 100644 --- a/include/linux/video_output.h +++ b/include/linux/video_output.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #ifndef _LINUX_VIDEO_OUTPUT_H | 23 | #ifndef _LINUX_VIDEO_OUTPUT_H |
24 | #define _LINUX_VIDEO_OUTPUT_H | 24 | #define _LINUX_VIDEO_OUTPUT_H |
25 | #include <linux/device.h> | 25 | #include <linux/device.h> |
26 | #include <linux/err.h> | ||
26 | struct output_device; | 27 | struct output_device; |
27 | struct output_properties { | 28 | struct output_properties { |
28 | int (*set_state)(struct output_device *); | 29 | int (*set_state)(struct output_device *); |
@@ -34,9 +35,23 @@ struct output_device { | |||
34 | struct device dev; | 35 | struct device dev; |
35 | }; | 36 | }; |
36 | #define to_output_device(obj) container_of(obj, struct output_device, dev) | 37 | #define to_output_device(obj) container_of(obj, struct output_device, dev) |
38 | #if defined(CONFIG_VIDEO_OUTPUT_CONTROL) || defined(CONFIG_VIDEO_OUTPUT_CONTROL_MODULE) | ||
37 | struct output_device *video_output_register(const char *name, | 39 | struct output_device *video_output_register(const char *name, |
38 | struct device *dev, | 40 | struct device *dev, |
39 | void *devdata, | 41 | void *devdata, |
40 | struct output_properties *op); | 42 | struct output_properties *op); |
41 | void video_output_unregister(struct output_device *dev); | 43 | void video_output_unregister(struct output_device *dev); |
44 | #else | ||
45 | static struct output_device *video_output_register(const char *name, | ||
46 | struct device *dev, | ||
47 | void *devdata, | ||
48 | struct output_properties *op) | ||
49 | { | ||
50 | return ERR_PTR(-ENODEV); | ||
51 | } | ||
52 | static void video_output_unregister(struct output_device *dev) | ||
53 | { | ||
54 | return; | ||
55 | } | ||
56 | #endif | ||
42 | #endif | 57 | #endif |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 61490c6dcdbd..5f6f47044abf 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -363,6 +363,8 @@ struct v4l2_pix_format { | |||
363 | #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ | 363 | #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ |
364 | #define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ | 364 | #define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ |
365 | #define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ | 365 | #define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ |
366 | #define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */ | ||
367 | #define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */ | ||
366 | 368 | ||
367 | /* | 369 | /* |
368 | * F O R M A T E N U M E R A T I O N | 370 | * F O R M A T E N U M E R A T I O N |
@@ -1045,8 +1047,11 @@ enum v4l2_colorfx { | |||
1045 | 1047 | ||
1046 | #define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36) | 1048 | #define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36) |
1047 | 1049 | ||
1050 | #define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37) | ||
1051 | #define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38) | ||
1052 | |||
1048 | /* last CID + 1 */ | 1053 | /* last CID + 1 */ |
1049 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+37) | 1054 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+39) |
1050 | 1055 | ||
1051 | /* MPEG-class control IDs defined by V4L2 */ | 1056 | /* MPEG-class control IDs defined by V4L2 */ |
1052 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | 1057 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) |
@@ -1363,6 +1368,8 @@ struct v4l2_modulator { | |||
1363 | #define V4L2_TUNER_CAP_SAP 0x0020 | 1368 | #define V4L2_TUNER_CAP_SAP 0x0020 |
1364 | #define V4L2_TUNER_CAP_LANG1 0x0040 | 1369 | #define V4L2_TUNER_CAP_LANG1 0x0040 |
1365 | #define V4L2_TUNER_CAP_RDS 0x0080 | 1370 | #define V4L2_TUNER_CAP_RDS 0x0080 |
1371 | #define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100 | ||
1372 | #define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200 | ||
1366 | 1373 | ||
1367 | /* Flags for the 'rxsubchans' field */ | 1374 | /* Flags for the 'rxsubchans' field */ |
1368 | #define V4L2_TUNER_SUB_MONO 0x0001 | 1375 | #define V4L2_TUNER_SUB_MONO 0x0001 |
@@ -1392,7 +1399,8 @@ struct v4l2_hw_freq_seek { | |||
1392 | enum v4l2_tuner_type type; | 1399 | enum v4l2_tuner_type type; |
1393 | __u32 seek_upward; | 1400 | __u32 seek_upward; |
1394 | __u32 wrap_around; | 1401 | __u32 wrap_around; |
1395 | __u32 reserved[8]; | 1402 | __u32 spacing; |
1403 | __u32 reserved[7]; | ||
1396 | }; | 1404 | }; |
1397 | 1405 | ||
1398 | /* | 1406 | /* |
diff --git a/include/linux/videotext.h b/include/linux/videotext.h deleted file mode 100644 index 3e68c8d1c7f7..000000000000 --- a/include/linux/videotext.h +++ /dev/null | |||
@@ -1,125 +0,0 @@ | |||
1 | #ifndef _VTX_H | ||
2 | #define _VTX_H | ||
3 | |||
4 | /* | ||
5 | * Teletext (=Videotext) hardware decoders using interface /dev/vtx | ||
6 | * Do not confuse with drivers using /dev/vbi which decode videotext by software | ||
7 | * | ||
8 | * Videotext IOCTLs changed in order to use _IO() macros defined in <linux/ioctl.h>, | ||
9 | * unused tuner IOCTLs cleaned up by | ||
10 | * Michael Geng <linux@MichaelGeng.de> | ||
11 | * | ||
12 | * Copyright (c) 1994-97 Martin Buck <martin-2.buck@student.uni-ulm.de> | ||
13 | * Read COPYING for more information | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | |||
18 | /* | ||
19 | * Videotext ioctls | ||
20 | */ | ||
21 | #define VTXIOCGETINFO _IOR (0x81, 1, vtx_info_t) | ||
22 | #define VTXIOCCLRPAGE _IOW (0x81, 2, vtx_pagereq_t) | ||
23 | #define VTXIOCCLRFOUND _IOW (0x81, 3, vtx_pagereq_t) | ||
24 | #define VTXIOCPAGEREQ _IOW (0x81, 4, vtx_pagereq_t) | ||
25 | #define VTXIOCGETSTAT _IOW (0x81, 5, vtx_pagereq_t) | ||
26 | #define VTXIOCGETPAGE _IOW (0x81, 6, vtx_pagereq_t) | ||
27 | #define VTXIOCSTOPDAU _IOW (0x81, 7, vtx_pagereq_t) | ||
28 | #define VTXIOCPUTPAGE _IO (0x81, 8) | ||
29 | #define VTXIOCSETDISP _IO (0x81, 9) | ||
30 | #define VTXIOCPUTSTAT _IO (0x81, 10) | ||
31 | #define VTXIOCCLRCACHE _IO (0x81, 11) | ||
32 | #define VTXIOCSETVIRT _IOW (0x81, 12, long) | ||
33 | |||
34 | /* for compatibility, will go away some day */ | ||
35 | #define VTXIOCGETINFO_OLD 0x7101 /* get version of driver & capabilities of vtx-chipset */ | ||
36 | #define VTXIOCCLRPAGE_OLD 0x7102 /* clear page-buffer */ | ||
37 | #define VTXIOCCLRFOUND_OLD 0x7103 /* clear bits indicating that page was found */ | ||
38 | #define VTXIOCPAGEREQ_OLD 0x7104 /* search for page */ | ||
39 | #define VTXIOCGETSTAT_OLD 0x7105 /* get status of page-buffer */ | ||
40 | #define VTXIOCGETPAGE_OLD 0x7106 /* get contents of page-buffer */ | ||
41 | #define VTXIOCSTOPDAU_OLD 0x7107 /* stop data acquisition unit */ | ||
42 | #define VTXIOCPUTPAGE_OLD 0x7108 /* display page on TV-screen */ | ||
43 | #define VTXIOCSETDISP_OLD 0x7109 /* set TV-mode */ | ||
44 | #define VTXIOCPUTSTAT_OLD 0x710a /* set status of TV-output-buffer */ | ||
45 | #define VTXIOCCLRCACHE_OLD 0x710b /* clear cache on VTX-interface (if avail.) */ | ||
46 | #define VTXIOCSETVIRT_OLD 0x710c /* turn on virtual mode (this disables TV-display) */ | ||
47 | |||
48 | /* | ||
49 | * Definitions for VTXIOCGETINFO | ||
50 | */ | ||
51 | |||
52 | #define SAA5243 0 | ||
53 | #define SAA5246 1 | ||
54 | #define SAA5249 2 | ||
55 | #define SAA5248 3 | ||
56 | #define XSTV5346 4 | ||
57 | |||
58 | typedef struct { | ||
59 | int version_major, version_minor; /* version of driver; if version_major changes, driver */ | ||
60 | /* is not backward compatible!!! CHECK THIS!!! */ | ||
61 | int numpages; /* number of page-buffers of vtx-chipset */ | ||
62 | int cct_type; /* type of vtx-chipset (SAA5243, SAA5246, SAA5248 or | ||
63 | * SAA5249) */ | ||
64 | } | ||
65 | vtx_info_t; | ||
66 | |||
67 | |||
68 | /* | ||
69 | * Definitions for VTXIOC{CLRPAGE,CLRFOUND,PAGEREQ,GETSTAT,GETPAGE,STOPDAU,PUTPAGE,SETDISP} | ||
70 | */ | ||
71 | |||
72 | #define MIN_UNIT (1<<0) | ||
73 | #define MIN_TEN (1<<1) | ||
74 | #define HR_UNIT (1<<2) | ||
75 | #define HR_TEN (1<<3) | ||
76 | #define PG_UNIT (1<<4) | ||
77 | #define PG_TEN (1<<5) | ||
78 | #define PG_HUND (1<<6) | ||
79 | #define PGMASK_MAX (1<<7) | ||
80 | #define PGMASK_PAGE (PG_HUND | PG_TEN | PG_UNIT) | ||
81 | #define PGMASK_HOUR (HR_TEN | HR_UNIT) | ||
82 | #define PGMASK_MINUTE (MIN_TEN | MIN_UNIT) | ||
83 | |||
84 | typedef struct | ||
85 | { | ||
86 | int page; /* number of requested page (hexadecimal) */ | ||
87 | int hour; /* requested hour (hexadecimal) */ | ||
88 | int minute; /* requested minute (hexadecimal) */ | ||
89 | int pagemask; /* mask defining which values of the above are set */ | ||
90 | int pgbuf; /* buffer where page will be stored */ | ||
91 | int start; /* start of requested part of page */ | ||
92 | int end; /* end of requested part of page */ | ||
93 | void __user *buffer; /* pointer to beginning of destination buffer */ | ||
94 | } | ||
95 | vtx_pagereq_t; | ||
96 | |||
97 | |||
98 | /* | ||
99 | * Definitions for VTXIOC{GETSTAT,PUTSTAT} | ||
100 | */ | ||
101 | |||
102 | #define VTX_PAGESIZE (40 * 24) | ||
103 | #define VTX_VIRTUALSIZE (40 * 49) | ||
104 | |||
105 | typedef struct | ||
106 | { | ||
107 | int pagenum; /* number of page (hexadecimal) */ | ||
108 | int hour; /* hour (hexadecimal) */ | ||
109 | int minute; /* minute (hexadecimal) */ | ||
110 | int charset; /* national charset */ | ||
111 | unsigned delete : 1; /* delete page (C4) */ | ||
112 | unsigned headline : 1; /* insert headline (C5) */ | ||
113 | unsigned subtitle : 1; /* insert subtitle (C6) */ | ||
114 | unsigned supp_header : 1; /* suppress header (C7) */ | ||
115 | unsigned update : 1; /* update page (C8) */ | ||
116 | unsigned inter_seq : 1; /* interrupted sequence (C9) */ | ||
117 | unsigned dis_disp : 1; /* disable/suppress display (C10) */ | ||
118 | unsigned serial : 1; /* serial mode (C11) */ | ||
119 | unsigned notfound : 1; /* /FOUND */ | ||
120 | unsigned pblf : 1; /* PBLF */ | ||
121 | unsigned hamming : 1; /* hamming-error occurred */ | ||
122 | } | ||
123 | vtx_pageinfo_t; | ||
124 | |||
125 | #endif /* _VTX_H */ | ||
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h index 1faa80d92f05..e68b439b2860 100644 --- a/include/linux/virtio_9p.h +++ b/include/linux/virtio_9p.h | |||
@@ -5,7 +5,6 @@ | |||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/virtio_ids.h> | 6 | #include <linux/virtio_ids.h> |
7 | #include <linux/virtio_config.h> | 7 | #include <linux/virtio_config.h> |
8 | #include <linux/types.h> | ||
9 | 8 | ||
10 | /* The feature bitmap for virtio 9P */ | 9 | /* The feature bitmap for virtio 9P */ |
11 | 10 | ||
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 63a4fe6d51bd..44b54f619ac6 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -7,8 +7,6 @@ | |||
7 | 7 | ||
8 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ | 8 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ |
9 | 9 | ||
10 | extern bool vmap_lazy_unmap; | ||
11 | |||
12 | /* bits in flags of vmalloc's vm_struct below */ | 10 | /* bits in flags of vmalloc's vm_struct below */ |
13 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ | 11 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ |
14 | #define VM_ALLOC 0x00000002 /* vmalloc() */ | 12 | #define VM_ALLOC 0x00000002 /* vmalloc() */ |
@@ -53,8 +51,10 @@ static inline void vmalloc_init(void) | |||
53 | #endif | 51 | #endif |
54 | 52 | ||
55 | extern void *vmalloc(unsigned long size); | 53 | extern void *vmalloc(unsigned long size); |
54 | extern void *vzalloc(unsigned long size); | ||
56 | extern void *vmalloc_user(unsigned long size); | 55 | extern void *vmalloc_user(unsigned long size); |
57 | extern void *vmalloc_node(unsigned long size, int node); | 56 | extern void *vmalloc_node(unsigned long size, int node); |
57 | extern void *vzalloc_node(unsigned long size, int node); | ||
58 | extern void *vmalloc_exec(unsigned long size); | 58 | extern void *vmalloc_exec(unsigned long size); |
59 | extern void *vmalloc_32(unsigned long size); | 59 | extern void *vmalloc_32(unsigned long size); |
60 | extern void *vmalloc_32_user(unsigned long size); | 60 | extern void *vmalloc_32_user(unsigned long size); |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 070bb7a88936..0c0771f06bfa 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -190,7 +190,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
190 | __INIT_WORK((_work), (_func), 0); \ | 190 | __INIT_WORK((_work), (_func), 0); \ |
191 | } while (0) | 191 | } while (0) |
192 | 192 | ||
193 | #define INIT_WORK_ON_STACK(_work, _func) \ | 193 | #define INIT_WORK_ONSTACK(_work, _func) \ |
194 | do { \ | 194 | do { \ |
195 | __INIT_WORK((_work), (_func), 1); \ | 195 | __INIT_WORK((_work), (_func), 1); \ |
196 | } while (0) | 196 | } while (0) |
@@ -201,9 +201,9 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
201 | init_timer(&(_work)->timer); \ | 201 | init_timer(&(_work)->timer); \ |
202 | } while (0) | 202 | } while (0) |
203 | 203 | ||
204 | #define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ | 204 | #define INIT_DELAYED_WORK_ONSTACK(_work, _func) \ |
205 | do { \ | 205 | do { \ |
206 | INIT_WORK_ON_STACK(&(_work)->work, (_func)); \ | 206 | INIT_WORK_ONSTACK(&(_work)->work, (_func)); \ |
207 | init_timer_on_stack(&(_work)->timer); \ | 207 | init_timer_on_stack(&(_work)->timer); \ |
208 | } while (0) | 208 | } while (0) |
209 | 209 | ||
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 72a5d647a5f2..0ead399e08b5 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -10,8 +10,6 @@ | |||
10 | struct backing_dev_info; | 10 | struct backing_dev_info; |
11 | 11 | ||
12 | extern spinlock_t inode_lock; | 12 | extern spinlock_t inode_lock; |
13 | extern struct list_head inode_in_use; | ||
14 | extern struct list_head inode_unused; | ||
15 | 13 | ||
16 | /* | 14 | /* |
17 | * fs/fs-writeback.c | 15 | * fs/fs-writeback.c |
@@ -60,7 +58,9 @@ struct writeback_control { | |||
60 | struct bdi_writeback; | 58 | struct bdi_writeback; |
61 | int inode_wait(void *); | 59 | int inode_wait(void *); |
62 | void writeback_inodes_sb(struct super_block *); | 60 | void writeback_inodes_sb(struct super_block *); |
61 | void writeback_inodes_sb_nr(struct super_block *, unsigned long nr); | ||
63 | int writeback_inodes_sb_if_idle(struct super_block *); | 62 | int writeback_inodes_sb_if_idle(struct super_block *); |
63 | int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr); | ||
64 | void sync_inodes_sb(struct super_block *); | 64 | void sync_inodes_sb(struct super_block *); |
65 | void writeback_inodes_wb(struct bdi_writeback *wb, | 65 | void writeback_inodes_wb(struct bdi_writeback *wb, |
66 | struct writeback_control *wbc); | 66 | struct writeback_control *wbc); |
@@ -143,12 +143,16 @@ typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc, | |||
143 | 143 | ||
144 | int generic_writepages(struct address_space *mapping, | 144 | int generic_writepages(struct address_space *mapping, |
145 | struct writeback_control *wbc); | 145 | struct writeback_control *wbc); |
146 | void tag_pages_for_writeback(struct address_space *mapping, | ||
147 | pgoff_t start, pgoff_t end); | ||
146 | int write_cache_pages(struct address_space *mapping, | 148 | int write_cache_pages(struct address_space *mapping, |
147 | struct writeback_control *wbc, writepage_t writepage, | 149 | struct writeback_control *wbc, writepage_t writepage, |
148 | void *data); | 150 | void *data); |
149 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); | 151 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); |
150 | void set_page_dirty_balance(struct page *page, int page_mkwrite); | 152 | void set_page_dirty_balance(struct page *page, int page_mkwrite); |
151 | void writeback_set_ratelimit(void); | 153 | void writeback_set_ratelimit(void); |
154 | void tag_pages_for_writeback(struct address_space *mapping, | ||
155 | pgoff_t start, pgoff_t end); | ||
152 | 156 | ||
153 | /* pdflush.c */ | 157 | /* pdflush.c */ |
154 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl | 158 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl |