diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-17 21:16:55 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-17 21:16:55 -0400 |
commit | 4b337c5f245b6587ba844ac7bb13c313a2912f7b (patch) | |
tree | 999c6a6580b76a083c8efb9dabff709d1c49fcd0 /include/linux | |
parent | 492b057c426e4aa747484958e18e9da29003985d (diff) | |
parent | 3fe0344faf7fdcb158bd5c1a9aec960a8d70c8e8 (diff) |
Merge commit 'origin/master' into next
Diffstat (limited to 'include/linux')
67 files changed, 2119 insertions, 303 deletions
diff --git a/include/linux/adfs_fs.h b/include/linux/adfs_fs.h index ef788c2085a1..b19801f73890 100644 --- a/include/linux/adfs_fs.h +++ b/include/linux/adfs_fs.h | |||
@@ -41,8 +41,6 @@ struct adfs_discrecord { | |||
41 | #define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3) | 41 | #define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3) |
42 | 42 | ||
43 | #ifdef __KERNEL__ | 43 | #ifdef __KERNEL__ |
44 | #include <linux/adfs_fs_i.h> | ||
45 | #include <linux/adfs_fs_sb.h> | ||
46 | /* | 44 | /* |
47 | * Calculate the boot block checksum on an ADFS drive. Note that this will | 45 | * Calculate the boot block checksum on an ADFS drive. Note that this will |
48 | * appear to be correct if the sector contains all zeros, so also check that | 46 | * appear to be correct if the sector contains all zeros, so also check that |
@@ -60,17 +58,6 @@ static inline int adfs_checkbblk(unsigned char *ptr) | |||
60 | 58 | ||
61 | return (result & 0xff) != ptr[511]; | 59 | return (result & 0xff) != ptr[511]; |
62 | } | 60 | } |
63 | |||
64 | static inline struct adfs_sb_info *ADFS_SB(struct super_block *sb) | ||
65 | { | ||
66 | return sb->s_fs_info; | ||
67 | } | ||
68 | |||
69 | static inline struct adfs_inode_info *ADFS_I(struct inode *inode) | ||
70 | { | ||
71 | return container_of(inode, struct adfs_inode_info, vfs_inode); | ||
72 | } | ||
73 | |||
74 | #endif | 61 | #endif |
75 | 62 | ||
76 | #endif | 63 | #endif |
diff --git a/include/linux/adfs_fs_i.h b/include/linux/adfs_fs_i.h deleted file mode 100644 index cb543034e54f..000000000000 --- a/include/linux/adfs_fs_i.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/linux/adfs_fs_i.h | ||
3 | * | ||
4 | * Copyright (C) 1997 Russell King | ||
5 | */ | ||
6 | |||
7 | #ifndef _ADFS_FS_I | ||
8 | #define _ADFS_FS_I | ||
9 | |||
10 | /* | ||
11 | * adfs file system inode data in memory | ||
12 | */ | ||
13 | struct adfs_inode_info { | ||
14 | loff_t mmu_private; | ||
15 | unsigned long parent_id; /* object id of parent */ | ||
16 | __u32 loadaddr; /* RISC OS load address */ | ||
17 | __u32 execaddr; /* RISC OS exec address */ | ||
18 | unsigned int filetype; /* RISC OS file type */ | ||
19 | unsigned int attr; /* RISC OS permissions */ | ||
20 | unsigned int stamped:1; /* RISC OS file has date/time */ | ||
21 | struct inode vfs_inode; | ||
22 | }; | ||
23 | |||
24 | #endif | ||
diff --git a/include/linux/adfs_fs_sb.h b/include/linux/adfs_fs_sb.h deleted file mode 100644 index d9bf05c02ccc..000000000000 --- a/include/linux/adfs_fs_sb.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/linux/adfs_fs_sb.h | ||
3 | * | ||
4 | * Copyright (C) 1997-1999 Russell King | ||
5 | */ | ||
6 | |||
7 | #ifndef _ADFS_FS_SB | ||
8 | #define _ADFS_FS_SB | ||
9 | |||
10 | /* | ||
11 | * Forward-declare this | ||
12 | */ | ||
13 | struct adfs_discmap; | ||
14 | struct adfs_dir_ops; | ||
15 | |||
16 | /* | ||
17 | * ADFS file system superblock data in memory | ||
18 | */ | ||
19 | struct adfs_sb_info { | ||
20 | struct adfs_discmap *s_map; /* bh list containing map */ | ||
21 | struct adfs_dir_ops *s_dir; /* directory operations */ | ||
22 | |||
23 | uid_t s_uid; /* owner uid */ | ||
24 | gid_t s_gid; /* owner gid */ | ||
25 | umode_t s_owner_mask; /* ADFS owner perm -> unix perm */ | ||
26 | umode_t s_other_mask; /* ADFS other perm -> unix perm */ | ||
27 | |||
28 | __u32 s_ids_per_zone; /* max. no ids in one zone */ | ||
29 | __u32 s_idlen; /* length of ID in map */ | ||
30 | __u32 s_map_size; /* sector size of a map */ | ||
31 | unsigned long s_size; /* total size (in blocks) of this fs */ | ||
32 | signed int s_map2blk; /* shift left by this for map->sector */ | ||
33 | unsigned int s_log2sharesize;/* log2 share size */ | ||
34 | __le32 s_version; /* disc format version */ | ||
35 | unsigned int s_namelen; /* maximum number of characters in name */ | ||
36 | }; | ||
37 | |||
38 | #endif | ||
diff --git a/include/linux/bug.h b/include/linux/bug.h index 54398d2c6d8d..d276b5510c83 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_BUG_H | 1 | #ifndef _LINUX_BUG_H |
2 | #define _LINUX_BUG_H | 2 | #define _LINUX_BUG_H |
3 | 3 | ||
4 | #include <linux/module.h> | ||
5 | #include <asm/bug.h> | 4 | #include <asm/bug.h> |
6 | 5 | ||
7 | enum bug_trap_type { | 6 | enum bug_trap_type { |
@@ -24,10 +23,6 @@ const struct bug_entry *find_bug(unsigned long bugaddr); | |||
24 | 23 | ||
25 | enum bug_trap_type report_bug(unsigned long bug_addr, struct pt_regs *regs); | 24 | enum bug_trap_type report_bug(unsigned long bug_addr, struct pt_regs *regs); |
26 | 25 | ||
27 | int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, | ||
28 | struct module *); | ||
29 | void module_bug_cleanup(struct module *); | ||
30 | |||
31 | /* These are defined by the architecture */ | 26 | /* These are defined by the architecture */ |
32 | int is_valid_bugaddr(unsigned long addr); | 27 | int is_valid_bugaddr(unsigned long addr); |
33 | 28 | ||
@@ -38,13 +33,6 @@ static inline enum bug_trap_type report_bug(unsigned long bug_addr, | |||
38 | { | 33 | { |
39 | return BUG_TRAP_TYPE_BUG; | 34 | return BUG_TRAP_TYPE_BUG; |
40 | } | 35 | } |
41 | static inline int module_bug_finalize(const Elf_Ehdr *hdr, | ||
42 | const Elf_Shdr *sechdrs, | ||
43 | struct module *mod) | ||
44 | { | ||
45 | return 0; | ||
46 | } | ||
47 | static inline void module_bug_cleanup(struct module *mod) {} | ||
48 | 36 | ||
49 | #endif /* CONFIG_GENERIC_BUG */ | 37 | #endif /* CONFIG_GENERIC_BUG */ |
50 | #endif /* _LINUX_BUG_H */ | 38 | #endif /* _LINUX_BUG_H */ |
diff --git a/include/linux/c2port.h b/include/linux/c2port.h index 7b5a2388ba67..2a5cd867c365 100644 --- a/include/linux/c2port.h +++ b/include/linux/c2port.h | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/device.h> | 12 | #include <linux/device.h> |
13 | #include <linux/kmemcheck.h> | ||
13 | 14 | ||
14 | #define C2PORT_NAME_LEN 32 | 15 | #define C2PORT_NAME_LEN 32 |
15 | 16 | ||
@@ -20,8 +21,10 @@ | |||
20 | /* Main struct */ | 21 | /* Main struct */ |
21 | struct c2port_ops; | 22 | struct c2port_ops; |
22 | struct c2port_device { | 23 | struct c2port_device { |
24 | kmemcheck_bitfield_begin(flags); | ||
23 | unsigned int access:1; | 25 | unsigned int access:1; |
24 | unsigned int flash_access:1; | 26 | unsigned int flash_access:1; |
27 | kmemcheck_bitfield_end(flags); | ||
25 | 28 | ||
26 | int id; | 29 | int id; |
27 | char name[C2PORT_NAME_LEN]; | 30 | char name[C2PORT_NAME_LEN]; |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 05ea1dd7d681..a5740fc4d04b 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -18,7 +18,6 @@ | |||
18 | 18 | ||
19 | extern int number_of_cpusets; /* How many cpusets are defined in system? */ | 19 | extern int number_of_cpusets; /* How many cpusets are defined in system? */ |
20 | 20 | ||
21 | extern int cpuset_init_early(void); | ||
22 | extern int cpuset_init(void); | 21 | extern int cpuset_init(void); |
23 | extern void cpuset_init_smp(void); | 22 | extern void cpuset_init_smp(void); |
24 | extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); | 23 | extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); |
@@ -27,7 +26,6 @@ extern void cpuset_cpus_allowed_locked(struct task_struct *p, | |||
27 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); | 26 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); |
28 | #define cpuset_current_mems_allowed (current->mems_allowed) | 27 | #define cpuset_current_mems_allowed (current->mems_allowed) |
29 | void cpuset_init_current_mems_allowed(void); | 28 | void cpuset_init_current_mems_allowed(void); |
30 | void cpuset_update_task_memory_state(void); | ||
31 | int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask); | 29 | int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask); |
32 | 30 | ||
33 | extern int __cpuset_node_allowed_softwall(int node, gfp_t gfp_mask); | 31 | extern int __cpuset_node_allowed_softwall(int node, gfp_t gfp_mask); |
@@ -92,9 +90,13 @@ extern void rebuild_sched_domains(void); | |||
92 | 90 | ||
93 | extern void cpuset_print_task_mems_allowed(struct task_struct *p); | 91 | extern void cpuset_print_task_mems_allowed(struct task_struct *p); |
94 | 92 | ||
93 | static inline void set_mems_allowed(nodemask_t nodemask) | ||
94 | { | ||
95 | current->mems_allowed = nodemask; | ||
96 | } | ||
97 | |||
95 | #else /* !CONFIG_CPUSETS */ | 98 | #else /* !CONFIG_CPUSETS */ |
96 | 99 | ||
97 | static inline int cpuset_init_early(void) { return 0; } | ||
98 | static inline int cpuset_init(void) { return 0; } | 100 | static inline int cpuset_init(void) { return 0; } |
99 | static inline void cpuset_init_smp(void) {} | 101 | static inline void cpuset_init_smp(void) {} |
100 | 102 | ||
@@ -116,7 +118,6 @@ static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) | |||
116 | 118 | ||
117 | #define cpuset_current_mems_allowed (node_states[N_HIGH_MEMORY]) | 119 | #define cpuset_current_mems_allowed (node_states[N_HIGH_MEMORY]) |
118 | static inline void cpuset_init_current_mems_allowed(void) {} | 120 | static inline void cpuset_init_current_mems_allowed(void) {} |
119 | static inline void cpuset_update_task_memory_state(void) {} | ||
120 | 121 | ||
121 | static inline int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask) | 122 | static inline int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask) |
122 | { | 123 | { |
@@ -188,6 +189,10 @@ static inline void cpuset_print_task_mems_allowed(struct task_struct *p) | |||
188 | { | 189 | { |
189 | } | 190 | } |
190 | 191 | ||
192 | static inline void set_mems_allowed(nodemask_t nodemask) | ||
193 | { | ||
194 | } | ||
195 | |||
191 | #endif /* !CONFIG_CPUSETS */ | 196 | #endif /* !CONFIG_CPUSETS */ |
192 | 197 | ||
193 | #endif /* _LINUX_CPUSET_H */ | 198 | #endif /* _LINUX_CPUSET_H */ |
diff --git a/include/linux/device.h b/include/linux/device.h index a4a7b10aaa48..ed4e39f2c423 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -114,6 +114,8 @@ extern int bus_unregister_notifier(struct bus_type *bus, | |||
114 | #define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */ | 114 | #define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */ |
115 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be | 115 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be |
116 | unbound */ | 116 | unbound */ |
117 | #define BUS_NOTIFY_UNBOUND_DRIVER 0x00000005 /* driver is unbound | ||
118 | from the device */ | ||
117 | 119 | ||
118 | extern struct kset *bus_get_kset(struct bus_type *bus); | 120 | extern struct kset *bus_get_kset(struct bus_type *bus); |
119 | extern struct klist *bus_get_device_klist(struct bus_type *bus); | 121 | extern struct klist *bus_get_device_klist(struct bus_type *bus); |
@@ -192,6 +194,7 @@ struct class { | |||
192 | struct kobject *dev_kobj; | 194 | struct kobject *dev_kobj; |
193 | 195 | ||
194 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); | 196 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); |
197 | char *(*nodename)(struct device *dev); | ||
195 | 198 | ||
196 | void (*class_release)(struct class *class); | 199 | void (*class_release)(struct class *class); |
197 | void (*dev_release)(struct device *dev); | 200 | void (*dev_release)(struct device *dev); |
@@ -287,6 +290,7 @@ struct device_type { | |||
287 | const char *name; | 290 | const char *name; |
288 | struct attribute_group **groups; | 291 | struct attribute_group **groups; |
289 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); | 292 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); |
293 | char *(*nodename)(struct device *dev); | ||
290 | void (*release)(struct device *dev); | 294 | void (*release)(struct device *dev); |
291 | 295 | ||
292 | struct dev_pm_ops *pm; | 296 | struct dev_pm_ops *pm; |
@@ -486,6 +490,7 @@ extern struct device *device_find_child(struct device *dev, void *data, | |||
486 | extern int device_rename(struct device *dev, char *new_name); | 490 | extern int device_rename(struct device *dev, char *new_name); |
487 | extern int device_move(struct device *dev, struct device *new_parent, | 491 | extern int device_move(struct device *dev, struct device *new_parent, |
488 | enum dpm_order dpm_order); | 492 | enum dpm_order dpm_order); |
493 | extern const char *device_get_nodename(struct device *dev, const char **tmp); | ||
489 | 494 | ||
490 | /* | 495 | /* |
491 | * Root device objects for grouping under /sys/devices | 496 | * Root device objects for grouping under /sys/devices |
diff --git a/include/linux/eisa.h b/include/linux/eisa.h index e61c0be2a459..6925249a5ac6 100644 --- a/include/linux/eisa.h +++ b/include/linux/eisa.h | |||
@@ -78,12 +78,12 @@ static inline void eisa_driver_unregister (struct eisa_driver *edrv) { } | |||
78 | /* Mimics pci.h... */ | 78 | /* Mimics pci.h... */ |
79 | static inline void *eisa_get_drvdata (struct eisa_device *edev) | 79 | static inline void *eisa_get_drvdata (struct eisa_device *edev) |
80 | { | 80 | { |
81 | return edev->dev.driver_data; | 81 | return dev_get_drvdata(&edev->dev); |
82 | } | 82 | } |
83 | 83 | ||
84 | static inline void eisa_set_drvdata (struct eisa_device *edev, void *data) | 84 | static inline void eisa_set_drvdata (struct eisa_device *edev, void *data) |
85 | { | 85 | { |
86 | edev->dev.driver_data = data; | 86 | dev_set_drvdata(&edev->dev, data); |
87 | } | 87 | } |
88 | 88 | ||
89 | /* The EISA root device. There's rumours about machines with multiple | 89 | /* The EISA root device. There's rumours about machines with multiple |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 330c4b1bfcaa..dd68358996b7 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -677,6 +677,9 @@ struct fb_ops { | |||
677 | /* get capability given var */ | 677 | /* get capability given var */ |
678 | void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps, | 678 | void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps, |
679 | struct fb_var_screeninfo *var); | 679 | struct fb_var_screeninfo *var); |
680 | |||
681 | /* teardown any resources to do with this framebuffer */ | ||
682 | void (*fb_destroy)(struct fb_info *info); | ||
680 | }; | 683 | }; |
681 | 684 | ||
682 | #ifdef CONFIG_FB_TILEBLITTING | 685 | #ifdef CONFIG_FB_TILEBLITTING |
@@ -786,6 +789,8 @@ struct fb_tile_ops { | |||
786 | #define FBINFO_MISC_USEREVENT 0x10000 /* event request | 789 | #define FBINFO_MISC_USEREVENT 0x10000 /* event request |
787 | from userspace */ | 790 | from userspace */ |
788 | #define FBINFO_MISC_TILEBLITTING 0x20000 /* use tile blitting */ | 791 | #define FBINFO_MISC_TILEBLITTING 0x20000 /* use tile blitting */ |
792 | #define FBINFO_MISC_FIRMWARE 0x40000 /* a replaceable firmware | ||
793 | inited framebuffer */ | ||
789 | 794 | ||
790 | /* A driver may set this flag to indicate that it does want a set_par to be | 795 | /* A driver may set this flag to indicate that it does want a set_par to be |
791 | * called every time when fbcon_switch is executed. The advantage is that with | 796 | * called every time when fbcon_switch is executed. The advantage is that with |
@@ -854,7 +859,12 @@ struct fb_info { | |||
854 | u32 state; /* Hardware state i.e suspend */ | 859 | u32 state; /* Hardware state i.e suspend */ |
855 | void *fbcon_par; /* fbcon use-only private area */ | 860 | void *fbcon_par; /* fbcon use-only private area */ |
856 | /* From here on everything is device dependent */ | 861 | /* From here on everything is device dependent */ |
857 | void *par; | 862 | void *par; |
863 | /* we need the PCI or similiar aperture base/size not | ||
864 | smem_start/size as smem_start may just be an object | ||
865 | allocated inside the aperture so may not actually overlap */ | ||
866 | resource_size_t aperture_base; | ||
867 | resource_size_t aperture_size; | ||
858 | }; | 868 | }; |
859 | 869 | ||
860 | #ifdef MODULE | 870 | #ifdef MODULE |
@@ -893,7 +903,7 @@ struct fb_info { | |||
893 | #define fb_writeq sbus_writeq | 903 | #define fb_writeq sbus_writeq |
894 | #define fb_memset sbus_memset_io | 904 | #define fb_memset sbus_memset_io |
895 | 905 | ||
896 | #elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) | 906 | #elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) || defined(__bfin__) |
897 | 907 | ||
898 | #define fb_readb __raw_readb | 908 | #define fb_readb __raw_readb |
899 | #define fb_readw __raw_readw | 909 | #define fb_readw __raw_readw |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h new file mode 100644 index 000000000000..e584b7215e8b --- /dev/null +++ b/include/linux/firewire.h | |||
@@ -0,0 +1,358 @@ | |||
1 | #ifndef _LINUX_FIREWIRE_H | ||
2 | #define _LINUX_FIREWIRE_H | ||
3 | |||
4 | #include <linux/completion.h> | ||
5 | #include <linux/device.h> | ||
6 | #include <linux/kernel.h> | ||
7 | #include <linux/kref.h> | ||
8 | #include <linux/list.h> | ||
9 | #include <linux/mutex.h> | ||
10 | #include <linux/spinlock.h> | ||
11 | #include <linux/sysfs.h> | ||
12 | #include <linux/timer.h> | ||
13 | #include <linux/types.h> | ||
14 | #include <linux/workqueue.h> | ||
15 | |||
16 | #include <asm/atomic.h> | ||
17 | #include <asm/byteorder.h> | ||
18 | |||
19 | #define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) | ||
20 | #define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args) | ||
21 | |||
22 | static inline void fw_memcpy_from_be32(void *_dst, void *_src, size_t size) | ||
23 | { | ||
24 | u32 *dst = _dst; | ||
25 | __be32 *src = _src; | ||
26 | int i; | ||
27 | |||
28 | for (i = 0; i < size / 4; i++) | ||
29 | dst[i] = be32_to_cpu(src[i]); | ||
30 | } | ||
31 | |||
32 | static inline void fw_memcpy_to_be32(void *_dst, void *_src, size_t size) | ||
33 | { | ||
34 | fw_memcpy_from_be32(_dst, _src, size); | ||
35 | } | ||
36 | #define CSR_REGISTER_BASE 0xfffff0000000ULL | ||
37 | |||
38 | /* register offsets are relative to CSR_REGISTER_BASE */ | ||
39 | #define CSR_STATE_CLEAR 0x0 | ||
40 | #define CSR_STATE_SET 0x4 | ||
41 | #define CSR_NODE_IDS 0x8 | ||
42 | #define CSR_RESET_START 0xc | ||
43 | #define CSR_SPLIT_TIMEOUT_HI 0x18 | ||
44 | #define CSR_SPLIT_TIMEOUT_LO 0x1c | ||
45 | #define CSR_CYCLE_TIME 0x200 | ||
46 | #define CSR_BUS_TIME 0x204 | ||
47 | #define CSR_BUSY_TIMEOUT 0x210 | ||
48 | #define CSR_BUS_MANAGER_ID 0x21c | ||
49 | #define CSR_BANDWIDTH_AVAILABLE 0x220 | ||
50 | #define CSR_CHANNELS_AVAILABLE 0x224 | ||
51 | #define CSR_CHANNELS_AVAILABLE_HI 0x224 | ||
52 | #define CSR_CHANNELS_AVAILABLE_LO 0x228 | ||
53 | #define CSR_BROADCAST_CHANNEL 0x234 | ||
54 | #define CSR_CONFIG_ROM 0x400 | ||
55 | #define CSR_CONFIG_ROM_END 0x800 | ||
56 | #define CSR_FCP_COMMAND 0xB00 | ||
57 | #define CSR_FCP_RESPONSE 0xD00 | ||
58 | #define CSR_FCP_END 0xF00 | ||
59 | #define CSR_TOPOLOGY_MAP 0x1000 | ||
60 | #define CSR_TOPOLOGY_MAP_END 0x1400 | ||
61 | #define CSR_SPEED_MAP 0x2000 | ||
62 | #define CSR_SPEED_MAP_END 0x3000 | ||
63 | |||
64 | #define CSR_OFFSET 0x40 | ||
65 | #define CSR_LEAF 0x80 | ||
66 | #define CSR_DIRECTORY 0xc0 | ||
67 | |||
68 | #define CSR_DESCRIPTOR 0x01 | ||
69 | #define CSR_VENDOR 0x03 | ||
70 | #define CSR_HARDWARE_VERSION 0x04 | ||
71 | #define CSR_NODE_CAPABILITIES 0x0c | ||
72 | #define CSR_UNIT 0x11 | ||
73 | #define CSR_SPECIFIER_ID 0x12 | ||
74 | #define CSR_VERSION 0x13 | ||
75 | #define CSR_DEPENDENT_INFO 0x14 | ||
76 | #define CSR_MODEL 0x17 | ||
77 | #define CSR_INSTANCE 0x18 | ||
78 | #define CSR_DIRECTORY_ID 0x20 | ||
79 | |||
80 | struct fw_csr_iterator { | ||
81 | u32 *p; | ||
82 | u32 *end; | ||
83 | }; | ||
84 | |||
85 | void fw_csr_iterator_init(struct fw_csr_iterator *ci, u32 *p); | ||
86 | int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value); | ||
87 | |||
88 | extern struct bus_type fw_bus_type; | ||
89 | |||
90 | struct fw_card_driver; | ||
91 | struct fw_node; | ||
92 | |||
93 | struct fw_card { | ||
94 | const struct fw_card_driver *driver; | ||
95 | struct device *device; | ||
96 | struct kref kref; | ||
97 | struct completion done; | ||
98 | |||
99 | int node_id; | ||
100 | int generation; | ||
101 | int current_tlabel; | ||
102 | u64 tlabel_mask; | ||
103 | struct list_head transaction_list; | ||
104 | struct timer_list flush_timer; | ||
105 | unsigned long reset_jiffies; | ||
106 | |||
107 | unsigned long long guid; | ||
108 | unsigned max_receive; | ||
109 | int link_speed; | ||
110 | int config_rom_generation; | ||
111 | |||
112 | spinlock_t lock; /* Take this lock when handling the lists in | ||
113 | * this struct. */ | ||
114 | struct fw_node *local_node; | ||
115 | struct fw_node *root_node; | ||
116 | struct fw_node *irm_node; | ||
117 | u8 color; /* must be u8 to match the definition in struct fw_node */ | ||
118 | int gap_count; | ||
119 | bool beta_repeaters_present; | ||
120 | |||
121 | int index; | ||
122 | |||
123 | struct list_head link; | ||
124 | |||
125 | /* Work struct for BM duties. */ | ||
126 | struct delayed_work work; | ||
127 | int bm_retries; | ||
128 | int bm_generation; | ||
129 | |||
130 | bool broadcast_channel_allocated; | ||
131 | u32 broadcast_channel; | ||
132 | u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; | ||
133 | }; | ||
134 | |||
135 | static inline struct fw_card *fw_card_get(struct fw_card *card) | ||
136 | { | ||
137 | kref_get(&card->kref); | ||
138 | |||
139 | return card; | ||
140 | } | ||
141 | |||
142 | void fw_card_release(struct kref *kref); | ||
143 | |||
144 | static inline void fw_card_put(struct fw_card *card) | ||
145 | { | ||
146 | kref_put(&card->kref, fw_card_release); | ||
147 | } | ||
148 | |||
149 | struct fw_attribute_group { | ||
150 | struct attribute_group *groups[2]; | ||
151 | struct attribute_group group; | ||
152 | struct attribute *attrs[12]; | ||
153 | }; | ||
154 | |||
155 | enum fw_device_state { | ||
156 | FW_DEVICE_INITIALIZING, | ||
157 | FW_DEVICE_RUNNING, | ||
158 | FW_DEVICE_GONE, | ||
159 | FW_DEVICE_SHUTDOWN, | ||
160 | }; | ||
161 | |||
162 | /* | ||
163 | * Note, fw_device.generation always has to be read before fw_device.node_id. | ||
164 | * Use SMP memory barriers to ensure this. Otherwise requests will be sent | ||
165 | * to an outdated node_id if the generation was updated in the meantime due | ||
166 | * to a bus reset. | ||
167 | * | ||
168 | * Likewise, fw-core will take care to update .node_id before .generation so | ||
169 | * that whenever fw_device.generation is current WRT the actual bus generation, | ||
170 | * fw_device.node_id is guaranteed to be current too. | ||
171 | * | ||
172 | * The same applies to fw_device.card->node_id vs. fw_device.generation. | ||
173 | * | ||
174 | * fw_device.config_rom and fw_device.config_rom_length may be accessed during | ||
175 | * the lifetime of any fw_unit belonging to the fw_device, before device_del() | ||
176 | * was called on the last fw_unit. Alternatively, they may be accessed while | ||
177 | * holding fw_device_rwsem. | ||
178 | */ | ||
179 | struct fw_device { | ||
180 | atomic_t state; | ||
181 | struct fw_node *node; | ||
182 | int node_id; | ||
183 | int generation; | ||
184 | unsigned max_speed; | ||
185 | struct fw_card *card; | ||
186 | struct device device; | ||
187 | |||
188 | struct mutex client_list_mutex; | ||
189 | struct list_head client_list; | ||
190 | |||
191 | u32 *config_rom; | ||
192 | size_t config_rom_length; | ||
193 | int config_rom_retries; | ||
194 | unsigned is_local:1; | ||
195 | unsigned max_rec:4; | ||
196 | unsigned cmc:1; | ||
197 | unsigned irmc:1; | ||
198 | unsigned bc_implemented:2; | ||
199 | |||
200 | struct delayed_work work; | ||
201 | struct fw_attribute_group attribute_group; | ||
202 | }; | ||
203 | |||
204 | static inline struct fw_device *fw_device(struct device *dev) | ||
205 | { | ||
206 | return container_of(dev, struct fw_device, device); | ||
207 | } | ||
208 | |||
209 | static inline int fw_device_is_shutdown(struct fw_device *device) | ||
210 | { | ||
211 | return atomic_read(&device->state) == FW_DEVICE_SHUTDOWN; | ||
212 | } | ||
213 | |||
214 | static inline struct fw_device *fw_device_get(struct fw_device *device) | ||
215 | { | ||
216 | get_device(&device->device); | ||
217 | |||
218 | return device; | ||
219 | } | ||
220 | |||
221 | static inline void fw_device_put(struct fw_device *device) | ||
222 | { | ||
223 | put_device(&device->device); | ||
224 | } | ||
225 | |||
226 | int fw_device_enable_phys_dma(struct fw_device *device); | ||
227 | |||
228 | /* | ||
229 | * fw_unit.directory must not be accessed after device_del(&fw_unit.device). | ||
230 | */ | ||
231 | struct fw_unit { | ||
232 | struct device device; | ||
233 | u32 *directory; | ||
234 | struct fw_attribute_group attribute_group; | ||
235 | }; | ||
236 | |||
237 | static inline struct fw_unit *fw_unit(struct device *dev) | ||
238 | { | ||
239 | return container_of(dev, struct fw_unit, device); | ||
240 | } | ||
241 | |||
242 | static inline struct fw_unit *fw_unit_get(struct fw_unit *unit) | ||
243 | { | ||
244 | get_device(&unit->device); | ||
245 | |||
246 | return unit; | ||
247 | } | ||
248 | |||
249 | static inline void fw_unit_put(struct fw_unit *unit) | ||
250 | { | ||
251 | put_device(&unit->device); | ||
252 | } | ||
253 | |||
254 | static inline struct fw_device *fw_parent_device(struct fw_unit *unit) | ||
255 | { | ||
256 | return fw_device(unit->device.parent); | ||
257 | } | ||
258 | |||
259 | struct ieee1394_device_id; | ||
260 | |||
261 | struct fw_driver { | ||
262 | struct device_driver driver; | ||
263 | /* Called when the parent device sits through a bus reset. */ | ||
264 | void (*update)(struct fw_unit *unit); | ||
265 | const struct ieee1394_device_id *id_table; | ||
266 | }; | ||
267 | |||
268 | struct fw_packet; | ||
269 | struct fw_request; | ||
270 | |||
271 | typedef void (*fw_packet_callback_t)(struct fw_packet *packet, | ||
272 | struct fw_card *card, int status); | ||
273 | typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode, | ||
274 | void *data, size_t length, | ||
275 | void *callback_data); | ||
276 | /* | ||
277 | * Important note: The callback must guarantee that either fw_send_response() | ||
278 | * or kfree() is called on the @request. | ||
279 | */ | ||
280 | typedef void (*fw_address_callback_t)(struct fw_card *card, | ||
281 | struct fw_request *request, | ||
282 | int tcode, int destination, int source, | ||
283 | int generation, int speed, | ||
284 | unsigned long long offset, | ||
285 | void *data, size_t length, | ||
286 | void *callback_data); | ||
287 | |||
288 | struct fw_packet { | ||
289 | int speed; | ||
290 | int generation; | ||
291 | u32 header[4]; | ||
292 | size_t header_length; | ||
293 | void *payload; | ||
294 | size_t payload_length; | ||
295 | dma_addr_t payload_bus; | ||
296 | u32 timestamp; | ||
297 | |||
298 | /* | ||
299 | * This callback is called when the packet transmission has | ||
300 | * completed; for successful transmission, the status code is | ||
301 | * the ack received from the destination, otherwise it's a | ||
302 | * negative errno: ENOMEM, ESTALE, ETIMEDOUT, ENODEV, EIO. | ||
303 | * The callback can be called from tasklet context and thus | ||
304 | * must never block. | ||
305 | */ | ||
306 | fw_packet_callback_t callback; | ||
307 | int ack; | ||
308 | struct list_head link; | ||
309 | void *driver_data; | ||
310 | }; | ||
311 | |||
312 | struct fw_transaction { | ||
313 | int node_id; /* The generation is implied; it is always the current. */ | ||
314 | int tlabel; | ||
315 | int timestamp; | ||
316 | struct list_head link; | ||
317 | |||
318 | struct fw_packet packet; | ||
319 | |||
320 | /* | ||
321 | * The data passed to the callback is valid only during the | ||
322 | * callback. | ||
323 | */ | ||
324 | fw_transaction_callback_t callback; | ||
325 | void *callback_data; | ||
326 | }; | ||
327 | |||
328 | struct fw_address_handler { | ||
329 | u64 offset; | ||
330 | size_t length; | ||
331 | fw_address_callback_t address_callback; | ||
332 | void *callback_data; | ||
333 | struct list_head link; | ||
334 | }; | ||
335 | |||
336 | struct fw_address_region { | ||
337 | u64 start; | ||
338 | u64 end; | ||
339 | }; | ||
340 | |||
341 | extern const struct fw_address_region fw_high_memory_region; | ||
342 | |||
343 | int fw_core_add_address_handler(struct fw_address_handler *handler, | ||
344 | const struct fw_address_region *region); | ||
345 | void fw_core_remove_address_handler(struct fw_address_handler *handler); | ||
346 | void fw_send_response(struct fw_card *card, | ||
347 | struct fw_request *request, int rcode); | ||
348 | void fw_send_request(struct fw_card *card, struct fw_transaction *t, | ||
349 | int tcode, int destination_id, int generation, int speed, | ||
350 | unsigned long long offset, void *payload, size_t length, | ||
351 | fw_transaction_callback_t callback, void *callback_data); | ||
352 | int fw_cancel_transaction(struct fw_card *card, | ||
353 | struct fw_transaction *transaction); | ||
354 | int fw_run_transaction(struct fw_card *card, int tcode, int destination_id, | ||
355 | int generation, int speed, unsigned long long offset, | ||
356 | void *payload, size_t length); | ||
357 | |||
358 | #endif /* _LINUX_FIREWIRE_H */ | ||
diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h index cca686b39123..875451f1373a 100644 --- a/include/linux/firmware-map.h +++ b/include/linux/firmware-map.h | |||
@@ -24,21 +24,17 @@ | |||
24 | */ | 24 | */ |
25 | #ifdef CONFIG_FIRMWARE_MEMMAP | 25 | #ifdef CONFIG_FIRMWARE_MEMMAP |
26 | 26 | ||
27 | int firmware_map_add(resource_size_t start, resource_size_t end, | 27 | int firmware_map_add(u64 start, u64 end, const char *type); |
28 | const char *type); | 28 | int firmware_map_add_early(u64 start, u64 end, const char *type); |
29 | int firmware_map_add_early(resource_size_t start, resource_size_t end, | ||
30 | const char *type); | ||
31 | 29 | ||
32 | #else /* CONFIG_FIRMWARE_MEMMAP */ | 30 | #else /* CONFIG_FIRMWARE_MEMMAP */ |
33 | 31 | ||
34 | static inline int firmware_map_add(resource_size_t start, resource_size_t end, | 32 | static inline int firmware_map_add(u64 start, u64 end, const char *type) |
35 | const char *type) | ||
36 | { | 33 | { |
37 | return 0; | 34 | return 0; |
38 | } | 35 | } |
39 | 36 | ||
40 | static inline int firmware_map_add_early(resource_size_t start, | 37 | static inline int firmware_map_add_early(u64 start, u64 end, const char *type) |
41 | resource_size_t end, const char *type) | ||
42 | { | 38 | { |
43 | return 0; | 39 | return 0; |
44 | } | 40 | } |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index c8ecf5b2a207..d31544628436 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -5,7 +5,6 @@ | |||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/compiler.h> | 6 | #include <linux/compiler.h> |
7 | 7 | ||
8 | #define FIRMWARE_NAME_MAX 30 | ||
9 | #define FW_ACTION_NOHOTPLUG 0 | 8 | #define FW_ACTION_NOHOTPLUG 0 |
10 | #define FW_ACTION_HOTPLUG 1 | 9 | #define FW_ACTION_HOTPLUG 1 |
11 | 10 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index ede84fa7da5d..74a57938c880 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -879,7 +879,7 @@ struct file_ra_state { | |||
879 | there are only # of pages ahead */ | 879 | there are only # of pages ahead */ |
880 | 880 | ||
881 | unsigned int ra_pages; /* Maximum readahead window */ | 881 | unsigned int ra_pages; /* Maximum readahead window */ |
882 | int mmap_miss; /* Cache miss stat for mmap accesses */ | 882 | unsigned int mmap_miss; /* Cache miss stat for mmap accesses */ |
883 | loff_t prev_pos; /* Cache last read() position */ | 883 | loff_t prev_pos; /* Cache last read() position */ |
884 | }; | 884 | }; |
885 | 885 | ||
@@ -1919,8 +1919,9 @@ extern void __init vfs_caches_init(unsigned long); | |||
1919 | 1919 | ||
1920 | extern struct kmem_cache *names_cachep; | 1920 | extern struct kmem_cache *names_cachep; |
1921 | 1921 | ||
1922 | #define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL) | 1922 | #define __getname_gfp(gfp) kmem_cache_alloc(names_cachep, (gfp)) |
1923 | #define __putname(name) kmem_cache_free(names_cachep, (void *)(name)) | 1923 | #define __getname() __getname_gfp(GFP_KERNEL) |
1924 | #define __putname(name) kmem_cache_free(names_cachep, (void *)(name)) | ||
1924 | #ifndef CONFIG_AUDITSYSCALL | 1925 | #ifndef CONFIG_AUDITSYSCALL |
1925 | #define putname(name) __putname(name) | 1926 | #define putname(name) __putname(name) |
1926 | #else | 1927 | #else |
@@ -2036,9 +2037,6 @@ extern int __invalidate_device(struct block_device *); | |||
2036 | extern int invalidate_partition(struct gendisk *, int); | 2037 | extern int invalidate_partition(struct gendisk *, int); |
2037 | #endif | 2038 | #endif |
2038 | extern int invalidate_inodes(struct super_block *); | 2039 | extern int invalidate_inodes(struct super_block *); |
2039 | unsigned long __invalidate_mapping_pages(struct address_space *mapping, | ||
2040 | pgoff_t start, pgoff_t end, | ||
2041 | bool be_atomic); | ||
2042 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 2040 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
2043 | pgoff_t start, pgoff_t end); | 2041 | pgoff_t start, pgoff_t end); |
2044 | 2042 | ||
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 7cbd38d363a2..45fc320a53c6 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -142,7 +142,7 @@ struct gendisk { | |||
142 | * disks that can't be partitioned. */ | 142 | * disks that can't be partitioned. */ |
143 | 143 | ||
144 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ | 144 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ |
145 | 145 | char *(*nodename)(struct gendisk *gd); | |
146 | /* Array of pointers to partitions indexed by partno. | 146 | /* Array of pointers to partitions indexed by partno. |
147 | * Protected with matching bdev lock but stat and other | 147 | * Protected with matching bdev lock but stat and other |
148 | * non-critical accesses use RCU. Always access through | 148 | * non-critical accesses use RCU. Always access through |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 3760e7c5de02..cfdb35d71bca 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/stddef.h> | 5 | #include <linux/stddef.h> |
6 | #include <linux/linkage.h> | 6 | #include <linux/linkage.h> |
7 | #include <linux/topology.h> | 7 | #include <linux/topology.h> |
8 | #include <linux/mmdebug.h> | ||
8 | 9 | ||
9 | struct vm_area_struct; | 10 | struct vm_area_struct; |
10 | 11 | ||
@@ -20,7 +21,8 @@ struct vm_area_struct; | |||
20 | #define __GFP_DMA ((__force gfp_t)0x01u) | 21 | #define __GFP_DMA ((__force gfp_t)0x01u) |
21 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) | 22 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) |
22 | #define __GFP_DMA32 ((__force gfp_t)0x04u) | 23 | #define __GFP_DMA32 ((__force gfp_t)0x04u) |
23 | 24 | #define __GFP_MOVABLE ((__force gfp_t)0x08u) /* Page is movable */ | |
25 | #define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE) | ||
24 | /* | 26 | /* |
25 | * Action modifiers - doesn't change the zoning | 27 | * Action modifiers - doesn't change the zoning |
26 | * | 28 | * |
@@ -50,9 +52,20 @@ struct vm_area_struct; | |||
50 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ | 52 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ |
51 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ | 53 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ |
52 | #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */ | 54 | #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */ |
53 | #define __GFP_MOVABLE ((__force gfp_t)0x100000u) /* Page is movable */ | ||
54 | 55 | ||
55 | #define __GFP_BITS_SHIFT 21 /* Room for 21 __GFP_FOO bits */ | 56 | #ifdef CONFIG_KMEMCHECK |
57 | #define __GFP_NOTRACK ((__force gfp_t)0x200000u) /* Don't track with kmemcheck */ | ||
58 | #else | ||
59 | #define __GFP_NOTRACK ((__force gfp_t)0) | ||
60 | #endif | ||
61 | |||
62 | /* | ||
63 | * This may seem redundant, but it's a way of annotating false positives vs. | ||
64 | * allocations that simply cannot be supported (e.g. page tables). | ||
65 | */ | ||
66 | #define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK) | ||
67 | |||
68 | #define __GFP_BITS_SHIFT 22 /* Room for 22 __GFP_FOO bits */ | ||
56 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) | 69 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) |
57 | 70 | ||
58 | /* This equals 0, but use constants in case they ever change */ | 71 | /* This equals 0, but use constants in case they ever change */ |
@@ -115,24 +128,105 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags) | |||
115 | ((gfp_flags & __GFP_RECLAIMABLE) != 0); | 128 | ((gfp_flags & __GFP_RECLAIMABLE) != 0); |
116 | } | 129 | } |
117 | 130 | ||
118 | static inline enum zone_type gfp_zone(gfp_t flags) | 131 | #ifdef CONFIG_HIGHMEM |
119 | { | 132 | #define OPT_ZONE_HIGHMEM ZONE_HIGHMEM |
133 | #else | ||
134 | #define OPT_ZONE_HIGHMEM ZONE_NORMAL | ||
135 | #endif | ||
136 | |||
120 | #ifdef CONFIG_ZONE_DMA | 137 | #ifdef CONFIG_ZONE_DMA |
121 | if (flags & __GFP_DMA) | 138 | #define OPT_ZONE_DMA ZONE_DMA |
122 | return ZONE_DMA; | 139 | #else |
140 | #define OPT_ZONE_DMA ZONE_NORMAL | ||
123 | #endif | 141 | #endif |
142 | |||
124 | #ifdef CONFIG_ZONE_DMA32 | 143 | #ifdef CONFIG_ZONE_DMA32 |
125 | if (flags & __GFP_DMA32) | 144 | #define OPT_ZONE_DMA32 ZONE_DMA32 |
126 | return ZONE_DMA32; | 145 | #else |
146 | #define OPT_ZONE_DMA32 ZONE_NORMAL | ||
127 | #endif | 147 | #endif |
128 | if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) == | 148 | |
129 | (__GFP_HIGHMEM | __GFP_MOVABLE)) | 149 | /* |
130 | return ZONE_MOVABLE; | 150 | * GFP_ZONE_TABLE is a word size bitstring that is used for looking up the |
131 | #ifdef CONFIG_HIGHMEM | 151 | * zone to use given the lowest 4 bits of gfp_t. Entries are ZONE_SHIFT long |
132 | if (flags & __GFP_HIGHMEM) | 152 | * and there are 16 of them to cover all possible combinations of |
133 | return ZONE_HIGHMEM; | 153 | * __GFP_DMA, __GFP_DMA32, __GFP_MOVABLE and __GFP_HIGHMEM |
154 | * | ||
155 | * The zone fallback order is MOVABLE=>HIGHMEM=>NORMAL=>DMA32=>DMA. | ||
156 | * But GFP_MOVABLE is not only a zone specifier but also an allocation | ||
157 | * policy. Therefore __GFP_MOVABLE plus another zone selector is valid. | ||
158 | * Only 1bit of the lowest 3 bit (DMA,DMA32,HIGHMEM) can be set to "1". | ||
159 | * | ||
160 | * bit result | ||
161 | * ================= | ||
162 | * 0x0 => NORMAL | ||
163 | * 0x1 => DMA or NORMAL | ||
164 | * 0x2 => HIGHMEM or NORMAL | ||
165 | * 0x3 => BAD (DMA+HIGHMEM) | ||
166 | * 0x4 => DMA32 or DMA or NORMAL | ||
167 | * 0x5 => BAD (DMA+DMA32) | ||
168 | * 0x6 => BAD (HIGHMEM+DMA32) | ||
169 | * 0x7 => BAD (HIGHMEM+DMA32+DMA) | ||
170 | * 0x8 => NORMAL (MOVABLE+0) | ||
171 | * 0x9 => DMA or NORMAL (MOVABLE+DMA) | ||
172 | * 0xa => MOVABLE (Movable is valid only if HIGHMEM is set too) | ||
173 | * 0xb => BAD (MOVABLE+HIGHMEM+DMA) | ||
174 | * 0xc => DMA32 (MOVABLE+HIGHMEM+DMA32) | ||
175 | * 0xd => BAD (MOVABLE+DMA32+DMA) | ||
176 | * 0xe => BAD (MOVABLE+DMA32+HIGHMEM) | ||
177 | * 0xf => BAD (MOVABLE+DMA32+HIGHMEM+DMA) | ||
178 | * | ||
179 | * ZONES_SHIFT must be <= 2 on 32 bit platforms. | ||
180 | */ | ||
181 | |||
182 | #if 16 * ZONES_SHIFT > BITS_PER_LONG | ||
183 | #error ZONES_SHIFT too large to create GFP_ZONE_TABLE integer | ||
184 | #endif | ||
185 | |||
186 | #define GFP_ZONE_TABLE ( \ | ||
187 | (ZONE_NORMAL << 0 * ZONES_SHIFT) \ | ||
188 | | (OPT_ZONE_DMA << __GFP_DMA * ZONES_SHIFT) \ | ||
189 | | (OPT_ZONE_HIGHMEM << __GFP_HIGHMEM * ZONES_SHIFT) \ | ||
190 | | (OPT_ZONE_DMA32 << __GFP_DMA32 * ZONES_SHIFT) \ | ||
191 | | (ZONE_NORMAL << __GFP_MOVABLE * ZONES_SHIFT) \ | ||
192 | | (OPT_ZONE_DMA << (__GFP_MOVABLE | __GFP_DMA) * ZONES_SHIFT) \ | ||
193 | | (ZONE_MOVABLE << (__GFP_MOVABLE | __GFP_HIGHMEM) * ZONES_SHIFT)\ | ||
194 | | (OPT_ZONE_DMA32 << (__GFP_MOVABLE | __GFP_DMA32) * ZONES_SHIFT)\ | ||
195 | ) | ||
196 | |||
197 | /* | ||
198 | * GFP_ZONE_BAD is a bitmap for all combination of __GFP_DMA, __GFP_DMA32 | ||
199 | * __GFP_HIGHMEM and __GFP_MOVABLE that are not permitted. One flag per | ||
200 | * entry starting with bit 0. Bit is set if the combination is not | ||
201 | * allowed. | ||
202 | */ | ||
203 | #define GFP_ZONE_BAD ( \ | ||
204 | 1 << (__GFP_DMA | __GFP_HIGHMEM) \ | ||
205 | | 1 << (__GFP_DMA | __GFP_DMA32) \ | ||
206 | | 1 << (__GFP_DMA32 | __GFP_HIGHMEM) \ | ||
207 | | 1 << (__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM) \ | ||
208 | | 1 << (__GFP_MOVABLE | __GFP_HIGHMEM | __GFP_DMA) \ | ||
209 | | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA) \ | ||
210 | | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_HIGHMEM) \ | ||
211 | | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA | __GFP_HIGHMEM)\ | ||
212 | ) | ||
213 | |||
214 | static inline enum zone_type gfp_zone(gfp_t flags) | ||
215 | { | ||
216 | enum zone_type z; | ||
217 | int bit = flags & GFP_ZONEMASK; | ||
218 | |||
219 | z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) & | ||
220 | ((1 << ZONES_SHIFT) - 1); | ||
221 | |||
222 | if (__builtin_constant_p(bit)) | ||
223 | BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1); | ||
224 | else { | ||
225 | #ifdef CONFIG_DEBUG_VM | ||
226 | BUG_ON((GFP_ZONE_BAD >> bit) & 1); | ||
134 | #endif | 227 | #endif |
135 | return ZONE_NORMAL; | 228 | } |
229 | return z; | ||
136 | } | 230 | } |
137 | 231 | ||
138 | /* | 232 | /* |
@@ -172,30 +266,19 @@ static inline void arch_alloc_page(struct page *page, int order) { } | |||
172 | #endif | 266 | #endif |
173 | 267 | ||
174 | struct page * | 268 | struct page * |
175 | __alloc_pages_internal(gfp_t gfp_mask, unsigned int order, | 269 | __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, |
176 | struct zonelist *zonelist, nodemask_t *nodemask); | 270 | struct zonelist *zonelist, nodemask_t *nodemask); |
177 | 271 | ||
178 | static inline struct page * | 272 | static inline struct page * |
179 | __alloc_pages(gfp_t gfp_mask, unsigned int order, | 273 | __alloc_pages(gfp_t gfp_mask, unsigned int order, |
180 | struct zonelist *zonelist) | 274 | struct zonelist *zonelist) |
181 | { | 275 | { |
182 | return __alloc_pages_internal(gfp_mask, order, zonelist, NULL); | 276 | return __alloc_pages_nodemask(gfp_mask, order, zonelist, NULL); |
183 | } | 277 | } |
184 | 278 | ||
185 | static inline struct page * | ||
186 | __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, | ||
187 | struct zonelist *zonelist, nodemask_t *nodemask) | ||
188 | { | ||
189 | return __alloc_pages_internal(gfp_mask, order, zonelist, nodemask); | ||
190 | } | ||
191 | |||
192 | |||
193 | static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, | 279 | static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, |
194 | unsigned int order) | 280 | unsigned int order) |
195 | { | 281 | { |
196 | if (unlikely(order >= MAX_ORDER)) | ||
197 | return NULL; | ||
198 | |||
199 | /* Unknown node is current node */ | 282 | /* Unknown node is current node */ |
200 | if (nid < 0) | 283 | if (nid < 0) |
201 | nid = numa_node_id(); | 284 | nid = numa_node_id(); |
@@ -203,15 +286,20 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, | |||
203 | return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask)); | 286 | return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask)); |
204 | } | 287 | } |
205 | 288 | ||
289 | static inline struct page *alloc_pages_exact_node(int nid, gfp_t gfp_mask, | ||
290 | unsigned int order) | ||
291 | { | ||
292 | VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES); | ||
293 | |||
294 | return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask)); | ||
295 | } | ||
296 | |||
206 | #ifdef CONFIG_NUMA | 297 | #ifdef CONFIG_NUMA |
207 | extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order); | 298 | extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order); |
208 | 299 | ||
209 | static inline struct page * | 300 | static inline struct page * |
210 | alloc_pages(gfp_t gfp_mask, unsigned int order) | 301 | alloc_pages(gfp_t gfp_mask, unsigned int order) |
211 | { | 302 | { |
212 | if (unlikely(order >= MAX_ORDER)) | ||
213 | return NULL; | ||
214 | |||
215 | return alloc_pages_current(gfp_mask, order); | 303 | return alloc_pages_current(gfp_mask, order); |
216 | } | 304 | } |
217 | extern struct page *alloc_page_vma(gfp_t gfp_mask, | 305 | extern struct page *alloc_page_vma(gfp_t gfp_mask, |
@@ -248,4 +336,16 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); | |||
248 | void drain_all_pages(void); | 336 | void drain_all_pages(void); |
249 | void drain_local_pages(void *dummy); | 337 | void drain_local_pages(void *dummy); |
250 | 338 | ||
339 | extern bool oom_killer_disabled; | ||
340 | |||
341 | static inline void oom_killer_disable(void) | ||
342 | { | ||
343 | oom_killer_disabled = true; | ||
344 | } | ||
345 | |||
346 | static inline void oom_killer_enable(void) | ||
347 | { | ||
348 | oom_killer_disabled = false; | ||
349 | } | ||
350 | |||
251 | #endif /* __LINUX_GFP_H */ | 351 | #endif /* __LINUX_GFP_H */ |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 1fcb7126a01f..211ff4497269 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -55,7 +55,9 @@ static inline void *kmap(struct page *page) | |||
55 | return page_address(page); | 55 | return page_address(page); |
56 | } | 56 | } |
57 | 57 | ||
58 | #define kunmap(page) do { (void) (page); } while (0) | 58 | static inline void kunmap(struct page *page) |
59 | { | ||
60 | } | ||
59 | 61 | ||
60 | static inline void *kmap_atomic(struct page *page, enum km_type idx) | 62 | static inline void *kmap_atomic(struct page *page, enum km_type idx) |
61 | { | 63 | { |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 03be7f29ca01..a05a5ef33391 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -11,6 +11,8 @@ | |||
11 | 11 | ||
12 | struct ctl_table; | 12 | struct ctl_table; |
13 | 13 | ||
14 | int PageHuge(struct page *page); | ||
15 | |||
14 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | 16 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) |
15 | { | 17 | { |
16 | return vma->vm_flags & VM_HUGETLB; | 18 | return vma->vm_flags & VM_HUGETLB; |
@@ -61,6 +63,11 @@ void hugetlb_change_protection(struct vm_area_struct *vma, | |||
61 | 63 | ||
62 | #else /* !CONFIG_HUGETLB_PAGE */ | 64 | #else /* !CONFIG_HUGETLB_PAGE */ |
63 | 65 | ||
66 | static inline int PageHuge(struct page *page) | ||
67 | { | ||
68 | return 0; | ||
69 | } | ||
70 | |||
64 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | 71 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) |
65 | { | 72 | { |
66 | return 0; | 73 | return 0; |
diff --git a/include/linux/init.h b/include/linux/init.h index b2189803f19a..8c2c9989626d 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -29,7 +29,7 @@ | |||
29 | * sign followed by value, e.g.: | 29 | * sign followed by value, e.g.: |
30 | * | 30 | * |
31 | * static int init_variable __initdata = 0; | 31 | * static int init_variable __initdata = 0; |
32 | * static char linux_logo[] __initdata = { 0x32, 0x36, ... }; | 32 | * static const char linux_logo[] __initconst = { 0x32, 0x36, ... }; |
33 | * | 33 | * |
34 | * Don't forget to initialize data not at file scope, i.e. within a function, | 34 | * Don't forget to initialize data not at file scope, i.e. within a function, |
35 | * as gcc otherwise puts the data into the bss section and not into the init | 35 | * as gcc otherwise puts the data into the bss section and not into the init |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 28b1f30601b5..5368fbdc7801 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -15,18 +15,6 @@ | |||
15 | extern struct files_struct init_files; | 15 | extern struct files_struct init_files; |
16 | extern struct fs_struct init_fs; | 16 | extern struct fs_struct init_fs; |
17 | 17 | ||
18 | #define INIT_MM(name) \ | ||
19 | { \ | ||
20 | .mm_rb = RB_ROOT, \ | ||
21 | .pgd = swapper_pg_dir, \ | ||
22 | .mm_users = ATOMIC_INIT(2), \ | ||
23 | .mm_count = ATOMIC_INIT(1), \ | ||
24 | .mmap_sem = __RWSEM_INITIALIZER(name.mmap_sem), \ | ||
25 | .page_table_lock = __SPIN_LOCK_UNLOCKED(name.page_table_lock), \ | ||
26 | .mmlist = LIST_HEAD_INIT(name.mmlist), \ | ||
27 | .cpu_vm_mask = CPU_MASK_ALL, \ | ||
28 | } | ||
29 | |||
30 | #define INIT_SIGNALS(sig) { \ | 18 | #define INIT_SIGNALS(sig) { \ |
31 | .count = ATOMIC_INIT(1), \ | 19 | .count = ATOMIC_INIT(1), \ |
32 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ | 20 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index c41e812e9d5e..2721f07e9354 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -472,6 +472,20 @@ static inline void tasklet_hi_schedule(struct tasklet_struct *t) | |||
472 | __tasklet_hi_schedule(t); | 472 | __tasklet_hi_schedule(t); |
473 | } | 473 | } |
474 | 474 | ||
475 | extern void __tasklet_hi_schedule_first(struct tasklet_struct *t); | ||
476 | |||
477 | /* | ||
478 | * This version avoids touching any other tasklets. Needed for kmemcheck | ||
479 | * in order not to take any page faults while enqueueing this tasklet; | ||
480 | * consider VERY carefully whether you really need this or | ||
481 | * tasklet_hi_schedule()... | ||
482 | */ | ||
483 | static inline void tasklet_hi_schedule_first(struct tasklet_struct *t) | ||
484 | { | ||
485 | if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) | ||
486 | __tasklet_hi_schedule_first(t); | ||
487 | } | ||
488 | |||
475 | 489 | ||
476 | static inline void tasklet_disable_nosync(struct tasklet_struct *t) | 490 | static inline void tasklet_disable_nosync(struct tasklet_struct *t) |
477 | { | 491 | { |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 1b2e1747df1a..c5a71c38a95f 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -408,7 +408,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
408 | * | 408 | * |
409 | * Use tracing_on/tracing_off when you want to quickly turn on or off | 409 | * Use tracing_on/tracing_off when you want to quickly turn on or off |
410 | * tracing. It simply enables or disables the recording of the trace events. | 410 | * tracing. It simply enables or disables the recording of the trace events. |
411 | * This also corresponds to the user space debugfs/tracing/tracing_on | 411 | * This also corresponds to the user space /sys/kernel/debug/tracing/tracing_on |
412 | * file, which gives a means for the kernel and userspace to interact. | 412 | * file, which gives a means for the kernel and userspace to interact. |
413 | * Place a tracing_off() in the kernel where you want tracing to end. | 413 | * Place a tracing_off() in the kernel where you want tracing to end. |
414 | * From user space, examine the trace, and then echo 1 > tracing_on | 414 | * From user space, examine the trace, and then echo 1 > tracing_on |
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h new file mode 100644 index 000000000000..47b39b7c7e84 --- /dev/null +++ b/include/linux/kmemcheck.h | |||
@@ -0,0 +1,153 @@ | |||
1 | #ifndef LINUX_KMEMCHECK_H | ||
2 | #define LINUX_KMEMCHECK_H | ||
3 | |||
4 | #include <linux/mm_types.h> | ||
5 | #include <linux/types.h> | ||
6 | |||
7 | #ifdef CONFIG_KMEMCHECK | ||
8 | extern int kmemcheck_enabled; | ||
9 | |||
10 | /* The slab-related functions. */ | ||
11 | void kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node); | ||
12 | void kmemcheck_free_shadow(struct page *page, int order); | ||
13 | void kmemcheck_slab_alloc(struct kmem_cache *s, gfp_t gfpflags, void *object, | ||
14 | size_t size); | ||
15 | void kmemcheck_slab_free(struct kmem_cache *s, void *object, size_t size); | ||
16 | |||
17 | void kmemcheck_pagealloc_alloc(struct page *p, unsigned int order, | ||
18 | gfp_t gfpflags); | ||
19 | |||
20 | void kmemcheck_show_pages(struct page *p, unsigned int n); | ||
21 | void kmemcheck_hide_pages(struct page *p, unsigned int n); | ||
22 | |||
23 | bool kmemcheck_page_is_tracked(struct page *p); | ||
24 | |||
25 | void kmemcheck_mark_unallocated(void *address, unsigned int n); | ||
26 | void kmemcheck_mark_uninitialized(void *address, unsigned int n); | ||
27 | void kmemcheck_mark_initialized(void *address, unsigned int n); | ||
28 | void kmemcheck_mark_freed(void *address, unsigned int n); | ||
29 | |||
30 | void kmemcheck_mark_unallocated_pages(struct page *p, unsigned int n); | ||
31 | void kmemcheck_mark_uninitialized_pages(struct page *p, unsigned int n); | ||
32 | void kmemcheck_mark_initialized_pages(struct page *p, unsigned int n); | ||
33 | |||
34 | int kmemcheck_show_addr(unsigned long address); | ||
35 | int kmemcheck_hide_addr(unsigned long address); | ||
36 | |||
37 | #else | ||
38 | #define kmemcheck_enabled 0 | ||
39 | |||
40 | static inline void | ||
41 | kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node) | ||
42 | { | ||
43 | } | ||
44 | |||
45 | static inline void | ||
46 | kmemcheck_free_shadow(struct page *page, int order) | ||
47 | { | ||
48 | } | ||
49 | |||
50 | static inline void | ||
51 | kmemcheck_slab_alloc(struct kmem_cache *s, gfp_t gfpflags, void *object, | ||
52 | size_t size) | ||
53 | { | ||
54 | } | ||
55 | |||
56 | static inline void kmemcheck_slab_free(struct kmem_cache *s, void *object, | ||
57 | size_t size) | ||
58 | { | ||
59 | } | ||
60 | |||
61 | static inline void kmemcheck_pagealloc_alloc(struct page *p, | ||
62 | unsigned int order, gfp_t gfpflags) | ||
63 | { | ||
64 | } | ||
65 | |||
66 | static inline bool kmemcheck_page_is_tracked(struct page *p) | ||
67 | { | ||
68 | return false; | ||
69 | } | ||
70 | |||
71 | static inline void kmemcheck_mark_unallocated(void *address, unsigned int n) | ||
72 | { | ||
73 | } | ||
74 | |||
75 | static inline void kmemcheck_mark_uninitialized(void *address, unsigned int n) | ||
76 | { | ||
77 | } | ||
78 | |||
79 | static inline void kmemcheck_mark_initialized(void *address, unsigned int n) | ||
80 | { | ||
81 | } | ||
82 | |||
83 | static inline void kmemcheck_mark_freed(void *address, unsigned int n) | ||
84 | { | ||
85 | } | ||
86 | |||
87 | static inline void kmemcheck_mark_unallocated_pages(struct page *p, | ||
88 | unsigned int n) | ||
89 | { | ||
90 | } | ||
91 | |||
92 | static inline void kmemcheck_mark_uninitialized_pages(struct page *p, | ||
93 | unsigned int n) | ||
94 | { | ||
95 | } | ||
96 | |||
97 | static inline void kmemcheck_mark_initialized_pages(struct page *p, | ||
98 | unsigned int n) | ||
99 | { | ||
100 | } | ||
101 | |||
102 | #endif /* CONFIG_KMEMCHECK */ | ||
103 | |||
104 | /* | ||
105 | * Bitfield annotations | ||
106 | * | ||
107 | * How to use: If you have a struct using bitfields, for example | ||
108 | * | ||
109 | * struct a { | ||
110 | * int x:8, y:8; | ||
111 | * }; | ||
112 | * | ||
113 | * then this should be rewritten as | ||
114 | * | ||
115 | * struct a { | ||
116 | * kmemcheck_bitfield_begin(flags); | ||
117 | * int x:8, y:8; | ||
118 | * kmemcheck_bitfield_end(flags); | ||
119 | * }; | ||
120 | * | ||
121 | * Now the "flags_begin" and "flags_end" members may be used to refer to the | ||
122 | * beginning and end, respectively, of the bitfield (and things like | ||
123 | * &x.flags_begin is allowed). As soon as the struct is allocated, the bit- | ||
124 | * fields should be annotated: | ||
125 | * | ||
126 | * struct a *a = kmalloc(sizeof(struct a), GFP_KERNEL); | ||
127 | * kmemcheck_annotate_bitfield(a, flags); | ||
128 | * | ||
129 | * Note: We provide the same definitions for both kmemcheck and non- | ||
130 | * kmemcheck kernels. This makes it harder to introduce accidental errors. It | ||
131 | * is also allowed to pass NULL pointers to kmemcheck_annotate_bitfield(). | ||
132 | */ | ||
133 | #define kmemcheck_bitfield_begin(name) \ | ||
134 | int name##_begin[0]; | ||
135 | |||
136 | #define kmemcheck_bitfield_end(name) \ | ||
137 | int name##_end[0]; | ||
138 | |||
139 | #define kmemcheck_annotate_bitfield(ptr, name) \ | ||
140 | do if (ptr) { \ | ||
141 | int _n = (long) &((ptr)->name##_end) \ | ||
142 | - (long) &((ptr)->name##_begin); \ | ||
143 | BUILD_BUG_ON(_n < 0); \ | ||
144 | \ | ||
145 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ | ||
146 | } while (0) | ||
147 | |||
148 | #define kmemcheck_annotate_variable(var) \ | ||
149 | do { \ | ||
150 | kmemcheck_mark_initialized(&(var), sizeof(var)); \ | ||
151 | } while (0) \ | ||
152 | |||
153 | #endif /* LINUX_KMEMCHECK_H */ | ||
diff --git a/include/linux/linux_logo.h b/include/linux/linux_logo.h index 08a92969c76e..ca5bd91d12e1 100644 --- a/include/linux/linux_logo.h +++ b/include/linux/linux_logo.h | |||
@@ -32,6 +32,22 @@ struct linux_logo { | |||
32 | const unsigned char *data; | 32 | const unsigned char *data; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | extern const struct linux_logo logo_linux_mono; | ||
36 | extern const struct linux_logo logo_linux_vga16; | ||
37 | extern const struct linux_logo logo_linux_clut224; | ||
38 | extern const struct linux_logo logo_blackfin_vga16; | ||
39 | extern const struct linux_logo logo_blackfin_clut224; | ||
40 | extern const struct linux_logo logo_dec_clut224; | ||
41 | extern const struct linux_logo logo_mac_clut224; | ||
42 | extern const struct linux_logo logo_parisc_clut224; | ||
43 | extern const struct linux_logo logo_sgi_clut224; | ||
44 | extern const struct linux_logo logo_sun_clut224; | ||
45 | extern const struct linux_logo logo_superh_mono; | ||
46 | extern const struct linux_logo logo_superh_vga16; | ||
47 | extern const struct linux_logo logo_superh_clut224; | ||
48 | extern const struct linux_logo logo_m32r_clut224; | ||
49 | extern const struct linux_logo logo_spe_clut224; | ||
50 | |||
35 | extern const struct linux_logo *fb_find_logo(int depth); | 51 | extern const struct linux_logo *fb_find_logo(int depth); |
36 | #ifdef CONFIG_FB_LOGO_EXTRA | 52 | #ifdef CONFIG_FB_LOGO_EXTRA |
37 | extern void fb_append_extra_logo(const struct linux_logo *logo, | 53 | extern void fb_append_extra_logo(const struct linux_logo *logo, |
diff --git a/include/linux/lis3lv02d.h b/include/linux/lis3lv02d.h new file mode 100644 index 000000000000..ad651f4e45ac --- /dev/null +++ b/include/linux/lis3lv02d.h | |||
@@ -0,0 +1,39 @@ | |||
1 | #ifndef __LIS3LV02D_H_ | ||
2 | #define __LIS3LV02D_H_ | ||
3 | |||
4 | struct lis3lv02d_platform_data { | ||
5 | /* please note: the 'click' feature is only supported for | ||
6 | * LIS[32]02DL variants of the chip and will be ignored for | ||
7 | * others */ | ||
8 | #define LIS3_CLICK_SINGLE_X (1 << 0) | ||
9 | #define LIS3_CLICK_DOUBLE_X (1 << 1) | ||
10 | #define LIS3_CLICK_SINGLE_Y (1 << 2) | ||
11 | #define LIS3_CLICK_DOUBLE_Y (1 << 3) | ||
12 | #define LIS3_CLICK_SINGLE_Z (1 << 4) | ||
13 | #define LIS3_CLICK_DOUBLE_Z (1 << 5) | ||
14 | unsigned char click_flags; | ||
15 | unsigned char click_thresh_x; | ||
16 | unsigned char click_thresh_y; | ||
17 | unsigned char click_thresh_z; | ||
18 | unsigned char click_time_limit; | ||
19 | unsigned char click_latency; | ||
20 | unsigned char click_window; | ||
21 | |||
22 | #define LIS3_IRQ1_DISABLE (0 << 0) | ||
23 | #define LIS3_IRQ1_FF_WU_1 (1 << 0) | ||
24 | #define LIS3_IRQ1_FF_WU_2 (2 << 0) | ||
25 | #define LIS3_IRQ1_FF_WU_12 (3 << 0) | ||
26 | #define LIS3_IRQ1_DATA_READY (4 << 0) | ||
27 | #define LIS3_IRQ1_CLICK (7 << 0) | ||
28 | #define LIS3_IRQ2_DISABLE (0 << 3) | ||
29 | #define LIS3_IRQ2_FF_WU_1 (1 << 3) | ||
30 | #define LIS3_IRQ2_FF_WU_2 (2 << 3) | ||
31 | #define LIS3_IRQ2_FF_WU_12 (3 << 3) | ||
32 | #define LIS3_IRQ2_DATA_READY (4 << 3) | ||
33 | #define LIS3_IRQ2_CLICK (7 << 3) | ||
34 | #define LIS3_IRQ_OPEN_DRAIN (1 << 6) | ||
35 | #define LIS3_IRQ_ACTIVE_HIGH (1 << 7) | ||
36 | unsigned char irq_cfg; | ||
37 | }; | ||
38 | |||
39 | #endif /* __LIS3LV02D_H_ */ | ||
diff --git a/include/linux/major.h b/include/linux/major.h index 058ec15dd060..6a8ca98c9a96 100644 --- a/include/linux/major.h +++ b/include/linux/major.h | |||
@@ -145,6 +145,7 @@ | |||
145 | #define UNIX98_PTY_MAJOR_COUNT 8 | 145 | #define UNIX98_PTY_MAJOR_COUNT 8 |
146 | #define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT) | 146 | #define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT) |
147 | 147 | ||
148 | #define DRBD_MAJOR 147 | ||
148 | #define RTF_MAJOR 150 | 149 | #define RTF_MAJOR 150 |
149 | #define RAW_MAJOR 162 | 150 | #define RAW_MAJOR 162 |
150 | 151 | ||
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 25b9ca93d232..45add35dda1b 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -94,6 +94,7 @@ extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, | |||
94 | extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | 94 | extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, |
95 | int priority); | 95 | int priority); |
96 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); | 96 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); |
97 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); | ||
97 | unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, | 98 | unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, |
98 | struct zone *zone, | 99 | struct zone *zone, |
99 | enum lru_list lru); | 100 | enum lru_list lru); |
@@ -239,6 +240,12 @@ mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg) | |||
239 | return 1; | 240 | return 1; |
240 | } | 241 | } |
241 | 242 | ||
243 | static inline int | ||
244 | mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg) | ||
245 | { | ||
246 | return 1; | ||
247 | } | ||
248 | |||
242 | static inline unsigned long | 249 | static inline unsigned long |
243 | mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, struct zone *zone, | 250 | mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, struct zone *zone, |
244 | enum lru_list lru) | 251 | enum lru_list lru) |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index beb6ec99cfef..052117744629 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -41,6 +41,7 @@ struct miscdevice { | |||
41 | struct list_head list; | 41 | struct list_head list; |
42 | struct device *parent; | 42 | struct device *parent; |
43 | struct device *this_device; | 43 | struct device *this_device; |
44 | const char *devnode; | ||
44 | }; | 45 | }; |
45 | 46 | ||
46 | extern int misc_register(struct miscdevice * misc); | 47 | extern int misc_register(struct miscdevice * misc); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index ad613ed66ab0..d88d6fc530ad 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -7,7 +7,6 @@ | |||
7 | 7 | ||
8 | #include <linux/gfp.h> | 8 | #include <linux/gfp.h> |
9 | #include <linux/list.h> | 9 | #include <linux/list.h> |
10 | #include <linux/mmdebug.h> | ||
11 | #include <linux/mmzone.h> | 10 | #include <linux/mmzone.h> |
12 | #include <linux/rbtree.h> | 11 | #include <linux/rbtree.h> |
13 | #include <linux/prio_tree.h> | 12 | #include <linux/prio_tree.h> |
@@ -725,7 +724,7 @@ static inline int shmem_lock(struct file *file, int lock, | |||
725 | return 0; | 724 | return 0; |
726 | } | 725 | } |
727 | #endif | 726 | #endif |
728 | struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags); | 727 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); |
729 | 728 | ||
730 | int shmem_zero_setup(struct vm_area_struct *); | 729 | int shmem_zero_setup(struct vm_area_struct *); |
731 | 730 | ||
@@ -793,6 +792,8 @@ int copy_page_range(struct mm_struct *dst, struct mm_struct *src, | |||
793 | struct vm_area_struct *vma); | 792 | struct vm_area_struct *vma); |
794 | void unmap_mapping_range(struct address_space *mapping, | 793 | void unmap_mapping_range(struct address_space *mapping, |
795 | loff_t const holebegin, loff_t const holelen, int even_cows); | 794 | loff_t const holebegin, loff_t const holelen, int even_cows); |
795 | int follow_pfn(struct vm_area_struct *vma, unsigned long address, | ||
796 | unsigned long *pfn); | ||
796 | int follow_phys(struct vm_area_struct *vma, unsigned long address, | 797 | int follow_phys(struct vm_area_struct *vma, unsigned long address, |
797 | unsigned int flags, unsigned long *prot, resource_size_t *phys); | 798 | unsigned int flags, unsigned long *prot, resource_size_t *phys); |
798 | int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, | 799 | int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, |
@@ -824,8 +825,11 @@ static inline int handle_mm_fault(struct mm_struct *mm, | |||
824 | extern int make_pages_present(unsigned long addr, unsigned long end); | 825 | extern int make_pages_present(unsigned long addr, unsigned long end); |
825 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); | 826 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); |
826 | 827 | ||
827 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, | 828 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, |
828 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); | 829 | unsigned long start, int len, int write, int force, |
830 | struct page **pages, struct vm_area_struct **vmas); | ||
831 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | ||
832 | struct page **pages); | ||
829 | 833 | ||
830 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); | 834 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); |
831 | extern void do_invalidatepage(struct page *page, unsigned long offset); | 835 | extern void do_invalidatepage(struct page *page, unsigned long offset); |
@@ -850,19 +854,6 @@ extern int mprotect_fixup(struct vm_area_struct *vma, | |||
850 | unsigned long end, unsigned long newflags); | 854 | unsigned long end, unsigned long newflags); |
851 | 855 | ||
852 | /* | 856 | /* |
853 | * get_user_pages_fast provides equivalent functionality to get_user_pages, | ||
854 | * operating on current and current->mm (force=0 and doesn't return any vmas). | ||
855 | * | ||
856 | * get_user_pages_fast may take mmap_sem and page tables, so no assumptions | ||
857 | * can be made about locking. get_user_pages_fast is to be implemented in a | ||
858 | * way that is advantageous (vs get_user_pages()) when the user memory area is | ||
859 | * already faulted in and present in ptes. However if the pages have to be | ||
860 | * faulted in, it may turn out to be slightly slower). | ||
861 | */ | ||
862 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | ||
863 | struct page **pages); | ||
864 | |||
865 | /* | ||
866 | * A callback you can register to apply pressure to ageable caches. | 857 | * A callback you can register to apply pressure to ageable caches. |
867 | * | 858 | * |
868 | * 'shrink' is passed a count 'nr_to_scan' and a 'gfpmask'. It should | 859 | * 'shrink' is passed a count 'nr_to_scan' and a 'gfpmask'. It should |
@@ -1061,7 +1052,8 @@ extern int __meminit __early_pfn_to_nid(unsigned long pfn); | |||
1061 | extern void set_dma_reserve(unsigned long new_dma_reserve); | 1052 | extern void set_dma_reserve(unsigned long new_dma_reserve); |
1062 | extern void memmap_init_zone(unsigned long, int, unsigned long, | 1053 | extern void memmap_init_zone(unsigned long, int, unsigned long, |
1063 | unsigned long, enum memmap_context); | 1054 | unsigned long, enum memmap_context); |
1064 | extern void setup_per_zone_pages_min(void); | 1055 | extern void setup_per_zone_wmarks(void); |
1056 | extern void calculate_zone_inactive_ratio(struct zone *zone); | ||
1065 | extern void mem_init(void); | 1057 | extern void mem_init(void); |
1066 | extern void __init mmap_init(void); | 1058 | extern void __init mmap_init(void); |
1067 | extern void show_mem(void); | 1059 | extern void show_mem(void); |
@@ -1178,8 +1170,6 @@ void task_dirty_inc(struct task_struct *tsk); | |||
1178 | #define VM_MAX_READAHEAD 128 /* kbytes */ | 1170 | #define VM_MAX_READAHEAD 128 /* kbytes */ |
1179 | #define VM_MIN_READAHEAD 16 /* kbytes (includes current page) */ | 1171 | #define VM_MIN_READAHEAD 16 /* kbytes (includes current page) */ |
1180 | 1172 | ||
1181 | int do_page_cache_readahead(struct address_space *mapping, struct file *filp, | ||
1182 | pgoff_t offset, unsigned long nr_to_read); | ||
1183 | int force_page_cache_readahead(struct address_space *mapping, struct file *filp, | 1173 | int force_page_cache_readahead(struct address_space *mapping, struct file *filp, |
1184 | pgoff_t offset, unsigned long nr_to_read); | 1174 | pgoff_t offset, unsigned long nr_to_read); |
1185 | 1175 | ||
@@ -1197,6 +1187,9 @@ void page_cache_async_readahead(struct address_space *mapping, | |||
1197 | unsigned long size); | 1187 | unsigned long size); |
1198 | 1188 | ||
1199 | unsigned long max_sane_readahead(unsigned long nr); | 1189 | unsigned long max_sane_readahead(unsigned long nr); |
1190 | unsigned long ra_submit(struct file_ra_state *ra, | ||
1191 | struct address_space *mapping, | ||
1192 | struct file *filp); | ||
1200 | 1193 | ||
1201 | /* Do stack extension */ | 1194 | /* Do stack extension */ |
1202 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); | 1195 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 0e80e26ecf21..7acc8439d9b3 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -98,6 +98,14 @@ struct page { | |||
98 | #ifdef CONFIG_WANT_PAGE_DEBUG_FLAGS | 98 | #ifdef CONFIG_WANT_PAGE_DEBUG_FLAGS |
99 | unsigned long debug_flags; /* Use atomic bitops on this */ | 99 | unsigned long debug_flags; /* Use atomic bitops on this */ |
100 | #endif | 100 | #endif |
101 | |||
102 | #ifdef CONFIG_KMEMCHECK | ||
103 | /* | ||
104 | * kmemcheck wants to track the status of each byte in a page; this | ||
105 | * is a pointer to such a status block. NULL if not tracked. | ||
106 | */ | ||
107 | void *shadow; | ||
108 | #endif | ||
101 | }; | 109 | }; |
102 | 110 | ||
103 | /* | 111 | /* |
@@ -232,6 +240,8 @@ struct mm_struct { | |||
232 | 240 | ||
233 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ | 241 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ |
234 | 242 | ||
243 | s8 oom_adj; /* OOM kill score adjustment (bit shift) */ | ||
244 | |||
235 | cpumask_t cpu_vm_mask; | 245 | cpumask_t cpu_vm_mask; |
236 | 246 | ||
237 | /* Architecture-specific MM context */ | 247 | /* Architecture-specific MM context */ |
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index c7211ab6dd4b..39751c8cde9c 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h | |||
@@ -28,4 +28,12 @@ | |||
28 | #define SDIO_DEVICE_ID_MARVELL_8688WLAN 0x9104 | 28 | #define SDIO_DEVICE_ID_MARVELL_8688WLAN 0x9104 |
29 | #define SDIO_DEVICE_ID_MARVELL_8688BT 0x9105 | 29 | #define SDIO_DEVICE_ID_MARVELL_8688BT 0x9105 |
30 | 30 | ||
31 | #define SDIO_VENDOR_ID_SIANO 0x039a | ||
32 | #define SDIO_DEVICE_ID_SIANO_NOVA_B0 0x0201 | ||
33 | #define SDIO_DEVICE_ID_SIANO_NICE 0x0202 | ||
34 | #define SDIO_DEVICE_ID_SIANO_VEGA_A0 0x0300 | ||
35 | #define SDIO_DEVICE_ID_SIANO_VENICE 0x0301 | ||
36 | #define SDIO_DEVICE_ID_SIANO_NOVA_A0 0x1100 | ||
37 | #define SDIO_DEVICE_ID_SIANO_STELLAR 0x5347 | ||
38 | |||
31 | #endif | 39 | #endif |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index a47c879e1304..889598537370 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -50,9 +50,6 @@ extern int page_group_by_mobility_disabled; | |||
50 | 50 | ||
51 | static inline int get_pageblock_migratetype(struct page *page) | 51 | static inline int get_pageblock_migratetype(struct page *page) |
52 | { | 52 | { |
53 | if (unlikely(page_group_by_mobility_disabled)) | ||
54 | return MIGRATE_UNMOVABLE; | ||
55 | |||
56 | return get_pageblock_flags_group(page, PB_migrate, PB_migrate_end); | 53 | return get_pageblock_flags_group(page, PB_migrate, PB_migrate_end); |
57 | } | 54 | } |
58 | 55 | ||
@@ -86,13 +83,8 @@ enum zone_stat_item { | |||
86 | NR_ACTIVE_ANON, /* " " " " " */ | 83 | NR_ACTIVE_ANON, /* " " " " " */ |
87 | NR_INACTIVE_FILE, /* " " " " " */ | 84 | NR_INACTIVE_FILE, /* " " " " " */ |
88 | NR_ACTIVE_FILE, /* " " " " " */ | 85 | NR_ACTIVE_FILE, /* " " " " " */ |
89 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
90 | NR_UNEVICTABLE, /* " " " " " */ | 86 | NR_UNEVICTABLE, /* " " " " " */ |
91 | NR_MLOCK, /* mlock()ed pages found and moved off LRU */ | 87 | NR_MLOCK, /* mlock()ed pages found and moved off LRU */ |
92 | #else | ||
93 | NR_UNEVICTABLE = NR_ACTIVE_FILE, /* avoid compiler errors in dead code */ | ||
94 | NR_MLOCK = NR_ACTIVE_FILE, | ||
95 | #endif | ||
96 | NR_ANON_PAGES, /* Mapped anonymous pages */ | 88 | NR_ANON_PAGES, /* Mapped anonymous pages */ |
97 | NR_FILE_MAPPED, /* pagecache pages mapped into pagetables. | 89 | NR_FILE_MAPPED, /* pagecache pages mapped into pagetables. |
98 | only modified from process context */ | 90 | only modified from process context */ |
@@ -135,11 +127,7 @@ enum lru_list { | |||
135 | LRU_ACTIVE_ANON = LRU_BASE + LRU_ACTIVE, | 127 | LRU_ACTIVE_ANON = LRU_BASE + LRU_ACTIVE, |
136 | LRU_INACTIVE_FILE = LRU_BASE + LRU_FILE, | 128 | LRU_INACTIVE_FILE = LRU_BASE + LRU_FILE, |
137 | LRU_ACTIVE_FILE = LRU_BASE + LRU_FILE + LRU_ACTIVE, | 129 | LRU_ACTIVE_FILE = LRU_BASE + LRU_FILE + LRU_ACTIVE, |
138 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
139 | LRU_UNEVICTABLE, | 130 | LRU_UNEVICTABLE, |
140 | #else | ||
141 | LRU_UNEVICTABLE = LRU_ACTIVE_FILE, /* avoid compiler errors in dead code */ | ||
142 | #endif | ||
143 | NR_LRU_LISTS | 131 | NR_LRU_LISTS |
144 | }; | 132 | }; |
145 | 133 | ||
@@ -159,13 +147,20 @@ static inline int is_active_lru(enum lru_list l) | |||
159 | 147 | ||
160 | static inline int is_unevictable_lru(enum lru_list l) | 148 | static inline int is_unevictable_lru(enum lru_list l) |
161 | { | 149 | { |
162 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
163 | return (l == LRU_UNEVICTABLE); | 150 | return (l == LRU_UNEVICTABLE); |
164 | #else | ||
165 | return 0; | ||
166 | #endif | ||
167 | } | 151 | } |
168 | 152 | ||
153 | enum zone_watermarks { | ||
154 | WMARK_MIN, | ||
155 | WMARK_LOW, | ||
156 | WMARK_HIGH, | ||
157 | NR_WMARK | ||
158 | }; | ||
159 | |||
160 | #define min_wmark_pages(z) (z->watermark[WMARK_MIN]) | ||
161 | #define low_wmark_pages(z) (z->watermark[WMARK_LOW]) | ||
162 | #define high_wmark_pages(z) (z->watermark[WMARK_HIGH]) | ||
163 | |||
169 | struct per_cpu_pages { | 164 | struct per_cpu_pages { |
170 | int count; /* number of pages in the list */ | 165 | int count; /* number of pages in the list */ |
171 | int high; /* high watermark, emptying needed */ | 166 | int high; /* high watermark, emptying needed */ |
@@ -278,7 +273,10 @@ struct zone_reclaim_stat { | |||
278 | 273 | ||
279 | struct zone { | 274 | struct zone { |
280 | /* Fields commonly accessed by the page allocator */ | 275 | /* Fields commonly accessed by the page allocator */ |
281 | unsigned long pages_min, pages_low, pages_high; | 276 | |
277 | /* zone watermarks, access with *_wmark_pages(zone) macros */ | ||
278 | unsigned long watermark[NR_WMARK]; | ||
279 | |||
282 | /* | 280 | /* |
283 | * We don't know if the memory that we're going to allocate will be freeable | 281 | * We don't know if the memory that we're going to allocate will be freeable |
284 | * or/and it will be released eventually, so to avoid totally wasting several | 282 | * or/and it will be released eventually, so to avoid totally wasting several |
@@ -323,9 +321,9 @@ struct zone { | |||
323 | 321 | ||
324 | /* Fields commonly accessed by the page reclaim scanner */ | 322 | /* Fields commonly accessed by the page reclaim scanner */ |
325 | spinlock_t lru_lock; | 323 | spinlock_t lru_lock; |
326 | struct { | 324 | struct zone_lru { |
327 | struct list_head list; | 325 | struct list_head list; |
328 | unsigned long nr_scan; | 326 | unsigned long nr_saved_scan; /* accumulated for batching */ |
329 | } lru[NR_LRU_LISTS]; | 327 | } lru[NR_LRU_LISTS]; |
330 | 328 | ||
331 | struct zone_reclaim_stat reclaim_stat; | 329 | struct zone_reclaim_stat reclaim_stat; |
diff --git a/include/linux/module.h b/include/linux/module.h index a7bc6e7b43a7..505f20dcc1c7 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -697,4 +697,21 @@ static inline void module_remove_modinfo_attrs(struct module *mod) | |||
697 | 697 | ||
698 | #define __MODULE_STRING(x) __stringify(x) | 698 | #define __MODULE_STRING(x) __stringify(x) |
699 | 699 | ||
700 | |||
701 | #ifdef CONFIG_GENERIC_BUG | ||
702 | int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, | ||
703 | struct module *); | ||
704 | void module_bug_cleanup(struct module *); | ||
705 | |||
706 | #else /* !CONFIG_GENERIC_BUG */ | ||
707 | |||
708 | static inline int module_bug_finalize(const Elf_Ehdr *hdr, | ||
709 | const Elf_Shdr *sechdrs, | ||
710 | struct module *mod) | ||
711 | { | ||
712 | return 0; | ||
713 | } | ||
714 | static inline void module_bug_cleanup(struct module *mod) {} | ||
715 | #endif /* CONFIG_GENERIC_BUG */ | ||
716 | |||
700 | #endif /* _LINUX_MODULE_H */ | 717 | #endif /* _LINUX_MODULE_H */ |
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index 6316fafe5c2a..6913b71d9ab2 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h | |||
@@ -132,6 +132,39 @@ struct ubi_device_info { | |||
132 | dev_t cdev; | 132 | dev_t cdev; |
133 | }; | 133 | }; |
134 | 134 | ||
135 | /* | ||
136 | * enum - volume notification types. | ||
137 | * @UBI_VOLUME_ADDED: volume has been added | ||
138 | * @UBI_VOLUME_REMOVED: start volume volume | ||
139 | * @UBI_VOLUME_RESIZED: volume size has been re-sized | ||
140 | * @UBI_VOLUME_RENAMED: volume name has been re-named | ||
141 | * @UBI_VOLUME_UPDATED: volume name has been updated | ||
142 | * | ||
143 | * These constants define which type of event has happened when a volume | ||
144 | * notification function is invoked. | ||
145 | */ | ||
146 | enum { | ||
147 | UBI_VOLUME_ADDED, | ||
148 | UBI_VOLUME_REMOVED, | ||
149 | UBI_VOLUME_RESIZED, | ||
150 | UBI_VOLUME_RENAMED, | ||
151 | UBI_VOLUME_UPDATED, | ||
152 | }; | ||
153 | |||
154 | /* | ||
155 | * struct ubi_notification - UBI notification description structure. | ||
156 | * @di: UBI device description object | ||
157 | * @vi: UBI volume description object | ||
158 | * | ||
159 | * UBI notifiers are called with a pointer to an object of this type. The | ||
160 | * object describes the notification. Namely, it provides a description of the | ||
161 | * UBI device and UBI volume the notification informs about. | ||
162 | */ | ||
163 | struct ubi_notification { | ||
164 | struct ubi_device_info di; | ||
165 | struct ubi_volume_info vi; | ||
166 | }; | ||
167 | |||
135 | /* UBI descriptor given to users when they open UBI volumes */ | 168 | /* UBI descriptor given to users when they open UBI volumes */ |
136 | struct ubi_volume_desc; | 169 | struct ubi_volume_desc; |
137 | 170 | ||
@@ -141,6 +174,10 @@ void ubi_get_volume_info(struct ubi_volume_desc *desc, | |||
141 | struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); | 174 | struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); |
142 | struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, | 175 | struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, |
143 | int mode); | 176 | int mode); |
177 | int ubi_register_volume_notifier(struct notifier_block *nb, | ||
178 | int ignore_existing); | ||
179 | int ubi_unregister_volume_notifier(struct notifier_block *nb); | ||
180 | |||
144 | void ubi_close_volume(struct ubi_volume_desc *desc); | 181 | void ubi_close_volume(struct ubi_volume_desc *desc); |
145 | int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, | 182 | int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, |
146 | int len, int check); | 183 | int len, int check); |
diff --git a/include/linux/nls.h b/include/linux/nls.h index 52b1a76c1b43..d47beef08dfd 100644 --- a/include/linux/nls.h +++ b/include/linux/nls.h | |||
@@ -3,8 +3,23 @@ | |||
3 | 3 | ||
4 | #include <linux/init.h> | 4 | #include <linux/init.h> |
5 | 5 | ||
6 | /* unicode character */ | 6 | /* Unicode has changed over the years. Unicode code points no longer |
7 | typedef __u16 wchar_t; | 7 | * fit into 16 bits; as of Unicode 5 valid code points range from 0 |
8 | * to 0x10ffff (17 planes, where each plane holds 65536 code points). | ||
9 | * | ||
10 | * The original decision to represent Unicode characters as 16-bit | ||
11 | * wchar_t values is now outdated. But plane 0 still includes the | ||
12 | * most commonly used characters, so we will retain it. The newer | ||
13 | * 32-bit unicode_t type can be used when it is necessary to | ||
14 | * represent the full Unicode character set. | ||
15 | */ | ||
16 | |||
17 | /* Plane-0 Unicode character */ | ||
18 | typedef u16 wchar_t; | ||
19 | #define MAX_WCHAR_T 0xffff | ||
20 | |||
21 | /* Arbitrary Unicode character */ | ||
22 | typedef u32 unicode_t; | ||
8 | 23 | ||
9 | struct nls_table { | 24 | struct nls_table { |
10 | const char *charset; | 25 | const char *charset; |
@@ -21,6 +36,13 @@ struct nls_table { | |||
21 | /* this value hold the maximum octet of charset */ | 36 | /* this value hold the maximum octet of charset */ |
22 | #define NLS_MAX_CHARSET_SIZE 6 /* for UTF-8 */ | 37 | #define NLS_MAX_CHARSET_SIZE 6 /* for UTF-8 */ |
23 | 38 | ||
39 | /* Byte order for UTF-16 strings */ | ||
40 | enum utf16_endian { | ||
41 | UTF16_HOST_ENDIAN, | ||
42 | UTF16_LITTLE_ENDIAN, | ||
43 | UTF16_BIG_ENDIAN | ||
44 | }; | ||
45 | |||
24 | /* nls.c */ | 46 | /* nls.c */ |
25 | extern int register_nls(struct nls_table *); | 47 | extern int register_nls(struct nls_table *); |
26 | extern int unregister_nls(struct nls_table *); | 48 | extern int unregister_nls(struct nls_table *); |
@@ -28,10 +50,11 @@ extern struct nls_table *load_nls(char *); | |||
28 | extern void unload_nls(struct nls_table *); | 50 | extern void unload_nls(struct nls_table *); |
29 | extern struct nls_table *load_nls_default(void); | 51 | extern struct nls_table *load_nls_default(void); |
30 | 52 | ||
31 | extern int utf8_mbtowc(wchar_t *, const __u8 *, int); | 53 | extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu); |
32 | extern int utf8_mbstowcs(wchar_t *, const __u8 *, int); | 54 | extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen); |
33 | extern int utf8_wctomb(__u8 *, wchar_t, int); | 55 | extern int utf8s_to_utf16s(const u8 *s, int len, wchar_t *pwcs); |
34 | extern int utf8_wcstombs(__u8 *, const wchar_t *, int); | 56 | extern int utf16s_to_utf8s(const wchar_t *pwcs, int len, |
57 | enum utf16_endian endian, u8 *s, int maxlen); | ||
35 | 58 | ||
36 | static inline unsigned char nls_tolower(struct nls_table *t, unsigned char c) | 59 | static inline unsigned char nls_tolower(struct nls_table *t, unsigned char c) |
37 | { | 60 | { |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 848025cd7087..829b94b156f2 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -408,6 +408,19 @@ static inline int num_node_state(enum node_states state) | |||
408 | #define next_online_node(nid) next_node((nid), node_states[N_ONLINE]) | 408 | #define next_online_node(nid) next_node((nid), node_states[N_ONLINE]) |
409 | 409 | ||
410 | extern int nr_node_ids; | 410 | extern int nr_node_ids; |
411 | extern int nr_online_nodes; | ||
412 | |||
413 | static inline void node_set_online(int nid) | ||
414 | { | ||
415 | node_set_state(nid, N_ONLINE); | ||
416 | nr_online_nodes = num_node_state(N_ONLINE); | ||
417 | } | ||
418 | |||
419 | static inline void node_set_offline(int nid) | ||
420 | { | ||
421 | node_clear_state(nid, N_ONLINE); | ||
422 | nr_online_nodes = num_node_state(N_ONLINE); | ||
423 | } | ||
411 | #else | 424 | #else |
412 | 425 | ||
413 | static inline int node_state(int node, enum node_states state) | 426 | static inline int node_state(int node, enum node_states state) |
@@ -434,7 +447,10 @@ static inline int num_node_state(enum node_states state) | |||
434 | #define first_online_node 0 | 447 | #define first_online_node 0 |
435 | #define next_online_node(nid) (MAX_NUMNODES) | 448 | #define next_online_node(nid) (MAX_NUMNODES) |
436 | #define nr_node_ids 1 | 449 | #define nr_node_ids 1 |
450 | #define nr_online_nodes 1 | ||
437 | 451 | ||
452 | #define node_set_online(node) node_set_state((node), N_ONLINE) | ||
453 | #define node_set_offline(node) node_clear_state((node), N_ONLINE) | ||
438 | #endif | 454 | #endif |
439 | 455 | ||
440 | #define node_online_map node_states[N_ONLINE] | 456 | #define node_online_map node_states[N_ONLINE] |
@@ -454,9 +470,6 @@ static inline int num_node_state(enum node_states state) | |||
454 | #define node_online(node) node_state((node), N_ONLINE) | 470 | #define node_online(node) node_state((node), N_ONLINE) |
455 | #define node_possible(node) node_state((node), N_POSSIBLE) | 471 | #define node_possible(node) node_state((node), N_POSSIBLE) |
456 | 472 | ||
457 | #define node_set_online(node) node_set_state((node), N_ONLINE) | ||
458 | #define node_set_offline(node) node_clear_state((node), N_ONLINE) | ||
459 | |||
460 | #define for_each_node(node) for_each_node_state(node, N_POSSIBLE) | 473 | #define for_each_node(node) for_each_node_state(node, N_POSSIBLE) |
461 | #define for_each_online_node(node) for_each_node_state(node, N_ONLINE) | 474 | #define for_each_online_node(node) for_each_node_state(node, N_ONLINE) |
462 | 475 | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 62214c7d2d93..e2e5ce543595 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -95,9 +95,7 @@ enum pageflags { | |||
95 | PG_reclaim, /* To be reclaimed asap */ | 95 | PG_reclaim, /* To be reclaimed asap */ |
96 | PG_buddy, /* Page is free, on buddy lists */ | 96 | PG_buddy, /* Page is free, on buddy lists */ |
97 | PG_swapbacked, /* Page is backed by RAM/swap */ | 97 | PG_swapbacked, /* Page is backed by RAM/swap */ |
98 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
99 | PG_unevictable, /* Page is "unevictable" */ | 98 | PG_unevictable, /* Page is "unevictable" */ |
100 | #endif | ||
101 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 99 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT |
102 | PG_mlocked, /* Page is vma mlocked */ | 100 | PG_mlocked, /* Page is vma mlocked */ |
103 | #endif | 101 | #endif |
@@ -120,7 +118,6 @@ enum pageflags { | |||
120 | PG_savepinned = PG_dirty, | 118 | PG_savepinned = PG_dirty, |
121 | 119 | ||
122 | /* SLOB */ | 120 | /* SLOB */ |
123 | PG_slob_page = PG_active, | ||
124 | PG_slob_free = PG_private, | 121 | PG_slob_free = PG_private, |
125 | 122 | ||
126 | /* SLUB */ | 123 | /* SLUB */ |
@@ -203,7 +200,6 @@ PAGEFLAG(SavePinned, savepinned); /* Xen */ | |||
203 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) | 200 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) |
204 | PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked) | 201 | PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked) |
205 | 202 | ||
206 | __PAGEFLAG(SlobPage, slob_page) | ||
207 | __PAGEFLAG(SlobFree, slob_free) | 203 | __PAGEFLAG(SlobFree, slob_free) |
208 | 204 | ||
209 | __PAGEFLAG(SlubFrozen, slub_frozen) | 205 | __PAGEFLAG(SlubFrozen, slub_frozen) |
@@ -248,14 +244,8 @@ PAGEFLAG_FALSE(SwapCache) | |||
248 | SETPAGEFLAG_NOOP(SwapCache) CLEARPAGEFLAG_NOOP(SwapCache) | 244 | SETPAGEFLAG_NOOP(SwapCache) CLEARPAGEFLAG_NOOP(SwapCache) |
249 | #endif | 245 | #endif |
250 | 246 | ||
251 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
252 | PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable) | 247 | PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable) |
253 | TESTCLEARFLAG(Unevictable, unevictable) | 248 | TESTCLEARFLAG(Unevictable, unevictable) |
254 | #else | ||
255 | PAGEFLAG_FALSE(Unevictable) TESTCLEARFLAG_FALSE(Unevictable) | ||
256 | SETPAGEFLAG_NOOP(Unevictable) CLEARPAGEFLAG_NOOP(Unevictable) | ||
257 | __CLEARPAGEFLAG_NOOP(Unevictable) | ||
258 | #endif | ||
259 | 249 | ||
260 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 250 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT |
261 | #define MLOCK_PAGES 1 | 251 | #define MLOCK_PAGES 1 |
@@ -382,12 +372,6 @@ static inline void __ClearPageTail(struct page *page) | |||
382 | 372 | ||
383 | #endif /* !PAGEFLAGS_EXTENDED */ | 373 | #endif /* !PAGEFLAGS_EXTENDED */ |
384 | 374 | ||
385 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
386 | #define __PG_UNEVICTABLE (1 << PG_unevictable) | ||
387 | #else | ||
388 | #define __PG_UNEVICTABLE 0 | ||
389 | #endif | ||
390 | |||
391 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 375 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT |
392 | #define __PG_MLOCKED (1 << PG_mlocked) | 376 | #define __PG_MLOCKED (1 << PG_mlocked) |
393 | #else | 377 | #else |
@@ -403,7 +387,7 @@ static inline void __ClearPageTail(struct page *page) | |||
403 | 1 << PG_private | 1 << PG_private_2 | \ | 387 | 1 << PG_private | 1 << PG_private_2 | \ |
404 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ | 388 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ |
405 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ | 389 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ |
406 | __PG_UNEVICTABLE | __PG_MLOCKED) | 390 | 1 << PG_unevictable | __PG_MLOCKED) |
407 | 391 | ||
408 | /* | 392 | /* |
409 | * Flags checked when a page is prepped for return by the page allocator. | 393 | * Flags checked when a page is prepped for return by the page allocator. |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 34da5230faab..aec3252afcf5 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -22,9 +22,7 @@ enum mapping_flags { | |||
22 | AS_EIO = __GFP_BITS_SHIFT + 0, /* IO error on async write */ | 22 | AS_EIO = __GFP_BITS_SHIFT + 0, /* IO error on async write */ |
23 | AS_ENOSPC = __GFP_BITS_SHIFT + 1, /* ENOSPC on async write */ | 23 | AS_ENOSPC = __GFP_BITS_SHIFT + 1, /* ENOSPC on async write */ |
24 | AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, /* under mm_take_all_locks() */ | 24 | AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, /* under mm_take_all_locks() */ |
25 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
26 | AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3, /* e.g., ramdisk, SHM_LOCK */ | 25 | AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3, /* e.g., ramdisk, SHM_LOCK */ |
27 | #endif | ||
28 | }; | 26 | }; |
29 | 27 | ||
30 | static inline void mapping_set_error(struct address_space *mapping, int error) | 28 | static inline void mapping_set_error(struct address_space *mapping, int error) |
@@ -37,8 +35,6 @@ static inline void mapping_set_error(struct address_space *mapping, int error) | |||
37 | } | 35 | } |
38 | } | 36 | } |
39 | 37 | ||
40 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
41 | |||
42 | static inline void mapping_set_unevictable(struct address_space *mapping) | 38 | static inline void mapping_set_unevictable(struct address_space *mapping) |
43 | { | 39 | { |
44 | set_bit(AS_UNEVICTABLE, &mapping->flags); | 40 | set_bit(AS_UNEVICTABLE, &mapping->flags); |
@@ -55,14 +51,6 @@ static inline int mapping_unevictable(struct address_space *mapping) | |||
55 | return test_bit(AS_UNEVICTABLE, &mapping->flags); | 51 | return test_bit(AS_UNEVICTABLE, &mapping->flags); |
56 | return !!mapping; | 52 | return !!mapping; |
57 | } | 53 | } |
58 | #else | ||
59 | static inline void mapping_set_unevictable(struct address_space *mapping) { } | ||
60 | static inline void mapping_clear_unevictable(struct address_space *mapping) { } | ||
61 | static inline int mapping_unevictable(struct address_space *mapping) | ||
62 | { | ||
63 | return 0; | ||
64 | } | ||
65 | #endif | ||
66 | 54 | ||
67 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) | 55 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) |
68 | { | 56 | { |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 72698d89e767..8e366bb0705f 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -124,6 +124,14 @@ typedef int __bitwise pci_power_t; | |||
124 | #define PCI_UNKNOWN ((pci_power_t __force) 5) | 124 | #define PCI_UNKNOWN ((pci_power_t __force) 5) |
125 | #define PCI_POWER_ERROR ((pci_power_t __force) -1) | 125 | #define PCI_POWER_ERROR ((pci_power_t __force) -1) |
126 | 126 | ||
127 | /* Remember to update this when the list above changes! */ | ||
128 | extern const char *pci_power_names[]; | ||
129 | |||
130 | static inline const char *pci_power_name(pci_power_t state) | ||
131 | { | ||
132 | return pci_power_names[1 + (int) state]; | ||
133 | } | ||
134 | |||
127 | #define PCI_PM_D2_DELAY 200 | 135 | #define PCI_PM_D2_DELAY 200 |
128 | #define PCI_PM_D3_WAIT 10 | 136 | #define PCI_PM_D3_WAIT 10 |
129 | #define PCI_PM_BUS_WAIT 50 | 137 | #define PCI_PM_BUS_WAIT 50 |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index aa01d38c9971..a3b000365795 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -104,6 +104,7 @@ | |||
104 | #define PCI_CLASS_SERIAL_USB_UHCI 0x0c0300 | 104 | #define PCI_CLASS_SERIAL_USB_UHCI 0x0c0300 |
105 | #define PCI_CLASS_SERIAL_USB_OHCI 0x0c0310 | 105 | #define PCI_CLASS_SERIAL_USB_OHCI 0x0c0310 |
106 | #define PCI_CLASS_SERIAL_USB_EHCI 0x0c0320 | 106 | #define PCI_CLASS_SERIAL_USB_EHCI 0x0c0320 |
107 | #define PCI_CLASS_SERIAL_USB_XHCI 0x0c0330 | ||
107 | #define PCI_CLASS_SERIAL_FIBER 0x0c04 | 108 | #define PCI_CLASS_SERIAL_FIBER 0x0c04 |
108 | #define PCI_CLASS_SERIAL_SMBUS 0x0c05 | 109 | #define PCI_CLASS_SERIAL_SMBUS 0x0c05 |
109 | 110 | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index b67bb5d7b221..8dc5123b6305 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -36,8 +36,8 @@ extern struct device platform_bus; | |||
36 | 36 | ||
37 | extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); | 37 | extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); |
38 | extern int platform_get_irq(struct platform_device *, unsigned int); | 38 | extern int platform_get_irq(struct platform_device *, unsigned int); |
39 | extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, char *); | 39 | extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *); |
40 | extern int platform_get_irq_byname(struct platform_device *, char *); | 40 | extern int platform_get_irq_byname(struct platform_device *, const char *); |
41 | extern int platform_add_devices(struct platform_device **, int); | 41 | extern int platform_add_devices(struct platform_device **, int); |
42 | 42 | ||
43 | extern struct platform_device *platform_device_register_simple(const char *, int id, | 43 | extern struct platform_device *platform_device_register_simple(const char *, int id, |
diff --git a/include/linux/poll.h b/include/linux/poll.h index 8c24ef8d9976..fa287f25138d 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h | |||
@@ -32,6 +32,7 @@ typedef void (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_ | |||
32 | 32 | ||
33 | typedef struct poll_table_struct { | 33 | typedef struct poll_table_struct { |
34 | poll_queue_proc qproc; | 34 | poll_queue_proc qproc; |
35 | unsigned long key; | ||
35 | } poll_table; | 36 | } poll_table; |
36 | 37 | ||
37 | static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p) | 38 | static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p) |
@@ -43,10 +44,12 @@ static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_addres | |||
43 | static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) | 44 | static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) |
44 | { | 45 | { |
45 | pt->qproc = qproc; | 46 | pt->qproc = qproc; |
47 | pt->key = ~0UL; /* all events enabled */ | ||
46 | } | 48 | } |
47 | 49 | ||
48 | struct poll_table_entry { | 50 | struct poll_table_entry { |
49 | struct file *filp; | 51 | struct file *filp; |
52 | unsigned long key; | ||
50 | wait_queue_t wait; | 53 | wait_queue_t wait; |
51 | wait_queue_head_t *wait_address; | 54 | wait_queue_head_t *wait_address; |
52 | }; | 55 | }; |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 355f6e80db0d..c5da74918096 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -167,6 +167,8 @@ radix_tree_gang_lookup_slot(struct radix_tree_root *root, void ***results, | |||
167 | unsigned long first_index, unsigned int max_items); | 167 | unsigned long first_index, unsigned int max_items); |
168 | unsigned long radix_tree_next_hole(struct radix_tree_root *root, | 168 | unsigned long radix_tree_next_hole(struct radix_tree_root *root, |
169 | unsigned long index, unsigned long max_scan); | 169 | unsigned long index, unsigned long max_scan); |
170 | unsigned long radix_tree_prev_hole(struct radix_tree_root *root, | ||
171 | unsigned long index, unsigned long max_scan); | ||
170 | int radix_tree_preload(gfp_t gfp_mask); | 172 | int radix_tree_preload(gfp_t gfp_mask); |
171 | void radix_tree_init(void); | 173 | void radix_tree_init(void); |
172 | void *radix_tree_tag_set(struct radix_tree_root *root, | 174 | void *radix_tree_tag_set(struct radix_tree_root *root, |
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 8670f1575fe1..29f8599e6bea 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _LINUX_RING_BUFFER_H | 1 | #ifndef _LINUX_RING_BUFFER_H |
2 | #define _LINUX_RING_BUFFER_H | 2 | #define _LINUX_RING_BUFFER_H |
3 | 3 | ||
4 | #include <linux/kmemcheck.h> | ||
4 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
5 | #include <linux/seq_file.h> | 6 | #include <linux/seq_file.h> |
6 | 7 | ||
@@ -11,7 +12,10 @@ struct ring_buffer_iter; | |||
11 | * Don't refer to this struct directly, use functions below. | 12 | * Don't refer to this struct directly, use functions below. |
12 | */ | 13 | */ |
13 | struct ring_buffer_event { | 14 | struct ring_buffer_event { |
15 | kmemcheck_bitfield_begin(bitfield); | ||
14 | u32 type_len:5, time_delta:27; | 16 | u32 type_len:5, time_delta:27; |
17 | kmemcheck_bitfield_end(bitfield); | ||
18 | |||
15 | u32 array[]; | 19 | u32 array[]; |
16 | }; | 20 | }; |
17 | 21 | ||
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index b35bc0e19cd9..216d024f830d 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -83,7 +83,8 @@ static inline void page_dup_rmap(struct page *page, struct vm_area_struct *vma, | |||
83 | /* | 83 | /* |
84 | * Called from mm/vmscan.c to handle paging out | 84 | * Called from mm/vmscan.c to handle paging out |
85 | */ | 85 | */ |
86 | int page_referenced(struct page *, int is_locked, struct mem_cgroup *cnt); | 86 | int page_referenced(struct page *, int is_locked, |
87 | struct mem_cgroup *cnt, unsigned long *vm_flags); | ||
87 | int try_to_unmap(struct page *, int ignore_refs); | 88 | int try_to_unmap(struct page *, int ignore_refs); |
88 | 89 | ||
89 | /* | 90 | /* |
@@ -105,18 +106,11 @@ unsigned long page_address_in_vma(struct page *, struct vm_area_struct *); | |||
105 | */ | 106 | */ |
106 | int page_mkclean(struct page *); | 107 | int page_mkclean(struct page *); |
107 | 108 | ||
108 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
109 | /* | 109 | /* |
110 | * called in munlock()/munmap() path to check for other vmas holding | 110 | * called in munlock()/munmap() path to check for other vmas holding |
111 | * the page mlocked. | 111 | * the page mlocked. |
112 | */ | 112 | */ |
113 | int try_to_munlock(struct page *); | 113 | int try_to_munlock(struct page *); |
114 | #else | ||
115 | static inline int try_to_munlock(struct page *page) | ||
116 | { | ||
117 | return 0; /* a.k.a. SWAP_SUCCESS */ | ||
118 | } | ||
119 | #endif | ||
120 | 114 | ||
121 | #else /* !CONFIG_MMU */ | 115 | #else /* !CONFIG_MMU */ |
122 | 116 | ||
@@ -124,7 +118,7 @@ static inline int try_to_munlock(struct page *page) | |||
124 | #define anon_vma_prepare(vma) (0) | 118 | #define anon_vma_prepare(vma) (0) |
125 | #define anon_vma_link(vma) do {} while (0) | 119 | #define anon_vma_link(vma) do {} while (0) |
126 | 120 | ||
127 | #define page_referenced(page,l,cnt) TestClearPageReferenced(page) | 121 | #define page_referenced(page, locked, cnt, flags) TestClearPageReferenced(page) |
128 | #define try_to_unmap(page, refs) SWAP_FAIL | 122 | #define try_to_unmap(page, refs) SWAP_FAIL |
129 | 123 | ||
130 | static inline int page_mkclean(struct page *page) | 124 | static inline int page_mkclean(struct page *page) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index c900aa530070..02042e7f2196 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -674,7 +674,7 @@ struct user_struct { | |||
674 | struct task_group *tg; | 674 | struct task_group *tg; |
675 | #ifdef CONFIG_SYSFS | 675 | #ifdef CONFIG_SYSFS |
676 | struct kobject kobj; | 676 | struct kobject kobj; |
677 | struct work_struct work; | 677 | struct delayed_work work; |
678 | #endif | 678 | #endif |
679 | #endif | 679 | #endif |
680 | 680 | ||
@@ -1178,7 +1178,6 @@ struct task_struct { | |||
1178 | * a short time | 1178 | * a short time |
1179 | */ | 1179 | */ |
1180 | unsigned char fpu_counter; | 1180 | unsigned char fpu_counter; |
1181 | s8 oomkilladj; /* OOM kill score adjustment (bit shift). */ | ||
1182 | #ifdef CONFIG_BLK_DEV_IO_TRACE | 1181 | #ifdef CONFIG_BLK_DEV_IO_TRACE |
1183 | unsigned int btrace_seq; | 1182 | unsigned int btrace_seq; |
1184 | #endif | 1183 | #endif |
@@ -1318,7 +1317,8 @@ struct task_struct { | |||
1318 | /* Thread group tracking */ | 1317 | /* Thread group tracking */ |
1319 | u32 parent_exec_id; | 1318 | u32 parent_exec_id; |
1320 | u32 self_exec_id; | 1319 | u32 self_exec_id; |
1321 | /* Protection of (de-)allocation: mm, files, fs, tty, keyrings */ | 1320 | /* Protection of (de-)allocation: mm, files, fs, tty, keyrings, mems_allowed, |
1321 | * mempolicy */ | ||
1322 | spinlock_t alloc_lock; | 1322 | spinlock_t alloc_lock; |
1323 | 1323 | ||
1324 | #ifdef CONFIG_GENERIC_HARDIRQS | 1324 | #ifdef CONFIG_GENERIC_HARDIRQS |
@@ -1386,8 +1386,7 @@ struct task_struct { | |||
1386 | cputime_t acct_timexpd; /* stime + utime since last update */ | 1386 | cputime_t acct_timexpd; /* stime + utime since last update */ |
1387 | #endif | 1387 | #endif |
1388 | #ifdef CONFIG_CPUSETS | 1388 | #ifdef CONFIG_CPUSETS |
1389 | nodemask_t mems_allowed; | 1389 | nodemask_t mems_allowed; /* Protected by alloc_lock */ |
1390 | int cpuset_mems_generation; | ||
1391 | int cpuset_mem_spread_rotor; | 1390 | int cpuset_mem_spread_rotor; |
1392 | #endif | 1391 | #endif |
1393 | #ifdef CONFIG_CGROUPS | 1392 | #ifdef CONFIG_CGROUPS |
@@ -1410,7 +1409,7 @@ struct task_struct { | |||
1410 | struct list_head perf_counter_list; | 1409 | struct list_head perf_counter_list; |
1411 | #endif | 1410 | #endif |
1412 | #ifdef CONFIG_NUMA | 1411 | #ifdef CONFIG_NUMA |
1413 | struct mempolicy *mempolicy; | 1412 | struct mempolicy *mempolicy; /* Protected by alloc_lock */ |
1414 | short il_next; | 1413 | short il_next; |
1415 | #endif | 1414 | #endif |
1416 | atomic_t fs_excl; /* holding fs exclusive resources */ | 1415 | atomic_t fs_excl; /* holding fs exclusive resources */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index fa51293f2708..63ef24bc01d0 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define _LINUX_SKBUFF_H | 15 | #define _LINUX_SKBUFF_H |
16 | 16 | ||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/kmemcheck.h> | ||
18 | #include <linux/compiler.h> | 19 | #include <linux/compiler.h> |
19 | #include <linux/time.h> | 20 | #include <linux/time.h> |
20 | #include <linux/cache.h> | 21 | #include <linux/cache.h> |
@@ -343,6 +344,7 @@ struct sk_buff { | |||
343 | }; | 344 | }; |
344 | }; | 345 | }; |
345 | __u32 priority; | 346 | __u32 priority; |
347 | kmemcheck_bitfield_begin(flags1); | ||
346 | __u8 local_df:1, | 348 | __u8 local_df:1, |
347 | cloned:1, | 349 | cloned:1, |
348 | ip_summed:2, | 350 | ip_summed:2, |
@@ -353,6 +355,7 @@ struct sk_buff { | |||
353 | ipvs_property:1, | 355 | ipvs_property:1, |
354 | peeked:1, | 356 | peeked:1, |
355 | nf_trace:1; | 357 | nf_trace:1; |
358 | kmemcheck_bitfield_end(flags1); | ||
356 | __be16 protocol; | 359 | __be16 protocol; |
357 | 360 | ||
358 | void (*destructor)(struct sk_buff *skb); | 361 | void (*destructor)(struct sk_buff *skb); |
@@ -372,12 +375,16 @@ struct sk_buff { | |||
372 | __u16 tc_verd; /* traffic control verdict */ | 375 | __u16 tc_verd; /* traffic control verdict */ |
373 | #endif | 376 | #endif |
374 | #endif | 377 | #endif |
378 | |||
379 | kmemcheck_bitfield_begin(flags2); | ||
375 | #ifdef CONFIG_IPV6_NDISC_NODETYPE | 380 | #ifdef CONFIG_IPV6_NDISC_NODETYPE |
376 | __u8 ndisc_nodetype:2; | 381 | __u8 ndisc_nodetype:2; |
377 | #endif | 382 | #endif |
378 | #if defined(CONFIG_MAC80211) || defined(CONFIG_MAC80211_MODULE) | 383 | #if defined(CONFIG_MAC80211) || defined(CONFIG_MAC80211_MODULE) |
379 | __u8 do_not_encrypt:1; | 384 | __u8 do_not_encrypt:1; |
380 | #endif | 385 | #endif |
386 | kmemcheck_bitfield_end(flags2); | ||
387 | |||
381 | /* 0/13/14 bit hole */ | 388 | /* 0/13/14 bit hole */ |
382 | 389 | ||
383 | #ifdef CONFIG_NET_DMA | 390 | #ifdef CONFIG_NET_DMA |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 219b8fb4651d..2da8372519f5 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -64,6 +64,13 @@ | |||
64 | 64 | ||
65 | #define SLAB_NOLEAKTRACE 0x00800000UL /* Avoid kmemleak tracing */ | 65 | #define SLAB_NOLEAKTRACE 0x00800000UL /* Avoid kmemleak tracing */ |
66 | 66 | ||
67 | /* Don't track use of uninitialized memory */ | ||
68 | #ifdef CONFIG_KMEMCHECK | ||
69 | # define SLAB_NOTRACK 0x01000000UL | ||
70 | #else | ||
71 | # define SLAB_NOTRACK 0x00000000UL | ||
72 | #endif | ||
73 | |||
67 | /* The following flags affect the page allocator grouping pages by mobility */ | 74 | /* The following flags affect the page allocator grouping pages by mobility */ |
68 | #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ | 75 | #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ |
69 | #define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Objects are short-lived */ | 76 | #define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Objects are short-lived */ |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 713f841ecaa9..850d057500de 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
@@ -16,6 +16,87 @@ | |||
16 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
17 | #include <linux/kmemtrace.h> | 17 | #include <linux/kmemtrace.h> |
18 | 18 | ||
19 | /* | ||
20 | * struct kmem_cache | ||
21 | * | ||
22 | * manages a cache. | ||
23 | */ | ||
24 | |||
25 | struct kmem_cache { | ||
26 | /* 1) per-cpu data, touched during every alloc/free */ | ||
27 | struct array_cache *array[NR_CPUS]; | ||
28 | /* 2) Cache tunables. Protected by cache_chain_mutex */ | ||
29 | unsigned int batchcount; | ||
30 | unsigned int limit; | ||
31 | unsigned int shared; | ||
32 | |||
33 | unsigned int buffer_size; | ||
34 | u32 reciprocal_buffer_size; | ||
35 | /* 3) touched by every alloc & free from the backend */ | ||
36 | |||
37 | unsigned int flags; /* constant flags */ | ||
38 | unsigned int num; /* # of objs per slab */ | ||
39 | |||
40 | /* 4) cache_grow/shrink */ | ||
41 | /* order of pgs per slab (2^n) */ | ||
42 | unsigned int gfporder; | ||
43 | |||
44 | /* force GFP flags, e.g. GFP_DMA */ | ||
45 | gfp_t gfpflags; | ||
46 | |||
47 | size_t colour; /* cache colouring range */ | ||
48 | unsigned int colour_off; /* colour offset */ | ||
49 | struct kmem_cache *slabp_cache; | ||
50 | unsigned int slab_size; | ||
51 | unsigned int dflags; /* dynamic flags */ | ||
52 | |||
53 | /* constructor func */ | ||
54 | void (*ctor)(void *obj); | ||
55 | |||
56 | /* 5) cache creation/removal */ | ||
57 | const char *name; | ||
58 | struct list_head next; | ||
59 | |||
60 | /* 6) statistics */ | ||
61 | #ifdef CONFIG_DEBUG_SLAB | ||
62 | unsigned long num_active; | ||
63 | unsigned long num_allocations; | ||
64 | unsigned long high_mark; | ||
65 | unsigned long grown; | ||
66 | unsigned long reaped; | ||
67 | unsigned long errors; | ||
68 | unsigned long max_freeable; | ||
69 | unsigned long node_allocs; | ||
70 | unsigned long node_frees; | ||
71 | unsigned long node_overflow; | ||
72 | atomic_t allochit; | ||
73 | atomic_t allocmiss; | ||
74 | atomic_t freehit; | ||
75 | atomic_t freemiss; | ||
76 | |||
77 | /* | ||
78 | * If debugging is enabled, then the allocator can add additional | ||
79 | * fields and/or padding to every object. buffer_size contains the total | ||
80 | * object size including these internal fields, the following two | ||
81 | * variables contain the offset to the user object and its size. | ||
82 | */ | ||
83 | int obj_offset; | ||
84 | int obj_size; | ||
85 | #endif /* CONFIG_DEBUG_SLAB */ | ||
86 | |||
87 | /* | ||
88 | * We put nodelists[] at the end of kmem_cache, because we want to size | ||
89 | * this array to nr_node_ids slots instead of MAX_NUMNODES | ||
90 | * (see kmem_cache_init()) | ||
91 | * We still use [MAX_NUMNODES] and not [1] or [0] because cache_cache | ||
92 | * is statically defined, so we reserve the max number of nodes. | ||
93 | */ | ||
94 | struct kmem_list3 *nodelists[MAX_NUMNODES]; | ||
95 | /* | ||
96 | * Do not add fields after nodelists[] | ||
97 | */ | ||
98 | }; | ||
99 | |||
19 | /* Size description struct for general caches. */ | 100 | /* Size description struct for general caches. */ |
20 | struct cache_sizes { | 101 | struct cache_sizes { |
21 | size_t cs_size; | 102 | size_t cs_size; |
diff --git a/include/linux/smp.h b/include/linux/smp.h index a69db820eed6..9e3d8af09207 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -177,7 +177,6 @@ static inline void init_call_single_data(void) | |||
177 | 177 | ||
178 | #define get_cpu() ({ preempt_disable(); smp_processor_id(); }) | 178 | #define get_cpu() ({ preempt_disable(); smp_processor_id(); }) |
179 | #define put_cpu() preempt_enable() | 179 | #define put_cpu() preempt_enable() |
180 | #define put_cpu_no_resched() preempt_enable_no_resched() | ||
181 | 180 | ||
182 | /* | 181 | /* |
183 | * Callback to arch code if there's nosmp or maxcpus=0 on the | 182 | * Callback to arch code if there's nosmp or maxcpus=0 on the |
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index 1a8cecc4f38c..51efbef38fb0 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h | |||
@@ -4,6 +4,8 @@ | |||
4 | struct task_struct; | 4 | struct task_struct; |
5 | 5 | ||
6 | #ifdef CONFIG_STACKTRACE | 6 | #ifdef CONFIG_STACKTRACE |
7 | struct task_struct; | ||
8 | |||
7 | struct stack_trace { | 9 | struct stack_trace { |
8 | unsigned int nr_entries, max_entries; | 10 | unsigned int nr_entries, max_entries; |
9 | unsigned long *entries; | 11 | unsigned long *entries; |
@@ -11,6 +13,7 @@ struct stack_trace { | |||
11 | }; | 13 | }; |
12 | 14 | ||
13 | extern void save_stack_trace(struct stack_trace *trace); | 15 | extern void save_stack_trace(struct stack_trace *trace); |
16 | extern void save_stack_trace_bp(struct stack_trace *trace, unsigned long bp); | ||
14 | extern void save_stack_trace_tsk(struct task_struct *tsk, | 17 | extern void save_stack_trace_tsk(struct task_struct *tsk, |
15 | struct stack_trace *trace); | 18 | struct stack_trace *trace); |
16 | 19 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index d476aad3ff57..0cedf31af0b0 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -129,9 +129,10 @@ enum { | |||
129 | 129 | ||
130 | #define SWAP_CLUSTER_MAX 32 | 130 | #define SWAP_CLUSTER_MAX 32 |
131 | 131 | ||
132 | #define SWAP_MAP_MAX 0x7fff | 132 | #define SWAP_MAP_MAX 0x7ffe |
133 | #define SWAP_MAP_BAD 0x8000 | 133 | #define SWAP_MAP_BAD 0x7fff |
134 | 134 | #define SWAP_HAS_CACHE 0x8000 /* There is a swap cache of entry. */ | |
135 | #define SWAP_COUNT_MASK (~SWAP_HAS_CACHE) | ||
135 | /* | 136 | /* |
136 | * The in-memory structure used to track swap areas. | 137 | * The in-memory structure used to track swap areas. |
137 | */ | 138 | */ |
@@ -235,7 +236,6 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) | |||
235 | } | 236 | } |
236 | #endif | 237 | #endif |
237 | 238 | ||
238 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
239 | extern int page_evictable(struct page *page, struct vm_area_struct *vma); | 239 | extern int page_evictable(struct page *page, struct vm_area_struct *vma); |
240 | extern void scan_mapping_unevictable_pages(struct address_space *); | 240 | extern void scan_mapping_unevictable_pages(struct address_space *); |
241 | 241 | ||
@@ -244,24 +244,6 @@ extern int scan_unevictable_handler(struct ctl_table *, int, struct file *, | |||
244 | void __user *, size_t *, loff_t *); | 244 | void __user *, size_t *, loff_t *); |
245 | extern int scan_unevictable_register_node(struct node *node); | 245 | extern int scan_unevictable_register_node(struct node *node); |
246 | extern void scan_unevictable_unregister_node(struct node *node); | 246 | extern void scan_unevictable_unregister_node(struct node *node); |
247 | #else | ||
248 | static inline int page_evictable(struct page *page, | ||
249 | struct vm_area_struct *vma) | ||
250 | { | ||
251 | return 1; | ||
252 | } | ||
253 | |||
254 | static inline void scan_mapping_unevictable_pages(struct address_space *mapping) | ||
255 | { | ||
256 | } | ||
257 | |||
258 | static inline int scan_unevictable_register_node(struct node *node) | ||
259 | { | ||
260 | return 0; | ||
261 | } | ||
262 | |||
263 | static inline void scan_unevictable_unregister_node(struct node *node) { } | ||
264 | #endif | ||
265 | 247 | ||
266 | extern int kswapd_run(int nid); | 248 | extern int kswapd_run(int nid); |
267 | 249 | ||
@@ -274,7 +256,7 @@ extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *); | |||
274 | 256 | ||
275 | #ifdef CONFIG_SWAP | 257 | #ifdef CONFIG_SWAP |
276 | /* linux/mm/page_io.c */ | 258 | /* linux/mm/page_io.c */ |
277 | extern int swap_readpage(struct file *, struct page *); | 259 | extern int swap_readpage(struct page *); |
278 | extern int swap_writepage(struct page *page, struct writeback_control *wbc); | 260 | extern int swap_writepage(struct page *page, struct writeback_control *wbc); |
279 | extern void end_swap_bio_read(struct bio *bio, int err); | 261 | extern void end_swap_bio_read(struct bio *bio, int err); |
280 | 262 | ||
@@ -300,9 +282,11 @@ extern long total_swap_pages; | |||
300 | extern void si_swapinfo(struct sysinfo *); | 282 | extern void si_swapinfo(struct sysinfo *); |
301 | extern swp_entry_t get_swap_page(void); | 283 | extern swp_entry_t get_swap_page(void); |
302 | extern swp_entry_t get_swap_page_of_type(int); | 284 | extern swp_entry_t get_swap_page_of_type(int); |
303 | extern int swap_duplicate(swp_entry_t); | 285 | extern void swap_duplicate(swp_entry_t); |
286 | extern int swapcache_prepare(swp_entry_t); | ||
304 | extern int valid_swaphandles(swp_entry_t, unsigned long *); | 287 | extern int valid_swaphandles(swp_entry_t, unsigned long *); |
305 | extern void swap_free(swp_entry_t); | 288 | extern void swap_free(swp_entry_t); |
289 | extern void swapcache_free(swp_entry_t, struct page *page); | ||
306 | extern int free_swap_and_cache(swp_entry_t); | 290 | extern int free_swap_and_cache(swp_entry_t); |
307 | extern int swap_type_of(dev_t, sector_t, struct block_device **); | 291 | extern int swap_type_of(dev_t, sector_t, struct block_device **); |
308 | extern unsigned int count_swap_pages(int, int); | 292 | extern unsigned int count_swap_pages(int, int); |
@@ -370,12 +354,20 @@ static inline void show_swap_cache_info(void) | |||
370 | } | 354 | } |
371 | 355 | ||
372 | #define free_swap_and_cache(swp) is_migration_entry(swp) | 356 | #define free_swap_and_cache(swp) is_migration_entry(swp) |
373 | #define swap_duplicate(swp) is_migration_entry(swp) | 357 | #define swapcache_prepare(swp) is_migration_entry(swp) |
358 | |||
359 | static inline void swap_duplicate(swp_entry_t swp) | ||
360 | { | ||
361 | } | ||
374 | 362 | ||
375 | static inline void swap_free(swp_entry_t swp) | 363 | static inline void swap_free(swp_entry_t swp) |
376 | { | 364 | { |
377 | } | 365 | } |
378 | 366 | ||
367 | static inline void swapcache_free(swp_entry_t swp, struct page *page) | ||
368 | { | ||
369 | } | ||
370 | |||
379 | static inline struct page *swapin_readahead(swp_entry_t swp, gfp_t gfp_mask, | 371 | static inline struct page *swapin_readahead(swp_entry_t swp, gfp_t gfp_mask, |
380 | struct vm_area_struct *vma, unsigned long addr) | 372 | struct vm_area_struct *vma, unsigned long addr) |
381 | { | 373 | { |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 418d90f5effe..fa4242cdade8 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -434,6 +434,7 @@ asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg); | |||
434 | asmlinkage long sys_fcntl64(unsigned int fd, | 434 | asmlinkage long sys_fcntl64(unsigned int fd, |
435 | unsigned int cmd, unsigned long arg); | 435 | unsigned int cmd, unsigned long arg); |
436 | #endif | 436 | #endif |
437 | asmlinkage long sys_pipe(int __user *fildes); | ||
437 | asmlinkage long sys_pipe2(int __user *fildes, int flags); | 438 | asmlinkage long sys_pipe2(int __user *fildes, int flags); |
438 | asmlinkage long sys_dup(unsigned int fildes); | 439 | asmlinkage long sys_dup(unsigned int fildes); |
439 | asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd); | 440 | asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd); |
@@ -751,8 +752,6 @@ asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *, | |||
751 | asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, | 752 | asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, |
752 | struct timespec __user *, const sigset_t __user *, | 753 | struct timespec __user *, const sigset_t __user *, |
753 | size_t); | 754 | size_t); |
754 | asmlinkage long sys_pipe2(int __user *, int); | ||
755 | asmlinkage long sys_pipe(int __user *); | ||
756 | 755 | ||
757 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | 756 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); |
758 | 757 | ||
diff --git a/include/linux/timex.h b/include/linux/timex.h index 9910e3bd5b31..e6967d10d9e5 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -280,6 +280,9 @@ extern int do_adjtimex(struct timex *); | |||
280 | 280 | ||
281 | int read_current_timer(unsigned long *timer_val); | 281 | int read_current_timer(unsigned long *timer_val); |
282 | 282 | ||
283 | /* The clock frequency of the i8253/i8254 PIT */ | ||
284 | #define PIT_TICK_RATE 1193182ul | ||
285 | |||
283 | #endif /* KERNEL */ | 286 | #endif /* KERNEL */ |
284 | 287 | ||
285 | #endif /* LINUX_TIMEX_H */ | 288 | #endif /* LINUX_TIMEX_H */ |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 14df7e635d43..b9dc4ca0246f 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -198,7 +198,7 @@ static inline void tracepoint_synchronize_unregister(void) | |||
198 | * * This is how the trace record is structured and will | 198 | * * This is how the trace record is structured and will |
199 | * * be saved into the ring buffer. These are the fields | 199 | * * be saved into the ring buffer. These are the fields |
200 | * * that will be exposed to user-space in | 200 | * * that will be exposed to user-space in |
201 | * * /debug/tracing/events/<*>/format. | 201 | * * /sys/kernel/debug/tracing/events/<*>/format. |
202 | * * | 202 | * * |
203 | * * The declared 'local variable' is called '__entry' | 203 | * * The declared 'local variable' is called '__entry' |
204 | * * | 204 | * * |
@@ -258,7 +258,7 @@ static inline void tracepoint_synchronize_unregister(void) | |||
258 | * tracepoint callback (this is used by programmatic plugins and | 258 | * tracepoint callback (this is used by programmatic plugins and |
259 | * can also by used by generic instrumentation like SystemTap), and | 259 | * can also by used by generic instrumentation like SystemTap), and |
260 | * it is also used to expose a structured trace record in | 260 | * it is also used to expose a structured trace record in |
261 | * /debug/tracing/events/. | 261 | * /sys/kernel/debug/tracing/events/. |
262 | */ | 262 | */ |
263 | 263 | ||
264 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ | 264 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 3aa2cd1f8d08..84929e914034 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -36,6 +36,7 @@ struct wusb_dev; | |||
36 | * - configs have one (often) or more interfaces; | 36 | * - configs have one (often) or more interfaces; |
37 | * - interfaces have one (usually) or more settings; | 37 | * - interfaces have one (usually) or more settings; |
38 | * - each interface setting has zero or (usually) more endpoints. | 38 | * - each interface setting has zero or (usually) more endpoints. |
39 | * - a SuperSpeed endpoint has a companion descriptor | ||
39 | * | 40 | * |
40 | * And there might be other descriptors mixed in with those. | 41 | * And there might be other descriptors mixed in with those. |
41 | * | 42 | * |
@@ -44,6 +45,19 @@ struct wusb_dev; | |||
44 | 45 | ||
45 | struct ep_device; | 46 | struct ep_device; |
46 | 47 | ||
48 | /* For SS devices */ | ||
49 | /** | ||
50 | * struct usb_host_ss_ep_comp - Valid for SuperSpeed devices only | ||
51 | * @desc: endpoint companion descriptor, wMaxPacketSize in native byteorder | ||
52 | * @extra: descriptors following this endpoint companion descriptor | ||
53 | * @extralen: how many bytes of "extra" are valid | ||
54 | */ | ||
55 | struct usb_host_ss_ep_comp { | ||
56 | struct usb_ss_ep_comp_descriptor desc; | ||
57 | unsigned char *extra; /* Extra descriptors */ | ||
58 | int extralen; | ||
59 | }; | ||
60 | |||
47 | /** | 61 | /** |
48 | * struct usb_host_endpoint - host-side endpoint descriptor and queue | 62 | * struct usb_host_endpoint - host-side endpoint descriptor and queue |
49 | * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder | 63 | * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder |
@@ -51,6 +65,7 @@ struct ep_device; | |||
51 | * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) | 65 | * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) |
52 | * with one or more transfer descriptors (TDs) per urb | 66 | * with one or more transfer descriptors (TDs) per urb |
53 | * @ep_dev: ep_device for sysfs info | 67 | * @ep_dev: ep_device for sysfs info |
68 | * @ss_ep_comp: companion descriptor information for this endpoint | ||
54 | * @extra: descriptors following this endpoint in the configuration | 69 | * @extra: descriptors following this endpoint in the configuration |
55 | * @extralen: how many bytes of "extra" are valid | 70 | * @extralen: how many bytes of "extra" are valid |
56 | * @enabled: URBs may be submitted to this endpoint | 71 | * @enabled: URBs may be submitted to this endpoint |
@@ -63,6 +78,7 @@ struct usb_host_endpoint { | |||
63 | struct list_head urb_list; | 78 | struct list_head urb_list; |
64 | void *hcpriv; | 79 | void *hcpriv; |
65 | struct ep_device *ep_dev; /* For sysfs info */ | 80 | struct ep_device *ep_dev; /* For sysfs info */ |
81 | struct usb_host_ss_ep_comp *ss_ep_comp; /* For SS devices */ | ||
66 | 82 | ||
67 | unsigned char *extra; /* Extra descriptors */ | 83 | unsigned char *extra; /* Extra descriptors */ |
68 | int extralen; | 84 | int extralen; |
@@ -336,7 +352,6 @@ struct usb_bus { | |||
336 | #ifdef CONFIG_USB_DEVICEFS | 352 | #ifdef CONFIG_USB_DEVICEFS |
337 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ | 353 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ |
338 | #endif | 354 | #endif |
339 | struct device *dev; /* device for this bus */ | ||
340 | 355 | ||
341 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) | 356 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) |
342 | struct mon_bus *mon_bus; /* non-null when associated */ | 357 | struct mon_bus *mon_bus; /* non-null when associated */ |
@@ -363,6 +378,7 @@ struct usb_tt; | |||
363 | * struct usb_device - kernel's representation of a USB device | 378 | * struct usb_device - kernel's representation of a USB device |
364 | * @devnum: device number; address on a USB bus | 379 | * @devnum: device number; address on a USB bus |
365 | * @devpath: device ID string for use in messages (e.g., /port/...) | 380 | * @devpath: device ID string for use in messages (e.g., /port/...) |
381 | * @route: tree topology hex string for use with xHCI | ||
366 | * @state: device state: configured, not attached, etc. | 382 | * @state: device state: configured, not attached, etc. |
367 | * @speed: device speed: high/full/low (or error) | 383 | * @speed: device speed: high/full/low (or error) |
368 | * @tt: Transaction Translator info; used with low/full speed dev, highspeed hub | 384 | * @tt: Transaction Translator info; used with low/full speed dev, highspeed hub |
@@ -420,6 +436,7 @@ struct usb_tt; | |||
420 | * @skip_sys_resume: skip the next system resume | 436 | * @skip_sys_resume: skip the next system resume |
421 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB | 437 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB |
422 | * specific data for the device. | 438 | * specific data for the device. |
439 | * @slot_id: Slot ID assigned by xHCI | ||
423 | * | 440 | * |
424 | * Notes: | 441 | * Notes: |
425 | * Usbcore drivers should not set usbdev->state directly. Instead use | 442 | * Usbcore drivers should not set usbdev->state directly. Instead use |
@@ -428,6 +445,7 @@ struct usb_tt; | |||
428 | struct usb_device { | 445 | struct usb_device { |
429 | int devnum; | 446 | int devnum; |
430 | char devpath [16]; | 447 | char devpath [16]; |
448 | u32 route; | ||
431 | enum usb_device_state state; | 449 | enum usb_device_state state; |
432 | enum usb_device_speed speed; | 450 | enum usb_device_speed speed; |
433 | 451 | ||
@@ -503,6 +521,7 @@ struct usb_device { | |||
503 | unsigned skip_sys_resume:1; | 521 | unsigned skip_sys_resume:1; |
504 | #endif | 522 | #endif |
505 | struct wusb_dev *wusb_dev; | 523 | struct wusb_dev *wusb_dev; |
524 | int slot_id; | ||
506 | }; | 525 | }; |
507 | #define to_usb_device(d) container_of(d, struct usb_device, dev) | 526 | #define to_usb_device(d) container_of(d, struct usb_device, dev) |
508 | 527 | ||
@@ -869,6 +888,8 @@ struct usb_driver { | |||
869 | * struct usb_device_driver - identifies USB device driver to usbcore | 888 | * struct usb_device_driver - identifies USB device driver to usbcore |
870 | * @name: The driver name should be unique among USB drivers, | 889 | * @name: The driver name should be unique among USB drivers, |
871 | * and should normally be the same as the module name. | 890 | * and should normally be the same as the module name. |
891 | * @nodename: Callback to provide a naming hint for a possible | ||
892 | * device node to create. | ||
872 | * @probe: Called to see if the driver is willing to manage a particular | 893 | * @probe: Called to see if the driver is willing to manage a particular |
873 | * device. If it is, probe returns zero and uses dev_set_drvdata() | 894 | * device. If it is, probe returns zero and uses dev_set_drvdata() |
874 | * to associate driver-specific data with the device. If unwilling | 895 | * to associate driver-specific data with the device. If unwilling |
@@ -912,6 +933,7 @@ extern struct bus_type usb_bus_type; | |||
912 | */ | 933 | */ |
913 | struct usb_class_driver { | 934 | struct usb_class_driver { |
914 | char *name; | 935 | char *name; |
936 | char *(*nodename)(struct device *dev); | ||
915 | const struct file_operations *fops; | 937 | const struct file_operations *fops; |
916 | int minor_base; | 938 | int minor_base; |
917 | }; | 939 | }; |
@@ -1041,7 +1063,9 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1041 | * @setup_dma: For control transfers with URB_NO_SETUP_DMA_MAP set, the | 1063 | * @setup_dma: For control transfers with URB_NO_SETUP_DMA_MAP set, the |
1042 | * device driver has provided this DMA address for the setup packet. | 1064 | * device driver has provided this DMA address for the setup packet. |
1043 | * The host controller driver should use this in preference to | 1065 | * The host controller driver should use this in preference to |
1044 | * setup_packet. | 1066 | * setup_packet, but the HCD may chose to ignore the address if it must |
1067 | * copy the setup packet into internal structures. Therefore, setup_packet | ||
1068 | * must always point to a valid buffer. | ||
1045 | * @start_frame: Returns the initial frame for isochronous transfers. | 1069 | * @start_frame: Returns the initial frame for isochronous transfers. |
1046 | * @number_of_packets: Lists the number of ISO transfer buffers. | 1070 | * @number_of_packets: Lists the number of ISO transfer buffers. |
1047 | * @interval: Specifies the polling interval for interrupt or isochronous | 1071 | * @interval: Specifies the polling interval for interrupt or isochronous |
@@ -1177,6 +1201,8 @@ struct urb { | |||
1177 | unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ | 1201 | unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ |
1178 | void *transfer_buffer; /* (in) associated data buffer */ | 1202 | void *transfer_buffer; /* (in) associated data buffer */ |
1179 | dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ | 1203 | dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ |
1204 | struct usb_sg_request *sg; /* (in) scatter gather buffer list */ | ||
1205 | int num_sgs; /* (in) number of entries in the sg list */ | ||
1180 | u32 transfer_buffer_length; /* (in) data buffer length */ | 1206 | u32 transfer_buffer_length; /* (in) data buffer length */ |
1181 | u32 actual_length; /* (return) actual transfer length */ | 1207 | u32 actual_length; /* (return) actual transfer length */ |
1182 | unsigned char *setup_packet; /* (in) setup packet (control only) */ | 1208 | unsigned char *setup_packet; /* (in) setup packet (control only) */ |
@@ -1422,8 +1448,8 @@ struct usb_sg_request { | |||
1422 | int status; | 1448 | int status; |
1423 | size_t bytes; | 1449 | size_t bytes; |
1424 | 1450 | ||
1425 | /* | 1451 | /* private: |
1426 | * members below are private: to usbcore, | 1452 | * members below are private to usbcore, |
1427 | * and are not provided for driver access! | 1453 | * and are not provided for driver access! |
1428 | */ | 1454 | */ |
1429 | spinlock_t lock; | 1455 | spinlock_t lock; |
@@ -1558,6 +1584,9 @@ extern void usb_unregister_notify(struct notifier_block *nb); | |||
1558 | #define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \ | 1584 | #define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \ |
1559 | format "\n" , ## arg) | 1585 | format "\n" , ## arg) |
1560 | 1586 | ||
1587 | /* debugfs stuff */ | ||
1588 | extern struct dentry *usb_debug_root; | ||
1589 | |||
1561 | #endif /* __KERNEL__ */ | 1590 | #endif /* __KERNEL__ */ |
1562 | 1591 | ||
1563 | #endif | 1592 | #endif |
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h index 8cb025fef634..b5744bc218ab 100644 --- a/include/linux/usb/audio.h +++ b/include/linux/usb/audio.h | |||
@@ -24,10 +24,75 @@ | |||
24 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 | 24 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 |
25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 | 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 |
26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 | 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 |
27 | #define USB_SUBCLASS_VENDOR_SPEC 0xff | ||
27 | 28 | ||
29 | /* A.5 Audio Class-Specific AC interface Descriptor Subtypes*/ | ||
30 | #define HEADER 0x01 | ||
31 | #define INPUT_TERMINAL 0x02 | ||
32 | #define OUTPUT_TERMINAL 0x03 | ||
33 | #define MIXER_UNIT 0x04 | ||
34 | #define SELECTOR_UNIT 0x05 | ||
35 | #define FEATURE_UNIT 0x06 | ||
36 | #define PROCESSING_UNIT 0x07 | ||
37 | #define EXTENSION_UNIT 0x08 | ||
38 | |||
39 | #define AS_GENERAL 0x01 | ||
40 | #define FORMAT_TYPE 0x02 | ||
41 | #define FORMAT_SPECIFIC 0x03 | ||
42 | |||
43 | #define EP_GENERAL 0x01 | ||
44 | |||
45 | #define MS_GENERAL 0x01 | ||
46 | #define MIDI_IN_JACK 0x02 | ||
47 | #define MIDI_OUT_JACK 0x03 | ||
48 | |||
49 | /* endpoint attributes */ | ||
50 | #define EP_ATTR_MASK 0x0c | ||
51 | #define EP_ATTR_ASYNC 0x04 | ||
52 | #define EP_ATTR_ADAPTIVE 0x08 | ||
53 | #define EP_ATTR_SYNC 0x0c | ||
54 | |||
55 | /* cs endpoint attributes */ | ||
56 | #define EP_CS_ATTR_SAMPLE_RATE 0x01 | ||
57 | #define EP_CS_ATTR_PITCH_CONTROL 0x02 | ||
58 | #define EP_CS_ATTR_FILL_MAX 0x80 | ||
59 | |||
60 | /* Audio Class specific Request Codes */ | ||
61 | #define USB_AUDIO_SET_INTF 0x21 | ||
62 | #define USB_AUDIO_SET_ENDPOINT 0x22 | ||
63 | #define USB_AUDIO_GET_INTF 0xa1 | ||
64 | #define USB_AUDIO_GET_ENDPOINT 0xa2 | ||
65 | |||
66 | #define SET_ 0x00 | ||
67 | #define GET_ 0x80 | ||
68 | |||
69 | #define _CUR 0x1 | ||
70 | #define _MIN 0x2 | ||
71 | #define _MAX 0x3 | ||
72 | #define _RES 0x4 | ||
73 | #define _MEM 0x5 | ||
74 | |||
75 | #define SET_CUR (SET_ | _CUR) | ||
76 | #define GET_CUR (GET_ | _CUR) | ||
77 | #define SET_MIN (SET_ | _MIN) | ||
78 | #define GET_MIN (GET_ | _MIN) | ||
79 | #define SET_MAX (SET_ | _MAX) | ||
80 | #define GET_MAX (GET_ | _MAX) | ||
81 | #define SET_RES (SET_ | _RES) | ||
82 | #define GET_RES (GET_ | _RES) | ||
83 | #define SET_MEM (SET_ | _MEM) | ||
84 | #define GET_MEM (GET_ | _MEM) | ||
85 | |||
86 | #define GET_STAT 0xff | ||
87 | |||
88 | #define USB_AC_TERMINAL_UNDEFINED 0x100 | ||
89 | #define USB_AC_TERMINAL_STREAMING 0x101 | ||
90 | #define USB_AC_TERMINAL_VENDOR_SPEC 0x1FF | ||
91 | |||
92 | /* Terminal Control Selectors */ | ||
28 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | 93 | /* 4.3.2 Class-Specific AC Interface Descriptor */ |
29 | struct usb_ac_header_descriptor { | 94 | struct usb_ac_header_descriptor { |
30 | __u8 bLength; /* 8+n */ | 95 | __u8 bLength; /* 8 + n */ |
31 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 96 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
32 | __u8 bDescriptorSubtype; /* USB_MS_HEADER */ | 97 | __u8 bDescriptorSubtype; /* USB_MS_HEADER */ |
33 | __le16 bcdADC; /* 0x0100 */ | 98 | __le16 bcdADC; /* 0x0100 */ |
@@ -36,7 +101,7 @@ struct usb_ac_header_descriptor { | |||
36 | __u8 baInterfaceNr[]; /* [n] */ | 101 | __u8 baInterfaceNr[]; /* [n] */ |
37 | } __attribute__ ((packed)); | 102 | } __attribute__ ((packed)); |
38 | 103 | ||
39 | #define USB_DT_AC_HEADER_SIZE(n) (8+(n)) | 104 | #define USB_DT_AC_HEADER_SIZE(n) (8 + (n)) |
40 | 105 | ||
41 | /* As above, but more useful for defining your own descriptors: */ | 106 | /* As above, but more useful for defining your own descriptors: */ |
42 | #define DECLARE_USB_AC_HEADER_DESCRIPTOR(n) \ | 107 | #define DECLARE_USB_AC_HEADER_DESCRIPTOR(n) \ |
@@ -50,4 +115,200 @@ struct usb_ac_header_descriptor_##n { \ | |||
50 | __u8 baInterfaceNr[n]; \ | 115 | __u8 baInterfaceNr[n]; \ |
51 | } __attribute__ ((packed)) | 116 | } __attribute__ ((packed)) |
52 | 117 | ||
118 | /* 4.3.2.1 Input Terminal Descriptor */ | ||
119 | struct usb_input_terminal_descriptor { | ||
120 | __u8 bLength; /* in bytes: 12 */ | ||
121 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | ||
122 | __u8 bDescriptorSubtype; /* INPUT_TERMINAL descriptor subtype */ | ||
123 | __u8 bTerminalID; /* Constant uniquely terminal ID */ | ||
124 | __le16 wTerminalType; /* USB Audio Terminal Types */ | ||
125 | __u8 bAssocTerminal; /* ID of the Output Terminal associated */ | ||
126 | __u8 bNrChannels; /* Number of logical output channels */ | ||
127 | __le16 wChannelConfig; | ||
128 | __u8 iChannelNames; | ||
129 | __u8 iTerminal; | ||
130 | } __attribute__ ((packed)); | ||
131 | |||
132 | #define USB_DT_AC_INPUT_TERMINAL_SIZE 12 | ||
133 | |||
134 | #define USB_AC_INPUT_TERMINAL_UNDEFINED 0x200 | ||
135 | #define USB_AC_INPUT_TERMINAL_MICROPHONE 0x201 | ||
136 | #define USB_AC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 | ||
137 | #define USB_AC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 | ||
138 | #define USB_AC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 | ||
139 | #define USB_AC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 | ||
140 | #define USB_AC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 | ||
141 | |||
142 | /* 4.3.2.2 Output Terminal Descriptor */ | ||
143 | struct usb_output_terminal_descriptor { | ||
144 | __u8 bLength; /* in bytes: 9 */ | ||
145 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | ||
146 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ | ||
147 | __u8 bTerminalID; /* Constant uniquely terminal ID */ | ||
148 | __le16 wTerminalType; /* USB Audio Terminal Types */ | ||
149 | __u8 bAssocTerminal; /* ID of the Input Terminal associated */ | ||
150 | __u8 bSourceID; /* ID of the connected Unit or Terminal*/ | ||
151 | __u8 iTerminal; | ||
152 | } __attribute__ ((packed)); | ||
153 | |||
154 | #define USB_DT_AC_OUTPUT_TERMINAL_SIZE 9 | ||
155 | |||
156 | #define USB_AC_OUTPUT_TERMINAL_UNDEFINED 0x300 | ||
157 | #define USB_AC_OUTPUT_TERMINAL_SPEAKER 0x301 | ||
158 | #define USB_AC_OUTPUT_TERMINAL_HEADPHONES 0x302 | ||
159 | #define USB_AC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 | ||
160 | #define USB_AC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 | ||
161 | #define USB_AC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 | ||
162 | #define USB_AC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 | ||
163 | #define USB_AC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 | ||
164 | |||
165 | /* Set bControlSize = 2 as default setting */ | ||
166 | #define USB_DT_AC_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) | ||
167 | |||
168 | /* As above, but more useful for defining your own descriptors: */ | ||
169 | #define DECLARE_USB_AC_FEATURE_UNIT_DESCRIPTOR(ch) \ | ||
170 | struct usb_ac_feature_unit_descriptor_##ch { \ | ||
171 | __u8 bLength; \ | ||
172 | __u8 bDescriptorType; \ | ||
173 | __u8 bDescriptorSubtype; \ | ||
174 | __u8 bUnitID; \ | ||
175 | __u8 bSourceID; \ | ||
176 | __u8 bControlSize; \ | ||
177 | __le16 bmaControls[ch + 1]; \ | ||
178 | __u8 iFeature; \ | ||
179 | } __attribute__ ((packed)) | ||
180 | |||
181 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | ||
182 | struct usb_as_header_descriptor { | ||
183 | __u8 bLength; /* in bytes: 7 */ | ||
184 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
185 | __u8 bDescriptorSubtype; /* AS_GENERAL */ | ||
186 | __u8 bTerminalLink; /* Terminal ID of connected Terminal */ | ||
187 | __u8 bDelay; /* Delay introduced by the data path */ | ||
188 | __le16 wFormatTag; /* The Audio Data Format */ | ||
189 | } __attribute__ ((packed)); | ||
190 | |||
191 | #define USB_DT_AS_HEADER_SIZE 7 | ||
192 | |||
193 | #define USB_AS_AUDIO_FORMAT_TYPE_I_UNDEFINED 0x0 | ||
194 | #define USB_AS_AUDIO_FORMAT_TYPE_I_PCM 0x1 | ||
195 | #define USB_AS_AUDIO_FORMAT_TYPE_I_PCM8 0x2 | ||
196 | #define USB_AS_AUDIO_FORMAT_TYPE_I_IEEE_FLOAT 0x3 | ||
197 | #define USB_AS_AUDIO_FORMAT_TYPE_I_ALAW 0x4 | ||
198 | #define USB_AS_AUDIO_FORMAT_TYPE_I_MULAW 0x5 | ||
199 | |||
200 | struct usb_as_format_type_i_continuous_descriptor { | ||
201 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | ||
202 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
203 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | ||
204 | __u8 bFormatType; /* FORMAT_TYPE_1 */ | ||
205 | __u8 bNrChannels; /* physical channels in the stream */ | ||
206 | __u8 bSubframeSize; /* */ | ||
207 | __u8 bBitResolution; | ||
208 | __u8 bSamFreqType; | ||
209 | __u8 tLowerSamFreq[3]; | ||
210 | __u8 tUpperSamFreq[3]; | ||
211 | } __attribute__ ((packed)); | ||
212 | |||
213 | #define USB_AS_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 | ||
214 | |||
215 | struct usb_as_formate_type_i_discrete_descriptor { | ||
216 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | ||
217 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
218 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | ||
219 | __u8 bFormatType; /* FORMAT_TYPE_1 */ | ||
220 | __u8 bNrChannels; /* physical channels in the stream */ | ||
221 | __u8 bSubframeSize; /* */ | ||
222 | __u8 bBitResolution; | ||
223 | __u8 bSamFreqType; | ||
224 | __u8 tSamFreq[][3]; | ||
225 | } __attribute__ ((packed)); | ||
226 | |||
227 | #define DECLARE_USB_AS_FORMAT_TYPE_I_DISCRETE_DESC(n) \ | ||
228 | struct usb_as_formate_type_i_discrete_descriptor_##n { \ | ||
229 | __u8 bLength; \ | ||
230 | __u8 bDescriptorType; \ | ||
231 | __u8 bDescriptorSubtype; \ | ||
232 | __u8 bFormatType; \ | ||
233 | __u8 bNrChannels; \ | ||
234 | __u8 bSubframeSize; \ | ||
235 | __u8 bBitResolution; \ | ||
236 | __u8 bSamFreqType; \ | ||
237 | __u8 tSamFreq[n][3]; \ | ||
238 | } __attribute__ ((packed)) | ||
239 | |||
240 | #define USB_AS_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) | ||
241 | |||
242 | #define USB_AS_FORMAT_TYPE_UNDEFINED 0x0 | ||
243 | #define USB_AS_FORMAT_TYPE_I 0x1 | ||
244 | #define USB_AS_FORMAT_TYPE_II 0x2 | ||
245 | #define USB_AS_FORMAT_TYPE_III 0x3 | ||
246 | |||
247 | #define USB_AS_ENDPOINT_ASYNC (1 << 2) | ||
248 | #define USB_AS_ENDPOINT_ADAPTIVE (2 << 2) | ||
249 | #define USB_AS_ENDPOINT_SYNC (3 << 2) | ||
250 | |||
251 | struct usb_as_iso_endpoint_descriptor { | ||
252 | __u8 bLength; /* in bytes: 7 */ | ||
253 | __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ | ||
254 | __u8 bDescriptorSubtype; /* EP_GENERAL */ | ||
255 | __u8 bmAttributes; | ||
256 | __u8 bLockDelayUnits; | ||
257 | __le16 wLockDelay; | ||
258 | }; | ||
259 | #define USB_AS_ISO_ENDPOINT_DESC_SIZE 7 | ||
260 | |||
261 | #define FU_CONTROL_UNDEFINED 0x00 | ||
262 | #define MUTE_CONTROL 0x01 | ||
263 | #define VOLUME_CONTROL 0x02 | ||
264 | #define BASS_CONTROL 0x03 | ||
265 | #define MID_CONTROL 0x04 | ||
266 | #define TREBLE_CONTROL 0x05 | ||
267 | #define GRAPHIC_EQUALIZER_CONTROL 0x06 | ||
268 | #define AUTOMATIC_GAIN_CONTROL 0x07 | ||
269 | #define DELAY_CONTROL 0x08 | ||
270 | #define BASS_BOOST_CONTROL 0x09 | ||
271 | #define LOUDNESS_CONTROL 0x0a | ||
272 | |||
273 | #define FU_MUTE (1 << (MUTE_CONTROL - 1)) | ||
274 | #define FU_VOLUME (1 << (VOLUME_CONTROL - 1)) | ||
275 | #define FU_BASS (1 << (BASS_CONTROL - 1)) | ||
276 | #define FU_MID (1 << (MID_CONTROL - 1)) | ||
277 | #define FU_TREBLE (1 << (TREBLE_CONTROL - 1)) | ||
278 | #define FU_GRAPHIC_EQ (1 << (GRAPHIC_EQUALIZER_CONTROL - 1)) | ||
279 | #define FU_AUTO_GAIN (1 << (AUTOMATIC_GAIN_CONTROL - 1)) | ||
280 | #define FU_DELAY (1 << (DELAY_CONTROL - 1)) | ||
281 | #define FU_BASS_BOOST (1 << (BASS_BOOST_CONTROL - 1)) | ||
282 | #define FU_LOUDNESS (1 << (LOUDNESS_CONTROL - 1)) | ||
283 | |||
284 | struct usb_audio_control { | ||
285 | struct list_head list; | ||
286 | const char *name; | ||
287 | u8 type; | ||
288 | int data[5]; | ||
289 | int (*set)(struct usb_audio_control *con, u8 cmd, int value); | ||
290 | int (*get)(struct usb_audio_control *con, u8 cmd); | ||
291 | }; | ||
292 | |||
293 | static inline int generic_set_cmd(struct usb_audio_control *con, u8 cmd, int value) | ||
294 | { | ||
295 | con->data[cmd] = value; | ||
296 | |||
297 | return 0; | ||
298 | } | ||
299 | |||
300 | static inline int generic_get_cmd(struct usb_audio_control *con, u8 cmd) | ||
301 | { | ||
302 | return con->data[cmd]; | ||
303 | } | ||
304 | |||
305 | struct usb_audio_control_selector { | ||
306 | struct list_head list; | ||
307 | struct list_head control; | ||
308 | u8 id; | ||
309 | const char *name; | ||
310 | u8 type; | ||
311 | struct usb_descriptor_header *desc; | ||
312 | }; | ||
313 | |||
53 | #endif /* __LINUX_USB_AUDIO_H */ | 314 | #endif /* __LINUX_USB_AUDIO_H */ |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index b145119a90da..93223638f702 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -191,6 +191,8 @@ struct usb_ctrlrequest { | |||
191 | #define USB_DT_WIRE_ADAPTER 0x21 | 191 | #define USB_DT_WIRE_ADAPTER 0x21 |
192 | #define USB_DT_RPIPE 0x22 | 192 | #define USB_DT_RPIPE 0x22 |
193 | #define USB_DT_CS_RADIO_CONTROL 0x23 | 193 | #define USB_DT_CS_RADIO_CONTROL 0x23 |
194 | /* From the USB 3.0 spec */ | ||
195 | #define USB_DT_SS_ENDPOINT_COMP 0x30 | ||
194 | 196 | ||
195 | /* Conventional codes for class-specific descriptors. The convention is | 197 | /* Conventional codes for class-specific descriptors. The convention is |
196 | * defined in the USB "Common Class" Spec (3.11). Individual class specs | 198 | * defined in the USB "Common Class" Spec (3.11). Individual class specs |
@@ -535,6 +537,20 @@ static inline int usb_endpoint_is_isoc_out( | |||
535 | 537 | ||
536 | /*-------------------------------------------------------------------------*/ | 538 | /*-------------------------------------------------------------------------*/ |
537 | 539 | ||
540 | /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ | ||
541 | struct usb_ss_ep_comp_descriptor { | ||
542 | __u8 bLength; | ||
543 | __u8 bDescriptorType; | ||
544 | |||
545 | __u8 bMaxBurst; | ||
546 | __u8 bmAttributes; | ||
547 | __u16 wBytesPerInterval; | ||
548 | } __attribute__ ((packed)); | ||
549 | |||
550 | #define USB_DT_SS_EP_COMP_SIZE 6 | ||
551 | |||
552 | /*-------------------------------------------------------------------------*/ | ||
553 | |||
538 | /* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */ | 554 | /* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */ |
539 | struct usb_qualifier_descriptor { | 555 | struct usb_qualifier_descriptor { |
540 | __u8 bLength; | 556 | __u8 bLength; |
@@ -752,6 +768,7 @@ enum usb_device_speed { | |||
752 | USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ | 768 | USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ |
753 | USB_SPEED_HIGH, /* usb 2.0 */ | 769 | USB_SPEED_HIGH, /* usb 2.0 */ |
754 | USB_SPEED_VARIABLE, /* wireless (usb 2.5) */ | 770 | USB_SPEED_VARIABLE, /* wireless (usb 2.5) */ |
771 | USB_SPEED_SUPER, /* usb 3.0 */ | ||
755 | }; | 772 | }; |
756 | 773 | ||
757 | enum usb_device_state { | 774 | enum usb_device_state { |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index acd7b0f06c8a..4f6bb3d2160e 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -124,6 +124,7 @@ struct usb_function { | |||
124 | void (*suspend)(struct usb_function *); | 124 | void (*suspend)(struct usb_function *); |
125 | void (*resume)(struct usb_function *); | 125 | void (*resume)(struct usb_function *); |
126 | 126 | ||
127 | /* private: */ | ||
127 | /* internals */ | 128 | /* internals */ |
128 | struct list_head list; | 129 | struct list_head list; |
129 | }; | 130 | }; |
@@ -219,6 +220,7 @@ struct usb_configuration { | |||
219 | 220 | ||
220 | struct usb_composite_dev *cdev; | 221 | struct usb_composite_dev *cdev; |
221 | 222 | ||
223 | /* private: */ | ||
222 | /* internals */ | 224 | /* internals */ |
223 | struct list_head list; | 225 | struct list_head list; |
224 | struct list_head functions; | 226 | struct list_head functions; |
@@ -321,6 +323,7 @@ struct usb_composite_dev { | |||
321 | 323 | ||
322 | struct usb_configuration *config; | 324 | struct usb_configuration *config; |
323 | 325 | ||
326 | /* private: */ | ||
324 | /* internals */ | 327 | /* internals */ |
325 | struct usb_device_descriptor desc; | 328 | struct usb_device_descriptor desc; |
326 | struct list_head configs; | 329 | struct list_head configs; |
diff --git a/include/linux/usb/langwell_otg.h b/include/linux/usb/langwell_otg.h new file mode 100644 index 000000000000..e115ae6df1da --- /dev/null +++ b/include/linux/usb/langwell_otg.h | |||
@@ -0,0 +1,177 @@ | |||
1 | /* | ||
2 | * Intel Langwell USB OTG transceiver driver | ||
3 | * Copyright (C) 2008, Intel Corporation. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #ifndef __LANGWELL_OTG_H__ | ||
21 | #define __LANGWELL_OTG_H__ | ||
22 | |||
23 | /* notify transceiver driver about OTG events */ | ||
24 | extern void langwell_update_transceiver(void); | ||
25 | /* HCD register bus driver */ | ||
26 | extern int langwell_register_host(struct pci_driver *host_driver); | ||
27 | /* HCD unregister bus driver */ | ||
28 | extern void langwell_unregister_host(struct pci_driver *host_driver); | ||
29 | /* DCD register bus driver */ | ||
30 | extern int langwell_register_peripheral(struct pci_driver *client_driver); | ||
31 | /* DCD unregister bus driver */ | ||
32 | extern void langwell_unregister_peripheral(struct pci_driver *client_driver); | ||
33 | /* No silent failure, output warning message */ | ||
34 | extern void langwell_otg_nsf_msg(unsigned long message); | ||
35 | |||
36 | #define CI_USBCMD 0x30 | ||
37 | # define USBCMD_RST BIT(1) | ||
38 | # define USBCMD_RS BIT(0) | ||
39 | #define CI_USBSTS 0x34 | ||
40 | # define USBSTS_SLI BIT(8) | ||
41 | # define USBSTS_URI BIT(6) | ||
42 | # define USBSTS_PCI BIT(2) | ||
43 | #define CI_PORTSC1 0x74 | ||
44 | # define PORTSC_PP BIT(12) | ||
45 | # define PORTSC_LS (BIT(11) | BIT(10)) | ||
46 | # define PORTSC_SUSP BIT(7) | ||
47 | # define PORTSC_CCS BIT(0) | ||
48 | #define CI_HOSTPC1 0xb4 | ||
49 | # define HOSTPC1_PHCD BIT(22) | ||
50 | #define CI_OTGSC 0xf4 | ||
51 | # define OTGSC_DPIE BIT(30) | ||
52 | # define OTGSC_1MSE BIT(29) | ||
53 | # define OTGSC_BSEIE BIT(28) | ||
54 | # define OTGSC_BSVIE BIT(27) | ||
55 | # define OTGSC_ASVIE BIT(26) | ||
56 | # define OTGSC_AVVIE BIT(25) | ||
57 | # define OTGSC_IDIE BIT(24) | ||
58 | # define OTGSC_DPIS BIT(22) | ||
59 | # define OTGSC_1MSS BIT(21) | ||
60 | # define OTGSC_BSEIS BIT(20) | ||
61 | # define OTGSC_BSVIS BIT(19) | ||
62 | # define OTGSC_ASVIS BIT(18) | ||
63 | # define OTGSC_AVVIS BIT(17) | ||
64 | # define OTGSC_IDIS BIT(16) | ||
65 | # define OTGSC_DPS BIT(14) | ||
66 | # define OTGSC_1MST BIT(13) | ||
67 | # define OTGSC_BSE BIT(12) | ||
68 | # define OTGSC_BSV BIT(11) | ||
69 | # define OTGSC_ASV BIT(10) | ||
70 | # define OTGSC_AVV BIT(9) | ||
71 | # define OTGSC_ID BIT(8) | ||
72 | # define OTGSC_HABA BIT(7) | ||
73 | # define OTGSC_HADP BIT(6) | ||
74 | # define OTGSC_IDPU BIT(5) | ||
75 | # define OTGSC_DP BIT(4) | ||
76 | # define OTGSC_OT BIT(3) | ||
77 | # define OTGSC_HAAR BIT(2) | ||
78 | # define OTGSC_VC BIT(1) | ||
79 | # define OTGSC_VD BIT(0) | ||
80 | # define OTGSC_INTEN_MASK (0x7f << 24) | ||
81 | # define OTGSC_INTSTS_MASK (0x7f << 16) | ||
82 | #define CI_USBMODE 0xf8 | ||
83 | # define USBMODE_CM (BIT(1) | BIT(0)) | ||
84 | # define USBMODE_IDLE 0 | ||
85 | # define USBMODE_DEVICE 0x2 | ||
86 | # define USBMODE_HOST 0x3 | ||
87 | |||
88 | #define INTR_DUMMY_MASK (USBSTS_SLI | USBSTS_URI | USBSTS_PCI) | ||
89 | |||
90 | struct otg_hsm { | ||
91 | /* Input */ | ||
92 | int a_bus_resume; | ||
93 | int a_bus_suspend; | ||
94 | int a_conn; | ||
95 | int a_sess_vld; | ||
96 | int a_srp_det; | ||
97 | int a_vbus_vld; | ||
98 | int b_bus_resume; | ||
99 | int b_bus_suspend; | ||
100 | int b_conn; | ||
101 | int b_se0_srp; | ||
102 | int b_sess_end; | ||
103 | int b_sess_vld; | ||
104 | int id; | ||
105 | |||
106 | /* Internal variables */ | ||
107 | int a_set_b_hnp_en; | ||
108 | int b_srp_done; | ||
109 | int b_hnp_enable; | ||
110 | |||
111 | /* Timeout indicator for timers */ | ||
112 | int a_wait_vrise_tmout; | ||
113 | int a_wait_bcon_tmout; | ||
114 | int a_aidl_bdis_tmout; | ||
115 | int b_ase0_brst_tmout; | ||
116 | int b_bus_suspend_tmout; | ||
117 | int b_srp_res_tmout; | ||
118 | |||
119 | /* Informative variables */ | ||
120 | int a_bus_drop; | ||
121 | int a_bus_req; | ||
122 | int a_clr_err; | ||
123 | int a_suspend_req; | ||
124 | int b_bus_req; | ||
125 | |||
126 | /* Output */ | ||
127 | int drv_vbus; | ||
128 | int loc_conn; | ||
129 | int loc_sof; | ||
130 | |||
131 | /* Others */ | ||
132 | int b_bus_suspend_vld; | ||
133 | }; | ||
134 | |||
135 | #define TA_WAIT_VRISE 100 | ||
136 | #define TA_WAIT_BCON 30000 | ||
137 | #define TA_AIDL_BDIS 15000 | ||
138 | #define TB_ASE0_BRST 5000 | ||
139 | #define TB_SE0_SRP 2 | ||
140 | #define TB_SRP_RES 100 | ||
141 | #define TB_BUS_SUSPEND 500 | ||
142 | |||
143 | struct langwell_otg_timer { | ||
144 | unsigned long expires; /* Number of count increase to timeout */ | ||
145 | unsigned long count; /* Tick counter */ | ||
146 | void (*function)(unsigned long); /* Timeout function */ | ||
147 | unsigned long data; /* Data passed to function */ | ||
148 | struct list_head list; | ||
149 | }; | ||
150 | |||
151 | struct langwell_otg { | ||
152 | struct otg_transceiver otg; | ||
153 | struct otg_hsm hsm; | ||
154 | void __iomem *regs; | ||
155 | unsigned region; | ||
156 | struct pci_driver *host_ops; | ||
157 | struct pci_driver *client_ops; | ||
158 | struct pci_dev *pdev; | ||
159 | struct work_struct work; | ||
160 | struct workqueue_struct *qwork; | ||
161 | spinlock_t lock; | ||
162 | spinlock_t wq_lock; | ||
163 | }; | ||
164 | |||
165 | static inline struct langwell_otg *otg_to_langwell(struct otg_transceiver *otg) | ||
166 | { | ||
167 | return container_of(otg, struct langwell_otg, otg); | ||
168 | } | ||
169 | |||
170 | #ifdef DEBUG | ||
171 | #define otg_dbg(fmt, args...) \ | ||
172 | printk(KERN_DEBUG fmt , ## args) | ||
173 | #else | ||
174 | #define otg_dbg(fmt, args...) \ | ||
175 | do { } while (0) | ||
176 | #endif /* DEBUG */ | ||
177 | #endif /* __LANGWELL_OTG_H__ */ | ||
diff --git a/include/linux/usb/langwell_udc.h b/include/linux/usb/langwell_udc.h new file mode 100644 index 000000000000..c949178a6530 --- /dev/null +++ b/include/linux/usb/langwell_udc.h | |||
@@ -0,0 +1,310 @@ | |||
1 | /* | ||
2 | * Intel Langwell USB Device Controller driver | ||
3 | * Copyright (C) 2008-2009, Intel Corporation. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #ifndef __LANGWELL_UDC_H | ||
21 | #define __LANGWELL_UDC_H | ||
22 | |||
23 | |||
24 | /* MACRO defines */ | ||
25 | #define CAP_REG_OFFSET 0x0 | ||
26 | #define OP_REG_OFFSET 0x28 | ||
27 | |||
28 | #define DMA_ADDR_INVALID (~(dma_addr_t)0) | ||
29 | |||
30 | #define DQH_ALIGNMENT 2048 | ||
31 | #define DTD_ALIGNMENT 64 | ||
32 | #define DMA_BOUNDARY 4096 | ||
33 | |||
34 | #define EP0_MAX_PKT_SIZE 64 | ||
35 | #define EP_DIR_IN 1 | ||
36 | #define EP_DIR_OUT 0 | ||
37 | |||
38 | #define FLUSH_TIMEOUT 1000 | ||
39 | #define RESET_TIMEOUT 1000 | ||
40 | #define SETUPSTAT_TIMEOUT 100 | ||
41 | #define PRIME_TIMEOUT 100 | ||
42 | |||
43 | |||
44 | /* device memory space registers */ | ||
45 | |||
46 | /* Capability Registers, BAR0 + CAP_REG_OFFSET */ | ||
47 | struct langwell_cap_regs { | ||
48 | /* offset: 0x0 */ | ||
49 | u8 caplength; /* offset of Operational Register */ | ||
50 | u8 _reserved3; | ||
51 | u16 hciversion; /* H: BCD encoding of host version */ | ||
52 | u32 hcsparams; /* H: host port steering logic capability */ | ||
53 | u32 hccparams; /* H: host multiple mode control capability */ | ||
54 | #define HCC_LEN BIT(17) /* Link power management (LPM) capability */ | ||
55 | u8 _reserved4[0x20-0xc]; | ||
56 | /* offset: 0x20 */ | ||
57 | u16 dciversion; /* BCD encoding of device version */ | ||
58 | u8 _reserved5[0x24-0x22]; | ||
59 | u32 dccparams; /* overall device controller capability */ | ||
60 | #define HOSTCAP BIT(8) /* host capable */ | ||
61 | #define DEVCAP BIT(7) /* device capable */ | ||
62 | #define DEN(d) \ | ||
63 | (((d)>>0)&0x1f) /* bits 4:0, device endpoint number */ | ||
64 | } __attribute__ ((packed)); | ||
65 | |||
66 | |||
67 | /* Operational Registers, BAR0 + OP_REG_OFFSET */ | ||
68 | struct langwell_op_regs { | ||
69 | /* offset: 0x28 */ | ||
70 | u32 extsts; | ||
71 | #define EXTS_TI1 BIT(4) /* general purpose timer interrupt 1 */ | ||
72 | #define EXTS_TI1TI0 BIT(3) /* general purpose timer interrupt 0 */ | ||
73 | #define EXTS_TI1UPI BIT(2) /* USB host periodic interrupt */ | ||
74 | #define EXTS_TI1UAI BIT(1) /* USB host asynchronous interrupt */ | ||
75 | #define EXTS_TI1NAKI BIT(0) /* NAK interrupt */ | ||
76 | u32 extintr; | ||
77 | #define EXTI_TIE1 BIT(4) /* general purpose timer interrupt enable 1 */ | ||
78 | #define EXTI_TIE0 BIT(3) /* general purpose timer interrupt enable 0 */ | ||
79 | #define EXTI_UPIE BIT(2) /* USB host periodic interrupt enable */ | ||
80 | #define EXTI_UAIE BIT(1) /* USB host asynchronous interrupt enable */ | ||
81 | #define EXTI_NAKE BIT(0) /* NAK interrupt enable */ | ||
82 | /* offset: 0x30 */ | ||
83 | u32 usbcmd; | ||
84 | #define CMD_HIRD(u) \ | ||
85 | (((u)>>24)&0xf) /* bits 27:24, host init resume duration */ | ||
86 | #define CMD_ITC(u) \ | ||
87 | (((u)>>16)&0xff) /* bits 23:16, interrupt threshold control */ | ||
88 | #define CMD_PPE BIT(15) /* per-port change events enable */ | ||
89 | #define CMD_ATDTW BIT(14) /* add dTD tripwire */ | ||
90 | #define CMD_SUTW BIT(13) /* setup tripwire */ | ||
91 | #define CMD_ASPE BIT(11) /* asynchronous schedule park mode enable */ | ||
92 | #define CMD_FS2 BIT(10) /* frame list size */ | ||
93 | #define CMD_ASP1 BIT(9) /* asynchronous schedule park mode count */ | ||
94 | #define CMD_ASP0 BIT(8) | ||
95 | #define CMD_LR BIT(7) /* light host/device controller reset */ | ||
96 | #define CMD_IAA BIT(6) /* interrupt on async advance doorbell */ | ||
97 | #define CMD_ASE BIT(5) /* asynchronous schedule enable */ | ||
98 | #define CMD_PSE BIT(4) /* periodic schedule enable */ | ||
99 | #define CMD_FS1 BIT(3) | ||
100 | #define CMD_FS0 BIT(2) | ||
101 | #define CMD_RST BIT(1) /* controller reset */ | ||
102 | #define CMD_RUNSTOP BIT(0) /* run/stop */ | ||
103 | u32 usbsts; | ||
104 | #define STS_PPCI(u) \ | ||
105 | (((u)>>16)&0xffff) /* bits 31:16, port-n change detect */ | ||
106 | #define STS_AS BIT(15) /* asynchronous schedule status */ | ||
107 | #define STS_PS BIT(14) /* periodic schedule status */ | ||
108 | #define STS_RCL BIT(13) /* reclamation */ | ||
109 | #define STS_HCH BIT(12) /* HC halted */ | ||
110 | #define STS_ULPII BIT(10) /* ULPI interrupt */ | ||
111 | #define STS_SLI BIT(8) /* DC suspend */ | ||
112 | #define STS_SRI BIT(7) /* SOF received */ | ||
113 | #define STS_URI BIT(6) /* USB reset received */ | ||
114 | #define STS_AAI BIT(5) /* interrupt on async advance */ | ||
115 | #define STS_SEI BIT(4) /* system error */ | ||
116 | #define STS_FRI BIT(3) /* frame list rollover */ | ||
117 | #define STS_PCI BIT(2) /* port change detect */ | ||
118 | #define STS_UEI BIT(1) /* USB error interrupt */ | ||
119 | #define STS_UI BIT(0) /* USB interrupt */ | ||
120 | u32 usbintr; | ||
121 | /* bits 31:16, per-port interrupt enable */ | ||
122 | #define INTR_PPCE(u) (((u)>>16)&0xffff) | ||
123 | #define INTR_ULPIE BIT(10) /* ULPI enable */ | ||
124 | #define INTR_SLE BIT(8) /* DC sleep/suspend enable */ | ||
125 | #define INTR_SRE BIT(7) /* SOF received enable */ | ||
126 | #define INTR_URE BIT(6) /* USB reset enable */ | ||
127 | #define INTR_AAE BIT(5) /* interrupt on async advance enable */ | ||
128 | #define INTR_SEE BIT(4) /* system error enable */ | ||
129 | #define INTR_FRE BIT(3) /* frame list rollover enable */ | ||
130 | #define INTR_PCE BIT(2) /* port change detect enable */ | ||
131 | #define INTR_UEE BIT(1) /* USB error interrupt enable */ | ||
132 | #define INTR_UE BIT(0) /* USB interrupt enable */ | ||
133 | u32 frindex; /* frame index */ | ||
134 | #define FRINDEX_MASK (0x3fff << 0) | ||
135 | u32 ctrldssegment; /* not used */ | ||
136 | u32 deviceaddr; | ||
137 | #define USBADR_SHIFT 25 | ||
138 | #define USBADR(d) \ | ||
139 | (((d)>>25)&0x7f) /* bits 31:25, device address */ | ||
140 | #define USBADR_MASK (0x7f << 25) | ||
141 | #define USBADRA BIT(24) /* device address advance */ | ||
142 | u32 endpointlistaddr;/* endpoint list top memory address */ | ||
143 | /* bits 31:11, endpoint list pointer */ | ||
144 | #define EPBASE(d) (((d)>>11)&0x1fffff) | ||
145 | #define ENDPOINTLISTADDR_MASK (0x1fffff << 11) | ||
146 | u32 ttctrl; /* H: TT operatin, not used */ | ||
147 | /* offset: 0x50 */ | ||
148 | u32 burstsize; /* burst size of data movement */ | ||
149 | #define TXPBURST(b) \ | ||
150 | (((b)>>8)&0xff) /* bits 15:8, TX burst length */ | ||
151 | #define RXPBURST(b) \ | ||
152 | (((b)>>0)&0xff) /* bits 7:0, RX burst length */ | ||
153 | u32 txfilltuning; /* TX tuning */ | ||
154 | u32 txttfilltuning; /* H: TX TT tuning */ | ||
155 | u32 ic_usb; /* control the IC_USB FS/LS transceiver */ | ||
156 | /* offset: 0x60 */ | ||
157 | u32 ulpi_viewport; /* indirect access to ULPI PHY */ | ||
158 | #define ULPIWU BIT(31) /* ULPI wakeup */ | ||
159 | #define ULPIRUN BIT(30) /* ULPI read/write run */ | ||
160 | #define ULPIRW BIT(29) /* ULPI read/write control */ | ||
161 | #define ULPISS BIT(27) /* ULPI sync state */ | ||
162 | #define ULPIPORT(u) \ | ||
163 | (((u)>>24)&7) /* bits 26:24, ULPI port number */ | ||
164 | #define ULPIADDR(u) \ | ||
165 | (((u)>>16)&0xff) /* bits 23:16, ULPI data address */ | ||
166 | #define ULPIDATRD(u) \ | ||
167 | (((u)>>8)&0xff) /* bits 15:8, ULPI data read */ | ||
168 | #define ULPIDATWR(u) \ | ||
169 | (((u)>>0)&0xff) /* bits 7:0, ULPI date write */ | ||
170 | u8 _reserved6[0x70-0x64]; | ||
171 | /* offset: 0x70 */ | ||
172 | u32 configflag; /* H: not used */ | ||
173 | u32 portsc1; /* port status */ | ||
174 | #define DA(p) \ | ||
175 | (((p)>>25)&0x7f) /* bits 31:25, device address */ | ||
176 | #define PORTS_SSTS (BIT(24) | BIT(23)) /* suspend status */ | ||
177 | #define PORTS_WKOC BIT(22) /* wake on over-current enable */ | ||
178 | #define PORTS_WKDS BIT(21) /* wake on disconnect enable */ | ||
179 | #define PORTS_WKCN BIT(20) /* wake on connect enable */ | ||
180 | #define PORTS_PTC(p) (((p)>>16)&0xf) /* bits 19:16, port test control */ | ||
181 | #define PORTS_PIC (BIT(15) | BIT(14)) /* port indicator control */ | ||
182 | #define PORTS_PO BIT(13) /* port owner */ | ||
183 | #define PORTS_PP BIT(12) /* port power */ | ||
184 | #define PORTS_LS (BIT(11) | BIT(10)) /* line status */ | ||
185 | #define PORTS_SLP BIT(9) /* suspend using L1 */ | ||
186 | #define PORTS_PR BIT(8) /* port reset */ | ||
187 | #define PORTS_SUSP BIT(7) /* suspend */ | ||
188 | #define PORTS_FPR BIT(6) /* force port resume */ | ||
189 | #define PORTS_OCC BIT(5) /* over-current change */ | ||
190 | #define PORTS_OCA BIT(4) /* over-current active */ | ||
191 | #define PORTS_PEC BIT(3) /* port enable/disable change */ | ||
192 | #define PORTS_PE BIT(2) /* port enable/disable */ | ||
193 | #define PORTS_CSC BIT(1) /* connect status change */ | ||
194 | #define PORTS_CCS BIT(0) /* current connect status */ | ||
195 | u8 _reserved7[0xb4-0x78]; | ||
196 | /* offset: 0xb4 */ | ||
197 | u32 devlc; /* control LPM and each USB port behavior */ | ||
198 | /* bits 31:29, parallel transceiver select */ | ||
199 | #define LPM_PTS(d) (((d)>>29)&7) | ||
200 | #define LPM_STS BIT(28) /* serial transceiver select */ | ||
201 | #define LPM_PTW BIT(27) /* parallel transceiver width */ | ||
202 | #define LPM_PSPD(d) (((d)>>25)&3) /* bits 26:25, port speed */ | ||
203 | #define LPM_PSPD_MASK (BIT(26) | BIT(25)) | ||
204 | #define LPM_SPEED_FULL 0 | ||
205 | #define LPM_SPEED_LOW 1 | ||
206 | #define LPM_SPEED_HIGH 2 | ||
207 | #define LPM_SRT BIT(24) /* shorten reset time */ | ||
208 | #define LPM_PFSC BIT(23) /* port force full speed connect */ | ||
209 | #define LPM_PHCD BIT(22) /* PHY low power suspend clock disable */ | ||
210 | #define LPM_STL BIT(16) /* STALL reply to LPM token */ | ||
211 | #define LPM_BA(d) \ | ||
212 | (((d)>>1)&0x7ff) /* bits 11:1, BmAttributes */ | ||
213 | #define LPM_NYT_ACK BIT(0) /* NYET/ACK reply to LPM token */ | ||
214 | u8 _reserved8[0xf4-0xb8]; | ||
215 | /* offset: 0xf4 */ | ||
216 | u32 otgsc; /* On-The-Go status and control */ | ||
217 | #define OTGSC_DPIE BIT(30) /* data pulse interrupt enable */ | ||
218 | #define OTGSC_MSE BIT(29) /* 1 ms timer interrupt enable */ | ||
219 | #define OTGSC_BSEIE BIT(28) /* B session end interrupt enable */ | ||
220 | #define OTGSC_BSVIE BIT(27) /* B session valid interrupt enable */ | ||
221 | #define OTGSC_ASVIE BIT(26) /* A session valid interrupt enable */ | ||
222 | #define OTGSC_AVVIE BIT(25) /* A VBUS valid interrupt enable */ | ||
223 | #define OTGSC_IDIE BIT(24) /* USB ID interrupt enable */ | ||
224 | #define OTGSC_DPIS BIT(22) /* data pulse interrupt status */ | ||
225 | #define OTGSC_MSS BIT(21) /* 1 ms timer interrupt status */ | ||
226 | #define OTGSC_BSEIS BIT(20) /* B session end interrupt status */ | ||
227 | #define OTGSC_BSVIS BIT(19) /* B session valid interrupt status */ | ||
228 | #define OTGSC_ASVIS BIT(18) /* A session valid interrupt status */ | ||
229 | #define OTGSC_AVVIS BIT(17) /* A VBUS valid interrupt status */ | ||
230 | #define OTGSC_IDIS BIT(16) /* USB ID interrupt status */ | ||
231 | #define OTGSC_DPS BIT(14) /* data bus pulsing status */ | ||
232 | #define OTGSC_MST BIT(13) /* 1 ms timer toggle */ | ||
233 | #define OTGSC_BSE BIT(12) /* B session end */ | ||
234 | #define OTGSC_BSV BIT(11) /* B session valid */ | ||
235 | #define OTGSC_ASV BIT(10) /* A session valid */ | ||
236 | #define OTGSC_AVV BIT(9) /* A VBUS valid */ | ||
237 | #define OTGSC_USBID BIT(8) /* USB ID */ | ||
238 | #define OTGSC_HABA BIT(7) /* hw assist B-disconnect to A-connect */ | ||
239 | #define OTGSC_HADP BIT(6) /* hw assist data pulse */ | ||
240 | #define OTGSC_IDPU BIT(5) /* ID pullup */ | ||
241 | #define OTGSC_DP BIT(4) /* data pulsing */ | ||
242 | #define OTGSC_OT BIT(3) /* OTG termination */ | ||
243 | #define OTGSC_HAAR BIT(2) /* hw assist auto reset */ | ||
244 | #define OTGSC_VC BIT(1) /* VBUS charge */ | ||
245 | #define OTGSC_VD BIT(0) /* VBUS discharge */ | ||
246 | u32 usbmode; | ||
247 | #define MODE_VBPS BIT(5) /* R/W VBUS power select */ | ||
248 | #define MODE_SDIS BIT(4) /* R/W stream disable mode */ | ||
249 | #define MODE_SLOM BIT(3) /* R/W setup lockout mode */ | ||
250 | #define MODE_ENSE BIT(2) /* endian select */ | ||
251 | #define MODE_CM(u) (((u)>>0)&3) /* bits 1:0, controller mode */ | ||
252 | #define MODE_IDLE 0 | ||
253 | #define MODE_DEVICE 2 | ||
254 | #define MODE_HOST 3 | ||
255 | u8 _reserved9[0x100-0xfc]; | ||
256 | /* offset: 0x100 */ | ||
257 | u32 endptnak; | ||
258 | #define EPTN(e) \ | ||
259 | (((e)>>16)&0xffff) /* bits 31:16, TX endpoint NAK */ | ||
260 | #define EPRN(e) \ | ||
261 | (((e)>>0)&0xffff) /* bits 15:0, RX endpoint NAK */ | ||
262 | u32 endptnaken; | ||
263 | #define EPTNE(e) \ | ||
264 | (((e)>>16)&0xffff) /* bits 31:16, TX endpoint NAK enable */ | ||
265 | #define EPRNE(e) \ | ||
266 | (((e)>>0)&0xffff) /* bits 15:0, RX endpoint NAK enable */ | ||
267 | u32 endptsetupstat; | ||
268 | #define SETUPSTAT_MASK (0xffff << 0) /* bits 15:0 */ | ||
269 | #define EP0SETUPSTAT_MASK 1 | ||
270 | u32 endptprime; | ||
271 | /* bits 31:16, prime endpoint transmit buffer */ | ||
272 | #define PETB(e) (((e)>>16)&0xffff) | ||
273 | /* bits 15:0, prime endpoint receive buffer */ | ||
274 | #define PERB(e) (((e)>>0)&0xffff) | ||
275 | /* offset: 0x110 */ | ||
276 | u32 endptflush; | ||
277 | /* bits 31:16, flush endpoint transmit buffer */ | ||
278 | #define FETB(e) (((e)>>16)&0xffff) | ||
279 | /* bits 15:0, flush endpoint receive buffer */ | ||
280 | #define FERB(e) (((e)>>0)&0xffff) | ||
281 | u32 endptstat; | ||
282 | /* bits 31:16, endpoint transmit buffer ready */ | ||
283 | #define ETBR(e) (((e)>>16)&0xffff) | ||
284 | /* bits 15:0, endpoint receive buffer ready */ | ||
285 | #define ERBR(e) (((e)>>0)&0xffff) | ||
286 | u32 endptcomplete; | ||
287 | /* bits 31:16, endpoint transmit complete event */ | ||
288 | #define ETCE(e) (((e)>>16)&0xffff) | ||
289 | /* bits 15:0, endpoint receive complete event */ | ||
290 | #define ERCE(e) (((e)>>0)&0xffff) | ||
291 | /* offset: 0x11c */ | ||
292 | u32 endptctrl[16]; | ||
293 | #define EPCTRL_TXE BIT(23) /* TX endpoint enable */ | ||
294 | #define EPCTRL_TXR BIT(22) /* TX data toggle reset */ | ||
295 | #define EPCTRL_TXI BIT(21) /* TX data toggle inhibit */ | ||
296 | #define EPCTRL_TXT(e) (((e)>>18)&3) /* bits 19:18, TX endpoint type */ | ||
297 | #define EPCTRL_TXT_SHIFT 18 | ||
298 | #define EPCTRL_TXD BIT(17) /* TX endpoint data source */ | ||
299 | #define EPCTRL_TXS BIT(16) /* TX endpoint STALL */ | ||
300 | #define EPCTRL_RXE BIT(7) /* RX endpoint enable */ | ||
301 | #define EPCTRL_RXR BIT(6) /* RX data toggle reset */ | ||
302 | #define EPCTRL_RXI BIT(5) /* RX data toggle inhibit */ | ||
303 | #define EPCTRL_RXT(e) (((e)>>2)&3) /* bits 3:2, RX endpoint type */ | ||
304 | #define EPCTRL_RXT_SHIFT 2 /* bits 19:18, TX endpoint type */ | ||
305 | #define EPCTRL_RXD BIT(1) /* RX endpoint data sink */ | ||
306 | #define EPCTRL_RXS BIT(0) /* RX endpoint STALL */ | ||
307 | } __attribute__ ((packed)); | ||
308 | |||
309 | #endif /* __LANGWELL_UDC_H */ | ||
310 | |||
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 1aaa826396a1..2443c0e7a80c 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -80,10 +80,10 @@ struct otg_transceiver { | |||
80 | 80 | ||
81 | /* for board-specific init logic */ | 81 | /* for board-specific init logic */ |
82 | extern int otg_set_transceiver(struct otg_transceiver *); | 82 | extern int otg_set_transceiver(struct otg_transceiver *); |
83 | #ifdef CONFIG_NOP_USB_XCEIV | 83 | |
84 | /* sometimes transceivers are accessed only through e.g. ULPI */ | ||
84 | extern void usb_nop_xceiv_register(void); | 85 | extern void usb_nop_xceiv_register(void); |
85 | extern void usb_nop_xceiv_unregister(void); | 86 | extern void usb_nop_xceiv_unregister(void); |
86 | #endif | ||
87 | 87 | ||
88 | 88 | ||
89 | /* for usb host and peripheral controller drivers */ | 89 | /* for usb host and peripheral controller drivers */ |
diff --git a/include/linux/usb/r8a66597.h b/include/linux/usb/r8a66597.h new file mode 100644 index 000000000000..e9f0384fa20c --- /dev/null +++ b/include/linux/usb/r8a66597.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * R8A66597 driver platform data | ||
3 | * | ||
4 | * Copyright (C) 2009 Renesas Solutions Corp. | ||
5 | * | ||
6 | * Author : Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; version 2 of the License. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
20 | * | ||
21 | */ | ||
22 | |||
23 | #ifndef __LINUX_USB_R8A66597_H | ||
24 | #define __LINUX_USB_R8A66597_H | ||
25 | |||
26 | #define R8A66597_PLATDATA_XTAL_12MHZ 0x01 | ||
27 | #define R8A66597_PLATDATA_XTAL_24MHZ 0x02 | ||
28 | #define R8A66597_PLATDATA_XTAL_48MHZ 0x03 | ||
29 | |||
30 | struct r8a66597_platdata { | ||
31 | /* This ops can controll port power instead of DVSTCTR register. */ | ||
32 | void (*port_power)(int port, int power); | ||
33 | |||
34 | /* (external controller only) set R8A66597_PLATDATA_XTAL_nnMHZ */ | ||
35 | unsigned xtal:2; | ||
36 | |||
37 | /* set one = 3.3V, set zero = 1.5V */ | ||
38 | unsigned vif:1; | ||
39 | |||
40 | /* set one = big endian, set zero = little endian */ | ||
41 | unsigned endian:1; | ||
42 | }; | ||
43 | #endif | ||
44 | |||
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 8cdfed738fe4..44801d26a37a 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/kref.h> | 16 | #include <linux/kref.h> |
17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
18 | #include <linux/sysrq.h> | ||
18 | 19 | ||
19 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ | 20 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ |
20 | #define SERIAL_TTY_MINORS 254 /* loads of devices :) */ | 21 | #define SERIAL_TTY_MINORS 254 /* loads of devices :) */ |
@@ -26,6 +27,13 @@ | |||
26 | /* parity check flag */ | 27 | /* parity check flag */ |
27 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) | 28 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) |
28 | 29 | ||
30 | enum port_dev_state { | ||
31 | PORT_UNREGISTERED, | ||
32 | PORT_REGISTERING, | ||
33 | PORT_REGISTERED, | ||
34 | PORT_UNREGISTERING, | ||
35 | }; | ||
36 | |||
29 | /** | 37 | /** |
30 | * usb_serial_port: structure for the specific ports of a device. | 38 | * usb_serial_port: structure for the specific ports of a device. |
31 | * @serial: pointer back to the struct usb_serial owner of this port. | 39 | * @serial: pointer back to the struct usb_serial owner of this port. |
@@ -91,12 +99,17 @@ struct usb_serial_port { | |||
91 | int write_urb_busy; | 99 | int write_urb_busy; |
92 | __u8 bulk_out_endpointAddress; | 100 | __u8 bulk_out_endpointAddress; |
93 | 101 | ||
102 | int tx_bytes_flight; | ||
103 | int urbs_in_flight; | ||
104 | |||
94 | wait_queue_head_t write_wait; | 105 | wait_queue_head_t write_wait; |
95 | struct work_struct work; | 106 | struct work_struct work; |
96 | char throttled; | 107 | char throttled; |
97 | char throttle_req; | 108 | char throttle_req; |
98 | char console; | 109 | char console; |
110 | unsigned long sysrq; /* sysrq timeout */ | ||
99 | struct device dev; | 111 | struct device dev; |
112 | enum port_dev_state dev_state; | ||
100 | }; | 113 | }; |
101 | #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) | 114 | #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) |
102 | 115 | ||
@@ -181,8 +194,10 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data) | |||
181 | * This will be called when the struct usb_serial structure is fully set | 194 | * This will be called when the struct usb_serial structure is fully set |
182 | * set up. Do any local initialization of the device, or any private | 195 | * set up. Do any local initialization of the device, or any private |
183 | * memory structure allocation at this point in time. | 196 | * memory structure allocation at this point in time. |
184 | * @shutdown: pointer to the driver's shutdown function. This will be | 197 | * @disconnect: pointer to the driver's disconnect function. This will be |
185 | * called when the device is removed from the system. | 198 | * called when the device is unplugged or unbound from the driver. |
199 | * @release: pointer to the driver's release function. This will be called | ||
200 | * when the usb_serial data structure is about to be destroyed. | ||
186 | * @usb_driver: pointer to the struct usb_driver that controls this | 201 | * @usb_driver: pointer to the struct usb_driver that controls this |
187 | * device. This is necessary to allow dynamic ids to be added to | 202 | * device. This is necessary to allow dynamic ids to be added to |
188 | * the driver from sysfs. | 203 | * the driver from sysfs. |
@@ -207,12 +222,14 @@ struct usb_serial_driver { | |||
207 | struct device_driver driver; | 222 | struct device_driver driver; |
208 | struct usb_driver *usb_driver; | 223 | struct usb_driver *usb_driver; |
209 | struct usb_dynids dynids; | 224 | struct usb_dynids dynids; |
225 | int max_in_flight_urbs; | ||
210 | 226 | ||
211 | int (*probe)(struct usb_serial *serial, const struct usb_device_id *id); | 227 | int (*probe)(struct usb_serial *serial, const struct usb_device_id *id); |
212 | int (*attach)(struct usb_serial *serial); | 228 | int (*attach)(struct usb_serial *serial); |
213 | int (*calc_num_ports) (struct usb_serial *serial); | 229 | int (*calc_num_ports) (struct usb_serial *serial); |
214 | 230 | ||
215 | void (*shutdown)(struct usb_serial *serial); | 231 | void (*disconnect)(struct usb_serial *serial); |
232 | void (*release)(struct usb_serial *serial); | ||
216 | 233 | ||
217 | int (*port_probe)(struct usb_serial_port *port); | 234 | int (*port_probe)(struct usb_serial_port *port); |
218 | int (*port_remove)(struct usb_serial_port *port); | 235 | int (*port_remove)(struct usb_serial_port *port); |
@@ -294,9 +311,16 @@ extern void usb_serial_generic_read_bulk_callback(struct urb *urb); | |||
294 | extern void usb_serial_generic_write_bulk_callback(struct urb *urb); | 311 | extern void usb_serial_generic_write_bulk_callback(struct urb *urb); |
295 | extern void usb_serial_generic_throttle(struct tty_struct *tty); | 312 | extern void usb_serial_generic_throttle(struct tty_struct *tty); |
296 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); | 313 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); |
297 | extern void usb_serial_generic_shutdown(struct usb_serial *serial); | 314 | extern void usb_serial_generic_disconnect(struct usb_serial *serial); |
315 | extern void usb_serial_generic_release(struct usb_serial *serial); | ||
298 | extern int usb_serial_generic_register(int debug); | 316 | extern int usb_serial_generic_register(int debug); |
299 | extern void usb_serial_generic_deregister(void); | 317 | extern void usb_serial_generic_deregister(void); |
318 | extern void usb_serial_generic_resubmit_read_urb(struct usb_serial_port *port, | ||
319 | gfp_t mem_flags); | ||
320 | extern int usb_serial_handle_sysrq_char(struct usb_serial_port *port, | ||
321 | unsigned int ch); | ||
322 | extern int usb_serial_handle_break(struct usb_serial_port *port); | ||
323 | |||
300 | 324 | ||
301 | extern int usb_serial_bus_register(struct usb_serial_driver *device); | 325 | extern int usb_serial_bus_register(struct usb_serial_driver *device); |
302 | extern void usb_serial_bus_deregister(struct usb_serial_driver *device); | 326 | extern void usb_serial_bus_deregister(struct usb_serial_driver *device); |
diff --git a/include/linux/utsname.h b/include/linux/utsname.h index 11232676bfff..3656b300de3a 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h | |||
@@ -22,12 +22,12 @@ struct old_utsname { | |||
22 | }; | 22 | }; |
23 | 23 | ||
24 | struct new_utsname { | 24 | struct new_utsname { |
25 | char sysname[65]; | 25 | char sysname[__NEW_UTS_LEN + 1]; |
26 | char nodename[65]; | 26 | char nodename[__NEW_UTS_LEN + 1]; |
27 | char release[65]; | 27 | char release[__NEW_UTS_LEN + 1]; |
28 | char version[65]; | 28 | char version[__NEW_UTS_LEN + 1]; |
29 | char machine[65]; | 29 | char machine[__NEW_UTS_LEN + 1]; |
30 | char domainname[65]; | 30 | char domainname[__NEW_UTS_LEN + 1]; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | #ifdef __KERNEL__ | 33 | #ifdef __KERNEL__ |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index ebb2ea6b4995..f24eceecc5a6 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -347,7 +347,8 @@ struct v4l2_pix_format { | |||
347 | #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ | 347 | #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ |
348 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ | 348 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ |
349 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ | 349 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ |
350 | #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ | 350 | #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ |
351 | #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ | ||
351 | 352 | ||
352 | /* | 353 | /* |
353 | * F O R M A T E N U M E R A T I O N | 354 | * F O R M A T E N U M E R A T I O N |
diff --git a/include/linux/vlynq.h b/include/linux/vlynq.h new file mode 100644 index 000000000000..8f6a95882b09 --- /dev/null +++ b/include/linux/vlynq.h | |||
@@ -0,0 +1,161 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006, 2007 Eugene Konev <ejka@openwrt.org> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef __VLYNQ_H__ | ||
20 | #define __VLYNQ_H__ | ||
21 | |||
22 | #include <linux/device.h> | ||
23 | #include <linux/module.h> | ||
24 | #include <linux/types.h> | ||
25 | |||
26 | #define VLYNQ_NUM_IRQS 32 | ||
27 | |||
28 | struct vlynq_mapping { | ||
29 | u32 size; | ||
30 | u32 offset; | ||
31 | }; | ||
32 | |||
33 | enum vlynq_divisor { | ||
34 | vlynq_div_auto = 0, | ||
35 | vlynq_ldiv1, | ||
36 | vlynq_ldiv2, | ||
37 | vlynq_ldiv3, | ||
38 | vlynq_ldiv4, | ||
39 | vlynq_ldiv5, | ||
40 | vlynq_ldiv6, | ||
41 | vlynq_ldiv7, | ||
42 | vlynq_ldiv8, | ||
43 | vlynq_rdiv1, | ||
44 | vlynq_rdiv2, | ||
45 | vlynq_rdiv3, | ||
46 | vlynq_rdiv4, | ||
47 | vlynq_rdiv5, | ||
48 | vlynq_rdiv6, | ||
49 | vlynq_rdiv7, | ||
50 | vlynq_rdiv8, | ||
51 | vlynq_div_external | ||
52 | }; | ||
53 | |||
54 | struct vlynq_device_id { | ||
55 | u32 id; | ||
56 | enum vlynq_divisor divisor; | ||
57 | unsigned long driver_data; | ||
58 | }; | ||
59 | |||
60 | struct vlynq_regs; | ||
61 | struct vlynq_device { | ||
62 | u32 id, dev_id; | ||
63 | int local_irq; | ||
64 | int remote_irq; | ||
65 | enum vlynq_divisor divisor; | ||
66 | u32 regs_start, regs_end; | ||
67 | u32 mem_start, mem_end; | ||
68 | u32 irq_start, irq_end; | ||
69 | int irq; | ||
70 | int enabled; | ||
71 | struct vlynq_regs *local; | ||
72 | struct vlynq_regs *remote; | ||
73 | struct device dev; | ||
74 | }; | ||
75 | |||
76 | struct vlynq_driver { | ||
77 | char *name; | ||
78 | struct vlynq_device_id *id_table; | ||
79 | int (*probe)(struct vlynq_device *dev, struct vlynq_device_id *id); | ||
80 | void (*remove)(struct vlynq_device *dev); | ||
81 | struct device_driver driver; | ||
82 | }; | ||
83 | |||
84 | struct plat_vlynq_ops { | ||
85 | int (*on)(struct vlynq_device *dev); | ||
86 | void (*off)(struct vlynq_device *dev); | ||
87 | }; | ||
88 | |||
89 | static inline struct vlynq_driver *to_vlynq_driver(struct device_driver *drv) | ||
90 | { | ||
91 | return container_of(drv, struct vlynq_driver, driver); | ||
92 | } | ||
93 | |||
94 | static inline struct vlynq_device *to_vlynq_device(struct device *device) | ||
95 | { | ||
96 | return container_of(device, struct vlynq_device, dev); | ||
97 | } | ||
98 | |||
99 | extern struct bus_type vlynq_bus_type; | ||
100 | |||
101 | extern int __vlynq_register_driver(struct vlynq_driver *driver, | ||
102 | struct module *owner); | ||
103 | |||
104 | static inline int vlynq_register_driver(struct vlynq_driver *driver) | ||
105 | { | ||
106 | return __vlynq_register_driver(driver, THIS_MODULE); | ||
107 | } | ||
108 | |||
109 | static inline void *vlynq_get_drvdata(struct vlynq_device *dev) | ||
110 | { | ||
111 | return dev_get_drvdata(&dev->dev); | ||
112 | } | ||
113 | |||
114 | static inline void vlynq_set_drvdata(struct vlynq_device *dev, void *data) | ||
115 | { | ||
116 | dev_set_drvdata(&dev->dev, data); | ||
117 | } | ||
118 | |||
119 | static inline u32 vlynq_mem_start(struct vlynq_device *dev) | ||
120 | { | ||
121 | return dev->mem_start; | ||
122 | } | ||
123 | |||
124 | static inline u32 vlynq_mem_end(struct vlynq_device *dev) | ||
125 | { | ||
126 | return dev->mem_end; | ||
127 | } | ||
128 | |||
129 | static inline u32 vlynq_mem_len(struct vlynq_device *dev) | ||
130 | { | ||
131 | return dev->mem_end - dev->mem_start + 1; | ||
132 | } | ||
133 | |||
134 | static inline int vlynq_virq_to_irq(struct vlynq_device *dev, int virq) | ||
135 | { | ||
136 | int irq = dev->irq_start + virq; | ||
137 | if ((irq < dev->irq_start) || (irq > dev->irq_end)) | ||
138 | return -EINVAL; | ||
139 | |||
140 | return irq; | ||
141 | } | ||
142 | |||
143 | static inline int vlynq_irq_to_virq(struct vlynq_device *dev, int irq) | ||
144 | { | ||
145 | if ((irq < dev->irq_start) || (irq > dev->irq_end)) | ||
146 | return -EINVAL; | ||
147 | |||
148 | return irq - dev->irq_start; | ||
149 | } | ||
150 | |||
151 | extern void vlynq_unregister_driver(struct vlynq_driver *driver); | ||
152 | extern int vlynq_enable_device(struct vlynq_device *dev); | ||
153 | extern void vlynq_disable_device(struct vlynq_device *dev); | ||
154 | extern int vlynq_set_local_mapping(struct vlynq_device *dev, u32 tx_offset, | ||
155 | struct vlynq_mapping *mapping); | ||
156 | extern int vlynq_set_remote_mapping(struct vlynq_device *dev, u32 tx_offset, | ||
157 | struct vlynq_mapping *mapping); | ||
158 | extern int vlynq_set_local_irq(struct vlynq_device *dev, int virq); | ||
159 | extern int vlynq_set_remote_irq(struct vlynq_device *dev, int virq); | ||
160 | |||
161 | #endif /* __VLYNQ_H__ */ | ||
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 524cd1b28ecb..81a97cf8f0a0 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -36,12 +36,14 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
36 | FOR_ALL_ZONES(PGSTEAL), | 36 | FOR_ALL_ZONES(PGSTEAL), |
37 | FOR_ALL_ZONES(PGSCAN_KSWAPD), | 37 | FOR_ALL_ZONES(PGSCAN_KSWAPD), |
38 | FOR_ALL_ZONES(PGSCAN_DIRECT), | 38 | FOR_ALL_ZONES(PGSCAN_DIRECT), |
39 | #ifdef CONFIG_NUMA | ||
40 | PGSCAN_ZONE_RECLAIM_FAILED, | ||
41 | #endif | ||
39 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, | 42 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, |
40 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, | 43 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, |
41 | #ifdef CONFIG_HUGETLB_PAGE | 44 | #ifdef CONFIG_HUGETLB_PAGE |
42 | HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL, | 45 | HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL, |
43 | #endif | 46 | #endif |
44 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
45 | UNEVICTABLE_PGCULLED, /* culled to noreclaim list */ | 47 | UNEVICTABLE_PGCULLED, /* culled to noreclaim list */ |
46 | UNEVICTABLE_PGSCANNED, /* scanned for reclaimability */ | 48 | UNEVICTABLE_PGSCANNED, /* scanned for reclaimability */ |
47 | UNEVICTABLE_PGRESCUED, /* rescued from noreclaim list */ | 49 | UNEVICTABLE_PGRESCUED, /* rescued from noreclaim list */ |
@@ -50,7 +52,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
50 | UNEVICTABLE_PGCLEARED, /* on COW, page truncate */ | 52 | UNEVICTABLE_PGCLEARED, /* on COW, page truncate */ |
51 | UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */ | 53 | UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */ |
52 | UNEVICTABLE_MLOCKFREED, | 54 | UNEVICTABLE_MLOCKFREED, |
53 | #endif | ||
54 | NR_VM_EVENT_ITEMS | 55 | NR_VM_EVENT_ITEMS |
55 | }; | 56 | }; |
56 | 57 | ||