diff options
Diffstat (limited to 'include')
34 files changed, 572 insertions, 344 deletions
diff --git a/include/asm-arm/arch-omap/tps65010.h b/include/asm-arm/arch-omap/tps65010.h index 0f97bb2e8fce..b9aa2b3a3909 100644 --- a/include/asm-arm/arch-omap/tps65010.h +++ b/include/asm-arm/arch-omap/tps65010.h | |||
@@ -30,6 +30,66 @@ | |||
30 | 30 | ||
31 | /* | 31 | /* |
32 | * ---------------------------------------------------------------------------- | 32 | * ---------------------------------------------------------------------------- |
33 | * Registers, all 8 bits | ||
34 | * ---------------------------------------------------------------------------- | ||
35 | */ | ||
36 | |||
37 | #define TPS_CHGSTATUS 0x01 | ||
38 | # define TPS_CHG_USB (1 << 7) | ||
39 | # define TPS_CHG_AC (1 << 6) | ||
40 | # define TPS_CHG_THERM (1 << 5) | ||
41 | # define TPS_CHG_TERM (1 << 4) | ||
42 | # define TPS_CHG_TAPER_TMO (1 << 3) | ||
43 | # define TPS_CHG_CHG_TMO (1 << 2) | ||
44 | # define TPS_CHG_PRECHG_TMO (1 << 1) | ||
45 | # define TPS_CHG_TEMP_ERR (1 << 0) | ||
46 | #define TPS_REGSTATUS 0x02 | ||
47 | # define TPS_REG_ONOFF (1 << 7) | ||
48 | # define TPS_REG_COVER (1 << 6) | ||
49 | # define TPS_REG_UVLO (1 << 5) | ||
50 | # define TPS_REG_NO_CHG (1 << 4) /* tps65013 */ | ||
51 | # define TPS_REG_PG_LD02 (1 << 3) | ||
52 | # define TPS_REG_PG_LD01 (1 << 2) | ||
53 | # define TPS_REG_PG_MAIN (1 << 1) | ||
54 | # define TPS_REG_PG_CORE (1 << 0) | ||
55 | #define TPS_MASK1 0x03 | ||
56 | #define TPS_MASK2 0x04 | ||
57 | #define TPS_ACKINT1 0x05 | ||
58 | #define TPS_ACKINT2 0x06 | ||
59 | #define TPS_CHGCONFIG 0x07 | ||
60 | # define TPS_CHARGE_POR (1 << 7) /* 65010/65012 */ | ||
61 | # define TPS65013_AUA (1 << 7) /* 65011/65013 */ | ||
62 | # define TPS_CHARGE_RESET (1 << 6) | ||
63 | # define TPS_CHARGE_FAST (1 << 5) | ||
64 | # define TPS_CHARGE_CURRENT (3 << 3) | ||
65 | # define TPS_VBUS_500MA (1 << 2) | ||
66 | # define TPS_VBUS_CHARGING (1 << 1) | ||
67 | # define TPS_CHARGE_ENABLE (1 << 0) | ||
68 | #define TPS_LED1_ON 0x08 | ||
69 | #define TPS_LED1_PER 0x09 | ||
70 | #define TPS_LED2_ON 0x0a | ||
71 | #define TPS_LED2_PER 0x0b | ||
72 | #define TPS_VDCDC1 0x0c | ||
73 | # define TPS_ENABLE_LP (1 << 3) | ||
74 | #define TPS_VDCDC2 0x0d | ||
75 | #define TPS_VREGS1 0x0e | ||
76 | # define TPS_LDO2_ENABLE (1 << 7) | ||
77 | # define TPS_LDO2_OFF (1 << 6) | ||
78 | # define TPS_VLDO2_3_0V (3 << 4) | ||
79 | # define TPS_VLDO2_2_75V (2 << 4) | ||
80 | # define TPS_VLDO2_2_5V (1 << 4) | ||
81 | # define TPS_VLDO2_1_8V (0 << 4) | ||
82 | # define TPS_LDO1_ENABLE (1 << 3) | ||
83 | # define TPS_LDO1_OFF (1 << 2) | ||
84 | # define TPS_VLDO1_3_0V (3 << 0) | ||
85 | # define TPS_VLDO1_2_75V (2 << 0) | ||
86 | # define TPS_VLDO1_2_5V (1 << 0) | ||
87 | # define TPS_VLDO1_ADJ (0 << 0) | ||
88 | #define TPS_MASK3 0x0f | ||
89 | #define TPS_DEFGPIO 0x10 | ||
90 | |||
91 | /* | ||
92 | * ---------------------------------------------------------------------------- | ||
33 | * Macros used by exported functions | 93 | * Macros used by exported functions |
34 | * ---------------------------------------------------------------------------- | 94 | * ---------------------------------------------------------------------------- |
35 | */ | 95 | */ |
@@ -71,10 +131,26 @@ extern int tps65010_set_gpio_out_value(unsigned gpio, unsigned value); | |||
71 | */ | 131 | */ |
72 | extern int tps65010_set_led(unsigned led, unsigned mode); | 132 | extern int tps65010_set_led(unsigned led, unsigned mode); |
73 | 133 | ||
134 | /* tps65010_set_vib parameter: | ||
135 | * value: ON or OFF | ||
136 | */ | ||
137 | extern int tps65010_set_vib(unsigned value); | ||
138 | |||
74 | /* tps65010_set_low_pwr parameter: | 139 | /* tps65010_set_low_pwr parameter: |
75 | * mode: ON or OFF | 140 | * mode: ON or OFF |
76 | */ | 141 | */ |
77 | extern int tps65010_set_low_pwr(unsigned mode); | 142 | extern int tps65010_set_low_pwr(unsigned mode); |
78 | 143 | ||
144 | /* tps65010_config_vregs1 parameter: | ||
145 | * value to be written to VREGS1 register | ||
146 | * Note: The complete register is written, set all bits you need | ||
147 | */ | ||
148 | extern int tps65010_config_vregs1(unsigned value); | ||
149 | |||
150 | /* tps65013_set_low_pwr parameter: | ||
151 | * mode: ON or OFF | ||
152 | */ | ||
153 | extern int tps65013_set_low_pwr(unsigned mode); | ||
154 | |||
79 | #endif /* __ASM_ARCH_TPS65010_H */ | 155 | #endif /* __ASM_ARCH_TPS65010_H */ |
80 | 156 | ||
diff --git a/include/linux/efi.h b/include/linux/efi.h index 047e7222df7a..73781ec165b4 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -315,7 +315,7 @@ extern struct efi_memory_map memmap; | |||
315 | */ | 315 | */ |
316 | static inline int efi_range_is_wc(unsigned long start, unsigned long len) | 316 | static inline int efi_range_is_wc(unsigned long start, unsigned long len) |
317 | { | 317 | { |
318 | int i; | 318 | unsigned long i; |
319 | 319 | ||
320 | for (i = 0; i < len; i += (1UL << EFI_PAGE_SHIFT)) { | 320 | for (i = 0; i < len; i += (1UL << EFI_PAGE_SHIFT)) { |
321 | unsigned long paddr = __pa(start + i); | 321 | unsigned long paddr = __pa(start + i); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 9b8b696d4f15..e5a8db00df29 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -674,6 +674,7 @@ struct file_lock { | |||
674 | struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */ | 674 | struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */ |
675 | union { | 675 | union { |
676 | struct nfs_lock_info nfs_fl; | 676 | struct nfs_lock_info nfs_fl; |
677 | struct nfs4_lock_info nfs4_fl; | ||
677 | } fl_u; | 678 | } fl_u; |
678 | }; | 679 | }; |
679 | 680 | ||
diff --git a/include/linux/i2c-sysfs.h b/include/linux/hwmon-sysfs.h index d7bf6ce11679..1b5018a965f5 100644 --- a/include/linux/i2c-sysfs.h +++ b/include/linux/hwmon-sysfs.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * i2c-sysfs.h - i2c chip driver sysfs defines | 2 | * hwmon-sysfs.h - hardware monitoring chip driver sysfs defines |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Yani Ioannou <yani.ioannou@gmail.com> | 4 | * Copyright (C) 2005 Yani Ioannou <yani.ioannou@gmail.com> |
5 | * | 5 | * |
@@ -17,8 +17,8 @@ | |||
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | */ | 19 | */ |
20 | #ifndef _LINUX_I2C_SYSFS_H | 20 | #ifndef _LINUX_HWMON_SYSFS_H |
21 | #define _LINUX_I2C_SYSFS_H | 21 | #define _LINUX_HWMON_SYSFS_H |
22 | 22 | ||
23 | struct sensor_device_attribute{ | 23 | struct sensor_device_attribute{ |
24 | struct device_attribute dev_attr; | 24 | struct device_attribute dev_attr; |
@@ -33,4 +33,4 @@ struct sensor_device_attribute sensor_dev_attr_##_name = { \ | |||
33 | .index = _index, \ | 33 | .index = _index, \ |
34 | } | 34 | } |
35 | 35 | ||
36 | #endif /* _LINUX_I2C_SYSFS_H */ | 36 | #endif /* _LINUX_HWMON_SYSFS_H */ |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 89270ce51470..33f08258f22b 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -108,6 +108,7 @@ | |||
108 | #define I2C_DRIVERID_TDA7313 62 /* TDA7313 audio processor */ | 108 | #define I2C_DRIVERID_TDA7313 62 /* TDA7313 audio processor */ |
109 | #define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ | 109 | #define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ |
110 | #define I2C_DRIVERID_SAA7114H 64 /* video decoder */ | 110 | #define I2C_DRIVERID_SAA7114H 64 /* video decoder */ |
111 | #define I2C_DRIVERID_DS1374 65 /* DS1374 real time clock */ | ||
111 | 112 | ||
112 | 113 | ||
113 | #define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ | 114 | #define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ |
diff --git a/include/linux/i2c-vid.h b/include/linux/i2c-vid.h index 974835e3530f..41d0635e0ba9 100644 --- a/include/linux/i2c-vid.h +++ b/include/linux/i2c-vid.h | |||
@@ -97,3 +97,15 @@ static inline int vid_from_reg(int val, int vrm) | |||
97 | 2050 - (val) * 50); | 97 | 2050 - (val) * 50); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | |||
101 | static inline int vid_to_reg(int val, int vrm) | ||
102 | { | ||
103 | switch (vrm) { | ||
104 | case 91: /* VRM 9.1 */ | ||
105 | case 90: /* VRM 9.0 */ | ||
106 | return ((val >= 1100) && (val <= 1850) ? | ||
107 | ((18499 - val * 10) / 25 + 5) / 10 : -1); | ||
108 | default: | ||
109 | return -1; | ||
110 | } | ||
111 | } | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index ebcd745f4cd6..be837b13f297 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -290,11 +290,8 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) | |||
290 | */ | 290 | */ |
291 | struct i2c_client_address_data { | 291 | struct i2c_client_address_data { |
292 | unsigned short *normal_i2c; | 292 | unsigned short *normal_i2c; |
293 | unsigned short *normal_i2c_range; | ||
294 | unsigned short *probe; | 293 | unsigned short *probe; |
295 | unsigned short *probe_range; | ||
296 | unsigned short *ignore; | 294 | unsigned short *ignore; |
297 | unsigned short *ignore_range; | ||
298 | unsigned short *force; | 295 | unsigned short *force; |
299 | }; | 296 | }; |
300 | 297 | ||
@@ -563,24 +560,15 @@ union i2c_smbus_data { | |||
563 | #define I2C_CLIENT_INSMOD \ | 560 | #define I2C_CLIENT_INSMOD \ |
564 | I2C_CLIENT_MODULE_PARM(probe, \ | 561 | I2C_CLIENT_MODULE_PARM(probe, \ |
565 | "List of adapter,address pairs to scan additionally"); \ | 562 | "List of adapter,address pairs to scan additionally"); \ |
566 | I2C_CLIENT_MODULE_PARM(probe_range, \ | ||
567 | "List of adapter,start-addr,end-addr triples to scan " \ | ||
568 | "additionally"); \ | ||
569 | I2C_CLIENT_MODULE_PARM(ignore, \ | 563 | I2C_CLIENT_MODULE_PARM(ignore, \ |
570 | "List of adapter,address pairs not to scan"); \ | 564 | "List of adapter,address pairs not to scan"); \ |
571 | I2C_CLIENT_MODULE_PARM(ignore_range, \ | ||
572 | "List of adapter,start-addr,end-addr triples not to " \ | ||
573 | "scan"); \ | ||
574 | I2C_CLIENT_MODULE_PARM(force, \ | 565 | I2C_CLIENT_MODULE_PARM(force, \ |
575 | "List of adapter,address pairs to boldly assume " \ | 566 | "List of adapter,address pairs to boldly assume " \ |
576 | "to be present"); \ | 567 | "to be present"); \ |
577 | static struct i2c_client_address_data addr_data = { \ | 568 | static struct i2c_client_address_data addr_data = { \ |
578 | .normal_i2c = normal_i2c, \ | 569 | .normal_i2c = normal_i2c, \ |
579 | .normal_i2c_range = normal_i2c_range, \ | ||
580 | .probe = probe, \ | 570 | .probe = probe, \ |
581 | .probe_range = probe_range, \ | ||
582 | .ignore = ignore, \ | 571 | .ignore = ignore, \ |
583 | .ignore_range = ignore_range, \ | ||
584 | .force = force, \ | 572 | .force = force, \ |
585 | } | 573 | } |
586 | 574 | ||
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 0d9d22578212..16d4e5a08e1d 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -72,6 +72,8 @@ struct nlm_lockowner { | |||
72 | uint32_t pid; | 72 | uint32_t pid; |
73 | }; | 73 | }; |
74 | 74 | ||
75 | struct nlm_wait; | ||
76 | |||
75 | /* | 77 | /* |
76 | * Memory chunk for NLM client RPC request. | 78 | * Memory chunk for NLM client RPC request. |
77 | */ | 79 | */ |
@@ -81,6 +83,7 @@ struct nlm_rqst { | |||
81 | struct nlm_host * a_host; /* host handle */ | 83 | struct nlm_host * a_host; /* host handle */ |
82 | struct nlm_args a_args; /* arguments */ | 84 | struct nlm_args a_args; /* arguments */ |
83 | struct nlm_res a_res; /* result */ | 85 | struct nlm_res a_res; /* result */ |
86 | struct nlm_wait * a_block; | ||
84 | char a_owner[NLMCLNT_OHSIZE]; | 87 | char a_owner[NLMCLNT_OHSIZE]; |
85 | }; | 88 | }; |
86 | 89 | ||
@@ -142,7 +145,9 @@ extern unsigned long nlmsvc_timeout; | |||
142 | * Lockd client functions | 145 | * Lockd client functions |
143 | */ | 146 | */ |
144 | struct nlm_rqst * nlmclnt_alloc_call(void); | 147 | struct nlm_rqst * nlmclnt_alloc_call(void); |
145 | int nlmclnt_block(struct nlm_host *, struct file_lock *, u32 *); | 148 | int nlmclnt_prepare_block(struct nlm_rqst *req, struct nlm_host *host, struct file_lock *fl); |
149 | void nlmclnt_finish_block(struct nlm_rqst *req); | ||
150 | long nlmclnt_block(struct nlm_rqst *req, long timeout); | ||
146 | int nlmclnt_cancel(struct nlm_host *, struct file_lock *); | 151 | int nlmclnt_cancel(struct nlm_host *, struct file_lock *); |
147 | u32 nlmclnt_grant(struct nlm_lock *); | 152 | u32 nlmclnt_grant(struct nlm_lock *); |
148 | void nlmclnt_recovery(struct nlm_host *, u32); | 153 | void nlmclnt_recovery(struct nlm_host *, u32); |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 5ca8a8d8ccdf..5bb5b2fd7ba2 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -382,6 +382,8 @@ enum { | |||
382 | NFSPROC4_CLNT_READDIR, | 382 | NFSPROC4_CLNT_READDIR, |
383 | NFSPROC4_CLNT_SERVER_CAPS, | 383 | NFSPROC4_CLNT_SERVER_CAPS, |
384 | NFSPROC4_CLNT_DELEGRETURN, | 384 | NFSPROC4_CLNT_DELEGRETURN, |
385 | NFSPROC4_CLNT_GETACL, | ||
386 | NFSPROC4_CLNT_SETACL, | ||
385 | }; | 387 | }; |
386 | 388 | ||
387 | #endif | 389 | #endif |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index dbac7f363e5d..8ea249110fb0 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/pagemap.h> | 15 | #include <linux/pagemap.h> |
16 | #include <linux/rwsem.h> | 16 | #include <linux/rwsem.h> |
17 | #include <linux/wait.h> | 17 | #include <linux/wait.h> |
18 | #include <linux/uio.h> | ||
19 | 18 | ||
20 | #include <linux/nfs_fs_sb.h> | 19 | #include <linux/nfs_fs_sb.h> |
21 | 20 | ||
@@ -29,7 +28,6 @@ | |||
29 | #include <linux/nfs4.h> | 28 | #include <linux/nfs4.h> |
30 | #include <linux/nfs_xdr.h> | 29 | #include <linux/nfs_xdr.h> |
31 | #include <linux/rwsem.h> | 30 | #include <linux/rwsem.h> |
32 | #include <linux/workqueue.h> | ||
33 | #include <linux/mempool.h> | 31 | #include <linux/mempool.h> |
34 | 32 | ||
35 | /* | 33 | /* |
@@ -44,13 +42,6 @@ | |||
44 | #define NFS_DEF_FILE_IO_BUFFER_SIZE 4096 | 42 | #define NFS_DEF_FILE_IO_BUFFER_SIZE 4096 |
45 | 43 | ||
46 | /* | 44 | /* |
47 | * The upper limit on timeouts for the exponential backoff algorithm. | ||
48 | */ | ||
49 | #define NFS_WRITEBACK_DELAY (5*HZ) | ||
50 | #define NFS_WRITEBACK_LOCKDELAY (60*HZ) | ||
51 | #define NFS_COMMIT_DELAY (5*HZ) | ||
52 | |||
53 | /* | ||
54 | * superblock magic number for NFS | 45 | * superblock magic number for NFS |
55 | */ | 46 | */ |
56 | #define NFS_SUPER_MAGIC 0x6969 | 47 | #define NFS_SUPER_MAGIC 0x6969 |
@@ -60,9 +51,6 @@ | |||
60 | */ | 51 | */ |
61 | #define NFS_RPC_SWAPFLAGS (RPC_TASK_SWAPPER|RPC_TASK_ROOTCREDS) | 52 | #define NFS_RPC_SWAPFLAGS (RPC_TASK_SWAPPER|RPC_TASK_ROOTCREDS) |
62 | 53 | ||
63 | #define NFS_RW_SYNC 0x0001 /* O_SYNC handling */ | ||
64 | #define NFS_RW_SWAP 0x0002 /* This is a swap request */ | ||
65 | |||
66 | /* | 54 | /* |
67 | * When flushing a cluster of dirty pages, there can be different | 55 | * When flushing a cluster of dirty pages, there can be different |
68 | * strategies: | 56 | * strategies: |
@@ -96,7 +84,8 @@ struct nfs_open_context { | |||
96 | int error; | 84 | int error; |
97 | 85 | ||
98 | struct list_head list; | 86 | struct list_head list; |
99 | wait_queue_head_t waitq; | 87 | |
88 | __u64 dir_cookie; | ||
100 | }; | 89 | }; |
101 | 90 | ||
102 | /* | 91 | /* |
@@ -104,6 +93,8 @@ struct nfs_open_context { | |||
104 | */ | 93 | */ |
105 | struct nfs_delegation; | 94 | struct nfs_delegation; |
106 | 95 | ||
96 | struct posix_acl; | ||
97 | |||
107 | /* | 98 | /* |
108 | * nfs fs inode data in memory | 99 | * nfs fs inode data in memory |
109 | */ | 100 | */ |
@@ -140,7 +131,6 @@ struct nfs_inode { | |||
140 | * | 131 | * |
141 | * mtime != read_cache_mtime | 132 | * mtime != read_cache_mtime |
142 | */ | 133 | */ |
143 | unsigned long readdir_timestamp; | ||
144 | unsigned long read_cache_jiffies; | 134 | unsigned long read_cache_jiffies; |
145 | unsigned long attrtimeo; | 135 | unsigned long attrtimeo; |
146 | unsigned long attrtimeo_timestamp; | 136 | unsigned long attrtimeo_timestamp; |
@@ -158,6 +148,10 @@ struct nfs_inode { | |||
158 | atomic_t data_updates; | 148 | atomic_t data_updates; |
159 | 149 | ||
160 | struct nfs_access_entry cache_access; | 150 | struct nfs_access_entry cache_access; |
151 | #ifdef CONFIG_NFS_V3_ACL | ||
152 | struct posix_acl *acl_access; | ||
153 | struct posix_acl *acl_default; | ||
154 | #endif | ||
161 | 155 | ||
162 | /* | 156 | /* |
163 | * This is the cookie verifier used for NFSv3 readdir | 157 | * This is the cookie verifier used for NFSv3 readdir |
@@ -183,13 +177,13 @@ struct nfs_inode { | |||
183 | wait_queue_head_t nfs_i_wait; | 177 | wait_queue_head_t nfs_i_wait; |
184 | 178 | ||
185 | #ifdef CONFIG_NFS_V4 | 179 | #ifdef CONFIG_NFS_V4 |
180 | struct nfs4_cached_acl *nfs4_acl; | ||
186 | /* NFSv4 state */ | 181 | /* NFSv4 state */ |
187 | struct list_head open_states; | 182 | struct list_head open_states; |
188 | struct nfs_delegation *delegation; | 183 | struct nfs_delegation *delegation; |
189 | int delegation_state; | 184 | int delegation_state; |
190 | struct rw_semaphore rwsem; | 185 | struct rw_semaphore rwsem; |
191 | #endif /* CONFIG_NFS_V4*/ | 186 | #endif /* CONFIG_NFS_V4*/ |
192 | |||
193 | struct inode vfs_inode; | 187 | struct inode vfs_inode; |
194 | }; | 188 | }; |
195 | 189 | ||
@@ -203,6 +197,8 @@ struct nfs_inode { | |||
203 | #define NFS_INO_INVALID_DATA 0x0010 /* cached data is invalid */ | 197 | #define NFS_INO_INVALID_DATA 0x0010 /* cached data is invalid */ |
204 | #define NFS_INO_INVALID_ATIME 0x0020 /* cached atime is invalid */ | 198 | #define NFS_INO_INVALID_ATIME 0x0020 /* cached atime is invalid */ |
205 | #define NFS_INO_INVALID_ACCESS 0x0040 /* cached access cred invalid */ | 199 | #define NFS_INO_INVALID_ACCESS 0x0040 /* cached access cred invalid */ |
200 | #define NFS_INO_INVALID_ACL 0x0080 /* cached acls are invalid */ | ||
201 | #define NFS_INO_REVAL_PAGECACHE 0x1000 /* must revalidate pagecache */ | ||
206 | 202 | ||
207 | static inline struct nfs_inode *NFS_I(struct inode *inode) | 203 | static inline struct nfs_inode *NFS_I(struct inode *inode) |
208 | { | 204 | { |
@@ -294,12 +290,12 @@ extern int nfs_release(struct inode *, struct file *); | |||
294 | extern int nfs_attribute_timeout(struct inode *inode); | 290 | extern int nfs_attribute_timeout(struct inode *inode); |
295 | extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); | 291 | extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); |
296 | extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); | 292 | extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); |
293 | extern void nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping); | ||
297 | extern int nfs_setattr(struct dentry *, struct iattr *); | 294 | extern int nfs_setattr(struct dentry *, struct iattr *); |
298 | extern void nfs_begin_attr_update(struct inode *); | 295 | extern void nfs_begin_attr_update(struct inode *); |
299 | extern void nfs_end_attr_update(struct inode *); | 296 | extern void nfs_end_attr_update(struct inode *); |
300 | extern void nfs_begin_data_update(struct inode *); | 297 | extern void nfs_begin_data_update(struct inode *); |
301 | extern void nfs_end_data_update(struct inode *); | 298 | extern void nfs_end_data_update(struct inode *); |
302 | extern void nfs_end_data_update_defer(struct inode *); | ||
303 | extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred); | 299 | extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred); |
304 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); | 300 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); |
305 | extern void put_nfs_open_context(struct nfs_open_context *ctx); | 301 | extern void put_nfs_open_context(struct nfs_open_context *ctx); |
@@ -314,6 +310,9 @@ extern u32 root_nfs_parse_addr(char *name); /*__init*/ | |||
314 | * linux/fs/nfs/file.c | 310 | * linux/fs/nfs/file.c |
315 | */ | 311 | */ |
316 | extern struct inode_operations nfs_file_inode_operations; | 312 | extern struct inode_operations nfs_file_inode_operations; |
313 | #ifdef CONFIG_NFS_V3 | ||
314 | extern struct inode_operations nfs3_file_inode_operations; | ||
315 | #endif /* CONFIG_NFS_V3 */ | ||
317 | extern struct file_operations nfs_file_operations; | 316 | extern struct file_operations nfs_file_operations; |
318 | extern struct address_space_operations nfs_file_aops; | 317 | extern struct address_space_operations nfs_file_aops; |
319 | 318 | ||
@@ -329,6 +328,22 @@ static inline struct rpc_cred *nfs_file_cred(struct file *file) | |||
329 | } | 328 | } |
330 | 329 | ||
331 | /* | 330 | /* |
331 | * linux/fs/nfs/xattr.c | ||
332 | */ | ||
333 | #ifdef CONFIG_NFS_V3_ACL | ||
334 | extern ssize_t nfs3_listxattr(struct dentry *, char *, size_t); | ||
335 | extern ssize_t nfs3_getxattr(struct dentry *, const char *, void *, size_t); | ||
336 | extern int nfs3_setxattr(struct dentry *, const char *, | ||
337 | const void *, size_t, int); | ||
338 | extern int nfs3_removexattr (struct dentry *, const char *name); | ||
339 | #else | ||
340 | # define nfs3_listxattr NULL | ||
341 | # define nfs3_getxattr NULL | ||
342 | # define nfs3_setxattr NULL | ||
343 | # define nfs3_removexattr NULL | ||
344 | #endif | ||
345 | |||
346 | /* | ||
332 | * linux/fs/nfs/direct.c | 347 | * linux/fs/nfs/direct.c |
333 | */ | 348 | */ |
334 | extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, | 349 | extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, |
@@ -342,6 +357,9 @@ extern ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, | |||
342 | * linux/fs/nfs/dir.c | 357 | * linux/fs/nfs/dir.c |
343 | */ | 358 | */ |
344 | extern struct inode_operations nfs_dir_inode_operations; | 359 | extern struct inode_operations nfs_dir_inode_operations; |
360 | #ifdef CONFIG_NFS_V3 | ||
361 | extern struct inode_operations nfs3_dir_inode_operations; | ||
362 | #endif /* CONFIG_NFS_V3 */ | ||
345 | extern struct file_operations nfs_dir_operations; | 363 | extern struct file_operations nfs_dir_operations; |
346 | extern struct dentry_operations nfs_dentry_operations; | 364 | extern struct dentry_operations nfs_dentry_operations; |
347 | 365 | ||
@@ -377,10 +395,10 @@ extern void nfs_commit_done(struct rpc_task *); | |||
377 | */ | 395 | */ |
378 | extern int nfs_sync_inode(struct inode *, unsigned long, unsigned int, int); | 396 | extern int nfs_sync_inode(struct inode *, unsigned long, unsigned int, int); |
379 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 397 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
380 | extern int nfs_commit_inode(struct inode *, unsigned long, unsigned int, int); | 398 | extern int nfs_commit_inode(struct inode *, int); |
381 | #else | 399 | #else |
382 | static inline int | 400 | static inline int |
383 | nfs_commit_inode(struct inode *inode, unsigned long idx_start, unsigned int npages, int how) | 401 | nfs_commit_inode(struct inode *inode, int how) |
384 | { | 402 | { |
385 | return 0; | 403 | return 0; |
386 | } | 404 | } |
@@ -434,11 +452,6 @@ static inline void nfs_writedata_free(struct nfs_write_data *p) | |||
434 | mempool_free(p, nfs_wdata_mempool); | 452 | mempool_free(p, nfs_wdata_mempool); |
435 | } | 453 | } |
436 | 454 | ||
437 | /* Hack for future NFS swap support */ | ||
438 | #ifndef IS_SWAPFILE | ||
439 | # define IS_SWAPFILE(inode) (0) | ||
440 | #endif | ||
441 | |||
442 | /* | 455 | /* |
443 | * linux/fs/nfs/read.c | 456 | * linux/fs/nfs/read.c |
444 | */ | 457 | */ |
@@ -468,6 +481,29 @@ static inline void nfs_readdata_free(struct nfs_read_data *p) | |||
468 | extern void nfs_readdata_release(struct rpc_task *task); | 481 | extern void nfs_readdata_release(struct rpc_task *task); |
469 | 482 | ||
470 | /* | 483 | /* |
484 | * linux/fs/nfs3proc.c | ||
485 | */ | ||
486 | #ifdef CONFIG_NFS_V3_ACL | ||
487 | extern struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type); | ||
488 | extern int nfs3_proc_setacl(struct inode *inode, int type, | ||
489 | struct posix_acl *acl); | ||
490 | extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, | ||
491 | mode_t mode); | ||
492 | extern void nfs3_forget_cached_acls(struct inode *inode); | ||
493 | #else | ||
494 | static inline int nfs3_proc_set_default_acl(struct inode *dir, | ||
495 | struct inode *inode, | ||
496 | mode_t mode) | ||
497 | { | ||
498 | return 0; | ||
499 | } | ||
500 | |||
501 | static inline void nfs3_forget_cached_acls(struct inode *inode) | ||
502 | { | ||
503 | } | ||
504 | #endif /* CONFIG_NFS_V3_ACL */ | ||
505 | |||
506 | /* | ||
471 | * linux/fs/mount_clnt.c | 507 | * linux/fs/mount_clnt.c |
472 | * (Used only by nfsroot module) | 508 | * (Used only by nfsroot module) |
473 | */ | 509 | */ |
@@ -515,230 +551,6 @@ extern void * nfs_root_data(void); | |||
515 | 551 | ||
516 | #define NFS_JUKEBOX_RETRY_TIME (5 * HZ) | 552 | #define NFS_JUKEBOX_RETRY_TIME (5 * HZ) |
517 | 553 | ||
518 | #ifdef CONFIG_NFS_V4 | ||
519 | |||
520 | struct idmap; | ||
521 | |||
522 | /* | ||
523 | * In a seqid-mutating op, this macro controls which error return | ||
524 | * values trigger incrementation of the seqid. | ||
525 | * | ||
526 | * from rfc 3010: | ||
527 | * The client MUST monotonically increment the sequence number for the | ||
528 | * CLOSE, LOCK, LOCKU, OPEN, OPEN_CONFIRM, and OPEN_DOWNGRADE | ||
529 | * operations. This is true even in the event that the previous | ||
530 | * operation that used the sequence number received an error. The only | ||
531 | * exception to this rule is if the previous operation received one of | ||
532 | * the following errors: NFSERR_STALE_CLIENTID, NFSERR_STALE_STATEID, | ||
533 | * NFSERR_BAD_STATEID, NFSERR_BAD_SEQID, NFSERR_BADXDR, | ||
534 | * NFSERR_RESOURCE, NFSERR_NOFILEHANDLE. | ||
535 | * | ||
536 | */ | ||
537 | #define seqid_mutating_err(err) \ | ||
538 | (((err) != NFSERR_STALE_CLIENTID) && \ | ||
539 | ((err) != NFSERR_STALE_STATEID) && \ | ||
540 | ((err) != NFSERR_BAD_STATEID) && \ | ||
541 | ((err) != NFSERR_BAD_SEQID) && \ | ||
542 | ((err) != NFSERR_BAD_XDR) && \ | ||
543 | ((err) != NFSERR_RESOURCE) && \ | ||
544 | ((err) != NFSERR_NOFILEHANDLE)) | ||
545 | |||
546 | enum nfs4_client_state { | ||
547 | NFS4CLNT_OK = 0, | ||
548 | }; | ||
549 | |||
550 | /* | ||
551 | * The nfs4_client identifies our client state to the server. | ||
552 | */ | ||
553 | struct nfs4_client { | ||
554 | struct list_head cl_servers; /* Global list of servers */ | ||
555 | struct in_addr cl_addr; /* Server identifier */ | ||
556 | u64 cl_clientid; /* constant */ | ||
557 | nfs4_verifier cl_confirm; | ||
558 | unsigned long cl_state; | ||
559 | |||
560 | u32 cl_lockowner_id; | ||
561 | |||
562 | /* | ||
563 | * The following rwsem ensures exclusive access to the server | ||
564 | * while we recover the state following a lease expiration. | ||
565 | */ | ||
566 | struct rw_semaphore cl_sem; | ||
567 | |||
568 | struct list_head cl_delegations; | ||
569 | struct list_head cl_state_owners; | ||
570 | struct list_head cl_unused; | ||
571 | int cl_nunused; | ||
572 | spinlock_t cl_lock; | ||
573 | atomic_t cl_count; | ||
574 | |||
575 | struct rpc_clnt * cl_rpcclient; | ||
576 | struct rpc_cred * cl_cred; | ||
577 | |||
578 | struct list_head cl_superblocks; /* List of nfs_server structs */ | ||
579 | |||
580 | unsigned long cl_lease_time; | ||
581 | unsigned long cl_last_renewal; | ||
582 | struct work_struct cl_renewd; | ||
583 | struct work_struct cl_recoverd; | ||
584 | |||
585 | wait_queue_head_t cl_waitq; | ||
586 | struct rpc_wait_queue cl_rpcwaitq; | ||
587 | |||
588 | /* used for the setclientid verifier */ | ||
589 | struct timespec cl_boot_time; | ||
590 | |||
591 | /* idmapper */ | ||
592 | struct idmap * cl_idmap; | ||
593 | |||
594 | /* Our own IP address, as a null-terminated string. | ||
595 | * This is used to generate the clientid, and the callback address. | ||
596 | */ | ||
597 | char cl_ipaddr[16]; | ||
598 | unsigned char cl_id_uniquifier; | ||
599 | }; | ||
600 | |||
601 | /* | ||
602 | * NFS4 state_owners and lock_owners are simply labels for ordered | ||
603 | * sequences of RPC calls. Their sole purpose is to provide once-only | ||
604 | * semantics by allowing the server to identify replayed requests. | ||
605 | * | ||
606 | * The ->so_sema is held during all state_owner seqid-mutating operations: | ||
607 | * OPEN, OPEN_DOWNGRADE, and CLOSE. Its purpose is to properly serialize | ||
608 | * so_seqid. | ||
609 | */ | ||
610 | struct nfs4_state_owner { | ||
611 | struct list_head so_list; /* per-clientid list of state_owners */ | ||
612 | struct nfs4_client *so_client; | ||
613 | u32 so_id; /* 32-bit identifier, unique */ | ||
614 | struct semaphore so_sema; | ||
615 | u32 so_seqid; /* protected by so_sema */ | ||
616 | atomic_t so_count; | ||
617 | |||
618 | struct rpc_cred *so_cred; /* Associated cred */ | ||
619 | struct list_head so_states; | ||
620 | struct list_head so_delegations; | ||
621 | }; | ||
622 | |||
623 | /* | ||
624 | * struct nfs4_state maintains the client-side state for a given | ||
625 | * (state_owner,inode) tuple (OPEN) or state_owner (LOCK). | ||
626 | * | ||
627 | * OPEN: | ||
628 | * In order to know when to OPEN_DOWNGRADE or CLOSE the state on the server, | ||
629 | * we need to know how many files are open for reading or writing on a | ||
630 | * given inode. This information too is stored here. | ||
631 | * | ||
632 | * LOCK: one nfs4_state (LOCK) to hold the lock stateid nfs4_state(OPEN) | ||
633 | */ | ||
634 | |||
635 | struct nfs4_lock_state { | ||
636 | struct list_head ls_locks; /* Other lock stateids */ | ||
637 | fl_owner_t ls_owner; /* POSIX lock owner */ | ||
638 | #define NFS_LOCK_INITIALIZED 1 | ||
639 | int ls_flags; | ||
640 | u32 ls_seqid; | ||
641 | u32 ls_id; | ||
642 | nfs4_stateid ls_stateid; | ||
643 | atomic_t ls_count; | ||
644 | }; | ||
645 | |||
646 | /* bits for nfs4_state->flags */ | ||
647 | enum { | ||
648 | LK_STATE_IN_USE, | ||
649 | NFS_DELEGATED_STATE, | ||
650 | }; | ||
651 | |||
652 | struct nfs4_state { | ||
653 | struct list_head open_states; /* List of states for the same state_owner */ | ||
654 | struct list_head inode_states; /* List of states for the same inode */ | ||
655 | struct list_head lock_states; /* List of subservient lock stateids */ | ||
656 | |||
657 | struct nfs4_state_owner *owner; /* Pointer to the open owner */ | ||
658 | struct inode *inode; /* Pointer to the inode */ | ||
659 | |||
660 | unsigned long flags; /* Do we hold any locks? */ | ||
661 | struct semaphore lock_sema; /* Serializes file locking operations */ | ||
662 | rwlock_t state_lock; /* Protects the lock_states list */ | ||
663 | |||
664 | nfs4_stateid stateid; | ||
665 | |||
666 | unsigned int nreaders; | ||
667 | unsigned int nwriters; | ||
668 | int state; /* State on the server (R,W, or RW) */ | ||
669 | atomic_t count; | ||
670 | }; | ||
671 | |||
672 | |||
673 | struct nfs4_exception { | ||
674 | long timeout; | ||
675 | int retry; | ||
676 | }; | ||
677 | |||
678 | struct nfs4_state_recovery_ops { | ||
679 | int (*recover_open)(struct nfs4_state_owner *, struct nfs4_state *); | ||
680 | int (*recover_lock)(struct nfs4_state *, struct file_lock *); | ||
681 | }; | ||
682 | |||
683 | extern struct dentry_operations nfs4_dentry_operations; | ||
684 | extern struct inode_operations nfs4_dir_inode_operations; | ||
685 | |||
686 | /* nfs4proc.c */ | ||
687 | extern int nfs4_map_errors(int err); | ||
688 | extern int nfs4_proc_setclientid(struct nfs4_client *, u32, unsigned short); | ||
689 | extern int nfs4_proc_setclientid_confirm(struct nfs4_client *); | ||
690 | extern int nfs4_proc_async_renew(struct nfs4_client *); | ||
691 | extern int nfs4_proc_renew(struct nfs4_client *); | ||
692 | extern int nfs4_do_close(struct inode *inode, struct nfs4_state *state, mode_t mode); | ||
693 | extern struct inode *nfs4_atomic_open(struct inode *, struct dentry *, struct nameidata *); | ||
694 | extern int nfs4_open_revalidate(struct inode *, struct dentry *, int); | ||
695 | |||
696 | extern struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops; | ||
697 | extern struct nfs4_state_recovery_ops nfs4_network_partition_recovery_ops; | ||
698 | |||
699 | /* nfs4renewd.c */ | ||
700 | extern void nfs4_schedule_state_renewal(struct nfs4_client *); | ||
701 | extern void nfs4_renewd_prepare_shutdown(struct nfs_server *); | ||
702 | extern void nfs4_kill_renewd(struct nfs4_client *); | ||
703 | |||
704 | /* nfs4state.c */ | ||
705 | extern void init_nfsv4_state(struct nfs_server *); | ||
706 | extern void destroy_nfsv4_state(struct nfs_server *); | ||
707 | extern struct nfs4_client *nfs4_get_client(struct in_addr *); | ||
708 | extern void nfs4_put_client(struct nfs4_client *clp); | ||
709 | extern int nfs4_init_client(struct nfs4_client *clp); | ||
710 | extern struct nfs4_client *nfs4_find_client(struct in_addr *); | ||
711 | extern u32 nfs4_alloc_lockowner_id(struct nfs4_client *); | ||
712 | |||
713 | extern struct nfs4_state_owner * nfs4_get_state_owner(struct nfs_server *, struct rpc_cred *); | ||
714 | extern void nfs4_put_state_owner(struct nfs4_state_owner *); | ||
715 | extern void nfs4_drop_state_owner(struct nfs4_state_owner *); | ||
716 | extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *); | ||
717 | extern void nfs4_put_open_state(struct nfs4_state *); | ||
718 | extern void nfs4_close_state(struct nfs4_state *, mode_t); | ||
719 | extern struct nfs4_state *nfs4_find_state(struct inode *, struct rpc_cred *, mode_t mode); | ||
720 | extern void nfs4_increment_seqid(int status, struct nfs4_state_owner *sp); | ||
721 | extern void nfs4_schedule_state_recovery(struct nfs4_client *); | ||
722 | extern struct nfs4_lock_state *nfs4_find_lock_state(struct nfs4_state *state, fl_owner_t); | ||
723 | extern struct nfs4_lock_state *nfs4_get_lock_state(struct nfs4_state *state, fl_owner_t); | ||
724 | extern void nfs4_put_lock_state(struct nfs4_lock_state *state); | ||
725 | extern void nfs4_increment_lock_seqid(int status, struct nfs4_lock_state *ls); | ||
726 | extern void nfs4_notify_setlk(struct nfs4_state *, struct file_lock *, struct nfs4_lock_state *); | ||
727 | extern void nfs4_notify_unlck(struct nfs4_state *, struct file_lock *, struct nfs4_lock_state *); | ||
728 | extern void nfs4_copy_stateid(nfs4_stateid *, struct nfs4_state *, fl_owner_t); | ||
729 | |||
730 | |||
731 | |||
732 | struct nfs4_mount_data; | ||
733 | #else | ||
734 | #define init_nfsv4_state(server) do { } while (0) | ||
735 | #define destroy_nfsv4_state(server) do { } while (0) | ||
736 | #define nfs4_put_state_owner(inode, owner) do { } while (0) | ||
737 | #define nfs4_put_open_state(state) do { } while (0) | ||
738 | #define nfs4_close_state(a, b) do { } while (0) | ||
739 | #define nfs4_renewd_prepare_shutdown(server) do { } while (0) | ||
740 | #endif | ||
741 | |||
742 | #endif /* __KERNEL__ */ | 554 | #endif /* __KERNEL__ */ |
743 | 555 | ||
744 | /* | 556 | /* |
diff --git a/include/linux/nfs_fs_i.h b/include/linux/nfs_fs_i.h index e9a749588a7b..e2c18dabff86 100644 --- a/include/linux/nfs_fs_i.h +++ b/include/linux/nfs_fs_i.h | |||
@@ -16,6 +16,11 @@ struct nfs_lock_info { | |||
16 | struct nlm_lockowner *owner; | 16 | struct nlm_lockowner *owner; |
17 | }; | 17 | }; |
18 | 18 | ||
19 | struct nfs4_lock_state; | ||
20 | struct nfs4_lock_info { | ||
21 | struct nfs4_lock_state *owner; | ||
22 | }; | ||
23 | |||
19 | /* | 24 | /* |
20 | * Lock flag values | 25 | * Lock flag values |
21 | */ | 26 | */ |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index fc51645d61ee..3d3a305488cf 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -10,6 +10,7 @@ | |||
10 | struct nfs_server { | 10 | struct nfs_server { |
11 | struct rpc_clnt * client; /* RPC client handle */ | 11 | struct rpc_clnt * client; /* RPC client handle */ |
12 | struct rpc_clnt * client_sys; /* 2nd handle for FSINFO */ | 12 | struct rpc_clnt * client_sys; /* 2nd handle for FSINFO */ |
13 | struct rpc_clnt * client_acl; /* ACL RPC client handle */ | ||
13 | struct nfs_rpc_ops * rpc_ops; /* NFS protocol vector */ | 14 | struct nfs_rpc_ops * rpc_ops; /* NFS protocol vector */ |
14 | struct backing_dev_info backing_dev_info; | 15 | struct backing_dev_info backing_dev_info; |
15 | int flags; /* various flags */ | 16 | int flags; /* various flags */ |
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h index 0071428231f9..659c75438454 100644 --- a/include/linux/nfs_mount.h +++ b/include/linux/nfs_mount.h | |||
@@ -58,6 +58,7 @@ struct nfs_mount_data { | |||
58 | #define NFS_MOUNT_KERBEROS 0x0100 /* 3 */ | 58 | #define NFS_MOUNT_KERBEROS 0x0100 /* 3 */ |
59 | #define NFS_MOUNT_NONLM 0x0200 /* 3 */ | 59 | #define NFS_MOUNT_NONLM 0x0200 /* 3 */ |
60 | #define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */ | 60 | #define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */ |
61 | #define NFS_MOUNT_NOACL 0x0800 /* 4 */ | ||
61 | #define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ | 62 | #define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ |
62 | #define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ | 63 | #define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ |
63 | #define NFS_MOUNT_FLAGMASK 0xFFFF | 64 | #define NFS_MOUNT_FLAGMASK 0xFFFF |
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 39e4895bcdb4..da2e077b65e2 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
@@ -20,12 +20,19 @@ | |||
20 | #include <asm/atomic.h> | 20 | #include <asm/atomic.h> |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * Valid flags for the radix tree | ||
24 | */ | ||
25 | #define NFS_PAGE_TAG_DIRTY 0 | ||
26 | #define NFS_PAGE_TAG_WRITEBACK 1 | ||
27 | |||
28 | /* | ||
23 | * Valid flags for a dirty buffer | 29 | * Valid flags for a dirty buffer |
24 | */ | 30 | */ |
25 | #define PG_BUSY 0 | 31 | #define PG_BUSY 0 |
26 | #define PG_NEED_COMMIT 1 | 32 | #define PG_NEED_COMMIT 1 |
27 | #define PG_NEED_RESCHED 2 | 33 | #define PG_NEED_RESCHED 2 |
28 | 34 | ||
35 | struct nfs_inode; | ||
29 | struct nfs_page { | 36 | struct nfs_page { |
30 | struct list_head wb_list, /* Defines state of page: */ | 37 | struct list_head wb_list, /* Defines state of page: */ |
31 | *wb_list_head; /* read/write/commit */ | 38 | *wb_list_head; /* read/write/commit */ |
@@ -54,14 +61,17 @@ extern void nfs_clear_request(struct nfs_page *req); | |||
54 | extern void nfs_release_request(struct nfs_page *req); | 61 | extern void nfs_release_request(struct nfs_page *req); |
55 | 62 | ||
56 | 63 | ||
57 | extern void nfs_list_add_request(struct nfs_page *, struct list_head *); | 64 | extern int nfs_scan_lock_dirty(struct nfs_inode *nfsi, struct list_head *dst, |
58 | 65 | unsigned long idx_start, unsigned int npages); | |
59 | extern int nfs_scan_list(struct list_head *, struct list_head *, | 66 | extern int nfs_scan_list(struct list_head *, struct list_head *, |
60 | unsigned long, unsigned int); | 67 | unsigned long, unsigned int); |
61 | extern int nfs_coalesce_requests(struct list_head *, struct list_head *, | 68 | extern int nfs_coalesce_requests(struct list_head *, struct list_head *, |
62 | unsigned int); | 69 | unsigned int); |
63 | extern int nfs_wait_on_request(struct nfs_page *); | 70 | extern int nfs_wait_on_request(struct nfs_page *); |
64 | extern void nfs_unlock_request(struct nfs_page *req); | 71 | extern void nfs_unlock_request(struct nfs_page *req); |
72 | extern int nfs_set_page_writeback_locked(struct nfs_page *req); | ||
73 | extern void nfs_clear_page_writeback(struct nfs_page *req); | ||
74 | |||
65 | 75 | ||
66 | /* | 76 | /* |
67 | * Lock the page of an asynchronous request without incrementing the wb_count | 77 | * Lock the page of an asynchronous request without incrementing the wb_count |
@@ -86,6 +96,18 @@ nfs_lock_request(struct nfs_page *req) | |||
86 | return 1; | 96 | return 1; |
87 | } | 97 | } |
88 | 98 | ||
99 | /** | ||
100 | * nfs_list_add_request - Insert a request into a list | ||
101 | * @req: request | ||
102 | * @head: head of list into which to insert the request. | ||
103 | */ | ||
104 | static inline void | ||
105 | nfs_list_add_request(struct nfs_page *req, struct list_head *head) | ||
106 | { | ||
107 | list_add_tail(&req->wb_list, head); | ||
108 | req->wb_list_head = head; | ||
109 | } | ||
110 | |||
89 | 111 | ||
90 | /** | 112 | /** |
91 | * nfs_list_remove_request - Remove a request from its wb_list | 113 | * nfs_list_remove_request - Remove a request from its wb_list |
@@ -96,10 +118,6 @@ nfs_list_remove_request(struct nfs_page *req) | |||
96 | { | 118 | { |
97 | if (list_empty(&req->wb_list)) | 119 | if (list_empty(&req->wb_list)) |
98 | return; | 120 | return; |
99 | if (!NFS_WBACK_BUSY(req)) { | ||
100 | printk(KERN_ERR "NFS: unlocked request attempted removed from list!\n"); | ||
101 | BUG(); | ||
102 | } | ||
103 | list_del_init(&req->wb_list); | 121 | list_del_init(&req->wb_list); |
104 | req->wb_list_head = NULL; | 122 | req->wb_list_head = NULL; |
105 | } | 123 | } |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 47037d9521cb..a2bf6914ff1b 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_NFS_XDR_H | 2 | #define _LINUX_NFS_XDR_H |
3 | 3 | ||
4 | #include <linux/sunrpc/xprt.h> | 4 | #include <linux/sunrpc/xprt.h> |
5 | #include <linux/nfsacl.h> | ||
5 | 6 | ||
6 | struct nfs4_fsid { | 7 | struct nfs4_fsid { |
7 | __u64 major; | 8 | __u64 major; |
@@ -326,6 +327,20 @@ struct nfs_setattrargs { | |||
326 | const u32 * bitmask; | 327 | const u32 * bitmask; |
327 | }; | 328 | }; |
328 | 329 | ||
330 | struct nfs_setaclargs { | ||
331 | struct nfs_fh * fh; | ||
332 | size_t acl_len; | ||
333 | unsigned int acl_pgbase; | ||
334 | struct page ** acl_pages; | ||
335 | }; | ||
336 | |||
337 | struct nfs_getaclargs { | ||
338 | struct nfs_fh * fh; | ||
339 | size_t acl_len; | ||
340 | unsigned int acl_pgbase; | ||
341 | struct page ** acl_pages; | ||
342 | }; | ||
343 | |||
329 | struct nfs_setattrres { | 344 | struct nfs_setattrres { |
330 | struct nfs_fattr * fattr; | 345 | struct nfs_fattr * fattr; |
331 | const struct nfs_server * server; | 346 | const struct nfs_server * server; |
@@ -354,6 +369,20 @@ struct nfs_readdirargs { | |||
354 | struct page ** pages; | 369 | struct page ** pages; |
355 | }; | 370 | }; |
356 | 371 | ||
372 | struct nfs3_getaclargs { | ||
373 | struct nfs_fh * fh; | ||
374 | int mask; | ||
375 | struct page ** pages; | ||
376 | }; | ||
377 | |||
378 | struct nfs3_setaclargs { | ||
379 | struct inode * inode; | ||
380 | int mask; | ||
381 | struct posix_acl * acl_access; | ||
382 | struct posix_acl * acl_default; | ||
383 | struct page ** pages; | ||
384 | }; | ||
385 | |||
357 | struct nfs_diropok { | 386 | struct nfs_diropok { |
358 | struct nfs_fh * fh; | 387 | struct nfs_fh * fh; |
359 | struct nfs_fattr * fattr; | 388 | struct nfs_fattr * fattr; |
@@ -477,6 +506,15 @@ struct nfs3_readdirres { | |||
477 | int plus; | 506 | int plus; |
478 | }; | 507 | }; |
479 | 508 | ||
509 | struct nfs3_getaclres { | ||
510 | struct nfs_fattr * fattr; | ||
511 | int mask; | ||
512 | unsigned int acl_access_count; | ||
513 | unsigned int acl_default_count; | ||
514 | struct posix_acl * acl_access; | ||
515 | struct posix_acl * acl_default; | ||
516 | }; | ||
517 | |||
480 | #ifdef CONFIG_NFS_V4 | 518 | #ifdef CONFIG_NFS_V4 |
481 | 519 | ||
482 | typedef u64 clientid4; | 520 | typedef u64 clientid4; |
@@ -667,6 +705,7 @@ struct nfs_rpc_ops { | |||
667 | int version; /* Protocol version */ | 705 | int version; /* Protocol version */ |
668 | struct dentry_operations *dentry_ops; | 706 | struct dentry_operations *dentry_ops; |
669 | struct inode_operations *dir_inode_ops; | 707 | struct inode_operations *dir_inode_ops; |
708 | struct inode_operations *file_inode_ops; | ||
670 | 709 | ||
671 | int (*getroot) (struct nfs_server *, struct nfs_fh *, | 710 | int (*getroot) (struct nfs_server *, struct nfs_fh *, |
672 | struct nfs_fsinfo *); | 711 | struct nfs_fsinfo *); |
@@ -713,6 +752,7 @@ struct nfs_rpc_ops { | |||
713 | int (*file_open) (struct inode *, struct file *); | 752 | int (*file_open) (struct inode *, struct file *); |
714 | int (*file_release) (struct inode *, struct file *); | 753 | int (*file_release) (struct inode *, struct file *); |
715 | int (*lock)(struct file *, int, struct file_lock *); | 754 | int (*lock)(struct file *, int, struct file_lock *); |
755 | void (*clear_acl_cache)(struct inode *); | ||
716 | }; | 756 | }; |
717 | 757 | ||
718 | /* | 758 | /* |
@@ -732,4 +772,7 @@ extern struct rpc_version nfs_version2; | |||
732 | extern struct rpc_version nfs_version3; | 772 | extern struct rpc_version nfs_version3; |
733 | extern struct rpc_version nfs_version4; | 773 | extern struct rpc_version nfs_version4; |
734 | 774 | ||
775 | extern struct rpc_version nfsacl_version3; | ||
776 | extern struct rpc_program nfsacl_program; | ||
777 | |||
735 | #endif | 778 | #endif |
diff --git a/include/linux/nfsacl.h b/include/linux/nfsacl.h new file mode 100644 index 000000000000..54487a99beb8 --- /dev/null +++ b/include/linux/nfsacl.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * File: linux/nfsacl.h | ||
3 | * | ||
4 | * (C) 2003 Andreas Gruenbacher <agruen@suse.de> | ||
5 | */ | ||
6 | #ifndef __LINUX_NFSACL_H | ||
7 | #define __LINUX_NFSACL_H | ||
8 | |||
9 | #define NFS_ACL_PROGRAM 100227 | ||
10 | |||
11 | #define ACLPROC2_GETACL 1 | ||
12 | #define ACLPROC2_SETACL 2 | ||
13 | #define ACLPROC2_GETATTR 3 | ||
14 | #define ACLPROC2_ACCESS 4 | ||
15 | |||
16 | #define ACLPROC3_GETACL 1 | ||
17 | #define ACLPROC3_SETACL 2 | ||
18 | |||
19 | |||
20 | /* Flags for the getacl/setacl mode */ | ||
21 | #define NFS_ACL 0x0001 | ||
22 | #define NFS_ACLCNT 0x0002 | ||
23 | #define NFS_DFACL 0x0004 | ||
24 | #define NFS_DFACLCNT 0x0008 | ||
25 | |||
26 | /* Flag for Default ACL entries */ | ||
27 | #define NFS_ACL_DEFAULT 0x1000 | ||
28 | |||
29 | #ifdef __KERNEL__ | ||
30 | |||
31 | #include <linux/posix_acl.h> | ||
32 | |||
33 | /* Maximum number of ACL entries over NFS */ | ||
34 | #define NFS_ACL_MAX_ENTRIES 1024 | ||
35 | |||
36 | #define NFSACL_MAXWORDS (2*(2+3*NFS_ACL_MAX_ENTRIES)) | ||
37 | #define NFSACL_MAXPAGES ((2*(8+12*NFS_ACL_MAX_ENTRIES) + PAGE_SIZE-1) \ | ||
38 | >> PAGE_SHIFT) | ||
39 | |||
40 | static inline unsigned int | ||
41 | nfsacl_size(struct posix_acl *acl_access, struct posix_acl *acl_default) | ||
42 | { | ||
43 | unsigned int w = 16; | ||
44 | w += max(acl_access ? (int)acl_access->a_count : 3, 4) * 12; | ||
45 | if (acl_default) | ||
46 | w += max((int)acl_default->a_count, 4) * 12; | ||
47 | return w; | ||
48 | } | ||
49 | |||
50 | extern unsigned int | ||
51 | nfsacl_encode(struct xdr_buf *buf, unsigned int base, struct inode *inode, | ||
52 | struct posix_acl *acl, int encode_entries, int typeflag); | ||
53 | extern unsigned int | ||
54 | nfsacl_decode(struct xdr_buf *buf, unsigned int base, unsigned int *aclcnt, | ||
55 | struct posix_acl **pacl); | ||
56 | |||
57 | #endif /* __KERNEL__ */ | ||
58 | #endif /* __LINUX_NFSACL_H */ | ||
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 8f85d9a59607..4bf931d5ff56 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/unistd.h> | 15 | #include <linux/unistd.h> |
16 | #include <linux/dirent.h> | 16 | #include <linux/dirent.h> |
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | #include <linux/posix_acl.h> | ||
18 | #include <linux/mount.h> | 19 | #include <linux/mount.h> |
19 | 20 | ||
20 | #include <linux/nfsd/debug.h> | 21 | #include <linux/nfsd/debug.h> |
@@ -124,6 +125,21 @@ int nfsd_statfs(struct svc_rqst *, struct svc_fh *, | |||
124 | int nfsd_notify_change(struct inode *, struct iattr *); | 125 | int nfsd_notify_change(struct inode *, struct iattr *); |
125 | int nfsd_permission(struct svc_export *, struct dentry *, int); | 126 | int nfsd_permission(struct svc_export *, struct dentry *, int); |
126 | 127 | ||
128 | #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) | ||
129 | #ifdef CONFIG_NFSD_V2_ACL | ||
130 | extern struct svc_version nfsd_acl_version2; | ||
131 | #else | ||
132 | #define nfsd_acl_version2 NULL | ||
133 | #endif | ||
134 | #ifdef CONFIG_NFSD_V3_ACL | ||
135 | extern struct svc_version nfsd_acl_version3; | ||
136 | #else | ||
137 | #define nfsd_acl_version3 NULL | ||
138 | #endif | ||
139 | struct posix_acl *nfsd_get_posix_acl(struct svc_fh *, int); | ||
140 | int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *); | ||
141 | #endif | ||
142 | |||
127 | 143 | ||
128 | /* | 144 | /* |
129 | * NFSv4 State | 145 | * NFSv4 State |
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h index ecccef777dae..130d4f588a37 100644 --- a/include/linux/nfsd/xdr.h +++ b/include/linux/nfsd/xdr.h | |||
@@ -169,4 +169,8 @@ int nfssvc_encode_entry(struct readdir_cd *, const char *name, | |||
169 | 169 | ||
170 | int nfssvc_release_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *); | 170 | int nfssvc_release_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *); |
171 | 171 | ||
172 | /* Helper functions for NFSv2 ACL code */ | ||
173 | u32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp); | ||
174 | u32 *nfs2svc_decode_fh(u32 *p, struct svc_fh *fhp); | ||
175 | |||
172 | #endif /* LINUX_NFSD_H */ | 176 | #endif /* LINUX_NFSD_H */ |
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h index 0ae9e0ef5f68..21e18ce7ca63 100644 --- a/include/linux/nfsd/xdr3.h +++ b/include/linux/nfsd/xdr3.h | |||
@@ -110,6 +110,19 @@ struct nfsd3_commitargs { | |||
110 | __u32 count; | 110 | __u32 count; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | struct nfsd3_getaclargs { | ||
114 | struct svc_fh fh; | ||
115 | int mask; | ||
116 | }; | ||
117 | |||
118 | struct posix_acl; | ||
119 | struct nfsd3_setaclargs { | ||
120 | struct svc_fh fh; | ||
121 | int mask; | ||
122 | struct posix_acl *acl_access; | ||
123 | struct posix_acl *acl_default; | ||
124 | }; | ||
125 | |||
113 | struct nfsd3_attrstat { | 126 | struct nfsd3_attrstat { |
114 | __u32 status; | 127 | __u32 status; |
115 | struct svc_fh fh; | 128 | struct svc_fh fh; |
@@ -209,6 +222,14 @@ struct nfsd3_commitres { | |||
209 | struct svc_fh fh; | 222 | struct svc_fh fh; |
210 | }; | 223 | }; |
211 | 224 | ||
225 | struct nfsd3_getaclres { | ||
226 | __u32 status; | ||
227 | struct svc_fh fh; | ||
228 | int mask; | ||
229 | struct posix_acl *acl_access; | ||
230 | struct posix_acl *acl_default; | ||
231 | }; | ||
232 | |||
212 | /* dummy type for release */ | 233 | /* dummy type for release */ |
213 | struct nfsd3_fhandle_pair { | 234 | struct nfsd3_fhandle_pair { |
214 | __u32 dummy; | 235 | __u32 dummy; |
@@ -241,6 +262,7 @@ union nfsd3_xdrstore { | |||
241 | struct nfsd3_fsinfores fsinfores; | 262 | struct nfsd3_fsinfores fsinfores; |
242 | struct nfsd3_pathconfres pathconfres; | 263 | struct nfsd3_pathconfres pathconfres; |
243 | struct nfsd3_commitres commitres; | 264 | struct nfsd3_commitres commitres; |
265 | struct nfsd3_getaclres getaclres; | ||
244 | }; | 266 | }; |
245 | 267 | ||
246 | #define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore) | 268 | #define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore) |
@@ -316,6 +338,10 @@ int nfs3svc_encode_entry(struct readdir_cd *, const char *name, | |||
316 | int nfs3svc_encode_entry_plus(struct readdir_cd *, const char *name, | 338 | int nfs3svc_encode_entry_plus(struct readdir_cd *, const char *name, |
317 | int namlen, loff_t offset, ino_t ino, | 339 | int namlen, loff_t offset, ino_t ino, |
318 | unsigned int); | 340 | unsigned int); |
341 | /* Helper functions for NFSv3 ACL code */ | ||
342 | u32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, u32 *p, | ||
343 | struct svc_fh *fhp); | ||
344 | u32 *nfs3svc_decode_fh(u32 *p, struct svc_fh *fhp); | ||
319 | 345 | ||
320 | 346 | ||
321 | #endif /* _LINUX_NFSD_XDR3_H */ | 347 | #endif /* _LINUX_NFSD_XDR3_H */ |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 2709caf4d128..ab151bbb66df 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -111,6 +111,11 @@ struct rpc_procinfo { | |||
111 | struct rpc_clnt *rpc_create_client(struct rpc_xprt *xprt, char *servname, | 111 | struct rpc_clnt *rpc_create_client(struct rpc_xprt *xprt, char *servname, |
112 | struct rpc_program *info, | 112 | struct rpc_program *info, |
113 | u32 version, rpc_authflavor_t authflavor); | 113 | u32 version, rpc_authflavor_t authflavor); |
114 | struct rpc_clnt *rpc_new_client(struct rpc_xprt *xprt, char *servname, | ||
115 | struct rpc_program *info, | ||
116 | u32 version, rpc_authflavor_t authflavor); | ||
117 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | ||
118 | struct rpc_program *, int); | ||
114 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); | 119 | struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); |
115 | int rpc_shutdown_client(struct rpc_clnt *); | 120 | int rpc_shutdown_client(struct rpc_clnt *); |
116 | int rpc_destroy_client(struct rpc_clnt *); | 121 | int rpc_destroy_client(struct rpc_clnt *); |
@@ -129,6 +134,7 @@ void rpc_clnt_sigmask(struct rpc_clnt *clnt, sigset_t *oldset); | |||
129 | void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset); | 134 | void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset); |
130 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | 135 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); |
131 | size_t rpc_max_payload(struct rpc_clnt *); | 136 | size_t rpc_max_payload(struct rpc_clnt *); |
137 | int rpc_ping(struct rpc_clnt *clnt, int flags); | ||
132 | 138 | ||
133 | static __inline__ | 139 | static __inline__ |
134 | int rpc_call(struct rpc_clnt *clnt, u32 proc, void *argp, void *resp, int flags) | 140 | int rpc_call(struct rpc_clnt *clnt, u32 proc, void *argp, void *resp, int flags) |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 99d17ed7cebb..4d77e90d0b30 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -31,7 +31,6 @@ struct rpc_wait_queue; | |||
31 | struct rpc_wait { | 31 | struct rpc_wait { |
32 | struct list_head list; /* wait queue links */ | 32 | struct list_head list; /* wait queue links */ |
33 | struct list_head links; /* Links to related tasks */ | 33 | struct list_head links; /* Links to related tasks */ |
34 | wait_queue_head_t waitq; /* sync: sleep on this q */ | ||
35 | struct rpc_wait_queue * rpc_waitq; /* RPC wait queue we're on */ | 34 | struct rpc_wait_queue * rpc_waitq; /* RPC wait queue we're on */ |
36 | }; | 35 | }; |
37 | 36 | ||
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 37003970cf2e..5af8800e0ce3 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -185,6 +185,17 @@ xdr_ressize_check(struct svc_rqst *rqstp, u32 *p) | |||
185 | return vec->iov_len <= PAGE_SIZE; | 185 | return vec->iov_len <= PAGE_SIZE; |
186 | } | 186 | } |
187 | 187 | ||
188 | static inline struct page * | ||
189 | svc_take_res_page(struct svc_rqst *rqstp) | ||
190 | { | ||
191 | if (rqstp->rq_arghi <= rqstp->rq_argused) | ||
192 | return NULL; | ||
193 | rqstp->rq_arghi--; | ||
194 | rqstp->rq_respages[rqstp->rq_resused] = | ||
195 | rqstp->rq_argpages[rqstp->rq_arghi]; | ||
196 | return rqstp->rq_respages[rqstp->rq_resused++]; | ||
197 | } | ||
198 | |||
188 | static inline int svc_take_page(struct svc_rqst *rqstp) | 199 | static inline int svc_take_page(struct svc_rqst *rqstp) |
189 | { | 200 | { |
190 | if (rqstp->rq_arghi <= rqstp->rq_argused) | 201 | if (rqstp->rq_arghi <= rqstp->rq_argused) |
@@ -240,9 +251,10 @@ struct svc_deferred_req { | |||
240 | }; | 251 | }; |
241 | 252 | ||
242 | /* | 253 | /* |
243 | * RPC program | 254 | * List of RPC programs on the same transport endpoint |
244 | */ | 255 | */ |
245 | struct svc_program { | 256 | struct svc_program { |
257 | struct svc_program * pg_next; /* other programs (same xprt) */ | ||
246 | u32 pg_prog; /* program number */ | 258 | u32 pg_prog; /* program number */ |
247 | unsigned int pg_lovers; /* lowest version */ | 259 | unsigned int pg_lovers; /* lowest version */ |
248 | unsigned int pg_hivers; /* lowest version */ | 260 | unsigned int pg_hivers; /* lowest version */ |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 541dcf838abf..34ec3e8d99b3 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -146,7 +146,8 @@ extern void xdr_shift_buf(struct xdr_buf *, size_t); | |||
146 | extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); | 146 | extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); |
147 | extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, int, int); | 147 | extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, int, int); |
148 | extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, int); | 148 | extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, int); |
149 | extern int read_bytes_from_xdr_buf(struct xdr_buf *buf, int base, void *obj, int len); | 149 | extern int read_bytes_from_xdr_buf(struct xdr_buf *, int, void *, int); |
150 | extern int write_bytes_to_xdr_buf(struct xdr_buf *, int, void *, int); | ||
150 | 151 | ||
151 | /* | 152 | /* |
152 | * Helper structure for copying from an sk_buff. | 153 | * Helper structure for copying from an sk_buff. |
@@ -160,7 +161,7 @@ typedef struct { | |||
160 | 161 | ||
161 | typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); | 162 | typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); |
162 | 163 | ||
163 | extern void xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, | 164 | extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, |
164 | skb_reader_t *, skb_read_actor_t); | 165 | skb_reader_t *, skb_read_actor_t); |
165 | 166 | ||
166 | struct socket; | 167 | struct socket; |
@@ -168,6 +169,22 @@ struct sockaddr; | |||
168 | extern int xdr_sendpages(struct socket *, struct sockaddr *, int, | 169 | extern int xdr_sendpages(struct socket *, struct sockaddr *, int, |
169 | struct xdr_buf *, unsigned int, int); | 170 | struct xdr_buf *, unsigned int, int); |
170 | 171 | ||
172 | extern int xdr_encode_word(struct xdr_buf *, int, u32); | ||
173 | extern int xdr_decode_word(struct xdr_buf *, int, u32 *); | ||
174 | |||
175 | struct xdr_array2_desc; | ||
176 | typedef int (*xdr_xcode_elem_t)(struct xdr_array2_desc *desc, void *elem); | ||
177 | struct xdr_array2_desc { | ||
178 | unsigned int elem_size; | ||
179 | unsigned int array_len; | ||
180 | xdr_xcode_elem_t xcode; | ||
181 | }; | ||
182 | |||
183 | extern int xdr_decode_array2(struct xdr_buf *buf, unsigned int base, | ||
184 | struct xdr_array2_desc *desc); | ||
185 | extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base, | ||
186 | struct xdr_array2_desc *desc); | ||
187 | |||
171 | /* | 188 | /* |
172 | * Provide some simple tools for XDR buffer overflow-checking etc. | 189 | * Provide some simple tools for XDR buffer overflow-checking etc. |
173 | */ | 190 | */ |
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 2433e279e071..1309c12b8f71 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
@@ -437,6 +437,7 @@ struct snd_ac97_build_ops { | |||
437 | void (*suspend) (ac97_t *ac97); | 437 | void (*suspend) (ac97_t *ac97); |
438 | void (*resume) (ac97_t *ac97); | 438 | void (*resume) (ac97_t *ac97); |
439 | #endif | 439 | #endif |
440 | void (*update_jacks) (ac97_t *ac97); /* for jack-sharing */ | ||
440 | }; | 441 | }; |
441 | 442 | ||
442 | struct _snd_ac97_bus_ops { | 443 | struct _snd_ac97_bus_ops { |
@@ -516,6 +517,9 @@ struct _snd_ac97 { | |||
516 | } ad18xx; | 517 | } ad18xx; |
517 | unsigned int dev_flags; /* device specific */ | 518 | unsigned int dev_flags; /* device specific */ |
518 | } spec; | 519 | } spec; |
520 | /* jack-sharing info */ | ||
521 | unsigned char indep_surround; | ||
522 | unsigned char channel_mode; | ||
519 | }; | 523 | }; |
520 | 524 | ||
521 | /* conditions */ | 525 | /* conditions */ |
@@ -569,8 +573,8 @@ enum { | |||
569 | }; | 573 | }; |
570 | 574 | ||
571 | struct ac97_quirk { | 575 | struct ac97_quirk { |
572 | unsigned short vendor; /* PCI vendor id */ | 576 | unsigned short subvendor; /* PCI subsystem vendor id */ |
573 | unsigned short device; /* PCI device id */ | 577 | unsigned short subdevice; /* PCI sybsystem device id */ |
574 | unsigned short mask; /* device id bit mask, 0 = accept all */ | 578 | unsigned short mask; /* device id bit mask, 0 = accept all */ |
575 | unsigned int codec_id; /* codec id (if any), 0 = accept all */ | 579 | unsigned int codec_id; /* codec id (if any), 0 = accept all */ |
576 | const char *name; /* name shown as info */ | 580 | const char *name; /* name shown as info */ |
diff --git a/include/sound/asound.h b/include/sound/asound.h index a4d149f34541..9974f83cca44 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
@@ -113,9 +113,10 @@ enum sndrv_hwdep_iface { | |||
113 | SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */ | 113 | SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */ |
114 | SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */ | 114 | SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */ |
115 | SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */ | 115 | SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */ |
116 | SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */ | ||
116 | 117 | ||
117 | /* Don't forget to change the following: */ | 118 | /* Don't forget to change the following: */ |
118 | SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_PCXHR | 119 | SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC |
119 | }; | 120 | }; |
120 | 121 | ||
121 | struct sndrv_hwdep_info { | 122 | struct sndrv_hwdep_info { |
@@ -344,7 +345,7 @@ enum sndrv_pcm_hw_param { | |||
344 | SNDRV_PCM_HW_PARAM_LAST_INTERVAL = SNDRV_PCM_HW_PARAM_TICK_TIME | 345 | SNDRV_PCM_HW_PARAM_LAST_INTERVAL = SNDRV_PCM_HW_PARAM_TICK_TIME |
345 | }; | 346 | }; |
346 | 347 | ||
347 | #define SNDRV_PCM_HW_PARAMS_RUNTIME (1<<0) | 348 | #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ |
348 | 349 | ||
349 | struct sndrv_interval { | 350 | struct sndrv_interval { |
350 | unsigned int min, max; | 351 | unsigned int min, max; |
@@ -559,7 +560,7 @@ enum { | |||
559 | * Timer section - /dev/snd/timer | 560 | * Timer section - /dev/snd/timer |
560 | */ | 561 | */ |
561 | 562 | ||
562 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 2) | 563 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 4) |
563 | 564 | ||
564 | enum sndrv_timer_class { | 565 | enum sndrv_timer_class { |
565 | SNDRV_TIMER_CLASS_NONE = -1, | 566 | SNDRV_TIMER_CLASS_NONE = -1, |
@@ -672,10 +673,11 @@ enum { | |||
672 | SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct sndrv_timer_info), | 673 | SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct sndrv_timer_info), |
673 | SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct sndrv_timer_params), | 674 | SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct sndrv_timer_params), |
674 | SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct sndrv_timer_status), | 675 | SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct sndrv_timer_status), |
675 | SNDRV_TIMER_IOCTL_START = _IO('T', 0x20), | 676 | /* The following four ioctls are changed since 1.0.9 due to confliction */ |
676 | SNDRV_TIMER_IOCTL_STOP = _IO('T', 0x21), | 677 | SNDRV_TIMER_IOCTL_START = _IO('T', 0xa0), |
677 | SNDRV_TIMER_IOCTL_CONTINUE = _IO('T', 0x22), | 678 | SNDRV_TIMER_IOCTL_STOP = _IO('T', 0xa1), |
678 | SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0x23), | 679 | SNDRV_TIMER_IOCTL_CONTINUE = _IO('T', 0xa2), |
680 | SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0xa3), | ||
679 | }; | 681 | }; |
680 | 682 | ||
681 | struct sndrv_timer_read { | 683 | struct sndrv_timer_read { |
diff --git a/include/sound/control.h b/include/sound/control.h index 7b9444cd02f4..ef7903c7a327 100644 --- a/include/sound/control.h +++ b/include/sound/control.h | |||
@@ -106,7 +106,7 @@ typedef int (*snd_kctl_ioctl_func_t) (snd_card_t * card, | |||
106 | void snd_ctl_notify(snd_card_t * card, unsigned int mask, snd_ctl_elem_id_t * id); | 106 | void snd_ctl_notify(snd_card_t * card, unsigned int mask, snd_ctl_elem_id_t * id); |
107 | 107 | ||
108 | snd_kcontrol_t *snd_ctl_new(snd_kcontrol_t * kcontrol, unsigned int access); | 108 | snd_kcontrol_t *snd_ctl_new(snd_kcontrol_t * kcontrol, unsigned int access); |
109 | snd_kcontrol_t *snd_ctl_new1(snd_kcontrol_new_t * kcontrolnew, void * private_data); | 109 | snd_kcontrol_t *snd_ctl_new1(const snd_kcontrol_new_t * kcontrolnew, void * private_data); |
110 | void snd_ctl_free_one(snd_kcontrol_t * kcontrol); | 110 | void snd_ctl_free_one(snd_kcontrol_t * kcontrol); |
111 | int snd_ctl_add(snd_card_t * card, snd_kcontrol_t * kcontrol); | 111 | int snd_ctl_add(snd_card_t * card, snd_kcontrol_t * kcontrol); |
112 | int snd_ctl_remove(snd_card_t * card, snd_kcontrol_t * kcontrol); | 112 | int snd_ctl_remove(snd_card_t * card, snd_kcontrol_t * kcontrol); |
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 43b6786abae5..c50b91958ff9 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h | |||
@@ -83,7 +83,8 @@ | |||
83 | #define IPR 0x08 /* Global interrupt pending register */ | 83 | #define IPR 0x08 /* Global interrupt pending register */ |
84 | /* Clear pending interrupts by writing a 1 to */ | 84 | /* Clear pending interrupts by writing a 1 to */ |
85 | /* the relevant bits and zero to the other bits */ | 85 | /* the relevant bits and zero to the other bits */ |
86 | 86 | #define IPR_P16V 0x80000000 /* Bit set when the CA0151 P16V chip wishes | |
87 | to interrupt */ | ||
87 | #define IPR_GPIOMSG 0x20000000 /* GPIO message interrupt (RE'd, still not sure | 88 | #define IPR_GPIOMSG 0x20000000 /* GPIO message interrupt (RE'd, still not sure |
88 | which INTE bits enable it) */ | 89 | which INTE bits enable it) */ |
89 | 90 | ||
@@ -746,6 +747,7 @@ | |||
746 | /* Assumes sample lock */ | 747 | /* Assumes sample lock */ |
747 | 748 | ||
748 | /* These three bitfields apply to CDSRCS, GPSRCS, and (except as noted) ZVSRCS. */ | 749 | /* These three bitfields apply to CDSRCS, GPSRCS, and (except as noted) ZVSRCS. */ |
750 | #define SRCS_SPDIFVALID 0x04000000 /* SPDIF stream valid */ | ||
749 | #define SRCS_SPDIFLOCKED 0x02000000 /* SPDIF stream locked */ | 751 | #define SRCS_SPDIFLOCKED 0x02000000 /* SPDIF stream locked */ |
750 | #define SRCS_RATELOCKED 0x01000000 /* Sample rate locked */ | 752 | #define SRCS_RATELOCKED 0x01000000 /* Sample rate locked */ |
751 | #define SRCS_ESTSAMPLERATE 0x0007ffff /* Do not modify this field. */ | 753 | #define SRCS_ESTSAMPLERATE 0x0007ffff /* Do not modify this field. */ |
@@ -803,10 +805,26 @@ | |||
803 | #define A_FXWC2 0x75 /* Selects 0x9f-0x80 for FX recording */ | 805 | #define A_FXWC2 0x75 /* Selects 0x9f-0x80 for FX recording */ |
804 | 806 | ||
805 | #define A_SPDIF_SAMPLERATE 0x76 /* Set the sample rate of SPDIF output */ | 807 | #define A_SPDIF_SAMPLERATE 0x76 /* Set the sample rate of SPDIF output */ |
806 | #define A_SPDIF_RATE_MASK 0x000000c0 | 808 | #define A_SAMPLE_RATE 0x76 /* Various sample rate settings. */ |
809 | #define A_SAMPLE_RATE_NOT_USED 0x0ffc111e /* Bits that are not used and cannot be set. */ | ||
810 | #define A_SAMPLE_RATE_UNKNOWN 0xf0030001 /* Bits that can be set, but have unknown use. */ | ||
811 | #define A_SPDIF_RATE_MASK 0x000000e0 /* Any other values for rates, just use 48000 */ | ||
807 | #define A_SPDIF_48000 0x00000000 | 812 | #define A_SPDIF_48000 0x00000000 |
808 | #define A_SPDIF_44100 0x00000080 | 813 | #define A_SPDIF_192000 0x00000020 |
809 | #define A_SPDIF_96000 0x00000040 | 814 | #define A_SPDIF_96000 0x00000040 |
815 | #define A_SPDIF_44100 0x00000080 | ||
816 | |||
817 | #define A_I2S_CAPTURE_RATE_MASK 0x00000e00 /* This sets the capture PCM rate, but it is */ | ||
818 | #define A_I2S_CAPTURE_48000 0x00000000 /* unclear if this sets the ADC rate as well. */ | ||
819 | #define A_I2S_CAPTURE_192000 0x00000200 | ||
820 | #define A_I2S_CAPTURE_96000 0x00000400 | ||
821 | #define A_I2S_CAPTURE_44100 0x00000800 | ||
822 | |||
823 | #define A_PCM_RATE_MASK 0x0000e000 /* This sets the playback PCM rate on the P16V */ | ||
824 | #define A_PCM_48000 0x00000000 | ||
825 | #define A_PCM_192000 0x00002000 | ||
826 | #define A_PCM_96000 0x00004000 | ||
827 | #define A_PCM_44100 0x00008000 | ||
810 | 828 | ||
811 | /* 0x77,0x78,0x79 "something i2s-related" - default to 0x01080000 on my audigy 2 ZS --rlrevell */ | 829 | /* 0x77,0x78,0x79 "something i2s-related" - default to 0x01080000 on my audigy 2 ZS --rlrevell */ |
812 | /* 0x7a, 0x7b - lookup tables */ | 830 | /* 0x7a, 0x7b - lookup tables */ |
@@ -1039,28 +1057,28 @@ typedef struct { | |||
1039 | u32 vendor; | 1057 | u32 vendor; |
1040 | u32 device; | 1058 | u32 device; |
1041 | u32 subsystem; | 1059 | u32 subsystem; |
1060 | unsigned char revision; | ||
1042 | unsigned char emu10k1_chip; /* Original SB Live. Not SB Live 24bit. */ | 1061 | unsigned char emu10k1_chip; /* Original SB Live. Not SB Live 24bit. */ |
1043 | unsigned char emu10k2_chip; /* Audigy 1 or Audigy 2. */ | 1062 | unsigned char emu10k2_chip; /* Audigy 1 or Audigy 2. */ |
1044 | unsigned char ca0102_chip; /* Audigy 1 or Audigy 2. Not SB Audigy 2 Value. */ | 1063 | unsigned char ca0102_chip; /* Audigy 1 or Audigy 2. Not SB Audigy 2 Value. */ |
1045 | unsigned char ca0108_chip; /* Audigy 2 Value */ | 1064 | unsigned char ca0108_chip; /* Audigy 2 Value */ |
1046 | unsigned char ca0151_chip; /* P16V */ | 1065 | unsigned char ca0151_chip; /* P16V */ |
1047 | unsigned char spk71; /* Has 7.1 speakers */ | 1066 | unsigned char spk71; /* Has 7.1 speakers */ |
1067 | unsigned char sblive51; /* SBLive! 5.1 - extout 0x11 -> center, 0x12 -> lfe */ | ||
1048 | unsigned char spdif_bug; /* Has Spdif phasing bug */ | 1068 | unsigned char spdif_bug; /* Has Spdif phasing bug */ |
1049 | unsigned char ac97_chip; /* Has an AC97 chip */ | 1069 | unsigned char ac97_chip; /* Has an AC97 chip */ |
1050 | unsigned char ecard; /* APS EEPROM */ | 1070 | unsigned char ecard; /* APS EEPROM */ |
1051 | char * driver; | 1071 | const char *driver; |
1052 | char * name; | 1072 | const char *name; |
1073 | const char *id; /* for backward compatibility - can be NULL if not needed */ | ||
1053 | } emu_chip_details_t; | 1074 | } emu_chip_details_t; |
1054 | 1075 | ||
1055 | struct _snd_emu10k1 { | 1076 | struct _snd_emu10k1 { |
1056 | int irq; | 1077 | int irq; |
1057 | 1078 | ||
1058 | unsigned long port; /* I/O port number */ | 1079 | unsigned long port; /* I/O port number */ |
1059 | unsigned int APS: 1, /* APS flag */ | 1080 | unsigned int tos_link: 1, /* tos link detected */ |
1060 | no_ac97: 1, /* no AC'97 */ | 1081 | rear_ac97: 1; /* rear channels are on AC'97 */ |
1061 | tos_link: 1, /* tos link detected */ | ||
1062 | rear_ac97: 1, /* rear channels are on AC'97 */ | ||
1063 | spk71:1; /* 7.1 configuration (Audigy 2 ZS) */ | ||
1064 | const emu_chip_details_t *card_capabilities; /* Contains profile of card capabilities */ | 1082 | const emu_chip_details_t *card_capabilities; /* Contains profile of card capabilities */ |
1065 | unsigned int audigy; /* is Audigy? */ | 1083 | unsigned int audigy; /* is Audigy? */ |
1066 | unsigned int revision; /* chip revision */ | 1084 | unsigned int revision; /* chip revision */ |
@@ -1109,7 +1127,10 @@ struct _snd_emu10k1 { | |||
1109 | 1127 | ||
1110 | emu10k1_voice_t voices[NUM_G]; | 1128 | emu10k1_voice_t voices[NUM_G]; |
1111 | emu10k1_voice_t p16v_voices[4]; | 1129 | emu10k1_voice_t p16v_voices[4]; |
1130 | emu10k1_voice_t p16v_capture_voice; | ||
1112 | int p16v_device_offset; | 1131 | int p16v_device_offset; |
1132 | u32 p16v_capture_source; | ||
1133 | u32 p16v_capture_channel; | ||
1113 | emu10k1_pcm_mixer_t pcm_mixer[32]; | 1134 | emu10k1_pcm_mixer_t pcm_mixer[32]; |
1114 | emu10k1_pcm_mixer_t efx_pcm_mixer[NUM_EFX_PLAYBACK]; | 1135 | emu10k1_pcm_mixer_t efx_pcm_mixer[NUM_EFX_PLAYBACK]; |
1115 | snd_kcontrol_t *ctl_send_routing; | 1136 | snd_kcontrol_t *ctl_send_routing; |
@@ -1453,7 +1474,6 @@ int snd_emu10k1_fx8010_unregister_irq_handler(emu10k1_t *emu, | |||
1453 | #endif | 1474 | #endif |
1454 | 1475 | ||
1455 | typedef struct { | 1476 | typedef struct { |
1456 | unsigned int card; /* card type */ | ||
1457 | unsigned int internal_tram_size; /* in samples */ | 1477 | unsigned int internal_tram_size; /* in samples */ |
1458 | unsigned int external_tram_size; /* in samples */ | 1478 | unsigned int external_tram_size; /* in samples */ |
1459 | char fxbus_names[16][32]; /* names of FXBUSes */ | 1479 | char fxbus_names[16][32]; /* names of FXBUSes */ |
diff --git a/include/sound/gus.h b/include/sound/gus.h index 8b6287a6fff5..b4b461ca173d 100644 --- a/include/sound/gus.h +++ b/include/sound/gus.h | |||
@@ -526,9 +526,6 @@ extern void snd_gf1_adlib_write(snd_gus_card_t * gus, unsigned char reg, unsigne | |||
526 | extern void snd_gf1_dram_addr(snd_gus_card_t * gus, unsigned int addr); | 526 | extern void snd_gf1_dram_addr(snd_gus_card_t * gus, unsigned int addr); |
527 | extern void snd_gf1_poke(snd_gus_card_t * gus, unsigned int addr, unsigned char data); | 527 | extern void snd_gf1_poke(snd_gus_card_t * gus, unsigned int addr, unsigned char data); |
528 | extern unsigned char snd_gf1_peek(snd_gus_card_t * gus, unsigned int addr); | 528 | extern unsigned char snd_gf1_peek(snd_gus_card_t * gus, unsigned int addr); |
529 | extern void snd_gf1_pokew(snd_gus_card_t * gus, unsigned int addr, unsigned short data); | ||
530 | extern unsigned short snd_gf1_peekw(snd_gus_card_t * gus, unsigned int addr); | ||
531 | extern void snd_gf1_dram_setmem(snd_gus_card_t * gus, unsigned int addr, unsigned short value, unsigned int count); | ||
532 | extern void snd_gf1_write_addr(snd_gus_card_t * gus, unsigned char reg, unsigned int addr, short w_16bit); | 529 | extern void snd_gf1_write_addr(snd_gus_card_t * gus, unsigned char reg, unsigned int addr, short w_16bit); |
533 | extern unsigned int snd_gf1_read_addr(snd_gus_card_t * gus, unsigned char reg, short w_16bit); | 530 | extern unsigned int snd_gf1_read_addr(snd_gus_card_t * gus, unsigned char reg, short w_16bit); |
534 | extern void snd_gf1_i_ctrl_stop(snd_gus_card_t * gus, unsigned char reg); | 531 | extern void snd_gf1_i_ctrl_stop(snd_gus_card_t * gus, unsigned char reg); |
@@ -544,9 +541,6 @@ extern inline unsigned short snd_gf1_i_read16(snd_gus_card_t * gus, unsigned cha | |||
544 | { | 541 | { |
545 | return snd_gf1_i_look16(gus, reg | 0x80); | 542 | return snd_gf1_i_look16(gus, reg | 0x80); |
546 | } | 543 | } |
547 | extern void snd_gf1_i_adlib_write(snd_gus_card_t * gus, unsigned char reg, unsigned char data); | ||
548 | extern void snd_gf1_i_write_addr(snd_gus_card_t * gus, unsigned char reg, unsigned int addr, short w_16bit); | ||
549 | extern unsigned int snd_gf1_i_read_addr(snd_gus_card_t * gus, unsigned char reg, short w_16bit); | ||
550 | 544 | ||
551 | extern void snd_gf1_select_active_voices(snd_gus_card_t * gus); | 545 | extern void snd_gf1_select_active_voices(snd_gus_card_t * gus); |
552 | 546 | ||
@@ -580,10 +574,6 @@ extern void snd_gf1_lfo_command(snd_gus_card_t * gus, int voice, unsigned char * | |||
580 | 574 | ||
581 | void snd_gf1_mem_lock(snd_gf1_mem_t * alloc, int xup); | 575 | void snd_gf1_mem_lock(snd_gf1_mem_t * alloc, int xup); |
582 | int snd_gf1_mem_xfree(snd_gf1_mem_t * alloc, snd_gf1_mem_block_t * block); | 576 | int snd_gf1_mem_xfree(snd_gf1_mem_t * alloc, snd_gf1_mem_block_t * block); |
583 | snd_gf1_mem_block_t *snd_gf1_mem_look(snd_gf1_mem_t * alloc, | ||
584 | unsigned int address); | ||
585 | snd_gf1_mem_block_t *snd_gf1_mem_share(snd_gf1_mem_t * alloc, | ||
586 | unsigned int *share_id); | ||
587 | snd_gf1_mem_block_t *snd_gf1_mem_alloc(snd_gf1_mem_t * alloc, int owner, | 577 | snd_gf1_mem_block_t *snd_gf1_mem_alloc(snd_gf1_mem_t * alloc, int owner, |
588 | char *name, int size, int w_16, | 578 | char *name, int size, int w_16, |
589 | int align, unsigned int *share_id); | 579 | int align, unsigned int *share_id); |
@@ -608,23 +598,13 @@ int snd_gf1_dma_transfer_block(snd_gus_card_t * gus, | |||
608 | /* gus_volume.c */ | 598 | /* gus_volume.c */ |
609 | 599 | ||
610 | unsigned short snd_gf1_lvol_to_gvol_raw(unsigned int vol); | 600 | unsigned short snd_gf1_lvol_to_gvol_raw(unsigned int vol); |
611 | unsigned int snd_gf1_gvol_to_lvol_raw(unsigned short gf1_vol); | ||
612 | unsigned int snd_gf1_calc_ramp_rate(snd_gus_card_t * gus, | ||
613 | unsigned short start, | ||
614 | unsigned short end, | ||
615 | unsigned int us); | ||
616 | unsigned short snd_gf1_translate_freq(snd_gus_card_t * gus, unsigned int freq2); | 601 | unsigned short snd_gf1_translate_freq(snd_gus_card_t * gus, unsigned int freq2); |
617 | unsigned short snd_gf1_compute_pitchbend(unsigned short pitchbend, unsigned short sens); | ||
618 | unsigned short snd_gf1_compute_freq(unsigned int freq, | ||
619 | unsigned int rate, | ||
620 | unsigned short mix_rate); | ||
621 | 602 | ||
622 | /* gus_reset.c */ | 603 | /* gus_reset.c */ |
623 | 604 | ||
624 | void snd_gf1_set_default_handlers(snd_gus_card_t * gus, unsigned int what); | 605 | void snd_gf1_set_default_handlers(snd_gus_card_t * gus, unsigned int what); |
625 | void snd_gf1_smart_stop_voice(snd_gus_card_t * gus, unsigned short voice); | 606 | void snd_gf1_smart_stop_voice(snd_gus_card_t * gus, unsigned short voice); |
626 | void snd_gf1_stop_voice(snd_gus_card_t * gus, unsigned short voice); | 607 | void snd_gf1_stop_voice(snd_gus_card_t * gus, unsigned short voice); |
627 | void snd_gf1_clear_voices(snd_gus_card_t * gus, unsigned short v_min, unsigned short v_max); | ||
628 | void snd_gf1_stop_voices(snd_gus_card_t * gus, unsigned short v_min, unsigned short v_max); | 608 | void snd_gf1_stop_voices(snd_gus_card_t * gus, unsigned short v_min, unsigned short v_max); |
629 | snd_gus_voice_t *snd_gf1_alloc_voice(snd_gus_card_t * gus, int type, int client, int port); | 609 | snd_gus_voice_t *snd_gf1_alloc_voice(snd_gus_card_t * gus, int type, int client, int port); |
630 | void snd_gf1_free_voice(snd_gus_card_t * gus, snd_gus_voice_t *voice); | 610 | void snd_gf1_free_voice(snd_gus_card_t * gus, snd_gus_voice_t *voice); |
@@ -641,9 +621,6 @@ int snd_gf1_pcm_new(snd_gus_card_t * gus, int pcm_dev, int control_index, snd_pc | |||
641 | 621 | ||
642 | #ifdef CONFIG_SND_DEBUG | 622 | #ifdef CONFIG_SND_DEBUG |
643 | extern void snd_gf1_print_voice_registers(snd_gus_card_t * gus); | 623 | extern void snd_gf1_print_voice_registers(snd_gus_card_t * gus); |
644 | extern void snd_gf1_print_global_registers(snd_gus_card_t * gus); | ||
645 | extern void snd_gf1_print_setup_registers(snd_gus_card_t * gus); | ||
646 | extern void snd_gf1_peek_print_block(snd_gus_card_t * gus, unsigned int addr, int count, int w_16bit); | ||
647 | #endif | 624 | #endif |
648 | 625 | ||
649 | /* gus.c */ | 626 | /* gus.c */ |
diff --git a/include/sound/hdspm.h b/include/sound/hdspm.h new file mode 100644 index 000000000000..c34427ccd0b3 --- /dev/null +++ b/include/sound/hdspm.h | |||
@@ -0,0 +1,131 @@ | |||
1 | #ifndef __SOUND_HDSPM_H /* -*- linux-c -*- */ | ||
2 | #define __SOUND_HDSPM_H | ||
3 | /* | ||
4 | * Copyright (C) 2003 Winfried Ritsch (IEM) | ||
5 | * based on hdsp.h from Thomas Charbonnel (thomas@undata.org) | ||
6 | * | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
21 | */ | ||
22 | |||
23 | /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */ | ||
24 | #define HDSPM_MAX_CHANNELS 64 | ||
25 | |||
26 | /* -------------------- IOCTL Peak/RMS Meters -------------------- */ | ||
27 | |||
28 | typedef struct _snd_hdspm_peak_rms hdspm_peak_rms_t; | ||
29 | |||
30 | /* peam rms level structure like we get from hardware | ||
31 | |||
32 | maybe in future we can memory map it so I just copy it | ||
33 | to user on ioctl call now an dont change anything | ||
34 | rms are made out of low and high values | ||
35 | where (long) ????_rms = (????_rms_l >> 8) + ((????_rms_h & 0xFFFFFF00)<<24) | ||
36 | (i asume so from the code) | ||
37 | */ | ||
38 | |||
39 | struct _snd_hdspm_peak_rms { | ||
40 | |||
41 | unsigned int level_offset[1024]; | ||
42 | |||
43 | unsigned int input_peak[64]; | ||
44 | unsigned int playback_peak[64]; | ||
45 | unsigned int output_peak[64]; | ||
46 | unsigned int xxx_peak[64]; /* not used */ | ||
47 | |||
48 | unsigned int reserved[256]; /* not used */ | ||
49 | |||
50 | unsigned int input_rms_l[64]; | ||
51 | unsigned int playback_rms_l[64]; | ||
52 | unsigned int output_rms_l[64]; | ||
53 | unsigned int xxx_rms_l[64]; /* not used */ | ||
54 | |||
55 | unsigned int input_rms_h[64]; | ||
56 | unsigned int playback_rms_h[64]; | ||
57 | unsigned int output_rms_h[64]; | ||
58 | unsigned int xxx_rms_h[64]; /* not used */ | ||
59 | }; | ||
60 | |||
61 | struct sndrv_hdspm_peak_rms_ioctl { | ||
62 | hdspm_peak_rms_t *peak; | ||
63 | }; | ||
64 | |||
65 | /* use indirect access due to the limit of ioctl bit size */ | ||
66 | #define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct sndrv_hdspm_peak_rms_ioctl) | ||
67 | |||
68 | /* ------------ CONFIG block IOCTL ---------------------- */ | ||
69 | |||
70 | typedef struct _snd_hdspm_config_info hdspm_config_info_t; | ||
71 | |||
72 | struct _snd_hdspm_config_info { | ||
73 | unsigned char pref_sync_ref; | ||
74 | unsigned char wordclock_sync_check; | ||
75 | unsigned char madi_sync_check; | ||
76 | unsigned int system_sample_rate; | ||
77 | unsigned int autosync_sample_rate; | ||
78 | unsigned char system_clock_mode; | ||
79 | unsigned char clock_source; | ||
80 | unsigned char autosync_ref; | ||
81 | unsigned char line_out; | ||
82 | unsigned int passthru; | ||
83 | unsigned int analog_out; | ||
84 | }; | ||
85 | |||
86 | #define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, hdspm_config_info_t) | ||
87 | |||
88 | |||
89 | /* get Soundcard Version */ | ||
90 | |||
91 | typedef struct _snd_hdspm_version hdspm_version_t; | ||
92 | |||
93 | struct _snd_hdspm_version { | ||
94 | unsigned short firmware_rev; | ||
95 | }; | ||
96 | |||
97 | #define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, hdspm_version_t) | ||
98 | |||
99 | |||
100 | /* ------------- get Matrix Mixer IOCTL --------------- */ | ||
101 | |||
102 | /* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte = 32768 Bytes */ | ||
103 | |||
104 | /* organisation is 64 channelfader in a continous memory block */ | ||
105 | /* equivalent to hardware definition, maybe for future feature of mmap of them */ | ||
106 | /* each of 64 outputs has 64 infader and 64 outfader: | ||
107 | Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */ | ||
108 | |||
109 | #define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS | ||
110 | |||
111 | typedef struct _snd_hdspm_channelfader snd_hdspm_channelfader_t; | ||
112 | |||
113 | struct _snd_hdspm_channelfader { | ||
114 | unsigned int in[HDSPM_MIXER_CHANNELS]; | ||
115 | unsigned int pb[HDSPM_MIXER_CHANNELS]; | ||
116 | }; | ||
117 | |||
118 | typedef struct _snd_hdspm_mixer hdspm_mixer_t; | ||
119 | |||
120 | struct _snd_hdspm_mixer { | ||
121 | snd_hdspm_channelfader_t ch[HDSPM_MIXER_CHANNELS]; | ||
122 | }; | ||
123 | |||
124 | struct sndrv_hdspm_mixer_ioctl { | ||
125 | hdspm_mixer_t *mixer; | ||
126 | }; | ||
127 | |||
128 | /* use indirect access due to the limit of ioctl bit size */ | ||
129 | #define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct sndrv_hdspm_mixer_ioctl) | ||
130 | |||
131 | #endif /* __SOUND_HDSPM_H */ | ||
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 53fc04d75bad..d935417575b5 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -848,23 +848,6 @@ int snd_interval_ratnum(snd_interval_t *i, | |||
848 | 848 | ||
849 | void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params); | 849 | void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params); |
850 | void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var); | 850 | void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var); |
851 | int snd_pcm_hw_param_min(snd_pcm_substream_t *substream, | ||
852 | snd_pcm_hw_params_t *params, | ||
853 | snd_pcm_hw_param_t var, | ||
854 | unsigned int val, int *dir); | ||
855 | int snd_pcm_hw_param_max(snd_pcm_substream_t *substream, | ||
856 | snd_pcm_hw_params_t *params, | ||
857 | snd_pcm_hw_param_t var, | ||
858 | unsigned int val, int *dir); | ||
859 | int snd_pcm_hw_param_setinteger(snd_pcm_substream_t *substream, | ||
860 | snd_pcm_hw_params_t *params, | ||
861 | snd_pcm_hw_param_t var); | ||
862 | int snd_pcm_hw_param_first(snd_pcm_substream_t *substream, | ||
863 | snd_pcm_hw_params_t *params, | ||
864 | snd_pcm_hw_param_t var, int *dir); | ||
865 | int snd_pcm_hw_param_last(snd_pcm_substream_t *substream, | ||
866 | snd_pcm_hw_params_t *params, | ||
867 | snd_pcm_hw_param_t var, int *dir); | ||
868 | int snd_pcm_hw_param_near(snd_pcm_substream_t *substream, | 851 | int snd_pcm_hw_param_near(snd_pcm_substream_t *substream, |
869 | snd_pcm_hw_params_t *params, | 852 | snd_pcm_hw_params_t *params, |
870 | snd_pcm_hw_param_t var, | 853 | snd_pcm_hw_param_t var, |
@@ -876,7 +859,6 @@ int snd_pcm_hw_param_set(snd_pcm_substream_t *pcm, | |||
876 | int snd_pcm_hw_params_choose(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); | 859 | int snd_pcm_hw_params_choose(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); |
877 | 860 | ||
878 | int snd_pcm_hw_refine(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); | 861 | int snd_pcm_hw_refine(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); |
879 | int snd_pcm_hw_params(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); | ||
880 | 862 | ||
881 | int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream); | 863 | int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream); |
882 | int snd_pcm_hw_constraints_complete(snd_pcm_substream_t *substream); | 864 | int snd_pcm_hw_constraints_complete(snd_pcm_substream_t *substream); |
@@ -922,8 +904,22 @@ int snd_pcm_format_unsigned(snd_pcm_format_t format); | |||
922 | int snd_pcm_format_linear(snd_pcm_format_t format); | 904 | int snd_pcm_format_linear(snd_pcm_format_t format); |
923 | int snd_pcm_format_little_endian(snd_pcm_format_t format); | 905 | int snd_pcm_format_little_endian(snd_pcm_format_t format); |
924 | int snd_pcm_format_big_endian(snd_pcm_format_t format); | 906 | int snd_pcm_format_big_endian(snd_pcm_format_t format); |
907 | /** | ||
908 | * snd_pcm_format_cpu_endian - Check the PCM format is CPU-endian | ||
909 | * @format: the format to check | ||
910 | * | ||
911 | * Returns 1 if the given PCM format is CPU-endian, 0 if | ||
912 | * opposite, or a negative error code if endian not specified. | ||
913 | */ | ||
914 | /* int snd_pcm_format_cpu_endian(snd_pcm_format_t format); */ | ||
915 | #ifdef SNDRV_LITTLE_ENDIAN | ||
916 | #define snd_pcm_format_cpu_endian snd_pcm_format_little_endian | ||
917 | #else | ||
918 | #define snd_pcm_format_cpu_endian snd_pcm_format_big_endian | ||
919 | #endif | ||
925 | int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */ | 920 | int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */ |
926 | int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */ | 921 | int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */ |
922 | ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples); | ||
927 | const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); | 923 | const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); |
928 | int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); | 924 | int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); |
929 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); | 925 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); |
diff --git a/include/sound/seq_midi_event.h b/include/sound/seq_midi_event.h index 4357cac07500..8857e2bd31a5 100644 --- a/include/sound/seq_midi_event.h +++ b/include/sound/seq_midi_event.h | |||
@@ -41,9 +41,7 @@ struct snd_midi_event_t { | |||
41 | }; | 41 | }; |
42 | 42 | ||
43 | int snd_midi_event_new(int bufsize, snd_midi_event_t **rdev); | 43 | int snd_midi_event_new(int bufsize, snd_midi_event_t **rdev); |
44 | int snd_midi_event_resize_buffer(snd_midi_event_t *dev, int bufsize); | ||
45 | void snd_midi_event_free(snd_midi_event_t *dev); | 44 | void snd_midi_event_free(snd_midi_event_t *dev); |
46 | void snd_midi_event_init(snd_midi_event_t *dev); | ||
47 | void snd_midi_event_reset_encode(snd_midi_event_t *dev); | 45 | void snd_midi_event_reset_encode(snd_midi_event_t *dev); |
48 | void snd_midi_event_reset_decode(snd_midi_event_t *dev); | 46 | void snd_midi_event_reset_decode(snd_midi_event_t *dev); |
49 | void snd_midi_event_no_status(snd_midi_event_t *dev, int on); | 47 | void snd_midi_event_no_status(snd_midi_event_t *dev, int on); |
diff --git a/include/sound/seq_virmidi.h b/include/sound/seq_virmidi.h index cf4e2388103f..1ad27e859af3 100644 --- a/include/sound/seq_virmidi.h +++ b/include/sound/seq_virmidi.h | |||
@@ -79,6 +79,5 @@ struct _snd_virmidi_dev { | |||
79 | #define SNDRV_VIRMIDI_SEQ_DISPATCH 2 | 79 | #define SNDRV_VIRMIDI_SEQ_DISPATCH 2 |
80 | 80 | ||
81 | int snd_virmidi_new(snd_card_t *card, int device, snd_rawmidi_t **rrmidi); | 81 | int snd_virmidi_new(snd_card_t *card, int device, snd_rawmidi_t **rrmidi); |
82 | int snd_virmidi_receive(snd_rawmidi_t *rmidi, snd_seq_event_t *ev); | ||
83 | 82 | ||
84 | #endif /* __SOUND_SEQ_VIRMIDI */ | 83 | #endif /* __SOUND_SEQ_VIRMIDI */ |
diff --git a/include/sound/timer.h b/include/sound/timer.h index 57fde990606e..1898511a0f38 100644 --- a/include/sound/timer.h +++ b/include/sound/timer.h | |||
@@ -152,6 +152,4 @@ extern int snd_timer_pause(snd_timer_instance_t * timeri); | |||
152 | 152 | ||
153 | extern void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left); | 153 | extern void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left); |
154 | 154 | ||
155 | extern unsigned int snd_timer_system_resolution(void); | ||
156 | |||
157 | #endif /* __SOUND_TIMER_H */ | 155 | #endif /* __SOUND_TIMER_H */ |
diff --git a/include/sound/version.h b/include/sound/version.h index 98b4230778ed..46acfa8c9988 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* include/version.h. Generated by configure. */ | 1 | /* include/version.h. Generated by configure. */ |
2 | #define CONFIG_SND_VERSION "1.0.9rc2" | 2 | #define CONFIG_SND_VERSION "1.0.9" |
3 | #define CONFIG_SND_DATE " (Thu Mar 24 10:33:39 2005 UTC)" | 3 | #define CONFIG_SND_DATE " (Sun May 29 07:31:02 2005 UTC)" |