summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2008-06-17 22:48:27 +0000
committerKevin P. Fleming <kpfleming@digium.com>2008-06-17 22:48:27 +0000
commit04bb1a509c1ac1d680ba1bf458822d0277b1af52 (patch)
tree37217a8b3be4016856267099b16d1bd5a529da87
parent82750add3d81c7e8b66fb314f4bd8d722015ed6c (diff)
another batch of fixes for non-hotplug firmware handling
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4385 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/Kbuild4
-rw-r--r--drivers/dahdi/firmware/Makefile60
-rw-r--r--drivers/dahdi/wctdm24xxp/base.c2
3 files changed, 18 insertions, 48 deletions
diff --git a/drivers/dahdi/Kbuild b/drivers/dahdi/Kbuild
index 106b8fd..329899e 100644
--- a/drivers/dahdi/Kbuild
+++ b/drivers/dahdi/Kbuild
@@ -30,8 +30,10 @@ EXTRA_CFLAGS += $(ECHO_CAN_CFLAGS)
ifndef HOTPLUG_FIRMWARE
ifneq (,$(filter y m,$(CONFIG_FW_LOADER)))
HOTPLUG_FIRMWARE := yes
-export HOTPLUG_FIRMWARE
+else
+HOTPLUG_FIRMWARE := no
endif
+export HOTPLUG_FIRMWARE
endif
# fix typo present in CentOS and RHEL 2.6.9 kernels
diff --git a/drivers/dahdi/firmware/Makefile b/drivers/dahdi/firmware/Makefile
index e8b7938..e957371 100644
--- a/drivers/dahdi/firmware/Makefile
+++ b/drivers/dahdi/firmware/Makefile
@@ -42,6 +42,10 @@ OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-OCT6114-128=dahdi-fw-oct6114-128.o)
OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-TC400M=dahdi-fw-tc400m.o)
OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-VPMADT032=dahdi-fw-vpmadt032.o)
+# Force usage of wget, for now
+DOWNLOAD=wget
+WGET=wget
+
# If "fetch" is used, --continue is not a valid option.
ifeq ($(WGET),wget)
WGET_ARGS:=--continue
@@ -49,51 +53,6 @@ endif
all: $(FIRMWARE)
-have_download:
- @if test "$(DOWNLOAD)" = ":" ; then \
- echo "**************************************************"; \
- echo "*** ***"; \
- echo "*** You must have either wget or fetch to be ***"; \
- echo "*** able to automatically download and install ***"; \
- echo "*** the requested firmware packages. ***"; \
- echo "*** ***"; \
- echo "**************************************************"; \
- exit 1; \
- fi
-
-# Download and extract firmware tarballs
-dahdi-fw-oct6114-064-%.tar.gz: have_download
-ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
- @echo "Attempting to download $@"
- @if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
- @if test ! -f $@; then exit 1; fi; \
- (cat $@ | gzip -d | tar -xf -)
-endif
-
-dahdi-fw-oct6114-128-%.tar.gz: have_download
-ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-128-$(OCT6114_128_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-128-$(OCT6114_128_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
- @echo "Attempting to download $@"
- @if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
- @if test ! -f $@; then exit 1; fi; \
- (cat $@ | gzip -d | tar -xf -)
-endif
-
-dahdi-fw-tc400m-%.tar.gz: have_download
-ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-tc400m-$(TC400M_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-tc400m-$(TC400M_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
- @echo "Attempting to download $@"
- @if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
- @if test ! -f $@; then exit 1; fi; \
- (cat $@ | gzip -d | tar -xf -)
-endif
-
-dahdi-fw-vpmadt032-%.tar.gz: have_download
-ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-vpmadt032-$(VPMADT032_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-vpmadt032-$(VPMADT032_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
- @echo "Attempting to download $@"
- @if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
- @if test ! -f $@; then exit 1; fi; \
- (cat $@ | gzip -d | tar -xf -)
-endif
-
# Clean up any downloaded/extracted firmware packages
dist-clean: clean
rm -f dahdi-fw-*.bin
@@ -104,10 +63,19 @@ dist-clean: clean
clean:
rm -f dahdi-fw-*.o
+# Download and extract firmware tarballs
+dahdi-fw-oct6114-064-%.tar.gz dahdi-fw-oct6114-128-%.tar.gz dahdi-fw-tc400m-%.tar.gz dahdi-fw-vpmadt032-%.tar.gz:
+ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.$(subst .tar.gz,,$*) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.$(subst .tar.gz,,$*) ] ); then echo "yes"; else echo "no"; fi),yes)
+ @echo "Attempting to download $@"
+ @if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
+ @if test ! -f $@; then exit 1; fi; \
+ (cat $@ | gzip -d | tar -xf -)
+endif
+
# Create object files suitable for linking against
object-build: $(FIRMWARE) $(OBJECT_FILES)
-# Install all downloaded firmware images for hotplug usage and build headers for inclusion
+# Install all downloaded firmware images for hotplug usage
hotplug-install: $(FIRMWARE)
ifeq ($(HOTPLUG_FIRMWARE),yes)
ifeq ($(shell if ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index dcf22b4..d5bbb7e 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -3287,7 +3287,6 @@ static enum vpmadt032_init_result wctdm_vpm150m_init(struct wctdm *wc)
struct vpm150m *vpm150m;
unsigned short reg;
unsigned long flags;
- struct pci_dev* pdev = voicebus_get_pci_dev(wc->vb);
enum vpmadt032_init_result res = VPMADT032_FAILED;
#ifdef VPM150M_SUPPORT
@@ -3299,6 +3298,7 @@ static enum vpmadt032_init_result wctdm_vpm150m_init(struct wctdm *wc)
extern u8 _binary_dahdi_fw_vpmadt032_bin_start[];
#else
static const char vpmadt032_firmware[] = "dahdi-fw-vpmadt032.bin";
+ struct pci_dev *pdev = voicebus_get_pci_dev(wc->vb);
#endif
gpakDownloadStatus_t downloadstatus;
gpakPingDspStat_t pingstatus;