From 026fb1e3a267bbf528b1849ef7a38c012370bc58 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 5 Mar 2004 20:41:31 +0000 Subject: [PATCH] [SERIAL] Fix supprot for AFAVLAB 8port boards in 2.6.x I didn't yet use one of my AFAVLAB boards with 2.6.x until now. The upper 4 ports are not detected at all. I suppose the bug was introduced while porting the driver from 2.4.x. Please consider applying the following patch. It also adds support for a new 8 port board called P030. --- drivers/pci/pci.ids | 2 ++ drivers/serial/8250_pci.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci.ids b/drivers/pci/pci.ids index 7ae5905974433..a805bacaaf1ea 100644 --- a/drivers/pci/pci.ids +++ b/drivers/pci/pci.ids @@ -5601,6 +5601,8 @@ 14da National Aerospace Laboratories 14db AFAVLAB Technology Inc 2120 TK9902 + 2180 P028 + 2182 P030 14dc Amplicon Liveline Ltd 0000 PCI230 0001 PCI242 diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c index 16937439bd295..1d1f33de31286 100644 --- a/drivers/serial/8250_pci.c +++ b/drivers/serial/8250_pci.c @@ -145,8 +145,10 @@ afavlab_setup(struct pci_dev *dev, struct pci_board *board, bar = FL_GET_BASE(board->flags); if (idx < 4) bar += idx; - else + else { + bar = 4; offset += (idx - 4) * board->uart_offset; + } return setup_port(dev, req, bar, offset, board->reg_shift); } @@ -1891,6 +1893,9 @@ static struct pci_device_id serial_pci_tbl[] = { { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_b0_bt_8_115200 }, + { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P030, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, + pbn_b0_bt_8_115200 }, { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL, PCI_ANY_ID, PCI_ANY_ID, 0, 0, -- 2.53.0