mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.7 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/linux/linux24/88-multiple-soundcard-fix.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. --- linux-2.4.17/drivers/sound/sound_core.c.orig Sun Jan 6 17:31:30 2002
  20. +++ linux/drivers/sound/sound_core.c Sun Jan 6 17:39:43 2002
  21. @@ -17,7 +17,7 @@
  22. * plug into this. The fact they dont all go via OSS doesn't mean
  23. * they don't have to implement the OSS API. There is a lot of logic
  24. * to keeping much of the OSS weight out of the code in a compatibility
  25. - * module, but its up to the driver to rember to load it...
  26. + * module, but it's up to the driver to remember to load it...
  27. *
  28. * The code provides a set of functions for registration of devices
  29. * by type. This is done rather than providing a single call so that
  30. @@ -173,10 +173,10 @@
  31. return r;
  32. }
  33. - if (r == low)
  34. + if ( r < SOUND_STEP )
  35. sprintf (name_buf, "%s", name);
  36. else
  37. - sprintf (name_buf, "%s%d", name, (r - low) / SOUND_STEP);
  38. + sprintf (name_buf, "%s%d", name, (r / SOUND_STEP));
  39. s->de = devfs_register (devfs_handle, name_buf,
  40. DEVFS_FL_NONE, SOUND_MAJOR, s->unit_minor,
  41. S_IFCHR | mode, fops, NULL);
  42. @@ -231,17 +231,20 @@
  43. int register_sound_special(struct file_operations *fops, int unit)
  44. {
  45. - char *name;
  46. + const int chain = (unit & 0x0F);
  47. + int max_unit = chain + 128;
  48. + const char *name;
  49. - switch (unit) {
  50. + switch (chain) {
  51. case 0:
  52. name = "mixer";
  53. break;
  54. case 1:
  55. name = "sequencer";
  56. + max_unit = unit + 1;
  57. break;
  58. case 2:
  59. - name = "midi00";
  60. + name = "midi";
  61. break;
  62. case 3:
  63. name = "dsp";
  64. @@ -260,6 +263,7 @@
  65. break;
  66. case 8:
  67. name = "sequencer2";
  68. + max_unit = unit + 1;
  69. break;
  70. case 9:
  71. name = "dmmidi";
  72. @@ -280,10 +284,10 @@
  73. name = "admmidi";
  74. break;
  75. default:
  76. - name = "unknown";
  77. + name = "unknownX";
  78. break;
  79. }
  80. - return sound_insert_unit(&chains[unit&15], fops, -1, unit, unit+1,
  81. + return sound_insert_unit(&chains[chain], fops, -1, unit, max_unit,
  82. name, S_IRUSR | S_IWUSR);
  83. }