aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/capability.h6
-rw-r--r--include/linux/dmar.h86
-rw-r--r--include/linux/efi.h2
-rw-r--r--include/linux/efs_fs.h6
-rw-r--r--include/linux/exportfs.h141
-rw-r--r--include/linux/ext2_fs.h1
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/linkage.h6
-rw-r--r--include/linux/memory.h31
-rw-r--r--include/linux/pci.h2
-rw-r--r--include/linux/reiserfs_fs.h12
-rw-r--r--include/linux/scatterlist.h202
-rw-r--r--include/linux/videodev.h42
-rw-r--r--include/linux/videodev2.h92
14 files changed, 377 insertions, 254 deletions
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 7a8d7ade28a0..bb017edffd56 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -56,10 +56,8 @@ typedef struct __user_cap_data_struct {
56 56
57struct vfs_cap_data { 57struct vfs_cap_data {
58 __u32 magic_etc; /* Little endian */ 58 __u32 magic_etc; /* Little endian */
59 struct { 59 __u32 permitted; /* Little endian */
60 __u32 permitted; /* Little endian */ 60 __u32 inheritable; /* Little endian */
61 __u32 inheritable; /* Little endian */
62 } data[1];
63}; 61};
64 62
65#ifdef __KERNEL__ 63#ifdef __KERNEL__
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
new file mode 100644
index 000000000000..ffb6439cb5e6
--- /dev/null
+++ b/include/linux/dmar.h
@@ -0,0 +1,86 @@
1/*
2 * Copyright (c) 2006, Intel Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 *
17 * Copyright (C) Ashok Raj <ashok.raj@intel.com>
18 * Copyright (C) Shaohua Li <shaohua.li@intel.com>
19 */
20
21#ifndef __DMAR_H__
22#define __DMAR_H__
23
24#include <linux/acpi.h>
25#include <linux/types.h>
26#include <linux/msi.h>
27
28#ifdef CONFIG_DMAR
29struct intel_iommu;
30
31extern char *dmar_get_fault_reason(u8 fault_reason);
32
33/* Can't use the common MSI interrupt functions
34 * since DMAR is not a pci device
35 */
36extern void dmar_msi_unmask(unsigned int irq);
37extern void dmar_msi_mask(unsigned int irq);
38extern void dmar_msi_read(int irq, struct msi_msg *msg);
39extern void dmar_msi_write(int irq, struct msi_msg *msg);
40extern int dmar_set_interrupt(struct intel_iommu *iommu);
41extern int arch_setup_dmar_msi(unsigned int irq);
42
43/* Intel IOMMU detection and initialization functions */
44extern void detect_intel_iommu(void);
45extern int intel_iommu_init(void);
46
47extern int dmar_table_init(void);
48extern int early_dmar_detect(void);
49
50extern struct list_head dmar_drhd_units;
51extern struct list_head dmar_rmrr_units;
52
53struct dmar_drhd_unit {
54 struct list_head list; /* list of drhd units */
55 u64 reg_base_addr; /* register base address*/
56 struct pci_dev **devices; /* target device array */
57 int devices_cnt; /* target device count */
58 u8 ignored:1; /* ignore drhd */
59 u8 include_all:1;
60 struct intel_iommu *iommu;
61};
62
63struct dmar_rmrr_unit {
64 struct list_head list; /* list of rmrr units */
65 u64 base_address; /* reserved base address*/
66 u64 end_address; /* reserved end address */
67 struct pci_dev **devices; /* target devices */
68 int devices_cnt; /* target device count */
69};
70
71#define for_each_drhd_unit(drhd) \
72 list_for_each_entry(drhd, &dmar_drhd_units, list)
73#define for_each_rmrr_units(rmrr) \
74 list_for_each_entry(rmrr, &dmar_rmrr_units, list)
75#else
76static inline void detect_intel_iommu(void)
77{
78 return;
79}
80static inline int intel_iommu_init(void)
81{
82 return -ENODEV;
83}
84
85#endif /* !CONFIG_DMAR */
86#endif /* __DMAR_H__ */
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 0b9579a4cd42..14813b595802 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -298,7 +298,7 @@ extern int efi_mem_attribute_range (unsigned long phys_addr, unsigned long size,
298 u64 attr); 298 u64 attr);
299extern int __init efi_uart_console_only (void); 299extern int __init efi_uart_console_only (void);
300extern void efi_initialize_iomem_resources(struct resource *code_resource, 300extern void efi_initialize_iomem_resources(struct resource *code_resource,
301 struct resource *data_resource); 301 struct resource *data_resource, struct resource *bss_resource);
302extern unsigned long efi_get_time(void); 302extern unsigned long efi_get_time(void);
303extern int efi_set_rtc_mmss(unsigned long nowtime); 303extern int efi_set_rtc_mmss(unsigned long nowtime);
304extern int is_available_memory(efi_memory_desc_t * md); 304extern int is_available_memory(efi_memory_desc_t * md);
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h
index 16cb25cbf7c5..dd57fe523e97 100644
--- a/include/linux/efs_fs.h
+++ b/include/linux/efs_fs.h
@@ -35,6 +35,7 @@ static inline struct efs_sb_info *SUPER_INFO(struct super_block *sb)
35} 35}
36 36
37struct statfs; 37struct statfs;
38struct fid;
38 39
39extern const struct inode_operations efs_dir_inode_operations; 40extern const struct inode_operations efs_dir_inode_operations;
40extern const struct file_operations efs_dir_operations; 41extern const struct file_operations efs_dir_operations;
@@ -45,7 +46,10 @@ extern efs_block_t efs_map_block(struct inode *, efs_block_t);
45extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); 46extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int);
46 47
47extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *); 48extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *);
48extern struct dentry *efs_get_dentry(struct super_block *sb, void *vobjp); 49extern struct dentry *efs_fh_to_dentry(struct super_block *sb, struct fid *fid,
50 int fh_len, int fh_type);
51extern struct dentry *efs_fh_to_parent(struct super_block *sb, struct fid *fid,
52 int fh_len, int fh_type);
49extern struct dentry *efs_get_parent(struct dentry *); 53extern struct dentry *efs_get_parent(struct dentry *);
50extern int efs_bmap(struct inode *, int); 54extern int efs_bmap(struct inode *, int);
51 55
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
index 8872fe8392d6..51d214138814 100644
--- a/include/linux/exportfs.h
+++ b/include/linux/exportfs.h
@@ -4,9 +4,48 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct dentry; 6struct dentry;
7struct inode;
7struct super_block; 8struct super_block;
8struct vfsmount; 9struct vfsmount;
9 10
11/*
12 * The fileid_type identifies how the file within the filesystem is encoded.
13 * In theory this is freely set and parsed by the filesystem, but we try to
14 * stick to conventions so we can share some generic code and don't confuse
15 * sniffers like ethereal/wireshark.
16 *
17 * The filesystem must not use the value '0' or '0xff'.
18 */
19enum fid_type {
20 /*
21 * The root, or export point, of the filesystem.
22 * (Never actually passed down to the filesystem.
23 */
24 FILEID_ROOT = 0,
25
26 /*
27 * 32bit inode number, 32 bit generation number.
28 */
29 FILEID_INO32_GEN = 1,
30
31 /*
32 * 32bit inode number, 32 bit generation number,
33 * 32 bit parent directory inode number.
34 */
35 FILEID_INO32_GEN_PARENT = 2,
36};
37
38struct fid {
39 union {
40 struct {
41 u32 ino;
42 u32 gen;
43 u32 parent_ino;
44 u32 parent_gen;
45 } i32;
46 __u32 raw[6];
47 };
48};
10 49
11/** 50/**
12 * struct export_operations - for nfsd to communicate with file systems 51 * struct export_operations - for nfsd to communicate with file systems
@@ -15,43 +54,9 @@ struct vfsmount;
15 * @get_name: find the name for a given inode in a given directory 54 * @get_name: find the name for a given inode in a given directory
16 * @get_parent: find the parent of a given directory 55 * @get_parent: find the parent of a given directory
17 * @get_dentry: find a dentry for the inode given a file handle sub-fragment 56 * @get_dentry: find a dentry for the inode given a file handle sub-fragment
18 * @find_exported_dentry:
19 * set by the exporting module to a standard helper function.
20 *
21 * Description:
22 * The export_operations structure provides a means for nfsd to communicate
23 * with a particular exported file system - particularly enabling nfsd and
24 * the filesystem to co-operate when dealing with file handles.
25 *
26 * export_operations contains two basic operation for dealing with file
27 * handles, decode_fh() and encode_fh(), and allows for some other
28 * operations to be defined which standard helper routines use to get
29 * specific information from the filesystem.
30 *
31 * nfsd encodes information use to determine which filesystem a filehandle
32 * applies to in the initial part of the file handle. The remainder, termed
33 * a file handle fragment, is controlled completely by the filesystem. The
34 * standard helper routines assume that this fragment will contain one or
35 * two sub-fragments, one which identifies the file, and one which may be
36 * used to identify the (a) directory containing the file.
37 * 57 *
38 * In some situations, nfsd needs to get a dentry which is connected into a 58 * See Documentation/filesystems/Exporting for details on how to use
39 * specific part of the file tree. To allow for this, it passes the 59 * this interface correctly.
40 * function acceptable() together with a @context which can be used to see
41 * if the dentry is acceptable. As there can be multiple dentrys for a
42 * given file, the filesystem should check each one for acceptability before
43 * looking for the next. As soon as an acceptable one is found, it should
44 * be returned.
45 *
46 * decode_fh:
47 * @decode_fh is given a &struct super_block (@sb), a file handle fragment
48 * (@fh, @fh_len) and an acceptability testing function (@acceptable,
49 * @context). It should return a &struct dentry which refers to the same
50 * file that the file handle fragment refers to, and which passes the
51 * acceptability test. If it cannot, it should return a %NULL pointer if
52 * the file was found but no acceptable &dentries were available, or a
53 * %ERR_PTR error code indicating why it couldn't be found (e.g. %ENOENT or
54 * %ENOMEM).
55 * 60 *
56 * encode_fh: 61 * encode_fh:
57 * @encode_fh should store in the file handle fragment @fh (using at most 62 * @encode_fh should store in the file handle fragment @fh (using at most
@@ -63,6 +68,21 @@ struct vfsmount;
63 * the filehandle fragment. encode_fh() should return the number of bytes 68 * the filehandle fragment. encode_fh() should return the number of bytes
64 * stored or a negative error code such as %-ENOSPC 69 * stored or a negative error code such as %-ENOSPC
65 * 70 *
71 * fh_to_dentry:
72 * @fh_to_dentry is given a &struct super_block (@sb) and a file handle
73 * fragment (@fh, @fh_len). It should return a &struct dentry which refers
74 * to the same file that the file handle fragment refers to. If it cannot,
75 * it should return a %NULL pointer if the file was found but no acceptable
76 * &dentries were available, or an %ERR_PTR error code indicating why it
77 * couldn't be found (e.g. %ENOENT or %ENOMEM). Any suitable dentry can be
78 * returned including, if necessary, a new dentry created with d_alloc_root.
79 * The caller can then find any other extant dentries by following the
80 * d_alias links.
81 *
82 * fh_to_parent:
83 * Same as @fh_to_dentry, except that it returns a pointer to the parent
84 * dentry if it was encoded into the filehandle fragment by @encode_fh.
85 *
66 * get_name: 86 * get_name:
67 * @get_name should find a name for the given @child in the given @parent 87 * @get_name should find a name for the given @child in the given @parent
68 * directory. The name should be stored in the @name (with the 88 * directory. The name should be stored in the @name (with the
@@ -75,52 +95,37 @@ struct vfsmount;
75 * is also a directory. In the event that it cannot be found, or storage 95 * is also a directory. In the event that it cannot be found, or storage
76 * space cannot be allocated, a %ERR_PTR should be returned. 96 * space cannot be allocated, a %ERR_PTR should be returned.
77 * 97 *
78 * get_dentry:
79 * Given a &super_block (@sb) and a pointer to a file-system specific inode
80 * identifier, possibly an inode number, (@inump) get_dentry() should find
81 * the identified inode and return a dentry for that inode. Any suitable
82 * dentry can be returned including, if necessary, a new dentry created with
83 * d_alloc_root. The caller can then find any other extant dentrys by
84 * following the d_alias links. If a new dentry was created using
85 * d_alloc_root, DCACHE_NFSD_DISCONNECTED should be set, and the dentry
86 * should be d_rehash()ed.
87 *
88 * If the inode cannot be found, either a %NULL pointer or an %ERR_PTR code
89 * can be returned. The @inump will be whatever was passed to
90 * nfsd_find_fh_dentry() in either the @obj or @parent parameters.
91 *
92 * Locking rules: 98 * Locking rules:
93 * get_parent is called with child->d_inode->i_mutex down 99 * get_parent is called with child->d_inode->i_mutex down
94 * get_name is not (which is possibly inconsistent) 100 * get_name is not (which is possibly inconsistent)
95 */ 101 */
96 102
97struct export_operations { 103struct export_operations {
98 struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh,
99 int fh_len, int fh_type,
100 int (*acceptable)(void *context, struct dentry *de),
101 void *context);
102 int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len, 104 int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len,
103 int connectable); 105 int connectable);
106 struct dentry * (*fh_to_dentry)(struct super_block *sb, struct fid *fid,
107 int fh_len, int fh_type);
108 struct dentry * (*fh_to_parent)(struct super_block *sb, struct fid *fid,
109 int fh_len, int fh_type);
104 int (*get_name)(struct dentry *parent, char *name, 110 int (*get_name)(struct dentry *parent, char *name,
105 struct dentry *child); 111 struct dentry *child);
106 struct dentry * (*get_parent)(struct dentry *child); 112 struct dentry * (*get_parent)(struct dentry *child);
107 struct dentry * (*get_dentry)(struct super_block *sb, void *inump);
108
109 /* This is set by the exporting module to a standard helper */
110 struct dentry * (*find_exported_dentry)(
111 struct super_block *sb, void *obj, void *parent,
112 int (*acceptable)(void *context, struct dentry *de),
113 void *context);
114}; 113};
115 114
116extern struct dentry *find_exported_dentry(struct super_block *sb, void *obj, 115extern int exportfs_encode_fh(struct dentry *dentry, struct fid *fid,
117 void *parent, int (*acceptable)(void *context, struct dentry *de), 116 int *max_len, int connectable);
118 void *context); 117extern struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid,
119
120extern int exportfs_encode_fh(struct dentry *dentry, __u32 *fh, int *max_len,
121 int connectable);
122extern struct dentry *exportfs_decode_fh(struct vfsmount *mnt, __u32 *fh,
123 int fh_len, int fileid_type, int (*acceptable)(void *, struct dentry *), 118 int fh_len, int fileid_type, int (*acceptable)(void *, struct dentry *),
124 void *context); 119 void *context);
125 120
121/*
122 * Generic helpers for filesystems.
123 */
124extern struct dentry *generic_fh_to_dentry(struct super_block *sb,
125 struct fid *fid, int fh_len, int fh_type,
126 struct inode *(*get_inode) (struct super_block *sb, u64 ino, u32 gen));
127extern struct dentry *generic_fh_to_parent(struct super_block *sb,
128 struct fid *fid, int fh_len, int fh_type,
129 struct inode *(*get_inode) (struct super_block *sb, u64 ino, u32 gen));
130
126#endif /* LINUX_EXPORTFS_H */ 131#endif /* LINUX_EXPORTFS_H */
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index c77c3bbfe4bb..0f6c86c634fd 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -561,6 +561,7 @@ enum {
561#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) 561#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1)
562#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ 562#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \
563 ~EXT2_DIR_ROUND) 563 ~EXT2_DIR_ROUND)
564#define EXT2_MAX_REC_LEN ((1<<16)-1)
564 565
565static inline ext2_fsblk_t 566static inline ext2_fsblk_t
566ext2_group_first_block_no(struct super_block *sb, unsigned long group_no) 567ext2_group_first_block_no(struct super_block *sb, unsigned long group_no)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 50078bb30a1c..b3ec4a496d64 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -987,7 +987,7 @@ struct super_block {
987 const struct super_operations *s_op; 987 const struct super_operations *s_op;
988 struct dquot_operations *dq_op; 988 struct dquot_operations *dq_op;
989 struct quotactl_ops *s_qcop; 989 struct quotactl_ops *s_qcop;
990 struct export_operations *s_export_op; 990 const struct export_operations *s_export_op;
991 unsigned long s_flags; 991 unsigned long s_flags;
992 unsigned long s_magic; 992 unsigned long s_magic;
993 struct dentry *s_root; 993 struct dentry *s_root;
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index 6c9873f88287..ff203dd02919 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -34,6 +34,12 @@
34 name: 34 name:
35#endif 35#endif
36 36
37#ifndef WEAK
38#define WEAK(name) \
39 .weak name; \
40 name:
41#endif
42
37#define KPROBE_ENTRY(name) \ 43#define KPROBE_ENTRY(name) \
38 .pushsection .kprobes.text, "ax"; \ 44 .pushsection .kprobes.text, "ax"; \
39 ENTRY(name) 45 ENTRY(name)
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 654ef5544878..33f0ff0cf634 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -41,18 +41,15 @@ struct memory_block {
41#define MEM_ONLINE (1<<0) /* exposed to userspace */ 41#define MEM_ONLINE (1<<0) /* exposed to userspace */
42#define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */ 42#define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */
43#define MEM_OFFLINE (1<<2) /* exposed to userspace */ 43#define MEM_OFFLINE (1<<2) /* exposed to userspace */
44#define MEM_GOING_ONLINE (1<<3)
45#define MEM_CANCEL_ONLINE (1<<4)
46#define MEM_CANCEL_OFFLINE (1<<5)
44 47
45/* 48struct memory_notify {
46 * All of these states are currently kernel-internal for notifying 49 unsigned long start_pfn;
47 * kernel components and architectures. 50 unsigned long nr_pages;
48 * 51 int status_change_nid;
49 * For MEM_MAPPING_INVALID, all notifier chains with priority >0 52};
50 * are called before pfn_to_page() becomes invalid. The priority=0
51 * entry is reserved for the function that actually makes
52 * pfn_to_page() stop working. Any notifiers that want to be called
53 * after that should have priority <0.
54 */
55#define MEM_MAPPING_INVALID (1<<3)
56 53
57struct notifier_block; 54struct notifier_block;
58struct mem_section; 55struct mem_section;
@@ -69,21 +66,31 @@ static inline int register_memory_notifier(struct notifier_block *nb)
69static inline void unregister_memory_notifier(struct notifier_block *nb) 66static inline void unregister_memory_notifier(struct notifier_block *nb)
70{ 67{
71} 68}
69static inline int memory_notify(unsigned long val, void *v)
70{
71 return 0;
72}
72#else 73#else
74extern int register_memory_notifier(struct notifier_block *nb);
75extern void unregister_memory_notifier(struct notifier_block *nb);
73extern int register_new_memory(struct mem_section *); 76extern int register_new_memory(struct mem_section *);
74extern int unregister_memory_section(struct mem_section *); 77extern int unregister_memory_section(struct mem_section *);
75extern int memory_dev_init(void); 78extern int memory_dev_init(void);
76extern int remove_memory_block(unsigned long, struct mem_section *, int); 79extern int remove_memory_block(unsigned long, struct mem_section *, int);
77 80extern int memory_notify(unsigned long val, void *v);
78#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) 81#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
79 82
80 83
81#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ 84#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
82 85
86#ifdef CONFIG_MEMORY_HOTPLUG
83#define hotplug_memory_notifier(fn, pri) { \ 87#define hotplug_memory_notifier(fn, pri) { \
84 static struct notifier_block fn##_mem_nb = \ 88 static struct notifier_block fn##_mem_nb = \
85 { .notifier_call = fn, .priority = pri }; \ 89 { .notifier_call = fn, .priority = pri }; \
86 register_memory_notifier(&fn##_mem_nb); \ 90 register_memory_notifier(&fn##_mem_nb); \
87} 91}
92#else
93#define hotplug_memory_notifier(fn, pri) do { } while (0)
94#endif
88 95
89#endif /* _LINUX_MEMORY_H_ */ 96#endif /* _LINUX_MEMORY_H_ */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 768b93359f90..5d2281f661f7 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -141,6 +141,7 @@ struct pci_dev {
141 unsigned int class; /* 3 bytes: (base,sub,prog-if) */ 141 unsigned int class; /* 3 bytes: (base,sub,prog-if) */
142 u8 revision; /* PCI revision, low byte of class word */ 142 u8 revision; /* PCI revision, low byte of class word */
143 u8 hdr_type; /* PCI header type (`multi' flag masked out) */ 143 u8 hdr_type; /* PCI header type (`multi' flag masked out) */
144 u8 pcie_type; /* PCI-E device/port type */
144 u8 rom_base_reg; /* which config register controls the ROM */ 145 u8 rom_base_reg; /* which config register controls the ROM */
145 u8 pin; /* which interrupt pin this device uses */ 146 u8 pin; /* which interrupt pin this device uses */
146 147
@@ -183,6 +184,7 @@ struct pci_dev {
183 unsigned int msi_enabled:1; 184 unsigned int msi_enabled:1;
184 unsigned int msix_enabled:1; 185 unsigned int msix_enabled:1;
185 unsigned int is_managed:1; 186 unsigned int is_managed:1;
187 unsigned int is_pcie:1;
186 atomic_t enable_cnt; /* pci_enable_device has been called */ 188 atomic_t enable_cnt; /* pci_enable_device has been called */
187 189
188 u32 saved_config_space[16]; /* config space saved at suspend time */ 190 u32 saved_config_space[16]; /* config space saved at suspend time */
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 72bfccd3da22..422eab4958a6 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -28,6 +28,8 @@
28#include <linux/reiserfs_fs_sb.h> 28#include <linux/reiserfs_fs_sb.h>
29#endif 29#endif
30 30
31struct fid;
32
31/* 33/*
32 * include/linux/reiser_fs.h 34 * include/linux/reiser_fs.h
33 * 35 *
@@ -1877,12 +1879,10 @@ void reiserfs_delete_inode(struct inode *inode);
1877int reiserfs_write_inode(struct inode *inode, int); 1879int reiserfs_write_inode(struct inode *inode, int);
1878int reiserfs_get_block(struct inode *inode, sector_t block, 1880int reiserfs_get_block(struct inode *inode, sector_t block,
1879 struct buffer_head *bh_result, int create); 1881 struct buffer_head *bh_result, int create);
1880struct dentry *reiserfs_get_dentry(struct super_block *, void *); 1882struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
1881struct dentry *reiserfs_decode_fh(struct super_block *sb, __u32 * data, 1883 int fh_len, int fh_type);
1882 int len, int fhtype, 1884struct dentry *reiserfs_fh_to_parent(struct super_block *sb, struct fid *fid,
1883 int (*acceptable) (void *contect, 1885 int fh_len, int fh_type);
1884 struct dentry * de),
1885 void *context);
1886int reiserfs_encode_fh(struct dentry *dentry, __u32 * data, int *lenp, 1886int reiserfs_encode_fh(struct dentry *dentry, __u32 * data, int *lenp,
1887 int connectable); 1887 int connectable);
1888 1888
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 2dc7464cce52..42daf5e15265 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -4,47 +4,95 @@
4#include <asm/scatterlist.h> 4#include <asm/scatterlist.h>
5#include <linux/mm.h> 5#include <linux/mm.h>
6#include <linux/string.h> 6#include <linux/string.h>
7#include <asm/io.h>
7 8
9/*
10 * Notes on SG table design.
11 *
12 * Architectures must provide an unsigned long page_link field in the
13 * scatterlist struct. We use that to place the page pointer AND encode
14 * information about the sg table as well. The two lower bits are reserved
15 * for this information.
16 *
17 * If bit 0 is set, then the page_link contains a pointer to the next sg
18 * table list. Otherwise the next entry is at sg + 1.
19 *
20 * If bit 1 is set, then this sg entry is the last element in a list.
21 *
22 * See sg_next().
23 *
24 */
25
26#define SG_MAGIC 0x87654321
27
28/**
29 * sg_set_page - Set sg entry to point at given page
30 * @sg: SG entry
31 * @page: The page
32 *
33 * Description:
34 * Use this function to set an sg entry pointing at a page, never assign
35 * the page directly. We encode sg table information in the lower bits
36 * of the page pointer. See sg_page() for looking up the page belonging
37 * to an sg entry.
38 *
39 **/
40static inline void sg_set_page(struct scatterlist *sg, struct page *page)
41{
42 unsigned long page_link = sg->page_link & 0x3;
43
44#ifdef CONFIG_DEBUG_SG
45 BUG_ON(sg->sg_magic != SG_MAGIC);
46#endif
47 sg->page_link = page_link | (unsigned long) page;
48}
49
50#define sg_page(sg) ((struct page *) ((sg)->page_link & ~0x3))
51
52/**
53 * sg_set_buf - Set sg entry to point at given data
54 * @sg: SG entry
55 * @buf: Data
56 * @buflen: Data length
57 *
58 **/
8static inline void sg_set_buf(struct scatterlist *sg, const void *buf, 59static inline void sg_set_buf(struct scatterlist *sg, const void *buf,
9 unsigned int buflen) 60 unsigned int buflen)
10{ 61{
11 sg->page = virt_to_page(buf); 62 sg_set_page(sg, virt_to_page(buf));
12 sg->offset = offset_in_page(buf); 63 sg->offset = offset_in_page(buf);
13 sg->length = buflen; 64 sg->length = buflen;
14} 65}
15 66
16static inline void sg_init_one(struct scatterlist *sg, const void *buf,
17 unsigned int buflen)
18{
19 memset(sg, 0, sizeof(*sg));
20 sg_set_buf(sg, buf, buflen);
21}
22
23/* 67/*
24 * We overload the LSB of the page pointer to indicate whether it's 68 * We overload the LSB of the page pointer to indicate whether it's
25 * a valid sg entry, or whether it points to the start of a new scatterlist. 69 * a valid sg entry, or whether it points to the start of a new scatterlist.
26 * Those low bits are there for everyone! (thanks mason :-) 70 * Those low bits are there for everyone! (thanks mason :-)
27 */ 71 */
28#define sg_is_chain(sg) ((unsigned long) (sg)->page & 0x01) 72#define sg_is_chain(sg) ((sg)->page_link & 0x01)
73#define sg_is_last(sg) ((sg)->page_link & 0x02)
29#define sg_chain_ptr(sg) \ 74#define sg_chain_ptr(sg) \
30 ((struct scatterlist *) ((unsigned long) (sg)->page & ~0x01)) 75 ((struct scatterlist *) ((sg)->page_link & ~0x03))
31 76
32/** 77/**
33 * sg_next - return the next scatterlist entry in a list 78 * sg_next - return the next scatterlist entry in a list
34 * @sg: The current sg entry 79 * @sg: The current sg entry
35 * 80 *
36 * Usually the next entry will be @sg@ + 1, but if this sg element is part 81 * Description:
37 * of a chained scatterlist, it could jump to the start of a new 82 * Usually the next entry will be @sg@ + 1, but if this sg element is part
38 * scatterlist array. 83 * of a chained scatterlist, it could jump to the start of a new
39 * 84 * scatterlist array.
40 * Note that the caller must ensure that there are further entries after
41 * the current entry, this function will NOT return NULL for an end-of-list.
42 * 85 *
43 */ 86 **/
44static inline struct scatterlist *sg_next(struct scatterlist *sg) 87static inline struct scatterlist *sg_next(struct scatterlist *sg)
45{ 88{
46 sg++; 89#ifdef CONFIG_DEBUG_SG
90 BUG_ON(sg->sg_magic != SG_MAGIC);
91#endif
92 if (sg_is_last(sg))
93 return NULL;
47 94
95 sg++;
48 if (unlikely(sg_is_chain(sg))) 96 if (unlikely(sg_is_chain(sg)))
49 sg = sg_chain_ptr(sg); 97 sg = sg_chain_ptr(sg);
50 98
@@ -62,14 +110,15 @@ static inline struct scatterlist *sg_next(struct scatterlist *sg)
62 * @sgl: First entry in the scatterlist 110 * @sgl: First entry in the scatterlist
63 * @nents: Number of entries in the scatterlist 111 * @nents: Number of entries in the scatterlist
64 * 112 *
65 * Should only be used casually, it (currently) scan the entire list 113 * Description:
66 * to get the last entry. 114 * Should only be used casually, it (currently) scan the entire list
115 * to get the last entry.
67 * 116 *
68 * Note that the @sgl@ pointer passed in need not be the first one, 117 * Note that the @sgl@ pointer passed in need not be the first one,
69 * the important bit is that @nents@ denotes the number of entries that 118 * the important bit is that @nents@ denotes the number of entries that
70 * exist from @sgl@. 119 * exist from @sgl@.
71 * 120 *
72 */ 121 **/
73static inline struct scatterlist *sg_last(struct scatterlist *sgl, 122static inline struct scatterlist *sg_last(struct scatterlist *sgl,
74 unsigned int nents) 123 unsigned int nents)
75{ 124{
@@ -83,6 +132,10 @@ static inline struct scatterlist *sg_last(struct scatterlist *sgl,
83 ret = sg; 132 ret = sg;
84 133
85#endif 134#endif
135#ifdef CONFIG_DEBUG_SG
136 BUG_ON(sgl[0].sg_magic != SG_MAGIC);
137 BUG_ON(!sg_is_last(ret));
138#endif
86 return ret; 139 return ret;
87} 140}
88 141
@@ -92,16 +145,111 @@ static inline struct scatterlist *sg_last(struct scatterlist *sgl,
92 * @prv_nents: Number of entries in prv 145 * @prv_nents: Number of entries in prv
93 * @sgl: Second scatterlist 146 * @sgl: Second scatterlist
94 * 147 *
95 * Links @prv@ and @sgl@ together, to form a longer scatterlist. 148 * Description:
149 * Links @prv@ and @sgl@ together, to form a longer scatterlist.
96 * 150 *
97 */ 151 **/
98static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, 152static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
99 struct scatterlist *sgl) 153 struct scatterlist *sgl)
100{ 154{
101#ifndef ARCH_HAS_SG_CHAIN 155#ifndef ARCH_HAS_SG_CHAIN
102 BUG(); 156 BUG();
103#endif 157#endif
104 prv[prv_nents - 1].page = (struct page *) ((unsigned long) sgl | 0x01); 158 prv[prv_nents - 1].page_link = (unsigned long) sgl | 0x01;
159}
160
161/**
162 * sg_mark_end - Mark the end of the scatterlist
163 * @sgl: Scatterlist
164 * @nents: Number of entries in sgl
165 *
166 * Description:
167 * Marks the last entry as the termination point for sg_next()
168 *
169 **/
170static inline void sg_mark_end(struct scatterlist *sgl, unsigned int nents)
171{
172 sgl[nents - 1].page_link = 0x02;
173}
174
175static inline void __sg_mark_end(struct scatterlist *sg)
176{
177 sg->page_link |= 0x02;
178}
179
180/**
181 * sg_init_one - Initialize a single entry sg list
182 * @sg: SG entry
183 * @buf: Virtual address for IO
184 * @buflen: IO length
185 *
186 * Notes:
187 * This should not be used on a single entry that is part of a larger
188 * table. Use sg_init_table() for that.
189 *
190 **/
191static inline void sg_init_one(struct scatterlist *sg, const void *buf,
192 unsigned int buflen)
193{
194 memset(sg, 0, sizeof(*sg));
195#ifdef CONFIG_DEBUG_SG
196 sg->sg_magic = SG_MAGIC;
197#endif
198 sg_mark_end(sg, 1);
199 sg_set_buf(sg, buf, buflen);
200}
201
202/**
203 * sg_init_table - Initialize SG table
204 * @sgl: The SG table
205 * @nents: Number of entries in table
206 *
207 * Notes:
208 * If this is part of a chained sg table, sg_mark_end() should be
209 * used only on the last table part.
210 *
211 **/
212static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
213{
214 memset(sgl, 0, sizeof(*sgl) * nents);
215 sg_mark_end(sgl, nents);
216#ifdef CONFIG_DEBUG_SG
217 {
218 int i;
219 for (i = 0; i < nents; i++)
220 sgl[i].sg_magic = SG_MAGIC;
221 }
222#endif
223}
224
225/**
226 * sg_phys - Return physical address of an sg entry
227 * @sg: SG entry
228 *
229 * Description:
230 * This calls page_to_phys() on the page in this sg entry, and adds the
231 * sg offset. The caller must know that it is legal to call page_to_phys()
232 * on the sg page.
233 *
234 **/
235static inline unsigned long sg_phys(struct scatterlist *sg)
236{
237 return page_to_phys(sg_page(sg)) + sg->offset;
238}
239
240/**
241 * sg_virt - Return virtual address of an sg entry
242 * @sg: SG entry
243 *
244 * Description:
245 * This calls page_address() on the page in this sg entry, and adds the
246 * sg offset. The caller must know that the sg page has a valid virtual
247 * mapping.
248 *
249 **/
250static inline void *sg_virt(struct scatterlist *sg)
251{
252 return page_address(sg_page(sg)) + sg->offset;
105} 253}
106 254
107#endif /* _LINUX_SCATTERLIST_H */ 255#endif /* _LINUX_SCATTERLIST_H */
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index 8dba97a291f6..52e3d5fd5be4 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -294,48 +294,6 @@ struct video_code
294#define VID_PLAY_RESET 13 294#define VID_PLAY_RESET 13
295#define VID_PLAY_END_MARK 14 295#define VID_PLAY_END_MARK 14
296 296
297
298
299#define VID_HARDWARE_BT848 1
300#define VID_HARDWARE_QCAM_BW 2
301#define VID_HARDWARE_PMS 3
302#define VID_HARDWARE_QCAM_C 4
303#define VID_HARDWARE_PSEUDO 5
304#define VID_HARDWARE_SAA5249 6
305#define VID_HARDWARE_AZTECH 7
306#define VID_HARDWARE_SF16MI 8
307#define VID_HARDWARE_RTRACK 9
308#define VID_HARDWARE_ZOLTRIX 10
309#define VID_HARDWARE_SAA7146 11
310#define VID_HARDWARE_VIDEUM 12 /* Reserved for Winnov videum */
311#define VID_HARDWARE_RTRACK2 13
312#define VID_HARDWARE_PERMEDIA2 14 /* Reserved for Permedia2 */
313#define VID_HARDWARE_RIVA128 15 /* Reserved for RIVA 128 */
314#define VID_HARDWARE_PLANB 16 /* PowerMac motherboard video-in */
315#define VID_HARDWARE_BROADWAY 17 /* Broadway project */
316#define VID_HARDWARE_GEMTEK 18
317#define VID_HARDWARE_TYPHOON 19
318#define VID_HARDWARE_VINO 20 /* SGI Indy Vino */
319#define VID_HARDWARE_CADET 21 /* Cadet radio */
320#define VID_HARDWARE_TRUST 22 /* Trust FM Radio */
321#define VID_HARDWARE_TERRATEC 23 /* TerraTec ActiveRadio */
322#define VID_HARDWARE_CPIA 24
323#define VID_HARDWARE_ZR36120 25 /* Zoran ZR36120/ZR36125 */
324#define VID_HARDWARE_ZR36067 26 /* Zoran ZR36067/36060 */
325#define VID_HARDWARE_OV511 27
326#define VID_HARDWARE_ZR356700 28 /* Zoran 36700 series */
327#define VID_HARDWARE_W9966 29
328#define VID_HARDWARE_SE401 30 /* SE401 USB webcams */
329#define VID_HARDWARE_PWC 31 /* Philips webcams */
330#define VID_HARDWARE_MEYE 32 /* Sony Vaio MotionEye cameras */
331#define VID_HARDWARE_CPIA2 33
332#define VID_HARDWARE_VICAM 34
333#define VID_HARDWARE_SF16FMR2 35
334#define VID_HARDWARE_W9968CF 36
335#define VID_HARDWARE_SAA7114H 37
336#define VID_HARDWARE_SN9C102 38
337#define VID_HARDWARE_ARV 39
338
339#endif /* CONFIG_VIDEO_V4L1_COMPAT */ 297#endif /* CONFIG_VIDEO_V4L1_COMPAT */
340 298
341#endif /* __LINUX_VIDEODEV_H */ 299#endif /* __LINUX_VIDEODEV_H */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 1f503e94eff1..439474f24e34 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -441,94 +441,6 @@ struct v4l2_timecode
441#define V4L2_TC_USERBITS_8BITCHARS 0x0008 441#define V4L2_TC_USERBITS_8BITCHARS 0x0008
442/* The above is based on SMPTE timecodes */ 442/* The above is based on SMPTE timecodes */
443 443
444#ifdef __KERNEL__
445/*
446 * M P E G C O M P R E S S I O N P A R A M E T E R S
447 *
448 * ### WARNING: This experimental MPEG compression API is obsolete.
449 * ### It is replaced by the MPEG controls API.
450 * ### This old API will disappear in the near future!
451 *
452 */
453enum v4l2_bitrate_mode {
454 V4L2_BITRATE_NONE = 0, /* not specified */
455 V4L2_BITRATE_CBR, /* constant bitrate */
456 V4L2_BITRATE_VBR, /* variable bitrate */
457};
458struct v4l2_bitrate {
459 /* rates are specified in kbit/sec */
460 enum v4l2_bitrate_mode mode;
461 __u32 min;
462 __u32 target; /* use this one for CBR */
463 __u32 max;
464};
465
466enum v4l2_mpeg_streamtype {
467 V4L2_MPEG_SS_1, /* MPEG-1 system stream */
468 V4L2_MPEG_PS_2, /* MPEG-2 program stream */
469 V4L2_MPEG_TS_2, /* MPEG-2 transport stream */
470 V4L2_MPEG_PS_DVD, /* MPEG-2 program stream with DVD header fixups */
471};
472enum v4l2_mpeg_audiotype {
473 V4L2_MPEG_AU_2_I, /* MPEG-2 layer 1 */
474 V4L2_MPEG_AU_2_II, /* MPEG-2 layer 2 */
475 V4L2_MPEG_AU_2_III, /* MPEG-2 layer 3 */
476 V4L2_MPEG_AC3, /* AC3 */
477 V4L2_MPEG_LPCM, /* LPCM */
478};
479enum v4l2_mpeg_videotype {
480 V4L2_MPEG_VI_1, /* MPEG-1 */
481 V4L2_MPEG_VI_2, /* MPEG-2 */
482};
483enum v4l2_mpeg_aspectratio {
484 V4L2_MPEG_ASPECT_SQUARE = 1, /* square pixel */
485 V4L2_MPEG_ASPECT_4_3 = 2, /* 4 : 3 */
486 V4L2_MPEG_ASPECT_16_9 = 3, /* 16 : 9 */
487 V4L2_MPEG_ASPECT_1_221 = 4, /* 1 : 2,21 */
488};
489
490struct v4l2_mpeg_compression {
491 /* general */
492 enum v4l2_mpeg_streamtype st_type;
493 struct v4l2_bitrate st_bitrate;
494
495 /* transport streams */
496 __u16 ts_pid_pmt;
497 __u16 ts_pid_audio;
498 __u16 ts_pid_video;
499 __u16 ts_pid_pcr;
500
501 /* program stream */
502 __u16 ps_size;
503 __u16 reserved_1; /* align */
504
505 /* audio */
506 enum v4l2_mpeg_audiotype au_type;
507 struct v4l2_bitrate au_bitrate;
508 __u32 au_sample_rate;
509 __u8 au_pesid;
510 __u8 reserved_2[3]; /* align */
511
512 /* video */
513 enum v4l2_mpeg_videotype vi_type;
514 enum v4l2_mpeg_aspectratio vi_aspect_ratio;
515 struct v4l2_bitrate vi_bitrate;
516 __u32 vi_frame_rate;
517 __u16 vi_frames_per_gop;
518 __u16 vi_bframes_count;
519 __u8 vi_pesid;
520 __u8 reserved_3[3]; /* align */
521
522 /* misc flags */
523 __u32 closed_gops:1;
524 __u32 pulldown:1;
525 __u32 reserved_4:30; /* align */
526
527 /* I don't expect the above being perfect yet ;) */
528 __u32 reserved_5[8];
529};
530#endif
531
532struct v4l2_jpegcompression 444struct v4l2_jpegcompression
533{ 445{
534 int quality; 446 int quality;
@@ -1420,10 +1332,6 @@ struct v4l2_chip_ident {
1420#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) 1332#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc)
1421#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) 1333#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
1422#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) 1334#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
1423#ifdef __KERNEL__
1424#define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression)
1425#define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression)
1426#endif
1427#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) 1335#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
1428#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) 1336#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
1429#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) 1337#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)