summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benesch <twoof7@freenet.de>2009-12-18 20:18:10 (GMT)
committerMatthias Benesch <twoof7@freenet.de>2009-12-18 20:18:10 (GMT)
commit599744408a850c5643b007729cd4b1c429e7f0cd (patch)
tree0f3d48c4bebd281aa24158ddf4cb20bb59a772da
parent2db1572222bc386574689e4eeb53a6e5e41f036d (diff)
downloadmediapointer-dvb-s2-599744408a850c5643b007729cd4b1c429e7f0cd.tar.gz
mediapointer-dvb-s2-599744408a850c5643b007729cd4b1c429e7f0cd.tar.bz2
ngene: Enabled loading firmware from file.
From: Matthias Benesch <twoof7@freenet.de> Changes within method ngene_load_firm to avoid compiler errors. Removed firmware debugging, because setting ngene_fw_debug and requesting firmware from file causes a kernel oops. Priority: normal
-rw-r--r--linux/drivers/media/video/ngene/ngene-core.c45
1 files changed, 29 insertions, 16 deletions
diff --git a/linux/drivers/media/video/ngene/ngene-core.c b/linux/drivers/media/video/ngene/ngene-core.c
index 7c9a9af..3b2a186 100644
--- a/linux/drivers/media/video/ngene/ngene-core.c
+++ b/linux/drivers/media/video/ngene/ngene-core.c
@@ -74,9 +74,11 @@ static int copy_eeprom = 0;
module_param(copy_eeprom, int, 0444);
MODULE_PARM_DESC(copy_eeprom, "Copy eeprom.");
+/*
static int ngene_fw_debug = 0;
module_param(ngene_fw_debug, int, 0444);
MODULE_PARM_DESC(ngene_fw_debug, "Debug firmware.");
+*/
static int debug = 0;
module_param(debug, int, 0444);
@@ -483,7 +485,8 @@ static int ngene_command_load_firmware(struct ngene *dev,
cleft-FIRSTCHUNK);
cleft=FIRSTCHUNK;
}
- ngene_fw[FW_DEBUG_DEFAULT-PROGRAM_SRAM]=ngene_fw_debug;
+ /* crashes when loading firmware from file */
+ /* ngene_fw[FW_DEBUG_DEFAULT-PROGRAM_SRAM]=ngene_fw_debug; */
ngcpyto(DATA_FIFO_AREA, ngene_fw, cleft);
memset(&com, 0, sizeof(struct ngene_command));
@@ -2915,10 +2918,10 @@ static int ngene_load_firm(struct ngene *dev)
version=dev->card_info->fw_version;
+#ifdef FW_INC
switch (version) {
default:
case 15:
- version=15;
ngene_fw=FW15;
size=sizeof(FW15);
fw_name="ngene_15.fw";
@@ -2934,33 +2937,43 @@ static int ngene_load_firm(struct ngene *dev)
fw_name="ngene_17.fw";
break;
}
-#ifdef FW_INC
+
if (load_firmware &&
request_firmware(&fw, fw_name, &dev->pci_dev->dev)>=0) {
printk(DEVICE_NAME ": Loading firmware file %s.\n", fw_name);
size=fw->size;
ngene_fw=(u8 *)fw->data;
- } else
- printk(DEVICE_NAME ": Loading built-in firmware version %d.\n",
- version);
- err=ngene_command_load_firmware(dev, ngene_fw, size);
-
- if (fw)
- release_firmware(fw);
+ } else {
+ printk(DEVICE_NAME ": Loading built-in firmware version %d.\n", version);
+ }
#else
+ switch (dev->card_info->fw_version) {
+ default:
+ case 15:
+ fw_name = "ngene_15.fw";
+ break;
+ case 16:
+ fw_name = "ngene_16.fw";
+ break;
+ case 17:
+ fw_name = "ngene_17.fw";
+ break;
+ }
if (request_firmware(&fw, fw_name, &dev->pci_dev->dev)<0) {
- printk(DEVICE_NAME ": Could not load firmware file %s. \n",
- fw_name);
- printk(DEVICE_NAME
- ": Copy %s to your hotplug directory!\n", fw_name);
+ printk(DEVICE_NAME ": Could not load firmware file %s. \n", fw_name);
+ printk(DEVICE_NAME ": Copy %s to your hotplug directory!\n", fw_name);
return -1;
}
printk(DEVICE_NAME ": Loading firmware file %s.\n", fw_name);
size=fw->size;
ngene_fw=(u8 *)fw->data;
- err=ngene_command_load_firmware(dev, ngene_fw, size);
- release_firmware(fw);
#endif
+
+ err=ngene_command_load_firmware(dev, ngene_fw, size);
+
+ if (fw)
+ release_firmware(fw);
+
return err;
}