[2.3.99p1] bin2hex in /drivers/sound

From: Arjan van de Ven (arjan@fenrus.demon.nl)
Date: Wed Mar 15 2000 - 13:06:54 EST


Hi,

Several soundcards have firmware associated with them. These cards also
allow the optional inclusion of this firmware into the kernel(module).
Unfortionatly, this is currently broken. The fix is:

--- linux/drivers/sound/bin2hex.c.org Sat Mar 11 10:14:26 2000
+++ linux/drivers/sound/bin2hex.c Sat Mar 11 10:14:09 2000
@@ -33,6 +33,6 @@
         i++;
     }
 
- printf( "};\n#define %sLen %d\n", varname, i );
+ printf( "};\nstatic int %sLen = %d;\n", varname, i );
     return 0;
 }

------* end patch *---------
What is happening is this (I take the "maui" card as example, but there
are others):

If the firmware is not included in the kernel, the buildsystem generates a
maui_boot.h with

static unsigned char * maui_os = NULL;
static int maui_osLen = 0;

in it. If the firmware is included, the bin2hex tool creates a maui_boot.h
with

static unsigned char maui_os [] = {..............};
#define maui_osLen = 12345;

(12345 is replaced by the actual size of the firmware).

The problem is that the maui driver tries to be (rightfully) smart and
tries to load the firmware:

if (maui_os == NULL) {
        maui_osLen = mod_firmware_load("/etc/sound/oswf.mot",&maui_os);
}

This works great if the kernel(module) does not have the firmware, but the
define turns it into:

if (maui_os == NULL) {
        12345 = mod_firmware_load("/etc/sound/oswf.mot",&maui_os);
}

which obviously doesn't compile. The patch above makes the "maui_osLen" to
always be a "static int".

Greetings,
   Arjan van de Ven

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Mar 15 2000 - 21:00:30 EST