aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/vga.h2
-rw-r--r--include/asm-arm/vga.h2
-rw-r--r--include/asm-i386/vga.h2
-rw-r--r--include/asm-ia64/vga.h2
-rw-r--r--include/asm-m32r/vga.h2
-rw-r--r--include/asm-mips/vga.h2
-rw-r--r--include/asm-powerpc/vga.h4
-rw-r--r--include/asm-sparc64/vga.h2
-rw-r--r--include/asm-x86_64/vga.h2
-rw-r--r--include/asm-xtensa/vga.h2
-rw-r--r--include/linux/dcache.h2
-rw-r--r--include/linux/device.h25
-rw-r--r--include/linux/fs.h1
-rw-r--r--include/linux/isa.h28
-rw-r--r--include/linux/key.h23
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/security.h10
-rw-r--r--include/linux/sysdev.h18
-rw-r--r--include/linux/tty.h4
-rw-r--r--include/linux/usb.h22
-rw-r--r--include/linux/usb/cdc.h (renamed from include/linux/usb_cdc.h)0
-rw-r--r--include/linux/usb/input.h (renamed from include/linux/usb_input.h)0
-rw-r--r--include/linux/usb/isp116x.h (renamed from include/linux/usb_isp116x.h)0
-rw-r--r--include/linux/usb/sl811.h (renamed from include/linux/usb_sl811.h)8
-rw-r--r--include/linux/zconf.h12
-rw-r--r--include/linux/zlib.h209
-rw-r--r--include/linux/zutil.h12
-rw-r--r--include/sound/ac97_codec.h1
-rw-r--r--include/sound/asequencer.h4
-rw-r--r--include/sound/asound.h2
-rw-r--r--include/sound/core.h3
-rw-r--r--include/sound/emu10k1.h2
-rw-r--r--include/sound/info.h11
-rw-r--r--include/sound/mpu401.h14
-rw-r--r--include/sound/pcm.h19
-rw-r--r--include/sound/pcm_params.h125
-rw-r--r--include/sound/rawmidi.h3
-rw-r--r--include/sound/version.h4
38 files changed, 350 insertions, 236 deletions
diff --git a/include/asm-alpha/vga.h b/include/asm-alpha/vga.h
index 8ca4f6b2da19..ed06f59b544d 100644
--- a/include/asm-alpha/vga.h
+++ b/include/asm-alpha/vga.h
@@ -46,6 +46,6 @@ extern void scr_memcpyw(u16 *d, const u16 *s, unsigned int count);
46#define vga_readb(a) readb((u8 __iomem *)(a)) 46#define vga_readb(a) readb((u8 __iomem *)(a))
47#define vga_writeb(v,a) writeb(v, (u8 __iomem *)(a)) 47#define vga_writeb(v,a) writeb(v, (u8 __iomem *)(a))
48 48
49#define VGA_MAP_MEM(x) ((unsigned long) ioremap(x, 0)) 49#define VGA_MAP_MEM(x,s) ((unsigned long) ioremap(x, s))
50 50
51#endif 51#endif
diff --git a/include/asm-arm/vga.h b/include/asm-arm/vga.h
index 926e5ee128e9..1e0b913c3d71 100644
--- a/include/asm-arm/vga.h
+++ b/include/asm-arm/vga.h
@@ -4,7 +4,7 @@
4#include <asm/hardware.h> 4#include <asm/hardware.h>
5#include <asm/io.h> 5#include <asm/io.h>
6 6
7#define VGA_MAP_MEM(x) (PCIMEM_BASE + (x)) 7#define VGA_MAP_MEM(x,s) (PCIMEM_BASE + (x))
8 8
9#define vga_readb(x) (*((volatile unsigned char *)x)) 9#define vga_readb(x) (*((volatile unsigned char *)x))
10#define vga_writeb(x,y) (*((volatile unsigned char *)y) = (x)) 10#define vga_writeb(x,y) (*((volatile unsigned char *)y) = (x))
diff --git a/include/asm-i386/vga.h b/include/asm-i386/vga.h
index ef0c0e50cc95..0ecf68ac03aa 100644
--- a/include/asm-i386/vga.h
+++ b/include/asm-i386/vga.h
@@ -12,7 +12,7 @@
12 * access the videoram directly without any black magic. 12 * access the videoram directly without any black magic.
13 */ 13 */
14 14
15#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) 15#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
16 16
17#define vga_readb(x) (*(x)) 17#define vga_readb(x) (*(x))
18#define vga_writeb(x,y) (*(y) = (x)) 18#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/asm-ia64/vga.h b/include/asm-ia64/vga.h
index 091177cda223..02184ecd8208 100644
--- a/include/asm-ia64/vga.h
+++ b/include/asm-ia64/vga.h
@@ -17,7 +17,7 @@
17extern unsigned long vga_console_iobase; 17extern unsigned long vga_console_iobase;
18extern unsigned long vga_console_membase; 18extern unsigned long vga_console_membase;
19 19
20#define VGA_MAP_MEM(x) ((unsigned long) ioremap_nocache(vga_console_membase + (x), 0)) 20#define VGA_MAP_MEM(x,s) ((unsigned long) ioremap_nocache(vga_console_membase + (x), s))
21 21
22#define vga_readb(x) (*(x)) 22#define vga_readb(x) (*(x))
23#define vga_writeb(x,y) (*(y) = (x)) 23#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/asm-m32r/vga.h b/include/asm-m32r/vga.h
index d0f4b6eed7a3..533163447cc9 100644
--- a/include/asm-m32r/vga.h
+++ b/include/asm-m32r/vga.h
@@ -14,7 +14,7 @@
14 * access the videoram directly without any black magic. 14 * access the videoram directly without any black magic.
15 */ 15 */
16 16
17#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) 17#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
18 18
19#define vga_readb(x) (*(x)) 19#define vga_readb(x) (*(x))
20#define vga_writeb(x,y) (*(y) = (x)) 20#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/asm-mips/vga.h b/include/asm-mips/vga.h
index 34755c0a6398..c1dd0b10bc27 100644
--- a/include/asm-mips/vga.h
+++ b/include/asm-mips/vga.h
@@ -13,7 +13,7 @@
13 * access the videoram directly without any black magic. 13 * access the videoram directly without any black magic.
14 */ 14 */
15 15
16#define VGA_MAP_MEM(x) (0xb0000000L + (unsigned long)(x)) 16#define VGA_MAP_MEM(x,s) (0xb0000000L + (unsigned long)(x))
17 17
18#define vga_readb(x) (*(x)) 18#define vga_readb(x) (*(x))
19#define vga_writeb(x,y) (*(y) = (x)) 19#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/asm-powerpc/vga.h b/include/asm-powerpc/vga.h
index eadaf2f3d032..a2eac409c1ec 100644
--- a/include/asm-powerpc/vga.h
+++ b/include/asm-powerpc/vga.h
@@ -41,9 +41,9 @@ static inline u16 scr_readw(volatile const u16 *addr)
41extern unsigned long vgacon_remap_base; 41extern unsigned long vgacon_remap_base;
42 42
43#ifdef __powerpc64__ 43#ifdef __powerpc64__
44#define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0)) 44#define VGA_MAP_MEM(x,s) ((unsigned long) ioremap((x), s))
45#else 45#else
46#define VGA_MAP_MEM(x) (x + vgacon_remap_base) 46#define VGA_MAP_MEM(x,s) (x + vgacon_remap_base)
47#endif 47#endif
48 48
49#define vga_readb(x) (*(x)) 49#define vga_readb(x) (*(x))
diff --git a/include/asm-sparc64/vga.h b/include/asm-sparc64/vga.h
index 9c57eb363b40..c69d5b2ba19a 100644
--- a/include/asm-sparc64/vga.h
+++ b/include/asm-sparc64/vga.h
@@ -28,6 +28,6 @@ static inline u16 scr_readw(const u16 *addr)
28 return *addr; 28 return *addr;
29} 29}
30 30
31#define VGA_MAP_MEM(x) (x) 31#define VGA_MAP_MEM(x,s) (x)
32 32
33#endif 33#endif
diff --git a/include/asm-x86_64/vga.h b/include/asm-x86_64/vga.h
index ef0c0e50cc95..0ecf68ac03aa 100644
--- a/include/asm-x86_64/vga.h
+++ b/include/asm-x86_64/vga.h
@@ -12,7 +12,7 @@
12 * access the videoram directly without any black magic. 12 * access the videoram directly without any black magic.
13 */ 13 */
14 14
15#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) 15#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
16 16
17#define vga_readb(x) (*(x)) 17#define vga_readb(x) (*(x))
18#define vga_writeb(x,y) (*(y) = (x)) 18#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/asm-xtensa/vga.h b/include/asm-xtensa/vga.h
index 23d82f6acb57..1fd8cab3a297 100644
--- a/include/asm-xtensa/vga.h
+++ b/include/asm-xtensa/vga.h
@@ -11,7 +11,7 @@
11#ifndef _XTENSA_VGA_H 11#ifndef _XTENSA_VGA_H
12#define _XTENSA_VGA_H 12#define _XTENSA_VGA_H
13 13
14#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) 14#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
15 15
16#define vga_readb(x) (*(x)) 16#define vga_readb(x) (*(x))
17#define vga_writeb(x,y) (*(y) = (x)) 17#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 836325ee0931..46d0e079735d 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -217,7 +217,7 @@ extern struct dentry * d_alloc_anon(struct inode *);
217extern struct dentry * d_splice_alias(struct inode *, struct dentry *); 217extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
218extern void shrink_dcache_sb(struct super_block *); 218extern void shrink_dcache_sb(struct super_block *);
219extern void shrink_dcache_parent(struct dentry *); 219extern void shrink_dcache_parent(struct dentry *);
220extern void shrink_dcache_anon(struct hlist_head *); 220extern void shrink_dcache_anon(struct super_block *);
221extern int d_invalidate(struct dentry *); 221extern int d_invalidate(struct dentry *);
222 222
223/* only used at mount-time */ 223/* only used at mount-time */
diff --git a/include/linux/device.h b/include/linux/device.h
index b2e5da2b637b..1e5f30da98bc 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -60,11 +60,6 @@ extern void bus_unregister(struct bus_type * bus);
60 60
61extern void bus_rescan_devices(struct bus_type * bus); 61extern void bus_rescan_devices(struct bus_type * bus);
62 62
63extern struct bus_type * get_bus(struct bus_type * bus);
64extern void put_bus(struct bus_type * bus);
65
66extern struct bus_type * find_bus(char * name);
67
68/* iterator helpers for buses */ 63/* iterator helpers for buses */
69 64
70int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, 65int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data,
@@ -147,6 +142,7 @@ struct class {
147 142
148 struct subsystem subsys; 143 struct subsystem subsys;
149 struct list_head children; 144 struct list_head children;
145 struct list_head devices;
150 struct list_head interfaces; 146 struct list_head interfaces;
151 struct semaphore sem; /* locks both the children and interfaces lists */ 147 struct semaphore sem; /* locks both the children and interfaces lists */
152 148
@@ -163,9 +159,6 @@ struct class {
163extern int class_register(struct class *); 159extern int class_register(struct class *);
164extern void class_unregister(struct class *); 160extern void class_unregister(struct class *);
165 161
166extern struct class * class_get(struct class *);
167extern void class_put(struct class *);
168
169 162
170struct class_attribute { 163struct class_attribute {
171 struct attribute attr; 164 struct attribute attr;
@@ -313,6 +306,7 @@ struct device {
313 struct kobject kobj; 306 struct kobject kobj;
314 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 307 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
315 struct device_attribute uevent_attr; 308 struct device_attribute uevent_attr;
309 struct device_attribute *devt_attr;
316 310
317 struct semaphore sem; /* semaphore to synchronize calls to 311 struct semaphore sem; /* semaphore to synchronize calls to
318 * its driver. 312 * its driver.
@@ -340,6 +334,11 @@ struct device {
340 struct dma_coherent_mem *dma_mem; /* internal for coherent mem 334 struct dma_coherent_mem *dma_mem; /* internal for coherent mem
341 override */ 335 override */
342 336
337 /* class_device migration path */
338 struct list_head node;
339 struct class *class; /* optional*/
340 dev_t devt; /* dev_t, creates the sysfs "dev" */
341
343 void (*release)(struct device * dev); 342 void (*release)(struct device * dev);
344}; 343};
345 344
@@ -381,6 +380,13 @@ extern int device_attach(struct device * dev);
381extern void driver_attach(struct device_driver * drv); 380extern void driver_attach(struct device_driver * drv);
382extern void device_reprobe(struct device *dev); 381extern void device_reprobe(struct device *dev);
383 382
383/*
384 * Easy functions for dynamically creating devices on the fly
385 */
386extern struct device *device_create(struct class *cls, struct device *parent,
387 dev_t devt, char *fmt, ...)
388 __attribute__((format(printf,4,5)));
389extern void device_destroy(struct class *cls, dev_t devt);
384 390
385/* 391/*
386 * Platform "fixup" functions - allow the platform to have their say 392 * Platform "fixup" functions - allow the platform to have their say
@@ -410,8 +416,9 @@ extern int firmware_register(struct subsystem *);
410extern void firmware_unregister(struct subsystem *); 416extern void firmware_unregister(struct subsystem *);
411 417
412/* debugging and troubleshooting/diagnostic helpers. */ 418/* debugging and troubleshooting/diagnostic helpers. */
419extern const char *dev_driver_string(struct device *dev);
413#define dev_printk(level, dev, format, arg...) \ 420#define dev_printk(level, dev, format, arg...) \
414 printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg) 421 printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg)
415 422
416#ifdef DEBUG 423#ifdef DEBUG
417#define dev_dbg(dev, format, arg...) \ 424#define dev_dbg(dev, format, arg...) \
diff --git a/include/linux/fs.h b/include/linux/fs.h
index ecc8c2c3d8ca..73c7d6f04b31 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -782,7 +782,6 @@ extern int setlease(struct file *, long, struct file_lock **);
782extern int lease_modify(struct file_lock **, int); 782extern int lease_modify(struct file_lock **, int);
783extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 783extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
784extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 784extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
785extern void steal_locks(fl_owner_t from);
786 785
787struct fasync_struct { 786struct fasync_struct {
788 int magic; 787 int magic;
diff --git a/include/linux/isa.h b/include/linux/isa.h
new file mode 100644
index 000000000000..1b855335cb11
--- /dev/null
+++ b/include/linux/isa.h
@@ -0,0 +1,28 @@
1/*
2 * ISA bus.
3 */
4
5#ifndef __LINUX_ISA_H
6#define __LINUX_ISA_H
7
8#include <linux/device.h>
9#include <linux/kernel.h>
10
11struct isa_driver {
12 int (*match)(struct device *, unsigned int);
13 int (*probe)(struct device *, unsigned int);
14 int (*remove)(struct device *, unsigned int);
15 void (*shutdown)(struct device *, unsigned int);
16 int (*suspend)(struct device *, unsigned int, pm_message_t);
17 int (*resume)(struct device *, unsigned int);
18
19 struct device_driver driver;
20 struct device *devices;
21};
22
23#define to_isa_driver(x) container_of((x), struct isa_driver, driver)
24
25int isa_register_driver(struct isa_driver *, unsigned int);
26void isa_unregister_driver(struct isa_driver *);
27
28#endif /* __LINUX_ISA_H */
diff --git a/include/linux/key.h b/include/linux/key.h
index cbf464ad9589..e81ebf910d0b 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -205,6 +205,11 @@ struct key_type {
205 /* match a key against a description */ 205 /* match a key against a description */
206 int (*match)(const struct key *key, const void *desc); 206 int (*match)(const struct key *key, const void *desc);
207 207
208 /* clear some of the data from a key on revokation (optional)
209 * - the key's semaphore will be write-locked by the caller
210 */
211 void (*revoke)(struct key *key);
212
208 /* clear the data from a key (optional) */ 213 /* clear the data from a key (optional) */
209 void (*destroy)(struct key *key); 214 void (*destroy)(struct key *key);
210 215
@@ -241,8 +246,9 @@ extern void unregister_key_type(struct key_type *ktype);
241 246
242extern struct key *key_alloc(struct key_type *type, 247extern struct key *key_alloc(struct key_type *type,
243 const char *desc, 248 const char *desc,
244 uid_t uid, gid_t gid, key_perm_t perm, 249 uid_t uid, gid_t gid,
245 int not_in_quota); 250 struct task_struct *ctx,
251 key_perm_t perm, int not_in_quota);
246extern int key_payload_reserve(struct key *key, size_t datalen); 252extern int key_payload_reserve(struct key *key, size_t datalen);
247extern int key_instantiate_and_link(struct key *key, 253extern int key_instantiate_and_link(struct key *key,
248 const void *data, 254 const void *data,
@@ -292,7 +298,9 @@ extern int key_unlink(struct key *keyring,
292 struct key *key); 298 struct key *key);
293 299
294extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, 300extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
295 int not_in_quota, struct key *dest); 301 struct task_struct *ctx,
302 int not_in_quota,
303 struct key *dest);
296 304
297extern int keyring_clear(struct key *keyring); 305extern int keyring_clear(struct key *keyring);
298 306
@@ -313,7 +321,8 @@ extern void keyring_replace_payload(struct key *key, void *replacement);
313 * the userspace interface 321 * the userspace interface
314 */ 322 */
315extern struct key root_user_keyring, root_session_keyring; 323extern struct key root_user_keyring, root_session_keyring;
316extern int alloc_uid_keyring(struct user_struct *user); 324extern int alloc_uid_keyring(struct user_struct *user,
325 struct task_struct *ctx);
317extern void switch_uid_keyring(struct user_struct *new_user); 326extern void switch_uid_keyring(struct user_struct *new_user);
318extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk); 327extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk);
319extern int copy_thread_group_keys(struct task_struct *tsk); 328extern int copy_thread_group_keys(struct task_struct *tsk);
@@ -342,7 +351,7 @@ extern void key_init(void);
342#define make_key_ref(k) ({ NULL; }) 351#define make_key_ref(k) ({ NULL; })
343#define key_ref_to_ptr(k) ({ NULL; }) 352#define key_ref_to_ptr(k) ({ NULL; })
344#define is_key_possessed(k) 0 353#define is_key_possessed(k) 0
345#define alloc_uid_keyring(u) 0 354#define alloc_uid_keyring(u,c) 0
346#define switch_uid_keyring(u) do { } while(0) 355#define switch_uid_keyring(u) do { } while(0)
347#define __install_session_keyring(t, k) ({ NULL; }) 356#define __install_session_keyring(t, k) ({ NULL; })
348#define copy_keys(f,t) 0 357#define copy_keys(f,t) 0
@@ -355,6 +364,10 @@ extern void key_init(void);
355#define key_fsgid_changed(t) do { } while(0) 364#define key_fsgid_changed(t) do { } while(0)
356#define key_init() do { } while(0) 365#define key_init() do { } while(0)
357 366
367/* Initial keyrings */
368extern struct key root_user_keyring;
369extern struct key root_session_keyring;
370
358#endif /* CONFIG_KEYS */ 371#endif /* CONFIG_KEYS */
359#endif /* __KERNEL__ */ 372#endif /* __KERNEL__ */
360#endif /* _LINUX_KEY_H */ 373#endif /* _LINUX_KEY_H */
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index c187c53cecd0..2d229327959e 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -190,6 +190,8 @@ struct subsystem _varname##_subsys = { \
190 190
191/* The global /sys/kernel/ subsystem for people to chain off of */ 191/* The global /sys/kernel/ subsystem for people to chain off of */
192extern struct subsystem kernel_subsys; 192extern struct subsystem kernel_subsys;
193/* The global /sys/hypervisor/ subsystem */
194extern struct subsystem hypervisor_subsys;
193 195
194/** 196/**
195 * Helpers for setting the kset of registered objects. 197 * Helpers for setting the kset of registered objects.
diff --git a/include/linux/security.h b/include/linux/security.h
index 4dfb1b84a9b3..47722d355532 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1313,7 +1313,7 @@ struct security_operations {
1313 1313
1314 /* key management security hooks */ 1314 /* key management security hooks */
1315#ifdef CONFIG_KEYS 1315#ifdef CONFIG_KEYS
1316 int (*key_alloc)(struct key *key); 1316 int (*key_alloc)(struct key *key, struct task_struct *tsk);
1317 void (*key_free)(struct key *key); 1317 void (*key_free)(struct key *key);
1318 int (*key_permission)(key_ref_t key_ref, 1318 int (*key_permission)(key_ref_t key_ref,
1319 struct task_struct *context, 1319 struct task_struct *context,
@@ -3008,9 +3008,10 @@ static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid
3008 3008
3009#ifdef CONFIG_KEYS 3009#ifdef CONFIG_KEYS
3010#ifdef CONFIG_SECURITY 3010#ifdef CONFIG_SECURITY
3011static inline int security_key_alloc(struct key *key) 3011static inline int security_key_alloc(struct key *key,
3012 struct task_struct *tsk)
3012{ 3013{
3013 return security_ops->key_alloc(key); 3014 return security_ops->key_alloc(key, tsk);
3014} 3015}
3015 3016
3016static inline void security_key_free(struct key *key) 3017static inline void security_key_free(struct key *key)
@@ -3027,7 +3028,8 @@ static inline int security_key_permission(key_ref_t key_ref,
3027 3028
3028#else 3029#else
3029 3030
3030static inline int security_key_alloc(struct key *key) 3031static inline int security_key_alloc(struct key *key,
3032 struct task_struct *tsk)
3031{ 3033{
3032 return 0; 3034 return 0;
3033} 3035}
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index 2a4b432e1176..166a2e58c287 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -37,11 +37,27 @@ struct sysdev_class {
37 struct kset kset; 37 struct kset kset;
38}; 38};
39 39
40struct sysdev_class_attribute {
41 struct attribute attr;
42 ssize_t (*show)(struct sysdev_class *, char *);
43 ssize_t (*store)(struct sysdev_class *, const char *, size_t);
44};
45
46#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \
47struct sysdev_class_attribute attr_##_name = { \
48 .attr = {.name = __stringify(_name), .mode = _mode }, \
49 .show = _show, \
50 .store = _store, \
51};
52
40 53
41extern int sysdev_class_register(struct sysdev_class *); 54extern int sysdev_class_register(struct sysdev_class *);
42extern void sysdev_class_unregister(struct sysdev_class *); 55extern void sysdev_class_unregister(struct sysdev_class *);
43 56
44 57extern int sysdev_class_create_file(struct sysdev_class *,
58 struct sysdev_class_attribute *);
59extern void sysdev_class_remove_file(struct sysdev_class *,
60 struct sysdev_class_attribute *);
45/** 61/**
46 * Auxillary system device drivers. 62 * Auxillary system device drivers.
47 */ 63 */
diff --git a/include/linux/tty.h b/include/linux/tty.h
index e898eeb94166..cb35ca50a0a6 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -290,7 +290,9 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc);
290extern int tty_unregister_ldisc(int disc); 290extern int tty_unregister_ldisc(int disc);
291extern int tty_register_driver(struct tty_driver *driver); 291extern int tty_register_driver(struct tty_driver *driver);
292extern int tty_unregister_driver(struct tty_driver *driver); 292extern int tty_unregister_driver(struct tty_driver *driver);
293extern void tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev); 293extern struct class_device *tty_register_device(struct tty_driver *driver,
294 unsigned index,
295 struct device *dev);
294extern void tty_unregister_device(struct tty_driver *driver, unsigned index); 296extern void tty_unregister_device(struct tty_driver *driver, unsigned index);
295extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, 297extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp,
296 int buflen); 298 int buflen);
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 1f492c0c7047..8dead32e7ebf 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -40,6 +40,8 @@ struct usb_driver;
40 * Devices may also have class-specific or vendor-specific descriptors. 40 * Devices may also have class-specific or vendor-specific descriptors.
41 */ 41 */
42 42
43struct ep_device;
44
43/** 45/**
44 * struct usb_host_endpoint - host-side endpoint descriptor and queue 46 * struct usb_host_endpoint - host-side endpoint descriptor and queue
45 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder 47 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder
@@ -57,7 +59,7 @@ struct usb_host_endpoint {
57 struct usb_endpoint_descriptor desc; 59 struct usb_endpoint_descriptor desc;
58 struct list_head urb_list; 60 struct list_head urb_list;
59 void *hcpriv; 61 void *hcpriv;
60 struct kobject *kobj; /* For sysfs info */ 62 struct ep_device *ep_dev; /* For sysfs info */
61 63
62 unsigned char *extra; /* Extra descriptors */ 64 unsigned char *extra; /* Extra descriptors */
63 int extralen; 65 int extralen;
@@ -101,7 +103,8 @@ enum usb_interface_condition {
101 * @condition: binding state of the interface: not bound, binding 103 * @condition: binding state of the interface: not bound, binding
102 * (in probe()), bound to a driver, or unbinding (in disconnect()) 104 * (in probe()), bound to a driver, or unbinding (in disconnect())
103 * @dev: driver model's view of this device 105 * @dev: driver model's view of this device
104 * @class_dev: driver model's class view of this device. 106 * @usb_dev: if an interface is bound to the USB major, this will point
107 * to the sysfs representation for that device.
105 * 108 *
106 * USB device drivers attach to interfaces on a physical device. Each 109 * USB device drivers attach to interfaces on a physical device. Each
107 * interface encapsulates a single high level function, such as feeding 110 * interface encapsulates a single high level function, such as feeding
@@ -141,7 +144,7 @@ struct usb_interface {
141 * bound to */ 144 * bound to */
142 enum usb_interface_condition condition; /* state of binding */ 145 enum usb_interface_condition condition; /* state of binding */
143 struct device dev; /* interface specific device info */ 146 struct device dev; /* interface specific device info */
144 struct class_device *class_dev; 147 struct device *usb_dev; /* pointer to the usb class's device, if any */
145}; 148};
146#define to_usb_interface(d) container_of(d, struct usb_interface, dev) 149#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
147#define interface_to_usbdev(intf) \ 150#define interface_to_usbdev(intf) \
@@ -358,7 +361,7 @@ struct usb_device {
358 char *serial; /* iSerialNumber string, if present */ 361 char *serial; /* iSerialNumber string, if present */
359 362
360 struct list_head filelist; 363 struct list_head filelist;
361 struct class_device *class_dev; 364 struct device *usbfs_dev;
362 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 365 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
363 366
364 /* 367 /*
@@ -386,6 +389,8 @@ extern int usb_lock_device_for_reset(struct usb_device *udev,
386 389
387/* USB port reset for device reinitialization */ 390/* USB port reset for device reinitialization */
388extern int usb_reset_device(struct usb_device *dev); 391extern int usb_reset_device(struct usb_device *dev);
392extern int usb_reset_composite_device(struct usb_device *dev,
393 struct usb_interface *iface);
389 394
390extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); 395extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
391 396
@@ -554,6 +559,10 @@ struct usb_dynids {
554 * do (or don't) show up otherwise in the filesystem. 559 * do (or don't) show up otherwise in the filesystem.
555 * @suspend: Called when the device is going to be suspended by the system. 560 * @suspend: Called when the device is going to be suspended by the system.
556 * @resume: Called when the device is being resumed by the system. 561 * @resume: Called when the device is being resumed by the system.
562 * @pre_reset: Called by usb_reset_composite_device() when the device
563 * is about to be reset.
564 * @post_reset: Called by usb_reset_composite_device() after the device
565 * has been reset.
557 * @id_table: USB drivers use ID table to support hotplugging. 566 * @id_table: USB drivers use ID table to support hotplugging.
558 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set 567 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
559 * or your driver's probe function will never get called. 568 * or your driver's probe function will never get called.
@@ -592,6 +601,9 @@ struct usb_driver {
592 int (*suspend) (struct usb_interface *intf, pm_message_t message); 601 int (*suspend) (struct usb_interface *intf, pm_message_t message);
593 int (*resume) (struct usb_interface *intf); 602 int (*resume) (struct usb_interface *intf);
594 603
604 void (*pre_reset) (struct usb_interface *intf);
605 void (*post_reset) (struct usb_interface *intf);
606
595 const struct usb_device_id *id_table; 607 const struct usb_device_id *id_table;
596 608
597 struct usb_dynids dynids; 609 struct usb_dynids dynids;
@@ -1008,6 +1020,8 @@ void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe,
1008extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, 1020extern int usb_control_msg(struct usb_device *dev, unsigned int pipe,
1009 __u8 request, __u8 requesttype, __u16 value, __u16 index, 1021 __u8 request, __u8 requesttype, __u16 value, __u16 index,
1010 void *data, __u16 size, int timeout); 1022 void *data, __u16 size, int timeout);
1023extern int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe,
1024 void *data, int len, int *actual_length, int timeout);
1011extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, 1025extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
1012 void *data, int len, int *actual_length, 1026 void *data, int len, int *actual_length,
1013 int timeout); 1027 int timeout);
diff --git a/include/linux/usb_cdc.h b/include/linux/usb/cdc.h
index ba617c372455..ba617c372455 100644
--- a/include/linux/usb_cdc.h
+++ b/include/linux/usb/cdc.h
diff --git a/include/linux/usb_input.h b/include/linux/usb/input.h
index 716e0cc16043..716e0cc16043 100644
--- a/include/linux/usb_input.h
+++ b/include/linux/usb/input.h
diff --git a/include/linux/usb_isp116x.h b/include/linux/usb/isp116x.h
index 436dd8a2b64a..436dd8a2b64a 100644
--- a/include/linux/usb_isp116x.h
+++ b/include/linux/usb/isp116x.h
diff --git a/include/linux/usb_sl811.h b/include/linux/usb/sl811.h
index 4f2d012d7309..397ee3b3d7f3 100644
--- a/include/linux/usb_sl811.h
+++ b/include/linux/usb/sl811.h
@@ -14,13 +14,13 @@ struct sl811_platform_data {
14 u8 power; 14 u8 power;
15 15
16 /* sl811 relies on an external source of VBUS current */ 16 /* sl811 relies on an external source of VBUS current */
17 void (*port_power)(struct device *dev, int is_on); 17 void (*port_power)(struct device *dev, int is_on);
18 18
19 /* pulse sl811 nRST (probably with a GPIO) */ 19 /* pulse sl811 nRST (probably with a GPIO) */
20 void (*reset)(struct device *dev); 20 void (*reset)(struct device *dev);
21 21
22 // some boards need something like these: 22 // some boards need something like these:
23 // int (*check_overcurrent)(struct device *dev); 23 // int (*check_overcurrent)(struct device *dev);
24 // void (*clock_enable)(struct device *dev, int is_on); 24 // void (*clock_enable)(struct device *dev, int is_on);
25}; 25};
26 26
diff --git a/include/linux/zconf.h b/include/linux/zconf.h
index f1cfd66b9554..0beb75e38caa 100644
--- a/include/linux/zconf.h
+++ b/include/linux/zconf.h
@@ -35,6 +35,18 @@
35# define MAX_WBITS 15 /* 32K LZ77 window */ 35# define MAX_WBITS 15 /* 32K LZ77 window */
36#endif 36#endif
37 37
38/* default windowBits for decompression. MAX_WBITS is for compression only */
39#ifndef DEF_WBITS
40# define DEF_WBITS MAX_WBITS
41#endif
42
43/* default memLevel */
44#if MAX_MEM_LEVEL >= 8
45# define DEF_MEM_LEVEL 8
46#else
47# define DEF_MEM_LEVEL MAX_MEM_LEVEL
48#endif
49
38 /* Type declarations */ 50 /* Type declarations */
39 51
40typedef unsigned char Byte; /* 8 bits */ 52typedef unsigned char Byte; /* 8 bits */
diff --git a/include/linux/zlib.h b/include/linux/zlib.h
index 4fa32f0d4df8..9e3192a7dc6f 100644
--- a/include/linux/zlib.h
+++ b/include/linux/zlib.h
@@ -1,7 +1,6 @@
1/* zlib.h -- interface of the 'zlib' general purpose compression library 1/* zlib.h -- interface of the 'zlib' general purpose compression library
2 version 1.1.3, July 9th, 1998
3 2
4 Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler 3 Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
5 4
6 This software is provided 'as-is', without any express or implied 5 This software is provided 'as-is', without any express or implied
7 warranty. In no event will the authors be held liable for any damages 6 warranty. In no event will the authors be held liable for any damages
@@ -24,7 +23,7 @@
24 23
25 24
26 The data format used by the zlib library is described by RFCs (Request for 25 The data format used by the zlib library is described by RFCs (Request for
27 Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt 26 Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
28 (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). 27 (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
29*/ 28*/
30 29
@@ -33,7 +32,22 @@
33 32
34#include <linux/zconf.h> 33#include <linux/zconf.h>
35 34
36#define ZLIB_VERSION "1.1.3" 35/* zlib deflate based on ZLIB_VERSION "1.1.3" */
36/* zlib inflate based on ZLIB_VERSION "1.2.3" */
37
38/*
39 This is a modified version of zlib for use inside the Linux kernel.
40 The main changes are to perform all memory allocation in advance.
41
42 Inflation Changes:
43 * Z_PACKET_FLUSH is added and used by ppp_deflate. Before returning
44 this checks there is no more input data available and the next data
45 is a STORED block. It also resets the mode to be read for the next
46 data, all as per PPP requirements.
47 * Addition of zlib_inflateIncomp which copies incompressible data into
48 the history window and adjusts the accoutning without calling
49 zlib_inflate itself to inflate the data.
50*/
37 51
38/* 52/*
39 The 'zlib' compression library provides in-memory compression and 53 The 'zlib' compression library provides in-memory compression and
@@ -48,9 +62,18 @@
48 application must provide more input and/or consume the output 62 application must provide more input and/or consume the output
49 (providing more output space) before each call. 63 (providing more output space) before each call.
50 64
65 The compressed data format used by default by the in-memory functions is
66 the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
67 around a deflate stream, which is itself documented in RFC 1951.
68
51 The library also supports reading and writing files in gzip (.gz) format 69 The library also supports reading and writing files in gzip (.gz) format
52 with an interface similar to that of stdio. 70 with an interface similar to that of stdio.
53 71
72 The zlib format was designed to be compact and fast for use in memory
73 and on communications channels. The gzip format was designed for single-
74 file compression on file systems, has a larger header than zlib to maintain
75 directory information, and uses a different, slower check method than zlib.
76
54 The library does not install any signal handler. The decoder checks 77 The library does not install any signal handler. The decoder checks
55 the consistency of the compressed data, so the library should never 78 the consistency of the compressed data, so the library should never
56 crash even in case of corrupted input. 79 crash even in case of corrupted input.
@@ -119,7 +142,8 @@ typedef z_stream *z_streamp;
119#define Z_SYNC_FLUSH 3 142#define Z_SYNC_FLUSH 3
120#define Z_FULL_FLUSH 4 143#define Z_FULL_FLUSH 4
121#define Z_FINISH 5 144#define Z_FINISH 5
122/* Allowed flush values; see deflate() below for details */ 145#define Z_BLOCK 6 /* Only for inflate at present */
146/* Allowed flush values; see deflate() and inflate() below for details */
123 147
124#define Z_OK 0 148#define Z_OK 0
125#define Z_STREAM_END 1 149#define Z_STREAM_END 1
@@ -155,13 +179,6 @@ typedef z_stream *z_streamp;
155 179
156 /* basic functions */ 180 /* basic functions */
157 181
158extern const char * zlib_zlibVersion (void);
159/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
160 If the first character differs, the library code actually used is
161 not compatible with the zlib.h header file used by the application.
162 This check is automatically made by deflateInit and inflateInit.
163 */
164
165extern int zlib_deflate_workspacesize (void); 182extern int zlib_deflate_workspacesize (void);
166/* 183/*
167 Returns the number of bytes that needs to be allocated for a per- 184 Returns the number of bytes that needs to be allocated for a per-
@@ -315,9 +332,9 @@ extern int zlib_inflateInit (z_streamp strm);
315extern int zlib_inflate (z_streamp strm, int flush); 332extern int zlib_inflate (z_streamp strm, int flush);
316/* 333/*
317 inflate decompresses as much data as possible, and stops when the input 334 inflate decompresses as much data as possible, and stops when the input
318 buffer becomes empty or the output buffer becomes full. It may some 335 buffer becomes empty or the output buffer becomes full. It may introduce
319 introduce some output latency (reading input without producing any output) 336 some output latency (reading input without producing any output) except when
320 except when forced to flush. 337 forced to flush.
321 338
322 The detailed semantics are as follows. inflate performs one or both of the 339 The detailed semantics are as follows. inflate performs one or both of the
323 following actions: 340 following actions:
@@ -341,11 +358,26 @@ extern int zlib_inflate (z_streamp strm, int flush);
341 must be called again after making room in the output buffer because there 358 must be called again after making room in the output buffer because there
342 might be more output pending. 359 might be more output pending.
343 360
344 If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much 361 The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
345 output as possible to the output buffer. The flushing behavior of inflate is 362 Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
346 not specified for values of the flush parameter other than Z_SYNC_FLUSH 363 output as possible to the output buffer. Z_BLOCK requests that inflate() stop
347 and Z_FINISH, but the current implementation actually flushes as much output 364 if and when it gets to the next deflate block boundary. When decoding the
348 as possible anyway. 365 zlib or gzip format, this will cause inflate() to return immediately after
366 the header and before the first block. When doing a raw inflate, inflate()
367 will go ahead and process the first block, and will return when it gets to
368 the end of that block, or when it runs out of data.
369
370 The Z_BLOCK option assists in appending to or combining deflate streams.
371 Also to assist in this, on return inflate() will set strm->data_type to the
372 number of unused bits in the last byte taken from strm->next_in, plus 64
373 if inflate() is currently decoding the last block in the deflate stream,
374 plus 128 if inflate() returned immediately after decoding an end-of-block
375 code or decoding the complete header up to just before the first byte of the
376 deflate stream. The end-of-block will not be indicated until all of the
377 uncompressed data from that block has been written to strm->next_out. The
378 number of unused bits may in general be greater than seven, except when
379 bit 7 of data_type is set, in which case the number of unused bits will be
380 less than eight.
349 381
350 inflate() should normally be called until it returns Z_STREAM_END or an 382 inflate() should normally be called until it returns Z_STREAM_END or an
351 error. However if all decompression is to be performed in a single step 383 error. However if all decompression is to be performed in a single step
@@ -355,29 +387,44 @@ extern int zlib_inflate (z_streamp strm, int flush);
355 uncompressed data. (The size of the uncompressed data may have been saved 387 uncompressed data. (The size of the uncompressed data may have been saved
356 by the compressor for this purpose.) The next operation on this stream must 388 by the compressor for this purpose.) The next operation on this stream must
357 be inflateEnd to deallocate the decompression state. The use of Z_FINISH 389 be inflateEnd to deallocate the decompression state. The use of Z_FINISH
358 is never required, but can be used to inform inflate that a faster routine 390 is never required, but can be used to inform inflate that a faster approach
359 may be used for the single inflate() call. 391 may be used for the single inflate() call.
360 392
361 If a preset dictionary is needed at this point (see inflateSetDictionary 393 In this implementation, inflate() always flushes as much output as
362 below), inflate sets strm-adler to the adler32 checksum of the 394 possible to the output buffer, and always uses the faster approach on the
363 dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise 395 first call. So the only effect of the flush parameter in this implementation
364 it sets strm->adler to the adler32 checksum of all output produced 396 is on the return value of inflate(), as noted below, or when it returns early
365 so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or 397 because Z_BLOCK is used.
366 an error code as described below. At the end of the stream, inflate() 398
367 checks that its computed adler32 checksum is equal to that saved by the 399 If a preset dictionary is needed after this call (see inflateSetDictionary
368 compressor and returns Z_STREAM_END only if the checksum is correct. 400 below), inflate sets strm->adler to the adler32 checksum of the dictionary
401 chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
402 strm->adler to the adler32 checksum of all output produced so far (that is,
403 total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
404 below. At the end of the stream, inflate() checks that its computed adler32
405 checksum is equal to that saved by the compressor and returns Z_STREAM_END
406 only if the checksum is correct.
407
408 inflate() will decompress and check either zlib-wrapped or gzip-wrapped
409 deflate data. The header type is detected automatically. Any information
410 contained in the gzip header is not retained, so applications that need that
411 information should instead use raw inflate, see inflateInit2() below, or
412 inflateBack() and perform their own processing of the gzip header and
413 trailer.
369 414
370 inflate() returns Z_OK if some progress has been made (more input processed 415 inflate() returns Z_OK if some progress has been made (more input processed
371 or more output produced), Z_STREAM_END if the end of the compressed data has 416 or more output produced), Z_STREAM_END if the end of the compressed data has
372 been reached and all uncompressed output has been produced, Z_NEED_DICT if a 417 been reached and all uncompressed output has been produced, Z_NEED_DICT if a
373 preset dictionary is needed at this point, Z_DATA_ERROR if the input data was 418 preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
374 corrupted (input stream not conforming to the zlib format or incorrect 419 corrupted (input stream not conforming to the zlib format or incorrect check
375 adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent 420 value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
376 (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not 421 if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
377 enough memory, Z_BUF_ERROR if no progress is possible or if there was not 422 Z_BUF_ERROR if no progress is possible or if there was not enough room in the
378 enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR 423 output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
379 case, the application may then call inflateSync to look for a good 424 inflate() can be called again with more input and more output space to
380 compression block. 425 continue decompressing. If Z_DATA_ERROR is returned, the application may then
426 call inflateSync() to look for a good compression block if a partial recovery
427 of the data is desired.
381*/ 428*/
382 429
383 430
@@ -547,16 +594,36 @@ extern int inflateInit2 (z_streamp strm, int windowBits);
547 The windowBits parameter is the base two logarithm of the maximum window 594 The windowBits parameter is the base two logarithm of the maximum window
548 size (the size of the history buffer). It should be in the range 8..15 for 595 size (the size of the history buffer). It should be in the range 8..15 for
549 this version of the library. The default value is 15 if inflateInit is used 596 this version of the library. The default value is 15 if inflateInit is used
550 instead. If a compressed stream with a larger window size is given as 597 instead. windowBits must be greater than or equal to the windowBits value
551 input, inflate() will return with the error code Z_DATA_ERROR instead of 598 provided to deflateInit2() while compressing, or it must be equal to 15 if
552 trying to allocate a larger window. 599 deflateInit2() was not used. If a compressed stream with a larger window
553 600 size is given as input, inflate() will return with the error code
554 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 601 Z_DATA_ERROR instead of trying to allocate a larger window.
555 memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative 602
556 memLevel). msg is set to null if there is no error message. inflateInit2 603 windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
557 does not perform any decompression apart from reading the zlib header if 604 determines the window size. inflate() will then process raw deflate data,
558 present: this will be done by inflate(). (So next_in and avail_in may be 605 not looking for a zlib or gzip header, not generating a check value, and not
559 modified, but next_out and avail_out are unchanged.) 606 looking for any check values for comparison at the end of the stream. This
607 is for use with other formats that use the deflate compressed data format
608 such as zip. Those formats provide their own check values. If a custom
609 format is developed using the raw deflate format for compressed data, it is
610 recommended that a check value such as an adler32 or a crc32 be applied to
611 the uncompressed data as is done in the zlib, gzip, and zip formats. For
612 most applications, the zlib format should be used as is. Note that comments
613 above on the use in deflateInit2() applies to the magnitude of windowBits.
614
615 windowBits can also be greater than 15 for optional gzip decoding. Add
616 32 to windowBits to enable zlib and gzip decoding with automatic header
617 detection, or add 16 to decode only the gzip format (the zlib format will
618 return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is
619 a crc32 instead of an adler32.
620
621 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
622 memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
623 is set to null if there is no error message. inflateInit2 does not perform
624 any decompression apart from reading the zlib header if present: this will
625 be done by inflate(). (So next_in and avail_in may be modified, but next_out
626 and avail_out are unchanged.)
560*/ 627*/
561 628
562extern int zlib_inflateSetDictionary (z_streamp strm, 629extern int zlib_inflateSetDictionary (z_streamp strm,
@@ -564,16 +631,19 @@ extern int zlib_inflateSetDictionary (z_streamp strm,
564 uInt dictLength); 631 uInt dictLength);
565/* 632/*
566 Initializes the decompression dictionary from the given uncompressed byte 633 Initializes the decompression dictionary from the given uncompressed byte
567 sequence. This function must be called immediately after a call of inflate 634 sequence. This function must be called immediately after a call of inflate,
568 if this call returned Z_NEED_DICT. The dictionary chosen by the compressor 635 if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
569 can be determined from the Adler32 value returned by this call of 636 can be determined from the adler32 value returned by that call of inflate.
570 inflate. The compressor and decompressor must use exactly the same 637 The compressor and decompressor must use exactly the same dictionary (see
571 dictionary (see deflateSetDictionary). 638 deflateSetDictionary). For raw inflate, this function can be called
639 immediately after inflateInit2() or inflateReset() and before any call of
640 inflate() to set the dictionary. The application must insure that the
641 dictionary that was used for compression is provided.
572 642
573 inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a 643 inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
574 parameter is invalid (such as NULL dictionary) or the stream state is 644 parameter is invalid (such as NULL dictionary) or the stream state is
575 inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the 645 inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
576 expected one (incorrect Adler32 value). inflateSetDictionary does not 646 expected one (incorrect adler32 value). inflateSetDictionary does not
577 perform any decompression: this will be done by subsequent calls of 647 perform any decompression: this will be done by subsequent calls of
578 inflate(). 648 inflate().
579*/ 649*/
@@ -614,40 +684,19 @@ extern int zlib_inflateIncomp (z_stream *strm);
614 containing the data at next_in (except that the data is not output). 684 containing the data at next_in (except that the data is not output).
615*/ 685*/
616 686
617 /* various hacks, don't look :) */
618
619/* deflateInit and inflateInit are macros to allow checking the zlib version
620 * and the compiler's view of z_stream:
621 */
622extern int zlib_deflateInit_ (z_streamp strm, int level,
623 const char *version, int stream_size);
624extern int zlib_inflateInit_ (z_streamp strm,
625 const char *version, int stream_size);
626extern int zlib_deflateInit2_ (z_streamp strm, int level, int method,
627 int windowBits, int memLevel,
628 int strategy, const char *version,
629 int stream_size);
630extern int zlib_inflateInit2_ (z_streamp strm, int windowBits,
631 const char *version, int stream_size);
632#define zlib_deflateInit(strm, level) \ 687#define zlib_deflateInit(strm, level) \
633 zlib_deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) 688 zlib_deflateInit2((strm), (level), Z_DEFLATED, MAX_WBITS, \
689 DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY)
634#define zlib_inflateInit(strm) \ 690#define zlib_inflateInit(strm) \
635 zlib_inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) 691 zlib_inflateInit2((strm), DEF_WBITS)
636#define zlib_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
637 zlib_deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
638 (strategy), ZLIB_VERSION, sizeof(z_stream))
639#define zlib_inflateInit2(strm, windowBits) \
640 zlib_inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
641 692
693extern int zlib_deflateInit2(z_streamp strm, int level, int method,
694 int windowBits, int memLevel,
695 int strategy);
696extern int zlib_inflateInit2(z_streamp strm, int windowBits);
642 697
643#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) 698#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
644 struct internal_state {int dummy;}; /* hack for buggy compilers */ 699 struct internal_state {int dummy;}; /* hack for buggy compilers */
645#endif 700#endif
646 701
647extern const char * zlib_zError (int err);
648#if 0
649extern int zlib_inflateSyncPoint (z_streamp z);
650#endif
651extern const uLong * zlib_get_crc_table (void);
652
653#endif /* _ZLIB_H */ 702#endif /* _ZLIB_H */
diff --git a/include/linux/zutil.h b/include/linux/zutil.h
index ee0c59cf2136..6adfa9a6ffe9 100644
--- a/include/linux/zutil.h
+++ b/include/linux/zutil.h
@@ -23,18 +23,6 @@ typedef unsigned long ulg;
23 23
24 /* common constants */ 24 /* common constants */
25 25
26#ifndef DEF_WBITS
27# define DEF_WBITS MAX_WBITS
28#endif
29/* default windowBits for decompression. MAX_WBITS is for compression only */
30
31#if MAX_MEM_LEVEL >= 8
32# define DEF_MEM_LEVEL 8
33#else
34# define DEF_MEM_LEVEL MAX_MEM_LEVEL
35#endif
36/* default memLevel */
37
38#define STORED_BLOCK 0 26#define STORED_BLOCK 0
39#define STATIC_TREES 1 27#define STATIC_TREES 1
40#define DYN_TREES 2 28#define DYN_TREES 2
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index b45a73712748..446afc3ea27f 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -378,6 +378,7 @@
378#define AC97_HAS_NO_MIC (1<<15) /* no MIC volume */ 378#define AC97_HAS_NO_MIC (1<<15) /* no MIC volume */
379#define AC97_HAS_NO_TONE (1<<16) /* no Tone volume */ 379#define AC97_HAS_NO_TONE (1<<16) /* no Tone volume */
380#define AC97_HAS_NO_STD_PCM (1<<17) /* no standard AC97 PCM volume and mute */ 380#define AC97_HAS_NO_STD_PCM (1<<17) /* no standard AC97 PCM volume and mute */
381#define AC97_HAS_NO_AUX (1<<18) /* no standard AC97 AUX volume and mute */
381 382
382/* rates indexes */ 383/* rates indexes */
383#define AC97_RATES_FRONT_DAC 0 384#define AC97_RATES_FRONT_DAC 0
diff --git a/include/sound/asequencer.h b/include/sound/asequencer.h
index 6691e4aa4ea7..3f2f4042a20d 100644
--- a/include/sound/asequencer.h
+++ b/include/sound/asequencer.h
@@ -605,6 +605,10 @@ struct snd_seq_remove_events {
605#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */ 605#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
606#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */ 606#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
607/*...*/ 607/*...*/
608#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
609#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
610#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
611#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
608#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */ 612#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
609 613
610/* misc. conditioning flags */ 614/* misc. conditioning flags */
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 9cc021c7ee11..41885f48ad91 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -137,7 +137,7 @@ enum {
137 * * 137 * *
138 *****************************************************************************/ 138 *****************************************************************************/
139 139
140#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) 140#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8)
141 141
142typedef unsigned long snd_pcm_uframes_t; 142typedef unsigned long snd_pcm_uframes_t;
143typedef signed long snd_pcm_sframes_t; 143typedef signed long snd_pcm_sframes_t;
diff --git a/include/sound/core.h b/include/sound/core.h
index 5135147f20e8..5d184be0ff72 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -233,9 +233,8 @@ int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size
233 233
234/* init.c */ 234/* init.c */
235 235
236extern unsigned int snd_cards_lock;
237extern struct snd_card *snd_cards[SNDRV_CARDS]; 236extern struct snd_card *snd_cards[SNDRV_CARDS];
238extern rwlock_t snd_card_rwlock; 237int snd_card_locked(int card);
239#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) 238#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
240#define SND_MIXER_OSS_NOTIFY_REGISTER 0 239#define SND_MIXER_OSS_NOTIFY_REGISTER 0
241#define SND_MIXER_OSS_NOTIFY_DISCONNECT 1 240#define SND_MIXER_OSS_NOTIFY_DISCONNECT 1
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 186e00ad9e79..884bbf54cd36 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -245,6 +245,7 @@
245#define A_IOCFG_GPOUT0 0x0044 /* analog/digital */ 245#define A_IOCFG_GPOUT0 0x0044 /* analog/digital */
246#define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4) */ 246#define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4) */
247#define A_IOCFG_ENABLE_DIGITAL 0x0004 247#define A_IOCFG_ENABLE_DIGITAL 0x0004
248#define A_IOCFG_ENABLE_DIGITAL_AUDIGY4 0x0080
248#define A_IOCFG_UNKNOWN_20 0x0020 249#define A_IOCFG_UNKNOWN_20 0x0020
249#define A_IOCFG_DISABLE_AC97_FRONT 0x0080 /* turn off ac97 front -> front (10k2.1) */ 250#define A_IOCFG_DISABLE_AC97_FRONT 0x0080 /* turn off ac97 front -> front (10k2.1) */
250#define A_IOCFG_GPOUT1 0x0002 /* IR? drive's internal bypass (?) */ 251#define A_IOCFG_GPOUT1 0x0002 /* IR? drive's internal bypass (?) */
@@ -1065,6 +1066,7 @@ struct snd_emu_chip_details {
1065 unsigned char emu1212m; /* EMU 1212m card */ 1066 unsigned char emu1212m; /* EMU 1212m card */
1066 unsigned char spi_dac; /* SPI interface for DAC */ 1067 unsigned char spi_dac; /* SPI interface for DAC */
1067 unsigned char i2c_adc; /* I2C interface for ADC */ 1068 unsigned char i2c_adc; /* I2C interface for ADC */
1069 unsigned char adc_1361t; /* Use Philips 1361T ADC */
1068 const char *driver; 1070 const char *driver;
1069 const char *name; 1071 const char *name;
1070 const char *id; /* for backward compatibility - can be NULL if not needed */ 1072 const char *id; /* for backward compatibility - can be NULL if not needed */
diff --git a/include/sound/info.h b/include/sound/info.h
index f23d8381c216..74f6996769c7 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -27,9 +27,9 @@
27/* buffer for information */ 27/* buffer for information */
28struct snd_info_buffer { 28struct snd_info_buffer {
29 char *buffer; /* pointer to begin of buffer */ 29 char *buffer; /* pointer to begin of buffer */
30 char *curr; /* current position in buffer */ 30 unsigned int curr; /* current position in buffer */
31 unsigned long size; /* current size */ 31 unsigned int size; /* current size */
32 unsigned long len; /* total length of buffer */ 32 unsigned int len; /* total length of buffer */
33 int stop; /* stop flag */ 33 int stop; /* stop flag */
34 int error; /* error code */ 34 int error; /* error code */
35}; 35};
@@ -40,8 +40,6 @@ struct snd_info_buffer {
40struct snd_info_entry; 40struct snd_info_entry;
41 41
42struct snd_info_entry_text { 42struct snd_info_entry_text {
43 unsigned long read_size;
44 unsigned long write_size;
45 void (*read) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); 43 void (*read) (struct snd_info_entry *entry, struct snd_info_buffer *buffer);
46 void (*write) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); 44 void (*write) (struct snd_info_entry *entry, struct snd_info_buffer *buffer);
47}; 45};
@@ -132,11 +130,9 @@ int snd_card_proc_new(struct snd_card *card, const char *name, struct snd_info_e
132 130
133static inline void snd_info_set_text_ops(struct snd_info_entry *entry, 131static inline void snd_info_set_text_ops(struct snd_info_entry *entry,
134 void *private_data, 132 void *private_data,
135 long read_size,
136 void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) 133 void (*read)(struct snd_info_entry *, struct snd_info_buffer *))
137{ 134{
138 entry->private_data = private_data; 135 entry->private_data = private_data;
139 entry->c.text.read_size = read_size;
140 entry->c.text.read = read; 136 entry->c.text.read = read;
141} 137}
142 138
@@ -167,7 +163,6 @@ static inline int snd_card_proc_new(struct snd_card *card, const char *name,
167 struct snd_info_entry **entryp) { return -EINVAL; } 163 struct snd_info_entry **entryp) { return -EINVAL; }
168static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)), 164static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)),
169 void *private_data, 165 void *private_data,
170 long read_size,
171 void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {} 166 void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {}
172 167
173static inline int snd_info_check_reserved_words(const char *str) { return 1; } 168static inline int snd_info_check_reserved_words(const char *str) { return 1; }
diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h
index 8e97ace78f16..ac504321ea56 100644
--- a/include/sound/mpu401.h
+++ b/include/sound/mpu401.h
@@ -45,6 +45,12 @@
45#define MPU401_HW_PC98II 18 /* Roland PC98II */ 45#define MPU401_HW_PC98II 18 /* Roland PC98II */
46#define MPU401_HW_AUREAL 19 /* Aureal Vortex */ 46#define MPU401_HW_AUREAL 19 /* Aureal Vortex */
47 47
48#define MPU401_INFO_INPUT (1 << 0) /* input stream */
49#define MPU401_INFO_OUTPUT (1 << 1) /* output stream */
50#define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */
51#define MPU401_INFO_MMIO (1 << 3) /* MMIO access */
52#define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */
53
48#define MPU401_MODE_BIT_INPUT 0 54#define MPU401_MODE_BIT_INPUT 0
49#define MPU401_MODE_BIT_OUTPUT 1 55#define MPU401_MODE_BIT_OUTPUT 1
50#define MPU401_MODE_BIT_INPUT_TRIGGER 2 56#define MPU401_MODE_BIT_INPUT_TRIGGER 2
@@ -62,6 +68,7 @@ struct snd_mpu401 {
62 struct snd_rawmidi *rmidi; 68 struct snd_rawmidi *rmidi;
63 69
64 unsigned short hardware; /* MPU401_HW_XXXX */ 70 unsigned short hardware; /* MPU401_HW_XXXX */
71 unsigned int info_flags; /* MPU401_INFO_XXX */
65 unsigned long port; /* base port of MPU-401 chip */ 72 unsigned long port; /* base port of MPU-401 chip */
66 unsigned long cport; /* port + 1 (usually) */ 73 unsigned long cport; /* port + 1 (usually) */
67 struct resource *res; /* port resource */ 74 struct resource *res; /* port resource */
@@ -99,13 +106,16 @@ struct snd_mpu401 {
99 106
100 */ 107 */
101 108
102irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs); 109irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id,
110 struct pt_regs *regs);
111irqreturn_t snd_mpu401_uart_interrupt_tx(int irq, void *dev_id,
112 struct pt_regs *regs);
103 113
104int snd_mpu401_uart_new(struct snd_card *card, 114int snd_mpu401_uart_new(struct snd_card *card,
105 int device, 115 int device,
106 unsigned short hardware, 116 unsigned short hardware,
107 unsigned long port, 117 unsigned long port,
108 int integrated, 118 unsigned int info_flags,
109 int irq, 119 int irq,
110 int irq_flags, 120 int irq_flags,
111 struct snd_rawmidi ** rrawmidi); 121 struct snd_rawmidi ** rrawmidi);
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 373425895faa..f84d84993a31 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -300,7 +300,6 @@ struct snd_pcm_runtime {
300 /* -- mmap -- */ 300 /* -- mmap -- */
301 volatile struct snd_pcm_mmap_status *status; 301 volatile struct snd_pcm_mmap_status *status;
302 volatile struct snd_pcm_mmap_control *control; 302 volatile struct snd_pcm_mmap_control *control;
303 atomic_t mmap_count;
304 303
305 /* -- locking / scheduling -- */ 304 /* -- locking / scheduling -- */
306 wait_queue_head_t sleep; 305 wait_queue_head_t sleep;
@@ -368,7 +367,9 @@ struct snd_pcm_substream {
368 struct snd_pcm_group *group; /* pointer to current group */ 367 struct snd_pcm_group *group; /* pointer to current group */
369 /* -- assigned files -- */ 368 /* -- assigned files -- */
370 void *file; 369 void *file;
371 struct file *ffile; 370 int ref_count;
371 atomic_t mmap_count;
372 unsigned int f_flags;
372 void (*pcm_release)(struct snd_pcm_substream *); 373 void (*pcm_release)(struct snd_pcm_substream *);
373#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 374#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
374 /* -- OSS things -- */ 375 /* -- OSS things -- */
@@ -387,7 +388,7 @@ struct snd_pcm_substream {
387 unsigned int hw_opened: 1; 388 unsigned int hw_opened: 1;
388}; 389};
389 390
390#define SUBSTREAM_BUSY(substream) ((substream)->file != NULL) 391#define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0)
391 392
392 393
393struct snd_pcm_str { 394struct snd_pcm_str {
@@ -825,14 +826,6 @@ int snd_interval_ratnum(struct snd_interval *i,
825 826
826void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params); 827void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params);
827void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var); 828void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var);
828int snd_pcm_hw_param_near(struct snd_pcm_substream *substream,
829 struct snd_pcm_hw_params *params,
830 snd_pcm_hw_param_t var,
831 unsigned int val, int *dir);
832int snd_pcm_hw_param_set(struct snd_pcm_substream *pcm,
833 struct snd_pcm_hw_params *params,
834 snd_pcm_hw_param_t var,
835 unsigned int val, int dir);
836int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); 829int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
837 830
838int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); 831int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
@@ -979,13 +972,13 @@ struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigne
979static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) 972static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area)
980{ 973{
981 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; 974 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
982 atomic_inc(&substream->runtime->mmap_count); 975 atomic_inc(&substream->mmap_count);
983} 976}
984 977
985static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) 978static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area)
986{ 979{
987 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; 980 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
988 atomic_dec(&substream->runtime->mmap_count); 981 atomic_dec(&substream->mmap_count);
989} 982}
990 983
991/* mmap for io-memory area */ 984/* mmap for io-memory area */
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h
index fb18aef77341..85cf1cf4f31a 100644
--- a/include/sound/pcm_params.h
+++ b/include/sound/pcm_params.h
@@ -22,29 +22,21 @@
22 * 22 *
23 */ 23 */
24 24
25extern int snd_pcm_hw_param_mask(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params, 25int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm,
26 snd_pcm_hw_param_t var, const struct snd_mask *val); 26 struct snd_pcm_hw_params *params,
27extern unsigned int snd_pcm_hw_param_value_min(const struct snd_pcm_hw_params *params, 27 snd_pcm_hw_param_t var, int *dir);
28 snd_pcm_hw_param_t var, int *dir); 28int snd_pcm_hw_param_last(struct snd_pcm_substream *pcm,
29extern unsigned int snd_pcm_hw_param_value_max(const struct snd_pcm_hw_params *params, 29 struct snd_pcm_hw_params *params,
30 snd_pcm_hw_param_t var, int *dir); 30 snd_pcm_hw_param_t var, int *dir);
31extern int _snd_pcm_hw_param_min(struct snd_pcm_hw_params *params, 31int snd_pcm_hw_param_value(const struct snd_pcm_hw_params *params,
32 snd_pcm_hw_param_t var, unsigned int val, int dir); 32 snd_pcm_hw_param_t var, int *dir);
33extern int _snd_pcm_hw_param_setinteger(struct snd_pcm_hw_params *params,
34 snd_pcm_hw_param_t var);
35extern int _snd_pcm_hw_param_set(struct snd_pcm_hw_params *params,
36 snd_pcm_hw_param_t var, unsigned int val, int dir);
37
38/* To share the same code we have alsa-lib */
39#define INLINE static inline
40#define assert(a) (void)(a)
41 33
42#define SNDRV_MASK_BITS 64 /* we use so far 64bits only */ 34#define SNDRV_MASK_BITS 64 /* we use so far 64bits only */
43#define SNDRV_MASK_SIZE (SNDRV_MASK_BITS / 32) 35#define SNDRV_MASK_SIZE (SNDRV_MASK_BITS / 32)
44#define MASK_OFS(i) ((i) >> 5) 36#define MASK_OFS(i) ((i) >> 5)
45#define MASK_BIT(i) (1U << ((i) & 31)) 37#define MASK_BIT(i) (1U << ((i) & 31))
46 38
47INLINE unsigned int ld2(u_int32_t v) 39static inline unsigned int ld2(u_int32_t v)
48{ 40{
49 unsigned r = 0; 41 unsigned r = 0;
50 42
@@ -69,22 +61,22 @@ INLINE unsigned int ld2(u_int32_t v)
69 return r; 61 return r;
70} 62}
71 63
72INLINE size_t snd_mask_sizeof(void) 64static inline size_t snd_mask_sizeof(void)
73{ 65{
74 return sizeof(struct snd_mask); 66 return sizeof(struct snd_mask);
75} 67}
76 68
77INLINE void snd_mask_none(struct snd_mask *mask) 69static inline void snd_mask_none(struct snd_mask *mask)
78{ 70{
79 memset(mask, 0, sizeof(*mask)); 71 memset(mask, 0, sizeof(*mask));
80} 72}
81 73
82INLINE void snd_mask_any(struct snd_mask *mask) 74static inline void snd_mask_any(struct snd_mask *mask)
83{ 75{
84 memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t)); 76 memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t));
85} 77}
86 78
87INLINE int snd_mask_empty(const struct snd_mask *mask) 79static inline int snd_mask_empty(const struct snd_mask *mask)
88{ 80{
89 int i; 81 int i;
90 for (i = 0; i < SNDRV_MASK_SIZE; i++) 82 for (i = 0; i < SNDRV_MASK_SIZE; i++)
@@ -93,10 +85,9 @@ INLINE int snd_mask_empty(const struct snd_mask *mask)
93 return 1; 85 return 1;
94} 86}
95 87
96INLINE unsigned int snd_mask_min(const struct snd_mask *mask) 88static inline unsigned int snd_mask_min(const struct snd_mask *mask)
97{ 89{
98 int i; 90 int i;
99 assert(!snd_mask_empty(mask));
100 for (i = 0; i < SNDRV_MASK_SIZE; i++) { 91 for (i = 0; i < SNDRV_MASK_SIZE; i++) {
101 if (mask->bits[i]) 92 if (mask->bits[i])
102 return ffs(mask->bits[i]) - 1 + (i << 5); 93 return ffs(mask->bits[i]) - 1 + (i << 5);
@@ -104,10 +95,9 @@ INLINE unsigned int snd_mask_min(const struct snd_mask *mask)
104 return 0; 95 return 0;
105} 96}
106 97
107INLINE unsigned int snd_mask_max(const struct snd_mask *mask) 98static inline unsigned int snd_mask_max(const struct snd_mask *mask)
108{ 99{
109 int i; 100 int i;
110 assert(!snd_mask_empty(mask));
111 for (i = SNDRV_MASK_SIZE - 1; i >= 0; i--) { 101 for (i = SNDRV_MASK_SIZE - 1; i >= 0; i--) {
112 if (mask->bits[i]) 102 if (mask->bits[i])
113 return ld2(mask->bits[i]) + (i << 5); 103 return ld2(mask->bits[i]) + (i << 5);
@@ -115,70 +105,68 @@ INLINE unsigned int snd_mask_max(const struct snd_mask *mask)
115 return 0; 105 return 0;
116} 106}
117 107
118INLINE void snd_mask_set(struct snd_mask *mask, unsigned int val) 108static inline void snd_mask_set(struct snd_mask *mask, unsigned int val)
119{ 109{
120 assert(val <= SNDRV_MASK_BITS);
121 mask->bits[MASK_OFS(val)] |= MASK_BIT(val); 110 mask->bits[MASK_OFS(val)] |= MASK_BIT(val);
122} 111}
123 112
124INLINE void snd_mask_reset(struct snd_mask *mask, unsigned int val) 113static inline void snd_mask_reset(struct snd_mask *mask, unsigned int val)
125{ 114{
126 assert(val <= SNDRV_MASK_BITS);
127 mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val); 115 mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val);
128} 116}
129 117
130INLINE void snd_mask_set_range(struct snd_mask *mask, unsigned int from, unsigned int to) 118static inline void snd_mask_set_range(struct snd_mask *mask,
119 unsigned int from, unsigned int to)
131{ 120{
132 unsigned int i; 121 unsigned int i;
133 assert(to <= SNDRV_MASK_BITS && from <= to);
134 for (i = from; i <= to; i++) 122 for (i = from; i <= to; i++)
135 mask->bits[MASK_OFS(i)] |= MASK_BIT(i); 123 mask->bits[MASK_OFS(i)] |= MASK_BIT(i);
136} 124}
137 125
138INLINE void snd_mask_reset_range(struct snd_mask *mask, unsigned int from, unsigned int to) 126static inline void snd_mask_reset_range(struct snd_mask *mask,
127 unsigned int from, unsigned int to)
139{ 128{
140 unsigned int i; 129 unsigned int i;
141 assert(to <= SNDRV_MASK_BITS && from <= to);
142 for (i = from; i <= to; i++) 130 for (i = from; i <= to; i++)
143 mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i); 131 mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i);
144} 132}
145 133
146INLINE void snd_mask_leave(struct snd_mask *mask, unsigned int val) 134static inline void snd_mask_leave(struct snd_mask *mask, unsigned int val)
147{ 135{
148 unsigned int v; 136 unsigned int v;
149 assert(val <= SNDRV_MASK_BITS);
150 v = mask->bits[MASK_OFS(val)] & MASK_BIT(val); 137 v = mask->bits[MASK_OFS(val)] & MASK_BIT(val);
151 snd_mask_none(mask); 138 snd_mask_none(mask);
152 mask->bits[MASK_OFS(val)] = v; 139 mask->bits[MASK_OFS(val)] = v;
153} 140}
154 141
155INLINE void snd_mask_intersect(struct snd_mask *mask, const struct snd_mask *v) 142static inline void snd_mask_intersect(struct snd_mask *mask,
143 const struct snd_mask *v)
156{ 144{
157 int i; 145 int i;
158 for (i = 0; i < SNDRV_MASK_SIZE; i++) 146 for (i = 0; i < SNDRV_MASK_SIZE; i++)
159 mask->bits[i] &= v->bits[i]; 147 mask->bits[i] &= v->bits[i];
160} 148}
161 149
162INLINE int snd_mask_eq(const struct snd_mask *mask, const struct snd_mask *v) 150static inline int snd_mask_eq(const struct snd_mask *mask,
151 const struct snd_mask *v)
163{ 152{
164 return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t)); 153 return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t));
165} 154}
166 155
167INLINE void snd_mask_copy(struct snd_mask *mask, const struct snd_mask *v) 156static inline void snd_mask_copy(struct snd_mask *mask,
157 const struct snd_mask *v)
168{ 158{
169 *mask = *v; 159 *mask = *v;
170} 160}
171 161
172INLINE int snd_mask_test(const struct snd_mask *mask, unsigned int val) 162static inline int snd_mask_test(const struct snd_mask *mask, unsigned int val)
173{ 163{
174 assert(val <= SNDRV_MASK_BITS);
175 return mask->bits[MASK_OFS(val)] & MASK_BIT(val); 164 return mask->bits[MASK_OFS(val)] & MASK_BIT(val);
176} 165}
177 166
178INLINE int snd_mask_single(const struct snd_mask *mask) 167static inline int snd_mask_single(const struct snd_mask *mask)
179{ 168{
180 int i, c = 0; 169 int i, c = 0;
181 assert(!snd_mask_empty(mask));
182 for (i = 0; i < SNDRV_MASK_SIZE; i++) { 170 for (i = 0; i < SNDRV_MASK_SIZE; i++) {
183 if (! mask->bits[i]) 171 if (! mask->bits[i])
184 continue; 172 continue;
@@ -191,10 +179,10 @@ INLINE int snd_mask_single(const struct snd_mask *mask)
191 return 1; 179 return 1;
192} 180}
193 181
194INLINE int snd_mask_refine(struct snd_mask *mask, const struct snd_mask *v) 182static inline int snd_mask_refine(struct snd_mask *mask,
183 const struct snd_mask *v)
195{ 184{
196 struct snd_mask old; 185 struct snd_mask old;
197 assert(!snd_mask_empty(mask));
198 snd_mask_copy(&old, mask); 186 snd_mask_copy(&old, mask);
199 snd_mask_intersect(mask, v); 187 snd_mask_intersect(mask, v);
200 if (snd_mask_empty(mask)) 188 if (snd_mask_empty(mask))
@@ -202,27 +190,24 @@ INLINE int snd_mask_refine(struct snd_mask *mask, const struct snd_mask *v)
202 return !snd_mask_eq(mask, &old); 190 return !snd_mask_eq(mask, &old);
203} 191}
204 192
205INLINE int snd_mask_refine_first(struct snd_mask *mask) 193static inline int snd_mask_refine_first(struct snd_mask *mask)
206{ 194{
207 assert(!snd_mask_empty(mask));
208 if (snd_mask_single(mask)) 195 if (snd_mask_single(mask))
209 return 0; 196 return 0;
210 snd_mask_leave(mask, snd_mask_min(mask)); 197 snd_mask_leave(mask, snd_mask_min(mask));
211 return 1; 198 return 1;
212} 199}
213 200
214INLINE int snd_mask_refine_last(struct snd_mask *mask) 201static inline int snd_mask_refine_last(struct snd_mask *mask)
215{ 202{
216 assert(!snd_mask_empty(mask));
217 if (snd_mask_single(mask)) 203 if (snd_mask_single(mask))
218 return 0; 204 return 0;
219 snd_mask_leave(mask, snd_mask_max(mask)); 205 snd_mask_leave(mask, snd_mask_max(mask));
220 return 1; 206 return 1;
221} 207}
222 208
223INLINE int snd_mask_refine_min(struct snd_mask *mask, unsigned int val) 209static inline int snd_mask_refine_min(struct snd_mask *mask, unsigned int val)
224{ 210{
225 assert(!snd_mask_empty(mask));
226 if (snd_mask_min(mask) >= val) 211 if (snd_mask_min(mask) >= val)
227 return 0; 212 return 0;
228 snd_mask_reset_range(mask, 0, val - 1); 213 snd_mask_reset_range(mask, 0, val - 1);
@@ -231,9 +216,8 @@ INLINE int snd_mask_refine_min(struct snd_mask *mask, unsigned int val)
231 return 1; 216 return 1;
232} 217}
233 218
234INLINE int snd_mask_refine_max(struct snd_mask *mask, unsigned int val) 219static inline int snd_mask_refine_max(struct snd_mask *mask, unsigned int val)
235{ 220{
236 assert(!snd_mask_empty(mask));
237 if (snd_mask_max(mask) <= val) 221 if (snd_mask_max(mask) <= val)
238 return 0; 222 return 0;
239 snd_mask_reset_range(mask, val + 1, SNDRV_MASK_BITS); 223 snd_mask_reset_range(mask, val + 1, SNDRV_MASK_BITS);
@@ -242,10 +226,9 @@ INLINE int snd_mask_refine_max(struct snd_mask *mask, unsigned int val)
242 return 1; 226 return 1;
243} 227}
244 228
245INLINE int snd_mask_refine_set(struct snd_mask *mask, unsigned int val) 229static inline int snd_mask_refine_set(struct snd_mask *mask, unsigned int val)
246{ 230{
247 int changed; 231 int changed;
248 assert(!snd_mask_empty(mask));
249 changed = !snd_mask_single(mask); 232 changed = !snd_mask_single(mask);
250 snd_mask_leave(mask, val); 233 snd_mask_leave(mask, val);
251 if (snd_mask_empty(mask)) 234 if (snd_mask_empty(mask))
@@ -253,13 +236,12 @@ INLINE int snd_mask_refine_set(struct snd_mask *mask, unsigned int val)
253 return changed; 236 return changed;
254} 237}
255 238
256INLINE int snd_mask_value(const struct snd_mask *mask) 239static inline int snd_mask_value(const struct snd_mask *mask)
257{ 240{
258 assert(!snd_mask_empty(mask));
259 return snd_mask_min(mask); 241 return snd_mask_min(mask);
260} 242}
261 243
262INLINE void snd_interval_any(struct snd_interval *i) 244static inline void snd_interval_any(struct snd_interval *i)
263{ 245{
264 i->min = 0; 246 i->min = 0;
265 i->openmin = 0; 247 i->openmin = 0;
@@ -269,63 +251,59 @@ INLINE void snd_interval_any(struct snd_interval *i)
269 i->empty = 0; 251 i->empty = 0;
270} 252}
271 253
272INLINE void snd_interval_none(struct snd_interval *i) 254static inline void snd_interval_none(struct snd_interval *i)
273{ 255{
274 i->empty = 1; 256 i->empty = 1;
275} 257}
276 258
277INLINE int snd_interval_checkempty(const struct snd_interval *i) 259static inline int snd_interval_checkempty(const struct snd_interval *i)
278{ 260{
279 return (i->min > i->max || 261 return (i->min > i->max ||
280 (i->min == i->max && (i->openmin || i->openmax))); 262 (i->min == i->max && (i->openmin || i->openmax)));
281} 263}
282 264
283INLINE int snd_interval_empty(const struct snd_interval *i) 265static inline int snd_interval_empty(const struct snd_interval *i)
284{ 266{
285 return i->empty; 267 return i->empty;
286} 268}
287 269
288INLINE int snd_interval_single(const struct snd_interval *i) 270static inline int snd_interval_single(const struct snd_interval *i)
289{ 271{
290 assert(!snd_interval_empty(i));
291 return (i->min == i->max || 272 return (i->min == i->max ||
292 (i->min + 1 == i->max && i->openmax)); 273 (i->min + 1 == i->max && i->openmax));
293} 274}
294 275
295INLINE int snd_interval_value(const struct snd_interval *i) 276static inline int snd_interval_value(const struct snd_interval *i)
296{ 277{
297 assert(snd_interval_single(i));
298 return i->min; 278 return i->min;
299} 279}
300 280
301INLINE int snd_interval_min(const struct snd_interval *i) 281static inline int snd_interval_min(const struct snd_interval *i)
302{ 282{
303 assert(!snd_interval_empty(i));
304 return i->min; 283 return i->min;
305} 284}
306 285
307INLINE int snd_interval_max(const struct snd_interval *i) 286static inline int snd_interval_max(const struct snd_interval *i)
308{ 287{
309 unsigned int v; 288 unsigned int v;
310 assert(!snd_interval_empty(i));
311 v = i->max; 289 v = i->max;
312 if (i->openmax) 290 if (i->openmax)
313 v--; 291 v--;
314 return v; 292 return v;
315} 293}
316 294
317INLINE int snd_interval_test(const struct snd_interval *i, unsigned int val) 295static inline int snd_interval_test(const struct snd_interval *i, unsigned int val)
318{ 296{
319 return !((i->min > val || (i->min == val && i->openmin) || 297 return !((i->min > val || (i->min == val && i->openmin) ||
320 i->max < val || (i->max == val && i->openmax))); 298 i->max < val || (i->max == val && i->openmax)));
321} 299}
322 300
323INLINE void snd_interval_copy(struct snd_interval *d, const struct snd_interval *s) 301static inline void snd_interval_copy(struct snd_interval *d, const struct snd_interval *s)
324{ 302{
325 *d = *s; 303 *d = *s;
326} 304}
327 305
328INLINE int snd_interval_setinteger(struct snd_interval *i) 306static inline int snd_interval_setinteger(struct snd_interval *i)
329{ 307{
330 if (i->integer) 308 if (i->integer)
331 return 0; 309 return 0;
@@ -335,7 +313,7 @@ INLINE int snd_interval_setinteger(struct snd_interval *i)
335 return 1; 313 return 1;
336} 314}
337 315
338INLINE int snd_interval_eq(const struct snd_interval *i1, const struct snd_interval *i2) 316static inline int snd_interval_eq(const struct snd_interval *i1, const struct snd_interval *i2)
339{ 317{
340 if (i1->empty) 318 if (i1->empty)
341 return i2->empty; 319 return i2->empty;
@@ -359,8 +337,5 @@ static inline unsigned int sub(unsigned int a, unsigned int b)
359 return 0; 337 return 0;
360} 338}
361 339
362#undef INLINE
363#undef assert
364
365#endif /* __SOUND_PCM_PARAMS_H */ 340#endif /* __SOUND_PCM_PARAMS_H */
366 341
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
index 584e73dd4793..7dbcd10fa215 100644
--- a/include/sound/rawmidi.h
+++ b/include/sound/rawmidi.h
@@ -46,6 +46,7 @@
46 46
47struct snd_rawmidi; 47struct snd_rawmidi;
48struct snd_rawmidi_substream; 48struct snd_rawmidi_substream;
49struct snd_seq_port_info;
49 50
50struct snd_rawmidi_ops { 51struct snd_rawmidi_ops {
51 int (*open) (struct snd_rawmidi_substream * substream); 52 int (*open) (struct snd_rawmidi_substream * substream);
@@ -57,6 +58,8 @@ struct snd_rawmidi_ops {
57struct snd_rawmidi_global_ops { 58struct snd_rawmidi_global_ops {
58 int (*dev_register) (struct snd_rawmidi * rmidi); 59 int (*dev_register) (struct snd_rawmidi * rmidi);
59 int (*dev_unregister) (struct snd_rawmidi * rmidi); 60 int (*dev_unregister) (struct snd_rawmidi * rmidi);
61 void (*get_port_info)(struct snd_rawmidi *rmidi, int number,
62 struct snd_seq_port_info *info);
60}; 63};
61 64
62struct snd_rawmidi_runtime { 65struct snd_rawmidi_runtime {
diff --git a/include/sound/version.h b/include/sound/version.h
index 4f0e65808cf1..2ee849d0e198 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.11rc4" 2#define CONFIG_SND_VERSION "1.0.12rc1"
3#define CONFIG_SND_DATE " (Wed Mar 22 10:27:24 2006 UTC)" 3#define CONFIG_SND_DATE " (Thu Jun 22 13:55:50 2006 UTC)"