8250_pci.c 146 KB

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