wcte43x: Add support for new te436/te236 cards

Adds driver support for Digium's new te436 and te236 quad and dual span T1/E1 cards.

[removed whitespace at end of line]
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
This commit is contained in:
Russ Meyerriecks 2014-04-24 15:11:56 -05:00 committed by Shaun Ruffell
parent a951dd5e32
commit bce1ecafda
2 changed files with 32 additions and 6 deletions

View File

@ -34,6 +34,7 @@ WCT820_VERSION:=1.76
TE133_VERSION:=780019 TE133_VERSION:=780019
TE134_VERSION:=780017 TE134_VERSION:=780017
TE435_VERSION:=e0019 TE435_VERSION:=e0019
TE436_VERSION:=10017
A8A_VERSION:=1d0017 A8A_VERSION:=1d0017
A8B_VERSION:=1d0019 A8B_VERSION:=1d0019
A4A_VERSION:=a0017 A4A_VERSION:=a0017
@ -63,6 +64,7 @@ FIRMWARE:=$(FIRMWARE:FIRMWARE-TE820=dahdi-fw-te820-$(WCT820_VERSION).tar.gz)
FIRMWARE:=$(FIRMWARE:FIRMWARE-TE133=dahdi-fw-te133-$(TE133_VERSION).tar.gz) FIRMWARE:=$(FIRMWARE:FIRMWARE-TE133=dahdi-fw-te133-$(TE133_VERSION).tar.gz)
FIRMWARE:=$(FIRMWARE:FIRMWARE-TE134=dahdi-fw-te134-$(TE134_VERSION).tar.gz) FIRMWARE:=$(FIRMWARE:FIRMWARE-TE134=dahdi-fw-te134-$(TE134_VERSION).tar.gz)
FIRMWARE:=$(FIRMWARE:FIRMWARE-TE435=dahdi-fw-te435-$(TE435_VERSION).tar.gz) FIRMWARE:=$(FIRMWARE:FIRMWARE-TE435=dahdi-fw-te435-$(TE435_VERSION).tar.gz)
FIRMWARE:=$(FIRMWARE:FIRMWARE-TE436=dahdi-fw-te436-$(TE436_VERSION).tar.gz)
FIRMWARE:=$(FIRMWARE:FIRMWARE-A8A=dahdi-fw-a8b-$(A8B_VERSION).tar.gz) FIRMWARE:=$(FIRMWARE:FIRMWARE-A8A=dahdi-fw-a8b-$(A8B_VERSION).tar.gz)
FIRMWARE:=$(FIRMWARE:FIRMWARE-A8B=dahdi-fw-a8a-$(A8A_VERSION).tar.gz) FIRMWARE:=$(FIRMWARE:FIRMWARE-A8B=dahdi-fw-a8a-$(A8A_VERSION).tar.gz)
FIRMWARE:=$(FIRMWARE:FIRMWARE-A4A=dahdi-fw-a4b-$(A4B_VERSION).tar.gz) FIRMWARE:=$(FIRMWARE:FIRMWARE-A4A=dahdi-fw-a4b-$(A4B_VERSION).tar.gz)
@ -138,6 +140,7 @@ hotplug-install: $(DESTDIR)/usr/lib/hotplug/firmware $(DESTDIR)/lib/firmware $(F
@$(call RUN_INST,dahdi-fw-te133,$(TE133_VERSION)) @$(call RUN_INST,dahdi-fw-te133,$(TE133_VERSION))
@$(call RUN_INST,dahdi-fw-te134,$(TE134_VERSION)) @$(call RUN_INST,dahdi-fw-te134,$(TE134_VERSION))
@$(call RUN_INST,dahdi-fw-te435,$(TE435_VERSION)) @$(call RUN_INST,dahdi-fw-te435,$(TE435_VERSION))
@$(call RUN_INST,dahdi-fw-te436,$(TE436_VERSION))
@$(call RUN_INST,dahdi-fw-a8a,$(A8A_VERSION)) @$(call RUN_INST,dahdi-fw-a8a,$(A8A_VERSION))
@$(call RUN_INST,dahdi-fw-a8b,$(A8B_VERSION)) @$(call RUN_INST,dahdi-fw-a8b,$(A8B_VERSION))
@$(call RUN_INST,dahdi-fw-a4a,$(A4A_VERSION)) @$(call RUN_INST,dahdi-fw-a4a,$(A4A_VERSION))

View File

@ -65,7 +65,9 @@ static inline int delayed_work_pending(struct work_struct *work)
#endif #endif
static const char *TE435_FW_FILENAME = "dahdi-fw-te435.bin"; static const char *TE435_FW_FILENAME = "dahdi-fw-te435.bin";
static const char *TE436_FW_FILENAME = "dahdi-fw-te436.bin";
static const u32 TE435_VERSION = 0xe0019; static const u32 TE435_VERSION = 0xe0019;
static const u32 TE436_VERSION = 0x10017;
/* #define RPC_RCLK */ /* #define RPC_RCLK */
@ -794,6 +796,8 @@ struct t43x_desc {
static const struct t43x_desc te435 = {"Wildcard TE435"}; /* pci express quad */ static const struct t43x_desc te435 = {"Wildcard TE435"}; /* pci express quad */
static const struct t43x_desc te235 = {"Wildcard TE235"}; /* pci express dual */ static const struct t43x_desc te235 = {"Wildcard TE235"}; /* pci express dual */
static const struct t43x_desc te436 = {"Wildcard TE436"}; /* pci quad */
static const struct t43x_desc te236 = {"Wildcard TE236"}; /* pci dual */
static int __t43x_pci_get(struct t43x *wc, unsigned int addr) static int __t43x_pci_get(struct t43x *wc, unsigned int addr)
{ {
@ -3449,12 +3453,6 @@ static int __devinit t43x_init_one(struct pci_dev *pdev,
goto fail_exit; goto fail_exit;
} }
/* Check for field updatable firmware */
res = wcxb_check_firmware(&wc->xb, TE435_VERSION,
TE435_FW_FILENAME, force_firmware, WCXB_RESET_NOW);
if (res)
goto fail_exit;
wc->ddev->hardware_id = t43x_read_serial(wc); wc->ddev->hardware_id = t43x_read_serial(wc);
if (wc->ddev->hardware_id == NULL) { if (wc->ddev->hardware_id == NULL) {
@ -3464,11 +3462,21 @@ static int __devinit t43x_init_one(struct pci_dev *pdev,
} }
if (strncmp(wc->ddev->hardware_id, "1TE435F", 7) == 0) { if (strncmp(wc->ddev->hardware_id, "1TE435F", 7) == 0) {
/* Quad-span PCIE */
wc->numspans = 4; wc->numspans = 4;
wc->devtype = &te435; wc->devtype = &te435;
} else if (strncmp(wc->ddev->hardware_id, "1TE235F", 7) == 0) { } else if (strncmp(wc->ddev->hardware_id, "1TE235F", 7) == 0) {
/* Dual-span PCIE */
wc->numspans = 2; wc->numspans = 2;
wc->devtype = &te235; wc->devtype = &te235;
} else if (strncmp(wc->ddev->hardware_id, "1TE436F", 7) == 0) {
/* Quad-span PCI */
wc->numspans = 4;
wc->devtype = &te436;
} else if (strncmp(wc->ddev->hardware_id, "1TE236F", 7) == 0) {
/* Dual-span PCI */
wc->numspans = 2;
wc->devtype = &te236;
} else { } else {
dev_info(&wc->xb.pdev->dev, dev_info(&wc->xb.pdev->dev,
"Unable to identify board type from serial number %s\n", "Unable to identify board type from serial number %s\n",
@ -3477,6 +3485,20 @@ static int __devinit t43x_init_one(struct pci_dev *pdev,
goto fail_exit; goto fail_exit;
} }
/* Check for field updatable firmware */
if ((wc->devtype == &te435) || (wc->devtype == &te235)) {
res = wcxb_check_firmware(&wc->xb, TE435_VERSION,
TE435_FW_FILENAME, force_firmware, WCXB_RESET_NOW);
} else if ((wc->devtype == &te436) || (wc->devtype == &te236)) {
res = wcxb_check_firmware(&wc->xb, TE436_VERSION,
TE436_FW_FILENAME, force_firmware, WCXB_RESET_NOW);
} else {
res = -EIO;
}
if (res)
goto fail_exit;
for (x = 0; x < wc->numspans; x++) { for (x = 0; x < wc->numspans; x++) {
ts = kzalloc(sizeof(*wc->tspans[x]), GFP_KERNEL); ts = kzalloc(sizeof(*wc->tspans[x]), GFP_KERNEL);
if (!ts) { if (!ts) {
@ -3595,6 +3617,7 @@ static void __devexit t43x_remove_one(struct pci_dev *pdev)
static DEFINE_PCI_DEVICE_TABLE(t43x_pci_tbl) = { static DEFINE_PCI_DEVICE_TABLE(t43x_pci_tbl) = {
{ 0xd161, 0x800e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { 0xd161, 0x800e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0xd161, 0x8013, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0 } { 0 }
}; };