diff options
author | Patrick McHardy <kaber@trash.net> | 2011-01-14 08:12:37 -0500 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2011-01-14 08:12:37 -0500 |
commit | 0134e89c7bcc9fde1da962c82a120691e185619f (patch) | |
tree | 3e03335cf001019a2687d161e956de4f73379984 /include | |
parent | c7066f70d9610df0b9406cc635fc09e86136e714 (diff) | |
parent | 6faee60a4e82075853a437831768cc9e2e563e4e (diff) |
Merge branch 'master' of git://1984.lsi.us.es/net-next-2.6
Conflicts:
net/ipv4/route.c
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include')
288 files changed, 6106 insertions, 3074 deletions
diff --git a/include/acpi/video.h b/include/acpi/video.h index 551793c9b6e8..0e98e679d3a7 100644 --- a/include/acpi/video.h +++ b/include/acpi/video.h | |||
@@ -1,6 +1,10 @@ | |||
1 | #ifndef __ACPI_VIDEO_H | 1 | #ifndef __ACPI_VIDEO_H |
2 | #define __ACPI_VIDEO_H | 2 | #define __ACPI_VIDEO_H |
3 | 3 | ||
4 | #include <linux/errno.h> /* for ENODEV */ | ||
5 | |||
6 | struct acpi_device; | ||
7 | |||
4 | #define ACPI_VIDEO_DISPLAY_CRT 1 | 8 | #define ACPI_VIDEO_DISPLAY_CRT 1 |
5 | #define ACPI_VIDEO_DISPLAY_TV 2 | 9 | #define ACPI_VIDEO_DISPLAY_TV 2 |
6 | #define ACPI_VIDEO_DISPLAY_DVI 3 | 10 | #define ACPI_VIDEO_DISPLAY_DVI 3 |
@@ -26,4 +30,3 @@ static inline int acpi_video_get_edid(struct acpi_device *device, int type, | |||
26 | #endif | 30 | #endif |
27 | 31 | ||
28 | #endif | 32 | #endif |
29 | |||
diff --git a/include/asm-generic/ioctls.h b/include/asm-generic/ioctls.h index a3216655d657..3f3f2d189fb8 100644 --- a/include/asm-generic/ioctls.h +++ b/include/asm-generic/ioctls.h | |||
@@ -67,6 +67,7 @@ | |||
67 | #endif | 67 | #endif |
68 | #define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 68 | #define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
69 | #define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ | 69 | #define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ |
70 | #define TIOCGDEV _IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */ | ||
70 | #define TCGETX 0x5432 /* SYS5 TCGETX compatibility */ | 71 | #define TCGETX 0x5432 /* SYS5 TCGETX compatibility */ |
71 | #define TCSETX 0x5433 | 72 | #define TCSETX 0x5433 |
72 | #define TCSETXF 0x5434 | 73 | #define TCSETXF 0x5434 |
diff --git a/include/asm-generic/irq_regs.h b/include/asm-generic/irq_regs.h index 5ae1d07d4a12..6bf9355fa7eb 100644 --- a/include/asm-generic/irq_regs.h +++ b/include/asm-generic/irq_regs.h | |||
@@ -22,15 +22,15 @@ DECLARE_PER_CPU(struct pt_regs *, __irq_regs); | |||
22 | 22 | ||
23 | static inline struct pt_regs *get_irq_regs(void) | 23 | static inline struct pt_regs *get_irq_regs(void) |
24 | { | 24 | { |
25 | return __get_cpu_var(__irq_regs); | 25 | return __this_cpu_read(__irq_regs); |
26 | } | 26 | } |
27 | 27 | ||
28 | static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs) | 28 | static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs) |
29 | { | 29 | { |
30 | struct pt_regs *old_regs, **pp_regs = &__get_cpu_var(__irq_regs); | 30 | struct pt_regs *old_regs; |
31 | 31 | ||
32 | old_regs = *pp_regs; | 32 | old_regs = __this_cpu_read(__irq_regs); |
33 | *pp_regs = new_regs; | 33 | __this_cpu_write(__irq_regs, new_regs); |
34 | return old_regs; | 34 | return old_regs; |
35 | } | 35 | } |
36 | 36 | ||
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 8c641bed9bbd..a2776e2807a4 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
@@ -287,6 +287,8 @@ typedef struct drm_i915_irq_wait { | |||
287 | #define I915_PARAM_HAS_EXECBUF2 9 | 287 | #define I915_PARAM_HAS_EXECBUF2 9 |
288 | #define I915_PARAM_HAS_BSD 10 | 288 | #define I915_PARAM_HAS_BSD 10 |
289 | #define I915_PARAM_HAS_BLT 11 | 289 | #define I915_PARAM_HAS_BLT 11 |
290 | #define I915_PARAM_HAS_RELAXED_FENCING 12 | ||
291 | #define I915_PARAM_HAS_COHERENT_RINGS 13 | ||
290 | 292 | ||
291 | typedef struct drm_i915_getparam { | 293 | typedef struct drm_i915_getparam { |
292 | int param; | 294 | int param; |
diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h index 01a714119506..bc5590b1a1ac 100644 --- a/include/drm/nouveau_drm.h +++ b/include/drm/nouveau_drm.h | |||
@@ -80,6 +80,7 @@ struct drm_nouveau_gpuobj_free { | |||
80 | #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 | 80 | #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 |
81 | #define NOUVEAU_GETPARAM_GRAPH_UNITS 13 | 81 | #define NOUVEAU_GETPARAM_GRAPH_UNITS 13 |
82 | #define NOUVEAU_GETPARAM_PTIMER_TIME 14 | 82 | #define NOUVEAU_GETPARAM_PTIMER_TIME 14 |
83 | #define NOUVEAU_GETPARAM_HAS_BO_USAGE 15 | ||
83 | struct drm_nouveau_getparam { | 84 | struct drm_nouveau_getparam { |
84 | uint64_t param; | 85 | uint64_t param; |
85 | uint64_t value; | 86 | uint64_t value; |
@@ -95,6 +96,12 @@ struct drm_nouveau_setparam { | |||
95 | #define NOUVEAU_GEM_DOMAIN_GART (1 << 2) | 96 | #define NOUVEAU_GEM_DOMAIN_GART (1 << 2) |
96 | #define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3) | 97 | #define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3) |
97 | 98 | ||
99 | #define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00 | ||
100 | #define NOUVEAU_GEM_TILE_16BPP 0x00000001 | ||
101 | #define NOUVEAU_GEM_TILE_32BPP 0x00000002 | ||
102 | #define NOUVEAU_GEM_TILE_ZETA 0x00000004 | ||
103 | #define NOUVEAU_GEM_TILE_NONCONTIG 0x00000008 | ||
104 | |||
98 | struct drm_nouveau_gem_info { | 105 | struct drm_nouveau_gem_info { |
99 | uint32_t handle; | 106 | uint32_t handle; |
100 | uint32_t domain; | 107 | uint32_t domain; |
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 5afa5b52063e..beafc156a535 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h | |||
@@ -432,6 +432,10 @@ extern void ttm_bo_synccpu_write_release(struct ttm_buffer_object *bo); | |||
432 | * together with the @destroy function, | 432 | * together with the @destroy function, |
433 | * enables driver-specific objects derived from a ttm_buffer_object. | 433 | * enables driver-specific objects derived from a ttm_buffer_object. |
434 | * On successful return, the object kref and list_kref are set to 1. | 434 | * On successful return, the object kref and list_kref are set to 1. |
435 | * If a failure occurs, the function will call the @destroy function, or | ||
436 | * kfree() if @destroy is NULL. Thus, after a failure, dereferencing @bo is | ||
437 | * illegal and will likely cause memory corruption. | ||
438 | * | ||
435 | * Returns | 439 | * Returns |
436 | * -ENOMEM: Out of memory. | 440 | * -ENOMEM: Out of memory. |
437 | * -EINVAL: Invalid placement flags. | 441 | * -EINVAL: Invalid placement flags. |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index d01b4ddbdc56..8e0c848326b6 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -206,14 +206,84 @@ struct ttm_tt { | |||
206 | struct ttm_mem_type_manager; | 206 | struct ttm_mem_type_manager; |
207 | 207 | ||
208 | struct ttm_mem_type_manager_func { | 208 | struct ttm_mem_type_manager_func { |
209 | /** | ||
210 | * struct ttm_mem_type_manager member init | ||
211 | * | ||
212 | * @man: Pointer to a memory type manager. | ||
213 | * @p_size: Implementation dependent, but typically the size of the | ||
214 | * range to be managed in pages. | ||
215 | * | ||
216 | * Called to initialize a private range manager. The function is | ||
217 | * expected to initialize the man::priv member. | ||
218 | * Returns 0 on success, negative error code on failure. | ||
219 | */ | ||
209 | int (*init)(struct ttm_mem_type_manager *man, unsigned long p_size); | 220 | int (*init)(struct ttm_mem_type_manager *man, unsigned long p_size); |
221 | |||
222 | /** | ||
223 | * struct ttm_mem_type_manager member takedown | ||
224 | * | ||
225 | * @man: Pointer to a memory type manager. | ||
226 | * | ||
227 | * Called to undo the setup done in init. All allocated resources | ||
228 | * should be freed. | ||
229 | */ | ||
210 | int (*takedown)(struct ttm_mem_type_manager *man); | 230 | int (*takedown)(struct ttm_mem_type_manager *man); |
231 | |||
232 | /** | ||
233 | * struct ttm_mem_type_manager member get_node | ||
234 | * | ||
235 | * @man: Pointer to a memory type manager. | ||
236 | * @bo: Pointer to the buffer object we're allocating space for. | ||
237 | * @placement: Placement details. | ||
238 | * @mem: Pointer to a struct ttm_mem_reg to be filled in. | ||
239 | * | ||
240 | * This function should allocate space in the memory type managed | ||
241 | * by @man. Placement details if | ||
242 | * applicable are given by @placement. If successful, | ||
243 | * @mem::mm_node should be set to a non-null value, and | ||
244 | * @mem::start should be set to a value identifying the beginning | ||
245 | * of the range allocated, and the function should return zero. | ||
246 | * If the memory region accomodate the buffer object, @mem::mm_node | ||
247 | * should be set to NULL, and the function should return 0. | ||
248 | * If a system error occured, preventing the request to be fulfilled, | ||
249 | * the function should return a negative error code. | ||
250 | * | ||
251 | * Note that @mem::mm_node will only be dereferenced by | ||
252 | * struct ttm_mem_type_manager functions and optionally by the driver, | ||
253 | * which has knowledge of the underlying type. | ||
254 | * | ||
255 | * This function may not be called from within atomic context, so | ||
256 | * an implementation can and must use either a mutex or a spinlock to | ||
257 | * protect any data structures managing the space. | ||
258 | */ | ||
211 | int (*get_node)(struct ttm_mem_type_manager *man, | 259 | int (*get_node)(struct ttm_mem_type_manager *man, |
212 | struct ttm_buffer_object *bo, | 260 | struct ttm_buffer_object *bo, |
213 | struct ttm_placement *placement, | 261 | struct ttm_placement *placement, |
214 | struct ttm_mem_reg *mem); | 262 | struct ttm_mem_reg *mem); |
263 | |||
264 | /** | ||
265 | * struct ttm_mem_type_manager member put_node | ||
266 | * | ||
267 | * @man: Pointer to a memory type manager. | ||
268 | * @mem: Pointer to a struct ttm_mem_reg to be filled in. | ||
269 | * | ||
270 | * This function frees memory type resources previously allocated | ||
271 | * and that are identified by @mem::mm_node and @mem::start. May not | ||
272 | * be called from within atomic context. | ||
273 | */ | ||
215 | void (*put_node)(struct ttm_mem_type_manager *man, | 274 | void (*put_node)(struct ttm_mem_type_manager *man, |
216 | struct ttm_mem_reg *mem); | 275 | struct ttm_mem_reg *mem); |
276 | |||
277 | /** | ||
278 | * struct ttm_mem_type_manager member debug | ||
279 | * | ||
280 | * @man: Pointer to a memory type manager. | ||
281 | * @prefix: Prefix to be used in printout to identify the caller. | ||
282 | * | ||
283 | * This function is called to print out the state of the memory | ||
284 | * type manager to aid debugging of out-of-memory conditions. | ||
285 | * It may not be called from within atomic context. | ||
286 | */ | ||
217 | void (*debug)(struct ttm_mem_type_manager *man, const char *prefix); | 287 | void (*debug)(struct ttm_mem_type_manager *man, const char *prefix); |
218 | }; | 288 | }; |
219 | 289 | ||
@@ -231,14 +301,13 @@ struct ttm_mem_type_manager { | |||
231 | uint64_t size; | 301 | uint64_t size; |
232 | uint32_t available_caching; | 302 | uint32_t available_caching; |
233 | uint32_t default_caching; | 303 | uint32_t default_caching; |
304 | const struct ttm_mem_type_manager_func *func; | ||
305 | void *priv; | ||
234 | 306 | ||
235 | /* | 307 | /* |
236 | * Protected by the bdev->lru_lock. | 308 | * Protected by the global->lru_lock. |
237 | * TODO: Consider one lru_lock per ttm_mem_type_manager. | ||
238 | * Plays ill with list removal, though. | ||
239 | */ | 309 | */ |
240 | const struct ttm_mem_type_manager_func *func; | 310 | |
241 | void *priv; | ||
242 | struct list_head lru; | 311 | struct list_head lru; |
243 | }; | 312 | }; |
244 | 313 | ||
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 97319a8fc1e0..a354c199ab98 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -367,7 +367,6 @@ header-y += utime.h | |||
367 | header-y += utsname.h | 367 | header-y += utsname.h |
368 | header-y += veth.h | 368 | header-y += veth.h |
369 | header-y += vhost.h | 369 | header-y += vhost.h |
370 | header-y += videodev.h | ||
371 | header-y += videodev2.h | 370 | header-y += videodev2.h |
372 | header-y += virtio_9p.h | 371 | header-y += virtio_9p.h |
373 | header-y += virtio_balloon.h | 372 | header-y += virtio_balloon.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 050a7bccb836..67c91b4418b0 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); |
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index c6454cca0447..9e7f259346e1 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/device.h> | 18 | #include <linux/device.h> |
19 | #include <linux/err.h> | 19 | #include <linux/err.h> |
20 | #include <linux/resource.h> | 20 | #include <linux/resource.h> |
21 | #include <linux/regulator/consumer.h> | ||
21 | 22 | ||
22 | #define AMBA_NR_IRQS 2 | 23 | #define AMBA_NR_IRQS 2 |
23 | #define AMBA_CID 0xb105f00d | 24 | #define AMBA_CID 0xb105f00d |
@@ -28,6 +29,7 @@ struct amba_device { | |||
28 | struct device dev; | 29 | struct device dev; |
29 | struct resource res; | 30 | struct resource res; |
30 | struct clk *pclk; | 31 | struct clk *pclk; |
32 | struct regulator *vcore; | ||
31 | u64 dma_mask; | 33 | u64 dma_mask; |
32 | unsigned int periphid; | 34 | unsigned int periphid; |
33 | unsigned int irq[AMBA_NR_IRQS]; | 35 | unsigned int irq[AMBA_NR_IRQS]; |
@@ -71,6 +73,12 @@ void amba_release_regions(struct amba_device *); | |||
71 | #define amba_pclk_disable(d) \ | 73 | #define amba_pclk_disable(d) \ |
72 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) | 74 | do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) |
73 | 75 | ||
76 | #define amba_vcore_enable(d) \ | ||
77 | (IS_ERR((d)->vcore) ? 0 : regulator_enable((d)->vcore)) | ||
78 | |||
79 | #define amba_vcore_disable(d) \ | ||
80 | do { if (!IS_ERR((d)->vcore)) regulator_disable((d)->vcore); } while (0) | ||
81 | |||
74 | /* Some drivers don't use the struct amba_device */ | 82 | /* Some drivers don't use the struct amba_device */ |
75 | #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) | 83 | #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) |
76 | #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f) | 84 | #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f) |
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index 6021588ba0a8..5479fdc849e9 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h | |||
@@ -113,6 +113,21 @@ | |||
113 | #define UART01x_LCRH_PEN 0x02 | 113 | #define UART01x_LCRH_PEN 0x02 |
114 | #define UART01x_LCRH_BRK 0x01 | 114 | #define UART01x_LCRH_BRK 0x01 |
115 | 115 | ||
116 | #define ST_UART011_DMAWM_RX_1 (0 << 3) | ||
117 | #define ST_UART011_DMAWM_RX_2 (1 << 3) | ||
118 | #define ST_UART011_DMAWM_RX_4 (2 << 3) | ||
119 | #define ST_UART011_DMAWM_RX_8 (3 << 3) | ||
120 | #define ST_UART011_DMAWM_RX_16 (4 << 3) | ||
121 | #define ST_UART011_DMAWM_RX_32 (5 << 3) | ||
122 | #define ST_UART011_DMAWM_RX_48 (6 << 3) | ||
123 | #define ST_UART011_DMAWM_TX_1 0 | ||
124 | #define ST_UART011_DMAWM_TX_2 1 | ||
125 | #define ST_UART011_DMAWM_TX_4 2 | ||
126 | #define ST_UART011_DMAWM_TX_8 3 | ||
127 | #define ST_UART011_DMAWM_TX_16 4 | ||
128 | #define ST_UART011_DMAWM_TX_32 5 | ||
129 | #define ST_UART011_DMAWM_TX_48 6 | ||
130 | |||
116 | #define UART010_IIR_RTIS 0x08 | 131 | #define UART010_IIR_RTIS 0x08 |
117 | #define UART010_IIR_TIS 0x04 | 132 | #define UART010_IIR_TIS 0x04 |
118 | #define UART010_IIR_RIS 0x02 | 133 | #define UART010_IIR_RIS 0x02 |
@@ -180,6 +195,13 @@ struct amba_device; /* in uncompress this is included but amba/bus.h is not */ | |||
180 | struct amba_pl010_data { | 195 | struct amba_pl010_data { |
181 | void (*set_mctrl)(struct amba_device *dev, void __iomem *base, unsigned int mctrl); | 196 | void (*set_mctrl)(struct amba_device *dev, void __iomem *base, unsigned int mctrl); |
182 | }; | 197 | }; |
198 | |||
199 | struct dma_chan; | ||
200 | struct amba_pl011_data { | ||
201 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | ||
202 | void *dma_rx_param; | ||
203 | void *dma_tx_param; | ||
204 | }; | ||
183 | #endif | 205 | #endif |
184 | 206 | ||
185 | #endif | 207 | #endif |
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/average.h b/include/linux/average.h new file mode 100644 index 000000000000..c6028fd742c1 --- /dev/null +++ b/include/linux/average.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef _LINUX_AVERAGE_H | ||
2 | #define _LINUX_AVERAGE_H | ||
3 | |||
4 | /* Exponentially weighted moving average (EWMA) */ | ||
5 | |||
6 | /* For more documentation see lib/average.c */ | ||
7 | |||
8 | struct ewma { | ||
9 | unsigned long internal; | ||
10 | unsigned long factor; | ||
11 | unsigned long weight; | ||
12 | }; | ||
13 | |||
14 | extern void ewma_init(struct ewma *avg, unsigned long factor, | ||
15 | unsigned long weight); | ||
16 | |||
17 | extern struct ewma *ewma_add(struct ewma *avg, unsigned long val); | ||
18 | |||
19 | /** | ||
20 | * ewma_read() - Get average value | ||
21 | * @avg: Average structure | ||
22 | * | ||
23 | * Returns the average value held in @avg. | ||
24 | */ | ||
25 | static inline unsigned long ewma_read(const struct ewma *avg) | ||
26 | { | ||
27 | return avg->internal >> avg->factor; | ||
28 | } | ||
29 | |||
30 | #endif /* _LINUX_AVERAGE_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/bit_spinlock.h b/include/linux/bit_spinlock.h index 7113a32a86ea..e612575a2596 100644 --- a/include/linux/bit_spinlock.h +++ b/include/linux/bit_spinlock.h | |||
@@ -1,6 +1,10 @@ | |||
1 | #ifndef __LINUX_BIT_SPINLOCK_H | 1 | #ifndef __LINUX_BIT_SPINLOCK_H |
2 | #define __LINUX_BIT_SPINLOCK_H | 2 | #define __LINUX_BIT_SPINLOCK_H |
3 | 3 | ||
4 | #include <linux/kernel.h> | ||
5 | #include <linux/preempt.h> | ||
6 | #include <asm/atomic.h> | ||
7 | |||
4 | /* | 8 | /* |
5 | * bit-based spin_lock() | 9 | * bit-based spin_lock() |
6 | * | 10 | * |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 827cc95711ef..2184c6b97aeb 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
@@ -109,6 +109,17 @@ static inline __u8 ror8(__u8 word, unsigned int shift) | |||
109 | return (word >> shift) | (word << (8 - shift)); | 109 | return (word >> shift) | (word << (8 - shift)); |
110 | } | 110 | } |
111 | 111 | ||
112 | /** | ||
113 | * sign_extend32 - sign extend a 32-bit value using specified bit as sign-bit | ||
114 | * @value: value to sign extend | ||
115 | * @index: 0 based bit index (0<=index<32) to sign bit | ||
116 | */ | ||
117 | static inline __s32 sign_extend32(__u32 value, int index) | ||
118 | { | ||
119 | __u8 shift = 31 - index; | ||
120 | return (__s32)(value << shift) >> shift; | ||
121 | } | ||
122 | |||
112 | static inline unsigned fls_long(unsigned long l) | 123 | static inline unsigned fls_long(unsigned long l) |
113 | { | 124 | { |
114 | if (sizeof(l) == 4) | 125 | if (sizeof(l) == 4) |
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 5027a599077d..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); |
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/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/clkdev.h b/include/linux/clkdev.h new file mode 100644 index 000000000000..457bcb0a310a --- /dev/null +++ b/include/linux/clkdev.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * include/linux/clkdev.h | ||
3 | * | ||
4 | * Copyright (C) 2008 Russell King. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * Helper for the clk API to assist looking up a struct clk. | ||
11 | */ | ||
12 | #ifndef __CLKDEV_H | ||
13 | #define __CLKDEV_H | ||
14 | |||
15 | #include <asm/clkdev.h> | ||
16 | |||
17 | struct clk; | ||
18 | struct device; | ||
19 | |||
20 | struct clk_lookup { | ||
21 | struct list_head node; | ||
22 | const char *dev_id; | ||
23 | const char *con_id; | ||
24 | struct clk *clk; | ||
25 | }; | ||
26 | |||
27 | struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, | ||
28 | const char *dev_fmt, ...); | ||
29 | |||
30 | void clkdev_add(struct clk_lookup *cl); | ||
31 | void clkdev_drop(struct clk_lookup *cl); | ||
32 | |||
33 | void clkdev_add_table(struct clk_lookup *, size_t); | ||
34 | int clk_add_alias(const char *, const char *, char *, struct device *); | ||
35 | |||
36 | #endif | ||
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/coda_linux.h b/include/linux/coda_linux.h index 2e914d0771b9..4ccc59c1ea82 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h | |||
@@ -37,7 +37,7 @@ extern const struct file_operations coda_ioctl_operations; | |||
37 | /* operations shared over more than one file */ | 37 | /* operations shared over more than one file */ |
38 | int coda_open(struct inode *i, struct file *f); | 38 | int coda_open(struct inode *i, struct file *f); |
39 | int coda_release(struct inode *i, struct file *f); | 39 | int coda_release(struct inode *i, struct file *f); |
40 | int coda_permission(struct inode *inode, int mask); | 40 | int coda_permission(struct inode *inode, int mask, unsigned int flags); |
41 | int coda_revalidate_inode(struct dentry *); | 41 | int coda_revalidate_inode(struct dentry *); |
42 | int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 42 | int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
43 | int coda_setattr(struct dentry *, struct iattr *); | 43 | int coda_setattr(struct dentry *, struct iattr *); |
diff --git a/include/linux/completion.h b/include/linux/completion.h index 36d57f74cd01..51494e6b5548 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -81,10 +81,10 @@ extern int wait_for_completion_interruptible(struct completion *x); | |||
81 | extern int wait_for_completion_killable(struct completion *x); | 81 | extern int wait_for_completion_killable(struct completion *x); |
82 | extern unsigned long wait_for_completion_timeout(struct completion *x, | 82 | extern unsigned long wait_for_completion_timeout(struct completion *x, |
83 | unsigned long timeout); | 83 | unsigned long timeout); |
84 | extern unsigned long wait_for_completion_interruptible_timeout( | 84 | extern long wait_for_completion_interruptible_timeout( |
85 | struct completion *x, unsigned long timeout); | 85 | struct completion *x, unsigned long timeout); |
86 | extern unsigned long wait_for_completion_killable_timeout( | 86 | extern long wait_for_completion_killable_timeout( |
87 | struct completion *x, unsigned long timeout); | 87 | struct completion *x, unsigned long timeout); |
88 | extern bool try_wait_for_completion(struct completion *x); | 88 | extern bool try_wait_for_completion(struct completion *x); |
89 | extern bool completion_done(struct completion *x); | 89 | extern bool completion_done(struct completion *x); |
90 | 90 | ||
diff --git a/include/linux/console.h b/include/linux/console.h index 95cf6f08a59d..9774fe6a1a97 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -126,6 +126,12 @@ struct console { | |||
126 | struct console *next; | 126 | struct console *next; |
127 | }; | 127 | }; |
128 | 128 | ||
129 | /* | ||
130 | * for_each_console() allows you to iterate on each console | ||
131 | */ | ||
132 | #define for_each_console(con) \ | ||
133 | for (con = console_drivers; con != NULL; con = con->next) | ||
134 | |||
129 | extern int console_set_on_cmdline; | 135 | extern int console_set_on_cmdline; |
130 | 136 | ||
131 | extern int add_preferred_console(char *name, int idx, char *options); | 137 | extern int add_preferred_console(char *name, int idx, char *options); |
@@ -145,7 +151,7 @@ extern int is_console_locked(void); | |||
145 | extern int braille_register_console(struct console *, int index, | 151 | extern int braille_register_console(struct console *, int index, |
146 | char *console_options, char *braille_options); | 152 | char *console_options, char *braille_options); |
147 | extern int braille_unregister_console(struct console *); | 153 | extern int braille_unregister_console(struct console *); |
148 | 154 | extern void console_sysfs_notify(void); | |
149 | extern int console_suspend_enabled; | 155 | extern int console_suspend_enabled; |
150 | 156 | ||
151 | /* Suspend and resume console messages over PM events */ | 157 | /* Suspend and resume console messages over PM events */ |
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/crash_dump.h b/include/linux/crash_dump.h index 0026f267da20..088cd4ace4ef 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
@@ -20,7 +20,14 @@ extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, | |||
20 | #define vmcore_elf_check_arch_cross(x) 0 | 20 | #define vmcore_elf_check_arch_cross(x) 0 |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) | 23 | /* |
24 | * Architecture code can redefine this if there are any special checks | ||
25 | * needed for 64-bit ELF vmcores. In case of 32-bit only architecture, | ||
26 | * this can be set to zero. | ||
27 | */ | ||
28 | #ifndef vmcore_elf64_check_arch | ||
29 | #define vmcore_elf64_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) | ||
30 | #endif | ||
24 | 31 | ||
25 | /* | 32 | /* |
26 | * is_kdump_kernel() checks whether this kernel is booting after a panic of | 33 | * is_kdump_kernel() checks whether this kernel is booting after a panic of |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 6a4aea30aa09..bd07758943e0 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -4,7 +4,9 @@ | |||
4 | #include <asm/atomic.h> | 4 | #include <asm/atomic.h> |
5 | #include <linux/list.h> | 5 | #include <linux/list.h> |
6 | #include <linux/rculist.h> | 6 | #include <linux/rculist.h> |
7 | #include <linux/rculist_bl.h> | ||
7 | #include <linux/spinlock.h> | 8 | #include <linux/spinlock.h> |
9 | #include <linux/seqlock.h> | ||
8 | #include <linux/cache.h> | 10 | #include <linux/cache.h> |
9 | #include <linux/rcupdate.h> | 11 | #include <linux/rcupdate.h> |
10 | 12 | ||
@@ -45,6 +47,27 @@ struct dentry_stat_t { | |||
45 | }; | 47 | }; |
46 | extern struct dentry_stat_t dentry_stat; | 48 | extern struct dentry_stat_t dentry_stat; |
47 | 49 | ||
50 | /* | ||
51 | * Compare 2 name strings, return 0 if they match, otherwise non-zero. | ||
52 | * The strings are both count bytes long, and count is non-zero. | ||
53 | */ | ||
54 | static inline int dentry_cmp(const unsigned char *cs, size_t scount, | ||
55 | const unsigned char *ct, size_t tcount) | ||
56 | { | ||
57 | int ret; | ||
58 | if (scount != tcount) | ||
59 | return 1; | ||
60 | do { | ||
61 | ret = (*cs != *ct); | ||
62 | if (ret) | ||
63 | break; | ||
64 | cs++; | ||
65 | ct++; | ||
66 | tcount--; | ||
67 | } while (tcount); | ||
68 | return ret; | ||
69 | } | ||
70 | |||
48 | /* Name hashing routines. Initial hash value */ | 71 | /* Name hashing routines. Initial hash value */ |
49 | /* Hash courtesy of the R5 hash in reiserfs modulo sign bits */ | 72 | /* Hash courtesy of the R5 hash in reiserfs modulo sign bits */ |
50 | #define init_name_hash() 0 | 73 | #define init_name_hash() 0 |
@@ -81,25 +104,33 @@ full_name_hash(const unsigned char *name, unsigned int len) | |||
81 | * large memory footprint increase). | 104 | * large memory footprint increase). |
82 | */ | 105 | */ |
83 | #ifdef CONFIG_64BIT | 106 | #ifdef CONFIG_64BIT |
84 | #define DNAME_INLINE_LEN_MIN 32 /* 192 bytes */ | 107 | # define DNAME_INLINE_LEN 32 /* 192 bytes */ |
85 | #else | 108 | #else |
86 | #define DNAME_INLINE_LEN_MIN 40 /* 128 bytes */ | 109 | # ifdef CONFIG_SMP |
110 | # define DNAME_INLINE_LEN 36 /* 128 bytes */ | ||
111 | # else | ||
112 | # define DNAME_INLINE_LEN 40 /* 128 bytes */ | ||
113 | # endif | ||
87 | #endif | 114 | #endif |
88 | 115 | ||
89 | struct dentry { | 116 | struct dentry { |
90 | atomic_t d_count; | 117 | /* RCU lookup touched fields */ |
91 | unsigned int d_flags; /* protected by d_lock */ | 118 | unsigned int d_flags; /* protected by d_lock */ |
92 | spinlock_t d_lock; /* per dentry lock */ | 119 | seqcount_t d_seq; /* per dentry seqlock */ |
93 | int d_mounted; | 120 | struct hlist_bl_node d_hash; /* lookup hash list */ |
94 | struct inode *d_inode; /* Where the name belongs to - NULL is | ||
95 | * negative */ | ||
96 | /* | ||
97 | * The next three fields are touched by __d_lookup. Place them here | ||
98 | * so they all fit in a cache line. | ||
99 | */ | ||
100 | struct hlist_node d_hash; /* lookup hash list */ | ||
101 | struct dentry *d_parent; /* parent directory */ | 121 | struct dentry *d_parent; /* parent directory */ |
102 | struct qstr d_name; | 122 | struct qstr d_name; |
123 | struct inode *d_inode; /* Where the name belongs to - NULL is | ||
124 | * negative */ | ||
125 | unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */ | ||
126 | |||
127 | /* Ref lookup also touches following */ | ||
128 | unsigned int d_count; /* protected by d_lock */ | ||
129 | spinlock_t d_lock; /* per dentry lock */ | ||
130 | const struct dentry_operations *d_op; | ||
131 | struct super_block *d_sb; /* The root of the dentry tree */ | ||
132 | unsigned long d_time; /* used by d_revalidate */ | ||
133 | void *d_fsdata; /* fs-specific data */ | ||
103 | 134 | ||
104 | struct list_head d_lru; /* LRU list */ | 135 | struct list_head d_lru; /* LRU list */ |
105 | /* | 136 | /* |
@@ -111,12 +142,6 @@ struct dentry { | |||
111 | } d_u; | 142 | } d_u; |
112 | struct list_head d_subdirs; /* our children */ | 143 | struct list_head d_subdirs; /* our children */ |
113 | struct list_head d_alias; /* inode alias list */ | 144 | struct list_head d_alias; /* inode alias list */ |
114 | unsigned long d_time; /* used by d_revalidate */ | ||
115 | const struct dentry_operations *d_op; | ||
116 | struct super_block *d_sb; /* The root of the dentry tree */ | ||
117 | void *d_fsdata; /* fs-specific data */ | ||
118 | |||
119 | unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ | ||
120 | }; | 145 | }; |
121 | 146 | ||
122 | /* | 147 | /* |
@@ -133,96 +158,61 @@ enum dentry_d_lock_class | |||
133 | 158 | ||
134 | struct dentry_operations { | 159 | struct dentry_operations { |
135 | int (*d_revalidate)(struct dentry *, struct nameidata *); | 160 | int (*d_revalidate)(struct dentry *, struct nameidata *); |
136 | int (*d_hash) (struct dentry *, struct qstr *); | 161 | int (*d_hash)(const struct dentry *, const struct inode *, |
137 | int (*d_compare) (struct dentry *, struct qstr *, struct qstr *); | 162 | struct qstr *); |
138 | int (*d_delete)(struct dentry *); | 163 | int (*d_compare)(const struct dentry *, const struct inode *, |
164 | const struct dentry *, const struct inode *, | ||
165 | unsigned int, const char *, const struct qstr *); | ||
166 | int (*d_delete)(const struct dentry *); | ||
139 | void (*d_release)(struct dentry *); | 167 | void (*d_release)(struct dentry *); |
140 | void (*d_iput)(struct dentry *, struct inode *); | 168 | void (*d_iput)(struct dentry *, struct inode *); |
141 | char *(*d_dname)(struct dentry *, char *, int); | 169 | char *(*d_dname)(struct dentry *, char *, int); |
142 | }; | 170 | } ____cacheline_aligned; |
143 | |||
144 | /* the dentry parameter passed to d_hash and d_compare is the parent | ||
145 | * directory of the entries to be compared. It is used in case these | ||
146 | * functions need any directory specific information for determining | ||
147 | * equivalency classes. Using the dentry itself might not work, as it | ||
148 | * might be a negative dentry which has no information associated with | ||
149 | * it */ | ||
150 | 171 | ||
151 | /* | 172 | /* |
152 | locking rules: | 173 | * Locking rules for dentry_operations callbacks are to be found in |
153 | big lock dcache_lock d_lock may block | 174 | * Documentation/filesystems/Locking. Keep it updated! |
154 | d_revalidate: no no no yes | 175 | * |
155 | d_hash no no no yes | 176 | * FUrther descriptions are found in Documentation/filesystems/vfs.txt. |
156 | d_compare: no yes yes no | 177 | * Keep it updated too! |
157 | d_delete: no yes no no | ||
158 | d_release: no no no yes | ||
159 | d_iput: no no no yes | ||
160 | */ | 178 | */ |
161 | 179 | ||
162 | /* d_flags entries */ | 180 | /* d_flags entries */ |
163 | #define DCACHE_AUTOFS_PENDING 0x0001 /* autofs: "under construction" */ | 181 | #define DCACHE_AUTOFS_PENDING 0x0001 /* autofs: "under construction" */ |
164 | #define DCACHE_NFSFS_RENAMED 0x0002 /* this dentry has been "silly | 182 | #define DCACHE_NFSFS_RENAMED 0x0002 |
165 | * renamed" and has to be | 183 | /* this dentry has been "silly renamed" and has to be deleted on the last |
166 | * deleted on the last dput() | 184 | * dput() */ |
167 | */ | 185 | |
168 | #define DCACHE_DISCONNECTED 0x0004 | 186 | #define DCACHE_DISCONNECTED 0x0004 |
169 | /* This dentry is possibly not currently connected to the dcache tree, | 187 | /* This dentry is possibly not currently connected to the dcache tree, in |
170 | * in which case its parent will either be itself, or will have this | 188 | * which case its parent will either be itself, or will have this flag as |
171 | * flag as well. nfsd will not use a dentry with this bit set, but will | 189 | * well. nfsd will not use a dentry with this bit set, but will first |
172 | * first endeavour to clear the bit either by discovering that it is | 190 | * endeavour to clear the bit either by discovering that it is connected, |
173 | * connected, or by performing lookup operations. Any filesystem which | 191 | * or by performing lookup operations. Any filesystem which supports |
174 | * supports nfsd_operations MUST have a lookup function which, if it finds | 192 | * nfsd_operations MUST have a lookup function which, if it finds a |
175 | * a directory inode with a DCACHE_DISCONNECTED dentry, will d_move | 193 | * directory inode with a DCACHE_DISCONNECTED dentry, will d_move that |
176 | * that dentry into place and return that dentry rather than the passed one, | 194 | * dentry into place and return that dentry rather than the passed one, |
177 | * typically using d_splice_alias. | 195 | * typically using d_splice_alias. */ |
178 | */ | ||
179 | 196 | ||
180 | #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ | 197 | #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ |
181 | #define DCACHE_UNHASHED 0x0010 | 198 | #define DCACHE_UNHASHED 0x0010 |
182 | 199 | #define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 | |
183 | #define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched by inotify */ | 200 | /* Parent inode is watched by inotify */ |
184 | 201 | ||
185 | #define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */ | 202 | #define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */ |
186 | 203 | #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 | |
187 | #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 /* Parent inode is watched by some fsnotify listener */ | 204 | /* Parent inode is watched by some fsnotify listener */ |
188 | 205 | ||
189 | #define DCACHE_CANT_MOUNT 0x0100 | 206 | #define DCACHE_CANT_MOUNT 0x0100 |
207 | #define DCACHE_GENOCIDE 0x0200 | ||
208 | #define DCACHE_MOUNTED 0x0400 /* is a mountpoint */ | ||
190 | 209 | ||
191 | extern spinlock_t dcache_lock; | 210 | #define DCACHE_OP_HASH 0x1000 |
192 | extern seqlock_t rename_lock; | 211 | #define DCACHE_OP_COMPARE 0x2000 |
193 | 212 | #define DCACHE_OP_REVALIDATE 0x4000 | |
194 | /** | 213 | #define DCACHE_OP_DELETE 0x8000 |
195 | * d_drop - drop a dentry | ||
196 | * @dentry: dentry to drop | ||
197 | * | ||
198 | * d_drop() unhashes the entry from the parent dentry hashes, so that it won't | ||
199 | * be found through a VFS lookup any more. Note that this is different from | ||
200 | * deleting the dentry - d_delete will try to mark the dentry negative if | ||
201 | * possible, giving a successful _negative_ lookup, while d_drop will | ||
202 | * just make the cache lookup fail. | ||
203 | * | ||
204 | * d_drop() is used mainly for stuff that wants to invalidate a dentry for some | ||
205 | * reason (NFS timeouts or autofs deletes). | ||
206 | * | ||
207 | * __d_drop requires dentry->d_lock. | ||
208 | */ | ||
209 | |||
210 | static inline void __d_drop(struct dentry *dentry) | ||
211 | { | ||
212 | if (!(dentry->d_flags & DCACHE_UNHASHED)) { | ||
213 | dentry->d_flags |= DCACHE_UNHASHED; | ||
214 | hlist_del_rcu(&dentry->d_hash); | ||
215 | } | ||
216 | } | ||
217 | 214 | ||
218 | static inline void d_drop(struct dentry *dentry) | 215 | extern seqlock_t rename_lock; |
219 | { | ||
220 | spin_lock(&dcache_lock); | ||
221 | spin_lock(&dentry->d_lock); | ||
222 | __d_drop(dentry); | ||
223 | spin_unlock(&dentry->d_lock); | ||
224 | spin_unlock(&dcache_lock); | ||
225 | } | ||
226 | 216 | ||
227 | static inline int dname_external(struct dentry *dentry) | 217 | static inline int dname_external(struct dentry *dentry) |
228 | { | 218 | { |
@@ -235,10 +225,14 @@ static inline int dname_external(struct dentry *dentry) | |||
235 | extern void d_instantiate(struct dentry *, struct inode *); | 225 | extern void d_instantiate(struct dentry *, struct inode *); |
236 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); | 226 | extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); |
237 | extern struct dentry * d_materialise_unique(struct dentry *, struct inode *); | 227 | extern struct dentry * d_materialise_unique(struct dentry *, struct inode *); |
228 | extern void __d_drop(struct dentry *dentry); | ||
229 | extern void d_drop(struct dentry *dentry); | ||
238 | extern void d_delete(struct dentry *); | 230 | extern void d_delete(struct dentry *); |
231 | extern void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op); | ||
239 | 232 | ||
240 | /* allocate/de-allocate */ | 233 | /* allocate/de-allocate */ |
241 | extern struct dentry * d_alloc(struct dentry *, const struct qstr *); | 234 | extern struct dentry * d_alloc(struct dentry *, const struct qstr *); |
235 | extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *); | ||
242 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); | 236 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); |
243 | extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *); | 237 | extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *); |
244 | extern struct dentry * d_obtain_alias(struct inode *); | 238 | extern struct dentry * d_obtain_alias(struct inode *); |
@@ -296,14 +290,40 @@ static inline struct dentry *d_add_unique(struct dentry *entry, struct inode *in | |||
296 | return res; | 290 | return res; |
297 | } | 291 | } |
298 | 292 | ||
293 | extern void dentry_update_name_case(struct dentry *, struct qstr *); | ||
294 | |||
299 | /* used for rename() and baskets */ | 295 | /* used for rename() and baskets */ |
300 | extern void d_move(struct dentry *, struct dentry *); | 296 | extern void d_move(struct dentry *, struct dentry *); |
301 | extern struct dentry *d_ancestor(struct dentry *, struct dentry *); | 297 | extern struct dentry *d_ancestor(struct dentry *, struct dentry *); |
302 | 298 | ||
303 | /* appendix may either be NULL or be used for transname suffixes */ | 299 | /* appendix may either be NULL or be used for transname suffixes */ |
304 | extern struct dentry * d_lookup(struct dentry *, struct qstr *); | 300 | extern struct dentry *d_lookup(struct dentry *, struct qstr *); |
305 | extern struct dentry * __d_lookup(struct dentry *, struct qstr *); | 301 | extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *); |
306 | extern struct dentry * d_hash_and_lookup(struct dentry *, struct qstr *); | 302 | extern struct dentry *__d_lookup(struct dentry *, struct qstr *); |
303 | extern struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name, | ||
304 | unsigned *seq, struct inode **inode); | ||
305 | |||
306 | /** | ||
307 | * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok | ||
308 | * @dentry: dentry to take a ref on | ||
309 | * @seq: seqcount to verify against | ||
310 | * @Returns: 0 on failure, else 1. | ||
311 | * | ||
312 | * __d_rcu_to_refcount operates on a dentry,seq pair that was returned | ||
313 | * by __d_lookup_rcu, to get a reference on an rcu-walk dentry. | ||
314 | */ | ||
315 | static inline int __d_rcu_to_refcount(struct dentry *dentry, unsigned seq) | ||
316 | { | ||
317 | int ret = 0; | ||
318 | |||
319 | assert_spin_locked(&dentry->d_lock); | ||
320 | if (!read_seqcount_retry(&dentry->d_seq, seq)) { | ||
321 | ret = 1; | ||
322 | dentry->d_count++; | ||
323 | } | ||
324 | |||
325 | return ret; | ||
326 | } | ||
307 | 327 | ||
308 | /* validate "insecure" dentry pointer */ | 328 | /* validate "insecure" dentry pointer */ |
309 | extern int d_validate(struct dentry *, struct dentry *); | 329 | extern int d_validate(struct dentry *, struct dentry *); |
@@ -316,34 +336,37 @@ extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...); | |||
316 | extern char *__d_path(const struct path *path, struct path *root, char *, int); | 336 | extern char *__d_path(const struct path *path, struct path *root, char *, int); |
317 | extern char *d_path(const struct path *, char *, int); | 337 | extern char *d_path(const struct path *, char *, int); |
318 | extern char *d_path_with_unreachable(const struct path *, char *, int); | 338 | extern char *d_path_with_unreachable(const struct path *, char *, int); |
319 | extern char *__dentry_path(struct dentry *, char *, int); | 339 | extern char *dentry_path_raw(struct dentry *, char *, int); |
320 | extern char *dentry_path(struct dentry *, char *, int); | 340 | extern char *dentry_path(struct dentry *, char *, int); |
321 | 341 | ||
322 | /* Allocation counts.. */ | 342 | /* Allocation counts.. */ |
323 | 343 | ||
324 | /** | 344 | /** |
325 | * dget, dget_locked - get a reference to a dentry | 345 | * dget, dget_dlock - get a reference to a dentry |
326 | * @dentry: dentry to get a reference to | 346 | * @dentry: dentry to get a reference to |
327 | * | 347 | * |
328 | * Given a dentry or %NULL pointer increment the reference count | 348 | * Given a dentry or %NULL pointer increment the reference count |
329 | * if appropriate and return the dentry. A dentry will not be | 349 | * if appropriate and return the dentry. A dentry will not be |
330 | * destroyed when it has references. dget() should never be | 350 | * destroyed when it has references. |
331 | * called for dentries with zero reference counter. For these cases | ||
332 | * (preferably none, functions in dcache.c are sufficient for normal | ||
333 | * needs and they take necessary precautions) you should hold dcache_lock | ||
334 | * and call dget_locked() instead of dget(). | ||
335 | */ | 351 | */ |
336 | 352 | static inline struct dentry *dget_dlock(struct dentry *dentry) | |
353 | { | ||
354 | if (dentry) | ||
355 | dentry->d_count++; | ||
356 | return dentry; | ||
357 | } | ||
358 | |||
337 | static inline struct dentry *dget(struct dentry *dentry) | 359 | static inline struct dentry *dget(struct dentry *dentry) |
338 | { | 360 | { |
339 | if (dentry) { | 361 | if (dentry) { |
340 | BUG_ON(!atomic_read(&dentry->d_count)); | 362 | spin_lock(&dentry->d_lock); |
341 | atomic_inc(&dentry->d_count); | 363 | dget_dlock(dentry); |
364 | spin_unlock(&dentry->d_lock); | ||
342 | } | 365 | } |
343 | return dentry; | 366 | return dentry; |
344 | } | 367 | } |
345 | 368 | ||
346 | extern struct dentry * dget_locked(struct dentry *); | 369 | extern struct dentry *dget_parent(struct dentry *dentry); |
347 | 370 | ||
348 | /** | 371 | /** |
349 | * d_unhashed - is dentry hashed | 372 | * d_unhashed - is dentry hashed |
@@ -374,21 +397,11 @@ static inline void dont_mount(struct dentry *dentry) | |||
374 | spin_unlock(&dentry->d_lock); | 397 | spin_unlock(&dentry->d_lock); |
375 | } | 398 | } |
376 | 399 | ||
377 | static inline struct dentry *dget_parent(struct dentry *dentry) | ||
378 | { | ||
379 | struct dentry *ret; | ||
380 | |||
381 | spin_lock(&dentry->d_lock); | ||
382 | ret = dget(dentry->d_parent); | ||
383 | spin_unlock(&dentry->d_lock); | ||
384 | return ret; | ||
385 | } | ||
386 | |||
387 | extern void dput(struct dentry *); | 400 | extern void dput(struct dentry *); |
388 | 401 | ||
389 | static inline int d_mountpoint(struct dentry *dentry) | 402 | static inline int d_mountpoint(struct dentry *dentry) |
390 | { | 403 | { |
391 | return dentry->d_mounted; | 404 | return dentry->d_flags & DCACHE_MOUNTED; |
392 | } | 405 | } |
393 | 406 | ||
394 | extern struct vfsmount *lookup_mnt(struct path *); | 407 | extern struct vfsmount *lookup_mnt(struct path *); |
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h index 8723491f7dfd..68cd248f6d3e 100644 --- a/include/linux/dcbnl.h +++ b/include/linux/dcbnl.h | |||
@@ -22,6 +22,89 @@ | |||
22 | 22 | ||
23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
24 | 24 | ||
25 | /* IEEE 802.1Qaz std supported values */ | ||
26 | #define IEEE_8021QAZ_MAX_TCS 8 | ||
27 | |||
28 | /* This structure contains the IEEE 802.1Qaz ETS managed object | ||
29 | * | ||
30 | * @willing: willing bit in ETS configuratin TLV | ||
31 | * @ets_cap: indicates supported capacity of ets feature | ||
32 | * @cbs: credit based shaper ets algorithm supported | ||
33 | * @tc_tx_bw: tc tx bandwidth indexed by traffic class | ||
34 | * @tc_rx_bw: tc rx bandwidth indexed by traffic class | ||
35 | * @tc_tsa: TSA Assignment table, indexed by traffic class | ||
36 | * @prio_tc: priority assignment table mapping 8021Qp to traffic class | ||
37 | * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV | ||
38 | * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV | ||
39 | * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV | ||
40 | * | ||
41 | * Recommended values are used to set fields in the ETS recommendation TLV | ||
42 | * with hardware offloaded LLDP. | ||
43 | * | ||
44 | * ---- | ||
45 | * TSA Assignment 8 bit identifiers | ||
46 | * 0 strict priority | ||
47 | * 1 credit-based shaper | ||
48 | * 2 enhanced transmission selection | ||
49 | * 3-254 reserved | ||
50 | * 255 vendor specific | ||
51 | */ | ||
52 | struct ieee_ets { | ||
53 | __u8 willing; | ||
54 | __u8 ets_cap; | ||
55 | __u8 cbs; | ||
56 | __u8 tc_tx_bw[IEEE_8021QAZ_MAX_TCS]; | ||
57 | __u8 tc_rx_bw[IEEE_8021QAZ_MAX_TCS]; | ||
58 | __u8 tc_tsa[IEEE_8021QAZ_MAX_TCS]; | ||
59 | __u8 prio_tc[IEEE_8021QAZ_MAX_TCS]; | ||
60 | __u8 tc_reco_bw[IEEE_8021QAZ_MAX_TCS]; | ||
61 | __u8 tc_reco_tsa[IEEE_8021QAZ_MAX_TCS]; | ||
62 | __u8 reco_prio_tc[IEEE_8021QAZ_MAX_TCS]; | ||
63 | }; | ||
64 | |||
65 | /* This structure contains the IEEE 802.1Qaz PFC managed object | ||
66 | * | ||
67 | * @pfc_cap: Indicates the number of traffic classes on the local device | ||
68 | * that may simultaneously have PFC enabled. | ||
69 | * @pfc_en: bitmap indicating pfc enabled traffic classes | ||
70 | * @mbc: enable macsec bypass capability | ||
71 | * @delay: the allowance made for a round-trip propagation delay of the | ||
72 | * link in bits. | ||
73 | * @requests: count of the sent pfc frames | ||
74 | * @indications: count of the received pfc frames | ||
75 | */ | ||
76 | struct ieee_pfc { | ||
77 | __u8 pfc_cap; | ||
78 | __u8 pfc_en; | ||
79 | __u8 mbc; | ||
80 | __u16 delay; | ||
81 | __u64 requests[IEEE_8021QAZ_MAX_TCS]; | ||
82 | __u64 indications[IEEE_8021QAZ_MAX_TCS]; | ||
83 | }; | ||
84 | |||
85 | /* This structure contains the IEEE 802.1Qaz APP managed object. This | ||
86 | * object is also used for the CEE std as well. There is no difference | ||
87 | * between the objects. | ||
88 | * | ||
89 | * @selector: protocol identifier type | ||
90 | * @protocol: protocol of type indicated | ||
91 | * @priority: 3-bit unsigned integer indicating priority | ||
92 | * | ||
93 | * ---- | ||
94 | * Selector field values | ||
95 | * 0 Reserved | ||
96 | * 1 Ethertype | ||
97 | * 2 Well known port number over TCP or SCTP | ||
98 | * 3 Well known port number over UDP or DCCP | ||
99 | * 4 Well known port number over TCP, SCTP, UDP, or DCCP | ||
100 | * 5-7 Reserved | ||
101 | */ | ||
102 | struct dcb_app { | ||
103 | __u8 selector; | ||
104 | __u32 protocol; | ||
105 | __u8 priority; | ||
106 | }; | ||
107 | |||
25 | struct dcbmsg { | 108 | struct dcbmsg { |
26 | __u8 dcb_family; | 109 | __u8 dcb_family; |
27 | __u8 cmd; | 110 | __u8 cmd; |
@@ -50,6 +133,12 @@ struct dcbmsg { | |||
50 | * @DCB_CMD_SBCN: get backward congestion notification configration. | 133 | * @DCB_CMD_SBCN: get backward congestion notification configration. |
51 | * @DCB_CMD_GAPP: get application protocol configuration | 134 | * @DCB_CMD_GAPP: get application protocol configuration |
52 | * @DCB_CMD_SAPP: set application protocol configuration | 135 | * @DCB_CMD_SAPP: set application protocol configuration |
136 | * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration | ||
137 | * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration | ||
138 | * @DCB_CMD_GDCBX: get DCBX engine configuration | ||
139 | * @DCB_CMD_SDCBX: set DCBX engine configuration | ||
140 | * @DCB_CMD_GFEATCFG: get DCBX features flags | ||
141 | * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags | ||
53 | */ | 142 | */ |
54 | enum dcbnl_commands { | 143 | enum dcbnl_commands { |
55 | DCB_CMD_UNDEFINED, | 144 | DCB_CMD_UNDEFINED, |
@@ -83,6 +172,15 @@ enum dcbnl_commands { | |||
83 | DCB_CMD_GAPP, | 172 | DCB_CMD_GAPP, |
84 | DCB_CMD_SAPP, | 173 | DCB_CMD_SAPP, |
85 | 174 | ||
175 | DCB_CMD_IEEE_SET, | ||
176 | DCB_CMD_IEEE_GET, | ||
177 | |||
178 | DCB_CMD_GDCBX, | ||
179 | DCB_CMD_SDCBX, | ||
180 | |||
181 | DCB_CMD_GFEATCFG, | ||
182 | DCB_CMD_SFEATCFG, | ||
183 | |||
86 | __DCB_CMD_ENUM_MAX, | 184 | __DCB_CMD_ENUM_MAX, |
87 | DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, | 185 | DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, |
88 | }; | 186 | }; |
@@ -102,6 +200,9 @@ enum dcbnl_commands { | |||
102 | * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED) | 200 | * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED) |
103 | * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED) | 201 | * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED) |
104 | * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED) | 202 | * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED) |
203 | * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED) | ||
204 | * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8) | ||
205 | * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED) | ||
105 | */ | 206 | */ |
106 | enum dcbnl_attrs { | 207 | enum dcbnl_attrs { |
107 | DCB_ATTR_UNDEFINED, | 208 | DCB_ATTR_UNDEFINED, |
@@ -119,10 +220,32 @@ enum dcbnl_attrs { | |||
119 | DCB_ATTR_BCN, | 220 | DCB_ATTR_BCN, |
120 | DCB_ATTR_APP, | 221 | DCB_ATTR_APP, |
121 | 222 | ||
223 | /* IEEE std attributes */ | ||
224 | DCB_ATTR_IEEE, | ||
225 | |||
226 | DCB_ATTR_DCBX, | ||
227 | DCB_ATTR_FEATCFG, | ||
228 | |||
122 | __DCB_ATTR_ENUM_MAX, | 229 | __DCB_ATTR_ENUM_MAX, |
123 | DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, | 230 | DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, |
124 | }; | 231 | }; |
125 | 232 | ||
233 | enum ieee_attrs { | ||
234 | DCB_ATTR_IEEE_UNSPEC, | ||
235 | DCB_ATTR_IEEE_ETS, | ||
236 | DCB_ATTR_IEEE_PFC, | ||
237 | DCB_ATTR_IEEE_APP_TABLE, | ||
238 | __DCB_ATTR_IEEE_MAX | ||
239 | }; | ||
240 | #define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1) | ||
241 | |||
242 | enum ieee_attrs_app { | ||
243 | DCB_ATTR_IEEE_APP_UNSPEC, | ||
244 | DCB_ATTR_IEEE_APP, | ||
245 | __DCB_ATTR_IEEE_APP_MAX | ||
246 | }; | ||
247 | #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1) | ||
248 | |||
126 | /** | 249 | /** |
127 | * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs | 250 | * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs |
128 | * | 251 | * |
@@ -262,6 +385,8 @@ enum dcbnl_tc_attrs { | |||
262 | * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority | 385 | * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority |
263 | * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion | 386 | * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion |
264 | * Notification | 387 | * Notification |
388 | * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine | ||
389 | * | ||
265 | */ | 390 | */ |
266 | enum dcbnl_cap_attrs { | 391 | enum dcbnl_cap_attrs { |
267 | DCB_CAP_ATTR_UNDEFINED, | 392 | DCB_CAP_ATTR_UNDEFINED, |
@@ -273,12 +398,45 @@ enum dcbnl_cap_attrs { | |||
273 | DCB_CAP_ATTR_PFC_TCS, | 398 | DCB_CAP_ATTR_PFC_TCS, |
274 | DCB_CAP_ATTR_GSP, | 399 | DCB_CAP_ATTR_GSP, |
275 | DCB_CAP_ATTR_BCN, | 400 | DCB_CAP_ATTR_BCN, |
401 | DCB_CAP_ATTR_DCBX, | ||
276 | 402 | ||
277 | __DCB_CAP_ATTR_ENUM_MAX, | 403 | __DCB_CAP_ATTR_ENUM_MAX, |
278 | DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1, | 404 | DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1, |
279 | }; | 405 | }; |
280 | 406 | ||
281 | /** | 407 | /** |
408 | * DCBX capability flags | ||
409 | * | ||
410 | * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent. | ||
411 | * 'set' routines are used to configure the device with | ||
412 | * the negotiated parameters | ||
413 | * | ||
414 | * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but | ||
415 | * by another entity | ||
416 | * 'get' routines are used to retrieve the | ||
417 | * negotiated parameters | ||
418 | * 'set' routines can be used to set the initial | ||
419 | * negotiation configuration | ||
420 | * | ||
421 | * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine | ||
422 | * supports the CEE protocol flavor | ||
423 | * | ||
424 | * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine | ||
425 | * supports the IEEE protocol flavor | ||
426 | * | ||
427 | * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine | ||
428 | * supports static configuration (i.e no actual | ||
429 | * negotiation is performed negotiated parameters equal | ||
430 | * the initial configuration) | ||
431 | * | ||
432 | */ | ||
433 | #define DCB_CAP_DCBX_HOST 0x01 | ||
434 | #define DCB_CAP_DCBX_LLD_MANAGED 0x02 | ||
435 | #define DCB_CAP_DCBX_VER_CEE 0x04 | ||
436 | #define DCB_CAP_DCBX_VER_IEEE 0x08 | ||
437 | #define DCB_CAP_DCBX_STATIC 0x10 | ||
438 | |||
439 | /** | ||
282 | * enum dcbnl_numtcs_attrs - number of traffic classes | 440 | * enum dcbnl_numtcs_attrs - number of traffic classes |
283 | * | 441 | * |
284 | * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors | 442 | * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors |
@@ -355,4 +513,30 @@ enum dcbnl_app_attrs { | |||
355 | DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1, | 513 | DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1, |
356 | }; | 514 | }; |
357 | 515 | ||
516 | /** | ||
517 | * enum dcbnl_featcfg_attrs - features conifiguration flags | ||
518 | * | ||
519 | * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors | ||
520 | * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes | ||
521 | * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups | ||
522 | * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority | ||
523 | * flow control | ||
524 | * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV | ||
525 | * | ||
526 | */ | ||
527 | #define DCB_FEATCFG_ERROR 0x01 /* error in feature resolution */ | ||
528 | #define DCB_FEATCFG_ENABLE 0x02 /* enable feature */ | ||
529 | #define DCB_FEATCFG_WILLING 0x04 /* feature is willing */ | ||
530 | #define DCB_FEATCFG_ADVERTISE 0x08 /* advertise feature */ | ||
531 | enum dcbnl_featcfg_attrs { | ||
532 | DCB_FEATCFG_ATTR_UNDEFINED, | ||
533 | DCB_FEATCFG_ATTR_ALL, | ||
534 | DCB_FEATCFG_ATTR_PG, | ||
535 | DCB_FEATCFG_ATTR_PFC, | ||
536 | DCB_FEATCFG_ATTR_APP, | ||
537 | |||
538 | __DCB_FEATCFG_ATTR_ENUM_MAX, | ||
539 | DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1, | ||
540 | }; | ||
541 | |||
358 | #endif /* __LINUX_DCBNL_H__ */ | 542 | #endif /* __LINUX_DCBNL_H__ */ |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 749f01ccd26e..010e2d87ed75 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -197,6 +197,21 @@ enum dccp_feature_numbers { | |||
197 | DCCPF_MAX_CCID_SPECIFIC = 255, | 197 | DCCPF_MAX_CCID_SPECIFIC = 255, |
198 | }; | 198 | }; |
199 | 199 | ||
200 | /* DCCP socket control message types for cmsg */ | ||
201 | enum dccp_cmsg_type { | ||
202 | DCCP_SCM_PRIORITY = 1, | ||
203 | DCCP_SCM_QPOLICY_MAX = 0xFFFF, | ||
204 | /* ^-- Up to here reserved exclusively for qpolicy parameters */ | ||
205 | DCCP_SCM_MAX | ||
206 | }; | ||
207 | |||
208 | /* DCCP priorities for outgoing/queued packets */ | ||
209 | enum dccp_packet_dequeueing_policy { | ||
210 | DCCPQ_POLICY_SIMPLE, | ||
211 | DCCPQ_POLICY_PRIO, | ||
212 | DCCPQ_POLICY_MAX | ||
213 | }; | ||
214 | |||
200 | /* DCCP socket options */ | 215 | /* DCCP socket options */ |
201 | #define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */ | 216 | #define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */ |
202 | #define DCCP_SOCKOPT_SERVICE 2 | 217 | #define DCCP_SOCKOPT_SERVICE 2 |
@@ -210,6 +225,8 @@ enum dccp_feature_numbers { | |||
210 | #define DCCP_SOCKOPT_CCID 13 | 225 | #define DCCP_SOCKOPT_CCID 13 |
211 | #define DCCP_SOCKOPT_TX_CCID 14 | 226 | #define DCCP_SOCKOPT_TX_CCID 14 |
212 | #define DCCP_SOCKOPT_RX_CCID 15 | 227 | #define DCCP_SOCKOPT_RX_CCID 15 |
228 | #define DCCP_SOCKOPT_QPOLICY_ID 16 | ||
229 | #define DCCP_SOCKOPT_QPOLICY_TXQLEN 17 | ||
213 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 | 230 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 |
214 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 | 231 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 |
215 | 232 | ||
@@ -458,10 +475,13 @@ struct dccp_ackvec; | |||
458 | * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection) | 475 | * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection) |
459 | * @dccps_hc_tx_ccid - CCID used for the sender (or sending half-connection) | 476 | * @dccps_hc_tx_ccid - CCID used for the sender (or sending half-connection) |
460 | * @dccps_options_received - parsed set of retrieved options | 477 | * @dccps_options_received - parsed set of retrieved options |
478 | * @dccps_qpolicy - TX dequeueing policy, one of %dccp_packet_dequeueing_policy | ||
479 | * @dccps_tx_qlen - maximum length of the TX queue | ||
461 | * @dccps_role - role of this sock, one of %dccp_role | 480 | * @dccps_role - role of this sock, one of %dccp_role |
462 | * @dccps_hc_rx_insert_options - receiver wants to add options when acking | 481 | * @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 | 482 | * @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) | 483 | * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3) |
484 | * @dccps_sync_scheduled - flag which signals "send out-of-band message soon" | ||
465 | * @dccps_xmitlet - tasklet scheduled by the TX CCID to dequeue data packets | 485 | * @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) | 486 | * @dccps_xmit_timer - used by the TX CCID to delay sending (rate-based pacing) |
467 | * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) | 487 | * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) |
@@ -499,10 +519,13 @@ struct dccp_sock { | |||
499 | struct ccid *dccps_hc_rx_ccid; | 519 | struct ccid *dccps_hc_rx_ccid; |
500 | struct ccid *dccps_hc_tx_ccid; | 520 | struct ccid *dccps_hc_tx_ccid; |
501 | struct dccp_options_received dccps_options_received; | 521 | struct dccp_options_received dccps_options_received; |
522 | __u8 dccps_qpolicy; | ||
523 | __u32 dccps_tx_qlen; | ||
502 | enum dccp_role dccps_role:2; | 524 | enum dccp_role dccps_role:2; |
503 | __u8 dccps_hc_rx_insert_options:1; | 525 | __u8 dccps_hc_rx_insert_options:1; |
504 | __u8 dccps_hc_tx_insert_options:1; | 526 | __u8 dccps_hc_tx_insert_options:1; |
505 | __u8 dccps_server_timewait:1; | 527 | __u8 dccps_server_timewait:1; |
528 | __u8 dccps_sync_scheduled:1; | ||
506 | struct tasklet_struct dccps_xmitlet; | 529 | struct tasklet_struct dccps_xmitlet; |
507 | struct timer_list dccps_xmit_timer; | 530 | struct timer_list dccps_xmit_timer; |
508 | }; | 531 | }; |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 9d8688b92d8b..8cd00ad98d37 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -824,6 +824,8 @@ enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie); | |||
824 | #ifdef CONFIG_DMA_ENGINE | 824 | #ifdef CONFIG_DMA_ENGINE |
825 | 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); |
826 | 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); | ||
827 | #else | 829 | #else |
828 | 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) |
829 | { | 831 | { |
@@ -831,7 +833,14 @@ static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descript | |||
831 | } | 833 | } |
832 | static inline void dma_issue_pending_all(void) | 834 | static inline void dma_issue_pending_all(void) |
833 | { | 835 | { |
834 | 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 | { | ||
835 | } | 844 | } |
836 | #endif | 845 | #endif |
837 | 846 | ||
@@ -842,8 +851,6 @@ void dma_async_device_unregister(struct dma_device *device); | |||
842 | void dma_run_dependencies(struct dma_async_tx_descriptor *tx); | 851 | void dma_run_dependencies(struct dma_async_tx_descriptor *tx); |
843 | 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); |
844 | #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) |
845 | struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param); | ||
846 | void dma_release_channel(struct dma_chan *chan); | ||
847 | 854 | ||
848 | /* --- Helper iov-locking functions --- */ | 855 | /* --- Helper iov-locking functions --- */ |
849 | 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/elevator.h b/include/linux/elevator.h index 4fd978e7eb83..4d857973d2c9 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -195,15 +195,9 @@ enum { | |||
195 | /* | 195 | /* |
196 | * io context count accounting | 196 | * io context count accounting |
197 | */ | 197 | */ |
198 | #define elv_ioc_count_mod(name, __val) \ | 198 | #define elv_ioc_count_mod(name, __val) this_cpu_add(name, __val) |
199 | do { \ | 199 | #define elv_ioc_count_inc(name) this_cpu_inc(name) |
200 | preempt_disable(); \ | 200 | #define elv_ioc_count_dec(name) this_cpu_dec(name) |
201 | __get_cpu_var(name) += (__val); \ | ||
202 | preempt_enable(); \ | ||
203 | } while (0) | ||
204 | |||
205 | #define elv_ioc_count_inc(name) elv_ioc_count_mod(name, 1) | ||
206 | #define elv_ioc_count_dec(name) elv_ioc_count_mod(name, -1) | ||
207 | 201 | ||
208 | #define elv_ioc_count_read(name) \ | 202 | #define elv_ioc_count_read(name) \ |
209 | ({ \ | 203 | ({ \ |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 6628a507fd3b..1908929204a9 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -691,7 +691,9 @@ struct ethtool_ops { | |||
691 | #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */ | 691 | #define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */ |
692 | #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */ | 692 | #define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */ |
693 | #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */ | 693 | #define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */ |
694 | #define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */ | 694 | /* Get link status for host, i.e. whether the interface *and* the |
695 | * physical port (if there is one) are up (ethtool_value). */ | ||
696 | #define ETHTOOL_GLINK 0x0000000a | ||
695 | #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */ | 697 | #define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */ |
696 | #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */ | 698 | #define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */ |
697 | #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */ | 699 | #define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */ |
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h index 0f0121467fc4..6c6133f76e16 100644 --- a/include/linux/fanotify.h +++ b/include/linux/fanotify.h | |||
@@ -83,11 +83,13 @@ | |||
83 | FAN_ALL_PERM_EVENTS |\ | 83 | FAN_ALL_PERM_EVENTS |\ |
84 | FAN_Q_OVERFLOW) | 84 | FAN_Q_OVERFLOW) |
85 | 85 | ||
86 | #define FANOTIFY_METADATA_VERSION 2 | 86 | #define FANOTIFY_METADATA_VERSION 3 |
87 | 87 | ||
88 | struct fanotify_event_metadata { | 88 | struct fanotify_event_metadata { |
89 | __u32 event_len; | 89 | __u32 event_len; |
90 | __u32 vers; | 90 | __u8 vers; |
91 | __u8 reserved; | ||
92 | __u16 metadata_len; | ||
91 | __aligned_u64 mask; | 93 | __aligned_u64 mask; |
92 | __s32 fd; | 94 | __s32 fd; |
93 | __s32 pid; | 95 | __s32 pid; |
@@ -96,11 +98,13 @@ struct fanotify_event_metadata { | |||
96 | struct fanotify_response { | 98 | struct fanotify_response { |
97 | __s32 fd; | 99 | __s32 fd; |
98 | __u32 response; | 100 | __u32 response; |
99 | } __attribute__ ((packed)); | 101 | }; |
100 | 102 | ||
101 | /* Legit userspace responses to a _PERM event */ | 103 | /* Legit userspace responses to a _PERM event */ |
102 | #define FAN_ALLOW 0x01 | 104 | #define FAN_ALLOW 0x01 |
103 | #define FAN_DENY 0x02 | 105 | #define FAN_DENY 0x02 |
106 | /* No fd set in event */ | ||
107 | #define FAN_NOFD -1 | ||
104 | 108 | ||
105 | /* Helper functions to deal with fanotify_event_metadata buffers */ | 109 | /* Helper functions to deal with fanotify_event_metadata buffers */ |
106 | #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 7fca3dc4e475..68ba85a00c06 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -1092,6 +1092,8 @@ extern int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var); | |||
1092 | extern const unsigned char *fb_firmware_edid(struct device *device); | 1092 | extern const unsigned char *fb_firmware_edid(struct device *device); |
1093 | extern void fb_edid_to_monspecs(unsigned char *edid, | 1093 | extern void fb_edid_to_monspecs(unsigned char *edid, |
1094 | struct fb_monspecs *specs); | 1094 | struct fb_monspecs *specs); |
1095 | extern void fb_edid_add_monspecs(unsigned char *edid, | ||
1096 | struct fb_monspecs *specs); | ||
1095 | extern void fb_destroy_modedb(struct fb_videomode *modedb); | 1097 | extern void fb_destroy_modedb(struct fb_videomode *modedb); |
1096 | extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); | 1098 | extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); |
1097 | extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter); | 1099 | extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter); |
@@ -1122,6 +1124,7 @@ extern const struct fb_videomode *fb_find_best_display(const struct fb_monspecs | |||
1122 | 1124 | ||
1123 | /* drivers/video/fbcmap.c */ | 1125 | /* drivers/video/fbcmap.c */ |
1124 | extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); | 1126 | extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); |
1127 | extern int fb_alloc_cmap_gfp(struct fb_cmap *cmap, int len, int transp, gfp_t flags); | ||
1125 | extern void fb_dealloc_cmap(struct fb_cmap *cmap); | 1128 | extern void fb_dealloc_cmap(struct fb_cmap *cmap); |
1126 | extern int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to); | 1129 | extern int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to); |
1127 | extern int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to); | 1130 | extern int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to); |
@@ -1149,6 +1152,7 @@ struct fb_videomode { | |||
1149 | 1152 | ||
1150 | extern const char *fb_mode_option; | 1153 | extern const char *fb_mode_option; |
1151 | extern const struct fb_videomode vesa_modes[]; | 1154 | extern const struct fb_videomode vesa_modes[]; |
1155 | extern const struct fb_videomode cea_modes[64]; | ||
1152 | 1156 | ||
1153 | struct fb_modelist { | 1157 | struct fb_modelist { |
1154 | struct list_head list; | 1158 | struct list_head list; |
diff --git a/include/linux/filter.h b/include/linux/filter.h index 69b43dbea6c6..45266b75409a 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -91,54 +91,6 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ | |||
91 | #define BPF_TAX 0x00 | 91 | #define BPF_TAX 0x00 |
92 | #define BPF_TXA 0x80 | 92 | #define BPF_TXA 0x80 |
93 | 93 | ||
94 | enum { | ||
95 | BPF_S_RET_K = 0, | ||
96 | BPF_S_RET_A, | ||
97 | BPF_S_ALU_ADD_K, | ||
98 | BPF_S_ALU_ADD_X, | ||
99 | BPF_S_ALU_SUB_K, | ||
100 | BPF_S_ALU_SUB_X, | ||
101 | BPF_S_ALU_MUL_K, | ||
102 | BPF_S_ALU_MUL_X, | ||
103 | BPF_S_ALU_DIV_X, | ||
104 | BPF_S_ALU_AND_K, | ||
105 | BPF_S_ALU_AND_X, | ||
106 | BPF_S_ALU_OR_K, | ||
107 | BPF_S_ALU_OR_X, | ||
108 | BPF_S_ALU_LSH_K, | ||
109 | BPF_S_ALU_LSH_X, | ||
110 | BPF_S_ALU_RSH_K, | ||
111 | BPF_S_ALU_RSH_X, | ||
112 | BPF_S_ALU_NEG, | ||
113 | BPF_S_LD_W_ABS, | ||
114 | BPF_S_LD_H_ABS, | ||
115 | BPF_S_LD_B_ABS, | ||
116 | BPF_S_LD_W_LEN, | ||
117 | BPF_S_LD_W_IND, | ||
118 | BPF_S_LD_H_IND, | ||
119 | BPF_S_LD_B_IND, | ||
120 | BPF_S_LD_IMM, | ||
121 | BPF_S_LDX_W_LEN, | ||
122 | BPF_S_LDX_B_MSH, | ||
123 | BPF_S_LDX_IMM, | ||
124 | BPF_S_MISC_TAX, | ||
125 | BPF_S_MISC_TXA, | ||
126 | BPF_S_ALU_DIV_K, | ||
127 | BPF_S_LD_MEM, | ||
128 | BPF_S_LDX_MEM, | ||
129 | BPF_S_ST, | ||
130 | BPF_S_STX, | ||
131 | BPF_S_JMP_JA, | ||
132 | BPF_S_JMP_JEQ_K, | ||
133 | BPF_S_JMP_JEQ_X, | ||
134 | BPF_S_JMP_JGE_K, | ||
135 | BPF_S_JMP_JGE_X, | ||
136 | BPF_S_JMP_JGT_K, | ||
137 | BPF_S_JMP_JGT_X, | ||
138 | BPF_S_JMP_JSET_K, | ||
139 | BPF_S_JMP_JSET_X, | ||
140 | }; | ||
141 | |||
142 | #ifndef BPF_MAXINSNS | 94 | #ifndef BPF_MAXINSNS |
143 | #define BPF_MAXINSNS 4096 | 95 | #define BPF_MAXINSNS 4096 |
144 | #endif | 96 | #endif |
@@ -172,7 +124,9 @@ enum { | |||
172 | #define SKF_AD_MARK 20 | 124 | #define SKF_AD_MARK 20 |
173 | #define SKF_AD_QUEUE 24 | 125 | #define SKF_AD_QUEUE 24 |
174 | #define SKF_AD_HATYPE 28 | 126 | #define SKF_AD_HATYPE 28 |
175 | #define SKF_AD_MAX 32 | 127 | #define SKF_AD_RXHASH 32 |
128 | #define SKF_AD_CPU 36 | ||
129 | #define SKF_AD_MAX 40 | ||
176 | #define SKF_NET_OFF (-0x100000) | 130 | #define SKF_NET_OFF (-0x100000) |
177 | #define SKF_LL_OFF (-0x200000) | 131 | #define SKF_LL_OFF (-0x200000) |
178 | 132 | ||
@@ -194,8 +148,8 @@ struct sk_buff; | |||
194 | struct sock; | 148 | struct sock; |
195 | 149 | ||
196 | extern int sk_filter(struct sock *sk, struct sk_buff *skb); | 150 | extern int sk_filter(struct sock *sk, struct sk_buff *skb); |
197 | extern unsigned int sk_run_filter(struct sk_buff *skb, | 151 | extern unsigned int sk_run_filter(const struct sk_buff *skb, |
198 | struct sock_filter *filter, int flen); | 152 | const struct sock_filter *filter); |
199 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); | 153 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); |
200 | extern int sk_detach_filter(struct sock *sk); | 154 | extern int sk_detach_filter(struct sock *sk); |
201 | extern int sk_chk_filter(struct sock_filter *filter, int flen); | 155 | extern int sk_chk_filter(struct sock_filter *filter, int flen); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 334d68a17108..baf3e556ff0e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -34,9 +34,9 @@ | |||
34 | #define SEEK_MAX SEEK_END | 34 | #define SEEK_MAX SEEK_END |
35 | 35 | ||
36 | struct fstrim_range { | 36 | struct fstrim_range { |
37 | uint64_t start; | 37 | __u64 start; |
38 | uint64_t len; | 38 | __u64 len; |
39 | uint64_t minlen; | 39 | __u64 minlen; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | /* And dynamically-tunable limits and defaults: */ | 42 | /* And dynamically-tunable limits and defaults: */ |
@@ -392,6 +392,7 @@ struct inodes_stat_t { | |||
392 | #include <linux/capability.h> | 392 | #include <linux/capability.h> |
393 | #include <linux/semaphore.h> | 393 | #include <linux/semaphore.h> |
394 | #include <linux/fiemap.h> | 394 | #include <linux/fiemap.h> |
395 | #include <linux/rculist_bl.h> | ||
395 | 396 | ||
396 | #include <asm/atomic.h> | 397 | #include <asm/atomic.h> |
397 | #include <asm/byteorder.h> | 398 | #include <asm/byteorder.h> |
@@ -602,6 +603,7 @@ struct address_space_operations { | |||
602 | sector_t (*bmap)(struct address_space *, sector_t); | 603 | sector_t (*bmap)(struct address_space *, sector_t); |
603 | void (*invalidatepage) (struct page *, unsigned long); | 604 | void (*invalidatepage) (struct page *, unsigned long); |
604 | int (*releasepage) (struct page *, gfp_t); | 605 | int (*releasepage) (struct page *, gfp_t); |
606 | void (*freepage)(struct page *); | ||
605 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 607 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, |
606 | loff_t offset, unsigned long nr_segs); | 608 | loff_t offset, unsigned long nr_segs); |
607 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, | 609 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, |
@@ -732,16 +734,31 @@ struct posix_acl; | |||
732 | #define ACL_NOT_CACHED ((void *)(-1)) | 734 | #define ACL_NOT_CACHED ((void *)(-1)) |
733 | 735 | ||
734 | struct inode { | 736 | struct inode { |
737 | /* RCU path lookup touches following: */ | ||
738 | umode_t i_mode; | ||
739 | uid_t i_uid; | ||
740 | gid_t i_gid; | ||
741 | const struct inode_operations *i_op; | ||
742 | struct super_block *i_sb; | ||
743 | |||
744 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | ||
745 | unsigned int i_flags; | ||
746 | struct mutex i_mutex; | ||
747 | |||
748 | unsigned long i_state; | ||
749 | unsigned long dirtied_when; /* jiffies of first dirtying */ | ||
750 | |||
735 | struct hlist_node i_hash; | 751 | struct hlist_node i_hash; |
736 | struct list_head i_wb_list; /* backing dev IO list */ | 752 | struct list_head i_wb_list; /* backing dev IO list */ |
737 | struct list_head i_lru; /* inode LRU list */ | 753 | struct list_head i_lru; /* inode LRU list */ |
738 | struct list_head i_sb_list; | 754 | struct list_head i_sb_list; |
739 | struct list_head i_dentry; | 755 | union { |
756 | struct list_head i_dentry; | ||
757 | struct rcu_head i_rcu; | ||
758 | }; | ||
740 | unsigned long i_ino; | 759 | unsigned long i_ino; |
741 | atomic_t i_count; | 760 | atomic_t i_count; |
742 | unsigned int i_nlink; | 761 | unsigned int i_nlink; |
743 | uid_t i_uid; | ||
744 | gid_t i_gid; | ||
745 | dev_t i_rdev; | 762 | dev_t i_rdev; |
746 | unsigned int i_blkbits; | 763 | unsigned int i_blkbits; |
747 | u64 i_version; | 764 | u64 i_version; |
@@ -754,13 +771,8 @@ struct inode { | |||
754 | struct timespec i_ctime; | 771 | struct timespec i_ctime; |
755 | blkcnt_t i_blocks; | 772 | blkcnt_t i_blocks; |
756 | unsigned short i_bytes; | 773 | unsigned short i_bytes; |
757 | umode_t i_mode; | ||
758 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | ||
759 | struct mutex i_mutex; | ||
760 | struct rw_semaphore i_alloc_sem; | 774 | struct rw_semaphore i_alloc_sem; |
761 | const struct inode_operations *i_op; | ||
762 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ | 775 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ |
763 | struct super_block *i_sb; | ||
764 | struct file_lock *i_flock; | 776 | struct file_lock *i_flock; |
765 | struct address_space *i_mapping; | 777 | struct address_space *i_mapping; |
766 | struct address_space i_data; | 778 | struct address_space i_data; |
@@ -781,11 +793,6 @@ struct inode { | |||
781 | struct hlist_head i_fsnotify_marks; | 793 | struct hlist_head i_fsnotify_marks; |
782 | #endif | 794 | #endif |
783 | 795 | ||
784 | unsigned long i_state; | ||
785 | unsigned long dirtied_when; /* jiffies of first dirtying */ | ||
786 | |||
787 | unsigned int i_flags; | ||
788 | |||
789 | #ifdef CONFIG_IMA | 796 | #ifdef CONFIG_IMA |
790 | /* protected by i_lock */ | 797 | /* protected by i_lock */ |
791 | unsigned int i_readcount; /* struct files open RO */ | 798 | unsigned int i_readcount; /* struct files open RO */ |
@@ -1371,13 +1378,13 @@ struct super_block { | |||
1371 | const struct xattr_handler **s_xattr; | 1378 | const struct xattr_handler **s_xattr; |
1372 | 1379 | ||
1373 | struct list_head s_inodes; /* all inodes */ | 1380 | struct list_head s_inodes; /* all inodes */ |
1374 | struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ | 1381 | struct hlist_bl_head s_anon; /* anonymous dentries for (nfs) exporting */ |
1375 | #ifdef CONFIG_SMP | 1382 | #ifdef CONFIG_SMP |
1376 | struct list_head __percpu *s_files; | 1383 | struct list_head __percpu *s_files; |
1377 | #else | 1384 | #else |
1378 | struct list_head s_files; | 1385 | struct list_head s_files; |
1379 | #endif | 1386 | #endif |
1380 | /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */ | 1387 | /* s_dentry_lru, s_nr_dentry_unused protected by dcache.c lru locks */ |
1381 | struct list_head s_dentry_lru; /* unused dentry lru */ | 1388 | struct list_head s_dentry_lru; /* unused dentry lru */ |
1382 | int s_nr_dentry_unused; /* # of dentry on lru */ | 1389 | int s_nr_dentry_unused; /* # of dentry on lru */ |
1383 | 1390 | ||
@@ -1544,9 +1551,18 @@ struct file_operations { | |||
1544 | int (*setlease)(struct file *, long, struct file_lock **); | 1551 | int (*setlease)(struct file *, long, struct file_lock **); |
1545 | }; | 1552 | }; |
1546 | 1553 | ||
1554 | #define IPERM_FLAG_RCU 0x0001 | ||
1555 | |||
1547 | struct inode_operations { | 1556 | struct inode_operations { |
1548 | int (*create) (struct inode *,struct dentry *,int, struct nameidata *); | ||
1549 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); | 1557 | struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); |
1558 | void * (*follow_link) (struct dentry *, struct nameidata *); | ||
1559 | int (*permission) (struct inode *, int, unsigned int); | ||
1560 | int (*check_acl)(struct inode *, int, unsigned int); | ||
1561 | |||
1562 | int (*readlink) (struct dentry *, char __user *,int); | ||
1563 | void (*put_link) (struct dentry *, struct nameidata *, void *); | ||
1564 | |||
1565 | int (*create) (struct inode *,struct dentry *,int, struct nameidata *); | ||
1550 | int (*link) (struct dentry *,struct inode *,struct dentry *); | 1566 | int (*link) (struct dentry *,struct inode *,struct dentry *); |
1551 | int (*unlink) (struct inode *,struct dentry *); | 1567 | int (*unlink) (struct inode *,struct dentry *); |
1552 | int (*symlink) (struct inode *,struct dentry *,const char *); | 1568 | int (*symlink) (struct inode *,struct dentry *,const char *); |
@@ -1555,12 +1571,7 @@ struct inode_operations { | |||
1555 | int (*mknod) (struct inode *,struct dentry *,int,dev_t); | 1571 | int (*mknod) (struct inode *,struct dentry *,int,dev_t); |
1556 | int (*rename) (struct inode *, struct dentry *, | 1572 | int (*rename) (struct inode *, struct dentry *, |
1557 | struct inode *, struct dentry *); | 1573 | struct inode *, struct dentry *); |
1558 | int (*readlink) (struct dentry *, char __user *,int); | ||
1559 | void * (*follow_link) (struct dentry *, struct nameidata *); | ||
1560 | void (*put_link) (struct dentry *, struct nameidata *, void *); | ||
1561 | void (*truncate) (struct inode *); | 1574 | void (*truncate) (struct inode *); |
1562 | int (*permission) (struct inode *, int); | ||
1563 | int (*check_acl)(struct inode *, int); | ||
1564 | int (*setattr) (struct dentry *, struct iattr *); | 1575 | int (*setattr) (struct dentry *, struct iattr *); |
1565 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); | 1576 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); |
1566 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); | 1577 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); |
@@ -1572,7 +1583,7 @@ struct inode_operations { | |||
1572 | loff_t len); | 1583 | loff_t len); |
1573 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | 1584 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, |
1574 | u64 len); | 1585 | u64 len); |
1575 | }; | 1586 | } ____cacheline_aligned; |
1576 | 1587 | ||
1577 | struct seq_file; | 1588 | struct seq_file; |
1578 | 1589 | ||
@@ -1612,7 +1623,6 @@ struct super_operations { | |||
1612 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); | 1623 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); |
1613 | #endif | 1624 | #endif |
1614 | int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); | 1625 | int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); |
1615 | int (*trim_fs) (struct super_block *, struct fstrim_range *); | ||
1616 | }; | 1626 | }; |
1617 | 1627 | ||
1618 | /* | 1628 | /* |
@@ -2158,8 +2168,8 @@ extern sector_t bmap(struct inode *, sector_t); | |||
2158 | #endif | 2168 | #endif |
2159 | extern int notify_change(struct dentry *, struct iattr *); | 2169 | extern int notify_change(struct dentry *, struct iattr *); |
2160 | extern int inode_permission(struct inode *, int); | 2170 | extern int inode_permission(struct inode *, int); |
2161 | extern int generic_permission(struct inode *, int, | 2171 | extern int generic_permission(struct inode *, int, unsigned int, |
2162 | int (*check_acl)(struct inode *, int)); | 2172 | int (*check_acl)(struct inode *, int, unsigned int)); |
2163 | 2173 | ||
2164 | static inline bool execute_ok(struct inode *inode) | 2174 | static inline bool execute_ok(struct inode *inode) |
2165 | { | 2175 | { |
@@ -2230,6 +2240,7 @@ extern void iget_failed(struct inode *); | |||
2230 | extern void end_writeback(struct inode *); | 2240 | extern void end_writeback(struct inode *); |
2231 | extern void __destroy_inode(struct inode *); | 2241 | extern void __destroy_inode(struct inode *); |
2232 | extern struct inode *new_inode(struct super_block *); | 2242 | extern struct inode *new_inode(struct super_block *); |
2243 | extern void free_inode_nonrcu(struct inode *inode); | ||
2233 | extern int should_remove_suid(struct dentry *); | 2244 | extern int should_remove_suid(struct dentry *); |
2234 | extern int file_remove_suid(struct file *); | 2245 | extern int file_remove_suid(struct file *); |
2235 | 2246 | ||
@@ -2446,6 +2457,10 @@ static inline ino_t parent_ino(struct dentry *dentry) | |||
2446 | { | 2457 | { |
2447 | ino_t res; | 2458 | ino_t res; |
2448 | 2459 | ||
2460 | /* | ||
2461 | * Don't strictly need d_lock here? If the parent ino could change | ||
2462 | * then surely we'd have a deeper race in the caller? | ||
2463 | */ | ||
2449 | spin_lock(&dentry->d_lock); | 2464 | spin_lock(&dentry->d_lock); |
2450 | res = dentry->d_parent->d_inode->i_ino; | 2465 | res = dentry->d_parent->d_inode->i_ino; |
2451 | spin_unlock(&dentry->d_lock); | 2466 | spin_unlock(&dentry->d_lock); |
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index a42b5bf02f8b..003dc0fd7347 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h | |||
@@ -2,10 +2,13 @@ | |||
2 | #define _LINUX_FS_STRUCT_H | 2 | #define _LINUX_FS_STRUCT_H |
3 | 3 | ||
4 | #include <linux/path.h> | 4 | #include <linux/path.h> |
5 | #include <linux/spinlock.h> | ||
6 | #include <linux/seqlock.h> | ||
5 | 7 | ||
6 | struct fs_struct { | 8 | struct fs_struct { |
7 | int users; | 9 | int users; |
8 | spinlock_t lock; | 10 | spinlock_t lock; |
11 | seqcount_t seq; | ||
9 | int umask; | 12 | int umask; |
10 | int in_exec; | 13 | int in_exec; |
11 | struct path root, pwd; | 14 | struct path root, pwd; |
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 5c185fa27089..2a53f10712b3 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -17,7 +17,6 @@ | |||
17 | 17 | ||
18 | /* | 18 | /* |
19 | * fsnotify_d_instantiate - instantiate a dentry for inode | 19 | * fsnotify_d_instantiate - instantiate a dentry for inode |
20 | * Called with dcache_lock held. | ||
21 | */ | 20 | */ |
22 | static inline void fsnotify_d_instantiate(struct dentry *dentry, | 21 | static inline void fsnotify_d_instantiate(struct dentry *dentry, |
23 | struct inode *inode) | 22 | struct inode *inode) |
@@ -62,7 +61,6 @@ static inline int fsnotify_perm(struct file *file, int mask) | |||
62 | 61 | ||
63 | /* | 62 | /* |
64 | * fsnotify_d_move - dentry has been moved | 63 | * fsnotify_d_move - dentry has been moved |
65 | * Called with dcache_lock and dentry->d_lock held. | ||
66 | */ | 64 | */ |
67 | static inline void fsnotify_d_move(struct dentry *dentry) | 65 | static inline void fsnotify_d_move(struct dentry *dentry) |
68 | { | 66 | { |
@@ -235,9 +233,6 @@ static inline void fsnotify_open(struct file *file) | |||
235 | if (S_ISDIR(inode->i_mode)) | 233 | if (S_ISDIR(inode->i_mode)) |
236 | mask |= FS_ISDIR; | 234 | mask |= FS_ISDIR; |
237 | 235 | ||
238 | /* FMODE_NONOTIFY must never be set from user */ | ||
239 | file->f_mode &= ~FMODE_NONOTIFY; | ||
240 | |||
241 | fsnotify_parent(path, NULL, mask); | 236 | fsnotify_parent(path, NULL, mask); |
242 | fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); | 237 | fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); |
243 | } | 238 | } |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 0a68f924f06f..69ad89b50489 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -166,7 +166,7 @@ struct fsnotify_group { | |||
166 | struct mutex access_mutex; | 166 | struct mutex access_mutex; |
167 | struct list_head access_list; | 167 | struct list_head access_list; |
168 | wait_queue_head_t access_waitq; | 168 | wait_queue_head_t access_waitq; |
169 | bool bypass_perm; /* protected by access_mutex */ | 169 | atomic_t bypass_perm; |
170 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ | 170 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ |
171 | int f_flags; | 171 | int f_flags; |
172 | unsigned int max_marks; | 172 | unsigned int max_marks; |
@@ -329,9 +329,15 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) | |||
329 | { | 329 | { |
330 | struct dentry *parent; | 330 | struct dentry *parent; |
331 | 331 | ||
332 | assert_spin_locked(&dcache_lock); | ||
333 | assert_spin_locked(&dentry->d_lock); | 332 | assert_spin_locked(&dentry->d_lock); |
334 | 333 | ||
334 | /* | ||
335 | * Serialisation of setting PARENT_WATCHED on the dentries is provided | ||
336 | * by d_lock. If inotify_inode_watched changes after we have taken | ||
337 | * d_lock, the following __fsnotify_update_child_dentry_flags call will | ||
338 | * find our entry, so it will spin until we complete here, and update | ||
339 | * us with the new state. | ||
340 | */ | ||
335 | parent = dentry->d_parent; | 341 | parent = dentry->d_parent; |
336 | if (parent->d_inode && fsnotify_inode_watches_children(parent->d_inode)) | 342 | if (parent->d_inode && fsnotify_inode_watches_children(parent->d_inode)) |
337 | dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED; | 343 | dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED; |
@@ -341,15 +347,12 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) | |||
341 | 347 | ||
342 | /* | 348 | /* |
343 | * fsnotify_d_instantiate - instantiate a dentry for inode | 349 | * fsnotify_d_instantiate - instantiate a dentry for inode |
344 | * Called with dcache_lock held. | ||
345 | */ | 350 | */ |
346 | static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode) | 351 | static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode) |
347 | { | 352 | { |
348 | if (!inode) | 353 | if (!inode) |
349 | return; | 354 | return; |
350 | 355 | ||
351 | assert_spin_locked(&dcache_lock); | ||
352 | |||
353 | spin_lock(&dentry->d_lock); | 356 | spin_lock(&dentry->d_lock); |
354 | __fsnotify_update_dcache_flags(dentry); | 357 | __fsnotify_update_dcache_flags(dentry); |
355 | spin_unlock(&dentry->d_lock); | 358 | spin_unlock(&dentry->d_lock); |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 8beabb958f61..47e3997f7b5c 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -154,12 +154,14 @@ enum { | |||
154 | TRACE_EVENT_FL_ENABLED_BIT, | 154 | TRACE_EVENT_FL_ENABLED_BIT, |
155 | TRACE_EVENT_FL_FILTERED_BIT, | 155 | TRACE_EVENT_FL_FILTERED_BIT, |
156 | TRACE_EVENT_FL_RECORDED_CMD_BIT, | 156 | TRACE_EVENT_FL_RECORDED_CMD_BIT, |
157 | TRACE_EVENT_FL_CAP_ANY_BIT, | ||
157 | }; | 158 | }; |
158 | 159 | ||
159 | enum { | 160 | enum { |
160 | TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), | 161 | TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), |
161 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), | 162 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), |
162 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), | 163 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), |
164 | TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), | ||
163 | }; | 165 | }; |
164 | 166 | ||
165 | struct ftrace_event_call { | 167 | struct ftrace_event_call { |
@@ -196,6 +198,14 @@ struct ftrace_event_call { | |||
196 | #endif | 198 | #endif |
197 | }; | 199 | }; |
198 | 200 | ||
201 | #define __TRACE_EVENT_FLAGS(name, value) \ | ||
202 | static int __init trace_init_flags_##name(void) \ | ||
203 | { \ | ||
204 | event_##name.flags = value; \ | ||
205 | return 0; \ | ||
206 | } \ | ||
207 | early_initcall(trace_init_flags_##name); | ||
208 | |||
199 | #define PERF_MAX_TRACE_SIZE 2048 | 209 | #define PERF_MAX_TRACE_SIZE 2048 |
200 | 210 | ||
201 | #define MAX_FILTER_PRED 32 | 211 | #define MAX_FILTER_PRED 32 |
@@ -215,6 +225,10 @@ enum { | |||
215 | FILTER_PTR_STRING, | 225 | FILTER_PTR_STRING, |
216 | }; | 226 | }; |
217 | 227 | ||
228 | #define EVENT_STORAGE_SIZE 128 | ||
229 | extern struct mutex event_storage_mutex; | ||
230 | extern char event_storage[EVENT_STORAGE_SIZE]; | ||
231 | |||
218 | extern int trace_event_raw_init(struct ftrace_event_call *call); | 232 | extern int trace_event_raw_init(struct ftrace_event_call *call); |
219 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, | 233 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, |
220 | const char *name, int offset, int size, | 234 | const char *name, int offset, int size, |
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h index 574bea4013b6..0437e377b555 100644 --- a/include/linux/generic_acl.h +++ b/include/linux/generic_acl.h | |||
@@ -10,6 +10,6 @@ extern const struct xattr_handler generic_acl_default_handler; | |||
10 | 10 | ||
11 | int generic_acl_init(struct inode *, struct inode *); | 11 | int generic_acl_init(struct inode *, struct inode *); |
12 | int generic_acl_chmod(struct inode *); | 12 | int generic_acl_chmod(struct inode *); |
13 | int generic_check_acl(struct inode *inode, int mask); | 13 | int generic_check_acl(struct inode *inode, int mask, unsigned int flags); |
14 | 14 | ||
15 | #endif /* LINUX_GENERIC_ACL_H */ | 15 | #endif /* LINUX_GENERIC_ACL_H */ |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index e8713d55360a..f54adfcbec9c 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -360,7 +360,7 @@ void drain_local_pages(void *dummy); | |||
360 | 360 | ||
361 | extern gfp_t gfp_allowed_mask; | 361 | extern gfp_t gfp_allowed_mask; |
362 | 362 | ||
363 | extern void set_gfp_allowed_mask(gfp_t mask); | 363 | extern void pm_restrict_gfp_mask(void); |
364 | extern gfp_t clear_gfp_allowed_mask(gfp_t mask); | 364 | extern void pm_restore_gfp_mask(void); |
365 | 365 | ||
366 | #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 41cb31f14ee3..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> |
@@ -97,7 +94,8 @@ | |||
97 | #define in_nmi() (preempt_count() & NMI_MASK) | 94 | #define in_nmi() (preempt_count() & NMI_MASK) |
98 | 95 | ||
99 | #if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL) | 96 | #if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL) |
100 | # define PREEMPT_INATOMIC_BASE kernel_locked() | 97 | # include <linux/sched.h> |
98 | # define PREEMPT_INATOMIC_BASE (current->lock_depth >= 0) | ||
101 | #else | 99 | #else |
102 | # define PREEMPT_INATOMIC_BASE 0 | 100 | # define PREEMPT_INATOMIC_BASE 0 |
103 | #endif | 101 | #endif |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index e9138198e823..3a93f73a8acc 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 | ||
@@ -80,7 +81,8 @@ DECLARE_PER_CPU(int, __kmap_atomic_idx); | |||
80 | 81 | ||
81 | static inline int kmap_atomic_idx_push(void) | 82 | static inline int kmap_atomic_idx_push(void) |
82 | { | 83 | { |
83 | int idx = __get_cpu_var(__kmap_atomic_idx)++; | 84 | int idx = __this_cpu_inc_return(__kmap_atomic_idx) - 1; |
85 | |||
84 | #ifdef CONFIG_DEBUG_HIGHMEM | 86 | #ifdef CONFIG_DEBUG_HIGHMEM |
85 | WARN_ON_ONCE(in_irq() && !irqs_disabled()); | 87 | WARN_ON_ONCE(in_irq() && !irqs_disabled()); |
86 | BUG_ON(idx > KM_TYPE_NR); | 88 | BUG_ON(idx > KM_TYPE_NR); |
@@ -90,16 +92,18 @@ static inline int kmap_atomic_idx_push(void) | |||
90 | 92 | ||
91 | static inline int kmap_atomic_idx(void) | 93 | static inline int kmap_atomic_idx(void) |
92 | { | 94 | { |
93 | return __get_cpu_var(__kmap_atomic_idx) - 1; | 95 | return __this_cpu_read(__kmap_atomic_idx) - 1; |
94 | } | 96 | } |
95 | 97 | ||
96 | static inline int kmap_atomic_idx_pop(void) | 98 | static inline void kmap_atomic_idx_pop(void) |
97 | { | 99 | { |
98 | int idx = --__get_cpu_var(__kmap_atomic_idx); | ||
99 | #ifdef CONFIG_DEBUG_HIGHMEM | 100 | #ifdef CONFIG_DEBUG_HIGHMEM |
101 | int idx = __this_cpu_dec_return(__kmap_atomic_idx); | ||
102 | |||
100 | BUG_ON(idx < 0); | 103 | BUG_ON(idx < 0); |
104 | #else | ||
105 | __this_cpu_dec(__kmap_atomic_idx); | ||
101 | #endif | 106 | #endif |
102 | return idx; | ||
103 | } | 107 | } |
104 | 108 | ||
105 | #endif | 109 | #endif |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index fd0c1b857d3d..330586ffffbb 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/wait.h> | 22 | #include <linux/wait.h> |
23 | #include <linux/percpu.h> | 23 | #include <linux/percpu.h> |
24 | #include <linux/timer.h> | 24 | #include <linux/timer.h> |
25 | 25 | #include <linux/timerqueue.h> | |
26 | 26 | ||
27 | struct hrtimer_clock_base; | 27 | struct hrtimer_clock_base; |
28 | struct hrtimer_cpu_base; | 28 | struct hrtimer_cpu_base; |
@@ -79,8 +79,8 @@ enum hrtimer_restart { | |||
79 | 79 | ||
80 | /** | 80 | /** |
81 | * struct hrtimer - the basic hrtimer structure | 81 | * struct hrtimer - the basic hrtimer structure |
82 | * @node: red black tree node for time ordered insertion | 82 | * @node: timerqueue node, which also manages node.expires, |
83 | * @_expires: the absolute expiry time in the hrtimers internal | 83 | * the absolute expiry time in the hrtimers internal |
84 | * representation. The time is related to the clock on | 84 | * representation. The time is related to the clock on |
85 | * which the timer is based. Is setup by adding | 85 | * which the timer is based. Is setup by adding |
86 | * slack to the _softexpires value. For non range timers | 86 | * slack to the _softexpires value. For non range timers |
@@ -101,8 +101,7 @@ enum hrtimer_restart { | |||
101 | * The hrtimer structure must be initialized by hrtimer_init() | 101 | * The hrtimer structure must be initialized by hrtimer_init() |
102 | */ | 102 | */ |
103 | struct hrtimer { | 103 | struct hrtimer { |
104 | struct rb_node node; | 104 | struct timerqueue_node node; |
105 | ktime_t _expires; | ||
106 | ktime_t _softexpires; | 105 | ktime_t _softexpires; |
107 | enum hrtimer_restart (*function)(struct hrtimer *); | 106 | enum hrtimer_restart (*function)(struct hrtimer *); |
108 | struct hrtimer_clock_base *base; | 107 | struct hrtimer_clock_base *base; |
@@ -141,8 +140,7 @@ struct hrtimer_sleeper { | |||
141 | struct hrtimer_clock_base { | 140 | struct hrtimer_clock_base { |
142 | struct hrtimer_cpu_base *cpu_base; | 141 | struct hrtimer_cpu_base *cpu_base; |
143 | clockid_t index; | 142 | clockid_t index; |
144 | struct rb_root active; | 143 | struct timerqueue_head active; |
145 | struct rb_node *first; | ||
146 | ktime_t resolution; | 144 | ktime_t resolution; |
147 | ktime_t (*get_time)(void); | 145 | ktime_t (*get_time)(void); |
148 | ktime_t softirq_time; | 146 | ktime_t softirq_time; |
@@ -158,7 +156,6 @@ struct hrtimer_clock_base { | |||
158 | * @lock: lock protecting the base and associated clock bases | 156 | * @lock: lock protecting the base and associated clock bases |
159 | * and timers | 157 | * and timers |
160 | * @clock_base: array of clock bases for this cpu | 158 | * @clock_base: array of clock bases for this cpu |
161 | * @curr_timer: the timer which is executing a callback right now | ||
162 | * @expires_next: absolute time of the next event which was scheduled | 159 | * @expires_next: absolute time of the next event which was scheduled |
163 | * via clock_set_next_event() | 160 | * via clock_set_next_event() |
164 | * @hres_active: State of high resolution mode | 161 | * @hres_active: State of high resolution mode |
@@ -184,43 +181,43 @@ struct hrtimer_cpu_base { | |||
184 | 181 | ||
185 | static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) | 182 | static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) |
186 | { | 183 | { |
187 | timer->_expires = time; | 184 | timer->node.expires = time; |
188 | timer->_softexpires = time; | 185 | timer->_softexpires = time; |
189 | } | 186 | } |
190 | 187 | ||
191 | static inline void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta) | 188 | static inline void hrtimer_set_expires_range(struct hrtimer *timer, ktime_t time, ktime_t delta) |
192 | { | 189 | { |
193 | timer->_softexpires = time; | 190 | timer->_softexpires = time; |
194 | timer->_expires = ktime_add_safe(time, delta); | 191 | timer->node.expires = ktime_add_safe(time, delta); |
195 | } | 192 | } |
196 | 193 | ||
197 | static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, unsigned long delta) | 194 | static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t time, unsigned long delta) |
198 | { | 195 | { |
199 | timer->_softexpires = time; | 196 | timer->_softexpires = time; |
200 | timer->_expires = ktime_add_safe(time, ns_to_ktime(delta)); | 197 | timer->node.expires = ktime_add_safe(time, ns_to_ktime(delta)); |
201 | } | 198 | } |
202 | 199 | ||
203 | static inline void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64) | 200 | static inline void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64) |
204 | { | 201 | { |
205 | timer->_expires.tv64 = tv64; | 202 | timer->node.expires.tv64 = tv64; |
206 | timer->_softexpires.tv64 = tv64; | 203 | timer->_softexpires.tv64 = tv64; |
207 | } | 204 | } |
208 | 205 | ||
209 | static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time) | 206 | static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time) |
210 | { | 207 | { |
211 | timer->_expires = ktime_add_safe(timer->_expires, time); | 208 | timer->node.expires = ktime_add_safe(timer->node.expires, time); |
212 | timer->_softexpires = ktime_add_safe(timer->_softexpires, time); | 209 | timer->_softexpires = ktime_add_safe(timer->_softexpires, time); |
213 | } | 210 | } |
214 | 211 | ||
215 | static inline void hrtimer_add_expires_ns(struct hrtimer *timer, u64 ns) | 212 | static inline void hrtimer_add_expires_ns(struct hrtimer *timer, u64 ns) |
216 | { | 213 | { |
217 | timer->_expires = ktime_add_ns(timer->_expires, ns); | 214 | timer->node.expires = ktime_add_ns(timer->node.expires, ns); |
218 | timer->_softexpires = ktime_add_ns(timer->_softexpires, ns); | 215 | timer->_softexpires = ktime_add_ns(timer->_softexpires, ns); |
219 | } | 216 | } |
220 | 217 | ||
221 | static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer) | 218 | static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer) |
222 | { | 219 | { |
223 | return timer->_expires; | 220 | return timer->node.expires; |
224 | } | 221 | } |
225 | 222 | ||
226 | static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer) | 223 | static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer) |
@@ -230,7 +227,7 @@ static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer) | |||
230 | 227 | ||
231 | static inline s64 hrtimer_get_expires_tv64(const struct hrtimer *timer) | 228 | static inline s64 hrtimer_get_expires_tv64(const struct hrtimer *timer) |
232 | { | 229 | { |
233 | return timer->_expires.tv64; | 230 | return timer->node.expires.tv64; |
234 | } | 231 | } |
235 | static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer) | 232 | static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer) |
236 | { | 233 | { |
@@ -239,12 +236,12 @@ static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer) | |||
239 | 236 | ||
240 | static inline s64 hrtimer_get_expires_ns(const struct hrtimer *timer) | 237 | static inline s64 hrtimer_get_expires_ns(const struct hrtimer *timer) |
241 | { | 238 | { |
242 | return ktime_to_ns(timer->_expires); | 239 | return ktime_to_ns(timer->node.expires); |
243 | } | 240 | } |
244 | 241 | ||
245 | static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *timer) | 242 | static inline ktime_t hrtimer_expires_remaining(const struct hrtimer *timer) |
246 | { | 243 | { |
247 | return ktime_sub(timer->_expires, timer->base->get_time()); | 244 | return ktime_sub(timer->node.expires, timer->base->get_time()); |
248 | } | 245 | } |
249 | 246 | ||
250 | #ifdef CONFIG_HIGH_RES_TIMERS | 247 | #ifdef CONFIG_HIGH_RES_TIMERS |
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-omap.h b/include/linux/i2c-omap.h index 78ebf507ce56..7472449cbb74 100644 --- a/include/linux/i2c-omap.h +++ b/include/linux/i2c-omap.h | |||
@@ -1,9 +1,14 @@ | |||
1 | #ifndef __I2C_OMAP_H__ | 1 | #ifndef __I2C_OMAP_H__ |
2 | #define __I2C_OMAP_H__ | 2 | #define __I2C_OMAP_H__ |
3 | 3 | ||
4 | #include <linux/platform_device.h> | ||
5 | |||
4 | struct omap_i2c_bus_platform_data { | 6 | struct omap_i2c_bus_platform_data { |
5 | u32 clkrate; | 7 | u32 clkrate; |
6 | void (*set_mpu_wkup_lat)(struct device *dev, long set); | 8 | void (*set_mpu_wkup_lat)(struct device *dev, long set); |
9 | int (*device_enable) (struct platform_device *pdev); | ||
10 | int (*device_shutdown) (struct platform_device *pdev); | ||
11 | int (*device_idle) (struct platform_device *pdev); | ||
7 | }; | 12 | }; |
8 | 13 | ||
9 | #endif | 14 | #endif |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 889b35abaeda..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; |
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h index 3c5d6b6e765c..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 | */ |
@@ -77,13 +77,26 @@ | |||
77 | /* Configuration Register1 */ | 77 | /* Configuration Register1 */ |
78 | #define ADP5588_AUTO_INC (1 << 7) | 78 | #define ADP5588_AUTO_INC (1 << 7) |
79 | #define ADP5588_GPIEM_CFG (1 << 6) | 79 | #define ADP5588_GPIEM_CFG (1 << 6) |
80 | #define ADP5588_OVR_FLOW_M (1 << 5) | ||
80 | #define ADP5588_INT_CFG (1 << 4) | 81 | #define ADP5588_INT_CFG (1 << 4) |
82 | #define ADP5588_OVR_FLOW_IEN (1 << 3) | ||
83 | #define ADP5588_K_LCK_IM (1 << 2) | ||
81 | #define ADP5588_GPI_IEN (1 << 1) | 84 | #define ADP5588_GPI_IEN (1 << 1) |
85 | #define ADP5588_KE_IEN (1 << 0) | ||
82 | 86 | ||
83 | /* Interrupt Status Register */ | 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) | ||
84 | #define ADP5588_GPI_INT (1 << 1) | 92 | #define ADP5588_GPI_INT (1 << 1) |
85 | #define ADP5588_KE_INT (1 << 0) | 93 | #define ADP5588_KE_INT (1 << 0) |
86 | 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 | |||
87 | #define ADP5588_MAXGPIO 18 | 100 | #define ADP5588_MAXGPIO 18 |
88 | #define ADP5588_BANK(offs) ((offs) >> 3) | 101 | #define ADP5588_BANK(offs) ((offs) >> 3) |
89 | #define ADP5588_BIT(offs) (1u << ((offs) & 0x7)) | 102 | #define ADP5588_BIT(offs) (1u << ((offs) & 0x7)) |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index c760991b354a..61b9609e55f2 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -593,6 +593,13 @@ enum twl4030_usb_mode { | |||
593 | 593 | ||
594 | struct twl4030_usb_data { | 594 | struct twl4030_usb_data { |
595 | enum twl4030_usb_mode usb_mode; | 595 | enum twl4030_usb_mode usb_mode; |
596 | |||
597 | int (*phy_init)(struct device *dev); | ||
598 | int (*phy_exit)(struct device *dev); | ||
599 | /* Power on/off the PHY */ | ||
600 | int (*phy_power)(struct device *dev, int iD, int on); | ||
601 | /* enable/disable phy clocks */ | ||
602 | int (*phy_set_clock)(struct device *dev, int on); | ||
596 | }; | 603 | }; |
597 | 604 | ||
598 | struct twl4030_ins { | 605 | struct twl4030_ins { |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index ed5a03cbe184..6042228954a7 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -122,6 +122,7 @@ | |||
122 | 122 | ||
123 | /* U-APSD queue for WMM IEs sent by AP */ | 123 | /* U-APSD queue for WMM IEs sent by AP */ |
124 | #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) | 124 | #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) |
125 | #define IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK 0x0f | ||
125 | 126 | ||
126 | /* U-APSD queues for WMM IEs sent by STA */ | 127 | /* U-APSD queues for WMM IEs sent by STA */ |
127 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_VO (1<<0) | 128 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_VO (1<<0) |
@@ -535,7 +536,6 @@ struct ieee80211s_hdr { | |||
535 | __le32 seqnum; | 536 | __le32 seqnum; |
536 | u8 eaddr1[6]; | 537 | u8 eaddr1[6]; |
537 | u8 eaddr2[6]; | 538 | u8 eaddr2[6]; |
538 | u8 eaddr3[6]; | ||
539 | } __attribute__ ((packed)); | 539 | } __attribute__ ((packed)); |
540 | 540 | ||
541 | /* Mesh flags */ | 541 | /* Mesh flags */ |
@@ -1223,6 +1223,9 @@ enum ieee80211_eid { | |||
1223 | WLAN_EID_BSS_AC_ACCESS_DELAY = 68, | 1223 | WLAN_EID_BSS_AC_ACCESS_DELAY = 68, |
1224 | WLAN_EID_RRM_ENABLED_CAPABILITIES = 70, | 1224 | WLAN_EID_RRM_ENABLED_CAPABILITIES = 70, |
1225 | WLAN_EID_MULTIPLE_BSSID = 71, | 1225 | WLAN_EID_MULTIPLE_BSSID = 71, |
1226 | WLAN_EID_BSS_COEX_2040 = 72, | ||
1227 | WLAN_EID_OVERLAP_BSS_SCAN_PARAM = 74, | ||
1228 | WLAN_EID_EXT_CAPABILITY = 127, | ||
1226 | 1229 | ||
1227 | WLAN_EID_MOBILITY_DOMAIN = 54, | 1230 | WLAN_EID_MOBILITY_DOMAIN = 54, |
1228 | WLAN_EID_FAST_BSS_TRANSITION = 55, | 1231 | WLAN_EID_FAST_BSS_TRANSITION = 55, |
@@ -1287,6 +1290,31 @@ enum ieee80211_key_len { | |||
1287 | WLAN_KEY_LEN_AES_CMAC = 16, | 1290 | WLAN_KEY_LEN_AES_CMAC = 16, |
1288 | }; | 1291 | }; |
1289 | 1292 | ||
1293 | /** | ||
1294 | * enum - mesh path selection protocol identifier | ||
1295 | * | ||
1296 | * @IEEE80211_PATH_PROTOCOL_HWMP: the default path selection protocol | ||
1297 | * @IEEE80211_PATH_PROTOCOL_VENDOR: a vendor specific protocol that will | ||
1298 | * be specified in a vendor specific information element | ||
1299 | */ | ||
1300 | enum { | ||
1301 | IEEE80211_PATH_PROTOCOL_HWMP = 0, | ||
1302 | IEEE80211_PATH_PROTOCOL_VENDOR = 255, | ||
1303 | }; | ||
1304 | |||
1305 | /** | ||
1306 | * enum - mesh path selection metric identifier | ||
1307 | * | ||
1308 | * @IEEE80211_PATH_METRIC_AIRTIME: the default path selection metric | ||
1309 | * @IEEE80211_PATH_METRIC_VENDOR: a vendor specific metric that will be | ||
1310 | * specified in a vendor specific information element | ||
1311 | */ | ||
1312 | enum { | ||
1313 | IEEE80211_PATH_METRIC_AIRTIME = 0, | ||
1314 | IEEE80211_PATH_METRIC_VENDOR = 255, | ||
1315 | }; | ||
1316 | |||
1317 | |||
1290 | /* | 1318 | /* |
1291 | * IEEE 802.11-2007 7.3.2.9 Country information element | 1319 | * IEEE 802.11-2007 7.3.2.9 Country information element |
1292 | * | 1320 | * |
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index 0d241a5c4909..f7e73c338c40 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h | |||
@@ -102,7 +102,9 @@ struct __fdb_entry { | |||
102 | #include <linux/netdevice.h> | 102 | #include <linux/netdevice.h> |
103 | 103 | ||
104 | extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); | 104 | extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); |
105 | extern int (*br_should_route_hook)(struct sk_buff *skb); | 105 | |
106 | typedef int (*br_should_route_hook_t)(struct sk_buff *skb); | ||
107 | extern br_should_route_hook_t __rcu *br_should_route_hook; | ||
106 | 108 | ||
107 | #endif | 109 | #endif |
108 | 110 | ||
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index f9c3df03db0f..be69043d2896 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -72,6 +72,7 @@ | |||
72 | #define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */ | 72 | #define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */ |
73 | #define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */ | 73 | #define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */ |
74 | #define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */ | 74 | #define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */ |
75 | #define ETH_P_LINK_CTL 0x886c /* HPNA, wlan link local tunnel */ | ||
75 | #define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport | 76 | #define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport |
76 | * over Ethernet | 77 | * over Ethernet |
77 | */ | 78 | */ |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index 2fc66dd783ee..6485d2a89bec 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -80,6 +80,24 @@ struct rtnl_link_ifmap { | |||
80 | __u8 port; | 80 | __u8 port; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | /* | ||
84 | * IFLA_AF_SPEC | ||
85 | * Contains nested attributes for address family specific attributes. | ||
86 | * Each address family may create a attribute with the address family | ||
87 | * number as type and create its own attribute structure in it. | ||
88 | * | ||
89 | * Example: | ||
90 | * [IFLA_AF_SPEC] = { | ||
91 | * [AF_INET] = { | ||
92 | * [IFLA_INET_CONF] = ..., | ||
93 | * }, | ||
94 | * [AF_INET6] = { | ||
95 | * [IFLA_INET6_FLAGS] = ..., | ||
96 | * [IFLA_INET6_CONF] = ..., | ||
97 | * } | ||
98 | * } | ||
99 | */ | ||
100 | |||
83 | enum { | 101 | enum { |
84 | IFLA_UNSPEC, | 102 | IFLA_UNSPEC, |
85 | IFLA_ADDRESS, | 103 | IFLA_ADDRESS, |
@@ -116,6 +134,7 @@ enum { | |||
116 | IFLA_STATS64, | 134 | IFLA_STATS64, |
117 | IFLA_VF_PORTS, | 135 | IFLA_VF_PORTS, |
118 | IFLA_PORT_SELF, | 136 | IFLA_PORT_SELF, |
137 | IFLA_AF_SPEC, | ||
119 | __IFLA_MAX | 138 | __IFLA_MAX |
120 | }; | 139 | }; |
121 | 140 | ||
@@ -128,6 +147,14 @@ enum { | |||
128 | #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) | 147 | #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) |
129 | #endif | 148 | #endif |
130 | 149 | ||
150 | enum { | ||
151 | IFLA_INET_UNSPEC, | ||
152 | IFLA_INET_CONF, | ||
153 | __IFLA_INET_MAX, | ||
154 | }; | ||
155 | |||
156 | #define IFLA_INET_MAX (__IFLA_INET_MAX - 1) | ||
157 | |||
131 | /* ifi_flags. | 158 | /* ifi_flags. |
132 | 159 | ||
133 | IFF_* flags. | 160 | IFF_* flags. |
@@ -232,6 +259,7 @@ enum macvlan_mode { | |||
232 | MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */ | 259 | MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */ |
233 | MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */ | 260 | MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */ |
234 | MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ | 261 | MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ |
262 | MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */ | ||
235 | }; | 263 | }; |
236 | 264 | ||
237 | /* SR-IOV virtual function management section */ | 265 | /* SR-IOV virtual function management section */ |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 8a2fd66a8b5f..e28b2e4959d4 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
@@ -25,19 +25,25 @@ struct macvlan_port; | |||
25 | struct macvtap_queue; | 25 | struct macvtap_queue; |
26 | 26 | ||
27 | /** | 27 | /** |
28 | * struct macvlan_rx_stats - MACVLAN percpu rx stats | 28 | * struct macvlan_pcpu_stats - MACVLAN percpu stats |
29 | * @rx_packets: number of received packets | 29 | * @rx_packets: number of received packets |
30 | * @rx_bytes: number of received bytes | 30 | * @rx_bytes: number of received bytes |
31 | * @rx_multicast: number of received multicast packets | 31 | * @rx_multicast: number of received multicast packets |
32 | * @tx_packets: number of transmitted packets | ||
33 | * @tx_bytes: number of transmitted bytes | ||
32 | * @syncp: synchronization point for 64bit counters | 34 | * @syncp: synchronization point for 64bit counters |
33 | * @rx_errors: number of errors | 35 | * @rx_errors: number of rx errors |
36 | * @tx_dropped: number of tx dropped packets | ||
34 | */ | 37 | */ |
35 | struct macvlan_rx_stats { | 38 | struct macvlan_pcpu_stats { |
36 | u64 rx_packets; | 39 | u64 rx_packets; |
37 | u64 rx_bytes; | 40 | u64 rx_bytes; |
38 | u64 rx_multicast; | 41 | u64 rx_multicast; |
42 | u64 tx_packets; | ||
43 | u64 tx_bytes; | ||
39 | struct u64_stats_sync syncp; | 44 | struct u64_stats_sync syncp; |
40 | unsigned long rx_errors; | 45 | u32 rx_errors; |
46 | u32 tx_dropped; | ||
41 | }; | 47 | }; |
42 | 48 | ||
43 | /* | 49 | /* |
@@ -52,7 +58,7 @@ struct macvlan_dev { | |||
52 | struct hlist_node hlist; | 58 | struct hlist_node hlist; |
53 | struct macvlan_port *port; | 59 | struct macvlan_port *port; |
54 | struct net_device *lowerdev; | 60 | struct net_device *lowerdev; |
55 | struct macvlan_rx_stats __percpu *rx_stats; | 61 | struct macvlan_pcpu_stats __percpu *pcpu_stats; |
56 | enum macvlan_mode mode; | 62 | enum macvlan_mode mode; |
57 | int (*receive)(struct sk_buff *skb); | 63 | int (*receive)(struct sk_buff *skb); |
58 | int (*forward)(struct net_device *dev, struct sk_buff *skb); | 64 | int (*forward)(struct net_device *dev, struct sk_buff *skb); |
@@ -64,18 +70,18 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | |||
64 | unsigned int len, bool success, | 70 | unsigned int len, bool success, |
65 | bool multicast) | 71 | bool multicast) |
66 | { | 72 | { |
67 | struct macvlan_rx_stats *rx_stats; | ||
68 | |||
69 | rx_stats = this_cpu_ptr(vlan->rx_stats); | ||
70 | if (likely(success)) { | 73 | if (likely(success)) { |
71 | u64_stats_update_begin(&rx_stats->syncp); | 74 | struct macvlan_pcpu_stats *pcpu_stats; |
72 | rx_stats->rx_packets++;; | 75 | |
73 | rx_stats->rx_bytes += len; | 76 | pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); |
77 | u64_stats_update_begin(&pcpu_stats->syncp); | ||
78 | pcpu_stats->rx_packets++; | ||
79 | pcpu_stats->rx_bytes += len; | ||
74 | if (multicast) | 80 | if (multicast) |
75 | rx_stats->rx_multicast++; | 81 | pcpu_stats->rx_multicast++; |
76 | u64_stats_update_end(&rx_stats->syncp); | 82 | u64_stats_update_end(&pcpu_stats->syncp); |
77 | } else { | 83 | } else { |
78 | rx_stats->rx_errors++; | 84 | this_cpu_inc(vlan->pcpu_stats->rx_errors); |
79 | } | 85 | } |
80 | } | 86 | } |
81 | 87 | ||
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/igmp.h b/include/linux/igmp.h index 93fc2449af10..74cfcff0148b 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
@@ -85,9 +85,9 @@ struct igmpv3_query { | |||
85 | #define IGMP_DVMRP 0x13 /* DVMRP routing */ | 85 | #define IGMP_DVMRP 0x13 /* DVMRP routing */ |
86 | #define IGMP_PIM 0x14 /* PIM routing */ | 86 | #define IGMP_PIM 0x14 /* PIM routing */ |
87 | #define IGMP_TRACE 0x15 | 87 | #define IGMP_TRACE 0x15 |
88 | #define IGMPV2_HOST_MEMBERSHIP_REPORT 0x16 /* V2 version of 0x11 */ | 88 | #define IGMPV2_HOST_MEMBERSHIP_REPORT 0x16 /* V2 version of 0x12 */ |
89 | #define IGMP_HOST_LEAVE_MESSAGE 0x17 | 89 | #define IGMP_HOST_LEAVE_MESSAGE 0x17 |
90 | #define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22 /* V3 version of 0x11 */ | 90 | #define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22 /* V3 version of 0x12 */ |
91 | 91 | ||
92 | #define IGMP_MTRACE_RESP 0x1e | 92 | #define IGMP_MTRACE_RESP 0x1e |
93 | #define IGMP_MTRACE 0x1f | 93 | #define IGMP_MTRACE 0x1f |
@@ -167,10 +167,10 @@ struct ip_sf_socklist { | |||
167 | */ | 167 | */ |
168 | 168 | ||
169 | struct ip_mc_socklist { | 169 | struct ip_mc_socklist { |
170 | struct ip_mc_socklist *next; | 170 | struct ip_mc_socklist __rcu *next_rcu; |
171 | struct ip_mreqn multi; | 171 | struct ip_mreqn multi; |
172 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ | 172 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ |
173 | struct ip_sf_socklist *sflist; | 173 | struct ip_sf_socklist __rcu *sflist; |
174 | struct rcu_head rcu; | 174 | struct rcu_head rcu; |
175 | }; | 175 | }; |
176 | 176 | ||
@@ -186,11 +186,14 @@ struct ip_sf_list { | |||
186 | struct ip_mc_list { | 186 | struct ip_mc_list { |
187 | struct in_device *interface; | 187 | struct in_device *interface; |
188 | __be32 multiaddr; | 188 | __be32 multiaddr; |
189 | unsigned int sfmode; | ||
189 | struct ip_sf_list *sources; | 190 | struct ip_sf_list *sources; |
190 | struct ip_sf_list *tomb; | 191 | struct ip_sf_list *tomb; |
191 | unsigned int sfmode; | ||
192 | unsigned long sfcount[2]; | 192 | unsigned long sfcount[2]; |
193 | struct ip_mc_list *next; | 193 | union { |
194 | struct ip_mc_list *next; | ||
195 | struct ip_mc_list __rcu *next_rcu; | ||
196 | }; | ||
194 | struct timer_list timer; | 197 | struct timer_list timer; |
195 | int users; | 198 | int users; |
196 | atomic_t refcnt; | 199 | atomic_t refcnt; |
@@ -201,6 +204,7 @@ struct ip_mc_list { | |||
201 | char loaded; | 204 | char loaded; |
202 | unsigned char gsquery; /* check source marks? */ | 205 | unsigned char gsquery; /* check source marks? */ |
203 | unsigned char crcount; | 206 | unsigned char crcount; |
207 | struct rcu_head rcu; | ||
204 | }; | 208 | }; |
205 | 209 | ||
206 | /* V3 exponential field decoding */ | 210 | /* V3 exponential field decoding */ |
@@ -234,7 +238,7 @@ extern void ip_mc_unmap(struct in_device *); | |||
234 | extern void ip_mc_remap(struct in_device *); | 238 | extern void ip_mc_remap(struct in_device *); |
235 | extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); | 239 | extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); |
236 | extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); | 240 | extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); |
237 | extern void ip_mc_rejoin_group(struct ip_mc_list *im); | 241 | extern void ip_mc_rejoin_groups(struct in_device *in_dev); |
238 | 242 | ||
239 | #endif | 243 | #endif |
240 | #endif | 244 | #endif |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index ccd5b07d678d..ae8fdc54e0c0 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -41,10 +41,12 @@ enum | |||
41 | __IPV4_DEVCONF_MAX | 41 | __IPV4_DEVCONF_MAX |
42 | }; | 42 | }; |
43 | 43 | ||
44 | #define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1) | ||
45 | |||
44 | struct ipv4_devconf { | 46 | struct ipv4_devconf { |
45 | void *sysctl; | 47 | void *sysctl; |
46 | int data[__IPV4_DEVCONF_MAX - 1]; | 48 | int data[IPV4_DEVCONF_MAX]; |
47 | DECLARE_BITMAP(state, __IPV4_DEVCONF_MAX - 1); | 49 | DECLARE_BITMAP(state, IPV4_DEVCONF_MAX); |
48 | }; | 50 | }; |
49 | 51 | ||
50 | struct in_device { | 52 | struct in_device { |
@@ -52,9 +54,8 @@ struct in_device { | |||
52 | atomic_t refcnt; | 54 | atomic_t refcnt; |
53 | int dead; | 55 | int dead; |
54 | struct in_ifaddr *ifa_list; /* IP ifaddr chain */ | 56 | struct in_ifaddr *ifa_list; /* IP ifaddr chain */ |
55 | rwlock_t mc_list_lock; | 57 | struct ip_mc_list __rcu *mc_list; /* IP multicast filter chain */ |
56 | struct ip_mc_list *mc_list; /* IP multicast filter chain */ | 58 | int mc_count; /* Number of installed mcasts */ |
57 | int mc_count; /* Number of installed mcasts */ | ||
58 | spinlock_t mc_tomb_lock; | 59 | spinlock_t mc_tomb_lock; |
59 | struct ip_mc_list *mc_tomb; | 60 | struct ip_mc_list *mc_tomb; |
60 | unsigned long mr_v1_seen; | 61 | unsigned long mr_v1_seen; |
@@ -91,7 +92,7 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index, | |||
91 | 92 | ||
92 | static inline void ipv4_devconf_setall(struct in_device *in_dev) | 93 | static inline void ipv4_devconf_setall(struct in_device *in_dev) |
93 | { | 94 | { |
94 | bitmap_fill(in_dev->cnf.state, __IPV4_DEVCONF_MAX - 1); | 95 | bitmap_fill(in_dev->cnf.state, IPV4_DEVCONF_MAX); |
95 | } | 96 | } |
96 | 97 | ||
97 | #define IN_DEV_CONF_GET(in_dev, attr) \ | 98 | #define IN_DEV_CONF_GET(in_dev, attr) \ |
@@ -221,7 +222,7 @@ static inline struct in_device *in_dev_get(const struct net_device *dev) | |||
221 | 222 | ||
222 | static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev) | 223 | static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev) |
223 | { | 224 | { |
224 | return rcu_dereference_check(dev->ip_ptr, lockdep_rtnl_is_held()); | 225 | return rtnl_dereference(dev->ip_ptr); |
225 | } | 226 | } |
226 | 227 | ||
227 | extern void in_dev_finish_destroy(struct in_device *idev); | 228 | extern void in_dev_finish_destroy(struct in_device *idev); |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 1f8c06ce0fa6..caa151fbebb7 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -12,6 +12,13 @@ | |||
12 | #include <linux/securebits.h> | 12 | #include <linux/securebits.h> |
13 | #include <net/net_namespace.h> | 13 | #include <net/net_namespace.h> |
14 | 14 | ||
15 | #ifdef CONFIG_SMP | ||
16 | # define INIT_PUSHABLE_TASKS(tsk) \ | ||
17 | .pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO), | ||
18 | #else | ||
19 | # define INIT_PUSHABLE_TASKS(tsk) | ||
20 | #endif | ||
21 | |||
15 | extern struct files_struct init_files; | 22 | extern struct files_struct init_files; |
16 | extern struct fs_struct init_fs; | 23 | extern struct fs_struct init_fs; |
17 | 24 | ||
@@ -83,6 +90,12 @@ extern struct group_info init_groups; | |||
83 | */ | 90 | */ |
84 | # define CAP_INIT_BSET CAP_FULL_SET | 91 | # define CAP_INIT_BSET CAP_FULL_SET |
85 | 92 | ||
93 | #ifdef CONFIG_RCU_BOOST | ||
94 | #define INIT_TASK_RCU_BOOST() \ | ||
95 | .rcu_boost_mutex = NULL, | ||
96 | #else | ||
97 | #define INIT_TASK_RCU_BOOST() | ||
98 | #endif | ||
86 | #ifdef CONFIG_TREE_PREEMPT_RCU | 99 | #ifdef CONFIG_TREE_PREEMPT_RCU |
87 | #define INIT_TASK_RCU_TREE_PREEMPT() \ | 100 | #define INIT_TASK_RCU_TREE_PREEMPT() \ |
88 | .rcu_blocked_node = NULL, | 101 | .rcu_blocked_node = NULL, |
@@ -94,7 +107,8 @@ extern struct group_info init_groups; | |||
94 | .rcu_read_lock_nesting = 0, \ | 107 | .rcu_read_lock_nesting = 0, \ |
95 | .rcu_read_unlock_special = 0, \ | 108 | .rcu_read_unlock_special = 0, \ |
96 | .rcu_node_entry = LIST_HEAD_INIT(tsk.rcu_node_entry), \ | 109 | .rcu_node_entry = LIST_HEAD_INIT(tsk.rcu_node_entry), \ |
97 | INIT_TASK_RCU_TREE_PREEMPT() | 110 | INIT_TASK_RCU_TREE_PREEMPT() \ |
111 | INIT_TASK_RCU_BOOST() | ||
98 | #else | 112 | #else |
99 | #define INIT_TASK_RCU_PREEMPT(tsk) | 113 | #define INIT_TASK_RCU_PREEMPT(tsk) |
100 | #endif | 114 | #endif |
@@ -137,7 +151,7 @@ extern struct cred init_cred; | |||
137 | .nr_cpus_allowed = NR_CPUS, \ | 151 | .nr_cpus_allowed = NR_CPUS, \ |
138 | }, \ | 152 | }, \ |
139 | .tasks = LIST_HEAD_INIT(tsk.tasks), \ | 153 | .tasks = LIST_HEAD_INIT(tsk.tasks), \ |
140 | .pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO), \ | 154 | INIT_PUSHABLE_TASKS(tsk) \ |
141 | .ptraced = LIST_HEAD_INIT(tsk.ptraced), \ | 155 | .ptraced = LIST_HEAD_INIT(tsk.ptraced), \ |
142 | .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \ | 156 | .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \ |
143 | .real_parent = &tsk, \ | 157 | .real_parent = &tsk, \ |
diff --git a/include/linux/input.h b/include/linux/input.h index 51af441f3a21..c4e9d91ec979 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,12 +104,15 @@ 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 */ |
93 | #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ | 114 | #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ |
115 | #define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len) /* get device properties */ | ||
94 | 116 | ||
95 | #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */ | 117 | #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */ |
96 | #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ | 118 | #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ |
@@ -108,6 +130,18 @@ struct input_keymap_entry { | |||
108 | #define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */ | 130 | #define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */ |
109 | 131 | ||
110 | /* | 132 | /* |
133 | * Device properties and quirks | ||
134 | */ | ||
135 | |||
136 | #define INPUT_PROP_POINTER 0x00 /* needs a pointer */ | ||
137 | #define INPUT_PROP_DIRECT 0x01 /* direct input devices */ | ||
138 | #define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */ | ||
139 | #define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */ | ||
140 | |||
141 | #define INPUT_PROP_MAX 0x1f | ||
142 | #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) | ||
143 | |||
144 | /* | ||
111 | * Event types | 145 | * Event types |
112 | */ | 146 | */ |
113 | 147 | ||
@@ -569,6 +603,8 @@ struct input_keymap_entry { | |||
569 | #define KEY_FRAMEFORWARD 0x1b5 | 603 | #define KEY_FRAMEFORWARD 0x1b5 |
570 | #define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ | 604 | #define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ |
571 | #define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ | 605 | #define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ |
606 | #define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */ | ||
607 | #define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */ | ||
572 | 608 | ||
573 | #define KEY_DEL_EOL 0x1c0 | 609 | #define KEY_DEL_EOL 0x1c0 |
574 | #define KEY_DEL_EOS 0x1c1 | 610 | #define KEY_DEL_EOS 0x1c1 |
@@ -624,6 +660,10 @@ struct input_keymap_entry { | |||
624 | #define KEY_CAMERA_FOCUS 0x210 | 660 | #define KEY_CAMERA_FOCUS 0x210 |
625 | #define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ | 661 | #define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ |
626 | 662 | ||
663 | #define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */ | ||
664 | #define KEY_TOUCHPAD_ON 0x213 | ||
665 | #define KEY_TOUCHPAD_OFF 0x214 | ||
666 | |||
627 | #define BTN_TRIGGER_HAPPY 0x2c0 | 667 | #define BTN_TRIGGER_HAPPY 0x2c0 |
628 | #define BTN_TRIGGER_HAPPY1 0x2c0 | 668 | #define BTN_TRIGGER_HAPPY1 0x2c0 |
629 | #define BTN_TRIGGER_HAPPY2 0x2c1 | 669 | #define BTN_TRIGGER_HAPPY2 0x2c1 |
@@ -733,11 +773,12 @@ struct input_keymap_entry { | |||
733 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ | 773 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ |
734 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ | 774 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ |
735 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ | 775 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ |
776 | #define ABS_MT_DISTANCE 0x3b /* Contact hover distance */ | ||
736 | 777 | ||
737 | #ifdef __KERNEL__ | 778 | #ifdef __KERNEL__ |
738 | /* Implementation details, userspace should not care about these */ | 779 | /* Implementation details, userspace should not care about these */ |
739 | #define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR | 780 | #define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR |
740 | #define ABS_MT_LAST ABS_MT_PRESSURE | 781 | #define ABS_MT_LAST ABS_MT_DISTANCE |
741 | #endif | 782 | #endif |
742 | 783 | ||
743 | #define ABS_MAX 0x3f | 784 | #define ABS_MAX 0x3f |
@@ -848,6 +889,7 @@ struct input_keymap_entry { | |||
848 | */ | 889 | */ |
849 | #define MT_TOOL_FINGER 0 | 890 | #define MT_TOOL_FINGER 0 |
850 | #define MT_TOOL_PEN 1 | 891 | #define MT_TOOL_PEN 1 |
892 | #define MT_TOOL_MAX 1 | ||
851 | 893 | ||
852 | /* | 894 | /* |
853 | * Values describing the status of a force-feedback effect | 895 | * Values describing the status of a force-feedback effect |
@@ -1083,19 +1125,12 @@ struct ff_effect { | |||
1083 | #include <linux/mod_devicetable.h> | 1125 | #include <linux/mod_devicetable.h> |
1084 | 1126 | ||
1085 | /** | 1127 | /** |
1086 | * struct input_mt_slot - represents the state of an input MT slot | ||
1087 | * @abs: holds current values of ABS_MT axes for this slot | ||
1088 | */ | ||
1089 | struct input_mt_slot { | ||
1090 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; | ||
1091 | }; | ||
1092 | |||
1093 | /** | ||
1094 | * struct input_dev - represents an input device | 1128 | * struct input_dev - represents an input device |
1095 | * @name: name of the device | 1129 | * @name: name of the device |
1096 | * @phys: physical path to the device in the system hierarchy | 1130 | * @phys: physical path to the device in the system hierarchy |
1097 | * @uniq: unique identification code for the device (if device has it) | 1131 | * @uniq: unique identification code for the device (if device has it) |
1098 | * @id: id of the device (struct input_id) | 1132 | * @id: id of the device (struct input_id) |
1133 | * @propbit: bitmap of device properties and quirks | ||
1099 | * @evbit: bitmap of types of events supported by the device (EV_KEY, | 1134 | * @evbit: bitmap of types of events supported by the device (EV_KEY, |
1100 | * EV_REL, etc.) | 1135 | * EV_REL, etc.) |
1101 | * @keybit: bitmap of keys/buttons this device has | 1136 | * @keybit: bitmap of keys/buttons this device has |
@@ -1130,7 +1165,8 @@ struct input_mt_slot { | |||
1130 | * of tracked contacts | 1165 | * of tracked contacts |
1131 | * @mtsize: number of MT slots the device uses | 1166 | * @mtsize: number of MT slots the device uses |
1132 | * @slot: MT slot currently being transmitted | 1167 | * @slot: MT slot currently being transmitted |
1133 | * @absinfo: array of &struct absinfo elements holding information | 1168 | * @trkid: stores MT tracking ID for the current contact |
1169 | * @absinfo: array of &struct input_absinfo elements holding information | ||
1134 | * about absolute axes (current value, min, max, flat, fuzz, | 1170 | * about absolute axes (current value, min, max, flat, fuzz, |
1135 | * resolution) | 1171 | * resolution) |
1136 | * @key: reflects current state of device's keys/buttons | 1172 | * @key: reflects current state of device's keys/buttons |
@@ -1178,6 +1214,8 @@ struct input_dev { | |||
1178 | const char *uniq; | 1214 | const char *uniq; |
1179 | struct input_id id; | 1215 | struct input_id id; |
1180 | 1216 | ||
1217 | unsigned long propbit[BITS_TO_LONGS(INPUT_PROP_CNT)]; | ||
1218 | |||
1181 | unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; | 1219 | unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; |
1182 | unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; | 1220 | unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; |
1183 | unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; | 1221 | unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; |
@@ -1214,6 +1252,7 @@ struct input_dev { | |||
1214 | struct input_mt_slot *mt; | 1252 | struct input_mt_slot *mt; |
1215 | int mtsize; | 1253 | int mtsize; |
1216 | int slot; | 1254 | int slot; |
1255 | int trkid; | ||
1217 | 1256 | ||
1218 | struct input_absinfo *absinfo; | 1257 | struct input_absinfo *absinfo; |
1219 | 1258 | ||
@@ -1406,6 +1445,8 @@ static inline void input_set_drvdata(struct input_dev *dev, void *data) | |||
1406 | int __must_check input_register_device(struct input_dev *); | 1445 | int __must_check input_register_device(struct input_dev *); |
1407 | void input_unregister_device(struct input_dev *); | 1446 | void input_unregister_device(struct input_dev *); |
1408 | 1447 | ||
1448 | void input_reset_device(struct input_dev *); | ||
1449 | |||
1409 | int __must_check input_register_handler(struct input_handler *); | 1450 | int __must_check input_register_handler(struct input_handler *); |
1410 | void input_unregister_handler(struct input_handler *); | 1451 | void input_unregister_handler(struct input_handler *); |
1411 | 1452 | ||
@@ -1421,7 +1462,7 @@ void input_release_device(struct input_handle *); | |||
1421 | int input_open_device(struct input_handle *); | 1462 | int input_open_device(struct input_handle *); |
1422 | void input_close_device(struct input_handle *); | 1463 | void input_close_device(struct input_handle *); |
1423 | 1464 | ||
1424 | int input_flush_device(struct input_handle* handle, struct file* file); | 1465 | int input_flush_device(struct input_handle *handle, struct file *file); |
1425 | 1466 | ||
1426 | void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); | 1467 | 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); | 1468 | void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value); |
@@ -1461,11 +1502,6 @@ static inline void input_mt_sync(struct input_dev *dev) | |||
1461 | input_event(dev, EV_SYN, SYN_MT_REPORT, 0); | 1502 | input_event(dev, EV_SYN, SYN_MT_REPORT, 0); |
1462 | } | 1503 | } |
1463 | 1504 | ||
1464 | static inline void input_mt_slot(struct input_dev *dev, int slot) | ||
1465 | { | ||
1466 | input_event(dev, EV_ABS, ABS_MT_SLOT, slot); | ||
1467 | } | ||
1468 | |||
1469 | void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); | 1505 | void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code); |
1470 | 1506 | ||
1471 | /** | 1507 | /** |
@@ -1578,8 +1614,5 @@ int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file); | |||
1578 | int input_ff_create_memless(struct input_dev *dev, void *data, | 1614 | int input_ff_create_memless(struct input_dev *dev, void *data, |
1579 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); | 1615 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); |
1580 | 1616 | ||
1581 | int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots); | ||
1582 | void input_mt_destroy_slots(struct input_dev *dev); | ||
1583 | |||
1584 | #endif | 1617 | #endif |
1585 | #endif | 1618 | #endif |
diff --git a/include/linux/input/cma3000.h b/include/linux/input/cma3000.h new file mode 100644 index 000000000000..cbbaac27d311 --- /dev/null +++ b/include/linux/input/cma3000.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * VTI CMA3000_Dxx Accelerometer driver | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments | ||
5 | * Author: Hemanth V <hemanthv@ti.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 version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along with | ||
17 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | #ifndef _LINUX_CMA3000_H | ||
21 | #define _LINUX_CMA3000_H | ||
22 | |||
23 | #define CMAMODE_DEFAULT 0 | ||
24 | #define CMAMODE_MEAS100 1 | ||
25 | #define CMAMODE_MEAS400 2 | ||
26 | #define CMAMODE_MEAS40 3 | ||
27 | #define CMAMODE_MOTDET 4 | ||
28 | #define CMAMODE_FF100 5 | ||
29 | #define CMAMODE_FF400 6 | ||
30 | #define CMAMODE_POFF 7 | ||
31 | |||
32 | #define CMARANGE_2G 2000 | ||
33 | #define CMARANGE_8G 8000 | ||
34 | |||
35 | /** | ||
36 | * struct cma3000_i2c_platform_data - CMA3000 Platform data | ||
37 | * @fuzz_x: Noise on X Axis | ||
38 | * @fuzz_y: Noise on Y Axis | ||
39 | * @fuzz_z: Noise on Z Axis | ||
40 | * @g_range: G range in milli g i.e 2000 or 8000 | ||
41 | * @mode: Operating mode | ||
42 | * @mdthr: Motion detect threshold value | ||
43 | * @mdfftmr: Motion detect and free fall time value | ||
44 | * @ffthr: Free fall threshold value | ||
45 | */ | ||
46 | |||
47 | struct cma3000_platform_data { | ||
48 | int fuzz_x; | ||
49 | int fuzz_y; | ||
50 | int fuzz_z; | ||
51 | int g_range; | ||
52 | uint8_t mode; | ||
53 | uint8_t mdthr; | ||
54 | uint8_t mdfftmr; | ||
55 | uint8_t ffthr; | ||
56 | unsigned long irqflags; | ||
57 | }; | ||
58 | |||
59 | #endif | ||
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h index 80352ad6581a..697474691749 100644 --- a/include/linux/input/matrix_keypad.h +++ b/include/linux/input/matrix_keypad.h | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | #define KEY(row, col, val) ((((row) & (MATRIX_MAX_ROWS - 1)) << 24) |\ | 10 | #define KEY(row, col, val) ((((row) & (MATRIX_MAX_ROWS - 1)) << 24) |\ |
11 | (((col) & (MATRIX_MAX_COLS - 1)) << 16) |\ | 11 | (((col) & (MATRIX_MAX_COLS - 1)) << 16) |\ |
12 | (val & 0xffff)) | 12 | ((val) & 0xffff)) |
13 | 13 | ||
14 | #define KEY_ROW(k) (((k) >> 24) & 0xff) | 14 | #define KEY_ROW(k) (((k) >> 24) & 0xff) |
15 | #define KEY_COL(k) (((k) >> 16) & 0xff) | 15 | #define KEY_COL(k) (((k) >> 16) & 0xff) |
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h new file mode 100644 index 000000000000..b3ac06a4435d --- /dev/null +++ b/include/linux/input/mt.h | |||
@@ -0,0 +1,57 @@ | |||
1 | #ifndef _INPUT_MT_H | ||
2 | #define _INPUT_MT_H | ||
3 | |||
4 | /* | ||
5 | * Input Multitouch Library | ||
6 | * | ||
7 | * Copyright (c) 2010 Henrik Rydberg | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License version 2 as published by | ||
11 | * the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/input.h> | ||
15 | |||
16 | #define TRKID_MAX 0xffff | ||
17 | |||
18 | /** | ||
19 | * struct input_mt_slot - represents the state of an input MT slot | ||
20 | * @abs: holds current values of ABS_MT axes for this slot | ||
21 | */ | ||
22 | struct input_mt_slot { | ||
23 | int abs[ABS_MT_LAST - ABS_MT_FIRST + 1]; | ||
24 | }; | ||
25 | |||
26 | static inline void input_mt_set_value(struct input_mt_slot *slot, | ||
27 | unsigned code, int value) | ||
28 | { | ||
29 | slot->abs[code - ABS_MT_FIRST] = value; | ||
30 | } | ||
31 | |||
32 | static inline int input_mt_get_value(const struct input_mt_slot *slot, | ||
33 | unsigned code) | ||
34 | { | ||
35 | return slot->abs[code - ABS_MT_FIRST]; | ||
36 | } | ||
37 | |||
38 | int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots); | ||
39 | void input_mt_destroy_slots(struct input_dev *dev); | ||
40 | |||
41 | static inline int input_mt_new_trkid(struct input_dev *dev) | ||
42 | { | ||
43 | return dev->trkid++ & TRKID_MAX; | ||
44 | } | ||
45 | |||
46 | static inline void input_mt_slot(struct input_dev *dev, int slot) | ||
47 | { | ||
48 | input_event(dev, EV_ABS, ABS_MT_SLOT, slot); | ||
49 | } | ||
50 | |||
51 | void input_mt_report_slot_state(struct input_dev *dev, | ||
52 | unsigned int tool_type, bool active); | ||
53 | |||
54 | void input_mt_report_finger_count(struct input_dev *dev, int count); | ||
55 | void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count); | ||
56 | |||
57 | #endif | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 79d0c4f6d071..55e0d4253e49 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -114,15 +114,15 @@ typedef irqreturn_t (*irq_handler_t)(int, void *); | |||
114 | struct irqaction { | 114 | struct irqaction { |
115 | irq_handler_t handler; | 115 | irq_handler_t handler; |
116 | unsigned long flags; | 116 | unsigned long flags; |
117 | const char *name; | ||
118 | void *dev_id; | 117 | void *dev_id; |
119 | struct irqaction *next; | 118 | struct irqaction *next; |
120 | int irq; | 119 | int irq; |
121 | struct proc_dir_entry *dir; | ||
122 | irq_handler_t thread_fn; | 120 | irq_handler_t thread_fn; |
123 | struct task_struct *thread; | 121 | struct task_struct *thread; |
124 | unsigned long thread_flags; | 122 | unsigned long thread_flags; |
125 | }; | 123 | const char *name; |
124 | struct proc_dir_entry *dir; | ||
125 | } ____cacheline_internodealigned_in_smp; | ||
126 | 126 | ||
127 | extern irqreturn_t no_action(int cpl, void *dev_id); | 127 | extern irqreturn_t no_action(int cpl, void *dev_id); |
128 | 128 | ||
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 d377ea815d45..e9bb22cba764 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -112,7 +112,6 @@ struct resource_list { | |||
112 | /* PC/ISA/whatever - the normal PC address spaces: IO and memory */ | 112 | /* PC/ISA/whatever - the normal PC address spaces: IO and memory */ |
113 | extern struct resource ioport_resource; | 113 | extern struct resource ioport_resource; |
114 | extern struct resource iomem_resource; | 114 | extern struct resource iomem_resource; |
115 | extern int resource_alloc_from_bottom; | ||
116 | 115 | ||
117 | extern struct resource *request_resource_conflict(struct resource *root, struct resource *new); | 116 | extern struct resource *request_resource_conflict(struct resource *root, struct resource *new); |
118 | extern int request_resource(struct resource *root, struct resource *new); | 117 | extern int request_resource(struct resource *root, struct resource *new); |
@@ -124,6 +123,7 @@ extern void reserve_region_with_split(struct resource *root, | |||
124 | 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); |
125 | extern int insert_resource(struct resource *parent, struct resource *new); | 124 | extern int insert_resource(struct resource *parent, struct resource *new); |
126 | 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); | ||
127 | extern int allocate_resource(struct resource *root, struct resource *new, | 127 | extern int allocate_resource(struct resource *root, struct resource *new, |
128 | resource_size_t size, resource_size_t min, | 128 | resource_size_t size, resource_size_t min, |
129 | resource_size_t max, resource_size_t align, | 129 | resource_size_t max, resource_size_t align, |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 8e429d0e0405..0c997767429a 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -364,7 +364,7 @@ struct ipv6_pinfo { | |||
364 | 364 | ||
365 | __u32 dst_cookie; | 365 | __u32 dst_cookie; |
366 | 366 | ||
367 | struct ipv6_mc_socklist *ipv6_mc_list; | 367 | struct ipv6_mc_socklist __rcu *ipv6_mc_list; |
368 | struct ipv6_ac_socklist *ipv6_ac_list; | 368 | struct ipv6_ac_socklist *ipv6_ac_list; |
369 | struct ipv6_fl_socklist *ipv6_fl_list; | 369 | struct ipv6_fl_socklist *ipv6_fl_list; |
370 | 370 | ||
diff --git a/include/linux/jhash.h b/include/linux/jhash.h index ced1159fa4f2..47cb09edec1a 100644 --- a/include/linux/jhash.h +++ b/include/linux/jhash.h | |||
@@ -3,129 +3,156 @@ | |||
3 | 3 | ||
4 | /* jhash.h: Jenkins hash support. | 4 | /* jhash.h: Jenkins hash support. |
5 | * | 5 | * |
6 | * Copyright (C) 1996 Bob Jenkins (bob_jenkins@burtleburtle.net) | 6 | * Copyright (C) 2006. Bob Jenkins (bob_jenkins@burtleburtle.net) |
7 | * | 7 | * |
8 | * http://burtleburtle.net/bob/hash/ | 8 | * http://burtleburtle.net/bob/hash/ |
9 | * | 9 | * |
10 | * These are the credits from Bob's sources: | 10 | * These are the credits from Bob's sources: |
11 | * | 11 | * |
12 | * lookup2.c, by Bob Jenkins, December 1996, Public Domain. | 12 | * lookup3.c, by Bob Jenkins, May 2006, Public Domain. |
13 | * hash(), hash2(), hash3, and mix() are externally useful functions. | ||
14 | * Routines to test the hash are included if SELF_TEST is defined. | ||
15 | * You can use this free for any purpose. It has no warranty. | ||
16 | * | 13 | * |
17 | * Copyright (C) 2003 David S. Miller (davem@redhat.com) | 14 | * These are functions for producing 32-bit hashes for hash table lookup. |
15 | * hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() | ||
16 | * are externally useful functions. Routines to test the hash are included | ||
17 | * if SELF_TEST is defined. You can use this free for any purpose. It's in | ||
18 | * the public domain. It has no warranty. | ||
19 | * | ||
20 | * Copyright (C) 2009-2010 Jozsef Kadlecsik (kadlec@blackhole.kfki.hu) | ||
18 | * | 21 | * |
19 | * I've modified Bob's hash to be useful in the Linux kernel, and | 22 | * I've modified Bob's hash to be useful in the Linux kernel, and |
20 | * any bugs present are surely my fault. -DaveM | 23 | * any bugs present are my fault. |
24 | * Jozsef | ||
21 | */ | 25 | */ |
26 | #include <linux/bitops.h> | ||
27 | #include <linux/unaligned/packed_struct.h> | ||
28 | |||
29 | /* Best hash sizes are of power of two */ | ||
30 | #define jhash_size(n) ((u32)1<<(n)) | ||
31 | /* Mask the hash value, i.e (value & jhash_mask(n)) instead of (value % n) */ | ||
32 | #define jhash_mask(n) (jhash_size(n)-1) | ||
33 | |||
34 | /* __jhash_mix -- mix 3 32-bit values reversibly. */ | ||
35 | #define __jhash_mix(a, b, c) \ | ||
36 | { \ | ||
37 | a -= c; a ^= rol32(c, 4); c += b; \ | ||
38 | b -= a; b ^= rol32(a, 6); a += c; \ | ||
39 | c -= b; c ^= rol32(b, 8); b += a; \ | ||
40 | a -= c; a ^= rol32(c, 16); c += b; \ | ||
41 | b -= a; b ^= rol32(a, 19); a += c; \ | ||
42 | c -= b; c ^= rol32(b, 4); b += a; \ | ||
43 | } | ||
22 | 44 | ||
23 | /* NOTE: Arguments are modified. */ | 45 | /* __jhash_final - final mixing of 3 32-bit values (a,b,c) into c */ |
24 | #define __jhash_mix(a, b, c) \ | 46 | #define __jhash_final(a, b, c) \ |
25 | { \ | 47 | { \ |
26 | a -= b; a -= c; a ^= (c>>13); \ | 48 | c ^= b; c -= rol32(b, 14); \ |
27 | b -= c; b -= a; b ^= (a<<8); \ | 49 | a ^= c; a -= rol32(c, 11); \ |
28 | c -= a; c -= b; c ^= (b>>13); \ | 50 | b ^= a; b -= rol32(a, 25); \ |
29 | a -= b; a -= c; a ^= (c>>12); \ | 51 | c ^= b; c -= rol32(b, 16); \ |
30 | b -= c; b -= a; b ^= (a<<16); \ | 52 | a ^= c; a -= rol32(c, 4); \ |
31 | c -= a; c -= b; c ^= (b>>5); \ | 53 | b ^= a; b -= rol32(a, 14); \ |
32 | a -= b; a -= c; a ^= (c>>3); \ | 54 | c ^= b; c -= rol32(b, 24); \ |
33 | b -= c; b -= a; b ^= (a<<10); \ | ||
34 | c -= a; c -= b; c ^= (b>>15); \ | ||
35 | } | 55 | } |
36 | 56 | ||
37 | /* The golden ration: an arbitrary value */ | 57 | /* An arbitrary initial parameter */ |
38 | #define JHASH_GOLDEN_RATIO 0x9e3779b9 | 58 | #define JHASH_INITVAL 0xdeadbeef |
39 | 59 | ||
40 | /* The most generic version, hashes an arbitrary sequence | 60 | /* jhash - hash an arbitrary key |
41 | * of bytes. No alignment or length assumptions are made about | 61 | * @k: sequence of bytes as key |
42 | * the input key. | 62 | * @length: the length of the key |
63 | * @initval: the previous hash, or an arbitray value | ||
64 | * | ||
65 | * The generic version, hashes an arbitrary sequence of bytes. | ||
66 | * No alignment or length assumptions are made about the input key. | ||
67 | * | ||
68 | * Returns the hash value of the key. The result depends on endianness. | ||
43 | */ | 69 | */ |
44 | static inline u32 jhash(const void *key, u32 length, u32 initval) | 70 | static inline u32 jhash(const void *key, u32 length, u32 initval) |
45 | { | 71 | { |
46 | u32 a, b, c, len; | 72 | u32 a, b, c; |
47 | const u8 *k = key; | 73 | const u8 *k = key; |
48 | 74 | ||
49 | len = length; | 75 | /* Set up the internal state */ |
50 | a = b = JHASH_GOLDEN_RATIO; | 76 | a = b = c = JHASH_INITVAL + length + initval; |
51 | c = initval; | ||
52 | |||
53 | while (len >= 12) { | ||
54 | a += (k[0] +((u32)k[1]<<8) +((u32)k[2]<<16) +((u32)k[3]<<24)); | ||
55 | b += (k[4] +((u32)k[5]<<8) +((u32)k[6]<<16) +((u32)k[7]<<24)); | ||
56 | c += (k[8] +((u32)k[9]<<8) +((u32)k[10]<<16)+((u32)k[11]<<24)); | ||
57 | |||
58 | __jhash_mix(a,b,c); | ||
59 | 77 | ||
78 | /* All but the last block: affect some 32 bits of (a,b,c) */ | ||
79 | while (length > 12) { | ||
80 | a += __get_unaligned_cpu32(k); | ||
81 | b += __get_unaligned_cpu32(k + 4); | ||
82 | c += __get_unaligned_cpu32(k + 8); | ||
83 | __jhash_mix(a, b, c); | ||
84 | length -= 12; | ||
60 | k += 12; | 85 | k += 12; |
61 | len -= 12; | ||
62 | } | 86 | } |
63 | 87 | /* Last block: affect all 32 bits of (c) */ | |
64 | c += length; | 88 | /* All the case statements fall through */ |
65 | switch (len) { | 89 | switch (length) { |
66 | case 11: c += ((u32)k[10]<<24); | 90 | case 12: c += (u32)k[11]<<24; |
67 | case 10: c += ((u32)k[9]<<16); | 91 | case 11: c += (u32)k[10]<<16; |
68 | case 9 : c += ((u32)k[8]<<8); | 92 | case 10: c += (u32)k[9]<<8; |
69 | case 8 : b += ((u32)k[7]<<24); | 93 | case 9: c += k[8]; |
70 | case 7 : b += ((u32)k[6]<<16); | 94 | case 8: b += (u32)k[7]<<24; |
71 | case 6 : b += ((u32)k[5]<<8); | 95 | case 7: b += (u32)k[6]<<16; |
72 | case 5 : b += k[4]; | 96 | case 6: b += (u32)k[5]<<8; |
73 | case 4 : a += ((u32)k[3]<<24); | 97 | case 5: b += k[4]; |
74 | case 3 : a += ((u32)k[2]<<16); | 98 | case 4: a += (u32)k[3]<<24; |
75 | case 2 : a += ((u32)k[1]<<8); | 99 | case 3: a += (u32)k[2]<<16; |
76 | case 1 : a += k[0]; | 100 | case 2: a += (u32)k[1]<<8; |
77 | }; | 101 | case 1: a += k[0]; |
78 | 102 | __jhash_final(a, b, c); | |
79 | __jhash_mix(a,b,c); | 103 | case 0: /* Nothing left to add */ |
104 | break; | ||
105 | } | ||
80 | 106 | ||
81 | return c; | 107 | return c; |
82 | } | 108 | } |
83 | 109 | ||
84 | /* A special optimized version that handles 1 or more of u32s. | 110 | /* jhash2 - hash an array of u32's |
85 | * The length parameter here is the number of u32s in the key. | 111 | * @k: the key which must be an array of u32's |
112 | * @length: the number of u32's in the key | ||
113 | * @initval: the previous hash, or an arbitray value | ||
114 | * | ||
115 | * Returns the hash value of the key. | ||
86 | */ | 116 | */ |
87 | static inline u32 jhash2(const u32 *k, u32 length, u32 initval) | 117 | static inline u32 jhash2(const u32 *k, u32 length, u32 initval) |
88 | { | 118 | { |
89 | u32 a, b, c, len; | 119 | u32 a, b, c; |
90 | 120 | ||
91 | a = b = JHASH_GOLDEN_RATIO; | 121 | /* Set up the internal state */ |
92 | c = initval; | 122 | a = b = c = JHASH_INITVAL + (length<<2) + initval; |
93 | len = length; | ||
94 | 123 | ||
95 | while (len >= 3) { | 124 | /* Handle most of the key */ |
125 | while (length > 3) { | ||
96 | a += k[0]; | 126 | a += k[0]; |
97 | b += k[1]; | 127 | b += k[1]; |
98 | c += k[2]; | 128 | c += k[2]; |
99 | __jhash_mix(a, b, c); | 129 | __jhash_mix(a, b, c); |
100 | k += 3; len -= 3; | 130 | length -= 3; |
131 | k += 3; | ||
101 | } | 132 | } |
102 | 133 | ||
103 | c += length * 4; | 134 | /* Handle the last 3 u32's: all the case statements fall through */ |
104 | 135 | switch (length) { | |
105 | switch (len) { | 136 | case 3: c += k[2]; |
106 | case 2 : b += k[1]; | 137 | case 2: b += k[1]; |
107 | case 1 : a += k[0]; | 138 | case 1: a += k[0]; |
108 | }; | 139 | __jhash_final(a, b, c); |
109 | 140 | case 0: /* Nothing left to add */ | |
110 | __jhash_mix(a,b,c); | 141 | break; |
142 | } | ||
111 | 143 | ||
112 | return c; | 144 | return c; |
113 | } | 145 | } |
114 | 146 | ||
115 | 147 | ||
116 | /* A special ultra-optimized versions that knows they are hashing exactly | 148 | /* jhash_3words - hash exactly 3, 2 or 1 word(s) */ |
117 | * 3, 2 or 1 word(s). | ||
118 | * | ||
119 | * NOTE: In particular the "c += length; __jhash_mix(a,b,c);" normally | ||
120 | * done at the end is not done here. | ||
121 | */ | ||
122 | static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval) | 149 | static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval) |
123 | { | 150 | { |
124 | a += JHASH_GOLDEN_RATIO; | 151 | a += JHASH_INITVAL; |
125 | b += JHASH_GOLDEN_RATIO; | 152 | b += JHASH_INITVAL; |
126 | c += initval; | 153 | c += initval; |
127 | 154 | ||
128 | __jhash_mix(a, b, c); | 155 | __jhash_final(a, b, c); |
129 | 156 | ||
130 | return c; | 157 | return c; |
131 | } | 158 | } |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 450092c1e35f..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; |
@@ -187,11 +160,6 @@ static inline void might_fault(void) | |||
187 | } | 160 | } |
188 | #endif | 161 | #endif |
189 | 162 | ||
190 | struct va_format { | ||
191 | const char *fmt; | ||
192 | va_list *va; | ||
193 | }; | ||
194 | |||
195 | extern struct atomic_notifier_head panic_notifier_list; | 163 | extern struct atomic_notifier_head panic_notifier_list; |
196 | extern long (*panic_blink)(int state); | 164 | extern long (*panic_blink)(int state); |
197 | NORET_TYPE void panic(const char * fmt, ...) | 165 | NORET_TYPE void panic(const char * fmt, ...) |
@@ -245,114 +213,8 @@ extern int func_ptr_is_kernel_text(void *ptr); | |||
245 | struct pid; | 213 | struct pid; |
246 | extern struct pid *session_of_pgrp(struct pid *pgrp); | 214 | extern struct pid *session_of_pgrp(struct pid *pgrp); |
247 | 215 | ||
248 | /* | ||
249 | * FW_BUG | ||
250 | * Add this to a message where you are sure the firmware is buggy or behaves | ||
251 | * really stupid or out of spec. Be aware that the responsible BIOS developer | ||
252 | * should be able to fix this issue or at least get a concrete idea of the | ||
253 | * problem by reading your message without the need of looking at the kernel | ||
254 | * code. | ||
255 | * | ||
256 | * Use it for definite and high priority BIOS bugs. | ||
257 | * | ||
258 | * FW_WARN | ||
259 | * Use it for not that clear (e.g. could the kernel messed up things already?) | ||
260 | * and medium priority BIOS bugs. | ||
261 | * | ||
262 | * FW_INFO | ||
263 | * Use this one if you want to tell the user or vendor about something | ||
264 | * suspicious, but generally harmless related to the firmware. | ||
265 | * | ||
266 | * Use it for information or very low priority BIOS bugs. | ||
267 | */ | ||
268 | #define FW_BUG "[Firmware Bug]: " | ||
269 | #define FW_WARN "[Firmware Warn]: " | ||
270 | #define FW_INFO "[Firmware Info]: " | ||
271 | |||
272 | /* | ||
273 | * HW_ERR | ||
274 | * Add this to a message for hardware errors, so that user can report | ||
275 | * it to hardware vendor instead of LKML or software vendor. | ||
276 | */ | ||
277 | #define HW_ERR "[Hardware Error]: " | ||
278 | |||
279 | #ifdef CONFIG_PRINTK | ||
280 | asmlinkage int vprintk(const char *fmt, va_list args) | ||
281 | __attribute__ ((format (printf, 1, 0))); | ||
282 | asmlinkage int printk(const char * fmt, ...) | ||
283 | __attribute__ ((format (printf, 1, 2))) __cold; | ||
284 | |||
285 | /* | ||
286 | * Please don't use printk_ratelimit(), because it shares ratelimiting state | ||
287 | * with all other unrelated printk_ratelimit() callsites. Instead use | ||
288 | * printk_ratelimited() or plain old __ratelimit(). | ||
289 | */ | ||
290 | extern int __printk_ratelimit(const char *func); | ||
291 | #define printk_ratelimit() __printk_ratelimit(__func__) | ||
292 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
293 | unsigned int interval_msec); | ||
294 | |||
295 | extern int printk_delay_msec; | ||
296 | |||
297 | /* | ||
298 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
299 | */ | ||
300 | #define printk_once(x...) ({ \ | ||
301 | static bool __print_once; \ | ||
302 | \ | ||
303 | if (!__print_once) { \ | ||
304 | __print_once = true; \ | ||
305 | printk(x); \ | ||
306 | } \ | ||
307 | }) | ||
308 | |||
309 | void log_buf_kexec_setup(void); | ||
310 | #else | ||
311 | static inline int vprintk(const char *s, va_list args) | ||
312 | __attribute__ ((format (printf, 1, 0))); | ||
313 | static inline int vprintk(const char *s, va_list args) { return 0; } | ||
314 | static inline int printk(const char *s, ...) | ||
315 | __attribute__ ((format (printf, 1, 2))); | ||
316 | static inline int __cold printk(const char *s, ...) { return 0; } | ||
317 | static inline int printk_ratelimit(void) { return 0; } | ||
318 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
319 | unsigned int interval_msec) \ | ||
320 | { return false; } | ||
321 | |||
322 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
323 | #define printk_once(x...) printk(x) | ||
324 | |||
325 | static inline void log_buf_kexec_setup(void) | ||
326 | { | ||
327 | } | ||
328 | #endif | ||
329 | |||
330 | /* | ||
331 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
332 | * gcc's format and side-effect checking. | ||
333 | */ | ||
334 | static inline __attribute__ ((format (printf, 1, 2))) | ||
335 | int no_printk(const char *s, ...) { return 0; } | ||
336 | |||
337 | extern int printk_needs_cpu(int cpu); | ||
338 | extern void printk_tick(void); | ||
339 | |||
340 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | ||
341 | early_printk(const char *fmt, ...); | ||
342 | |||
343 | unsigned long int_sqrt(unsigned long); | 216 | unsigned long int_sqrt(unsigned long); |
344 | 217 | ||
345 | static inline void console_silent(void) | ||
346 | { | ||
347 | console_loglevel = 0; | ||
348 | } | ||
349 | |||
350 | static inline void console_verbose(void) | ||
351 | { | ||
352 | if (console_loglevel) | ||
353 | console_loglevel = 15; | ||
354 | } | ||
355 | |||
356 | extern void bust_spinlocks(int yes); | 218 | extern void bust_spinlocks(int yes); |
357 | extern void wake_up_klogd(void); | 219 | extern void wake_up_klogd(void); |
358 | 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 */ |
@@ -389,22 +251,6 @@ extern enum system_states { | |||
389 | #define TAINT_CRAP 10 | 251 | #define TAINT_CRAP 10 |
390 | #define TAINT_FIRMWARE_WORKAROUND 11 | 252 | #define TAINT_FIRMWARE_WORKAROUND 11 |
391 | 253 | ||
392 | extern void dump_stack(void) __cold; | ||
393 | |||
394 | enum { | ||
395 | DUMP_PREFIX_NONE, | ||
396 | DUMP_PREFIX_ADDRESS, | ||
397 | DUMP_PREFIX_OFFSET | ||
398 | }; | ||
399 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
400 | int rowsize, int groupsize, | ||
401 | char *linebuf, size_t linebuflen, bool ascii); | ||
402 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
403 | int prefix_type, int rowsize, int groupsize, | ||
404 | const void *buf, size_t len, bool ascii); | ||
405 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
406 | const void *buf, size_t len); | ||
407 | |||
408 | extern const char hex_asc[]; | 254 | extern const char hex_asc[]; |
409 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] | 255 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] |
410 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] | 256 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] |
@@ -418,94 +264,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
418 | 264 | ||
419 | extern int hex_to_bin(char ch); | 265 | extern int hex_to_bin(char ch); |
420 | 266 | ||
421 | #ifndef pr_fmt | ||
422 | #define pr_fmt(fmt) fmt | ||
423 | #endif | ||
424 | |||
425 | #define pr_emerg(fmt, ...) \ | ||
426 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
427 | #define pr_alert(fmt, ...) \ | ||
428 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
429 | #define pr_crit(fmt, ...) \ | ||
430 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
431 | #define pr_err(fmt, ...) \ | ||
432 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
433 | #define pr_warning(fmt, ...) \ | ||
434 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
435 | #define pr_warn pr_warning | ||
436 | #define pr_notice(fmt, ...) \ | ||
437 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
438 | #define pr_info(fmt, ...) \ | ||
439 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
440 | #define pr_cont(fmt, ...) \ | ||
441 | printk(KERN_CONT fmt, ##__VA_ARGS__) | ||
442 | |||
443 | /* pr_devel() should produce zero code unless DEBUG is defined */ | ||
444 | #ifdef DEBUG | ||
445 | #define pr_devel(fmt, ...) \ | ||
446 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
447 | #else | ||
448 | #define pr_devel(fmt, ...) \ | ||
449 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
450 | #endif | ||
451 | |||
452 | /* If you are writing a driver, please use dev_dbg instead */ | ||
453 | #if defined(DEBUG) | ||
454 | #define pr_debug(fmt, ...) \ | ||
455 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
456 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
457 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ | ||
458 | #define pr_debug(fmt, ...) \ | ||
459 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | ||
460 | #else | ||
461 | #define pr_debug(fmt, ...) \ | ||
462 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
463 | #endif | ||
464 | |||
465 | /* | ||
466 | * ratelimited messages with local ratelimit_state, | ||
467 | * no local ratelimit_state used in the !PRINTK case | ||
468 | */ | ||
469 | #ifdef CONFIG_PRINTK | ||
470 | #define printk_ratelimited(fmt, ...) ({ \ | ||
471 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
472 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
473 | DEFAULT_RATELIMIT_BURST); \ | ||
474 | \ | ||
475 | if (__ratelimit(&_rs)) \ | ||
476 | printk(fmt, ##__VA_ARGS__); \ | ||
477 | }) | ||
478 | #else | ||
479 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
480 | #define printk_ratelimited printk | ||
481 | #endif | ||
482 | |||
483 | #define pr_emerg_ratelimited(fmt, ...) \ | ||
484 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
485 | #define pr_alert_ratelimited(fmt, ...) \ | ||
486 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
487 | #define pr_crit_ratelimited(fmt, ...) \ | ||
488 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
489 | #define pr_err_ratelimited(fmt, ...) \ | ||
490 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
491 | #define pr_warning_ratelimited(fmt, ...) \ | ||
492 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
493 | #define pr_warn_ratelimited pr_warning_ratelimited | ||
494 | #define pr_notice_ratelimited(fmt, ...) \ | ||
495 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
496 | #define pr_info_ratelimited(fmt, ...) \ | ||
497 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
498 | /* no pr_cont_ratelimited, don't do that... */ | ||
499 | /* If you are writing a driver, please use dev_dbg instead */ | ||
500 | #if defined(DEBUG) | ||
501 | #define pr_debug_ratelimited(fmt, ...) \ | ||
502 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
503 | #else | ||
504 | #define pr_debug_ratelimited(fmt, ...) \ | ||
505 | ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ | ||
506 | ##__VA_ARGS__); 0; }) | ||
507 | #endif | ||
508 | |||
509 | /* | 267 | /* |
510 | * General tracing related utility functions - trace_printk(), | 268 | * General tracing related utility functions - trace_printk(), |
511 | * tracing_on/tracing_off and tracing_start()/tracing_stop | 269 | * tracing_on/tracing_off and tracing_start()/tracing_stop |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index ad54c846911b..44e83ba12b5b 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -47,7 +47,7 @@ extern unsigned long long nr_context_switches(void); | |||
47 | 47 | ||
48 | #ifndef CONFIG_GENERIC_HARDIRQS | 48 | #ifndef CONFIG_GENERIC_HARDIRQS |
49 | #define kstat_irqs_this_cpu(irq) \ | 49 | #define kstat_irqs_this_cpu(irq) \ |
50 | (kstat_this_cpu.irqs[irq]) | 50 | (this_cpu_read(kstat.irqs[irq]) |
51 | 51 | ||
52 | struct irq_desc; | 52 | struct irq_desc; |
53 | 53 | ||
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index e7d1b2e0070d..dd7c12e875bc 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -275,7 +275,9 @@ extern int arch_prepared_optinsn(struct arch_optimized_insn *optinsn); | |||
275 | extern int arch_check_optimized_kprobe(struct optimized_kprobe *op); | 275 | extern int arch_check_optimized_kprobe(struct optimized_kprobe *op); |
276 | extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op); | 276 | extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op); |
277 | extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op); | 277 | extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op); |
278 | extern int arch_optimize_kprobe(struct optimized_kprobe *op); | 278 | extern void arch_optimize_kprobes(struct list_head *oplist); |
279 | extern void arch_unoptimize_kprobes(struct list_head *oplist, | ||
280 | struct list_head *done_list); | ||
279 | extern void arch_unoptimize_kprobe(struct optimized_kprobe *op); | 281 | extern void arch_unoptimize_kprobe(struct optimized_kprobe *op); |
280 | extern kprobe_opcode_t *get_optinsn_slot(void); | 282 | extern kprobe_opcode_t *get_optinsn_slot(void); |
281 | extern void free_optinsn_slot(kprobe_opcode_t *slot, int dirty); | 283 | extern void free_optinsn_slot(kprobe_opcode_t *slot, int dirty); |
@@ -303,12 +305,12 @@ struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk); | |||
303 | /* kprobe_running() will just return the current_kprobe on this CPU */ | 305 | /* kprobe_running() will just return the current_kprobe on this CPU */ |
304 | static inline struct kprobe *kprobe_running(void) | 306 | static inline struct kprobe *kprobe_running(void) |
305 | { | 307 | { |
306 | return (__get_cpu_var(current_kprobe)); | 308 | return (__this_cpu_read(current_kprobe)); |
307 | } | 309 | } |
308 | 310 | ||
309 | static inline void reset_current_kprobe(void) | 311 | static inline void reset_current_kprobe(void) |
310 | { | 312 | { |
311 | __get_cpu_var(current_kprobe) = NULL; | 313 | __this_cpu_write(current_kprobe, NULL); |
312 | } | 314 | } |
313 | 315 | ||
314 | static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void) | 316 | static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void) |
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_bl.h b/include/linux/list_bl.h new file mode 100644 index 000000000000..9ee97e7f2be4 --- /dev/null +++ b/include/linux/list_bl.h | |||
@@ -0,0 +1,144 @@ | |||
1 | #ifndef _LINUX_LIST_BL_H | ||
2 | #define _LINUX_LIST_BL_H | ||
3 | |||
4 | #include <linux/list.h> | ||
5 | |||
6 | /* | ||
7 | * Special version of lists, where head of the list has a lock in the lowest | ||
8 | * bit. This is useful for scalable hash tables without increasing memory | ||
9 | * footprint overhead. | ||
10 | * | ||
11 | * For modification operations, the 0 bit of hlist_bl_head->first | ||
12 | * pointer must be set. | ||
13 | * | ||
14 | * With some small modifications, this can easily be adapted to store several | ||
15 | * arbitrary bits (not just a single lock bit), if the need arises to store | ||
16 | * some fast and compact auxiliary data. | ||
17 | */ | ||
18 | |||
19 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | ||
20 | #define LIST_BL_LOCKMASK 1UL | ||
21 | #else | ||
22 | #define LIST_BL_LOCKMASK 0UL | ||
23 | #endif | ||
24 | |||
25 | #ifdef CONFIG_DEBUG_LIST | ||
26 | #define LIST_BL_BUG_ON(x) BUG_ON(x) | ||
27 | #else | ||
28 | #define LIST_BL_BUG_ON(x) | ||
29 | #endif | ||
30 | |||
31 | |||
32 | struct hlist_bl_head { | ||
33 | struct hlist_bl_node *first; | ||
34 | }; | ||
35 | |||
36 | struct hlist_bl_node { | ||
37 | struct hlist_bl_node *next, **pprev; | ||
38 | }; | ||
39 | #define INIT_HLIST_BL_HEAD(ptr) \ | ||
40 | ((ptr)->first = NULL) | ||
41 | |||
42 | static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h) | ||
43 | { | ||
44 | h->next = NULL; | ||
45 | h->pprev = NULL; | ||
46 | } | ||
47 | |||
48 | #define hlist_bl_entry(ptr, type, member) container_of(ptr,type,member) | ||
49 | |||
50 | static inline int hlist_bl_unhashed(const struct hlist_bl_node *h) | ||
51 | { | ||
52 | return !h->pprev; | ||
53 | } | ||
54 | |||
55 | static inline struct hlist_bl_node *hlist_bl_first(struct hlist_bl_head *h) | ||
56 | { | ||
57 | return (struct hlist_bl_node *) | ||
58 | ((unsigned long)h->first & ~LIST_BL_LOCKMASK); | ||
59 | } | ||
60 | |||
61 | static inline void hlist_bl_set_first(struct hlist_bl_head *h, | ||
62 | struct hlist_bl_node *n) | ||
63 | { | ||
64 | LIST_BL_BUG_ON((unsigned long)n & LIST_BL_LOCKMASK); | ||
65 | LIST_BL_BUG_ON(!((unsigned long)h->first & LIST_BL_LOCKMASK)); | ||
66 | h->first = (struct hlist_bl_node *)((unsigned long)n | LIST_BL_LOCKMASK); | ||
67 | } | ||
68 | |||
69 | static inline int hlist_bl_empty(const struct hlist_bl_head *h) | ||
70 | { | ||
71 | return !((unsigned long)h->first & ~LIST_BL_LOCKMASK); | ||
72 | } | ||
73 | |||
74 | static inline void hlist_bl_add_head(struct hlist_bl_node *n, | ||
75 | struct hlist_bl_head *h) | ||
76 | { | ||
77 | struct hlist_bl_node *first = hlist_bl_first(h); | ||
78 | |||
79 | n->next = first; | ||
80 | if (first) | ||
81 | first->pprev = &n->next; | ||
82 | n->pprev = &h->first; | ||
83 | hlist_bl_set_first(h, n); | ||
84 | } | ||
85 | |||
86 | static inline void __hlist_bl_del(struct hlist_bl_node *n) | ||
87 | { | ||
88 | struct hlist_bl_node *next = n->next; | ||
89 | struct hlist_bl_node **pprev = n->pprev; | ||
90 | |||
91 | LIST_BL_BUG_ON((unsigned long)n & LIST_BL_LOCKMASK); | ||
92 | |||
93 | /* pprev may be `first`, so be careful not to lose the lock bit */ | ||
94 | *pprev = (struct hlist_bl_node *) | ||
95 | ((unsigned long)next | | ||
96 | ((unsigned long)*pprev & LIST_BL_LOCKMASK)); | ||
97 | if (next) | ||
98 | next->pprev = pprev; | ||
99 | } | ||
100 | |||
101 | static inline void hlist_bl_del(struct hlist_bl_node *n) | ||
102 | { | ||
103 | __hlist_bl_del(n); | ||
104 | n->next = LIST_POISON1; | ||
105 | n->pprev = LIST_POISON2; | ||
106 | } | ||
107 | |||
108 | static inline void hlist_bl_del_init(struct hlist_bl_node *n) | ||
109 | { | ||
110 | if (!hlist_bl_unhashed(n)) { | ||
111 | __hlist_bl_del(n); | ||
112 | INIT_HLIST_BL_NODE(n); | ||
113 | } | ||
114 | } | ||
115 | |||
116 | /** | ||
117 | * hlist_bl_for_each_entry - iterate over list of given type | ||
118 | * @tpos: the type * to use as a loop cursor. | ||
119 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
120 | * @head: the head for your list. | ||
121 | * @member: the name of the hlist_node within the struct. | ||
122 | * | ||
123 | */ | ||
124 | #define hlist_bl_for_each_entry(tpos, pos, head, member) \ | ||
125 | for (pos = hlist_bl_first(head); \ | ||
126 | pos && \ | ||
127 | ({ tpos = hlist_bl_entry(pos, typeof(*tpos), member); 1;}); \ | ||
128 | pos = pos->next) | ||
129 | |||
130 | /** | ||
131 | * hlist_bl_for_each_entry_safe - iterate over list of given type safe against removal of list entry | ||
132 | * @tpos: the type * to use as a loop cursor. | ||
133 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
134 | * @n: another &struct hlist_node to use as temporary storage | ||
135 | * @head: the head for your list. | ||
136 | * @member: the name of the hlist_node within the struct. | ||
137 | */ | ||
138 | #define hlist_bl_for_each_entry_safe(tpos, pos, n, head, member) \ | ||
139 | for (pos = hlist_bl_first(head); \ | ||
140 | pos && ({ n = pos->next; 1; }) && \ | ||
141 | ({ tpos = hlist_bl_entry(pos, typeof(*tpos), member); 1;}); \ | ||
142 | pos = n) | ||
143 | |||
144 | #endif | ||
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/marvell_phy.h b/include/linux/marvell_phy.h index 1ff81b51b656..dd3c34ebca9a 100644 --- a/include/linux/marvell_phy.h +++ b/include/linux/marvell_phy.h | |||
@@ -11,6 +11,7 @@ | |||
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_88E1318S 0x01410e90 | 16 | #define MARVELL_PHY_ID_88E1318S 0x01410e90 |
16 | 17 | ||
diff --git a/include/linux/mdio.h b/include/linux/mdio.h index c779b49a1fda..b1494aced217 100644 --- a/include/linux/mdio.h +++ b/include/linux/mdio.h | |||
@@ -55,6 +55,7 @@ | |||
55 | #define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */ | 55 | #define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */ |
56 | #define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */ | 56 | #define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */ |
57 | #define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */ | 57 | #define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */ |
58 | #define MDIO_AN_EEE_ADV 60 /* EEE advertisement */ | ||
58 | 59 | ||
59 | /* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */ | 60 | /* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */ |
60 | #define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */ | 61 | #define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */ |
@@ -235,6 +236,10 @@ | |||
235 | #define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */ | 236 | #define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */ |
236 | #define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */ | 237 | #define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */ |
237 | 238 | ||
239 | /* AN EEE Advertisement register. */ | ||
240 | #define MDIO_AN_EEE_ADV_100TX 0x0002 /* Advertise 100TX EEE cap */ | ||
241 | #define MDIO_AN_EEE_ADV_1000T 0x0004 /* Advertise 1000T EEE cap */ | ||
242 | |||
238 | /* LASI RX_ALARM control/status registers. */ | 243 | /* LASI RX_ALARM control/status registers. */ |
239 | #define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */ | 244 | #define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */ |
240 | #define MDIO_PMA_LASI_RX_PCSLFLT 0x0008 /* PCS RX local fault */ | 245 | #define MDIO_PMA_LASI_RX_PCSLFLT 0x0008 /* PCS RX local fault */ |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 4307231bd22f..31c237a00c48 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -161,6 +161,9 @@ extern void register_page_bootmem_info_node(struct pglist_data *pgdat); | |||
161 | extern void put_page_bootmem(struct page *page); | 161 | extern void put_page_bootmem(struct page *page); |
162 | #endif | 162 | #endif |
163 | 163 | ||
164 | void lock_memory_hotplug(void); | ||
165 | void unlock_memory_hotplug(void); | ||
166 | |||
164 | #else /* ! CONFIG_MEMORY_HOTPLUG */ | 167 | #else /* ! CONFIG_MEMORY_HOTPLUG */ |
165 | /* | 168 | /* |
166 | * Stub functions for when hotplug is off | 169 | * Stub functions for when hotplug is off |
@@ -192,6 +195,9 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) | |||
192 | { | 195 | { |
193 | } | 196 | } |
194 | 197 | ||
198 | static inline void lock_memory_hotplug(void) {} | ||
199 | static inline void unlock_memory_hotplug(void) {} | ||
200 | |||
195 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ | 201 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ |
196 | 202 | ||
197 | #ifdef CONFIG_MEMORY_HOTREMOVE | 203 | #ifdef CONFIG_MEMORY_HOTREMOVE |
diff --git a/include/linux/mfd/tc35892.h b/include/linux/mfd/tc35892.h deleted file mode 100644 index eff3094ca84e..000000000000 --- a/include/linux/mfd/tc35892.h +++ /dev/null | |||
@@ -1,136 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License, version 2 | ||
5 | */ | ||
6 | |||
7 | #ifndef __LINUX_MFD_TC35892_H | ||
8 | #define __LINUX_MFD_TC35892_H | ||
9 | |||
10 | #include <linux/device.h> | ||
11 | |||
12 | #define TC35892_RSTCTRL_IRQRST (1 << 4) | ||
13 | #define TC35892_RSTCTRL_TIMRST (1 << 3) | ||
14 | #define TC35892_RSTCTRL_ROTRST (1 << 2) | ||
15 | #define TC35892_RSTCTRL_KBDRST (1 << 1) | ||
16 | #define TC35892_RSTCTRL_GPIRST (1 << 0) | ||
17 | |||
18 | #define TC35892_IRQST 0x91 | ||
19 | |||
20 | #define TC35892_MANFCODE_MAGIC 0x03 | ||
21 | #define TC35892_MANFCODE 0x80 | ||
22 | #define TC35892_VERSION 0x81 | ||
23 | #define TC35892_IOCFG 0xA7 | ||
24 | |||
25 | #define TC35892_CLKMODE 0x88 | ||
26 | #define TC35892_CLKCFG 0x89 | ||
27 | #define TC35892_CLKEN 0x8A | ||
28 | |||
29 | #define TC35892_RSTCTRL 0x82 | ||
30 | #define TC35892_EXTRSTN 0x83 | ||
31 | #define TC35892_RSTINTCLR 0x84 | ||
32 | |||
33 | #define TC35892_GPIOIS0 0xC9 | ||
34 | #define TC35892_GPIOIS1 0xCA | ||
35 | #define TC35892_GPIOIS2 0xCB | ||
36 | #define TC35892_GPIOIBE0 0xCC | ||
37 | #define TC35892_GPIOIBE1 0xCD | ||
38 | #define TC35892_GPIOIBE2 0xCE | ||
39 | #define TC35892_GPIOIEV0 0xCF | ||
40 | #define TC35892_GPIOIEV1 0xD0 | ||
41 | #define TC35892_GPIOIEV2 0xD1 | ||
42 | #define TC35892_GPIOIE0 0xD2 | ||
43 | #define TC35892_GPIOIE1 0xD3 | ||
44 | #define TC35892_GPIOIE2 0xD4 | ||
45 | #define TC35892_GPIORIS0 0xD6 | ||
46 | #define TC35892_GPIORIS1 0xD7 | ||
47 | #define TC35892_GPIORIS2 0xD8 | ||
48 | #define TC35892_GPIOMIS0 0xD9 | ||
49 | #define TC35892_GPIOMIS1 0xDA | ||
50 | #define TC35892_GPIOMIS2 0xDB | ||
51 | #define TC35892_GPIOIC0 0xDC | ||
52 | #define TC35892_GPIOIC1 0xDD | ||
53 | #define TC35892_GPIOIC2 0xDE | ||
54 | |||
55 | #define TC35892_GPIODATA0 0xC0 | ||
56 | #define TC35892_GPIOMASK0 0xc1 | ||
57 | #define TC35892_GPIODATA1 0xC2 | ||
58 | #define TC35892_GPIOMASK1 0xc3 | ||
59 | #define TC35892_GPIODATA2 0xC4 | ||
60 | #define TC35892_GPIOMASK2 0xC5 | ||
61 | |||
62 | #define TC35892_GPIODIR0 0xC6 | ||
63 | #define TC35892_GPIODIR1 0xC7 | ||
64 | #define TC35892_GPIODIR2 0xC8 | ||
65 | |||
66 | #define TC35892_GPIOSYNC0 0xE6 | ||
67 | #define TC35892_GPIOSYNC1 0xE7 | ||
68 | #define TC35892_GPIOSYNC2 0xE8 | ||
69 | |||
70 | #define TC35892_GPIOWAKE0 0xE9 | ||
71 | #define TC35892_GPIOWAKE1 0xEA | ||
72 | #define TC35892_GPIOWAKE2 0xEB | ||
73 | |||
74 | #define TC35892_GPIOODM0 0xE0 | ||
75 | #define TC35892_GPIOODE0 0xE1 | ||
76 | #define TC35892_GPIOODM1 0xE2 | ||
77 | #define TC35892_GPIOODE1 0xE3 | ||
78 | #define TC35892_GPIOODM2 0xE4 | ||
79 | #define TC35892_GPIOODE2 0xE5 | ||
80 | |||
81 | #define TC35892_INT_GPIIRQ 0 | ||
82 | #define TC35892_INT_TI0IRQ 1 | ||
83 | #define TC35892_INT_TI1IRQ 2 | ||
84 | #define TC35892_INT_TI2IRQ 3 | ||
85 | #define TC35892_INT_ROTIRQ 5 | ||
86 | #define TC35892_INT_KBDIRQ 6 | ||
87 | #define TC35892_INT_PORIRQ 7 | ||
88 | |||
89 | #define TC35892_NR_INTERNAL_IRQS 8 | ||
90 | #define TC35892_INT_GPIO(x) (TC35892_NR_INTERNAL_IRQS + (x)) | ||
91 | |||
92 | struct tc35892 { | ||
93 | struct mutex lock; | ||
94 | struct device *dev; | ||
95 | struct i2c_client *i2c; | ||
96 | |||
97 | int irq_base; | ||
98 | int num_gpio; | ||
99 | struct tc35892_platform_data *pdata; | ||
100 | }; | ||
101 | |||
102 | extern int tc35892_reg_write(struct tc35892 *tc35892, u8 reg, u8 data); | ||
103 | extern int tc35892_reg_read(struct tc35892 *tc35892, u8 reg); | ||
104 | extern int tc35892_block_read(struct tc35892 *tc35892, u8 reg, u8 length, | ||
105 | u8 *values); | ||
106 | extern int tc35892_block_write(struct tc35892 *tc35892, u8 reg, u8 length, | ||
107 | const u8 *values); | ||
108 | extern int tc35892_set_bits(struct tc35892 *tc35892, u8 reg, u8 mask, u8 val); | ||
109 | |||
110 | /** | ||
111 | * struct tc35892_gpio_platform_data - TC35892 GPIO platform data | ||
112 | * @gpio_base: first gpio number assigned to TC35892. A maximum of | ||
113 | * %TC35892_NR_GPIOS GPIOs will be allocated. | ||
114 | * @setup: callback for board-specific initialization | ||
115 | * @remove: callback for board-specific teardown | ||
116 | */ | ||
117 | struct tc35892_gpio_platform_data { | ||
118 | int gpio_base; | ||
119 | void (*setup)(struct tc35892 *tc35892, unsigned gpio_base); | ||
120 | void (*remove)(struct tc35892 *tc35892, unsigned gpio_base); | ||
121 | }; | ||
122 | |||
123 | /** | ||
124 | * struct tc35892_platform_data - TC35892 platform data | ||
125 | * @irq_base: base IRQ number. %TC35892_NR_IRQS irqs will be used. | ||
126 | * @gpio: GPIO-specific platform data | ||
127 | */ | ||
128 | struct tc35892_platform_data { | ||
129 | int irq_base; | ||
130 | struct tc35892_gpio_platform_data *gpio; | ||
131 | }; | ||
132 | |||
133 | #define TC35892_NR_GPIOS 24 | ||
134 | #define TC35892_NR_IRQS TC35892_INT_GPIO(TC35892_NR_GPIOS) | ||
135 | |||
136 | #endif | ||
diff --git a/include/linux/mfd/tc3589x.h b/include/linux/mfd/tc3589x.h new file mode 100644 index 000000000000..16c76e124f9c --- /dev/null +++ b/include/linux/mfd/tc3589x.h | |||
@@ -0,0 +1,195 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2010 | ||
3 | * | ||
4 | * License Terms: GNU General Public License, version 2 | ||
5 | */ | ||
6 | |||
7 | #ifndef __LINUX_MFD_TC3589x_H | ||
8 | #define __LINUX_MFD_TC3589x_H | ||
9 | |||
10 | #include <linux/device.h> | ||
11 | |||
12 | enum tx3589x_block { | ||
13 | TC3589x_BLOCK_GPIO = 1 << 0, | ||
14 | TC3589x_BLOCK_KEYPAD = 1 << 1, | ||
15 | }; | ||
16 | |||
17 | #define TC3589x_RSTCTRL_IRQRST (1 << 4) | ||
18 | #define TC3589x_RSTCTRL_TIMRST (1 << 3) | ||
19 | #define TC3589x_RSTCTRL_ROTRST (1 << 2) | ||
20 | #define TC3589x_RSTCTRL_KBDRST (1 << 1) | ||
21 | #define TC3589x_RSTCTRL_GPIRST (1 << 0) | ||
22 | |||
23 | /* Keyboard Configuration Registers */ | ||
24 | #define TC3589x_KBDSETTLE_REG 0x01 | ||
25 | #define TC3589x_KBDBOUNCE 0x02 | ||
26 | #define TC3589x_KBDSIZE 0x03 | ||
27 | #define TC3589x_KBCFG_LSB 0x04 | ||
28 | #define TC3589x_KBCFG_MSB 0x05 | ||
29 | #define TC3589x_KBDIC 0x08 | ||
30 | #define TC3589x_KBDMSK 0x09 | ||
31 | #define TC3589x_EVTCODE_FIFO 0x10 | ||
32 | #define TC3589x_KBDMFS 0x8F | ||
33 | |||
34 | #define TC3589x_IRQST 0x91 | ||
35 | |||
36 | #define TC3589x_MANFCODE_MAGIC 0x03 | ||
37 | #define TC3589x_MANFCODE 0x80 | ||
38 | #define TC3589x_VERSION 0x81 | ||
39 | #define TC3589x_IOCFG 0xA7 | ||
40 | |||
41 | #define TC3589x_CLKMODE 0x88 | ||
42 | #define TC3589x_CLKCFG 0x89 | ||
43 | #define TC3589x_CLKEN 0x8A | ||
44 | |||
45 | #define TC3589x_RSTCTRL 0x82 | ||
46 | #define TC3589x_EXTRSTN 0x83 | ||
47 | #define TC3589x_RSTINTCLR 0x84 | ||
48 | |||
49 | /* Pull up/down configuration registers */ | ||
50 | #define TC3589x_IOCFG 0xA7 | ||
51 | #define TC3589x_IOPULLCFG0_LSB 0xAA | ||
52 | #define TC3589x_IOPULLCFG0_MSB 0xAB | ||
53 | #define TC3589x_IOPULLCFG1_LSB 0xAC | ||
54 | #define TC3589x_IOPULLCFG1_MSB 0xAD | ||
55 | #define TC3589x_IOPULLCFG2_LSB 0xAE | ||
56 | |||
57 | #define TC3589x_GPIOIS0 0xC9 | ||
58 | #define TC3589x_GPIOIS1 0xCA | ||
59 | #define TC3589x_GPIOIS2 0xCB | ||
60 | #define TC3589x_GPIOIBE0 0xCC | ||
61 | #define TC3589x_GPIOIBE1 0xCD | ||
62 | #define TC3589x_GPIOIBE2 0xCE | ||
63 | #define TC3589x_GPIOIEV0 0xCF | ||
64 | #define TC3589x_GPIOIEV1 0xD0 | ||
65 | #define TC3589x_GPIOIEV2 0xD1 | ||
66 | #define TC3589x_GPIOIE0 0xD2 | ||
67 | #define TC3589x_GPIOIE1 0xD3 | ||
68 | #define TC3589x_GPIOIE2 0xD4 | ||
69 | #define TC3589x_GPIORIS0 0xD6 | ||
70 | #define TC3589x_GPIORIS1 0xD7 | ||
71 | #define TC3589x_GPIORIS2 0xD8 | ||
72 | #define TC3589x_GPIOMIS0 0xD9 | ||
73 | #define TC3589x_GPIOMIS1 0xDA | ||
74 | #define TC3589x_GPIOMIS2 0xDB | ||
75 | #define TC3589x_GPIOIC0 0xDC | ||
76 | #define TC3589x_GPIOIC1 0xDD | ||
77 | #define TC3589x_GPIOIC2 0xDE | ||
78 | |||
79 | #define TC3589x_GPIODATA0 0xC0 | ||
80 | #define TC3589x_GPIOMASK0 0xc1 | ||
81 | #define TC3589x_GPIODATA1 0xC2 | ||
82 | #define TC3589x_GPIOMASK1 0xc3 | ||
83 | #define TC3589x_GPIODATA2 0xC4 | ||
84 | #define TC3589x_GPIOMASK2 0xC5 | ||
85 | |||
86 | #define TC3589x_GPIODIR0 0xC6 | ||
87 | #define TC3589x_GPIODIR1 0xC7 | ||
88 | #define TC3589x_GPIODIR2 0xC8 | ||
89 | |||
90 | #define TC3589x_GPIOSYNC0 0xE6 | ||
91 | #define TC3589x_GPIOSYNC1 0xE7 | ||
92 | #define TC3589x_GPIOSYNC2 0xE8 | ||
93 | |||
94 | #define TC3589x_GPIOWAKE0 0xE9 | ||
95 | #define TC3589x_GPIOWAKE1 0xEA | ||
96 | #define TC3589x_GPIOWAKE2 0xEB | ||
97 | |||
98 | #define TC3589x_GPIOODM0 0xE0 | ||
99 | #define TC3589x_GPIOODE0 0xE1 | ||
100 | #define TC3589x_GPIOODM1 0xE2 | ||
101 | #define TC3589x_GPIOODE1 0xE3 | ||
102 | #define TC3589x_GPIOODM2 0xE4 | ||
103 | #define TC3589x_GPIOODE2 0xE5 | ||
104 | |||
105 | #define TC3589x_INT_GPIIRQ 0 | ||
106 | #define TC3589x_INT_TI0IRQ 1 | ||
107 | #define TC3589x_INT_TI1IRQ 2 | ||
108 | #define TC3589x_INT_TI2IRQ 3 | ||
109 | #define TC3589x_INT_ROTIRQ 5 | ||
110 | #define TC3589x_INT_KBDIRQ 6 | ||
111 | #define TC3589x_INT_PORIRQ 7 | ||
112 | |||
113 | #define TC3589x_NR_INTERNAL_IRQS 8 | ||
114 | #define TC3589x_INT_GPIO(x) (TC3589x_NR_INTERNAL_IRQS + (x)) | ||
115 | |||
116 | struct tc3589x { | ||
117 | struct mutex lock; | ||
118 | struct device *dev; | ||
119 | struct i2c_client *i2c; | ||
120 | |||
121 | int irq_base; | ||
122 | int num_gpio; | ||
123 | struct tc3589x_platform_data *pdata; | ||
124 | }; | ||
125 | |||
126 | extern int tc3589x_reg_write(struct tc3589x *tc3589x, u8 reg, u8 data); | ||
127 | extern int tc3589x_reg_read(struct tc3589x *tc3589x, u8 reg); | ||
128 | extern int tc3589x_block_read(struct tc3589x *tc3589x, u8 reg, u8 length, | ||
129 | u8 *values); | ||
130 | extern int tc3589x_block_write(struct tc3589x *tc3589x, u8 reg, u8 length, | ||
131 | const u8 *values); | ||
132 | extern int tc3589x_set_bits(struct tc3589x *tc3589x, u8 reg, u8 mask, u8 val); | ||
133 | |||
134 | /* | ||
135 | * Keypad related platform specific constants | ||
136 | * These values may be modified for fine tuning | ||
137 | */ | ||
138 | #define TC_KPD_ROWS 0x8 | ||
139 | #define TC_KPD_COLUMNS 0x8 | ||
140 | #define TC_KPD_DEBOUNCE_PERIOD 0xA3 | ||
141 | #define TC_KPD_SETTLE_TIME 0xA3 | ||
142 | |||
143 | /** | ||
144 | * struct tc35893_platform_data - data structure for platform specific data | ||
145 | * @keymap_data: matrix scan code table for keycodes | ||
146 | * @krow: mask for available rows, value is 0xFF | ||
147 | * @kcol: mask for available columns, value is 0xFF | ||
148 | * @debounce_period: platform specific debounce time | ||
149 | * @settle_time: platform specific settle down time | ||
150 | * @irqtype: type of interrupt, falling or rising edge | ||
151 | * @enable_wakeup: specifies if keypad event can wake up system from sleep | ||
152 | * @no_autorepeat: flag for auto repetition | ||
153 | */ | ||
154 | struct tc3589x_keypad_platform_data { | ||
155 | const struct matrix_keymap_data *keymap_data; | ||
156 | u8 krow; | ||
157 | u8 kcol; | ||
158 | u8 debounce_period; | ||
159 | u8 settle_time; | ||
160 | unsigned long irqtype; | ||
161 | bool enable_wakeup; | ||
162 | bool no_autorepeat; | ||
163 | }; | ||
164 | |||
165 | /** | ||
166 | * struct tc3589x_gpio_platform_data - TC3589x GPIO platform data | ||
167 | * @gpio_base: first gpio number assigned to TC3589x. A maximum of | ||
168 | * %TC3589x_NR_GPIOS GPIOs will be allocated. | ||
169 | * @setup: callback for board-specific initialization | ||
170 | * @remove: callback for board-specific teardown | ||
171 | */ | ||
172 | struct tc3589x_gpio_platform_data { | ||
173 | int gpio_base; | ||
174 | void (*setup)(struct tc3589x *tc3589x, unsigned gpio_base); | ||
175 | void (*remove)(struct tc3589x *tc3589x, unsigned gpio_base); | ||
176 | }; | ||
177 | |||
178 | /** | ||
179 | * struct tc3589x_platform_data - TC3589x platform data | ||
180 | * @block: bitmask of blocks to enable (use TC3589x_BLOCK_*) | ||
181 | * @irq_base: base IRQ number. %TC3589x_NR_IRQS irqs will be used. | ||
182 | * @gpio: GPIO-specific platform data | ||
183 | * @keypad: keypad-specific platform data | ||
184 | */ | ||
185 | struct tc3589x_platform_data { | ||
186 | unsigned int block; | ||
187 | int irq_base; | ||
188 | struct tc3589x_gpio_platform_data *gpio; | ||
189 | const struct tc3589x_keypad_platform_data *keypad; | ||
190 | }; | ||
191 | |||
192 | #define TC3589x_NR_GPIOS 24 | ||
193 | #define TC3589x_NR_IRQS TC3589x_INT_GPIO(TC3589x_NR_GPIOS) | ||
194 | |||
195 | #endif | ||
diff --git a/include/linux/mfd/wl1273-core.h b/include/linux/mfd/wl1273-core.h new file mode 100644 index 000000000000..9787293eae5f --- /dev/null +++ b/include/linux/mfd/wl1273-core.h | |||
@@ -0,0 +1,288 @@ | |||
1 | /* | ||
2 | * include/linux/mfd/wl1273-core.h | ||
3 | * | ||
4 | * Some definitions for the wl1273 radio receiver/transmitter chip. | ||
5 | * | ||
6 | * Copyright (C) 2010 Nokia Corporation | ||
7 | * Author: Matti J. Aaltonen <matti.j.aaltonen@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 | #ifndef WL1273_CORE_H | ||
25 | #define WL1273_CORE_H | ||
26 | |||
27 | #include <linux/i2c.h> | ||
28 | #include <linux/mfd/core.h> | ||
29 | |||
30 | #define WL1273_FM_DRIVER_NAME "wl1273-fm" | ||
31 | #define RX71_FM_I2C_ADDR 0x22 | ||
32 | |||
33 | #define WL1273_STEREO_GET 0 | ||
34 | #define WL1273_RSSI_LVL_GET 1 | ||
35 | #define WL1273_IF_COUNT_GET 2 | ||
36 | #define WL1273_FLAG_GET 3 | ||
37 | #define WL1273_RDS_SYNC_GET 4 | ||
38 | #define WL1273_RDS_DATA_GET 5 | ||
39 | #define WL1273_FREQ_SET 10 | ||
40 | #define WL1273_AF_FREQ_SET 11 | ||
41 | #define WL1273_MOST_MODE_SET 12 | ||
42 | #define WL1273_MOST_BLEND_SET 13 | ||
43 | #define WL1273_DEMPH_MODE_SET 14 | ||
44 | #define WL1273_SEARCH_LVL_SET 15 | ||
45 | #define WL1273_BAND_SET 16 | ||
46 | #define WL1273_MUTE_STATUS_SET 17 | ||
47 | #define WL1273_RDS_PAUSE_LVL_SET 18 | ||
48 | #define WL1273_RDS_PAUSE_DUR_SET 19 | ||
49 | #define WL1273_RDS_MEM_SET 20 | ||
50 | #define WL1273_RDS_BLK_B_SET 21 | ||
51 | #define WL1273_RDS_MSK_B_SET 22 | ||
52 | #define WL1273_RDS_PI_MASK_SET 23 | ||
53 | #define WL1273_RDS_PI_SET 24 | ||
54 | #define WL1273_RDS_SYSTEM_SET 25 | ||
55 | #define WL1273_INT_MASK_SET 26 | ||
56 | #define WL1273_SEARCH_DIR_SET 27 | ||
57 | #define WL1273_VOLUME_SET 28 | ||
58 | #define WL1273_AUDIO_ENABLE 29 | ||
59 | #define WL1273_PCM_MODE_SET 30 | ||
60 | #define WL1273_I2S_MODE_CONFIG_SET 31 | ||
61 | #define WL1273_POWER_SET 32 | ||
62 | #define WL1273_INTX_CONFIG_SET 33 | ||
63 | #define WL1273_PULL_EN_SET 34 | ||
64 | #define WL1273_HILO_SET 35 | ||
65 | #define WL1273_SWITCH2FREF 36 | ||
66 | #define WL1273_FREQ_DRIFT_REPORT 37 | ||
67 | |||
68 | #define WL1273_PCE_GET 40 | ||
69 | #define WL1273_FIRM_VER_GET 41 | ||
70 | #define WL1273_ASIC_VER_GET 42 | ||
71 | #define WL1273_ASIC_ID_GET 43 | ||
72 | #define WL1273_MAN_ID_GET 44 | ||
73 | #define WL1273_TUNER_MODE_SET 45 | ||
74 | #define WL1273_STOP_SEARCH 46 | ||
75 | #define WL1273_RDS_CNTRL_SET 47 | ||
76 | |||
77 | #define WL1273_WRITE_HARDWARE_REG 100 | ||
78 | #define WL1273_CODE_DOWNLOAD 101 | ||
79 | #define WL1273_RESET 102 | ||
80 | |||
81 | #define WL1273_FM_POWER_MODE 254 | ||
82 | #define WL1273_FM_INTERRUPT 255 | ||
83 | |||
84 | /* Transmitter API */ | ||
85 | |||
86 | #define WL1273_CHANL_SET 55 | ||
87 | #define WL1273_SCAN_SPACING_SET 56 | ||
88 | #define WL1273_REF_SET 57 | ||
89 | #define WL1273_POWER_ENB_SET 90 | ||
90 | #define WL1273_POWER_ATT_SET 58 | ||
91 | #define WL1273_POWER_LEV_SET 59 | ||
92 | #define WL1273_AUDIO_DEV_SET 60 | ||
93 | #define WL1273_PILOT_DEV_SET 61 | ||
94 | #define WL1273_RDS_DEV_SET 62 | ||
95 | #define WL1273_PUPD_SET 91 | ||
96 | #define WL1273_AUDIO_IO_SET 63 | ||
97 | #define WL1273_PREMPH_SET 64 | ||
98 | #define WL1273_MONO_SET 66 | ||
99 | #define WL1273_MUTE 92 | ||
100 | #define WL1273_MPX_LMT_ENABLE 67 | ||
101 | #define WL1273_PI_SET 93 | ||
102 | #define WL1273_ECC_SET 69 | ||
103 | #define WL1273_PTY 70 | ||
104 | #define WL1273_AF 71 | ||
105 | #define WL1273_DISPLAY_MODE 74 | ||
106 | #define WL1273_RDS_REP_SET 77 | ||
107 | #define WL1273_RDS_CONFIG_DATA_SET 98 | ||
108 | #define WL1273_RDS_DATA_SET 99 | ||
109 | #define WL1273_RDS_DATA_ENB 94 | ||
110 | #define WL1273_TA_SET 78 | ||
111 | #define WL1273_TP_SET 79 | ||
112 | #define WL1273_DI_SET 80 | ||
113 | #define WL1273_MS_SET 81 | ||
114 | #define WL1273_PS_SCROLL_SPEED 82 | ||
115 | #define WL1273_TX_AUDIO_LEVEL_TEST 96 | ||
116 | #define WL1273_TX_AUDIO_LEVEL_TEST_THRESHOLD 73 | ||
117 | #define WL1273_TX_AUDIO_INPUT_LEVEL_RANGE_SET 54 | ||
118 | #define WL1273_RX_ANTENNA_SELECT 87 | ||
119 | #define WL1273_I2C_DEV_ADDR_SET 86 | ||
120 | #define WL1273_REF_ERR_CALIB_PARAM_SET 88 | ||
121 | #define WL1273_REF_ERR_CALIB_PERIODICITY_SET 89 | ||
122 | #define WL1273_SOC_INT_TRIGGER 52 | ||
123 | #define WL1273_SOC_AUDIO_PATH_SET 83 | ||
124 | #define WL1273_SOC_PCMI_OVERRIDE 84 | ||
125 | #define WL1273_SOC_I2S_OVERRIDE 85 | ||
126 | #define WL1273_RSSI_BLOCK_SCAN_FREQ_SET 95 | ||
127 | #define WL1273_RSSI_BLOCK_SCAN_START 97 | ||
128 | #define WL1273_RSSI_BLOCK_SCAN_DATA_GET 5 | ||
129 | #define WL1273_READ_FMANT_TUNE_VALUE 104 | ||
130 | |||
131 | #define WL1273_RDS_OFF 0 | ||
132 | #define WL1273_RDS_ON 1 | ||
133 | #define WL1273_RDS_RESET 2 | ||
134 | |||
135 | #define WL1273_AUDIO_DIGITAL 0 | ||
136 | #define WL1273_AUDIO_ANALOG 1 | ||
137 | |||
138 | #define WL1273_MODE_RX BIT(0) | ||
139 | #define WL1273_MODE_TX BIT(1) | ||
140 | #define WL1273_MODE_OFF BIT(2) | ||
141 | #define WL1273_MODE_SUSPENDED BIT(3) | ||
142 | |||
143 | #define WL1273_RADIO_CHILD BIT(0) | ||
144 | #define WL1273_CODEC_CHILD BIT(1) | ||
145 | |||
146 | #define WL1273_RX_MONO 1 | ||
147 | #define WL1273_RX_STEREO 0 | ||
148 | #define WL1273_TX_MONO 0 | ||
149 | #define WL1273_TX_STEREO 1 | ||
150 | |||
151 | #define WL1273_MAX_VOLUME 0xffff | ||
152 | #define WL1273_DEFAULT_VOLUME 0x78b8 | ||
153 | |||
154 | /* I2S protocol, left channel first, data width 16 bits */ | ||
155 | #define WL1273_PCM_DEF_MODE 0x00 | ||
156 | |||
157 | /* Rx */ | ||
158 | #define WL1273_AUDIO_ENABLE_I2S BIT(0) | ||
159 | #define WL1273_AUDIO_ENABLE_ANALOG BIT(1) | ||
160 | |||
161 | /* Tx */ | ||
162 | #define WL1273_AUDIO_IO_SET_ANALOG 0 | ||
163 | #define WL1273_AUDIO_IO_SET_I2S 1 | ||
164 | |||
165 | #define WL1273_PUPD_SET_OFF 0x00 | ||
166 | #define WL1273_PUPD_SET_ON 0x01 | ||
167 | #define WL1273_PUPD_SET_RETENTION 0x10 | ||
168 | |||
169 | /* I2S mode */ | ||
170 | #define WL1273_IS2_WIDTH_32 0x0 | ||
171 | #define WL1273_IS2_WIDTH_40 0x1 | ||
172 | #define WL1273_IS2_WIDTH_22_23 0x2 | ||
173 | #define WL1273_IS2_WIDTH_23_22 0x3 | ||
174 | #define WL1273_IS2_WIDTH_48 0x4 | ||
175 | #define WL1273_IS2_WIDTH_50 0x5 | ||
176 | #define WL1273_IS2_WIDTH_60 0x6 | ||
177 | #define WL1273_IS2_WIDTH_64 0x7 | ||
178 | #define WL1273_IS2_WIDTH_80 0x8 | ||
179 | #define WL1273_IS2_WIDTH_96 0x9 | ||
180 | #define WL1273_IS2_WIDTH_128 0xa | ||
181 | #define WL1273_IS2_WIDTH 0xf | ||
182 | |||
183 | #define WL1273_IS2_FORMAT_STD (0x0 << 4) | ||
184 | #define WL1273_IS2_FORMAT_LEFT (0x1 << 4) | ||
185 | #define WL1273_IS2_FORMAT_RIGHT (0x2 << 4) | ||
186 | #define WL1273_IS2_FORMAT_USER (0x3 << 4) | ||
187 | |||
188 | #define WL1273_IS2_MASTER (0x0 << 6) | ||
189 | #define WL1273_IS2_SLAVEW (0x1 << 6) | ||
190 | |||
191 | #define WL1273_IS2_TRI_AFTER_SENDING (0x0 << 7) | ||
192 | #define WL1273_IS2_TRI_ALWAYS_ACTIVE (0x1 << 7) | ||
193 | |||
194 | #define WL1273_IS2_SDOWS_RR (0x0 << 8) | ||
195 | #define WL1273_IS2_SDOWS_RF (0x1 << 8) | ||
196 | #define WL1273_IS2_SDOWS_FR (0x2 << 8) | ||
197 | #define WL1273_IS2_SDOWS_FF (0x3 << 8) | ||
198 | |||
199 | #define WL1273_IS2_TRI_OPT (0x0 << 10) | ||
200 | #define WL1273_IS2_TRI_ALWAYS (0x1 << 10) | ||
201 | |||
202 | #define WL1273_IS2_RATE_48K (0x0 << 12) | ||
203 | #define WL1273_IS2_RATE_44_1K (0x1 << 12) | ||
204 | #define WL1273_IS2_RATE_32K (0x2 << 12) | ||
205 | #define WL1273_IS2_RATE_22_05K (0x4 << 12) | ||
206 | #define WL1273_IS2_RATE_16K (0x5 << 12) | ||
207 | #define WL1273_IS2_RATE_12K (0x8 << 12) | ||
208 | #define WL1273_IS2_RATE_11_025 (0x9 << 12) | ||
209 | #define WL1273_IS2_RATE_8K (0xa << 12) | ||
210 | #define WL1273_IS2_RATE (0xf << 12) | ||
211 | |||
212 | #define WL1273_I2S_DEF_MODE (WL1273_IS2_WIDTH_32 | \ | ||
213 | WL1273_IS2_FORMAT_STD | \ | ||
214 | WL1273_IS2_MASTER | \ | ||
215 | WL1273_IS2_TRI_AFTER_SENDING | \ | ||
216 | WL1273_IS2_SDOWS_RR | \ | ||
217 | WL1273_IS2_TRI_OPT | \ | ||
218 | WL1273_IS2_RATE_48K) | ||
219 | |||
220 | #define SCHAR_MIN (-128) | ||
221 | #define SCHAR_MAX 127 | ||
222 | |||
223 | #define WL1273_FR_EVENT BIT(0) | ||
224 | #define WL1273_BL_EVENT BIT(1) | ||
225 | #define WL1273_RDS_EVENT BIT(2) | ||
226 | #define WL1273_BBLK_EVENT BIT(3) | ||
227 | #define WL1273_LSYNC_EVENT BIT(4) | ||
228 | #define WL1273_LEV_EVENT BIT(5) | ||
229 | #define WL1273_IFFR_EVENT BIT(6) | ||
230 | #define WL1273_PI_EVENT BIT(7) | ||
231 | #define WL1273_PD_EVENT BIT(8) | ||
232 | #define WL1273_STIC_EVENT BIT(9) | ||
233 | #define WL1273_MAL_EVENT BIT(10) | ||
234 | #define WL1273_POW_ENB_EVENT BIT(11) | ||
235 | #define WL1273_SCAN_OVER_EVENT BIT(12) | ||
236 | #define WL1273_ERROR_EVENT BIT(13) | ||
237 | |||
238 | #define TUNER_MODE_STOP_SEARCH 0 | ||
239 | #define TUNER_MODE_PRESET 1 | ||
240 | #define TUNER_MODE_AUTO_SEEK 2 | ||
241 | #define TUNER_MODE_AF 3 | ||
242 | #define TUNER_MODE_AUTO_SEEK_PI 4 | ||
243 | #define TUNER_MODE_AUTO_SEEK_BULK 5 | ||
244 | |||
245 | #define RDS_BLOCK_SIZE 3 | ||
246 | |||
247 | struct wl1273_fm_platform_data { | ||
248 | int (*request_resources) (struct i2c_client *client); | ||
249 | void (*free_resources) (void); | ||
250 | void (*enable) (void); | ||
251 | void (*disable) (void); | ||
252 | |||
253 | u8 forbidden_modes; | ||
254 | unsigned int children; | ||
255 | }; | ||
256 | |||
257 | #define WL1273_FM_CORE_CELLS 2 | ||
258 | |||
259 | #define WL1273_BAND_OTHER 0 | ||
260 | #define WL1273_BAND_JAPAN 1 | ||
261 | |||
262 | #define WL1273_BAND_JAPAN_LOW 76000 | ||
263 | #define WL1273_BAND_JAPAN_HIGH 90000 | ||
264 | #define WL1273_BAND_OTHER_LOW 87500 | ||
265 | #define WL1273_BAND_OTHER_HIGH 108000 | ||
266 | |||
267 | #define WL1273_BAND_TX_LOW 76000 | ||
268 | #define WL1273_BAND_TX_HIGH 108000 | ||
269 | |||
270 | struct wl1273_core { | ||
271 | struct mfd_cell cells[WL1273_FM_CORE_CELLS]; | ||
272 | struct wl1273_fm_platform_data *pdata; | ||
273 | |||
274 | unsigned int mode; | ||
275 | unsigned int i2s_mode; | ||
276 | unsigned int volume; | ||
277 | unsigned int audio_mode; | ||
278 | unsigned int channel_number; | ||
279 | struct mutex lock; /* for serializing fm radio operations */ | ||
280 | |||
281 | struct i2c_client *client; | ||
282 | |||
283 | int (*write)(struct wl1273_core *core, u8, u16); | ||
284 | int (*set_audio)(struct wl1273_core *core, unsigned int); | ||
285 | int (*set_volume)(struct wl1273_core *core, unsigned int); | ||
286 | }; | ||
287 | |||
288 | #endif /* ifndef WL1273_CORE_H */ | ||
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/mmc/host.h b/include/linux/mmc/host.h index 6d87f68ce4b6..30f6fad99a58 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -168,6 +168,7 @@ struct mmc_host { | |||
168 | /* DDR mode at 1.8V */ | 168 | /* DDR mode at 1.8V */ |
169 | #define MMC_CAP_1_2V_DDR (1 << 12) /* can support */ | 169 | #define MMC_CAP_1_2V_DDR (1 << 12) /* can support */ |
170 | /* DDR mode at 1.2V */ | 170 | /* DDR mode at 1.2V */ |
171 | #define MMC_CAP_POWER_OFF_CARD (1 << 13) /* Can power off after boot */ | ||
171 | 172 | ||
172 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 173 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
173 | 174 | ||
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index 5c99da1078aa..44fc5348fd5d 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
@@ -14,8 +14,9 @@ | |||
14 | #ifndef __SH_MMCIF_H__ | 14 | #ifndef __SH_MMCIF_H__ |
15 | #define __SH_MMCIF_H__ | 15 | #define __SH_MMCIF_H__ |
16 | 16 | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/platform_device.h> | ||
19 | #include <linux/sh_dma.h> | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * MMCIF : CE_CLK_CTRL [19:16] | 22 | * MMCIF : CE_CLK_CTRL [19:16] |
@@ -31,13 +32,19 @@ | |||
31 | * 1111 : Peripheral clock (sup_pclk set '1') | 32 | * 1111 : Peripheral clock (sup_pclk set '1') |
32 | */ | 33 | */ |
33 | 34 | ||
35 | struct sh_mmcif_dma { | ||
36 | struct sh_dmae_slave chan_priv_tx; | ||
37 | struct sh_dmae_slave chan_priv_rx; | ||
38 | }; | ||
39 | |||
34 | struct sh_mmcif_plat_data { | 40 | struct sh_mmcif_plat_data { |
35 | void (*set_pwr)(struct platform_device *pdev, int state); | 41 | void (*set_pwr)(struct platform_device *pdev, int state); |
36 | void (*down_pwr)(struct platform_device *pdev); | 42 | void (*down_pwr)(struct platform_device *pdev); |
37 | int (*get_cd)(struct platform_device *pdef); | 43 | int (*get_cd)(struct platform_device *pdef); |
38 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ | 44 | struct sh_mmcif_dma *dma; |
39 | unsigned long caps; | 45 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ |
40 | u32 ocr; | 46 | unsigned long caps; |
47 | u32 ocr; | ||
41 | }; | 48 | }; |
42 | 49 | ||
43 | #define MMCIF_CE_CMD_SET 0x00000000 | 50 | #define MMCIF_CE_CMD_SET 0x00000000 |
@@ -59,6 +66,32 @@ struct sh_mmcif_plat_data { | |||
59 | #define MMCIF_CE_HOST_STS2 0x0000004C | 66 | #define MMCIF_CE_HOST_STS2 0x0000004C |
60 | #define MMCIF_CE_VERSION 0x0000007C | 67 | #define MMCIF_CE_VERSION 0x0000007C |
61 | 68 | ||
69 | /* CE_BUF_ACC */ | ||
70 | #define BUF_ACC_DMAWEN (1 << 25) | ||
71 | #define BUF_ACC_DMAREN (1 << 24) | ||
72 | #define BUF_ACC_BUSW_32 (0 << 17) | ||
73 | #define BUF_ACC_BUSW_16 (1 << 17) | ||
74 | #define BUF_ACC_ATYP (1 << 16) | ||
75 | |||
76 | /* CE_CLK_CTRL */ | ||
77 | #define CLK_ENABLE (1 << 24) /* 1: output mmc clock */ | ||
78 | #define CLK_CLEAR ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16)) | ||
79 | #define CLK_SUP_PCLK ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16)) | ||
80 | #define CLKDIV_4 (1<<16) /* mmc clock frequency. | ||
81 | * n: bus clock/(2^(n+1)) */ | ||
82 | #define CLKDIV_256 (7<<16) /* mmc clock frequency. (see above) */ | ||
83 | #define SRSPTO_256 ((1 << 13) | (0 << 12)) /* resp timeout */ | ||
84 | #define SRBSYTO_29 ((1 << 11) | (1 << 10) | \ | ||
85 | (1 << 9) | (1 << 8)) /* resp busy timeout */ | ||
86 | #define SRWDTO_29 ((1 << 7) | (1 << 6) | \ | ||
87 | (1 << 5) | (1 << 4)) /* read/write timeout */ | ||
88 | #define SCCSTO_29 ((1 << 3) | (1 << 2) | \ | ||
89 | (1 << 1) | (1 << 0)) /* ccs timeout */ | ||
90 | |||
91 | /* CE_VERSION */ | ||
92 | #define SOFT_RST_ON (1 << 31) | ||
93 | #define SOFT_RST_OFF 0 | ||
94 | |||
62 | static inline u32 sh_mmcif_readl(void __iomem *addr, int reg) | 95 | static inline u32 sh_mmcif_readl(void __iomem *addr, int reg) |
63 | { | 96 | { |
64 | return readl(addr + reg); | 97 | return readl(addr + reg); |
@@ -145,21 +178,20 @@ static inline int sh_mmcif_boot_do_read(void __iomem *base, | |||
145 | 178 | ||
146 | static inline void sh_mmcif_boot_init(void __iomem *base) | 179 | static inline void sh_mmcif_boot_init(void __iomem *base) |
147 | { | 180 | { |
148 | unsigned long tmp; | ||
149 | |||
150 | /* reset */ | 181 | /* reset */ |
151 | tmp = sh_mmcif_readl(base, MMCIF_CE_VERSION); | 182 | sh_mmcif_writel(base, MMCIF_CE_VERSION, SOFT_RST_ON); |
152 | sh_mmcif_writel(base, MMCIF_CE_VERSION, tmp | 0x80000000); | 183 | sh_mmcif_writel(base, MMCIF_CE_VERSION, SOFT_RST_OFF); |
153 | sh_mmcif_writel(base, MMCIF_CE_VERSION, tmp & ~0x80000000); | ||
154 | 184 | ||
155 | /* byte swap */ | 185 | /* byte swap */ |
156 | sh_mmcif_writel(base, MMCIF_CE_BUF_ACC, 0x00010000); | 186 | sh_mmcif_writel(base, MMCIF_CE_BUF_ACC, BUF_ACC_ATYP); |
157 | 187 | ||
158 | /* Set block size in MMCIF hardware */ | 188 | /* Set block size in MMCIF hardware */ |
159 | sh_mmcif_writel(base, MMCIF_CE_BLOCK_SET, SH_MMCIF_BBS); | 189 | sh_mmcif_writel(base, MMCIF_CE_BLOCK_SET, SH_MMCIF_BBS); |
160 | 190 | ||
161 | /* Enable the clock, set it to Bus clock/256 (about 325Khz)*/ | 191 | /* Enable the clock, set it to Bus clock/256 (about 325Khz). */ |
162 | sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, 0x01072fff); | 192 | sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, |
193 | CLK_ENABLE | CLKDIV_256 | SRSPTO_256 | | ||
194 | SRBSYTO_29 | SRWDTO_29 | SCCSTO_29); | ||
163 | 195 | ||
164 | /* CMD0 */ | 196 | /* CMD0 */ |
165 | sh_mmcif_boot_cmd(base, 0x00000040, 0); | 197 | sh_mmcif_boot_cmd(base, 0x00000040, 0); |
@@ -184,7 +216,9 @@ static inline void sh_mmcif_boot_slurp(void __iomem *base, | |||
184 | unsigned long tmp; | 216 | unsigned long tmp; |
185 | 217 | ||
186 | /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */ | 218 | /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */ |
187 | sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, 0x01012fff); | 219 | sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, |
220 | CLK_ENABLE | CLKDIV_4 | SRSPTO_256 | | ||
221 | SRBSYTO_29 | SRWDTO_29 | SCCSTO_29); | ||
188 | 222 | ||
189 | /* CMD9 - Get CSD */ | 223 | /* CMD9 - Get CSD */ |
190 | sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000); | 224 | sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000); |
diff --git a/include/linux/module.h b/include/linux/module.h index b29e7458b966..8b17fd8c790d 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -308,6 +308,9 @@ struct module | |||
308 | /* The size of the executable code in each section. */ | 308 | /* The size of the executable code in each section. */ |
309 | unsigned int init_text_size, core_text_size; | 309 | unsigned int init_text_size, core_text_size; |
310 | 310 | ||
311 | /* Size of RO sections of the module (text+rodata) */ | ||
312 | unsigned int init_ro_size, core_ro_size; | ||
313 | |||
311 | /* Arch-specific module values */ | 314 | /* Arch-specific module values */ |
312 | struct mod_arch_specific arch; | 315 | struct mod_arch_specific arch; |
313 | 316 | ||
@@ -517,7 +520,7 @@ static inline void __module_get(struct module *module) | |||
517 | #define symbol_put_addr(p) do { } while(0) | 520 | #define symbol_put_addr(p) do { } while(0) |
518 | 521 | ||
519 | #endif /* CONFIG_MODULE_UNLOAD */ | 522 | #endif /* CONFIG_MODULE_UNLOAD */ |
520 | int use_module(struct module *a, struct module *b); | 523 | int ref_module(struct module *a, struct module *b); |
521 | 524 | ||
522 | /* This is a #define so the string doesn't get put in every .o file */ | 525 | /* This is a #define so the string doesn't get put in every .o file */ |
523 | #define module_name(mod) \ | 526 | #define module_name(mod) \ |
@@ -672,7 +675,6 @@ static inline int module_get_iter_tracepoints(struct tracepoint_iter *iter) | |||
672 | { | 675 | { |
673 | return 0; | 676 | return 0; |
674 | } | 677 | } |
675 | |||
676 | #endif /* CONFIG_MODULES */ | 678 | #endif /* CONFIG_MODULES */ |
677 | 679 | ||
678 | #ifdef CONFIG_SYSFS | 680 | #ifdef CONFIG_SYSFS |
@@ -687,6 +689,13 @@ extern int module_sysfs_initialized; | |||
687 | 689 | ||
688 | #define __MODULE_STRING(x) __stringify(x) | 690 | #define __MODULE_STRING(x) __stringify(x) |
689 | 691 | ||
692 | #ifdef CONFIG_DEBUG_SET_MODULE_RONX | ||
693 | extern void set_all_modules_text_rw(void); | ||
694 | extern void set_all_modules_text_ro(void); | ||
695 | #else | ||
696 | static inline void set_all_modules_text_rw(void) { } | ||
697 | static inline void set_all_modules_text_ro(void) { } | ||
698 | #endif | ||
690 | 699 | ||
691 | #ifdef CONFIG_GENERIC_BUG | 700 | #ifdef CONFIG_GENERIC_BUG |
692 | void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, | 701 | void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 5e7a59408dd4..1869ea24a739 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
14 | #include <linux/nodemask.h> | 14 | #include <linux/nodemask.h> |
15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
16 | #include <linux/seqlock.h> | ||
16 | #include <asm/atomic.h> | 17 | #include <asm/atomic.h> |
17 | 18 | ||
18 | struct super_block; | 19 | struct super_block; |
@@ -46,12 +47,24 @@ struct mnt_namespace; | |||
46 | 47 | ||
47 | #define MNT_INTERNAL 0x4000 | 48 | #define MNT_INTERNAL 0x4000 |
48 | 49 | ||
50 | struct mnt_pcp { | ||
51 | int mnt_count; | ||
52 | int mnt_writers; | ||
53 | }; | ||
54 | |||
49 | struct vfsmount { | 55 | struct vfsmount { |
50 | struct list_head mnt_hash; | 56 | struct list_head mnt_hash; |
51 | struct vfsmount *mnt_parent; /* fs we are mounted on */ | 57 | struct vfsmount *mnt_parent; /* fs we are mounted on */ |
52 | struct dentry *mnt_mountpoint; /* dentry of mountpoint */ | 58 | struct dentry *mnt_mountpoint; /* dentry of mountpoint */ |
53 | struct dentry *mnt_root; /* root of the mounted tree */ | 59 | struct dentry *mnt_root; /* root of the mounted tree */ |
54 | struct super_block *mnt_sb; /* pointer to superblock */ | 60 | struct super_block *mnt_sb; /* pointer to superblock */ |
61 | #ifdef CONFIG_SMP | ||
62 | struct mnt_pcp __percpu *mnt_pcp; | ||
63 | atomic_t mnt_longrefs; | ||
64 | #else | ||
65 | int mnt_count; | ||
66 | int mnt_writers; | ||
67 | #endif | ||
55 | struct list_head mnt_mounts; /* list of children, anchored here */ | 68 | struct list_head mnt_mounts; /* list of children, anchored here */ |
56 | struct list_head mnt_child; /* and going through their mnt_child */ | 69 | struct list_head mnt_child; /* and going through their mnt_child */ |
57 | int mnt_flags; | 70 | int mnt_flags; |
@@ -70,57 +83,25 @@ struct vfsmount { | |||
70 | struct mnt_namespace *mnt_ns; /* containing namespace */ | 83 | struct mnt_namespace *mnt_ns; /* containing namespace */ |
71 | int mnt_id; /* mount identifier */ | 84 | int mnt_id; /* mount identifier */ |
72 | int mnt_group_id; /* peer group identifier */ | 85 | int mnt_group_id; /* peer group identifier */ |
73 | /* | ||
74 | * We put mnt_count & mnt_expiry_mark at the end of struct vfsmount | ||
75 | * to let these frequently modified fields in a separate cache line | ||
76 | * (so that reads of mnt_flags wont ping-pong on SMP machines) | ||
77 | */ | ||
78 | atomic_t mnt_count; | ||
79 | int mnt_expiry_mark; /* true if marked for expiry */ | 86 | int mnt_expiry_mark; /* true if marked for expiry */ |
80 | int mnt_pinned; | 87 | int mnt_pinned; |
81 | int mnt_ghosts; | 88 | int mnt_ghosts; |
82 | #ifdef CONFIG_SMP | ||
83 | int __percpu *mnt_writers; | ||
84 | #else | ||
85 | int mnt_writers; | ||
86 | #endif | ||
87 | }; | 89 | }; |
88 | 90 | ||
89 | static inline int *get_mnt_writers_ptr(struct vfsmount *mnt) | ||
90 | { | ||
91 | #ifdef CONFIG_SMP | ||
92 | return mnt->mnt_writers; | ||
93 | #else | ||
94 | return &mnt->mnt_writers; | ||
95 | #endif | ||
96 | } | ||
97 | |||
98 | static inline struct vfsmount *mntget(struct vfsmount *mnt) | ||
99 | { | ||
100 | if (mnt) | ||
101 | atomic_inc(&mnt->mnt_count); | ||
102 | return mnt; | ||
103 | } | ||
104 | |||
105 | struct file; /* forward dec */ | 91 | struct file; /* forward dec */ |
106 | 92 | ||
107 | extern int mnt_want_write(struct vfsmount *mnt); | 93 | extern int mnt_want_write(struct vfsmount *mnt); |
108 | extern int mnt_want_write_file(struct file *file); | 94 | extern int mnt_want_write_file(struct file *file); |
109 | extern int mnt_clone_write(struct vfsmount *mnt); | 95 | extern int mnt_clone_write(struct vfsmount *mnt); |
110 | extern void mnt_drop_write(struct vfsmount *mnt); | 96 | extern void mnt_drop_write(struct vfsmount *mnt); |
111 | extern void mntput_no_expire(struct vfsmount *mnt); | 97 | extern void mntput(struct vfsmount *mnt); |
98 | extern struct vfsmount *mntget(struct vfsmount *mnt); | ||
99 | extern void mntput_long(struct vfsmount *mnt); | ||
100 | extern struct vfsmount *mntget_long(struct vfsmount *mnt); | ||
112 | extern void mnt_pin(struct vfsmount *mnt); | 101 | extern void mnt_pin(struct vfsmount *mnt); |
113 | extern void mnt_unpin(struct vfsmount *mnt); | 102 | extern void mnt_unpin(struct vfsmount *mnt); |
114 | extern int __mnt_is_readonly(struct vfsmount *mnt); | 103 | extern int __mnt_is_readonly(struct vfsmount *mnt); |
115 | 104 | ||
116 | static inline void mntput(struct vfsmount *mnt) | ||
117 | { | ||
118 | if (mnt) { | ||
119 | mnt->mnt_expiry_mark = 0; | ||
120 | mntput_no_expire(mnt); | ||
121 | } | ||
122 | } | ||
123 | |||
124 | extern struct vfsmount *do_kern_mount(const char *fstype, int flags, | 105 | extern struct vfsmount *do_kern_mount(const char *fstype, int flags, |
125 | const char *name, void *data); | 106 | const char *name, void *data); |
126 | 107 | ||
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index f363bc8fdc74..94b48bd40dd7 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -160,4 +160,8 @@ extern int mutex_trylock(struct mutex *lock); | |||
160 | extern void mutex_unlock(struct mutex *lock); | 160 | extern void mutex_unlock(struct mutex *lock); |
161 | extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); | 161 | extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); |
162 | 162 | ||
163 | #ifndef CONFIG_HAVE_ARCH_MUTEX_CPU_RELAX | ||
164 | #define arch_mutex_cpu_relax() cpu_relax() | ||
165 | #endif | ||
166 | |||
163 | #endif | 167 | #endif |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 05b441d93642..18d06add0a40 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -19,7 +19,10 @@ struct nameidata { | |||
19 | struct path path; | 19 | struct path path; |
20 | struct qstr last; | 20 | struct qstr last; |
21 | struct path root; | 21 | struct path root; |
22 | struct file *file; | ||
23 | struct inode *inode; /* path.dentry.d_inode */ | ||
22 | unsigned int flags; | 24 | unsigned int flags; |
25 | unsigned seq; | ||
23 | int last_type; | 26 | int last_type; |
24 | unsigned depth; | 27 | unsigned depth; |
25 | char *saved_names[MAX_NESTED_LINKS + 1]; | 28 | char *saved_names[MAX_NESTED_LINKS + 1]; |
@@ -41,14 +44,15 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
41 | * - require a directory | 44 | * - require a directory |
42 | * - ending slashes ok even for nonexistent files | 45 | * - ending slashes ok even for nonexistent files |
43 | * - internal "there are more path components" flag | 46 | * - internal "there are more path components" flag |
44 | * - locked when lookup done with dcache_lock held | ||
45 | * - dentry cache is untrusted; force a real lookup | 47 | * - dentry cache is untrusted; force a real lookup |
46 | */ | 48 | */ |
47 | #define LOOKUP_FOLLOW 1 | 49 | #define LOOKUP_FOLLOW 0x0001 |
48 | #define LOOKUP_DIRECTORY 2 | 50 | #define LOOKUP_DIRECTORY 0x0002 |
49 | #define LOOKUP_CONTINUE 4 | 51 | #define LOOKUP_CONTINUE 0x0004 |
50 | #define LOOKUP_PARENT 16 | 52 | |
51 | #define LOOKUP_REVAL 64 | 53 | #define LOOKUP_PARENT 0x0010 |
54 | #define LOOKUP_REVAL 0x0020 | ||
55 | #define LOOKUP_RCU 0x0040 | ||
52 | /* | 56 | /* |
53 | * Intent data | 57 | * Intent data |
54 | */ | 58 | */ |
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index ef663061d5ac..1c27f201c856 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h | |||
@@ -184,13 +184,13 @@ struct ncp_entry_info { | |||
184 | __u8 file_handle[6]; | 184 | __u8 file_handle[6]; |
185 | }; | 185 | }; |
186 | 186 | ||
187 | static inline struct ncp_server *NCP_SBP(struct super_block *sb) | 187 | static inline struct ncp_server *NCP_SBP(const struct super_block *sb) |
188 | { | 188 | { |
189 | return sb->s_fs_info; | 189 | return sb->s_fs_info; |
190 | } | 190 | } |
191 | 191 | ||
192 | #define NCP_SERVER(inode) NCP_SBP((inode)->i_sb) | 192 | #define NCP_SERVER(inode) NCP_SBP((inode)->i_sb) |
193 | static inline struct ncp_inode_info *NCP_FINFO(struct inode *inode) | 193 | static inline struct ncp_inode_info *NCP_FINFO(const struct inode *inode) |
194 | { | 194 | { |
195 | return container_of(inode, struct ncp_inode_info, vfs_inode); | 195 | return container_of(inode, struct ncp_inode_info, vfs_inode); |
196 | } | 196 | } |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 578debb801f4..0f6b1c965815 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -493,6 +493,8 @@ static inline void napi_synchronize(const struct napi_struct *n) | |||
493 | enum netdev_queue_state_t { | 493 | enum netdev_queue_state_t { |
494 | __QUEUE_STATE_XOFF, | 494 | __QUEUE_STATE_XOFF, |
495 | __QUEUE_STATE_FROZEN, | 495 | __QUEUE_STATE_FROZEN, |
496 | #define QUEUE_STATE_XOFF_OR_FROZEN ((1 << __QUEUE_STATE_XOFF) | \ | ||
497 | (1 << __QUEUE_STATE_FROZEN)) | ||
496 | }; | 498 | }; |
497 | 499 | ||
498 | struct netdev_queue { | 500 | struct netdev_queue { |
@@ -503,6 +505,12 @@ struct netdev_queue { | |||
503 | struct Qdisc *qdisc; | 505 | struct Qdisc *qdisc; |
504 | unsigned long state; | 506 | unsigned long state; |
505 | struct Qdisc *qdisc_sleeping; | 507 | struct Qdisc *qdisc_sleeping; |
508 | #ifdef CONFIG_RPS | ||
509 | struct kobject kobj; | ||
510 | #endif | ||
511 | #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) | ||
512 | int numa_node; | ||
513 | #endif | ||
506 | /* | 514 | /* |
507 | * write mostly part | 515 | * write mostly part |
508 | */ | 516 | */ |
@@ -517,6 +525,22 @@ struct netdev_queue { | |||
517 | u64 tx_dropped; | 525 | u64 tx_dropped; |
518 | } ____cacheline_aligned_in_smp; | 526 | } ____cacheline_aligned_in_smp; |
519 | 527 | ||
528 | static inline int netdev_queue_numa_node_read(const struct netdev_queue *q) | ||
529 | { | ||
530 | #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) | ||
531 | return q->numa_node; | ||
532 | #else | ||
533 | return NUMA_NO_NODE; | ||
534 | #endif | ||
535 | } | ||
536 | |||
537 | static inline void netdev_queue_numa_node_write(struct netdev_queue *q, int node) | ||
538 | { | ||
539 | #if defined(CONFIG_XPS) && defined(CONFIG_NUMA) | ||
540 | q->numa_node = node; | ||
541 | #endif | ||
542 | } | ||
543 | |||
520 | #ifdef CONFIG_RPS | 544 | #ifdef CONFIG_RPS |
521 | /* | 545 | /* |
522 | * This structure holds an RPS map which can be of variable length. The | 546 | * This structure holds an RPS map which can be of variable length. The |
@@ -592,11 +616,36 @@ struct netdev_rx_queue { | |||
592 | struct rps_map __rcu *rps_map; | 616 | struct rps_map __rcu *rps_map; |
593 | struct rps_dev_flow_table __rcu *rps_flow_table; | 617 | struct rps_dev_flow_table __rcu *rps_flow_table; |
594 | struct kobject kobj; | 618 | struct kobject kobj; |
595 | struct netdev_rx_queue *first; | 619 | struct net_device *dev; |
596 | atomic_t count; | ||
597 | } ____cacheline_aligned_in_smp; | 620 | } ____cacheline_aligned_in_smp; |
598 | #endif /* CONFIG_RPS */ | 621 | #endif /* CONFIG_RPS */ |
599 | 622 | ||
623 | #ifdef CONFIG_XPS | ||
624 | /* | ||
625 | * This structure holds an XPS map which can be of variable length. The | ||
626 | * map is an array of queues. | ||
627 | */ | ||
628 | struct xps_map { | ||
629 | unsigned int len; | ||
630 | unsigned int alloc_len; | ||
631 | struct rcu_head rcu; | ||
632 | u16 queues[0]; | ||
633 | }; | ||
634 | #define XPS_MAP_SIZE(_num) (sizeof(struct xps_map) + (_num * sizeof(u16))) | ||
635 | #define XPS_MIN_MAP_ALLOC ((L1_CACHE_BYTES - sizeof(struct xps_map)) \ | ||
636 | / sizeof(u16)) | ||
637 | |||
638 | /* | ||
639 | * This structure holds all XPS maps for device. Maps are indexed by CPU. | ||
640 | */ | ||
641 | struct xps_dev_maps { | ||
642 | struct rcu_head rcu; | ||
643 | struct xps_map __rcu *cpu_map[0]; | ||
644 | }; | ||
645 | #define XPS_DEV_MAPS_SIZE (sizeof(struct xps_dev_maps) + \ | ||
646 | (nr_cpu_ids * sizeof(struct xps_map *))) | ||
647 | #endif /* CONFIG_XPS */ | ||
648 | |||
600 | /* | 649 | /* |
601 | * This structure defines the management hooks for network devices. | 650 | * This structure defines the management hooks for network devices. |
602 | * The following hooks can be defined; unless noted otherwise, they are | 651 | * The following hooks can be defined; unless noted otherwise, they are |
@@ -683,7 +732,7 @@ struct netdev_rx_queue { | |||
683 | * neither operation. | 732 | * neither operation. |
684 | * | 733 | * |
685 | * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp); | 734 | * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp); |
686 | * If device support VLAN receive accleration | 735 | * If device support VLAN receive acceleration |
687 | * (ie. dev->features & NETIF_F_HW_VLAN_RX), then this function is called | 736 | * (ie. dev->features & NETIF_F_HW_VLAN_RX), then this function is called |
688 | * when vlan groups for the device changes. Note: grp is NULL | 737 | * when vlan groups for the device changes. Note: grp is NULL |
689 | * if no vlan's groups are being used. | 738 | * if no vlan's groups are being used. |
@@ -995,8 +1044,8 @@ struct net_device { | |||
995 | unsigned int real_num_rx_queues; | 1044 | unsigned int real_num_rx_queues; |
996 | #endif | 1045 | #endif |
997 | 1046 | ||
998 | rx_handler_func_t *rx_handler; | 1047 | rx_handler_func_t __rcu *rx_handler; |
999 | void *rx_handler_data; | 1048 | void __rcu *rx_handler_data; |
1000 | 1049 | ||
1001 | struct netdev_queue __rcu *ingress_queue; | 1050 | struct netdev_queue __rcu *ingress_queue; |
1002 | 1051 | ||
@@ -1017,6 +1066,10 @@ struct net_device { | |||
1017 | unsigned long tx_queue_len; /* Max frames per queue allowed */ | 1066 | unsigned long tx_queue_len; /* Max frames per queue allowed */ |
1018 | spinlock_t tx_global_lock; | 1067 | spinlock_t tx_global_lock; |
1019 | 1068 | ||
1069 | #ifdef CONFIG_XPS | ||
1070 | struct xps_dev_maps __rcu *xps_maps; | ||
1071 | #endif | ||
1072 | |||
1020 | /* These may be needed for future network-power-down code. */ | 1073 | /* These may be needed for future network-power-down code. */ |
1021 | 1074 | ||
1022 | /* | 1075 | /* |
@@ -1307,7 +1360,8 @@ static inline struct net_device *first_net_device(struct net *net) | |||
1307 | 1360 | ||
1308 | extern int netdev_boot_setup_check(struct net_device *dev); | 1361 | extern int netdev_boot_setup_check(struct net_device *dev); |
1309 | extern unsigned long netdev_boot_base(const char *prefix, int unit); | 1362 | extern unsigned long netdev_boot_base(const char *prefix, int unit); |
1310 | extern struct net_device *dev_getbyhwaddr(struct net *net, unsigned short type, char *hwaddr); | 1363 | extern struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type, |
1364 | const char *hwaddr); | ||
1311 | extern struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type); | 1365 | extern struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type); |
1312 | extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type); | 1366 | extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type); |
1313 | extern void dev_add_pack(struct packet_type *pt); | 1367 | extern void dev_add_pack(struct packet_type *pt); |
@@ -1600,9 +1654,9 @@ static inline int netif_queue_stopped(const struct net_device *dev) | |||
1600 | return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); | 1654 | return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); |
1601 | } | 1655 | } |
1602 | 1656 | ||
1603 | static inline int netif_tx_queue_frozen(const struct netdev_queue *dev_queue) | 1657 | static inline int netif_tx_queue_frozen_or_stopped(const struct netdev_queue *dev_queue) |
1604 | { | 1658 | { |
1605 | return test_bit(__QUEUE_STATE_FROZEN, &dev_queue->state); | 1659 | return dev_queue->state & QUEUE_STATE_XOFF_OR_FROZEN; |
1606 | } | 1660 | } |
1607 | 1661 | ||
1608 | /** | 1662 | /** |
@@ -1693,6 +1747,16 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) | |||
1693 | __netif_schedule(txq->qdisc); | 1747 | __netif_schedule(txq->qdisc); |
1694 | } | 1748 | } |
1695 | 1749 | ||
1750 | /* | ||
1751 | * Returns a Tx hash for the given packet when dev->real_num_tx_queues is used | ||
1752 | * as a distribution range limit for the returned value. | ||
1753 | */ | ||
1754 | static inline u16 skb_tx_hash(const struct net_device *dev, | ||
1755 | const struct sk_buff *skb) | ||
1756 | { | ||
1757 | return __skb_tx_hash(dev, skb, dev->real_num_tx_queues); | ||
1758 | } | ||
1759 | |||
1696 | /** | 1760 | /** |
1697 | * netif_is_multiqueue - test if device has multiple transmit queues | 1761 | * netif_is_multiqueue - test if device has multiple transmit queues |
1698 | * @dev: network device | 1762 | * @dev: network device |
@@ -2239,6 +2303,8 @@ unsigned long netdev_fix_features(unsigned long features, const char *name); | |||
2239 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, | 2303 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, |
2240 | struct net_device *dev); | 2304 | struct net_device *dev); |
2241 | 2305 | ||
2306 | int netif_get_vlan_features(struct sk_buff *skb, struct net_device *dev); | ||
2307 | |||
2242 | static inline int net_gso_ok(int features, int gso_type) | 2308 | static inline int net_gso_ok(int features, int gso_type) |
2243 | { | 2309 | { |
2244 | int feature = gso_type << NETIF_F_GSO_SHIFT; | 2310 | int feature = gso_type << NETIF_F_GSO_SHIFT; |
@@ -2254,10 +2320,7 @@ static inline int skb_gso_ok(struct sk_buff *skb, int features) | |||
2254 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | 2320 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) |
2255 | { | 2321 | { |
2256 | if (skb_is_gso(skb)) { | 2322 | if (skb_is_gso(skb)) { |
2257 | int features = dev->features; | 2323 | int features = netif_get_vlan_features(skb, dev); |
2258 | |||
2259 | if (skb->protocol == htons(ETH_P_8021Q) || skb->vlan_tci) | ||
2260 | features &= dev->vlan_features; | ||
2261 | 2324 | ||
2262 | return (!skb_gso_ok(skb, features) || | 2325 | return (!skb_gso_ok(skb, features) || |
2263 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); | 2326 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 928a35ec21c7..0ab7ca787b22 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -33,6 +33,8 @@ | |||
33 | 33 | ||
34 | #define NF_QUEUE_NR(x) ((((x) << NF_VERDICT_BITS) & NF_VERDICT_QMASK) | NF_QUEUE) | 34 | #define NF_QUEUE_NR(x) ((((x) << NF_VERDICT_BITS) & NF_VERDICT_QMASK) | NF_QUEUE) |
35 | 35 | ||
36 | #define NF_DROP_ERR(x) (((-x) << NF_VERDICT_BITS) | NF_DROP) | ||
37 | |||
36 | /* only for userspace compatibility */ | 38 | /* only for userspace compatibility */ |
37 | #ifndef __KERNEL__ | 39 | #ifndef __KERNEL__ |
38 | /* Generic cache responses from hook functions. | 40 | /* Generic cache responses from hook functions. |
@@ -215,7 +217,7 @@ NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sk_buff *skb, | |||
215 | int ret; | 217 | int ret; |
216 | 218 | ||
217 | if (!cond || | 219 | if (!cond || |
218 | (ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN) == 1)) | 220 | ((ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN)) == 1)) |
219 | ret = okfn(skb); | 221 | ret = okfn(skb); |
220 | return ret; | 222 | return ret; |
221 | } | 223 | } |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 742bec051440..0f04d985b41c 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -611,8 +611,9 @@ struct _compat_xt_align { | |||
611 | extern void xt_compat_lock(u_int8_t af); | 611 | extern void xt_compat_lock(u_int8_t af); |
612 | extern void xt_compat_unlock(u_int8_t af); | 612 | extern void xt_compat_unlock(u_int8_t af); |
613 | 613 | ||
614 | extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta); | 614 | extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, int delta); |
615 | extern void xt_compat_flush_offsets(u_int8_t af); | 615 | extern void xt_compat_flush_offsets(u_int8_t af); |
616 | extern void xt_compat_init_offsets(u_int8_t af, unsigned int number); | ||
616 | extern int xt_compat_calc_jump(u_int8_t af, unsigned int offset); | 617 | extern int xt_compat_calc_jump(u_int8_t af, unsigned int offset); |
617 | 618 | ||
618 | extern int xt_compat_match_offset(const struct xt_match *match); | 619 | extern int xt_compat_match_offset(const struct xt_match *match); |
diff --git a/include/linux/netfilter/xt_comment.h b/include/linux/netfilter/xt_comment.h index eacfedc6b5d0..0ea5e79f5bd7 100644 --- a/include/linux/netfilter/xt_comment.h +++ b/include/linux/netfilter/xt_comment.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #define XT_MAX_COMMENT_LEN 256 | 4 | #define XT_MAX_COMMENT_LEN 256 |
5 | 5 | ||
6 | struct xt_comment_info { | 6 | struct xt_comment_info { |
7 | unsigned char comment[XT_MAX_COMMENT_LEN]; | 7 | char comment[XT_MAX_COMMENT_LEN]; |
8 | }; | 8 | }; |
9 | 9 | ||
10 | #endif /* XT_COMMENT_H */ | 10 | #endif /* XT_COMMENT_H */ |
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h index 54f47a2f6152..74b904d8f99c 100644 --- a/include/linux/netfilter/xt_conntrack.h +++ b/include/linux/netfilter/xt_conntrack.h | |||
@@ -58,4 +58,19 @@ struct xt_conntrack_mtinfo2 { | |||
58 | __u16 state_mask, status_mask; | 58 | __u16 state_mask, status_mask; |
59 | }; | 59 | }; |
60 | 60 | ||
61 | struct xt_conntrack_mtinfo3 { | ||
62 | union nf_inet_addr origsrc_addr, origsrc_mask; | ||
63 | union nf_inet_addr origdst_addr, origdst_mask; | ||
64 | union nf_inet_addr replsrc_addr, replsrc_mask; | ||
65 | union nf_inet_addr repldst_addr, repldst_mask; | ||
66 | __u32 expires_min, expires_max; | ||
67 | __u16 l4proto; | ||
68 | __u16 origsrc_port, origdst_port; | ||
69 | __u16 replsrc_port, repldst_port; | ||
70 | __u16 match_flags, invert_flags; | ||
71 | __u16 state_mask, status_mask; | ||
72 | __u16 origsrc_port_high, origdst_port_high; | ||
73 | __u16 replsrc_port_high, repldst_port_high; | ||
74 | }; | ||
75 | |||
61 | #endif /*_XT_CONNTRACK_H*/ | 76 | #endif /*_XT_CONNTRACK_H*/ |
diff --git a/include/linux/netfilter_bridge/ebt_ip6.h b/include/linux/netfilter_bridge/ebt_ip6.h index e5de98701519..22af18a3c16b 100644 --- a/include/linux/netfilter_bridge/ebt_ip6.h +++ b/include/linux/netfilter_bridge/ebt_ip6.h | |||
@@ -18,8 +18,11 @@ | |||
18 | #define EBT_IP6_PROTO 0x08 | 18 | #define EBT_IP6_PROTO 0x08 |
19 | #define EBT_IP6_SPORT 0x10 | 19 | #define EBT_IP6_SPORT 0x10 |
20 | #define EBT_IP6_DPORT 0x20 | 20 | #define EBT_IP6_DPORT 0x20 |
21 | #define EBT_IP6_ICMP6 0x40 | ||
22 | |||
21 | #define EBT_IP6_MASK (EBT_IP6_SOURCE | EBT_IP6_DEST | EBT_IP6_TCLASS |\ | 23 | #define EBT_IP6_MASK (EBT_IP6_SOURCE | EBT_IP6_DEST | EBT_IP6_TCLASS |\ |
22 | EBT_IP6_PROTO | EBT_IP6_SPORT | EBT_IP6_DPORT) | 24 | EBT_IP6_PROTO | EBT_IP6_SPORT | EBT_IP6_DPORT | \ |
25 | EBT_IP6_ICMP6) | ||
23 | #define EBT_IP6_MATCH "ip6" | 26 | #define EBT_IP6_MATCH "ip6" |
24 | 27 | ||
25 | /* the same values are used for the invflags */ | 28 | /* the same values are used for the invflags */ |
@@ -32,8 +35,14 @@ struct ebt_ip6_info { | |||
32 | uint8_t protocol; | 35 | uint8_t protocol; |
33 | uint8_t bitmask; | 36 | uint8_t bitmask; |
34 | uint8_t invflags; | 37 | uint8_t invflags; |
35 | uint16_t sport[2]; | 38 | union { |
36 | uint16_t dport[2]; | 39 | uint16_t sport[2]; |
40 | uint8_t icmpv6_type[2]; | ||
41 | }; | ||
42 | union { | ||
43 | uint16_t dport[2]; | ||
44 | uint8_t icmpv6_code[2]; | ||
45 | }; | ||
37 | }; | 46 | }; |
38 | 47 | ||
39 | #endif | 48 | #endif |
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..0779bb8f95be 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -351,7 +351,7 @@ extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); | |||
351 | extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); | 351 | extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); |
352 | extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); | 352 | extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); |
353 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 353 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
354 | extern int nfs_permission(struct inode *, int); | 354 | extern int nfs_permission(struct inode *, int, unsigned int); |
355 | extern int nfs_open(struct inode *, struct file *); | 355 | extern int nfs_open(struct inode *, struct file *); |
356 | extern int nfs_release(struct inode *, struct file *); | 356 | extern int nfs_release(struct inode *, struct file *); |
357 | extern int nfs_attribute_timeout(struct inode *inode); | 357 | extern int nfs_attribute_timeout(struct inode *inode); |
@@ -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/nl80211.h b/include/linux/nl80211.h index 0edb2566c14c..2b89b712565b 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -172,10 +172,10 @@ | |||
172 | * to the specified ISO/IEC 3166-1 alpha2 country code. The core will | 172 | * to the specified ISO/IEC 3166-1 alpha2 country code. The core will |
173 | * store this as a valid request and then query userspace for it. | 173 | * store this as a valid request and then query userspace for it. |
174 | * | 174 | * |
175 | * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the | 175 | * @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the |
176 | * interface identified by %NL80211_ATTR_IFINDEX | 176 | * interface identified by %NL80211_ATTR_IFINDEX |
177 | * | 177 | * |
178 | * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the | 178 | * @NL80211_CMD_SET_MESH_CONFIG: Set mesh networking properties for the |
179 | * interface identified by %NL80211_ATTR_IFINDEX | 179 | * interface identified by %NL80211_ATTR_IFINDEX |
180 | * | 180 | * |
181 | * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The | 181 | * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The |
@@ -358,11 +358,16 @@ | |||
358 | * user space application). %NL80211_ATTR_FRAME is used to specify the | 358 | * user space application). %NL80211_ATTR_FRAME is used to specify the |
359 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and | 359 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and |
360 | * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on | 360 | * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on |
361 | * which channel the frame is to be transmitted or was received. This | 361 | * which channel the frame is to be transmitted or was received. If this |
362 | * channel has to be the current channel (remain-on-channel or the | 362 | * channel is not the current channel (remain-on-channel or the |
363 | * operational channel). When called, this operation returns a cookie | 363 | * operational channel) the device will switch to the given channel and |
364 | * (%NL80211_ATTR_COOKIE) that will be included with the TX status event | 364 | * transmit the frame, optionally waiting for a response for the time |
365 | * pertaining to the TX request. | 365 | * specified using %NL80211_ATTR_DURATION. When called, this operation |
366 | * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the | ||
367 | * TX status event pertaining to the TX request. | ||
368 | * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this | ||
369 | * command may be used with the corresponding cookie to cancel the wait | ||
370 | * time if it is known that it is no longer necessary. | ||
366 | * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility. | 371 | * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility. |
367 | * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame | 372 | * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame |
368 | * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies | 373 | * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies |
@@ -389,6 +394,18 @@ | |||
389 | * | 394 | * |
390 | * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. | 395 | * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. |
391 | * | 396 | * |
397 | * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial | ||
398 | * mesh config parameters may be given. | ||
399 | * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the | ||
400 | * network is determined by the network interface. | ||
401 | * | ||
402 | * @NL80211_CMD_UNPROT_DEAUTHENTICATE: Unprotected deauthentication frame | ||
403 | * notification. This event is used to indicate that an unprotected | ||
404 | * deauthentication frame was dropped when MFP is in use. | ||
405 | * @NL80211_CMD_UNPROT_DISASSOCIATE: Unprotected disassociation frame | ||
406 | * notification. This event is used to indicate that an unprotected | ||
407 | * disassociation frame was dropped when MFP is in use. | ||
408 | * | ||
392 | * @NL80211_CMD_MAX: highest used command number | 409 | * @NL80211_CMD_MAX: highest used command number |
393 | * @__NL80211_CMD_AFTER_LAST: internal use | 410 | * @__NL80211_CMD_AFTER_LAST: internal use |
394 | */ | 411 | */ |
@@ -431,8 +448,8 @@ enum nl80211_commands { | |||
431 | NL80211_CMD_SET_REG, | 448 | NL80211_CMD_SET_REG, |
432 | NL80211_CMD_REQ_SET_REG, | 449 | NL80211_CMD_REQ_SET_REG, |
433 | 450 | ||
434 | NL80211_CMD_GET_MESH_PARAMS, | 451 | NL80211_CMD_GET_MESH_CONFIG, |
435 | NL80211_CMD_SET_MESH_PARAMS, | 452 | NL80211_CMD_SET_MESH_CONFIG, |
436 | 453 | ||
437 | NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */, | 454 | NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */, |
438 | 455 | ||
@@ -493,6 +510,14 @@ enum nl80211_commands { | |||
493 | NL80211_CMD_SET_CHANNEL, | 510 | NL80211_CMD_SET_CHANNEL, |
494 | NL80211_CMD_SET_WDS_PEER, | 511 | NL80211_CMD_SET_WDS_PEER, |
495 | 512 | ||
513 | NL80211_CMD_FRAME_WAIT_CANCEL, | ||
514 | |||
515 | NL80211_CMD_JOIN_MESH, | ||
516 | NL80211_CMD_LEAVE_MESH, | ||
517 | |||
518 | NL80211_CMD_UNPROT_DEAUTHENTICATE, | ||
519 | NL80211_CMD_UNPROT_DISASSOCIATE, | ||
520 | |||
496 | /* add new commands above here */ | 521 | /* add new commands above here */ |
497 | 522 | ||
498 | /* used to define NL80211_CMD_MAX below */ | 523 | /* used to define NL80211_CMD_MAX below */ |
@@ -513,6 +538,10 @@ enum nl80211_commands { | |||
513 | #define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE | 538 | #define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE |
514 | #define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT | 539 | #define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT |
515 | 540 | ||
541 | /* source-level API compatibility */ | ||
542 | #define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG | ||
543 | #define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG | ||
544 | |||
516 | /** | 545 | /** |
517 | * enum nl80211_attrs - nl80211 netlink attributes | 546 | * enum nl80211_attrs - nl80211 netlink attributes |
518 | * | 547 | * |
@@ -758,6 +787,9 @@ enum nl80211_commands { | |||
758 | * cache, a wiphy attribute. | 787 | * cache, a wiphy attribute. |
759 | * | 788 | * |
760 | * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32. | 789 | * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32. |
790 | * @NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION: Device attribute that | ||
791 | * specifies the maximum duration that can be requested with the | ||
792 | * remain-on-channel operation, in milliseconds, u32. | ||
761 | * | 793 | * |
762 | * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects. | 794 | * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects. |
763 | * | 795 | * |
@@ -804,6 +836,51 @@ enum nl80211_commands { | |||
804 | * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly | 836 | * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly |
805 | * means support for per-station GTKs. | 837 | * means support for per-station GTKs. |
806 | * | 838 | * |
839 | * @NL80211_ATTR_WIPHY_ANTENNA_TX: Bitmap of allowed antennas for transmitting. | ||
840 | * This can be used to mask out antennas which are not attached or should | ||
841 | * not be used for transmitting. If an antenna is not selected in this | ||
842 | * bitmap the hardware is not allowed to transmit on this antenna. | ||
843 | * | ||
844 | * Each bit represents one antenna, starting with antenna 1 at the first | ||
845 | * bit. Depending on which antennas are selected in the bitmap, 802.11n | ||
846 | * drivers can derive which chainmasks to use (if all antennas belonging to | ||
847 | * a particular chain are disabled this chain should be disabled) and if | ||
848 | * a chain has diversity antennas wether diversity should be used or not. | ||
849 | * HT capabilities (STBC, TX Beamforming, Antenna selection) can be | ||
850 | * derived from the available chains after applying the antenna mask. | ||
851 | * Non-802.11n drivers can derive wether to use diversity or not. | ||
852 | * Drivers may reject configurations or RX/TX mask combinations they cannot | ||
853 | * support by returning -EINVAL. | ||
854 | * | ||
855 | * @NL80211_ATTR_WIPHY_ANTENNA_RX: Bitmap of allowed antennas for receiving. | ||
856 | * This can be used to mask out antennas which are not attached or should | ||
857 | * not be used for receiving. If an antenna is not selected in this bitmap | ||
858 | * the hardware should not be configured to receive on this antenna. | ||
859 | * For a more detailed descripton see @NL80211_ATTR_WIPHY_ANTENNA_TX. | ||
860 | * | ||
861 | * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available | ||
862 | * for configuration as TX antennas via the above parameters. | ||
863 | * | ||
864 | * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available | ||
865 | * for configuration as RX antennas via the above parameters. | ||
866 | * | ||
867 | * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS | ||
868 | * | ||
869 | * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be | ||
870 | * transmitted on another channel when the channel given doesn't match | ||
871 | * the current channel. If the current channel doesn't match and this | ||
872 | * flag isn't set, the frame will be rejected. This is also used as an | ||
873 | * nl80211 capability flag. | ||
874 | * | ||
875 | * @NL80211_ATTR_BSS_HTOPMODE: HT operation mode (u16) | ||
876 | * | ||
877 | * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags | ||
878 | * attributes, specifying what a key should be set as default as. | ||
879 | * See &enum nl80211_key_default_types. | ||
880 | * | ||
881 | * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters. These cannot be | ||
882 | * changed once the mesh is active. | ||
883 | * | ||
807 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 884 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
808 | * @__NL80211_ATTR_AFTER_LAST: internal use | 885 | * @__NL80211_ATTR_AFTER_LAST: internal use |
809 | */ | 886 | */ |
@@ -858,7 +935,7 @@ enum nl80211_attrs { | |||
858 | NL80211_ATTR_REG_ALPHA2, | 935 | NL80211_ATTR_REG_ALPHA2, |
859 | NL80211_ATTR_REG_RULES, | 936 | NL80211_ATTR_REG_RULES, |
860 | 937 | ||
861 | NL80211_ATTR_MESH_PARAMS, | 938 | NL80211_ATTR_MESH_CONFIG, |
862 | 939 | ||
863 | NL80211_ATTR_BSS_BASIC_RATES, | 940 | NL80211_ATTR_BSS_BASIC_RATES, |
864 | 941 | ||
@@ -973,6 +1050,24 @@ enum nl80211_attrs { | |||
973 | 1050 | ||
974 | NL80211_ATTR_SUPPORT_IBSS_RSN, | 1051 | NL80211_ATTR_SUPPORT_IBSS_RSN, |
975 | 1052 | ||
1053 | NL80211_ATTR_WIPHY_ANTENNA_TX, | ||
1054 | NL80211_ATTR_WIPHY_ANTENNA_RX, | ||
1055 | |||
1056 | NL80211_ATTR_MCAST_RATE, | ||
1057 | |||
1058 | NL80211_ATTR_OFFCHANNEL_TX_OK, | ||
1059 | |||
1060 | NL80211_ATTR_BSS_HT_OPMODE, | ||
1061 | |||
1062 | NL80211_ATTR_KEY_DEFAULT_TYPES, | ||
1063 | |||
1064 | NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION, | ||
1065 | |||
1066 | NL80211_ATTR_MESH_SETUP, | ||
1067 | |||
1068 | NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX, | ||
1069 | NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX, | ||
1070 | |||
976 | /* add attributes here, update the policy in nl80211.c */ | 1071 | /* add attributes here, update the policy in nl80211.c */ |
977 | 1072 | ||
978 | __NL80211_ATTR_AFTER_LAST, | 1073 | __NL80211_ATTR_AFTER_LAST, |
@@ -981,6 +1076,7 @@ enum nl80211_attrs { | |||
981 | 1076 | ||
982 | /* source-level API compatibility */ | 1077 | /* source-level API compatibility */ |
983 | #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION | 1078 | #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION |
1079 | #define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG | ||
984 | 1080 | ||
985 | /* | 1081 | /* |
986 | * Allow user space programs to use #ifdef on new attributes by defining them | 1082 | * Allow user space programs to use #ifdef on new attributes by defining them |
@@ -1139,6 +1235,7 @@ enum nl80211_rate_info { | |||
1139 | * station) | 1235 | * station) |
1140 | * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) | 1236 | * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) |
1141 | * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) | 1237 | * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) |
1238 | * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm) | ||
1142 | */ | 1239 | */ |
1143 | enum nl80211_sta_info { | 1240 | enum nl80211_sta_info { |
1144 | __NL80211_STA_INFO_INVALID, | 1241 | __NL80211_STA_INFO_INVALID, |
@@ -1154,6 +1251,7 @@ enum nl80211_sta_info { | |||
1154 | NL80211_STA_INFO_TX_PACKETS, | 1251 | NL80211_STA_INFO_TX_PACKETS, |
1155 | NL80211_STA_INFO_TX_RETRIES, | 1252 | NL80211_STA_INFO_TX_RETRIES, |
1156 | NL80211_STA_INFO_TX_FAILED, | 1253 | NL80211_STA_INFO_TX_FAILED, |
1254 | NL80211_STA_INFO_SIGNAL_AVG, | ||
1157 | 1255 | ||
1158 | /* keep last */ | 1256 | /* keep last */ |
1159 | __NL80211_STA_INFO_AFTER_LAST, | 1257 | __NL80211_STA_INFO_AFTER_LAST, |
@@ -1307,7 +1405,11 @@ enum nl80211_bitrate_attr { | |||
1307 | * wireless core it thinks its knows the regulatory domain we should be in. | 1405 | * wireless core it thinks its knows the regulatory domain we should be in. |
1308 | * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an | 1406 | * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an |
1309 | * 802.11 country information element with regulatory information it | 1407 | * 802.11 country information element with regulatory information it |
1310 | * thinks we should consider. | 1408 | * thinks we should consider. cfg80211 only processes the country |
1409 | * code from the IE, and relies on the regulatory domain information | ||
1410 | * structure pased by userspace (CRDA) from our wireless-regdb. | ||
1411 | * If a channel is enabled but the country code indicates it should | ||
1412 | * be disabled we disable the channel and re-enable it upon disassociation. | ||
1311 | */ | 1413 | */ |
1312 | enum nl80211_reg_initiator { | 1414 | enum nl80211_reg_initiator { |
1313 | NL80211_REGDOM_SET_BY_CORE, | 1415 | NL80211_REGDOM_SET_BY_CORE, |
@@ -1476,7 +1578,8 @@ enum nl80211_mntr_flags { | |||
1476 | /** | 1578 | /** |
1477 | * enum nl80211_meshconf_params - mesh configuration parameters | 1579 | * enum nl80211_meshconf_params - mesh configuration parameters |
1478 | * | 1580 | * |
1479 | * Mesh configuration parameters | 1581 | * Mesh configuration parameters. These can be changed while the mesh is |
1582 | * active. | ||
1480 | * | 1583 | * |
1481 | * @__NL80211_MESHCONF_INVALID: internal use | 1584 | * @__NL80211_MESHCONF_INVALID: internal use |
1482 | * | 1585 | * |
@@ -1525,6 +1628,9 @@ enum nl80211_mntr_flags { | |||
1525 | * | 1628 | * |
1526 | * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not | 1629 | * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not |
1527 | * | 1630 | * |
1631 | * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a | ||
1632 | * source mesh point for path selection elements. | ||
1633 | * | ||
1528 | * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute | 1634 | * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute |
1529 | * | 1635 | * |
1530 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use | 1636 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use |
@@ -1545,6 +1651,7 @@ enum nl80211_meshconf_params { | |||
1545 | NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, | 1651 | NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, |
1546 | NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, | 1652 | NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, |
1547 | NL80211_MESHCONF_HWMP_ROOTMODE, | 1653 | NL80211_MESHCONF_HWMP_ROOTMODE, |
1654 | NL80211_MESHCONF_ELEMENT_TTL, | ||
1548 | 1655 | ||
1549 | /* keep last */ | 1656 | /* keep last */ |
1550 | __NL80211_MESHCONF_ATTR_AFTER_LAST, | 1657 | __NL80211_MESHCONF_ATTR_AFTER_LAST, |
@@ -1552,6 +1659,39 @@ enum nl80211_meshconf_params { | |||
1552 | }; | 1659 | }; |
1553 | 1660 | ||
1554 | /** | 1661 | /** |
1662 | * enum nl80211_mesh_setup_params - mesh setup parameters | ||
1663 | * | ||
1664 | * Mesh setup parameters. These are used to start/join a mesh and cannot be | ||
1665 | * changed while the mesh is active. | ||
1666 | * | ||
1667 | * @__NL80211_MESH_SETUP_INVALID: Internal use | ||
1668 | * | ||
1669 | * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a | ||
1670 | * vendor specific path selection algorithm or disable it to use the default | ||
1671 | * HWMP. | ||
1672 | * | ||
1673 | * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a | ||
1674 | * vendor specific path metric or disable it to use the default Airtime | ||
1675 | * metric. | ||
1676 | * | ||
1677 | * @NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE: A vendor specific information | ||
1678 | * element that vendors will use to identify the path selection methods and | ||
1679 | * metrics in use. | ||
1680 | * | ||
1681 | * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use | ||
1682 | */ | ||
1683 | enum nl80211_mesh_setup_params { | ||
1684 | __NL80211_MESH_SETUP_INVALID, | ||
1685 | NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL, | ||
1686 | NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC, | ||
1687 | NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE, | ||
1688 | |||
1689 | /* keep last */ | ||
1690 | __NL80211_MESH_SETUP_ATTR_AFTER_LAST, | ||
1691 | NL80211_MESH_SETUP_ATTR_MAX = __NL80211_MESH_SETUP_ATTR_AFTER_LAST - 1 | ||
1692 | }; | ||
1693 | |||
1694 | /** | ||
1555 | * enum nl80211_txq_attr - TX queue parameter attributes | 1695 | * enum nl80211_txq_attr - TX queue parameter attributes |
1556 | * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved | 1696 | * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved |
1557 | * @NL80211_TXQ_ATTR_QUEUE: TX queue identifier (NL80211_TXQ_Q_*) | 1697 | * @NL80211_TXQ_ATTR_QUEUE: TX queue identifier (NL80211_TXQ_Q_*) |
@@ -1709,6 +1849,23 @@ enum nl80211_wpa_versions { | |||
1709 | }; | 1849 | }; |
1710 | 1850 | ||
1711 | /** | 1851 | /** |
1852 | * enum nl80211_key_default_types - key default types | ||
1853 | * @__NL80211_KEY_DEFAULT_TYPE_INVALID: invalid | ||
1854 | * @NL80211_KEY_DEFAULT_TYPE_UNICAST: key should be used as default | ||
1855 | * unicast key | ||
1856 | * @NL80211_KEY_DEFAULT_TYPE_MULTICAST: key should be used as default | ||
1857 | * multicast key | ||
1858 | * @NUM_NL80211_KEY_DEFAULT_TYPES: number of default types | ||
1859 | */ | ||
1860 | enum nl80211_key_default_types { | ||
1861 | __NL80211_KEY_DEFAULT_TYPE_INVALID, | ||
1862 | NL80211_KEY_DEFAULT_TYPE_UNICAST, | ||
1863 | NL80211_KEY_DEFAULT_TYPE_MULTICAST, | ||
1864 | |||
1865 | NUM_NL80211_KEY_DEFAULT_TYPES | ||
1866 | }; | ||
1867 | |||
1868 | /** | ||
1712 | * enum nl80211_key_attributes - key attributes | 1869 | * enum nl80211_key_attributes - key attributes |
1713 | * @__NL80211_KEY_INVALID: invalid | 1870 | * @__NL80211_KEY_INVALID: invalid |
1714 | * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of | 1871 | * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of |
@@ -1724,6 +1881,9 @@ enum nl80211_wpa_versions { | |||
1724 | * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not | 1881 | * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not |
1725 | * specified the default depends on whether a MAC address was | 1882 | * specified the default depends on whether a MAC address was |
1726 | * given with the command using the key or not (u32) | 1883 | * given with the command using the key or not (u32) |
1884 | * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags | ||
1885 | * attributes, specifying what a key should be set as default as. | ||
1886 | * See &enum nl80211_key_default_types. | ||
1727 | * @__NL80211_KEY_AFTER_LAST: internal | 1887 | * @__NL80211_KEY_AFTER_LAST: internal |
1728 | * @NL80211_KEY_MAX: highest key attribute | 1888 | * @NL80211_KEY_MAX: highest key attribute |
1729 | */ | 1889 | */ |
@@ -1736,6 +1896,7 @@ enum nl80211_key_attributes { | |||
1736 | NL80211_KEY_DEFAULT, | 1896 | NL80211_KEY_DEFAULT, |
1737 | NL80211_KEY_DEFAULT_MGMT, | 1897 | NL80211_KEY_DEFAULT_MGMT, |
1738 | NL80211_KEY_TYPE, | 1898 | NL80211_KEY_TYPE, |
1899 | NL80211_KEY_DEFAULT_TYPES, | ||
1739 | 1900 | ||
1740 | /* keep last */ | 1901 | /* keep last */ |
1741 | __NL80211_KEY_AFTER_LAST, | 1902 | __NL80211_KEY_AFTER_LAST, |
@@ -1786,6 +1947,8 @@ enum nl80211_ps_state { | |||
1786 | * the minimum amount the RSSI level must change after an event before a | 1947 | * the minimum amount the RSSI level must change after an event before a |
1787 | * new event may be issued (to reduce effects of RSSI oscillation). | 1948 | * new event may be issued (to reduce effects of RSSI oscillation). |
1788 | * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event | 1949 | * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event |
1950 | * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many | ||
1951 | * consecutive packets were not acknowledged by the peer | ||
1789 | * @__NL80211_ATTR_CQM_AFTER_LAST: internal | 1952 | * @__NL80211_ATTR_CQM_AFTER_LAST: internal |
1790 | * @NL80211_ATTR_CQM_MAX: highest key attribute | 1953 | * @NL80211_ATTR_CQM_MAX: highest key attribute |
1791 | */ | 1954 | */ |
@@ -1794,6 +1957,7 @@ enum nl80211_attr_cqm { | |||
1794 | NL80211_ATTR_CQM_RSSI_THOLD, | 1957 | NL80211_ATTR_CQM_RSSI_THOLD, |
1795 | NL80211_ATTR_CQM_RSSI_HYST, | 1958 | NL80211_ATTR_CQM_RSSI_HYST, |
1796 | NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, | 1959 | NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, |
1960 | NL80211_ATTR_CQM_PKT_LOSS_EVENT, | ||
1797 | 1961 | ||
1798 | /* keep last */ | 1962 | /* keep last */ |
1799 | __NL80211_ATTR_CQM_AFTER_LAST, | 1963 | __NL80211_ATTR_CQM_AFTER_LAST, |
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 06aab5eee134..c536f8545f74 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h | |||
@@ -14,22 +14,14 @@ | |||
14 | * may be used to reset the timeout - for code which intentionally | 14 | * may be used to reset the timeout - for code which intentionally |
15 | * disables interrupts for a long time. This call is stateless. | 15 | * disables interrupts for a long time. This call is stateless. |
16 | */ | 16 | */ |
17 | #ifdef ARCH_HAS_NMI_WATCHDOG | 17 | #if defined(ARCH_HAS_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR) |
18 | #include <asm/nmi.h> | 18 | #include <asm/nmi.h> |
19 | extern void touch_nmi_watchdog(void); | 19 | extern void touch_nmi_watchdog(void); |
20 | extern void acpi_nmi_disable(void); | ||
21 | extern void acpi_nmi_enable(void); | ||
22 | #else | 20 | #else |
23 | #ifndef CONFIG_HARDLOCKUP_DETECTOR | ||
24 | static inline void touch_nmi_watchdog(void) | 21 | static inline void touch_nmi_watchdog(void) |
25 | { | 22 | { |
26 | touch_softlockup_watchdog(); | 23 | touch_softlockup_watchdog(); |
27 | } | 24 | } |
28 | #else | ||
29 | extern void touch_nmi_watchdog(void); | ||
30 | #endif | ||
31 | static inline void acpi_nmi_disable(void) { } | ||
32 | static inline void acpi_nmi_enable(void) { } | ||
33 | #endif | 25 | #endif |
34 | 26 | ||
35 | /* | 27 | /* |
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/path.h b/include/linux/path.h index edc98dec6266..a581e8c06533 100644 --- a/include/linux/path.h +++ b/include/linux/path.h | |||
@@ -10,7 +10,9 @@ struct path { | |||
10 | }; | 10 | }; |
11 | 11 | ||
12 | extern void path_get(struct path *); | 12 | extern void path_get(struct path *); |
13 | extern void path_get_long(struct path *); | ||
13 | extern void path_put(struct path *); | 14 | extern void path_put(struct path *); |
15 | extern void path_put_long(struct path *); | ||
14 | 16 | ||
15 | static inline int path_equal(const struct path *path1, const struct path *path2) | 17 | static inline int path_equal(const struct path *path1, const struct path *path2) |
16 | { | 18 | { |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index c6bcfe93b9ca..cb845c16ad7d 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2047,6 +2047,7 @@ | |||
2047 | #define PCI_DEVICE_ID_AFAVLAB_P030 0x2182 | 2047 | #define PCI_DEVICE_ID_AFAVLAB_P030 0x2182 |
2048 | #define PCI_SUBDEVICE_ID_AFAVLAB_P061 0x2150 | 2048 | #define PCI_SUBDEVICE_ID_AFAVLAB_P061 0x2150 |
2049 | 2049 | ||
2050 | #define PCI_VENDOR_ID_BCM_GVC 0x14a4 | ||
2050 | #define PCI_VENDOR_ID_BROADCOM 0x14e4 | 2051 | #define PCI_VENDOR_ID_BROADCOM 0x14e4 |
2051 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 | 2052 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 |
2052 | #define PCI_DEVICE_ID_TIGON3_5752M 0x1601 | 2053 | #define PCI_DEVICE_ID_TIGON3_5752M 0x1601 |
@@ -2441,6 +2442,7 @@ | |||
2441 | #define PCI_DEVICE_ID_INTEL_MFD_SDIO2 0x0822 | 2442 | #define PCI_DEVICE_ID_INTEL_MFD_SDIO2 0x0822 |
2442 | #define PCI_DEVICE_ID_INTEL_MFD_EMMC0 0x0823 | 2443 | #define PCI_DEVICE_ID_INTEL_MFD_EMMC0 0x0823 |
2443 | #define PCI_DEVICE_ID_INTEL_MFD_EMMC1 0x0824 | 2444 | #define PCI_DEVICE_ID_INTEL_MFD_EMMC1 0x0824 |
2445 | #define PCI_DEVICE_ID_INTEL_MRST_SD2 0x084F | ||
2444 | #define PCI_DEVICE_ID_INTEL_I960 0x0960 | 2446 | #define PCI_DEVICE_ID_INTEL_I960 0x0960 |
2445 | #define PCI_DEVICE_ID_INTEL_I960RM 0x0962 | 2447 | #define PCI_DEVICE_ID_INTEL_I960RM 0x0962 |
2446 | #define PCI_DEVICE_ID_INTEL_8257X_SOL 0x1062 | 2448 | #define PCI_DEVICE_ID_INTEL_8257X_SOL 0x1062 |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 5095b834a6fb..27c3c6fcfad3 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -240,6 +240,21 @@ extern void __bad_size_call_parameter(void); | |||
240 | pscr_ret__; \ | 240 | pscr_ret__; \ |
241 | }) | 241 | }) |
242 | 242 | ||
243 | #define __pcpu_size_call_return2(stem, variable, ...) \ | ||
244 | ({ \ | ||
245 | typeof(variable) pscr2_ret__; \ | ||
246 | __verify_pcpu_ptr(&(variable)); \ | ||
247 | switch(sizeof(variable)) { \ | ||
248 | case 1: pscr2_ret__ = stem##1(variable, __VA_ARGS__); break; \ | ||
249 | case 2: pscr2_ret__ = stem##2(variable, __VA_ARGS__); break; \ | ||
250 | case 4: pscr2_ret__ = stem##4(variable, __VA_ARGS__); break; \ | ||
251 | case 8: pscr2_ret__ = stem##8(variable, __VA_ARGS__); break; \ | ||
252 | default: \ | ||
253 | __bad_size_call_parameter(); break; \ | ||
254 | } \ | ||
255 | pscr2_ret__; \ | ||
256 | }) | ||
257 | |||
243 | #define __pcpu_size_call(stem, variable, ...) \ | 258 | #define __pcpu_size_call(stem, variable, ...) \ |
244 | do { \ | 259 | do { \ |
245 | __verify_pcpu_ptr(&(variable)); \ | 260 | __verify_pcpu_ptr(&(variable)); \ |
@@ -402,6 +417,89 @@ do { \ | |||
402 | # define this_cpu_xor(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) | 417 | # define this_cpu_xor(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) |
403 | #endif | 418 | #endif |
404 | 419 | ||
420 | #define _this_cpu_generic_add_return(pcp, val) \ | ||
421 | ({ \ | ||
422 | typeof(pcp) ret__; \ | ||
423 | preempt_disable(); \ | ||
424 | __this_cpu_add(pcp, val); \ | ||
425 | ret__ = __this_cpu_read(pcp); \ | ||
426 | preempt_enable(); \ | ||
427 | ret__; \ | ||
428 | }) | ||
429 | |||
430 | #ifndef this_cpu_add_return | ||
431 | # ifndef this_cpu_add_return_1 | ||
432 | # define this_cpu_add_return_1(pcp, val) _this_cpu_generic_add_return(pcp, val) | ||
433 | # endif | ||
434 | # ifndef this_cpu_add_return_2 | ||
435 | # define this_cpu_add_return_2(pcp, val) _this_cpu_generic_add_return(pcp, val) | ||
436 | # endif | ||
437 | # ifndef this_cpu_add_return_4 | ||
438 | # define this_cpu_add_return_4(pcp, val) _this_cpu_generic_add_return(pcp, val) | ||
439 | # endif | ||
440 | # ifndef this_cpu_add_return_8 | ||
441 | # define this_cpu_add_return_8(pcp, val) _this_cpu_generic_add_return(pcp, val) | ||
442 | # endif | ||
443 | # define this_cpu_add_return(pcp, val) __pcpu_size_call_return2(this_cpu_add_return_, pcp, val) | ||
444 | #endif | ||
445 | |||
446 | #define this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(val)) | ||
447 | #define this_cpu_inc_return(pcp) this_cpu_add_return(pcp, 1) | ||
448 | #define this_cpu_dec_return(pcp) this_cpu_add_return(pcp, -1) | ||
449 | |||
450 | #define _this_cpu_generic_xchg(pcp, nval) \ | ||
451 | ({ typeof(pcp) ret__; \ | ||
452 | preempt_disable(); \ | ||
453 | ret__ = __this_cpu_read(pcp); \ | ||
454 | __this_cpu_write(pcp, nval); \ | ||
455 | preempt_enable(); \ | ||
456 | ret__; \ | ||
457 | }) | ||
458 | |||
459 | #ifndef this_cpu_xchg | ||
460 | # ifndef this_cpu_xchg_1 | ||
461 | # define this_cpu_xchg_1(pcp, nval) _this_cpu_generic_xchg(pcp, nval) | ||
462 | # endif | ||
463 | # ifndef this_cpu_xchg_2 | ||
464 | # define this_cpu_xchg_2(pcp, nval) _this_cpu_generic_xchg(pcp, nval) | ||
465 | # endif | ||
466 | # ifndef this_cpu_xchg_4 | ||
467 | # define this_cpu_xchg_4(pcp, nval) _this_cpu_generic_xchg(pcp, nval) | ||
468 | # endif | ||
469 | # ifndef this_cpu_xchg_8 | ||
470 | # define this_cpu_xchg_8(pcp, nval) _this_cpu_generic_xchg(pcp, nval) | ||
471 | # endif | ||
472 | # define this_cpu_xchg(pcp, nval) \ | ||
473 | __pcpu_size_call_return2(this_cpu_xchg_, (pcp), nval) | ||
474 | #endif | ||
475 | |||
476 | #define _this_cpu_generic_cmpxchg(pcp, oval, nval) \ | ||
477 | ({ typeof(pcp) ret__; \ | ||
478 | preempt_disable(); \ | ||
479 | ret__ = __this_cpu_read(pcp); \ | ||
480 | if (ret__ == (oval)) \ | ||
481 | __this_cpu_write(pcp, nval); \ | ||
482 | preempt_enable(); \ | ||
483 | ret__; \ | ||
484 | }) | ||
485 | |||
486 | #ifndef this_cpu_cmpxchg | ||
487 | # ifndef this_cpu_cmpxchg_1 | ||
488 | # define this_cpu_cmpxchg_1(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
489 | # endif | ||
490 | # ifndef this_cpu_cmpxchg_2 | ||
491 | # define this_cpu_cmpxchg_2(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
492 | # endif | ||
493 | # ifndef this_cpu_cmpxchg_4 | ||
494 | # define this_cpu_cmpxchg_4(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
495 | # endif | ||
496 | # ifndef this_cpu_cmpxchg_8 | ||
497 | # define this_cpu_cmpxchg_8(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
498 | # endif | ||
499 | # define this_cpu_cmpxchg(pcp, oval, nval) \ | ||
500 | __pcpu_size_call_return2(this_cpu_cmpxchg_, pcp, oval, nval) | ||
501 | #endif | ||
502 | |||
405 | /* | 503 | /* |
406 | * Generic percpu operations that do not require preemption handling. | 504 | * Generic percpu operations that do not require preemption handling. |
407 | * Either we do not care about races or the caller has the | 505 | * Either we do not care about races or the caller has the |
@@ -529,11 +627,87 @@ do { \ | |||
529 | # define __this_cpu_xor(pcp, val) __pcpu_size_call(__this_cpu_xor_, (pcp), (val)) | 627 | # define __this_cpu_xor(pcp, val) __pcpu_size_call(__this_cpu_xor_, (pcp), (val)) |
530 | #endif | 628 | #endif |
531 | 629 | ||
630 | #define __this_cpu_generic_add_return(pcp, val) \ | ||
631 | ({ \ | ||
632 | __this_cpu_add(pcp, val); \ | ||
633 | __this_cpu_read(pcp); \ | ||
634 | }) | ||
635 | |||
636 | #ifndef __this_cpu_add_return | ||
637 | # ifndef __this_cpu_add_return_1 | ||
638 | # define __this_cpu_add_return_1(pcp, val) __this_cpu_generic_add_return(pcp, val) | ||
639 | # endif | ||
640 | # ifndef __this_cpu_add_return_2 | ||
641 | # define __this_cpu_add_return_2(pcp, val) __this_cpu_generic_add_return(pcp, val) | ||
642 | # endif | ||
643 | # ifndef __this_cpu_add_return_4 | ||
644 | # define __this_cpu_add_return_4(pcp, val) __this_cpu_generic_add_return(pcp, val) | ||
645 | # endif | ||
646 | # ifndef __this_cpu_add_return_8 | ||
647 | # define __this_cpu_add_return_8(pcp, val) __this_cpu_generic_add_return(pcp, val) | ||
648 | # endif | ||
649 | # define __this_cpu_add_return(pcp, val) __pcpu_size_call_return2(this_cpu_add_return_, pcp, val) | ||
650 | #endif | ||
651 | |||
652 | #define __this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(val)) | ||
653 | #define __this_cpu_inc_return(pcp) this_cpu_add_return(pcp, 1) | ||
654 | #define __this_cpu_dec_return(pcp) this_cpu_add_return(pcp, -1) | ||
655 | |||
656 | #define __this_cpu_generic_xchg(pcp, nval) \ | ||
657 | ({ typeof(pcp) ret__; \ | ||
658 | ret__ = __this_cpu_read(pcp); \ | ||
659 | __this_cpu_write(pcp, nval); \ | ||
660 | ret__; \ | ||
661 | }) | ||
662 | |||
663 | #ifndef __this_cpu_xchg | ||
664 | # ifndef __this_cpu_xchg_1 | ||
665 | # define __this_cpu_xchg_1(pcp, nval) __this_cpu_generic_xchg(pcp, nval) | ||
666 | # endif | ||
667 | # ifndef __this_cpu_xchg_2 | ||
668 | # define __this_cpu_xchg_2(pcp, nval) __this_cpu_generic_xchg(pcp, nval) | ||
669 | # endif | ||
670 | # ifndef __this_cpu_xchg_4 | ||
671 | # define __this_cpu_xchg_4(pcp, nval) __this_cpu_generic_xchg(pcp, nval) | ||
672 | # endif | ||
673 | # ifndef __this_cpu_xchg_8 | ||
674 | # define __this_cpu_xchg_8(pcp, nval) __this_cpu_generic_xchg(pcp, nval) | ||
675 | # endif | ||
676 | # define __this_cpu_xchg(pcp, nval) \ | ||
677 | __pcpu_size_call_return2(__this_cpu_xchg_, (pcp), nval) | ||
678 | #endif | ||
679 | |||
680 | #define __this_cpu_generic_cmpxchg(pcp, oval, nval) \ | ||
681 | ({ \ | ||
682 | typeof(pcp) ret__; \ | ||
683 | ret__ = __this_cpu_read(pcp); \ | ||
684 | if (ret__ == (oval)) \ | ||
685 | __this_cpu_write(pcp, nval); \ | ||
686 | ret__; \ | ||
687 | }) | ||
688 | |||
689 | #ifndef __this_cpu_cmpxchg | ||
690 | # ifndef __this_cpu_cmpxchg_1 | ||
691 | # define __this_cpu_cmpxchg_1(pcp, oval, nval) __this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
692 | # endif | ||
693 | # ifndef __this_cpu_cmpxchg_2 | ||
694 | # define __this_cpu_cmpxchg_2(pcp, oval, nval) __this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
695 | # endif | ||
696 | # ifndef __this_cpu_cmpxchg_4 | ||
697 | # define __this_cpu_cmpxchg_4(pcp, oval, nval) __this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
698 | # endif | ||
699 | # ifndef __this_cpu_cmpxchg_8 | ||
700 | # define __this_cpu_cmpxchg_8(pcp, oval, nval) __this_cpu_generic_cmpxchg(pcp, oval, nval) | ||
701 | # endif | ||
702 | # define __this_cpu_cmpxchg(pcp, oval, nval) \ | ||
703 | __pcpu_size_call_return2(__this_cpu_cmpxchg_, pcp, oval, nval) | ||
704 | #endif | ||
705 | |||
532 | /* | 706 | /* |
533 | * IRQ safe versions of the per cpu RMW operations. Note that these operations | 707 | * IRQ safe versions of the per cpu RMW operations. Note that these operations |
534 | * are *not* safe against modification of the same variable from another | 708 | * are *not* safe against modification of the same variable from another |
535 | * processors (which one gets when using regular atomic operations) | 709 | * processors (which one gets when using regular atomic operations) |
536 | . They are guaranteed to be atomic vs. local interrupts and | 710 | * They are guaranteed to be atomic vs. local interrupts and |
537 | * preemption only. | 711 | * preemption only. |
538 | */ | 712 | */ |
539 | #define irqsafe_cpu_generic_to_op(pcp, val, op) \ | 713 | #define irqsafe_cpu_generic_to_op(pcp, val, op) \ |
@@ -620,4 +794,33 @@ do { \ | |||
620 | # define irqsafe_cpu_xor(pcp, val) __pcpu_size_call(irqsafe_cpu_xor_, (val)) | 794 | # define irqsafe_cpu_xor(pcp, val) __pcpu_size_call(irqsafe_cpu_xor_, (val)) |
621 | #endif | 795 | #endif |
622 | 796 | ||
797 | #define irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) \ | ||
798 | ({ \ | ||
799 | typeof(pcp) ret__; \ | ||
800 | unsigned long flags; \ | ||
801 | local_irq_save(flags); \ | ||
802 | ret__ = __this_cpu_read(pcp); \ | ||
803 | if (ret__ == (oval)) \ | ||
804 | __this_cpu_write(pcp, nval); \ | ||
805 | local_irq_restore(flags); \ | ||
806 | ret__; \ | ||
807 | }) | ||
808 | |||
809 | #ifndef irqsafe_cpu_cmpxchg | ||
810 | # ifndef irqsafe_cpu_cmpxchg_1 | ||
811 | # define irqsafe_cpu_cmpxchg_1(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) | ||
812 | # endif | ||
813 | # ifndef irqsafe_cpu_cmpxchg_2 | ||
814 | # define irqsafe_cpu_cmpxchg_2(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) | ||
815 | # endif | ||
816 | # ifndef irqsafe_cpu_cmpxchg_4 | ||
817 | # define irqsafe_cpu_cmpxchg_4(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) | ||
818 | # endif | ||
819 | # ifndef irqsafe_cpu_cmpxchg_8 | ||
820 | # define irqsafe_cpu_cmpxchg_8(pcp, oval, nval) irqsafe_cpu_generic_cmpxchg(pcp, oval, nval) | ||
821 | # endif | ||
822 | # define irqsafe_cpu_cmpxchg(pcp, oval, nval) \ | ||
823 | __pcpu_size_call_return2(irqsafe_cpu_cmpxchg_, (pcp), oval, nval) | ||
824 | #endif | ||
825 | |||
623 | #endif /* __LINUX_PERCPU_H */ | 826 | #endif /* __LINUX_PERCPU_H */ |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 057bf22a8323..dda5b0a3ff60 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -215,8 +215,9 @@ struct perf_event_attr { | |||
215 | */ | 215 | */ |
216 | precise_ip : 2, /* skid constraint */ | 216 | precise_ip : 2, /* skid constraint */ |
217 | mmap_data : 1, /* non-exec mmap data */ | 217 | mmap_data : 1, /* non-exec mmap data */ |
218 | sample_id_all : 1, /* sample_type all events */ | ||
218 | 219 | ||
219 | __reserved_1 : 46; | 220 | __reserved_1 : 45; |
220 | 221 | ||
221 | union { | 222 | union { |
222 | __u32 wakeup_events; /* wakeup every n events */ | 223 | __u32 wakeup_events; /* wakeup every n events */ |
@@ -327,6 +328,15 @@ struct perf_event_header { | |||
327 | enum perf_event_type { | 328 | enum perf_event_type { |
328 | 329 | ||
329 | /* | 330 | /* |
331 | * If perf_event_attr.sample_id_all is set then all event types will | ||
332 | * have the sample_type selected fields related to where/when | ||
333 | * (identity) an event took place (TID, TIME, ID, CPU, STREAM_ID) | ||
334 | * described in PERF_RECORD_SAMPLE below, it will be stashed just after | ||
335 | * the perf_event_header and the fields already present for the existing | ||
336 | * fields, i.e. at the end of the payload. That way a newer perf.data | ||
337 | * file will be supported by older perf tools, with these new optional | ||
338 | * fields being ignored. | ||
339 | * | ||
330 | * The MMAP events record the PROT_EXEC mappings so that we can | 340 | * The MMAP events record the PROT_EXEC mappings so that we can |
331 | * correlate userspace IPs to code. They have the following structure: | 341 | * correlate userspace IPs to code. They have the following structure: |
332 | * | 342 | * |
@@ -578,6 +588,10 @@ struct perf_event; | |||
578 | struct pmu { | 588 | struct pmu { |
579 | struct list_head entry; | 589 | struct list_head entry; |
580 | 590 | ||
591 | struct device *dev; | ||
592 | char *name; | ||
593 | int type; | ||
594 | |||
581 | int * __percpu pmu_disable_count; | 595 | int * __percpu pmu_disable_count; |
582 | struct perf_cpu_context * __percpu pmu_cpu_context; | 596 | struct perf_cpu_context * __percpu pmu_cpu_context; |
583 | int task_ctx_nr; | 597 | int task_ctx_nr; |
@@ -747,7 +761,20 @@ struct perf_event { | |||
747 | u64 tstamp_running; | 761 | u64 tstamp_running; |
748 | u64 tstamp_stopped; | 762 | u64 tstamp_stopped; |
749 | 763 | ||
764 | /* | ||
765 | * timestamp shadows the actual context timing but it can | ||
766 | * be safely used in NMI interrupt context. It reflects the | ||
767 | * context time as it was when the event was last scheduled in. | ||
768 | * | ||
769 | * ctx_time already accounts for ctx->timestamp. Therefore to | ||
770 | * compute ctx_time for a sample, simply add perf_clock(). | ||
771 | */ | ||
772 | u64 shadow_ctx_time; | ||
773 | |||
750 | struct perf_event_attr attr; | 774 | struct perf_event_attr attr; |
775 | u16 header_size; | ||
776 | u16 id_header_size; | ||
777 | u16 read_size; | ||
751 | struct hw_perf_event hw; | 778 | struct hw_perf_event hw; |
752 | 779 | ||
753 | struct perf_event_context *ctx; | 780 | struct perf_event_context *ctx; |
@@ -840,6 +867,7 @@ struct perf_event_context { | |||
840 | int nr_active; | 867 | int nr_active; |
841 | int is_active; | 868 | int is_active; |
842 | int nr_stat; | 869 | int nr_stat; |
870 | int rotate_disable; | ||
843 | atomic_t refcount; | 871 | atomic_t refcount; |
844 | struct task_struct *task; | 872 | struct task_struct *task; |
845 | 873 | ||
@@ -876,6 +904,7 @@ struct perf_cpu_context { | |||
876 | int exclusive; | 904 | int exclusive; |
877 | struct list_head rotation_list; | 905 | struct list_head rotation_list; |
878 | int jiffies_interval; | 906 | int jiffies_interval; |
907 | struct pmu *active_pmu; | ||
879 | }; | 908 | }; |
880 | 909 | ||
881 | struct perf_output_handle { | 910 | struct perf_output_handle { |
@@ -891,27 +920,13 @@ struct perf_output_handle { | |||
891 | 920 | ||
892 | #ifdef CONFIG_PERF_EVENTS | 921 | #ifdef CONFIG_PERF_EVENTS |
893 | 922 | ||
894 | extern int perf_pmu_register(struct pmu *pmu); | 923 | extern int perf_pmu_register(struct pmu *pmu, char *name, int type); |
895 | extern void perf_pmu_unregister(struct pmu *pmu); | 924 | extern void perf_pmu_unregister(struct pmu *pmu); |
896 | 925 | ||
897 | extern int perf_num_counters(void); | 926 | extern int perf_num_counters(void); |
898 | extern const char *perf_pmu_name(void); | 927 | extern const char *perf_pmu_name(void); |
899 | extern void __perf_event_task_sched_in(struct task_struct *task); | 928 | 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); | 929 | 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); | 930 | extern int perf_event_init_task(struct task_struct *child); |
916 | extern void perf_event_exit_task(struct task_struct *child); | 931 | extern void perf_event_exit_task(struct task_struct *child); |
917 | extern void perf_event_free_task(struct task_struct *task); | 932 | extern void perf_event_free_task(struct task_struct *task); |
@@ -972,6 +987,11 @@ extern int perf_event_overflow(struct perf_event *event, int nmi, | |||
972 | struct perf_sample_data *data, | 987 | struct perf_sample_data *data, |
973 | struct pt_regs *regs); | 988 | struct pt_regs *regs); |
974 | 989 | ||
990 | static inline bool is_sampling_event(struct perf_event *event) | ||
991 | { | ||
992 | return event->attr.sample_period != 0; | ||
993 | } | ||
994 | |||
975 | /* | 995 | /* |
976 | * Return 1 for a software event, 0 for a hardware event | 996 | * Return 1 for a software event, 0 for a hardware event |
977 | */ | 997 | */ |
@@ -1020,6 +1040,21 @@ have_event: | |||
1020 | __perf_sw_event(event_id, nr, nmi, regs, addr); | 1040 | __perf_sw_event(event_id, nr, nmi, regs, addr); |
1021 | } | 1041 | } |
1022 | 1042 | ||
1043 | extern atomic_t perf_task_events; | ||
1044 | |||
1045 | static inline void perf_event_task_sched_in(struct task_struct *task) | ||
1046 | { | ||
1047 | COND_STMT(&perf_task_events, __perf_event_task_sched_in(task)); | ||
1048 | } | ||
1049 | |||
1050 | static inline | ||
1051 | void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) | ||
1052 | { | ||
1053 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0); | ||
1054 | |||
1055 | COND_STMT(&perf_task_events, __perf_event_task_sched_out(task, next)); | ||
1056 | } | ||
1057 | |||
1023 | extern void perf_event_mmap(struct vm_area_struct *vma); | 1058 | extern void perf_event_mmap(struct vm_area_struct *vma); |
1024 | extern struct perf_guest_info_callbacks *perf_guest_cbs; | 1059 | extern struct perf_guest_info_callbacks *perf_guest_cbs; |
1025 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | 1060 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |
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/posix_acl.h b/include/linux/posix_acl.h index 67608161df6b..d68283a898bb 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -108,6 +108,25 @@ static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) | |||
108 | return acl; | 108 | return acl; |
109 | } | 109 | } |
110 | 110 | ||
111 | static inline int negative_cached_acl(struct inode *inode, int type) | ||
112 | { | ||
113 | struct posix_acl **p, *acl; | ||
114 | switch (type) { | ||
115 | case ACL_TYPE_ACCESS: | ||
116 | p = &inode->i_acl; | ||
117 | break; | ||
118 | case ACL_TYPE_DEFAULT: | ||
119 | p = &inode->i_default_acl; | ||
120 | break; | ||
121 | default: | ||
122 | BUG(); | ||
123 | } | ||
124 | acl = ACCESS_ONCE(*p); | ||
125 | if (acl) | ||
126 | return 0; | ||
127 | return 1; | ||
128 | } | ||
129 | |||
111 | static inline void set_cached_acl(struct inode *inode, | 130 | static inline void set_cached_acl(struct inode *inode, |
112 | int type, | 131 | int type, |
113 | struct posix_acl *acl) | 132 | struct posix_acl *acl) |
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/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/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h new file mode 100644 index 000000000000..2f691e4e6222 --- /dev/null +++ b/include/linux/pxa2xx_ssp.h | |||
@@ -0,0 +1,209 @@ | |||
1 | /* | ||
2 | * pxa2xx_ssp.h | ||
3 | * | ||
4 | * Copyright (C) 2003 Russell King, 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 version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * This driver supports the following PXA CPU/SSP ports:- | ||
11 | * | ||
12 | * PXA250 SSP | ||
13 | * PXA255 SSP, NSSP | ||
14 | * PXA26x SSP, NSSP, ASSP | ||
15 | * PXA27x SSP1, SSP2, SSP3 | ||
16 | * PXA3xx SSP1, SSP2, SSP3, SSP4 | ||
17 | */ | ||
18 | |||
19 | #ifndef __LINUX_SSP_H | ||
20 | #define __LINUX_SSP_H | ||
21 | |||
22 | #include <linux/list.h> | ||
23 | #include <linux/io.h> | ||
24 | |||
25 | /* | ||
26 | * SSP Serial Port Registers | ||
27 | * PXA250, PXA255, PXA26x and PXA27x SSP controllers are all slightly different. | ||
28 | * PXA255, PXA26x and PXA27x have extra ports, registers and bits. | ||
29 | */ | ||
30 | |||
31 | #define SSCR0 (0x00) /* SSP Control Register 0 */ | ||
32 | #define SSCR1 (0x04) /* SSP Control Register 1 */ | ||
33 | #define SSSR (0x08) /* SSP Status Register */ | ||
34 | #define SSITR (0x0C) /* SSP Interrupt Test Register */ | ||
35 | #define SSDR (0x10) /* SSP Data Write/Data Read Register */ | ||
36 | |||
37 | #define SSTO (0x28) /* SSP Time Out Register */ | ||
38 | #define SSPSP (0x2C) /* SSP Programmable Serial Protocol */ | ||
39 | #define SSTSA (0x30) /* SSP Tx Timeslot Active */ | ||
40 | #define SSRSA (0x34) /* SSP Rx Timeslot Active */ | ||
41 | #define SSTSS (0x38) /* SSP Timeslot Status */ | ||
42 | #define SSACD (0x3C) /* SSP Audio Clock Divider */ | ||
43 | #define SSACDD (0x40) /* SSP Audio Clock Dither Divider */ | ||
44 | |||
45 | /* Common PXA2xx bits first */ | ||
46 | #define SSCR0_DSS (0x0000000f) /* Data Size Select (mask) */ | ||
47 | #define SSCR0_DataSize(x) ((x) - 1) /* Data Size Select [4..16] */ | ||
48 | #define SSCR0_FRF (0x00000030) /* FRame Format (mask) */ | ||
49 | #define SSCR0_Motorola (0x0 << 4) /* Motorola's Serial Peripheral Interface (SPI) */ | ||
50 | #define SSCR0_TI (0x1 << 4) /* Texas Instruments' Synchronous Serial Protocol (SSP) */ | ||
51 | #define SSCR0_National (0x2 << 4) /* National Microwire */ | ||
52 | #define SSCR0_ECS (1 << 6) /* External clock select */ | ||
53 | #define SSCR0_SSE (1 << 7) /* Synchronous Serial Port Enable */ | ||
54 | #define SSCR0_SCR(x) ((x) << 8) /* Serial Clock Rate (mask) */ | ||
55 | |||
56 | /* PXA27x, PXA3xx */ | ||
57 | #define SSCR0_EDSS (1 << 20) /* Extended data size select */ | ||
58 | #define SSCR0_NCS (1 << 21) /* Network clock select */ | ||
59 | #define SSCR0_RIM (1 << 22) /* Receive FIFO overrrun interrupt mask */ | ||
60 | #define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */ | ||
61 | #define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */ | ||
62 | #define SSCR0_SlotsPerFrm(x) (((x) - 1) << 24) /* Time slots per frame [1..8] */ | ||
63 | #define SSCR0_FPCKE (1 << 29) /* FIFO packing enable */ | ||
64 | #define SSCR0_ACS (1 << 30) /* Audio clock select */ | ||
65 | #define SSCR0_MOD (1 << 31) /* Mode (normal or network) */ | ||
66 | |||
67 | |||
68 | #define SSCR1_RIE (1 << 0) /* Receive FIFO Interrupt Enable */ | ||
69 | #define SSCR1_TIE (1 << 1) /* Transmit FIFO Interrupt Enable */ | ||
70 | #define SSCR1_LBM (1 << 2) /* Loop-Back Mode */ | ||
71 | #define SSCR1_SPO (1 << 3) /* Motorola SPI SSPSCLK polarity setting */ | ||
72 | #define SSCR1_SPH (1 << 4) /* Motorola SPI SSPSCLK phase setting */ | ||
73 | #define SSCR1_MWDS (1 << 5) /* Microwire Transmit Data Size */ | ||
74 | |||
75 | #define SSSR_ALT_FRM_MASK 3 /* Masks the SFRM signal number */ | ||
76 | #define SSSR_TNF (1 << 2) /* Transmit FIFO Not Full */ | ||
77 | #define SSSR_RNE (1 << 3) /* Receive FIFO Not Empty */ | ||
78 | #define SSSR_BSY (1 << 4) /* SSP Busy */ | ||
79 | #define SSSR_TFS (1 << 5) /* Transmit FIFO Service Request */ | ||
80 | #define SSSR_RFS (1 << 6) /* Receive FIFO Service Request */ | ||
81 | #define SSSR_ROR (1 << 7) /* Receive FIFO Overrun */ | ||
82 | |||
83 | #ifdef CONFIG_ARCH_PXA | ||
84 | #define RX_THRESH_DFLT 8 | ||
85 | #define TX_THRESH_DFLT 8 | ||
86 | |||
87 | #define SSSR_TFL_MASK (0xf << 8) /* Transmit FIFO Level mask */ | ||
88 | #define SSSR_RFL_MASK (0xf << 12) /* Receive FIFO Level mask */ | ||
89 | |||
90 | #define SSCR1_TFT (0x000003c0) /* Transmit FIFO Threshold (mask) */ | ||
91 | #define SSCR1_TxTresh(x) (((x) - 1) << 6) /* level [1..16] */ | ||
92 | #define SSCR1_RFT (0x00003c00) /* Receive FIFO Threshold (mask) */ | ||
93 | #define SSCR1_RxTresh(x) (((x) - 1) << 10) /* level [1..16] */ | ||
94 | |||
95 | #else | ||
96 | |||
97 | #define RX_THRESH_DFLT 2 | ||
98 | #define TX_THRESH_DFLT 2 | ||
99 | |||
100 | #define SSSR_TFL_MASK (0x3 << 8) /* Transmit FIFO Level mask */ | ||
101 | #define SSSR_RFL_MASK (0x3 << 12) /* Receive FIFO Level mask */ | ||
102 | |||
103 | #define SSCR1_TFT (0x000000c0) /* Transmit FIFO Threshold (mask) */ | ||
104 | #define SSCR1_TxTresh(x) (((x) - 1) << 6) /* level [1..4] */ | ||
105 | #define SSCR1_RFT (0x00000c00) /* Receive FIFO Threshold (mask) */ | ||
106 | #define SSCR1_RxTresh(x) (((x) - 1) << 10) /* level [1..4] */ | ||
107 | #endif | ||
108 | |||
109 | /* extra bits in PXA255, PXA26x and PXA27x SSP ports */ | ||
110 | #define SSCR0_TISSP (1 << 4) /* TI Sync Serial Protocol */ | ||
111 | #define SSCR0_PSP (3 << 4) /* PSP - Programmable Serial Protocol */ | ||
112 | #define SSCR1_TTELP (1 << 31) /* TXD Tristate Enable Last Phase */ | ||
113 | #define SSCR1_TTE (1 << 30) /* TXD Tristate Enable */ | ||
114 | #define SSCR1_EBCEI (1 << 29) /* Enable Bit Count Error interrupt */ | ||
115 | #define SSCR1_SCFR (1 << 28) /* Slave Clock free Running */ | ||
116 | #define SSCR1_ECRA (1 << 27) /* Enable Clock Request A */ | ||
117 | #define SSCR1_ECRB (1 << 26) /* Enable Clock request B */ | ||
118 | #define SSCR1_SCLKDIR (1 << 25) /* Serial Bit Rate Clock Direction */ | ||
119 | #define SSCR1_SFRMDIR (1 << 24) /* Frame Direction */ | ||
120 | #define SSCR1_RWOT (1 << 23) /* Receive Without Transmit */ | ||
121 | #define SSCR1_TRAIL (1 << 22) /* Trailing Byte */ | ||
122 | #define SSCR1_TSRE (1 << 21) /* Transmit Service Request Enable */ | ||
123 | #define SSCR1_RSRE (1 << 20) /* Receive Service Request Enable */ | ||
124 | #define SSCR1_TINTE (1 << 19) /* Receiver Time-out Interrupt enable */ | ||
125 | #define SSCR1_PINTE (1 << 18) /* Peripheral Trailing Byte Interupt Enable */ | ||
126 | #define SSCR1_IFS (1 << 16) /* Invert Frame Signal */ | ||
127 | #define SSCR1_STRF (1 << 15) /* Select FIFO or EFWR */ | ||
128 | #define SSCR1_EFWR (1 << 14) /* Enable FIFO Write/Read */ | ||
129 | |||
130 | #define SSSR_BCE (1 << 23) /* Bit Count Error */ | ||
131 | #define SSSR_CSS (1 << 22) /* Clock Synchronisation Status */ | ||
132 | #define SSSR_TUR (1 << 21) /* Transmit FIFO Under Run */ | ||
133 | #define SSSR_EOC (1 << 20) /* End Of Chain */ | ||
134 | #define SSSR_TINT (1 << 19) /* Receiver Time-out Interrupt */ | ||
135 | #define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */ | ||
136 | |||
137 | |||
138 | #define SSPSP_SCMODE(x) ((x) << 0) /* Serial Bit Rate Clock Mode */ | ||
139 | #define SSPSP_SFRMP (1 << 2) /* Serial Frame Polarity */ | ||
140 | #define SSPSP_ETDS (1 << 3) /* End of Transfer data State */ | ||
141 | #define SSPSP_STRTDLY(x) ((x) << 4) /* Start Delay */ | ||
142 | #define SSPSP_DMYSTRT(x) ((x) << 7) /* Dummy Start */ | ||
143 | #define SSPSP_SFRMDLY(x) ((x) << 9) /* Serial Frame Delay */ | ||
144 | #define SSPSP_SFRMWDTH(x) ((x) << 16) /* Serial Frame Width */ | ||
145 | #define SSPSP_DMYSTOP(x) ((x) << 23) /* Dummy Stop */ | ||
146 | #define SSPSP_FSRT (1 << 25) /* Frame Sync Relative Timing */ | ||
147 | |||
148 | /* PXA3xx */ | ||
149 | #define SSPSP_EDMYSTRT(x) ((x) << 26) /* Extended Dummy Start */ | ||
150 | #define SSPSP_EDMYSTOP(x) ((x) << 28) /* Extended Dummy Stop */ | ||
151 | #define SSPSP_TIMING_MASK (0x7f8001f0) | ||
152 | |||
153 | #define SSACD_SCDB (1 << 3) /* SSPSYSCLK Divider Bypass */ | ||
154 | #define SSACD_ACPS(x) ((x) << 4) /* Audio clock PLL select */ | ||
155 | #define SSACD_ACDS(x) ((x) << 0) /* Audio clock divider select */ | ||
156 | #define SSACD_SCDX8 (1 << 7) /* SYSCLK division ratio select */ | ||
157 | |||
158 | enum pxa_ssp_type { | ||
159 | SSP_UNDEFINED = 0, | ||
160 | PXA25x_SSP, /* pxa 210, 250, 255, 26x */ | ||
161 | PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */ | ||
162 | PXA27x_SSP, | ||
163 | PXA168_SSP, | ||
164 | CE4100_SSP, | ||
165 | }; | ||
166 | |||
167 | struct ssp_device { | ||
168 | struct platform_device *pdev; | ||
169 | struct list_head node; | ||
170 | |||
171 | struct clk *clk; | ||
172 | void __iomem *mmio_base; | ||
173 | unsigned long phys_base; | ||
174 | |||
175 | const char *label; | ||
176 | int port_id; | ||
177 | int type; | ||
178 | int use_count; | ||
179 | int irq; | ||
180 | int drcmr_rx; | ||
181 | int drcmr_tx; | ||
182 | }; | ||
183 | |||
184 | /** | ||
185 | * pxa_ssp_write_reg - Write to a SSP register | ||
186 | * | ||
187 | * @dev: SSP device to access | ||
188 | * @reg: Register to write to | ||
189 | * @val: Value to be written. | ||
190 | */ | ||
191 | static inline void pxa_ssp_write_reg(struct ssp_device *dev, u32 reg, u32 val) | ||
192 | { | ||
193 | __raw_writel(val, dev->mmio_base + reg); | ||
194 | } | ||
195 | |||
196 | /** | ||
197 | * pxa_ssp_read_reg - Read from a SSP register | ||
198 | * | ||
199 | * @dev: SSP device to access | ||
200 | * @reg: Register to read from | ||
201 | */ | ||
202 | static inline u32 pxa_ssp_read_reg(struct ssp_device *dev, u32 reg) | ||
203 | { | ||
204 | return __raw_readl(dev->mmio_base + reg); | ||
205 | } | ||
206 | |||
207 | struct ssp_device *pxa_ssp_request(int port, const char *label); | ||
208 | void pxa_ssp_free(struct ssp_device *); | ||
209 | #endif | ||
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/rculist.h b/include/linux/rculist.h index f31ef61f1c65..2dea94fc4402 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -241,11 +241,6 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
241 | #define list_first_entry_rcu(ptr, type, member) \ | 241 | #define list_first_entry_rcu(ptr, type, member) \ |
242 | list_entry_rcu((ptr)->next, type, member) | 242 | list_entry_rcu((ptr)->next, type, member) |
243 | 243 | ||
244 | #define __list_for_each_rcu(pos, head) \ | ||
245 | for (pos = rcu_dereference_raw(list_next_rcu(head)); \ | ||
246 | pos != (head); \ | ||
247 | pos = rcu_dereference_raw(list_next_rcu((pos))) | ||
248 | |||
249 | /** | 244 | /** |
250 | * list_for_each_entry_rcu - iterate over rcu list of given type | 245 | * list_for_each_entry_rcu - iterate over rcu list of given type |
251 | * @pos: the type * to use as a loop cursor. | 246 | * @pos: the type * to use as a loop cursor. |
diff --git a/include/linux/rculist_bl.h b/include/linux/rculist_bl.h new file mode 100644 index 000000000000..b872b493724d --- /dev/null +++ b/include/linux/rculist_bl.h | |||
@@ -0,0 +1,127 @@ | |||
1 | #ifndef _LINUX_RCULIST_BL_H | ||
2 | #define _LINUX_RCULIST_BL_H | ||
3 | |||
4 | /* | ||
5 | * RCU-protected bl list version. See include/linux/list_bl.h. | ||
6 | */ | ||
7 | #include <linux/list_bl.h> | ||
8 | #include <linux/rcupdate.h> | ||
9 | |||
10 | static inline void hlist_bl_set_first_rcu(struct hlist_bl_head *h, | ||
11 | struct hlist_bl_node *n) | ||
12 | { | ||
13 | LIST_BL_BUG_ON((unsigned long)n & LIST_BL_LOCKMASK); | ||
14 | LIST_BL_BUG_ON(!((unsigned long)h->first & LIST_BL_LOCKMASK)); | ||
15 | rcu_assign_pointer(h->first, | ||
16 | (struct hlist_bl_node *)((unsigned long)n | LIST_BL_LOCKMASK)); | ||
17 | } | ||
18 | |||
19 | static inline struct hlist_bl_node *hlist_bl_first_rcu(struct hlist_bl_head *h) | ||
20 | { | ||
21 | return (struct hlist_bl_node *) | ||
22 | ((unsigned long)rcu_dereference(h->first) & ~LIST_BL_LOCKMASK); | ||
23 | } | ||
24 | |||
25 | /** | ||
26 | * hlist_bl_del_init_rcu - deletes entry from hash list with re-initialization | ||
27 | * @n: the element to delete from the hash list. | ||
28 | * | ||
29 | * Note: hlist_bl_unhashed() on the node returns true after this. It is | ||
30 | * useful for RCU based read lockfree traversal if the writer side | ||
31 | * must know if the list entry is still hashed or already unhashed. | ||
32 | * | ||
33 | * In particular, it means that we can not poison the forward pointers | ||
34 | * that may still be used for walking the hash list and we can only | ||
35 | * zero the pprev pointer so list_unhashed() will return true after | ||
36 | * this. | ||
37 | * | ||
38 | * The caller must take whatever precautions are necessary (such as | ||
39 | * holding appropriate locks) to avoid racing with another | ||
40 | * list-mutation primitive, such as hlist_bl_add_head_rcu() or | ||
41 | * hlist_bl_del_rcu(), running on this same list. However, it is | ||
42 | * perfectly legal to run concurrently with the _rcu list-traversal | ||
43 | * primitives, such as hlist_bl_for_each_entry_rcu(). | ||
44 | */ | ||
45 | static inline void hlist_bl_del_init_rcu(struct hlist_bl_node *n) | ||
46 | { | ||
47 | if (!hlist_bl_unhashed(n)) { | ||
48 | __hlist_bl_del(n); | ||
49 | n->pprev = NULL; | ||
50 | } | ||
51 | } | ||
52 | |||
53 | /** | ||
54 | * hlist_bl_del_rcu - deletes entry from hash list without re-initialization | ||
55 | * @n: the element to delete from the hash list. | ||
56 | * | ||
57 | * Note: hlist_bl_unhashed() on entry does not return true after this, | ||
58 | * the entry is in an undefined state. It is useful for RCU based | ||
59 | * lockfree traversal. | ||
60 | * | ||
61 | * In particular, it means that we can not poison the forward | ||
62 | * pointers that may still be used for walking the hash list. | ||
63 | * | ||
64 | * The caller must take whatever precautions are necessary | ||
65 | * (such as holding appropriate locks) to avoid racing | ||
66 | * with another list-mutation primitive, such as hlist_bl_add_head_rcu() | ||
67 | * or hlist_bl_del_rcu(), running on this same list. | ||
68 | * However, it is perfectly legal to run concurrently with | ||
69 | * the _rcu list-traversal primitives, such as | ||
70 | * hlist_bl_for_each_entry(). | ||
71 | */ | ||
72 | static inline void hlist_bl_del_rcu(struct hlist_bl_node *n) | ||
73 | { | ||
74 | __hlist_bl_del(n); | ||
75 | n->pprev = LIST_POISON2; | ||
76 | } | ||
77 | |||
78 | /** | ||
79 | * hlist_bl_add_head_rcu | ||
80 | * @n: the element to add to the hash list. | ||
81 | * @h: the list to add to. | ||
82 | * | ||
83 | * Description: | ||
84 | * Adds the specified element to the specified hlist_bl, | ||
85 | * while permitting racing traversals. | ||
86 | * | ||
87 | * The caller must take whatever precautions are necessary | ||
88 | * (such as holding appropriate locks) to avoid racing | ||
89 | * with another list-mutation primitive, such as hlist_bl_add_head_rcu() | ||
90 | * or hlist_bl_del_rcu(), running on this same list. | ||
91 | * However, it is perfectly legal to run concurrently with | ||
92 | * the _rcu list-traversal primitives, such as | ||
93 | * hlist_bl_for_each_entry_rcu(), used to prevent memory-consistency | ||
94 | * problems on Alpha CPUs. Regardless of the type of CPU, the | ||
95 | * list-traversal primitive must be guarded by rcu_read_lock(). | ||
96 | */ | ||
97 | static inline void hlist_bl_add_head_rcu(struct hlist_bl_node *n, | ||
98 | struct hlist_bl_head *h) | ||
99 | { | ||
100 | struct hlist_bl_node *first; | ||
101 | |||
102 | /* don't need hlist_bl_first_rcu because we're under lock */ | ||
103 | first = hlist_bl_first(h); | ||
104 | |||
105 | n->next = first; | ||
106 | if (first) | ||
107 | first->pprev = &n->next; | ||
108 | n->pprev = &h->first; | ||
109 | |||
110 | /* need _rcu because we can have concurrent lock free readers */ | ||
111 | hlist_bl_set_first_rcu(h, n); | ||
112 | } | ||
113 | /** | ||
114 | * hlist_bl_for_each_entry_rcu - iterate over rcu list of given type | ||
115 | * @tpos: the type * to use as a loop cursor. | ||
116 | * @pos: the &struct hlist_bl_node to use as a loop cursor. | ||
117 | * @head: the head for your list. | ||
118 | * @member: the name of the hlist_bl_node within the struct. | ||
119 | * | ||
120 | */ | ||
121 | #define hlist_bl_for_each_entry_rcu(tpos, pos, head, member) \ | ||
122 | for (pos = hlist_bl_first_rcu(head); \ | ||
123 | pos && \ | ||
124 | ({ tpos = hlist_bl_entry(pos, typeof(*tpos), member); 1; }); \ | ||
125 | pos = rcu_dereference_raw(pos->next)) | ||
126 | |||
127 | #endif | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 03cda7bed985..af5614856285 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -47,6 +47,8 @@ | |||
47 | extern int rcutorture_runnable; /* for sysctl */ | 47 | extern int rcutorture_runnable; /* for sysctl */ |
48 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ | 48 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ |
49 | 49 | ||
50 | #define UINT_CMP_GE(a, b) (UINT_MAX / 2 >= (a) - (b)) | ||
51 | #define UINT_CMP_LT(a, b) (UINT_MAX / 2 < (a) - (b)) | ||
50 | #define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b)) | 52 | #define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b)) |
51 | #define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b)) | 53 | #define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b)) |
52 | 54 | ||
@@ -66,7 +68,6 @@ extern void call_rcu_sched(struct rcu_head *head, | |||
66 | extern void synchronize_sched(void); | 68 | extern void synchronize_sched(void); |
67 | extern void rcu_barrier_bh(void); | 69 | extern void rcu_barrier_bh(void); |
68 | extern void rcu_barrier_sched(void); | 70 | extern void rcu_barrier_sched(void); |
69 | extern void synchronize_sched_expedited(void); | ||
70 | extern int sched_expedited_torture_stats(char *page); | 71 | extern int sched_expedited_torture_stats(char *page); |
71 | 72 | ||
72 | static inline void __rcu_read_lock_bh(void) | 73 | static inline void __rcu_read_lock_bh(void) |
@@ -118,7 +119,6 @@ static inline int rcu_preempt_depth(void) | |||
118 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ | 119 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ |
119 | 120 | ||
120 | /* Internal to kernel */ | 121 | /* Internal to kernel */ |
121 | extern void rcu_init(void); | ||
122 | extern void rcu_sched_qs(int cpu); | 122 | extern void rcu_sched_qs(int cpu); |
123 | extern void rcu_bh_qs(int cpu); | 123 | extern void rcu_bh_qs(int cpu); |
124 | extern void rcu_check_callbacks(int cpu, int user); | 124 | extern void rcu_check_callbacks(int cpu, int user); |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 13877cb93a60..30ebd7c8d874 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -27,7 +27,9 @@ | |||
27 | 27 | ||
28 | #include <linux/cache.h> | 28 | #include <linux/cache.h> |
29 | 29 | ||
30 | #define rcu_init_sched() do { } while (0) | 30 | static inline void rcu_init(void) |
31 | { | ||
32 | } | ||
31 | 33 | ||
32 | #ifdef CONFIG_TINY_RCU | 34 | #ifdef CONFIG_TINY_RCU |
33 | 35 | ||
@@ -58,6 +60,11 @@ static inline void synchronize_rcu_bh_expedited(void) | |||
58 | synchronize_sched(); | 60 | synchronize_sched(); |
59 | } | 61 | } |
60 | 62 | ||
63 | static inline void synchronize_sched_expedited(void) | ||
64 | { | ||
65 | synchronize_sched(); | ||
66 | } | ||
67 | |||
61 | #ifdef CONFIG_TINY_RCU | 68 | #ifdef CONFIG_TINY_RCU |
62 | 69 | ||
63 | static inline void rcu_preempt_note_context_switch(void) | 70 | static inline void rcu_preempt_note_context_switch(void) |
@@ -125,16 +132,12 @@ static inline void rcu_cpu_stall_reset(void) | |||
125 | } | 132 | } |
126 | 133 | ||
127 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 134 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
128 | |||
129 | extern int rcu_scheduler_active __read_mostly; | 135 | extern int rcu_scheduler_active __read_mostly; |
130 | extern void rcu_scheduler_starting(void); | 136 | extern void rcu_scheduler_starting(void); |
131 | |||
132 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 137 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
133 | |||
134 | static inline void rcu_scheduler_starting(void) | 138 | static inline void rcu_scheduler_starting(void) |
135 | { | 139 | { |
136 | } | 140 | } |
137 | |||
138 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | 141 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ |
139 | 142 | ||
140 | #endif /* __LINUX_RCUTINY_H */ | 143 | #endif /* __LINUX_RCUTINY_H */ |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 95518e628794..3a933482734a 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #ifndef __LINUX_RCUTREE_H | 30 | #ifndef __LINUX_RCUTREE_H |
31 | #define __LINUX_RCUTREE_H | 31 | #define __LINUX_RCUTREE_H |
32 | 32 | ||
33 | extern void rcu_init(void); | ||
33 | extern void rcu_note_context_switch(int cpu); | 34 | extern void rcu_note_context_switch(int cpu); |
34 | extern int rcu_needs_cpu(int cpu); | 35 | extern int rcu_needs_cpu(int cpu); |
35 | extern void rcu_cpu_stall_reset(void); | 36 | extern void rcu_cpu_stall_reset(void); |
@@ -47,6 +48,7 @@ static inline void exit_rcu(void) | |||
47 | #endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ | 48 | #endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ |
48 | 49 | ||
49 | extern void synchronize_rcu_bh(void); | 50 | extern void synchronize_rcu_bh(void); |
51 | extern void synchronize_sched_expedited(void); | ||
50 | extern void synchronize_rcu_expedited(void); | 52 | extern void synchronize_rcu_expedited(void); |
51 | 53 | ||
52 | static inline void synchronize_rcu_bh_expedited(void) | 54 | static inline void synchronize_rcu_bh_expedited(void) |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 5ca47e59b727..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> |
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index b2cf2089769b..3b94c91f20a6 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h | |||
@@ -41,7 +41,7 @@ int reiserfs_xattr_init(struct super_block *sb, int mount_flags); | |||
41 | int reiserfs_lookup_privroot(struct super_block *sb); | 41 | int reiserfs_lookup_privroot(struct super_block *sb); |
42 | int reiserfs_delete_xattrs(struct inode *inode); | 42 | int reiserfs_delete_xattrs(struct inode *inode); |
43 | int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); | 43 | int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); |
44 | int reiserfs_permission(struct inode *inode, int mask); | 44 | int reiserfs_permission(struct inode *inode, int mask, unsigned int flags); |
45 | 45 | ||
46 | #ifdef CONFIG_REISERFS_FS_XATTR | 46 | #ifdef CONFIG_REISERFS_FS_XATTR |
47 | #define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) | 47 | #define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) |
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/rfkill.h b/include/linux/rfkill.h index 08c32e4f261a..c6c608482cba 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -354,37 +354,6 @@ static inline bool rfkill_blocked(struct rfkill *rfkill) | |||
354 | } | 354 | } |
355 | #endif /* RFKILL || RFKILL_MODULE */ | 355 | #endif /* RFKILL || RFKILL_MODULE */ |
356 | 356 | ||
357 | |||
358 | #ifdef CONFIG_RFKILL_LEDS | ||
359 | /** | ||
360 | * rfkill_get_led_trigger_name - Get the LED trigger name for the button's LED. | ||
361 | * This function might return a NULL pointer if registering of the | ||
362 | * LED trigger failed. Use this as "default_trigger" for the LED. | ||
363 | */ | ||
364 | const char *rfkill_get_led_trigger_name(struct rfkill *rfkill); | ||
365 | |||
366 | /** | ||
367 | * rfkill_set_led_trigger_name -- set the LED trigger name | ||
368 | * @rfkill: rfkill struct | ||
369 | * @name: LED trigger name | ||
370 | * | ||
371 | * This function sets the LED trigger name of the radio LED | ||
372 | * trigger that rfkill creates. It is optional, but if called | ||
373 | * must be called before rfkill_register() to be effective. | ||
374 | */ | ||
375 | void rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name); | ||
376 | #else | ||
377 | static inline const char *rfkill_get_led_trigger_name(struct rfkill *rfkill) | ||
378 | { | ||
379 | return NULL; | ||
380 | } | ||
381 | |||
382 | static inline void | ||
383 | rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name) | ||
384 | { | ||
385 | } | ||
386 | #endif | ||
387 | |||
388 | #endif /* __KERNEL__ */ | 357 | #endif /* __KERNEL__ */ |
389 | 358 | ||
390 | #endif /* RFKILL_H */ | 359 | #endif /* RFKILL_H */ |
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 d0036e52a24a..341acbbc434a 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 | ||
@@ -316,6 +316,7 @@ extern int proc_dowatchdog_thresh(struct ctl_table *table, int write, | |||
316 | size_t *lenp, loff_t *ppos); | 316 | size_t *lenp, loff_t *ppos); |
317 | extern unsigned int softlockup_panic; | 317 | extern unsigned int softlockup_panic; |
318 | extern int softlockup_thresh; | 318 | extern int softlockup_thresh; |
319 | void lockup_detector_init(void); | ||
319 | #else | 320 | #else |
320 | static inline void touch_softlockup_watchdog(void) | 321 | static inline void touch_softlockup_watchdog(void) |
321 | { | 322 | { |
@@ -326,6 +327,9 @@ static inline void touch_softlockup_watchdog_sync(void) | |||
326 | static inline void touch_all_softlockup_watchdogs(void) | 327 | static inline void touch_all_softlockup_watchdogs(void) |
327 | { | 328 | { |
328 | } | 329 | } |
330 | static inline void lockup_detector_init(void) | ||
331 | { | ||
332 | } | ||
329 | #endif | 333 | #endif |
330 | 334 | ||
331 | #ifdef CONFIG_DETECT_HUNG_TASK | 335 | #ifdef CONFIG_DETECT_HUNG_TASK |
@@ -509,6 +513,8 @@ struct thread_group_cputimer { | |||
509 | spinlock_t lock; | 513 | spinlock_t lock; |
510 | }; | 514 | }; |
511 | 515 | ||
516 | struct autogroup; | ||
517 | |||
512 | /* | 518 | /* |
513 | * NOTE! "signal_struct" does not have it's own | 519 | * NOTE! "signal_struct" does not have it's own |
514 | * locking, because a shared signal_struct always | 520 | * locking, because a shared signal_struct always |
@@ -576,6 +582,9 @@ struct signal_struct { | |||
576 | 582 | ||
577 | struct tty_struct *tty; /* NULL if no tty */ | 583 | struct tty_struct *tty; /* NULL if no tty */ |
578 | 584 | ||
585 | #ifdef CONFIG_SCHED_AUTOGROUP | ||
586 | struct autogroup *autogroup; | ||
587 | #endif | ||
579 | /* | 588 | /* |
580 | * Cumulative resource counters for dead threads in the group, | 589 | * Cumulative resource counters for dead threads in the group, |
581 | * and for reaped dead child processes forked by this group. | 590 | * and for reaped dead child processes forked by this group. |
@@ -862,6 +871,7 @@ struct sched_group { | |||
862 | * single CPU. | 871 | * single CPU. |
863 | */ | 872 | */ |
864 | unsigned int cpu_power, cpu_power_orig; | 873 | unsigned int cpu_power, cpu_power_orig; |
874 | unsigned int group_weight; | ||
865 | 875 | ||
866 | /* | 876 | /* |
867 | * The CPUs this group covers. | 877 | * The CPUs this group covers. |
@@ -1228,13 +1238,18 @@ struct task_struct { | |||
1228 | #ifdef CONFIG_TREE_PREEMPT_RCU | 1238 | #ifdef CONFIG_TREE_PREEMPT_RCU |
1229 | struct rcu_node *rcu_blocked_node; | 1239 | struct rcu_node *rcu_blocked_node; |
1230 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 1240 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
1241 | #ifdef CONFIG_RCU_BOOST | ||
1242 | struct rt_mutex *rcu_boost_mutex; | ||
1243 | #endif /* #ifdef CONFIG_RCU_BOOST */ | ||
1231 | 1244 | ||
1232 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) | 1245 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) |
1233 | struct sched_info sched_info; | 1246 | struct sched_info sched_info; |
1234 | #endif | 1247 | #endif |
1235 | 1248 | ||
1236 | struct list_head tasks; | 1249 | struct list_head tasks; |
1250 | #ifdef CONFIG_SMP | ||
1237 | struct plist_node pushable_tasks; | 1251 | struct plist_node pushable_tasks; |
1252 | #endif | ||
1238 | 1253 | ||
1239 | struct mm_struct *mm, *active_mm; | 1254 | struct mm_struct *mm, *active_mm; |
1240 | #if defined(SPLIT_RSS_COUNTING) | 1255 | #if defined(SPLIT_RSS_COUNTING) |
@@ -1758,7 +1773,8 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
1758 | #ifdef CONFIG_PREEMPT_RCU | 1773 | #ifdef CONFIG_PREEMPT_RCU |
1759 | 1774 | ||
1760 | #define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ | 1775 | #define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ |
1761 | #define RCU_READ_UNLOCK_NEED_QS (1 << 1) /* RCU core needs CPU response. */ | 1776 | #define RCU_READ_UNLOCK_BOOSTED (1 << 1) /* boosted while in RCU read-side. */ |
1777 | #define RCU_READ_UNLOCK_NEED_QS (1 << 2) /* RCU core needs CPU response. */ | ||
1762 | 1778 | ||
1763 | static inline void rcu_copy_process(struct task_struct *p) | 1779 | static inline void rcu_copy_process(struct task_struct *p) |
1764 | { | 1780 | { |
@@ -1766,7 +1782,10 @@ static inline void rcu_copy_process(struct task_struct *p) | |||
1766 | p->rcu_read_unlock_special = 0; | 1782 | p->rcu_read_unlock_special = 0; |
1767 | #ifdef CONFIG_TREE_PREEMPT_RCU | 1783 | #ifdef CONFIG_TREE_PREEMPT_RCU |
1768 | p->rcu_blocked_node = NULL; | 1784 | p->rcu_blocked_node = NULL; |
1769 | #endif | 1785 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
1786 | #ifdef CONFIG_RCU_BOOST | ||
1787 | p->rcu_boost_mutex = NULL; | ||
1788 | #endif /* #ifdef CONFIG_RCU_BOOST */ | ||
1770 | INIT_LIST_HEAD(&p->rcu_node_entry); | 1789 | INIT_LIST_HEAD(&p->rcu_node_entry); |
1771 | } | 1790 | } |
1772 | 1791 | ||
@@ -1871,14 +1890,11 @@ extern void sched_clock_idle_sleep_event(void); | |||
1871 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); | 1890 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); |
1872 | 1891 | ||
1873 | #ifdef CONFIG_HOTPLUG_CPU | 1892 | #ifdef CONFIG_HOTPLUG_CPU |
1874 | extern void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p); | ||
1875 | extern void idle_task_exit(void); | 1893 | extern void idle_task_exit(void); |
1876 | #else | 1894 | #else |
1877 | static inline void idle_task_exit(void) {} | 1895 | static inline void idle_task_exit(void) {} |
1878 | #endif | 1896 | #endif |
1879 | 1897 | ||
1880 | extern void sched_idle_next(void); | ||
1881 | |||
1882 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) | 1898 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) |
1883 | extern void wake_up_idle_cpu(int cpu); | 1899 | extern void wake_up_idle_cpu(int cpu); |
1884 | #else | 1900 | #else |
@@ -1888,8 +1904,6 @@ static inline void wake_up_idle_cpu(int cpu) { } | |||
1888 | extern unsigned int sysctl_sched_latency; | 1904 | extern unsigned int sysctl_sched_latency; |
1889 | extern unsigned int sysctl_sched_min_granularity; | 1905 | extern unsigned int sysctl_sched_min_granularity; |
1890 | extern unsigned int sysctl_sched_wakeup_granularity; | 1906 | extern unsigned int sysctl_sched_wakeup_granularity; |
1891 | extern unsigned int sysctl_sched_shares_ratelimit; | ||
1892 | extern unsigned int sysctl_sched_shares_thresh; | ||
1893 | extern unsigned int sysctl_sched_child_runs_first; | 1907 | extern unsigned int sysctl_sched_child_runs_first; |
1894 | 1908 | ||
1895 | enum sched_tunable_scaling { | 1909 | enum sched_tunable_scaling { |
@@ -1905,6 +1919,7 @@ extern unsigned int sysctl_sched_migration_cost; | |||
1905 | extern unsigned int sysctl_sched_nr_migrate; | 1919 | extern unsigned int sysctl_sched_nr_migrate; |
1906 | extern unsigned int sysctl_sched_time_avg; | 1920 | extern unsigned int sysctl_sched_time_avg; |
1907 | extern unsigned int sysctl_timer_migration; | 1921 | extern unsigned int sysctl_timer_migration; |
1922 | extern unsigned int sysctl_sched_shares_window; | ||
1908 | 1923 | ||
1909 | int sched_proc_update_handler(struct ctl_table *table, int write, | 1924 | int sched_proc_update_handler(struct ctl_table *table, int write, |
1910 | void __user *buffer, size_t *length, | 1925 | void __user *buffer, size_t *length, |
@@ -1930,6 +1945,24 @@ int sched_rt_handler(struct ctl_table *table, int write, | |||
1930 | 1945 | ||
1931 | extern unsigned int sysctl_sched_compat_yield; | 1946 | extern unsigned int sysctl_sched_compat_yield; |
1932 | 1947 | ||
1948 | #ifdef CONFIG_SCHED_AUTOGROUP | ||
1949 | extern unsigned int sysctl_sched_autogroup_enabled; | ||
1950 | |||
1951 | extern void sched_autogroup_create_attach(struct task_struct *p); | ||
1952 | extern void sched_autogroup_detach(struct task_struct *p); | ||
1953 | extern void sched_autogroup_fork(struct signal_struct *sig); | ||
1954 | extern void sched_autogroup_exit(struct signal_struct *sig); | ||
1955 | #ifdef CONFIG_PROC_FS | ||
1956 | extern void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m); | ||
1957 | extern int proc_sched_autogroup_set_nice(struct task_struct *p, int *nice); | ||
1958 | #endif | ||
1959 | #else | ||
1960 | static inline void sched_autogroup_create_attach(struct task_struct *p) { } | ||
1961 | static inline void sched_autogroup_detach(struct task_struct *p) { } | ||
1962 | static inline void sched_autogroup_fork(struct signal_struct *sig) { } | ||
1963 | static inline void sched_autogroup_exit(struct signal_struct *sig) { } | ||
1964 | #endif | ||
1965 | |||
1933 | #ifdef CONFIG_RT_MUTEXES | 1966 | #ifdef CONFIG_RT_MUTEXES |
1934 | extern int rt_mutex_getprio(struct task_struct *p); | 1967 | extern int rt_mutex_getprio(struct task_struct *p); |
1935 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | 1968 | extern void rt_mutex_setprio(struct task_struct *p, int prio); |
@@ -1948,9 +1981,10 @@ extern int task_nice(const struct task_struct *p); | |||
1948 | extern int can_nice(const struct task_struct *p, const int nice); | 1981 | extern int can_nice(const struct task_struct *p, const int nice); |
1949 | extern int task_curr(const struct task_struct *p); | 1982 | extern int task_curr(const struct task_struct *p); |
1950 | extern int idle_cpu(int cpu); | 1983 | extern int idle_cpu(int cpu); |
1951 | extern int sched_setscheduler(struct task_struct *, int, struct sched_param *); | 1984 | extern int sched_setscheduler(struct task_struct *, int, |
1985 | const struct sched_param *); | ||
1952 | extern int sched_setscheduler_nocheck(struct task_struct *, int, | 1986 | extern int sched_setscheduler_nocheck(struct task_struct *, int, |
1953 | struct sched_param *); | 1987 | const struct sched_param *); |
1954 | extern struct task_struct *idle_task(int cpu); | 1988 | extern struct task_struct *idle_task(int cpu); |
1955 | extern struct task_struct *curr_task(int cpu); | 1989 | extern struct task_struct *curr_task(int cpu); |
1956 | extern void set_curr_task(int cpu, struct task_struct *p); | 1990 | extern void set_curr_task(int cpu, struct task_struct *p); |
@@ -2477,7 +2511,7 @@ extern void normalize_rt_tasks(void); | |||
2477 | 2511 | ||
2478 | #ifdef CONFIG_CGROUP_SCHED | 2512 | #ifdef CONFIG_CGROUP_SCHED |
2479 | 2513 | ||
2480 | extern struct task_group init_task_group; | 2514 | extern struct task_group root_task_group; |
2481 | 2515 | ||
2482 | extern struct task_group *sched_create_group(struct task_group *parent); | 2516 | extern struct task_group *sched_create_group(struct task_group *parent); |
2483 | extern void sched_destroy_group(struct task_group *tg); | 2517 | extern void sched_destroy_group(struct task_group *tg); |
diff --git a/include/linux/security.h b/include/linux/security.h index b8246a8df7d2..1ac42475ea08 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; |
@@ -458,7 +457,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
458 | * called when the actual read/write operations are performed. | 457 | * called when the actual read/write operations are performed. |
459 | * @inode contains the inode structure to check. | 458 | * @inode contains the inode structure to check. |
460 | * @mask contains the permission mask. | 459 | * @mask contains the permission mask. |
461 | * @nd contains the nameidata (may be NULL). | ||
462 | * Return 0 if permission is granted. | 460 | * Return 0 if permission is granted. |
463 | * @inode_setattr: | 461 | * @inode_setattr: |
464 | * Check permission before setting file attributes. Note that the kernel | 462 | * Check permission before setting file attributes. Note that the kernel |
@@ -797,8 +795,9 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
797 | * @unix_stream_connect: | 795 | * @unix_stream_connect: |
798 | * Check permissions before establishing a Unix domain stream connection | 796 | * Check permissions before establishing a Unix domain stream connection |
799 | * between @sock and @other. | 797 | * between @sock and @other. |
800 | * @sock contains the socket structure. | 798 | * @sock contains the sock structure. |
801 | * @other contains the peer socket structure. | 799 | * @other contains the peer sock structure. |
800 | * @newsk contains the new sock structure. | ||
802 | * Return 0 if permission is granted. | 801 | * Return 0 if permission is granted. |
803 | * @unix_may_send: | 802 | * @unix_may_send: |
804 | * Check permissions before connecting or sending datagrams from @sock to | 803 | * Check permissions before connecting or sending datagrams from @sock to |
@@ -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 | ||
@@ -1569,8 +1568,7 @@ struct security_operations { | |||
1569 | int (*inode_getsecctx)(struct inode *inode, void **ctx, u32 *ctxlen); | 1568 | int (*inode_getsecctx)(struct inode *inode, void **ctx, u32 *ctxlen); |
1570 | 1569 | ||
1571 | #ifdef CONFIG_SECURITY_NETWORK | 1570 | #ifdef CONFIG_SECURITY_NETWORK |
1572 | int (*unix_stream_connect) (struct socket *sock, | 1571 | int (*unix_stream_connect) (struct sock *sock, struct sock *other, struct sock *newsk); |
1573 | struct socket *other, struct sock *newsk); | ||
1574 | int (*unix_may_send) (struct socket *sock, struct socket *other); | 1572 | int (*unix_may_send) (struct socket *sock, struct socket *other); |
1575 | 1573 | ||
1576 | int (*socket_create) (int family, int type, int protocol, int kern); | 1574 | int (*socket_create) (int family, int type, int protocol, int kern); |
@@ -1671,7 +1669,7 @@ int security_real_capable_noaudit(struct task_struct *tsk, int cap); | |||
1671 | int security_sysctl(struct ctl_table *table, int op); | 1669 | int security_sysctl(struct ctl_table *table, int op); |
1672 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); | 1670 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); |
1673 | int security_quota_on(struct dentry *dentry); | 1671 | int security_quota_on(struct dentry *dentry); |
1674 | int security_syslog(int type, bool from_file); | 1672 | int security_syslog(int type); |
1675 | int security_settime(struct timespec *ts, struct timezone *tz); | 1673 | int security_settime(struct timespec *ts, struct timezone *tz); |
1676 | int security_vm_enough_memory(long pages); | 1674 | int security_vm_enough_memory(long pages); |
1677 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); | 1675 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); |
@@ -1714,6 +1712,7 @@ int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1714 | int security_inode_readlink(struct dentry *dentry); | 1712 | int security_inode_readlink(struct dentry *dentry); |
1715 | int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); | 1713 | int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); |
1716 | int security_inode_permission(struct inode *inode, int mask); | 1714 | int security_inode_permission(struct inode *inode, int mask); |
1715 | int security_inode_exec_permission(struct inode *inode, unsigned int flags); | ||
1717 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr); | 1716 | int security_inode_setattr(struct dentry *dentry, struct iattr *attr); |
1718 | int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); | 1717 | int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); |
1719 | int security_inode_setxattr(struct dentry *dentry, const char *name, | 1718 | int security_inode_setxattr(struct dentry *dentry, const char *name, |
@@ -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) |
@@ -2103,6 +2102,12 @@ static inline int security_inode_permission(struct inode *inode, int mask) | |||
2103 | return 0; | 2102 | return 0; |
2104 | } | 2103 | } |
2105 | 2104 | ||
2105 | static inline int security_inode_exec_permission(struct inode *inode, | ||
2106 | unsigned int flags) | ||
2107 | { | ||
2108 | return 0; | ||
2109 | } | ||
2110 | |||
2106 | static inline int security_inode_setattr(struct dentry *dentry, | 2111 | static inline int security_inode_setattr(struct dentry *dentry, |
2107 | struct iattr *attr) | 2112 | struct iattr *attr) |
2108 | { | 2113 | { |
@@ -2526,8 +2531,7 @@ static inline int security_inode_getsecctx(struct inode *inode, void **ctx, u32 | |||
2526 | 2531 | ||
2527 | #ifdef CONFIG_SECURITY_NETWORK | 2532 | #ifdef CONFIG_SECURITY_NETWORK |
2528 | 2533 | ||
2529 | int security_unix_stream_connect(struct socket *sock, struct socket *other, | 2534 | int security_unix_stream_connect(struct sock *sock, struct sock *other, struct sock *newsk); |
2530 | struct sock *newsk); | ||
2531 | int security_unix_may_send(struct socket *sock, struct socket *other); | 2535 | int security_unix_may_send(struct socket *sock, struct socket *other); |
2532 | int security_socket_create(int family, int type, int protocol, int kern); | 2536 | int security_socket_create(int family, int type, int protocol, int kern); |
2533 | int security_socket_post_create(struct socket *sock, int family, | 2537 | int security_socket_post_create(struct socket *sock, int family, |
@@ -2568,8 +2572,8 @@ void security_tun_dev_post_create(struct sock *sk); | |||
2568 | int security_tun_dev_attach(struct sock *sk); | 2572 | int security_tun_dev_attach(struct sock *sk); |
2569 | 2573 | ||
2570 | #else /* CONFIG_SECURITY_NETWORK */ | 2574 | #else /* CONFIG_SECURITY_NETWORK */ |
2571 | static inline int security_unix_stream_connect(struct socket *sock, | 2575 | static inline int security_unix_stream_connect(struct sock *sock, |
2572 | struct socket *other, | 2576 | struct sock *other, |
2573 | struct sock *newsk) | 2577 | struct sock *newsk) |
2574 | { | 2578 | { |
2575 | return 0; | 2579 | return 0; |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 632205ccc25d..e98cd2e57194 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -107,7 +107,7 @@ static __always_inline int read_seqretry(const seqlock_t *sl, unsigned start) | |||
107 | { | 107 | { |
108 | smp_rmb(); | 108 | smp_rmb(); |
109 | 109 | ||
110 | return (sl->sequence != start); | 110 | return unlikely(sl->sequence != start); |
111 | } | 111 | } |
112 | 112 | ||
113 | 113 | ||
@@ -125,14 +125,25 @@ typedef struct seqcount { | |||
125 | #define SEQCNT_ZERO { 0 } | 125 | #define SEQCNT_ZERO { 0 } |
126 | #define seqcount_init(x) do { *(x) = (seqcount_t) SEQCNT_ZERO; } while (0) | 126 | #define seqcount_init(x) do { *(x) = (seqcount_t) SEQCNT_ZERO; } while (0) |
127 | 127 | ||
128 | /* Start of read using pointer to a sequence counter only. */ | 128 | /** |
129 | static inline unsigned read_seqcount_begin(const seqcount_t *s) | 129 | * __read_seqcount_begin - begin a seq-read critical section (without barrier) |
130 | * @s: pointer to seqcount_t | ||
131 | * Returns: count to be passed to read_seqcount_retry | ||
132 | * | ||
133 | * __read_seqcount_begin is like read_seqcount_begin, but has no smp_rmb() | ||
134 | * barrier. Callers should ensure that smp_rmb() or equivalent ordering is | ||
135 | * provided before actually loading any of the variables that are to be | ||
136 | * protected in this critical section. | ||
137 | * | ||
138 | * Use carefully, only in critical code, and comment how the barrier is | ||
139 | * provided. | ||
140 | */ | ||
141 | static inline unsigned __read_seqcount_begin(const seqcount_t *s) | ||
130 | { | 142 | { |
131 | unsigned ret; | 143 | unsigned ret; |
132 | 144 | ||
133 | repeat: | 145 | repeat: |
134 | ret = s->sequence; | 146 | ret = s->sequence; |
135 | smp_rmb(); | ||
136 | if (unlikely(ret & 1)) { | 147 | if (unlikely(ret & 1)) { |
137 | cpu_relax(); | 148 | cpu_relax(); |
138 | goto repeat; | 149 | goto repeat; |
@@ -140,14 +151,56 @@ repeat: | |||
140 | return ret; | 151 | return ret; |
141 | } | 152 | } |
142 | 153 | ||
143 | /* | 154 | /** |
144 | * Test if reader processed invalid data because sequence number has changed. | 155 | * read_seqcount_begin - begin a seq-read critical section |
156 | * @s: pointer to seqcount_t | ||
157 | * Returns: count to be passed to read_seqcount_retry | ||
158 | * | ||
159 | * read_seqcount_begin opens a read critical section of the given seqcount. | ||
160 | * Validity of the critical section is tested by checking read_seqcount_retry | ||
161 | * function. | ||
162 | */ | ||
163 | static inline unsigned read_seqcount_begin(const seqcount_t *s) | ||
164 | { | ||
165 | unsigned ret = __read_seqcount_begin(s); | ||
166 | smp_rmb(); | ||
167 | return ret; | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * __read_seqcount_retry - end a seq-read critical section (without barrier) | ||
172 | * @s: pointer to seqcount_t | ||
173 | * @start: count, from read_seqcount_begin | ||
174 | * Returns: 1 if retry is required, else 0 | ||
175 | * | ||
176 | * __read_seqcount_retry is like read_seqcount_retry, but has no smp_rmb() | ||
177 | * barrier. Callers should ensure that smp_rmb() or equivalent ordering is | ||
178 | * provided before actually loading any of the variables that are to be | ||
179 | * protected in this critical section. | ||
180 | * | ||
181 | * Use carefully, only in critical code, and comment how the barrier is | ||
182 | * provided. | ||
183 | */ | ||
184 | static inline int __read_seqcount_retry(const seqcount_t *s, unsigned start) | ||
185 | { | ||
186 | return unlikely(s->sequence != start); | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * read_seqcount_retry - end a seq-read critical section | ||
191 | * @s: pointer to seqcount_t | ||
192 | * @start: count, from read_seqcount_begin | ||
193 | * Returns: 1 if retry is required, else 0 | ||
194 | * | ||
195 | * read_seqcount_retry closes a read critical section of the given seqcount. | ||
196 | * If the critical section was invalid, it must be ignored (and typically | ||
197 | * retried). | ||
145 | */ | 198 | */ |
146 | static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) | 199 | static inline int read_seqcount_retry(const seqcount_t *s, unsigned start) |
147 | { | 200 | { |
148 | smp_rmb(); | 201 | smp_rmb(); |
149 | 202 | ||
150 | return s->sequence != start; | 203 | return __read_seqcount_retry(s, start); |
151 | } | 204 | } |
152 | 205 | ||
153 | 206 | ||
@@ -167,6 +220,19 @@ static inline void write_seqcount_end(seqcount_t *s) | |||
167 | s->sequence++; | 220 | s->sequence++; |
168 | } | 221 | } |
169 | 222 | ||
223 | /** | ||
224 | * write_seqcount_barrier - invalidate in-progress read-side seq operations | ||
225 | * @s: pointer to seqcount_t | ||
226 | * | ||
227 | * After write_seqcount_barrier, no read-side seq operations will complete | ||
228 | * successfully and see data older than this. | ||
229 | */ | ||
230 | static inline void write_seqcount_barrier(seqcount_t *s) | ||
231 | { | ||
232 | smp_wmb(); | ||
233 | s->sequence+=2; | ||
234 | } | ||
235 | |||
170 | /* | 236 | /* |
171 | * Possible sw/hw IRQ protected versions of the interfaces. | 237 | * Possible sw/hw IRQ protected versions of the interfaces. |
172 | */ | 238 | */ |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 212eb4c67797..a23fa29d4eb0 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -95,7 +95,7 @@ | |||
95 | /* PPC CPM type number */ | 95 | /* PPC CPM type number */ |
96 | #define PORT_CPM 58 | 96 | #define PORT_CPM 58 |
97 | 97 | ||
98 | /* MPC52xx type numbers */ | 98 | /* MPC52xx (and MPC512x) type numbers */ |
99 | #define PORT_MPC52xx 59 | 99 | #define PORT_MPC52xx 59 |
100 | 100 | ||
101 | /* IBM icom */ | 101 | /* IBM icom */ |
@@ -199,6 +199,9 @@ | |||
199 | /* TI OMAP-UART */ | 199 | /* TI OMAP-UART */ |
200 | #define PORT_OMAP 96 | 200 | #define PORT_OMAP 96 |
201 | 201 | ||
202 | /* VIA VT8500 SoC */ | ||
203 | #define PORT_VT8500 97 | ||
204 | |||
202 | #ifdef __KERNEL__ | 205 | #ifdef __KERNEL__ |
203 | 206 | ||
204 | #include <linux/compiler.h> | 207 | #include <linux/compiler.h> |
@@ -311,6 +314,7 @@ struct uart_port { | |||
311 | #define UPIO_TSI (5) /* Tsi108/109 type IO */ | 314 | #define UPIO_TSI (5) /* Tsi108/109 type IO */ |
312 | #define UPIO_DWAPB (6) /* DesignWare APB UART */ | 315 | #define UPIO_DWAPB (6) /* DesignWare APB UART */ |
313 | #define UPIO_RM9000 (7) /* RM9000 type IO */ | 316 | #define UPIO_RM9000 (7) /* RM9000 type IO */ |
317 | #define UPIO_DWAPB32 (8) /* DesignWare APB UART (32 bit accesses) */ | ||
314 | 318 | ||
315 | unsigned int read_status_mask; /* driver specific */ | 319 | unsigned int read_status_mask; /* driver specific */ |
316 | unsigned int ignore_status_mask; /* driver specific */ | 320 | unsigned int ignore_status_mask; /* driver specific */ |
@@ -361,6 +365,7 @@ struct uart_port { | |||
361 | struct device *dev; /* parent device */ | 365 | struct device *dev; /* parent device */ |
362 | unsigned char hub6; /* this should be in the 8250 driver */ | 366 | unsigned char hub6; /* this should be in the 8250 driver */ |
363 | unsigned char suspended; | 367 | unsigned char suspended; |
368 | unsigned char irq_wake; | ||
364 | unsigned char unused[2]; | 369 | unsigned char unused[2]; |
365 | void *private_data; /* generic platform data pointer */ | 370 | void *private_data; /* generic platform data pointer */ |
366 | }; | 371 | }; |
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h index c7a0ce11cd47..3ecb71a9e505 100644 --- a/include/linux/serial_reg.h +++ b/include/linux/serial_reg.h | |||
@@ -99,6 +99,13 @@ | |||
99 | #define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */ | 99 | #define UART_LCR_WLEN7 0x02 /* Wordlength: 7 bits */ |
100 | #define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */ | 100 | #define UART_LCR_WLEN8 0x03 /* Wordlength: 8 bits */ |
101 | 101 | ||
102 | /* | ||
103 | * Access to some registers depends on register access / configuration | ||
104 | * mode. | ||
105 | */ | ||
106 | #define UART_LCR_CONF_MODE_A UART_LCR_DLAB /* Configutation mode A */ | ||
107 | #define UART_LCR_CONF_MODE_B 0xBF /* Configutation mode B */ | ||
108 | |||
102 | #define UART_MCR 4 /* Out: Modem Control Register */ | 109 | #define UART_MCR 4 /* Out: Modem Control Register */ |
103 | #define UART_MCR_CLKSEL 0x80 /* Divide clock by 4 (TI16C752, EFR[4]=1) */ | 110 | #define UART_MCR_CLKSEL 0x80 /* Divide clock by 4 (TI16C752, EFR[4]=1) */ |
104 | #define UART_MCR_TCRTLR 0x40 /* Access TCR/TLR (TI16C752, EFR[4]=1) */ | 111 | #define UART_MCR_TCRTLR 0x40 /* Access TCR/TLR (TI16C752, EFR[4]=1) */ |
@@ -341,5 +348,17 @@ | |||
341 | #define UART_OMAP_SYSS 0x16 /* System status register */ | 348 | #define UART_OMAP_SYSS 0x16 /* System status register */ |
342 | #define UART_OMAP_WER 0x17 /* Wake-up enable register */ | 349 | #define UART_OMAP_WER 0x17 /* Wake-up enable register */ |
343 | 350 | ||
351 | /* | ||
352 | * These are the definitions for the MDR1 register | ||
353 | */ | ||
354 | #define UART_OMAP_MDR1_16X_MODE 0x00 /* UART 16x mode */ | ||
355 | #define UART_OMAP_MDR1_SIR_MODE 0x01 /* SIR mode */ | ||
356 | #define UART_OMAP_MDR1_16X_ABAUD_MODE 0x02 /* UART 16x auto-baud */ | ||
357 | #define UART_OMAP_MDR1_13X_MODE 0x03 /* UART 13x mode */ | ||
358 | #define UART_OMAP_MDR1_MIR_MODE 0x04 /* MIR mode */ | ||
359 | #define UART_OMAP_MDR1_FIR_MODE 0x05 /* FIR mode */ | ||
360 | #define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */ | ||
361 | #define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */ | ||
362 | |||
344 | #endif /* _LINUX_SERIAL_REG_H */ | 363 | #endif /* _LINUX_SERIAL_REG_H */ |
345 | 364 | ||
diff --git a/include/linux/sfi.h b/include/linux/sfi.h index 7f770c638e99..fe817918b30e 100644 --- a/include/linux/sfi.h +++ b/include/linux/sfi.h | |||
@@ -77,6 +77,8 @@ | |||
77 | #define SFI_OEM_ID_SIZE 6 | 77 | #define SFI_OEM_ID_SIZE 6 |
78 | #define SFI_OEM_TABLE_ID_SIZE 8 | 78 | #define SFI_OEM_TABLE_ID_SIZE 8 |
79 | 79 | ||
80 | #define SFI_NAME_LEN 16 | ||
81 | |||
80 | #define SFI_SYST_SEARCH_BEGIN 0x000E0000 | 82 | #define SFI_SYST_SEARCH_BEGIN 0x000E0000 |
81 | #define SFI_SYST_SEARCH_END 0x000FFFFF | 83 | #define SFI_SYST_SEARCH_END 0x000FFFFF |
82 | 84 | ||
@@ -156,13 +158,13 @@ struct sfi_device_table_entry { | |||
156 | u16 addr; | 158 | u16 addr; |
157 | u8 irq; | 159 | u8 irq; |
158 | u32 max_freq; | 160 | u32 max_freq; |
159 | char name[16]; | 161 | char name[SFI_NAME_LEN]; |
160 | } __packed; | 162 | } __packed; |
161 | 163 | ||
162 | struct sfi_gpio_table_entry { | 164 | struct sfi_gpio_table_entry { |
163 | char controller_name[16]; | 165 | char controller_name[SFI_NAME_LEN]; |
164 | u16 pin_no; | 166 | u16 pin_no; |
165 | char pin_name[16]; | 167 | char pin_name[SFI_NAME_LEN]; |
166 | } __packed; | 168 | } __packed; |
167 | 169 | ||
168 | typedef int (*sfi_table_handler) (struct sfi_table_header *table); | 170 | typedef int (*sfi_table_handler) (struct sfi_table_header *table); |
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h index cea0c38e7a63..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; |
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h index f656d1a43dc0..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) \ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 4f2db79a2abb..bf221d65d9ad 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -393,9 +393,10 @@ struct sk_buff { | |||
393 | #else | 393 | #else |
394 | __u8 deliver_no_wcard:1; | 394 | __u8 deliver_no_wcard:1; |
395 | #endif | 395 | #endif |
396 | __u8 ooo_okay:1; | ||
396 | kmemcheck_bitfield_end(flags2); | 397 | kmemcheck_bitfield_end(flags2); |
397 | 398 | ||
398 | /* 0/14 bit hole */ | 399 | /* 0/13 bit hole */ |
399 | 400 | ||
400 | #ifdef CONFIG_NET_DMA | 401 | #ifdef CONFIG_NET_DMA |
401 | dma_cookie_t dma_cookie; | 402 | dma_cookie_t dma_cookie; |
@@ -1361,6 +1362,11 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) | |||
1361 | } | 1362 | } |
1362 | #endif /* NET_SKBUFF_DATA_USES_OFFSET */ | 1363 | #endif /* NET_SKBUFF_DATA_USES_OFFSET */ |
1363 | 1364 | ||
1365 | static inline int skb_checksum_start_offset(const struct sk_buff *skb) | ||
1366 | { | ||
1367 | return skb->csum_start - skb_headroom(skb); | ||
1368 | } | ||
1369 | |||
1364 | static inline int skb_transport_offset(const struct sk_buff *skb) | 1370 | static inline int skb_transport_offset(const struct sk_buff *skb) |
1365 | { | 1371 | { |
1366 | return skb_transport_header(skb) - skb->data; | 1372 | return skb_transport_header(skb) - skb->data; |
@@ -2179,8 +2185,9 @@ static inline bool skb_rx_queue_recorded(const struct sk_buff *skb) | |||
2179 | return skb->queue_mapping != 0; | 2185 | return skb->queue_mapping != 0; |
2180 | } | 2186 | } |
2181 | 2187 | ||
2182 | extern u16 skb_tx_hash(const struct net_device *dev, | 2188 | extern u16 __skb_tx_hash(const struct net_device *dev, |
2183 | const struct sk_buff *skb); | 2189 | const struct sk_buff *skb, |
2190 | unsigned int num_tx_queues); | ||
2184 | 2191 | ||
2185 | #ifdef CONFIG_XFRM | 2192 | #ifdef CONFIG_XFRM |
2186 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | 2193 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 59260e21bdf5..fa9086647eb7 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -106,8 +106,6 @@ int kmem_cache_shrink(struct kmem_cache *); | |||
106 | void kmem_cache_free(struct kmem_cache *, void *); | 106 | void kmem_cache_free(struct kmem_cache *, void *); |
107 | unsigned int kmem_cache_size(struct kmem_cache *); | 107 | unsigned int kmem_cache_size(struct kmem_cache *); |
108 | const char *kmem_cache_name(struct kmem_cache *); | 108 | const char *kmem_cache_name(struct kmem_cache *); |
109 | int kern_ptr_validate(const void *ptr, unsigned long size); | ||
110 | int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); | ||
111 | 109 | ||
112 | /* | 110 | /* |
113 | * Please use this macro to create slab caches. Simply specify the | 111 | * Please use this macro to create slab caches. Simply specify the |
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 86b652fabf6e..5f65f14c4f44 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -30,12 +30,10 @@ struct cred; | |||
30 | #define __sockaddr_check_size(size) \ | 30 | #define __sockaddr_check_size(size) \ |
31 | BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage))) | 31 | BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage))) |
32 | 32 | ||
33 | #ifdef __KERNEL__ | 33 | #ifdef CONFIG_PROC_FS |
34 | # ifdef CONFIG_PROC_FS | ||
35 | struct seq_file; | 34 | struct seq_file; |
36 | extern void socket_seq_show(struct seq_file *seq); | 35 | extern void socket_seq_show(struct seq_file *seq); |
37 | # endif | 36 | #endif |
38 | #endif /* __KERNEL__ */ | ||
39 | 37 | ||
40 | typedef unsigned short sa_family_t; | 38 | typedef unsigned short sa_family_t; |
41 | 39 | ||
@@ -311,7 +309,6 @@ struct ucred { | |||
311 | /* IPX options */ | 309 | /* IPX options */ |
312 | #define IPX_TYPE 1 | 310 | #define IPX_TYPE 1 |
313 | 311 | ||
314 | #ifdef __KERNEL__ | ||
315 | extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred); | 312 | extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred); |
316 | 313 | ||
317 | extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); | 314 | extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); |
@@ -333,6 +330,5 @@ struct timespec; | |||
333 | 330 | ||
334 | extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, | 331 | extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, |
335 | unsigned int flags, struct timespec *timeout); | 332 | unsigned int flags, struct timespec *timeout); |
336 | #endif | ||
337 | #endif /* not kernel and not glibc */ | 333 | #endif /* not kernel and not glibc */ |
338 | #endif /* _LINUX_SOCKET_H */ | 334 | #endif /* _LINUX_SOCKET_H */ |
diff --git a/include/linux/spi/dw_spi.h b/include/linux/spi/dw_spi.h index c91302f3a257..6cd10f6ad472 100644 --- a/include/linux/spi/dw_spi.h +++ b/include/linux/spi/dw_spi.h | |||
@@ -1,5 +1,6 @@ | |||
1 | #ifndef DW_SPI_HEADER_H | 1 | #ifndef DW_SPI_HEADER_H |
2 | #define DW_SPI_HEADER_H | 2 | #define DW_SPI_HEADER_H |
3 | |||
3 | #include <linux/io.h> | 4 | #include <linux/io.h> |
4 | 5 | ||
5 | /* Bit fields in CTRLR0 */ | 6 | /* Bit fields in CTRLR0 */ |
@@ -82,6 +83,13 @@ struct dw_spi_reg { | |||
82 | though only low 16 bits matters */ | 83 | though only low 16 bits matters */ |
83 | } __packed; | 84 | } __packed; |
84 | 85 | ||
86 | struct dw_spi; | ||
87 | struct dw_spi_dma_ops { | ||
88 | int (*dma_init)(struct dw_spi *dws); | ||
89 | void (*dma_exit)(struct dw_spi *dws); | ||
90 | int (*dma_transfer)(struct dw_spi *dws, int cs_change); | ||
91 | }; | ||
92 | |||
85 | struct dw_spi { | 93 | struct dw_spi { |
86 | struct spi_master *master; | 94 | struct spi_master *master; |
87 | struct spi_device *cur_dev; | 95 | struct spi_device *cur_dev; |
@@ -136,13 +144,15 @@ struct dw_spi { | |||
136 | /* Dma info */ | 144 | /* Dma info */ |
137 | int dma_inited; | 145 | int dma_inited; |
138 | struct dma_chan *txchan; | 146 | struct dma_chan *txchan; |
147 | struct scatterlist tx_sgl; | ||
139 | struct dma_chan *rxchan; | 148 | struct dma_chan *rxchan; |
140 | int txdma_done; | 149 | struct scatterlist rx_sgl; |
141 | int rxdma_done; | 150 | int dma_chan_done; |
142 | u64 tx_param; | ||
143 | u64 rx_param; | ||
144 | struct device *dma_dev; | 151 | struct device *dma_dev; |
145 | dma_addr_t dma_addr; | 152 | dma_addr_t dma_addr; /* phy address of the Data register */ |
153 | struct dw_spi_dma_ops *dma_ops; | ||
154 | void *dma_priv; /* platform relate info */ | ||
155 | struct pci_dev *dmac; | ||
146 | 156 | ||
147 | /* Bus interface info */ | 157 | /* Bus interface info */ |
148 | void *priv; | 158 | void *priv; |
@@ -216,4 +226,8 @@ extern int dw_spi_add_host(struct dw_spi *dws); | |||
216 | extern void dw_spi_remove_host(struct dw_spi *dws); | 226 | extern void dw_spi_remove_host(struct dw_spi *dws); |
217 | extern int dw_spi_suspend_host(struct dw_spi *dws); | 227 | extern int dw_spi_suspend_host(struct dw_spi *dws); |
218 | extern int dw_spi_resume_host(struct dw_spi *dws); | 228 | extern int dw_spi_resume_host(struct dw_spi *dws); |
229 | extern void dw_spi_xfer_done(struct dw_spi *dws); | ||
230 | |||
231 | /* platform related setup */ | ||
232 | extern int dw_spi_mid_init(struct dw_spi *dws); /* Intel MID platforms */ | ||
219 | #endif /* DW_SPI_HEADER_H */ | 233 | #endif /* DW_SPI_HEADER_H */ |
diff --git a/include/linux/spi/ifx_modem.h b/include/linux/spi/ifx_modem.h new file mode 100644 index 000000000000..a68f3b19d112 --- /dev/null +++ b/include/linux/spi/ifx_modem.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef LINUX_IFX_MODEM_H | ||
2 | #define LINUX_IFX_MODEM_H | ||
3 | |||
4 | struct ifx_modem_platform_data { | ||
5 | unsigned short rst_out; /* modem reset out */ | ||
6 | unsigned short pwr_on; /* power on */ | ||
7 | unsigned short rst_pmu; /* reset modem */ | ||
8 | unsigned short tx_pwr; /* modem power threshold */ | ||
9 | unsigned short srdy; /* SRDY */ | ||
10 | unsigned short mrdy; /* MRDY */ | ||
11 | unsigned short is_6160; /* Modem type */ | ||
12 | }; | ||
13 | |||
14 | #endif | ||
diff --git a/include/linux/spi/pxa2xx_spi.h b/include/linux/spi/pxa2xx_spi.h new file mode 100644 index 000000000000..d3e1075f7b60 --- /dev/null +++ b/include/linux/spi/pxa2xx_spi.h | |||
@@ -0,0 +1,152 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | #ifndef __linux_pxa2xx_spi_h | ||
19 | #define __linux_pxa2xx_spi_h | ||
20 | |||
21 | #include <linux/pxa2xx_ssp.h> | ||
22 | |||
23 | #define PXA2XX_CS_ASSERT (0x01) | ||
24 | #define PXA2XX_CS_DEASSERT (0x02) | ||
25 | |||
26 | /* device.platform_data for SSP controller devices */ | ||
27 | struct pxa2xx_spi_master { | ||
28 | u32 clock_enable; | ||
29 | u16 num_chipselect; | ||
30 | u8 enable_dma; | ||
31 | }; | ||
32 | |||
33 | /* spi_board_info.controller_data for SPI slave devices, | ||
34 | * copied to spi_device.platform_data ... mostly for dma tuning | ||
35 | */ | ||
36 | struct pxa2xx_spi_chip { | ||
37 | u8 tx_threshold; | ||
38 | u8 rx_threshold; | ||
39 | u8 dma_burst_size; | ||
40 | u32 timeout; | ||
41 | u8 enable_loopback; | ||
42 | int gpio_cs; | ||
43 | void (*cs_control)(u32 command); | ||
44 | }; | ||
45 | |||
46 | #ifdef CONFIG_ARCH_PXA | ||
47 | |||
48 | #include <linux/clk.h> | ||
49 | #include <mach/dma.h> | ||
50 | |||
51 | extern void pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info); | ||
52 | |||
53 | #else | ||
54 | /* | ||
55 | * This is the implemtation for CE4100 on x86. ARM defines them in mach/ or | ||
56 | * plat/ include path. | ||
57 | * The CE4100 does not provide DMA support. This bits are here to let the driver | ||
58 | * compile and will never be used. Maybe we get DMA support at a later point in | ||
59 | * time. | ||
60 | */ | ||
61 | |||
62 | #define DCSR(n) (n) | ||
63 | #define DSADR(n) (n) | ||
64 | #define DTADR(n) (n) | ||
65 | #define DCMD(n) (n) | ||
66 | #define DRCMR(n) (n) | ||
67 | |||
68 | #define DCSR_RUN (1 << 31) /* Run Bit */ | ||
69 | #define DCSR_NODESC (1 << 30) /* No-Descriptor Fetch */ | ||
70 | #define DCSR_STOPIRQEN (1 << 29) /* Stop Interrupt Enable */ | ||
71 | #define DCSR_REQPEND (1 << 8) /* Request Pending (read-only) */ | ||
72 | #define DCSR_STOPSTATE (1 << 3) /* Stop State (read-only) */ | ||
73 | #define DCSR_ENDINTR (1 << 2) /* End Interrupt */ | ||
74 | #define DCSR_STARTINTR (1 << 1) /* Start Interrupt */ | ||
75 | #define DCSR_BUSERR (1 << 0) /* Bus Error Interrupt */ | ||
76 | |||
77 | #define DCSR_EORIRQEN (1 << 28) /* End of Receive Interrupt Enable */ | ||
78 | #define DCSR_EORJMPEN (1 << 27) /* Jump to next descriptor on EOR */ | ||
79 | #define DCSR_EORSTOPEN (1 << 26) /* STOP on an EOR */ | ||
80 | #define DCSR_SETCMPST (1 << 25) /* Set Descriptor Compare Status */ | ||
81 | #define DCSR_CLRCMPST (1 << 24) /* Clear Descriptor Compare Status */ | ||
82 | #define DCSR_CMPST (1 << 10) /* The Descriptor Compare Status */ | ||
83 | #define DCSR_EORINTR (1 << 9) /* The end of Receive */ | ||
84 | |||
85 | #define DRCMR_MAPVLD (1 << 7) /* Map Valid */ | ||
86 | #define DRCMR_CHLNUM 0x1f /* mask for Channel Number */ | ||
87 | |||
88 | #define DDADR_DESCADDR 0xfffffff0 /* Address of next descriptor */ | ||
89 | #define DDADR_STOP (1 << 0) /* Stop */ | ||
90 | |||
91 | #define DCMD_INCSRCADDR (1 << 31) /* Source Address Increment Setting. */ | ||
92 | #define DCMD_INCTRGADDR (1 << 30) /* Target Address Increment Setting. */ | ||
93 | #define DCMD_FLOWSRC (1 << 29) /* Flow Control by the source. */ | ||
94 | #define DCMD_FLOWTRG (1 << 28) /* Flow Control by the target. */ | ||
95 | #define DCMD_STARTIRQEN (1 << 22) /* Start Interrupt Enable */ | ||
96 | #define DCMD_ENDIRQEN (1 << 21) /* End Interrupt Enable */ | ||
97 | #define DCMD_ENDIAN (1 << 18) /* Device Endian-ness. */ | ||
98 | #define DCMD_BURST8 (1 << 16) /* 8 byte burst */ | ||
99 | #define DCMD_BURST16 (2 << 16) /* 16 byte burst */ | ||
100 | #define DCMD_BURST32 (3 << 16) /* 32 byte burst */ | ||
101 | #define DCMD_WIDTH1 (1 << 14) /* 1 byte width */ | ||
102 | #define DCMD_WIDTH2 (2 << 14) /* 2 byte width (HalfWord) */ | ||
103 | #define DCMD_WIDTH4 (3 << 14) /* 4 byte width (Word) */ | ||
104 | #define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ | ||
105 | |||
106 | /* | ||
107 | * Descriptor structure for PXA's DMA engine | ||
108 | * Note: this structure must always be aligned to a 16-byte boundary. | ||
109 | */ | ||
110 | |||
111 | typedef enum { | ||
112 | DMA_PRIO_HIGH = 0, | ||
113 | DMA_PRIO_MEDIUM = 1, | ||
114 | DMA_PRIO_LOW = 2 | ||
115 | } pxa_dma_prio; | ||
116 | |||
117 | /* | ||
118 | * DMA registration | ||
119 | */ | ||
120 | |||
121 | static inline int pxa_request_dma(char *name, | ||
122 | pxa_dma_prio prio, | ||
123 | void (*irq_handler)(int, void *), | ||
124 | void *data) | ||
125 | { | ||
126 | return -ENODEV; | ||
127 | } | ||
128 | |||
129 | static inline void pxa_free_dma(int dma_ch) | ||
130 | { | ||
131 | } | ||
132 | |||
133 | /* | ||
134 | * The CE4100 does not have the clk framework implemented and SPI clock can | ||
135 | * not be switched on/off or the divider changed. | ||
136 | */ | ||
137 | static inline void clk_disable(struct clk *clk) | ||
138 | { | ||
139 | } | ||
140 | |||
141 | static inline int clk_enable(struct clk *clk) | ||
142 | { | ||
143 | return 0; | ||
144 | } | ||
145 | |||
146 | static inline unsigned long clk_get_rate(struct clk *clk) | ||
147 | { | ||
148 | return 3686400; | ||
149 | } | ||
150 | |||
151 | #endif | ||
152 | #endif | ||
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 623b704fdc42..9659eff52ca2 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -55,6 +55,10 @@ struct ssb_sprom { | |||
55 | u8 tri5gl; /* 5.2GHz TX isolation */ | 55 | u8 tri5gl; /* 5.2GHz TX isolation */ |
56 | u8 tri5g; /* 5.3GHz TX isolation */ | 56 | u8 tri5g; /* 5.3GHz TX isolation */ |
57 | u8 tri5gh; /* 5.8GHz TX isolation */ | 57 | u8 tri5gh; /* 5.8GHz TX isolation */ |
58 | u8 txpid2g[4]; /* 2GHz TX power index */ | ||
59 | u8 txpid5gl[4]; /* 4.9 - 5.1GHz TX power index */ | ||
60 | u8 txpid5g[4]; /* 5.1 - 5.5GHz TX power index */ | ||
61 | u8 txpid5gh[4]; /* 5.5 - ...GHz TX power index */ | ||
58 | u8 rxpo2g; /* 2GHz RX power offset */ | 62 | u8 rxpo2g; /* 2GHz RX power offset */ |
59 | u8 rxpo5g; /* 5GHz RX power offset */ | 63 | u8 rxpo5g; /* 5GHz RX power offset */ |
60 | u8 rssisav2g; /* 2GHz RSSI params */ | 64 | u8 rssisav2g; /* 2GHz RSSI params */ |
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/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index 11daf9c140e7..489f7b6d61c5 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
@@ -299,6 +299,46 @@ | |||
299 | #define SSB_SPROM4_AGAIN2_SHIFT 0 | 299 | #define SSB_SPROM4_AGAIN2_SHIFT 0 |
300 | #define SSB_SPROM4_AGAIN3 0xFF00 /* Antenna 3 */ | 300 | #define SSB_SPROM4_AGAIN3 0xFF00 /* Antenna 3 */ |
301 | #define SSB_SPROM4_AGAIN3_SHIFT 8 | 301 | #define SSB_SPROM4_AGAIN3_SHIFT 8 |
302 | #define SSB_SPROM4_TXPID2G01 0x0062 /* TX Power Index 2GHz */ | ||
303 | #define SSB_SPROM4_TXPID2G0 0x00FF | ||
304 | #define SSB_SPROM4_TXPID2G0_SHIFT 0 | ||
305 | #define SSB_SPROM4_TXPID2G1 0xFF00 | ||
306 | #define SSB_SPROM4_TXPID2G1_SHIFT 8 | ||
307 | #define SSB_SPROM4_TXPID2G23 0x0064 /* TX Power Index 2GHz */ | ||
308 | #define SSB_SPROM4_TXPID2G2 0x00FF | ||
309 | #define SSB_SPROM4_TXPID2G2_SHIFT 0 | ||
310 | #define SSB_SPROM4_TXPID2G3 0xFF00 | ||
311 | #define SSB_SPROM4_TXPID2G3_SHIFT 8 | ||
312 | #define SSB_SPROM4_TXPID5G01 0x0066 /* TX Power Index 5GHz middle subband */ | ||
313 | #define SSB_SPROM4_TXPID5G0 0x00FF | ||
314 | #define SSB_SPROM4_TXPID5G0_SHIFT 0 | ||
315 | #define SSB_SPROM4_TXPID5G1 0xFF00 | ||
316 | #define SSB_SPROM4_TXPID5G1_SHIFT 8 | ||
317 | #define SSB_SPROM4_TXPID5G23 0x0068 /* TX Power Index 5GHz middle subband */ | ||
318 | #define SSB_SPROM4_TXPID5G2 0x00FF | ||
319 | #define SSB_SPROM4_TXPID5G2_SHIFT 0 | ||
320 | #define SSB_SPROM4_TXPID5G3 0xFF00 | ||
321 | #define SSB_SPROM4_TXPID5G3_SHIFT 8 | ||
322 | #define SSB_SPROM4_TXPID5GL01 0x006A /* TX Power Index 5GHz low subband */ | ||
323 | #define SSB_SPROM4_TXPID5GL0 0x00FF | ||
324 | #define SSB_SPROM4_TXPID5GL0_SHIFT 0 | ||
325 | #define SSB_SPROM4_TXPID5GL1 0xFF00 | ||
326 | #define SSB_SPROM4_TXPID5GL1_SHIFT 8 | ||
327 | #define SSB_SPROM4_TXPID5GL23 0x006C /* TX Power Index 5GHz low subband */ | ||
328 | #define SSB_SPROM4_TXPID5GL2 0x00FF | ||
329 | #define SSB_SPROM4_TXPID5GL2_SHIFT 0 | ||
330 | #define SSB_SPROM4_TXPID5GL3 0xFF00 | ||
331 | #define SSB_SPROM4_TXPID5GL3_SHIFT 8 | ||
332 | #define SSB_SPROM4_TXPID5GH01 0x006E /* TX Power Index 5GHz high subband */ | ||
333 | #define SSB_SPROM4_TXPID5GH0 0x00FF | ||
334 | #define SSB_SPROM4_TXPID5GH0_SHIFT 0 | ||
335 | #define SSB_SPROM4_TXPID5GH1 0xFF00 | ||
336 | #define SSB_SPROM4_TXPID5GH1_SHIFT 8 | ||
337 | #define SSB_SPROM4_TXPID5GH23 0x0070 /* TX Power Index 5GHz high subband */ | ||
338 | #define SSB_SPROM4_TXPID5GH2 0x00FF | ||
339 | #define SSB_SPROM4_TXPID5GH2_SHIFT 0 | ||
340 | #define SSB_SPROM4_TXPID5GH3 0xFF00 | ||
341 | #define SSB_SPROM4_TXPID5GH3_SHIFT 8 | ||
302 | #define SSB_SPROM4_MAXP_BG 0x0080 /* Max Power BG in path 1 */ | 342 | #define SSB_SPROM4_MAXP_BG 0x0080 /* Max Power BG in path 1 */ |
303 | #define SSB_SPROM4_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ | 343 | #define SSB_SPROM4_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ |
304 | #define SSB_SPROM4_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ | 344 | #define SSB_SPROM4_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ |
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index 51efbef38fb0..25310f1d7f37 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __LINUX_STACKTRACE_H | 2 | #define __LINUX_STACKTRACE_H |
3 | 3 | ||
4 | struct task_struct; | 4 | struct task_struct; |
5 | struct pt_regs; | ||
5 | 6 | ||
6 | #ifdef CONFIG_STACKTRACE | 7 | #ifdef CONFIG_STACKTRACE |
7 | struct task_struct; | 8 | struct task_struct; |
@@ -13,7 +14,8 @@ struct stack_trace { | |||
13 | }; | 14 | }; |
14 | 15 | ||
15 | extern void save_stack_trace(struct stack_trace *trace); | 16 | extern void save_stack_trace(struct stack_trace *trace); |
16 | extern void save_stack_trace_bp(struct stack_trace *trace, unsigned long bp); | 17 | extern void save_stack_trace_regs(struct stack_trace *trace, |
18 | struct pt_regs *regs); | ||
17 | extern void save_stack_trace_tsk(struct task_struct *tsk, | 19 | extern void save_stack_trace_tsk(struct task_struct *tsk, |
18 | struct stack_trace *trace); | 20 | struct stack_trace *trace); |
19 | 21 | ||
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index d66c61774d95..e10352915698 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
@@ -40,9 +40,9 @@ struct plat_stmmacenet_data { | |||
40 | int pmt; | 40 | int pmt; |
41 | void (*fix_mac_speed)(void *priv, unsigned int speed); | 41 | void (*fix_mac_speed)(void *priv, unsigned int speed); |
42 | void (*bus_setup)(void __iomem *ioaddr); | 42 | void (*bus_setup)(void __iomem *ioaddr); |
43 | #ifdef CONFIG_STM_DRIVERS | 43 | int (*init)(struct platform_device *pdev); |
44 | struct stm_pad_config *pad_config; | 44 | void (*exit)(struct platform_device *pdev); |
45 | #endif | 45 | void *custom_cfg; |
46 | void *bsp_priv; | 46 | void *bsp_priv; |
47 | }; | 47 | }; |
48 | 48 | ||
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/syscalls.h b/include/linux/syscalls.h index cacc27a0e285..18cd0684fc4e 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -127,8 +127,6 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
127 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ | 127 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ |
128 | static struct syscall_metadata \ | 128 | static struct syscall_metadata \ |
129 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ | 129 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ |
130 | static struct ftrace_event_call \ | ||
131 | __attribute__((__aligned__(4))) event_enter_##sname; \ | ||
132 | static struct ftrace_event_call __used \ | 130 | static struct ftrace_event_call __used \ |
133 | __attribute__((__aligned__(4))) \ | 131 | __attribute__((__aligned__(4))) \ |
134 | __attribute__((section("_ftrace_events"))) \ | 132 | __attribute__((section("_ftrace_events"))) \ |
@@ -137,13 +135,12 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
137 | .class = &event_class_syscall_enter, \ | 135 | .class = &event_class_syscall_enter, \ |
138 | .event.funcs = &enter_syscall_print_funcs, \ | 136 | .event.funcs = &enter_syscall_print_funcs, \ |
139 | .data = (void *)&__syscall_meta_##sname,\ | 137 | .data = (void *)&__syscall_meta_##sname,\ |
140 | } | 138 | }; \ |
139 | __TRACE_EVENT_FLAGS(enter_##sname, TRACE_EVENT_FL_CAP_ANY) | ||
141 | 140 | ||
142 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 141 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
143 | static struct syscall_metadata \ | 142 | static struct syscall_metadata \ |
144 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ | 143 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ |
145 | static struct ftrace_event_call \ | ||
146 | __attribute__((__aligned__(4))) event_exit_##sname; \ | ||
147 | static struct ftrace_event_call __used \ | 144 | static struct ftrace_event_call __used \ |
148 | __attribute__((__aligned__(4))) \ | 145 | __attribute__((__aligned__(4))) \ |
149 | __attribute__((section("_ftrace_events"))) \ | 146 | __attribute__((section("_ftrace_events"))) \ |
@@ -152,7 +149,8 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
152 | .class = &event_class_syscall_exit, \ | 149 | .class = &event_class_syscall_exit, \ |
153 | .event.funcs = &exit_syscall_print_funcs, \ | 150 | .event.funcs = &exit_syscall_print_funcs, \ |
154 | .data = (void *)&__syscall_meta_##sname,\ | 151 | .data = (void *)&__syscall_meta_##sname,\ |
155 | } | 152 | }; \ |
153 | __TRACE_EVENT_FLAGS(exit_##sname, TRACE_EVENT_FL_CAP_ANY) | ||
156 | 154 | ||
157 | #define SYSCALL_METADATA(sname, nb) \ | 155 | #define SYSCALL_METADATA(sname, nb) \ |
158 | SYSCALL_TRACE_ENTER_EVENT(sname); \ | 156 | SYSCALL_TRACE_ENTER_EVENT(sname); \ |
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/timer.h b/include/linux/timer.h index 38cf093ef62c..6abd9138beda 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -24,9 +24,9 @@ struct timer_list { | |||
24 | int slack; | 24 | int slack; |
25 | 25 | ||
26 | #ifdef CONFIG_TIMER_STATS | 26 | #ifdef CONFIG_TIMER_STATS |
27 | int start_pid; | ||
27 | void *start_site; | 28 | void *start_site; |
28 | char start_comm[16]; | 29 | char start_comm[16]; |
29 | int start_pid; | ||
30 | #endif | 30 | #endif |
31 | #ifdef CONFIG_LOCKDEP | 31 | #ifdef CONFIG_LOCKDEP |
32 | struct lockdep_map lockdep_map; | 32 | struct lockdep_map lockdep_map; |
@@ -48,12 +48,38 @@ extern struct tvec_base boot_tvec_bases; | |||
48 | #define __TIMER_LOCKDEP_MAP_INITIALIZER(_kn) | 48 | #define __TIMER_LOCKDEP_MAP_INITIALIZER(_kn) |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | /* | ||
52 | * Note that all tvec_bases are 2 byte aligned and lower bit of | ||
53 | * base in timer_list is guaranteed to be zero. Use the LSB to | ||
54 | * indicate whether the timer is deferrable. | ||
55 | * | ||
56 | * A deferrable timer will work normally when the system is busy, but | ||
57 | * will not cause a CPU to come out of idle just to service it; instead, | ||
58 | * the timer will be serviced when the CPU eventually wakes up with a | ||
59 | * subsequent non-deferrable timer. | ||
60 | */ | ||
61 | #define TBASE_DEFERRABLE_FLAG (0x1) | ||
62 | |||
51 | #define TIMER_INITIALIZER(_function, _expires, _data) { \ | 63 | #define TIMER_INITIALIZER(_function, _expires, _data) { \ |
52 | .entry = { .prev = TIMER_ENTRY_STATIC }, \ | 64 | .entry = { .prev = TIMER_ENTRY_STATIC }, \ |
53 | .function = (_function), \ | 65 | .function = (_function), \ |
54 | .expires = (_expires), \ | 66 | .expires = (_expires), \ |
55 | .data = (_data), \ | 67 | .data = (_data), \ |
56 | .base = &boot_tvec_bases, \ | 68 | .base = &boot_tvec_bases, \ |
69 | .slack = -1, \ | ||
70 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ | ||
71 | __FILE__ ":" __stringify(__LINE__)) \ | ||
72 | } | ||
73 | |||
74 | #define TBASE_MAKE_DEFERRED(ptr) ((struct tvec_base *) \ | ||
75 | ((unsigned char *)(ptr) + TBASE_DEFERRABLE_FLAG)) | ||
76 | |||
77 | #define TIMER_DEFERRED_INITIALIZER(_function, _expires, _data) {\ | ||
78 | .entry = { .prev = TIMER_ENTRY_STATIC }, \ | ||
79 | .function = (_function), \ | ||
80 | .expires = (_expires), \ | ||
81 | .data = (_data), \ | ||
82 | .base = TBASE_MAKE_DEFERRED(&boot_tvec_bases), \ | ||
57 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ | 83 | __TIMER_LOCKDEP_MAP_INITIALIZER( \ |
58 | __FILE__ ":" __stringify(__LINE__)) \ | 84 | __FILE__ ":" __stringify(__LINE__)) \ |
59 | } | 85 | } |
@@ -248,11 +274,11 @@ static inline void timer_stats_timer_clear_start_info(struct timer_list *timer) | |||
248 | 274 | ||
249 | extern void add_timer(struct timer_list *timer); | 275 | extern void add_timer(struct timer_list *timer); |
250 | 276 | ||
277 | extern int try_to_del_timer_sync(struct timer_list *timer); | ||
278 | |||
251 | #ifdef CONFIG_SMP | 279 | #ifdef CONFIG_SMP |
252 | extern int try_to_del_timer_sync(struct timer_list *timer); | ||
253 | extern int del_timer_sync(struct timer_list *timer); | 280 | extern int del_timer_sync(struct timer_list *timer); |
254 | #else | 281 | #else |
255 | # define try_to_del_timer_sync(t) del_timer(t) | ||
256 | # define del_timer_sync(t) del_timer(t) | 282 | # define del_timer_sync(t) del_timer(t) |
257 | #endif | 283 | #endif |
258 | 284 | ||
diff --git a/include/linux/timerqueue.h b/include/linux/timerqueue.h new file mode 100644 index 000000000000..d24aabaca474 --- /dev/null +++ b/include/linux/timerqueue.h | |||
@@ -0,0 +1,50 @@ | |||
1 | #ifndef _LINUX_TIMERQUEUE_H | ||
2 | #define _LINUX_TIMERQUEUE_H | ||
3 | |||
4 | #include <linux/rbtree.h> | ||
5 | #include <linux/ktime.h> | ||
6 | |||
7 | |||
8 | struct timerqueue_node { | ||
9 | struct rb_node node; | ||
10 | ktime_t expires; | ||
11 | }; | ||
12 | |||
13 | struct timerqueue_head { | ||
14 | struct rb_root head; | ||
15 | struct timerqueue_node *next; | ||
16 | }; | ||
17 | |||
18 | |||
19 | extern void timerqueue_add(struct timerqueue_head *head, | ||
20 | struct timerqueue_node *node); | ||
21 | extern void timerqueue_del(struct timerqueue_head *head, | ||
22 | struct timerqueue_node *node); | ||
23 | extern struct timerqueue_node *timerqueue_iterate_next( | ||
24 | struct timerqueue_node *node); | ||
25 | |||
26 | /** | ||
27 | * timerqueue_getnext - Returns the timer with the earlies expiration time | ||
28 | * | ||
29 | * @head: head of timerqueue | ||
30 | * | ||
31 | * Returns a pointer to the timer node that has the | ||
32 | * earliest expiration time. | ||
33 | */ | ||
34 | static inline | ||
35 | struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head) | ||
36 | { | ||
37 | return head->next; | ||
38 | } | ||
39 | |||
40 | static inline void timerqueue_init(struct timerqueue_node *node) | ||
41 | { | ||
42 | RB_CLEAR_NODE(&node->node); | ||
43 | } | ||
44 | |||
45 | static inline void timerqueue_init_head(struct timerqueue_head *head) | ||
46 | { | ||
47 | head->head = RB_ROOT; | ||
48 | head->next = NULL; | ||
49 | } | ||
50 | #endif /* _LINUX_TIMERQUEUE_H */ | ||
diff --git a/include/linux/tipc.h b/include/linux/tipc.h index d10614b29d59..1eefa3f6d1f4 100644 --- a/include/linux/tipc.h +++ b/include/linux/tipc.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * include/linux/tipc.h: Include file for TIPC socket interface | 2 | * include/linux/tipc.h: Include file for TIPC socket interface |
3 | * | 3 | * |
4 | * Copyright (c) 2003-2006, Ericsson AB | 4 | * Copyright (c) 2003-2006, Ericsson AB |
5 | * Copyright (c) 2005, Wind River Systems | 5 | * Copyright (c) 2005, Wind River Systems |
6 | * All rights reserved. | 6 | * All rights reserved. |
@@ -42,7 +42,7 @@ | |||
42 | /* | 42 | /* |
43 | * TIPC addressing primitives | 43 | * TIPC addressing primitives |
44 | */ | 44 | */ |
45 | 45 | ||
46 | struct tipc_portid { | 46 | struct tipc_portid { |
47 | __u32 ref; | 47 | __u32 ref; |
48 | __u32 node; | 48 | __u32 node; |
@@ -89,7 +89,7 @@ static inline unsigned int tipc_node(__u32 addr) | |||
89 | #define TIPC_TOP_SRV 1 /* topology service name type */ | 89 | #define TIPC_TOP_SRV 1 /* topology service name type */ |
90 | #define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */ | 90 | #define TIPC_RESERVED_TYPES 64 /* lowest user-publishable name type */ |
91 | 91 | ||
92 | /* | 92 | /* |
93 | * Publication scopes when binding port names and port name sequences | 93 | * Publication scopes when binding port names and port name sequences |
94 | */ | 94 | */ |
95 | 95 | ||
@@ -112,7 +112,7 @@ static inline unsigned int tipc_node(__u32 addr) | |||
112 | #define TIPC_HIGH_IMPORTANCE 2 | 112 | #define TIPC_HIGH_IMPORTANCE 2 |
113 | #define TIPC_CRITICAL_IMPORTANCE 3 | 113 | #define TIPC_CRITICAL_IMPORTANCE 3 |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * Msg rejection/connection shutdown reasons | 116 | * Msg rejection/connection shutdown reasons |
117 | */ | 117 | */ |
118 | 118 | ||
@@ -127,9 +127,9 @@ static inline unsigned int tipc_node(__u32 addr) | |||
127 | * TIPC topology subscription service definitions | 127 | * TIPC topology subscription service definitions |
128 | */ | 128 | */ |
129 | 129 | ||
130 | #define TIPC_SUB_PORTS 0x01 /* filter for port availability */ | 130 | #define TIPC_SUB_PORTS 0x01 /* filter for port availability */ |
131 | #define TIPC_SUB_SERVICE 0x02 /* filter for service availability */ | 131 | #define TIPC_SUB_SERVICE 0x02 /* filter for service availability */ |
132 | #define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */ | 132 | #define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */ |
133 | #if 0 | 133 | #if 0 |
134 | /* The following filter options are not currently implemented */ | 134 | /* The following filter options are not currently implemented */ |
135 | #define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */ | 135 | #define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */ |
@@ -137,12 +137,12 @@ static inline unsigned int tipc_node(__u32 addr) | |||
137 | #define TIPC_SUB_SINGLE_EVT 0x10 /* expire after first event */ | 137 | #define TIPC_SUB_SINGLE_EVT 0x10 /* expire after first event */ |
138 | #endif | 138 | #endif |
139 | 139 | ||
140 | #define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */ | 140 | #define TIPC_WAIT_FOREVER (~0) /* timeout for permanent subscription */ |
141 | 141 | ||
142 | struct tipc_subscr { | 142 | struct tipc_subscr { |
143 | struct tipc_name_seq seq; /* name sequence of interest */ | 143 | struct tipc_name_seq seq; /* name sequence of interest */ |
144 | __u32 timeout; /* subscription duration (in ms) */ | 144 | __u32 timeout; /* subscription duration (in ms) */ |
145 | __u32 filter; /* bitmask of filter options */ | 145 | __u32 filter; /* bitmask of filter options */ |
146 | char usr_handle[8]; /* available for subscriber use */ | 146 | char usr_handle[8]; /* available for subscriber use */ |
147 | }; | 147 | }; |
148 | 148 | ||
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h index 9cde86c32412..7d42460a5e3c 100644 --- a/include/linux/tipc_config.h +++ b/include/linux/tipc_config.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * include/linux/tipc_config.h: Include file for TIPC configuration interface | 2 | * include/linux/tipc_config.h: Include file for TIPC configuration interface |
3 | * | 3 | * |
4 | * Copyright (c) 2003-2006, Ericsson AB | 4 | * Copyright (c) 2003-2006, Ericsson AB |
5 | * Copyright (c) 2005-2007, Wind River Systems | 5 | * Copyright (c) 2005-2007, Wind River Systems |
6 | * All rights reserved. | 6 | * All rights reserved. |
@@ -54,19 +54,19 @@ | |||
54 | * which specify parameters or results for the operation. | 54 | * which specify parameters or results for the operation. |
55 | * | 55 | * |
56 | * For many operations, the request and reply messages have a fixed number | 56 | * For many operations, the request and reply messages have a fixed number |
57 | * of TLVs (usually zero or one); however, some reply messages may return | 57 | * of TLVs (usually zero or one); however, some reply messages may return |
58 | * a variable number of TLVs. A failed request is denoted by the presence | 58 | * a variable number of TLVs. A failed request is denoted by the presence |
59 | * of an "error string" TLV in the reply message instead of the TLV(s) the | 59 | * of an "error string" TLV in the reply message instead of the TLV(s) the |
60 | * reply should contain if the request succeeds. | 60 | * reply should contain if the request succeeds. |
61 | */ | 61 | */ |
62 | 62 | ||
63 | /* | 63 | /* |
64 | * Public commands: | 64 | * Public commands: |
65 | * May be issued by any process. | 65 | * May be issued by any process. |
66 | * Accepted by own node, or by remote node only if remote management enabled. | 66 | * Accepted by own node, or by remote node only if remote management enabled. |
67 | */ | 67 | */ |
68 | 68 | ||
69 | #define TIPC_CMD_NOOP 0x0000 /* tx none, rx none */ | 69 | #define TIPC_CMD_NOOP 0x0000 /* tx none, rx none */ |
70 | #define TIPC_CMD_GET_NODES 0x0001 /* tx net_addr, rx node_info(s) */ | 70 | #define TIPC_CMD_GET_NODES 0x0001 /* tx net_addr, rx node_info(s) */ |
71 | #define TIPC_CMD_GET_MEDIA_NAMES 0x0002 /* tx none, rx media_name(s) */ | 71 | #define TIPC_CMD_GET_MEDIA_NAMES 0x0002 /* tx none, rx media_name(s) */ |
72 | #define TIPC_CMD_GET_BEARER_NAMES 0x0003 /* tx none, rx bearer_name(s) */ | 72 | #define TIPC_CMD_GET_BEARER_NAMES 0x0003 /* tx none, rx bearer_name(s) */ |
@@ -83,21 +83,21 @@ | |||
83 | #define TIPC_CMD_GET_LINK_PEER 0x000D /* tx link_name, rx ? */ | 83 | #define TIPC_CMD_GET_LINK_PEER 0x000D /* tx link_name, rx ? */ |
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | /* | 86 | /* |
87 | * Protected commands: | 87 | * Protected commands: |
88 | * May only be issued by "network administration capable" process. | 88 | * May only be issued by "network administration capable" process. |
89 | * Accepted by own node, or by remote node only if remote management enabled | 89 | * Accepted by own node, or by remote node only if remote management enabled |
90 | * and this node is zone manager. | 90 | * and this node is zone manager. |
91 | */ | 91 | */ |
92 | 92 | ||
93 | #define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */ | 93 | #define TIPC_CMD_GET_REMOTE_MNG 0x4003 /* tx none, rx unsigned */ |
94 | #define TIPC_CMD_GET_MAX_PORTS 0x4004 /* tx none, rx unsigned */ | 94 | #define TIPC_CMD_GET_MAX_PORTS 0x4004 /* tx none, rx unsigned */ |
95 | #define TIPC_CMD_GET_MAX_PUBL 0x4005 /* tx none, rx unsigned */ | 95 | #define TIPC_CMD_GET_MAX_PUBL 0x4005 /* tx none, rx unsigned */ |
96 | #define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* tx none, rx unsigned */ | 96 | #define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* tx none, rx unsigned */ |
97 | #define TIPC_CMD_GET_MAX_ZONES 0x4007 /* tx none, rx unsigned */ | 97 | #define TIPC_CMD_GET_MAX_ZONES 0x4007 /* obsoleted */ |
98 | #define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* tx none, rx unsigned */ | 98 | #define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* obsoleted */ |
99 | #define TIPC_CMD_GET_MAX_NODES 0x4009 /* tx none, rx unsigned */ | 99 | #define TIPC_CMD_GET_MAX_NODES 0x4009 /* tx none, rx unsigned */ |
100 | #define TIPC_CMD_GET_MAX_SLAVES 0x400A /* tx none, rx unsigned */ | 100 | #define TIPC_CMD_GET_MAX_SLAVES 0x400A /* obsoleted */ |
101 | #define TIPC_CMD_GET_NETID 0x400B /* tx none, rx unsigned */ | 101 | #define TIPC_CMD_GET_NETID 0x400B /* tx none, rx unsigned */ |
102 | 102 | ||
103 | #define TIPC_CMD_ENABLE_BEARER 0x4101 /* tx bearer_config, rx none */ | 103 | #define TIPC_CMD_ENABLE_BEARER 0x4101 /* tx bearer_config, rx none */ |
@@ -116,10 +116,10 @@ | |||
116 | #define TIPC_CMD_UNBLOCK_LINK 0x4106 /* tx link_name, rx none */ | 116 | #define TIPC_CMD_UNBLOCK_LINK 0x4106 /* tx link_name, rx none */ |
117 | #endif | 117 | #endif |
118 | 118 | ||
119 | /* | 119 | /* |
120 | * Private commands: | 120 | * Private commands: |
121 | * May only be issued by "network administration capable" process. | 121 | * May only be issued by "network administration capable" process. |
122 | * Accepted by own node only; cannot be used on a remote node. | 122 | * Accepted by own node only; cannot be used on a remote node. |
123 | */ | 123 | */ |
124 | 124 | ||
125 | #define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */ | 125 | #define TIPC_CMD_SET_NODE_ADDR 0x8001 /* tx net_addr, rx none */ |
@@ -130,10 +130,10 @@ | |||
130 | #define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */ | 130 | #define TIPC_CMD_SET_MAX_PORTS 0x8004 /* tx unsigned, rx none */ |
131 | #define TIPC_CMD_SET_MAX_PUBL 0x8005 /* tx unsigned, rx none */ | 131 | #define TIPC_CMD_SET_MAX_PUBL 0x8005 /* tx unsigned, rx none */ |
132 | #define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* tx unsigned, rx none */ | 132 | #define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* tx unsigned, rx none */ |
133 | #define TIPC_CMD_SET_MAX_ZONES 0x8007 /* tx unsigned, rx none */ | 133 | #define TIPC_CMD_SET_MAX_ZONES 0x8007 /* obsoleted */ |
134 | #define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* tx unsigned, rx none */ | 134 | #define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* obsoleted */ |
135 | #define TIPC_CMD_SET_MAX_NODES 0x8009 /* tx unsigned, rx none */ | 135 | #define TIPC_CMD_SET_MAX_NODES 0x8009 /* tx unsigned, rx none */ |
136 | #define TIPC_CMD_SET_MAX_SLAVES 0x800A /* tx unsigned, rx none */ | 136 | #define TIPC_CMD_SET_MAX_SLAVES 0x800A /* obsoleted */ |
137 | #define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */ | 137 | #define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */ |
138 | 138 | ||
139 | /* | 139 | /* |
@@ -156,20 +156,20 @@ | |||
156 | #define TIPC_TLV_ULTRA_STRING 5 /* char[32768] (max) */ | 156 | #define TIPC_TLV_ULTRA_STRING 5 /* char[32768] (max) */ |
157 | 157 | ||
158 | #define TIPC_TLV_ERROR_STRING 16 /* char[128] containing "error code" */ | 158 | #define TIPC_TLV_ERROR_STRING 16 /* char[128] containing "error code" */ |
159 | #define TIPC_TLV_NET_ADDR 17 /* 32-bit integer denoting <Z.C.N> */ | 159 | #define TIPC_TLV_NET_ADDR 17 /* 32-bit integer denoting <Z.C.N> */ |
160 | #define TIPC_TLV_MEDIA_NAME 18 /* char[TIPC_MAX_MEDIA_NAME] */ | 160 | #define TIPC_TLV_MEDIA_NAME 18 /* char[TIPC_MAX_MEDIA_NAME] */ |
161 | #define TIPC_TLV_BEARER_NAME 19 /* char[TIPC_MAX_BEARER_NAME] */ | 161 | #define TIPC_TLV_BEARER_NAME 19 /* char[TIPC_MAX_BEARER_NAME] */ |
162 | #define TIPC_TLV_LINK_NAME 20 /* char[TIPC_MAX_LINK_NAME] */ | 162 | #define TIPC_TLV_LINK_NAME 20 /* char[TIPC_MAX_LINK_NAME] */ |
163 | #define TIPC_TLV_NODE_INFO 21 /* struct tipc_node_info */ | 163 | #define TIPC_TLV_NODE_INFO 21 /* struct tipc_node_info */ |
164 | #define TIPC_TLV_LINK_INFO 22 /* struct tipc_link_info */ | 164 | #define TIPC_TLV_LINK_INFO 22 /* struct tipc_link_info */ |
165 | #define TIPC_TLV_BEARER_CONFIG 23 /* struct tipc_bearer_config */ | 165 | #define TIPC_TLV_BEARER_CONFIG 23 /* struct tipc_bearer_config */ |
166 | #define TIPC_TLV_LINK_CONFIG 24 /* struct tipc_link_config */ | 166 | #define TIPC_TLV_LINK_CONFIG 24 /* struct tipc_link_config */ |
167 | #define TIPC_TLV_NAME_TBL_QUERY 25 /* struct tipc_name_table_query */ | 167 | #define TIPC_TLV_NAME_TBL_QUERY 25 /* struct tipc_name_table_query */ |
168 | #define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */ | 168 | #define TIPC_TLV_PORT_REF 26 /* 32-bit port reference */ |
169 | 169 | ||
170 | /* | 170 | /* |
171 | * Maximum sizes of TIPC bearer-related names (including terminating NUL) | 171 | * Maximum sizes of TIPC bearer-related names (including terminating NUL) |
172 | */ | 172 | */ |
173 | 173 | ||
174 | #define TIPC_MAX_MEDIA_NAME 16 /* format = media */ | 174 | #define TIPC_MAX_MEDIA_NAME 16 /* format = media */ |
175 | #define TIPC_MAX_IF_NAME 16 /* format = interface */ | 175 | #define TIPC_MAX_IF_NAME 16 /* format = interface */ |
@@ -234,7 +234,7 @@ struct tipc_name_table_query { | |||
234 | }; | 234 | }; |
235 | 235 | ||
236 | /* | 236 | /* |
237 | * The error string TLV is a null-terminated string describing the cause | 237 | * The error string TLV is a null-terminated string describing the cause |
238 | * of the request failure. To simplify error processing (and to save space) | 238 | * of the request failure. To simplify error processing (and to save space) |
239 | * the first character of the string can be a special error code character | 239 | * the first character of the string can be a special error code character |
240 | * (lying by the range 0x80 to 0xFF) which represents a pre-defined reason. | 240 | * (lying by the range 0x80 to 0xFF) which represents a pre-defined reason. |
@@ -254,16 +254,11 @@ struct tipc_link_create { | |||
254 | struct tipc_media_addr peer_addr; | 254 | struct tipc_media_addr peer_addr; |
255 | char bearer_name[TIPC_MAX_BEARER_NAME]; | 255 | char bearer_name[TIPC_MAX_BEARER_NAME]; |
256 | }; | 256 | }; |
257 | |||
258 | struct tipc_route_info { | ||
259 | __u32 dest; | ||
260 | __u32 router; | ||
261 | }; | ||
262 | #endif | 257 | #endif |
263 | 258 | ||
264 | /* | 259 | /* |
265 | * A TLV consists of a descriptor, followed by the TLV value. | 260 | * A TLV consists of a descriptor, followed by the TLV value. |
266 | * TLV descriptor fields are stored in network byte order; | 261 | * TLV descriptor fields are stored in network byte order; |
267 | * TLV values must also be stored in network byte order (where applicable). | 262 | * TLV values must also be stored in network byte order (where applicable). |
268 | * TLV descriptors must be aligned to addresses which are multiple of 4, | 263 | * TLV descriptors must be aligned to addresses which are multiple of 4, |
269 | * so up to 3 bytes of padding may exist at the end of the TLV value area. | 264 | * so up to 3 bytes of padding may exist at the end of the TLV value area. |
@@ -299,7 +294,7 @@ static inline int TLV_OK(const void *tlv, __u16 space) | |||
299 | 294 | ||
300 | static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type) | 295 | static inline int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type) |
301 | { | 296 | { |
302 | return TLV_OK(tlv, space) && | 297 | return TLV_OK(tlv, space) && |
303 | (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type); | 298 | (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type); |
304 | } | 299 | } |
305 | 300 | ||
@@ -318,7 +313,7 @@ static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len) | |||
318 | } | 313 | } |
319 | 314 | ||
320 | /* | 315 | /* |
321 | * A TLV list descriptor simplifies processing of messages | 316 | * A TLV list descriptor simplifies processing of messages |
322 | * containing multiple TLVs. | 317 | * containing multiple TLVs. |
323 | */ | 318 | */ |
324 | 319 | ||
@@ -327,15 +322,15 @@ struct tlv_list_desc { | |||
327 | __u32 tlv_space; /* # bytes from curr TLV to list end */ | 322 | __u32 tlv_space; /* # bytes from curr TLV to list end */ |
328 | }; | 323 | }; |
329 | 324 | ||
330 | static inline void TLV_LIST_INIT(struct tlv_list_desc *list, | 325 | static inline void TLV_LIST_INIT(struct tlv_list_desc *list, |
331 | void *data, __u32 space) | 326 | void *data, __u32 space) |
332 | { | 327 | { |
333 | list->tlv_ptr = (struct tlv_desc *)data; | 328 | list->tlv_ptr = (struct tlv_desc *)data; |
334 | list->tlv_space = space; | 329 | list->tlv_space = space; |
335 | } | 330 | } |
336 | 331 | ||
337 | static inline int TLV_LIST_EMPTY(struct tlv_list_desc *list) | 332 | static inline int TLV_LIST_EMPTY(struct tlv_list_desc *list) |
338 | { | 333 | { |
339 | return (list->tlv_space == 0); | 334 | return (list->tlv_space == 0); |
340 | } | 335 | } |
341 | 336 | ||
@@ -353,7 +348,7 @@ static inline void TLV_LIST_STEP(struct tlv_list_desc *list) | |||
353 | { | 348 | { |
354 | __u16 tlv_space = TLV_ALIGN(ntohs(list->tlv_ptr->tlv_len)); | 349 | __u16 tlv_space = TLV_ALIGN(ntohs(list->tlv_ptr->tlv_len)); |
355 | 350 | ||
356 | list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space); | 351 | list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space); |
357 | list->tlv_space -= tlv_space; | 352 | list->tlv_space -= tlv_space; |
358 | } | 353 | } |
359 | 354 | ||
@@ -377,15 +372,14 @@ struct tipc_genlmsghdr { | |||
377 | #define TIPC_GENL_HDRLEN NLMSG_ALIGN(sizeof(struct tipc_genlmsghdr)) | 372 | #define TIPC_GENL_HDRLEN NLMSG_ALIGN(sizeof(struct tipc_genlmsghdr)) |
378 | 373 | ||
379 | /* | 374 | /* |
380 | * Configuration messages exchanged via TIPC sockets use the TIPC configuration | 375 | * Configuration messages exchanged via TIPC sockets use the TIPC configuration |
381 | * message header, which is defined below. This structure is analogous | 376 | * message header, which is defined below. This structure is analogous |
382 | * to the Netlink message header, but fields are stored in network byte order | 377 | * to the Netlink message header, but fields are stored in network byte order |
383 | * and no padding is permitted between the header and the message data | 378 | * and no padding is permitted between the header and the message data |
384 | * that follows. | 379 | * that follows. |
385 | */ | 380 | */ |
386 | 381 | ||
387 | struct tipc_cfg_msg_hdr | 382 | struct tipc_cfg_msg_hdr { |
388 | { | ||
389 | __be32 tcm_len; /* Message length (including header) */ | 383 | __be32 tcm_len; /* Message length (including header) */ |
390 | __be16 tcm_type; /* Command type */ | 384 | __be16 tcm_type; /* Command type */ |
391 | __be16 tcm_flags; /* Additional flags */ | 385 | __be16 tcm_flags; /* Additional flags */ |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index a4a90b6726ce..d3e4f87e95c0 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -106,6 +106,7 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
106 | 106 | ||
107 | #define TP_PROTO(args...) args | 107 | #define TP_PROTO(args...) args |
108 | #define TP_ARGS(args...) args | 108 | #define TP_ARGS(args...) args |
109 | #define TP_CONDITION(args...) args | ||
109 | 110 | ||
110 | #ifdef CONFIG_TRACEPOINTS | 111 | #ifdef CONFIG_TRACEPOINTS |
111 | 112 | ||
@@ -119,12 +120,14 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
119 | * as "(void *, void)". The DECLARE_TRACE_NOARGS() will pass in just | 120 | * as "(void *, void)". The DECLARE_TRACE_NOARGS() will pass in just |
120 | * "void *data", where as the DECLARE_TRACE() will pass in "void *data, proto". | 121 | * "void *data", where as the DECLARE_TRACE() will pass in "void *data, proto". |
121 | */ | 122 | */ |
122 | #define __DO_TRACE(tp, proto, args) \ | 123 | #define __DO_TRACE(tp, proto, args, cond) \ |
123 | do { \ | 124 | do { \ |
124 | struct tracepoint_func *it_func_ptr; \ | 125 | struct tracepoint_func *it_func_ptr; \ |
125 | void *it_func; \ | 126 | void *it_func; \ |
126 | void *__data; \ | 127 | void *__data; \ |
127 | \ | 128 | \ |
129 | if (!(cond)) \ | ||
130 | return; \ | ||
128 | rcu_read_lock_sched_notrace(); \ | 131 | rcu_read_lock_sched_notrace(); \ |
129 | it_func_ptr = rcu_dereference_sched((tp)->funcs); \ | 132 | it_func_ptr = rcu_dereference_sched((tp)->funcs); \ |
130 | if (it_func_ptr) { \ | 133 | if (it_func_ptr) { \ |
@@ -142,7 +145,7 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
142 | * not add unwanted padding between the beginning of the section and the | 145 | * not add unwanted padding between the beginning of the section and the |
143 | * structure. Force alignment to the same alignment as the section start. | 146 | * structure. Force alignment to the same alignment as the section start. |
144 | */ | 147 | */ |
145 | #define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \ | 148 | #define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \ |
146 | extern struct tracepoint __tracepoint_##name; \ | 149 | extern struct tracepoint __tracepoint_##name; \ |
147 | static inline void trace_##name(proto) \ | 150 | static inline void trace_##name(proto) \ |
148 | { \ | 151 | { \ |
@@ -151,7 +154,8 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
151 | do_trace: \ | 154 | do_trace: \ |
152 | __DO_TRACE(&__tracepoint_##name, \ | 155 | __DO_TRACE(&__tracepoint_##name, \ |
153 | TP_PROTO(data_proto), \ | 156 | TP_PROTO(data_proto), \ |
154 | TP_ARGS(data_args)); \ | 157 | TP_ARGS(data_args), \ |
158 | TP_CONDITION(cond)); \ | ||
155 | } \ | 159 | } \ |
156 | static inline int \ | 160 | static inline int \ |
157 | register_trace_##name(void (*probe)(data_proto), void *data) \ | 161 | register_trace_##name(void (*probe)(data_proto), void *data) \ |
@@ -186,7 +190,7 @@ do_trace: \ | |||
186 | EXPORT_SYMBOL(__tracepoint_##name) | 190 | EXPORT_SYMBOL(__tracepoint_##name) |
187 | 191 | ||
188 | #else /* !CONFIG_TRACEPOINTS */ | 192 | #else /* !CONFIG_TRACEPOINTS */ |
189 | #define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \ | 193 | #define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \ |
190 | static inline void trace_##name(proto) \ | 194 | static inline void trace_##name(proto) \ |
191 | { } \ | 195 | { } \ |
192 | static inline int \ | 196 | static inline int \ |
@@ -227,13 +231,20 @@ do_trace: \ | |||
227 | * "void *__data, proto" as the callback prototype. | 231 | * "void *__data, proto" as the callback prototype. |
228 | */ | 232 | */ |
229 | #define DECLARE_TRACE_NOARGS(name) \ | 233 | #define DECLARE_TRACE_NOARGS(name) \ |
230 | __DECLARE_TRACE(name, void, , void *__data, __data) | 234 | __DECLARE_TRACE(name, void, , 1, void *__data, __data) |
231 | 235 | ||
232 | #define DECLARE_TRACE(name, proto, args) \ | 236 | #define DECLARE_TRACE(name, proto, args) \ |
233 | __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \ | 237 | __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), 1, \ |
234 | PARAMS(void *__data, proto), \ | 238 | PARAMS(void *__data, proto), \ |
235 | PARAMS(__data, args)) | 239 | PARAMS(__data, args)) |
236 | 240 | ||
241 | #define DECLARE_TRACE_CONDITION(name, proto, args, cond) \ | ||
242 | __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), PARAMS(cond), \ | ||
243 | PARAMS(void *__data, proto), \ | ||
244 | PARAMS(__data, args)) | ||
245 | |||
246 | #define TRACE_EVENT_FLAGS(event, flag) | ||
247 | |||
237 | #endif /* DECLARE_TRACE */ | 248 | #endif /* DECLARE_TRACE */ |
238 | 249 | ||
239 | #ifndef TRACE_EVENT | 250 | #ifndef TRACE_EVENT |
@@ -347,11 +358,21 @@ do_trace: \ | |||
347 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 358 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
348 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 359 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
349 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 360 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
361 | #define DEFINE_EVENT_CONDITION(template, name, proto, \ | ||
362 | args, cond) \ | ||
363 | DECLARE_TRACE_CONDITION(name, PARAMS(proto), \ | ||
364 | PARAMS(args), PARAMS(cond)) | ||
350 | 365 | ||
351 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ | 366 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ |
352 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 367 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
353 | #define TRACE_EVENT_FN(name, proto, args, struct, \ | 368 | #define TRACE_EVENT_FN(name, proto, args, struct, \ |
354 | assign, print, reg, unreg) \ | 369 | assign, print, reg, unreg) \ |
355 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 370 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
371 | #define TRACE_EVENT_CONDITION(name, proto, args, cond, \ | ||
372 | struct, assign, print) \ | ||
373 | DECLARE_TRACE_CONDITION(name, PARAMS(proto), \ | ||
374 | PARAMS(args), PARAMS(cond)) | ||
375 | |||
376 | #define TRACE_EVENT_FLAGS(event, flag) | ||
356 | 377 | ||
357 | #endif /* ifdef TRACE_EVENT (see note above) */ | 378 | #endif /* ifdef TRACE_EVENT (see note above) */ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 2a754748dd5f..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,7 +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 */ |
53 | #define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */ | 52 | #define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */ |
54 | 53 | ||
55 | /* | 54 | /* |
56 | * 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 |
@@ -367,6 +366,7 @@ struct tty_file_private { | |||
367 | #define TTY_HUPPED 18 /* Post driver->hangup() */ | 366 | #define TTY_HUPPED 18 /* Post driver->hangup() */ |
368 | #define TTY_FLUSHING 19 /* Flushing to ldisc in progress */ | 367 | #define TTY_FLUSHING 19 /* Flushing to ldisc in progress */ |
369 | #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 */ | ||
370 | 370 | ||
371 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) | 371 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) |
372 | 372 | ||
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index db2d227694da..c3d43eb4150c 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -102,7 +102,7 @@ | |||
102 | * unsigned int cmd, unsigned long arg); | 102 | * unsigned int cmd, unsigned long arg); |
103 | * | 103 | * |
104 | * This routine allows the tty driver to implement | 104 | * This routine allows the tty driver to implement |
105 | * device-specific ioctl's. If the ioctl number passed in cmd | 105 | * device-specific ioctls. If the ioctl number passed in cmd |
106 | * is not recognized by the driver, it should return ENOIOCTLCMD. | 106 | * is not recognized by the driver, it should return ENOIOCTLCMD. |
107 | * | 107 | * |
108 | * Optional | 108 | * Optional |
@@ -167,12 +167,12 @@ | |||
167 | * | 167 | * |
168 | * void (*hangup)(struct tty_struct *tty); | 168 | * void (*hangup)(struct tty_struct *tty); |
169 | * | 169 | * |
170 | * This routine notifies the tty driver that it should hangup the | 170 | * This routine notifies the tty driver that it should hang up the |
171 | * tty device. | 171 | * tty device. |
172 | * | 172 | * |
173 | * Optional: | 173 | * Optional: |
174 | * | 174 | * |
175 | * int (*break_ctl)(struct tty_stuct *tty, int state); | 175 | * int (*break_ctl)(struct tty_struct *tty, int state); |
176 | * | 176 | * |
177 | * This optional routine requests the tty driver to turn on or | 177 | * This optional routine requests the tty driver to turn on or |
178 | * off BREAK status on the RS-232 port. If state is -1, | 178 | * off BREAK status on the RS-232 port. If state is -1, |
@@ -235,6 +235,7 @@ | |||
235 | #include <linux/fs.h> | 235 | #include <linux/fs.h> |
236 | #include <linux/list.h> | 236 | #include <linux/list.h> |
237 | #include <linux/cdev.h> | 237 | #include <linux/cdev.h> |
238 | #include <linux/termios.h> | ||
238 | 239 | ||
239 | struct tty_struct; | 240 | struct tty_struct; |
240 | struct tty_driver; | 241 | struct tty_driver; |
@@ -357,7 +358,7 @@ static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) | |||
357 | * overruns, either.) | 358 | * overruns, either.) |
358 | * | 359 | * |
359 | * TTY_DRIVER_DYNAMIC_DEV --- if set, the individual tty devices need | 360 | * TTY_DRIVER_DYNAMIC_DEV --- if set, the individual tty devices need |
360 | * to be registered with a call to tty_register_driver() when the | 361 | * to be registered with a call to tty_register_device() when the |
361 | * device is found in the system and unregistered with a call to | 362 | * device is found in the system and unregistered with a call to |
362 | * tty_unregister_device() so the devices will be show up | 363 | * tty_unregister_device() so the devices will be show up |
363 | * properly in sysfs. If not set, driver->num entries will be | 364 | * properly in sysfs. If not set, driver->num entries will be |
diff --git a/include/linux/uinput.h b/include/linux/uinput.h index 05f7fed2b173..d28c726ede4f 100644 --- a/include/linux/uinput.h +++ b/include/linux/uinput.h | |||
@@ -104,6 +104,7 @@ struct uinput_ff_erase { | |||
104 | #define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int) | 104 | #define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int) |
105 | #define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*) | 105 | #define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*) |
106 | #define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int) | 106 | #define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int) |
107 | #define UI_SET_PROPBIT _IOW(UINPUT_IOCTL_BASE, 110, int) | ||
107 | 108 | ||
108 | #define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload) | 109 | #define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload) |
109 | #define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload) | 110 | #define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload) |
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..bd69b65f3356 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/completion.h> /* for struct completion */ | 20 | #include <linux/completion.h> /* for struct completion */ |
21 | #include <linux/sched.h> /* for current && schedule_timeout */ | 21 | #include <linux/sched.h> /* for current && schedule_timeout */ |
22 | #include <linux/mutex.h> /* for struct mutex */ | 22 | #include <linux/mutex.h> /* for struct mutex */ |
23 | #include <linux/pm_runtime.h> /* for runtime PM */ | ||
23 | 24 | ||
24 | struct usb_device; | 25 | struct usb_device; |
25 | struct usb_driver; | 26 | struct usb_driver; |
@@ -313,6 +314,10 @@ struct usb_bus { | |||
313 | int busnum; /* Bus number (in order of reg) */ | 314 | int busnum; /* Bus number (in order of reg) */ |
314 | const char *bus_name; /* stable id (PCI slot_name etc) */ | 315 | const char *bus_name; /* stable id (PCI slot_name etc) */ |
315 | u8 uses_dma; /* Does the host controller use DMA? */ | 316 | u8 uses_dma; /* Does the host controller use DMA? */ |
317 | u8 uses_pio_for_control; /* | ||
318 | * Does the host controller use PIO | ||
319 | * for control transfers? | ||
320 | */ | ||
316 | u8 otg_port; /* 0, or number of OTG/HNP port */ | 321 | u8 otg_port; /* 0, or number of OTG/HNP port */ |
317 | unsigned is_b_host:1; /* true during some HNP roleswitches */ | 322 | unsigned is_b_host:1; /* true during some HNP roleswitches */ |
318 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ | 323 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ |
@@ -407,8 +412,6 @@ struct usb_tt; | |||
407 | * @quirks: quirks of the whole device | 412 | * @quirks: quirks of the whole device |
408 | * @urbnum: number of URBs submitted for the whole device | 413 | * @urbnum: number of URBs submitted for the whole device |
409 | * @active_duration: total time device is not suspended | 414 | * @active_duration: total time device is not suspended |
410 | * @last_busy: time of last use | ||
411 | * @autosuspend_delay: in jiffies | ||
412 | * @connect_time: time device was first connected | 415 | * @connect_time: time device was first connected |
413 | * @do_remote_wakeup: remote wakeup should be enabled | 416 | * @do_remote_wakeup: remote wakeup should be enabled |
414 | * @reset_resume: needs reset instead of resume | 417 | * @reset_resume: needs reset instead of resume |
@@ -481,8 +484,6 @@ struct usb_device { | |||
481 | unsigned long active_duration; | 484 | unsigned long active_duration; |
482 | 485 | ||
483 | #ifdef CONFIG_PM | 486 | #ifdef CONFIG_PM |
484 | unsigned long last_busy; | ||
485 | int autosuspend_delay; | ||
486 | unsigned long connect_time; | 487 | unsigned long connect_time; |
487 | 488 | ||
488 | unsigned do_remote_wakeup:1; | 489 | unsigned do_remote_wakeup:1; |
@@ -527,7 +528,7 @@ extern void usb_autopm_put_interface_no_suspend(struct usb_interface *intf); | |||
527 | 528 | ||
528 | static inline void usb_mark_last_busy(struct usb_device *udev) | 529 | static inline void usb_mark_last_busy(struct usb_device *udev) |
529 | { | 530 | { |
530 | udev->last_busy = jiffies; | 531 | pm_runtime_mark_last_busy(&udev->dev); |
531 | } | 532 | } |
532 | 533 | ||
533 | #else | 534 | #else |
@@ -797,7 +798,7 @@ struct usbdrv_wrap { | |||
797 | * @disconnect: Called when the interface is no longer accessible, usually | 798 | * @disconnect: Called when the interface is no longer accessible, usually |
798 | * because its device has been (or is being) disconnected or the | 799 | * because its device has been (or is being) disconnected or the |
799 | * driver module is being unloaded. | 800 | * driver module is being unloaded. |
800 | * @ioctl: Used for drivers that want to talk to userspace through | 801 | * @unlocked_ioctl: Used for drivers that want to talk to userspace through |
801 | * the "usbfs" filesystem. This lets devices provide ways to | 802 | * the "usbfs" filesystem. This lets devices provide ways to |
802 | * expose information to user space regardless of where they | 803 | * expose information to user space regardless of where they |
803 | * do (or don't) show up otherwise in the filesystem. | 804 | * do (or don't) show up otherwise in the filesystem. |
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h index 119194c85d10..10ec0699bea4 100644 --- a/include/linux/usb/ch11.h +++ b/include/linux/usb/ch11.h | |||
@@ -28,6 +28,13 @@ | |||
28 | #define HUB_STOP_TT 11 | 28 | #define HUB_STOP_TT 11 |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * Hub class additional requests defined by USB 3.0 spec | ||
32 | * See USB 3.0 spec Table 10-6 | ||
33 | */ | ||
34 | #define HUB_SET_DEPTH 12 | ||
35 | #define HUB_GET_PORT_ERR_COUNT 13 | ||
36 | |||
37 | /* | ||
31 | * Hub Class feature numbers | 38 | * Hub Class feature numbers |
32 | * See USB 2.0 spec Table 11-17 | 39 | * See USB 2.0 spec Table 11-17 |
33 | */ | 40 | */ |
@@ -56,6 +63,20 @@ | |||
56 | #define USB_PORT_FEAT_C_PORT_L1 23 | 63 | #define USB_PORT_FEAT_C_PORT_L1 23 |
57 | 64 | ||
58 | /* | 65 | /* |
66 | * Port feature selectors added by USB 3.0 spec. | ||
67 | * See USB 3.0 spec Table 10-7 | ||
68 | */ | ||
69 | #define USB_PORT_FEAT_LINK_STATE 5 | ||
70 | #define USB_PORT_FEAT_U1_TIMEOUT 23 | ||
71 | #define USB_PORT_FEAT_U2_TIMEOUT 24 | ||
72 | #define USB_PORT_FEAT_C_LINK_STATE 25 | ||
73 | #define USB_PORT_FEAT_C_CONFIG_ERR 26 | ||
74 | #define USB_PORT_FEAT_REMOTE_WAKE_MASK 27 | ||
75 | #define USB_PORT_FEAT_BH_PORT_RESET 28 | ||
76 | #define USB_PORT_FEAT_C_BH_PORT_RESET 29 | ||
77 | #define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT 30 | ||
78 | |||
79 | /* | ||
59 | * Hub Status and Hub Change results | 80 | * Hub Status and Hub Change results |
60 | * See USB 2.0 spec Table 11-19 and Table 11-20 | 81 | * See USB 2.0 spec Table 11-19 and Table 11-20 |
61 | */ | 82 | */ |
@@ -84,6 +105,32 @@ struct usb_port_status { | |||
84 | #define USB_PORT_STAT_SUPER_SPEED 0x8000 /* Linux-internal */ | 105 | #define USB_PORT_STAT_SUPER_SPEED 0x8000 /* Linux-internal */ |
85 | 106 | ||
86 | /* | 107 | /* |
108 | * Additions to wPortStatus bit field from USB 3.0 | ||
109 | * See USB 3.0 spec Table 10-10 | ||
110 | */ | ||
111 | #define USB_PORT_STAT_LINK_STATE 0x01e0 | ||
112 | #define USB_SS_PORT_STAT_POWER 0x0200 | ||
113 | #define USB_PORT_STAT_SPEED_5GBPS 0x0000 | ||
114 | /* Valid only if port is enabled */ | ||
115 | |||
116 | /* | ||
117 | * Definitions for PORT_LINK_STATE values | ||
118 | * (bits 5-8) in wPortStatus | ||
119 | */ | ||
120 | #define USB_SS_PORT_LS_U0 0x0000 | ||
121 | #define USB_SS_PORT_LS_U1 0x0020 | ||
122 | #define USB_SS_PORT_LS_U2 0x0040 | ||
123 | #define USB_SS_PORT_LS_U3 0x0060 | ||
124 | #define USB_SS_PORT_LS_SS_DISABLED 0x0080 | ||
125 | #define USB_SS_PORT_LS_RX_DETECT 0x00a0 | ||
126 | #define USB_SS_PORT_LS_SS_INACTIVE 0x00c0 | ||
127 | #define USB_SS_PORT_LS_POLLING 0x00e0 | ||
128 | #define USB_SS_PORT_LS_RECOVERY 0x0100 | ||
129 | #define USB_SS_PORT_LS_HOT_RESET 0x0120 | ||
130 | #define USB_SS_PORT_LS_COMP_MOD 0x0140 | ||
131 | #define USB_SS_PORT_LS_LOOPBACK 0x0160 | ||
132 | |||
133 | /* | ||
87 | * wPortChange bit field | 134 | * wPortChange bit field |
88 | * See USB 2.0 spec Table 11-22 | 135 | * See USB 2.0 spec Table 11-22 |
89 | * Bits 0 to 4 shown, bits 5 to 15 are reserved | 136 | * Bits 0 to 4 shown, bits 5 to 15 are reserved |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index f917bbbc8901..ab461948b579 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -124,6 +124,16 @@ | |||
124 | #define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ | 124 | #define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ |
125 | 125 | ||
126 | /* | 126 | /* |
127 | * Test Mode Selectors | ||
128 | * See USB 2.0 spec Table 9-7 | ||
129 | */ | ||
130 | #define TEST_J 1 | ||
131 | #define TEST_K 2 | ||
132 | #define TEST_SE0_NAK 3 | ||
133 | #define TEST_PACKET 4 | ||
134 | #define TEST_FORCE_EN 5 | ||
135 | |||
136 | /* | ||
127 | * New Feature Selectors as added by USB 3.0 | 137 | * New Feature Selectors as added by USB 3.0 |
128 | * See USB 3.0 spec Table 9-6 | 138 | * See USB 3.0 spec Table 9-6 |
129 | */ | 139 | */ |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 0b6e751ea0b1..dd6ee49a0844 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -471,6 +471,10 @@ extern void usb_ep0_reinit(struct usb_device *); | |||
471 | 471 | ||
472 | /*-------------------------------------------------------------------------*/ | 472 | /*-------------------------------------------------------------------------*/ |
473 | 473 | ||
474 | /* class requests from USB 3.0 hub spec, table 10-5 */ | ||
475 | #define SetHubDepth (0x3000 | HUB_SET_DEPTH) | ||
476 | #define GetPortErrorCount (0x8000 | HUB_GET_PORT_ERR_COUNT) | ||
477 | |||
474 | /* | 478 | /* |
475 | * Generic bandwidth allocation constants/support | 479 | * Generic bandwidth allocation constants/support |
476 | */ | 480 | */ |
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h new file mode 100644 index 000000000000..3675e03b1539 --- /dev/null +++ b/include/linux/usb/msm_hsusb.h | |||
@@ -0,0 +1,112 @@ | |||
1 | /* linux/include/asm-arm/arch-msm/hsusb.h | ||
2 | * | ||
3 | * Copyright (C) 2008 Google, Inc. | ||
4 | * Author: Brian Swetland <swetland@google.com> | ||
5 | * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved. | ||
6 | * | ||
7 | * This software is licensed under the terms of the GNU General Public | ||
8 | * License version 2, as published by the Free Software Foundation, and | ||
9 | * may be copied, distributed, and modified under those terms. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef __ASM_ARCH_MSM_HSUSB_H | ||
19 | #define __ASM_ARCH_MSM_HSUSB_H | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | #include <linux/usb/otg.h> | ||
23 | |||
24 | /** | ||
25 | * Supported USB modes | ||
26 | * | ||
27 | * USB_PERIPHERAL Only peripheral mode is supported. | ||
28 | * USB_HOST Only host mode is supported. | ||
29 | * USB_OTG OTG mode is supported. | ||
30 | * | ||
31 | */ | ||
32 | enum usb_mode_type { | ||
33 | USB_NONE = 0, | ||
34 | USB_PERIPHERAL, | ||
35 | USB_HOST, | ||
36 | USB_OTG, | ||
37 | }; | ||
38 | |||
39 | /** | ||
40 | * OTG control | ||
41 | * | ||
42 | * OTG_NO_CONTROL Id/VBUS notifications not required. Useful in host | ||
43 | * only configuration. | ||
44 | * OTG_PHY_CONTROL Id/VBUS notifications comes form USB PHY. | ||
45 | * OTG_PMIC_CONTROL Id/VBUS notifications comes from PMIC hardware. | ||
46 | * OTG_USER_CONTROL Id/VBUS notifcations comes from User via sysfs. | ||
47 | * | ||
48 | */ | ||
49 | enum otg_control_type { | ||
50 | OTG_NO_CONTROL = 0, | ||
51 | OTG_PHY_CONTROL, | ||
52 | OTG_PMIC_CONTROL, | ||
53 | OTG_USER_CONTROL, | ||
54 | }; | ||
55 | |||
56 | /** | ||
57 | * struct msm_otg_platform_data - platform device data | ||
58 | * for msm72k_otg driver. | ||
59 | * @phy_init_seq: PHY configuration sequence. val, reg pairs | ||
60 | * terminated by -1. | ||
61 | * @vbus_power: VBUS power on/off routine. | ||
62 | * @power_budget: VBUS power budget in mA (0 will be treated as 500mA). | ||
63 | * @mode: Supported mode (OTG/peripheral/host). | ||
64 | * @otg_control: OTG switch controlled by user/Id pin | ||
65 | * @default_mode: Default operational mode. Applicable only if | ||
66 | * OTG switch is controller by user. | ||
67 | * | ||
68 | */ | ||
69 | struct msm_otg_platform_data { | ||
70 | int *phy_init_seq; | ||
71 | void (*vbus_power)(bool on); | ||
72 | unsigned power_budget; | ||
73 | enum usb_mode_type mode; | ||
74 | enum otg_control_type otg_control; | ||
75 | enum usb_mode_type default_mode; | ||
76 | void (*setup_gpio)(enum usb_otg_state state); | ||
77 | }; | ||
78 | |||
79 | /** | ||
80 | * struct msm_otg: OTG driver data. Shared by HCD and DCD. | ||
81 | * @otg: USB OTG Transceiver structure. | ||
82 | * @pdata: otg device platform data. | ||
83 | * @irq: IRQ number assigned for HSUSB controller. | ||
84 | * @clk: clock struct of usb_hs_clk. | ||
85 | * @pclk: clock struct of usb_hs_pclk. | ||
86 | * @phy_reset_clk: clock struct of usb_phy_clk. | ||
87 | * @core_clk: clock struct of usb_hs_core_clk. | ||
88 | * @regs: ioremapped register base address. | ||
89 | * @inputs: OTG state machine inputs(Id, SessValid etc). | ||
90 | * @sm_work: OTG state machine work. | ||
91 | * @in_lpm: indicates low power mode (LPM) state. | ||
92 | * @async_int: Async interrupt arrived. | ||
93 | * | ||
94 | */ | ||
95 | struct msm_otg { | ||
96 | struct otg_transceiver otg; | ||
97 | struct msm_otg_platform_data *pdata; | ||
98 | int irq; | ||
99 | struct clk *clk; | ||
100 | struct clk *pclk; | ||
101 | struct clk *phy_reset_clk; | ||
102 | struct clk *core_clk; | ||
103 | void __iomem *regs; | ||
104 | #define ID 0 | ||
105 | #define B_SESS_VLD 1 | ||
106 | unsigned long inputs; | ||
107 | struct work_struct sm_work; | ||
108 | atomic_t in_lpm; | ||
109 | int async_int; | ||
110 | }; | ||
111 | |||
112 | #endif | ||
diff --git a/include/linux/usb/msm_hsusb_hw.h b/include/linux/usb/msm_hsusb_hw.h new file mode 100644 index 000000000000..b92e17349c7b --- /dev/null +++ b/include/linux/usb/msm_hsusb_hw.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Google, Inc. | ||
3 | * Author: Brian Swetland <swetland@google.com> | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __LINUX_USB_GADGET_MSM72K_UDC_H__ | ||
17 | #define __LINUX_USB_GADGET_MSM72K_UDC_H__ | ||
18 | |||
19 | #ifdef CONFIG_ARCH_MSM7X00A | ||
20 | #define USB_SBUSCFG (MSM_USB_BASE + 0x0090) | ||
21 | #else | ||
22 | #define USB_AHBBURST (MSM_USB_BASE + 0x0090) | ||
23 | #define USB_AHBMODE (MSM_USB_BASE + 0x0098) | ||
24 | #endif | ||
25 | #define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */ | ||
26 | |||
27 | #define USB_USBCMD (MSM_USB_BASE + 0x0140) | ||
28 | #define USB_PORTSC (MSM_USB_BASE + 0x0184) | ||
29 | #define USB_OTGSC (MSM_USB_BASE + 0x01A4) | ||
30 | #define USB_USBMODE (MSM_USB_BASE + 0x01A8) | ||
31 | |||
32 | #define USBCMD_RESET 2 | ||
33 | #define USB_USBINTR (MSM_USB_BASE + 0x0148) | ||
34 | |||
35 | #define PORTSC_PHCD (1 << 23) /* phy suspend mode */ | ||
36 | #define PORTSC_PTS_MASK (3 << 30) | ||
37 | #define PORTSC_PTS_ULPI (3 << 30) | ||
38 | |||
39 | #define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170) | ||
40 | #define ULPI_RUN (1 << 30) | ||
41 | #define ULPI_WRITE (1 << 29) | ||
42 | #define ULPI_READ (0 << 29) | ||
43 | #define ULPI_ADDR(n) (((n) & 255) << 16) | ||
44 | #define ULPI_DATA(n) ((n) & 255) | ||
45 | #define ULPI_DATA_READ(n) (((n) >> 8) & 255) | ||
46 | |||
47 | #define ASYNC_INTR_CTRL (1 << 29) /* Enable async interrupt */ | ||
48 | #define ULPI_STP_CTRL (1 << 30) /* Block communication with PHY */ | ||
49 | |||
50 | /* OTG definitions */ | ||
51 | #define OTGSC_INTSTS_MASK (0x7f << 16) | ||
52 | #define OTGSC_ID (1 << 8) | ||
53 | #define OTGSC_BSV (1 << 11) | ||
54 | #define OTGSC_IDIS (1 << 16) | ||
55 | #define OTGSC_BSVIS (1 << 19) | ||
56 | #define OTGSC_IDIE (1 << 24) | ||
57 | #define OTGSC_BSVIE (1 << 27) | ||
58 | |||
59 | #endif /* __LINUX_USB_GADGET_MSM72K_UDC_H__ */ | ||
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index ee2dd1d506ed..eb505250940a 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC. | 3 | * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC. |
4 | * | 4 | * |
5 | * Board initialization should put one of these into dev->platform_data, | 5 | * Board initialization should put one of these into dev->platform_data, |
6 | * probably on some platform_device named "musb_hdrc". It encapsulates | 6 | * probably on some platform_device named "musb-hdrc". It encapsulates |
7 | * key configuration differences between boards. | 7 | * key configuration differences between boards. |
8 | */ | 8 | */ |
9 | 9 | ||
@@ -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 | }; |
@@ -118,14 +120,14 @@ struct musb_hdrc_platform_data { | |||
118 | /* Power the device on or off */ | 120 | /* Power the device on or off */ |
119 | int (*set_power)(int state); | 121 | int (*set_power)(int state); |
120 | 122 | ||
121 | /* Turn device clock on or off */ | ||
122 | int (*set_clock)(struct clk *clock, int is_on); | ||
123 | |||
124 | /* MUSB configuration-specific details */ | 123 | /* MUSB configuration-specific details */ |
125 | struct musb_hdrc_config *config; | 124 | struct musb_hdrc_config *config; |
126 | 125 | ||
127 | /* Architecture specific board data */ | 126 | /* Architecture specific board data */ |
128 | void *board_data; | 127 | void *board_data; |
128 | |||
129 | /* Platform specific struct musb_ops pointer */ | ||
130 | const void *platform_ops; | ||
129 | }; | 131 | }; |
130 | 132 | ||
131 | 133 | ||
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 0a5b3711e502..a1a1e7a73ec9 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -116,7 +116,7 @@ struct otg_transceiver { | |||
116 | /* for board-specific init logic */ | 116 | /* for board-specific init logic */ |
117 | extern int otg_set_transceiver(struct otg_transceiver *); | 117 | extern int otg_set_transceiver(struct otg_transceiver *); |
118 | 118 | ||
119 | #if defined(CONFIG_NOP_USB_XCEIV) || defined(CONFIG_NOP_USB_XCEIV_MODULE) | 119 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) |
120 | /* sometimes transceivers are accessed only through e.g. ULPI */ | 120 | /* sometimes transceivers are accessed only through e.g. ULPI */ |
121 | extern void usb_nop_xceiv_register(void); | 121 | extern void usb_nop_xceiv_register(void); |
122 | extern void usb_nop_xceiv_unregister(void); | 122 | extern void usb_nop_xceiv_unregister(void); |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 7ae27a473818..44842c8d38c0 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -97,6 +97,12 @@ struct driver_info { | |||
97 | 97 | ||
98 | #define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */ | 98 | #define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */ |
99 | 99 | ||
100 | /* | ||
101 | * Indicates to usbnet, that USB driver accumulates multiple IP packets. | ||
102 | * Affects statistic (counters) and short packet handling. | ||
103 | */ | ||
104 | #define FLAG_MULTI_PACKET 0x1000 | ||
105 | |||
100 | /* init device ... can sleep, or cause probe() failure */ | 106 | /* init device ... can sleep, or cause probe() failure */ |
101 | int (*bind)(struct usbnet *, struct usb_interface *); | 107 | int (*bind)(struct usbnet *, struct usb_interface *); |
102 | 108 | ||
diff --git a/include/linux/via-core.h b/include/linux/via-core.h index 38bffd8ccca5..9c21cdf3e3b3 100644 --- a/include/linux/via-core.h +++ b/include/linux/via-core.h | |||
@@ -60,6 +60,21 @@ struct via_port_cfg { | |||
60 | }; | 60 | }; |
61 | 61 | ||
62 | /* | 62 | /* |
63 | * Allow subdevs to register suspend/resume hooks. | ||
64 | */ | ||
65 | #ifdef CONFIG_PM | ||
66 | struct viafb_pm_hooks { | ||
67 | struct list_head list; | ||
68 | int (*suspend)(void *private); | ||
69 | int (*resume)(void *private); | ||
70 | void *private; | ||
71 | }; | ||
72 | |||
73 | void viafb_pm_register(struct viafb_pm_hooks *hooks); | ||
74 | void viafb_pm_unregister(struct viafb_pm_hooks *hooks); | ||
75 | #endif /* CONFIG_PM */ | ||
76 | |||
77 | /* | ||
63 | * This is the global viafb "device" containing stuff needed by | 78 | * This is the global viafb "device" containing stuff needed by |
64 | * all subdevs. | 79 | * all subdevs. |
65 | */ | 80 | */ |
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/videodev.h b/include/linux/videodev.h deleted file mode 100644 index b19eab140977..000000000000 --- a/include/linux/videodev.h +++ /dev/null | |||
@@ -1,340 +0,0 @@ | |||
1 | /* | ||
2 | * Video for Linux version 1 - OBSOLETE | ||
3 | * | ||
4 | * Header file for v4l1 drivers and applications, for | ||
5 | * Linux kernels 2.2.x or 2.4.x. | ||
6 | * | ||
7 | * Provides header for legacy drivers and applications | ||
8 | * | ||
9 | * See http://linuxtv.org for more info | ||
10 | * | ||
11 | */ | ||
12 | #ifndef __LINUX_VIDEODEV_H | ||
13 | #define __LINUX_VIDEODEV_H | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | #include <linux/ioctl.h> | ||
17 | #include <linux/videodev2.h> | ||
18 | |||
19 | #if defined(__MIN_V4L1) && defined (__KERNEL__) | ||
20 | |||
21 | /* | ||
22 | * Used by those V4L2 core functions that need a minimum V4L1 support, | ||
23 | * in order to allow V4L1 Compatibilty code compilation. | ||
24 | */ | ||
25 | |||
26 | struct video_mbuf | ||
27 | { | ||
28 | int size; /* Total memory to map */ | ||
29 | int frames; /* Frames */ | ||
30 | int offsets[VIDEO_MAX_FRAME]; | ||
31 | }; | ||
32 | |||
33 | #define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */ | ||
34 | |||
35 | #else | ||
36 | #if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__) | ||
37 | |||
38 | #define VID_TYPE_CAPTURE 1 /* Can capture */ | ||
39 | #define VID_TYPE_TUNER 2 /* Can tune */ | ||
40 | #define VID_TYPE_TELETEXT 4 /* Does teletext */ | ||
41 | #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ | ||
42 | #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ | ||
43 | #define VID_TYPE_CLIPPING 32 /* Can clip */ | ||
44 | #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ | ||
45 | #define VID_TYPE_SCALES 128 /* Scalable */ | ||
46 | #define VID_TYPE_MONOCHROME 256 /* Monochrome only */ | ||
47 | #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ | ||
48 | #define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ | ||
49 | #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ | ||
50 | #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ | ||
51 | #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ | ||
52 | |||
53 | struct video_capability | ||
54 | { | ||
55 | char name[32]; | ||
56 | int type; | ||
57 | int channels; /* Num channels */ | ||
58 | int audios; /* Num audio devices */ | ||
59 | int maxwidth; /* Supported width */ | ||
60 | int maxheight; /* And height */ | ||
61 | int minwidth; /* Supported width */ | ||
62 | int minheight; /* And height */ | ||
63 | }; | ||
64 | |||
65 | |||
66 | struct video_channel | ||
67 | { | ||
68 | int channel; | ||
69 | char name[32]; | ||
70 | int tuners; | ||
71 | __u32 flags; | ||
72 | #define VIDEO_VC_TUNER 1 /* Channel has a tuner */ | ||
73 | #define VIDEO_VC_AUDIO 2 /* Channel has audio */ | ||
74 | __u16 type; | ||
75 | #define VIDEO_TYPE_TV 1 | ||
76 | #define VIDEO_TYPE_CAMERA 2 | ||
77 | __u16 norm; /* Norm set by channel */ | ||
78 | }; | ||
79 | |||
80 | struct video_tuner | ||
81 | { | ||
82 | int tuner; | ||
83 | char name[32]; | ||
84 | unsigned long rangelow, rangehigh; /* Tuner range */ | ||
85 | __u32 flags; | ||
86 | #define VIDEO_TUNER_PAL 1 | ||
87 | #define VIDEO_TUNER_NTSC 2 | ||
88 | #define VIDEO_TUNER_SECAM 4 | ||
89 | #define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */ | ||
90 | #define VIDEO_TUNER_NORM 16 /* Tuner can set norm */ | ||
91 | #define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */ | ||
92 | #define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */ | ||
93 | #define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */ | ||
94 | __u16 mode; /* PAL/NTSC/SECAM/OTHER */ | ||
95 | #define VIDEO_MODE_PAL 0 | ||
96 | #define VIDEO_MODE_NTSC 1 | ||
97 | #define VIDEO_MODE_SECAM 2 | ||
98 | #define VIDEO_MODE_AUTO 3 | ||
99 | __u16 signal; /* Signal strength 16bit scale */ | ||
100 | }; | ||
101 | |||
102 | struct video_picture | ||
103 | { | ||
104 | __u16 brightness; | ||
105 | __u16 hue; | ||
106 | __u16 colour; | ||
107 | __u16 contrast; | ||
108 | __u16 whiteness; /* Black and white only */ | ||
109 | __u16 depth; /* Capture depth */ | ||
110 | __u16 palette; /* Palette in use */ | ||
111 | #define VIDEO_PALETTE_GREY 1 /* Linear greyscale */ | ||
112 | #define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */ | ||
113 | #define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */ | ||
114 | #define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */ | ||
115 | #define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */ | ||
116 | #define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */ | ||
117 | #define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */ | ||
118 | #define VIDEO_PALETTE_YUYV 8 | ||
119 | #define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */ | ||
120 | #define VIDEO_PALETTE_YUV420 10 | ||
121 | #define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */ | ||
122 | #define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */ | ||
123 | #define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */ | ||
124 | #define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */ | ||
125 | #define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */ | ||
126 | #define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */ | ||
127 | #define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */ | ||
128 | #define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */ | ||
129 | }; | ||
130 | |||
131 | struct video_audio | ||
132 | { | ||
133 | int audio; /* Audio channel */ | ||
134 | __u16 volume; /* If settable */ | ||
135 | __u16 bass, treble; | ||
136 | __u32 flags; | ||
137 | #define VIDEO_AUDIO_MUTE 1 | ||
138 | #define VIDEO_AUDIO_MUTABLE 2 | ||
139 | #define VIDEO_AUDIO_VOLUME 4 | ||
140 | #define VIDEO_AUDIO_BASS 8 | ||
141 | #define VIDEO_AUDIO_TREBLE 16 | ||
142 | #define VIDEO_AUDIO_BALANCE 32 | ||
143 | char name[16]; | ||
144 | #define VIDEO_SOUND_MONO 1 | ||
145 | #define VIDEO_SOUND_STEREO 2 | ||
146 | #define VIDEO_SOUND_LANG1 4 | ||
147 | #define VIDEO_SOUND_LANG2 8 | ||
148 | __u16 mode; | ||
149 | __u16 balance; /* Stereo balance */ | ||
150 | __u16 step; /* Step actual volume uses */ | ||
151 | }; | ||
152 | |||
153 | struct video_clip | ||
154 | { | ||
155 | __s32 x,y; | ||
156 | __s32 width, height; | ||
157 | struct video_clip *next; /* For user use/driver use only */ | ||
158 | }; | ||
159 | |||
160 | struct video_window | ||
161 | { | ||
162 | __u32 x,y; /* Position of window */ | ||
163 | __u32 width,height; /* Its size */ | ||
164 | __u32 chromakey; | ||
165 | __u32 flags; | ||
166 | struct video_clip __user *clips; /* Set only */ | ||
167 | int clipcount; | ||
168 | #define VIDEO_WINDOW_INTERLACE 1 | ||
169 | #define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */ | ||
170 | #define VIDEO_CLIP_BITMAP -1 | ||
171 | /* bitmap is 1024x625, a '1' bit represents a clipped pixel */ | ||
172 | #define VIDEO_CLIPMAP_SIZE (128 * 625) | ||
173 | }; | ||
174 | |||
175 | struct video_capture | ||
176 | { | ||
177 | __u32 x,y; /* Offsets into image */ | ||
178 | __u32 width, height; /* Area to capture */ | ||
179 | __u16 decimation; /* Decimation divider */ | ||
180 | __u16 flags; /* Flags for capture */ | ||
181 | #define VIDEO_CAPTURE_ODD 0 /* Temporal */ | ||
182 | #define VIDEO_CAPTURE_EVEN 1 | ||
183 | }; | ||
184 | |||
185 | struct video_buffer | ||
186 | { | ||
187 | void *base; | ||
188 | int height,width; | ||
189 | int depth; | ||
190 | int bytesperline; | ||
191 | }; | ||
192 | |||
193 | struct video_mmap | ||
194 | { | ||
195 | unsigned int frame; /* Frame (0 - n) for double buffer */ | ||
196 | int height,width; | ||
197 | unsigned int format; /* should be VIDEO_PALETTE_* */ | ||
198 | }; | ||
199 | |||
200 | struct video_key | ||
201 | { | ||
202 | __u8 key[8]; | ||
203 | __u32 flags; | ||
204 | }; | ||
205 | |||
206 | struct video_mbuf | ||
207 | { | ||
208 | int size; /* Total memory to map */ | ||
209 | int frames; /* Frames */ | ||
210 | int offsets[VIDEO_MAX_FRAME]; | ||
211 | }; | ||
212 | |||
213 | #define VIDEO_NO_UNIT (-1) | ||
214 | |||
215 | struct video_unit | ||
216 | { | ||
217 | int video; /* Video minor */ | ||
218 | int vbi; /* VBI minor */ | ||
219 | int radio; /* Radio minor */ | ||
220 | int audio; /* Audio minor */ | ||
221 | int teletext; /* Teletext minor */ | ||
222 | }; | ||
223 | |||
224 | struct vbi_format { | ||
225 | __u32 sampling_rate; /* in Hz */ | ||
226 | __u32 samples_per_line; | ||
227 | __u32 sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */ | ||
228 | __s32 start[2]; /* starting line for each frame */ | ||
229 | __u32 count[2]; /* count of lines for each frame */ | ||
230 | __u32 flags; | ||
231 | #define VBI_UNSYNC 1 /* can distingues between top/bottom field */ | ||
232 | #define VBI_INTERLACED 2 /* lines are interlaced */ | ||
233 | }; | ||
234 | |||
235 | /* video_info is biased towards hardware mpeg encode/decode */ | ||
236 | /* but it could apply generically to any hardware compressor/decompressor */ | ||
237 | struct video_info | ||
238 | { | ||
239 | __u32 frame_count; /* frames output since decode/encode began */ | ||
240 | __u32 h_size; /* current unscaled horizontal size */ | ||
241 | __u32 v_size; /* current unscaled veritcal size */ | ||
242 | __u32 smpte_timecode; /* current SMPTE timecode (for current GOP) */ | ||
243 | __u32 picture_type; /* current picture type */ | ||
244 | __u32 temporal_reference; /* current temporal reference */ | ||
245 | __u8 user_data[256]; /* user data last found in compressed stream */ | ||
246 | /* user_data[0] contains user data flags, user_data[1] has count */ | ||
247 | }; | ||
248 | |||
249 | /* generic structure for setting playback modes */ | ||
250 | struct video_play_mode | ||
251 | { | ||
252 | int mode; | ||
253 | int p1; | ||
254 | int p2; | ||
255 | }; | ||
256 | |||
257 | /* for loading microcode / fpga programming */ | ||
258 | struct video_code | ||
259 | { | ||
260 | char loadwhat[16]; /* name or tag of file being passed */ | ||
261 | int datasize; | ||
262 | __u8 *data; | ||
263 | }; | ||
264 | |||
265 | #define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */ | ||
266 | #define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */ | ||
267 | #define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */ | ||
268 | #define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */ | ||
269 | #define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */ | ||
270 | #define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */ | ||
271 | #define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */ | ||
272 | #define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */ | ||
273 | #define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */ | ||
274 | #define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */ | ||
275 | #define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */ | ||
276 | #define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */ | ||
277 | #define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */ | ||
278 | #define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */ | ||
279 | #define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */ | ||
280 | #define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */ | ||
281 | #define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */ | ||
282 | #define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */ | ||
283 | #define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */ | ||
284 | #define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */ | ||
285 | #define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */ | ||
286 | #define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */ | ||
287 | #define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */ | ||
288 | #define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */ | ||
289 | #define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */ | ||
290 | #define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */ | ||
291 | #define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */ | ||
292 | #define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */ | ||
293 | #define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */ | ||
294 | |||
295 | |||
296 | #define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */ | ||
297 | |||
298 | /* VIDIOCSWRITEMODE */ | ||
299 | #define VID_WRITE_MPEG_AUD 0 | ||
300 | #define VID_WRITE_MPEG_VID 1 | ||
301 | #define VID_WRITE_OSD 2 | ||
302 | #define VID_WRITE_TTX 3 | ||
303 | #define VID_WRITE_CC 4 | ||
304 | #define VID_WRITE_MJPEG 5 | ||
305 | |||
306 | /* VIDIOCSPLAYMODE */ | ||
307 | #define VID_PLAY_VID_OUT_MODE 0 | ||
308 | /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */ | ||
309 | #define VID_PLAY_GENLOCK 1 | ||
310 | /* p1: 0 = OFF, 1 = ON */ | ||
311 | /* p2: GENLOCK FINE DELAY value */ | ||
312 | #define VID_PLAY_NORMAL 2 | ||
313 | #define VID_PLAY_PAUSE 3 | ||
314 | #define VID_PLAY_SINGLE_FRAME 4 | ||
315 | #define VID_PLAY_FAST_FORWARD 5 | ||
316 | #define VID_PLAY_SLOW_MOTION 6 | ||
317 | #define VID_PLAY_IMMEDIATE_NORMAL 7 | ||
318 | #define VID_PLAY_SWITCH_CHANNELS 8 | ||
319 | #define VID_PLAY_FREEZE_FRAME 9 | ||
320 | #define VID_PLAY_STILL_MODE 10 | ||
321 | #define VID_PLAY_MASTER_MODE 11 | ||
322 | /* p1: see below */ | ||
323 | #define VID_PLAY_MASTER_NONE 1 | ||
324 | #define VID_PLAY_MASTER_VIDEO 2 | ||
325 | #define VID_PLAY_MASTER_AUDIO 3 | ||
326 | #define VID_PLAY_ACTIVE_SCANLINES 12 | ||
327 | /* p1 = first active; p2 = last active */ | ||
328 | #define VID_PLAY_RESET 13 | ||
329 | #define VID_PLAY_END_MARK 14 | ||
330 | |||
331 | #endif /* CONFIG_VIDEO_V4L1_COMPAT */ | ||
332 | #endif /* __MIN_V4L1 */ | ||
333 | |||
334 | #endif /* __LINUX_VIDEODEV_H */ | ||
335 | |||
336 | /* | ||
337 | * Local variables: | ||
338 | * c-basic-offset: 8 | ||
339 | * End: | ||
340 | */ | ||
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index a03dcf62ca9d..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() */ |
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h index 4f902e1908aa..bebb8efea0a6 100644 --- a/include/linux/wl12xx.h +++ b/include/linux/wl12xx.h | |||
@@ -24,6 +24,14 @@ | |||
24 | #ifndef _LINUX_WL12XX_H | 24 | #ifndef _LINUX_WL12XX_H |
25 | #define _LINUX_WL12XX_H | 25 | #define _LINUX_WL12XX_H |
26 | 26 | ||
27 | /* The board reference clock values */ | ||
28 | enum { | ||
29 | WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */ | ||
30 | WL12XX_REFCLOCK_26 = 1, /* 26 MHz */ | ||
31 | WL12XX_REFCLOCK_38 = 2, /* 38.4 MHz */ | ||
32 | WL12XX_REFCLOCK_54 = 3, /* 54 MHz */ | ||
33 | }; | ||
34 | |||
27 | struct wl12xx_platform_data { | 35 | struct wl12xx_platform_data { |
28 | void (*set_power)(bool enable); | 36 | void (*set_power)(bool enable); |
29 | /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ | 37 | /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 0c0771f06bfa..1ac11586a2f5 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -127,12 +127,20 @@ struct execute_work { | |||
127 | .timer = TIMER_INITIALIZER(NULL, 0, 0), \ | 127 | .timer = TIMER_INITIALIZER(NULL, 0, 0), \ |
128 | } | 128 | } |
129 | 129 | ||
130 | #define __DEFERRED_WORK_INITIALIZER(n, f) { \ | ||
131 | .work = __WORK_INITIALIZER((n).work, (f)), \ | ||
132 | .timer = TIMER_DEFERRED_INITIALIZER(NULL, 0, 0), \ | ||
133 | } | ||
134 | |||
130 | #define DECLARE_WORK(n, f) \ | 135 | #define DECLARE_WORK(n, f) \ |
131 | struct work_struct n = __WORK_INITIALIZER(n, f) | 136 | struct work_struct n = __WORK_INITIALIZER(n, f) |
132 | 137 | ||
133 | #define DECLARE_DELAYED_WORK(n, f) \ | 138 | #define DECLARE_DELAYED_WORK(n, f) \ |
134 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f) | 139 | struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f) |
135 | 140 | ||
141 | #define DECLARE_DEFERRED_WORK(n, f) \ | ||
142 | struct delayed_work n = __DEFERRED_WORK_INITIALIZER(n, f) | ||
143 | |||
136 | /* | 144 | /* |
137 | * initialize a work item's function pointer | 145 | * initialize a work item's function pointer |
138 | */ | 146 | */ |
@@ -401,7 +409,7 @@ static inline bool __cancel_delayed_work(struct delayed_work *work) | |||
401 | } | 409 | } |
402 | 410 | ||
403 | /* Obsolete. use cancel_delayed_work_sync() */ | 411 | /* Obsolete. use cancel_delayed_work_sync() */ |
404 | static inline | 412 | static inline __deprecated |
405 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, | 413 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, |
406 | struct delayed_work *work) | 414 | struct delayed_work *work) |
407 | { | 415 | { |
@@ -409,7 +417,7 @@ void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, | |||
409 | } | 417 | } |
410 | 418 | ||
411 | /* Obsolete. use cancel_delayed_work_sync() */ | 419 | /* Obsolete. use cancel_delayed_work_sync() */ |
412 | static inline | 420 | static inline __deprecated |
413 | void cancel_rearming_delayed_work(struct delayed_work *work) | 421 | void cancel_rearming_delayed_work(struct delayed_work *work) |
414 | { | 422 | { |
415 | cancel_delayed_work_sync(work); | 423 | cancel_delayed_work_sync(work); |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index b971e3848493..930fdd2de79c 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -283,6 +283,7 @@ enum xfrm_attr_type_t { | |||
283 | XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ | 283 | XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ |
284 | XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */ | 284 | XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */ |
285 | XFRMA_MARK, /* struct xfrm_mark */ | 285 | XFRMA_MARK, /* struct xfrm_mark */ |
286 | XFRMA_TFCPAD, /* __u32 */ | ||
286 | __XFRMA_MAX | 287 | __XFRMA_MAX |
287 | 288 | ||
288 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 289 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
diff --git a/include/media/bt819.h b/include/media/bt819.h index 38f666bde77a..8025f4bc2bb6 100644 --- a/include/media/bt819.h +++ b/include/media/bt819.h | |||
@@ -26,7 +26,10 @@ | |||
26 | /* v4l2_device notifications. */ | 26 | /* v4l2_device notifications. */ |
27 | 27 | ||
28 | /* Needed to reset the FIFO buffer when changing the input | 28 | /* Needed to reset the FIFO buffer when changing the input |
29 | or the video standard. */ | 29 | or the video standard. |
30 | |||
31 | Note: these ioctls that internal to the kernel and are never called | ||
32 | from userspace. */ | ||
30 | #define BT819_FIFO_RESET_LOW _IO('b', 0) | 33 | #define BT819_FIFO_RESET_LOW _IO('b', 0) |
31 | #define BT819_FIFO_RESET_HIGH _IO('b', 1) | 34 | #define BT819_FIFO_RESET_HIGH _IO('b', 1) |
32 | 35 | ||
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h index 8d08ebfe20b7..9635eebaab09 100644 --- a/include/media/cx2341x.h +++ b/include/media/cx2341x.h | |||
@@ -95,7 +95,7 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func, | |||
95 | const struct cx2341x_mpeg_params *new); | 95 | const struct cx2341x_mpeg_params *new); |
96 | int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params, | 96 | int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params, |
97 | struct v4l2_queryctrl *qctrl); | 97 | struct v4l2_queryctrl *qctrl); |
98 | const char **cx2341x_ctrl_get_menu(const struct cx2341x_mpeg_params *p, u32 id); | 98 | const char * const *cx2341x_ctrl_get_menu(const struct cx2341x_mpeg_params *p, u32 id); |
99 | int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy, | 99 | int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy, |
100 | struct v4l2_ext_controls *ctrls, unsigned int cmd); | 100 | struct v4l2_ext_controls *ctrls, unsigned int cmd); |
101 | void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); | 101 | void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); |
diff --git a/include/media/ir-common.h b/include/media/ir-common.h deleted file mode 100644 index 528050e39ad9..000000000000 --- a/include/media/ir-common.h +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * some common structs and functions to handle infrared remotes via | ||
4 | * input layer ... | ||
5 | * | ||
6 | * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef _IR_COMMON | ||
24 | #define _IR_COMMON | ||
25 | |||
26 | #include <linux/input.h> | ||
27 | #include <linux/workqueue.h> | ||
28 | #include <linux/interrupt.h> | ||
29 | #include <media/ir-core.h> | ||
30 | |||
31 | #define RC5_START(x) (((x)>>12)&3) | ||
32 | #define RC5_TOGGLE(x) (((x)>>11)&1) | ||
33 | #define RC5_ADDR(x) (((x)>>6)&31) | ||
34 | #define RC5_INSTR(x) ((x)&63) | ||
35 | |||
36 | struct ir_input_state { | ||
37 | /* configuration */ | ||
38 | u64 ir_type; | ||
39 | |||
40 | /* key info */ | ||
41 | u32 ir_key; /* ir scancode */ | ||
42 | u32 keycode; /* linux key code */ | ||
43 | int keypressed; /* current state */ | ||
44 | }; | ||
45 | |||
46 | /* this was saa7134_ir and bttv_ir, moved here for | ||
47 | * rc5 decoding. */ | ||
48 | struct card_ir { | ||
49 | struct input_dev *dev; | ||
50 | struct ir_input_state ir; | ||
51 | char name[32]; | ||
52 | char phys[32]; | ||
53 | int users; | ||
54 | |||
55 | u32 running:1; | ||
56 | struct ir_dev_props props; | ||
57 | |||
58 | /* Usual gpio signalling */ | ||
59 | |||
60 | u32 mask_keycode; | ||
61 | u32 mask_keydown; | ||
62 | u32 mask_keyup; | ||
63 | u32 polling; | ||
64 | u32 last_gpio; | ||
65 | int shift_by; | ||
66 | int start; // What should RC5_START() be | ||
67 | int addr; // What RC5_ADDR() should be. | ||
68 | int rc5_key_timeout; | ||
69 | int rc5_remote_gap; | ||
70 | struct work_struct work; | ||
71 | struct timer_list timer; | ||
72 | |||
73 | /* RC5 gpio */ | ||
74 | u32 rc5_gpio; | ||
75 | struct timer_list timer_end; /* timer_end for code completion */ | ||
76 | struct timer_list timer_keyup; /* timer_end for key release */ | ||
77 | u32 last_rc5; /* last good rc5 code */ | ||
78 | u32 last_bit; /* last raw bit seen */ | ||
79 | u32 code; /* raw code under construction */ | ||
80 | struct timeval base_time; /* time of last seen code */ | ||
81 | int active; /* building raw code */ | ||
82 | |||
83 | /* NEC decoding */ | ||
84 | u32 nec_gpio; | ||
85 | struct tasklet_struct tlet; | ||
86 | |||
87 | /* IR core raw decoding */ | ||
88 | u32 raw_decode; | ||
89 | }; | ||
90 | |||
91 | /* Routines from ir-functions.c */ | ||
92 | |||
93 | int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | ||
94 | const u64 ir_type); | ||
95 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); | ||
96 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, | ||
97 | u32 ir_key); | ||
98 | u32 ir_extract_bits(u32 data, u32 mask); | ||
99 | int ir_dump_samples(u32 *samples, int count); | ||
100 | int ir_decode_biphase(u32 *samples, int count, int low, int high); | ||
101 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); | ||
102 | u32 ir_rc5_decode(unsigned int code); | ||
103 | |||
104 | void ir_rc5_timer_end(unsigned long data); | ||
105 | void ir_rc5_timer_keyup(unsigned long data); | ||
106 | |||
107 | #endif | ||
diff --git a/include/media/ir-core.h b/include/media/ir-core.h deleted file mode 100644 index 6dc37fae6606..000000000000 --- a/include/media/ir-core.h +++ /dev/null | |||
@@ -1,214 +0,0 @@ | |||
1 | /* | ||
2 | * Remote Controller core header | ||
3 | * | ||
4 | * Copyright (C) 2009-2010 by Mauro Carvalho Chehab <mchehab@redhat.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation version 2 of the License. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef _IR_CORE | ||
17 | #define _IR_CORE | ||
18 | |||
19 | #include <linux/spinlock.h> | ||
20 | #include <linux/kfifo.h> | ||
21 | #include <linux/time.h> | ||
22 | #include <linux/timer.h> | ||
23 | #include <media/rc-map.h> | ||
24 | |||
25 | extern int ir_core_debug; | ||
26 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ | ||
27 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | ||
28 | |||
29 | enum rc_driver_type { | ||
30 | RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */ | ||
31 | RC_DRIVER_IR_RAW, /* Needs a Infra-Red pulse/space decoder */ | ||
32 | }; | ||
33 | |||
34 | /** | ||
35 | * struct ir_dev_props - Allow caller drivers to set special properties | ||
36 | * @driver_type: specifies if the driver or hardware have already a decoder, | ||
37 | * or if it needs to use the IR raw event decoders to produce a scancode | ||
38 | * @allowed_protos: bitmask with the supported IR_TYPE_* protocols | ||
39 | * @scanmask: some hardware decoders are not capable of providing the full | ||
40 | * scancode to the application. As this is a hardware limit, we can't do | ||
41 | * anything with it. Yet, as the same keycode table can be used with other | ||
42 | * devices, a mask is provided to allow its usage. Drivers should generally | ||
43 | * leave this field in blank | ||
44 | * @timeout: optional time after which device stops sending data | ||
45 | * @min_timeout: minimum timeout supported by device | ||
46 | * @max_timeout: maximum timeout supported by device | ||
47 | * @rx_resolution : resolution (in ns) of input sampler | ||
48 | * @tx_resolution: resolution (in ns) of output sampler | ||
49 | * @priv: driver-specific data, to be used on the callbacks | ||
50 | * @change_protocol: allow changing the protocol used on hardware decoders | ||
51 | * @open: callback to allow drivers to enable polling/irq when IR input device | ||
52 | * is opened. | ||
53 | * @close: callback to allow drivers to disable polling/irq when IR input device | ||
54 | * is opened. | ||
55 | * @s_tx_mask: set transmitter mask (for devices with multiple tx outputs) | ||
56 | * @s_tx_carrier: set transmit carrier frequency | ||
57 | * @s_tx_duty_cycle: set transmit duty cycle (0% - 100%) | ||
58 | * @s_rx_carrier: inform driver about carrier it is expected to handle | ||
59 | * @tx_ir: transmit IR | ||
60 | * @s_idle: optional: enable/disable hardware idle mode, upon which, | ||
61 | device doesn't interrupt host until it sees IR pulses | ||
62 | * @s_learning_mode: enable wide band receiver used for learning | ||
63 | * @s_carrier_report: enable carrier reports | ||
64 | */ | ||
65 | struct ir_dev_props { | ||
66 | enum rc_driver_type driver_type; | ||
67 | unsigned long allowed_protos; | ||
68 | u32 scanmask; | ||
69 | |||
70 | u32 timeout; | ||
71 | u32 min_timeout; | ||
72 | u32 max_timeout; | ||
73 | |||
74 | u32 rx_resolution; | ||
75 | u32 tx_resolution; | ||
76 | |||
77 | void *priv; | ||
78 | int (*change_protocol)(void *priv, u64 ir_type); | ||
79 | int (*open)(void *priv); | ||
80 | void (*close)(void *priv); | ||
81 | int (*s_tx_mask)(void *priv, u32 mask); | ||
82 | int (*s_tx_carrier)(void *priv, u32 carrier); | ||
83 | int (*s_tx_duty_cycle)(void *priv, u32 duty_cycle); | ||
84 | int (*s_rx_carrier_range)(void *priv, u32 min, u32 max); | ||
85 | int (*tx_ir)(void *priv, int *txbuf, u32 n); | ||
86 | void (*s_idle)(void *priv, bool enable); | ||
87 | int (*s_learning_mode)(void *priv, int enable); | ||
88 | int (*s_carrier_report) (void *priv, int enable); | ||
89 | }; | ||
90 | |||
91 | struct ir_input_dev { | ||
92 | struct device dev; /* device */ | ||
93 | char *driver_name; /* Name of the driver module */ | ||
94 | struct ir_scancode_table rc_tab; /* scan/key table */ | ||
95 | unsigned long devno; /* device number */ | ||
96 | struct ir_dev_props *props; /* Device properties */ | ||
97 | struct ir_raw_event_ctrl *raw; /* for raw pulse/space events */ | ||
98 | struct input_dev *input_dev; /* the input device associated with this device */ | ||
99 | bool idle; | ||
100 | |||
101 | /* key info - needed by IR keycode handlers */ | ||
102 | spinlock_t keylock; /* protects the below members */ | ||
103 | bool keypressed; /* current state */ | ||
104 | unsigned long keyup_jiffies; /* when should the current keypress be released? */ | ||
105 | struct timer_list timer_keyup; /* timer for releasing a keypress */ | ||
106 | u32 last_keycode; /* keycode of last command */ | ||
107 | u32 last_scancode; /* scancode of last command */ | ||
108 | u8 last_toggle; /* toggle of last command */ | ||
109 | }; | ||
110 | |||
111 | enum raw_event_type { | ||
112 | IR_SPACE = (1 << 0), | ||
113 | IR_PULSE = (1 << 1), | ||
114 | IR_START_EVENT = (1 << 2), | ||
115 | IR_STOP_EVENT = (1 << 3), | ||
116 | }; | ||
117 | |||
118 | #define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr) | ||
119 | |||
120 | /* From ir-keytable.c */ | ||
121 | int __ir_input_register(struct input_dev *dev, | ||
122 | const struct ir_scancode_table *ir_codes, | ||
123 | struct ir_dev_props *props, | ||
124 | const char *driver_name); | ||
125 | |||
126 | static inline int ir_input_register(struct input_dev *dev, | ||
127 | const char *map_name, | ||
128 | struct ir_dev_props *props, | ||
129 | const char *driver_name) { | ||
130 | struct ir_scancode_table *ir_codes; | ||
131 | struct ir_input_dev *ir_dev; | ||
132 | int rc; | ||
133 | |||
134 | if (!map_name) | ||
135 | return -EINVAL; | ||
136 | |||
137 | ir_codes = get_rc_map(map_name); | ||
138 | if (!ir_codes) { | ||
139 | ir_codes = get_rc_map(RC_MAP_EMPTY); | ||
140 | |||
141 | if (!ir_codes) | ||
142 | return -EINVAL; | ||
143 | } | ||
144 | |||
145 | rc = __ir_input_register(dev, ir_codes, props, driver_name); | ||
146 | if (rc < 0) | ||
147 | return -EINVAL; | ||
148 | |||
149 | ir_dev = input_get_drvdata(dev); | ||
150 | |||
151 | if (!rc && ir_dev->props && ir_dev->props->change_protocol) | ||
152 | rc = ir_dev->props->change_protocol(ir_dev->props->priv, | ||
153 | ir_codes->ir_type); | ||
154 | |||
155 | return rc; | ||
156 | } | ||
157 | |||
158 | void ir_input_unregister(struct input_dev *input_dev); | ||
159 | |||
160 | void ir_repeat(struct input_dev *dev); | ||
161 | void ir_keydown(struct input_dev *dev, int scancode, u8 toggle); | ||
162 | void ir_keyup(struct ir_input_dev *ir); | ||
163 | u32 ir_g_keycode_from_table(struct input_dev *input_dev, u32 scancode); | ||
164 | |||
165 | /* From ir-raw-event.c */ | ||
166 | |||
167 | struct ir_raw_event { | ||
168 | union { | ||
169 | u32 duration; | ||
170 | |||
171 | struct { | ||
172 | u32 carrier; | ||
173 | u8 duty_cycle; | ||
174 | }; | ||
175 | }; | ||
176 | |||
177 | unsigned pulse:1; | ||
178 | unsigned reset:1; | ||
179 | unsigned timeout:1; | ||
180 | unsigned carrier_report:1; | ||
181 | }; | ||
182 | |||
183 | #define DEFINE_IR_RAW_EVENT(event) \ | ||
184 | struct ir_raw_event event = { \ | ||
185 | { .duration = 0 } , \ | ||
186 | .pulse = 0, \ | ||
187 | .reset = 0, \ | ||
188 | .timeout = 0, \ | ||
189 | .carrier_report = 0 } | ||
190 | |||
191 | static inline void init_ir_raw_event(struct ir_raw_event *ev) | ||
192 | { | ||
193 | memset(ev, 0, sizeof(*ev)); | ||
194 | } | ||
195 | |||
196 | #define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */ | ||
197 | |||
198 | void ir_raw_event_handle(struct input_dev *input_dev); | ||
199 | int ir_raw_event_store(struct input_dev *input_dev, struct ir_raw_event *ev); | ||
200 | int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type); | ||
201 | int ir_raw_event_store_with_filter(struct input_dev *input_dev, | ||
202 | struct ir_raw_event *ev); | ||
203 | void ir_raw_event_set_idle(struct input_dev *input_dev, bool idle); | ||
204 | |||
205 | static inline void ir_raw_event_reset(struct input_dev *input_dev) | ||
206 | { | ||
207 | DEFINE_IR_RAW_EVENT(ev); | ||
208 | ev.reset = true; | ||
209 | |||
210 | ir_raw_event_store(input_dev, &ev); | ||
211 | ir_raw_event_handle(input_dev); | ||
212 | } | ||
213 | |||
214 | #endif /* _IR_CORE */ | ||
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h index 557c676ab7dc..768aa77925cd 100644 --- a/include/media/ir-kbd-i2c.h +++ b/include/media/ir-kbd-i2c.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _IR_I2C | 1 | #ifndef _IR_I2C |
2 | #define _IR_I2C | 2 | #define _IR_I2C |
3 | 3 | ||
4 | #include <media/ir-common.h> | 4 | #include <media/rc-core.h> |
5 | 5 | ||
6 | #define DEFAULT_POLLING_INTERVAL 100 /* ms */ | 6 | #define DEFAULT_POLLING_INTERVAL 100 /* ms */ |
7 | 7 | ||
@@ -9,11 +9,9 @@ struct IR_i2c; | |||
9 | 9 | ||
10 | struct IR_i2c { | 10 | struct IR_i2c { |
11 | char *ir_codes; | 11 | char *ir_codes; |
12 | |||
13 | struct i2c_client *c; | 12 | struct i2c_client *c; |
14 | struct input_dev *input; | 13 | struct rc_dev *rc; |
15 | struct ir_input_state ir; | 14 | |
16 | u64 ir_type; | ||
17 | /* Used to avoid fast repeating */ | 15 | /* Used to avoid fast repeating */ |
18 | unsigned char old; | 16 | unsigned char old; |
19 | 17 | ||
@@ -39,13 +37,16 @@ enum ir_kbd_get_key_fn { | |||
39 | struct IR_i2c_init_data { | 37 | struct IR_i2c_init_data { |
40 | char *ir_codes; | 38 | char *ir_codes; |
41 | const char *name; | 39 | const char *name; |
42 | u64 type; /* IR_TYPE_RC5, etc */ | 40 | u64 type; /* RC_TYPE_RC5, etc */ |
43 | u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */ | 41 | u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */ |
42 | |||
44 | /* | 43 | /* |
45 | * Specify either a function pointer or a value indicating one of | 44 | * Specify either a function pointer or a value indicating one of |
46 | * ir_kbd_i2c's internal get_key functions | 45 | * ir_kbd_i2c's internal get_key functions |
47 | */ | 46 | */ |
48 | int (*get_key)(struct IR_i2c*, u32*, u32*); | 47 | int (*get_key)(struct IR_i2c*, u32*, u32*); |
49 | enum ir_kbd_get_key_fn internal_get_key_func; | 48 | enum ir_kbd_get_key_fn internal_get_key_func; |
49 | |||
50 | struct rc_dev *rc_dev; | ||
50 | }; | 51 | }; |
51 | #endif | 52 | #endif |
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h index 54780a560d0e..630e702c9511 100644 --- a/include/media/lirc_dev.h +++ b/include/media/lirc_dev.h | |||
@@ -217,9 +217,9 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file); | |||
217 | int lirc_dev_fop_close(struct inode *inode, struct file *file); | 217 | int lirc_dev_fop_close(struct inode *inode, struct file *file); |
218 | unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait); | 218 | unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait); |
219 | long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | 219 | long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
220 | ssize_t lirc_dev_fop_read(struct file *file, char *buffer, size_t length, | 220 | ssize_t lirc_dev_fop_read(struct file *file, char __user *buffer, size_t length, |
221 | loff_t *ppos); | 221 | loff_t *ppos); |
222 | ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length, | 222 | ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer, |
223 | loff_t *ppos); | 223 | size_t length, loff_t *ppos); |
224 | 224 | ||
225 | #endif | 225 | #endif |
diff --git a/include/media/ovcamchip.h b/include/media/ovcamchip.h deleted file mode 100644 index 05b9569ef1c8..000000000000 --- a/include/media/ovcamchip.h +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | /* OmniVision* camera chip driver API | ||
2 | * | ||
3 | * Copyright (c) 1999-2004 Mark McClelland | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. NO WARRANTY OF ANY KIND is expressed or implied. | ||
9 | * | ||
10 | * * OmniVision is a trademark of OmniVision Technologies, Inc. This driver | ||
11 | * is not sponsored or developed by them. | ||
12 | */ | ||
13 | |||
14 | #ifndef __LINUX_OVCAMCHIP_H | ||
15 | #define __LINUX_OVCAMCHIP_H | ||
16 | |||
17 | #include <linux/videodev.h> | ||
18 | #include <media/v4l2-common.h> | ||
19 | |||
20 | /* --------------------------------- */ | ||
21 | /* ENUMERATIONS */ | ||
22 | /* --------------------------------- */ | ||
23 | |||
24 | /* Controls */ | ||
25 | enum { | ||
26 | OVCAMCHIP_CID_CONT, /* Contrast */ | ||
27 | OVCAMCHIP_CID_BRIGHT, /* Brightness */ | ||
28 | OVCAMCHIP_CID_SAT, /* Saturation */ | ||
29 | OVCAMCHIP_CID_HUE, /* Hue */ | ||
30 | OVCAMCHIP_CID_EXP, /* Exposure */ | ||
31 | OVCAMCHIP_CID_FREQ, /* Light frequency */ | ||
32 | OVCAMCHIP_CID_BANDFILT, /* Banding filter */ | ||
33 | OVCAMCHIP_CID_AUTOBRIGHT, /* Auto brightness */ | ||
34 | OVCAMCHIP_CID_AUTOEXP, /* Auto exposure */ | ||
35 | OVCAMCHIP_CID_BACKLIGHT, /* Back light compensation */ | ||
36 | OVCAMCHIP_CID_MIRROR, /* Mirror horizontally */ | ||
37 | }; | ||
38 | |||
39 | /* Chip types */ | ||
40 | #define NUM_CC_TYPES 9 | ||
41 | enum { | ||
42 | CC_UNKNOWN, | ||
43 | CC_OV76BE, | ||
44 | CC_OV7610, | ||
45 | CC_OV7620, | ||
46 | CC_OV7620AE, | ||
47 | CC_OV6620, | ||
48 | CC_OV6630, | ||
49 | CC_OV6630AE, | ||
50 | CC_OV6630AF, | ||
51 | }; | ||
52 | |||
53 | /* --------------------------------- */ | ||
54 | /* I2C ADDRESSES */ | ||
55 | /* --------------------------------- */ | ||
56 | |||
57 | #define OV7xx0_SID (0x42 >> 1) | ||
58 | #define OV6xx0_SID (0xC0 >> 1) | ||
59 | |||
60 | /* --------------------------------- */ | ||
61 | /* API */ | ||
62 | /* --------------------------------- */ | ||
63 | |||
64 | struct ovcamchip_control { | ||
65 | __u32 id; | ||
66 | __s32 value; | ||
67 | }; | ||
68 | |||
69 | struct ovcamchip_window { | ||
70 | int x; | ||
71 | int y; | ||
72 | int width; | ||
73 | int height; | ||
74 | int format; | ||
75 | int quarter; /* Scale width and height down 2x */ | ||
76 | |||
77 | /* This stuff will be removed eventually */ | ||
78 | int clockdiv; /* Clock divisor setting */ | ||
79 | }; | ||
80 | |||
81 | /* Commands */ | ||
82 | #define OVCAMCHIP_CMD_Q_SUBTYPE _IOR (0x88, 0x00, int) | ||
83 | #define OVCAMCHIP_CMD_INITIALIZE _IOW (0x88, 0x01, int) | ||
84 | /* You must call OVCAMCHIP_CMD_INITIALIZE before any of commands below! */ | ||
85 | #define OVCAMCHIP_CMD_S_CTRL _IOW (0x88, 0x02, struct ovcamchip_control) | ||
86 | #define OVCAMCHIP_CMD_G_CTRL _IOWR (0x88, 0x03, struct ovcamchip_control) | ||
87 | #define OVCAMCHIP_CMD_S_MODE _IOW (0x88, 0x04, struct ovcamchip_window) | ||
88 | #define OVCAMCHIP_MAX_CMD _IO (0x88, 0x3f) | ||
89 | |||
90 | #endif | ||
diff --git a/include/media/rc-core.h b/include/media/rc-core.h new file mode 100644 index 000000000000..a23c1fc685a1 --- /dev/null +++ b/include/media/rc-core.h | |||
@@ -0,0 +1,220 @@ | |||
1 | /* | ||
2 | * Remote Controller core header | ||
3 | * | ||
4 | * Copyright (C) 2009-2010 by Mauro Carvalho Chehab <mchehab@redhat.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation version 2 of the License. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef _RC_CORE | ||
17 | #define _RC_CORE | ||
18 | |||
19 | #include <linux/spinlock.h> | ||
20 | #include <linux/kfifo.h> | ||
21 | #include <linux/time.h> | ||
22 | #include <linux/timer.h> | ||
23 | #include <media/rc-map.h> | ||
24 | |||
25 | extern int rc_core_debug; | ||
26 | #define IR_dprintk(level, fmt, arg...) if (rc_core_debug >= level) \ | ||
27 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | ||
28 | |||
29 | enum rc_driver_type { | ||
30 | RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */ | ||
31 | RC_DRIVER_IR_RAW, /* Needs a Infra-Red pulse/space decoder */ | ||
32 | }; | ||
33 | |||
34 | /** | ||
35 | * struct rc_dev - represents a remote control device | ||
36 | * @dev: driver model's view of this device | ||
37 | * @input_name: name of the input child device | ||
38 | * @input_phys: physical path to the input child device | ||
39 | * @input_id: id of the input child device (struct input_id) | ||
40 | * @driver_name: name of the hardware driver which registered this device | ||
41 | * @map_name: name of the default keymap | ||
42 | * @rc_map: current scan/key table | ||
43 | * @devno: unique remote control device number | ||
44 | * @raw: additional data for raw pulse/space devices | ||
45 | * @input_dev: the input child device used to communicate events to userspace | ||
46 | * @driver_type: specifies if protocol decoding is done in hardware or software | ||
47 | * @idle: used to keep track of RX state | ||
48 | * @allowed_protos: bitmask with the supported RC_TYPE_* protocols | ||
49 | * @scanmask: some hardware decoders are not capable of providing the full | ||
50 | * scancode to the application. As this is a hardware limit, we can't do | ||
51 | * anything with it. Yet, as the same keycode table can be used with other | ||
52 | * devices, a mask is provided to allow its usage. Drivers should generally | ||
53 | * leave this field in blank | ||
54 | * @priv: driver-specific data | ||
55 | * @keylock: protects the remaining members of the struct | ||
56 | * @keypressed: whether a key is currently pressed | ||
57 | * @keyup_jiffies: time (in jiffies) when the current keypress should be released | ||
58 | * @timer_keyup: timer for releasing a keypress | ||
59 | * @last_keycode: keycode of last keypress | ||
60 | * @last_scancode: scancode of last keypress | ||
61 | * @last_toggle: toggle value of last command | ||
62 | * @timeout: optional time after which device stops sending data | ||
63 | * @min_timeout: minimum timeout supported by device | ||
64 | * @max_timeout: maximum timeout supported by device | ||
65 | * @rx_resolution : resolution (in ns) of input sampler | ||
66 | * @tx_resolution: resolution (in ns) of output sampler | ||
67 | * @change_protocol: allow changing the protocol used on hardware decoders | ||
68 | * @open: callback to allow drivers to enable polling/irq when IR input device | ||
69 | * is opened. | ||
70 | * @close: callback to allow drivers to disable polling/irq when IR input device | ||
71 | * is opened. | ||
72 | * @s_tx_mask: set transmitter mask (for devices with multiple tx outputs) | ||
73 | * @s_tx_carrier: set transmit carrier frequency | ||
74 | * @s_tx_duty_cycle: set transmit duty cycle (0% - 100%) | ||
75 | * @s_rx_carrier: inform driver about carrier it is expected to handle | ||
76 | * @tx_ir: transmit IR | ||
77 | * @s_idle: enable/disable hardware idle mode, upon which, | ||
78 | * device doesn't interrupt host until it sees IR pulses | ||
79 | * @s_learning_mode: enable wide band receiver used for learning | ||
80 | * @s_carrier_report: enable carrier reports | ||
81 | */ | ||
82 | struct rc_dev { | ||
83 | struct device dev; | ||
84 | const char *input_name; | ||
85 | const char *input_phys; | ||
86 | struct input_id input_id; | ||
87 | char *driver_name; | ||
88 | const char *map_name; | ||
89 | struct rc_map rc_map; | ||
90 | unsigned long devno; | ||
91 | struct ir_raw_event_ctrl *raw; | ||
92 | struct input_dev *input_dev; | ||
93 | enum rc_driver_type driver_type; | ||
94 | bool idle; | ||
95 | u64 allowed_protos; | ||
96 | u32 scanmask; | ||
97 | void *priv; | ||
98 | spinlock_t keylock; | ||
99 | bool keypressed; | ||
100 | unsigned long keyup_jiffies; | ||
101 | struct timer_list timer_keyup; | ||
102 | u32 last_keycode; | ||
103 | u32 last_scancode; | ||
104 | u8 last_toggle; | ||
105 | u32 timeout; | ||
106 | u32 min_timeout; | ||
107 | u32 max_timeout; | ||
108 | u32 rx_resolution; | ||
109 | u32 tx_resolution; | ||
110 | int (*change_protocol)(struct rc_dev *dev, u64 rc_type); | ||
111 | int (*open)(struct rc_dev *dev); | ||
112 | void (*close)(struct rc_dev *dev); | ||
113 | int (*s_tx_mask)(struct rc_dev *dev, u32 mask); | ||
114 | int (*s_tx_carrier)(struct rc_dev *dev, u32 carrier); | ||
115 | int (*s_tx_duty_cycle)(struct rc_dev *dev, u32 duty_cycle); | ||
116 | int (*s_rx_carrier_range)(struct rc_dev *dev, u32 min, u32 max); | ||
117 | int (*tx_ir)(struct rc_dev *dev, int *txbuf, u32 n); | ||
118 | void (*s_idle)(struct rc_dev *dev, bool enable); | ||
119 | int (*s_learning_mode)(struct rc_dev *dev, int enable); | ||
120 | int (*s_carrier_report) (struct rc_dev *dev, int enable); | ||
121 | }; | ||
122 | |||
123 | #define to_rc_dev(d) container_of(d, struct rc_dev, dev) | ||
124 | |||
125 | /* | ||
126 | * From rc-main.c | ||
127 | * Those functions can be used on any type of Remote Controller. They | ||
128 | * basically creates an input_dev and properly reports the device as a | ||
129 | * Remote Controller, at sys/class/rc. | ||
130 | */ | ||
131 | |||
132 | struct rc_dev *rc_allocate_device(void); | ||
133 | void rc_free_device(struct rc_dev *dev); | ||
134 | int rc_register_device(struct rc_dev *dev); | ||
135 | void rc_unregister_device(struct rc_dev *dev); | ||
136 | |||
137 | void rc_repeat(struct rc_dev *dev); | ||
138 | void rc_keydown(struct rc_dev *dev, int scancode, u8 toggle); | ||
139 | void rc_keydown_notimeout(struct rc_dev *dev, int scancode, u8 toggle); | ||
140 | void rc_keyup(struct rc_dev *dev); | ||
141 | u32 rc_g_keycode_from_table(struct rc_dev *dev, u32 scancode); | ||
142 | |||
143 | /* | ||
144 | * From rc-raw.c | ||
145 | * The Raw interface is specific to InfraRed. It may be a good idea to | ||
146 | * split it later into a separate header. | ||
147 | */ | ||
148 | |||
149 | enum raw_event_type { | ||
150 | IR_SPACE = (1 << 0), | ||
151 | IR_PULSE = (1 << 1), | ||
152 | IR_START_EVENT = (1 << 2), | ||
153 | IR_STOP_EVENT = (1 << 3), | ||
154 | }; | ||
155 | |||
156 | struct ir_raw_event { | ||
157 | union { | ||
158 | u32 duration; | ||
159 | |||
160 | struct { | ||
161 | u32 carrier; | ||
162 | u8 duty_cycle; | ||
163 | }; | ||
164 | }; | ||
165 | |||
166 | unsigned pulse:1; | ||
167 | unsigned reset:1; | ||
168 | unsigned timeout:1; | ||
169 | unsigned carrier_report:1; | ||
170 | }; | ||
171 | |||
172 | #define DEFINE_IR_RAW_EVENT(event) \ | ||
173 | struct ir_raw_event event = { \ | ||
174 | { .duration = 0 } , \ | ||
175 | .pulse = 0, \ | ||
176 | .reset = 0, \ | ||
177 | .timeout = 0, \ | ||
178 | .carrier_report = 0 } | ||
179 | |||
180 | static inline void init_ir_raw_event(struct ir_raw_event *ev) | ||
181 | { | ||
182 | memset(ev, 0, sizeof(*ev)); | ||
183 | } | ||
184 | |||
185 | #define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */ | ||
186 | |||
187 | void ir_raw_event_handle(struct rc_dev *dev); | ||
188 | int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev); | ||
189 | int ir_raw_event_store_edge(struct rc_dev *dev, enum raw_event_type type); | ||
190 | int ir_raw_event_store_with_filter(struct rc_dev *dev, | ||
191 | struct ir_raw_event *ev); | ||
192 | void ir_raw_event_set_idle(struct rc_dev *dev, bool idle); | ||
193 | |||
194 | static inline void ir_raw_event_reset(struct rc_dev *dev) | ||
195 | { | ||
196 | DEFINE_IR_RAW_EVENT(ev); | ||
197 | ev.reset = true; | ||
198 | |||
199 | ir_raw_event_store(dev, &ev); | ||
200 | ir_raw_event_handle(dev); | ||
201 | } | ||
202 | |||
203 | /* extract mask bits out of data and pack them into the result */ | ||
204 | static inline u32 ir_extract_bits(u32 data, u32 mask) | ||
205 | { | ||
206 | u32 vbit = 1, value = 0; | ||
207 | |||
208 | do { | ||
209 | if (mask & 1) { | ||
210 | if (data & 1) | ||
211 | value |= vbit; | ||
212 | vbit <<= 1; | ||
213 | } | ||
214 | data >>= 1; | ||
215 | } while (mask >>= 1); | ||
216 | |||
217 | return value; | ||
218 | } | ||
219 | |||
220 | #endif /* _RC_CORE */ | ||
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index e0f17edf38ed..ee9e2f747c76 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
@@ -11,45 +11,45 @@ | |||
11 | 11 | ||
12 | #include <linux/input.h> | 12 | #include <linux/input.h> |
13 | 13 | ||
14 | #define IR_TYPE_UNKNOWN 0 | 14 | #define RC_TYPE_UNKNOWN 0 |
15 | #define IR_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */ | 15 | #define RC_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */ |
16 | #define IR_TYPE_NEC (1 << 1) | 16 | #define RC_TYPE_NEC (1 << 1) |
17 | #define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ | 17 | #define RC_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ |
18 | #define IR_TYPE_JVC (1 << 3) /* JVC protocol */ | 18 | #define RC_TYPE_JVC (1 << 3) /* JVC protocol */ |
19 | #define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ | 19 | #define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ |
20 | #define IR_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ | 20 | #define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ |
21 | #define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ | 21 | #define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ |
22 | #define IR_TYPE_OTHER (1u << 31) | 22 | #define RC_TYPE_OTHER (1u << 31) |
23 | 23 | ||
24 | #define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \ | 24 | #define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \ |
25 | IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \ | 25 | RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \ |
26 | IR_TYPE_RC5_SZ | IR_TYPE_OTHER) | 26 | RC_TYPE_RC5_SZ | RC_TYPE_OTHER) |
27 | 27 | ||
28 | struct ir_scancode { | 28 | struct rc_map_table { |
29 | u32 scancode; | 29 | u32 scancode; |
30 | u32 keycode; | 30 | u32 keycode; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | struct ir_scancode_table { | 33 | struct rc_map { |
34 | struct ir_scancode *scan; | 34 | struct rc_map_table *scan; |
35 | unsigned int size; /* Max number of entries */ | 35 | unsigned int size; /* Max number of entries */ |
36 | unsigned int len; /* Used number of entries */ | 36 | unsigned int len; /* Used number of entries */ |
37 | unsigned int alloc; /* Size of *scan in bytes */ | 37 | unsigned int alloc; /* Size of *scan in bytes */ |
38 | u64 ir_type; | 38 | u64 rc_type; |
39 | const char *name; | 39 | const char *name; |
40 | spinlock_t lock; | 40 | spinlock_t lock; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | struct rc_keymap { | 43 | struct rc_map_list { |
44 | struct list_head list; | 44 | struct list_head list; |
45 | struct ir_scancode_table map; | 45 | struct rc_map map; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | /* Routines from rc-map.c */ | 48 | /* Routines from rc-map.c */ |
49 | 49 | ||
50 | int ir_register_map(struct rc_keymap *map); | 50 | int rc_map_register(struct rc_map_list *map); |
51 | void ir_unregister_map(struct rc_keymap *map); | 51 | void rc_map_unregister(struct rc_map_list *map); |
52 | struct ir_scancode_table *get_rc_map(const char *name); | 52 | struct rc_map *rc_map_get(const char *name); |
53 | void rc_map_init(void); | 53 | void rc_map_init(void); |
54 | 54 | ||
55 | /* Names of the several keytables defined in-kernel */ | 55 | /* Names of the several keytables defined in-kernel */ |
@@ -119,6 +119,7 @@ void rc_map_init(void); | |||
119 | #define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd" | 119 | #define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd" |
120 | #define RC_MAP_PIXELVIEW_NEW "rc-pixelview-new" | 120 | #define RC_MAP_PIXELVIEW_NEW "rc-pixelview-new" |
121 | #define RC_MAP_PIXELVIEW "rc-pixelview" | 121 | #define RC_MAP_PIXELVIEW "rc-pixelview" |
122 | #define RC_MAP_PIXELVIEW_002T "rc-pixelview-002t" | ||
122 | #define RC_MAP_PIXELVIEW_MK12 "rc-pixelview-mk12" | 123 | #define RC_MAP_PIXELVIEW_MK12 "rc-pixelview-mk12" |
123 | #define RC_MAP_POWERCOLOR_REAL_ANGEL "rc-powercolor-real-angel" | 124 | #define RC_MAP_POWERCOLOR_REAL_ANGEL "rc-powercolor-real-angel" |
124 | #define RC_MAP_PROTEUS_2309 "rc-proteus-2309" | 125 | #define RC_MAP_PROTEUS_2309 "rc-proteus-2309" |
@@ -137,6 +138,7 @@ void rc_map_init(void); | |||
137 | #define RC_MAP_TREKSTOR "rc-trekstor" | 138 | #define RC_MAP_TREKSTOR "rc-trekstor" |
138 | #define RC_MAP_TT_1500 "rc-tt-1500" | 139 | #define RC_MAP_TT_1500 "rc-tt-1500" |
139 | #define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027" | 140 | #define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027" |
141 | #define RC_MAP_VIDEOMATE_M1F "rc-videomate-m1f" | ||
140 | #define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" | 142 | #define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" |
141 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" | 143 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" |
142 | #define RC_MAP_WINFAST "rc-winfast" | 144 | #define RC_MAP_WINFAST "rc-winfast" |
diff --git a/include/media/rds.h b/include/media/saa6588.h index a89426667618..2c3c4420a4eb 100644 --- a/include/media/rds.h +++ b/include/media/saa6588.h | |||
@@ -4,9 +4,6 @@ | |||
4 | saa6588.c and every driver (e.g. bttv-driver.c) that wants | 4 | saa6588.c and every driver (e.g. bttv-driver.c) that wants |
5 | to use the saa6588 module. | 5 | to use the saa6588 module. |
6 | 6 | ||
7 | Instead of having a separate rds.h, I'd prefer to include | ||
8 | this stuff in one of the already existing files like tuner.h | ||
9 | |||
10 | (c) 2005 by Hans J. Koch | 7 | (c) 2005 by Hans J. Koch |
11 | 8 | ||
12 | This program is free software; you can redistribute it and/or modify | 9 | This program is free software; you can redistribute it and/or modify |
@@ -25,10 +22,10 @@ | |||
25 | 22 | ||
26 | */ | 23 | */ |
27 | 24 | ||
28 | #ifndef _RDS_H | 25 | #ifndef _SAA6588_H |
29 | #define _RDS_H | 26 | #define _SAA6588_H |
30 | 27 | ||
31 | struct rds_command { | 28 | struct saa6588_command { |
32 | unsigned int block_count; | 29 | unsigned int block_count; |
33 | int result; | 30 | int result; |
34 | unsigned char __user *buffer; | 31 | unsigned char __user *buffer; |
@@ -36,9 +33,10 @@ struct rds_command { | |||
36 | poll_table *event_list; | 33 | poll_table *event_list; |
37 | }; | 34 | }; |
38 | 35 | ||
39 | #define RDS_CMD_OPEN _IOW('R',1,int) | 36 | /* These ioctls are internal to the kernel */ |
40 | #define RDS_CMD_CLOSE _IOW('R',2,int) | 37 | #define SAA6588_CMD_OPEN _IOW('R', 1, int) |
41 | #define RDS_CMD_READ _IOR('R',3,int) | 38 | #define SAA6588_CMD_CLOSE _IOW('R', 2, int) |
42 | #define RDS_CMD_POLL _IOR('R',4,int) | 39 | #define SAA6588_CMD_READ _IOR('R', 3, int) |
40 | #define SAA6588_CMD_POLL _IOR('R', 4, int) | ||
43 | 41 | ||
44 | #endif | 42 | #endif |
diff --git a/include/media/saa7146.h b/include/media/saa7146.h index 7a9f76ecbbbd..ac7ce00f39cf 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h | |||
@@ -161,7 +161,7 @@ extern struct list_head saa7146_devices; | |||
161 | extern struct mutex saa7146_devices_lock; | 161 | extern struct mutex saa7146_devices_lock; |
162 | int saa7146_register_extension(struct saa7146_extension*); | 162 | int saa7146_register_extension(struct saa7146_extension*); |
163 | int saa7146_unregister_extension(struct saa7146_extension*); | 163 | int saa7146_unregister_extension(struct saa7146_extension*); |
164 | struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc); | 164 | struct saa7146_format* saa7146_format_by_fourcc(struct saa7146_dev *dev, int fourcc); |
165 | int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt); | 165 | int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt); |
166 | void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt); | 166 | void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt); |
167 | int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, struct scatterlist *list, int length ); | 167 | int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, struct scatterlist *list, int length ); |
diff --git a/include/media/si4713.h b/include/media/si4713.h index 99850a54ed09..ed7353e8a982 100644 --- a/include/media/si4713.h +++ b/include/media/si4713.h | |||
@@ -23,8 +23,7 @@ | |||
23 | * Platform dependent definition | 23 | * Platform dependent definition |
24 | */ | 24 | */ |
25 | struct si4713_platform_data { | 25 | struct si4713_platform_data { |
26 | /* Set power state, zero is off, non-zero is on. */ | 26 | int gpio_reset; /* < 0 if not used */ |
27 | int (*set_power)(int power); | ||
28 | }; | 27 | }; |
29 | 28 | ||
30 | /* | 29 | /* |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 86e3631764ef..9386db829fb7 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -97,6 +97,7 @@ struct soc_camera_host_ops { | |||
97 | #define SOCAM_SENSOR_INVERT_DATA (1 << 4) | 97 | #define SOCAM_SENSOR_INVERT_DATA (1 << 4) |
98 | 98 | ||
99 | struct i2c_board_info; | 99 | struct i2c_board_info; |
100 | struct regulator_bulk_data; | ||
100 | 101 | ||
101 | struct soc_camera_link { | 102 | struct soc_camera_link { |
102 | /* Camera bus id, used to match a camera and a bus */ | 103 | /* Camera bus id, used to match a camera and a bus */ |
@@ -108,6 +109,10 @@ struct soc_camera_link { | |||
108 | const char *module_name; | 109 | const char *module_name; |
109 | void *priv; | 110 | void *priv; |
110 | 111 | ||
112 | /* Optional regulators that have to be managed on power on/off events */ | ||
113 | struct regulator_bulk_data *regulators; | ||
114 | int num_regulators; | ||
115 | |||
111 | /* | 116 | /* |
112 | * For non-I2C devices platform platform has to provide methods to | 117 | * For non-I2C devices platform platform has to provide methods to |
113 | * add a device to the system and to remove | 118 | * add a device to the system and to remove |
diff --git a/include/media/timb_radio.h b/include/media/timb_radio.h index fcd32a3696ba..a59a84854dc1 100644 --- a/include/media/timb_radio.h +++ b/include/media/timb_radio.h | |||
@@ -24,7 +24,6 @@ | |||
24 | struct timb_radio_platform_data { | 24 | struct timb_radio_platform_data { |
25 | int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */ | 25 | int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */ |
26 | struct { | 26 | struct { |
27 | const char *module_name; | ||
28 | struct i2c_board_info *info; | 27 | struct i2c_board_info *info; |
29 | } tuner; | 28 | } tuner; |
30 | struct { | 29 | struct { |
diff --git a/include/media/timb_video.h b/include/media/timb_video.h new file mode 100644 index 000000000000..70ae43970a49 --- /dev/null +++ b/include/media/timb_video.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * timb_video.h Platform struct for the Timberdale video driver | ||
3 | * Copyright (c) 2009-2010 Intel Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef _TIMB_VIDEO_ | ||
20 | #define _TIMB_VIDEO_ 1 | ||
21 | |||
22 | #include <linux/i2c.h> | ||
23 | |||
24 | struct timb_video_platform_data { | ||
25 | int dma_channel; | ||
26 | int i2c_adapter; /* The I2C adapter where the encoder is attached */ | ||
27 | struct { | ||
28 | const char *module_name; | ||
29 | struct i2c_board_info *info; | ||
30 | } encoder; | ||
31 | }; | ||
32 | |||
33 | #endif | ||
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 51e89f2267b8..44fe44ec9ea7 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
@@ -74,6 +74,7 @@ enum { | |||
74 | V4L2_IDENT_SOI968 = 256, | 74 | V4L2_IDENT_SOI968 = 256, |
75 | V4L2_IDENT_OV9640 = 257, | 75 | V4L2_IDENT_OV9640 = 257, |
76 | V4L2_IDENT_OV6650 = 258, | 76 | V4L2_IDENT_OV6650 = 258, |
77 | V4L2_IDENT_OV2640 = 259, | ||
77 | 78 | ||
78 | /* module saa7146: reserved range 300-309 */ | 79 | /* module saa7146: reserved range 300-309 */ |
79 | V4L2_IDENT_SAA7146 = 300, | 80 | V4L2_IDENT_SAA7146 = 300, |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 41dd480e45f1..2d65b35cdab2 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -98,12 +98,12 @@ int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local); | |||
98 | /* Control helper functions */ | 98 | /* Control helper functions */ |
99 | 99 | ||
100 | int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, | 100 | int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, |
101 | const char **menu_items); | 101 | const char * const *menu_items); |
102 | const char *v4l2_ctrl_get_name(u32 id); | 102 | const char *v4l2_ctrl_get_name(u32 id); |
103 | const char **v4l2_ctrl_get_menu(u32 id); | 103 | const char * const *v4l2_ctrl_get_menu(u32 id); |
104 | int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); | 104 | int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); |
105 | int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, | 105 | int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, |
106 | struct v4l2_queryctrl *qctrl, const char **menu_items); | 106 | struct v4l2_queryctrl *qctrl, const char * const *menu_items); |
107 | #define V4L2_CTRL_MENU_IDS_END (0xffffffff) | 107 | #define V4L2_CTRL_MENU_IDS_END (0xffffffff) |
108 | int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *ids); | 108 | int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *ids); |
109 | 109 | ||
@@ -137,31 +137,27 @@ struct v4l2_subdev_ops; | |||
137 | 137 | ||
138 | 138 | ||
139 | /* Load an i2c module and return an initialized v4l2_subdev struct. | 139 | /* Load an i2c module and return an initialized v4l2_subdev struct. |
140 | Only call request_module if module_name != NULL. | ||
141 | The client_type argument is the name of the chip that's on the adapter. */ | 140 | The client_type argument is the name of the chip that's on the adapter. */ |
142 | struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev, | 141 | struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev, |
143 | struct i2c_adapter *adapter, | 142 | struct i2c_adapter *adapter, const char *client_type, |
144 | const char *module_name, const char *client_type, | ||
145 | int irq, void *platform_data, | 143 | int irq, void *platform_data, |
146 | u8 addr, const unsigned short *probe_addrs); | 144 | u8 addr, const unsigned short *probe_addrs); |
147 | 145 | ||
148 | /* Load an i2c module and return an initialized v4l2_subdev struct. | 146 | /* Load an i2c module and return an initialized v4l2_subdev struct. |
149 | Only call request_module if module_name != NULL. | ||
150 | The client_type argument is the name of the chip that's on the adapter. */ | 147 | The client_type argument is the name of the chip that's on the adapter. */ |
151 | static inline struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, | 148 | static inline struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, |
152 | struct i2c_adapter *adapter, | 149 | struct i2c_adapter *adapter, const char *client_type, |
153 | const char *module_name, const char *client_type, | ||
154 | u8 addr, const unsigned short *probe_addrs) | 150 | u8 addr, const unsigned short *probe_addrs) |
155 | { | 151 | { |
156 | return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, module_name, | 152 | return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, client_type, 0, NULL, |
157 | client_type, 0, NULL, addr, probe_addrs); | 153 | addr, probe_addrs); |
158 | } | 154 | } |
159 | 155 | ||
160 | struct i2c_board_info; | 156 | struct i2c_board_info; |
161 | 157 | ||
162 | struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, | 158 | struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, |
163 | struct i2c_adapter *adapter, const char *module_name, | 159 | struct i2c_adapter *adapter, struct i2c_board_info *info, |
164 | struct i2c_board_info *info, const unsigned short *probe_addrs); | 160 | const unsigned short *probe_addrs); |
165 | 161 | ||
166 | /* Initialize an v4l2_subdev with data from an i2c_client struct */ | 162 | /* Initialize an v4l2_subdev with data from an i2c_client struct */ |
167 | void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, | 163 | void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, |
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 9b7bea928a88..d69ab4aae032 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
@@ -112,7 +112,7 @@ struct v4l2_ctrl { | |||
112 | u32 step; | 112 | u32 step; |
113 | u32 menu_skip_mask; | 113 | u32 menu_skip_mask; |
114 | }; | 114 | }; |
115 | const char **qmenu; | 115 | const char * const *qmenu; |
116 | unsigned long flags; | 116 | unsigned long flags; |
117 | union { | 117 | union { |
118 | s32 val; | 118 | s32 val; |
@@ -202,7 +202,7 @@ struct v4l2_ctrl_config { | |||
202 | s32 def; | 202 | s32 def; |
203 | u32 flags; | 203 | u32 flags; |
204 | u32 menu_skip_mask; | 204 | u32 menu_skip_mask; |
205 | const char **qmenu; | 205 | const char * const *qmenu; |
206 | unsigned int is_private:1; | 206 | unsigned int is_private:1; |
207 | unsigned int is_volatile:1; | 207 | unsigned int is_volatile:1; |
208 | }; | 208 | }; |
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h index 6648036b728d..b16f307d471a 100644 --- a/include/media/v4l2-device.h +++ b/include/media/v4l2-device.h | |||
@@ -51,6 +51,8 @@ struct v4l2_device { | |||
51 | unsigned int notification, void *arg); | 51 | unsigned int notification, void *arg); |
52 | /* The control handler. May be NULL. */ | 52 | /* The control handler. May be NULL. */ |
53 | struct v4l2_ctrl_handler *ctrl_handler; | 53 | struct v4l2_ctrl_handler *ctrl_handler; |
54 | /* BKL replacement mutex. Temporary solution only. */ | ||
55 | struct mutex ioctl_lock; | ||
54 | }; | 56 | }; |
55 | 57 | ||
56 | /* Initialize v4l2_dev and make dev->driver_data point to v4l2_dev. | 58 | /* Initialize v4l2_dev and make dev->driver_data point to v4l2_dev. |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 06daa6e8e051..67df37542c68 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
@@ -14,12 +14,7 @@ | |||
14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
15 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
16 | #include <linux/compiler.h> /* need __user */ | 16 | #include <linux/compiler.h> /* need __user */ |
17 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
18 | #define __MIN_V4L1 | ||
19 | #include <linux/videodev.h> | ||
20 | #else | ||
21 | #include <linux/videodev2.h> | 17 | #include <linux/videodev2.h> |
22 | #endif | ||
23 | 18 | ||
24 | struct v4l2_fh; | 19 | struct v4l2_fh; |
25 | 20 | ||
@@ -113,10 +108,6 @@ struct v4l2_ioctl_ops { | |||
113 | 108 | ||
114 | 109 | ||
115 | int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); | 110 | int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); |
116 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
117 | /* buffer type is struct vidio_mbuf * */ | ||
118 | int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p); | ||
119 | #endif | ||
120 | int (*vidioc_g_fbuf) (struct file *file, void *fh, | 111 | int (*vidioc_g_fbuf) (struct file *file, void *fh, |
121 | struct v4l2_framebuffer *a); | 112 | struct v4l2_framebuffer *a); |
122 | int (*vidioc_s_fbuf) (struct file *file, void *fh, | 113 | int (*vidioc_s_fbuf) (struct file *file, void *fh, |
@@ -300,22 +291,15 @@ extern void v4l_printk_ioctl(unsigned int cmd); | |||
300 | extern const char *v4l2_field_names[]; | 291 | extern const char *v4l2_field_names[]; |
301 | extern const char *v4l2_type_names[]; | 292 | extern const char *v4l2_type_names[]; |
302 | 293 | ||
303 | /* Compatibility layer interface -- v4l1-compat module */ | ||
304 | typedef long (*v4l2_kioctl)(struct file *file, | ||
305 | unsigned int cmd, void *arg); | ||
306 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
307 | long v4l_compat_translate_ioctl(struct file *file, | ||
308 | int cmd, void *arg, v4l2_kioctl driver_ioctl); | ||
309 | #else | ||
310 | #define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL) | ||
311 | #endif | ||
312 | |||
313 | #ifdef CONFIG_COMPAT | 294 | #ifdef CONFIG_COMPAT |
314 | /* 32 Bits compatibility layer for 64 bits processors */ | 295 | /* 32 Bits compatibility layer for 64 bits processors */ |
315 | extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, | 296 | extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, |
316 | unsigned long arg); | 297 | unsigned long arg); |
317 | #endif | 298 | #endif |
318 | 299 | ||
300 | typedef long (*v4l2_kioctl)(struct file *file, | ||
301 | unsigned int cmd, void *arg); | ||
302 | |||
319 | /* Include support for obsoleted stuff */ | 303 | /* Include support for obsoleted stuff */ |
320 | extern long video_usercopy(struct file *file, unsigned int cmd, | 304 | extern long video_usercopy(struct file *file, unsigned int cmd, |
321 | unsigned long arg, v4l2_kioctl func); | 305 | unsigned long arg, v4l2_kioctl func); |
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h index 1d3835fc26be..90ed895e217d 100644 --- a/include/media/videobuf-core.h +++ b/include/media/videobuf-core.h | |||
@@ -17,10 +17,6 @@ | |||
17 | #define _VIDEOBUF_CORE_H | 17 | #define _VIDEOBUF_CORE_H |
18 | 18 | ||
19 | #include <linux/poll.h> | 19 | #include <linux/poll.h> |
20 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
21 | #define __MIN_V4L1 | ||
22 | #include <linux/videodev.h> | ||
23 | #endif | ||
24 | #include <linux/videodev2.h> | 20 | #include <linux/videodev2.h> |
25 | 21 | ||
26 | #define UNSET (-1U) | 22 | #define UNSET (-1U) |
@@ -212,10 +208,6 @@ int videobuf_qbuf(struct videobuf_queue *q, | |||
212 | struct v4l2_buffer *b); | 208 | struct v4l2_buffer *b); |
213 | int videobuf_dqbuf(struct videobuf_queue *q, | 209 | int videobuf_dqbuf(struct videobuf_queue *q, |
214 | struct v4l2_buffer *b, int nonblocking); | 210 | struct v4l2_buffer *b, int nonblocking); |
215 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
216 | int videobuf_cgmbuf(struct videobuf_queue *q, | ||
217 | struct video_mbuf *mbuf, int count); | ||
218 | #endif | ||
219 | int videobuf_streamon(struct videobuf_queue *q); | 211 | int videobuf_streamon(struct videobuf_queue *q); |
220 | int videobuf_streamoff(struct videobuf_queue *q); | 212 | int videobuf_streamoff(struct videobuf_queue *q); |
221 | 213 | ||
diff --git a/include/media/wm8775.h b/include/media/wm8775.h index a1c4d417dfa2..60739c5a23ae 100644 --- a/include/media/wm8775.h +++ b/include/media/wm8775.h | |||
@@ -32,7 +32,4 @@ | |||
32 | #define WM8775_AIN3 4 | 32 | #define WM8775_AIN3 4 |
33 | #define WM8775_AIN4 8 | 33 | #define WM8775_AIN4 8 |
34 | 34 | ||
35 | /* subdev group ID */ | ||
36 | #define WM8775_GID (1 << 0) | ||
37 | |||
38 | #endif | 35 | #endif |
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index a9441249306c..23710aa6a181 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _ADDRCONF_H | 1 | #ifndef _ADDRCONF_H |
2 | #define _ADDRCONF_H | 2 | #define _ADDRCONF_H |
3 | 3 | ||
4 | #define RETRANS_TIMER HZ | ||
5 | |||
6 | #define MAX_RTR_SOLICITATIONS 3 | 4 | #define MAX_RTR_SOLICITATIONS 3 |
7 | #define RTR_SOLICITATION_INTERVAL (4*HZ) | 5 | #define RTR_SOLICITATION_INTERVAL (4*HZ) |
8 | 6 | ||
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 90c9e2872f27..18e5c3f67580 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -10,6 +10,7 @@ extern void unix_inflight(struct file *fp); | |||
10 | extern void unix_notinflight(struct file *fp); | 10 | extern void unix_notinflight(struct file *fp); |
11 | extern void unix_gc(void); | 11 | extern void unix_gc(void); |
12 | extern void wait_for_unix_gc(void); | 12 | extern void wait_for_unix_gc(void); |
13 | extern struct sock *unix_get_socket(struct file *filp); | ||
13 | 14 | ||
14 | #define UNIX_HASH_SIZE 256 | 15 | #define UNIX_HASH_SIZE 256 |
15 | 16 | ||
@@ -56,6 +57,7 @@ struct unix_sock { | |||
56 | spinlock_t lock; | 57 | spinlock_t lock; |
57 | unsigned int gc_candidate : 1; | 58 | unsigned int gc_candidate : 1; |
58 | unsigned int gc_maybe_cycle : 1; | 59 | unsigned int gc_maybe_cycle : 1; |
60 | unsigned char recursion_level; | ||
59 | struct socket_wq peer_wq; | 61 | struct socket_wq peer_wq; |
60 | }; | 62 | }; |
61 | #define unix_sk(__sk) ((struct unix_sock *)__sk) | 63 | #define unix_sk(__sk) ((struct unix_sock *)__sk) |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index d81ea7997701..0c5e72503b77 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -144,6 +144,7 @@ struct bt_skb_cb { | |||
144 | __u8 tx_seq; | 144 | __u8 tx_seq; |
145 | __u8 retries; | 145 | __u8 retries; |
146 | __u8 sar; | 146 | __u8 sar; |
147 | unsigned short channel; | ||
147 | }; | 148 | }; |
148 | #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) | 149 | #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) |
149 | 150 | ||
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index e30e00834340..29a7a8ca0438 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
4 | 4 | ||
@@ -12,13 +12,13 @@ | |||
12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
19 | 19 | ||
20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
22 | SOFTWARE IS DISCLAIMED. | 22 | SOFTWARE IS DISCLAIMED. |
23 | */ | 23 | */ |
24 | 24 | ||
@@ -489,7 +489,7 @@ struct hci_rp_read_local_name { | |||
489 | 489 | ||
490 | #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 | 490 | #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18 |
491 | 491 | ||
492 | #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a | 492 | #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a |
493 | #define SCAN_DISABLED 0x00 | 493 | #define SCAN_DISABLED 0x00 |
494 | #define SCAN_INQUIRY 0x01 | 494 | #define SCAN_INQUIRY 0x01 |
495 | #define SCAN_PAGE 0x02 | 495 | #define SCAN_PAGE 0x02 |
@@ -874,7 +874,7 @@ struct hci_ev_si_security { | |||
874 | 874 | ||
875 | struct hci_command_hdr { | 875 | struct hci_command_hdr { |
876 | __le16 opcode; /* OCF & OGF */ | 876 | __le16 opcode; /* OCF & OGF */ |
877 | __u8 plen; | 877 | __u8 plen; |
878 | } __packed; | 878 | } __packed; |
879 | 879 | ||
880 | struct hci_event_hdr { | 880 | struct hci_event_hdr { |
@@ -934,9 +934,13 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) | |||
934 | struct sockaddr_hci { | 934 | struct sockaddr_hci { |
935 | sa_family_t hci_family; | 935 | sa_family_t hci_family; |
936 | unsigned short hci_dev; | 936 | unsigned short hci_dev; |
937 | unsigned short hci_channel; | ||
937 | }; | 938 | }; |
938 | #define HCI_DEV_NONE 0xffff | 939 | #define HCI_DEV_NONE 0xffff |
939 | 940 | ||
941 | #define HCI_CHANNEL_RAW 0 | ||
942 | #define HCI_CHANNEL_CONTROL 1 | ||
943 | |||
940 | struct hci_filter { | 944 | struct hci_filter { |
941 | unsigned long type_mask; | 945 | unsigned long type_mask; |
942 | unsigned long event_mask[2]; | 946 | unsigned long event_mask[2]; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index ebec8c9a929d..a29feb01854e 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -44,15 +44,15 @@ struct inquiry_data { | |||
44 | }; | 44 | }; |
45 | 45 | ||
46 | struct inquiry_entry { | 46 | struct inquiry_entry { |
47 | struct inquiry_entry *next; | 47 | struct inquiry_entry *next; |
48 | __u32 timestamp; | 48 | __u32 timestamp; |
49 | struct inquiry_data data; | 49 | struct inquiry_data data; |
50 | }; | 50 | }; |
51 | 51 | ||
52 | struct inquiry_cache { | 52 | struct inquiry_cache { |
53 | spinlock_t lock; | 53 | spinlock_t lock; |
54 | __u32 timestamp; | 54 | __u32 timestamp; |
55 | struct inquiry_entry *list; | 55 | struct inquiry_entry *list; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | struct hci_conn_hash { | 58 | struct hci_conn_hash { |
@@ -129,6 +129,7 @@ struct hci_dev { | |||
129 | wait_queue_head_t req_wait_q; | 129 | wait_queue_head_t req_wait_q; |
130 | __u32 req_status; | 130 | __u32 req_status; |
131 | __u32 req_result; | 131 | __u32 req_result; |
132 | __u16 req_last_cmd; | ||
132 | 133 | ||
133 | struct inquiry_cache inq_cache; | 134 | struct inquiry_cache inq_cache; |
134 | struct hci_conn_hash conn_hash; | 135 | struct hci_conn_hash conn_hash; |
@@ -141,7 +142,7 @@ struct hci_dev { | |||
141 | void *driver_data; | 142 | void *driver_data; |
142 | void *core_data; | 143 | void *core_data; |
143 | 144 | ||
144 | atomic_t promisc; | 145 | atomic_t promisc; |
145 | 146 | ||
146 | struct dentry *debugfs; | 147 | struct dentry *debugfs; |
147 | 148 | ||
@@ -150,7 +151,7 @@ struct hci_dev { | |||
150 | 151 | ||
151 | struct rfkill *rfkill; | 152 | struct rfkill *rfkill; |
152 | 153 | ||
153 | struct module *owner; | 154 | struct module *owner; |
154 | 155 | ||
155 | int (*open)(struct hci_dev *hdev); | 156 | int (*open)(struct hci_dev *hdev); |
156 | int (*close)(struct hci_dev *hdev); | 157 | int (*close)(struct hci_dev *hdev); |
@@ -215,8 +216,8 @@ extern rwlock_t hci_dev_list_lock; | |||
215 | extern rwlock_t hci_cb_list_lock; | 216 | extern rwlock_t hci_cb_list_lock; |
216 | 217 | ||
217 | /* ----- Inquiry cache ----- */ | 218 | /* ----- Inquiry cache ----- */ |
218 | #define INQUIRY_CACHE_AGE_MAX (HZ*30) // 30 seconds | 219 | #define INQUIRY_CACHE_AGE_MAX (HZ*30) /* 30 seconds */ |
219 | #define INQUIRY_ENTRY_AGE_MAX (HZ*60) // 60 seconds | 220 | #define INQUIRY_ENTRY_AGE_MAX (HZ*60) /* 60 seconds */ |
220 | 221 | ||
221 | #define inquiry_cache_lock(c) spin_lock(&c->lock) | 222 | #define inquiry_cache_lock(c) spin_lock(&c->lock) |
222 | #define inquiry_cache_unlock(c) spin_unlock(&c->lock) | 223 | #define inquiry_cache_unlock(c) spin_unlock(&c->lock) |
@@ -660,6 +661,11 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data); | |||
660 | /* ----- HCI Sockets ----- */ | 661 | /* ----- HCI Sockets ----- */ |
661 | void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb); | 662 | void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb); |
662 | 663 | ||
664 | /* Management interface */ | ||
665 | int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); | ||
666 | int mgmt_index_added(u16 index); | ||
667 | int mgmt_index_removed(u16 index); | ||
668 | |||
663 | /* HCI info for socket */ | 669 | /* HCI info for socket */ |
664 | #define hci_pi(sk) ((struct hci_pinfo *) sk) | 670 | #define hci_pi(sk) ((struct hci_pinfo *) sk) |
665 | 671 | ||
@@ -668,6 +674,7 @@ struct hci_pinfo { | |||
668 | struct hci_dev *hdev; | 674 | struct hci_dev *hdev; |
669 | struct hci_filter filter; | 675 | struct hci_filter filter; |
670 | __u32 cmsg_mask; | 676 | __u32 cmsg_mask; |
677 | unsigned short channel; | ||
671 | }; | 678 | }; |
672 | 679 | ||
673 | /* HCI security filter */ | 680 | /* HCI security filter */ |
@@ -687,6 +694,6 @@ struct hci_sec_filter { | |||
687 | #define hci_req_lock(d) mutex_lock(&d->req_lock) | 694 | #define hci_req_lock(d) mutex_lock(&d->req_lock) |
688 | #define hci_req_unlock(d) mutex_unlock(&d->req_lock) | 695 | #define hci_req_unlock(d) mutex_unlock(&d->req_lock) |
689 | 696 | ||
690 | void hci_req_complete(struct hci_dev *hdev, int result); | 697 | void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result); |
691 | 698 | ||
692 | #endif /* __HCI_CORE_H */ | 699 | #endif /* __HCI_CORE_H */ |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index c819c8bf9b68..7ad25ca60ec0 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
4 | Copyright (C) 2009-2010 Gustavo F. Padovan <gustavo@padovan.org> | 4 | Copyright (C) 2009-2010 Gustavo F. Padovan <gustavo@padovan.org> |
@@ -14,13 +14,13 @@ | |||
14 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 14 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
16 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 16 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
17 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 17 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
18 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 18 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
19 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 19 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
20 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 20 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
21 | 21 | ||
22 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 22 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
23 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 23 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
24 | SOFTWARE IS DISCLAIMED. | 24 | SOFTWARE IS DISCLAIMED. |
25 | */ | 25 | */ |
26 | 26 | ||
@@ -417,11 +417,11 @@ static inline int l2cap_tx_window_full(struct sock *sk) | |||
417 | return sub == pi->remote_tx_win; | 417 | return sub == pi->remote_tx_win; |
418 | } | 418 | } |
419 | 419 | ||
420 | #define __get_txseq(ctrl) ((ctrl) & L2CAP_CTRL_TXSEQ) >> 1 | 420 | #define __get_txseq(ctrl) (((ctrl) & L2CAP_CTRL_TXSEQ) >> 1) |
421 | #define __get_reqseq(ctrl) ((ctrl) & L2CAP_CTRL_REQSEQ) >> 8 | 421 | #define __get_reqseq(ctrl) (((ctrl) & L2CAP_CTRL_REQSEQ) >> 8) |
422 | #define __is_iframe(ctrl) !((ctrl) & L2CAP_CTRL_FRAME_TYPE) | 422 | #define __is_iframe(ctrl) (!((ctrl) & L2CAP_CTRL_FRAME_TYPE)) |
423 | #define __is_sframe(ctrl) (ctrl) & L2CAP_CTRL_FRAME_TYPE | 423 | #define __is_sframe(ctrl) ((ctrl) & L2CAP_CTRL_FRAME_TYPE) |
424 | #define __is_sar_start(ctrl) ((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START | 424 | #define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START) |
425 | 425 | ||
426 | void l2cap_load(void); | 426 | void l2cap_load(void); |
427 | 427 | ||
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h new file mode 100644 index 000000000000..ca29c1367ffd --- /dev/null +++ b/include/net/bluetooth/mgmt.h | |||
@@ -0,0 +1,87 @@ | |||
1 | /* | ||
2 | BlueZ - Bluetooth protocol stack for Linux | ||
3 | |||
4 | Copyright (C) 2010 Nokia Corporation | ||
5 | |||
6 | This program is free software; you can redistribute it and/or modify | ||
7 | it under the terms of the GNU General Public License version 2 as | ||
8 | published by the Free Software Foundation; | ||
9 | |||
10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
11 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | ||
13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | ||
14 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | ||
15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
16 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
17 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
18 | |||
19 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | ||
20 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | ||
21 | SOFTWARE IS DISCLAIMED. | ||
22 | */ | ||
23 | |||
24 | struct mgmt_hdr { | ||
25 | __le16 opcode; | ||
26 | __le16 len; | ||
27 | } __packed; | ||
28 | #define MGMT_HDR_SIZE 4 | ||
29 | |||
30 | #define MGMT_OP_READ_VERSION 0x0001 | ||
31 | struct mgmt_rp_read_version { | ||
32 | __u8 version; | ||
33 | __le16 revision; | ||
34 | } __packed; | ||
35 | |||
36 | #define MGMT_OP_READ_INDEX_LIST 0x0003 | ||
37 | struct mgmt_rp_read_index_list { | ||
38 | __le16 num_controllers; | ||
39 | __le16 index[0]; | ||
40 | } __packed; | ||
41 | |||
42 | #define MGMT_OP_READ_INFO 0x0004 | ||
43 | struct mgmt_cp_read_info { | ||
44 | __le16 index; | ||
45 | } __packed; | ||
46 | struct mgmt_rp_read_info { | ||
47 | __le16 index; | ||
48 | __u8 type; | ||
49 | __u8 powered; | ||
50 | __u8 discoverable; | ||
51 | __u8 pairable; | ||
52 | __u8 sec_mode; | ||
53 | bdaddr_t bdaddr; | ||
54 | __u8 dev_class[3]; | ||
55 | __u8 features[8]; | ||
56 | __u16 manufacturer; | ||
57 | __u8 hci_ver; | ||
58 | __u16 hci_rev; | ||
59 | } __packed; | ||
60 | |||
61 | #define MGMT_EV_CMD_COMPLETE 0x0001 | ||
62 | struct mgmt_ev_cmd_complete { | ||
63 | __le16 opcode; | ||
64 | __u8 data[0]; | ||
65 | } __packed; | ||
66 | |||
67 | #define MGMT_EV_CMD_STATUS 0x0002 | ||
68 | struct mgmt_ev_cmd_status { | ||
69 | __u8 status; | ||
70 | __le16 opcode; | ||
71 | } __packed; | ||
72 | |||
73 | #define MGMT_EV_CONTROLLER_ERROR 0x0003 | ||
74 | struct mgmt_ev_controller_error { | ||
75 | __le16 index; | ||
76 | __u8 error_code; | ||
77 | } __packed; | ||
78 | |||
79 | #define MGMT_EV_INDEX_ADDED 0x0004 | ||
80 | struct mgmt_ev_index_added { | ||
81 | __le16 index; | ||
82 | } __packed; | ||
83 | |||
84 | #define MGMT_EV_INDEX_REMOVED 0x0005 | ||
85 | struct mgmt_ev_index_removed { | ||
86 | __le16 index; | ||
87 | } __packed; | ||
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index 71047bc0af84..6eac4a760c3b 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | RFCOMM implementation for Linux Bluetooth stack (BlueZ). | 2 | RFCOMM implementation for Linux Bluetooth stack (BlueZ) |
3 | Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com> | 3 | Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com> |
4 | Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org> | 4 | Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org> |
5 | 5 | ||
@@ -11,13 +11,13 @@ | |||
11 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 11 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
14 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 14 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
16 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 16 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
17 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 17 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
18 | 18 | ||
19 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 19 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
20 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 20 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
21 | SOFTWARE IS DISCLAIMED. | 21 | SOFTWARE IS DISCLAIMED. |
22 | */ | 22 | */ |
23 | 23 | ||
@@ -105,7 +105,7 @@ | |||
105 | struct rfcomm_hdr { | 105 | struct rfcomm_hdr { |
106 | u8 addr; | 106 | u8 addr; |
107 | u8 ctrl; | 107 | u8 ctrl; |
108 | u8 len; // Actual size can be 2 bytes | 108 | u8 len; /* Actual size can be 2 bytes */ |
109 | } __packed; | 109 | } __packed; |
110 | 110 | ||
111 | struct rfcomm_cmd { | 111 | struct rfcomm_cmd { |
@@ -228,7 +228,7 @@ struct rfcomm_dlc { | |||
228 | /* ---- RFCOMM SEND RPN ---- */ | 228 | /* ---- RFCOMM SEND RPN ---- */ |
229 | int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci, | 229 | int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci, |
230 | u8 bit_rate, u8 data_bits, u8 stop_bits, | 230 | u8 bit_rate, u8 data_bits, u8 stop_bits, |
231 | u8 parity, u8 flow_ctrl_settings, | 231 | u8 parity, u8 flow_ctrl_settings, |
232 | u8 xon_char, u8 xoff_char, u16 param_mask); | 232 | u8 xon_char, u8 xoff_char, u16 param_mask); |
233 | 233 | ||
234 | /* ---- RFCOMM DLCs (channels) ---- */ | 234 | /* ---- RFCOMM DLCs (channels) ---- */ |
diff --git a/include/net/bluetooth/sco.h b/include/net/bluetooth/sco.h index e28a2a771471..1e35c43657c8 100644 --- a/include/net/bluetooth/sco.h +++ b/include/net/bluetooth/sco.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
4 | 4 | ||
@@ -12,13 +12,13 @@ | |||
12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
19 | 19 | ||
20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
22 | SOFTWARE IS DISCLAIMED. | 22 | SOFTWARE IS DISCLAIMED. |
23 | */ | 23 | */ |
24 | 24 | ||
@@ -55,11 +55,11 @@ struct sco_conninfo { | |||
55 | struct sco_conn { | 55 | struct sco_conn { |
56 | struct hci_conn *hcon; | 56 | struct hci_conn *hcon; |
57 | 57 | ||
58 | bdaddr_t *dst; | 58 | bdaddr_t *dst; |
59 | bdaddr_t *src; | 59 | bdaddr_t *src; |
60 | 60 | ||
61 | spinlock_t lock; | 61 | spinlock_t lock; |
62 | struct sock *sk; | 62 | struct sock *sk; |
63 | 63 | ||
64 | unsigned int mtu; | 64 | unsigned int mtu; |
65 | }; | 65 | }; |
diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h index 9402543fc20d..e54f6396fa4c 100644 --- a/include/net/caif/cfctrl.h +++ b/include/net/caif/cfctrl.h | |||
@@ -51,7 +51,7 @@ struct cfctrl_rsp { | |||
51 | void (*restart_rsp)(void); | 51 | void (*restart_rsp)(void); |
52 | void (*radioset_rsp)(void); | 52 | void (*radioset_rsp)(void); |
53 | void (*reject_rsp)(struct cflayer *layer, u8 linkid, | 53 | void (*reject_rsp)(struct cflayer *layer, u8 linkid, |
54 | struct cflayer *client_layer);; | 54 | struct cflayer *client_layer); |
55 | }; | 55 | }; |
56 | 56 | ||
57 | /* Link Setup Parameters for CAIF-Links. */ | 57 | /* Link Setup Parameters for CAIF-Links. */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 2a7936d7851d..bcc9f448ec4e 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -258,13 +258,9 @@ struct ieee80211_supported_band { | |||
258 | 258 | ||
259 | /** | 259 | /** |
260 | * struct vif_params - describes virtual interface parameters | 260 | * struct vif_params - describes virtual interface parameters |
261 | * @mesh_id: mesh ID to use | ||
262 | * @mesh_id_len: length of the mesh ID | ||
263 | * @use_4addr: use 4-address frames | 261 | * @use_4addr: use 4-address frames |
264 | */ | 262 | */ |
265 | struct vif_params { | 263 | struct vif_params { |
266 | u8 *mesh_id; | ||
267 | int mesh_id_len; | ||
268 | int use_4addr; | 264 | int use_4addr; |
269 | }; | 265 | }; |
270 | 266 | ||
@@ -424,6 +420,7 @@ struct station_parameters { | |||
424 | * @STATION_INFO_TX_RETRIES: @tx_retries filled | 420 | * @STATION_INFO_TX_RETRIES: @tx_retries filled |
425 | * @STATION_INFO_TX_FAILED: @tx_failed filled | 421 | * @STATION_INFO_TX_FAILED: @tx_failed filled |
426 | * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled | 422 | * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled |
423 | * @STATION_INFO_SIGNAL_AVG: @signal_avg filled | ||
427 | */ | 424 | */ |
428 | enum station_info_flags { | 425 | enum station_info_flags { |
429 | STATION_INFO_INACTIVE_TIME = 1<<0, | 426 | STATION_INFO_INACTIVE_TIME = 1<<0, |
@@ -439,6 +436,7 @@ enum station_info_flags { | |||
439 | STATION_INFO_TX_RETRIES = 1<<10, | 436 | STATION_INFO_TX_RETRIES = 1<<10, |
440 | STATION_INFO_TX_FAILED = 1<<11, | 437 | STATION_INFO_TX_FAILED = 1<<11, |
441 | STATION_INFO_RX_DROP_MISC = 1<<12, | 438 | STATION_INFO_RX_DROP_MISC = 1<<12, |
439 | STATION_INFO_SIGNAL_AVG = 1<<13, | ||
442 | }; | 440 | }; |
443 | 441 | ||
444 | /** | 442 | /** |
@@ -485,6 +483,7 @@ struct rate_info { | |||
485 | * @plid: mesh peer link id | 483 | * @plid: mesh peer link id |
486 | * @plink_state: mesh peer link state | 484 | * @plink_state: mesh peer link state |
487 | * @signal: signal strength of last received packet in dBm | 485 | * @signal: signal strength of last received packet in dBm |
486 | * @signal_avg: signal strength average in dBm | ||
488 | * @txrate: current unicast bitrate to this station | 487 | * @txrate: current unicast bitrate to this station |
489 | * @rx_packets: packets received from this station | 488 | * @rx_packets: packets received from this station |
490 | * @tx_packets: packets transmitted to this station | 489 | * @tx_packets: packets transmitted to this station |
@@ -505,6 +504,7 @@ struct station_info { | |||
505 | u16 plid; | 504 | u16 plid; |
506 | u8 plink_state; | 505 | u8 plink_state; |
507 | s8 signal; | 506 | s8 signal; |
507 | s8 signal_avg; | ||
508 | struct rate_info txrate; | 508 | struct rate_info txrate; |
509 | u32 rx_packets; | 509 | u32 rx_packets; |
510 | u32 tx_packets; | 510 | u32 tx_packets; |
@@ -605,6 +605,8 @@ struct mpath_info { | |||
605 | * (or NULL for no change) | 605 | * (or NULL for no change) |
606 | * @basic_rates_len: number of basic rates | 606 | * @basic_rates_len: number of basic rates |
607 | * @ap_isolate: do not forward packets between connected stations | 607 | * @ap_isolate: do not forward packets between connected stations |
608 | * @ht_opmode: HT Operation mode | ||
609 | * (u16 = opmode, -1 = do not change) | ||
608 | */ | 610 | */ |
609 | struct bss_parameters { | 611 | struct bss_parameters { |
610 | int use_cts_prot; | 612 | int use_cts_prot; |
@@ -613,8 +615,14 @@ struct bss_parameters { | |||
613 | u8 *basic_rates; | 615 | u8 *basic_rates; |
614 | u8 basic_rates_len; | 616 | u8 basic_rates_len; |
615 | int ap_isolate; | 617 | int ap_isolate; |
618 | int ht_opmode; | ||
616 | }; | 619 | }; |
617 | 620 | ||
621 | /* | ||
622 | * struct mesh_config - 802.11s mesh configuration | ||
623 | * | ||
624 | * These parameters can be changed while the mesh is active. | ||
625 | */ | ||
618 | struct mesh_config { | 626 | struct mesh_config { |
619 | /* Timeouts in ms */ | 627 | /* Timeouts in ms */ |
620 | /* Mesh plink management parameters */ | 628 | /* Mesh plink management parameters */ |
@@ -624,6 +632,8 @@ struct mesh_config { | |||
624 | u16 dot11MeshMaxPeerLinks; | 632 | u16 dot11MeshMaxPeerLinks; |
625 | u8 dot11MeshMaxRetries; | 633 | u8 dot11MeshMaxRetries; |
626 | u8 dot11MeshTTL; | 634 | u8 dot11MeshTTL; |
635 | /* ttl used in path selection information elements */ | ||
636 | u8 element_ttl; | ||
627 | bool auto_open_plinks; | 637 | bool auto_open_plinks; |
628 | /* HWMP parameters */ | 638 | /* HWMP parameters */ |
629 | u8 dot11MeshHWMPmaxPREQretries; | 639 | u8 dot11MeshHWMPmaxPREQretries; |
@@ -636,6 +646,26 @@ struct mesh_config { | |||
636 | }; | 646 | }; |
637 | 647 | ||
638 | /** | 648 | /** |
649 | * struct mesh_setup - 802.11s mesh setup configuration | ||
650 | * @mesh_id: the mesh ID | ||
651 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes | ||
652 | * @path_sel_proto: which path selection protocol to use | ||
653 | * @path_metric: which metric to use | ||
654 | * @vendor_ie: vendor information elements (optional) | ||
655 | * @vendor_ie_len: length of vendor information elements | ||
656 | * | ||
657 | * These parameters are fixed when the mesh is created. | ||
658 | */ | ||
659 | struct mesh_setup { | ||
660 | const u8 *mesh_id; | ||
661 | u8 mesh_id_len; | ||
662 | u8 path_sel_proto; | ||
663 | u8 path_metric; | ||
664 | const u8 *vendor_ie; | ||
665 | u8 vendor_ie_len; | ||
666 | }; | ||
667 | |||
668 | /** | ||
639 | * struct ieee80211_txq_params - TX queue parameters | 669 | * struct ieee80211_txq_params - TX queue parameters |
640 | * @queue: TX queue identifier (NL80211_TXQ_Q_*) | 670 | * @queue: TX queue identifier (NL80211_TXQ_Q_*) |
641 | * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled | 671 | * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled |
@@ -923,6 +953,7 @@ struct cfg80211_disassoc_request { | |||
923 | * @privacy: this is a protected network, keys will be configured | 953 | * @privacy: this is a protected network, keys will be configured |
924 | * after joining | 954 | * after joining |
925 | * @basic_rates: bitmap of basic rates to use when creating the IBSS | 955 | * @basic_rates: bitmap of basic rates to use when creating the IBSS |
956 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | ||
926 | */ | 957 | */ |
927 | struct cfg80211_ibss_params { | 958 | struct cfg80211_ibss_params { |
928 | u8 *ssid; | 959 | u8 *ssid; |
@@ -934,6 +965,7 @@ struct cfg80211_ibss_params { | |||
934 | u32 basic_rates; | 965 | u32 basic_rates; |
935 | bool channel_fixed; | 966 | bool channel_fixed; |
936 | bool privacy; | 967 | bool privacy; |
968 | int mcast_rate[IEEE80211_NUM_BANDS]; | ||
937 | }; | 969 | }; |
938 | 970 | ||
939 | /** | 971 | /** |
@@ -1029,7 +1061,8 @@ struct cfg80211_pmksa { | |||
1029 | * | 1061 | * |
1030 | * @add_virtual_intf: create a new virtual interface with the given name, | 1062 | * @add_virtual_intf: create a new virtual interface with the given name, |
1031 | * must set the struct wireless_dev's iftype. Beware: You must create | 1063 | * must set the struct wireless_dev's iftype. Beware: You must create |
1032 | * the new netdev in the wiphy's network namespace! | 1064 | * the new netdev in the wiphy's network namespace! Returns the netdev, |
1065 | * or an ERR_PTR. | ||
1033 | * | 1066 | * |
1034 | * @del_virtual_intf: remove the virtual interface determined by ifindex. | 1067 | * @del_virtual_intf: remove the virtual interface determined by ifindex. |
1035 | * | 1068 | * |
@@ -1071,9 +1104,9 @@ struct cfg80211_pmksa { | |||
1071 | * @get_mpath: get a mesh path for the given parameters | 1104 | * @get_mpath: get a mesh path for the given parameters |
1072 | * @dump_mpath: dump mesh path callback -- resume dump at index @idx | 1105 | * @dump_mpath: dump mesh path callback -- resume dump at index @idx |
1073 | * | 1106 | * |
1074 | * @get_mesh_params: Put the current mesh parameters into *params | 1107 | * @get_mesh_config: Get the current mesh configuration |
1075 | * | 1108 | * |
1076 | * @set_mesh_params: Set mesh parameters. | 1109 | * @update_mesh_config: Update mesh parameters on a running mesh. |
1077 | * The mask is a bitfield which tells us which parameters to | 1110 | * The mask is a bitfield which tells us which parameters to |
1078 | * set, and which to leave alone. | 1111 | * set, and which to leave alone. |
1079 | * | 1112 | * |
@@ -1132,7 +1165,9 @@ struct cfg80211_pmksa { | |||
1132 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. | 1165 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. |
1133 | * This allows the operation to be terminated prior to timeout based on | 1166 | * This allows the operation to be terminated prior to timeout based on |
1134 | * the duration value. | 1167 | * the duration value. |
1135 | * @mgmt_tx: Transmit a management frame | 1168 | * @mgmt_tx: Transmit a management frame. |
1169 | * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management | ||
1170 | * frame on another channel | ||
1136 | * | 1171 | * |
1137 | * @testmode_cmd: run a test mode command | 1172 | * @testmode_cmd: run a test mode command |
1138 | * | 1173 | * |
@@ -1150,14 +1185,23 @@ struct cfg80211_pmksa { | |||
1150 | * @mgmt_frame_register: Notify driver that a management frame type was | 1185 | * @mgmt_frame_register: Notify driver that a management frame type was |
1151 | * registered. Note that this callback may not sleep, and cannot run | 1186 | * registered. Note that this callback may not sleep, and cannot run |
1152 | * concurrently with itself. | 1187 | * concurrently with itself. |
1188 | * | ||
1189 | * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device. | ||
1190 | * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may | ||
1191 | * reject TX/RX mask combinations they cannot support by returning -EINVAL | ||
1192 | * (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX). | ||
1193 | * | ||
1194 | * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant). | ||
1153 | */ | 1195 | */ |
1154 | struct cfg80211_ops { | 1196 | struct cfg80211_ops { |
1155 | int (*suspend)(struct wiphy *wiphy); | 1197 | int (*suspend)(struct wiphy *wiphy); |
1156 | int (*resume)(struct wiphy *wiphy); | 1198 | int (*resume)(struct wiphy *wiphy); |
1157 | 1199 | ||
1158 | int (*add_virtual_intf)(struct wiphy *wiphy, char *name, | 1200 | struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, |
1159 | enum nl80211_iftype type, u32 *flags, | 1201 | char *name, |
1160 | struct vif_params *params); | 1202 | enum nl80211_iftype type, |
1203 | u32 *flags, | ||
1204 | struct vif_params *params); | ||
1161 | int (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev); | 1205 | int (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev); |
1162 | int (*change_virtual_intf)(struct wiphy *wiphy, | 1206 | int (*change_virtual_intf)(struct wiphy *wiphy, |
1163 | struct net_device *dev, | 1207 | struct net_device *dev, |
@@ -1175,7 +1219,7 @@ struct cfg80211_ops { | |||
1175 | u8 key_index, bool pairwise, const u8 *mac_addr); | 1219 | u8 key_index, bool pairwise, const u8 *mac_addr); |
1176 | int (*set_default_key)(struct wiphy *wiphy, | 1220 | int (*set_default_key)(struct wiphy *wiphy, |
1177 | struct net_device *netdev, | 1221 | struct net_device *netdev, |
1178 | u8 key_index); | 1222 | u8 key_index, bool unicast, bool multicast); |
1179 | int (*set_default_mgmt_key)(struct wiphy *wiphy, | 1223 | int (*set_default_mgmt_key)(struct wiphy *wiphy, |
1180 | struct net_device *netdev, | 1224 | struct net_device *netdev, |
1181 | u8 key_index); | 1225 | u8 key_index); |
@@ -1210,12 +1254,17 @@ struct cfg80211_ops { | |||
1210 | int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, | 1254 | int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, |
1211 | int idx, u8 *dst, u8 *next_hop, | 1255 | int idx, u8 *dst, u8 *next_hop, |
1212 | struct mpath_info *pinfo); | 1256 | struct mpath_info *pinfo); |
1213 | int (*get_mesh_params)(struct wiphy *wiphy, | 1257 | int (*get_mesh_config)(struct wiphy *wiphy, |
1214 | struct net_device *dev, | 1258 | struct net_device *dev, |
1215 | struct mesh_config *conf); | 1259 | struct mesh_config *conf); |
1216 | int (*set_mesh_params)(struct wiphy *wiphy, | 1260 | int (*update_mesh_config)(struct wiphy *wiphy, |
1217 | struct net_device *dev, | 1261 | struct net_device *dev, u32 mask, |
1218 | const struct mesh_config *nconf, u32 mask); | 1262 | const struct mesh_config *nconf); |
1263 | int (*join_mesh)(struct wiphy *wiphy, struct net_device *dev, | ||
1264 | const struct mesh_config *conf, | ||
1265 | const struct mesh_setup *setup); | ||
1266 | int (*leave_mesh)(struct wiphy *wiphy, struct net_device *dev); | ||
1267 | |||
1219 | int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, | 1268 | int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, |
1220 | struct bss_parameters *params); | 1269 | struct bss_parameters *params); |
1221 | 1270 | ||
@@ -1289,10 +1338,13 @@ struct cfg80211_ops { | |||
1289 | u64 cookie); | 1338 | u64 cookie); |
1290 | 1339 | ||
1291 | int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, | 1340 | int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, |
1292 | struct ieee80211_channel *chan, | 1341 | struct ieee80211_channel *chan, bool offchan, |
1293 | enum nl80211_channel_type channel_type, | 1342 | enum nl80211_channel_type channel_type, |
1294 | bool channel_type_valid, | 1343 | bool channel_type_valid, unsigned int wait, |
1295 | const u8 *buf, size_t len, u64 *cookie); | 1344 | const u8 *buf, size_t len, u64 *cookie); |
1345 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | ||
1346 | struct net_device *dev, | ||
1347 | u64 cookie); | ||
1296 | 1348 | ||
1297 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 1349 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
1298 | bool enabled, int timeout); | 1350 | bool enabled, int timeout); |
@@ -1304,6 +1356,9 @@ struct cfg80211_ops { | |||
1304 | void (*mgmt_frame_register)(struct wiphy *wiphy, | 1356 | void (*mgmt_frame_register)(struct wiphy *wiphy, |
1305 | struct net_device *dev, | 1357 | struct net_device *dev, |
1306 | u16 frame_type, bool reg); | 1358 | u16 frame_type, bool reg); |
1359 | |||
1360 | int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant); | ||
1361 | int (*get_antenna)(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant); | ||
1307 | }; | 1362 | }; |
1308 | 1363 | ||
1309 | /* | 1364 | /* |
@@ -1321,13 +1376,14 @@ struct cfg80211_ops { | |||
1321 | * initiator is %REGDOM_SET_BY_CORE). | 1376 | * initiator is %REGDOM_SET_BY_CORE). |
1322 | * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will | 1377 | * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will |
1323 | * ignore regulatory domain settings until it gets its own regulatory | 1378 | * ignore regulatory domain settings until it gets its own regulatory |
1324 | * domain via its regulatory_hint(). After its gets its own regulatory | 1379 | * domain via its regulatory_hint() unless the regulatory hint is |
1325 | * domain it will only allow further regulatory domain settings to | 1380 | * from a country IE. After its gets its own regulatory domain it will |
1326 | * further enhance compliance. For example if channel 13 and 14 are | 1381 | * only allow further regulatory domain settings to further enhance |
1327 | * disabled by this regulatory domain no user regulatory domain can | 1382 | * compliance. For example if channel 13 and 14 are disabled by this |
1328 | * enable these channels at a later time. This can be used for devices | 1383 | * regulatory domain no user regulatory domain can enable these channels |
1329 | * which do not have calibration information gauranteed for frequencies | 1384 | * at a later time. This can be used for devices which do not have |
1330 | * or settings outside of its regulatory domain. | 1385 | * calibration information guaranteed for frequencies or settings |
1386 | * outside of its regulatory domain. | ||
1331 | * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure | 1387 | * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure |
1332 | * that passive scan flags and beaconing flags may not be lifted by | 1388 | * that passive scan flags and beaconing flags may not be lifted by |
1333 | * cfg80211 due to regulatory beacon hints. For more information on beacon | 1389 | * cfg80211 due to regulatory beacon hints. For more information on beacon |
@@ -1345,6 +1401,8 @@ struct cfg80211_ops { | |||
1345 | * control port protocol ethertype. The device also honours the | 1401 | * control port protocol ethertype. The device also honours the |
1346 | * control_port_no_encrypt flag. | 1402 | * control_port_no_encrypt flag. |
1347 | * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. | 1403 | * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. |
1404 | * @WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS: The device supports separate | ||
1405 | * unicast and multicast TX keys. | ||
1348 | */ | 1406 | */ |
1349 | enum wiphy_flags { | 1407 | enum wiphy_flags { |
1350 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), | 1408 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), |
@@ -1355,7 +1413,8 @@ enum wiphy_flags { | |||
1355 | WIPHY_FLAG_4ADDR_AP = BIT(5), | 1413 | WIPHY_FLAG_4ADDR_AP = BIT(5), |
1356 | WIPHY_FLAG_4ADDR_STATION = BIT(6), | 1414 | WIPHY_FLAG_4ADDR_STATION = BIT(6), |
1357 | WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), | 1415 | WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), |
1358 | WIPHY_FLAG_IBSS_RSN = BIT(7), | 1416 | WIPHY_FLAG_IBSS_RSN = BIT(8), |
1417 | WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS= BIT(9), | ||
1359 | }; | 1418 | }; |
1360 | 1419 | ||
1361 | struct mac_address { | 1420 | struct mac_address { |
@@ -1368,7 +1427,9 @@ struct ieee80211_txrx_stypes { | |||
1368 | 1427 | ||
1369 | /** | 1428 | /** |
1370 | * struct wiphy - wireless hardware description | 1429 | * struct wiphy - wireless hardware description |
1371 | * @reg_notifier: the driver's regulatory notification callback | 1430 | * @reg_notifier: the driver's regulatory notification callback, |
1431 | * note that if your driver uses wiphy_apply_custom_regulatory() | ||
1432 | * the reg_notifier's request can be passed as NULL | ||
1372 | * @regd: the driver's regulatory domain, if one was requested via | 1433 | * @regd: the driver's regulatory domain, if one was requested via |
1373 | * the regulatory_hint() API. This can be used by the driver | 1434 | * the regulatory_hint() API. This can be used by the driver |
1374 | * on the reg_notifier() if it chooses to ignore future | 1435 | * on the reg_notifier() if it chooses to ignore future |
@@ -1420,6 +1481,17 @@ struct ieee80211_txrx_stypes { | |||
1420 | * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or | 1481 | * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or |
1421 | * transmitted through nl80211, points to an array indexed by interface | 1482 | * transmitted through nl80211, points to an array indexed by interface |
1422 | * type | 1483 | * type |
1484 | * | ||
1485 | * @available_antennas_tx: bitmap of antennas which are available to be | ||
1486 | * configured as TX antennas. Antenna configuration commands will be | ||
1487 | * rejected unless this or @available_antennas_rx is set. | ||
1488 | * | ||
1489 | * @available_antennas_rx: bitmap of antennas which are available to be | ||
1490 | * configured as RX antennas. Antenna configuration commands will be | ||
1491 | * rejected unless this or @available_antennas_tx is set. | ||
1492 | * | ||
1493 | * @max_remain_on_channel_duration: Maximum time a remain-on-channel operation | ||
1494 | * may request, if implemented. | ||
1423 | */ | 1495 | */ |
1424 | struct wiphy { | 1496 | struct wiphy { |
1425 | /* assign these fields before you register the wiphy */ | 1497 | /* assign these fields before you register the wiphy */ |
@@ -1457,8 +1529,13 @@ struct wiphy { | |||
1457 | char fw_version[ETHTOOL_BUSINFO_LEN]; | 1529 | char fw_version[ETHTOOL_BUSINFO_LEN]; |
1458 | u32 hw_version; | 1530 | u32 hw_version; |
1459 | 1531 | ||
1532 | u16 max_remain_on_channel_duration; | ||
1533 | |||
1460 | u8 max_num_pmkids; | 1534 | u8 max_num_pmkids; |
1461 | 1535 | ||
1536 | u32 available_antennas_tx; | ||
1537 | u32 available_antennas_rx; | ||
1538 | |||
1462 | /* If multiple wiphys are registered and you're handed e.g. | 1539 | /* If multiple wiphys are registered and you're handed e.g. |
1463 | * a regular netdev with assigned ieee80211_ptr, you won't | 1540 | * a regular netdev with assigned ieee80211_ptr, you won't |
1464 | * know whether it points to a wiphy your driver has registered | 1541 | * know whether it points to a wiphy your driver has registered |
@@ -1624,6 +1701,8 @@ struct cfg80211_cached_keys; | |||
1624 | * @bssid: (private) Used by the internal configuration code | 1701 | * @bssid: (private) Used by the internal configuration code |
1625 | * @ssid: (private) Used by the internal configuration code | 1702 | * @ssid: (private) Used by the internal configuration code |
1626 | * @ssid_len: (private) Used by the internal configuration code | 1703 | * @ssid_len: (private) Used by the internal configuration code |
1704 | * @mesh_id_len: (private) Used by the internal configuration code | ||
1705 | * @mesh_id_up_len: (private) Used by the internal configuration code | ||
1627 | * @wext: (private) Used by the internal wireless extensions compat code | 1706 | * @wext: (private) Used by the internal wireless extensions compat code |
1628 | * @use_4addr: indicates 4addr mode is used on this interface, must be | 1707 | * @use_4addr: indicates 4addr mode is used on this interface, must be |
1629 | * set by driver (if supported) on add_interface BEFORE registering the | 1708 | * set by driver (if supported) on add_interface BEFORE registering the |
@@ -1653,7 +1732,7 @@ struct wireless_dev { | |||
1653 | 1732 | ||
1654 | /* currently used for IBSS and SME - might be rearranged later */ | 1733 | /* currently used for IBSS and SME - might be rearranged later */ |
1655 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 1734 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
1656 | u8 ssid_len; | 1735 | u8 ssid_len, mesh_id_len, mesh_id_up_len; |
1657 | enum { | 1736 | enum { |
1658 | CFG80211_SME_IDLE, | 1737 | CFG80211_SME_IDLE, |
1659 | CFG80211_SME_CONNECTING, | 1738 | CFG80211_SME_CONNECTING, |
@@ -2297,6 +2376,32 @@ void __cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, | |||
2297 | size_t len); | 2376 | size_t len); |
2298 | 2377 | ||
2299 | /** | 2378 | /** |
2379 | * cfg80211_send_unprot_deauth - notification of unprotected deauthentication | ||
2380 | * @dev: network device | ||
2381 | * @buf: deauthentication frame (header + body) | ||
2382 | * @len: length of the frame data | ||
2383 | * | ||
2384 | * This function is called whenever a received Deauthentication frame has been | ||
2385 | * dropped in station mode because of MFP being used but the Deauthentication | ||
2386 | * frame was not protected. This function may sleep. | ||
2387 | */ | ||
2388 | void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf, | ||
2389 | size_t len); | ||
2390 | |||
2391 | /** | ||
2392 | * cfg80211_send_unprot_disassoc - notification of unprotected disassociation | ||
2393 | * @dev: network device | ||
2394 | * @buf: disassociation frame (header + body) | ||
2395 | * @len: length of the frame data | ||
2396 | * | ||
2397 | * This function is called whenever a received Disassociation frame has been | ||
2398 | * dropped in station mode because of MFP being used but the Disassociation | ||
2399 | * frame was not protected. This function may sleep. | ||
2400 | */ | ||
2401 | void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf, | ||
2402 | size_t len); | ||
2403 | |||
2404 | /** | ||
2300 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) | 2405 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) |
2301 | * @dev: network device | 2406 | * @dev: network device |
2302 | * @addr: The source MAC address of the frame | 2407 | * @addr: The source MAC address of the frame |
@@ -2595,6 +2700,18 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev, | |||
2595 | enum nl80211_cqm_rssi_threshold_event rssi_event, | 2700 | enum nl80211_cqm_rssi_threshold_event rssi_event, |
2596 | gfp_t gfp); | 2701 | gfp_t gfp); |
2597 | 2702 | ||
2703 | /** | ||
2704 | * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer | ||
2705 | * @dev: network device | ||
2706 | * @peer: peer's MAC address | ||
2707 | * @num_packets: how many packets were lost -- should be a fixed threshold | ||
2708 | * but probably no less than maybe 50, or maybe a throughput dependent | ||
2709 | * threshold (to account for temporary interference) | ||
2710 | * @gfp: context flags | ||
2711 | */ | ||
2712 | void cfg80211_cqm_pktloss_notify(struct net_device *dev, | ||
2713 | const u8 *peer, u32 num_packets, gfp_t gfp); | ||
2714 | |||
2598 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 2715 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
2599 | 2716 | ||
2600 | /* wiphy_printk helpers, similar to dev_printk */ | 2717 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h new file mode 100644 index 000000000000..bc1e7ef40171 --- /dev/null +++ b/include/net/dcbevent.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2010, Intel Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
16 | * | ||
17 | * Author: John Fastabend <john.r.fastabend@intel.com> | ||
18 | */ | ||
19 | |||
20 | #ifndef _DCB_EVENT_H | ||
21 | #define _DCB_EVENT_H | ||
22 | |||
23 | enum dcbevent_notif_type { | ||
24 | DCB_APP_EVENT = 1, | ||
25 | }; | ||
26 | |||
27 | extern int register_dcbevent_notifier(struct notifier_block *nb); | ||
28 | extern int unregister_dcbevent_notifier(struct notifier_block *nb); | ||
29 | extern int call_dcbevent_notifiers(unsigned long val, void *v); | ||
30 | |||
31 | #endif | ||
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h index b36ac7e0914d..a8e7852b10ab 100644 --- a/include/net/dcbnl.h +++ b/include/net/dcbnl.h | |||
@@ -20,11 +20,31 @@ | |||
20 | #ifndef __NET_DCBNL_H__ | 20 | #ifndef __NET_DCBNL_H__ |
21 | #define __NET_DCBNL_H__ | 21 | #define __NET_DCBNL_H__ |
22 | 22 | ||
23 | #include <linux/dcbnl.h> | ||
24 | |||
25 | struct dcb_app_type { | ||
26 | char name[IFNAMSIZ]; | ||
27 | struct dcb_app app; | ||
28 | struct list_head list; | ||
29 | }; | ||
30 | |||
31 | u8 dcb_setapp(struct net_device *, struct dcb_app *); | ||
32 | u8 dcb_getapp(struct net_device *, struct dcb_app *); | ||
33 | |||
23 | /* | 34 | /* |
24 | * Ops struct for the netlink callbacks. Used by DCB-enabled drivers through | 35 | * Ops struct for the netlink callbacks. Used by DCB-enabled drivers through |
25 | * the netdevice struct. | 36 | * the netdevice struct. |
26 | */ | 37 | */ |
27 | struct dcbnl_rtnl_ops { | 38 | struct dcbnl_rtnl_ops { |
39 | /* IEEE 802.1Qaz std */ | ||
40 | int (*ieee_getets) (struct net_device *, struct ieee_ets *); | ||
41 | int (*ieee_setets) (struct net_device *, struct ieee_ets *); | ||
42 | int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *); | ||
43 | int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *); | ||
44 | int (*ieee_getapp) (struct net_device *, struct dcb_app *); | ||
45 | int (*ieee_setapp) (struct net_device *, struct dcb_app *); | ||
46 | |||
47 | /* CEE std */ | ||
28 | u8 (*getstate)(struct net_device *); | 48 | u8 (*getstate)(struct net_device *); |
29 | u8 (*setstate)(struct net_device *, u8); | 49 | u8 (*setstate)(struct net_device *, u8); |
30 | void (*getpermhwaddr)(struct net_device *, u8 *); | 50 | void (*getpermhwaddr)(struct net_device *, u8 *); |
@@ -50,6 +70,14 @@ struct dcbnl_rtnl_ops { | |||
50 | void (*setbcnrp)(struct net_device *, int, u8); | 70 | void (*setbcnrp)(struct net_device *, int, u8); |
51 | u8 (*setapp)(struct net_device *, u8, u16, u8); | 71 | u8 (*setapp)(struct net_device *, u8, u16, u8); |
52 | u8 (*getapp)(struct net_device *, u8, u16); | 72 | u8 (*getapp)(struct net_device *, u8, u16); |
73 | u8 (*getfeatcfg)(struct net_device *, int, u8 *); | ||
74 | u8 (*setfeatcfg)(struct net_device *, int, u8); | ||
75 | |||
76 | /* DCBX configuration */ | ||
77 | u8 (*getdcbx)(struct net_device *); | ||
78 | u8 (*setdcbx)(struct net_device *, u8); | ||
79 | |||
80 | |||
53 | }; | 81 | }; |
54 | 82 | ||
55 | #endif /* __NET_DCBNL_H__ */ | 83 | #endif /* __NET_DCBNL_H__ */ |
diff --git a/include/net/dn.h b/include/net/dn.h index e5469f7b67a3..a514a3cf4573 100644 --- a/include/net/dn.h +++ b/include/net/dn.h | |||
@@ -225,7 +225,7 @@ extern int decnet_di_count; | |||
225 | extern int decnet_dr_count; | 225 | extern int decnet_dr_count; |
226 | extern int decnet_no_fc_max_cwnd; | 226 | extern int decnet_no_fc_max_cwnd; |
227 | 227 | ||
228 | extern int sysctl_decnet_mem[3]; | 228 | extern long sysctl_decnet_mem[3]; |
229 | extern int sysctl_decnet_wmem[3]; | 229 | extern int sysctl_decnet_wmem[3]; |
230 | extern int sysctl_decnet_rmem[3]; | 230 | extern int sysctl_decnet_rmem[3]; |
231 | 231 | ||
diff --git a/include/net/dst.h b/include/net/dst.h index 6baba836ad8b..be5a0d4c491d 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -70,7 +70,7 @@ struct dst_entry { | |||
70 | 70 | ||
71 | struct dst_ops *ops; | 71 | struct dst_ops *ops; |
72 | 72 | ||
73 | u32 metrics[RTAX_MAX]; | 73 | u32 _metrics[RTAX_MAX]; |
74 | 74 | ||
75 | #ifdef CONFIG_IP_ROUTE_CLASSID | 75 | #ifdef CONFIG_IP_ROUTE_CLASSID |
76 | __u32 tclassid; | 76 | __u32 tclassid; |
@@ -104,9 +104,49 @@ struct dst_entry { | |||
104 | #ifdef __KERNEL__ | 104 | #ifdef __KERNEL__ |
105 | 105 | ||
106 | static inline u32 | 106 | static inline u32 |
107 | dst_metric(const struct dst_entry *dst, int metric) | 107 | dst_metric_raw(const struct dst_entry *dst, const int metric) |
108 | { | 108 | { |
109 | return dst->metrics[metric-1]; | 109 | return dst->_metrics[metric-1]; |
110 | } | ||
111 | |||
112 | static inline u32 | ||
113 | dst_metric(const struct dst_entry *dst, const int metric) | ||
114 | { | ||
115 | WARN_ON_ONCE(metric == RTAX_HOPLIMIT || | ||
116 | metric == RTAX_ADVMSS || | ||
117 | metric == RTAX_MTU); | ||
118 | return dst_metric_raw(dst, metric); | ||
119 | } | ||
120 | |||
121 | static inline u32 | ||
122 | dst_metric_advmss(const struct dst_entry *dst) | ||
123 | { | ||
124 | u32 advmss = dst_metric_raw(dst, RTAX_ADVMSS); | ||
125 | |||
126 | if (!advmss) | ||
127 | advmss = dst->ops->default_advmss(dst); | ||
128 | |||
129 | return advmss; | ||
130 | } | ||
131 | |||
132 | static inline void dst_metric_set(struct dst_entry *dst, int metric, u32 val) | ||
133 | { | ||
134 | dst->_metrics[metric-1] = val; | ||
135 | } | ||
136 | |||
137 | static inline void dst_import_metrics(struct dst_entry *dst, const u32 *src_metrics) | ||
138 | { | ||
139 | memcpy(dst->_metrics, src_metrics, RTAX_MAX * sizeof(u32)); | ||
140 | } | ||
141 | |||
142 | static inline void dst_copy_metrics(struct dst_entry *dest, const struct dst_entry *src) | ||
143 | { | ||
144 | dst_import_metrics(dest, src->_metrics); | ||
145 | } | ||
146 | |||
147 | static inline u32 *dst_metrics_ptr(struct dst_entry *dst) | ||
148 | { | ||
149 | return dst->_metrics; | ||
110 | } | 150 | } |
111 | 151 | ||
112 | static inline u32 | 152 | static inline u32 |
@@ -117,11 +157,11 @@ dst_feature(const struct dst_entry *dst, u32 feature) | |||
117 | 157 | ||
118 | static inline u32 dst_mtu(const struct dst_entry *dst) | 158 | static inline u32 dst_mtu(const struct dst_entry *dst) |
119 | { | 159 | { |
120 | u32 mtu = dst_metric(dst, RTAX_MTU); | 160 | u32 mtu = dst_metric_raw(dst, RTAX_MTU); |
121 | /* | 161 | |
122 | * Alexey put it here, so ask him about it :) | 162 | if (!mtu) |
123 | */ | 163 | mtu = dst->ops->default_mtu(dst); |
124 | barrier(); | 164 | |
125 | return mtu; | 165 | return mtu; |
126 | } | 166 | } |
127 | 167 | ||
@@ -134,7 +174,7 @@ static inline unsigned long dst_metric_rtt(const struct dst_entry *dst, int metr | |||
134 | static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, | 174 | static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, |
135 | unsigned long rtt) | 175 | unsigned long rtt) |
136 | { | 176 | { |
137 | dst->metrics[metric-1] = jiffies_to_msecs(rtt); | 177 | dst_metric_set(dst, metric, jiffies_to_msecs(rtt)); |
138 | } | 178 | } |
139 | 179 | ||
140 | static inline u32 | 180 | static inline u32 |
@@ -147,7 +187,7 @@ dst_allfrag(const struct dst_entry *dst) | |||
147 | } | 187 | } |
148 | 188 | ||
149 | static inline int | 189 | static inline int |
150 | dst_metric_locked(struct dst_entry *dst, int metric) | 190 | dst_metric_locked(const struct dst_entry *dst, int metric) |
151 | { | 191 | { |
152 | return dst_metric(dst, RTAX_LOCK) & (1<<metric); | 192 | return dst_metric(dst, RTAX_LOCK) & (1<<metric); |
153 | } | 193 | } |
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h index 51665b3461b8..21a320b8708e 100644 --- a/include/net/dst_ops.h +++ b/include/net/dst_ops.h | |||
@@ -16,6 +16,8 @@ struct dst_ops { | |||
16 | 16 | ||
17 | int (*gc)(struct dst_ops *ops); | 17 | int (*gc)(struct dst_ops *ops); |
18 | struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); | 18 | struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); |
19 | unsigned int (*default_advmss)(const struct dst_entry *); | ||
20 | unsigned int (*default_mtu)(const struct dst_entry *); | ||
19 | void (*destroy)(struct dst_entry *); | 21 | void (*destroy)(struct dst_entry *); |
20 | void (*ifdown)(struct dst_entry *, | 22 | void (*ifdown)(struct dst_entry *, |
21 | struct net_device *dev, int how); | 23 | struct net_device *dev, int how); |
diff --git a/include/net/flow.h b/include/net/flow.h index 0ac3fb5e0973..240b7f356c71 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
@@ -49,7 +49,6 @@ struct flowi { | |||
49 | __u8 proto; | 49 | __u8 proto; |
50 | __u8 flags; | 50 | __u8 flags; |
51 | #define FLOWI_FLAG_ANYSRC 0x01 | 51 | #define FLOWI_FLAG_ANYSRC 0x01 |
52 | #define FLOWI_FLAG_MATCH_ANY_IIF 0x02 | ||
53 | union { | 52 | union { |
54 | struct { | 53 | struct { |
55 | __be16 sport; | 54 | __be16 sport; |
@@ -67,6 +66,7 @@ struct flowi { | |||
67 | } dnports; | 66 | } dnports; |
68 | 67 | ||
69 | __be32 spi; | 68 | __be32 spi; |
69 | __be32 gre_key; | ||
70 | 70 | ||
71 | struct { | 71 | struct { |
72 | __u8 type; | 72 | __u8 type; |
@@ -78,6 +78,7 @@ struct flowi { | |||
78 | #define fl_icmp_code uli_u.icmpt.code | 78 | #define fl_icmp_code uli_u.icmpt.code |
79 | #define fl_ipsec_spi uli_u.spi | 79 | #define fl_ipsec_spi uli_u.spi |
80 | #define fl_mh_type uli_u.mht.type | 80 | #define fl_mh_type uli_u.mht.type |
81 | #define fl_gre_key uli_u.gre_key | ||
81 | __u32 secid; /* used by xfrm; see secid.txt */ | 82 | __u32 secid; /* used by xfrm; see secid.txt */ |
82 | } __attribute__((__aligned__(BITS_PER_LONG/8))); | 83 | } __attribute__((__aligned__(BITS_PER_LONG/8))); |
83 | 84 | ||
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index f95ff8d9aa47..04977eefb0ee 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
@@ -89,10 +89,11 @@ struct ip6_sf_socklist { | |||
89 | struct ipv6_mc_socklist { | 89 | struct ipv6_mc_socklist { |
90 | struct in6_addr addr; | 90 | struct in6_addr addr; |
91 | int ifindex; | 91 | int ifindex; |
92 | struct ipv6_mc_socklist *next; | 92 | struct ipv6_mc_socklist __rcu *next; |
93 | rwlock_t sflock; | 93 | rwlock_t sflock; |
94 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ | 94 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ |
95 | struct ip6_sf_socklist *sflist; | 95 | struct ip6_sf_socklist *sflist; |
96 | struct rcu_head rcu; | ||
96 | }; | 97 | }; |
97 | 98 | ||
98 | struct ip6_sf_list { | 99 | struct ip6_sf_list { |
diff --git a/include/net/inet6_connection_sock.h b/include/net/inet6_connection_sock.h index aae08f686633..ff013505236b 100644 --- a/include/net/inet6_connection_sock.h +++ b/include/net/inet6_connection_sock.h | |||
@@ -25,6 +25,9 @@ struct sockaddr; | |||
25 | extern int inet6_csk_bind_conflict(const struct sock *sk, | 25 | extern int inet6_csk_bind_conflict(const struct sock *sk, |
26 | const struct inet_bind_bucket *tb); | 26 | const struct inet_bind_bucket *tb); |
27 | 27 | ||
28 | extern struct dst_entry* inet6_csk_route_req(struct sock *sk, | ||
29 | const struct request_sock *req); | ||
30 | |||
28 | extern struct request_sock *inet6_csk_search_req(const struct sock *sk, | 31 | extern struct request_sock *inet6_csk_search_req(const struct sock *sk, |
29 | struct request_sock ***prevp, | 32 | struct request_sock ***prevp, |
30 | const __be16 rport, | 33 | const __be16 rport, |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index e4f494b42e06..6ac4e3b5007f 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
@@ -43,7 +43,7 @@ struct inet_connection_sock_af_ops { | |||
43 | struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, | 43 | struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, |
44 | struct request_sock *req, | 44 | struct request_sock *req, |
45 | struct dst_entry *dst); | 45 | struct dst_entry *dst); |
46 | int (*remember_stamp)(struct sock *sk); | 46 | struct inet_peer *(*get_peer)(struct sock *sk, bool *release_it); |
47 | u16 net_header_len; | 47 | u16 net_header_len; |
48 | u16 sockaddr_len; | 48 | u16 sockaddr_len; |
49 | int (*setsockopt)(struct sock *sk, int level, int optname, | 49 | int (*setsockopt)(struct sock *sk, int level, int optname, |
@@ -132,7 +132,6 @@ struct inet_connection_sock { | |||
132 | #define ICSK_TIME_RETRANS 1 /* Retransmit timer */ | 132 | #define ICSK_TIME_RETRANS 1 /* Retransmit timer */ |
133 | #define ICSK_TIME_DACK 2 /* Delayed ack timer */ | 133 | #define ICSK_TIME_DACK 2 /* Delayed ack timer */ |
134 | #define ICSK_TIME_PROBE0 3 /* Zero window probe timer */ | 134 | #define ICSK_TIME_PROBE0 3 /* Zero window probe timer */ |
135 | #define ICSK_TIME_KEEPOPEN 4 /* Keepalive timer */ | ||
136 | 135 | ||
137 | static inline struct inet_connection_sock *inet_csk(const struct sock *sk) | 136 | static inline struct inet_connection_sock *inet_csk(const struct sock *sk) |
138 | { | 137 | { |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 1989cfd7405f..8181498fa96c 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -116,8 +116,9 @@ struct inet_sock { | |||
116 | struct ipv6_pinfo *pinet6; | 116 | struct ipv6_pinfo *pinet6; |
117 | #endif | 117 | #endif |
118 | /* Socket demultiplex comparisons on incoming packets. */ | 118 | /* Socket demultiplex comparisons on incoming packets. */ |
119 | __be32 inet_daddr; | 119 | #define inet_daddr sk.__sk_common.skc_daddr |
120 | __be32 inet_rcv_saddr; | 120 | #define inet_rcv_saddr sk.__sk_common.skc_rcv_saddr |
121 | |||
121 | __be16 inet_dport; | 122 | __be16 inet_dport; |
122 | __u16 inet_num; | 123 | __u16 inet_num; |
123 | __be32 inet_saddr; | 124 | __be32 inet_saddr; |
@@ -141,7 +142,7 @@ struct inet_sock { | |||
141 | nodefrag:1; | 142 | nodefrag:1; |
142 | int mc_index; | 143 | int mc_index; |
143 | __be32 mc_addr; | 144 | __be32 mc_addr; |
144 | struct ip_mc_socklist *mc_list; | 145 | struct ip_mc_socklist __rcu *mc_list; |
145 | struct { | 146 | struct { |
146 | unsigned int flags; | 147 | unsigned int flags; |
147 | unsigned int fragsize; | 148 | unsigned int fragsize; |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index a066fdd50da6..17404b5388a7 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
@@ -88,12 +88,6 @@ extern void inet_twdr_hangman(unsigned long data); | |||
88 | extern void inet_twdr_twkill_work(struct work_struct *work); | 88 | extern void inet_twdr_twkill_work(struct work_struct *work); |
89 | extern void inet_twdr_twcal_tick(unsigned long data); | 89 | extern void inet_twdr_twcal_tick(unsigned long data); |
90 | 90 | ||
91 | #if (BITS_PER_LONG == 64) | ||
92 | #define INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES 8 | ||
93 | #else | ||
94 | #define INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES 4 | ||
95 | #endif | ||
96 | |||
97 | struct inet_bind_bucket; | 91 | struct inet_bind_bucket; |
98 | 92 | ||
99 | /* | 93 | /* |
@@ -117,15 +111,15 @@ struct inet_timewait_sock { | |||
117 | #define tw_hash __tw_common.skc_hash | 111 | #define tw_hash __tw_common.skc_hash |
118 | #define tw_prot __tw_common.skc_prot | 112 | #define tw_prot __tw_common.skc_prot |
119 | #define tw_net __tw_common.skc_net | 113 | #define tw_net __tw_common.skc_net |
114 | #define tw_daddr __tw_common.skc_daddr | ||
115 | #define tw_rcv_saddr __tw_common.skc_rcv_saddr | ||
120 | int tw_timeout; | 116 | int tw_timeout; |
121 | volatile unsigned char tw_substate; | 117 | volatile unsigned char tw_substate; |
122 | /* 3 bits hole, try to pack */ | ||
123 | unsigned char tw_rcv_wscale; | 118 | unsigned char tw_rcv_wscale; |
119 | |||
124 | /* Socket demultiplex comparisons on incoming packets. */ | 120 | /* Socket demultiplex comparisons on incoming packets. */ |
125 | /* these five are in inet_sock */ | 121 | /* these three are in inet_sock */ |
126 | __be16 tw_sport; | 122 | __be16 tw_sport; |
127 | __be32 tw_daddr __attribute__((aligned(INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES))); | ||
128 | __be32 tw_rcv_saddr; | ||
129 | __be16 tw_dport; | 123 | __be16 tw_dport; |
130 | __u16 tw_num; | 124 | __u16 tw_num; |
131 | kmemcheck_bitfield_begin(flags); | 125 | kmemcheck_bitfield_begin(flags); |
@@ -191,10 +185,10 @@ static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk) | |||
191 | return (struct inet_timewait_sock *)sk; | 185 | return (struct inet_timewait_sock *)sk; |
192 | } | 186 | } |
193 | 187 | ||
194 | static inline __be32 inet_rcv_saddr(const struct sock *sk) | 188 | static inline __be32 sk_rcv_saddr(const struct sock *sk) |
195 | { | 189 | { |
196 | return likely(sk->sk_state != TCP_TIME_WAIT) ? | 190 | /* both inet_sk() and inet_twsk() store rcv_saddr in skc_rcv_saddr */ |
197 | inet_sk(sk)->inet_rcv_saddr : inet_twsk(sk)->tw_rcv_saddr; | 191 | return sk->__sk_common.skc_rcv_saddr; |
198 | } | 192 | } |
199 | 193 | ||
200 | extern void inet_twsk_put(struct inet_timewait_sock *tw); | 194 | extern void inet_twsk_put(struct inet_timewait_sock *tw); |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index fe239bfe5f7f..599d96e74114 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -11,12 +11,21 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/jiffies.h> | 12 | #include <linux/jiffies.h> |
13 | #include <linux/spinlock.h> | 13 | #include <linux/spinlock.h> |
14 | #include <net/ipv6.h> | ||
14 | #include <asm/atomic.h> | 15 | #include <asm/atomic.h> |
15 | 16 | ||
17 | struct inetpeer_addr { | ||
18 | union { | ||
19 | __be32 a4; | ||
20 | __be32 a6[4]; | ||
21 | }; | ||
22 | __u16 family; | ||
23 | }; | ||
24 | |||
16 | struct inet_peer { | 25 | struct inet_peer { |
17 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ | 26 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ |
18 | struct inet_peer __rcu *avl_left, *avl_right; | 27 | struct inet_peer __rcu *avl_left, *avl_right; |
19 | __be32 v4daddr; /* peer's address */ | 28 | struct inetpeer_addr daddr; |
20 | __u32 avl_height; | 29 | __u32 avl_height; |
21 | struct list_head unused; | 30 | struct list_head unused; |
22 | __u32 dtime; /* the time of last use of not | 31 | __u32 dtime; /* the time of last use of not |
@@ -26,7 +35,6 @@ struct inet_peer { | |||
26 | * Once inet_peer is queued for deletion (refcnt == -1), following fields | 35 | * Once inet_peer is queued for deletion (refcnt == -1), following fields |
27 | * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp | 36 | * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp |
28 | * We can share memory with rcu_head to keep inet_peer small | 37 | * We can share memory with rcu_head to keep inet_peer small |
29 | * (less then 64 bytes) | ||
30 | */ | 38 | */ |
31 | union { | 39 | union { |
32 | struct { | 40 | struct { |
@@ -42,7 +50,25 @@ struct inet_peer { | |||
42 | void inet_initpeers(void) __init; | 50 | void inet_initpeers(void) __init; |
43 | 51 | ||
44 | /* can be called with or without local BH being disabled */ | 52 | /* can be called with or without local BH being disabled */ |
45 | struct inet_peer *inet_getpeer(__be32 daddr, int create); | 53 | struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create); |
54 | |||
55 | static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create) | ||
56 | { | ||
57 | struct inetpeer_addr daddr; | ||
58 | |||
59 | daddr.a4 = v4daddr; | ||
60 | daddr.family = AF_INET; | ||
61 | return inet_getpeer(&daddr, create); | ||
62 | } | ||
63 | |||
64 | static inline struct inet_peer *inet_getpeer_v6(struct in6_addr *v6daddr, int create) | ||
65 | { | ||
66 | struct inetpeer_addr daddr; | ||
67 | |||
68 | ipv6_addr_copy((struct in6_addr *)daddr.a6, v6daddr); | ||
69 | daddr.family = AF_INET6; | ||
70 | return inet_getpeer(&daddr, create); | ||
71 | } | ||
46 | 72 | ||
47 | /* can be called from BH context or outside */ | 73 | /* can be called from BH context or outside */ |
48 | extern void inet_putpeer(struct inet_peer *p); | 74 | extern void inet_putpeer(struct inet_peer *p); |
diff --git a/include/net/ip.h b/include/net/ip.h index 86e2b182a0c0..67fac78a186b 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -201,7 +201,6 @@ static inline int inet_is_reserved_local_port(int port) | |||
201 | return test_bit(port, sysctl_local_reserved_ports); | 201 | return test_bit(port, sysctl_local_reserved_ports); |
202 | } | 202 | } |
203 | 203 | ||
204 | extern int sysctl_ip_default_ttl; | ||
205 | extern int sysctl_ip_nonlocal_bind; | 204 | extern int sysctl_ip_nonlocal_bind; |
206 | 205 | ||
207 | extern struct ctl_path net_core_path[]; | 206 | extern struct ctl_path net_core_path[]; |
@@ -428,15 +427,6 @@ extern void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, | |||
428 | extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, | 427 | extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, |
429 | u32 info); | 428 | u32 info); |
430 | 429 | ||
431 | /* sysctl helpers - any sysctl which holds a value that ends up being | ||
432 | * fed into the routing cache should use these handlers. | ||
433 | */ | ||
434 | int ipv4_doint_and_flush(ctl_table *ctl, int write, | ||
435 | void __user *buffer, | ||
436 | size_t *lenp, loff_t *ppos); | ||
437 | int ipv4_doint_and_flush_strategy(ctl_table *table, | ||
438 | void __user *oldval, size_t __user *oldlenp, | ||
439 | void __user *newval, size_t newlen); | ||
440 | #ifdef CONFIG_PROC_FS | 430 | #ifdef CONFIG_PROC_FS |
441 | extern int ip_misc_proc_init(void); | 431 | extern int ip_misc_proc_init(void); |
442 | #endif | 432 | #endif |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 062a823d311c..708ff7cb8806 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <net/dst.h> | 21 | #include <net/dst.h> |
22 | #include <net/flow.h> | 22 | #include <net/flow.h> |
23 | #include <net/netlink.h> | 23 | #include <net/netlink.h> |
24 | #include <net/inetpeer.h> | ||
24 | 25 | ||
25 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | 26 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES |
26 | #define FIB6_TABLE_HASHSZ 256 | 27 | #define FIB6_TABLE_HASHSZ 256 |
@@ -109,6 +110,7 @@ struct rt6_info { | |||
109 | u32 rt6i_metric; | 110 | u32 rt6i_metric; |
110 | 111 | ||
111 | struct inet6_dev *rt6i_idev; | 112 | struct inet6_dev *rt6i_idev; |
113 | struct inet_peer *rt6i_peer; | ||
112 | 114 | ||
113 | #ifdef CONFIG_XFRM | 115 | #ifdef CONFIG_XFRM |
114 | u32 rt6i_flow_cache_genid; | 116 | u32 rt6i_flow_cache_genid; |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 278312c95f96..8552f0a2e854 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #define IP6_RT_PRIO_USER 1024 | 4 | #define IP6_RT_PRIO_USER 1024 |
5 | #define IP6_RT_PRIO_ADDRCONF 256 | 5 | #define IP6_RT_PRIO_ADDRCONF 256 |
6 | #define IP6_RT_PRIO_KERN 512 | ||
7 | 6 | ||
8 | struct route_info { | 7 | struct route_info { |
9 | __u8 type; | 8 | __u8 type; |
@@ -56,6 +55,18 @@ static inline unsigned int rt6_flags2srcprefs(int flags) | |||
56 | return (flags >> 3) & 7; | 55 | return (flags >> 3) & 7; |
57 | } | 56 | } |
58 | 57 | ||
58 | extern void rt6_bind_peer(struct rt6_info *rt, | ||
59 | int create); | ||
60 | |||
61 | static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) | ||
62 | { | ||
63 | if (rt->rt6i_peer) | ||
64 | return rt->rt6i_peer; | ||
65 | |||
66 | rt6_bind_peer(rt, 0); | ||
67 | return rt->rt6i_peer; | ||
68 | } | ||
69 | |||
59 | extern void ip6_route_input(struct sk_buff *skb); | 70 | extern void ip6_route_input(struct sk_buff *skb); |
60 | 71 | ||
61 | extern struct dst_entry * ip6_route_output(struct net *net, | 72 | extern struct dst_entry * ip6_route_output(struct net *net, |
@@ -164,5 +175,15 @@ static inline int ipv6_unicast_destination(struct sk_buff *skb) | |||
164 | return rt->rt6i_flags & RTF_LOCAL; | 175 | return rt->rt6i_flags & RTF_LOCAL; |
165 | } | 176 | } |
166 | 177 | ||
178 | int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | ||
179 | |||
180 | static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | ||
181 | { | ||
182 | struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; | ||
183 | |||
184 | return (np && np->pmtudisc == IPV6_PMTUDISC_PROBE) ? | ||
185 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | ||
186 | } | ||
187 | |||
167 | #endif | 188 | #endif |
168 | #endif | 189 | #endif |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index d858264217ba..b23bea62f708 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -28,6 +28,80 @@ | |||
28 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 28 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
29 | #include <net/netfilter/nf_conntrack.h> | 29 | #include <net/netfilter/nf_conntrack.h> |
30 | #endif | 30 | #endif |
31 | #include <net/net_namespace.h> /* Netw namespace */ | ||
32 | |||
33 | /* | ||
34 | * Generic access of ipvs struct | ||
35 | */ | ||
36 | static inline struct netns_ipvs *net_ipvs(struct net* net) | ||
37 | { | ||
38 | return net->ipvs; | ||
39 | } | ||
40 | /* | ||
41 | * Get net ptr from skb in traffic cases | ||
42 | * use skb_sknet when call is from userland (ioctl or netlink) | ||
43 | */ | ||
44 | static inline struct net *skb_net(const struct sk_buff *skb) | ||
45 | { | ||
46 | #ifdef CONFIG_NET_NS | ||
47 | #ifdef CONFIG_IP_VS_DEBUG | ||
48 | /* | ||
49 | * This is used for debug only. | ||
50 | * Start with the most likely hit | ||
51 | * End with BUG | ||
52 | */ | ||
53 | if (likely(skb->dev && skb->dev->nd_net)) | ||
54 | return dev_net(skb->dev); | ||
55 | if (skb_dst(skb)->dev) | ||
56 | return dev_net(skb_dst(skb)->dev); | ||
57 | WARN(skb->sk, "Maybe skb_sknet should be used in %s() at line:%d\n", | ||
58 | __func__, __LINE__); | ||
59 | if (likely(skb->sk && skb->sk->sk_net)) | ||
60 | return sock_net(skb->sk); | ||
61 | pr_err("There is no net ptr to find in the skb in %s() line:%d\n", | ||
62 | __func__, __LINE__); | ||
63 | BUG(); | ||
64 | #else | ||
65 | return dev_net(skb->dev ? : skb_dst(skb)->dev); | ||
66 | #endif | ||
67 | #else | ||
68 | return &init_net; | ||
69 | #endif | ||
70 | } | ||
71 | |||
72 | static inline struct net *skb_sknet(const struct sk_buff *skb) | ||
73 | { | ||
74 | #ifdef CONFIG_NET_NS | ||
75 | #ifdef CONFIG_IP_VS_DEBUG | ||
76 | /* Start with the most likely hit */ | ||
77 | if (likely(skb->sk && skb->sk->sk_net)) | ||
78 | return sock_net(skb->sk); | ||
79 | WARN(skb->dev, "Maybe skb_net should be used instead in %s() line:%d\n", | ||
80 | __func__, __LINE__); | ||
81 | if (likely(skb->dev && skb->dev->nd_net)) | ||
82 | return dev_net(skb->dev); | ||
83 | pr_err("There is no net ptr to find in the skb in %s() line:%d\n", | ||
84 | __func__, __LINE__); | ||
85 | BUG(); | ||
86 | #else | ||
87 | return sock_net(skb->sk); | ||
88 | #endif | ||
89 | #else | ||
90 | return &init_net; | ||
91 | #endif | ||
92 | } | ||
93 | /* | ||
94 | * This one needed for single_open_net since net is stored directly in | ||
95 | * private not as a struct i.e. seq_file_net cant be used. | ||
96 | */ | ||
97 | static inline struct net *seq_file_single_net(struct seq_file *seq) | ||
98 | { | ||
99 | #ifdef CONFIG_NET_NS | ||
100 | return (struct net *)seq->private; | ||
101 | #else | ||
102 | return &init_net; | ||
103 | #endif | ||
104 | } | ||
31 | 105 | ||
32 | /* Connections' size value needed by ip_vs_ctl.c */ | 106 | /* Connections' size value needed by ip_vs_ctl.c */ |
33 | extern int ip_vs_conn_tab_size; | 107 | extern int ip_vs_conn_tab_size; |
@@ -258,6 +332,23 @@ struct ip_vs_seq { | |||
258 | before last resized pkt */ | 332 | before last resized pkt */ |
259 | }; | 333 | }; |
260 | 334 | ||
335 | /* | ||
336 | * counters per cpu | ||
337 | */ | ||
338 | struct ip_vs_counters { | ||
339 | __u32 conns; /* connections scheduled */ | ||
340 | __u32 inpkts; /* incoming packets */ | ||
341 | __u32 outpkts; /* outgoing packets */ | ||
342 | __u64 inbytes; /* incoming bytes */ | ||
343 | __u64 outbytes; /* outgoing bytes */ | ||
344 | }; | ||
345 | /* | ||
346 | * Stats per cpu | ||
347 | */ | ||
348 | struct ip_vs_cpu_stats { | ||
349 | struct ip_vs_counters ustats; | ||
350 | struct u64_stats_sync syncp; | ||
351 | }; | ||
261 | 352 | ||
262 | /* | 353 | /* |
263 | * IPVS statistics objects | 354 | * IPVS statistics objects |
@@ -279,17 +370,34 @@ struct ip_vs_estimator { | |||
279 | }; | 370 | }; |
280 | 371 | ||
281 | struct ip_vs_stats { | 372 | struct ip_vs_stats { |
282 | struct ip_vs_stats_user ustats; /* statistics */ | 373 | struct ip_vs_stats_user ustats; /* statistics */ |
283 | struct ip_vs_estimator est; /* estimator */ | 374 | struct ip_vs_estimator est; /* estimator */ |
284 | 375 | struct ip_vs_cpu_stats *cpustats; /* per cpu counters */ | |
285 | spinlock_t lock; /* spin lock */ | 376 | spinlock_t lock; /* spin lock */ |
286 | }; | 377 | }; |
287 | 378 | ||
379 | /* | ||
380 | * Helper Macros for per cpu | ||
381 | * ipvs->tot_stats->ustats.count | ||
382 | */ | ||
383 | #define IPVS_STAT_INC(ipvs, count) \ | ||
384 | __this_cpu_inc((ipvs)->ustats->count) | ||
385 | |||
386 | #define IPVS_STAT_ADD(ipvs, count, value) \ | ||
387 | do {\ | ||
388 | write_seqcount_begin(per_cpu_ptr((ipvs)->ustats_seq, \ | ||
389 | raw_smp_processor_id())); \ | ||
390 | __this_cpu_add((ipvs)->ustats->count, value); \ | ||
391 | write_seqcount_end(per_cpu_ptr((ipvs)->ustats_seq, \ | ||
392 | raw_smp_processor_id())); \ | ||
393 | } while (0) | ||
394 | |||
288 | struct dst_entry; | 395 | struct dst_entry; |
289 | struct iphdr; | 396 | struct iphdr; |
290 | struct ip_vs_conn; | 397 | struct ip_vs_conn; |
291 | struct ip_vs_app; | 398 | struct ip_vs_app; |
292 | struct sk_buff; | 399 | struct sk_buff; |
400 | struct ip_vs_proto_data; | ||
293 | 401 | ||
294 | struct ip_vs_protocol { | 402 | struct ip_vs_protocol { |
295 | struct ip_vs_protocol *next; | 403 | struct ip_vs_protocol *next; |
@@ -297,21 +405,22 @@ struct ip_vs_protocol { | |||
297 | u16 protocol; | 405 | u16 protocol; |
298 | u16 num_states; | 406 | u16 num_states; |
299 | int dont_defrag; | 407 | int dont_defrag; |
300 | atomic_t appcnt; /* counter of proto app incs */ | ||
301 | int *timeout_table; /* protocol timeout table */ | ||
302 | 408 | ||
303 | void (*init)(struct ip_vs_protocol *pp); | 409 | void (*init)(struct ip_vs_protocol *pp); |
304 | 410 | ||
305 | void (*exit)(struct ip_vs_protocol *pp); | 411 | void (*exit)(struct ip_vs_protocol *pp); |
306 | 412 | ||
413 | void (*init_netns)(struct net *net, struct ip_vs_proto_data *pd); | ||
414 | |||
415 | void (*exit_netns)(struct net *net, struct ip_vs_proto_data *pd); | ||
416 | |||
307 | int (*conn_schedule)(int af, struct sk_buff *skb, | 417 | int (*conn_schedule)(int af, struct sk_buff *skb, |
308 | struct ip_vs_protocol *pp, | 418 | struct ip_vs_proto_data *pd, |
309 | int *verdict, struct ip_vs_conn **cpp); | 419 | int *verdict, struct ip_vs_conn **cpp); |
310 | 420 | ||
311 | struct ip_vs_conn * | 421 | struct ip_vs_conn * |
312 | (*conn_in_get)(int af, | 422 | (*conn_in_get)(int af, |
313 | const struct sk_buff *skb, | 423 | const struct sk_buff *skb, |
314 | struct ip_vs_protocol *pp, | ||
315 | const struct ip_vs_iphdr *iph, | 424 | const struct ip_vs_iphdr *iph, |
316 | unsigned int proto_off, | 425 | unsigned int proto_off, |
317 | int inverse); | 426 | int inverse); |
@@ -319,7 +428,6 @@ struct ip_vs_protocol { | |||
319 | struct ip_vs_conn * | 428 | struct ip_vs_conn * |
320 | (*conn_out_get)(int af, | 429 | (*conn_out_get)(int af, |
321 | const struct sk_buff *skb, | 430 | const struct sk_buff *skb, |
322 | struct ip_vs_protocol *pp, | ||
323 | const struct ip_vs_iphdr *iph, | 431 | const struct ip_vs_iphdr *iph, |
324 | unsigned int proto_off, | 432 | unsigned int proto_off, |
325 | int inverse); | 433 | int inverse); |
@@ -337,11 +445,11 @@ struct ip_vs_protocol { | |||
337 | 445 | ||
338 | int (*state_transition)(struct ip_vs_conn *cp, int direction, | 446 | int (*state_transition)(struct ip_vs_conn *cp, int direction, |
339 | const struct sk_buff *skb, | 447 | const struct sk_buff *skb, |
340 | struct ip_vs_protocol *pp); | 448 | struct ip_vs_proto_data *pd); |
341 | 449 | ||
342 | int (*register_app)(struct ip_vs_app *inc); | 450 | int (*register_app)(struct net *net, struct ip_vs_app *inc); |
343 | 451 | ||
344 | void (*unregister_app)(struct ip_vs_app *inc); | 452 | void (*unregister_app)(struct net *net, struct ip_vs_app *inc); |
345 | 453 | ||
346 | int (*app_conn_bind)(struct ip_vs_conn *cp); | 454 | int (*app_conn_bind)(struct ip_vs_conn *cp); |
347 | 455 | ||
@@ -350,14 +458,26 @@ struct ip_vs_protocol { | |||
350 | int offset, | 458 | int offset, |
351 | const char *msg); | 459 | const char *msg); |
352 | 460 | ||
353 | void (*timeout_change)(struct ip_vs_protocol *pp, int flags); | 461 | void (*timeout_change)(struct ip_vs_proto_data *pd, int flags); |
462 | }; | ||
354 | 463 | ||
355 | int (*set_state_timeout)(struct ip_vs_protocol *pp, char *sname, int to); | 464 | /* |
465 | * protocol data per netns | ||
466 | */ | ||
467 | struct ip_vs_proto_data { | ||
468 | struct ip_vs_proto_data *next; | ||
469 | struct ip_vs_protocol *pp; | ||
470 | int *timeout_table; /* protocol timeout table */ | ||
471 | atomic_t appcnt; /* counter of proto app incs. */ | ||
472 | struct tcp_states_t *tcp_state_table; | ||
356 | }; | 473 | }; |
357 | 474 | ||
358 | extern struct ip_vs_protocol * ip_vs_proto_get(unsigned short proto); | 475 | extern struct ip_vs_protocol *ip_vs_proto_get(unsigned short proto); |
476 | extern struct ip_vs_proto_data *ip_vs_proto_data_get(struct net *net, | ||
477 | unsigned short proto); | ||
359 | 478 | ||
360 | struct ip_vs_conn_param { | 479 | struct ip_vs_conn_param { |
480 | struct net *net; | ||
361 | const union nf_inet_addr *caddr; | 481 | const union nf_inet_addr *caddr; |
362 | const union nf_inet_addr *vaddr; | 482 | const union nf_inet_addr *vaddr; |
363 | __be16 cport; | 483 | __be16 cport; |
@@ -375,17 +495,19 @@ struct ip_vs_conn_param { | |||
375 | */ | 495 | */ |
376 | struct ip_vs_conn { | 496 | struct ip_vs_conn { |
377 | struct list_head c_list; /* hashed list heads */ | 497 | struct list_head c_list; /* hashed list heads */ |
378 | 498 | #ifdef CONFIG_NET_NS | |
499 | struct net *net; /* Name space */ | ||
500 | #endif | ||
379 | /* Protocol, addresses and port numbers */ | 501 | /* Protocol, addresses and port numbers */ |
380 | u16 af; /* address family */ | 502 | u16 af; /* address family */ |
381 | union nf_inet_addr caddr; /* client address */ | 503 | __be16 cport; |
382 | union nf_inet_addr vaddr; /* virtual address */ | 504 | __be16 vport; |
383 | union nf_inet_addr daddr; /* destination address */ | 505 | __be16 dport; |
384 | volatile __u32 flags; /* status flags */ | 506 | __u32 fwmark; /* Fire wall mark from skb */ |
385 | __u32 fwmark; /* Fire wall mark from skb */ | 507 | union nf_inet_addr caddr; /* client address */ |
386 | __be16 cport; | 508 | union nf_inet_addr vaddr; /* virtual address */ |
387 | __be16 vport; | 509 | union nf_inet_addr daddr; /* destination address */ |
388 | __be16 dport; | 510 | volatile __u32 flags; /* status flags */ |
389 | __u16 protocol; /* Which protocol (TCP/UDP) */ | 511 | __u16 protocol; /* Which protocol (TCP/UDP) */ |
390 | 512 | ||
391 | /* counter and timer */ | 513 | /* counter and timer */ |
@@ -428,6 +550,33 @@ struct ip_vs_conn { | |||
428 | __u8 pe_data_len; | 550 | __u8 pe_data_len; |
429 | }; | 551 | }; |
430 | 552 | ||
553 | /* | ||
554 | * To save some memory in conn table when name space is disabled. | ||
555 | */ | ||
556 | static inline struct net *ip_vs_conn_net(const struct ip_vs_conn *cp) | ||
557 | { | ||
558 | #ifdef CONFIG_NET_NS | ||
559 | return cp->net; | ||
560 | #else | ||
561 | return &init_net; | ||
562 | #endif | ||
563 | } | ||
564 | static inline void ip_vs_conn_net_set(struct ip_vs_conn *cp, struct net *net) | ||
565 | { | ||
566 | #ifdef CONFIG_NET_NS | ||
567 | cp->net = net; | ||
568 | #endif | ||
569 | } | ||
570 | |||
571 | static inline int ip_vs_conn_net_eq(const struct ip_vs_conn *cp, | ||
572 | struct net *net) | ||
573 | { | ||
574 | #ifdef CONFIG_NET_NS | ||
575 | return cp->net == net; | ||
576 | #else | ||
577 | return 1; | ||
578 | #endif | ||
579 | } | ||
431 | 580 | ||
432 | /* | 581 | /* |
433 | * Extended internal versions of struct ip_vs_service_user and | 582 | * Extended internal versions of struct ip_vs_service_user and |
@@ -487,6 +636,7 @@ struct ip_vs_service { | |||
487 | unsigned flags; /* service status flags */ | 636 | unsigned flags; /* service status flags */ |
488 | unsigned timeout; /* persistent timeout in ticks */ | 637 | unsigned timeout; /* persistent timeout in ticks */ |
489 | __be32 netmask; /* grouping granularity */ | 638 | __be32 netmask; /* grouping granularity */ |
639 | struct net *net; | ||
490 | 640 | ||
491 | struct list_head destinations; /* real server d-linked list */ | 641 | struct list_head destinations; /* real server d-linked list */ |
492 | __u32 num_dests; /* number of servers */ | 642 | __u32 num_dests; /* number of servers */ |
@@ -512,8 +662,8 @@ struct ip_vs_dest { | |||
512 | struct list_head d_list; /* for table with all the dests */ | 662 | struct list_head d_list; /* for table with all the dests */ |
513 | 663 | ||
514 | u16 af; /* address family */ | 664 | u16 af; /* address family */ |
515 | union nf_inet_addr addr; /* IP address of the server */ | ||
516 | __be16 port; /* port number of the server */ | 665 | __be16 port; /* port number of the server */ |
666 | union nf_inet_addr addr; /* IP address of the server */ | ||
517 | volatile unsigned flags; /* dest status flags */ | 667 | volatile unsigned flags; /* dest status flags */ |
518 | atomic_t conn_flags; /* flags to copy to conn */ | 668 | atomic_t conn_flags; /* flags to copy to conn */ |
519 | atomic_t weight; /* server weight */ | 669 | atomic_t weight; /* server weight */ |
@@ -540,8 +690,8 @@ struct ip_vs_dest { | |||
540 | /* for virtual service */ | 690 | /* for virtual service */ |
541 | struct ip_vs_service *svc; /* service it belongs to */ | 691 | struct ip_vs_service *svc; /* service it belongs to */ |
542 | __u16 protocol; /* which protocol (TCP/UDP) */ | 692 | __u16 protocol; /* which protocol (TCP/UDP) */ |
543 | union nf_inet_addr vaddr; /* virtual IP address */ | ||
544 | __be16 vport; /* virtual port number */ | 693 | __be16 vport; /* virtual port number */ |
694 | union nf_inet_addr vaddr; /* virtual IP address */ | ||
545 | __u32 vfwmark; /* firewall mark of service */ | 695 | __u32 vfwmark; /* firewall mark of service */ |
546 | }; | 696 | }; |
547 | 697 | ||
@@ -676,13 +826,14 @@ enum { | |||
676 | IP_VS_DIR_LAST, | 826 | IP_VS_DIR_LAST, |
677 | }; | 827 | }; |
678 | 828 | ||
679 | static inline void ip_vs_conn_fill_param(int af, int protocol, | 829 | static inline void ip_vs_conn_fill_param(struct net *net, int af, int protocol, |
680 | const union nf_inet_addr *caddr, | 830 | const union nf_inet_addr *caddr, |
681 | __be16 cport, | 831 | __be16 cport, |
682 | const union nf_inet_addr *vaddr, | 832 | const union nf_inet_addr *vaddr, |
683 | __be16 vport, | 833 | __be16 vport, |
684 | struct ip_vs_conn_param *p) | 834 | struct ip_vs_conn_param *p) |
685 | { | 835 | { |
836 | p->net = net; | ||
686 | p->af = af; | 837 | p->af = af; |
687 | p->protocol = protocol; | 838 | p->protocol = protocol; |
688 | p->caddr = caddr; | 839 | p->caddr = caddr; |
@@ -697,7 +848,6 @@ struct ip_vs_conn *ip_vs_conn_in_get(const struct ip_vs_conn_param *p); | |||
697 | struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p); | 848 | struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p); |
698 | 849 | ||
699 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, | 850 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, |
700 | struct ip_vs_protocol *pp, | ||
701 | const struct ip_vs_iphdr *iph, | 851 | const struct ip_vs_iphdr *iph, |
702 | unsigned int proto_off, | 852 | unsigned int proto_off, |
703 | int inverse); | 853 | int inverse); |
@@ -705,7 +855,6 @@ struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, | |||
705 | struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); | 855 | struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); |
706 | 856 | ||
707 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, | 857 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, |
708 | struct ip_vs_protocol *pp, | ||
709 | const struct ip_vs_iphdr *iph, | 858 | const struct ip_vs_iphdr *iph, |
710 | unsigned int proto_off, | 859 | unsigned int proto_off, |
711 | int inverse); | 860 | int inverse); |
@@ -726,9 +875,9 @@ extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); | |||
726 | 875 | ||
727 | extern const char * ip_vs_state_name(__u16 proto, int state); | 876 | extern const char * ip_vs_state_name(__u16 proto, int state); |
728 | 877 | ||
729 | extern void ip_vs_tcp_conn_listen(struct ip_vs_conn *cp); | 878 | extern void ip_vs_tcp_conn_listen(struct net *net, struct ip_vs_conn *cp); |
730 | extern int ip_vs_check_template(struct ip_vs_conn *ct); | 879 | extern int ip_vs_check_template(struct ip_vs_conn *ct); |
731 | extern void ip_vs_random_dropentry(void); | 880 | extern void ip_vs_random_dropentry(struct net *net); |
732 | extern int ip_vs_conn_init(void); | 881 | extern int ip_vs_conn_init(void); |
733 | extern void ip_vs_conn_cleanup(void); | 882 | extern void ip_vs_conn_cleanup(void); |
734 | 883 | ||
@@ -798,12 +947,12 @@ ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp) | |||
798 | * (from ip_vs_app.c) | 947 | * (from ip_vs_app.c) |
799 | */ | 948 | */ |
800 | #define IP_VS_APP_MAX_PORTS 8 | 949 | #define IP_VS_APP_MAX_PORTS 8 |
801 | extern int register_ip_vs_app(struct ip_vs_app *app); | 950 | extern int register_ip_vs_app(struct net *net, struct ip_vs_app *app); |
802 | extern void unregister_ip_vs_app(struct ip_vs_app *app); | 951 | extern void unregister_ip_vs_app(struct net *net, struct ip_vs_app *app); |
803 | extern int ip_vs_bind_app(struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 952 | extern int ip_vs_bind_app(struct ip_vs_conn *cp, struct ip_vs_protocol *pp); |
804 | extern void ip_vs_unbind_app(struct ip_vs_conn *cp); | 953 | extern void ip_vs_unbind_app(struct ip_vs_conn *cp); |
805 | extern int | 954 | extern int register_ip_vs_app_inc(struct net *net, struct ip_vs_app *app, |
806 | register_ip_vs_app_inc(struct ip_vs_app *app, __u16 proto, __u16 port); | 955 | __u16 proto, __u16 port); |
807 | extern int ip_vs_app_inc_get(struct ip_vs_app *inc); | 956 | extern int ip_vs_app_inc_get(struct ip_vs_app *inc); |
808 | extern void ip_vs_app_inc_put(struct ip_vs_app *inc); | 957 | extern void ip_vs_app_inc_put(struct ip_vs_app *inc); |
809 | 958 | ||
@@ -836,7 +985,7 @@ static inline void ip_vs_pe_put(const struct ip_vs_pe *pe) | |||
836 | */ | 985 | */ |
837 | extern int ip_vs_protocol_init(void); | 986 | extern int ip_vs_protocol_init(void); |
838 | extern void ip_vs_protocol_cleanup(void); | 987 | extern void ip_vs_protocol_cleanup(void); |
839 | extern void ip_vs_protocol_timeout_change(int flags); | 988 | extern void ip_vs_protocol_timeout_change(struct netns_ipvs *ipvs, int flags); |
840 | extern int *ip_vs_create_timeout_table(int *table, int size); | 989 | extern int *ip_vs_create_timeout_table(int *table, int size); |
841 | extern int | 990 | extern int |
842 | ip_vs_set_state_timeout(int *table, int num, const char *const *names, | 991 | ip_vs_set_state_timeout(int *table, int num, const char *const *names, |
@@ -866,28 +1015,21 @@ extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name); | |||
866 | extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); | 1015 | extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); |
867 | extern struct ip_vs_conn * | 1016 | extern struct ip_vs_conn * |
868 | ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, | 1017 | ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, |
869 | struct ip_vs_protocol *pp, int *ignored); | 1018 | struct ip_vs_proto_data *pd, int *ignored); |
870 | extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, | 1019 | extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, |
871 | struct ip_vs_protocol *pp); | 1020 | struct ip_vs_proto_data *pd); |
872 | 1021 | ||
873 | 1022 | ||
874 | /* | 1023 | /* |
875 | * IPVS control data and functions (from ip_vs_ctl.c) | 1024 | * IPVS control data and functions (from ip_vs_ctl.c) |
876 | */ | 1025 | */ |
877 | extern int sysctl_ip_vs_cache_bypass; | ||
878 | extern int sysctl_ip_vs_expire_nodest_conn; | ||
879 | extern int sysctl_ip_vs_expire_quiescent_template; | ||
880 | extern int sysctl_ip_vs_sync_threshold[2]; | ||
881 | extern int sysctl_ip_vs_nat_icmp_send; | ||
882 | extern int sysctl_ip_vs_conntrack; | ||
883 | extern int sysctl_ip_vs_snat_reroute; | ||
884 | extern struct ip_vs_stats ip_vs_stats; | 1026 | extern struct ip_vs_stats ip_vs_stats; |
885 | extern const struct ctl_path net_vs_ctl_path[]; | 1027 | extern const struct ctl_path net_vs_ctl_path[]; |
886 | extern int sysctl_ip_vs_sync_ver; | 1028 | extern int sysctl_ip_vs_sync_ver; |
887 | 1029 | ||
888 | extern void ip_vs_sync_switch_mode(int mode); | 1030 | extern void ip_vs_sync_switch_mode(struct net *net, int mode); |
889 | extern struct ip_vs_service * | 1031 | extern struct ip_vs_service * |
890 | ip_vs_service_get(int af, __u32 fwmark, __u16 protocol, | 1032 | ip_vs_service_get(struct net *net, int af, __u32 fwmark, __u16 protocol, |
891 | const union nf_inet_addr *vaddr, __be16 vport); | 1033 | const union nf_inet_addr *vaddr, __be16 vport); |
892 | 1034 | ||
893 | static inline void ip_vs_service_put(struct ip_vs_service *svc) | 1035 | static inline void ip_vs_service_put(struct ip_vs_service *svc) |
@@ -896,7 +1038,7 @@ static inline void ip_vs_service_put(struct ip_vs_service *svc) | |||
896 | } | 1038 | } |
897 | 1039 | ||
898 | extern struct ip_vs_dest * | 1040 | extern struct ip_vs_dest * |
899 | ip_vs_lookup_real_service(int af, __u16 protocol, | 1041 | ip_vs_lookup_real_service(struct net *net, int af, __u16 protocol, |
900 | const union nf_inet_addr *daddr, __be16 dport); | 1042 | const union nf_inet_addr *daddr, __be16 dport); |
901 | 1043 | ||
902 | extern int ip_vs_use_count_inc(void); | 1044 | extern int ip_vs_use_count_inc(void); |
@@ -904,9 +1046,9 @@ extern void ip_vs_use_count_dec(void); | |||
904 | extern int ip_vs_control_init(void); | 1046 | extern int ip_vs_control_init(void); |
905 | extern void ip_vs_control_cleanup(void); | 1047 | extern void ip_vs_control_cleanup(void); |
906 | extern struct ip_vs_dest * | 1048 | extern struct ip_vs_dest * |
907 | ip_vs_find_dest(int af, const union nf_inet_addr *daddr, __be16 dport, | 1049 | ip_vs_find_dest(struct net *net, int af, const union nf_inet_addr *daddr, |
908 | const union nf_inet_addr *vaddr, __be16 vport, __u16 protocol, | 1050 | __be16 dport, const union nf_inet_addr *vaddr, __be16 vport, |
909 | __u32 fwmark); | 1051 | __u16 protocol, __u32 fwmark); |
910 | extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp); | 1052 | extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp); |
911 | 1053 | ||
912 | 1054 | ||
@@ -914,14 +1056,12 @@ extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp); | |||
914 | * IPVS sync daemon data and function prototypes | 1056 | * IPVS sync daemon data and function prototypes |
915 | * (from ip_vs_sync.c) | 1057 | * (from ip_vs_sync.c) |
916 | */ | 1058 | */ |
917 | extern volatile int ip_vs_sync_state; | 1059 | extern int start_sync_thread(struct net *net, int state, char *mcast_ifn, |
918 | extern volatile int ip_vs_master_syncid; | 1060 | __u8 syncid); |
919 | extern volatile int ip_vs_backup_syncid; | 1061 | extern int stop_sync_thread(struct net *net, int state); |
920 | extern char ip_vs_master_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | 1062 | extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp); |
921 | extern char ip_vs_backup_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | 1063 | extern int ip_vs_sync_init(void); |
922 | extern int start_sync_thread(int state, char *mcast_ifn, __u8 syncid); | 1064 | extern void ip_vs_sync_cleanup(void); |
923 | extern int stop_sync_thread(int state); | ||
924 | extern void ip_vs_sync_conn(struct ip_vs_conn *cp); | ||
925 | 1065 | ||
926 | 1066 | ||
927 | /* | 1067 | /* |
@@ -929,8 +1069,8 @@ extern void ip_vs_sync_conn(struct ip_vs_conn *cp); | |||
929 | */ | 1069 | */ |
930 | extern int ip_vs_estimator_init(void); | 1070 | extern int ip_vs_estimator_init(void); |
931 | extern void ip_vs_estimator_cleanup(void); | 1071 | extern void ip_vs_estimator_cleanup(void); |
932 | extern void ip_vs_new_estimator(struct ip_vs_stats *stats); | 1072 | extern void ip_vs_new_estimator(struct net *net, struct ip_vs_stats *stats); |
933 | extern void ip_vs_kill_estimator(struct ip_vs_stats *stats); | 1073 | extern void ip_vs_kill_estimator(struct net *net, struct ip_vs_stats *stats); |
934 | extern void ip_vs_zero_estimator(struct ip_vs_stats *stats); | 1074 | extern void ip_vs_zero_estimator(struct ip_vs_stats *stats); |
935 | 1075 | ||
936 | /* | 1076 | /* |
@@ -972,11 +1112,13 @@ extern int ip_vs_icmp_xmit_v6 | |||
972 | extern int ip_vs_drop_rate; | 1112 | extern int ip_vs_drop_rate; |
973 | extern int ip_vs_drop_counter; | 1113 | extern int ip_vs_drop_counter; |
974 | 1114 | ||
975 | static __inline__ int ip_vs_todrop(void) | 1115 | static inline int ip_vs_todrop(struct netns_ipvs *ipvs) |
976 | { | 1116 | { |
977 | if (!ip_vs_drop_rate) return 0; | 1117 | if (!ipvs->drop_rate) |
978 | if (--ip_vs_drop_counter > 0) return 0; | 1118 | return 0; |
979 | ip_vs_drop_counter = ip_vs_drop_rate; | 1119 | if (--ipvs->drop_counter > 0) |
1120 | return 0; | ||
1121 | ipvs->drop_counter = ipvs->drop_rate; | ||
980 | return 1; | 1122 | return 1; |
981 | } | 1123 | } |
982 | 1124 | ||
@@ -1064,9 +1206,9 @@ static inline void ip_vs_notrack(struct sk_buff *skb) | |||
1064 | * Netfilter connection tracking | 1206 | * Netfilter connection tracking |
1065 | * (from ip_vs_nfct.c) | 1207 | * (from ip_vs_nfct.c) |
1066 | */ | 1208 | */ |
1067 | static inline int ip_vs_conntrack_enabled(void) | 1209 | static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs) |
1068 | { | 1210 | { |
1069 | return sysctl_ip_vs_conntrack; | 1211 | return ipvs->sysctl_conntrack; |
1070 | } | 1212 | } |
1071 | 1213 | ||
1072 | extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, | 1214 | extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, |
@@ -1079,7 +1221,7 @@ extern void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp); | |||
1079 | 1221 | ||
1080 | #else | 1222 | #else |
1081 | 1223 | ||
1082 | static inline int ip_vs_conntrack_enabled(void) | 1224 | static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs) |
1083 | { | 1225 | { |
1084 | return 0; | 1226 | return 0; |
1085 | } | 1227 | } |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 9fdf982d1286..5b3fd5add7a4 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -97,6 +97,20 @@ enum ieee80211_max_queues { | |||
97 | }; | 97 | }; |
98 | 98 | ||
99 | /** | 99 | /** |
100 | * enum ieee80211_ac_numbers - AC numbers as used in mac80211 | ||
101 | * @IEEE80211_AC_VO: voice | ||
102 | * @IEEE80211_AC_VI: video | ||
103 | * @IEEE80211_AC_BE: best effort | ||
104 | * @IEEE80211_AC_BK: background | ||
105 | */ | ||
106 | enum ieee80211_ac_numbers { | ||
107 | IEEE80211_AC_VO = 0, | ||
108 | IEEE80211_AC_VI = 1, | ||
109 | IEEE80211_AC_BE = 2, | ||
110 | IEEE80211_AC_BK = 3, | ||
111 | }; | ||
112 | |||
113 | /** | ||
100 | * struct ieee80211_tx_queue_params - transmit queue configuration | 114 | * struct ieee80211_tx_queue_params - transmit queue configuration |
101 | * | 115 | * |
102 | * The information provided in this structure is required for QoS | 116 | * The information provided in this structure is required for QoS |
@@ -205,6 +219,7 @@ enum ieee80211_bss_change { | |||
205 | * @basic_rates: bitmap of basic rates, each bit stands for an | 219 | * @basic_rates: bitmap of basic rates, each bit stands for an |
206 | * index into the rate table configured by the driver in | 220 | * index into the rate table configured by the driver in |
207 | * the current band. | 221 | * the current band. |
222 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | ||
208 | * @bssid: The BSSID for this BSS | 223 | * @bssid: The BSSID for this BSS |
209 | * @enable_beacon: whether beaconing should be enabled or not | 224 | * @enable_beacon: whether beaconing should be enabled or not |
210 | * @channel_type: Channel type for this BSS -- the hardware might be | 225 | * @channel_type: Channel type for this BSS -- the hardware might be |
@@ -244,6 +259,7 @@ struct ieee80211_bss_conf { | |||
244 | u16 assoc_capability; | 259 | u16 assoc_capability; |
245 | u64 timestamp; | 260 | u64 timestamp; |
246 | u32 basic_rates; | 261 | u32 basic_rates; |
262 | int mcast_rate[IEEE80211_NUM_BANDS]; | ||
247 | u16 ht_operation_mode; | 263 | u16 ht_operation_mode; |
248 | s32 cqm_rssi_thold; | 264 | s32 cqm_rssi_thold; |
249 | u32 cqm_rssi_hyst; | 265 | u32 cqm_rssi_hyst; |
@@ -349,6 +365,7 @@ enum mac80211_tx_control_flags { | |||
349 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), | 365 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), |
350 | IEEE80211_TX_CTL_LDPC = BIT(22), | 366 | IEEE80211_TX_CTL_LDPC = BIT(22), |
351 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), | 367 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), |
368 | IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25), | ||
352 | }; | 369 | }; |
353 | 370 | ||
354 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | 371 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 |
@@ -1652,6 +1669,11 @@ enum ieee80211_ampdu_mlme_action { | |||
1652 | * and IV16) for the given key from hardware. | 1669 | * and IV16) for the given key from hardware. |
1653 | * The callback must be atomic. | 1670 | * The callback must be atomic. |
1654 | * | 1671 | * |
1672 | * @set_frag_threshold: Configuration of fragmentation threshold. Assign this | ||
1673 | * if the device does fragmentation by itself; if this callback is | ||
1674 | * implemented then the stack will not do fragmentation. | ||
1675 | * The callback can sleep. | ||
1676 | * | ||
1655 | * @set_rts_threshold: Configuration of RTS threshold (if device needs it) | 1677 | * @set_rts_threshold: Configuration of RTS threshold (if device needs it) |
1656 | * The callback can sleep. | 1678 | * The callback can sleep. |
1657 | * | 1679 | * |
@@ -1724,6 +1746,13 @@ enum ieee80211_ampdu_mlme_action { | |||
1724 | * completion of the channel switch. | 1746 | * completion of the channel switch. |
1725 | * | 1747 | * |
1726 | * @napi_poll: Poll Rx queue for incoming data frames. | 1748 | * @napi_poll: Poll Rx queue for incoming data frames. |
1749 | * | ||
1750 | * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device. | ||
1751 | * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may | ||
1752 | * reject TX/RX mask combinations they cannot support by returning -EINVAL | ||
1753 | * (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX). | ||
1754 | * | ||
1755 | * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant). | ||
1727 | */ | 1756 | */ |
1728 | struct ieee80211_ops { | 1757 | struct ieee80211_ops { |
1729 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1758 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
@@ -1765,6 +1794,7 @@ struct ieee80211_ops { | |||
1765 | struct ieee80211_low_level_stats *stats); | 1794 | struct ieee80211_low_level_stats *stats); |
1766 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, | 1795 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, |
1767 | u32 *iv32, u16 *iv16); | 1796 | u32 *iv32, u16 *iv16); |
1797 | int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value); | ||
1768 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); | 1798 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); |
1769 | int (*sta_add)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1799 | int (*sta_add)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1770 | struct ieee80211_sta *sta); | 1800 | struct ieee80211_sta *sta); |
@@ -1793,6 +1823,14 @@ struct ieee80211_ops { | |||
1793 | void (*channel_switch)(struct ieee80211_hw *hw, | 1823 | void (*channel_switch)(struct ieee80211_hw *hw, |
1794 | struct ieee80211_channel_switch *ch_switch); | 1824 | struct ieee80211_channel_switch *ch_switch); |
1795 | int (*napi_poll)(struct ieee80211_hw *hw, int budget); | 1825 | int (*napi_poll)(struct ieee80211_hw *hw, int budget); |
1826 | int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant); | ||
1827 | int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); | ||
1828 | |||
1829 | int (*remain_on_channel)(struct ieee80211_hw *hw, | ||
1830 | struct ieee80211_channel *chan, | ||
1831 | enum nl80211_channel_type channel_type, | ||
1832 | int duration); | ||
1833 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); | ||
1796 | }; | 1834 | }; |
1797 | 1835 | ||
1798 | /** | 1836 | /** |
@@ -1821,11 +1859,39 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
1821 | */ | 1859 | */ |
1822 | int ieee80211_register_hw(struct ieee80211_hw *hw); | 1860 | int ieee80211_register_hw(struct ieee80211_hw *hw); |
1823 | 1861 | ||
1862 | /** | ||
1863 | * struct ieee80211_tpt_blink - throughput blink description | ||
1864 | * @throughput: throughput in Kbit/sec | ||
1865 | * @blink_time: blink time in milliseconds | ||
1866 | * (full cycle, ie. one off + one on period) | ||
1867 | */ | ||
1868 | struct ieee80211_tpt_blink { | ||
1869 | int throughput; | ||
1870 | int blink_time; | ||
1871 | }; | ||
1872 | |||
1873 | /** | ||
1874 | * enum ieee80211_tpt_led_trigger_flags - throughput trigger flags | ||
1875 | * @IEEE80211_TPT_LEDTRIG_FL_RADIO: enable blinking with radio | ||
1876 | * @IEEE80211_TPT_LEDTRIG_FL_WORK: enable blinking when working | ||
1877 | * @IEEE80211_TPT_LEDTRIG_FL_CONNECTED: enable blinking when at least one | ||
1878 | * interface is connected in some way, including being an AP | ||
1879 | */ | ||
1880 | enum ieee80211_tpt_led_trigger_flags { | ||
1881 | IEEE80211_TPT_LEDTRIG_FL_RADIO = BIT(0), | ||
1882 | IEEE80211_TPT_LEDTRIG_FL_WORK = BIT(1), | ||
1883 | IEEE80211_TPT_LEDTRIG_FL_CONNECTED = BIT(2), | ||
1884 | }; | ||
1885 | |||
1824 | #ifdef CONFIG_MAC80211_LEDS | 1886 | #ifdef CONFIG_MAC80211_LEDS |
1825 | extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); | 1887 | extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); |
1826 | extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); | 1888 | extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); |
1827 | extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); | 1889 | extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); |
1828 | extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); | 1890 | extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); |
1891 | extern char *__ieee80211_create_tpt_led_trigger( | ||
1892 | struct ieee80211_hw *hw, unsigned int flags, | ||
1893 | const struct ieee80211_tpt_blink *blink_table, | ||
1894 | unsigned int blink_table_len); | ||
1829 | #endif | 1895 | #endif |
1830 | /** | 1896 | /** |
1831 | * ieee80211_get_tx_led_name - get name of TX LED | 1897 | * ieee80211_get_tx_led_name - get name of TX LED |
@@ -1904,6 +1970,30 @@ static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw) | |||
1904 | } | 1970 | } |
1905 | 1971 | ||
1906 | /** | 1972 | /** |
1973 | * ieee80211_create_tpt_led_trigger - create throughput LED trigger | ||
1974 | * @hw: the hardware to create the trigger for | ||
1975 | * @flags: trigger flags, see &enum ieee80211_tpt_led_trigger_flags | ||
1976 | * @blink_table: the blink table -- needs to be ordered by throughput | ||
1977 | * @blink_table_len: size of the blink table | ||
1978 | * | ||
1979 | * This function returns %NULL (in case of error, or if no LED | ||
1980 | * triggers are configured) or the name of the new trigger. | ||
1981 | * This function must be called before ieee80211_register_hw(). | ||
1982 | */ | ||
1983 | static inline char * | ||
1984 | ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, unsigned int flags, | ||
1985 | const struct ieee80211_tpt_blink *blink_table, | ||
1986 | unsigned int blink_table_len) | ||
1987 | { | ||
1988 | #ifdef CONFIG_MAC80211_LEDS | ||
1989 | return __ieee80211_create_tpt_led_trigger(hw, flags, blink_table, | ||
1990 | blink_table_len); | ||
1991 | #else | ||
1992 | return NULL; | ||
1993 | #endif | ||
1994 | } | ||
1995 | |||
1996 | /** | ||
1907 | * ieee80211_unregister_hw - Unregister a hardware device | 1997 | * ieee80211_unregister_hw - Unregister a hardware device |
1908 | * | 1998 | * |
1909 | * This function instructs mac80211 to free allocated resources | 1999 | * This function instructs mac80211 to free allocated resources |
@@ -2024,8 +2114,8 @@ static inline void ieee80211_rx_ni(struct ieee80211_hw *hw, | |||
2024 | * | 2114 | * |
2025 | * This function may not be called in IRQ context. Calls to this function | 2115 | * This function may not be called in IRQ context. Calls to this function |
2026 | * for a single hardware must be synchronized against each other. Calls | 2116 | * for a single hardware must be synchronized against each other. Calls |
2027 | * to this function and ieee80211_tx_status_irqsafe() may not be mixed | 2117 | * to this function, ieee80211_tx_status_ni() and ieee80211_tx_status_irqsafe() |
2028 | * for a single hardware. | 2118 | * may not be mixed for a single hardware. |
2029 | * | 2119 | * |
2030 | * @hw: the hardware the frame was transmitted by | 2120 | * @hw: the hardware the frame was transmitted by |
2031 | * @skb: the frame that was transmitted, owned by mac80211 after this call | 2121 | * @skb: the frame that was transmitted, owned by mac80211 after this call |
@@ -2034,13 +2124,33 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, | |||
2034 | struct sk_buff *skb); | 2124 | struct sk_buff *skb); |
2035 | 2125 | ||
2036 | /** | 2126 | /** |
2127 | * ieee80211_tx_status_ni - transmit status callback (in process context) | ||
2128 | * | ||
2129 | * Like ieee80211_tx_status() but can be called in process context. | ||
2130 | * | ||
2131 | * Calls to this function, ieee80211_tx_status() and | ||
2132 | * ieee80211_tx_status_irqsafe() may not be mixed | ||
2133 | * for a single hardware. | ||
2134 | * | ||
2135 | * @hw: the hardware the frame was transmitted by | ||
2136 | * @skb: the frame that was transmitted, owned by mac80211 after this call | ||
2137 | */ | ||
2138 | static inline void ieee80211_tx_status_ni(struct ieee80211_hw *hw, | ||
2139 | struct sk_buff *skb) | ||
2140 | { | ||
2141 | local_bh_disable(); | ||
2142 | ieee80211_tx_status(hw, skb); | ||
2143 | local_bh_enable(); | ||
2144 | } | ||
2145 | |||
2146 | /** | ||
2037 | * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback | 2147 | * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback |
2038 | * | 2148 | * |
2039 | * Like ieee80211_tx_status() but can be called in IRQ context | 2149 | * Like ieee80211_tx_status() but can be called in IRQ context |
2040 | * (internally defers to a tasklet.) | 2150 | * (internally defers to a tasklet.) |
2041 | * | 2151 | * |
2042 | * Calls to this function and ieee80211_tx_status() may not be mixed for a | 2152 | * Calls to this function, ieee80211_tx_status() and |
2043 | * single hardware. | 2153 | * ieee80211_tx_status_ni() may not be mixed for a single hardware. |
2044 | * | 2154 | * |
2045 | * @hw: the hardware the frame was transmitted by | 2155 | * @hw: the hardware the frame was transmitted by |
2046 | * @skb: the frame that was transmitted, owned by mac80211 after this call | 2156 | * @skb: the frame that was transmitted, owned by mac80211 after this call |
@@ -2384,6 +2494,7 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
2384 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. | 2494 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. |
2385 | * @sta: the station for which to start a BA session | 2495 | * @sta: the station for which to start a BA session |
2386 | * @tid: the TID to BA on. | 2496 | * @tid: the TID to BA on. |
2497 | * @timeout: session timeout value (in TUs) | ||
2387 | * | 2498 | * |
2388 | * Return: success if addBA request was sent, failure otherwise | 2499 | * Return: success if addBA request was sent, failure otherwise |
2389 | * | 2500 | * |
@@ -2391,7 +2502,8 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
2391 | * the need to start aggregation on a certain RA/TID, the session level | 2502 | * the need to start aggregation on a certain RA/TID, the session level |
2392 | * will be managed by the mac80211. | 2503 | * will be managed by the mac80211. |
2393 | */ | 2504 | */ |
2394 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid); | 2505 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid, |
2506 | u16 timeout); | ||
2395 | 2507 | ||
2396 | /** | 2508 | /** |
2397 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. | 2509 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. |
@@ -2501,6 +2613,21 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | |||
2501 | struct ieee80211_sta *pubsta, bool block); | 2613 | struct ieee80211_sta *pubsta, bool block); |
2502 | 2614 | ||
2503 | /** | 2615 | /** |
2616 | * ieee80211_ap_probereq_get - retrieve a Probe Request template | ||
2617 | * @hw: pointer obtained from ieee80211_alloc_hw(). | ||
2618 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
2619 | * | ||
2620 | * Creates a Probe Request template which can, for example, be uploaded to | ||
2621 | * hardware. The template is filled with bssid, ssid and supported rate | ||
2622 | * information. This function must only be called from within the | ||
2623 | * .bss_info_changed callback function and only in managed mode. The function | ||
2624 | * is only useful when the interface is associated, otherwise it will return | ||
2625 | * NULL. | ||
2626 | */ | ||
2627 | struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw, | ||
2628 | struct ieee80211_vif *vif); | ||
2629 | |||
2630 | /** | ||
2504 | * ieee80211_beacon_loss - inform hardware does not receive beacons | 2631 | * ieee80211_beacon_loss - inform hardware does not receive beacons |
2505 | * | 2632 | * |
2506 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 2633 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
@@ -2609,6 +2736,18 @@ void ieee80211_request_smps(struct ieee80211_vif *vif, | |||
2609 | */ | 2736 | */ |
2610 | void ieee80211_key_removed(struct ieee80211_key_conf *key_conf); | 2737 | void ieee80211_key_removed(struct ieee80211_key_conf *key_conf); |
2611 | 2738 | ||
2739 | /** | ||
2740 | * ieee80211_ready_on_channel - notification of remain-on-channel start | ||
2741 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
2742 | */ | ||
2743 | void ieee80211_ready_on_channel(struct ieee80211_hw *hw); | ||
2744 | |||
2745 | /** | ||
2746 | * ieee80211_remain_on_channel_expired - remain_on_channel duration expired | ||
2747 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
2748 | */ | ||
2749 | void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw); | ||
2750 | |||
2612 | /* Rate control API */ | 2751 | /* Rate control API */ |
2613 | 2752 | ||
2614 | /** | 2753 | /** |
@@ -2640,7 +2779,7 @@ enum rate_control_changed { | |||
2640 | * @rate_idx_mask: user-requested rate mask (not MCS for now) | 2779 | * @rate_idx_mask: user-requested rate mask (not MCS for now) |
2641 | * @skb: the skb that will be transmitted, the control information in it needs | 2780 | * @skb: the skb that will be transmitted, the control information in it needs |
2642 | * to be filled in | 2781 | * to be filled in |
2643 | * @ap: whether this frame is sent out in AP mode | 2782 | * @bss: whether this frame is sent out in AP or IBSS mode |
2644 | */ | 2783 | */ |
2645 | struct ieee80211_tx_rate_control { | 2784 | struct ieee80211_tx_rate_control { |
2646 | struct ieee80211_hw *hw; | 2785 | struct ieee80211_hw *hw; |
@@ -2651,7 +2790,7 @@ struct ieee80211_tx_rate_control { | |||
2651 | bool rts, short_preamble; | 2790 | bool rts, short_preamble; |
2652 | u8 max_rate_idx; | 2791 | u8 max_rate_idx; |
2653 | u32 rate_idx_mask; | 2792 | u32 rate_idx_mask; |
2654 | bool ap; | 2793 | bool bss; |
2655 | }; | 2794 | }; |
2656 | 2795 | ||
2657 | struct rate_control_ops { | 2796 | struct rate_control_ops { |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 895997bc2ead..e0e594f8e9d9 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -42,9 +42,6 @@ enum { | |||
42 | #define ND_REACHABLE_TIME (30*HZ) | 42 | #define ND_REACHABLE_TIME (30*HZ) |
43 | #define ND_RETRANS_TIMER HZ | 43 | #define ND_RETRANS_TIMER HZ |
44 | 44 | ||
45 | #define ND_MIN_RANDOM_FACTOR (1/2) | ||
46 | #define ND_MAX_RANDOM_FACTOR (3/2) | ||
47 | |||
48 | #ifdef __KERNEL__ | 45 | #ifdef __KERNEL__ |
49 | 46 | ||
50 | #include <linux/compiler.h> | 47 | #include <linux/compiler.h> |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 815b2ce9f4a4..4014b623880c 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -303,7 +303,7 @@ static inline void neigh_confirm(struct neighbour *neigh) | |||
303 | 303 | ||
304 | static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) | 304 | static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) |
305 | { | 305 | { |
306 | unsigned long now = ACCESS_ONCE(jiffies); | 306 | unsigned long now = jiffies; |
307 | 307 | ||
308 | if (neigh->used != now) | 308 | if (neigh->used != now) |
309 | neigh->used = now; | 309 | neigh->used = now; |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 1bf812b21fb7..b3b4a34cb2cc 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <net/netns/conntrack.h> | 20 | #include <net/netns/conntrack.h> |
21 | #endif | 21 | #endif |
22 | #include <net/netns/xfrm.h> | 22 | #include <net/netns/xfrm.h> |
23 | #include <net/netns/ip_vs.h> | ||
23 | 24 | ||
24 | struct proc_dir_entry; | 25 | struct proc_dir_entry; |
25 | struct net_device; | 26 | struct net_device; |
@@ -94,6 +95,7 @@ struct net { | |||
94 | #ifdef CONFIG_XFRM | 95 | #ifdef CONFIG_XFRM |
95 | struct netns_xfrm xfrm; | 96 | struct netns_xfrm xfrm; |
96 | #endif | 97 | #endif |
98 | struct netns_ipvs *ipvs; | ||
97 | }; | 99 | }; |
98 | 100 | ||
99 | 101 | ||
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 8a58901c96d3..2bc344c98215 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -311,6 +311,8 @@ static inline int nf_ct_is_untracked(const struct nf_conn *ct) | |||
311 | extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); | 311 | extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); |
312 | extern unsigned int nf_conntrack_htable_size; | 312 | extern unsigned int nf_conntrack_htable_size; |
313 | extern unsigned int nf_conntrack_max; | 313 | extern unsigned int nf_conntrack_max; |
314 | extern unsigned int nf_conntrack_hash_rnd; | ||
315 | void init_nf_conntrack_hash_rnd(void); | ||
314 | 316 | ||
315 | #define NF_CT_STAT_INC(net, count) \ | 317 | #define NF_CT_STAT_INC(net, count) \ |
316 | __this_cpu_inc((net)->ct.stat->count) | 318 | __this_cpu_inc((net)->ct.stat->count) |
diff --git a/include/net/netlink.h b/include/net/netlink.h index 9801c55de5d6..373f1a900cf4 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -225,13 +225,15 @@ extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb, | |||
225 | u32 pid, unsigned int group, int report, | 225 | u32 pid, unsigned int group, int report, |
226 | gfp_t flags); | 226 | gfp_t flags); |
227 | 227 | ||
228 | extern int nla_validate(struct nlattr *head, int len, int maxtype, | 228 | extern int nla_validate(const struct nlattr *head, |
229 | int len, int maxtype, | ||
229 | const struct nla_policy *policy); | 230 | const struct nla_policy *policy); |
230 | extern int nla_parse(struct nlattr *tb[], int maxtype, | 231 | extern int nla_parse(struct nlattr **tb, int maxtype, |
231 | struct nlattr *head, int len, | 232 | const struct nlattr *head, int len, |
232 | const struct nla_policy *policy); | 233 | const struct nla_policy *policy); |
233 | extern int nla_policy_len(const struct nla_policy *, int); | 234 | extern int nla_policy_len(const struct nla_policy *, int); |
234 | extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); | 235 | extern struct nlattr * nla_find(const struct nlattr *head, |
236 | int len, int attrtype); | ||
235 | extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, | 237 | extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, |
236 | size_t dstsize); | 238 | size_t dstsize); |
237 | extern int nla_memcpy(void *dest, const struct nlattr *src, int count); | 239 | extern int nla_memcpy(void *dest, const struct nlattr *src, int count); |
@@ -346,7 +348,8 @@ static inline int nlmsg_ok(const struct nlmsghdr *nlh, int remaining) | |||
346 | * Returns the next netlink message in the message stream and | 348 | * Returns the next netlink message in the message stream and |
347 | * decrements remaining by the size of the current message. | 349 | * decrements remaining by the size of the current message. |
348 | */ | 350 | */ |
349 | static inline struct nlmsghdr *nlmsg_next(struct nlmsghdr *nlh, int *remaining) | 351 | static inline struct nlmsghdr * |
352 | nlmsg_next(const struct nlmsghdr *nlh, int *remaining) | ||
350 | { | 353 | { |
351 | int totlen = NLMSG_ALIGN(nlh->nlmsg_len); | 354 | int totlen = NLMSG_ALIGN(nlh->nlmsg_len); |
352 | 355 | ||
@@ -398,7 +401,8 @@ static inline struct nlattr *nlmsg_find_attr(const struct nlmsghdr *nlh, | |||
398 | * @maxtype: maximum attribute type to be expected | 401 | * @maxtype: maximum attribute type to be expected |
399 | * @policy: validation policy | 402 | * @policy: validation policy |
400 | */ | 403 | */ |
401 | static inline int nlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype, | 404 | static inline int nlmsg_validate(const struct nlmsghdr *nlh, |
405 | int hdrlen, int maxtype, | ||
402 | const struct nla_policy *policy) | 406 | const struct nla_policy *policy) |
403 | { | 407 | { |
404 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) | 408 | if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) |
@@ -727,7 +731,8 @@ static inline struct nlattr *nla_next(const struct nlattr *nla, int *remaining) | |||
727 | * | 731 | * |
728 | * Returns the first attribute which matches the specified type. | 732 | * Returns the first attribute which matches the specified type. |
729 | */ | 733 | */ |
730 | static inline struct nlattr *nla_find_nested(struct nlattr *nla, int attrtype) | 734 | static inline struct nlattr * |
735 | nla_find_nested(const struct nlattr *nla, int attrtype) | ||
731 | { | 736 | { |
732 | return nla_find(nla_data(nla), nla_len(nla), attrtype); | 737 | return nla_find(nla_data(nla), nla_len(nla), attrtype); |
733 | } | 738 | } |
@@ -1032,7 +1037,7 @@ static inline void nla_nest_cancel(struct sk_buff *skb, struct nlattr *start) | |||
1032 | * | 1037 | * |
1033 | * Returns 0 on success or a negative error code. | 1038 | * Returns 0 on success or a negative error code. |
1034 | */ | 1039 | */ |
1035 | static inline int nla_validate_nested(struct nlattr *start, int maxtype, | 1040 | static inline int nla_validate_nested(const struct nlattr *start, int maxtype, |
1036 | const struct nla_policy *policy) | 1041 | const struct nla_policy *policy) |
1037 | { | 1042 | { |
1038 | return nla_validate(nla_data(start), nla_len(start), maxtype, policy); | 1043 | return nla_validate(nla_data(start), nla_len(start), maxtype, policy); |
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h index 81a31c0db3e7..3419bf5cd154 100644 --- a/include/net/netns/generic.h +++ b/include/net/netns/generic.h | |||
@@ -30,7 +30,7 @@ struct net_generic { | |||
30 | void *ptr[0]; | 30 | void *ptr[0]; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | static inline void *net_generic(struct net *net, int id) | 33 | static inline void *net_generic(const struct net *net, int id) |
34 | { | 34 | { |
35 | struct net_generic *ng; | 35 | struct net_generic *ng; |
36 | void *ptr; | 36 | void *ptr; |
diff --git a/include/net/netns/ip_vs.h b/include/net/netns/ip_vs.h new file mode 100644 index 000000000000..259ebac904bf --- /dev/null +++ b/include/net/netns/ip_vs.h | |||
@@ -0,0 +1,143 @@ | |||
1 | /* | ||
2 | * IP Virtual Server | ||
3 | * Data structure for network namspace | ||
4 | * | ||
5 | */ | ||
6 | |||
7 | #ifndef IP_VS_H_ | ||
8 | #define IP_VS_H_ | ||
9 | |||
10 | #include <linux/list.h> | ||
11 | #include <linux/mutex.h> | ||
12 | #include <linux/list_nulls.h> | ||
13 | #include <linux/ip_vs.h> | ||
14 | #include <asm/atomic.h> | ||
15 | #include <linux/in.h> | ||
16 | |||
17 | struct ip_vs_stats; | ||
18 | struct ip_vs_sync_buff; | ||
19 | struct ctl_table_header; | ||
20 | |||
21 | struct netns_ipvs { | ||
22 | int gen; /* Generation */ | ||
23 | /* | ||
24 | * Hash table: for real service lookups | ||
25 | */ | ||
26 | #define IP_VS_RTAB_BITS 4 | ||
27 | #define IP_VS_RTAB_SIZE (1 << IP_VS_RTAB_BITS) | ||
28 | #define IP_VS_RTAB_MASK (IP_VS_RTAB_SIZE - 1) | ||
29 | |||
30 | struct list_head rs_table[IP_VS_RTAB_SIZE]; | ||
31 | /* ip_vs_app */ | ||
32 | struct list_head app_list; | ||
33 | struct mutex app_mutex; | ||
34 | struct lock_class_key app_key; /* mutex debuging */ | ||
35 | |||
36 | /* ip_vs_proto */ | ||
37 | #define IP_VS_PROTO_TAB_SIZE 32 /* must be power of 2 */ | ||
38 | struct ip_vs_proto_data *proto_data_table[IP_VS_PROTO_TAB_SIZE]; | ||
39 | /* ip_vs_proto_tcp */ | ||
40 | #ifdef CONFIG_IP_VS_PROTO_TCP | ||
41 | #define TCP_APP_TAB_BITS 4 | ||
42 | #define TCP_APP_TAB_SIZE (1 << TCP_APP_TAB_BITS) | ||
43 | #define TCP_APP_TAB_MASK (TCP_APP_TAB_SIZE - 1) | ||
44 | struct list_head tcp_apps[TCP_APP_TAB_SIZE]; | ||
45 | spinlock_t tcp_app_lock; | ||
46 | #endif | ||
47 | /* ip_vs_proto_udp */ | ||
48 | #ifdef CONFIG_IP_VS_PROTO_UDP | ||
49 | #define UDP_APP_TAB_BITS 4 | ||
50 | #define UDP_APP_TAB_SIZE (1 << UDP_APP_TAB_BITS) | ||
51 | #define UDP_APP_TAB_MASK (UDP_APP_TAB_SIZE - 1) | ||
52 | struct list_head udp_apps[UDP_APP_TAB_SIZE]; | ||
53 | spinlock_t udp_app_lock; | ||
54 | #endif | ||
55 | /* ip_vs_proto_sctp */ | ||
56 | #ifdef CONFIG_IP_VS_PROTO_SCTP | ||
57 | #define SCTP_APP_TAB_BITS 4 | ||
58 | #define SCTP_APP_TAB_SIZE (1 << SCTP_APP_TAB_BITS) | ||
59 | #define SCTP_APP_TAB_MASK (SCTP_APP_TAB_SIZE - 1) | ||
60 | /* Hash table for SCTP application incarnations */ | ||
61 | struct list_head sctp_apps[SCTP_APP_TAB_SIZE]; | ||
62 | spinlock_t sctp_app_lock; | ||
63 | #endif | ||
64 | /* ip_vs_conn */ | ||
65 | atomic_t conn_count; /* connection counter */ | ||
66 | |||
67 | /* ip_vs_ctl */ | ||
68 | struct ip_vs_stats *tot_stats; /* Statistics & est. */ | ||
69 | struct ip_vs_cpu_stats __percpu *cpustats; /* Stats per cpu */ | ||
70 | seqcount_t *ustats_seq; /* u64 read retry */ | ||
71 | |||
72 | int num_services; /* no of virtual services */ | ||
73 | /* 1/rate drop and drop-entry variables */ | ||
74 | struct delayed_work defense_work; /* Work handler */ | ||
75 | int drop_rate; | ||
76 | int drop_counter; | ||
77 | atomic_t dropentry; | ||
78 | /* locks in ctl.c */ | ||
79 | spinlock_t dropentry_lock; /* drop entry handling */ | ||
80 | spinlock_t droppacket_lock; /* drop packet handling */ | ||
81 | spinlock_t securetcp_lock; /* state and timeout tables */ | ||
82 | rwlock_t rs_lock; /* real services table */ | ||
83 | /* semaphore for IPVS sockopts. And, [gs]etsockopt may sleep. */ | ||
84 | struct lock_class_key ctl_key; /* ctl_mutex debuging */ | ||
85 | /* Trash for destinations */ | ||
86 | struct list_head dest_trash; | ||
87 | /* Service counters */ | ||
88 | atomic_t ftpsvc_counter; | ||
89 | atomic_t nullsvc_counter; | ||
90 | |||
91 | /* sys-ctl struct */ | ||
92 | struct ctl_table_header *sysctl_hdr; | ||
93 | struct ctl_table *sysctl_tbl; | ||
94 | /* sysctl variables */ | ||
95 | int sysctl_amemthresh; | ||
96 | int sysctl_am_droprate; | ||
97 | int sysctl_drop_entry; | ||
98 | int sysctl_drop_packet; | ||
99 | int sysctl_secure_tcp; | ||
100 | #ifdef CONFIG_IP_VS_NFCT | ||
101 | int sysctl_conntrack; | ||
102 | #endif | ||
103 | int sysctl_snat_reroute; | ||
104 | int sysctl_sync_ver; | ||
105 | int sysctl_cache_bypass; | ||
106 | int sysctl_expire_nodest_conn; | ||
107 | int sysctl_expire_quiescent_template; | ||
108 | int sysctl_sync_threshold[2]; | ||
109 | int sysctl_nat_icmp_send; | ||
110 | |||
111 | /* ip_vs_lblc */ | ||
112 | int sysctl_lblc_expiration; | ||
113 | struct ctl_table_header *lblc_ctl_header; | ||
114 | struct ctl_table *lblc_ctl_table; | ||
115 | /* ip_vs_lblcr */ | ||
116 | int sysctl_lblcr_expiration; | ||
117 | struct ctl_table_header *lblcr_ctl_header; | ||
118 | struct ctl_table *lblcr_ctl_table; | ||
119 | /* ip_vs_est */ | ||
120 | struct list_head est_list; /* estimator list */ | ||
121 | spinlock_t est_lock; | ||
122 | struct timer_list est_timer; /* Estimation timer */ | ||
123 | /* ip_vs_sync */ | ||
124 | struct list_head sync_queue; | ||
125 | spinlock_t sync_lock; | ||
126 | struct ip_vs_sync_buff *sync_buff; | ||
127 | spinlock_t sync_buff_lock; | ||
128 | struct sockaddr_in sync_mcast_addr; | ||
129 | struct task_struct *master_thread; | ||
130 | struct task_struct *backup_thread; | ||
131 | int send_mesg_maxlen; | ||
132 | int recv_mesg_maxlen; | ||
133 | volatile int sync_state; | ||
134 | volatile int master_syncid; | ||
135 | volatile int backup_syncid; | ||
136 | /* multicast interface name */ | ||
137 | char master_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | ||
138 | char backup_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | ||
139 | /* net name space ptr */ | ||
140 | struct net *net; /* Needed by timer routines */ | ||
141 | }; | ||
142 | |||
143 | #endif /* IP_VS_H_ */ | ||
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index dd3031aed9d5..9fcc680ab6b9 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h | |||
@@ -323,7 +323,9 @@ static inline unsigned char * tcf_get_base_ptr(struct sk_buff *skb, int layer) | |||
323 | static inline int tcf_valid_offset(const struct sk_buff *skb, | 323 | static inline int tcf_valid_offset(const struct sk_buff *skb, |
324 | const unsigned char *ptr, const int len) | 324 | const unsigned char *ptr, const int len) |
325 | { | 325 | { |
326 | return unlikely((ptr + len) < skb_tail_pointer(skb) && ptr > skb->head); | 326 | return likely((ptr + len) <= skb_tail_pointer(skb) && |
327 | ptr >= skb->head && | ||
328 | (ptr <= (ptr + len))); | ||
327 | } | 329 | } |
328 | 330 | ||
329 | #ifdef CONFIG_NET_CLS_IND | 331 | #ifdef CONFIG_NET_CLS_IND |
diff --git a/include/net/regulatory.h b/include/net/regulatory.h index 9e103a4e91ee..356d6e3dc20a 100644 --- a/include/net/regulatory.h +++ b/include/net/regulatory.h | |||
@@ -43,6 +43,12 @@ enum environment_cap { | |||
43 | * @intersect: indicates whether the wireless core should intersect | 43 | * @intersect: indicates whether the wireless core should intersect |
44 | * the requested regulatory domain with the presently set regulatory | 44 | * the requested regulatory domain with the presently set regulatory |
45 | * domain. | 45 | * domain. |
46 | * @processed: indicates whether or not this requests has already been | ||
47 | * processed. When the last request is processed it means that the | ||
48 | * currently regulatory domain set on cfg80211 is updated from | ||
49 | * CRDA and can be used by other regulatory requests. When a | ||
50 | * the last request is not yet processed we must yield until it | ||
51 | * is processed before processing any new requests. | ||
46 | * @country_ie_checksum: checksum of the last processed and accepted | 52 | * @country_ie_checksum: checksum of the last processed and accepted |
47 | * country IE | 53 | * country IE |
48 | * @country_ie_env: lets us know if the AP is telling us we are outdoor, | 54 | * @country_ie_env: lets us know if the AP is telling us we are outdoor, |
@@ -54,6 +60,7 @@ struct regulatory_request { | |||
54 | enum nl80211_reg_initiator initiator; | 60 | enum nl80211_reg_initiator initiator; |
55 | char alpha2[2]; | 61 | char alpha2[2]; |
56 | bool intersect; | 62 | bool intersect; |
63 | bool processed; | ||
57 | enum environment_cap country_ie_env; | 64 | enum environment_cap country_ie_env; |
58 | struct list_head list; | 65 | struct list_head list; |
59 | }; | 66 | }; |
diff --git a/include/net/route.h b/include/net/route.h index 5cd46d1c0e14..93e10c453f6b 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -114,7 +114,7 @@ extern int ip_rt_init(void); | |||
114 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, | 114 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, |
115 | __be32 src, struct net_device *dev); | 115 | __be32 src, struct net_device *dev); |
116 | extern void rt_cache_flush(struct net *net, int how); | 116 | extern void rt_cache_flush(struct net *net, int how); |
117 | extern void rt_cache_flush_batch(void); | 117 | extern void rt_cache_flush_batch(struct net *net); |
118 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); | 118 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); |
119 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); | 119 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); |
120 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); | 120 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); |
@@ -169,14 +169,12 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, | |||
169 | { | 169 | { |
170 | struct flowi fl = { .oif = oif, | 170 | struct flowi fl = { .oif = oif, |
171 | .mark = sk->sk_mark, | 171 | .mark = sk->sk_mark, |
172 | .nl_u = { .ip4_u = { .daddr = dst, | 172 | .fl4_dst = dst, |
173 | .saddr = src, | 173 | .fl4_src = src, |
174 | .tos = tos } }, | 174 | .fl4_tos = tos, |
175 | .proto = protocol, | 175 | .proto = protocol, |
176 | .uli_u = { .ports = | 176 | .fl_ip_sport = sport, |
177 | { .sport = sport, | 177 | .fl_ip_dport = dport }; |
178 | .dport = dport } } }; | ||
179 | |||
180 | int err; | 178 | int err; |
181 | struct net *net = sock_net(sk); | 179 | struct net *net = sock_net(sk); |
182 | 180 | ||
@@ -233,4 +231,15 @@ static inline int inet_iif(const struct sk_buff *skb) | |||
233 | return skb_rtable(skb)->rt_iif; | 231 | return skb_rtable(skb)->rt_iif; |
234 | } | 232 | } |
235 | 233 | ||
234 | extern int sysctl_ip_default_ttl; | ||
235 | |||
236 | static inline int ip4_dst_hoplimit(const struct dst_entry *dst) | ||
237 | { | ||
238 | int hoplimit = dst_metric_raw(dst, RTAX_HOPLIMIT); | ||
239 | |||
240 | if (hoplimit == 0) | ||
241 | hoplimit = sysctl_ip_default_ttl; | ||
242 | return hoplimit; | ||
243 | } | ||
244 | |||
236 | #endif /* _ROUTE_H */ | 245 | #endif /* _ROUTE_H */ |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index e013c68bfb00..4093ca78cf60 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
@@ -83,6 +83,41 @@ extern void __rtnl_link_unregister(struct rtnl_link_ops *ops); | |||
83 | extern int rtnl_link_register(struct rtnl_link_ops *ops); | 83 | extern int rtnl_link_register(struct rtnl_link_ops *ops); |
84 | extern void rtnl_link_unregister(struct rtnl_link_ops *ops); | 84 | extern void rtnl_link_unregister(struct rtnl_link_ops *ops); |
85 | 85 | ||
86 | /** | ||
87 | * struct rtnl_af_ops - rtnetlink address family operations | ||
88 | * | ||
89 | * @list: Used internally | ||
90 | * @family: Address family | ||
91 | * @fill_link_af: Function to fill IFLA_AF_SPEC with address family | ||
92 | * specific netlink attributes. | ||
93 | * @get_link_af_size: Function to calculate size of address family specific | ||
94 | * netlink attributes exlusive the container attribute. | ||
95 | * @validate_link_af: Validate a IFLA_AF_SPEC attribute, must check attr | ||
96 | * for invalid configuration settings. | ||
97 | * @set_link_af: Function to parse a IFLA_AF_SPEC attribute and modify | ||
98 | * net_device accordingly. | ||
99 | */ | ||
100 | struct rtnl_af_ops { | ||
101 | struct list_head list; | ||
102 | int family; | ||
103 | |||
104 | int (*fill_link_af)(struct sk_buff *skb, | ||
105 | const struct net_device *dev); | ||
106 | size_t (*get_link_af_size)(const struct net_device *dev); | ||
107 | |||
108 | int (*validate_link_af)(const struct net_device *dev, | ||
109 | const struct nlattr *attr); | ||
110 | int (*set_link_af)(struct net_device *dev, | ||
111 | const struct nlattr *attr); | ||
112 | }; | ||
113 | |||
114 | extern int __rtnl_af_register(struct rtnl_af_ops *ops); | ||
115 | extern void __rtnl_af_unregister(struct rtnl_af_ops *ops); | ||
116 | |||
117 | extern int rtnl_af_register(struct rtnl_af_ops *ops); | ||
118 | extern void rtnl_af_unregister(struct rtnl_af_ops *ops); | ||
119 | |||
120 | |||
86 | extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); | 121 | extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); |
87 | extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net, | 122 | extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net, |
88 | char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]); | 123 | char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index ea1f8a83160d..0af57ebae762 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -321,6 +321,7 @@ extern void dev_init_scheduler(struct net_device *dev); | |||
321 | extern void dev_shutdown(struct net_device *dev); | 321 | extern void dev_shutdown(struct net_device *dev); |
322 | extern void dev_activate(struct net_device *dev); | 322 | extern void dev_activate(struct net_device *dev); |
323 | extern void dev_deactivate(struct net_device *dev); | 323 | extern void dev_deactivate(struct net_device *dev); |
324 | extern void dev_deactivate_many(struct list_head *head); | ||
324 | extern struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, | 325 | extern struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, |
325 | struct Qdisc *qdisc); | 326 | struct Qdisc *qdisc); |
326 | extern void qdisc_reset(struct Qdisc *qdisc); | 327 | extern void qdisc_reset(struct Qdisc *qdisc); |
@@ -610,11 +611,7 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask, | |||
610 | { | 611 | { |
611 | struct sk_buff *n; | 612 | struct sk_buff *n; |
612 | 613 | ||
613 | if ((action == TC_ACT_STOLEN || action == TC_ACT_QUEUED) && | 614 | n = skb_clone(skb, gfp_mask); |
614 | !skb_shared(skb)) | ||
615 | n = skb_get(skb); | ||
616 | else | ||
617 | n = skb_clone(skb, gfp_mask); | ||
618 | 615 | ||
619 | if (n) { | 616 | if (n) { |
620 | n->tc_verd = SET_TC_VERD(n->tc_verd, 0); | 617 | n->tc_verd = SET_TC_VERD(n->tc_verd, 0); |
diff --git a/include/net/scm.h b/include/net/scm.h index 31656506d967..745460fa2f02 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
@@ -10,11 +10,12 @@ | |||
10 | /* Well, we should have at least one descriptor open | 10 | /* Well, we should have at least one descriptor open |
11 | * to accept passed FDs 8) | 11 | * to accept passed FDs 8) |
12 | */ | 12 | */ |
13 | #define SCM_MAX_FD 255 | 13 | #define SCM_MAX_FD 253 |
14 | 14 | ||
15 | struct scm_fp_list { | 15 | struct scm_fp_list { |
16 | struct list_head list; | 16 | struct list_head list; |
17 | int count; | 17 | short count; |
18 | short max; | ||
18 | struct file *fp[SCM_MAX_FD]; | 19 | struct file *fp[SCM_MAX_FD]; |
19 | }; | 20 | }; |
20 | 21 | ||
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 2c55a7ea20af..c01dc99def07 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
@@ -111,9 +111,6 @@ typedef enum { | |||
111 | SCTP_CMD_LAST | 111 | SCTP_CMD_LAST |
112 | } sctp_verb_t; | 112 | } sctp_verb_t; |
113 | 113 | ||
114 | #define SCTP_CMD_MAX (SCTP_CMD_LAST - 1) | ||
115 | #define SCTP_CMD_NUM_VERBS (SCTP_CMD_MAX + 1) | ||
116 | |||
117 | /* How many commands can you put in an sctp_cmd_seq_t? | 114 | /* How many commands can you put in an sctp_cmd_seq_t? |
118 | * This is a rather arbitrary number, ideally derived from a careful | 115 | * This is a rather arbitrary number, ideally derived from a careful |
119 | * analysis of the state functions, but in reality just taken from | 116 | * analysis of the state functions, but in reality just taken from |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 63908840eef0..c70d8ccc55cb 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -61,7 +61,6 @@ enum { SCTP_DEFAULT_INSTREAMS = SCTP_MAX_STREAM }; | |||
61 | * symbols. CIDs are dense through SCTP_CID_BASE_MAX. | 61 | * symbols. CIDs are dense through SCTP_CID_BASE_MAX. |
62 | */ | 62 | */ |
63 | #define SCTP_CID_BASE_MAX SCTP_CID_SHUTDOWN_COMPLETE | 63 | #define SCTP_CID_BASE_MAX SCTP_CID_SHUTDOWN_COMPLETE |
64 | #define SCTP_CID_MAX SCTP_CID_ASCONF_ACK | ||
65 | 64 | ||
66 | #define SCTP_NUM_BASE_CHUNK_TYPES (SCTP_CID_BASE_MAX + 1) | 65 | #define SCTP_NUM_BASE_CHUNK_TYPES (SCTP_CID_BASE_MAX + 1) |
67 | 66 | ||
@@ -86,9 +85,6 @@ typedef enum { | |||
86 | 85 | ||
87 | } sctp_event_t; | 86 | } sctp_event_t; |
88 | 87 | ||
89 | #define SCTP_EVENT_T_MAX SCTP_EVENT_T_PRIMITIVE | ||
90 | #define SCTP_EVENT_T_NUM (SCTP_EVENT_T_MAX + 1) | ||
91 | |||
92 | /* As a convenience for the state machine, we append SCTP_EVENT_* and | 88 | /* As a convenience for the state machine, we append SCTP_EVENT_* and |
93 | * SCTP_ULP_* to the list of possible chunks. | 89 | * SCTP_ULP_* to the list of possible chunks. |
94 | */ | 90 | */ |
@@ -162,9 +158,6 @@ SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE, sctp_event_primitive_t, primitive) | |||
162 | - (unsigned long)(c->chunk_hdr)\ | 158 | - (unsigned long)(c->chunk_hdr)\ |
163 | - sizeof(sctp_data_chunk_t))) | 159 | - sizeof(sctp_data_chunk_t))) |
164 | 160 | ||
165 | #define SCTP_MAX_ERROR_CAUSE SCTP_ERROR_NONEXIST_IP | ||
166 | #define SCTP_NUM_ERROR_CAUSE 10 | ||
167 | |||
168 | /* Internal error codes */ | 161 | /* Internal error codes */ |
169 | typedef enum { | 162 | typedef enum { |
170 | 163 | ||
@@ -266,7 +259,6 @@ enum { SCTP_ARBITRARY_COOKIE_ECHO_LEN = 200 }; | |||
266 | #define SCTP_TSN_MAP_INITIAL BITS_PER_LONG | 259 | #define SCTP_TSN_MAP_INITIAL BITS_PER_LONG |
267 | #define SCTP_TSN_MAP_INCREMENT SCTP_TSN_MAP_INITIAL | 260 | #define SCTP_TSN_MAP_INCREMENT SCTP_TSN_MAP_INITIAL |
268 | #define SCTP_TSN_MAP_SIZE 4096 | 261 | #define SCTP_TSN_MAP_SIZE 4096 |
269 | #define SCTP_TSN_MAX_GAP 65535 | ||
270 | 262 | ||
271 | /* We will not record more than this many duplicate TSNs between two | 263 | /* We will not record more than this many duplicate TSNs between two |
272 | * SACKs. The minimum PMTU is 576. Remove all the headers and there | 264 | * SACKs. The minimum PMTU is 576. Remove all the headers and there |
@@ -301,9 +293,6 @@ enum { SCTP_MAX_GABS = 16 }; | |||
301 | 293 | ||
302 | #define SCTP_CLOCK_GRANULARITY 1 /* 1 jiffy */ | 294 | #define SCTP_CLOCK_GRANULARITY 1 /* 1 jiffy */ |
303 | 295 | ||
304 | #define SCTP_DEF_MAX_INIT 6 | ||
305 | #define SCTP_DEF_MAX_SEND 10 | ||
306 | |||
307 | #define SCTP_DEFAULT_COOKIE_LIFE (60 * 1000) /* 60 seconds */ | 296 | #define SCTP_DEFAULT_COOKIE_LIFE (60 * 1000) /* 60 seconds */ |
308 | 297 | ||
309 | #define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ | 298 | #define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ |
@@ -317,9 +306,6 @@ enum { SCTP_MAX_GABS = 16 }; | |||
317 | */ | 306 | */ |
318 | #define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */ | 307 | #define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */ |
319 | #define SCTP_HOW_MANY_SECRETS 2 /* How many secrets I keep */ | 308 | #define SCTP_HOW_MANY_SECRETS 2 /* How many secrets I keep */ |
320 | #define SCTP_HOW_LONG_COOKIE_LIVE 3600 /* How many seconds the current | ||
321 | * secret will live? | ||
322 | */ | ||
323 | #define SCTP_SECRET_SIZE 32 /* Number of octets in a 256 bits. */ | 309 | #define SCTP_SECRET_SIZE 32 /* Number of octets in a 256 bits. */ |
324 | 310 | ||
325 | #define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */ | 311 | #define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */ |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 69fef4fb79c0..cc9185ca8fd1 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -261,8 +261,6 @@ extern struct sctp_globals { | |||
261 | #define sctp_assoc_hashsize (sctp_globals.assoc_hashsize) | 261 | #define sctp_assoc_hashsize (sctp_globals.assoc_hashsize) |
262 | #define sctp_assoc_hashtable (sctp_globals.assoc_hashtable) | 262 | #define sctp_assoc_hashtable (sctp_globals.assoc_hashtable) |
263 | #define sctp_port_hashsize (sctp_globals.port_hashsize) | 263 | #define sctp_port_hashsize (sctp_globals.port_hashsize) |
264 | #define sctp_port_rover (sctp_globals.port_rover) | ||
265 | #define sctp_port_alloc_lock (sctp_globals.port_alloc_lock) | ||
266 | #define sctp_port_hashtable (sctp_globals.port_hashtable) | 264 | #define sctp_port_hashtable (sctp_globals.port_hashtable) |
267 | #define sctp_local_addr_list (sctp_globals.local_addr_list) | 265 | #define sctp_local_addr_list (sctp_globals.local_addr_list) |
268 | #define sctp_local_addr_lock (sctp_globals.addr_list_lock) | 266 | #define sctp_local_addr_lock (sctp_globals.addr_list_lock) |
diff --git a/include/net/snmp.h b/include/net/snmp.h index a0e61806d480..762e2abce889 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
@@ -60,9 +60,7 @@ struct ipstats_mib { | |||
60 | }; | 60 | }; |
61 | 61 | ||
62 | /* ICMP */ | 62 | /* ICMP */ |
63 | #define ICMP_MIB_DUMMY __ICMP_MIB_MAX | 63 | #define ICMP_MIB_MAX __ICMP_MIB_MAX |
64 | #define ICMP_MIB_MAX (__ICMP_MIB_MAX + 1) | ||
65 | |||
66 | struct icmp_mib { | 64 | struct icmp_mib { |
67 | unsigned long mibs[ICMP_MIB_MAX]; | 65 | unsigned long mibs[ICMP_MIB_MAX]; |
68 | }; | 66 | }; |
diff --git a/include/net/sock.h b/include/net/sock.h index c7a736228ca2..21a02f7e4f45 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -57,7 +57,7 @@ | |||
57 | #include <linux/rculist_nulls.h> | 57 | #include <linux/rculist_nulls.h> |
58 | #include <linux/poll.h> | 58 | #include <linux/poll.h> |
59 | 59 | ||
60 | #include <asm/atomic.h> | 60 | #include <linux/atomic.h> |
61 | #include <net/dst.h> | 61 | #include <net/dst.h> |
62 | #include <net/checksum.h> | 62 | #include <net/checksum.h> |
63 | 63 | ||
@@ -105,10 +105,8 @@ struct net; | |||
105 | 105 | ||
106 | /** | 106 | /** |
107 | * struct sock_common - minimal network layer representation of sockets | 107 | * struct sock_common - minimal network layer representation of sockets |
108 | * @skc_node: main hash linkage for various protocol lookup tables | 108 | * @skc_daddr: Foreign IPv4 addr |
109 | * @skc_nulls_node: main hash linkage for TCP/UDP/UDP-Lite protocol | 109 | * @skc_rcv_saddr: Bound local IPv4 addr |
110 | * @skc_refcnt: reference count | ||
111 | * @skc_tx_queue_mapping: tx queue number for this connection | ||
112 | * @skc_hash: hash value used with various protocol lookup tables | 110 | * @skc_hash: hash value used with various protocol lookup tables |
113 | * @skc_u16hashes: two u16 hash values used by UDP lookup tables | 111 | * @skc_u16hashes: two u16 hash values used by UDP lookup tables |
114 | * @skc_family: network address family | 112 | * @skc_family: network address family |
@@ -119,20 +117,20 @@ struct net; | |||
119 | * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol | 117 | * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol |
120 | * @skc_prot: protocol handlers inside a network family | 118 | * @skc_prot: protocol handlers inside a network family |
121 | * @skc_net: reference to the network namespace of this socket | 119 | * @skc_net: reference to the network namespace of this socket |
120 | * @skc_node: main hash linkage for various protocol lookup tables | ||
121 | * @skc_nulls_node: main hash linkage for TCP/UDP/UDP-Lite protocol | ||
122 | * @skc_tx_queue_mapping: tx queue number for this connection | ||
123 | * @skc_refcnt: reference count | ||
122 | * | 124 | * |
123 | * This is the minimal network layer representation of sockets, the header | 125 | * This is the minimal network layer representation of sockets, the header |
124 | * for struct sock and struct inet_timewait_sock. | 126 | * for struct sock and struct inet_timewait_sock. |
125 | */ | 127 | */ |
126 | struct sock_common { | 128 | struct sock_common { |
127 | /* | 129 | /* skc_daddr and skc_rcv_saddr must be grouped : |
128 | * first fields are not copied in sock_copy() | 130 | * cf INET_MATCH() and INET_TW_MATCH() |
129 | */ | 131 | */ |
130 | union { | 132 | __be32 skc_daddr; |
131 | struct hlist_node skc_node; | 133 | __be32 skc_rcv_saddr; |
132 | struct hlist_nulls_node skc_nulls_node; | ||
133 | }; | ||
134 | atomic_t skc_refcnt; | ||
135 | int skc_tx_queue_mapping; | ||
136 | 134 | ||
137 | union { | 135 | union { |
138 | unsigned int skc_hash; | 136 | unsigned int skc_hash; |
@@ -150,6 +148,18 @@ struct sock_common { | |||
150 | #ifdef CONFIG_NET_NS | 148 | #ifdef CONFIG_NET_NS |
151 | struct net *skc_net; | 149 | struct net *skc_net; |
152 | #endif | 150 | #endif |
151 | /* | ||
152 | * fields between dontcopy_begin/dontcopy_end | ||
153 | * are not copied in sock_copy() | ||
154 | */ | ||
155 | int skc_dontcopy_begin[0]; | ||
156 | union { | ||
157 | struct hlist_node skc_node; | ||
158 | struct hlist_nulls_node skc_nulls_node; | ||
159 | }; | ||
160 | int skc_tx_queue_mapping; | ||
161 | atomic_t skc_refcnt; | ||
162 | int skc_dontcopy_end[0]; | ||
153 | }; | 163 | }; |
154 | 164 | ||
155 | /** | 165 | /** |
@@ -232,7 +242,8 @@ struct sock { | |||
232 | #define sk_refcnt __sk_common.skc_refcnt | 242 | #define sk_refcnt __sk_common.skc_refcnt |
233 | #define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping | 243 | #define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping |
234 | 244 | ||
235 | #define sk_copy_start __sk_common.skc_hash | 245 | #define sk_dontcopy_begin __sk_common.skc_dontcopy_begin |
246 | #define sk_dontcopy_end __sk_common.skc_dontcopy_end | ||
236 | #define sk_hash __sk_common.skc_hash | 247 | #define sk_hash __sk_common.skc_hash |
237 | #define sk_family __sk_common.skc_family | 248 | #define sk_family __sk_common.skc_family |
238 | #define sk_state __sk_common.skc_state | 249 | #define sk_state __sk_common.skc_state |
@@ -241,59 +252,67 @@ struct sock { | |||
241 | #define sk_bind_node __sk_common.skc_bind_node | 252 | #define sk_bind_node __sk_common.skc_bind_node |
242 | #define sk_prot __sk_common.skc_prot | 253 | #define sk_prot __sk_common.skc_prot |
243 | #define sk_net __sk_common.skc_net | 254 | #define sk_net __sk_common.skc_net |
244 | kmemcheck_bitfield_begin(flags); | ||
245 | unsigned int sk_shutdown : 2, | ||
246 | sk_no_check : 2, | ||
247 | sk_userlocks : 4, | ||
248 | sk_protocol : 8, | ||
249 | sk_type : 16; | ||
250 | kmemcheck_bitfield_end(flags); | ||
251 | int sk_rcvbuf; | ||
252 | socket_lock_t sk_lock; | 255 | socket_lock_t sk_lock; |
256 | struct sk_buff_head sk_receive_queue; | ||
253 | /* | 257 | /* |
254 | * The backlog queue is special, it is always used with | 258 | * The backlog queue is special, it is always used with |
255 | * the per-socket spinlock held and requires low latency | 259 | * the per-socket spinlock held and requires low latency |
256 | * access. Therefore we special case it's implementation. | 260 | * access. Therefore we special case it's implementation. |
261 | * Note : rmem_alloc is in this structure to fill a hole | ||
262 | * on 64bit arches, not because its logically part of | ||
263 | * backlog. | ||
257 | */ | 264 | */ |
258 | struct { | 265 | struct { |
259 | struct sk_buff *head; | 266 | atomic_t rmem_alloc; |
260 | struct sk_buff *tail; | 267 | int len; |
261 | int len; | 268 | struct sk_buff *head; |
269 | struct sk_buff *tail; | ||
262 | } sk_backlog; | 270 | } sk_backlog; |
271 | #define sk_rmem_alloc sk_backlog.rmem_alloc | ||
272 | int sk_forward_alloc; | ||
273 | #ifdef CONFIG_RPS | ||
274 | __u32 sk_rxhash; | ||
275 | #endif | ||
276 | atomic_t sk_drops; | ||
277 | int sk_rcvbuf; | ||
278 | |||
279 | struct sk_filter __rcu *sk_filter; | ||
263 | struct socket_wq *sk_wq; | 280 | struct socket_wq *sk_wq; |
264 | struct dst_entry *sk_dst_cache; | 281 | |
282 | #ifdef CONFIG_NET_DMA | ||
283 | struct sk_buff_head sk_async_wait_queue; | ||
284 | #endif | ||
285 | |||
265 | #ifdef CONFIG_XFRM | 286 | #ifdef CONFIG_XFRM |
266 | struct xfrm_policy *sk_policy[2]; | 287 | struct xfrm_policy *sk_policy[2]; |
267 | #endif | 288 | #endif |
289 | unsigned long sk_flags; | ||
290 | struct dst_entry *sk_dst_cache; | ||
268 | spinlock_t sk_dst_lock; | 291 | spinlock_t sk_dst_lock; |
269 | atomic_t sk_rmem_alloc; | ||
270 | atomic_t sk_wmem_alloc; | 292 | atomic_t sk_wmem_alloc; |
271 | atomic_t sk_omem_alloc; | 293 | atomic_t sk_omem_alloc; |
272 | int sk_sndbuf; | 294 | int sk_sndbuf; |
273 | struct sk_buff_head sk_receive_queue; | ||
274 | struct sk_buff_head sk_write_queue; | 295 | struct sk_buff_head sk_write_queue; |
275 | #ifdef CONFIG_NET_DMA | 296 | kmemcheck_bitfield_begin(flags); |
276 | struct sk_buff_head sk_async_wait_queue; | 297 | unsigned int sk_shutdown : 2, |
277 | #endif | 298 | sk_no_check : 2, |
299 | sk_userlocks : 4, | ||
300 | sk_protocol : 8, | ||
301 | sk_type : 16; | ||
302 | kmemcheck_bitfield_end(flags); | ||
278 | int sk_wmem_queued; | 303 | int sk_wmem_queued; |
279 | int sk_forward_alloc; | ||
280 | gfp_t sk_allocation; | 304 | gfp_t sk_allocation; |
281 | int sk_route_caps; | 305 | int sk_route_caps; |
282 | int sk_route_nocaps; | 306 | int sk_route_nocaps; |
283 | int sk_gso_type; | 307 | int sk_gso_type; |
284 | unsigned int sk_gso_max_size; | 308 | unsigned int sk_gso_max_size; |
285 | int sk_rcvlowat; | 309 | int sk_rcvlowat; |
286 | #ifdef CONFIG_RPS | ||
287 | __u32 sk_rxhash; | ||
288 | #endif | ||
289 | unsigned long sk_flags; | ||
290 | unsigned long sk_lingertime; | 310 | unsigned long sk_lingertime; |
291 | struct sk_buff_head sk_error_queue; | 311 | struct sk_buff_head sk_error_queue; |
292 | struct proto *sk_prot_creator; | 312 | struct proto *sk_prot_creator; |
293 | rwlock_t sk_callback_lock; | 313 | rwlock_t sk_callback_lock; |
294 | int sk_err, | 314 | int sk_err, |
295 | sk_err_soft; | 315 | sk_err_soft; |
296 | atomic_t sk_drops; | ||
297 | unsigned short sk_ack_backlog; | 316 | unsigned short sk_ack_backlog; |
298 | unsigned short sk_max_ack_backlog; | 317 | unsigned short sk_max_ack_backlog; |
299 | __u32 sk_priority; | 318 | __u32 sk_priority; |
@@ -301,7 +320,6 @@ struct sock { | |||
301 | const struct cred *sk_peer_cred; | 320 | const struct cred *sk_peer_cred; |
302 | long sk_rcvtimeo; | 321 | long sk_rcvtimeo; |
303 | long sk_sndtimeo; | 322 | long sk_sndtimeo; |
304 | struct sk_filter __rcu *sk_filter; | ||
305 | void *sk_protinfo; | 323 | void *sk_protinfo; |
306 | struct timer_list sk_timer; | 324 | struct timer_list sk_timer; |
307 | ktime_t sk_stamp; | 325 | ktime_t sk_stamp; |
@@ -509,9 +527,6 @@ static __inline__ void sk_add_bind_node(struct sock *sk, | |||
509 | #define sk_nulls_for_each_from(__sk, node) \ | 527 | #define sk_nulls_for_each_from(__sk, node) \ |
510 | if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \ | 528 | if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \ |
511 | hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node) | 529 | hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node) |
512 | #define sk_for_each_continue(__sk, node) \ | ||
513 | if (__sk && ({ node = &(__sk)->sk_node; 1; })) \ | ||
514 | hlist_for_each_entry_continue(__sk, node, sk_node) | ||
515 | #define sk_for_each_safe(__sk, node, tmp, list) \ | 530 | #define sk_for_each_safe(__sk, node, tmp, list) \ |
516 | hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node) | 531 | hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node) |
517 | #define sk_for_each_bound(__sk, node, list) \ | 532 | #define sk_for_each_bound(__sk, node, list) \ |
@@ -754,6 +769,7 @@ struct proto { | |||
754 | void (*unhash)(struct sock *sk); | 769 | void (*unhash)(struct sock *sk); |
755 | void (*rehash)(struct sock *sk); | 770 | void (*rehash)(struct sock *sk); |
756 | int (*get_port)(struct sock *sk, unsigned short snum); | 771 | int (*get_port)(struct sock *sk, unsigned short snum); |
772 | void (*clear_sk)(struct sock *sk, int size); | ||
757 | 773 | ||
758 | /* Keeping track of sockets in use */ | 774 | /* Keeping track of sockets in use */ |
759 | #ifdef CONFIG_PROC_FS | 775 | #ifdef CONFIG_PROC_FS |
@@ -762,7 +778,7 @@ struct proto { | |||
762 | 778 | ||
763 | /* Memory pressure */ | 779 | /* Memory pressure */ |
764 | void (*enter_memory_pressure)(struct sock *sk); | 780 | void (*enter_memory_pressure)(struct sock *sk); |
765 | atomic_t *memory_allocated; /* Current allocated memory. */ | 781 | atomic_long_t *memory_allocated; /* Current allocated memory. */ |
766 | struct percpu_counter *sockets_allocated; /* Current number of sockets. */ | 782 | struct percpu_counter *sockets_allocated; /* Current number of sockets. */ |
767 | /* | 783 | /* |
768 | * Pressure flag: try to collapse. | 784 | * Pressure flag: try to collapse. |
@@ -771,7 +787,7 @@ struct proto { | |||
771 | * is strict, actions are advisory and have some latency. | 787 | * is strict, actions are advisory and have some latency. |
772 | */ | 788 | */ |
773 | int *memory_pressure; | 789 | int *memory_pressure; |
774 | int *sysctl_mem; | 790 | long *sysctl_mem; |
775 | int *sysctl_wmem; | 791 | int *sysctl_wmem; |
776 | int *sysctl_rmem; | 792 | int *sysctl_rmem; |
777 | int max_header; | 793 | int max_header; |
@@ -852,6 +868,8 @@ static inline void __sk_prot_rehash(struct sock *sk) | |||
852 | sk->sk_prot->hash(sk); | 868 | sk->sk_prot->hash(sk); |
853 | } | 869 | } |
854 | 870 | ||
871 | void sk_prot_clear_portaddr_nulls(struct sock *sk, int size); | ||
872 | |||
855 | /* About 10 seconds */ | 873 | /* About 10 seconds */ |
856 | #define SOCK_DESTROY_TIME (10*HZ) | 874 | #define SOCK_DESTROY_TIME (10*HZ) |
857 | 875 | ||
@@ -1155,6 +1173,8 @@ extern void sk_common_release(struct sock *sk); | |||
1155 | /* Initialise core socket variables */ | 1173 | /* Initialise core socket variables */ |
1156 | extern void sock_init_data(struct socket *sock, struct sock *sk); | 1174 | extern void sock_init_data(struct socket *sock, struct sock *sk); |
1157 | 1175 | ||
1176 | extern void sk_filter_release_rcu(struct rcu_head *rcu); | ||
1177 | |||
1158 | /** | 1178 | /** |
1159 | * sk_filter_release - release a socket filter | 1179 | * sk_filter_release - release a socket filter |
1160 | * @fp: filter to remove | 1180 | * @fp: filter to remove |
@@ -1165,7 +1185,7 @@ extern void sock_init_data(struct socket *sock, struct sock *sk); | |||
1165 | static inline void sk_filter_release(struct sk_filter *fp) | 1185 | static inline void sk_filter_release(struct sk_filter *fp) |
1166 | { | 1186 | { |
1167 | if (atomic_dec_and_test(&fp->refcnt)) | 1187 | if (atomic_dec_and_test(&fp->refcnt)) |
1168 | kfree(fp); | 1188 | call_rcu_bh(&fp->rcu, sk_filter_release_rcu); |
1169 | } | 1189 | } |
1170 | 1190 | ||
1171 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) | 1191 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 4fee0424af7e..38509f047382 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -60,6 +60,9 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
60 | */ | 60 | */ |
61 | #define MAX_TCP_WINDOW 32767U | 61 | #define MAX_TCP_WINDOW 32767U |
62 | 62 | ||
63 | /* Offer an initial receive window of 10 mss. */ | ||
64 | #define TCP_DEFAULT_INIT_RCVWND 10 | ||
65 | |||
63 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ | 66 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ |
64 | #define TCP_MIN_MSS 88U | 67 | #define TCP_MIN_MSS 88U |
65 | 68 | ||
@@ -100,12 +103,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
100 | #define TCP_SYNACK_RETRIES 5 /* number of times to retry passive opening a | 103 | #define TCP_SYNACK_RETRIES 5 /* number of times to retry passive opening a |
101 | * connection: ~180sec is RFC minimum */ | 104 | * connection: ~180sec is RFC minimum */ |
102 | 105 | ||
103 | |||
104 | #define TCP_ORPHAN_RETRIES 7 /* number of times to retry on an orphaned | ||
105 | * socket. 7 is ~50sec-16min. | ||
106 | */ | ||
107 | |||
108 | |||
109 | #define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT | 106 | #define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT |
110 | * state, about 60 seconds */ | 107 | * state, about 60 seconds */ |
111 | #define TCP_FIN_TIMEOUT TCP_TIMEWAIT_LEN | 108 | #define TCP_FIN_TIMEOUT TCP_TIMEWAIT_LEN |
@@ -224,7 +221,7 @@ extern int sysctl_tcp_fack; | |||
224 | extern int sysctl_tcp_reordering; | 221 | extern int sysctl_tcp_reordering; |
225 | extern int sysctl_tcp_ecn; | 222 | extern int sysctl_tcp_ecn; |
226 | extern int sysctl_tcp_dsack; | 223 | extern int sysctl_tcp_dsack; |
227 | extern int sysctl_tcp_mem[3]; | 224 | extern long sysctl_tcp_mem[3]; |
228 | extern int sysctl_tcp_wmem[3]; | 225 | extern int sysctl_tcp_wmem[3]; |
229 | extern int sysctl_tcp_rmem[3]; | 226 | extern int sysctl_tcp_rmem[3]; |
230 | extern int sysctl_tcp_app_win; | 227 | extern int sysctl_tcp_app_win; |
@@ -247,7 +244,7 @@ extern int sysctl_tcp_cookie_size; | |||
247 | extern int sysctl_tcp_thin_linear_timeouts; | 244 | extern int sysctl_tcp_thin_linear_timeouts; |
248 | extern int sysctl_tcp_thin_dupack; | 245 | extern int sysctl_tcp_thin_dupack; |
249 | 246 | ||
250 | extern atomic_t tcp_memory_allocated; | 247 | extern atomic_long_t tcp_memory_allocated; |
251 | extern struct percpu_counter tcp_sockets_allocated; | 248 | extern struct percpu_counter tcp_sockets_allocated; |
252 | extern int tcp_memory_pressure; | 249 | extern int tcp_memory_pressure; |
253 | 250 | ||
@@ -280,7 +277,7 @@ static inline bool tcp_too_many_orphans(struct sock *sk, int shift) | |||
280 | } | 277 | } |
281 | 278 | ||
282 | if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && | 279 | if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && |
283 | atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]) | 280 | atomic_long_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]) |
284 | return true; | 281 | return true; |
285 | return false; | 282 | return false; |
286 | } | 283 | } |
@@ -312,7 +309,8 @@ extern void tcp_shutdown (struct sock *sk, int how); | |||
312 | 309 | ||
313 | extern int tcp_v4_rcv(struct sk_buff *skb); | 310 | extern int tcp_v4_rcv(struct sk_buff *skb); |
314 | 311 | ||
315 | extern int tcp_v4_remember_stamp(struct sock *sk); | 312 | extern struct inet_peer *tcp_v4_get_peer(struct sock *sk, bool *release_it); |
313 | extern void *tcp_v4_tw_get_peer(struct sock *sk); | ||
316 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); | 314 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); |
317 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 315 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
318 | size_t size); | 316 | size_t size); |
@@ -1043,7 +1041,13 @@ static inline int tcp_paws_check(const struct tcp_options_received *rx_opt, | |||
1043 | return 1; | 1041 | return 1; |
1044 | if (unlikely(get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS)) | 1042 | if (unlikely(get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS)) |
1045 | return 1; | 1043 | return 1; |
1046 | 1044 | /* | |
1045 | * Some OSes send SYN and SYNACK messages with tsval=0 tsecr=0, | ||
1046 | * then following tcp messages have valid values. Ignore 0 value, | ||
1047 | * or else 'negative' tsval might forbid us to accept their packets. | ||
1048 | */ | ||
1049 | if (!rx_opt->ts_recent) | ||
1050 | return 1; | ||
1047 | return 0; | 1051 | return 0; |
1048 | } | 1052 | } |
1049 | 1053 | ||
@@ -1157,8 +1161,6 @@ struct tcp_md5sig_pool { | |||
1157 | union tcp_md5sum_block md5_blk; | 1161 | union tcp_md5sum_block md5_blk; |
1158 | }; | 1162 | }; |
1159 | 1163 | ||
1160 | #define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ | ||
1161 | |||
1162 | /* - functions */ | 1164 | /* - functions */ |
1163 | extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, | 1165 | extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, |
1164 | struct sock *sk, struct request_sock *req, | 1166 | struct sock *sk, struct request_sock *req, |
diff --git a/include/net/timewait_sock.h b/include/net/timewait_sock.h index 97c3b14da55d..053b3cf2c66a 100644 --- a/include/net/timewait_sock.h +++ b/include/net/timewait_sock.h | |||
@@ -21,6 +21,7 @@ struct timewait_sock_ops { | |||
21 | int (*twsk_unique)(struct sock *sk, | 21 | int (*twsk_unique)(struct sock *sk, |
22 | struct sock *sktw, void *twp); | 22 | struct sock *sktw, void *twp); |
23 | void (*twsk_destructor)(struct sock *sk); | 23 | void (*twsk_destructor)(struct sock *sk); |
24 | void *(*twsk_getpeer)(struct sock *sk); | ||
24 | }; | 25 | }; |
25 | 26 | ||
26 | static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) | 27 | static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) |
@@ -39,4 +40,11 @@ static inline void twsk_destructor(struct sock *sk) | |||
39 | sk->sk_prot->twsk_prot->twsk_destructor(sk); | 40 | sk->sk_prot->twsk_prot->twsk_destructor(sk); |
40 | } | 41 | } |
41 | 42 | ||
43 | static inline void *twsk_getpeer(struct sock *sk) | ||
44 | { | ||
45 | if (sk->sk_prot->twsk_prot->twsk_getpeer) | ||
46 | return sk->sk_prot->twsk_prot->twsk_getpeer(sk); | ||
47 | return NULL; | ||
48 | } | ||
49 | |||
42 | #endif /* _TIMEWAIT_SOCK_H */ | 50 | #endif /* _TIMEWAIT_SOCK_H */ |
diff --git a/include/net/tipc/tipc.h b/include/net/tipc/tipc.h deleted file mode 100644 index 1e0645e1eed2..000000000000 --- a/include/net/tipc/tipc.h +++ /dev/null | |||
@@ -1,186 +0,0 @@ | |||
1 | /* | ||
2 | * include/net/tipc/tipc.h: Main include file for TIPC users | ||
3 | * | ||
4 | * Copyright (c) 2003-2006, Ericsson AB | ||
5 | * Copyright (c) 2005,2010 Wind River Systems | ||
6 | * All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions are met: | ||
10 | * | ||
11 | * 1. Redistributions of source code must retain the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer. | ||
13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
14 | * notice, this list of conditions and the following disclaimer in the | ||
15 | * documentation and/or other materials provided with the distribution. | ||
16 | * 3. Neither the names of the copyright holders nor the names of its | ||
17 | * contributors may be used to endorse or promote products derived from | ||
18 | * this software without specific prior written permission. | ||
19 | * | ||
20 | * Alternatively, this software may be distributed under the terms of the | ||
21 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
22 | * Software Foundation. | ||
23 | * | ||
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
28 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
34 | * POSSIBILITY OF SUCH DAMAGE. | ||
35 | */ | ||
36 | |||
37 | #ifndef _NET_TIPC_H_ | ||
38 | #define _NET_TIPC_H_ | ||
39 | |||
40 | #ifdef __KERNEL__ | ||
41 | |||
42 | #include <linux/tipc.h> | ||
43 | #include <linux/skbuff.h> | ||
44 | |||
45 | /* | ||
46 | * Native API | ||
47 | */ | ||
48 | |||
49 | /* | ||
50 | * TIPC operating mode routines | ||
51 | */ | ||
52 | |||
53 | #define TIPC_NOT_RUNNING 0 | ||
54 | #define TIPC_NODE_MODE 1 | ||
55 | #define TIPC_NET_MODE 2 | ||
56 | |||
57 | typedef void (*tipc_mode_event)(void *usr_handle, int mode, u32 addr); | ||
58 | |||
59 | int tipc_attach(unsigned int *userref, tipc_mode_event, void *usr_handle); | ||
60 | |||
61 | void tipc_detach(unsigned int userref); | ||
62 | |||
63 | /* | ||
64 | * TIPC port manipulation routines | ||
65 | */ | ||
66 | |||
67 | typedef void (*tipc_msg_err_event) (void *usr_handle, | ||
68 | u32 portref, | ||
69 | struct sk_buff **buf, | ||
70 | unsigned char const *data, | ||
71 | unsigned int size, | ||
72 | int reason, | ||
73 | struct tipc_portid const *attmpt_destid); | ||
74 | |||
75 | typedef void (*tipc_named_msg_err_event) (void *usr_handle, | ||
76 | u32 portref, | ||
77 | struct sk_buff **buf, | ||
78 | unsigned char const *data, | ||
79 | unsigned int size, | ||
80 | int reason, | ||
81 | struct tipc_name_seq const *attmpt_dest); | ||
82 | |||
83 | typedef void (*tipc_conn_shutdown_event) (void *usr_handle, | ||
84 | u32 portref, | ||
85 | struct sk_buff **buf, | ||
86 | unsigned char const *data, | ||
87 | unsigned int size, | ||
88 | int reason); | ||
89 | |||
90 | typedef void (*tipc_msg_event) (void *usr_handle, | ||
91 | u32 portref, | ||
92 | struct sk_buff **buf, | ||
93 | unsigned char const *data, | ||
94 | unsigned int size, | ||
95 | unsigned int importance, | ||
96 | struct tipc_portid const *origin); | ||
97 | |||
98 | typedef void (*tipc_named_msg_event) (void *usr_handle, | ||
99 | u32 portref, | ||
100 | struct sk_buff **buf, | ||
101 | unsigned char const *data, | ||
102 | unsigned int size, | ||
103 | unsigned int importance, | ||
104 | struct tipc_portid const *orig, | ||
105 | struct tipc_name_seq const *dest); | ||
106 | |||
107 | typedef void (*tipc_conn_msg_event) (void *usr_handle, | ||
108 | u32 portref, | ||
109 | struct sk_buff **buf, | ||
110 | unsigned char const *data, | ||
111 | unsigned int size); | ||
112 | |||
113 | typedef void (*tipc_continue_event) (void *usr_handle, | ||
114 | u32 portref); | ||
115 | |||
116 | int tipc_createport(unsigned int tipc_user, | ||
117 | void *usr_handle, | ||
118 | unsigned int importance, | ||
119 | tipc_msg_err_event error_cb, | ||
120 | tipc_named_msg_err_event named_error_cb, | ||
121 | tipc_conn_shutdown_event conn_error_cb, | ||
122 | tipc_msg_event message_cb, | ||
123 | tipc_named_msg_event named_message_cb, | ||
124 | tipc_conn_msg_event conn_message_cb, | ||
125 | tipc_continue_event continue_event_cb, | ||
126 | u32 *portref); | ||
127 | |||
128 | int tipc_deleteport(u32 portref); | ||
129 | |||
130 | int tipc_ownidentity(u32 portref, struct tipc_portid *port); | ||
131 | |||
132 | int tipc_portimportance(u32 portref, unsigned int *importance); | ||
133 | int tipc_set_portimportance(u32 portref, unsigned int importance); | ||
134 | |||
135 | int tipc_portunreliable(u32 portref, unsigned int *isunreliable); | ||
136 | int tipc_set_portunreliable(u32 portref, unsigned int isunreliable); | ||
137 | |||
138 | int tipc_portunreturnable(u32 portref, unsigned int *isunreturnable); | ||
139 | int tipc_set_portunreturnable(u32 portref, unsigned int isunreturnable); | ||
140 | |||
141 | int tipc_publish(u32 portref, unsigned int scope, | ||
142 | struct tipc_name_seq const *name_seq); | ||
143 | int tipc_withdraw(u32 portref, unsigned int scope, | ||
144 | struct tipc_name_seq const *name_seq); | ||
145 | |||
146 | int tipc_connect2port(u32 portref, struct tipc_portid const *port); | ||
147 | |||
148 | int tipc_disconnect(u32 portref); | ||
149 | |||
150 | int tipc_shutdown(u32 ref); | ||
151 | |||
152 | /* | ||
153 | * TIPC messaging routines | ||
154 | */ | ||
155 | |||
156 | #define TIPC_PORT_IMPORTANCE 100 /* send using current port setting */ | ||
157 | |||
158 | |||
159 | int tipc_send(u32 portref, | ||
160 | unsigned int num_sect, | ||
161 | struct iovec const *msg_sect); | ||
162 | |||
163 | int tipc_send2name(u32 portref, | ||
164 | struct tipc_name const *name, | ||
165 | u32 domain, | ||
166 | unsigned int num_sect, | ||
167 | struct iovec const *msg_sect); | ||
168 | |||
169 | int tipc_send2port(u32 portref, | ||
170 | struct tipc_portid const *dest, | ||
171 | unsigned int num_sect, | ||
172 | struct iovec const *msg_sect); | ||
173 | |||
174 | int tipc_send_buf2port(u32 portref, | ||
175 | struct tipc_portid const *dest, | ||
176 | struct sk_buff *buf, | ||
177 | unsigned int dsz); | ||
178 | |||
179 | int tipc_multicast(u32 portref, | ||
180 | struct tipc_name_seq const *seq, | ||
181 | u32 domain, /* currently unused */ | ||
182 | unsigned int section_count, | ||
183 | struct iovec const *msg); | ||
184 | #endif | ||
185 | |||
186 | #endif | ||
diff --git a/include/net/tipc/tipc_bearer.h b/include/net/tipc/tipc_bearer.h deleted file mode 100644 index ee2f304e4919..000000000000 --- a/include/net/tipc/tipc_bearer.h +++ /dev/null | |||
@@ -1,138 +0,0 @@ | |||
1 | /* | ||
2 | * include/net/tipc/tipc_bearer.h: Include file for privileged access to TIPC bearers | ||
3 | * | ||
4 | * Copyright (c) 2003-2006, Ericsson AB | ||
5 | * Copyright (c) 2005, Wind River Systems | ||
6 | * All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions are met: | ||
10 | * | ||
11 | * 1. Redistributions of source code must retain the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer. | ||
13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
14 | * notice, this list of conditions and the following disclaimer in the | ||
15 | * documentation and/or other materials provided with the distribution. | ||
16 | * 3. Neither the names of the copyright holders nor the names of its | ||
17 | * contributors may be used to endorse or promote products derived from | ||
18 | * this software without specific prior written permission. | ||
19 | * | ||
20 | * Alternatively, this software may be distributed under the terms of the | ||
21 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
22 | * Software Foundation. | ||
23 | * | ||
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
28 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
34 | * POSSIBILITY OF SUCH DAMAGE. | ||
35 | */ | ||
36 | |||
37 | #ifndef _NET_TIPC_BEARER_H_ | ||
38 | #define _NET_TIPC_BEARER_H_ | ||
39 | |||
40 | #ifdef __KERNEL__ | ||
41 | |||
42 | #include <linux/tipc_config.h> | ||
43 | #include <linux/skbuff.h> | ||
44 | #include <linux/spinlock.h> | ||
45 | |||
46 | /* | ||
47 | * Identifiers of supported TIPC media types | ||
48 | */ | ||
49 | |||
50 | #define TIPC_MEDIA_TYPE_ETH 1 | ||
51 | |||
52 | /* | ||
53 | * Destination address structure used by TIPC bearers when sending messages | ||
54 | * | ||
55 | * IMPORTANT: The fields of this structure MUST be stored using the specified | ||
56 | * byte order indicated below, as the structure is exchanged between nodes | ||
57 | * as part of a link setup process. | ||
58 | */ | ||
59 | |||
60 | struct tipc_media_addr { | ||
61 | __be32 type; /* bearer type (network byte order) */ | ||
62 | union { | ||
63 | __u8 eth_addr[6]; /* 48 bit Ethernet addr (byte array) */ | ||
64 | #if 0 | ||
65 | /* Prototypes for other possible bearer types */ | ||
66 | |||
67 | struct { | ||
68 | __u16 sin_family; | ||
69 | __u16 sin_port; | ||
70 | struct { | ||
71 | __u32 s_addr; | ||
72 | } sin_addr; | ||
73 | char pad[4]; | ||
74 | } addr_in; /* IP-based bearer */ | ||
75 | __u16 sock_descr; /* generic socket bearer */ | ||
76 | #endif | ||
77 | } dev_addr; | ||
78 | }; | ||
79 | |||
80 | /** | ||
81 | * struct tipc_bearer - TIPC bearer info available to privileged users | ||
82 | * @usr_handle: pointer to additional user-defined information about bearer | ||
83 | * @mtu: max packet size bearer can support | ||
84 | * @blocked: non-zero if bearer is blocked | ||
85 | * @lock: spinlock for controlling access to bearer | ||
86 | * @addr: media-specific address associated with bearer | ||
87 | * @name: bearer name (format = media:interface) | ||
88 | * | ||
89 | * Note: TIPC initializes "name" and "lock" fields; user is responsible for | ||
90 | * initialization all other fields when a bearer is enabled. | ||
91 | */ | ||
92 | |||
93 | struct tipc_bearer { | ||
94 | void *usr_handle; | ||
95 | u32 mtu; | ||
96 | int blocked; | ||
97 | spinlock_t lock; | ||
98 | struct tipc_media_addr addr; | ||
99 | char name[TIPC_MAX_BEARER_NAME]; | ||
100 | }; | ||
101 | |||
102 | /* | ||
103 | * TIPC routines available to supported media types | ||
104 | */ | ||
105 | |||
106 | int tipc_register_media(u32 media_type, | ||
107 | char *media_name, | ||
108 | int (*enable)(struct tipc_bearer *), | ||
109 | void (*disable)(struct tipc_bearer *), | ||
110 | int (*send_msg)(struct sk_buff *, | ||
111 | struct tipc_bearer *, | ||
112 | struct tipc_media_addr *), | ||
113 | char *(*addr2str)(struct tipc_media_addr *a, | ||
114 | char *str_buf, | ||
115 | int str_size), | ||
116 | struct tipc_media_addr *bcast_addr, | ||
117 | const u32 bearer_priority, | ||
118 | const u32 link_tolerance, /* [ms] */ | ||
119 | const u32 send_window_limit); | ||
120 | |||
121 | void tipc_recv_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr); | ||
122 | |||
123 | int tipc_block_bearer(const char *name); | ||
124 | void tipc_continue(struct tipc_bearer *tb_ptr); | ||
125 | |||
126 | int tipc_enable_bearer(const char *bearer_name, u32 bcast_scope, u32 priority); | ||
127 | int tipc_disable_bearer(const char *name); | ||
128 | |||
129 | /* | ||
130 | * Routines made available to TIPC by supported media types | ||
131 | */ | ||
132 | |||
133 | int tipc_eth_media_start(void); | ||
134 | void tipc_eth_media_stop(void); | ||
135 | |||
136 | #endif | ||
137 | |||
138 | #endif | ||
diff --git a/include/net/tipc/tipc_msg.h b/include/net/tipc/tipc_msg.h deleted file mode 100644 index ffe50b4e7b93..000000000000 --- a/include/net/tipc/tipc_msg.h +++ /dev/null | |||
@@ -1,207 +0,0 @@ | |||
1 | /* | ||
2 | * include/net/tipc/tipc_msg.h: Include file for privileged access to TIPC message headers | ||
3 | * | ||
4 | * Copyright (c) 2003-2006, Ericsson AB | ||
5 | * Copyright (c) 2005, Wind River Systems | ||
6 | * All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions are met: | ||
10 | * | ||
11 | * 1. Redistributions of source code must retain the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer. | ||
13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
14 | * notice, this list of conditions and the following disclaimer in the | ||
15 | * documentation and/or other materials provided with the distribution. | ||
16 | * 3. Neither the names of the copyright holders nor the names of its | ||
17 | * contributors may be used to endorse or promote products derived from | ||
18 | * this software without specific prior written permission. | ||
19 | * | ||
20 | * Alternatively, this software may be distributed under the terms of the | ||
21 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
22 | * Software Foundation. | ||
23 | * | ||
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
28 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
34 | * POSSIBILITY OF SUCH DAMAGE. | ||
35 | */ | ||
36 | |||
37 | #ifndef _NET_TIPC_MSG_H_ | ||
38 | #define _NET_TIPC_MSG_H_ | ||
39 | |||
40 | #ifdef __KERNEL__ | ||
41 | |||
42 | struct tipc_msg { | ||
43 | __be32 hdr[15]; | ||
44 | }; | ||
45 | |||
46 | |||
47 | /* | ||
48 | TIPC user data message header format, version 2: | ||
49 | |||
50 | |||
51 | 1 0 9 8 7 6 5 4|3 2 1 0 9 8 7 6|5 4 3 2 1 0 9 8|7 6 5 4 3 2 1 0 | ||
52 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
53 | w0:|vers | user |hdr sz |n|d|s|-| message size | | ||
54 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
55 | w1:|mstyp| error |rer cnt|lsc|opt p| broadcast ack no | | ||
56 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
57 | w2:| link level ack no | broadcast/link level seq no | | ||
58 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
59 | w3:| previous node | | ||
60 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
61 | w4:| originating port | | ||
62 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
63 | w5:| destination port | | ||
64 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
65 | w6:| originating node | | ||
66 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
67 | w7:| destination node | | ||
68 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
69 | w8:| name type / transport sequence number | | ||
70 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
71 | w9:| name instance/multicast lower bound | | ||
72 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
73 | wA:| multicast upper bound | | ||
74 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
75 | / / | ||
76 | \ options \ | ||
77 | / / | ||
78 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
79 | |||
80 | */ | ||
81 | |||
82 | #define TIPC_CONN_MSG 0 | ||
83 | #define TIPC_MCAST_MSG 1 | ||
84 | #define TIPC_NAMED_MSG 2 | ||
85 | #define TIPC_DIRECT_MSG 3 | ||
86 | |||
87 | |||
88 | static inline u32 msg_word(struct tipc_msg *m, u32 pos) | ||
89 | { | ||
90 | return ntohl(m->hdr[pos]); | ||
91 | } | ||
92 | |||
93 | static inline u32 msg_bits(struct tipc_msg *m, u32 w, u32 pos, u32 mask) | ||
94 | { | ||
95 | return (msg_word(m, w) >> pos) & mask; | ||
96 | } | ||
97 | |||
98 | static inline u32 msg_importance(struct tipc_msg *m) | ||
99 | { | ||
100 | return msg_bits(m, 0, 25, 0xf); | ||
101 | } | ||
102 | |||
103 | static inline u32 msg_hdr_sz(struct tipc_msg *m) | ||
104 | { | ||
105 | return msg_bits(m, 0, 21, 0xf) << 2; | ||
106 | } | ||
107 | |||
108 | static inline int msg_short(struct tipc_msg *m) | ||
109 | { | ||
110 | return msg_hdr_sz(m) == 24; | ||
111 | } | ||
112 | |||
113 | static inline u32 msg_size(struct tipc_msg *m) | ||
114 | { | ||
115 | return msg_bits(m, 0, 0, 0x1ffff); | ||
116 | } | ||
117 | |||
118 | static inline u32 msg_data_sz(struct tipc_msg *m) | ||
119 | { | ||
120 | return msg_size(m) - msg_hdr_sz(m); | ||
121 | } | ||
122 | |||
123 | static inline unchar *msg_data(struct tipc_msg *m) | ||
124 | { | ||
125 | return ((unchar *)m) + msg_hdr_sz(m); | ||
126 | } | ||
127 | |||
128 | static inline u32 msg_type(struct tipc_msg *m) | ||
129 | { | ||
130 | return msg_bits(m, 1, 29, 0x7); | ||
131 | } | ||
132 | |||
133 | static inline u32 msg_named(struct tipc_msg *m) | ||
134 | { | ||
135 | return msg_type(m) == TIPC_NAMED_MSG; | ||
136 | } | ||
137 | |||
138 | static inline u32 msg_mcast(struct tipc_msg *m) | ||
139 | { | ||
140 | return msg_type(m) == TIPC_MCAST_MSG; | ||
141 | } | ||
142 | |||
143 | static inline u32 msg_connected(struct tipc_msg *m) | ||
144 | { | ||
145 | return msg_type(m) == TIPC_CONN_MSG; | ||
146 | } | ||
147 | |||
148 | static inline u32 msg_errcode(struct tipc_msg *m) | ||
149 | { | ||
150 | return msg_bits(m, 1, 25, 0xf); | ||
151 | } | ||
152 | |||
153 | static inline u32 msg_prevnode(struct tipc_msg *m) | ||
154 | { | ||
155 | return msg_word(m, 3); | ||
156 | } | ||
157 | |||
158 | static inline u32 msg_origport(struct tipc_msg *m) | ||
159 | { | ||
160 | return msg_word(m, 4); | ||
161 | } | ||
162 | |||
163 | static inline u32 msg_destport(struct tipc_msg *m) | ||
164 | { | ||
165 | return msg_word(m, 5); | ||
166 | } | ||
167 | |||
168 | static inline u32 msg_mc_netid(struct tipc_msg *m) | ||
169 | { | ||
170 | return msg_word(m, 5); | ||
171 | } | ||
172 | |||
173 | static inline u32 msg_orignode(struct tipc_msg *m) | ||
174 | { | ||
175 | if (likely(msg_short(m))) | ||
176 | return msg_prevnode(m); | ||
177 | return msg_word(m, 6); | ||
178 | } | ||
179 | |||
180 | static inline u32 msg_destnode(struct tipc_msg *m) | ||
181 | { | ||
182 | return msg_word(m, 7); | ||
183 | } | ||
184 | |||
185 | static inline u32 msg_nametype(struct tipc_msg *m) | ||
186 | { | ||
187 | return msg_word(m, 8); | ||
188 | } | ||
189 | |||
190 | static inline u32 msg_nameinst(struct tipc_msg *m) | ||
191 | { | ||
192 | return msg_word(m, 9); | ||
193 | } | ||
194 | |||
195 | static inline u32 msg_namelower(struct tipc_msg *m) | ||
196 | { | ||
197 | return msg_nameinst(m); | ||
198 | } | ||
199 | |||
200 | static inline u32 msg_nameupper(struct tipc_msg *m) | ||
201 | { | ||
202 | return msg_word(m, 10); | ||
203 | } | ||
204 | |||
205 | #endif | ||
206 | |||
207 | #endif | ||
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h deleted file mode 100644 index 1893aaf49426..000000000000 --- a/include/net/tipc/tipc_port.h +++ /dev/null | |||
@@ -1,101 +0,0 @@ | |||
1 | /* | ||
2 | * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports | ||
3 | * | ||
4 | * Copyright (c) 1994-2007, Ericsson AB | ||
5 | * Copyright (c) 2005-2008, Wind River Systems | ||
6 | * All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions are met: | ||
10 | * | ||
11 | * 1. Redistributions of source code must retain the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer. | ||
13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
14 | * notice, this list of conditions and the following disclaimer in the | ||
15 | * documentation and/or other materials provided with the distribution. | ||
16 | * 3. Neither the names of the copyright holders nor the names of its | ||
17 | * contributors may be used to endorse or promote products derived from | ||
18 | * this software without specific prior written permission. | ||
19 | * | ||
20 | * Alternatively, this software may be distributed under the terms of the | ||
21 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
22 | * Software Foundation. | ||
23 | * | ||
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
28 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
34 | * POSSIBILITY OF SUCH DAMAGE. | ||
35 | */ | ||
36 | |||
37 | #ifndef _NET_TIPC_PORT_H_ | ||
38 | #define _NET_TIPC_PORT_H_ | ||
39 | |||
40 | #ifdef __KERNEL__ | ||
41 | |||
42 | #include <linux/tipc.h> | ||
43 | #include <linux/skbuff.h> | ||
44 | #include <net/tipc/tipc_msg.h> | ||
45 | |||
46 | #define TIPC_FLOW_CONTROL_WIN 512 | ||
47 | |||
48 | /** | ||
49 | * struct tipc_port - native TIPC port info available to privileged users | ||
50 | * @usr_handle: pointer to additional user-defined information about port | ||
51 | * @lock: pointer to spinlock for controlling access to port | ||
52 | * @connected: non-zero if port is currently connected to a peer port | ||
53 | * @conn_type: TIPC type used when connection was established | ||
54 | * @conn_instance: TIPC instance used when connection was established | ||
55 | * @conn_unacked: number of unacknowledged messages received from peer port | ||
56 | * @published: non-zero if port has one or more associated names | ||
57 | * @congested: non-zero if cannot send because of link or port congestion | ||
58 | * @max_pkt: maximum packet size "hint" used when building messages sent by port | ||
59 | * @ref: unique reference to port in TIPC object registry | ||
60 | * @phdr: preformatted message header used when sending messages | ||
61 | */ | ||
62 | |||
63 | struct tipc_port { | ||
64 | void *usr_handle; | ||
65 | spinlock_t *lock; | ||
66 | int connected; | ||
67 | u32 conn_type; | ||
68 | u32 conn_instance; | ||
69 | u32 conn_unacked; | ||
70 | int published; | ||
71 | u32 congested; | ||
72 | u32 max_pkt; | ||
73 | u32 ref; | ||
74 | struct tipc_msg phdr; | ||
75 | }; | ||
76 | |||
77 | |||
78 | struct tipc_port *tipc_createport_raw(void *usr_handle, | ||
79 | u32 (*dispatcher)(struct tipc_port *, struct sk_buff *), | ||
80 | void (*wakeup)(struct tipc_port *), | ||
81 | const u32 importance); | ||
82 | |||
83 | int tipc_reject_msg(struct sk_buff *buf, u32 err); | ||
84 | |||
85 | int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode); | ||
86 | |||
87 | void tipc_acknowledge(u32 port_ref,u32 ack); | ||
88 | |||
89 | struct tipc_port *tipc_get_port(const u32 ref); | ||
90 | |||
91 | /* | ||
92 | * The following routines require that the port be locked on entry | ||
93 | */ | ||
94 | |||
95 | int tipc_disconnect_port(struct tipc_port *tp_ptr); | ||
96 | |||
97 | |||
98 | #endif | ||
99 | |||
100 | #endif | ||
101 | |||
diff --git a/include/net/udp.h b/include/net/udp.h index 200b82848c9a..bb967dd59bf7 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -105,10 +105,10 @@ static inline struct udp_hslot *udp_hashslot2(struct udp_table *table, | |||
105 | 105 | ||
106 | extern struct proto udp_prot; | 106 | extern struct proto udp_prot; |
107 | 107 | ||
108 | extern atomic_t udp_memory_allocated; | 108 | extern atomic_long_t udp_memory_allocated; |
109 | 109 | ||
110 | /* sysctl variables for udp */ | 110 | /* sysctl variables for udp */ |
111 | extern int sysctl_udp_mem[3]; | 111 | extern long sysctl_udp_mem[3]; |
112 | extern int sysctl_udp_rmem_min; | 112 | extern int sysctl_udp_rmem_min; |
113 | extern int sysctl_udp_wmem_min; | 113 | extern int sysctl_udp_wmem_min; |
114 | 114 | ||
diff --git a/include/net/x25.h b/include/net/x25.h index 1479cb4a41fc..a06119a05129 100644 --- a/include/net/x25.h +++ b/include/net/x25.h | |||
@@ -315,6 +315,8 @@ extern struct list_head x25_route_list; | |||
315 | extern rwlock_t x25_route_list_lock; | 315 | extern rwlock_t x25_route_list_lock; |
316 | extern struct list_head x25_forward_list; | 316 | extern struct list_head x25_forward_list; |
317 | extern rwlock_t x25_forward_list_lock; | 317 | extern rwlock_t x25_forward_list_lock; |
318 | extern struct list_head x25_neigh_list; | ||
319 | extern rwlock_t x25_neigh_list_lock; | ||
318 | 320 | ||
319 | extern int x25_proc_init(void); | 321 | extern int x25_proc_init(void); |
320 | extern void x25_proc_exit(void); | 322 | extern void x25_proc_exit(void); |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index bcfb6b24b019..b9f385da758e 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -143,6 +143,7 @@ struct xfrm_state { | |||
143 | struct xfrm_id id; | 143 | struct xfrm_id id; |
144 | struct xfrm_selector sel; | 144 | struct xfrm_selector sel; |
145 | struct xfrm_mark mark; | 145 | struct xfrm_mark mark; |
146 | u32 tfcpad; | ||
146 | 147 | ||
147 | u32 genid; | 148 | u32 genid; |
148 | 149 | ||
@@ -805,6 +806,9 @@ __be16 xfrm_flowi_sport(struct flowi *fl) | |||
805 | case IPPROTO_MH: | 806 | case IPPROTO_MH: |
806 | port = htons(fl->fl_mh_type); | 807 | port = htons(fl->fl_mh_type); |
807 | break; | 808 | break; |
809 | case IPPROTO_GRE: | ||
810 | port = htons(ntohl(fl->fl_gre_key) >> 16); | ||
811 | break; | ||
808 | default: | 812 | default: |
809 | port = 0; /*XXX*/ | 813 | port = 0; /*XXX*/ |
810 | } | 814 | } |
@@ -826,6 +830,9 @@ __be16 xfrm_flowi_dport(struct flowi *fl) | |||
826 | case IPPROTO_ICMPV6: | 830 | case IPPROTO_ICMPV6: |
827 | port = htons(fl->fl_icmp_code); | 831 | port = htons(fl->fl_icmp_code); |
828 | break; | 832 | break; |
833 | case IPPROTO_GRE: | ||
834 | port = htons(ntohl(fl->fl_gre_key) & 0xffff); | ||
835 | break; | ||
829 | default: | 836 | default: |
830 | port = 0; /*XXX*/ | 837 | port = 0; /*XXX*/ |
831 | } | 838 | } |
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index a8631acd37c3..c3e1cbcc2ad2 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
@@ -263,6 +263,7 @@ enum iscsi_err { | |||
263 | ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, | 263 | ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, |
264 | ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, | 264 | ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, |
265 | ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20, | 265 | ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20, |
266 | ISCSI_ERR_SCSI_EH_SESSION_RST = ISCSI_ERR_BASE + 21, | ||
266 | }; | 267 | }; |
267 | 268 | ||
268 | /* | 269 | /* |
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index f986ab7ffe6f..f53c8e31d5fb 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
@@ -221,8 +221,8 @@ struct fc_rport_priv { | |||
221 | * @InputRequests: Number of input requests | 221 | * @InputRequests: Number of input requests |
222 | * @OutputRequests: Number of output requests | 222 | * @OutputRequests: Number of output requests |
223 | * @ControlRequests: Number of control requests | 223 | * @ControlRequests: Number of control requests |
224 | * @InputMegabytes: Number of received megabytes | 224 | * @InputBytes: Number of received bytes |
225 | * @OutputMegabytes: Number of transmitted megabytes | 225 | * @OutputBytes: Number of transmitted bytes |
226 | * @VLinkFailureCount: Number of virtual link failures | 226 | * @VLinkFailureCount: Number of virtual link failures |
227 | * @MissDiscAdvCount: Number of missing FIP discovery advertisement | 227 | * @MissDiscAdvCount: Number of missing FIP discovery advertisement |
228 | */ | 228 | */ |
@@ -241,8 +241,8 @@ struct fcoe_dev_stats { | |||
241 | u64 InputRequests; | 241 | u64 InputRequests; |
242 | u64 OutputRequests; | 242 | u64 OutputRequests; |
243 | u64 ControlRequests; | 243 | u64 ControlRequests; |
244 | u64 InputMegabytes; | 244 | u64 InputBytes; |
245 | u64 OutputMegabytes; | 245 | u64 OutputBytes; |
246 | u64 VLinkFailureCount; | 246 | u64 VLinkFailureCount; |
247 | u64 MissDiscAdvCount; | 247 | u64 MissDiscAdvCount; |
248 | }; | 248 | }; |
@@ -263,7 +263,6 @@ struct fc_seq_els_data { | |||
263 | * struct fc_fcp_pkt - FCP request structure (one for each scsi_cmnd request) | 263 | * struct fc_fcp_pkt - FCP request structure (one for each scsi_cmnd request) |
264 | * @lp: The associated local port | 264 | * @lp: The associated local port |
265 | * @state: The state of the I/O | 265 | * @state: The state of the I/O |
266 | * @tgt_flags: Target's flags | ||
267 | * @ref_cnt: Reference count | 266 | * @ref_cnt: Reference count |
268 | * @scsi_pkt_lock: Lock to protect the SCSI packet (must be taken before the | 267 | * @scsi_pkt_lock: Lock to protect the SCSI packet (must be taken before the |
269 | * host_lock if both are to be held at the same time) | 268 | * host_lock if both are to be held at the same time) |
@@ -298,7 +297,6 @@ struct fc_fcp_pkt { | |||
298 | /* Housekeeping information */ | 297 | /* Housekeeping information */ |
299 | struct fc_lport *lp; | 298 | struct fc_lport *lp; |
300 | u16 state; | 299 | u16 state; |
301 | u16 tgt_flags; | ||
302 | atomic_t ref_cnt; | 300 | atomic_t ref_cnt; |
303 | spinlock_t scsi_pkt_lock; | 301 | spinlock_t scsi_pkt_lock; |
304 | 302 | ||
@@ -1006,8 +1004,7 @@ void fc_fcp_destroy(struct fc_lport *); | |||
1006 | /* | 1004 | /* |
1007 | * SCSI INTERACTION LAYER | 1005 | * SCSI INTERACTION LAYER |
1008 | *****************************/ | 1006 | *****************************/ |
1009 | int fc_queuecommand(struct scsi_cmnd *, | 1007 | int fc_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); |
1010 | void (*done)(struct scsi_cmnd *)); | ||
1011 | int fc_eh_abort(struct scsi_cmnd *); | 1008 | int fc_eh_abort(struct scsi_cmnd *); |
1012 | int fc_eh_device_reset(struct scsi_cmnd *); | 1009 | int fc_eh_device_reset(struct scsi_cmnd *); |
1013 | int fc_eh_host_reset(struct scsi_cmnd *); | 1010 | int fc_eh_host_reset(struct scsi_cmnd *); |
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index 06f1b5a8ed19..feb6a94c90ea 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h | |||
@@ -92,10 +92,12 @@ enum fip_state { | |||
92 | * @timer_work: &work_struct for doing keep-alives and resets. | 92 | * @timer_work: &work_struct for doing keep-alives and resets. |
93 | * @recv_work: &work_struct for receiving FIP frames. | 93 | * @recv_work: &work_struct for receiving FIP frames. |
94 | * @fip_recv_list: list of received FIP frames. | 94 | * @fip_recv_list: list of received FIP frames. |
95 | * @flogi_req: clone of FLOGI request sent | ||
95 | * @rnd_state: state for pseudo-random number generator. | 96 | * @rnd_state: state for pseudo-random number generator. |
96 | * @port_id: proposed or selected local-port ID. | 97 | * @port_id: proposed or selected local-port ID. |
97 | * @user_mfs: configured maximum FC frame size, including FC header. | 98 | * @user_mfs: configured maximum FC frame size, including FC header. |
98 | * @flogi_oxid: exchange ID of most recent fabric login. | 99 | * @flogi_oxid: exchange ID of most recent fabric login. |
100 | * @flogi_req_send: send of FLOGI requested | ||
99 | * @flogi_count: number of FLOGI attempts in AUTO mode. | 101 | * @flogi_count: number of FLOGI attempts in AUTO mode. |
100 | * @map_dest: use the FC_MAP mode for destination MAC addresses. | 102 | * @map_dest: use the FC_MAP mode for destination MAC addresses. |
101 | * @spma: supports SPMA server-provided MACs mode | 103 | * @spma: supports SPMA server-provided MACs mode |
@@ -106,6 +108,7 @@ enum fip_state { | |||
106 | * @update_mac: LLD-supplied function to handle changes to MAC addresses. | 108 | * @update_mac: LLD-supplied function to handle changes to MAC addresses. |
107 | * @get_src_addr: LLD-supplied function to supply a source MAC address. | 109 | * @get_src_addr: LLD-supplied function to supply a source MAC address. |
108 | * @ctlr_mutex: lock protecting this structure. | 110 | * @ctlr_mutex: lock protecting this structure. |
111 | * @ctlr_lock: spinlock covering flogi_req | ||
109 | * | 112 | * |
110 | * This structure is used by all FCoE drivers. It contains information | 113 | * This structure is used by all FCoE drivers. It contains information |
111 | * needed by all FCoE low-level drivers (LLDs) as well as internal state | 114 | * needed by all FCoE low-level drivers (LLDs) as well as internal state |
@@ -126,12 +129,14 @@ struct fcoe_ctlr { | |||
126 | struct work_struct timer_work; | 129 | struct work_struct timer_work; |
127 | struct work_struct recv_work; | 130 | struct work_struct recv_work; |
128 | struct sk_buff_head fip_recv_list; | 131 | struct sk_buff_head fip_recv_list; |
132 | struct sk_buff *flogi_req; | ||
129 | 133 | ||
130 | struct rnd_state rnd_state; | 134 | struct rnd_state rnd_state; |
131 | u32 port_id; | 135 | u32 port_id; |
132 | 136 | ||
133 | u16 user_mfs; | 137 | u16 user_mfs; |
134 | u16 flogi_oxid; | 138 | u16 flogi_oxid; |
139 | u8 flogi_req_send; | ||
135 | u8 flogi_count; | 140 | u8 flogi_count; |
136 | u8 map_dest; | 141 | u8 map_dest; |
137 | u8 spma; | 142 | u8 spma; |
@@ -143,6 +148,7 @@ struct fcoe_ctlr { | |||
143 | void (*update_mac)(struct fc_lport *, u8 *addr); | 148 | void (*update_mac)(struct fc_lport *, u8 *addr); |
144 | u8 * (*get_src_addr)(struct fc_lport *); | 149 | u8 * (*get_src_addr)(struct fc_lport *); |
145 | struct mutex ctlr_mutex; | 150 | struct mutex ctlr_mutex; |
151 | spinlock_t ctlr_lock; | ||
146 | }; | 152 | }; |
147 | 153 | ||
148 | /** | 154 | /** |
@@ -155,6 +161,7 @@ struct fcoe_ctlr { | |||
155 | * @fcf_mac: Ethernet address of the FCF | 161 | * @fcf_mac: Ethernet address of the FCF |
156 | * @vfid: virtual fabric ID | 162 | * @vfid: virtual fabric ID |
157 | * @pri: selection priority, smaller values are better | 163 | * @pri: selection priority, smaller values are better |
164 | * @flogi_sent: current FLOGI sent to this FCF | ||
158 | * @flags: flags received from advertisement | 165 | * @flags: flags received from advertisement |
159 | * @fka_period: keep-alive period, in jiffies | 166 | * @fka_period: keep-alive period, in jiffies |
160 | * | 167 | * |
@@ -176,6 +183,7 @@ struct fcoe_fcf { | |||
176 | u8 fcf_mac[ETH_ALEN]; | 183 | u8 fcf_mac[ETH_ALEN]; |
177 | 184 | ||
178 | u8 pri; | 185 | u8 pri; |
186 | u8 flogi_sent; | ||
179 | u16 flags; | 187 | u16 flags; |
180 | u32 fka_period; | 188 | u32 fka_period; |
181 | u8 fd_flags:1; | 189 | u8 fd_flags:1; |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index ae5196aae1a5..748382b32b52 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
@@ -89,6 +89,7 @@ enum { | |||
89 | ISCSI_TASK_RUNNING, | 89 | ISCSI_TASK_RUNNING, |
90 | ISCSI_TASK_ABRT_TMF, /* aborted due to TMF */ | 90 | ISCSI_TASK_ABRT_TMF, /* aborted due to TMF */ |
91 | ISCSI_TASK_ABRT_SESS_RECOV, /* aborted due to session recovery */ | 91 | ISCSI_TASK_ABRT_SESS_RECOV, /* aborted due to session recovery */ |
92 | ISCSI_TASK_REQUEUE_SCSIQ, /* qcmd requeueing to scsi-ml */ | ||
92 | }; | 93 | }; |
93 | 94 | ||
94 | struct iscsi_r2t_info { | 95 | struct iscsi_r2t_info { |
@@ -341,8 +342,7 @@ extern int iscsi_eh_abort(struct scsi_cmnd *sc); | |||
341 | extern int iscsi_eh_recover_target(struct scsi_cmnd *sc); | 342 | extern int iscsi_eh_recover_target(struct scsi_cmnd *sc); |
342 | extern int iscsi_eh_session_reset(struct scsi_cmnd *sc); | 343 | extern int iscsi_eh_session_reset(struct scsi_cmnd *sc); |
343 | extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); | 344 | extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); |
344 | extern int iscsi_queuecommand(struct scsi_cmnd *sc, | 345 | extern int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc); |
345 | void (*done)(struct scsi_cmnd *)); | ||
346 | 346 | ||
347 | /* | 347 | /* |
348 | * iSCSI host helpers. | 348 | * iSCSI host helpers. |
@@ -420,6 +420,7 @@ extern struct iscsi_task *iscsi_itt_to_ctask(struct iscsi_conn *, itt_t); | |||
420 | extern struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *, itt_t); | 420 | extern struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *, itt_t); |
421 | extern void iscsi_requeue_task(struct iscsi_task *task); | 421 | extern void iscsi_requeue_task(struct iscsi_task *task); |
422 | extern void iscsi_put_task(struct iscsi_task *task); | 422 | extern void iscsi_put_task(struct iscsi_task *task); |
423 | extern void __iscsi_put_task(struct iscsi_task *task); | ||
423 | extern void __iscsi_get_task(struct iscsi_task *task); | 424 | extern void __iscsi_get_task(struct iscsi_task *task); |
424 | extern void iscsi_complete_scsi_task(struct iscsi_task *task, | 425 | extern void iscsi_complete_scsi_task(struct iscsi_task *task, |
425 | uint32_t exp_cmdsn, uint32_t max_cmdsn); | 426 | uint32_t exp_cmdsn, uint32_t max_cmdsn); |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 3dec1949f69c..8f6bb9c7f3eb 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -361,6 +361,8 @@ struct sas_ha_struct { | |||
361 | /* The class calls this to send a task for execution. */ | 361 | /* The class calls this to send a task for execution. */ |
362 | int lldd_max_execute_num; | 362 | int lldd_max_execute_num; |
363 | int lldd_queue_size; | 363 | int lldd_queue_size; |
364 | int strict_wide_ports; /* both sas_addr and attached_sas_addr must match | ||
365 | * their siblings when forming wide ports */ | ||
364 | 366 | ||
365 | /* LLDD calls these to notify the class of an event. */ | 367 | /* LLDD calls these to notify the class of an event. */ |
366 | void (*notify_ha_event)(struct sas_ha_struct *, enum ha_event); | 368 | void (*notify_ha_event)(struct sas_ha_struct *, enum ha_event); |
@@ -621,8 +623,7 @@ int sas_set_phy_speed(struct sas_phy *phy, | |||
621 | int sas_phy_enable(struct sas_phy *phy, int enabled); | 623 | int sas_phy_enable(struct sas_phy *phy, int enabled); |
622 | int sas_phy_reset(struct sas_phy *phy, int hard_reset); | 624 | int sas_phy_reset(struct sas_phy *phy, int hard_reset); |
623 | int sas_queue_up(struct sas_task *task); | 625 | int sas_queue_up(struct sas_task *task); |
624 | extern int sas_queuecommand(struct scsi_cmnd *, | 626 | extern int sas_queuecommand(struct Scsi_Host * ,struct scsi_cmnd *); |
625 | void (*scsi_done)(struct scsi_cmnd *)); | ||
626 | extern int sas_target_alloc(struct scsi_target *); | 627 | extern int sas_target_alloc(struct scsi_target *); |
627 | extern int sas_slave_alloc(struct scsi_device *); | 628 | extern int sas_slave_alloc(struct scsi_device *); |
628 | extern int sas_slave_configure(struct scsi_device *); | 629 | extern int sas_slave_configure(struct scsi_device *); |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 216af8538cc9..1651fef18831 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -115,33 +115,61 @@ struct scsi_cmnd; | |||
115 | #define PERSISTENT_RESERVE_OUT 0x5f | 115 | #define PERSISTENT_RESERVE_OUT 0x5f |
116 | #define VARIABLE_LENGTH_CMD 0x7f | 116 | #define VARIABLE_LENGTH_CMD 0x7f |
117 | #define REPORT_LUNS 0xa0 | 117 | #define REPORT_LUNS 0xa0 |
118 | #define SECURITY_PROTOCOL_IN 0xa2 | ||
118 | #define MAINTENANCE_IN 0xa3 | 119 | #define MAINTENANCE_IN 0xa3 |
119 | #define MAINTENANCE_OUT 0xa4 | 120 | #define MAINTENANCE_OUT 0xa4 |
120 | #define MOVE_MEDIUM 0xa5 | 121 | #define MOVE_MEDIUM 0xa5 |
121 | #define EXCHANGE_MEDIUM 0xa6 | 122 | #define EXCHANGE_MEDIUM 0xa6 |
122 | #define READ_12 0xa8 | 123 | #define READ_12 0xa8 |
123 | #define WRITE_12 0xaa | 124 | #define WRITE_12 0xaa |
125 | #define READ_MEDIA_SERIAL_NUMBER 0xab | ||
124 | #define WRITE_VERIFY_12 0xae | 126 | #define WRITE_VERIFY_12 0xae |
125 | #define VERIFY_12 0xaf | 127 | #define VERIFY_12 0xaf |
126 | #define SEARCH_HIGH_12 0xb0 | 128 | #define SEARCH_HIGH_12 0xb0 |
127 | #define SEARCH_EQUAL_12 0xb1 | 129 | #define SEARCH_EQUAL_12 0xb1 |
128 | #define SEARCH_LOW_12 0xb2 | 130 | #define SEARCH_LOW_12 0xb2 |
131 | #define SECURITY_PROTOCOL_OUT 0xb5 | ||
129 | #define READ_ELEMENT_STATUS 0xb8 | 132 | #define READ_ELEMENT_STATUS 0xb8 |
130 | #define SEND_VOLUME_TAG 0xb6 | 133 | #define SEND_VOLUME_TAG 0xb6 |
131 | #define WRITE_LONG_2 0xea | 134 | #define WRITE_LONG_2 0xea |
135 | #define EXTENDED_COPY 0x83 | ||
136 | #define RECEIVE_COPY_RESULTS 0x84 | ||
137 | #define ACCESS_CONTROL_IN 0x86 | ||
138 | #define ACCESS_CONTROL_OUT 0x87 | ||
132 | #define READ_16 0x88 | 139 | #define READ_16 0x88 |
133 | #define WRITE_16 0x8a | 140 | #define WRITE_16 0x8a |
141 | #define READ_ATTRIBUTE 0x8c | ||
142 | #define WRITE_ATTRIBUTE 0x8d | ||
134 | #define VERIFY_16 0x8f | 143 | #define VERIFY_16 0x8f |
135 | #define WRITE_SAME_16 0x93 | 144 | #define WRITE_SAME_16 0x93 |
136 | #define SERVICE_ACTION_IN 0x9e | 145 | #define SERVICE_ACTION_IN 0x9e |
137 | /* values for service action in */ | 146 | /* values for service action in */ |
138 | #define SAI_READ_CAPACITY_16 0x10 | 147 | #define SAI_READ_CAPACITY_16 0x10 |
139 | #define SAI_GET_LBA_STATUS 0x12 | 148 | #define SAI_GET_LBA_STATUS 0x12 |
149 | /* values for VARIABLE_LENGTH_CMD service action codes | ||
150 | * see spc4r17 Section D.3.5, table D.7 and D.8 */ | ||
151 | #define VLC_SA_RECEIVE_CREDENTIAL 0x1800 | ||
140 | /* values for maintenance in */ | 152 | /* values for maintenance in */ |
153 | #define MI_REPORT_IDENTIFYING_INFORMATION 0x05 | ||
141 | #define MI_REPORT_TARGET_PGS 0x0a | 154 | #define MI_REPORT_TARGET_PGS 0x0a |
155 | #define MI_REPORT_ALIASES 0x0b | ||
156 | #define MI_REPORT_SUPPORTED_OPERATION_CODES 0x0c | ||
157 | #define MI_REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS 0x0d | ||
158 | #define MI_REPORT_PRIORITY 0x0e | ||
159 | #define MI_REPORT_TIMESTAMP 0x0f | ||
160 | #define MI_MANAGEMENT_PROTOCOL_IN 0x10 | ||
142 | /* values for maintenance out */ | 161 | /* values for maintenance out */ |
162 | #define MO_SET_IDENTIFYING_INFORMATION 0x06 | ||
143 | #define MO_SET_TARGET_PGS 0x0a | 163 | #define MO_SET_TARGET_PGS 0x0a |
164 | #define MO_CHANGE_ALIASES 0x0b | ||
165 | #define MO_SET_PRIORITY 0x0e | ||
166 | #define MO_SET_TIMESTAMP 0x0f | ||
167 | #define MO_MANAGEMENT_PROTOCOL_OUT 0x10 | ||
144 | /* values for variable length command */ | 168 | /* values for variable length command */ |
169 | #define XDREAD_32 0x03 | ||
170 | #define XDWRITE_32 0x04 | ||
171 | #define XPWRITE_32 0x06 | ||
172 | #define XDWRITEREAD_32 0x07 | ||
145 | #define READ_32 0x09 | 173 | #define READ_32 0x09 |
146 | #define VERIFY_32 0x0a | 174 | #define VERIFY_32 0x0a |
147 | #define WRITE_32 0x0b | 175 | #define WRITE_32 0x0b |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index d0a6a845f204..e7e385842a38 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -127,8 +127,7 @@ struct scsi_host_template { | |||
127 | * | 127 | * |
128 | * STATUS: REQUIRED | 128 | * STATUS: REQUIRED |
129 | */ | 129 | */ |
130 | int (* queuecommand)(struct scsi_cmnd *, | 130 | int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *); |
131 | void (*done)(struct scsi_cmnd *)); | ||
132 | 131 | ||
133 | /* | 132 | /* |
134 | * The transfer functions are used to queue a scsi command to | 133 | * The transfer functions are used to queue a scsi command to |
@@ -505,6 +504,25 @@ struct scsi_host_template { | |||
505 | }; | 504 | }; |
506 | 505 | ||
507 | /* | 506 | /* |
507 | * Temporary #define for host lock push down. Can be removed when all | ||
508 | * drivers have been updated to take advantage of unlocked | ||
509 | * queuecommand. | ||
510 | * | ||
511 | */ | ||
512 | #define DEF_SCSI_QCMD(func_name) \ | ||
513 | int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd) \ | ||
514 | { \ | ||
515 | unsigned long irq_flags; \ | ||
516 | int rc; \ | ||
517 | spin_lock_irqsave(shost->host_lock, irq_flags); \ | ||
518 | scsi_cmd_get_serial(shost, cmd); \ | ||
519 | rc = func_name##_lck (cmd, cmd->scsi_done); \ | ||
520 | spin_unlock_irqrestore(shost->host_lock, irq_flags); \ | ||
521 | return rc; \ | ||
522 | } | ||
523 | |||
524 | |||
525 | /* | ||
508 | * shost state: If you alter this, you also need to alter scsi_sysfs.c | 526 | * shost state: If you alter this, you also need to alter scsi_sysfs.c |
509 | * (for the ascii descriptions) and the state model enforcer: | 527 | * (for the ascii descriptions) and the state model enforcer: |
510 | * scsi_host_set_state() | 528 | * scsi_host_set_state() |
@@ -752,6 +770,7 @@ extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *); | |||
752 | extern void scsi_host_put(struct Scsi_Host *t); | 770 | extern void scsi_host_put(struct Scsi_Host *t); |
753 | extern struct Scsi_Host *scsi_host_lookup(unsigned short); | 771 | extern struct Scsi_Host *scsi_host_lookup(unsigned short); |
754 | extern const char *scsi_host_state_name(enum scsi_host_state); | 772 | extern const char *scsi_host_state_name(enum scsi_host_state); |
773 | extern void scsi_cmd_get_serial(struct Scsi_Host *, struct scsi_cmnd *); | ||
755 | 774 | ||
756 | extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); | 775 | extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); |
757 | 776 | ||
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h index fa60cbda90a4..d79894192ae3 100644 --- a/include/sound/sh_fsi.h +++ b/include/sound/sh_fsi.h | |||
@@ -85,7 +85,9 @@ | |||
85 | * ACK_MD (FSI2) | 85 | * ACK_MD (FSI2) |
86 | * CKG1 (FSI) | 86 | * CKG1 (FSI) |
87 | * | 87 | * |
88 | * err: return value < 0 | 88 | * err : return value < 0 |
89 | * no change : return value == 0 | ||
90 | * change xMD : return value > 0 | ||
89 | * | 91 | * |
90 | * 0x-00000AB | 92 | * 0x-00000AB |
91 | * | 93 | * |
@@ -111,7 +113,7 @@ | |||
111 | struct sh_fsi_platform_info { | 113 | struct sh_fsi_platform_info { |
112 | unsigned long porta_flags; | 114 | unsigned long porta_flags; |
113 | unsigned long portb_flags; | 115 | unsigned long portb_flags; |
114 | int (*set_rate)(int is_porta, int rate); /* for master mode */ | 116 | int (*set_rate)(struct device *dev, int is_porta, int rate, int enable); |
115 | }; | 117 | }; |
116 | 118 | ||
117 | #endif /* __SOUND_FSI_H */ | 119 | #endif /* __SOUND_FSI_H */ |
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h index 1dfab5401511..b0b4eb24d592 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h | |||
@@ -26,6 +26,15 @@ | |||
26 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ | 26 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ |
27 | DEFINE_TRACE(name) | 27 | DEFINE_TRACE(name) |
28 | 28 | ||
29 | #undef TRACE_EVENT_CONDITION | ||
30 | #define TRACE_EVENT_CONDITION(name, proto, args, cond, tstruct, assign, print) \ | ||
31 | TRACE_EVENT(name, \ | ||
32 | PARAMS(proto), \ | ||
33 | PARAMS(args), \ | ||
34 | PARAMS(tstruct), \ | ||
35 | PARAMS(assign), \ | ||
36 | PARAMS(print)) | ||
37 | |||
29 | #undef TRACE_EVENT_FN | 38 | #undef TRACE_EVENT_FN |
30 | #define TRACE_EVENT_FN(name, proto, args, tstruct, \ | 39 | #define TRACE_EVENT_FN(name, proto, args, tstruct, \ |
31 | assign, print, reg, unreg) \ | 40 | assign, print, reg, unreg) \ |
@@ -39,6 +48,10 @@ | |||
39 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 48 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
40 | DEFINE_TRACE(name) | 49 | DEFINE_TRACE(name) |
41 | 50 | ||
51 | #undef DEFINE_EVENT_CONDITION | ||
52 | #define DEFINE_EVENT_CONDITION(template, name, proto, args, cond) \ | ||
53 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | ||
54 | |||
42 | #undef DECLARE_TRACE | 55 | #undef DECLARE_TRACE |
43 | #define DECLARE_TRACE(name, proto, args) \ | 56 | #define DECLARE_TRACE(name, proto, args) \ |
44 | DEFINE_TRACE(name) | 57 | DEFINE_TRACE(name) |
@@ -75,9 +88,11 @@ | |||
75 | 88 | ||
76 | #undef TRACE_EVENT | 89 | #undef TRACE_EVENT |
77 | #undef TRACE_EVENT_FN | 90 | #undef TRACE_EVENT_FN |
91 | #undef TRACE_EVENT_CONDITION | ||
78 | #undef DECLARE_EVENT_CLASS | 92 | #undef DECLARE_EVENT_CLASS |
79 | #undef DEFINE_EVENT | 93 | #undef DEFINE_EVENT |
80 | #undef DEFINE_EVENT_PRINT | 94 | #undef DEFINE_EVENT_PRINT |
95 | #undef DEFINE_EVENT_CONDITION | ||
81 | #undef TRACE_HEADER_MULTI_READ | 96 | #undef TRACE_HEADER_MULTI_READ |
82 | #undef DECLARE_TRACE | 97 | #undef DECLARE_TRACE |
83 | 98 | ||
diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 286784d69b8f..1bcc2a8c00e2 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h | |||
@@ -7,16 +7,67 @@ | |||
7 | #include <linux/ktime.h> | 7 | #include <linux/ktime.h> |
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
9 | 9 | ||
10 | #ifndef _TRACE_POWER_ENUM_ | 10 | DECLARE_EVENT_CLASS(cpu, |
11 | #define _TRACE_POWER_ENUM_ | 11 | |
12 | enum { | 12 | TP_PROTO(unsigned int state, unsigned int cpu_id), |
13 | POWER_NONE = 0, | 13 | |
14 | POWER_CSTATE = 1, /* C-State */ | 14 | TP_ARGS(state, cpu_id), |
15 | POWER_PSTATE = 2, /* Fequency change or DVFS */ | 15 | |
16 | POWER_SSTATE = 3, /* Suspend */ | 16 | TP_STRUCT__entry( |
17 | }; | 17 | __field( u32, state ) |
18 | __field( u32, cpu_id ) | ||
19 | ), | ||
20 | |||
21 | TP_fast_assign( | ||
22 | __entry->state = state; | ||
23 | __entry->cpu_id = cpu_id; | ||
24 | ), | ||
25 | |||
26 | TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state, | ||
27 | (unsigned long)__entry->cpu_id) | ||
28 | ); | ||
29 | |||
30 | DEFINE_EVENT(cpu, cpu_idle, | ||
31 | |||
32 | TP_PROTO(unsigned int state, unsigned int cpu_id), | ||
33 | |||
34 | TP_ARGS(state, cpu_id) | ||
35 | ); | ||
36 | |||
37 | /* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */ | ||
38 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING | ||
39 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING | ||
40 | |||
41 | #define PWR_EVENT_EXIT -1 | ||
18 | #endif | 42 | #endif |
19 | 43 | ||
44 | DEFINE_EVENT(cpu, cpu_frequency, | ||
45 | |||
46 | TP_PROTO(unsigned int frequency, unsigned int cpu_id), | ||
47 | |||
48 | TP_ARGS(frequency, cpu_id) | ||
49 | ); | ||
50 | |||
51 | TRACE_EVENT(machine_suspend, | ||
52 | |||
53 | TP_PROTO(unsigned int state), | ||
54 | |||
55 | TP_ARGS(state), | ||
56 | |||
57 | TP_STRUCT__entry( | ||
58 | __field( u32, state ) | ||
59 | ), | ||
60 | |||
61 | TP_fast_assign( | ||
62 | __entry->state = state; | ||
63 | ), | ||
64 | |||
65 | TP_printk("state=%lu", (unsigned long)__entry->state) | ||
66 | ); | ||
67 | |||
68 | /* This code will be removed after deprecation time exceeded (2.6.41) */ | ||
69 | #ifdef CONFIG_EVENT_POWER_TRACING_DEPRECATED | ||
70 | |||
20 | /* | 71 | /* |
21 | * The power events are used for cpuidle & suspend (power_start, power_end) | 72 | * The power events are used for cpuidle & suspend (power_start, power_end) |
22 | * and for cpufreq (power_frequency) | 73 | * and for cpufreq (power_frequency) |
@@ -75,6 +126,36 @@ TRACE_EVENT(power_end, | |||
75 | 126 | ||
76 | ); | 127 | ); |
77 | 128 | ||
129 | /* Deprecated dummy functions must be protected against multi-declartion */ | ||
130 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
131 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
132 | |||
133 | enum { | ||
134 | POWER_NONE = 0, | ||
135 | POWER_CSTATE = 1, | ||
136 | POWER_PSTATE = 2, | ||
137 | }; | ||
138 | #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ | ||
139 | |||
140 | #else /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ | ||
141 | |||
142 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
143 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
144 | enum { | ||
145 | POWER_NONE = 0, | ||
146 | POWER_CSTATE = 1, | ||
147 | POWER_PSTATE = 2, | ||
148 | }; | ||
149 | |||
150 | /* These dummy declaration have to be ripped out when the deprecated | ||
151 | events get removed */ | ||
152 | static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {}; | ||
153 | static inline void trace_power_end(u64 cpuid) {}; | ||
154 | static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {}; | ||
155 | #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ | ||
156 | |||
157 | #endif /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ | ||
158 | |||
78 | /* | 159 | /* |
79 | * The clock events are used for clock enable/disable and for | 160 | * The clock events are used for clock enable/disable and for |
80 | * clock rate change | 161 | * clock rate change |
@@ -153,7 +234,6 @@ DEFINE_EVENT(power_domain, power_domain_target, | |||
153 | 234 | ||
154 | TP_ARGS(name, state, cpu_id) | 235 | TP_ARGS(name, state, cpu_id) |
155 | ); | 236 | ); |
156 | |||
157 | #endif /* _TRACE_POWER_H */ | 237 | #endif /* _TRACE_POWER_H */ |
158 | 238 | ||
159 | /* This part must be outside protection */ | 239 | /* This part must be outside protection */ |
diff --git a/include/trace/events/syscalls.h b/include/trace/events/syscalls.h index fb726ac7caee..5a4c04a75b3d 100644 --- a/include/trace/events/syscalls.h +++ b/include/trace/events/syscalls.h | |||
@@ -40,6 +40,8 @@ TRACE_EVENT_FN(sys_enter, | |||
40 | syscall_regfunc, syscall_unregfunc | 40 | syscall_regfunc, syscall_unregfunc |
41 | ); | 41 | ); |
42 | 42 | ||
43 | TRACE_EVENT_FLAGS(sys_enter, TRACE_EVENT_FL_CAP_ANY) | ||
44 | |||
43 | TRACE_EVENT_FN(sys_exit, | 45 | TRACE_EVENT_FN(sys_exit, |
44 | 46 | ||
45 | TP_PROTO(struct pt_regs *regs, long ret), | 47 | TP_PROTO(struct pt_regs *regs, long ret), |
@@ -62,6 +64,8 @@ TRACE_EVENT_FN(sys_exit, | |||
62 | syscall_regfunc, syscall_unregfunc | 64 | syscall_regfunc, syscall_unregfunc |
63 | ); | 65 | ); |
64 | 66 | ||
67 | TRACE_EVENT_FLAGS(sys_exit, TRACE_EVENT_FL_CAP_ANY) | ||
68 | |||
65 | #endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */ | 69 | #endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */ |
66 | 70 | ||
67 | #endif /* _TRACE_EVENTS_SYSCALLS_H */ | 71 | #endif /* _TRACE_EVENTS_SYSCALLS_H */ |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index a9377c0083ad..e16610c208c9 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -82,6 +82,10 @@ | |||
82 | TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \ | 82 | TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \ |
83 | PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \ | 83 | PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \ |
84 | 84 | ||
85 | #undef TRACE_EVENT_FLAGS | ||
86 | #define TRACE_EVENT_FLAGS(name, value) \ | ||
87 | __TRACE_EVENT_FLAGS(name, value) | ||
88 | |||
85 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 89 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
86 | 90 | ||
87 | 91 | ||
@@ -129,6 +133,9 @@ | |||
129 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 133 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
130 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | 134 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) |
131 | 135 | ||
136 | #undef TRACE_EVENT_FLAGS | ||
137 | #define TRACE_EVENT_FLAGS(event, flag) | ||
138 | |||
132 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 139 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
133 | 140 | ||
134 | /* | 141 | /* |
@@ -289,13 +296,19 @@ static struct trace_event_functions ftrace_event_type_funcs_##call = { \ | |||
289 | 296 | ||
290 | #undef __array | 297 | #undef __array |
291 | #define __array(type, item, len) \ | 298 | #define __array(type, item, len) \ |
292 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ | 299 | do { \ |
293 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ | 300 | mutex_lock(&event_storage_mutex); \ |
301 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ | ||
302 | snprintf(event_storage, sizeof(event_storage), \ | ||
303 | "%s[%d]", #type, len); \ | ||
304 | ret = trace_define_field(event_call, event_storage, #item, \ | ||
294 | offsetof(typeof(field), item), \ | 305 | offsetof(typeof(field), item), \ |
295 | sizeof(field.item), \ | 306 | sizeof(field.item), \ |
296 | is_signed_type(type), FILTER_OTHER); \ | 307 | is_signed_type(type), FILTER_OTHER); \ |
297 | if (ret) \ | 308 | mutex_unlock(&event_storage_mutex); \ |
298 | return ret; | 309 | if (ret) \ |
310 | return ret; \ | ||
311 | } while (0); | ||
299 | 312 | ||
300 | #undef __dynamic_array | 313 | #undef __dynamic_array |
301 | #define __dynamic_array(type, item, len) \ | 314 | #define __dynamic_array(type, item, len) \ |
diff --git a/include/video/da8xx-fb.h b/include/video/da8xx-fb.h index 6316cdabf73f..89d43b3d4cb9 100644 --- a/include/video/da8xx-fb.h +++ b/include/video/da8xx-fb.h | |||
@@ -99,7 +99,6 @@ struct lcd_sync_arg { | |||
99 | #define FBIPUT_COLOR _IOW('F', 6, int) | 99 | #define FBIPUT_COLOR _IOW('F', 6, int) |
100 | #define FBIPUT_HSYNC _IOW('F', 9, int) | 100 | #define FBIPUT_HSYNC _IOW('F', 9, int) |
101 | #define FBIPUT_VSYNC _IOW('F', 10, int) | 101 | #define FBIPUT_VSYNC _IOW('F', 10, int) |
102 | #define FBIO_WAITFORVSYNC _IOW('F', 0x20, u_int32_t) | ||
103 | 102 | ||
104 | #endif /* ifndef DA8XX_FB_H */ | 103 | #endif /* ifndef DA8XX_FB_H */ |
105 | 104 | ||
diff --git a/include/video/s1d13xxxfb.h b/include/video/s1d13xxxfb.h index f0736cff2ca3..55f534491a3d 100644 --- a/include/video/s1d13xxxfb.h +++ b/include/video/s1d13xxxfb.h | |||
@@ -136,12 +136,6 @@ | |||
136 | #define S1DREG_DELAYOFF 0xFFFE | 136 | #define S1DREG_DELAYOFF 0xFFFE |
137 | #define S1DREG_DELAYON 0xFFFF | 137 | #define S1DREG_DELAYON 0xFFFF |
138 | 138 | ||
139 | #define BBLT_FIFO_EMPTY 0x00 | ||
140 | #define BBLT_FIFO_NOT_EMPTY 0x40 | ||
141 | #define BBLT_FIFO_NOT_FULL 0x30 | ||
142 | #define BBLT_FIFO_HALF_FULL 0x20 | ||
143 | #define BBLT_FIFO_FULL 0x10 | ||
144 | |||
145 | #define BBLT_SOLID_FILL 0x0c | 139 | #define BBLT_SOLID_FILL 0x0c |
146 | 140 | ||
147 | 141 | ||
diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h index 18bca08f9f59..6cb95c977de9 100644 --- a/include/video/sh_mipi_dsi.h +++ b/include/video/sh_mipi_dsi.h | |||
@@ -27,9 +27,15 @@ enum sh_mipi_dsi_data_fmt { | |||
27 | 27 | ||
28 | struct sh_mobile_lcdc_chan_cfg; | 28 | struct sh_mobile_lcdc_chan_cfg; |
29 | 29 | ||
30 | #define SH_MIPI_DSI_HSABM (1 << 0) | ||
31 | #define SH_MIPI_DSI_HSPBM (1 << 1) | ||
32 | |||
30 | struct sh_mipi_dsi_info { | 33 | struct sh_mipi_dsi_info { |
31 | enum sh_mipi_dsi_data_fmt data_format; | 34 | enum sh_mipi_dsi_data_fmt data_format; |
32 | struct sh_mobile_lcdc_chan_cfg *lcd_chan; | 35 | struct sh_mobile_lcdc_chan_cfg *lcd_chan; |
36 | unsigned long flags; | ||
37 | u32 clksrc; | ||
38 | unsigned int vsynw_offset; | ||
33 | }; | 39 | }; |
34 | 40 | ||
35 | #endif | 41 | #endif |
diff --git a/include/video/sh_mobile_hdmi.h b/include/video/sh_mobile_hdmi.h index 1e1aa54ab2e4..b56932927d0a 100644 --- a/include/video/sh_mobile_hdmi.h +++ b/include/video/sh_mobile_hdmi.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | struct sh_mobile_lcdc_chan_cfg; | 14 | struct sh_mobile_lcdc_chan_cfg; |
15 | struct device; | 15 | struct device; |
16 | struct clk; | ||
16 | 17 | ||
17 | /* | 18 | /* |
18 | * flags format | 19 | * flags format |
@@ -33,6 +34,8 @@ struct sh_mobile_hdmi_info { | |||
33 | struct sh_mobile_lcdc_chan_cfg *lcd_chan; | 34 | struct sh_mobile_lcdc_chan_cfg *lcd_chan; |
34 | struct device *lcd_dev; | 35 | struct device *lcd_dev; |
35 | unsigned int flags; | 36 | unsigned int flags; |
37 | long (*clk_optimize_parent)(unsigned long target, unsigned long *best_freq, | ||
38 | unsigned long *parent_freq); | ||
36 | }; | 39 | }; |
37 | 40 | ||
38 | #endif | 41 | #endif |
diff --git a/include/video/udlfb.h b/include/video/udlfb.h new file mode 100644 index 000000000000..69d485a4a026 --- /dev/null +++ b/include/video/udlfb.h | |||
@@ -0,0 +1,95 @@ | |||
1 | #ifndef UDLFB_H | ||
2 | #define UDLFB_H | ||
3 | |||
4 | /* | ||
5 | * TODO: Propose standard fb.h ioctl for reporting damage, | ||
6 | * using _IOWR() and one of the existing area structs from fb.h | ||
7 | * Consider these ioctls deprecated, but they're still used by the | ||
8 | * DisplayLink X server as yet - need both to be modified in tandem | ||
9 | * when new ioctl(s) are ready. | ||
10 | */ | ||
11 | #define DLFB_IOCTL_RETURN_EDID 0xAD | ||
12 | #define DLFB_IOCTL_REPORT_DAMAGE 0xAA | ||
13 | struct dloarea { | ||
14 | int x, y; | ||
15 | int w, h; | ||
16 | int x2, y2; | ||
17 | }; | ||
18 | |||
19 | struct urb_node { | ||
20 | struct list_head entry; | ||
21 | struct dlfb_data *dev; | ||
22 | struct delayed_work release_urb_work; | ||
23 | struct urb *urb; | ||
24 | }; | ||
25 | |||
26 | struct urb_list { | ||
27 | struct list_head list; | ||
28 | spinlock_t lock; | ||
29 | struct semaphore limit_sem; | ||
30 | int available; | ||
31 | int count; | ||
32 | size_t size; | ||
33 | }; | ||
34 | |||
35 | struct dlfb_data { | ||
36 | struct usb_device *udev; | ||
37 | struct device *gdev; /* &udev->dev */ | ||
38 | struct fb_info *info; | ||
39 | struct urb_list urbs; | ||
40 | struct kref kref; | ||
41 | char *backing_buffer; | ||
42 | int fb_count; | ||
43 | bool virtualized; /* true when physical usb device not present */ | ||
44 | struct delayed_work free_framebuffer_work; | ||
45 | atomic_t usb_active; /* 0 = update virtual buffer, but no usb traffic */ | ||
46 | atomic_t lost_pixels; /* 1 = a render op failed. Need screen refresh */ | ||
47 | char *edid; /* null until we read edid from hw or get from sysfs */ | ||
48 | size_t edid_size; | ||
49 | int sku_pixel_limit; | ||
50 | int base16; | ||
51 | int base8; | ||
52 | u32 pseudo_palette[256]; | ||
53 | /* blit-only rendering path metrics, exposed through sysfs */ | ||
54 | atomic_t bytes_rendered; /* raw pixel-bytes driver asked to render */ | ||
55 | atomic_t bytes_identical; /* saved effort with backbuffer comparison */ | ||
56 | atomic_t bytes_sent; /* to usb, after compression including overhead */ | ||
57 | atomic_t cpu_kcycles_used; /* transpired during pixel processing */ | ||
58 | }; | ||
59 | |||
60 | #define NR_USB_REQUEST_I2C_SUB_IO 0x02 | ||
61 | #define NR_USB_REQUEST_CHANNEL 0x12 | ||
62 | |||
63 | /* -BULK_SIZE as per usb-skeleton. Can we get full page and avoid overhead? */ | ||
64 | #define BULK_SIZE 512 | ||
65 | #define MAX_TRANSFER (PAGE_SIZE*16 - BULK_SIZE) | ||
66 | #define WRITES_IN_FLIGHT (4) | ||
67 | |||
68 | #define MAX_VENDOR_DESCRIPTOR_SIZE 256 | ||
69 | |||
70 | #define GET_URB_TIMEOUT HZ | ||
71 | #define FREE_URB_TIMEOUT (HZ*2) | ||
72 | |||
73 | #define BPP 2 | ||
74 | #define MAX_CMD_PIXELS 255 | ||
75 | |||
76 | #define RLX_HEADER_BYTES 7 | ||
77 | #define MIN_RLX_PIX_BYTES 4 | ||
78 | #define MIN_RLX_CMD_BYTES (RLX_HEADER_BYTES + MIN_RLX_PIX_BYTES) | ||
79 | |||
80 | #define RLE_HEADER_BYTES 6 | ||
81 | #define MIN_RLE_PIX_BYTES 3 | ||
82 | #define MIN_RLE_CMD_BYTES (RLE_HEADER_BYTES + MIN_RLE_PIX_BYTES) | ||
83 | |||
84 | #define RAW_HEADER_BYTES 6 | ||
85 | #define MIN_RAW_PIX_BYTES 2 | ||
86 | #define MIN_RAW_CMD_BYTES (RAW_HEADER_BYTES + MIN_RAW_PIX_BYTES) | ||
87 | |||
88 | #define DL_DEFIO_WRITE_DELAY 5 /* fb_deferred_io.delay in jiffies */ | ||
89 | #define DL_DEFIO_WRITE_DISABLE (HZ*60) /* "disable" with long delay */ | ||
90 | |||
91 | /* remove these once align.h patch is taken into kernel */ | ||
92 | #define DL_ALIGN_UP(x, a) ALIGN(x, a) | ||
93 | #define DL_ALIGN_DOWN(x, a) ALIGN(x-(a-1), a) | ||
94 | |||
95 | #endif | ||
diff --git a/include/xen/events.h b/include/xen/events.h index 646dd17d3aa4..00f53ddcc062 100644 --- a/include/xen/events.h +++ b/include/xen/events.h | |||
@@ -76,7 +76,9 @@ int xen_map_pirq_gsi(unsigned pirq, unsigned gsi, int shareable, char *name); | |||
76 | 76 | ||
77 | #ifdef CONFIG_PCI_MSI | 77 | #ifdef CONFIG_PCI_MSI |
78 | /* Allocate an irq and a pirq to be used with MSIs. */ | 78 | /* Allocate an irq and a pirq to be used with MSIs. */ |
79 | void xen_allocate_pirq_msi(char *name, int *irq, int *pirq); | 79 | #define XEN_ALLOC_PIRQ (1 << 0) |
80 | #define XEN_ALLOC_IRQ (1 << 1) | ||
81 | void xen_allocate_pirq_msi(char *name, int *irq, int *pirq, int alloc_mask); | ||
80 | int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type); | 82 | int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type); |
81 | #endif | 83 | #endif |
82 | 84 | ||
@@ -89,4 +91,7 @@ int xen_vector_from_irq(unsigned pirq); | |||
89 | /* Return gsi allocated to pirq */ | 91 | /* Return gsi allocated to pirq */ |
90 | int xen_gsi_from_irq(unsigned pirq); | 92 | int xen_gsi_from_irq(unsigned pirq); |
91 | 93 | ||
94 | /* Return irq from pirq */ | ||
95 | int xen_irq_from_pirq(unsigned pirq); | ||
96 | |||
92 | #endif /* _XEN_EVENTS_H */ | 97 | #endif /* _XEN_EVENTS_H */ |
diff --git a/include/xen/interface/io/ring.h b/include/xen/interface/io/ring.h index e8cbf431c8cc..75271b9a8f61 100644 --- a/include/xen/interface/io/ring.h +++ b/include/xen/interface/io/ring.h | |||
@@ -24,8 +24,15 @@ typedef unsigned int RING_IDX; | |||
24 | * A ring contains as many entries as will fit, rounded down to the nearest | 24 | * A ring contains as many entries as will fit, rounded down to the nearest |
25 | * power of two (so we can mask with (size-1) to loop around). | 25 | * power of two (so we can mask with (size-1) to loop around). |
26 | */ | 26 | */ |
27 | #define __RING_SIZE(_s, _sz) \ | 27 | #define __CONST_RING_SIZE(_s, _sz) \ |
28 | (__RD32(((_sz) - (long)&(_s)->ring + (long)(_s)) / sizeof((_s)->ring[0]))) | 28 | (__RD32(((_sz) - offsetof(struct _s##_sring, ring)) / \ |
29 | sizeof(((struct _s##_sring *)0)->ring[0]))) | ||
30 | |||
31 | /* | ||
32 | * The same for passing in an actual pointer instead of a name tag. | ||
33 | */ | ||
34 | #define __RING_SIZE(_s, _sz) \ | ||
35 | (__RD32(((_sz) - (long)&(_s)->ring + (long)(_s)) / sizeof((_s)->ring[0]))) | ||
29 | 36 | ||
30 | /* | 37 | /* |
31 | * Macros to make the correct C datatypes for a new kind of ring. | 38 | * Macros to make the correct C datatypes for a new kind of ring. |
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h index d7a6c13bde69..eac3ce153719 100644 --- a/include/xen/interface/memory.h +++ b/include/xen/interface/memory.h | |||
@@ -141,6 +141,19 @@ struct xen_machphys_mfn_list { | |||
141 | DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mfn_list); | 141 | DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mfn_list); |
142 | 142 | ||
143 | /* | 143 | /* |
144 | * Returns the location in virtual address space of the machine_to_phys | ||
145 | * mapping table. Architectures which do not have a m2p table, or which do not | ||
146 | * map it by default into guest address space, do not implement this command. | ||
147 | * arg == addr of xen_machphys_mapping_t. | ||
148 | */ | ||
149 | #define XENMEM_machphys_mapping 12 | ||
150 | struct xen_machphys_mapping { | ||
151 | unsigned long v_start, v_end; /* Start and end virtual addresses. */ | ||
152 | unsigned long max_mfn; /* Maximum MFN that can be looked up. */ | ||
153 | }; | ||
154 | DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mapping_t); | ||
155 | |||
156 | /* | ||
144 | * Sets the GPFN at which a particular page appears in the specified guest's | 157 | * Sets the GPFN at which a particular page appears in the specified guest's |
145 | * pseudophysical address space. | 158 | * pseudophysical address space. |
146 | * arg == addr of xen_add_to_physmap_t. | 159 | * arg == addr of xen_add_to_physmap_t. |
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h index 2b2c66c3df00..534cac89a77d 100644 --- a/include/xen/interface/physdev.h +++ b/include/xen/interface/physdev.h | |||
@@ -188,6 +188,16 @@ struct physdev_nr_pirqs { | |||
188 | uint32_t nr_pirqs; | 188 | uint32_t nr_pirqs; |
189 | }; | 189 | }; |
190 | 190 | ||
191 | /* type is MAP_PIRQ_TYPE_GSI or MAP_PIRQ_TYPE_MSI | ||
192 | * the hypercall returns a free pirq */ | ||
193 | #define PHYSDEVOP_get_free_pirq 23 | ||
194 | struct physdev_get_free_pirq { | ||
195 | /* IN */ | ||
196 | int type; | ||
197 | /* OUT */ | ||
198 | uint32_t pirq; | ||
199 | }; | ||
200 | |||
191 | /* | 201 | /* |
192 | * Notify that some PIRQ-bound event channels have been unmasked. | 202 | * Notify that some PIRQ-bound event channels have been unmasked. |
193 | * ** This command is obsolete since interface version 0x00030202 and is ** | 203 | * ** This command is obsolete since interface version 0x00030202 and is ** |
diff --git a/include/xen/page.h b/include/xen/page.h index eaf85fab1263..0be36b976f4b 100644 --- a/include/xen/page.h +++ b/include/xen/page.h | |||
@@ -1 +1,8 @@ | |||
1 | #ifndef _XEN_PAGE_H | ||
2 | #define _XEN_PAGE_H | ||
3 | |||
1 | #include <asm/xen/page.h> | 4 | #include <asm/xen/page.h> |
5 | |||
6 | extern phys_addr_t xen_extra_mem_start, xen_extra_mem_size; | ||
7 | |||
8 | #endif /* _XEN_PAGE_H */ | ||
diff --git a/include/xen/privcmd.h b/include/xen/privcmd.h index b42cdfd92fee..17857fb4d550 100644 --- a/include/xen/privcmd.h +++ b/include/xen/privcmd.h | |||
@@ -34,13 +34,10 @@ | |||
34 | #define __LINUX_PUBLIC_PRIVCMD_H__ | 34 | #define __LINUX_PUBLIC_PRIVCMD_H__ |
35 | 35 | ||
36 | #include <linux/types.h> | 36 | #include <linux/types.h> |
37 | #include <linux/compiler.h> | ||
37 | 38 | ||
38 | typedef unsigned long xen_pfn_t; | 39 | typedef unsigned long xen_pfn_t; |
39 | 40 | ||
40 | #ifndef __user | ||
41 | #define __user | ||
42 | #endif | ||
43 | |||
44 | struct privcmd_hypercall { | 41 | struct privcmd_hypercall { |
45 | __u64 op; | 42 | __u64 op; |
46 | __u64 arg[5]; | 43 | __u64 arg[5]; |