--- linux-2.4.17-pre8-plain/drivers/char/serial.c	Wed Dec 12 14:28:07 2001
+++ linux-2.4.17-pre8-nfpom/drivers/char/serial.c	Wed Dec 12 14:42:14 2001
@@ -3895,7 +3895,14 @@
 			case 6: /* BAR 4*/
 			case 7: base_idx=idx-2; /* BAR 5*/
 		}
-
+ 
+	/* AFAVLAB uses a different mixture of BARs and offsets */
+	/* Not that ugly ;) -- HW */ 
+	if (dev->vendor == PCI_VENDOR_ID_AFAVLAB && idx >= 4) {
+		base_idx = 4;
+		offset = (idx - 4) * 8;
+	}
+ 
 	/* Some Titan cards are also a little weird */
 	if (dev->vendor == PCI_VENDOR_ID_TITAN &&
 	    (dev->device == PCI_DEVICE_ID_TITAN_400L ||
@@ -4242,6 +4249,7 @@
 
 	pbn_b0_bt_1_115200,
 	pbn_b0_bt_2_115200,
+	pbn_b0_bt_8_115200,
 	pbn_b0_bt_1_460800,
 	pbn_b0_bt_2_460800,
 
@@ -4320,6 +4328,7 @@
 
 	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200 }, /* pbn_b0_bt_1_115200 */
 	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 115200 }, /* pbn_b0_bt_2_115200 */
+	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 8, 115200 }, /* pbn_b0_bt_8_115200 */
 	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 460800 }, /* pbn_b0_bt_1_460800 */
 	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 460800 }, /* pbn_b0_bt_2_460800 */
 
@@ -4841,6 +4850,11 @@
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 		pbn_b2_bt_2_115200 },
 
+	/* AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org> */
+	{	PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028,
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+		pbn_b0_bt_8_115200 },
+		
 	/* EKF addition for i960 Boards form EKF with serial port */
 	{	PCI_VENDOR_ID_INTEL, 0x1960,
 		0xE4BF, PCI_ANY_ID, 0, 0,
--- linux-2.4.17-pre8-plain/include/linux/pci_ids.h	Wed Dec 12 14:28:16 2001
+++ linux-2.4.17-pre8-nfpom/include/linux/pci_ids.h	Wed Dec 12 14:33:20 2001
@@ -1483,6 +1483,9 @@
 #define PCI_DEVICE_ID_PANACOM_QUADMODEM	0x0400
 #define PCI_DEVICE_ID_PANACOM_DUALMODEM	0x0402
 
+#define PCI_VENDOR_ID_AFAVLAB		0x14db
+#define PCI_DEVICE_ID_AFAVLAB_P028	0x2180
+
 #define PCI_VENDOR_ID_BROADCOM		0x14e4
 #define PCI_DEVICE_ID_TIGON3_5700	0x1644
 #define PCI_DEVICE_ID_TIGON3_5701	0x1645
