|
# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
|
|
#
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
|
|
# Please add additional copyright information _after_ the line containing
|
|
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
|
|
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
|
|
#
|
|
# ROCK Linux: rock-src/package/base/linux24/88-multiple-soundcard-fix.patch
|
|
# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
# (at your option) any later version. A copy of the GNU General Public
|
|
# License can be found at Documentation/COPYING.
|
|
#
|
|
# Many people helped and are helping developing ROCK Linux. Please
|
|
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
|
|
# file for details.
|
|
#
|
|
# --- ROCK-COPYRIGHT-NOTE-END ---
|
|
|
|
|
|
--- linux-2.4.17/drivers/sound/sound_core.c.orig Sun Jan 6 17:31:30 2002
|
|
+++ linux/drivers/sound/sound_core.c Sun Jan 6 17:39:43 2002
|
|
@@ -17,7 +17,7 @@
|
|
* plug into this. The fact they dont all go via OSS doesn't mean
|
|
* they don't have to implement the OSS API. There is a lot of logic
|
|
* to keeping much of the OSS weight out of the code in a compatibility
|
|
- * module, but its up to the driver to rember to load it...
|
|
+ * module, but it's up to the driver to remember to load it...
|
|
*
|
|
* The code provides a set of functions for registration of devices
|
|
* by type. This is done rather than providing a single call so that
|
|
@@ -173,10 +173,10 @@
|
|
return r;
|
|
}
|
|
|
|
- if (r == low)
|
|
+ if ( r < SOUND_STEP )
|
|
sprintf (name_buf, "%s", name);
|
|
else
|
|
- sprintf (name_buf, "%s%d", name, (r - low) / SOUND_STEP);
|
|
+ sprintf (name_buf, "%s%d", name, (r / SOUND_STEP));
|
|
s->de = devfs_register (devfs_handle, name_buf,
|
|
DEVFS_FL_NONE, SOUND_MAJOR, s->unit_minor,
|
|
S_IFCHR | mode, fops, NULL);
|
|
@@ -231,17 +231,20 @@
|
|
|
|
int register_sound_special(struct file_operations *fops, int unit)
|
|
{
|
|
- char *name;
|
|
+ const int chain = (unit & 0x0F);
|
|
+ int max_unit = chain + 128;
|
|
+ const char *name;
|
|
|
|
- switch (unit) {
|
|
+ switch (chain) {
|
|
case 0:
|
|
name = "mixer";
|
|
break;
|
|
case 1:
|
|
name = "sequencer";
|
|
+ max_unit = unit + 1;
|
|
break;
|
|
case 2:
|
|
- name = "midi00";
|
|
+ name = "midi";
|
|
break;
|
|
case 3:
|
|
name = "dsp";
|
|
@@ -260,6 +263,7 @@
|
|
break;
|
|
case 8:
|
|
name = "sequencer2";
|
|
+ max_unit = unit + 1;
|
|
break;
|
|
case 9:
|
|
name = "dmmidi";
|
|
@@ -280,10 +284,10 @@
|
|
name = "admmidi";
|
|
break;
|
|
default:
|
|
- name = "unknown";
|
|
+ name = "unknownX";
|
|
break;
|
|
}
|
|
- return sound_insert_unit(&chains[unit&15], fops, -1, unit, unit+1,
|
|
+ return sound_insert_unit(&chains[chain], fops, -1, unit, max_unit,
|
|
name, S_IRUSR | S_IWUSR);
|
|
}
|
|
|