blob: 8f2617206e8fceb553f4bb414a6d15133948e743 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/drivers/char/8250_pci.c
3 *
4 * Probe module for 8250/16550-type PCI serial ports.
5 *
6 * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
7 *
8 * Copyright (C) 2001 Russell King, All Rights Reserved.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License.
13 *
14 * $Id: 8250_pci.c,v 1.28 2002/11/02 11:14:18 rmk Exp $
15 */
16#include <linux/module.h>
17#include <linux/init.h>
18#include <linux/pci.h>
19#include <linux/sched.h>
20#include <linux/string.h>
21#include <linux/kernel.h>
22#include <linux/slab.h>
23#include <linux/delay.h>
24#include <linux/tty.h>
25#include <linux/serial_core.h>
26#include <linux/8250_pci.h>
27#include <linux/bitops.h>
28
29#include <asm/byteorder.h>
30#include <asm/io.h>
31
32#include "8250.h"
33
34#undef SERIAL_DEBUG_PCI
35
36/*
37 * Definitions for PCI support.
38 */
39#define FL_BASE_MASK 0x0007
40#define FL_BASE0 0x0000
41#define FL_BASE1 0x0001
42#define FL_BASE2 0x0002
43#define FL_BASE3 0x0003
44#define FL_BASE4 0x0004
45#define FL_GET_BASE(x) (x & FL_BASE_MASK)
46
47/* Use successive BARs (PCI base address registers),
48 else use offset into some specified BAR */
49#define FL_BASE_BARS 0x0008
50
51/* do not assign an irq */
52#define FL_NOIRQ 0x0080
53
54/* Use the Base address register size to cap number of ports */
55#define FL_REGION_SZ_CAP 0x0100
56
Russell King1c7c1fe2005-07-27 11:31:19 +010057struct pciserial_board {
Linus Torvalds1da177e2005-04-16 15:20:36 -070058 unsigned int flags;
59 unsigned int num_ports;
60 unsigned int base_baud;
61 unsigned int uart_offset;
62 unsigned int reg_shift;
63 unsigned int first_offset;
64};
65
66/*
67 * init function returns:
68 * > 0 - number of ports
69 * = 0 - use board->num_ports
70 * < 0 - error
71 */
72struct pci_serial_quirk {
73 u32 vendor;
74 u32 device;
75 u32 subvendor;
76 u32 subdevice;
77 int (*init)(struct pci_dev *dev);
Russell King1c7c1fe2005-07-27 11:31:19 +010078 int (*setup)(struct pci_dev *dev, struct pciserial_board *,
Linus Torvalds1da177e2005-04-16 15:20:36 -070079 struct uart_port *port, int idx);
80 void (*exit)(struct pci_dev *dev);
81};
82
83#define PCI_NUM_BAR_RESOURCES 6
84
85struct serial_private {
86 unsigned int nr;
87 void __iomem *remapped_bar[PCI_NUM_BAR_RESOURCES];
88 struct pci_serial_quirk *quirk;
89 int line[0];
90};
91
92static void moan_device(const char *str, struct pci_dev *dev)
93{
94 printk(KERN_WARNING "%s: %s\n"
95 KERN_WARNING "Please send the output of lspci -vv, this\n"
96 KERN_WARNING "message (0x%04x,0x%04x,0x%04x,0x%04x), the\n"
97 KERN_WARNING "manufacturer and name of serial board or\n"
98 KERN_WARNING "modem board to rmk+serial@arm.linux.org.uk.\n",
99 pci_name(dev), str, dev->vendor, dev->device,
100 dev->subsystem_vendor, dev->subsystem_device);
101}
102
103static int
104setup_port(struct pci_dev *dev, struct uart_port *port,
105 int bar, int offset, int regshift)
106{
107 struct serial_private *priv = pci_get_drvdata(dev);
108 unsigned long base, len;
109
110 if (bar >= PCI_NUM_BAR_RESOURCES)
111 return -EINVAL;
112
Russell King72ce9a82005-07-27 11:32:04 +0100113 base = pci_resource_start(dev, bar);
114
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115 if (pci_resource_flags(dev, bar) & IORESOURCE_MEM) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116 len = pci_resource_len(dev, bar);
117
118 if (!priv->remapped_bar[bar])
119 priv->remapped_bar[bar] = ioremap(base, len);
120 if (!priv->remapped_bar[bar])
121 return -ENOMEM;
122
123 port->iotype = UPIO_MEM;
Russell King72ce9a82005-07-27 11:32:04 +0100124 port->iobase = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125 port->mapbase = base + offset;
126 port->membase = priv->remapped_bar[bar] + offset;
127 port->regshift = regshift;
128 } else {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 port->iotype = UPIO_PORT;
Russell King72ce9a82005-07-27 11:32:04 +0100130 port->iobase = base + offset;
131 port->mapbase = 0;
132 port->membase = NULL;
133 port->regshift = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134 }
135 return 0;
136}
137
138/*
139 * AFAVLAB uses a different mixture of BARs and offsets
140 * Not that ugly ;) -- HW
141 */
142static int
Russell King1c7c1fe2005-07-27 11:31:19 +0100143afavlab_setup(struct pci_dev *dev, struct pciserial_board *board,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144 struct uart_port *port, int idx)
145{
146 unsigned int bar, offset = board->first_offset;
147
148 bar = FL_GET_BASE(board->flags);
149 if (idx < 4)
150 bar += idx;
151 else {
152 bar = 4;
153 offset += (idx - 4) * board->uart_offset;
154 }
155
156 return setup_port(dev, port, bar, offset, board->reg_shift);
157}
158
159/*
160 * HP's Remote Management Console. The Diva chip came in several
161 * different versions. N-class, L2000 and A500 have two Diva chips, each
162 * with 3 UARTs (the third UART on the second chip is unused). Superdome
163 * and Keystone have one Diva chip with 3 UARTs. Some later machines have
164 * one Diva chip, but it has been expanded to 5 UARTs.
165 */
166static int __devinit pci_hp_diva_init(struct pci_dev *dev)
167{
168 int rc = 0;
169
170 switch (dev->subsystem_device) {
171 case PCI_DEVICE_ID_HP_DIVA_TOSCA1:
172 case PCI_DEVICE_ID_HP_DIVA_HALFDOME:
173 case PCI_DEVICE_ID_HP_DIVA_KEYSTONE:
174 case PCI_DEVICE_ID_HP_DIVA_EVEREST:
175 rc = 3;
176 break;
177 case PCI_DEVICE_ID_HP_DIVA_TOSCA2:
178 rc = 2;
179 break;
180 case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
181 rc = 4;
182 break;
183 case PCI_DEVICE_ID_HP_DIVA_POWERBAR:
184 rc = 1;
185 break;
186 }
187
188 return rc;
189}
190
191/*
192 * HP's Diva chip puts the 4th/5th serial port further out, and
193 * some serial ports are supposed to be hidden on certain models.
194 */
195static int
Russell King1c7c1fe2005-07-27 11:31:19 +0100196pci_hp_diva_setup(struct pci_dev *dev, struct pciserial_board *board,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197 struct uart_port *port, int idx)
198{
199 unsigned int offset = board->first_offset;
200 unsigned int bar = FL_GET_BASE(board->flags);
201
202 switch (dev->subsystem_device) {
203 case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
204 if (idx == 3)
205 idx++;
206 break;
207 case PCI_DEVICE_ID_HP_DIVA_EVEREST:
208 if (idx > 0)
209 idx++;
210 if (idx > 2)
211 idx++;
212 break;
213 }
214 if (idx > 2)
215 offset = 0x18;
216
217 offset += idx * board->uart_offset;
218
219 return setup_port(dev, port, bar, offset, board->reg_shift);
220}
221
222/*
223 * Added for EKF Intel i960 serial boards
224 */
225static int __devinit pci_inteli960ni_init(struct pci_dev *dev)
226{
227 unsigned long oldval;
228
229 if (!(dev->subsystem_device & 0x1000))
230 return -ENODEV;
231
232 /* is firmware started? */
233 pci_read_config_dword(dev, 0x44, (void*) &oldval);
234 if (oldval == 0x00001000L) { /* RESET value */
235 printk(KERN_DEBUG "Local i960 firmware missing");
236 return -ENODEV;
237 }
238 return 0;
239}
240
241/*
242 * Some PCI serial cards using the PLX 9050 PCI interface chip require
243 * that the card interrupt be explicitly enabled or disabled. This
244 * seems to be mainly needed on card using the PLX which also use I/O
245 * mapped memory.
246 */
247static int __devinit pci_plx9050_init(struct pci_dev *dev)
248{
249 u8 irq_config;
250 void __iomem *p;
251
252 if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0) {
253 moan_device("no memory in bar 0", dev);
254 return 0;
255 }
256
257 irq_config = 0x41;
258 if (dev->vendor == PCI_VENDOR_ID_PANACOM)
259 irq_config = 0x43;
260 if ((dev->vendor == PCI_VENDOR_ID_PLX) &&
261 (dev->device == PCI_DEVICE_ID_PLX_ROMULUS)) {
262 /*
263 * As the megawolf cards have the int pins active
264 * high, and have 2 UART chips, both ints must be
265 * enabled on the 9050. Also, the UARTS are set in
266 * 16450 mode by default, so we have to enable the
267 * 16C950 'enhanced' mode so that we can use the
268 * deep FIFOs
269 */
270 irq_config = 0x5b;
271 }
272
273 /*
274 * enable/disable interrupts
275 */
276 p = ioremap(pci_resource_start(dev, 0), 0x80);
277 if (p == NULL)
278 return -ENOMEM;
279 writel(irq_config, p + 0x4c);
280
281 /*
282 * Read the register back to ensure that it took effect.
283 */
284 readl(p + 0x4c);
285 iounmap(p);
286
287 return 0;
288}
289
290static void __devexit pci_plx9050_exit(struct pci_dev *dev)
291{
292 u8 __iomem *p;
293
294 if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0)
295 return;
296
297 /*
298 * disable interrupts
299 */
300 p = ioremap(pci_resource_start(dev, 0), 0x80);
301 if (p != NULL) {
302 writel(0, p + 0x4c);
303
304 /*
305 * Read the register back to ensure that it took effect.
306 */
307 readl(p + 0x4c);
308 iounmap(p);
309 }
310}
311
312/* SBS Technologies Inc. PMC-OCTPRO and P-OCTAL cards */
313static int
Russell King1c7c1fe2005-07-27 11:31:19 +0100314sbs_setup(struct pci_dev *dev, struct pciserial_board *board,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700315 struct uart_port *port, int idx)
316{
317 unsigned int bar, offset = board->first_offset;
318
319 bar = 0;
320
321 if (idx < 4) {
322 /* first four channels map to 0, 0x100, 0x200, 0x300 */
323 offset += idx * board->uart_offset;
324 } else if (idx < 8) {
325 /* last four channels map to 0x1000, 0x1100, 0x1200, 0x1300 */
326 offset += idx * board->uart_offset + 0xC00;
327 } else /* we have only 8 ports on PMC-OCTALPRO */
328 return 1;
329
330 return setup_port(dev, port, bar, offset, board->reg_shift);
331}
332
333/*
334* This does initialization for PMC OCTALPRO cards:
335* maps the device memory, resets the UARTs (needed, bc
336* if the module is removed and inserted again, the card
337* is in the sleep mode) and enables global interrupt.
338*/
339
340/* global control register offset for SBS PMC-OctalPro */
341#define OCT_REG_CR_OFF 0x500
342
343static int __devinit sbs_init(struct pci_dev *dev)
344{
345 u8 __iomem *p;
346
347 p = ioremap(pci_resource_start(dev, 0),pci_resource_len(dev,0));
348
349 if (p == NULL)
350 return -ENOMEM;
351 /* Set bit-4 Control Register (UART RESET) in to reset the uarts */
352 writeb(0x10,p + OCT_REG_CR_OFF);
353 udelay(50);
354 writeb(0x0,p + OCT_REG_CR_OFF);
355
356 /* Set bit-2 (INTENABLE) of Control Register */
357 writeb(0x4, p + OCT_REG_CR_OFF);
358 iounmap(p);
359
360 return 0;
361}
362
363/*
364 * Disables the global interrupt of PMC-OctalPro
365 */
366
367static void __devexit sbs_exit(struct pci_dev *dev)
368{
369 u8 __iomem *p;
370
371 p = ioremap(pci_resource_start(dev, 0),pci_resource_len(dev,0));
372 if (p != NULL) {
373 writeb(0, p + OCT_REG_CR_OFF);
374 }
375 iounmap(p);
376}
377
378/*
379 * SIIG serial cards have an PCI interface chip which also controls
380 * the UART clocking frequency. Each UART can be clocked independently
381 * (except cards equiped with 4 UARTs) and initial clocking settings
382 * are stored in the EEPROM chip. It can cause problems because this
383 * version of serial driver doesn't support differently clocked UART's
384 * on single PCI card. To prevent this, initialization functions set
385 * high frequency clocking for all UART's on given card. It is safe (I
386 * hope) because it doesn't touch EEPROM settings to prevent conflicts
387 * with other OSes (like M$ DOS).
388 *
389 * SIIG support added by Andrey Panin <pazke@donpac.ru>, 10/1999
390 *
391 * There is two family of SIIG serial cards with different PCI
392 * interface chip and different configuration methods:
393 * - 10x cards have control registers in IO and/or memory space;
394 * - 20x cards have control registers in standard PCI configuration space.
395 *
Andrey Paninfbc0dc02005-07-18 11:38:09 +0100396 * There are also Quartet Serial cards which use Oxford Semiconductor
397 * 16954 quad UART PCI chip clocked by 18.432 MHz quartz.
398 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700399 * Note: some SIIG cards are probed by the parport_serial object.
400 */
401
402#define PCI_DEVICE_ID_SIIG_1S_10x (PCI_DEVICE_ID_SIIG_1S_10x_550 & 0xfffc)
403#define PCI_DEVICE_ID_SIIG_2S_10x (PCI_DEVICE_ID_SIIG_2S_10x_550 & 0xfff8)
404
405static int pci_siig10x_init(struct pci_dev *dev)
406{
407 u16 data;
408 void __iomem *p;
409
410 switch (dev->device & 0xfff8) {
411 case PCI_DEVICE_ID_SIIG_1S_10x: /* 1S */
412 data = 0xffdf;
413 break;
414 case PCI_DEVICE_ID_SIIG_2S_10x: /* 2S, 2S1P */
415 data = 0xf7ff;
416 break;
417 default: /* 1S1P, 4S */
418 data = 0xfffb;
419 break;
420 }
421
422 p = ioremap(pci_resource_start(dev, 0), 0x80);
423 if (p == NULL)
424 return -ENOMEM;
425
426 writew(readw(p + 0x28) & data, p + 0x28);
427 readw(p + 0x28);
428 iounmap(p);
429 return 0;
430}
431
432#define PCI_DEVICE_ID_SIIG_2S_20x (PCI_DEVICE_ID_SIIG_2S_20x_550 & 0xfffc)
433#define PCI_DEVICE_ID_SIIG_2S1P_20x (PCI_DEVICE_ID_SIIG_2S1P_20x_550 & 0xfffc)
434
435static int pci_siig20x_init(struct pci_dev *dev)
436{
437 u8 data;
438
439 /* Change clock frequency for the first UART. */
440 pci_read_config_byte(dev, 0x6f, &data);
441 pci_write_config_byte(dev, 0x6f, data & 0xef);
442
443 /* If this card has 2 UART, we have to do the same with second UART. */
444 if (((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S_20x) ||
445 ((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S1P_20x)) {
446 pci_read_config_byte(dev, 0x73, &data);
447 pci_write_config_byte(dev, 0x73, data & 0xef);
448 }
449 return 0;
450}
451
452int pci_siig10x_fn(struct pci_dev *dev, int enable)
453{
454 int ret = 0;
455 if (enable)
456 ret = pci_siig10x_init(dev);
457 return ret;
458}
459
460int pci_siig20x_fn(struct pci_dev *dev, int enable)
461{
462 int ret = 0;
463 if (enable)
464 ret = pci_siig20x_init(dev);
465 return ret;
466}
467
468EXPORT_SYMBOL(pci_siig10x_fn);
469EXPORT_SYMBOL(pci_siig20x_fn);
470
471/*
472 * Timedia has an explosion of boards, and to avoid the PCI table from
473 * growing *huge*, we use this function to collapse some 70 entries
474 * in the PCI table into one, for sanity's and compactness's sake.
475 */
476static unsigned short timedia_single_port[] = {
477 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0
478};
479
480static unsigned short timedia_dual_port[] = {
481 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
482 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079,
483 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079,
484 0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079,
485 0xD079, 0
486};
487
488static unsigned short timedia_quad_port[] = {
489 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157,
490 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159,
491 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
492 0xB157, 0
493};
494
495static unsigned short timedia_eight_port[] = {
496 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166,
497 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
498};
499
500static struct timedia_struct {
501 int num;
502 unsigned short *ids;
503} timedia_data[] = {
504 { 1, timedia_single_port },
505 { 2, timedia_dual_port },
506 { 4, timedia_quad_port },
507 { 8, timedia_eight_port },
508 { 0, NULL }
509};
510
511static int __devinit pci_timedia_init(struct pci_dev *dev)
512{
513 unsigned short *ids;
514 int i, j;
515
516 for (i = 0; timedia_data[i].num; i++) {
517 ids = timedia_data[i].ids;
518 for (j = 0; ids[j]; j++)
519 if (dev->subsystem_device == ids[j])
520 return timedia_data[i].num;
521 }
522 return 0;
523}
524
525/*
526 * Timedia/SUNIX uses a mixture of BARs and offsets
527 * Ugh, this is ugly as all hell --- TYT
528 */
529static int
Russell King1c7c1fe2005-07-27 11:31:19 +0100530pci_timedia_setup(struct pci_dev *dev, struct pciserial_board *board,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700531 struct uart_port *port, int idx)
532{
533 unsigned int bar = 0, offset = board->first_offset;
534
535 switch (idx) {
536 case 0:
537 bar = 0;
538 break;
539 case 1:
540 offset = board->uart_offset;
541 bar = 0;
542 break;
543 case 2:
544 bar = 1;
545 break;
546 case 3:
547 offset = board->uart_offset;
548 bar = 1;
549 case 4: /* BAR 2 */
550 case 5: /* BAR 3 */
551 case 6: /* BAR 4 */
552 case 7: /* BAR 5 */
553 bar = idx - 2;
554 }
555
556 return setup_port(dev, port, bar, offset, board->reg_shift);
557}
558
559/*
560 * Some Titan cards are also a little weird
561 */
562static int
Russell King1c7c1fe2005-07-27 11:31:19 +0100563titan_400l_800l_setup(struct pci_dev *dev,
564 struct pciserial_board *board,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700565 struct uart_port *port, int idx)
566{
567 unsigned int bar, offset = board->first_offset;
568
569 switch (idx) {
570 case 0:
571 bar = 1;
572 break;
573 case 1:
574 bar = 2;
575 break;
576 default:
577 bar = 4;
578 offset = (idx - 2) * board->uart_offset;
579 }
580
581 return setup_port(dev, port, bar, offset, board->reg_shift);
582}
583
584static int __devinit pci_xircom_init(struct pci_dev *dev)
585{
586 msleep(100);
587 return 0;
588}
589
590static int __devinit pci_netmos_init(struct pci_dev *dev)
591{
592 /* subdevice 0x00PS means <P> parallel, <S> serial */
593 unsigned int num_serial = dev->subsystem_device & 0xf;
594
595 if (num_serial == 0)
596 return -ENODEV;
597 return num_serial;
598}
599
600static int
Russell King1c7c1fe2005-07-27 11:31:19 +0100601pci_default_setup(struct pci_dev *dev, struct pciserial_board *board,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700602 struct uart_port *port, int idx)
603{
604 unsigned int bar, offset = board->first_offset, maxnr;
605
606 bar = FL_GET_BASE(board->flags);
607 if (board->flags & FL_BASE_BARS)
608 bar += idx;
609 else
610 offset += idx * board->uart_offset;
611
612 maxnr = (pci_resource_len(dev, bar) - board->first_offset) /
613 (8 << board->reg_shift);
614
615 if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
616 return 1;
617
618 return setup_port(dev, port, bar, offset, board->reg_shift);
619}
620
621/* This should be in linux/pci_ids.h */
622#define PCI_VENDOR_ID_SBSMODULARIO 0x124B
623#define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
624#define PCI_DEVICE_ID_OCTPRO 0x0001
625#define PCI_SUBDEVICE_ID_OCTPRO232 0x0108
626#define PCI_SUBDEVICE_ID_OCTPRO422 0x0208
627#define PCI_SUBDEVICE_ID_POCTAL232 0x0308
628#define PCI_SUBDEVICE_ID_POCTAL422 0x0408
629
630/*
631 * Master list of serial port init/setup/exit quirks.
632 * This does not describe the general nature of the port.
633 * (ie, baud base, number and location of ports, etc)
634 *
635 * This list is ordered alphabetically by vendor then device.
636 * Specific entries must come before more generic entries.
637 */
638static struct pci_serial_quirk pci_serial_quirks[] = {
639 /*
640 * AFAVLAB cards.
641 * It is not clear whether this applies to all products.
642 */
643 {
644 .vendor = PCI_VENDOR_ID_AFAVLAB,
645 .device = PCI_ANY_ID,
646 .subvendor = PCI_ANY_ID,
647 .subdevice = PCI_ANY_ID,
648 .setup = afavlab_setup,
649 },
650 /*
651 * HP Diva
652 */
653 {
654 .vendor = PCI_VENDOR_ID_HP,
655 .device = PCI_DEVICE_ID_HP_DIVA,
656 .subvendor = PCI_ANY_ID,
657 .subdevice = PCI_ANY_ID,
658 .init = pci_hp_diva_init,
659 .setup = pci_hp_diva_setup,
660 },
661 /*
662 * Intel
663 */
664 {
665 .vendor = PCI_VENDOR_ID_INTEL,
666 .device = PCI_DEVICE_ID_INTEL_80960_RP,
667 .subvendor = 0xe4bf,
668 .subdevice = PCI_ANY_ID,
669 .init = pci_inteli960ni_init,
670 .setup = pci_default_setup,
671 },
672 /*
673 * Panacom
674 */
675 {
676 .vendor = PCI_VENDOR_ID_PANACOM,
677 .device = PCI_DEVICE_ID_PANACOM_QUADMODEM,
678 .subvendor = PCI_ANY_ID,
679 .subdevice = PCI_ANY_ID,
680 .init = pci_plx9050_init,
681 .setup = pci_default_setup,
682 .exit = __devexit_p(pci_plx9050_exit),
683 },
684 {
685 .vendor = PCI_VENDOR_ID_PANACOM,
686 .device = PCI_DEVICE_ID_PANACOM_DUALMODEM,
687 .subvendor = PCI_ANY_ID,
688 .subdevice = PCI_ANY_ID,
689 .init = pci_plx9050_init,
690 .setup = pci_default_setup,
691 .exit = __devexit_p(pci_plx9050_exit),
692 },
693 /*
694 * PLX
695 */
696 {
697 .vendor = PCI_VENDOR_ID_PLX,
698 .device = PCI_DEVICE_ID_PLX_9050,
699 .subvendor = PCI_SUBVENDOR_ID_KEYSPAN,
700 .subdevice = PCI_SUBDEVICE_ID_KEYSPAN_SX2,
701 .init = pci_plx9050_init,
702 .setup = pci_default_setup,
703 .exit = __devexit_p(pci_plx9050_exit),
704 },
705 {
706 .vendor = PCI_VENDOR_ID_PLX,
707 .device = PCI_DEVICE_ID_PLX_ROMULUS,
708 .subvendor = PCI_VENDOR_ID_PLX,
709 .subdevice = PCI_DEVICE_ID_PLX_ROMULUS,
710 .init = pci_plx9050_init,
711 .setup = pci_default_setup,
712 .exit = __devexit_p(pci_plx9050_exit),
713 },
714 /*
715 * SBS Technologies, Inc., PMC-OCTALPRO 232
716 */
717 {
718 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
719 .device = PCI_DEVICE_ID_OCTPRO,
720 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
721 .subdevice = PCI_SUBDEVICE_ID_OCTPRO232,
722 .init = sbs_init,
723 .setup = sbs_setup,
724 .exit = __devexit_p(sbs_exit),
725 },
726 /*
727 * SBS Technologies, Inc., PMC-OCTALPRO 422
728 */
729 {
730 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
731 .device = PCI_DEVICE_ID_OCTPRO,
732 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
733 .subdevice = PCI_SUBDEVICE_ID_OCTPRO422,
734 .init = sbs_init,
735 .setup = sbs_setup,
736 .exit = __devexit_p(sbs_exit),
737 },
738 /*
739 * SBS Technologies, Inc., P-Octal 232
740 */
741 {
742 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
743 .device = PCI_DEVICE_ID_OCTPRO,
744 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
745 .subdevice = PCI_SUBDEVICE_ID_POCTAL232,
746 .init = sbs_init,
747 .setup = sbs_setup,
748 .exit = __devexit_p(sbs_exit),
749 },
750 /*
751 * SBS Technologies, Inc., P-Octal 422
752 */
753 {
754 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
755 .device = PCI_DEVICE_ID_OCTPRO,
756 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
757 .subdevice = PCI_SUBDEVICE_ID_POCTAL422,
758 .init = sbs_init,
759 .setup = sbs_setup,
760 .exit = __devexit_p(sbs_exit),
761 },
762
763 /*
764 * SIIG cards.
765 * It is not clear whether these could be collapsed.
766 */
767 {
768 .vendor = PCI_VENDOR_ID_SIIG,
769 .device = PCI_DEVICE_ID_SIIG_1S_10x_550,
770 .subvendor = PCI_ANY_ID,
771 .subdevice = PCI_ANY_ID,
772 .init = pci_siig10x_init,
773 .setup = pci_default_setup,
774 },
775 {
776 .vendor = PCI_VENDOR_ID_SIIG,
777 .device = PCI_DEVICE_ID_SIIG_1S_10x_650,
778 .subvendor = PCI_ANY_ID,
779 .subdevice = PCI_ANY_ID,
780 .init = pci_siig10x_init,
781 .setup = pci_default_setup,
782 },
783 {
784 .vendor = PCI_VENDOR_ID_SIIG,
785 .device = PCI_DEVICE_ID_SIIG_1S_10x_850,
786 .subvendor = PCI_ANY_ID,
787 .subdevice = PCI_ANY_ID,
788 .init = pci_siig10x_init,
789 .setup = pci_default_setup,
790 },
791 {
792 .vendor = PCI_VENDOR_ID_SIIG,
793 .device = PCI_DEVICE_ID_SIIG_2S_10x_550,
794 .subvendor = PCI_ANY_ID,
795 .subdevice = PCI_ANY_ID,
796 .init = pci_siig10x_init,
797 .setup = pci_default_setup,
798 },
799 {
800 .vendor = PCI_VENDOR_ID_SIIG,
801 .device = PCI_DEVICE_ID_SIIG_2S_10x_650,
802 .subvendor = PCI_ANY_ID,
803 .subdevice = PCI_ANY_ID,
804 .init = pci_siig10x_init,
805 .setup = pci_default_setup,
806 },
807 {
808 .vendor = PCI_VENDOR_ID_SIIG,
809 .device = PCI_DEVICE_ID_SIIG_2S_10x_850,
810 .subvendor = PCI_ANY_ID,
811 .subdevice = PCI_ANY_ID,
812 .init = pci_siig10x_init,
813 .setup = pci_default_setup,
814 },
815 {
816 .vendor = PCI_VENDOR_ID_SIIG,
817 .device = PCI_DEVICE_ID_SIIG_4S_10x_550,
818 .subvendor = PCI_ANY_ID,
819 .subdevice = PCI_ANY_ID,
820 .init = pci_siig10x_init,
821 .setup = pci_default_setup,
822 },
823 {
824 .vendor = PCI_VENDOR_ID_SIIG,
825 .device = PCI_DEVICE_ID_SIIG_4S_10x_650,
826 .subvendor = PCI_ANY_ID,
827 .subdevice = PCI_ANY_ID,
828 .init = pci_siig10x_init,
829 .setup = pci_default_setup,
830 },
831 {
832 .vendor = PCI_VENDOR_ID_SIIG,
833 .device = PCI_DEVICE_ID_SIIG_4S_10x_850,
834 .subvendor = PCI_ANY_ID,
835 .subdevice = PCI_ANY_ID,
836 .init = pci_siig10x_init,
837 .setup = pci_default_setup,
838 },
839 {
840 .vendor = PCI_VENDOR_ID_SIIG,
841 .device = PCI_DEVICE_ID_SIIG_1S_20x_550,
842 .subvendor = PCI_ANY_ID,
843 .subdevice = PCI_ANY_ID,
844 .init = pci_siig20x_init,
845 .setup = pci_default_setup,
846 },
847 {
848 .vendor = PCI_VENDOR_ID_SIIG,
849 .device = PCI_DEVICE_ID_SIIG_1S_20x_650,
850 .subvendor = PCI_ANY_ID,
851 .subdevice = PCI_ANY_ID,
852 .init = pci_siig20x_init,
853 .setup = pci_default_setup,
854 },
855 {
856 .vendor = PCI_VENDOR_ID_SIIG,
857 .device = PCI_DEVICE_ID_SIIG_1S_20x_850,
858 .subvendor = PCI_ANY_ID,
859 .subdevice = PCI_ANY_ID,
860 .init = pci_siig20x_init,
861 .setup = pci_default_setup,
862 },
863 {
864 .vendor = PCI_VENDOR_ID_SIIG,
865 .device = PCI_DEVICE_ID_SIIG_2S_20x_550,
866 .subvendor = PCI_ANY_ID,
867 .subdevice = PCI_ANY_ID,
868 .init = pci_siig20x_init,
869 .setup = pci_default_setup,
870 },
871 { .vendor = PCI_VENDOR_ID_SIIG,
872 .device = PCI_DEVICE_ID_SIIG_2S_20x_650,
873 .subvendor = PCI_ANY_ID,
874 .subdevice = PCI_ANY_ID,
875 .init = pci_siig20x_init,
876 .setup = pci_default_setup,
877 },
878 {
879 .vendor = PCI_VENDOR_ID_SIIG,
880 .device = PCI_DEVICE_ID_SIIG_2S_20x_850,
881 .subvendor = PCI_ANY_ID,
882 .subdevice = PCI_ANY_ID,
883 .init = pci_siig20x_init,
884 .setup = pci_default_setup,
885 },
886 {
887 .vendor = PCI_VENDOR_ID_SIIG,
888 .device = PCI_DEVICE_ID_SIIG_4S_20x_550,
889 .subvendor = PCI_ANY_ID,
890 .subdevice = PCI_ANY_ID,
891 .init = pci_siig20x_init,
892 .setup = pci_default_setup,
893 },
894 {
895 .vendor = PCI_VENDOR_ID_SIIG,
896 .device = PCI_DEVICE_ID_SIIG_4S_20x_650,
897 .subvendor = PCI_ANY_ID,
898 .subdevice = PCI_ANY_ID,
899 .init = pci_siig20x_init,
900 .setup = pci_default_setup,
901 },
902 {
903 .vendor = PCI_VENDOR_ID_SIIG,
904 .device = PCI_DEVICE_ID_SIIG_4S_20x_850,
905 .subvendor = PCI_ANY_ID,
906 .subdevice = PCI_ANY_ID,
907 .init = pci_siig20x_init,
908 .setup = pci_default_setup,
909 },
910 /*
911 * Titan cards
912 */
913 {
914 .vendor = PCI_VENDOR_ID_TITAN,
915 .device = PCI_DEVICE_ID_TITAN_400L,
916 .subvendor = PCI_ANY_ID,
917 .subdevice = PCI_ANY_ID,
918 .setup = titan_400l_800l_setup,
919 },
920 {
921 .vendor = PCI_VENDOR_ID_TITAN,
922 .device = PCI_DEVICE_ID_TITAN_800L,
923 .subvendor = PCI_ANY_ID,
924 .subdevice = PCI_ANY_ID,
925 .setup = titan_400l_800l_setup,
926 },
927 /*
928 * Timedia cards
929 */
930 {
931 .vendor = PCI_VENDOR_ID_TIMEDIA,
932 .device = PCI_DEVICE_ID_TIMEDIA_1889,
933 .subvendor = PCI_VENDOR_ID_TIMEDIA,
934 .subdevice = PCI_ANY_ID,
935 .init = pci_timedia_init,
936 .setup = pci_timedia_setup,
937 },
938 {
939 .vendor = PCI_VENDOR_ID_TIMEDIA,
940 .device = PCI_ANY_ID,
941 .subvendor = PCI_ANY_ID,
942 .subdevice = PCI_ANY_ID,
943 .setup = pci_timedia_setup,
944 },
945 /*
946 * Xircom cards
947 */
948 {
949 .vendor = PCI_VENDOR_ID_XIRCOM,
950 .device = PCI_DEVICE_ID_XIRCOM_X3201_MDM,
951 .subvendor = PCI_ANY_ID,
952 .subdevice = PCI_ANY_ID,
953 .init = pci_xircom_init,
954 .setup = pci_default_setup,
955 },
956 /*
957 * Netmos cards
958 */
959 {
960 .vendor = PCI_VENDOR_ID_NETMOS,
961 .device = PCI_ANY_ID,
962 .subvendor = PCI_ANY_ID,
963 .subdevice = PCI_ANY_ID,
964 .init = pci_netmos_init,
965 .setup = pci_default_setup,
966 },
967 /*
968 * Default "match everything" terminator entry
969 */
970 {
971 .vendor = PCI_ANY_ID,
972 .device = PCI_ANY_ID,
973 .subvendor = PCI_ANY_ID,
974 .subdevice = PCI_ANY_ID,
975 .setup = pci_default_setup,
976 }
977};
978
979static inline int quirk_id_matches(u32 quirk_id, u32 dev_id)
980{
981 return quirk_id == PCI_ANY_ID || quirk_id == dev_id;
982}
983
984static struct pci_serial_quirk *find_quirk(struct pci_dev *dev)
985{
986 struct pci_serial_quirk *quirk;
987
988 for (quirk = pci_serial_quirks; ; quirk++)
989 if (quirk_id_matches(quirk->vendor, dev->vendor) &&
990 quirk_id_matches(quirk->device, dev->device) &&
991 quirk_id_matches(quirk->subvendor, dev->subsystem_vendor) &&
992 quirk_id_matches(quirk->subdevice, dev->subsystem_device))
993 break;
994 return quirk;
995}
996
997static _INLINE_ int
Russell King72ce9a82005-07-27 11:32:04 +0100998get_pci_irq(struct pci_dev *dev, struct pciserial_board *board)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700999{
1000 if (board->flags & FL_NOIRQ)
1001 return 0;
1002 else
1003 return dev->irq;
1004}
1005
1006/*
1007 * This is the configuration table for all of the PCI serial boards
1008 * which we support. It is directly indexed by the pci_board_num_t enum
1009 * value, which is encoded in the pci_device_id PCI probe table's
1010 * driver_data member.
1011 *
1012 * The makeup of these names are:
1013 * pbn_bn{_bt}_n_baud
1014 *
1015 * bn = PCI BAR number
1016 * bt = Index using PCI BARs
1017 * n = number of serial ports
1018 * baud = baud rate
1019 *
Russell Kingf1690f32005-05-06 10:19:09 +01001020 * This table is sorted by (in order): baud, bt, bn, n.
1021 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07001022 * Please note: in theory if n = 1, _bt infix should make no difference.
1023 * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200
1024 */
1025enum pci_board_num_t {
1026 pbn_default = 0,
1027
1028 pbn_b0_1_115200,
1029 pbn_b0_2_115200,
1030 pbn_b0_4_115200,
1031 pbn_b0_5_115200,
1032
1033 pbn_b0_1_921600,
1034 pbn_b0_2_921600,
1035 pbn_b0_4_921600,
1036
Andrey Paninfbc0dc02005-07-18 11:38:09 +01001037 pbn_b0_4_1152000,
1038
Linus Torvalds1da177e2005-04-16 15:20:36 -07001039 pbn_b0_bt_1_115200,
1040 pbn_b0_bt_2_115200,
1041 pbn_b0_bt_8_115200,
1042
1043 pbn_b0_bt_1_460800,
1044 pbn_b0_bt_2_460800,
1045 pbn_b0_bt_4_460800,
1046
1047 pbn_b0_bt_1_921600,
1048 pbn_b0_bt_2_921600,
1049 pbn_b0_bt_4_921600,
1050 pbn_b0_bt_8_921600,
1051
1052 pbn_b1_1_115200,
1053 pbn_b1_2_115200,
1054 pbn_b1_4_115200,
1055 pbn_b1_8_115200,
1056
1057 pbn_b1_1_921600,
1058 pbn_b1_2_921600,
1059 pbn_b1_4_921600,
1060 pbn_b1_8_921600,
1061
1062 pbn_b1_bt_2_921600,
1063
1064 pbn_b1_1_1382400,
1065 pbn_b1_2_1382400,
1066 pbn_b1_4_1382400,
1067 pbn_b1_8_1382400,
1068
1069 pbn_b2_1_115200,
1070 pbn_b2_8_115200,
1071
1072 pbn_b2_1_460800,
1073 pbn_b2_4_460800,
1074 pbn_b2_8_460800,
1075 pbn_b2_16_460800,
1076
1077 pbn_b2_1_921600,
1078 pbn_b2_4_921600,
1079 pbn_b2_8_921600,
1080
1081 pbn_b2_bt_1_115200,
1082 pbn_b2_bt_2_115200,
1083 pbn_b2_bt_4_115200,
1084
1085 pbn_b2_bt_2_921600,
1086 pbn_b2_bt_4_921600,
1087
1088 pbn_b3_4_115200,
1089 pbn_b3_8_115200,
1090
1091 /*
1092 * Board-specific versions.
1093 */
1094 pbn_panacom,
1095 pbn_panacom2,
1096 pbn_panacom4,
1097 pbn_plx_romulus,
1098 pbn_oxsemi,
1099 pbn_intel_i960,
1100 pbn_sgi_ioc3,
1101 pbn_nec_nile4,
1102 pbn_computone_4,
1103 pbn_computone_6,
1104 pbn_computone_8,
1105 pbn_sbsxrsio,
1106 pbn_exar_XR17C152,
1107 pbn_exar_XR17C154,
1108 pbn_exar_XR17C158,
1109};
1110
1111/*
1112 * uart_offset - the space between channels
1113 * reg_shift - describes how the UART registers are mapped
1114 * to PCI memory by the card.
1115 * For example IER register on SBS, Inc. PMC-OctPro is located at
1116 * offset 0x10 from the UART base, while UART_IER is defined as 1
1117 * in include/linux/serial_reg.h,
1118 * see first lines of serial_in() and serial_out() in 8250.c
1119*/
1120
Russell King1c7c1fe2005-07-27 11:31:19 +01001121static struct pciserial_board pci_boards[] __devinitdata = {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001122 [pbn_default] = {
1123 .flags = FL_BASE0,
1124 .num_ports = 1,
1125 .base_baud = 115200,
1126 .uart_offset = 8,
1127 },
1128 [pbn_b0_1_115200] = {
1129 .flags = FL_BASE0,
1130 .num_ports = 1,
1131 .base_baud = 115200,
1132 .uart_offset = 8,
1133 },
1134 [pbn_b0_2_115200] = {
1135 .flags = FL_BASE0,
1136 .num_ports = 2,
1137 .base_baud = 115200,
1138 .uart_offset = 8,
1139 },
1140 [pbn_b0_4_115200] = {
1141 .flags = FL_BASE0,
1142 .num_ports = 4,
1143 .base_baud = 115200,
1144 .uart_offset = 8,
1145 },
1146 [pbn_b0_5_115200] = {
1147 .flags = FL_BASE0,
1148 .num_ports = 5,
1149 .base_baud = 115200,
1150 .uart_offset = 8,
1151 },
1152
1153 [pbn_b0_1_921600] = {
1154 .flags = FL_BASE0,
1155 .num_ports = 1,
1156 .base_baud = 921600,
1157 .uart_offset = 8,
1158 },
1159 [pbn_b0_2_921600] = {
1160 .flags = FL_BASE0,
1161 .num_ports = 2,
1162 .base_baud = 921600,
1163 .uart_offset = 8,
1164 },
1165 [pbn_b0_4_921600] = {
1166 .flags = FL_BASE0,
1167 .num_ports = 4,
1168 .base_baud = 921600,
1169 .uart_offset = 8,
1170 },
Andrey Paninfbc0dc02005-07-18 11:38:09 +01001171 [pbn_b0_4_1152000] = {
1172 .flags = FL_BASE0,
1173 .num_ports = 4,
1174 .base_baud = 1152000,
1175 .uart_offset = 8,
1176 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001177
1178 [pbn_b0_bt_1_115200] = {
1179 .flags = FL_BASE0|FL_BASE_BARS,
1180 .num_ports = 1,
1181 .base_baud = 115200,
1182 .uart_offset = 8,
1183 },
1184 [pbn_b0_bt_2_115200] = {
1185 .flags = FL_BASE0|FL_BASE_BARS,
1186 .num_ports = 2,
1187 .base_baud = 115200,
1188 .uart_offset = 8,
1189 },
1190 [pbn_b0_bt_8_115200] = {
1191 .flags = FL_BASE0|FL_BASE_BARS,
1192 .num_ports = 8,
1193 .base_baud = 115200,
1194 .uart_offset = 8,
1195 },
1196
1197 [pbn_b0_bt_1_460800] = {
1198 .flags = FL_BASE0|FL_BASE_BARS,
1199 .num_ports = 1,
1200 .base_baud = 460800,
1201 .uart_offset = 8,
1202 },
1203 [pbn_b0_bt_2_460800] = {
1204 .flags = FL_BASE0|FL_BASE_BARS,
1205 .num_ports = 2,
1206 .base_baud = 460800,
1207 .uart_offset = 8,
1208 },
1209 [pbn_b0_bt_4_460800] = {
1210 .flags = FL_BASE0|FL_BASE_BARS,
1211 .num_ports = 4,
1212 .base_baud = 460800,
1213 .uart_offset = 8,
1214 },
1215
1216 [pbn_b0_bt_1_921600] = {
1217 .flags = FL_BASE0|FL_BASE_BARS,
1218 .num_ports = 1,
1219 .base_baud = 921600,
1220 .uart_offset = 8,
1221 },
1222 [pbn_b0_bt_2_921600] = {
1223 .flags = FL_BASE0|FL_BASE_BARS,
1224 .num_ports = 2,
1225 .base_baud = 921600,
1226 .uart_offset = 8,
1227 },
1228 [pbn_b0_bt_4_921600] = {
1229 .flags = FL_BASE0|FL_BASE_BARS,
1230 .num_ports = 4,
1231 .base_baud = 921600,
1232 .uart_offset = 8,
1233 },
1234 [pbn_b0_bt_8_921600] = {
1235 .flags = FL_BASE0|FL_BASE_BARS,
1236 .num_ports = 8,
1237 .base_baud = 921600,
1238 .uart_offset = 8,
1239 },
1240
1241 [pbn_b1_1_115200] = {
1242 .flags = FL_BASE1,
1243 .num_ports = 1,
1244 .base_baud = 115200,
1245 .uart_offset = 8,
1246 },
1247 [pbn_b1_2_115200] = {
1248 .flags = FL_BASE1,
1249 .num_ports = 2,
1250 .base_baud = 115200,
1251 .uart_offset = 8,
1252 },
1253 [pbn_b1_4_115200] = {
1254 .flags = FL_BASE1,
1255 .num_ports = 4,
1256 .base_baud = 115200,
1257 .uart_offset = 8,
1258 },
1259 [pbn_b1_8_115200] = {
1260 .flags = FL_BASE1,
1261 .num_ports = 8,
1262 .base_baud = 115200,
1263 .uart_offset = 8,
1264 },
1265
1266 [pbn_b1_1_921600] = {
1267 .flags = FL_BASE1,
1268 .num_ports = 1,
1269 .base_baud = 921600,
1270 .uart_offset = 8,
1271 },
1272 [pbn_b1_2_921600] = {
1273 .flags = FL_BASE1,
1274 .num_ports = 2,
1275 .base_baud = 921600,
1276 .uart_offset = 8,
1277 },
1278 [pbn_b1_4_921600] = {
1279 .flags = FL_BASE1,
1280 .num_ports = 4,
1281 .base_baud = 921600,
1282 .uart_offset = 8,
1283 },
1284 [pbn_b1_8_921600] = {
1285 .flags = FL_BASE1,
1286 .num_ports = 8,
1287 .base_baud = 921600,
1288 .uart_offset = 8,
1289 },
1290
1291 [pbn_b1_bt_2_921600] = {
1292 .flags = FL_BASE1|FL_BASE_BARS,
1293 .num_ports = 2,
1294 .base_baud = 921600,
1295 .uart_offset = 8,
1296 },
1297
1298 [pbn_b1_1_1382400] = {
1299 .flags = FL_BASE1,
1300 .num_ports = 1,
1301 .base_baud = 1382400,
1302 .uart_offset = 8,
1303 },
1304 [pbn_b1_2_1382400] = {
1305 .flags = FL_BASE1,
1306 .num_ports = 2,
1307 .base_baud = 1382400,
1308 .uart_offset = 8,
1309 },
1310 [pbn_b1_4_1382400] = {
1311 .flags = FL_BASE1,
1312 .num_ports = 4,
1313 .base_baud = 1382400,
1314 .uart_offset = 8,
1315 },
1316 [pbn_b1_8_1382400] = {
1317 .flags = FL_BASE1,
1318 .num_ports = 8,
1319 .base_baud = 1382400,
1320 .uart_offset = 8,
1321 },
1322
1323 [pbn_b2_1_115200] = {
1324 .flags = FL_BASE2,
1325 .num_ports = 1,
1326 .base_baud = 115200,
1327 .uart_offset = 8,
1328 },
1329 [pbn_b2_8_115200] = {
1330 .flags = FL_BASE2,
1331 .num_ports = 8,
1332 .base_baud = 115200,
1333 .uart_offset = 8,
1334 },
1335
1336 [pbn_b2_1_460800] = {
1337 .flags = FL_BASE2,
1338 .num_ports = 1,
1339 .base_baud = 460800,
1340 .uart_offset = 8,
1341 },
1342 [pbn_b2_4_460800] = {
1343 .flags = FL_BASE2,
1344 .num_ports = 4,
1345 .base_baud = 460800,
1346 .uart_offset = 8,
1347 },
1348 [pbn_b2_8_460800] = {
1349 .flags = FL_BASE2,
1350 .num_ports = 8,
1351 .base_baud = 460800,
1352 .uart_offset = 8,
1353 },
1354 [pbn_b2_16_460800] = {
1355 .flags = FL_BASE2,
1356 .num_ports = 16,
1357 .base_baud = 460800,
1358 .uart_offset = 8,
1359 },
1360
1361 [pbn_b2_1_921600] = {
1362 .flags = FL_BASE2,
1363 .num_ports = 1,
1364 .base_baud = 921600,
1365 .uart_offset = 8,
1366 },
1367 [pbn_b2_4_921600] = {
1368 .flags = FL_BASE2,
1369 .num_ports = 4,
1370 .base_baud = 921600,
1371 .uart_offset = 8,
1372 },
1373 [pbn_b2_8_921600] = {
1374 .flags = FL_BASE2,
1375 .num_ports = 8,
1376 .base_baud = 921600,
1377 .uart_offset = 8,
1378 },
1379
1380 [pbn_b2_bt_1_115200] = {
1381 .flags = FL_BASE2|FL_BASE_BARS,
1382 .num_ports = 1,
1383 .base_baud = 115200,
1384 .uart_offset = 8,
1385 },
1386 [pbn_b2_bt_2_115200] = {
1387 .flags = FL_BASE2|FL_BASE_BARS,
1388 .num_ports = 2,
1389 .base_baud = 115200,
1390 .uart_offset = 8,
1391 },
1392 [pbn_b2_bt_4_115200] = {
1393 .flags = FL_BASE2|FL_BASE_BARS,
1394 .num_ports = 4,
1395 .base_baud = 115200,
1396 .uart_offset = 8,
1397 },
1398
1399 [pbn_b2_bt_2_921600] = {
1400 .flags = FL_BASE2|FL_BASE_BARS,
1401 .num_ports = 2,
1402 .base_baud = 921600,
1403 .uart_offset = 8,
1404 },
1405 [pbn_b2_bt_4_921600] = {
1406 .flags = FL_BASE2|FL_BASE_BARS,
1407 .num_ports = 4,
1408 .base_baud = 921600,
1409 .uart_offset = 8,
1410 },
1411
1412 [pbn_b3_4_115200] = {
1413 .flags = FL_BASE3,
1414 .num_ports = 4,
1415 .base_baud = 115200,
1416 .uart_offset = 8,
1417 },
1418 [pbn_b3_8_115200] = {
1419 .flags = FL_BASE3,
1420 .num_ports = 8,
1421 .base_baud = 115200,
1422 .uart_offset = 8,
1423 },
1424
1425 /*
1426 * Entries following this are board-specific.
1427 */
1428
1429 /*
1430 * Panacom - IOMEM
1431 */
1432 [pbn_panacom] = {
1433 .flags = FL_BASE2,
1434 .num_ports = 2,
1435 .base_baud = 921600,
1436 .uart_offset = 0x400,
1437 .reg_shift = 7,
1438 },
1439 [pbn_panacom2] = {
1440 .flags = FL_BASE2|FL_BASE_BARS,
1441 .num_ports = 2,
1442 .base_baud = 921600,
1443 .uart_offset = 0x400,
1444 .reg_shift = 7,
1445 },
1446 [pbn_panacom4] = {
1447 .flags = FL_BASE2|FL_BASE_BARS,
1448 .num_ports = 4,
1449 .base_baud = 921600,
1450 .uart_offset = 0x400,
1451 .reg_shift = 7,
1452 },
1453
1454 /* I think this entry is broken - the first_offset looks wrong --rmk */
1455 [pbn_plx_romulus] = {
1456 .flags = FL_BASE2,
1457 .num_ports = 4,
1458 .base_baud = 921600,
1459 .uart_offset = 8 << 2,
1460 .reg_shift = 2,
1461 .first_offset = 0x03,
1462 },
1463
1464 /*
1465 * This board uses the size of PCI Base region 0 to
1466 * signal now many ports are available
1467 */
1468 [pbn_oxsemi] = {
1469 .flags = FL_BASE0|FL_REGION_SZ_CAP,
1470 .num_ports = 32,
1471 .base_baud = 115200,
1472 .uart_offset = 8,
1473 },
1474
1475 /*
1476 * EKF addition for i960 Boards form EKF with serial port.
1477 * Max 256 ports.
1478 */
1479 [pbn_intel_i960] = {
1480 .flags = FL_BASE0,
1481 .num_ports = 32,
1482 .base_baud = 921600,
1483 .uart_offset = 8 << 2,
1484 .reg_shift = 2,
1485 .first_offset = 0x10000,
1486 },
1487 [pbn_sgi_ioc3] = {
1488 .flags = FL_BASE0|FL_NOIRQ,
1489 .num_ports = 1,
1490 .base_baud = 458333,
1491 .uart_offset = 8,
1492 .reg_shift = 0,
1493 .first_offset = 0x20178,
1494 },
1495
1496 /*
1497 * NEC Vrc-5074 (Nile 4) builtin UART.
1498 */
1499 [pbn_nec_nile4] = {
1500 .flags = FL_BASE0,
1501 .num_ports = 1,
1502 .base_baud = 520833,
1503 .uart_offset = 8 << 3,
1504 .reg_shift = 3,
1505 .first_offset = 0x300,
1506 },
1507
1508 /*
1509 * Computone - uses IOMEM.
1510 */
1511 [pbn_computone_4] = {
1512 .flags = FL_BASE0,
1513 .num_ports = 4,
1514 .base_baud = 921600,
1515 .uart_offset = 0x40,
1516 .reg_shift = 2,
1517 .first_offset = 0x200,
1518 },
1519 [pbn_computone_6] = {
1520 .flags = FL_BASE0,
1521 .num_ports = 6,
1522 .base_baud = 921600,
1523 .uart_offset = 0x40,
1524 .reg_shift = 2,
1525 .first_offset = 0x200,
1526 },
1527 [pbn_computone_8] = {
1528 .flags = FL_BASE0,
1529 .num_ports = 8,
1530 .base_baud = 921600,
1531 .uart_offset = 0x40,
1532 .reg_shift = 2,
1533 .first_offset = 0x200,
1534 },
1535 [pbn_sbsxrsio] = {
1536 .flags = FL_BASE0,
1537 .num_ports = 8,
1538 .base_baud = 460800,
1539 .uart_offset = 256,
1540 .reg_shift = 4,
1541 },
1542 /*
1543 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
1544 * Only basic 16550A support.
1545 * XR17C15[24] are not tested, but they should work.
1546 */
1547 [pbn_exar_XR17C152] = {
1548 .flags = FL_BASE0,
1549 .num_ports = 2,
1550 .base_baud = 921600,
1551 .uart_offset = 0x200,
1552 },
1553 [pbn_exar_XR17C154] = {
1554 .flags = FL_BASE0,
1555 .num_ports = 4,
1556 .base_baud = 921600,
1557 .uart_offset = 0x200,
1558 },
1559 [pbn_exar_XR17C158] = {
1560 .flags = FL_BASE0,
1561 .num_ports = 8,
1562 .base_baud = 921600,
1563 .uart_offset = 0x200,
1564 },
1565};
1566
1567/*
1568 * Given a complete unknown PCI device, try to use some heuristics to
1569 * guess what the configuration might be, based on the pitiful PCI
1570 * serial specs. Returns 0 on success, 1 on failure.
1571 */
1572static int __devinit
Russell King1c7c1fe2005-07-27 11:31:19 +01001573serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001574{
1575 int num_iomem, num_port, first_port = -1, i;
1576
1577 /*
1578 * If it is not a communications device or the programming
1579 * interface is greater than 6, give up.
1580 *
1581 * (Should we try to make guesses for multiport serial devices
1582 * later?)
1583 */
1584 if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) &&
1585 ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) ||
1586 (dev->class & 0xff) > 6)
1587 return -ENODEV;
1588
1589 num_iomem = num_port = 0;
1590 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
1591 if (pci_resource_flags(dev, i) & IORESOURCE_IO) {
1592 num_port++;
1593 if (first_port == -1)
1594 first_port = i;
1595 }
1596 if (pci_resource_flags(dev, i) & IORESOURCE_MEM)
1597 num_iomem++;
1598 }
1599
1600 /*
1601 * If there is 1 or 0 iomem regions, and exactly one port,
1602 * use it. We guess the number of ports based on the IO
1603 * region size.
1604 */
1605 if (num_iomem <= 1 && num_port == 1) {
1606 board->flags = first_port;
1607 board->num_ports = pci_resource_len(dev, first_port) / 8;
1608 return 0;
1609 }
1610
1611 /*
1612 * Now guess if we've got a board which indexes by BARs.
1613 * Each IO BAR should be 8 bytes, and they should follow
1614 * consecutively.
1615 */
1616 first_port = -1;
1617 num_port = 0;
1618 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
1619 if (pci_resource_flags(dev, i) & IORESOURCE_IO &&
1620 pci_resource_len(dev, i) == 8 &&
1621 (first_port == -1 || (first_port + num_port) == i)) {
1622 num_port++;
1623 if (first_port == -1)
1624 first_port = i;
1625 }
1626 }
1627
1628 if (num_port > 1) {
1629 board->flags = first_port | FL_BASE_BARS;
1630 board->num_ports = num_port;
1631 return 0;
1632 }
1633
1634 return -ENODEV;
1635}
1636
1637static inline int
Russell King1c7c1fe2005-07-27 11:31:19 +01001638serial_pci_matches(struct pciserial_board *board,
1639 struct pciserial_board *guessed)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001640{
1641 return
1642 board->num_ports == guessed->num_ports &&
1643 board->base_baud == guessed->base_baud &&
1644 board->uart_offset == guessed->uart_offset &&
1645 board->reg_shift == guessed->reg_shift &&
1646 board->first_offset == guessed->first_offset;
1647}
1648
1649/*
1650 * Probe one serial board. Unfortunately, there is no rhyme nor reason
1651 * to the arrangement of serial ports on a PCI card.
1652 */
1653static int __devinit
1654pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
1655{
Russell King72ce9a82005-07-27 11:32:04 +01001656 struct uart_port serial_port;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001657 struct serial_private *priv;
Russell King1c7c1fe2005-07-27 11:31:19 +01001658 struct pciserial_board *board, tmp;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001659 struct pci_serial_quirk *quirk;
1660 int rc, nr_ports, i;
1661
1662 if (ent->driver_data >= ARRAY_SIZE(pci_boards)) {
1663 printk(KERN_ERR "pci_init_one: invalid driver_data: %ld\n",
1664 ent->driver_data);
1665 return -EINVAL;
1666 }
1667
1668 board = &pci_boards[ent->driver_data];
1669
1670 rc = pci_enable_device(dev);
1671 if (rc)
1672 return rc;
1673
1674 if (ent->driver_data == pbn_default) {
1675 /*
1676 * Use a copy of the pci_board entry for this;
1677 * avoid changing entries in the table.
1678 */
Russell King1c7c1fe2005-07-27 11:31:19 +01001679 memcpy(&tmp, board, sizeof(struct pciserial_board));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001680 board = &tmp;
1681
1682 /*
1683 * We matched one of our class entries. Try to
1684 * determine the parameters of this board.
1685 */
1686 rc = serial_pci_guess_board(dev, board);
1687 if (rc)
1688 goto disable;
1689 } else {
1690 /*
1691 * We matched an explicit entry. If we are able to
1692 * detect this boards settings with our heuristic,
1693 * then we no longer need this entry.
1694 */
Russell King1c7c1fe2005-07-27 11:31:19 +01001695 memcpy(&tmp, &pci_boards[pbn_default],
1696 sizeof(struct pciserial_board));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001697 rc = serial_pci_guess_board(dev, &tmp);
1698 if (rc == 0 && serial_pci_matches(board, &tmp))
1699 moan_device("Redundant entry in serial pci_table.",
1700 dev);
1701 }
1702
1703 nr_ports = board->num_ports;
1704
1705 /*
1706 * Find an init and setup quirks.
1707 */
1708 quirk = find_quirk(dev);
1709
1710 /*
1711 * Run the new-style initialization function.
1712 * The initialization function returns:
1713 * <0 - error
1714 * 0 - use board->num_ports
1715 * >0 - number of ports
1716 */
1717 if (quirk->init) {
1718 rc = quirk->init(dev);
1719 if (rc < 0)
1720 goto disable;
1721 if (rc)
1722 nr_ports = rc;
1723 }
1724
1725 priv = kmalloc(sizeof(struct serial_private) +
1726 sizeof(unsigned int) * nr_ports,
1727 GFP_KERNEL);
1728 if (!priv) {
1729 rc = -ENOMEM;
1730 goto deinit;
1731 }
1732
1733 memset(priv, 0, sizeof(struct serial_private) +
1734 sizeof(unsigned int) * nr_ports);
1735
1736 priv->quirk = quirk;
1737 pci_set_drvdata(dev, priv);
1738
Russell King72ce9a82005-07-27 11:32:04 +01001739 memset(&serial_port, 0, sizeof(struct uart_port));
1740 serial_port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
1741 serial_port.uartclk = board->base_baud * 16;
1742 serial_port.irq = get_pci_irq(dev, board);
1743 serial_port.dev = &dev->dev;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001744
Russell King72ce9a82005-07-27 11:32:04 +01001745 for (i = 0; i < nr_ports; i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001746 if (quirk->setup(dev, board, &serial_port, i))
1747 break;
Russell King72ce9a82005-07-27 11:32:04 +01001748
Linus Torvalds1da177e2005-04-16 15:20:36 -07001749#ifdef SERIAL_DEBUG_PCI
1750 printk("Setup PCI port: port %x, irq %d, type %d\n",
1751 serial_port.iobase, serial_port.irq, serial_port.iotype);
1752#endif
1753
1754 priv->line[i] = serial8250_register_port(&serial_port);
1755 if (priv->line[i] < 0) {
1756 printk(KERN_WARNING "Couldn't register serial port %s: %d\n", pci_name(dev), priv->line[i]);
1757 break;
1758 }
1759 }
1760
1761 priv->nr = i;
1762
1763 return 0;
1764
1765 deinit:
1766 if (quirk->exit)
1767 quirk->exit(dev);
1768 disable:
1769 pci_disable_device(dev);
1770 return rc;
1771}
1772
1773static void __devexit pciserial_remove_one(struct pci_dev *dev)
1774{
1775 struct serial_private *priv = pci_get_drvdata(dev);
Russell King056a8762005-07-22 10:15:04 +01001776 struct pci_serial_quirk *quirk;
1777 int i;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001778
1779 pci_set_drvdata(dev, NULL);
1780
Russell King056a8762005-07-22 10:15:04 +01001781 for (i = 0; i < priv->nr; i++)
1782 serial8250_unregister_port(priv->line[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001783
Russell King056a8762005-07-22 10:15:04 +01001784 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
1785 if (priv->remapped_bar[i])
1786 iounmap(priv->remapped_bar[i]);
1787 priv->remapped_bar[i] = NULL;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001788 }
Russell King056a8762005-07-22 10:15:04 +01001789
1790 /*
1791 * Find the exit quirks.
1792 */
1793 quirk = find_quirk(dev);
1794 if (quirk->exit)
1795 quirk->exit(dev);
1796
1797 pci_disable_device(dev);
1798
1799 kfree(priv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001800}
1801
1802static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
1803{
1804 struct serial_private *priv = pci_get_drvdata(dev);
1805
1806 if (priv) {
1807 int i;
1808
1809 for (i = 0; i < priv->nr; i++)
1810 serial8250_suspend_port(priv->line[i]);
1811 }
1812 pci_save_state(dev);
1813 pci_set_power_state(dev, pci_choose_state(dev, state));
1814 return 0;
1815}
1816
1817static int pciserial_resume_one(struct pci_dev *dev)
1818{
1819 struct serial_private *priv = pci_get_drvdata(dev);
1820
1821 pci_set_power_state(dev, PCI_D0);
1822 pci_restore_state(dev);
1823
1824 if (priv) {
1825 int i;
1826
1827 /*
1828 * The device may have been disabled. Re-enable it.
1829 */
1830 pci_enable_device(dev);
1831
1832 /*
1833 * Ensure that the board is correctly configured.
1834 */
1835 if (priv->quirk->init)
1836 priv->quirk->init(dev);
1837
1838 for (i = 0; i < priv->nr; i++)
1839 serial8250_resume_port(priv->line[i]);
1840 }
1841 return 0;
1842}
1843
1844static struct pci_device_id serial_pci_tbl[] = {
1845 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
1846 PCI_SUBVENDOR_ID_CONNECT_TECH,
1847 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
1848 pbn_b1_8_1382400 },
1849 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
1850 PCI_SUBVENDOR_ID_CONNECT_TECH,
1851 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
1852 pbn_b1_4_1382400 },
1853 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
1854 PCI_SUBVENDOR_ID_CONNECT_TECH,
1855 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
1856 pbn_b1_2_1382400 },
1857 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1858 PCI_SUBVENDOR_ID_CONNECT_TECH,
1859 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
1860 pbn_b1_8_1382400 },
1861 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1862 PCI_SUBVENDOR_ID_CONNECT_TECH,
1863 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
1864 pbn_b1_4_1382400 },
1865 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1866 PCI_SUBVENDOR_ID_CONNECT_TECH,
1867 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
1868 pbn_b1_2_1382400 },
1869 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1870 PCI_SUBVENDOR_ID_CONNECT_TECH,
1871 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485, 0, 0,
1872 pbn_b1_8_921600 },
1873 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1874 PCI_SUBVENDOR_ID_CONNECT_TECH,
1875 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4, 0, 0,
1876 pbn_b1_8_921600 },
1877 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1878 PCI_SUBVENDOR_ID_CONNECT_TECH,
1879 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485, 0, 0,
1880 pbn_b1_4_921600 },
1881 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1882 PCI_SUBVENDOR_ID_CONNECT_TECH,
1883 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2, 0, 0,
1884 pbn_b1_4_921600 },
1885 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1886 PCI_SUBVENDOR_ID_CONNECT_TECH,
1887 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485, 0, 0,
1888 pbn_b1_2_921600 },
1889 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1890 PCI_SUBVENDOR_ID_CONNECT_TECH,
1891 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6, 0, 0,
1892 pbn_b1_8_921600 },
1893 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1894 PCI_SUBVENDOR_ID_CONNECT_TECH,
1895 PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1, 0, 0,
1896 pbn_b1_8_921600 },
1897 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
1898 PCI_SUBVENDOR_ID_CONNECT_TECH,
1899 PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1, 0, 0,
1900 pbn_b1_4_921600 },
1901
1902 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_U530,
1903 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1904 pbn_b2_bt_1_115200 },
1905 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM2,
1906 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1907 pbn_b2_bt_2_115200 },
1908 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM422,
1909 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1910 pbn_b2_bt_4_115200 },
1911 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM232,
1912 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1913 pbn_b2_bt_2_115200 },
1914 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM4,
1915 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1916 pbn_b2_bt_4_115200 },
1917 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8,
1918 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1919 pbn_b2_8_115200 },
1920 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8,
1921 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1922 pbn_b2_8_115200 },
1923
1924 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_GTEK_SERIAL2,
1925 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1926 pbn_b2_bt_2_115200 },
1927 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM200,
1928 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1929 pbn_b2_bt_2_921600 },
1930 /*
1931 * VScom SPCOM800, from sl@s.pl
1932 */
1933 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM800,
1934 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1935 pbn_b2_8_921600 },
1936 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_1077,
1937 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1938 pbn_b2_4_921600 },
1939 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1940 PCI_SUBVENDOR_ID_KEYSPAN,
1941 PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0,
1942 pbn_panacom },
1943 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_QUADMODEM,
1944 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1945 pbn_panacom4 },
1946 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM,
1947 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1948 pbn_panacom2 },
1949 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1950 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
1951 PCI_SUBDEVICE_ID_CHASE_PCIFAST4, 0, 0,
1952 pbn_b2_4_460800 },
1953 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1954 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
1955 PCI_SUBDEVICE_ID_CHASE_PCIFAST8, 0, 0,
1956 pbn_b2_8_460800 },
1957 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1958 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
1959 PCI_SUBDEVICE_ID_CHASE_PCIFAST16, 0, 0,
1960 pbn_b2_16_460800 },
1961 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1962 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
1963 PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC, 0, 0,
1964 pbn_b2_16_460800 },
1965 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1966 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
1967 PCI_SUBDEVICE_ID_CHASE_PCIRAS4, 0, 0,
1968 pbn_b2_4_460800 },
1969 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1970 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
1971 PCI_SUBDEVICE_ID_CHASE_PCIRAS8, 0, 0,
1972 pbn_b2_8_460800 },
1973 /*
1974 * Megawolf Romulus PCI Serial Card, from Mike Hudson
1975 * (Exoray@isys.ca)
1976 */
1977 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_ROMULUS,
1978 0x10b5, 0x106a, 0, 0,
1979 pbn_plx_romulus },
1980 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC100,
1981 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1982 pbn_b1_4_115200 },
1983 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100,
1984 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1985 pbn_b1_2_115200 },
1986 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100D,
1987 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1988 pbn_b1_8_115200 },
1989 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100M,
1990 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1991 pbn_b1_8_115200 },
1992 { PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_OXSEMI_16PCI954,
1993 PCI_VENDOR_ID_SPECIALIX, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4, 0, 0,
1994 pbn_b0_4_921600 },
1995 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
Andrey Paninfbc0dc02005-07-18 11:38:09 +01001996 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL, 0, 0,
1997 pbn_b0_4_1152000 },
1998 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001999 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2000 pbn_b0_4_115200 },
2001 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI952,
2002 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2003 pbn_b0_bt_2_921600 },
2004
2005 /*
2006 * SBS Technologies, Inc. P-Octal and PMC-OCTPRO cards,
2007 * from skokodyn@yahoo.com
2008 */
2009 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
2010 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO232, 0, 0,
2011 pbn_sbsxrsio },
2012 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
2013 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO422, 0, 0,
2014 pbn_sbsxrsio },
2015 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
2016 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL232, 0, 0,
2017 pbn_sbsxrsio },
2018 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
2019 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL422, 0, 0,
2020 pbn_sbsxrsio },
2021
2022 /*
2023 * Digitan DS560-558, from jimd@esoft.com
2024 */
2025 { PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_ATT_VENUS_MODEM,
2026 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2027 pbn_b1_1_115200 },
2028
2029 /*
2030 * Titan Electronic cards
2031 * The 400L and 800L have a custom setup quirk.
2032 */
2033 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100,
2034 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2035 pbn_b0_1_921600 },
2036 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200,
2037 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2038 pbn_b0_2_921600 },
2039 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400,
2040 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2041 pbn_b0_4_921600 },
2042 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800B,
2043 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2044 pbn_b0_4_921600 },
2045 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100L,
2046 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2047 pbn_b1_1_921600 },
2048 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200L,
2049 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2050 pbn_b1_bt_2_921600 },
2051 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400L,
2052 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2053 pbn_b0_bt_4_921600 },
2054 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800L,
2055 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2056 pbn_b0_bt_8_921600 },
2057
2058 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550,
2059 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2060 pbn_b2_1_460800 },
2061 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_650,
2062 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2063 pbn_b2_1_460800 },
2064 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_850,
2065 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2066 pbn_b2_1_460800 },
2067 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_550,
2068 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2069 pbn_b2_bt_2_921600 },
2070 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_650,
2071 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2072 pbn_b2_bt_2_921600 },
2073 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_850,
2074 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2075 pbn_b2_bt_2_921600 },
2076 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_550,
2077 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2078 pbn_b2_bt_4_921600 },
2079 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_650,
2080 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2081 pbn_b2_bt_4_921600 },
2082 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_850,
2083 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2084 pbn_b2_bt_4_921600 },
2085 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_550,
2086 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2087 pbn_b0_1_921600 },
2088 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_650,
2089 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2090 pbn_b0_1_921600 },
2091 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_850,
2092 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2093 pbn_b0_1_921600 },
2094 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_550,
2095 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2096 pbn_b0_bt_2_921600 },
2097 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_650,
2098 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2099 pbn_b0_bt_2_921600 },
2100 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_850,
2101 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2102 pbn_b0_bt_2_921600 },
2103 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_550,
2104 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2105 pbn_b0_bt_4_921600 },
2106 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_650,
2107 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2108 pbn_b0_bt_4_921600 },
2109 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_850,
2110 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2111 pbn_b0_bt_4_921600 },
2112
2113 /*
2114 * Computone devices submitted by Doug McNash dmcnash@computone.com
2115 */
2116 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
2117 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG4,
2118 0, 0, pbn_computone_4 },
2119 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
2120 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG8,
2121 0, 0, pbn_computone_8 },
2122 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
2123 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG6,
2124 0, 0, pbn_computone_6 },
2125
2126 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI95N,
2127 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2128 pbn_oxsemi },
2129 { PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
2130 PCI_VENDOR_ID_TIMEDIA, PCI_ANY_ID, 0, 0,
2131 pbn_b0_bt_1_921600 },
2132
2133 /*
2134 * AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org>
2135 */
2136 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028,
2137 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2138 pbn_b0_bt_8_115200 },
2139 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P030,
2140 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2141 pbn_b0_bt_8_115200 },
2142
2143 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL,
2144 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2145 pbn_b0_bt_2_115200 },
2146 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_A,
2147 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2148 pbn_b0_bt_2_115200 },
2149 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_B,
2150 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2151 pbn_b0_bt_2_115200 },
2152 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_A,
2153 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2154 pbn_b0_bt_4_460800 },
2155 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_B,
2156 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2157 pbn_b0_bt_4_460800 },
2158 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_PLUS,
2159 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2160 pbn_b0_bt_2_460800 },
2161 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_A,
2162 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2163 pbn_b0_bt_2_460800 },
2164 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_B,
2165 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2166 pbn_b0_bt_2_460800 },
2167 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_SSERIAL,
2168 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2169 pbn_b0_bt_1_115200 },
2170 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_650,
2171 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2172 pbn_b0_bt_1_460800 },
2173
2174 /*
2175 * Dell Remote Access Card 4 - Tim_T_Murphy@Dell.com
2176 */
2177 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,
2178 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2179 pbn_b1_1_1382400 },
2180
2181 /*
2182 * Dell Remote Access Card III - Tim_T_Murphy@Dell.com
2183 */
2184 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RACIII,
2185 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2186 pbn_b1_1_1382400 },
2187
2188 /*
2189 * RAStel 2 port modem, gerg@moreton.com.au
2190 */
2191 { PCI_VENDOR_ID_MORETON, PCI_DEVICE_ID_RASTEL_2PORT,
2192 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2193 pbn_b2_bt_2_115200 },
2194
2195 /*
2196 * EKF addition for i960 Boards form EKF with serial port
2197 */
2198 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80960_RP,
2199 0xE4BF, PCI_ANY_ID, 0, 0,
2200 pbn_intel_i960 },
2201
2202 /*
2203 * Xircom Cardbus/Ethernet combos
2204 */
2205 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_X3201_MDM,
2206 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2207 pbn_b0_1_115200 },
2208 /*
2209 * Xircom RBM56G cardbus modem - Dirk Arnold (temp entry)
2210 */
2211 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_RBM56G,
2212 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2213 pbn_b0_1_115200 },
2214
2215 /*
2216 * Untested PCI modems, sent in from various folks...
2217 */
2218
2219 /*
2220 * Elsa Model 56K PCI Modem, from Andreas Rath <arh@01019freenet.de>
2221 */
2222 { PCI_VENDOR_ID_ROCKWELL, 0x1004,
2223 0x1048, 0x1500, 0, 0,
2224 pbn_b1_1_115200 },
2225
2226 { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
2227 0xFF00, 0, 0, 0,
2228 pbn_sgi_ioc3 },
2229
2230 /*
2231 * HP Diva card
2232 */
2233 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
2234 PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_RMP3, 0, 0,
2235 pbn_b1_1_115200 },
2236 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
2237 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2238 pbn_b0_5_115200 },
2239 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_AUX,
2240 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2241 pbn_b2_1_115200 },
2242
2243 /*
2244 * NEC Vrc-5074 (Nile 4) builtin UART.
2245 */
2246 { PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_NILE4,
2247 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2248 pbn_nec_nile4 },
2249
2250 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM4,
2251 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2252 pbn_b3_4_115200 },
2253 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM8,
2254 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2255 pbn_b3_8_115200 },
2256
2257 /*
2258 * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
2259 */
2260 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
2261 PCI_ANY_ID, PCI_ANY_ID,
2262 0,
2263 0, pbn_exar_XR17C152 },
2264 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
2265 PCI_ANY_ID, PCI_ANY_ID,
2266 0,
2267 0, pbn_exar_XR17C154 },
2268 { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
2269 PCI_ANY_ID, PCI_ANY_ID,
2270 0,
2271 0, pbn_exar_XR17C158 },
2272
2273 /*
2274 * Topic TP560 Data/Fax/Voice 56k modem (reported by Evan Clarke)
2275 */
2276 { PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560,
2277 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2278 pbn_b0_1_115200 },
2279
2280 /*
2281 * These entries match devices with class COMMUNICATION_SERIAL,
2282 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
2283 */
2284 { PCI_ANY_ID, PCI_ANY_ID,
2285 PCI_ANY_ID, PCI_ANY_ID,
2286 PCI_CLASS_COMMUNICATION_SERIAL << 8,
2287 0xffff00, pbn_default },
2288 { PCI_ANY_ID, PCI_ANY_ID,
2289 PCI_ANY_ID, PCI_ANY_ID,
2290 PCI_CLASS_COMMUNICATION_MODEM << 8,
2291 0xffff00, pbn_default },
2292 { PCI_ANY_ID, PCI_ANY_ID,
2293 PCI_ANY_ID, PCI_ANY_ID,
2294 PCI_CLASS_COMMUNICATION_MULTISERIAL << 8,
2295 0xffff00, pbn_default },
2296 { 0, }
2297};
2298
2299static struct pci_driver serial_pci_driver = {
2300 .name = "serial",
2301 .probe = pciserial_init_one,
2302 .remove = __devexit_p(pciserial_remove_one),
2303 .suspend = pciserial_suspend_one,
2304 .resume = pciserial_resume_one,
2305 .id_table = serial_pci_tbl,
2306};
2307
2308static int __init serial8250_pci_init(void)
2309{
2310 return pci_register_driver(&serial_pci_driver);
2311}
2312
2313static void __exit serial8250_pci_exit(void)
2314{
2315 pci_unregister_driver(&serial_pci_driver);
2316}
2317
2318module_init(serial8250_pci_init);
2319module_exit(serial8250_pci_exit);
2320
2321MODULE_LICENSE("GPL");
2322MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module");
2323MODULE_DEVICE_TABLE(pci, serial_pci_tbl);