1
2
3
4
5
6
7
8
9
10
11
12#undef DEBUG
13#include <linux/module.h>
14#include <linux/pci.h>
15#include <linux/string.h>
16#include <linux/kernel.h>
17#include <linux/slab.h>
18#include <linux/delay.h>
19#include <linux/tty.h>
20#include <linux/serial_reg.h>
21#include <linux/serial_core.h>
22#include <linux/8250_pci.h>
23#include <linux/bitops.h>
24
25#include <asm/byteorder.h>
26#include <asm/io.h>
27
28#include "8250.h"
29
30
31
32
33
34
35
36struct pci_serial_quirk {
37 u32 vendor;
38 u32 device;
39 u32 subvendor;
40 u32 subdevice;
41 int (*probe)(struct pci_dev *dev);
42 int (*init)(struct pci_dev *dev);
43 int (*setup)(struct serial_private *,
44 const struct pciserial_board *,
45 struct uart_8250_port *, int);
46 void (*exit)(struct pci_dev *dev);
47};
48
49#define PCI_NUM_BAR_RESOURCES 6
50
51struct serial_private {
52 struct pci_dev *dev;
53 unsigned int nr;
54 struct pci_serial_quirk *quirk;
55 const struct pciserial_board *board;
56 int line[0];
57};
58
59static int pci_default_setup(struct serial_private*,
60 const struct pciserial_board*, struct uart_8250_port *, int);
61
62static void moan_device(const char *str, struct pci_dev *dev)
63{
64 dev_err(&dev->dev,
65 "%s: %s\n"
66 "Please send the output of lspci -vv, this\n"
67 "message (0x%04x,0x%04x,0x%04x,0x%04x), the\n"
68 "manufacturer and name of serial board or\n"
69 "modem board to <linux-serial@vger.kernel.org>.\n",
70 pci_name(dev), str, dev->vendor, dev->device,
71 dev->subsystem_vendor, dev->subsystem_device);
72}
73
74static int
75setup_port(struct serial_private *priv, struct uart_8250_port *port,
76 int bar, int offset, int regshift)
77{
78 struct pci_dev *dev = priv->dev;
79
80 if (bar >= PCI_NUM_BAR_RESOURCES)
81 return -EINVAL;
82
83 if (pci_resource_flags(dev, bar) & IORESOURCE_MEM) {
84 if (!pcim_iomap(dev, bar, 0) && !pcim_iomap_table(dev))
85 return -ENOMEM;
86
87 port->port.iotype = UPIO_MEM;
88 port->port.iobase = 0;
89 port->port.mapbase = pci_resource_start(dev, bar) + offset;
90 port->port.membase = pcim_iomap_table(dev)[bar] + offset;
91 port->port.regshift = regshift;
92 } else {
93 port->port.iotype = UPIO_PORT;
94 port->port.iobase = pci_resource_start(dev, bar) + offset;
95 port->port.mapbase = 0;
96 port->port.membase = NULL;
97 port->port.regshift = 0;
98 }
99 return 0;
100}
101
102
103
104
105static int addidata_apci7800_setup(struct serial_private *priv,
106 const struct pciserial_board *board,
107 struct uart_8250_port *port, int idx)
108{
109 unsigned int bar = 0, offset = board->first_offset;
110 bar = FL_GET_BASE(board->flags);
111
112 if (idx < 2) {
113 offset += idx * board->uart_offset;
114 } else if ((idx >= 2) && (idx < 4)) {
115 bar += 1;
116 offset += ((idx - 2) * board->uart_offset);
117 } else if ((idx >= 4) && (idx < 6)) {
118 bar += 2;
119 offset += ((idx - 4) * board->uart_offset);
120 } else if (idx >= 6) {
121 bar += 3;
122 offset += ((idx - 6) * board->uart_offset);
123 }
124
125 return setup_port(priv, port, bar, offset, board->reg_shift);
126}
127
128
129
130
131
132static int
133afavlab_setup(struct serial_private *priv, const struct pciserial_board *board,
134 struct uart_8250_port *port, int idx)
135{
136 unsigned int bar, offset = board->first_offset;
137
138 bar = FL_GET_BASE(board->flags);
139 if (idx < 4)
140 bar += idx;
141 else {
142 bar = 4;
143 offset += (idx - 4) * board->uart_offset;
144 }
145
146 return setup_port(priv, port, bar, offset, board->reg_shift);
147}
148
149
150
151
152
153
154
155
156static int pci_hp_diva_init(struct pci_dev *dev)
157{
158 int rc = 0;
159
160 switch (dev->subsystem_device) {
161 case PCI_DEVICE_ID_HP_DIVA_TOSCA1:
162 case PCI_DEVICE_ID_HP_DIVA_HALFDOME:
163 case PCI_DEVICE_ID_HP_DIVA_KEYSTONE:
164 case PCI_DEVICE_ID_HP_DIVA_EVEREST:
165 rc = 3;
166 break;
167 case PCI_DEVICE_ID_HP_DIVA_TOSCA2:
168 rc = 2;
169 break;
170 case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
171 rc = 4;
172 break;
173 case PCI_DEVICE_ID_HP_DIVA_POWERBAR:
174 case PCI_DEVICE_ID_HP_DIVA_HURRICANE:
175 rc = 1;
176 break;
177 }
178
179 return rc;
180}
181
182
183
184
185
186static int
187pci_hp_diva_setup(struct serial_private *priv,
188 const struct pciserial_board *board,
189 struct uart_8250_port *port, int idx)
190{
191 unsigned int offset = board->first_offset;
192 unsigned int bar = FL_GET_BASE(board->flags);
193
194 switch (priv->dev->subsystem_device) {
195 case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
196 if (idx == 3)
197 idx++;
198 break;
199 case PCI_DEVICE_ID_HP_DIVA_EVEREST:
200 if (idx > 0)
201 idx++;
202 if (idx > 2)
203 idx++;
204 break;
205 }
206 if (idx > 2)
207 offset = 0x18;
208
209 offset += idx * board->uart_offset;
210
211 return setup_port(priv, port, bar, offset, board->reg_shift);
212}
213
214
215
216
217static int pci_inteli960ni_init(struct pci_dev *dev)
218{
219 u32 oldval;
220
221 if (!(dev->subsystem_device & 0x1000))
222 return -ENODEV;
223
224
225 pci_read_config_dword(dev, 0x44, &oldval);
226 if (oldval == 0x00001000L) {
227 dev_dbg(&dev->dev, "Local i960 firmware missing\n");
228 return -ENODEV;
229 }
230 return 0;
231}
232
233
234
235
236
237
238
239static int pci_plx9050_init(struct pci_dev *dev)
240{
241 u8 irq_config;
242 void __iomem *p;
243
244 if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0) {
245 moan_device("no memory in bar 0", dev);
246 return 0;
247 }
248
249 irq_config = 0x41;
250 if (dev->vendor == PCI_VENDOR_ID_PANACOM ||
251 dev->subsystem_vendor == PCI_SUBVENDOR_ID_EXSYS)
252 irq_config = 0x43;
253
254 if ((dev->vendor == PCI_VENDOR_ID_PLX) &&
255 (dev->device == PCI_DEVICE_ID_PLX_ROMULUS))
256
257
258
259
260
261
262
263
264 irq_config = 0x5b;
265
266
267
268 p = ioremap_nocache(pci_resource_start(dev, 0), 0x80);
269 if (p == NULL)
270 return -ENOMEM;
271 writel(irq_config, p + 0x4c);
272
273
274
275
276 readl(p + 0x4c);
277 iounmap(p);
278
279 return 0;
280}
281
282static void pci_plx9050_exit(struct pci_dev *dev)
283{
284 u8 __iomem *p;
285
286 if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0)
287 return;
288
289
290
291
292 p = ioremap_nocache(pci_resource_start(dev, 0), 0x80);
293 if (p != NULL) {
294 writel(0, p + 0x4c);
295
296
297
298
299 readl(p + 0x4c);
300 iounmap(p);
301 }
302}
303
304#define NI8420_INT_ENABLE_REG 0x38
305#define NI8420_INT_ENABLE_BIT 0x2000
306
307static void pci_ni8420_exit(struct pci_dev *dev)
308{
309 void __iomem *p;
310 unsigned int bar = 0;
311
312 if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
313 moan_device("no memory in bar", dev);
314 return;
315 }
316
317 p = pci_ioremap_bar(dev, bar);
318 if (p == NULL)
319 return;
320
321
322 writel(readl(p + NI8420_INT_ENABLE_REG) & ~(NI8420_INT_ENABLE_BIT),
323 p + NI8420_INT_ENABLE_REG);
324 iounmap(p);
325}
326
327
328
329#define MITE_IOWBSR1 0xc4
330#define MITE_IOWCR1 0xf4
331#define MITE_LCIMR1 0x08
332#define MITE_LCIMR2 0x10
333
334#define MITE_LCIMR2_CLR_CPU_IE (1 << 30)
335
336static void pci_ni8430_exit(struct pci_dev *dev)
337{
338 void __iomem *p;
339 unsigned int bar = 0;
340
341 if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
342 moan_device("no memory in bar", dev);
343 return;
344 }
345
346 p = pci_ioremap_bar(dev, bar);
347 if (p == NULL)
348 return;
349
350
351 writel(MITE_LCIMR2_CLR_CPU_IE, p + MITE_LCIMR2);
352 iounmap(p);
353}
354
355
356static int
357sbs_setup(struct serial_private *priv, const struct pciserial_board *board,
358 struct uart_8250_port *port, int idx)
359{
360 unsigned int bar, offset = board->first_offset;
361
362 bar = 0;
363
364 if (idx < 4) {
365
366 offset += idx * board->uart_offset;
367 } else if (idx < 8) {
368
369 offset += idx * board->uart_offset + 0xC00;
370 } else
371 return 1;
372
373 return setup_port(priv, port, bar, offset, board->reg_shift);
374}
375
376
377
378
379
380
381
382
383
384#define OCT_REG_CR_OFF 0x500
385
386static int sbs_init(struct pci_dev *dev)
387{
388 u8 __iomem *p;
389
390 p = pci_ioremap_bar(dev, 0);
391
392 if (p == NULL)
393 return -ENOMEM;
394
395 writeb(0x10, p + OCT_REG_CR_OFF);
396 udelay(50);
397 writeb(0x0, p + OCT_REG_CR_OFF);
398
399
400 writeb(0x4, p + OCT_REG_CR_OFF);
401 iounmap(p);
402
403 return 0;
404}
405
406
407
408
409
410static void sbs_exit(struct pci_dev *dev)
411{
412 u8 __iomem *p;
413
414 p = pci_ioremap_bar(dev, 0);
415
416 if (p != NULL)
417 writeb(0, p + OCT_REG_CR_OFF);
418 iounmap(p);
419}
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448#define PCI_DEVICE_ID_SIIG_1S_10x (PCI_DEVICE_ID_SIIG_1S_10x_550 & 0xfffc)
449#define PCI_DEVICE_ID_SIIG_2S_10x (PCI_DEVICE_ID_SIIG_2S_10x_550 & 0xfff8)
450
451static int pci_siig10x_init(struct pci_dev *dev)
452{
453 u16 data;
454 void __iomem *p;
455
456 switch (dev->device & 0xfff8) {
457 case PCI_DEVICE_ID_SIIG_1S_10x:
458 data = 0xffdf;
459 break;
460 case PCI_DEVICE_ID_SIIG_2S_10x:
461 data = 0xf7ff;
462 break;
463 default:
464 data = 0xfffb;
465 break;
466 }
467
468 p = ioremap_nocache(pci_resource_start(dev, 0), 0x80);
469 if (p == NULL)
470 return -ENOMEM;
471
472 writew(readw(p + 0x28) & data, p + 0x28);
473 readw(p + 0x28);
474 iounmap(p);
475 return 0;
476}
477
478#define PCI_DEVICE_ID_SIIG_2S_20x (PCI_DEVICE_ID_SIIG_2S_20x_550 & 0xfffc)
479#define PCI_DEVICE_ID_SIIG_2S1P_20x (PCI_DEVICE_ID_SIIG_2S1P_20x_550 & 0xfffc)
480
481static int pci_siig20x_init(struct pci_dev *dev)
482{
483 u8 data;
484
485
486 pci_read_config_byte(dev, 0x6f, &data);
487 pci_write_config_byte(dev, 0x6f, data & 0xef);
488
489
490 if (((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S_20x) ||
491 ((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S1P_20x)) {
492 pci_read_config_byte(dev, 0x73, &data);
493 pci_write_config_byte(dev, 0x73, data & 0xef);
494 }
495 return 0;
496}
497
498static int pci_siig_init(struct pci_dev *dev)
499{
500 unsigned int type = dev->device & 0xff00;
501
502 if (type == 0x1000)
503 return pci_siig10x_init(dev);
504 else if (type == 0x2000)
505 return pci_siig20x_init(dev);
506
507 moan_device("Unknown SIIG card", dev);
508 return -ENODEV;
509}
510
511static int pci_siig_setup(struct serial_private *priv,
512 const struct pciserial_board *board,
513 struct uart_8250_port *port, int idx)
514{
515 unsigned int bar = FL_GET_BASE(board->flags) + idx, offset = 0;
516
517 if (idx > 3) {
518 bar = 4;
519 offset = (idx - 4) * 8;
520 }
521
522 return setup_port(priv, port, bar, offset, 0);
523}
524
525
526
527
528
529
530static const unsigned short timedia_single_port[] = {
531 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0
532};
533
534static const unsigned short timedia_dual_port[] = {
535 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
536 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079,
537 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079,
538 0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079,
539 0xD079, 0
540};
541
542static const unsigned short timedia_quad_port[] = {
543 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157,
544 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159,
545 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
546 0xB157, 0
547};
548
549static const unsigned short timedia_eight_port[] = {
550 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166,
551 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
552};
553
554static const struct timedia_struct {
555 int num;
556 const unsigned short *ids;
557} timedia_data[] = {
558 { 1, timedia_single_port },
559 { 2, timedia_dual_port },
560 { 4, timedia_quad_port },
561 { 8, timedia_eight_port }
562};
563
564
565
566
567
568
569
570static int pci_timedia_probe(struct pci_dev *dev)
571{
572
573
574
575
576 if ((dev->subsystem_device & 0x00f0) >= 0x70) {
577 dev_info(&dev->dev,
578 "ignoring Timedia subdevice %04x for parport_serial\n",
579 dev->subsystem_device);
580 return -ENODEV;
581 }
582
583 return 0;
584}
585
586static int pci_timedia_init(struct pci_dev *dev)
587{
588 const unsigned short *ids;
589 int i, j;
590
591 for (i = 0; i < ARRAY_SIZE(timedia_data); i++) {
592 ids = timedia_data[i].ids;
593 for (j = 0; ids[j]; j++)
594 if (dev->subsystem_device == ids[j])
595 return timedia_data[i].num;
596 }
597 return 0;
598}
599
600
601
602
603
604static int
605pci_timedia_setup(struct serial_private *priv,
606 const struct pciserial_board *board,
607 struct uart_8250_port *port, int idx)
608{
609 unsigned int bar = 0, offset = board->first_offset;
610
611 switch (idx) {
612 case 0:
613 bar = 0;
614 break;
615 case 1:
616 offset = board->uart_offset;
617 bar = 0;
618 break;
619 case 2:
620 bar = 1;
621 break;
622 case 3:
623 offset = board->uart_offset;
624
625 case 4:
626 case 5:
627 case 6:
628 case 7:
629 bar = idx - 2;
630 }
631
632 return setup_port(priv, port, bar, offset, board->reg_shift);
633}
634
635
636
637
638static int
639titan_400l_800l_setup(struct serial_private *priv,
640 const struct pciserial_board *board,
641 struct uart_8250_port *port, int idx)
642{
643 unsigned int bar, offset = board->first_offset;
644
645 switch (idx) {
646 case 0:
647 bar = 1;
648 break;
649 case 1:
650 bar = 2;
651 break;
652 default:
653 bar = 4;
654 offset = (idx - 2) * board->uart_offset;
655 }
656
657 return setup_port(priv, port, bar, offset, board->reg_shift);
658}
659
660static int pci_xircom_init(struct pci_dev *dev)
661{
662 msleep(100);
663 return 0;
664}
665
666static int pci_ni8420_init(struct pci_dev *dev)
667{
668 void __iomem *p;
669 unsigned int bar = 0;
670
671 if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
672 moan_device("no memory in bar", dev);
673 return 0;
674 }
675
676 p = pci_ioremap_bar(dev, bar);
677 if (p == NULL)
678 return -ENOMEM;
679
680
681 writel(readl(p + NI8420_INT_ENABLE_REG) | NI8420_INT_ENABLE_BIT,
682 p + NI8420_INT_ENABLE_REG);
683
684 iounmap(p);
685 return 0;
686}
687
688#define MITE_IOWBSR1_WSIZE 0xa
689#define MITE_IOWBSR1_WIN_OFFSET 0x800
690#define MITE_IOWBSR1_WENAB (1 << 7)
691#define MITE_LCIMR1_IO_IE_0 (1 << 24)
692#define MITE_LCIMR2_SET_CPU_IE (1 << 31)
693#define MITE_IOWCR1_RAMSEL_MASK 0xfffffffe
694
695static int pci_ni8430_init(struct pci_dev *dev)
696{
697 void __iomem *p;
698 struct pci_bus_region region;
699 u32 device_window;
700 unsigned int bar = 0;
701
702 if ((pci_resource_flags(dev, bar) & IORESOURCE_MEM) == 0) {
703 moan_device("no memory in bar", dev);
704 return 0;
705 }
706
707 p = pci_ioremap_bar(dev, bar);
708 if (p == NULL)
709 return -ENOMEM;
710
711
712
713
714
715
716 pcibios_resource_to_bus(dev->bus, ®ion, &dev->resource[bar]);
717 device_window = ((region.start + MITE_IOWBSR1_WIN_OFFSET) & 0xffffff00)
718 | MITE_IOWBSR1_WENAB | MITE_IOWBSR1_WSIZE;
719 writel(device_window, p + MITE_IOWBSR1);
720
721
722 writel((readl(p + MITE_IOWCR1) & MITE_IOWCR1_RAMSEL_MASK),
723 p + MITE_IOWCR1);
724
725
726 writel(MITE_LCIMR1_IO_IE_0, p + MITE_LCIMR1);
727
728
729 writel(MITE_LCIMR2_SET_CPU_IE, p + MITE_LCIMR2);
730
731 iounmap(p);
732 return 0;
733}
734
735
736#define NI8430_PORTCON 0x0f
737#define NI8430_PORTCON_TXVR_ENABLE (1 << 3)
738
739static int
740pci_ni8430_setup(struct serial_private *priv,
741 const struct pciserial_board *board,
742 struct uart_8250_port *port, int idx)
743{
744 struct pci_dev *dev = priv->dev;
745 void __iomem *p;
746 unsigned int bar, offset = board->first_offset;
747
748 if (idx >= board->num_ports)
749 return 1;
750
751 bar = FL_GET_BASE(board->flags);
752 offset += idx * board->uart_offset;
753
754 p = pci_ioremap_bar(dev, bar);
755 if (!p)
756 return -ENOMEM;
757
758
759 writeb(readb(p + offset + NI8430_PORTCON) | NI8430_PORTCON_TXVR_ENABLE,
760 p + offset + NI8430_PORTCON);
761
762 iounmap(p);
763
764 return setup_port(priv, port, bar, offset, board->reg_shift);
765}
766
767static int pci_netmos_9900_setup(struct serial_private *priv,
768 const struct pciserial_board *board,
769 struct uart_8250_port *port, int idx)
770{
771 unsigned int bar;
772
773 if ((priv->dev->device != PCI_DEVICE_ID_NETMOS_9865) &&
774 (priv->dev->subsystem_device & 0xff00) == 0x3000) {
775
776
777
778 bar = 3 * idx;
779
780 return setup_port(priv, port, bar, 0, board->reg_shift);
781 } else {
782 return pci_default_setup(priv, board, port, idx);
783 }
784}
785
786
787
788
789
790
791
792
793
794static int pci_netmos_9900_numports(struct pci_dev *dev)
795{
796 unsigned int c = dev->class;
797 unsigned int pi;
798 unsigned short sub_serports;
799
800 pi = c & 0xff;
801
802 if (pi == 2)
803 return 1;
804
805 if ((pi == 0) && (dev->device == PCI_DEVICE_ID_NETMOS_9900)) {
806
807
808
809
810
811
812 sub_serports = dev->subsystem_device & 0xf;
813 if (sub_serports > 0)
814 return sub_serports;
815
816 dev_err(&dev->dev,
817 "NetMos/Mostech serial driver ignoring port on ambiguous config.\n");
818 return 0;
819 }
820
821 moan_device("unknown NetMos/Mostech program interface", dev);
822 return 0;
823}
824
825static int pci_netmos_init(struct pci_dev *dev)
826{
827
828 unsigned int num_serial = dev->subsystem_device & 0xf;
829
830 if ((dev->device == PCI_DEVICE_ID_NETMOS_9901) ||
831 (dev->device == PCI_DEVICE_ID_NETMOS_9865))
832 return 0;
833
834 if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
835 dev->subsystem_device == 0x0299)
836 return 0;
837
838 switch (dev->device) {
839 case PCI_DEVICE_ID_NETMOS_9904:
840 case PCI_DEVICE_ID_NETMOS_9912:
841 case PCI_DEVICE_ID_NETMOS_9922:
842 case PCI_DEVICE_ID_NETMOS_9900:
843 num_serial = pci_netmos_9900_numports(dev);
844 break;
845
846 default:
847 break;
848 }
849
850 if (num_serial == 0) {
851 moan_device("unknown NetMos/Mostech device", dev);
852 return -ENODEV;
853 }
854
855 return num_serial;
856}
857
858
859
860
861
862
863
864
865
866
867
868
869#define ITE_887x_MISCR 0x9c
870#define ITE_887x_INTCBAR 0x78
871#define ITE_887x_UARTBAR 0x7c
872#define ITE_887x_PS0BAR 0x10
873#define ITE_887x_POSIO0 0x60
874
875
876#define ITE_887x_IOSIZE 32
877
878#define ITE_887x_POSIO_IOSIZE_8 (3 << 24)
879
880#define ITE_887x_POSIO_IOSIZE_32 (5 << 24)
881
882#define ITE_887x_POSIO_SPEED (3 << 29)
883
884#define ITE_887x_POSIO_ENABLE (1 << 31)
885
886static int pci_ite887x_init(struct pci_dev *dev)
887{
888
889 static const short inta_addr[] = { 0x2a0, 0x2c0, 0x220, 0x240, 0x1e0,
890 0x200, 0x280, 0 };
891 int ret, i, type;
892 struct resource *iobase = NULL;
893 u32 miscr, uartbar, ioport;
894
895
896 i = 0;
897 while (inta_addr[i] && iobase == NULL) {
898 iobase = request_region(inta_addr[i], ITE_887x_IOSIZE,
899 "ite887x");
900 if (iobase != NULL) {
901
902 pci_write_config_dword(dev, ITE_887x_POSIO0,
903 ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED |
904 ITE_887x_POSIO_IOSIZE_32 | inta_addr[i]);
905
906 pci_write_config_dword(dev, ITE_887x_INTCBAR,
907 inta_addr[i]);
908 ret = inb(inta_addr[i]);
909 if (ret != 0xff) {
910
911 break;
912 }
913 release_region(iobase->start, ITE_887x_IOSIZE);
914 iobase = NULL;
915 }
916 i++;
917 }
918
919 if (!inta_addr[i]) {
920 dev_err(&dev->dev, "ite887x: could not find iobase\n");
921 return -ENODEV;
922 }
923
924
925 type = inb(iobase->start + 0x18) & 0x0f;
926
927 switch (type) {
928 case 0x2:
929 case 0xa:
930 ret = 0;
931 break;
932 case 0xe:
933 ret = 2;
934 break;
935 case 0x6:
936 ret = 1;
937 break;
938 case 0x8:
939 ret = 2;
940 break;
941 default:
942 moan_device("Unknown ITE887x", dev);
943 ret = -ENODEV;
944 }
945
946
947 for (i = 0; i < ret; i++) {
948
949 pci_read_config_dword(dev, ITE_887x_PS0BAR + (0x4 * (i + 1)),
950 &ioport);
951 ioport &= 0x0000FF00;
952 pci_write_config_dword(dev, ITE_887x_POSIO0 + (0x4 * (i + 1)),
953 ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED |
954 ITE_887x_POSIO_IOSIZE_8 | ioport);
955
956
957 pci_read_config_dword(dev, ITE_887x_UARTBAR, &uartbar);
958 uartbar &= ~(0xffff << (16 * i));
959 uartbar |= (ioport << (16 * i));
960 pci_write_config_dword(dev, ITE_887x_UARTBAR, uartbar);
961
962
963 pci_read_config_dword(dev, ITE_887x_MISCR, &miscr);
964
965 miscr &= ~(0xf << (12 - 4 * i));
966
967 miscr |= 1 << (23 - i);
968
969 pci_write_config_dword(dev, ITE_887x_MISCR, miscr);
970 }
971
972 if (ret <= 0) {
973
974 release_region(iobase->start, ITE_887x_IOSIZE);
975 }
976
977 return ret;
978}
979
980static void pci_ite887x_exit(struct pci_dev *dev)
981{
982 u32 ioport;
983
984 pci_read_config_dword(dev, ITE_887x_POSIO0, &ioport);
985 ioport &= 0xffff;
986 release_region(ioport, ITE_887x_IOSIZE);
987}
988
989
990
991
992
993#define PCI_VENDOR_ID_ENDRUN 0x7401
994#define PCI_DEVICE_ID_ENDRUN_1588 0xe100
995
996static int pci_endrun_init(struct pci_dev *dev)
997{
998 u8 __iomem *p;
999 unsigned long deviceID;
1000 unsigned int number_uarts = 0;
1001
1002
1003 if (dev->vendor == PCI_VENDOR_ID_ENDRUN &&
1004 (dev->device & 0xf000) != 0xe000)
1005 return 0;
1006
1007 p = pci_iomap(dev, 0, 5);
1008 if (p == NULL)
1009 return -ENOMEM;
1010
1011 deviceID = ioread32(p);
1012
1013 if (deviceID == 0x07000200) {
1014 number_uarts = ioread8(p + 4);
1015 dev_dbg(&dev->dev,
1016 "%d ports detected on EndRun PCI Express device\n",
1017 number_uarts);
1018 }
1019 pci_iounmap(dev, p);
1020 return number_uarts;
1021}
1022
1023
1024
1025
1026
1027
1028static int pci_oxsemi_tornado_init(struct pci_dev *dev)
1029{
1030 u8 __iomem *p;
1031 unsigned long deviceID;
1032 unsigned int number_uarts = 0;
1033
1034
1035 if (dev->vendor == PCI_VENDOR_ID_OXSEMI &&
1036 (dev->device & 0xF000) != 0xC000)
1037 return 0;
1038
1039 p = pci_iomap(dev, 0, 5);
1040 if (p == NULL)
1041 return -ENOMEM;
1042
1043 deviceID = ioread32(p);
1044
1045 if (deviceID == 0x07000200) {
1046 number_uarts = ioread8(p + 4);
1047 dev_dbg(&dev->dev,
1048 "%d ports detected on Oxford PCI Express device\n",
1049 number_uarts);
1050 }
1051 pci_iounmap(dev, p);
1052 return number_uarts;
1053}
1054
1055static int pci_asix_setup(struct serial_private *priv,
1056 const struct pciserial_board *board,
1057 struct uart_8250_port *port, int idx)
1058{
1059 port->bugs |= UART_BUG_PARITY;
1060 return pci_default_setup(priv, board, port, idx);
1061}
1062
1063
1064
1065struct quatech_feature {
1066 u16 devid;
1067 bool amcc;
1068};
1069
1070#define QPCR_TEST_FOR1 0x3F
1071#define QPCR_TEST_GET1 0x00
1072#define QPCR_TEST_FOR2 0x40
1073#define QPCR_TEST_GET2 0x40
1074#define QPCR_TEST_FOR3 0x80
1075#define QPCR_TEST_GET3 0x40
1076#define QPCR_TEST_FOR4 0xC0
1077#define QPCR_TEST_GET4 0x80
1078
1079#define QOPR_CLOCK_X1 0x0000
1080#define QOPR_CLOCK_X2 0x0001
1081#define QOPR_CLOCK_X4 0x0002
1082#define QOPR_CLOCK_X8 0x0003
1083#define QOPR_CLOCK_RATE_MASK 0x0003
1084
1085
1086static struct quatech_feature quatech_cards[] = {
1087 { PCI_DEVICE_ID_QUATECH_QSC100, 1 },
1088 { PCI_DEVICE_ID_QUATECH_DSC100, 1 },
1089 { PCI_DEVICE_ID_QUATECH_DSC100E, 0 },
1090 { PCI_DEVICE_ID_QUATECH_DSC200, 1 },
1091 { PCI_DEVICE_ID_QUATECH_DSC200E, 0 },
1092 { PCI_DEVICE_ID_QUATECH_ESC100D, 1 },
1093 { PCI_DEVICE_ID_QUATECH_ESC100M, 1 },
1094 { PCI_DEVICE_ID_QUATECH_QSCP100, 1 },
1095 { PCI_DEVICE_ID_QUATECH_DSCP100, 1 },
1096 { PCI_DEVICE_ID_QUATECH_QSCP200, 1 },
1097 { PCI_DEVICE_ID_QUATECH_DSCP200, 1 },
1098 { PCI_DEVICE_ID_QUATECH_ESCLP100, 0 },
1099 { PCI_DEVICE_ID_QUATECH_QSCLP100, 0 },
1100 { PCI_DEVICE_ID_QUATECH_DSCLP100, 0 },
1101 { PCI_DEVICE_ID_QUATECH_SSCLP100, 0 },
1102 { PCI_DEVICE_ID_QUATECH_QSCLP200, 0 },
1103 { PCI_DEVICE_ID_QUATECH_DSCLP200, 0 },
1104 { PCI_DEVICE_ID_QUATECH_SSCLP200, 0 },
1105 { PCI_DEVICE_ID_QUATECH_SPPXP_100, 0 },
1106 { 0, }
1107};
1108
1109static int pci_quatech_amcc(u16 devid)
1110{
1111 struct quatech_feature *qf = &quatech_cards[0];
1112 while (qf->devid) {
1113 if (qf->devid == devid)
1114 return qf->amcc;
1115 qf++;
1116 }
1117 pr_err("quatech: unknown port type '0x%04X'.\n", devid);
1118 return 0;
1119};
1120
1121static int pci_quatech_rqopr(struct uart_8250_port *port)
1122{
1123 unsigned long base = port->port.iobase;
1124 u8 LCR, val;
1125
1126 LCR = inb(base + UART_LCR);
1127 outb(0xBF, base + UART_LCR);
1128 val = inb(base + UART_SCR);
1129 outb(LCR, base + UART_LCR);
1130 return val;
1131}
1132
1133static void pci_quatech_wqopr(struct uart_8250_port *port, u8 qopr)
1134{
1135 unsigned long base = port->port.iobase;
1136 u8 LCR;
1137
1138 LCR = inb(base + UART_LCR);
1139 outb(0xBF, base + UART_LCR);
1140 inb(base + UART_SCR);
1141 outb(qopr, base + UART_SCR);
1142 outb(LCR, base + UART_LCR);
1143}
1144
1145static int pci_quatech_rqmcr(struct uart_8250_port *port)
1146{
1147 unsigned long base = port->port.iobase;
1148 u8 LCR, val, qmcr;
1149
1150 LCR = inb(base + UART_LCR);
1151 outb(0xBF, base + UART_LCR);
1152 val = inb(base + UART_SCR);
1153 outb(val | 0x10, base + UART_SCR);
1154 qmcr = inb(base + UART_MCR);
1155 outb(val, base + UART_SCR);
1156 outb(LCR, base + UART_LCR);
1157
1158 return qmcr;
1159}
1160
1161static void pci_quatech_wqmcr(struct uart_8250_port *port, u8 qmcr)
1162{
1163 unsigned long base = port->port.iobase;
1164 u8 LCR, val;
1165
1166 LCR = inb(base + UART_LCR);
1167 outb(0xBF, base + UART_LCR);
1168 val = inb(base + UART_SCR);
1169 outb(val | 0x10, base + UART_SCR);
1170 outb(qmcr, base + UART_MCR);
1171 outb(val, base + UART_SCR);
1172 outb(LCR, base + UART_LCR);
1173}
1174
1175static int pci_quatech_has_qmcr(struct uart_8250_port *port)
1176{
1177 unsigned long base = port->port.iobase;
1178 u8 LCR, val;
1179
1180 LCR = inb(base + UART_LCR);
1181 outb(0xBF, base + UART_LCR);
1182 val = inb(base + UART_SCR);
1183 if (val & 0x20) {
1184 outb(0x80, UART_LCR);
1185 if (!(inb(UART_SCR) & 0x20)) {
1186 outb(LCR, base + UART_LCR);
1187 return 1;
1188 }
1189 }
1190 return 0;
1191}
1192
1193static int pci_quatech_test(struct uart_8250_port *port)
1194{
1195 u8 reg, qopr;
1196
1197 qopr = pci_quatech_rqopr(port);
1198 pci_quatech_wqopr(port, qopr & QPCR_TEST_FOR1);
1199 reg = pci_quatech_rqopr(port) & 0xC0;
1200 if (reg != QPCR_TEST_GET1)
1201 return -EINVAL;
1202 pci_quatech_wqopr(port, (qopr & QPCR_TEST_FOR1)|QPCR_TEST_FOR2);
1203 reg = pci_quatech_rqopr(port) & 0xC0;
1204 if (reg != QPCR_TEST_GET2)
1205 return -EINVAL;
1206 pci_quatech_wqopr(port, (qopr & QPCR_TEST_FOR1)|QPCR_TEST_FOR3);
1207 reg = pci_quatech_rqopr(port) & 0xC0;
1208 if (reg != QPCR_TEST_GET3)
1209 return -EINVAL;
1210 pci_quatech_wqopr(port, (qopr & QPCR_TEST_FOR1)|QPCR_TEST_FOR4);
1211 reg = pci_quatech_rqopr(port) & 0xC0;
1212 if (reg != QPCR_TEST_GET4)
1213 return -EINVAL;
1214
1215 pci_quatech_wqopr(port, qopr);
1216 return 0;
1217}
1218
1219static int pci_quatech_clock(struct uart_8250_port *port)
1220{
1221 u8 qopr, reg, set;
1222 unsigned long clock;
1223
1224 if (pci_quatech_test(port) < 0)
1225 return 1843200;
1226
1227 qopr = pci_quatech_rqopr(port);
1228
1229 pci_quatech_wqopr(port, qopr & ~QOPR_CLOCK_X8);
1230 reg = pci_quatech_rqopr(port);
1231 if (reg & QOPR_CLOCK_X8) {
1232 clock = 1843200;
1233 goto out;
1234 }
1235 pci_quatech_wqopr(port, qopr | QOPR_CLOCK_X8);
1236 reg = pci_quatech_rqopr(port);
1237 if (!(reg & QOPR_CLOCK_X8)) {
1238 clock = 1843200;
1239 goto out;
1240 }
1241 reg &= QOPR_CLOCK_X8;
1242 if (reg == QOPR_CLOCK_X2) {
1243 clock = 3685400;
1244 set = QOPR_CLOCK_X2;
1245 } else if (reg == QOPR_CLOCK_X4) {
1246 clock = 7372800;
1247 set = QOPR_CLOCK_X4;
1248 } else if (reg == QOPR_CLOCK_X8) {
1249 clock = 14745600;
1250 set = QOPR_CLOCK_X8;
1251 } else {
1252 clock = 1843200;
1253 set = QOPR_CLOCK_X1;
1254 }
1255 qopr &= ~QOPR_CLOCK_RATE_MASK;
1256 qopr |= set;
1257
1258out:
1259 pci_quatech_wqopr(port, qopr);
1260 return clock;
1261}
1262
1263static int pci_quatech_rs422(struct uart_8250_port *port)
1264{
1265 u8 qmcr;
1266 int rs422 = 0;
1267
1268 if (!pci_quatech_has_qmcr(port))
1269 return 0;
1270 qmcr = pci_quatech_rqmcr(port);
1271 pci_quatech_wqmcr(port, 0xFF);
1272 if (pci_quatech_rqmcr(port))
1273 rs422 = 1;
1274 pci_quatech_wqmcr(port, qmcr);
1275 return rs422;
1276}
1277
1278static int pci_quatech_init(struct pci_dev *dev)
1279{
1280 if (pci_quatech_amcc(dev->device)) {
1281 unsigned long base = pci_resource_start(dev, 0);
1282 if (base) {
1283 u32 tmp;
1284
1285 outl(inl(base + 0x38) | 0x00002000, base + 0x38);
1286 tmp = inl(base + 0x3c);
1287 outl(tmp | 0x01000000, base + 0x3c);
1288 outl(tmp &= ~0x01000000, base + 0x3c);
1289 }
1290 }
1291 return 0;
1292}
1293
1294static int pci_quatech_setup(struct serial_private *priv,
1295 const struct pciserial_board *board,
1296 struct uart_8250_port *port, int idx)
1297{
1298
1299 port->port.iobase = pci_resource_start(priv->dev, FL_GET_BASE(board->flags));
1300
1301 port->port.uartclk = pci_quatech_clock(port);
1302
1303 if (pci_quatech_rs422(port))
1304 pr_warn("quatech: software control of RS422 features not currently supported.\n");
1305 return pci_default_setup(priv, board, port, idx);
1306}
1307
1308static void pci_quatech_exit(struct pci_dev *dev)
1309{
1310}
1311
1312static int pci_default_setup(struct serial_private *priv,
1313 const struct pciserial_board *board,
1314 struct uart_8250_port *port, int idx)
1315{
1316 unsigned int bar, offset = board->first_offset, maxnr;
1317
1318 bar = FL_GET_BASE(board->flags);
1319 if (board->flags & FL_BASE_BARS)
1320 bar += idx;
1321 else
1322 offset += idx * board->uart_offset;
1323
1324 maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) >>
1325 (board->reg_shift + 3);
1326
1327 if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
1328 return 1;
1329
1330 return setup_port(priv, port, bar, offset, board->reg_shift);
1331}
1332
1333static int pci_pericom_setup(struct serial_private *priv,
1334 const struct pciserial_board *board,
1335 struct uart_8250_port *port, int idx)
1336{
1337 unsigned int bar, offset = board->first_offset, maxnr;
1338
1339 bar = FL_GET_BASE(board->flags);
1340 if (board->flags & FL_BASE_BARS)
1341 bar += idx;
1342 else
1343 offset += idx * board->uart_offset;
1344
1345 if (idx==3)
1346 offset = 0x38;
1347
1348 maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) >>
1349 (board->reg_shift + 3);
1350
1351 if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
1352 return 1;
1353
1354 return setup_port(priv, port, bar, offset, board->reg_shift);
1355}
1356
1357static int
1358ce4100_serial_setup(struct serial_private *priv,
1359 const struct pciserial_board *board,
1360 struct uart_8250_port *port, int idx)
1361{
1362 int ret;
1363
1364 ret = setup_port(priv, port, idx, 0, board->reg_shift);
1365 port->port.iotype = UPIO_MEM32;
1366 port->port.type = PORT_XSCALE;
1367 port->port.flags = (port->port.flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
1368 port->port.regshift = 2;
1369
1370 return ret;
1371}
1372
1373static int
1374pci_omegapci_setup(struct serial_private *priv,
1375 const struct pciserial_board *board,
1376 struct uart_8250_port *port, int idx)
1377{
1378 return setup_port(priv, port, 2, idx * 8, 0);
1379}
1380
1381static int
1382pci_brcm_trumanage_setup(struct serial_private *priv,
1383 const struct pciserial_board *board,
1384 struct uart_8250_port *port, int idx)
1385{
1386 int ret = pci_default_setup(priv, board, port, idx);
1387
1388 port->port.type = PORT_BRCM_TRUMANAGE;
1389 port->port.flags = (port->port.flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
1390 return ret;
1391}
1392
1393
1394#define FINTEK_RTS_CONTROL_BY_HW BIT(4)
1395
1396#define FINTEK_RTS_INVERT BIT(5)
1397
1398
1399static int pci_fintek_rs485_config(struct uart_port *port,
1400 struct serial_rs485 *rs485)
1401{
1402 struct pci_dev *pci_dev = to_pci_dev(port->dev);
1403 u8 setting;
1404 u8 *index = (u8 *) port->private_data;
1405
1406 pci_read_config_byte(pci_dev, 0x40 + 8 * *index + 7, &setting);
1407
1408 if (!rs485)
1409 rs485 = &port->rs485;
1410 else if (rs485->flags & SER_RS485_ENABLED)
1411 memset(rs485->padding, 0, sizeof(rs485->padding));
1412 else
1413 memset(rs485, 0, sizeof(*rs485));
1414
1415
1416 rs485->flags &= SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND;
1417
1418 if (rs485->flags & SER_RS485_ENABLED) {
1419
1420 setting |= FINTEK_RTS_CONTROL_BY_HW;
1421
1422 if (rs485->flags & SER_RS485_RTS_ON_SEND) {
1423
1424 setting &= ~FINTEK_RTS_INVERT;
1425 } else {
1426
1427 setting |= FINTEK_RTS_INVERT;
1428 }
1429
1430 rs485->delay_rts_after_send = 0;
1431 rs485->delay_rts_before_send = 0;
1432 } else {
1433
1434 setting &= ~(FINTEK_RTS_CONTROL_BY_HW | FINTEK_RTS_INVERT);
1435 }
1436
1437 pci_write_config_byte(pci_dev, 0x40 + 8 * *index + 7, setting);
1438
1439 if (rs485 != &port->rs485)
1440 port->rs485 = *rs485;
1441
1442 return 0;
1443}
1444
1445static int pci_fintek_setup(struct serial_private *priv,
1446 const struct pciserial_board *board,
1447 struct uart_8250_port *port, int idx)
1448{
1449 struct pci_dev *pdev = priv->dev;
1450 u8 *data;
1451 u8 config_base;
1452 u16 iobase;
1453
1454 config_base = 0x40 + 0x08 * idx;
1455
1456
1457 pci_read_config_word(pdev, config_base + 4, &iobase);
1458
1459 dev_dbg(&pdev->dev, "%s: idx=%d iobase=0x%x", __func__, idx, iobase);
1460
1461 port->port.iotype = UPIO_PORT;
1462 port->port.iobase = iobase;
1463 port->port.rs485_config = pci_fintek_rs485_config;
1464
1465 data = devm_kzalloc(&pdev->dev, sizeof(u8), GFP_KERNEL);
1466 if (!data)
1467 return -ENOMEM;
1468
1469
1470 *data = idx;
1471 port->port.private_data = data;
1472
1473 return 0;
1474}
1475
1476static int pci_fintek_init(struct pci_dev *dev)
1477{
1478 unsigned long iobase;
1479 u32 max_port, i;
1480 resource_size_t bar_data[3];
1481 u8 config_base;
1482 struct serial_private *priv = pci_get_drvdata(dev);
1483 struct uart_8250_port *port;
1484
1485 if (!(pci_resource_flags(dev, 5) & IORESOURCE_IO) ||
1486 !(pci_resource_flags(dev, 4) & IORESOURCE_IO) ||
1487 !(pci_resource_flags(dev, 3) & IORESOURCE_IO))
1488 return -ENODEV;
1489
1490 switch (dev->device) {
1491 case 0x1104:
1492 case 0x1108:
1493 max_port = dev->device & 0xff;
1494 break;
1495 case 0x1112:
1496 max_port = 12;
1497 break;
1498 default:
1499 return -EINVAL;
1500 }
1501
1502
1503 bar_data[0] = pci_resource_start(dev, 5);
1504 bar_data[1] = pci_resource_start(dev, 4);
1505 bar_data[2] = pci_resource_start(dev, 3);
1506
1507 for (i = 0; i < max_port; ++i) {
1508
1509 config_base = 0x40 + 0x08 * i;
1510
1511
1512 iobase = (bar_data[i / 4] & 0xffffffe0) + (i % 4) * 8;
1513
1514
1515 pci_write_config_byte(dev, config_base + 0x00, 0x01);
1516
1517
1518 pci_write_config_byte(dev, config_base + 0x01, 0x33);
1519
1520
1521 pci_write_config_byte(dev, config_base + 0x04,
1522 (u8)(iobase & 0xff));
1523
1524
1525 pci_write_config_byte(dev, config_base + 0x05,
1526 (u8)((iobase & 0xff00) >> 8));
1527
1528 pci_write_config_byte(dev, config_base + 0x06, dev->irq);
1529
1530 if (priv) {
1531
1532
1533
1534 port = serial8250_get_port(priv->line[i]);
1535 pci_fintek_rs485_config(&port->port, NULL);
1536 } else {
1537
1538
1539
1540 pci_write_config_byte(dev, config_base + 0x07, 0x01);
1541 }
1542 }
1543
1544 return max_port;
1545}
1546
1547static int skip_tx_en_setup(struct serial_private *priv,
1548 const struct pciserial_board *board,
1549 struct uart_8250_port *port, int idx)
1550{
1551 port->port.flags |= UPF_NO_TXEN_TEST;
1552 dev_dbg(&priv->dev->dev,
1553 "serial8250: skipping TxEn test for device [%04x:%04x] subsystem [%04x:%04x]\n",
1554 priv->dev->vendor, priv->dev->device,
1555 priv->dev->subsystem_vendor, priv->dev->subsystem_device);
1556
1557 return pci_default_setup(priv, board, port, idx);
1558}
1559
1560static void kt_handle_break(struct uart_port *p)
1561{
1562 struct uart_8250_port *up = up_to_u8250p(p);
1563
1564
1565
1566
1567
1568 serial8250_clear_and_reinit_fifos(up);
1569}
1570
1571static unsigned int kt_serial_in(struct uart_port *p, int offset)
1572{
1573 struct uart_8250_port *up = up_to_u8250p(p);
1574 unsigned int val;
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586 val = inb(p->iobase + offset);
1587 if (offset == UART_IER) {
1588 if (val == 0)
1589 val = up->ier;
1590 }
1591 return val;
1592}
1593
1594static int kt_serial_setup(struct serial_private *priv,
1595 const struct pciserial_board *board,
1596 struct uart_8250_port *port, int idx)
1597{
1598 port->port.flags |= UPF_BUG_THRE;
1599 port->port.serial_in = kt_serial_in;
1600 port->port.handle_break = kt_handle_break;
1601 return skip_tx_en_setup(priv, board, port, idx);
1602}
1603
1604static int pci_eg20t_init(struct pci_dev *dev)
1605{
1606#if defined(CONFIG_SERIAL_PCH_UART) || defined(CONFIG_SERIAL_PCH_UART_MODULE)
1607 return -ENODEV;
1608#else
1609 return 0;
1610#endif
1611}
1612
1613static int
1614pci_wch_ch353_setup(struct serial_private *priv,
1615 const struct pciserial_board *board,
1616 struct uart_8250_port *port, int idx)
1617{
1618 port->port.flags |= UPF_FIXED_TYPE;
1619 port->port.type = PORT_16550A;
1620 return pci_default_setup(priv, board, port, idx);
1621}
1622
1623static int
1624pci_wch_ch355_setup(struct serial_private *priv,
1625 const struct pciserial_board *board,
1626 struct uart_8250_port *port, int idx)
1627{
1628 port->port.flags |= UPF_FIXED_TYPE;
1629 port->port.type = PORT_16550A;
1630 return pci_default_setup(priv, board, port, idx);
1631}
1632
1633static int
1634pci_wch_ch38x_setup(struct serial_private *priv,
1635 const struct pciserial_board *board,
1636 struct uart_8250_port *port, int idx)
1637{
1638 port->port.flags |= UPF_FIXED_TYPE;
1639 port->port.type = PORT_16850;
1640 return pci_default_setup(priv, board, port, idx);
1641}
1642
1643#define PCI_VENDOR_ID_SBSMODULARIO 0x124B
1644#define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
1645#define PCI_DEVICE_ID_OCTPRO 0x0001
1646#define PCI_SUBDEVICE_ID_OCTPRO232 0x0108
1647#define PCI_SUBDEVICE_ID_OCTPRO422 0x0208
1648#define PCI_SUBDEVICE_ID_POCTAL232 0x0308
1649#define PCI_SUBDEVICE_ID_POCTAL422 0x0408
1650#define PCI_SUBDEVICE_ID_SIIG_DUAL_00 0x2500
1651#define PCI_SUBDEVICE_ID_SIIG_DUAL_30 0x2530
1652#define PCI_VENDOR_ID_ADVANTECH 0x13fe
1653#define PCI_DEVICE_ID_INTEL_CE4100_UART 0x2e66
1654#define PCI_DEVICE_ID_ADVANTECH_PCI3620 0x3620
1655#define PCI_DEVICE_ID_ADVANTECH_PCI3618 0x3618
1656#define PCI_DEVICE_ID_ADVANTECH_PCIf618 0xf618
1657#define PCI_DEVICE_ID_TITAN_200I 0x8028
1658#define PCI_DEVICE_ID_TITAN_400I 0x8048
1659#define PCI_DEVICE_ID_TITAN_800I 0x8088
1660#define PCI_DEVICE_ID_TITAN_800EH 0xA007
1661#define PCI_DEVICE_ID_TITAN_800EHB 0xA008
1662#define PCI_DEVICE_ID_TITAN_400EH 0xA009
1663#define PCI_DEVICE_ID_TITAN_100E 0xA010
1664#define PCI_DEVICE_ID_TITAN_200E 0xA012
1665#define PCI_DEVICE_ID_TITAN_400E 0xA013
1666#define PCI_DEVICE_ID_TITAN_800E 0xA014
1667#define PCI_DEVICE_ID_TITAN_200EI 0xA016
1668#define PCI_DEVICE_ID_TITAN_200EISI 0xA017
1669#define PCI_DEVICE_ID_TITAN_200V3 0xA306
1670#define PCI_DEVICE_ID_TITAN_400V3 0xA310
1671#define PCI_DEVICE_ID_TITAN_410V3 0xA312
1672#define PCI_DEVICE_ID_TITAN_800V3 0xA314
1673#define PCI_DEVICE_ID_TITAN_800V3B 0xA315
1674#define PCI_DEVICE_ID_OXSEMI_16PCI958 0x9538
1675#define PCIE_DEVICE_ID_NEO_2_OX_IBM 0x00F6
1676#define PCI_DEVICE_ID_PLX_CRONYX_OMEGA 0xc001
1677#define PCI_DEVICE_ID_INTEL_PATSBURG_KT 0x1d3d
1678#define PCI_VENDOR_ID_WCH 0x4348
1679#define PCI_DEVICE_ID_WCH_CH352_2S 0x3253
1680#define PCI_DEVICE_ID_WCH_CH353_4S 0x3453
1681#define PCI_DEVICE_ID_WCH_CH353_2S1PF 0x5046
1682#define PCI_DEVICE_ID_WCH_CH353_1S1P 0x5053
1683#define PCI_DEVICE_ID_WCH_CH353_2S1P 0x7053
1684#define PCI_DEVICE_ID_WCH_CH355_4S 0x7173
1685#define PCI_VENDOR_ID_AGESTAR 0x5372
1686#define PCI_DEVICE_ID_AGESTAR_9375 0x6872
1687#define PCI_VENDOR_ID_ASIX 0x9710
1688#define PCI_DEVICE_ID_BROADCOM_TRUMANAGE 0x160a
1689#define PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800 0x818e
1690
1691#define PCI_VENDOR_ID_SUNIX 0x1fd4
1692#define PCI_DEVICE_ID_SUNIX_1999 0x1999
1693
1694#define PCIE_VENDOR_ID_WCH 0x1c00
1695#define PCIE_DEVICE_ID_WCH_CH382_2S1P 0x3250
1696#define PCIE_DEVICE_ID_WCH_CH384_4S 0x3470
1697#define PCIE_DEVICE_ID_WCH_CH382_2S 0x3253
1698
1699#define PCI_VENDOR_ID_PERICOM 0x12D8
1700#define PCI_DEVICE_ID_PERICOM_PI7C9X7951 0x7951
1701#define PCI_DEVICE_ID_PERICOM_PI7C9X7952 0x7952
1702#define PCI_DEVICE_ID_PERICOM_PI7C9X7954 0x7954
1703#define PCI_DEVICE_ID_PERICOM_PI7C9X7958 0x7958
1704
1705#define PCI_VENDOR_ID_ACCESIO 0x494f
1706#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SDB 0x1051
1707#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2S 0x1053
1708#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SDB 0x105C
1709#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4S 0x105E
1710#define PCI_DEVICE_ID_ACCESIO_PCIE_COM232_2DB 0x1091
1711#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM232_2 0x1093
1712#define PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4DB 0x1099
1713#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM232_4 0x109B
1714#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SMDB 0x10D1
1715#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2SM 0x10D3
1716#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SMDB 0x10DA
1717#define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4SM 0x10DC
1718#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_1 0x1108
1719#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_2 0x1110
1720#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_2 0x1111
1721#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_4 0x1118
1722#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_4 0x1119
1723#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2S 0x1152
1724#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4S 0x115A
1725#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_2 0x1190
1726#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM232_2 0x1191
1727#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_4 0x1198
1728#define PCI_DEVICE_ID_ACCESIO_MPCIE_ICM232_4 0x1199
1729#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2SM 0x11D0
1730#define PCI_DEVICE_ID_ACCESIO_PCIE_COM422_4 0x105A
1731#define PCI_DEVICE_ID_ACCESIO_PCIE_COM485_4 0x105B
1732#define PCI_DEVICE_ID_ACCESIO_PCIE_COM422_8 0x106A
1733#define PCI_DEVICE_ID_ACCESIO_PCIE_COM485_8 0x106B
1734#define PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4 0x1098
1735#define PCI_DEVICE_ID_ACCESIO_PCIE_COM232_8 0x10A9
1736#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SM 0x10D9
1737#define PCI_DEVICE_ID_ACCESIO_PCIE_COM_8SM 0x10E9
1738#define PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4SM 0x11D8
1739
1740
1741
1742
1743#define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
1744#define PCI_SUBDEVICE_ID_UNKNOWN_0x1588 0x1588
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
1755
1756
1757
1758 {
1759 .vendor = PCI_VENDOR_ID_AMCC,
1760 .device = PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800,
1761 .subvendor = PCI_ANY_ID,
1762 .subdevice = PCI_ANY_ID,
1763 .setup = addidata_apci7800_setup,
1764 },
1765
1766
1767
1768
1769 {
1770 .vendor = PCI_VENDOR_ID_AFAVLAB,
1771 .device = PCI_ANY_ID,
1772 .subvendor = PCI_ANY_ID,
1773 .subdevice = PCI_ANY_ID,
1774 .setup = afavlab_setup,
1775 },
1776
1777
1778
1779 {
1780 .vendor = PCI_VENDOR_ID_HP,
1781 .device = PCI_DEVICE_ID_HP_DIVA,
1782 .subvendor = PCI_ANY_ID,
1783 .subdevice = PCI_ANY_ID,
1784 .init = pci_hp_diva_init,
1785 .setup = pci_hp_diva_setup,
1786 },
1787
1788
1789
1790 {
1791 .vendor = PCI_VENDOR_ID_INTEL,
1792 .device = PCI_DEVICE_ID_INTEL_80960_RP,
1793 .subvendor = 0xe4bf,
1794 .subdevice = PCI_ANY_ID,
1795 .init = pci_inteli960ni_init,
1796 .setup = pci_default_setup,
1797 },
1798 {
1799 .vendor = PCI_VENDOR_ID_INTEL,
1800 .device = PCI_DEVICE_ID_INTEL_8257X_SOL,
1801 .subvendor = PCI_ANY_ID,
1802 .subdevice = PCI_ANY_ID,
1803 .setup = skip_tx_en_setup,
1804 },
1805 {
1806 .vendor = PCI_VENDOR_ID_INTEL,
1807 .device = PCI_DEVICE_ID_INTEL_82573L_SOL,
1808 .subvendor = PCI_ANY_ID,
1809 .subdevice = PCI_ANY_ID,
1810 .setup = skip_tx_en_setup,
1811 },
1812 {
1813 .vendor = PCI_VENDOR_ID_INTEL,
1814 .device = PCI_DEVICE_ID_INTEL_82573E_SOL,
1815 .subvendor = PCI_ANY_ID,
1816 .subdevice = PCI_ANY_ID,
1817 .setup = skip_tx_en_setup,
1818 },
1819 {
1820 .vendor = PCI_VENDOR_ID_INTEL,
1821 .device = PCI_DEVICE_ID_INTEL_CE4100_UART,
1822 .subvendor = PCI_ANY_ID,
1823 .subdevice = PCI_ANY_ID,
1824 .setup = ce4100_serial_setup,
1825 },
1826 {
1827 .vendor = PCI_VENDOR_ID_INTEL,
1828 .device = PCI_DEVICE_ID_INTEL_PATSBURG_KT,
1829 .subvendor = PCI_ANY_ID,
1830 .subdevice = PCI_ANY_ID,
1831 .setup = kt_serial_setup,
1832 },
1833
1834
1835
1836 {
1837 .vendor = PCI_VENDOR_ID_ITE,
1838 .device = PCI_DEVICE_ID_ITE_8872,
1839 .subvendor = PCI_ANY_ID,
1840 .subdevice = PCI_ANY_ID,
1841 .init = pci_ite887x_init,
1842 .setup = pci_default_setup,
1843 .exit = pci_ite887x_exit,
1844 },
1845
1846
1847
1848 {
1849 .vendor = PCI_VENDOR_ID_NI,
1850 .device = PCI_DEVICE_ID_NI_PCI23216,
1851 .subvendor = PCI_ANY_ID,
1852 .subdevice = PCI_ANY_ID,
1853 .init = pci_ni8420_init,
1854 .setup = pci_default_setup,
1855 .exit = pci_ni8420_exit,
1856 },
1857 {
1858 .vendor = PCI_VENDOR_ID_NI,
1859 .device = PCI_DEVICE_ID_NI_PCI2328,
1860 .subvendor = PCI_ANY_ID,
1861 .subdevice = PCI_ANY_ID,
1862 .init = pci_ni8420_init,
1863 .setup = pci_default_setup,
1864 .exit = pci_ni8420_exit,
1865 },
1866 {
1867 .vendor = PCI_VENDOR_ID_NI,
1868 .device = PCI_DEVICE_ID_NI_PCI2324,
1869 .subvendor = PCI_ANY_ID,
1870 .subdevice = PCI_ANY_ID,
1871 .init = pci_ni8420_init,
1872 .setup = pci_default_setup,
1873 .exit = pci_ni8420_exit,
1874 },
1875 {
1876 .vendor = PCI_VENDOR_ID_NI,
1877 .device = PCI_DEVICE_ID_NI_PCI2322,
1878 .subvendor = PCI_ANY_ID,
1879 .subdevice = PCI_ANY_ID,
1880 .init = pci_ni8420_init,
1881 .setup = pci_default_setup,
1882 .exit = pci_ni8420_exit,
1883 },
1884 {
1885 .vendor = PCI_VENDOR_ID_NI,
1886 .device = PCI_DEVICE_ID_NI_PCI2324I,
1887 .subvendor = PCI_ANY_ID,
1888 .subdevice = PCI_ANY_ID,
1889 .init = pci_ni8420_init,
1890 .setup = pci_default_setup,
1891 .exit = pci_ni8420_exit,
1892 },
1893 {
1894 .vendor = PCI_VENDOR_ID_NI,
1895 .device = PCI_DEVICE_ID_NI_PCI2322I,
1896 .subvendor = PCI_ANY_ID,
1897 .subdevice = PCI_ANY_ID,
1898 .init = pci_ni8420_init,
1899 .setup = pci_default_setup,
1900 .exit = pci_ni8420_exit,
1901 },
1902 {
1903 .vendor = PCI_VENDOR_ID_NI,
1904 .device = PCI_DEVICE_ID_NI_PXI8420_23216,
1905 .subvendor = PCI_ANY_ID,
1906 .subdevice = PCI_ANY_ID,
1907 .init = pci_ni8420_init,
1908 .setup = pci_default_setup,
1909 .exit = pci_ni8420_exit,
1910 },
1911 {
1912 .vendor = PCI_VENDOR_ID_NI,
1913 .device = PCI_DEVICE_ID_NI_PXI8420_2328,
1914 .subvendor = PCI_ANY_ID,
1915 .subdevice = PCI_ANY_ID,
1916 .init = pci_ni8420_init,
1917 .setup = pci_default_setup,
1918 .exit = pci_ni8420_exit,
1919 },
1920 {
1921 .vendor = PCI_VENDOR_ID_NI,
1922 .device = PCI_DEVICE_ID_NI_PXI8420_2324,
1923 .subvendor = PCI_ANY_ID,
1924 .subdevice = PCI_ANY_ID,
1925 .init = pci_ni8420_init,
1926 .setup = pci_default_setup,
1927 .exit = pci_ni8420_exit,
1928 },
1929 {
1930 .vendor = PCI_VENDOR_ID_NI,
1931 .device = PCI_DEVICE_ID_NI_PXI8420_2322,
1932 .subvendor = PCI_ANY_ID,
1933 .subdevice = PCI_ANY_ID,
1934 .init = pci_ni8420_init,
1935 .setup = pci_default_setup,
1936 .exit = pci_ni8420_exit,
1937 },
1938 {
1939 .vendor = PCI_VENDOR_ID_NI,
1940 .device = PCI_DEVICE_ID_NI_PXI8422_2324,
1941 .subvendor = PCI_ANY_ID,
1942 .subdevice = PCI_ANY_ID,
1943 .init = pci_ni8420_init,
1944 .setup = pci_default_setup,
1945 .exit = pci_ni8420_exit,
1946 },
1947 {
1948 .vendor = PCI_VENDOR_ID_NI,
1949 .device = PCI_DEVICE_ID_NI_PXI8422_2322,
1950 .subvendor = PCI_ANY_ID,
1951 .subdevice = PCI_ANY_ID,
1952 .init = pci_ni8420_init,
1953 .setup = pci_default_setup,
1954 .exit = pci_ni8420_exit,
1955 },
1956 {
1957 .vendor = PCI_VENDOR_ID_NI,
1958 .device = PCI_ANY_ID,
1959 .subvendor = PCI_ANY_ID,
1960 .subdevice = PCI_ANY_ID,
1961 .init = pci_ni8430_init,
1962 .setup = pci_ni8430_setup,
1963 .exit = pci_ni8430_exit,
1964 },
1965
1966 {
1967 .vendor = PCI_VENDOR_ID_QUATECH,
1968 .device = PCI_ANY_ID,
1969 .subvendor = PCI_ANY_ID,
1970 .subdevice = PCI_ANY_ID,
1971 .init = pci_quatech_init,
1972 .setup = pci_quatech_setup,
1973 .exit = pci_quatech_exit,
1974 },
1975
1976
1977
1978 {
1979 .vendor = PCI_VENDOR_ID_PANACOM,
1980 .device = PCI_DEVICE_ID_PANACOM_QUADMODEM,
1981 .subvendor = PCI_ANY_ID,
1982 .subdevice = PCI_ANY_ID,
1983 .init = pci_plx9050_init,
1984 .setup = pci_default_setup,
1985 .exit = pci_plx9050_exit,
1986 },
1987 {
1988 .vendor = PCI_VENDOR_ID_PANACOM,
1989 .device = PCI_DEVICE_ID_PANACOM_DUALMODEM,
1990 .subvendor = PCI_ANY_ID,
1991 .subdevice = PCI_ANY_ID,
1992 .init = pci_plx9050_init,
1993 .setup = pci_default_setup,
1994 .exit = pci_plx9050_exit,
1995 },
1996
1997
1998
1999 {
2000 .vendor = PCI_VENDOR_ID_PERICOM,
2001 .device = PCI_DEVICE_ID_PERICOM_PI7C9X7954,
2002 .subvendor = PCI_ANY_ID,
2003 .subdevice = PCI_ANY_ID,
2004 .setup = pci_pericom_setup,
2005 },
2006
2007
2008
2009 {
2010 .vendor = PCI_VENDOR_ID_PLX,
2011 .device = PCI_DEVICE_ID_PLX_9050,
2012 .subvendor = PCI_SUBVENDOR_ID_EXSYS,
2013 .subdevice = PCI_SUBDEVICE_ID_EXSYS_4055,
2014 .init = pci_plx9050_init,
2015 .setup = pci_default_setup,
2016 .exit = pci_plx9050_exit,
2017 },
2018 {
2019 .vendor = PCI_VENDOR_ID_PLX,
2020 .device = PCI_DEVICE_ID_PLX_9050,
2021 .subvendor = PCI_SUBVENDOR_ID_KEYSPAN,
2022 .subdevice = PCI_SUBDEVICE_ID_KEYSPAN_SX2,
2023 .init = pci_plx9050_init,
2024 .setup = pci_default_setup,
2025 .exit = pci_plx9050_exit,
2026 },
2027 {
2028 .vendor = PCI_VENDOR_ID_PLX,
2029 .device = PCI_DEVICE_ID_PLX_ROMULUS,
2030 .subvendor = PCI_VENDOR_ID_PLX,
2031 .subdevice = PCI_DEVICE_ID_PLX_ROMULUS,
2032 .init = pci_plx9050_init,
2033 .setup = pci_default_setup,
2034 .exit = pci_plx9050_exit,
2035 },
2036
2037
2038
2039 {
2040 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2041 .device = PCI_DEVICE_ID_OCTPRO,
2042 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2043 .subdevice = PCI_SUBDEVICE_ID_OCTPRO232,
2044 .init = sbs_init,
2045 .setup = sbs_setup,
2046 .exit = sbs_exit,
2047 },
2048
2049
2050
2051 {
2052 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2053 .device = PCI_DEVICE_ID_OCTPRO,
2054 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2055 .subdevice = PCI_SUBDEVICE_ID_OCTPRO422,
2056 .init = sbs_init,
2057 .setup = sbs_setup,
2058 .exit = sbs_exit,
2059 },
2060
2061
2062
2063 {
2064 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2065 .device = PCI_DEVICE_ID_OCTPRO,
2066 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2067 .subdevice = PCI_SUBDEVICE_ID_POCTAL232,
2068 .init = sbs_init,
2069 .setup = sbs_setup,
2070 .exit = sbs_exit,
2071 },
2072
2073
2074
2075 {
2076 .vendor = PCI_VENDOR_ID_SBSMODULARIO,
2077 .device = PCI_DEVICE_ID_OCTPRO,
2078 .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
2079 .subdevice = PCI_SUBDEVICE_ID_POCTAL422,
2080 .init = sbs_init,
2081 .setup = sbs_setup,
2082 .exit = sbs_exit,
2083 },
2084
2085
2086
2087 {
2088 .vendor = PCI_VENDOR_ID_SIIG,
2089 .device = PCI_ANY_ID,
2090 .subvendor = PCI_ANY_ID,
2091 .subdevice = PCI_ANY_ID,
2092 .init = pci_siig_init,
2093 .setup = pci_siig_setup,
2094 },
2095
2096
2097
2098 {
2099 .vendor = PCI_VENDOR_ID_TITAN,
2100 .device = PCI_DEVICE_ID_TITAN_400L,
2101 .subvendor = PCI_ANY_ID,
2102 .subdevice = PCI_ANY_ID,
2103 .setup = titan_400l_800l_setup,
2104 },
2105 {
2106 .vendor = PCI_VENDOR_ID_TITAN,
2107 .device = PCI_DEVICE_ID_TITAN_800L,
2108 .subvendor = PCI_ANY_ID,
2109 .subdevice = PCI_ANY_ID,
2110 .setup = titan_400l_800l_setup,
2111 },
2112
2113
2114
2115 {
2116 .vendor = PCI_VENDOR_ID_TIMEDIA,
2117 .device = PCI_DEVICE_ID_TIMEDIA_1889,
2118 .subvendor = PCI_VENDOR_ID_TIMEDIA,
2119 .subdevice = PCI_ANY_ID,
2120 .probe = pci_timedia_probe,
2121 .init = pci_timedia_init,
2122 .setup = pci_timedia_setup,
2123 },
2124 {
2125 .vendor = PCI_VENDOR_ID_TIMEDIA,
2126 .device = PCI_ANY_ID,
2127 .subvendor = PCI_ANY_ID,
2128 .subdevice = PCI_ANY_ID,
2129 .setup = pci_timedia_setup,
2130 },
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140 {
2141 .vendor = PCI_VENDOR_ID_SUNIX,
2142 .device = PCI_DEVICE_ID_SUNIX_1999,
2143 .subvendor = PCI_VENDOR_ID_SUNIX,
2144 .subdevice = PCI_ANY_ID,
2145 .init = pci_timedia_init,
2146 .setup = pci_timedia_setup,
2147 },
2148
2149
2150
2151 {
2152 .vendor = PCI_VENDOR_ID_XIRCOM,
2153 .device = PCI_DEVICE_ID_XIRCOM_X3201_MDM,
2154 .subvendor = PCI_ANY_ID,
2155 .subdevice = PCI_ANY_ID,
2156 .init = pci_xircom_init,
2157 .setup = pci_default_setup,
2158 },
2159
2160
2161
2162 {
2163 .vendor = PCI_VENDOR_ID_NETMOS,
2164 .device = PCI_ANY_ID,
2165 .subvendor = PCI_ANY_ID,
2166 .subdevice = PCI_ANY_ID,
2167 .init = pci_netmos_init,
2168 .setup = pci_netmos_9900_setup,
2169 },
2170
2171
2172
2173 {
2174 .vendor = PCI_VENDOR_ID_ENDRUN,
2175 .device = PCI_ANY_ID,
2176 .subvendor = PCI_ANY_ID,
2177 .subdevice = PCI_ANY_ID,
2178 .init = pci_endrun_init,
2179 .setup = pci_default_setup,
2180 },
2181
2182
2183
2184 {
2185 .vendor = PCI_VENDOR_ID_OXSEMI,
2186 .device = PCI_ANY_ID,
2187 .subvendor = PCI_ANY_ID,
2188 .subdevice = PCI_ANY_ID,
2189 .init = pci_oxsemi_tornado_init,
2190 .setup = pci_default_setup,
2191 },
2192 {
2193 .vendor = PCI_VENDOR_ID_MAINPINE,
2194 .device = PCI_ANY_ID,
2195 .subvendor = PCI_ANY_ID,
2196 .subdevice = PCI_ANY_ID,
2197 .init = pci_oxsemi_tornado_init,
2198 .setup = pci_default_setup,
2199 },
2200 {
2201 .vendor = PCI_VENDOR_ID_DIGI,
2202 .device = PCIE_DEVICE_ID_NEO_2_OX_IBM,
2203 .subvendor = PCI_SUBVENDOR_ID_IBM,
2204 .subdevice = PCI_ANY_ID,
2205 .init = pci_oxsemi_tornado_init,
2206 .setup = pci_default_setup,
2207 },
2208 {
2209 .vendor = PCI_VENDOR_ID_INTEL,
2210 .device = 0x8811,
2211 .subvendor = PCI_ANY_ID,
2212 .subdevice = PCI_ANY_ID,
2213 .init = pci_eg20t_init,
2214 .setup = pci_default_setup,
2215 },
2216 {
2217 .vendor = PCI_VENDOR_ID_INTEL,
2218 .device = 0x8812,
2219 .subvendor = PCI_ANY_ID,
2220 .subdevice = PCI_ANY_ID,
2221 .init = pci_eg20t_init,
2222 .setup = pci_default_setup,
2223 },
2224 {
2225 .vendor = PCI_VENDOR_ID_INTEL,
2226 .device = 0x8813,
2227 .subvendor = PCI_ANY_ID,
2228 .subdevice = PCI_ANY_ID,
2229 .init = pci_eg20t_init,
2230 .setup = pci_default_setup,
2231 },
2232 {
2233 .vendor = PCI_VENDOR_ID_INTEL,
2234 .device = 0x8814,
2235 .subvendor = PCI_ANY_ID,
2236 .subdevice = PCI_ANY_ID,
2237 .init = pci_eg20t_init,
2238 .setup = pci_default_setup,
2239 },
2240 {
2241 .vendor = 0x10DB,
2242 .device = 0x8027,
2243 .subvendor = PCI_ANY_ID,
2244 .subdevice = PCI_ANY_ID,
2245 .init = pci_eg20t_init,
2246 .setup = pci_default_setup,
2247 },
2248 {
2249 .vendor = 0x10DB,
2250 .device = 0x8028,
2251 .subvendor = PCI_ANY_ID,
2252 .subdevice = PCI_ANY_ID,
2253 .init = pci_eg20t_init,
2254 .setup = pci_default_setup,
2255 },
2256 {
2257 .vendor = 0x10DB,
2258 .device = 0x8029,
2259 .subvendor = PCI_ANY_ID,
2260 .subdevice = PCI_ANY_ID,
2261 .init = pci_eg20t_init,
2262 .setup = pci_default_setup,
2263 },
2264 {
2265 .vendor = 0x10DB,
2266 .device = 0x800C,
2267 .subvendor = PCI_ANY_ID,
2268 .subdevice = PCI_ANY_ID,
2269 .init = pci_eg20t_init,
2270 .setup = pci_default_setup,
2271 },
2272 {
2273 .vendor = 0x10DB,
2274 .device = 0x800D,
2275 .subvendor = PCI_ANY_ID,
2276 .subdevice = PCI_ANY_ID,
2277 .init = pci_eg20t_init,
2278 .setup = pci_default_setup,
2279 },
2280
2281
2282
2283 {
2284 .vendor = PCI_VENDOR_ID_PLX,
2285 .device = PCI_DEVICE_ID_PLX_CRONYX_OMEGA,
2286 .subvendor = PCI_ANY_ID,
2287 .subdevice = PCI_ANY_ID,
2288 .setup = pci_omegapci_setup,
2289 },
2290
2291 {
2292 .vendor = PCI_VENDOR_ID_WCH,
2293 .device = PCI_DEVICE_ID_WCH_CH353_1S1P,
2294 .subvendor = PCI_ANY_ID,
2295 .subdevice = PCI_ANY_ID,
2296 .setup = pci_wch_ch353_setup,
2297 },
2298
2299 {
2300 .vendor = PCI_VENDOR_ID_WCH,
2301 .device = PCI_DEVICE_ID_WCH_CH353_2S1P,
2302 .subvendor = PCI_ANY_ID,
2303 .subdevice = PCI_ANY_ID,
2304 .setup = pci_wch_ch353_setup,
2305 },
2306
2307 {
2308 .vendor = PCI_VENDOR_ID_WCH,
2309 .device = PCI_DEVICE_ID_WCH_CH353_4S,
2310 .subvendor = PCI_ANY_ID,
2311 .subdevice = PCI_ANY_ID,
2312 .setup = pci_wch_ch353_setup,
2313 },
2314
2315 {
2316 .vendor = PCI_VENDOR_ID_WCH,
2317 .device = PCI_DEVICE_ID_WCH_CH353_2S1PF,
2318 .subvendor = PCI_ANY_ID,
2319 .subdevice = PCI_ANY_ID,
2320 .setup = pci_wch_ch353_setup,
2321 },
2322
2323 {
2324 .vendor = PCI_VENDOR_ID_WCH,
2325 .device = PCI_DEVICE_ID_WCH_CH352_2S,
2326 .subvendor = PCI_ANY_ID,
2327 .subdevice = PCI_ANY_ID,
2328 .setup = pci_wch_ch353_setup,
2329 },
2330
2331 {
2332 .vendor = PCI_VENDOR_ID_WCH,
2333 .device = PCI_DEVICE_ID_WCH_CH355_4S,
2334 .subvendor = PCI_ANY_ID,
2335 .subdevice = PCI_ANY_ID,
2336 .setup = pci_wch_ch355_setup,
2337 },
2338
2339 {
2340 .vendor = PCIE_VENDOR_ID_WCH,
2341 .device = PCIE_DEVICE_ID_WCH_CH382_2S,
2342 .subvendor = PCI_ANY_ID,
2343 .subdevice = PCI_ANY_ID,
2344 .setup = pci_wch_ch38x_setup,
2345 },
2346
2347 {
2348 .vendor = PCIE_VENDOR_ID_WCH,
2349 .device = PCIE_DEVICE_ID_WCH_CH382_2S1P,
2350 .subvendor = PCI_ANY_ID,
2351 .subdevice = PCI_ANY_ID,
2352 .setup = pci_wch_ch38x_setup,
2353 },
2354
2355 {
2356 .vendor = PCIE_VENDOR_ID_WCH,
2357 .device = PCIE_DEVICE_ID_WCH_CH384_4S,
2358 .subvendor = PCI_ANY_ID,
2359 .subdevice = PCI_ANY_ID,
2360 .setup = pci_wch_ch38x_setup,
2361 },
2362
2363
2364
2365 {
2366 .vendor = PCI_VENDOR_ID_ASIX,
2367 .device = PCI_ANY_ID,
2368 .subvendor = PCI_ANY_ID,
2369 .subdevice = PCI_ANY_ID,
2370 .setup = pci_asix_setup,
2371 },
2372
2373
2374
2375 {
2376 .vendor = PCI_VENDOR_ID_BROADCOM,
2377 .device = PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
2378 .subvendor = PCI_ANY_ID,
2379 .subdevice = PCI_ANY_ID,
2380 .setup = pci_brcm_trumanage_setup,
2381 },
2382 {
2383 .vendor = 0x1c29,
2384 .device = 0x1104,
2385 .subvendor = PCI_ANY_ID,
2386 .subdevice = PCI_ANY_ID,
2387 .setup = pci_fintek_setup,
2388 .init = pci_fintek_init,
2389 },
2390 {
2391 .vendor = 0x1c29,
2392 .device = 0x1108,
2393 .subvendor = PCI_ANY_ID,
2394 .subdevice = PCI_ANY_ID,
2395 .setup = pci_fintek_setup,
2396 .init = pci_fintek_init,
2397 },
2398 {
2399 .vendor = 0x1c29,
2400 .device = 0x1112,
2401 .subvendor = PCI_ANY_ID,
2402 .subdevice = PCI_ANY_ID,
2403 .setup = pci_fintek_setup,
2404 .init = pci_fintek_init,
2405 },
2406
2407
2408
2409
2410 {
2411 .vendor = PCI_ANY_ID,
2412 .device = PCI_ANY_ID,
2413 .subvendor = PCI_ANY_ID,
2414 .subdevice = PCI_ANY_ID,
2415 .setup = pci_default_setup,
2416 }
2417};
2418
2419static inline int quirk_id_matches(u32 quirk_id, u32 dev_id)
2420{
2421 return quirk_id == PCI_ANY_ID || quirk_id == dev_id;
2422}
2423
2424static struct pci_serial_quirk *find_quirk(struct pci_dev *dev)
2425{
2426 struct pci_serial_quirk *quirk;
2427
2428 for (quirk = pci_serial_quirks; ; quirk++)
2429 if (quirk_id_matches(quirk->vendor, dev->vendor) &&
2430 quirk_id_matches(quirk->device, dev->device) &&
2431 quirk_id_matches(quirk->subvendor, dev->subsystem_vendor) &&
2432 quirk_id_matches(quirk->subdevice, dev->subsystem_device))
2433 break;
2434 return quirk;
2435}
2436
2437static inline int get_pci_irq(struct pci_dev *dev,
2438 const struct pciserial_board *board)
2439{
2440 if (board->flags & FL_NOIRQ)
2441 return 0;
2442 else
2443 return dev->irq;
2444}
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466enum pci_board_num_t {
2467 pbn_default = 0,
2468
2469 pbn_b0_1_115200,
2470 pbn_b0_2_115200,
2471 pbn_b0_4_115200,
2472 pbn_b0_5_115200,
2473 pbn_b0_8_115200,
2474
2475 pbn_b0_1_921600,
2476 pbn_b0_2_921600,
2477 pbn_b0_4_921600,
2478
2479 pbn_b0_2_1130000,
2480
2481 pbn_b0_4_1152000,
2482
2483 pbn_b0_4_1250000,
2484
2485 pbn_b0_2_1843200,
2486 pbn_b0_4_1843200,
2487
2488 pbn_b0_1_4000000,
2489
2490 pbn_b0_bt_1_115200,
2491 pbn_b0_bt_2_115200,
2492 pbn_b0_bt_4_115200,
2493 pbn_b0_bt_8_115200,
2494
2495 pbn_b0_bt_1_460800,
2496 pbn_b0_bt_2_460800,
2497 pbn_b0_bt_4_460800,
2498
2499 pbn_b0_bt_1_921600,
2500 pbn_b0_bt_2_921600,
2501 pbn_b0_bt_4_921600,
2502 pbn_b0_bt_8_921600,
2503
2504 pbn_b1_1_115200,
2505 pbn_b1_2_115200,
2506 pbn_b1_4_115200,
2507 pbn_b1_8_115200,
2508 pbn_b1_16_115200,
2509
2510 pbn_b1_1_921600,
2511 pbn_b1_2_921600,
2512 pbn_b1_4_921600,
2513 pbn_b1_8_921600,
2514
2515 pbn_b1_2_1250000,
2516
2517 pbn_b1_bt_1_115200,
2518 pbn_b1_bt_2_115200,
2519 pbn_b1_bt_4_115200,
2520
2521 pbn_b1_bt_2_921600,
2522
2523 pbn_b1_1_1382400,
2524 pbn_b1_2_1382400,
2525 pbn_b1_4_1382400,
2526 pbn_b1_8_1382400,
2527
2528 pbn_b2_1_115200,
2529 pbn_b2_2_115200,
2530 pbn_b2_4_115200,
2531 pbn_b2_8_115200,
2532
2533 pbn_b2_1_460800,
2534 pbn_b2_4_460800,
2535 pbn_b2_8_460800,
2536 pbn_b2_16_460800,
2537
2538 pbn_b2_1_921600,
2539 pbn_b2_4_921600,
2540 pbn_b2_8_921600,
2541
2542 pbn_b2_8_1152000,
2543
2544 pbn_b2_bt_1_115200,
2545 pbn_b2_bt_2_115200,
2546 pbn_b2_bt_4_115200,
2547
2548 pbn_b2_bt_2_921600,
2549 pbn_b2_bt_4_921600,
2550
2551 pbn_b3_2_115200,
2552 pbn_b3_4_115200,
2553 pbn_b3_8_115200,
2554
2555 pbn_b4_bt_2_921600,
2556 pbn_b4_bt_4_921600,
2557 pbn_b4_bt_8_921600,
2558
2559
2560
2561
2562 pbn_panacom,
2563 pbn_panacom2,
2564 pbn_panacom4,
2565 pbn_plx_romulus,
2566 pbn_endrun_2_4000000,
2567 pbn_oxsemi,
2568 pbn_oxsemi_1_4000000,
2569 pbn_oxsemi_2_4000000,
2570 pbn_oxsemi_4_4000000,
2571 pbn_oxsemi_8_4000000,
2572 pbn_intel_i960,
2573 pbn_sgi_ioc3,
2574 pbn_computone_4,
2575 pbn_computone_6,
2576 pbn_computone_8,
2577 pbn_sbsxrsio,
2578 pbn_pasemi_1682M,
2579 pbn_ni8430_2,
2580 pbn_ni8430_4,
2581 pbn_ni8430_8,
2582 pbn_ni8430_16,
2583 pbn_ADDIDATA_PCIe_1_3906250,
2584 pbn_ADDIDATA_PCIe_2_3906250,
2585 pbn_ADDIDATA_PCIe_4_3906250,
2586 pbn_ADDIDATA_PCIe_8_3906250,
2587 pbn_ce4100_1_115200,
2588 pbn_omegapci,
2589 pbn_NETMOS9900_2s_115200,
2590 pbn_brcm_trumanage,
2591 pbn_fintek_4,
2592 pbn_fintek_8,
2593 pbn_fintek_12,
2594 pbn_wch382_2,
2595 pbn_wch384_4,
2596 pbn_pericom_PI7C9X7951,
2597 pbn_pericom_PI7C9X7952,
2598 pbn_pericom_PI7C9X7954,
2599 pbn_pericom_PI7C9X7958,
2600};
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612static struct pciserial_board pci_boards[] = {
2613 [pbn_default] = {
2614 .flags = FL_BASE0,
2615 .num_ports = 1,
2616 .base_baud = 115200,
2617 .uart_offset = 8,
2618 },
2619 [pbn_b0_1_115200] = {
2620 .flags = FL_BASE0,
2621 .num_ports = 1,
2622 .base_baud = 115200,
2623 .uart_offset = 8,
2624 },
2625 [pbn_b0_2_115200] = {
2626 .flags = FL_BASE0,
2627 .num_ports = 2,
2628 .base_baud = 115200,
2629 .uart_offset = 8,
2630 },
2631 [pbn_b0_4_115200] = {
2632 .flags = FL_BASE0,
2633 .num_ports = 4,
2634 .base_baud = 115200,
2635 .uart_offset = 8,
2636 },
2637 [pbn_b0_5_115200] = {
2638 .flags = FL_BASE0,
2639 .num_ports = 5,
2640 .base_baud = 115200,
2641 .uart_offset = 8,
2642 },
2643 [pbn_b0_8_115200] = {
2644 .flags = FL_BASE0,
2645 .num_ports = 8,
2646 .base_baud = 115200,
2647 .uart_offset = 8,
2648 },
2649 [pbn_b0_1_921600] = {
2650 .flags = FL_BASE0,
2651 .num_ports = 1,
2652 .base_baud = 921600,
2653 .uart_offset = 8,
2654 },
2655 [pbn_b0_2_921600] = {
2656 .flags = FL_BASE0,
2657 .num_ports = 2,
2658 .base_baud = 921600,
2659 .uart_offset = 8,
2660 },
2661 [pbn_b0_4_921600] = {
2662 .flags = FL_BASE0,
2663 .num_ports = 4,
2664 .base_baud = 921600,
2665 .uart_offset = 8,
2666 },
2667
2668 [pbn_b0_2_1130000] = {
2669 .flags = FL_BASE0,
2670 .num_ports = 2,
2671 .base_baud = 1130000,
2672 .uart_offset = 8,
2673 },
2674
2675 [pbn_b0_4_1152000] = {
2676 .flags = FL_BASE0,
2677 .num_ports = 4,
2678 .base_baud = 1152000,
2679 .uart_offset = 8,
2680 },
2681
2682 [pbn_b0_4_1250000] = {
2683 .flags = FL_BASE0,
2684 .num_ports = 4,
2685 .base_baud = 1250000,
2686 .uart_offset = 8,
2687 },
2688
2689 [pbn_b0_2_1843200] = {
2690 .flags = FL_BASE0,
2691 .num_ports = 2,
2692 .base_baud = 1843200,
2693 .uart_offset = 8,
2694 },
2695 [pbn_b0_4_1843200] = {
2696 .flags = FL_BASE0,
2697 .num_ports = 4,
2698 .base_baud = 1843200,
2699 .uart_offset = 8,
2700 },
2701
2702 [pbn_b0_1_4000000] = {
2703 .flags = FL_BASE0,
2704 .num_ports = 1,
2705 .base_baud = 4000000,
2706 .uart_offset = 8,
2707 },
2708
2709 [pbn_b0_bt_1_115200] = {
2710 .flags = FL_BASE0|FL_BASE_BARS,
2711 .num_ports = 1,
2712 .base_baud = 115200,
2713 .uart_offset = 8,
2714 },
2715 [pbn_b0_bt_2_115200] = {
2716 .flags = FL_BASE0|FL_BASE_BARS,
2717 .num_ports = 2,
2718 .base_baud = 115200,
2719 .uart_offset = 8,
2720 },
2721 [pbn_b0_bt_4_115200] = {
2722 .flags = FL_BASE0|FL_BASE_BARS,
2723 .num_ports = 4,
2724 .base_baud = 115200,
2725 .uart_offset = 8,
2726 },
2727 [pbn_b0_bt_8_115200] = {
2728 .flags = FL_BASE0|FL_BASE_BARS,
2729 .num_ports = 8,
2730 .base_baud = 115200,
2731 .uart_offset = 8,
2732 },
2733
2734 [pbn_b0_bt_1_460800] = {
2735 .flags = FL_BASE0|FL_BASE_BARS,
2736 .num_ports = 1,
2737 .base_baud = 460800,
2738 .uart_offset = 8,
2739 },
2740 [pbn_b0_bt_2_460800] = {
2741 .flags = FL_BASE0|FL_BASE_BARS,
2742 .num_ports = 2,
2743 .base_baud = 460800,
2744 .uart_offset = 8,
2745 },
2746 [pbn_b0_bt_4_460800] = {
2747 .flags = FL_BASE0|FL_BASE_BARS,
2748 .num_ports = 4,
2749 .base_baud = 460800,
2750 .uart_offset = 8,
2751 },
2752
2753 [pbn_b0_bt_1_921600] = {
2754 .flags = FL_BASE0|FL_BASE_BARS,
2755 .num_ports = 1,
2756 .base_baud = 921600,
2757 .uart_offset = 8,
2758 },
2759 [pbn_b0_bt_2_921600] = {
2760 .flags = FL_BASE0|FL_BASE_BARS,
2761 .num_ports = 2,
2762 .base_baud = 921600,
2763 .uart_offset = 8,
2764 },
2765 [pbn_b0_bt_4_921600] = {
2766 .flags = FL_BASE0|FL_BASE_BARS,
2767 .num_ports = 4,
2768 .base_baud = 921600,
2769 .uart_offset = 8,
2770 },
2771 [pbn_b0_bt_8_921600] = {
2772 .flags = FL_BASE0|FL_BASE_BARS,
2773 .num_ports = 8,
2774 .base_baud = 921600,
2775 .uart_offset = 8,
2776 },
2777
2778 [pbn_b1_1_115200] = {
2779 .flags = FL_BASE1,
2780 .num_ports = 1,
2781 .base_baud = 115200,
2782 .uart_offset = 8,
2783 },
2784 [pbn_b1_2_115200] = {
2785 .flags = FL_BASE1,
2786 .num_ports = 2,
2787 .base_baud = 115200,
2788 .uart_offset = 8,
2789 },
2790 [pbn_b1_4_115200] = {
2791 .flags = FL_BASE1,
2792 .num_ports = 4,
2793 .base_baud = 115200,
2794 .uart_offset = 8,
2795 },
2796 [pbn_b1_8_115200] = {
2797 .flags = FL_BASE1,
2798 .num_ports = 8,
2799 .base_baud = 115200,
2800 .uart_offset = 8,
2801 },
2802 [pbn_b1_16_115200] = {
2803 .flags = FL_BASE1,
2804 .num_ports = 16,
2805 .base_baud = 115200,
2806 .uart_offset = 8,
2807 },
2808
2809 [pbn_b1_1_921600] = {
2810 .flags = FL_BASE1,
2811 .num_ports = 1,
2812 .base_baud = 921600,
2813 .uart_offset = 8,
2814 },
2815 [pbn_b1_2_921600] = {
2816 .flags = FL_BASE1,
2817 .num_ports = 2,
2818 .base_baud = 921600,
2819 .uart_offset = 8,
2820 },
2821 [pbn_b1_4_921600] = {
2822 .flags = FL_BASE1,
2823 .num_ports = 4,
2824 .base_baud = 921600,
2825 .uart_offset = 8,
2826 },
2827 [pbn_b1_8_921600] = {
2828 .flags = FL_BASE1,
2829 .num_ports = 8,
2830 .base_baud = 921600,
2831 .uart_offset = 8,
2832 },
2833 [pbn_b1_2_1250000] = {
2834 .flags = FL_BASE1,
2835 .num_ports = 2,
2836 .base_baud = 1250000,
2837 .uart_offset = 8,
2838 },
2839
2840 [pbn_b1_bt_1_115200] = {
2841 .flags = FL_BASE1|FL_BASE_BARS,
2842 .num_ports = 1,
2843 .base_baud = 115200,
2844 .uart_offset = 8,
2845 },
2846 [pbn_b1_bt_2_115200] = {
2847 .flags = FL_BASE1|FL_BASE_BARS,
2848 .num_ports = 2,
2849 .base_baud = 115200,
2850 .uart_offset = 8,
2851 },
2852 [pbn_b1_bt_4_115200] = {
2853 .flags = FL_BASE1|FL_BASE_BARS,
2854 .num_ports = 4,
2855 .base_baud = 115200,
2856 .uart_offset = 8,
2857 },
2858
2859 [pbn_b1_bt_2_921600] = {
2860 .flags = FL_BASE1|FL_BASE_BARS,
2861 .num_ports = 2,
2862 .base_baud = 921600,
2863 .uart_offset = 8,
2864 },
2865
2866 [pbn_b1_1_1382400] = {
2867 .flags = FL_BASE1,
2868 .num_ports = 1,
2869 .base_baud = 1382400,
2870 .uart_offset = 8,
2871 },
2872 [pbn_b1_2_1382400] = {
2873 .flags = FL_BASE1,
2874 .num_ports = 2,
2875 .base_baud = 1382400,
2876 .uart_offset = 8,
2877 },
2878 [pbn_b1_4_1382400] = {
2879 .flags = FL_BASE1,
2880 .num_ports = 4,
2881 .base_baud = 1382400,
2882 .uart_offset = 8,
2883 },
2884 [pbn_b1_8_1382400] = {
2885 .flags = FL_BASE1,
2886 .num_ports = 8,
2887 .base_baud = 1382400,
2888 .uart_offset = 8,
2889 },
2890
2891 [pbn_b2_1_115200] = {
2892 .flags = FL_BASE2,
2893 .num_ports = 1,
2894 .base_baud = 115200,
2895 .uart_offset = 8,
2896 },
2897 [pbn_b2_2_115200] = {
2898 .flags = FL_BASE2,
2899 .num_ports = 2,
2900 .base_baud = 115200,
2901 .uart_offset = 8,
2902 },
2903 [pbn_b2_4_115200] = {
2904 .flags = FL_BASE2,
2905 .num_ports = 4,
2906 .base_baud = 115200,
2907 .uart_offset = 8,
2908 },
2909 [pbn_b2_8_115200] = {
2910 .flags = FL_BASE2,
2911 .num_ports = 8,
2912 .base_baud = 115200,
2913 .uart_offset = 8,
2914 },
2915
2916 [pbn_b2_1_460800] = {
2917 .flags = FL_BASE2,
2918 .num_ports = 1,
2919 .base_baud = 460800,
2920 .uart_offset = 8,
2921 },
2922 [pbn_b2_4_460800] = {
2923 .flags = FL_BASE2,
2924 .num_ports = 4,
2925 .base_baud = 460800,
2926 .uart_offset = 8,
2927 },
2928 [pbn_b2_8_460800] = {
2929 .flags = FL_BASE2,
2930 .num_ports = 8,
2931 .base_baud = 460800,
2932 .uart_offset = 8,
2933 },
2934 [pbn_b2_16_460800] = {
2935 .flags = FL_BASE2,
2936 .num_ports = 16,
2937 .base_baud = 460800,
2938 .uart_offset = 8,
2939 },
2940
2941 [pbn_b2_1_921600] = {
2942 .flags = FL_BASE2,
2943 .num_ports = 1,
2944 .base_baud = 921600,
2945 .uart_offset = 8,
2946 },
2947 [pbn_b2_4_921600] = {
2948 .flags = FL_BASE2,
2949 .num_ports = 4,
2950 .base_baud = 921600,
2951 .uart_offset = 8,
2952 },
2953 [pbn_b2_8_921600] = {
2954 .flags = FL_BASE2,
2955 .num_ports = 8,
2956 .base_baud = 921600,
2957 .uart_offset = 8,
2958 },
2959
2960 [pbn_b2_8_1152000] = {
2961 .flags = FL_BASE2,
2962 .num_ports = 8,
2963 .base_baud = 1152000,
2964 .uart_offset = 8,
2965 },
2966
2967 [pbn_b2_bt_1_115200] = {
2968 .flags = FL_BASE2|FL_BASE_BARS,
2969 .num_ports = 1,
2970 .base_baud = 115200,
2971 .uart_offset = 8,
2972 },
2973 [pbn_b2_bt_2_115200] = {
2974 .flags = FL_BASE2|FL_BASE_BARS,
2975 .num_ports = 2,
2976 .base_baud = 115200,
2977 .uart_offset = 8,
2978 },
2979 [pbn_b2_bt_4_115200] = {
2980 .flags = FL_BASE2|FL_BASE_BARS,
2981 .num_ports = 4,
2982 .base_baud = 115200,
2983 .uart_offset = 8,
2984 },
2985
2986 [pbn_b2_bt_2_921600] = {
2987 .flags = FL_BASE2|FL_BASE_BARS,
2988 .num_ports = 2,
2989 .base_baud = 921600,
2990 .uart_offset = 8,
2991 },
2992 [pbn_b2_bt_4_921600] = {
2993 .flags = FL_BASE2|FL_BASE_BARS,
2994 .num_ports = 4,
2995 .base_baud = 921600,
2996 .uart_offset = 8,
2997 },
2998
2999 [pbn_b3_2_115200] = {
3000 .flags = FL_BASE3,
3001 .num_ports = 2,
3002 .base_baud = 115200,
3003 .uart_offset = 8,
3004 },
3005 [pbn_b3_4_115200] = {
3006 .flags = FL_BASE3,
3007 .num_ports = 4,
3008 .base_baud = 115200,
3009 .uart_offset = 8,
3010 },
3011 [pbn_b3_8_115200] = {
3012 .flags = FL_BASE3,
3013 .num_ports = 8,
3014 .base_baud = 115200,
3015 .uart_offset = 8,
3016 },
3017
3018 [pbn_b4_bt_2_921600] = {
3019 .flags = FL_BASE4,
3020 .num_ports = 2,
3021 .base_baud = 921600,
3022 .uart_offset = 8,
3023 },
3024 [pbn_b4_bt_4_921600] = {
3025 .flags = FL_BASE4,
3026 .num_ports = 4,
3027 .base_baud = 921600,
3028 .uart_offset = 8,
3029 },
3030 [pbn_b4_bt_8_921600] = {
3031 .flags = FL_BASE4,
3032 .num_ports = 8,
3033 .base_baud = 921600,
3034 .uart_offset = 8,
3035 },
3036
3037
3038
3039
3040
3041
3042
3043
3044 [pbn_panacom] = {
3045 .flags = FL_BASE2,
3046 .num_ports = 2,
3047 .base_baud = 921600,
3048 .uart_offset = 0x400,
3049 .reg_shift = 7,
3050 },
3051 [pbn_panacom2] = {
3052 .flags = FL_BASE2|FL_BASE_BARS,
3053 .num_ports = 2,
3054 .base_baud = 921600,
3055 .uart_offset = 0x400,
3056 .reg_shift = 7,
3057 },
3058 [pbn_panacom4] = {
3059 .flags = FL_BASE2|FL_BASE_BARS,
3060 .num_ports = 4,
3061 .base_baud = 921600,
3062 .uart_offset = 0x400,
3063 .reg_shift = 7,
3064 },
3065
3066
3067 [pbn_plx_romulus] = {
3068 .flags = FL_BASE2,
3069 .num_ports = 4,
3070 .base_baud = 921600,
3071 .uart_offset = 8 << 2,
3072 .reg_shift = 2,
3073 .first_offset = 0x03,
3074 },
3075
3076
3077
3078
3079
3080
3081
3082 [pbn_endrun_2_4000000] = {
3083 .flags = FL_BASE0,
3084 .num_ports = 2,
3085 .base_baud = 4000000,
3086 .uart_offset = 0x200,
3087 .first_offset = 0x1000,
3088 },
3089
3090
3091
3092
3093
3094 [pbn_oxsemi] = {
3095 .flags = FL_BASE0|FL_REGION_SZ_CAP,
3096 .num_ports = 32,
3097 .base_baud = 115200,
3098 .uart_offset = 8,
3099 },
3100 [pbn_oxsemi_1_4000000] = {
3101 .flags = FL_BASE0,
3102 .num_ports = 1,
3103 .base_baud = 4000000,
3104 .uart_offset = 0x200,
3105 .first_offset = 0x1000,
3106 },
3107 [pbn_oxsemi_2_4000000] = {
3108 .flags = FL_BASE0,
3109 .num_ports = 2,
3110 .base_baud = 4000000,
3111 .uart_offset = 0x200,
3112 .first_offset = 0x1000,
3113 },
3114 [pbn_oxsemi_4_4000000] = {
3115 .flags = FL_BASE0,
3116 .num_ports = 4,
3117 .base_baud = 4000000,
3118 .uart_offset = 0x200,
3119 .first_offset = 0x1000,
3120 },
3121 [pbn_oxsemi_8_4000000] = {
3122 .flags = FL_BASE0,
3123 .num_ports = 8,
3124 .base_baud = 4000000,
3125 .uart_offset = 0x200,
3126 .first_offset = 0x1000,
3127 },
3128
3129
3130
3131
3132
3133
3134 [pbn_intel_i960] = {
3135 .flags = FL_BASE0,
3136 .num_ports = 32,
3137 .base_baud = 921600,
3138 .uart_offset = 8 << 2,
3139 .reg_shift = 2,
3140 .first_offset = 0x10000,
3141 },
3142 [pbn_sgi_ioc3] = {
3143 .flags = FL_BASE0|FL_NOIRQ,
3144 .num_ports = 1,
3145 .base_baud = 458333,
3146 .uart_offset = 8,
3147 .reg_shift = 0,
3148 .first_offset = 0x20178,
3149 },
3150
3151
3152
3153
3154 [pbn_computone_4] = {
3155 .flags = FL_BASE0,
3156 .num_ports = 4,
3157 .base_baud = 921600,
3158 .uart_offset = 0x40,
3159 .reg_shift = 2,
3160 .first_offset = 0x200,
3161 },
3162 [pbn_computone_6] = {
3163 .flags = FL_BASE0,
3164 .num_ports = 6,
3165 .base_baud = 921600,
3166 .uart_offset = 0x40,
3167 .reg_shift = 2,
3168 .first_offset = 0x200,
3169 },
3170 [pbn_computone_8] = {
3171 .flags = FL_BASE0,
3172 .num_ports = 8,
3173 .base_baud = 921600,
3174 .uart_offset = 0x40,
3175 .reg_shift = 2,
3176 .first_offset = 0x200,
3177 },
3178 [pbn_sbsxrsio] = {
3179 .flags = FL_BASE0,
3180 .num_ports = 8,
3181 .base_baud = 460800,
3182 .uart_offset = 256,
3183 .reg_shift = 4,
3184 },
3185
3186
3187
3188 [pbn_pasemi_1682M] = {
3189 .flags = FL_BASE0,
3190 .num_ports = 1,
3191 .base_baud = 8333333,
3192 },
3193
3194
3195
3196 [pbn_ni8430_16] = {
3197 .flags = FL_BASE0,
3198 .num_ports = 16,
3199 .base_baud = 3686400,
3200 .uart_offset = 0x10,
3201 .first_offset = 0x800,
3202 },
3203 [pbn_ni8430_8] = {
3204 .flags = FL_BASE0,
3205 .num_ports = 8,
3206 .base_baud = 3686400,
3207 .uart_offset = 0x10,
3208 .first_offset = 0x800,
3209 },
3210 [pbn_ni8430_4] = {
3211 .flags = FL_BASE0,
3212 .num_ports = 4,
3213 .base_baud = 3686400,
3214 .uart_offset = 0x10,
3215 .first_offset = 0x800,
3216 },
3217 [pbn_ni8430_2] = {
3218 .flags = FL_BASE0,
3219 .num_ports = 2,
3220 .base_baud = 3686400,
3221 .uart_offset = 0x10,
3222 .first_offset = 0x800,
3223 },
3224
3225
3226
3227 [pbn_ADDIDATA_PCIe_1_3906250] = {
3228 .flags = FL_BASE0,
3229 .num_ports = 1,
3230 .base_baud = 3906250,
3231 .uart_offset = 0x200,
3232 .first_offset = 0x1000,
3233 },
3234 [pbn_ADDIDATA_PCIe_2_3906250] = {
3235 .flags = FL_BASE0,
3236 .num_ports = 2,
3237 .base_baud = 3906250,
3238 .uart_offset = 0x200,
3239 .first_offset = 0x1000,
3240 },
3241 [pbn_ADDIDATA_PCIe_4_3906250] = {
3242 .flags = FL_BASE0,
3243 .num_ports = 4,
3244 .base_baud = 3906250,
3245 .uart_offset = 0x200,
3246 .first_offset = 0x1000,
3247 },
3248 [pbn_ADDIDATA_PCIe_8_3906250] = {
3249 .flags = FL_BASE0,
3250 .num_ports = 8,
3251 .base_baud = 3906250,
3252 .uart_offset = 0x200,
3253 .first_offset = 0x1000,
3254 },
3255 [pbn_ce4100_1_115200] = {
3256 .flags = FL_BASE_BARS,
3257 .num_ports = 2,
3258 .base_baud = 921600,
3259 .reg_shift = 2,
3260 },
3261 [pbn_omegapci] = {
3262 .flags = FL_BASE0,
3263 .num_ports = 8,
3264 .base_baud = 115200,
3265 .uart_offset = 0x200,
3266 },
3267 [pbn_NETMOS9900_2s_115200] = {
3268 .flags = FL_BASE0,
3269 .num_ports = 2,
3270 .base_baud = 115200,
3271 },
3272 [pbn_brcm_trumanage] = {
3273 .flags = FL_BASE0,
3274 .num_ports = 1,
3275 .reg_shift = 2,
3276 .base_baud = 115200,
3277 },
3278 [pbn_fintek_4] = {
3279 .num_ports = 4,
3280 .uart_offset = 8,
3281 .base_baud = 115200,
3282 .first_offset = 0x40,
3283 },
3284 [pbn_fintek_8] = {
3285 .num_ports = 8,
3286 .uart_offset = 8,
3287 .base_baud = 115200,
3288 .first_offset = 0x40,
3289 },
3290 [pbn_fintek_12] = {
3291 .num_ports = 12,
3292 .uart_offset = 8,
3293 .base_baud = 115200,
3294 .first_offset = 0x40,
3295 },
3296 [pbn_wch382_2] = {
3297 .flags = FL_BASE0,
3298 .num_ports = 2,
3299 .base_baud = 115200,
3300 .uart_offset = 8,
3301 .first_offset = 0xC0,
3302 },
3303 [pbn_wch384_4] = {
3304 .flags = FL_BASE0,
3305 .num_ports = 4,
3306 .base_baud = 115200,
3307 .uart_offset = 8,
3308 .first_offset = 0xC0,
3309 },
3310
3311
3312
3313 [pbn_pericom_PI7C9X7951] = {
3314 .flags = FL_BASE0,
3315 .num_ports = 1,
3316 .base_baud = 921600,
3317 .uart_offset = 0x8,
3318 },
3319 [pbn_pericom_PI7C9X7952] = {
3320 .flags = FL_BASE0,
3321 .num_ports = 2,
3322 .base_baud = 921600,
3323 .uart_offset = 0x8,
3324 },
3325 [pbn_pericom_PI7C9X7954] = {
3326 .flags = FL_BASE0,
3327 .num_ports = 4,
3328 .base_baud = 921600,
3329 .uart_offset = 0x8,
3330 },
3331 [pbn_pericom_PI7C9X7958] = {
3332 .flags = FL_BASE0,
3333 .num_ports = 8,
3334 .base_baud = 921600,
3335 .uart_offset = 0x8,
3336 },
3337};
3338
3339static const struct pci_device_id blacklist[] = {
3340
3341 { PCI_VDEVICE(AL, 0x5457), },
3342 { PCI_VDEVICE(MOTOROLA, 0x3052), },
3343 { PCI_DEVICE(0x1543, 0x3052), },
3344
3345
3346 { PCI_DEVICE(0x4348, 0x7053), },
3347 { PCI_DEVICE(0x4348, 0x5053), },
3348 { PCI_DEVICE(0x4348, 0x7173), },
3349 { PCI_DEVICE(0x1c00, 0x3250), },
3350 { PCI_DEVICE(0x1c00, 0x3470), },
3351
3352
3353 { PCI_VDEVICE(MOXA, 0x1024), },
3354 { PCI_VDEVICE(MOXA, 0x1025), },
3355 { PCI_VDEVICE(MOXA, 0x1045), },
3356 { PCI_VDEVICE(MOXA, 0x1144), },
3357 { PCI_VDEVICE(MOXA, 0x1160), },
3358 { PCI_VDEVICE(MOXA, 0x1161), },
3359 { PCI_VDEVICE(MOXA, 0x1182), },
3360 { PCI_VDEVICE(MOXA, 0x1183), },
3361 { PCI_VDEVICE(MOXA, 0x1322), },
3362 { PCI_VDEVICE(MOXA, 0x1342), },
3363 { PCI_VDEVICE(MOXA, 0x1381), },
3364 { PCI_VDEVICE(MOXA, 0x1683), },
3365
3366
3367 { PCI_VDEVICE(INTEL, 0x081b), },
3368 { PCI_VDEVICE(INTEL, 0x081c), },
3369 { PCI_VDEVICE(INTEL, 0x081d), },
3370 { PCI_VDEVICE(INTEL, 0x1191), },
3371 { PCI_VDEVICE(INTEL, 0x19d8), },
3372
3373
3374 { PCI_VDEVICE(INTEL, 0x0936), },
3375 { PCI_VDEVICE(INTEL, 0x0f0a), },
3376 { PCI_VDEVICE(INTEL, 0x0f0c), },
3377 { PCI_VDEVICE(INTEL, 0x228a), },
3378 { PCI_VDEVICE(INTEL, 0x228c), },
3379 { PCI_VDEVICE(INTEL, 0x9ce3), },
3380 { PCI_VDEVICE(INTEL, 0x9ce4), },
3381
3382
3383 { PCI_VDEVICE(EXAR, PCI_ANY_ID), },
3384 { PCI_VDEVICE(COMMTECH, PCI_ANY_ID), },
3385};
3386
3387
3388
3389
3390
3391
3392static int
3393serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board)
3394{
3395 const struct pci_device_id *bldev;
3396 int num_iomem, num_port, first_port = -1, i;
3397
3398
3399
3400
3401
3402
3403
3404
3405 if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) &&
3406 ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) ||
3407 (dev->class & 0xff) > 6)
3408 return -ENODEV;
3409
3410
3411
3412
3413
3414 for (bldev = blacklist;
3415 bldev < blacklist + ARRAY_SIZE(blacklist);
3416 bldev++) {
3417 if (dev->vendor == bldev->vendor &&
3418 dev->device == bldev->device)
3419 return -ENODEV;
3420 }
3421
3422 num_iomem = num_port = 0;
3423 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
3424 if (pci_resource_flags(dev, i) & IORESOURCE_IO) {
3425 num_port++;
3426 if (first_port == -1)
3427 first_port = i;
3428 }
3429 if (pci_resource_flags(dev, i) & IORESOURCE_MEM)
3430 num_iomem++;
3431 }
3432
3433
3434
3435
3436
3437
3438 if (num_iomem <= 1 && num_port == 1) {
3439 board->flags = first_port;
3440 board->num_ports = pci_resource_len(dev, first_port) / 8;
3441 return 0;
3442 }
3443
3444
3445
3446
3447
3448
3449 first_port = -1;
3450 num_port = 0;
3451 for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
3452 if (pci_resource_flags(dev, i) & IORESOURCE_IO &&
3453 pci_resource_len(dev, i) == 8 &&
3454 (first_port == -1 || (first_port + num_port) == i)) {
3455 num_port++;
3456 if (first_port == -1)
3457 first_port = i;
3458 }
3459 }
3460
3461 if (num_port > 1) {
3462 board->flags = first_port | FL_BASE_BARS;
3463 board->num_ports = num_port;
3464 return 0;
3465 }
3466
3467 return -ENODEV;
3468}
3469
3470static inline int
3471serial_pci_matches(const struct pciserial_board *board,
3472 const struct pciserial_board *guessed)
3473{
3474 return
3475 board->num_ports == guessed->num_ports &&
3476 board->base_baud == guessed->base_baud &&
3477 board->uart_offset == guessed->uart_offset &&
3478 board->reg_shift == guessed->reg_shift &&
3479 board->first_offset == guessed->first_offset;
3480}
3481
3482struct serial_private *
3483pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board)
3484{
3485 struct uart_8250_port uart;
3486 struct serial_private *priv;
3487 struct pci_serial_quirk *quirk;
3488 int rc, nr_ports, i;
3489
3490 nr_ports = board->num_ports;
3491
3492
3493
3494
3495 quirk = find_quirk(dev);
3496
3497
3498
3499
3500
3501
3502
3503
3504 if (quirk->init) {
3505 rc = quirk->init(dev);
3506 if (rc < 0) {
3507 priv = ERR_PTR(rc);
3508 goto err_out;
3509 }
3510 if (rc)
3511 nr_ports = rc;
3512 }
3513
3514 priv = kzalloc(sizeof(struct serial_private) +
3515 sizeof(unsigned int) * nr_ports,
3516 GFP_KERNEL);
3517 if (!priv) {
3518 priv = ERR_PTR(-ENOMEM);
3519 goto err_deinit;
3520 }
3521
3522 priv->dev = dev;
3523 priv->quirk = quirk;
3524
3525 memset(&uart, 0, sizeof(uart));
3526 uart.port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
3527 uart.port.uartclk = board->base_baud * 16;
3528 uart.port.irq = get_pci_irq(dev, board);
3529 uart.port.dev = &dev->dev;
3530
3531 for (i = 0; i < nr_ports; i++) {
3532 if (quirk->setup(priv, board, &uart, i))
3533 break;
3534
3535 dev_dbg(&dev->dev, "Setup PCI port: port %lx, irq %d, type %d\n",
3536 uart.port.iobase, uart.port.irq, uart.port.iotype);
3537
3538 priv->line[i] = serial8250_register_8250_port(&uart);
3539 if (priv->line[i] < 0) {
3540 dev_err(&dev->dev,
3541 "Couldn't register serial port %lx, irq %d, type %d, error %d\n",
3542 uart.port.iobase, uart.port.irq,
3543 uart.port.iotype, priv->line[i]);
3544 break;
3545 }
3546 }
3547 priv->nr = i;
3548 priv->board = board;
3549 return priv;
3550
3551err_deinit:
3552 if (quirk->exit)
3553 quirk->exit(dev);
3554err_out:
3555 return priv;
3556}
3557EXPORT_SYMBOL_GPL(pciserial_init_ports);
3558
3559static void pciserial_detach_ports(struct serial_private *priv)
3560{
3561 struct pci_serial_quirk *quirk;
3562 int i;
3563
3564 for (i = 0; i < priv->nr; i++)
3565 serial8250_unregister_port(priv->line[i]);
3566
3567
3568
3569
3570 quirk = find_quirk(priv->dev);
3571 if (quirk->exit)
3572 quirk->exit(priv->dev);
3573}
3574
3575void pciserial_remove_ports(struct serial_private *priv)
3576{
3577 pciserial_detach_ports(priv);
3578 kfree(priv);
3579}
3580EXPORT_SYMBOL_GPL(pciserial_remove_ports);
3581
3582void pciserial_suspend_ports(struct serial_private *priv)
3583{
3584 int i;
3585
3586 for (i = 0; i < priv->nr; i++)
3587 if (priv->line[i] >= 0)
3588 serial8250_suspend_port(priv->line[i]);
3589
3590
3591
3592
3593 if (priv->quirk->exit)
3594 priv->quirk->exit(priv->dev);
3595}
3596EXPORT_SYMBOL_GPL(pciserial_suspend_ports);
3597
3598void pciserial_resume_ports(struct serial_private *priv)
3599{
3600 int i;
3601
3602
3603
3604
3605 if (priv->quirk->init)
3606 priv->quirk->init(priv->dev);
3607
3608 for (i = 0; i < priv->nr; i++)
3609 if (priv->line[i] >= 0)
3610 serial8250_resume_port(priv->line[i]);
3611}
3612EXPORT_SYMBOL_GPL(pciserial_resume_ports);
3613
3614
3615
3616
3617
3618static int
3619pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
3620{
3621 struct pci_serial_quirk *quirk;
3622 struct serial_private *priv;
3623 const struct pciserial_board *board;
3624 struct pciserial_board tmp;
3625 int rc;
3626
3627 quirk = find_quirk(dev);
3628 if (quirk->probe) {
3629 rc = quirk->probe(dev);
3630 if (rc)
3631 return rc;
3632 }
3633
3634 if (ent->driver_data >= ARRAY_SIZE(pci_boards)) {
3635 dev_err(&dev->dev, "invalid driver_data: %ld\n",
3636 ent->driver_data);
3637 return -EINVAL;
3638 }
3639
3640 board = &pci_boards[ent->driver_data];
3641
3642 rc = pcim_enable_device(dev);
3643 pci_save_state(dev);
3644 if (rc)
3645 return rc;
3646
3647 if (ent->driver_data == pbn_default) {
3648
3649
3650
3651
3652 memcpy(&tmp, board, sizeof(struct pciserial_board));
3653 board = &tmp;
3654
3655
3656
3657
3658
3659 rc = serial_pci_guess_board(dev, &tmp);
3660 if (rc)
3661 return rc;
3662 } else {
3663
3664
3665
3666
3667
3668 memcpy(&tmp, &pci_boards[pbn_default],
3669 sizeof(struct pciserial_board));
3670 rc = serial_pci_guess_board(dev, &tmp);
3671 if (rc == 0 && serial_pci_matches(board, &tmp))
3672 moan_device("Redundant entry in serial pci_table.",
3673 dev);
3674 }
3675
3676 priv = pciserial_init_ports(dev, board);
3677 if (IS_ERR(priv))
3678 return PTR_ERR(priv);
3679
3680 pci_set_drvdata(dev, priv);
3681 return 0;
3682}
3683
3684static void pciserial_remove_one(struct pci_dev *dev)
3685{
3686 struct serial_private *priv = pci_get_drvdata(dev);
3687
3688 pciserial_remove_ports(priv);
3689}
3690
3691#ifdef CONFIG_PM_SLEEP
3692static int pciserial_suspend_one(struct device *dev)
3693{
3694 struct pci_dev *pdev = to_pci_dev(dev);
3695 struct serial_private *priv = pci_get_drvdata(pdev);
3696
3697 if (priv)
3698 pciserial_suspend_ports(priv);
3699
3700 return 0;
3701}
3702
3703static int pciserial_resume_one(struct device *dev)
3704{
3705 struct pci_dev *pdev = to_pci_dev(dev);
3706 struct serial_private *priv = pci_get_drvdata(pdev);
3707 int err;
3708
3709 if (priv) {
3710
3711
3712
3713 err = pci_enable_device(pdev);
3714
3715 if (err)
3716 dev_err(dev, "Unable to re-enable ports, trying to continue.\n");
3717 pciserial_resume_ports(priv);
3718 }
3719 return 0;
3720}
3721#endif
3722
3723static SIMPLE_DEV_PM_OPS(pciserial_pm_ops, pciserial_suspend_one,
3724 pciserial_resume_one);
3725
3726static struct pci_device_id serial_pci_tbl[] = {
3727
3728 { PCI_VENDOR_ID_ADVANTECH, PCI_DEVICE_ID_ADVANTECH_PCI3620,
3729 PCI_DEVICE_ID_ADVANTECH_PCI3620, 0x0001, 0, 0,
3730 pbn_b2_8_921600 },
3731
3732 { PCI_VENDOR_ID_ADVANTECH, PCI_DEVICE_ID_ADVANTECH_PCI3618,
3733 PCI_DEVICE_ID_ADVANTECH_PCI3618, PCI_ANY_ID, 0, 0,
3734 pbn_b0_4_921600 },
3735 { PCI_VENDOR_ID_ADVANTECH, PCI_DEVICE_ID_ADVANTECH_PCIf618,
3736 PCI_DEVICE_ID_ADVANTECH_PCI3618, PCI_ANY_ID, 0, 0,
3737 pbn_b0_4_921600 },
3738 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
3739 PCI_SUBVENDOR_ID_CONNECT_TECH,
3740 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
3741 pbn_b1_8_1382400 },
3742 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
3743 PCI_SUBVENDOR_ID_CONNECT_TECH,
3744 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
3745 pbn_b1_4_1382400 },
3746 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
3747 PCI_SUBVENDOR_ID_CONNECT_TECH,
3748 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
3749 pbn_b1_2_1382400 },
3750 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3751 PCI_SUBVENDOR_ID_CONNECT_TECH,
3752 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
3753 pbn_b1_8_1382400 },
3754 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3755 PCI_SUBVENDOR_ID_CONNECT_TECH,
3756 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
3757 pbn_b1_4_1382400 },
3758 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3759 PCI_SUBVENDOR_ID_CONNECT_TECH,
3760 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
3761 pbn_b1_2_1382400 },
3762 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3763 PCI_SUBVENDOR_ID_CONNECT_TECH,
3764 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485, 0, 0,
3765 pbn_b1_8_921600 },
3766 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3767 PCI_SUBVENDOR_ID_CONNECT_TECH,
3768 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4, 0, 0,
3769 pbn_b1_8_921600 },
3770 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3771 PCI_SUBVENDOR_ID_CONNECT_TECH,
3772 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485, 0, 0,
3773 pbn_b1_4_921600 },
3774 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3775 PCI_SUBVENDOR_ID_CONNECT_TECH,
3776 PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2, 0, 0,
3777 pbn_b1_4_921600 },
3778 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3779 PCI_SUBVENDOR_ID_CONNECT_TECH,
3780 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485, 0, 0,
3781 pbn_b1_2_921600 },
3782 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3783 PCI_SUBVENDOR_ID_CONNECT_TECH,
3784 PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6, 0, 0,
3785 pbn_b1_8_921600 },
3786 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3787 PCI_SUBVENDOR_ID_CONNECT_TECH,
3788 PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1, 0, 0,
3789 pbn_b1_8_921600 },
3790 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3791 PCI_SUBVENDOR_ID_CONNECT_TECH,
3792 PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1, 0, 0,
3793 pbn_b1_4_921600 },
3794 { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
3795 PCI_SUBVENDOR_ID_CONNECT_TECH,
3796 PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_20MHZ, 0, 0,
3797 pbn_b1_2_1250000 },
3798 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
3799 PCI_SUBVENDOR_ID_CONNECT_TECH,
3800 PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_2, 0, 0,
3801 pbn_b0_2_1843200 },
3802 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
3803 PCI_SUBVENDOR_ID_CONNECT_TECH,
3804 PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_4, 0, 0,
3805 pbn_b0_4_1843200 },
3806 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
3807 PCI_VENDOR_ID_AFAVLAB,
3808 PCI_SUBDEVICE_ID_AFAVLAB_P061, 0, 0,
3809 pbn_b0_4_1152000 },
3810 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_U530,
3811 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3812 pbn_b2_bt_1_115200 },
3813 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM2,
3814 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3815 pbn_b2_bt_2_115200 },
3816 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM422,
3817 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3818 pbn_b2_bt_4_115200 },
3819 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM232,
3820 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3821 pbn_b2_bt_2_115200 },
3822 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM4,
3823 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3824 pbn_b2_bt_4_115200 },
3825 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8,
3826 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3827 pbn_b2_8_115200 },
3828 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_7803,
3829 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3830 pbn_b2_8_460800 },
3831 { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8,
3832 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3833 pbn_b2_8_115200 },
3834
3835 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_GTEK_SERIAL2,
3836 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3837 pbn_b2_bt_2_115200 },
3838 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM200,
3839 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3840 pbn_b2_bt_2_921600 },
3841
3842
3843
3844 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM800,
3845 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3846 pbn_b2_8_921600 },
3847 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_1077,
3848 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3849 pbn_b2_4_921600 },
3850
3851 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3852 PCI_VENDOR_ID_PLX,
3853 PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0,
3854 pbn_b2_4_115200 },
3855
3856 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3857 PCI_VENDOR_ID_PLX,
3858 PCI_SUBDEVICE_ID_UNKNOWN_0x1588, 0, 0,
3859 pbn_b2_8_115200 },
3860 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3861 PCI_SUBVENDOR_ID_KEYSPAN,
3862 PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0,
3863 pbn_panacom },
3864 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_QUADMODEM,
3865 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3866 pbn_panacom4 },
3867 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM,
3868 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3869 pbn_panacom2 },
3870 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
3871 PCI_VENDOR_ID_ESDGMBH,
3872 PCI_DEVICE_ID_ESDGMBH_CPCIASIO4, 0, 0,
3873 pbn_b2_4_115200 },
3874 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3875 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
3876 PCI_SUBDEVICE_ID_CHASE_PCIFAST4, 0, 0,
3877 pbn_b2_4_460800 },
3878 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3879 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
3880 PCI_SUBDEVICE_ID_CHASE_PCIFAST8, 0, 0,
3881 pbn_b2_8_460800 },
3882 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3883 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
3884 PCI_SUBDEVICE_ID_CHASE_PCIFAST16, 0, 0,
3885 pbn_b2_16_460800 },
3886 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3887 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
3888 PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC, 0, 0,
3889 pbn_b2_16_460800 },
3890 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3891 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
3892 PCI_SUBDEVICE_ID_CHASE_PCIRAS4, 0, 0,
3893 pbn_b2_4_460800 },
3894 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3895 PCI_SUBVENDOR_ID_CHASE_PCIRAS,
3896 PCI_SUBDEVICE_ID_CHASE_PCIRAS8, 0, 0,
3897 pbn_b2_8_460800 },
3898 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
3899 PCI_SUBVENDOR_ID_EXSYS,
3900 PCI_SUBDEVICE_ID_EXSYS_4055, 0, 0,
3901 pbn_b2_4_115200 },
3902
3903
3904
3905
3906 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_ROMULUS,
3907 0x10b5, 0x106a, 0, 0,
3908 pbn_plx_romulus },
3909
3910
3911
3912
3913 { PCI_VENDOR_ID_ENDRUN, PCI_DEVICE_ID_ENDRUN_1588,
3914 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3915 pbn_endrun_2_4000000 },
3916
3917
3918
3919
3920
3921
3922 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC100,
3923 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3924 pbn_b1_4_115200 },
3925 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100,
3926 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3927 pbn_b1_2_115200 },
3928 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100E,
3929 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3930 pbn_b2_2_115200 },
3931 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC200,
3932 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3933 pbn_b1_2_115200 },
3934 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC200E,
3935 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3936 pbn_b2_2_115200 },
3937 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC200,
3938 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3939 pbn_b1_4_115200 },
3940 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100D,
3941 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3942 pbn_b1_8_115200 },
3943 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100M,
3944 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3945 pbn_b1_8_115200 },
3946 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCP100,
3947 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3948 pbn_b1_4_115200 },
3949 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCP100,
3950 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3951 pbn_b1_2_115200 },
3952 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCP200,
3953 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3954 pbn_b1_4_115200 },
3955 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCP200,
3956 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3957 pbn_b1_2_115200 },
3958 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCLP100,
3959 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3960 pbn_b2_4_115200 },
3961 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCLP100,
3962 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3963 pbn_b2_2_115200 },
3964 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SSCLP100,
3965 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3966 pbn_b2_1_115200 },
3967 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSCLP200,
3968 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3969 pbn_b2_4_115200 },
3970 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSCLP200,
3971 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3972 pbn_b2_2_115200 },
3973 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SSCLP200,
3974 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3975 pbn_b2_1_115200 },
3976 { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESCLP100,
3977 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3978 pbn_b0_8_115200 },
3979
3980 { PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_OXSEMI_16PCI954,
3981 PCI_VENDOR_ID_SPECIALIX, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4,
3982 0, 0,
3983 pbn_b0_4_921600 },
3984 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
3985 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL,
3986 0, 0,
3987 pbn_b0_4_1152000 },
3988 { PCI_VENDOR_ID_OXSEMI, 0x9505,
3989 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3990 pbn_b0_bt_2_921600 },
3991
3992
3993
3994
3995
3996
3997
3998 { PCI_VENDOR_ID_OXSEMI, 0x950a,
3999 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_DUAL_00,
4000 0, 0, pbn_b0_2_115200 },
4001 { PCI_VENDOR_ID_OXSEMI, 0x950a,
4002 PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_DUAL_30,
4003 0, 0, pbn_b0_2_115200 },
4004 { PCI_VENDOR_ID_OXSEMI, 0x950a,
4005 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4006 pbn_b0_2_1130000 },
4007 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_C950,
4008 PCI_VENDOR_ID_OXSEMI, PCI_SUBDEVICE_ID_OXSEMI_C950, 0, 0,
4009 pbn_b0_1_921600 },
4010 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
4011 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4012 pbn_b0_4_115200 },
4013 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI952,
4014 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4015 pbn_b0_bt_2_921600 },
4016 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI958,
4017 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4018 pbn_b2_8_1152000 },
4019
4020
4021
4022
4023 { PCI_VENDOR_ID_OXSEMI, 0xc101,
4024 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4025 pbn_b0_1_4000000 },
4026 { PCI_VENDOR_ID_OXSEMI, 0xc105,
4027 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4028 pbn_b0_1_4000000 },
4029 { PCI_VENDOR_ID_OXSEMI, 0xc11b,
4030 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4031 pbn_oxsemi_1_4000000 },
4032 { PCI_VENDOR_ID_OXSEMI, 0xc11f,
4033 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4034 pbn_oxsemi_1_4000000 },
4035 { PCI_VENDOR_ID_OXSEMI, 0xc120,
4036 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4037 pbn_b0_1_4000000 },
4038 { PCI_VENDOR_ID_OXSEMI, 0xc124,
4039 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4040 pbn_b0_1_4000000 },
4041 { PCI_VENDOR_ID_OXSEMI, 0xc138,
4042 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4043 pbn_oxsemi_1_4000000 },
4044 { PCI_VENDOR_ID_OXSEMI, 0xc13d,
4045 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4046 pbn_oxsemi_1_4000000 },
4047 { PCI_VENDOR_ID_OXSEMI, 0xc140,
4048 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4049 pbn_b0_1_4000000 },
4050 { PCI_VENDOR_ID_OXSEMI, 0xc141,
4051 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4052 pbn_b0_1_4000000 },
4053 { PCI_VENDOR_ID_OXSEMI, 0xc144,
4054 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4055 pbn_b0_1_4000000 },
4056 { PCI_VENDOR_ID_OXSEMI, 0xc145,
4057 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4058 pbn_b0_1_4000000 },
4059 { PCI_VENDOR_ID_OXSEMI, 0xc158,
4060 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4061 pbn_oxsemi_2_4000000 },
4062 { PCI_VENDOR_ID_OXSEMI, 0xc15d,
4063 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4064 pbn_oxsemi_2_4000000 },
4065 { PCI_VENDOR_ID_OXSEMI, 0xc208,
4066 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4067 pbn_oxsemi_4_4000000 },
4068 { PCI_VENDOR_ID_OXSEMI, 0xc20d,
4069 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4070 pbn_oxsemi_4_4000000 },
4071 { PCI_VENDOR_ID_OXSEMI, 0xc308,
4072 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4073 pbn_oxsemi_8_4000000 },
4074 { PCI_VENDOR_ID_OXSEMI, 0xc30d,
4075 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4076 pbn_oxsemi_8_4000000 },
4077 { PCI_VENDOR_ID_OXSEMI, 0xc40b,
4078 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4079 pbn_oxsemi_1_4000000 },
4080 { PCI_VENDOR_ID_OXSEMI, 0xc40f,
4081 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4082 pbn_oxsemi_1_4000000 },
4083 { PCI_VENDOR_ID_OXSEMI, 0xc41b,
4084 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4085 pbn_oxsemi_1_4000000 },
4086 { PCI_VENDOR_ID_OXSEMI, 0xc41f,
4087 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4088 pbn_oxsemi_1_4000000 },
4089 { PCI_VENDOR_ID_OXSEMI, 0xc42b,
4090 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4091 pbn_oxsemi_1_4000000 },
4092 { PCI_VENDOR_ID_OXSEMI, 0xc42f,
4093 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4094 pbn_oxsemi_1_4000000 },
4095 { PCI_VENDOR_ID_OXSEMI, 0xc43b,
4096 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4097 pbn_oxsemi_1_4000000 },
4098 { PCI_VENDOR_ID_OXSEMI, 0xc43f,
4099 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4100 pbn_oxsemi_1_4000000 },
4101 { PCI_VENDOR_ID_OXSEMI, 0xc44b,
4102 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4103 pbn_oxsemi_1_4000000 },
4104 { PCI_VENDOR_ID_OXSEMI, 0xc44f,
4105 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4106 pbn_oxsemi_1_4000000 },
4107 { PCI_VENDOR_ID_OXSEMI, 0xc45b,
4108 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4109 pbn_oxsemi_1_4000000 },
4110 { PCI_VENDOR_ID_OXSEMI, 0xc45f,
4111 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4112 pbn_oxsemi_1_4000000 },
4113 { PCI_VENDOR_ID_OXSEMI, 0xc46b,
4114 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4115 pbn_oxsemi_1_4000000 },
4116 { PCI_VENDOR_ID_OXSEMI, 0xc46f,
4117 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4118 pbn_oxsemi_1_4000000 },
4119 { PCI_VENDOR_ID_OXSEMI, 0xc47b,
4120 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4121 pbn_oxsemi_1_4000000 },
4122 { PCI_VENDOR_ID_OXSEMI, 0xc47f,
4123 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4124 pbn_oxsemi_1_4000000 },
4125 { PCI_VENDOR_ID_OXSEMI, 0xc48b,
4126 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4127 pbn_oxsemi_1_4000000 },
4128 { PCI_VENDOR_ID_OXSEMI, 0xc48f,
4129 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4130 pbn_oxsemi_1_4000000 },
4131 { PCI_VENDOR_ID_OXSEMI, 0xc49b,
4132 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4133 pbn_oxsemi_1_4000000 },
4134 { PCI_VENDOR_ID_OXSEMI, 0xc49f,
4135 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4136 pbn_oxsemi_1_4000000 },
4137 { PCI_VENDOR_ID_OXSEMI, 0xc4ab,
4138 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4139 pbn_oxsemi_1_4000000 },
4140 { PCI_VENDOR_ID_OXSEMI, 0xc4af,
4141 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4142 pbn_oxsemi_1_4000000 },
4143 { PCI_VENDOR_ID_OXSEMI, 0xc4bb,
4144 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4145 pbn_oxsemi_1_4000000 },
4146 { PCI_VENDOR_ID_OXSEMI, 0xc4bf,
4147 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4148 pbn_oxsemi_1_4000000 },
4149 { PCI_VENDOR_ID_OXSEMI, 0xc4cb,
4150 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4151 pbn_oxsemi_1_4000000 },
4152 { PCI_VENDOR_ID_OXSEMI, 0xc4cf,
4153 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4154 pbn_oxsemi_1_4000000 },
4155
4156
4157
4158 { PCI_VENDOR_ID_MAINPINE, 0x4000,
4159 PCI_VENDOR_ID_MAINPINE, 0x4001, 0, 0,
4160 pbn_oxsemi_1_4000000 },
4161 { PCI_VENDOR_ID_MAINPINE, 0x4000,
4162 PCI_VENDOR_ID_MAINPINE, 0x4002, 0, 0,
4163 pbn_oxsemi_2_4000000 },
4164 { PCI_VENDOR_ID_MAINPINE, 0x4000,
4165 PCI_VENDOR_ID_MAINPINE, 0x4004, 0, 0,
4166 pbn_oxsemi_4_4000000 },
4167 { PCI_VENDOR_ID_MAINPINE, 0x4000,
4168 PCI_VENDOR_ID_MAINPINE, 0x4008, 0, 0,
4169 pbn_oxsemi_8_4000000 },
4170
4171
4172
4173
4174 { PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_2_OX_IBM,
4175 PCI_SUBVENDOR_ID_IBM, PCI_ANY_ID, 0, 0,
4176 pbn_oxsemi_2_4000000 },
4177
4178
4179
4180
4181
4182 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4183 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO232, 0, 0,
4184 pbn_sbsxrsio },
4185 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4186 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO422, 0, 0,
4187 pbn_sbsxrsio },
4188 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4189 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL232, 0, 0,
4190 pbn_sbsxrsio },
4191 { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
4192 PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL422, 0, 0,
4193 pbn_sbsxrsio },
4194
4195
4196
4197
4198 { PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_ATT_VENUS_MODEM,
4199 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4200 pbn_b1_1_115200 },
4201
4202
4203
4204
4205
4206 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100,
4207 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4208 pbn_b0_1_921600 },
4209 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200,
4210 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4211 pbn_b0_2_921600 },
4212 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400,
4213 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4214 pbn_b0_4_921600 },
4215 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800B,
4216 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4217 pbn_b0_4_921600 },
4218 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100L,
4219 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4220 pbn_b1_1_921600 },
4221 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200L,
4222 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4223 pbn_b1_bt_2_921600 },
4224 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400L,
4225 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4226 pbn_b0_bt_4_921600 },
4227 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800L,
4228 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4229 pbn_b0_bt_8_921600 },
4230 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200I,
4231 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4232 pbn_b4_bt_2_921600 },
4233 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400I,
4234 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4235 pbn_b4_bt_4_921600 },
4236 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800I,
4237 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4238 pbn_b4_bt_8_921600 },
4239 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400EH,
4240 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4241 pbn_b0_4_921600 },
4242 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800EH,
4243 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4244 pbn_b0_4_921600 },
4245 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800EHB,
4246 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4247 pbn_b0_4_921600 },
4248 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100E,
4249 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4250 pbn_oxsemi_1_4000000 },
4251 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200E,
4252 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4253 pbn_oxsemi_2_4000000 },
4254 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400E,
4255 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4256 pbn_oxsemi_4_4000000 },
4257 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800E,
4258 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4259 pbn_oxsemi_8_4000000 },
4260 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EI,
4261 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4262 pbn_oxsemi_2_4000000 },
4263 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EISI,
4264 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4265 pbn_oxsemi_2_4000000 },
4266 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200V3,
4267 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4268 pbn_b0_bt_2_921600 },
4269 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400V3,
4270 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4271 pbn_b0_4_921600 },
4272 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_410V3,
4273 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4274 pbn_b0_4_921600 },
4275 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800V3,
4276 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4277 pbn_b0_4_921600 },
4278 { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800V3B,
4279 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4280 pbn_b0_4_921600 },
4281
4282 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550,
4283 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4284 pbn_b2_1_460800 },
4285 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_650,
4286 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4287 pbn_b2_1_460800 },
4288 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_850,
4289 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4290 pbn_b2_1_460800 },
4291 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_550,
4292 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4293 pbn_b2_bt_2_921600 },
4294 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_650,
4295 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4296 pbn_b2_bt_2_921600 },
4297 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_850,
4298 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4299 pbn_b2_bt_2_921600 },
4300 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_550,
4301 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4302 pbn_b2_bt_4_921600 },
4303 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_650,
4304 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4305 pbn_b2_bt_4_921600 },
4306 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_850,
4307 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4308 pbn_b2_bt_4_921600 },
4309 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_550,
4310 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4311 pbn_b0_1_921600 },
4312 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_650,
4313 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4314 pbn_b0_1_921600 },
4315 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_850,
4316 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4317 pbn_b0_1_921600 },
4318 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_550,
4319 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4320 pbn_b0_bt_2_921600 },
4321 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_650,
4322 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4323 pbn_b0_bt_2_921600 },
4324 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_850,
4325 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4326 pbn_b0_bt_2_921600 },
4327 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_550,
4328 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4329 pbn_b0_bt_4_921600 },
4330 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_650,
4331 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4332 pbn_b0_bt_4_921600 },
4333 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_850,
4334 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4335 pbn_b0_bt_4_921600 },
4336 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_550,
4337 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4338 pbn_b0_bt_8_921600 },
4339 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_650,
4340 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4341 pbn_b0_bt_8_921600 },
4342 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_850,
4343 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4344 pbn_b0_bt_8_921600 },
4345
4346
4347
4348
4349 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
4350 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG4,
4351 0, 0, pbn_computone_4 },
4352 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
4353 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG8,
4354 0, 0, pbn_computone_8 },
4355 { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
4356 PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG6,
4357 0, 0, pbn_computone_6 },
4358
4359 { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI95N,
4360 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4361 pbn_oxsemi },
4362 { PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
4363 PCI_VENDOR_ID_TIMEDIA, PCI_ANY_ID, 0, 0,
4364 pbn_b0_bt_1_921600 },
4365
4366
4367
4368
4369 { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
4370 PCI_VENDOR_ID_SUNIX, PCI_ANY_ID,
4371 PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xffff00,
4372 pbn_b0_bt_1_921600 },
4373
4374 { PCI_VENDOR_ID_SUNIX, PCI_DEVICE_ID_SUNIX_1999,
4375 PCI_VENDOR_ID_SUNIX, PCI_ANY_ID,
4376 PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00,
4377 pbn_b0_bt_1_921600 },
4378
4379
4380
4381
4382 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028,
4383 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4384 pbn_b0_bt_8_115200 },
4385 { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P030,
4386 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4387 pbn_b0_bt_8_115200 },
4388
4389 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL,
4390 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4391 pbn_b0_bt_2_115200 },
4392 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_A,
4393 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4394 pbn_b0_bt_2_115200 },
4395 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_B,
4396 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4397 pbn_b0_bt_2_115200 },
4398 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATTRO_A,
4399 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4400 pbn_b0_bt_2_115200 },
4401 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATTRO_B,
4402 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4403 pbn_b0_bt_2_115200 },
4404 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_A,
4405 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4406 pbn_b0_bt_4_460800 },
4407 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_B,
4408 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4409 pbn_b0_bt_4_460800 },
4410 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_PLUS,
4411 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4412 pbn_b0_bt_2_460800 },
4413 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_A,
4414 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4415 pbn_b0_bt_2_460800 },
4416 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_B,
4417 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4418 pbn_b0_bt_2_460800 },
4419 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_SSERIAL,
4420 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4421 pbn_b0_bt_1_115200 },
4422 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_650,
4423 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4424 pbn_b0_bt_1_460800 },
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4435 0x1204, 0x0004, 0, 0,
4436 pbn_b0_4_921600 },
4437 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
4438 0x1208, 0x0004, 0, 0,
4439 pbn_b0_4_921600 },
4440
4441
4442
4443
4444
4445
4446 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF1,
4447 0x1208, 0x0004, 0, 0,
4448 pbn_b0_4_921600 },
4449
4450 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF2,
4451 0x1204, 0x0004, 0, 0,
4452 pbn_b0_4_921600 },
4453 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF2,
4454 0x1208, 0x0004, 0, 0,
4455 pbn_b0_4_921600 },
4456 { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF3,
4457 0x1208, 0x0004, 0, 0,
4458 pbn_b0_4_921600 },
4459
4460
4461
4462 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,
4463 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4464 pbn_b1_1_1382400 },
4465
4466
4467
4468
4469 { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RACIII,
4470 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4471 pbn_b1_1_1382400 },
4472
4473
4474
4475
4476 { PCI_VENDOR_ID_MORETON, PCI_DEVICE_ID_RASTEL_2PORT,
4477 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4478 pbn_b2_bt_2_115200 },
4479
4480
4481
4482
4483 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80960_RP,
4484 0xE4BF, PCI_ANY_ID, 0, 0,
4485 pbn_intel_i960 },
4486
4487
4488
4489
4490 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_X3201_MDM,
4491 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4492 pbn_b0_1_115200 },
4493
4494
4495
4496 { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_RBM56G,
4497 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4498 pbn_b0_1_115200 },
4499
4500
4501
4502
4503
4504
4505
4506
4507 { PCI_VENDOR_ID_ROCKWELL, 0x1004,
4508 0x1048, 0x1500, 0, 0,
4509 pbn_b1_1_115200 },
4510
4511 { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
4512 0xFF00, 0, 0, 0,
4513 pbn_sgi_ioc3 },
4514
4515
4516
4517
4518 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
4519 PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_RMP3, 0, 0,
4520 pbn_b1_1_115200 },
4521 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
4522 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4523 pbn_b0_5_115200 },
4524 { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_AUX,
4525 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4526 pbn_b2_1_115200 },
4527
4528 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM2,
4529 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4530 pbn_b3_2_115200 },
4531 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM4,
4532 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4533 pbn_b3_4_115200 },
4534 { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM8,
4535 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4536 pbn_b3_8_115200 },
4537
4538
4539
4540 { PCI_VENDOR_ID_PERICOM, PCI_DEVICE_ID_PERICOM_PI7C9X7951,
4541 PCI_ANY_ID, PCI_ANY_ID,
4542 0,
4543 0, pbn_pericom_PI7C9X7951 },
4544 { PCI_VENDOR_ID_PERICOM, PCI_DEVICE_ID_PERICOM_PI7C9X7952,
4545 PCI_ANY_ID, PCI_ANY_ID,
4546 0,
4547 0, pbn_pericom_PI7C9X7952 },
4548 { PCI_VENDOR_ID_PERICOM, PCI_DEVICE_ID_PERICOM_PI7C9X7954,
4549 PCI_ANY_ID, PCI_ANY_ID,
4550 0,
4551 0, pbn_pericom_PI7C9X7954 },
4552 { PCI_VENDOR_ID_PERICOM, PCI_DEVICE_ID_PERICOM_PI7C9X7958,
4553 PCI_ANY_ID, PCI_ANY_ID,
4554 0,
4555 0, pbn_pericom_PI7C9X7958 },
4556
4557
4558
4559 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SDB,
4560 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4561 pbn_pericom_PI7C9X7954 },
4562 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2S,
4563 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4564 pbn_pericom_PI7C9X7954 },
4565 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SDB,
4566 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4567 pbn_pericom_PI7C9X7954 },
4568 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4S,
4569 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4570 pbn_pericom_PI7C9X7954 },
4571 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_2DB,
4572 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4573 pbn_pericom_PI7C9X7954 },
4574 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM232_2,
4575 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4576 pbn_pericom_PI7C9X7954 },
4577 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4DB,
4578 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4579 pbn_pericom_PI7C9X7954 },
4580 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM232_4,
4581 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4582 pbn_pericom_PI7C9X7954 },
4583 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SMDB,
4584 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4585 pbn_pericom_PI7C9X7954 },
4586 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2SM,
4587 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4588 pbn_pericom_PI7C9X7954 },
4589 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SMDB,
4590 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4591 pbn_pericom_PI7C9X7954 },
4592 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_COM_4SM,
4593 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4594 pbn_pericom_PI7C9X7954 },
4595 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_1,
4596 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4597 pbn_pericom_PI7C9X7954 },
4598 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_2,
4599 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4600 pbn_pericom_PI7C9X7954 },
4601 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_2,
4602 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4603 pbn_pericom_PI7C9X7954 },
4604 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM422_4,
4605 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4606 pbn_pericom_PI7C9X7954 },
4607 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM485_4,
4608 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4609 pbn_pericom_PI7C9X7954 },
4610 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2S,
4611 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4612 pbn_pericom_PI7C9X7954 },
4613 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4S,
4614 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4615 pbn_pericom_PI7C9X7954 },
4616 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_2,
4617 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4618 pbn_pericom_PI7C9X7954 },
4619 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM232_2,
4620 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4621 pbn_pericom_PI7C9X7954 },
4622 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM232_4,
4623 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4624 pbn_pericom_PI7C9X7954 },
4625 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_MPCIE_ICM232_4,
4626 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4627 pbn_pericom_PI7C9X7954 },
4628 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_2SM,
4629 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4630 pbn_pericom_PI7C9X7954 },
4631 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM422_4,
4632 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4633 pbn_pericom_PI7C9X7958 },
4634 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM485_4,
4635 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4636 pbn_pericom_PI7C9X7958 },
4637 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM422_8,
4638 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4639 pbn_pericom_PI7C9X7958 },
4640 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM485_8,
4641 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4642 pbn_pericom_PI7C9X7958 },
4643 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_4,
4644 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4645 pbn_pericom_PI7C9X7958 },
4646 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM232_8,
4647 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4648 pbn_pericom_PI7C9X7958 },
4649 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_4SM,
4650 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4651 pbn_pericom_PI7C9X7958 },
4652 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_COM_8SM,
4653 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4654 pbn_pericom_PI7C9X7958 },
4655 { PCI_VENDOR_ID_ACCESIO, PCI_DEVICE_ID_ACCESIO_PCIE_ICM_4SM,
4656 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4657 pbn_pericom_PI7C9X7958 },
4658
4659
4660
4661 { PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560,
4662 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4663 pbn_b0_1_115200 },
4664
4665
4666
4667 { PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8872,
4668 PCI_ANY_ID, PCI_ANY_ID,
4669 0, 0,
4670 pbn_b1_bt_1_115200 },
4671
4672
4673
4674
4675 { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS200,
4676 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4677 pbn_b2_2_115200 },
4678
4679
4680
4681 { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS400,
4682 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4683 pbn_b2_4_115200 },
4684
4685
4686
4687 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
4688 PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS4,
4689 0, 0, pbn_b2_4_921600 },
4690 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
4691 PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS8,
4692 0, 0, pbn_b2_8_921600 },
4693
4694
4695
4696
4697
4698
4699
4700 {
4701 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4702 PCI_VENDOR_ID_MAINPINE, 0x0200,
4703 0, 0, pbn_b0_2_115200 },
4704 {
4705 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4706 PCI_VENDOR_ID_MAINPINE, 0x0300,
4707 0, 0, pbn_b0_4_115200 },
4708 {
4709 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4710 PCI_VENDOR_ID_MAINPINE, 0x0400,
4711 0, 0, pbn_b0_2_115200 },
4712 {
4713 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4714 PCI_VENDOR_ID_MAINPINE, 0x0500,
4715 0, 0, pbn_b0_4_115200 },
4716 {
4717 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4718 PCI_VENDOR_ID_MAINPINE, 0x0600,
4719 0, 0, pbn_b0_2_115200 },
4720 {
4721 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4722 PCI_VENDOR_ID_MAINPINE, 0x0700,
4723 0, 0, pbn_b0_4_115200 },
4724 {
4725 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4726 PCI_VENDOR_ID_MAINPINE, 0x0800,
4727 0, 0, pbn_b0_8_115200 },
4728 {
4729 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4730 PCI_VENDOR_ID_MAINPINE, 0x0C00,
4731 0, 0, pbn_b0_2_115200 },
4732 {
4733 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4734 PCI_VENDOR_ID_MAINPINE, 0x0D00,
4735 0, 0, pbn_b0_4_115200 },
4736 {
4737 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4738 PCI_VENDOR_ID_MAINPINE, 0x1D00,
4739 0, 0, pbn_b0_8_115200 },
4740 {
4741 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4742 PCI_VENDOR_ID_MAINPINE, 0x2000,
4743 0, 0, pbn_b0_1_115200 },
4744 {
4745 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4746 PCI_VENDOR_ID_MAINPINE, 0x2100,
4747 0, 0, pbn_b0_1_115200 },
4748 {
4749 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4750 PCI_VENDOR_ID_MAINPINE, 0x2200,
4751 0, 0, pbn_b0_2_115200 },
4752 {
4753 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4754 PCI_VENDOR_ID_MAINPINE, 0x2300,
4755 0, 0, pbn_b0_2_115200 },
4756 {
4757 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4758 PCI_VENDOR_ID_MAINPINE, 0x2400,
4759 0, 0, pbn_b0_4_115200 },
4760 {
4761 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4762 PCI_VENDOR_ID_MAINPINE, 0x2500,
4763 0, 0, pbn_b0_4_115200 },
4764 {
4765 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4766 PCI_VENDOR_ID_MAINPINE, 0x2600,
4767 0, 0, pbn_b0_8_115200 },
4768 {
4769 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4770 PCI_VENDOR_ID_MAINPINE, 0x2700,
4771 0, 0, pbn_b0_8_115200 },
4772 {
4773 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4774 PCI_VENDOR_ID_MAINPINE, 0x3000,
4775 0, 0, pbn_b0_1_115200 },
4776 {
4777 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4778 PCI_VENDOR_ID_MAINPINE, 0x3100,
4779 0, 0, pbn_b0_1_115200 },
4780 {
4781 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4782 PCI_VENDOR_ID_MAINPINE, 0x3200,
4783 0, 0, pbn_b0_2_115200 },
4784 {
4785 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4786 PCI_VENDOR_ID_MAINPINE, 0x3300,
4787 0, 0, pbn_b0_2_115200 },
4788 {
4789 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4790 PCI_VENDOR_ID_MAINPINE, 0x3400,
4791 0, 0, pbn_b0_4_115200 },
4792 {
4793 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4794 PCI_VENDOR_ID_MAINPINE, 0x3500,
4795 0, 0, pbn_b0_4_115200 },
4796 {
4797 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4798 PCI_VENDOR_ID_MAINPINE, 0x3C00,
4799 0, 0, pbn_b0_8_115200 },
4800 {
4801 PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
4802 PCI_VENDOR_ID_MAINPINE, 0x3D00,
4803 0, 0, pbn_b0_8_115200 },
4804
4805
4806
4807
4808
4809 { PCI_VENDOR_ID_PASEMI, 0xa004,
4810 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4811 pbn_pasemi_1682M },
4812
4813
4814
4815
4816 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI23216,
4817 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4818 pbn_b1_16_115200 },
4819 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2328,
4820 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4821 pbn_b1_8_115200 },
4822 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2324,
4823 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4824 pbn_b1_bt_4_115200 },
4825 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2322,
4826 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4827 pbn_b1_bt_2_115200 },
4828 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2324I,
4829 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4830 pbn_b1_bt_4_115200 },
4831 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI2322I,
4832 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4833 pbn_b1_bt_2_115200 },
4834 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_23216,
4835 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4836 pbn_b1_16_115200 },
4837 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2328,
4838 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4839 pbn_b1_8_115200 },
4840 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2324,
4841 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4842 pbn_b1_bt_4_115200 },
4843 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8420_2322,
4844 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4845 pbn_b1_bt_2_115200 },
4846 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8422_2324,
4847 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4848 pbn_b1_bt_4_115200 },
4849 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8422_2322,
4850 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4851 pbn_b1_bt_2_115200 },
4852 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2322,
4853 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4854 pbn_ni8430_2 },
4855 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2322,
4856 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4857 pbn_ni8430_2 },
4858 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2324,
4859 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4860 pbn_ni8430_4 },
4861 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2324,
4862 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4863 pbn_ni8430_4 },
4864 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_2328,
4865 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4866 pbn_ni8430_8 },
4867 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_2328,
4868 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4869 pbn_ni8430_8 },
4870 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8430_23216,
4871 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4872 pbn_ni8430_16 },
4873 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8430_23216,
4874 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4875 pbn_ni8430_16 },
4876 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8432_2322,
4877 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4878 pbn_ni8430_2 },
4879 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8432_2322,
4880 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4881 pbn_ni8430_2 },
4882 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PXI8432_2324,
4883 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4884 pbn_ni8430_4 },
4885 { PCI_VENDOR_ID_NI, PCI_DEVICE_ID_NI_PCI8432_2324,
4886 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
4887 pbn_ni8430_4 },
4888
4889
4890
4891
4892 { PCI_VENDOR_ID_ADDIDATA,
4893 PCI_DEVICE_ID_ADDIDATA_APCI7500,
4894 PCI_ANY_ID,
4895 PCI_ANY_ID,
4896 0,
4897 0,
4898 pbn_b0_4_115200 },
4899
4900 { PCI_VENDOR_ID_ADDIDATA,
4901 PCI_DEVICE_ID_ADDIDATA_APCI7420,
4902 PCI_ANY_ID,
4903 PCI_ANY_ID,
4904 0,
4905 0,
4906 pbn_b0_2_115200 },
4907
4908 { PCI_VENDOR_ID_ADDIDATA,
4909 PCI_DEVICE_ID_ADDIDATA_APCI7300,
4910 PCI_ANY_ID,
4911 PCI_ANY_ID,
4912 0,
4913 0,
4914 pbn_b0_1_115200 },
4915
4916 { PCI_VENDOR_ID_AMCC,
4917 PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800,
4918 PCI_ANY_ID,
4919 PCI_ANY_ID,
4920 0,
4921 0,
4922 pbn_b1_8_115200 },
4923
4924 { PCI_VENDOR_ID_ADDIDATA,
4925 PCI_DEVICE_ID_ADDIDATA_APCI7500_2,
4926 PCI_ANY_ID,
4927 PCI_ANY_ID,
4928 0,
4929 0,
4930 pbn_b0_4_115200 },
4931
4932 { PCI_VENDOR_ID_ADDIDATA,
4933 PCI_DEVICE_ID_ADDIDATA_APCI7420_2,
4934 PCI_ANY_ID,
4935 PCI_ANY_ID,
4936 0,
4937 0,
4938 pbn_b0_2_115200 },
4939
4940 { PCI_VENDOR_ID_ADDIDATA,
4941 PCI_DEVICE_ID_ADDIDATA_APCI7300_2,
4942 PCI_ANY_ID,
4943 PCI_ANY_ID,
4944 0,
4945 0,
4946 pbn_b0_1_115200 },
4947
4948 { PCI_VENDOR_ID_ADDIDATA,
4949 PCI_DEVICE_ID_ADDIDATA_APCI7500_3,
4950 PCI_ANY_ID,
4951 PCI_ANY_ID,
4952 0,
4953 0,
4954 pbn_b0_4_115200 },
4955
4956 { PCI_VENDOR_ID_ADDIDATA,
4957 PCI_DEVICE_ID_ADDIDATA_APCI7420_3,
4958 PCI_ANY_ID,
4959 PCI_ANY_ID,
4960 0,
4961 0,
4962 pbn_b0_2_115200 },
4963
4964 { PCI_VENDOR_ID_ADDIDATA,
4965 PCI_DEVICE_ID_ADDIDATA_APCI7300_3,
4966 PCI_ANY_ID,
4967 PCI_ANY_ID,
4968 0,
4969 0,
4970 pbn_b0_1_115200 },
4971
4972 { PCI_VENDOR_ID_ADDIDATA,
4973 PCI_DEVICE_ID_ADDIDATA_APCI7800_3,
4974 PCI_ANY_ID,
4975 PCI_ANY_ID,
4976 0,
4977 0,
4978 pbn_b0_8_115200 },
4979
4980 { PCI_VENDOR_ID_ADDIDATA,
4981 PCI_DEVICE_ID_ADDIDATA_APCIe7500,
4982 PCI_ANY_ID,
4983 PCI_ANY_ID,
4984 0,
4985 0,
4986 pbn_ADDIDATA_PCIe_4_3906250 },
4987
4988 { PCI_VENDOR_ID_ADDIDATA,
4989 PCI_DEVICE_ID_ADDIDATA_APCIe7420,
4990 PCI_ANY_ID,
4991 PCI_ANY_ID,
4992 0,
4993 0,
4994 pbn_ADDIDATA_PCIe_2_3906250 },
4995
4996 { PCI_VENDOR_ID_ADDIDATA,
4997 PCI_DEVICE_ID_ADDIDATA_APCIe7300,
4998 PCI_ANY_ID,
4999 PCI_ANY_ID,
5000 0,
5001 0,
5002 pbn_ADDIDATA_PCIe_1_3906250 },
5003
5004 { PCI_VENDOR_ID_ADDIDATA,
5005 PCI_DEVICE_ID_ADDIDATA_APCIe7800,
5006 PCI_ANY_ID,
5007 PCI_ANY_ID,
5008 0,
5009 0,
5010 pbn_ADDIDATA_PCIe_8_3906250 },
5011
5012 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
5013 PCI_VENDOR_ID_IBM, 0x0299,
5014 0, 0, pbn_b0_bt_2_115200 },
5015
5016
5017
5018
5019
5020
5021
5022 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901,
5023 0xA000, 0x1000,
5024 0, 0, pbn_b0_1_115200 },
5025
5026
5027 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9912,
5028 0xA000, 0x1000,
5029 0, 0, pbn_b0_1_115200 },
5030
5031 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9922,
5032 0xA000, 0x1000,
5033 0, 0, pbn_b0_1_115200 },
5034
5035 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9904,
5036 0xA000, 0x1000,
5037 0, 0, pbn_b0_1_115200 },
5038
5039 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900,
5040 0xA000, 0x1000,
5041 0, 0, pbn_b0_1_115200 },
5042
5043 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900,
5044 0xA000, 0x3002,
5045 0, 0, pbn_NETMOS9900_2s_115200 },
5046
5047
5048
5049
5050
5051 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
5052 0xA000, 0x1000,
5053 0, 0, pbn_b0_1_115200 },
5054
5055 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
5056 0xA000, 0x3002,
5057 0, 0, pbn_b0_bt_2_115200 },
5058
5059 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9865,
5060 0xA000, 0x3004,
5061 0, 0, pbn_b0_bt_4_115200 },
5062
5063 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CE4100_UART,
5064 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5065 pbn_ce4100_1_115200 },
5066
5067
5068
5069
5070 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_CRONYX_OMEGA,
5071 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5072 pbn_omegapci },
5073
5074
5075
5076
5077 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BROADCOM_TRUMANAGE,
5078 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
5079 pbn_brcm_trumanage },
5080
5081
5082
5083
5084 { PCI_VENDOR_ID_AGESTAR, PCI_DEVICE_ID_AGESTAR_9375,
5085 PCI_ANY_ID, PCI_ANY_ID,
5086 0, 0, pbn_b0_bt_2_115200 },
5087
5088
5089
5090
5091
5092 { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH353_4S,
5093 PCI_ANY_ID, PCI_ANY_ID,
5094 0, 0, pbn_b0_bt_4_115200 },
5095
5096 { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH353_2S1PF,
5097 PCI_ANY_ID, PCI_ANY_ID,
5098 0, 0, pbn_b0_bt_2_115200 },
5099
5100 { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH355_4S,
5101 PCI_ANY_ID, PCI_ANY_ID,
5102 0, 0, pbn_b0_bt_4_115200 },
5103
5104 { PCIE_VENDOR_ID_WCH, PCIE_DEVICE_ID_WCH_CH382_2S,
5105 PCI_ANY_ID, PCI_ANY_ID,
5106 0, 0, pbn_wch382_2 },
5107
5108 { PCIE_VENDOR_ID_WCH, PCIE_DEVICE_ID_WCH_CH384_4S,
5109 PCI_ANY_ID, PCI_ANY_ID,
5110 0, 0, pbn_wch384_4 },
5111
5112
5113 { PCI_DEVICE(0x1c29, 0x1104), .driver_data = pbn_fintek_4 },
5114 { PCI_DEVICE(0x1c29, 0x1108), .driver_data = pbn_fintek_8 },
5115 { PCI_DEVICE(0x1c29, 0x1112), .driver_data = pbn_fintek_12 },
5116
5117
5118 { PCI_DEVICE(0x1601, 0x0800), .driver_data = pbn_b0_4_1250000 },
5119 { PCI_DEVICE(0x1601, 0xa801), .driver_data = pbn_b0_4_1250000 },
5120
5121
5122
5123
5124
5125 { PCI_ANY_ID, PCI_ANY_ID,
5126 PCI_ANY_ID, PCI_ANY_ID,
5127 PCI_CLASS_COMMUNICATION_SERIAL << 8,
5128 0xffff00, pbn_default },
5129 { PCI_ANY_ID, PCI_ANY_ID,
5130 PCI_ANY_ID, PCI_ANY_ID,
5131 PCI_CLASS_COMMUNICATION_MODEM << 8,
5132 0xffff00, pbn_default },
5133 { PCI_ANY_ID, PCI_ANY_ID,
5134 PCI_ANY_ID, PCI_ANY_ID,
5135 PCI_CLASS_COMMUNICATION_MULTISERIAL << 8,
5136 0xffff00, pbn_default },
5137 { 0, }
5138};
5139
5140static pci_ers_result_t serial8250_io_error_detected(struct pci_dev *dev,
5141 pci_channel_state_t state)
5142{
5143 struct serial_private *priv = pci_get_drvdata(dev);
5144
5145 if (state == pci_channel_io_perm_failure)
5146 return PCI_ERS_RESULT_DISCONNECT;
5147
5148 if (priv)
5149 pciserial_detach_ports(priv);
5150
5151 pci_disable_device(dev);
5152
5153 return PCI_ERS_RESULT_NEED_RESET;
5154}
5155
5156static pci_ers_result_t serial8250_io_slot_reset(struct pci_dev *dev)
5157{
5158 int rc;
5159
5160 rc = pci_enable_device(dev);
5161
5162 if (rc)
5163 return PCI_ERS_RESULT_DISCONNECT;
5164
5165 pci_restore_state(dev);
5166 pci_save_state(dev);
5167
5168 return PCI_ERS_RESULT_RECOVERED;
5169}
5170
5171static void serial8250_io_resume(struct pci_dev *dev)
5172{
5173 struct serial_private *priv = pci_get_drvdata(dev);
5174 struct serial_private *new;
5175
5176 if (!priv)
5177 return;
5178
5179 new = pciserial_init_ports(dev, priv->board);
5180 if (!IS_ERR(new)) {
5181 pci_set_drvdata(dev, new);
5182 kfree(priv);
5183 }
5184}
5185
5186static const struct pci_error_handlers serial8250_err_handler = {
5187 .error_detected = serial8250_io_error_detected,
5188 .slot_reset = serial8250_io_slot_reset,
5189 .resume = serial8250_io_resume,
5190};
5191
5192static struct pci_driver serial_pci_driver = {
5193 .name = "serial",
5194 .probe = pciserial_init_one,
5195 .remove = pciserial_remove_one,
5196 .driver = {
5197 .pm = &pciserial_pm_ops,
5198 },
5199 .id_table = serial_pci_tbl,
5200 .err_handler = &serial8250_err_handler,
5201};
5202
5203module_pci_driver(serial_pci_driver);
5204
5205MODULE_LICENSE("GPL");
5206MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module");
5207MODULE_DEVICE_TABLE(pci, serial_pci_tbl);
5208