8250_pci.c 80 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152
  1. /*
  2. * linux/drivers/char/8250_pci.c
  3. *
  4. * Probe module for 8250/16550-type PCI serial ports.
  5. *
  6. * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
  7. *
  8. * Copyright (C) 2001 Russell King, All Rights Reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License.
  13. */
  14. #include <linux/module.h>
  15. #include <linux/init.h>
  16. #include <linux/pci.h>
  17. #include <linux/string.h>
  18. #include <linux/kernel.h>
  19. #include <linux/slab.h>
  20. #include <linux/delay.h>
  21. #include <linux/tty.h>
  22. #include <linux/serial_core.h>
  23. #include <linux/8250_pci.h>
  24. #include <linux/bitops.h>
  25. #include <asm/byteorder.h>
  26. #include <asm/io.h>
  27. #include "8250.h"
  28. #undef SERIAL_DEBUG_PCI
  29. /*
  30. * init function returns:
  31. * > 0 - number of ports
  32. * = 0 - use board->num_ports
  33. * < 0 - error
  34. */
  35. struct pci_serial_quirk {
  36. u32 vendor;
  37. u32 device;
  38. u32 subvendor;
  39. u32 subdevice;
  40. int (*init)(struct pci_dev *dev);
  41. int (*setup)(struct serial_private *,
  42. const struct pciserial_board *,
  43. struct uart_port *, int);
  44. void (*exit)(struct pci_dev *dev);
  45. };
  46. #define PCI_NUM_BAR_RESOURCES 6
  47. struct serial_private {
  48. struct pci_dev *dev;
  49. unsigned int nr;
  50. void __iomem *remapped_bar[PCI_NUM_BAR_RESOURCES];
  51. struct pci_serial_quirk *quirk;
  52. int line[0];
  53. };
  54. static void moan_device(const char *str, struct pci_dev *dev)
  55. {
  56. printk(KERN_WARNING "%s: %s\n"
  57. KERN_WARNING "Please send the output of lspci -vv, this\n"
  58. KERN_WARNING "message (0x%04x,0x%04x,0x%04x,0x%04x), the\n"
  59. KERN_WARNING "manufacturer and name of serial board or\n"
  60. KERN_WARNING "modem board to rmk+serial@arm.linux.org.uk.\n",
  61. pci_name(dev), str, dev->vendor, dev->device,
  62. dev->subsystem_vendor, dev->subsystem_device);
  63. }
  64. static int
  65. setup_port(struct serial_private *priv, struct uart_port *port,
  66. int bar, int offset, int regshift)
  67. {
  68. struct pci_dev *dev = priv->dev;
  69. unsigned long base, len;
  70. if (bar >= PCI_NUM_BAR_RESOURCES)
  71. return -EINVAL;
  72. base = pci_resource_start(dev, bar);
  73. if (pci_resource_flags(dev, bar) & IORESOURCE_MEM) {
  74. len = pci_resource_len(dev, bar);
  75. if (!priv->remapped_bar[bar])
  76. priv->remapped_bar[bar] = ioremap_nocache(base, len);
  77. if (!priv->remapped_bar[bar])
  78. return -ENOMEM;
  79. port->iotype = UPIO_MEM;
  80. port->iobase = 0;
  81. port->mapbase = base + offset;
  82. port->membase = priv->remapped_bar[bar] + offset;
  83. port->regshift = regshift;
  84. } else {
  85. port->iotype = UPIO_PORT;
  86. port->iobase = base + offset;
  87. port->mapbase = 0;
  88. port->membase = NULL;
  89. port->regshift = 0;
  90. }
  91. return 0;
  92. }
  93. /*
  94. * ADDI-DATA GmbH communication cards <info@addi-data.com>
  95. */
  96. static int addidata_apci7800_setup(struct serial_private *priv,
  97. const struct pciserial_board *board,
  98. struct uart_port *port, int idx)
  99. {
  100. unsigned int bar = 0, offset = board->first_offset;
  101. bar = FL_GET_BASE(board->flags);
  102. if (idx < 2) {
  103. offset += idx * board->uart_offset;
  104. } else if ((idx >= 2) && (idx < 4)) {
  105. bar += 1;
  106. offset += ((idx - 2) * board->uart_offset);
  107. } else if ((idx >= 4) && (idx < 6)) {
  108. bar += 2;
  109. offset += ((idx - 4) * board->uart_offset);
  110. } else if (idx >= 6) {
  111. bar += 3;
  112. offset += ((idx - 6) * board->uart_offset);
  113. }
  114. return setup_port(priv, port, bar, offset, board->reg_shift);
  115. }
  116. /*
  117. * AFAVLAB uses a different mixture of BARs and offsets
  118. * Not that ugly ;) -- HW
  119. */
  120. static int
  121. afavlab_setup(struct serial_private *priv, const struct pciserial_board *board,
  122. struct uart_port *port, int idx)
  123. {
  124. unsigned int bar, offset = board->first_offset;
  125. bar = FL_GET_BASE(board->flags);
  126. if (idx < 4)
  127. bar += idx;
  128. else {
  129. bar = 4;
  130. offset += (idx - 4) * board->uart_offset;
  131. }
  132. return setup_port(priv, port, bar, offset, board->reg_shift);
  133. }
  134. /*
  135. * HP's Remote Management Console. The Diva chip came in several
  136. * different versions. N-class, L2000 and A500 have two Diva chips, each
  137. * with 3 UARTs (the third UART on the second chip is unused). Superdome
  138. * and Keystone have one Diva chip with 3 UARTs. Some later machines have
  139. * one Diva chip, but it has been expanded to 5 UARTs.
  140. */
  141. static int pci_hp_diva_init(struct pci_dev *dev)
  142. {
  143. int rc = 0;
  144. switch (dev->subsystem_device) {
  145. case PCI_DEVICE_ID_HP_DIVA_TOSCA1:
  146. case PCI_DEVICE_ID_HP_DIVA_HALFDOME:
  147. case PCI_DEVICE_ID_HP_DIVA_KEYSTONE:
  148. case PCI_DEVICE_ID_HP_DIVA_EVEREST:
  149. rc = 3;
  150. break;
  151. case PCI_DEVICE_ID_HP_DIVA_TOSCA2:
  152. rc = 2;
  153. break;
  154. case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
  155. rc = 4;
  156. break;
  157. case PCI_DEVICE_ID_HP_DIVA_POWERBAR:
  158. case PCI_DEVICE_ID_HP_DIVA_HURRICANE:
  159. rc = 1;
  160. break;
  161. }
  162. return rc;
  163. }
  164. /*
  165. * HP's Diva chip puts the 4th/5th serial port further out, and
  166. * some serial ports are supposed to be hidden on certain models.
  167. */
  168. static int
  169. pci_hp_diva_setup(struct serial_private *priv,
  170. const struct pciserial_board *board,
  171. struct uart_port *port, int idx)
  172. {
  173. unsigned int offset = board->first_offset;
  174. unsigned int bar = FL_GET_BASE(board->flags);
  175. switch (priv->dev->subsystem_device) {
  176. case PCI_DEVICE_ID_HP_DIVA_MAESTRO:
  177. if (idx == 3)
  178. idx++;
  179. break;
  180. case PCI_DEVICE_ID_HP_DIVA_EVEREST:
  181. if (idx > 0)
  182. idx++;
  183. if (idx > 2)
  184. idx++;
  185. break;
  186. }
  187. if (idx > 2)
  188. offset = 0x18;
  189. offset += idx * board->uart_offset;
  190. return setup_port(priv, port, bar, offset, board->reg_shift);
  191. }
  192. /*
  193. * Added for EKF Intel i960 serial boards
  194. */
  195. static int pci_inteli960ni_init(struct pci_dev *dev)
  196. {
  197. unsigned long oldval;
  198. if (!(dev->subsystem_device & 0x1000))
  199. return -ENODEV;
  200. /* is firmware started? */
  201. pci_read_config_dword(dev, 0x44, (void *)&oldval);
  202. if (oldval == 0x00001000L) { /* RESET value */
  203. printk(KERN_DEBUG "Local i960 firmware missing");
  204. return -ENODEV;
  205. }
  206. return 0;
  207. }
  208. /*
  209. * Some PCI serial cards using the PLX 9050 PCI interface chip require
  210. * that the card interrupt be explicitly enabled or disabled. This
  211. * seems to be mainly needed on card using the PLX which also use I/O
  212. * mapped memory.
  213. */
  214. static int pci_plx9050_init(struct pci_dev *dev)
  215. {
  216. u8 irq_config;
  217. void __iomem *p;
  218. if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0) {
  219. moan_device("no memory in bar 0", dev);
  220. return 0;
  221. }
  222. irq_config = 0x41;
  223. if (dev->vendor == PCI_VENDOR_ID_PANACOM ||
  224. dev->subsystem_vendor == PCI_SUBVENDOR_ID_EXSYS)
  225. irq_config = 0x43;
  226. if ((dev->vendor == PCI_VENDOR_ID_PLX) &&
  227. (dev->device == PCI_DEVICE_ID_PLX_ROMULUS))
  228. /*
  229. * As the megawolf cards have the int pins active
  230. * high, and have 2 UART chips, both ints must be
  231. * enabled on the 9050. Also, the UARTS are set in
  232. * 16450 mode by default, so we have to enable the
  233. * 16C950 'enhanced' mode so that we can use the
  234. * deep FIFOs
  235. */
  236. irq_config = 0x5b;
  237. /*
  238. * enable/disable interrupts
  239. */
  240. p = ioremap_nocache(pci_resource_start(dev, 0), 0x80);
  241. if (p == NULL)
  242. return -ENOMEM;
  243. writel(irq_config, p + 0x4c);
  244. /*
  245. * Read the register back to ensure that it took effect.
  246. */
  247. readl(p + 0x4c);
  248. iounmap(p);
  249. return 0;
  250. }
  251. static void __devexit pci_plx9050_exit(struct pci_dev *dev)
  252. {
  253. u8 __iomem *p;
  254. if ((pci_resource_flags(dev, 0) & IORESOURCE_MEM) == 0)
  255. return;
  256. /*
  257. * disable interrupts
  258. */
  259. p = ioremap_nocache(pci_resource_start(dev, 0), 0x80);
  260. if (p != NULL) {
  261. writel(0, p + 0x4c);
  262. /*
  263. * Read the register back to ensure that it took effect.
  264. */
  265. readl(p + 0x4c);
  266. iounmap(p);
  267. }
  268. }
  269. /* SBS Technologies Inc. PMC-OCTPRO and P-OCTAL cards */
  270. static int
  271. sbs_setup(struct serial_private *priv, const struct pciserial_board *board,
  272. struct uart_port *port, int idx)
  273. {
  274. unsigned int bar, offset = board->first_offset;
  275. bar = 0;
  276. if (idx < 4) {
  277. /* first four channels map to 0, 0x100, 0x200, 0x300 */
  278. offset += idx * board->uart_offset;
  279. } else if (idx < 8) {
  280. /* last four channels map to 0x1000, 0x1100, 0x1200, 0x1300 */
  281. offset += idx * board->uart_offset + 0xC00;
  282. } else /* we have only 8 ports on PMC-OCTALPRO */
  283. return 1;
  284. return setup_port(priv, port, bar, offset, board->reg_shift);
  285. }
  286. /*
  287. * This does initialization for PMC OCTALPRO cards:
  288. * maps the device memory, resets the UARTs (needed, bc
  289. * if the module is removed and inserted again, the card
  290. * is in the sleep mode) and enables global interrupt.
  291. */
  292. /* global control register offset for SBS PMC-OctalPro */
  293. #define OCT_REG_CR_OFF 0x500
  294. static int sbs_init(struct pci_dev *dev)
  295. {
  296. u8 __iomem *p;
  297. p = ioremap_nocache(pci_resource_start(dev, 0),
  298. pci_resource_len(dev, 0));
  299. if (p == NULL)
  300. return -ENOMEM;
  301. /* Set bit-4 Control Register (UART RESET) in to reset the uarts */
  302. writeb(0x10, p + OCT_REG_CR_OFF);
  303. udelay(50);
  304. writeb(0x0, p + OCT_REG_CR_OFF);
  305. /* Set bit-2 (INTENABLE) of Control Register */
  306. writeb(0x4, p + OCT_REG_CR_OFF);
  307. iounmap(p);
  308. return 0;
  309. }
  310. /*
  311. * Disables the global interrupt of PMC-OctalPro
  312. */
  313. static void __devexit sbs_exit(struct pci_dev *dev)
  314. {
  315. u8 __iomem *p;
  316. p = ioremap_nocache(pci_resource_start(dev, 0),
  317. pci_resource_len(dev, 0));
  318. /* FIXME: What if resource_len < OCT_REG_CR_OFF */
  319. if (p != NULL)
  320. writeb(0, p + OCT_REG_CR_OFF);
  321. iounmap(p);
  322. }
  323. /*
  324. * SIIG serial cards have an PCI interface chip which also controls
  325. * the UART clocking frequency. Each UART can be clocked independently
  326. * (except cards equiped with 4 UARTs) and initial clocking settings
  327. * are stored in the EEPROM chip. It can cause problems because this
  328. * version of serial driver doesn't support differently clocked UART's
  329. * on single PCI card. To prevent this, initialization functions set
  330. * high frequency clocking for all UART's on given card. It is safe (I
  331. * hope) because it doesn't touch EEPROM settings to prevent conflicts
  332. * with other OSes (like M$ DOS).
  333. *
  334. * SIIG support added by Andrey Panin <pazke@donpac.ru>, 10/1999
  335. *
  336. * There is two family of SIIG serial cards with different PCI
  337. * interface chip and different configuration methods:
  338. * - 10x cards have control registers in IO and/or memory space;
  339. * - 20x cards have control registers in standard PCI configuration space.
  340. *
  341. * Note: all 10x cards have PCI device ids 0x10..
  342. * all 20x cards have PCI device ids 0x20..
  343. *
  344. * There are also Quartet Serial cards which use Oxford Semiconductor
  345. * 16954 quad UART PCI chip clocked by 18.432 MHz quartz.
  346. *
  347. * Note: some SIIG cards are probed by the parport_serial object.
  348. */
  349. #define PCI_DEVICE_ID_SIIG_1S_10x (PCI_DEVICE_ID_SIIG_1S_10x_550 & 0xfffc)
  350. #define PCI_DEVICE_ID_SIIG_2S_10x (PCI_DEVICE_ID_SIIG_2S_10x_550 & 0xfff8)
  351. static int pci_siig10x_init(struct pci_dev *dev)
  352. {
  353. u16 data;
  354. void __iomem *p;
  355. switch (dev->device & 0xfff8) {
  356. case PCI_DEVICE_ID_SIIG_1S_10x: /* 1S */
  357. data = 0xffdf;
  358. break;
  359. case PCI_DEVICE_ID_SIIG_2S_10x: /* 2S, 2S1P */
  360. data = 0xf7ff;
  361. break;
  362. default: /* 1S1P, 4S */
  363. data = 0xfffb;
  364. break;
  365. }
  366. p = ioremap_nocache(pci_resource_start(dev, 0), 0x80);
  367. if (p == NULL)
  368. return -ENOMEM;
  369. writew(readw(p + 0x28) & data, p + 0x28);
  370. readw(p + 0x28);
  371. iounmap(p);
  372. return 0;
  373. }
  374. #define PCI_DEVICE_ID_SIIG_2S_20x (PCI_DEVICE_ID_SIIG_2S_20x_550 & 0xfffc)
  375. #define PCI_DEVICE_ID_SIIG_2S1P_20x (PCI_DEVICE_ID_SIIG_2S1P_20x_550 & 0xfffc)
  376. static int pci_siig20x_init(struct pci_dev *dev)
  377. {
  378. u8 data;
  379. /* Change clock frequency for the first UART. */
  380. pci_read_config_byte(dev, 0x6f, &data);
  381. pci_write_config_byte(dev, 0x6f, data & 0xef);
  382. /* If this card has 2 UART, we have to do the same with second UART. */
  383. if (((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S_20x) ||
  384. ((dev->device & 0xfffc) == PCI_DEVICE_ID_SIIG_2S1P_20x)) {
  385. pci_read_config_byte(dev, 0x73, &data);
  386. pci_write_config_byte(dev, 0x73, data & 0xef);
  387. }
  388. return 0;
  389. }
  390. static int pci_siig_init(struct pci_dev *dev)
  391. {
  392. unsigned int type = dev->device & 0xff00;
  393. if (type == 0x1000)
  394. return pci_siig10x_init(dev);
  395. else if (type == 0x2000)
  396. return pci_siig20x_init(dev);
  397. moan_device("Unknown SIIG card", dev);
  398. return -ENODEV;
  399. }
  400. static int pci_siig_setup(struct serial_private *priv,
  401. const struct pciserial_board *board,
  402. struct uart_port *port, int idx)
  403. {
  404. unsigned int bar = FL_GET_BASE(board->flags) + idx, offset = 0;
  405. if (idx > 3) {
  406. bar = 4;
  407. offset = (idx - 4) * 8;
  408. }
  409. return setup_port(priv, port, bar, offset, 0);
  410. }
  411. /*
  412. * Timedia has an explosion of boards, and to avoid the PCI table from
  413. * growing *huge*, we use this function to collapse some 70 entries
  414. * in the PCI table into one, for sanity's and compactness's sake.
  415. */
  416. static const unsigned short timedia_single_port[] = {
  417. 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0
  418. };
  419. static const unsigned short timedia_dual_port[] = {
  420. 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
  421. 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079,
  422. 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079,
  423. 0x9137, 0x9138, 0x9237, 0x9238, 0xA079, 0xB079, 0xC079,
  424. 0xD079, 0
  425. };
  426. static const unsigned short timedia_quad_port[] = {
  427. 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157,
  428. 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159,
  429. 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
  430. 0xB157, 0
  431. };
  432. static const unsigned short timedia_eight_port[] = {
  433. 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166,
  434. 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
  435. };
  436. static const struct timedia_struct {
  437. int num;
  438. const unsigned short *ids;
  439. } timedia_data[] = {
  440. { 1, timedia_single_port },
  441. { 2, timedia_dual_port },
  442. { 4, timedia_quad_port },
  443. { 8, timedia_eight_port }
  444. };
  445. static int pci_timedia_init(struct pci_dev *dev)
  446. {
  447. const unsigned short *ids;
  448. int i, j;
  449. for (i = 0; i < ARRAY_SIZE(timedia_data); i++) {
  450. ids = timedia_data[i].ids;
  451. for (j = 0; ids[j]; j++)
  452. if (dev->subsystem_device == ids[j])
  453. return timedia_data[i].num;
  454. }
  455. return 0;
  456. }
  457. /*
  458. * Timedia/SUNIX uses a mixture of BARs and offsets
  459. * Ugh, this is ugly as all hell --- TYT
  460. */
  461. static int
  462. pci_timedia_setup(struct serial_private *priv,
  463. const struct pciserial_board *board,
  464. struct uart_port *port, int idx)
  465. {
  466. unsigned int bar = 0, offset = board->first_offset;
  467. switch (idx) {
  468. case 0:
  469. bar = 0;
  470. break;
  471. case 1:
  472. offset = board->uart_offset;
  473. bar = 0;
  474. break;
  475. case 2:
  476. bar = 1;
  477. break;
  478. case 3:
  479. offset = board->uart_offset;
  480. /* FALLTHROUGH */
  481. case 4: /* BAR 2 */
  482. case 5: /* BAR 3 */
  483. case 6: /* BAR 4 */
  484. case 7: /* BAR 5 */
  485. bar = idx - 2;
  486. }
  487. return setup_port(priv, port, bar, offset, board->reg_shift);
  488. }
  489. /*
  490. * Some Titan cards are also a little weird
  491. */
  492. static int
  493. titan_400l_800l_setup(struct serial_private *priv,
  494. const struct pciserial_board *board,
  495. struct uart_port *port, int idx)
  496. {
  497. unsigned int bar, offset = board->first_offset;
  498. switch (idx) {
  499. case 0:
  500. bar = 1;
  501. break;
  502. case 1:
  503. bar = 2;
  504. break;
  505. default:
  506. bar = 4;
  507. offset = (idx - 2) * board->uart_offset;
  508. }
  509. return setup_port(priv, port, bar, offset, board->reg_shift);
  510. }
  511. static int pci_xircom_init(struct pci_dev *dev)
  512. {
  513. msleep(100);
  514. return 0;
  515. }
  516. static int pci_netmos_init(struct pci_dev *dev)
  517. {
  518. /* subdevice 0x00PS means <P> parallel, <S> serial */
  519. unsigned int num_serial = dev->subsystem_device & 0xf;
  520. if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
  521. dev->subsystem_device == 0x0299)
  522. return 0;
  523. if (num_serial == 0)
  524. return -ENODEV;
  525. return num_serial;
  526. }
  527. /*
  528. * ITE support by Niels de Vos <niels.devos@wincor-nixdorf.com>
  529. *
  530. * These chips are available with optionally one parallel port and up to
  531. * two serial ports. Unfortunately they all have the same product id.
  532. *
  533. * Basic configuration is done over a region of 32 I/O ports. The base
  534. * ioport is called INTA or INTC, depending on docs/other drivers.
  535. *
  536. * The region of the 32 I/O ports is configured in POSIO0R...
  537. */
  538. /* registers */
  539. #define ITE_887x_MISCR 0x9c
  540. #define ITE_887x_INTCBAR 0x78
  541. #define ITE_887x_UARTBAR 0x7c
  542. #define ITE_887x_PS0BAR 0x10
  543. #define ITE_887x_POSIO0 0x60
  544. /* I/O space size */
  545. #define ITE_887x_IOSIZE 32
  546. /* I/O space size (bits 26-24; 8 bytes = 011b) */
  547. #define ITE_887x_POSIO_IOSIZE_8 (3 << 24)
  548. /* I/O space size (bits 26-24; 32 bytes = 101b) */
  549. #define ITE_887x_POSIO_IOSIZE_32 (5 << 24)
  550. /* Decoding speed (1 = slow, 2 = medium, 3 = fast) */
  551. #define ITE_887x_POSIO_SPEED (3 << 29)
  552. /* enable IO_Space bit */
  553. #define ITE_887x_POSIO_ENABLE (1 << 31)
  554. static int pci_ite887x_init(struct pci_dev *dev)
  555. {
  556. /* inta_addr are the configuration addresses of the ITE */
  557. static const short inta_addr[] = { 0x2a0, 0x2c0, 0x220, 0x240, 0x1e0,
  558. 0x200, 0x280, 0 };
  559. int ret, i, type;
  560. struct resource *iobase = NULL;
  561. u32 miscr, uartbar, ioport;
  562. /* search for the base-ioport */
  563. i = 0;
  564. while (inta_addr[i] && iobase == NULL) {
  565. iobase = request_region(inta_addr[i], ITE_887x_IOSIZE,
  566. "ite887x");
  567. if (iobase != NULL) {
  568. /* write POSIO0R - speed | size | ioport */
  569. pci_write_config_dword(dev, ITE_887x_POSIO0,
  570. ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED |
  571. ITE_887x_POSIO_IOSIZE_32 | inta_addr[i]);
  572. /* write INTCBAR - ioport */
  573. pci_write_config_dword(dev, ITE_887x_INTCBAR,
  574. inta_addr[i]);
  575. ret = inb(inta_addr[i]);
  576. if (ret != 0xff) {
  577. /* ioport connected */
  578. break;
  579. }
  580. release_region(iobase->start, ITE_887x_IOSIZE);
  581. iobase = NULL;
  582. }
  583. i++;
  584. }
  585. if (!inta_addr[i]) {
  586. printk(KERN_ERR "ite887x: could not find iobase\n");
  587. return -ENODEV;
  588. }
  589. /* start of undocumented type checking (see parport_pc.c) */
  590. type = inb(iobase->start + 0x18) & 0x0f;
  591. switch (type) {
  592. case 0x2: /* ITE8871 (1P) */
  593. case 0xa: /* ITE8875 (1P) */
  594. ret = 0;
  595. break;
  596. case 0xe: /* ITE8872 (2S1P) */
  597. ret = 2;
  598. break;
  599. case 0x6: /* ITE8873 (1S) */
  600. ret = 1;
  601. break;
  602. case 0x8: /* ITE8874 (2S) */
  603. ret = 2;
  604. break;
  605. default:
  606. moan_device("Unknown ITE887x", dev);
  607. ret = -ENODEV;
  608. }
  609. /* configure all serial ports */
  610. for (i = 0; i < ret; i++) {
  611. /* read the I/O port from the device */
  612. pci_read_config_dword(dev, ITE_887x_PS0BAR + (0x4 * (i + 1)),
  613. &ioport);
  614. ioport &= 0x0000FF00; /* the actual base address */
  615. pci_write_config_dword(dev, ITE_887x_POSIO0 + (0x4 * (i + 1)),
  616. ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED |
  617. ITE_887x_POSIO_IOSIZE_8 | ioport);
  618. /* write the ioport to the UARTBAR */
  619. pci_read_config_dword(dev, ITE_887x_UARTBAR, &uartbar);
  620. uartbar &= ~(0xffff << (16 * i)); /* clear half the reg */
  621. uartbar |= (ioport << (16 * i)); /* set the ioport */
  622. pci_write_config_dword(dev, ITE_887x_UARTBAR, uartbar);
  623. /* get current config */
  624. pci_read_config_dword(dev, ITE_887x_MISCR, &miscr);
  625. /* disable interrupts (UARTx_Routing[3:0]) */
  626. miscr &= ~(0xf << (12 - 4 * i));
  627. /* activate the UART (UARTx_En) */
  628. miscr |= 1 << (23 - i);
  629. /* write new config with activated UART */
  630. pci_write_config_dword(dev, ITE_887x_MISCR, miscr);
  631. }
  632. if (ret <= 0) {
  633. /* the device has no UARTs if we get here */
  634. release_region(iobase->start, ITE_887x_IOSIZE);
  635. }
  636. return ret;
  637. }
  638. static void __devexit pci_ite887x_exit(struct pci_dev *dev)
  639. {
  640. u32 ioport;
  641. /* the ioport is bit 0-15 in POSIO0R */
  642. pci_read_config_dword(dev, ITE_887x_POSIO0, &ioport);
  643. ioport &= 0xffff;
  644. release_region(ioport, ITE_887x_IOSIZE);
  645. }
  646. /*
  647. * Oxford Semiconductor Inc.
  648. * Check that device is part of the Tornado range of devices, then determine
  649. * the number of ports available on the device.
  650. */
  651. static int pci_oxsemi_tornado_init(struct pci_dev *dev)
  652. {
  653. u8 __iomem *p;
  654. unsigned long deviceID;
  655. unsigned int number_uarts = 0;
  656. /* OxSemi Tornado devices are all 0xCxxx */
  657. if (dev->vendor == PCI_VENDOR_ID_OXSEMI &&
  658. (dev->device & 0xF000) != 0xC000)
  659. return 0;
  660. p = pci_iomap(dev, 0, 5);
  661. if (p == NULL)
  662. return -ENOMEM;
  663. deviceID = ioread32(p);
  664. /* Tornado device */
  665. if (deviceID == 0x07000200) {
  666. number_uarts = ioread8(p + 4);
  667. printk(KERN_DEBUG
  668. "%d ports detected on Oxford PCI Express device\n",
  669. number_uarts);
  670. }
  671. pci_iounmap(dev, p);
  672. return number_uarts;
  673. }
  674. static int
  675. pci_default_setup(struct serial_private *priv,
  676. const struct pciserial_board *board,
  677. struct uart_port *port, int idx)
  678. {
  679. unsigned int bar, offset = board->first_offset, maxnr;
  680. bar = FL_GET_BASE(board->flags);
  681. if (board->flags & FL_BASE_BARS)
  682. bar += idx;
  683. else
  684. offset += idx * board->uart_offset;
  685. maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) >>
  686. (board->reg_shift + 3);
  687. if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
  688. return 1;
  689. return setup_port(priv, port, bar, offset, board->reg_shift);
  690. }
  691. /* This should be in linux/pci_ids.h */
  692. #define PCI_VENDOR_ID_SBSMODULARIO 0x124B
  693. #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
  694. #define PCI_DEVICE_ID_OCTPRO 0x0001
  695. #define PCI_SUBDEVICE_ID_OCTPRO232 0x0108
  696. #define PCI_SUBDEVICE_ID_OCTPRO422 0x0208
  697. #define PCI_SUBDEVICE_ID_POCTAL232 0x0308
  698. #define PCI_SUBDEVICE_ID_POCTAL422 0x0408
  699. /* Unknown vendors/cards - this should not be in linux/pci_ids.h */
  700. #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
  701. /*
  702. * Master list of serial port init/setup/exit quirks.
  703. * This does not describe the general nature of the port.
  704. * (ie, baud base, number and location of ports, etc)
  705. *
  706. * This list is ordered alphabetically by vendor then device.
  707. * Specific entries must come before more generic entries.
  708. */
  709. static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
  710. /*
  711. * ADDI-DATA GmbH communication cards <info@addi-data.com>
  712. */
  713. {
  714. .vendor = PCI_VENDOR_ID_ADDIDATA_OLD,
  715. .device = PCI_DEVICE_ID_ADDIDATA_APCI7800,
  716. .subvendor = PCI_ANY_ID,
  717. .subdevice = PCI_ANY_ID,
  718. .setup = addidata_apci7800_setup,
  719. },
  720. /*
  721. * AFAVLAB cards - these may be called via parport_serial
  722. * It is not clear whether this applies to all products.
  723. */
  724. {
  725. .vendor = PCI_VENDOR_ID_AFAVLAB,
  726. .device = PCI_ANY_ID,
  727. .subvendor = PCI_ANY_ID,
  728. .subdevice = PCI_ANY_ID,
  729. .setup = afavlab_setup,
  730. },
  731. /*
  732. * HP Diva
  733. */
  734. {
  735. .vendor = PCI_VENDOR_ID_HP,
  736. .device = PCI_DEVICE_ID_HP_DIVA,
  737. .subvendor = PCI_ANY_ID,
  738. .subdevice = PCI_ANY_ID,
  739. .init = pci_hp_diva_init,
  740. .setup = pci_hp_diva_setup,
  741. },
  742. /*
  743. * Intel
  744. */
  745. {
  746. .vendor = PCI_VENDOR_ID_INTEL,
  747. .device = PCI_DEVICE_ID_INTEL_80960_RP,
  748. .subvendor = 0xe4bf,
  749. .subdevice = PCI_ANY_ID,
  750. .init = pci_inteli960ni_init,
  751. .setup = pci_default_setup,
  752. },
  753. /*
  754. * ITE
  755. */
  756. {
  757. .vendor = PCI_VENDOR_ID_ITE,
  758. .device = PCI_DEVICE_ID_ITE_8872,
  759. .subvendor = PCI_ANY_ID,
  760. .subdevice = PCI_ANY_ID,
  761. .init = pci_ite887x_init,
  762. .setup = pci_default_setup,
  763. .exit = __devexit_p(pci_ite887x_exit),
  764. },
  765. /*
  766. * Panacom
  767. */
  768. {
  769. .vendor = PCI_VENDOR_ID_PANACOM,
  770. .device = PCI_DEVICE_ID_PANACOM_QUADMODEM,
  771. .subvendor = PCI_ANY_ID,
  772. .subdevice = PCI_ANY_ID,
  773. .init = pci_plx9050_init,
  774. .setup = pci_default_setup,
  775. .exit = __devexit_p(pci_plx9050_exit),
  776. },
  777. {
  778. .vendor = PCI_VENDOR_ID_PANACOM,
  779. .device = PCI_DEVICE_ID_PANACOM_DUALMODEM,
  780. .subvendor = PCI_ANY_ID,
  781. .subdevice = PCI_ANY_ID,
  782. .init = pci_plx9050_init,
  783. .setup = pci_default_setup,
  784. .exit = __devexit_p(pci_plx9050_exit),
  785. },
  786. /*
  787. * PLX
  788. */
  789. {
  790. .vendor = PCI_VENDOR_ID_PLX,
  791. .device = PCI_DEVICE_ID_PLX_9030,
  792. .subvendor = PCI_SUBVENDOR_ID_PERLE,
  793. .subdevice = PCI_ANY_ID,
  794. .setup = pci_default_setup,
  795. },
  796. {
  797. .vendor = PCI_VENDOR_ID_PLX,
  798. .device = PCI_DEVICE_ID_PLX_9050,
  799. .subvendor = PCI_SUBVENDOR_ID_EXSYS,
  800. .subdevice = PCI_SUBDEVICE_ID_EXSYS_4055,
  801. .init = pci_plx9050_init,
  802. .setup = pci_default_setup,
  803. .exit = __devexit_p(pci_plx9050_exit),
  804. },
  805. {
  806. .vendor = PCI_VENDOR_ID_PLX,
  807. .device = PCI_DEVICE_ID_PLX_9050,
  808. .subvendor = PCI_SUBVENDOR_ID_KEYSPAN,
  809. .subdevice = PCI_SUBDEVICE_ID_KEYSPAN_SX2,
  810. .init = pci_plx9050_init,
  811. .setup = pci_default_setup,
  812. .exit = __devexit_p(pci_plx9050_exit),
  813. },
  814. {
  815. .vendor = PCI_VENDOR_ID_PLX,
  816. .device = PCI_DEVICE_ID_PLX_9050,
  817. .subvendor = PCI_VENDOR_ID_PLX,
  818. .subdevice = PCI_SUBDEVICE_ID_UNKNOWN_0x1584,
  819. .init = pci_plx9050_init,
  820. .setup = pci_default_setup,
  821. .exit = __devexit_p(pci_plx9050_exit),
  822. },
  823. {
  824. .vendor = PCI_VENDOR_ID_PLX,
  825. .device = PCI_DEVICE_ID_PLX_ROMULUS,
  826. .subvendor = PCI_VENDOR_ID_PLX,
  827. .subdevice = PCI_DEVICE_ID_PLX_ROMULUS,
  828. .init = pci_plx9050_init,
  829. .setup = pci_default_setup,
  830. .exit = __devexit_p(pci_plx9050_exit),
  831. },
  832. /*
  833. * SBS Technologies, Inc., PMC-OCTALPRO 232
  834. */
  835. {
  836. .vendor = PCI_VENDOR_ID_SBSMODULARIO,
  837. .device = PCI_DEVICE_ID_OCTPRO,
  838. .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
  839. .subdevice = PCI_SUBDEVICE_ID_OCTPRO232,
  840. .init = sbs_init,
  841. .setup = sbs_setup,
  842. .exit = __devexit_p(sbs_exit),
  843. },
  844. /*
  845. * SBS Technologies, Inc., PMC-OCTALPRO 422
  846. */
  847. {
  848. .vendor = PCI_VENDOR_ID_SBSMODULARIO,
  849. .device = PCI_DEVICE_ID_OCTPRO,
  850. .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
  851. .subdevice = PCI_SUBDEVICE_ID_OCTPRO422,
  852. .init = sbs_init,
  853. .setup = sbs_setup,
  854. .exit = __devexit_p(sbs_exit),
  855. },
  856. /*
  857. * SBS Technologies, Inc., P-Octal 232
  858. */
  859. {
  860. .vendor = PCI_VENDOR_ID_SBSMODULARIO,
  861. .device = PCI_DEVICE_ID_OCTPRO,
  862. .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
  863. .subdevice = PCI_SUBDEVICE_ID_POCTAL232,
  864. .init = sbs_init,
  865. .setup = sbs_setup,
  866. .exit = __devexit_p(sbs_exit),
  867. },
  868. /*
  869. * SBS Technologies, Inc., P-Octal 422
  870. */
  871. {
  872. .vendor = PCI_VENDOR_ID_SBSMODULARIO,
  873. .device = PCI_DEVICE_ID_OCTPRO,
  874. .subvendor = PCI_SUBVENDOR_ID_SBSMODULARIO,
  875. .subdevice = PCI_SUBDEVICE_ID_POCTAL422,
  876. .init = sbs_init,
  877. .setup = sbs_setup,
  878. .exit = __devexit_p(sbs_exit),
  879. },
  880. /*
  881. * SIIG cards - these may be called via parport_serial
  882. */
  883. {
  884. .vendor = PCI_VENDOR_ID_SIIG,
  885. .device = PCI_ANY_ID,
  886. .subvendor = PCI_ANY_ID,
  887. .subdevice = PCI_ANY_ID,
  888. .init = pci_siig_init,
  889. .setup = pci_siig_setup,
  890. },
  891. /*
  892. * Titan cards
  893. */
  894. {
  895. .vendor = PCI_VENDOR_ID_TITAN,
  896. .device = PCI_DEVICE_ID_TITAN_400L,
  897. .subvendor = PCI_ANY_ID,
  898. .subdevice = PCI_ANY_ID,
  899. .setup = titan_400l_800l_setup,
  900. },
  901. {
  902. .vendor = PCI_VENDOR_ID_TITAN,
  903. .device = PCI_DEVICE_ID_TITAN_800L,
  904. .subvendor = PCI_ANY_ID,
  905. .subdevice = PCI_ANY_ID,
  906. .setup = titan_400l_800l_setup,
  907. },
  908. /*
  909. * Timedia cards
  910. */
  911. {
  912. .vendor = PCI_VENDOR_ID_TIMEDIA,
  913. .device = PCI_DEVICE_ID_TIMEDIA_1889,
  914. .subvendor = PCI_VENDOR_ID_TIMEDIA,
  915. .subdevice = PCI_ANY_ID,
  916. .init = pci_timedia_init,
  917. .setup = pci_timedia_setup,
  918. },
  919. {
  920. .vendor = PCI_VENDOR_ID_TIMEDIA,
  921. .device = PCI_ANY_ID,
  922. .subvendor = PCI_ANY_ID,
  923. .subdevice = PCI_ANY_ID,
  924. .setup = pci_timedia_setup,
  925. },
  926. /*
  927. * Xircom cards
  928. */
  929. {
  930. .vendor = PCI_VENDOR_ID_XIRCOM,
  931. .device = PCI_DEVICE_ID_XIRCOM_X3201_MDM,
  932. .subvendor = PCI_ANY_ID,
  933. .subdevice = PCI_ANY_ID,
  934. .init = pci_xircom_init,
  935. .setup = pci_default_setup,
  936. },
  937. /*
  938. * Netmos cards - these may be called via parport_serial
  939. */
  940. {
  941. .vendor = PCI_VENDOR_ID_NETMOS,
  942. .device = PCI_ANY_ID,
  943. .subvendor = PCI_ANY_ID,
  944. .subdevice = PCI_ANY_ID,
  945. .init = pci_netmos_init,
  946. .setup = pci_default_setup,
  947. },
  948. /*
  949. * For Oxford Semiconductor and Mainpine
  950. */
  951. {
  952. .vendor = PCI_VENDOR_ID_OXSEMI,
  953. .device = PCI_ANY_ID,
  954. .subvendor = PCI_ANY_ID,
  955. .subdevice = PCI_ANY_ID,
  956. .init = pci_oxsemi_tornado_init,
  957. .setup = pci_default_setup,
  958. },
  959. {
  960. .vendor = PCI_VENDOR_ID_MAINPINE,
  961. .device = PCI_ANY_ID,
  962. .subvendor = PCI_ANY_ID,
  963. .subdevice = PCI_ANY_ID,
  964. .init = pci_oxsemi_tornado_init,
  965. .setup = pci_default_setup,
  966. },
  967. /*
  968. * Default "match everything" terminator entry
  969. */
  970. {
  971. .vendor = PCI_ANY_ID,
  972. .device = PCI_ANY_ID,
  973. .subvendor = PCI_ANY_ID,
  974. .subdevice = PCI_ANY_ID,
  975. .setup = pci_default_setup,
  976. }
  977. };
  978. static inline int quirk_id_matches(u32 quirk_id, u32 dev_id)
  979. {
  980. return quirk_id == PCI_ANY_ID || quirk_id == dev_id;
  981. }
  982. static struct pci_serial_quirk *find_quirk(struct pci_dev *dev)
  983. {
  984. struct pci_serial_quirk *quirk;
  985. for (quirk = pci_serial_quirks; ; quirk++)
  986. if (quirk_id_matches(quirk->vendor, dev->vendor) &&
  987. quirk_id_matches(quirk->device, dev->device) &&
  988. quirk_id_matches(quirk->subvendor, dev->subsystem_vendor) &&
  989. quirk_id_matches(quirk->subdevice, dev->subsystem_device))
  990. break;
  991. return quirk;
  992. }
  993. static inline int get_pci_irq(struct pci_dev *dev,
  994. const struct pciserial_board *board)
  995. {
  996. if (board->flags & FL_NOIRQ)
  997. return 0;
  998. else
  999. return dev->irq;
  1000. }
  1001. /*
  1002. * This is the configuration table for all of the PCI serial boards
  1003. * which we support. It is directly indexed by the pci_board_num_t enum
  1004. * value, which is encoded in the pci_device_id PCI probe table's
  1005. * driver_data member.
  1006. *
  1007. * The makeup of these names are:
  1008. * pbn_bn{_bt}_n_baud{_offsetinhex}
  1009. *
  1010. * bn = PCI BAR number
  1011. * bt = Index using PCI BARs
  1012. * n = number of serial ports
  1013. * baud = baud rate
  1014. * offsetinhex = offset for each sequential port (in hex)
  1015. *
  1016. * This table is sorted by (in order): bn, bt, baud, offsetindex, n.
  1017. *
  1018. * Please note: in theory if n = 1, _bt infix should make no difference.
  1019. * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200
  1020. */
  1021. enum pci_board_num_t {
  1022. pbn_default = 0,
  1023. pbn_b0_1_115200,
  1024. pbn_b0_2_115200,
  1025. pbn_b0_4_115200,
  1026. pbn_b0_5_115200,
  1027. pbn_b0_8_115200,
  1028. pbn_b0_1_921600,
  1029. pbn_b0_2_921600,
  1030. pbn_b0_4_921600,
  1031. pbn_b0_2_1130000,
  1032. pbn_b0_4_1152000,
  1033. pbn_b0_2_1843200,
  1034. pbn_b0_4_1843200,
  1035. pbn_b0_2_1843200_200,
  1036. pbn_b0_4_1843200_200,
  1037. pbn_b0_8_1843200_200,
  1038. pbn_b0_1_4000000,
  1039. pbn_b0_bt_1_115200,
  1040. pbn_b0_bt_2_115200,
  1041. pbn_b0_bt_8_115200,
  1042. pbn_b0_bt_1_460800,
  1043. pbn_b0_bt_2_460800,
  1044. pbn_b0_bt_4_460800,
  1045. pbn_b0_bt_1_921600,
  1046. pbn_b0_bt_2_921600,
  1047. pbn_b0_bt_4_921600,
  1048. pbn_b0_bt_8_921600,
  1049. pbn_b1_1_115200,
  1050. pbn_b1_2_115200,
  1051. pbn_b1_4_115200,
  1052. pbn_b1_8_115200,
  1053. pbn_b1_1_921600,
  1054. pbn_b1_2_921600,
  1055. pbn_b1_4_921600,
  1056. pbn_b1_8_921600,
  1057. pbn_b1_2_1250000,
  1058. pbn_b1_bt_1_115200,
  1059. pbn_b1_bt_2_921600,
  1060. pbn_b1_1_1382400,
  1061. pbn_b1_2_1382400,
  1062. pbn_b1_4_1382400,
  1063. pbn_b1_8_1382400,
  1064. pbn_b2_1_115200,
  1065. pbn_b2_2_115200,
  1066. pbn_b2_4_115200,
  1067. pbn_b2_8_115200,
  1068. pbn_b2_1_460800,
  1069. pbn_b2_4_460800,
  1070. pbn_b2_8_460800,
  1071. pbn_b2_16_460800,
  1072. pbn_b2_1_921600,
  1073. pbn_b2_4_921600,
  1074. pbn_b2_8_921600,
  1075. pbn_b2_bt_1_115200,
  1076. pbn_b2_bt_2_115200,
  1077. pbn_b2_bt_4_115200,
  1078. pbn_b2_bt_2_921600,
  1079. pbn_b2_bt_4_921600,
  1080. pbn_b3_2_115200,
  1081. pbn_b3_4_115200,
  1082. pbn_b3_8_115200,
  1083. /*
  1084. * Board-specific versions.
  1085. */
  1086. pbn_panacom,
  1087. pbn_panacom2,
  1088. pbn_panacom4,
  1089. pbn_exsys_4055,
  1090. pbn_plx_romulus,
  1091. pbn_oxsemi,
  1092. pbn_oxsemi_1_4000000,
  1093. pbn_oxsemi_2_4000000,
  1094. pbn_oxsemi_4_4000000,
  1095. pbn_oxsemi_8_4000000,
  1096. pbn_intel_i960,
  1097. pbn_sgi_ioc3,
  1098. pbn_computone_4,
  1099. pbn_computone_6,
  1100. pbn_computone_8,
  1101. pbn_sbsxrsio,
  1102. pbn_exar_XR17C152,
  1103. pbn_exar_XR17C154,
  1104. pbn_exar_XR17C158,
  1105. pbn_pasemi_1682M,
  1106. };
  1107. /*
  1108. * uart_offset - the space between channels
  1109. * reg_shift - describes how the UART registers are mapped
  1110. * to PCI memory by the card.
  1111. * For example IER register on SBS, Inc. PMC-OctPro is located at
  1112. * offset 0x10 from the UART base, while UART_IER is defined as 1
  1113. * in include/linux/serial_reg.h,
  1114. * see first lines of serial_in() and serial_out() in 8250.c
  1115. */
  1116. static struct pciserial_board pci_boards[] __devinitdata = {
  1117. [pbn_default] = {
  1118. .flags = FL_BASE0,
  1119. .num_ports = 1,
  1120. .base_baud = 115200,
  1121. .uart_offset = 8,
  1122. },
  1123. [pbn_b0_1_115200] = {
  1124. .flags = FL_BASE0,
  1125. .num_ports = 1,
  1126. .base_baud = 115200,
  1127. .uart_offset = 8,
  1128. },
  1129. [pbn_b0_2_115200] = {
  1130. .flags = FL_BASE0,
  1131. .num_ports = 2,
  1132. .base_baud = 115200,
  1133. .uart_offset = 8,
  1134. },
  1135. [pbn_b0_4_115200] = {
  1136. .flags = FL_BASE0,
  1137. .num_ports = 4,
  1138. .base_baud = 115200,
  1139. .uart_offset = 8,
  1140. },
  1141. [pbn_b0_5_115200] = {
  1142. .flags = FL_BASE0,
  1143. .num_ports = 5,
  1144. .base_baud = 115200,
  1145. .uart_offset = 8,
  1146. },
  1147. [pbn_b0_8_115200] = {
  1148. .flags = FL_BASE0,
  1149. .num_ports = 8,
  1150. .base_baud = 115200,
  1151. .uart_offset = 8,
  1152. },
  1153. [pbn_b0_1_921600] = {
  1154. .flags = FL_BASE0,
  1155. .num_ports = 1,
  1156. .base_baud = 921600,
  1157. .uart_offset = 8,
  1158. },
  1159. [pbn_b0_2_921600] = {
  1160. .flags = FL_BASE0,
  1161. .num_ports = 2,
  1162. .base_baud = 921600,
  1163. .uart_offset = 8,
  1164. },
  1165. [pbn_b0_4_921600] = {
  1166. .flags = FL_BASE0,
  1167. .num_ports = 4,
  1168. .base_baud = 921600,
  1169. .uart_offset = 8,
  1170. },
  1171. [pbn_b0_2_1130000] = {
  1172. .flags = FL_BASE0,
  1173. .num_ports = 2,
  1174. .base_baud = 1130000,
  1175. .uart_offset = 8,
  1176. },
  1177. [pbn_b0_4_1152000] = {
  1178. .flags = FL_BASE0,
  1179. .num_ports = 4,
  1180. .base_baud = 1152000,
  1181. .uart_offset = 8,
  1182. },
  1183. [pbn_b0_2_1843200] = {
  1184. .flags = FL_BASE0,
  1185. .num_ports = 2,
  1186. .base_baud = 1843200,
  1187. .uart_offset = 8,
  1188. },
  1189. [pbn_b0_4_1843200] = {
  1190. .flags = FL_BASE0,
  1191. .num_ports = 4,
  1192. .base_baud = 1843200,
  1193. .uart_offset = 8,
  1194. },
  1195. [pbn_b0_2_1843200_200] = {
  1196. .flags = FL_BASE0,
  1197. .num_ports = 2,
  1198. .base_baud = 1843200,
  1199. .uart_offset = 0x200,
  1200. },
  1201. [pbn_b0_4_1843200_200] = {
  1202. .flags = FL_BASE0,
  1203. .num_ports = 4,
  1204. .base_baud = 1843200,
  1205. .uart_offset = 0x200,
  1206. },
  1207. [pbn_b0_8_1843200_200] = {
  1208. .flags = FL_BASE0,
  1209. .num_ports = 8,
  1210. .base_baud = 1843200,
  1211. .uart_offset = 0x200,
  1212. },
  1213. [pbn_b0_1_4000000] = {
  1214. .flags = FL_BASE0,
  1215. .num_ports = 1,
  1216. .base_baud = 4000000,
  1217. .uart_offset = 8,
  1218. },
  1219. [pbn_b0_bt_1_115200] = {
  1220. .flags = FL_BASE0|FL_BASE_BARS,
  1221. .num_ports = 1,
  1222. .base_baud = 115200,
  1223. .uart_offset = 8,
  1224. },
  1225. [pbn_b0_bt_2_115200] = {
  1226. .flags = FL_BASE0|FL_BASE_BARS,
  1227. .num_ports = 2,
  1228. .base_baud = 115200,
  1229. .uart_offset = 8,
  1230. },
  1231. [pbn_b0_bt_8_115200] = {
  1232. .flags = FL_BASE0|FL_BASE_BARS,
  1233. .num_ports = 8,
  1234. .base_baud = 115200,
  1235. .uart_offset = 8,
  1236. },
  1237. [pbn_b0_bt_1_460800] = {
  1238. .flags = FL_BASE0|FL_BASE_BARS,
  1239. .num_ports = 1,
  1240. .base_baud = 460800,
  1241. .uart_offset = 8,
  1242. },
  1243. [pbn_b0_bt_2_460800] = {
  1244. .flags = FL_BASE0|FL_BASE_BARS,
  1245. .num_ports = 2,
  1246. .base_baud = 460800,
  1247. .uart_offset = 8,
  1248. },
  1249. [pbn_b0_bt_4_460800] = {
  1250. .flags = FL_BASE0|FL_BASE_BARS,
  1251. .num_ports = 4,
  1252. .base_baud = 460800,
  1253. .uart_offset = 8,
  1254. },
  1255. [pbn_b0_bt_1_921600] = {
  1256. .flags = FL_BASE0|FL_BASE_BARS,
  1257. .num_ports = 1,
  1258. .base_baud = 921600,
  1259. .uart_offset = 8,
  1260. },
  1261. [pbn_b0_bt_2_921600] = {
  1262. .flags = FL_BASE0|FL_BASE_BARS,
  1263. .num_ports = 2,
  1264. .base_baud = 921600,
  1265. .uart_offset = 8,
  1266. },
  1267. [pbn_b0_bt_4_921600] = {
  1268. .flags = FL_BASE0|FL_BASE_BARS,
  1269. .num_ports = 4,
  1270. .base_baud = 921600,
  1271. .uart_offset = 8,
  1272. },
  1273. [pbn_b0_bt_8_921600] = {
  1274. .flags = FL_BASE0|FL_BASE_BARS,
  1275. .num_ports = 8,
  1276. .base_baud = 921600,
  1277. .uart_offset = 8,
  1278. },
  1279. [pbn_b1_1_115200] = {
  1280. .flags = FL_BASE1,
  1281. .num_ports = 1,
  1282. .base_baud = 115200,
  1283. .uart_offset = 8,
  1284. },
  1285. [pbn_b1_2_115200] = {
  1286. .flags = FL_BASE1,
  1287. .num_ports = 2,
  1288. .base_baud = 115200,
  1289. .uart_offset = 8,
  1290. },
  1291. [pbn_b1_4_115200] = {
  1292. .flags = FL_BASE1,
  1293. .num_ports = 4,
  1294. .base_baud = 115200,
  1295. .uart_offset = 8,
  1296. },
  1297. [pbn_b1_8_115200] = {
  1298. .flags = FL_BASE1,
  1299. .num_ports = 8,
  1300. .base_baud = 115200,
  1301. .uart_offset = 8,
  1302. },
  1303. [pbn_b1_1_921600] = {
  1304. .flags = FL_BASE1,
  1305. .num_ports = 1,
  1306. .base_baud = 921600,
  1307. .uart_offset = 8,
  1308. },
  1309. [pbn_b1_2_921600] = {
  1310. .flags = FL_BASE1,
  1311. .num_ports = 2,
  1312. .base_baud = 921600,
  1313. .uart_offset = 8,
  1314. },
  1315. [pbn_b1_4_921600] = {
  1316. .flags = FL_BASE1,
  1317. .num_ports = 4,
  1318. .base_baud = 921600,
  1319. .uart_offset = 8,
  1320. },
  1321. [pbn_b1_8_921600] = {
  1322. .flags = FL_BASE1,
  1323. .num_ports = 8,
  1324. .base_baud = 921600,
  1325. .uart_offset = 8,
  1326. },
  1327. [pbn_b1_2_1250000] = {
  1328. .flags = FL_BASE1,
  1329. .num_ports = 2,
  1330. .base_baud = 1250000,
  1331. .uart_offset = 8,
  1332. },
  1333. [pbn_b1_bt_1_115200] = {
  1334. .flags = FL_BASE1|FL_BASE_BARS,
  1335. .num_ports = 1,
  1336. .base_baud = 115200,
  1337. .uart_offset = 8,
  1338. },
  1339. [pbn_b1_bt_2_921600] = {
  1340. .flags = FL_BASE1|FL_BASE_BARS,
  1341. .num_ports = 2,
  1342. .base_baud = 921600,
  1343. .uart_offset = 8,
  1344. },
  1345. [pbn_b1_1_1382400] = {
  1346. .flags = FL_BASE1,
  1347. .num_ports = 1,
  1348. .base_baud = 1382400,
  1349. .uart_offset = 8,
  1350. },
  1351. [pbn_b1_2_1382400] = {
  1352. .flags = FL_BASE1,
  1353. .num_ports = 2,
  1354. .base_baud = 1382400,
  1355. .uart_offset = 8,
  1356. },
  1357. [pbn_b1_4_1382400] = {
  1358. .flags = FL_BASE1,
  1359. .num_ports = 4,
  1360. .base_baud = 1382400,
  1361. .uart_offset = 8,
  1362. },
  1363. [pbn_b1_8_1382400] = {
  1364. .flags = FL_BASE1,
  1365. .num_ports = 8,
  1366. .base_baud = 1382400,
  1367. .uart_offset = 8,
  1368. },
  1369. [pbn_b2_1_115200] = {
  1370. .flags = FL_BASE2,
  1371. .num_ports = 1,
  1372. .base_baud = 115200,
  1373. .uart_offset = 8,
  1374. },
  1375. [pbn_b2_2_115200] = {
  1376. .flags = FL_BASE2,
  1377. .num_ports = 2,
  1378. .base_baud = 115200,
  1379. .uart_offset = 8,
  1380. },
  1381. [pbn_b2_4_115200] = {
  1382. .flags = FL_BASE2,
  1383. .num_ports = 4,
  1384. .base_baud = 115200,
  1385. .uart_offset = 8,
  1386. },
  1387. [pbn_b2_8_115200] = {
  1388. .flags = FL_BASE2,
  1389. .num_ports = 8,
  1390. .base_baud = 115200,
  1391. .uart_offset = 8,
  1392. },
  1393. [pbn_b2_1_460800] = {
  1394. .flags = FL_BASE2,
  1395. .num_ports = 1,
  1396. .base_baud = 460800,
  1397. .uart_offset = 8,
  1398. },
  1399. [pbn_b2_4_460800] = {
  1400. .flags = FL_BASE2,
  1401. .num_ports = 4,
  1402. .base_baud = 460800,
  1403. .uart_offset = 8,
  1404. },
  1405. [pbn_b2_8_460800] = {
  1406. .flags = FL_BASE2,
  1407. .num_ports = 8,
  1408. .base_baud = 460800,
  1409. .uart_offset = 8,
  1410. },
  1411. [pbn_b2_16_460800] = {
  1412. .flags = FL_BASE2,
  1413. .num_ports = 16,
  1414. .base_baud = 460800,
  1415. .uart_offset = 8,
  1416. },
  1417. [pbn_b2_1_921600] = {
  1418. .flags = FL_BASE2,
  1419. .num_ports = 1,
  1420. .base_baud = 921600,
  1421. .uart_offset = 8,
  1422. },
  1423. [pbn_b2_4_921600] = {
  1424. .flags = FL_BASE2,
  1425. .num_ports = 4,
  1426. .base_baud = 921600,
  1427. .uart_offset = 8,
  1428. },
  1429. [pbn_b2_8_921600] = {
  1430. .flags = FL_BASE2,
  1431. .num_ports = 8,
  1432. .base_baud = 921600,
  1433. .uart_offset = 8,
  1434. },
  1435. [pbn_b2_bt_1_115200] = {
  1436. .flags = FL_BASE2|FL_BASE_BARS,
  1437. .num_ports = 1,
  1438. .base_baud = 115200,
  1439. .uart_offset = 8,
  1440. },
  1441. [pbn_b2_bt_2_115200] = {
  1442. .flags = FL_BASE2|FL_BASE_BARS,
  1443. .num_ports = 2,
  1444. .base_baud = 115200,
  1445. .uart_offset = 8,
  1446. },
  1447. [pbn_b2_bt_4_115200] = {
  1448. .flags = FL_BASE2|FL_BASE_BARS,
  1449. .num_ports = 4,
  1450. .base_baud = 115200,
  1451. .uart_offset = 8,
  1452. },
  1453. [pbn_b2_bt_2_921600] = {
  1454. .flags = FL_BASE2|FL_BASE_BARS,
  1455. .num_ports = 2,
  1456. .base_baud = 921600,
  1457. .uart_offset = 8,
  1458. },
  1459. [pbn_b2_bt_4_921600] = {
  1460. .flags = FL_BASE2|FL_BASE_BARS,
  1461. .num_ports = 4,
  1462. .base_baud = 921600,
  1463. .uart_offset = 8,
  1464. },
  1465. [pbn_b3_2_115200] = {
  1466. .flags = FL_BASE3,
  1467. .num_ports = 2,
  1468. .base_baud = 115200,
  1469. .uart_offset = 8,
  1470. },
  1471. [pbn_b3_4_115200] = {
  1472. .flags = FL_BASE3,
  1473. .num_ports = 4,
  1474. .base_baud = 115200,
  1475. .uart_offset = 8,
  1476. },
  1477. [pbn_b3_8_115200] = {
  1478. .flags = FL_BASE3,
  1479. .num_ports = 8,
  1480. .base_baud = 115200,
  1481. .uart_offset = 8,
  1482. },
  1483. /*
  1484. * Entries following this are board-specific.
  1485. */
  1486. /*
  1487. * Panacom - IOMEM
  1488. */
  1489. [pbn_panacom] = {
  1490. .flags = FL_BASE2,
  1491. .num_ports = 2,
  1492. .base_baud = 921600,
  1493. .uart_offset = 0x400,
  1494. .reg_shift = 7,
  1495. },
  1496. [pbn_panacom2] = {
  1497. .flags = FL_BASE2|FL_BASE_BARS,
  1498. .num_ports = 2,
  1499. .base_baud = 921600,
  1500. .uart_offset = 0x400,
  1501. .reg_shift = 7,
  1502. },
  1503. [pbn_panacom4] = {
  1504. .flags = FL_BASE2|FL_BASE_BARS,
  1505. .num_ports = 4,
  1506. .base_baud = 921600,
  1507. .uart_offset = 0x400,
  1508. .reg_shift = 7,
  1509. },
  1510. [pbn_exsys_4055] = {
  1511. .flags = FL_BASE2,
  1512. .num_ports = 4,
  1513. .base_baud = 115200,
  1514. .uart_offset = 8,
  1515. },
  1516. /* I think this entry is broken - the first_offset looks wrong --rmk */
  1517. [pbn_plx_romulus] = {
  1518. .flags = FL_BASE2,
  1519. .num_ports = 4,
  1520. .base_baud = 921600,
  1521. .uart_offset = 8 << 2,
  1522. .reg_shift = 2,
  1523. .first_offset = 0x03,
  1524. },
  1525. /*
  1526. * This board uses the size of PCI Base region 0 to
  1527. * signal now many ports are available
  1528. */
  1529. [pbn_oxsemi] = {
  1530. .flags = FL_BASE0|FL_REGION_SZ_CAP,
  1531. .num_ports = 32,
  1532. .base_baud = 115200,
  1533. .uart_offset = 8,
  1534. },
  1535. [pbn_oxsemi_1_4000000] = {
  1536. .flags = FL_BASE0,
  1537. .num_ports = 1,
  1538. .base_baud = 4000000,
  1539. .uart_offset = 0x200,
  1540. .first_offset = 0x1000,
  1541. },
  1542. [pbn_oxsemi_2_4000000] = {
  1543. .flags = FL_BASE0,
  1544. .num_ports = 2,
  1545. .base_baud = 4000000,
  1546. .uart_offset = 0x200,
  1547. .first_offset = 0x1000,
  1548. },
  1549. [pbn_oxsemi_4_4000000] = {
  1550. .flags = FL_BASE0,
  1551. .num_ports = 4,
  1552. .base_baud = 4000000,
  1553. .uart_offset = 0x200,
  1554. .first_offset = 0x1000,
  1555. },
  1556. [pbn_oxsemi_8_4000000] = {
  1557. .flags = FL_BASE0,
  1558. .num_ports = 8,
  1559. .base_baud = 4000000,
  1560. .uart_offset = 0x200,
  1561. .first_offset = 0x1000,
  1562. },
  1563. /*
  1564. * EKF addition for i960 Boards form EKF with serial port.
  1565. * Max 256 ports.
  1566. */
  1567. [pbn_intel_i960] = {
  1568. .flags = FL_BASE0,
  1569. .num_ports = 32,
  1570. .base_baud = 921600,
  1571. .uart_offset = 8 << 2,
  1572. .reg_shift = 2,
  1573. .first_offset = 0x10000,
  1574. },
  1575. [pbn_sgi_ioc3] = {
  1576. .flags = FL_BASE0|FL_NOIRQ,
  1577. .num_ports = 1,
  1578. .base_baud = 458333,
  1579. .uart_offset = 8,
  1580. .reg_shift = 0,
  1581. .first_offset = 0x20178,
  1582. },
  1583. /*
  1584. * Computone - uses IOMEM.
  1585. */
  1586. [pbn_computone_4] = {
  1587. .flags = FL_BASE0,
  1588. .num_ports = 4,
  1589. .base_baud = 921600,
  1590. .uart_offset = 0x40,
  1591. .reg_shift = 2,
  1592. .first_offset = 0x200,
  1593. },
  1594. [pbn_computone_6] = {
  1595. .flags = FL_BASE0,
  1596. .num_ports = 6,
  1597. .base_baud = 921600,
  1598. .uart_offset = 0x40,
  1599. .reg_shift = 2,
  1600. .first_offset = 0x200,
  1601. },
  1602. [pbn_computone_8] = {
  1603. .flags = FL_BASE0,
  1604. .num_ports = 8,
  1605. .base_baud = 921600,
  1606. .uart_offset = 0x40,
  1607. .reg_shift = 2,
  1608. .first_offset = 0x200,
  1609. },
  1610. [pbn_sbsxrsio] = {
  1611. .flags = FL_BASE0,
  1612. .num_ports = 8,
  1613. .base_baud = 460800,
  1614. .uart_offset = 256,
  1615. .reg_shift = 4,
  1616. },
  1617. /*
  1618. * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
  1619. * Only basic 16550A support.
  1620. * XR17C15[24] are not tested, but they should work.
  1621. */
  1622. [pbn_exar_XR17C152] = {
  1623. .flags = FL_BASE0,
  1624. .num_ports = 2,
  1625. .base_baud = 921600,
  1626. .uart_offset = 0x200,
  1627. },
  1628. [pbn_exar_XR17C154] = {
  1629. .flags = FL_BASE0,
  1630. .num_ports = 4,
  1631. .base_baud = 921600,
  1632. .uart_offset = 0x200,
  1633. },
  1634. [pbn_exar_XR17C158] = {
  1635. .flags = FL_BASE0,
  1636. .num_ports = 8,
  1637. .base_baud = 921600,
  1638. .uart_offset = 0x200,
  1639. },
  1640. /*
  1641. * PA Semi PWRficient PA6T-1682M on-chip UART
  1642. */
  1643. [pbn_pasemi_1682M] = {
  1644. .flags = FL_BASE0,
  1645. .num_ports = 1,
  1646. .base_baud = 8333333,
  1647. },
  1648. };
  1649. static const struct pci_device_id softmodem_blacklist[] = {
  1650. { PCI_VDEVICE(AL, 0x5457), }, /* ALi Corporation M5457 AC'97 Modem */
  1651. };
  1652. /*
  1653. * Given a complete unknown PCI device, try to use some heuristics to
  1654. * guess what the configuration might be, based on the pitiful PCI
  1655. * serial specs. Returns 0 on success, 1 on failure.
  1656. */
  1657. static int __devinit
  1658. serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board)
  1659. {
  1660. const struct pci_device_id *blacklist;
  1661. int num_iomem, num_port, first_port = -1, i;
  1662. /*
  1663. * If it is not a communications device or the programming
  1664. * interface is greater than 6, give up.
  1665. *
  1666. * (Should we try to make guesses for multiport serial devices
  1667. * later?)
  1668. */
  1669. if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) &&
  1670. ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) ||
  1671. (dev->class & 0xff) > 6)
  1672. return -ENODEV;
  1673. /*
  1674. * Do not access blacklisted devices that are known not to
  1675. * feature serial ports.
  1676. */
  1677. for (blacklist = softmodem_blacklist;
  1678. blacklist < softmodem_blacklist + ARRAY_SIZE(softmodem_blacklist);
  1679. blacklist++) {
  1680. if (dev->vendor == blacklist->vendor &&
  1681. dev->device == blacklist->device)
  1682. return -ENODEV;
  1683. }
  1684. num_iomem = num_port = 0;
  1685. for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
  1686. if (pci_resource_flags(dev, i) & IORESOURCE_IO) {
  1687. num_port++;
  1688. if (first_port == -1)
  1689. first_port = i;
  1690. }
  1691. if (pci_resource_flags(dev, i) & IORESOURCE_MEM)
  1692. num_iomem++;
  1693. }
  1694. /*
  1695. * If there is 1 or 0 iomem regions, and exactly one port,
  1696. * use it. We guess the number of ports based on the IO
  1697. * region size.
  1698. */
  1699. if (num_iomem <= 1 && num_port == 1) {
  1700. board->flags = first_port;
  1701. board->num_ports = pci_resource_len(dev, first_port) / 8;
  1702. return 0;
  1703. }
  1704. /*
  1705. * Now guess if we've got a board which indexes by BARs.
  1706. * Each IO BAR should be 8 bytes, and they should follow
  1707. * consecutively.
  1708. */
  1709. first_port = -1;
  1710. num_port = 0;
  1711. for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
  1712. if (pci_resource_flags(dev, i) & IORESOURCE_IO &&
  1713. pci_resource_len(dev, i) == 8 &&
  1714. (first_port == -1 || (first_port + num_port) == i)) {
  1715. num_port++;
  1716. if (first_port == -1)
  1717. first_port = i;
  1718. }
  1719. }
  1720. if (num_port > 1) {
  1721. board->flags = first_port | FL_BASE_BARS;
  1722. board->num_ports = num_port;
  1723. return 0;
  1724. }
  1725. return -ENODEV;
  1726. }
  1727. static inline int
  1728. serial_pci_matches(const struct pciserial_board *board,
  1729. const struct pciserial_board *guessed)
  1730. {
  1731. return
  1732. board->num_ports == guessed->num_ports &&
  1733. board->base_baud == guessed->base_baud &&
  1734. board->uart_offset == guessed->uart_offset &&
  1735. board->reg_shift == guessed->reg_shift &&
  1736. board->first_offset == guessed->first_offset;
  1737. }
  1738. struct serial_private *
  1739. pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board)
  1740. {
  1741. struct uart_port serial_port;
  1742. struct serial_private *priv;
  1743. struct pci_serial_quirk *quirk;
  1744. int rc, nr_ports, i;
  1745. nr_ports = board->num_ports;
  1746. /*
  1747. * Find an init and setup quirks.
  1748. */
  1749. quirk = find_quirk(dev);
  1750. /*
  1751. * Run the new-style initialization function.
  1752. * The initialization function returns:
  1753. * <0 - error
  1754. * 0 - use board->num_ports
  1755. * >0 - number of ports
  1756. */
  1757. if (quirk->init) {
  1758. rc = quirk->init(dev);
  1759. if (rc < 0) {
  1760. priv = ERR_PTR(rc);
  1761. goto err_out;
  1762. }
  1763. if (rc)
  1764. nr_ports = rc;
  1765. }
  1766. priv = kzalloc(sizeof(struct serial_private) +
  1767. sizeof(unsigned int) * nr_ports,
  1768. GFP_KERNEL);
  1769. if (!priv) {
  1770. priv = ERR_PTR(-ENOMEM);
  1771. goto err_deinit;
  1772. }
  1773. priv->dev = dev;
  1774. priv->quirk = quirk;
  1775. memset(&serial_port, 0, sizeof(struct uart_port));
  1776. serial_port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
  1777. serial_port.uartclk = board->base_baud * 16;
  1778. serial_port.irq = get_pci_irq(dev, board);
  1779. serial_port.dev = &dev->dev;
  1780. for (i = 0; i < nr_ports; i++) {
  1781. if (quirk->setup(priv, board, &serial_port, i))
  1782. break;
  1783. #ifdef SERIAL_DEBUG_PCI
  1784. printk(KERN_DEBUG "Setup PCI port: port %x, irq %d, type %d\n",
  1785. serial_port.iobase, serial_port.irq, serial_port.iotype);
  1786. #endif
  1787. priv->line[i] = serial8250_register_port(&serial_port);
  1788. if (priv->line[i] < 0) {
  1789. printk(KERN_WARNING "Couldn't register serial port %s: %d\n", pci_name(dev), priv->line[i]);
  1790. break;
  1791. }
  1792. }
  1793. priv->nr = i;
  1794. return priv;
  1795. err_deinit:
  1796. if (quirk->exit)
  1797. quirk->exit(dev);
  1798. err_out:
  1799. return priv;
  1800. }
  1801. EXPORT_SYMBOL_GPL(pciserial_init_ports);
  1802. void pciserial_remove_ports(struct serial_private *priv)
  1803. {
  1804. struct pci_serial_quirk *quirk;
  1805. int i;
  1806. for (i = 0; i < priv->nr; i++)
  1807. serial8250_unregister_port(priv->line[i]);
  1808. for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) {
  1809. if (priv->remapped_bar[i])
  1810. iounmap(priv->remapped_bar[i]);
  1811. priv->remapped_bar[i] = NULL;
  1812. }
  1813. /*
  1814. * Find the exit quirks.
  1815. */
  1816. quirk = find_quirk(priv->dev);
  1817. if (quirk->exit)
  1818. quirk->exit(priv->dev);
  1819. kfree(priv);
  1820. }
  1821. EXPORT_SYMBOL_GPL(pciserial_remove_ports);
  1822. void pciserial_suspend_ports(struct serial_private *priv)
  1823. {
  1824. int i;
  1825. for (i = 0; i < priv->nr; i++)
  1826. if (priv->line[i] >= 0)
  1827. serial8250_suspend_port(priv->line[i]);
  1828. }
  1829. EXPORT_SYMBOL_GPL(pciserial_suspend_ports);
  1830. void pciserial_resume_ports(struct serial_private *priv)
  1831. {
  1832. int i;
  1833. /*
  1834. * Ensure that the board is correctly configured.
  1835. */
  1836. if (priv->quirk->init)
  1837. priv->quirk->init(priv->dev);
  1838. for (i = 0; i < priv->nr; i++)
  1839. if (priv->line[i] >= 0)
  1840. serial8250_resume_port(priv->line[i]);
  1841. }
  1842. EXPORT_SYMBOL_GPL(pciserial_resume_ports);
  1843. /*
  1844. * Probe one serial board. Unfortunately, there is no rhyme nor reason
  1845. * to the arrangement of serial ports on a PCI card.
  1846. */
  1847. static int __devinit
  1848. pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
  1849. {
  1850. struct serial_private *priv;
  1851. const struct pciserial_board *board;
  1852. struct pciserial_board tmp;
  1853. int rc;
  1854. if (ent->driver_data >= ARRAY_SIZE(pci_boards)) {
  1855. printk(KERN_ERR "pci_init_one: invalid driver_data: %ld\n",
  1856. ent->driver_data);
  1857. return -EINVAL;
  1858. }
  1859. board = &pci_boards[ent->driver_data];
  1860. rc = pci_enable_device(dev);
  1861. if (rc)
  1862. return rc;
  1863. if (ent->driver_data == pbn_default) {
  1864. /*
  1865. * Use a copy of the pci_board entry for this;
  1866. * avoid changing entries in the table.
  1867. */
  1868. memcpy(&tmp, board, sizeof(struct pciserial_board));
  1869. board = &tmp;
  1870. /*
  1871. * We matched one of our class entries. Try to
  1872. * determine the parameters of this board.
  1873. */
  1874. rc = serial_pci_guess_board(dev, &tmp);
  1875. if (rc)
  1876. goto disable;
  1877. } else {
  1878. /*
  1879. * We matched an explicit entry. If we are able to
  1880. * detect this boards settings with our heuristic,
  1881. * then we no longer need this entry.
  1882. */
  1883. memcpy(&tmp, &pci_boards[pbn_default],
  1884. sizeof(struct pciserial_board));
  1885. rc = serial_pci_guess_board(dev, &tmp);
  1886. if (rc == 0 && serial_pci_matches(board, &tmp))
  1887. moan_device("Redundant entry in serial pci_table.",
  1888. dev);
  1889. }
  1890. priv = pciserial_init_ports(dev, board);
  1891. if (!IS_ERR(priv)) {
  1892. pci_set_drvdata(dev, priv);
  1893. return 0;
  1894. }
  1895. rc = PTR_ERR(priv);
  1896. disable:
  1897. pci_disable_device(dev);
  1898. return rc;
  1899. }
  1900. static void __devexit pciserial_remove_one(struct pci_dev *dev)
  1901. {
  1902. struct serial_private *priv = pci_get_drvdata(dev);
  1903. pci_set_drvdata(dev, NULL);
  1904. pciserial_remove_ports(priv);
  1905. pci_disable_device(dev);
  1906. }
  1907. #ifdef CONFIG_PM
  1908. static int pciserial_suspend_one(struct pci_dev *dev, pm_message_t state)
  1909. {
  1910. struct serial_private *priv = pci_get_drvdata(dev);
  1911. if (priv)
  1912. pciserial_suspend_ports(priv);
  1913. pci_save_state(dev);
  1914. pci_set_power_state(dev, pci_choose_state(dev, state));
  1915. return 0;
  1916. }
  1917. static int pciserial_resume_one(struct pci_dev *dev)
  1918. {
  1919. int err;
  1920. struct serial_private *priv = pci_get_drvdata(dev);
  1921. pci_set_power_state(dev, PCI_D0);
  1922. pci_restore_state(dev);
  1923. if (priv) {
  1924. /*
  1925. * The device may have been disabled. Re-enable it.
  1926. */
  1927. err = pci_enable_device(dev);
  1928. /* FIXME: We cannot simply error out here */
  1929. if (err)
  1930. printk(KERN_ERR "pciserial: Unable to re-enable ports, trying to continue.\n");
  1931. pciserial_resume_ports(priv);
  1932. }
  1933. return 0;
  1934. }
  1935. #endif
  1936. static struct pci_device_id serial_pci_tbl[] = {
  1937. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
  1938. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1939. PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
  1940. pbn_b1_8_1382400 },
  1941. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
  1942. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1943. PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
  1944. pbn_b1_4_1382400 },
  1945. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
  1946. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1947. PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
  1948. pbn_b1_2_1382400 },
  1949. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1950. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1951. PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232, 0, 0,
  1952. pbn_b1_8_1382400 },
  1953. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1954. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1955. PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232, 0, 0,
  1956. pbn_b1_4_1382400 },
  1957. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1958. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1959. PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232, 0, 0,
  1960. pbn_b1_2_1382400 },
  1961. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1962. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1963. PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485, 0, 0,
  1964. pbn_b1_8_921600 },
  1965. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1966. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1967. PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4, 0, 0,
  1968. pbn_b1_8_921600 },
  1969. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1970. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1971. PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485, 0, 0,
  1972. pbn_b1_4_921600 },
  1973. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1974. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1975. PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2, 0, 0,
  1976. pbn_b1_4_921600 },
  1977. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1978. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1979. PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485, 0, 0,
  1980. pbn_b1_2_921600 },
  1981. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1982. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1983. PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6, 0, 0,
  1984. pbn_b1_8_921600 },
  1985. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1986. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1987. PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1, 0, 0,
  1988. pbn_b1_8_921600 },
  1989. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1990. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1991. PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1, 0, 0,
  1992. pbn_b1_4_921600 },
  1993. { PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V351,
  1994. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1995. PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_20MHZ, 0, 0,
  1996. pbn_b1_2_1250000 },
  1997. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
  1998. PCI_SUBVENDOR_ID_CONNECT_TECH,
  1999. PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_2, 0, 0,
  2000. pbn_b0_2_1843200 },
  2001. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
  2002. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2003. PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_4, 0, 0,
  2004. pbn_b0_4_1843200 },
  2005. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
  2006. PCI_VENDOR_ID_AFAVLAB,
  2007. PCI_SUBDEVICE_ID_AFAVLAB_P061, 0, 0,
  2008. pbn_b0_4_1152000 },
  2009. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
  2010. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2011. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_232, 0, 0,
  2012. pbn_b0_2_1843200_200 },
  2013. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
  2014. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2015. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_232, 0, 0,
  2016. pbn_b0_4_1843200_200 },
  2017. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
  2018. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2019. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_232, 0, 0,
  2020. pbn_b0_8_1843200_200 },
  2021. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
  2022. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2023. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_1_1, 0, 0,
  2024. pbn_b0_2_1843200_200 },
  2025. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
  2026. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2027. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_2, 0, 0,
  2028. pbn_b0_4_1843200_200 },
  2029. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
  2030. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2031. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4, 0, 0,
  2032. pbn_b0_8_1843200_200 },
  2033. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
  2034. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2035. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2, 0, 0,
  2036. pbn_b0_2_1843200_200 },
  2037. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
  2038. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2039. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4, 0, 0,
  2040. pbn_b0_4_1843200_200 },
  2041. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
  2042. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2043. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8, 0, 0,
  2044. pbn_b0_8_1843200_200 },
  2045. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
  2046. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2047. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_485, 0, 0,
  2048. pbn_b0_2_1843200_200 },
  2049. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
  2050. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2051. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485, 0, 0,
  2052. pbn_b0_4_1843200_200 },
  2053. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
  2054. PCI_SUBVENDOR_ID_CONNECT_TECH,
  2055. PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485, 0, 0,
  2056. pbn_b0_8_1843200_200 },
  2057. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_U530,
  2058. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2059. pbn_b2_bt_1_115200 },
  2060. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM2,
  2061. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2062. pbn_b2_bt_2_115200 },
  2063. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM422,
  2064. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2065. pbn_b2_bt_4_115200 },
  2066. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM232,
  2067. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2068. pbn_b2_bt_2_115200 },
  2069. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM4,
  2070. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2071. pbn_b2_bt_4_115200 },
  2072. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8,
  2073. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2074. pbn_b2_8_115200 },
  2075. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_7803,
  2076. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2077. pbn_b2_8_460800 },
  2078. { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8,
  2079. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2080. pbn_b2_8_115200 },
  2081. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_GTEK_SERIAL2,
  2082. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2083. pbn_b2_bt_2_115200 },
  2084. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM200,
  2085. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2086. pbn_b2_bt_2_921600 },
  2087. /*
  2088. * VScom SPCOM800, from sl@s.pl
  2089. */
  2090. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_SPCOM800,
  2091. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2092. pbn_b2_8_921600 },
  2093. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_1077,
  2094. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2095. pbn_b2_4_921600 },
  2096. /* Unknown card - subdevice 0x1584 */
  2097. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2098. PCI_VENDOR_ID_PLX,
  2099. PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0,
  2100. pbn_b0_4_115200 },
  2101. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2102. PCI_SUBVENDOR_ID_KEYSPAN,
  2103. PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0,
  2104. pbn_panacom },
  2105. { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_QUADMODEM,
  2106. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2107. pbn_panacom4 },
  2108. { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM,
  2109. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2110. pbn_panacom2 },
  2111. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
  2112. PCI_VENDOR_ID_ESDGMBH,
  2113. PCI_DEVICE_ID_ESDGMBH_CPCIASIO4, 0, 0,
  2114. pbn_b2_4_115200 },
  2115. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2116. PCI_SUBVENDOR_ID_CHASE_PCIFAST,
  2117. PCI_SUBDEVICE_ID_CHASE_PCIFAST4, 0, 0,
  2118. pbn_b2_4_460800 },
  2119. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2120. PCI_SUBVENDOR_ID_CHASE_PCIFAST,
  2121. PCI_SUBDEVICE_ID_CHASE_PCIFAST8, 0, 0,
  2122. pbn_b2_8_460800 },
  2123. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2124. PCI_SUBVENDOR_ID_CHASE_PCIFAST,
  2125. PCI_SUBDEVICE_ID_CHASE_PCIFAST16, 0, 0,
  2126. pbn_b2_16_460800 },
  2127. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2128. PCI_SUBVENDOR_ID_CHASE_PCIFAST,
  2129. PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC, 0, 0,
  2130. pbn_b2_16_460800 },
  2131. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2132. PCI_SUBVENDOR_ID_CHASE_PCIRAS,
  2133. PCI_SUBDEVICE_ID_CHASE_PCIRAS4, 0, 0,
  2134. pbn_b2_4_460800 },
  2135. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2136. PCI_SUBVENDOR_ID_CHASE_PCIRAS,
  2137. PCI_SUBDEVICE_ID_CHASE_PCIRAS8, 0, 0,
  2138. pbn_b2_8_460800 },
  2139. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
  2140. PCI_SUBVENDOR_ID_EXSYS,
  2141. PCI_SUBDEVICE_ID_EXSYS_4055, 0, 0,
  2142. pbn_exsys_4055 },
  2143. /*
  2144. * Megawolf Romulus PCI Serial Card, from Mike Hudson
  2145. * (Exoray@isys.ca)
  2146. */
  2147. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_ROMULUS,
  2148. 0x10b5, 0x106a, 0, 0,
  2149. pbn_plx_romulus },
  2150. { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_QSC100,
  2151. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2152. pbn_b1_4_115200 },
  2153. { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_DSC100,
  2154. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2155. pbn_b1_2_115200 },
  2156. { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100D,
  2157. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2158. pbn_b1_8_115200 },
  2159. { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_ESC100M,
  2160. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2161. pbn_b1_8_115200 },
  2162. { PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_OXSEMI_16PCI954,
  2163. PCI_VENDOR_ID_SPECIALIX, PCI_SUBDEVICE_ID_SPECIALIX_SPEED4,
  2164. 0, 0,
  2165. pbn_b0_4_921600 },
  2166. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
  2167. PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL,
  2168. 0, 0,
  2169. pbn_b0_4_1152000 },
  2170. /*
  2171. * The below card is a little controversial since it is the
  2172. * subject of a PCI vendor/device ID clash. (See
  2173. * www.ussg.iu.edu/hypermail/linux/kernel/0303.1/0516.html).
  2174. * For now just used the hex ID 0x950a.
  2175. */
  2176. { PCI_VENDOR_ID_OXSEMI, 0x950a,
  2177. PCI_SUBVENDOR_ID_SIIG, PCI_SUBDEVICE_ID_SIIG_DUAL_SERIAL, 0, 0,
  2178. pbn_b0_2_115200 },
  2179. { PCI_VENDOR_ID_OXSEMI, 0x950a,
  2180. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2181. pbn_b0_2_1130000 },
  2182. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI954,
  2183. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2184. pbn_b0_4_115200 },
  2185. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI952,
  2186. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2187. pbn_b0_bt_2_921600 },
  2188. /*
  2189. * Oxford Semiconductor Inc. Tornado PCI express device range.
  2190. */
  2191. { PCI_VENDOR_ID_OXSEMI, 0xc101, /* OXPCIe952 1 Legacy UART */
  2192. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2193. pbn_b0_1_4000000 },
  2194. { PCI_VENDOR_ID_OXSEMI, 0xc105, /* OXPCIe952 1 Legacy UART */
  2195. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2196. pbn_b0_1_4000000 },
  2197. { PCI_VENDOR_ID_OXSEMI, 0xc11b, /* OXPCIe952 1 Native UART */
  2198. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2199. pbn_oxsemi_1_4000000 },
  2200. { PCI_VENDOR_ID_OXSEMI, 0xc11f, /* OXPCIe952 1 Native UART */
  2201. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2202. pbn_oxsemi_1_4000000 },
  2203. { PCI_VENDOR_ID_OXSEMI, 0xc120, /* OXPCIe952 1 Legacy UART */
  2204. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2205. pbn_b0_1_4000000 },
  2206. { PCI_VENDOR_ID_OXSEMI, 0xc124, /* OXPCIe952 1 Legacy UART */
  2207. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2208. pbn_b0_1_4000000 },
  2209. { PCI_VENDOR_ID_OXSEMI, 0xc138, /* OXPCIe952 1 Native UART */
  2210. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2211. pbn_oxsemi_1_4000000 },
  2212. { PCI_VENDOR_ID_OXSEMI, 0xc13d, /* OXPCIe952 1 Native UART */
  2213. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2214. pbn_oxsemi_1_4000000 },
  2215. { PCI_VENDOR_ID_OXSEMI, 0xc140, /* OXPCIe952 1 Legacy UART */
  2216. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2217. pbn_b0_1_4000000 },
  2218. { PCI_VENDOR_ID_OXSEMI, 0xc141, /* OXPCIe952 1 Legacy UART */
  2219. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2220. pbn_b0_1_4000000 },
  2221. { PCI_VENDOR_ID_OXSEMI, 0xc144, /* OXPCIe952 1 Legacy UART */
  2222. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2223. pbn_b0_1_4000000 },
  2224. { PCI_VENDOR_ID_OXSEMI, 0xc145, /* OXPCIe952 1 Legacy UART */
  2225. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2226. pbn_b0_1_4000000 },
  2227. { PCI_VENDOR_ID_OXSEMI, 0xc158, /* OXPCIe952 2 Native UART */
  2228. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2229. pbn_oxsemi_2_4000000 },
  2230. { PCI_VENDOR_ID_OXSEMI, 0xc15d, /* OXPCIe952 2 Native UART */
  2231. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2232. pbn_oxsemi_2_4000000 },
  2233. { PCI_VENDOR_ID_OXSEMI, 0xc208, /* OXPCIe954 4 Native UART */
  2234. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2235. pbn_oxsemi_4_4000000 },
  2236. { PCI_VENDOR_ID_OXSEMI, 0xc20d, /* OXPCIe954 4 Native UART */
  2237. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2238. pbn_oxsemi_4_4000000 },
  2239. { PCI_VENDOR_ID_OXSEMI, 0xc308, /* OXPCIe958 8 Native UART */
  2240. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2241. pbn_oxsemi_8_4000000 },
  2242. { PCI_VENDOR_ID_OXSEMI, 0xc30d, /* OXPCIe958 8 Native UART */
  2243. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2244. pbn_oxsemi_8_4000000 },
  2245. { PCI_VENDOR_ID_OXSEMI, 0xc40b, /* OXPCIe200 1 Native UART */
  2246. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2247. pbn_oxsemi_1_4000000 },
  2248. { PCI_VENDOR_ID_OXSEMI, 0xc40f, /* OXPCIe200 1 Native UART */
  2249. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2250. pbn_oxsemi_1_4000000 },
  2251. { PCI_VENDOR_ID_OXSEMI, 0xc41b, /* OXPCIe200 1 Native UART */
  2252. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2253. pbn_oxsemi_1_4000000 },
  2254. { PCI_VENDOR_ID_OXSEMI, 0xc41f, /* OXPCIe200 1 Native UART */
  2255. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2256. pbn_oxsemi_1_4000000 },
  2257. { PCI_VENDOR_ID_OXSEMI, 0xc42b, /* OXPCIe200 1 Native UART */
  2258. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2259. pbn_oxsemi_1_4000000 },
  2260. { PCI_VENDOR_ID_OXSEMI, 0xc42f, /* OXPCIe200 1 Native UART */
  2261. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2262. pbn_oxsemi_1_4000000 },
  2263. { PCI_VENDOR_ID_OXSEMI, 0xc43b, /* OXPCIe200 1 Native UART */
  2264. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2265. pbn_oxsemi_1_4000000 },
  2266. { PCI_VENDOR_ID_OXSEMI, 0xc43f, /* OXPCIe200 1 Native UART */
  2267. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2268. pbn_oxsemi_1_4000000 },
  2269. { PCI_VENDOR_ID_OXSEMI, 0xc44b, /* OXPCIe200 1 Native UART */
  2270. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2271. pbn_oxsemi_1_4000000 },
  2272. { PCI_VENDOR_ID_OXSEMI, 0xc44f, /* OXPCIe200 1 Native UART */
  2273. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2274. pbn_oxsemi_1_4000000 },
  2275. { PCI_VENDOR_ID_OXSEMI, 0xc45b, /* OXPCIe200 1 Native UART */
  2276. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2277. pbn_oxsemi_1_4000000 },
  2278. { PCI_VENDOR_ID_OXSEMI, 0xc45f, /* OXPCIe200 1 Native UART */
  2279. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2280. pbn_oxsemi_1_4000000 },
  2281. { PCI_VENDOR_ID_OXSEMI, 0xc46b, /* OXPCIe200 1 Native UART */
  2282. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2283. pbn_oxsemi_1_4000000 },
  2284. { PCI_VENDOR_ID_OXSEMI, 0xc46f, /* OXPCIe200 1 Native UART */
  2285. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2286. pbn_oxsemi_1_4000000 },
  2287. { PCI_VENDOR_ID_OXSEMI, 0xc47b, /* OXPCIe200 1 Native UART */
  2288. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2289. pbn_oxsemi_1_4000000 },
  2290. { PCI_VENDOR_ID_OXSEMI, 0xc47f, /* OXPCIe200 1 Native UART */
  2291. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2292. pbn_oxsemi_1_4000000 },
  2293. { PCI_VENDOR_ID_OXSEMI, 0xc48b, /* OXPCIe200 1 Native UART */
  2294. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2295. pbn_oxsemi_1_4000000 },
  2296. { PCI_VENDOR_ID_OXSEMI, 0xc48f, /* OXPCIe200 1 Native UART */
  2297. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2298. pbn_oxsemi_1_4000000 },
  2299. { PCI_VENDOR_ID_OXSEMI, 0xc49b, /* OXPCIe200 1 Native UART */
  2300. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2301. pbn_oxsemi_1_4000000 },
  2302. { PCI_VENDOR_ID_OXSEMI, 0xc49f, /* OXPCIe200 1 Native UART */
  2303. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2304. pbn_oxsemi_1_4000000 },
  2305. { PCI_VENDOR_ID_OXSEMI, 0xc4ab, /* OXPCIe200 1 Native UART */
  2306. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2307. pbn_oxsemi_1_4000000 },
  2308. { PCI_VENDOR_ID_OXSEMI, 0xc4af, /* OXPCIe200 1 Native UART */
  2309. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2310. pbn_oxsemi_1_4000000 },
  2311. { PCI_VENDOR_ID_OXSEMI, 0xc4bb, /* OXPCIe200 1 Native UART */
  2312. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2313. pbn_oxsemi_1_4000000 },
  2314. { PCI_VENDOR_ID_OXSEMI, 0xc4bf, /* OXPCIe200 1 Native UART */
  2315. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2316. pbn_oxsemi_1_4000000 },
  2317. { PCI_VENDOR_ID_OXSEMI, 0xc4cb, /* OXPCIe200 1 Native UART */
  2318. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2319. pbn_oxsemi_1_4000000 },
  2320. { PCI_VENDOR_ID_OXSEMI, 0xc4cf, /* OXPCIe200 1 Native UART */
  2321. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2322. pbn_oxsemi_1_4000000 },
  2323. /*
  2324. * Mainpine Inc. IQ Express "Rev3" utilizing OxSemi Tornado
  2325. */
  2326. { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 1 Port V.34 Super-G3 Fax */
  2327. PCI_VENDOR_ID_MAINPINE, 0x4001, 0, 0,
  2328. pbn_oxsemi_1_4000000 },
  2329. { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 2 Port V.34 Super-G3 Fax */
  2330. PCI_VENDOR_ID_MAINPINE, 0x4002, 0, 0,
  2331. pbn_oxsemi_2_4000000 },
  2332. { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 4 Port V.34 Super-G3 Fax */
  2333. PCI_VENDOR_ID_MAINPINE, 0x4004, 0, 0,
  2334. pbn_oxsemi_4_4000000 },
  2335. { PCI_VENDOR_ID_MAINPINE, 0x4000, /* IQ Express 8 Port V.34 Super-G3 Fax */
  2336. PCI_VENDOR_ID_MAINPINE, 0x4008, 0, 0,
  2337. pbn_oxsemi_8_4000000 },
  2338. /*
  2339. * SBS Technologies, Inc. P-Octal and PMC-OCTPRO cards,
  2340. * from skokodyn@yahoo.com
  2341. */
  2342. { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
  2343. PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO232, 0, 0,
  2344. pbn_sbsxrsio },
  2345. { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
  2346. PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_OCTPRO422, 0, 0,
  2347. pbn_sbsxrsio },
  2348. { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
  2349. PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL232, 0, 0,
  2350. pbn_sbsxrsio },
  2351. { PCI_VENDOR_ID_SBSMODULARIO, PCI_DEVICE_ID_OCTPRO,
  2352. PCI_SUBVENDOR_ID_SBSMODULARIO, PCI_SUBDEVICE_ID_POCTAL422, 0, 0,
  2353. pbn_sbsxrsio },
  2354. /*
  2355. * Digitan DS560-558, from jimd@esoft.com
  2356. */
  2357. { PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_ATT_VENUS_MODEM,
  2358. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2359. pbn_b1_1_115200 },
  2360. /*
  2361. * Titan Electronic cards
  2362. * The 400L and 800L have a custom setup quirk.
  2363. */
  2364. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100,
  2365. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2366. pbn_b0_1_921600 },
  2367. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200,
  2368. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2369. pbn_b0_2_921600 },
  2370. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400,
  2371. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2372. pbn_b0_4_921600 },
  2373. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800B,
  2374. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2375. pbn_b0_4_921600 },
  2376. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100L,
  2377. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2378. pbn_b1_1_921600 },
  2379. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200L,
  2380. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2381. pbn_b1_bt_2_921600 },
  2382. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400L,
  2383. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2384. pbn_b0_bt_4_921600 },
  2385. { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800L,
  2386. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2387. pbn_b0_bt_8_921600 },
  2388. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550,
  2389. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2390. pbn_b2_1_460800 },
  2391. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_650,
  2392. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2393. pbn_b2_1_460800 },
  2394. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_850,
  2395. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2396. pbn_b2_1_460800 },
  2397. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_550,
  2398. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2399. pbn_b2_bt_2_921600 },
  2400. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_650,
  2401. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2402. pbn_b2_bt_2_921600 },
  2403. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_10x_850,
  2404. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2405. pbn_b2_bt_2_921600 },
  2406. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_550,
  2407. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2408. pbn_b2_bt_4_921600 },
  2409. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_650,
  2410. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2411. pbn_b2_bt_4_921600 },
  2412. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_10x_850,
  2413. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2414. pbn_b2_bt_4_921600 },
  2415. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_550,
  2416. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2417. pbn_b0_1_921600 },
  2418. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_650,
  2419. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2420. pbn_b0_1_921600 },
  2421. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_20x_850,
  2422. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2423. pbn_b0_1_921600 },
  2424. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_550,
  2425. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2426. pbn_b0_bt_2_921600 },
  2427. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_650,
  2428. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2429. pbn_b0_bt_2_921600 },
  2430. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S_20x_850,
  2431. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2432. pbn_b0_bt_2_921600 },
  2433. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_550,
  2434. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2435. pbn_b0_bt_4_921600 },
  2436. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_650,
  2437. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2438. pbn_b0_bt_4_921600 },
  2439. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_850,
  2440. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2441. pbn_b0_bt_4_921600 },
  2442. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_550,
  2443. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2444. pbn_b0_bt_8_921600 },
  2445. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_650,
  2446. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2447. pbn_b0_bt_8_921600 },
  2448. { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_850,
  2449. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2450. pbn_b0_bt_8_921600 },
  2451. /*
  2452. * Computone devices submitted by Doug McNash dmcnash@computone.com
  2453. */
  2454. { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
  2455. PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG4,
  2456. 0, 0, pbn_computone_4 },
  2457. { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
  2458. PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG8,
  2459. 0, 0, pbn_computone_8 },
  2460. { PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_PG,
  2461. PCI_SUBVENDOR_ID_COMPUTONE, PCI_SUBDEVICE_ID_COMPUTONE_PG6,
  2462. 0, 0, pbn_computone_6 },
  2463. { PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI95N,
  2464. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2465. pbn_oxsemi },
  2466. { PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
  2467. PCI_VENDOR_ID_TIMEDIA, PCI_ANY_ID, 0, 0,
  2468. pbn_b0_bt_1_921600 },
  2469. /*
  2470. * AFAVLAB serial card, from Harald Welte <laforge@gnumonks.org>
  2471. */
  2472. { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028,
  2473. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2474. pbn_b0_bt_8_115200 },
  2475. { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P030,
  2476. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2477. pbn_b0_bt_8_115200 },
  2478. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL,
  2479. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2480. pbn_b0_bt_2_115200 },
  2481. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_A,
  2482. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2483. pbn_b0_bt_2_115200 },
  2484. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_B,
  2485. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2486. pbn_b0_bt_2_115200 },
  2487. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_A,
  2488. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2489. pbn_b0_bt_4_460800 },
  2490. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_B,
  2491. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2492. pbn_b0_bt_4_460800 },
  2493. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_PLUS,
  2494. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2495. pbn_b0_bt_2_460800 },
  2496. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_A,
  2497. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2498. pbn_b0_bt_2_460800 },
  2499. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_B,
  2500. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2501. pbn_b0_bt_2_460800 },
  2502. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_SSERIAL,
  2503. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2504. pbn_b0_bt_1_115200 },
  2505. { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_PORT_650,
  2506. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2507. pbn_b0_bt_1_460800 },
  2508. /*
  2509. * Korenix Jetcard F0/F1 cards (JC1204, JC1208, JC1404, JC1408).
  2510. * Cards are identified by their subsystem vendor IDs, which
  2511. * (in hex) match the model number.
  2512. *
  2513. * Note that JC140x are RS422/485 cards which require ox950
  2514. * ACR = 0x10, and as such are not currently fully supported.
  2515. */
  2516. { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
  2517. 0x1204, 0x0004, 0, 0,
  2518. pbn_b0_4_921600 },
  2519. { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
  2520. 0x1208, 0x0004, 0, 0,
  2521. pbn_b0_4_921600 },
  2522. /* { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
  2523. 0x1402, 0x0002, 0, 0,
  2524. pbn_b0_2_921600 }, */
  2525. /* { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
  2526. 0x1404, 0x0004, 0, 0,
  2527. pbn_b0_4_921600 }, */
  2528. { PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF1,
  2529. 0x1208, 0x0004, 0, 0,
  2530. pbn_b0_4_921600 },
  2531. /*
  2532. * Dell Remote Access Card 4 - Tim_T_Murphy@Dell.com
  2533. */
  2534. { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,
  2535. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2536. pbn_b1_1_1382400 },
  2537. /*
  2538. * Dell Remote Access Card III - Tim_T_Murphy@Dell.com
  2539. */
  2540. { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RACIII,
  2541. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2542. pbn_b1_1_1382400 },
  2543. /*
  2544. * RAStel 2 port modem, gerg@moreton.com.au
  2545. */
  2546. { PCI_VENDOR_ID_MORETON, PCI_DEVICE_ID_RASTEL_2PORT,
  2547. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2548. pbn_b2_bt_2_115200 },
  2549. /*
  2550. * EKF addition for i960 Boards form EKF with serial port
  2551. */
  2552. { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_80960_RP,
  2553. 0xE4BF, PCI_ANY_ID, 0, 0,
  2554. pbn_intel_i960 },
  2555. /*
  2556. * Xircom Cardbus/Ethernet combos
  2557. */
  2558. { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_X3201_MDM,
  2559. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2560. pbn_b0_1_115200 },
  2561. /*
  2562. * Xircom RBM56G cardbus modem - Dirk Arnold (temp entry)
  2563. */
  2564. { PCI_VENDOR_ID_XIRCOM, PCI_DEVICE_ID_XIRCOM_RBM56G,
  2565. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2566. pbn_b0_1_115200 },
  2567. /*
  2568. * Untested PCI modems, sent in from various folks...
  2569. */
  2570. /*
  2571. * Elsa Model 56K PCI Modem, from Andreas Rath <arh@01019freenet.de>
  2572. */
  2573. { PCI_VENDOR_ID_ROCKWELL, 0x1004,
  2574. 0x1048, 0x1500, 0, 0,
  2575. pbn_b1_1_115200 },
  2576. { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
  2577. 0xFF00, 0, 0, 0,
  2578. pbn_sgi_ioc3 },
  2579. /*
  2580. * HP Diva card
  2581. */
  2582. { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
  2583. PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_RMP3, 0, 0,
  2584. pbn_b1_1_115200 },
  2585. { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
  2586. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2587. pbn_b0_5_115200 },
  2588. { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_AUX,
  2589. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2590. pbn_b2_1_115200 },
  2591. { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM2,
  2592. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2593. pbn_b3_2_115200 },
  2594. { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM4,
  2595. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2596. pbn_b3_4_115200 },
  2597. { PCI_VENDOR_ID_DCI, PCI_DEVICE_ID_DCI_PCCOM8,
  2598. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2599. pbn_b3_8_115200 },
  2600. /*
  2601. * Exar Corp. XR17C15[248] Dual/Quad/Octal UART
  2602. */
  2603. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152,
  2604. PCI_ANY_ID, PCI_ANY_ID,
  2605. 0,
  2606. 0, pbn_exar_XR17C152 },
  2607. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C154,
  2608. PCI_ANY_ID, PCI_ANY_ID,
  2609. 0,
  2610. 0, pbn_exar_XR17C154 },
  2611. { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C158,
  2612. PCI_ANY_ID, PCI_ANY_ID,
  2613. 0,
  2614. 0, pbn_exar_XR17C158 },
  2615. /*
  2616. * Topic TP560 Data/Fax/Voice 56k modem (reported by Evan Clarke)
  2617. */
  2618. { PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560,
  2619. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2620. pbn_b0_1_115200 },
  2621. /*
  2622. * ITE
  2623. */
  2624. { PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8872,
  2625. PCI_ANY_ID, PCI_ANY_ID,
  2626. 0, 0,
  2627. pbn_b1_bt_1_115200 },
  2628. /*
  2629. * IntaShield IS-200
  2630. */
  2631. { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS200,
  2632. PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0811 */
  2633. pbn_b2_2_115200 },
  2634. /*
  2635. * IntaShield IS-400
  2636. */
  2637. { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS400,
  2638. PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0dc0 */
  2639. pbn_b2_4_115200 },
  2640. /*
  2641. * Perle PCI-RAS cards
  2642. */
  2643. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
  2644. PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS4,
  2645. 0, 0, pbn_b2_4_921600 },
  2646. { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
  2647. PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS8,
  2648. 0, 0, pbn_b2_8_921600 },
  2649. /*
  2650. * Mainpine series cards: Fairly standard layout but fools
  2651. * parts of the autodetect in some cases and uses otherwise
  2652. * unmatched communications subclasses in the PCI Express case
  2653. */
  2654. { /* RockForceDUO */
  2655. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2656. PCI_VENDOR_ID_MAINPINE, 0x0200,
  2657. 0, 0, pbn_b0_2_115200 },
  2658. { /* RockForceQUATRO */
  2659. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2660. PCI_VENDOR_ID_MAINPINE, 0x0300,
  2661. 0, 0, pbn_b0_4_115200 },
  2662. { /* RockForceDUO+ */
  2663. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2664. PCI_VENDOR_ID_MAINPINE, 0x0400,
  2665. 0, 0, pbn_b0_2_115200 },
  2666. { /* RockForceQUATRO+ */
  2667. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2668. PCI_VENDOR_ID_MAINPINE, 0x0500,
  2669. 0, 0, pbn_b0_4_115200 },
  2670. { /* RockForce+ */
  2671. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2672. PCI_VENDOR_ID_MAINPINE, 0x0600,
  2673. 0, 0, pbn_b0_2_115200 },
  2674. { /* RockForce+ */
  2675. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2676. PCI_VENDOR_ID_MAINPINE, 0x0700,
  2677. 0, 0, pbn_b0_4_115200 },
  2678. { /* RockForceOCTO+ */
  2679. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2680. PCI_VENDOR_ID_MAINPINE, 0x0800,
  2681. 0, 0, pbn_b0_8_115200 },
  2682. { /* RockForceDUO+ */
  2683. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2684. PCI_VENDOR_ID_MAINPINE, 0x0C00,
  2685. 0, 0, pbn_b0_2_115200 },
  2686. { /* RockForceQUARTRO+ */
  2687. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2688. PCI_VENDOR_ID_MAINPINE, 0x0D00,
  2689. 0, 0, pbn_b0_4_115200 },
  2690. { /* RockForceOCTO+ */
  2691. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2692. PCI_VENDOR_ID_MAINPINE, 0x1D00,
  2693. 0, 0, pbn_b0_8_115200 },
  2694. { /* RockForceD1 */
  2695. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2696. PCI_VENDOR_ID_MAINPINE, 0x2000,
  2697. 0, 0, pbn_b0_1_115200 },
  2698. { /* RockForceF1 */
  2699. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2700. PCI_VENDOR_ID_MAINPINE, 0x2100,
  2701. 0, 0, pbn_b0_1_115200 },
  2702. { /* RockForceD2 */
  2703. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2704. PCI_VENDOR_ID_MAINPINE, 0x2200,
  2705. 0, 0, pbn_b0_2_115200 },
  2706. { /* RockForceF2 */
  2707. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2708. PCI_VENDOR_ID_MAINPINE, 0x2300,
  2709. 0, 0, pbn_b0_2_115200 },
  2710. { /* RockForceD4 */
  2711. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2712. PCI_VENDOR_ID_MAINPINE, 0x2400,
  2713. 0, 0, pbn_b0_4_115200 },
  2714. { /* RockForceF4 */
  2715. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2716. PCI_VENDOR_ID_MAINPINE, 0x2500,
  2717. 0, 0, pbn_b0_4_115200 },
  2718. { /* RockForceD8 */
  2719. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2720. PCI_VENDOR_ID_MAINPINE, 0x2600,
  2721. 0, 0, pbn_b0_8_115200 },
  2722. { /* RockForceF8 */
  2723. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2724. PCI_VENDOR_ID_MAINPINE, 0x2700,
  2725. 0, 0, pbn_b0_8_115200 },
  2726. { /* IQ Express D1 */
  2727. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2728. PCI_VENDOR_ID_MAINPINE, 0x3000,
  2729. 0, 0, pbn_b0_1_115200 },
  2730. { /* IQ Express F1 */
  2731. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2732. PCI_VENDOR_ID_MAINPINE, 0x3100,
  2733. 0, 0, pbn_b0_1_115200 },
  2734. { /* IQ Express D2 */
  2735. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2736. PCI_VENDOR_ID_MAINPINE, 0x3200,
  2737. 0, 0, pbn_b0_2_115200 },
  2738. { /* IQ Express F2 */
  2739. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2740. PCI_VENDOR_ID_MAINPINE, 0x3300,
  2741. 0, 0, pbn_b0_2_115200 },
  2742. { /* IQ Express D4 */
  2743. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2744. PCI_VENDOR_ID_MAINPINE, 0x3400,
  2745. 0, 0, pbn_b0_4_115200 },
  2746. { /* IQ Express F4 */
  2747. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2748. PCI_VENDOR_ID_MAINPINE, 0x3500,
  2749. 0, 0, pbn_b0_4_115200 },
  2750. { /* IQ Express D8 */
  2751. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2752. PCI_VENDOR_ID_MAINPINE, 0x3C00,
  2753. 0, 0, pbn_b0_8_115200 },
  2754. { /* IQ Express F8 */
  2755. PCI_VENDOR_ID_MAINPINE, PCI_DEVICE_ID_MAINPINE_PBRIDGE,
  2756. PCI_VENDOR_ID_MAINPINE, 0x3D00,
  2757. 0, 0, pbn_b0_8_115200 },
  2758. /*
  2759. * PA Semi PA6T-1682M on-chip UART
  2760. */
  2761. { PCI_VENDOR_ID_PASEMI, 0xa004,
  2762. PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  2763. pbn_pasemi_1682M },
  2764. /*
  2765. * ADDI-DATA GmbH communication cards <info@addi-data.com>
  2766. */
  2767. { PCI_VENDOR_ID_ADDIDATA,
  2768. PCI_DEVICE_ID_ADDIDATA_APCI7500,
  2769. PCI_ANY_ID,
  2770. PCI_ANY_ID,
  2771. 0,
  2772. 0,
  2773. pbn_b0_4_115200 },
  2774. { PCI_VENDOR_ID_ADDIDATA,
  2775. PCI_DEVICE_ID_ADDIDATA_APCI7420,
  2776. PCI_ANY_ID,
  2777. PCI_ANY_ID,
  2778. 0,
  2779. 0,
  2780. pbn_b0_2_115200 },
  2781. { PCI_VENDOR_ID_ADDIDATA,
  2782. PCI_DEVICE_ID_ADDIDATA_APCI7300,
  2783. PCI_ANY_ID,
  2784. PCI_ANY_ID,
  2785. 0,
  2786. 0,
  2787. pbn_b0_1_115200 },
  2788. { PCI_VENDOR_ID_ADDIDATA_OLD,
  2789. PCI_DEVICE_ID_ADDIDATA_APCI7800,
  2790. PCI_ANY_ID,
  2791. PCI_ANY_ID,
  2792. 0,
  2793. 0,
  2794. pbn_b1_8_115200 },
  2795. { PCI_VENDOR_ID_ADDIDATA,
  2796. PCI_DEVICE_ID_ADDIDATA_APCI7500_2,
  2797. PCI_ANY_ID,
  2798. PCI_ANY_ID,
  2799. 0,
  2800. 0,
  2801. pbn_b0_4_115200 },
  2802. { PCI_VENDOR_ID_ADDIDATA,
  2803. PCI_DEVICE_ID_ADDIDATA_APCI7420_2,
  2804. PCI_ANY_ID,
  2805. PCI_ANY_ID,
  2806. 0,
  2807. 0,
  2808. pbn_b0_2_115200 },
  2809. { PCI_VENDOR_ID_ADDIDATA,
  2810. PCI_DEVICE_ID_ADDIDATA_APCI7300_2,
  2811. PCI_ANY_ID,
  2812. PCI_ANY_ID,
  2813. 0,
  2814. 0,
  2815. pbn_b0_1_115200 },
  2816. { PCI_VENDOR_ID_ADDIDATA,
  2817. PCI_DEVICE_ID_ADDIDATA_APCI7500_3,
  2818. PCI_ANY_ID,
  2819. PCI_ANY_ID,
  2820. 0,
  2821. 0,
  2822. pbn_b0_4_115200 },
  2823. { PCI_VENDOR_ID_ADDIDATA,
  2824. PCI_DEVICE_ID_ADDIDATA_APCI7420_3,
  2825. PCI_ANY_ID,
  2826. PCI_ANY_ID,
  2827. 0,
  2828. 0,
  2829. pbn_b0_2_115200 },
  2830. { PCI_VENDOR_ID_ADDIDATA,
  2831. PCI_DEVICE_ID_ADDIDATA_APCI7300_3,
  2832. PCI_ANY_ID,
  2833. PCI_ANY_ID,
  2834. 0,
  2835. 0,
  2836. pbn_b0_1_115200 },
  2837. { PCI_VENDOR_ID_ADDIDATA,
  2838. PCI_DEVICE_ID_ADDIDATA_APCI7800_3,
  2839. PCI_ANY_ID,
  2840. PCI_ANY_ID,
  2841. 0,
  2842. 0,
  2843. pbn_b0_8_115200 },
  2844. { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
  2845. PCI_VENDOR_ID_IBM, 0x0299,
  2846. 0, 0, pbn_b0_bt_2_115200 },
  2847. /*
  2848. * These entries match devices with class COMMUNICATION_SERIAL,
  2849. * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
  2850. */
  2851. { PCI_ANY_ID, PCI_ANY_ID,
  2852. PCI_ANY_ID, PCI_ANY_ID,
  2853. PCI_CLASS_COMMUNICATION_SERIAL << 8,
  2854. 0xffff00, pbn_default },
  2855. { PCI_ANY_ID, PCI_ANY_ID,
  2856. PCI_ANY_ID, PCI_ANY_ID,
  2857. PCI_CLASS_COMMUNICATION_MODEM << 8,
  2858. 0xffff00, pbn_default },
  2859. { PCI_ANY_ID, PCI_ANY_ID,
  2860. PCI_ANY_ID, PCI_ANY_ID,
  2861. PCI_CLASS_COMMUNICATION_MULTISERIAL << 8,
  2862. 0xffff00, pbn_default },
  2863. { 0, }
  2864. };
  2865. static struct pci_driver serial_pci_driver = {
  2866. .name = "serial",
  2867. .probe = pciserial_init_one,
  2868. .remove = __devexit_p(pciserial_remove_one),
  2869. #ifdef CONFIG_PM
  2870. .suspend = pciserial_suspend_one,
  2871. .resume = pciserial_resume_one,
  2872. #endif
  2873. .id_table = serial_pci_tbl,
  2874. };
  2875. static int __init serial8250_pci_init(void)
  2876. {
  2877. return pci_register_driver(&serial_pci_driver);
  2878. }
  2879. static void __exit serial8250_pci_exit(void)
  2880. {
  2881. pci_unregister_driver(&serial_pci_driver);
  2882. }
  2883. module_init(serial8250_pci_init);
  2884. module_exit(serial8250_pci_exit);
  2885. MODULE_LICENSE("GPL");
  2886. MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module");
  2887. MODULE_DEVICE_TABLE(pci, serial_pci_tbl);