diff options
Diffstat (limited to 'include/linux')
167 files changed, 3653 insertions, 1244 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index a17177639376..702f79dad16a 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -236,6 +236,7 @@ int acpi_check_mem_region(resource_size_t start, resource_size_t n, | |||
236 | const char *name); | 236 | const char *name); |
237 | 237 | ||
238 | #ifdef CONFIG_PM_SLEEP | 238 | #ifdef CONFIG_PM_SLEEP |
239 | void __init acpi_no_s4_hw_signature(void); | ||
239 | void __init acpi_old_suspend_ordering(void); | 240 | void __init acpi_old_suspend_ordering(void); |
240 | #endif /* CONFIG_PM_SLEEP */ | 241 | #endif /* CONFIG_PM_SLEEP */ |
241 | #else /* CONFIG_ACPI */ | 242 | #else /* CONFIG_ACPI */ |
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h index 6129e58ca7c9..e0a0cdc2da43 100644 --- a/include/linux/anon_inodes.h +++ b/include/linux/anon_inodes.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #define _LINUX_ANON_INODES_H | 9 | #define _LINUX_ANON_INODES_H |
10 | 10 | ||
11 | int anon_inode_getfd(const char *name, const struct file_operations *fops, | 11 | int anon_inode_getfd(const char *name, const struct file_operations *fops, |
12 | void *priv); | 12 | void *priv, int flags); |
13 | 13 | ||
14 | #endif /* _LINUX_ANON_INODES_H */ | 14 | #endif /* _LINUX_ANON_INODES_H */ |
15 | 15 | ||
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h index eb640f0acfac..0f50d4cc4360 100644 --- a/include/linux/async_tx.h +++ b/include/linux/async_tx.h | |||
@@ -101,21 +101,14 @@ async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, | |||
101 | 101 | ||
102 | /** | 102 | /** |
103 | * async_tx_sync_epilog - actions to take if an operation is run synchronously | 103 | * async_tx_sync_epilog - actions to take if an operation is run synchronously |
104 | * @flags: async_tx flags | ||
105 | * @depend_tx: transaction depends on depend_tx | ||
106 | * @cb_fn: function to call when the transaction completes | 104 | * @cb_fn: function to call when the transaction completes |
107 | * @cb_fn_param: parameter to pass to the callback routine | 105 | * @cb_fn_param: parameter to pass to the callback routine |
108 | */ | 106 | */ |
109 | static inline void | 107 | static inline void |
110 | async_tx_sync_epilog(unsigned long flags, | 108 | async_tx_sync_epilog(dma_async_tx_callback cb_fn, void *cb_fn_param) |
111 | struct dma_async_tx_descriptor *depend_tx, | ||
112 | dma_async_tx_callback cb_fn, void *cb_fn_param) | ||
113 | { | 109 | { |
114 | if (cb_fn) | 110 | if (cb_fn) |
115 | cb_fn(cb_fn_param); | 111 | cb_fn(cb_fn_param); |
116 | |||
117 | if (depend_tx && (flags & ASYNC_TX_DEP_ACK)) | ||
118 | async_tx_ack(depend_tx); | ||
119 | } | 112 | } |
120 | 113 | ||
121 | void | 114 | void |
@@ -152,4 +145,6 @@ struct dma_async_tx_descriptor * | |||
152 | async_trigger_callback(enum async_tx_flags flags, | 145 | async_trigger_callback(enum async_tx_flags flags, |
153 | struct dma_async_tx_descriptor *depend_tx, | 146 | struct dma_async_tx_descriptor *depend_tx, |
154 | dma_async_tx_callback cb_fn, void *cb_fn_param); | 147 | dma_async_tx_callback cb_fn, void *cb_fn_param); |
148 | |||
149 | void async_tx_quiesce(struct dma_async_tx_descriptor **tx); | ||
155 | #endif /* _ASYNC_TX_H_ */ | 150 | #endif /* _ASYNC_TX_H_ */ |
diff --git a/include/linux/atmel-pwm-bl.h b/include/linux/atmel-pwm-bl.h new file mode 100644 index 000000000000..0153a47806c2 --- /dev/null +++ b/include/linux/atmel-pwm-bl.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Atmel Corporation | ||
3 | * | ||
4 | * Driver for the AT32AP700X PS/2 controller (PSIF). | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License version 2 as published | ||
8 | * by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __INCLUDE_ATMEL_PWM_BL_H | ||
12 | #define __INCLUDE_ATMEL_PWM_BL_H | ||
13 | |||
14 | /** | ||
15 | * struct atmel_pwm_bl_platform_data | ||
16 | * @pwm_channel: which PWM channel in the PWM module to use. | ||
17 | * @pwm_frequency: PWM frequency to generate, the driver will try to be as | ||
18 | * close as the prescaler allows. | ||
19 | * @pwm_compare_max: value to use in the PWM channel compare register. | ||
20 | * @pwm_duty_max: maximum duty cycle value, must be less than or equal to | ||
21 | * pwm_compare_max. | ||
22 | * @pwm_duty_min: minimum duty cycle value, must be less than pwm_duty_max. | ||
23 | * @pwm_active_low: set to one if the low part of the PWM signal increases the | ||
24 | * brightness of the backlight. | ||
25 | * @gpio_on: GPIO line to control the backlight on/off, set to -1 if not used. | ||
26 | * @on_active_low: set to one if the on/off signal is on when GPIO is low. | ||
27 | * | ||
28 | * This struct must be added to the platform device in the board code. It is | ||
29 | * used by the atmel-pwm-bl driver to setup the GPIO to control on/off and the | ||
30 | * PWM device. | ||
31 | */ | ||
32 | struct atmel_pwm_bl_platform_data { | ||
33 | unsigned int pwm_channel; | ||
34 | unsigned int pwm_frequency; | ||
35 | unsigned int pwm_compare_max; | ||
36 | unsigned int pwm_duty_max; | ||
37 | unsigned int pwm_duty_min; | ||
38 | unsigned int pwm_active_low; | ||
39 | int gpio_on; | ||
40 | unsigned int on_active_low; | ||
41 | }; | ||
42 | |||
43 | #endif /* __INCLUDE_ATMEL_PWM_BL_H */ | ||
diff --git a/include/linux/audit.h b/include/linux/audit.h index 8b82974bdc12..6272a395d43c 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -286,7 +286,6 @@ | |||
286 | #define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) | 286 | #define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) |
287 | #define AUDIT_ARCH_SPARC (EM_SPARC) | 287 | #define AUDIT_ARCH_SPARC (EM_SPARC) |
288 | #define AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT) | 288 | #define AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT) |
289 | #define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE) | ||
290 | #define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) | 289 | #define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) |
291 | 290 | ||
292 | #define AUDIT_PERM_EXEC 1 | 291 | #define AUDIT_PERM_EXEC 1 |
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h index 31a29541b504..b785c6f8644d 100644 --- a/include/linux/auto_fs4.h +++ b/include/linux/auto_fs4.h | |||
@@ -98,8 +98,6 @@ union autofs_v5_packet_union { | |||
98 | #define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI | 98 | #define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI |
99 | #define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI | 99 | #define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI |
100 | #define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int) | 100 | #define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int) |
101 | #define AUTOFS_IOC_ASKREGHOST _IOR(0x93,0x68,int) | ||
102 | #define AUTOFS_IOC_TOGGLEREGHOST _IOR(0x93,0x69,int) | ||
103 | #define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int) | 101 | #define AUTOFS_IOC_ASKUMOUNT _IOR(0x93,0x70,int) |
104 | 102 | ||
105 | 103 | ||
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h index ad895455ab72..0da17d14fd13 100644 --- a/include/linux/auxvec.h +++ b/include/linux/auxvec.h | |||
@@ -26,8 +26,10 @@ | |||
26 | 26 | ||
27 | #define AT_SECURE 23 /* secure mode boolean */ | 27 | #define AT_SECURE 23 /* secure mode boolean */ |
28 | 28 | ||
29 | #define AT_EXECFN 31 /* filename of program */ | ||
29 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
30 | #define AT_VECTOR_SIZE_BASE (14 + 2) /* NEW_AUX_ENT entries in auxiliary table */ | 31 | #define AT_VECTOR_SIZE_BASE 17 /* NEW_AUX_ENT entries in auxiliary table */ |
32 | /* number of "#define AT_.*" above, minus {AT_NULL, AT_IGNORE, AT_NOTELF} */ | ||
31 | #endif | 33 | #endif |
32 | 34 | ||
33 | #endif /* _LINUX_AUXVEC_H */ | 35 | #endif /* _LINUX_AUXVEC_H */ |
diff --git a/include/linux/bcd.h b/include/linux/bcd.h index c545308125b0..7ac518e3c152 100644 --- a/include/linux/bcd.h +++ b/include/linux/bcd.h | |||
@@ -10,8 +10,13 @@ | |||
10 | #ifndef _BCD_H | 10 | #ifndef _BCD_H |
11 | #define _BCD_H | 11 | #define _BCD_H |
12 | 12 | ||
13 | #define BCD2BIN(val) (((val) & 0x0f) + ((val)>>4)*10) | 13 | #include <linux/compiler.h> |
14 | #define BIN2BCD(val) ((((val)/10)<<4) + (val)%10) | 14 | |
15 | unsigned bcd2bin(unsigned char val) __attribute_const__; | ||
16 | unsigned char bin2bcd(unsigned val) __attribute_const__; | ||
17 | |||
18 | #define BCD2BIN(val) bcd2bin(val) | ||
19 | #define BIN2BCD(val) bin2bcd(val) | ||
15 | 20 | ||
16 | /* backwards compat */ | 21 | /* backwards compat */ |
17 | #define BCD_TO_BIN(val) ((val)=BCD2BIN(val)) | 22 | #define BCD_TO_BIN(val) ((val)=BCD2BIN(val)) |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index ee0ed48e8348..826f62350805 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -38,7 +38,7 @@ struct linux_binprm{ | |||
38 | misc_bang:1; | 38 | misc_bang:1; |
39 | struct file * file; | 39 | struct file * file; |
40 | int e_uid, e_gid; | 40 | int e_uid, e_gid; |
41 | kernel_cap_t cap_inheritable, cap_permitted; | 41 | kernel_cap_t cap_post_exec_permitted; |
42 | bool cap_effective; | 42 | bool cap_effective; |
43 | void *security; | 43 | void *security; |
44 | int argc, envc; | 44 | int argc, envc; |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index a1d9b79078ea..4ddf2922fc8d 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -28,52 +28,73 @@ extern unsigned long saved_max_pfn; | |||
28 | * memory pages (including holes) on the node. | 28 | * memory pages (including holes) on the node. |
29 | */ | 29 | */ |
30 | typedef struct bootmem_data { | 30 | typedef struct bootmem_data { |
31 | unsigned long node_boot_start; | 31 | unsigned long node_min_pfn; |
32 | unsigned long node_low_pfn; | 32 | unsigned long node_low_pfn; |
33 | void *node_bootmem_map; | 33 | void *node_bootmem_map; |
34 | unsigned long last_offset; | 34 | unsigned long last_end_off; |
35 | unsigned long last_pos; | 35 | unsigned long hint_idx; |
36 | unsigned long last_success; /* Previous allocation point. To speed | ||
37 | * up searching */ | ||
38 | struct list_head list; | 36 | struct list_head list; |
39 | } bootmem_data_t; | 37 | } bootmem_data_t; |
40 | 38 | ||
39 | extern bootmem_data_t bootmem_node_data[]; | ||
40 | |||
41 | extern unsigned long bootmem_bootmap_pages(unsigned long); | 41 | extern unsigned long bootmem_bootmap_pages(unsigned long); |
42 | |||
43 | extern unsigned long init_bootmem_node(pg_data_t *pgdat, | ||
44 | unsigned long freepfn, | ||
45 | unsigned long startpfn, | ||
46 | unsigned long endpfn); | ||
42 | extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); | 47 | extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); |
48 | |||
49 | extern unsigned long free_all_bootmem_node(pg_data_t *pgdat); | ||
50 | extern unsigned long free_all_bootmem(void); | ||
51 | |||
52 | extern void free_bootmem_node(pg_data_t *pgdat, | ||
53 | unsigned long addr, | ||
54 | unsigned long size); | ||
43 | extern void free_bootmem(unsigned long addr, unsigned long size); | 55 | extern void free_bootmem(unsigned long addr, unsigned long size); |
44 | extern void *__alloc_bootmem(unsigned long size, | 56 | |
57 | /* | ||
58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | ||
59 | * the architecture-specific code should honor this). | ||
60 | * | ||
61 | * If flags is 0, then the return value is always 0 (success). If | ||
62 | * flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the | ||
63 | * memory already was reserved. | ||
64 | */ | ||
65 | #define BOOTMEM_DEFAULT 0 | ||
66 | #define BOOTMEM_EXCLUSIVE (1<<0) | ||
67 | |||
68 | extern int reserve_bootmem_node(pg_data_t *pgdat, | ||
69 | unsigned long physaddr, | ||
70 | unsigned long size, | ||
71 | int flags); | ||
72 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | ||
73 | extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags); | ||
74 | #endif | ||
75 | |||
76 | extern void *__alloc_bootmem_nopanic(unsigned long size, | ||
45 | unsigned long align, | 77 | unsigned long align, |
46 | unsigned long goal); | 78 | unsigned long goal); |
47 | extern void *__alloc_bootmem_nopanic(unsigned long size, | 79 | extern void *__alloc_bootmem(unsigned long size, |
48 | unsigned long align, | 80 | unsigned long align, |
49 | unsigned long goal); | 81 | unsigned long goal); |
50 | extern void *__alloc_bootmem_low(unsigned long size, | 82 | extern void *__alloc_bootmem_low(unsigned long size, |
51 | unsigned long align, | 83 | unsigned long align, |
52 | unsigned long goal); | 84 | unsigned long goal); |
85 | extern void *__alloc_bootmem_node(pg_data_t *pgdat, | ||
86 | unsigned long size, | ||
87 | unsigned long align, | ||
88 | unsigned long goal); | ||
89 | extern void *__alloc_bootmem_node_nopanic(pg_data_t *pgdat, | ||
90 | unsigned long size, | ||
91 | unsigned long align, | ||
92 | unsigned long goal); | ||
53 | extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | 93 | extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, |
54 | unsigned long size, | 94 | unsigned long size, |
55 | unsigned long align, | 95 | unsigned long align, |
56 | unsigned long goal); | 96 | unsigned long goal); |
57 | extern void *__alloc_bootmem_core(struct bootmem_data *bdata, | ||
58 | unsigned long size, | ||
59 | unsigned long align, | ||
60 | unsigned long goal, | ||
61 | unsigned long limit); | ||
62 | |||
63 | /* | ||
64 | * flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | ||
65 | * the architecture-specific code should honor this) | ||
66 | */ | ||
67 | #define BOOTMEM_DEFAULT 0 | ||
68 | #define BOOTMEM_EXCLUSIVE (1<<0) | ||
69 | |||
70 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 97 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
71 | /* | ||
72 | * If flags is 0, then the return value is always 0 (success). If | ||
73 | * flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the | ||
74 | * memory already was reserved. | ||
75 | */ | ||
76 | extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags); | ||
77 | #define alloc_bootmem(x) \ | 98 | #define alloc_bootmem(x) \ |
78 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 99 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
79 | #define alloc_bootmem_low(x) \ | 100 | #define alloc_bootmem_low(x) \ |
@@ -86,34 +107,16 @@ extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags); | |||
86 | 107 | ||
87 | extern int reserve_bootmem_generic(unsigned long addr, unsigned long size, | 108 | extern int reserve_bootmem_generic(unsigned long addr, unsigned long size, |
88 | int flags); | 109 | int flags); |
89 | extern unsigned long free_all_bootmem(void); | ||
90 | extern unsigned long free_all_bootmem_node(pg_data_t *pgdat); | ||
91 | extern void *__alloc_bootmem_node(pg_data_t *pgdat, | ||
92 | unsigned long size, | ||
93 | unsigned long align, | ||
94 | unsigned long goal); | ||
95 | extern unsigned long init_bootmem_node(pg_data_t *pgdat, | ||
96 | unsigned long freepfn, | ||
97 | unsigned long startpfn, | ||
98 | unsigned long endpfn); | ||
99 | extern int reserve_bootmem_node(pg_data_t *pgdat, | ||
100 | unsigned long physaddr, | ||
101 | unsigned long size, | ||
102 | int flags); | ||
103 | extern void free_bootmem_node(pg_data_t *pgdat, | ||
104 | unsigned long addr, | ||
105 | unsigned long size); | ||
106 | extern void *alloc_bootmem_section(unsigned long size, | ||
107 | unsigned long section_nr); | ||
108 | 110 | ||
109 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | ||
110 | #define alloc_bootmem_node(pgdat, x) \ | 111 | #define alloc_bootmem_node(pgdat, x) \ |
111 | __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 112 | __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
112 | #define alloc_bootmem_pages_node(pgdat, x) \ | 113 | #define alloc_bootmem_pages_node(pgdat, x) \ |
113 | __alloc_bootmem_node(pgdat, x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 114 | __alloc_bootmem_node(pgdat, x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) |
114 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | 115 | #define alloc_bootmem_low_pages_node(pgdat, x) \ |
115 | __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) | 116 | __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) |
116 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ | 117 | |
118 | extern void *alloc_bootmem_section(unsigned long size, | ||
119 | unsigned long section_nr); | ||
117 | 120 | ||
118 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP | 121 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP |
119 | extern void *alloc_remap(int nid, unsigned long size); | 122 | extern void *alloc_remap(int nid, unsigned long size); |
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h new file mode 100644 index 000000000000..9b64b6d67873 --- /dev/null +++ b/include/linux/brcmphy.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #define PHY_BRCM_WIRESPEED_ENABLE 0x00000001 | ||
2 | #define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000002 | ||
3 | #define PHY_BRCM_APD_CLK125_ENABLE 0x00000004 | ||
4 | #define PHY_BRCM_STD_IBND_DISABLE 0x00000008 | ||
5 | #define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00000010 | ||
6 | #define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00000020 | ||
diff --git a/include/linux/configfs.h b/include/linux/configfs.h index 0488f937634a..d62c19ff041c 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h | |||
@@ -148,7 +148,8 @@ struct configfs_attribute { | |||
148 | * items. If the item is a group, it may support mkdir(2). | 148 | * items. If the item is a group, it may support mkdir(2). |
149 | * Groups supply one of make_group() and make_item(). If the | 149 | * Groups supply one of make_group() and make_item(). If the |
150 | * group supports make_group(), one can create group children. If it | 150 | * group supports make_group(), one can create group children. If it |
151 | * supports make_item(), one can create config_item children. If it has | 151 | * supports make_item(), one can create config_item children. make_group() |
152 | * and make_item() return ERR_PTR() on errors. If it has | ||
152 | * default_groups on group->default_groups, it has automatically created | 153 | * default_groups on group->default_groups, it has automatically created |
153 | * group children. default_groups may coexist alongsize make_group() or | 154 | * group children. default_groups may coexist alongsize make_group() or |
154 | * make_item(), but if the group wishes to have only default_groups | 155 | * make_item(), but if the group wishes to have only default_groups |
@@ -165,8 +166,8 @@ struct configfs_item_operations { | |||
165 | }; | 166 | }; |
166 | 167 | ||
167 | struct configfs_group_operations { | 168 | struct configfs_group_operations { |
168 | int (*make_item)(struct config_group *group, const char *name, struct config_item **new_item); | 169 | struct config_item *(*make_item)(struct config_group *group, const char *name); |
169 | int (*make_group)(struct config_group *group, const char *name, struct config_group **new_group); | 170 | struct config_group *(*make_group)(struct config_group *group, const char *name); |
170 | int (*commit_item)(struct config_item *item); | 171 | int (*commit_item)(struct config_item *item); |
171 | void (*disconnect_notify)(struct config_group *group, struct config_item *item); | 172 | void (*disconnect_notify)(struct config_group *group, struct config_item *item); |
172 | void (*drop_item)(struct config_group *group, struct config_item *item); | 173 | void (*drop_item)(struct config_group *group, struct config_item *item); |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index e7e91dbfde0f..2270ca5ec631 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -4,9 +4,6 @@ | |||
4 | * Copyright (C) 2001 Russell King | 4 | * Copyright (C) 2001 Russell King |
5 | * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> | 5 | * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> |
6 | * | 6 | * |
7 | * | ||
8 | * $Id: cpufreq.h,v 1.36 2003/01/20 17:31:48 db Exp $ | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
12 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index c24875bd9c5b..1b5c98e7fef7 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -17,6 +17,20 @@ | |||
17 | * For details of cpus_onto(), see bitmap_onto in lib/bitmap.c. | 17 | * For details of cpus_onto(), see bitmap_onto in lib/bitmap.c. |
18 | * For details of cpus_fold(), see bitmap_fold in lib/bitmap.c. | 18 | * For details of cpus_fold(), see bitmap_fold in lib/bitmap.c. |
19 | * | 19 | * |
20 | * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | ||
21 | * Note: The alternate operations with the suffix "_nr" are used | ||
22 | * to limit the range of the loop to nr_cpu_ids instead of | ||
23 | * NR_CPUS when NR_CPUS > 64 for performance reasons. | ||
24 | * If NR_CPUS is <= 64 then most assembler bitmask | ||
25 | * operators execute faster with a constant range, so | ||
26 | * the operator will continue to use NR_CPUS. | ||
27 | * | ||
28 | * Another consideration is that nr_cpu_ids is initialized | ||
29 | * to NR_CPUS and isn't lowered until the possible cpus are | ||
30 | * discovered (including any disabled cpus). So early uses | ||
31 | * will span the entire range of NR_CPUS. | ||
32 | * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | ||
33 | * | ||
20 | * The available cpumask operations are: | 34 | * The available cpumask operations are: |
21 | * | 35 | * |
22 | * void cpu_set(cpu, mask) turn on bit 'cpu' in mask | 36 | * void cpu_set(cpu, mask) turn on bit 'cpu' in mask |
@@ -38,18 +52,60 @@ | |||
38 | * int cpus_empty(mask) Is mask empty (no bits sets)? | 52 | * int cpus_empty(mask) Is mask empty (no bits sets)? |
39 | * int cpus_full(mask) Is mask full (all bits sets)? | 53 | * int cpus_full(mask) Is mask full (all bits sets)? |
40 | * int cpus_weight(mask) Hamming weigh - number of set bits | 54 | * int cpus_weight(mask) Hamming weigh - number of set bits |
55 | * int cpus_weight_nr(mask) Same using nr_cpu_ids instead of NR_CPUS | ||
41 | * | 56 | * |
42 | * void cpus_shift_right(dst, src, n) Shift right | 57 | * void cpus_shift_right(dst, src, n) Shift right |
43 | * void cpus_shift_left(dst, src, n) Shift left | 58 | * void cpus_shift_left(dst, src, n) Shift left |
44 | * | 59 | * |
45 | * int first_cpu(mask) Number lowest set bit, or NR_CPUS | 60 | * int first_cpu(mask) Number lowest set bit, or NR_CPUS |
46 | * int next_cpu(cpu, mask) Next cpu past 'cpu', or NR_CPUS | 61 | * int next_cpu(cpu, mask) Next cpu past 'cpu', or NR_CPUS |
62 | * int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids | ||
47 | * | 63 | * |
48 | * cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set | 64 | * cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set |
65 | *ifdef CONFIG_HAS_CPUMASK_OF_CPU | ||
66 | * cpumask_of_cpu_ptr_declare(v) Declares cpumask_t *v | ||
67 | * cpumask_of_cpu_ptr_next(v, cpu) Sets v = &cpumask_of_cpu_map[cpu] | ||
68 | * cpumask_of_cpu_ptr(v, cpu) Combines above two operations | ||
69 | *else | ||
70 | * cpumask_of_cpu_ptr_declare(v) Declares cpumask_t _v and *v = &_v | ||
71 | * cpumask_of_cpu_ptr_next(v, cpu) Sets _v = cpumask_of_cpu(cpu) | ||
72 | * cpumask_of_cpu_ptr(v, cpu) Combines above two operations | ||
73 | *endif | ||
49 | * CPU_MASK_ALL Initializer - all bits set | 74 | * CPU_MASK_ALL Initializer - all bits set |
50 | * CPU_MASK_NONE Initializer - no bits set | 75 | * CPU_MASK_NONE Initializer - no bits set |
51 | * unsigned long *cpus_addr(mask) Array of unsigned long's in mask | 76 | * unsigned long *cpus_addr(mask) Array of unsigned long's in mask |
52 | * | 77 | * |
78 | * CPUMASK_ALLOC kmalloc's a structure that is a composite of many cpumask_t | ||
79 | * variables, and CPUMASK_PTR provides pointers to each field. | ||
80 | * | ||
81 | * The structure should be defined something like this: | ||
82 | * struct my_cpumasks { | ||
83 | * cpumask_t mask1; | ||
84 | * cpumask_t mask2; | ||
85 | * }; | ||
86 | * | ||
87 | * Usage is then: | ||
88 | * CPUMASK_ALLOC(my_cpumasks); | ||
89 | * CPUMASK_PTR(mask1, my_cpumasks); | ||
90 | * CPUMASK_PTR(mask2, my_cpumasks); | ||
91 | * | ||
92 | * --- DO NOT reference cpumask_t pointers until this check --- | ||
93 | * if (my_cpumasks == NULL) | ||
94 | * "kmalloc failed"... | ||
95 | * | ||
96 | * References are now pointers to the cpumask_t variables (*mask1, ...) | ||
97 | * | ||
98 | *if NR_CPUS > BITS_PER_LONG | ||
99 | * CPUMASK_ALLOC(m) Declares and allocates struct m *m = | ||
100 | * kmalloc(sizeof(*m), GFP_KERNEL) | ||
101 | * CPUMASK_FREE(m) Macro for kfree(m) | ||
102 | *else | ||
103 | * CPUMASK_ALLOC(m) Declares struct m _m, *m = &_m | ||
104 | * CPUMASK_FREE(m) Nop | ||
105 | *endif | ||
106 | * CPUMASK_PTR(v, m) Declares cpumask_t *v = &(m->v) | ||
107 | * ------------------------------------------------------------------------ | ||
108 | * | ||
53 | * int cpumask_scnprintf(buf, len, mask) Format cpumask for printing | 109 | * int cpumask_scnprintf(buf, len, mask) Format cpumask for printing |
54 | * int cpumask_parse_user(ubuf, ulen, mask) Parse ascii string as cpumask | 110 | * int cpumask_parse_user(ubuf, ulen, mask) Parse ascii string as cpumask |
55 | * int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing | 111 | * int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing |
@@ -59,7 +115,8 @@ | |||
59 | * void cpus_onto(dst, orig, relmap) *dst = orig relative to relmap | 115 | * void cpus_onto(dst, orig, relmap) *dst = orig relative to relmap |
60 | * void cpus_fold(dst, orig, sz) dst bits = orig bits mod sz | 116 | * void cpus_fold(dst, orig, sz) dst bits = orig bits mod sz |
61 | * | 117 | * |
62 | * for_each_cpu_mask(cpu, mask) for-loop cpu over mask | 118 | * for_each_cpu_mask(cpu, mask) for-loop cpu over mask using NR_CPUS |
119 | * for_each_cpu_mask_nr(cpu, mask) for-loop cpu over mask using nr_cpu_ids | ||
63 | * | 120 | * |
64 | * int num_online_cpus() Number of online CPUs | 121 | * int num_online_cpus() Number of online CPUs |
65 | * int num_possible_cpus() Number of all possible CPUs | 122 | * int num_possible_cpus() Number of all possible CPUs |
@@ -216,23 +273,19 @@ static inline void __cpus_shift_left(cpumask_t *dstp, | |||
216 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | 273 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); |
217 | } | 274 | } |
218 | 275 | ||
219 | #ifdef CONFIG_SMP | ||
220 | int __first_cpu(const cpumask_t *srcp); | ||
221 | #define first_cpu(src) __first_cpu(&(src)) | ||
222 | int __next_cpu(int n, const cpumask_t *srcp); | ||
223 | #define next_cpu(n, src) __next_cpu((n), &(src)) | ||
224 | #else | ||
225 | #define first_cpu(src) ({ (void)(src); 0; }) | ||
226 | #define next_cpu(n, src) ({ (void)(src); 1; }) | ||
227 | #endif | ||
228 | 276 | ||
229 | #ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP | 277 | #ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP |
230 | extern cpumask_t *cpumask_of_cpu_map; | 278 | extern cpumask_t *cpumask_of_cpu_map; |
231 | #define cpumask_of_cpu(cpu) (cpumask_of_cpu_map[cpu]) | 279 | #define cpumask_of_cpu(cpu) (cpumask_of_cpu_map[cpu]) |
232 | 280 | #define cpumask_of_cpu_ptr(v, cpu) \ | |
281 | const cpumask_t *v = &cpumask_of_cpu(cpu) | ||
282 | #define cpumask_of_cpu_ptr_declare(v) \ | ||
283 | const cpumask_t *v | ||
284 | #define cpumask_of_cpu_ptr_next(v, cpu) \ | ||
285 | v = &cpumask_of_cpu(cpu) | ||
233 | #else | 286 | #else |
234 | #define cpumask_of_cpu(cpu) \ | 287 | #define cpumask_of_cpu(cpu) \ |
235 | (*({ \ | 288 | ({ \ |
236 | typeof(_unused_cpumask_arg_) m; \ | 289 | typeof(_unused_cpumask_arg_) m; \ |
237 | if (sizeof(m) == sizeof(unsigned long)) { \ | 290 | if (sizeof(m) == sizeof(unsigned long)) { \ |
238 | m.bits[0] = 1UL<<(cpu); \ | 291 | m.bits[0] = 1UL<<(cpu); \ |
@@ -240,8 +293,16 @@ extern cpumask_t *cpumask_of_cpu_map; | |||
240 | cpus_clear(m); \ | 293 | cpus_clear(m); \ |
241 | cpu_set((cpu), m); \ | 294 | cpu_set((cpu), m); \ |
242 | } \ | 295 | } \ |
243 | &m; \ | 296 | m; \ |
244 | })) | 297 | }) |
298 | #define cpumask_of_cpu_ptr(v, cpu) \ | ||
299 | cpumask_t _##v = cpumask_of_cpu(cpu); \ | ||
300 | const cpumask_t *v = &_##v | ||
301 | #define cpumask_of_cpu_ptr_declare(v) \ | ||
302 | cpumask_t _##v; \ | ||
303 | const cpumask_t *v = &_##v | ||
304 | #define cpumask_of_cpu_ptr_next(v, cpu) \ | ||
305 | _##v = cpumask_of_cpu(cpu) | ||
245 | #endif | 306 | #endif |
246 | 307 | ||
247 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) | 308 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) |
@@ -281,6 +342,15 @@ extern cpumask_t cpu_mask_all; | |||
281 | 342 | ||
282 | #define cpus_addr(src) ((src).bits) | 343 | #define cpus_addr(src) ((src).bits) |
283 | 344 | ||
345 | #if NR_CPUS > BITS_PER_LONG | ||
346 | #define CPUMASK_ALLOC(m) struct m *m = kmalloc(sizeof(*m), GFP_KERNEL) | ||
347 | #define CPUMASK_FREE(m) kfree(m) | ||
348 | #else | ||
349 | #define CPUMASK_ALLOC(m) struct m _m, *m = &_m | ||
350 | #define CPUMASK_FREE(m) | ||
351 | #endif | ||
352 | #define CPUMASK_PTR(v, m) cpumask_t *v = &(m->v) | ||
353 | |||
284 | #define cpumask_scnprintf(buf, len, src) \ | 354 | #define cpumask_scnprintf(buf, len, src) \ |
285 | __cpumask_scnprintf((buf), (len), &(src), NR_CPUS) | 355 | __cpumask_scnprintf((buf), (len), &(src), NR_CPUS) |
286 | static inline int __cpumask_scnprintf(char *buf, int len, | 356 | static inline int __cpumask_scnprintf(char *buf, int len, |
@@ -343,29 +413,59 @@ static inline void __cpus_fold(cpumask_t *dstp, const cpumask_t *origp, | |||
343 | bitmap_fold(dstp->bits, origp->bits, sz, nbits); | 413 | bitmap_fold(dstp->bits, origp->bits, sz, nbits); |
344 | } | 414 | } |
345 | 415 | ||
346 | #if NR_CPUS > 1 | 416 | #if NR_CPUS == 1 |
347 | #define for_each_cpu_mask(cpu, mask) \ | 417 | |
348 | for ((cpu) = first_cpu(mask); \ | 418 | #define nr_cpu_ids 1 |
349 | (cpu) < NR_CPUS; \ | 419 | #define first_cpu(src) ({ (void)(src); 0; }) |
350 | (cpu) = next_cpu((cpu), (mask))) | 420 | #define next_cpu(n, src) ({ (void)(src); 1; }) |
351 | #else /* NR_CPUS == 1 */ | 421 | #define any_online_cpu(mask) 0 |
352 | #define for_each_cpu_mask(cpu, mask) \ | 422 | #define for_each_cpu_mask(cpu, mask) \ |
353 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | 423 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) |
354 | #endif /* NR_CPUS */ | 424 | |
425 | #else /* NR_CPUS > 1 */ | ||
426 | |||
427 | extern int nr_cpu_ids; | ||
428 | int __first_cpu(const cpumask_t *srcp); | ||
429 | int __next_cpu(int n, const cpumask_t *srcp); | ||
430 | int __any_online_cpu(const cpumask_t *mask); | ||
431 | |||
432 | #define first_cpu(src) __first_cpu(&(src)) | ||
433 | #define next_cpu(n, src) __next_cpu((n), &(src)) | ||
434 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) | ||
435 | #define for_each_cpu_mask(cpu, mask) \ | ||
436 | for ((cpu) = -1; \ | ||
437 | (cpu) = next_cpu((cpu), (mask)), \ | ||
438 | (cpu) < NR_CPUS; ) | ||
439 | #endif | ||
440 | |||
441 | #if NR_CPUS <= 64 | ||
355 | 442 | ||
356 | #define next_cpu_nr(n, src) next_cpu(n, src) | 443 | #define next_cpu_nr(n, src) next_cpu(n, src) |
357 | #define cpus_weight_nr(cpumask) cpus_weight(cpumask) | 444 | #define cpus_weight_nr(cpumask) cpus_weight(cpumask) |
358 | #define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask) | 445 | #define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask) |
359 | 446 | ||
447 | #else /* NR_CPUS > 64 */ | ||
448 | |||
449 | int __next_cpu_nr(int n, const cpumask_t *srcp); | ||
450 | #define next_cpu_nr(n, src) __next_cpu_nr((n), &(src)) | ||
451 | #define cpus_weight_nr(cpumask) __cpus_weight(&(cpumask), nr_cpu_ids) | ||
452 | #define for_each_cpu_mask_nr(cpu, mask) \ | ||
453 | for ((cpu) = -1; \ | ||
454 | (cpu) = next_cpu_nr((cpu), (mask)), \ | ||
455 | (cpu) < nr_cpu_ids; ) | ||
456 | |||
457 | #endif /* NR_CPUS > 64 */ | ||
458 | |||
360 | /* | 459 | /* |
361 | * The following particular system cpumasks and operations manage | 460 | * The following particular system cpumasks and operations manage |
362 | * possible, present and online cpus. Each of them is a fixed size | 461 | * possible, present, active and online cpus. Each of them is a fixed size |
363 | * bitmap of size NR_CPUS. | 462 | * bitmap of size NR_CPUS. |
364 | * | 463 | * |
365 | * #ifdef CONFIG_HOTPLUG_CPU | 464 | * #ifdef CONFIG_HOTPLUG_CPU |
366 | * cpu_possible_map - has bit 'cpu' set iff cpu is populatable | 465 | * cpu_possible_map - has bit 'cpu' set iff cpu is populatable |
367 | * cpu_present_map - has bit 'cpu' set iff cpu is populated | 466 | * cpu_present_map - has bit 'cpu' set iff cpu is populated |
368 | * cpu_online_map - has bit 'cpu' set iff cpu available to scheduler | 467 | * cpu_online_map - has bit 'cpu' set iff cpu available to scheduler |
468 | * cpu_active_map - has bit 'cpu' set iff cpu available to migration | ||
369 | * #else | 469 | * #else |
370 | * cpu_possible_map - has bit 'cpu' set iff cpu is populated | 470 | * cpu_possible_map - has bit 'cpu' set iff cpu is populated |
371 | * cpu_present_map - copy of cpu_possible_map | 471 | * cpu_present_map - copy of cpu_possible_map |
@@ -416,14 +516,16 @@ static inline void __cpus_fold(cpumask_t *dstp, const cpumask_t *origp, | |||
416 | extern cpumask_t cpu_possible_map; | 516 | extern cpumask_t cpu_possible_map; |
417 | extern cpumask_t cpu_online_map; | 517 | extern cpumask_t cpu_online_map; |
418 | extern cpumask_t cpu_present_map; | 518 | extern cpumask_t cpu_present_map; |
519 | extern cpumask_t cpu_active_map; | ||
419 | 520 | ||
420 | #if NR_CPUS > 1 | 521 | #if NR_CPUS > 1 |
421 | #define num_online_cpus() cpus_weight(cpu_online_map) | 522 | #define num_online_cpus() cpus_weight_nr(cpu_online_map) |
422 | #define num_possible_cpus() cpus_weight(cpu_possible_map) | 523 | #define num_possible_cpus() cpus_weight_nr(cpu_possible_map) |
423 | #define num_present_cpus() cpus_weight(cpu_present_map) | 524 | #define num_present_cpus() cpus_weight_nr(cpu_present_map) |
424 | #define cpu_online(cpu) cpu_isset((cpu), cpu_online_map) | 525 | #define cpu_online(cpu) cpu_isset((cpu), cpu_online_map) |
425 | #define cpu_possible(cpu) cpu_isset((cpu), cpu_possible_map) | 526 | #define cpu_possible(cpu) cpu_isset((cpu), cpu_possible_map) |
426 | #define cpu_present(cpu) cpu_isset((cpu), cpu_present_map) | 527 | #define cpu_present(cpu) cpu_isset((cpu), cpu_present_map) |
528 | #define cpu_active(cpu) cpu_isset((cpu), cpu_active_map) | ||
427 | #else | 529 | #else |
428 | #define num_online_cpus() 1 | 530 | #define num_online_cpus() 1 |
429 | #define num_possible_cpus() 1 | 531 | #define num_possible_cpus() 1 |
@@ -431,21 +533,13 @@ extern cpumask_t cpu_present_map; | |||
431 | #define cpu_online(cpu) ((cpu) == 0) | 533 | #define cpu_online(cpu) ((cpu) == 0) |
432 | #define cpu_possible(cpu) ((cpu) == 0) | 534 | #define cpu_possible(cpu) ((cpu) == 0) |
433 | #define cpu_present(cpu) ((cpu) == 0) | 535 | #define cpu_present(cpu) ((cpu) == 0) |
536 | #define cpu_active(cpu) ((cpu) == 0) | ||
434 | #endif | 537 | #endif |
435 | 538 | ||
436 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) | 539 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) |
437 | 540 | ||
438 | #ifdef CONFIG_SMP | 541 | #define for_each_possible_cpu(cpu) for_each_cpu_mask_nr((cpu), cpu_possible_map) |
439 | extern int nr_cpu_ids; | 542 | #define for_each_online_cpu(cpu) for_each_cpu_mask_nr((cpu), cpu_online_map) |
440 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) | 543 | #define for_each_present_cpu(cpu) for_each_cpu_mask_nr((cpu), cpu_present_map) |
441 | int __any_online_cpu(const cpumask_t *mask); | ||
442 | #else | ||
443 | #define nr_cpu_ids 1 | ||
444 | #define any_online_cpu(mask) 0 | ||
445 | #endif | ||
446 | |||
447 | #define for_each_possible_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) | ||
448 | #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) | ||
449 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) | ||
450 | 544 | ||
451 | #endif /* __LINUX_CPUMASK_H */ | 545 | #endif /* __LINUX_CPUMASK_H */ |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 038578362b47..e8f450c499b0 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -78,6 +78,8 @@ extern void cpuset_track_online_nodes(void); | |||
78 | 78 | ||
79 | extern int current_cpuset_is_being_rebound(void); | 79 | extern int current_cpuset_is_being_rebound(void); |
80 | 80 | ||
81 | extern void rebuild_sched_domains(void); | ||
82 | |||
81 | #else /* !CONFIG_CPUSETS */ | 83 | #else /* !CONFIG_CPUSETS */ |
82 | 84 | ||
83 | static inline int cpuset_init_early(void) { return 0; } | 85 | static inline int cpuset_init_early(void) { return 0; } |
@@ -156,6 +158,11 @@ static inline int current_cpuset_is_being_rebound(void) | |||
156 | return 0; | 158 | return 0; |
157 | } | 159 | } |
158 | 160 | ||
161 | static inline void rebuild_sched_domains(void) | ||
162 | { | ||
163 | partition_sched_domains(0, NULL, NULL); | ||
164 | } | ||
165 | |||
159 | #endif /* !CONFIG_CPUSETS */ | 166 | #endif /* !CONFIG_CPUSETS */ |
160 | 167 | ||
161 | #endif /* _LINUX_CPUSET_H */ | 168 | #endif /* _LINUX_CPUSET_H */ |
diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h index 504cb2c3fa9a..2d3d1e04ba92 100644 --- a/include/linux/cyclades.h +++ b/include/linux/cyclades.h | |||
@@ -550,11 +550,11 @@ struct cyclades_icount { | |||
550 | 550 | ||
551 | struct cyclades_port { | 551 | struct cyclades_port { |
552 | int magic; | 552 | int magic; |
553 | struct tty_port port; | ||
553 | struct cyclades_card *card; | 554 | struct cyclades_card *card; |
554 | int line; | 555 | int line; |
555 | int flags; /* defined in tty.h */ | 556 | int flags; /* defined in tty.h */ |
556 | int type; /* UART type */ | 557 | int type; /* UART type */ |
557 | struct tty_struct *tty; | ||
558 | int read_status_mask; | 558 | int read_status_mask; |
559 | int ignore_status_mask; | 559 | int ignore_status_mask; |
560 | int timeout; | 560 | int timeout; |
@@ -567,13 +567,8 @@ struct cyclades_port { | |||
567 | int chip_rev; | 567 | int chip_rev; |
568 | int custom_divisor; | 568 | int custom_divisor; |
569 | u8 x_char; /* to be pushed out ASAP */ | 569 | u8 x_char; /* to be pushed out ASAP */ |
570 | int close_delay; | ||
571 | unsigned short closing_wait; | ||
572 | int count; /* # of fd on device */ | ||
573 | int breakon; | 570 | int breakon; |
574 | int breakoff; | 571 | int breakoff; |
575 | int blocked_open; /* # of blocked opens */ | ||
576 | unsigned char *xmit_buf; | ||
577 | int xmit_head; | 572 | int xmit_head; |
578 | int xmit_tail; | 573 | int xmit_tail; |
579 | int xmit_cnt; | 574 | int xmit_cnt; |
@@ -583,16 +578,14 @@ struct cyclades_port { | |||
583 | struct cyclades_monitor mon; | 578 | struct cyclades_monitor mon; |
584 | struct cyclades_idle_stats idle_stats; | 579 | struct cyclades_idle_stats idle_stats; |
585 | struct cyclades_icount icount; | 580 | struct cyclades_icount icount; |
586 | wait_queue_head_t open_wait; | ||
587 | wait_queue_head_t close_wait; | ||
588 | struct completion shutdown_wait; | 581 | struct completion shutdown_wait; |
589 | wait_queue_head_t delta_msr_wait; | 582 | wait_queue_head_t delta_msr_wait; |
590 | int throttle; | 583 | int throttle; |
591 | }; | 584 | }; |
592 | 585 | ||
593 | #define CLOSING_WAIT_DELAY 30*HZ | 586 | #define CLOSING_WAIT_DELAY 30*HZ |
594 | #define CY_CLOSING_WAIT_NONE 65535 | 587 | #define CY_CLOSING_WAIT_NONE ASYNC_CLOSING_WAIT_NONE |
595 | #define CY_CLOSING_WAIT_INF 0 | 588 | #define CY_CLOSING_WAIT_INF ASYNC_CLOSING_WAIT_INF |
596 | 589 | ||
597 | 590 | ||
598 | #define CyMAX_CHIPS_PER_CARD 8 | 591 | #define CyMAX_CHIPS_PER_CARD 8 |
diff --git a/include/linux/dca.h b/include/linux/dca.h index af61cd1f37e9..b00a753eda53 100644 --- a/include/linux/dca.h +++ b/include/linux/dca.h | |||
@@ -10,6 +10,7 @@ void dca_unregister_notify(struct notifier_block *nb); | |||
10 | #define DCA_PROVIDER_REMOVE 0x0002 | 10 | #define DCA_PROVIDER_REMOVE 0x0002 |
11 | 11 | ||
12 | struct dca_provider { | 12 | struct dca_provider { |
13 | struct list_head node; | ||
13 | struct dca_ops *ops; | 14 | struct dca_ops *ops; |
14 | struct device *cd; | 15 | struct device *cd; |
15 | int id; | 16 | int id; |
@@ -18,7 +19,9 @@ struct dca_provider { | |||
18 | struct dca_ops { | 19 | struct dca_ops { |
19 | int (*add_requester) (struct dca_provider *, struct device *); | 20 | int (*add_requester) (struct dca_provider *, struct device *); |
20 | int (*remove_requester) (struct dca_provider *, struct device *); | 21 | int (*remove_requester) (struct dca_provider *, struct device *); |
21 | u8 (*get_tag) (struct dca_provider *, int cpu); | 22 | u8 (*get_tag) (struct dca_provider *, struct device *, |
23 | int cpu); | ||
24 | int (*dev_managed) (struct dca_provider *, struct device *); | ||
22 | }; | 25 | }; |
23 | 26 | ||
24 | struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size); | 27 | struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size); |
@@ -32,9 +35,11 @@ static inline void *dca_priv(struct dca_provider *dca) | |||
32 | } | 35 | } |
33 | 36 | ||
34 | /* Requester API */ | 37 | /* Requester API */ |
38 | #define DCA_GET_TAG_TWO_ARGS | ||
35 | int dca_add_requester(struct device *dev); | 39 | int dca_add_requester(struct device *dev); |
36 | int dca_remove_requester(struct device *dev); | 40 | int dca_remove_requester(struct device *dev); |
37 | u8 dca_get_tag(int cpu); | 41 | u8 dca_get_tag(int cpu); |
42 | u8 dca3_get_tag(struct device *dev, int cpu); | ||
38 | 43 | ||
39 | /* internal stuff */ | 44 | /* internal stuff */ |
40 | int __init dca_sysfs_init(void); | 45 | int __init dca_sysfs_init(void); |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index aa0737019e37..6080449fbec9 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -364,8 +364,6 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb) | |||
364 | /* FIXME: for now we're default to 1 but it should really be 0 */ | 364 | /* FIXME: for now we're default to 1 but it should really be 0 */ |
365 | #define DCCPF_INITIAL_SEND_NDP_COUNT 1 | 365 | #define DCCPF_INITIAL_SEND_NDP_COUNT 1 |
366 | 366 | ||
367 | #define DCCP_NDP_LIMIT 0xFFFFFF | ||
368 | |||
369 | /** | 367 | /** |
370 | * struct dccp_minisock - Minimal DCCP connection representation | 368 | * struct dccp_minisock - Minimal DCCP connection representation |
371 | * | 369 | * |
@@ -437,7 +435,7 @@ extern int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq, | |||
437 | struct sk_buff *skb); | 435 | struct sk_buff *skb); |
438 | 436 | ||
439 | struct dccp_options_received { | 437 | struct dccp_options_received { |
440 | u32 dccpor_ndp; /* only 24 bits */ | 438 | u64 dccpor_ndp:48; |
441 | u32 dccpor_timestamp; | 439 | u32 dccpor_timestamp; |
442 | u32 dccpor_timestamp_echo; | 440 | u32 dccpor_timestamp_echo; |
443 | u32 dccpor_elapsed_time; | 441 | u32 dccpor_elapsed_time; |
@@ -533,7 +531,7 @@ struct dccp_sock { | |||
533 | __u16 dccps_r_ack_ratio; | 531 | __u16 dccps_r_ack_ratio; |
534 | __u16 dccps_pcslen; | 532 | __u16 dccps_pcslen; |
535 | __u16 dccps_pcrlen; | 533 | __u16 dccps_pcrlen; |
536 | unsigned long dccps_ndp_count; | 534 | __u64 dccps_ndp_count:48; |
537 | unsigned long dccps_rate_last; | 535 | unsigned long dccps_rate_last; |
538 | struct dccp_minisock dccps_minisock; | 536 | struct dccp_minisock dccps_minisock; |
539 | struct dccp_ackvec *dccps_hc_rx_ackvec; | 537 | struct dccp_ackvec *dccps_hc_rx_ackvec; |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 7266124361b4..e1a6c046cea3 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -26,6 +26,8 @@ struct debugfs_blob_wrapper { | |||
26 | unsigned long size; | 26 | unsigned long size; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | extern struct dentry *arch_debugfs_dir; | ||
30 | |||
29 | #if defined(CONFIG_DEBUG_FS) | 31 | #if defined(CONFIG_DEBUG_FS) |
30 | 32 | ||
31 | /* declared over in file.c */ | 33 | /* declared over in file.c */ |
@@ -42,6 +44,7 @@ struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, | |||
42 | const char *dest); | 44 | const char *dest); |
43 | 45 | ||
44 | void debugfs_remove(struct dentry *dentry); | 46 | void debugfs_remove(struct dentry *dentry); |
47 | void debugfs_remove_recursive(struct dentry *dentry); | ||
45 | 48 | ||
46 | struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, | 49 | struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, |
47 | struct dentry *new_dir, const char *new_name); | 50 | struct dentry *new_dir, const char *new_name); |
@@ -99,6 +102,9 @@ static inline struct dentry *debugfs_create_symlink(const char *name, | |||
99 | static inline void debugfs_remove(struct dentry *dentry) | 102 | static inline void debugfs_remove(struct dentry *dentry) |
100 | { } | 103 | { } |
101 | 104 | ||
105 | static inline void debugfs_remove_recursive(struct dentry *dentry) | ||
106 | { } | ||
107 | |||
102 | static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, | 108 | static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, |
103 | struct dentry *new_dir, char *new_name) | 109 | struct dentry *new_dir, char *new_name) |
104 | { | 110 | { |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 0d8d419d191a..a90222e3297d 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -9,11 +9,13 @@ | |||
9 | #define _LINUX_DEVICE_MAPPER_H | 9 | #define _LINUX_DEVICE_MAPPER_H |
10 | 10 | ||
11 | #include <linux/bio.h> | 11 | #include <linux/bio.h> |
12 | #include <linux/blkdev.h> | ||
12 | 13 | ||
13 | struct dm_target; | 14 | struct dm_target; |
14 | struct dm_table; | 15 | struct dm_table; |
15 | struct dm_dev; | 16 | struct dm_dev; |
16 | struct mapped_device; | 17 | struct mapped_device; |
18 | struct bio_vec; | ||
17 | 19 | ||
18 | typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t; | 20 | typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t; |
19 | 21 | ||
@@ -72,6 +74,9 @@ typedef int (*dm_ioctl_fn) (struct dm_target *ti, struct inode *inode, | |||
72 | struct file *filp, unsigned int cmd, | 74 | struct file *filp, unsigned int cmd, |
73 | unsigned long arg); | 75 | unsigned long arg); |
74 | 76 | ||
77 | typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, | ||
78 | struct bio_vec *biovec, int max_size); | ||
79 | |||
75 | void dm_error(const char *message); | 80 | void dm_error(const char *message); |
76 | 81 | ||
77 | /* | 82 | /* |
@@ -107,6 +112,7 @@ struct target_type { | |||
107 | dm_status_fn status; | 112 | dm_status_fn status; |
108 | dm_message_fn message; | 113 | dm_message_fn message; |
109 | dm_ioctl_fn ioctl; | 114 | dm_ioctl_fn ioctl; |
115 | dm_merge_fn merge; | ||
110 | }; | 116 | }; |
111 | 117 | ||
112 | struct io_restrictions { | 118 | struct io_restrictions { |
diff --git a/include/linux/device.h b/include/linux/device.h index f71a78d123ae..d24a47f80f9c 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/kobject.h> | 16 | #include <linux/kobject.h> |
17 | #include <linux/klist.h> | 17 | #include <linux/klist.h> |
18 | #include <linux/list.h> | 18 | #include <linux/list.h> |
19 | #include <linux/lockdep.h> | ||
19 | #include <linux/compiler.h> | 20 | #include <linux/compiler.h> |
20 | #include <linux/types.h> | 21 | #include <linux/types.h> |
21 | #include <linux/module.h> | 22 | #include <linux/module.h> |
@@ -24,17 +25,13 @@ | |||
24 | #include <asm/atomic.h> | 25 | #include <asm/atomic.h> |
25 | #include <asm/device.h> | 26 | #include <asm/device.h> |
26 | 27 | ||
27 | #define DEVICE_NAME_SIZE 50 | 28 | #define BUS_ID_SIZE 20 |
28 | /* DEVICE_NAME_HALF is really less than half to accommodate slop */ | ||
29 | #define DEVICE_NAME_HALF __stringify(20) | ||
30 | #define DEVICE_ID_SIZE 32 | ||
31 | #define BUS_ID_SIZE KOBJ_NAME_LEN | ||
32 | |||
33 | 29 | ||
34 | struct device; | 30 | struct device; |
35 | struct device_driver; | 31 | struct device_driver; |
36 | struct driver_private; | 32 | struct driver_private; |
37 | struct class; | 33 | struct class; |
34 | struct class_private; | ||
38 | struct bus_type; | 35 | struct bus_type; |
39 | struct bus_type_private; | 36 | struct bus_type_private; |
40 | 37 | ||
@@ -186,13 +183,9 @@ struct class { | |||
186 | const char *name; | 183 | const char *name; |
187 | struct module *owner; | 184 | struct module *owner; |
188 | 185 | ||
189 | struct kset subsys; | ||
190 | struct list_head devices; | ||
191 | struct list_head interfaces; | ||
192 | struct kset class_dirs; | ||
193 | struct semaphore sem; /* locks children, devices, interfaces */ | ||
194 | struct class_attribute *class_attrs; | 186 | struct class_attribute *class_attrs; |
195 | struct device_attribute *dev_attrs; | 187 | struct device_attribute *dev_attrs; |
188 | struct kobject *dev_kobj; | ||
196 | 189 | ||
197 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); | 190 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); |
198 | 191 | ||
@@ -203,13 +196,28 @@ struct class { | |||
203 | int (*resume)(struct device *dev); | 196 | int (*resume)(struct device *dev); |
204 | 197 | ||
205 | struct pm_ops *pm; | 198 | struct pm_ops *pm; |
199 | struct class_private *p; | ||
206 | }; | 200 | }; |
207 | 201 | ||
208 | extern int __must_check class_register(struct class *class); | 202 | extern struct kobject *sysfs_dev_block_kobj; |
203 | extern struct kobject *sysfs_dev_char_kobj; | ||
204 | extern int __must_check __class_register(struct class *class, | ||
205 | struct lock_class_key *key); | ||
209 | extern void class_unregister(struct class *class); | 206 | extern void class_unregister(struct class *class); |
210 | extern int class_for_each_device(struct class *class, void *data, | 207 | |
208 | /* This is a #define to keep the compiler from merging different | ||
209 | * instances of the __key variable */ | ||
210 | #define class_register(class) \ | ||
211 | ({ \ | ||
212 | static struct lock_class_key __key; \ | ||
213 | __class_register(class, &__key); \ | ||
214 | }) | ||
215 | |||
216 | extern int class_for_each_device(struct class *class, struct device *start, | ||
217 | void *data, | ||
211 | int (*fn)(struct device *dev, void *data)); | 218 | int (*fn)(struct device *dev, void *data)); |
212 | extern struct device *class_find_device(struct class *class, void *data, | 219 | extern struct device *class_find_device(struct class *class, |
220 | struct device *start, void *data, | ||
213 | int (*match)(struct device *, void *)); | 221 | int (*match)(struct device *, void *)); |
214 | 222 | ||
215 | struct class_attribute { | 223 | struct class_attribute { |
@@ -237,9 +245,19 @@ struct class_interface { | |||
237 | extern int __must_check class_interface_register(struct class_interface *); | 245 | extern int __must_check class_interface_register(struct class_interface *); |
238 | extern void class_interface_unregister(struct class_interface *); | 246 | extern void class_interface_unregister(struct class_interface *); |
239 | 247 | ||
240 | extern struct class *class_create(struct module *owner, const char *name); | 248 | extern struct class * __must_check __class_create(struct module *owner, |
249 | const char *name, | ||
250 | struct lock_class_key *key); | ||
241 | extern void class_destroy(struct class *cls); | 251 | extern void class_destroy(struct class *cls); |
242 | 252 | ||
253 | /* This is a #define to keep the compiler from merging different | ||
254 | * instances of the __key variable */ | ||
255 | #define class_create(owner, name) \ | ||
256 | ({ \ | ||
257 | static struct lock_class_key __key; \ | ||
258 | __class_create(owner, name, &__key); \ | ||
259 | }) | ||
260 | |||
243 | /* | 261 | /* |
244 | * The type of device, "struct device" is embedded in. A class | 262 | * The type of device, "struct device" is embedded in. A class |
245 | * or bus can contain devices of different types | 263 | * or bus can contain devices of different types |
@@ -468,14 +486,10 @@ extern struct device *device_create_vargs(struct class *cls, | |||
468 | const char *fmt, | 486 | const char *fmt, |
469 | va_list vargs); | 487 | va_list vargs); |
470 | extern struct device *device_create(struct class *cls, struct device *parent, | 488 | extern struct device *device_create(struct class *cls, struct device *parent, |
471 | dev_t devt, const char *fmt, ...) | 489 | dev_t devt, void *drvdata, |
472 | __attribute__((format(printf, 4, 5))); | 490 | const char *fmt, ...) |
473 | extern struct device *device_create_drvdata(struct class *cls, | ||
474 | struct device *parent, | ||
475 | dev_t devt, | ||
476 | void *drvdata, | ||
477 | const char *fmt, ...) | ||
478 | __attribute__((format(printf, 5, 6))); | 491 | __attribute__((format(printf, 5, 6))); |
492 | #define device_create_drvdata device_create | ||
479 | extern void device_destroy(struct class *cls, dev_t devt); | 493 | extern void device_destroy(struct class *cls, dev_t devt); |
480 | 494 | ||
481 | /* | 495 | /* |
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index b03c41bbfa14..28c2940eb30d 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -256,9 +256,9 @@ enum { | |||
256 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 256 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
257 | 257 | ||
258 | #define DM_VERSION_MAJOR 4 | 258 | #define DM_VERSION_MAJOR 4 |
259 | #define DM_VERSION_MINOR 13 | 259 | #define DM_VERSION_MINOR 14 |
260 | #define DM_VERSION_PATCHLEVEL 0 | 260 | #define DM_VERSION_PATCHLEVEL 0 |
261 | #define DM_VERSION_EXTRA "-ioctl (2007-10-18)" | 261 | #define DM_VERSION_EXTRA "-ioctl (2008-04-23)" |
262 | 262 | ||
263 | /* Status bits */ | 263 | /* Status bits */ |
264 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 264 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h index a3750462f9e3..fc82446b6425 100644 --- a/include/linux/dm9000.h +++ b/include/linux/dm9000.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define DM9000_PLATF_32BITONLY (0x0004) | 21 | #define DM9000_PLATF_32BITONLY (0x0004) |
22 | #define DM9000_PLATF_EXT_PHY (0x0008) | 22 | #define DM9000_PLATF_EXT_PHY (0x0008) |
23 | #define DM9000_PLATF_NO_EEPROM (0x0010) | 23 | #define DM9000_PLATF_NO_EEPROM (0x0010) |
24 | #define DM9000_PLATF_SIMPLE_PHY (0x0020) /* Use NSR to find LinkStatus */ | ||
24 | 25 | ||
25 | /* platfrom data for platfrom device structure's platfrom_data field */ | 26 | /* platfrom data for platfrom device structure's platfrom_data field */ |
26 | 27 | ||
diff --git a/include/linux/dma-attrs.h b/include/linux/dma-attrs.h index 1677e2bfa00c..71ad34eca6e3 100644 --- a/include/linux/dma-attrs.h +++ b/include/linux/dma-attrs.h | |||
@@ -12,6 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | enum dma_attr { | 13 | enum dma_attr { |
14 | DMA_ATTR_WRITE_BARRIER, | 14 | DMA_ATTR_WRITE_BARRIER, |
15 | DMA_ATTR_WEAK_ORDERING, | ||
15 | DMA_ATTR_MAX, | 16 | DMA_ATTR_MAX, |
16 | }; | 17 | }; |
17 | 18 | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index d08a5c5eb928..adb0b084eb5a 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -89,10 +89,23 @@ enum dma_transaction_type { | |||
89 | DMA_MEMSET, | 89 | DMA_MEMSET, |
90 | DMA_MEMCPY_CRC32C, | 90 | DMA_MEMCPY_CRC32C, |
91 | DMA_INTERRUPT, | 91 | DMA_INTERRUPT, |
92 | DMA_SLAVE, | ||
92 | }; | 93 | }; |
93 | 94 | ||
94 | /* last transaction type for creation of the capabilities mask */ | 95 | /* last transaction type for creation of the capabilities mask */ |
95 | #define DMA_TX_TYPE_END (DMA_INTERRUPT + 1) | 96 | #define DMA_TX_TYPE_END (DMA_SLAVE + 1) |
97 | |||
98 | /** | ||
99 | * enum dma_slave_width - DMA slave register access width. | ||
100 | * @DMA_SLAVE_WIDTH_8BIT: Do 8-bit slave register accesses | ||
101 | * @DMA_SLAVE_WIDTH_16BIT: Do 16-bit slave register accesses | ||
102 | * @DMA_SLAVE_WIDTH_32BIT: Do 32-bit slave register accesses | ||
103 | */ | ||
104 | enum dma_slave_width { | ||
105 | DMA_SLAVE_WIDTH_8BIT, | ||
106 | DMA_SLAVE_WIDTH_16BIT, | ||
107 | DMA_SLAVE_WIDTH_32BIT, | ||
108 | }; | ||
96 | 109 | ||
97 | /** | 110 | /** |
98 | * enum dma_ctrl_flags - DMA flags to augment operation preparation, | 111 | * enum dma_ctrl_flags - DMA flags to augment operation preparation, |
@@ -102,10 +115,14 @@ enum dma_transaction_type { | |||
102 | * @DMA_CTRL_ACK - the descriptor cannot be reused until the client | 115 | * @DMA_CTRL_ACK - the descriptor cannot be reused until the client |
103 | * acknowledges receipt, i.e. has has a chance to establish any | 116 | * acknowledges receipt, i.e. has has a chance to establish any |
104 | * dependency chains | 117 | * dependency chains |
118 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) | ||
119 | * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) | ||
105 | */ | 120 | */ |
106 | enum dma_ctrl_flags { | 121 | enum dma_ctrl_flags { |
107 | DMA_PREP_INTERRUPT = (1 << 0), | 122 | DMA_PREP_INTERRUPT = (1 << 0), |
108 | DMA_CTRL_ACK = (1 << 1), | 123 | DMA_CTRL_ACK = (1 << 1), |
124 | DMA_COMPL_SKIP_SRC_UNMAP = (1 << 2), | ||
125 | DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), | ||
109 | }; | 126 | }; |
110 | 127 | ||
111 | /** | 128 | /** |
@@ -115,6 +132,32 @@ enum dma_ctrl_flags { | |||
115 | typedef struct { DECLARE_BITMAP(bits, DMA_TX_TYPE_END); } dma_cap_mask_t; | 132 | typedef struct { DECLARE_BITMAP(bits, DMA_TX_TYPE_END); } dma_cap_mask_t; |
116 | 133 | ||
117 | /** | 134 | /** |
135 | * struct dma_slave - Information about a DMA slave | ||
136 | * @dev: device acting as DMA slave | ||
137 | * @dma_dev: required DMA master device. If non-NULL, the client can not be | ||
138 | * bound to other masters than this. | ||
139 | * @tx_reg: physical address of data register used for | ||
140 | * memory-to-peripheral transfers | ||
141 | * @rx_reg: physical address of data register used for | ||
142 | * peripheral-to-memory transfers | ||
143 | * @reg_width: peripheral register width | ||
144 | * | ||
145 | * If dma_dev is non-NULL, the client can not be bound to other DMA | ||
146 | * masters than the one corresponding to this device. The DMA master | ||
147 | * driver may use this to determine if there is controller-specific | ||
148 | * data wrapped around this struct. Drivers of platform code that sets | ||
149 | * the dma_dev field must therefore make sure to use an appropriate | ||
150 | * controller-specific dma slave structure wrapping this struct. | ||
151 | */ | ||
152 | struct dma_slave { | ||
153 | struct device *dev; | ||
154 | struct device *dma_dev; | ||
155 | dma_addr_t tx_reg; | ||
156 | dma_addr_t rx_reg; | ||
157 | enum dma_slave_width reg_width; | ||
158 | }; | ||
159 | |||
160 | /** | ||
118 | * struct dma_chan_percpu - the per-CPU part of struct dma_chan | 161 | * struct dma_chan_percpu - the per-CPU part of struct dma_chan |
119 | * @refcount: local_t used for open-coded "bigref" counting | 162 | * @refcount: local_t used for open-coded "bigref" counting |
120 | * @memcpy_count: transaction counter | 163 | * @memcpy_count: transaction counter |
@@ -139,6 +182,7 @@ struct dma_chan_percpu { | |||
139 | * @rcu: the DMA channel's RCU head | 182 | * @rcu: the DMA channel's RCU head |
140 | * @device_node: used to add this to the device chan list | 183 | * @device_node: used to add this to the device chan list |
141 | * @local: per-cpu pointer to a struct dma_chan_percpu | 184 | * @local: per-cpu pointer to a struct dma_chan_percpu |
185 | * @client-count: how many clients are using this channel | ||
142 | */ | 186 | */ |
143 | struct dma_chan { | 187 | struct dma_chan { |
144 | struct dma_device *device; | 188 | struct dma_device *device; |
@@ -154,6 +198,7 @@ struct dma_chan { | |||
154 | 198 | ||
155 | struct list_head device_node; | 199 | struct list_head device_node; |
156 | struct dma_chan_percpu *local; | 200 | struct dma_chan_percpu *local; |
201 | int client_count; | ||
157 | }; | 202 | }; |
158 | 203 | ||
159 | #define to_dma_chan(p) container_of(p, struct dma_chan, dev) | 204 | #define to_dma_chan(p) container_of(p, struct dma_chan, dev) |
@@ -202,11 +247,14 @@ typedef enum dma_state_client (*dma_event_callback) (struct dma_client *client, | |||
202 | * @event_callback: func ptr to call when something happens | 247 | * @event_callback: func ptr to call when something happens |
203 | * @cap_mask: only return channels that satisfy the requested capabilities | 248 | * @cap_mask: only return channels that satisfy the requested capabilities |
204 | * a value of zero corresponds to any capability | 249 | * a value of zero corresponds to any capability |
250 | * @slave: data for preparing slave transfer. Must be non-NULL iff the | ||
251 | * DMA_SLAVE capability is requested. | ||
205 | * @global_node: list_head for global dma_client_list | 252 | * @global_node: list_head for global dma_client_list |
206 | */ | 253 | */ |
207 | struct dma_client { | 254 | struct dma_client { |
208 | dma_event_callback event_callback; | 255 | dma_event_callback event_callback; |
209 | dma_cap_mask_t cap_mask; | 256 | dma_cap_mask_t cap_mask; |
257 | struct dma_slave *slave; | ||
210 | struct list_head global_node; | 258 | struct list_head global_node; |
211 | }; | 259 | }; |
212 | 260 | ||
@@ -263,6 +311,8 @@ struct dma_async_tx_descriptor { | |||
263 | * @device_prep_dma_zero_sum: prepares a zero_sum operation | 311 | * @device_prep_dma_zero_sum: prepares a zero_sum operation |
264 | * @device_prep_dma_memset: prepares a memset operation | 312 | * @device_prep_dma_memset: prepares a memset operation |
265 | * @device_prep_dma_interrupt: prepares an end of chain interrupt operation | 313 | * @device_prep_dma_interrupt: prepares an end of chain interrupt operation |
314 | * @device_prep_slave_sg: prepares a slave dma operation | ||
315 | * @device_terminate_all: terminate all pending operations | ||
266 | * @device_issue_pending: push pending transactions to hardware | 316 | * @device_issue_pending: push pending transactions to hardware |
267 | */ | 317 | */ |
268 | struct dma_device { | 318 | struct dma_device { |
@@ -279,7 +329,8 @@ struct dma_device { | |||
279 | int dev_id; | 329 | int dev_id; |
280 | struct device *dev; | 330 | struct device *dev; |
281 | 331 | ||
282 | int (*device_alloc_chan_resources)(struct dma_chan *chan); | 332 | int (*device_alloc_chan_resources)(struct dma_chan *chan, |
333 | struct dma_client *client); | ||
283 | void (*device_free_chan_resources)(struct dma_chan *chan); | 334 | void (*device_free_chan_resources)(struct dma_chan *chan); |
284 | 335 | ||
285 | struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( | 336 | struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( |
@@ -297,6 +348,12 @@ struct dma_device { | |||
297 | struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( | 348 | struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( |
298 | struct dma_chan *chan, unsigned long flags); | 349 | struct dma_chan *chan, unsigned long flags); |
299 | 350 | ||
351 | struct dma_async_tx_descriptor *(*device_prep_slave_sg)( | ||
352 | struct dma_chan *chan, struct scatterlist *sgl, | ||
353 | unsigned int sg_len, enum dma_data_direction direction, | ||
354 | unsigned long flags); | ||
355 | void (*device_terminate_all)(struct dma_chan *chan); | ||
356 | |||
300 | enum dma_status (*device_is_tx_complete)(struct dma_chan *chan, | 357 | enum dma_status (*device_is_tx_complete)(struct dma_chan *chan, |
301 | dma_cookie_t cookie, dma_cookie_t *last, | 358 | dma_cookie_t cookie, dma_cookie_t *last, |
302 | dma_cookie_t *used); | 359 | dma_cookie_t *used); |
@@ -318,16 +375,14 @@ dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan, | |||
318 | void dma_async_tx_descriptor_init(struct dma_async_tx_descriptor *tx, | 375 | void dma_async_tx_descriptor_init(struct dma_async_tx_descriptor *tx, |
319 | struct dma_chan *chan); | 376 | struct dma_chan *chan); |
320 | 377 | ||
321 | static inline void | 378 | static inline void async_tx_ack(struct dma_async_tx_descriptor *tx) |
322 | async_tx_ack(struct dma_async_tx_descriptor *tx) | ||
323 | { | 379 | { |
324 | tx->flags |= DMA_CTRL_ACK; | 380 | tx->flags |= DMA_CTRL_ACK; |
325 | } | 381 | } |
326 | 382 | ||
327 | static inline int | 383 | static inline bool async_tx_test_ack(struct dma_async_tx_descriptor *tx) |
328 | async_tx_test_ack(struct dma_async_tx_descriptor *tx) | ||
329 | { | 384 | { |
330 | return tx->flags & DMA_CTRL_ACK; | 385 | return (tx->flags & DMA_CTRL_ACK) == DMA_CTRL_ACK; |
331 | } | 386 | } |
332 | 387 | ||
333 | #define first_dma_cap(mask) __first_dma_cap(&(mask)) | 388 | #define first_dma_cap(mask) __first_dma_cap(&(mask)) |
diff --git a/include/linux/dw_dmac.h b/include/linux/dw_dmac.h new file mode 100644 index 000000000000..04d217b442bf --- /dev/null +++ b/include/linux/dw_dmac.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * Driver for the Synopsys DesignWare DMA Controller (aka DMACA on | ||
3 | * AVR32 systems.) | ||
4 | * | ||
5 | * Copyright (C) 2007 Atmel Corporation | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef DW_DMAC_H | ||
12 | #define DW_DMAC_H | ||
13 | |||
14 | #include <linux/dmaengine.h> | ||
15 | |||
16 | /** | ||
17 | * struct dw_dma_platform_data - Controller configuration parameters | ||
18 | * @nr_channels: Number of channels supported by hardware (max 8) | ||
19 | */ | ||
20 | struct dw_dma_platform_data { | ||
21 | unsigned int nr_channels; | ||
22 | }; | ||
23 | |||
24 | /** | ||
25 | * struct dw_dma_slave - Controller-specific information about a slave | ||
26 | * @slave: Generic information about the slave | ||
27 | * @ctl_lo: Platform-specific initializer for the CTL_LO register | ||
28 | * @cfg_hi: Platform-specific initializer for the CFG_HI register | ||
29 | * @cfg_lo: Platform-specific initializer for the CFG_LO register | ||
30 | */ | ||
31 | struct dw_dma_slave { | ||
32 | struct dma_slave slave; | ||
33 | u32 cfg_hi; | ||
34 | u32 cfg_lo; | ||
35 | }; | ||
36 | |||
37 | /* Platform-configurable bits in CFG_HI */ | ||
38 | #define DWC_CFGH_FCMODE (1 << 0) | ||
39 | #define DWC_CFGH_FIFO_MODE (1 << 1) | ||
40 | #define DWC_CFGH_PROTCTL(x) ((x) << 2) | ||
41 | #define DWC_CFGH_SRC_PER(x) ((x) << 7) | ||
42 | #define DWC_CFGH_DST_PER(x) ((x) << 11) | ||
43 | |||
44 | /* Platform-configurable bits in CFG_LO */ | ||
45 | #define DWC_CFGL_PRIO(x) ((x) << 5) /* priority */ | ||
46 | #define DWC_CFGL_LOCK_CH_XFER (0 << 12) /* scope of LOCK_CH */ | ||
47 | #define DWC_CFGL_LOCK_CH_BLOCK (1 << 12) | ||
48 | #define DWC_CFGL_LOCK_CH_XACT (2 << 12) | ||
49 | #define DWC_CFGL_LOCK_BUS_XFER (0 << 14) /* scope of LOCK_BUS */ | ||
50 | #define DWC_CFGL_LOCK_BUS_BLOCK (1 << 14) | ||
51 | #define DWC_CFGL_LOCK_BUS_XACT (2 << 14) | ||
52 | #define DWC_CFGL_LOCK_CH (1 << 15) /* channel lockout */ | ||
53 | #define DWC_CFGL_LOCK_BUS (1 << 16) /* busmaster lockout */ | ||
54 | #define DWC_CFGL_HS_DST_POL (1 << 18) /* dst handshake active low */ | ||
55 | #define DWC_CFGL_HS_SRC_POL (1 << 19) /* src handshake active low */ | ||
56 | |||
57 | static inline struct dw_dma_slave *to_dw_dma_slave(struct dma_slave *slave) | ||
58 | { | ||
59 | return container_of(slave, struct dw_dma_slave, slave); | ||
60 | } | ||
61 | |||
62 | #endif /* DW_DMAC_H */ | ||
diff --git a/include/linux/eisa.h b/include/linux/eisa.h index fe806b6f030d..e61c0be2a459 100644 --- a/include/linux/eisa.h +++ b/include/linux/eisa.h | |||
@@ -40,7 +40,7 @@ struct eisa_device { | |||
40 | u64 dma_mask; | 40 | u64 dma_mask; |
41 | struct device dev; /* generic device */ | 41 | struct device dev; /* generic device */ |
42 | #ifdef CONFIG_EISA_NAMES | 42 | #ifdef CONFIG_EISA_NAMES |
43 | char pretty_name[DEVICE_NAME_SIZE]; | 43 | char pretty_name[50]; |
44 | #endif | 44 | #endif |
45 | }; | 45 | }; |
46 | 46 | ||
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index c8d216357865..8bb5e87df365 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -272,6 +272,12 @@ enum ethtool_flags { | |||
272 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ | 272 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ |
273 | }; | 273 | }; |
274 | 274 | ||
275 | struct ethtool_rxnfc { | ||
276 | __u32 cmd; | ||
277 | __u32 flow_type; | ||
278 | __u64 data; | ||
279 | }; | ||
280 | |||
275 | #ifdef __KERNEL__ | 281 | #ifdef __KERNEL__ |
276 | 282 | ||
277 | struct net_device; | 283 | struct net_device; |
@@ -396,6 +402,8 @@ struct ethtool_ops { | |||
396 | /* the following hooks are obsolete */ | 402 | /* the following hooks are obsolete */ |
397 | int (*self_test_count)(struct net_device *);/* use get_sset_count */ | 403 | int (*self_test_count)(struct net_device *);/* use get_sset_count */ |
398 | int (*get_stats_count)(struct net_device *);/* use get_sset_count */ | 404 | int (*get_stats_count)(struct net_device *);/* use get_sset_count */ |
405 | int (*get_rxhash)(struct net_device *, struct ethtool_rxnfc *); | ||
406 | int (*set_rxhash)(struct net_device *, struct ethtool_rxnfc *); | ||
399 | }; | 407 | }; |
400 | #endif /* __KERNEL__ */ | 408 | #endif /* __KERNEL__ */ |
401 | 409 | ||
@@ -442,6 +450,9 @@ struct ethtool_ops { | |||
442 | #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */ | 450 | #define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */ |
443 | #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */ | 451 | #define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */ |
444 | 452 | ||
453 | #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */ | ||
454 | #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ | ||
455 | |||
445 | /* compatibility with older code */ | 456 | /* compatibility with older code */ |
446 | #define SPARC_ETH_GSET ETHTOOL_GSET | 457 | #define SPARC_ETH_GSET ETHTOOL_GSET |
447 | #define SPARC_ETH_SSET ETHTOOL_SSET | 458 | #define SPARC_ETH_SSET ETHTOOL_SSET |
@@ -528,4 +539,26 @@ struct ethtool_ops { | |||
528 | #define WAKE_MAGIC (1 << 5) | 539 | #define WAKE_MAGIC (1 << 5) |
529 | #define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */ | 540 | #define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */ |
530 | 541 | ||
542 | /* L3-L4 network traffic flow types */ | ||
543 | #define TCP_V4_FLOW 0x01 | ||
544 | #define UDP_V4_FLOW 0x02 | ||
545 | #define SCTP_V4_FLOW 0x03 | ||
546 | #define AH_ESP_V4_FLOW 0x04 | ||
547 | #define TCP_V6_FLOW 0x05 | ||
548 | #define UDP_V6_FLOW 0x06 | ||
549 | #define SCTP_V6_FLOW 0x07 | ||
550 | #define AH_ESP_V6_FLOW 0x08 | ||
551 | |||
552 | /* L3-L4 network traffic flow hash options */ | ||
553 | #define RXH_DEV_PORT (1 << 0) | ||
554 | #define RXH_L2DA (1 << 1) | ||
555 | #define RXH_VLAN (1 << 2) | ||
556 | #define RXH_L3_PROTO (1 << 3) | ||
557 | #define RXH_IP_SRC (1 << 4) | ||
558 | #define RXH_IP_DST (1 << 5) | ||
559 | #define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */ | ||
560 | #define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */ | ||
561 | #define RXH_DISCARD (1 << 31) | ||
562 | |||
563 | |||
531 | #endif /* _LINUX_ETHTOOL_H */ | 564 | #endif /* _LINUX_ETHTOOL_H */ |
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index a701399b7fed..a667637b54e3 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h | |||
@@ -10,6 +10,13 @@ | |||
10 | 10 | ||
11 | #ifdef CONFIG_EVENTFD | 11 | #ifdef CONFIG_EVENTFD |
12 | 12 | ||
13 | /* For O_CLOEXEC and O_NONBLOCK */ | ||
14 | #include <linux/fcntl.h> | ||
15 | |||
16 | /* Flags for eventfd2. */ | ||
17 | #define EFD_CLOEXEC O_CLOEXEC | ||
18 | #define EFD_NONBLOCK O_NONBLOCK | ||
19 | |||
13 | struct file *eventfd_fget(int fd); | 20 | struct file *eventfd_fget(int fd); |
14 | int eventfd_signal(struct file *file, int n); | 21 | int eventfd_signal(struct file *file, int n); |
15 | 22 | ||
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index cf79853967ff..f1e1d3c47125 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h | |||
@@ -14,8 +14,12 @@ | |||
14 | #ifndef _LINUX_EVENTPOLL_H | 14 | #ifndef _LINUX_EVENTPOLL_H |
15 | #define _LINUX_EVENTPOLL_H | 15 | #define _LINUX_EVENTPOLL_H |
16 | 16 | ||
17 | /* For O_CLOEXEC */ | ||
18 | #include <linux/fcntl.h> | ||
17 | #include <linux/types.h> | 19 | #include <linux/types.h> |
18 | 20 | ||
21 | /* Flags for epoll_create1. */ | ||
22 | #define EPOLL_CLOEXEC O_CLOEXEC | ||
19 | 23 | ||
20 | /* Valid opcodes to issue to sys_epoll_ctl() */ | 24 | /* Valid opcodes to issue to sys_epoll_ctl() */ |
21 | #define EPOLL_CTL_ADD 1 | 25 | #define EPOLL_CTL_ADD 1 |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 72295b099228..3b8870e32afd 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -8,7 +8,6 @@ struct dentry; | |||
8 | 8 | ||
9 | /* Definitions of frame buffers */ | 9 | /* Definitions of frame buffers */ |
10 | 10 | ||
11 | #define FB_MAJOR 29 | ||
12 | #define FB_MAX 32 /* sufficient for now */ | 11 | #define FB_MAX 32 /* sufficient for now */ |
13 | 12 | ||
14 | /* ioctls | 13 | /* ioctls |
@@ -120,6 +119,10 @@ struct dentry; | |||
120 | #define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */ | 119 | #define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */ |
121 | #define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */ | 120 | #define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */ |
122 | #define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */ | 121 | #define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */ |
122 | #define FB_ACCEL_TRIDENT_TGUI 50 /* Trident TGUI */ | ||
123 | #define FB_ACCEL_TRIDENT_3DIMAGE 51 /* Trident 3DImage */ | ||
124 | #define FB_ACCEL_TRIDENT_BLADE3D 52 /* Trident Blade3D */ | ||
125 | #define FB_ACCEL_TRIDENT_BLADEXP 53 /* Trident BladeXP */ | ||
123 | #define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ | 126 | #define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ |
124 | #define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ | 127 | #define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ |
125 | #define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ | 128 | #define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index c6455dadb21b..4b86f806014c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -918,12 +918,12 @@ struct file_lock { | |||
918 | struct list_head fl_link; /* doubly linked list of all locks */ | 918 | struct list_head fl_link; /* doubly linked list of all locks */ |
919 | struct list_head fl_block; /* circular list of blocked processes */ | 919 | struct list_head fl_block; /* circular list of blocked processes */ |
920 | fl_owner_t fl_owner; | 920 | fl_owner_t fl_owner; |
921 | unsigned char fl_flags; | ||
922 | unsigned char fl_type; | ||
921 | unsigned int fl_pid; | 923 | unsigned int fl_pid; |
922 | struct pid *fl_nspid; | 924 | struct pid *fl_nspid; |
923 | wait_queue_head_t fl_wait; | 925 | wait_queue_head_t fl_wait; |
924 | struct file *fl_file; | 926 | struct file *fl_file; |
925 | unsigned char fl_flags; | ||
926 | unsigned char fl_type; | ||
927 | loff_t fl_start; | 927 | loff_t fl_start; |
928 | loff_t fl_end; | 928 | loff_t fl_end; |
929 | 929 | ||
@@ -1025,6 +1025,7 @@ extern int send_sigurg(struct fown_struct *fown); | |||
1025 | extern struct list_head super_blocks; | 1025 | extern struct list_head super_blocks; |
1026 | extern spinlock_t sb_lock; | 1026 | extern spinlock_t sb_lock; |
1027 | 1027 | ||
1028 | #define sb_entry(list) list_entry((list), struct super_block, s_list) | ||
1028 | #define S_BIAS (1<<30) | 1029 | #define S_BIAS (1<<30) |
1029 | struct super_block { | 1030 | struct super_block { |
1030 | struct list_head s_list; /* Keep this first */ | 1031 | struct list_head s_list; /* Keep this first */ |
@@ -1058,6 +1059,9 @@ struct super_block { | |||
1058 | struct list_head s_more_io; /* parked for more writeback */ | 1059 | struct list_head s_more_io; /* parked for more writeback */ |
1059 | struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ | 1060 | struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ |
1060 | struct list_head s_files; | 1061 | struct list_head s_files; |
1062 | /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */ | ||
1063 | struct list_head s_dentry_lru; /* unused dentry lru */ | ||
1064 | int s_nr_dentry_unused; /* # of dentry on lru */ | ||
1061 | 1065 | ||
1062 | struct block_device *s_bdev; | 1066 | struct block_device *s_bdev; |
1063 | struct mtd_info *s_mtd; | 1067 | struct mtd_info *s_mtd; |
@@ -1773,8 +1777,9 @@ static inline void allow_write_access(struct file *file) | |||
1773 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); | 1777 | atomic_inc(&file->f_path.dentry->d_inode->i_writecount); |
1774 | } | 1778 | } |
1775 | extern int do_pipe(int *); | 1779 | extern int do_pipe(int *); |
1776 | extern struct file *create_read_pipe(struct file *f); | 1780 | extern int do_pipe_flags(int *, int); |
1777 | extern struct file *create_write_pipe(void); | 1781 | extern struct file *create_read_pipe(struct file *f, int flags); |
1782 | extern struct file *create_write_pipe(int flags); | ||
1778 | extern void free_write_pipe(struct file *); | 1783 | extern void free_write_pipe(struct file *); |
1779 | 1784 | ||
1780 | extern struct file *do_filp_open(int dfd, const char *pathname, | 1785 | extern struct file *do_filp_open(int dfd, const char *pathname, |
@@ -2006,8 +2011,6 @@ extern void simple_release_fs(struct vfsmount **mount, int *count); | |||
2006 | 2011 | ||
2007 | extern ssize_t simple_read_from_buffer(void __user *to, size_t count, | 2012 | extern ssize_t simple_read_from_buffer(void __user *to, size_t count, |
2008 | loff_t *ppos, const void *from, size_t available); | 2013 | loff_t *ppos, const void *from, size_t available); |
2009 | extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, | ||
2010 | const void *from, size_t available); | ||
2011 | 2014 | ||
2012 | #ifdef CONFIG_MIGRATION | 2015 | #ifdef CONFIG_MIGRATION |
2013 | extern int buffer_migrate_page(struct address_space *, | 2016 | extern int buffer_migrate_page(struct address_space *, |
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h index 9bc045b8c478..8300cab30f9a 100644 --- a/include/linux/fs_enet_pd.h +++ b/include/linux/fs_enet_pd.h | |||
@@ -103,10 +103,6 @@ struct fs_mii_bb_platform_info { | |||
103 | struct fs_mii_bit mdio_dir; | 103 | struct fs_mii_bit mdio_dir; |
104 | struct fs_mii_bit mdio_dat; | 104 | struct fs_mii_bit mdio_dat; |
105 | struct fs_mii_bit mdc_dat; | 105 | struct fs_mii_bit mdc_dat; |
106 | int mdio_port; /* port & bit for MDIO */ | ||
107 | int mdio_bit; | ||
108 | int mdc_port; /* port & bit for MDC */ | ||
109 | int mdc_bit; | ||
110 | int delay; /* delay in us */ | 106 | int delay; /* delay in us */ |
111 | int irq[32]; /* irqs per phy's */ | 107 | int irq[32]; /* irqs per phy's */ |
112 | }; | 108 | }; |
@@ -135,11 +131,7 @@ struct fs_platform_info { | |||
135 | u32 device_flags; | 131 | u32 device_flags; |
136 | 132 | ||
137 | int phy_addr; /* the phy address (-1 no phy) */ | 133 | int phy_addr; /* the phy address (-1 no phy) */ |
138 | #ifdef CONFIG_PPC_CPM_NEW_BINDING | ||
139 | char bus_id[16]; | 134 | char bus_id[16]; |
140 | #else | ||
141 | const char* bus_id; | ||
142 | #endif | ||
143 | int phy_irq; /* the phy irq (if it exists) */ | 135 | int phy_irq; /* the phy irq (if it exists) */ |
144 | 136 | ||
145 | const struct fs_mii_bus_info *bus_info; | 137 | const struct fs_mii_bus_info *bus_info; |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index c415a496de3a..4e625e0094c8 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -69,6 +69,7 @@ struct gianfar_mdio_data { | |||
69 | #define FSL_GIANFAR_DEV_HAS_VLAN 0x00000020 | 69 | #define FSL_GIANFAR_DEV_HAS_VLAN 0x00000020 |
70 | #define FSL_GIANFAR_DEV_HAS_EXTENDED_HASH 0x00000040 | 70 | #define FSL_GIANFAR_DEV_HAS_EXTENDED_HASH 0x00000040 |
71 | #define FSL_GIANFAR_DEV_HAS_PADDING 0x00000080 | 71 | #define FSL_GIANFAR_DEV_HAS_PADDING 0x00000080 |
72 | #define FSL_GIANFAR_DEV_HAS_MAGIC_PACKET 0x00000100 | ||
72 | 73 | ||
73 | /* Flags in gianfar_platform_data */ | 74 | /* Flags in gianfar_platform_data */ |
74 | #define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* set or use a timer */ | 75 | #define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* set or use a timer */ |
@@ -125,4 +126,10 @@ struct mpc8xx_pcmcia_ops { | |||
125 | int(*voltage_set)(int slot, int vcc, int vpp); | 126 | int(*voltage_set)(int slot, int vcc, int vpp); |
126 | }; | 127 | }; |
127 | 128 | ||
129 | /* Returns non-zero if the current suspend operation would | ||
130 | * lead to a deep sleep (i.e. power removed from the core, | ||
131 | * instead of just the clock). | ||
132 | */ | ||
133 | int fsl_deep_sleep(void); | ||
134 | |||
128 | #endif /* _FSL_DEVICE_H_ */ | 135 | #endif /* _FSL_DEVICE_H_ */ |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index afad95272841..f64e29c0ef3f 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
@@ -68,7 +68,6 @@ struct gameport_driver { | |||
68 | 68 | ||
69 | int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mode); | 69 | int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mode); |
70 | void gameport_close(struct gameport *gameport); | 70 | void gameport_close(struct gameport *gameport); |
71 | void gameport_rescan(struct gameport *gameport); | ||
72 | 71 | ||
73 | #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) | 72 | #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) |
74 | 73 | ||
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h index 110833666e37..4cc913939817 100644 --- a/include/linux/generic_serial.h +++ b/include/linux/generic_serial.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #ifdef __KERNEL__ | 15 | #ifdef __KERNEL__ |
16 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
17 | #include <linux/tty.h> | ||
17 | 18 | ||
18 | struct real_driver { | 19 | struct real_driver { |
19 | void (*disable_tx_interrupts) (void *); | 20 | void (*disable_tx_interrupts) (void *); |
@@ -33,17 +34,12 @@ struct real_driver { | |||
33 | 34 | ||
34 | struct gs_port { | 35 | struct gs_port { |
35 | int magic; | 36 | int magic; |
37 | struct tty_port port; | ||
36 | unsigned char *xmit_buf; | 38 | unsigned char *xmit_buf; |
37 | int xmit_head; | 39 | int xmit_head; |
38 | int xmit_tail; | 40 | int xmit_tail; |
39 | int xmit_cnt; | 41 | int xmit_cnt; |
40 | struct mutex port_write_mutex; | 42 | struct mutex port_write_mutex; |
41 | int flags; | ||
42 | wait_queue_head_t open_wait; | ||
43 | wait_queue_head_t close_wait; | ||
44 | int count; | ||
45 | int blocked_open; | ||
46 | struct tty_struct *tty; | ||
47 | unsigned long event; | 43 | unsigned long event; |
48 | unsigned short closing_wait; | 44 | unsigned short closing_wait; |
49 | int close_delay; | 45 | int close_delay; |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index b414be387180..e8003afeffba 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -173,11 +173,24 @@ static inline void arch_free_page(struct page *page, int order) { } | |||
173 | static inline void arch_alloc_page(struct page *page, int order) { } | 173 | static inline void arch_alloc_page(struct page *page, int order) { } |
174 | #endif | 174 | #endif |
175 | 175 | ||
176 | extern struct page *__alloc_pages(gfp_t, unsigned int, struct zonelist *); | 176 | struct page * |
177 | __alloc_pages_internal(gfp_t gfp_mask, unsigned int order, | ||
178 | struct zonelist *zonelist, nodemask_t *nodemask); | ||
179 | |||
180 | static inline struct page * | ||
181 | __alloc_pages(gfp_t gfp_mask, unsigned int order, | ||
182 | struct zonelist *zonelist) | ||
183 | { | ||
184 | return __alloc_pages_internal(gfp_mask, order, zonelist, NULL); | ||
185 | } | ||
186 | |||
187 | static inline struct page * | ||
188 | __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, | ||
189 | struct zonelist *zonelist, nodemask_t *nodemask) | ||
190 | { | ||
191 | return __alloc_pages_internal(gfp_mask, order, zonelist, nodemask); | ||
192 | } | ||
177 | 193 | ||
178 | extern struct page * | ||
179 | __alloc_pages_nodemask(gfp_t, unsigned int, | ||
180 | struct zonelist *, nodemask_t *nodemask); | ||
181 | 194 | ||
182 | static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, | 195 | static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, |
183 | unsigned int order) | 196 | unsigned int order) |
@@ -215,6 +228,9 @@ extern struct page *alloc_page_vma(gfp_t gfp_mask, | |||
215 | extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order); | 228 | extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order); |
216 | extern unsigned long get_zeroed_page(gfp_t gfp_mask); | 229 | extern unsigned long get_zeroed_page(gfp_t gfp_mask); |
217 | 230 | ||
231 | void *alloc_pages_exact(size_t size, gfp_t gfp_mask); | ||
232 | void free_pages_exact(void *virt, size_t size); | ||
233 | |||
218 | #define __get_free_page(gfp_mask) \ | 234 | #define __get_free_page(gfp_mask) \ |
219 | __get_free_pages((gfp_mask),0) | 235 | __get_free_pages((gfp_mask),0) |
220 | 236 | ||
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h index c6d3a9de5634..ec6ecd74781d 100644 --- a/include/linux/gpio_keys.h +++ b/include/linux/gpio_keys.h | |||
@@ -9,6 +9,7 @@ struct gpio_keys_button { | |||
9 | char *desc; | 9 | char *desc; |
10 | int type; /* input event type (EV_KEY, EV_SW) */ | 10 | int type; /* input event type (EV_KEY, EV_SW) */ |
11 | int wakeup; /* configure the button as a wake-up source */ | 11 | int wakeup; /* configure the button as a wake-up source */ |
12 | int debounce_interval; /* debounce ticks interval in msecs */ | ||
12 | }; | 13 | }; |
13 | 14 | ||
14 | struct gpio_keys_platform_data { | 15 | struct gpio_keys_platform_data { |
diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h index 2177ee5b2fe2..940aeb51d53f 100644 --- a/include/linux/hayesesp.h +++ b/include/linux/hayesesp.h | |||
@@ -76,11 +76,10 @@ struct hayes_esp_config { | |||
76 | 76 | ||
77 | struct esp_struct { | 77 | struct esp_struct { |
78 | int magic; | 78 | int magic; |
79 | struct tty_port port; | ||
79 | spinlock_t lock; | 80 | spinlock_t lock; |
80 | int port; | 81 | int io_port; |
81 | int irq; | 82 | int irq; |
82 | int flags; /* defined in tty.h */ | ||
83 | struct tty_struct *tty; | ||
84 | int read_status_mask; | 83 | int read_status_mask; |
85 | int ignore_status_mask; | 84 | int ignore_status_mask; |
86 | int timeout; | 85 | int timeout; |
@@ -93,14 +92,10 @@ struct esp_struct { | |||
93 | int MCR; /* Modem control register */ | 92 | int MCR; /* Modem control register */ |
94 | unsigned long last_active; | 93 | unsigned long last_active; |
95 | int line; | 94 | int line; |
96 | int count; /* # of fd on device */ | ||
97 | int blocked_open; /* # of blocked opens */ | ||
98 | unsigned char *xmit_buf; | 95 | unsigned char *xmit_buf; |
99 | int xmit_head; | 96 | int xmit_head; |
100 | int xmit_tail; | 97 | int xmit_tail; |
101 | int xmit_cnt; | 98 | int xmit_cnt; |
102 | wait_queue_head_t open_wait; | ||
103 | wait_queue_head_t close_wait; | ||
104 | wait_queue_head_t delta_msr_wait; | 99 | wait_queue_head_t delta_msr_wait; |
105 | wait_queue_head_t break_wait; | 100 | wait_queue_head_t break_wait; |
106 | struct async_icount icount; /* kernel counters for the 4 input interrupts */ | 101 | struct async_icount icount; /* kernel counters for the 4 input interrupts */ |
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index 6115545a5b9c..c59769693bee 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
@@ -45,7 +45,6 @@ struct hdlc_proto { | |||
45 | 45 | ||
46 | /* Pointed to by dev->priv */ | 46 | /* Pointed to by dev->priv */ |
47 | typedef struct hdlc_device { | 47 | typedef struct hdlc_device { |
48 | struct net_device_stats stats; | ||
49 | /* used by HDLC layer to take control over HDLC device from hw driver*/ | 48 | /* used by HDLC layer to take control over HDLC device from hw driver*/ |
50 | int (*attach)(struct net_device *dev, | 49 | int (*attach)(struct net_device *dev, |
51 | unsigned short encoding, unsigned short parity); | 50 | unsigned short encoding, unsigned short parity); |
@@ -109,12 +108,6 @@ int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, | |||
109 | /* May be used by hardware driver to gain control over HDLC device */ | 108 | /* May be used by hardware driver to gain control over HDLC device */ |
110 | void detach_hdlc_protocol(struct net_device *dev); | 109 | void detach_hdlc_protocol(struct net_device *dev); |
111 | 110 | ||
112 | static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) | ||
113 | { | ||
114 | return &dev_to_hdlc(dev)->stats; | ||
115 | } | ||
116 | |||
117 | |||
118 | static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb, | 111 | static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb, |
119 | struct net_device *dev) | 112 | struct net_device *dev) |
120 | { | 113 | { |
diff --git a/include/linux/hid.h b/include/linux/hid.h index fe56b86f2c67..ac4e678a04ed 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -512,7 +512,7 @@ struct hid_descriptor { | |||
512 | 512 | ||
513 | /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ | 513 | /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ |
514 | /* We ignore a few input applications that are not widely used */ | 514 | /* We ignore a few input applications that are not widely used */ |
515 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) | 515 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || (a == 0x000d0002)) |
516 | 516 | ||
517 | /* HID core API */ | 517 | /* HID core API */ |
518 | 518 | ||
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index a79e80b689d8..9a71d4cc88c8 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -8,7 +8,6 @@ | |||
8 | #include <linux/mempolicy.h> | 8 | #include <linux/mempolicy.h> |
9 | #include <linux/shm.h> | 9 | #include <linux/shm.h> |
10 | #include <asm/tlbflush.h> | 10 | #include <asm/tlbflush.h> |
11 | #include <asm/hugetlb.h> | ||
12 | 11 | ||
13 | struct ctl_table; | 12 | struct ctl_table; |
14 | 13 | ||
@@ -17,38 +16,45 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | |||
17 | return vma->vm_flags & VM_HUGETLB; | 16 | return vma->vm_flags & VM_HUGETLB; |
18 | } | 17 | } |
19 | 18 | ||
19 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | ||
20 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 20 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); |
21 | int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 21 | int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); |
22 | int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 22 | int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); |
23 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); | 23 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); |
24 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int); | 24 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int); |
25 | void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); | 25 | void unmap_hugepage_range(struct vm_area_struct *, |
26 | void __unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); | 26 | unsigned long, unsigned long, struct page *); |
27 | void __unmap_hugepage_range(struct vm_area_struct *, | ||
28 | unsigned long, unsigned long, struct page *); | ||
27 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); | 29 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); |
28 | int hugetlb_report_meminfo(char *); | 30 | int hugetlb_report_meminfo(char *); |
29 | int hugetlb_report_node_meminfo(int, char *); | 31 | int hugetlb_report_node_meminfo(int, char *); |
30 | unsigned long hugetlb_total_pages(void); | 32 | unsigned long hugetlb_total_pages(void); |
31 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 33 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
32 | unsigned long address, int write_access); | 34 | unsigned long address, int write_access); |
33 | int hugetlb_reserve_pages(struct inode *inode, long from, long to); | 35 | int hugetlb_reserve_pages(struct inode *inode, long from, long to, |
36 | struct vm_area_struct *vma); | ||
34 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | 37 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); |
35 | 38 | ||
36 | extern unsigned long max_huge_pages; | ||
37 | extern unsigned long sysctl_overcommit_huge_pages; | ||
38 | extern unsigned long hugepages_treat_as_movable; | 39 | extern unsigned long hugepages_treat_as_movable; |
39 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 40 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
40 | extern int sysctl_hugetlb_shm_group; | 41 | extern int sysctl_hugetlb_shm_group; |
42 | extern struct list_head huge_boot_pages; | ||
41 | 43 | ||
42 | /* arch callbacks */ | 44 | /* arch callbacks */ |
43 | 45 | ||
44 | pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr); | 46 | pte_t *huge_pte_alloc(struct mm_struct *mm, |
47 | unsigned long addr, unsigned long sz); | ||
45 | pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr); | 48 | pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr); |
46 | int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep); | 49 | int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep); |
47 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | 50 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, |
48 | int write); | 51 | int write); |
49 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | 52 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, |
50 | pmd_t *pmd, int write); | 53 | pmd_t *pmd, int write); |
54 | struct page *follow_huge_pud(struct mm_struct *mm, unsigned long address, | ||
55 | pud_t *pud, int write); | ||
51 | int pmd_huge(pmd_t pmd); | 56 | int pmd_huge(pmd_t pmd); |
57 | int pud_huge(pud_t pmd); | ||
52 | void hugetlb_change_protection(struct vm_area_struct *vma, | 58 | void hugetlb_change_protection(struct vm_area_struct *vma, |
53 | unsigned long address, unsigned long end, pgprot_t newprot); | 59 | unsigned long address, unsigned long end, pgprot_t newprot); |
54 | 60 | ||
@@ -58,6 +64,11 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | |||
58 | { | 64 | { |
59 | return 0; | 65 | return 0; |
60 | } | 66 | } |
67 | |||
68 | static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) | ||
69 | { | ||
70 | } | ||
71 | |||
61 | static inline unsigned long hugetlb_total_pages(void) | 72 | static inline unsigned long hugetlb_total_pages(void) |
62 | { | 73 | { |
63 | return 0; | 74 | return 0; |
@@ -67,12 +78,14 @@ static inline unsigned long hugetlb_total_pages(void) | |||
67 | #define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) | 78 | #define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) |
68 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) | 79 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) |
69 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) | 80 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) |
70 | #define unmap_hugepage_range(vma, start, end) BUG() | 81 | #define unmap_hugepage_range(vma, start, end, page) BUG() |
71 | #define hugetlb_report_meminfo(buf) 0 | 82 | #define hugetlb_report_meminfo(buf) 0 |
72 | #define hugetlb_report_node_meminfo(n, buf) 0 | 83 | #define hugetlb_report_node_meminfo(n, buf) 0 |
73 | #define follow_huge_pmd(mm, addr, pmd, write) NULL | 84 | #define follow_huge_pmd(mm, addr, pmd, write) NULL |
74 | #define prepare_hugepage_range(addr,len) (-EINVAL) | 85 | #define follow_huge_pud(mm, addr, pud, write) NULL |
86 | #define prepare_hugepage_range(file, addr, len) (-EINVAL) | ||
75 | #define pmd_huge(x) 0 | 87 | #define pmd_huge(x) 0 |
88 | #define pud_huge(x) 0 | ||
76 | #define is_hugepage_only_range(mm, addr, len) 0 | 89 | #define is_hugepage_only_range(mm, addr, len) 0 |
77 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) | 90 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) |
78 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) | 91 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) |
@@ -93,6 +106,7 @@ struct hugetlbfs_config { | |||
93 | umode_t mode; | 106 | umode_t mode; |
94 | long nr_blocks; | 107 | long nr_blocks; |
95 | long nr_inodes; | 108 | long nr_inodes; |
109 | struct hstate *hstate; | ||
96 | }; | 110 | }; |
97 | 111 | ||
98 | struct hugetlbfs_sb_info { | 112 | struct hugetlbfs_sb_info { |
@@ -101,6 +115,7 @@ struct hugetlbfs_sb_info { | |||
101 | long max_inodes; /* inodes allowed */ | 115 | long max_inodes; /* inodes allowed */ |
102 | long free_inodes; /* inodes free */ | 116 | long free_inodes; /* inodes free */ |
103 | spinlock_t stat_lock; | 117 | spinlock_t stat_lock; |
118 | struct hstate *hstate; | ||
104 | }; | 119 | }; |
105 | 120 | ||
106 | 121 | ||
@@ -125,8 +140,6 @@ struct file *hugetlb_file_setup(const char *name, size_t); | |||
125 | int hugetlb_get_quota(struct address_space *mapping, long delta); | 140 | int hugetlb_get_quota(struct address_space *mapping, long delta); |
126 | void hugetlb_put_quota(struct address_space *mapping, long delta); | 141 | void hugetlb_put_quota(struct address_space *mapping, long delta); |
127 | 142 | ||
128 | #define BLOCKS_PER_HUGEPAGE (HPAGE_SIZE / 512) | ||
129 | |||
130 | static inline int is_file_hugepages(struct file *file) | 143 | static inline int is_file_hugepages(struct file *file) |
131 | { | 144 | { |
132 | if (file->f_op == &hugetlbfs_file_operations) | 145 | if (file->f_op == &hugetlbfs_file_operations) |
@@ -155,4 +168,112 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, | |||
155 | unsigned long flags); | 168 | unsigned long flags); |
156 | #endif /* HAVE_ARCH_HUGETLB_UNMAPPED_AREA */ | 169 | #endif /* HAVE_ARCH_HUGETLB_UNMAPPED_AREA */ |
157 | 170 | ||
171 | #ifdef CONFIG_HUGETLB_PAGE | ||
172 | |||
173 | #define HSTATE_NAME_LEN 32 | ||
174 | /* Defines one hugetlb page size */ | ||
175 | struct hstate { | ||
176 | int hugetlb_next_nid; | ||
177 | unsigned int order; | ||
178 | unsigned long mask; | ||
179 | unsigned long max_huge_pages; | ||
180 | unsigned long nr_huge_pages; | ||
181 | unsigned long free_huge_pages; | ||
182 | unsigned long resv_huge_pages; | ||
183 | unsigned long surplus_huge_pages; | ||
184 | unsigned long nr_overcommit_huge_pages; | ||
185 | struct list_head hugepage_freelists[MAX_NUMNODES]; | ||
186 | unsigned int nr_huge_pages_node[MAX_NUMNODES]; | ||
187 | unsigned int free_huge_pages_node[MAX_NUMNODES]; | ||
188 | unsigned int surplus_huge_pages_node[MAX_NUMNODES]; | ||
189 | char name[HSTATE_NAME_LEN]; | ||
190 | }; | ||
191 | |||
192 | struct huge_bootmem_page { | ||
193 | struct list_head list; | ||
194 | struct hstate *hstate; | ||
195 | }; | ||
196 | |||
197 | /* arch callback */ | ||
198 | int __init alloc_bootmem_huge_page(struct hstate *h); | ||
199 | |||
200 | void __init hugetlb_add_hstate(unsigned order); | ||
201 | struct hstate *size_to_hstate(unsigned long size); | ||
202 | |||
203 | #ifndef HUGE_MAX_HSTATE | ||
204 | #define HUGE_MAX_HSTATE 1 | ||
205 | #endif | ||
206 | |||
207 | extern struct hstate hstates[HUGE_MAX_HSTATE]; | ||
208 | extern unsigned int default_hstate_idx; | ||
209 | |||
210 | #define default_hstate (hstates[default_hstate_idx]) | ||
211 | |||
212 | static inline struct hstate *hstate_inode(struct inode *i) | ||
213 | { | ||
214 | struct hugetlbfs_sb_info *hsb; | ||
215 | hsb = HUGETLBFS_SB(i->i_sb); | ||
216 | return hsb->hstate; | ||
217 | } | ||
218 | |||
219 | static inline struct hstate *hstate_file(struct file *f) | ||
220 | { | ||
221 | return hstate_inode(f->f_dentry->d_inode); | ||
222 | } | ||
223 | |||
224 | static inline struct hstate *hstate_vma(struct vm_area_struct *vma) | ||
225 | { | ||
226 | return hstate_file(vma->vm_file); | ||
227 | } | ||
228 | |||
229 | static inline unsigned long huge_page_size(struct hstate *h) | ||
230 | { | ||
231 | return (unsigned long)PAGE_SIZE << h->order; | ||
232 | } | ||
233 | |||
234 | static inline unsigned long huge_page_mask(struct hstate *h) | ||
235 | { | ||
236 | return h->mask; | ||
237 | } | ||
238 | |||
239 | static inline unsigned int huge_page_order(struct hstate *h) | ||
240 | { | ||
241 | return h->order; | ||
242 | } | ||
243 | |||
244 | static inline unsigned huge_page_shift(struct hstate *h) | ||
245 | { | ||
246 | return h->order + PAGE_SHIFT; | ||
247 | } | ||
248 | |||
249 | static inline unsigned int pages_per_huge_page(struct hstate *h) | ||
250 | { | ||
251 | return 1 << h->order; | ||
252 | } | ||
253 | |||
254 | static inline unsigned int blocks_per_huge_page(struct hstate *h) | ||
255 | { | ||
256 | return huge_page_size(h) / 512; | ||
257 | } | ||
258 | |||
259 | #include <asm/hugetlb.h> | ||
260 | |||
261 | static inline struct hstate *page_hstate(struct page *page) | ||
262 | { | ||
263 | return size_to_hstate(PAGE_SIZE << compound_order(page)); | ||
264 | } | ||
265 | |||
266 | #else | ||
267 | struct hstate {}; | ||
268 | #define alloc_bootmem_huge_page(h) NULL | ||
269 | #define hstate_file(f) NULL | ||
270 | #define hstate_vma(v) NULL | ||
271 | #define hstate_inode(i) NULL | ||
272 | #define huge_page_size(h) PAGE_SIZE | ||
273 | #define huge_page_mask(h) PAGE_MASK | ||
274 | #define huge_page_order(h) 0 | ||
275 | #define huge_page_shift(h) PAGE_SHIFT | ||
276 | #define pages_per_huge_page(h) 1 | ||
277 | #endif | ||
278 | |||
158 | #endif /* _LINUX_HUGETLB_H */ | 279 | #endif /* _LINUX_HUGETLB_H */ |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index ef13b7c66df3..4862398e05bf 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -33,15 +33,11 @@ | |||
33 | 33 | ||
34 | #define I2C_DRIVERID_MSP3400 1 | 34 | #define I2C_DRIVERID_MSP3400 1 |
35 | #define I2C_DRIVERID_TUNER 2 | 35 | #define I2C_DRIVERID_TUNER 2 |
36 | #define I2C_DRIVERID_TDA8425 4 /* stereo sound processor */ | ||
37 | #define I2C_DRIVERID_TEA6420 5 /* audio matrix switch */ | 36 | #define I2C_DRIVERID_TEA6420 5 /* audio matrix switch */ |
38 | #define I2C_DRIVERID_TEA6415C 6 /* video matrix switch */ | 37 | #define I2C_DRIVERID_TEA6415C 6 /* video matrix switch */ |
39 | #define I2C_DRIVERID_TDA9840 7 /* stereo sound processor */ | 38 | #define I2C_DRIVERID_TDA9840 7 /* stereo sound processor */ |
40 | #define I2C_DRIVERID_SAA7111A 8 /* video input processor */ | 39 | #define I2C_DRIVERID_SAA7111A 8 /* video input processor */ |
41 | #define I2C_DRIVERID_SAA7185B 13 /* video encoder */ | 40 | #define I2C_DRIVERID_SAA7185B 13 /* video encoder */ |
42 | #define I2C_DRIVERID_TEA6300 18 /* audio mixer */ | ||
43 | #define I2C_DRIVERID_TDA9850 20 /* audio mixer */ | ||
44 | #define I2C_DRIVERID_TDA9855 21 /* audio mixer */ | ||
45 | #define I2C_DRIVERID_SAA7110 22 /* video decoder */ | 41 | #define I2C_DRIVERID_SAA7110 22 /* video decoder */ |
46 | #define I2C_DRIVERID_MGATVO 23 /* Matrox TVOut */ | 42 | #define I2C_DRIVERID_MGATVO 23 /* Matrox TVOut */ |
47 | #define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */ | 43 | #define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */ |
@@ -50,9 +46,7 @@ | |||
50 | #define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */ | 46 | #define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */ |
51 | #define I2C_DRIVERID_TVMIXER 28 /* Mixer driver for tv cards */ | 47 | #define I2C_DRIVERID_TVMIXER 28 /* Mixer driver for tv cards */ |
52 | #define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */ | 48 | #define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */ |
53 | #define I2C_DRIVERID_TDA9873 31 /* TV sound decoder chip */ | ||
54 | #define I2C_DRIVERID_TDA9875 32 /* TV sound decoder chip */ | 49 | #define I2C_DRIVERID_TDA9875 32 /* TV sound decoder chip */ |
55 | #define I2C_DRIVERID_PIC16C54_PV9 33 /* Audio mux/ir receiver */ | ||
56 | #define I2C_DRIVERID_BT819 40 /* video decoder */ | 50 | #define I2C_DRIVERID_BT819 40 /* video decoder */ |
57 | #define I2C_DRIVERID_BT856 41 /* video encoder */ | 51 | #define I2C_DRIVERID_BT856 41 /* video encoder */ |
58 | #define I2C_DRIVERID_VPX3220 42 /* video decoder+vbi/vtxt */ | 52 | #define I2C_DRIVERID_VPX3220 42 /* video decoder+vbi/vtxt */ |
@@ -63,7 +57,6 @@ | |||
63 | #define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */ | 57 | #define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */ |
64 | #define I2C_DRIVERID_OVCAMCHIP 61 /* OmniVision CMOS image sens. */ | 58 | #define I2C_DRIVERID_OVCAMCHIP 61 /* OmniVision CMOS image sens. */ |
65 | #define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ | 59 | #define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ |
66 | #define I2C_DRIVERID_TDA9874 66 /* TV sound decoder */ | ||
67 | #define I2C_DRIVERID_SAA6752HS 67 /* MPEG2 encoder */ | 60 | #define I2C_DRIVERID_SAA6752HS 67 /* MPEG2 encoder */ |
68 | #define I2C_DRIVERID_TVEEPROM 68 /* TV EEPROM */ | 61 | #define I2C_DRIVERID_TVEEPROM 68 /* TV EEPROM */ |
69 | #define I2C_DRIVERID_WM8775 69 /* wm8775 audio processor */ | 62 | #define I2C_DRIVERID_WM8775 69 /* wm8775 audio processor */ |
@@ -158,7 +151,6 @@ | |||
158 | #define I2C_HW_SMBUS_W9968CF 0x04000d | 151 | #define I2C_HW_SMBUS_W9968CF 0x04000d |
159 | #define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */ | 152 | #define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */ |
160 | #define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ | 153 | #define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ |
161 | #define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */ | ||
162 | #define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */ | 154 | #define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */ |
163 | #define I2C_HW_SMBUS_ALI1563 0x040013 | 155 | #define I2C_HW_SMBUS_ALI1563 0x040013 |
164 | 156 | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 4726126f5a59..d67ccca2b964 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -178,6 +178,7 @@ typedef struct hw_regs_s { | |||
178 | ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ | 178 | ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ |
179 | hwif_chipset_t chipset; | 179 | hwif_chipset_t chipset; |
180 | struct device *dev, *parent; | 180 | struct device *dev, *parent; |
181 | unsigned long config; | ||
181 | } hw_regs_t; | 182 | } hw_regs_t; |
182 | 183 | ||
183 | void ide_init_port_data(struct hwif_s *, unsigned int); | 184 | void ide_init_port_data(struct hwif_s *, unsigned int); |
@@ -307,7 +308,65 @@ struct ide_acpi_drive_link; | |||
307 | struct ide_acpi_hwif_link; | 308 | struct ide_acpi_hwif_link; |
308 | #endif | 309 | #endif |
309 | 310 | ||
310 | typedef struct ide_drive_s { | 311 | /* ATAPI device flags */ |
312 | enum { | ||
313 | IDE_AFLAG_DRQ_INTERRUPT = (1 << 0), | ||
314 | IDE_AFLAG_MEDIA_CHANGED = (1 << 1), | ||
315 | |||
316 | /* ide-cd */ | ||
317 | /* Drive cannot lock the door. */ | ||
318 | IDE_AFLAG_NO_DOORLOCK = (1 << 2), | ||
319 | /* Drive cannot eject the disc. */ | ||
320 | IDE_AFLAG_NO_EJECT = (1 << 3), | ||
321 | /* Drive is a pre ATAPI 1.2 drive. */ | ||
322 | IDE_AFLAG_PRE_ATAPI12 = (1 << 4), | ||
323 | /* TOC addresses are in BCD. */ | ||
324 | IDE_AFLAG_TOCADDR_AS_BCD = (1 << 5), | ||
325 | /* TOC track numbers are in BCD. */ | ||
326 | IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 6), | ||
327 | /* | ||
328 | * Drive does not provide data in multiples of SECTOR_SIZE | ||
329 | * when more than one interrupt is needed. | ||
330 | */ | ||
331 | IDE_AFLAG_LIMIT_NFRAMES = (1 << 7), | ||
332 | /* Seeking in progress. */ | ||
333 | IDE_AFLAG_SEEKING = (1 << 8), | ||
334 | /* Saved TOC information is current. */ | ||
335 | IDE_AFLAG_TOC_VALID = (1 << 9), | ||
336 | /* We think that the drive door is locked. */ | ||
337 | IDE_AFLAG_DOOR_LOCKED = (1 << 10), | ||
338 | /* SET_CD_SPEED command is unsupported. */ | ||
339 | IDE_AFLAG_NO_SPEED_SELECT = (1 << 11), | ||
340 | IDE_AFLAG_VERTOS_300_SSD = (1 << 12), | ||
341 | IDE_AFLAG_VERTOS_600_ESD = (1 << 13), | ||
342 | IDE_AFLAG_SANYO_3CD = (1 << 14), | ||
343 | IDE_AFLAG_FULL_CAPS_PAGE = (1 << 15), | ||
344 | IDE_AFLAG_PLAY_AUDIO_OK = (1 << 16), | ||
345 | IDE_AFLAG_LE_SPEED_FIELDS = (1 << 17), | ||
346 | |||
347 | /* ide-floppy */ | ||
348 | /* Format in progress */ | ||
349 | IDE_AFLAG_FORMAT_IN_PROGRESS = (1 << 18), | ||
350 | /* Avoid commands not supported in Clik drive */ | ||
351 | IDE_AFLAG_CLIK_DRIVE = (1 << 19), | ||
352 | /* Requires BH algorithm for packets */ | ||
353 | IDE_AFLAG_ZIP_DRIVE = (1 << 20), | ||
354 | |||
355 | /* ide-tape */ | ||
356 | IDE_AFLAG_IGNORE_DSC = (1 << 21), | ||
357 | /* 0 When the tape position is unknown */ | ||
358 | IDE_AFLAG_ADDRESS_VALID = (1 << 22), | ||
359 | /* Device already opened */ | ||
360 | IDE_AFLAG_BUSY = (1 << 23), | ||
361 | /* Attempt to auto-detect the current user block size */ | ||
362 | IDE_AFLAG_DETECT_BS = (1 << 24), | ||
363 | /* Currently on a filemark */ | ||
364 | IDE_AFLAG_FILEMARK = (1 << 25), | ||
365 | /* 0 = no tape is loaded, so we don't rewind after ejecting */ | ||
366 | IDE_AFLAG_MEDIUM_PRESENT = (1 << 26) | ||
367 | }; | ||
368 | |||
369 | struct ide_drive_s { | ||
311 | char name[4]; /* drive name, such as "hda" */ | 370 | char name[4]; /* drive name, such as "hda" */ |
312 | char driver_req[10]; /* requests specific driver */ | 371 | char driver_req[10]; /* requests specific driver */ |
313 | 372 | ||
@@ -355,7 +414,6 @@ typedef struct ide_drive_s { | |||
355 | unsigned nodma : 1; /* disallow DMA */ | 414 | unsigned nodma : 1; /* disallow DMA */ |
356 | unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ | 415 | unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ |
357 | unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ | 416 | unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ |
358 | unsigned vdma : 1; /* 1=doing PIO over DMA 0=doing normal DMA */ | ||
359 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ | 417 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ |
360 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ | 418 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ |
361 | unsigned post_reset : 1; | 419 | unsigned post_reset : 1; |
@@ -400,7 +458,14 @@ typedef struct ide_drive_s { | |||
400 | struct list_head list; | 458 | struct list_head list; |
401 | struct device gendev; | 459 | struct device gendev; |
402 | struct completion gendev_rel_comp; /* to deal with device release() */ | 460 | struct completion gendev_rel_comp; /* to deal with device release() */ |
403 | } ide_drive_t; | 461 | |
462 | /* callback for packet commands */ | ||
463 | void (*pc_callback)(struct ide_drive_s *); | ||
464 | |||
465 | unsigned long atapi_flags; | ||
466 | }; | ||
467 | |||
468 | typedef struct ide_drive_s ide_drive_t; | ||
404 | 469 | ||
405 | #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev) | 470 | #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev) |
406 | 471 | ||
@@ -408,8 +473,28 @@ typedef struct ide_drive_s { | |||
408 | ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) | 473 | ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) |
409 | #define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) | 474 | #define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) |
410 | 475 | ||
476 | struct ide_task_s; | ||
411 | struct ide_port_info; | 477 | struct ide_port_info; |
412 | 478 | ||
479 | struct ide_tp_ops { | ||
480 | void (*exec_command)(struct hwif_s *, u8); | ||
481 | u8 (*read_status)(struct hwif_s *); | ||
482 | u8 (*read_altstatus)(struct hwif_s *); | ||
483 | u8 (*read_sff_dma_status)(struct hwif_s *); | ||
484 | |||
485 | void (*set_irq)(struct hwif_s *, int); | ||
486 | |||
487 | void (*tf_load)(ide_drive_t *, struct ide_task_s *); | ||
488 | void (*tf_read)(ide_drive_t *, struct ide_task_s *); | ||
489 | |||
490 | void (*input_data)(ide_drive_t *, struct request *, void *, | ||
491 | unsigned int); | ||
492 | void (*output_data)(ide_drive_t *, struct request *, void *, | ||
493 | unsigned int); | ||
494 | }; | ||
495 | |||
496 | extern const struct ide_tp_ops default_tp_ops; | ||
497 | |||
413 | struct ide_port_ops { | 498 | struct ide_port_ops { |
414 | /* host specific initialization of a device */ | 499 | /* host specific initialization of a device */ |
415 | void (*init_dev)(ide_drive_t *); | 500 | void (*init_dev)(ide_drive_t *); |
@@ -447,8 +532,6 @@ struct ide_dma_ops { | |||
447 | void (*dma_timeout)(struct ide_drive_s *); | 532 | void (*dma_timeout)(struct ide_drive_s *); |
448 | }; | 533 | }; |
449 | 534 | ||
450 | struct ide_task_s; | ||
451 | |||
452 | typedef struct hwif_s { | 535 | typedef struct hwif_s { |
453 | struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ | 536 | struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ |
454 | struct hwif_s *mate; /* other hwif from same PCI chip */ | 537 | struct hwif_s *mate; /* other hwif from same PCI chip */ |
@@ -486,22 +569,12 @@ typedef struct hwif_s { | |||
486 | 569 | ||
487 | void (*rw_disk)(ide_drive_t *, struct request *); | 570 | void (*rw_disk)(ide_drive_t *, struct request *); |
488 | 571 | ||
572 | const struct ide_tp_ops *tp_ops; | ||
489 | const struct ide_port_ops *port_ops; | 573 | const struct ide_port_ops *port_ops; |
490 | const struct ide_dma_ops *dma_ops; | 574 | const struct ide_dma_ops *dma_ops; |
491 | 575 | ||
492 | void (*tf_load)(ide_drive_t *, struct ide_task_s *); | ||
493 | void (*tf_read)(ide_drive_t *, struct ide_task_s *); | ||
494 | |||
495 | void (*input_data)(ide_drive_t *, struct request *, void *, unsigned); | ||
496 | void (*output_data)(ide_drive_t *, struct request *, void *, unsigned); | ||
497 | |||
498 | void (*ide_dma_clear_irq)(ide_drive_t *drive); | 576 | void (*ide_dma_clear_irq)(ide_drive_t *drive); |
499 | 577 | ||
500 | void (*OUTB)(u8 addr, unsigned long port); | ||
501 | void (*OUTBSYNC)(struct hwif_s *hwif, u8 addr, unsigned long port); | ||
502 | |||
503 | u8 (*INB)(unsigned long port); | ||
504 | |||
505 | /* dma physical region descriptor table (cpu view) */ | 578 | /* dma physical region descriptor table (cpu view) */ |
506 | unsigned int *dmatable_cpu; | 579 | unsigned int *dmatable_cpu; |
507 | /* dma physical region descriptor table (dma view) */ | 580 | /* dma physical region descriptor table (dma view) */ |
@@ -524,8 +597,6 @@ typedef struct hwif_s { | |||
524 | int irq; /* our irq number */ | 597 | int irq; /* our irq number */ |
525 | 598 | ||
526 | unsigned long dma_base; /* base addr for dma ports */ | 599 | unsigned long dma_base; /* base addr for dma ports */ |
527 | unsigned long dma_command; /* dma command register */ | ||
528 | unsigned long dma_status; /* dma status register */ | ||
529 | 600 | ||
530 | unsigned long config_data; /* for use by chipset-specific code */ | 601 | unsigned long config_data; /* for use by chipset-specific code */ |
531 | unsigned long select_data; /* for use by chipset-specific code */ | 602 | unsigned long select_data; /* for use by chipset-specific code */ |
@@ -552,6 +623,11 @@ typedef struct hwif_s { | |||
552 | #endif | 623 | #endif |
553 | } ____cacheline_internodealigned_in_smp ide_hwif_t; | 624 | } ____cacheline_internodealigned_in_smp ide_hwif_t; |
554 | 625 | ||
626 | struct ide_host { | ||
627 | ide_hwif_t *ports[MAX_HWIFS]; | ||
628 | unsigned int n_ports; | ||
629 | }; | ||
630 | |||
555 | /* | 631 | /* |
556 | * internal ide interrupt handler type | 632 | * internal ide interrupt handler type |
557 | */ | 633 | */ |
@@ -611,8 +687,6 @@ enum { | |||
611 | PC_FLAG_WRITING = (1 << 6), | 687 | PC_FLAG_WRITING = (1 << 6), |
612 | /* command timed out */ | 688 | /* command timed out */ |
613 | PC_FLAG_TIMEDOUT = (1 << 7), | 689 | PC_FLAG_TIMEDOUT = (1 << 7), |
614 | PC_FLAG_ZIP_DRIVE = (1 << 8), | ||
615 | PC_FLAG_DRQ_INTERRUPT = (1 << 9), | ||
616 | }; | 690 | }; |
617 | 691 | ||
618 | struct ide_atapi_pc { | 692 | struct ide_atapi_pc { |
@@ -646,8 +720,6 @@ struct ide_atapi_pc { | |||
646 | */ | 720 | */ |
647 | u8 pc_buf[256]; | 721 | u8 pc_buf[256]; |
648 | 722 | ||
649 | void (*callback)(ide_drive_t *); | ||
650 | |||
651 | /* idetape only */ | 723 | /* idetape only */ |
652 | struct idetape_bh *bh; | 724 | struct idetape_bh *bh; |
653 | char *b_data; | 725 | char *b_data; |
@@ -807,13 +879,6 @@ int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsig | |||
807 | extern int ide_vlb_clk; | 879 | extern int ide_vlb_clk; |
808 | extern int ide_pci_clk; | 880 | extern int ide_pci_clk; |
809 | 881 | ||
810 | ide_hwif_t *ide_find_port_slot(const struct ide_port_info *); | ||
811 | |||
812 | static inline ide_hwif_t *ide_find_port(void) | ||
813 | { | ||
814 | return ide_find_port_slot(NULL); | ||
815 | } | ||
816 | |||
817 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); | 882 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); |
818 | int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, | 883 | int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, |
819 | int uptodate, int nr_sectors); | 884 | int uptodate, int nr_sectors); |
@@ -884,6 +949,7 @@ enum { | |||
884 | IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE | | 949 | IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE | |
885 | IDE_TFLAG_IN_HOB_NSECT | | 950 | IDE_TFLAG_IN_HOB_NSECT | |
886 | IDE_TFLAG_IN_HOB_LBA, | 951 | IDE_TFLAG_IN_HOB_LBA, |
952 | IDE_TFLAG_IN_FEATURE = (1 << 1), | ||
887 | IDE_TFLAG_IN_NSECT = (1 << 25), | 953 | IDE_TFLAG_IN_NSECT = (1 << 25), |
888 | IDE_TFLAG_IN_LBAL = (1 << 26), | 954 | IDE_TFLAG_IN_LBAL = (1 << 26), |
889 | IDE_TFLAG_IN_LBAM = (1 << 27), | 955 | IDE_TFLAG_IN_LBAM = (1 << 27), |
@@ -948,9 +1014,25 @@ typedef struct ide_task_s { | |||
948 | 1014 | ||
949 | void ide_tf_dump(const char *, struct ide_taskfile *); | 1015 | void ide_tf_dump(const char *, struct ide_taskfile *); |
950 | 1016 | ||
1017 | void ide_exec_command(ide_hwif_t *, u8); | ||
1018 | u8 ide_read_status(ide_hwif_t *); | ||
1019 | u8 ide_read_altstatus(ide_hwif_t *); | ||
1020 | u8 ide_read_sff_dma_status(ide_hwif_t *); | ||
1021 | |||
1022 | void ide_set_irq(ide_hwif_t *, int); | ||
1023 | |||
1024 | void ide_tf_load(ide_drive_t *, ide_task_t *); | ||
1025 | void ide_tf_read(ide_drive_t *, ide_task_t *); | ||
1026 | |||
1027 | void ide_input_data(ide_drive_t *, struct request *, void *, unsigned int); | ||
1028 | void ide_output_data(ide_drive_t *, struct request *, void *, unsigned int); | ||
1029 | |||
951 | extern void SELECT_DRIVE(ide_drive_t *); | 1030 | extern void SELECT_DRIVE(ide_drive_t *); |
952 | void SELECT_MASK(ide_drive_t *, int); | 1031 | void SELECT_MASK(ide_drive_t *, int); |
953 | 1032 | ||
1033 | u8 ide_read_error(ide_drive_t *); | ||
1034 | void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); | ||
1035 | |||
954 | extern int drive_is_ready(ide_drive_t *); | 1036 | extern int drive_is_ready(ide_drive_t *); |
955 | 1037 | ||
956 | void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); | 1038 | void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); |
@@ -1000,12 +1082,15 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o | |||
1000 | #define ide_pci_register_driver(d) pci_register_driver(d) | 1082 | #define ide_pci_register_driver(d) pci_register_driver(d) |
1001 | #endif | 1083 | #endif |
1002 | 1084 | ||
1003 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); | 1085 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, |
1086 | hw_regs_t *, hw_regs_t **); | ||
1004 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | 1087 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); |
1005 | 1088 | ||
1006 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1089 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
1007 | int ide_pci_set_master(struct pci_dev *, const char *); | 1090 | int ide_pci_set_master(struct pci_dev *, const char *); |
1008 | unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *); | 1091 | unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *); |
1092 | extern const struct ide_dma_ops sff_dma_ops; | ||
1093 | int ide_pci_check_simplex(ide_hwif_t *, const struct ide_port_info *); | ||
1009 | int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); | 1094 | int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); |
1010 | #else | 1095 | #else |
1011 | static inline int ide_hwif_setup_dma(ide_hwif_t *hwif, | 1096 | static inline int ide_hwif_setup_dma(ide_hwif_t *hwif, |
@@ -1015,10 +1100,6 @@ static inline int ide_hwif_setup_dma(ide_hwif_t *hwif, | |||
1015 | } | 1100 | } |
1016 | #endif | 1101 | #endif |
1017 | 1102 | ||
1018 | extern void default_hwif_iops(ide_hwif_t *); | ||
1019 | extern void default_hwif_mmiops(ide_hwif_t *); | ||
1020 | extern void default_hwif_transport(ide_hwif_t *); | ||
1021 | |||
1022 | typedef struct ide_pci_enablebit_s { | 1103 | typedef struct ide_pci_enablebit_s { |
1023 | u8 reg; /* byte pci reg holding the enable-bit */ | 1104 | u8 reg; /* byte pci reg holding the enable-bit */ |
1024 | u8 mask; /* mask to isolate the enable-bit */ | 1105 | u8 mask; /* mask to isolate the enable-bit */ |
@@ -1081,7 +1162,6 @@ enum { | |||
1081 | IDE_HFLAG_IO_32BIT = (1 << 24), | 1162 | IDE_HFLAG_IO_32BIT = (1 << 24), |
1082 | /* unmask IRQs */ | 1163 | /* unmask IRQs */ |
1083 | IDE_HFLAG_UNMASK_IRQS = (1 << 25), | 1164 | IDE_HFLAG_UNMASK_IRQS = (1 << 25), |
1084 | IDE_HFLAG_ABUSE_SET_DMA_MODE = (1 << 26), | ||
1085 | /* serialize ports if DMA is possible (for sl82c105) */ | 1165 | /* serialize ports if DMA is possible (for sl82c105) */ |
1086 | IDE_HFLAG_SERIALIZE_DMA = (1 << 27), | 1166 | IDE_HFLAG_SERIALIZE_DMA = (1 << 27), |
1087 | /* force host out of "simplex" mode */ | 1167 | /* force host out of "simplex" mode */ |
@@ -1092,8 +1172,6 @@ enum { | |||
1092 | IDE_HFLAG_NO_IO_32BIT = (1 << 30), | 1172 | IDE_HFLAG_NO_IO_32BIT = (1 << 30), |
1093 | /* never unmask IRQs */ | 1173 | /* never unmask IRQs */ |
1094 | IDE_HFLAG_NO_UNMASK_IRQS = (1 << 31), | 1174 | IDE_HFLAG_NO_UNMASK_IRQS = (1 << 31), |
1095 | /* host uses VDMA (disabled for now) */ | ||
1096 | IDE_HFLAG_VDMA = 0, | ||
1097 | }; | 1175 | }; |
1098 | 1176 | ||
1099 | #ifdef CONFIG_BLK_DEV_OFFBOARD | 1177 | #ifdef CONFIG_BLK_DEV_OFFBOARD |
@@ -1110,6 +1188,7 @@ struct ide_port_info { | |||
1110 | int (*init_dma)(ide_hwif_t *, | 1188 | int (*init_dma)(ide_hwif_t *, |
1111 | const struct ide_port_info *); | 1189 | const struct ide_port_info *); |
1112 | 1190 | ||
1191 | const struct ide_tp_ops *tp_ops; | ||
1113 | const struct ide_port_ops *port_ops; | 1192 | const struct ide_port_ops *port_ops; |
1114 | const struct ide_dma_ops *dma_ops; | 1193 | const struct ide_dma_ops *dma_ops; |
1115 | 1194 | ||
@@ -1163,7 +1242,6 @@ void ide_destroy_dmatable(ide_drive_t *); | |||
1163 | extern int ide_build_dmatable(ide_drive_t *, struct request *); | 1242 | extern int ide_build_dmatable(ide_drive_t *, struct request *); |
1164 | int ide_allocate_dma_engine(ide_hwif_t *); | 1243 | int ide_allocate_dma_engine(ide_hwif_t *); |
1165 | void ide_release_dma_engine(ide_hwif_t *); | 1244 | void ide_release_dma_engine(ide_hwif_t *); |
1166 | void ide_setup_dma(ide_hwif_t *, unsigned long); | ||
1167 | 1245 | ||
1168 | void ide_dma_host_set(ide_drive_t *, int); | 1246 | void ide_dma_host_set(ide_drive_t *, int); |
1169 | extern int ide_dma_setup(ide_drive_t *); | 1247 | extern int ide_dma_setup(ide_drive_t *); |
@@ -1217,8 +1295,14 @@ void ide_undecoded_slave(ide_drive_t *); | |||
1217 | 1295 | ||
1218 | void ide_port_apply_params(ide_hwif_t *); | 1296 | void ide_port_apply_params(ide_hwif_t *); |
1219 | 1297 | ||
1220 | int ide_device_add_all(u8 *idx, const struct ide_port_info *); | 1298 | struct ide_host *ide_host_alloc_all(const struct ide_port_info *, hw_regs_t **); |
1221 | int ide_device_add(u8 idx[4], const struct ide_port_info *); | 1299 | struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **); |
1300 | void ide_host_free(struct ide_host *); | ||
1301 | int ide_host_register(struct ide_host *, const struct ide_port_info *, | ||
1302 | hw_regs_t **); | ||
1303 | int ide_host_add(const struct ide_port_info *, hw_regs_t **, | ||
1304 | struct ide_host **); | ||
1305 | void ide_host_remove(struct ide_host *); | ||
1222 | int ide_legacy_device_add(const struct ide_port_info *, unsigned long); | 1306 | int ide_legacy_device_add(const struct ide_port_info *, unsigned long); |
1223 | void ide_port_unregister_devices(ide_hwif_t *); | 1307 | void ide_port_unregister_devices(ide_hwif_t *); |
1224 | void ide_port_scan(ide_hwif_t *); | 1308 | void ide_port_scan(ide_hwif_t *); |
@@ -1350,33 +1434,4 @@ static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) | |||
1350 | 1434 | ||
1351 | return &hwif->drives[(drive->dn ^ 1) & 1]; | 1435 | return &hwif->drives[(drive->dn ^ 1) & 1]; |
1352 | } | 1436 | } |
1353 | |||
1354 | static inline void ide_set_irq(ide_drive_t *drive, int on) | ||
1355 | { | ||
1356 | ide_hwif_t *hwif = drive->hwif; | ||
1357 | |||
1358 | hwif->OUTBSYNC(hwif, ATA_DEVCTL_OBS | (on ? 0 : 2), | ||
1359 | hwif->io_ports.ctl_addr); | ||
1360 | } | ||
1361 | |||
1362 | static inline u8 ide_read_status(ide_drive_t *drive) | ||
1363 | { | ||
1364 | ide_hwif_t *hwif = drive->hwif; | ||
1365 | |||
1366 | return hwif->INB(hwif->io_ports.status_addr); | ||
1367 | } | ||
1368 | |||
1369 | static inline u8 ide_read_altstatus(ide_drive_t *drive) | ||
1370 | { | ||
1371 | ide_hwif_t *hwif = drive->hwif; | ||
1372 | |||
1373 | return hwif->INB(hwif->io_ports.ctl_addr); | ||
1374 | } | ||
1375 | |||
1376 | static inline u8 ide_read_error(ide_drive_t *drive) | ||
1377 | { | ||
1378 | ide_hwif_t *hwif = drive->hwif; | ||
1379 | |||
1380 | return hwif->INB(hwif->io_ports.error_addr); | ||
1381 | } | ||
1382 | #endif /* _IDE_H */ | 1437 | #endif /* _IDE_H */ |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 0b5e03eae6d2..a1630ba0b87c 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -98,6 +98,9 @@ | |||
98 | 98 | ||
99 | #define IEEE80211_MAX_SSID_LEN 32 | 99 | #define IEEE80211_MAX_SSID_LEN 32 |
100 | #define IEEE80211_MAX_MESH_ID_LEN 32 | 100 | #define IEEE80211_MAX_MESH_ID_LEN 32 |
101 | #define IEEE80211_QOS_CTL_LEN 2 | ||
102 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F | ||
103 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 | ||
101 | 104 | ||
102 | struct ieee80211_hdr { | 105 | struct ieee80211_hdr { |
103 | __le16 frame_control; | 106 | __le16 frame_control; |
@@ -109,6 +112,355 @@ struct ieee80211_hdr { | |||
109 | u8 addr4[6]; | 112 | u8 addr4[6]; |
110 | } __attribute__ ((packed)); | 113 | } __attribute__ ((packed)); |
111 | 114 | ||
115 | /** | ||
116 | * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set | ||
117 | * @fc: frame control bytes in little-endian byteorder | ||
118 | */ | ||
119 | static inline int ieee80211_has_tods(__le16 fc) | ||
120 | { | ||
121 | return (fc & cpu_to_le16(IEEE80211_FCTL_TODS)) != 0; | ||
122 | } | ||
123 | |||
124 | /** | ||
125 | * ieee80211_has_fromds - check if IEEE80211_FCTL_FROMDS is set | ||
126 | * @fc: frame control bytes in little-endian byteorder | ||
127 | */ | ||
128 | static inline int ieee80211_has_fromds(__le16 fc) | ||
129 | { | ||
130 | return (fc & cpu_to_le16(IEEE80211_FCTL_FROMDS)) != 0; | ||
131 | } | ||
132 | |||
133 | /** | ||
134 | * ieee80211_has_a4 - check if IEEE80211_FCTL_TODS and IEEE80211_FCTL_FROMDS are set | ||
135 | * @fc: frame control bytes in little-endian byteorder | ||
136 | */ | ||
137 | static inline int ieee80211_has_a4(__le16 fc) | ||
138 | { | ||
139 | __le16 tmp = cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS); | ||
140 | return (fc & tmp) == tmp; | ||
141 | } | ||
142 | |||
143 | /** | ||
144 | * ieee80211_has_morefrags - check if IEEE80211_FCTL_MOREFRAGS is set | ||
145 | * @fc: frame control bytes in little-endian byteorder | ||
146 | */ | ||
147 | static inline int ieee80211_has_morefrags(__le16 fc) | ||
148 | { | ||
149 | return (fc & cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)) != 0; | ||
150 | } | ||
151 | |||
152 | /** | ||
153 | * ieee80211_has_retry - check if IEEE80211_FCTL_RETRY is set | ||
154 | * @fc: frame control bytes in little-endian byteorder | ||
155 | */ | ||
156 | static inline int ieee80211_has_retry(__le16 fc) | ||
157 | { | ||
158 | return (fc & cpu_to_le16(IEEE80211_FCTL_RETRY)) != 0; | ||
159 | } | ||
160 | |||
161 | /** | ||
162 | * ieee80211_has_pm - check if IEEE80211_FCTL_PM is set | ||
163 | * @fc: frame control bytes in little-endian byteorder | ||
164 | */ | ||
165 | static inline int ieee80211_has_pm(__le16 fc) | ||
166 | { | ||
167 | return (fc & cpu_to_le16(IEEE80211_FCTL_PM)) != 0; | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * ieee80211_has_moredata - check if IEEE80211_FCTL_MOREDATA is set | ||
172 | * @fc: frame control bytes in little-endian byteorder | ||
173 | */ | ||
174 | static inline int ieee80211_has_moredata(__le16 fc) | ||
175 | { | ||
176 | return (fc & cpu_to_le16(IEEE80211_FCTL_MOREDATA)) != 0; | ||
177 | } | ||
178 | |||
179 | /** | ||
180 | * ieee80211_has_protected - check if IEEE80211_FCTL_PROTECTED is set | ||
181 | * @fc: frame control bytes in little-endian byteorder | ||
182 | */ | ||
183 | static inline int ieee80211_has_protected(__le16 fc) | ||
184 | { | ||
185 | return (fc & cpu_to_le16(IEEE80211_FCTL_PROTECTED)) != 0; | ||
186 | } | ||
187 | |||
188 | /** | ||
189 | * ieee80211_has_order - check if IEEE80211_FCTL_ORDER is set | ||
190 | * @fc: frame control bytes in little-endian byteorder | ||
191 | */ | ||
192 | static inline int ieee80211_has_order(__le16 fc) | ||
193 | { | ||
194 | return (fc & cpu_to_le16(IEEE80211_FCTL_ORDER)) != 0; | ||
195 | } | ||
196 | |||
197 | /** | ||
198 | * ieee80211_is_mgmt - check if type is IEEE80211_FTYPE_MGMT | ||
199 | * @fc: frame control bytes in little-endian byteorder | ||
200 | */ | ||
201 | static inline int ieee80211_is_mgmt(__le16 fc) | ||
202 | { | ||
203 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) == | ||
204 | cpu_to_le16(IEEE80211_FTYPE_MGMT); | ||
205 | } | ||
206 | |||
207 | /** | ||
208 | * ieee80211_is_ctl - check if type is IEEE80211_FTYPE_CTL | ||
209 | * @fc: frame control bytes in little-endian byteorder | ||
210 | */ | ||
211 | static inline int ieee80211_is_ctl(__le16 fc) | ||
212 | { | ||
213 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) == | ||
214 | cpu_to_le16(IEEE80211_FTYPE_CTL); | ||
215 | } | ||
216 | |||
217 | /** | ||
218 | * ieee80211_is_data - check if type is IEEE80211_FTYPE_DATA | ||
219 | * @fc: frame control bytes in little-endian byteorder | ||
220 | */ | ||
221 | static inline int ieee80211_is_data(__le16 fc) | ||
222 | { | ||
223 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) == | ||
224 | cpu_to_le16(IEEE80211_FTYPE_DATA); | ||
225 | } | ||
226 | |||
227 | /** | ||
228 | * ieee80211_is_data_qos - check if type is IEEE80211_FTYPE_DATA and IEEE80211_STYPE_QOS_DATA is set | ||
229 | * @fc: frame control bytes in little-endian byteorder | ||
230 | */ | ||
231 | static inline int ieee80211_is_data_qos(__le16 fc) | ||
232 | { | ||
233 | /* | ||
234 | * mask with QOS_DATA rather than IEEE80211_FCTL_STYPE as we just need | ||
235 | * to check the one bit | ||
236 | */ | ||
237 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_STYPE_QOS_DATA)) == | ||
238 | cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_DATA); | ||
239 | } | ||
240 | |||
241 | /** | ||
242 | * ieee80211_is_data_present - check if type is IEEE80211_FTYPE_DATA and has data | ||
243 | * @fc: frame control bytes in little-endian byteorder | ||
244 | */ | ||
245 | static inline int ieee80211_is_data_present(__le16 fc) | ||
246 | { | ||
247 | /* | ||
248 | * mask with 0x40 and test that that bit is clear to only return true | ||
249 | * for the data-containing substypes. | ||
250 | */ | ||
251 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | 0x40)) == | ||
252 | cpu_to_le16(IEEE80211_FTYPE_DATA); | ||
253 | } | ||
254 | |||
255 | /** | ||
256 | * ieee80211_is_assoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_REQ | ||
257 | * @fc: frame control bytes in little-endian byteorder | ||
258 | */ | ||
259 | static inline int ieee80211_is_assoc_req(__le16 fc) | ||
260 | { | ||
261 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
262 | cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ASSOC_REQ); | ||
263 | } | ||
264 | |||
265 | /** | ||
266 | * ieee80211_is_assoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_RESP | ||
267 | * @fc: frame control bytes in little-endian byteorder | ||
268 | */ | ||
269 | static inline int ieee80211_is_assoc_resp(__le16 fc) | ||
270 | { | ||
271 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
272 | cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ASSOC_RESP); | ||
273 | } | ||
274 | |||
275 | /** | ||
276 | * ieee80211_is_reassoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_REQ | ||
277 | * @fc: frame control bytes in little-endian byteorder | ||
278 | */ | ||
279 | static inline int ieee80211_is_reassoc_req(__le16 fc) | ||
280 | { | ||
281 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
282 | cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_REASSOC_REQ); | ||
283 | } | ||
284 | |||
285 | /** | ||
286 | * ieee80211_is_reassoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_RESP | ||
287 | * @fc: frame control bytes in little-endian byteorder | ||
288 | */ | ||
289 | static inline int ieee80211_is_reassoc_resp(__le16 fc) | ||
290 | { | ||
291 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
292 | cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_REASSOC_RESP); | ||
293 | } | ||
294 | |||
295 | /** | ||
296 | * ieee80211_is_probe_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_REQ | ||
297 | * @fc: frame control bytes in little-endian byteorder | ||
298 | */ | ||
299 | static inline int ieee80211_is_probe_req(__le16 fc) | ||
300 | { | ||
301 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
302 | cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ); | ||
303 | } | ||
304 | |||
305 | /** | ||
306 | * ieee80211_is_probe_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_RESP | ||
307 | * @fc: frame control bytes in little-endian byteorder | ||
308 | */ | ||
309 | static inline int ieee80211_is_probe_resp(__le16 fc) | ||
310 | { | ||
311 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
312 | cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP); | ||
313 | } | ||
314 | |||
315 | /** | ||
316 | * ieee80211_is_beacon - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_BEACON | ||
317 | * @fc: frame control bytes in little-endian byteorder | ||
318 | */ | ||
319 | static inline int ieee80211_is_beacon(__le16 fc) | ||
320 | { | ||
321 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
322 | cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON); | ||
323 | } | ||
324 | |||
325 | /** | ||
326 | * ieee80211_is_atim - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ATIM | ||
327 | * @fc: frame control bytes in little-endian byteorder | ||
328 | */ | ||
329 | static inline int ieee80211_is_atim(__le16 fc) | ||
330 | { | ||
331 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
332 | cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ATIM); | ||
333 | } | ||
334 | |||
335 | /** | ||
336 | * ieee80211_is_disassoc - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DISASSOC | ||
337 | * @fc: frame control bytes in little-endian byteorder | ||
338 | */ | ||
339 | static inline int ieee80211_is_disassoc(__le16 fc) | ||
340 | { | ||
341 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
342 | cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DISASSOC); | ||
343 | } | ||
344 | |||
345 | /** | ||
346 | * ieee80211_is_auth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_AUTH | ||
347 | * @fc: frame control bytes in little-endian byteorder | ||
348 | */ | ||
349 | static inline int ieee80211_is_auth(__le16 fc) | ||
350 | { | ||
351 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
352 | cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH); | ||
353 | } | ||
354 | |||
355 | /** | ||
356 | * ieee80211_is_deauth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DEAUTH | ||
357 | * @fc: frame control bytes in little-endian byteorder | ||
358 | */ | ||
359 | static inline int ieee80211_is_deauth(__le16 fc) | ||
360 | { | ||
361 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
362 | cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DEAUTH); | ||
363 | } | ||
364 | |||
365 | /** | ||
366 | * ieee80211_is_action - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ACTION | ||
367 | * @fc: frame control bytes in little-endian byteorder | ||
368 | */ | ||
369 | static inline int ieee80211_is_action(__le16 fc) | ||
370 | { | ||
371 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
372 | cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION); | ||
373 | } | ||
374 | |||
375 | /** | ||
376 | * ieee80211_is_back_req - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK_REQ | ||
377 | * @fc: frame control bytes in little-endian byteorder | ||
378 | */ | ||
379 | static inline int ieee80211_is_back_req(__le16 fc) | ||
380 | { | ||
381 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
382 | cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_BACK_REQ); | ||
383 | } | ||
384 | |||
385 | /** | ||
386 | * ieee80211_is_back - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK | ||
387 | * @fc: frame control bytes in little-endian byteorder | ||
388 | */ | ||
389 | static inline int ieee80211_is_back(__le16 fc) | ||
390 | { | ||
391 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
392 | cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_BACK); | ||
393 | } | ||
394 | |||
395 | /** | ||
396 | * ieee80211_is_pspoll - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_PSPOLL | ||
397 | * @fc: frame control bytes in little-endian byteorder | ||
398 | */ | ||
399 | static inline int ieee80211_is_pspoll(__le16 fc) | ||
400 | { | ||
401 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
402 | cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL); | ||
403 | } | ||
404 | |||
405 | /** | ||
406 | * ieee80211_is_rts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_RTS | ||
407 | * @fc: frame control bytes in little-endian byteorder | ||
408 | */ | ||
409 | static inline int ieee80211_is_rts(__le16 fc) | ||
410 | { | ||
411 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
412 | cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS); | ||
413 | } | ||
414 | |||
415 | /** | ||
416 | * ieee80211_is_cts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CTS | ||
417 | * @fc: frame control bytes in little-endian byteorder | ||
418 | */ | ||
419 | static inline int ieee80211_is_cts(__le16 fc) | ||
420 | { | ||
421 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
422 | cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS); | ||
423 | } | ||
424 | |||
425 | /** | ||
426 | * ieee80211_is_ack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_ACK | ||
427 | * @fc: frame control bytes in little-endian byteorder | ||
428 | */ | ||
429 | static inline int ieee80211_is_ack(__le16 fc) | ||
430 | { | ||
431 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
432 | cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_ACK); | ||
433 | } | ||
434 | |||
435 | /** | ||
436 | * ieee80211_is_cfend - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFEND | ||
437 | * @fc: frame control bytes in little-endian byteorder | ||
438 | */ | ||
439 | static inline int ieee80211_is_cfend(__le16 fc) | ||
440 | { | ||
441 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
442 | cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CFEND); | ||
443 | } | ||
444 | |||
445 | /** | ||
446 | * ieee80211_is_cfendack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFENDACK | ||
447 | * @fc: frame control bytes in little-endian byteorder | ||
448 | */ | ||
449 | static inline int ieee80211_is_cfendack(__le16 fc) | ||
450 | { | ||
451 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
452 | cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CFENDACK); | ||
453 | } | ||
454 | |||
455 | /** | ||
456 | * ieee80211_is_nullfunc - check if FTYPE=IEEE80211_FTYPE_DATA and STYPE=IEEE80211_STYPE_NULLFUNC | ||
457 | * @fc: frame control bytes in little-endian byteorder | ||
458 | */ | ||
459 | static inline int ieee80211_is_nullfunc(__le16 fc) | ||
460 | { | ||
461 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
462 | cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); | ||
463 | } | ||
112 | 464 | ||
113 | struct ieee80211s_hdr { | 465 | struct ieee80211s_hdr { |
114 | u8 flags; | 466 | u8 flags; |
@@ -119,6 +471,40 @@ struct ieee80211s_hdr { | |||
119 | u8 eaddr3[6]; | 471 | u8 eaddr3[6]; |
120 | } __attribute__ ((packed)); | 472 | } __attribute__ ((packed)); |
121 | 473 | ||
474 | /** | ||
475 | * struct ieee80211_quiet_ie | ||
476 | * | ||
477 | * This structure refers to "Quiet information element" | ||
478 | */ | ||
479 | struct ieee80211_quiet_ie { | ||
480 | u8 count; | ||
481 | u8 period; | ||
482 | __le16 duration; | ||
483 | __le16 offset; | ||
484 | } __attribute__ ((packed)); | ||
485 | |||
486 | /** | ||
487 | * struct ieee80211_msrment_ie | ||
488 | * | ||
489 | * This structure refers to "Measurement Request/Report information element" | ||
490 | */ | ||
491 | struct ieee80211_msrment_ie { | ||
492 | u8 token; | ||
493 | u8 mode; | ||
494 | u8 type; | ||
495 | u8 request[0]; | ||
496 | } __attribute__ ((packed)); | ||
497 | |||
498 | /** | ||
499 | * struct ieee80211_channel_sw_ie | ||
500 | * | ||
501 | * This structure refers to "Channel Switch Announcement information element" | ||
502 | */ | ||
503 | struct ieee80211_channel_sw_ie { | ||
504 | u8 mode; | ||
505 | u8 new_ch_num; | ||
506 | u8 count; | ||
507 | } __attribute__ ((packed)); | ||
122 | 508 | ||
123 | struct ieee80211_mgmt { | 509 | struct ieee80211_mgmt { |
124 | __le16 frame_control; | 510 | __le16 frame_control; |
@@ -194,13 +580,18 @@ struct ieee80211_mgmt { | |||
194 | u8 action_code; | 580 | u8 action_code; |
195 | u8 element_id; | 581 | u8 element_id; |
196 | u8 length; | 582 | u8 length; |
197 | u8 switch_mode; | 583 | struct ieee80211_channel_sw_ie sw_elem; |
198 | u8 new_chan; | ||
199 | u8 switch_count; | ||
200 | } __attribute__((packed)) chan_switch; | 584 | } __attribute__((packed)) chan_switch; |
201 | struct{ | 585 | struct{ |
202 | u8 action_code; | 586 | u8 action_code; |
203 | u8 dialog_token; | 587 | u8 dialog_token; |
588 | u8 element_id; | ||
589 | u8 length; | ||
590 | struct ieee80211_msrment_ie msr_elem; | ||
591 | } __attribute__((packed)) measurement; | ||
592 | struct{ | ||
593 | u8 action_code; | ||
594 | u8 dialog_token; | ||
204 | __le16 capab; | 595 | __le16 capab; |
205 | __le16 timeout; | 596 | __le16 timeout; |
206 | __le16 start_seq_num; | 597 | __le16 start_seq_num; |
@@ -269,6 +660,10 @@ struct ieee80211_bar { | |||
269 | __le16 start_seq_num; | 660 | __le16 start_seq_num; |
270 | } __attribute__((packed)); | 661 | } __attribute__((packed)); |
271 | 662 | ||
663 | /* 802.11 BAR control masks */ | ||
664 | #define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 | ||
665 | #define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 | ||
666 | |||
272 | /** | 667 | /** |
273 | * struct ieee80211_ht_cap - HT capabilities | 668 | * struct ieee80211_ht_cap - HT capabilities |
274 | * | 669 | * |
@@ -306,20 +701,33 @@ struct ieee80211_ht_addt_info { | |||
306 | #define IEEE80211_HT_CAP_SGI_40 0x0040 | 701 | #define IEEE80211_HT_CAP_SGI_40 0x0040 |
307 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 | 702 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 |
308 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 | 703 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 |
704 | /* 802.11n HT capability AMPDU settings */ | ||
309 | #define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 | 705 | #define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 |
310 | #define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C | 706 | #define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C |
707 | /* 802.11n HT capability MSC set */ | ||
708 | #define IEEE80211_SUPP_MCS_SET_UEQM 4 | ||
709 | #define IEEE80211_HT_CAP_MAX_STREAMS 4 | ||
710 | #define IEEE80211_SUPP_MCS_SET_LEN 10 | ||
711 | /* maximum streams the spec allows */ | ||
712 | #define IEEE80211_HT_CAP_MCS_TX_DEFINED 0x01 | ||
713 | #define IEEE80211_HT_CAP_MCS_TX_RX_DIFF 0x02 | ||
714 | #define IEEE80211_HT_CAP_MCS_TX_STREAMS 0x0C | ||
715 | #define IEEE80211_HT_CAP_MCS_TX_UEQM 0x10 | ||
311 | /* 802.11n HT IE masks */ | 716 | /* 802.11n HT IE masks */ |
312 | #define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03 | 717 | #define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03 |
718 | #define IEEE80211_HT_IE_CHA_SEC_NONE 0x00 | ||
719 | #define IEEE80211_HT_IE_CHA_SEC_ABOVE 0x01 | ||
720 | #define IEEE80211_HT_IE_CHA_SEC_BELOW 0x03 | ||
313 | #define IEEE80211_HT_IE_CHA_WIDTH 0x04 | 721 | #define IEEE80211_HT_IE_CHA_WIDTH 0x04 |
314 | #define IEEE80211_HT_IE_HT_PROTECTION 0x0003 | 722 | #define IEEE80211_HT_IE_HT_PROTECTION 0x0003 |
315 | #define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 | 723 | #define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 |
316 | #define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010 | 724 | #define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010 |
317 | 725 | ||
318 | /* MIMO Power Save Modes */ | 726 | /* MIMO Power Save Modes */ |
319 | #define WLAN_HT_CAP_MIMO_PS_STATIC 0 | 727 | #define WLAN_HT_CAP_MIMO_PS_STATIC 0 |
320 | #define WLAN_HT_CAP_MIMO_PS_DYNAMIC 1 | 728 | #define WLAN_HT_CAP_MIMO_PS_DYNAMIC 1 |
321 | #define WLAN_HT_CAP_MIMO_PS_INVALID 2 | 729 | #define WLAN_HT_CAP_MIMO_PS_INVALID 2 |
322 | #define WLAN_HT_CAP_MIMO_PS_DISABLED 3 | 730 | #define WLAN_HT_CAP_MIMO_PS_DISABLED 3 |
323 | 731 | ||
324 | /* Authentication algorithms */ | 732 | /* Authentication algorithms */ |
325 | #define WLAN_AUTH_OPEN 0 | 733 | #define WLAN_AUTH_OPEN 0 |
@@ -337,11 +745,21 @@ struct ieee80211_ht_addt_info { | |||
337 | #define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5) | 745 | #define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5) |
338 | #define WLAN_CAPABILITY_PBCC (1<<6) | 746 | #define WLAN_CAPABILITY_PBCC (1<<6) |
339 | #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) | 747 | #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) |
748 | |||
340 | /* 802.11h */ | 749 | /* 802.11h */ |
341 | #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) | 750 | #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) |
342 | #define WLAN_CAPABILITY_QOS (1<<9) | 751 | #define WLAN_CAPABILITY_QOS (1<<9) |
343 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) | 752 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) |
344 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) | 753 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) |
754 | /* measurement */ | ||
755 | #define IEEE80211_SPCT_MSR_RPRT_MODE_LATE (1<<0) | ||
756 | #define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE (1<<1) | ||
757 | #define IEEE80211_SPCT_MSR_RPRT_MODE_REFUSED (1<<2) | ||
758 | |||
759 | #define IEEE80211_SPCT_MSR_RPRT_TYPE_BASIC 0 | ||
760 | #define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA 1 | ||
761 | #define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI 2 | ||
762 | |||
345 | 763 | ||
346 | /* 802.11g ERP information element */ | 764 | /* 802.11g ERP information element */ |
347 | #define WLAN_ERP_NON_ERP_PRESENT (1<<0) | 765 | #define WLAN_ERP_NON_ERP_PRESENT (1<<0) |
@@ -512,6 +930,15 @@ enum ieee80211_category { | |||
512 | WLAN_CATEGORY_WMM = 17, | 930 | WLAN_CATEGORY_WMM = 17, |
513 | }; | 931 | }; |
514 | 932 | ||
933 | /* SPECTRUM_MGMT action code */ | ||
934 | enum ieee80211_spectrum_mgmt_actioncode { | ||
935 | WLAN_ACTION_SPCT_MSR_REQ = 0, | ||
936 | WLAN_ACTION_SPCT_MSR_RPRT = 1, | ||
937 | WLAN_ACTION_SPCT_TPC_REQ = 2, | ||
938 | WLAN_ACTION_SPCT_TPC_RPRT = 3, | ||
939 | WLAN_ACTION_SPCT_CHL_SWITCH = 4, | ||
940 | }; | ||
941 | |||
515 | /* BACK action code */ | 942 | /* BACK action code */ |
516 | enum ieee80211_back_actioncode { | 943 | enum ieee80211_back_actioncode { |
517 | WLAN_ACTION_ADDBA_REQ = 0, | 944 | WLAN_ACTION_ADDBA_REQ = 0, |
@@ -540,63 +967,57 @@ enum ieee80211_back_parties { | |||
540 | #define WLAN_MAX_KEY_LEN 32 | 967 | #define WLAN_MAX_KEY_LEN 32 |
541 | 968 | ||
542 | /** | 969 | /** |
970 | * ieee80211_get_qos_ctl - get pointer to qos control bytes | ||
971 | * @hdr: the frame | ||
972 | * | ||
973 | * The qos ctrl bytes come after the frame_control, duration, seq_num | ||
974 | * and 3 or 4 addresses of length ETH_ALEN. | ||
975 | * 3 addr: 2 + 2 + 2 + 3*6 = 24 | ||
976 | * 4 addr: 2 + 2 + 2 + 4*6 = 30 | ||
977 | */ | ||
978 | static inline u8 *ieee80211_get_qos_ctl(struct ieee80211_hdr *hdr) | ||
979 | { | ||
980 | if (ieee80211_has_a4(hdr->frame_control)) | ||
981 | return (u8 *)hdr + 30; | ||
982 | else | ||
983 | return (u8 *)hdr + 24; | ||
984 | } | ||
985 | |||
986 | /** | ||
543 | * ieee80211_get_SA - get pointer to SA | 987 | * ieee80211_get_SA - get pointer to SA |
988 | * @hdr: the frame | ||
544 | * | 989 | * |
545 | * Given an 802.11 frame, this function returns the offset | 990 | * Given an 802.11 frame, this function returns the offset |
546 | * to the source address (SA). It does not verify that the | 991 | * to the source address (SA). It does not verify that the |
547 | * header is long enough to contain the address, and the | 992 | * header is long enough to contain the address, and the |
548 | * header must be long enough to contain the frame control | 993 | * header must be long enough to contain the frame control |
549 | * field. | 994 | * field. |
550 | * | ||
551 | * @hdr: the frame | ||
552 | */ | 995 | */ |
553 | static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr) | 996 | static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr) |
554 | { | 997 | { |
555 | u8 *raw = (u8 *) hdr; | 998 | if (ieee80211_has_a4(hdr->frame_control)) |
556 | u8 tofrom = (*(raw+1)) & 3; /* get the TODS and FROMDS bits */ | 999 | return hdr->addr4; |
557 | 1000 | if (ieee80211_has_fromds(hdr->frame_control)) | |
558 | switch (tofrom) { | 1001 | return hdr->addr3; |
559 | case 2: | ||
560 | return hdr->addr3; | ||
561 | case 3: | ||
562 | return hdr->addr4; | ||
563 | } | ||
564 | return hdr->addr2; | 1002 | return hdr->addr2; |
565 | } | 1003 | } |
566 | 1004 | ||
567 | /** | 1005 | /** |
568 | * ieee80211_get_DA - get pointer to DA | 1006 | * ieee80211_get_DA - get pointer to DA |
1007 | * @hdr: the frame | ||
569 | * | 1008 | * |
570 | * Given an 802.11 frame, this function returns the offset | 1009 | * Given an 802.11 frame, this function returns the offset |
571 | * to the destination address (DA). It does not verify that | 1010 | * to the destination address (DA). It does not verify that |
572 | * the header is long enough to contain the address, and the | 1011 | * the header is long enough to contain the address, and the |
573 | * header must be long enough to contain the frame control | 1012 | * header must be long enough to contain the frame control |
574 | * field. | 1013 | * field. |
575 | * | ||
576 | * @hdr: the frame | ||
577 | */ | 1014 | */ |
578 | static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr) | 1015 | static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr) |
579 | { | 1016 | { |
580 | u8 *raw = (u8 *) hdr; | 1017 | if (ieee80211_has_tods(hdr->frame_control)) |
581 | u8 to_ds = (*(raw+1)) & 1; /* get the TODS bit */ | ||
582 | |||
583 | if (to_ds) | ||
584 | return hdr->addr3; | 1018 | return hdr->addr3; |
585 | return hdr->addr1; | 1019 | else |
586 | } | 1020 | return hdr->addr1; |
587 | |||
588 | /** | ||
589 | * ieee80211_get_morefrag - determine whether the MOREFRAGS bit is set | ||
590 | * | ||
591 | * This function determines whether the "more fragments" bit is set | ||
592 | * in the frame. | ||
593 | * | ||
594 | * @hdr: the frame | ||
595 | */ | ||
596 | static inline int ieee80211_get_morefrag(struct ieee80211_hdr *hdr) | ||
597 | { | ||
598 | return (le16_to_cpu(hdr->frame_control) & | ||
599 | IEEE80211_FCTL_MOREFRAGS) != 0; | ||
600 | } | 1021 | } |
601 | 1022 | ||
602 | #endif /* IEEE80211_H */ | 1023 | #endif /* IEEE80211_H */ |
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index 950e13d09e06..6badb3e2c4e4 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h | |||
@@ -4,8 +4,6 @@ | |||
4 | * Authors: | 4 | * Authors: |
5 | * Lennert Buytenhek <buytenh@gnu.org> | 5 | * Lennert Buytenhek <buytenh@gnu.org> |
6 | * | 6 | * |
7 | * $Id: if_bridge.h,v 1.1 2000/02/18 16:47:01 davem Exp $ | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | 7 | * This program is free software; you can redistribute it and/or |
10 | * modify it under the terms of the GNU General Public License | 8 | * modify it under the terms of the GNU General Public License |
11 | * as published by the Free Software Foundation; either version | 9 | * as published by the Free Software Foundation; either version |
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index ad09609227ff..18db0668065a 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h | |||
@@ -43,6 +43,9 @@ struct sockaddr_ll | |||
43 | #define PACKET_COPY_THRESH 7 | 43 | #define PACKET_COPY_THRESH 7 |
44 | #define PACKET_AUXDATA 8 | 44 | #define PACKET_AUXDATA 8 |
45 | #define PACKET_ORIGDEV 9 | 45 | #define PACKET_ORIGDEV 9 |
46 | #define PACKET_VERSION 10 | ||
47 | #define PACKET_HDRLEN 11 | ||
48 | #define PACKET_RESERVE 12 | ||
46 | 49 | ||
47 | struct tpacket_stats | 50 | struct tpacket_stats |
48 | { | 51 | { |
@@ -57,6 +60,7 @@ struct tpacket_auxdata | |||
57 | __u32 tp_snaplen; | 60 | __u32 tp_snaplen; |
58 | __u16 tp_mac; | 61 | __u16 tp_mac; |
59 | __u16 tp_net; | 62 | __u16 tp_net; |
63 | __u16 tp_vlan_tci; | ||
60 | }; | 64 | }; |
61 | 65 | ||
62 | struct tpacket_hdr | 66 | struct tpacket_hdr |
@@ -79,6 +83,26 @@ struct tpacket_hdr | |||
79 | #define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1)) | 83 | #define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1)) |
80 | #define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll)) | 84 | #define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll)) |
81 | 85 | ||
86 | struct tpacket2_hdr | ||
87 | { | ||
88 | __u32 tp_status; | ||
89 | __u32 tp_len; | ||
90 | __u32 tp_snaplen; | ||
91 | __u16 tp_mac; | ||
92 | __u16 tp_net; | ||
93 | __u32 tp_sec; | ||
94 | __u32 tp_nsec; | ||
95 | __u16 tp_vlan_tci; | ||
96 | }; | ||
97 | |||
98 | #define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) | ||
99 | |||
100 | enum tpacket_versions | ||
101 | { | ||
102 | TPACKET_V1, | ||
103 | TPACKET_V2, | ||
104 | }; | ||
105 | |||
82 | /* | 106 | /* |
83 | Frame structure: | 107 | Frame structure: |
84 | 108 | ||
diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h index 0f2f70d4e48c..c3b1f8562709 100644 --- a/include/linux/if_ppp.h +++ b/include/linux/if_ppp.h | |||
@@ -1,5 +1,3 @@ | |||
1 | /* $Id: if_ppp.h,v 1.21 2000/03/27 06:03:36 paulus Exp $ */ | ||
2 | |||
3 | /* | 1 | /* |
4 | * if_ppp.h - Point-to-Point Protocol definitions. | 2 | * if_ppp.h - Point-to-Point Protocol definitions. |
5 | * | 3 | * |
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 8c71fe2fb1f5..4c6307ad9fdb 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
@@ -11,14 +11,13 @@ | |||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | ||
15 | * $Id: if_tun.h,v 1.2 2001/06/01 18:39:47 davem Exp $ | ||
16 | */ | 14 | */ |
17 | 15 | ||
18 | #ifndef __IF_TUN_H | 16 | #ifndef __IF_TUN_H |
19 | #define __IF_TUN_H | 17 | #define __IF_TUN_H |
20 | 18 | ||
21 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/if_ether.h> | ||
22 | 21 | ||
23 | /* Read queue size */ | 22 | /* Read queue size */ |
24 | #define TUN_READQ_SIZE 500 | 23 | #define TUN_READQ_SIZE 500 |
@@ -33,6 +32,7 @@ | |||
33 | #define TUN_NO_PI 0x0040 | 32 | #define TUN_NO_PI 0x0040 |
34 | #define TUN_ONE_QUEUE 0x0080 | 33 | #define TUN_ONE_QUEUE 0x0080 |
35 | #define TUN_PERSIST 0x0100 | 34 | #define TUN_PERSIST 0x0100 |
35 | #define TUN_VNET_HDR 0x0200 | ||
36 | 36 | ||
37 | /* Ioctl defines */ | 37 | /* Ioctl defines */ |
38 | #define TUNSETNOCSUM _IOW('T', 200, int) | 38 | #define TUNSETNOCSUM _IOW('T', 200, int) |
@@ -42,17 +42,43 @@ | |||
42 | #define TUNSETOWNER _IOW('T', 204, int) | 42 | #define TUNSETOWNER _IOW('T', 204, int) |
43 | #define TUNSETLINK _IOW('T', 205, int) | 43 | #define TUNSETLINK _IOW('T', 205, int) |
44 | #define TUNSETGROUP _IOW('T', 206, int) | 44 | #define TUNSETGROUP _IOW('T', 206, int) |
45 | #define TUNGETFEATURES _IOR('T', 207, unsigned int) | ||
46 | #define TUNSETOFFLOAD _IOW('T', 208, unsigned int) | ||
47 | #define TUNSETTXFILTER _IOW('T', 209, unsigned int) | ||
45 | 48 | ||
46 | /* TUNSETIFF ifr flags */ | 49 | /* TUNSETIFF ifr flags */ |
47 | #define IFF_TUN 0x0001 | 50 | #define IFF_TUN 0x0001 |
48 | #define IFF_TAP 0x0002 | 51 | #define IFF_TAP 0x0002 |
49 | #define IFF_NO_PI 0x1000 | 52 | #define IFF_NO_PI 0x1000 |
50 | #define IFF_ONE_QUEUE 0x2000 | 53 | #define IFF_ONE_QUEUE 0x2000 |
54 | #define IFF_VNET_HDR 0x4000 | ||
55 | |||
56 | /* Features for GSO (TUNSETOFFLOAD). */ | ||
57 | #define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ | ||
58 | #define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */ | ||
59 | #define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */ | ||
60 | #define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */ | ||
51 | 61 | ||
62 | /* Protocol info prepended to the packets (when IFF_NO_PI is not set) */ | ||
63 | #define TUN_PKT_STRIP 0x0001 | ||
52 | struct tun_pi { | 64 | struct tun_pi { |
53 | unsigned short flags; | 65 | __u16 flags; |
54 | __be16 proto; | 66 | __be16 proto; |
55 | }; | 67 | }; |
56 | #define TUN_PKT_STRIP 0x0001 | 68 | |
69 | /* | ||
70 | * Filter spec (used for SETXXFILTER ioctls) | ||
71 | * This stuff is applicable only to the TAP (Ethernet) devices. | ||
72 | * If the count is zero the filter is disabled and the driver accepts | ||
73 | * all packets (promisc mode). | ||
74 | * If the filter is enabled in order to accept broadcast packets | ||
75 | * broadcast addr must be explicitly included in the addr list. | ||
76 | */ | ||
77 | #define TUN_FLT_ALLMULTI 0x0001 /* Accept all multicast packets */ | ||
78 | struct tun_filter { | ||
79 | __u16 flags; /* TUN_FLT_ flags see above */ | ||
80 | __u16 count; /* Number of addresses */ | ||
81 | __u8 addr[0][ETH_ALEN]; | ||
82 | }; | ||
57 | 83 | ||
58 | #endif /* __IF_TUN_H */ | 84 | #endif /* __IF_TUN_H */ |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 15ace02b7b24..9e7b49b8062d 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -14,10 +14,6 @@ | |||
14 | #define _LINUX_IF_VLAN_H_ | 14 | #define _LINUX_IF_VLAN_H_ |
15 | 15 | ||
16 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
17 | |||
18 | /* externally defined structs */ | ||
19 | struct hlist_node; | ||
20 | |||
21 | #include <linux/netdevice.h> | 17 | #include <linux/netdevice.h> |
22 | #include <linux/etherdevice.h> | 18 | #include <linux/etherdevice.h> |
23 | 19 | ||
@@ -91,7 +87,7 @@ struct vlan_group { | |||
91 | }; | 87 | }; |
92 | 88 | ||
93 | static inline struct net_device *vlan_group_get_device(struct vlan_group *vg, | 89 | static inline struct net_device *vlan_group_get_device(struct vlan_group *vg, |
94 | unsigned int vlan_id) | 90 | u16 vlan_id) |
95 | { | 91 | { |
96 | struct net_device **array; | 92 | struct net_device **array; |
97 | array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; | 93 | array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; |
@@ -99,7 +95,7 @@ static inline struct net_device *vlan_group_get_device(struct vlan_group *vg, | |||
99 | } | 95 | } |
100 | 96 | ||
101 | static inline void vlan_group_set_device(struct vlan_group *vg, | 97 | static inline void vlan_group_set_device(struct vlan_group *vg, |
102 | unsigned int vlan_id, | 98 | u16 vlan_id, |
103 | struct net_device *dev) | 99 | struct net_device *dev) |
104 | { | 100 | { |
105 | struct net_device **array; | 101 | struct net_device **array; |
@@ -109,164 +105,81 @@ static inline void vlan_group_set_device(struct vlan_group *vg, | |||
109 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; | 105 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; |
110 | } | 106 | } |
111 | 107 | ||
112 | struct vlan_priority_tci_mapping { | 108 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci) |
113 | u32 priority; | 109 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci) |
114 | unsigned short vlan_qos; /* This should be shifted when first set, so we only do it | ||
115 | * at provisioning time. | ||
116 | * ((skb->priority << 13) & 0xE000) | ||
117 | */ | ||
118 | struct vlan_priority_tci_mapping *next; | ||
119 | }; | ||
120 | 110 | ||
121 | /* Holds information that makes sense if this device is a VLAN device. */ | 111 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
122 | struct vlan_dev_info { | 112 | extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); |
123 | /** This will be the mapping that correlates skb->priority to | 113 | extern u16 vlan_dev_vlan_id(const struct net_device *dev); |
124 | * 3 bits of VLAN QOS tags... | ||
125 | */ | ||
126 | unsigned int nr_ingress_mappings; | ||
127 | u32 ingress_priority_map[8]; | ||
128 | |||
129 | unsigned int nr_egress_mappings; | ||
130 | struct vlan_priority_tci_mapping *egress_priority_map[16]; /* hash table */ | ||
131 | |||
132 | unsigned short vlan_id; /* The VLAN Identifier for this interface. */ | ||
133 | unsigned short flags; /* (1 << 0) re_order_header This option will cause the | ||
134 | * VLAN code to move around the ethernet header on | ||
135 | * ingress to make the skb look **exactly** like it | ||
136 | * came in from an ethernet port. This destroys some of | ||
137 | * the VLAN information in the skb, but it fixes programs | ||
138 | * like DHCP that use packet-filtering and don't understand | ||
139 | * 802.1Q | ||
140 | */ | ||
141 | struct net_device *real_dev; /* the underlying device/interface */ | ||
142 | unsigned char real_dev_addr[ETH_ALEN]; | ||
143 | struct proc_dir_entry *dent; /* Holds the proc data */ | ||
144 | unsigned long cnt_inc_headroom_on_tx; /* How many times did we have to grow the skb on TX. */ | ||
145 | unsigned long cnt_encap_on_xmit; /* How many times did we have to encapsulate the skb on TX. */ | ||
146 | }; | ||
147 | 114 | ||
148 | static inline struct vlan_dev_info *vlan_dev_info(const struct net_device *dev) | 115 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, |
116 | u16 vlan_tci, int polling); | ||
117 | #else | ||
118 | static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) | ||
149 | { | 119 | { |
150 | return netdev_priv(dev); | 120 | BUG(); |
121 | return NULL; | ||
151 | } | 122 | } |
152 | 123 | ||
153 | /* inline functions */ | 124 | static inline u16 vlan_dev_vlan_id(const struct net_device *dev) |
154 | static inline __u32 vlan_get_ingress_priority(struct net_device *dev, | ||
155 | unsigned short vlan_tag) | ||
156 | { | 125 | { |
157 | struct vlan_dev_info *vip = vlan_dev_info(dev); | 126 | BUG(); |
158 | 127 | return 0; | |
159 | return vip->ingress_priority_map[(vlan_tag >> 13) & 0x7]; | ||
160 | } | 128 | } |
161 | 129 | ||
162 | /* VLAN tx hw acceleration helpers. */ | 130 | static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, |
163 | struct vlan_skb_tx_cookie { | 131 | u16 vlan_tci, int polling) |
164 | u32 magic; | ||
165 | u32 vlan_tag; | ||
166 | }; | ||
167 | |||
168 | #define VLAN_TX_COOKIE_MAGIC 0x564c414e /* "VLAN" in ascii. */ | ||
169 | #define VLAN_TX_SKB_CB(__skb) ((struct vlan_skb_tx_cookie *)&((__skb)->cb[0])) | ||
170 | #define vlan_tx_tag_present(__skb) \ | ||
171 | (VLAN_TX_SKB_CB(__skb)->magic == VLAN_TX_COOKIE_MAGIC) | ||
172 | #define vlan_tx_tag_get(__skb) (VLAN_TX_SKB_CB(__skb)->vlan_tag) | ||
173 | |||
174 | /* VLAN rx hw acceleration helper. This acts like netif_{rx,receive_skb}(). */ | ||
175 | static inline int __vlan_hwaccel_rx(struct sk_buff *skb, | ||
176 | struct vlan_group *grp, | ||
177 | unsigned short vlan_tag, int polling) | ||
178 | { | 132 | { |
179 | struct net_device_stats *stats; | 133 | BUG(); |
180 | 134 | return NET_XMIT_SUCCESS; | |
181 | if (skb_bond_should_drop(skb)) { | ||
182 | dev_kfree_skb_any(skb); | ||
183 | return NET_RX_DROP; | ||
184 | } | ||
185 | |||
186 | skb->dev = vlan_group_get_device(grp, vlan_tag & VLAN_VID_MASK); | ||
187 | if (skb->dev == NULL) { | ||
188 | dev_kfree_skb_any(skb); | ||
189 | |||
190 | /* Not NET_RX_DROP, this is not being dropped | ||
191 | * due to congestion. | ||
192 | */ | ||
193 | return 0; | ||
194 | } | ||
195 | |||
196 | skb->dev->last_rx = jiffies; | ||
197 | |||
198 | stats = &skb->dev->stats; | ||
199 | stats->rx_packets++; | ||
200 | stats->rx_bytes += skb->len; | ||
201 | |||
202 | skb->priority = vlan_get_ingress_priority(skb->dev, vlan_tag); | ||
203 | switch (skb->pkt_type) { | ||
204 | case PACKET_BROADCAST: | ||
205 | break; | ||
206 | |||
207 | case PACKET_MULTICAST: | ||
208 | stats->multicast++; | ||
209 | break; | ||
210 | |||
211 | case PACKET_OTHERHOST: | ||
212 | /* Our lower layer thinks this is not local, let's make sure. | ||
213 | * This allows the VLAN to have a different MAC than the underlying | ||
214 | * device, and still route correctly. | ||
215 | */ | ||
216 | if (!compare_ether_addr(eth_hdr(skb)->h_dest, | ||
217 | skb->dev->dev_addr)) | ||
218 | skb->pkt_type = PACKET_HOST; | ||
219 | break; | ||
220 | }; | ||
221 | |||
222 | return (polling ? netif_receive_skb(skb) : netif_rx(skb)); | ||
223 | } | 135 | } |
136 | #endif | ||
224 | 137 | ||
138 | /** | ||
139 | * vlan_hwaccel_rx - netif_rx wrapper for VLAN RX acceleration | ||
140 | * @skb: buffer | ||
141 | * @grp: vlan group | ||
142 | * @vlan_tci: VLAN TCI as received from the card | ||
143 | */ | ||
225 | static inline int vlan_hwaccel_rx(struct sk_buff *skb, | 144 | static inline int vlan_hwaccel_rx(struct sk_buff *skb, |
226 | struct vlan_group *grp, | 145 | struct vlan_group *grp, |
227 | unsigned short vlan_tag) | 146 | u16 vlan_tci) |
228 | { | 147 | { |
229 | return __vlan_hwaccel_rx(skb, grp, vlan_tag, 0); | 148 | return __vlan_hwaccel_rx(skb, grp, vlan_tci, 0); |
230 | } | 149 | } |
231 | 150 | ||
151 | /** | ||
152 | * vlan_hwaccel_receive_skb - netif_receive_skb wrapper for VLAN RX acceleration | ||
153 | * @skb: buffer | ||
154 | * @grp: vlan group | ||
155 | * @vlan_tci: VLAN TCI as received from the card | ||
156 | */ | ||
232 | static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb, | 157 | static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb, |
233 | struct vlan_group *grp, | 158 | struct vlan_group *grp, |
234 | unsigned short vlan_tag) | 159 | u16 vlan_tci) |
235 | { | 160 | { |
236 | return __vlan_hwaccel_rx(skb, grp, vlan_tag, 1); | 161 | return __vlan_hwaccel_rx(skb, grp, vlan_tci, 1); |
237 | } | 162 | } |
238 | 163 | ||
239 | /** | 164 | /** |
240 | * __vlan_put_tag - regular VLAN tag inserting | 165 | * __vlan_put_tag - regular VLAN tag inserting |
241 | * @skb: skbuff to tag | 166 | * @skb: skbuff to tag |
242 | * @tag: VLAN tag to insert | 167 | * @vlan_tci: VLAN TCI to insert |
243 | * | 168 | * |
244 | * Inserts the VLAN tag into @skb as part of the payload | 169 | * Inserts the VLAN tag into @skb as part of the payload |
245 | * Returns a VLAN tagged skb. If a new skb is created, @skb is freed. | 170 | * Returns a VLAN tagged skb. If a new skb is created, @skb is freed. |
246 | * | 171 | * |
247 | * Following the skb_unshare() example, in case of error, the calling function | 172 | * Following the skb_unshare() example, in case of error, the calling function |
248 | * doesn't have to worry about freeing the original skb. | 173 | * doesn't have to worry about freeing the original skb. |
249 | */ | 174 | */ |
250 | static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short tag) | 175 | static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) |
251 | { | 176 | { |
252 | struct vlan_ethhdr *veth; | 177 | struct vlan_ethhdr *veth; |
253 | 178 | ||
254 | if (skb_headroom(skb) < VLAN_HLEN) { | 179 | if (skb_cow_head(skb, VLAN_HLEN) < 0) { |
255 | struct sk_buff *sk_tmp = skb; | 180 | kfree_skb(skb); |
256 | skb = skb_realloc_headroom(sk_tmp, VLAN_HLEN); | 181 | return NULL; |
257 | kfree_skb(sk_tmp); | ||
258 | if (!skb) { | ||
259 | printk(KERN_ERR "vlan: failed to realloc headroom\n"); | ||
260 | return NULL; | ||
261 | } | ||
262 | } else { | ||
263 | skb = skb_unshare(skb, GFP_ATOMIC); | ||
264 | if (!skb) { | ||
265 | printk(KERN_ERR "vlan: failed to unshare skbuff\n"); | ||
266 | return NULL; | ||
267 | } | ||
268 | } | 182 | } |
269 | |||
270 | veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); | 183 | veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); |
271 | 184 | ||
272 | /* Move the mac addresses to the beginning of the new header. */ | 185 | /* Move the mac addresses to the beginning of the new header. */ |
@@ -275,12 +188,10 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short | |||
275 | /* first, the ethernet type */ | 188 | /* first, the ethernet type */ |
276 | veth->h_vlan_proto = htons(ETH_P_8021Q); | 189 | veth->h_vlan_proto = htons(ETH_P_8021Q); |
277 | 190 | ||
278 | /* now, the tag */ | 191 | /* now, the TCI */ |
279 | veth->h_vlan_TCI = htons(tag); | 192 | veth->h_vlan_TCI = htons(vlan_tci); |
280 | 193 | ||
281 | skb->protocol = htons(ETH_P_8021Q); | 194 | skb->protocol = htons(ETH_P_8021Q); |
282 | skb->mac_header -= VLAN_HLEN; | ||
283 | skb->network_header -= VLAN_HLEN; | ||
284 | 195 | ||
285 | return skb; | 196 | return skb; |
286 | } | 197 | } |
@@ -288,18 +199,14 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short | |||
288 | /** | 199 | /** |
289 | * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting | 200 | * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting |
290 | * @skb: skbuff to tag | 201 | * @skb: skbuff to tag |
291 | * @tag: VLAN tag to insert | 202 | * @vlan_tci: VLAN TCI to insert |
292 | * | 203 | * |
293 | * Puts the VLAN tag in @skb->cb[] and lets the device do the rest | 204 | * Puts the VLAN TCI in @skb->vlan_tci and lets the device do the rest |
294 | */ | 205 | */ |
295 | static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, unsigned short tag) | 206 | static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, |
207 | u16 vlan_tci) | ||
296 | { | 208 | { |
297 | struct vlan_skb_tx_cookie *cookie; | 209 | skb->vlan_tci = vlan_tci; |
298 | |||
299 | cookie = VLAN_TX_SKB_CB(skb); | ||
300 | cookie->magic = VLAN_TX_COOKIE_MAGIC; | ||
301 | cookie->vlan_tag = tag; | ||
302 | |||
303 | return skb; | 210 | return skb; |
304 | } | 211 | } |
305 | 212 | ||
@@ -308,28 +215,28 @@ static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, unsign | |||
308 | /** | 215 | /** |
309 | * vlan_put_tag - inserts VLAN tag according to device features | 216 | * vlan_put_tag - inserts VLAN tag according to device features |
310 | * @skb: skbuff to tag | 217 | * @skb: skbuff to tag |
311 | * @tag: VLAN tag to insert | 218 | * @vlan_tci: VLAN TCI to insert |
312 | * | 219 | * |
313 | * Assumes skb->dev is the target that will xmit this frame. | 220 | * Assumes skb->dev is the target that will xmit this frame. |
314 | * Returns a VLAN tagged skb. | 221 | * Returns a VLAN tagged skb. |
315 | */ | 222 | */ |
316 | static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short tag) | 223 | static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) |
317 | { | 224 | { |
318 | if (skb->dev->features & NETIF_F_HW_VLAN_TX) { | 225 | if (skb->dev->features & NETIF_F_HW_VLAN_TX) { |
319 | return __vlan_hwaccel_put_tag(skb, tag); | 226 | return __vlan_hwaccel_put_tag(skb, vlan_tci); |
320 | } else { | 227 | } else { |
321 | return __vlan_put_tag(skb, tag); | 228 | return __vlan_put_tag(skb, vlan_tci); |
322 | } | 229 | } |
323 | } | 230 | } |
324 | 231 | ||
325 | /** | 232 | /** |
326 | * __vlan_get_tag - get the VLAN ID that is part of the payload | 233 | * __vlan_get_tag - get the VLAN ID that is part of the payload |
327 | * @skb: skbuff to query | 234 | * @skb: skbuff to query |
328 | * @tag: buffer to store vlaue | 235 | * @vlan_tci: buffer to store vlaue |
329 | * | 236 | * |
330 | * Returns error if the skb is not of VLAN type | 237 | * Returns error if the skb is not of VLAN type |
331 | */ | 238 | */ |
332 | static inline int __vlan_get_tag(const struct sk_buff *skb, unsigned short *tag) | 239 | static inline int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) |
333 | { | 240 | { |
334 | struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; | 241 | struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; |
335 | 242 | ||
@@ -337,29 +244,25 @@ static inline int __vlan_get_tag(const struct sk_buff *skb, unsigned short *tag) | |||
337 | return -EINVAL; | 244 | return -EINVAL; |
338 | } | 245 | } |
339 | 246 | ||
340 | *tag = ntohs(veth->h_vlan_TCI); | 247 | *vlan_tci = ntohs(veth->h_vlan_TCI); |
341 | |||
342 | return 0; | 248 | return 0; |
343 | } | 249 | } |
344 | 250 | ||
345 | /** | 251 | /** |
346 | * __vlan_hwaccel_get_tag - get the VLAN ID that is in @skb->cb[] | 252 | * __vlan_hwaccel_get_tag - get the VLAN ID that is in @skb->cb[] |
347 | * @skb: skbuff to query | 253 | * @skb: skbuff to query |
348 | * @tag: buffer to store vlaue | 254 | * @vlan_tci: buffer to store vlaue |
349 | * | 255 | * |
350 | * Returns error if @skb->cb[] is not set correctly | 256 | * Returns error if @skb->vlan_tci is not set correctly |
351 | */ | 257 | */ |
352 | static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, | 258 | static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, |
353 | unsigned short *tag) | 259 | u16 *vlan_tci) |
354 | { | 260 | { |
355 | struct vlan_skb_tx_cookie *cookie; | 261 | if (vlan_tx_tag_present(skb)) { |
356 | 262 | *vlan_tci = skb->vlan_tci; | |
357 | cookie = VLAN_TX_SKB_CB(skb); | ||
358 | if (cookie->magic == VLAN_TX_COOKIE_MAGIC) { | ||
359 | *tag = cookie->vlan_tag; | ||
360 | return 0; | 263 | return 0; |
361 | } else { | 264 | } else { |
362 | *tag = 0; | 265 | *vlan_tci = 0; |
363 | return -EINVAL; | 266 | return -EINVAL; |
364 | } | 267 | } |
365 | } | 268 | } |
@@ -369,16 +272,16 @@ static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, | |||
369 | /** | 272 | /** |
370 | * vlan_get_tag - get the VLAN ID from the skb | 273 | * vlan_get_tag - get the VLAN ID from the skb |
371 | * @skb: skbuff to query | 274 | * @skb: skbuff to query |
372 | * @tag: buffer to store vlaue | 275 | * @vlan_tci: buffer to store vlaue |
373 | * | 276 | * |
374 | * Returns error if the skb is not VLAN tagged | 277 | * Returns error if the skb is not VLAN tagged |
375 | */ | 278 | */ |
376 | static inline int vlan_get_tag(const struct sk_buff *skb, unsigned short *tag) | 279 | static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) |
377 | { | 280 | { |
378 | if (skb->dev->features & NETIF_F_HW_VLAN_TX) { | 281 | if (skb->dev->features & NETIF_F_HW_VLAN_TX) { |
379 | return __vlan_hwaccel_get_tag(skb, tag); | 282 | return __vlan_hwaccel_get_tag(skb, vlan_tci); |
380 | } else { | 283 | } else { |
381 | return __vlan_get_tag(skb, tag); | 284 | return __vlan_get_tag(skb, vlan_tci); |
382 | } | 285 | } |
383 | } | 286 | } |
384 | 287 | ||
@@ -402,6 +305,7 @@ enum vlan_ioctl_cmds { | |||
402 | 305 | ||
403 | enum vlan_flags { | 306 | enum vlan_flags { |
404 | VLAN_FLAG_REORDER_HDR = 0x1, | 307 | VLAN_FLAG_REORDER_HDR = 0x1, |
308 | VLAN_FLAG_GVRP = 0x2, | ||
405 | }; | 309 | }; |
406 | 310 | ||
407 | enum vlan_name_types { | 311 | enum vlan_name_types { |
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index f5a1a0db2e8e..7bb3c095c15b 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
@@ -228,7 +228,6 @@ extern int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf, | |||
228 | extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, | 228 | extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, |
229 | struct group_filter __user *optval, int __user *optlen); | 229 | struct group_filter __user *optval, int __user *optlen); |
230 | extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt, int dif); | 230 | extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt, int dif); |
231 | extern void ip_mr_init(void); | ||
232 | extern void ip_mc_init_dev(struct in_device *); | 231 | extern void ip_mc_init_dev(struct in_device *); |
233 | extern void ip_mc_destroy_dev(struct in_device *); | 232 | extern void ip_mc_destroy_dev(struct in_device *); |
234 | extern void ip_mc_up(struct in_device *); | 233 | extern void ip_mc_up(struct in_device *); |
diff --git a/include/linux/inotify.h b/include/linux/inotify.h index 742b917e7d1b..bd578578a8b9 100644 --- a/include/linux/inotify.h +++ b/include/linux/inotify.h | |||
@@ -7,6 +7,8 @@ | |||
7 | #ifndef _LINUX_INOTIFY_H | 7 | #ifndef _LINUX_INOTIFY_H |
8 | #define _LINUX_INOTIFY_H | 8 | #define _LINUX_INOTIFY_H |
9 | 9 | ||
10 | /* For O_CLOEXEC and O_NONBLOCK */ | ||
11 | #include <linux/fcntl.h> | ||
10 | #include <linux/types.h> | 12 | #include <linux/types.h> |
11 | 13 | ||
12 | /* | 14 | /* |
@@ -63,6 +65,10 @@ struct inotify_event { | |||
63 | IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \ | 65 | IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \ |
64 | IN_MOVE_SELF) | 66 | IN_MOVE_SELF) |
65 | 67 | ||
68 | /* Flags for sys_inotify_init1. */ | ||
69 | #define IN_CLOEXEC O_CLOEXEC | ||
70 | #define IN_NONBLOCK O_NONBLOCK | ||
71 | |||
66 | #ifdef __KERNEL__ | 72 | #ifdef __KERNEL__ |
67 | 73 | ||
68 | #include <linux/dcache.h> | 74 | #include <linux/dcache.h> |
diff --git a/include/linux/input.h b/include/linux/input.h index d150c57e5f0a..a5802c9c81a4 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -373,6 +373,8 @@ struct input_absinfo { | |||
373 | 373 | ||
374 | #define KEY_WIMAX 246 | 374 | #define KEY_WIMAX 246 |
375 | 375 | ||
376 | /* Range 248 - 255 is reserved for special needs of AT keyboard driver */ | ||
377 | |||
376 | #define BTN_MISC 0x100 | 378 | #define BTN_MISC 0x100 |
377 | #define BTN_0 0x100 | 379 | #define BTN_0 0x100 |
378 | #define BTN_1 0x101 | 380 | #define BTN_1 0x101 |
@@ -640,6 +642,8 @@ struct input_absinfo { | |||
640 | #define SW_RFKILL_ALL 0x03 /* rfkill master switch, type "any" | 642 | #define SW_RFKILL_ALL 0x03 /* rfkill master switch, type "any" |
641 | set = radio enabled */ | 643 | set = radio enabled */ |
642 | #define SW_RADIO SW_RFKILL_ALL /* deprecated */ | 644 | #define SW_RADIO SW_RFKILL_ALL /* deprecated */ |
645 | #define SW_MICROPHONE_INSERT 0x04 /* set = inserted */ | ||
646 | #define SW_DOCK 0x05 /* set = plugged into dock */ | ||
643 | #define SW_MAX 0x0f | 647 | #define SW_MAX 0x0f |
644 | #define SW_CNT (SW_MAX+1) | 648 | #define SW_CNT (SW_MAX+1) |
645 | 649 | ||
@@ -1215,11 +1219,6 @@ struct input_handle { | |||
1215 | struct list_head h_node; | 1219 | struct list_head h_node; |
1216 | }; | 1220 | }; |
1217 | 1221 | ||
1218 | #define to_dev(n) container_of(n, struct input_dev, node) | ||
1219 | #define to_handler(n) container_of(n, struct input_handler, node) | ||
1220 | #define to_handle(n) container_of(n, struct input_handle, d_node) | ||
1221 | #define to_handle_h(n) container_of(n, struct input_handle, h_node) | ||
1222 | |||
1223 | struct input_dev *input_allocate_device(void); | 1222 | struct input_dev *input_allocate_device(void); |
1224 | void input_free_device(struct input_dev *dev); | 1223 | void input_free_device(struct input_dev *dev); |
1225 | 1224 | ||
diff --git a/include/linux/ip6_tunnel.h b/include/linux/ip6_tunnel.h index af3f4a70f3df..1e7cc4af40de 100644 --- a/include/linux/ip6_tunnel.h +++ b/include/linux/ip6_tunnel.h | |||
@@ -1,7 +1,3 @@ | |||
1 | /* | ||
2 | * $Id$ | ||
3 | */ | ||
4 | |||
5 | #ifndef _IP6_TUNNEL_H | 1 | #ifndef _IP6_TUNNEL_H |
6 | #define _IP6_TUNNEL_H | 2 | #define _IP6_TUNNEL_H |
7 | 3 | ||
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index cde056e08181..641e026eee8f 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -123,6 +123,7 @@ struct ipv6hdr { | |||
123 | struct in6_addr daddr; | 123 | struct in6_addr daddr; |
124 | }; | 124 | }; |
125 | 125 | ||
126 | #ifdef __KERNEL__ | ||
126 | /* | 127 | /* |
127 | * This structure contains configuration options per IPv6 link. | 128 | * This structure contains configuration options per IPv6 link. |
128 | */ | 129 | */ |
@@ -163,8 +164,11 @@ struct ipv6_devconf { | |||
163 | #ifdef CONFIG_IPV6_MROUTE | 164 | #ifdef CONFIG_IPV6_MROUTE |
164 | __s32 mc_forwarding; | 165 | __s32 mc_forwarding; |
165 | #endif | 166 | #endif |
167 | __s32 disable_ipv6; | ||
168 | __s32 accept_dad; | ||
166 | void *sysctl; | 169 | void *sysctl; |
167 | }; | 170 | }; |
171 | #endif | ||
168 | 172 | ||
169 | /* index values for the variables in ipv6_devconf */ | 173 | /* index values for the variables in ipv6_devconf */ |
170 | enum { | 174 | enum { |
@@ -194,6 +198,8 @@ enum { | |||
194 | DEVCONF_OPTIMISTIC_DAD, | 198 | DEVCONF_OPTIMISTIC_DAD, |
195 | DEVCONF_ACCEPT_SOURCE_ROUTE, | 199 | DEVCONF_ACCEPT_SOURCE_ROUTE, |
196 | DEVCONF_MC_FORWARDING, | 200 | DEVCONF_MC_FORWARDING, |
201 | DEVCONF_DISABLE_IPV6, | ||
202 | DEVCONF_ACCEPT_DAD, | ||
197 | DEVCONF_MAX | 203 | DEVCONF_MAX |
198 | }; | 204 | }; |
199 | 205 | ||
diff --git a/include/linux/istallion.h b/include/linux/istallion.h index 5a84fe944b74..0d1840723249 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h | |||
@@ -51,25 +51,21 @@ | |||
51 | */ | 51 | */ |
52 | struct stliport { | 52 | struct stliport { |
53 | unsigned long magic; | 53 | unsigned long magic; |
54 | struct tty_port port; | ||
54 | unsigned int portnr; | 55 | unsigned int portnr; |
55 | unsigned int panelnr; | 56 | unsigned int panelnr; |
56 | unsigned int brdnr; | 57 | unsigned int brdnr; |
57 | unsigned long state; | 58 | unsigned long state; |
58 | unsigned int devnr; | 59 | unsigned int devnr; |
59 | int flags; | ||
60 | int baud_base; | 60 | int baud_base; |
61 | int custom_divisor; | 61 | int custom_divisor; |
62 | int close_delay; | 62 | int close_delay; |
63 | int closing_wait; | 63 | int closing_wait; |
64 | int refcount; | ||
65 | int openwaitcnt; | 64 | int openwaitcnt; |
66 | int rc; | 65 | int rc; |
67 | int argsize; | 66 | int argsize; |
68 | void *argp; | 67 | void *argp; |
69 | unsigned int rxmarkmsk; | 68 | unsigned int rxmarkmsk; |
70 | struct tty_struct *tty; | ||
71 | wait_queue_head_t open_wait; | ||
72 | wait_queue_head_t close_wait; | ||
73 | wait_queue_head_t raw_wait; | 69 | wait_queue_head_t raw_wait; |
74 | struct asysigs asig; | 70 | struct asysigs asig; |
75 | unsigned long addr; | 71 | unsigned long addr; |
diff --git a/include/linux/joystick.h b/include/linux/joystick.h index e2d3a18af456..b5e051295a67 100644 --- a/include/linux/joystick.h +++ b/include/linux/joystick.h | |||
@@ -2,8 +2,6 @@ | |||
2 | #define _LINUX_JOYSTICK_H | 2 | #define _LINUX_JOYSTICK_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * $Id: joystick.h,v 1.3 2000/11/30 11:07:05 vojtech Exp $ | ||
6 | * | ||
7 | * Copyright (C) 1996-2000 Vojtech Pavlik | 5 | * Copyright (C) 1996-2000 Vojtech Pavlik |
8 | * | 6 | * |
9 | * Sponsored by SuSE | 7 | * Sponsored by SuSE |
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 5dc13848891b..0509c4ce4857 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -25,15 +25,16 @@ | |||
25 | 25 | ||
26 | #define KMOD_PATH_LEN 256 | 26 | #define KMOD_PATH_LEN 256 |
27 | 27 | ||
28 | #ifdef CONFIG_KMOD | 28 | #ifdef CONFIG_MODULES |
29 | /* modprobe exit status on success, -ve on error. Return value | 29 | /* modprobe exit status on success, -ve on error. Return value |
30 | * usually useless though. */ | 30 | * usually useless though. */ |
31 | extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2))); | 31 | extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2))); |
32 | #define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x))) | ||
32 | #else | 33 | #else |
33 | static inline int request_module(const char * name, ...) { return -ENOSYS; } | 34 | static inline int request_module(const char * name, ...) { return -ENOSYS; } |
35 | #define try_then_request_module(x, mod...) (x) | ||
34 | #endif | 36 | #endif |
35 | 37 | ||
36 | #define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x))) | ||
37 | 38 | ||
38 | struct key; | 39 | struct key; |
39 | struct file; | 40 | struct file; |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 39e709f88aa0..5437ac0276e2 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/wait.h> | 26 | #include <linux/wait.h> |
27 | #include <asm/atomic.h> | 27 | #include <asm/atomic.h> |
28 | 28 | ||
29 | #define KOBJ_NAME_LEN 20 | ||
30 | #define UEVENT_HELPER_PATH_LEN 256 | 29 | #define UEVENT_HELPER_PATH_LEN 256 |
31 | #define UEVENT_NUM_ENVP 32 /* number of env pointers */ | 30 | #define UEVENT_NUM_ENVP 32 /* number of env pointers */ |
32 | #define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */ | 31 | #define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */ |
@@ -59,12 +58,12 @@ enum kobject_action { | |||
59 | 58 | ||
60 | struct kobject { | 59 | struct kobject { |
61 | const char *name; | 60 | const char *name; |
62 | struct kref kref; | ||
63 | struct list_head entry; | 61 | struct list_head entry; |
64 | struct kobject *parent; | 62 | struct kobject *parent; |
65 | struct kset *kset; | 63 | struct kset *kset; |
66 | struct kobj_type *ktype; | 64 | struct kobj_type *ktype; |
67 | struct sysfs_dirent *sd; | 65 | struct sysfs_dirent *sd; |
66 | struct kref kref; | ||
68 | unsigned int state_initialized:1; | 67 | unsigned int state_initialized:1; |
69 | unsigned int state_in_sysfs:1; | 68 | unsigned int state_in_sysfs:1; |
70 | unsigned int state_add_uevent_sent:1; | 69 | unsigned int state_add_uevent_sent:1; |
@@ -187,6 +186,8 @@ extern struct kobject *kset_find_obj(struct kset *, const char *); | |||
187 | 186 | ||
188 | /* The global /sys/kernel/ kobject for people to chain off of */ | 187 | /* The global /sys/kernel/ kobject for people to chain off of */ |
189 | extern struct kobject *kernel_kobj; | 188 | extern struct kobject *kernel_kobj; |
189 | /* The global /sys/kernel/mm/ kobject for people to chain off of */ | ||
190 | extern struct kobject *mm_kobj; | ||
190 | /* The global /sys/hypervisor/ kobject for people to chain off of */ | 191 | /* The global /sys/hypervisor/ kobject for people to chain off of */ |
191 | extern struct kobject *hypervisor_kobj; | 192 | extern struct kobject *hypervisor_kobj; |
192 | /* The global /sys/power/ kobject for people to chain off of */ | 193 | /* The global /sys/power/ kobject for people to chain off of */ |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index a281afeddfbb..0ea064cbfbc8 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -173,6 +173,30 @@ struct kvm_run { | |||
173 | }; | 173 | }; |
174 | }; | 174 | }; |
175 | 175 | ||
176 | /* for KVM_REGISTER_COALESCED_MMIO / KVM_UNREGISTER_COALESCED_MMIO */ | ||
177 | |||
178 | struct kvm_coalesced_mmio_zone { | ||
179 | __u64 addr; | ||
180 | __u32 size; | ||
181 | __u32 pad; | ||
182 | }; | ||
183 | |||
184 | struct kvm_coalesced_mmio { | ||
185 | __u64 phys_addr; | ||
186 | __u32 len; | ||
187 | __u32 pad; | ||
188 | __u8 data[8]; | ||
189 | }; | ||
190 | |||
191 | struct kvm_coalesced_mmio_ring { | ||
192 | __u32 first, last; | ||
193 | struct kvm_coalesced_mmio coalesced_mmio[0]; | ||
194 | }; | ||
195 | |||
196 | #define KVM_COALESCED_MMIO_MAX \ | ||
197 | ((PAGE_SIZE - sizeof(struct kvm_coalesced_mmio_ring)) / \ | ||
198 | sizeof(struct kvm_coalesced_mmio)) | ||
199 | |||
176 | /* for KVM_TRANSLATE */ | 200 | /* for KVM_TRANSLATE */ |
177 | struct kvm_translation { | 201 | struct kvm_translation { |
178 | /* in */ | 202 | /* in */ |
@@ -294,14 +318,14 @@ struct kvm_trace_rec { | |||
294 | __u32 vcpu_id; | 318 | __u32 vcpu_id; |
295 | union { | 319 | union { |
296 | struct { | 320 | struct { |
297 | __u32 cycle_lo, cycle_hi; | 321 | __u64 cycle_u64; |
298 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | 322 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; |
299 | } cycle; | 323 | } cycle; |
300 | struct { | 324 | struct { |
301 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | 325 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; |
302 | } nocycle; | 326 | } nocycle; |
303 | } u; | 327 | } u; |
304 | }; | 328 | } __attribute__((packed)); |
305 | 329 | ||
306 | #define KVMIO 0xAE | 330 | #define KVMIO 0xAE |
307 | 331 | ||
@@ -346,6 +370,7 @@ struct kvm_trace_rec { | |||
346 | #define KVM_CAP_NOP_IO_DELAY 12 | 370 | #define KVM_CAP_NOP_IO_DELAY 12 |
347 | #define KVM_CAP_PV_MMU 13 | 371 | #define KVM_CAP_PV_MMU 13 |
348 | #define KVM_CAP_MP_STATE 14 | 372 | #define KVM_CAP_MP_STATE 14 |
373 | #define KVM_CAP_COALESCED_MMIO 15 | ||
349 | 374 | ||
350 | /* | 375 | /* |
351 | * ioctls for VM fds | 376 | * ioctls for VM fds |
@@ -371,6 +396,10 @@ struct kvm_trace_rec { | |||
371 | #define KVM_CREATE_PIT _IO(KVMIO, 0x64) | 396 | #define KVM_CREATE_PIT _IO(KVMIO, 0x64) |
372 | #define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state) | 397 | #define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state) |
373 | #define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state) | 398 | #define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state) |
399 | #define KVM_REGISTER_COALESCED_MMIO \ | ||
400 | _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) | ||
401 | #define KVM_UNREGISTER_COALESCED_MMIO \ | ||
402 | _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) | ||
374 | 403 | ||
375 | /* | 404 | /* |
376 | * ioctls for vcpu fds | 405 | * ioctls for vcpu fds |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index de9d1df4bba2..07d68a8ae8e9 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -52,7 +52,8 @@ struct kvm_io_bus { | |||
52 | 52 | ||
53 | void kvm_io_bus_init(struct kvm_io_bus *bus); | 53 | void kvm_io_bus_init(struct kvm_io_bus *bus); |
54 | void kvm_io_bus_destroy(struct kvm_io_bus *bus); | 54 | void kvm_io_bus_destroy(struct kvm_io_bus *bus); |
55 | struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus, gpa_t addr); | 55 | struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus, |
56 | gpa_t addr, int len, int is_write); | ||
56 | void kvm_io_bus_register_dev(struct kvm_io_bus *bus, | 57 | void kvm_io_bus_register_dev(struct kvm_io_bus *bus, |
57 | struct kvm_io_device *dev); | 58 | struct kvm_io_device *dev); |
58 | 59 | ||
@@ -116,6 +117,10 @@ struct kvm { | |||
116 | struct kvm_vm_stat stat; | 117 | struct kvm_vm_stat stat; |
117 | struct kvm_arch arch; | 118 | struct kvm_arch arch; |
118 | atomic_t users_count; | 119 | atomic_t users_count; |
120 | #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET | ||
121 | struct kvm_coalesced_mmio_dev *coalesced_mmio_dev; | ||
122 | struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; | ||
123 | #endif | ||
119 | }; | 124 | }; |
120 | 125 | ||
121 | /* The guest did something we don't support. */ | 126 | /* The guest did something we don't support. */ |
@@ -135,9 +140,6 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); | |||
135 | void vcpu_load(struct kvm_vcpu *vcpu); | 140 | void vcpu_load(struct kvm_vcpu *vcpu); |
136 | void vcpu_put(struct kvm_vcpu *vcpu); | 141 | void vcpu_put(struct kvm_vcpu *vcpu); |
137 | 142 | ||
138 | void decache_vcpus_on_cpu(int cpu); | ||
139 | |||
140 | |||
141 | int kvm_init(void *opaque, unsigned int vcpu_size, | 143 | int kvm_init(void *opaque, unsigned int vcpu_size, |
142 | struct module *module); | 144 | struct module *module); |
143 | void kvm_exit(void); | 145 | void kvm_exit(void); |
@@ -166,6 +168,7 @@ int kvm_arch_set_memory_region(struct kvm *kvm, | |||
166 | struct kvm_userspace_memory_region *mem, | 168 | struct kvm_userspace_memory_region *mem, |
167 | struct kvm_memory_slot old, | 169 | struct kvm_memory_slot old, |
168 | int user_alloc); | 170 | int user_alloc); |
171 | void kvm_arch_flush_shadow(struct kvm *kvm); | ||
169 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); | 172 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); |
170 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); | 173 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); |
171 | unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); | 174 | unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); |
diff --git a/include/linux/lcd.h b/include/linux/lcd.h index 1d379787f2e7..173febac6656 100644 --- a/include/linux/lcd.h +++ b/include/linux/lcd.h | |||
@@ -47,7 +47,7 @@ struct lcd_ops { | |||
47 | int (*set_contrast)(struct lcd_device *, int contrast); | 47 | int (*set_contrast)(struct lcd_device *, int contrast); |
48 | /* Check if given framebuffer device is the one LCD is bound to; | 48 | /* Check if given framebuffer device is the one LCD is bound to; |
49 | return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ | 49 | return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ |
50 | int (*check_fb)(struct fb_info *); | 50 | int (*check_fb)(struct lcd_device *, struct fb_info *); |
51 | }; | 51 | }; |
52 | 52 | ||
53 | struct lcd_device { | 53 | struct lcd_device { |
diff --git a/include/linux/libps2.h b/include/linux/libps2.h index f6f301e2b0f5..afc413369101 100644 --- a/include/linux/libps2.h +++ b/include/linux/libps2.h | |||
@@ -43,7 +43,6 @@ void ps2_init(struct ps2dev *ps2dev, struct serio *serio); | |||
43 | int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout); | 43 | int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout); |
44 | void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout); | 44 | void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout); |
45 | int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); | 45 | int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); |
46 | int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int command); | ||
47 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); | 46 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); |
48 | int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data); | 47 | int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data); |
49 | void ps2_cmd_aborted(struct ps2dev *ps2dev); | 48 | void ps2_cmd_aborted(struct ps2dev *ps2dev); |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 102d928f7206..dbb87ab282e8 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -200,10 +200,12 @@ typedef int (*nlm_host_match_fn_t)(void *cur, struct nlm_host *ref); | |||
200 | * Server-side lock handling | 200 | * Server-side lock handling |
201 | */ | 201 | */ |
202 | __be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, | 202 | __be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, |
203 | struct nlm_lock *, int, struct nlm_cookie *); | 203 | struct nlm_host *, struct nlm_lock *, int, |
204 | struct nlm_cookie *); | ||
204 | __be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); | 205 | __be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); |
205 | __be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *, | 206 | __be32 nlmsvc_testlock(struct svc_rqst *, struct nlm_file *, |
206 | struct nlm_lock *, struct nlm_lock *, struct nlm_cookie *); | 207 | struct nlm_host *, struct nlm_lock *, |
208 | struct nlm_lock *, struct nlm_cookie *); | ||
207 | __be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); | 209 | __be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); |
208 | unsigned long nlmsvc_retry_blocked(void); | 210 | unsigned long nlmsvc_retry_blocked(void); |
209 | void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, | 211 | void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, |
@@ -224,7 +226,7 @@ void nlmsvc_invalidate_all(void); | |||
224 | * Cluster failover support | 226 | * Cluster failover support |
225 | */ | 227 | */ |
226 | int nlmsvc_unlock_all_by_sb(struct super_block *sb); | 228 | int nlmsvc_unlock_all_by_sb(struct super_block *sb); |
227 | int nlmsvc_unlock_all_by_ip(__be32 server_addr); | 229 | int nlmsvc_unlock_all_by_ip(struct sockaddr *server_addr); |
228 | 230 | ||
229 | static inline struct inode *nlmsvc_file_inode(struct nlm_file *file) | 231 | static inline struct inode *nlmsvc_file_inode(struct nlm_file *file) |
230 | { | 232 | { |
diff --git a/include/linux/major.h b/include/linux/major.h index 0cb98053537a..53d5fafd85c3 100644 --- a/include/linux/major.h +++ b/include/linux/major.h | |||
@@ -53,7 +53,7 @@ | |||
53 | #define STL_SIOMEMMAJOR 28 | 53 | #define STL_SIOMEMMAJOR 28 |
54 | #define ACSI_MAJOR 28 | 54 | #define ACSI_MAJOR 28 |
55 | #define AZTECH_CDROM_MAJOR 29 | 55 | #define AZTECH_CDROM_MAJOR 29 |
56 | #define GRAPHDEV_MAJOR 29 /* SparcLinux & Linux/68k /dev/fb */ | 56 | #define FB_MAJOR 29 /* /dev/fb* framebuffers */ |
57 | #define CM206_CDROM_MAJOR 32 | 57 | #define CM206_CDROM_MAJOR 32 |
58 | #define IDE2_MAJOR 33 | 58 | #define IDE2_MAJOR 33 |
59 | #define IDE3_MAJOR 34 | 59 | #define IDE3_MAJOR 34 |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index ea9f5ad9ec8e..763ba81fc0f0 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -13,12 +13,12 @@ struct mem_section; | |||
13 | #ifdef CONFIG_MEMORY_HOTPLUG | 13 | #ifdef CONFIG_MEMORY_HOTPLUG |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * Magic number for free bootmem. | 16 | * Types for free bootmem. |
17 | * The normal smallest mapcount is -1. Here is smaller value than it. | 17 | * The normal smallest mapcount is -1. Here is smaller value than it. |
18 | */ | 18 | */ |
19 | #define SECTION_INFO 0xfffffffe | 19 | #define SECTION_INFO (-1 - 1) |
20 | #define MIX_INFO 0xfffffffd | 20 | #define MIX_SECTION_INFO (-1 - 2) |
21 | #define NODE_INFO 0xfffffffc | 21 | #define NODE_INFO (-1 - 3) |
22 | 22 | ||
23 | /* | 23 | /* |
24 | * pgdat resizing functions | 24 | * pgdat resizing functions |
@@ -199,6 +199,18 @@ extern int walk_memory_resource(unsigned long start_pfn, | |||
199 | unsigned long nr_pages, void *arg, | 199 | unsigned long nr_pages, void *arg, |
200 | int (*func)(unsigned long, unsigned long, void *)); | 200 | int (*func)(unsigned long, unsigned long, void *)); |
201 | 201 | ||
202 | #ifdef CONFIG_MEMORY_HOTREMOVE | ||
203 | |||
204 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); | ||
205 | |||
206 | #else | ||
207 | static inline int is_mem_section_removable(unsigned long pfn, | ||
208 | unsigned long nr_pages) | ||
209 | { | ||
210 | return 0; | ||
211 | } | ||
212 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | ||
213 | |||
202 | extern int add_memory(int nid, u64 start, u64 size); | 214 | extern int add_memory(int nid, u64 start, u64 size); |
203 | extern int arch_add_memory(int nid, u64 start, u64 size); | 215 | extern int arch_add_memory(int nid, u64 start, u64 size); |
204 | extern int remove_memory(u64 start, u64 size); | 216 | extern int remove_memory(u64 start, u64 size); |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 3a39570b81b8..085c903fe0f1 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -59,6 +59,7 @@ enum { | |||
59 | #include <linux/rbtree.h> | 59 | #include <linux/rbtree.h> |
60 | #include <linux/spinlock.h> | 60 | #include <linux/spinlock.h> |
61 | #include <linux/nodemask.h> | 61 | #include <linux/nodemask.h> |
62 | #include <linux/pagemap.h> | ||
62 | 63 | ||
63 | struct mm_struct; | 64 | struct mm_struct; |
64 | 65 | ||
@@ -220,6 +221,24 @@ extern int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context); | |||
220 | extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, | 221 | extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, |
221 | int no_context); | 222 | int no_context); |
222 | #endif | 223 | #endif |
224 | |||
225 | /* Check if a vma is migratable */ | ||
226 | static inline int vma_migratable(struct vm_area_struct *vma) | ||
227 | { | ||
228 | if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED)) | ||
229 | return 0; | ||
230 | /* | ||
231 | * Migration allocates pages in the highest zone. If we cannot | ||
232 | * do so then migration (at least from node to node) is not | ||
233 | * possible. | ||
234 | */ | ||
235 | if (vma->vm_file && | ||
236 | gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping)) | ||
237 | < policy_zone) | ||
238 | return 0; | ||
239 | return 1; | ||
240 | } | ||
241 | |||
223 | #else | 242 | #else |
224 | 243 | ||
225 | struct mempolicy {}; | 244 | struct mempolicy {}; |
diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h index 4ab2162db13b..322cd6deb9f0 100644 --- a/include/linux/mfd/asic3.h +++ b/include/linux/mfd/asic3.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | * | 9 | * |
10 | * Copyright 2001 Compaq Computer Corporation. | 10 | * Copyright 2001 Compaq Computer Corporation. |
11 | * Copyright 2007 OpendHand. | 11 | * Copyright 2007-2008 OpenedHand Ltd. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #ifndef __ASIC3_H__ | 14 | #ifndef __ASIC3_H__ |
@@ -16,43 +16,22 @@ | |||
16 | 16 | ||
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | 18 | ||
19 | struct asic3 { | ||
20 | void __iomem *mapping; | ||
21 | unsigned int bus_shift; | ||
22 | unsigned int irq_nr; | ||
23 | unsigned int irq_base; | ||
24 | spinlock_t lock; | ||
25 | u16 irq_bothedge[4]; | ||
26 | struct device *dev; | ||
27 | }; | ||
28 | |||
29 | struct asic3_platform_data { | 19 | struct asic3_platform_data { |
30 | struct { | 20 | u16 *gpio_config; |
31 | u32 dir; | 21 | unsigned int gpio_config_num; |
32 | u32 init; | ||
33 | u32 sleep_mask; | ||
34 | u32 sleep_out; | ||
35 | u32 batt_fault_out; | ||
36 | u32 sleep_conf; | ||
37 | u32 alt_function; | ||
38 | } gpio_a, gpio_b, gpio_c, gpio_d; | ||
39 | |||
40 | unsigned int bus_shift; | ||
41 | 22 | ||
42 | unsigned int irq_base; | 23 | unsigned int irq_base; |
43 | 24 | ||
44 | struct platform_device **children; | 25 | unsigned int gpio_base; |
45 | unsigned int n_children; | ||
46 | }; | 26 | }; |
47 | 27 | ||
48 | int asic3_gpio_get_value(struct asic3 *asic, unsigned gpio); | ||
49 | void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val); | ||
50 | |||
51 | #define ASIC3_NUM_GPIO_BANKS 4 | 28 | #define ASIC3_NUM_GPIO_BANKS 4 |
52 | #define ASIC3_GPIOS_PER_BANK 16 | 29 | #define ASIC3_GPIOS_PER_BANK 16 |
53 | #define ASIC3_NUM_GPIOS 64 | 30 | #define ASIC3_NUM_GPIOS 64 |
54 | #define ASIC3_NR_IRQS ASIC3_NUM_GPIOS + 6 | 31 | #define ASIC3_NR_IRQS ASIC3_NUM_GPIOS + 6 |
55 | 32 | ||
33 | #define ASIC3_TO_GPIO(gpio) (NR_BUILTIN_GPIO + (gpio)) | ||
34 | |||
56 | #define ASIC3_GPIO_BANK_A 0 | 35 | #define ASIC3_GPIO_BANK_A 0 |
57 | #define ASIC3_GPIO_BANK_B 1 | 36 | #define ASIC3_GPIO_BANK_B 1 |
58 | #define ASIC3_GPIO_BANK_C 2 | 37 | #define ASIC3_GPIO_BANK_C 2 |
@@ -64,32 +43,89 @@ void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val); | |||
64 | /* All offsets below are specified with this address bus shift */ | 43 | /* All offsets below are specified with this address bus shift */ |
65 | #define ASIC3_DEFAULT_ADDR_SHIFT 2 | 44 | #define ASIC3_DEFAULT_ADDR_SHIFT 2 |
66 | 45 | ||
67 | #define ASIC3_OFFSET(base, reg) (ASIC3_##base##_Base + ASIC3_##base##_##reg) | 46 | #define ASIC3_OFFSET(base, reg) (ASIC3_##base##_BASE + ASIC3_##base##_##reg) |
68 | #define ASIC3_GPIO_OFFSET(base, reg) \ | 47 | #define ASIC3_GPIO_OFFSET(base, reg) \ |
69 | (ASIC3_GPIO_##base##_Base + ASIC3_GPIO_##reg) | 48 | (ASIC3_GPIO_##base##_BASE + ASIC3_GPIO_##reg) |
70 | 49 | ||
71 | #define ASIC3_GPIO_A_Base 0x0000 | 50 | #define ASIC3_GPIO_A_BASE 0x0000 |
72 | #define ASIC3_GPIO_B_Base 0x0100 | 51 | #define ASIC3_GPIO_B_BASE 0x0100 |
73 | #define ASIC3_GPIO_C_Base 0x0200 | 52 | #define ASIC3_GPIO_C_BASE 0x0200 |
74 | #define ASIC3_GPIO_D_Base 0x0300 | 53 | #define ASIC3_GPIO_D_BASE 0x0300 |
75 | 54 | ||
76 | #define ASIC3_GPIO_Mask 0x00 /* R/W 0:don't mask */ | 55 | #define ASIC3_GPIO_TO_BANK(gpio) ((gpio) >> 4) |
77 | #define ASIC3_GPIO_Direction 0x04 /* R/W 0:input */ | 56 | #define ASIC3_GPIO_TO_BIT(gpio) ((gpio) - \ |
78 | #define ASIC3_GPIO_Out 0x08 /* R/W 0:output low */ | 57 | (ASIC3_GPIOS_PER_BANK * ((gpio) >> 4))) |
79 | #define ASIC3_GPIO_TriggerType 0x0c /* R/W 0:level */ | 58 | #define ASIC3_GPIO_TO_MASK(gpio) (1 << ASIC3_GPIO_TO_BIT(gpio)) |
80 | #define ASIC3_GPIO_EdgeTrigger 0x10 /* R/W 0:falling */ | 59 | #define ASIC3_GPIO_TO_BASE(gpio) (ASIC3_GPIO_A_BASE + (((gpio) >> 4) * 0x0100)) |
81 | #define ASIC3_GPIO_LevelTrigger 0x14 /* R/W 0:low level detect */ | 60 | #define ASIC3_BANK_TO_BASE(bank) (ASIC3_GPIO_A_BASE + ((bank) * 0x100)) |
82 | #define ASIC3_GPIO_SleepMask 0x18 /* R/W 0:don't mask in sleep mode */ | 61 | |
83 | #define ASIC3_GPIO_SleepOut 0x1c /* R/W level 0:low in sleep mode */ | 62 | #define ASIC3_GPIO_MASK 0x00 /* R/W 0:don't mask */ |
84 | #define ASIC3_GPIO_BattFaultOut 0x20 /* R/W level 0:low in batt_fault */ | 63 | #define ASIC3_GPIO_DIRECTION 0x04 /* R/W 0:input */ |
85 | #define ASIC3_GPIO_IntStatus 0x24 /* R/W 0:none, 1:detect */ | 64 | #define ASIC3_GPIO_OUT 0x08 /* R/W 0:output low */ |
86 | #define ASIC3_GPIO_AltFunction 0x28 /* R/W 1:LED register control */ | 65 | #define ASIC3_GPIO_TRIGGER_TYPE 0x0c /* R/W 0:level */ |
87 | #define ASIC3_GPIO_SleepConf 0x2c /* | 66 | #define ASIC3_GPIO_EDGE_TRIGGER 0x10 /* R/W 0:falling */ |
67 | #define ASIC3_GPIO_LEVEL_TRIGGER 0x14 /* R/W 0:low level detect */ | ||
68 | #define ASIC3_GPIO_SLEEP_MASK 0x18 /* R/W 0:don't mask in sleep mode */ | ||
69 | #define ASIC3_GPIO_SLEEP_OUT 0x1c /* R/W level 0:low in sleep mode */ | ||
70 | #define ASIC3_GPIO_BAT_FAULT_OUT 0x20 /* R/W level 0:low in batt_fault */ | ||
71 | #define ASIC3_GPIO_INT_STATUS 0x24 /* R/W 0:none, 1:detect */ | ||
72 | #define ASIC3_GPIO_ALT_FUNCTION 0x28 /* R/W 1:LED register control */ | ||
73 | #define ASIC3_GPIO_SLEEP_CONF 0x2c /* | ||
88 | * R/W bit 1: autosleep | 74 | * R/W bit 1: autosleep |
89 | * 0: disable gposlpout in normal mode, | 75 | * 0: disable gposlpout in normal mode, |
90 | * enable gposlpout in sleep mode. | 76 | * enable gposlpout in sleep mode. |
91 | */ | 77 | */ |
92 | #define ASIC3_GPIO_Status 0x30 /* R Pin status */ | 78 | #define ASIC3_GPIO_STATUS 0x30 /* R Pin status */ |
79 | |||
80 | /* | ||
81 | * ASIC3 GPIO config | ||
82 | * | ||
83 | * Bits 0..6 gpio number | ||
84 | * Bits 7..13 Alternate function | ||
85 | * Bit 14 Direction | ||
86 | * Bit 15 Initial value | ||
87 | * | ||
88 | */ | ||
89 | #define ASIC3_CONFIG_GPIO_PIN(config) ((config) & 0x7f) | ||
90 | #define ASIC3_CONFIG_GPIO_ALT(config) (((config) & (0x7f << 7)) >> 7) | ||
91 | #define ASIC3_CONFIG_GPIO_DIR(config) ((config & (1 << 14)) >> 14) | ||
92 | #define ASIC3_CONFIG_GPIO_INIT(config) ((config & (1 << 15)) >> 15) | ||
93 | #define ASIC3_CONFIG_GPIO(gpio, alt, dir, init) (((gpio) & 0x7f) \ | ||
94 | | (((alt) & 0x7f) << 7) | (((dir) & 0x1) << 14) \ | ||
95 | | (((init) & 0x1) << 15)) | ||
96 | #define ASIC3_CONFIG_GPIO_DEFAULT(gpio, dir, init) \ | ||
97 | ASIC3_CONFIG_GPIO((gpio), 0, (dir), (init)) | ||
98 | #define ASIC3_CONFIG_GPIO_DEFAULT_OUT(gpio, init) \ | ||
99 | ASIC3_CONFIG_GPIO((gpio), 0, 1, (init)) | ||
100 | |||
101 | /* | ||
102 | * Alternate functions | ||
103 | */ | ||
104 | #define ASIC3_GPIOA11_PWM0 ASIC3_CONFIG_GPIO(11, 1, 1, 0) | ||
105 | #define ASIC3_GPIOA12_PWM1 ASIC3_CONFIG_GPIO(12, 1, 1, 0) | ||
106 | #define ASIC3_GPIOA15_CONTROL_CX ASIC3_CONFIG_GPIO(15, 1, 1, 0) | ||
107 | #define ASIC3_GPIOC0_LED0 ASIC3_CONFIG_GPIO(32, 1, 1, 0) | ||
108 | #define ASIC3_GPIOC1_LED1 ASIC3_CONFIG_GPIO(33, 1, 1, 0) | ||
109 | #define ASIC3_GPIOC2_LED2 ASIC3_CONFIG_GPIO(34, 1, 1, 0) | ||
110 | #define ASIC3_GPIOC3_SPI_RXD ASIC3_CONFIG_GPIO(35, 1, 0, 0) | ||
111 | #define ASIC3_GPIOC4_CF_nCD ASIC3_CONFIG_GPIO(36, 1, 0, 0) | ||
112 | #define ASIC3_GPIOC4_SPI_TXD ASIC3_CONFIG_GPIO(36, 1, 1, 0) | ||
113 | #define ASIC3_GPIOC5_SPI_CLK ASIC3_CONFIG_GPIO(37, 1, 1, 0) | ||
114 | #define ASIC3_GPIOC5_nCIOW ASIC3_CONFIG_GPIO(37, 1, 1, 0) | ||
115 | #define ASIC3_GPIOC6_nCIOR ASIC3_CONFIG_GPIO(38, 1, 1, 0) | ||
116 | #define ASIC3_GPIOC7_nPCE_1 ASIC3_CONFIG_GPIO(39, 1, 0, 0) | ||
117 | #define ASIC3_GPIOC8_nPCE_2 ASIC3_CONFIG_GPIO(40, 1, 0, 0) | ||
118 | #define ASIC3_GPIOC9_nPOE ASIC3_CONFIG_GPIO(41, 1, 0, 0) | ||
119 | #define ASIC3_GPIOC10_nPWE ASIC3_CONFIG_GPIO(42, 1, 0, 0) | ||
120 | #define ASIC3_GPIOC11_PSKTSEL ASIC3_CONFIG_GPIO(43, 1, 0, 0) | ||
121 | #define ASIC3_GPIOC12_nPREG ASIC3_CONFIG_GPIO(44, 1, 0, 0) | ||
122 | #define ASIC3_GPIOC13_nPWAIT ASIC3_CONFIG_GPIO(45, 1, 1, 0) | ||
123 | #define ASIC3_GPIOC14_nPIOIS16 ASIC3_CONFIG_GPIO(46, 1, 1, 0) | ||
124 | #define ASIC3_GPIOC15_nPIOR ASIC3_CONFIG_GPIO(47, 1, 0, 0) | ||
125 | #define ASIC3_GPIOD11_nCIOIS16 ASIC3_CONFIG_GPIO(59, 1, 0, 0) | ||
126 | #define ASIC3_GPIOD12_nCWAIT ASIC3_CONFIG_GPIO(60, 1, 0, 0) | ||
127 | #define ASIC3_GPIOD15_nPIOW ASIC3_CONFIG_GPIO(63, 1, 0, 0) | ||
128 | |||
93 | 129 | ||
94 | #define ASIC3_SPI_Base 0x0400 | 130 | #define ASIC3_SPI_Base 0x0400 |
95 | #define ASIC3_SPI_Control 0x0000 | 131 | #define ASIC3_SPI_Control 0x0000 |
@@ -128,7 +164,7 @@ void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val); | |||
128 | #define LED_AUTOSTOP (1 << 5) /* LED ON/OFF auto stop 0:disable, 1:enable */ | 164 | #define LED_AUTOSTOP (1 << 5) /* LED ON/OFF auto stop 0:disable, 1:enable */ |
129 | #define LED_ALWAYS (1 << 6) /* LED Interrupt Mask 0:No mask, 1:mask */ | 165 | #define LED_ALWAYS (1 << 6) /* LED Interrupt Mask 0:No mask, 1:mask */ |
130 | 166 | ||
131 | #define ASIC3_CLOCK_Base 0x0A00 | 167 | #define ASIC3_CLOCK_BASE 0x0A00 |
132 | #define ASIC3_CLOCK_CDEX 0x00 | 168 | #define ASIC3_CLOCK_CDEX 0x00 |
133 | #define ASIC3_CLOCK_SEL 0x04 | 169 | #define ASIC3_CLOCK_SEL 0x04 |
134 | 170 | ||
@@ -159,12 +195,12 @@ void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val); | |||
159 | #define CLOCK_SEL_CX (1 << 2) | 195 | #define CLOCK_SEL_CX (1 << 2) |
160 | 196 | ||
161 | 197 | ||
162 | #define ASIC3_INTR_Base 0x0B00 | 198 | #define ASIC3_INTR_BASE 0x0B00 |
163 | 199 | ||
164 | #define ASIC3_INTR_IntMask 0x00 /* Interrupt mask control */ | 200 | #define ASIC3_INTR_INT_MASK 0x00 /* Interrupt mask control */ |
165 | #define ASIC3_INTR_PIntStat 0x04 /* Peripheral interrupt status */ | 201 | #define ASIC3_INTR_P_INT_STAT 0x04 /* Peripheral interrupt status */ |
166 | #define ASIC3_INTR_IntCPS 0x08 /* Interrupt timer clock pre-scale */ | 202 | #define ASIC3_INTR_INT_CPS 0x08 /* Interrupt timer clock pre-scale */ |
167 | #define ASIC3_INTR_IntTBS 0x0c /* Interrupt timer set */ | 203 | #define ASIC3_INTR_INT_TBS 0x0c /* Interrupt timer set */ |
168 | 204 | ||
169 | #define ASIC3_INTMASK_GINTMASK (1 << 0) /* Global INTs mask 1:enable */ | 205 | #define ASIC3_INTMASK_GINTMASK (1 << 0) /* Global INTs mask 1:enable */ |
170 | #define ASIC3_INTMASK_GINTEL (1 << 1) /* 1: rising edge, 0: hi level */ | 206 | #define ASIC3_INTMASK_GINTEL (1 << 1) /* 1: rising edge, 0: hi level */ |
@@ -227,44 +263,12 @@ void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val); | |||
227 | #define ASIC3_EXTCF_CF_SLEEP (1 << 15) /* CF sleep mode control */ | 263 | #define ASIC3_EXTCF_CF_SLEEP (1 << 15) /* CF sleep mode control */ |
228 | 264 | ||
229 | /********************************************* | 265 | /********************************************* |
230 | * The Onewire interface registers | 266 | * The Onewire interface (DS1WM) is handled |
231 | * | 267 | * by the ds1wm driver. |
232 | * OWM_CMD | ||
233 | * OWM_DAT | ||
234 | * OWM_INTR | ||
235 | * OWM_INTEN | ||
236 | * OWM_CLKDIV | ||
237 | * | 268 | * |
238 | *********************************************/ | 269 | *********************************************/ |
239 | 270 | ||
240 | #define ASIC3_OWM_Base 0xC00 | 271 | #define ASIC3_OWM_BASE 0xC00 |
241 | |||
242 | #define ASIC3_OWM_CMD 0x00 | ||
243 | #define ASIC3_OWM_DAT 0x04 | ||
244 | #define ASIC3_OWM_INTR 0x08 | ||
245 | #define ASIC3_OWM_INTEN 0x0C | ||
246 | #define ASIC3_OWM_CLKDIV 0x10 | ||
247 | |||
248 | #define ASIC3_OWM_CMD_ONEWR (1 << 0) | ||
249 | #define ASIC3_OWM_CMD_SRA (1 << 1) | ||
250 | #define ASIC3_OWM_CMD_DQO (1 << 2) | ||
251 | #define ASIC3_OWM_CMD_DQI (1 << 3) | ||
252 | |||
253 | #define ASIC3_OWM_INTR_PD (1 << 0) | ||
254 | #define ASIC3_OWM_INTR_PDR (1 << 1) | ||
255 | #define ASIC3_OWM_INTR_TBE (1 << 2) | ||
256 | #define ASIC3_OWM_INTR_TEMP (1 << 3) | ||
257 | #define ASIC3_OWM_INTR_RBF (1 << 4) | ||
258 | |||
259 | #define ASIC3_OWM_INTEN_EPD (1 << 0) | ||
260 | #define ASIC3_OWM_INTEN_IAS (1 << 1) | ||
261 | #define ASIC3_OWM_INTEN_ETBE (1 << 2) | ||
262 | #define ASIC3_OWM_INTEN_ETMT (1 << 3) | ||
263 | #define ASIC3_OWM_INTEN_ERBF (1 << 4) | ||
264 | |||
265 | #define ASIC3_OWM_CLKDIV_PRE (3 << 0) /* two bits wide at bit 0 */ | ||
266 | #define ASIC3_OWM_CLKDIV_DIV (7 << 2) /* 3 bits wide at bit 2 */ | ||
267 | |||
268 | 272 | ||
269 | /***************************************************************************** | 273 | /***************************************************************************** |
270 | * The SD configuration registers are at a completely different location | 274 | * The SD configuration registers are at a completely different location |
@@ -492,6 +496,7 @@ void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val); | |||
492 | #define ASIC3_SDIO_CTRL_LEDCtrl 0x7C | 496 | #define ASIC3_SDIO_CTRL_LEDCtrl 0x7C |
493 | #define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0 | 497 | #define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0 |
494 | 498 | ||
495 | #define ASIC3_MAP_SIZE 0x2000 | 499 | #define ASIC3_MAP_SIZE_32BIT 0x2000 |
500 | #define ASIC3_MAP_SIZE_16BIT 0x1000 | ||
496 | 501 | ||
497 | #endif /* __ASIC3_H__ */ | 502 | #endif /* __ASIC3_H__ */ |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h new file mode 100644 index 000000000000..bb3dd0545928 --- /dev/null +++ b/include/linux/mfd/core.h | |||
@@ -0,0 +1,55 @@ | |||
1 | #ifndef MFD_CORE_H | ||
2 | #define MFD_CORE_H | ||
3 | /* | ||
4 | * drivers/mfd/mfd-core.h | ||
5 | * | ||
6 | * core MFD support | ||
7 | * Copyright (c) 2006 Ian Molton | ||
8 | * Copyright (c) 2007 Dmitry Baryshkov | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #include <linux/platform_device.h> | ||
17 | |||
18 | /* | ||
19 | * This struct describes the MFD part ("cell"). | ||
20 | * After registration the copy of this structure will become the platform data | ||
21 | * of the resulting platform_device | ||
22 | */ | ||
23 | struct mfd_cell { | ||
24 | const char *name; | ||
25 | |||
26 | int (*enable)(struct platform_device *dev); | ||
27 | int (*disable)(struct platform_device *dev); | ||
28 | int (*suspend)(struct platform_device *dev); | ||
29 | int (*resume)(struct platform_device *dev); | ||
30 | |||
31 | void *driver_data; /* driver-specific data */ | ||
32 | |||
33 | /* | ||
34 | * This resources can be specified relatievly to the parent device. | ||
35 | * For accessing device you should use resources from device | ||
36 | */ | ||
37 | int num_resources; | ||
38 | const struct resource *resources; | ||
39 | }; | ||
40 | |||
41 | static inline struct mfd_cell * | ||
42 | mfd_get_cell(struct platform_device *pdev) | ||
43 | { | ||
44 | return (struct mfd_cell *)pdev->dev.platform_data; | ||
45 | } | ||
46 | |||
47 | extern int mfd_add_devices( | ||
48 | struct platform_device *parent, | ||
49 | const struct mfd_cell *cells, int n_devs, | ||
50 | struct resource *mem_base, | ||
51 | int irq_base); | ||
52 | |||
53 | extern void mfd_remove_devices(struct platform_device *parent); | ||
54 | |||
55 | #endif | ||
diff --git a/include/linux/mfd/tc6393xb.h b/include/linux/mfd/tc6393xb.h new file mode 100644 index 000000000000..7cc824a58f7c --- /dev/null +++ b/include/linux/mfd/tc6393xb.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * Toshiba TC6393XB SoC support | ||
3 | * | ||
4 | * Copyright(c) 2005-2006 Chris Humbert | ||
5 | * Copyright(c) 2005 Dirk Opfer | ||
6 | * Copyright(c) 2005 Ian Molton <spyro@f2s.com> | ||
7 | * Copyright(c) 2007 Dmitry Baryshkov | ||
8 | * | ||
9 | * Based on code written by Sharp/Lineo for 2.4 kernels | ||
10 | * Based on locomo.c | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License version 2 as | ||
14 | * published by the Free Software Foundation. | ||
15 | */ | ||
16 | |||
17 | #ifndef TC6393XB_H | ||
18 | #define TC6393XB_H | ||
19 | |||
20 | /* Also one should provide the CK3P6MI clock */ | ||
21 | struct tc6393xb_platform_data { | ||
22 | u16 scr_pll2cr; /* PLL2 Control */ | ||
23 | u16 scr_gper; /* GP Enable */ | ||
24 | u32 scr_gpo_doecr; /* GPO Data OE Control */ | ||
25 | u32 scr_gpo_dsr; /* GPO Data Set */ | ||
26 | |||
27 | int (*enable)(struct platform_device *dev); | ||
28 | int (*disable)(struct platform_device *dev); | ||
29 | int (*suspend)(struct platform_device *dev); | ||
30 | int (*resume)(struct platform_device *dev); | ||
31 | |||
32 | int irq_base; /* a base for cascaded irq */ | ||
33 | int gpio_base; | ||
34 | |||
35 | struct tmio_nand_data *nand_data; | ||
36 | }; | ||
37 | |||
38 | /* | ||
39 | * Relative to irq_base | ||
40 | */ | ||
41 | #define IRQ_TC6393_NAND 0 | ||
42 | #define IRQ_TC6393_MMC 1 | ||
43 | #define IRQ_TC6393_OHCI 2 | ||
44 | #define IRQ_TC6393_SERIAL 3 | ||
45 | #define IRQ_TC6393_FB 4 | ||
46 | |||
47 | #define TC6393XB_NR_IRQS 8 | ||
48 | |||
49 | #endif | ||
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h new file mode 100644 index 000000000000..9438d8c9ac1c --- /dev/null +++ b/include/linux/mfd/tmio.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef MFD_TMIO_H | ||
2 | #define MFD_TMIO_H | ||
3 | |||
4 | /* | ||
5 | * data for the NAND controller | ||
6 | */ | ||
7 | struct tmio_nand_data { | ||
8 | struct nand_bbt_descr *badblock_pattern; | ||
9 | struct mtd_partition *partition; | ||
10 | unsigned int num_partitions; | ||
11 | }; | ||
12 | |||
13 | #define TMIO_NAND_CONFIG "tmio-nand-config" | ||
14 | #define TMIO_NAND_CONTROL "tmio-nand-control" | ||
15 | #define TMIO_NAND_IRQ "tmio-nand" | ||
16 | |||
17 | #endif | ||
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index e10a90a93b5d..03aea612d284 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -3,28 +3,10 @@ | |||
3 | 3 | ||
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | #include <linux/mempolicy.h> | 5 | #include <linux/mempolicy.h> |
6 | #include <linux/pagemap.h> | ||
7 | 6 | ||
8 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); | 7 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); |
9 | 8 | ||
10 | #ifdef CONFIG_MIGRATION | 9 | #ifdef CONFIG_MIGRATION |
11 | /* Check if a vma is migratable */ | ||
12 | static inline int vma_migratable(struct vm_area_struct *vma) | ||
13 | { | ||
14 | if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED)) | ||
15 | return 0; | ||
16 | /* | ||
17 | * Migration allocates pages in the highest zone. If we cannot | ||
18 | * do so then migration (at least from node to node) is not | ||
19 | * possible. | ||
20 | */ | ||
21 | if (vma->vm_file && | ||
22 | gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping)) | ||
23 | < policy_zone) | ||
24 | return 0; | ||
25 | return 1; | ||
26 | } | ||
27 | |||
28 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); | 10 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); |
29 | extern int putback_lru_pages(struct list_head *l); | 11 | extern int putback_lru_pages(struct list_head *l); |
30 | extern int migrate_page(struct address_space *, | 12 | extern int migrate_page(struct address_space *, |
@@ -39,9 +21,6 @@ extern int migrate_vmas(struct mm_struct *mm, | |||
39 | const nodemask_t *from, const nodemask_t *to, | 21 | const nodemask_t *from, const nodemask_t *to, |
40 | unsigned long flags); | 22 | unsigned long flags); |
41 | #else | 23 | #else |
42 | static inline int vma_migratable(struct vm_area_struct *vma) | ||
43 | { return 0; } | ||
44 | |||
45 | static inline int isolate_lru_page(struct page *p, struct list_head *list) | 24 | static inline int isolate_lru_page(struct page *p, struct list_head *list) |
46 | { return -ENOSYS; } | 25 | { return -ENOSYS; } |
47 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | 26 | static inline int putback_lru_pages(struct list_head *l) { return 0; } |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 2128ef7780c6..d87a5a5fe87d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -41,6 +41,9 @@ extern unsigned long mmap_min_addr; | |||
41 | 41 | ||
42 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) | 42 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) |
43 | 43 | ||
44 | /* to align the pointer to the (next) page boundary */ | ||
45 | #define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) | ||
46 | |||
44 | /* | 47 | /* |
45 | * Linux kernel virtual memory manager primitives. | 48 | * Linux kernel virtual memory manager primitives. |
46 | * The idea being to have a "virtual" mm in the same way | 49 | * The idea being to have a "virtual" mm in the same way |
@@ -100,6 +103,7 @@ extern unsigned int kobjsize(const void *objp); | |||
100 | #define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ | 103 | #define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ |
101 | #define VM_RESERVED 0x00080000 /* Count as reserved_vm like IO */ | 104 | #define VM_RESERVED 0x00080000 /* Count as reserved_vm like IO */ |
102 | #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ | 105 | #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ |
106 | #define VM_NORESERVE 0x00200000 /* should the VM suppress accounting */ | ||
103 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ | 107 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ |
104 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ | 108 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ |
105 | #define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ | 109 | #define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ |
@@ -166,12 +170,16 @@ struct vm_operations_struct { | |||
166 | void (*open)(struct vm_area_struct * area); | 170 | void (*open)(struct vm_area_struct * area); |
167 | void (*close)(struct vm_area_struct * area); | 171 | void (*close)(struct vm_area_struct * area); |
168 | int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf); | 172 | int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf); |
169 | unsigned long (*nopfn)(struct vm_area_struct *area, | ||
170 | unsigned long address); | ||
171 | 173 | ||
172 | /* notification that a previously read-only page is about to become | 174 | /* notification that a previously read-only page is about to become |
173 | * writable, if an error is returned it will cause a SIGBUS */ | 175 | * writable, if an error is returned it will cause a SIGBUS */ |
174 | int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page); | 176 | int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page); |
177 | |||
178 | /* called by access_process_vm when get_user_pages() fails, typically | ||
179 | * for use by special VMAs that can switch between memory and hardware | ||
180 | */ | ||
181 | int (*access)(struct vm_area_struct *vma, unsigned long addr, | ||
182 | void *buf, int len, int write); | ||
175 | #ifdef CONFIG_NUMA | 183 | #ifdef CONFIG_NUMA |
176 | /* | 184 | /* |
177 | * set_policy() op must add a reference to any non-NULL @new mempolicy | 185 | * set_policy() op must add a reference to any non-NULL @new mempolicy |
@@ -675,13 +683,6 @@ static inline int page_mapped(struct page *page) | |||
675 | } | 683 | } |
676 | 684 | ||
677 | /* | 685 | /* |
678 | * Error return values for the *_nopfn functions | ||
679 | */ | ||
680 | #define NOPFN_SIGBUS ((unsigned long) -1) | ||
681 | #define NOPFN_OOM ((unsigned long) -2) | ||
682 | #define NOPFN_REFAULT ((unsigned long) -3) | ||
683 | |||
684 | /* | ||
685 | * Different kinds of faults, as returned by handle_mm_fault(). | 686 | * Different kinds of faults, as returned by handle_mm_fault(). |
686 | * Used to decide whether a process gets delivered SIGBUS or | 687 | * Used to decide whether a process gets delivered SIGBUS or |
687 | * just gets major/minor fault counters bumped up. | 688 | * just gets major/minor fault counters bumped up. |
@@ -772,14 +773,14 @@ struct mm_walk { | |||
772 | 773 | ||
773 | int walk_page_range(unsigned long addr, unsigned long end, | 774 | int walk_page_range(unsigned long addr, unsigned long end, |
774 | struct mm_walk *walk); | 775 | struct mm_walk *walk); |
775 | void free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | 776 | void free_pgd_range(struct mmu_gather *tlb, unsigned long addr, |
776 | unsigned long end, unsigned long floor, unsigned long ceiling); | 777 | unsigned long end, unsigned long floor, unsigned long ceiling); |
777 | void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma, | ||
778 | unsigned long floor, unsigned long ceiling); | ||
779 | int copy_page_range(struct mm_struct *dst, struct mm_struct *src, | 778 | int copy_page_range(struct mm_struct *dst, struct mm_struct *src, |
780 | struct vm_area_struct *vma); | 779 | struct vm_area_struct *vma); |
781 | void unmap_mapping_range(struct address_space *mapping, | 780 | void unmap_mapping_range(struct address_space *mapping, |
782 | loff_t const holebegin, loff_t const holelen, int even_cows); | 781 | loff_t const holebegin, loff_t const holelen, int even_cows); |
782 | int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, | ||
783 | void *buf, int len, int write); | ||
783 | 784 | ||
784 | static inline void unmap_shared_mapping_range(struct address_space *mapping, | 785 | static inline void unmap_shared_mapping_range(struct address_space *mapping, |
785 | loff_t const holebegin, loff_t const holelen) | 786 | loff_t const holebegin, loff_t const holelen) |
@@ -965,9 +966,8 @@ static inline void pgtable_page_dtor(struct page *page) | |||
965 | NULL: pte_offset_kernel(pmd, address)) | 966 | NULL: pte_offset_kernel(pmd, address)) |
966 | 967 | ||
967 | extern void free_area_init(unsigned long * zones_size); | 968 | extern void free_area_init(unsigned long * zones_size); |
968 | extern void free_area_init_node(int nid, pg_data_t *pgdat, | 969 | extern void free_area_init_node(int nid, unsigned long * zones_size, |
969 | unsigned long * zones_size, unsigned long zone_start_pfn, | 970 | unsigned long zone_start_pfn, unsigned long *zholes_size); |
970 | unsigned long *zholes_size); | ||
971 | #ifdef CONFIG_ARCH_POPULATES_NODE_MAP | 971 | #ifdef CONFIG_ARCH_POPULATES_NODE_MAP |
972 | /* | 972 | /* |
973 | * With CONFIG_ARCH_POPULATES_NODE_MAP set, an architecture may initialise its | 973 | * With CONFIG_ARCH_POPULATES_NODE_MAP set, an architecture may initialise its |
diff --git a/include/linux/module.h b/include/linux/module.h index 3e03b1acbc94..68e09557c951 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -23,7 +23,7 @@ | |||
23 | /* Not Yet Implemented */ | 23 | /* Not Yet Implemented */ |
24 | #define MODULE_SUPPORTED_DEVICE(name) | 24 | #define MODULE_SUPPORTED_DEVICE(name) |
25 | 25 | ||
26 | /* v850 toolchain uses a `_' prefix for all user symbols */ | 26 | /* some toolchains uses a `_' prefix for all user symbols */ |
27 | #ifndef MODULE_SYMBOL_PREFIX | 27 | #ifndef MODULE_SYMBOL_PREFIX |
28 | #define MODULE_SYMBOL_PREFIX "" | 28 | #define MODULE_SYMBOL_PREFIX "" |
29 | #endif | 29 | #endif |
@@ -249,27 +249,30 @@ struct module | |||
249 | 249 | ||
250 | /* Exported symbols */ | 250 | /* Exported symbols */ |
251 | const struct kernel_symbol *syms; | 251 | const struct kernel_symbol *syms; |
252 | unsigned int num_syms; | ||
253 | const unsigned long *crcs; | 252 | const unsigned long *crcs; |
253 | unsigned int num_syms; | ||
254 | 254 | ||
255 | /* GPL-only exported symbols. */ | 255 | /* GPL-only exported symbols. */ |
256 | const struct kernel_symbol *gpl_syms; | ||
257 | unsigned int num_gpl_syms; | 256 | unsigned int num_gpl_syms; |
257 | const struct kernel_symbol *gpl_syms; | ||
258 | const unsigned long *gpl_crcs; | 258 | const unsigned long *gpl_crcs; |
259 | 259 | ||
260 | #ifdef CONFIG_UNUSED_SYMBOLS | ||
260 | /* unused exported symbols. */ | 261 | /* unused exported symbols. */ |
261 | const struct kernel_symbol *unused_syms; | 262 | const struct kernel_symbol *unused_syms; |
262 | unsigned int num_unused_syms; | ||
263 | const unsigned long *unused_crcs; | 263 | const unsigned long *unused_crcs; |
264 | unsigned int num_unused_syms; | ||
265 | |||
264 | /* GPL-only, unused exported symbols. */ | 266 | /* GPL-only, unused exported symbols. */ |
265 | const struct kernel_symbol *unused_gpl_syms; | ||
266 | unsigned int num_unused_gpl_syms; | 267 | unsigned int num_unused_gpl_syms; |
268 | const struct kernel_symbol *unused_gpl_syms; | ||
267 | const unsigned long *unused_gpl_crcs; | 269 | const unsigned long *unused_gpl_crcs; |
270 | #endif | ||
268 | 271 | ||
269 | /* symbols that will be GPL-only in the near future. */ | 272 | /* symbols that will be GPL-only in the near future. */ |
270 | const struct kernel_symbol *gpl_future_syms; | 273 | const struct kernel_symbol *gpl_future_syms; |
271 | unsigned int num_gpl_future_syms; | ||
272 | const unsigned long *gpl_future_crcs; | 274 | const unsigned long *gpl_future_crcs; |
275 | unsigned int num_gpl_future_syms; | ||
273 | 276 | ||
274 | /* Exception table */ | 277 | /* Exception table */ |
275 | unsigned int num_exentries; | 278 | unsigned int num_exentries; |
@@ -285,10 +288,10 @@ struct module | |||
285 | void *module_core; | 288 | void *module_core; |
286 | 289 | ||
287 | /* Here are the sizes of the init and core sections */ | 290 | /* Here are the sizes of the init and core sections */ |
288 | unsigned long init_size, core_size; | 291 | unsigned int init_size, core_size; |
289 | 292 | ||
290 | /* The size of the executable code in each section. */ | 293 | /* The size of the executable code in each section. */ |
291 | unsigned long init_text_size, core_text_size; | 294 | unsigned int init_text_size, core_text_size; |
292 | 295 | ||
293 | /* The handle returned from unwind_add_table. */ | 296 | /* The handle returned from unwind_add_table. */ |
294 | void *unwind_info; | 297 | void *unwind_info; |
@@ -300,29 +303,15 @@ struct module | |||
300 | 303 | ||
301 | #ifdef CONFIG_GENERIC_BUG | 304 | #ifdef CONFIG_GENERIC_BUG |
302 | /* Support for BUG */ | 305 | /* Support for BUG */ |
306 | unsigned num_bugs; | ||
303 | struct list_head bug_list; | 307 | struct list_head bug_list; |
304 | struct bug_entry *bug_table; | 308 | struct bug_entry *bug_table; |
305 | unsigned num_bugs; | ||
306 | #endif | ||
307 | |||
308 | #ifdef CONFIG_MODULE_UNLOAD | ||
309 | /* Reference counts */ | ||
310 | struct module_ref ref[NR_CPUS]; | ||
311 | |||
312 | /* What modules depend on me? */ | ||
313 | struct list_head modules_which_use_me; | ||
314 | |||
315 | /* Who is waiting for us to be unloaded */ | ||
316 | struct task_struct *waiter; | ||
317 | |||
318 | /* Destruction function. */ | ||
319 | void (*exit)(void); | ||
320 | #endif | 309 | #endif |
321 | 310 | ||
322 | #ifdef CONFIG_KALLSYMS | 311 | #ifdef CONFIG_KALLSYMS |
323 | /* We keep the symbol and string tables for kallsyms. */ | 312 | /* We keep the symbol and string tables for kallsyms. */ |
324 | Elf_Sym *symtab; | 313 | Elf_Sym *symtab; |
325 | unsigned long num_symtab; | 314 | unsigned int num_symtab; |
326 | char *strtab; | 315 | char *strtab; |
327 | 316 | ||
328 | /* Section attributes */ | 317 | /* Section attributes */ |
@@ -342,6 +331,21 @@ struct module | |||
342 | struct marker *markers; | 331 | struct marker *markers; |
343 | unsigned int num_markers; | 332 | unsigned int num_markers; |
344 | #endif | 333 | #endif |
334 | |||
335 | #ifdef CONFIG_MODULE_UNLOAD | ||
336 | /* What modules depend on me? */ | ||
337 | struct list_head modules_which_use_me; | ||
338 | |||
339 | /* Who is waiting for us to be unloaded */ | ||
340 | struct task_struct *waiter; | ||
341 | |||
342 | /* Destruction function. */ | ||
343 | void (*exit)(void); | ||
344 | |||
345 | /* Reference counts */ | ||
346 | struct module_ref ref[NR_CPUS]; | ||
347 | #endif | ||
348 | |||
345 | }; | 349 | }; |
346 | #ifndef MODULE_ARCH_INIT | 350 | #ifndef MODULE_ARCH_INIT |
347 | #define MODULE_ARCH_INIT {} | 351 | #define MODULE_ARCH_INIT {} |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index de4decfa1bfc..07112ee9293a 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -144,11 +144,37 @@ static inline int ip_mroute_opt(int opt) | |||
144 | } | 144 | } |
145 | #endif | 145 | #endif |
146 | 146 | ||
147 | #ifdef CONFIG_IP_MROUTE | ||
147 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int); | 148 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int); |
148 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); | 149 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); |
149 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); | 150 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); |
150 | extern void ip_mr_init(void); | 151 | extern int ip_mr_init(void); |
152 | #else | ||
153 | static inline | ||
154 | int ip_mroute_setsockopt(struct sock *sock, | ||
155 | int optname, char __user *optval, int optlen) | ||
156 | { | ||
157 | return -ENOPROTOOPT; | ||
158 | } | ||
159 | |||
160 | static inline | ||
161 | int ip_mroute_getsockopt(struct sock *sock, | ||
162 | int optname, char __user *optval, int __user *optlen) | ||
163 | { | ||
164 | return -ENOPROTOOPT; | ||
165 | } | ||
151 | 166 | ||
167 | static inline | ||
168 | int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg) | ||
169 | { | ||
170 | return -ENOIOCTLCMD; | ||
171 | } | ||
172 | |||
173 | static inline int ip_mr_init(void) | ||
174 | { | ||
175 | return 0; | ||
176 | } | ||
177 | #endif | ||
152 | 178 | ||
153 | struct vif_device | 179 | struct vif_device |
154 | { | 180 | { |
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index e7989593142b..5cf50473a10f 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
@@ -131,11 +131,44 @@ static inline int ip6_mroute_opt(int opt) | |||
131 | 131 | ||
132 | struct sock; | 132 | struct sock; |
133 | 133 | ||
134 | #ifdef CONFIG_IPV6_MROUTE | ||
134 | extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, int); | 135 | extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, int); |
135 | extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); | 136 | extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); |
136 | extern int ip6_mr_input(struct sk_buff *skb); | 137 | extern int ip6_mr_input(struct sk_buff *skb); |
137 | extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); | 138 | extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); |
138 | extern void ip6_mr_init(void); | 139 | extern int ip6_mr_init(void); |
140 | extern void ip6_mr_cleanup(void); | ||
141 | #else | ||
142 | static inline | ||
143 | int ip6_mroute_setsockopt(struct sock *sock, | ||
144 | int optname, char __user *optval, int optlen) | ||
145 | { | ||
146 | return -ENOPROTOOPT; | ||
147 | } | ||
148 | |||
149 | static inline | ||
150 | int ip6_mroute_getsockopt(struct sock *sock, | ||
151 | int optname, char __user *optval, int __user *optlen) | ||
152 | { | ||
153 | return -ENOPROTOOPT; | ||
154 | } | ||
155 | |||
156 | static inline | ||
157 | int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg) | ||
158 | { | ||
159 | return -ENOIOCTLCMD; | ||
160 | } | ||
161 | |||
162 | static inline int ip6_mr_init(void) | ||
163 | { | ||
164 | return 0; | ||
165 | } | ||
166 | |||
167 | static inline void ip6_mr_cleanup(void) | ||
168 | { | ||
169 | return; | ||
170 | } | ||
171 | #endif | ||
139 | 172 | ||
140 | struct mif_device | 173 | struct mif_device |
141 | { | 174 | { |
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index a9fae032ba81..9c1d95491f8b 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
@@ -189,7 +189,7 @@ typedef union { | |||
189 | */ | 189 | */ |
190 | 190 | ||
191 | struct map_info { | 191 | struct map_info { |
192 | char *name; | 192 | const char *name; |
193 | unsigned long size; | 193 | unsigned long size; |
194 | resource_size_t phys; | 194 | resource_size_t phys; |
195 | #define NO_XIP (-1UL) | 195 | #define NO_XIP (-1UL) |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 245f9098e171..8b5d49133ec6 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -121,7 +121,7 @@ struct mtd_info { | |||
121 | u_int32_t oobavail; // Available OOB bytes per block | 121 | u_int32_t oobavail; // Available OOB bytes per block |
122 | 122 | ||
123 | // Kernel-only stuff starts here. | 123 | // Kernel-only stuff starts here. |
124 | char *name; | 124 | const char *name; |
125 | int index; | 125 | int index; |
126 | 126 | ||
127 | /* ecc layout structure pointer - read only ! */ | 127 | /* ecc layout structure pointer - read only ! */ |
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h index a15cdd4a8e58..12078577aef6 100644 --- a/include/linux/mv643xx_eth.h +++ b/include/linux/mv643xx_eth.h | |||
@@ -17,30 +17,59 @@ | |||
17 | 17 | ||
18 | struct mv643xx_eth_shared_platform_data { | 18 | struct mv643xx_eth_shared_platform_data { |
19 | struct mbus_dram_target_info *dram; | 19 | struct mbus_dram_target_info *dram; |
20 | unsigned int t_clk; | 20 | unsigned int t_clk; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | struct mv643xx_eth_platform_data { | 23 | struct mv643xx_eth_platform_data { |
24 | /* | ||
25 | * Pointer back to our parent instance, and our port number. | ||
26 | */ | ||
24 | struct platform_device *shared; | 27 | struct platform_device *shared; |
25 | int port_number; | 28 | int port_number; |
26 | 29 | ||
30 | /* | ||
31 | * Whether a PHY is present, and if yes, at which address. | ||
32 | */ | ||
27 | struct platform_device *shared_smi; | 33 | struct platform_device *shared_smi; |
34 | int force_phy_addr; | ||
35 | int phy_addr; | ||
28 | 36 | ||
29 | u16 force_phy_addr; /* force override if phy_addr == 0 */ | 37 | /* |
30 | u16 phy_addr; | 38 | * Use this MAC address if it is valid, overriding the |
31 | 39 | * address that is already in the hardware. | |
32 | /* If speed is 0, then speed and duplex are autonegotiated. */ | 40 | */ |
33 | int speed; /* 0, SPEED_10, SPEED_100, SPEED_1000 */ | 41 | u8 mac_addr[6]; |
34 | int duplex; /* DUPLEX_HALF or DUPLEX_FULL */ | 42 | |
35 | 43 | /* | |
36 | /* non-zero values of the following fields override defaults */ | 44 | * If speed is 0, autonegotiation is enabled. |
37 | u32 tx_queue_size; | 45 | * Valid values for speed: 0, SPEED_10, SPEED_100, SPEED_1000. |
38 | u32 rx_queue_size; | 46 | * Valid values for duplex: DUPLEX_HALF, DUPLEX_FULL. |
39 | u32 tx_sram_addr; | 47 | */ |
40 | u32 tx_sram_size; | 48 | int speed; |
41 | u32 rx_sram_addr; | 49 | int duplex; |
42 | u32 rx_sram_size; | 50 | |
43 | u8 mac_addr[6]; /* mac address if non-zero*/ | 51 | /* |
52 | * Which RX/TX queues to use. | ||
53 | */ | ||
54 | int rx_queue_mask; | ||
55 | int tx_queue_mask; | ||
56 | |||
57 | /* | ||
58 | * Override default RX/TX queue sizes if nonzero. | ||
59 | */ | ||
60 | int rx_queue_size; | ||
61 | int tx_queue_size; | ||
62 | |||
63 | /* | ||
64 | * Use on-chip SRAM for RX/TX descriptors if size is nonzero | ||
65 | * and sufficient to contain all descriptors for the requested | ||
66 | * ring sizes. | ||
67 | */ | ||
68 | unsigned long rx_sram_addr; | ||
69 | int rx_sram_size; | ||
70 | unsigned long tx_sram_addr; | ||
71 | int tx_sram_size; | ||
44 | }; | 72 | }; |
45 | 73 | ||
46 | #endif /* __LINUX_MV643XX_ETH_H */ | 74 | |
75 | #endif | ||
diff --git a/include/linux/net.h b/include/linux/net.h index 71f7dd559285..2f999fbb188d 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include <linux/wait.h> | 21 | #include <linux/wait.h> |
22 | #include <linux/socket.h> | 22 | #include <linux/socket.h> |
23 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ | ||
23 | #include <asm/socket.h> | 24 | #include <asm/socket.h> |
24 | 25 | ||
25 | struct poll_table_struct; | 26 | struct poll_table_struct; |
@@ -46,6 +47,7 @@ struct net; | |||
46 | #define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */ | 47 | #define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */ |
47 | #define SYS_SENDMSG 16 /* sys_sendmsg(2) */ | 48 | #define SYS_SENDMSG 16 /* sys_sendmsg(2) */ |
48 | #define SYS_RECVMSG 17 /* sys_recvmsg(2) */ | 49 | #define SYS_RECVMSG 17 /* sys_recvmsg(2) */ |
50 | #define SYS_PACCEPT 18 /* sys_paccept(2) */ | ||
49 | 51 | ||
50 | typedef enum { | 52 | typedef enum { |
51 | SS_FREE = 0, /* not allocated */ | 53 | SS_FREE = 0, /* not allocated */ |
@@ -94,6 +96,15 @@ enum sock_type { | |||
94 | }; | 96 | }; |
95 | 97 | ||
96 | #define SOCK_MAX (SOCK_PACKET + 1) | 98 | #define SOCK_MAX (SOCK_PACKET + 1) |
99 | /* Mask which covers at least up to SOCK_MASK-1. The | ||
100 | * remaining bits are used as flags. */ | ||
101 | #define SOCK_TYPE_MASK 0xf | ||
102 | |||
103 | /* Flags for socket, socketpair, paccept */ | ||
104 | #define SOCK_CLOEXEC O_CLOEXEC | ||
105 | #ifndef SOCK_NONBLOCK | ||
106 | #define SOCK_NONBLOCK O_NONBLOCK | ||
107 | #endif | ||
97 | 108 | ||
98 | #endif /* ARCH_HAS_SOCKET_TYPES */ | 109 | #endif /* ARCH_HAS_SOCKET_TYPES */ |
99 | 110 | ||
@@ -106,23 +117,23 @@ enum sock_shutdown_cmd { | |||
106 | /** | 117 | /** |
107 | * struct socket - general BSD socket | 118 | * struct socket - general BSD socket |
108 | * @state: socket state (%SS_CONNECTED, etc) | 119 | * @state: socket state (%SS_CONNECTED, etc) |
120 | * @type: socket type (%SOCK_STREAM, etc) | ||
109 | * @flags: socket flags (%SOCK_ASYNC_NOSPACE, etc) | 121 | * @flags: socket flags (%SOCK_ASYNC_NOSPACE, etc) |
110 | * @ops: protocol specific socket operations | 122 | * @ops: protocol specific socket operations |
111 | * @fasync_list: Asynchronous wake up list | 123 | * @fasync_list: Asynchronous wake up list |
112 | * @file: File back pointer for gc | 124 | * @file: File back pointer for gc |
113 | * @sk: internal networking protocol agnostic socket representation | 125 | * @sk: internal networking protocol agnostic socket representation |
114 | * @wait: wait queue for several uses | 126 | * @wait: wait queue for several uses |
115 | * @type: socket type (%SOCK_STREAM, etc) | ||
116 | */ | 127 | */ |
117 | struct socket { | 128 | struct socket { |
118 | socket_state state; | 129 | socket_state state; |
130 | short type; | ||
119 | unsigned long flags; | 131 | unsigned long flags; |
120 | const struct proto_ops *ops; | 132 | const struct proto_ops *ops; |
121 | struct fasync_struct *fasync_list; | 133 | struct fasync_struct *fasync_list; |
122 | struct file *file; | 134 | struct file *file; |
123 | struct sock *sk; | 135 | struct sock *sk; |
124 | wait_queue_head_t wait; | 136 | wait_queue_head_t wait; |
125 | short type; | ||
126 | }; | 137 | }; |
127 | 138 | ||
128 | struct vm_area_struct; | 139 | struct vm_area_struct; |
@@ -208,10 +219,12 @@ extern int sock_sendmsg(struct socket *sock, struct msghdr *msg, | |||
208 | size_t len); | 219 | size_t len); |
209 | extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, | 220 | extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, |
210 | size_t size, int flags); | 221 | size_t size, int flags); |
211 | extern int sock_map_fd(struct socket *sock); | 222 | extern int sock_map_fd(struct socket *sock, int flags); |
212 | extern struct socket *sockfd_lookup(int fd, int *err); | 223 | extern struct socket *sockfd_lookup(int fd, int *err); |
213 | #define sockfd_put(sock) fput(sock->file) | 224 | #define sockfd_put(sock) fput(sock->file) |
214 | extern int net_ratelimit(void); | 225 | extern int net_ratelimit(void); |
226 | extern long do_accept(int fd, struct sockaddr __user *upeer_sockaddr, | ||
227 | int __user *upeer_addrlen, int flags); | ||
215 | 228 | ||
216 | #define net_random() random32() | 229 | #define net_random() random32() |
217 | #define net_srandom(seed) srandom32((__force u32)seed) | 230 | #define net_srandom(seed) srandom32((__force u32)seed) |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 25f87102ab66..b4d056ceab96 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -118,14 +118,6 @@ struct wireless_dev; | |||
118 | 118 | ||
119 | #endif /* __KERNEL__ */ | 119 | #endif /* __KERNEL__ */ |
120 | 120 | ||
121 | struct net_device_subqueue | ||
122 | { | ||
123 | /* Give a control state for each queue. This struct may contain | ||
124 | * per-queue locks in the future. | ||
125 | */ | ||
126 | unsigned long state; | ||
127 | }; | ||
128 | |||
129 | /* | 121 | /* |
130 | * Network device statistics. Akin to the 2.0 ether stats but | 122 | * Network device statistics. Akin to the 2.0 ether stats but |
131 | * with byte counters. | 123 | * with byte counters. |
@@ -281,14 +273,11 @@ struct header_ops { | |||
281 | 273 | ||
282 | enum netdev_state_t | 274 | enum netdev_state_t |
283 | { | 275 | { |
284 | __LINK_STATE_XOFF=0, | ||
285 | __LINK_STATE_START, | 276 | __LINK_STATE_START, |
286 | __LINK_STATE_PRESENT, | 277 | __LINK_STATE_PRESENT, |
287 | __LINK_STATE_SCHED, | ||
288 | __LINK_STATE_NOCARRIER, | 278 | __LINK_STATE_NOCARRIER, |
289 | __LINK_STATE_LINKWATCH_PENDING, | 279 | __LINK_STATE_LINKWATCH_PENDING, |
290 | __LINK_STATE_DORMANT, | 280 | __LINK_STATE_DORMANT, |
291 | __LINK_STATE_QDISC_RUNNING, | ||
292 | }; | 281 | }; |
293 | 282 | ||
294 | 283 | ||
@@ -448,6 +437,20 @@ static inline void napi_synchronize(const struct napi_struct *n) | |||
448 | # define napi_synchronize(n) barrier() | 437 | # define napi_synchronize(n) barrier() |
449 | #endif | 438 | #endif |
450 | 439 | ||
440 | enum netdev_queue_state_t | ||
441 | { | ||
442 | __QUEUE_STATE_XOFF, | ||
443 | }; | ||
444 | |||
445 | struct netdev_queue { | ||
446 | struct net_device *dev; | ||
447 | struct Qdisc *qdisc; | ||
448 | unsigned long state; | ||
449 | spinlock_t _xmit_lock; | ||
450 | int xmit_lock_owner; | ||
451 | struct Qdisc *qdisc_sleeping; | ||
452 | } ____cacheline_aligned_in_smp; | ||
453 | |||
451 | /* | 454 | /* |
452 | * The DEVICE structure. | 455 | * The DEVICE structure. |
453 | * Actually, this whole structure is a big mistake. It mixes I/O | 456 | * Actually, this whole structure is a big mistake. It mixes I/O |
@@ -516,7 +519,6 @@ struct net_device | |||
516 | #define NETIF_F_LLTX 4096 /* LockLess TX - deprecated. Please */ | 519 | #define NETIF_F_LLTX 4096 /* LockLess TX - deprecated. Please */ |
517 | /* do not use LLTX in new drivers */ | 520 | /* do not use LLTX in new drivers */ |
518 | #define NETIF_F_NETNS_LOCAL 8192 /* Does not change network namespaces */ | 521 | #define NETIF_F_NETNS_LOCAL 8192 /* Does not change network namespaces */ |
519 | #define NETIF_F_MULTI_QUEUE 16384 /* Has multiple TX/RX queues */ | ||
520 | #define NETIF_F_LRO 32768 /* large receive offload */ | 522 | #define NETIF_F_LRO 32768 /* large receive offload */ |
521 | 523 | ||
522 | /* Segmentation offload features */ | 524 | /* Segmentation offload features */ |
@@ -537,8 +539,6 @@ struct net_device | |||
537 | #define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM) | 539 | #define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM) |
538 | #define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM) | 540 | #define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM) |
539 | 541 | ||
540 | struct net_device *next_sched; | ||
541 | |||
542 | /* Interface index. Unique device identifier */ | 542 | /* Interface index. Unique device identifier */ |
543 | int ifindex; | 543 | int ifindex; |
544 | int iflink; | 544 | int iflink; |
@@ -594,13 +594,14 @@ struct net_device | |||
594 | unsigned char addr_len; /* hardware address length */ | 594 | unsigned char addr_len; /* hardware address length */ |
595 | unsigned short dev_id; /* for shared network cards */ | 595 | unsigned short dev_id; /* for shared network cards */ |
596 | 596 | ||
597 | spinlock_t addr_list_lock; | ||
597 | struct dev_addr_list *uc_list; /* Secondary unicast mac addresses */ | 598 | struct dev_addr_list *uc_list; /* Secondary unicast mac addresses */ |
598 | int uc_count; /* Number of installed ucasts */ | 599 | int uc_count; /* Number of installed ucasts */ |
599 | int uc_promisc; | 600 | int uc_promisc; |
600 | struct dev_addr_list *mc_list; /* Multicast mac addresses */ | 601 | struct dev_addr_list *mc_list; /* Multicast mac addresses */ |
601 | int mc_count; /* Number of installed mcasts */ | 602 | int mc_count; /* Number of installed mcasts */ |
602 | int promiscuity; | 603 | unsigned int promiscuity; |
603 | int allmulti; | 604 | unsigned int allmulti; |
604 | 605 | ||
605 | 606 | ||
606 | /* Protocol specific pointers */ | 607 | /* Protocol specific pointers */ |
@@ -624,32 +625,21 @@ struct net_device | |||
624 | 625 | ||
625 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | 626 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ |
626 | 627 | ||
627 | /* ingress path synchronizer */ | 628 | struct netdev_queue rx_queue; |
628 | spinlock_t ingress_lock; | ||
629 | struct Qdisc *qdisc_ingress; | ||
630 | 629 | ||
631 | /* | 630 | struct netdev_queue *_tx ____cacheline_aligned_in_smp; |
632 | * Cache line mostly used on queue transmit path (qdisc) | 631 | |
633 | */ | 632 | /* Number of TX queues allocated at alloc_netdev_mq() time */ |
634 | /* device queue lock */ | 633 | unsigned int num_tx_queues; |
635 | spinlock_t queue_lock ____cacheline_aligned_in_smp; | 634 | |
636 | struct Qdisc *qdisc; | 635 | /* Number of TX queues currently active in device */ |
637 | struct Qdisc *qdisc_sleeping; | 636 | unsigned int real_num_tx_queues; |
638 | struct list_head qdisc_list; | ||
639 | unsigned long tx_queue_len; /* Max frames per queue allowed */ | ||
640 | 637 | ||
641 | /* Partially transmitted GSO packet. */ | 638 | unsigned long tx_queue_len; /* Max frames per queue allowed */ |
642 | struct sk_buff *gso_skb; | ||
643 | 639 | ||
644 | /* | 640 | /* |
645 | * One part is mostly used on xmit path (device) | 641 | * One part is mostly used on xmit path (device) |
646 | */ | 642 | */ |
647 | /* hard_start_xmit synchronizer */ | ||
648 | spinlock_t _xmit_lock ____cacheline_aligned_in_smp; | ||
649 | /* cpu id of processor entered to hard_start_xmit or -1, | ||
650 | if nobody entered there. | ||
651 | */ | ||
652 | int xmit_lock_owner; | ||
653 | void *priv; /* pointer to private data */ | 643 | void *priv; /* pointer to private data */ |
654 | int (*hard_start_xmit) (struct sk_buff *skb, | 644 | int (*hard_start_xmit) (struct sk_buff *skb, |
655 | struct net_device *dev); | 645 | struct net_device *dev); |
@@ -728,6 +718,9 @@ struct net_device | |||
728 | void (*poll_controller)(struct net_device *dev); | 718 | void (*poll_controller)(struct net_device *dev); |
729 | #endif | 719 | #endif |
730 | 720 | ||
721 | u16 (*select_queue)(struct net_device *dev, | ||
722 | struct sk_buff *skb); | ||
723 | |||
731 | #ifdef CONFIG_NET_NS | 724 | #ifdef CONFIG_NET_NS |
732 | /* Network namespace this network device is inside */ | 725 | /* Network namespace this network device is inside */ |
733 | struct net *nd_net; | 726 | struct net *nd_net; |
@@ -740,6 +733,8 @@ struct net_device | |||
740 | struct net_bridge_port *br_port; | 733 | struct net_bridge_port *br_port; |
741 | /* macvlan */ | 734 | /* macvlan */ |
742 | struct macvlan_port *macvlan_port; | 735 | struct macvlan_port *macvlan_port; |
736 | /* GARP */ | ||
737 | struct garp_port *garp_port; | ||
743 | 738 | ||
744 | /* class/net/name entry */ | 739 | /* class/net/name entry */ |
745 | struct device dev; | 740 | struct device dev; |
@@ -755,16 +750,31 @@ struct net_device | |||
755 | /* for setting kernel sock attribute on TCP connection setup */ | 750 | /* for setting kernel sock attribute on TCP connection setup */ |
756 | #define GSO_MAX_SIZE 65536 | 751 | #define GSO_MAX_SIZE 65536 |
757 | unsigned int gso_max_size; | 752 | unsigned int gso_max_size; |
758 | |||
759 | /* The TX queue control structures */ | ||
760 | unsigned int egress_subqueue_count; | ||
761 | struct net_device_subqueue egress_subqueue[1]; | ||
762 | }; | 753 | }; |
763 | #define to_net_dev(d) container_of(d, struct net_device, dev) | 754 | #define to_net_dev(d) container_of(d, struct net_device, dev) |
764 | 755 | ||
765 | #define NETDEV_ALIGN 32 | 756 | #define NETDEV_ALIGN 32 |
766 | #define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) | 757 | #define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) |
767 | 758 | ||
759 | static inline | ||
760 | struct netdev_queue *netdev_get_tx_queue(const struct net_device *dev, | ||
761 | unsigned int index) | ||
762 | { | ||
763 | return &dev->_tx[index]; | ||
764 | } | ||
765 | |||
766 | static inline void netdev_for_each_tx_queue(struct net_device *dev, | ||
767 | void (*f)(struct net_device *, | ||
768 | struct netdev_queue *, | ||
769 | void *), | ||
770 | void *arg) | ||
771 | { | ||
772 | unsigned int i; | ||
773 | |||
774 | for (i = 0; i < dev->num_tx_queues; i++) | ||
775 | f(dev, &dev->_tx[i], arg); | ||
776 | } | ||
777 | |||
768 | /* | 778 | /* |
769 | * Net namespace inlines | 779 | * Net namespace inlines |
770 | */ | 780 | */ |
@@ -795,7 +805,9 @@ void dev_net_set(struct net_device *dev, struct net *net) | |||
795 | */ | 805 | */ |
796 | static inline void *netdev_priv(const struct net_device *dev) | 806 | static inline void *netdev_priv(const struct net_device *dev) |
797 | { | 807 | { |
798 | return dev->priv; | 808 | return (char *)dev + ((sizeof(struct net_device) |
809 | + NETDEV_ALIGN_CONST) | ||
810 | & ~NETDEV_ALIGN_CONST); | ||
799 | } | 811 | } |
800 | 812 | ||
801 | /* Set the sysfs physical device reference for the network logical device | 813 | /* Set the sysfs physical device reference for the network logical device |
@@ -830,6 +842,19 @@ static inline void netif_napi_add(struct net_device *dev, | |||
830 | set_bit(NAPI_STATE_SCHED, &napi->state); | 842 | set_bit(NAPI_STATE_SCHED, &napi->state); |
831 | } | 843 | } |
832 | 844 | ||
845 | /** | ||
846 | * netif_napi_del - remove a napi context | ||
847 | * @napi: napi context | ||
848 | * | ||
849 | * netif_napi_del() removes a napi context from the network device napi list | ||
850 | */ | ||
851 | static inline void netif_napi_del(struct napi_struct *napi) | ||
852 | { | ||
853 | #ifdef CONFIG_NETPOLL | ||
854 | list_del(&napi->dev_list); | ||
855 | #endif | ||
856 | } | ||
857 | |||
833 | struct packet_type { | 858 | struct packet_type { |
834 | __be16 type; /* This is really htons(ether_type). */ | 859 | __be16 type; /* This is really htons(ether_type). */ |
835 | struct net_device *dev; /* NULL is wildcarded here */ | 860 | struct net_device *dev; /* NULL is wildcarded here */ |
@@ -890,6 +915,7 @@ extern struct net_device *__dev_get_by_name(struct net *net, const char *name); | |||
890 | extern int dev_alloc_name(struct net_device *dev, const char *name); | 915 | extern int dev_alloc_name(struct net_device *dev, const char *name); |
891 | extern int dev_open(struct net_device *dev); | 916 | extern int dev_open(struct net_device *dev); |
892 | extern int dev_close(struct net_device *dev); | 917 | extern int dev_close(struct net_device *dev); |
918 | extern void dev_disable_lro(struct net_device *dev); | ||
893 | extern int dev_queue_xmit(struct sk_buff *skb); | 919 | extern int dev_queue_xmit(struct sk_buff *skb); |
894 | extern int register_netdevice(struct net_device *dev); | 920 | extern int register_netdevice(struct net_device *dev); |
895 | extern void unregister_netdevice(struct net_device *dev); | 921 | extern void unregister_netdevice(struct net_device *dev); |
@@ -939,7 +965,7 @@ static inline int unregister_gifconf(unsigned int family) | |||
939 | */ | 965 | */ |
940 | struct softnet_data | 966 | struct softnet_data |
941 | { | 967 | { |
942 | struct net_device *output_queue; | 968 | struct Qdisc *output_queue; |
943 | struct sk_buff_head input_pkt_queue; | 969 | struct sk_buff_head input_pkt_queue; |
944 | struct list_head poll_list; | 970 | struct list_head poll_list; |
945 | struct sk_buff *completion_queue; | 971 | struct sk_buff *completion_queue; |
@@ -954,12 +980,25 @@ DECLARE_PER_CPU(struct softnet_data,softnet_data); | |||
954 | 980 | ||
955 | #define HAVE_NETIF_QUEUE | 981 | #define HAVE_NETIF_QUEUE |
956 | 982 | ||
957 | extern void __netif_schedule(struct net_device *dev); | 983 | extern void __netif_schedule(struct Qdisc *q); |
958 | 984 | ||
959 | static inline void netif_schedule(struct net_device *dev) | 985 | static inline void netif_schedule_queue(struct netdev_queue *txq) |
960 | { | 986 | { |
961 | if (!test_bit(__LINK_STATE_XOFF, &dev->state)) | 987 | if (!test_bit(__QUEUE_STATE_XOFF, &txq->state)) |
962 | __netif_schedule(dev); | 988 | __netif_schedule(txq->qdisc); |
989 | } | ||
990 | |||
991 | static inline void netif_tx_schedule_all(struct net_device *dev) | ||
992 | { | ||
993 | unsigned int i; | ||
994 | |||
995 | for (i = 0; i < dev->num_tx_queues; i++) | ||
996 | netif_schedule_queue(netdev_get_tx_queue(dev, i)); | ||
997 | } | ||
998 | |||
999 | static inline void netif_tx_start_queue(struct netdev_queue *dev_queue) | ||
1000 | { | ||
1001 | clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state); | ||
963 | } | 1002 | } |
964 | 1003 | ||
965 | /** | 1004 | /** |
@@ -970,7 +1009,29 @@ static inline void netif_schedule(struct net_device *dev) | |||
970 | */ | 1009 | */ |
971 | static inline void netif_start_queue(struct net_device *dev) | 1010 | static inline void netif_start_queue(struct net_device *dev) |
972 | { | 1011 | { |
973 | clear_bit(__LINK_STATE_XOFF, &dev->state); | 1012 | netif_tx_start_queue(netdev_get_tx_queue(dev, 0)); |
1013 | } | ||
1014 | |||
1015 | static inline void netif_tx_start_all_queues(struct net_device *dev) | ||
1016 | { | ||
1017 | unsigned int i; | ||
1018 | |||
1019 | for (i = 0; i < dev->num_tx_queues; i++) { | ||
1020 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | ||
1021 | netif_tx_start_queue(txq); | ||
1022 | } | ||
1023 | } | ||
1024 | |||
1025 | static inline void netif_tx_wake_queue(struct netdev_queue *dev_queue) | ||
1026 | { | ||
1027 | #ifdef CONFIG_NETPOLL_TRAP | ||
1028 | if (netpoll_trap()) { | ||
1029 | clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state); | ||
1030 | return; | ||
1031 | } | ||
1032 | #endif | ||
1033 | if (test_and_clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state)) | ||
1034 | __netif_schedule(dev_queue->qdisc); | ||
974 | } | 1035 | } |
975 | 1036 | ||
976 | /** | 1037 | /** |
@@ -982,14 +1043,22 @@ static inline void netif_start_queue(struct net_device *dev) | |||
982 | */ | 1043 | */ |
983 | static inline void netif_wake_queue(struct net_device *dev) | 1044 | static inline void netif_wake_queue(struct net_device *dev) |
984 | { | 1045 | { |
985 | #ifdef CONFIG_NETPOLL_TRAP | 1046 | netif_tx_wake_queue(netdev_get_tx_queue(dev, 0)); |
986 | if (netpoll_trap()) { | 1047 | } |
987 | clear_bit(__LINK_STATE_XOFF, &dev->state); | 1048 | |
988 | return; | 1049 | static inline void netif_tx_wake_all_queues(struct net_device *dev) |
1050 | { | ||
1051 | unsigned int i; | ||
1052 | |||
1053 | for (i = 0; i < dev->num_tx_queues; i++) { | ||
1054 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | ||
1055 | netif_tx_wake_queue(txq); | ||
989 | } | 1056 | } |
990 | #endif | 1057 | } |
991 | if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state)) | 1058 | |
992 | __netif_schedule(dev); | 1059 | static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue) |
1060 | { | ||
1061 | set_bit(__QUEUE_STATE_XOFF, &dev_queue->state); | ||
993 | } | 1062 | } |
994 | 1063 | ||
995 | /** | 1064 | /** |
@@ -1001,7 +1070,22 @@ static inline void netif_wake_queue(struct net_device *dev) | |||
1001 | */ | 1070 | */ |
1002 | static inline void netif_stop_queue(struct net_device *dev) | 1071 | static inline void netif_stop_queue(struct net_device *dev) |
1003 | { | 1072 | { |
1004 | set_bit(__LINK_STATE_XOFF, &dev->state); | 1073 | netif_tx_stop_queue(netdev_get_tx_queue(dev, 0)); |
1074 | } | ||
1075 | |||
1076 | static inline void netif_tx_stop_all_queues(struct net_device *dev) | ||
1077 | { | ||
1078 | unsigned int i; | ||
1079 | |||
1080 | for (i = 0; i < dev->num_tx_queues; i++) { | ||
1081 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | ||
1082 | netif_tx_stop_queue(txq); | ||
1083 | } | ||
1084 | } | ||
1085 | |||
1086 | static inline int netif_tx_queue_stopped(const struct netdev_queue *dev_queue) | ||
1087 | { | ||
1088 | return test_bit(__QUEUE_STATE_XOFF, &dev_queue->state); | ||
1005 | } | 1089 | } |
1006 | 1090 | ||
1007 | /** | 1091 | /** |
@@ -1012,7 +1096,7 @@ static inline void netif_stop_queue(struct net_device *dev) | |||
1012 | */ | 1096 | */ |
1013 | static inline int netif_queue_stopped(const struct net_device *dev) | 1097 | static inline int netif_queue_stopped(const struct net_device *dev) |
1014 | { | 1098 | { |
1015 | return test_bit(__LINK_STATE_XOFF, &dev->state); | 1099 | return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); |
1016 | } | 1100 | } |
1017 | 1101 | ||
1018 | /** | 1102 | /** |
@@ -1042,9 +1126,8 @@ static inline int netif_running(const struct net_device *dev) | |||
1042 | */ | 1126 | */ |
1043 | static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index) | 1127 | static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index) |
1044 | { | 1128 | { |
1045 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | 1129 | struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); |
1046 | clear_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state); | 1130 | clear_bit(__QUEUE_STATE_XOFF, &txq->state); |
1047 | #endif | ||
1048 | } | 1131 | } |
1049 | 1132 | ||
1050 | /** | 1133 | /** |
@@ -1056,13 +1139,12 @@ static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index) | |||
1056 | */ | 1139 | */ |
1057 | static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index) | 1140 | static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index) |
1058 | { | 1141 | { |
1059 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | 1142 | struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); |
1060 | #ifdef CONFIG_NETPOLL_TRAP | 1143 | #ifdef CONFIG_NETPOLL_TRAP |
1061 | if (netpoll_trap()) | 1144 | if (netpoll_trap()) |
1062 | return; | 1145 | return; |
1063 | #endif | 1146 | #endif |
1064 | set_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state); | 1147 | set_bit(__QUEUE_STATE_XOFF, &txq->state); |
1065 | #endif | ||
1066 | } | 1148 | } |
1067 | 1149 | ||
1068 | /** | 1150 | /** |
@@ -1075,12 +1157,8 @@ static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index) | |||
1075 | static inline int __netif_subqueue_stopped(const struct net_device *dev, | 1157 | static inline int __netif_subqueue_stopped(const struct net_device *dev, |
1076 | u16 queue_index) | 1158 | u16 queue_index) |
1077 | { | 1159 | { |
1078 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | 1160 | struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); |
1079 | return test_bit(__LINK_STATE_XOFF, | 1161 | return test_bit(__QUEUE_STATE_XOFF, &txq->state); |
1080 | &dev->egress_subqueue[queue_index].state); | ||
1081 | #else | ||
1082 | return 0; | ||
1083 | #endif | ||
1084 | } | 1162 | } |
1085 | 1163 | ||
1086 | static inline int netif_subqueue_stopped(const struct net_device *dev, | 1164 | static inline int netif_subqueue_stopped(const struct net_device *dev, |
@@ -1098,15 +1176,13 @@ static inline int netif_subqueue_stopped(const struct net_device *dev, | |||
1098 | */ | 1176 | */ |
1099 | static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) | 1177 | static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) |
1100 | { | 1178 | { |
1101 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | 1179 | struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); |
1102 | #ifdef CONFIG_NETPOLL_TRAP | 1180 | #ifdef CONFIG_NETPOLL_TRAP |
1103 | if (netpoll_trap()) | 1181 | if (netpoll_trap()) |
1104 | return; | 1182 | return; |
1105 | #endif | 1183 | #endif |
1106 | if (test_and_clear_bit(__LINK_STATE_XOFF, | 1184 | if (test_and_clear_bit(__QUEUE_STATE_XOFF, &txq->state)) |
1107 | &dev->egress_subqueue[queue_index].state)) | 1185 | __netif_schedule(txq->qdisc); |
1108 | __netif_schedule(dev); | ||
1109 | #endif | ||
1110 | } | 1186 | } |
1111 | 1187 | ||
1112 | /** | 1188 | /** |
@@ -1114,15 +1190,10 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) | |||
1114 | * @dev: network device | 1190 | * @dev: network device |
1115 | * | 1191 | * |
1116 | * Check if device has multiple transmit queues | 1192 | * Check if device has multiple transmit queues |
1117 | * Always falls if NETDEVICE_MULTIQUEUE is not configured | ||
1118 | */ | 1193 | */ |
1119 | static inline int netif_is_multiqueue(const struct net_device *dev) | 1194 | static inline int netif_is_multiqueue(const struct net_device *dev) |
1120 | { | 1195 | { |
1121 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | 1196 | return (dev->num_tx_queues > 1); |
1122 | return (!!(NETIF_F_MULTI_QUEUE & dev->features)); | ||
1123 | #else | ||
1124 | return 0; | ||
1125 | #endif | ||
1126 | } | 1197 | } |
1127 | 1198 | ||
1128 | /* Use this variant when it is known for sure that it | 1199 | /* Use this variant when it is known for sure that it |
@@ -1142,6 +1213,7 @@ extern int netif_rx(struct sk_buff *skb); | |||
1142 | extern int netif_rx_ni(struct sk_buff *skb); | 1213 | extern int netif_rx_ni(struct sk_buff *skb); |
1143 | #define HAVE_NETIF_RECEIVE_SKB 1 | 1214 | #define HAVE_NETIF_RECEIVE_SKB 1 |
1144 | extern int netif_receive_skb(struct sk_buff *skb); | 1215 | extern int netif_receive_skb(struct sk_buff *skb); |
1216 | extern void netif_nit_deliver(struct sk_buff *skb); | ||
1145 | extern int dev_valid_name(const char *name); | 1217 | extern int dev_valid_name(const char *name); |
1146 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | 1218 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); |
1147 | extern int dev_ethtool(struct net *net, struct ifreq *); | 1219 | extern int dev_ethtool(struct net *net, struct ifreq *); |
@@ -1154,7 +1226,8 @@ extern int dev_set_mtu(struct net_device *, int); | |||
1154 | extern int dev_set_mac_address(struct net_device *, | 1226 | extern int dev_set_mac_address(struct net_device *, |
1155 | struct sockaddr *); | 1227 | struct sockaddr *); |
1156 | extern int dev_hard_start_xmit(struct sk_buff *skb, | 1228 | extern int dev_hard_start_xmit(struct sk_buff *skb, |
1157 | struct net_device *dev); | 1229 | struct net_device *dev, |
1230 | struct netdev_queue *txq); | ||
1158 | 1231 | ||
1159 | extern int netdev_budget; | 1232 | extern int netdev_budget; |
1160 | 1233 | ||
@@ -1390,6 +1463,18 @@ static inline void netif_rx_complete(struct net_device *dev, | |||
1390 | local_irq_restore(flags); | 1463 | local_irq_restore(flags); |
1391 | } | 1464 | } |
1392 | 1465 | ||
1466 | static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu) | ||
1467 | { | ||
1468 | spin_lock(&txq->_xmit_lock); | ||
1469 | txq->xmit_lock_owner = cpu; | ||
1470 | } | ||
1471 | |||
1472 | static inline void __netif_tx_lock_bh(struct netdev_queue *txq) | ||
1473 | { | ||
1474 | spin_lock_bh(&txq->_xmit_lock); | ||
1475 | txq->xmit_lock_owner = smp_processor_id(); | ||
1476 | } | ||
1477 | |||
1393 | /** | 1478 | /** |
1394 | * netif_tx_lock - grab network device transmit lock | 1479 | * netif_tx_lock - grab network device transmit lock |
1395 | * @dev: network device | 1480 | * @dev: network device |
@@ -1397,62 +1482,109 @@ static inline void netif_rx_complete(struct net_device *dev, | |||
1397 | * | 1482 | * |
1398 | * Get network device transmit lock | 1483 | * Get network device transmit lock |
1399 | */ | 1484 | */ |
1400 | static inline void __netif_tx_lock(struct net_device *dev, int cpu) | ||
1401 | { | ||
1402 | spin_lock(&dev->_xmit_lock); | ||
1403 | dev->xmit_lock_owner = cpu; | ||
1404 | } | ||
1405 | |||
1406 | static inline void netif_tx_lock(struct net_device *dev) | 1485 | static inline void netif_tx_lock(struct net_device *dev) |
1407 | { | 1486 | { |
1408 | __netif_tx_lock(dev, smp_processor_id()); | 1487 | int cpu = smp_processor_id(); |
1488 | unsigned int i; | ||
1489 | |||
1490 | for (i = 0; i < dev->num_tx_queues; i++) { | ||
1491 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | ||
1492 | __netif_tx_lock(txq, cpu); | ||
1493 | } | ||
1409 | } | 1494 | } |
1410 | 1495 | ||
1411 | static inline void netif_tx_lock_bh(struct net_device *dev) | 1496 | static inline void netif_tx_lock_bh(struct net_device *dev) |
1412 | { | 1497 | { |
1413 | spin_lock_bh(&dev->_xmit_lock); | 1498 | local_bh_disable(); |
1414 | dev->xmit_lock_owner = smp_processor_id(); | 1499 | netif_tx_lock(dev); |
1415 | } | 1500 | } |
1416 | 1501 | ||
1417 | static inline int netif_tx_trylock(struct net_device *dev) | 1502 | static inline int __netif_tx_trylock(struct netdev_queue *txq) |
1418 | { | 1503 | { |
1419 | int ok = spin_trylock(&dev->_xmit_lock); | 1504 | int ok = spin_trylock(&txq->_xmit_lock); |
1420 | if (likely(ok)) | 1505 | if (likely(ok)) |
1421 | dev->xmit_lock_owner = smp_processor_id(); | 1506 | txq->xmit_lock_owner = smp_processor_id(); |
1422 | return ok; | 1507 | return ok; |
1423 | } | 1508 | } |
1424 | 1509 | ||
1510 | static inline int netif_tx_trylock(struct net_device *dev) | ||
1511 | { | ||
1512 | return __netif_tx_trylock(netdev_get_tx_queue(dev, 0)); | ||
1513 | } | ||
1514 | |||
1515 | static inline void __netif_tx_unlock(struct netdev_queue *txq) | ||
1516 | { | ||
1517 | txq->xmit_lock_owner = -1; | ||
1518 | spin_unlock(&txq->_xmit_lock); | ||
1519 | } | ||
1520 | |||
1521 | static inline void __netif_tx_unlock_bh(struct netdev_queue *txq) | ||
1522 | { | ||
1523 | txq->xmit_lock_owner = -1; | ||
1524 | spin_unlock_bh(&txq->_xmit_lock); | ||
1525 | } | ||
1526 | |||
1425 | static inline void netif_tx_unlock(struct net_device *dev) | 1527 | static inline void netif_tx_unlock(struct net_device *dev) |
1426 | { | 1528 | { |
1427 | dev->xmit_lock_owner = -1; | 1529 | unsigned int i; |
1428 | spin_unlock(&dev->_xmit_lock); | 1530 | |
1531 | for (i = 0; i < dev->num_tx_queues; i++) { | ||
1532 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | ||
1533 | __netif_tx_unlock(txq); | ||
1534 | } | ||
1535 | |||
1429 | } | 1536 | } |
1430 | 1537 | ||
1431 | static inline void netif_tx_unlock_bh(struct net_device *dev) | 1538 | static inline void netif_tx_unlock_bh(struct net_device *dev) |
1432 | { | 1539 | { |
1433 | dev->xmit_lock_owner = -1; | 1540 | netif_tx_unlock(dev); |
1434 | spin_unlock_bh(&dev->_xmit_lock); | 1541 | local_bh_enable(); |
1435 | } | 1542 | } |
1436 | 1543 | ||
1437 | #define HARD_TX_LOCK(dev, cpu) { \ | 1544 | #define HARD_TX_LOCK(dev, txq, cpu) { \ |
1438 | if ((dev->features & NETIF_F_LLTX) == 0) { \ | 1545 | if ((dev->features & NETIF_F_LLTX) == 0) { \ |
1439 | __netif_tx_lock(dev, cpu); \ | 1546 | __netif_tx_lock(txq, cpu); \ |
1440 | } \ | 1547 | } \ |
1441 | } | 1548 | } |
1442 | 1549 | ||
1443 | #define HARD_TX_UNLOCK(dev) { \ | 1550 | #define HARD_TX_UNLOCK(dev, txq) { \ |
1444 | if ((dev->features & NETIF_F_LLTX) == 0) { \ | 1551 | if ((dev->features & NETIF_F_LLTX) == 0) { \ |
1445 | netif_tx_unlock(dev); \ | 1552 | __netif_tx_unlock(txq); \ |
1446 | } \ | 1553 | } \ |
1447 | } | 1554 | } |
1448 | 1555 | ||
1449 | static inline void netif_tx_disable(struct net_device *dev) | 1556 | static inline void netif_tx_disable(struct net_device *dev) |
1450 | { | 1557 | { |
1558 | unsigned int i; | ||
1559 | |||
1451 | netif_tx_lock_bh(dev); | 1560 | netif_tx_lock_bh(dev); |
1452 | netif_stop_queue(dev); | 1561 | for (i = 0; i < dev->num_tx_queues; i++) { |
1562 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | ||
1563 | netif_tx_stop_queue(txq); | ||
1564 | } | ||
1453 | netif_tx_unlock_bh(dev); | 1565 | netif_tx_unlock_bh(dev); |
1454 | } | 1566 | } |
1455 | 1567 | ||
1568 | static inline void netif_addr_lock(struct net_device *dev) | ||
1569 | { | ||
1570 | spin_lock(&dev->addr_list_lock); | ||
1571 | } | ||
1572 | |||
1573 | static inline void netif_addr_lock_bh(struct net_device *dev) | ||
1574 | { | ||
1575 | spin_lock_bh(&dev->addr_list_lock); | ||
1576 | } | ||
1577 | |||
1578 | static inline void netif_addr_unlock(struct net_device *dev) | ||
1579 | { | ||
1580 | spin_unlock(&dev->addr_list_lock); | ||
1581 | } | ||
1582 | |||
1583 | static inline void netif_addr_unlock_bh(struct net_device *dev) | ||
1584 | { | ||
1585 | spin_unlock_bh(&dev->addr_list_lock); | ||
1586 | } | ||
1587 | |||
1456 | /* These functions live elsewhere (drivers/net/net_init.c, but related) */ | 1588 | /* These functions live elsewhere (drivers/net/net_init.c, but related) */ |
1457 | 1589 | ||
1458 | extern void ether_setup(struct net_device *dev); | 1590 | extern void ether_setup(struct net_device *dev); |
@@ -1480,9 +1612,10 @@ extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *ad | |||
1480 | extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); | 1612 | extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); |
1481 | extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count); | 1613 | extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count); |
1482 | extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count); | 1614 | extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count); |
1483 | extern void dev_set_promiscuity(struct net_device *dev, int inc); | 1615 | extern int dev_set_promiscuity(struct net_device *dev, int inc); |
1484 | extern void dev_set_allmulti(struct net_device *dev, int inc); | 1616 | extern int dev_set_allmulti(struct net_device *dev, int inc); |
1485 | extern void netdev_state_change(struct net_device *dev); | 1617 | extern void netdev_state_change(struct net_device *dev); |
1618 | extern void netdev_bonding_change(struct net_device *dev); | ||
1486 | extern void netdev_features_change(struct net_device *dev); | 1619 | extern void netdev_features_change(struct net_device *dev); |
1487 | /* Load a device via the kmod */ | 1620 | /* Load a device via the kmod */ |
1488 | extern void dev_load(struct net *net, const char *name); | 1621 | extern void dev_load(struct net *net, const char *name); |
@@ -1509,6 +1642,11 @@ extern void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos); | |||
1509 | extern void dev_seq_stop(struct seq_file *seq, void *v); | 1642 | extern void dev_seq_stop(struct seq_file *seq, void *v); |
1510 | #endif | 1643 | #endif |
1511 | 1644 | ||
1645 | extern int netdev_class_create_file(struct class_attribute *class_attr); | ||
1646 | extern void netdev_class_remove_file(struct class_attribute *class_attr); | ||
1647 | |||
1648 | extern char *netdev_drivername(struct net_device *dev, char *buffer, int len); | ||
1649 | |||
1512 | extern void linkwatch_run_queue(void); | 1650 | extern void linkwatch_run_queue(void); |
1513 | 1651 | ||
1514 | extern int netdev_compute_features(unsigned long all, unsigned long one); | 1652 | extern int netdev_compute_features(unsigned long all, unsigned long one); |
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index bad1eb760f61..885cbe282260 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
@@ -122,7 +122,7 @@ enum ip_conntrack_events | |||
122 | IPCT_NATINFO_BIT = 10, | 122 | IPCT_NATINFO_BIT = 10, |
123 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), | 123 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), |
124 | 124 | ||
125 | /* Counter highest bit has been set */ | 125 | /* Counter highest bit has been set, unused */ |
126 | IPCT_COUNTER_FILLING_BIT = 11, | 126 | IPCT_COUNTER_FILLING_BIT = 11, |
127 | IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT), | 127 | IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT), |
128 | 128 | ||
@@ -145,12 +145,6 @@ enum ip_conntrack_expect_events { | |||
145 | }; | 145 | }; |
146 | 146 | ||
147 | #ifdef __KERNEL__ | 147 | #ifdef __KERNEL__ |
148 | struct ip_conntrack_counter | ||
149 | { | ||
150 | u_int32_t packets; | ||
151 | u_int32_t bytes; | ||
152 | }; | ||
153 | |||
154 | struct ip_conntrack_stat | 148 | struct ip_conntrack_stat |
155 | { | 149 | { |
156 | unsigned int searched; | 150 | unsigned int searched; |
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index 0a383ac083cb..c19595c89304 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -81,6 +81,7 @@ enum ctattr_protoinfo { | |||
81 | CTA_PROTOINFO_UNSPEC, | 81 | CTA_PROTOINFO_UNSPEC, |
82 | CTA_PROTOINFO_TCP, | 82 | CTA_PROTOINFO_TCP, |
83 | CTA_PROTOINFO_DCCP, | 83 | CTA_PROTOINFO_DCCP, |
84 | CTA_PROTOINFO_SCTP, | ||
84 | __CTA_PROTOINFO_MAX | 85 | __CTA_PROTOINFO_MAX |
85 | }; | 86 | }; |
86 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) | 87 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) |
@@ -103,12 +104,21 @@ enum ctattr_protoinfo_dccp { | |||
103 | }; | 104 | }; |
104 | #define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1) | 105 | #define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1) |
105 | 106 | ||
107 | enum ctattr_protoinfo_sctp { | ||
108 | CTA_PROTOINFO_SCTP_UNSPEC, | ||
109 | CTA_PROTOINFO_SCTP_STATE, | ||
110 | CTA_PROTOINFO_SCTP_VTAG_ORIGINAL, | ||
111 | CTA_PROTOINFO_SCTP_VTAG_REPLY, | ||
112 | __CTA_PROTOINFO_SCTP_MAX | ||
113 | }; | ||
114 | #define CTA_PROTOINFO_SCTP_MAX (__CTA_PROTOINFO_SCTP_MAX - 1) | ||
115 | |||
106 | enum ctattr_counters { | 116 | enum ctattr_counters { |
107 | CTA_COUNTERS_UNSPEC, | 117 | CTA_COUNTERS_UNSPEC, |
108 | CTA_COUNTERS_PACKETS, /* old 64bit counters */ | 118 | CTA_COUNTERS_PACKETS, /* 64bit counters */ |
109 | CTA_COUNTERS_BYTES, /* old 64bit counters */ | 119 | CTA_COUNTERS_BYTES, /* 64bit counters */ |
110 | CTA_COUNTERS32_PACKETS, | 120 | CTA_COUNTERS32_PACKETS, /* old 32bit counters, unused */ |
111 | CTA_COUNTERS32_BYTES, | 121 | CTA_COUNTERS32_BYTES, /* old 32bit counters, unused */ |
112 | __CTA_COUNTERS_MAX | 122 | __CTA_COUNTERS_MAX |
113 | }; | 123 | }; |
114 | #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) | 124 | #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) |
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h index a85721332924..f661731f3cb1 100644 --- a/include/linux/netfilter/nfnetlink_log.h +++ b/include/linux/netfilter/nfnetlink_log.h | |||
@@ -48,6 +48,9 @@ enum nfulnl_attr_type { | |||
48 | NFULA_SEQ, /* instance-local sequence number */ | 48 | NFULA_SEQ, /* instance-local sequence number */ |
49 | NFULA_SEQ_GLOBAL, /* global sequence number */ | 49 | NFULA_SEQ_GLOBAL, /* global sequence number */ |
50 | NFULA_GID, /* group id of socket */ | 50 | NFULA_GID, /* group id of socket */ |
51 | NFULA_HWTYPE, /* hardware type */ | ||
52 | NFULA_HWHEADER, /* hardware header */ | ||
53 | NFULA_HWLEN, /* hardware header length */ | ||
51 | 54 | ||
52 | __NFULA_MAX | 55 | __NFULA_MAX |
53 | }; | 56 | }; |
diff --git a/include/linux/netfilter/xt_string.h b/include/linux/netfilter/xt_string.h index bb21dd1aee2d..8a6ba7bbef9f 100644 --- a/include/linux/netfilter/xt_string.h +++ b/include/linux/netfilter/xt_string.h | |||
@@ -4,6 +4,11 @@ | |||
4 | #define XT_STRING_MAX_PATTERN_SIZE 128 | 4 | #define XT_STRING_MAX_PATTERN_SIZE 128 |
5 | #define XT_STRING_MAX_ALGO_NAME_SIZE 16 | 5 | #define XT_STRING_MAX_ALGO_NAME_SIZE 16 |
6 | 6 | ||
7 | enum { | ||
8 | XT_STRING_FLAG_INVERT = 0x01, | ||
9 | XT_STRING_FLAG_IGNORECASE = 0x02 | ||
10 | }; | ||
11 | |||
7 | struct xt_string_info | 12 | struct xt_string_info |
8 | { | 13 | { |
9 | u_int16_t from_offset; | 14 | u_int16_t from_offset; |
@@ -11,7 +16,15 @@ struct xt_string_info | |||
11 | char algo[XT_STRING_MAX_ALGO_NAME_SIZE]; | 16 | char algo[XT_STRING_MAX_ALGO_NAME_SIZE]; |
12 | char pattern[XT_STRING_MAX_PATTERN_SIZE]; | 17 | char pattern[XT_STRING_MAX_PATTERN_SIZE]; |
13 | u_int8_t patlen; | 18 | u_int8_t patlen; |
14 | u_int8_t invert; | 19 | union { |
20 | struct { | ||
21 | u_int8_t invert; | ||
22 | } v0; | ||
23 | |||
24 | struct { | ||
25 | u_int8_t flags; | ||
26 | } v1; | ||
27 | } u; | ||
15 | 28 | ||
16 | /* Used internally by the kernel */ | 29 | /* Used internally by the kernel */ |
17 | struct ts_config __attribute__((aligned(8))) *config; | 30 | struct ts_config __attribute__((aligned(8))) *config; |
diff --git a/include/linux/netfilter_bridge/ebt_ip6.h b/include/linux/netfilter_bridge/ebt_ip6.h new file mode 100644 index 000000000000..2273c3ae33ca --- /dev/null +++ b/include/linux/netfilter_bridge/ebt_ip6.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * ebt_ip6 | ||
3 | * | ||
4 | * Authors: | ||
5 | * Kuo-Lang Tseng <kuo-lang.tseng@intel.com> | ||
6 | * Manohar Castelino <manohar.r.castelino@intel.com> | ||
7 | * | ||
8 | * Jan 11, 2008 | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_BRIDGE_EBT_IP6_H | ||
13 | #define __LINUX_BRIDGE_EBT_IP6_H | ||
14 | |||
15 | #define EBT_IP6_SOURCE 0x01 | ||
16 | #define EBT_IP6_DEST 0x02 | ||
17 | #define EBT_IP6_TCLASS 0x04 | ||
18 | #define EBT_IP6_PROTO 0x08 | ||
19 | #define EBT_IP6_SPORT 0x10 | ||
20 | #define EBT_IP6_DPORT 0x20 | ||
21 | #define EBT_IP6_MASK (EBT_IP6_SOURCE | EBT_IP6_DEST | EBT_IP6_TCLASS |\ | ||
22 | EBT_IP6_PROTO | EBT_IP6_SPORT | EBT_IP6_DPORT) | ||
23 | #define EBT_IP6_MATCH "ip6" | ||
24 | |||
25 | /* the same values are used for the invflags */ | ||
26 | struct ebt_ip6_info | ||
27 | { | ||
28 | struct in6_addr saddr; | ||
29 | struct in6_addr daddr; | ||
30 | struct in6_addr smsk; | ||
31 | struct in6_addr dmsk; | ||
32 | uint8_t tclass; | ||
33 | uint8_t protocol; | ||
34 | uint8_t bitmask; | ||
35 | uint8_t invflags; | ||
36 | uint16_t sport[2]; | ||
37 | uint16_t dport[2]; | ||
38 | }; | ||
39 | |||
40 | #endif | ||
diff --git a/include/linux/netfilter_bridge/ebt_log.h b/include/linux/netfilter_bridge/ebt_log.h index 96e231ae7554..b76e653157e5 100644 --- a/include/linux/netfilter_bridge/ebt_log.h +++ b/include/linux/netfilter_bridge/ebt_log.h | |||
@@ -4,7 +4,8 @@ | |||
4 | #define EBT_LOG_IP 0x01 /* if the frame is made by ip, log the ip information */ | 4 | #define EBT_LOG_IP 0x01 /* if the frame is made by ip, log the ip information */ |
5 | #define EBT_LOG_ARP 0x02 | 5 | #define EBT_LOG_ARP 0x02 |
6 | #define EBT_LOG_NFLOG 0x04 | 6 | #define EBT_LOG_NFLOG 0x04 |
7 | #define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP) | 7 | #define EBT_LOG_IP6 0x08 |
8 | #define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP | EBT_LOG_IP6) | ||
8 | #define EBT_LOG_PREFIX_SIZE 30 | 9 | #define EBT_LOG_PREFIX_SIZE 30 |
9 | #define EBT_LOG_WATCHER "log" | 10 | #define EBT_LOG_WATCHER "log" |
10 | 11 | ||
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index 650318b0c405..29c7727ff0e8 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
@@ -60,6 +60,7 @@ enum nf_ip_hook_priorities { | |||
60 | NF_IP_PRI_MANGLE = -150, | 60 | NF_IP_PRI_MANGLE = -150, |
61 | NF_IP_PRI_NAT_DST = -100, | 61 | NF_IP_PRI_NAT_DST = -100, |
62 | NF_IP_PRI_FILTER = 0, | 62 | NF_IP_PRI_FILTER = 0, |
63 | NF_IP_PRI_SECURITY = 50, | ||
63 | NF_IP_PRI_NAT_SRC = 100, | 64 | NF_IP_PRI_NAT_SRC = 100, |
64 | NF_IP_PRI_SELINUX_LAST = 225, | 65 | NF_IP_PRI_SELINUX_LAST = 225, |
65 | NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX, | 66 | NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX, |
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 3475a65dae9b..d654873aa25a 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
@@ -64,11 +64,14 @@ enum nf_ip6_hook_priorities { | |||
64 | NF_IP6_PRI_MANGLE = -150, | 64 | NF_IP6_PRI_MANGLE = -150, |
65 | NF_IP6_PRI_NAT_DST = -100, | 65 | NF_IP6_PRI_NAT_DST = -100, |
66 | NF_IP6_PRI_FILTER = 0, | 66 | NF_IP6_PRI_FILTER = 0, |
67 | NF_IP6_PRI_SECURITY = 50, | ||
67 | NF_IP6_PRI_NAT_SRC = 100, | 68 | NF_IP6_PRI_NAT_SRC = 100, |
68 | NF_IP6_PRI_SELINUX_LAST = 225, | 69 | NF_IP6_PRI_SELINUX_LAST = 225, |
69 | NF_IP6_PRI_LAST = INT_MAX, | 70 | NF_IP6_PRI_LAST = INT_MAX, |
70 | }; | 71 | }; |
71 | 72 | ||
73 | #ifdef __KERNEL__ | ||
74 | |||
72 | #ifdef CONFIG_NETFILTER | 75 | #ifdef CONFIG_NETFILTER |
73 | extern int ip6_route_me_harder(struct sk_buff *skb); | 76 | extern int ip6_route_me_harder(struct sk_buff *skb); |
74 | extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, | 77 | extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, |
@@ -81,4 +84,6 @@ static inline int ipv6_netfilter_init(void) { return 0; } | |||
81 | static inline void ipv6_netfilter_fini(void) { return; } | 84 | static inline void ipv6_netfilter_fini(void) { return; } |
82 | #endif /* CONFIG_NETFILTER */ | 85 | #endif /* CONFIG_NETFILTER */ |
83 | 86 | ||
87 | #endif /* __KERNEL__ */ | ||
88 | |||
84 | #endif /*__LINUX_IP6_NETFILTER_H*/ | 89 | #endif /*__LINUX_IP6_NETFILTER_H*/ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index bec1062a25a1..9ff1b54908f3 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -193,7 +193,7 @@ extern int netlink_unregister_notifier(struct notifier_block *nb); | |||
193 | 193 | ||
194 | /* finegrained unicast helpers: */ | 194 | /* finegrained unicast helpers: */ |
195 | struct sock *netlink_getsockbyfilp(struct file *filp); | 195 | struct sock *netlink_getsockbyfilp(struct file *filp); |
196 | int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, | 196 | int netlink_attachskb(struct sock *sk, struct sk_buff *skb, |
197 | long *timeo, struct sock *ssk); | 197 | long *timeo, struct sock *ssk); |
198 | void netlink_detachskb(struct sock *sk, struct sk_buff *skb); | 198 | void netlink_detachskb(struct sock *sk, struct sk_buff *skb); |
199 | int netlink_sendskb(struct sock *sk, struct sk_buff *skb); | 199 | int netlink_sendskb(struct sock *sk, struct sk_buff *skb); |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 8726491de154..ea0366769484 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -65,9 +65,6 @@ | |||
65 | #define NFS4_ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010 | 65 | #define NFS4_ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010 |
66 | #define NFS4_ACE_FAILED_ACCESS_ACE_FLAG 0x00000020 | 66 | #define NFS4_ACE_FAILED_ACCESS_ACE_FLAG 0x00000020 |
67 | #define NFS4_ACE_IDENTIFIER_GROUP 0x00000040 | 67 | #define NFS4_ACE_IDENTIFIER_GROUP 0x00000040 |
68 | #define NFS4_ACE_OWNER 0x00000080 | ||
69 | #define NFS4_ACE_GROUP 0x00000100 | ||
70 | #define NFS4_ACE_EVERYONE 0x00000200 | ||
71 | 68 | ||
72 | #define NFS4_ACE_READ_DATA 0x00000001 | 69 | #define NFS4_ACE_READ_DATA 0x00000001 |
73 | #define NFS4_ACE_LIST_DIRECTORY 0x00000001 | 70 | #define NFS4_ACE_LIST_DIRECTORY 0x00000001 |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 41d30c9c9de6..a2861d95ecc3 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
@@ -28,20 +28,20 @@ | |||
28 | #define NFSD_SUPPORTED_MINOR_VERSION 0 | 28 | #define NFSD_SUPPORTED_MINOR_VERSION 0 |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * Special flags for nfsd_permission. These must be different from MAY_READ, | 31 | * Flags for nfsd_permission |
32 | * MAY_WRITE, and MAY_EXEC. | ||
33 | */ | 32 | */ |
34 | #define MAY_NOP 0 | 33 | #define NFSD_MAY_NOP 0 |
35 | #define MAY_SATTR 8 | 34 | #define NFSD_MAY_EXEC 1 /* == MAY_EXEC */ |
36 | #define MAY_TRUNC 16 | 35 | #define NFSD_MAY_WRITE 2 /* == MAY_WRITE */ |
37 | #define MAY_LOCK 32 | 36 | #define NFSD_MAY_READ 4 /* == MAY_READ */ |
38 | #define MAY_OWNER_OVERRIDE 64 | 37 | #define NFSD_MAY_SATTR 8 |
39 | #define MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/ | 38 | #define NFSD_MAY_TRUNC 16 |
40 | #if (MAY_SATTR | MAY_TRUNC | MAY_LOCK | MAY_OWNER_OVERRIDE | MAY_LOCAL_ACCESS) & (MAY_READ | MAY_WRITE | MAY_EXEC) | 39 | #define NFSD_MAY_LOCK 32 |
41 | # error "please use a different value for MAY_SATTR or MAY_TRUNC or MAY_LOCK or MAY_LOCAL_ACCESS or MAY_OWNER_OVERRIDE." | 40 | #define NFSD_MAY_OWNER_OVERRIDE 64 |
42 | #endif | 41 | #define NFSD_MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/ |
43 | #define MAY_CREATE (MAY_EXEC|MAY_WRITE) | 42 | |
44 | #define MAY_REMOVE (MAY_EXEC|MAY_WRITE|MAY_TRUNC) | 43 | #define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE) |
44 | #define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC) | ||
45 | 45 | ||
46 | /* | 46 | /* |
47 | * Callback function for readdir | 47 | * Callback function for readdir |
@@ -54,6 +54,7 @@ typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int); | |||
54 | extern struct svc_program nfsd_program; | 54 | extern struct svc_program nfsd_program; |
55 | extern struct svc_version nfsd_version2, nfsd_version3, | 55 | extern struct svc_version nfsd_version2, nfsd_version3, |
56 | nfsd_version4; | 56 | nfsd_version4; |
57 | extern struct mutex nfsd_mutex; | ||
57 | extern struct svc_serv *nfsd_serv; | 58 | extern struct svc_serv *nfsd_serv; |
58 | 59 | ||
59 | extern struct seq_operations nfs_exports_op; | 60 | extern struct seq_operations nfs_exports_op; |
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index db348f749376..d0fe2e378452 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
@@ -98,8 +98,6 @@ struct nfs4_callback { | |||
98 | u32 cb_ident; | 98 | u32 cb_ident; |
99 | /* RPC client info */ | 99 | /* RPC client info */ |
100 | atomic_t cb_set; /* successful CB_NULL call */ | 100 | atomic_t cb_set; /* successful CB_NULL call */ |
101 | struct rpc_program cb_program; | ||
102 | struct rpc_stat cb_stat; | ||
103 | struct rpc_clnt * cb_client; | 101 | struct rpc_clnt * cb_client; |
104 | }; | 102 | }; |
105 | 103 | ||
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index ea6517e58b04..2be7c63bc0f2 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -122,13 +122,13 @@ enum nl80211_commands { | |||
122 | NL80211_CMD_NEW_STATION, | 122 | NL80211_CMD_NEW_STATION, |
123 | NL80211_CMD_DEL_STATION, | 123 | NL80211_CMD_DEL_STATION, |
124 | 124 | ||
125 | /* add commands here */ | ||
126 | |||
127 | NL80211_CMD_GET_MPATH, | 125 | NL80211_CMD_GET_MPATH, |
128 | NL80211_CMD_SET_MPATH, | 126 | NL80211_CMD_SET_MPATH, |
129 | NL80211_CMD_NEW_MPATH, | 127 | NL80211_CMD_NEW_MPATH, |
130 | NL80211_CMD_DEL_MPATH, | 128 | NL80211_CMD_DEL_MPATH, |
131 | 129 | ||
130 | /* add commands here */ | ||
131 | |||
132 | /* used to define NL80211_CMD_MAX below */ | 132 | /* used to define NL80211_CMD_MAX below */ |
133 | __NL80211_CMD_AFTER_LAST, | 133 | __NL80211_CMD_AFTER_LAST, |
134 | NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 | 134 | NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 |
@@ -230,18 +230,21 @@ enum nl80211_attrs { | |||
230 | 230 | ||
231 | NL80211_ATTR_MNTR_FLAGS, | 231 | NL80211_ATTR_MNTR_FLAGS, |
232 | 232 | ||
233 | /* add attributes here, update the policy in nl80211.c */ | ||
234 | |||
235 | NL80211_ATTR_MESH_ID, | 233 | NL80211_ATTR_MESH_ID, |
236 | NL80211_ATTR_STA_PLINK_ACTION, | 234 | NL80211_ATTR_STA_PLINK_ACTION, |
237 | NL80211_ATTR_MPATH_NEXT_HOP, | 235 | NL80211_ATTR_MPATH_NEXT_HOP, |
238 | NL80211_ATTR_MPATH_INFO, | 236 | NL80211_ATTR_MPATH_INFO, |
239 | 237 | ||
238 | /* add attributes here, update the policy in nl80211.c */ | ||
239 | |||
240 | __NL80211_ATTR_AFTER_LAST, | 240 | __NL80211_ATTR_AFTER_LAST, |
241 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 | 241 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 |
242 | }; | 242 | }; |
243 | 243 | ||
244 | #define NL80211_MAX_SUPP_RATES 32 | 244 | #define NL80211_MAX_SUPP_RATES 32 |
245 | #define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 | ||
246 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 | ||
247 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 | ||
245 | 248 | ||
246 | /** | 249 | /** |
247 | * enum nl80211_iftype - (virtual) interface types | 250 | * enum nl80211_iftype - (virtual) interface types |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 0ff6224d172a..bd3d72ddf333 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -197,6 +197,7 @@ static inline int notifier_to_errno(int ret) | |||
197 | #define NETDEV_GOING_DOWN 0x0009 | 197 | #define NETDEV_GOING_DOWN 0x0009 |
198 | #define NETDEV_CHANGENAME 0x000A | 198 | #define NETDEV_CHANGENAME 0x000A |
199 | #define NETDEV_FEAT_CHANGE 0x000B | 199 | #define NETDEV_FEAT_CHANGE 0x000B |
200 | #define NETDEV_BONDING_FAILOVER 0x000C | ||
200 | 201 | ||
201 | #define SYS_DOWN 0x0001 /* Notify of system down */ | 202 | #define SYS_DOWN 0x0001 /* Notify of system down */ |
202 | #define SYS_RESTART SYS_DOWN | 203 | #define SYS_RESTART SYS_DOWN |
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index 2ee97e9877a7..67db101d0eb8 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #define __LINUX_OF_GPIO_H | 15 | #define __LINUX_OF_GPIO_H |
16 | 16 | ||
17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
18 | #include <asm/gpio.h> | 18 | #include <linux/gpio.h> |
19 | 19 | ||
20 | #ifdef CONFIG_OF_GPIO | 20 | #ifdef CONFIG_OF_GPIO |
21 | 21 | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 0d2a4e7012aa..54590a9a103e 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -96,7 +96,22 @@ enum pageflags { | |||
96 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR | 96 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR |
97 | PG_uncached, /* Page has been mapped as uncached */ | 97 | PG_uncached, /* Page has been mapped as uncached */ |
98 | #endif | 98 | #endif |
99 | __NR_PAGEFLAGS | 99 | __NR_PAGEFLAGS, |
100 | |||
101 | /* Filesystems */ | ||
102 | PG_checked = PG_owner_priv_1, | ||
103 | |||
104 | /* XEN */ | ||
105 | PG_pinned = PG_owner_priv_1, | ||
106 | PG_savepinned = PG_dirty, | ||
107 | |||
108 | /* SLOB */ | ||
109 | PG_slob_page = PG_active, | ||
110 | PG_slob_free = PG_private, | ||
111 | |||
112 | /* SLUB */ | ||
113 | PG_slub_frozen = PG_active, | ||
114 | PG_slub_debug = PG_error, | ||
100 | }; | 115 | }; |
101 | 116 | ||
102 | #ifndef __GENERATING_BOUNDS_H | 117 | #ifndef __GENERATING_BOUNDS_H |
@@ -155,13 +170,19 @@ PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) | |||
155 | PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru) | 170 | PAGEFLAG(LRU, lru) __CLEARPAGEFLAG(LRU, lru) |
156 | PAGEFLAG(Active, active) __CLEARPAGEFLAG(Active, active) | 171 | PAGEFLAG(Active, active) __CLEARPAGEFLAG(Active, active) |
157 | __PAGEFLAG(Slab, slab) | 172 | __PAGEFLAG(Slab, slab) |
158 | PAGEFLAG(Checked, owner_priv_1) /* Used by some filesystems */ | 173 | PAGEFLAG(Checked, checked) /* Used by some filesystems */ |
159 | PAGEFLAG(Pinned, owner_priv_1) TESTSCFLAG(Pinned, owner_priv_1) /* Xen */ | 174 | PAGEFLAG(Pinned, pinned) TESTSCFLAG(Pinned, pinned) /* Xen */ |
160 | PAGEFLAG(SavePinned, dirty); /* Xen */ | 175 | PAGEFLAG(SavePinned, savepinned); /* Xen */ |
161 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) | 176 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) |
162 | PAGEFLAG(Private, private) __CLEARPAGEFLAG(Private, private) | 177 | PAGEFLAG(Private, private) __CLEARPAGEFLAG(Private, private) |
163 | __SETPAGEFLAG(Private, private) | 178 | __SETPAGEFLAG(Private, private) |
164 | 179 | ||
180 | __PAGEFLAG(SlobPage, slob_page) | ||
181 | __PAGEFLAG(SlobFree, slob_free) | ||
182 | |||
183 | __PAGEFLAG(SlubFrozen, slub_frozen) | ||
184 | __PAGEFLAG(SlubDebug, slub_debug) | ||
185 | |||
165 | /* | 186 | /* |
166 | * Only test-and-set exist for PG_writeback. The unconditional operators are | 187 | * Only test-and-set exist for PG_writeback. The unconditional operators are |
167 | * risky: they bypass page accounting. | 188 | * risky: they bypass page accounting. |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index d2fca802f809..ee1ec2c7723c 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | static inline void mapping_set_error(struct address_space *mapping, int error) | 23 | static inline void mapping_set_error(struct address_space *mapping, int error) |
24 | { | 24 | { |
25 | if (error) { | 25 | if (unlikely(error)) { |
26 | if (error == -ENOSPC) | 26 | if (error == -ENOSPC) |
27 | set_bit(AS_ENOSPC, &mapping->flags); | 27 | set_bit(AS_ENOSPC, &mapping->flags); |
28 | else | 28 | else |
diff --git a/include/linux/parser.h b/include/linux/parser.h index 7dcd05075756..cc554ca8bc78 100644 --- a/include/linux/parser.h +++ b/include/linux/parser.h | |||
@@ -14,7 +14,7 @@ struct match_token { | |||
14 | const char *pattern; | 14 | const char *pattern; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | typedef struct match_token match_table_t[]; | 17 | typedef const struct match_token match_table_t[]; |
18 | 18 | ||
19 | /* Maximum number of arguments that match_token will find in a pattern */ | 19 | /* Maximum number of arguments that match_token will find in a pattern */ |
20 | enum {MAX_OPT_ARGS = 3}; | 20 | enum {MAX_OPT_ARGS = 3}; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 6be6a7943d8b..119ae7b8f028 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1950,6 +1950,8 @@ | |||
1950 | #define PCI_DEVICE_ID_NX2_5708 0x164c | 1950 | #define PCI_DEVICE_ID_NX2_5708 0x164c |
1951 | #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d | 1951 | #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d |
1952 | #define PCI_DEVICE_ID_NX2_57710 0x164e | 1952 | #define PCI_DEVICE_ID_NX2_57710 0x164e |
1953 | #define PCI_DEVICE_ID_NX2_57711 0x164f | ||
1954 | #define PCI_DEVICE_ID_NX2_57711E 0x1650 | ||
1953 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 | 1955 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 |
1954 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 | 1956 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 |
1955 | #define PCI_DEVICE_ID_TIGON3_5720 0x1658 | 1957 | #define PCI_DEVICE_ID_TIGON3_5720 0x1658 |
@@ -1982,6 +1984,7 @@ | |||
1982 | #define PCI_DEVICE_ID_TIGON3_5787M 0x1693 | 1984 | #define PCI_DEVICE_ID_TIGON3_5787M 0x1693 |
1983 | #define PCI_DEVICE_ID_TIGON3_5782 0x1696 | 1985 | #define PCI_DEVICE_ID_TIGON3_5782 0x1696 |
1984 | #define PCI_DEVICE_ID_TIGON3_5784 0x1698 | 1986 | #define PCI_DEVICE_ID_TIGON3_5784 0x1698 |
1987 | #define PCI_DEVICE_ID_TIGON3_5785 0x1699 | ||
1985 | #define PCI_DEVICE_ID_TIGON3_5786 0x169a | 1988 | #define PCI_DEVICE_ID_TIGON3_5786 0x169a |
1986 | #define PCI_DEVICE_ID_TIGON3_5787 0x169b | 1989 | #define PCI_DEVICE_ID_TIGON3_5787 0x169b |
1987 | #define PCI_DEVICE_ID_TIGON3_5788 0x169c | 1990 | #define PCI_DEVICE_ID_TIGON3_5788 0x169c |
@@ -2368,6 +2371,14 @@ | |||
2368 | #define PCI_DEVICE_ID_INTEL_ICH9_7 0x2916 | 2371 | #define PCI_DEVICE_ID_INTEL_ICH9_7 0x2916 |
2369 | #define PCI_DEVICE_ID_INTEL_ICH9_8 0x2918 | 2372 | #define PCI_DEVICE_ID_INTEL_ICH9_8 0x2918 |
2370 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 | 2373 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 |
2374 | #define PCI_DEVICE_ID_INTEL_IOAT_TBG4 0x3429 | ||
2375 | #define PCI_DEVICE_ID_INTEL_IOAT_TBG5 0x342a | ||
2376 | #define PCI_DEVICE_ID_INTEL_IOAT_TBG6 0x342b | ||
2377 | #define PCI_DEVICE_ID_INTEL_IOAT_TBG7 0x342c | ||
2378 | #define PCI_DEVICE_ID_INTEL_IOAT_TBG0 0x3430 | ||
2379 | #define PCI_DEVICE_ID_INTEL_IOAT_TBG1 0x3431 | ||
2380 | #define PCI_DEVICE_ID_INTEL_IOAT_TBG2 0x3432 | ||
2381 | #define PCI_DEVICE_ID_INTEL_IOAT_TBG3 0x3433 | ||
2371 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 | 2382 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 |
2372 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 | 2383 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 |
2373 | #define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580 | 2384 | #define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580 |
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index 99efbed81fa2..7cf7824df778 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h | |||
@@ -374,6 +374,7 @@ enum | |||
374 | TCA_FLOW_ACT, | 374 | TCA_FLOW_ACT, |
375 | TCA_FLOW_POLICE, | 375 | TCA_FLOW_POLICE, |
376 | TCA_FLOW_EMATCHES, | 376 | TCA_FLOW_EMATCHES, |
377 | TCA_FLOW_PERTURB, | ||
377 | __TCA_FLOW_MAX | 378 | __TCA_FLOW_MAX |
378 | }; | 379 | }; |
379 | 380 | ||
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index dbb7ac37960d..e5de421ac7b4 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
@@ -85,6 +85,26 @@ struct tc_ratespec | |||
85 | 85 | ||
86 | #define TC_RTAB_SIZE 1024 | 86 | #define TC_RTAB_SIZE 1024 |
87 | 87 | ||
88 | struct tc_sizespec { | ||
89 | unsigned char cell_log; | ||
90 | unsigned char size_log; | ||
91 | short cell_align; | ||
92 | int overhead; | ||
93 | unsigned int linklayer; | ||
94 | unsigned int mpu; | ||
95 | unsigned int mtu; | ||
96 | unsigned int tsize; | ||
97 | }; | ||
98 | |||
99 | enum { | ||
100 | TCA_STAB_UNSPEC, | ||
101 | TCA_STAB_BASE, | ||
102 | TCA_STAB_DATA, | ||
103 | __TCA_STAB_MAX | ||
104 | }; | ||
105 | |||
106 | #define TCA_STAB_MAX (__TCA_STAB_MAX - 1) | ||
107 | |||
88 | /* FIFO section */ | 108 | /* FIFO section */ |
89 | 109 | ||
90 | struct tc_fifo_qopt | 110 | struct tc_fifo_qopt |
@@ -103,15 +123,6 @@ struct tc_prio_qopt | |||
103 | __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ | 123 | __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ |
104 | }; | 124 | }; |
105 | 125 | ||
106 | enum | ||
107 | { | ||
108 | TCA_PRIO_UNSPEC, | ||
109 | TCA_PRIO_MQ, | ||
110 | __TCA_PRIO_MAX | ||
111 | }; | ||
112 | |||
113 | #define TCA_PRIO_MAX (__TCA_PRIO_MAX - 1) | ||
114 | |||
115 | /* TBF section */ | 126 | /* TBF section */ |
116 | 127 | ||
117 | struct tc_tbf_qopt | 128 | struct tc_tbf_qopt |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 4ad9de94449a..4dcce54b6d76 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -22,78 +22,6 @@ | |||
22 | #define _LINUX_PM_H | 22 | #define _LINUX_PM_H |
23 | 23 | ||
24 | #include <linux/list.h> | 24 | #include <linux/list.h> |
25 | #include <asm/atomic.h> | ||
26 | #include <asm/errno.h> | ||
27 | |||
28 | /* | ||
29 | * Power management requests... these are passed to pm_send_all() and friends. | ||
30 | * | ||
31 | * these functions are old and deprecated, see below. | ||
32 | */ | ||
33 | typedef int __bitwise pm_request_t; | ||
34 | |||
35 | #define PM_SUSPEND ((__force pm_request_t) 1) /* enter D1-D3 */ | ||
36 | #define PM_RESUME ((__force pm_request_t) 2) /* enter D0 */ | ||
37 | |||
38 | |||
39 | /* | ||
40 | * Device types... these are passed to pm_register | ||
41 | */ | ||
42 | typedef int __bitwise pm_dev_t; | ||
43 | |||
44 | #define PM_UNKNOWN_DEV ((__force pm_dev_t) 0) /* generic */ | ||
45 | #define PM_SYS_DEV ((__force pm_dev_t) 1) /* system device (fan, KB controller, ...) */ | ||
46 | #define PM_PCI_DEV ((__force pm_dev_t) 2) /* PCI device */ | ||
47 | #define PM_USB_DEV ((__force pm_dev_t) 3) /* USB device */ | ||
48 | #define PM_SCSI_DEV ((__force pm_dev_t) 4) /* SCSI device */ | ||
49 | #define PM_ISA_DEV ((__force pm_dev_t) 5) /* ISA device */ | ||
50 | #define PM_MTD_DEV ((__force pm_dev_t) 6) /* Memory Technology Device */ | ||
51 | |||
52 | /* | ||
53 | * System device hardware ID (PnP) values | ||
54 | */ | ||
55 | enum | ||
56 | { | ||
57 | PM_SYS_UNKNOWN = 0x00000000, /* generic */ | ||
58 | PM_SYS_KBC = 0x41d00303, /* keyboard controller */ | ||
59 | PM_SYS_COM = 0x41d00500, /* serial port */ | ||
60 | PM_SYS_IRDA = 0x41d00510, /* IRDA controller */ | ||
61 | PM_SYS_FDC = 0x41d00700, /* floppy controller */ | ||
62 | PM_SYS_VGA = 0x41d00900, /* VGA controller */ | ||
63 | PM_SYS_PCMCIA = 0x41d00e00, /* PCMCIA controller */ | ||
64 | }; | ||
65 | |||
66 | /* | ||
67 | * Device identifier | ||
68 | */ | ||
69 | #define PM_PCI_ID(dev) ((dev)->bus->number << 16 | (dev)->devfn) | ||
70 | |||
71 | /* | ||
72 | * Request handler callback | ||
73 | */ | ||
74 | struct pm_dev; | ||
75 | |||
76 | typedef int (*pm_callback)(struct pm_dev *dev, pm_request_t rqst, void *data); | ||
77 | |||
78 | /* | ||
79 | * Dynamic device information | ||
80 | */ | ||
81 | struct pm_dev | ||
82 | { | ||
83 | pm_dev_t type; | ||
84 | unsigned long id; | ||
85 | pm_callback callback; | ||
86 | void *data; | ||
87 | |||
88 | unsigned long flags; | ||
89 | unsigned long state; | ||
90 | unsigned long prev_state; | ||
91 | |||
92 | struct list_head entry; | ||
93 | }; | ||
94 | |||
95 | /* Functions above this comment are list-based old-style power | ||
96 | * management. Please avoid using them. */ | ||
97 | 25 | ||
98 | /* | 26 | /* |
99 | * Callbacks for platform drivers to implement. | 27 | * Callbacks for platform drivers to implement. |
@@ -317,6 +245,21 @@ struct pm_ext_ops { | |||
317 | * RECOVER Creation of a hibernation image or restoration of the main | 245 | * RECOVER Creation of a hibernation image or restoration of the main |
318 | * memory contents from a hibernation image has failed, call | 246 | * memory contents from a hibernation image has failed, call |
319 | * ->thaw() and ->complete() for all devices. | 247 | * ->thaw() and ->complete() for all devices. |
248 | * | ||
249 | * The following PM_EVENT_ messages are defined for internal use by | ||
250 | * kernel subsystems. They are never issued by the PM core. | ||
251 | * | ||
252 | * USER_SUSPEND Manual selective suspend was issued by userspace. | ||
253 | * | ||
254 | * USER_RESUME Manual selective resume was issued by userspace. | ||
255 | * | ||
256 | * REMOTE_WAKEUP Remote-wakeup request was received from the device. | ||
257 | * | ||
258 | * AUTO_SUSPEND Automatic (device idle) runtime suspend was | ||
259 | * initiated by the subsystem. | ||
260 | * | ||
261 | * AUTO_RESUME Automatic (device needed) runtime resume was | ||
262 | * requested by a driver. | ||
320 | */ | 263 | */ |
321 | 264 | ||
322 | #define PM_EVENT_ON 0x0000 | 265 | #define PM_EVENT_ON 0x0000 |
@@ -328,9 +271,18 @@ struct pm_ext_ops { | |||
328 | #define PM_EVENT_THAW 0x0020 | 271 | #define PM_EVENT_THAW 0x0020 |
329 | #define PM_EVENT_RESTORE 0x0040 | 272 | #define PM_EVENT_RESTORE 0x0040 |
330 | #define PM_EVENT_RECOVER 0x0080 | 273 | #define PM_EVENT_RECOVER 0x0080 |
274 | #define PM_EVENT_USER 0x0100 | ||
275 | #define PM_EVENT_REMOTE 0x0200 | ||
276 | #define PM_EVENT_AUTO 0x0400 | ||
331 | 277 | ||
332 | #define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE) | 278 | #define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE) |
279 | #define PM_EVENT_USER_SUSPEND (PM_EVENT_USER | PM_EVENT_SUSPEND) | ||
280 | #define PM_EVENT_USER_RESUME (PM_EVENT_USER | PM_EVENT_RESUME) | ||
281 | #define PM_EVENT_REMOTE_WAKEUP (PM_EVENT_REMOTE | PM_EVENT_RESUME) | ||
282 | #define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND) | ||
283 | #define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME) | ||
333 | 284 | ||
285 | #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) | ||
334 | #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) | 286 | #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) |
335 | #define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, }) | 287 | #define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, }) |
336 | #define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, }) | 288 | #define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, }) |
@@ -339,7 +291,16 @@ struct pm_ext_ops { | |||
339 | #define PMSG_THAW ((struct pm_message){ .event = PM_EVENT_THAW, }) | 291 | #define PMSG_THAW ((struct pm_message){ .event = PM_EVENT_THAW, }) |
340 | #define PMSG_RESTORE ((struct pm_message){ .event = PM_EVENT_RESTORE, }) | 292 | #define PMSG_RESTORE ((struct pm_message){ .event = PM_EVENT_RESTORE, }) |
341 | #define PMSG_RECOVER ((struct pm_message){ .event = PM_EVENT_RECOVER, }) | 293 | #define PMSG_RECOVER ((struct pm_message){ .event = PM_EVENT_RECOVER, }) |
342 | #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) | 294 | #define PMSG_USER_SUSPEND ((struct pm_messge) \ |
295 | { .event = PM_EVENT_USER_SUSPEND, }) | ||
296 | #define PMSG_USER_RESUME ((struct pm_messge) \ | ||
297 | { .event = PM_EVENT_USER_RESUME, }) | ||
298 | #define PMSG_REMOTE_RESUME ((struct pm_messge) \ | ||
299 | { .event = PM_EVENT_REMOTE_RESUME, }) | ||
300 | #define PMSG_AUTO_SUSPEND ((struct pm_messge) \ | ||
301 | { .event = PM_EVENT_AUTO_SUSPEND, }) | ||
302 | #define PMSG_AUTO_RESUME ((struct pm_messge) \ | ||
303 | { .event = PM_EVENT_AUTO_RESUME, }) | ||
343 | 304 | ||
344 | /** | 305 | /** |
345 | * Device power management states | 306 | * Device power management states |
diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h deleted file mode 100644 index 446f4f42b952..000000000000 --- a/include/linux/pm_legacy.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | #ifndef __LINUX_PM_LEGACY_H__ | ||
2 | #define __LINUX_PM_LEGACY_H__ | ||
3 | |||
4 | |||
5 | #ifdef CONFIG_PM_LEGACY | ||
6 | |||
7 | /* | ||
8 | * Register a device with power management | ||
9 | */ | ||
10 | struct pm_dev __deprecated * | ||
11 | pm_register(pm_dev_t type, unsigned long id, pm_callback callback); | ||
12 | |||
13 | /* | ||
14 | * Send a request to all devices | ||
15 | */ | ||
16 | int __deprecated pm_send_all(pm_request_t rqst, void *data); | ||
17 | |||
18 | #else /* CONFIG_PM_LEGACY */ | ||
19 | |||
20 | static inline struct pm_dev *pm_register(pm_dev_t type, | ||
21 | unsigned long id, | ||
22 | pm_callback callback) | ||
23 | { | ||
24 | return NULL; | ||
25 | } | ||
26 | |||
27 | static inline int pm_send_all(pm_request_t rqst, void *data) | ||
28 | { | ||
29 | return 0; | ||
30 | } | ||
31 | |||
32 | #endif /* CONFIG_PM_LEGACY */ | ||
33 | |||
34 | #endif /* __LINUX_PM_LEGACY_H__ */ | ||
35 | |||
diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h index e86a7a5cf355..b8d4ddd22736 100644 --- a/include/linux/ppp-comp.h +++ b/include/linux/ppp-comp.h | |||
@@ -23,8 +23,6 @@ | |||
23 | * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO | 23 | * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO |
24 | * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, | 24 | * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, |
25 | * OR MODIFICATIONS. | 25 | * OR MODIFICATIONS. |
26 | * | ||
27 | * $Id: ppp-comp.h,v 1.6 1997/11/27 06:04:44 paulus Exp $ | ||
28 | */ | 26 | */ |
29 | 27 | ||
30 | /* | 28 | /* |
diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h index c6b13ff85028..6e8adc77522c 100644 --- a/include/linux/ppp_defs.h +++ b/include/linux/ppp_defs.h | |||
@@ -1,5 +1,3 @@ | |||
1 | /* $Id: ppp_defs.h,v 1.2 1994/09/21 01:31:06 paulus Exp $ */ | ||
2 | |||
3 | /* | 1 | /* |
4 | * ppp_defs.h - PPP definitions. | 2 | * ppp_defs.h - PPP definitions. |
5 | * | 3 | * |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index fff1d27ddb4c..15a9eaf4a802 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -305,8 +305,6 @@ static inline struct net *PDE_NET(struct proc_dir_entry *pde) | |||
305 | return pde->parent->data; | 305 | return pde->parent->data; |
306 | } | 306 | } |
307 | 307 | ||
308 | struct net *get_proc_net(const struct inode *inode); | ||
309 | |||
310 | struct proc_maps_private { | 308 | struct proc_maps_private { |
311 | struct pid *pid; | 309 | struct pid *pid; |
312 | struct task_struct *task; | 310 | struct task_struct *task; |
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index 78bfdea24a8e..e98900671ca9 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h | |||
@@ -221,6 +221,7 @@ struct bitmap { | |||
221 | unsigned long syncchunk; | 221 | unsigned long syncchunk; |
222 | 222 | ||
223 | __u64 events_cleared; | 223 | __u64 events_cleared; |
224 | int need_sync; | ||
224 | 225 | ||
225 | /* bitmap spinlock */ | 226 | /* bitmap spinlock */ |
226 | spinlock_t lock; | 227 | spinlock_t lock; |
diff --git a/include/linux/raid/linear.h b/include/linux/raid/linear.h index ba15469daf11..7e375111d007 100644 --- a/include/linux/raid/linear.h +++ b/include/linux/raid/linear.h | |||
@@ -16,7 +16,7 @@ struct linear_private_data | |||
16 | struct linear_private_data *prev; /* earlier version */ | 16 | struct linear_private_data *prev; /* earlier version */ |
17 | dev_info_t **hash_table; | 17 | dev_info_t **hash_table; |
18 | sector_t hash_spacing; | 18 | sector_t hash_spacing; |
19 | sector_t array_size; | 19 | sector_t array_sectors; |
20 | int preshift; /* shift before dividing by hash_spacing */ | 20 | int preshift; /* shift before dividing by hash_spacing */ |
21 | dev_info_t disks[0]; | 21 | dev_info_t disks[0]; |
22 | }; | 22 | }; |
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index b7386ae9d288..dc0e3fcb9f28 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
@@ -95,7 +95,7 @@ extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, | |||
95 | struct page *page, int rw); | 95 | struct page *page, int rw); |
96 | extern void md_do_sync(mddev_t *mddev); | 96 | extern void md_do_sync(mddev_t *mddev); |
97 | extern void md_new_event(mddev_t *mddev); | 97 | extern void md_new_event(mddev_t *mddev); |
98 | extern void md_allow_write(mddev_t *mddev); | 98 | extern int md_allow_write(mddev_t *mddev); |
99 | extern void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev); | 99 | extern void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev); |
100 | 100 | ||
101 | #endif /* CONFIG_MD */ | 101 | #endif /* CONFIG_MD */ |
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 3dea9f545c8f..9f2549ac0e2d 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -59,7 +59,7 @@ struct mdk_rdev_s | |||
59 | int sb_loaded; | 59 | int sb_loaded; |
60 | __u64 sb_events; | 60 | __u64 sb_events; |
61 | sector_t data_offset; /* start of data in array */ | 61 | sector_t data_offset; /* start of data in array */ |
62 | sector_t sb_offset; | 62 | sector_t sb_start; /* offset of the super block (in 512byte sectors) */ |
63 | int sb_size; /* bytes in the superblock */ | 63 | int sb_size; /* bytes in the superblock */ |
64 | int preferred_minor; /* autorun support */ | 64 | int preferred_minor; /* autorun support */ |
65 | 65 | ||
@@ -87,6 +87,9 @@ struct mdk_rdev_s | |||
87 | #define Blocked 8 /* An error occured on an externally | 87 | #define Blocked 8 /* An error occured on an externally |
88 | * managed array, don't allow writes | 88 | * managed array, don't allow writes |
89 | * until it is cleared */ | 89 | * until it is cleared */ |
90 | #define StateChanged 9 /* Faulty or Blocked has changed during | ||
91 | * interrupt, so it needs to be | ||
92 | * notified by the thread */ | ||
90 | wait_queue_head_t blocked_wait; | 93 | wait_queue_head_t blocked_wait; |
91 | 94 | ||
92 | int desc_nr; /* descriptor index in the superblock */ | 95 | int desc_nr; /* descriptor index in the superblock */ |
@@ -147,7 +150,7 @@ struct mddev_s | |||
147 | int raid_disks; | 150 | int raid_disks; |
148 | int max_disks; | 151 | int max_disks; |
149 | sector_t size; /* used size of component devices */ | 152 | sector_t size; /* used size of component devices */ |
150 | sector_t array_size; /* exported array size */ | 153 | sector_t array_sectors; /* exported array size */ |
151 | __u64 events; | 154 | __u64 events; |
152 | 155 | ||
153 | char uuid[16]; | 156 | char uuid[16]; |
@@ -188,6 +191,7 @@ struct mddev_s | |||
188 | * NEEDED: we might need to start a resync/recover | 191 | * NEEDED: we might need to start a resync/recover |
189 | * RUNNING: a thread is running, or about to be started | 192 | * RUNNING: a thread is running, or about to be started |
190 | * SYNC: actually doing a resync, not a recovery | 193 | * SYNC: actually doing a resync, not a recovery |
194 | * RECOVER: doing recovery, or need to try it. | ||
191 | * INTR: resync needs to be aborted for some reason | 195 | * INTR: resync needs to be aborted for some reason |
192 | * DONE: thread is done and is waiting to be reaped | 196 | * DONE: thread is done and is waiting to be reaped |
193 | * REQUEST: user-space has requested a sync (used with SYNC) | 197 | * REQUEST: user-space has requested a sync (used with SYNC) |
@@ -198,6 +202,7 @@ struct mddev_s | |||
198 | */ | 202 | */ |
199 | #define MD_RECOVERY_RUNNING 0 | 203 | #define MD_RECOVERY_RUNNING 0 |
200 | #define MD_RECOVERY_SYNC 1 | 204 | #define MD_RECOVERY_SYNC 1 |
205 | #define MD_RECOVERY_RECOVER 2 | ||
201 | #define MD_RECOVERY_INTR 3 | 206 | #define MD_RECOVERY_INTR 3 |
202 | #define MD_RECOVERY_DONE 4 | 207 | #define MD_RECOVERY_DONE 4 |
203 | #define MD_RECOVERY_NEEDED 5 | 208 | #define MD_RECOVERY_NEEDED 5 |
@@ -210,7 +215,8 @@ struct mddev_s | |||
210 | 215 | ||
211 | int in_sync; /* know to not need resync */ | 216 | int in_sync; /* know to not need resync */ |
212 | struct mutex reconfig_mutex; | 217 | struct mutex reconfig_mutex; |
213 | atomic_t active; | 218 | atomic_t active; /* general refcount */ |
219 | atomic_t openers; /* number of active opens */ | ||
214 | 220 | ||
215 | int changed; /* true if we might need to reread partition info */ | 221 | int changed; /* true if we might need to reread partition info */ |
216 | int degraded; /* whether md should consider | 222 | int degraded; /* whether md should consider |
@@ -227,6 +233,8 @@ struct mddev_s | |||
227 | atomic_t recovery_active; /* blocks scheduled, but not written */ | 233 | atomic_t recovery_active; /* blocks scheduled, but not written */ |
228 | wait_queue_head_t recovery_wait; | 234 | wait_queue_head_t recovery_wait; |
229 | sector_t recovery_cp; | 235 | sector_t recovery_cp; |
236 | sector_t resync_min; /* user requested sync | ||
237 | * starts here */ | ||
230 | sector_t resync_max; /* resync should pause | 238 | sector_t resync_max; /* resync should pause |
231 | * when it gets here */ | 239 | * when it gets here */ |
232 | 240 | ||
@@ -331,6 +339,9 @@ static inline char * mdname (mddev_t * mddev) | |||
331 | #define rdev_for_each(rdev, tmp, mddev) \ | 339 | #define rdev_for_each(rdev, tmp, mddev) \ |
332 | rdev_for_each_list(rdev, tmp, (mddev)->disks) | 340 | rdev_for_each_list(rdev, tmp, (mddev)->disks) |
333 | 341 | ||
342 | #define rdev_for_each_rcu(rdev, mddev) \ | ||
343 | list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set) | ||
344 | |||
334 | typedef struct mdk_thread_s { | 345 | typedef struct mdk_thread_s { |
335 | void (*run) (mddev_t *mddev); | 346 | void (*run) (mddev_t *mddev); |
336 | mddev_t *mddev; | 347 | mddev_t *mddev; |
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 3f2cd98c508b..8b4de4a41ff1 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -43,14 +43,11 @@ | |||
43 | */ | 43 | */ |
44 | #define MD_RESERVED_BYTES (64 * 1024) | 44 | #define MD_RESERVED_BYTES (64 * 1024) |
45 | #define MD_RESERVED_SECTORS (MD_RESERVED_BYTES / 512) | 45 | #define MD_RESERVED_SECTORS (MD_RESERVED_BYTES / 512) |
46 | #define MD_RESERVED_BLOCKS (MD_RESERVED_BYTES / BLOCK_SIZE) | ||
47 | 46 | ||
48 | #define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS) | 47 | #define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS) |
49 | #define MD_NEW_SIZE_BLOCKS(x) ((x & ~(MD_RESERVED_BLOCKS - 1)) - MD_RESERVED_BLOCKS) | ||
50 | 48 | ||
51 | #define MD_SB_BYTES 4096 | 49 | #define MD_SB_BYTES 4096 |
52 | #define MD_SB_WORDS (MD_SB_BYTES / 4) | 50 | #define MD_SB_WORDS (MD_SB_BYTES / 4) |
53 | #define MD_SB_BLOCKS (MD_SB_BYTES / BLOCK_SIZE) | ||
54 | #define MD_SB_SECTORS (MD_SB_BYTES / 512) | 51 | #define MD_SB_SECTORS (MD_SB_BYTES / 512) |
55 | 52 | ||
56 | /* | 53 | /* |
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index f0827d31ae6f..3b2672792457 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h | |||
@@ -158,6 +158,43 @@ | |||
158 | * the compute block completes. | 158 | * the compute block completes. |
159 | */ | 159 | */ |
160 | 160 | ||
161 | /* | ||
162 | * Operations state - intermediate states that are visible outside of sh->lock | ||
163 | * In general _idle indicates nothing is running, _run indicates a data | ||
164 | * processing operation is active, and _result means the data processing result | ||
165 | * is stable and can be acted upon. For simple operations like biofill and | ||
166 | * compute that only have an _idle and _run state they are indicated with | ||
167 | * sh->state flags (STRIPE_BIOFILL_RUN and STRIPE_COMPUTE_RUN) | ||
168 | */ | ||
169 | /** | ||
170 | * enum check_states - handles syncing / repairing a stripe | ||
171 | * @check_state_idle - check operations are quiesced | ||
172 | * @check_state_run - check operation is running | ||
173 | * @check_state_result - set outside lock when check result is valid | ||
174 | * @check_state_compute_run - check failed and we are repairing | ||
175 | * @check_state_compute_result - set outside lock when compute result is valid | ||
176 | */ | ||
177 | enum check_states { | ||
178 | check_state_idle = 0, | ||
179 | check_state_run, /* parity check */ | ||
180 | check_state_check_result, | ||
181 | check_state_compute_run, /* parity repair */ | ||
182 | check_state_compute_result, | ||
183 | }; | ||
184 | |||
185 | /** | ||
186 | * enum reconstruct_states - handles writing or expanding a stripe | ||
187 | */ | ||
188 | enum reconstruct_states { | ||
189 | reconstruct_state_idle = 0, | ||
190 | reconstruct_state_prexor_drain_run, /* prexor-write */ | ||
191 | reconstruct_state_drain_run, /* write */ | ||
192 | reconstruct_state_run, /* expand */ | ||
193 | reconstruct_state_prexor_drain_result, | ||
194 | reconstruct_state_drain_result, | ||
195 | reconstruct_state_result, | ||
196 | }; | ||
197 | |||
161 | struct stripe_head { | 198 | struct stripe_head { |
162 | struct hlist_node hash; | 199 | struct hlist_node hash; |
163 | struct list_head lru; /* inactive_list or handle_list */ | 200 | struct list_head lru; /* inactive_list or handle_list */ |
@@ -169,19 +206,13 @@ struct stripe_head { | |||
169 | spinlock_t lock; | 206 | spinlock_t lock; |
170 | int bm_seq; /* sequence number for bitmap flushes */ | 207 | int bm_seq; /* sequence number for bitmap flushes */ |
171 | int disks; /* disks in stripe */ | 208 | int disks; /* disks in stripe */ |
209 | enum check_states check_state; | ||
210 | enum reconstruct_states reconstruct_state; | ||
172 | /* stripe_operations | 211 | /* stripe_operations |
173 | * @pending - pending ops flags (set for request->issue->complete) | ||
174 | * @ack - submitted ops flags (set for issue->complete) | ||
175 | * @complete - completed ops flags (set for complete) | ||
176 | * @target - STRIPE_OP_COMPUTE_BLK target | 212 | * @target - STRIPE_OP_COMPUTE_BLK target |
177 | * @count - raid5_runs_ops is set to run when this is non-zero | ||
178 | */ | 213 | */ |
179 | struct stripe_operations { | 214 | struct stripe_operations { |
180 | unsigned long pending; | ||
181 | unsigned long ack; | ||
182 | unsigned long complete; | ||
183 | int target; | 215 | int target; |
184 | int count; | ||
185 | u32 zero_sum_result; | 216 | u32 zero_sum_result; |
186 | } ops; | 217 | } ops; |
187 | struct r5dev { | 218 | struct r5dev { |
@@ -202,6 +233,7 @@ struct stripe_head_state { | |||
202 | int locked, uptodate, to_read, to_write, failed, written; | 233 | int locked, uptodate, to_read, to_write, failed, written; |
203 | int to_fill, compute, req_compute, non_overwrite; | 234 | int to_fill, compute, req_compute, non_overwrite; |
204 | int failed_num; | 235 | int failed_num; |
236 | unsigned long ops_request; | ||
205 | }; | 237 | }; |
206 | 238 | ||
207 | /* r6_state - extra state data only relevant to r6 */ | 239 | /* r6_state - extra state data only relevant to r6 */ |
@@ -228,9 +260,7 @@ struct r6_state { | |||
228 | #define R5_Wantfill 12 /* dev->toread contains a bio that needs | 260 | #define R5_Wantfill 12 /* dev->toread contains a bio that needs |
229 | * filling | 261 | * filling |
230 | */ | 262 | */ |
231 | #define R5_Wantprexor 13 /* distinguish blocks ready for rmw from | 263 | #define R5_Wantdrain 13 /* dev->towrite needs to be drained */ |
232 | * other "towrites" | ||
233 | */ | ||
234 | /* | 264 | /* |
235 | * Write method | 265 | * Write method |
236 | */ | 266 | */ |
@@ -254,8 +284,10 @@ struct r6_state { | |||
254 | #define STRIPE_EXPAND_READY 11 | 284 | #define STRIPE_EXPAND_READY 11 |
255 | #define STRIPE_IO_STARTED 12 /* do not count towards 'bypass_count' */ | 285 | #define STRIPE_IO_STARTED 12 /* do not count towards 'bypass_count' */ |
256 | #define STRIPE_FULL_WRITE 13 /* all blocks are set to be overwritten */ | 286 | #define STRIPE_FULL_WRITE 13 /* all blocks are set to be overwritten */ |
287 | #define STRIPE_BIOFILL_RUN 14 | ||
288 | #define STRIPE_COMPUTE_RUN 15 | ||
257 | /* | 289 | /* |
258 | * Operations flags (in issue order) | 290 | * Operation request flags |
259 | */ | 291 | */ |
260 | #define STRIPE_OP_BIOFILL 0 | 292 | #define STRIPE_OP_BIOFILL 0 |
261 | #define STRIPE_OP_COMPUTE_BLK 1 | 293 | #define STRIPE_OP_COMPUTE_BLK 1 |
@@ -263,14 +295,6 @@ struct r6_state { | |||
263 | #define STRIPE_OP_BIODRAIN 3 | 295 | #define STRIPE_OP_BIODRAIN 3 |
264 | #define STRIPE_OP_POSTXOR 4 | 296 | #define STRIPE_OP_POSTXOR 4 |
265 | #define STRIPE_OP_CHECK 5 | 297 | #define STRIPE_OP_CHECK 5 |
266 | #define STRIPE_OP_IO 6 | ||
267 | |||
268 | /* modifiers to the base operations | ||
269 | * STRIPE_OP_MOD_REPAIR_PD - compute the parity block and write it back | ||
270 | * STRIPE_OP_MOD_DMA_CHECK - parity is not corrupted by the check | ||
271 | */ | ||
272 | #define STRIPE_OP_MOD_REPAIR_PD 7 | ||
273 | #define STRIPE_OP_MOD_DMA_CHECK 8 | ||
274 | 298 | ||
275 | /* | 299 | /* |
276 | * Plugging: | 300 | * Plugging: |
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index e3ab21d7fc7f..c5f6e54ec6ae 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -34,26 +34,37 @@ | |||
34 | * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device. | 34 | * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device. |
35 | * RFKILL_TYPE_UWB: switch is on a ultra wideband device. | 35 | * RFKILL_TYPE_UWB: switch is on a ultra wideband device. |
36 | * RFKILL_TYPE_WIMAX: switch is on a WiMAX device. | 36 | * RFKILL_TYPE_WIMAX: switch is on a WiMAX device. |
37 | * RFKILL_TYPE_WWAN: switch is on a wireless WAN device. | ||
37 | */ | 38 | */ |
38 | enum rfkill_type { | 39 | enum rfkill_type { |
39 | RFKILL_TYPE_WLAN , | 40 | RFKILL_TYPE_WLAN , |
40 | RFKILL_TYPE_BLUETOOTH, | 41 | RFKILL_TYPE_BLUETOOTH, |
41 | RFKILL_TYPE_UWB, | 42 | RFKILL_TYPE_UWB, |
42 | RFKILL_TYPE_WIMAX, | 43 | RFKILL_TYPE_WIMAX, |
44 | RFKILL_TYPE_WWAN, | ||
43 | RFKILL_TYPE_MAX, | 45 | RFKILL_TYPE_MAX, |
44 | }; | 46 | }; |
45 | 47 | ||
46 | enum rfkill_state { | 48 | enum rfkill_state { |
47 | RFKILL_STATE_OFF = 0, | 49 | RFKILL_STATE_SOFT_BLOCKED = 0, /* Radio output blocked */ |
48 | RFKILL_STATE_ON = 1, | 50 | RFKILL_STATE_UNBLOCKED = 1, /* Radio output allowed */ |
51 | RFKILL_STATE_HARD_BLOCKED = 2, /* Output blocked, non-overrideable */ | ||
49 | }; | 52 | }; |
50 | 53 | ||
54 | /* | ||
55 | * These are DEPRECATED, drivers using them should be verified to | ||
56 | * comply with the rfkill usage guidelines in Documentation/rfkill.txt | ||
57 | * and then converted to use the new names for rfkill_state | ||
58 | */ | ||
59 | #define RFKILL_STATE_OFF RFKILL_STATE_SOFT_BLOCKED | ||
60 | #define RFKILL_STATE_ON RFKILL_STATE_UNBLOCKED | ||
61 | |||
51 | /** | 62 | /** |
52 | * struct rfkill - rfkill control structure. | 63 | * struct rfkill - rfkill control structure. |
53 | * @name: Name of the switch. | 64 | * @name: Name of the switch. |
54 | * @type: Radio type which the button controls, the value stored | 65 | * @type: Radio type which the button controls, the value stored |
55 | * here should be a value from enum rfkill_type. | 66 | * here should be a value from enum rfkill_type. |
56 | * @state: State of the switch (on/off). | 67 | * @state: State of the switch, "UNBLOCKED" means radio can operate. |
57 | * @user_claim_unsupported: Whether the hardware supports exclusive | 68 | * @user_claim_unsupported: Whether the hardware supports exclusive |
58 | * RF-kill control by userspace. Set this before registering. | 69 | * RF-kill control by userspace. Set this before registering. |
59 | * @user_claim: Set when the switch is controlled exlusively by userspace. | 70 | * @user_claim: Set when the switch is controlled exlusively by userspace. |
@@ -61,6 +72,12 @@ enum rfkill_state { | |||
61 | * @data: Pointer to the RF button drivers private data which will be | 72 | * @data: Pointer to the RF button drivers private data which will be |
62 | * passed along when toggling radio state. | 73 | * passed along when toggling radio state. |
63 | * @toggle_radio(): Mandatory handler to control state of the radio. | 74 | * @toggle_radio(): Mandatory handler to control state of the radio. |
75 | * only RFKILL_STATE_SOFT_BLOCKED and RFKILL_STATE_UNBLOCKED are | ||
76 | * valid parameters. | ||
77 | * @get_state(): handler to read current radio state from hardware, | ||
78 | * may be called from atomic context, should return 0 on success. | ||
79 | * Either this handler OR judicious use of rfkill_force_state() is | ||
80 | * MANDATORY for any driver capable of RFKILL_STATE_HARD_BLOCKED. | ||
64 | * @led_trigger: A LED trigger for this button's LED. | 81 | * @led_trigger: A LED trigger for this button's LED. |
65 | * @dev: Device structure integrating the switch into device tree. | 82 | * @dev: Device structure integrating the switch into device tree. |
66 | * @node: Used to place switch into list of all switches known to the | 83 | * @node: Used to place switch into list of all switches known to the |
@@ -80,6 +97,7 @@ struct rfkill { | |||
80 | 97 | ||
81 | void *data; | 98 | void *data; |
82 | int (*toggle_radio)(void *data, enum rfkill_state state); | 99 | int (*toggle_radio)(void *data, enum rfkill_state state); |
100 | int (*get_state)(void *data, enum rfkill_state *state); | ||
83 | 101 | ||
84 | #ifdef CONFIG_RFKILL_LEDS | 102 | #ifdef CONFIG_RFKILL_LEDS |
85 | struct led_trigger led_trigger; | 103 | struct led_trigger led_trigger; |
@@ -95,6 +113,21 @@ void rfkill_free(struct rfkill *rfkill); | |||
95 | int rfkill_register(struct rfkill *rfkill); | 113 | int rfkill_register(struct rfkill *rfkill); |
96 | void rfkill_unregister(struct rfkill *rfkill); | 114 | void rfkill_unregister(struct rfkill *rfkill); |
97 | 115 | ||
116 | int rfkill_force_state(struct rfkill *rfkill, enum rfkill_state state); | ||
117 | |||
118 | /** | ||
119 | * rfkill_state_complement - return complementar state | ||
120 | * @state: state to return the complement of | ||
121 | * | ||
122 | * Returns RFKILL_STATE_SOFT_BLOCKED if @state is RFKILL_STATE_UNBLOCKED, | ||
123 | * returns RFKILL_STATE_UNBLOCKED otherwise. | ||
124 | */ | ||
125 | static inline enum rfkill_state rfkill_state_complement(enum rfkill_state state) | ||
126 | { | ||
127 | return (state == RFKILL_STATE_UNBLOCKED) ? | ||
128 | RFKILL_STATE_SOFT_BLOCKED : RFKILL_STATE_UNBLOCKED; | ||
129 | } | ||
130 | |||
98 | /** | 131 | /** |
99 | * rfkill_get_led_name - Get the LED trigger name for the button's LED. | 132 | * rfkill_get_led_name - Get the LED trigger name for the button's LED. |
100 | * This function might return a NULL pointer if registering of the | 133 | * This function might return a NULL pointer if registering of the |
@@ -110,4 +143,11 @@ static inline char *rfkill_get_led_name(struct rfkill *rfkill) | |||
110 | #endif | 143 | #endif |
111 | } | 144 | } |
112 | 145 | ||
146 | /* rfkill notification chain */ | ||
147 | #define RFKILL_STATE_CHANGED 0x0001 /* state of a normal rfkill | ||
148 | switch has changed */ | ||
149 | |||
150 | int register_rfkill_notifier(struct notifier_block *nb); | ||
151 | int unregister_rfkill_notifier(struct notifier_block *nb); | ||
152 | |||
113 | #endif /* RFKILL_H */ | 153 | #endif /* RFKILL_H */ |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index f2d0d1527721..b01fe004cb5e 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -115,6 +115,23 @@ extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); | |||
115 | 115 | ||
116 | extern struct class *rtc_class; | 116 | extern struct class *rtc_class; |
117 | 117 | ||
118 | /* | ||
119 | * For these RTC methods the device parameter is the physical device | ||
120 | * on whatever bus holds the hardware (I2C, Platform, SPI, etc), which | ||
121 | * was passed to rtc_device_register(). Its driver_data normally holds | ||
122 | * device state, including the rtc_device pointer for the RTC. | ||
123 | * | ||
124 | * Most of these methods are called with rtc_device.ops_lock held, | ||
125 | * through the rtc_*(struct rtc_device *, ...) calls. | ||
126 | * | ||
127 | * The (current) exceptions are mostly filesystem hooks: | ||
128 | * - the proc() hook for procfs | ||
129 | * - non-ioctl() chardev hooks: open(), release(), read_callback() | ||
130 | * - periodic irq calls: irq_set_state(), irq_set_freq() | ||
131 | * | ||
132 | * REVISIT those periodic irq calls *do* have ops_lock when they're | ||
133 | * issued through ioctl() ... | ||
134 | */ | ||
118 | struct rtc_class_ops { | 135 | struct rtc_class_ops { |
119 | int (*open)(struct device *); | 136 | int (*open)(struct device *); |
120 | void (*release)(struct device *); | 137 | void (*release)(struct device *); |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index b358c704d102..f4d386c191f5 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -482,6 +482,7 @@ enum | |||
482 | TCA_RATE, | 482 | TCA_RATE, |
483 | TCA_FCNT, | 483 | TCA_FCNT, |
484 | TCA_STATS2, | 484 | TCA_STATS2, |
485 | TCA_STAB, | ||
485 | __TCA_MAX | 486 | __TCA_MAX |
486 | }; | 487 | }; |
487 | 488 | ||
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 71fc81360048..e5996984ddd0 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
@@ -224,4 +224,42 @@ size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents, | |||
224 | */ | 224 | */ |
225 | #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) | 225 | #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) |
226 | 226 | ||
227 | |||
228 | /* | ||
229 | * Mapping sg iterator | ||
230 | * | ||
231 | * Iterates over sg entries mapping page-by-page. On each successful | ||
232 | * iteration, @miter->page points to the mapped page and | ||
233 | * @miter->length bytes of data can be accessed at @miter->addr. As | ||
234 | * long as an interation is enclosed between start and stop, the user | ||
235 | * is free to choose control structure and when to stop. | ||
236 | * | ||
237 | * @miter->consumed is set to @miter->length on each iteration. It | ||
238 | * can be adjusted if the user can't consume all the bytes in one go. | ||
239 | * Also, a stopped iteration can be resumed by calling next on it. | ||
240 | * This is useful when iteration needs to release all resources and | ||
241 | * continue later (e.g. at the next interrupt). | ||
242 | */ | ||
243 | |||
244 | #define SG_MITER_ATOMIC (1 << 0) /* use kmap_atomic */ | ||
245 | |||
246 | struct sg_mapping_iter { | ||
247 | /* the following three fields can be accessed directly */ | ||
248 | struct page *page; /* currently mapped page */ | ||
249 | void *addr; /* pointer to the mapped area */ | ||
250 | size_t length; /* length of the mapped area */ | ||
251 | size_t consumed; /* number of consumed bytes */ | ||
252 | |||
253 | /* these are internal states, keep away */ | ||
254 | struct scatterlist *__sg; /* current entry */ | ||
255 | unsigned int __nents; /* nr of remaining entries */ | ||
256 | unsigned int __offset; /* offset within sg */ | ||
257 | unsigned int __flags; | ||
258 | }; | ||
259 | |||
260 | void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl, | ||
261 | unsigned int nents, unsigned int flags); | ||
262 | bool sg_miter_next(struct sg_mapping_iter *miter); | ||
263 | void sg_miter_stop(struct sg_mapping_iter *miter); | ||
264 | |||
227 | #endif /* _LINUX_SCATTERLIST_H */ | 265 | #endif /* _LINUX_SCATTERLIST_H */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 1941d8b5cf11..6aca4a16e377 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -295,10 +295,11 @@ extern void softlockup_tick(void); | |||
295 | extern void spawn_softlockup_task(void); | 295 | extern void spawn_softlockup_task(void); |
296 | extern void touch_softlockup_watchdog(void); | 296 | extern void touch_softlockup_watchdog(void); |
297 | extern void touch_all_softlockup_watchdogs(void); | 297 | extern void touch_all_softlockup_watchdogs(void); |
298 | extern unsigned long softlockup_thresh; | 298 | extern unsigned int softlockup_panic; |
299 | extern unsigned long sysctl_hung_task_check_count; | 299 | extern unsigned long sysctl_hung_task_check_count; |
300 | extern unsigned long sysctl_hung_task_timeout_secs; | 300 | extern unsigned long sysctl_hung_task_timeout_secs; |
301 | extern unsigned long sysctl_hung_task_warnings; | 301 | extern unsigned long sysctl_hung_task_warnings; |
302 | extern int softlockup_thresh; | ||
302 | #else | 303 | #else |
303 | static inline void softlockup_tick(void) | 304 | static inline void softlockup_tick(void) |
304 | { | 305 | { |
@@ -824,7 +825,16 @@ extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | |||
824 | struct sched_domain_attr *dattr_new); | 825 | struct sched_domain_attr *dattr_new); |
825 | extern int arch_reinit_sched_domains(void); | 826 | extern int arch_reinit_sched_domains(void); |
826 | 827 | ||
827 | #endif /* CONFIG_SMP */ | 828 | #else /* CONFIG_SMP */ |
829 | |||
830 | struct sched_domain_attr; | ||
831 | |||
832 | static inline void | ||
833 | partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | ||
834 | struct sched_domain_attr *dattr_new) | ||
835 | { | ||
836 | } | ||
837 | #endif /* !CONFIG_SMP */ | ||
828 | 838 | ||
829 | struct io_context; /* See blkdev.h */ | 839 | struct io_context; /* See blkdev.h */ |
830 | #define NGROUPS_SMALL 32 | 840 | #define NGROUPS_SMALL 32 |
@@ -1973,6 +1983,13 @@ static inline unsigned long *end_of_stack(struct task_struct *p) | |||
1973 | 1983 | ||
1974 | #endif | 1984 | #endif |
1975 | 1985 | ||
1986 | static inline int object_is_on_stack(void *obj) | ||
1987 | { | ||
1988 | void *stack = task_stack_page(current); | ||
1989 | |||
1990 | return (obj >= stack) && (obj < (stack + THREAD_SIZE)); | ||
1991 | } | ||
1992 | |||
1976 | extern void thread_info_cache_init(void); | 1993 | extern void thread_info_cache_init(void); |
1977 | 1994 | ||
1978 | /* set thread flags in other task's structures | 1995 | /* set thread flags in other task's structures |
diff --git a/include/linux/security.h b/include/linux/security.h index 31c8851ec5d0..f0e9adb22ac2 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -102,9 +102,7 @@ extern unsigned long mmap_min_addr; | |||
102 | #define LSM_SETID_FS 8 | 102 | #define LSM_SETID_FS 8 |
103 | 103 | ||
104 | /* forward declares to avoid warnings */ | 104 | /* forward declares to avoid warnings */ |
105 | struct nfsctl_arg; | ||
106 | struct sched_param; | 105 | struct sched_param; |
107 | struct swap_info_struct; | ||
108 | struct request_sock; | 106 | struct request_sock; |
109 | 107 | ||
110 | /* bprm_apply_creds unsafe reasons */ | 108 | /* bprm_apply_creds unsafe reasons */ |
diff --git a/include/linux/seq_file_net.h b/include/linux/seq_file_net.h index 4ac52542a563..32c89bbe24a2 100644 --- a/include/linux/seq_file_net.h +++ b/include/linux/seq_file_net.h | |||
@@ -14,7 +14,10 @@ struct seq_net_private { | |||
14 | 14 | ||
15 | int seq_open_net(struct inode *, struct file *, | 15 | int seq_open_net(struct inode *, struct file *, |
16 | const struct seq_operations *, int); | 16 | const struct seq_operations *, int); |
17 | int single_open_net(struct inode *, struct file *file, | ||
18 | int (*show)(struct seq_file *, void *)); | ||
17 | int seq_release_net(struct inode *, struct file *); | 19 | int seq_release_net(struct inode *, struct file *); |
20 | int single_release_net(struct inode *, struct file *); | ||
18 | static inline struct net *seq_file_net(struct seq_file *seq) | 21 | static inline struct net *seq_file_net(struct seq_file *seq) |
19 | { | 22 | { |
20 | #ifdef CONFIG_NET_NS | 23 | #ifdef CONFIG_NET_NS |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index d8f31de632c5..3b2f6c04855e 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -59,9 +59,6 @@ | |||
59 | #define PORT_SUNZILOG 38 | 59 | #define PORT_SUNZILOG 38 |
60 | #define PORT_SUNSAB 39 | 60 | #define PORT_SUNSAB 39 |
61 | 61 | ||
62 | /* NEC v850. */ | ||
63 | #define PORT_V850E_UART 40 | ||
64 | |||
65 | /* DEC */ | 62 | /* DEC */ |
66 | #define PORT_DZ 46 | 63 | #define PORT_DZ 46 |
67 | #define PORT_ZS 47 | 64 | #define PORT_ZS 47 |
@@ -190,6 +187,7 @@ struct uart_ops { | |||
190 | void (*break_ctl)(struct uart_port *, int ctl); | 187 | void (*break_ctl)(struct uart_port *, int ctl); |
191 | int (*startup)(struct uart_port *); | 188 | int (*startup)(struct uart_port *); |
192 | void (*shutdown)(struct uart_port *); | 189 | void (*shutdown)(struct uart_port *); |
190 | void (*flush_buffer)(struct uart_port *); | ||
193 | void (*set_termios)(struct uart_port *, struct ktermios *new, | 191 | void (*set_termios)(struct uart_port *, struct ktermios *new, |
194 | struct ktermios *old); | 192 | struct ktermios *old); |
195 | void (*set_ldisc)(struct uart_port *); | 193 | void (*set_ldisc)(struct uart_port *); |
@@ -343,13 +341,15 @@ typedef unsigned int __bitwise__ uif_t; | |||
343 | * stuff here. | 341 | * stuff here. |
344 | */ | 342 | */ |
345 | struct uart_info { | 343 | struct uart_info { |
346 | struct tty_struct *tty; | 344 | struct tty_port port; |
347 | struct circ_buf xmit; | 345 | struct circ_buf xmit; |
348 | uif_t flags; | 346 | uif_t flags; |
349 | 347 | ||
350 | /* | 348 | /* |
351 | * Definitions for info->flags. These are _private_ to serial_core, and | 349 | * Definitions for info->flags. These are _private_ to serial_core, and |
352 | * are specific to this structure. They may be queried by low level drivers. | 350 | * are specific to this structure. They may be queried by low level drivers. |
351 | * | ||
352 | * FIXME: use the ASY_ definitions | ||
353 | */ | 353 | */ |
354 | #define UIF_CHECK_CD ((__force uif_t) (1 << 25)) | 354 | #define UIF_CHECK_CD ((__force uif_t) (1 << 25)) |
355 | #define UIF_CTS_FLOW ((__force uif_t) (1 << 26)) | 355 | #define UIF_CTS_FLOW ((__force uif_t) (1 << 26)) |
@@ -357,11 +357,7 @@ struct uart_info { | |||
357 | #define UIF_INITIALIZED ((__force uif_t) (1 << 31)) | 357 | #define UIF_INITIALIZED ((__force uif_t) (1 << 31)) |
358 | #define UIF_SUSPENDED ((__force uif_t) (1 << 30)) | 358 | #define UIF_SUSPENDED ((__force uif_t) (1 << 30)) |
359 | 359 | ||
360 | int blocked_open; | ||
361 | |||
362 | struct tasklet_struct tlet; | 360 | struct tasklet_struct tlet; |
363 | |||
364 | wait_queue_head_t open_wait; | ||
365 | wait_queue_head_t delta_msr_wait; | 361 | wait_queue_head_t delta_msr_wait; |
366 | }; | 362 | }; |
367 | 363 | ||
@@ -438,8 +434,8 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port); | |||
438 | #define uart_circ_chars_free(circ) \ | 434 | #define uart_circ_chars_free(circ) \ |
439 | (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE)) | 435 | (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE)) |
440 | 436 | ||
441 | #define uart_tx_stopped(port) \ | 437 | #define uart_tx_stopped(portp) \ |
442 | ((port)->info->tty->stopped || (port)->info->tty->hw_stopped) | 438 | ((portp)->info->port.tty->stopped || (portp)->info->port.tty->hw_stopped) |
443 | 439 | ||
444 | /* | 440 | /* |
445 | * The following are helper functions for the low level drivers. | 441 | * The following are helper functions for the low level drivers. |
@@ -450,7 +446,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) | |||
450 | #ifdef SUPPORT_SYSRQ | 446 | #ifdef SUPPORT_SYSRQ |
451 | if (port->sysrq) { | 447 | if (port->sysrq) { |
452 | if (ch && time_before(jiffies, port->sysrq)) { | 448 | if (ch && time_before(jiffies, port->sysrq)) { |
453 | handle_sysrq(ch, port->info ? port->info->tty : NULL); | 449 | handle_sysrq(ch, port->info ? port->info->port.tty : NULL); |
454 | port->sysrq = 0; | 450 | port->sysrq = 0; |
455 | return 1; | 451 | return 1; |
456 | } | 452 | } |
@@ -479,7 +475,7 @@ static inline int uart_handle_break(struct uart_port *port) | |||
479 | } | 475 | } |
480 | #endif | 476 | #endif |
481 | if (port->flags & UPF_SAK) | 477 | if (port->flags & UPF_SAK) |
482 | do_SAK(info->tty); | 478 | do_SAK(info->port.tty); |
483 | return 0; | 479 | return 0; |
484 | } | 480 | } |
485 | 481 | ||
@@ -502,9 +498,9 @@ uart_handle_dcd_change(struct uart_port *port, unsigned int status) | |||
502 | 498 | ||
503 | if (info->flags & UIF_CHECK_CD) { | 499 | if (info->flags & UIF_CHECK_CD) { |
504 | if (status) | 500 | if (status) |
505 | wake_up_interruptible(&info->open_wait); | 501 | wake_up_interruptible(&info->port.open_wait); |
506 | else if (info->tty) | 502 | else if (info->port.tty) |
507 | tty_hangup(info->tty); | 503 | tty_hangup(info->port.tty); |
508 | } | 504 | } |
509 | } | 505 | } |
510 | 506 | ||
@@ -517,7 +513,7 @@ static inline void | |||
517 | uart_handle_cts_change(struct uart_port *port, unsigned int status) | 513 | uart_handle_cts_change(struct uart_port *port, unsigned int status) |
518 | { | 514 | { |
519 | struct uart_info *info = port->info; | 515 | struct uart_info *info = port->info; |
520 | struct tty_struct *tty = info->tty; | 516 | struct tty_struct *tty = info->port.tty; |
521 | 517 | ||
522 | port->icount.cts++; | 518 | port->icount.cts++; |
523 | 519 | ||
@@ -543,7 +539,7 @@ static inline void | |||
543 | uart_insert_char(struct uart_port *port, unsigned int status, | 539 | uart_insert_char(struct uart_port *port, unsigned int status, |
544 | unsigned int overrun, unsigned int ch, unsigned int flag) | 540 | unsigned int overrun, unsigned int ch, unsigned int flag) |
545 | { | 541 | { |
546 | struct tty_struct *tty = port->info->tty; | 542 | struct tty_struct *tty = port->info->port.tty; |
547 | 543 | ||
548 | if ((status & port->ignore_status_mask & ~overrun) == 0) | 544 | if ((status & port->ignore_status_mask & ~overrun) == 0) |
549 | tty_insert_flip_char(tty, ch, flag); | 545 | tty_insert_flip_char(tty, ch, flag); |
diff --git a/include/linux/serio.h b/include/linux/serio.h index 95674d97dabd..e72716cca577 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -175,7 +175,7 @@ static inline void serio_unpin_driver(struct serio *serio) | |||
175 | #define SERIO_8042_XL 0x06 | 175 | #define SERIO_8042_XL 0x06 |
176 | 176 | ||
177 | /* | 177 | /* |
178 | * Serio types | 178 | * Serio protocols |
179 | */ | 179 | */ |
180 | #define SERIO_UNKNOWN 0x00 | 180 | #define SERIO_UNKNOWN 0x00 |
181 | #define SERIO_MSC 0x01 | 181 | #define SERIO_MSC 0x01 |
@@ -212,5 +212,7 @@ static inline void serio_unpin_driver(struct serio *serio) | |||
212 | #define SERIO_TAOSEVM 0x34 | 212 | #define SERIO_TAOSEVM 0x34 |
213 | #define SERIO_FUJITSU 0x35 | 213 | #define SERIO_FUJITSU 0x35 |
214 | #define SERIO_ZHENHUA 0x36 | 214 | #define SERIO_ZHENHUA 0x36 |
215 | #define SERIO_INEXIO 0x37 | ||
216 | #define SERIO_TOUCHIT213 0x37 | ||
215 | 217 | ||
216 | #endif | 218 | #endif |
diff --git a/include/linux/signalfd.h b/include/linux/signalfd.h index ea037f28df91..bef0c46d4713 100644 --- a/include/linux/signalfd.h +++ b/include/linux/signalfd.h | |||
@@ -8,6 +8,12 @@ | |||
8 | #ifndef _LINUX_SIGNALFD_H | 8 | #ifndef _LINUX_SIGNALFD_H |
9 | #define _LINUX_SIGNALFD_H | 9 | #define _LINUX_SIGNALFD_H |
10 | 10 | ||
11 | /* For O_CLOEXEC and O_NONBLOCK */ | ||
12 | #include <linux/fcntl.h> | ||
13 | |||
14 | /* Flags for signalfd4. */ | ||
15 | #define SFD_CLOEXEC O_CLOEXEC | ||
16 | #define SFD_NONBLOCK O_NONBLOCK | ||
11 | 17 | ||
12 | struct signalfd_siginfo { | 18 | struct signalfd_siginfo { |
13 | __u32 ssi_signo; | 19 | __u32 ssi_signo; |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 299ec4b31412..7ea44f6621f2 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -246,6 +246,7 @@ typedef unsigned char *sk_buff_data_t; | |||
246 | * @dma_cookie: a cookie to one of several possible DMA operations | 246 | * @dma_cookie: a cookie to one of several possible DMA operations |
247 | * done by skb DMA functions | 247 | * done by skb DMA functions |
248 | * @secmark: security marking | 248 | * @secmark: security marking |
249 | * @vlan_tci: vlan tag control information | ||
249 | */ | 250 | */ |
250 | 251 | ||
251 | struct sk_buff { | 252 | struct sk_buff { |
@@ -305,9 +306,7 @@ struct sk_buff { | |||
305 | #endif | 306 | #endif |
306 | 307 | ||
307 | int iif; | 308 | int iif; |
308 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | ||
309 | __u16 queue_mapping; | 309 | __u16 queue_mapping; |
310 | #endif | ||
311 | #ifdef CONFIG_NET_SCHED | 310 | #ifdef CONFIG_NET_SCHED |
312 | __u16 tc_index; /* traffic control index */ | 311 | __u16 tc_index; /* traffic control index */ |
313 | #ifdef CONFIG_NET_CLS_ACT | 312 | #ifdef CONFIG_NET_CLS_ACT |
@@ -328,6 +327,8 @@ struct sk_buff { | |||
328 | 327 | ||
329 | __u32 mark; | 328 | __u32 mark; |
330 | 329 | ||
330 | __u16 vlan_tci; | ||
331 | |||
331 | sk_buff_data_t transport_header; | 332 | sk_buff_data_t transport_header; |
332 | sk_buff_data_t network_header; | 333 | sk_buff_data_t network_header; |
333 | sk_buff_data_t mac_header; | 334 | sk_buff_data_t mac_header; |
@@ -1671,25 +1672,17 @@ static inline void skb_init_secmark(struct sk_buff *skb) | |||
1671 | 1672 | ||
1672 | static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping) | 1673 | static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping) |
1673 | { | 1674 | { |
1674 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | ||
1675 | skb->queue_mapping = queue_mapping; | 1675 | skb->queue_mapping = queue_mapping; |
1676 | #endif | ||
1677 | } | 1676 | } |
1678 | 1677 | ||
1679 | static inline u16 skb_get_queue_mapping(struct sk_buff *skb) | 1678 | static inline u16 skb_get_queue_mapping(struct sk_buff *skb) |
1680 | { | 1679 | { |
1681 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | ||
1682 | return skb->queue_mapping; | 1680 | return skb->queue_mapping; |
1683 | #else | ||
1684 | return 0; | ||
1685 | #endif | ||
1686 | } | 1681 | } |
1687 | 1682 | ||
1688 | static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from) | 1683 | static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from) |
1689 | { | 1684 | { |
1690 | #ifdef CONFIG_NETDEVICES_MULTIQUEUE | ||
1691 | to->queue_mapping = from->queue_mapping; | 1685 | to->queue_mapping = from->queue_mapping; |
1692 | #endif | ||
1693 | } | 1686 | } |
1694 | 1687 | ||
1695 | static inline int skb_is_gso(const struct sk_buff *skb) | 1688 | static inline int skb_is_gso(const struct sk_buff *skb) |
@@ -1702,6 +1695,20 @@ static inline int skb_is_gso_v6(const struct sk_buff *skb) | |||
1702 | return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; | 1695 | return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; |
1703 | } | 1696 | } |
1704 | 1697 | ||
1698 | extern void __skb_warn_lro_forwarding(const struct sk_buff *skb); | ||
1699 | |||
1700 | static inline bool skb_warn_if_lro(const struct sk_buff *skb) | ||
1701 | { | ||
1702 | /* LRO sets gso_size but not gso_type, whereas if GSO is really | ||
1703 | * wanted then gso_type will be set. */ | ||
1704 | struct skb_shared_info *shinfo = skb_shinfo(skb); | ||
1705 | if (shinfo->gso_size != 0 && unlikely(shinfo->gso_type == 0)) { | ||
1706 | __skb_warn_lro_forwarding(skb); | ||
1707 | return true; | ||
1708 | } | ||
1709 | return false; | ||
1710 | } | ||
1711 | |||
1705 | static inline void skb_forward_csum(struct sk_buff *skb) | 1712 | static inline void skb_forward_csum(struct sk_buff *skb) |
1706 | { | 1713 | { |
1707 | /* Unfortunately we don't support this one. Any brave souls? */ | 1714 | /* Unfortunately we don't support this one. Any brave souls? */ |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 9aa90a6f20e0..41103910f8a2 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -180,7 +180,7 @@ size_t ksize(const void *); | |||
180 | */ | 180 | */ |
181 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | 181 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) |
182 | { | 182 | { |
183 | if (n != 0 && size > ULONG_MAX / n) | 183 | if (size != 0 && n > ULONG_MAX / size) |
184 | return NULL; | 184 | return NULL; |
185 | return __kmalloc(n * size, flags | __GFP_ZERO); | 185 | return __kmalloc(n * size, flags | __GFP_ZERO); |
186 | } | 186 | } |
diff --git a/include/linux/sm501.h b/include/linux/sm501.h index 95c1c39ba445..b530fa6a1d34 100644 --- a/include/linux/sm501.h +++ b/include/linux/sm501.h | |||
@@ -73,6 +73,8 @@ extern unsigned long sm501_gpio_get(struct device *dev, | |||
73 | #define SM501FB_FLAG_USE_HWACCEL (1<<3) | 73 | #define SM501FB_FLAG_USE_HWACCEL (1<<3) |
74 | #define SM501FB_FLAG_PANEL_NO_FPEN (1<<4) | 74 | #define SM501FB_FLAG_PANEL_NO_FPEN (1<<4) |
75 | #define SM501FB_FLAG_PANEL_NO_VBIASEN (1<<5) | 75 | #define SM501FB_FLAG_PANEL_NO_VBIASEN (1<<5) |
76 | #define SM501FB_FLAG_PANEL_INV_FPEN (1<<6) | ||
77 | #define SM501FB_FLAG_PANEL_INV_VBIASEN (1<<7) | ||
76 | 78 | ||
77 | struct sm501_platdata_fbsub { | 79 | struct sm501_platdata_fbsub { |
78 | struct fb_videomode *def_mode; | 80 | struct fb_videomode *def_mode; |
diff --git a/include/linux/smc911x.h b/include/linux/smc911x.h new file mode 100644 index 000000000000..b58f54c24183 --- /dev/null +++ b/include/linux/smc911x.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef __SMC911X_H__ | ||
2 | #define __SMC911X_H__ | ||
3 | |||
4 | #define SMC911X_USE_16BIT (1 << 0) | ||
5 | #define SMC911X_USE_32BIT (1 << 1) | ||
6 | |||
7 | struct smc911x_platdata { | ||
8 | unsigned long flags; | ||
9 | unsigned long irq_flags; /* IRQF_... */ | ||
10 | }; | ||
11 | |||
12 | #endif /* __SMC911X_H__ */ | ||
diff --git a/include/linux/smc91x.h b/include/linux/smc91x.h index 8e0556b8781c..3827b922ba1f 100644 --- a/include/linux/smc91x.h +++ b/include/linux/smc91x.h | |||
@@ -5,9 +5,19 @@ | |||
5 | #define SMC91X_USE_16BIT (1 << 1) | 5 | #define SMC91X_USE_16BIT (1 << 1) |
6 | #define SMC91X_USE_32BIT (1 << 2) | 6 | #define SMC91X_USE_32BIT (1 << 2) |
7 | 7 | ||
8 | #define SMC91X_NOWAIT (1 << 3) | ||
9 | |||
10 | /* two bits for IO_SHIFT, let's hope later designs will keep this sane */ | ||
11 | #define SMC91X_IO_SHIFT_0 (0 << 4) | ||
12 | #define SMC91X_IO_SHIFT_1 (1 << 4) | ||
13 | #define SMC91X_IO_SHIFT_2 (2 << 4) | ||
14 | #define SMC91X_IO_SHIFT_3 (3 << 4) | ||
15 | #define SMC91X_IO_SHIFT(x) (((x) >> 4) & 0x3) | ||
16 | |||
17 | #define SMC91X_USE_DMA (1 << 6) | ||
18 | |||
8 | struct smc91x_platdata { | 19 | struct smc91x_platdata { |
9 | unsigned long flags; | 20 | unsigned long flags; |
10 | unsigned long irq_flags; /* IRQF_... */ | ||
11 | }; | 21 | }; |
12 | 22 | ||
13 | #endif /* __SMC91X_H__ */ | 23 | #endif /* __SMC91X_H__ */ |
diff --git a/include/linux/socket.h b/include/linux/socket.h index bd2b30a74e76..950af631e7fb 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -306,10 +306,10 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata, | |||
306 | int offset, | 306 | int offset, |
307 | unsigned int len, __wsum *csump); | 307 | unsigned int len, __wsum *csump); |
308 | 308 | ||
309 | extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode); | 309 | extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); |
310 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); | 310 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); |
311 | extern int move_addr_to_user(void *kaddr, int klen, void __user *uaddr, int __user *ulen); | 311 | extern int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uaddr, int __user *ulen); |
312 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, void *kaddr); | 312 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); |
313 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); | 313 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); |
314 | 314 | ||
315 | #endif | 315 | #endif |
diff --git a/include/linux/sonet.h b/include/linux/sonet.h index 753680296e17..67ad11fcf88b 100644 --- a/include/linux/sonet.h +++ b/include/linux/sonet.h | |||
@@ -34,7 +34,7 @@ struct sonet_stats { | |||
34 | /* clear error insertion */ | 34 | /* clear error insertion */ |
35 | #define SONET_GETDIAG _IOR('a',ATMIOC_PHYTYP+4,int) | 35 | #define SONET_GETDIAG _IOR('a',ATMIOC_PHYTYP+4,int) |
36 | /* query error insertion */ | 36 | /* query error insertion */ |
37 | #define SONET_SETFRAMING _IO('a',ATMIOC_PHYTYP+5) | 37 | #define SONET_SETFRAMING _IOW('a',ATMIOC_PHYTYP+5,int) |
38 | /* set framing mode (SONET/SDH) */ | 38 | /* set framing mode (SONET/SDH) */ |
39 | #define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int) | 39 | #define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int) |
40 | /* get framing mode */ | 40 | /* get framing mode */ |
diff --git a/include/linux/spi/ds1305.h b/include/linux/spi/ds1305.h new file mode 100644 index 000000000000..287ec830eab7 --- /dev/null +++ b/include/linux/spi/ds1305.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #ifndef __LINUX_SPI_DS1305_H | ||
2 | #define __LINUX_SPI_DS1305_H | ||
3 | |||
4 | /* | ||
5 | * One-time configuration for ds1305 and ds1306 RTC chips. | ||
6 | * | ||
7 | * Put a pointer to this in spi_board_info.platform_data if you want to | ||
8 | * be sure that Linux (re)initializes this as needed ... after losing | ||
9 | * backup power, and potentially on the first boot. | ||
10 | */ | ||
11 | struct ds1305_platform_data { | ||
12 | |||
13 | /* Trickle charge configuration: it's OK to leave out the MAGIC | ||
14 | * bitmask; mask in either DS1 or DS2, and then one of 2K/4k/8K. | ||
15 | */ | ||
16 | #define DS1305_TRICKLE_MAGIC 0xa0 | ||
17 | #define DS1305_TRICKLE_DS2 0x08 /* two diodes */ | ||
18 | #define DS1305_TRICKLE_DS1 0x04 /* one diode */ | ||
19 | #define DS1305_TRICKLE_2K 0x01 /* 2 KOhm resistance */ | ||
20 | #define DS1305_TRICKLE_4K 0x02 /* 4 KOhm resistance */ | ||
21 | #define DS1305_TRICKLE_8K 0x03 /* 8 KOhm resistance */ | ||
22 | u8 trickle; | ||
23 | |||
24 | /* set only on ds1306 parts */ | ||
25 | bool is_ds1306; | ||
26 | |||
27 | /* ds1306 only: enable 1 Hz output */ | ||
28 | bool en_1hz; | ||
29 | |||
30 | /* REVISIT: the driver currently expects nINT0 to be wired | ||
31 | * as the alarm IRQ. ALM1 may also need to be set up ... | ||
32 | */ | ||
33 | }; | ||
34 | |||
35 | #endif /* __LINUX_SPI_DS1305_H */ | ||
diff --git a/include/linux/spi/max7301.h b/include/linux/spi/max7301.h new file mode 100644 index 000000000000..6dfd83f19b4b --- /dev/null +++ b/include/linux/spi/max7301.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef LINUX_SPI_MAX7301_H | ||
2 | #define LINUX_SPI_MAX7301_H | ||
3 | |||
4 | struct max7301_platform_data { | ||
5 | /* number assigned to the first GPIO */ | ||
6 | unsigned base; | ||
7 | }; | ||
8 | |||
9 | #endif | ||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 387e428f1cdf..a9cc29d46653 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -82,7 +82,7 @@ struct spi_device { | |||
82 | int irq; | 82 | int irq; |
83 | void *controller_state; | 83 | void *controller_state; |
84 | void *controller_data; | 84 | void *controller_data; |
85 | const char *modalias; | 85 | char modalias[32]; |
86 | 86 | ||
87 | /* | 87 | /* |
88 | * likely need more hooks for more protocol options affecting how | 88 | * likely need more hooks for more protocol options affecting how |
@@ -733,7 +733,7 @@ struct spi_board_info { | |||
733 | * controller_data goes to spi_device.controller_data, | 733 | * controller_data goes to spi_device.controller_data, |
734 | * irq is copied too | 734 | * irq is copied too |
735 | */ | 735 | */ |
736 | char modalias[KOBJ_NAME_LEN]; | 736 | char modalias[32]; |
737 | const void *platform_data; | 737 | const void *platform_data; |
738 | void *controller_data; | 738 | void *controller_data; |
739 | int irq; | 739 | int irq; |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 50dfd0dc4093..4bf8cade9dbc 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/spinlock.h> | 7 | #include <linux/spinlock.h> |
8 | #include <linux/pci.h> | 8 | #include <linux/pci.h> |
9 | #include <linux/mod_devicetable.h> | 9 | #include <linux/mod_devicetable.h> |
10 | #include <linux/dma-mapping.h> | ||
10 | 11 | ||
11 | #include <linux/ssb/ssb_regs.h> | 12 | #include <linux/ssb/ssb_regs.h> |
12 | 13 | ||
@@ -137,9 +138,6 @@ struct ssb_device { | |||
137 | const struct ssb_bus_ops *ops; | 138 | const struct ssb_bus_ops *ops; |
138 | 139 | ||
139 | struct device *dev; | 140 | struct device *dev; |
140 | /* Pointer to the device that has to be used for | ||
141 | * any DMA related operation. */ | ||
142 | struct device *dma_dev; | ||
143 | 141 | ||
144 | struct ssb_bus *bus; | 142 | struct ssb_bus *bus; |
145 | struct ssb_device_id id; | 143 | struct ssb_device_id id; |
@@ -399,13 +397,151 @@ static inline void ssb_block_write(struct ssb_device *dev, const void *buffer, | |||
399 | #endif /* CONFIG_SSB_BLOCKIO */ | 397 | #endif /* CONFIG_SSB_BLOCKIO */ |
400 | 398 | ||
401 | 399 | ||
400 | /* The SSB DMA API. Use this API for any DMA operation on the device. | ||
401 | * This API basically is a wrapper that calls the correct DMA API for | ||
402 | * the host device type the SSB device is attached to. */ | ||
403 | |||
402 | /* Translation (routing) bits that need to be ORed to DMA | 404 | /* Translation (routing) bits that need to be ORed to DMA |
403 | * addresses before they are given to a device. */ | 405 | * addresses before they are given to a device. */ |
404 | extern u32 ssb_dma_translation(struct ssb_device *dev); | 406 | extern u32 ssb_dma_translation(struct ssb_device *dev); |
405 | #define SSB_DMA_TRANSLATION_MASK 0xC0000000 | 407 | #define SSB_DMA_TRANSLATION_MASK 0xC0000000 |
406 | #define SSB_DMA_TRANSLATION_SHIFT 30 | 408 | #define SSB_DMA_TRANSLATION_SHIFT 30 |
407 | 409 | ||
408 | extern int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask); | 410 | extern int ssb_dma_set_mask(struct ssb_device *dev, u64 mask); |
411 | |||
412 | extern void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size, | ||
413 | dma_addr_t *dma_handle, gfp_t gfp_flags); | ||
414 | extern void ssb_dma_free_consistent(struct ssb_device *dev, size_t size, | ||
415 | void *vaddr, dma_addr_t dma_handle, | ||
416 | gfp_t gfp_flags); | ||
417 | |||
418 | static inline void __cold __ssb_dma_not_implemented(struct ssb_device *dev) | ||
419 | { | ||
420 | #ifdef CONFIG_SSB_DEBUG | ||
421 | printk(KERN_ERR "SSB: BUG! Calling DMA API for " | ||
422 | "unsupported bustype %d\n", dev->bus->bustype); | ||
423 | #endif /* DEBUG */ | ||
424 | } | ||
425 | |||
426 | static inline int ssb_dma_mapping_error(struct ssb_device *dev, dma_addr_t addr) | ||
427 | { | ||
428 | switch (dev->bus->bustype) { | ||
429 | case SSB_BUSTYPE_PCI: | ||
430 | return pci_dma_mapping_error(addr); | ||
431 | case SSB_BUSTYPE_SSB: | ||
432 | return dma_mapping_error(addr); | ||
433 | default: | ||
434 | __ssb_dma_not_implemented(dev); | ||
435 | } | ||
436 | return -ENOSYS; | ||
437 | } | ||
438 | |||
439 | static inline dma_addr_t ssb_dma_map_single(struct ssb_device *dev, void *p, | ||
440 | size_t size, enum dma_data_direction dir) | ||
441 | { | ||
442 | switch (dev->bus->bustype) { | ||
443 | case SSB_BUSTYPE_PCI: | ||
444 | return pci_map_single(dev->bus->host_pci, p, size, dir); | ||
445 | case SSB_BUSTYPE_SSB: | ||
446 | return dma_map_single(dev->dev, p, size, dir); | ||
447 | default: | ||
448 | __ssb_dma_not_implemented(dev); | ||
449 | } | ||
450 | return 0; | ||
451 | } | ||
452 | |||
453 | static inline void ssb_dma_unmap_single(struct ssb_device *dev, dma_addr_t dma_addr, | ||
454 | size_t size, enum dma_data_direction dir) | ||
455 | { | ||
456 | switch (dev->bus->bustype) { | ||
457 | case SSB_BUSTYPE_PCI: | ||
458 | pci_unmap_single(dev->bus->host_pci, dma_addr, size, dir); | ||
459 | return; | ||
460 | case SSB_BUSTYPE_SSB: | ||
461 | dma_unmap_single(dev->dev, dma_addr, size, dir); | ||
462 | return; | ||
463 | default: | ||
464 | __ssb_dma_not_implemented(dev); | ||
465 | } | ||
466 | } | ||
467 | |||
468 | static inline void ssb_dma_sync_single_for_cpu(struct ssb_device *dev, | ||
469 | dma_addr_t dma_addr, | ||
470 | size_t size, | ||
471 | enum dma_data_direction dir) | ||
472 | { | ||
473 | switch (dev->bus->bustype) { | ||
474 | case SSB_BUSTYPE_PCI: | ||
475 | pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr, | ||
476 | size, dir); | ||
477 | return; | ||
478 | case SSB_BUSTYPE_SSB: | ||
479 | dma_sync_single_for_cpu(dev->dev, dma_addr, size, dir); | ||
480 | return; | ||
481 | default: | ||
482 | __ssb_dma_not_implemented(dev); | ||
483 | } | ||
484 | } | ||
485 | |||
486 | static inline void ssb_dma_sync_single_for_device(struct ssb_device *dev, | ||
487 | dma_addr_t dma_addr, | ||
488 | size_t size, | ||
489 | enum dma_data_direction dir) | ||
490 | { | ||
491 | switch (dev->bus->bustype) { | ||
492 | case SSB_BUSTYPE_PCI: | ||
493 | pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr, | ||
494 | size, dir); | ||
495 | return; | ||
496 | case SSB_BUSTYPE_SSB: | ||
497 | dma_sync_single_for_device(dev->dev, dma_addr, size, dir); | ||
498 | return; | ||
499 | default: | ||
500 | __ssb_dma_not_implemented(dev); | ||
501 | } | ||
502 | } | ||
503 | |||
504 | static inline void ssb_dma_sync_single_range_for_cpu(struct ssb_device *dev, | ||
505 | dma_addr_t dma_addr, | ||
506 | unsigned long offset, | ||
507 | size_t size, | ||
508 | enum dma_data_direction dir) | ||
509 | { | ||
510 | switch (dev->bus->bustype) { | ||
511 | case SSB_BUSTYPE_PCI: | ||
512 | /* Just sync everything. That's all the PCI API can do. */ | ||
513 | pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr, | ||
514 | offset + size, dir); | ||
515 | return; | ||
516 | case SSB_BUSTYPE_SSB: | ||
517 | dma_sync_single_range_for_cpu(dev->dev, dma_addr, offset, | ||
518 | size, dir); | ||
519 | return; | ||
520 | default: | ||
521 | __ssb_dma_not_implemented(dev); | ||
522 | } | ||
523 | } | ||
524 | |||
525 | static inline void ssb_dma_sync_single_range_for_device(struct ssb_device *dev, | ||
526 | dma_addr_t dma_addr, | ||
527 | unsigned long offset, | ||
528 | size_t size, | ||
529 | enum dma_data_direction dir) | ||
530 | { | ||
531 | switch (dev->bus->bustype) { | ||
532 | case SSB_BUSTYPE_PCI: | ||
533 | /* Just sync everything. That's all the PCI API can do. */ | ||
534 | pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr, | ||
535 | offset + size, dir); | ||
536 | return; | ||
537 | case SSB_BUSTYPE_SSB: | ||
538 | dma_sync_single_range_for_device(dev->dev, dma_addr, offset, | ||
539 | size, dir); | ||
540 | return; | ||
541 | default: | ||
542 | __ssb_dma_not_implemented(dev); | ||
543 | } | ||
544 | } | ||
409 | 545 | ||
410 | 546 | ||
411 | #ifdef CONFIG_SSB_PCIHOST | 547 | #ifdef CONFIG_SSB_PCIHOST |
diff --git a/include/linux/stallion.h b/include/linux/stallion.h index 0424d75a5aaa..336af33c6ea4 100644 --- a/include/linux/stallion.h +++ b/include/linux/stallion.h | |||
@@ -69,6 +69,7 @@ struct stlrq { | |||
69 | */ | 69 | */ |
70 | struct stlport { | 70 | struct stlport { |
71 | unsigned long magic; | 71 | unsigned long magic; |
72 | struct tty_port port; | ||
72 | unsigned int portnr; | 73 | unsigned int portnr; |
73 | unsigned int panelnr; | 74 | unsigned int panelnr; |
74 | unsigned int brdnr; | 75 | unsigned int brdnr; |
@@ -76,12 +77,10 @@ struct stlport { | |||
76 | int uartaddr; | 77 | int uartaddr; |
77 | unsigned int pagenr; | 78 | unsigned int pagenr; |
78 | unsigned long istate; | 79 | unsigned long istate; |
79 | int flags; | ||
80 | int baud_base; | 80 | int baud_base; |
81 | int custom_divisor; | 81 | int custom_divisor; |
82 | int close_delay; | 82 | int close_delay; |
83 | int closing_wait; | 83 | int closing_wait; |
84 | int refcount; | ||
85 | int openwaitcnt; | 84 | int openwaitcnt; |
86 | int brklen; | 85 | int brklen; |
87 | unsigned int sigs; | 86 | unsigned int sigs; |
@@ -92,9 +91,6 @@ struct stlport { | |||
92 | unsigned long clk; | 91 | unsigned long clk; |
93 | unsigned long hwid; | 92 | unsigned long hwid; |
94 | void *uartp; | 93 | void *uartp; |
95 | struct tty_struct *tty; | ||
96 | wait_queue_head_t open_wait; | ||
97 | wait_queue_head_t close_wait; | ||
98 | comstats_t stats; | 94 | comstats_t stats; |
99 | struct stlrq tx; | 95 | struct stlrq tx; |
100 | }; | 96 | }; |
diff --git a/include/linux/string.h b/include/linux/string.h index efdc44593b52..810d80df0a1d 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -111,5 +111,8 @@ extern void argv_free(char **argv); | |||
111 | 111 | ||
112 | extern bool sysfs_streq(const char *s1, const char *s2); | 112 | extern bool sysfs_streq(const char *s1, const char *s2); |
113 | 113 | ||
114 | extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, | ||
115 | const void *from, size_t available); | ||
116 | |||
114 | #endif | 117 | #endif |
115 | #endif /* _LINUX_STRING_H_ */ | 118 | #endif /* _LINUX_STRING_H_ */ |
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h index fec6899bf355..d48d4e605f74 100644 --- a/include/linux/sunrpc/auth_gss.h +++ b/include/linux/sunrpc/auth_gss.h | |||
@@ -7,8 +7,6 @@ | |||
7 | * Andy Adamson <andros@umich.edu> | 7 | * Andy Adamson <andros@umich.edu> |
8 | * Bruce Fields <bfields@umich.edu> | 8 | * Bruce Fields <bfields@umich.edu> |
9 | * Copyright (c) 2000 The Regents of the University of Michigan | 9 | * Copyright (c) 2000 The Regents of the University of Michigan |
10 | * | ||
11 | * $Id$ | ||
12 | */ | 10 | */ |
13 | 11 | ||
14 | #ifndef _LINUX_SUNRPC_AUTH_GSS_H | 12 | #ifndef _LINUX_SUNRPC_AUTH_GSS_H |
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 459c5fc11d51..03f33330ece2 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
@@ -7,8 +7,6 @@ | |||
7 | * Andy Adamson <andros@umich.edu> | 7 | * Andy Adamson <andros@umich.edu> |
8 | * Bruce Fields <bfields@umich.edu> | 8 | * Bruce Fields <bfields@umich.edu> |
9 | * Copyright (c) 2000 The Regents of the University of Michigan | 9 | * Copyright (c) 2000 The Regents of the University of Michigan |
10 | * | ||
11 | * $Id$ | ||
12 | */ | 10 | */ |
13 | 11 | ||
14 | #ifndef _LINUX_SUNRPC_GSS_API_H | 12 | #ifndef _LINUX_SUNRPC_GSS_API_H |
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h index a10f1fb0bf7c..e7bbdba474d5 100644 --- a/include/linux/sunrpc/gss_krb5.h +++ b/include/linux/sunrpc/gss_krb5.h | |||
@@ -51,6 +51,9 @@ struct krb5_ctx { | |||
51 | 51 | ||
52 | extern spinlock_t krb5_seq_lock; | 52 | extern spinlock_t krb5_seq_lock; |
53 | 53 | ||
54 | /* The length of the Kerberos GSS token header */ | ||
55 | #define GSS_KRB5_TOK_HDR_LEN (16) | ||
56 | |||
54 | #define KG_TOK_MIC_MSG 0x0101 | 57 | #define KG_TOK_MIC_MSG 0x0101 |
55 | #define KG_TOK_WRAP_MSG 0x0201 | 58 | #define KG_TOK_WRAP_MSG 0x0201 |
56 | 59 | ||
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 4b54c5fdcfd9..dc69068d94c7 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -22,7 +22,7 @@ | |||
22 | /* | 22 | /* |
23 | * This is the RPC server thread function prototype | 23 | * This is the RPC server thread function prototype |
24 | */ | 24 | */ |
25 | typedef void (*svc_thread_fn)(struct svc_rqst *); | 25 | typedef int (*svc_thread_fn)(void *); |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * | 28 | * |
@@ -80,7 +80,6 @@ struct svc_serv { | |||
80 | struct module * sv_module; /* optional module to count when | 80 | struct module * sv_module; /* optional module to count when |
81 | * adding threads */ | 81 | * adding threads */ |
82 | svc_thread_fn sv_function; /* main function for threads */ | 82 | svc_thread_fn sv_function; /* main function for threads */ |
83 | int sv_kill_signal; /* signal to kill threads */ | ||
84 | }; | 83 | }; |
85 | 84 | ||
86 | /* | 85 | /* |
@@ -388,8 +387,8 @@ struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, | |||
388 | struct svc_pool *pool); | 387 | struct svc_pool *pool); |
389 | void svc_exit_thread(struct svc_rqst *); | 388 | void svc_exit_thread(struct svc_rqst *); |
390 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, | 389 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, |
391 | void (*shutdown)(struct svc_serv*), | 390 | void (*shutdown)(struct svc_serv*), svc_thread_fn, |
392 | svc_thread_fn, int sig, struct module *); | 391 | struct module *); |
393 | int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); | 392 | int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); |
394 | void svc_destroy(struct svc_serv *); | 393 | void svc_destroy(struct svc_serv *); |
395 | int svc_process(struct svc_rqst *); | 394 | int svc_process(struct svc_rqst *); |
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index 05eb4664d0dd..ef2e3a20bf3b 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h | |||
@@ -72,7 +72,7 @@ extern atomic_t rdma_stat_sq_prod; | |||
72 | */ | 72 | */ |
73 | struct svc_rdma_op_ctxt { | 73 | struct svc_rdma_op_ctxt { |
74 | struct svc_rdma_op_ctxt *read_hdr; | 74 | struct svc_rdma_op_ctxt *read_hdr; |
75 | struct list_head free_list; | 75 | int hdr_count; |
76 | struct xdr_buf arg; | 76 | struct xdr_buf arg; |
77 | struct list_head dto_q; | 77 | struct list_head dto_q; |
78 | enum ib_wr_opcode wr_op; | 78 | enum ib_wr_opcode wr_op; |
@@ -86,6 +86,31 @@ struct svc_rdma_op_ctxt { | |||
86 | struct page *pages[RPCSVC_MAXPAGES]; | 86 | struct page *pages[RPCSVC_MAXPAGES]; |
87 | }; | 87 | }; |
88 | 88 | ||
89 | /* | ||
90 | * NFS_ requests are mapped on the client side by the chunk lists in | ||
91 | * the RPCRDMA header. During the fetching of the RPC from the client | ||
92 | * and the writing of the reply to the client, the memory in the | ||
93 | * client and the memory in the server must be mapped as contiguous | ||
94 | * vaddr/len for access by the hardware. These data strucures keep | ||
95 | * these mappings. | ||
96 | * | ||
97 | * For an RDMA_WRITE, the 'sge' maps the RPC REPLY. For RDMA_READ, the | ||
98 | * 'sge' in the svc_rdma_req_map maps the server side RPC reply and the | ||
99 | * 'ch' field maps the read-list of the RPCRDMA header to the 'sge' | ||
100 | * mapping of the reply. | ||
101 | */ | ||
102 | struct svc_rdma_chunk_sge { | ||
103 | int start; /* sge no for this chunk */ | ||
104 | int count; /* sge count for this chunk */ | ||
105 | }; | ||
106 | struct svc_rdma_req_map { | ||
107 | unsigned long count; | ||
108 | union { | ||
109 | struct kvec sge[RPCSVC_MAXPAGES]; | ||
110 | struct svc_rdma_chunk_sge ch[RPCSVC_MAXPAGES]; | ||
111 | }; | ||
112 | }; | ||
113 | |||
89 | #define RDMACTXT_F_LAST_CTXT 2 | 114 | #define RDMACTXT_F_LAST_CTXT 2 |
90 | 115 | ||
91 | struct svcxprt_rdma { | 116 | struct svcxprt_rdma { |
@@ -93,7 +118,6 @@ struct svcxprt_rdma { | |||
93 | struct rdma_cm_id *sc_cm_id; /* RDMA connection id */ | 118 | struct rdma_cm_id *sc_cm_id; /* RDMA connection id */ |
94 | struct list_head sc_accept_q; /* Conn. waiting accept */ | 119 | struct list_head sc_accept_q; /* Conn. waiting accept */ |
95 | int sc_ord; /* RDMA read limit */ | 120 | int sc_ord; /* RDMA read limit */ |
96 | wait_queue_head_t sc_read_wait; | ||
97 | int sc_max_sge; | 121 | int sc_max_sge; |
98 | 122 | ||
99 | int sc_sq_depth; /* Depth of SQ */ | 123 | int sc_sq_depth; /* Depth of SQ */ |
@@ -104,12 +128,8 @@ struct svcxprt_rdma { | |||
104 | 128 | ||
105 | struct ib_pd *sc_pd; | 129 | struct ib_pd *sc_pd; |
106 | 130 | ||
131 | atomic_t sc_dma_used; | ||
107 | atomic_t sc_ctxt_used; | 132 | atomic_t sc_ctxt_used; |
108 | struct list_head sc_ctxt_free; | ||
109 | int sc_ctxt_cnt; | ||
110 | int sc_ctxt_bump; | ||
111 | int sc_ctxt_max; | ||
112 | spinlock_t sc_ctxt_lock; | ||
113 | struct list_head sc_rq_dto_q; | 133 | struct list_head sc_rq_dto_q; |
114 | spinlock_t sc_rq_dto_lock; | 134 | spinlock_t sc_rq_dto_lock; |
115 | struct ib_qp *sc_qp; | 135 | struct ib_qp *sc_qp; |
@@ -173,6 +193,8 @@ extern int svc_rdma_post_recv(struct svcxprt_rdma *); | |||
173 | extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *); | 193 | extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *); |
174 | extern struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *); | 194 | extern struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *); |
175 | extern void svc_rdma_put_context(struct svc_rdma_op_ctxt *, int); | 195 | extern void svc_rdma_put_context(struct svc_rdma_op_ctxt *, int); |
196 | extern struct svc_rdma_req_map *svc_rdma_get_req_map(void); | ||
197 | extern void svc_rdma_put_req_map(struct svc_rdma_req_map *); | ||
176 | extern void svc_sq_reap(struct svcxprt_rdma *); | 198 | extern void svc_sq_reap(struct svcxprt_rdma *); |
177 | extern void svc_rq_reap(struct svcxprt_rdma *); | 199 | extern void svc_rq_reap(struct svcxprt_rdma *); |
178 | extern struct svc_xprt_class svc_rdma_class; | 200 | extern struct svc_xprt_class svc_rdma_class; |
diff --git a/include/linux/sunrpc/svcauth_gss.h b/include/linux/sunrpc/svcauth_gss.h index 417a1def56db..c9165d9771a8 100644 --- a/include/linux/sunrpc/svcauth_gss.h +++ b/include/linux/sunrpc/svcauth_gss.h | |||
@@ -3,9 +3,6 @@ | |||
3 | * | 3 | * |
4 | * Bruce Fields <bfields@umich.edu> | 4 | * Bruce Fields <bfields@umich.edu> |
5 | * Copyright (c) 2002 The Regents of the Unviersity of Michigan | 5 | * Copyright (c) 2002 The Regents of the Unviersity of Michigan |
6 | * | ||
7 | * $Id$ | ||
8 | * | ||
9 | */ | 6 | */ |
10 | 7 | ||
11 | #ifndef _LINUX_SUNRPC_SVCAUTH_GSS_H | 8 | #ifndef _LINUX_SUNRPC_SVCAUTH_GSS_H |
diff --git a/include/linux/synclink.h b/include/linux/synclink.h index 45f6bc82d317..c844a229acc9 100644 --- a/include/linux/synclink.h +++ b/include/linux/synclink.h | |||
@@ -136,6 +136,7 @@ | |||
136 | #define MGSL_INTERFACE_RTS_EN 0x10 | 136 | #define MGSL_INTERFACE_RTS_EN 0x10 |
137 | #define MGSL_INTERFACE_LL 0x20 | 137 | #define MGSL_INTERFACE_LL 0x20 |
138 | #define MGSL_INTERFACE_RL 0x40 | 138 | #define MGSL_INTERFACE_RL 0x40 |
139 | #define MGSL_INTERFACE_MSB_FIRST 0x80 | ||
139 | 140 | ||
140 | typedef struct _MGSL_PARAMS | 141 | typedef struct _MGSL_PARAMS |
141 | { | 142 | { |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 0522f368f9d7..06f2bf76c030 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -305,6 +305,7 @@ asmlinkage long sys_fcntl64(unsigned int fd, | |||
305 | #endif | 305 | #endif |
306 | asmlinkage long sys_dup(unsigned int fildes); | 306 | asmlinkage long sys_dup(unsigned int fildes); |
307 | asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd); | 307 | asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd); |
308 | asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags); | ||
308 | asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on); | 309 | asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on); |
309 | asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, | 310 | asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, |
310 | unsigned long arg); | 311 | unsigned long arg); |
@@ -409,6 +410,8 @@ asmlinkage long sys_getsockopt(int fd, int level, int optname, | |||
409 | asmlinkage long sys_bind(int, struct sockaddr __user *, int); | 410 | asmlinkage long sys_bind(int, struct sockaddr __user *, int); |
410 | asmlinkage long sys_connect(int, struct sockaddr __user *, int); | 411 | asmlinkage long sys_connect(int, struct sockaddr __user *, int); |
411 | asmlinkage long sys_accept(int, struct sockaddr __user *, int __user *); | 412 | asmlinkage long sys_accept(int, struct sockaddr __user *, int __user *); |
413 | asmlinkage long sys_paccept(int, struct sockaddr __user *, int __user *, | ||
414 | const sigset_t *, size_t, int); | ||
412 | asmlinkage long sys_getsockname(int, struct sockaddr __user *, int __user *); | 415 | asmlinkage long sys_getsockname(int, struct sockaddr __user *, int __user *); |
413 | asmlinkage long sys_getpeername(int, struct sockaddr __user *, int __user *); | 416 | asmlinkage long sys_getpeername(int, struct sockaddr __user *, int __user *); |
414 | asmlinkage long sys_send(int, void __user *, size_t, unsigned); | 417 | asmlinkage long sys_send(int, void __user *, size_t, unsigned); |
@@ -428,6 +431,7 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, | |||
428 | asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, | 431 | asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, |
429 | fd_set __user *exp, struct timeval __user *tvp); | 432 | fd_set __user *exp, struct timeval __user *tvp); |
430 | asmlinkage long sys_epoll_create(int size); | 433 | asmlinkage long sys_epoll_create(int size); |
434 | asmlinkage long sys_epoll_create1(int flags); | ||
431 | asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, | 435 | asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, |
432 | struct epoll_event __user *event); | 436 | struct epoll_event __user *event); |
433 | asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events, | 437 | asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events, |
@@ -443,7 +447,7 @@ asmlinkage long sys_newuname(struct new_utsname __user *name); | |||
443 | 447 | ||
444 | asmlinkage long sys_getrlimit(unsigned int resource, | 448 | asmlinkage long sys_getrlimit(unsigned int resource, |
445 | struct rlimit __user *rlim); | 449 | struct rlimit __user *rlim); |
446 | #if defined(COMPAT_RLIM_OLD_INFINITY) || !(defined(CONFIG_IA64) || defined(CONFIG_V850)) | 450 | #if defined(COMPAT_RLIM_OLD_INFINITY) || !(defined(CONFIG_IA64)) |
447 | asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *rlim); | 451 | asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *rlim); |
448 | #endif | 452 | #endif |
449 | asmlinkage long sys_setrlimit(unsigned int resource, | 453 | asmlinkage long sys_setrlimit(unsigned int resource, |
@@ -543,6 +547,7 @@ asmlinkage long sys_get_mempolicy(int __user *policy, | |||
543 | unsigned long addr, unsigned long flags); | 547 | unsigned long addr, unsigned long flags); |
544 | 548 | ||
545 | asmlinkage long sys_inotify_init(void); | 549 | asmlinkage long sys_inotify_init(void); |
550 | asmlinkage long sys_inotify_init1(int flags); | ||
546 | asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, | 551 | asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, |
547 | u32 mask); | 552 | u32 mask); |
548 | asmlinkage long sys_inotify_rm_watch(int fd, u32 wd); | 553 | asmlinkage long sys_inotify_rm_watch(int fd, u32 wd); |
@@ -608,12 +613,14 @@ asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, | |||
608 | size_t len); | 613 | size_t len); |
609 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); | 614 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); |
610 | asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask); | 615 | asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask); |
616 | asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask, size_t sizemask, int flags); | ||
611 | asmlinkage long sys_timerfd_create(int clockid, int flags); | 617 | asmlinkage long sys_timerfd_create(int clockid, int flags); |
612 | asmlinkage long sys_timerfd_settime(int ufd, int flags, | 618 | asmlinkage long sys_timerfd_settime(int ufd, int flags, |
613 | const struct itimerspec __user *utmr, | 619 | const struct itimerspec __user *utmr, |
614 | struct itimerspec __user *otmr); | 620 | struct itimerspec __user *otmr); |
615 | asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr); | 621 | asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr); |
616 | asmlinkage long sys_eventfd(unsigned int count); | 622 | asmlinkage long sys_eventfd(unsigned int count); |
623 | asmlinkage long sys_eventfd2(unsigned int count, int flags); | ||
617 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); | 624 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); |
618 | 625 | ||
619 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | 626 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); |
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h index f2767bc6b735..f395bb3fa2f2 100644 --- a/include/linux/sysdev.h +++ b/include/linux/sysdev.h | |||
@@ -99,8 +99,9 @@ extern void sysdev_unregister(struct sys_device *); | |||
99 | 99 | ||
100 | struct sysdev_attribute { | 100 | struct sysdev_attribute { |
101 | struct attribute attr; | 101 | struct attribute attr; |
102 | ssize_t (*show)(struct sys_device *, char *); | 102 | ssize_t (*show)(struct sys_device *, struct sysdev_attribute *, char *); |
103 | ssize_t (*store)(struct sys_device *, const char *, size_t); | 103 | ssize_t (*store)(struct sys_device *, struct sysdev_attribute *, |
104 | const char *, size_t); | ||
104 | }; | 105 | }; |
105 | 106 | ||
106 | 107 | ||
@@ -118,4 +119,38 @@ struct sysdev_attribute { | |||
118 | extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); | 119 | extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); |
119 | extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); | 120 | extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); |
120 | 121 | ||
122 | struct sysdev_ext_attribute { | ||
123 | struct sysdev_attribute attr; | ||
124 | void *var; | ||
125 | }; | ||
126 | |||
127 | /* | ||
128 | * Support for simple variable sysdev attributes. | ||
129 | * The pointer to the variable is stored in a sysdev_ext_attribute | ||
130 | */ | ||
131 | |||
132 | /* Add more types as needed */ | ||
133 | |||
134 | extern ssize_t sysdev_show_ulong(struct sys_device *, struct sysdev_attribute *, | ||
135 | char *); | ||
136 | extern ssize_t sysdev_store_ulong(struct sys_device *, | ||
137 | struct sysdev_attribute *, const char *, size_t); | ||
138 | extern ssize_t sysdev_show_int(struct sys_device *, struct sysdev_attribute *, | ||
139 | char *); | ||
140 | extern ssize_t sysdev_store_int(struct sys_device *, | ||
141 | struct sysdev_attribute *, const char *, size_t); | ||
142 | |||
143 | #define _SYSDEV_ULONG_ATTR(_name, _mode, _var) \ | ||
144 | { _SYSDEV_ATTR(_name, _mode, sysdev_show_ulong, sysdev_store_ulong), \ | ||
145 | &(_var) } | ||
146 | #define SYSDEV_ULONG_ATTR(_name, _mode, _var) \ | ||
147 | struct sysdev_ext_attribute attr_##_name = \ | ||
148 | _SYSDEV_ULONG_ATTR(_name, _mode, _var); | ||
149 | #define _SYSDEV_INT_ATTR(_name, _mode, _var) \ | ||
150 | { _SYSDEV_ATTR(_name, _mode, sysdev_show_int, sysdev_store_int), \ | ||
151 | &(_var) } | ||
152 | #define SYSDEV_INT_ATTR(_name, _mode, _var) \ | ||
153 | struct sysdev_ext_attribute attr_##_name = \ | ||
154 | _SYSDEV_INT_ATTR(_name, _mode, _var); | ||
155 | |||
121 | #endif /* _SYSDEV_H_ */ | 156 | #endif /* _SYSDEV_H_ */ |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 7858eac40aa7..37fa24152bd8 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -101,6 +101,9 @@ void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); | |||
101 | 101 | ||
102 | int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target, | 102 | int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target, |
103 | const char *name); | 103 | const char *name); |
104 | int __must_check sysfs_create_link_nowarn(struct kobject *kobj, | ||
105 | struct kobject *target, | ||
106 | const char *name); | ||
104 | void sysfs_remove_link(struct kobject *kobj, const char *name); | 107 | void sysfs_remove_link(struct kobject *kobj, const char *name); |
105 | 108 | ||
106 | int __must_check sysfs_create_group(struct kobject *kobj, | 109 | int __must_check sysfs_create_group(struct kobject *kobj, |
@@ -180,6 +183,13 @@ static inline int sysfs_create_link(struct kobject *kobj, | |||
180 | return 0; | 183 | return 0; |
181 | } | 184 | } |
182 | 185 | ||
186 | static inline int sysfs_create_link_nowarn(struct kobject *kobj, | ||
187 | struct kobject *target, | ||
188 | const char *name) | ||
189 | { | ||
190 | return 0; | ||
191 | } | ||
192 | |||
183 | static inline void sysfs_remove_link(struct kobject *kobj, const char *name) | 193 | static inline void sysfs_remove_link(struct kobject *kobj, const char *name) |
184 | { | 194 | { |
185 | } | 195 | } |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index b31b6b74aa28..2e2557388e36 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -224,6 +224,12 @@ struct tcp_options_received { | |||
224 | u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ | 224 | u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ |
225 | }; | 225 | }; |
226 | 226 | ||
227 | /* This is the max number of SACKS that we'll generate and process. It's safe | ||
228 | * to increse this, although since: | ||
229 | * size = TCPOLEN_SACK_BASE_ALIGNED (4) + n * TCPOLEN_SACK_PERBLOCK (8) | ||
230 | * only four options will fit in a standard TCP header */ | ||
231 | #define TCP_NUM_SACKS 4 | ||
232 | |||
227 | struct tcp_request_sock { | 233 | struct tcp_request_sock { |
228 | struct inet_request_sock req; | 234 | struct inet_request_sock req; |
229 | #ifdef CONFIG_TCP_MD5SIG | 235 | #ifdef CONFIG_TCP_MD5SIG |
@@ -291,10 +297,9 @@ struct tcp_sock { | |||
291 | u32 rcv_ssthresh; /* Current window clamp */ | 297 | u32 rcv_ssthresh; /* Current window clamp */ |
292 | 298 | ||
293 | u32 frto_highmark; /* snd_nxt when RTO occurred */ | 299 | u32 frto_highmark; /* snd_nxt when RTO occurred */ |
294 | u8 reordering; /* Packet reordering metric. */ | 300 | u16 advmss; /* Advertised MSS */ |
295 | u8 frto_counter; /* Number of new acks after RTO */ | 301 | u8 frto_counter; /* Number of new acks after RTO */ |
296 | u8 nonagle; /* Disable Nagle algorithm? */ | 302 | u8 nonagle; /* Disable Nagle algorithm? */ |
297 | u8 keepalive_probes; /* num of allowed keep alive probes */ | ||
298 | 303 | ||
299 | /* RTT measurement */ | 304 | /* RTT measurement */ |
300 | u32 srtt; /* smoothed round trip time << 3 */ | 305 | u32 srtt; /* smoothed round trip time << 3 */ |
@@ -305,6 +310,10 @@ struct tcp_sock { | |||
305 | 310 | ||
306 | u32 packets_out; /* Packets which are "in flight" */ | 311 | u32 packets_out; /* Packets which are "in flight" */ |
307 | u32 retrans_out; /* Retransmitted packets out */ | 312 | u32 retrans_out; /* Retransmitted packets out */ |
313 | |||
314 | u16 urg_data; /* Saved octet of OOB data and control flags */ | ||
315 | u8 urg_mode; /* In urgent mode */ | ||
316 | u8 ecn_flags; /* ECN status bits. */ | ||
308 | /* | 317 | /* |
309 | * Options received (usually on last packet, some only on SYN packets). | 318 | * Options received (usually on last packet, some only on SYN packets). |
310 | */ | 319 | */ |
@@ -320,13 +329,24 @@ struct tcp_sock { | |||
320 | u32 snd_cwnd_used; | 329 | u32 snd_cwnd_used; |
321 | u32 snd_cwnd_stamp; | 330 | u32 snd_cwnd_stamp; |
322 | 331 | ||
323 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ | ||
324 | |||
325 | u32 rcv_wnd; /* Current receiver window */ | 332 | u32 rcv_wnd; /* Current receiver window */ |
326 | u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ | 333 | u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ |
327 | u32 pushed_seq; /* Last pushed seq, required to talk to windows */ | 334 | u32 pushed_seq; /* Last pushed seq, required to talk to windows */ |
335 | u32 lost_out; /* Lost packets */ | ||
336 | u32 sacked_out; /* SACK'd packets */ | ||
337 | u32 fackets_out; /* FACK'd packets */ | ||
338 | u32 tso_deferred; | ||
339 | u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */ | ||
328 | 340 | ||
329 | /* SACKs data */ | 341 | /* from STCP, retrans queue hinting */ |
342 | struct sk_buff* lost_skb_hint; | ||
343 | struct sk_buff *scoreboard_skb_hint; | ||
344 | struct sk_buff *retransmit_skb_hint; | ||
345 | struct sk_buff *forward_skb_hint; | ||
346 | |||
347 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ | ||
348 | |||
349 | /* SACKs data, these 2 need to be together (see tcp_build_and_update_options) */ | ||
330 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ | 350 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ |
331 | struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ | 351 | struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ |
332 | 352 | ||
@@ -337,23 +357,14 @@ struct tcp_sock { | |||
337 | * sacked_out > 0) | 357 | * sacked_out > 0) |
338 | */ | 358 | */ |
339 | 359 | ||
340 | /* from STCP, retrans queue hinting */ | ||
341 | struct sk_buff* lost_skb_hint; | ||
342 | |||
343 | struct sk_buff *scoreboard_skb_hint; | ||
344 | struct sk_buff *retransmit_skb_hint; | ||
345 | struct sk_buff *forward_skb_hint; | ||
346 | |||
347 | int lost_cnt_hint; | 360 | int lost_cnt_hint; |
348 | int retransmit_cnt_hint; | 361 | int retransmit_cnt_hint; |
349 | 362 | ||
350 | u32 lost_retrans_low; /* Sent seq after any rxmit (lowest) */ | 363 | u32 lost_retrans_low; /* Sent seq after any rxmit (lowest) */ |
351 | 364 | ||
352 | u16 advmss; /* Advertised MSS */ | 365 | u8 reordering; /* Packet reordering metric. */ |
366 | u8 keepalive_probes; /* num of allowed keep alive probes */ | ||
353 | u32 prior_ssthresh; /* ssthresh saved at recovery start */ | 367 | u32 prior_ssthresh; /* ssthresh saved at recovery start */ |
354 | u32 lost_out; /* Lost packets */ | ||
355 | u32 sacked_out; /* SACK'd packets */ | ||
356 | u32 fackets_out; /* FACK'd packets */ | ||
357 | u32 high_seq; /* snd_nxt at onset of congestion */ | 368 | u32 high_seq; /* snd_nxt at onset of congestion */ |
358 | 369 | ||
359 | u32 retrans_stamp; /* Timestamp of the last retransmit, | 370 | u32 retrans_stamp; /* Timestamp of the last retransmit, |
@@ -361,23 +372,16 @@ struct tcp_sock { | |||
361 | * the first SYN. */ | 372 | * the first SYN. */ |
362 | u32 undo_marker; /* tracking retrans started here. */ | 373 | u32 undo_marker; /* tracking retrans started here. */ |
363 | int undo_retrans; /* number of undoable retransmissions. */ | 374 | int undo_retrans; /* number of undoable retransmissions. */ |
375 | u32 total_retrans; /* Total retransmits for entire connection */ | ||
376 | |||
364 | u32 urg_seq; /* Seq of received urgent pointer */ | 377 | u32 urg_seq; /* Seq of received urgent pointer */ |
365 | u16 urg_data; /* Saved octet of OOB data and control flags */ | ||
366 | u8 urg_mode; /* In urgent mode */ | ||
367 | u8 ecn_flags; /* ECN status bits. */ | ||
368 | u32 snd_up; /* Urgent pointer */ | 378 | u32 snd_up; /* Urgent pointer */ |
369 | 379 | ||
370 | u32 total_retrans; /* Total retransmits for entire connection */ | ||
371 | u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */ | ||
372 | |||
373 | unsigned int keepalive_time; /* time before keep alive takes place */ | 380 | unsigned int keepalive_time; /* time before keep alive takes place */ |
374 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ | 381 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ |
375 | int linger2; | ||
376 | 382 | ||
377 | unsigned long last_synq_overflow; | 383 | unsigned long last_synq_overflow; |
378 | 384 | ||
379 | u32 tso_deferred; | ||
380 | |||
381 | /* Receiver side RTT estimation */ | 385 | /* Receiver side RTT estimation */ |
382 | struct { | 386 | struct { |
383 | u32 rtt; | 387 | u32 rtt; |
@@ -405,6 +409,8 @@ struct tcp_sock { | |||
405 | /* TCP MD5 Signagure Option information */ | 409 | /* TCP MD5 Signagure Option information */ |
406 | struct tcp_md5sig_info *md5sig_info; | 410 | struct tcp_md5sig_info *md5sig_info; |
407 | #endif | 411 | #endif |
412 | |||
413 | int linger2; | ||
408 | }; | 414 | }; |
409 | 415 | ||
410 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) | 416 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) |
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h index 6f371f24160b..d9a85d616385 100644 --- a/include/linux/textsearch.h +++ b/include/linux/textsearch.h | |||
@@ -10,10 +10,8 @@ | |||
10 | 10 | ||
11 | struct ts_config; | 11 | struct ts_config; |
12 | 12 | ||
13 | /** | 13 | #define TS_AUTOLOAD 1 /* Automatically load textsearch modules when needed */ |
14 | * TS_AUTOLOAD - Automatically load textsearch modules when needed | 14 | #define TS_IGNORECASE 2 /* Searches string case insensitively */ |
15 | */ | ||
16 | #define TS_AUTOLOAD 1 | ||
17 | 15 | ||
18 | /** | 16 | /** |
19 | * struct ts_state - search state | 17 | * struct ts_state - search state |
@@ -39,7 +37,7 @@ struct ts_state | |||
39 | struct ts_ops | 37 | struct ts_ops |
40 | { | 38 | { |
41 | const char *name; | 39 | const char *name; |
42 | struct ts_config * (*init)(const void *, unsigned int, gfp_t); | 40 | struct ts_config * (*init)(const void *, unsigned int, gfp_t, int); |
43 | unsigned int (*find)(struct ts_config *, | 41 | unsigned int (*find)(struct ts_config *, |
44 | struct ts_state *); | 42 | struct ts_state *); |
45 | void (*destroy)(struct ts_config *); | 43 | void (*destroy)(struct ts_config *); |
@@ -52,12 +50,14 @@ struct ts_ops | |||
52 | /** | 50 | /** |
53 | * struct ts_config - search configuration | 51 | * struct ts_config - search configuration |
54 | * @ops: operations of chosen algorithm | 52 | * @ops: operations of chosen algorithm |
53 | * @flags: flags | ||
55 | * @get_next_block: callback to fetch the next block to search in | 54 | * @get_next_block: callback to fetch the next block to search in |
56 | * @finish: callback to finalize a search | 55 | * @finish: callback to finalize a search |
57 | */ | 56 | */ |
58 | struct ts_config | 57 | struct ts_config |
59 | { | 58 | { |
60 | struct ts_ops *ops; | 59 | struct ts_ops *ops; |
60 | int flags; | ||
61 | 61 | ||
62 | /** | 62 | /** |
63 | * get_next_block - fetch next block of data | 63 | * get_next_block - fetch next block of data |
@@ -162,11 +162,10 @@ static inline struct ts_config *alloc_ts_config(size_t payload, | |||
162 | { | 162 | { |
163 | struct ts_config *conf; | 163 | struct ts_config *conf; |
164 | 164 | ||
165 | conf = kmalloc(TS_PRIV_ALIGN(sizeof(*conf)) + payload, gfp_mask); | 165 | conf = kzalloc(TS_PRIV_ALIGN(sizeof(*conf)) + payload, gfp_mask); |
166 | if (conf == NULL) | 166 | if (conf == NULL) |
167 | return ERR_PTR(-ENOMEM); | 167 | return ERR_PTR(-ENOMEM); |
168 | 168 | ||
169 | memset(conf, 0, TS_PRIV_ALIGN(sizeof(*conf)) + payload); | ||
170 | return conf; | 169 | return conf; |
171 | } | 170 | } |
172 | 171 | ||
diff --git a/include/linux/timerfd.h b/include/linux/timerfd.h index cf2b10d75731..86cb0501d3e2 100644 --- a/include/linux/timerfd.h +++ b/include/linux/timerfd.h | |||
@@ -8,9 +8,15 @@ | |||
8 | #ifndef _LINUX_TIMERFD_H | 8 | #ifndef _LINUX_TIMERFD_H |
9 | #define _LINUX_TIMERFD_H | 9 | #define _LINUX_TIMERFD_H |
10 | 10 | ||
11 | /* For O_CLOEXEC and O_NONBLOCK */ | ||
12 | #include <linux/fcntl.h> | ||
11 | 13 | ||
14 | /* Flags for timerfd_settime. */ | ||
12 | #define TFD_TIMER_ABSTIME (1 << 0) | 15 | #define TFD_TIMER_ABSTIME (1 << 0) |
13 | 16 | ||
17 | /* Flags for timerfd_create. */ | ||
18 | #define TFD_CLOEXEC O_CLOEXEC | ||
19 | #define TFD_NONBLOCK O_NONBLOCK | ||
14 | 20 | ||
15 | 21 | ||
16 | #endif /* _LINUX_TIMERFD_H */ | 22 | #endif /* _LINUX_TIMERFD_H */ |
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h index b0c916d1f375..2bc6fa4adeb5 100644 --- a/include/linux/tipc_config.h +++ b/include/linux/tipc_config.h | |||
@@ -2,7 +2,7 @@ | |||
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, Wind River Systems | 5 | * Copyright (c) 2005-2007, Wind River Systems |
6 | * All rights reserved. | 6 | * All rights reserved. |
7 | * | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without |
@@ -136,6 +136,14 @@ | |||
136 | #define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */ | 136 | #define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */ |
137 | 137 | ||
138 | /* | 138 | /* |
139 | * Reserved commands: | ||
140 | * May not be issued by any process. | ||
141 | * Used internally by TIPC. | ||
142 | */ | ||
143 | |||
144 | #define TIPC_CMD_NOT_NET_ADMIN 0xC001 /* tx none, rx none */ | ||
145 | |||
146 | /* | ||
139 | * TLV types defined for TIPC | 147 | * TLV types defined for TIPC |
140 | */ | 148 | */ |
141 | 149 | ||
diff --git a/include/linux/tty.h b/include/linux/tty.h index 324a3b231d40..e3579cb086e0 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -71,7 +71,8 @@ struct tty_bufhead { | |||
71 | struct tty_buffer *head; /* Queue head */ | 71 | struct tty_buffer *head; /* Queue head */ |
72 | struct tty_buffer *tail; /* Active buffer */ | 72 | struct tty_buffer *tail; /* Active buffer */ |
73 | struct tty_buffer *free; /* Free queue head */ | 73 | struct tty_buffer *free; /* Free queue head */ |
74 | int memory_used; /* Buffer space used excluding free queue */ | 74 | int memory_used; /* Buffer space used excluding |
75 | free queue */ | ||
75 | }; | 76 | }; |
76 | /* | 77 | /* |
77 | * When a break, frame error, or parity error happens, these codes are | 78 | * When a break, frame error, or parity error happens, these codes are |
@@ -101,71 +102,96 @@ struct tty_bufhead { | |||
101 | #define LNEXT_CHAR(tty) ((tty)->termios->c_cc[VLNEXT]) | 102 | #define LNEXT_CHAR(tty) ((tty)->termios->c_cc[VLNEXT]) |
102 | #define EOL2_CHAR(tty) ((tty)->termios->c_cc[VEOL2]) | 103 | #define EOL2_CHAR(tty) ((tty)->termios->c_cc[VEOL2]) |
103 | 104 | ||
104 | #define _I_FLAG(tty,f) ((tty)->termios->c_iflag & (f)) | 105 | #define _I_FLAG(tty, f) ((tty)->termios->c_iflag & (f)) |
105 | #define _O_FLAG(tty,f) ((tty)->termios->c_oflag & (f)) | 106 | #define _O_FLAG(tty, f) ((tty)->termios->c_oflag & (f)) |
106 | #define _C_FLAG(tty,f) ((tty)->termios->c_cflag & (f)) | 107 | #define _C_FLAG(tty, f) ((tty)->termios->c_cflag & (f)) |
107 | #define _L_FLAG(tty,f) ((tty)->termios->c_lflag & (f)) | 108 | #define _L_FLAG(tty, f) ((tty)->termios->c_lflag & (f)) |
108 | 109 | ||
109 | #define I_IGNBRK(tty) _I_FLAG((tty),IGNBRK) | 110 | #define I_IGNBRK(tty) _I_FLAG((tty), IGNBRK) |
110 | #define I_BRKINT(tty) _I_FLAG((tty),BRKINT) | 111 | #define I_BRKINT(tty) _I_FLAG((tty), BRKINT) |
111 | #define I_IGNPAR(tty) _I_FLAG((tty),IGNPAR) | 112 | #define I_IGNPAR(tty) _I_FLAG((tty), IGNPAR) |
112 | #define I_PARMRK(tty) _I_FLAG((tty),PARMRK) | 113 | #define I_PARMRK(tty) _I_FLAG((tty), PARMRK) |
113 | #define I_INPCK(tty) _I_FLAG((tty),INPCK) | 114 | #define I_INPCK(tty) _I_FLAG((tty), INPCK) |
114 | #define I_ISTRIP(tty) _I_FLAG((tty),ISTRIP) | 115 | #define I_ISTRIP(tty) _I_FLAG((tty), ISTRIP) |
115 | #define I_INLCR(tty) _I_FLAG((tty),INLCR) | 116 | #define I_INLCR(tty) _I_FLAG((tty), INLCR) |
116 | #define I_IGNCR(tty) _I_FLAG((tty),IGNCR) | 117 | #define I_IGNCR(tty) _I_FLAG((tty), IGNCR) |
117 | #define I_ICRNL(tty) _I_FLAG((tty),ICRNL) | 118 | #define I_ICRNL(tty) _I_FLAG((tty), ICRNL) |
118 | #define I_IUCLC(tty) _I_FLAG((tty),IUCLC) | 119 | #define I_IUCLC(tty) _I_FLAG((tty), IUCLC) |
119 | #define I_IXON(tty) _I_FLAG((tty),IXON) | 120 | #define I_IXON(tty) _I_FLAG((tty), IXON) |
120 | #define I_IXANY(tty) _I_FLAG((tty),IXANY) | 121 | #define I_IXANY(tty) _I_FLAG((tty), IXANY) |
121 | #define I_IXOFF(tty) _I_FLAG((tty),IXOFF) | 122 | #define I_IXOFF(tty) _I_FLAG((tty), IXOFF) |
122 | #define I_IMAXBEL(tty) _I_FLAG((tty),IMAXBEL) | 123 | #define I_IMAXBEL(tty) _I_FLAG((tty), IMAXBEL) |
123 | #define I_IUTF8(tty) _I_FLAG((tty),IUTF8) | 124 | #define I_IUTF8(tty) _I_FLAG((tty), IUTF8) |
124 | 125 | ||
125 | #define O_OPOST(tty) _O_FLAG((tty),OPOST) | 126 | #define O_OPOST(tty) _O_FLAG((tty), OPOST) |
126 | #define O_OLCUC(tty) _O_FLAG((tty),OLCUC) | 127 | #define O_OLCUC(tty) _O_FLAG((tty), OLCUC) |
127 | #define O_ONLCR(tty) _O_FLAG((tty),ONLCR) | 128 | #define O_ONLCR(tty) _O_FLAG((tty), ONLCR) |
128 | #define O_OCRNL(tty) _O_FLAG((tty),OCRNL) | 129 | #define O_OCRNL(tty) _O_FLAG((tty), OCRNL) |
129 | #define O_ONOCR(tty) _O_FLAG((tty),ONOCR) | 130 | #define O_ONOCR(tty) _O_FLAG((tty), ONOCR) |
130 | #define O_ONLRET(tty) _O_FLAG((tty),ONLRET) | 131 | #define O_ONLRET(tty) _O_FLAG((tty), ONLRET) |
131 | #define O_OFILL(tty) _O_FLAG((tty),OFILL) | 132 | #define O_OFILL(tty) _O_FLAG((tty), OFILL) |
132 | #define O_OFDEL(tty) _O_FLAG((tty),OFDEL) | 133 | #define O_OFDEL(tty) _O_FLAG((tty), OFDEL) |
133 | #define O_NLDLY(tty) _O_FLAG((tty),NLDLY) | 134 | #define O_NLDLY(tty) _O_FLAG((tty), NLDLY) |
134 | #define O_CRDLY(tty) _O_FLAG((tty),CRDLY) | 135 | #define O_CRDLY(tty) _O_FLAG((tty), CRDLY) |
135 | #define O_TABDLY(tty) _O_FLAG((tty),TABDLY) | 136 | #define O_TABDLY(tty) _O_FLAG((tty), TABDLY) |
136 | #define O_BSDLY(tty) _O_FLAG((tty),BSDLY) | 137 | #define O_BSDLY(tty) _O_FLAG((tty), BSDLY) |
137 | #define O_VTDLY(tty) _O_FLAG((tty),VTDLY) | 138 | #define O_VTDLY(tty) _O_FLAG((tty), VTDLY) |
138 | #define O_FFDLY(tty) _O_FLAG((tty),FFDLY) | 139 | #define O_FFDLY(tty) _O_FLAG((tty), FFDLY) |
139 | 140 | ||
140 | #define C_BAUD(tty) _C_FLAG((tty),CBAUD) | 141 | #define C_BAUD(tty) _C_FLAG((tty), CBAUD) |
141 | #define C_CSIZE(tty) _C_FLAG((tty),CSIZE) | 142 | #define C_CSIZE(tty) _C_FLAG((tty), CSIZE) |
142 | #define C_CSTOPB(tty) _C_FLAG((tty),CSTOPB) | 143 | #define C_CSTOPB(tty) _C_FLAG((tty), CSTOPB) |
143 | #define C_CREAD(tty) _C_FLAG((tty),CREAD) | 144 | #define C_CREAD(tty) _C_FLAG((tty), CREAD) |
144 | #define C_PARENB(tty) _C_FLAG((tty),PARENB) | 145 | #define C_PARENB(tty) _C_FLAG((tty), PARENB) |
145 | #define C_PARODD(tty) _C_FLAG((tty),PARODD) | 146 | #define C_PARODD(tty) _C_FLAG((tty), PARODD) |
146 | #define C_HUPCL(tty) _C_FLAG((tty),HUPCL) | 147 | #define C_HUPCL(tty) _C_FLAG((tty), HUPCL) |
147 | #define C_CLOCAL(tty) _C_FLAG((tty),CLOCAL) | 148 | #define C_CLOCAL(tty) _C_FLAG((tty), CLOCAL) |
148 | #define C_CIBAUD(tty) _C_FLAG((tty),CIBAUD) | 149 | #define C_CIBAUD(tty) _C_FLAG((tty), CIBAUD) |
149 | #define C_CRTSCTS(tty) _C_FLAG((tty),CRTSCTS) | 150 | #define C_CRTSCTS(tty) _C_FLAG((tty), CRTSCTS) |
150 | 151 | ||
151 | #define L_ISIG(tty) _L_FLAG((tty),ISIG) | 152 | #define L_ISIG(tty) _L_FLAG((tty), ISIG) |
152 | #define L_ICANON(tty) _L_FLAG((tty),ICANON) | 153 | #define L_ICANON(tty) _L_FLAG((tty), ICANON) |
153 | #define L_XCASE(tty) _L_FLAG((tty),XCASE) | 154 | #define L_XCASE(tty) _L_FLAG((tty), XCASE) |
154 | #define L_ECHO(tty) _L_FLAG((tty),ECHO) | 155 | #define L_ECHO(tty) _L_FLAG((tty), ECHO) |
155 | #define L_ECHOE(tty) _L_FLAG((tty),ECHOE) | 156 | #define L_ECHOE(tty) _L_FLAG((tty), ECHOE) |
156 | #define L_ECHOK(tty) _L_FLAG((tty),ECHOK) | 157 | #define L_ECHOK(tty) _L_FLAG((tty), ECHOK) |
157 | #define L_ECHONL(tty) _L_FLAG((tty),ECHONL) | 158 | #define L_ECHONL(tty) _L_FLAG((tty), ECHONL) |
158 | #define L_NOFLSH(tty) _L_FLAG((tty),NOFLSH) | 159 | #define L_NOFLSH(tty) _L_FLAG((tty), NOFLSH) |
159 | #define L_TOSTOP(tty) _L_FLAG((tty),TOSTOP) | 160 | #define L_TOSTOP(tty) _L_FLAG((tty), TOSTOP) |
160 | #define L_ECHOCTL(tty) _L_FLAG((tty),ECHOCTL) | 161 | #define L_ECHOCTL(tty) _L_FLAG((tty), ECHOCTL) |
161 | #define L_ECHOPRT(tty) _L_FLAG((tty),ECHOPRT) | 162 | #define L_ECHOPRT(tty) _L_FLAG((tty), ECHOPRT) |
162 | #define L_ECHOKE(tty) _L_FLAG((tty),ECHOKE) | 163 | #define L_ECHOKE(tty) _L_FLAG((tty), ECHOKE) |
163 | #define L_FLUSHO(tty) _L_FLAG((tty),FLUSHO) | 164 | #define L_FLUSHO(tty) _L_FLAG((tty), FLUSHO) |
164 | #define L_PENDIN(tty) _L_FLAG((tty),PENDIN) | 165 | #define L_PENDIN(tty) _L_FLAG((tty), PENDIN) |
165 | #define L_IEXTEN(tty) _L_FLAG((tty),IEXTEN) | 166 | #define L_IEXTEN(tty) _L_FLAG((tty), IEXTEN) |
166 | 167 | ||
167 | struct device; | 168 | struct device; |
168 | struct signal_struct; | 169 | struct signal_struct; |
170 | |||
171 | /* | ||
172 | * Port level information. Each device keeps its own port level information | ||
173 | * so provide a common structure for those ports wanting to use common support | ||
174 | * routines. | ||
175 | * | ||
176 | * The tty port has a different lifetime to the tty so must be kept apart. | ||
177 | * In addition be careful as tty -> port mappings are valid for the life | ||
178 | * of the tty object but in many cases port -> tty mappings are valid only | ||
179 | * until a hangup so don't use the wrong path. | ||
180 | */ | ||
181 | |||
182 | struct tty_port { | ||
183 | struct tty_struct *tty; /* Back pointer */ | ||
184 | int blocked_open; /* Waiting to open */ | ||
185 | int count; /* Usage count */ | ||
186 | wait_queue_head_t open_wait; /* Open waiters */ | ||
187 | wait_queue_head_t close_wait; /* Close waiters */ | ||
188 | unsigned long flags; /* TTY flags ASY_*/ | ||
189 | struct mutex mutex; /* Locking */ | ||
190 | unsigned char *xmit_buf; /* Optional buffer */ | ||
191 | int close_delay; /* Close port delay */ | ||
192 | int closing_wait; /* Delay for output */ | ||
193 | }; | ||
194 | |||
169 | /* | 195 | /* |
170 | * Where all of the state associated with a tty is kept while the tty | 196 | * Where all of the state associated with a tty is kept while the tty |
171 | * is open. Since the termios state should be kept even if the tty | 197 | * is open. Since the termios state should be kept even if the tty |
@@ -185,6 +211,7 @@ struct tty_struct { | |||
185 | struct tty_driver *driver; | 211 | struct tty_driver *driver; |
186 | const struct tty_operations *ops; | 212 | const struct tty_operations *ops; |
187 | int index; | 213 | int index; |
214 | /* The ldisc objects are protected by tty_ldisc_lock at the moment */ | ||
188 | struct tty_ldisc ldisc; | 215 | struct tty_ldisc ldisc; |
189 | struct mutex termios_mutex; | 216 | struct mutex termios_mutex; |
190 | spinlock_t ctrl_lock; | 217 | spinlock_t ctrl_lock; |
@@ -213,7 +240,7 @@ struct tty_struct { | |||
213 | struct list_head tty_files; | 240 | struct list_head tty_files; |
214 | 241 | ||
215 | #define N_TTY_BUF_SIZE 4096 | 242 | #define N_TTY_BUF_SIZE 4096 |
216 | 243 | ||
217 | /* | 244 | /* |
218 | * The following is data for the N_TTY line discipline. For | 245 | * The following is data for the N_TTY line discipline. For |
219 | * historical reasons, this is included in the tty structure. | 246 | * historical reasons, this is included in the tty structure. |
@@ -241,6 +268,7 @@ struct tty_struct { | |||
241 | spinlock_t read_lock; | 268 | spinlock_t read_lock; |
242 | /* If the tty has a pending do_SAK, queue it here - akpm */ | 269 | /* If the tty has a pending do_SAK, queue it here - akpm */ |
243 | struct work_struct SAK_work; | 270 | struct work_struct SAK_work; |
271 | struct tty_port *port; | ||
244 | }; | 272 | }; |
245 | 273 | ||
246 | /* tty magic number */ | 274 | /* tty magic number */ |
@@ -248,14 +276,14 @@ struct tty_struct { | |||
248 | 276 | ||
249 | /* | 277 | /* |
250 | * These bits are used in the flags field of the tty structure. | 278 | * These bits are used in the flags field of the tty structure. |
251 | * | 279 | * |
252 | * So that interrupts won't be able to mess up the queues, | 280 | * So that interrupts won't be able to mess up the queues, |
253 | * copy_to_cooked must be atomic with respect to itself, as must | 281 | * copy_to_cooked must be atomic with respect to itself, as must |
254 | * tty->write. Thus, you must use the inline functions set_bit() and | 282 | * tty->write. Thus, you must use the inline functions set_bit() and |
255 | * clear_bit() to make things atomic. | 283 | * clear_bit() to make things atomic. |
256 | */ | 284 | */ |
257 | #define TTY_THROTTLED 0 /* Call unthrottle() at threshold min */ | 285 | #define TTY_THROTTLED 0 /* Call unthrottle() at threshold min */ |
258 | #define TTY_IO_ERROR 1 /* Canse an I/O error (may be no ldisc too) */ | 286 | #define TTY_IO_ERROR 1 /* Cause an I/O error (may be no ldisc too) */ |
259 | #define TTY_OTHER_CLOSED 2 /* Other side (if any) has closed */ | 287 | #define TTY_OTHER_CLOSED 2 /* Other side (if any) has closed */ |
260 | #define TTY_EXCLUSIVE 3 /* Exclusive open mode */ | 288 | #define TTY_EXCLUSIVE 3 /* Exclusive open mode */ |
261 | #define TTY_DEBUG 4 /* Debugging */ | 289 | #define TTY_DEBUG 4 /* Debugging */ |
@@ -285,12 +313,10 @@ extern int vcs_init(void); | |||
285 | extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode, | 313 | extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode, |
286 | const char *routine); | 314 | const char *routine); |
287 | extern char *tty_name(struct tty_struct *tty, char *buf); | 315 | extern char *tty_name(struct tty_struct *tty, char *buf); |
288 | extern void tty_wait_until_sent(struct tty_struct * tty, long timeout); | 316 | extern void tty_wait_until_sent(struct tty_struct *tty, long timeout); |
289 | extern int tty_check_change(struct tty_struct * tty); | 317 | extern int tty_check_change(struct tty_struct *tty); |
290 | extern void stop_tty(struct tty_struct * tty); | 318 | extern void stop_tty(struct tty_struct *tty); |
291 | extern void start_tty(struct tty_struct * tty); | 319 | extern void start_tty(struct tty_struct *tty); |
292 | extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc); | ||
293 | extern int tty_unregister_ldisc(int disc); | ||
294 | extern int tty_register_driver(struct tty_driver *driver); | 320 | extern int tty_register_driver(struct tty_driver *driver); |
295 | extern int tty_unregister_driver(struct tty_driver *driver); | 321 | extern int tty_unregister_driver(struct tty_driver *driver); |
296 | extern struct device *tty_register_device(struct tty_driver *driver, | 322 | extern struct device *tty_register_device(struct tty_driver *driver, |
@@ -310,10 +336,10 @@ extern int is_current_pgrp_orphaned(void); | |||
310 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); | 336 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); |
311 | extern int is_ignored(int sig); | 337 | extern int is_ignored(int sig); |
312 | extern int tty_signal(int sig, struct tty_struct *tty); | 338 | extern int tty_signal(int sig, struct tty_struct *tty); |
313 | extern void tty_hangup(struct tty_struct * tty); | 339 | extern void tty_hangup(struct tty_struct *tty); |
314 | extern void tty_vhangup(struct tty_struct * tty); | 340 | extern void tty_vhangup(struct tty_struct *tty); |
315 | extern void tty_unhangup(struct file *filp); | 341 | extern void tty_unhangup(struct file *filp); |
316 | extern int tty_hung_up_p(struct file * filp); | 342 | extern int tty_hung_up_p(struct file *filp); |
317 | extern void do_SAK(struct tty_struct *tty); | 343 | extern void do_SAK(struct tty_struct *tty); |
318 | extern void __do_SAK(struct tty_struct *tty); | 344 | extern void __do_SAK(struct tty_struct *tty); |
319 | extern void disassociate_ctty(int priv); | 345 | extern void disassociate_ctty(int priv); |
@@ -322,17 +348,17 @@ extern void tty_flip_buffer_push(struct tty_struct *tty); | |||
322 | extern speed_t tty_get_baud_rate(struct tty_struct *tty); | 348 | extern speed_t tty_get_baud_rate(struct tty_struct *tty); |
323 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); | 349 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); |
324 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); | 350 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); |
325 | extern void tty_termios_encode_baud_rate(struct ktermios *termios, speed_t ibaud, speed_t obaud); | 351 | extern void tty_termios_encode_baud_rate(struct ktermios *termios, |
326 | extern void tty_encode_baud_rate(struct tty_struct *tty, speed_t ibaud, speed_t obaud); | 352 | speed_t ibaud, speed_t obaud); |
353 | extern void tty_encode_baud_rate(struct tty_struct *tty, | ||
354 | speed_t ibaud, speed_t obaud); | ||
327 | extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); | 355 | extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); |
328 | extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); | 356 | extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); |
329 | 357 | ||
330 | extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); | 358 | extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); |
331 | extern void tty_ldisc_deref(struct tty_ldisc *); | 359 | extern void tty_ldisc_deref(struct tty_ldisc *); |
332 | extern struct tty_ldisc *tty_ldisc_ref_wait(struct tty_struct *); | 360 | extern struct tty_ldisc *tty_ldisc_ref_wait(struct tty_struct *); |
333 | 361 | extern const struct file_operations tty_ldiscs_proc_fops; | |
334 | extern struct tty_ldisc *tty_ldisc_get(int); | ||
335 | extern void tty_ldisc_put(int); | ||
336 | 362 | ||
337 | extern void tty_wakeup(struct tty_struct *tty); | 363 | extern void tty_wakeup(struct tty_struct *tty); |
338 | extern void tty_ldisc_flush(struct tty_struct *tty); | 364 | extern void tty_ldisc_flush(struct tty_struct *tty); |
@@ -351,10 +377,23 @@ extern void tty_write_unlock(struct tty_struct *tty); | |||
351 | extern int tty_write_lock(struct tty_struct *tty, int ndelay); | 377 | extern int tty_write_lock(struct tty_struct *tty, int ndelay); |
352 | #define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock)) | 378 | #define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock)) |
353 | 379 | ||
380 | extern void tty_port_init(struct tty_port *port); | ||
381 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); | ||
382 | extern void tty_port_free_xmit_buf(struct tty_port *port); | ||
383 | |||
384 | extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); | ||
385 | extern int tty_unregister_ldisc(int disc); | ||
386 | extern int tty_set_ldisc(struct tty_struct *tty, int ldisc); | ||
387 | extern int tty_ldisc_setup(struct tty_struct *tty, struct tty_struct *o_tty); | ||
388 | extern void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty); | ||
389 | extern void tty_ldisc_init(struct tty_struct *tty); | ||
390 | extern void tty_ldisc_begin(void); | ||
391 | /* This last one is just for the tty layer internals and shouldn't be used elsewhere */ | ||
392 | extern void tty_ldisc_enable(struct tty_struct *tty); | ||
354 | 393 | ||
355 | 394 | ||
356 | /* n_tty.c */ | 395 | /* n_tty.c */ |
357 | extern struct tty_ldisc tty_ldisc_N_TTY; | 396 | extern struct tty_ldisc_ops tty_ldisc_N_TTY; |
358 | 397 | ||
359 | /* tty_audit.c */ | 398 | /* tty_audit.c */ |
360 | #ifdef CONFIG_AUDIT | 399 | #ifdef CONFIG_AUDIT |
@@ -363,7 +402,8 @@ extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, | |||
363 | extern void tty_audit_exit(void); | 402 | extern void tty_audit_exit(void); |
364 | extern void tty_audit_fork(struct signal_struct *sig); | 403 | extern void tty_audit_fork(struct signal_struct *sig); |
365 | extern void tty_audit_push(struct tty_struct *tty); | 404 | extern void tty_audit_push(struct tty_struct *tty); |
366 | extern void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid, u32 sessionid); | 405 | extern void tty_audit_push_task(struct task_struct *tsk, |
406 | uid_t loginuid, u32 sessionid); | ||
367 | #else | 407 | #else |
368 | static inline void tty_audit_add_data(struct tty_struct *tty, | 408 | static inline void tty_audit_add_data(struct tty_struct *tty, |
369 | unsigned char *data, size_t size) | 409 | unsigned char *data, size_t size) |
@@ -378,19 +418,20 @@ static inline void tty_audit_fork(struct signal_struct *sig) | |||
378 | static inline void tty_audit_push(struct tty_struct *tty) | 418 | static inline void tty_audit_push(struct tty_struct *tty) |
379 | { | 419 | { |
380 | } | 420 | } |
381 | static inline void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid, u32 sessionid) | 421 | static inline void tty_audit_push_task(struct task_struct *tsk, |
422 | uid_t loginuid, u32 sessionid) | ||
382 | { | 423 | { |
383 | } | 424 | } |
384 | #endif | 425 | #endif |
385 | 426 | ||
386 | /* tty_ioctl.c */ | 427 | /* tty_ioctl.c */ |
387 | extern int n_tty_ioctl(struct tty_struct * tty, struct file * file, | 428 | extern int n_tty_ioctl(struct tty_struct *tty, struct file *file, |
388 | unsigned int cmd, unsigned long arg); | 429 | unsigned int cmd, unsigned long arg); |
389 | 430 | ||
390 | /* serial.c */ | 431 | /* serial.c */ |
391 | 432 | ||
392 | extern void serial_console_init(void); | 433 | extern void serial_console_init(void); |
393 | 434 | ||
394 | /* pcxx.c */ | 435 | /* pcxx.c */ |
395 | 436 | ||
396 | extern int pcxe_open(struct tty_struct *tty, struct file *filp); | 437 | extern int pcxe_open(struct tty_struct *tty, struct file *filp); |
@@ -401,7 +442,7 @@ extern void console_print(const char *); | |||
401 | 442 | ||
402 | /* vt.c */ | 443 | /* vt.c */ |
403 | 444 | ||
404 | extern int vt_ioctl(struct tty_struct *tty, struct file * file, | 445 | extern int vt_ioctl(struct tty_struct *tty, struct file *file, |
405 | unsigned int cmd, unsigned long arg); | 446 | unsigned int cmd, unsigned long arg); |
406 | 447 | ||
407 | #endif /* __KERNEL__ */ | 448 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index d2a003586761..e1065ac0d922 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -135,7 +135,7 @@ | |||
135 | * | 135 | * |
136 | * Optional: | 136 | * Optional: |
137 | * | 137 | * |
138 | * void (*break_ctl)(struct tty_stuct *tty, int state); | 138 | * int (*break_ctl)(struct tty_stuct *tty, int state); |
139 | * | 139 | * |
140 | * This optional routine requests the tty driver to turn on or | 140 | * This optional routine requests the tty driver to turn on or |
141 | * off BREAK status on the RS-232 port. If state is -1, | 141 | * off BREAK status on the RS-232 port. If state is -1, |
@@ -146,6 +146,10 @@ | |||
146 | * handle the following ioctls: TCSBRK, TCSBRKP, TIOCSBRK, | 146 | * handle the following ioctls: TCSBRK, TCSBRKP, TIOCSBRK, |
147 | * TIOCCBRK. | 147 | * TIOCCBRK. |
148 | * | 148 | * |
149 | * If the driver sets TTY_DRIVER_HARDWARE_BREAK then the interface | ||
150 | * will also be called with actual times and the hardware is expected | ||
151 | * to do the delay work itself. 0 and -1 are still used for on/off. | ||
152 | * | ||
149 | * Optional: Required for TCSBRK/BRKP/etc handling. | 153 | * Optional: Required for TCSBRK/BRKP/etc handling. |
150 | * | 154 | * |
151 | * void (*wait_until_sent)(struct tty_struct *tty, int timeout); | 155 | * void (*wait_until_sent)(struct tty_struct *tty, int timeout); |
@@ -192,7 +196,7 @@ struct tty_operations { | |||
192 | void (*stop)(struct tty_struct *tty); | 196 | void (*stop)(struct tty_struct *tty); |
193 | void (*start)(struct tty_struct *tty); | 197 | void (*start)(struct tty_struct *tty); |
194 | void (*hangup)(struct tty_struct *tty); | 198 | void (*hangup)(struct tty_struct *tty); |
195 | void (*break_ctl)(struct tty_struct *tty, int state); | 199 | int (*break_ctl)(struct tty_struct *tty, int state); |
196 | void (*flush_buffer)(struct tty_struct *tty); | 200 | void (*flush_buffer)(struct tty_struct *tty); |
197 | void (*set_ldisc)(struct tty_struct *tty); | 201 | void (*set_ldisc)(struct tty_struct *tty); |
198 | void (*wait_until_sent)(struct tty_struct *tty, int timeout); | 202 | void (*wait_until_sent)(struct tty_struct *tty, int timeout); |
@@ -285,12 +289,18 @@ extern struct tty_driver *tty_find_polling_driver(char *name, int *line); | |||
285 | * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead | 289 | * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead |
286 | * use dynamic memory keyed through the devpts filesystem. This | 290 | * use dynamic memory keyed through the devpts filesystem. This |
287 | * is only applicable to the pty driver. | 291 | * is only applicable to the pty driver. |
292 | * | ||
293 | * TTY_DRIVER_HARDWARE_BREAK -- hardware handles break signals. Pass | ||
294 | * the requested timeout to the caller instead of using a simple | ||
295 | * on/off interface. | ||
296 | * | ||
288 | */ | 297 | */ |
289 | #define TTY_DRIVER_INSTALLED 0x0001 | 298 | #define TTY_DRIVER_INSTALLED 0x0001 |
290 | #define TTY_DRIVER_RESET_TERMIOS 0x0002 | 299 | #define TTY_DRIVER_RESET_TERMIOS 0x0002 |
291 | #define TTY_DRIVER_REAL_RAW 0x0004 | 300 | #define TTY_DRIVER_REAL_RAW 0x0004 |
292 | #define TTY_DRIVER_DYNAMIC_DEV 0x0008 | 301 | #define TTY_DRIVER_DYNAMIC_DEV 0x0008 |
293 | #define TTY_DRIVER_DEVPTS_MEM 0x0010 | 302 | #define TTY_DRIVER_DEVPTS_MEM 0x0010 |
303 | #define TTY_DRIVER_HARDWARE_BREAK 0x0020 | ||
294 | 304 | ||
295 | /* tty driver types */ | 305 | /* tty driver types */ |
296 | #define TTY_DRIVER_TYPE_SYSTEM 0x0001 | 306 | #define TTY_DRIVER_TYPE_SYSTEM 0x0001 |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 6226504d9108..40f38d896777 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -104,7 +104,7 @@ | |||
104 | #include <linux/fs.h> | 104 | #include <linux/fs.h> |
105 | #include <linux/wait.h> | 105 | #include <linux/wait.h> |
106 | 106 | ||
107 | struct tty_ldisc { | 107 | struct tty_ldisc_ops { |
108 | int magic; | 108 | int magic; |
109 | char *name; | 109 | char *name; |
110 | int num; | 110 | int num; |
@@ -142,6 +142,11 @@ struct tty_ldisc { | |||
142 | int refcount; | 142 | int refcount; |
143 | }; | 143 | }; |
144 | 144 | ||
145 | struct tty_ldisc { | ||
146 | struct tty_ldisc_ops *ops; | ||
147 | int refcount; | ||
148 | }; | ||
149 | |||
145 | #define TTY_LDISC_MAGIC 0x5403 | 150 | #define TTY_LDISC_MAGIC 0x5403 |
146 | 151 | ||
147 | #define LDISC_FLAG_DEFINED 0x00000001 | 152 | #define LDISC_FLAG_DEFINED 0x00000001 |
diff --git a/include/linux/udp.h b/include/linux/udp.h index 581ca2c14c52..0cf5c4c0ec81 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -38,6 +38,7 @@ struct udphdr { | |||
38 | #ifdef __KERNEL__ | 38 | #ifdef __KERNEL__ |
39 | #include <net/inet_sock.h> | 39 | #include <net/inet_sock.h> |
40 | #include <linux/skbuff.h> | 40 | #include <linux/skbuff.h> |
41 | #include <net/netns/hash.h> | ||
41 | 42 | ||
42 | static inline struct udphdr *udp_hdr(const struct sk_buff *skb) | 43 | static inline struct udphdr *udp_hdr(const struct sk_buff *skb) |
43 | { | 44 | { |
@@ -46,6 +47,11 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb) | |||
46 | 47 | ||
47 | #define UDP_HTABLE_SIZE 128 | 48 | #define UDP_HTABLE_SIZE 128 |
48 | 49 | ||
50 | static inline int udp_hashfn(struct net *net, const unsigned num) | ||
51 | { | ||
52 | return (num + net_hash_mix(net)) & (UDP_HTABLE_SIZE - 1); | ||
53 | } | ||
54 | |||
49 | struct udp_sock { | 55 | struct udp_sock { |
50 | /* inet_sock has to be the first member */ | 56 | /* inet_sock has to be the first member */ |
51 | struct inet_sock inet; | 57 | struct inet_sock inet; |
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h index 973386d439da..cdf338d94b7f 100644 --- a/include/linux/uio_driver.h +++ b/include/linux/uio_driver.h | |||
@@ -36,7 +36,7 @@ struct uio_mem { | |||
36 | struct uio_map *map; | 36 | struct uio_map *map; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | #define MAX_UIO_MAPS 5 | 39 | #define MAX_UIO_MAPS 5 |
40 | 40 | ||
41 | struct uio_device; | 41 | struct uio_device; |
42 | 42 | ||
@@ -53,6 +53,7 @@ struct uio_device; | |||
53 | * @mmap: mmap operation for this uio device | 53 | * @mmap: mmap operation for this uio device |
54 | * @open: open operation for this uio device | 54 | * @open: open operation for this uio device |
55 | * @release: release operation for this uio device | 55 | * @release: release operation for this uio device |
56 | * @irqcontrol: disable/enable irqs when 0/1 is written to /dev/uioX | ||
56 | */ | 57 | */ |
57 | struct uio_info { | 58 | struct uio_info { |
58 | struct uio_device *uio_dev; | 59 | struct uio_device *uio_dev; |
@@ -66,6 +67,7 @@ struct uio_info { | |||
66 | int (*mmap)(struct uio_info *info, struct vm_area_struct *vma); | 67 | int (*mmap)(struct uio_info *info, struct vm_area_struct *vma); |
67 | int (*open)(struct uio_info *info, struct inode *inode); | 68 | int (*open)(struct uio_info *info, struct inode *inode); |
68 | int (*release)(struct uio_info *info, struct inode *inode); | 69 | int (*release)(struct uio_info *info, struct inode *inode); |
70 | int (*irqcontrol)(struct uio_info *info, s32 irq_on); | ||
69 | }; | 71 | }; |
70 | 72 | ||
71 | extern int __must_check | 73 | extern int __must_check |
@@ -80,11 +82,11 @@ static inline int __must_check | |||
80 | extern void uio_unregister_device(struct uio_info *info); | 82 | extern void uio_unregister_device(struct uio_info *info); |
81 | extern void uio_event_notify(struct uio_info *info); | 83 | extern void uio_event_notify(struct uio_info *info); |
82 | 84 | ||
83 | /* defines for uio_device->irq */ | 85 | /* defines for uio_info->irq */ |
84 | #define UIO_IRQ_CUSTOM -1 | 86 | #define UIO_IRQ_CUSTOM -1 |
85 | #define UIO_IRQ_NONE -2 | 87 | #define UIO_IRQ_NONE -2 |
86 | 88 | ||
87 | /* defines for uio_device->memtype */ | 89 | /* defines for uio_mem->memtype */ |
88 | #define UIO_MEM_NONE 0 | 90 | #define UIO_MEM_NONE 0 |
89 | #define UIO_MEM_PHYS 1 | 91 | #define UIO_MEM_PHYS 1 |
90 | #define UIO_MEM_LOGICAL 2 | 92 | #define UIO_MEM_LOGICAL 2 |
diff --git a/include/linux/usb.h b/include/linux/usb.h index c08689ea9b4b..5811c5da69f9 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -160,6 +160,7 @@ struct usb_interface { | |||
160 | unsigned is_active:1; /* the interface is not suspended */ | 160 | unsigned is_active:1; /* the interface is not suspended */ |
161 | unsigned sysfs_files_created:1; /* the sysfs attributes exist */ | 161 | unsigned sysfs_files_created:1; /* the sysfs attributes exist */ |
162 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ | 162 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ |
163 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ | ||
163 | 164 | ||
164 | struct device dev; /* interface specific device info */ | 165 | struct device dev; /* interface specific device info */ |
165 | struct device *usb_dev; | 166 | struct device *usb_dev; |
@@ -293,7 +294,7 @@ struct usb_devmap { | |||
293 | struct usb_bus { | 294 | struct usb_bus { |
294 | struct device *controller; /* host/master side hardware */ | 295 | struct device *controller; /* host/master side hardware */ |
295 | int busnum; /* Bus number (in order of reg) */ | 296 | int busnum; /* Bus number (in order of reg) */ |
296 | char *bus_name; /* stable id (PCI slot_name etc) */ | 297 | const char *bus_name; /* stable id (PCI slot_name etc) */ |
297 | u8 uses_dma; /* Does the host controller use DMA? */ | 298 | u8 uses_dma; /* Does the host controller use DMA? */ |
298 | u8 otg_port; /* 0, or number of OTG/HNP port */ | 299 | u8 otg_port; /* 0, or number of OTG/HNP port */ |
299 | unsigned is_b_host:1; /* true during some HNP roleswitches */ | 300 | unsigned is_b_host:1; /* true during some HNP roleswitches */ |
@@ -497,8 +498,6 @@ extern int usb_lock_device_for_reset(struct usb_device *udev, | |||
497 | 498 | ||
498 | /* USB port reset for device reinitialization */ | 499 | /* USB port reset for device reinitialization */ |
499 | extern int usb_reset_device(struct usb_device *dev); | 500 | extern int usb_reset_device(struct usb_device *dev); |
500 | extern int usb_reset_composite_device(struct usb_device *dev, | ||
501 | struct usb_interface *iface); | ||
502 | 501 | ||
503 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | 502 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); |
504 | 503 | ||
@@ -958,9 +957,9 @@ struct usbdrv_wrap { | |||
958 | * @resume: Called when the device is being resumed by the system. | 957 | * @resume: Called when the device is being resumed by the system. |
959 | * @reset_resume: Called when the suspended device has been reset instead | 958 | * @reset_resume: Called when the suspended device has been reset instead |
960 | * of being resumed. | 959 | * of being resumed. |
961 | * @pre_reset: Called by usb_reset_composite_device() when the device | 960 | * @pre_reset: Called by usb_reset_device() when the device |
962 | * is about to be reset. | 961 | * is about to be reset. |
963 | * @post_reset: Called by usb_reset_composite_device() after the device | 962 | * @post_reset: Called by usb_reset_device() after the device |
964 | * has been reset | 963 | * has been reset |
965 | * @id_table: USB drivers use ID table to support hotplugging. | 964 | * @id_table: USB drivers use ID table to support hotplugging. |
966 | * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set | 965 | * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set |
@@ -972,6 +971,8 @@ struct usbdrv_wrap { | |||
972 | * added to this driver by preventing the sysfs file from being created. | 971 | * added to this driver by preventing the sysfs file from being created. |
973 | * @supports_autosuspend: if set to 0, the USB core will not allow autosuspend | 972 | * @supports_autosuspend: if set to 0, the USB core will not allow autosuspend |
974 | * for interfaces bound to this driver. | 973 | * for interfaces bound to this driver. |
974 | * @soft_unbind: if set to 1, the USB core will not kill URBs and disable | ||
975 | * endpoints before calling the driver's disconnect method. | ||
975 | * | 976 | * |
976 | * USB interface drivers must provide a name, probe() and disconnect() | 977 | * USB interface drivers must provide a name, probe() and disconnect() |
977 | * methods, and an id_table. Other driver fields are optional. | 978 | * methods, and an id_table. Other driver fields are optional. |
@@ -1012,6 +1013,7 @@ struct usb_driver { | |||
1012 | struct usbdrv_wrap drvwrap; | 1013 | struct usbdrv_wrap drvwrap; |
1013 | unsigned int no_dynamic_id:1; | 1014 | unsigned int no_dynamic_id:1; |
1014 | unsigned int supports_autosuspend:1; | 1015 | unsigned int supports_autosuspend:1; |
1016 | unsigned int soft_unbind:1; | ||
1015 | }; | 1017 | }; |
1016 | #define to_usb_driver(d) container_of(d, struct usb_driver, drvwrap.driver) | 1018 | #define to_usb_driver(d) container_of(d, struct usb_driver, drvwrap.driver) |
1017 | 1019 | ||
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h new file mode 100644 index 000000000000..747c3a49cdc9 --- /dev/null +++ b/include/linux/usb/composite.h | |||
@@ -0,0 +1,338 @@ | |||
1 | /* | ||
2 | * composite.h -- framework for usb gadgets which are composite devices | ||
3 | * | ||
4 | * Copyright (C) 2006-2008 David Brownell | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | */ | ||
20 | |||
21 | #ifndef __LINUX_USB_COMPOSITE_H | ||
22 | #define __LINUX_USB_COMPOSITE_H | ||
23 | |||
24 | /* | ||
25 | * This framework is an optional layer on top of the USB Gadget interface, | ||
26 | * making it easier to build (a) Composite devices, supporting multiple | ||
27 | * functions within any single configuration, and (b) Multi-configuration | ||
28 | * devices, also supporting multiple functions but without necessarily | ||
29 | * having more than one function per configuration. | ||
30 | * | ||
31 | * Example: a device with a single configuration supporting both network | ||
32 | * link and mass storage functions is a composite device. Those functions | ||
33 | * might alternatively be packaged in individual configurations, but in | ||
34 | * the composite model the host can use both functions at the same time. | ||
35 | */ | ||
36 | |||
37 | #include <linux/usb/ch9.h> | ||
38 | #include <linux/usb/gadget.h> | ||
39 | |||
40 | |||
41 | struct usb_configuration; | ||
42 | |||
43 | /** | ||
44 | * struct usb_function - describes one function of a configuration | ||
45 | * @name: For diagnostics, identifies the function. | ||
46 | * @strings: tables of strings, keyed by identifiers assigned during bind() | ||
47 | * and by language IDs provided in control requests | ||
48 | * @descriptors: Table of full (or low) speed descriptors, using interface and | ||
49 | * string identifiers assigned during @bind(). If this pointer is null, | ||
50 | * the function will not be available at full speed (or at low speed). | ||
51 | * @hs_descriptors: Table of high speed descriptors, using interface and | ||
52 | * string identifiers assigned during @bind(). If this pointer is null, | ||
53 | * the function will not be available at high speed. | ||
54 | * @config: assigned when @usb_add_function() is called; this is the | ||
55 | * configuration with which this function is associated. | ||
56 | * @bind: Before the gadget can register, all of its functions bind() to the | ||
57 | * available resources including string and interface identifiers used | ||
58 | * in interface or class descriptors; endpoints; I/O buffers; and so on. | ||
59 | * @unbind: Reverses @bind; called as a side effect of unregistering the | ||
60 | * driver which added this function. | ||
61 | * @set_alt: (REQUIRED) Reconfigures altsettings; function drivers may | ||
62 | * initialize usb_ep.driver data at this time (when it is used). | ||
63 | * Note that setting an interface to its current altsetting resets | ||
64 | * interface state, and that all interfaces have a disabled state. | ||
65 | * @get_alt: Returns the active altsetting. If this is not provided, | ||
66 | * then only altsetting zero is supported. | ||
67 | * @disable: (REQUIRED) Indicates the function should be disabled. Reasons | ||
68 | * include host resetting or reconfiguring the gadget, and disconnection. | ||
69 | * @setup: Used for interface-specific control requests. | ||
70 | * @suspend: Notifies functions when the host stops sending USB traffic. | ||
71 | * @resume: Notifies functions when the host restarts USB traffic. | ||
72 | * | ||
73 | * A single USB function uses one or more interfaces, and should in most | ||
74 | * cases support operation at both full and high speeds. Each function is | ||
75 | * associated by @usb_add_function() with a one configuration; that function | ||
76 | * causes @bind() to be called so resources can be allocated as part of | ||
77 | * setting up a gadget driver. Those resources include endpoints, which | ||
78 | * should be allocated using @usb_ep_autoconfig(). | ||
79 | * | ||
80 | * To support dual speed operation, a function driver provides descriptors | ||
81 | * for both high and full speed operation. Except in rare cases that don't | ||
82 | * involve bulk endpoints, each speed needs different endpoint descriptors. | ||
83 | * | ||
84 | * Function drivers choose their own strategies for managing instance data. | ||
85 | * The simplest strategy just declares it "static', which means the function | ||
86 | * can only be activated once. If the function needs to be exposed in more | ||
87 | * than one configuration at a given speed, it needs to support multiple | ||
88 | * usb_function structures (one for each configuration). | ||
89 | * | ||
90 | * A more complex strategy might encapsulate a @usb_function structure inside | ||
91 | * a driver-specific instance structure to allows multiple activations. An | ||
92 | * example of multiple activations might be a CDC ACM function that supports | ||
93 | * two or more distinct instances within the same configuration, providing | ||
94 | * several independent logical data links to a USB host. | ||
95 | */ | ||
96 | struct usb_function { | ||
97 | const char *name; | ||
98 | struct usb_gadget_strings **strings; | ||
99 | struct usb_descriptor_header **descriptors; | ||
100 | struct usb_descriptor_header **hs_descriptors; | ||
101 | |||
102 | struct usb_configuration *config; | ||
103 | |||
104 | /* REVISIT: bind() functions can be marked __init, which | ||
105 | * makes trouble for section mismatch analysis. See if | ||
106 | * we can't restructure things to avoid mismatching. | ||
107 | * Related: unbind() may kfree() but bind() won't... | ||
108 | */ | ||
109 | |||
110 | /* configuration management: bind/unbind */ | ||
111 | int (*bind)(struct usb_configuration *, | ||
112 | struct usb_function *); | ||
113 | void (*unbind)(struct usb_configuration *, | ||
114 | struct usb_function *); | ||
115 | |||
116 | /* runtime state management */ | ||
117 | int (*set_alt)(struct usb_function *, | ||
118 | unsigned interface, unsigned alt); | ||
119 | int (*get_alt)(struct usb_function *, | ||
120 | unsigned interface); | ||
121 | void (*disable)(struct usb_function *); | ||
122 | int (*setup)(struct usb_function *, | ||
123 | const struct usb_ctrlrequest *); | ||
124 | void (*suspend)(struct usb_function *); | ||
125 | void (*resume)(struct usb_function *); | ||
126 | |||
127 | /* internals */ | ||
128 | struct list_head list; | ||
129 | }; | ||
130 | |||
131 | int usb_add_function(struct usb_configuration *, struct usb_function *); | ||
132 | |||
133 | int usb_interface_id(struct usb_configuration *, struct usb_function *); | ||
134 | |||
135 | /** | ||
136 | * ep_choose - select descriptor endpoint at current device speed | ||
137 | * @g: gadget, connected and running at some speed | ||
138 | * @hs: descriptor to use for high speed operation | ||
139 | * @fs: descriptor to use for full or low speed operation | ||
140 | */ | ||
141 | static inline struct usb_endpoint_descriptor * | ||
142 | ep_choose(struct usb_gadget *g, struct usb_endpoint_descriptor *hs, | ||
143 | struct usb_endpoint_descriptor *fs) | ||
144 | { | ||
145 | if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH) | ||
146 | return hs; | ||
147 | return fs; | ||
148 | } | ||
149 | |||
150 | #define MAX_CONFIG_INTERFACES 16 /* arbitrary; max 255 */ | ||
151 | |||
152 | /** | ||
153 | * struct usb_configuration - represents one gadget configuration | ||
154 | * @label: For diagnostics, describes the configuration. | ||
155 | * @strings: Tables of strings, keyed by identifiers assigned during @bind() | ||
156 | * and by language IDs provided in control requests. | ||
157 | * @descriptors: Table of descriptors preceding all function descriptors. | ||
158 | * Examples include OTG and vendor-specific descriptors. | ||
159 | * @bind: Called from @usb_add_config() to allocate resources unique to this | ||
160 | * configuration and to call @usb_add_function() for each function used. | ||
161 | * @unbind: Reverses @bind; called as a side effect of unregistering the | ||
162 | * driver which added this configuration. | ||
163 | * @setup: Used to delegate control requests that aren't handled by standard | ||
164 | * device infrastructure or directed at a specific interface. | ||
165 | * @bConfigurationValue: Copied into configuration descriptor. | ||
166 | * @iConfiguration: Copied into configuration descriptor. | ||
167 | * @bmAttributes: Copied into configuration descriptor. | ||
168 | * @bMaxPower: Copied into configuration descriptor. | ||
169 | * @cdev: assigned by @usb_add_config() before calling @bind(); this is | ||
170 | * the device associated with this configuration. | ||
171 | * | ||
172 | * Configurations are building blocks for gadget drivers structured around | ||
173 | * function drivers. Simple USB gadgets require only one function and one | ||
174 | * configuration, and handle dual-speed hardware by always providing the same | ||
175 | * functionality. Slightly more complex gadgets may have more than one | ||
176 | * single-function configuration at a given speed; or have configurations | ||
177 | * that only work at one speed. | ||
178 | * | ||
179 | * Composite devices are, by definition, ones with configurations which | ||
180 | * include more than one function. | ||
181 | * | ||
182 | * The lifecycle of a usb_configuration includes allocation, initialization | ||
183 | * of the fields described above, and calling @usb_add_config() to set up | ||
184 | * internal data and bind it to a specific device. The configuration's | ||
185 | * @bind() method is then used to initialize all the functions and then | ||
186 | * call @usb_add_function() for them. | ||
187 | * | ||
188 | * Those functions would normally be independant of each other, but that's | ||
189 | * not mandatory. CDC WMC devices are an example where functions often | ||
190 | * depend on other functions, with some functions subsidiary to others. | ||
191 | * Such interdependency may be managed in any way, so long as all of the | ||
192 | * descriptors complete by the time the composite driver returns from | ||
193 | * its bind() routine. | ||
194 | */ | ||
195 | struct usb_configuration { | ||
196 | const char *label; | ||
197 | struct usb_gadget_strings **strings; | ||
198 | const struct usb_descriptor_header **descriptors; | ||
199 | |||
200 | /* REVISIT: bind() functions can be marked __init, which | ||
201 | * makes trouble for section mismatch analysis. See if | ||
202 | * we can't restructure things to avoid mismatching... | ||
203 | */ | ||
204 | |||
205 | /* configuration management: bind/unbind */ | ||
206 | int (*bind)(struct usb_configuration *); | ||
207 | void (*unbind)(struct usb_configuration *); | ||
208 | int (*setup)(struct usb_configuration *, | ||
209 | const struct usb_ctrlrequest *); | ||
210 | |||
211 | /* fields in the config descriptor */ | ||
212 | u8 bConfigurationValue; | ||
213 | u8 iConfiguration; | ||
214 | u8 bmAttributes; | ||
215 | u8 bMaxPower; | ||
216 | |||
217 | struct usb_composite_dev *cdev; | ||
218 | |||
219 | /* internals */ | ||
220 | struct list_head list; | ||
221 | struct list_head functions; | ||
222 | u8 next_interface_id; | ||
223 | unsigned highspeed:1; | ||
224 | unsigned fullspeed:1; | ||
225 | struct usb_function *interface[MAX_CONFIG_INTERFACES]; | ||
226 | }; | ||
227 | |||
228 | int usb_add_config(struct usb_composite_dev *, | ||
229 | struct usb_configuration *); | ||
230 | |||
231 | /** | ||
232 | * struct usb_composite_driver - groups configurations into a gadget | ||
233 | * @name: For diagnostics, identifies the driver. | ||
234 | * @dev: Template descriptor for the device, including default device | ||
235 | * identifiers. | ||
236 | * @strings: tables of strings, keyed by identifiers assigned during bind() | ||
237 | * and language IDs provided in control requests | ||
238 | * @bind: (REQUIRED) Used to allocate resources that are shared across the | ||
239 | * whole device, such as string IDs, and add its configurations using | ||
240 | * @usb_add_config(). This may fail by returning a negative errno | ||
241 | * value; it should return zero on successful initialization. | ||
242 | * @unbind: Reverses @bind(); called as a side effect of unregistering | ||
243 | * this driver. | ||
244 | * | ||
245 | * Devices default to reporting self powered operation. Devices which rely | ||
246 | * on bus powered operation should report this in their @bind() method. | ||
247 | * | ||
248 | * Before returning from @bind, various fields in the template descriptor | ||
249 | * may be overridden. These include the idVendor/idProduct/bcdDevice values | ||
250 | * normally to bind the appropriate host side driver, and the three strings | ||
251 | * (iManufacturer, iProduct, iSerialNumber) normally used to provide user | ||
252 | * meaningful device identifiers. (The strings will not be defined unless | ||
253 | * they are defined in @dev and @strings.) The correct ep0 maxpacket size | ||
254 | * is also reported, as defined by the underlying controller driver. | ||
255 | */ | ||
256 | struct usb_composite_driver { | ||
257 | const char *name; | ||
258 | const struct usb_device_descriptor *dev; | ||
259 | struct usb_gadget_strings **strings; | ||
260 | |||
261 | /* REVISIT: bind() functions can be marked __init, which | ||
262 | * makes trouble for section mismatch analysis. See if | ||
263 | * we can't restructure things to avoid mismatching... | ||
264 | */ | ||
265 | |||
266 | int (*bind)(struct usb_composite_dev *); | ||
267 | int (*unbind)(struct usb_composite_dev *); | ||
268 | }; | ||
269 | |||
270 | extern int usb_composite_register(struct usb_composite_driver *); | ||
271 | extern void usb_composite_unregister(struct usb_composite_driver *); | ||
272 | |||
273 | |||
274 | /** | ||
275 | * struct usb_composite_device - represents one composite usb gadget | ||
276 | * @gadget: read-only, abstracts the gadget's usb peripheral controller | ||
277 | * @req: used for control responses; buffer is pre-allocated | ||
278 | * @bufsiz: size of buffer pre-allocated in @req | ||
279 | * @config: the currently active configuration | ||
280 | * | ||
281 | * One of these devices is allocated and initialized before the | ||
282 | * associated device driver's bind() is called. | ||
283 | * | ||
284 | * OPEN ISSUE: it appears that some WUSB devices will need to be | ||
285 | * built by combining a normal (wired) gadget with a wireless one. | ||
286 | * This revision of the gadget framework should probably try to make | ||
287 | * sure doing that won't hurt too much. | ||
288 | * | ||
289 | * One notion for how to handle Wireless USB devices involves: | ||
290 | * (a) a second gadget here, discovery mechanism TBD, but likely | ||
291 | * needing separate "register/unregister WUSB gadget" calls; | ||
292 | * (b) updates to usb_gadget to include flags "is it wireless", | ||
293 | * "is it wired", plus (presumably in a wrapper structure) | ||
294 | * bandgroup and PHY info; | ||
295 | * (c) presumably a wireless_ep wrapping a usb_ep, and reporting | ||
296 | * wireless-specific parameters like maxburst and maxsequence; | ||
297 | * (d) configurations that are specific to wireless links; | ||
298 | * (e) function drivers that understand wireless configs and will | ||
299 | * support wireless for (additional) function instances; | ||
300 | * (f) a function to support association setup (like CBAF), not | ||
301 | * necessarily requiring a wireless adapter; | ||
302 | * (g) composite device setup that can create one or more wireless | ||
303 | * configs, including appropriate association setup support; | ||
304 | * (h) more, TBD. | ||
305 | */ | ||
306 | struct usb_composite_dev { | ||
307 | struct usb_gadget *gadget; | ||
308 | struct usb_request *req; | ||
309 | unsigned bufsiz; | ||
310 | |||
311 | struct usb_configuration *config; | ||
312 | |||
313 | /* internals */ | ||
314 | struct usb_device_descriptor desc; | ||
315 | struct list_head configs; | ||
316 | struct usb_composite_driver *driver; | ||
317 | u8 next_string_id; | ||
318 | |||
319 | spinlock_t lock; | ||
320 | |||
321 | /* REVISIT use and existence of lock ... */ | ||
322 | }; | ||
323 | |||
324 | extern int usb_string_id(struct usb_composite_dev *c); | ||
325 | |||
326 | /* messaging utils */ | ||
327 | #define DBG(d, fmt, args...) \ | ||
328 | dev_dbg(&(d)->gadget->dev , fmt , ## args) | ||
329 | #define VDBG(d, fmt, args...) \ | ||
330 | dev_vdbg(&(d)->gadget->dev , fmt , ## args) | ||
331 | #define ERROR(d, fmt, args...) \ | ||
332 | dev_err(&(d)->gadget->dev , fmt , ## args) | ||
333 | #define WARN(d, fmt, args...) \ | ||
334 | dev_warn(&(d)->gadget->dev , fmt , ## args) | ||
335 | #define INFO(d, fmt, args...) \ | ||
336 | dev_info(&(d)->gadget->dev , fmt , ## args) | ||
337 | |||
338 | #endif /* __LINUX_USB_COMPOSITE_H */ | ||
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index cf468fbdbf8e..0460a746480c 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -33,7 +33,8 @@ struct usb_ep; | |||
33 | * @short_not_ok: When reading data, makes short packets be | 33 | * @short_not_ok: When reading data, makes short packets be |
34 | * treated as errors (queue stops advancing till cleanup). | 34 | * treated as errors (queue stops advancing till cleanup). |
35 | * @complete: Function called when request completes, so this request and | 35 | * @complete: Function called when request completes, so this request and |
36 | * its buffer may be re-used. | 36 | * its buffer may be re-used. The function will always be called with |
37 | * interrupts disabled, and it must not sleep. | ||
37 | * Reads terminate with a short packet, or when the buffer fills, | 38 | * Reads terminate with a short packet, or when the buffer fills, |
38 | * whichever comes first. When writes terminate, some data bytes | 39 | * whichever comes first. When writes terminate, some data bytes |
39 | * will usually still be in flight (often in a hardware fifo). | 40 | * will usually still be in flight (often in a hardware fifo). |
@@ -271,7 +272,10 @@ static inline void usb_ep_free_request(struct usb_ep *ep, | |||
271 | * (Note that some USB device controllers disallow protocol stall responses | 272 | * (Note that some USB device controllers disallow protocol stall responses |
272 | * in some cases.) When control responses are deferred (the response is | 273 | * in some cases.) When control responses are deferred (the response is |
273 | * written after the setup callback returns), then usb_ep_set_halt() may be | 274 | * written after the setup callback returns), then usb_ep_set_halt() may be |
274 | * used on ep0 to trigger protocol stalls. | 275 | * used on ep0 to trigger protocol stalls. Depending on the controller, |
276 | * it may not be possible to trigger a status-stage protocol stall when the | ||
277 | * data stage is over, that is, from within the response's completion | ||
278 | * routine. | ||
275 | * | 279 | * |
276 | * For periodic endpoints, like interrupt or isochronous ones, the usb host | 280 | * For periodic endpoints, like interrupt or isochronous ones, the usb host |
277 | * arranges to poll once per interval, and the gadget driver usually will | 281 | * arranges to poll once per interval, and the gadget driver usually will |
@@ -858,6 +862,25 @@ int usb_descriptor_fillbuf(void *, unsigned, | |||
858 | int usb_gadget_config_buf(const struct usb_config_descriptor *config, | 862 | int usb_gadget_config_buf(const struct usb_config_descriptor *config, |
859 | void *buf, unsigned buflen, const struct usb_descriptor_header **desc); | 863 | void *buf, unsigned buflen, const struct usb_descriptor_header **desc); |
860 | 864 | ||
865 | /* copy a NULL-terminated vector of descriptors */ | ||
866 | struct usb_descriptor_header **usb_copy_descriptors( | ||
867 | struct usb_descriptor_header **); | ||
868 | |||
869 | /* return copy of endpoint descriptor given original descriptor set */ | ||
870 | struct usb_endpoint_descriptor *usb_find_endpoint( | ||
871 | struct usb_descriptor_header **src, | ||
872 | struct usb_descriptor_header **copy, | ||
873 | struct usb_endpoint_descriptor *match); | ||
874 | |||
875 | /** | ||
876 | * usb_free_descriptors - free descriptors returned by usb_copy_descriptors() | ||
877 | * @v: vector of descriptors | ||
878 | */ | ||
879 | static inline void usb_free_descriptors(struct usb_descriptor_header **v) | ||
880 | { | ||
881 | kfree(v); | ||
882 | } | ||
883 | |||
861 | /*-------------------------------------------------------------------------*/ | 884 | /*-------------------------------------------------------------------------*/ |
862 | 885 | ||
863 | /* utility wrapping a simple endpoint selection policy */ | 886 | /* utility wrapping a simple endpoint selection policy */ |
diff --git a/include/linux/usb/irda.h b/include/linux/usb/irda.h new file mode 100644 index 000000000000..e345ceaf72d6 --- /dev/null +++ b/include/linux/usb/irda.h | |||
@@ -0,0 +1,151 @@ | |||
1 | /* | ||
2 | * USB IrDA Bridge Device Definition | ||
3 | */ | ||
4 | |||
5 | #ifndef __LINUX_USB_IRDA_H | ||
6 | #define __LINUX_USB_IRDA_H | ||
7 | |||
8 | /* This device should use Application-specific class */ | ||
9 | |||
10 | #define USB_SUBCLASS_IRDA 0x02 | ||
11 | |||
12 | /*-------------------------------------------------------------------------*/ | ||
13 | |||
14 | /* Class-Specific requests (bRequest field) */ | ||
15 | |||
16 | #define USB_REQ_CS_IRDA_RECEIVING 1 | ||
17 | #define USB_REQ_CS_IRDA_CHECK_MEDIA_BUSY 3 | ||
18 | #define USB_REQ_CS_IRDA_RATE_SNIFF 4 | ||
19 | #define USB_REQ_CS_IRDA_UNICAST_LIST 5 | ||
20 | #define USB_REQ_CS_IRDA_GET_CLASS_DESC 6 | ||
21 | |||
22 | /*-------------------------------------------------------------------------*/ | ||
23 | |||
24 | /* Class-Specific descriptor */ | ||
25 | |||
26 | #define USB_DT_CS_IRDA 0x21 | ||
27 | |||
28 | /*-------------------------------------------------------------------------*/ | ||
29 | |||
30 | /* Data sizes */ | ||
31 | |||
32 | #define USB_IRDA_DS_2048 (1 << 5) | ||
33 | #define USB_IRDA_DS_1024 (1 << 4) | ||
34 | #define USB_IRDA_DS_512 (1 << 3) | ||
35 | #define USB_IRDA_DS_256 (1 << 2) | ||
36 | #define USB_IRDA_DS_128 (1 << 1) | ||
37 | #define USB_IRDA_DS_64 (1 << 0) | ||
38 | |||
39 | /* Window sizes */ | ||
40 | |||
41 | #define USB_IRDA_WS_7 (1 << 6) | ||
42 | #define USB_IRDA_WS_6 (1 << 5) | ||
43 | #define USB_IRDA_WS_5 (1 << 4) | ||
44 | #define USB_IRDA_WS_4 (1 << 3) | ||
45 | #define USB_IRDA_WS_3 (1 << 2) | ||
46 | #define USB_IRDA_WS_2 (1 << 1) | ||
47 | #define USB_IRDA_WS_1 (1 << 0) | ||
48 | |||
49 | /* Min turnaround times in usecs */ | ||
50 | |||
51 | #define USB_IRDA_MTT_0 (1 << 7) | ||
52 | #define USB_IRDA_MTT_10 (1 << 6) | ||
53 | #define USB_IRDA_MTT_50 (1 << 5) | ||
54 | #define USB_IRDA_MTT_100 (1 << 4) | ||
55 | #define USB_IRDA_MTT_500 (1 << 3) | ||
56 | #define USB_IRDA_MTT_1000 (1 << 2) | ||
57 | #define USB_IRDA_MTT_5000 (1 << 1) | ||
58 | #define USB_IRDA_MTT_10000 (1 << 0) | ||
59 | |||
60 | /* Baud rates */ | ||
61 | |||
62 | #define USB_IRDA_BR_4000000 (1 << 8) | ||
63 | #define USB_IRDA_BR_1152000 (1 << 7) | ||
64 | #define USB_IRDA_BR_576000 (1 << 6) | ||
65 | #define USB_IRDA_BR_115200 (1 << 5) | ||
66 | #define USB_IRDA_BR_57600 (1 << 4) | ||
67 | #define USB_IRDA_BR_38400 (1 << 3) | ||
68 | #define USB_IRDA_BR_19200 (1 << 2) | ||
69 | #define USB_IRDA_BR_9600 (1 << 1) | ||
70 | #define USB_IRDA_BR_2400 (1 << 0) | ||
71 | |||
72 | /* Additional BOFs */ | ||
73 | |||
74 | #define USB_IRDA_AB_0 (1 << 7) | ||
75 | #define USB_IRDA_AB_1 (1 << 6) | ||
76 | #define USB_IRDA_AB_2 (1 << 5) | ||
77 | #define USB_IRDA_AB_3 (1 << 4) | ||
78 | #define USB_IRDA_AB_6 (1 << 3) | ||
79 | #define USB_IRDA_AB_12 (1 << 2) | ||
80 | #define USB_IRDA_AB_24 (1 << 1) | ||
81 | #define USB_IRDA_AB_48 (1 << 0) | ||
82 | |||
83 | /* IRDA Rate Sniff */ | ||
84 | |||
85 | #define USB_IRDA_RATE_SNIFF 1 | ||
86 | |||
87 | /*-------------------------------------------------------------------------*/ | ||
88 | |||
89 | struct usb_irda_cs_descriptor { | ||
90 | __u8 bLength; | ||
91 | __u8 bDescriptorType; | ||
92 | |||
93 | __le16 bcdSpecRevision; | ||
94 | __u8 bmDataSize; | ||
95 | __u8 bmWindowSize; | ||
96 | __u8 bmMinTurnaroundTime; | ||
97 | __le16 wBaudRate; | ||
98 | __u8 bmAdditionalBOFs; | ||
99 | __u8 bIrdaRateSniff; | ||
100 | __u8 bMaxUnicastList; | ||
101 | } __attribute__ ((packed)); | ||
102 | |||
103 | /*-------------------------------------------------------------------------*/ | ||
104 | |||
105 | /* Data Format */ | ||
106 | |||
107 | #define USB_IRDA_STATUS_MEDIA_BUSY (1 << 7) | ||
108 | |||
109 | /* The following is a 4-bit value used for both | ||
110 | * inbound and outbound headers: | ||
111 | * | ||
112 | * 0 - speed ignored | ||
113 | * 1 - 2400 bps | ||
114 | * 2 - 9600 bps | ||
115 | * 3 - 19200 bps | ||
116 | * 4 - 38400 bps | ||
117 | * 5 - 57600 bps | ||
118 | * 6 - 115200 bps | ||
119 | * 7 - 576000 bps | ||
120 | * 8 - 1.152 Mbps | ||
121 | * 9 - 5 mbps | ||
122 | * 10..15 - Reserved | ||
123 | */ | ||
124 | #define USB_IRDA_STATUS_LINK_SPEED 0x0f | ||
125 | |||
126 | /* The following is a 4-bit value used only for | ||
127 | * outbound header: | ||
128 | * | ||
129 | * 0 - No change (BOF ignored) | ||
130 | * 1 - 48 BOFs | ||
131 | * 2 - 24 BOFs | ||
132 | * 3 - 12 BOFs | ||
133 | * 4 - 6 BOFs | ||
134 | * 5 - 3 BOFs | ||
135 | * 6 - 2 BOFs | ||
136 | * 7 - 1 BOFs | ||
137 | * 8 - 0 BOFs | ||
138 | * 9..15 - Reserved | ||
139 | */ | ||
140 | #define USB_IRDA_EXTRA_BOFS 0xf0 | ||
141 | |||
142 | struct usb_irda_inbound_header { | ||
143 | __u8 bmStatus; | ||
144 | }; | ||
145 | |||
146 | struct usb_irda_outbound_header { | ||
147 | __u8 bmChange; | ||
148 | }; | ||
149 | |||
150 | #endif /* __LINUX_USB_IRDA_H */ | ||
151 | |||
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h index 29d6458ecb8d..0a6e6d4b929a 100644 --- a/include/linux/usb/rndis_host.h +++ b/include/linux/usb/rndis_host.h | |||
@@ -260,7 +260,8 @@ struct rndis_keepalive_c { /* IN (optionally OUT) */ | |||
260 | 260 | ||
261 | 261 | ||
262 | extern void rndis_status(struct usbnet *dev, struct urb *urb); | 262 | extern void rndis_status(struct usbnet *dev, struct urb *urb); |
263 | extern int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf); | 263 | extern int |
264 | rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen); | ||
264 | extern int | 265 | extern int |
265 | generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags); | 266 | generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags); |
266 | extern void rndis_unbind(struct usbnet *dev, struct usb_interface *intf); | 267 | extern void rndis_unbind(struct usbnet *dev, struct usb_interface *intf); |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 8f891cbaf9ab..09a3e6a7518f 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -62,7 +62,7 @@ | |||
62 | */ | 62 | */ |
63 | struct usb_serial_port { | 63 | struct usb_serial_port { |
64 | struct usb_serial *serial; | 64 | struct usb_serial *serial; |
65 | struct tty_struct *tty; | 65 | struct tty_port port; |
66 | spinlock_t lock; | 66 | spinlock_t lock; |
67 | struct mutex mutex; | 67 | struct mutex mutex; |
68 | unsigned char number; | 68 | unsigned char number; |
@@ -89,7 +89,6 @@ struct usb_serial_port { | |||
89 | 89 | ||
90 | wait_queue_head_t write_wait; | 90 | wait_queue_head_t write_wait; |
91 | struct work_struct work; | 91 | struct work_struct work; |
92 | int open_count; | ||
93 | char throttled; | 92 | char throttled; |
94 | char throttle_req; | 93 | char throttle_req; |
95 | char console; | 94 | char console; |
@@ -217,22 +216,27 @@ struct usb_serial_driver { | |||
217 | int (*resume)(struct usb_serial *serial); | 216 | int (*resume)(struct usb_serial *serial); |
218 | 217 | ||
219 | /* serial function calls */ | 218 | /* serial function calls */ |
220 | int (*open)(struct usb_serial_port *port, struct file *filp); | 219 | /* Called by console with tty = NULL and by tty */ |
221 | void (*close)(struct usb_serial_port *port, struct file *filp); | 220 | int (*open)(struct tty_struct *tty, |
222 | int (*write)(struct usb_serial_port *port, const unsigned char *buf, | 221 | struct usb_serial_port *port, struct file *filp); |
223 | int count); | 222 | void (*close)(struct tty_struct *tty, |
224 | int (*write_room)(struct usb_serial_port *port); | 223 | struct usb_serial_port *port, struct file *filp); |
225 | int (*ioctl)(struct usb_serial_port *port, struct file *file, | 224 | int (*write)(struct tty_struct *tty, struct usb_serial_port *port, |
225 | const unsigned char *buf, int count); | ||
226 | /* Called only by the tty layer */ | ||
227 | int (*write_room)(struct tty_struct *tty); | ||
228 | int (*ioctl)(struct tty_struct *tty, struct file *file, | ||
226 | unsigned int cmd, unsigned long arg); | 229 | unsigned int cmd, unsigned long arg); |
227 | void (*set_termios)(struct usb_serial_port *port, struct ktermios *old); | 230 | void (*set_termios)(struct tty_struct *tty, |
228 | void (*break_ctl)(struct usb_serial_port *port, int break_state); | 231 | struct usb_serial_port *port, struct ktermios *old); |
229 | int (*chars_in_buffer)(struct usb_serial_port *port); | 232 | void (*break_ctl)(struct tty_struct *tty, int break_state); |
230 | void (*throttle)(struct usb_serial_port *port); | 233 | int (*chars_in_buffer)(struct tty_struct *tty); |
231 | void (*unthrottle)(struct usb_serial_port *port); | 234 | void (*throttle)(struct tty_struct *tty); |
232 | int (*tiocmget)(struct usb_serial_port *port, struct file *file); | 235 | void (*unthrottle)(struct tty_struct *tty); |
233 | int (*tiocmset)(struct usb_serial_port *port, struct file *file, | 236 | int (*tiocmget)(struct tty_struct *tty, struct file *file); |
237 | int (*tiocmset)(struct tty_struct *tty, struct file *file, | ||
234 | unsigned int set, unsigned int clear); | 238 | unsigned int set, unsigned int clear); |
235 | 239 | /* USB events */ | |
236 | void (*read_int_callback)(struct urb *urb); | 240 | void (*read_int_callback)(struct urb *urb); |
237 | void (*write_int_callback)(struct urb *urb); | 241 | void (*write_int_callback)(struct urb *urb); |
238 | void (*read_bulk_callback)(struct urb *urb); | 242 | void (*read_bulk_callback)(struct urb *urb); |
@@ -270,19 +274,19 @@ static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} | |||
270 | /* Functions needed by other parts of the usbserial core */ | 274 | /* Functions needed by other parts of the usbserial core */ |
271 | extern struct usb_serial *usb_serial_get_by_index(unsigned int minor); | 275 | extern struct usb_serial *usb_serial_get_by_index(unsigned int minor); |
272 | extern void usb_serial_put(struct usb_serial *serial); | 276 | extern void usb_serial_put(struct usb_serial *serial); |
273 | extern int usb_serial_generic_open(struct usb_serial_port *port, | 277 | extern int usb_serial_generic_open(struct tty_struct *tty, |
274 | struct file *filp); | 278 | struct usb_serial_port *port, struct file *filp); |
275 | extern int usb_serial_generic_write(struct usb_serial_port *port, | 279 | extern int usb_serial_generic_write(struct tty_struct *tty, |
276 | const unsigned char *buf, int count); | 280 | struct usb_serial_port *port, const unsigned char *buf, int count); |
277 | extern void usb_serial_generic_close(struct usb_serial_port *port, | 281 | extern void usb_serial_generic_close(struct tty_struct *tty, |
278 | struct file *filp); | 282 | struct usb_serial_port *port, struct file *filp); |
279 | extern int usb_serial_generic_resume(struct usb_serial *serial); | 283 | extern int usb_serial_generic_resume(struct usb_serial *serial); |
280 | extern int usb_serial_generic_write_room(struct usb_serial_port *port); | 284 | extern int usb_serial_generic_write_room(struct tty_struct *tty); |
281 | extern int usb_serial_generic_chars_in_buffer(struct usb_serial_port *port); | 285 | extern int usb_serial_generic_chars_in_buffer(struct tty_struct *tty); |
282 | extern void usb_serial_generic_read_bulk_callback(struct urb *urb); | 286 | extern void usb_serial_generic_read_bulk_callback(struct urb *urb); |
283 | extern void usb_serial_generic_write_bulk_callback(struct urb *urb); | 287 | extern void usb_serial_generic_write_bulk_callback(struct urb *urb); |
284 | extern void usb_serial_generic_throttle(struct usb_serial_port *port); | 288 | extern void usb_serial_generic_throttle(struct tty_struct *tty); |
285 | extern void usb_serial_generic_unthrottle(struct usb_serial_port *port); | 289 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); |
286 | extern void usb_serial_generic_shutdown(struct usb_serial *serial); | 290 | extern void usb_serial_generic_shutdown(struct usb_serial *serial); |
287 | extern int usb_serial_generic_register(int debug); | 291 | extern int usb_serial_generic_register(int debug); |
288 | extern void usb_serial_generic_deregister(void); | 292 | extern void usb_serial_generic_deregister(void); |
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 3118ede2c67b..0044d9b4cb85 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
@@ -22,8 +22,6 @@ | |||
22 | * | 22 | * |
23 | * History: | 23 | * History: |
24 | * 0.1 04.01.2000 Created | 24 | * 0.1 04.01.2000 Created |
25 | * | ||
26 | * $Id: usbdevice_fs.h,v 1.1 2000/01/06 18:40:41 tom Exp $ | ||
27 | */ | 25 | */ |
28 | 26 | ||
29 | /*****************************************************************************/ | 27 | /*****************************************************************************/ |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 4a535ea1e123..2e66a95e8d32 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -246,6 +246,7 @@ struct v4l2_capability | |||
246 | #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ | 246 | #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ |
247 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ | 247 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ |
248 | #define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */ | 248 | #define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */ |
249 | #define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */ | ||
249 | 250 | ||
250 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ | 251 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ |
251 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ | 252 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ |
@@ -309,6 +310,7 @@ struct v4l2_pix_format | |||
309 | 310 | ||
310 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ | 311 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ |
311 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ | 312 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ |
313 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G','B','R','G') /* 8 GBGB.. RGRG.. */ | ||
312 | #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B','Y','R','2') /* 16 BGBG.. GRGR.. */ | 314 | #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B','Y','R','2') /* 16 BGBG.. GRGR.. */ |
313 | 315 | ||
314 | /* compressed formats */ | 316 | /* compressed formats */ |
@@ -323,6 +325,9 @@ struct v4l2_pix_format | |||
323 | #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */ | 325 | #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */ |
324 | #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */ | 326 | #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */ |
325 | #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */ | 327 | #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */ |
328 | #define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S','5','0','1') /* YUYV per line */ | ||
329 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S','5','6','1') /* compressed GBRG bayer */ | ||
330 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P','2','0','7') /* compressed BGGR bayer */ | ||
326 | 331 | ||
327 | /* | 332 | /* |
328 | * F O R M A T E N U M E R A T I O N | 333 | * F O R M A T E N U M E R A T I O N |
@@ -1156,6 +1161,14 @@ struct v4l2_frequency | |||
1156 | __u32 reserved[8]; | 1161 | __u32 reserved[8]; |
1157 | }; | 1162 | }; |
1158 | 1163 | ||
1164 | struct v4l2_hw_freq_seek { | ||
1165 | __u32 tuner; | ||
1166 | enum v4l2_tuner_type type; | ||
1167 | __u32 seek_upward; | ||
1168 | __u32 wrap_around; | ||
1169 | __u32 reserved[8]; | ||
1170 | }; | ||
1171 | |||
1159 | /* | 1172 | /* |
1160 | * A U D I O | 1173 | * A U D I O |
1161 | */ | 1174 | */ |
@@ -1441,6 +1454,7 @@ struct v4l2_chip_ident { | |||
1441 | 1454 | ||
1442 | #define VIDIOC_G_CHIP_IDENT _IOWR ('V', 81, struct v4l2_chip_ident) | 1455 | #define VIDIOC_G_CHIP_IDENT _IOWR ('V', 81, struct v4l2_chip_ident) |
1443 | #endif | 1456 | #endif |
1457 | #define VIDIOC_S_HW_FREQ_SEEK _IOW ('V', 82, struct v4l2_hw_freq_seek) | ||
1444 | 1458 | ||
1445 | #ifdef __OLD_VIDIOC_ | 1459 | #ifdef __OLD_VIDIOC_ |
1446 | /* for compatibility, will go away some day */ | 1460 | /* for compatibility, will go away some day */ |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index e83b69346d23..58334d439516 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -44,6 +44,12 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
44 | NR_VM_EVENT_ITEMS | 44 | NR_VM_EVENT_ITEMS |
45 | }; | 45 | }; |
46 | 46 | ||
47 | extern const struct seq_operations fragmentation_op; | ||
48 | extern const struct seq_operations pagetypeinfo_op; | ||
49 | extern const struct seq_operations zoneinfo_op; | ||
50 | extern const struct seq_operations vmstat_op; | ||
51 | extern int sysctl_stat_interval; | ||
52 | |||
47 | #ifdef CONFIG_VM_EVENT_COUNTERS | 53 | #ifdef CONFIG_VM_EVENT_COUNTERS |
48 | /* | 54 | /* |
49 | * Light weight per cpu counter implementation. | 55 | * Light weight per cpu counter implementation. |
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h index 3add87465b1f..e0aa39612eba 100644 --- a/include/linux/wanrouter.h +++ b/include/linux/wanrouter.h | |||
@@ -522,7 +522,7 @@ extern int wanrouter_proc_init(void); | |||
522 | extern void wanrouter_proc_cleanup(void); | 522 | extern void wanrouter_proc_cleanup(void); |
523 | extern int wanrouter_proc_add(struct wan_device *wandev); | 523 | extern int wanrouter_proc_add(struct wan_device *wandev); |
524 | extern int wanrouter_proc_delete(struct wan_device *wandev); | 524 | extern int wanrouter_proc_delete(struct wan_device *wandev); |
525 | extern int wanrouter_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); | 525 | extern long wanrouter_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
526 | 526 | ||
527 | /* Public Data */ | 527 | /* Public Data */ |
528 | /* list of registered devices */ | 528 | /* list of registered devices */ |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index 0a9b5b41ed67..d7958f9b52cb 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -611,6 +611,7 @@ | |||
611 | #define IW_ENCODE_ALG_WEP 1 | 611 | #define IW_ENCODE_ALG_WEP 1 |
612 | #define IW_ENCODE_ALG_TKIP 2 | 612 | #define IW_ENCODE_ALG_TKIP 2 |
613 | #define IW_ENCODE_ALG_CCMP 3 | 613 | #define IW_ENCODE_ALG_CCMP 3 |
614 | #define IW_ENCODE_ALG_PMK 4 | ||
614 | /* struct iw_encode_ext ->ext_flags */ | 615 | /* struct iw_encode_ext ->ext_flags */ |
615 | #define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001 | 616 | #define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001 |
616 | #define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002 | 617 | #define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002 |
@@ -630,6 +631,7 @@ | |||
630 | #define IW_ENC_CAPA_WPA2 0x00000002 | 631 | #define IW_ENC_CAPA_WPA2 0x00000002 |
631 | #define IW_ENC_CAPA_CIPHER_TKIP 0x00000004 | 632 | #define IW_ENC_CAPA_CIPHER_TKIP 0x00000004 |
632 | #define IW_ENC_CAPA_CIPHER_CCMP 0x00000008 | 633 | #define IW_ENC_CAPA_CIPHER_CCMP 0x00000008 |
634 | #define IW_ENC_CAPA_4WAY_HANDSHAKE 0x00000010 | ||
633 | 635 | ||
634 | /* Event capability macros - in (struct iw_range *)->event_capa | 636 | /* Event capability macros - in (struct iw_range *)->event_capa |
635 | * Because we have more than 32 possible events, we use an array of | 637 | * Because we have more than 32 possible events, we use an array of |
@@ -675,6 +677,19 @@ struct iw_point | |||
675 | __u16 flags; /* Optional params */ | 677 | __u16 flags; /* Optional params */ |
676 | }; | 678 | }; |
677 | 679 | ||
680 | #ifdef __KERNEL__ | ||
681 | #ifdef CONFIG_COMPAT | ||
682 | |||
683 | #include <linux/compat.h> | ||
684 | |||
685 | struct compat_iw_point { | ||
686 | compat_caddr_t pointer; | ||
687 | __u16 length; | ||
688 | __u16 flags; | ||
689 | }; | ||
690 | #endif | ||
691 | #endif | ||
692 | |||
678 | /* | 693 | /* |
679 | * A frequency | 694 | * A frequency |
680 | * For numbers lower than 10^9, we encode the number in 'm' and | 695 | * For numbers lower than 10^9, we encode the number in 'm' and |
@@ -1098,6 +1113,21 @@ struct iw_event | |||
1098 | #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ | 1113 | #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ |
1099 | IW_EV_POINT_OFF) | 1114 | IW_EV_POINT_OFF) |
1100 | 1115 | ||
1116 | #ifdef __KERNEL__ | ||
1117 | #ifdef CONFIG_COMPAT | ||
1118 | struct __compat_iw_event { | ||
1119 | __u16 len; /* Real length of this stuff */ | ||
1120 | __u16 cmd; /* Wireless IOCTL */ | ||
1121 | compat_caddr_t pointer; | ||
1122 | }; | ||
1123 | #define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer) | ||
1124 | #define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length) | ||
1125 | #define IW_EV_COMPAT_POINT_LEN \ | ||
1126 | (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \ | ||
1127 | IW_EV_COMPAT_POINT_OFF) | ||
1128 | #endif | ||
1129 | #endif | ||
1130 | |||
1101 | /* Size of the Event prefix when packed in stream */ | 1131 | /* Size of the Event prefix when packed in stream */ |
1102 | #define IW_EV_LCP_PK_LEN (4) | 1132 | #define IW_EV_LCP_PK_LEN (4) |
1103 | /* Size of the various events when packed in stream */ | 1133 | /* Size of the various events when packed in stream */ |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 542526c6e8ef..14d47120682b 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -179,6 +179,8 @@ __create_workqueue_key(const char *name, int singlethread, | |||
179 | extern void destroy_workqueue(struct workqueue_struct *wq); | 179 | extern void destroy_workqueue(struct workqueue_struct *wq); |
180 | 180 | ||
181 | extern int queue_work(struct workqueue_struct *wq, struct work_struct *work); | 181 | extern int queue_work(struct workqueue_struct *wq, struct work_struct *work); |
182 | extern int queue_work_on(int cpu, struct workqueue_struct *wq, | ||
183 | struct work_struct *work); | ||
182 | extern int queue_delayed_work(struct workqueue_struct *wq, | 184 | extern int queue_delayed_work(struct workqueue_struct *wq, |
183 | struct delayed_work *work, unsigned long delay); | 185 | struct delayed_work *work, unsigned long delay); |
184 | extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | 186 | extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, |
@@ -188,6 +190,7 @@ extern void flush_workqueue(struct workqueue_struct *wq); | |||
188 | extern void flush_scheduled_work(void); | 190 | extern void flush_scheduled_work(void); |
189 | 191 | ||
190 | extern int schedule_work(struct work_struct *work); | 192 | extern int schedule_work(struct work_struct *work); |
193 | extern int schedule_work_on(int cpu, struct work_struct *work); | ||
191 | extern int schedule_delayed_work(struct delayed_work *work, unsigned long delay); | 194 | extern int schedule_delayed_work(struct delayed_work *work, unsigned long delay); |
192 | extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, | 195 | extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, |
193 | unsigned long delay); | 196 | unsigned long delay); |