I've uploaded the attached changes to DELAYED/5, and will follow this
with an upload of dahdi-firmware.

The deleted files are noted in the debdiff as just '[deleted]'.

Ben.

-- 
Ben Hutchings
Experience is what causes a person to make new mistakes instead of old ones.
diff -Nru dahdi-linux-2.6.1+dfsg/debian/changelog dahdi-linux-2.6.1+dfsg2/debian/changelog
--- dahdi-linux-2.6.1+dfsg/debian/changelog	2012-04-23 11:26:35.000000000 +0100
+++ dahdi-linux-2.6.1+dfsg2/debian/changelog	2013-01-27 16:13:02.000000000 +0000
@@ -1,3 +1,11 @@
+dahdi-linux (1:2.6.1+dfsg2-0.1) unstable; urgency=low
+
+  * Non-maintainer upload
+  * Remove non-free FPGA bitfiles and patch drivers to load them
+    (Closes: #693666)
+
+ -- Ben Hutchings <b...@decadent.org.uk>  Sun, 27 Jan 2013 16:13:02 +0000
+
 dahdi-linux (1:2.6.1+dfsg-1) unstable; urgency=low
 
   * New upstream release candidate:
diff -Nru dahdi-linux-2.6.1+dfsg/debian/patches/pciradio-request_firmware dahdi-linux-2.6.1+dfsg2/debian/patches/pciradio-request_firmware
--- dahdi-linux-2.6.1+dfsg/debian/patches/pciradio-request_firmware	1970-01-01 01:00:00.000000000 +0100
+++ dahdi-linux-2.6.1+dfsg2/debian/patches/pciradio-request_firmware	2013-01-27 16:07:00.000000000 +0000
@@ -0,0 +1,135 @@
+Author: Ben Hutchings <b...@decadent.org.uk>
+Description: pciradio: Use request_firmware() to load bitfile
+Bug-Debian: http://bugs.debian.org/693666
+
+Non-free bits belong in separate (source & binary) packages.
+This driver must use request_firmware() to load the FPGA bitfile.
+
+---
+--- a/drivers/dahdi/pciradio.c
++++ b/drivers/dahdi/pciradio.c
+@@ -51,6 +51,7 @@ With driver:	303826  (1.5 %)
+ #include <linux/interrupt.h>
+ #include <linux/moduleparam.h>
+ #include <linux/sched.h>
++#include <linux/firmware.h>
+ #include <asm/io.h>
+ #include <asm/delay.h> 
+ 
+@@ -220,8 +221,6 @@ struct tonedef {
+ 	unsigned char b2;
+ } ;
+ 
+-#include "radfw.h"
+-
+ static struct tonedef cttable_tx [] = {
+ {0,0,0},
+ {670,0xE,0xB1},
+@@ -1505,9 +1504,18 @@ static void wait_just_a_bit(int foo)
+ 
+ static int pciradio_hardware_init(struct pciradio *rad)
+ {
++const struct firmware *bitfile;
+ unsigned char byte1,byte2;
+ int	x;
+ unsigned long endjif;
++int res;
++
++	res = request_firmware(&bitfile, "dahdi-fw-pciradio.bin",
++			       &rad->dev->dev);
++	if (res)
++		return res;
++
++	res = -EIO;
+ 
+ 	/* Signal Reset */
+ 	outb(0x01, rad->ioaddr + RAD_CNTL);
+@@ -1539,7 +1547,7 @@ unsigned long endjif;
+ 	while (inb(rad->ioaddr + RAD_AUXR) & (XINIT | XDONE) && (jiffies <= endjif));
+ 	if (endjif < jiffies) {
+ 		printk(KERN_DEBUG "Timeout waiting for INIT and DONE to go low\n");
+-		return -1;
++		goto out;
+ 	}
+ 	if (debug) printk(KERN_DEBUG "fwload: Init and done gone to low\n");
+ 	/* De-assert PGM */
+@@ -1550,16 +1558,16 @@ unsigned long endjif;
+ 	while (!(inb(rad->ioaddr + RAD_AUXR) & XINIT) && (jiffies <= endjif));
+ 	if (endjif < jiffies) {
+ 		printk(KERN_DEBUG "Timeout waiting for INIT to go high\n");
+-		return -1;
++		goto out;
+ 	}
+ 	if (debug) printk(KERN_DEBUG "fwload: Init went high (clearing done)\nNow loading...\n");
+ 	/* Assert CS+Write */
+ 	rad->ios &= ~XCS;
+ 	outb(rad->ios, rad->ioaddr + RAD_AUXD);
+-	for (x = 0; x < sizeof(radfw); x++)
++	for (x = 0; x < bitfile->size; x++)
+ 	   {
+ 		  /* write the byte */
+-		outb(radfw[x],rad->ioaddr + RAD_REGBASE);
++		outb(bitfile->data[x], rad->ioaddr + RAD_REGBASE);
+ 		  /* if DONE signal, we're done, exit */
+ 		if (inb(rad->ioaddr + RAD_AUXR) & XDONE) break;
+ 		  /* if INIT drops, we're screwed, exit */
+@@ -1580,12 +1588,12 @@ unsigned long endjif;
+ 	if (!(inb(rad->ioaddr + RAD_AUXR) & XINIT))
+ 	   {
+ 		printk(KERN_NOTICE "Drove Init low!! CRC Error!!!\n");
+-		return -1;
++		goto out;
+ 	   }
+ 	if (!(inb(rad->ioaddr + RAD_AUXR) & XDONE))
+ 	   {
+ 		printk(KERN_INFO "Did not get DONE signal. Short file maybe??\n");
+-		return -1;
++		goto out;
+ 	   }
+ 	wait_just_a_bit(2);
+ 	/* get the thingy started */
+@@ -1646,7 +1654,10 @@ unsigned long endjif;
+ 	/* Wait 1/4 of a sec */
+ 	wait_just_a_bit(HZ/4);
+ 
+-	return 0;
++	res = 0;
++out:
++	release_firmware(bitfile);
++	return res;
+ }
+ 
+ static void pciradio_enable_interrupts(struct pciradio *rad)
+@@ -1765,7 +1776,8 @@ static int __devinit pciradio_init_one(s
+ 			/* Keep track of which device we are */
+ 			pci_set_drvdata(pdev, rad);
+ 
+-			if (pciradio_hardware_init(rad)) {
++			res = pciradio_hardware_init(rad);
++			if (res) {
+ 				/* Set Reset Low */
+ 				x=inb(rad->ioaddr + RAD_CNTL);
+ 				outb((~0x1)&x, rad->ioaddr + RAD_CNTL);
+@@ -1780,7 +1792,7 @@ static int __devinit pciradio_init_one(s
+ 				pci_set_drvdata(pdev, NULL);
+ 				dahdi_free_device(rad->ddev);
+ 				kfree(rad);
+-				return -EIO;
++				return res;
+ 
+ 			}
+ 
+--- a/drivers/dahdi/Kbuild
++++ b/drivers/dahdi/Kbuild
+@@ -141,11 +141,4 @@ ifeq ($(HPEC_PRESENT),yes)
+ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_HPEC)	+= dahdi_echocan_hpec.o
+ endif
+ 
+-$(obj)/pciradio.o: $(obj)/radfw.h
+-
+ hostprogs-y := makefw
+-
+-$(obj)/radfw.h: $(src)/pciradio.rbt $(obj)/makefw
+-	$(obj)/makefw $< radfw > $@
+-
+-clean-files	:= radfw.h
diff -Nru dahdi-linux-2.6.1+dfsg/debian/patches/series dahdi-linux-2.6.1+dfsg2/debian/patches/series
--- dahdi-linux-2.6.1+dfsg/debian/patches/series	2012-04-23 10:32:49.000000000 +0100
+++ dahdi-linux-2.6.1+dfsg2/debian/patches/series	2013-01-27 15:34:45.000000000 +0000
@@ -3,3 +3,5 @@
 no_firmware_download
 chanmute
 notest
+tor2-request_firmware
+pciradio-request_firmware
diff -Nru dahdi-linux-2.6.1+dfsg/debian/patches/tor2-request_firmware dahdi-linux-2.6.1+dfsg2/debian/patches/tor2-request_firmware
--- dahdi-linux-2.6.1+dfsg/debian/patches/tor2-request_firmware	1970-01-01 01:00:00.000000000 +0100
+++ dahdi-linux-2.6.1+dfsg2/debian/patches/tor2-request_firmware	2013-01-27 16:05:48.000000000 +0000
@@ -0,0 +1,87 @@
+Author: Ben Hutchings <b...@decadent.org.uk>
+Description: tor2: Use request_firmware() to load bitfile
+Bug-Debian: http://bugs.debian.org/693666
+
+Non-free bits belong in separate (source & binary) packages.
+This driver must use request_firmware() to load the FPGA bitfile.
+
+---
+--- a/drivers/dahdi/tor2.c
++++ b/drivers/dahdi/tor2.c
+@@ -31,11 +31,11 @@
+ #include <linux/sched.h>
+ #include <linux/interrupt.h>
+ #include <linux/moduleparam.h>
++#include <linux/firmware.h>
+ 
+ #include <dahdi/kernel.h>
+ #define NEED_PCI_IDS
+ #include "tor2-hw.h"
+-#include "tor2fw.h"
+ 
+ /*
+  * Tasklets provide better system interactive response at the cost of the
+@@ -379,6 +379,7 @@ static int __devinit tor2_probe(struct p
+ 	unsigned long endjif;
+ 	__iomem volatile unsigned long *gpdata_io, *lasdata_io;
+ 	unsigned long gpdata,lasdata;
++	const struct firmware *bitfile;
+ 
+ 	res = pci_enable_device(pdev);
+ 	if (res)
+@@ -439,6 +440,11 @@ static int __devinit tor2_probe(struct p
+ 		       tor->xilinx8_len, tor->xilinx8_region);
+ 		goto err_out_release_plx_region;
+ 	}
++	res = request_firmware(&bitfile, "dahdi-fw-tor2.bin", &pdev->dev);
++	if (res) {
++		ret = res;
++		goto err_out_release_all_regions;
++	}
+ 	pci_set_drvdata(pdev, tor);
+ 	printk(KERN_INFO "Detected %s at 0x%lx/0x%lx irq %d\n", tor->type, 
+ 		tor->xilinx32_region, tor->xilinx8_region,tor->irq);
+@@ -490,10 +496,10 @@ static int __devinit tor2_probe(struct p
+ 	/* assert WRITE signal */
+ 	gpdata &= ~GPIO_WRITE;
+ 	writel(gpdata, gpdata_io);
+-	for (x = 0; x < sizeof(tor2fw); x++)
++	for (x = 0; x < bitfile->size; x++)
+ 	   {
+ 		  /* write the byte */
+-		writeb(tor2fw[x], tor->mem8);
++		writeb(bitfile->data[x], tor->mem8);
+ 		  /* if DONE signal, we're done, exit */
+ 		if (readl(gpdata_io) & GPIO_DONE)
+ 			break;
+@@ -612,9 +618,12 @@ static int __devinit tor2_probe(struct p
+ 			break;
+ 	}
+ 
++	release_firmware(bitfile);
+ 	return 0;
+ 
+ err_out_release_all:
++	release_firmware(bitfile);
++err_out_release_all_regions:
+ 	release_mem_region(tor->xilinx32_region, tor->xilinx32_len);
+ 	release_mem_region(tor->xilinx8_region, tor->xilinx8_len);
+ err_out_release_plx_region:
+--- a/drivers/dahdi/Kbuild
++++ b/drivers/dahdi/Kbuild
+@@ -142,14 +142,10 @@ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECH
+ endif
+ 
+ $(obj)/pciradio.o: $(obj)/radfw.h
+-$(obj)/tor2.o: $(obj)/tor2fw.h
+ 
+ hostprogs-y := makefw
+ 
+-$(obj)/tor2fw.h: $(src)/tormenta2.rbt $(obj)/makefw 
+-	$(obj)/makefw $< tor2fw > $@
+-
+ $(obj)/radfw.h: $(src)/pciradio.rbt $(obj)/makefw
+ 	$(obj)/makefw $< radfw > $@
+ 
+-clean-files	:= radfw.h tor2fw.h
++clean-files	:= radfw.h
diff -Nru dahdi-linux-2.6.1+dfsg/debian/rules dahdi-linux-2.6.1+dfsg2/debian/rules
--- dahdi-linux-2.6.1+dfsg/debian/rules	2012-04-23 10:32:49.000000000 +0100
+++ dahdi-linux-2.6.1+dfsg2/debian/rules	2013-01-27 15:13:03.000000000 +0000
@@ -25,7 +25,7 @@
 DEBVERSION:=$(shell head -n 1 debian/changelog \
 		    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
 DEB_BASE_VERSION:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9~.a-z]*$$//')
-UPVERSION:=$(shell echo $(DEB_BASE_VERSION) | sed -e 's/[~+]dfsg\(~\|$$\)/\1/' -e 's/~\(rc\|beta\)/-\1/')
+UPVERSION:=$(shell echo $(DEB_BASE_VERSION) | sed -e 's/[~+]dfsg[0-9]*\(~\|$$\)/\1/' -e 's/~\(rc\|beta\)/-\1/')
 
 UPFILENAME := $(PACKAGE_SRC)_$(UPVERSION).orig.tar.gz
 FILENAME := $(PACKAGE_SRC)_$(DEB_BASE_VERSION).orig.tar.gz
@@ -117,6 +117,7 @@
 	@@cd $(TARBALL_DIR) ; \
 	tar xfz ../$(UPFILENAME)
 	@@rm -rf $(TARBALL_DIR)/$(PACKAGE_SRC)-$(UPVERSION)/drivers/dahdi/xpp/firmwares/*.hex
+	@@rm -f $(TARBALL_DIR)/$(PACKAGE_SRC)-$(UPVERSION)/drivers/dahdi/*.rbt
 	@@cd $(TARBALL_DIR) ; \
 	tar cfz ../$(FILENAME) *
 	@@echo Cleaning up...
diff -Nru dahdi-linux-2.6.1+dfsg/drivers/dahdi/pciradio.rbt dahdi-linux-2.6.1+dfsg2/drivers/dahdi/pciradio.rbt
--- dahdi-linux-2.6.1+dfsg/drivers/dahdi/pciradio.rbt	2008-05-21 16:11:48.000000000 +0100
+++ dahdi-linux-2.6.1+dfsg2/drivers/dahdi/pciradio.rbt	1970-01-01 01:00:00.000000000 +0100
[deleted]
diff -Nru dahdi-linux-2.6.1+dfsg/drivers/dahdi/tormenta2.rbt dahdi-linux-2.6.1+dfsg2/drivers/dahdi/tormenta2.rbt
--- dahdi-linux-2.6.1+dfsg/drivers/dahdi/tormenta2.rbt	2008-05-21 16:11:48.000000000 +0100
+++ dahdi-linux-2.6.1+dfsg2/drivers/dahdi/tormenta2.rbt	1970-01-01 01:00:00.000000000 +0100
[deleted]

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to