Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6593097586 | ||
|
|
e62f0f1835 | ||
|
|
e4fce6849a | ||
|
|
bc0c04fb13 | ||
|
|
45b4937a35 | ||
|
|
50f2fd15b6 | ||
|
|
665bf9feb6 | ||
|
|
b817c7625a | ||
|
|
6cebc1c1fb | ||
|
|
7ce8498465 | ||
|
|
d4868092bf | ||
|
|
06c45b7cd8 |
23
build_tools/install_firmware
Executable file
23
build_tools/install_firmware
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# This is a helper script intended to be called from
|
||||
# drivers/dahdi/firmware/Makefile to install the different firmware version.
|
||||
|
||||
FIRMWARE_PATTERN=$1
|
||||
FIRMWARE_VERSION=$2
|
||||
DESTDIR=$3
|
||||
|
||||
if ! test -f ${DESTDIR}/usr/lib/hotplug/firmware/.${FIRMWARE_PATTERN}-${FIRMWARE_VERSION} || ! test -f ${DESTDIR}/lib/firmware/.${FIRMWARE_PATTERN}-${FIRMWARE_VERSION}; then
|
||||
echo "Installing ${FIRMWARE_PATTERN}.bin to hotplug firmware directories"
|
||||
tar --no-same-owner -xf ${FIRMWARE_PATTERN}-${FIRMWARE_VERSION}.tar.gz || exit 1
|
||||
install -m 644 ${FIRMWARE_PATTERN}.bin ${DESTDIR}/usr/lib/hotplug/firmware || exit 1
|
||||
rm -rf ${DESTDIR}/usr/lib/hotplug/firmware/.${FIRMWARE_PATTERN}-*
|
||||
touch ${DESTDIR}/usr/lib/hotplug/firmware/.${FIRMWARE_PATTERN}-${FIRMWARE_VERSION}
|
||||
install -m 644 ${FIRMWARE_PATTERN}.bin ${DESTDIR}/lib/firmware || exit 1
|
||||
rm -rf ${DESTDIR}/lib/firmware/.${FIRMWARE_PATTERN}-*
|
||||
touch ${DESTDIR}/lib/firmware/.${FIRMWARE_PATTERN}-${FIRMWARE_VERSION}
|
||||
# Remove the .bin file so that if the version is reverted, it will not
|
||||
# be installed with a non-matching ${FIRMARE_VERSION} file.
|
||||
rm ${FIRMWARE_PATTERN}.bin
|
||||
else
|
||||
echo "Firmware ${FIRMWARE_PATTERN}.bin is already installed with required version ${FIRMWARE_VERSION}"
|
||||
fi
|
||||
@@ -7374,10 +7374,18 @@ int dahdi_assign_device_spans(struct dahdi_device *ddev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int auto_assign_spans = 1;
|
||||
EXPORT_SYMBOL(auto_assign_spans);
|
||||
static int auto_assign_spans = 1;
|
||||
static const char *UNKNOWN = "";
|
||||
|
||||
/**
|
||||
* dahdi_auto_assign_spans - is the parameter auto_assign_spans set?
|
||||
*/
|
||||
int dahdi_get_auto_assign_spans(void)
|
||||
{
|
||||
return auto_assign_spans;
|
||||
}
|
||||
EXPORT_SYMBOL(dahdi_get_auto_assign_spans);
|
||||
|
||||
/**
|
||||
* _dahdi_register_device - Registers a DAHDI device and assign its spans.
|
||||
* @ddev: the DAHDI device
|
||||
|
||||
@@ -31,13 +31,13 @@ VPMADT032_VERSION:=1.25.0
|
||||
HX8_VERSION:=2.06
|
||||
VPMOCT032_VERSION:=1.12.0
|
||||
WCT820_VERSION:=1.76
|
||||
TE133_VERSION:=780017
|
||||
TE133_VERSION:=780019
|
||||
TE134_VERSION:=780017
|
||||
TE435_VERSION:=e0017
|
||||
TE435_VERSION:=e0019
|
||||
A8A_VERSION:=1d0017
|
||||
A8B_VERSION:=1d0017
|
||||
A8B_VERSION:=1d0019
|
||||
A4A_VERSION:=a0017
|
||||
A4B_VERSION:=b0017
|
||||
A4B_VERSION:=b0019
|
||||
|
||||
FIRMWARE_URL:=http://downloads.digium.com/pub/telephony/firmware/releases
|
||||
|
||||
@@ -82,6 +82,7 @@ OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-VPMOCT032=dahdi-fw-vpmoct032.o)
|
||||
# Force usage of wget, for now
|
||||
DOWNLOAD=wget
|
||||
WGET=wget
|
||||
INSTALL_FIRMWARE=../../../build_tools/install_firmware
|
||||
|
||||
# If "fetch" is used, --continue is not a valid option.
|
||||
ifeq ($(WGET),wget)
|
||||
@@ -107,7 +108,6 @@ dahdi-fw-%.tar.gz:
|
||||
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 --no-same-owner -xf -) \
|
||||
fi
|
||||
|
||||
firmware-loaders: $(FWLOADERS)
|
||||
@@ -126,172 +126,21 @@ $(DESTDIR)/usr/lib/hotplug/firmware $(DESTDIR)/lib/firmware:
|
||||
|
||||
# Install all downloaded firmware images for hotplug usage
|
||||
hotplug-install: $(DESTDIR)/usr/lib/hotplug/firmware $(DESTDIR)/lib/firmware $(FIRMWARE)
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-032-$(OCT6114_032_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-032-$(OCT6114_032_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-oct6114-032.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-oct6114-032.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-032-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-032-$(OCT6114_032_VERSION)
|
||||
@install -m 644 dahdi-fw-oct6114-032.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-032-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-032-$(OCT6114_032_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-oct6114-032.bin is already installed with required version $(OCT6114_032_VERSION)"
|
||||
endif
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-oct6114-064.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-oct6114-064.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-064-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION)
|
||||
@install -m 644 dahdi-fw-oct6114-064.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-064-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-oct6114-064.bin is already installed with required version $(OCT6114_064_VERSION)"
|
||||
endif
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-128-$(OCT6114_128_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-128-$(OCT6114_128_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-oct6114-128.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-oct6114-128.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-128-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-128-$(OCT6114_128_VERSION)
|
||||
@install -m 644 dahdi-fw-oct6114-128.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-128-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-128-$(OCT6114_128_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-oct6114-128.bin is already installed with required version $(OCT6114_128_VERSION)"
|
||||
endif
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-256-$(OCT6114_256_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-256-$(OCT6114_256_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-oct6114-256.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-oct6114-256.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-256-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-256-$(OCT6114_256_VERSION)
|
||||
@install -m 644 dahdi-fw-oct6114-256.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-256-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-256-$(OCT6114_256_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-oct6114-256.bin is already installed with required version $(OCT6114_256_VERSION)"
|
||||
endif
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-tc400m-$(TC400M_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-tc400m-$(TC400M_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-tc400m.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-tc400m.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-tc400m-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-tc400m-$(TC400M_VERSION)
|
||||
@install -m 644 dahdi-fw-tc400m.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-tc400m-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-tc400m-$(TC400M_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-tc400m.bin is already installed with required version $(TC400M_VERSION)"
|
||||
endif
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-hx8-$(HX8_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-hx8-$(HX8_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-hx8.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-hx8.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-hx8-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-hx8-$(HX8_VERSION)
|
||||
@install -m 644 dahdi-fw-hx8.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-hx8-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-hx8-$(HX8_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-hx8.bin is already installed with required version $(HX8_VERSION)"
|
||||
endif
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-vpmoct032-$(VPMOCT032_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-vpmoct032-$(VPMOCT032_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-vpmoct032.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-vpmoct032.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-vpmoct032-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-vpmoct032-$(VPMOCT032_VERSION)
|
||||
@install -m 644 dahdi-fw-vpmoct032.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-vpmoct032-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-vpmoct032-$(VPMOCT032_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-vpmoct032.bin is already installed with required version $(VPMOCT032_VERSION)"
|
||||
endif
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-te820-$(WCT820_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-te820-$(WCT820_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-te820.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-te820.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-te820-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-te820-$(WCT820_VERSION)
|
||||
@install -m 644 dahdi-fw-te820.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-te820-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-te820-$(WCT820_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-te820.bin is already installed with required version $(WCT820_VERSION)"
|
||||
endif
|
||||
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-te133-$(TE133_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-te133-$(TE133_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-te133.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-te133.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-te133-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-te133-$(TE133_VERSION)
|
||||
@install -m 644 dahdi-fw-te133.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-te133-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-te133-$(TE133_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-te133.bin is already installed with required version $(TE133_VERSION)"
|
||||
endif
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-te134-$(TE134_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-te134-$(TE134_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-te134.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-te134.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-te134-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-te134-$(TE134_VERSION)
|
||||
@install -m 644 dahdi-fw-te134.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-te134-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-te134-$(TE134_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-te134.bin is already installed with required version $(TE134_VERSION)"
|
||||
endif
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-te435-$(TE435_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-te435-$(TE435_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-te435.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-te435.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-te435-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-te435-$(TE435_VERSION)
|
||||
@install -m 644 dahdi-fw-te435.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-te435-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-te435-$(TE435_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-te435.bin is already installed with required version $(TE435_VERSION)"
|
||||
endif
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-a8a-$(A8A_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-a8a-$(A8A_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-a8a.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-a8a.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-a8a-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-a8a-$(A8A_VERSION)
|
||||
@install -m 644 dahdi-fw-a8a.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-a8a-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-a8a-$(A8A_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-a8a.bin is already installed with required version $(A8A_VERSION)"
|
||||
endif
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-a8b-$(A8B_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-a8b-$(A8B_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-a8b.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-a8b.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-a8b-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-a8b-$(A8B_VERSION)
|
||||
@install -m 644 dahdi-fw-a8b.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-a8b-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-a8b-$(A8B_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-a8b.bin is already installed with required version $(A8B_VERSION)"
|
||||
endif
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-a4a-$(A4A_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-a4a-$(A4A_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-a4a.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-a4a.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-a4a-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-a4a-$(A4A_VERSION)
|
||||
@install -m 644 dahdi-fw-a4a.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-a4a-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-a4a-$(A4A_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-a4a.bin is already installed with required version $(A4A_VERSION)"
|
||||
endif
|
||||
ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-a4b-$(A4B_VERSION) ] ) && ( [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-a4b-$(A4B_VERSION) ] ); then echo "no"; else echo "yes"; fi),yes)
|
||||
@echo "Installing dahdi-fw-a4b.bin to hotplug firmware directories"
|
||||
@install -m 644 dahdi-fw-a4b.bin $(DESTDIR)/usr/lib/hotplug/firmware
|
||||
@rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-a4b-*
|
||||
@touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-a4b-$(A4B_VERSION)
|
||||
@install -m 645 dahdi-fw-a4b.bin $(DESTDIR)/lib/firmware
|
||||
@rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-a4b-*
|
||||
@touch $(DESTDIR)/lib/firmware/.dahdi-fw-a4b-$(A4B_VERSION)
|
||||
else
|
||||
@echo "Firmware dahdi-fw-a4b.bin is already installed with required version $(A4B_VERSION)"
|
||||
endif
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-oct6114-032 $(OCT6114_032_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-oct6114-064 $(OCT6114_064_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-oct6114-128 $(OCT6114_128_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-oct6114-256 $(OCT6114_256_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-tc400m $(TC400M_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-hx8 $(HX8_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-vpmoct032 $(VPMOCT032_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-te820 $(WCT820_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-te133 $(TE133_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-te134 $(TE134_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-te435 $(TE435_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-a8a $(A8A_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-a8b $(A8B_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-a4a $(A4A_VERSION)
|
||||
@$(INSTALL_FIRMWARE) dahdi-fw-a4b $(A4B_VERSION)
|
||||
|
||||
# Uninstall any installed dahdi firmware images from hotplug firmware directories
|
||||
hotplug-uninstall:
|
||||
|
||||
@@ -3886,9 +3886,9 @@ static int wcaxx_check_firmware(struct wcaxx *wc)
|
||||
u32 firmware_version;
|
||||
const bool force_firmware = false;
|
||||
const unsigned int A4A_VERSION = 0x0a0017;
|
||||
const unsigned int A4B_VERSION = 0x0b0017;
|
||||
const unsigned int A4B_VERSION = 0x0b0019;
|
||||
const unsigned int A8A_VERSION = 0x1d0017;
|
||||
const unsigned int A8B_VERSION = 0x1d0017;
|
||||
const unsigned int A8B_VERSION = 0x1d0019;
|
||||
|
||||
if (wc->desc == &device_a8a) {
|
||||
firmware_version = A8A_VERSION;
|
||||
|
||||
@@ -45,7 +45,8 @@
|
||||
|
||||
static const char *TE133_FW_FILENAME = "dahdi-fw-te133.bin";
|
||||
static const char *TE134_FW_FILENAME = "dahdi-fw-te134.bin";
|
||||
static const u32 TE13X_FW_VERSION = 0x780017;
|
||||
static const u32 TE133_FW_VERSION = 0x780019;
|
||||
static const u32 TE134_FW_VERSION = 0x780017;
|
||||
|
||||
#define WC_MAX_IFACES 8
|
||||
|
||||
@@ -2434,12 +2435,16 @@ error_exit:
|
||||
static int te13xp_check_firmware(struct t13x *wc)
|
||||
{
|
||||
const char *filename;
|
||||
u32 expected_version;
|
||||
enum wcxb_reset_option reset;
|
||||
|
||||
if (is_pcie(wc))
|
||||
if (is_pcie(wc)) {
|
||||
filename = TE133_FW_FILENAME;
|
||||
else
|
||||
expected_version = TE133_FW_VERSION;
|
||||
} else {
|
||||
filename = TE134_FW_FILENAME;
|
||||
expected_version = TE134_FW_VERSION;
|
||||
}
|
||||
|
||||
/* Specific firmware requires power cycle to properly reset */
|
||||
if (0x6f0017 == wcxb_get_firmware_version(&wc->xb))
|
||||
@@ -2447,7 +2452,7 @@ static int te13xp_check_firmware(struct t13x *wc)
|
||||
else
|
||||
reset = WCXB_RESET_NOW;
|
||||
|
||||
return wcxb_check_firmware(&wc->xb, TE13X_FW_VERSION, filename,
|
||||
return wcxb_check_firmware(&wc->xb, expected_version, filename,
|
||||
force_firmware, reset);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "wcxb_flash.h"
|
||||
|
||||
static const char *TE435_FW_FILENAME = "dahdi-fw-te435.bin";
|
||||
static const u32 TE435_VERSION = 0xe0017;
|
||||
static const u32 TE435_VERSION = 0xe0019;
|
||||
|
||||
/* #define RPC_RCLK */
|
||||
|
||||
|
||||
@@ -45,10 +45,13 @@
|
||||
|
||||
/* The definition for Surprise Down was added in Linux 3.6 in (a0dee2e PCI: misc
|
||||
* pci_reg additions). It may be backported though so we won't check for the
|
||||
* version. */
|
||||
* version. Same with PCI_EXP_SLTCTL_PDCE. */
|
||||
#ifndef PCI_ERR_UNC_SURPDN
|
||||
#define PCI_ERR_UNC_SURPDN 0x20
|
||||
#endif
|
||||
#ifndef PCI_EXP_SLTCTL_PDCE
|
||||
#define PCI_EXP_SLTCTL_PDCE 0x8
|
||||
#endif
|
||||
|
||||
/* FPGA Status definitions */
|
||||
#define OCT_CPU_RESET (1 << 0)
|
||||
@@ -62,8 +65,9 @@
|
||||
#define DRING_SIZE_MASK (DRING_SIZE-1)
|
||||
#define DESC_EOR (1 << 0)
|
||||
#define DESC_INT (1 << 1)
|
||||
#define DESC_IO_ERROR (1 << 30)
|
||||
#define DESC_OWN (1 << 31)
|
||||
#define DESC_DEFAULT_STATUS 0xdeadbeef
|
||||
#define DESC_DEFAULT_STATUS 0xdeadbe00
|
||||
#define DMA_CHAN_SIZE 128
|
||||
|
||||
/* Echocan definitions */
|
||||
@@ -351,16 +355,49 @@ static void _wcxb_reset_dring(struct wcxb *xb)
|
||||
BUG_ON(!hdesc);
|
||||
/* Set end of ring bit in last descriptor to force hw to loop around */
|
||||
hdesc->control |= cpu_to_be32(DESC_EOR);
|
||||
#ifdef DEBUG
|
||||
xb->last_retry_count = 0;
|
||||
#endif
|
||||
iowrite32be(xb->hw_dring_phys, xb->membase + TDM_DRING_ADDR);
|
||||
}
|
||||
|
||||
static void wcxb_handle_dma(struct wcxb *xb)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
bool did_retry_dma = false;
|
||||
u8 retry;
|
||||
#endif
|
||||
struct wcxb_meta_desc *mdesc;
|
||||
struct wcxb_hw_desc *tail = &(xb->hw_dring[xb->dma_tail]);
|
||||
|
||||
while (!(xb->hw_dring[xb->dma_tail].control & cpu_to_be32(DESC_OWN))) {
|
||||
while (!(tail->control & cpu_to_be32(DESC_OWN))) {
|
||||
u_char *frame;
|
||||
|
||||
if (tail->control & cpu_to_be32(DESC_IO_ERROR)) {
|
||||
u32 ier;
|
||||
unsigned long flags;
|
||||
|
||||
/* The firmware detected an error condition on the bus.
|
||||
* Force an underrun by disabling the descriptor
|
||||
* complete interrupt. When the driver processes the
|
||||
* underrun it will reset the TDM engine. */
|
||||
xb->flags.io_error = 1;
|
||||
|
||||
spin_lock_irqsave(&xb->lock, flags);
|
||||
ier = ioread32be(xb->membase + IER);
|
||||
iowrite32be(ier & ~DESC_COMPLETE, xb->membase + IER);
|
||||
spin_unlock_irqrestore(&xb->lock, flags);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
retry = be32_to_cpu(tail->status) & 0xff;
|
||||
if (xb->last_retry_count != retry) {
|
||||
xb->last_retry_count = retry;
|
||||
did_retry_dma = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
mdesc = &xb->meta_dring[xb->dma_tail];
|
||||
frame = mdesc->rx_buf_virt;
|
||||
|
||||
@@ -368,6 +405,7 @@ static void wcxb_handle_dma(struct wcxb *xb)
|
||||
|
||||
xb->dma_tail =
|
||||
(xb->dma_tail == xb->latency-1) ? 0 : xb->dma_tail + 1;
|
||||
tail = &(xb->hw_dring[xb->dma_tail]);
|
||||
|
||||
mdesc = &xb->meta_dring[xb->dma_head];
|
||||
frame = mdesc->tx_buf_virt;
|
||||
@@ -379,6 +417,13 @@ static void wcxb_handle_dma(struct wcxb *xb)
|
||||
xb->dma_head =
|
||||
(xb->dma_head == xb->latency-1) ? 0 : xb->dma_head + 1;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
if (did_retry_dma) {
|
||||
dev_info(&xb->pdev->dev,
|
||||
"DMA retries detected: %d\n", xb->last_retry_count);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static irqreturn_t _wcxb_isr(int irq, void *dev_id)
|
||||
@@ -403,10 +448,18 @@ static irqreturn_t _wcxb_isr(int irq, void *dev_id)
|
||||
if (xb->ops->handle_error)
|
||||
xb->ops->handle_error(xb);
|
||||
|
||||
/* bump latency */
|
||||
spin_lock(&xb->lock);
|
||||
|
||||
if (!xb->flags.latency_locked) {
|
||||
if (xb->flags.io_error) {
|
||||
/* Since an IO error is not necessarily because
|
||||
* the host could not keep up, we do not want to
|
||||
* bump the latency. */
|
||||
xb->flags.io_error = 0;
|
||||
dev_warn(&xb->pdev->dev,
|
||||
"IO error reported by firmware.\n");
|
||||
} else if (!xb->flags.latency_locked) {
|
||||
/* bump latency */
|
||||
|
||||
xb->latency = min(xb->latency + 1,
|
||||
xb->max_latency);
|
||||
#ifdef HAVE_RATELIMIT
|
||||
@@ -552,27 +605,41 @@ static void _wcxb_pcie_hard_reset(struct wcxb *xb)
|
||||
{
|
||||
struct pci_dev *const parent = xb->pdev->bus->self;
|
||||
u32 aer_mask;
|
||||
int pos;
|
||||
u16 sltctl;
|
||||
int pos_err;
|
||||
int pos_exp;
|
||||
|
||||
if (!wcxb_is_pcie(xb))
|
||||
return;
|
||||
|
||||
pos = pci_find_ext_capability(parent, PCI_EXT_CAP_ID_ERR);
|
||||
if (pos) {
|
||||
pci_read_config_dword(parent, pos + PCI_ERR_UNCOR_MASK,
|
||||
pos_err = pci_find_ext_capability(parent, PCI_EXT_CAP_ID_ERR);
|
||||
if (pos_err) {
|
||||
pci_read_config_dword(parent, pos_err + PCI_ERR_UNCOR_MASK,
|
||||
&aer_mask);
|
||||
pci_write_config_dword(parent, pos + PCI_ERR_UNCOR_MASK,
|
||||
pci_write_config_dword(parent, pos_err + PCI_ERR_UNCOR_MASK,
|
||||
aer_mask | PCI_ERR_UNC_SURPDN);
|
||||
}
|
||||
|
||||
/* Also disable any presence change reporting. */
|
||||
pos_exp = pci_find_capability(parent, PCI_CAP_ID_EXP);
|
||||
if (pos_exp) {
|
||||
pci_read_config_word(parent, pos_exp + PCI_EXP_SLTCTL,
|
||||
&sltctl);
|
||||
pci_write_config_word(parent, pos_exp + PCI_EXP_SLTCTL,
|
||||
sltctl & ~PCI_EXP_SLTCTL_PDCE);
|
||||
}
|
||||
|
||||
_wcxb_hard_reset(xb);
|
||||
|
||||
if (pos) {
|
||||
pci_write_config_dword(parent, pos + PCI_ERR_UNCOR_MASK,
|
||||
if (pos_exp)
|
||||
pci_write_config_word(parent, pos_exp + PCI_EXP_SLTCTL, sltctl);
|
||||
|
||||
if (pos_err) {
|
||||
pci_write_config_dword(parent, pos_err + PCI_ERR_UNCOR_MASK,
|
||||
aer_mask);
|
||||
|
||||
/* Clear the error as well from the status register. */
|
||||
pci_write_config_dword(parent, pos + PCI_ERR_UNCOR_STATUS,
|
||||
pci_write_config_dword(parent, pos_err + PCI_ERR_UNCOR_STATUS,
|
||||
PCI_ERR_UNC_SURPDN);
|
||||
}
|
||||
|
||||
@@ -925,8 +992,8 @@ int wcxb_check_firmware(struct wcxb *xb, const u32 expected_version,
|
||||
if ((meta.version == cpu_to_le32(expected_version))
|
||||
&& !force_firmware) {
|
||||
dev_info(&xb->pdev->dev,
|
||||
"Detected previous firmware updated to current version %x, but not running. You likely need to power cycle your system.\n",
|
||||
expected_version);
|
||||
"Detected previous firmware updated to current version %x, but %x is currently running on card. You likely need to power cycle your system.\n",
|
||||
expected_version, version);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,11 @@ struct wcxb_operations {
|
||||
struct wcxb_meta_desc;
|
||||
struct wcxb_hw_desc;
|
||||
|
||||
/**
|
||||
* struct wcxb - Interface to wcxb firmware.
|
||||
* @last_retry_count: Running count of times firmware had to retry host DMA
|
||||
* transaction. Debugging aide.
|
||||
*/
|
||||
struct wcxb {
|
||||
struct pci_dev *pdev;
|
||||
spinlock_t lock;
|
||||
@@ -61,6 +66,7 @@ struct wcxb {
|
||||
#ifdef WCXB_PCI_DEV_DOES_NOT_HAVE_IS_PCIE
|
||||
u32 is_pcie:1;
|
||||
#endif
|
||||
u32 io_error:1;
|
||||
} flags;
|
||||
void __iomem *membase;
|
||||
struct wcxb_meta_desc *meta_dring;
|
||||
@@ -70,6 +76,9 @@ struct wcxb {
|
||||
dma_addr_t hw_dring_phys;
|
||||
struct dma_pool *pool;
|
||||
unsigned long framecount;
|
||||
#ifdef DEBUG
|
||||
u8 last_retry_count;
|
||||
#endif
|
||||
};
|
||||
|
||||
extern int wcxb_init(struct wcxb *xb, const char *board_name, u32 int_mode);
|
||||
|
||||
@@ -611,7 +611,7 @@ static int set_pri_proto(xpd_t *xpd, enum pri_protocol set_proto)
|
||||
}
|
||||
priv->pri_protocol = set_proto;
|
||||
priv->is_cas = -1;
|
||||
phonedev->channels = pri_num_channels(set_proto);
|
||||
phonedev_alloc_channels(xpd, pri_num_channels(set_proto));
|
||||
phonedev->offhook_state = BITMASK(phonedev->channels);
|
||||
CALL_PHONE_METHOD(card_pcm_recompute, xpd, 0);
|
||||
priv->deflaw = deflaw;
|
||||
@@ -1082,6 +1082,7 @@ static int pri_set_spantype(struct dahdi_span *span, enum spantypes spantype)
|
||||
struct phonedev *phonedev = container_of(span, struct phonedev, span);
|
||||
xpd_t *xpd = container_of(phonedev, struct xpd, phonedev);
|
||||
enum pri_protocol set_proto = PRI_PROTO_0;
|
||||
int ret;
|
||||
|
||||
XPD_INFO(xpd, "%s: %s\n", __func__, dahdi_spantype2str(spantype));
|
||||
switch (spantype) {
|
||||
@@ -1099,7 +1100,13 @@ static int pri_set_spantype(struct dahdi_span *span, enum spantypes spantype)
|
||||
__func__, dahdi_spantype2str(spantype));
|
||||
return -EINVAL;
|
||||
}
|
||||
return set_pri_proto(xpd, set_proto);
|
||||
ret = set_pri_proto(xpd, set_proto);
|
||||
if (ret < 0) {
|
||||
XPD_ERR(xpd, "%s: set_pri_proto failed\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
dahdi_init_span(span);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int PRI_card_open(xpd_t *xpd, lineno_t pos)
|
||||
@@ -1929,7 +1936,8 @@ static void PRI_card_pcm_tospan(xpd_t *xpd, xpacket_t *pack)
|
||||
dchan_state(xpd, 0);
|
||||
}
|
||||
if (IS_SET(physical_mask, i)) {
|
||||
r = XPD_CHAN(xpd, logical_chan)->readchunk;
|
||||
struct dahdi_chan *chan = XPD_CHAN(xpd, logical_chan);
|
||||
r = chan->readchunk;
|
||||
// memset((u_char *)r, 0x5A, DAHDI_CHUNKSIZE); // DEBUG
|
||||
memcpy((u_char *)r, pcm, DAHDI_CHUNKSIZE);
|
||||
pcm += DAHDI_CHUNKSIZE;
|
||||
|
||||
@@ -953,10 +953,14 @@ int xbus_register_dahdi_device(xbus_t *xbus)
|
||||
goto err;
|
||||
}
|
||||
if (xbus_is_registered(xbus)) {
|
||||
XBUS_ERR(xbus, "Already registered to DAHDI\n");
|
||||
WARN_ON(1);
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
/*
|
||||
* Ignore duplicate registrations (from dahdi_registration)
|
||||
* Until we completely migrate to dahdi_autoreg=1 and
|
||||
* hotplug-based span-assignments
|
||||
*/
|
||||
XBUS_DBG(DEVICES, xbus, "Already registered to DAHDI\n");
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
xbus->ddev = dahdi_create_device();
|
||||
if (!xbus->ddev) {
|
||||
@@ -1118,7 +1122,7 @@ void xbus_populate(void *data)
|
||||
*/
|
||||
xbus_request_sync(xbus, SYNC_MODE_PLL);
|
||||
elect_syncer("xbus_populate(end)"); /* FIXME: try to do it later */
|
||||
if (!auto_assign_spans)
|
||||
if (!dahdi_get_auto_assign_spans())
|
||||
xbus_register_dahdi_device(xbus);
|
||||
out:
|
||||
XBUS_DBG(DEVICES, xbus, "Leaving\n");
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#ifdef PROTOCOL_DEBUG
|
||||
#include <linux/ctype.h>
|
||||
@@ -596,8 +595,6 @@ static DEVICE_ATTR_READER(span_show, dev, buf)
|
||||
return len;
|
||||
}
|
||||
|
||||
static DEFINE_MUTEX(span_store_mutex);
|
||||
|
||||
/*
|
||||
* For backward compatibility with old dahdi-tools
|
||||
* Remove after dahdi_registration is upgraded
|
||||
@@ -619,29 +616,10 @@ static DEVICE_ATTR_WRITER(span_store, dev, buf, count)
|
||||
return -ENODEV;
|
||||
XPD_DBG(DEVICES, xpd, "%s -- deprecated (should use assigned-spans)\n",
|
||||
(dahdi_reg) ? "register" : "unregister");
|
||||
ret = mutex_lock_interruptible(&span_store_mutex);
|
||||
if (ret < 0) {
|
||||
XBUS_ERR(xpd->xbus, "span_store_mutex already taken\n");
|
||||
return ret;
|
||||
}
|
||||
if (xbus_is_registered(xpd->xbus)) {
|
||||
if (dahdi_reg) {
|
||||
XPD_DBG(DEVICES, xpd,
|
||||
"already registered %s. Ignored.\n",
|
||||
xpd->xbus->busname);
|
||||
} else {
|
||||
xbus_unregister_dahdi_device(xpd->xbus);
|
||||
}
|
||||
} else {
|
||||
if (!dahdi_reg) {
|
||||
XPD_DBG(DEVICES, xpd,
|
||||
"already unregistered %s. Ignored.\n",
|
||||
xpd->xbus->busname);
|
||||
} else {
|
||||
xbus_register_dahdi_device(xpd->xbus);
|
||||
}
|
||||
}
|
||||
mutex_unlock(&span_store_mutex);
|
||||
if (dahdi_reg)
|
||||
xbus_register_dahdi_device(xpd->xbus);
|
||||
else
|
||||
xbus_unregister_dahdi_device(xpd->xbus);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
@@ -458,29 +458,28 @@ static void phonedev_cleanup(xpd_t *xpd)
|
||||
unsigned int x;
|
||||
|
||||
for (x = 0; x < phonedev->channels; x++) {
|
||||
if (phonedev->chans[x])
|
||||
if (phonedev->chans[x]) {
|
||||
KZFREE(phonedev->chans[x]);
|
||||
if (phonedev->ec[x])
|
||||
phonedev->chans[x] = NULL;
|
||||
}
|
||||
if (phonedev->ec[x]) {
|
||||
KZFREE(phonedev->ec[x]);
|
||||
phonedev->ec[x] = NULL;
|
||||
}
|
||||
}
|
||||
phonedev->channels = 0;
|
||||
}
|
||||
|
||||
__must_check static int phonedev_init(xpd_t *xpd,
|
||||
const xproto_table_t *proto_table,
|
||||
int channels, xpp_line_t no_pcm)
|
||||
int phonedev_alloc_channels(xpd_t *xpd, int channels)
|
||||
{
|
||||
struct phonedev *phonedev = &PHONEDEV(xpd);
|
||||
int old_channels = phonedev->channels;
|
||||
unsigned int x;
|
||||
|
||||
spin_lock_init(&phonedev->lock_recompute_pcm);
|
||||
XPD_NOTICE(xpd, "Reallocating channels: %d -> %d\n",
|
||||
old_channels, channels);
|
||||
phonedev_cleanup(xpd);
|
||||
phonedev->channels = channels;
|
||||
phonedev->no_pcm = no_pcm;
|
||||
phonedev->offhook_state = 0x0; /* ONHOOK */
|
||||
phonedev->phoneops = proto_table->phoneops;
|
||||
phonedev->digital_outputs = 0;
|
||||
phonedev->digital_inputs = 0;
|
||||
atomic_set(&phonedev->dahdi_registered, 0);
|
||||
atomic_set(&phonedev->open_counter, 0);
|
||||
for (x = 0; x < phonedev->channels; x++) {
|
||||
if (!
|
||||
(phonedev->chans[x] =
|
||||
@@ -501,6 +500,29 @@ err:
|
||||
phonedev_cleanup(xpd);
|
||||
return -ENOMEM;
|
||||
}
|
||||
EXPORT_SYMBOL(phonedev_alloc_channels);
|
||||
|
||||
__must_check static int phonedev_init(xpd_t *xpd,
|
||||
const xproto_table_t *proto_table,
|
||||
int channels, xpp_line_t no_pcm)
|
||||
{
|
||||
struct phonedev *phonedev = &PHONEDEV(xpd);
|
||||
|
||||
spin_lock_init(&phonedev->lock_recompute_pcm);
|
||||
phonedev->no_pcm = no_pcm;
|
||||
phonedev->offhook_state = 0x0; /* ONHOOK */
|
||||
phonedev->phoneops = proto_table->phoneops;
|
||||
phonedev->digital_outputs = 0;
|
||||
phonedev->digital_inputs = 0;
|
||||
atomic_set(&phonedev->dahdi_registered, 0);
|
||||
atomic_set(&phonedev->open_counter, 0);
|
||||
if (phonedev_alloc_channels(xpd, channels) < 0)
|
||||
goto err;
|
||||
return 0;
|
||||
err:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* xpd_alloc - Allocator for new XPD's
|
||||
@@ -1025,12 +1047,9 @@ EXPORT_SYMBOL(xpd_set_spanname);
|
||||
static void xpd_init_span(xpd_t *xpd, unsigned offset, int cn)
|
||||
{
|
||||
struct dahdi_span *span;
|
||||
int i;
|
||||
|
||||
memset(&PHONEDEV(xpd).span, 0, sizeof(struct dahdi_span));
|
||||
for (i = 0; i < cn; i++)
|
||||
memset(XPD_CHAN(xpd, i), 0, sizeof(struct dahdi_chan));
|
||||
|
||||
phonedev_alloc_channels(xpd, cn);
|
||||
span = &PHONEDEV(xpd).span;
|
||||
span->deflaw = DAHDI_LAW_MULAW; /* card_* drivers may override */
|
||||
span->channels = cn;
|
||||
|
||||
@@ -38,6 +38,7 @@ xpd_t *xpd_alloc(xbus_t *xbus, int unit, int subunit, int subtype, int subunits,
|
||||
int channels);
|
||||
void xpd_free(xpd_t *xpd);
|
||||
void xpd_remove(xpd_t *xpd);
|
||||
int phonedev_alloc_channels(xpd_t *xpd, int channels);
|
||||
void update_xpd_status(xpd_t *xpd, int alarm_flag);
|
||||
const char *xpp_echocan_name(const struct dahdi_chan *chan);
|
||||
int xpp_echocan_create(struct dahdi_chan *chan, struct dahdi_echocanparams *ecp,
|
||||
@@ -64,6 +65,7 @@ void notify_rxsig(xpd_t *xpd, int pos, enum dahdi_rxsig rxsig);
|
||||
extern struct proc_dir_entry *xpp_proc_toplevel;
|
||||
#endif
|
||||
|
||||
#define SPAN_REGISTERED(xpd) atomic_read(&PHONEDEV(xpd).dahdi_registered)
|
||||
#define SPAN_REGISTERED(xpd) (atomic_read(&PHONEDEV(xpd).dahdi_registered) && \
|
||||
test_bit(DAHDI_FLAGBIT_REGISTERED, &PHONEDEV(xpd).span.flags))
|
||||
|
||||
#endif /* XPP_DAHDI_H */
|
||||
|
||||
@@ -1280,7 +1280,8 @@ static inline void dahdi_ec_span(struct dahdi_span *span)
|
||||
}
|
||||
|
||||
extern struct file_operations *dahdi_transcode_fops;
|
||||
extern int auto_assign_spans;
|
||||
|
||||
int dahdi_get_auto_assign_spans(void);
|
||||
|
||||
/* Don't use these directly -- they're not guaranteed to
|
||||
be there. */
|
||||
|
||||
Reference in New Issue
Block a user