200-i4l.patch 611 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486
  1. Index: linux-2.4.35.4/Documentation/isdn/CREDITS
  2. ===================================================================
  3. --- linux-2.4.35.4.orig/Documentation/isdn/CREDITS
  4. +++ linux-2.4.35.4/Documentation/isdn/CREDITS
  5. @@ -37,7 +37,7 @@ Michael Knigge ([email protected])
  6. Andreas Kool ([email protected])
  7. For contribution of the isdnlog/isdnrep-tool
  8. -Pedro Roque Marques ([email protected])
  9. +Pedro Roque Marques ([email protected])
  10. For lot of new ideas and the pcbit driver.
  11. Eberhard Moenkeberg ([email protected])
  12. Index: linux-2.4.35.4/Documentation/isdn/HiSax.cert
  13. ===================================================================
  14. --- linux-2.4.35.4.orig/Documentation/isdn/HiSax.cert
  15. +++ linux-2.4.35.4/Documentation/isdn/HiSax.cert
  16. @@ -68,6 +68,8 @@ drivers/isdn/hisax/cert.c
  17. drivers/isdn/hisax/elsa.c
  18. drivers/isdn/hisax/diva.c
  19. drivers/isdn/hisax/hfc_pci.c
  20. +drivers/isdn/hisax/hfc_usbr.c
  21. +drivers/isdn/hisax/hfc_usb.c
  22. Please send any changes, bugfixes and patches to me rather than implementing
  23. them directly into the HiSax sources.
  24. Index: linux-2.4.35.4/Documentation/isdn/INTERFACE
  25. ===================================================================
  26. --- linux-2.4.35.4.orig/Documentation/isdn/INTERFACE
  27. +++ linux-2.4.35.4/Documentation/isdn/INTERFACE
  28. @@ -1,4 +1,4 @@
  29. -$Id: INTERFACE,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
  30. +$Id: INTERFACE,v 1.17 2002/01/31 13:26:35 keil Exp $
  31. Description of the Interface between Linklevel and Hardwarelevel
  32. of isdn4linux:
  33. @@ -399,7 +399,7 @@ Description of the Interface between Lin
  34. protocol-Id is one of the constants ISDN_PROTO_L3...
  35. parm.fax = Pointer to T30_s fax struct. (fax usage only)
  36. - ISDN_CMD_GETL2: (currently unused)
  37. + ISDN_CMD_GETL3: (currently unused)
  38. With this command, the HL-driver is told to return the current
  39. setting of the Layer-3-protocol.
  40. @@ -781,3 +781,22 @@ Description of the Interface between Lin
  41. arg = channel-number, locally to the driver. (starting with 0)
  42. parm = unused.
  43. + ISDN_STAT_ALERT:
  44. +
  45. + With this call, the HL-driver signals the receive of an ALERTING message to the LL.
  46. +
  47. + Parameter:
  48. + driver = driver-Id
  49. + command = ISDN_STAT_ALERT
  50. + arg = channel-number, locally to the driver. (starting with 0)
  51. +
  52. + ISDN_STAT_PROCEED:
  53. +
  54. + With this call, the HL-driver signals the receive of an CALL PROCEEDING message
  55. + to the LL.
  56. +
  57. + Parameter:
  58. + driver = driver-Id
  59. + command = ISDN_STAT_PROCEED
  60. + arg = channel-number, locally to the driver. (starting with 0)
  61. +
  62. Index: linux-2.4.35.4/Documentation/isdn/INTERFACE.fax
  63. ===================================================================
  64. --- linux-2.4.35.4.orig/Documentation/isdn/INTERFACE.fax
  65. +++ linux-2.4.35.4/Documentation/isdn/INTERFACE.fax
  66. @@ -1,4 +1,4 @@
  67. -$Id: INTERFACE.fax,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
  68. +$Id: INTERFACE.fax,v 1.2 2000/08/06 09:22:50 armin Exp $
  69. Description of the fax-subinterface between linklevel and hardwarelevel of
  70. Index: linux-2.4.35.4/Documentation/isdn/README
  71. ===================================================================
  72. --- linux-2.4.35.4.orig/Documentation/isdn/README
  73. +++ linux-2.4.35.4/Documentation/isdn/README
  74. @@ -278,6 +278,12 @@ README for the ISDN-subsystem
  75. 1 = Add CPN to FCON message on
  76. Bit 2: 0 = Add CDN to RING/FCON message off
  77. 1 = Add CDN to RING/FCON message on
  78. + Bit 3: 0 = Do not signal RINGING
  79. + 1 = Signal RINGING if ALERT was received
  80. + Bit 4: 0 = Do not signal PROCEEDING
  81. + 1 = Signal PROCEEDING if CALL PROCEEDING
  82. + was received
  83. +
  84. Last but not least a (at the moment fairly primitive) device to request
  85. the line-status (/dev/isdninfo) is made available.
  86. Index: linux-2.4.35.4/Documentation/isdn/README.HiSax
  87. ===================================================================
  88. --- linux-2.4.35.4.orig/Documentation/isdn/README.HiSax
  89. +++ linux-2.4.35.4/Documentation/isdn/README.HiSax
  90. @@ -41,10 +41,9 @@ ELSA Quickstep 3000 (same settings as QS
  91. ELSA Quickstep 3000PCI
  92. ELSA PCMCIA
  93. ITK ix1-micro Rev.2
  94. -Eicon Diva 2.0 ISA and PCI (S0 and U interface, no PRO version)
  95. -Eicon Diva 2.01 ISA and PCI
  96. -Eicon Diva 2.02 PCI
  97. -Eicon Diva Piccola
  98. +Eicon.Diehl Diva 2.0 ISA and PCI (S0 and U interface, no PRO version)
  99. +Eicon.Diehl Diva 2.01 ISA and PCI
  100. +Eicon.Diehl Diva Piccola
  101. ASUSCOM NETWORK INC. ISDNLink 128K PC adapter (order code I-IN100-ST-D)
  102. Dynalink IS64PH (OEM version of ASUSCOM NETWORK INC. ISDNLink 128K adapter)
  103. PCBIT-DP (OEM version of ASUSCOM NETWORK INC. ISDNLink)
  104. @@ -53,7 +52,6 @@ Sedlbauer Speed Card (Speed Win, Teledat
  105. Sedlbauer Speed Star/Speed Star2 (PCMCIA)
  106. Sedlbauer ISDN-Controller PC/104
  107. USR Sportster internal TA (compatible Stollmann tina-pp V3)
  108. -USR internal TA PCI
  109. ith Kommunikationstechnik GmbH MIC 16 ISA card
  110. Traverse Technologie NETjet PCI S0 card and NETspider U card
  111. Ovislink ISDN sc100-p card (NETjet driver)
  112. @@ -68,14 +66,14 @@ Gazel ISDN cards
  113. HFC-PCI based cards
  114. Winbond W6692 based cards
  115. HFC-S+, HFC-SP/PCMCIA cards
  116. -formula-n enternow
  117. -Gerdes Power ISDN
  118. +HFC-USB ISDN TAs
  119. Note: PCF, PCF-Pro: up to now, only the ISDN part is supported
  120. PCC-8: not tested yet
  121. Eicon.Diehl Diva U interface not tested
  122. If you know other passive cards with the Siemens chipset, please let me know.
  123. +To use the PNP cards you need the isapnptools.
  124. You can combine any card, if there is no conflict between the resources
  125. (io, mem, irq).
  126. @@ -91,15 +89,8 @@ There is also some config needed before
  127. modules. It is included in the normal "make [menu]config" target at the
  128. kernel. Don't forget it, especially to select the right D-channel protocol.
  129. -Please note: In older versions of the HiSax driver, all PnP cards
  130. -needed to be configured with isapnp and worked only with the HiSax
  131. -driver used as a module.
  132. -
  133. -In the current version, HiSax will automatically use the in-kernel
  134. -ISAPnP support, provided you selected it during kernel configuration
  135. -(CONFIG_ISAPNP), if you don't give the io=, irq= command line parameters.
  136. -
  137. -The affected card types are: 4,7,12,14,19,27-30
  138. +Please note: All PnP cards need to be configured with isapnp and will work
  139. +only with the HiSax driver used as a module.
  140. a) when built as a module
  141. -------------------------
  142. @@ -200,8 +191,6 @@ Card types:
  143. 37 HFC 2BDS0 S+, SP irq,io
  144. 38 NETspider U PCI card none
  145. 39 HFC 2BDS0 SP/PCMCIA irq,io (set with cardmgr)
  146. - 40 hotplug interface
  147. - 41 Formula-n enter:now PCI none
  148. At the moment IRQ sharing is only possible with PCI cards. Please make sure
  149. that your IRQ is free and enabled for ISA use.
  150. @@ -227,13 +216,6 @@ Examples for module loading
  151. (IO 1 (BASE 0x0180))
  152. modprobe hisax type=4 protocol=2 irq=10 io0=0x580 io1=0x180
  153. - In the current version of HiSax, you can instead simply use
  154. -
  155. - modprobe hisax type=4 protocol=2
  156. -
  157. - if you configured your kernel for ISAPnP. Don't run isapnp in
  158. - this case!
  159. -
  160. 6. Teles 16.3, Euro ISDN, I/O base 280 hex, IRQ 12 and
  161. Teles 16.0, 1TR6, IRQ 5, Memory d0000 hex
  162. modprobe hisax type=3,1 protocol=2,1 io=0x280 mem=0,0xd0000
  163. @@ -314,9 +296,7 @@ type
  164. 36 W6692 based PCI cards none
  165. 37 HFC 2BDS0 S+,SP/PCMCIA ONLY WORKS AS A MODULE !
  166. 38 NETspider U PCI card none
  167. - 39 HFC 2BDS0 SP/PCMCIA ONLY WORKS AS A MODULE !
  168. - 40 hotplug interface ONLY WORKS AS A MODULE !
  169. - 41 Formula-n enter:now PCI none
  170. +
  171. Running the driver
  172. ------------------
  173. Index: linux-2.4.35.4/Documentation/isdn/README.act2000
  174. ===================================================================
  175. --- linux-2.4.35.4.orig/Documentation/isdn/README.act2000
  176. +++ linux-2.4.35.4/Documentation/isdn/README.act2000
  177. @@ -1,4 +1,4 @@
  178. -$Id: README.act2000,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
  179. +$Id: README.act2000,v 1.3 2000/08/06 09:22:51 armin Exp $
  180. This document describes the ACT2000 driver for the
  181. IBM Active 2000 ISDN card.
  182. Index: linux-2.4.35.4/Documentation/isdn/README.audio
  183. ===================================================================
  184. --- linux-2.4.35.4.orig/Documentation/isdn/README.audio
  185. +++ linux-2.4.35.4/Documentation/isdn/README.audio
  186. @@ -1,4 +1,4 @@
  187. -$Id: README.audio,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
  188. +$Id: README.audio,v 1.8 1999/07/11 17:17:29 armin Exp $
  189. ISDN subsystem for Linux.
  190. Description of audio mode.
  191. Index: linux-2.4.35.4/Documentation/isdn/README.eicon
  192. ===================================================================
  193. --- linux-2.4.35.4.orig/Documentation/isdn/README.eicon
  194. +++ linux-2.4.35.4/Documentation/isdn/README.eicon
  195. @@ -1,4 +1,4 @@
  196. -$Id: README.eicon,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
  197. +$Id: README.eicon,v 1.10 2000/08/13 12:19:15 armin Exp $
  198. (c) 1999,2000 Armin Schindler ([email protected])
  199. (c) 1999,2000 Cytronics & Melware ([email protected])
  200. Index: linux-2.4.35.4/Documentation/isdn/README.hysdn
  201. ===================================================================
  202. --- linux-2.4.35.4.orig/Documentation/isdn/README.hysdn
  203. +++ linux-2.4.35.4/Documentation/isdn/README.hysdn
  204. @@ -1,4 +1,4 @@
  205. -$Id: README.hysdn,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
  206. +$Id: README.hysdn,v 1.3.6.1 2001/02/10 14:41:19 kai Exp $
  207. The hysdn driver has been written by
  208. by Werner Cornelius ([email protected] or [email protected])
  209. for Hypercope GmbH Aachen Germany. Hypercope agreed to publish this driver
  210. Index: linux-2.4.35.4/Documentation/isdn/README.icn
  211. ===================================================================
  212. --- linux-2.4.35.4.orig/Documentation/isdn/README.icn
  213. +++ linux-2.4.35.4/Documentation/isdn/README.icn
  214. @@ -1,4 +1,4 @@
  215. -$Id: README.icn,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
  216. +$Id: README.icn,v 1.7 2000/08/06 09:22:51 armin Exp $
  217. You can get the ICN-ISDN-card from:
  218. Index: linux-2.4.35.4/Documentation/isdn/README.pcbit
  219. ===================================================================
  220. --- linux-2.4.35.4.orig/Documentation/isdn/README.pcbit
  221. +++ linux-2.4.35.4/Documentation/isdn/README.pcbit
  222. @@ -37,4 +37,4 @@ mailing list ([email protected]
  223. regards,
  224. Pedro.
  225. -<[email protected]>
  226. +<[email protected]>
  227. Index: linux-2.4.35.4/Documentation/isdn/abcext_kernel.help
  228. ===================================================================
  229. --- /dev/null
  230. +++ linux-2.4.35.4/Documentation/isdn/abcext_kernel.help
  231. @@ -0,0 +1,166 @@
  232. +
  233. +ISDN-ABC-DW Extension
  234. +CONFIG_ISDN_WITH_ABC
  235. + These are many brand new Options and Features for the
  236. + ISDN SUBSYSTEM. Including Logical Device bindings,
  237. + Compression and other good stuff for Optimizing your
  238. + ISDN System.
  239. +
  240. + To Use this Extensions you MUST HAVE THE NEWEST
  241. + ISDN4K-UTILS. You must have Version 3.1-Beta6 or
  242. + higher. Elsewhere you can not configure this Extensions.
  243. +
  244. + WARNING ! THIS STUF IS NOT PRODUCTION RELEASE THE
  245. + FUNCTION ARE UNDER DEVELOPMENT. This ist BETA-CODE.
  246. + You can use it at you Own Risk.
  247. +
  248. + For more Information on these Extensions take a look at
  249. + "linux/Documentation/isdn/dw-abc-extension-howto.txt or
  250. + Online at the Web "http://www.mediatronix.de/i4l/index.html"
  251. +
  252. + Please Report Bugs to "[email protected]" or
  253. + "[email protected]"
  254. +
  255. +D-Channel-Callback with Channel in use check
  256. +CONFIG_ISDN_WITH_ABC_CALLB
  257. + When a Interface is declared as an Callback Interface,
  258. + the Interface is checking that the other Side is not
  259. + Calling on the same time before the Interface is Dialing.
  260. +
  261. + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
  262. + for more Information
  263. +
  264. + In most case answer with "Yes" when you have Callback devices,
  265. + otherwise leave it "No"
  266. +
  267. +Outgoing-EAZ-Support
  268. +CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  269. + Enables the Feature to Define an other EAZ or MSN for
  270. + Outgoing calls on an Interface.
  271. +
  272. + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
  273. + for more Information
  274. +
  275. +Least Cost Router Support
  276. +CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  277. + This is the final Kernel Code for configuring an Least
  278. + Cost Router Softwarebased. The other Job is to do the
  279. + action in ISDNLOG. You need the ISDNLOG to use this
  280. + function. Currently the ISDNLOG have not the Support for
  281. + this Option.
  282. + So in most situations let the Option off.
  283. +
  284. +TCP keepalive detect and response
  285. +CONFIG_ISDN_WITH_ABC_IPV4_TCP_KEEPALIVE
  286. + This Option works only with the TCP/IP V4. It enables
  287. + the Function that ISDN Devices are Answering TCP_KEEPALIVE Pakets
  288. + localy. So that TCP KEEPALIVE Pakets not longer takes the Line
  289. + open.
  290. +
  291. +Drop frames Sourceadresse is not Interfaceadress
  292. +CONFIG_ISDN_WITH_ABC_IPV4_DYNADDR
  293. + This Option works only with the TCP/IP V4. It will allow only
  294. + the Transmitt of Pakets where the Sourceadresse is the Interface
  295. + adress. It is usefull when you have Lines with Dynamic IP.
  296. +
  297. + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
  298. + for more Information
  299. +
  300. +Receive do not reset the Hanguptimer
  301. +CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
  302. + When you activate this option than the reiceive of pakets do
  303. + not reset the Hanguptimer. It is very usefull because if the
  304. + Paket vor your Network your Network generate an Response and
  305. + the Transmit is reseting the HUPTIMER. But when the Paket is
  306. + Rejected at your firewall your network generate no Response
  307. + and no Sendtraffic is generated. So in this case there is no
  308. + need to Reset the Huptimer because you have only received Data.
  309. + With that option only Transmitted Data/Pakets will reset the
  310. + HUPTIMER.
  311. +
  312. +Support of (device-channel) and Binding Groups
  313. +CONFIG_ISDN_WITH_ABC_ICALL_BIND
  314. + This Option enables the Feature to Bind logical ISDN Interfaces
  315. + to an prefered ISDN Card or ISDN Card plus Channel. So you have
  316. + the Chance to keep Channels exclusively for one (or more)
  317. + Connection. Very usefull when you have more channels and Use
  318. + Calling Line Identification, because you can organize that your
  319. + call is going out over the Line with the right EAZ for the CLI.
  320. +
  321. +Skip channel if used external (Dial Only)
  322. +CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
  323. + When you have more than One ISDN Card in your System and you
  324. + will Dialout with an Interface you can become the Situation
  325. + that an External Device such a Telephone or Fax is Using the
  326. + B-Channels. Normaly ISDN4Linux does not detect this Situation
  327. + and dial everytime of the "External Busy" line out. With this
  328. + Option Enabled the I4L will detect that he can not dialout on
  329. + This Card and dial over the next Card out.
  330. +
  331. + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
  332. + for more Information
  333. +
  334. +Interface autodisable if Config error
  335. +CONFIG_ISDN_WITH_ABC_CONN_ERROR
  336. + This Option will detect an Device which generate Telephone
  337. + Cost but does not Function correctly because there are
  338. + Configerrors on one of the Site. In this Situation the
  339. + Interface will be marked as Unsuably for some time to do
  340. + not call every time this Site.
  341. +
  342. + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
  343. + for more Information
  344. +
  345. +UDP-Info-Support
  346. +CONFIG_ISDN_WITH_ABC_UDP_CHECK
  347. + This is the Mainoption to Enable or Disable the UDP
  348. + Info Support. An Option to Controll ISDN-Interfaces
  349. + Remotely. For this very Complex thing take a look at
  350. +
  351. + "linux/Documentation/isdn/dw-abc-extension-howto.txt"
  352. + for more Information.
  353. +
  354. +UDP Hangup Support
  355. +CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
  356. +
  357. + Sorry no more Information!
  358. +
  359. + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
  360. + for more Information
  361. +
  362. +UDP Dial Support
  363. +CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
  364. +
  365. + Sorry no more Information!
  366. +
  367. + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
  368. + for more Information
  369. +
  370. +Limit on the line frames to two
  371. +CONFIG_ISDN_WITH_ABC_FRAME_LIMIT
  372. +
  373. + This Option enables support for sending only 2 Pakets on
  374. + the Fly to the ISDN Driver. It is very usefull when you
  375. + will use the new RAW-IP Compression. Because of sending
  376. + Only 2 Pakets on the Fly makes the risk of overflowing
  377. + the ISDN Driver very smaller.
  378. +
  379. + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
  380. + for more Information
  381. +
  382. +Compression with RAWIP and X75I
  383. +CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
  384. +
  385. + With this Option you have the ability to make Datacompression
  386. + on RAW-IP Lines. It is function on HDLC and X75I Connection,
  387. + but the Prefered L2-Protocol for Compression is X75I because
  388. + the HDLC Protocol have no Errorcorrection.
  389. +
  390. + To Use this Option YOU MUST HAVE ENABLED THE OPTION:
  391. + Support synchronous PPP
  392. + and must load after loading the main isdndrivers the
  393. + Modul "isdn_bsdcomp".
  394. +
  395. + See "linux/Documentation/isdn/dw-abc-extension-howto.txt"
  396. + for more Information
  397. +
  398. Index: linux-2.4.35.4/drivers/isdn/Config.in
  399. ===================================================================
  400. --- linux-2.4.35.4.orig/drivers/isdn/Config.in
  401. +++ linux-2.4.35.4/drivers/isdn/Config.in
  402. @@ -4,11 +4,9 @@
  403. # only included if CONFIG_ISDN != n
  404. -define_bool CONFIG_ISDN_BOOL y
  405. if [ "$CONFIG_INET" != "n" ]; then
  406. bool ' Support synchronous PPP' CONFIG_ISDN_PPP
  407. if [ "$CONFIG_ISDN_PPP" != "n" ]; then
  408. - dep_bool ' PPP filtering for ISDN' CONFIG_IPPP_FILTER $CONFIG_FILTER
  409. bool ' Use VJ-compression with synchronous PPP' CONFIG_ISDN_PPP_VJ
  410. bool ' Support generic MP (RFC 1717)' CONFIG_ISDN_MPP
  411. dep_tristate ' Support BSD compression' CONFIG_ISDN_PPP_BSDCOMP $CONFIG_ISDN
  412. @@ -23,6 +21,30 @@ if [ "$CONFIG_X25" != "n" ]; then
  413. fi
  414. mainmenu_option next_comment
  415. +comment 'ISDN abc-dw-extension'
  416. +bool 'Enable isdn-abc-dw-extension' CONFIG_ISDN_WITH_ABC
  417. +if [ "$CONFIG_ISDN_WITH_ABC" != "n" ]; then
  418. + bool ' Use D-Channel-Callback with Channel in use check' CONFIG_ISDN_WITH_ABC_CALLB
  419. + bool ' Enable Outgoing-EAZ-Support' CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  420. + bool ' Enable LCR-Support (need isdnlog)' CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  421. + bool ' RX dont reset hanguptimeout' CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
  422. + if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
  423. + bool ' Enable UDP-Info-Support' CONFIG_ISDN_WITH_ABC_UDP_CHECK
  424. + if [ "$CONFIG_ISDN_WITH_ABC_UDP_CHECK" != "n" ]; then
  425. + bool ' Enable Hangup-Support with UDP-INFO' CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
  426. + bool ' Enable Dial-Support with UDP-INFO' CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
  427. + fi
  428. + fi
  429. +
  430. + bool ' Skip channel if used external (dial only)' CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
  431. + bool ' Support interface-auto-disable if config-error' CONFIG_ISDN_WITH_ABC_CONN_ERROR
  432. + if [ "$CONFIG_ISDN_PPP" != "n" ]; then
  433. + bool ' Enable Compression with rawip and x75i' CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
  434. + fi
  435. +fi
  436. +endmenu
  437. +
  438. +mainmenu_option next_comment
  439. comment 'ISDN feature submodules'
  440. dep_tristate 'isdnloop support' CONFIG_ISDN_DRV_LOOP $CONFIG_ISDN
  441. dep_tristate 'Support isdn diversion services' CONFIG_ISDN_DIVERSION $CONFIG_ISDN
  442. @@ -34,7 +56,6 @@ mainmenu_option next_comment
  443. comment 'Passive ISDN cards'
  444. dep_tristate 'HiSax SiemensChipSet driver support' CONFIG_ISDN_DRV_HISAX $CONFIG_ISDN
  445. if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ]; then
  446. - define_bool CONFIG_ISDN_HISAX y
  447. comment ' D-channel protocol features'
  448. bool ' HiSax Support for EURO/DSS1' CONFIG_HISAX_EURO
  449. if [ "$CONFIG_HISAX_EURO" != "n" ]; then
  450. @@ -45,31 +66,28 @@ if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ];
  451. fi
  452. bool ' HiSax Support for german 1TR6' CONFIG_HISAX_1TR6
  453. bool ' HiSax Support for US NI1' CONFIG_HISAX_NI1
  454. - int ' Maximum number of cards supported by HiSax' CONFIG_HISAX_MAX_CARDS 8
  455. comment ' HiSax supported cards'
  456. - if [ "$CONFIG_ISA" != "n" ]; then
  457. - bool ' Teles 16.0/8.0' CONFIG_HISAX_16_0
  458. - bool ' Teles 16.3 or PNP or PCMCIA' CONFIG_HISAX_16_3
  459. - bool ' AVM A1 (Fritz)' CONFIG_HISAX_AVM_A1
  460. - bool ' ITK ix1-micro Revision 2' CONFIG_HISAX_IX1MICROR2
  461. - bool ' ASUSCOM ISA cards' CONFIG_HISAX_ASUSCOM
  462. - bool ' TELEINT cards' CONFIG_HISAX_TELEINT
  463. - bool ' HFC-S based cards' CONFIG_HISAX_HFCS
  464. - bool ' USR Sportster internal TA' CONFIG_HISAX_SPORTSTER
  465. - bool ' MIC card' CONFIG_HISAX_MIC
  466. - bool ' Siemens I-Surf card' CONFIG_HISAX_ISURF
  467. - bool ' HST Saphir card' CONFIG_HISAX_HSTSAPHIR
  468. - fi
  469. + bool ' Teles 16.0/8.0' CONFIG_HISAX_16_0
  470. + bool ' Teles 16.3 or PNP or PCMCIA' CONFIG_HISAX_16_3
  471. bool ' Teles PCI' CONFIG_HISAX_TELESPCI
  472. bool ' Teles S0Box' CONFIG_HISAX_S0BOX
  473. + bool ' AVM A1 (Fritz)' CONFIG_HISAX_AVM_A1
  474. bool ' AVM PnP/PCI (Fritz!PnP/PCI)' CONFIG_HISAX_FRITZPCI
  475. bool ' AVM A1 PCMCIA (Fritz)' CONFIG_HISAX_AVM_A1_PCMCIA
  476. bool ' Elsa cards' CONFIG_HISAX_ELSA
  477. + bool ' ITK ix1-micro Revision 2' CONFIG_HISAX_IX1MICROR2
  478. bool ' Eicon.Diehl Diva cards' CONFIG_HISAX_DIEHLDIVA
  479. + bool ' ASUSCOM ISA cards' CONFIG_HISAX_ASUSCOM
  480. + bool ' TELEINT cards' CONFIG_HISAX_TELEINT
  481. + bool ' HFC-S based cards' CONFIG_HISAX_HFCS
  482. bool ' Sedlbauer cards' CONFIG_HISAX_SEDLBAUER
  483. + bool ' USR Sportster internal TA' CONFIG_HISAX_SPORTSTER
  484. + bool ' MIC card' CONFIG_HISAX_MIC
  485. bool ' NETjet card' CONFIG_HISAX_NETJET
  486. bool ' NETspider U card' CONFIG_HISAX_NETJET_U
  487. bool ' Niccy PnP/PCI card' CONFIG_HISAX_NICCY
  488. + bool ' Siemens I-Surf card' CONFIG_HISAX_ISURF
  489. + bool ' HST Saphir card' CONFIG_HISAX_HSTSAPHIR
  490. bool ' Telekom A4T card' CONFIG_HISAX_BKM_A4T
  491. bool ' Scitel Quadro card' CONFIG_HISAX_SCT_QUADRO
  492. bool ' Gazel cards' CONFIG_HISAX_GAZEL
  493. @@ -78,20 +96,27 @@ if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ];
  494. bool ' HFC-S+, HFC-SP, HFC-PCMCIA cards' CONFIG_HISAX_HFC_SX
  495. if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
  496. # bool ' TESTEMULATOR (EXPERIMENTAL)' CONFIG_HISAX_TESTEMU
  497. - bool ' Formula-n enter:now PCI card' CONFIG_HISAX_ENTERNOW_PCI
  498. if [ "$ARCH" = "sparc" -o "$ARCH" = "sparc64" ]; then
  499. bool ' Am7930' CONFIG_HISAX_AMD7930
  500. fi
  501. fi
  502. bool ' HiSax debugging' CONFIG_HISAX_DEBUG
  503. - dep_tristate 'Sedlbauer PCMCIA cards' CONFIG_HISAX_SEDLBAUER_CS $CONFIG_ISDN_DRV_HISAX $CONFIG_PCMCIA
  504. - dep_tristate 'ELSA PCMCIA MicroLink cards' CONFIG_HISAX_ELSA_CS $CONFIG_ISDN_DRV_HISAX $CONFIG_PCMCIA
  505. - dep_tristate 'AVM A1 PCMCIA cards' CONFIG_HISAX_AVM_A1_CS $CONFIG_ISDN_DRV_HISAX $CONFIG_PCMCIA $CONFIG_HISAX_AVM_A1_PCMCIA
  506. - dep_tristate 'ST5481 USB ISDN modem (EXPERIMENTAL)' CONFIG_HISAX_ST5481 $CONFIG_ISDN_DRV_HISAX $CONFIG_EXPERIMENTAL
  507. - dep_tristate 'AVM Fritz!Card PCI/PCIv2/PnP support (EXPERIMENTAL)' CONFIG_HISAX_FRITZ_PCIPNP $CONFIG_ISDN_DRV_HISAX $CONFIG_EXPERIMENTAL
  508. - dep_tristate 'Auerswald devices ISDN support' CONFIG_USB_AUERISDN $CONFIG_ISDN_DRV_HISAX
  509. + dep_tristate 'Sedlbauer PCMCIA cards' CONFIG_HISAX_SEDLBAUER_CS $CONFIG_PCMCIA
  510. + dep_tristate 'ELSA PCMCIA MicroLink cards' CONFIG_HISAX_ELSA_CS $CONFIG_PCMCIA
  511. + dep_tristate 'Colognechip HFC-USB support' CONFIG_HISAX_HFC_USB_CS $CONFIG_HISAX $CONFIG_USB
  512. + dep_tristate 'ST5481 USB ISDN modem (EXPERIMENTAL)' CONFIG_HISAX_ST5481 $CONFIG_HISAX $CONFIG_USB $CONFIG_EXPERIMENTAL
  513. + dep_tristate 'Fritz!PCIv2 support (EXPERIMENTAL)' CONFIG_HISAX_FRITZ_PCIPNP $CONFIG_HISAX $CONFIG_EXPERIMENTAL
  514. + if [ "$CONFIG_HISAX_SEDLBAUER_CS" != "n" ]; then
  515. + define_bool CONFIG_HISAX_SEDLBAUER y
  516. + fi
  517. + if [ "$CONFIG_HISAX_ELSA_CS" != "n" ]; then
  518. + define_bool CONFIG_HISAX_ELSA y
  519. + fi
  520. + if [ "$CONFIG_HISAX_HFC_USB_CS" != "n" ]; then
  521. + define_bool CONFIG_HISAX_HFC_USB y
  522. + fi
  523. fi
  524. endmenu
  525. Index: linux-2.4.35.4/drivers/isdn/Makefile
  526. ===================================================================
  527. --- linux-2.4.35.4.orig/drivers/isdn/Makefile
  528. +++ linux-2.4.35.4/drivers/isdn/Makefile
  529. @@ -2,7 +2,7 @@
  530. # The target object and module list name.
  531. -O_TARGET := vmlinux-obj.o
  532. +O_TARGET := isdn.a
  533. # Objects that export symbols.
  534. @@ -32,9 +32,9 @@ obj-$(CONFIG_ISDN_PPP_BSDCOMP) += isdn_
  535. # Object files in subdirectories
  536. -mod-subdirs := avmb1 eicon hisax
  537. +mod-subdirs := avmb1 eicon
  538. subdir-$(CONFIG_ISDN_DIVERSION) += divert
  539. -subdir-$(CONFIG_ISDN_HISAX) += hisax
  540. +subdir-$(CONFIG_ISDN_DRV_HISAX) += hisax
  541. subdir-$(CONFIG_ISDN_DRV_ICN) += icn
  542. subdir-$(CONFIG_ISDN_DRV_PCBIT) += pcbit
  543. subdir-$(CONFIG_ISDN_DRV_SC) += sc
  544. Index: linux-2.4.35.4/drivers/isdn/act2000/act2000.h
  545. ===================================================================
  546. --- linux-2.4.35.4.orig/drivers/isdn/act2000/act2000.h
  547. +++ linux-2.4.35.4/drivers/isdn/act2000/act2000.h
  548. @@ -1,4 +1,4 @@
  549. -/* $Id: act2000.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  550. +/* $Id$
  551. *
  552. * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
  553. *
  554. @@ -178,19 +178,19 @@ typedef struct act2000_card {
  555. char regname[35]; /* Name used for request_region */
  556. } act2000_card;
  557. -static inline void act2000_schedule_tx(act2000_card *card)
  558. +extern __inline__ void act2000_schedule_tx(act2000_card *card)
  559. {
  560. queue_task(&card->snd_tq, &tq_immediate);
  561. mark_bh(IMMEDIATE_BH);
  562. }
  563. -static inline void act2000_schedule_rx(act2000_card *card)
  564. +extern __inline__ void act2000_schedule_rx(act2000_card *card)
  565. {
  566. queue_task(&card->rcv_tq, &tq_immediate);
  567. mark_bh(IMMEDIATE_BH);
  568. }
  569. -static inline void act2000_schedule_poll(act2000_card *card)
  570. +extern __inline__ void act2000_schedule_poll(act2000_card *card)
  571. {
  572. queue_task(&card->poll_tq, &tq_immediate);
  573. mark_bh(IMMEDIATE_BH);
  574. Index: linux-2.4.35.4/drivers/isdn/act2000/act2000_isa.c
  575. ===================================================================
  576. --- linux-2.4.35.4.orig/drivers/isdn/act2000/act2000_isa.c
  577. +++ linux-2.4.35.4/drivers/isdn/act2000/act2000_isa.c
  578. @@ -1,4 +1,4 @@
  579. -/* $Id: act2000_isa.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  580. +/* $Id$
  581. *
  582. * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version).
  583. *
  584. @@ -178,8 +178,7 @@ act2000_isa_config_port(act2000_card * c
  585. card->flags &= ~ACT2000_FLAGS_PVALID;
  586. }
  587. if (!check_region(portbase, ISA_REGION)) {
  588. - if (request_region(portbase, ACT2000_PORTLEN, card->regname) == NULL)
  589. - return -EIO;
  590. + request_region(portbase, ACT2000_PORTLEN, card->regname);
  591. card->port = portbase;
  592. card->flags |= ACT2000_FLAGS_PVALID;
  593. return 0;
  594. @@ -341,6 +340,9 @@ act2000_isa_send(act2000_card * card)
  595. while (skb->len) {
  596. if (act2000_isa_writeb(card, *(skb->data))) {
  597. /* Fifo is full, but more data to send */
  598. +#if 0
  599. + printk(KERN_DEBUG "act2000_isa_send: %d bytes\n", l);
  600. +#endif
  601. test_and_clear_bit(ACT2000_LOCK_TX, (void *) &card->ilock);
  602. /* Schedule myself */
  603. act2000_schedule_tx(card);
  604. @@ -363,6 +365,9 @@ act2000_isa_send(act2000_card * card)
  605. } else
  606. dev_kfree_skb(skb);
  607. card->sbuf = NULL;
  608. +#if 0
  609. + printk(KERN_DEBUG "act2000_isa_send: %d bytes\n", l);
  610. +#endif
  611. }
  612. }
  613. Index: linux-2.4.35.4/drivers/isdn/act2000/act2000_isa.h
  614. ===================================================================
  615. --- linux-2.4.35.4.orig/drivers/isdn/act2000/act2000_isa.h
  616. +++ linux-2.4.35.4/drivers/isdn/act2000/act2000_isa.h
  617. @@ -1,4 +1,4 @@
  618. -/* $Id: act2000_isa.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  619. +/* $Id$
  620. *
  621. * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version).
  622. *
  623. Index: linux-2.4.35.4/drivers/isdn/act2000/capi.c
  624. ===================================================================
  625. --- linux-2.4.35.4.orig/drivers/isdn/act2000/capi.c
  626. +++ linux-2.4.35.4/drivers/isdn/act2000/capi.c
  627. @@ -1,4 +1,4 @@
  628. -/* $Id: capi.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  629. +/* $Id$
  630. *
  631. * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
  632. * CAPI encoder/decoder
  633. @@ -76,6 +76,10 @@ static actcapi_msgdsc valid_msg[] = {
  634. {{ 0x84, 0x03}, "DISCONNECT_B3_RESP"},
  635. {{ 0x86, 0x03}, "DATA_B3_RESP"},
  636. {{ 0xff, 0x03}, "MANUFACTURER_RESP"},
  637. +#if 0
  638. +/* CAPI 2.0 */
  639. + {{ 0x05, 0x80}, "LISTEN_REQ (CAPI 2.0)"},
  640. +#endif
  641. #endif
  642. {{ 0x00, 0x00}, NULL},
  643. };
  644. Index: linux-2.4.35.4/drivers/isdn/act2000/capi.h
  645. ===================================================================
  646. --- linux-2.4.35.4.orig/drivers/isdn/act2000/capi.h
  647. +++ linux-2.4.35.4/drivers/isdn/act2000/capi.h
  648. @@ -1,4 +1,4 @@
  649. -/* $Id: capi.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  650. +/* $Id$
  651. *
  652. * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
  653. *
  654. @@ -294,6 +294,19 @@ typedef struct actcapi_msg {
  655. __u16 plci;
  656. __u16 info;
  657. } select_b3_protocol_conf;
  658. +#if 0
  659. + struct listen_req {
  660. + __u32 controller;
  661. + __u32 infomask;
  662. + __u32 cipmask;
  663. + __u32 cipmask2;
  664. + __u16 dummy; /* 2 Length-bytes of 2 Structs MUST always be 0!!! */
  665. + } listen_req;
  666. + struct listen_conf {
  667. + __u32 controller;
  668. + __u16 info;
  669. + } listen_conf;
  670. +#else
  671. struct listen_req {
  672. __u8 controller;
  673. __u32 infomask __attribute__ ((packed));
  674. @@ -304,6 +317,7 @@ typedef struct actcapi_msg {
  675. __u8 controller;
  676. __u16 info __attribute__ ((packed));
  677. } listen_conf;
  678. +#endif
  679. struct data_b3_req {
  680. __u16 fakencci;
  681. __u16 datalen;
  682. @@ -330,7 +344,7 @@ typedef struct actcapi_msg {
  683. } msg;
  684. } actcapi_msg;
  685. -static inline unsigned short
  686. +extern __inline__ unsigned short
  687. actcapi_nextsmsg(act2000_card *card)
  688. {
  689. unsigned long flags;
  690. Index: linux-2.4.35.4/drivers/isdn/act2000/module.c
  691. ===================================================================
  692. --- linux-2.4.35.4.orig/drivers/isdn/act2000/module.c
  693. +++ linux-2.4.35.4/drivers/isdn/act2000/module.c
  694. @@ -1,4 +1,4 @@
  695. -/* $Id: module.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  696. +/* $Id$
  697. *
  698. * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000.
  699. *
  700. @@ -630,6 +630,10 @@ act2000_alloccard(int bus, int port, int
  701. card->interface.features =
  702. ISDN_FEATURE_L2_X75I |
  703. ISDN_FEATURE_L2_HDLC |
  704. +#if 0
  705. +/* Not yet! New Firmware is on the way ... */
  706. + ISDN_FEATURE_L2_TRANS |
  707. +#endif
  708. ISDN_FEATURE_L3_TRANS |
  709. ISDN_FEATURE_P_UNKNOWN;
  710. card->interface.hl_hdrlen = 20;
  711. @@ -843,6 +847,39 @@ static void __exit act2000_exit(void)
  712. }
  713. printk(KERN_INFO "%s unloaded\n", DRIVERNAME);
  714. }
  715. +#if 0
  716. +#ifndef MODULE
  717. +void
  718. +act2000_setup(char *str, int *ints)
  719. +{
  720. + int i, j, argc, port, irq, bus;
  721. +
  722. + argc = ints[0];
  723. + i = 1;
  724. + if (argc)
  725. + while (argc) {
  726. + port = irq = -1;
  727. + bus = 0;
  728. + if (argc) {
  729. + bus = ints[i];
  730. + i++;
  731. + argc--;
  732. + }
  733. + if (argc) {
  734. + port = ints[i];
  735. + i++;
  736. + argc--;
  737. + }
  738. + if (argc) {
  739. + irq = ints[i];
  740. + i++;
  741. + argc--;
  742. + }
  743. + act2000_addcard(bus, port, irq, act_id);
  744. + }
  745. +}
  746. +#endif
  747. +#endif
  748. module_init(act2000_init);
  749. module_exit(act2000_exit);
  750. Index: linux-2.4.35.4/drivers/isdn/avmb1/avm_cs.c
  751. ===================================================================
  752. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/avm_cs.c
  753. +++ linux-2.4.35.4/drivers/isdn/avmb1/avm_cs.c
  754. @@ -1,4 +1,4 @@
  755. -/* $Id: avm_cs.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  756. +/* $Id: avm_cs.c,v 1.6 2001/09/24 13:22:44 kai Exp $
  757. *
  758. * A PCMCIA client driver for AVM B1/M1/M2
  759. *
  760. Index: linux-2.4.35.4/drivers/isdn/avmb1/avmcard.h
  761. ===================================================================
  762. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/avmcard.h
  763. +++ linux-2.4.35.4/drivers/isdn/avmb1/avmcard.h
  764. @@ -1,4 +1,4 @@
  765. -/* $Id: avmcard.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  766. +/* $Id: avmcard.h,v 1.12 2001/09/24 13:22:44 kai Exp $
  767. *
  768. * Copyright 1999 by Carsten Paeth <[email protected]>
  769. *
  770. Index: linux-2.4.35.4/drivers/isdn/avmb1/b1.c
  771. ===================================================================
  772. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/b1.c
  773. +++ linux-2.4.35.4/drivers/isdn/avmb1/b1.c
  774. @@ -1,4 +1,4 @@
  775. -/* $Id: b1.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  776. +/* $Id: b1.c,v 1.26 2001/09/24 13:22:44 kai Exp $
  777. *
  778. * Common module for AVM B1 cards.
  779. *
  780. @@ -20,6 +20,7 @@
  781. #include <linux/kernelcapi.h>
  782. #include <asm/io.h>
  783. #include <linux/init.h>
  784. +#include <linux/isdn_compat.h>
  785. #include <asm/uaccess.h>
  786. #include <linux/netdevice.h>
  787. #include "capilli.h"
  788. @@ -27,7 +28,7 @@
  789. #include "capicmd.h"
  790. #include "capiutil.h"
  791. -static char *revision = "$Revision: 1.1.4.1 $";
  792. +static char *revision = "$Revision: 1.26 $";
  793. /* ------------------------------------------------------------- */
  794. Index: linux-2.4.35.4/drivers/isdn/avmb1/b1dma.c
  795. ===================================================================
  796. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/b1dma.c
  797. +++ linux-2.4.35.4/drivers/isdn/avmb1/b1dma.c
  798. @@ -1,4 +1,4 @@
  799. -/* $Id: b1dma.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  800. +/* $Id: b1dma.c,v 1.18 2001/09/24 13:22:44 kai Exp $
  801. *
  802. * Common module for AVM B1 cards that support dma with AMCC
  803. *
  804. @@ -21,6 +21,7 @@
  805. #include <linux/kernelcapi.h>
  806. #include <asm/io.h>
  807. #include <linux/init.h>
  808. +#include <linux/isdn_compat.h>
  809. #include <asm/uaccess.h>
  810. #include <linux/netdevice.h>
  811. #include "capilli.h"
  812. @@ -28,7 +29,11 @@
  813. #include "capicmd.h"
  814. #include "capiutil.h"
  815. -static char *revision = "$Revision: 1.1.4.1 $";
  816. +#if BITS_PER_LONG != 32
  817. +#error FIXME: driver requires 32-bit platform
  818. +#endif
  819. +
  820. +static char *revision = "$Revision: 1.18 $";
  821. /* ------------------------------------------------------------- */
  822. @@ -851,7 +856,7 @@ int b1dmactl_read_proc(char *page, char
  823. __u8 flag;
  824. int len = 0;
  825. char *s;
  826. - u_long txaddr, txlen, rxaddr, rxlen, csr;
  827. + __u32 txaddr, txlen, rxaddr, rxlen, csr;
  828. len += sprintf(page+len, "%-16s %s\n", "name", card->name);
  829. len += sprintf(page+len, "%-16s 0x%x\n", "io", card->port);
  830. @@ -907,12 +912,12 @@ int b1dmactl_read_proc(char *page, char
  831. save_flags(flags);
  832. cli();
  833. - txaddr = (u_long)phys_to_virt(b1dmainmeml(card->mbase+0x2c));
  834. - txaddr -= (u_long)card->dma->sendbuf;
  835. + txaddr = (__u32)phys_to_virt(b1dmainmeml(card->mbase+0x2c));
  836. + txaddr -= (__u32)card->dma->sendbuf;
  837. txlen = b1dmainmeml(card->mbase+0x30);
  838. - rxaddr = (u_long)phys_to_virt(b1dmainmeml(card->mbase+0x24));
  839. - rxaddr -= (u_long)card->dma->recvbuf;
  840. + rxaddr = (__u32)phys_to_virt(b1dmainmeml(card->mbase+0x24));
  841. + rxaddr -= (__u32)card->dma->recvbuf;
  842. rxlen = b1dmainmeml(card->mbase+0x28);
  843. csr = b1dmainmeml(card->mbase+AMCC_INTCSR);
  844. Index: linux-2.4.35.4/drivers/isdn/avmb1/b1isa.c
  845. ===================================================================
  846. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/b1isa.c
  847. +++ linux-2.4.35.4/drivers/isdn/avmb1/b1isa.c
  848. @@ -1,4 +1,4 @@
  849. -/* $Id: b1isa.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  850. +/* $Id: b1isa.c,v 1.14 2001/09/24 13:22:44 kai Exp $
  851. *
  852. * Module for AVM B1 ISA-card.
  853. *
  854. @@ -19,12 +19,13 @@
  855. #include <linux/capi.h>
  856. #include <linux/init.h>
  857. #include <asm/io.h>
  858. +#include <linux/isdn_compat.h>
  859. #include "capicmd.h"
  860. #include "capiutil.h"
  861. #include "capilli.h"
  862. #include "avmcard.h"
  863. -static char *revision = "$Revision: 1.1.4.1 $";
  864. +static char *revision = "$Revision: 1.14 $";
  865. /* ------------------------------------------------------------- */
  866. Index: linux-2.4.35.4/drivers/isdn/avmb1/b1pci.c
  867. ===================================================================
  868. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/b1pci.c
  869. +++ linux-2.4.35.4/drivers/isdn/avmb1/b1pci.c
  870. @@ -1,4 +1,4 @@
  871. -/* $Id: b1pci.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  872. +/* $Id: b1pci.c,v 1.40 2001/09/24 13:22:44 kai Exp $
  873. *
  874. * Module for AVM B1 PCI-card.
  875. *
  876. @@ -21,21 +21,24 @@
  877. #include <linux/capi.h>
  878. #include <asm/io.h>
  879. #include <linux/init.h>
  880. +#include <linux/isdn_compat.h>
  881. #include "capicmd.h"
  882. #include "capiutil.h"
  883. #include "capilli.h"
  884. #include "avmcard.h"
  885. -static char *revision = "$Revision: 1.1.4.1 $";
  886. +static char *revision = "$Revision: 1.40 $";
  887. /* ------------------------------------------------------------- */
  888. +#ifndef COMPAT_HAS_2_2_PCI
  889. static struct pci_device_id b1pci_pci_tbl[] __initdata = {
  890. { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_B1, PCI_ANY_ID, PCI_ANY_ID },
  891. { } /* Terminating entry */
  892. };
  893. MODULE_DEVICE_TABLE(pci, b1pci_pci_tbl);
  894. +#endif
  895. MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM B1 PCI card");
  896. MODULE_AUTHOR("Carsten Paeth");
  897. MODULE_LICENSE("GPL");
  898. @@ -416,14 +419,14 @@ static int add_card(struct pci_dev *dev)
  899. }
  900. param.irq = dev->irq;
  901. - if (pci_resource_start(dev, 2)) { /* B1 PCI V4 */
  902. + if (pci_resource_start_io(dev, 2)) { /* B1 PCI V4 */
  903. #ifdef CONFIG_ISDN_DRV_AVMB1_B1PCIV4
  904. driver = &b1pciv4_driver;
  905. pci_set_master(dev);
  906. #endif
  907. - param.membase = pci_resource_start(dev, 0);
  908. - param.port = pci_resource_start(dev, 2);
  909. + param.membase = pci_resource_start_mem(dev, 0);
  910. + param.port = pci_resource_start_io(dev, 2);
  911. printk(KERN_INFO
  912. "%s: PCI BIOS reports AVM-B1 V4 at i/o %#x, irq %d, mem %#x\n",
  913. @@ -440,7 +443,7 @@ static int add_card(struct pci_dev *dev)
  914. }
  915. } else {
  916. param.membase = 0;
  917. - param.port = pci_resource_start(dev, 1);
  918. + param.port = pci_resource_start_io(dev, 1);
  919. printk(KERN_INFO
  920. "%s: PCI BIOS reports AVM-B1 at i/o %#x, irq %d\n",
  921. Index: linux-2.4.35.4/drivers/isdn/avmb1/b1pcmcia.c
  922. ===================================================================
  923. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/b1pcmcia.c
  924. +++ linux-2.4.35.4/drivers/isdn/avmb1/b1pcmcia.c
  925. @@ -1,4 +1,4 @@
  926. -/* $Id: b1pcmcia.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  927. +/* $Id: b1pcmcia.c,v 1.17 2001/09/24 13:22:44 kai Exp $
  928. *
  929. * Module for AVM B1/M1/M2 PCMCIA-card.
  930. *
  931. @@ -25,7 +25,7 @@
  932. #include "capilli.h"
  933. #include "avmcard.h"
  934. -static char *revision = "$Revision: 1.1.4.1 $";
  935. +static char *revision = "$Revision: 1.17 $";
  936. /* ------------------------------------------------------------- */
  937. Index: linux-2.4.35.4/drivers/isdn/avmb1/c4.c
  938. ===================================================================
  939. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/c4.c
  940. +++ linux-2.4.35.4/drivers/isdn/avmb1/c4.c
  941. @@ -1,4 +1,4 @@
  942. -/* $Id: c4.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  943. +/* $Id: c4.c,v 1.38 2001/09/24 13:22:44 kai Exp $
  944. *
  945. * Module for AVM C4 & C2 card.
  946. *
  947. @@ -18,6 +18,7 @@
  948. #include <linux/interrupt.h>
  949. #include <linux/ioport.h>
  950. #include <linux/pci.h>
  951. +#include <linux/isdn_compat.h>
  952. #include <linux/capi.h>
  953. #include <linux/kernelcapi.h>
  954. #include <linux/init.h>
  955. @@ -30,7 +31,7 @@
  956. #include "capilli.h"
  957. #include "avmcard.h"
  958. -static char *revision = "$Revision: 1.1.4.1 $";
  959. +static char *revision = "$Revision: 1.38 $";
  960. #undef CONFIG_C4_DEBUG
  961. #undef CONFIG_C4_POLLDEBUG
  962. @@ -39,6 +40,7 @@ static char *revision = "$Revision: 1.1.
  963. static int suppress_pollack;
  964. +#ifndef COMPAT_HAS_2_2_PCI
  965. static struct pci_device_id c4_pci_tbl[] __initdata = {
  966. { PCI_VENDOR_ID_DEC,PCI_DEVICE_ID_DEC_21285, PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_C4 },
  967. { PCI_VENDOR_ID_DEC,PCI_DEVICE_ID_DEC_21285, PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_C2 },
  968. @@ -46,6 +48,7 @@ static struct pci_device_id c4_pci_tbl[]
  969. };
  970. MODULE_DEVICE_TABLE(pci, c4_pci_tbl);
  971. +#endif
  972. MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM C2/C4 cards");
  973. MODULE_AUTHOR("Carsten Paeth");
  974. MODULE_LICENSE("GPL");
  975. @@ -1332,9 +1335,9 @@ static int __init search_cards(struct ca
  976. }
  977. pci_set_master(dev);
  978. - param.port = pci_resource_start(dev, 1);
  979. + param.port = pci_resource_start_io(dev, 1);
  980. param.irq = dev->irq;
  981. - param.membase = pci_resource_start(dev, 0);
  982. + param.membase = pci_resource_start_mem(dev, 0);
  983. printk(KERN_INFO
  984. "%s: PCI BIOS reports AVM-C%d at i/o %#x, irq %d, mem %#x\n",
  985. Index: linux-2.4.35.4/drivers/isdn/avmb1/capi.c
  986. ===================================================================
  987. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capi.c
  988. +++ linux-2.4.35.4/drivers/isdn/avmb1/capi.c
  989. @@ -1,4 +1,4 @@
  990. -/* $Id: capi.c,v 1.1.4.2 2001/12/09 18:45:13 kai Exp $
  991. +/* $Id: capi.c,v 1.59 2001/11/07 22:35:48 kai Exp $
  992. *
  993. * CAPI 2.0 Interface for Linux
  994. *
  995. @@ -23,6 +23,7 @@
  996. #include <linux/smp_lock.h>
  997. #include <linux/timer.h>
  998. #include <linux/wait.h>
  999. +#include <linux/isdn_compat.h>
  1000. #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
  1001. #include <linux/tty.h>
  1002. #ifdef CONFIG_PPP
  1003. @@ -30,6 +31,9 @@
  1004. #include <linux/ppp_defs.h>
  1005. #include <linux/if_ppp.h>
  1006. #undef CAPI_PPP_ON_RAW_DEVICE
  1007. +#ifdef CAPI_PPP_ON_RAW_DEVICE
  1008. +#include <linux/ppp_channel.h>
  1009. +#endif /* CAPI_PPP_ON_RAW_DEVICE */
  1010. #endif /* CONFIG_PPP */
  1011. #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
  1012. #include <linux/skbuff.h>
  1013. @@ -38,14 +42,16 @@
  1014. #include <linux/capi.h>
  1015. #include <linux/kernelcapi.h>
  1016. #include <linux/init.h>
  1017. +#ifdef HAVE_DEVFS_FS
  1018. #include <linux/devfs_fs_kernel.h>
  1019. +#endif /* HAVE_DEVFS_FS */
  1020. #include "capiutil.h"
  1021. #include "capicmd.h"
  1022. #if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
  1023. #include "capifs.h"
  1024. #endif
  1025. -static char *revision = "$Revision: 1.1.4.2 $";
  1026. +static char *revision = "$Revision: 1.59 $";
  1027. MODULE_DESCRIPTION("CAPI4Linux: Userspace /dev/capi20 interface");
  1028. MODULE_AUTHOR("Carsten Paeth");
  1029. @@ -87,10 +93,10 @@ struct capiminor {
  1030. struct capincci *nccip;
  1031. unsigned int minor;
  1032. - u16 applid;
  1033. - u32 ncci;
  1034. - u16 datahandle;
  1035. - u16 msgid;
  1036. + __u16 applid;
  1037. + __u32 ncci;
  1038. + __u16 datahandle;
  1039. + __u16 msgid;
  1040. struct file *file;
  1041. struct tty_struct *tty;
  1042. @@ -112,16 +118,22 @@ struct capiminor {
  1043. /* transmit path */
  1044. struct datahandle_queue {
  1045. struct datahandle_queue *next;
  1046. - u16 datahandle;
  1047. + __u16 datahandle;
  1048. } *ackqueue;
  1049. int nack;
  1050. +#ifdef CAPI_PPP_ON_RAW_DEVICE
  1051. + /* interface to generic ppp layer */
  1052. + struct ppp_channel chan;
  1053. + int chan_connected;
  1054. + int chan_index;
  1055. +#endif
  1056. };
  1057. #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
  1058. struct capincci {
  1059. struct capincci *next;
  1060. - u32 ncci;
  1061. + __u32 ncci;
  1062. struct capidev *cdev;
  1063. #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
  1064. struct capiminor *minorp;
  1065. @@ -131,8 +143,8 @@ struct capincci {
  1066. struct capidev {
  1067. struct capidev *next;
  1068. struct file *file;
  1069. - u16 applid;
  1070. - u16 errcode;
  1071. + __u16 applid;
  1072. + __u16 errcode;
  1073. unsigned int minor;
  1074. unsigned userflags;
  1075. @@ -156,22 +168,28 @@ static struct capidev *capidev_openlist
  1076. static struct capiminor *minors = 0;
  1077. #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
  1078. +#ifdef COMPAT_HAS_kmem_cache
  1079. static kmem_cache_t *capidev_cachep = 0;
  1080. static kmem_cache_t *capincci_cachep = 0;
  1081. #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
  1082. static kmem_cache_t *capiminor_cachep = 0;
  1083. static kmem_cache_t *capidh_cachep = 0;
  1084. #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
  1085. +#endif
  1086. #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
  1087. /* -------- datahandles --------------------------------------------- */
  1088. -static int capincci_add_ack(struct capiminor *mp, u16 datahandle)
  1089. +int capincci_add_ack(struct capiminor *mp, __u16 datahandle)
  1090. {
  1091. struct datahandle_queue *n, **pp;
  1092. n = (struct datahandle_queue *)
  1093. +#ifdef COMPAT_HAS_kmem_cache
  1094. kmem_cache_alloc(capidh_cachep, GFP_ATOMIC);
  1095. +#else
  1096. + kmalloc(sizeof(struct datahandle_queue), GFP_ATOMIC);
  1097. +#endif
  1098. if (!n) {
  1099. printk(KERN_ERR "capi: alloc datahandle failed\n");
  1100. return -1;
  1101. @@ -184,7 +202,7 @@ static int capincci_add_ack(struct capim
  1102. return 0;
  1103. }
  1104. -static int capiminor_del_ack(struct capiminor *mp, u16 datahandle)
  1105. +int capiminor_del_ack(struct capiminor *mp, __u16 datahandle)
  1106. {
  1107. struct datahandle_queue **pp, *p;
  1108. @@ -192,7 +210,11 @@ static int capiminor_del_ack(struct capi
  1109. if ((*pp)->datahandle == datahandle) {
  1110. p = *pp;
  1111. *pp = (*pp)->next;
  1112. +#ifdef COMPAT_HAS_kmem_cache
  1113. kmem_cache_free(capidh_cachep, p);
  1114. +#else
  1115. + kfree(p);
  1116. +#endif
  1117. mp->nack--;
  1118. return 0;
  1119. }
  1120. @@ -200,7 +222,7 @@ static int capiminor_del_ack(struct capi
  1121. return -1;
  1122. }
  1123. -static void capiminor_del_all_ack(struct capiminor *mp)
  1124. +void capiminor_del_all_ack(struct capiminor *mp)
  1125. {
  1126. struct datahandle_queue **pp, *p;
  1127. @@ -208,7 +230,11 @@ static void capiminor_del_all_ack(struct
  1128. while (*pp) {
  1129. p = *pp;
  1130. *pp = (*pp)->next;
  1131. +#ifdef COMPAT_HAS_kmem_cache
  1132. kmem_cache_free(capidh_cachep, p);
  1133. +#else
  1134. + kfree(p);
  1135. +#endif
  1136. mp->nack--;
  1137. }
  1138. }
  1139. @@ -216,13 +242,17 @@ static void capiminor_del_all_ack(struct
  1140. /* -------- struct capiminor ---------------------------------------- */
  1141. -static struct capiminor *capiminor_alloc(u16 applid, u32 ncci)
  1142. +struct capiminor *capiminor_alloc(__u16 applid, __u32 ncci)
  1143. {
  1144. struct capiminor *mp, **pp;
  1145. unsigned int minor = 0;
  1146. MOD_INC_USE_COUNT;
  1147. +#ifdef COMPAT_HAS_kmem_cache
  1148. mp = (struct capiminor *)kmem_cache_alloc(capiminor_cachep, GFP_ATOMIC);
  1149. +#else
  1150. + mp = (struct capiminor *)kmalloc(sizeof(struct capiminor), GFP_ATOMIC);
  1151. +#endif
  1152. if (!mp) {
  1153. MOD_DEC_USE_COUNT;
  1154. printk(KERN_ERR "capi: can't alloc capiminor\n");
  1155. @@ -257,7 +287,7 @@ static struct capiminor *capiminor_alloc
  1156. return mp;
  1157. }
  1158. -static void capiminor_free(struct capiminor *mp)
  1159. +void capiminor_free(struct capiminor *mp)
  1160. {
  1161. struct capiminor **pp;
  1162. @@ -271,7 +301,11 @@ static void capiminor_free(struct capimi
  1163. skb_queue_purge(&mp->inqueue);
  1164. skb_queue_purge(&mp->outqueue);
  1165. capiminor_del_all_ack(mp);
  1166. +#ifdef COMPAT_HAS_kmem_cache
  1167. kmem_cache_free(capiminor_cachep, mp);
  1168. +#else
  1169. + kfree(mp);
  1170. +#endif
  1171. MOD_DEC_USE_COUNT;
  1172. #ifdef _DEBUG_REFCOUNT
  1173. printk(KERN_DEBUG "capiminor_free %d\n", GET_USE_COUNT(THIS_MODULE));
  1174. @@ -283,7 +317,7 @@ static void capiminor_free(struct capimi
  1175. }
  1176. }
  1177. -static struct capiminor *capiminor_find(unsigned int minor)
  1178. +struct capiminor *capiminor_find(unsigned int minor)
  1179. {
  1180. struct capiminor *p;
  1181. for (p = minors; p && p->minor != minor; p = p->next)
  1182. @@ -294,7 +328,7 @@ static struct capiminor *capiminor_find(
  1183. /* -------- struct capincci ----------------------------------------- */
  1184. -static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci)
  1185. +static struct capincci *capincci_alloc(struct capidev *cdev, __u32 ncci)
  1186. {
  1187. struct capincci *np, **pp;
  1188. #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
  1189. @@ -302,7 +336,11 @@ static struct capincci *capincci_alloc(s
  1190. kdev_t kdev;
  1191. #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
  1192. +#ifdef COMPAT_HAS_kmem_cache
  1193. np = (struct capincci *)kmem_cache_alloc(capincci_cachep, GFP_ATOMIC);
  1194. +#else
  1195. + np = (struct capincci *)kmalloc(sizeof(struct capincci), GFP_ATOMIC);
  1196. +#endif
  1197. if (!np)
  1198. return 0;
  1199. memset(np, 0, sizeof(struct capincci));
  1200. @@ -331,7 +369,7 @@ static struct capincci *capincci_alloc(s
  1201. return np;
  1202. }
  1203. -static void capincci_free(struct capidev *cdev, u32 ncci)
  1204. +static void capincci_free(struct capidev *cdev, __u32 ncci)
  1205. {
  1206. struct capincci *np, **pp;
  1207. #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
  1208. @@ -367,7 +405,11 @@ static void capincci_free(struct capidev
  1209. }
  1210. }
  1211. #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
  1212. +#ifdef COMPAT_HAS_kmem_cache
  1213. kmem_cache_free(capincci_cachep, np);
  1214. +#else
  1215. + kfree(np);
  1216. +#endif
  1217. if (*pp == 0) return;
  1218. } else {
  1219. pp = &(*pp)->next;
  1220. @@ -375,7 +417,7 @@ static void capincci_free(struct capidev
  1221. }
  1222. }
  1223. -static struct capincci *capincci_find(struct capidev *cdev, u32 ncci)
  1224. +struct capincci *capincci_find(struct capidev *cdev, __u32 ncci)
  1225. {
  1226. struct capincci *p;
  1227. @@ -393,7 +435,11 @@ static struct capidev *capidev_alloc(str
  1228. struct capidev *cdev;
  1229. struct capidev **pp;
  1230. +#ifdef COMPAT_HAS_kmem_cache
  1231. cdev = (struct capidev *)kmem_cache_alloc(capidev_cachep, GFP_KERNEL);
  1232. +#else
  1233. + cdev = (struct capidev *)kmalloc(sizeof(struct capidev), GFP_KERNEL);
  1234. +#endif
  1235. if (!cdev)
  1236. return 0;
  1237. memset(cdev, 0, sizeof(struct capidev));
  1238. @@ -423,10 +469,14 @@ static void capidev_free(struct capidev
  1239. if (*pp)
  1240. *pp = cdev->next;
  1241. +#ifdef COMPAT_HAS_kmem_cache
  1242. kmem_cache_free(capidev_cachep, cdev);
  1243. +#else
  1244. + kfree(cdev);
  1245. +#endif
  1246. }
  1247. -static struct capidev *capidev_find(u16 applid)
  1248. +static struct capidev *capidev_find(__u16 applid)
  1249. {
  1250. struct capidev *p;
  1251. for (p=capidev_openlist; p; p = p->next) {
  1252. @@ -439,13 +489,13 @@ static struct capidev *capidev_find(u16
  1253. #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
  1254. /* -------- handle data queue --------------------------------------- */
  1255. -static struct sk_buff *
  1256. +struct sk_buff *
  1257. gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb)
  1258. {
  1259. struct sk_buff *nskb;
  1260. nskb = alloc_skb(CAPI_DATA_B3_RESP_LEN, GFP_ATOMIC);
  1261. if (nskb) {
  1262. - u16 datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4+4+2);
  1263. + __u16 datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4+4+2);
  1264. unsigned char *s = skb_put(nskb, CAPI_DATA_B3_RESP_LEN);
  1265. capimsg_setu16(s, 0, CAPI_DATA_B3_RESP_LEN);
  1266. capimsg_setu16(s, 2, mp->applid);
  1267. @@ -458,11 +508,11 @@ gen_data_b3_resp_for(struct capiminor *m
  1268. return nskb;
  1269. }
  1270. -static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
  1271. +int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
  1272. {
  1273. struct sk_buff *nskb;
  1274. unsigned int datalen;
  1275. - u16 errcode, datahandle;
  1276. + __u16 errcode, datahandle;
  1277. datalen = skb->len - CAPIMSG_LEN(skb->data);
  1278. if (mp->tty) {
  1279. @@ -504,6 +554,28 @@ static int handle_recv_skb(struct capimi
  1280. kfree_skb(skb);
  1281. return 0;
  1282. +#ifdef CAPI_PPP_ON_RAW_DEVICE
  1283. + } else if (mp->chan_connected) {
  1284. + if ((nskb = gen_data_b3_resp_for(mp, skb)) == 0) {
  1285. + printk(KERN_ERR "capi: gen_data_b3_resp failed\n");
  1286. + return -1;
  1287. + }
  1288. + datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4);
  1289. + errcode = (*capifuncs->capi_put_message)(mp->applid, nskb);
  1290. + if (errcode != CAPI_NOERROR) {
  1291. + printk(KERN_ERR "capi: send DATA_B3_RESP failed=%x\n",
  1292. + errcode);
  1293. + kfree_skb(nskb);
  1294. + return -1;
  1295. + }
  1296. + (void)skb_pull(skb, CAPIMSG_LEN(skb->data));
  1297. +#ifdef _DEBUG_DATAFLOW
  1298. + printk(KERN_DEBUG "capi: DATA_B3_RESP %u len=%d => ppp\n",
  1299. + datahandle, skb->len);
  1300. +#endif
  1301. + ppp_input(&mp->chan, skb);
  1302. + return 0;
  1303. +#endif
  1304. } else if (mp->file) {
  1305. if (skb_queue_len(&mp->recvqueue) > CAPINC_MAX_RECVQUEUE) {
  1306. #if defined(_DEBUG_DATAFLOW) || defined(_DEBUG_TTYFUNCS)
  1307. @@ -538,7 +610,7 @@ static int handle_recv_skb(struct capimi
  1308. return -1;
  1309. }
  1310. -static void handle_minor_recv(struct capiminor *mp)
  1311. +void handle_minor_recv(struct capiminor *mp)
  1312. {
  1313. struct sk_buff *skb;
  1314. while ((skb = skb_dequeue(&mp->inqueue)) != 0) {
  1315. @@ -552,13 +624,13 @@ static void handle_minor_recv(struct cap
  1316. }
  1317. }
  1318. -static int handle_minor_send(struct capiminor *mp)
  1319. +int handle_minor_send(struct capiminor *mp)
  1320. {
  1321. struct sk_buff *skb;
  1322. - u16 len;
  1323. + __u16 len;
  1324. int count = 0;
  1325. - u16 errcode;
  1326. - u16 datahandle;
  1327. + __u16 errcode;
  1328. + __u16 datahandle;
  1329. if (mp->tty && mp->ttyoutstop) {
  1330. #if defined(_DEBUG_DATAFLOW) || defined(_DEBUG_TTYFUNCS)
  1331. @@ -569,7 +641,7 @@ static int handle_minor_send(struct capi
  1332. while ((skb = skb_dequeue(&mp->outqueue)) != 0) {
  1333. datahandle = mp->datahandle;
  1334. - len = (u16)skb->len;
  1335. + len = (__u16)skb->len;
  1336. skb_push(skb, CAPI_DATA_B3_REQ_LEN);
  1337. memset(skb->data, 0, CAPI_DATA_B3_REQ_LEN);
  1338. capimsg_setu16(skb->data, 0, CAPI_DATA_B3_REQ_LEN);
  1339. @@ -578,7 +650,7 @@ static int handle_minor_send(struct capi
  1340. capimsg_setu8 (skb->data, 5, CAPI_REQ);
  1341. capimsg_setu16(skb->data, 6, mp->msgid++);
  1342. capimsg_setu32(skb->data, 8, mp->ncci); /* NCCI */
  1343. - capimsg_setu32(skb->data, 12, (u32) skb->data); /* Data32 */
  1344. + capimsg_setu32(skb->data, 12, (__u32) skb->data); /* Data32 */
  1345. capimsg_setu16(skb->data, 16, len); /* Data length */
  1346. capimsg_setu16(skb->data, 18, datahandle);
  1347. capimsg_setu16(skb->data, 20, 0); /* Flags */
  1348. @@ -620,16 +692,16 @@ static int handle_minor_send(struct capi
  1349. #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
  1350. /* -------- function called by lower level -------------------------- */
  1351. -static void capi_signal(u16 applid, void *param)
  1352. +static void capi_signal(__u16 applid, void *param)
  1353. {
  1354. struct capidev *cdev = (struct capidev *)param;
  1355. #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
  1356. struct capiminor *mp;
  1357. - u16 datahandle;
  1358. + __u16 datahandle;
  1359. #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
  1360. struct capincci *np;
  1361. struct sk_buff *skb = 0;
  1362. - u32 ncci;
  1363. + __u32 ncci;
  1364. (void) (*capifuncs->capi_get_message) (applid, &skb);
  1365. if (!skb) {
  1366. @@ -683,6 +755,12 @@ static void capi_signal(u16 applid, void
  1367. #endif
  1368. kfree_skb(skb);
  1369. (void)capiminor_del_ack(mp, datahandle);
  1370. +#ifdef CAPI_PPP_ON_RAW_DEVICE
  1371. + if (mp->chan_connected) {
  1372. + ppp_output_wakeup(&mp->chan);
  1373. + return;
  1374. + }
  1375. +#endif
  1376. if (mp->tty) {
  1377. if (mp->tty->ldisc.write_wakeup)
  1378. mp->tty->ldisc.write_wakeup(mp->tty);
  1379. @@ -758,7 +836,7 @@ capi_write(struct file *file, const char
  1380. struct capidev *cdev = (struct capidev *)file->private_data;
  1381. struct sk_buff *skb;
  1382. int retval;
  1383. - u16 mlen;
  1384. + __u16 mlen;
  1385. if (ppos != &file->f_pos)
  1386. return -ESPIPE;
  1387. @@ -998,7 +1076,7 @@ capi_ioctl(struct inode *inode, struct f
  1388. sizeof(ncci));
  1389. if (retval)
  1390. return -EFAULT;
  1391. - nccip = capincci_find(cdev, (u32) ncci);
  1392. + nccip = capincci_find(cdev, (__u32) ncci);
  1393. if (!nccip)
  1394. return 0;
  1395. #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
  1396. @@ -1023,7 +1101,7 @@ capi_ioctl(struct inode *inode, struct f
  1397. sizeof(ncci));
  1398. if (retval)
  1399. return -EFAULT;
  1400. - nccip = capincci_find(cdev, (u32) ncci);
  1401. + nccip = capincci_find(cdev, (__u32) ncci);
  1402. if (!nccip || (mp = nccip->minorp) == 0)
  1403. return -ESRCH;
  1404. return mp->minor;
  1405. @@ -1070,7 +1148,9 @@ capi_release(struct inode *inode, struct
  1406. static struct file_operations capi_fops =
  1407. {
  1408. +#ifdef COMPAT_HAS_FILEOP_OWNER
  1409. owner: THIS_MODULE,
  1410. +#endif
  1411. llseek: no_llseek,
  1412. read: capi_read,
  1413. write: capi_write,
  1414. @@ -1233,6 +1313,45 @@ capinc_raw_ioctl(struct inode *inode, st
  1415. return -EINVAL;
  1416. switch (cmd) {
  1417. +#ifdef CAPI_PPP_ON_RAW_DEVICE
  1418. + case PPPIOCATTACH:
  1419. + {
  1420. + int retval, val;
  1421. + if (get_user(val, (int *) arg))
  1422. + break;
  1423. + if (mp->chan_connected)
  1424. + return -EALREADY;
  1425. + mp->chan.private = mp;
  1426. +#if 1
  1427. + return -EINVAL;
  1428. +#else
  1429. + mp->chan.ops = &ppp_ops;
  1430. +#endif
  1431. +
  1432. + retval = ppp_register_channel(&mp->chan, val);
  1433. + if (retval)
  1434. + return retval;
  1435. + mp->chan_connected = 1;
  1436. + mp->chan_index = val;
  1437. + }
  1438. + return 0;
  1439. + case PPPIOCDETACH:
  1440. + {
  1441. + if (!mp->chan_connected)
  1442. + return -ENXIO;
  1443. + ppp_unregister_channel(&mp->chan);
  1444. + mp->chan_connected = 0;
  1445. + }
  1446. + return 0;
  1447. + case PPPIOCGUNIT:
  1448. + {
  1449. + if (!mp->chan_connected)
  1450. + return -ENXIO;
  1451. + if (put_user(mp->chan_index, (int *) arg))
  1452. + return -EFAULT;
  1453. + }
  1454. + return 0;
  1455. +#endif
  1456. }
  1457. return -EINVAL;
  1458. }
  1459. @@ -1260,7 +1379,9 @@ capinc_raw_release(struct inode *inode,
  1460. static struct file_operations capinc_raw_fops =
  1461. {
  1462. +#ifdef COMPAT_HAS_FILEOP_OWNER
  1463. owner: THIS_MODULE,
  1464. +#endif
  1465. llseek: no_llseek,
  1466. read: capinc_raw_read,
  1467. write: capinc_raw_write,
  1468. @@ -1272,7 +1393,7 @@ static struct file_operations capinc_raw
  1469. /* -------- tty_operations for capincci ----------------------------- */
  1470. -static int capinc_tty_open(struct tty_struct * tty, struct file * file)
  1471. +int capinc_tty_open(struct tty_struct * tty, struct file * file)
  1472. {
  1473. struct capiminor *mp;
  1474. @@ -1300,7 +1421,7 @@ static int capinc_tty_open(struct tty_st
  1475. return 0;
  1476. }
  1477. -static void capinc_tty_close(struct tty_struct * tty, struct file * file)
  1478. +void capinc_tty_close(struct tty_struct * tty, struct file * file)
  1479. {
  1480. struct capiminor *mp;
  1481. @@ -1325,8 +1446,8 @@ static void capinc_tty_close(struct tty_
  1482. #endif
  1483. }
  1484. -static int capinc_tty_write(struct tty_struct * tty, int from_user,
  1485. - const unsigned char *buf, int count)
  1486. +int capinc_tty_write(struct tty_struct * tty, int from_user,
  1487. + const unsigned char *buf, int count)
  1488. {
  1489. struct capiminor *mp = (struct capiminor *)tty->driver_data;
  1490. struct sk_buff *skb;
  1491. @@ -1377,7 +1498,7 @@ static int capinc_tty_write(struct tty_s
  1492. return count;
  1493. }
  1494. -static void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
  1495. +void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
  1496. {
  1497. struct capiminor *mp = (struct capiminor *)tty->driver_data;
  1498. struct sk_buff *skb;
  1499. @@ -1414,7 +1535,7 @@ static void capinc_tty_put_char(struct t
  1500. }
  1501. }
  1502. -static void capinc_tty_flush_chars(struct tty_struct *tty)
  1503. +void capinc_tty_flush_chars(struct tty_struct *tty)
  1504. {
  1505. struct capiminor *mp = (struct capiminor *)tty->driver_data;
  1506. struct sk_buff *skb;
  1507. @@ -1440,7 +1561,7 @@ static void capinc_tty_flush_chars(struc
  1508. (void)handle_minor_recv(mp);
  1509. }
  1510. -static int capinc_tty_write_room(struct tty_struct *tty)
  1511. +int capinc_tty_write_room(struct tty_struct *tty)
  1512. {
  1513. struct capiminor *mp = (struct capiminor *)tty->driver_data;
  1514. int room;
  1515. @@ -1458,7 +1579,7 @@ static int capinc_tty_write_room(struct
  1516. return room;
  1517. }
  1518. -static int capinc_tty_chars_in_buffer(struct tty_struct *tty)
  1519. +int capinc_tty_chars_in_buffer(struct tty_struct *tty)
  1520. {
  1521. struct capiminor *mp = (struct capiminor *)tty->driver_data;
  1522. if (!mp || !mp->nccip) {
  1523. @@ -1476,7 +1597,7 @@ static int capinc_tty_chars_in_buffer(st
  1524. return mp->outbytes;
  1525. }
  1526. -static int capinc_tty_ioctl(struct tty_struct *tty, struct file * file,
  1527. +int capinc_tty_ioctl(struct tty_struct *tty, struct file * file,
  1528. unsigned int cmd, unsigned long arg)
  1529. {
  1530. int error = 0;
  1531. @@ -1488,14 +1609,14 @@ static int capinc_tty_ioctl(struct tty_s
  1532. return error;
  1533. }
  1534. -static void capinc_tty_set_termios(struct tty_struct *tty, struct termios * old)
  1535. +void capinc_tty_set_termios(struct tty_struct *tty, struct termios * old)
  1536. {
  1537. #ifdef _DEBUG_TTYFUNCS
  1538. printk(KERN_DEBUG "capinc_tty_set_termios\n");
  1539. #endif
  1540. }
  1541. -static void capinc_tty_throttle(struct tty_struct * tty)
  1542. +void capinc_tty_throttle(struct tty_struct * tty)
  1543. {
  1544. struct capiminor *mp = (struct capiminor *)tty->driver_data;
  1545. #ifdef _DEBUG_TTYFUNCS
  1546. @@ -1505,7 +1626,7 @@ static void capinc_tty_throttle(struct t
  1547. mp->ttyinstop = 1;
  1548. }
  1549. -static void capinc_tty_unthrottle(struct tty_struct * tty)
  1550. +void capinc_tty_unthrottle(struct tty_struct * tty)
  1551. {
  1552. struct capiminor *mp = (struct capiminor *)tty->driver_data;
  1553. #ifdef _DEBUG_TTYFUNCS
  1554. @@ -1517,7 +1638,7 @@ static void capinc_tty_unthrottle(struct
  1555. }
  1556. }
  1557. -static void capinc_tty_stop(struct tty_struct *tty)
  1558. +void capinc_tty_stop(struct tty_struct *tty)
  1559. {
  1560. struct capiminor *mp = (struct capiminor *)tty->driver_data;
  1561. #ifdef _DEBUG_TTYFUNCS
  1562. @@ -1528,7 +1649,7 @@ static void capinc_tty_stop(struct tty_s
  1563. }
  1564. }
  1565. -static void capinc_tty_start(struct tty_struct *tty)
  1566. +void capinc_tty_start(struct tty_struct *tty)
  1567. {
  1568. struct capiminor *mp = (struct capiminor *)tty->driver_data;
  1569. #ifdef _DEBUG_TTYFUNCS
  1570. @@ -1540,43 +1661,49 @@ static void capinc_tty_start(struct tty_
  1571. }
  1572. }
  1573. -static void capinc_tty_hangup(struct tty_struct *tty)
  1574. +void capinc_tty_hangup(struct tty_struct *tty)
  1575. {
  1576. #ifdef _DEBUG_TTYFUNCS
  1577. printk(KERN_DEBUG "capinc_tty_hangup\n");
  1578. #endif
  1579. }
  1580. -static void capinc_tty_break_ctl(struct tty_struct *tty, int state)
  1581. +void capinc_tty_break_ctl(struct tty_struct *tty, int state)
  1582. {
  1583. #ifdef _DEBUG_TTYFUNCS
  1584. printk(KERN_DEBUG "capinc_tty_break_ctl(%d)\n", state);
  1585. #endif
  1586. }
  1587. -static void capinc_tty_flush_buffer(struct tty_struct *tty)
  1588. +void capinc_tty_flush_buffer(struct tty_struct *tty)
  1589. {
  1590. #ifdef _DEBUG_TTYFUNCS
  1591. printk(KERN_DEBUG "capinc_tty_flush_buffer\n");
  1592. #endif
  1593. }
  1594. -static void capinc_tty_set_ldisc(struct tty_struct *tty)
  1595. +void capinc_tty_set_ldisc(struct tty_struct *tty)
  1596. {
  1597. #ifdef _DEBUG_TTYFUNCS
  1598. printk(KERN_DEBUG "capinc_tty_set_ldisc\n");
  1599. #endif
  1600. }
  1601. -static void capinc_tty_send_xchar(struct tty_struct *tty, char ch)
  1602. +void capinc_tty_send_xchar(struct tty_struct *tty, char ch)
  1603. {
  1604. #ifdef _DEBUG_TTYFUNCS
  1605. printk(KERN_DEBUG "capinc_tty_send_xchar(%d)\n", ch);
  1606. #endif
  1607. }
  1608. -static int capinc_tty_read_proc(char *page, char **start, off_t off,
  1609. - int count, int *eof, void *data)
  1610. +int capinc_tty_read_proc(char *page, char **start, off_t off,
  1611. + int count, int *eof, void *data)
  1612. +{
  1613. + return 0;
  1614. +}
  1615. +
  1616. +int capinc_write_proc(struct file *file, const char *buffer,
  1617. + unsigned long count, void *data)
  1618. {
  1619. return 0;
  1620. }
  1621. @@ -1588,7 +1715,7 @@ static struct tty_struct *capinc_tty_tab
  1622. static struct termios *capinc_tty_termios[CAPINC_NR_PORTS];
  1623. static struct termios *capinc_tty_termios_locked[CAPINC_NR_PORTS];
  1624. -static int capinc_tty_init(void)
  1625. +int capinc_tty_init(void)
  1626. {
  1627. struct tty_driver *drv = &capinc_tty_driver;
  1628. @@ -1646,7 +1773,7 @@ static int capinc_tty_init(void)
  1629. return 0;
  1630. }
  1631. -static void capinc_tty_exit(void)
  1632. +void capinc_tty_exit(void)
  1633. {
  1634. struct tty_driver *drv = &capinc_tty_driver;
  1635. int retval;
  1636. @@ -1771,8 +1898,9 @@ static void __exit proc_exit(void)
  1637. /* -------- init function and module interface ---------------------- */
  1638. +#ifdef COMPAT_HAS_kmem_cache
  1639. -static void alloc_exit(void)
  1640. +static void __exit alloc_exit(void)
  1641. {
  1642. if (capidev_cachep) {
  1643. (void)kmem_cache_destroy(capidev_cachep);
  1644. @@ -1837,8 +1965,9 @@ static int __init alloc_init(void)
  1645. #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
  1646. return 0;
  1647. }
  1648. +#endif
  1649. -static void lower_callback(unsigned int cmd, u32 contr, void *data)
  1650. +static void lower_callback(unsigned int cmd, __u32 contr, void *data)
  1651. {
  1652. struct capi_ncciinfo *np;
  1653. struct capidev *cdev;
  1654. @@ -1900,15 +2029,19 @@ static int __init capi_init(void)
  1655. MOD_DEC_USE_COUNT;
  1656. return -EIO;
  1657. }
  1658. +#ifdef HAVE_DEVFS_FS
  1659. devfs_register_series (NULL, "capi/r%u", CAPINC_NR_PORTS,
  1660. DEVFS_FL_DEFAULT,
  1661. capi_rawmajor, 0,
  1662. S_IFCHR | S_IRUSR | S_IWUSR,
  1663. &capinc_raw_fops, NULL);
  1664. +#endif
  1665. #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
  1666. +#ifdef HAVE_DEVFS_FS
  1667. devfs_register (NULL, "isdn/capi20", DEVFS_FL_DEFAULT,
  1668. capi_major, 0, S_IFCHR | S_IRUSR | S_IWUSR,
  1669. &capi_fops, NULL);
  1670. +#endif
  1671. printk(KERN_NOTICE "capi20: started up with major %d\n", capi_major);
  1672. if ((capifuncs = attach_capi_interface(&cuser)) == 0) {
  1673. @@ -1918,9 +2051,11 @@ static int __init capi_init(void)
  1674. #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
  1675. devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
  1676. #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
  1677. +#ifdef HAVE_DEVFS_FS
  1678. devfs_unregister(devfs_find_handle(NULL, "capi20",
  1679. capi_major, 0,
  1680. DEVFS_SPECIAL_CHR, 0));
  1681. +#endif
  1682. return -EIO;
  1683. }
  1684. @@ -1934,8 +2069,10 @@ static int __init capi_init(void)
  1685. }
  1686. #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
  1687. +#ifdef COMPAT_HAS_kmem_cache
  1688. if (alloc_init() < 0) {
  1689. #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
  1690. +#ifdef HAVE_DEVFS_FS
  1691. unsigned int j;
  1692. devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
  1693. for (j = 0; j < CAPINC_NR_PORTS; j++) {
  1694. @@ -1943,16 +2080,20 @@ static int __init capi_init(void)
  1695. sprintf(devname, "capi/r%u", j);
  1696. devfs_unregister(devfs_find_handle(NULL, devname, capi_rawmajor, j, DEVFS_SPECIAL_CHR, 0));
  1697. }
  1698. +#endif
  1699. capinc_tty_exit();
  1700. #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
  1701. (void) detach_capi_interface(&cuser);
  1702. devfs_unregister_chrdev(capi_major, "capi20");
  1703. +#ifdef HAVE_DEVFS_FS
  1704. devfs_unregister(devfs_find_handle(NULL, "capi20",
  1705. capi_major, 0,
  1706. DEVFS_SPECIAL_CHR, 0));
  1707. +#endif
  1708. MOD_DEC_USE_COUNT;
  1709. return -ENOMEM;
  1710. }
  1711. +#endif /* COMPAT_HAS_kmem_cache */
  1712. (void)proc_init();
  1713. @@ -1975,23 +2116,31 @@ static int __init capi_init(void)
  1714. static void __exit capi_exit(void)
  1715. {
  1716. #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
  1717. +#ifdef HAVE_DEVFS_FS
  1718. unsigned int j;
  1719. #endif
  1720. +#endif
  1721. +#ifdef COMPAT_HAS_kmem_cache
  1722. alloc_exit();
  1723. +#endif
  1724. (void)proc_exit();
  1725. devfs_unregister_chrdev(capi_major, "capi20");
  1726. +#ifdef HAVE_DEVFS_FS
  1727. devfs_unregister(devfs_find_handle(NULL, "isdn/capi20", capi_major, 0, DEVFS_SPECIAL_CHR, 0));
  1728. +#endif
  1729. #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
  1730. capinc_tty_exit();
  1731. devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
  1732. +#ifdef HAVE_DEVFS_FS
  1733. for (j = 0; j < CAPINC_NR_PORTS; j++) {
  1734. char devname[32];
  1735. sprintf(devname, "capi/r%u", j);
  1736. devfs_unregister(devfs_find_handle(NULL, devname, capi_rawmajor, j, DEVFS_SPECIAL_CHR, 0));
  1737. }
  1738. #endif
  1739. +#endif
  1740. (void) detach_capi_interface(&cuser);
  1741. printk(KERN_NOTICE "capi: Rev %s: unloaded\n", rev);
  1742. }
  1743. Index: linux-2.4.35.4/drivers/isdn/avmb1/capicmd.h
  1744. ===================================================================
  1745. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capicmd.h
  1746. +++ linux-2.4.35.4/drivers/isdn/avmb1/capicmd.h
  1747. @@ -1,4 +1,4 @@
  1748. -/* $Id: capicmd.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  1749. +/* $Id: capicmd.h,v 1.4 2001/09/24 13:22:44 kai Exp $
  1750. *
  1751. * CAPI 2.0 Interface for Linux
  1752. *
  1753. Index: linux-2.4.35.4/drivers/isdn/avmb1/capidev.h
  1754. ===================================================================
  1755. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capidev.h
  1756. +++ linux-2.4.35.4/drivers/isdn/avmb1/capidev.h
  1757. @@ -1,4 +1,4 @@
  1758. -/* $Id: capidev.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  1759. +/* $Id: capidev.h,v 1.8 2001/09/24 13:22:44 kai Exp $
  1760. *
  1761. * CAPI 2.0 Interface for Linux
  1762. *
  1763. Index: linux-2.4.35.4/drivers/isdn/avmb1/capidrv.c
  1764. ===================================================================
  1765. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capidrv.c
  1766. +++ linux-2.4.35.4/drivers/isdn/avmb1/capidrv.c
  1767. @@ -1,4 +1,4 @@
  1768. -/* $Id: capidrv.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  1769. +/* $Id: capidrv.c,v 1.45 2001/09/24 13:22:44 kai Exp $
  1770. *
  1771. * ISDN4Linux Driver, using capi20 interface (kernelcapi)
  1772. *
  1773. @@ -35,7 +35,7 @@
  1774. #include "capicmd.h"
  1775. #include "capidrv.h"
  1776. -static char *revision = "$Revision: 1.1.4.1 $";
  1777. +static char *revision = "$Revision: 1.45 $";
  1778. static int debugmode = 0;
  1779. MODULE_DESCRIPTION("CAPI4Linux: Interface to ISDN4Linux");
  1780. @@ -105,7 +105,6 @@ struct capidrv_contr {
  1781. int oldstate;
  1782. /* */
  1783. __u16 datahandle;
  1784. - spinlock_t lock;
  1785. struct ncci_datahandle_queue {
  1786. struct ncci_datahandle_queue *next;
  1787. __u16 datahandle;
  1788. @@ -423,7 +422,6 @@ static inline capidrv_ncci *new_ncci(cap
  1789. nccip->plcip = plcip;
  1790. nccip->chan = plcip->chan;
  1791. nccip->datahandle = 0;
  1792. - nccip->lock = SPIN_LOCK_UNLOCKED;
  1793. nccip->next = plcip->ncci_list;
  1794. plcip->ncci_list = nccip;
  1795. @@ -480,7 +478,6 @@ static int capidrv_add_ack(struct capidr
  1796. __u16 datahandle, int len)
  1797. {
  1798. struct ncci_datahandle_queue *n, **pp;
  1799. - unsigned long flags;
  1800. n = (struct ncci_datahandle_queue *)
  1801. kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC);
  1802. @@ -491,31 +488,25 @@ static int capidrv_add_ack(struct capidr
  1803. n->next = 0;
  1804. n->datahandle = datahandle;
  1805. n->len = len;
  1806. - spin_lock_irqsave(&nccip->lock, flags);
  1807. for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) ;
  1808. *pp = n;
  1809. - spin_unlock_irqrestore(&nccip->lock, flags);
  1810. return 0;
  1811. }
  1812. static int capidrv_del_ack(struct capidrv_ncci *nccip, __u16 datahandle)
  1813. {
  1814. struct ncci_datahandle_queue **pp, *p;
  1815. - unsigned long flags;
  1816. int len;
  1817. - spin_lock_irqsave(&nccip->lock, flags);
  1818. for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) {
  1819. if ((*pp)->datahandle == datahandle) {
  1820. p = *pp;
  1821. len = p->len;
  1822. *pp = (*pp)->next;
  1823. - spin_unlock_irqrestore(&nccip->lock, flags);
  1824. kfree(p);
  1825. return len;
  1826. }
  1827. }
  1828. - spin_unlock_irqrestore(&nccip->lock, flags);
  1829. return -1;
  1830. }
  1831. @@ -523,25 +514,13 @@ static int capidrv_del_ack(struct capidr
  1832. static void send_message(capidrv_contr * card, _cmsg * cmsg)
  1833. {
  1834. - struct sk_buff *skb;
  1835. - size_t len;
  1836. - u16 err;
  1837. -
  1838. + struct sk_buff *skb;
  1839. + size_t len;
  1840. capi_cmsg2message(cmsg, cmsg->buf);
  1841. len = CAPIMSG_LEN(cmsg->buf);
  1842. skb = alloc_skb(len, GFP_ATOMIC);
  1843. - if(!skb) {
  1844. - printk(KERN_ERR "no skb len(%d) memory\n", len);
  1845. - return;
  1846. - }
  1847. memcpy(skb_put(skb, len), cmsg->buf, len);
  1848. - err = (*capifuncs->capi_put_message) (global.appid, skb);
  1849. - if (err) {
  1850. - printk(KERN_WARNING "%s: capi_put_message error: %04x\n",
  1851. - __FUNCTION__, err);
  1852. - kfree_skb(skb);
  1853. - return;
  1854. - }
  1855. + (*capifuncs->capi_put_message) (global.appid, skb);
  1856. global.nsentctlpkt++;
  1857. }
  1858. @@ -1932,8 +1911,10 @@ static int if_sendbuf(int id, int channe
  1859. (void)capidrv_del_ack(nccip, datahandle);
  1860. return 0;
  1861. }
  1862. +#if 1
  1863. printk(KERN_DEBUG "capidrv-%d: only %d bytes headroom, need %d\n",
  1864. card->contrnr, skb_headroom(skb), msglen);
  1865. +#endif
  1866. memcpy(skb_push(nskb, msglen), sendcmsg.buf, msglen);
  1867. errcode = (*capifuncs->capi_put_message) (global.appid, nskb);
  1868. if (errcode == CAPI_NOERROR) {
  1869. @@ -2035,6 +2016,52 @@ static void enable_dchannel_trace(capidr
  1870. send_message(card, &cmdcmsg);
  1871. }
  1872. +#if 0
  1873. +static void disable_dchannel_trace(capidrv_contr *card)
  1874. +{
  1875. + __u8 manufacturer[CAPI_MANUFACTURER_LEN];
  1876. + capi_version version;
  1877. + __u16 contr = card->contrnr;
  1878. + __u16 errcode;
  1879. + __u16 avmversion[3];
  1880. +
  1881. + errcode = (*capifuncs->capi_get_manufacturer)(contr, manufacturer);
  1882. + if (errcode != CAPI_NOERROR) {
  1883. + printk(KERN_ERR "%s: can't get manufacturer (0x%x)\n",
  1884. + card->name, errcode);
  1885. + return;
  1886. + }
  1887. + if (strstr(manufacturer, "AVM") == 0) {
  1888. + printk(KERN_ERR "%s: not from AVM, no d-channel trace possible (%s)\n",
  1889. + card->name, manufacturer);
  1890. + return;
  1891. + }
  1892. + errcode = (*capifuncs->capi_get_version)(contr, &version);
  1893. + if (errcode != CAPI_NOERROR) {
  1894. + printk(KERN_ERR "%s: can't get version (0x%x)\n",
  1895. + card->name, errcode);
  1896. + return;
  1897. + }
  1898. + avmversion[0] = (version.majormanuversion >> 4) & 0x0f;
  1899. + avmversion[1] = (version.majormanuversion << 4) & 0xf0;
  1900. + avmversion[1] |= (version.minormanuversion >> 4) & 0x0f;
  1901. + avmversion[2] |= version.minormanuversion & 0x0f;
  1902. +
  1903. + if (avmversion[0] > 3 || (avmversion[0] == 3 && avmversion[1] > 5)) {
  1904. + printk(KERN_INFO "%s: D2 trace disabled\n", card->name);
  1905. + } else {
  1906. + printk(KERN_INFO "%s: D3 trace disabled\n", card->name);
  1907. + }
  1908. + capi_fill_MANUFACTURER_REQ(&cmdcmsg, global.appid,
  1909. + card->msgid++,
  1910. + contr,
  1911. + 0x214D5641, /* ManuID */
  1912. + 0, /* Class */
  1913. + 1, /* Function */
  1914. + (_cstruct)"\004\000\000\000\000");
  1915. + send_message(card, &cmdcmsg);
  1916. +}
  1917. +#endif
  1918. static void send_listen(capidrv_contr *card)
  1919. {
  1920. @@ -2200,10 +2227,10 @@ static int capidrv_delcontr(__u16 contr)
  1921. free_ncci(card, card->bchans[card->nbchan-1].nccip);
  1922. if (card->bchans[card->nbchan-1].plcip)
  1923. free_plci(card, card->bchans[card->nbchan-1].plcip);
  1924. + if (card->plci_list)
  1925. + printk(KERN_ERR "capidrv: bug in free_plci()\n");
  1926. card->nbchan--;
  1927. }
  1928. - if (card->plci_list)
  1929. - printk(KERN_ERR "capidrv: bug in free_plci()\n");
  1930. kfree(card->bchans);
  1931. card->bchans = 0;
  1932. Index: linux-2.4.35.4/drivers/isdn/avmb1/capidrv.h
  1933. ===================================================================
  1934. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capidrv.h
  1935. +++ linux-2.4.35.4/drivers/isdn/avmb1/capidrv.h
  1936. @@ -1,4 +1,4 @@
  1937. -/* $Id: capidrv.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  1938. +/* $Id: capidrv.h,v 1.4 2001/09/24 13:22:44 kai Exp $
  1939. *
  1940. * ISDN4Linux Driver, using capi20 interface (kernelcapi)
  1941. *
  1942. Index: linux-2.4.35.4/drivers/isdn/avmb1/capifs.c
  1943. ===================================================================
  1944. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capifs.c
  1945. +++ linux-2.4.35.4/drivers/isdn/avmb1/capifs.c
  1946. @@ -1,4 +1,4 @@
  1947. -/* $Id: capifs.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  1948. +/* $Id: capifs.c,v 1.22 2001/09/24 13:22:44 kai Exp $
  1949. *
  1950. * Copyright 2000 by Carsten Paeth <[email protected]>
  1951. *
  1952. @@ -25,6 +25,7 @@
  1953. #include <linux/major.h>
  1954. #include <linux/slab.h>
  1955. #include <linux/ctype.h>
  1956. +#include <linux/isdn_compat.h>
  1957. #include <asm/bitops.h>
  1958. #include <asm/uaccess.h>
  1959. @@ -32,7 +33,7 @@ MODULE_DESCRIPTION("CAPI4Linux: /dev/cap
  1960. MODULE_AUTHOR("Carsten Paeth");
  1961. MODULE_LICENSE("GPL");
  1962. -static char *revision = "$Revision: 1.1.4.1 $";
  1963. +static char *revision = "$Revision: 1.22 $";
  1964. struct capifs_ncci {
  1965. struct inode *inode;
  1966. @@ -69,14 +70,21 @@ static inline struct capifs_sb_info *SBI
  1967. static int capifs_root_readdir(struct file *,void *,filldir_t);
  1968. static struct dentry *capifs_root_lookup(struct inode *,struct dentry *);
  1969. static int capifs_revalidate(struct dentry *, int);
  1970. +#ifdef COMPAT_VFS_2_4
  1971. static struct inode *capifs_new_inode(struct super_block *sb);
  1972. +#endif
  1973. static struct file_operations capifs_root_operations = {
  1974. +#ifdef COMPAT_VFS_2_4
  1975. read: generic_read_dir,
  1976. +#endif
  1977. readdir: capifs_root_readdir,
  1978. };
  1979. struct inode_operations capifs_root_inode_operations = {
  1980. +#ifndef COMPAT_VFS_2_4
  1981. + default_file_ops: &capifs_root_operations, /* file operations */
  1982. +#endif
  1983. lookup: capifs_root_lookup,
  1984. };
  1985. @@ -101,12 +109,20 @@ static int capifs_root_readdir(struct fi
  1986. switch(nr)
  1987. {
  1988. case 0:
  1989. +#ifdef COMPAT_VFS_2_4
  1990. if (filldir(dirent, ".", 1, nr, inode->i_ino, DT_DIR) < 0)
  1991. +#else
  1992. + if (filldir(dirent, ".", 1, nr, inode->i_ino) < 0)
  1993. +#endif
  1994. return 0;
  1995. filp->f_pos = ++nr;
  1996. /* fall through */
  1997. case 1:
  1998. +#ifdef COMPAT_VFS_2_4
  1999. if (filldir(dirent, "..", 2, nr, inode->i_ino, DT_DIR) < 0)
  2000. +#else
  2001. + if (filldir(dirent, "..", 2, nr, inode->i_ino) < 0)
  2002. +#endif
  2003. return 0;
  2004. filp->f_pos = ++nr;
  2005. /* fall through */
  2006. @@ -118,7 +134,11 @@ static int capifs_root_readdir(struct fi
  2007. char *p = numbuf;
  2008. if (np->type) *p++ = np->type;
  2009. sprintf(p, "%u", np->num);
  2010. +#ifdef COMPAT_VFS_2_4
  2011. if ( filldir(dirent, numbuf, strlen(numbuf), nr, nr, DT_UNKNOWN) < 0 )
  2012. +#else
  2013. + if ( filldir(dirent, numbuf, strlen(numbuf), nr, nr) < 0 )
  2014. +#endif
  2015. return 0;
  2016. }
  2017. filp->f_pos = ++nr;
  2018. @@ -180,7 +200,7 @@ static struct dentry *capifs_root_lookup
  2019. dentry->d_inode = np->inode;
  2020. if ( dentry->d_inode )
  2021. - atomic_inc(&dentry->d_inode->i_count);
  2022. + i_count_inc(dentry->d_inode->i_count);
  2023. d_add(dentry, dentry->d_inode);
  2024. @@ -199,9 +219,9 @@ static void capifs_put_super(struct supe
  2025. for ( i = 0 ; i < sbi->max_ncci ; i++ ) {
  2026. if ( (inode = sbi->nccis[i].inode) ) {
  2027. - if (atomic_read(&inode->i_count) != 1 )
  2028. + if (i_count_read(inode->i_count) != 1 )
  2029. printk("capifs_put_super: badness: entry %d count %d\n",
  2030. - i, (unsigned)atomic_read(&inode->i_count));
  2031. + i, (unsigned)i_count_read(inode->i_count));
  2032. inode->i_nlink--;
  2033. iput(inode);
  2034. }
  2035. @@ -213,11 +233,24 @@ static void capifs_put_super(struct supe
  2036. kfree(sbi->nccis);
  2037. kfree(sbi);
  2038. +#ifndef COMPAT_VFS_2_4
  2039. + MOD_DEC_USE_COUNT;
  2040. +#endif
  2041. }
  2042. +#ifdef COMPAT_VFS_2_4
  2043. static int capifs_statfs(struct super_block *sb, struct statfs *buf);
  2044. +#else
  2045. +static int capifs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
  2046. +static void capifs_write_inode(struct inode *inode) { };
  2047. +static void capifs_read_inode(struct inode *inode);
  2048. +#endif
  2049. static struct super_operations capifs_sops = {
  2050. +#ifndef COMPAT_VFS_2_4
  2051. + read_inode: capifs_read_inode,
  2052. + write_inode: capifs_write_inode,
  2053. +#endif
  2054. put_super: capifs_put_super,
  2055. statfs: capifs_statfs,
  2056. };
  2057. @@ -288,6 +321,10 @@ struct super_block *capifs_read_super(st
  2058. struct dentry * root;
  2059. struct capifs_sb_info *sbi;
  2060. +#ifndef COMPAT_VFS_2_4
  2061. + MOD_INC_USE_COUNT;
  2062. + lock_super(s);
  2063. +#endif
  2064. /* Super block already completed? */
  2065. if (s->s_root)
  2066. goto out;
  2067. @@ -322,6 +359,7 @@ struct super_block *capifs_read_super(st
  2068. /*
  2069. * Get the root inode and dentry, but defer checking for errors.
  2070. */
  2071. +#ifdef COMPAT_VFS_2_4
  2072. root_inode = capifs_new_inode(s);
  2073. if (root_inode) {
  2074. root_inode->i_ino = 1;
  2075. @@ -331,6 +369,10 @@ struct super_block *capifs_read_super(st
  2076. root_inode->i_nlink = 2;
  2077. }
  2078. root = d_alloc_root(root_inode);
  2079. +#else
  2080. + root_inode = iget(s, 1); /* inode 1 == root directory */
  2081. + root = d_alloc_root(root_inode, NULL);
  2082. +#endif
  2083. /*
  2084. * Check whether somebody else completed the super block.
  2085. @@ -370,11 +412,34 @@ struct super_block *capifs_read_super(st
  2086. mounts = s;
  2087. out: /* Success ... somebody else completed the super block for us. */
  2088. +#ifndef COMPAT_VFS_2_4
  2089. + unlock_super(s);
  2090. +#endif
  2091. return s;
  2092. fail:
  2093. +#ifndef COMPAT_VFS_2_4
  2094. + unlock_super(s);
  2095. + MOD_DEC_USE_COUNT;
  2096. +#endif
  2097. return NULL;
  2098. }
  2099. +#ifndef COMPAT_VFS_2_4
  2100. +static int capifs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
  2101. +{
  2102. + struct statfs tmp;
  2103. +
  2104. + tmp.f_type = CAPIFS_SUPER_MAGIC;
  2105. + tmp.f_bsize = 1024;
  2106. + tmp.f_blocks = 0;
  2107. + tmp.f_bfree = 0;
  2108. + tmp.f_bavail = 0;
  2109. + tmp.f_files = 0;
  2110. + tmp.f_ffree = 0;
  2111. + tmp.f_namelen = NAME_MAX;
  2112. + return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
  2113. +}
  2114. +#else
  2115. static int capifs_statfs(struct super_block *sb, struct statfs *buf)
  2116. {
  2117. buf->f_type = CAPIFS_SUPER_MAGIC;
  2118. @@ -387,7 +452,9 @@ static int capifs_statfs(struct super_bl
  2119. buf->f_namelen = NAME_MAX;
  2120. return 0;
  2121. }
  2122. +#endif
  2123. +#ifdef COMPAT_VFS_2_4
  2124. static struct inode *capifs_new_inode(struct super_block *sb)
  2125. {
  2126. struct inode *inode = new_inode(sb);
  2127. @@ -399,8 +466,51 @@ static struct inode *capifs_new_inode(st
  2128. }
  2129. return inode;
  2130. }
  2131. +#else
  2132. +static void capifs_read_inode(struct inode *inode)
  2133. +{
  2134. + ino_t ino = inode->i_ino;
  2135. + struct capifs_sb_info *sbi = SBI(inode->i_sb);
  2136. +
  2137. + inode->i_mode = 0;
  2138. + inode->i_nlink = 0;
  2139. + inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
  2140. + inode->i_blocks = 0;
  2141. + inode->i_blksize = 1024;
  2142. + inode->i_uid = inode->i_gid = 0;
  2143. +
  2144. + if ( ino == 1 ) {
  2145. + inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
  2146. + inode->i_op = &capifs_root_inode_operations;
  2147. + inode->i_nlink = 2;
  2148. + return;
  2149. + }
  2150. + ino -= 2;
  2151. + if ( ino >= sbi->max_ncci )
  2152. + return; /* Bogus */
  2153. +
  2154. +#ifdef COMPAT_VFS_2_4
  2155. + init_special_inode(inode, S_IFCHR, 0);
  2156. +#else
  2157. + inode->i_mode = S_IFCHR;
  2158. + inode->i_op = &chrdev_inode_operations;
  2159. +#endif
  2160. +
  2161. + return;
  2162. +}
  2163. +#endif
  2164. +
  2165. +#ifndef COMPAT_VFS_2_4
  2166. +static struct file_system_type capifs_fs_type = {
  2167. + "capifs",
  2168. + 0,
  2169. + capifs_read_super,
  2170. + NULL
  2171. +};
  2172. +#else
  2173. static DECLARE_FSTYPE(capifs_fs_type, "capifs", capifs_read_super, 0);
  2174. +#endif
  2175. void capifs_new_ncci(char type, unsigned int num, kdev_t device)
  2176. {
  2177. @@ -421,16 +531,26 @@ void capifs_new_ncci(char type, unsigned
  2178. break;
  2179. }
  2180. }
  2181. +#ifdef COMPAT_VFS_2_4
  2182. if ( ino >= sbi->max_ncci )
  2183. continue;
  2184. if ((np->inode = capifs_new_inode(sb)) != NULL) {
  2185. +#else
  2186. + if ((np->inode = iget(sb, ino+2)) != NULL) {
  2187. +#endif
  2188. struct inode *inode = np->inode;
  2189. inode->i_uid = sbi->setuid ? sbi->uid : current->fsuid;
  2190. inode->i_gid = sbi->setgid ? sbi->gid : current->fsgid;
  2191. +#ifdef COMPAT_VFS_2_4
  2192. inode->i_nlink = 1;
  2193. inode->i_ino = ino + 2;
  2194. init_special_inode(inode, sbi->mode|S_IFCHR, np->kdev);
  2195. +#else
  2196. + inode->i_mode = sbi->mode | S_IFCHR;
  2197. + inode->i_rdev = np->kdev;
  2198. + inode->i_nlink++;
  2199. +#endif
  2200. }
  2201. }
  2202. }
  2203. Index: linux-2.4.35.4/drivers/isdn/avmb1/capifs.h
  2204. ===================================================================
  2205. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capifs.h
  2206. +++ linux-2.4.35.4/drivers/isdn/avmb1/capifs.h
  2207. @@ -1,4 +1,4 @@
  2208. -/* $Id: capifs.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  2209. +/* $Id: capifs.h,v 1.4 2001/09/24 13:22:44 kai Exp $
  2210. *
  2211. * Copyright 2000 by Carsten Paeth <[email protected]>
  2212. *
  2213. Index: linux-2.4.35.4/drivers/isdn/avmb1/capilli.h
  2214. ===================================================================
  2215. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capilli.h
  2216. +++ linux-2.4.35.4/drivers/isdn/avmb1/capilli.h
  2217. @@ -1,4 +1,4 @@
  2218. -/* $Id: capilli.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  2219. +/* $Id: capilli.h,v 1.5 2001/09/24 13:22:44 kai Exp $
  2220. *
  2221. * Kernel CAPI 2.0 Driver Interface for Linux
  2222. *
  2223. Index: linux-2.4.35.4/drivers/isdn/avmb1/capiutil.c
  2224. ===================================================================
  2225. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capiutil.c
  2226. +++ linux-2.4.35.4/drivers/isdn/avmb1/capiutil.c
  2227. @@ -1,4 +1,4 @@
  2228. -/* $Id: capiutil.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  2229. +/* $Id: capiutil.c,v 1.16 2001/09/24 13:22:44 kai Exp $
  2230. *
  2231. * CAPI 2.0 convert capi message to capi message struct
  2232. *
  2233. @@ -19,6 +19,7 @@
  2234. #include <linux/init.h>
  2235. #include <asm/segment.h>
  2236. #include <linux/config.h>
  2237. +#include <linux/isdn_compat.h>
  2238. #include "capiutil.h"
  2239. MODULE_DESCRIPTION("CAPI4Linux: CAPI message conversion support");
  2240. Index: linux-2.4.35.4/drivers/isdn/avmb1/capiutil.h
  2241. ===================================================================
  2242. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/capiutil.h
  2243. +++ linux-2.4.35.4/drivers/isdn/avmb1/capiutil.h
  2244. @@ -1,4 +1,4 @@
  2245. -/* $Id: capiutil.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  2246. +/* $Id: capiutil.h,v 1.7 2001/09/24 13:22:44 kai Exp $
  2247. *
  2248. * CAPI 2.0 defines & types
  2249. *
  2250. Index: linux-2.4.35.4/drivers/isdn/avmb1/kcapi.c
  2251. ===================================================================
  2252. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/kcapi.c
  2253. +++ linux-2.4.35.4/drivers/isdn/avmb1/kcapi.c
  2254. @@ -1,4 +1,4 @@
  2255. -/* $Id: kcapi.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  2256. +/* $Id: kcapi.c,v 1.28 2001/09/24 13:22:44 kai Exp $
  2257. *
  2258. * Kernel CAPI 2.0 Module
  2259. *
  2260. @@ -21,6 +21,7 @@
  2261. #include <linux/proc_fs.h>
  2262. #include <linux/skbuff.h>
  2263. #include <linux/tqueue.h>
  2264. +#include <linux/isdn_compat.h>
  2265. #include <linux/capi.h>
  2266. #include <linux/kernelcapi.h>
  2267. #include <linux/locks.h>
  2268. @@ -33,7 +34,7 @@
  2269. #include <linux/b1lli.h>
  2270. #endif
  2271. -static char *revision = "$Revision: 1.1.4.1 $";
  2272. +static char *revision = "$Revision: 1.28 $";
  2273. /* ------------------------------------------------------------- */
  2274. @@ -64,7 +65,6 @@ struct capi_ncci {
  2275. __u32 ncci;
  2276. __u32 winsize;
  2277. int nmsg;
  2278. - spinlock_t lock;
  2279. struct msgidqueue *msgidqueue;
  2280. struct msgidqueue *msgidlast;
  2281. struct msgidqueue *msgidfree;
  2282. @@ -104,14 +104,14 @@ static char capi_manufakturer[64] = "AVM
  2283. #define APPL(a) (&applications[(a)-1])
  2284. #define VALID_APPLID(a) ((a) && (a) <= CAPI_MAXAPPL && APPL(a)->applid == a)
  2285. #define APPL_IS_FREE(a) (APPL(a)->applid == 0)
  2286. -#define APPL_MARK_FREE(a) do{ APPL(a)->applid=0; MOD_DEC_USE_COUNT; }while(0)
  2287. -#define APPL_MARK_USED(a) do{ APPL(a)->applid=(a); MOD_INC_USE_COUNT; }while(0)
  2288. +#define APPL_MARK_FREE(a) do{ APPL(a)->applid=0; MOD_DEC_USE_COUNT; }while(0);
  2289. +#define APPL_MARK_USED(a) do{ APPL(a)->applid=(a); MOD_INC_USE_COUNT; }while(0);
  2290. #define NCCI2CTRL(ncci) (((ncci) >> 24) & 0x7f)
  2291. #define VALID_CARD(c) ((c) > 0 && (c) <= CAPI_MAXCONTR)
  2292. #define CARD(c) (&cards[(c)-1])
  2293. -#define CARDNR(cp) ((((cp)-cards)+1) & 0xff)
  2294. +#define CARDNR(cp) (((cp)-cards)+1)
  2295. static struct capi_appl applications[CAPI_MAXAPPL];
  2296. static struct capi_ctr cards[CAPI_MAXCONTR];
  2297. @@ -535,9 +535,13 @@ static int notify_push(unsigned int cmd,
  2298. * of devices. Devices can only removed in
  2299. * user process, not in bh.
  2300. */
  2301. +#ifdef COMPAT_HAS_SCHEDULE_TASK
  2302. MOD_INC_USE_COUNT;
  2303. if (schedule_task(&tq_state_notify) == 0)
  2304. MOD_DEC_USE_COUNT;
  2305. +#else
  2306. + queue_task(&tq_state_notify, &tq_scheduler);
  2307. +#endif
  2308. return 0;
  2309. }
  2310. @@ -546,13 +550,7 @@ static int notify_push(unsigned int cmd,
  2311. static void notify_up(__u32 contr)
  2312. {
  2313. struct capi_interface_user *p;
  2314. - __u16 appl;
  2315. - for (appl = 1; appl <= CAPI_MAXAPPL; appl++) {
  2316. - if (!VALID_APPLID(appl)) continue;
  2317. - if (APPL(appl)->releasing) continue;
  2318. - CARD(contr)->driver->register_appl(CARD(contr), appl, &APPL(appl)->rparam);
  2319. - }
  2320. printk(KERN_NOTICE "kcapi: notify up contr %d\n", contr);
  2321. spin_lock(&capi_users_lock);
  2322. for (p = capi_users; p; p = p->next) {
  2323. @@ -639,7 +637,9 @@ static void notify_handler(void *dummy)
  2324. kfree(np);
  2325. MOD_DEC_USE_COUNT;
  2326. }
  2327. +#ifdef COMPAT_HAS_SCHEDULE_TASK
  2328. MOD_DEC_USE_COUNT;
  2329. +#endif
  2330. }
  2331. /* -------- NCCI Handling ------------------------------------- */
  2332. @@ -647,7 +647,6 @@ static void notify_handler(void *dummy)
  2333. static inline void mq_init(struct capi_ncci * np)
  2334. {
  2335. int i;
  2336. - np->lock = SPIN_LOCK_UNLOCKED;
  2337. np->msgidqueue = 0;
  2338. np->msgidlast = 0;
  2339. np->nmsg = 0;
  2340. @@ -662,11 +661,8 @@ static inline void mq_init(struct capi_n
  2341. static inline int mq_enqueue(struct capi_ncci * np, __u16 msgid)
  2342. {
  2343. struct msgidqueue *mq;
  2344. - spin_lock_bh(&np->lock);
  2345. - if ((mq = np->msgidfree) == 0) {
  2346. - spin_unlock_bh(&np->lock);
  2347. + if ((mq = np->msgidfree) == 0)
  2348. return 0;
  2349. - }
  2350. np->msgidfree = mq->next;
  2351. mq->msgid = msgid;
  2352. mq->next = 0;
  2353. @@ -676,14 +672,12 @@ static inline int mq_enqueue(struct capi
  2354. if (!np->msgidqueue)
  2355. np->msgidqueue = mq;
  2356. np->nmsg++;
  2357. - spin_unlock_bh(&np->lock);
  2358. return 1;
  2359. }
  2360. static inline int mq_dequeue(struct capi_ncci * np, __u16 msgid)
  2361. {
  2362. struct msgidqueue **pp;
  2363. - spin_lock_bh(&np->lock);
  2364. for (pp = &np->msgidqueue; *pp; pp = &(*pp)->next) {
  2365. if ((*pp)->msgid == msgid) {
  2366. struct msgidqueue *mq = *pp;
  2367. @@ -693,11 +687,9 @@ static inline int mq_dequeue(struct capi
  2368. mq->next = np->msgidfree;
  2369. np->msgidfree = mq;
  2370. np->nmsg--;
  2371. - spin_unlock_bh(&np->lock);
  2372. return 1;
  2373. }
  2374. }
  2375. - spin_unlock_bh(&np->lock);
  2376. return 0;
  2377. }
  2378. @@ -720,16 +712,12 @@ static void controllercb_appl_released(s
  2379. nextpp = &(*pp)->next;
  2380. }
  2381. }
  2382. - if (APPL(appl)->releasing) { /* only release if the application was marked for release */
  2383. - printk(KERN_DEBUG "kcapi: appl %d releasing(%d)\n", appl, APPL(appl)->releasing);
  2384. - APPL(appl)->releasing--;
  2385. - if (APPL(appl)->releasing <= 0) {
  2386. - APPL(appl)->signal = 0;
  2387. - APPL_MARK_FREE(appl);
  2388. - printk(KERN_INFO "kcapi: appl %d down\n", appl);
  2389. - }
  2390. - } else
  2391. - printk(KERN_WARNING "kcapi: appl %d card%d released without request\n", appl, card->cnr);
  2392. + APPL(appl)->releasing--;
  2393. + if (APPL(appl)->releasing <= 0) {
  2394. + APPL(appl)->signal = 0;
  2395. + APPL_MARK_FREE(appl);
  2396. + printk(KERN_INFO "kcapi: appl %d down\n", appl);
  2397. + }
  2398. }
  2399. /*
  2400. * ncci management
  2401. @@ -882,7 +870,16 @@ error:
  2402. static void controllercb_ready(struct capi_ctr * card)
  2403. {
  2404. + __u16 appl;
  2405. +
  2406. card->cardstate = CARD_RUNNING;
  2407. +
  2408. + for (appl = 1; appl <= CAPI_MAXAPPL; appl++) {
  2409. + if (!VALID_APPLID(appl)) continue;
  2410. + if (APPL(appl)->releasing) continue;
  2411. + card->driver->register_appl(card, appl, &APPL(appl)->rparam);
  2412. + }
  2413. +
  2414. printk(KERN_NOTICE "kcapi: card %d \"%s\" ready.\n",
  2415. CARDNR(card), card->name);
  2416. Index: linux-2.4.35.4/drivers/isdn/avmb1/t1isa.c
  2417. ===================================================================
  2418. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/t1isa.c
  2419. +++ linux-2.4.35.4/drivers/isdn/avmb1/t1isa.c
  2420. @@ -1,4 +1,4 @@
  2421. -/* $Id: t1isa.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  2422. +/* $Id: t1isa.c,v 1.22 2001/09/24 13:22:44 kai Exp $
  2423. *
  2424. * Module for AVM T1 HEMA-card.
  2425. *
  2426. @@ -19,13 +19,14 @@
  2427. #include <linux/capi.h>
  2428. #include <linux/kernelcapi.h>
  2429. #include <linux/init.h>
  2430. +#include <linux/isdn_compat.h>
  2431. #include <asm/io.h>
  2432. #include "capicmd.h"
  2433. #include "capiutil.h"
  2434. #include "capilli.h"
  2435. #include "avmcard.h"
  2436. -static char *revision = "$Revision: 1.1.4.1 $";
  2437. +static char *revision = "$Revision: 1.22 $";
  2438. /* ------------------------------------------------------------- */
  2439. Index: linux-2.4.35.4/drivers/isdn/avmb1/t1pci.c
  2440. ===================================================================
  2441. --- linux-2.4.35.4.orig/drivers/isdn/avmb1/t1pci.c
  2442. +++ linux-2.4.35.4/drivers/isdn/avmb1/t1pci.c
  2443. @@ -1,4 +1,4 @@
  2444. -/* $Id: t1pci.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  2445. +/* $Id: t1pci.c,v 1.25 2001/09/24 13:22:44 kai Exp $
  2446. *
  2447. * Module for AVM T1 PCI-card.
  2448. *
  2449. @@ -18,6 +18,7 @@
  2450. #include <linux/interrupt.h>
  2451. #include <linux/ioport.h>
  2452. #include <linux/pci.h>
  2453. +#include <linux/isdn_compat.h>
  2454. #include <linux/capi.h>
  2455. #include <linux/init.h>
  2456. #include <asm/io.h>
  2457. @@ -26,19 +27,21 @@
  2458. #include "capilli.h"
  2459. #include "avmcard.h"
  2460. -static char *revision = "$Revision: 1.1.4.1 $";
  2461. +static char *revision = "$Revision: 1.25 $";
  2462. #undef CONFIG_T1PCI_DEBUG
  2463. #undef CONFIG_T1PCI_POLLDEBUG
  2464. /* ------------------------------------------------------------- */
  2465. +#ifndef COMPAT_HAS_2_2_PCI
  2466. static struct pci_device_id t1pci_pci_tbl[] __initdata = {
  2467. { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_T1, PCI_ANY_ID, PCI_ANY_ID },
  2468. { } /* Terminating entry */
  2469. };
  2470. MODULE_DEVICE_TABLE(pci, t1pci_pci_tbl);
  2471. +#endif
  2472. MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM T1 PCI card");
  2473. MODULE_AUTHOR("Carsten Paeth");
  2474. MODULE_LICENSE("GPL");
  2475. @@ -264,9 +267,9 @@ static int __init t1pci_init(void)
  2476. }
  2477. pci_set_master(dev);
  2478. - param.port = pci_resource_start(dev, 1);
  2479. + param.port = pci_resource_start_io(dev, 1);
  2480. param.irq = dev->irq;
  2481. - param.membase = pci_resource_start(dev, 0);
  2482. + param.membase = pci_resource_start_mem(dev, 0);
  2483. printk(KERN_INFO
  2484. "%s: PCI BIOS reports AVM-T1-PCI at i/o %#x, irq %d, mem %#x\n",
  2485. Index: linux-2.4.35.4/drivers/isdn/divert/divert_procfs.c
  2486. ===================================================================
  2487. --- linux-2.4.35.4.orig/drivers/isdn/divert/divert_procfs.c
  2488. +++ linux-2.4.35.4/drivers/isdn/divert/divert_procfs.c
  2489. @@ -1,4 +1,4 @@
  2490. -/* $Id: divert_procfs.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  2491. +/* $Id$
  2492. *
  2493. * Filesystem handling for the diversion supplementary services.
  2494. *
  2495. @@ -14,13 +14,16 @@
  2496. #include <linux/module.h>
  2497. #include <linux/version.h>
  2498. #include <linux/poll.h>
  2499. +#ifndef COMPAT_USE_MODCOUNT_LOCK
  2500. #include <linux/smp_lock.h>
  2501. +#endif
  2502. #ifdef CONFIG_PROC_FS
  2503. #include <linux/proc_fs.h>
  2504. #else
  2505. #include <linux/fs.h>
  2506. #endif
  2507. #include <linux/isdnif.h>
  2508. +#include <linux/isdn_compat.h>
  2509. #include "isdn_divert.h"
  2510. /*********************************/
  2511. @@ -80,7 +83,6 @@ static ssize_t
  2512. isdn_divert_read(struct file *file, char *buf, size_t count, loff_t * off)
  2513. {
  2514. struct divert_info *inf;
  2515. - loff_t pos = *off;
  2516. int len;
  2517. if (!*((struct divert_info **) file->private_data)) {
  2518. @@ -92,11 +94,11 @@ isdn_divert_read(struct file *file, char
  2519. return (0);
  2520. inf->usage_cnt--; /* new usage count */
  2521. - file->private_data = &inf->next; /* next structure */
  2522. + (struct divert_info **) file->private_data = &inf->next; /* next structure */
  2523. if ((len = strlen(inf->info_start)) <= count) {
  2524. if (copy_to_user(buf, inf->info_start, len))
  2525. return -EFAULT;
  2526. - *off = pos + len;
  2527. + file->f_pos += len;
  2528. return (len);
  2529. }
  2530. return (0);
  2531. @@ -136,17 +138,23 @@ isdn_divert_open(struct inode *ino, stru
  2532. {
  2533. unsigned long flags;
  2534. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  2535. + MOD_INC_USE_COUNT;
  2536. +#else
  2537. lock_kernel();
  2538. +#endif
  2539. save_flags(flags);
  2540. cli();
  2541. if_used++;
  2542. if (divert_info_head)
  2543. - filep->private_data = &(divert_info_tail->next);
  2544. + (struct divert_info **) filep->private_data = &(divert_info_tail->next);
  2545. else
  2546. - filep->private_data = &divert_info_head;
  2547. + (struct divert_info **) filep->private_data = &divert_info_head;
  2548. restore_flags(flags);
  2549. /* start_divert(); */
  2550. +#ifndef COMPAT_USE_MODCOUNT_LOCK
  2551. unlock_kernel();
  2552. +#endif
  2553. return (0);
  2554. } /* isdn_divert_open */
  2555. @@ -159,7 +167,9 @@ isdn_divert_close(struct inode *ino, str
  2556. struct divert_info *inf;
  2557. unsigned long flags;
  2558. +#ifndef COMPAT_USE_MODCOUNT_LOCK
  2559. lock_kernel();
  2560. +#endif
  2561. save_flags(flags);
  2562. cli();
  2563. if_used--;
  2564. @@ -175,7 +185,11 @@ isdn_divert_close(struct inode *ino, str
  2565. divert_info_head = divert_info_head->next;
  2566. kfree(inf);
  2567. }
  2568. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  2569. + MOD_DEC_USE_COUNT;
  2570. +#else
  2571. unlock_kernel();
  2572. +#endif
  2573. return (0);
  2574. } /* isdn_divert_close */
  2575. @@ -276,6 +290,9 @@ static struct file_operations isdn_fops
  2576. open: isdn_divert_open,
  2577. release: isdn_divert_close,
  2578. };
  2579. +#ifdef COMPAT_NO_SOFTNET
  2580. +struct inode_operations divert_file_inode_operations;
  2581. +#endif
  2582. /****************************/
  2583. /* isdn subdir in /proc/net */
  2584. @@ -302,8 +319,16 @@ divert_dev_init(void)
  2585. remove_proc_entry("isdn", proc_net);
  2586. return (-1);
  2587. }
  2588. +#ifdef COMPAT_NO_SOFTNET
  2589. + memset(&divert_file_inode_operations, 0, sizeof(struct inode_operations));
  2590. + divert_file_inode_operations.default_file_ops = &isdn_fops;
  2591. + isdn_divert_entry->ops = &divert_file_inode_operations;
  2592. +#else
  2593. isdn_divert_entry->proc_fops = &isdn_fops;
  2594. +#ifdef COMPAT_HAS_FILEOP_OWNER
  2595. isdn_divert_entry->owner = THIS_MODULE;
  2596. +#endif
  2597. +#endif /* COMPAT_NO_SOFTNET */
  2598. #endif /* CONFIG_PROC_FS */
  2599. return (0);
  2600. Index: linux-2.4.35.4/drivers/isdn/divert/isdn_divert.c
  2601. ===================================================================
  2602. --- linux-2.4.35.4.orig/drivers/isdn/divert/isdn_divert.c
  2603. +++ linux-2.4.35.4/drivers/isdn/divert/isdn_divert.c
  2604. @@ -1,4 +1,4 @@
  2605. -/* $Id: isdn_divert.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  2606. +/* $Id$
  2607. *
  2608. * DSS1 main diversion supplementary handling for i4l.
  2609. *
  2610. @@ -84,6 +84,9 @@ static void deflect_timer_expire(ulong a
  2611. restore_flags(flags);
  2612. break;
  2613. + case NETWORK_DIAL:
  2614. + divert_if.dial_net_name(cs->deflect_dest);
  2615. +
  2616. case DEFLECT_AUTODEL:
  2617. default:
  2618. save_flags(flags);
  2619. @@ -452,6 +455,7 @@ int isdn_divert_icall(isdn_ctrl *ic)
  2620. case DEFLECT_PROCEED:
  2621. case DEFLECT_REPORT:
  2622. case DEFLECT_REJECT:
  2623. + case NETWORK_DIAL:
  2624. if (dv->rule.action == DEFLECT_PROCEED)
  2625. if ((!if_used) || ((!extern_wait_max) && (!dv->rule.waittime)))
  2626. return(0); /* no external deflection needed */
  2627. @@ -495,6 +499,11 @@ int isdn_divert_icall(isdn_ctrl *ic)
  2628. else
  2629. { cs->deflect_dest[0] = '\0';
  2630. retval = 4; /* only proceed */
  2631. + if (cs->akt_state == NETWORK_DIAL) {
  2632. + strcpy(cs->deflect_dest,dv->rule.to_nr);
  2633. + cs->timer.expires = jiffies + 10;
  2634. + retval = 0;
  2635. + }
  2636. }
  2637. sprintf(cs->info,"%d 0x%lx %s %s %s %s 0x%x 0x%x %d %d %s\n",
  2638. cs->akt_state,
  2639. @@ -739,6 +748,18 @@ int prot_stat_callback(isdn_ctrl *ic)
  2640. }
  2641. +#if 0
  2642. + sprintf(st, "0x%lx 0x%lx",ic->arg, ic->parm.dss1_io.ll_id);
  2643. + p = st + strlen(st);
  2644. + p1 = ic->parm.dss1_io.data;
  2645. + i = ic->parm.dss1_io.datalen;
  2646. + while ((i > 0) && (p - st < 530))
  2647. + { p += sprintf(p," %02x",(*p1++) & 0xFF);
  2648. + i--;
  2649. + }
  2650. + sprintf(p, "\n");
  2651. + put_info_buffer(st);
  2652. +#endif
  2653. break;
  2654. default:
  2655. Index: linux-2.4.35.4/drivers/isdn/divert/isdn_divert.h
  2656. ===================================================================
  2657. --- linux-2.4.35.4.orig/drivers/isdn/divert/isdn_divert.h
  2658. +++ linux-2.4.35.4/drivers/isdn/divert/isdn_divert.h
  2659. @@ -1,4 +1,4 @@
  2660. -/* $Id: isdn_divert.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  2661. +/* $Id$
  2662. *
  2663. * Header for the diversion supplementary ioctl interface.
  2664. *
  2665. @@ -36,9 +36,10 @@
  2666. #define DEFLECT_PROCEED 2 /* deflect when externally triggered */
  2667. #define DEFLECT_ALERT 3 /* alert and deflect after delay */
  2668. #define DEFLECT_REJECT 4 /* reject immediately */
  2669. -#define DIVERT_ACTIVATE 5 /* diversion activate */
  2670. -#define DIVERT_DEACTIVATE 6 /* diversion deactivate */
  2671. -#define DIVERT_REPORT 7 /* interrogation result */
  2672. +#define NETWORK_DIAL 5 /* dial a network interface */
  2673. +#define DIVERT_ACTIVATE 16 /* diversion activate */
  2674. +#define DIVERT_DEACTIVATE 17 /* diversion deactivate */
  2675. +#define DIVERT_REPORT 18 /* interrogation result */
  2676. #define DEFLECT_AUTODEL 255 /* only for internal use */
  2677. #define DEFLECT_ALL_IDS 0xFFFFFFFF /* all drivers selected */
  2678. @@ -60,6 +61,7 @@ typedef struct
  2679. 2 = report call, send proceed, wait max waittime secs
  2680. 3 = report call, alert and deflect after waittime
  2681. 4 = report call, reject immediately
  2682. + 5 = dial net interface specified in to_nr
  2683. actions 1-2 only take place if interface is opened
  2684. */
  2685. u_char waittime; /* maximum wait time for proceeding */
  2686. Index: linux-2.4.35.4/drivers/isdn/eicon/Divas_mod.c
  2687. ===================================================================
  2688. --- linux-2.4.35.4.orig/drivers/isdn/eicon/Divas_mod.c
  2689. +++ linux-2.4.35.4/drivers/isdn/eicon/Divas_mod.c
  2690. @@ -20,6 +20,7 @@
  2691. #include "adapter.h"
  2692. #include "uxio.h"
  2693. +#include <linux/isdn_compat.h>
  2694. MODULE_DESCRIPTION("ISDN4Linux: Driver for Eicon Diva Server cards");
  2695. MODULE_AUTHOR("Armin Schindler");
  2696. Index: linux-2.4.35.4/drivers/isdn/eicon/common.c
  2697. ===================================================================
  2698. --- linux-2.4.35.4.orig/drivers/isdn/eicon/common.c
  2699. +++ linux-2.4.35.4/drivers/isdn/eicon/common.c
  2700. @@ -808,9 +808,7 @@ void DivasDoDpc(void *pData)
  2701. while(i--)
  2702. {
  2703. - if (card->state == DIA_RUNNING)
  2704. - DivaDoCardDpc(card);
  2705. - card++;
  2706. + DivaDoCardDpc(card++);
  2707. }
  2708. }
  2709. Index: linux-2.4.35.4/drivers/isdn/eicon/eicon.h
  2710. ===================================================================
  2711. --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon.h
  2712. +++ linux-2.4.35.4/drivers/isdn/eicon/eicon.h
  2713. @@ -1,4 +1,4 @@
  2714. -/* $Id: eicon.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  2715. +/* $Id: eicon.h,v 1.26 2001/09/24 13:22:47 kai Exp $
  2716. *
  2717. * ISDN low-level module for Eicon active ISDN-Cards.
  2718. *
  2719. @@ -347,19 +347,19 @@ typedef struct eicon_card {
  2720. extern char *eicon_ctype_name[];
  2721. -static inline void eicon_schedule_tx(eicon_card *card)
  2722. +extern __inline__ void eicon_schedule_tx(eicon_card *card)
  2723. {
  2724. queue_task(&card->snd_tq, &tq_immediate);
  2725. mark_bh(IMMEDIATE_BH);
  2726. }
  2727. -static inline void eicon_schedule_rx(eicon_card *card)
  2728. +extern __inline__ void eicon_schedule_rx(eicon_card *card)
  2729. {
  2730. queue_task(&card->rcv_tq, &tq_immediate);
  2731. mark_bh(IMMEDIATE_BH);
  2732. }
  2733. -static inline void eicon_schedule_ack(eicon_card *card)
  2734. +extern __inline__ void eicon_schedule_ack(eicon_card *card)
  2735. {
  2736. queue_task(&card->ack_tq, &tq_immediate);
  2737. mark_bh(IMMEDIATE_BH);
  2738. Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_dsp.h
  2739. ===================================================================
  2740. --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_dsp.h
  2741. +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_dsp.h
  2742. @@ -1,4 +1,4 @@
  2743. -/* $Id: eicon_dsp.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  2744. +/* $Id: eicon_dsp.h,v 1.8 2001/09/24 13:22:47 kai Exp $
  2745. *
  2746. * ISDN lowlevel-module for Eicon active cards.
  2747. * DSP definitions
  2748. Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_idi.c
  2749. ===================================================================
  2750. --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_idi.c
  2751. +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_idi.c
  2752. @@ -1,4 +1,4 @@
  2753. -/* $Id: eicon_idi.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  2754. +/* $Id: eicon_idi.c,v 1.45 2001/11/07 22:35:48 kai Exp $
  2755. *
  2756. * ISDN lowlevel-module for Eicon active cards.
  2757. * IDI interface
  2758. @@ -25,7 +25,7 @@
  2759. #undef EICON_FULL_SERVICE_OKTETT
  2760. -char *eicon_idi_revision = "$Revision: 1.1.4.1 $";
  2761. +char *eicon_idi_revision = "$Revision: 1.45 $";
  2762. eicon_manifbuf *manbuf;
  2763. @@ -1583,6 +1583,37 @@ idi_faxdata_rcv(eicon_card *ccard, eicon
  2764. return;
  2765. }
  2766. +#if 0
  2767. + eicon_sff_dochead *doc = (eicon_sff_dochead *)skb->data;
  2768. + eicon_sff_pagehead *page = (eicon_sff_pagehead *)skb->data + sizeof(eicon_sff_dochead);
  2769. +
  2770. + printk(KERN_DEBUG"SFF: doc %d / page %d (skb : %d)\n",
  2771. + sizeof(eicon_sff_dochead),
  2772. + sizeof(eicon_sff_pagehead), skb->len);
  2773. +
  2774. + if (skb->len >= sizeof(eicon_sff_dochead)) {
  2775. + printk(KERN_DEBUG"SFF: id = 0x%x\n", doc->id);
  2776. + printk(KERN_DEBUG"SFF: version = 0x%x\n", doc->version);
  2777. + printk(KERN_DEBUG"SFF: reserved1 = 0x%x\n", doc->reserved1);
  2778. + printk(KERN_DEBUG"SFF: userinfo = 0x%x\n", doc->userinfo);
  2779. + printk(KERN_DEBUG"SFF: pagecount = 0x%x\n", doc->pagecount);
  2780. + printk(KERN_DEBUG"SFF: off1pagehead = 0x%x\n", doc->off1pagehead);
  2781. + printk(KERN_DEBUG"SFF: offnpagehead = 0x%x\n", doc->offnpagehead);
  2782. + printk(KERN_DEBUG"SFF: offdocend = 0x%x\n", doc->offdocend);
  2783. + }
  2784. + if (skb->len >= (sizeof(eicon_sff_dochead) + sizeof(eicon_sff_pagehead))) {
  2785. + printk(KERN_DEBUG"SFFp: id = 0x%x\n", page->pageheadid);
  2786. + printk(KERN_DEBUG"SFFp: len = 0x%x\n", page->pageheadlen);
  2787. + printk(KERN_DEBUG"SFFp: resvert = 0x%x\n", page->resvert);
  2788. + printk(KERN_DEBUG"SFFp: reshoriz = 0x%x\n", page->reshoriz);
  2789. + printk(KERN_DEBUG"SFFp: coding = 0x%x\n", page->coding);
  2790. + printk(KERN_DEBUG"SFFp: reserved2 = 0x%x\n", page->reserved2);
  2791. + printk(KERN_DEBUG"SFFp: linelength = 0x%x\n", page->linelength);
  2792. + printk(KERN_DEBUG"SFFp: pagelength = 0x%x\n", page->pagelength);
  2793. + printk(KERN_DEBUG"SFFp: offprevpage = 0x%x\n", page->offprevpage);
  2794. + printk(KERN_DEBUG"SFFp: offnextpage = 0x%x\n", page->offnextpage);
  2795. + }
  2796. +#endif
  2797. if (chan->fax->direction == ISDN_TTY_FAX_CONN_IN) {
  2798. @@ -2054,8 +2085,7 @@ idi_faxdata_send(eicon_card *ccard, eico
  2799. OutBuf.Len++;
  2800. } else {
  2801. *OutBuf.Next++ = 0;
  2802. - *(__u16 *) OutBuf.Next = (__u16) LineBuf.Len;
  2803. - OutBuf.Next += sizeof(__u16);
  2804. + *((__u16 *) OutBuf.Next)++ = (__u16) LineBuf.Len;
  2805. OutBuf.Len += 3;
  2806. }
  2807. memcpy(OutBuf.Next, LineBuf.Data, LineBuf.Len);
  2808. @@ -2385,6 +2415,12 @@ idi_handle_ind(eicon_card *ccard, struct
  2809. } else {
  2810. if (chan->e.B2Id)
  2811. idi_do_req(ccard, chan, REMOVE, 1);
  2812. +#if 0
  2813. + if (chan->e.D3Id) {
  2814. + idi_do_req(ccard, chan, REMOVE, 0);
  2815. + idi_do_req(ccard, chan, ASSIGN, 0);
  2816. + }
  2817. +#endif
  2818. chan->statectrl &= ~WAITING_FOR_HANGUP;
  2819. chan->statectrl &= ~IN_HOLD;
  2820. if (chan->statectrl & HAVE_CONN_REQ) {
  2821. Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_idi.h
  2822. ===================================================================
  2823. --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_idi.h
  2824. +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_idi.h
  2825. @@ -1,4 +1,4 @@
  2826. -/* $Id: eicon_idi.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  2827. +/* $Id: eicon_idi.h,v 1.12 2001/09/24 13:22:47 kai Exp $
  2828. *
  2829. * ISDN lowlevel-module for the Eicon active cards.
  2830. * IDI-Interface
  2831. Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_io.c
  2832. ===================================================================
  2833. --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_io.c
  2834. +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_io.c
  2835. @@ -1,4 +1,4 @@
  2836. -/* $Id: eicon_io.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  2837. +/* $Id: eicon_io.c,v 1.15 2001/09/24 13:22:47 kai Exp $
  2838. *
  2839. * ISDN low-level module for Eicon active ISDN-Cards.
  2840. * Code for communicating with hardware.
  2841. Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_isa.c
  2842. ===================================================================
  2843. --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_isa.c
  2844. +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_isa.c
  2845. @@ -1,4 +1,4 @@
  2846. -/* $Id: eicon_isa.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  2847. +/* $Id: eicon_isa.c,v 1.18 2001/11/07 22:35:48 kai Exp $
  2848. *
  2849. * ISDN low-level module for Eicon active ISDN-Cards.
  2850. * Hardware-specific code for old ISA cards.
  2851. @@ -20,7 +20,7 @@
  2852. #define release_shmem release_region
  2853. #define request_shmem request_region
  2854. -char *eicon_isa_revision = "$Revision: 1.1.4.1 $";
  2855. +char *eicon_isa_revision = "$Revision: 1.18 $";
  2856. #undef EICON_MCA_DEBUG
  2857. @@ -38,8 +38,12 @@ static int eicon_isa_valid_irq[] = {
  2858. static void
  2859. eicon_isa_release_shmem(eicon_isa_card *card) {
  2860. if (card->mvalid) {
  2861. +#ifdef COMPAT_HAS_ISA_IOREMAP
  2862. iounmap(card->shmem);
  2863. release_mem_region(card->physmem, card->ramsize);
  2864. +#else
  2865. + release_shmem((unsigned long)card->shmem, card->ramsize);
  2866. +#endif
  2867. }
  2868. card->mvalid = 0;
  2869. }
  2870. @@ -94,12 +98,20 @@ eicon_isa_find_card(int Mem, int Irq, ch
  2871. Mem, Id);
  2872. return -1;
  2873. }
  2874. +#ifdef COMPAT_HAS_ISA_IOREMAP
  2875. if (check_mem_region(Mem, RAMSIZE)) {
  2876. +#else
  2877. + if (check_shmem(Mem, RAMSIZE)) {
  2878. +#endif
  2879. printk(KERN_WARNING "eicon_isa_boot: memory at 0x%x already in use.\n", Mem);
  2880. return -1;
  2881. }
  2882. +#ifdef COMPAT_HAS_ISA_IOREMAP
  2883. amem = (unsigned long) ioremap(Mem, RAMSIZE);
  2884. +#else
  2885. + amem = (unsigned long) Mem;
  2886. +#endif
  2887. writew(0x55aa, amem + 0x402);
  2888. if (readw(amem + 0x402) != 0x55aa) primary = 0;
  2889. writew(0, amem + 0x402);
  2890. @@ -109,12 +121,16 @@ eicon_isa_find_card(int Mem, int Irq, ch
  2891. if (primary) {
  2892. printk(KERN_INFO "Eicon: assuming pri card at 0x%x\n", Mem);
  2893. writeb(0, amem + 0x3ffe);
  2894. +#ifdef COMPAT_HAS_ISA_IOREMAP
  2895. iounmap((unsigned char *)amem);
  2896. +#endif
  2897. return EICON_CTYPE_ISAPRI;
  2898. } else {
  2899. printk(KERN_INFO "Eicon: assuming bri card at 0x%x\n", Mem);
  2900. writeb(0, amem + 0x400);
  2901. +#ifdef COMPAT_HAS_ISA_IOREMAP
  2902. iounmap((unsigned char *)amem);
  2903. +#endif
  2904. return EICON_CTYPE_ISABRI;
  2905. }
  2906. return -1;
  2907. @@ -151,6 +167,7 @@ eicon_isa_bootload(eicon_isa_card *card,
  2908. else
  2909. card->ramsize = RAMSIZE;
  2910. +#ifdef COMPAT_HAS_ISA_IOREMAP
  2911. if (check_mem_region(card->physmem, card->ramsize)) {
  2912. printk(KERN_WARNING "eicon_isa_boot: memory at 0x%lx already in use.\n",
  2913. card->physmem);
  2914. @@ -159,6 +176,16 @@ eicon_isa_bootload(eicon_isa_card *card,
  2915. }
  2916. request_mem_region(card->physmem, card->ramsize, "Eicon ISA ISDN");
  2917. card->shmem = (eicon_isa_shmem *) ioremap(card->physmem, card->ramsize);
  2918. +#else
  2919. + /* Register shmem */
  2920. + if (check_shmem((unsigned long)card->shmem, card->ramsize)) {
  2921. + printk(KERN_WARNING "eicon_isa_boot: memory at 0x%lx already in use.\n",
  2922. + (unsigned long)card->shmem);
  2923. + kfree(code);
  2924. + return -EBUSY;
  2925. + }
  2926. + request_shmem((unsigned long)card->shmem, card->ramsize, "Eicon ISA ISDN");
  2927. +#endif
  2928. #ifdef EICON_MCA_DEBUG
  2929. printk(KERN_INFO "eicon_isa_boot: card->ramsize = %d.\n", card->ramsize);
  2930. #endif
  2931. Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_isa.h
  2932. ===================================================================
  2933. --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_isa.h
  2934. +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_isa.h
  2935. @@ -1,4 +1,4 @@
  2936. -/* $Id: eicon_isa.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  2937. +/* $Id: eicon_isa.h,v 1.11 2001/09/24 13:22:47 kai Exp $
  2938. *
  2939. * ISDN low-level module for Eicon active ISDN-Cards.
  2940. *
  2941. Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_mod.c
  2942. ===================================================================
  2943. --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_mod.c
  2944. +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_mod.c
  2945. @@ -1,4 +1,4 @@
  2946. -/* $Id: eicon_mod.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  2947. +/* $Id: eicon_mod.c,v 1.44 2001/11/20 09:48:25 armin Exp $
  2948. *
  2949. * ISDN lowlevel-module for Eicon active cards.
  2950. *
  2951. @@ -44,7 +44,7 @@
  2952. static eicon_card *cards = (eicon_card *) NULL; /* glob. var , contains
  2953. start of card-list */
  2954. -static char *eicon_revision = "$Revision: 1.1.4.1 $";
  2955. +static char *eicon_revision = "$Revision: 1.44 $";
  2956. extern char *eicon_pci_revision;
  2957. extern char *eicon_isa_revision;
  2958. @@ -639,6 +639,18 @@ if_command(isdn_ctrl * c)
  2959. static int
  2960. if_writecmd(const u_char * buf, int len, int user, int id, int channel)
  2961. {
  2962. +#if 0
  2963. + /* Not yet used */
  2964. + eicon_card *card = eicon_findcard(id);
  2965. +
  2966. + if (card) {
  2967. + if (!card->flags & EICON_FLAGS_RUNNING)
  2968. + return (len);
  2969. + return (len);
  2970. + }
  2971. + printk(KERN_ERR
  2972. + "eicon: if_writecmd called with invalid driverId!\n");
  2973. +#endif
  2974. return (len);
  2975. }
  2976. @@ -665,11 +677,8 @@ if_readstatus(u_char * buf, int len, int
  2977. else
  2978. cnt = skb->len;
  2979. - if (user) {
  2980. - spin_unlock_irqrestore(&eicon_lock, flags);
  2981. + if (user)
  2982. copy_to_user(p, skb->data, cnt);
  2983. - spin_lock_irqsave(&eicon_lock, flags);
  2984. - }
  2985. else
  2986. memcpy(p, skb->data, cnt);
  2987. @@ -1459,6 +1468,7 @@ eicon_exit(void)
  2988. #ifndef MODULE
  2989. +#ifdef COMPAT_HAS_NEW_SETUP
  2990. static int __init
  2991. eicon_setup(char *line)
  2992. {
  2993. @@ -1467,6 +1477,12 @@ eicon_setup(char *line)
  2994. char *str;
  2995. str = get_options(line, 4, ints);
  2996. +#else
  2997. +void
  2998. +eicon_setup(char *str, int *ints)
  2999. +{
  3000. + int i, argc;
  3001. +#endif
  3002. argc = ints[0];
  3003. i = 1;
  3004. @@ -1494,9 +1510,13 @@ eicon_setup(char *line)
  3005. #else
  3006. printk(KERN_INFO "Eicon ISDN active driver setup\n");
  3007. #endif
  3008. +#ifdef COMPAT_HAS_NEW_SETUP
  3009. return(1);
  3010. }
  3011. __setup("eicon=", eicon_setup);
  3012. +#else
  3013. +}
  3014. +#endif
  3015. #endif /* MODULE */
  3016. Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_pci.c
  3017. ===================================================================
  3018. --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_pci.c
  3019. +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_pci.c
  3020. @@ -1,4 +1,4 @@
  3021. -/* $Id: eicon_pci.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  3022. +/* $Id: eicon_pci.c,v 1.18 2001/09/24 13:22:47 kai Exp $
  3023. *
  3024. * ISDN low-level module for Eicon active ISDN-Cards.
  3025. * Hardware-specific code for PCI cards.
  3026. @@ -24,7 +24,7 @@
  3027. #include "adapter.h"
  3028. #include "uxio.h"
  3029. -char *eicon_pci_revision = "$Revision: 1.1.4.1 $";
  3030. +char *eicon_pci_revision = "$Revision: 1.18 $";
  3031. #if CONFIG_PCI /* intire stuff is only for PCI */
  3032. #ifdef CONFIG_ISDN_DRV_EICON_PCI
  3033. Index: linux-2.4.35.4/drivers/isdn/eicon/eicon_pci.h
  3034. ===================================================================
  3035. --- linux-2.4.35.4.orig/drivers/isdn/eicon/eicon_pci.h
  3036. +++ linux-2.4.35.4/drivers/isdn/eicon/eicon_pci.h
  3037. @@ -1,4 +1,4 @@
  3038. -/* $Id: eicon_pci.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  3039. +/* $Id: eicon_pci.h,v 1.7 2001/09/24 13:22:47 kai Exp $
  3040. *
  3041. * ISDN low-level module for Eicon active ISDN-Cards (PCI part).
  3042. *
  3043. Index: linux-2.4.35.4/drivers/isdn/eicon/fourbri.c
  3044. ===================================================================
  3045. --- linux-2.4.35.4.orig/drivers/isdn/eicon/fourbri.c
  3046. +++ linux-2.4.35.4/drivers/isdn/eicon/fourbri.c
  3047. @@ -337,8 +337,7 @@ static int diva_server_4bri_load(card_t
  3048. static int diva_server_4bri_start(card_t *card, byte *channels)
  3049. {
  3050. byte *ctl;
  3051. - byte *shared;
  3052. - int i;
  3053. + byte *shared, i;
  3054. int adapter_num;
  3055. DPRINTF(("divas: start Diva Server 4BRI"));
  3056. Index: linux-2.4.35.4/drivers/isdn/eicon/kprintf.c
  3057. ===================================================================
  3058. --- linux-2.4.35.4.orig/drivers/isdn/eicon/kprintf.c
  3059. +++ linux-2.4.35.4/drivers/isdn/eicon/kprintf.c
  3060. @@ -18,6 +18,468 @@
  3061. #include "divalog.h"
  3062. #include "uxio.h"
  3063. +/*
  3064. + * Implementation of printf and sprintf for kernel
  3065. + */
  3066. +
  3067. +#define MAX_BUFF (80) /* limit size of temporary buffers */
  3068. +
  3069. +#define WRITE_CHAR(BUFFER, SIZE, C) \
  3070. + if (--(SIZE) < 0) { (BUFFER)--; *(BUFFER) = '\0'; return; } *(BUFFER)++ = (C)
  3071. +
  3072. +
  3073. +/*
  3074. + * convert a number to decimal ASCII
  3075. + */
  3076. +
  3077. +static
  3078. +void do_decimal( char *temp,
  3079. + int temp_len,
  3080. + unsigned int value,
  3081. + char *s)
  3082. +
  3083. +{
  3084. + int i;
  3085. +
  3086. + temp[0] = '\0';
  3087. +
  3088. + for (i = 1; i < temp_len; i++)
  3089. + {
  3090. + temp[i] = (char) ((value % 10) + (int) '0');
  3091. + value /= 10;
  3092. + }
  3093. +
  3094. + for (i = (temp_len - 1); temp[i] == '0'; i--)
  3095. + {
  3096. + ;
  3097. + }
  3098. +
  3099. + if (i == 0)
  3100. + {
  3101. + i++;
  3102. + }
  3103. +
  3104. + while (i >= 0)
  3105. + {
  3106. + *s++ = temp[i--];
  3107. + }
  3108. +
  3109. + return;
  3110. +}
  3111. +
  3112. +/*
  3113. + * convert a number to octal ASCII
  3114. + */
  3115. +
  3116. +static
  3117. +void do_octal( char *temp,
  3118. + unsigned int value,
  3119. + char *s)
  3120. +
  3121. +{
  3122. + int i;
  3123. +
  3124. + temp[0] = '\0';
  3125. +
  3126. + for (i = 1; i <= 11; i++)
  3127. + {
  3128. + temp[i] = (char) ((value & 07) + (int) '0');
  3129. + value >>= 3;
  3130. + }
  3131. + temp[11] &= '3';
  3132. +
  3133. + for (i = 11; temp[i] == '0'; i--)
  3134. + {
  3135. + ;
  3136. + }
  3137. +
  3138. + if (i == 0)
  3139. + {
  3140. + i++;
  3141. + }
  3142. +
  3143. + while (i >= 0)
  3144. + {
  3145. + *s++ = temp[i--];
  3146. + }
  3147. +
  3148. + return;
  3149. +}
  3150. +
  3151. +/*
  3152. + * convert a number to hex ASCII
  3153. + */
  3154. +
  3155. +static
  3156. +void do_hex( char *temp,
  3157. + unsigned int value,
  3158. + char *s)
  3159. +
  3160. +{
  3161. + int i;
  3162. + static
  3163. + char *dec_to_hex = "0123456789abcdef";
  3164. +
  3165. + temp[0] = '\0';
  3166. +
  3167. + for (i = 1; i <= 8; i++)
  3168. + {
  3169. + temp[i] = dec_to_hex[value & 0x0f];
  3170. + value >>= 4;
  3171. + }
  3172. +
  3173. + for (i = 8; temp[i] == '0'; i--)
  3174. + {
  3175. + ;
  3176. + }
  3177. +
  3178. + if (i == 0)
  3179. + {
  3180. + i++;
  3181. + }
  3182. +
  3183. + while (i >= 0)
  3184. + {
  3185. + *s++ = temp[i--];
  3186. + }
  3187. +
  3188. + return;
  3189. +}
  3190. +
  3191. +/*
  3192. + * convert a buffer to ASCII HEX
  3193. + */
  3194. +
  3195. +static
  3196. +void do_buffer( char *buffer,
  3197. + int length,
  3198. + char *s)
  3199. +
  3200. +{
  3201. + static
  3202. + char hex_char [] = "0123456789abcdef";
  3203. + char *b = buffer;
  3204. + int hex_byte;
  3205. + int nybble;
  3206. +
  3207. + length = (length >= ((MAX_BUFF / 3) + 1)) ? (MAX_BUFF / 3) : length;
  3208. +
  3209. + while (length)
  3210. + {
  3211. + hex_byte = (int) *b++;
  3212. + nybble = (hex_byte >> 4) & 0xf;
  3213. + *s++ = hex_char[nybble];
  3214. + nybble = hex_byte & 0xf;
  3215. + *s++ = hex_char[nybble];
  3216. + *s++ = ' ';
  3217. + length--;
  3218. + }
  3219. + *s = '\0';
  3220. +
  3221. + return;
  3222. +}
  3223. +
  3224. +/*
  3225. + * Body of sprintf function: behaves just like standard sprintf, except we
  3226. + * have an extra argument (buffer size) which we use to ensure we don't
  3227. + * overflow
  3228. + */
  3229. +
  3230. +void Divas_vsprintf( char *buffer,
  3231. + int size,
  3232. + char *fmt,
  3233. + va_list argptr)
  3234. +
  3235. +{
  3236. + char c; /* single character buffer */
  3237. + int i; /* handy scratch counter */
  3238. + int f; /* format character (after %) */
  3239. + char *str; /* pointer into string */
  3240. + char temp[20]; /* temp buffer used in printing numbers */
  3241. + char string[MAX_BUFF]; /* output from number conversion */
  3242. + int length; /* length of string "str" */
  3243. + char fill; /* fill character ' ' or '0' */
  3244. + boolean_t leftjust; /* TRUE if left justified, else right justified */
  3245. + int fmax, fmin; /* field specifiers % MIN . MAX s */
  3246. + int leading; /* number of leading/trailing fill characters */
  3247. + char sign; /* set to '-' for negative decimals */
  3248. + int number; /* numeric argument */
  3249. +
  3250. + char *buff_ptr; /* pointer to user's buffer of hex data */
  3251. + int buff_len; /* length of hex data */
  3252. +
  3253. + /* make sure we have somthing to write into */
  3254. +
  3255. + if ((!buffer) || (size <= 0))
  3256. + {
  3257. + return;
  3258. + }
  3259. +
  3260. + while (TRUE)
  3261. + {
  3262. + /* echo characters until end or '%' encountered */
  3263. +
  3264. + while ((c = *fmt++) != '%')
  3265. + {
  3266. + if (!c)
  3267. + {
  3268. + *buffer = '\0';
  3269. + return;
  3270. + }
  3271. + WRITE_CHAR(buffer, size, c);
  3272. + }
  3273. +
  3274. + /* echo %% as % */
  3275. +
  3276. + if (*fmt == '%')
  3277. + {
  3278. + WRITE_CHAR(buffer, size, *fmt);
  3279. + continue;
  3280. + }
  3281. +
  3282. + /* %- turns on left-justify */
  3283. +
  3284. + if ((leftjust = (boolean_t) ((*fmt == '-') ? TRUE : FALSE)))
  3285. + {
  3286. + fmt++;
  3287. + }
  3288. +
  3289. + /* %0 turns on zero filling */
  3290. +
  3291. + if (*fmt == '0')
  3292. + {
  3293. + fill = '0';
  3294. + }
  3295. + else
  3296. + {
  3297. + fill = ' ';
  3298. + }
  3299. +
  3300. + /* minium field width specifier for %d, u, x, c, s */
  3301. +
  3302. + fmin = 0;
  3303. +
  3304. + if (*fmt == '*')
  3305. + {
  3306. + fmin = va_arg(argptr, int);
  3307. + fmt++;
  3308. + }
  3309. + else
  3310. + {
  3311. + while ('0' <= *fmt && *fmt <= '9')
  3312. + {
  3313. + fmin = (fmin * 10) + (*fmt++ - '0');
  3314. + }
  3315. + }
  3316. +
  3317. + /* maximum string width specifier for %s */
  3318. +
  3319. + fmax = 0;
  3320. +
  3321. + if (*fmt == '.')
  3322. + {
  3323. + if (*(++fmt) == '*')
  3324. + {
  3325. + fmax = va_arg(argptr, int);
  3326. + fmt++;
  3327. + }
  3328. + else
  3329. + {
  3330. + while ('0' <= *fmt && *fmt <= '9')
  3331. + {
  3332. + fmax = (fmax * 10) + (*fmt++ - '0');
  3333. + }
  3334. + }
  3335. + }
  3336. +
  3337. + /* skip over 'l' option (ints are assumed same size as longs) */
  3338. +
  3339. + if (*fmt == 'l')
  3340. + {
  3341. + fmt++;
  3342. + }
  3343. +
  3344. + /* get the format chacater */
  3345. +
  3346. + if (!(f = *fmt++))
  3347. + {
  3348. + WRITE_CHAR(buffer, size, '%');
  3349. + *buffer = '\0';
  3350. + return;
  3351. + }
  3352. +
  3353. + sign = '\0'; /* sign == '-' for negative decimal */
  3354. +
  3355. + str = string;
  3356. +
  3357. + switch (f)
  3358. + {
  3359. + case 'c' :
  3360. + string[0] = (char) va_arg(argptr, int);
  3361. + string[1] = '\0';
  3362. + fmax = 0;
  3363. + fill = ' ';
  3364. + break;
  3365. +
  3366. + case 's' :
  3367. + str = va_arg(argptr, char *);
  3368. + fill = ' ';
  3369. + break;
  3370. +
  3371. + case 'D' :
  3372. + case 'd' :
  3373. + number = va_arg(argptr, int);
  3374. + if (number < 0)
  3375. + {
  3376. + sign = '-';
  3377. + number = -number;
  3378. + }
  3379. + do_decimal(temp, DIM(temp), (unsigned int) number, str);
  3380. + fmax = 0;
  3381. + break;
  3382. +
  3383. + case 'U' :
  3384. + case 'u' :
  3385. + number = va_arg(argptr, int);
  3386. + do_decimal(temp, DIM(temp), (unsigned int) number, str);
  3387. + fmax = 0;
  3388. + break;
  3389. +
  3390. + case 'O' :
  3391. + case 'o' :
  3392. + number = va_arg(argptr, int);
  3393. + do_octal(temp, (unsigned int) number, str);
  3394. + fmax = 0;
  3395. + break;
  3396. +
  3397. + case 'X' :
  3398. + case 'x' :
  3399. + number = va_arg(argptr, int);
  3400. + do_hex(temp, (unsigned int) number, str);
  3401. + fmax = 0;
  3402. + break;
  3403. +
  3404. + case 'H' :
  3405. + case 'h' :
  3406. + buff_ptr = va_arg(argptr, char *);
  3407. + buff_len = va_arg(argptr, int);
  3408. + do_buffer(buff_ptr, buff_len, str);
  3409. + fmax = 0;
  3410. + break;
  3411. +
  3412. + default :
  3413. + WRITE_CHAR(buffer, size, ((char) f));
  3414. + break;
  3415. + }
  3416. +
  3417. + /* get the length of the string */
  3418. +
  3419. + length = 0;
  3420. + while (str[length])
  3421. + {
  3422. + length++;
  3423. + }
  3424. +
  3425. + /* make sure we have fmax and fmin values that are O.K. */
  3426. +
  3427. + if (fmin > DIM(string) || fmin < 0)
  3428. + {
  3429. + fmin = 0;
  3430. + }
  3431. +
  3432. + if (fmax > DIM(string) || fmax < 0)
  3433. + {
  3434. + fmax = 0;
  3435. + }
  3436. +
  3437. + /* figure out how many leading characters thare are */
  3438. +
  3439. + leading = 0;
  3440. +
  3441. + if (fmax || fmin)
  3442. + {
  3443. + if (fmax)
  3444. + {
  3445. + if (length > fmax)
  3446. + {
  3447. + length = fmax;
  3448. + }
  3449. + }
  3450. +
  3451. + if (fmin)
  3452. + {
  3453. + leading = fmin - length;
  3454. + }
  3455. +
  3456. + if (sign == '-')
  3457. + {
  3458. + leading--;
  3459. + }
  3460. + }
  3461. +
  3462. + /* output sign now, if fill is numeric */
  3463. +
  3464. + if (sign == '-' && fill == '0')
  3465. + {
  3466. + WRITE_CHAR(buffer, size, '-');
  3467. + }
  3468. +
  3469. + /* if right justified, output fill characters */
  3470. +
  3471. + if (!leftjust)
  3472. + {
  3473. + for (i = 0; i < leading; i++)
  3474. + {
  3475. + WRITE_CHAR(buffer, size, fill);
  3476. + }
  3477. + }
  3478. +
  3479. + /* output sign now, if fill is spaces */
  3480. +
  3481. + if (sign == '-' && fill == ' ')
  3482. + {
  3483. + WRITE_CHAR(buffer, size, '-');
  3484. + }
  3485. +
  3486. + /* now the actual value */
  3487. +
  3488. + for (i = 0; i < length; i++)
  3489. + {
  3490. + WRITE_CHAR(buffer, size, str[i]);
  3491. + }
  3492. +
  3493. + /* if left justified, fill out with the fill character */
  3494. +
  3495. + if (leftjust)
  3496. + {
  3497. + for (i = 0; i < leading; i++)
  3498. + {
  3499. + WRITE_CHAR(buffer, size, fill);
  3500. + }
  3501. + }
  3502. + }
  3503. +}
  3504. +
  3505. +/*
  3506. + * sprintf for kernel
  3507. + *
  3508. + * call our vsprintf assuming user has a big buffer....
  3509. + */
  3510. +
  3511. +void DivasSprintf(char *buffer, char *fmt, ...)
  3512. +
  3513. +{
  3514. + va_list argptr; /* pointer to additional args */
  3515. +
  3516. + va_start(argptr, fmt);
  3517. +
  3518. + Divas_vsprintf(buffer, 1024, fmt, argptr);
  3519. +
  3520. + va_end(argptr);
  3521. +
  3522. + return;
  3523. +}
  3524. +
  3525. void DivasPrintf(char *fmt, ...)
  3526. {
  3527. @@ -40,7 +502,7 @@ void DivasPrintf(char *fmt, ...)
  3528. /* call vsprintf to format the user's information */
  3529. - vsnprintf(log.buffer, DIM(log.buffer), fmt, argptr);
  3530. + Divas_vsprintf(log.buffer, DIM(log.buffer), fmt, argptr);
  3531. va_end(argptr);
  3532. Index: linux-2.4.35.4/drivers/isdn/eicon/lincfg.c
  3533. ===================================================================
  3534. --- linux-2.4.35.4.orig/drivers/isdn/eicon/lincfg.c
  3535. +++ linux-2.4.35.4/drivers/isdn/eicon/lincfg.c
  3536. @@ -26,6 +26,9 @@
  3537. #include "uxio.h"
  3538. #include <linux/pci.h>
  3539. +#ifndef COMPAT_HAS_2_2_PCI
  3540. +#include <linux/pci_ids.h>
  3541. +#endif
  3542. #include <linux/kernel.h>
  3543. #include <linux/ioport.h>
  3544. Index: linux-2.4.35.4/drivers/isdn/eicon/linchr.c
  3545. ===================================================================
  3546. --- linux-2.4.35.4.orig/drivers/isdn/eicon/linchr.c
  3547. +++ linux-2.4.35.4/drivers/isdn/eicon/linchr.c
  3548. @@ -154,17 +154,17 @@ ssize_t do_read(struct file *pFile, char
  3549. klog_t *pHeadItem;
  3550. if (BufferSize < sizeof(klog_t))
  3551. + {
  3552. + printk(KERN_WARNING "Divas: Divalog buffer specifed a size that is too small (%d - %d required)\n",
  3553. + BufferSize, sizeof(klog_t));
  3554. return -EIO;
  3555. + }
  3556. pHeadItem = (klog_t *) DivasLogFifoRead();
  3557. if (pHeadItem)
  3558. {
  3559. - if(copy_to_user(pClientLogBuffer, pHeadItem, sizeof(klog_t)))
  3560. - {
  3561. - kfree(pHeadItem);
  3562. - return -EFAULT;
  3563. - }
  3564. + memcpy(pClientLogBuffer, pHeadItem, sizeof(klog_t));
  3565. kfree(pHeadItem);
  3566. return sizeof(klog_t);
  3567. }
  3568. Index: linux-2.4.35.4/drivers/isdn/eicon/linio.c
  3569. ===================================================================
  3570. --- linux-2.4.35.4.orig/drivers/isdn/eicon/linio.c
  3571. +++ linux-2.4.35.4/drivers/isdn/eicon/linio.c
  3572. @@ -15,6 +15,7 @@
  3573. #include <linux/slab.h>
  3574. #include <linux/pci.h>
  3575. #include <linux/delay.h>
  3576. +#include <linux/isdn_compat.h>
  3577. #undef N_DATA
  3578. #include "uxio.h"
  3579. Index: linux-2.4.35.4/drivers/isdn/hisax/Makefile
  3580. ===================================================================
  3581. --- linux-2.4.35.4.orig/drivers/isdn/hisax/Makefile
  3582. +++ linux-2.4.35.4/drivers/isdn/hisax/Makefile
  3583. @@ -4,20 +4,17 @@
  3584. O_TARGET := vmlinux-obj.o
  3585. -# Define maximum number of cards
  3586. -
  3587. -EXTRA_CFLAGS += -DHISAX_MAX_CARDS=$(CONFIG_HISAX_MAX_CARDS)
  3588. -
  3589. # Objects that export symbols.
  3590. -export-objs := config.o hisax_isac.o isdnhdlc.o
  3591. +export-objs := config.o fsm.o hisax_isac.o
  3592. # Multipart objects.
  3593. list-multi := hisax.o hisax_st5481.o
  3594. hisax-objs := config.o isdnl1.o tei.o isdnl2.o isdnl3.o \
  3595. lmgr.o q931.o callc.o fsm.o cert.o
  3596. -hisax_st5481-objs := st5481_init.o st5481_usb.o st5481_d.o st5481_b.o
  3597. +hisax_st5481-objs := st5481_init.o st5481_usb.o st5481_d.o st5481_b.o \
  3598. + st5481_hdlc.o
  3599. # Optional parts of multipart objects.
  3600. hisax-objs-$(CONFIG_HISAX_EURO) += l3dss1.o
  3601. @@ -33,7 +30,7 @@ hisax-objs-$(CONFIG_HISAX_AVM_A1_PCMCIA)
  3602. hisax-objs-$(CONFIG_HISAX_FRITZPCI) += avm_pci.o isac.o arcofi.o
  3603. hisax-objs-$(CONFIG_HISAX_ELSA) += elsa.o isac.o arcofi.o hscx.o
  3604. hisax-objs-$(CONFIG_HISAX_IX1MICROR2) += ix1_micro.o isac.o arcofi.o hscx.o
  3605. -hisax-objs-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o ipacx.o
  3606. +hisax-objs-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o
  3607. hisax-objs-$(CONFIG_HISAX_ASUSCOM) += asuscom.o isac.o arcofi.o hscx.o
  3608. hisax-objs-$(CONFIG_HISAX_TELEINT) += teleint.o isac.o arcofi.o hfc_2bs0.o
  3609. hisax-objs-$(CONFIG_HISAX_SEDLBAUER) += sedlbauer.o isac.o arcofi.o hscx.o isar.o
  3610. @@ -44,6 +41,7 @@ hisax-objs-$(CONFIG_HISAX_NETJET_U) += n
  3611. hisax-objs-$(CONFIG_HISAX_HFCS) += hfcscard.o hfc_2bds0.o
  3612. hisax-objs-$(CONFIG_HISAX_HFC_PCI) += hfc_pci.o
  3613. hisax-objs-$(CONFIG_HISAX_HFC_SX) += hfc_sx.o
  3614. +hisax-objs-$(CONFIG_HISAX_HFC_USB) += hfc_usbr.o
  3615. hisax-objs-$(CONFIG_HISAX_NICCY) += niccy.o isac.o arcofi.o hscx.o
  3616. hisax-objs-$(CONFIG_HISAX_ISURF) += isurf.o isac.o arcofi.o isar.o
  3617. hisax-objs-$(CONFIG_HISAX_HSTSAPHIR) += saphir.o isac.o arcofi.o hscx.o
  3618. @@ -51,7 +49,6 @@ hisax-objs-$(CONFIG_HISAX_BKM_A4T) += bk
  3619. hisax-objs-$(CONFIG_HISAX_SCT_QUADRO) += bkm_a8.o isac.o arcofi.o hscx.o
  3620. hisax-objs-$(CONFIG_HISAX_GAZEL) += gazel.o isac.o arcofi.o hscx.o
  3621. hisax-objs-$(CONFIG_HISAX_W6692) += w6692.o
  3622. -hisax-objs-$(CONFIG_HISAX_ENTERNOW_PCI) += enternow_pci.o amd7930_fn.o
  3623. #hisax-objs-$(CONFIG_HISAX_TESTEMU) += testemu.o
  3624. hisax-objs += $(sort $(hisax-objs-y))
  3625. @@ -61,10 +58,9 @@ hisax-objs += $(sort $(hisax-objs-y))
  3626. obj-$(CONFIG_ISDN_DRV_HISAX) += hisax.o
  3627. obj-$(CONFIG_HISAX_SEDLBAUER_CS) += sedlbauer_cs.o
  3628. obj-$(CONFIG_HISAX_ELSA_CS) += elsa_cs.o
  3629. -obj-$(CONFIG_HISAX_AVM_A1_CS) += avma1_cs.o
  3630. -obj-$(CONFIG_HISAX_ST5481) += hisax_st5481.o isdnhdlc.o
  3631. -obj-$(CONFIG_HISAX_FRITZ_PCIPNP) += hisax_isac.o hisax_fcpcipnp.o
  3632. -obj-$(CONFIG_USB_AUERISDN) += isdnhdlc.o
  3633. +obj-$(CONFIG_HISAX_HFC_USB_CS) += hfc_usb.o
  3634. +obj-$(CONFIG_HISAX_ST5481) += hisax_st5481.o
  3635. +obj-$(CONFIG_HISAX_FRITZ_PCIPNP) += hisax_fcpcipnp.o hisax_isac.o
  3636. CERT := $(shell md5sum -c md5sums.asc >> /dev/null;echo $$?)
  3637. CFLAGS_cert.o := -DCERTIFICATION=$(CERT)
  3638. Index: linux-2.4.35.4/drivers/isdn/hisax/amd7930.c
  3639. ===================================================================
  3640. --- /dev/null
  3641. +++ linux-2.4.35.4/drivers/isdn/hisax/amd7930.c
  3642. @@ -0,0 +1,755 @@
  3643. +/* $Id: amd7930.c,v 1.8 2001/09/24 13:22:55 kai Exp $
  3644. + *
  3645. + * HiSax ISDN driver - chip specific routines for AMD 7930
  3646. + *
  3647. + * Author Brent Baccala
  3648. + * Copyright by Brent Baccala <[email protected]>
  3649. + *
  3650. + * This software may be used and distributed according to the terms
  3651. + * of the GNU General Public License, incorporated herein by reference.
  3652. + *
  3653. + * - Existing ISDN HiSax driver provides all the smarts
  3654. + * - it compiles, runs, talks to an isolated phone switch, connects
  3655. + * to a Cisco, pings go through
  3656. + * - AMD 7930 support only (no DBRI yet)
  3657. + * - no US NI-1 support (may not work on US phone system - untested)
  3658. + * - periodic packet loss, apparently due to lost interrupts
  3659. + * - ISDN sometimes freezes, requiring reboot before it will work again
  3660. + *
  3661. + * The code is unreliable enough to be consider alpha
  3662. + *
  3663. + * This file is (c) under GNU General Public License
  3664. + *
  3665. + * Advanced Micro Devices' Am79C30A is an ISDN/audio chip used in the
  3666. + * SparcStation 1+. The chip provides microphone and speaker interfaces
  3667. + * which provide mono-channel audio at 8K samples per second via either
  3668. + * 8-bit A-law or 8-bit mu-law encoding. Also, the chip features an
  3669. + * ISDN BRI Line Interface Unit (LIU), I.430 S/T physical interface,
  3670. + * which performs basic D channel LAPD processing and provides raw
  3671. + * B channel data. The digital audio channel, the two ISDN B channels,
  3672. + * and two 64 Kbps channels to the microprocessor are all interconnected
  3673. + * via a multiplexer.
  3674. + *
  3675. + * This driver interfaces to the Linux HiSax ISDN driver, which performs
  3676. + * all high-level Q.921 and Q.931 ISDN functions. The file is not
  3677. + * itself a hardware driver; rather it uses functions exported by
  3678. + * the AMD7930 driver in the sparcaudio subsystem (drivers/sbus/audio),
  3679. + * allowing the chip to be simultaneously used for both audio and ISDN data.
  3680. + * The hardware driver does _no_ buffering, but provides several callbacks
  3681. + * which are called during interrupt service and should therefore run quickly.
  3682. + *
  3683. + * D channel transmission is performed by passing the hardware driver the
  3684. + * address and size of an skb's data area, then waiting for a callback
  3685. + * to signal successful transmission of the packet. A task is then
  3686. + * queued to notify the HiSax driver that another packet may be transmitted.
  3687. + *
  3688. + * D channel reception is quite simple, mainly because of:
  3689. + * 1) the slow speed of the D channel - 16 kbps, and
  3690. + * 2) the presence of an 8- or 32-byte (depending on chip version) FIFO
  3691. + * to buffer the D channel data on the chip
  3692. + * Worst case scenario of back-to-back packets with the 8 byte buffer
  3693. + * at 16 kbps yields an service time of 4 ms - long enough to preclude
  3694. + * the need for fancy buffering. We queue a background task that copies
  3695. + * data out of the receive buffer into an skb, and the hardware driver
  3696. + * simply does nothing until we're done with the receive buffer and
  3697. + * reset it for a new packet.
  3698. + *
  3699. + * B channel processing is more complex, because of:
  3700. + * 1) the faster speed - 64 kbps,
  3701. + * 2) the lack of any on-chip buffering (it interrupts for every byte), and
  3702. + * 3) the lack of any chip support for HDLC encapsulation
  3703. + *
  3704. + * The HiSax driver can put each B channel into one of three modes -
  3705. + * L1_MODE_NULL (channel disabled), L1_MODE_TRANS (transparent data relay),
  3706. + * and L1_MODE_HDLC (HDLC encapsulation by low-level driver).
  3707. + * L1_MODE_HDLC is the most common, used for almost all "pure" digital
  3708. + * data sessions. L1_MODE_TRANS is used for ISDN audio.
  3709. + *
  3710. + * HDLC B channel transmission is performed via a large buffer into
  3711. + * which the skb is copied while performing HDLC bit-stuffing. A CRC
  3712. + * is computed and attached to the end of the buffer, which is then
  3713. + * passed to the low-level routines for raw transmission. Once
  3714. + * transmission is complete, the hardware driver is set to enter HDLC
  3715. + * idle by successive transmission of mark (all 1) bytes, waiting for
  3716. + * the ISDN driver to prepare another packet for transmission and
  3717. + * deliver it.
  3718. + *
  3719. + * HDLC B channel reception is performed via an X-byte ring buffer
  3720. + * divided into N sections of X/N bytes each. Defaults: X=256 bytes, N=4.
  3721. + * As the hardware driver notifies us that each section is full, we
  3722. + * hand it the next section and schedule a background task to peruse
  3723. + * the received section, bit-by-bit, with an HDLC decoder. As
  3724. + * packets are detected, they are copied into a large buffer while
  3725. + * decoding HDLC bit-stuffing. The ending CRC is verified, and if
  3726. + * it is correct, we alloc a new skb of the correct length (which we
  3727. + * now know), copy the packet into it, and hand it to the upper layers.
  3728. + * Optimization: for large packets, we hand the buffer (which also
  3729. + * happens to be an skb) directly to the upper layer after an skb_trim,
  3730. + * and alloc a new large buffer for future packets, thus avoiding a copy.
  3731. + * Then we return to HDLC processing; state is saved between calls.
  3732. + *
  3733. + */
  3734. +
  3735. +#define __NO_VERSION__
  3736. +#include "hisax.h"
  3737. +#include "../../sbus/audio/amd7930.h"
  3738. +#include "isac.h"
  3739. +#include "isdnl1.h"
  3740. +#include "rawhdlc.h"
  3741. +#include <linux/interrupt.h>
  3742. +
  3743. +static const char *amd7930_revision = "$Revision: 1.8 $";
  3744. +
  3745. +#define RCV_BUFSIZE 1024 /* Size of raw receive buffer in bytes */
  3746. +#define RCV_BUFBLKS 4 /* Number of blocks to divide buffer into
  3747. + * (must divide RCV_BUFSIZE) */
  3748. +
  3749. +static void Bchan_fill_fifo(struct BCState *, struct sk_buff *);
  3750. +
  3751. +static void
  3752. +Bchan_xmt_bh(struct BCState *bcs)
  3753. +{
  3754. + struct sk_buff *skb;
  3755. +
  3756. + if (bcs->hw.amd7930.tx_skb != NULL) {
  3757. + dev_kfree_skb(bcs->hw.amd7930.tx_skb);
  3758. + bcs->hw.amd7930.tx_skb = NULL;
  3759. + }
  3760. +
  3761. + if ((skb = skb_dequeue(&bcs->squeue))) {
  3762. + Bchan_fill_fifo(bcs, skb);
  3763. + } else {
  3764. + clear_bit(BC_FLG_BUSY, &bcs->Flag);
  3765. + bcs->event |= 1 << B_XMTBUFREADY;
  3766. + queue_task(&bcs->tqueue, &tq_immediate);
  3767. + mark_bh(IMMEDIATE_BH);
  3768. + }
  3769. +}
  3770. +
  3771. +static void
  3772. +Bchan_xmit_callback(struct BCState *bcs)
  3773. +{
  3774. + queue_task(&bcs->hw.amd7930.tq_xmt, &tq_immediate);
  3775. + mark_bh(IMMEDIATE_BH);
  3776. +}
  3777. +
  3778. +/* B channel transmission: two modes (three, if you count L1_MODE_NULL)
  3779. + *
  3780. + * L1_MODE_HDLC - We need to do HDLC encapsulation before transmiting
  3781. + * the packet (i.e. make_raw_hdlc_data). Since this can be a
  3782. + * time-consuming operation, our completion callback just schedules
  3783. + * a bottom half to do encapsulation for the next packet. In between,
  3784. + * the link will just idle
  3785. + *
  3786. + * L1_MODE_TRANS - Data goes through, well, transparent. No HDLC encap,
  3787. + * and we can't just let the link idle, so the "bottom half" actually
  3788. + * gets called during the top half (it's our callback routine in this case),
  3789. + * but it's a lot faster now since we don't call make_raw_hdlc_data
  3790. + */
  3791. +
  3792. +static void
  3793. +Bchan_fill_fifo(struct BCState *bcs, struct sk_buff *skb)
  3794. +{
  3795. + struct IsdnCardState *cs = bcs->cs;
  3796. + int len;
  3797. +
  3798. + if ((cs->debug & L1_DEB_HSCX) || (cs->debug & L1_DEB_HSCX_FIFO)) {
  3799. + char tmp[1024];
  3800. + char *t = tmp;
  3801. +
  3802. + t += sprintf(t, "amd7930_fill_fifo %c cnt %d",
  3803. + bcs->channel ? 'B' : 'A', skb->len);
  3804. + if (cs->debug & L1_DEB_HSCX_FIFO)
  3805. + QuickHex(t, skb->data, skb->len);
  3806. + debugl1(cs, tmp);
  3807. + }
  3808. +
  3809. + if (bcs->mode == L1_MODE_HDLC) {
  3810. + len = make_raw_hdlc_data(skb->data, skb->len,
  3811. + bcs->hw.amd7930.tx_buff, RAW_BUFMAX);
  3812. + if (len > 0)
  3813. + amd7930_bxmit(0, bcs->channel,
  3814. + bcs->hw.amd7930.tx_buff, len,
  3815. + (void *) &Bchan_xmit_callback,
  3816. + (void *) bcs);
  3817. + dev_kfree_skb(skb);
  3818. + } else if (bcs->mode == L1_MODE_TRANS) {
  3819. + amd7930_bxmit(0, bcs->channel,
  3820. + bcs->hw.amd7930.tx_buff, skb->len,
  3821. + (void *) &Bchan_xmt_bh,
  3822. + (void *) bcs);
  3823. + bcs->hw.amd7930.tx_skb = skb;
  3824. + } else {
  3825. + dev_kfree_skb(skb);
  3826. + }
  3827. +}
  3828. +
  3829. +static void
  3830. +Bchan_mode(struct BCState *bcs, int mode, int bc)
  3831. +{
  3832. + struct IsdnCardState *cs = bcs->cs;
  3833. +
  3834. + if (cs->debug & L1_DEB_HSCX) {
  3835. + char tmp[40];
  3836. + sprintf(tmp, "AMD 7930 mode %d bchan %d/%d",
  3837. + mode, bc, bcs->channel);
  3838. + debugl1(cs, tmp);
  3839. + }
  3840. + bcs->mode = mode;
  3841. +}
  3842. +
  3843. +/* Bchan_l2l1 is the entry point for upper layer routines that want to
  3844. + * transmit on the B channel. PH_DATA_REQ is a normal packet that
  3845. + * we either start transmitting (if idle) or queue (if busy).
  3846. + * PH_PULL_REQ can be called to request a callback message (PH_PULL_CNF)
  3847. + * once the link is idle. After a "pull" callback, the upper layer
  3848. + * routines can use PH_PULL_IND to send data.
  3849. + */
  3850. +
  3851. +static void
  3852. +Bchan_l2l1(struct PStack *st, int pr, void *arg)
  3853. +{
  3854. + struct sk_buff *skb = arg;
  3855. +
  3856. + switch (pr) {
  3857. + case (PH_DATA_REQ):
  3858. + if (test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) {
  3859. + skb_queue_tail(&st->l1.bcs->squeue, skb);
  3860. + } else {
  3861. + test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
  3862. + Bchan_fill_fifo(st->l1.bcs, skb);
  3863. + }
  3864. + break;
  3865. + case (PH_PULL_IND):
  3866. + if (test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) {
  3867. + printk(KERN_WARNING "amd7930: this shouldn't happen\n");
  3868. + break;
  3869. + }
  3870. + test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
  3871. + Bchan_fill_fifo(st->l1.bcs, skb);
  3872. + break;
  3873. + case (PH_PULL_REQ):
  3874. + if (!test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag)) {
  3875. + clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
  3876. + st->l1.l1l2(st, PH_PULL_CNF, NULL);
  3877. + } else
  3878. + set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
  3879. + break;
  3880. + }
  3881. +}
  3882. +
  3883. +/* Receiver callback and bottom half - decodes HDLC at leisure (if
  3884. + * L1_MODE_HDLC) and passes newly received skb on via bcs->rqueue. If
  3885. + * a large packet is received, stick rv_skb (the buffer that the
  3886. + * packet has been decoded into) on the receive queue and alloc a new
  3887. + * (large) skb to act as buffer for future receives. If a small
  3888. + * packet is received, leave rv_skb alone, alloc a new skb of the
  3889. + * correct size, and copy the packet into it
  3890. + */
  3891. +
  3892. +static void
  3893. +Bchan_recv_callback(struct BCState *bcs)
  3894. +{
  3895. + struct amd7930_hw *hw = &bcs->hw.amd7930;
  3896. +
  3897. + hw->rv_buff_in += RCV_BUFSIZE/RCV_BUFBLKS;
  3898. + hw->rv_buff_in %= RCV_BUFSIZE;
  3899. +
  3900. + if (hw->rv_buff_in != hw->rv_buff_out) {
  3901. + amd7930_brecv(0, bcs->channel,
  3902. + hw->rv_buff + hw->rv_buff_in,
  3903. + RCV_BUFSIZE/RCV_BUFBLKS,
  3904. + (void *) &Bchan_recv_callback, (void *) bcs);
  3905. + }
  3906. +
  3907. + queue_task(&hw->tq_rcv, &tq_immediate);
  3908. + mark_bh(IMMEDIATE_BH);
  3909. +}
  3910. +
  3911. +static void
  3912. +Bchan_rcv_bh(struct BCState *bcs)
  3913. +{
  3914. + struct IsdnCardState *cs = bcs->cs;
  3915. + struct amd7930_hw *hw = &bcs->hw.amd7930;
  3916. + struct sk_buff *skb;
  3917. + int len;
  3918. +
  3919. + if (cs->debug & L1_DEB_HSCX) {
  3920. + char tmp[1024];
  3921. +
  3922. + sprintf(tmp, "amd7930_Bchan_rcv (%d/%d)",
  3923. + hw->rv_buff_in, hw->rv_buff_out);
  3924. + debugl1(cs, tmp);
  3925. + QuickHex(tmp, hw->rv_buff + hw->rv_buff_out,
  3926. + RCV_BUFSIZE/RCV_BUFBLKS);
  3927. + debugl1(cs, tmp);
  3928. + }
  3929. +
  3930. + do {
  3931. + if (bcs->mode == L1_MODE_HDLC) {
  3932. + while ((len = read_raw_hdlc_data(hw->hdlc_state,
  3933. + hw->rv_buff + hw->rv_buff_out, RCV_BUFSIZE/RCV_BUFBLKS,
  3934. + hw->rv_skb->tail, HSCX_BUFMAX))) {
  3935. + if (len > 0 && (cs->debug & L1_DEB_HSCX_FIFO)) {
  3936. + char tmp[1024];
  3937. + char *t = tmp;
  3938. +
  3939. + t += sprintf(t, "amd7930_Bchan_rcv %c cnt %d", bcs->channel ? 'B' : 'A', len);
  3940. + QuickHex(t, hw->rv_skb->tail, len);
  3941. + debugl1(cs, tmp);
  3942. + }
  3943. +
  3944. + if (len > HSCX_BUFMAX/2) {
  3945. + /* Large packet received */
  3946. +
  3947. + if (!(skb = dev_alloc_skb(HSCX_BUFMAX))) {
  3948. + printk(KERN_WARNING "amd7930: receive out of memory");
  3949. + } else {
  3950. + skb_put(hw->rv_skb, len);
  3951. + skb_queue_tail(&bcs->rqueue, hw->rv_skb);
  3952. + hw->rv_skb = skb;
  3953. + bcs->event |= 1 << B_RCVBUFREADY;
  3954. + queue_task(&bcs->tqueue, &tq_immediate);
  3955. + }
  3956. + } else if (len > 0) {
  3957. + /* Small packet received */
  3958. +
  3959. + if (!(skb = dev_alloc_skb(len))) {
  3960. + printk(KERN_WARNING "amd7930: receive out of memory\n");
  3961. + } else {
  3962. + memcpy(skb_put(skb, len), hw->rv_skb->tail, len);
  3963. + skb_queue_tail(&bcs->rqueue, skb);
  3964. + bcs->event |= 1 << B_RCVBUFREADY;
  3965. + queue_task(&bcs->tqueue, &tq_immediate);
  3966. + mark_bh(IMMEDIATE_BH);
  3967. + }
  3968. + } else {
  3969. + /* Reception Error */
  3970. + /* printk("amd7930: B channel receive error\n"); */
  3971. + }
  3972. + }
  3973. + } else if (bcs->mode == L1_MODE_TRANS) {
  3974. + if (!(skb = dev_alloc_skb(RCV_BUFSIZE/RCV_BUFBLKS))) {
  3975. + printk(KERN_WARNING "amd7930: receive out of memory\n");
  3976. + } else {
  3977. + memcpy(skb_put(skb, RCV_BUFSIZE/RCV_BUFBLKS),
  3978. + hw->rv_buff + hw->rv_buff_out,
  3979. + RCV_BUFSIZE/RCV_BUFBLKS);
  3980. + skb_queue_tail(&bcs->rqueue, skb);
  3981. + bcs->event |= 1 << B_RCVBUFREADY;
  3982. + queue_task(&bcs->tqueue, &tq_immediate);
  3983. + mark_bh(IMMEDIATE_BH);
  3984. + }
  3985. + }
  3986. +
  3987. + if (hw->rv_buff_in == hw->rv_buff_out) {
  3988. + /* Buffer was filled up - need to restart receiver */
  3989. + amd7930_brecv(0, bcs->channel,
  3990. + hw->rv_buff + hw->rv_buff_in,
  3991. + RCV_BUFSIZE/RCV_BUFBLKS,
  3992. + (void *) &Bchan_recv_callback,
  3993. + (void *) bcs);
  3994. + }
  3995. +
  3996. + hw->rv_buff_out += RCV_BUFSIZE/RCV_BUFBLKS;
  3997. + hw->rv_buff_out %= RCV_BUFSIZE;
  3998. +
  3999. + } while (hw->rv_buff_in != hw->rv_buff_out);
  4000. +}
  4001. +
  4002. +static void
  4003. +Bchan_close(struct BCState *bcs)
  4004. +{
  4005. + struct sk_buff *skb;
  4006. +
  4007. + Bchan_mode(bcs, 0, 0);
  4008. + amd7930_bclose(0, bcs->channel);
  4009. +
  4010. + if (test_bit(BC_FLG_INIT, &bcs->Flag)) {
  4011. + skb_queue_purge(&bcs->rqueue);
  4012. + skb_queue_purge(&bcs->squeue);
  4013. + }
  4014. + test_and_clear_bit(BC_FLG_INIT, &bcs->Flag);
  4015. +}
  4016. +
  4017. +static int
  4018. +Bchan_open(struct BCState *bcs)
  4019. +{
  4020. + struct amd7930_hw *hw = &bcs->hw.amd7930;
  4021. +
  4022. + if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) {
  4023. + skb_queue_head_init(&bcs->rqueue);
  4024. + skb_queue_head_init(&bcs->squeue);
  4025. + }
  4026. + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
  4027. +
  4028. + amd7930_bopen(0, bcs->channel, 0xff);
  4029. + hw->rv_buff_in = 0;
  4030. + hw->rv_buff_out = 0;
  4031. + hw->tx_skb = NULL;
  4032. + init_hdlc_state(hw->hdlc_state, 0);
  4033. + amd7930_brecv(0, bcs->channel,
  4034. + hw->rv_buff + hw->rv_buff_in, RCV_BUFSIZE/RCV_BUFBLKS,
  4035. + (void *) &Bchan_recv_callback, (void *) bcs);
  4036. +
  4037. + bcs->event = 0;
  4038. + bcs->tx_cnt = 0;
  4039. + return (0);
  4040. +}
  4041. +
  4042. +static void
  4043. +Bchan_init(struct BCState *bcs)
  4044. +{
  4045. + if (!(bcs->hw.amd7930.tx_buff = kmalloc(RAW_BUFMAX, GFP_ATOMIC))) {
  4046. + printk(KERN_WARNING
  4047. + "HiSax: No memory for amd7930.tx_buff\n");
  4048. + return;
  4049. + }
  4050. + if (!(bcs->hw.amd7930.rv_buff = kmalloc(RCV_BUFSIZE, GFP_ATOMIC))) {
  4051. + printk(KERN_WARNING
  4052. + "HiSax: No memory for amd7930.rv_buff\n");
  4053. + return;
  4054. + }
  4055. + if (!(bcs->hw.amd7930.rv_skb = dev_alloc_skb(HSCX_BUFMAX))) {
  4056. + printk(KERN_WARNING
  4057. + "HiSax: No memory for amd7930.rv_skb\n");
  4058. + return;
  4059. + }
  4060. + if (!(bcs->hw.amd7930.hdlc_state = kmalloc(sizeof(struct hdlc_state),
  4061. + GFP_ATOMIC))) {
  4062. + printk(KERN_WARNING
  4063. + "HiSax: No memory for amd7930.hdlc_state\n");
  4064. + return;
  4065. + }
  4066. +
  4067. + bcs->hw.amd7930.tq_rcv.sync = 0;
  4068. + bcs->hw.amd7930.tq_rcv.routine = (void (*)(void *)) &Bchan_rcv_bh;
  4069. + bcs->hw.amd7930.tq_rcv.data = (void *) bcs;
  4070. +
  4071. + bcs->hw.amd7930.tq_xmt.sync = 0;
  4072. + bcs->hw.amd7930.tq_xmt.routine = (void (*)(void *)) &Bchan_xmt_bh;
  4073. + bcs->hw.amd7930.tq_xmt.data = (void *) bcs;
  4074. +}
  4075. +
  4076. +static void
  4077. +Bchan_manl1(struct PStack *st, int pr,
  4078. + void *arg)
  4079. +{
  4080. + switch (pr) {
  4081. + case (PH_ACTIVATE_REQ):
  4082. + test_and_set_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
  4083. + Bchan_mode(st->l1.bcs, st->l1.mode, st->l1.bc);
  4084. + st->l1.l1man(st, PH_ACTIVATE_CNF, NULL);
  4085. + break;
  4086. + case (PH_DEACTIVATE_REQ):
  4087. + if (!test_bit(BC_FLG_BUSY, &st->l1.bcs->Flag))
  4088. + Bchan_mode(st->l1.bcs, 0, 0);
  4089. + test_and_clear_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
  4090. + break;
  4091. + }
  4092. +}
  4093. +
  4094. +int
  4095. +setstack_amd7930(struct PStack *st, struct BCState *bcs)
  4096. +{
  4097. + if (Bchan_open(bcs))
  4098. + return (-1);
  4099. + st->l1.bcs = bcs;
  4100. + st->l2.l2l1 = Bchan_l2l1;
  4101. + st->ma.manl1 = Bchan_manl1;
  4102. + setstack_manager(st);
  4103. + bcs->st = st;
  4104. + return (0);
  4105. +}
  4106. +
  4107. +
  4108. +static void
  4109. +amd7930_drecv_callback(void *arg, int error, unsigned int count)
  4110. +{
  4111. + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
  4112. + static struct tq_struct task;
  4113. + struct sk_buff *skb;
  4114. +
  4115. + /* NOTE: This function is called directly from an interrupt handler */
  4116. +
  4117. + if (1) {
  4118. + if (!(skb = alloc_skb(count, GFP_ATOMIC)))
  4119. + printk(KERN_WARNING "HiSax: D receive out of memory\n");
  4120. + else {
  4121. + memcpy(skb_put(skb, count), cs->rcvbuf, count);
  4122. + skb_queue_tail(&cs->rq, skb);
  4123. + }
  4124. +
  4125. + task.routine = (void *) DChannel_proc_rcv;
  4126. + task.data = (void *) cs;
  4127. + queue_task(&task, &tq_immediate);
  4128. + mark_bh(IMMEDIATE_BH);
  4129. + }
  4130. +
  4131. + if (cs->debug & L1_DEB_ISAC_FIFO) {
  4132. + char tmp[128];
  4133. + char *t = tmp;
  4134. +
  4135. + t += sprintf(t, "amd7930 Drecv cnt %d", count);
  4136. + if (error) t += sprintf(t, " ERR %x", error);
  4137. + QuickHex(t, cs->rcvbuf, count);
  4138. + debugl1(cs, tmp);
  4139. + }
  4140. +
  4141. + amd7930_drecv(0, cs->rcvbuf, MAX_DFRAME_LEN,
  4142. + &amd7930_drecv_callback, cs);
  4143. +}
  4144. +
  4145. +static void
  4146. +amd7930_dxmit_callback(void *arg, int error)
  4147. +{
  4148. + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
  4149. + static struct tq_struct task;
  4150. +
  4151. + /* NOTE: This function is called directly from an interrupt handler */
  4152. +
  4153. + /* may wish to do retransmission here, if error indicates collision */
  4154. +
  4155. + if (cs->debug & L1_DEB_ISAC_FIFO) {
  4156. + char tmp[128];
  4157. + char *t = tmp;
  4158. +
  4159. + t += sprintf(t, "amd7930 Dxmit cnt %d", cs->tx_skb->len);
  4160. + if (error) t += sprintf(t, " ERR %x", error);
  4161. + QuickHex(t, cs->tx_skb->data, cs->tx_skb->len);
  4162. + debugl1(cs, tmp);
  4163. + }
  4164. +
  4165. + cs->tx_skb = NULL;
  4166. +
  4167. + task.routine = (void *) DChannel_proc_xmt;
  4168. + task.data = (void *) cs;
  4169. + queue_task(&task, &tq_immediate);
  4170. + mark_bh(IMMEDIATE_BH);
  4171. +}
  4172. +
  4173. +static void
  4174. +amd7930_Dchan_l2l1(struct PStack *st, int pr, void *arg)
  4175. +{
  4176. + struct IsdnCardState *cs = (struct IsdnCardState *) st->l1.hardware;
  4177. + struct sk_buff *skb = arg;
  4178. + char str[64];
  4179. +
  4180. + switch (pr) {
  4181. + case (PH_DATA_REQ):
  4182. + if (cs->tx_skb) {
  4183. + skb_queue_tail(&cs->sq, skb);
  4184. +#ifdef L2FRAME_DEBUG /* psa */
  4185. + if (cs->debug & L1_DEB_LAPD)
  4186. + Logl2Frame(cs, skb, "PH_DATA Queued", 0);
  4187. +#endif
  4188. + } else {
  4189. + if ((cs->dlogflag) && (!(skb->data[2] & 1))) {
  4190. + /* I-FRAME */
  4191. + LogFrame(cs, skb->data, skb->len);
  4192. + sprintf(str, "Q.931 frame user->network tei %d", st->l2.tei);
  4193. + dlogframe(cs, skb->data+4, skb->len-4,
  4194. + str);
  4195. + }
  4196. + cs->tx_skb = skb;
  4197. + cs->tx_cnt = 0;
  4198. +#ifdef L2FRAME_DEBUG /* psa */
  4199. + if (cs->debug & L1_DEB_LAPD)
  4200. + Logl2Frame(cs, skb, "PH_DATA", 0);
  4201. +#endif
  4202. + amd7930_dxmit(0, skb->data, skb->len,
  4203. + &amd7930_dxmit_callback, cs);
  4204. + }
  4205. + break;
  4206. + case (PH_PULL_IND):
  4207. + if (cs->tx_skb) {
  4208. + if (cs->debug & L1_DEB_WARN)
  4209. + debugl1(cs, " l2l1 tx_skb exist this shouldn't happen");
  4210. + skb_queue_tail(&cs->sq, skb);
  4211. + break;
  4212. + }
  4213. + if ((cs->dlogflag) && (!(skb->data[2] & 1))) { /* I-FRAME */
  4214. + LogFrame(cs, skb->data, skb->len);
  4215. + sprintf(str, "Q.931 frame user->network tei %d", st->l2.tei);
  4216. + dlogframe(cs, skb->data + 4, skb->len - 4,
  4217. + str);
  4218. + }
  4219. + cs->tx_skb = skb;
  4220. + cs->tx_cnt = 0;
  4221. +#ifdef L2FRAME_DEBUG /* psa */
  4222. + if (cs->debug & L1_DEB_LAPD)
  4223. + Logl2Frame(cs, skb, "PH_DATA_PULLED", 0);
  4224. +#endif
  4225. + amd7930_dxmit(0, cs->tx_skb->data, cs->tx_skb->len,
  4226. + &amd7930_dxmit_callback, cs);
  4227. + break;
  4228. + case (PH_PULL_REQ):
  4229. +#ifdef L2FRAME_DEBUG /* psa */
  4230. + if (cs->debug & L1_DEB_LAPD)
  4231. + debugl1(cs, "-> PH_REQUEST_PULL");
  4232. +#endif
  4233. + if (!cs->tx_skb) {
  4234. + test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
  4235. + st->l1.l1l2(st, PH_PULL_CNF, NULL);
  4236. + } else
  4237. + test_and_set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
  4238. + break;
  4239. + }
  4240. +}
  4241. +
  4242. +int
  4243. +setDstack_amd7930(struct PStack *st, struct IsdnCardState *cs)
  4244. +{
  4245. + st->l2.l2l1 = amd7930_Dchan_l2l1;
  4246. + if (! cs->rcvbuf) {
  4247. + printk("setDstack_amd7930: No cs->rcvbuf!\n");
  4248. + } else {
  4249. + amd7930_drecv(0, cs->rcvbuf, MAX_DFRAME_LEN,
  4250. + &amd7930_drecv_callback, cs);
  4251. + }
  4252. + return (0);
  4253. +}
  4254. +
  4255. +static void
  4256. +manl1_msg(struct IsdnCardState *cs, int msg, void *arg) {
  4257. + struct PStack *st;
  4258. +
  4259. + st = cs->stlist;
  4260. + while (st) {
  4261. + st->ma.manl1(st, msg, arg);
  4262. + st = st->next;
  4263. + }
  4264. +}
  4265. +
  4266. +static void
  4267. +amd7930_new_ph(struct IsdnCardState *cs)
  4268. +{
  4269. + switch (amd7930_get_liu_state(0)) {
  4270. + case 3:
  4271. + manl1_msg(cs, PH_POWERUP_CNF, NULL);
  4272. + break;
  4273. +
  4274. + case 7:
  4275. + manl1_msg(cs, PH_I4_P8_IND, NULL);
  4276. + break;
  4277. +
  4278. + case 8:
  4279. + manl1_msg(cs, PH_RSYNC_IND, NULL);
  4280. + break;
  4281. + }
  4282. +}
  4283. +
  4284. +/* amd7930 LIU state change callback */
  4285. +
  4286. +static void
  4287. +amd7930_liu_callback(struct IsdnCardState *cs)
  4288. +{
  4289. + static struct tq_struct task;
  4290. +
  4291. + if (!cs)
  4292. + return;
  4293. +
  4294. + if (cs->debug & L1_DEB_ISAC) {
  4295. + char tmp[32];
  4296. + sprintf(tmp, "amd7930_liu state %d", amd7930_get_liu_state(0));
  4297. + debugl1(cs, tmp);
  4298. + }
  4299. +
  4300. + task.sync = 0;
  4301. + task.routine = (void *) &amd7930_new_ph;
  4302. + task.data = (void *) cs;
  4303. + queue_task(&task, &tq_immediate);
  4304. + mark_bh(IMMEDIATE_BH);
  4305. +}
  4306. +
  4307. +void
  4308. +amd7930_l1cmd(struct IsdnCardState *cs, int msg, void *arg)
  4309. +{
  4310. + u_char val;
  4311. + char tmp[32];
  4312. +
  4313. + if (cs->debug & L1_DEB_ISAC) {
  4314. + char tmp[32];
  4315. + sprintf(tmp, "amd7930_l1cmd msg %x", msg);
  4316. + debugl1(cs, tmp);
  4317. + }
  4318. +
  4319. + switch(msg) {
  4320. + case PH_RESET_REQ:
  4321. + if (amd7930_get_liu_state(0) <= 3)
  4322. + amd7930_liu_activate(0,0);
  4323. + else
  4324. + amd7930_liu_deactivate(0);
  4325. + break;
  4326. + case PH_ENABLE_REQ:
  4327. + break;
  4328. + case PH_INFO3_REQ:
  4329. + amd7930_liu_activate(0,0);
  4330. + break;
  4331. + case PH_TESTLOOP_REQ:
  4332. + break;
  4333. + default:
  4334. + if (cs->debug & L1_DEB_WARN) {
  4335. + sprintf(tmp, "amd7930_l1cmd unknown %4x", msg);
  4336. + debugl1(cs, tmp);
  4337. + }
  4338. + break;
  4339. + }
  4340. +}
  4341. +
  4342. +static void init_amd7930(struct IsdnCardState *cs)
  4343. +{
  4344. + Bchan_init(&cs->bcs[0]);
  4345. + Bchan_init(&cs->bcs[1]);
  4346. + cs->bcs[0].BC_SetStack = setstack_amd7930;
  4347. + cs->bcs[1].BC_SetStack = setstack_amd7930;
  4348. + cs->bcs[0].BC_Close = Bchan_close;
  4349. + cs->bcs[1].BC_Close = Bchan_close;
  4350. + Bchan_mode(cs->bcs, 0, 0);
  4351. + Bchan_mode(cs->bcs + 1, 0, 0);
  4352. +}
  4353. +
  4354. +void
  4355. +release_amd7930(struct IsdnCardState *cs)
  4356. +{
  4357. +}
  4358. +
  4359. +static int
  4360. +amd7930_card_msg(struct IsdnCardState *cs, int mt, void *arg)
  4361. +{
  4362. + switch (mt) {
  4363. + case CARD_RESET:
  4364. + return(0);
  4365. + case CARD_RELEASE:
  4366. + release_amd7930(cs);
  4367. + return(0);
  4368. + case CARD_INIT:
  4369. + cs->l1cmd = amd7930_l1cmd;
  4370. + amd7930_liu_init(0, &amd7930_liu_callback, (void *)cs);
  4371. + init_amd7930(cs);
  4372. + return(0);
  4373. + case CARD_TEST:
  4374. + return(0);
  4375. + }
  4376. + return(0);
  4377. +}
  4378. +
  4379. +int __init
  4380. +setup_amd7930(struct IsdnCard *card)
  4381. +{
  4382. + struct IsdnCardState *cs = card->cs;
  4383. + char tmp[64];
  4384. +
  4385. + strcpy(tmp, amd7930_revision);
  4386. + printk(KERN_INFO "HiSax: AMD7930 driver Rev. %s\n", HiSax_getrev(tmp));
  4387. + if (cs->typ != ISDN_CTYPE_AMD7930)
  4388. + return (0);
  4389. +
  4390. + cs->irq = amd7930_get_irqnum(0);
  4391. + if (cs->irq == 0)
  4392. + return (0);
  4393. +
  4394. + cs->cardmsg = &amd7930_card_msg;
  4395. +
  4396. + return (1);
  4397. +}
  4398. Index: linux-2.4.35.4/drivers/isdn/hisax/arcofi.c
  4399. ===================================================================
  4400. --- linux-2.4.35.4.orig/drivers/isdn/hisax/arcofi.c
  4401. +++ linux-2.4.35.4/drivers/isdn/hisax/arcofi.c
  4402. @@ -1,4 +1,4 @@
  4403. -/* $Id: arcofi.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  4404. +/* $Id: arcofi.c,v 1.14 2001/09/24 13:22:55 kai Exp $
  4405. *
  4406. * Ansteuerung ARCOFI 2165
  4407. *
  4408. Index: linux-2.4.35.4/drivers/isdn/hisax/arcofi.h
  4409. ===================================================================
  4410. --- linux-2.4.35.4.orig/drivers/isdn/hisax/arcofi.h
  4411. +++ linux-2.4.35.4/drivers/isdn/hisax/arcofi.h
  4412. @@ -1,4 +1,4 @@
  4413. -/* $Id: arcofi.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  4414. +/* $Id$
  4415. *
  4416. * Ansteuerung ARCOFI 2165
  4417. *
  4418. Index: linux-2.4.35.4/drivers/isdn/hisax/asuscom.c
  4419. ===================================================================
  4420. --- linux-2.4.35.4.orig/drivers/isdn/hisax/asuscom.c
  4421. +++ linux-2.4.35.4/drivers/isdn/hisax/asuscom.c
  4422. @@ -1,4 +1,4 @@
  4423. -/* $Id: asuscom.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  4424. +/* $Id: asuscom.c,v 1.14 2001/09/24 13:22:55 kai Exp $
  4425. *
  4426. * low level stuff for ASUSCOM NETWORK INC. ISDNLink cards
  4427. *
  4428. @@ -14,7 +14,6 @@
  4429. #define __NO_VERSION__
  4430. #include <linux/init.h>
  4431. -#include <linux/isapnp.h>
  4432. #include "hisax.h"
  4433. #include "isac.h"
  4434. #include "ipac.h"
  4435. @@ -23,7 +22,7 @@
  4436. extern const char *CardType[];
  4437. -const char *Asuscom_revision = "$Revision: 1.1.4.1 $";
  4438. +const char *Asuscom_revision = "$Revision: 1.14 $";
  4439. #define byteout(addr,val) outb(val,addr)
  4440. #define bytein(addr) inb(addr)
  4441. @@ -310,27 +309,6 @@ Asus_card_msg(struct IsdnCardState *cs,
  4442. return(0);
  4443. }
  4444. -#ifdef __ISAPNP__
  4445. -static struct isapnp_device_id asus_ids[] __initdata = {
  4446. - { ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
  4447. - ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1688),
  4448. - (unsigned long) "Asus1688 PnP" },
  4449. - { ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1690),
  4450. - ISAPNP_VENDOR('A', 'S', 'U'), ISAPNP_FUNCTION(0x1690),
  4451. - (unsigned long) "Asus1690 PnP" },
  4452. - { ISAPNP_VENDOR('S', 'I', 'E'), ISAPNP_FUNCTION(0x0020),
  4453. - ISAPNP_VENDOR('S', 'I', 'E'), ISAPNP_FUNCTION(0x0020),
  4454. - (unsigned long) "Isurf2 PnP" },
  4455. - { ISAPNP_VENDOR('E', 'L', 'F'), ISAPNP_FUNCTION(0x0000),
  4456. - ISAPNP_VENDOR('E', 'L', 'F'), ISAPNP_FUNCTION(0x0000),
  4457. - (unsigned long) "Iscas TE320" },
  4458. - { 0, }
  4459. -};
  4460. -
  4461. -static struct isapnp_device_id *adev = &asus_ids[0];
  4462. -static struct pci_bus *pnp_c __devinitdata = NULL;
  4463. -#endif
  4464. -
  4465. int __init
  4466. setup_asuscom(struct IsdnCard *card)
  4467. {
  4468. @@ -343,45 +321,7 @@ setup_asuscom(struct IsdnCard *card)
  4469. printk(KERN_INFO "HiSax: Asuscom ISDNLink driver Rev. %s\n", HiSax_getrev(tmp));
  4470. if (cs->typ != ISDN_CTYPE_ASUSCOM)
  4471. return (0);
  4472. -#ifdef __ISAPNP__
  4473. - if (!card->para[1] && isapnp_present()) {
  4474. - struct pci_bus *pb;
  4475. - struct pci_dev *pd;
  4476. -
  4477. - while(adev->card_vendor) {
  4478. - if ((pb = isapnp_find_card(adev->card_vendor,
  4479. - adev->card_device, pnp_c))) {
  4480. - pnp_c = pb;
  4481. - pd = NULL;
  4482. - if ((pd = isapnp_find_dev(pnp_c,
  4483. - adev->vendor, adev->function, pd))) {
  4484. - printk(KERN_INFO "HiSax: %s detected\n",
  4485. - (char *)adev->driver_data);
  4486. - pd->prepare(pd);
  4487. - pd->deactivate(pd);
  4488. - pd->activate(pd);
  4489. - card->para[1] = pd->resource[0].start;
  4490. - card->para[0] = pd->irq_resource[0].start;
  4491. - if (!card->para[0] || !card->para[1]) {
  4492. - printk(KERN_ERR "AsusPnP:some resources are missing %ld/%lx\n",
  4493. - card->para[0], card->para[1]);
  4494. - pd->deactivate(pd);
  4495. - return(0);
  4496. - }
  4497. - break;
  4498. - } else {
  4499. - printk(KERN_ERR "AsusPnP: PnP error card found, no device\n");
  4500. - }
  4501. - }
  4502. - adev++;
  4503. - pnp_c=NULL;
  4504. - }
  4505. - if (!adev->card_vendor) {
  4506. - printk(KERN_INFO "AsusPnP: no ISAPnP card found\n");
  4507. - return(0);
  4508. - }
  4509. - }
  4510. -#endif
  4511. +
  4512. bytecnt = 8;
  4513. cs->hw.asus.cfg_reg = card->para[1];
  4514. cs->irq = card->para[0];
  4515. Index: linux-2.4.35.4/drivers/isdn/hisax/avm_a1.c
  4516. ===================================================================
  4517. --- linux-2.4.35.4.orig/drivers/isdn/hisax/avm_a1.c
  4518. +++ linux-2.4.35.4/drivers/isdn/hisax/avm_a1.c
  4519. @@ -1,4 +1,4 @@
  4520. -/* $Id: avm_a1.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  4521. +/* $Id: avm_a1.c,v 2.15 2001/09/24 13:22:55 kai Exp $
  4522. *
  4523. * low level stuff for AVM A1 (Fritz) isdn cards
  4524. *
  4525. @@ -18,7 +18,7 @@
  4526. #include "isdnl1.h"
  4527. extern const char *CardType[];
  4528. -static const char *avm_revision = "$Revision: 1.1.4.1 $";
  4529. +static const char *avm_revision = "$Revision: 2.15 $";
  4530. #define AVM_A1_STAT_ISAC 0x01
  4531. #define AVM_A1_STAT_HSCX 0x02
  4532. Index: linux-2.4.35.4/drivers/isdn/hisax/avm_a1p.c
  4533. ===================================================================
  4534. --- linux-2.4.35.4.orig/drivers/isdn/hisax/avm_a1p.c
  4535. +++ linux-2.4.35.4/drivers/isdn/hisax/avm_a1p.c
  4536. @@ -1,4 +1,4 @@
  4537. -/* $Id: avm_a1p.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  4538. +/* $Id: avm_a1p.c,v 2.9 2001/09/24 13:22:55 kai Exp $
  4539. *
  4540. * low level stuff for the following AVM cards:
  4541. * A1 PCMCIA
  4542. @@ -57,7 +57,7 @@
  4543. #define byteout(addr,val) outb(val,addr)
  4544. #define bytein(addr) inb(addr)
  4545. -static const char *avm_revision = "$Revision: 1.1.4.1 $";
  4546. +static const char *avm_revision = "$Revision: 2.9 $";
  4547. static inline u_char
  4548. ReadISAC(struct IsdnCardState *cs, u_char offset)
  4549. Index: linux-2.4.35.4/drivers/isdn/hisax/avm_pci.c
  4550. ===================================================================
  4551. --- linux-2.4.35.4.orig/drivers/isdn/hisax/avm_pci.c
  4552. +++ linux-2.4.35.4/drivers/isdn/hisax/avm_pci.c
  4553. @@ -1,4 +1,4 @@
  4554. -/* $Id: avm_pci.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  4555. +/* $Id: avm_pci.c,v 1.29 2001/09/24 13:22:55 kai Exp $
  4556. *
  4557. * low level stuff for AVM Fritz!PCI and ISA PnP isdn cards
  4558. *
  4559. @@ -19,11 +19,11 @@
  4560. #include "isac.h"
  4561. #include "isdnl1.h"
  4562. #include <linux/pci.h>
  4563. -#include <linux/isapnp.h>
  4564. +#include <linux/isdn_compat.h>
  4565. #include <linux/interrupt.h>
  4566. extern const char *CardType[];
  4567. -static const char *avm_pci_rev = "$Revision: 1.1.4.1 $";
  4568. +static const char *avm_pci_rev = "$Revision: 1.29 $";
  4569. #define AVM_FRITZ_PCI 1
  4570. #define AVM_FRITZ_PNP 2
  4571. @@ -291,8 +291,7 @@ hdlc_empty_fifo(struct BCState *bcs, int
  4572. debugl1(cs, "hdlc_empty_fifo: incoming packet too large");
  4573. return;
  4574. }
  4575. - p = bcs->hw.hdlc.rcvbuf + bcs->hw.hdlc.rcvidx;
  4576. - ptr = (u_int *)p;
  4577. + ptr = (u_int *) p = bcs->hw.hdlc.rcvbuf + bcs->hw.hdlc.rcvidx;
  4578. bcs->hw.hdlc.rcvidx += count;
  4579. if (cs->subtyp == AVM_FRITZ_PCI) {
  4580. outl(idx, cs->hw.avm.cfg_reg + 4);
  4581. @@ -353,8 +352,7 @@ hdlc_fill_fifo(struct BCState *bcs)
  4582. }
  4583. if ((cs->debug & L1_DEB_HSCX) && !(cs->debug & L1_DEB_HSCX_FIFO))
  4584. debugl1(cs, "hdlc_fill_fifo %d/%ld", count, bcs->tx_skb->len);
  4585. - p = bcs->tx_skb->data;
  4586. - ptr = (u_int *)p;
  4587. + ptr = (u_int *) p = bcs->tx_skb->data;
  4588. skb_pull(bcs->tx_skb, count);
  4589. bcs->tx_cnt -= count;
  4590. bcs->hw.hdlc.count += count;
  4591. @@ -766,10 +764,6 @@ AVM_card_msg(struct IsdnCardState *cs, i
  4592. }
  4593. static struct pci_dev *dev_avm __initdata = NULL;
  4594. -#ifdef __ISAPNP__
  4595. -static struct pci_bus *bus_avm __initdata = NULL;
  4596. -static struct pci_dev *pnp_avm __initdata = NULL;
  4597. -#endif
  4598. int __init
  4599. setup_avm_pcipnp(struct IsdnCard *card)
  4600. @@ -783,47 +777,10 @@ setup_avm_pcipnp(struct IsdnCard *card)
  4601. if (cs->typ != ISDN_CTYPE_FRITZPCI)
  4602. return (0);
  4603. if (card->para[1]) {
  4604. - /* old manual method */
  4605. cs->hw.avm.cfg_reg = card->para[1];
  4606. cs->irq = card->para[0];
  4607. cs->subtyp = AVM_FRITZ_PNP;
  4608. } else {
  4609. -#ifdef __ISAPNP__
  4610. - if (isapnp_present()) {
  4611. - struct pci_bus *ba;
  4612. - if ((ba = isapnp_find_card(
  4613. - ISAPNP_VENDOR('A', 'V', 'M'),
  4614. - ISAPNP_FUNCTION(0x0900), bus_avm))) {
  4615. - bus_avm = ba;
  4616. - pnp_avm = NULL;
  4617. - if ((pnp_avm = isapnp_find_dev(bus_avm,
  4618. - ISAPNP_VENDOR('A', 'V', 'M'),
  4619. - ISAPNP_FUNCTION(0x0900), pnp_avm))) {
  4620. - pnp_avm->prepare(pnp_avm);
  4621. - pnp_avm->deactivate(pnp_avm);
  4622. - pnp_avm->activate(pnp_avm);
  4623. - cs->hw.avm.cfg_reg =
  4624. - pnp_avm->resource[0].start;
  4625. - cs->irq =
  4626. - pnp_avm->irq_resource[0].start;
  4627. - if (!cs->irq) {
  4628. - printk(KERN_ERR "FritzPnP:No IRQ\n");
  4629. - pnp_avm->deactivate(pnp_avm);
  4630. - return(0);
  4631. - }
  4632. - if (!cs->hw.avm.cfg_reg) {
  4633. - printk(KERN_ERR "FritzPnP:No IO address\n");
  4634. - pnp_avm->deactivate(pnp_avm);
  4635. - return(0);
  4636. - }
  4637. - cs->subtyp = AVM_FRITZ_PNP;
  4638. - goto ready;
  4639. - }
  4640. - }
  4641. - } else {
  4642. - printk(KERN_INFO "FritzPnP: no ISA PnP present\n");
  4643. - }
  4644. -#endif
  4645. #if CONFIG_PCI
  4646. if (!pci_present()) {
  4647. printk(KERN_ERR "FritzPCI: no PCI bus present\n");
  4648. @@ -838,7 +795,7 @@ setup_avm_pcipnp(struct IsdnCard *card)
  4649. }
  4650. if (pci_enable_device(dev_avm))
  4651. return(0);
  4652. - cs->hw.avm.cfg_reg = pci_resource_start(dev_avm, 1);
  4653. + cs->hw.avm.cfg_reg = pci_resource_start_io(dev_avm, 1);
  4654. if (!cs->hw.avm.cfg_reg) {
  4655. printk(KERN_ERR "FritzPCI: No IO-Adr for PCI card found\n");
  4656. return(0);
  4657. @@ -854,7 +811,6 @@ setup_avm_pcipnp(struct IsdnCard *card)
  4658. return (0);
  4659. #endif /* CONFIG_PCI */
  4660. }
  4661. -ready:
  4662. cs->hw.avm.isac = cs->hw.avm.cfg_reg + 0x10;
  4663. if (check_region((cs->hw.avm.cfg_reg), 32)) {
  4664. printk(KERN_WARNING
  4665. Index: linux-2.4.35.4/drivers/isdn/hisax/bkm_a4t.c
  4666. ===================================================================
  4667. --- linux-2.4.35.4.orig/drivers/isdn/hisax/bkm_a4t.c
  4668. +++ linux-2.4.35.4/drivers/isdn/hisax/bkm_a4t.c
  4669. @@ -1,4 +1,4 @@
  4670. -/* $Id: bkm_a4t.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  4671. +/* $Id: bkm_a4t.c,v 1.22 2001/09/24 13:22:55 kai Exp $
  4672. *
  4673. * low level stuff for T-Berkom A4T
  4674. *
  4675. @@ -20,11 +20,12 @@
  4676. #include "jade.h"
  4677. #include "isdnl1.h"
  4678. #include <linux/pci.h>
  4679. +#include <linux/isdn_compat.h>
  4680. #include "bkm_ax.h"
  4681. extern const char *CardType[];
  4682. -const char *bkm_a4t_revision = "$Revision: 1.1.4.1 $";
  4683. +const char *bkm_a4t_revision = "$Revision: 1.22 $";
  4684. static inline u_char
  4685. @@ -293,13 +294,13 @@ setup_bkm_a4t(struct IsdnCard *card)
  4686. u16 sub_sys;
  4687. u16 sub_vendor;
  4688. - sub_vendor = dev_a4t->subsystem_vendor;
  4689. - sub_sys = dev_a4t->subsystem_device;
  4690. + pci_get_sub_vendor(dev_a4t,sub_vendor);
  4691. + pci_get_sub_system(dev_a4t,sub_sys);
  4692. if ((sub_sys == PCI_DEVICE_ID_BERKOM_A4T) && (sub_vendor == PCI_VENDOR_ID_BERKOM)) {
  4693. if (pci_enable_device(dev_a4t))
  4694. return(0);
  4695. found = 1;
  4696. - pci_memaddr = pci_resource_start(dev_a4t, 0);
  4697. + pci_memaddr = pci_resource_start_mem(dev_a4t, 0);
  4698. cs->irq = dev_a4t->irq;
  4699. break;
  4700. }
  4701. Index: linux-2.4.35.4/drivers/isdn/hisax/bkm_a8.c
  4702. ===================================================================
  4703. --- linux-2.4.35.4.orig/drivers/isdn/hisax/bkm_a8.c
  4704. +++ linux-2.4.35.4/drivers/isdn/hisax/bkm_a8.c
  4705. @@ -1,4 +1,4 @@
  4706. -/* $Id: bkm_a8.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  4707. +/* $Id: bkm_a8.c,v 1.22 2001/09/24 13:22:55 kai Exp $
  4708. *
  4709. * low level stuff for Scitel Quadro (4*S0, passive)
  4710. *
  4711. @@ -20,6 +20,7 @@
  4712. #include "hscx.h"
  4713. #include "isdnl1.h"
  4714. #include <linux/pci.h>
  4715. +#include <linux/isdn_compat.h>
  4716. #include "bkm_ax.h"
  4717. #if CONFIG_PCI
  4718. @@ -28,7 +29,7 @@
  4719. extern const char *CardType[];
  4720. -const char sct_quadro_revision[] = "$Revision: 1.1.4.1 $";
  4721. +const char sct_quadro_revision[] = "$Revision: 1.22 $";
  4722. static const char *sct_quadro_subtypes[] =
  4723. {
  4724. @@ -329,13 +330,13 @@ setup_sct_quadro(struct IsdnCard *card)
  4725. while ((dev_a8 = pci_find_device(PCI_VENDOR_ID_PLX,
  4726. PCI_DEVICE_ID_PLX_9050, dev_a8))) {
  4727. - sub_vendor_id = dev_a8->subsystem_vendor;
  4728. - sub_sys_id = dev_a8->subsystem_device;
  4729. + pci_get_sub_vendor(dev_a8,sub_vendor_id);
  4730. + pci_get_sub_system(dev_a8,sub_sys_id);
  4731. if ((sub_sys_id == PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO) &&
  4732. (sub_vendor_id == PCI_VENDOR_ID_BERKOM)) {
  4733. if (pci_enable_device(dev_a8))
  4734. return(0);
  4735. - pci_ioaddr1 = pci_resource_start(dev_a8, 1);
  4736. + pci_ioaddr1 = pci_resource_start_io(dev_a8, 1);
  4737. pci_irq = dev_a8->irq;
  4738. pci_bus = dev_a8->bus->number;
  4739. pci_device_fn = dev_a8->devfn;
  4740. @@ -365,7 +366,7 @@ setup_sct_quadro(struct IsdnCard *card)
  4741. pci_ioaddr1 &= PCI_BASE_ADDRESS_IO_MASK;
  4742. pcibios_write_config_dword(pci_bus, pci_device_fn,
  4743. PCI_BASE_ADDRESS_1, pci_ioaddr1);
  4744. - dev_a8->resource[ 1].start = pci_ioaddr1;
  4745. + get_pcibase(dev_a8, 1) = pci_ioaddr1;
  4746. }
  4747. #endif /* End HACK */
  4748. }
  4749. Index: linux-2.4.35.4/drivers/isdn/hisax/bkm_ax.h
  4750. ===================================================================
  4751. --- linux-2.4.35.4.orig/drivers/isdn/hisax/bkm_ax.h
  4752. +++ linux-2.4.35.4/drivers/isdn/hisax/bkm_ax.h
  4753. @@ -1,4 +1,4 @@
  4754. -/* $Id: bkm_ax.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  4755. +/* $Id$
  4756. *
  4757. * low level decls for T-Berkom cards A4T and Scitel Quadro (4*S0, passive)
  4758. *
  4759. Index: linux-2.4.35.4/drivers/isdn/hisax/callc.c
  4760. ===================================================================
  4761. --- linux-2.4.35.4.orig/drivers/isdn/hisax/callc.c
  4762. +++ linux-2.4.35.4/drivers/isdn/hisax/callc.c
  4763. @@ -1,4 +1,4 @@
  4764. -/* $Id: callc.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  4765. +/* $Id: callc.c,v 2.59 2002/02/09 21:19:11 keil Exp $
  4766. *
  4767. * Author Karsten Keil
  4768. * Copyright by Karsten Keil <[email protected]>
  4769. @@ -26,7 +26,7 @@
  4770. #define MOD_USE_COUNT ( GET_USE_COUNT (&__this_module))
  4771. #endif /* MODULE */
  4772. -const char *lli_revision = "$Revision: 1.1.4.1 $";
  4773. +const char *lli_revision = "$Revision: 2.59 $";
  4774. extern struct IsdnCard cards[];
  4775. extern int nrcards;
  4776. @@ -145,9 +145,11 @@ enum {
  4777. EV_PROCEED, /* 20 */
  4778. EV_ALERT, /* 21 */
  4779. EV_REDIR, /* 22 */
  4780. + EV_ALERTING, /* 23 */
  4781. + EV_PROCEEDING, /* 24 */
  4782. };
  4783. -#define EVENT_COUNT (EV_REDIR + 1)
  4784. +#define EVENT_COUNT (EV_PROCEEDING + 1)
  4785. static char *strEvent[] =
  4786. {
  4787. @@ -174,6 +176,8 @@ static char *strEvent[] =
  4788. "EV_PROCEED",
  4789. "EV_ALERT",
  4790. "EV_REDIR",
  4791. + "EV_ALERTING",
  4792. + "EV_PROCEEDING",
  4793. };
  4794. @@ -286,6 +290,22 @@ lli_prep_dialout(struct FsmInst *fi, int
  4795. }
  4796. static void
  4797. +lli_alerting(struct FsmInst *fi, int event, void *arg)
  4798. +{
  4799. + struct Channel *chanp = fi->userdata;
  4800. +
  4801. + HL_LL(chanp, ISDN_STAT_ALERT);
  4802. +}
  4803. +
  4804. +static void
  4805. +lli_proceeding(struct FsmInst *fi, int event, void *arg)
  4806. +{
  4807. + struct Channel *chanp = fi->userdata;
  4808. +
  4809. + HL_LL(chanp, ISDN_STAT_PROCEED);
  4810. +}
  4811. +
  4812. +static void
  4813. lli_resume(struct FsmInst *fi, int event, void *arg)
  4814. {
  4815. struct Channel *chanp = fi->userdata;
  4816. @@ -784,6 +804,8 @@ static struct FsmNode fnlist[] __initdat
  4817. {ST_OUT_DIAL, EV_DISCONNECT_IND, lli_release_req},
  4818. {ST_OUT_DIAL, EV_RELEASE, lli_dhup_close},
  4819. {ST_OUT_DIAL, EV_NOSETUP_RSP, lli_no_setup_rsp},
  4820. + {ST_OUT_DIAL, EV_PROCEEDING, lli_proceeding},
  4821. + {ST_OUT_DIAL, EV_ALERTING, lli_alerting},
  4822. {ST_OUT_DIAL, EV_SETUP_ERR, lli_error},
  4823. {ST_IN_WAIT_LL, EV_LEASED_REL, lli_failure_l},
  4824. {ST_IN_WAIT_LL, EV_ACCEPTD, lli_setup_rsp},
  4825. @@ -925,7 +947,7 @@ static void stat_redir_result(struct Isd
  4826. ic.driver = cs->myid;
  4827. ic.command = ISDN_STAT_REDIR;
  4828. ic.arg = chan;
  4829. - ic.parm.num[0] = result;
  4830. + (ulong)(ic.parm.num[0]) = result;
  4831. cs->iif.statcallb(&ic);
  4832. } /* stat_redir_result */
  4833. @@ -997,8 +1019,13 @@ dchan_l3l4(struct PStack *st, int pr, vo
  4834. FsmEvent(&chanp->fi, EV_RELEASE, NULL);
  4835. break;
  4836. case (CC_PROCEED_SEND | INDICATION):
  4837. + break;
  4838. case (CC_PROCEEDING | INDICATION):
  4839. + FsmEvent(&chanp->fi, EV_PROCEEDING, NULL);
  4840. + break;
  4841. case (CC_ALERTING | INDICATION):
  4842. + FsmEvent(&chanp->fi, EV_ALERTING, NULL);
  4843. + break;
  4844. case (CC_PROGRESS | INDICATION):
  4845. case (CC_NOTIFY | INDICATION):
  4846. break;
  4847. Index: linux-2.4.35.4/drivers/isdn/hisax/cert.c
  4848. ===================================================================
  4849. --- linux-2.4.35.4.orig/drivers/isdn/hisax/cert.c
  4850. +++ linux-2.4.35.4/drivers/isdn/hisax/cert.c
  4851. @@ -1,4 +1,4 @@
  4852. -/* $Id: cert.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  4853. +/* $Id: cert.c,v 2.6 2001/09/24 13:22:56 kai Exp $
  4854. *
  4855. * Author Karsten Keil
  4856. * Copyright by Karsten Keil <[email protected]>
  4857. Index: linux-2.4.35.4/drivers/isdn/hisax/config.c
  4858. ===================================================================
  4859. --- linux-2.4.35.4.orig/drivers/isdn/hisax/config.c
  4860. +++ linux-2.4.35.4/drivers/isdn/hisax/config.c
  4861. @@ -1,4 +1,4 @@
  4862. -/* $Id: config.c,v 1.1.4.5 2001/12/09 19:19:26 kai Exp $
  4863. +/* $Id: config.c,v 2.84 2002/08/13 09:55:29 keil Exp $
  4864. *
  4865. * Author Karsten Keil
  4866. * Copyright by Karsten Keil <[email protected]>
  4867. @@ -24,6 +24,11 @@
  4868. #include <linux/kernel_stat.h>
  4869. #include <linux/tqueue.h>
  4870. #include <linux/interrupt.h>
  4871. +
  4872. +#ifdef CONFIG_HISAX_HFC_USB
  4873. +#include "hisax_loadable.h"
  4874. +#endif
  4875. +
  4876. #define HISAX_STATUS_BUFSIZE 4096
  4877. #define INCLUDE_INLINE_FUNCS
  4878. @@ -75,8 +80,7 @@
  4879. * 37 HFC 2BDS0 S+/SP p0=irq p1=iobase
  4880. * 38 Travers Technologies NETspider-U PCI card
  4881. * 39 HFC 2BDS0-SP PCMCIA p0=irq p1=iobase
  4882. - * 40 hotplug interface
  4883. - * 41 Formula-n enter:now ISDN PCI a/b none
  4884. + * 40 HFC-S USB none
  4885. *
  4886. * protocol can be either ISDN_PTYPE_EURO or ISDN_PTYPE_1TR6 or ISDN_PTYPE_NI1
  4887. *
  4888. @@ -95,11 +99,17 @@ const char *CardType[] = {
  4889. "Siemens I-Surf", "Acer P10", "HST Saphir", "Telekom A4T",
  4890. "Scitel Quadro", "Gazel", "HFC 2BDS0 PCI", "Winbond 6692",
  4891. "HFC 2BDS0 SX", "NETspider-U", "HFC-2BDS0-SP PCMCIA",
  4892. - "Hotplug", "Formula-n enter:now PCI a/b",
  4893. + "HFC-S USB",
  4894. };
  4895. void HiSax_closecard(int cardnr);
  4896. +#ifdef CONFIG_HISAX_HFC_USB
  4897. +#define DEFAULT_CARD ISDN_CTYPE_HFC_USB
  4898. +#define DEFAULT_CFG {0,0,0,0}
  4899. +EXPORT_SYMBOL(hisax_register_hfcusb);
  4900. +#endif
  4901. +
  4902. #ifdef CONFIG_HISAX_ELSA
  4903. #define DEFAULT_CARD ISDN_CTYPE_ELSA
  4904. #define DEFAULT_CFG {0,0,0,0}
  4905. @@ -339,19 +349,27 @@ EXPORT_SYMBOL(HiSax_closecard);
  4906. NULL, \
  4907. }
  4908. -struct IsdnCard cards[HISAX_MAX_CARDS] = {
  4909. +#define EMPTY_CARD {0, DEFAULT_PROTO, {0, 0, 0, 0}, NULL}
  4910. +
  4911. +struct IsdnCard cards[] = {
  4912. FIRST_CARD,
  4913. + EMPTY_CARD,
  4914. + EMPTY_CARD,
  4915. + EMPTY_CARD,
  4916. + EMPTY_CARD,
  4917. + EMPTY_CARD,
  4918. + EMPTY_CARD,
  4919. + EMPTY_CARD,
  4920. };
  4921. -#define HISAX_IDSIZE (HISAX_MAX_CARDS*8)
  4922. -static char HiSaxID[HISAX_IDSIZE] __devinitdata = { 0, };
  4923. +static char HiSaxID[64] __devinitdata = { 0, };
  4924. char *HiSax_id __devinitdata = HiSaxID;
  4925. #ifdef MODULE
  4926. /* Variables for insmod */
  4927. -static int type[HISAX_MAX_CARDS] __devinitdata = { 0, };
  4928. -static int protocol[HISAX_MAX_CARDS] __devinitdata = { 0, };
  4929. -static int io[HISAX_MAX_CARDS] __devinitdata = { 0, };
  4930. +static int type[8] __devinitdata = { 0, };
  4931. +static int protocol[8] __devinitdata = { 0, };
  4932. +static int io[8] __devinitdata = { 0, };
  4933. #undef IO0_IO1
  4934. #ifdef CONFIG_HISAX_16_3
  4935. #define IO0_IO1
  4936. @@ -361,27 +379,23 @@ static int io[HISAX_MAX_CARDS] __devinit
  4937. #define IO0_IO1
  4938. #endif
  4939. #ifdef IO0_IO1
  4940. -static int io0[HISAX_MAX_CARDS] __devinitdata = { 0, };
  4941. -static int io1[HISAX_MAX_CARDS] __devinitdata = { 0, };
  4942. +static int io0[8] __devinitdata = { 0, };
  4943. +static int io1[8] __devinitdata = { 0, };
  4944. #endif
  4945. -static int irq[HISAX_MAX_CARDS] __devinitdata = { 0, };
  4946. -static int mem[HISAX_MAX_CARDS] __devinitdata = { 0, };
  4947. +static int irq[8] __devinitdata = { 0, };
  4948. +static int mem[8] __devinitdata = { 0, };
  4949. static char *id __devinitdata = HiSaxID;
  4950. -#define PARM_PARA "1-" __MODULE_STRING(HISAX_MAX_CARDS) "i"
  4951. -
  4952. -MODULE_DESCRIPTION("ISDN4Linux: Driver for passive ISDN cards");
  4953. MODULE_AUTHOR("Karsten Keil");
  4954. -MODULE_LICENSE("GPL");
  4955. -MODULE_PARM(type, PARM_PARA);
  4956. -MODULE_PARM(protocol, PARM_PARA);
  4957. -MODULE_PARM(io, PARM_PARA);
  4958. -MODULE_PARM(irq, PARM_PARA);
  4959. -MODULE_PARM(mem, PARM_PARA);
  4960. +MODULE_PARM(type, "1-8i");
  4961. +MODULE_PARM(protocol, "1-8i");
  4962. +MODULE_PARM(io, "1-8i");
  4963. +MODULE_PARM(irq, "1-8i");
  4964. +MODULE_PARM(mem, "1-8i");
  4965. MODULE_PARM(id, "s");
  4966. #ifdef IO0_IO1
  4967. -MODULE_PARM(io0, PARM_PARA);
  4968. -MODULE_PARM(io1, PARM_PARA);
  4969. +MODULE_PARM(io0, "1-8i");
  4970. +MODULE_PARM(io1, "1-8i");
  4971. #endif
  4972. #endif /* MODULE */
  4973. @@ -432,6 +446,7 @@ void __init HiSaxVersion(void)
  4974. }
  4975. #ifndef MODULE
  4976. +#ifdef COMPAT_HAS_NEW_SETUP
  4977. #define MAX_ARG (HISAX_MAX_CARDS*5)
  4978. static int __init HiSax_setup(char *line)
  4979. {
  4980. @@ -440,12 +455,16 @@ static int __init HiSax_setup(char *line
  4981. char *str;
  4982. str = get_options(line, MAX_ARG, ints);
  4983. +#else
  4984. +void __init HiSax_setup(char *str, int *ints)
  4985. +{
  4986. + int i, j, argc;
  4987. +#endif
  4988. argc = ints[0];
  4989. printk(KERN_DEBUG "HiSax_setup: argc(%d) str(%s)\n", argc, str);
  4990. i = 0;
  4991. j = 1;
  4992. while (argc && (i < HISAX_MAX_CARDS)) {
  4993. - cards[i].protocol = DEFAULT_PROTO;
  4994. if (argc) {
  4995. cards[i].typ = ints[j];
  4996. j++;
  4997. @@ -473,19 +492,21 @@ static int __init HiSax_setup(char *line
  4998. }
  4999. i++;
  5000. }
  5001. - if (str && *str) {
  5002. - if (strlen(str) < HISAX_IDSIZE)
  5003. - strcpy(HiSaxID, str);
  5004. - else
  5005. - printk(KERN_WARNING "HiSax: ID too long!");
  5006. - } else
  5007. + if (str && *str) {
  5008. + strcpy(HiSaxID, str);
  5009. + HiSax_id = HiSaxID;
  5010. + } else {
  5011. strcpy(HiSaxID, "HiSax");
  5012. -
  5013. - HiSax_id = HiSaxID;
  5014. + HiSax_id = HiSaxID;
  5015. + }
  5016. +#ifdef COMPAT_HAS_NEW_SETUP
  5017. return 1;
  5018. }
  5019. __setup("hisax=", HiSax_setup);
  5020. +#else
  5021. +}
  5022. +#endif /* COMPAT_HAS_NEW_SETUP */
  5023. #endif /* MODULES */
  5024. #if CARD_TELES0
  5025. @@ -560,6 +581,10 @@ extern int setup_hfcs(struct IsdnCard *c
  5026. extern int setup_hfcpci(struct IsdnCard *card);
  5027. #endif
  5028. +#if CONFIG_HISAX_HFC_USB
  5029. +extern int setup_hfc_usb(struct IsdnCard *card);
  5030. +#endif
  5031. +
  5032. #if CARD_HFC_SX
  5033. extern int setup_hfcsx(struct IsdnCard *card);
  5034. #endif
  5035. @@ -604,10 +629,6 @@ extern int setup_w6692(struct IsdnCard *
  5036. extern int setup_netjet_u(struct IsdnCard *card);
  5037. #endif
  5038. -#if CARD_FN_ENTERNOW_PCI
  5039. -extern int setup_enternow_pci(struct IsdnCard *card);
  5040. -#endif
  5041. -
  5042. /*
  5043. * Find card with given driverId
  5044. */
  5045. @@ -899,7 +920,8 @@ static int __devinit init_card(struct Is
  5046. return 3;
  5047. }
  5048. -static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
  5049. +static int __devinit checkcard(int cardnr, char *id, int *busy_flag,
  5050. + void *load_drv)
  5051. {
  5052. long flags;
  5053. int ret = 0;
  5054. @@ -1093,6 +1115,12 @@ static int __devinit checkcard(int cardn
  5055. ret = setup_hfcsx(card);
  5056. break;
  5057. #endif
  5058. +#if CONFIG_HISAX_HFC_USB
  5059. + case ISDN_CTYPE_HFC_USB:
  5060. + cs->hw.hfcusb.drv = load_drv;
  5061. + ret = setup_hfc_usb(card);
  5062. + break;
  5063. +#endif
  5064. #if CARD_NICCY
  5065. case ISDN_CTYPE_NICCY:
  5066. ret = setup_niccy(card);
  5067. @@ -1143,11 +1171,6 @@ static int __devinit checkcard(int cardn
  5068. ret = setup_netjet_u(card);
  5069. break;
  5070. #endif
  5071. -#if CARD_FN_ENTERNOW_PCI
  5072. - case ISDN_CTYPE_ENTERNOW:
  5073. - ret = setup_enternow_pci(card);
  5074. - break;
  5075. -#endif
  5076. case ISDN_CTYPE_DYNAMIC:
  5077. ret = 2;
  5078. break;
  5079. @@ -1186,6 +1209,9 @@ static int __devinit checkcard(int cardn
  5080. case ISDN_CTYPE_DYNAMIC:
  5081. ret = 0;
  5082. break;
  5083. + case ISDN_CTYPE_HFC_USB:
  5084. + ret = cs->cardmsg(cs, CARD_INIT, NULL);
  5085. + break;
  5086. default:
  5087. ret = init_card(cs);
  5088. break;
  5089. @@ -1257,16 +1283,13 @@ int __devinit HiSax_inithardware(int *bu
  5090. else
  5091. sprintf(ids, "%s%d", id, i);
  5092. }
  5093. - if (checkcard(i, ids, busy_flag)) {
  5094. + if (checkcard(i, ids, busy_flag, NULL)) {
  5095. foundcards++;
  5096. i++;
  5097. } else {
  5098. - /* make sure we don't oops the module */
  5099. - if (cards[i].typ > 0 && cards[i].typ <= ISDN_CTYPE_COUNT) {
  5100. - printk(KERN_WARNING
  5101. - "HiSax: Card %s not installed !\n",
  5102. - CardType[cards[i].typ]);
  5103. - }
  5104. + printk(KERN_WARNING
  5105. + "HiSax: Card %s not installed !\n",
  5106. + CardType[cards[i].typ]);
  5107. HiSax_shiftcards(i);
  5108. nrcards--;
  5109. }
  5110. @@ -1342,6 +1365,49 @@ void HiSax_reportcard(int cardnr, int se
  5111. #endif
  5112. }
  5113. +#ifdef CONFIG_HISAX_HFC_USB
  5114. +int
  5115. +hisax_register_hfcusb(struct hisax_drvreg *l1drv)
  5116. +{
  5117. + int i;
  5118. + char ids[30];
  5119. +
  5120. + if (l1drv->version != HISAX_LOAD_VERSION)
  5121. + return 1;
  5122. +
  5123. + switch (l1drv->cmd) {
  5124. + case HISAX_LOAD_CHKVER:
  5125. + break; /* success */
  5126. +
  5127. + case HISAX_LOAD_REGISTER:
  5128. + for (i = 0; i < HISAX_MAX_CARDS; i++) {
  5129. + if (!cards[i].typ)
  5130. + break;
  5131. + }
  5132. + if (i >= HISAX_MAX_CARDS)
  5133. + return 1; /* no space */
  5134. + cards[i].typ = ISDN_CTYPE_HFC_USB; /* setup type */
  5135. + cards[i].protocol = DEFAULT_PROTO;
  5136. + sprintf(ids, "%s%d", l1drv->drvname, i);
  5137. + if (checkcard(i, ids, NULL, (void *) l1drv)) {
  5138. + nrcards++;
  5139. + return 0;
  5140. + }
  5141. + if (cards[i].cs)
  5142. + kfree((void *) cards[i].cs);
  5143. + cards[i].cs = NULL;
  5144. + cards[i].typ = 0; /* no card present */
  5145. + return 1;
  5146. + break;
  5147. +
  5148. + default:
  5149. + return 1; /* unknown command */
  5150. + }
  5151. +
  5152. + return 0;
  5153. +} /* hisax_register_hfcusb */
  5154. +#endif
  5155. +
  5156. static int __init HiSax_init(void)
  5157. {
  5158. int i, retval;
  5159. @@ -1408,8 +1474,6 @@ static int __init HiSax_init(void)
  5160. if (protocol[i]) {
  5161. cards[j].protocol = protocol[i];
  5162. nzproto++;
  5163. - } else {
  5164. - cards[j].protocol = DEFAULT_PROTO;
  5165. }
  5166. switch (type[i]) {
  5167. case ISDN_CTYPE_16_0:
  5168. @@ -1487,22 +1551,15 @@ static int __init HiSax_init(void)
  5169. } else {
  5170. /* QUADRO is a 4 BRI card */
  5171. cards[j++].para[0] = 1;
  5172. - /* we need to check if further cards can be added */
  5173. - if (j < HISAX_MAX_CARDS) {
  5174. - cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
  5175. - cards[j].protocol = protocol[i];
  5176. - cards[j++].para[0] = 2;
  5177. - }
  5178. - if (j < HISAX_MAX_CARDS) {
  5179. - cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
  5180. - cards[j].protocol = protocol[i];
  5181. - cards[j++].para[0] = 3;
  5182. - }
  5183. - if (j < HISAX_MAX_CARDS) {
  5184. - cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
  5185. - cards[j].protocol = protocol[i];
  5186. - cards[j].para[0] = 4;
  5187. - }
  5188. + cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
  5189. + cards[j].protocol = protocol[i];
  5190. + cards[j++].para[0] = 2;
  5191. + cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
  5192. + cards[j].protocol = protocol[i];
  5193. + cards[j++].para[0] = 3;
  5194. + cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
  5195. + cards[j].protocol = protocol[i];
  5196. + cards[j].para[0] = 4;
  5197. }
  5198. break;
  5199. }
  5200. @@ -1526,10 +1583,15 @@ static int __init HiSax_init(void)
  5201. nrcards, (nrcards > 1) ? "s" : "");
  5202. /* Install only, if at least one card found */
  5203. - if (!HiSax_inithardware(NULL))
  5204. - return -ENODEV;
  5205. + if (!HiSax_inithardware(NULL)) {
  5206. + retval = -EIO;
  5207. + goto out_isdnl1;
  5208. + }
  5209. +
  5210. return 0;
  5211. + out_isdnl1:
  5212. + Isdnl1Free();
  5213. out_tei:
  5214. TeiFree();
  5215. out_isdnl2:
  5216. @@ -1576,8 +1638,6 @@ int elsa_init_pcmcia(void *pcm_iob, int
  5217. cards[i].typ = type[i];
  5218. if (protocol[i]) {
  5219. cards[i].protocol = protocol[i];
  5220. - } else {
  5221. - cards[i].protocol = DEFAULT_PROTO;
  5222. }
  5223. }
  5224. cards[0].para[0] = pcm_irq;
  5225. @@ -1595,8 +1655,7 @@ int elsa_init_pcmcia(void *pcm_iob, int
  5226. printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
  5227. nrcards, (nrcards > 1) ? "s" : "");
  5228. - if (!HiSax_inithardware(busy_flag))
  5229. - return -ENODEV;
  5230. + HiSax_inithardware(busy_flag);
  5231. printk(KERN_NOTICE "HiSax: module installed\n");
  5232. #endif
  5233. return 0;
  5234. @@ -1619,8 +1678,6 @@ int hfc_init_pcmcia(void *pcm_iob, int p
  5235. cards[i].typ = type[i];
  5236. if (protocol[i]) {
  5237. cards[i].protocol = protocol[i];
  5238. - } else {
  5239. - cards[i].protocol = DEFAULT_PROTO;
  5240. }
  5241. }
  5242. cards[0].para[0] = pcm_irq;
  5243. @@ -1638,8 +1695,7 @@ int hfc_init_pcmcia(void *pcm_iob, int p
  5244. printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
  5245. nrcards, (nrcards > 1) ? "s" : "");
  5246. - if (!HiSax_inithardware(busy_flag))
  5247. - return -ENODEV;
  5248. + HiSax_inithardware(busy_flag);
  5249. printk(KERN_NOTICE "HiSax: module installed\n");
  5250. #endif
  5251. return 0;
  5252. @@ -1662,8 +1718,6 @@ int sedl_init_pcmcia(void *pcm_iob, int
  5253. cards[i].typ = type[i];
  5254. if (protocol[i]) {
  5255. cards[i].protocol = protocol[i];
  5256. - } else {
  5257. - cards[i].protocol = DEFAULT_PROTO;
  5258. }
  5259. }
  5260. cards[0].para[0] = pcm_irq;
  5261. @@ -1681,8 +1735,7 @@ int sedl_init_pcmcia(void *pcm_iob, int
  5262. printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
  5263. nrcards, (nrcards > 1) ? "s" : "");
  5264. - if (!HiSax_inithardware(busy_flag))
  5265. - return -ENODEV;
  5266. + HiSax_inithardware(busy_flag);
  5267. printk(KERN_NOTICE "HiSax: module installed\n");
  5268. #endif
  5269. return 0;
  5270. @@ -1705,8 +1758,6 @@ int avm_a1_init_pcmcia(void *pcm_iob, in
  5271. cards[i].typ = type[i];
  5272. if (protocol[i]) {
  5273. cards[i].protocol = protocol[i];
  5274. - } else {
  5275. - cards[i].protocol = DEFAULT_PROTO;
  5276. }
  5277. }
  5278. cards[0].para[0] = pcm_irq;
  5279. @@ -1724,8 +1775,7 @@ int avm_a1_init_pcmcia(void *pcm_iob, in
  5280. printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
  5281. nrcards, (nrcards > 1) ? "s" : "");
  5282. - if (!HiSax_inithardware(busy_flag))
  5283. - return -ENODEV;
  5284. + HiSax_inithardware(busy_flag);
  5285. printk(KERN_NOTICE "HiSax: module installed\n");
  5286. #endif
  5287. return 0;
  5288. @@ -1743,7 +1793,7 @@ int __devinit hisax_init_pcmcia(void *pc
  5289. sprintf(ids, "HiSax%d", nrcards);
  5290. else
  5291. sprintf(ids, "HiSax");
  5292. - if (!checkcard(nrcards, ids, busy_flag)) {
  5293. + if (!checkcard(nrcards, ids, busy_flag, NULL)) {
  5294. return -1;
  5295. }
  5296. ret = nrcards;
  5297. @@ -1785,7 +1835,7 @@ int hisax_register(struct hisax_d_if *hi
  5298. cards[i].protocol = protocol;
  5299. sprintf(id, "%s%d", name, i);
  5300. nrcards++;
  5301. - retval = checkcard(i, id, 0);
  5302. + retval = checkcard(i, id, 0, NULL);
  5303. if (retval == 0) { // yuck
  5304. cards[i].typ = 0;
  5305. nrcards--;
  5306. @@ -2117,9 +2167,6 @@ static struct pci_device_id hisax_pci_tb
  5307. {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA20, PCI_ANY_ID, PCI_ANY_ID},
  5308. {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA20_U, PCI_ANY_ID, PCI_ANY_ID},
  5309. {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA201, PCI_ANY_ID, PCI_ANY_ID},
  5310. -//#########################################################################################
  5311. - {PCI_VENDOR_ID_EICON, PCI_DEVICE_ID_EICON_DIVA202, PCI_ANY_ID, PCI_ANY_ID},
  5312. -//#########################################################################################
  5313. #endif
  5314. #ifdef CONFIG_HISAX_ELSA
  5315. {PCI_VENDOR_ID_ELSA, PCI_DEVICE_ID_ELSA_MICROLINK, PCI_ANY_ID, PCI_ANY_ID},
  5316. @@ -2178,11 +2225,3 @@ MODULE_DEVICE_TABLE(pci, hisax_pci_tbl);
  5317. module_init(HiSax_init);
  5318. module_exit(HiSax_exit);
  5319. -
  5320. -EXPORT_SYMBOL(FsmNew);
  5321. -EXPORT_SYMBOL(FsmFree);
  5322. -EXPORT_SYMBOL(FsmEvent);
  5323. -EXPORT_SYMBOL(FsmChangeState);
  5324. -EXPORT_SYMBOL(FsmInitTimer);
  5325. -EXPORT_SYMBOL(FsmDelTimer);
  5326. -EXPORT_SYMBOL(FsmRestartTimer);
  5327. Index: linux-2.4.35.4/drivers/isdn/hisax/diva.c
  5328. ===================================================================
  5329. --- linux-2.4.35.4.orig/drivers/isdn/hisax/diva.c
  5330. +++ linux-2.4.35.4/drivers/isdn/hisax/diva.c
  5331. @@ -1,4 +1,4 @@
  5332. -/* $Id: diva.c,v 1.1.4.2 2002/08/30 11:21:00 keil Exp $
  5333. +/* $Id: diva.c,v 1.33 2001/09/24 13:22:56 kai Exp $
  5334. *
  5335. * low level stuff for Eicon.Diehl Diva Family ISDN cards
  5336. *
  5337. @@ -22,14 +22,13 @@
  5338. #include "isac.h"
  5339. #include "hscx.h"
  5340. #include "ipac.h"
  5341. -#include "ipacx.h"
  5342. #include "isdnl1.h"
  5343. #include <linux/pci.h>
  5344. -#include <linux/isapnp.h>
  5345. +#include <linux/isdn_compat.h>
  5346. extern const char *CardType[];
  5347. -const char *Diva_revision = "$Revision: 1.1.4.2 $";
  5348. +const char *Diva_revision = "$Revision: 1.33 $";
  5349. #define byteout(addr,val) outb(val,addr)
  5350. #define bytein(addr) inb(addr)
  5351. @@ -51,7 +50,6 @@ const char *Diva_revision = "$Revision:
  5352. #define DIVA_PCI 2
  5353. #define DIVA_IPAC_ISA 3
  5354. #define DIVA_IPAC_PCI 4
  5355. -#define DIVA_IPACX_PCI 5
  5356. /* CTRL (Read) */
  5357. #define DIVA_IRQ_STAT 0x01
  5358. @@ -71,12 +69,10 @@ const char *Diva_revision = "$Revision:
  5359. #define PITA_MISC_REG 0x1c
  5360. #ifdef __BIG_ENDIAN
  5361. #define PITA_PARA_SOFTRESET 0x00000001
  5362. -#define PITA_SER_SOFTRESET 0x00000002
  5363. #define PITA_PARA_MPX_MODE 0x00000004
  5364. #define PITA_INT0_ENABLE 0x00000200
  5365. #else
  5366. #define PITA_PARA_SOFTRESET 0x01000000
  5367. -#define PITA_SER_SOFTRESET 0x02000000
  5368. #define PITA_PARA_MPX_MODE 0x04000000
  5369. #define PITA_INT0_ENABLE 0x00020000
  5370. #endif
  5371. @@ -244,47 +240,6 @@ MemWriteHSCX(struct IsdnCardState *cs, i
  5372. memwritereg(cs->hw.diva.cfg_reg, offset + (hscx ? 0x40 : 0), value);
  5373. }
  5374. -/* IO-Functions for IPACX type cards */
  5375. -static u_char
  5376. -MemReadISAC_IPACX(struct IsdnCardState *cs, u_char offset)
  5377. -{
  5378. - return (memreadreg(cs->hw.diva.cfg_reg, offset));
  5379. -}
  5380. -
  5381. -static void
  5382. -MemWriteISAC_IPACX(struct IsdnCardState *cs, u_char offset, u_char value)
  5383. -{
  5384. - memwritereg(cs->hw.diva.cfg_reg, offset, value);
  5385. -}
  5386. -
  5387. -static void
  5388. -MemReadISACfifo_IPACX(struct IsdnCardState *cs, u_char * data, int size)
  5389. -{
  5390. - while(size--)
  5391. - *data++ = memreadreg(cs->hw.diva.cfg_reg, 0);
  5392. -}
  5393. -
  5394. -static void
  5395. -MemWriteISACfifo_IPACX(struct IsdnCardState *cs, u_char * data, int size)
  5396. -{
  5397. - while(size--)
  5398. - memwritereg(cs->hw.diva.cfg_reg, 0, *data++);
  5399. -}
  5400. -
  5401. -static u_char
  5402. -MemReadHSCX_IPACX(struct IsdnCardState *cs, int hscx, u_char offset)
  5403. -{
  5404. - return(memreadreg(cs->hw.diva.cfg_reg, offset +
  5405. - (hscx ? IPACX_OFF_B2 : IPACX_OFF_B1)));
  5406. -}
  5407. -
  5408. -static void
  5409. -MemWriteHSCX_IPACX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
  5410. -{
  5411. - memwritereg(cs->hw.diva.cfg_reg, offset +
  5412. - (hscx ? IPACX_OFF_B2 : IPACX_OFF_B1), value);
  5413. -}
  5414. -
  5415. /*
  5416. * fast interrupt HSCX stuff goes here
  5417. */
  5418. @@ -595,7 +550,7 @@ Memhscx_int_main(struct IsdnCardState *c
  5419. u_char exval;
  5420. struct BCState *bcs;
  5421. - if (val & 0x01) { // EXB
  5422. + if (val & 0x01) {
  5423. bcs = cs->bcs + 1;
  5424. exval = MemReadHSCX(cs, 1, HSCX_EXIR);
  5425. if (exval & 0x40) {
  5426. @@ -622,7 +577,7 @@ Memhscx_int_main(struct IsdnCardState *c
  5427. debugl1(cs, "HSCX B interrupt %x", val);
  5428. Memhscx_interrupt(cs, val, 1);
  5429. }
  5430. - if (val & 0x02) { // EXA
  5431. + if (val & 0x02) {
  5432. bcs = cs->bcs;
  5433. exval = MemReadHSCX(cs, 0, HSCX_EXIR);
  5434. if (exval & 0x40) {
  5435. @@ -644,7 +599,7 @@ Memhscx_int_main(struct IsdnCardState *c
  5436. } else if (cs->debug & L1_DEB_HSCX)
  5437. debugl1(cs, "HSCX A EXIR %x", exval);
  5438. }
  5439. - if (val & 0x04) { // ICA
  5440. + if (val & 0x04) {
  5441. exval = MemReadHSCX(cs, 0, HSCX_ISTA);
  5442. if (cs->debug & L1_DEB_HSCX)
  5443. debugl1(cs, "HSCX A interrupt %x", exval);
  5444. @@ -705,31 +660,12 @@ Start_IPACPCI:
  5445. memwritereg(cs->hw.diva.cfg_reg, IPAC_MASK, 0xC0);
  5446. }
  5447. -static void
  5448. -diva_irq_ipacx_pci(int intno, void *dev_id, struct pt_regs *regs)
  5449. -{
  5450. - struct IsdnCardState *cs = dev_id;
  5451. - u_char val;
  5452. - u_char *cfg;
  5453. -
  5454. - if (!cs) {
  5455. - printk(KERN_WARNING "Diva: Spurious interrupt!\n");
  5456. - return;
  5457. - }
  5458. - cfg = (u_char *) cs->hw.diva.pci_cfg;
  5459. - val = *cfg;
  5460. - if (!(val &PITA_INT0_STATUS)) return; // other shared IRQ
  5461. - interrupt_ipacx(cs); // handler for chip
  5462. - *cfg = PITA_INT0_STATUS; // Reset PLX interrupt
  5463. -}
  5464. -
  5465. void
  5466. release_io_diva(struct IsdnCardState *cs)
  5467. {
  5468. int bytecnt;
  5469. - if ((cs->subtyp == DIVA_IPAC_PCI) ||
  5470. - (cs->subtyp == DIVA_IPACX_PCI) ) {
  5471. + if (cs->subtyp == DIVA_IPAC_PCI) {
  5472. u_int *cfg = (unsigned int *)cs->hw.diva.pci_cfg;
  5473. *cfg = 0; /* disable INT0/1 */
  5474. @@ -776,16 +712,6 @@ reset_diva(struct IsdnCardState *cs)
  5475. set_current_state(TASK_UNINTERRUPTIBLE);
  5476. schedule_timeout((10*HZ)/1000);
  5477. memwritereg(cs->hw.diva.cfg_reg, IPAC_MASK, 0xc0);
  5478. - } else if (cs->subtyp == DIVA_IPACX_PCI) {
  5479. - unsigned int *ireg = (unsigned int *)(cs->hw.diva.pci_cfg +
  5480. - PITA_MISC_REG);
  5481. - *ireg = PITA_PARA_SOFTRESET | PITA_PARA_MPX_MODE;
  5482. - set_current_state(TASK_UNINTERRUPTIBLE);
  5483. - schedule_timeout((10*HZ)/1000);
  5484. - *ireg = PITA_PARA_MPX_MODE | PITA_SER_SOFTRESET;
  5485. - set_current_state(TASK_UNINTERRUPTIBLE);
  5486. - schedule_timeout((10*HZ)/1000);
  5487. - MemWriteISAC_IPACX(cs, IPACX_MASK, 0xff); // Interrupts off
  5488. } else { /* DIVA 2.0 */
  5489. cs->hw.diva.ctrl_reg = 0; /* Reset On */
  5490. byteout(cs->hw.diva.ctrl, cs->hw.diva.ctrl_reg);
  5491. @@ -814,9 +740,7 @@ diva_led_handler(struct IsdnCardState *c
  5492. {
  5493. int blink = 0;
  5494. - if ((cs->subtyp == DIVA_IPAC_ISA) ||
  5495. - (cs->subtyp == DIVA_IPAC_PCI) ||
  5496. - (cs->subtyp == DIVA_IPACX_PCI) )
  5497. + if ((cs->subtyp == DIVA_IPAC_ISA) || (cs->subtyp == DIVA_IPAC_PCI))
  5498. return;
  5499. del_timer(&cs->hw.diva.tl);
  5500. if (cs->hw.diva.status & DIVA_ASSIGN)
  5501. @@ -859,12 +783,6 @@ Diva_card_msg(struct IsdnCardState *cs,
  5502. release_io_diva(cs);
  5503. return(0);
  5504. case CARD_INIT:
  5505. - if (cs->subtyp == DIVA_IPACX_PCI) {
  5506. - ireg = (unsigned int *)cs->hw.diva.pci_cfg;
  5507. - *ireg = PITA_INT0_ENABLE;
  5508. - init_ipacx(cs, 3); // init chip and enable interrupts
  5509. - return (0);
  5510. - }
  5511. if (cs->subtyp == DIVA_IPAC_PCI) {
  5512. ireg = (unsigned int *)cs->hw.diva.pci_cfg;
  5513. *ireg = PITA_INT0_ENABLE;
  5514. @@ -901,9 +819,7 @@ Diva_card_msg(struct IsdnCardState *cs,
  5515. }
  5516. break;
  5517. }
  5518. - if ((cs->subtyp != DIVA_IPAC_ISA) &&
  5519. - (cs->subtyp != DIVA_IPAC_PCI) &&
  5520. - (cs->subtyp != DIVA_IPACX_PCI) )
  5521. + if ((cs->subtyp != DIVA_IPAC_ISA) && (cs->subtyp != DIVA_IPAC_PCI))
  5522. diva_led_handler(cs);
  5523. return(0);
  5524. }
  5525. @@ -911,40 +827,11 @@ Diva_card_msg(struct IsdnCardState *cs,
  5526. static struct pci_dev *dev_diva __initdata = NULL;
  5527. static struct pci_dev *dev_diva_u __initdata = NULL;
  5528. static struct pci_dev *dev_diva201 __initdata = NULL;
  5529. -static struct pci_dev *dev_diva202 __initdata = NULL;
  5530. -
  5531. -#ifdef __ISAPNP__
  5532. -static struct isapnp_device_id diva_ids[] __initdata = {
  5533. - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
  5534. - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
  5535. - (unsigned long) "Diva picola" },
  5536. - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51),
  5537. - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0x51),
  5538. - (unsigned long) "Diva picola" },
  5539. - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
  5540. - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
  5541. - (unsigned long) "Diva 2.0" },
  5542. - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71),
  5543. - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0x71),
  5544. - (unsigned long) "Diva 2.0" },
  5545. - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
  5546. - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
  5547. - (unsigned long) "Diva 2.01" },
  5548. - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1),
  5549. - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0xA1),
  5550. - (unsigned long) "Diva 2.01" },
  5551. - { 0, }
  5552. -};
  5553. -
  5554. -static struct isapnp_device_id *pdev = &diva_ids[0];
  5555. -static struct pci_bus *pnp_c __devinitdata = NULL;
  5556. -#endif
  5557. -
  5558. int __init
  5559. setup_diva(struct IsdnCard *card)
  5560. {
  5561. - int bytecnt = 8;
  5562. + int bytecnt;
  5563. u_char val;
  5564. struct IsdnCardState *cs = card->cs;
  5565. char tmp[64];
  5566. @@ -977,75 +864,8 @@ setup_diva(struct IsdnCard *card)
  5567. cs->hw.diva.hscx_adr = card->para[1] + DIVA_HSCX_ADR;
  5568. }
  5569. cs->irq = card->para[0];
  5570. + bytecnt = 8;
  5571. } else {
  5572. -#ifdef __ISAPNP__
  5573. - if (isapnp_present()) {
  5574. - struct pci_bus *pb;
  5575. - struct pci_dev *pd;
  5576. -
  5577. - while(pdev->card_vendor) {
  5578. - if ((pb = isapnp_find_card(pdev->card_vendor,
  5579. - pdev->card_device, pnp_c))) {
  5580. - pnp_c = pb;
  5581. - pd = NULL;
  5582. - if ((pd = isapnp_find_dev(pnp_c,
  5583. - pdev->vendor, pdev->function, pd))) {
  5584. - printk(KERN_INFO "HiSax: %s detected\n",
  5585. - (char *)pdev->driver_data);
  5586. - pd->prepare(pd);
  5587. - pd->deactivate(pd);
  5588. - pd->activate(pd);
  5589. - card->para[1] =
  5590. - pd->resource[0].start;
  5591. - card->para[0] =
  5592. - pd->irq_resource[0].start;
  5593. - if (!card->para[0] || !card->para[1]) {
  5594. - printk(KERN_ERR "Diva PnP:some resources are missing %ld/%lx\n",
  5595. - card->para[0], card->para[1]);
  5596. - pd->deactivate(pd);
  5597. - return(0);
  5598. - }
  5599. - cs->hw.diva.cfg_reg = card->para[1];
  5600. - cs->irq = card->para[0];
  5601. - if (pdev->function == ISAPNP_FUNCTION(0xA1)) {
  5602. - cs->subtyp = DIVA_IPAC_ISA;
  5603. - cs->hw.diva.ctrl = 0;
  5604. - cs->hw.diva.isac =
  5605. - card->para[1] + DIVA_IPAC_DATA;
  5606. - cs->hw.diva.hscx =
  5607. - card->para[1] + DIVA_IPAC_DATA;
  5608. - cs->hw.diva.isac_adr =
  5609. - card->para[1] + DIVA_IPAC_ADR;
  5610. - cs->hw.diva.hscx_adr =
  5611. - card->para[1] + DIVA_IPAC_ADR;
  5612. - test_and_set_bit(HW_IPAC, &cs->HW_Flags);
  5613. - } else {
  5614. - cs->subtyp = DIVA_ISA;
  5615. - cs->hw.diva.ctrl =
  5616. - card->para[1] + DIVA_ISA_CTRL;
  5617. - cs->hw.diva.isac =
  5618. - card->para[1] + DIVA_ISA_ISAC_DATA;
  5619. - cs->hw.diva.hscx =
  5620. - card->para[1] + DIVA_HSCX_DATA;
  5621. - cs->hw.diva.isac_adr =
  5622. - card->para[1] + DIVA_ISA_ISAC_ADR;
  5623. - cs->hw.diva.hscx_adr =
  5624. - card->para[1] + DIVA_HSCX_ADR;
  5625. - }
  5626. - goto ready;
  5627. - } else {
  5628. - printk(KERN_ERR "Diva PnP: PnP error card found, no device\n");
  5629. - return(0);
  5630. - }
  5631. - }
  5632. - pdev++;
  5633. - pnp_c=NULL;
  5634. - }
  5635. - if (!pdev->card_vendor) {
  5636. - printk(KERN_INFO "Diva PnP: no ISAPnP card found\n");
  5637. - }
  5638. - }
  5639. -#endif
  5640. #if CONFIG_PCI
  5641. if (!pci_present()) {
  5642. printk(KERN_ERR "Diva: no PCI bus present\n");
  5643. @@ -1059,14 +879,14 @@ setup_diva(struct IsdnCard *card)
  5644. return(0);
  5645. cs->subtyp = DIVA_PCI;
  5646. cs->irq = dev_diva->irq;
  5647. - cs->hw.diva.cfg_reg = pci_resource_start(dev_diva, 2);
  5648. + cs->hw.diva.cfg_reg = pci_resource_start_io(dev_diva, 2);
  5649. } else if ((dev_diva_u = pci_find_device(PCI_VENDOR_ID_EICON,
  5650. PCI_DEVICE_ID_EICON_DIVA20_U, dev_diva_u))) {
  5651. if (pci_enable_device(dev_diva_u))
  5652. return(0);
  5653. cs->subtyp = DIVA_PCI;
  5654. cs->irq = dev_diva_u->irq;
  5655. - cs->hw.diva.cfg_reg = pci_resource_start(dev_diva_u, 2);
  5656. + cs->hw.diva.cfg_reg = pci_resource_start_io(dev_diva_u, 2);
  5657. } else if ((dev_diva201 = pci_find_device(PCI_VENDOR_ID_EICON,
  5658. PCI_DEVICE_ID_EICON_DIVA201, dev_diva201))) {
  5659. if (pci_enable_device(dev_diva201))
  5660. @@ -1074,19 +894,9 @@ setup_diva(struct IsdnCard *card)
  5661. cs->subtyp = DIVA_IPAC_PCI;
  5662. cs->irq = dev_diva201->irq;
  5663. cs->hw.diva.pci_cfg =
  5664. - (ulong) ioremap(pci_resource_start(dev_diva201, 0), 4096);
  5665. + (ulong) ioremap(pci_resource_start_mem(dev_diva201, 0), 4096);
  5666. cs->hw.diva.cfg_reg =
  5667. - (ulong) ioremap(pci_resource_start(dev_diva201, 1), 4096);
  5668. - } else if ((dev_diva202 = pci_find_device(PCI_VENDOR_ID_EICON,
  5669. - PCI_DEVICE_ID_EICON_DIVA202, dev_diva202))) {
  5670. - if (pci_enable_device(dev_diva202))
  5671. - return(0);
  5672. - cs->subtyp = DIVA_IPACX_PCI;
  5673. - cs->irq = dev_diva202->irq;
  5674. - cs->hw.diva.pci_cfg =
  5675. - (ulong) ioremap(pci_resource_start(dev_diva202, 0), 4096);
  5676. - cs->hw.diva.cfg_reg =
  5677. - (ulong) ioremap(pci_resource_start(dev_diva202, 1), 4096);
  5678. + (ulong) ioremap(pci_resource_start_mem(dev_diva201, 1), 4096);
  5679. } else {
  5680. printk(KERN_WARNING "Diva: No PCI card found\n");
  5681. return(0);
  5682. @@ -1107,8 +917,7 @@ setup_diva(struct IsdnCard *card)
  5683. printk(KERN_WARNING "Diva: unable to config DIVA PCI\n");
  5684. return (0);
  5685. #endif /* CONFIG_PCI */
  5686. - if ((cs->subtyp == DIVA_IPAC_PCI) ||
  5687. - (cs->subtyp == DIVA_IPACX_PCI) ) {
  5688. + if (cs->subtyp == DIVA_IPAC_PCI) {
  5689. cs->hw.diva.ctrl = 0;
  5690. cs->hw.diva.isac = 0;
  5691. cs->hw.diva.hscx = 0;
  5692. @@ -1125,23 +934,18 @@ setup_diva(struct IsdnCard *card)
  5693. bytecnt = 32;
  5694. }
  5695. }
  5696. -ready:
  5697. +
  5698. printk(KERN_INFO
  5699. "Diva: %s card configured at %#lx IRQ %d\n",
  5700. (cs->subtyp == DIVA_PCI) ? "PCI" :
  5701. (cs->subtyp == DIVA_ISA) ? "ISA" :
  5702. - (cs->subtyp == DIVA_IPAC_ISA) ? "IPAC ISA" :
  5703. - (cs->subtyp == DIVA_IPAC_PCI) ? "IPAC PCI" : "IPACX PCI",
  5704. + (cs->subtyp == DIVA_IPAC_ISA) ? "IPAC ISA" : "IPAC PCI",
  5705. cs->hw.diva.cfg_reg, cs->irq);
  5706. - if ((cs->subtyp == DIVA_IPAC_PCI) ||
  5707. - (cs->subtyp == DIVA_IPACX_PCI) ||
  5708. - (cs->subtyp == DIVA_PCI) )
  5709. - printk(KERN_INFO "Diva: %s space at %#lx\n",
  5710. - (cs->subtyp == DIVA_PCI) ? "PCI" :
  5711. - (cs->subtyp == DIVA_IPAC_PCI) ? "IPAC PCI" : "IPACX PCI",
  5712. + if ((cs->subtyp == DIVA_IPAC_PCI) || (cs->subtyp == DIVA_PCI))
  5713. + printk(KERN_INFO "Diva: %s PCI space at %#lx\n",
  5714. + (cs->subtyp == DIVA_PCI) ? "PCI" : "IPAC PCI",
  5715. cs->hw.diva.pci_cfg);
  5716. - if ((cs->subtyp != DIVA_IPAC_PCI) &&
  5717. - (cs->subtyp != DIVA_IPACX_PCI) ) {
  5718. + if (cs->subtyp != DIVA_IPAC_PCI) {
  5719. if (check_region(cs->hw.diva.cfg_reg, bytecnt)) {
  5720. printk(KERN_WARNING
  5721. "HiSax: %s config port %lx-%lx already in use\n",
  5722. @@ -1177,17 +981,6 @@ ready:
  5723. cs->irq_func = &diva_irq_ipac_pci;
  5724. val = memreadreg(cs->hw.diva.cfg_reg, IPAC_ID);
  5725. printk(KERN_INFO "Diva: IPAC version %x\n", val);
  5726. - } else if (cs->subtyp == DIVA_IPACX_PCI) {
  5727. - cs->readisac = &MemReadISAC_IPACX;
  5728. - cs->writeisac = &MemWriteISAC_IPACX;
  5729. - cs->readisacfifo = &MemReadISACfifo_IPACX;
  5730. - cs->writeisacfifo = &MemWriteISACfifo_IPACX;
  5731. - cs->BC_Read_Reg = &MemReadHSCX_IPACX;
  5732. - cs->BC_Write_Reg = &MemWriteHSCX_IPACX;
  5733. - cs->BC_Send_Data = 0; // function located in ipacx module
  5734. - cs->irq_func = &diva_irq_ipacx_pci;
  5735. - printk(KERN_INFO "Diva: IPACX Design Id: %x\n",
  5736. - MemReadISAC_IPACX(cs, IPACX_ID) &0x3F);
  5737. } else { /* DIVA 2.0 */
  5738. cs->hw.diva.tl.function = (void *) diva_led_handler;
  5739. cs->hw.diva.tl.data = (long) cs;
  5740. Index: linux-2.4.35.4/drivers/isdn/hisax/elsa.c
  5741. ===================================================================
  5742. --- linux-2.4.35.4.orig/drivers/isdn/hisax/elsa.c
  5743. +++ linux-2.4.35.4/drivers/isdn/hisax/elsa.c
  5744. @@ -1,4 +1,4 @@
  5745. -/* $Id: elsa.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  5746. +/* $Id: elsa.c,v 2.32 2001/09/24 13:22:56 kai Exp $
  5747. *
  5748. * low level stuff for Elsa isdn cards
  5749. *
  5750. @@ -28,13 +28,13 @@
  5751. #include "hscx.h"
  5752. #include "isdnl1.h"
  5753. #include <linux/pci.h>
  5754. -#include <linux/isapnp.h>
  5755. +#include <linux/isdn_compat.h>
  5756. #include <linux/serial.h>
  5757. #include <linux/serial_reg.h>
  5758. extern const char *CardType[];
  5759. -const char *Elsa_revision = "$Revision: 1.1.4.1 $";
  5760. +const char *Elsa_revision = "$Revision: 2.32 $";
  5761. const char *Elsa_Types[] =
  5762. {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro",
  5763. "PCMCIA", "QS 1000", "QS 3000", "Microlink PCI", "QS 3000 PCI",
  5764. @@ -864,21 +864,6 @@ probe_elsa(struct IsdnCardState *cs)
  5765. static struct pci_dev *dev_qs1000 __devinitdata = NULL;
  5766. static struct pci_dev *dev_qs3000 __devinitdata = NULL;
  5767. -#ifdef __ISAPNP__
  5768. -static struct isapnp_device_id elsa_ids[] __initdata = {
  5769. - { ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
  5770. - ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
  5771. - (unsigned long) "Elsa QS1000" },
  5772. - { ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134),
  5773. - ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134),
  5774. - (unsigned long) "Elsa QS3000" },
  5775. - { 0, }
  5776. -};
  5777. -
  5778. -static struct isapnp_device_id *pdev = &elsa_ids[0];
  5779. -static struct pci_bus *pnp_c __devinitdata = NULL;
  5780. -#endif
  5781. -
  5782. int __devinit
  5783. setup_elsa(struct IsdnCard *card)
  5784. {
  5785. @@ -893,7 +878,6 @@ setup_elsa(struct IsdnCard *card)
  5786. cs->hw.elsa.ctrl_reg = 0;
  5787. cs->hw.elsa.status = 0;
  5788. cs->hw.elsa.MFlag = 0;
  5789. - cs->subtyp = 0;
  5790. if (cs->typ == ISDN_CTYPE_ELSA) {
  5791. cs->hw.elsa.base = card->para[0];
  5792. printk(KERN_INFO "Elsa: Microlink IO probing\n");
  5793. @@ -955,60 +939,9 @@ setup_elsa(struct IsdnCard *card)
  5794. return (0);
  5795. }
  5796. } else if (cs->typ == ISDN_CTYPE_ELSA_PNP) {
  5797. -#ifdef __ISAPNP__
  5798. - if (!card->para[1] && isapnp_present()) {
  5799. - struct pci_bus *pb;
  5800. - struct pci_dev *pd;
  5801. -
  5802. - while(pdev->card_vendor) {
  5803. - if ((pb = isapnp_find_card(pdev->card_vendor,
  5804. - pdev->card_device, pnp_c))) {
  5805. - pnp_c = pb;
  5806. - pd = NULL;
  5807. - if ((pd = isapnp_find_dev(pnp_c,
  5808. - pdev->vendor, pdev->function, pd))) {
  5809. - printk(KERN_INFO "HiSax: %s detected\n",
  5810. - (char *)pdev->driver_data);
  5811. - pd->prepare(pd);
  5812. - pd->deactivate(pd);
  5813. - pd->activate(pd);
  5814. - card->para[1] =
  5815. - pd->resource[0].start;
  5816. - card->para[0] =
  5817. - pd->irq_resource[0].start;
  5818. - if (!card->para[0] || !card->para[1]) {
  5819. - printk(KERN_ERR "Elsa PnP:some resources are missing %ld/%lx\n",
  5820. - card->para[0], card->para[1]);
  5821. - pd->deactivate(pd);
  5822. - return(0);
  5823. - }
  5824. - if (pdev->function == ISAPNP_FUNCTION(0x133))
  5825. - cs->subtyp = ELSA_QS1000;
  5826. - else
  5827. - cs->subtyp = ELSA_QS3000;
  5828. - break;
  5829. - } else {
  5830. - printk(KERN_ERR "Elsa PnP: PnP error card found, no device\n");
  5831. - return(0);
  5832. - }
  5833. - }
  5834. - pdev++;
  5835. - pnp_c=NULL;
  5836. - }
  5837. - if (!pdev->card_vendor) {
  5838. - printk(KERN_INFO "Elsa PnP: no ISAPnP card found\n");
  5839. - return(0);
  5840. - }
  5841. - }
  5842. -#endif
  5843. - if (card->para[1] && card->para[0]) {
  5844. - cs->hw.elsa.base = card->para[1];
  5845. - cs->irq = card->para[0];
  5846. - if (!cs->subtyp)
  5847. - cs->subtyp = ELSA_QS1000;
  5848. - } else {
  5849. - printk(KERN_ERR "Elsa PnP: no parameter\n");
  5850. - }
  5851. + cs->hw.elsa.base = card->para[1];
  5852. + cs->irq = card->para[0];
  5853. + cs->subtyp = ELSA_QS1000;
  5854. cs->hw.elsa.cfg = cs->hw.elsa.base + ELSA_CONFIG;
  5855. cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE;
  5856. cs->hw.elsa.isac = cs->hw.elsa.base + ELSA_ISAC;
  5857. @@ -1058,16 +991,16 @@ setup_elsa(struct IsdnCard *card)
  5858. return(0);
  5859. cs->subtyp = ELSA_QS1000PCI;
  5860. cs->irq = dev_qs1000->irq;
  5861. - cs->hw.elsa.cfg = pci_resource_start(dev_qs1000, 1);
  5862. - cs->hw.elsa.base = pci_resource_start(dev_qs1000, 3);
  5863. + cs->hw.elsa.cfg = pci_resource_start_io(dev_qs1000, 1);
  5864. + cs->hw.elsa.base = pci_resource_start_io(dev_qs1000, 3);
  5865. } else if ((dev_qs3000 = pci_find_device(PCI_VENDOR_ID_ELSA,
  5866. PCI_DEVICE_ID_ELSA_QS3000, dev_qs3000))) {
  5867. if (pci_enable_device(dev_qs3000))
  5868. return(0);
  5869. cs->subtyp = ELSA_QS3000PCI;
  5870. cs->irq = dev_qs3000->irq;
  5871. - cs->hw.elsa.cfg = pci_resource_start(dev_qs3000, 1);
  5872. - cs->hw.elsa.base = pci_resource_start(dev_qs3000, 3);
  5873. + cs->hw.elsa.cfg = pci_resource_start_io(dev_qs3000, 1);
  5874. + cs->hw.elsa.base = pci_resource_start_io(dev_qs3000, 3);
  5875. } else {
  5876. printk(KERN_WARNING "Elsa: No PCI card found\n");
  5877. return(0);
  5878. @@ -1123,7 +1056,6 @@ setup_elsa(struct IsdnCard *card)
  5879. break;
  5880. case ELSA_PCFPRO:
  5881. case ELSA_PCF:
  5882. - case ELSA_QS3000:
  5883. case ELSA_QS3000PCI:
  5884. bytecnt = 16;
  5885. break;
  5886. Index: linux-2.4.35.4/drivers/isdn/hisax/elsa_cs.c
  5887. ===================================================================
  5888. --- linux-2.4.35.4.orig/drivers/isdn/hisax/elsa_cs.c
  5889. +++ linux-2.4.35.4/drivers/isdn/hisax/elsa_cs.c
  5890. @@ -72,7 +72,7 @@ static int pc_debug = PCMCIA_DEBUG;
  5891. MODULE_PARM(pc_debug, "i");
  5892. #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
  5893. static char *version =
  5894. -"elsa_cs.c $Revision: 1.1.4.1 $ $Date: 2001/11/20 14:19:35 $ (K.Lichtenwalder)";
  5895. +"elsa_cs.c $Revision: 1.2 $ $Date: 2001/09/24 13:22:56 $ (K.Lichtenwalder)";
  5896. #else
  5897. #define DEBUG(n, args...)
  5898. #endif
  5899. Index: linux-2.4.35.4/drivers/isdn/hisax/elsa_ser.c
  5900. ===================================================================
  5901. --- linux-2.4.35.4.orig/drivers/isdn/hisax/elsa_ser.c
  5902. +++ linux-2.4.35.4/drivers/isdn/hisax/elsa_ser.c
  5903. @@ -1,4 +1,4 @@
  5904. -/* $Id: elsa_ser.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  5905. +/* $Id: elsa_ser.c,v 2.14 2001/09/24 13:22:56 kai Exp $
  5906. *
  5907. * stuff for the serial modem on ELSA cards
  5908. *
  5909. @@ -396,6 +396,74 @@ static inline void transmit_chars(struct
  5910. }
  5911. }
  5912. +#if 0
  5913. +static inline void check_modem_status(struct IsdnCardState *cs)
  5914. +{
  5915. + int status;
  5916. + struct async_struct *info = cs->hw.elsa.info;
  5917. + struct async_icount *icount;
  5918. +
  5919. + status = serial_inp(info, UART_MSR);
  5920. +
  5921. + if (status & UART_MSR_ANY_DELTA) {
  5922. + icount = &info->state->icount;
  5923. + /* update input line counters */
  5924. + if (status & UART_MSR_TERI)
  5925. + icount->rng++;
  5926. + if (status & UART_MSR_DDSR)
  5927. + icount->dsr++;
  5928. + if (status & UART_MSR_DDCD) {
  5929. + icount->dcd++;
  5930. + }
  5931. + if (status & UART_MSR_DCTS)
  5932. + icount->cts++;
  5933. +// wake_up(&info->delta_msr_wait);
  5934. + }
  5935. +
  5936. + if ((info->flags & ASYNC_CHECK_CD) && (status & UART_MSR_DDCD)) {
  5937. +#if (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR))
  5938. + printk("ttys%d CD now %s...", info->line,
  5939. + (status & UART_MSR_DCD) ? "on" : "off");
  5940. +#endif
  5941. + if (status & UART_MSR_DCD)
  5942. +// wake_up(&info->open_wait);
  5943. +;
  5944. + else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) &&
  5945. + (info->flags & ASYNC_CALLOUT_NOHUP))) {
  5946. +#ifdef SERIAL_DEBUG_OPEN
  5947. + printk("doing serial hangup...");
  5948. +#endif
  5949. + if (info->tty)
  5950. + tty_hangup(info->tty);
  5951. + }
  5952. + }
  5953. +#if 0
  5954. + if (info->flags & ASYNC_CTS_FLOW) {
  5955. + if (info->tty->hw_stopped) {
  5956. + if (status & UART_MSR_CTS) {
  5957. +#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
  5958. + printk("CTS tx start...");
  5959. +#endif
  5960. + info->tty->hw_stopped = 0;
  5961. + info->IER |= UART_IER_THRI;
  5962. + serial_outp(info, UART_IER, info->IER);
  5963. +// rs_sched_event(info, RS_EVENT_WRITE_WAKEUP);
  5964. + return;
  5965. + }
  5966. + } else {
  5967. + if (!(status & UART_MSR_CTS)) {
  5968. +#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
  5969. + printk("CTS tx stop...");
  5970. +#endif
  5971. + info->tty->hw_stopped = 1;
  5972. + info->IER &= ~UART_IER_THRI;
  5973. + serial_outp(info, UART_IER, info->IER);
  5974. + }
  5975. + }
  5976. + }
  5977. +#endif 0
  5978. +}
  5979. +#endif
  5980. static void rs_interrupt_elsa(int irq, struct IsdnCardState *cs)
  5981. {
  5982. Index: linux-2.4.35.4/drivers/isdn/hisax/fsm.c
  5983. ===================================================================
  5984. --- linux-2.4.35.4.orig/drivers/isdn/hisax/fsm.c
  5985. +++ linux-2.4.35.4/drivers/isdn/hisax/fsm.c
  5986. @@ -1,4 +1,4 @@
  5987. -/* $Id: fsm.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  5988. +/* $Id$
  5989. *
  5990. * Finite state machine
  5991. *
  5992. @@ -21,6 +21,14 @@
  5993. #define FSM_TIMER_DEBUG 0
  5994. +EXPORT_SYMBOL(FsmNew);
  5995. +EXPORT_SYMBOL(FsmFree);
  5996. +EXPORT_SYMBOL(FsmEvent);
  5997. +EXPORT_SYMBOL(FsmChangeState);
  5998. +EXPORT_SYMBOL(FsmInitTimer);
  5999. +EXPORT_SYMBOL(FsmDelTimer);
  6000. +EXPORT_SYMBOL(FsmRestartTimer);
  6001. +
  6002. int __init
  6003. FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount)
  6004. {
  6005. Index: linux-2.4.35.4/drivers/isdn/hisax/fsm.h
  6006. ===================================================================
  6007. --- linux-2.4.35.4.orig/drivers/isdn/hisax/fsm.h
  6008. +++ linux-2.4.35.4/drivers/isdn/hisax/fsm.h
  6009. @@ -1,4 +1,4 @@
  6010. -/* $Id: fsm.h,v 1.1.2.1 2001/11/20 14:19:35 kai Exp $
  6011. +/* $Id$
  6012. *
  6013. * Finite state machine
  6014. *
  6015. Index: linux-2.4.35.4/drivers/isdn/hisax/gazel.c
  6016. ===================================================================
  6017. --- linux-2.4.35.4.orig/drivers/isdn/hisax/gazel.c
  6018. +++ linux-2.4.35.4/drivers/isdn/hisax/gazel.c
  6019. @@ -1,4 +1,4 @@
  6020. -/* $Id: gazel.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  6021. +/* $Id: gazel.c,v 2.19 2001/09/24 13:22:56 kai Exp $
  6022. *
  6023. * low level stuff for Gazel isdn cards
  6024. *
  6025. @@ -20,9 +20,10 @@
  6026. #include "isdnl1.h"
  6027. #include "ipac.h"
  6028. #include <linux/pci.h>
  6029. +#include <linux/isdn_compat.h>
  6030. extern const char *CardType[];
  6031. -const char *gazel_revision = "$Revision: 1.1.4.1 $";
  6032. +const char *gazel_revision = "$Revision: 2.19 $";
  6033. #define R647 1
  6034. #define R685 2
  6035. @@ -563,8 +564,8 @@ setup_gazelpci(struct IsdnCardState *cs)
  6036. if (pci_enable_device(dev_tel))
  6037. return 1;
  6038. pci_irq = dev_tel->irq;
  6039. - pci_ioaddr0 = pci_resource_start(dev_tel, 1);
  6040. - pci_ioaddr1 = pci_resource_start(dev_tel, 2);
  6041. + pci_ioaddr0 = pci_resource_start_io(dev_tel, 1);
  6042. + pci_ioaddr1 = pci_resource_start_io(dev_tel, 2);
  6043. found = 1;
  6044. }
  6045. if (found)
  6046. Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_2bds0.c
  6047. ===================================================================
  6048. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_2bds0.c
  6049. +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_2bds0.c
  6050. @@ -1,4 +1,4 @@
  6051. -/* $Id: hfc_2bds0.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  6052. +/* $Id: hfc_2bds0.c,v 1.18 2001/09/24 13:22:56 kai Exp $
  6053. *
  6054. * specific routines for CCD's HFC 2BDS0
  6055. *
  6056. @@ -616,6 +616,17 @@ hfcd_bh(struct IsdnCardState *cs)
  6057. */
  6058. if (!cs)
  6059. return;
  6060. +#if 0
  6061. + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
  6062. + if (cs->debug)
  6063. + debugl1(cs, "D-Channel Busy cleared");
  6064. + stptr = cs->stlist;
  6065. + while (stptr != NULL) {
  6066. + stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL);
  6067. + stptr = stptr->next;
  6068. + }
  6069. + }
  6070. +#endif
  6071. if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
  6072. switch (cs->dc.hfcd.ph_state) {
  6073. case (0):
  6074. @@ -1090,6 +1101,32 @@ HFCD_l1hw(struct PStack *st, int pr, voi
  6075. cs->hw.hfcD.mst_m |= HFCD_MASTER;
  6076. cs->writeisac(cs, HFCD_MST_MODE, cs->hw.hfcD.mst_m);
  6077. break;
  6078. +#if 0
  6079. + case (HW_TESTLOOP | REQUEST):
  6080. + u_char val = 0;
  6081. + if (1 & (int) arg)
  6082. + val |= 0x0c;
  6083. + if (2 & (int) arg)
  6084. + val |= 0x3;
  6085. + if (test_bit(HW_IOM1, &cs->HW_Flags)) {
  6086. + /* IOM 1 Mode */
  6087. + if (!val) {
  6088. + cs->writeisac(cs, ISAC_SPCR, 0xa);
  6089. + cs->writeisac(cs, ISAC_ADF1, 0x2);
  6090. + } else {
  6091. + cs->writeisac(cs, ISAC_SPCR, val);
  6092. + cs->writeisac(cs, ISAC_ADF1, 0xa);
  6093. + }
  6094. + } else {
  6095. + /* IOM 2 Mode */
  6096. + cs->writeisac(cs, ISAC_SPCR, val);
  6097. + if (val)
  6098. + cs->writeisac(cs, ISAC_ADF1, 0x8);
  6099. + else
  6100. + cs->writeisac(cs, ISAC_ADF1, 0x0);
  6101. + }
  6102. + break;
  6103. +#endif
  6104. default:
  6105. if (cs->debug & L1_DEB_WARN)
  6106. debugl1(cs, "hfcd_l1hw unknown pr %4x", pr);
  6107. @@ -1106,6 +1143,20 @@ setstack_hfcd(struct PStack *st, struct
  6108. static void
  6109. hfc_dbusy_timer(struct IsdnCardState *cs)
  6110. {
  6111. +#if 0
  6112. + struct PStack *stptr;
  6113. + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
  6114. + if (cs->debug)
  6115. + debugl1(cs, "D-Channel Busy");
  6116. + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
  6117. + stptr = cs->stlist;
  6118. +
  6119. + while (stptr != NULL) {
  6120. + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
  6121. + stptr = stptr->next;
  6122. + }
  6123. + }
  6124. +#endif
  6125. }
  6126. unsigned int __init
  6127. Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_2bds0.h
  6128. ===================================================================
  6129. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_2bds0.h
  6130. +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_2bds0.h
  6131. @@ -1,4 +1,4 @@
  6132. -/* $Id: hfc_2bds0.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  6133. +/* $Id: hfc_2bds0.h,v 1.6 2001/09/24 13:22:56 kai Exp $
  6134. *
  6135. * specific defines for CCD's HFC 2BDS0
  6136. *
  6137. Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_2bs0.c
  6138. ===================================================================
  6139. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_2bs0.c
  6140. +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_2bs0.c
  6141. @@ -1,4 +1,4 @@
  6142. -/* $Id: hfc_2bs0.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  6143. +/* $Id: hfc_2bs0.c,v 1.20 2001/09/24 13:22:56 kai Exp $
  6144. *
  6145. * specific routines for CCD's HFC 2BS0
  6146. *
  6147. Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_2bs0.h
  6148. ===================================================================
  6149. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_2bs0.h
  6150. +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_2bs0.h
  6151. @@ -1,4 +1,4 @@
  6152. -/* $Id: hfc_2bs0.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  6153. +/* $Id: hfc_2bs0.h,v 1.5 2001/09/24 13:22:56 kai Exp $
  6154. *
  6155. * specific defines for CCD's HFC 2BS0
  6156. *
  6157. Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_pci.c
  6158. ===================================================================
  6159. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_pci.c
  6160. +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_pci.c
  6161. @@ -1,4 +1,4 @@
  6162. -/* $Id: hfc_pci.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  6163. +/* $Id: hfc_pci.c,v 1.48 2001/09/24 13:22:56 kai Exp $
  6164. *
  6165. * low level driver for CCD´s hfc-pci based cards
  6166. *
  6167. @@ -22,11 +22,12 @@
  6168. #include "hfc_pci.h"
  6169. #include "isdnl1.h"
  6170. #include <linux/pci.h>
  6171. +#include <linux/isdn_compat.h>
  6172. #include <linux/interrupt.h>
  6173. extern const char *CardType[];
  6174. -static const char *hfcpci_revision = "$Revision: 1.1.4.1 $";
  6175. +static const char *hfcpci_revision = "$Revision: 1.48 $";
  6176. /* table entry in the PCI devices list */
  6177. typedef struct {
  6178. @@ -76,8 +77,6 @@ release_io_hfcpci(struct IsdnCardState *
  6179. {
  6180. unsigned long flags;
  6181. - printk(KERN_INFO "HiSax: release hfcpci at %p\n",
  6182. - cs->hw.hfcpci.pci_io);
  6183. save_flags(flags);
  6184. cli();
  6185. cs->hw.hfcpci.int_m2 = 0; /* interrupt output off ! */
  6186. @@ -88,11 +87,13 @@ release_io_hfcpci(struct IsdnCardState *
  6187. set_current_state(TASK_UNINTERRUPTIBLE);
  6188. schedule_timeout((30 * HZ) / 1000); /* Timeout 30ms */
  6189. Write_hfc(cs, HFCPCI_CIRM, 0); /* Reset Off */
  6190. +#if CONFIG_PCI
  6191. pcibios_write_config_word(cs->hw.hfcpci.pci_bus, cs->hw.hfcpci.pci_device_fn, PCI_COMMAND, 0); /* disable memory mapped ports + busmaster */
  6192. +#endif /* CONFIG_PCI */
  6193. del_timer(&cs->hw.hfcpci.timer);
  6194. kfree(cs->hw.hfcpci.share_start);
  6195. cs->hw.hfcpci.share_start = NULL;
  6196. - iounmap((void *)cs->hw.hfcpci.pci_io);
  6197. + vfree(cs->hw.hfcpci.pci_io);
  6198. }
  6199. /********************************************************************************/
  6200. @@ -687,10 +688,6 @@ hfcpci_fill_fifo(struct BCState *bcs)
  6201. debugl1(cs, "hfcpci_fill_fifo_trans %d frame length %d discarded",
  6202. bcs->channel, bcs->tx_skb->len);
  6203. - if (bcs->st->lli.l1writewakeup &&
  6204. - (PACKET_NOACK != bcs->tx_skb->pkt_type))
  6205. - bcs->st->lli.l1writewakeup(bcs->st, bcs->tx_skb->len);
  6206. -
  6207. dev_kfree_skb_any(bcs->tx_skb);
  6208. cli();
  6209. bcs->tx_skb = skb_dequeue(&bcs->squeue); /* fetch next data */
  6210. @@ -1146,6 +1143,20 @@ hfcpci_interrupt(int intno, void *dev_id
  6211. static void
  6212. hfcpci_dbusy_timer(struct IsdnCardState *cs)
  6213. {
  6214. +#if 0
  6215. + struct PStack *stptr;
  6216. + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
  6217. + if (cs->debug)
  6218. + debugl1(cs, "D-Channel Busy");
  6219. + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
  6220. + stptr = cs->stlist;
  6221. +
  6222. + while (stptr != NULL) {
  6223. + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
  6224. + stptr = stptr->next;
  6225. + }
  6226. + }
  6227. +#endif
  6228. }
  6229. /*************************************/
  6230. @@ -1550,6 +1561,17 @@ hfcpci_bh(struct IsdnCardState *cs)
  6231. */
  6232. if (!cs)
  6233. return;
  6234. +#if 0
  6235. + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
  6236. + if (cs->debug)
  6237. + debugl1(cs, "D-Channel Busy cleared");
  6238. + stptr = cs->stlist;
  6239. + while (stptr != NULL) {
  6240. + stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL);
  6241. + stptr = stptr->next;
  6242. + }
  6243. + }
  6244. +#endif
  6245. if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
  6246. if (!cs->hw.hfcpci.nt_mode)
  6247. switch (cs->dc.hfcpci.ph_state) {
  6248. @@ -1712,7 +1734,7 @@ setup_hfcpci(struct IsdnCard *card)
  6249. if (pci_enable_device(tmp_hfcpci))
  6250. continue;
  6251. pci_set_master(tmp_hfcpci);
  6252. - if ((card->para[0]) && (card->para[0] != (tmp_hfcpci->resource[ 0].start & PCI_BASE_ADDRESS_IO_MASK)))
  6253. + if ((card->para[0]) && (card->para[0] != (get_pcibase(tmp_hfcpci, 0) & PCI_BASE_ADDRESS_IO_MASK)))
  6254. continue;
  6255. else
  6256. break;
  6257. @@ -1729,7 +1751,7 @@ setup_hfcpci(struct IsdnCard *card)
  6258. printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
  6259. return (0);
  6260. }
  6261. - cs->hw.hfcpci.pci_io = (char *) dev_hfcpci->resource[ 1].start;
  6262. + cs->hw.hfcpci.pci_io = (char *) get_pcibase(dev_hfcpci, 1);
  6263. printk(KERN_INFO "HiSax: HFC-PCI card manufacturer: %s card name: %s\n", id_list[i].vendor_name, id_list[i].card_name);
  6264. } else {
  6265. printk(KERN_WARNING "HFC-PCI: No PCI card found\n");
  6266. @@ -1746,7 +1768,7 @@ setup_hfcpci(struct IsdnCard *card)
  6267. printk(KERN_WARNING "HFC-PCI: Error allocating memory for FIFO!\n");
  6268. return 0;
  6269. }
  6270. - cs->hw.hfcpci.fifos = (void *)
  6271. + (ulong) cs->hw.hfcpci.fifos =
  6272. (((ulong) cs->hw.hfcpci.share_start) & ~0x7FFF) + 0x8000;
  6273. pcibios_write_config_dword(cs->hw.hfcpci.pci_bus,
  6274. cs->hw.hfcpci.pci_device_fn, 0x80,
  6275. Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_pci.h
  6276. ===================================================================
  6277. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_pci.h
  6278. +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_pci.h
  6279. @@ -1,4 +1,4 @@
  6280. -/* $Id: hfc_pci.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  6281. +/* $Id: hfc_pci.h,v 1.10 2001/09/24 13:22:56 kai Exp $
  6282. *
  6283. * specific defines for CCD's HFC 2BDS0 PCI chips
  6284. *
  6285. Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_sx.c
  6286. ===================================================================
  6287. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_sx.c
  6288. +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_sx.c
  6289. @@ -1,4 +1,4 @@
  6290. -/* $Id: hfc_sx.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  6291. +/* $Id: hfc_sx.c,v 1.12 2001/09/24 13:22:56 kai Exp $
  6292. *
  6293. * level driver for CCD´s hfc-s+/sp based cards
  6294. *
  6295. @@ -17,11 +17,10 @@
  6296. #include "hfc_sx.h"
  6297. #include "isdnl1.h"
  6298. #include <linux/interrupt.h>
  6299. -#include <linux/isapnp.h>
  6300. extern const char *CardType[];
  6301. -static const char *hfcsx_revision = "$Revision: 1.1.4.1 $";
  6302. +static const char *hfcsx_revision = "$Revision: 1.12 $";
  6303. /***************************************/
  6304. /* IRQ-table for CCDs demo board */
  6305. @@ -940,6 +939,20 @@ hfcsx_interrupt(int intno, void *dev_id,
  6306. static void
  6307. hfcsx_dbusy_timer(struct IsdnCardState *cs)
  6308. {
  6309. +#if 0
  6310. + struct PStack *stptr;
  6311. + if (test_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) {
  6312. + if (cs->debug)
  6313. + debugl1(cs, "D-Channel Busy");
  6314. + test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags);
  6315. + stptr = cs->stlist;
  6316. +
  6317. + while (stptr != NULL) {
  6318. + stptr->l1.l1l2(stptr, PH_PAUSE | INDICATION, NULL);
  6319. + stptr = stptr->next;
  6320. + }
  6321. + }
  6322. +#endif
  6323. }
  6324. /*************************************/
  6325. @@ -1333,6 +1346,17 @@ hfcsx_bh(struct IsdnCardState *cs)
  6326. */
  6327. if (!cs)
  6328. return;
  6329. +#if 0
  6330. + if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) {
  6331. + if (cs->debug)
  6332. + debugl1(cs, "D-Channel Busy cleared");
  6333. + stptr = cs->stlist;
  6334. + while (stptr != NULL) {
  6335. + stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL);
  6336. + stptr = stptr->next;
  6337. + }
  6338. + }
  6339. +#endif
  6340. if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
  6341. if (!cs->hw.hfcsx.nt_mode)
  6342. switch (cs->dc.hfcsx.ph_state) {
  6343. @@ -1461,17 +1485,7 @@ hfcsx_card_msg(struct IsdnCardState *cs,
  6344. return (0);
  6345. }
  6346. -#ifdef __ISAPNP__
  6347. -static struct isapnp_device_id hfc_ids[] __initdata = {
  6348. - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2620),
  6349. - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2620),
  6350. - (unsigned long) "Teles 16.3c2" },
  6351. - { 0, }
  6352. -};
  6353. -static struct isapnp_device_id *hdev = &hfc_ids[0];
  6354. -static struct pci_bus *pnp_c __devinitdata = NULL;
  6355. -#endif
  6356. int __devinit
  6357. setup_hfcsx(struct IsdnCard *card)
  6358. @@ -1482,45 +1496,6 @@ setup_hfcsx(struct IsdnCard *card)
  6359. strcpy(tmp, hfcsx_revision);
  6360. printk(KERN_INFO "HiSax: HFC-SX driver Rev. %s\n", HiSax_getrev(tmp));
  6361. -#ifdef __ISAPNP__
  6362. - if (!card->para[1] && isapnp_present()) {
  6363. - struct pci_bus *pb;
  6364. - struct pci_dev *pd;
  6365. -
  6366. - while(hdev->card_vendor) {
  6367. - if ((pb = isapnp_find_card(hdev->card_vendor,
  6368. - hdev->card_device, pnp_c))) {
  6369. - pnp_c = pb;
  6370. - pd = NULL;
  6371. - if ((pd = isapnp_find_dev(pnp_c,
  6372. - hdev->vendor, hdev->function, pd))) {
  6373. - printk(KERN_INFO "HiSax: %s detected\n",
  6374. - (char *)hdev->driver_data);
  6375. - pd->prepare(pd);
  6376. - pd->deactivate(pd);
  6377. - pd->activate(pd);
  6378. - card->para[1] = pd->resource[0].start;
  6379. - card->para[0] = pd->irq_resource[0].start;
  6380. - if (!card->para[0] || !card->para[1]) {
  6381. - printk(KERN_ERR "HFC PnP:some resources are missing %ld/%lx\n",
  6382. - card->para[0], card->para[1]);
  6383. - pd->deactivate(pd);
  6384. - return(0);
  6385. - }
  6386. - break;
  6387. - } else {
  6388. - printk(KERN_ERR "HFC PnP: PnP error card found, no device\n");
  6389. - }
  6390. - }
  6391. - hdev++;
  6392. - pnp_c=NULL;
  6393. - }
  6394. - if (!hdev->card_vendor) {
  6395. - printk(KERN_INFO "HFC PnP: no ISAPnP card found\n");
  6396. - return(0);
  6397. - }
  6398. - }
  6399. -#endif
  6400. cs->hw.hfcsx.base = card->para[1] & 0xfffe;
  6401. cs->irq = card->para[0];
  6402. cs->hw.hfcsx.int_s1 = 0;
  6403. @@ -1603,3 +1578,7 @@ setup_hfcsx(struct IsdnCard *card)
  6404. cs->auxcmd = &hfcsx_auxcmd;
  6405. return (1);
  6406. }
  6407. +
  6408. +
  6409. +
  6410. +
  6411. Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_sx.h
  6412. ===================================================================
  6413. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfc_sx.h
  6414. +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_sx.h
  6415. @@ -1,4 +1,4 @@
  6416. -/* $Id: hfc_sx.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  6417. +/* $Id$
  6418. *
  6419. * specific defines for CCD's HFC 2BDS0 S+,SP chips
  6420. *
  6421. Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_usb.c
  6422. ===================================================================
  6423. --- /dev/null
  6424. +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_usb.c
  6425. @@ -0,0 +1,1189 @@
  6426. +/* $Id: hfc_usb.c,v 2.3 2001/07/06 21:30:11 werner Exp $
  6427. + *
  6428. + *
  6429. + *
  6430. + * Author (C) 2001 Werner Cornelius ([email protected])
  6431. + * modular driver for Colognechip HFC-USB chip
  6432. + * as plugin for HiSax isdn driver
  6433. + * type approval valid for HFC-S USB based TAs
  6434. + *
  6435. + * Copyright 2001 by Werner Cornelius ([email protected])
  6436. + *
  6437. + * This program is free software; you can redistribute it and/or modify
  6438. + * it under the terms of the GNU General Public License as published by
  6439. + * the Free Software Foundation; either version 2, or (at your option)
  6440. + * any later version.
  6441. + *
  6442. + * This program is distributed in the hope that it will be useful,
  6443. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  6444. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  6445. + * GNU General Public License for more details.
  6446. + *
  6447. + * You should have received a copy of the GNU General Public License
  6448. + * along with this program; if not, write to the Free Software
  6449. + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  6450. + *
  6451. + */
  6452. +
  6453. +#include <linux/types.h>
  6454. +#include <linux/stddef.h>
  6455. +#include <linux/timer.h>
  6456. +#include <linux/config.h>
  6457. +#include <linux/isdn_compat.h>
  6458. +#include <linux/init.h>
  6459. +#include "hisax.h"
  6460. +#include <linux/module.h>
  6461. +#include <linux/kernel_stat.h>
  6462. +#include <linux/tqueue.h>
  6463. +#include <linux/usb.h>
  6464. +#include <linux/kernel.h>
  6465. +#include <linux/smp_lock.h>
  6466. +#include <linux/sched.h>
  6467. +#include "hisax_loadable.h"
  6468. +
  6469. +#define INCLUDE_INLINE_FUNCS
  6470. +
  6471. +/***********/
  6472. +/* defines */
  6473. +/***********/
  6474. +#define HFC_CTRL_TIMEOUT 5 /* 5ms timeout writing/reading regs */
  6475. +#define HFC_TIMER_T3 7000 /* timeout for l1 activation timer */
  6476. +
  6477. +#define HFCUSB_L1_STATECHANGE 0 /* L1 state changed */
  6478. +#define HFCUSB_L1_DRX 1 /* D-frame received */
  6479. +#define HFCUSB_L1_ERX 2 /* E-frame received */
  6480. +#define HFCUSB_L1_DTX 4 /* D-frames completed */
  6481. +
  6482. +#define MAX_BCH_SIZE 2048 /* allowed B-channel packet size */
  6483. +
  6484. +#define HFCUSB_RX_THRESHOLD 64 /* threshold for fifo report bit rx */
  6485. +#define HFCUSB_TX_THRESHOLD 64 /* threshold for fifo report bit tx */
  6486. +
  6487. +#define HFCUSB_CHIP_ID 0x16 /* Chip ID register index */
  6488. +#define HFCUSB_CIRM 0x00 /* cirm register index */
  6489. +#define HFCUSB_USB_SIZE 0x07 /* int length register */
  6490. +#define HFCUSB_USB_SIZE_I 0x06 /* iso length register */
  6491. +#define HFCUSB_F_CROSS 0x0b /* bit order register */
  6492. +#define HFCUSB_CLKDEL 0x37 /* bit delay register */
  6493. +#define HFCUSB_CON_HDLC 0xfa /* channel connect register */
  6494. +#define HFCUSB_HDLC_PAR 0xfb
  6495. +#define HFCUSB_SCTRL 0x31 /* S-bus control register (tx) */
  6496. +#define HFCUSB_SCTRL_E 0x32 /* same for E and special funcs */
  6497. +#define HFCUSB_SCTRL_R 0x33 /* S-bus control register (rx) */
  6498. +#define HFCUSB_F_THRES 0x0c /* threshold register */
  6499. +#define HFCUSB_FIFO 0x0f /* fifo select register */
  6500. +#define HFCUSB_F_USAGE 0x1a /* fifo usage register */
  6501. +#define HFCUSB_MST_MODE0 0x14
  6502. +#define HFCUSB_MST_MODE1 0x15
  6503. +#define HFCUSB_P_DATA 0x1f
  6504. +#define HFCUSB_INC_RES_F 0x0e
  6505. +#define HFCUSB_STATES 0x30
  6506. +
  6507. +#define HFCUSB_CHIPID 0x40 /* ID value of HFC-USB */
  6508. +
  6509. +/******************/
  6510. +/* fifo registers */
  6511. +/******************/
  6512. +#define HFCUSB_NUM_FIFOS 8 /* maximum number of fifos */
  6513. +#define HFCUSB_B1_TX 0 /* index for B1 transmit bulk/int */
  6514. +#define HFCUSB_B1_RX 1 /* index for B1 receive bulk/int */
  6515. +#define HFCUSB_B2_TX 2
  6516. +#define HFCUSB_B2_RX 3
  6517. +#define HFCUSB_D_TX 4
  6518. +#define HFCUSB_D_RX 5
  6519. +#define HFCUSB_PCM_TX 6
  6520. +#define HFCUSB_PCM_RX 7
  6521. +
  6522. +/************/
  6523. +/* LED mask */
  6524. +/************/
  6525. +#define LED_DRIVER 0x1
  6526. +#define LED_L1 0x2
  6527. +#define LED_BCH 0x4
  6528. +
  6529. +/**********/
  6530. +/* macros */
  6531. +/**********/
  6532. +#define Write_hfc(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),0,0,HFC_CTRL_TIMEOUT)
  6533. +#define Read_hfc(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_in_pipe,1,0xC0,0,(b),(c),1,HFC_CTRL_TIMEOUT)
  6534. +
  6535. +#ifdef COMPAT_HAS_USB_IDTAB
  6536. +/****************************************/
  6537. +/* data defining the devices to be used */
  6538. +/****************************************/
  6539. +static __devinitdata const struct usb_device_id hfc_usb_idtab[3] = {
  6540. + {USB_DEVICE(0x959, 0x2bd0)}, /* Colognechip ROM */
  6541. + {USB_DEVICE(0x7b0, 0x0006)}, /* USB TA 128 */
  6542. + {} /* end with an all-zeroes entry */
  6543. +};
  6544. +#endif
  6545. +
  6546. +/*************************************************/
  6547. +/* entry and size of output/input control buffer */
  6548. +/*************************************************/
  6549. +#define HFC_CTRL_BUFSIZE 32
  6550. +typedef struct {
  6551. + __u8 hfc_reg; /* register number */
  6552. + __u8 reg_val; /* value to be written (or read) */
  6553. +} ctrl_buft;
  6554. +
  6555. +/***************************************************************/
  6556. +/* structure defining input+output fifos (interrupt/bulk mode) */
  6557. +/***************************************************************/
  6558. +struct hfcusb_data; /* forward definition */
  6559. +typedef struct {
  6560. + int fifonum; /* fifo index attached to this structure */
  6561. + __u8 fifo_mask; /* mask for this fifo */
  6562. + int active; /* fifo is currently active */
  6563. + struct hfcusb_data *hfc; /* pointer to main structure */
  6564. + int pipe; /* address of endpoint */
  6565. + __u8 usb_maxlen; /* maximum length for usb transfer */
  6566. + int max_size; /* maximum size of receive/send packet */
  6567. + int transmode; /* transparent mode selected */
  6568. + int framenum; /* number of frame when last tx completed */
  6569. + int rx_offset; /* offset inside rx buffer */
  6570. + int next_complete; /* complete marker */
  6571. + __u8 *act_ptr; /* pointer to next data */
  6572. + __u8 intervall; /* interrupt interval */
  6573. + struct sk_buff *buff; /* actual used buffer */
  6574. + urb_t urb; /* transfer structure for usb routines */
  6575. + __u8 buffer[128]; /* buffer incoming/outgoing data */
  6576. +} usb_fifo;
  6577. +
  6578. +/*********************************************/
  6579. +/* structure holding all data for one device */
  6580. +/*********************************************/
  6581. +typedef struct hfcusb_data {
  6582. + struct hisax_drvreg regd; /* register data and callbacks */
  6583. + struct usb_device *dev; /* our device */
  6584. + int if_used; /* used interface number */
  6585. + int alt_used; /* used alternate config */
  6586. + int ctrl_paksize; /* control pipe packet size */
  6587. + int ctrl_in_pipe, ctrl_out_pipe; /* handles for control pipe */
  6588. +
  6589. + /* control pipe background handling */
  6590. + ctrl_buft ctrl_buff[HFC_CTRL_BUFSIZE]; /* buffer holding queued data */
  6591. + volatile int ctrl_in_idx, ctrl_out_idx, ctrl_cnt; /* input/output pointer + count */
  6592. + urb_t ctrl_urb; /* transfer structure for control channel */
  6593. + devrequest ctrl_write; /* buffer for control write request */
  6594. + devrequest ctrl_read; /* same for read request */
  6595. +
  6596. + volatile __u8 dfifo_fill; /* value read from tx d-fifo */
  6597. + volatile __u8 active_fifos; /* fifos currently active as bit mask */
  6598. + volatile __u8 threshold_mask; /* threshold actually reported */
  6599. + volatile __u8 service_request; /* fifo needs service from task */
  6600. + volatile __u8 ctrl_fifo; /* last selected fifo */
  6601. + volatile __u8 bch_enables; /* or mask for sctrl_r and sctrl register values */
  6602. + volatile __u8 led_req; /* request status of adapters leds */
  6603. + volatile __u8 led_act; /* active status of adapters leds */
  6604. + usb_fifo fifos[HFCUSB_NUM_FIFOS]; /* structure holding all fifo data */
  6605. +
  6606. + /* layer 1 activation/deactivation handling */
  6607. + volatile __u8 l1_state; /* actual l1 state */
  6608. + volatile ulong l1_event; /* event mask */
  6609. + struct tq_struct l1_tq; /* l1 bh structure */
  6610. + struct timer_list t3_timer; /* timer for activation/deactivation */
  6611. + struct timer_list t4_timer; /* timer for activation/deactivation */
  6612. +} hfcusb_data;
  6613. +
  6614. +#if 0
  6615. +static void
  6616. +usb_dump_urb(purb_t purb)
  6617. +{
  6618. + printk("urb :%p\n", purb);
  6619. + printk("next :%p\n", purb->next);
  6620. + printk("dev :%p\n", purb->dev);
  6621. + printk("pipe :%08X\n", purb->pipe);
  6622. + printk("status :%d\n", purb->status);
  6623. + printk("transfer_flags :%08X\n", purb->transfer_flags);
  6624. + printk("transfer_buffer :%p\n", purb->transfer_buffer);
  6625. + printk("transfer_buffer_length:%d\n",
  6626. + purb->transfer_buffer_length);
  6627. + printk("actual_length :%d\n", purb->actual_length);
  6628. + printk("setup_packet :%p\n", purb->setup_packet);
  6629. + printk("start_frame :%d\n", purb->start_frame);
  6630. + printk("number_of_packets :%d\n", purb->number_of_packets);
  6631. + printk("interval :%d\n", purb->interval);
  6632. + printk("error_count :%d\n", purb->error_count);
  6633. + printk("context :%p\n", purb->context);
  6634. + printk("complete :%p\n", purb->complete);
  6635. +}
  6636. +#endif
  6637. +
  6638. +/*************************************************************************/
  6639. +/* bottom half handler for L1 activation/deactiavtaion + D-chan + E-chan */
  6640. +/*************************************************************************/
  6641. +static void
  6642. +usb_l1d_bh(hfcusb_data * hfc)
  6643. +{
  6644. +
  6645. + while (hfc->l1_event) {
  6646. + if (test_and_clear_bit
  6647. + (HFCUSB_L1_STATECHANGE, &hfc->l1_event)) {
  6648. + if (hfc->l1_state == 7)
  6649. + hfc->led_req |= LED_L1;
  6650. + else
  6651. + hfc->led_req &= ~LED_L1;
  6652. + if ((hfc->l1_state == 7) ||
  6653. + (hfc->l1_state == 3))
  6654. + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
  6655. + (hfc->l1_state ==
  6656. + 7) ? (PH_ACTIVATE |
  6657. + INDICATION)
  6658. + : (PH_DEACTIVATE | INDICATION),
  6659. + NULL);
  6660. + }
  6661. + if (test_and_clear_bit(HFCUSB_L1_DRX, &hfc->l1_event)) {
  6662. + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
  6663. + PH_DATA | INDICATION,
  6664. + (void *) 0);
  6665. + }
  6666. + if (test_and_clear_bit(HFCUSB_L1_ERX, &hfc->l1_event)) {
  6667. + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
  6668. + PH_DATA | INDICATION,
  6669. + (void *) 1);
  6670. + }
  6671. + if (test_and_clear_bit(HFCUSB_L1_DTX, &hfc->l1_event)) {
  6672. + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
  6673. + PH_DATA | CONFIRM, NULL);
  6674. + }
  6675. + } /* while */
  6676. +} /* usb_l1d_bh */
  6677. +
  6678. +/******************************************************/
  6679. +/* start next background transfer for control channel */
  6680. +/******************************************************/
  6681. +static void
  6682. +ctrl_start_transfer(hfcusb_data * hfc)
  6683. +{
  6684. +
  6685. + if (hfc->ctrl_cnt) {
  6686. + switch (hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg) {
  6687. + case HFCUSB_F_USAGE:
  6688. + hfc->ctrl_urb.pipe = hfc->ctrl_in_pipe;
  6689. + hfc->ctrl_urb.setup_packet =
  6690. + (u_char *) & hfc->ctrl_read;
  6691. + hfc->ctrl_urb.transfer_buffer_length = 1;
  6692. + hfc->ctrl_read.index =
  6693. + hfc->ctrl_buff[hfc->ctrl_out_idx].
  6694. + hfc_reg;
  6695. + hfc->ctrl_urb.transfer_buffer =
  6696. + (char *) &hfc->dfifo_fill;
  6697. + break;
  6698. +
  6699. + default: /* write register */
  6700. + hfc->ctrl_urb.pipe = hfc->ctrl_out_pipe;
  6701. + hfc->ctrl_urb.setup_packet =
  6702. + (u_char *) & hfc->ctrl_write;
  6703. + hfc->ctrl_urb.transfer_buffer = NULL;
  6704. + hfc->ctrl_urb.transfer_buffer_length = 0;
  6705. + hfc->ctrl_write.index =
  6706. + hfc->ctrl_buff[hfc->ctrl_out_idx].
  6707. + hfc_reg;
  6708. + hfc->ctrl_write.value =
  6709. + hfc->ctrl_buff[hfc->ctrl_out_idx].
  6710. + reg_val;
  6711. + break;
  6712. + }
  6713. + usb_submit_urb(&hfc->ctrl_urb); /* start transfer */
  6714. + }
  6715. +} /* ctrl_start_transfer */
  6716. +
  6717. +/************************************/
  6718. +/* queue a control transfer request */
  6719. +/* return 0 on success. */
  6720. +/************************************/
  6721. +static int
  6722. +queue_control_request(hfcusb_data * hfc, __u8 reg, __u8 val)
  6723. +{
  6724. + ctrl_buft *buf;
  6725. +
  6726. + if (hfc->ctrl_cnt >= HFC_CTRL_BUFSIZE)
  6727. + return (1); /* no space left */
  6728. + buf = hfc->ctrl_buff + hfc->ctrl_in_idx; /* pointer to new index */
  6729. + buf->hfc_reg = reg;
  6730. + buf->reg_val = val;
  6731. + if (++hfc->ctrl_in_idx >= HFC_CTRL_BUFSIZE)
  6732. + hfc->ctrl_in_idx = 0; /* pointer wrap */
  6733. + if (++hfc->ctrl_cnt == 1)
  6734. + ctrl_start_transfer(hfc);
  6735. + return (0);
  6736. +} /* queue_control_request */
  6737. +
  6738. +/**************************************/
  6739. +/* called when timer t3 or t4 expires */
  6740. +/**************************************/
  6741. +static void
  6742. +l1_timer_expire(hfcusb_data * hfc)
  6743. +{
  6744. + if (timer_pending(&hfc->t4_timer))
  6745. + del_timer(&hfc->t4_timer);
  6746. + queue_control_request(hfc, HFCUSB_STATES, 0x40);
  6747. + test_and_set_bit(HFCUSB_L1_STATECHANGE,
  6748. + &hfc->l1_event);
  6749. + queue_task(&hfc->l1_tq, &tq_immediate);
  6750. + mark_bh(IMMEDIATE_BH);
  6751. +} /* l1_timer_expire */
  6752. +
  6753. +/**************************************************/
  6754. +/* (re)fills a tx-fifo urb. Queuing is done later */
  6755. +/**************************************************/
  6756. +static void
  6757. +fill_tx_urb(usb_fifo * fifo)
  6758. +{
  6759. + struct sk_buff *skb;
  6760. + long flags;
  6761. + int i, ii = 0;
  6762. +
  6763. + fifo->urb.dev = fifo->hfc->dev;
  6764. + if ((fifo->buff)
  6765. + && (fifo->urb.transfer_buffer_length < fifo->usb_maxlen)) {
  6766. + switch (fifo->fifonum) {
  6767. + case HFCUSB_B1_TX:
  6768. + case HFCUSB_B2_TX:
  6769. + skb = fifo->buff;
  6770. + fifo->buff = NULL;
  6771. + fifo->hfc->regd.bch_l1l2(fifo->hfc->regd.
  6772. + arg_hisax,
  6773. + (fifo->fifonum ==
  6774. + HFCUSB_B1_TX) ? 0
  6775. + : 1,
  6776. + (PH_DATA |
  6777. + CONFIRM),
  6778. + (void *) skb);
  6779. + fifo->hfc->service_request |=
  6780. + fifo->fifo_mask;
  6781. + return;
  6782. + case HFCUSB_D_TX:
  6783. + dev_kfree_skb_any(fifo->buff);
  6784. + fifo->buff = NULL;
  6785. + save_flags(flags);
  6786. + cli();
  6787. + fifo->hfc->dfifo_fill = 0xff; /* currently invalid data */
  6788. + queue_control_request(fifo->hfc,
  6789. + HFCUSB_FIFO,
  6790. + HFCUSB_D_TX);
  6791. + queue_control_request(fifo->hfc,
  6792. + HFCUSB_F_USAGE, 0);
  6793. + restore_flags(flags);
  6794. + return;
  6795. + default:
  6796. + return; /* error, invalid fifo */
  6797. + }
  6798. + }
  6799. +
  6800. + /* check if new buffer needed */
  6801. + if (!fifo->buff) {
  6802. + switch (fifo->fifonum) {
  6803. + case HFCUSB_B1_TX:
  6804. + if (fifo->hfc->regd.bsk[0])
  6805. + fifo->buff = *fifo->hfc->regd.bsk[0]; /* B1-channel tx buffer */
  6806. + break;
  6807. + case HFCUSB_B2_TX:
  6808. + if (fifo->hfc->regd.bsk[1])
  6809. + fifo->buff = *fifo->hfc->regd.bsk[1]; /* B2-channel tx buffer */
  6810. + break;
  6811. + case HFCUSB_D_TX:
  6812. + if (fifo->hfc->regd.dsq)
  6813. + fifo->buff = skb_dequeue(fifo->hfc->regd.dsq); /* D-channel tx queue */
  6814. + break;
  6815. + default:
  6816. + return; /* error, invalid fifo */
  6817. + }
  6818. + if (!fifo->buff) {
  6819. + fifo->active = 0; /* we are inactive now */
  6820. + fifo->hfc->active_fifos &= ~fifo->fifo_mask;
  6821. + if (fifo->fifonum == HFCUSB_D_TX) {
  6822. + test_and_set_bit(HFCUSB_L1_DTX,
  6823. + &fifo->hfc->l1_event);
  6824. + queue_task(&fifo->hfc->l1_tq,
  6825. + &tq_immediate);
  6826. + mark_bh(IMMEDIATE_BH);
  6827. + }
  6828. + return;
  6829. + }
  6830. + fifo->act_ptr = fifo->buff->data; /* start of data */
  6831. + fifo->active = 1;
  6832. + ii = 1;
  6833. + fifo->hfc->active_fifos |= fifo->fifo_mask;
  6834. + fifo->hfc->service_request &= ~fifo->fifo_mask;
  6835. + }
  6836. + /* fillup the send buffer */
  6837. + i = fifo->buff->len - (fifo->act_ptr - fifo->buff->data); /* remaining length */
  6838. + fifo->buffer[0] = !fifo->transmode; /* not eof */
  6839. + if (i > (fifo->usb_maxlen - ii)) {
  6840. + i = fifo->usb_maxlen - ii;
  6841. + }
  6842. + if (i)
  6843. + memcpy(fifo->buffer + ii, fifo->act_ptr, i);
  6844. + fifo->urb.transfer_buffer_length = i + ii;
  6845. + fifo->rx_offset = ii;
  6846. +} /* fill_tx_urb */
  6847. +
  6848. +/************************************************/
  6849. +/* transmit completion routine for all tx fifos */
  6850. +/************************************************/
  6851. +static void
  6852. +tx_complete(purb_t urb)
  6853. +{
  6854. + usb_fifo *fifo = (usb_fifo *) urb->context; /* pointer to our fifo */
  6855. +
  6856. + fifo->hfc->service_request &= ~fifo->fifo_mask; /* no further handling */
  6857. + fifo->framenum = usb_get_current_frame_number(fifo->hfc->dev);
  6858. +
  6859. + /* check for deactivation or error */
  6860. + if ((!fifo->active) || (urb->status)) {
  6861. + fifo->hfc->active_fifos &= ~fifo->fifo_mask; /* we are inactive */
  6862. + fifo->active = 0;
  6863. + if ((fifo->buff) && (fifo->fifonum == HFCUSB_D_TX)) {
  6864. + dev_kfree_skb_any(fifo->buff);
  6865. + }
  6866. + fifo->buff = NULL;
  6867. + return;
  6868. + }
  6869. + fifo->act_ptr += (urb->transfer_buffer_length - fifo->rx_offset); /* adjust pointer */
  6870. + fill_tx_urb(fifo); /* refill the urb */
  6871. + fifo->hfc->threshold_mask |= fifo->fifo_mask; /* assume threshold reached */
  6872. + if (fifo->buff)
  6873. + fifo->hfc->service_request |= fifo->fifo_mask; /* need to restart */
  6874. +} /* tx_complete */
  6875. +
  6876. +/***********************************************/
  6877. +/* receive completion routine for all rx fifos */
  6878. +/***********************************************/
  6879. +static void
  6880. +rx_complete(purb_t urb)
  6881. +{
  6882. + usb_fifo *fifo = (usb_fifo *) urb->context; /* pointer to our fifo */
  6883. + hfcusb_data *hfc = fifo->hfc;
  6884. + usb_fifo *txfifo;
  6885. + __u8 last_state;
  6886. + int i, ii, currcnt, hdlci;
  6887. + struct sk_buff *skb;
  6888. +
  6889. + urb->dev = hfc->dev; /* security init */
  6890. + if ((!fifo->active) || (urb->status)) {
  6891. + hfc->service_request &= ~fifo->fifo_mask; /* no further handling */
  6892. + hfc->active_fifos &= ~fifo->fifo_mask; /* we are inactive */
  6893. + fifo->urb.interval = 0; /* cancel automatic rescheduling */
  6894. + if (fifo->buff) {
  6895. + dev_kfree_skb_any(fifo->buff);
  6896. + fifo->buff = NULL;
  6897. + }
  6898. + return;
  6899. + }
  6900. +
  6901. + /* first check for any status changes */
  6902. + if ((urb->actual_length < fifo->rx_offset)
  6903. + || (urb->actual_length > fifo->usb_maxlen))
  6904. + return; /* error condition */
  6905. +
  6906. + if (fifo->rx_offset) {
  6907. + hfc->threshold_mask = fifo->buffer[1]; /* update threshold status */
  6908. + fifo->next_complete = fifo->buffer[0] & 1;
  6909. + if ((fifo->fifonum == HFCUSB_D_RX) &&
  6910. + (hfc->led_req != hfc->led_act))
  6911. + queue_control_request(hfc, HFCUSB_P_DATA, hfc->led_req);
  6912. +
  6913. + /* check if rescheduling needed */
  6914. + if ((i =
  6915. + hfc->service_request & hfc->active_fifos & ~hfc->
  6916. + threshold_mask)) {
  6917. + currcnt =
  6918. + usb_get_current_frame_number(hfc->dev);
  6919. + txfifo = hfc->fifos + HFCUSB_B1_TX;
  6920. + ii = 3;
  6921. + while (ii--) {
  6922. + if ((i & txfifo->fifo_mask)
  6923. + && (currcnt != txfifo->framenum)) {
  6924. + hfc->service_request &=
  6925. + ~txfifo->fifo_mask;
  6926. + if (!txfifo->buff)
  6927. + fill_tx_urb(txfifo);
  6928. + if (txfifo->buff)
  6929. + usb_submit_urb(&txfifo->
  6930. + urb);
  6931. + }
  6932. + txfifo += 2;
  6933. + }
  6934. + }
  6935. +
  6936. + /* handle l1 events */
  6937. + if ((fifo->buffer[0] >> 4) != hfc->l1_state) {
  6938. + last_state = hfc->l1_state;
  6939. + hfc->l1_state = fifo->buffer[0] >> 4; /* update status */
  6940. + if (timer_pending(&hfc->t4_timer))
  6941. + del_timer(&hfc->t4_timer);
  6942. + if (((hfc->l1_state == 3) &&
  6943. + ((last_state == 7) ||
  6944. + (last_state == 8))) ||
  6945. + ((timer_pending(&hfc->t3_timer) &&
  6946. + (hfc->l1_state == 8)))) {
  6947. + hfc->t4_timer.expires = jiffies + 2;
  6948. + add_timer(&hfc->t4_timer);
  6949. + } else {
  6950. + if (timer_pending(&hfc->t3_timer)
  6951. + && (hfc->l1_state == 7))
  6952. + del_timer(&hfc->t3_timer); /* no longer needed */
  6953. + test_and_set_bit(HFCUSB_L1_STATECHANGE,
  6954. + &hfc->l1_event);
  6955. + queue_task(&hfc->l1_tq, &tq_immediate);
  6956. + mark_bh(IMMEDIATE_BH);
  6957. + }
  6958. + }
  6959. + }
  6960. +
  6961. + /* check the length for data and move if present */
  6962. + if (fifo->next_complete || (urb->actual_length > fifo->rx_offset)) {
  6963. + i = fifo->buff->len + urb->actual_length - fifo->rx_offset; /* new total length */
  6964. + hdlci = (fifo->transmode) ? 0 : 3;
  6965. + if (i <= (fifo->max_size + hdlci)) {
  6966. + memcpy(fifo->act_ptr,
  6967. + fifo->buffer + fifo->rx_offset,
  6968. + urb->actual_length - fifo->rx_offset);
  6969. + fifo->act_ptr +=
  6970. + (urb->actual_length - fifo->rx_offset);
  6971. + fifo->buff->len +=
  6972. + (urb->actual_length - fifo->rx_offset);
  6973. + } else
  6974. + fifo->buff->len = fifo->max_size + 4; /* mark frame as to long */
  6975. + if (fifo->next_complete && (urb->actual_length < fifo->usb_maxlen)) {
  6976. + /* the frame is complete */
  6977. + fifo->next_complete = 0;
  6978. + if (((!*(fifo->act_ptr - 1)) || fifo->transmode) &&
  6979. + (fifo->buff->len >= (hdlci + 1))
  6980. + && (fifo->buff->len <=
  6981. + (fifo->max_size + hdlci)) &&
  6982. + ((skb = dev_alloc_skb(fifo->max_size + hdlci)) != NULL)) {
  6983. + fifo->buff->len -= hdlci; /* adjust size */
  6984. + switch (fifo->fifonum) {
  6985. + case HFCUSB_D_RX:
  6986. + skb_queue_tail(hfc->regd.
  6987. + drq,
  6988. + fifo->buff);
  6989. + test_and_set_bit
  6990. + (HFCUSB_L1_DRX,
  6991. + &hfc->l1_event);
  6992. + queue_task(&hfc->l1_tq,
  6993. + &tq_immediate);
  6994. + mark_bh(IMMEDIATE_BH);
  6995. + break;
  6996. +
  6997. + case HFCUSB_B1_RX:
  6998. + if (hfc->regd.brq[0]) {
  6999. + skb_queue_tail
  7000. + (hfc->regd.
  7001. + brq[0],
  7002. + fifo->buff);
  7003. + hfc->regd.
  7004. + bch_l1l2(hfc->
  7005. + regd.
  7006. + arg_hisax,
  7007. + 0,
  7008. + PH_DATA
  7009. + |
  7010. + INDICATION,
  7011. + (void *)
  7012. + fifo->
  7013. + buff);
  7014. + } else
  7015. + dev_kfree_skb_any
  7016. + (fifo->buff);
  7017. + break;
  7018. +
  7019. + case HFCUSB_B2_RX:
  7020. + if (hfc->regd.brq[1]) {
  7021. + skb_queue_tail
  7022. + (hfc->regd.
  7023. + brq[1],
  7024. + fifo->buff);
  7025. + hfc->regd.
  7026. + bch_l1l2(hfc->
  7027. + regd.
  7028. + arg_hisax,
  7029. + 1,
  7030. + PH_DATA
  7031. + |
  7032. + INDICATION,
  7033. + (void
  7034. + *)
  7035. + fifo->
  7036. + buff);
  7037. + } else
  7038. + dev_kfree_skb_any
  7039. + (fifo->buff);
  7040. + break;
  7041. +
  7042. + case HFCUSB_PCM_RX:
  7043. + skb_queue_tail(&hfc->regd.
  7044. + erq,
  7045. + fifo->buff);
  7046. + test_and_set_bit
  7047. + (HFCUSB_L1_ERX,
  7048. + &hfc->l1_event);
  7049. + queue_task(&hfc->l1_tq,
  7050. + &tq_immediate);
  7051. + mark_bh(IMMEDIATE_BH);
  7052. + break;
  7053. +
  7054. + default:
  7055. + dev_kfree_skb_any(fifo->
  7056. + buff);
  7057. + break;
  7058. + }
  7059. + fifo->buff = skb;
  7060. + }
  7061. + fifo->buff->len = 0; /* reset counter */
  7062. + fifo->act_ptr = fifo->buff->data; /* and pointer */
  7063. + }
  7064. + }
  7065. + fifo->rx_offset = (urb->actual_length < fifo->usb_maxlen) ? 2 : 0;
  7066. +} /* rx_complete */
  7067. +
  7068. +/***************************************************/
  7069. +/* start the interrupt transfer for the given fifo */
  7070. +/***************************************************/
  7071. +static void
  7072. +start_rx_fifo(usb_fifo * fifo)
  7073. +{
  7074. + if (fifo->buff)
  7075. + return; /* still active */
  7076. + if (!
  7077. + (fifo->buff =
  7078. + dev_alloc_skb(fifo->max_size + (fifo->transmode ? 0 : 3))))
  7079. + return;
  7080. + fifo->act_ptr = fifo->buff->data;
  7081. + FILL_INT_URB(&fifo->urb, fifo->hfc->dev, fifo->pipe, fifo->buffer,
  7082. + fifo->usb_maxlen, rx_complete, fifo, fifo->intervall);
  7083. + fifo->next_complete = 0;
  7084. + fifo->rx_offset = 2;
  7085. + fifo->active = 1; /* must be marked active */
  7086. + fifo->hfc->active_fifos |= fifo->fifo_mask;
  7087. + if (usb_submit_urb(&fifo->urb)) {
  7088. + fifo->active = 0;
  7089. + fifo->hfc->active_fifos &= ~fifo->fifo_mask;
  7090. + dev_kfree_skb_any(fifo->buff);
  7091. + fifo->buff = NULL;
  7092. + }
  7093. +} /* start_rx_fifo */
  7094. +
  7095. +/***************************************************************/
  7096. +/* control completion routine handling background control cmds */
  7097. +/***************************************************************/
  7098. +static void
  7099. +ctrl_complete(purb_t urb)
  7100. +{
  7101. + hfcusb_data *hfc = (hfcusb_data *) urb->context;
  7102. +
  7103. + urb->dev = hfc->dev;
  7104. + if (hfc->ctrl_cnt) {
  7105. + switch (hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg) {
  7106. + case HFCUSB_FIFO:
  7107. + hfc->ctrl_fifo =
  7108. + hfc->ctrl_buff[hfc->ctrl_out_idx].
  7109. + reg_val;
  7110. + break;
  7111. + case HFCUSB_F_USAGE:
  7112. + if (!hfc->dfifo_fill) {
  7113. + fill_tx_urb(hfc->fifos +
  7114. + HFCUSB_D_TX);
  7115. + if (hfc->fifos[HFCUSB_D_TX].buff)
  7116. + usb_submit_urb(&hfc->
  7117. + fifos
  7118. + [HFCUSB_D_TX].
  7119. + urb);
  7120. + } else {
  7121. + queue_control_request(hfc,
  7122. + HFCUSB_FIFO,
  7123. + HFCUSB_D_TX);
  7124. + queue_control_request(hfc,
  7125. + HFCUSB_F_USAGE,
  7126. + 0);
  7127. + }
  7128. + break;
  7129. + case HFCUSB_SCTRL_R:
  7130. + switch (hfc->ctrl_fifo) {
  7131. + case HFCUSB_B1_RX:
  7132. + if (hfc->bch_enables & 1)
  7133. + start_rx_fifo(hfc->
  7134. + fifos
  7135. + +
  7136. + HFCUSB_B1_RX);
  7137. + break;
  7138. + case HFCUSB_B2_RX:
  7139. + if (hfc->bch_enables & 2)
  7140. + start_rx_fifo(hfc->
  7141. + fifos
  7142. + +
  7143. + HFCUSB_B2_RX);
  7144. + break;
  7145. + }
  7146. + if (hfc->bch_enables & 3)
  7147. + hfc->led_req |= LED_BCH;
  7148. + else
  7149. + hfc->led_req &= ~LED_BCH;
  7150. + break;
  7151. + case HFCUSB_P_DATA:
  7152. + hfc->led_act =
  7153. + hfc->ctrl_buff[hfc->ctrl_out_idx].
  7154. + reg_val;
  7155. + break;
  7156. + }
  7157. + hfc->ctrl_cnt--; /* decrement actual count */
  7158. + if (++hfc->ctrl_out_idx >= HFC_CTRL_BUFSIZE)
  7159. + hfc->ctrl_out_idx = 0; /* pointer wrap */
  7160. + ctrl_start_transfer(hfc); /* start next transfer */
  7161. + }
  7162. +} /* ctrl_complete */
  7163. +
  7164. +/*****************************************/
  7165. +/* Layer 1 + D channel access from HiSax */
  7166. +/*****************************************/
  7167. +static void
  7168. +hfcusb_l1_access(void *drvarg, int pr, void *arg)
  7169. +{
  7170. + hfcusb_data *hfc = (hfcusb_data *) drvarg;
  7171. +
  7172. + switch (pr) {
  7173. + case (PH_DATA | REQUEST):
  7174. + case (PH_PULL | INDICATION):
  7175. + skb_queue_tail(hfc->regd.dsq,
  7176. + (struct sk_buff *) arg);
  7177. + if (!hfc->fifos[HFCUSB_D_TX].active
  7178. + && !hfc->dfifo_fill) {
  7179. + fill_tx_urb(hfc->fifos + HFCUSB_D_TX);
  7180. + hfc->active_fifos |=
  7181. + hfc->fifos[HFCUSB_D_TX].fifo_mask;
  7182. + usb_submit_urb(&hfc->fifos[HFCUSB_D_TX].
  7183. + urb);
  7184. + }
  7185. + break;
  7186. + case (PH_ACTIVATE | REQUEST):
  7187. + switch (hfc->l1_state) {
  7188. + case 6:
  7189. + case 8:
  7190. + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
  7191. + (PH_DEACTIVATE |
  7192. + INDICATION), NULL);
  7193. +
  7194. + break;
  7195. + case 7:
  7196. + hfc->regd.dch_l1l2(hfc->regd.arg_hisax,
  7197. + (PH_ACTIVATE |
  7198. + INDICATION), NULL);
  7199. +
  7200. + break;
  7201. + default:
  7202. + queue_control_request(hfc, HFCUSB_STATES, 0x60); /* start activation */
  7203. + hfc->t3_timer.expires =
  7204. + jiffies + (HFC_TIMER_T3 * HZ) / 1000;
  7205. + if (!timer_pending(&hfc->t3_timer))
  7206. + add_timer(&hfc->t3_timer);
  7207. + break;
  7208. + }
  7209. + break;
  7210. +
  7211. + case (PH_DEACTIVATE | REQUEST):
  7212. + queue_control_request(hfc, HFCUSB_STATES, 0x40); /* start deactivation */
  7213. + break;
  7214. + default:
  7215. + printk(KERN_INFO "unknown hfcusb l1_access 0x%x\n",
  7216. + pr);
  7217. + break;
  7218. + }
  7219. +} /* hfcusb_l1_access */
  7220. +
  7221. +/*******************************/
  7222. +/* B channel access from HiSax */
  7223. +/*******************************/
  7224. +static void
  7225. +hfcusb_bch_access(void *drvarg, int chan, int pr, void *arg)
  7226. +{
  7227. + hfcusb_data *hfc = (hfcusb_data *) drvarg;
  7228. + usb_fifo *fifo = hfc->fifos + (chan ? HFCUSB_B2_TX : HFCUSB_B1_TX);
  7229. + long flags;
  7230. +
  7231. + switch (pr) {
  7232. + case (PH_DATA | REQUEST):
  7233. + case (PH_PULL | INDICATION):
  7234. + save_flags(flags);
  7235. + cli();
  7236. + if (!fifo->active) {
  7237. + fill_tx_urb(fifo);
  7238. + hfc->active_fifos |= fifo->fifo_mask;
  7239. + usb_submit_urb(&fifo->urb);
  7240. + }
  7241. + restore_flags(flags);
  7242. + break;
  7243. + case (PH_ACTIVATE | REQUEST):
  7244. + if (!((int) arg)) {
  7245. + hfc->bch_enables &= ~(1 << chan);
  7246. + if (fifo->active) {
  7247. + fifo->active = 0;
  7248. + usb_unlink_urb(&fifo->urb);
  7249. + }
  7250. + save_flags(flags);
  7251. + cli();
  7252. + queue_control_request(hfc, HFCUSB_FIFO,
  7253. + fifo->fifonum);
  7254. + queue_control_request(hfc,
  7255. + HFCUSB_INC_RES_F, 2);
  7256. + queue_control_request(hfc, HFCUSB_CON_HDLC,
  7257. + 9);
  7258. + queue_control_request(hfc, HFCUSB_SCTRL,
  7259. + 0x40 +
  7260. + hfc->bch_enables);
  7261. + queue_control_request(hfc, HFCUSB_SCTRL_R,
  7262. + hfc->bch_enables);
  7263. + restore_flags(flags);
  7264. + fifo++;
  7265. + if (fifo->active) {
  7266. + fifo->active = 0;
  7267. + usb_unlink_urb(&fifo->urb);
  7268. + }
  7269. + return; /* fifo deactivated */
  7270. + }
  7271. + fifo->transmode = ((int) arg == L1_MODE_TRANS);
  7272. + fifo->max_size =
  7273. + ((fifo->transmode) ? fifo->
  7274. + usb_maxlen : MAX_BCH_SIZE);
  7275. + (fifo + 1)->transmode = fifo->transmode;
  7276. + (fifo + 1)->max_size = fifo->max_size;
  7277. + hfc->bch_enables |= (1 << chan);
  7278. + save_flags(flags);
  7279. + cli();
  7280. + queue_control_request(hfc, HFCUSB_FIFO,
  7281. + fifo->fifonum);
  7282. + queue_control_request(hfc, HFCUSB_CON_HDLC,
  7283. + ((!fifo->
  7284. + transmode) ? 9 : 11));
  7285. + queue_control_request(hfc, HFCUSB_INC_RES_F, 2);
  7286. + queue_control_request(hfc, HFCUSB_SCTRL,
  7287. + 0x40 + hfc->bch_enables);
  7288. + if ((int) arg == L1_MODE_HDLC)
  7289. + queue_control_request(hfc, HFCUSB_CON_HDLC,
  7290. + 8);
  7291. + queue_control_request(hfc, HFCUSB_FIFO,
  7292. + fifo->fifonum + 1);
  7293. + queue_control_request(hfc, HFCUSB_CON_HDLC,
  7294. + ((!fifo->
  7295. + transmode) ? 8 : 10));
  7296. + queue_control_request(hfc, HFCUSB_INC_RES_F, 2);
  7297. + queue_control_request(hfc, HFCUSB_SCTRL_R,
  7298. + hfc->bch_enables);
  7299. + restore_flags(flags);
  7300. +
  7301. + break;
  7302. +
  7303. + default:
  7304. + printk(KERN_INFO
  7305. + "unknown hfcusb bch_access chan %d 0x%x\n",
  7306. + chan, pr);
  7307. + break;
  7308. + }
  7309. +} /* hfcusb_bch_access */
  7310. +
  7311. +/***************************************************************************/
  7312. +/* usb_init is called once when a new matching device is detected to setup */
  7313. +/* main parmeters. It registers the driver at the main hisax module. */
  7314. +/* on success 0 is returned. */
  7315. +/***************************************************************************/
  7316. +static int
  7317. +usb_init(hfcusb_data * hfc)
  7318. +{
  7319. + usb_fifo *fifo;
  7320. + int i;
  7321. + u_char b;
  7322. +
  7323. + /* check the chip id */
  7324. + if ((Read_hfc(hfc, HFCUSB_CHIP_ID, &b) != 1) ||
  7325. + (b != HFCUSB_CHIPID)) {
  7326. + printk(KERN_INFO "HFC-USB: Invalid chip id 0x%02x\n", b);
  7327. + return (1);
  7328. + }
  7329. +
  7330. + /* first set the needed config, interface and alternate */
  7331. + usb_set_configuration(hfc->dev, 1);
  7332. + usb_set_interface(hfc->dev, hfc->if_used, hfc->alt_used);
  7333. +
  7334. + /* init the led state request */
  7335. + hfc->led_req = LED_DRIVER;
  7336. +
  7337. + /* now we initialise the chip */
  7338. + Write_hfc(hfc, HFCUSB_CIRM, 0x10); /* aux = output, reset off */
  7339. + Write_hfc(hfc, HFCUSB_P_DATA, 0); /* leds = off */
  7340. + Write_hfc(hfc, HFCUSB_USB_SIZE,
  7341. + (hfc->fifos[HFCUSB_B1_TX].usb_maxlen >> 3) |
  7342. + ((hfc->fifos[HFCUSB_B1_RX].usb_maxlen >> 3) << 4));
  7343. +
  7344. + /* enable PCM/GCI master mode */
  7345. + Write_hfc(hfc, HFCUSB_MST_MODE1, 0); /* set default values */
  7346. + Write_hfc(hfc, HFCUSB_MST_MODE0, 1); /* enable master mode */
  7347. +
  7348. + /* init the fifos */
  7349. + Write_hfc(hfc, HFCUSB_F_THRES, (HFCUSB_TX_THRESHOLD >> 3) |
  7350. + ((HFCUSB_RX_THRESHOLD >> 3) << 4));
  7351. +
  7352. + for (i = 0, fifo = hfc->fifos + i; i < HFCUSB_NUM_FIFOS;
  7353. + i++, fifo++) {
  7354. + Write_hfc(hfc, HFCUSB_FIFO, i); /* select the desired fifo */
  7355. +
  7356. + fifo->transmode = 0; /* hdlc mode selected */
  7357. + fifo->buff = NULL; /* init buffer pointer */
  7358. + fifo->max_size =
  7359. + (i <= HFCUSB_B2_RX) ? MAX_BCH_SIZE : MAX_DFRAME_LEN;
  7360. + Write_hfc(hfc, HFCUSB_HDLC_PAR, ((i <= HFCUSB_B2_RX) ? 0 : 2)); /* data length */
  7361. + Write_hfc(hfc, HFCUSB_CON_HDLC, ((i & 1) ? 0x08 : 0x09)); /* rx hdlc, tx fill 1 */
  7362. + Write_hfc(hfc, HFCUSB_INC_RES_F, 2); /* reset the fifo */
  7363. + }
  7364. +
  7365. + Write_hfc(hfc, HFCUSB_CLKDEL, 0x0f); /* clock delay value */
  7366. + Write_hfc(hfc, HFCUSB_STATES, 3 | 0x10); /* set deactivated mode */
  7367. + Write_hfc(hfc, HFCUSB_STATES, 3); /* enable state machine */
  7368. +
  7369. + Write_hfc(hfc, HFCUSB_SCTRL_R, 0); /* disable both B receivers */
  7370. + Write_hfc(hfc, HFCUSB_SCTRL, 0x40); /* disable B transmitters + cap mode */
  7371. +
  7372. + /* init the l1 timer */
  7373. + init_timer(&hfc->t3_timer);
  7374. + hfc->t3_timer.data = (long) hfc;
  7375. + hfc->t3_timer.function = (void *) l1_timer_expire;
  7376. + hfc->t4_timer.data = (long) hfc;
  7377. + hfc->t4_timer.function = (void *) l1_timer_expire;
  7378. + hfc->l1_tq.routine = (void *) (void *) usb_l1d_bh;
  7379. + hfc->l1_tq.sync = 0;
  7380. + hfc->l1_tq.data = hfc;
  7381. +
  7382. + /* init the background control machinery */
  7383. + hfc->ctrl_read.requesttype = 0xc0;
  7384. + hfc->ctrl_read.request = 1;
  7385. + hfc->ctrl_read.length = 1;
  7386. + hfc->ctrl_write.requesttype = 0x40;
  7387. + hfc->ctrl_write.request = 0;
  7388. + hfc->ctrl_write.length = 0;
  7389. + FILL_CONTROL_URB(&hfc->ctrl_urb, hfc->dev, hfc->ctrl_out_pipe,
  7390. + (u_char *) & hfc->ctrl_write, NULL, 0,
  7391. + ctrl_complete, hfc);
  7392. +
  7393. + /* init the TX-urbs */
  7394. + fifo = hfc->fifos + HFCUSB_D_TX;
  7395. + FILL_BULK_URB(&fifo->urb, hfc->dev, fifo->pipe,
  7396. + (u_char *) fifo->buffer, 0, tx_complete, fifo);
  7397. + fifo = hfc->fifos + HFCUSB_B1_TX;
  7398. + FILL_BULK_URB(&fifo->urb, hfc->dev, fifo->pipe,
  7399. + (u_char *) fifo->buffer, 0, tx_complete, fifo);
  7400. + fifo = hfc->fifos + HFCUSB_B2_TX;
  7401. + FILL_BULK_URB(&fifo->urb, hfc->dev, fifo->pipe,
  7402. + (u_char *) fifo->buffer, 0, tx_complete, fifo);
  7403. +
  7404. + /* init the E-buffer */
  7405. + skb_queue_head_init(&hfc->regd.erq);
  7406. +
  7407. + /* now register ourself at hisax */
  7408. + hfc->regd.version = HISAX_LOAD_VERSION; /* set our version */
  7409. + hfc->regd.cmd = HISAX_LOAD_REGISTER; /* register command */
  7410. + hfc->regd.argl1 = (void *) hfc; /* argument for our local routine */
  7411. + hfc->regd.dch_l2l1 = hfcusb_l1_access;
  7412. + hfc->regd.bch_l2l1 = hfcusb_bch_access;
  7413. + hfc->regd.drvname = "hfc_usb";
  7414. + if (hisax_register_hfcusb(&hfc->regd)) {
  7415. + printk(KERN_INFO "HFC-USB failed to register at hisax\n");
  7416. + Write_hfc(hfc, HFCUSB_CIRM, 0x08); /* aux = input, reset on */
  7417. + return (1);
  7418. + }
  7419. +
  7420. + /* startup the D- and E-channel fifos */
  7421. + start_rx_fifo(hfc->fifos + HFCUSB_D_RX); /* D-fifo */
  7422. + if (hfc->fifos[HFCUSB_PCM_RX].pipe)
  7423. + start_rx_fifo(hfc->fifos + HFCUSB_PCM_RX); /* E-fifo */
  7424. +
  7425. + return (0);
  7426. +} /* usb_init */
  7427. +
  7428. +/*************************************************/
  7429. +/* function called to probe a new plugged device */
  7430. +/*************************************************/
  7431. +static void *
  7432. +hfc_usb_probe(struct usb_device *dev, unsigned int interface
  7433. +#ifdef COMPAT_HAS_USB_IDTAB
  7434. + , const struct usb_device_id *id_table)
  7435. +#else
  7436. + )
  7437. +#endif
  7438. +{
  7439. + hfcusb_data *context;
  7440. + struct usb_interface *ifp = dev->actconfig->interface + interface;
  7441. + struct usb_interface_descriptor *ifdp =
  7442. + ifp->altsetting + ifp->act_altsetting;
  7443. + struct usb_endpoint_descriptor *epd;
  7444. + int i, idx, ep_msk;
  7445. +
  7446. +#ifdef COMPAT_HAS_USB_IDTAB
  7447. + if (id_table && (dev->descriptor.idVendor == id_table->idVendor) &&
  7448. + (dev->descriptor.idProduct == id_table->idProduct) &&
  7449. +#else
  7450. + if ((((dev->descriptor.idVendor == 0x959) &&
  7451. + (dev->descriptor.idProduct == 0x2bd0)) ||
  7452. + ((dev->descriptor.idVendor == 0x7b0) &&
  7453. + (dev->descriptor.idProduct == 0x0006))) &&
  7454. +#endif
  7455. + (ifdp->bNumEndpoints >= 6) && (ifdp->bNumEndpoints <= 16)) {
  7456. + if (!(context = kmalloc(sizeof(hfcusb_data), GFP_KERNEL))) {
  7457. + return (NULL); /* got no mem */
  7458. + };
  7459. + memset(context, 0, sizeof(hfcusb_data)); /* clear the structure */
  7460. + i = ifdp->bNumEndpoints; /* get number of endpoints */
  7461. + ep_msk = 0; /* none found */
  7462. + epd = ifdp->endpoint; /* first endpoint descriptor */
  7463. + while (i-- && ((ep_msk & 0xcf) != 0xcf)) {
  7464. +
  7465. + idx = (((epd->bEndpointAddress & 0x7f) - 1) << 1); /* get endpoint base */
  7466. + if (idx < 7) {
  7467. + switch (epd->bmAttributes) {
  7468. + case USB_ENDPOINT_XFER_INT:
  7469. + if (!
  7470. + (epd->
  7471. + bEndpointAddress &
  7472. + 0x80))
  7473. + break; /* only interrupt in allowed */
  7474. + idx++; /* input index is odd */
  7475. + context->fifos[idx].pipe =
  7476. + usb_rcvintpipe(dev,
  7477. + epd->
  7478. + bEndpointAddress);
  7479. + break;
  7480. +
  7481. + case USB_ENDPOINT_XFER_BULK:
  7482. + if (epd->
  7483. + bEndpointAddress &
  7484. + 0x80)
  7485. + break; /* only bulk out allowed */
  7486. + context->fifos[idx].pipe =
  7487. + usb_sndbulkpipe(dev,
  7488. + epd->
  7489. + bEndpointAddress);
  7490. + break;
  7491. + default:
  7492. + context->fifos[idx].pipe = 0; /* reset data */
  7493. + } /* switch attribute */
  7494. +
  7495. + if (context->fifos[idx].pipe) {
  7496. + context->fifos[idx].fifonum = idx;
  7497. + context->fifos[idx].fifo_mask =
  7498. + 1 << idx;
  7499. + context->fifos[idx].hfc = context;
  7500. + context->fifos[idx].usb_maxlen =
  7501. + epd->wMaxPacketSize;
  7502. + context->fifos[idx].intervall =
  7503. + epd->bInterval;
  7504. + ep_msk |= (1 << idx);
  7505. + } else
  7506. + ep_msk &= ~(1 << idx);
  7507. + } /* idx < 7 */
  7508. + epd++;
  7509. + }
  7510. +
  7511. + if ((ep_msk & 0x3f) != 0x3f) {
  7512. + kfree(context);
  7513. + return (NULL);
  7514. + }
  7515. + MOD_INC_USE_COUNT; /* lock our module */
  7516. + context->dev = dev; /* save device */
  7517. + context->if_used = interface; /* save used interface */
  7518. + context->alt_used = ifp->act_altsetting; /* and alternate config */
  7519. + context->ctrl_paksize = dev->descriptor.bMaxPacketSize0; /* control size */
  7520. +
  7521. + /* create the control pipes needed for register access */
  7522. + context->ctrl_in_pipe = usb_rcvctrlpipe(context->dev, 0);
  7523. + context->ctrl_out_pipe = usb_sndctrlpipe(context->dev, 0);
  7524. +
  7525. + /* init the chip and register the driver */
  7526. + if (usb_init(context)) {
  7527. + kfree(context);
  7528. + MOD_DEC_USE_COUNT;
  7529. + return (NULL);
  7530. + }
  7531. +
  7532. + printk(KERN_INFO
  7533. + "HFC-USB: New device if=%d alt=%d registered\n",
  7534. + context->if_used, context->alt_used);
  7535. + return (context);
  7536. + }
  7537. +
  7538. + return (NULL); /* no matching entry */
  7539. +} /* hfc_usb_probe */
  7540. +
  7541. +/****************************************************/
  7542. +/* function called when an active device is removed */
  7543. +/****************************************************/
  7544. +static void
  7545. +hfc_usb_disconnect(struct usb_device *usbdev, void *drv_context)
  7546. +{
  7547. + hfcusb_data *context = drv_context;
  7548. + int i;
  7549. + struct sk_buff *skb;
  7550. +
  7551. + /* tell all fifos to terminate */
  7552. + for (i = 0; i < HFCUSB_NUM_FIFOS; i++)
  7553. + if (context->fifos[i].active) {
  7554. + context->fifos[i].active = 0;
  7555. + usb_unlink_urb(&context->fifos[i].urb);
  7556. + }
  7557. + while (context->active_fifos) {
  7558. + set_current_state(TASK_INTERRUPTIBLE);
  7559. + /* Timeout 10ms */
  7560. + schedule_timeout((10 * HZ) / 1000);
  7561. + }
  7562. + if (timer_pending(&context->t3_timer))
  7563. + del_timer(&context->t3_timer);
  7564. + context->regd.release_driver(context->regd.arg_hisax);
  7565. + while ((skb = skb_dequeue(&context->regd.erq)) != NULL)
  7566. + dev_kfree_skb_any(skb);
  7567. +
  7568. + kfree(context); /* free our structure again */
  7569. + MOD_DEC_USE_COUNT; /* and decrement the usage counter */
  7570. +} /* hfc_usb_disconnect */
  7571. +
  7572. +/************************************/
  7573. +/* our driver information structure */
  7574. +/************************************/
  7575. +static struct usb_driver hfc_drv = {
  7576. + name:"hfc_usb",
  7577. +#ifdef COMPAT_HAS_USB_IDTAB
  7578. + id_table:hfc_usb_idtab,
  7579. +#endif
  7580. + probe:hfc_usb_probe,
  7581. + disconnect:hfc_usb_disconnect,
  7582. +};
  7583. +
  7584. +static void __exit
  7585. +hfc_usb_exit(void)
  7586. +{
  7587. +
  7588. + usb_deregister(&hfc_drv); /* release our driver */
  7589. + printk(KERN_INFO "HFC-USB module removed\n");
  7590. +}
  7591. +
  7592. +static int __init
  7593. +hfc_usb_init(void)
  7594. +{
  7595. + struct hisax_drvreg drv;
  7596. +
  7597. + drv.version = HISAX_LOAD_VERSION; /* set our version */
  7598. + drv.cmd = HISAX_LOAD_CHKVER; /* check command only */
  7599. + if (hisax_register_hfcusb(&drv)) {
  7600. + printk(KERN_INFO "HFC-USB <-> hisax version conflict\n");
  7601. + return (-1); /* unable to register */
  7602. + }
  7603. + if (usb_register(&hfc_drv)) {
  7604. + printk(KERN_INFO
  7605. + "Unable to register HFC-USB module at usb stack\n");
  7606. + return (-1); /* unable to register */
  7607. + }
  7608. +
  7609. + printk(KERN_INFO "HFC-USB module loaded\n");
  7610. + return (0);
  7611. +}
  7612. +
  7613. +module_init(hfc_usb_init);
  7614. +module_exit(hfc_usb_exit);
  7615. Index: linux-2.4.35.4/drivers/isdn/hisax/hfc_usbr.c
  7616. ===================================================================
  7617. --- /dev/null
  7618. +++ linux-2.4.35.4/drivers/isdn/hisax/hfc_usbr.c
  7619. @@ -0,0 +1,471 @@
  7620. +/* $Id: hfc_usbr.c,v 2.5 2001/07/06 21:30:11 werner Exp $
  7621. +
  7622. + * hfc_usb.c low level driver for CCD´s hfc-usb single chip controllers
  7623. + * type approval valid for HFC-S USB based TAs
  7624. + *
  7625. + * Author Werner Cornelius ([email protected])
  7626. + *
  7627. + * Copyright 2001 by Werner Cornelius ([email protected])
  7628. + *
  7629. + * This program is free software; you can redistribute it and/or modify
  7630. + * it under the terms of the GNU General Public License as published by
  7631. + * the Free Software Foundation; either version 2, or (at your option)
  7632. + * any later version.
  7633. + *
  7634. + * This program is distributed in the hope that it will be useful,
  7635. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  7636. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  7637. + * GNU General Public License for more details.
  7638. + *
  7639. + * You should have received a copy of the GNU General Public License
  7640. + * along with this program; if not, write to the Free Software
  7641. + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  7642. + *
  7643. + */
  7644. +
  7645. +#define __NO_VERSION__
  7646. +#include <linux/init.h>
  7647. +#include "hisax.h"
  7648. +#include "isdnl1.h"
  7649. +#include "hisax_loadable.h"
  7650. +
  7651. +extern const char *CardType[];
  7652. +
  7653. +static const char *hfcusb_revision = "$Revision: 2.5 $";
  7654. +
  7655. +/*********************************/
  7656. +/* schedule a new b_channel task */
  7657. +/*********************************/
  7658. +static void
  7659. +hfcusb_sched_event(struct BCState *bcs, int event)
  7660. +{
  7661. + bcs->event |= 1 << event;
  7662. + queue_task(&bcs->tqueue, &tq_immediate);
  7663. + mark_bh(IMMEDIATE_BH);
  7664. +}
  7665. +
  7666. +/************************************************/
  7667. +/* select a b-channel entry matching and active */
  7668. +/************************************************/
  7669. +static
  7670. +struct BCState *
  7671. +Sel_BCS(struct IsdnCardState *cs, int channel)
  7672. +{
  7673. + if (cs->bcs[0].mode && (cs->bcs[0].channel == channel))
  7674. + return (&cs->bcs[0]);
  7675. + else if (cs->bcs[1].mode && (cs->bcs[1].channel == channel))
  7676. + return (&cs->bcs[1]);
  7677. + else
  7678. + return (NULL);
  7679. +}
  7680. +
  7681. +/**********************************************/
  7682. +/* transfer function (D-channel from l2 to l1 */
  7683. +/**********************************************/
  7684. +static void
  7685. +hfcusb_d_l2l1(struct PStack *st, int pr, void *arg)
  7686. +{
  7687. + struct IsdnCardState *cs = st->l1.hardware;
  7688. + struct hisax_drvreg *drv = cs->hw.hfcusb.drv;
  7689. +
  7690. + if (drv) {
  7691. + switch (pr) {
  7692. + case (PH_DATA | REQUEST):
  7693. + case (PH_PULL | INDICATION):
  7694. + cs->hw.hfcusb.dch_tx_busy = 1;
  7695. + break;
  7696. + case (PH_PULL | REQUEST):
  7697. + if (!cs->hw.hfcusb.dch_tx_busy) {
  7698. + test_and_clear_bit(FLG_L1_PULL_REQ,
  7699. + &st->l1.Flags);
  7700. + st->l1.l1l2(st, PH_PULL | CONFIRM,
  7701. + NULL);
  7702. + } else
  7703. + test_and_set_bit(FLG_L1_PULL_REQ,
  7704. + &st->l1.Flags);
  7705. + return;
  7706. + }
  7707. + drv->dch_l2l1(drv, pr, arg);
  7708. + } else
  7709. + debugl1(cs, "hfcusb l2l1 called without existing driver");
  7710. +} /* hfcusb_d_l2l1 */
  7711. +
  7712. +/*****************************/
  7713. +/* E-channel receive routine */
  7714. +/*****************************/
  7715. +static void
  7716. +EChannel_proc_rcv(struct IsdnCardState *cs)
  7717. +{
  7718. + u_char *ptr;
  7719. + struct sk_buff *skb;
  7720. + struct hisax_drvreg *usbdrv =
  7721. + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
  7722. +
  7723. +
  7724. + while ((skb = skb_dequeue(&usbdrv->erq)) != NULL) {
  7725. + if (cs->debug & DEB_DLOG_HEX) {
  7726. + ptr = cs->dlog;
  7727. + if ((skb->len) < MAX_DLOG_SPACE / 3 - 10) {
  7728. + *ptr++ = 'E';
  7729. + *ptr++ = 'C';
  7730. + *ptr++ = 'H';
  7731. + *ptr++ = 'O';
  7732. + *ptr++ = ':';
  7733. + ptr += QuickHex(ptr, skb->data, skb->len);
  7734. + ptr--;
  7735. + *ptr++ = '\n';
  7736. + *ptr = 0;
  7737. + HiSax_putstatus(cs, NULL, cs->dlog);
  7738. + } else
  7739. + HiSax_putstatus(cs, "LogEcho: ",
  7740. + "warning Frame too big (%d)",
  7741. + skb->len);
  7742. + }
  7743. + dev_kfree_skb_any(skb);
  7744. + }
  7745. +}
  7746. +
  7747. +/******************************************/
  7748. +/* transfer function called from L1 to L2 */
  7749. +/******************************************/
  7750. +static void
  7751. +hfcusb_d_l1l2(void *cs1, int pr, void *arg)
  7752. +{
  7753. + struct IsdnCardState *cs = (struct IsdnCardState *) cs1;
  7754. +
  7755. + switch (pr) {
  7756. + case (PH_DATA | INDICATION):
  7757. + if (!((int) arg))
  7758. + DChannel_proc_rcv(cs);
  7759. + else
  7760. + EChannel_proc_rcv(cs);
  7761. + break;
  7762. +
  7763. + case (PH_DATA | CONFIRM):
  7764. + cs->hw.hfcusb.dch_tx_busy = 0;
  7765. + DChannel_proc_xmt(cs);
  7766. + break;
  7767. +
  7768. + case (PH_ACTIVATE | INDICATION):
  7769. + case (PH_ACTIVATE | CONFIRM):
  7770. + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
  7771. + if (cs->debug & L1_DEB_ISAC)
  7772. + debugl1(cs, "layer 1 activated");
  7773. + break;
  7774. +
  7775. + case (PH_DEACTIVATE | INDICATION):
  7776. + case (PH_DEACTIVATE | CONFIRM):
  7777. + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
  7778. + if (cs->debug & L1_DEB_ISAC)
  7779. + debugl1(cs, "layer 1 deactivated");
  7780. + break;
  7781. +
  7782. + default:
  7783. + debugl1(cs, "unknown l1 msg 0x%x ", pr);
  7784. + }
  7785. +} /* hfcusb_d_l1l2 */
  7786. +
  7787. +
  7788. +/******************************************/
  7789. +/* transfer function called from L1 to L2 */
  7790. +/******************************************/
  7791. +static void
  7792. +hfcusb_b_l1l2(void *cs1, int chan, int pr, void *arg)
  7793. +{
  7794. + struct IsdnCardState *cs = (struct IsdnCardState *) cs1;
  7795. + struct BCState *bcs = Sel_BCS(cs, chan);
  7796. +
  7797. + switch (pr) {
  7798. + case (PH_DATA | INDICATION):
  7799. + if (!bcs)
  7800. + return;
  7801. + hfcusb_sched_event(bcs, B_RCVBUFREADY);
  7802. + break;
  7803. +
  7804. + case (PH_DATA | CONFIRM):
  7805. + if (!bcs)
  7806. + return;
  7807. + bcs->tx_cnt -= bcs->tx_skb->len;
  7808. + if (bcs->st->lli.l1writewakeup &&
  7809. + (PACKET_NOACK != bcs->tx_skb->pkt_type))
  7810. + bcs->st->lli.l1writewakeup(bcs->st,
  7811. + bcs->tx_skb->
  7812. + len);
  7813. + dev_kfree_skb_any(bcs->tx_skb);
  7814. + bcs->tx_skb = skb_dequeue(&bcs->squeue);
  7815. + break;
  7816. +
  7817. + case (PH_ACTIVATE | INDICATION):
  7818. + case (PH_ACTIVATE | CONFIRM):
  7819. + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
  7820. + if (cs->debug & L1_DEB_ISAC)
  7821. + debugl1(cs, "layer 1 activated");
  7822. + break;
  7823. +
  7824. + case (PH_DEACTIVATE | INDICATION):
  7825. + case (PH_DEACTIVATE | CONFIRM):
  7826. + cs->stlist->l1.l1l2(cs->stlist, pr, arg);
  7827. + if (cs->debug & L1_DEB_ISAC)
  7828. + debugl1(cs, "layer 1 deactivated");
  7829. + break;
  7830. +
  7831. + default:
  7832. + debugl1(cs, "unknown l1 b msg 0x%x ", pr);
  7833. + }
  7834. +} /* hfcusb_b_l1l2 */
  7835. +
  7836. +
  7837. +/***********************************************/
  7838. +/* called during init setting l1 stack pointer */
  7839. +/***********************************************/
  7840. +void
  7841. +setstack_hfcusb(struct PStack *st, struct IsdnCardState *cs)
  7842. +{
  7843. + st->l2.l2l1 = hfcusb_d_l2l1;
  7844. +}
  7845. +
  7846. +/**************************************/
  7847. +/* send B-channel data if not blocked */
  7848. +/**************************************/
  7849. +static void
  7850. +hfcusb_send_data(struct BCState *bcs)
  7851. +{
  7852. + struct IsdnCardState *cs = bcs->cs;
  7853. + struct hisax_drvreg *drv =
  7854. + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
  7855. +
  7856. + if (!drv)
  7857. + return;
  7858. + drv->bch_l2l1(drv->argl1, bcs->channel, PH_DATA | REQUEST,
  7859. + bcs->tx_skb);
  7860. +}
  7861. +
  7862. +/***************************************************************/
  7863. +/* activate/deactivate hardware for selected channels and mode */
  7864. +/***************************************************************/
  7865. +void
  7866. +mode_hfcusb(struct BCState *bcs, int mode, int bc)
  7867. +{
  7868. + struct IsdnCardState *cs = bcs->cs;
  7869. + struct hisax_drvreg *drv = cs->hw.hfcusb.drv;
  7870. +
  7871. + if (!drv)
  7872. + return;
  7873. + if (cs->debug & L1_DEB_HSCX)
  7874. + debugl1(cs, "HFCUSB bchannel mode %d bchan %d/%d",
  7875. + mode, bc, bcs->channel);
  7876. + bcs->mode = mode;
  7877. + bcs->channel = bc;
  7878. + if (mode) {
  7879. + drv->bsk[bc] = &bcs->tx_skb;
  7880. + drv->brq[bc] = &bcs->rqueue;
  7881. + }
  7882. + drv->bch_l2l1(drv->argl1, bc, PH_ACTIVATE | REQUEST,
  7883. + (void *) mode);
  7884. + if (!mode) {
  7885. + drv->bsk[bc] = NULL;
  7886. + drv->brq[bc] = NULL;
  7887. + }
  7888. +}
  7889. +
  7890. +/******************************/
  7891. +/* Layer2 -> Layer 1 Transfer */
  7892. +/******************************/
  7893. +static void
  7894. +hfcusb_b_l2l1(struct PStack *st, int pr, void *arg)
  7895. +{
  7896. + struct sk_buff *skb = arg;
  7897. + struct hisax_drvreg *drv = st->l1.bcs->cs->hw.hfcusb.drv;
  7898. + long flags;
  7899. +
  7900. + switch (pr) {
  7901. + case (PH_DATA | REQUEST):
  7902. + save_flags(flags);
  7903. + cli();
  7904. + if (st->l1.bcs->tx_skb) {
  7905. + skb_queue_tail(&st->l1.bcs->squeue, skb);
  7906. + restore_flags(flags);
  7907. + } else {
  7908. + st->l1.bcs->tx_skb = skb;
  7909. + st->l1.bcs->cs->BC_Send_Data(st->l1.bcs);
  7910. + restore_flags(flags);
  7911. + }
  7912. + break;
  7913. + case (PH_PULL | INDICATION):
  7914. + if (st->l1.bcs->tx_skb) {
  7915. + printk(KERN_WARNING
  7916. + "hfc_l2l1: this shouldn't happen\n");
  7917. + break;
  7918. + }
  7919. + save_flags(flags);
  7920. + cli();
  7921. + st->l1.bcs->tx_skb = skb;
  7922. + st->l1.bcs->cs->BC_Send_Data(st->l1.bcs);
  7923. + restore_flags(flags);
  7924. + break;
  7925. + case (PH_PULL | REQUEST):
  7926. + if (!st->l1.bcs->tx_skb) {
  7927. + test_and_clear_bit(FLG_L1_PULL_REQ,
  7928. + &st->l1.Flags);
  7929. + st->l1.l1l2(st, PH_PULL | CONFIRM, NULL);
  7930. + } else
  7931. + test_and_set_bit(FLG_L1_PULL_REQ,
  7932. + &st->l1.Flags);
  7933. + break;
  7934. + case (PH_ACTIVATE | REQUEST):
  7935. + if (drv) {
  7936. + test_and_set_bit(BC_FLG_ACTIV,
  7937. + &st->l1.bcs->Flag);
  7938. + mode_hfcusb(st->l1.bcs, st->l1.mode,
  7939. + st->l1.bc);
  7940. + l1_msg_b(st, pr, arg);
  7941. + }
  7942. + break;
  7943. + case (PH_DEACTIVATE | REQUEST):
  7944. + l1_msg_b(st, pr, arg);
  7945. + break;
  7946. + case (PH_DEACTIVATE | CONFIRM):
  7947. + test_and_clear_bit(BC_FLG_ACTIV,
  7948. + &st->l1.bcs->Flag);
  7949. + test_and_clear_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
  7950. + mode_hfcusb(st->l1.bcs, 0, st->l1.bc);
  7951. + st->l1.l1l2(st, PH_DEACTIVATE | CONFIRM, NULL);
  7952. + break;
  7953. + }
  7954. +}
  7955. +
  7956. +/******************************************/
  7957. +/* deactivate B-channel access and queues */
  7958. +/******************************************/
  7959. +static void
  7960. +close_hfcusb(struct BCState *bcs)
  7961. +{
  7962. + mode_hfcusb(bcs, 0, bcs->channel);
  7963. + if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) {
  7964. + skb_queue_purge(&bcs->rqueue);
  7965. + skb_queue_purge(&bcs->squeue);
  7966. + if (bcs->tx_skb) {
  7967. + dev_kfree_skb_any(bcs->tx_skb);
  7968. + bcs->tx_skb = NULL;
  7969. + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
  7970. + }
  7971. + }
  7972. +}
  7973. +
  7974. +/*************************************/
  7975. +/* init B-channel queues and control */
  7976. +/*************************************/
  7977. +static int
  7978. +open_hfcusbstate(struct IsdnCardState *cs, struct BCState *bcs)
  7979. +{
  7980. + if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) {
  7981. + skb_queue_head_init(&bcs->rqueue);
  7982. + skb_queue_head_init(&bcs->squeue);
  7983. + }
  7984. + bcs->tx_skb = NULL;
  7985. + test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
  7986. + bcs->event = 0;
  7987. + bcs->tx_cnt = 0;
  7988. + return (0);
  7989. +}
  7990. +
  7991. +/*********************************/
  7992. +/* inits the stack for B-channel */
  7993. +/*********************************/
  7994. +static int
  7995. +setstack_2b(struct PStack *st, struct BCState *bcs)
  7996. +{
  7997. + bcs->channel = st->l1.bc;
  7998. + if (open_hfcusbstate(st->l1.hardware, bcs))
  7999. + return (-1);
  8000. + st->l1.bcs = bcs;
  8001. + st->l2.l2l1 = hfcusb_b_l2l1;
  8002. + setstack_manager(st);
  8003. + bcs->st = st;
  8004. + setstack_l1_B(st);
  8005. + return (0);
  8006. +}
  8007. +
  8008. +/********************************/
  8009. +/* called for card init message */
  8010. +/********************************/
  8011. +void __devinit
  8012. +inithfcusb(struct IsdnCardState *cs)
  8013. +{
  8014. + cs->setstack_d = setstack_hfcusb;
  8015. + cs->BC_Send_Data = &hfcusb_send_data;
  8016. + cs->bcs[0].BC_SetStack = setstack_2b;
  8017. + cs->bcs[1].BC_SetStack = setstack_2b;
  8018. + cs->bcs[0].BC_Close = close_hfcusb;
  8019. + cs->bcs[1].BC_Close = close_hfcusb;
  8020. + mode_hfcusb(cs->bcs, 0, 0);
  8021. + mode_hfcusb(cs->bcs + 1, 0, 1);
  8022. +}
  8023. +
  8024. +
  8025. +
  8026. +/*******************************************/
  8027. +/* handle card messages from control layer */
  8028. +/*******************************************/
  8029. +static int
  8030. +hfcusb_card_msg(struct IsdnCardState *cs, int mt, void *arg)
  8031. +{
  8032. + if (cs->debug & L1_DEB_ISAC)
  8033. + debugl1(cs, "HFCUSB: card_msg %x", mt);
  8034. + switch (mt) {
  8035. + case CARD_INIT:
  8036. + inithfcusb(cs);
  8037. + return (0);
  8038. + case CARD_RELEASE:
  8039. + case CARD_RESET:
  8040. + case CARD_TEST:
  8041. + return (0);
  8042. + }
  8043. + return (0);
  8044. +}
  8045. +
  8046. +
  8047. +extern void
  8048. + HiSax_closecard(int cardnr);
  8049. +/*****************************/
  8050. +/* release a driver instance */
  8051. +/* called when hardware is */
  8052. +/* no longer present. */
  8053. +/*****************************/
  8054. +static void
  8055. +release_hfcdrv(void *arg)
  8056. +{
  8057. + struct IsdnCardState *cs = (struct IsdnCardState *) arg;
  8058. +
  8059. + cs->hw.hfcusb.drv = NULL; /* disable any further use of driver */
  8060. + HiSax_closecard(cs->cardnr);
  8061. +} /* release_hfcdrv */
  8062. +
  8063. +/*********************************************/
  8064. +/* called once when a new device is detected */
  8065. +/* initialises local data */
  8066. +/*********************************************/
  8067. +int
  8068. +setup_hfc_usb(struct IsdnCard *card)
  8069. +{
  8070. + struct IsdnCardState *cs = card->cs;
  8071. + char tmp[64];
  8072. + struct hisax_drvreg *usbdrv =
  8073. + (struct hisax_drvreg *) cs->hw.hfcusb.drv;
  8074. +
  8075. + if (!usbdrv)
  8076. + return (0); /* no driver data present */
  8077. +
  8078. + strcpy(tmp, hfcusb_revision);
  8079. + printk(KERN_INFO "HiSax: HFC-USB driver Rev. %s\n",
  8080. + HiSax_getrev(tmp));
  8081. +
  8082. + usbdrv->release_driver = &release_hfcdrv; /* release routine */
  8083. + usbdrv->arg_hisax = (void *) cs; /* parameter for calling */
  8084. + usbdrv->dch_l1l2 = &hfcusb_d_l1l2; /* access from L1 to HiSax */
  8085. + usbdrv->bch_l1l2 = &hfcusb_b_l1l2;
  8086. + usbdrv->drq = &cs->rq;
  8087. + usbdrv->dsq = &cs->sq;
  8088. + cs->cardmsg = &hfcusb_card_msg;
  8089. + return (1); /* success */
  8090. +}
  8091. Index: linux-2.4.35.4/drivers/isdn/hisax/hfcscard.c
  8092. ===================================================================
  8093. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hfcscard.c
  8094. +++ linux-2.4.35.4/drivers/isdn/hisax/hfcscard.c
  8095. @@ -1,4 +1,4 @@
  8096. -/* $Id: hfcscard.c,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  8097. +/* $Id: hfcscard.c,v 1.10 2001/09/24 13:22:56 kai Exp $
  8098. *
  8099. * low level stuff for hfcs based cards (Teles3c, ACER P10)
  8100. *
  8101. @@ -12,14 +12,13 @@
  8102. #define __NO_VERSION__
  8103. #include <linux/init.h>
  8104. -#include <linux/isapnp.h>
  8105. #include "hisax.h"
  8106. #include "hfc_2bds0.h"
  8107. #include "isdnl1.h"
  8108. extern const char *CardType[];
  8109. -static const char *hfcs_revision = "$Revision: 1.1.4.1 $";
  8110. +static const char *hfcs_revision = "$Revision: 1.10 $";
  8111. static void
  8112. hfcs_interrupt(int intno, void *dev_id, struct pt_regs *regs)
  8113. @@ -140,36 +139,6 @@ hfcs_card_msg(struct IsdnCardState *cs,
  8114. return(0);
  8115. }
  8116. -#ifdef __ISAPNP__
  8117. -static struct isapnp_device_id hfc_ids[] __initdata = {
  8118. - { ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
  8119. - ISAPNP_VENDOR('A', 'N', 'X'), ISAPNP_FUNCTION(0x1114),
  8120. - (unsigned long) "Acer P10" },
  8121. - { ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0002),
  8122. - ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0002),
  8123. - (unsigned long) "Billion 2" },
  8124. - { ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0001),
  8125. - ISAPNP_VENDOR('B', 'I', 'L'), ISAPNP_FUNCTION(0x0001),
  8126. - (unsigned long) "Billion 1" },
  8127. - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x7410),
  8128. - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x7410),
  8129. - (unsigned long) "IStar PnP" },
  8130. - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2610),
  8131. - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2610),
  8132. - (unsigned long) "Teles 16.3c" },
  8133. - { ISAPNP_VENDOR('S', 'F', 'M'), ISAPNP_FUNCTION(0x0001),
  8134. - ISAPNP_VENDOR('S', 'F', 'M'), ISAPNP_FUNCTION(0x0001),
  8135. - (unsigned long) "Tornado Tipa C" },
  8136. - { ISAPNP_VENDOR('K', 'Y', 'E'), ISAPNP_FUNCTION(0x0001),
  8137. - ISAPNP_VENDOR('K', 'Y', 'E'), ISAPNP_FUNCTION(0x0001),
  8138. - (unsigned long) "Genius Speed Surfer" },
  8139. - { 0, }
  8140. -};
  8141. -
  8142. -static struct isapnp_device_id *hdev = &hfc_ids[0];
  8143. -static struct pci_bus *pnp_c __devinitdata = NULL;
  8144. -#endif
  8145. -
  8146. int __init
  8147. setup_hfcs(struct IsdnCard *card)
  8148. {
  8149. @@ -178,46 +147,6 @@ setup_hfcs(struct IsdnCard *card)
  8150. strcpy(tmp, hfcs_revision);
  8151. printk(KERN_INFO "HiSax: HFC-S driver Rev. %s\n", HiSax_getrev(tmp));
  8152. -
  8153. -#ifdef __ISAPNP__
  8154. - if (!card->para[1] && isapnp_present()) {
  8155. - struct pci_bus *pb;
  8156. - struct pci_dev *pd;
  8157. -
  8158. - while(hdev->card_vendor) {
  8159. - if ((pb = isapnp_find_card(hdev->card_vendor,
  8160. - hdev->card_device, pnp_c))) {
  8161. - pnp_c = pb;
  8162. - pd = NULL;
  8163. - if ((pd = isapnp_find_dev(pnp_c,
  8164. - hdev->vendor, hdev->function, pd))) {
  8165. - printk(KERN_INFO "HiSax: %s detected\n",
  8166. - (char *)hdev->driver_data);
  8167. - pd->prepare(pd);
  8168. - pd->deactivate(pd);
  8169. - pd->activate(pd);
  8170. - card->para[1] = pd->resource[0].start;
  8171. - card->para[0] = pd->irq_resource[0].start;
  8172. - if (!card->para[0] || !card->para[1]) {
  8173. - printk(KERN_ERR "HFC PnP:some resources are missing %ld/%lx\n",
  8174. - card->para[0], card->para[1]);
  8175. - pd->deactivate(pd);
  8176. - return(0);
  8177. - }
  8178. - break;
  8179. - } else {
  8180. - printk(KERN_ERR "HFC PnP: PnP error card found, no device\n");
  8181. - }
  8182. - }
  8183. - hdev++;
  8184. - pnp_c=NULL;
  8185. - }
  8186. - if (!hdev->card_vendor) {
  8187. - printk(KERN_INFO "HFC PnP: no ISAPnP card found\n");
  8188. - return(0);
  8189. - }
  8190. - }
  8191. -#endif
  8192. cs->hw.hfcD.addr = card->para[1] & 0xfffe;
  8193. cs->irq = card->para[0];
  8194. cs->hw.hfcD.cip = 0;
  8195. Index: linux-2.4.35.4/drivers/isdn/hisax/hisax.h
  8196. ===================================================================
  8197. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hisax.h
  8198. +++ linux-2.4.35.4/drivers/isdn/hisax/hisax.h
  8199. @@ -1,4 +1,4 @@
  8200. -/* $Id: hisax.h,v 1.1.4.2 2001/12/09 19:15:28 kai Exp $
  8201. +/* $Id: hisax.h,v 2.64 2001/09/24 13:22:56 kai Exp $
  8202. *
  8203. * Basic declarations, defines and prototypes
  8204. *
  8205. @@ -24,7 +24,9 @@
  8206. #include <linux/isdnif.h>
  8207. #include <linux/tty.h>
  8208. #include <linux/serial_reg.h>
  8209. +#ifndef COMPAT_NO_SOFTNET
  8210. #include <linux/netdevice.h>
  8211. +#endif
  8212. #define ERROR_STATISTIC
  8213. @@ -68,9 +70,6 @@
  8214. #define DL_DATA 0x0220
  8215. #define DL_FLUSH 0x0224
  8216. #define DL_UNIT_DATA 0x0230
  8217. -
  8218. -#define MDL_BC_RELEASE 0x0278 // Formula-n enter:now
  8219. -#define MDL_BC_ASSIGN 0x027C // Formula-n enter:now
  8220. #define MDL_ASSIGN 0x0280
  8221. #define MDL_REMOVE 0x0284
  8222. #define MDL_ERROR 0x0288
  8223. @@ -472,8 +471,6 @@ struct amd7930_hw {
  8224. #define BC_FLG_FTI_RUN 13
  8225. #define BC_FLG_LL_OK 14
  8226. #define BC_FLG_LL_CONN 15
  8227. -#define BC_FLG_FTI_FTS 16
  8228. -#define BC_FLG_FRH_WAIT 17
  8229. #define L1_MODE_NULL 0
  8230. #define L1_MODE_TRANS 1
  8231. @@ -695,6 +692,13 @@ struct hfcPCI_hw {
  8232. struct timer_list timer;
  8233. };
  8234. +#ifdef CONFIG_HISAX_HFC_USB
  8235. +struct hfcUSB_hw {
  8236. + void *drv; /* pointer to driver structure */
  8237. + int dch_tx_busy;
  8238. +};
  8239. +#endif
  8240. +
  8241. struct hfcSX_hw {
  8242. unsigned long base;
  8243. unsigned char cirm;
  8244. @@ -838,17 +842,6 @@ struct w6692_chip {
  8245. int ph_state;
  8246. };
  8247. -struct amd7930_chip {
  8248. - u_char lmr1;
  8249. - u_char ph_state;
  8250. - u_char old_state;
  8251. - u_char flg_t3;
  8252. - unsigned int tx_xmtlen;
  8253. - struct timer_list timer3;
  8254. - void (*ph_command) (struct IsdnCardState *, u_char, char *);
  8255. - void (*setIrqMask) (struct IsdnCardState *, u_char);
  8256. -};
  8257. -
  8258. struct icc_chip {
  8259. int ph_state;
  8260. u_char *mon_tx;
  8261. @@ -902,6 +895,9 @@ struct IsdnCardState {
  8262. struct njet_hw njet;
  8263. struct hfcD_hw hfcD;
  8264. struct hfcPCI_hw hfcpci;
  8265. +#ifdef CONFIG_HISAX_HFC_USB
  8266. + struct hfcUSB_hw hfcusb;
  8267. +#endif
  8268. struct hfcSX_hw hfcsx;
  8269. struct ix1_hw niccy;
  8270. struct isurf_hw isurf;
  8271. @@ -945,7 +941,6 @@ struct IsdnCardState {
  8272. struct hfcpci_chip hfcpci;
  8273. struct hfcsx_chip hfcsx;
  8274. struct w6692_chip w6692;
  8275. - struct amd7930_chip amd7930;
  8276. struct icc_chip icc;
  8277. } dc;
  8278. u_char *rcvbuf;
  8279. @@ -967,6 +962,8 @@ struct IsdnCardState {
  8280. #define MON0_TX 4
  8281. #define MON1_TX 8
  8282. +#define HISAX_MAX_CARDS 8
  8283. +
  8284. #define ISDN_CTYPE_16_0 1
  8285. #define ISDN_CTYPE_8_0 2
  8286. #define ISDN_CTYPE_16_3 3
  8287. @@ -1006,8 +1003,8 @@ struct IsdnCardState {
  8288. #define ISDN_CTYPE_HFC_SX 37
  8289. #define ISDN_CTYPE_NETJET_U 38
  8290. #define ISDN_CTYPE_HFC_SP_PCMCIA 39
  8291. -#define ISDN_CTYPE_DYNAMIC 40
  8292. -#define ISDN_CTYPE_ENTERNOW 41
  8293. +#define ISDN_CTYPE_HFC_USB 40
  8294. +#define ISDN_CTYPE_DYNAMIC 41
  8295. #define ISDN_CTYPE_COUNT 41
  8296. @@ -1267,10 +1264,6 @@ struct IsdnCardState {
  8297. #define CARD_NETJET_U 0
  8298. #endif
  8299. -#ifdef CONFIG_HISAX_ENTERNOW_PCI
  8300. -#define CARD_FN_ENTERNOW_PCI 1
  8301. -#endif
  8302. -
  8303. #define TEI_PER_CARD 1
  8304. /* L1 Debug */
  8305. Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_debug.h
  8306. ===================================================================
  8307. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hisax_debug.h
  8308. +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_debug.h
  8309. @@ -28,7 +28,7 @@
  8310. #define DBG(level, format, arg...) do { \
  8311. if (level & __debug_variable) \
  8312. -printk(KERN_DEBUG "%s: " format "\n" , __FUNCTION__ , ## arg); \
  8313. +printk(KERN_DEBUG __FUNCTION__ ": " format "\n" , ## arg); \
  8314. } while (0)
  8315. #define DBG_PACKET(level,data,count) \
  8316. Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_fcpcipnp.c
  8317. ===================================================================
  8318. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hisax_fcpcipnp.c
  8319. +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_fcpcipnp.c
  8320. @@ -20,22 +20,19 @@
  8321. *
  8322. * o POWER PC
  8323. * o clean up debugging
  8324. - * o tx_skb at PH_DEACTIVATE time
  8325. */
  8326. #include <linux/version.h>
  8327. #include <linux/module.h>
  8328. #include <linux/init.h>
  8329. #include <linux/pci.h>
  8330. -#include <linux/isapnp.h>
  8331. +#include "hisax_isapnp.h"
  8332. #include <linux/kmod.h>
  8333. #include <linux/slab.h>
  8334. #include <linux/skbuff.h>
  8335. #include <linux/netdevice.h>
  8336. -
  8337. -#include <asm/io.h>
  8338. -
  8339. #include "hisax_fcpcipnp.h"
  8340. +#include "hisax_isac.h"
  8341. // debugging cruft
  8342. #define __debug_variable debug
  8343. @@ -46,10 +43,14 @@ static int debug = 0;
  8344. MODULE_PARM(debug, "i");
  8345. #endif
  8346. -MODULE_AUTHOR("Kai Germaschewski <[email protected]>/Karsten Keil <[email protected]>");
  8347. +MODULE_AUTHOR("Kai Germaschewski <[email protected]>");
  8348. MODULE_DESCRIPTION("AVM Fritz!PCI/PnP ISDN driver");
  8349. -static struct pci_device_id fcpci_ids[] __devinitdata = {
  8350. +#ifndef PCI_DEVICE_ID_AVM_A1_V2
  8351. +#define PCI_DEVICE_ID_AVM_A1_V2 0x0e00
  8352. +#endif
  8353. +
  8354. +static struct pci_device_id fcpci_ids[] __initdata = {
  8355. { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1 , PCI_ANY_ID, PCI_ANY_ID,
  8356. 0, 0, (unsigned long) "Fritz!Card PCI" },
  8357. { PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1_V2, PCI_ANY_ID, PCI_ANY_ID,
  8358. @@ -58,7 +59,7 @@ static struct pci_device_id fcpci_ids[]
  8359. };
  8360. MODULE_DEVICE_TABLE(pci, fcpci_ids);
  8361. -static struct isapnp_device_id fcpnp_ids[] __devinitdata = {
  8362. +static struct isapnp_device_id fcpnp_ids[] __initdata = {
  8363. { ISAPNP_VENDOR('A', 'V', 'M'), ISAPNP_FUNCTION(0x0900),
  8364. ISAPNP_VENDOR('A', 'V', 'M'), ISAPNP_FUNCTION(0x0900),
  8365. (unsigned long) "Fritz!Card PnP" },
  8366. @@ -68,7 +69,8 @@ MODULE_DEVICE_TABLE(isapnp, fcpnp_ids);
  8367. static int protocol = 2; /* EURO-ISDN Default */
  8368. MODULE_PARM(protocol, "i");
  8369. -MODULE_LICENSE("GPL");
  8370. +
  8371. +static LIST_HEAD(adapter_list);
  8372. // ----------------------------------------------------------------------
  8373. @@ -147,7 +149,7 @@ static unsigned char fcpci_read_isac(str
  8374. outb(idx, adapter->io + AVM_INDEX);
  8375. val = inb(adapter->io + AVM_DATA + (offset & 0xf));
  8376. spin_unlock_irqrestore(&adapter->hw_lock, flags);
  8377. - DBG(0x1000, " port %#x, value %#x",
  8378. + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
  8379. offset, val);
  8380. return val;
  8381. }
  8382. @@ -160,7 +162,7 @@ static void fcpci_write_isac(struct isac
  8383. AVM_IDX_ISAC_REG_HIGH : AVM_IDX_ISAC_REG_LOW;
  8384. unsigned long flags;
  8385. - DBG(0x1000, " port %#x, value %#x",
  8386. + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
  8387. offset, value);
  8388. spin_lock_irqsave(&adapter->hw_lock, flags);
  8389. outb(idx, adapter->io + AVM_INDEX);
  8390. @@ -240,7 +242,7 @@ static unsigned char fcpci2_read_isac(st
  8391. outl(offset, adapter->io + AVM_ISACSX_INDEX);
  8392. val = inl(adapter->io + AVM_ISACSX_DATA);
  8393. spin_unlock_irqrestore(&adapter->hw_lock, flags);
  8394. - DBG(0x1000, " port %#x, value %#x",
  8395. + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
  8396. offset, val);
  8397. return val;
  8398. @@ -252,7 +254,7 @@ static void fcpci2_write_isac(struct isa
  8399. struct fritz_adapter *adapter = isac->priv;
  8400. unsigned long flags;
  8401. - DBG(0x1000, " port %#x, value %#x",
  8402. + DBG(0x1000, __FUNCTION__ " port %#x, value %#x",
  8403. offset, value);
  8404. spin_lock_irqsave(&adapter->hw_lock, flags);
  8405. outl(offset, adapter->io + AVM_ISACSX_INDEX);
  8406. @@ -375,6 +377,9 @@ static void hdlc_fill_fifo(struct fritz_
  8407. DBG(0x40, "hdlc_fill_fifo");
  8408. + if (!skb)
  8409. + BUG();
  8410. +
  8411. if (skb->len == 0)
  8412. BUG();
  8413. @@ -515,7 +520,6 @@ static inline void hdlc_xdu_irq(struct f
  8414. }
  8415. skb_push(bcs->tx_skb, bcs->tx_cnt);
  8416. bcs->tx_cnt = 0;
  8417. - hdlc_fill_fifo(bcs);
  8418. }
  8419. static inline void hdlc_xpr_irq(struct fritz_bcs *bcs)
  8420. @@ -536,7 +540,7 @@ static inline void hdlc_xpr_irq(struct f
  8421. dev_kfree_skb_irq(skb);
  8422. }
  8423. -static void hdlc_irq_one(struct fritz_bcs *bcs, u32 stat)
  8424. +static void hdlc_irq(struct fritz_bcs *bcs, u32 stat)
  8425. {
  8426. DBG(0x10, "ch%d stat %#x", bcs->channel, stat);
  8427. if (stat & HDLC_INT_RPR) {
  8428. @@ -553,7 +557,7 @@ static void hdlc_irq_one(struct fritz_bc
  8429. }
  8430. }
  8431. -static inline void hdlc_irq(struct fritz_adapter *adapter)
  8432. +static inline void hdlc_interrupt(struct fritz_adapter *adapter)
  8433. {
  8434. int nr;
  8435. u32 stat;
  8436. @@ -562,7 +566,7 @@ static inline void hdlc_irq(struct fritz
  8437. stat = adapter->read_hdlc_status(adapter, nr);
  8438. DBG(0x10, "HDLC %c stat %#x", 'A' + nr, stat);
  8439. if (stat & HDLC_INT_MASK)
  8440. - hdlc_irq_one(&adapter->bcs[nr], stat);
  8441. + hdlc_irq(&adapter->bcs[nr], stat);
  8442. }
  8443. }
  8444. @@ -584,14 +588,14 @@ static void modehdlc(struct fritz_bcs *b
  8445. adapter->write_ctrl(bcs, 5);
  8446. break;
  8447. case L1_MODE_TRANS:
  8448. + bcs->ctrl.sr.mode = HDLC_MODE_TRANS;
  8449. + adapter->write_ctrl(bcs, 5);
  8450. + bcs->ctrl.sr.cmd = HDLC_CMD_XRS;
  8451. + adapter->write_ctrl(bcs, 1);
  8452. + bcs->ctrl.sr.cmd = 0;
  8453. + break;
  8454. case L1_MODE_HDLC:
  8455. - bcs->rcvidx = 0;
  8456. - bcs->tx_cnt = 0;
  8457. - bcs->tx_skb = NULL;
  8458. - if (mode == L1_MODE_TRANS)
  8459. - bcs->ctrl.sr.mode = HDLC_MODE_TRANS;
  8460. - else
  8461. - bcs->ctrl.sr.mode = HDLC_MODE_ITF_FLG;
  8462. + bcs->ctrl.sr.mode = HDLC_MODE_ITF_FLG;
  8463. adapter->write_ctrl(bcs, 5);
  8464. bcs->ctrl.sr.cmd = HDLC_CMD_XRS;
  8465. adapter->write_ctrl(bcs, 1);
  8466. @@ -645,10 +649,10 @@ static void fcpci2_irq(int intno, void *
  8467. return;
  8468. DBG(2, "STATUS0 %#x", val);
  8469. if (val & AVM_STATUS0_IRQ_ISAC)
  8470. - isacsx_irq(&adapter->isac);
  8471. + isacsx_interrupt(&adapter->isac);
  8472. if (val & AVM_STATUS0_IRQ_HDLC)
  8473. - hdlc_irq(adapter);
  8474. + hdlc_interrupt(adapter);
  8475. }
  8476. static void fcpci_irq(int intno, void *dev, struct pt_regs *regs)
  8477. @@ -662,10 +666,10 @@ static void fcpci_irq(int intno, void *d
  8478. return;
  8479. DBG(2, "sval %#x", sval);
  8480. if (!(sval & AVM_STATUS0_IRQ_ISAC))
  8481. - isac_irq(&adapter->isac);
  8482. + isac_interrupt(&adapter->isac);
  8483. if (!(sval & AVM_STATUS0_IRQ_HDLC))
  8484. - hdlc_irq(adapter);
  8485. + hdlc_interrupt(adapter);
  8486. }
  8487. // ----------------------------------------------------------------------
  8488. @@ -681,11 +685,6 @@ static inline void fcpci_init(struct fri
  8489. {
  8490. outb(AVM_STATUS0_DIS_TIMER | AVM_STATUS0_RES_TIMER |
  8491. AVM_STATUS0_ENA_IRQ, adapter->io + AVM_STATUS0);
  8492. -
  8493. - outb(AVM_STATUS1_ENA_IOM | adapter->irq,
  8494. - adapter->io + AVM_STATUS1);
  8495. - set_current_state(TASK_UNINTERRUPTIBLE);
  8496. - schedule_timeout(50*HZ / 1000); /* Timeout 50ms */
  8497. }
  8498. // ----------------------------------------------------------------------
  8499. @@ -693,6 +692,7 @@ static inline void fcpci_init(struct fri
  8500. static int __devinit fcpcipnp_setup(struct fritz_adapter *adapter)
  8501. {
  8502. u32 val = 0;
  8503. + struct pci_dev *pdev = adapter->pci_dev;
  8504. int retval;
  8505. DBG(1,"");
  8506. @@ -700,21 +700,21 @@ static int __devinit fcpcipnp_setup(stru
  8507. isac_init(&adapter->isac); // FIXME is this okay now
  8508. retval = -EBUSY;
  8509. - if (!request_region(adapter->io, 32, "fcpcipnp"))
  8510. + if (!request_region(adapter->io, 32, "hisax_fcpcipnp"))
  8511. goto err;
  8512. switch (adapter->type) {
  8513. case AVM_FRITZ_PCIV2:
  8514. - retval = request_irq(adapter->irq, fcpci2_irq, SA_SHIRQ,
  8515. - "fcpcipnp", adapter);
  8516. + retval = request_irq(pdev->irq, fcpci2_irq, SA_SHIRQ,
  8517. + "hisax_fcpcipnp", adapter);
  8518. break;
  8519. case AVM_FRITZ_PCI:
  8520. - retval = request_irq(adapter->irq, fcpci_irq, SA_SHIRQ,
  8521. - "fcpcipnp", adapter);
  8522. + retval = request_irq(pdev->irq, fcpci_irq, SA_SHIRQ,
  8523. + "hisax_fcpcipnp", adapter);
  8524. break;
  8525. case AVM_FRITZ_PNP:
  8526. - retval = request_irq(adapter->irq, fcpci_irq, 0,
  8527. - "fcpcipnp", adapter);
  8528. + retval = request_irq(pdev->irq, fcpci_irq, 0,
  8529. + "hisax_fcpcipnp", adapter);
  8530. break;
  8531. }
  8532. if (retval)
  8533. @@ -808,11 +808,23 @@ static int __devinit fcpcipnp_setup(stru
  8534. static void __devexit fcpcipnp_release(struct fritz_adapter *adapter)
  8535. {
  8536. + struct pci_dev *pdev = adapter->pci_dev;
  8537. +
  8538. DBG(1,"");
  8539. outb(0, adapter->io + AVM_STATUS0);
  8540. - free_irq(adapter->irq, adapter);
  8541. + free_irq(pdev->irq, adapter);
  8542. release_region(adapter->io, 32);
  8543. +
  8544. + switch (adapter->type) {
  8545. + case AVM_FRITZ_PCI:
  8546. + case AVM_FRITZ_PCIV2:
  8547. + pci_disable_device(pdev);
  8548. + break;
  8549. + case AVM_FRITZ_PNP:
  8550. + pdev->deactivate(pdev);
  8551. + break;
  8552. + }
  8553. }
  8554. // ----------------------------------------------------------------------
  8555. @@ -830,6 +842,8 @@ new_adapter(struct pci_dev *pdev)
  8556. memset(adapter, 0, sizeof(struct fritz_adapter));
  8557. + adapter->pci_dev = pdev;
  8558. +
  8559. SET_MODULE_OWNER(&adapter->isac.hisax_d_if);
  8560. adapter->isac.hisax_d_if.ifc.priv = &adapter->isac;
  8561. adapter->isac.hisax_d_if.ifc.l2l1 = isac_d_l2l1;
  8562. @@ -840,6 +854,7 @@ new_adapter(struct pci_dev *pdev)
  8563. adapter->bcs[i].b_if.ifc.priv = &adapter->bcs[i];
  8564. adapter->bcs[i].b_if.ifc.l2l1 = fritz_b_l2l1;
  8565. }
  8566. + list_add(&adapter->list, &adapter_list);
  8567. pci_set_drvdata(pdev, adapter);
  8568. @@ -854,6 +869,7 @@ new_adapter(struct pci_dev *pdev)
  8569. static void delete_adapter(struct fritz_adapter *adapter)
  8570. {
  8571. hisax_unregister(&adapter->isac.hisax_d_if);
  8572. + list_del(&adapter->list);
  8573. kfree(adapter);
  8574. }
  8575. @@ -863,12 +879,15 @@ static int __devinit fcpci_probe(struct
  8576. struct fritz_adapter *adapter;
  8577. int retval;
  8578. + printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at %s\n",
  8579. + (char *) ent->driver_data, pdev->slot_name);
  8580. +
  8581. retval = -ENOMEM;
  8582. adapter = new_adapter(pdev);
  8583. if (!adapter)
  8584. goto err;
  8585. - if (pdev->device == PCI_DEVICE_ID_AVM_A1_V2)
  8586. + if (pdev->device == 0x0e00)
  8587. adapter->type = AVM_FRITZ_PCIV2;
  8588. else
  8589. adapter->type = AVM_FRITZ_PCI;
  8590. @@ -876,12 +895,7 @@ static int __devinit fcpci_probe(struct
  8591. retval = pci_enable_device(pdev);
  8592. if (retval)
  8593. goto err_free;
  8594. -
  8595. adapter->io = pci_resource_start(pdev, 1);
  8596. - adapter->irq = pdev->irq;
  8597. -
  8598. - printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at %s\n",
  8599. - (char *) ent->driver_data, pdev->slot_name);
  8600. retval = fcpcipnp_setup(adapter);
  8601. if (retval)
  8602. @@ -901,6 +915,9 @@ static int __devinit fcpnp_probe(struct
  8603. struct fritz_adapter *adapter;
  8604. int retval;
  8605. + printk(KERN_INFO "hisax_fcpcipnp: found adapter %s\n",
  8606. + (char *) ent->driver_data);
  8607. +
  8608. retval = -ENOMEM;
  8609. adapter = new_adapter(pdev);
  8610. if (!adapter)
  8611. @@ -912,11 +929,8 @@ static int __devinit fcpnp_probe(struct
  8612. pdev->deactivate(pdev); // why?
  8613. pdev->activate(pdev);
  8614. adapter->io = pdev->resource[0].start;
  8615. - adapter->irq = pdev->irq_resource[0].start;
  8616. -
  8617. - printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at IO %#x irq %d\n",
  8618. - (char *) ent->driver_data, adapter->io, adapter->irq);
  8619. -
  8620. + pdev->irq = pdev->irq_resource[0].start;
  8621. +
  8622. retval = fcpcipnp_setup(adapter);
  8623. if (retval)
  8624. goto err_free;
  8625. @@ -929,43 +943,35 @@ static int __devinit fcpnp_probe(struct
  8626. return retval;
  8627. }
  8628. -static void __devexit fcpci_remove(struct pci_dev *pdev)
  8629. -{
  8630. - struct fritz_adapter *adapter = pci_get_drvdata(pdev);
  8631. -
  8632. - fcpcipnp_release(adapter);
  8633. - pci_disable_device(pdev);
  8634. - delete_adapter(adapter);
  8635. -}
  8636. -
  8637. -static void __devexit fcpnp_remove(struct pci_dev *pdev)
  8638. +static void __devexit fcpcipnp_remove(struct pci_dev *pdev)
  8639. {
  8640. struct fritz_adapter *adapter = pci_get_drvdata(pdev);
  8641. fcpcipnp_release(adapter);
  8642. - pdev->deactivate(pdev);
  8643. delete_adapter(adapter);
  8644. }
  8645. static struct pci_driver fcpci_driver = {
  8646. - name: "fcpci",
  8647. - probe: fcpci_probe,
  8648. - remove: __devexit_p(fcpci_remove),
  8649. + name: "fcpci",
  8650. + probe: fcpci_probe,
  8651. + remove: fcpcipnp_remove,
  8652. id_table: fcpci_ids,
  8653. };
  8654. static struct isapnp_driver fcpnp_driver = {
  8655. - name: "fcpnp",
  8656. - probe: fcpnp_probe,
  8657. - remove: __devexit_p(fcpnp_remove),
  8658. + name: "fcpnp",
  8659. + probe: fcpnp_probe,
  8660. + remove: fcpcipnp_remove,
  8661. id_table: fcpnp_ids,
  8662. };
  8663. -static int __init hisax_fcpcipnp_init(void)
  8664. +static LIST_HEAD(isapnp_drivers);
  8665. +
  8666. +static int __init hisax_fcpci_init(void)
  8667. {
  8668. int retval, pci_nr_found;
  8669. - printk(KERN_INFO "hisax_fcpcipnp: Fritz!Card PCI/PCIv2/PnP ISDN driver v0.0.1\n");
  8670. + printk(KERN_INFO "hisax_fcpcipnp: Fritz!PCI/PnP ISDN driver v0.0.1\n");
  8671. retval = pci_register_driver(&fcpci_driver);
  8672. if (retval < 0)
  8673. @@ -976,15 +982,14 @@ static int __init hisax_fcpcipnp_init(vo
  8674. if (retval < 0)
  8675. goto out_unregister_pci;
  8676. -#if !defined(CONFIG_HOTPLUG) || defined(MODULE)
  8677. +#if !defined(CONFIG_HOTPLUG) && defined(MODULE)
  8678. if (pci_nr_found + retval == 0) {
  8679. retval = -ENODEV;
  8680. goto out_unregister_isapnp;
  8681. - }
  8682. #endif
  8683. return 0;
  8684. -#if !defined(CONFIG_HOTPLUG) || defined(MODULE)
  8685. +#if !defined(CONFIG_HOTPLUG) && defined(MODULE)
  8686. out_unregister_isapnp:
  8687. isapnp_unregister_driver(&fcpnp_driver);
  8688. #endif
  8689. @@ -994,11 +999,15 @@ static int __init hisax_fcpcipnp_init(vo
  8690. return retval;
  8691. }
  8692. -static void __exit hisax_fcpcipnp_exit(void)
  8693. +static void __exit hisax_fcpci_exit(void)
  8694. {
  8695. isapnp_unregister_driver(&fcpnp_driver);
  8696. pci_unregister_driver(&fcpci_driver);
  8697. }
  8698. -module_init(hisax_fcpcipnp_init);
  8699. -module_exit(hisax_fcpcipnp_exit);
  8700. +module_init(hisax_fcpci_init);
  8701. +module_exit(hisax_fcpci_exit);
  8702. +
  8703. +#ifdef __ISAPNP__
  8704. +#include "hisax_isapnp.c"
  8705. +#endif
  8706. Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_fcpcipnp.h
  8707. ===================================================================
  8708. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hisax_fcpcipnp.h
  8709. +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_fcpcipnp.h
  8710. @@ -43,10 +43,12 @@ struct fritz_bcs {
  8711. };
  8712. struct fritz_adapter {
  8713. + struct list_head list;
  8714. + struct pci_dev *pci_dev;
  8715. +
  8716. int type;
  8717. spinlock_t hw_lock;
  8718. unsigned int io;
  8719. - unsigned int irq;
  8720. struct isac isac;
  8721. struct fritz_bcs bcs[2];
  8722. Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_isac.c
  8723. ===================================================================
  8724. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hisax_isac.c
  8725. +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_isac.c
  8726. @@ -34,7 +34,7 @@
  8727. static int debug = 1;
  8728. MODULE_PARM(debug, "i");
  8729. -static char *ISACVer[] = {
  8730. +static char *ISACVer[] __devinitdata = {
  8731. "2086/2186 V1.1",
  8732. "2085 B1",
  8733. "2085 B2",
  8734. @@ -42,10 +42,6 @@ static char *ISACVer[] = {
  8735. };
  8736. #endif
  8737. -MODULE_AUTHOR("Kai Germaschewski <[email protected]>/Karsten Keil <[email protected]>");
  8738. -MODULE_DESCRIPTION("ISAC/ISAC-SX driver");
  8739. -MODULE_LICENSE("GPL");
  8740. -
  8741. #define DBG_WARN 0x0001
  8742. #define DBG_IRQ 0x0002
  8743. #define DBG_L1M 0x0004
  8744. @@ -438,7 +434,7 @@ static void l1m_debug(struct FsmInst *fi
  8745. va_end(args);
  8746. }
  8747. -static void isac_version(struct isac *cs)
  8748. +static void __devinit isac_version(struct isac *cs)
  8749. {
  8750. int val;
  8751. @@ -602,7 +598,7 @@ static inline void isac_exi_interrupt(st
  8752. }
  8753. }
  8754. -void isac_irq(struct isac *isac)
  8755. +void isac_interrupt(struct isac *isac)
  8756. {
  8757. unsigned char val;
  8758. @@ -635,8 +631,6 @@ void isac_irq(struct isac *isac)
  8759. if (val & ISAC_ISTA_SIN) {
  8760. DBG(DBG_WARN, "SIN");
  8761. }
  8762. - isac->write_isac(isac, ISAC_MASK, 0xff);
  8763. - isac->write_isac(isac, ISAC_MASK, 0x00);
  8764. }
  8765. // ======================================================================
  8766. @@ -742,7 +736,7 @@ static inline void isacsx_icd_interrupt(
  8767. }
  8768. }
  8769. -void isacsx_irq(struct isac *isac)
  8770. +void isacsx_interrupt(struct isac *isac)
  8771. {
  8772. unsigned char val;
  8773. @@ -755,7 +749,7 @@ void isacsx_irq(struct isac *isac)
  8774. isacsx_cic_interrupt(isac);
  8775. }
  8776. -void isac_init(struct isac *isac)
  8777. +void __devinit isac_init(struct isac *isac)
  8778. {
  8779. isac->tx_skb = NULL;
  8780. isac->l1m.fsm = &l1fsm;
  8781. @@ -770,7 +764,7 @@ void isac_init(struct isac *isac)
  8782. FsmInitTimer(&isac->l1m, &isac->timer);
  8783. }
  8784. -void isac_setup(struct isac *isac)
  8785. +void __devinit isac_setup(struct isac *isac)
  8786. {
  8787. int val, eval;
  8788. @@ -781,7 +775,7 @@ void isac_setup(struct isac *isac)
  8789. isac->write_isac(isac, ISAC_MASK, 0xff);
  8790. isac->mocr = 0xaa;
  8791. - if (test_bit(ISAC_IOM1, &isac->flags)) {
  8792. + if (test_bit(HW_IOM1, &isac->flags)) {
  8793. /* IOM 1 Mode */
  8794. isac->write_isac(isac, ISAC_ADF2, 0x0);
  8795. isac->write_isac(isac, ISAC_SPCR, 0xa);
  8796. @@ -817,7 +811,7 @@ void isac_setup(struct isac *isac)
  8797. FsmEvent(&isac->l1m, (val >> 2) & 0xf, NULL);
  8798. isac->write_isac(isac, ISAC_MASK, 0x0);
  8799. - // RESET Receiver and Transmitter
  8800. + /* RESET Receiver and Transmitter */
  8801. isac->write_isac(isac, ISAC_CMDR, ISAC_CMDR_XRES | ISAC_CMDR_RRES);
  8802. }
  8803. @@ -888,10 +882,10 @@ EXPORT_SYMBOL(isac_init);
  8804. EXPORT_SYMBOL(isac_d_l2l1);
  8805. EXPORT_SYMBOL(isacsx_setup);
  8806. -EXPORT_SYMBOL(isacsx_irq);
  8807. +EXPORT_SYMBOL(isacsx_interrupt);
  8808. EXPORT_SYMBOL(isac_setup);
  8809. -EXPORT_SYMBOL(isac_irq);
  8810. +EXPORT_SYMBOL(isac_interrupt);
  8811. module_init(hisax_isac_init);
  8812. module_exit(hisax_isac_exit);
  8813. Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_isac.h
  8814. ===================================================================
  8815. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hisax_isac.h
  8816. +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_isac.h
  8817. @@ -8,7 +8,7 @@
  8818. #define TIMER3_VALUE 7000
  8819. #define MAX_DFRAME_LEN_L1 300
  8820. -#define ISAC_IOM1 0
  8821. +#define HW_IOM1 0
  8822. struct isac {
  8823. void *priv;
  8824. @@ -37,9 +37,9 @@ void isac_init(struct isac *isac);
  8825. void isac_d_l2l1(struct hisax_if *hisax_d_if, int pr, void *arg);
  8826. void isac_setup(struct isac *isac);
  8827. -void isac_irq(struct isac *isac);
  8828. +void isac_interrupt(struct isac *isac);
  8829. void isacsx_setup(struct isac *isac);
  8830. -void isacsx_irq(struct isac *isac);
  8831. +void isacsx_interrupt(struct isac *isac);
  8832. #endif
  8833. Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_isapnp.c
  8834. ===================================================================
  8835. --- /dev/null
  8836. +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_isapnp.c
  8837. @@ -0,0 +1,105 @@
  8838. +// FIXME copied
  8839. +static const struct isapnp_device_id *
  8840. +isapnp_match_device(const struct isapnp_device_id *ids, struct pci_dev *dev)
  8841. +{
  8842. + DBG(1,"");
  8843. +
  8844. + while (ids->card_vendor || ids->card_device) {
  8845. + if ((ids->card_vendor == ISAPNP_ANY_ID || ids->card_vendor == dev->bus->vendor) &&
  8846. + (ids->card_device == ISAPNP_ANY_ID || ids->card_device == dev->bus->device) &&
  8847. + (ids->vendor == ISAPNP_ANY_ID || ids->vendor == dev->vendor) &&
  8848. + (ids->function == ISAPNP_ANY_ID || ids->function == dev->device))
  8849. + return ids;
  8850. + ids++;
  8851. + }
  8852. + return NULL;
  8853. +}
  8854. +
  8855. +/**
  8856. + * pci_dev_driver - get the pci_driver of a device
  8857. + * @dev: the device to query
  8858. + *
  8859. + * Returns the appropriate pci_driver structure or %NULL if there is no
  8860. + * registered driver for the device.
  8861. + */
  8862. +struct pci_driver *isapnp_dev_driver(const struct pci_dev *dev)
  8863. +{
  8864. + return dev->driver;
  8865. +}
  8866. +
  8867. +static int isapnp_announce_device(struct isapnp_driver *drv, struct pci_dev *dev)
  8868. +{
  8869. + const struct isapnp_device_id *id;
  8870. + int ret = 0;
  8871. +
  8872. + DBG(1,"");
  8873. +
  8874. + if (drv->id_table) {
  8875. + id = isapnp_match_device(drv->id_table, dev);
  8876. + if (!id) {
  8877. + ret = 0;
  8878. + goto out;
  8879. + }
  8880. + } else
  8881. + id = NULL;
  8882. +
  8883. +// dev_probe_lock();
  8884. + if (drv->probe(dev, id) >= 0) {
  8885. + dev->driver = (struct pci_driver *) drv;
  8886. + ret = 1;
  8887. + }
  8888. +// dev_probe_unlock();
  8889. +out:
  8890. + return ret;
  8891. +}
  8892. +
  8893. +/**
  8894. + * FIXME pci_register_driver - register a new pci driver
  8895. + * @drv: the driver structure to register
  8896. + *
  8897. + * Adds the driver structure to the list of registered drivers
  8898. + * Returns the number of pci devices which were claimed by the driver
  8899. + * during registration. The driver remains registered even if the
  8900. + * return value is zero.
  8901. + */
  8902. +int isapnp_register_driver(struct isapnp_driver *drv)
  8903. +{
  8904. + struct pci_dev *dev;
  8905. + int count = 0;
  8906. +
  8907. + DBG(1,"");
  8908. +
  8909. + list_add_tail(&drv->node, &isapnp_drivers);
  8910. + isapnp_for_each_dev(dev) {
  8911. + if (!isapnp_dev_driver(dev))
  8912. + count += isapnp_announce_device(drv, dev);
  8913. + }
  8914. + return count;
  8915. +}
  8916. +
  8917. +/**
  8918. + * pci_unregister_driver - unregister a pci driver
  8919. + * @drv: the driver structure to unregister
  8920. + *
  8921. + * Deletes the driver structure from the list of registered PCI drivers,
  8922. + * gives it a chance to clean up by calling its remove() function for
  8923. + * each device it was responsible for, and marks those devices as
  8924. + * driverless.
  8925. + */
  8926. +
  8927. +void isapnp_unregister_driver(struct isapnp_driver *drv)
  8928. +{
  8929. + struct pci_dev *dev;
  8930. +
  8931. + DBG(1,"");
  8932. +
  8933. + list_del(&drv->node);
  8934. + isapnp_for_each_dev(dev) {
  8935. + if (dev->driver == (struct pci_driver *) drv) {
  8936. + if (drv->remove)
  8937. + drv->remove(dev);
  8938. + dev->driver = NULL;
  8939. + }
  8940. + }
  8941. +}
  8942. +
  8943. Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_isapnp.h
  8944. ===================================================================
  8945. --- /dev/null
  8946. +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_isapnp.h
  8947. @@ -0,0 +1,33 @@
  8948. +#ifndef __HISAX_ISAPNP_H__
  8949. +#define __HISAX_ISAPNP_H__
  8950. +
  8951. +#include <linux/isapnp.h>
  8952. +
  8953. +#ifdef COMPAT_NEED_ISAPNP_DRIVER
  8954. +struct isapnp_driver {
  8955. + struct list_head node;
  8956. + char *name;
  8957. + const struct isapnp_device_id *id_table; /* NULL if wants all devices */
  8958. + int (*probe) (struct pci_dev *dev, const struct isapnp_device_id *id); /* New device inserted */
  8959. + void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
  8960. +};
  8961. +#endif
  8962. +#ifdef __ISAPNP__
  8963. +
  8964. +int isapnp_register_driver(struct isapnp_driver *drv);
  8965. +void isapnp_unregister_driver(struct isapnp_driver *drv);
  8966. +
  8967. +#else
  8968. +
  8969. +static inline int isapnp_register_driver(struct isapnp_driver *drv)
  8970. +{
  8971. + return 0;
  8972. +}
  8973. +
  8974. +static inline void isapnp_unregister_driver(struct isapnp_driver *drv)
  8975. +{
  8976. +}
  8977. +
  8978. +#endif
  8979. +
  8980. +#endif
  8981. Index: linux-2.4.35.4/drivers/isdn/hisax/hisax_loadable.h
  8982. ===================================================================
  8983. --- /dev/null
  8984. +++ linux-2.4.35.4/drivers/isdn/hisax/hisax_loadable.h
  8985. @@ -0,0 +1,74 @@
  8986. +/* $Id: hisax_loadable.h,v 2.1 2001/06/08 22:19:16 werner Exp $
  8987. + *
  8988. + *
  8989. + * Author (C) 2001 Werner Cornelius ([email protected])
  8990. + * modular driver for Colognechip HFC-USB chip
  8991. + * as plugin for HiSax isdn driver
  8992. + *
  8993. + * Copyright 2001 by Werner Cornelius ([email protected])
  8994. + *
  8995. + * This program is free software; you can redistribute it and/or modify
  8996. + * it under the terms of the GNU General Public License as published by
  8997. + * the Free Software Foundation; either version 2, or (at your option)
  8998. + * any later version.
  8999. + *
  9000. + * This program is distributed in the hope that it will be useful,
  9001. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9002. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9003. + * GNU General Public License for more details.
  9004. + *
  9005. + * You should have received a copy of the GNU General Public License
  9006. + * along with this program; if not, write to the Free Software
  9007. + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  9008. + *
  9009. + */
  9010. +
  9011. +#include <linux/types.h>
  9012. +#include <linux/skbuff.h>
  9013. +
  9014. +/***************************************/
  9015. +/* additional defines for l1 constants */
  9016. +/***************************************/
  9017. +#define B1_DATA 0x1f0
  9018. +#define B1_SETMODE 0x1f4
  9019. +#define B2_DATA 0x1f8
  9020. +#define B2_SETMODE 0x1fc
  9021. +
  9022. +
  9023. +/********************************************************/
  9024. +/* structure used for register and release of L1 driver */
  9025. +/********************************************************/
  9026. +struct hisax_drvreg {
  9027. + int version; /* actual version for check */
  9028. + int cmd; /* command code */
  9029. +
  9030. + /* function pointers set by hisax during register call */
  9031. + void (*release_driver) (void *arg_hisax); /* set by hisax, release function for driver */
  9032. + void (*dch_l1l2) (void *arg_hisax, int pr, void *arg); /* set by hisax, notify dch+l1 events */
  9033. + void (*bch_l1l2) (void *arg_hisax, int chan, int pr, void *arg); /* set by hisax, notify bch events */
  9034. + void *arg_hisax; /* argument when calling hisax main */
  9035. + struct sk_buff_head *drq; /* pointer to D-receive queue */
  9036. + struct sk_buff_head *dsq; /* pointer to D-send queue */
  9037. + struct sk_buff_head erq; /* E-receive queue */
  9038. + struct sk_buff_head *brq[2]; /* pointer to B-receive queues */
  9039. + struct sk_buff **bsk[2]; /* pointer to B-transmit buffer */
  9040. +
  9041. + /* function pointers set by l1 driver before calling the register function */
  9042. + void (*dch_l2l1) (void *argl1, int pr, void *arg); /* function dch+l1 from hisax -> l1 */
  9043. + void (*bch_l2l1) (void *argl1, int chan, int pr, void *arg); /* function bch from hisax -> l1 */
  9044. + void *argl1; /* pointer to l1 data structure when calling l1 */
  9045. +
  9046. + char *drvname; /* driver name for hisax usage */
  9047. +};
  9048. +
  9049. +/**************************/
  9050. +/* constants and commands */
  9051. +/**************************/
  9052. +#define HISAX_LOAD_VERSION 4 /* change when interface changes */
  9053. +#define HISAX_LOAD_CHKVER 0 /* check version command (returns 0 on success) */
  9054. +#define HISAX_LOAD_REGISTER 1 /* register the L1 driver and return 0 on success */
  9055. +
  9056. +/***************************************/
  9057. +/* definition of the register function */
  9058. +/***************************************/
  9059. +extern int hisax_register_hfcusb(struct hisax_drvreg *l1drv);
  9060. Index: linux-2.4.35.4/drivers/isdn/hisax/hscx.c
  9061. ===================================================================
  9062. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hscx.c
  9063. +++ linux-2.4.35.4/drivers/isdn/hisax/hscx.c
  9064. @@ -1,4 +1,4 @@
  9065. -/* $Id: hscx.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9066. +/* $Id: hscx.c,v 1.24 2001/09/24 13:22:56 kai Exp $
  9067. *
  9068. * HSCX specific routines
  9069. *
  9070. Index: linux-2.4.35.4/drivers/isdn/hisax/hscx.h
  9071. ===================================================================
  9072. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hscx.h
  9073. +++ linux-2.4.35.4/drivers/isdn/hisax/hscx.h
  9074. @@ -1,4 +1,4 @@
  9075. -/* $Id: hscx.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9076. +/* $Id: hscx.h,v 1.8 2001/09/24 13:22:56 kai Exp $
  9077. *
  9078. * HSCX specific defines
  9079. *
  9080. Index: linux-2.4.35.4/drivers/isdn/hisax/hscx_irq.c
  9081. ===================================================================
  9082. --- linux-2.4.35.4.orig/drivers/isdn/hisax/hscx_irq.c
  9083. +++ linux-2.4.35.4/drivers/isdn/hisax/hscx_irq.c
  9084. @@ -1,4 +1,4 @@
  9085. -/* $Id: hscx_irq.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9086. +/* $Id: hscx_irq.c,v 1.18 2001/09/24 13:22:56 kai Exp $
  9087. *
  9088. * low level b-channel stuff for Siemens HSCX
  9089. *
  9090. Index: linux-2.4.35.4/drivers/isdn/hisax/icc.c
  9091. ===================================================================
  9092. --- linux-2.4.35.4.orig/drivers/isdn/hisax/icc.c
  9093. +++ linux-2.4.35.4/drivers/isdn/hisax/icc.c
  9094. @@ -1,4 +1,4 @@
  9095. -/* $Id: icc.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9096. +/* $Id: icc.c,v 1.8 2001/09/24 13:22:56 kai Exp $
  9097. *
  9098. * ICC specific routines
  9099. *
  9100. Index: linux-2.4.35.4/drivers/isdn/hisax/icc.h
  9101. ===================================================================
  9102. --- linux-2.4.35.4.orig/drivers/isdn/hisax/icc.h
  9103. +++ linux-2.4.35.4/drivers/isdn/hisax/icc.h
  9104. @@ -1,4 +1,4 @@
  9105. -/* $Id: icc.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9106. +/* $Id: icc.h,v 1.4 2001/09/24 13:22:56 kai Exp $
  9107. *
  9108. * ICC specific routines
  9109. *
  9110. Index: linux-2.4.35.4/drivers/isdn/hisax/ipac.h
  9111. ===================================================================
  9112. --- linux-2.4.35.4.orig/drivers/isdn/hisax/ipac.h
  9113. +++ linux-2.4.35.4/drivers/isdn/hisax/ipac.h
  9114. @@ -1,4 +1,4 @@
  9115. -/* $Id: ipac.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9116. +/* $Id: ipac.h,v 1.7 2001/09/24 13:22:56 kai Exp $
  9117. *
  9118. * IPAC specific defines
  9119. *
  9120. Index: linux-2.4.35.4/drivers/isdn/hisax/isac.c
  9121. ===================================================================
  9122. --- linux-2.4.35.4.orig/drivers/isdn/hisax/isac.c
  9123. +++ linux-2.4.35.4/drivers/isdn/hisax/isac.c
  9124. @@ -1,4 +1,4 @@
  9125. -/* $Id: isac.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9126. +/* $Id: isac.c,v 1.31 2001/09/24 13:22:56 kai Exp $
  9127. *
  9128. * ISAC specific routines
  9129. *
  9130. Index: linux-2.4.35.4/drivers/isdn/hisax/isac.h
  9131. ===================================================================
  9132. --- linux-2.4.35.4.orig/drivers/isdn/hisax/isac.h
  9133. +++ linux-2.4.35.4/drivers/isdn/hisax/isac.h
  9134. @@ -1,4 +1,4 @@
  9135. -/* $Id: isac.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9136. +/* $Id: isac.h,v 1.9 2001/09/24 13:22:56 kai Exp $
  9137. *
  9138. * ISAC specific defines
  9139. *
  9140. Index: linux-2.4.35.4/drivers/isdn/hisax/isar.c
  9141. ===================================================================
  9142. --- linux-2.4.35.4.orig/drivers/isdn/hisax/isar.c
  9143. +++ linux-2.4.35.4/drivers/isdn/hisax/isar.c
  9144. @@ -1,4 +1,4 @@
  9145. -/* $Id: isar.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9146. +/* $Id: isar.c,v 1.22 2001/09/23 12:00:05 keil Exp $
  9147. *
  9148. * isar.c ISAR (Siemens PSB 7110) specific routines
  9149. *
  9150. @@ -21,12 +21,10 @@
  9151. #define DLE 0x10
  9152. #define ETX 0x03
  9153. -#define FAXMODCNT 13
  9154. -const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146};
  9155. -static u_int modmask = 0x1fff;
  9156. -static int frm_extra_delay = 2;
  9157. -static int para_TOA = 6;
  9158. -const u_char *FC1_CMD[] = {"FAE", "FTS", "FRS", "FTM", "FRM", "FTH", "FRH", "CTRL" };
  9159. +
  9160. +const u_char faxmodulation_s[] = "3,24,48,72,73,74,96,97,98,121,122,145,146";
  9161. +const u_char faxmodulation[] = {3,24,48,72,73,74,96,97,98,121,122,145,146};
  9162. +#define FAXMODCNT 13
  9163. void isar_setup(struct IsdnCardState *cs);
  9164. static void isar_pump_cmd(struct BCState *bcs, u_char cmd, u_char para);
  9165. @@ -127,7 +125,7 @@ get_irq_infos(struct IsdnCardState *cs,
  9166. ireg->clsb = cs->BC_Read_Reg(cs, 1, ISAR_CTRL_L);
  9167. #if DUMP_MBOXFRAME
  9168. if (cs->debug & L1_DEB_HSCX)
  9169. - debugl1(cs, "irq_stat(%02x,%02x,%d)", ireg->iis, ireg->cmsb,
  9170. + debugl1(cs, "rcv_mbox(%02x,%02x,%d)", ireg->iis, ireg->cmsb,
  9171. ireg->clsb);
  9172. #endif
  9173. }
  9174. @@ -414,7 +412,6 @@ isar_load_firmware(struct IsdnCardState
  9175. }
  9176. cs->debug = debug;
  9177. isar_setup(cs);
  9178. -
  9179. ret = 0;
  9180. reterrflg:
  9181. restore_flags(flags);
  9182. @@ -428,21 +425,6 @@ reterror:
  9183. return(ret);
  9184. }
  9185. -static inline void
  9186. -ll_deliver_faxstat(struct BCState *bcs, u_char status)
  9187. -{
  9188. - isdn_ctrl ic;
  9189. - struct Channel *chanp = (struct Channel *) bcs->st->lli.userdata;
  9190. -
  9191. - if (bcs->cs->debug & L1_DEB_HSCX)
  9192. - debugl1(bcs->cs, "HL->LL FAXIND %x", status);
  9193. - ic.driver = bcs->cs->myid;
  9194. - ic.command = ISDN_STAT_FAXIND;
  9195. - ic.arg = chanp->chan;
  9196. - ic.parm.aux.cmd = status;
  9197. - bcs->cs->iif.statcallb(&ic);
  9198. -}
  9199. -
  9200. extern void BChannel_bh(struct BCState *);
  9201. #define B_LL_NOCARRIER 8
  9202. #define B_LL_CONNECT 9
  9203. @@ -599,6 +581,7 @@ isar_rcv_frame(struct IsdnCardState *cs,
  9204. if (ireg->cmsb & SART_NMD) { /* ABORT */
  9205. if (cs->debug & L1_DEB_WARN)
  9206. debugl1(cs, "isar_rcv_frame: no more data");
  9207. + cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
  9208. bcs->hw.isar.rcvidx = 0;
  9209. send_DLE_ETX(bcs);
  9210. sendmsg(cs, SET_DPS(bcs->hw.isar.dpath) |
  9211. @@ -609,6 +592,7 @@ isar_rcv_frame(struct IsdnCardState *cs,
  9212. }
  9213. } else {
  9214. printk(KERN_WARNING "HiSax: skb out of memory\n");
  9215. + cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
  9216. }
  9217. break;
  9218. }
  9219. @@ -633,9 +617,8 @@ isar_rcv_frame(struct IsdnCardState *cs,
  9220. bcs->hw.isar.rcvidx = 0;
  9221. cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
  9222. } else {
  9223. - if (ireg->cmsb & HDLC_FSD) {
  9224. + if (ireg->cmsb & HDLC_FSD)
  9225. bcs->hw.isar.rcvidx = 0;
  9226. - }
  9227. ptr = bcs->hw.isar.rcvbuf + bcs->hw.isar.rcvidx;
  9228. bcs->hw.isar.rcvidx += ireg->clsb;
  9229. rcv_mbox(cs, ireg, ptr);
  9230. @@ -646,8 +629,6 @@ isar_rcv_frame(struct IsdnCardState *cs,
  9231. if (cs->debug & L1_DEB_WARN)
  9232. debugl1(cs, "isar frame to short %d",
  9233. bcs->hw.isar.rcvidx);
  9234. - printk(KERN_WARNING "ISAR: frame to short %d\n",
  9235. - bcs->hw.isar.rcvidx);
  9236. } else if (!(skb = dev_alloc_skb(bcs->hw.isar.rcvidx))) {
  9237. printk(KERN_WARNING "ISAR: receive out of memory\n");
  9238. } else {
  9239. @@ -658,7 +639,6 @@ isar_rcv_frame(struct IsdnCardState *cs,
  9240. isar_sched_event(bcs, B_RCVBUFREADY);
  9241. send_DLE_ETX(bcs);
  9242. isar_sched_event(bcs, B_LL_OK);
  9243. - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
  9244. }
  9245. bcs->hw.isar.rcvidx = 0;
  9246. }
  9247. @@ -666,14 +646,13 @@ isar_rcv_frame(struct IsdnCardState *cs,
  9248. if (ireg->cmsb & SART_NMD) { /* ABORT */
  9249. if (cs->debug & L1_DEB_WARN)
  9250. debugl1(cs, "isar_rcv_frame: no more data");
  9251. + cs->BC_Write_Reg(cs, 1, ISAR_IIA, 0);
  9252. bcs->hw.isar.rcvidx = 0;
  9253. + send_DLE_ETX(bcs);
  9254. sendmsg(cs, SET_DPS(bcs->hw.isar.dpath) |
  9255. ISAR_HIS_PUMPCTRL, PCTRL_CMD_ESC, 0, NULL);
  9256. bcs->hw.isar.state = STFAX_ESCAPE;
  9257. - if (test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag)) {
  9258. - send_DLE_ETX(bcs);
  9259. - isar_sched_event(bcs, B_LL_NOCARRIER);
  9260. - }
  9261. + isar_sched_event(bcs, B_LL_NOCARRIER);
  9262. }
  9263. break;
  9264. default:
  9265. @@ -977,6 +956,21 @@ isar_pump_statev_modem(struct BCState *b
  9266. }
  9267. }
  9268. +static inline void
  9269. +ll_deliver_faxstat(struct BCState *bcs, u_char status)
  9270. +{
  9271. + isdn_ctrl ic;
  9272. + struct Channel *chanp = (struct Channel *) bcs->st->lli.userdata;
  9273. +
  9274. + if (bcs->cs->debug & L1_DEB_HSCX)
  9275. + debugl1(bcs->cs, "HL->LL FAXIND %x", status);
  9276. + ic.driver = bcs->cs->myid;
  9277. + ic.command = ISDN_STAT_FAXIND;
  9278. + ic.arg = chanp->chan;
  9279. + ic.parm.aux.cmd = status;
  9280. + bcs->cs->iif.statcallb(&ic);
  9281. +}
  9282. +
  9283. static void
  9284. isar_pump_statev_fax(struct BCState *bcs, u_char devt) {
  9285. struct IsdnCardState *cs = bcs->cs;
  9286. @@ -1081,22 +1075,19 @@ isar_pump_statev_fax(struct BCState *bcs
  9287. if (cs->debug & L1_DEB_HSCX)
  9288. debugl1(cs, "pump stev RSP_DISC");
  9289. if (bcs->hw.isar.state == STFAX_ESCAPE) {
  9290. - p1 = 5;
  9291. switch(bcs->hw.isar.newcmd) {
  9292. case 0:
  9293. bcs->hw.isar.state = STFAX_READY;
  9294. break;
  9295. - case PCTRL_CMD_FTM:
  9296. - p1 = 2;
  9297. case PCTRL_CMD_FTH:
  9298. + case PCTRL_CMD_FTM:
  9299. + p1 = 10;
  9300. sendmsg(cs, dps | ISAR_HIS_PUMPCTRL,
  9301. PCTRL_CMD_SILON, 1, &p1);
  9302. bcs->hw.isar.state = STFAX_SILDET;
  9303. break;
  9304. - case PCTRL_CMD_FRM:
  9305. - if (frm_extra_delay)
  9306. - mdelay(frm_extra_delay);
  9307. case PCTRL_CMD_FRH:
  9308. + case PCTRL_CMD_FRM:
  9309. p1 = bcs->hw.isar.mod = bcs->hw.isar.newmod;
  9310. bcs->hw.isar.newmod = 0;
  9311. bcs->hw.isar.cmd = bcs->hw.isar.newcmd;
  9312. @@ -1215,9 +1206,6 @@ isar_int_main(struct IsdnCardState *cs)
  9313. isar_pump_statev_modem(bcs, ireg->cmsb);
  9314. } else if (bcs->mode == L1_MODE_FAX) {
  9315. isar_pump_statev_fax(bcs, ireg->cmsb);
  9316. - } else if (ireg->cmsb == PSEV_10MS_TIMER) {
  9317. - if (cs->debug & L1_DEB_HSCX)
  9318. - debugl1(cs, "pump stev TIMER");
  9319. } else {
  9320. if (cs->debug & L1_DEB_WARN)
  9321. debugl1(cs, "isar IIS_PSTEV pmode %d stat %x",
  9322. @@ -1278,9 +1266,6 @@ ftimer_handler(struct BCState *bcs) {
  9323. if (test_and_clear_bit(BC_FLG_LL_CONN, &bcs->Flag)) {
  9324. isar_sched_event(bcs, B_LL_CONNECT);
  9325. }
  9326. - if (test_and_clear_bit(BC_FLG_FTI_FTS, &bcs->Flag)) {
  9327. - isar_sched_event(bcs, B_LL_OK);
  9328. - }
  9329. }
  9330. static void
  9331. @@ -1303,7 +1288,7 @@ setup_pump(struct BCState *bcs) {
  9332. } else {
  9333. param[5] = PV32P6_ATN;
  9334. }
  9335. - param[0] = para_TOA; /* 6 db */
  9336. + param[0] = 6; /* 6 db */
  9337. param[1] = PV32P2_V23R | PV32P2_V22A | PV32P2_V22B |
  9338. PV32P2_V22C | PV32P2_V21 | PV32P2_BEL;
  9339. param[2] = PV32P3_AMOD | PV32P3_V32B | PV32P3_V23B;
  9340. @@ -1319,7 +1304,7 @@ setup_pump(struct BCState *bcs) {
  9341. } else {
  9342. param[1] = PFAXP2_ATN;
  9343. }
  9344. - param[0] = para_TOA; /* 6 db */
  9345. + param[0] = 6; /* 6 db */
  9346. sendmsg(cs, dps | ISAR_HIS_PUMPCFG, ctrl, 2, param);
  9347. bcs->hw.isar.state = STFAX_NULL;
  9348. bcs->hw.isar.newcmd = 0;
  9349. @@ -1348,6 +1333,7 @@ setup_sart(struct BCState *bcs) {
  9350. "\0\0");
  9351. break;
  9352. case L1_MODE_HDLC:
  9353. + case L1_MODE_FAX:
  9354. param[0] = 0;
  9355. sendmsg(cs, dps | ISAR_HIS_SARTCFG, SMODE_HDLC, 1,
  9356. param);
  9357. @@ -1359,9 +1345,6 @@ setup_sart(struct BCState *bcs) {
  9358. sendmsg(cs, dps | ISAR_HIS_SARTCFG, ctrl, 2,
  9359. param);
  9360. break;
  9361. - case L1_MODE_FAX:
  9362. - /* SART must not configured with FAX */
  9363. - break;
  9364. }
  9365. udelay(1000);
  9366. sendmsg(cs, dps | ISAR_HIS_BSTREQ, 0, 0, NULL);
  9367. @@ -1465,7 +1448,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
  9368. switch(cmd) {
  9369. case ISDN_FAX_CLASS1_FTM:
  9370. - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
  9371. if (bcs->hw.isar.state == STFAX_READY) {
  9372. p1 = para;
  9373. ctrl = PCTRL_CMD_FTM;
  9374. @@ -1489,7 +1471,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
  9375. }
  9376. break;
  9377. case ISDN_FAX_CLASS1_FTH:
  9378. - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
  9379. if (bcs->hw.isar.state == STFAX_READY) {
  9380. p1 = para;
  9381. ctrl = PCTRL_CMD_FTH;
  9382. @@ -1513,7 +1494,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
  9383. }
  9384. break;
  9385. case ISDN_FAX_CLASS1_FRM:
  9386. - test_and_clear_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
  9387. if (bcs->hw.isar.state == STFAX_READY) {
  9388. p1 = para;
  9389. ctrl = PCTRL_CMD_FRM;
  9390. @@ -1537,7 +1517,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
  9391. }
  9392. break;
  9393. case ISDN_FAX_CLASS1_FRH:
  9394. - test_and_set_bit(BC_FLG_FRH_WAIT, &bcs->Flag);
  9395. if (bcs->hw.isar.state == STFAX_READY) {
  9396. p1 = para;
  9397. ctrl = PCTRL_CMD_FRH;
  9398. @@ -1560,11 +1539,6 @@ isar_pump_cmd(struct BCState *bcs, u_cha
  9399. bcs->hw.isar.state = STFAX_ESCAPE;
  9400. }
  9401. break;
  9402. - case ISDN_FAXPUMP_HALT:
  9403. - bcs->hw.isar.state = STFAX_NULL;
  9404. - nom = 0;
  9405. - ctrl = PCTRL_CMD_HALT;
  9406. - break;
  9407. }
  9408. if (ctrl)
  9409. sendmsg(cs, dps | ISAR_HIS_PUMPCTRL, ctrl, nom, &p1);
  9410. @@ -1658,15 +1632,6 @@ isar_l2l1(struct PStack *st, int pr, voi
  9411. l1_msg_b(st, pr, arg);
  9412. break;
  9413. case (PH_DEACTIVATE | CONFIRM):
  9414. - switch(st->l1.mode) {
  9415. - case L1_MODE_TRANS:
  9416. - case L1_MODE_HDLC:
  9417. - case L1_MODE_V32:
  9418. - break;
  9419. - case L1_MODE_FAX:
  9420. - isar_pump_cmd(st->l1.bcs, ISDN_FAXPUMP_HALT, 0);
  9421. - break;
  9422. - }
  9423. test_and_clear_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
  9424. test_and_clear_bit(BC_FLG_BUSY, &st->l1.bcs->Flag);
  9425. if (st->l1.bcs->cs->debug & L1_DEB_HSCX)
  9426. @@ -1758,51 +1723,6 @@ isar_auxcmd(struct IsdnCardState *cs, is
  9427. test_and_set_bit(BC_FLG_DLEETX,
  9428. &bcs->Flag);
  9429. break;
  9430. - case ISDN_FAX_CLASS1_FTS:
  9431. - if (ic->parm.aux.subcmd == AT_QUERY) {
  9432. - ic->command = ISDN_STAT_FAXIND;
  9433. - ic->parm.aux.cmd = ISDN_FAX_CLASS1_OK;
  9434. - cs->iif.statcallb(ic);
  9435. - return(0);
  9436. - } else if (ic->parm.aux.subcmd == AT_EQ_QUERY) {
  9437. - strcpy(ic->parm.aux.para, "0-255");
  9438. - ic->command = ISDN_STAT_FAXIND;
  9439. - ic->parm.aux.cmd = ISDN_FAX_CLASS1_QUERY;
  9440. - cs->iif.statcallb(ic);
  9441. - return(0);
  9442. - } else if (ic->parm.aux.subcmd == AT_EQ_VALUE) {
  9443. - if (cs->debug & L1_DEB_HSCX)
  9444. - debugl1(cs, "isar_auxcmd %s=%d",
  9445. - FC1_CMD[ic->parm.aux.cmd], ic->parm.aux.para[0]);
  9446. - if (bcs->hw.isar.state == STFAX_READY) {
  9447. - if (! ic->parm.aux.para[0]) {
  9448. - ic->command = ISDN_STAT_FAXIND;
  9449. - ic->parm.aux.cmd = ISDN_FAX_CLASS1_OK;
  9450. - cs->iif.statcallb(ic);
  9451. - return(0);
  9452. - }
  9453. - if (! test_and_set_bit(BC_FLG_FTI_RUN, &bcs->Flag)) {
  9454. - /* n*10 ms */
  9455. - bcs->hw.isar.ftimer.expires =
  9456. - jiffies + ((ic->parm.aux.para[0] * 10 * HZ)/1000);
  9457. - test_and_set_bit(BC_FLG_FTI_FTS, &bcs->Flag);
  9458. - add_timer(&bcs->hw.isar.ftimer);
  9459. - return(0);
  9460. - } else {
  9461. - if (cs->debug)
  9462. - debugl1(cs, "isar FTS=%d and FTI busy",
  9463. - ic->parm.aux.para[0]);
  9464. - }
  9465. - } else {
  9466. - if (cs->debug)
  9467. - debugl1(cs, "isar FTS=%d and isar.state not ready(%x)",
  9468. - ic->parm.aux.para[0],bcs->hw.isar.state);
  9469. - }
  9470. - ic->command = ISDN_STAT_FAXIND;
  9471. - ic->parm.aux.cmd = ISDN_FAX_CLASS1_ERROR;
  9472. - cs->iif.statcallb(ic);
  9473. - }
  9474. - break;
  9475. case ISDN_FAX_CLASS1_FRM:
  9476. case ISDN_FAX_CLASS1_FRH:
  9477. case ISDN_FAX_CLASS1_FTM:
  9478. @@ -1815,24 +1735,16 @@ isar_auxcmd(struct IsdnCardState *cs, is
  9479. cs->iif.statcallb(ic);
  9480. return(0);
  9481. } else if (ic->parm.aux.subcmd == AT_EQ_QUERY) {
  9482. - char *p = ic->parm.aux.para;
  9483. - for(i=0;i<FAXMODCNT;i++)
  9484. - if ((1<<i) & modmask)
  9485. - p += sprintf(p, "%d,", faxmodulation[i]);
  9486. - p--;
  9487. - *p=0;
  9488. + strcpy(ic->parm.aux.para, faxmodulation_s);
  9489. ic->command = ISDN_STAT_FAXIND;
  9490. ic->parm.aux.cmd = ISDN_FAX_CLASS1_QUERY;
  9491. cs->iif.statcallb(ic);
  9492. return(0);
  9493. } else if (ic->parm.aux.subcmd == AT_EQ_VALUE) {
  9494. - if (cs->debug & L1_DEB_HSCX)
  9495. - debugl1(cs, "isar_auxcmd %s=%d",
  9496. - FC1_CMD[ic->parm.aux.cmd], ic->parm.aux.para[0]);
  9497. for(i=0;i<FAXMODCNT;i++)
  9498. if (faxmodulation[i]==ic->parm.aux.para[0])
  9499. break;
  9500. - if ((i < FAXMODCNT) && ((1<<i) & modmask) &&
  9501. + if ((FAXMODCNT > i) &&
  9502. test_bit(BC_FLG_INIT, &bcs->Flag)) {
  9503. isar_pump_cmd(bcs,
  9504. ic->parm.aux.cmd,
  9505. @@ -1850,7 +1762,7 @@ isar_auxcmd(struct IsdnCardState *cs, is
  9506. break;
  9507. case (ISDN_CMD_IOCTL):
  9508. switch (ic->arg) {
  9509. - case 9: /* load firmware */
  9510. + case (9): /* load firmware */
  9511. features = ISDN_FEATURE_L2_MODEM |
  9512. ISDN_FEATURE_L2_FAX |
  9513. ISDN_FEATURE_L3_FCLASS1;
  9514. @@ -1860,26 +1772,6 @@ isar_auxcmd(struct IsdnCardState *cs, is
  9515. else
  9516. ll_run(cs, features);
  9517. break;
  9518. - case 20:
  9519. - features = *(unsigned int *) ic->parm.num;
  9520. - printk(KERN_DEBUG "HiSax: max modulation old(%04x) new(%04x)\n",
  9521. - modmask, features);
  9522. - modmask = features;
  9523. - break;
  9524. - case 21:
  9525. - features = *(unsigned int *) ic->parm.num;
  9526. - printk(KERN_DEBUG "HiSax: FRM extra delay old(%d) new(%d) ms\n",
  9527. - frm_extra_delay, features);
  9528. - if (features >= 0)
  9529. - frm_extra_delay = features;
  9530. - break;
  9531. - case 22:
  9532. - features = *(unsigned int *) ic->parm.num;
  9533. - printk(KERN_DEBUG "HiSax: TOA old(%d) new(%d) db\n",
  9534. - para_TOA, features);
  9535. - if (features >= 0 && features < 32)
  9536. - para_TOA = features;
  9537. - break;
  9538. default:
  9539. printk(KERN_DEBUG "HiSax: invalid ioctl %d\n",
  9540. (int) ic->arg);
  9541. Index: linux-2.4.35.4/drivers/isdn/hisax/isar.h
  9542. ===================================================================
  9543. --- linux-2.4.35.4.orig/drivers/isdn/hisax/isar.h
  9544. +++ linux-2.4.35.4/drivers/isdn/hisax/isar.h
  9545. @@ -1,4 +1,4 @@
  9546. -/* $Id: isar.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9547. +/* $Id: isar.h,v 1.11 2001/09/24 13:22:56 kai Exp $
  9548. *
  9549. * ISAR (Siemens PSB 7110) specific defines
  9550. *
  9551. @@ -28,8 +28,6 @@
  9552. #define ISAR_HIS_FIRM 0x1e
  9553. #define ISAR_HIS_STDSP 0x08
  9554. #define ISAR_HIS_DIAG 0x05
  9555. -#define ISAR_HIS_WAITSTATE 0x27
  9556. -#define ISAR_HIS_TIMERIRQ 0x25
  9557. #define ISAR_HIS_P0CFG 0x3c
  9558. #define ISAR_HIS_P12CFG 0x24
  9559. #define ISAR_HIS_SARTCFG 0x25
  9560. @@ -45,10 +43,6 @@
  9561. #define ISAR_HIS_DPS2 0x80
  9562. #define SET_DPS(x) ((x<<6) & 0xc0)
  9563. -#define ISAR_CMD_TIMERIRQ_OFF 0x20
  9564. -#define ISAR_CMD_TIMERIRQ_ON 0x21
  9565. -
  9566. -
  9567. #define ISAR_IIS_MSCMSD 0x3f
  9568. #define ISAR_IIS_VNR 0x15
  9569. #define ISAR_IIS_DKEY 0x03
  9570. @@ -213,8 +207,6 @@
  9571. #define STFAX_ESCAPE 5
  9572. #define STFAX_SILDET 6
  9573. -#define ISDN_FAXPUMP_HALT 100
  9574. -
  9575. extern int ISARVersion(struct IsdnCardState *cs, char *s);
  9576. extern void isar_int_main(struct IsdnCardState *cs);
  9577. extern void initisar(struct IsdnCardState *cs);
  9578. Index: linux-2.4.35.4/drivers/isdn/hisax/isdnl1.c
  9579. ===================================================================
  9580. --- linux-2.4.35.4.orig/drivers/isdn/hisax/isdnl1.c
  9581. +++ linux-2.4.35.4/drivers/isdn/hisax/isdnl1.c
  9582. @@ -1,4 +1,4 @@
  9583. -/* $Id: isdnl1.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9584. +/* $Id: isdnl1.c,v 2.46 2001/09/24 13:22:56 kai Exp $
  9585. *
  9586. * common low level stuff for Siemens Chipsetbased isdn cards
  9587. *
  9588. @@ -18,7 +18,7 @@
  9589. *
  9590. */
  9591. -const char *l1_revision = "$Revision: 1.1.4.1 $";
  9592. +const char *l1_revision = "$Revision: 2.46 $";
  9593. #define __NO_VERSION__
  9594. #include <linux/init.h>
  9595. Index: linux-2.4.35.4/drivers/isdn/hisax/isdnl1.h
  9596. ===================================================================
  9597. --- linux-2.4.35.4.orig/drivers/isdn/hisax/isdnl1.h
  9598. +++ linux-2.4.35.4/drivers/isdn/hisax/isdnl1.h
  9599. @@ -1,4 +1,4 @@
  9600. -/* $Id: isdnl1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9601. +/* $Id: isdnl1.h,v 2.12 2001/09/24 13:22:56 kai Exp $
  9602. *
  9603. * Layer 1 defines
  9604. *
  9605. Index: linux-2.4.35.4/drivers/isdn/hisax/isdnl2.c
  9606. ===================================================================
  9607. --- linux-2.4.35.4.orig/drivers/isdn/hisax/isdnl2.c
  9608. +++ linux-2.4.35.4/drivers/isdn/hisax/isdnl2.c
  9609. @@ -1,4 +1,4 @@
  9610. -/* $Id: isdnl2.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9611. +/* $Id: isdnl2.c,v 2.30 2001/09/24 13:22:56 kai Exp $
  9612. *
  9613. * Author Karsten Keil
  9614. * based on the teles driver from Jan den Ouden
  9615. @@ -20,7 +20,7 @@
  9616. #include "hisax.h"
  9617. #include "isdnl2.h"
  9618. -const char *l2_revision = "$Revision: 1.1.4.1 $";
  9619. +const char *l2_revision = "$Revision: 2.30 $";
  9620. static void l2m_debug(struct FsmInst *fi, char *fmt, ...);
  9621. @@ -1418,8 +1418,8 @@ l2_st5_tei_remove(struct FsmInst *fi, in
  9622. freewin(st);
  9623. st->l2.tei = -1;
  9624. stop_t200(st, 17);
  9625. - st5_dl_release_l2l3(st);
  9626. FsmChangeState(fi, ST_L2_1);
  9627. + st5_dl_release_l2l3(st);
  9628. }
  9629. static void
  9630. Index: linux-2.4.35.4/drivers/isdn/hisax/isdnl2.h
  9631. ===================================================================
  9632. --- linux-2.4.35.4.orig/drivers/isdn/hisax/isdnl2.h
  9633. +++ linux-2.4.35.4/drivers/isdn/hisax/isdnl2.h
  9634. @@ -1,4 +1,4 @@
  9635. -/* $Id: isdnl2.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9636. +/* $Id$
  9637. *
  9638. * Layer 2 defines
  9639. *
  9640. Index: linux-2.4.35.4/drivers/isdn/hisax/isdnl3.c
  9641. ===================================================================
  9642. --- linux-2.4.35.4.orig/drivers/isdn/hisax/isdnl3.c
  9643. +++ linux-2.4.35.4/drivers/isdn/hisax/isdnl3.c
  9644. @@ -1,4 +1,4 @@
  9645. -/* $Id: isdnl3.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9646. +/* $Id: isdnl3.c,v 2.22 2001/09/24 13:22:56 kai Exp $
  9647. *
  9648. * Author Karsten Keil
  9649. * based on the teles driver from Jan den Ouden
  9650. @@ -21,7 +21,7 @@
  9651. #include "isdnl3.h"
  9652. #include <linux/config.h>
  9653. -const char *l3_revision = "$Revision: 1.1.4.1 $";
  9654. +const char *l3_revision = "$Revision: 2.22 $";
  9655. static struct Fsm l3fsm;
  9656. Index: linux-2.4.35.4/drivers/isdn/hisax/isdnl3.h
  9657. ===================================================================
  9658. --- linux-2.4.35.4.orig/drivers/isdn/hisax/isdnl3.h
  9659. +++ linux-2.4.35.4/drivers/isdn/hisax/isdnl3.h
  9660. @@ -1,4 +1,4 @@
  9661. -/* $Id: isdnl3.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9662. +/* $Id$
  9663. *
  9664. * This software may be used and distributed according to the terms
  9665. * of the GNU General Public License, incorporated herein by reference.
  9666. Index: linux-2.4.35.4/drivers/isdn/hisax/isurf.c
  9667. ===================================================================
  9668. --- linux-2.4.35.4.orig/drivers/isdn/hisax/isurf.c
  9669. +++ linux-2.4.35.4/drivers/isdn/hisax/isurf.c
  9670. @@ -1,4 +1,4 @@
  9671. -/* $Id: isurf.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9672. +/* $Id: isurf.c,v 1.12 2001/09/24 13:22:56 kai Exp $
  9673. *
  9674. * low level stuff for Siemens I-Surf/I-Talk cards
  9675. *
  9676. @@ -16,11 +16,10 @@
  9677. #include "isac.h"
  9678. #include "isar.h"
  9679. #include "isdnl1.h"
  9680. -#include <linux/isapnp.h>
  9681. extern const char *CardType[];
  9682. -static const char *ISurf_revision = "$Revision: 1.1.4.1 $";
  9683. +static const char *ISurf_revision = "$Revision: 1.12 $";
  9684. #define byteout(addr,val) outb(val,addr)
  9685. #define bytein(addr) inb(addr)
  9686. @@ -128,8 +127,10 @@ void
  9687. release_io_isurf(struct IsdnCardState *cs)
  9688. {
  9689. release_region(cs->hw.isurf.reset, 1);
  9690. +#ifdef COMPAT_HAS_ISA_IOREMAP
  9691. iounmap((unsigned char *)cs->hw.isurf.isar);
  9692. release_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
  9693. +#endif
  9694. }
  9695. static void
  9696. @@ -194,10 +195,6 @@ isurf_auxcmd(struct IsdnCardState *cs, i
  9697. return(isar_auxcmd(cs, ic));
  9698. }
  9699. -#ifdef __ISAPNP__
  9700. -static struct pci_bus *pnp_surf __devinitdata = NULL;
  9701. -#endif
  9702. -
  9703. int __init
  9704. setup_isurf(struct IsdnCard *card)
  9705. {
  9706. @@ -215,58 +212,9 @@ setup_isurf(struct IsdnCard *card)
  9707. cs->hw.isurf.phymem = card->para[2];
  9708. cs->irq = card->para[0];
  9709. } else {
  9710. -#ifdef __ISAPNP__
  9711. - struct pci_bus *pb;
  9712. - struct pci_dev *pd;
  9713. -
  9714. - if (isapnp_present()) {
  9715. - cs->subtyp = 0;
  9716. - if ((pb = isapnp_find_card(
  9717. - ISAPNP_VENDOR('S', 'I', 'E'),
  9718. - ISAPNP_FUNCTION(0x0010), pnp_surf))) {
  9719. - pnp_surf = pb;
  9720. - pd = NULL;
  9721. - if (!(pd = isapnp_find_dev(pnp_surf,
  9722. - ISAPNP_VENDOR('S', 'I', 'E'),
  9723. - ISAPNP_FUNCTION(0x0010), pd))) {
  9724. - printk(KERN_ERR "ISurfPnP: PnP error card found, no device\n");
  9725. - return (0);
  9726. - }
  9727. - pd->prepare(pd);
  9728. - pd->deactivate(pd);
  9729. - pd->activate(pd);
  9730. - /* The ISA-PnP logic apparently
  9731. - * expects upper limit address to be
  9732. - * set. Since the isa-pnp module
  9733. - * doesn't do this, so we have to make
  9734. - * up for it.
  9735. - */
  9736. - isapnp_cfg_begin(pd->bus->number, pd->devfn);
  9737. - isapnp_write_word(ISAPNP_CFG_MEM+3,
  9738. - pd->resource[8].end >> 8);
  9739. - isapnp_cfg_end();
  9740. - cs->hw.isurf.reset = pd->resource[0].start;
  9741. - cs->hw.isurf.phymem = pd->resource[8].start;
  9742. - cs->irq = pd->irq_resource[0].start;
  9743. - if (!cs->irq || !cs->hw.isurf.reset || !cs->hw.isurf.phymem) {
  9744. - printk(KERN_ERR "ISurfPnP:some resources are missing %d/%x/%lx\n",
  9745. - cs->irq, cs->hw.isurf.reset, cs->hw.isurf.phymem);
  9746. - pd->deactivate(pd);
  9747. - return(0);
  9748. - }
  9749. - } else {
  9750. - printk(KERN_INFO "ISurfPnP: no ISAPnP card found\n");
  9751. - return(0);
  9752. - }
  9753. - } else {
  9754. - printk(KERN_INFO "ISurfPnP: no ISAPnP bus found\n");
  9755. - return(0);
  9756. - }
  9757. -#else
  9758. printk(KERN_WARNING "HiSax: %s port/mem not set\n",
  9759. CardType[card->typ]);
  9760. return (0);
  9761. -#endif
  9762. }
  9763. if (check_region(cs->hw.isurf.reset, 1)) {
  9764. printk(KERN_WARNING
  9765. @@ -277,6 +225,7 @@ setup_isurf(struct IsdnCard *card)
  9766. } else {
  9767. request_region(cs->hw.isurf.reset, 1, "isurf isdn");
  9768. }
  9769. +#ifdef COMPAT_HAS_ISA_IOREMAP
  9770. if (check_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE)) {
  9771. printk(KERN_WARNING
  9772. "HiSax: %s memory region %lx-%lx already in use\n",
  9773. @@ -292,6 +241,10 @@ setup_isurf(struct IsdnCard *card)
  9774. cs->hw.isurf.isar =
  9775. (unsigned long) ioremap(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
  9776. cs->hw.isurf.isac = cs->hw.isurf.isar + ISURF_ISAC_OFFSET;
  9777. +#else
  9778. + cs->hw.isurf.isar = cs->hw.isurf.phymem + ISURF_ISAR_OFFSET;
  9779. + cs->hw.isurf.isac = cs->hw.isurf.phymem + ISURF_ISAC_OFFSET;
  9780. +#endif
  9781. printk(KERN_INFO
  9782. "ISurf: defined at 0x%x 0x%lx IRQ %d\n",
  9783. cs->hw.isurf.reset,
  9784. Index: linux-2.4.35.4/drivers/isdn/hisax/ix1_micro.c
  9785. ===================================================================
  9786. --- linux-2.4.35.4.orig/drivers/isdn/hisax/ix1_micro.c
  9787. +++ linux-2.4.35.4/drivers/isdn/hisax/ix1_micro.c
  9788. @@ -1,4 +1,4 @@
  9789. -/* $Id: ix1_micro.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9790. +/* $Id: ix1_micro.c,v 2.12 2001/09/24 13:22:56 kai Exp $
  9791. *
  9792. * low level stuff for ITK ix1-micro Rev.2 isdn cards
  9793. * derived from the original file teles3.c from Karsten Keil
  9794. @@ -19,14 +19,13 @@
  9795. #define __NO_VERSION__
  9796. #include <linux/init.h>
  9797. -#include <linux/isapnp.h>
  9798. #include "hisax.h"
  9799. #include "isac.h"
  9800. #include "hscx.h"
  9801. #include "isdnl1.h"
  9802. extern const char *CardType[];
  9803. -const char *ix1_revision = "$Revision: 1.1.4.1 $";
  9804. +const char *ix1_revision = "$Revision: 2.12 $";
  9805. #define byteout(addr,val) outb(val,addr)
  9806. #define bytein(addr) inb(addr)
  9807. @@ -219,21 +218,6 @@ ix1_card_msg(struct IsdnCardState *cs, i
  9808. return(0);
  9809. }
  9810. -#ifdef __ISAPNP__
  9811. -static struct isapnp_device_id itk_ids[] __initdata = {
  9812. - { ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25),
  9813. - ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x25),
  9814. - (unsigned long) "ITK micro 2" },
  9815. - { ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x29),
  9816. - ISAPNP_VENDOR('I', 'T', 'K'), ISAPNP_FUNCTION(0x29),
  9817. - (unsigned long) "ITK micro 2." },
  9818. - { 0, }
  9819. -};
  9820. -
  9821. -static struct isapnp_device_id *idev = &itk_ids[0];
  9822. -static struct pci_bus *pnp_c __devinitdata = NULL;
  9823. -#endif
  9824. -
  9825. int __init
  9826. setup_ix1micro(struct IsdnCard *card)
  9827. @@ -246,45 +230,6 @@ setup_ix1micro(struct IsdnCard *card)
  9828. if (cs->typ != ISDN_CTYPE_IX1MICROR2)
  9829. return (0);
  9830. -#ifdef __ISAPNP__
  9831. - if (!card->para[1] && isapnp_present()) {
  9832. - struct pci_bus *pb;
  9833. - struct pci_dev *pd;
  9834. -
  9835. - while(idev->card_vendor) {
  9836. - if ((pb = isapnp_find_card(idev->card_vendor,
  9837. - idev->card_device, pnp_c))) {
  9838. - pnp_c = pb;
  9839. - pd = NULL;
  9840. - if ((pd = isapnp_find_dev(pnp_c,
  9841. - idev->vendor, idev->function, pd))) {
  9842. - printk(KERN_INFO "HiSax: %s detected\n",
  9843. - (char *)idev->driver_data);
  9844. - pd->prepare(pd);
  9845. - pd->deactivate(pd);
  9846. - pd->activate(pd);
  9847. - card->para[1] = pd->resource[0].start;
  9848. - card->para[0] = pd->irq_resource[0].start;
  9849. - if (!card->para[0] || !card->para[1]) {
  9850. - printk(KERN_ERR "ITK PnP:some resources are missing %ld/%lx\n",
  9851. - card->para[0], card->para[1]);
  9852. - pd->deactivate(pd);
  9853. - return(0);
  9854. - }
  9855. - break;
  9856. - } else {
  9857. - printk(KERN_ERR "ITK PnP: PnP error card found, no device\n");
  9858. - }
  9859. - }
  9860. - idev++;
  9861. - pnp_c=NULL;
  9862. - }
  9863. - if (!idev->card_vendor) {
  9864. - printk(KERN_INFO "ITK PnP: no ISAPnP card found\n");
  9865. - return(0);
  9866. - }
  9867. - }
  9868. -#endif
  9869. /* IO-Ports */
  9870. cs->hw.ix1.isac_ale = card->para[1] + ISAC_COMMAND_OFFSET;
  9871. cs->hw.ix1.hscx_ale = card->para[1] + HSCX_COMMAND_OFFSET;
  9872. Index: linux-2.4.35.4/drivers/isdn/hisax/jade.c
  9873. ===================================================================
  9874. --- linux-2.4.35.4.orig/drivers/isdn/hisax/jade.c
  9875. +++ linux-2.4.35.4/drivers/isdn/hisax/jade.c
  9876. @@ -1,4 +1,4 @@
  9877. -/* $Id: jade.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9878. +/* $Id: jade.c,v 1.9 2001/09/24 13:22:56 kai Exp $
  9879. *
  9880. * JADE stuff (derived from original hscx.c)
  9881. *
  9882. Index: linux-2.4.35.4/drivers/isdn/hisax/jade.h
  9883. ===================================================================
  9884. --- linux-2.4.35.4.orig/drivers/isdn/hisax/jade.h
  9885. +++ linux-2.4.35.4/drivers/isdn/hisax/jade.h
  9886. @@ -1,4 +1,4 @@
  9887. -/* $Id: jade.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9888. +/* $Id: jade.h,v 1.5 2001/09/24 13:22:56 kai Exp $
  9889. *
  9890. * JADE specific defines
  9891. *
  9892. Index: linux-2.4.35.4/drivers/isdn/hisax/jade_irq.c
  9893. ===================================================================
  9894. --- linux-2.4.35.4.orig/drivers/isdn/hisax/jade_irq.c
  9895. +++ linux-2.4.35.4/drivers/isdn/hisax/jade_irq.c
  9896. @@ -1,4 +1,4 @@
  9897. -/* $Id: jade_irq.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9898. +/* $Id: jade_irq.c,v 1.7 2001/09/24 13:22:56 kai Exp $
  9899. *
  9900. * Low level JADE IRQ stuff (derived from original hscx_irq.c)
  9901. *
  9902. Index: linux-2.4.35.4/drivers/isdn/hisax/l3_1tr6.c
  9903. ===================================================================
  9904. --- linux-2.4.35.4.orig/drivers/isdn/hisax/l3_1tr6.c
  9905. +++ linux-2.4.35.4/drivers/isdn/hisax/l3_1tr6.c
  9906. @@ -1,4 +1,4 @@
  9907. -/* $Id: l3_1tr6.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9908. +/* $Id: l3_1tr6.c,v 2.15 2001/09/24 13:22:56 kai Exp $
  9909. *
  9910. * German 1TR6 D-channel protocol
  9911. *
  9912. @@ -20,7 +20,7 @@
  9913. #include <linux/ctype.h>
  9914. extern char *HiSax_getrev(const char *revision);
  9915. -const char *l3_1tr6_revision = "$Revision: 1.1.4.1 $";
  9916. +const char *l3_1tr6_revision = "$Revision: 2.15 $";
  9917. #define MsgHead(ptr, cref, mty, dis) \
  9918. *ptr++ = dis; \
  9919. Index: linux-2.4.35.4/drivers/isdn/hisax/l3_1tr6.h
  9920. ===================================================================
  9921. --- linux-2.4.35.4.orig/drivers/isdn/hisax/l3_1tr6.h
  9922. +++ linux-2.4.35.4/drivers/isdn/hisax/l3_1tr6.h
  9923. @@ -1,4 +1,4 @@
  9924. -/* $Id: l3_1tr6.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9925. +/* $Id$
  9926. *
  9927. * German 1TR6 D-channel protocol defines
  9928. *
  9929. Index: linux-2.4.35.4/drivers/isdn/hisax/l3dss1.c
  9930. ===================================================================
  9931. --- linux-2.4.35.4.orig/drivers/isdn/hisax/l3dss1.c
  9932. +++ linux-2.4.35.4/drivers/isdn/hisax/l3dss1.c
  9933. @@ -1,4 +1,4 @@
  9934. -/* $Id: l3dss1.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9935. +/* $Id: l3dss1.c,v 2.32 2001/09/24 13:22:56 kai Exp $
  9936. *
  9937. * EURO/DSS1 D-channel protocol
  9938. *
  9939. @@ -27,7 +27,7 @@
  9940. #include <linux/config.h>
  9941. extern char *HiSax_getrev(const char *revision);
  9942. -const char *dss1_revision = "$Revision: 1.1.4.1 $";
  9943. +const char *dss1_revision = "$Revision: 2.32 $";
  9944. #define EXT_BEARER_CAPS 1
  9945. Index: linux-2.4.35.4/drivers/isdn/hisax/l3dss1.h
  9946. ===================================================================
  9947. --- linux-2.4.35.4.orig/drivers/isdn/hisax/l3dss1.h
  9948. +++ linux-2.4.35.4/drivers/isdn/hisax/l3dss1.h
  9949. @@ -1,4 +1,4 @@
  9950. -/* $Id: l3dss1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9951. +/* $Id$
  9952. *
  9953. * DSS1 (Euro) D-channel protocol defines
  9954. *
  9955. Index: linux-2.4.35.4/drivers/isdn/hisax/l3ni1.c
  9956. ===================================================================
  9957. --- linux-2.4.35.4.orig/drivers/isdn/hisax/l3ni1.c
  9958. +++ linux-2.4.35.4/drivers/isdn/hisax/l3ni1.c
  9959. @@ -1,4 +1,4 @@
  9960. -/* $Id: l3ni1.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9961. +/* $Id: l3ni1.c,v 2.8 2001/09/24 13:22:56 kai Exp $
  9962. *
  9963. * NI1 D-channel protocol
  9964. *
  9965. @@ -25,7 +25,7 @@
  9966. #include <linux/ctype.h>
  9967. extern char *HiSax_getrev(const char *revision);
  9968. -const char *ni1_revision = "$Revision: 1.1.4.1 $";
  9969. +const char *ni1_revision = "$Revision: 2.8 $";
  9970. #define EXT_BEARER_CAPS 1
  9971. Index: linux-2.4.35.4/drivers/isdn/hisax/l3ni1.h
  9972. ===================================================================
  9973. --- linux-2.4.35.4.orig/drivers/isdn/hisax/l3ni1.h
  9974. +++ linux-2.4.35.4/drivers/isdn/hisax/l3ni1.h
  9975. @@ -1,4 +1,4 @@
  9976. -/* $Id: l3ni1.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9977. +/* $Id$
  9978. *
  9979. * NI1 D-channel protocol
  9980. *
  9981. Index: linux-2.4.35.4/drivers/isdn/hisax/lmgr.c
  9982. ===================================================================
  9983. --- linux-2.4.35.4.orig/drivers/isdn/hisax/lmgr.c
  9984. +++ linux-2.4.35.4/drivers/isdn/hisax/lmgr.c
  9985. @@ -1,4 +1,4 @@
  9986. -/* $Id: lmgr.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  9987. +/* $Id$
  9988. *
  9989. * Layermanagement module
  9990. *
  9991. Index: linux-2.4.35.4/drivers/isdn/hisax/md5sums.asc
  9992. ===================================================================
  9993. --- linux-2.4.35.4.orig/drivers/isdn/hisax/md5sums.asc
  9994. +++ linux-2.4.35.4/drivers/isdn/hisax/md5sums.asc
  9995. @@ -1,33 +1,22 @@
  9996. ------BEGIN PGP SIGNED MESSAGE-----
  9997. -Hash: SHA1
  9998. -
  9999. # This are valid md5sums for certificated HiSax driver.
  10000. # The certification is valid only if the md5sums of all files match.
  10001. # The certification is valid only for ELSA Microlink PCI,
  10002. -# Eicon Technology Diva 2.01 PCI, Sedlbauer SpeedFax+,
  10003. -# HFC-S PCI A based cards and HFC-S USB based ISDN
  10004. -# terminal adapters in the moment.
  10005. +# Eicon Technology Diva 2.01 PCI, Sedlbauer SpeedFax+,
  10006. +# HFC-S PCI A based cards and HFC-S USB based isdn tas
  10007. +# in the moment.
  10008. # Read ../../../Documentation/isdn/HiSax.cert for more informations.
  10009. #
  10010. -cd4a9917e1147039d5dfc66440d42054 isac.c
  10011. -211840e78b56c9d4753be9c85da21a50 isdnl1.c
  10012. -5ce9b1fff42a02f9c2eb4fb81c701b1f isdnl2.c
  10013. -6948de0c43513dd23c6706feb5fc2209 isdnl3.c
  10014. -3730780b69368218d756024165efea79 tei.c
  10015. -16e72710eb58da01415b877490f5d2ac callc.c
  10016. -6abc55c77e0f3149ae9334f3257a1a1a cert.c
  10017. -27bdb2800d4590e00da20eff241edc47 l3dss1.c
  10018. -df8bb877b854c4302d396b554e4e84ef l3_1tr6.c
  10019. -9d8b4bed15370063d1b16e47080f50e1 elsa.c
  10020. -210f4a3f1eebca70229d786b15cf3e90 diva.c
  10021. -4ddf21079dd77e892380f789bae250a7 sedlbauer.c
  10022. -8200d818771e3cbdef2a3c3e818d25ac hfc_pci.c
  10023. +6f9433a8b696076562562d090e3c420f isac.c
  10024. +13c3eed869f5139f44c563e3a8fea1f5 isdnl1.c
  10025. +addcff863b0ff1e366c0f2ae9fa6e81e isdnl2.c
  10026. +7076deb94a363945c21ea27aca4a720a isdnl3.c
  10027. +51c603829b6cc4f8421f744ad657ceff tei.c
  10028. +669050ab5079f02887ed0239d86e5474 callc.c
  10029. +ecacd146b8f8881ef9349935dab3df4a cert.c
  10030. +fadeb3b85bb23bc1ac48470c0848d6fa l3dss1.c
  10031. +cf7dec9fac6283716904d26b99188476 l3_1tr6.c
  10032. +2f75c8765e1be13d114d5f4433cf364b elsa.c
  10033. +b4cf8a4dceed9ea6dcba65a85b4eecc7 diva.c
  10034. +dee3f8f40c6fe78a4b57729804b7e6cd sedlbauer.c
  10035. +0d79fe6dfc5bfaa4826970c41a6d273d hfc_pci.c
  10036. # end of md5sums
  10037. ------BEGIN PGP SIGNATURE-----
  10038. -Version: GnuPG v1.0.6 (GNU/Linux)
  10039. -Comment: For info see http://www.gnupg.org
  10040. -
  10041. -iD8DBQE9rE91DiY0VZsg4ukRAkKfAJ4xWUfqjc0hW+V+JPue5yr7mrt+RwCdGdSf
  10042. -GIKgAEdRLzERmpt/bCCwAbY=
  10043. -=FaHw
  10044. ------END PGP SIGNATURE-----
  10045. Index: linux-2.4.35.4/drivers/isdn/hisax/mic.c
  10046. ===================================================================
  10047. --- linux-2.4.35.4.orig/drivers/isdn/hisax/mic.c
  10048. +++ linux-2.4.35.4/drivers/isdn/hisax/mic.c
  10049. @@ -1,4 +1,4 @@
  10050. -/* $Id: mic.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  10051. +/* $Id: mic.c,v 1.12 2001/09/24 13:22:56 kai Exp $
  10052. *
  10053. * low level stuff for mic cards
  10054. *
  10055. @@ -19,7 +19,7 @@
  10056. extern const char *CardType[];
  10057. -const char *mic_revision = "$Revision: 1.1.4.1 $";
  10058. +const char *mic_revision = "$Revision: 1.12 $";
  10059. #define byteout(addr,val) outb(val,addr)
  10060. #define bytein(addr) inb(addr)
  10061. Index: linux-2.4.35.4/drivers/isdn/hisax/netjet.c
  10062. ===================================================================
  10063. --- linux-2.4.35.4.orig/drivers/isdn/hisax/netjet.c
  10064. +++ linux-2.4.35.4/drivers/isdn/hisax/netjet.c
  10065. @@ -1,4 +1,4 @@
  10066. -/* $Id: netjet.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  10067. +/* $Id: netjet.c,v 1.29 2001/09/24 13:22:56 kai Exp $
  10068. *
  10069. * low level stuff for Traverse Technologie NETJet ISDN cards
  10070. *
  10071. @@ -8,9 +8,7 @@
  10072. * This software may be used and distributed according to the terms
  10073. * of the GNU General Public License, incorporated herein by reference.
  10074. *
  10075. - * Thanks to Traverse Technologies Australia for documents and information
  10076. - *
  10077. - * 16-Apr-2002 - led code added - Guy Ellis ([email protected])
  10078. + * Thanks to Traverse Technologie Australia for documents and information
  10079. *
  10080. */
  10081. @@ -26,7 +24,7 @@
  10082. #include <asm/io.h>
  10083. #include "netjet.h"
  10084. -const char *NETjet_revision = "$Revision: 1.1.4.1 $";
  10085. +const char *NETjet_revision = "$Revision: 1.29 $";
  10086. /* Interface functions */
  10087. @@ -135,7 +133,6 @@ void
  10088. mode_tiger(struct BCState *bcs, int mode, int bc)
  10089. {
  10090. struct IsdnCardState *cs = bcs->cs;
  10091. - u_char led;
  10092. if (cs->debug & L1_DEB_HSCX)
  10093. debugl1(cs, "Tiger mode %d bchan %d/%d",
  10094. @@ -157,15 +154,6 @@ mode_tiger(struct BCState *bcs, int mode
  10095. cs->hw.njet.dmactrl);
  10096. byteout(cs->hw.njet.base + NETJET_IRQMASK0, 0);
  10097. }
  10098. - if (cs->typ == ISDN_CTYPE_NETJET_S)
  10099. - {
  10100. - // led off
  10101. - led = bc & 0x01;
  10102. - led = 0x01 << (6 + led); // convert to mask
  10103. - led = ~led;
  10104. - cs->hw.njet.auxd &= led;
  10105. - byteout(cs->hw.njet.auxa, cs->hw.njet.auxd);
  10106. - }
  10107. break;
  10108. case (L1_MODE_TRANS):
  10109. break;
  10110. @@ -191,14 +179,6 @@ mode_tiger(struct BCState *bcs, int mode
  10111. bcs->hw.tiger.sendp = bcs->hw.tiger.send;
  10112. bcs->hw.tiger.free = NETJET_DMA_TXSIZE;
  10113. test_and_set_bit(BC_FLG_EMPTY, &bcs->Flag);
  10114. - if (cs->typ == ISDN_CTYPE_NETJET_S)
  10115. - {
  10116. - // led on
  10117. - led = bc & 0x01;
  10118. - led = 0x01 << (6 + led); // convert to mask
  10119. - cs->hw.njet.auxd |= led;
  10120. - byteout(cs->hw.njet.auxa, cs->hw.njet.auxd);
  10121. - }
  10122. break;
  10123. }
  10124. if (cs->debug & L1_DEB_HSCX)
  10125. @@ -874,13 +854,9 @@ tiger_l2l1(struct PStack *st, int pr, vo
  10126. case (PH_ACTIVATE | REQUEST):
  10127. test_and_set_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag);
  10128. mode_tiger(st->l1.bcs, st->l1.mode, st->l1.bc);
  10129. - /* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG */
  10130. - st->l1.bcs->cs->cardmsg(st->l1.bcs->cs, MDL_BC_ASSIGN, (void *)(&st->l1.bc));
  10131. l1_msg_b(st, pr, arg);
  10132. break;
  10133. case (PH_DEACTIVATE | REQUEST):
  10134. - /* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG */
  10135. - st->l1.bcs->cs->cardmsg(st->l1.bcs->cs, MDL_BC_RELEASE, (void *)(&st->l1.bc));
  10136. l1_msg_b(st, pr, arg);
  10137. break;
  10138. case (PH_DEACTIVATE | CONFIRM):
  10139. Index: linux-2.4.35.4/drivers/isdn/hisax/netjet.h
  10140. ===================================================================
  10141. --- linux-2.4.35.4.orig/drivers/isdn/hisax/netjet.h
  10142. +++ linux-2.4.35.4/drivers/isdn/hisax/netjet.h
  10143. @@ -1,4 +1,4 @@
  10144. -/* $Id: netjet.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  10145. +/* $Id: netjet.h,v 2.8 2001/09/24 13:22:56 kai Exp $
  10146. *
  10147. * NETjet common header file
  10148. *
  10149. Index: linux-2.4.35.4/drivers/isdn/hisax/niccy.c
  10150. ===================================================================
  10151. --- linux-2.4.35.4.orig/drivers/isdn/hisax/niccy.c
  10152. +++ linux-2.4.35.4/drivers/isdn/hisax/niccy.c
  10153. @@ -1,4 +1,4 @@
  10154. -/* $Id: niccy.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  10155. +/* $Id: niccy.c,v 1.21 2001/10/20 22:05:00 kai Exp $
  10156. *
  10157. * low level stuff for Dr. Neuhaus NICCY PnP and NICCY PCI and
  10158. * compatible (SAGEM cybermodem)
  10159. @@ -22,10 +22,10 @@
  10160. #include "hscx.h"
  10161. #include "isdnl1.h"
  10162. #include <linux/pci.h>
  10163. -#include <linux/isapnp.h>
  10164. +#include <linux/isdn_compat.h>
  10165. extern const char *CardType[];
  10166. -const char *niccy_revision = "$Revision: 1.1.4.1 $";
  10167. +const char *niccy_revision = "$Revision: 1.21 $";
  10168. #define byteout(addr,val) outb(val,addr)
  10169. #define bytein(addr) inb(addr)
  10170. @@ -239,9 +239,6 @@ niccy_card_msg(struct IsdnCardState *cs,
  10171. }
  10172. static struct pci_dev *niccy_dev __initdata = NULL;
  10173. -#ifdef __ISAPNP__
  10174. -static struct pci_bus *pnp_c __devinitdata = NULL;
  10175. -#endif
  10176. int __init
  10177. setup_niccy(struct IsdnCard *card)
  10178. @@ -253,39 +250,7 @@ setup_niccy(struct IsdnCard *card)
  10179. printk(KERN_INFO "HiSax: Niccy driver Rev. %s\n", HiSax_getrev(tmp));
  10180. if (cs->typ != ISDN_CTYPE_NICCY)
  10181. return (0);
  10182. -#ifdef __ISAPNP__
  10183. - if (!card->para[1] && isapnp_present()) {
  10184. - struct pci_bus *pb;
  10185. - struct pci_dev *pd;
  10186. -
  10187. - if ((pb = isapnp_find_card(
  10188. - ISAPNP_VENDOR('S', 'D', 'A'),
  10189. - ISAPNP_FUNCTION(0x0150), pnp_c))) {
  10190. - pnp_c = pb;
  10191. - pd = NULL;
  10192. - if (!(pd = isapnp_find_dev(pnp_c,
  10193. - ISAPNP_VENDOR('S', 'D', 'A'),
  10194. - ISAPNP_FUNCTION(0x0150), pd))) {
  10195. - printk(KERN_ERR "NiccyPnP: PnP error card found, no device\n");
  10196. - return (0);
  10197. - }
  10198. - pd->prepare(pd);
  10199. - pd->deactivate(pd);
  10200. - pd->activate(pd);
  10201. - card->para[1] = pd->resource[0].start;
  10202. - card->para[2] = pd->resource[1].start;
  10203. - card->para[0] = pd->irq_resource[0].start;
  10204. - if (!card->para[0] || !card->para[1] || !card->para[2]) {
  10205. - printk(KERN_ERR "NiccyPnP:some resources are missing %ld/%lx/%lx\n",
  10206. - card->para[0], card->para[1], card->para[2]);
  10207. - pd->deactivate(pd);
  10208. - return(0);
  10209. - }
  10210. - } else {
  10211. - printk(KERN_INFO "NiccyPnP: no ISAPnP card found\n");
  10212. - }
  10213. - }
  10214. -#endif
  10215. +
  10216. if (card->para[1]) {
  10217. cs->hw.niccy.isac = card->para[1] + ISAC_PNP;
  10218. cs->hw.niccy.hscx = card->para[1] + HSCX_PNP;
  10219. @@ -331,12 +296,12 @@ setup_niccy(struct IsdnCard *card)
  10220. return(0);
  10221. }
  10222. cs->irq = niccy_dev->irq;
  10223. - cs->hw.niccy.cfg_reg = pci_resource_start(niccy_dev, 0);
  10224. + cs->hw.niccy.cfg_reg = pci_resource_start_io(niccy_dev, 0);
  10225. if (!cs->hw.niccy.cfg_reg) {
  10226. printk(KERN_WARNING "Niccy: No IO-Adr for PCI cfg found\n");
  10227. return(0);
  10228. }
  10229. - pci_ioaddr = pci_resource_start(niccy_dev, 1);
  10230. + pci_ioaddr = pci_resource_start_io(niccy_dev, 1);
  10231. if (!pci_ioaddr) {
  10232. printk(KERN_WARNING "Niccy: No IO-Adr for PCI card found\n");
  10233. return(0);
  10234. Index: linux-2.4.35.4/drivers/isdn/hisax/nj_s.c
  10235. ===================================================================
  10236. --- linux-2.4.35.4.orig/drivers/isdn/hisax/nj_s.c
  10237. +++ linux-2.4.35.4/drivers/isdn/hisax/nj_s.c
  10238. @@ -1,4 +1,4 @@
  10239. -/* $Id: nj_s.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  10240. +/* $Id: nj_s.c,v 2.13 2001/09/24 13:22:56 kai Exp $
  10241. *
  10242. * This software may be used and distributed according to the terms
  10243. * of the GNU General Public License, incorporated herein by reference.
  10244. @@ -12,11 +12,12 @@
  10245. #include "isac.h"
  10246. #include "isdnl1.h"
  10247. #include <linux/pci.h>
  10248. +#include <linux/isdn_compat.h>
  10249. #include <linux/interrupt.h>
  10250. #include <linux/ppp_defs.h>
  10251. #include "netjet.h"
  10252. -const char *NETjet_S_revision = "$Revision: 1.1.4.1 $";
  10253. +const char *NETjet_S_revision = "$Revision: 2.13 $";
  10254. static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
  10255. {
  10256. @@ -130,7 +131,6 @@ NETjet_S_card_msg(struct IsdnCardState *
  10257. release_io_netjet(cs);
  10258. return(0);
  10259. case CARD_INIT:
  10260. - reset_netjet_s(cs);
  10261. inittiger(cs);
  10262. clear_pending_isac_ints(cs);
  10263. initisac(cs);
  10264. @@ -180,19 +180,11 @@ setup_netjet_s(struct IsdnCard *card)
  10265. printk(KERN_WARNING "NETjet-S: No IRQ for PCI card found\n");
  10266. return(0);
  10267. }
  10268. - cs->hw.njet.base = pci_resource_start(dev_netjet, 0);
  10269. + cs->hw.njet.base = pci_resource_start_io(dev_netjet, 0);
  10270. if (!cs->hw.njet.base) {
  10271. printk(KERN_WARNING "NETjet-S: No IO-Adr for PCI card found\n");
  10272. return(0);
  10273. }
  10274. - /* 2001/10/04 Christoph Ersfeld, Formula-n Europe AG www.formula-n.com */
  10275. - if ((dev_netjet->subsystem_vendor == 0x55) &&
  10276. - (dev_netjet->subsystem_device == 0x02)) {
  10277. - printk(KERN_WARNING "Netjet: You tried to load this driver with an incompatible TigerJet-card\n");
  10278. - printk(KERN_WARNING "Use type=41 for Formula-n enter:now ISDN PCI and compatible\n");
  10279. - return(0);
  10280. - }
  10281. - /* end new code */
  10282. } else {
  10283. printk(KERN_WARNING "NETjet-S: No PCI card found\n");
  10284. return(0);
  10285. @@ -263,6 +255,7 @@ setup_netjet_s(struct IsdnCard *card)
  10286. } else {
  10287. request_region(cs->hw.njet.base, bytecnt, "netjet-s isdn");
  10288. }
  10289. + reset_netjet_s(cs);
  10290. cs->readisac = &NETjet_ReadIC;
  10291. cs->writeisac = &NETjet_WriteIC;
  10292. cs->readisacfifo = &NETjet_ReadICfifo;
  10293. Index: linux-2.4.35.4/drivers/isdn/hisax/nj_u.c
  10294. ===================================================================
  10295. --- linux-2.4.35.4.orig/drivers/isdn/hisax/nj_u.c
  10296. +++ linux-2.4.35.4/drivers/isdn/hisax/nj_u.c
  10297. @@ -1,4 +1,4 @@
  10298. -/* $Id: nj_u.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  10299. +/* $Id: nj_u.c,v 2.14 2001/09/24 13:22:56 kai Exp $
  10300. *
  10301. * This software may be used and distributed according to the terms
  10302. * of the GNU General Public License, incorporated herein by reference.
  10303. @@ -12,11 +12,12 @@
  10304. #include "icc.h"
  10305. #include "isdnl1.h"
  10306. #include <linux/pci.h>
  10307. +#include <linux/isdn_compat.h>
  10308. #include <linux/interrupt.h>
  10309. #include <linux/ppp_defs.h>
  10310. #include "netjet.h"
  10311. -const char *NETjet_U_revision = "$Revision: 1.1.4.1 $";
  10312. +const char *NETjet_U_revision = "$Revision: 2.14 $";
  10313. static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off)
  10314. {
  10315. @@ -181,7 +182,7 @@ setup_netjet_u(struct IsdnCard *card)
  10316. printk(KERN_WARNING "NETspider-U: No IRQ for PCI card found\n");
  10317. return(0);
  10318. }
  10319. - cs->hw.njet.base = pci_resource_start(dev_netjet, 0);
  10320. + cs->hw.njet.base = pci_resource_start_io(dev_netjet, 0);
  10321. if (!cs->hw.njet.base) {
  10322. printk(KERN_WARNING "NETspider-U: No IO-Adr for PCI card found\n");
  10323. return(0);
  10324. Index: linux-2.4.35.4/drivers/isdn/hisax/q931.c
  10325. ===================================================================
  10326. --- linux-2.4.35.4.orig/drivers/isdn/hisax/q931.c
  10327. +++ linux-2.4.35.4/drivers/isdn/hisax/q931.c
  10328. @@ -1,4 +1,4 @@
  10329. -/* $Id: q931.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  10330. +/* $Id: q931.c,v 1.12 2001/09/24 13:22:56 kai Exp $
  10331. *
  10332. * code to decode ITU Q.931 call control messages
  10333. *
  10334. @@ -197,6 +197,31 @@ struct MessageType mt_n1[] =
  10335. #define MT_N1_LEN (sizeof(mt_n1) / sizeof(struct MessageType))
  10336. +#if 0
  10337. +static struct MessageType fac_1tr6[] =
  10338. +{
  10339. + {FAC_Sperre, "Sperre"},
  10340. + {FAC_Forward1, "Forward 1"},
  10341. + {FAC_Forward2, "Forward 2"},
  10342. + {FAC_Konferenz, "Konferenz"},
  10343. + {FAC_GrabBchan, "Grab Bchannel"},
  10344. + {FAC_Reactivate, "Reactivate"},
  10345. + {FAC_Konferenz3, "Dreier Konferenz"},
  10346. + {FAC_Dienstwechsel1, "Einseitiger Dienstwechsel"},
  10347. + {FAC_Dienstwechsel2, "Zweiseitiger Dienstwechsel"},
  10348. + {FAC_NummernIdent, "Rufnummer-Identifizierung"},
  10349. + {FAC_GBG, "GBG"},
  10350. + {FAC_DisplayUebergeben, "Display Uebergeben"},
  10351. + {FAC_DisplayUmgeleitet, "Display Umgeleitet"},
  10352. + {FAC_Unterdruecke, "Unterdruecke Rufnummer"},
  10353. + {FAC_Deactivate, "Deactivate"},
  10354. + {FAC_Activate, "Activate"},
  10355. + {FAC_SPV, "SPV"},
  10356. + {FAC_Rueckwechsel, "Rueckwechsel"},
  10357. + {FAC_Umleitung, "Umleitung"}
  10358. +};
  10359. +#define FAC_1TR6_LEN (sizeof(fac_1tr6) / sizeof(struct MessageType))
  10360. +#endif
  10361. static int
  10362. prbits(char *dest, u_char b, int start, int len)
  10363. Index: linux-2.4.35.4/drivers/isdn/hisax/rawhdlc.c
  10364. ===================================================================
  10365. --- /dev/null
  10366. +++ linux-2.4.35.4/drivers/isdn/hisax/rawhdlc.c
  10367. @@ -0,0 +1,543 @@
  10368. +/* $Id: rawhdlc.c,v 1.7 2001/09/24 13:22:57 kai Exp $
  10369. + *
  10370. + * support routines for cards that don't support HDLC
  10371. + *
  10372. + * Author Brent Baccala
  10373. + * Copyright by Karsten Keil <[email protected]>
  10374. + * by Brent Baccala <[email protected]>
  10375. + *
  10376. + * This software may be used and distributed according to the terms
  10377. + * of the GNU General Public License, incorporated herein by reference.
  10378. + *
  10379. + *
  10380. + * Some passive ISDN cards, such as the Traverse NETJet and the AMD 7930,
  10381. + * don't perform HDLC encapsulation over the B channel. Drivers for
  10382. + * such cards use support routines in this file to perform B channel HDLC.
  10383. + *
  10384. + * Bit-synchronous HDLC encapsulation is a means of encapsulating packets
  10385. + * over a continuously transmitting serial communications link.
  10386. + * It looks like this:
  10387. + *
  10388. + * 11111111101111110...........0111111011111111111
  10389. + * iiiiiiiiiffffffffdddddddddddffffffffiiiiiiiiiii
  10390. + *
  10391. + * i = idle f = flag d = data
  10392. + *
  10393. + * When idle, the channel sends a continuous string of ones (mark
  10394. + * idle; illustrated), or a continuous string of flag characters (flag
  10395. + * idle). The beginning of a data frame is marked by a flag character
  10396. + * (01111110), then comes the actual data, followed by another flag
  10397. + * character, after which another frame may be sent immediately (a
  10398. + * single flag may serve as both the end of one frame and the start of
  10399. + * the next), or the link may return to idle. Obviously, the flag
  10400. + * character can not appear anywhere in the data (or a false
  10401. + * end-of-frame would occur), so the transmitter performs
  10402. + * "bit-stuffing" - inserting a zero bit after every five one bits,
  10403. + * irregardless of the original bit after the five ones. Byte
  10404. + * ordering is irrelevent at this point - the data is treated as a
  10405. + * string of bits, not bytes. Since no more than 5 ones may now occur
  10406. + * in a row, the flag sequence, with its 6 ones, is unique.
  10407. + *
  10408. + * Upon reception, a zero bit that occur after 5 one bits is simply
  10409. + * discarded. A series of 6 one bits is end-of-frame, and a series of
  10410. + * 7 one bits is an abort. Once bit-stuffing has been corrected for,
  10411. + * an integer number of bytes should now be present. The last two
  10412. + * of these bytes form the Frame Check Sequence, a CRC that is verified
  10413. + * and then discarded. Note that bit-stuffing is performed on the FCS
  10414. + * just as if it were regular data.
  10415. + *
  10416. + *
  10417. + *
  10418. + * int make_raw_hdlc_data(u_char *src, u_int slen,
  10419. + * u_char *dst, u_int dsize)
  10420. + *
  10421. + * Used for transmission. Copies slen bytes from src to dst, performing
  10422. + * HDLC encapsulation (flag bytes, bit-stuffing, CRC) in the process.
  10423. + * dsize is size of destination buffer, and should be at least
  10424. + * ((6*slen)/5)+5 bytes to ensure adequate space will be available.
  10425. + * Function returns length (in bytes) of valid destination buffer, or
  10426. + * 0 upon destination overflow.
  10427. + *
  10428. + * void init_hdlc_state(struct hdlc_state *stateptr, int mode)
  10429. + *
  10430. + * Initializes hdlc_state structure before first call to read_raw_hdlc_data
  10431. + *
  10432. + * mode = 0: Sane mode
  10433. + * mode = 1/2:
  10434. + * Insane mode; NETJet use a shared unsigned int memory block (
  10435. + * with busmaster DMA), the bit pattern of every word is
  10436. + * <8 B1> <8 B2> <8 Mon> <2 D> <4 C/I> <MX> <MR>
  10437. + * according to Siemens IOM-2 interface, so we have to handle
  10438. + * the src buffer as unsigned int and have to shift/mask the
  10439. + * B-channel bytes.
  10440. + * mode 1 -> B1 mode 2 -> B2 data is used
  10441. + *
  10442. + * int read_raw_hdlc_data(struct hdlc_state *saved_state,
  10443. + * u_char *src, u_int slen,
  10444. + * u_char *dst, u_int dsize)
  10445. + *
  10446. + * Used for reception. Scans source buffer bit-by-bit looking for
  10447. + * valid HDLC frames, which are copied to destination buffer. HDLC
  10448. + * state information is stored in a structure, which allows this
  10449. + * function to process frames spread across several blocks of raw
  10450. + * HDLC data. Part of the state information is bit offsets into
  10451. + * the source and destination buffers.
  10452. + *
  10453. + * A return value >0 indicates the length of a valid frame, now
  10454. + * stored in the destination buffer. In this case, the source
  10455. + * buffer might not be completely processed, so this function should
  10456. + * be called again with the same source buffer, possibly with a
  10457. + * different destination buffer.
  10458. + *
  10459. + * A return value of zero indicates that the source buffer was
  10460. + * completely processed without finding a valid end-of-packet;
  10461. + * however, we might be in the middle of packet reception, so
  10462. + * the function should be called again with the next block of
  10463. + * raw HDLC data and the same destination buffer. It is NOT
  10464. + * permitted to change the destination buffer in this case,
  10465. + * since data may already have begun to be stored there.
  10466. + *
  10467. + * A return value of -1 indicates some kind of error - destination
  10468. + * buffer overflow, CRC check failed, frame not a multiple of 8
  10469. + * bits. Destination buffer probably contains invalid data, which
  10470. + * should be discarded. Call function again with same source buffer
  10471. + * and a new (or same) destination buffer.
  10472. + *
  10473. + * Suggested calling sequence:
  10474. + *
  10475. + * init_hdlc_state(...);
  10476. + * for (EACH_RAW_DATA_BLOCK) {
  10477. + * while (len = read_raw_hdlc_data(...)) {
  10478. + * if (len == -1) DISCARD_FRAME;
  10479. + * else PROCESS_FRAME;
  10480. + * }
  10481. + * }
  10482. + *
  10483. + *
  10484. + * Test the code in this file as follows:
  10485. + * gcc -DDEBUGME -o rawhdlctest rawhdlc.c
  10486. + * ./rawhdlctest < rawdata
  10487. + *
  10488. + * The file "rawdata" can be easily generated from a HISAX B-channel
  10489. + * hex dump (CF CF CF 02 ...) using the following perl script:
  10490. + *
  10491. + * while(<>) {
  10492. + * @hexlist = split ' ';
  10493. + * while ($hexstr = shift(@hexlist)) {
  10494. + * printf "%c", hex($hexstr);
  10495. + * }
  10496. + * }
  10497. + *
  10498. + */
  10499. +
  10500. +#ifdef DEBUGME
  10501. +#include <stdio.h>
  10502. +#endif
  10503. +
  10504. +#include <linux/types.h>
  10505. +#include <linux/ppp_defs.h>
  10506. +#include "rawhdlc.h"
  10507. +
  10508. +/* There's actually an identical copy of this table in the PPP code
  10509. + * (ppp_crc16_table), but I don't want this code dependent on PPP
  10510. + */
  10511. +
  10512. +// static
  10513. +__u16 fcstab[256] =
  10514. +{
  10515. + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
  10516. + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
  10517. + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
  10518. + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
  10519. + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
  10520. + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
  10521. + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
  10522. + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
  10523. + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
  10524. + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
  10525. + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
  10526. + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
  10527. + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
  10528. + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
  10529. + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
  10530. + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
  10531. + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
  10532. + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
  10533. + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
  10534. + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
  10535. + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
  10536. + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
  10537. + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
  10538. + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
  10539. + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
  10540. + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
  10541. + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
  10542. + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
  10543. + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
  10544. + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
  10545. + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
  10546. + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
  10547. +};
  10548. +
  10549. +#define HDLC_ZERO_SEARCH 0
  10550. +#define HDLC_FLAG_SEARCH 1
  10551. +#define HDLC_FLAG_FOUND 2
  10552. +#define HDLC_FRAME_FOUND 3
  10553. +#define HDLC_NULL 4
  10554. +#define HDLC_PART 5
  10555. +#define HDLC_FULL 6
  10556. +
  10557. +#define HDLC_FLAG_VALUE 0x7e
  10558. +
  10559. +
  10560. +#define MAKE_RAW_BYTE for (j=0; j<8; j++) { \
  10561. + bitcnt++;\
  10562. + out_val >>= 1;\
  10563. + if (val & 1) {\
  10564. + s_one++;\
  10565. + out_val |= 0x80;\
  10566. + } else {\
  10567. + s_one = 0;\
  10568. + out_val &= 0x7f;\
  10569. + }\
  10570. + if (bitcnt==8) {\
  10571. + if (d_cnt == dsize) return 0;\
  10572. + dst[d_cnt++] = out_val;\
  10573. + bitcnt = 0;\
  10574. + }\
  10575. + if (s_one == 5) {\
  10576. + out_val >>= 1;\
  10577. + out_val &= 0x7f;\
  10578. + bitcnt++;\
  10579. + s_one = 0;\
  10580. + }\
  10581. + if (bitcnt==8) {\
  10582. + if (d_cnt == dsize) return 0;\
  10583. + dst[d_cnt++] = out_val;\
  10584. + bitcnt = 0;\
  10585. + }\
  10586. + val >>= 1;\
  10587. + }
  10588. +
  10589. +/* Optimization suggestion: If needed, this function could be
  10590. + * dramatically sped up using a state machine. Each state would
  10591. + * correspond to having seen N one bits, and being offset M bits into
  10592. + * the current output byte. N ranges from 0 to 4, M from 0 to 7, so
  10593. + * we need 5*8 = 35 states. Each state would have a table with 256
  10594. + * entries, one for each input character. Each entry would contain
  10595. + * three output characters, an output state, an a byte increment
  10596. + * that's either 1 or 2. All this could fit in four bytes; so we need
  10597. + * 4 bytes * 256 characters = 1 KB for each state (35 KB total). Zero
  10598. + * the output buffer before you start. For each character in your
  10599. + * input, you look it up in the current state's table and get three
  10600. + * bytes to be or'ed into the output at the current byte offset, and
  10601. + * an byte increment to move your pointer forward. A simple Perl
  10602. + * script could generate the tables. Given HDLC semantics, probably
  10603. + * would be better to set output to all 1s, then use ands instead of ors.
  10604. + * A smaller state machine could operate on nibbles instead of bytes.
  10605. + * A state machine for 32-bit architectures could use word offsets
  10606. + * instead of byte offsets, requiring 5*32 = 160 states; probably
  10607. + * best to work on nibbles in such a case.
  10608. + */
  10609. +
  10610. +
  10611. +int make_raw_hdlc_data(u_char *src, u_int slen, u_char *dst, u_int dsize)
  10612. +{
  10613. + register u_int i,d_cnt=0;
  10614. + register u_char j;
  10615. + register u_char val;
  10616. + register u_char s_one = 0;
  10617. + register u_char out_val = 0;
  10618. + register u_char bitcnt = 0;
  10619. + u_int fcs;
  10620. +
  10621. +
  10622. + dst[d_cnt++] = HDLC_FLAG_VALUE;
  10623. + fcs = PPP_INITFCS;
  10624. + for (i=0; i<slen; i++) {
  10625. + val = src[i];
  10626. + fcs = PPP_FCS (fcs, val);
  10627. + MAKE_RAW_BYTE;
  10628. + }
  10629. + fcs ^= 0xffff;
  10630. + val = fcs & 0xff;
  10631. + MAKE_RAW_BYTE;
  10632. + val = (fcs>>8) & 0xff;
  10633. + MAKE_RAW_BYTE;
  10634. + val = HDLC_FLAG_VALUE;
  10635. + for (j=0; j<8; j++) {
  10636. + bitcnt++;
  10637. + out_val >>= 1;
  10638. + if (val & 1)
  10639. + out_val |= 0x80;
  10640. + else
  10641. + out_val &= 0x7f;
  10642. + if (bitcnt==8) {
  10643. + if (d_cnt == dsize) return 0;
  10644. + dst[d_cnt++] = out_val;
  10645. + bitcnt = 0;
  10646. + }
  10647. + val >>= 1;
  10648. + }
  10649. + if (bitcnt) {
  10650. + while (8>bitcnt++) {
  10651. + out_val >>= 1;
  10652. + out_val |= 0x80;
  10653. + }
  10654. + if (d_cnt == dsize) return 0;
  10655. + dst[d_cnt++] = out_val;
  10656. + }
  10657. +
  10658. + return d_cnt;
  10659. +}
  10660. +
  10661. +void init_hdlc_state(struct hdlc_state *stateptr, int mode)
  10662. +{
  10663. + stateptr->state = HDLC_ZERO_SEARCH;
  10664. + stateptr->r_one = 0;
  10665. + stateptr->r_val = 0;
  10666. + stateptr->o_bitcnt = 0;
  10667. + stateptr->i_bitcnt = 0;
  10668. + stateptr->insane_mode = mode;
  10669. +}
  10670. +
  10671. +/* Optimization suggestion: A similar state machine could surely
  10672. + * be developed for this function as well.
  10673. + */
  10674. +
  10675. +int read_raw_hdlc_data(struct hdlc_state *saved_state,
  10676. + u_char *src, u_int slen, u_char *dst, u_int dsize)
  10677. +{
  10678. + int retval=0;
  10679. + register u_char val;
  10680. + register u_char state = saved_state->state;
  10681. + register u_char r_one = saved_state->r_one;
  10682. + register u_char r_val = saved_state->r_val;
  10683. + register u_int o_bitcnt = saved_state->o_bitcnt;
  10684. + register u_int i_bitcnt = saved_state->i_bitcnt;
  10685. + register u_int fcs = saved_state->fcs;
  10686. + register u_int *isrc = (u_int *) src;
  10687. +
  10688. + /* Use i_bitcnt (bit offset into source buffer) to reload "val"
  10689. + * in case we're starting up again partway through a source buffer
  10690. + */
  10691. +
  10692. + if ((i_bitcnt >> 3) < slen) {
  10693. + if (saved_state->insane_mode==1) {
  10694. + val = isrc[(i_bitcnt >> 3)] & 0xff;
  10695. + } else if (saved_state->insane_mode==2) {
  10696. + val = (isrc[i_bitcnt >> 3] >>8) & 0xff;
  10697. + } else {
  10698. + val = src[i_bitcnt >> 3];
  10699. + }
  10700. + val >>= i_bitcnt & 7;
  10701. + }
  10702. +
  10703. + /* One bit per loop. Keep going until we've got something to
  10704. + * report (retval != 0), or we exhaust the source buffer
  10705. + */
  10706. +
  10707. + while ((retval == 0) && ((i_bitcnt >> 3) < slen)) {
  10708. + if ((i_bitcnt & 7) == 0) {
  10709. + if (saved_state->insane_mode==1) {
  10710. + val = isrc[(i_bitcnt >> 3)] & 0xff;
  10711. + } else if (saved_state->insane_mode==2) {
  10712. + val = (isrc[i_bitcnt >> 3] >>8) & 0xff;
  10713. + } else {
  10714. + val = src[i_bitcnt >> 3];
  10715. + }
  10716. +#ifdef DEBUGME
  10717. + printf("Input byte %d: 0x%2x\n", i_bitcnt>>3, val);
  10718. +#endif
  10719. + if (val == 0xff) {
  10720. + state = HDLC_ZERO_SEARCH;
  10721. + o_bitcnt = 0;
  10722. + r_one = 0;
  10723. + i_bitcnt += 8;
  10724. + continue;
  10725. + }
  10726. + }
  10727. +
  10728. +#ifdef DEBUGME
  10729. + /* printf("Data bit=%d (%d/%d)\n", val&1, i_bitcnt>>3, i_bitcnt&7);*/
  10730. +#endif
  10731. +
  10732. + if (state == HDLC_ZERO_SEARCH) {
  10733. + if (val & 1) {
  10734. + r_one++;
  10735. + } else {
  10736. + r_one=0;
  10737. + state= HDLC_FLAG_SEARCH;
  10738. + }
  10739. + } else if (state == HDLC_FLAG_SEARCH) {
  10740. + if (val & 1) {
  10741. + r_one++;
  10742. + if (r_one>6) {
  10743. + state=HDLC_ZERO_SEARCH;
  10744. + }
  10745. + } else {
  10746. + if (r_one==6) {
  10747. + o_bitcnt=0;
  10748. + r_val=0;
  10749. + state=HDLC_FLAG_FOUND;
  10750. + }
  10751. + r_one=0;
  10752. + }
  10753. + } else if (state == HDLC_FLAG_FOUND) {
  10754. + if (val & 1) {
  10755. + r_one++;
  10756. + if (r_one>6) {
  10757. + state=HDLC_ZERO_SEARCH;
  10758. + } else {
  10759. + r_val >>= 1;
  10760. + r_val |= 0x80;
  10761. + o_bitcnt++;
  10762. + }
  10763. + } else {
  10764. + if (r_one==6) {
  10765. + o_bitcnt=0;
  10766. + r_val=0;
  10767. + r_one=0;
  10768. + i_bitcnt++;
  10769. + val >>= 1;
  10770. + continue;
  10771. + } else if (r_one!=5) {
  10772. + r_val >>= 1;
  10773. + r_val &= 0x7f;
  10774. + o_bitcnt++;
  10775. + }
  10776. + r_one=0;
  10777. + }
  10778. + if ((state != HDLC_ZERO_SEARCH) &&
  10779. + !(o_bitcnt & 7)) {
  10780. +#ifdef DEBUGME
  10781. + printf("HDLC_FRAME_FOUND at i_bitcnt:%d\n",i_bitcnt);
  10782. +#endif
  10783. + state=HDLC_FRAME_FOUND;
  10784. + fcs = PPP_INITFCS;
  10785. + dst[0] = r_val;
  10786. + fcs = PPP_FCS (fcs, r_val);
  10787. + }
  10788. + } else if (state == HDLC_FRAME_FOUND) {
  10789. + if (val & 1) {
  10790. + r_one++;
  10791. + if (r_one>6) {
  10792. + state=HDLC_ZERO_SEARCH;
  10793. + o_bitcnt=0;
  10794. + } else {
  10795. + r_val >>= 1;
  10796. + r_val |= 0x80;
  10797. + o_bitcnt++;
  10798. + }
  10799. + } else {
  10800. + if (r_one==6) {
  10801. + r_val=0;
  10802. + r_one=0;
  10803. + o_bitcnt++;
  10804. + if (o_bitcnt & 7) {
  10805. + /* Alignment error */
  10806. +#ifdef DEBUGME
  10807. + printf("Alignment error\n");
  10808. +#endif
  10809. + state=HDLC_FLAG_SEARCH;
  10810. + retval = -1;
  10811. + } else if (fcs==PPP_GOODFCS) {
  10812. + /* Valid frame */
  10813. + state=HDLC_FLAG_FOUND;
  10814. + retval = (o_bitcnt>>3)-3;
  10815. + } else {
  10816. + /* CRC error */
  10817. +#ifdef DEBUGME
  10818. + printf("CRC error; fcs was 0x%x, should have been 0x%x\n", fcs, PPP_GOODFCS);
  10819. +#endif
  10820. + state=HDLC_FLAG_FOUND;
  10821. + retval = -1;
  10822. + }
  10823. + } else if (r_one==5) {
  10824. + r_one=0;
  10825. + i_bitcnt++;
  10826. + val >>= 1;
  10827. + continue;
  10828. + } else {
  10829. + r_val >>= 1;
  10830. + r_val &= 0x7f;
  10831. + o_bitcnt++;
  10832. + }
  10833. + r_one=0;
  10834. + }
  10835. + if ((state == HDLC_FRAME_FOUND) &&
  10836. + !(o_bitcnt & 7)) {
  10837. + if ((o_bitcnt>>3)>=dsize) {
  10838. + /* Buffer overflow error */
  10839. +#ifdef DEBUGME
  10840. + printf("Buffer overflow error\n");
  10841. +#endif
  10842. + r_val=0;
  10843. + state=HDLC_FLAG_SEARCH;
  10844. + retval = -1;
  10845. + } else {
  10846. + dst[(o_bitcnt>>3)-1] = r_val;
  10847. + fcs = PPP_FCS (fcs, r_val);
  10848. +#ifdef DEBUGME
  10849. + printf("Output byte %d: 0x%02x; FCS 0x%04x\n", (o_bitcnt>>3)-1, r_val, fcs);
  10850. +#endif
  10851. + }
  10852. + }
  10853. + }
  10854. + i_bitcnt ++;
  10855. + val >>= 1;
  10856. + }
  10857. +
  10858. + /* We exhausted the source buffer before anything else happened
  10859. + * (retval==0). Reset i_bitcnt in expectation of a new source
  10860. + * buffer. Other, we either had an error or a valid frame, so
  10861. + * reset o_bitcnt in expectation of a new destination buffer.
  10862. + */
  10863. +
  10864. + if (retval == 0) {
  10865. + i_bitcnt = 0;
  10866. + } else {
  10867. + o_bitcnt = 0;
  10868. + }
  10869. +
  10870. + saved_state->state = state;
  10871. + saved_state->r_one = r_one;
  10872. + saved_state->r_val = r_val;
  10873. + saved_state->fcs = fcs;
  10874. + saved_state->o_bitcnt = o_bitcnt;
  10875. + saved_state->i_bitcnt = i_bitcnt;
  10876. +
  10877. + return (retval);
  10878. +}
  10879. +
  10880. +
  10881. +
  10882. +#ifdef DEBUGME
  10883. +
  10884. +char buffer[1024];
  10885. +char obuffer[1024];
  10886. +
  10887. +main()
  10888. +{
  10889. + int buflen=0;
  10890. + int len;
  10891. + struct hdlc_state hdlc_state;
  10892. +
  10893. + while((buffer[buflen] = getc(stdin)) != EOF && buflen<1024) buflen++;
  10894. +
  10895. + printf("buflen = %d\n", buflen);
  10896. +
  10897. + init_hdlc_state(&hdlc_state, 0);
  10898. +
  10899. + while (len = read_raw_hdlc_data(&hdlc_state,buffer,buflen,obuffer,1024)) {
  10900. + if (len == -1) printf("Error @ byte %d/bit %d\n",
  10901. + hdlc_state.i_bitcnt>>3, hdlc_state.i_bitcnt & 7);
  10902. + else {
  10903. + printf("Frame received: len %d\n", len);
  10904. + }
  10905. + }
  10906. +
  10907. + printf("Done\n");
  10908. +}
  10909. +
  10910. +#endif
  10911. Index: linux-2.4.35.4/drivers/isdn/hisax/rawhdlc.h
  10912. ===================================================================
  10913. --- /dev/null
  10914. +++ linux-2.4.35.4/drivers/isdn/hisax/rawhdlc.h
  10915. @@ -0,0 +1,28 @@
  10916. +/* $Id: rawhdlc.h,v 1.5 2001/09/24 13:22:57 kai Exp $
  10917. + *
  10918. + * Author Brent Baccala
  10919. + * Copyright by Brent Baccala <[email protected]>
  10920. + *
  10921. + * This software may be used and distributed according to the terms
  10922. + * of the GNU General Public License, incorporated herein by reference.
  10923. + *
  10924. + */
  10925. +
  10926. +#ifndef RAWHDLC_H
  10927. +struct hdlc_state {
  10928. + char insane_mode;
  10929. + u_char state;
  10930. + u_char r_one;
  10931. + u_char r_val;
  10932. + u_int o_bitcnt;
  10933. + u_int i_bitcnt;
  10934. + u_int fcs;
  10935. +};
  10936. +
  10937. +
  10938. +int make_raw_hdlc_data(u_char *src, u_int slen, u_char *dst, u_int dsize);
  10939. +void init_hdlc_state(struct hdlc_state *stateptr, int mode);
  10940. +int read_raw_hdlc_data(struct hdlc_state *saved_state,
  10941. + u_char *src, u_int slen, u_char *dst, u_int dsize);
  10942. +#define RAWHDLC_H
  10943. +#endif
  10944. Index: linux-2.4.35.4/drivers/isdn/hisax/s0box.c
  10945. ===================================================================
  10946. --- linux-2.4.35.4.orig/drivers/isdn/hisax/s0box.c
  10947. +++ linux-2.4.35.4/drivers/isdn/hisax/s0box.c
  10948. @@ -1,4 +1,4 @@
  10949. -/* $Id: s0box.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  10950. +/* $Id: s0box.c,v 2.6 2001/09/24 13:22:57 kai Exp $
  10951. *
  10952. * low level stuff for Creatix S0BOX
  10953. *
  10954. @@ -18,7 +18,7 @@
  10955. #include "isdnl1.h"
  10956. extern const char *CardType[];
  10957. -const char *s0box_revision = "$Revision: 1.1.4.1 $";
  10958. +const char *s0box_revision = "$Revision: 2.6 $";
  10959. static inline void
  10960. writereg(unsigned int padr, signed int addr, u_char off, u_char val) {
  10961. Index: linux-2.4.35.4/drivers/isdn/hisax/saphir.c
  10962. ===================================================================
  10963. --- linux-2.4.35.4.orig/drivers/isdn/hisax/saphir.c
  10964. +++ linux-2.4.35.4/drivers/isdn/hisax/saphir.c
  10965. @@ -1,4 +1,4 @@
  10966. -/* $Id: saphir.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  10967. +/* $Id: saphir.c,v 1.10 2001/09/24 13:22:57 kai Exp $
  10968. *
  10969. * low level stuff for HST Saphir 1
  10970. *
  10971. @@ -20,7 +20,7 @@
  10972. #include "isdnl1.h"
  10973. extern const char *CardType[];
  10974. -static char *saphir_rev = "$Revision: 1.1.4.1 $";
  10975. +static char *saphir_rev = "$Revision: 1.10 $";
  10976. #define byteout(addr,val) outb(val,addr)
  10977. #define bytein(addr) inb(addr)
  10978. Index: linux-2.4.35.4/drivers/isdn/hisax/sedlbauer.c
  10979. ===================================================================
  10980. --- linux-2.4.35.4.orig/drivers/isdn/hisax/sedlbauer.c
  10981. +++ linux-2.4.35.4/drivers/isdn/hisax/sedlbauer.c
  10982. @@ -1,4 +1,4 @@
  10983. -/* $Id: sedlbauer.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  10984. +/* $Id: sedlbauer.c,v 1.34 2002/02/09 21:00:57 keil Exp $
  10985. *
  10986. * low level stuff for Sedlbauer cards
  10987. * includes support for the Sedlbauer speed star (speed star II),
  10988. @@ -48,18 +48,19 @@
  10989. #include "isar.h"
  10990. #include "isdnl1.h"
  10991. #include <linux/pci.h>
  10992. -#include <linux/isapnp.h>
  10993. +#include <linux/isdn_compat.h>
  10994. extern const char *CardType[];
  10995. -const char *Sedlbauer_revision = "$Revision: 1.1.4.1 $";
  10996. +const char *Sedlbauer_revision = "$Revision: 1.34 $";
  10997. const char *Sedlbauer_Types[] =
  10998. {"None", "speed card/win", "speed star", "speed fax+",
  10999. "speed win II / ISDN PC/104", "speed star II", "speed pci",
  11000. - "speed fax+ pyramid", "speed fax+ pci"};
  11001. + "speed fax+ pyramid", "speed fax+ pci", "HST Saphir III"};
  11002. #define PCI_SUBVENDOR_SPEEDFAX_PYRAMID 0x51
  11003. +#define PCI_SUBVENDOR_HST_SAPHIR3 0x52
  11004. #define PCI_SUBVENDOR_SEDLBAUER_PCI 0x53
  11005. #define PCI_SUBVENDOR_SPEEDFAX_PCI 0x54
  11006. #define PCI_SUB_ID_SEDLBAUER 0x01
  11007. @@ -72,6 +73,7 @@ const char *Sedlbauer_Types[] =
  11008. #define SEDL_SPEED_PCI 6
  11009. #define SEDL_SPEEDFAX_PYRAMID 7
  11010. #define SEDL_SPEEDFAX_PCI 8
  11011. +#define HST_SAPHIR3 9
  11012. #define SEDL_CHIP_TEST 0
  11013. #define SEDL_CHIP_ISAC_HSCX 1
  11014. @@ -531,21 +533,6 @@ Sedl_card_msg(struct IsdnCardState *cs,
  11015. static struct pci_dev *dev_sedl __devinitdata = NULL;
  11016. -#ifdef __ISAPNP__
  11017. -static struct isapnp_device_id sedl_ids[] __initdata = {
  11018. - { ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01),
  11019. - ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01),
  11020. - (unsigned long) "Speed win" },
  11021. - { ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x02),
  11022. - ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x02),
  11023. - (unsigned long) "Speed Fax+" },
  11024. - { 0, }
  11025. -};
  11026. -
  11027. -static struct isapnp_device_id *pdev = &sedl_ids[0];
  11028. -static struct pci_bus *pnp_c __devinitdata = NULL;
  11029. -#endif
  11030. -
  11031. int __devinit
  11032. setup_sedlbauer(struct IsdnCard *card)
  11033. {
  11034. @@ -581,57 +568,6 @@ setup_sedlbauer(struct IsdnCard *card)
  11035. bytecnt = 16;
  11036. }
  11037. } else {
  11038. -#ifdef __ISAPNP__
  11039. - if (isapnp_present()) {
  11040. - struct pci_bus *pb;
  11041. - struct pci_dev *pd;
  11042. -
  11043. - while(pdev->card_vendor) {
  11044. - if ((pb = isapnp_find_card(pdev->card_vendor,
  11045. - pdev->card_device, pnp_c))) {
  11046. - pnp_c = pb;
  11047. - pd = NULL;
  11048. - if ((pd = isapnp_find_dev(pnp_c,
  11049. - pdev->vendor, pdev->function, pd))) {
  11050. - printk(KERN_INFO "HiSax: %s detected\n",
  11051. - (char *)pdev->driver_data);
  11052. - pd->prepare(pd);
  11053. - pd->deactivate(pd);
  11054. - pd->activate(pd);
  11055. - card->para[1] =
  11056. - pd->resource[0].start;
  11057. - card->para[0] =
  11058. - pd->irq_resource[0].start;
  11059. - if (!card->para[0] || !card->para[1]) {
  11060. - printk(KERN_ERR "Sedlbauer PnP:some resources are missing %ld/%lx\n",
  11061. - card->para[0], card->para[1]);
  11062. - pd->deactivate(pd);
  11063. - return(0);
  11064. - }
  11065. - cs->hw.sedl.cfg_reg = card->para[1];
  11066. - cs->irq = card->para[0];
  11067. - if (pdev->function == ISAPNP_FUNCTION(0x2)) {
  11068. - cs->subtyp = SEDL_SPEED_FAX;
  11069. - cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR;
  11070. - bytecnt = 16;
  11071. - } else {
  11072. - cs->subtyp = SEDL_SPEED_CARD_WIN;
  11073. - cs->hw.sedl.chip = SEDL_CHIP_TEST;
  11074. - }
  11075. - goto ready;
  11076. - } else {
  11077. - printk(KERN_ERR "Sedlbauer PnP: PnP error card found, no device\n");
  11078. - return(0);
  11079. - }
  11080. - }
  11081. - pdev++;
  11082. - pnp_c=NULL;
  11083. - }
  11084. - if (!pdev->card_vendor) {
  11085. - printk(KERN_INFO "Sedlbauer PnP: no ISAPnP card found\n");
  11086. - }
  11087. - }
  11088. -#endif
  11089. /* Probe for Sedlbauer speed pci */
  11090. #if CONFIG_PCI
  11091. if (!pci_present()) {
  11092. @@ -647,15 +583,15 @@ setup_sedlbauer(struct IsdnCard *card)
  11093. printk(KERN_WARNING "Sedlbauer: No IRQ for PCI card found\n");
  11094. return(0);
  11095. }
  11096. - cs->hw.sedl.cfg_reg = pci_resource_start(dev_sedl, 0);
  11097. + cs->hw.sedl.cfg_reg = pci_resource_start_io(dev_sedl, 0);
  11098. } else {
  11099. printk(KERN_WARNING "Sedlbauer: No PCI card found\n");
  11100. return(0);
  11101. }
  11102. cs->irq_flags |= SA_SHIRQ;
  11103. cs->hw.sedl.bus = SEDL_BUS_PCI;
  11104. - sub_vendor_id = dev_sedl->subsystem_vendor;
  11105. - sub_id = dev_sedl->subsystem_device;
  11106. + pci_get_sub_vendor(dev_sedl,sub_vendor_id);
  11107. + pci_get_sub_system(dev_sedl,sub_id);
  11108. printk(KERN_INFO "Sedlbauer: PCI subvendor:%x subid %x\n",
  11109. sub_vendor_id, sub_id);
  11110. printk(KERN_INFO "Sedlbauer: PCI base adr %#x\n",
  11111. @@ -670,6 +606,9 @@ setup_sedlbauer(struct IsdnCard *card)
  11112. } else if (sub_vendor_id == PCI_SUBVENDOR_SPEEDFAX_PCI) {
  11113. cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR;
  11114. cs->subtyp = SEDL_SPEEDFAX_PCI;
  11115. + } else if (sub_vendor_id == PCI_SUBVENDOR_HST_SAPHIR3) {
  11116. + cs->hw.sedl.chip = SEDL_CHIP_IPAC;
  11117. + cs->subtyp = HST_SAPHIR3;
  11118. } else if (sub_vendor_id == PCI_SUBVENDOR_SEDLBAUER_PCI) {
  11119. cs->hw.sedl.chip = SEDL_CHIP_IPAC;
  11120. cs->subtyp = SEDL_SPEED_PCI;
  11121. @@ -683,8 +622,8 @@ setup_sedlbauer(struct IsdnCard *card)
  11122. cs->hw.sedl.reset_off = SEDL_ISAR_PCI_ISAR_RESET_OFF;
  11123. byteout(cs->hw.sedl.cfg_reg, 0xff);
  11124. byteout(cs->hw.sedl.cfg_reg, 0x00);
  11125. - byteout(cs->hw.sedl.cfg_reg+ 2, 0xdd);
  11126. - byteout(cs->hw.sedl.cfg_reg+ 5, 0x02);
  11127. + byteout(cs->hw.sedl.cfg_reg +2, 0xdd);
  11128. + byteout(cs->hw.sedl.cfg_reg +5, 0x02);
  11129. byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_on);
  11130. save_flags(flags);
  11131. sti();
  11132. @@ -697,7 +636,7 @@ setup_sedlbauer(struct IsdnCard *card)
  11133. return (0);
  11134. #endif /* CONFIG_PCI */
  11135. }
  11136. -ready:
  11137. +
  11138. /* In case of the sedlbauer pcmcia card, this region is in use,
  11139. * reserved for us by the card manager. So we do not check it
  11140. * here, it would fail.
  11141. Index: linux-2.4.35.4/drivers/isdn/hisax/sportster.c
  11142. ===================================================================
  11143. --- linux-2.4.35.4.orig/drivers/isdn/hisax/sportster.c
  11144. +++ linux-2.4.35.4/drivers/isdn/hisax/sportster.c
  11145. @@ -1,4 +1,4 @@
  11146. -/* $Id: sportster.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  11147. +/* $Id: sportster.c,v 1.16 2001/09/24 13:22:57 kai Exp $
  11148. *
  11149. * low level stuff for USR Sportster internal TA
  11150. *
  11151. @@ -20,7 +20,7 @@
  11152. #include "isdnl1.h"
  11153. extern const char *CardType[];
  11154. -const char *sportster_revision = "$Revision: 1.1.4.1 $";
  11155. +const char *sportster_revision = "$Revision: 1.16 $";
  11156. #define byteout(addr,val) outb(val,addr)
  11157. #define bytein(addr) inb(addr)
  11158. Index: linux-2.4.35.4/drivers/isdn/hisax/st5481-debug.h
  11159. ===================================================================
  11160. --- /dev/null
  11161. +++ linux-2.4.35.4/drivers/isdn/hisax/st5481-debug.h
  11162. @@ -0,0 +1,103 @@
  11163. +#define ST5481_DEBUG 0x0
  11164. +
  11165. +#if ST5481_DEBUG
  11166. +
  11167. +
  11168. +/*
  11169. + DEBUG flags. Set compile option ST5481_DEBUG with the following bits set to trace
  11170. + the given subsections:
  11171. +
  11172. + 0x01: USB
  11173. + 0x02: D
  11174. + 0x04: B
  11175. + 0x08: PH
  11176. + 0x10: PACKET_DUMP D out
  11177. + 0x20: ISO_DUMP D out
  11178. + 0x40: PACKET_DUMP D in
  11179. + 0x80: ISO_DUMP in
  11180. + 0x100: PACKET_DUMP B out
  11181. + 0x200: ISO_DUMP B out
  11182. + 0x400: PACKET_DUMP B in
  11183. +*/
  11184. +
  11185. +#define DBG(level, format, arg...) \
  11186. +if (level & ST5481_DEBUG) \
  11187. +printk(KERN_DEBUG __FUNCTION__ ": " format "\n" , ## arg) \
  11188. +
  11189. +static inline void
  11190. +dump_packet(const char *name,const u_char *data,int pkt_len)
  11191. +{
  11192. +#define DUMP_HDR_SIZE 200
  11193. +#define DUMP_TLR_SIZE 8
  11194. + if (pkt_len) {
  11195. + int i,len1,len2;
  11196. +
  11197. + printk(KERN_DEBUG "%s: length=%d,data=",name,pkt_len);
  11198. +
  11199. + if (pkt_len > DUMP_HDR_SIZE+ DUMP_TLR_SIZE) {
  11200. + len1 = DUMP_HDR_SIZE;
  11201. + len2 = DUMP_TLR_SIZE;
  11202. + } else {
  11203. + len1 = pkt_len > DUMP_HDR_SIZE ? DUMP_HDR_SIZE : pkt_len;
  11204. + len2 = 0;
  11205. + }
  11206. + for (i = 0; i < len1; ++i) {
  11207. + printk ("%.2x", data[i]);
  11208. + }
  11209. + if (len2) {
  11210. + printk ("..");
  11211. + for (i = pkt_len-DUMP_TLR_SIZE; i < pkt_len; ++i) {
  11212. + printk ("%.2x", data[i]);
  11213. + }
  11214. + }
  11215. + printk ("\n");
  11216. + }
  11217. +#undef DUMP_HDR_SIZE
  11218. +#undef DUMP_TLR_SIZE
  11219. +}
  11220. +
  11221. +static inline void
  11222. +dump_iso_packet(const char *name,urb_t *urb)
  11223. +{
  11224. + int i,j;
  11225. + int len,ofs;
  11226. + u_char *data;
  11227. +
  11228. + printk(KERN_DEBUG "%s: packets=%d,errors=%d\n",
  11229. + name,urb->number_of_packets,urb->error_count);
  11230. + for (i = 0; i < urb->number_of_packets; ++i) {
  11231. + if (urb->pipe & USB_DIR_IN) {
  11232. + len = urb->iso_frame_desc[i].actual_length;
  11233. + } else {
  11234. + len = urb->iso_frame_desc[i].length;
  11235. + }
  11236. + ofs = urb->iso_frame_desc[i].offset;
  11237. + printk(KERN_DEBUG "len=%.2d,ofs=%.3d ",len,ofs);
  11238. + if (len) {
  11239. + data = urb->transfer_buffer+ofs;
  11240. + for (j=0; j < len; j++) {
  11241. + printk ("%.2x", data[j]);
  11242. + }
  11243. + }
  11244. + printk("\n");
  11245. + }
  11246. +}
  11247. +
  11248. +#define DUMP_PACKET(level,data,count) \
  11249. + if (level & ST5481_DEBUG) dump_packet(__FUNCTION__,data,count)
  11250. +#define DUMP_SKB(level,skb) \
  11251. + if ((level & ST5481_DEBUG) && skb) dump_packet(__FUNCTION__,skb->data,skb->len)
  11252. +#define DUMP_ISO_PACKET(level,urb) \
  11253. + if (level & ST5481_DEBUG) dump_iso_packet(__FUNCTION__,urb)
  11254. +
  11255. +#else
  11256. +
  11257. +#define DBG(level,format, arg...) do {} while (0)
  11258. +#define DUMP_PACKET(level,data,count) do {} while (0)
  11259. +#define DUMP_SKB(level,skb) do {} while (0)
  11260. +#define DUMP_ISO_PACKET(level,urb) do {} while (0)
  11261. +
  11262. +#endif
  11263. +
  11264. +
  11265. +
  11266. Index: linux-2.4.35.4/drivers/isdn/hisax/st5481.h
  11267. ===================================================================
  11268. --- linux-2.4.35.4.orig/drivers/isdn/hisax/st5481.h
  11269. +++ linux-2.4.35.4/drivers/isdn/hisax/st5481.h
  11270. @@ -219,15 +219,15 @@ enum {
  11271. #define L1_EVENT_COUNT (EV_TIMER3 + 1)
  11272. #define ERR(format, arg...) \
  11273. -printk(KERN_ERR "%s:%s: " format "\n" , __FILE__, __FUNCTION__ , ## arg)
  11274. +printk(KERN_ERR __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
  11275. #define WARN(format, arg...) \
  11276. -printk(KERN_WARNING "%s:%s: " format "\n" , __FILE__, __FUNCTION__ , ## arg)
  11277. +printk(KERN_WARNING __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
  11278. #define INFO(format, arg...) \
  11279. -printk(KERN_INFO "%s:%s: " format "\n" , __FILE__, __FUNCTION__ , ## arg)
  11280. +printk(KERN_INFO __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg)
  11281. -#include "isdnhdlc.h"
  11282. +#include "st5481_hdlc.h"
  11283. #include "fsm.h"
  11284. #include "hisax_if.h"
  11285. #include <linux/skbuff.h>
  11286. @@ -236,7 +236,7 @@ printk(KERN_INFO "%s:%s: " format "\n" ,
  11287. * FIFO handling
  11288. */
  11289. -/* Generic FIFO structure */
  11290. +/* Generic FIFO structure */
  11291. struct fifo {
  11292. u_char r,w,count,size;
  11293. spinlock_t lock;
  11294. @@ -270,7 +270,7 @@ static inline int fifo_add(struct fifo *
  11295. index = -1;
  11296. } else {
  11297. // Return index where to get the next data to add to the FIFO
  11298. - index = fifo->w++ & (fifo->size-1);
  11299. + index = fifo->w++ & (fifo->size-1);
  11300. fifo->count++;
  11301. }
  11302. spin_unlock_irqrestore(&fifo->lock, flags);
  11303. @@ -289,13 +289,13 @@ static inline int fifo_remove(struct fif
  11304. return -1;
  11305. }
  11306. - spin_lock_irqsave(&fifo->lock, flags);
  11307. + spin_lock_irqsave(&fifo->lock, flags);
  11308. if (!fifo->count) {
  11309. // FIFO empty
  11310. index = -1;
  11311. } else {
  11312. // Return index where to get the next data from the FIFO
  11313. - index = fifo->r++ & (fifo->size-1);
  11314. + index = fifo->r++ & (fifo->size-1);
  11315. fifo->count--;
  11316. }
  11317. spin_unlock_irqrestore(&fifo->lock, flags);
  11318. @@ -309,7 +309,7 @@ static inline int fifo_remove(struct fif
  11319. typedef void (*ctrl_complete_t)(void *);
  11320. typedef struct ctrl_msg {
  11321. - struct usb_ctrlrequest dr;
  11322. + devrequest dr;
  11323. ctrl_complete_t complete;
  11324. void *context;
  11325. } ctrl_msg;
  11326. @@ -336,7 +336,7 @@ struct st5481_intr {
  11327. };
  11328. struct st5481_d_out {
  11329. - struct isdnhdlc_vars hdlc_state;
  11330. + struct hdlc_vars hdlc_state;
  11331. struct urb *urb[2]; /* double buffering */
  11332. unsigned long busy;
  11333. struct sk_buff *tx_skb;
  11334. @@ -344,7 +344,7 @@ struct st5481_d_out {
  11335. };
  11336. struct st5481_b_out {
  11337. - struct isdnhdlc_vars hdlc_state;
  11338. + struct hdlc_vars hdlc_state;
  11339. struct urb *urb[2]; /* double buffering */
  11340. u_char flow_event;
  11341. u_long busy;
  11342. @@ -352,7 +352,7 @@ struct st5481_b_out {
  11343. };
  11344. struct st5481_in {
  11345. - struct isdnhdlc_vars hdlc_state;
  11346. + struct hdlc_vars hdlc_state;
  11347. struct urb *urb[2]; /* double buffering */
  11348. int mode;
  11349. int bufsize;
  11350. @@ -478,7 +478,7 @@ extern int st5481_debug;
  11351. if (level & __debug_variable) dump_iso_packet(__FUNCTION__,urb)
  11352. static void __attribute__((unused))
  11353. -dump_iso_packet(const char *name,struct urb *urb)
  11354. +dump_iso_packet(const char *name,urb_t *urb)
  11355. {
  11356. int i,j;
  11357. int len,ofs;
  11358. Index: linux-2.4.35.4/drivers/isdn/hisax/st5481_b.c
  11359. ===================================================================
  11360. --- linux-2.4.35.4.orig/drivers/isdn/hisax/st5481_b.c
  11361. +++ linux-2.4.35.4/drivers/isdn/hisax/st5481_b.c
  11362. @@ -67,28 +67,24 @@ static void usb_b_out(struct st5481_bcs
  11363. bytes_sent = buf_size - len;
  11364. if (skb->len < bytes_sent)
  11365. bytes_sent = skb->len;
  11366. - { /* swap tx bytes to get hearable audio data */
  11367. - register unsigned char *src = skb->data;
  11368. - register unsigned char *dest = urb->transfer_buffer+len;
  11369. - register unsigned int count;
  11370. - for (count = 0; count < bytes_sent; count++)
  11371. - *dest++ = isdnhdlc_bit_rev_tab[*src++];
  11372. - }
  11373. +
  11374. + memcpy(urb->transfer_buffer+len, skb->data, bytes_sent);
  11375. +
  11376. len += bytes_sent;
  11377. } else {
  11378. - len += isdnhdlc_encode(&b_out->hdlc_state,
  11379. - skb->data, skb->len, &bytes_sent,
  11380. - urb->transfer_buffer+len, buf_size-len);
  11381. + len += hdlc_encode(&b_out->hdlc_state,
  11382. + skb->data, skb->len, &bytes_sent,
  11383. + urb->transfer_buffer+len, buf_size-len);
  11384. }
  11385. skb_pull(skb, bytes_sent);
  11386. -
  11387. +
  11388. if (!skb->len) {
  11389. // Frame sent
  11390. b_out->tx_skb = NULL;
  11391. B_L1L2(bcs, PH_DATA | CONFIRM, (void *) skb->truesize);
  11392. dev_kfree_skb_any(skb);
  11393. -
  11394. +
  11395. /* if (!(bcs->tx_skb = skb_dequeue(&bcs->sq))) { */
  11396. /* st5481B_sched_event(bcs, B_XMTBUFREADY); */
  11397. /* } */
  11398. @@ -99,9 +95,9 @@ static void usb_b_out(struct st5481_bcs
  11399. len = buf_size;
  11400. } else {
  11401. // Send flags
  11402. - len += isdnhdlc_encode(&b_out->hdlc_state,
  11403. - NULL, 0, &bytes_sent,
  11404. - urb->transfer_buffer+len, buf_size-len);
  11405. + len += hdlc_encode(&b_out->hdlc_state,
  11406. + NULL, 0, &bytes_sent,
  11407. + urb->transfer_buffer+len, buf_size-len);
  11408. }
  11409. }
  11410. }
  11411. @@ -213,7 +209,7 @@ static void st5481B_mode(struct st5481_b
  11412. if (bcs->mode != L1_MODE_NULL) {
  11413. // Open the B channel
  11414. if (bcs->mode != L1_MODE_TRANS) {
  11415. - isdnhdlc_out_init(&b_out->hdlc_state, 0, bcs->mode == L1_MODE_HDLC_56K);
  11416. + hdlc_out_init(&b_out->hdlc_state, 0, bcs->mode == L1_MODE_HDLC_56K);
  11417. }
  11418. st5481_usb_pipe_reset(adapter, (bcs->channel+1)*2, NULL, NULL);
  11419. @@ -279,7 +275,7 @@ static int __devinit st5481_setup_b_out(
  11420. usb_b_out_complete, bcs);
  11421. }
  11422. -static void st5481_release_b_out(struct st5481_bcs *bcs)
  11423. +static void __devexit st5481_release_b_out(struct st5481_bcs *bcs)
  11424. {
  11425. struct st5481_b_out *b_out = &bcs->b_out;
  11426. @@ -320,7 +316,7 @@ int __devinit st5481_setup_b(struct st54
  11427. /*
  11428. * Release buffers and URBs for the B channels
  11429. */
  11430. -void st5481_release_b(struct st5481_bcs *bcs)
  11431. +void __devexit st5481_release_b(struct st5481_bcs *bcs)
  11432. {
  11433. DBG(4,"");
  11434. Index: linux-2.4.35.4/drivers/isdn/hisax/st5481_d.c
  11435. ===================================================================
  11436. --- linux-2.4.35.4.orig/drivers/isdn/hisax/st5481_d.c
  11437. +++ linux-2.4.35.4/drivers/isdn/hisax/st5481_d.c
  11438. @@ -162,8 +162,8 @@ static struct FsmNode L1FnList[] __initd
  11439. {ST_L1_F8, EV_TIMER3, l1_timer3},
  11440. {ST_L1_F8, EV_IND_DP, l1_go_f3},
  11441. {ST_L1_F8, EV_IND_AP, l1_go_f6},
  11442. - {ST_L1_F8, EV_IND_AI8, l1_go_f7},
  11443. - {ST_L1_F8, EV_IND_AI10, l1_go_f7},
  11444. + {ST_L1_F8, EV_IND_AI8, l1_go_f8},
  11445. + {ST_L1_F8, EV_IND_AI10, l1_go_f8},
  11446. {ST_L1_F8, EV_IND_RSY, l1_ignore},
  11447. };
  11448. @@ -297,7 +297,7 @@ static void usb_d_out(struct st5481_adap
  11449. unsigned int num_packets, packet_offset;
  11450. int len, buf_size, bytes_sent;
  11451. struct sk_buff *skb;
  11452. - struct iso_packet_descriptor *desc;
  11453. + iso_packet_descriptor_t *desc;
  11454. if (d_out->fsm.state != ST_DOUT_NORMAL)
  11455. return;
  11456. @@ -313,15 +313,15 @@ static void usb_d_out(struct st5481_adap
  11457. buf_size = NUM_ISO_PACKETS_D * SIZE_ISO_PACKETS_D_OUT;
  11458. if (skb) {
  11459. - len = isdnhdlc_encode(&d_out->hdlc_state,
  11460. - skb->data, skb->len, &bytes_sent,
  11461. - urb->transfer_buffer, buf_size);
  11462. + len = hdlc_encode(&d_out->hdlc_state,
  11463. + skb->data, skb->len, &bytes_sent,
  11464. + urb->transfer_buffer, buf_size);
  11465. skb_pull(skb,bytes_sent);
  11466. } else {
  11467. // Send flags or idle
  11468. - len = isdnhdlc_encode(&d_out->hdlc_state,
  11469. - NULL, 0, &bytes_sent,
  11470. - urb->transfer_buffer, buf_size);
  11471. + len = hdlc_encode(&d_out->hdlc_state,
  11472. + NULL, 0, &bytes_sent,
  11473. + urb->transfer_buffer, buf_size);
  11474. }
  11475. if (len < buf_size) {
  11476. @@ -413,7 +413,7 @@ static void dout_start_xmit(struct FsmIn
  11477. DBG(2,"len=%d",skb->len);
  11478. - isdnhdlc_out_init(&d_out->hdlc_state, 1, 0);
  11479. + hdlc_out_init(&d_out->hdlc_state, 1, 0);
  11480. if (test_and_set_bit(buf_nr, &d_out->busy)) {
  11481. WARN("ep %d urb %d busy %#lx", EP_D_OUT, buf_nr, d_out->busy);
  11482. @@ -422,9 +422,9 @@ static void dout_start_xmit(struct FsmIn
  11483. urb = d_out->urb[buf_nr];
  11484. DBG_SKB(0x10, skb);
  11485. - len = isdnhdlc_encode(&d_out->hdlc_state,
  11486. - skb->data, skb->len, &bytes_sent,
  11487. - urb->transfer_buffer, 16);
  11488. + len = hdlc_encode(&d_out->hdlc_state,
  11489. + skb->data, skb->len, &bytes_sent,
  11490. + urb->transfer_buffer, 16);
  11491. skb_pull(skb, bytes_sent);
  11492. if(len < 16)
  11493. @@ -673,7 +673,7 @@ static int __devinit st5481_setup_d_out(
  11494. usb_d_out_complete, adapter);
  11495. }
  11496. -static void st5481_release_d_out(struct st5481_adapter *adapter)
  11497. +static void __devexit st5481_release_d_out(struct st5481_adapter *adapter)
  11498. {
  11499. struct st5481_d_out *d_out = &adapter->d_out;
  11500. @@ -723,7 +723,7 @@ int __devinit st5481_setup_d(struct st54
  11501. return retval;
  11502. }
  11503. -void st5481_release_d(struct st5481_adapter *adapter)
  11504. +void __devexit st5481_release_d(struct st5481_adapter *adapter)
  11505. {
  11506. DBG(2,"");
  11507. Index: linux-2.4.35.4/drivers/isdn/hisax/st5481_init.c
  11508. ===================================================================
  11509. --- linux-2.4.35.4.orig/drivers/isdn/hisax/st5481_init.c
  11510. +++ linux-2.4.35.4/drivers/isdn/hisax/st5481_init.c
  11511. @@ -14,6 +14,7 @@
  11512. * TODO:
  11513. *
  11514. * b layer1 delay?
  11515. + * hdlc as module
  11516. * hotplug / unregister issues
  11517. * mod_inc/dec_use_count
  11518. * unify parts of d/b channel usb handling
  11519. @@ -177,7 +178,7 @@ MODULE_DEVICE_TABLE (usb, st5481_ids);
  11520. static struct usb_driver st5481_usb_driver = {
  11521. name: "st5481_usb",
  11522. probe: probe_st5481,
  11523. - disconnect: __devexit_p(disconnect_st5481),
  11524. + disconnect: disconnect_st5481,
  11525. id_table: st5481_ids,
  11526. };
  11527. Index: linux-2.4.35.4/drivers/isdn/hisax/st5481_usb.c
  11528. ===================================================================
  11529. --- linux-2.4.35.4.orig/drivers/isdn/hisax/st5481_usb.c
  11530. +++ linux-2.4.35.4/drivers/isdn/hisax/st5481_usb.c
  11531. @@ -41,9 +41,9 @@ static void usb_next_ctrl_msg(struct urb
  11532. (unsigned char *)&ctrl->msg_fifo.data[r_index];
  11533. DBG(1,"request=0x%02x,value=0x%04x,index=%x",
  11534. - ((struct ctrl_msg *)urb->setup_packet)->dr.bRequest,
  11535. - ((struct ctrl_msg *)urb->setup_packet)->dr.wValue,
  11536. - ((struct ctrl_msg *)urb->setup_packet)->dr.wIndex);
  11537. + ((struct ctrl_msg *)urb->setup_packet)->dr.request,
  11538. + ((struct ctrl_msg *)urb->setup_packet)->dr.value,
  11539. + ((struct ctrl_msg *)urb->setup_packet)->dr.index);
  11540. // Prepare the URB
  11541. urb->dev = adapter->usb_dev;
  11542. @@ -69,11 +69,11 @@ void usb_ctrl_msg(struct st5481_adapter
  11543. }
  11544. ctrl_msg = &ctrl->msg_fifo.data[w_index];
  11545. - ctrl_msg->dr.bRequestType = requesttype;
  11546. - ctrl_msg->dr.bRequest = request;
  11547. - ctrl_msg->dr.wValue = cpu_to_le16p(&value);
  11548. - ctrl_msg->dr.wIndex = cpu_to_le16p(&index);
  11549. - ctrl_msg->dr.wLength = 0;
  11550. + ctrl_msg->dr.requesttype = requesttype;
  11551. + ctrl_msg->dr.request = request;
  11552. + ctrl_msg->dr.value = cpu_to_le16p(&value);
  11553. + ctrl_msg->dr.index = cpu_to_le16p(&index);
  11554. + ctrl_msg->dr.length = 0;
  11555. ctrl_msg->complete = complete;
  11556. ctrl_msg->context = context;
  11557. @@ -140,17 +140,17 @@ static void usb_ctrl_complete(struct urb
  11558. ctrl_msg = (struct ctrl_msg *)urb->setup_packet;
  11559. - if (ctrl_msg->dr.bRequest == USB_REQ_CLEAR_FEATURE) {
  11560. + if (ctrl_msg->dr.request == USB_REQ_CLEAR_FEATURE) {
  11561. /* Special case handling for pipe reset */
  11562. - le16_to_cpus(&ctrl_msg->dr.wIndex);
  11563. + le16_to_cpus(&ctrl_msg->dr.index);
  11564. usb_endpoint_running(adapter->usb_dev,
  11565. - ctrl_msg->dr.wIndex & ~USB_DIR_IN,
  11566. - (ctrl_msg->dr.wIndex & USB_DIR_IN) == 0);
  11567. + ctrl_msg->dr.index & ~USB_DIR_IN,
  11568. + (ctrl_msg->dr.index & USB_DIR_IN) == 0);
  11569. /* toggle is reset on clear */
  11570. usb_settoggle(adapter->usb_dev,
  11571. - ctrl_msg->dr.wIndex & ~USB_DIR_IN,
  11572. - (ctrl_msg->dr.wIndex & USB_DIR_IN) == 0,
  11573. + ctrl_msg->dr.index & ~USB_DIR_IN,
  11574. + (ctrl_msg->dr.index & USB_DIR_IN) == 0,
  11575. 0);
  11576. @@ -235,7 +235,7 @@ int __devinit st5481_setup_usb(struct st
  11577. struct usb_interface_descriptor *altsetting;
  11578. struct usb_endpoint_descriptor *endpoint;
  11579. int status;
  11580. - struct urb *urb;
  11581. + urb_t *urb;
  11582. u_char *buf;
  11583. DBG(1,"");
  11584. @@ -307,7 +307,7 @@ int __devinit st5481_setup_usb(struct st
  11585. * Release buffers and URBs for the interrupt and control
  11586. * endpoint.
  11587. */
  11588. -void st5481_release_usb(struct st5481_adapter *adapter)
  11589. +void __devexit st5481_release_usb(struct st5481_adapter *adapter)
  11590. {
  11591. struct st5481_intr *intr = &adapter->intr;
  11592. struct st5481_ctrl *ctrl = &adapter->ctrl;
  11593. @@ -443,7 +443,7 @@ st5481_setup_isocpipes(struct urb* urb[2
  11594. return retval;
  11595. }
  11596. -void st5481_release_isocpipes(struct urb* urb[2])
  11597. +void __devexit st5481_release_isocpipes(struct urb* urb[2])
  11598. {
  11599. int j;
  11600. @@ -484,18 +484,16 @@ static void usb_in_complete(struct urb *
  11601. ptr = urb->transfer_buffer;
  11602. while (len > 0) {
  11603. if (in->mode == L1_MODE_TRANS) {
  11604. - /* swap rx bytes to get hearable audio */
  11605. - register unsigned char *dest = in->rcvbuf;
  11606. + memcpy(in->rcvbuf, ptr, len);
  11607. status = len;
  11608. - for (; len; len--)
  11609. - *dest++ = isdnhdlc_bit_rev_tab[*ptr++];
  11610. + len = 0;
  11611. } else {
  11612. - status = isdnhdlc_decode(&in->hdlc_state, ptr, len, &count,
  11613. - in->rcvbuf, in->bufsize);
  11614. + status = hdlc_decode(&in->hdlc_state, ptr, len, &count,
  11615. + in->rcvbuf, in->bufsize);
  11616. ptr += count;
  11617. len -= count;
  11618. }
  11619. -
  11620. +
  11621. if (status > 0) {
  11622. // Good frame received
  11623. DBG(4,"count=%d",status);
  11624. @@ -549,7 +547,7 @@ int __devinit st5481_setup_in(struct st5
  11625. return retval;
  11626. }
  11627. -void st5481_release_in(struct st5481_in *in)
  11628. +void __devexit st5481_release_in(struct st5481_in *in)
  11629. {
  11630. DBG(2,"");
  11631. @@ -562,8 +560,7 @@ void st5481_release_in(struct st5481_in
  11632. */
  11633. int st5481_isoc_flatten(struct urb *urb)
  11634. {
  11635. - struct iso_packet_descriptor *pipd;
  11636. - struct iso_packet_descriptor *pend;
  11637. + piso_packet_descriptor_t pipd,pend;
  11638. unsigned char *src,*dst;
  11639. unsigned int len;
  11640. @@ -624,10 +621,15 @@ void st5481_in_mode(struct st5481_in *in
  11641. if (in->mode != L1_MODE_NULL) {
  11642. if (in->mode != L1_MODE_TRANS)
  11643. - isdnhdlc_rcv_init(&in->hdlc_state,
  11644. - in->mode == L1_MODE_HDLC_56K);
  11645. + hdlc_rcv_init(&in->hdlc_state,
  11646. + in->mode == L1_MODE_HDLC_56K);
  11647. st5481_usb_pipe_reset(in->adapter, in->ep, NULL, NULL);
  11648. +#if 0
  11649. + st5481_usb_device_ctrl_msg(in->adapter, in->counter,
  11650. + in->packet_size,
  11651. + st5481_start_rcv, in);
  11652. +#endif
  11653. st5481_usb_device_ctrl_msg(in->adapter, in->counter,
  11654. in->packet_size,
  11655. NULL, NULL);
  11656. Index: linux-2.4.35.4/drivers/isdn/hisax/tei.c
  11657. ===================================================================
  11658. --- linux-2.4.35.4.orig/drivers/isdn/hisax/tei.c
  11659. +++ linux-2.4.35.4/drivers/isdn/hisax/tei.c
  11660. @@ -1,4 +1,4 @@
  11661. -/* $Id: tei.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  11662. +/* $Id: tei.c,v 2.20 2001/09/24 13:22:57 kai Exp $
  11663. *
  11664. * Author Karsten Keil
  11665. * based on the teles driver from Jan den Ouden
  11666. @@ -21,7 +21,7 @@
  11667. #include <linux/init.h>
  11668. #include <linux/random.h>
  11669. -const char *tei_revision = "$Revision: 1.1.4.1 $";
  11670. +const char *tei_revision = "$Revision: 2.20 $";
  11671. #define ID_REQUEST 1
  11672. #define ID_ASSIGNED 2
  11673. Index: linux-2.4.35.4/drivers/isdn/hisax/teleint.c
  11674. ===================================================================
  11675. --- linux-2.4.35.4.orig/drivers/isdn/hisax/teleint.c
  11676. +++ linux-2.4.35.4/drivers/isdn/hisax/teleint.c
  11677. @@ -1,4 +1,4 @@
  11678. -/* $Id: teleint.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  11679. +/* $Id: teleint.c,v 1.16 2001/09/24 13:22:57 kai Exp $
  11680. *
  11681. * low level stuff for TeleInt isdn cards
  11682. *
  11683. @@ -19,7 +19,7 @@
  11684. extern const char *CardType[];
  11685. -const char *TeleInt_revision = "$Revision: 1.1.4.1 $";
  11686. +const char *TeleInt_revision = "$Revision: 1.16 $";
  11687. #define byteout(addr,val) outb(val,addr)
  11688. #define bytein(addr) inb(addr)
  11689. Index: linux-2.4.35.4/drivers/isdn/hisax/teles0.c
  11690. ===================================================================
  11691. --- linux-2.4.35.4.orig/drivers/isdn/hisax/teles0.c
  11692. +++ linux-2.4.35.4/drivers/isdn/hisax/teles0.c
  11693. @@ -1,4 +1,4 @@
  11694. -/* $Id: teles0.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  11695. +/* $Id: teles0.c,v 2.15 2001/09/24 13:22:57 kai Exp $
  11696. *
  11697. * low level stuff for Teles Memory IO isdn cards
  11698. *
  11699. @@ -24,7 +24,7 @@
  11700. extern const char *CardType[];
  11701. -const char *teles0_revision = "$Revision: 1.1.4.1 $";
  11702. +const char *teles0_revision = "$Revision: 2.15 $";
  11703. #define TELES_IOMEM_SIZE 0x400
  11704. #define byteout(addr,val) outb(val,addr)
  11705. @@ -189,8 +189,10 @@ release_io_teles0(struct IsdnCardState *
  11706. {
  11707. if (cs->hw.teles0.cfg_reg)
  11708. release_region(cs->hw.teles0.cfg_reg, 8);
  11709. +#ifdef COMPAT_HAS_ISA_IOREMAP
  11710. iounmap((unsigned char *)cs->hw.teles0.membase);
  11711. release_mem_region(cs->hw.teles0.phymem, TELES_IOMEM_SIZE);
  11712. +#endif
  11713. }
  11714. static int
  11715. @@ -327,6 +329,7 @@ setup_teles0(struct IsdnCard *card)
  11716. /* 16.0 and 8.0 designed for IOM1 */
  11717. test_and_set_bit(HW_IOM1, &cs->HW_Flags);
  11718. cs->hw.teles0.phymem = card->para[1];
  11719. +#ifdef COMPAT_HAS_ISA_IOREMAP
  11720. if (check_mem_region(cs->hw.teles0.phymem, TELES_IOMEM_SIZE)) {
  11721. printk(KERN_WARNING
  11722. "HiSax: %s memory region %lx-%lx already in use\n",
  11723. @@ -342,6 +345,9 @@ setup_teles0(struct IsdnCard *card)
  11724. }
  11725. cs->hw.teles0.membase =
  11726. (unsigned long) ioremap(cs->hw.teles0.phymem, TELES_IOMEM_SIZE);
  11727. +#else
  11728. + cs->hw.teles0.membase = cs->hw.teles0.phymem;
  11729. +#endif
  11730. printk(KERN_INFO
  11731. "HiSax: %s config irq:%d mem:0x%lX cfg:0x%X\n",
  11732. CardType[cs->typ], cs->irq,
  11733. Index: linux-2.4.35.4/drivers/isdn/hisax/teles3.c
  11734. ===================================================================
  11735. --- linux-2.4.35.4.orig/drivers/isdn/hisax/teles3.c
  11736. +++ linux-2.4.35.4/drivers/isdn/hisax/teles3.c
  11737. @@ -1,4 +1,4 @@
  11738. -/* $Id: teles3.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  11739. +/* $Id: teles3.c,v 2.19 2001/09/24 13:22:57 kai Exp $
  11740. *
  11741. * low level stuff for Teles 16.3 & PNP isdn cards
  11742. *
  11743. @@ -15,14 +15,13 @@
  11744. */
  11745. #define __NO_VERSION__
  11746. #include <linux/init.h>
  11747. -#include <linux/isapnp.h>
  11748. #include "hisax.h"
  11749. #include "isac.h"
  11750. #include "hscx.h"
  11751. #include "isdnl1.h"
  11752. extern const char *CardType[];
  11753. -const char *teles3_revision = "$Revision: 1.1.4.1 $";
  11754. +const char *teles3_revision = "$Revision: 2.19 $";
  11755. #define byteout(addr,val) outb(val,addr)
  11756. #define bytein(addr) inb(addr)
  11757. @@ -255,24 +254,6 @@ Teles_card_msg(struct IsdnCardState *cs,
  11758. return(0);
  11759. }
  11760. -#ifdef __ISAPNP__
  11761. -static struct isapnp_device_id teles_ids[] __initdata = {
  11762. - { ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110),
  11763. - ISAPNP_VENDOR('T', 'A', 'G'), ISAPNP_FUNCTION(0x2110),
  11764. - (unsigned long) "Teles 16.3 PnP" },
  11765. - { ISAPNP_VENDOR('C', 'T', 'X'), ISAPNP_FUNCTION(0x0),
  11766. - ISAPNP_VENDOR('C', 'T', 'X'), ISAPNP_FUNCTION(0x0),
  11767. - (unsigned long) "Creatix 16.3 PnP" },
  11768. - { ISAPNP_VENDOR('C', 'P', 'Q'), ISAPNP_FUNCTION(0x1002),
  11769. - ISAPNP_VENDOR('C', 'P', 'Q'), ISAPNP_FUNCTION(0x1002),
  11770. - (unsigned long) "Compaq ISDN S0" },
  11771. - { 0, }
  11772. -};
  11773. -
  11774. -static struct isapnp_device_id *tdev = &teles_ids[0];
  11775. -static struct pci_bus *pnp_c __devinitdata = NULL;
  11776. -#endif
  11777. -
  11778. int __devinit
  11779. setup_teles3(struct IsdnCard *card)
  11780. {
  11781. @@ -286,47 +267,6 @@ setup_teles3(struct IsdnCard *card)
  11782. && (cs->typ != ISDN_CTYPE_TELESPCMCIA) && (cs->typ != ISDN_CTYPE_COMPAQ_ISA))
  11783. return (0);
  11784. -#ifdef __ISAPNP__
  11785. - if (!card->para[1] && isapnp_present()) {
  11786. - struct pci_bus *pb;
  11787. - struct pci_dev *pd;
  11788. -
  11789. - while(tdev->card_vendor) {
  11790. - if ((pb = isapnp_find_card(tdev->card_vendor,
  11791. - tdev->card_device, pnp_c))) {
  11792. - pnp_c = pb;
  11793. - pd = NULL;
  11794. - if ((pd = isapnp_find_dev(pnp_c,
  11795. - tdev->vendor, tdev->function, pd))) {
  11796. - printk(KERN_INFO "HiSax: %s detected\n",
  11797. - (char *)tdev->driver_data);
  11798. - pd->prepare(pd);
  11799. - pd->deactivate(pd);
  11800. - pd->activate(pd);
  11801. - card->para[3] = pd->resource[2].start;
  11802. - card->para[2] = pd->resource[1].start;
  11803. - card->para[1] = pd->resource[0].start;
  11804. - card->para[0] = pd->irq_resource[0].start;
  11805. - if (!card->para[0] || !card->para[1] || !card->para[2]) {
  11806. - printk(KERN_ERR "Teles PnP:some resources are missing %ld/%lx/%lx\n",
  11807. - card->para[0], card->para[1], card->para[2]);
  11808. - pd->deactivate(pd);
  11809. - return(0);
  11810. - }
  11811. - break;
  11812. - } else {
  11813. - printk(KERN_ERR "Teles PnP: PnP error card found, no device\n");
  11814. - }
  11815. - }
  11816. - tdev++;
  11817. - pnp_c=NULL;
  11818. - }
  11819. - if (!tdev->card_vendor) {
  11820. - printk(KERN_INFO "Teles PnP: no ISAPnP card found\n");
  11821. - return(0);
  11822. - }
  11823. - }
  11824. -#endif
  11825. if (cs->typ == ISDN_CTYPE_16_3) {
  11826. cs->hw.teles3.cfg_reg = card->para[1];
  11827. switch (cs->hw.teles3.cfg_reg) {
  11828. Index: linux-2.4.35.4/drivers/isdn/hisax/telespci.c
  11829. ===================================================================
  11830. --- linux-2.4.35.4.orig/drivers/isdn/hisax/telespci.c
  11831. +++ linux-2.4.35.4/drivers/isdn/hisax/telespci.c
  11832. @@ -1,4 +1,4 @@
  11833. -/* $Id: telespci.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  11834. +/* $Id: telespci.c,v 2.23 2001/09/24 13:22:57 kai Exp $
  11835. *
  11836. * low level stuff for Teles PCI isdn cards
  11837. *
  11838. @@ -20,9 +20,10 @@
  11839. #include "hscx.h"
  11840. #include "isdnl1.h"
  11841. #include <linux/pci.h>
  11842. +#include <linux/isdn_compat.h>
  11843. extern const char *CardType[];
  11844. -const char *telespci_revision = "$Revision: 1.1.4.1 $";
  11845. +const char *telespci_revision = "$Revision: 2.23 $";
  11846. #define ZORAN_PO_RQ_PEN 0x02000000
  11847. #define ZORAN_PO_WR 0x00800000
  11848. @@ -307,10 +308,10 @@ setup_telespci(struct IsdnCard *card)
  11849. printk(KERN_WARNING "Teles: No IRQ for PCI card found\n");
  11850. return(0);
  11851. }
  11852. - cs->hw.teles0.membase = (u_long) ioremap(pci_resource_start(dev_tel, 0),
  11853. + cs->hw.teles0.membase = (u_long) ioremap(pci_resource_start_mem(dev_tel, 0),
  11854. PAGE_SIZE);
  11855. printk(KERN_INFO "Found: Zoran, base-address: 0x%lx, irq: 0x%x\n",
  11856. - pci_resource_start(dev_tel, 0), dev_tel->irq);
  11857. + pci_resource_start_mem(dev_tel, 0), dev_tel->irq);
  11858. } else {
  11859. printk(KERN_WARNING "TelesPCI: No PCI card found\n");
  11860. return(0);
  11861. Index: linux-2.4.35.4/drivers/isdn/hisax/w6692.c
  11862. ===================================================================
  11863. --- linux-2.4.35.4.orig/drivers/isdn/hisax/w6692.c
  11864. +++ linux-2.4.35.4/drivers/isdn/hisax/w6692.c
  11865. @@ -1,4 +1,4 @@
  11866. -/* $Id: w6692.c,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  11867. +/* $Id: w6692.c,v 1.18 2001/09/24 13:22:57 kai Exp $
  11868. *
  11869. * Winbond W6692 specific routines
  11870. *
  11871. @@ -18,6 +18,7 @@
  11872. #include "isdnl1.h"
  11873. #include <linux/interrupt.h>
  11874. #include <linux/pci.h>
  11875. +#include <linux/isdn_compat.h>
  11876. /* table entry in the PCI devices list */
  11877. typedef struct {
  11878. @@ -29,20 +30,14 @@ typedef struct {
  11879. static const PCI_ENTRY id_list[] =
  11880. {
  11881. - {PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_6692, "Winbond", "W6692"},
  11882. {PCI_VENDOR_ID_DYNALINK, PCI_DEVICE_ID_DYNALINK_IS64PH, "Dynalink/AsusCom", "IS64PH"},
  11883. - {0, 0, "U.S.Robotics", "ISDN PCI Card TA"}
  11884. + {PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_6692, "Winbond", "W6692"},
  11885. + {0, 0, NULL, NULL}
  11886. };
  11887. -#define W6692_SV_USR 0x16ec
  11888. -#define W6692_SD_USR 0x3409
  11889. -#define W6692_WINBOND 0
  11890. -#define W6692_DYNALINK 1
  11891. -#define W6692_USR 2
  11892. -
  11893. extern const char *CardType[];
  11894. -const char *w6692_revision = "$Revision: 1.1.4.1 $";
  11895. +const char *w6692_revision = "$Revision: 1.18 $";
  11896. #define DBUSY_TIMER_VALUE 80
  11897. @@ -675,6 +670,16 @@ setstack_W6692(struct PStack *st, struct
  11898. static void
  11899. DC_Close_W6692(struct IsdnCardState *cs)
  11900. {
  11901. +#if 0
  11902. + if (cs->dc.w6692.mon_rx) {
  11903. + kfree(cs->dc.w6692.mon_rx);
  11904. + cs->dc.w6692.mon_rx = NULL;
  11905. + }
  11906. + if (cs->dc.w6692.mon_tx) {
  11907. + kfree(cs->dc.w6692.mon_tx);
  11908. + cs->dc.w6692.mon_tx = NULL;
  11909. + }
  11910. +#endif
  11911. }
  11912. static void
  11913. @@ -865,38 +870,31 @@ setstack_w6692(struct PStack *st, struct
  11914. return (0);
  11915. }
  11916. -void resetW6692(struct IsdnCardState *cs)
  11917. -{
  11918. - cs->writeW6692(cs, W_D_CTL, W_D_CTL_SRST);
  11919. - schedule_timeout((10*HZ)/1000);
  11920. - cs->writeW6692(cs, W_D_CTL, 0x00);
  11921. - schedule_timeout((10*HZ)/1000);
  11922. - cs->writeW6692(cs, W_IMASK, 0xff);
  11923. - cs->writeW6692(cs, W_D_SAM, 0xff);
  11924. - cs->writeW6692(cs, W_D_TAM, 0xff);
  11925. - cs->writeW6692(cs, W_D_EXIM, 0x00);
  11926. - cs->writeW6692(cs, W_D_MODE, W_D_MODE_RACT);
  11927. - cs->writeW6692(cs, W_IMASK, 0x18);
  11928. - if (cs->subtyp == W6692_USR) {
  11929. - /* seems that USR implemented some power control features
  11930. - * Pin 79 is connected to the oscilator circuit so we
  11931. - * have to handle it here
  11932. - */
  11933. - cs->writeW6692(cs, W_PCTL, 0x80);
  11934. - cs->writeW6692(cs, W_XDATA, 0x00);
  11935. - }
  11936. -}
  11937. -
  11938. void __init initW6692(struct IsdnCardState *cs, int part)
  11939. {
  11940. if (part & 1) {
  11941. cs->tqueue.routine = (void *) (void *) W6692_bh;
  11942. cs->setstack_d = setstack_W6692;
  11943. cs->DC_Close = DC_Close_W6692;
  11944. +#if 0
  11945. + cs->dc.w6692.mon_tx = NULL;
  11946. + cs->dc.w6692.mon_rx = NULL;
  11947. +#endif
  11948. cs->dbusytimer.function = (void *) dbusy_timer_handler;
  11949. cs->dbusytimer.data = (long) cs;
  11950. init_timer(&cs->dbusytimer);
  11951. - resetW6692(cs);
  11952. +
  11953. + cs->writeW6692(cs, W_D_CTL, W_D_CTL_SRST);
  11954. + cs->writeW6692(cs, W_D_CTL, 0x00);
  11955. + cs->writeW6692(cs, W_IMASK, 0xff);
  11956. +#if 0
  11957. + cs->dc.w6692.mocr = 0xaa;
  11958. +#endif
  11959. + cs->writeW6692(cs, W_D_SAM, 0xff);
  11960. + cs->writeW6692(cs, W_D_TAM, 0xff);
  11961. + cs->writeW6692(cs, W_D_EXIM, 0x00);
  11962. + cs->writeW6692(cs, W_D_MODE, W_D_MODE_RACT);
  11963. + cs->writeW6692(cs, W_IMASK, 0x18);
  11964. ph_command(cs, W_L1CMD_RST);
  11965. cs->dc.w6692.ph_state = W_L1CMD_RST;
  11966. W6692_new_ph(cs);
  11967. @@ -963,14 +961,9 @@ w6692_card_msg(struct IsdnCardState *cs,
  11968. {
  11969. switch (mt) {
  11970. case CARD_RESET:
  11971. - resetW6692(cs);
  11972. return (0);
  11973. case CARD_RELEASE:
  11974. - cs->writeW6692(cs, W_IMASK, 0xff);
  11975. release_region(cs->hw.w6692.iobase, 256);
  11976. - if (cs->subtyp == W6692_USR) {
  11977. - cs->writeW6692(cs, W_XDATA, 0x04);
  11978. - }
  11979. return (0);
  11980. case CARD_INIT:
  11981. initW6692(cs, 3);
  11982. @@ -1013,7 +1006,6 @@ setup_w6692(struct IsdnCard *card)
  11983. if (dev_w6692) {
  11984. if (pci_enable_device(dev_w6692))
  11985. continue;
  11986. - cs->subtyp = id_idx;
  11987. break;
  11988. }
  11989. id_idx++;
  11990. @@ -1023,14 +1015,7 @@ setup_w6692(struct IsdnCard *card)
  11991. pci_irq = dev_w6692->irq;
  11992. /* I think address 0 is allways the configuration area */
  11993. /* and address 1 is the real IO space KKe 03.09.99 */
  11994. - pci_ioaddr = pci_resource_start(dev_w6692, 1);
  11995. - /* USR ISDN PCI card TA need some special handling */
  11996. - if (cs->subtyp == W6692_WINBOND) {
  11997. - if ((W6692_SV_USR == dev_w6692->subsystem_vendor) &&
  11998. - (W6692_SD_USR == dev_w6692->subsystem_device)) {
  11999. - cs->subtyp = W6692_USR;
  12000. - }
  12001. - }
  12002. + pci_ioaddr = pci_resource_start_io(dev_w6692, 1);
  12003. }
  12004. if (!found) {
  12005. printk(KERN_WARNING "W6692: No PCI card found\n");
  12006. @@ -1047,18 +1032,18 @@ setup_w6692(struct IsdnCard *card)
  12007. }
  12008. cs->hw.w6692.iobase = pci_ioaddr;
  12009. printk(KERN_INFO "Found: %s %s, I/O base: 0x%x, irq: %d\n",
  12010. - id_list[cs->subtyp].vendor_name, id_list[cs->subtyp].card_name,
  12011. - pci_ioaddr, pci_irq);
  12012. + id_list[id_idx].vendor_name, id_list[id_idx].card_name,
  12013. + pci_ioaddr, dev_w6692->irq);
  12014. if (check_region((cs->hw.w6692.iobase), 256)) {
  12015. printk(KERN_WARNING
  12016. "HiSax: %s I/O ports %x-%x already in use\n",
  12017. - id_list[cs->subtyp].card_name,
  12018. + id_list[id_idx].card_name,
  12019. cs->hw.w6692.iobase,
  12020. cs->hw.w6692.iobase + 255);
  12021. return (0);
  12022. } else {
  12023. request_region(cs->hw.w6692.iobase, 256,
  12024. - id_list[cs->subtyp].card_name);
  12025. + id_list[id_idx].card_name);
  12026. }
  12027. #else
  12028. printk(KERN_WARNING "HiSax: W6692 and NO_PCI_BIOS\n");
  12029. @@ -1068,7 +1053,7 @@ setup_w6692(struct IsdnCard *card)
  12030. printk(KERN_INFO
  12031. "HiSax: %s config irq:%d I/O:%x\n",
  12032. - id_list[cs->subtyp].card_name, cs->irq,
  12033. + id_list[id_idx].card_name, cs->irq,
  12034. cs->hw.w6692.iobase);
  12035. cs->readW6692 = &ReadW6692;
  12036. Index: linux-2.4.35.4/drivers/isdn/hisax/w6692.h
  12037. ===================================================================
  12038. --- linux-2.4.35.4.orig/drivers/isdn/hisax/w6692.h
  12039. +++ linux-2.4.35.4/drivers/isdn/hisax/w6692.h
  12040. @@ -1,4 +1,4 @@
  12041. -/* $Id: w6692.h,v 1.1.4.1 2001/11/20 14:19:36 kai Exp $
  12042. +/* $Id: w6692.h,v 1.4 2001/09/24 13:22:57 kai Exp $
  12043. *
  12044. * Winbond W6692 specific defines
  12045. *
  12046. Index: linux-2.4.35.4/drivers/isdn/hysdn/boardergo.c
  12047. ===================================================================
  12048. --- linux-2.4.35.4.orig/drivers/isdn/hysdn/boardergo.c
  12049. +++ linux-2.4.35.4/drivers/isdn/hysdn/boardergo.c
  12050. @@ -1,27 +1,41 @@
  12051. -/* $Id: boardergo.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  12052. - *
  12053. +/* $Id: boardergo.c,v 1.9 2001/07/19 20:39:51 kai Exp $
  12054. +
  12055. * Linux driver for HYSDN cards, specific routines for ergo type boards.
  12056. *
  12057. - * Author Werner Cornelius ([email protected]) for Hypercope GmbH
  12058. - * Copyright 1999 by Werner Cornelius ([email protected])
  12059. - *
  12060. - * This software may be used and distributed according to the terms
  12061. - * of the GNU General Public License, incorporated herein by reference.
  12062. - *
  12063. * As all Linux supported cards Champ2, Ergo and Metro2/4 use the same
  12064. * DPRAM interface and layout with only minor differences all related
  12065. * stuff is done here, not in separate modules.
  12066. *
  12067. + * written by Werner Cornelius ([email protected]) for Hypercope GmbH
  12068. + *
  12069. + * Copyright 1999 by Werner Cornelius ([email protected])
  12070. + *
  12071. + * This program is free software; you can redistribute it and/or modify
  12072. + * it under the terms of the GNU General Public License as published by
  12073. + * the Free Software Foundation; either version 2, or (at your option)
  12074. + * any later version.
  12075. + *
  12076. + * This program is distributed in the hope that it will be useful,
  12077. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12078. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12079. + * GNU General Public License for more details.
  12080. + *
  12081. + * You should have received a copy of the GNU General Public License
  12082. + * along with this program; if not, write to the Free Software
  12083. + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  12084. + *
  12085. */
  12086. +#define __NO_VERSION__
  12087. #include <linux/config.h>
  12088. -#include <linux/sched.h>
  12089. +#include <linux/module.h>
  12090. +#include <linux/version.h>
  12091. +#include <asm/io.h>
  12092. #include <linux/signal.h>
  12093. #include <linux/kernel.h>
  12094. #include <linux/ioport.h>
  12095. #include <linux/interrupt.h>
  12096. #include <linux/vmalloc.h>
  12097. -#include <asm/io.h>
  12098. #include "hysdn_defs.h"
  12099. #include "boardergo.h"
  12100. @@ -45,11 +59,10 @@ ergo_interrupt(int intno, void *dev_id,
  12101. if (!card->irq_enabled)
  12102. return; /* other device interrupting or irq switched off */
  12103. - save_flags(flags);
  12104. - cli(); /* no further irqs allowed */
  12105. + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
  12106. if (!(bytein(card->iobase + PCI9050_INTR_REG) & PCI9050_INTR_REG_STAT1)) {
  12107. - restore_flags(flags); /* restore old state */
  12108. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12109. return; /* no interrupt requested by E1 */
  12110. }
  12111. /* clear any pending ints on the board */
  12112. @@ -63,7 +76,7 @@ ergo_interrupt(int intno, void *dev_id,
  12113. queue_task(&card->irq_queue, &tq_immediate);
  12114. mark_bh(IMMEDIATE_BH);
  12115. }
  12116. - restore_flags(flags);
  12117. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12118. } /* ergo_interrupt */
  12119. /******************************************************************************/
  12120. @@ -83,17 +96,15 @@ ergo_irq_bh(hysdn_card * card)
  12121. return; /* invalid call */
  12122. dpr = card->dpram; /* point to DPRAM */
  12123. + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
  12124. - save_flags(flags);
  12125. - cli();
  12126. if (card->hw_lock) {
  12127. - restore_flags(flags); /* hardware currently unavailable */
  12128. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12129. return;
  12130. }
  12131. card->hw_lock = 1; /* we now lock the hardware */
  12132. do {
  12133. - sti(); /* reenable other ints */
  12134. again = 0; /* assume loop not to be repeated */
  12135. if (!dpr->ToHyFlag) {
  12136. @@ -113,15 +124,13 @@ ergo_irq_bh(hysdn_card * card)
  12137. again = 1; /* restart loop */
  12138. }
  12139. } /* a message has arrived for us */
  12140. - cli(); /* no further ints */
  12141. if (again) {
  12142. dpr->ToHyInt = 1;
  12143. dpr->ToPcInt = 1; /* interrupt to E1 for all cards */
  12144. } else
  12145. card->hw_lock = 0; /* free hardware again */
  12146. } while (again); /* until nothing more to do */
  12147. -
  12148. - restore_flags(flags);
  12149. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12150. } /* ergo_irq_bh */
  12151. @@ -138,8 +147,7 @@ ergo_stopcard(hysdn_card * card)
  12152. #ifdef CONFIG_HYSDN_CAPI
  12153. hycapi_capi_stop(card);
  12154. #endif /* CONFIG_HYSDN_CAPI */
  12155. - save_flags(flags);
  12156. - cli();
  12157. + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
  12158. val = bytein(card->iobase + PCI9050_INTR_REG); /* get actual value */
  12159. val &= ~(PCI9050_INTR_REG_ENPCI | PCI9050_INTR_REG_EN1); /* mask irq */
  12160. byteout(card->iobase + PCI9050_INTR_REG, val);
  12161. @@ -147,8 +155,7 @@ ergo_stopcard(hysdn_card * card)
  12162. byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RESET); /* reset E1 processor */
  12163. card->state = CARD_STATE_UNUSED;
  12164. card->err_log_state = ERRLOG_STATE_OFF; /* currently no log active */
  12165. -
  12166. - restore_flags(flags);
  12167. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12168. } /* ergo_stopcard */
  12169. /**************************************************************************/
  12170. @@ -163,20 +170,17 @@ ergo_set_errlog_state(hysdn_card * card,
  12171. card->err_log_state = ERRLOG_STATE_OFF; /* must be off */
  12172. return;
  12173. }
  12174. - save_flags(flags);
  12175. - cli();
  12176. -
  12177. + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
  12178. if (((card->err_log_state == ERRLOG_STATE_OFF) && !on) ||
  12179. ((card->err_log_state == ERRLOG_STATE_ON) && on)) {
  12180. - restore_flags(flags);
  12181. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12182. return; /* nothing to do */
  12183. }
  12184. if (on)
  12185. card->err_log_state = ERRLOG_STATE_START; /* request start */
  12186. else
  12187. card->err_log_state = ERRLOG_STATE_STOP; /* request stop */
  12188. -
  12189. - restore_flags(flags);
  12190. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12191. queue_task(&card->irq_queue, &tq_immediate);
  12192. mark_bh(IMMEDIATE_BH);
  12193. } /* ergo_set_errlog_state */
  12194. @@ -245,9 +249,6 @@ ergo_writebootimg(struct HYSDN_CARD *car
  12195. while (!dpram->ToHyNoDpramErrLog); /* reread volatile register to flush PCI */
  12196. byteout(card->iobase + PCI9050_USER_IO, PCI9050_E1_RUN); /* start E1 processor */
  12197. - /* the interrupts are still masked */
  12198. -
  12199. - sti();
  12200. set_current_state(TASK_INTERRUPTIBLE);
  12201. schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
  12202. @@ -282,7 +283,6 @@ ergo_writebootseq(struct HYSDN_CARD *car
  12203. dst = sp->Data; /* point to data in spool structure */
  12204. buflen = sp->Len; /* maximum len of spooled data */
  12205. wr_mirror = sp->WrPtr; /* only once read */
  12206. - sti();
  12207. /* try until all bytes written or error */
  12208. i = 0x1000; /* timeout value */
  12209. @@ -358,9 +358,7 @@ ergo_waitpofready(struct HYSDN_CARD *car
  12210. if (card->debug_flags & LOG_POF_RECORD)
  12211. hysdn_addlog(card, "ERGO: pof boot success");
  12212. - save_flags(flags);
  12213. - cli();
  12214. -
  12215. + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
  12216. card->state = CARD_STATE_RUN; /* now card is running */
  12217. /* enable the cards interrupt */
  12218. byteout(card->iobase + PCI9050_INTR_REG,
  12219. @@ -371,8 +369,7 @@ ergo_waitpofready(struct HYSDN_CARD *car
  12220. dpr->ToPcFlag = 0; /* reset data indicator */
  12221. dpr->ToHyInt = 1;
  12222. dpr->ToPcInt = 1; /* interrupt to E1 for all cards */
  12223. -
  12224. - restore_flags(flags);
  12225. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12226. if ((hynet_enable & (1 << card->myid))
  12227. && (i = hysdn_net_create(card)))
  12228. {
  12229. @@ -387,7 +384,6 @@ ergo_waitpofready(struct HYSDN_CARD *car
  12230. #endif /* CONFIG_HYSDN_CAPI */
  12231. return (0); /* success */
  12232. } /* data has arrived */
  12233. - sti();
  12234. set_current_state(TASK_INTERRUPTIBLE);
  12235. schedule_timeout((50 * HZ) / 1000); /* Timeout 50ms */
  12236. } /* wait until timeout */
  12237. Index: linux-2.4.35.4/drivers/isdn/hysdn/boardergo.h
  12238. ===================================================================
  12239. --- linux-2.4.35.4.orig/drivers/isdn/hysdn/boardergo.h
  12240. +++ linux-2.4.35.4/drivers/isdn/hysdn/boardergo.h
  12241. @@ -1,4 +1,4 @@
  12242. -/* $Id: boardergo.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  12243. +/* $Id$
  12244. *
  12245. * Linux driver for HYSDN cards, definitions for ergo type boards (buffers..).
  12246. *
  12247. @@ -10,6 +10,7 @@
  12248. *
  12249. */
  12250. +#include <linux/isdn_compat.h>
  12251. /************************************************/
  12252. /* defines for the dual port memory of the card */
  12253. Index: linux-2.4.35.4/drivers/isdn/hysdn/hycapi.c
  12254. ===================================================================
  12255. --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hycapi.c
  12256. +++ linux-2.4.35.4/drivers/isdn/hysdn/hycapi.c
  12257. @@ -1,4 +1,4 @@
  12258. -/* $Id: hycapi.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  12259. +/* $Id$
  12260. *
  12261. * Linux driver for HYSDN cards, CAPI2.0-Interface.
  12262. *
  12263. @@ -29,7 +29,7 @@
  12264. #include "hysdn_defs.h"
  12265. #include <linux/kernelcapi.h>
  12266. -static char hycapi_revision[]="$Revision: 1.1.4.1 $";
  12267. +static char hycapi_revision[]="$Revision$";
  12268. unsigned int hycapi_enable = 0xffffffff;
  12269. MODULE_PARM(hycapi_enable, "i");
  12270. Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_boot.c
  12271. ===================================================================
  12272. --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_boot.c
  12273. +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_boot.c
  12274. @@ -1,4 +1,4 @@
  12275. -/* $Id: hysdn_boot.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  12276. +/* $Id$
  12277. *
  12278. * Linux driver for HYSDN cards
  12279. * specific routines for booting and pof handling
  12280. @@ -143,7 +143,7 @@ pof_handle_data(hysdn_card * card, int d
  12281. (boot->pof_recid == TAG_CABSDATA) ? "CABSDATA" : "ABSDATA",
  12282. datlen, boot->pof_recoffset);
  12283. - if ((boot->last_error = card->writebootseq(card, boot->buf.BootBuf, datlen)) < 0)
  12284. + if ((boot->last_error = card->writebootseq(card, boot->buf.BootBuf, datlen) < 0))
  12285. return (boot->last_error); /* error writing data */
  12286. if (boot->pof_recoffset + datlen >= boot->pof_reclen)
  12287. Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_defs.h
  12288. ===================================================================
  12289. --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_defs.h
  12290. +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_defs.h
  12291. @@ -1,4 +1,4 @@
  12292. -/* $Id: hysdn_defs.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  12293. +/* $Id: hysdn_defs.h,v 1.10 2001/09/24 13:23:03 kai Exp $
  12294. *
  12295. * Linux driver for HYSDN cards
  12296. * global definitions and exported vars and functions.
  12297. @@ -19,6 +19,11 @@
  12298. #include <linux/interrupt.h>
  12299. #include <linux/tqueue.h>
  12300. #include <linux/skbuff.h>
  12301. +#include <linux/isdn_compat.h>
  12302. +#include <linux/spinlock.h>
  12303. +
  12304. +#define HYSDN_SPIN_LOCK(a,b) spin_lock(a)
  12305. +#define HYSDN_SPIN_UNLOCK(a,b) spin_unlock(a)
  12306. /****************************/
  12307. /* storage type definitions */
  12308. @@ -176,6 +181,7 @@ typedef struct HYSDN_CARD {
  12309. struct tq_struct irq_queue; /* interrupt task queue */
  12310. uchar volatile irq_enabled; /* interrupt enabled if != 0 */
  12311. uchar volatile hw_lock; /* hardware is currently locked -> no access */
  12312. + spinlock_t irq_lock;
  12313. /* boot process */
  12314. void *boot; /* pointer to boot private data */
  12315. Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_init.c
  12316. ===================================================================
  12317. --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_init.c
  12318. +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_init.c
  12319. @@ -1,4 +1,4 @@
  12320. -/* $Id: hysdn_init.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  12321. +/* $Id$
  12322. *
  12323. * Linux driver for HYSDN cards, init functions.
  12324. *
  12325. @@ -21,6 +21,7 @@
  12326. #include "hysdn_defs.h"
  12327. +#ifndef COMPAT_HAS_2_2_PCI
  12328. static struct pci_device_id hysdn_pci_tbl[] __initdata = {
  12329. {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_METRO},
  12330. {PCI_VENDOR_ID_HYPERCOPE, PCI_DEVICE_ID_HYPERCOPE_PLX, PCI_ANY_ID, PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2},
  12331. @@ -29,11 +30,12 @@ static struct pci_device_id hysdn_pci_tb
  12332. { } /* Terminating entry */
  12333. };
  12334. MODULE_DEVICE_TABLE(pci, hysdn_pci_tbl);
  12335. +#endif
  12336. MODULE_DESCRIPTION("ISDN4Linux: Driver for HYSDN cards");
  12337. MODULE_AUTHOR("Werner Cornelius");
  12338. MODULE_LICENSE("GPL");
  12339. -static char *hysdn_init_revision = "$Revision: 1.1.4.1 $";
  12340. +static char *hysdn_init_revision = "$Revision$";
  12341. int cardmax; /* number of found cards */
  12342. hysdn_card *card_root = NULL; /* pointer to first card */
  12343. @@ -91,11 +93,11 @@ search_cards(void)
  12344. card->myid = cardmax; /* set own id */
  12345. card->bus = akt_pcidev->bus->number;
  12346. card->devfn = akt_pcidev->devfn; /* slot + function */
  12347. - card->subsysid = akt_pcidev->subsystem_device;
  12348. + pci_get_sub_system(akt_pcidev,card->subsysid);
  12349. card->irq = akt_pcidev->irq;
  12350. - card->iobase = pci_resource_start(akt_pcidev, PCI_REG_PLX_IO_BASE);
  12351. - card->plxbase = pci_resource_start(akt_pcidev, PCI_REG_PLX_MEM_BASE);
  12352. - card->membase = pci_resource_start(akt_pcidev, PCI_REG_MEMORY_BASE);
  12353. + card->iobase = pci_resource_start_io(akt_pcidev, PCI_REG_PLX_IO_BASE);
  12354. + card->plxbase = pci_resource_start_mem(akt_pcidev, PCI_REG_PLX_MEM_BASE);
  12355. + card->membase = pci_resource_start_mem(akt_pcidev, PCI_REG_MEMORY_BASE);
  12356. card->brdtype = BD_NONE; /* unknown */
  12357. card->debug_flags = DEF_DEB_FLAGS; /* set default debug */
  12358. card->faxchans = 0; /* default no fax channels */
  12359. Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_net.c
  12360. ===================================================================
  12361. --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_net.c
  12362. +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_net.c
  12363. @@ -1,4 +1,4 @@
  12364. -/* $Id: hysdn_net.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  12365. +/* $Id$
  12366. *
  12367. * Linux driver for HYSDN cards, net (ethernet type) handling routines.
  12368. *
  12369. @@ -29,7 +29,7 @@ unsigned int hynet_enable = 0xffffffff;
  12370. MODULE_PARM(hynet_enable, "i");
  12371. /* store the actual version for log reporting */
  12372. -char *hysdn_net_revision = "$Revision: 1.1.4.1 $";
  12373. +char *hysdn_net_revision = "$Revision$";
  12374. #define MAX_SKB_BUFFERS 20 /* number of buffers for keeping TX-data */
  12375. @@ -45,6 +45,10 @@ struct net_local {
  12376. /* additional vars may be added here */
  12377. char dev_name[9]; /* our own device name */
  12378. +#ifdef COMPAT_NO_SOFTNET
  12379. + struct sk_buff *tx_skb; /* buffer for tx operation */
  12380. +
  12381. +#else
  12382. /* Tx control lock. This protects the transmit buffer ring
  12383. * state along with the "tx full" state of the driver. This
  12384. * means all netif_queue flow control actions are protected
  12385. @@ -56,6 +60,7 @@ struct net_local {
  12386. int sk_count; /* number of buffers currently in ring */
  12387. int is_open; /* flag controlling module locking */
  12388. +#endif
  12389. }; /* net_local */
  12390. @@ -83,11 +88,19 @@ net_open(struct net_device *dev)
  12391. hysdn_card *card = dev->priv;
  12392. int i;
  12393. +#ifdef COMPAT_NO_SOFTNET
  12394. + dev->tbusy = 0; /* non busy state */
  12395. + dev->interrupt = 0;
  12396. + if (!dev->start)
  12397. + MOD_INC_USE_COUNT; /* increment only if device is down */
  12398. + dev->start = 1; /* and started */
  12399. +#else
  12400. if (!((struct net_local *) dev)->is_open)
  12401. MOD_INC_USE_COUNT; /* increment only if interface is actually down */
  12402. ((struct net_local *) dev)->is_open = 1; /* device actually open */
  12403. netif_start_queue(dev); /* start tx-queueing */
  12404. +#endif
  12405. /* Fill in the MAC-level header (if not already set) */
  12406. if (!card->mac_addr[0]) {
  12407. @@ -104,6 +117,7 @@ net_open(struct net_device *dev)
  12408. return (0);
  12409. } /* net_open */
  12410. +#ifndef COMPAT_NO_SOFTNET
  12411. /*******************************************/
  12412. /* flush the currently occupied tx-buffers */
  12413. /* must only be called when device closed */
  12414. @@ -119,6 +133,7 @@ flush_tx_buffers(struct net_local *nl)
  12415. nl->sk_count--;
  12416. }
  12417. } /* flush_tx_buffers */
  12418. +#endif
  12419. /*********************************************************************/
  12420. @@ -129,6 +144,15 @@ static int
  12421. net_close(struct net_device *dev)
  12422. {
  12423. +#ifdef COMPAT_NO_SOFTNET
  12424. + dev->tbusy = 1; /* we are busy */
  12425. +
  12426. + if (dev->start)
  12427. + MOD_DEC_USE_COUNT; /* dec only if device has been active */
  12428. +
  12429. + dev->start = 0; /* and not started */
  12430. +
  12431. +#else
  12432. netif_stop_queue(dev); /* disable queueing */
  12433. if (((struct net_local *) dev)->is_open)
  12434. @@ -136,9 +160,52 @@ net_close(struct net_device *dev)
  12435. ((struct net_local *) dev)->is_open = 0;
  12436. flush_tx_buffers((struct net_local *) dev);
  12437. +#endif
  12438. return (0); /* success */
  12439. } /* net_close */
  12440. +#ifdef COMPAT_NO_SOFTNET
  12441. +/************************************/
  12442. +/* send a packet on this interface. */
  12443. +/* only for kernel versions < 2.3.33 */
  12444. +/************************************/
  12445. +static int
  12446. +net_send_packet(struct sk_buff *skb, struct net_device *dev)
  12447. +{
  12448. + struct net_local *lp = (struct net_local *) dev;
  12449. +
  12450. + if (dev->tbusy) {
  12451. + /*
  12452. + * If we get here, some higher level has decided we are broken.
  12453. + * There should really be a "kick me" function call instead.
  12454. + * As ISDN may have higher timeouts than real ethernet 10s timeout
  12455. + */
  12456. + int tickssofar = jiffies - dev->trans_start;
  12457. + if (tickssofar < (10000 * HZ) / 1000)
  12458. + return 1;
  12459. + printk(KERN_WARNING "%s: transmit timed out. \n", dev->name);
  12460. + dev->tbusy = 0;
  12461. + dev->trans_start = jiffies;
  12462. + }
  12463. + /*
  12464. + * Block a timer-based transmit from overlapping. This could better be
  12465. + * done with atomic_swap(1, dev->tbusy), but set_bit() works as well.
  12466. + */
  12467. + if (test_and_set_bit(0, (void *) &dev->tbusy) != 0)
  12468. + printk(KERN_WARNING "%s: Transmitter access conflict.\n", dev->name);
  12469. +
  12470. + else {
  12471. + lp->stats.tx_bytes += skb->len;
  12472. + dev->trans_start = jiffies;
  12473. + lp->tx_skb = skb; /* remember skb pointer */
  12474. + queue_task(&((hysdn_card *) dev->priv)->irq_queue, &tq_immediate);
  12475. + mark_bh(IMMEDIATE_BH);
  12476. + }
  12477. +
  12478. + return (0); /* success */
  12479. +} /* net_send_packet */
  12480. +
  12481. +#else
  12482. /************************************/
  12483. /* send a packet on this interface. */
  12484. /* new style for kernel >= 2.3.33 */
  12485. @@ -176,6 +243,7 @@ net_send_packet(struct sk_buff *skb, str
  12486. return (0); /* success */
  12487. } /* net_send_packet */
  12488. +#endif
  12489. /***********************************************************************/
  12490. @@ -190,6 +258,15 @@ hysdn_tx_netack(hysdn_card * card)
  12491. if (!lp)
  12492. return; /* non existing device */
  12493. +#ifdef COMPAT_NO_SOFTNET
  12494. + if (lp->tx_skb)
  12495. + dev_kfree_skb(lp->tx_skb); /* free tx pointer */
  12496. + lp->tx_skb = NULL; /* reset pointer */
  12497. +
  12498. + lp->stats.tx_packets++;
  12499. + lp->netdev.tbusy = 0;
  12500. + mark_bh(NET_BH); /* Inform upper layers. */
  12501. +#else
  12502. if (!lp->sk_count)
  12503. return; /* error condition */
  12504. @@ -203,6 +280,7 @@ hysdn_tx_netack(hysdn_card * card)
  12505. if (lp->sk_count-- == MAX_SKB_BUFFERS) /* dec usage count */
  12506. netif_start_queue((struct net_device *) lp);
  12507. +#endif
  12508. } /* hysdn_tx_netack */
  12509. /*****************************************************/
  12510. @@ -250,10 +328,15 @@ hysdn_tx_netget(hysdn_card * card)
  12511. if (!lp)
  12512. return (NULL); /* non existing device */
  12513. +#ifdef COMPAT_NO_SOFTNET
  12514. + return (lp->tx_skb); /* return packet pointer */
  12515. +
  12516. +#else
  12517. if (!lp->sk_count)
  12518. return (NULL); /* nothing available */
  12519. return (lp->skbs[lp->out_idx]); /* next packet to send */
  12520. +#endif
  12521. } /* hysdn_tx_netget */
  12522. @@ -296,15 +379,21 @@ hysdn_net_create(hysdn_card * card)
  12523. }
  12524. memset(dev, 0, sizeof(struct net_local)); /* clean the structure */
  12525. +#ifndef COMPAT_NO_SOFTNET
  12526. spin_lock_init(&((struct net_local *) dev)->lock);
  12527. +#endif
  12528. /* initialise necessary or informing fields */
  12529. dev->base_addr = card->iobase; /* IO address */
  12530. dev->irq = card->irq; /* irq */
  12531. dev->init = net_init; /* the init function of the device */
  12532. +#ifdef COMPAT_NO_SOFTNET
  12533. + dev->name = ((struct net_local *) dev)->dev_name; /* device name */
  12534. +#else
  12535. if(dev->name) {
  12536. strcpy(dev->name, ((struct net_local *) dev)->dev_name);
  12537. }
  12538. +#endif
  12539. if ((i = register_netdev(dev))) {
  12540. printk(KERN_WARNING "HYSDN: unable to create network device\n");
  12541. kfree(dev);
  12542. @@ -333,7 +422,9 @@ hysdn_net_release(hysdn_card * card)
  12543. card->netif = NULL; /* clear out pointer */
  12544. dev->stop(dev); /* close the device */
  12545. +#ifndef COMPAT_NO_SOFTNET
  12546. flush_tx_buffers((struct net_local *) dev); /* empty buffers */
  12547. +#endif
  12548. unregister_netdev(dev); /* release the device */
  12549. kfree(dev); /* release the memory allocated */
  12550. Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_pof.h
  12551. ===================================================================
  12552. --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_pof.h
  12553. +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_pof.h
  12554. @@ -1,4 +1,4 @@
  12555. -/* $Id: hysdn_pof.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  12556. +/* $Id$
  12557. *
  12558. * Linux driver for HYSDN cards, definitions used for handling pof-files.
  12559. *
  12560. Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_procconf.c
  12561. ===================================================================
  12562. --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_procconf.c
  12563. +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_procconf.c
  12564. @@ -1,4 +1,4 @@
  12565. -/* $Id: hysdn_procconf.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  12566. +/* $Id$
  12567. *
  12568. * Linux driver for HYSDN cards, /proc/net filesystem dir and conf functions.
  12569. *
  12570. @@ -17,11 +17,13 @@
  12571. #include <linux/poll.h>
  12572. #include <linux/proc_fs.h>
  12573. #include <linux/pci.h>
  12574. +#ifndef COMPAT_USE_MODCOUNT_LOCK
  12575. #include <linux/smp_lock.h>
  12576. +#endif
  12577. #include "hysdn_defs.h"
  12578. -static char *hysdn_procconf_revision = "$Revision: 1.1.4.1 $";
  12579. +static char *hysdn_procconf_revision = "$Revision$";
  12580. #define INFO_OUT_LEN 80 /* length of info line including lf */
  12581. @@ -212,32 +214,29 @@ hysdn_conf_write(struct file *file, cons
  12582. static ssize_t
  12583. hysdn_conf_read(struct file *file, char *buf, size_t count, loff_t * off)
  12584. {
  12585. - loff_t pos = *off;
  12586. char *cp;
  12587. int i;
  12588. if (off != &file->f_pos) /* fs error check */
  12589. return -ESPIPE;
  12590. - if (!(file->f_mode & FMODE_READ))
  12591. - return -EPERM;
  12592. -
  12593. - if (!(cp = file->private_data))
  12594. - return (-EFAULT); /* should never happen */
  12595. -
  12596. - i = strlen(cp); /* get total string length */
  12597. -
  12598. - if (pos != (unsigned)pos || pos >= i)
  12599. - return 0;
  12600. -
  12601. - /* still bytes to transfer */
  12602. - cp += pos; /* point to desired data offset */
  12603. - i -= pos; /* remaining length */
  12604. - if (i > count)
  12605. - i = count; /* limit length to transfer */
  12606. - if (copy_to_user(buf, cp, i))
  12607. - return (-EFAULT); /* copy error */
  12608. - *off = pos + i; /* adjust offset */
  12609. + if (file->f_mode & FMODE_READ) {
  12610. + if (!(cp = file->private_data))
  12611. + return (-EFAULT); /* should never happen */
  12612. + i = strlen(cp); /* get total string length */
  12613. + if (*off < i) {
  12614. + /* still bytes to transfer */
  12615. + cp += *off; /* point to desired data offset */
  12616. + i -= *off; /* remaining length */
  12617. + if (i > count)
  12618. + i = count; /* limit length to transfer */
  12619. + if (copy_to_user(buf, cp, i))
  12620. + return (-EFAULT); /* copy error */
  12621. + *off += i; /* adjust offset */
  12622. + } else
  12623. + return (0);
  12624. + } else
  12625. + return (-EPERM); /* no permission to read */
  12626. return (i);
  12627. } /* hysdn_conf_read */
  12628. @@ -254,7 +253,11 @@ hysdn_conf_open(struct inode *ino, struc
  12629. char *cp, *tmp;
  12630. /* now search the addressed card */
  12631. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  12632. + MOD_INC_USE_COUNT;
  12633. +#else
  12634. lock_kernel();
  12635. +#endif
  12636. card = card_root;
  12637. while (card) {
  12638. pd = card->procconf;
  12639. @@ -263,7 +266,11 @@ hysdn_conf_open(struct inode *ino, struc
  12640. card = card->next; /* search next entry */
  12641. }
  12642. if (!card) {
  12643. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  12644. + MOD_DEC_USE_COUNT;
  12645. +#else
  12646. unlock_kernel();
  12647. +#endif
  12648. return (-ENODEV); /* device is unknown/invalid */
  12649. }
  12650. if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
  12651. @@ -274,7 +281,11 @@ hysdn_conf_open(struct inode *ino, struc
  12652. /* write only access -> write boot file or conf line */
  12653. if (!(cnf = kmalloc(sizeof(struct conf_writedata), GFP_KERNEL))) {
  12654. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  12655. + MOD_DEC_USE_COUNT;
  12656. +#else
  12657. unlock_kernel();
  12658. +#endif
  12659. return (-EFAULT);
  12660. }
  12661. cnf->card = card;
  12662. @@ -286,7 +297,11 @@ hysdn_conf_open(struct inode *ino, struc
  12663. /* read access -> output card info data */
  12664. if (!(tmp = (char *) kmalloc(INFO_OUT_LEN * 2 + 2, GFP_KERNEL))) {
  12665. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  12666. + MOD_DEC_USE_COUNT;
  12667. +#else
  12668. unlock_kernel();
  12669. +#endif
  12670. return (-EFAULT); /* out of memory */
  12671. }
  12672. filep->private_data = tmp; /* start of string */
  12673. @@ -320,10 +335,16 @@ hysdn_conf_open(struct inode *ino, struc
  12674. *cp++ = '\n';
  12675. *cp = 0; /* end of string */
  12676. } else { /* simultaneous read/write access forbidden ! */
  12677. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  12678. + MOD_DEC_USE_COUNT;
  12679. +#else
  12680. unlock_kernel();
  12681. +#endif
  12682. return (-EPERM); /* no permission this time */
  12683. }
  12684. +#ifndef COMPAT_USE_MODCOUNT_LOCK
  12685. unlock_kernel();
  12686. +#endif
  12687. return (0);
  12688. } /* hysdn_conf_open */
  12689. @@ -338,7 +359,9 @@ hysdn_conf_close(struct inode *ino, stru
  12690. int retval = 0;
  12691. struct proc_dir_entry *pd;
  12692. +#ifndef COMPAT_USE_MODCOUNT_LOCK
  12693. lock_kernel();
  12694. +#endif
  12695. /* search the addressed card */
  12696. card = card_root;
  12697. while (card) {
  12698. @@ -348,7 +371,9 @@ hysdn_conf_close(struct inode *ino, stru
  12699. card = card->next; /* search next entry */
  12700. }
  12701. if (!card) {
  12702. +#ifndef COMPAT_USE_MODCOUNT_LOCK
  12703. unlock_kernel();
  12704. +#endif
  12705. return (-ENODEV); /* device is unknown/invalid */
  12706. }
  12707. if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
  12708. @@ -371,7 +396,11 @@ hysdn_conf_close(struct inode *ino, stru
  12709. if (filep->private_data)
  12710. kfree(filep->private_data); /* release memory */
  12711. }
  12712. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  12713. + MOD_DEC_USE_COUNT;
  12714. +#else
  12715. unlock_kernel();
  12716. +#endif
  12717. return (retval);
  12718. } /* hysdn_conf_close */
  12719. @@ -387,6 +416,9 @@ static struct file_operations conf_fops
  12720. release: hysdn_conf_close,
  12721. };
  12722. +#ifdef COMPAT_NO_SOFTNET
  12723. +static struct inode_operations conf_inode_operations;
  12724. +#endif
  12725. /*****************************/
  12726. /* hysdn subdir in /proc/net */
  12727. /*****************************/
  12728. @@ -415,8 +447,17 @@ hysdn_procconf_init(void)
  12729. if ((card->procconf = (void *) create_proc_entry(conf_name,
  12730. S_IFREG | S_IRUGO | S_IWUSR,
  12731. hysdn_proc_entry)) != NULL) {
  12732. +#ifdef COMPAT_NO_SOFTNET
  12733. + memset(&conf_inode_operations, 0, sizeof(struct inode_operations));
  12734. + conf_inode_operations.default_file_ops = &conf_fops;
  12735. +
  12736. + ((struct proc_dir_entry *) card->procconf)->ops = &conf_inode_operations;
  12737. +#else
  12738. ((struct proc_dir_entry *) card->procconf)->proc_fops = &conf_fops;
  12739. +#ifdef COMPAT_HAS_FILEOP_OWNER
  12740. ((struct proc_dir_entry *) card->procconf)->owner = THIS_MODULE;
  12741. +#endif
  12742. +#endif
  12743. hysdn_proclog_init(card); /* init the log file entry */
  12744. }
  12745. card = card->next; /* next entry */
  12746. Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_proclog.c
  12747. ===================================================================
  12748. --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_proclog.c
  12749. +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_proclog.c
  12750. @@ -1,4 +1,4 @@
  12751. -/* $Id: hysdn_proclog.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  12752. +/* $Id$
  12753. *
  12754. * Linux driver for HYSDN cards, /proc/net filesystem log functions.
  12755. *
  12756. @@ -16,7 +16,9 @@
  12757. #include <linux/poll.h>
  12758. #include <linux/proc_fs.h>
  12759. #include <linux/pci.h>
  12760. +#ifndef COMPAT_USE_MODCOUNT_LOCK
  12761. #include <linux/smp_lock.h>
  12762. +#endif
  12763. #include "hysdn_defs.h"
  12764. @@ -115,8 +117,7 @@ put_log_buffer(hysdn_card * card, char *
  12765. strcpy(ib->log_start, cp); /* set output string */
  12766. ib->next = NULL;
  12767. ib->proc_ctrl = pd; /* point to own control structure */
  12768. - save_flags(flags);
  12769. - cli();
  12770. + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
  12771. ib->usage_cnt = pd->if_used;
  12772. if (!pd->log_head)
  12773. pd->log_head = ib; /* new head */
  12774. @@ -124,7 +125,7 @@ put_log_buffer(hysdn_card * card, char *
  12775. pd->log_tail->next = ib; /* follows existing messages */
  12776. pd->log_tail = ib; /* new tail */
  12777. i = pd->del_lock++; /* get lock state */
  12778. - restore_flags(flags);
  12779. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12780. /* delete old entrys */
  12781. if (!i)
  12782. @@ -210,7 +211,6 @@ hysdn_log_read(struct file *file, char *
  12783. word ino;
  12784. struct procdata *pd = NULL;
  12785. hysdn_card *card;
  12786. - loff_t pos = *off;
  12787. if (!*((struct log_data **) file->private_data)) {
  12788. if (file->f_flags & O_NONBLOCK)
  12789. @@ -235,11 +235,11 @@ hysdn_log_read(struct file *file, char *
  12790. return (0);
  12791. inf->usage_cnt--; /* new usage count */
  12792. - file->private_data = &inf->next; /* next structure */
  12793. + (struct log_data **) file->private_data = &inf->next; /* next structure */
  12794. if ((len = strlen(inf->log_start)) <= count) {
  12795. if (copy_to_user(buf, inf->log_start, len))
  12796. return -EFAULT;
  12797. - *off = pos + len;
  12798. + file->f_pos += len;
  12799. return (len);
  12800. }
  12801. return (0);
  12802. @@ -255,7 +255,11 @@ hysdn_log_open(struct inode *ino, struct
  12803. struct procdata *pd = NULL;
  12804. ulong flags;
  12805. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  12806. + MOD_INC_USE_COUNT;
  12807. +#else
  12808. lock_kernel();
  12809. +#endif
  12810. card = card_root;
  12811. while (card) {
  12812. pd = card->proclog;
  12813. @@ -264,7 +268,11 @@ hysdn_log_open(struct inode *ino, struct
  12814. card = card->next; /* search next entry */
  12815. }
  12816. if (!card) {
  12817. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  12818. + MOD_DEC_USE_COUNT;
  12819. +#else
  12820. unlock_kernel();
  12821. +#endif
  12822. return (-ENODEV); /* device is unknown/invalid */
  12823. }
  12824. filep->private_data = card; /* remember our own card */
  12825. @@ -274,19 +282,24 @@ hysdn_log_open(struct inode *ino, struct
  12826. } else if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) {
  12827. /* read access -> log/debug read */
  12828. - save_flags(flags);
  12829. - cli();
  12830. + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
  12831. pd->if_used++;
  12832. if (pd->log_head)
  12833. - filep->private_data = &(pd->log_tail->next);
  12834. + (struct log_data **) filep->private_data = &(pd->log_tail->next);
  12835. else
  12836. - filep->private_data = &(pd->log_head);
  12837. - restore_flags(flags);
  12838. + (struct log_data **) filep->private_data = &(pd->log_head);
  12839. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12840. } else { /* simultaneous read/write access forbidden ! */
  12841. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  12842. + MOD_DEC_USE_COUNT;
  12843. +#else
  12844. unlock_kernel();
  12845. +#endif
  12846. return (-EPERM); /* no permission this time */
  12847. }
  12848. +#ifndef COMPAT_USE_MODCOUNT_LOCK
  12849. unlock_kernel();
  12850. +#endif
  12851. return (0);
  12852. } /* hysdn_log_open */
  12853. @@ -306,7 +319,9 @@ hysdn_log_close(struct inode *ino, struc
  12854. int flags, retval = 0;
  12855. +#ifndef COMPAT_USE_MODCOUNT_LOCK
  12856. lock_kernel();
  12857. +#endif
  12858. if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) {
  12859. /* write only access -> write debug level written */
  12860. retval = 0; /* success */
  12861. @@ -314,8 +329,7 @@ hysdn_log_close(struct inode *ino, struc
  12862. /* read access -> log/debug read, mark one further file as closed */
  12863. pd = NULL;
  12864. - save_flags(flags);
  12865. - cli();
  12866. + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
  12867. inf = *((struct log_data **) filep->private_data); /* get first log entry */
  12868. if (inf)
  12869. pd = (struct procdata *) inf->proc_ctrl; /* still entries there */
  12870. @@ -338,7 +352,7 @@ hysdn_log_close(struct inode *ino, struc
  12871. inf->usage_cnt--; /* decrement usage count for buffers */
  12872. inf = inf->next;
  12873. }
  12874. - restore_flags(flags);
  12875. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12876. if (pd)
  12877. if (pd->if_used <= 0) /* delete buffers if last file closed */
  12878. @@ -348,7 +362,11 @@ hysdn_log_close(struct inode *ino, struc
  12879. kfree(inf);
  12880. }
  12881. } /* read access */
  12882. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  12883. + MOD_DEC_USE_COUNT;
  12884. +#else
  12885. unlock_kernel();
  12886. +#endif
  12887. return (retval);
  12888. } /* hysdn_log_close */
  12889. @@ -400,6 +418,9 @@ static struct file_operations log_fops =
  12890. release: hysdn_log_close,
  12891. };
  12892. +#ifdef COMPAT_NO_SOFTNET
  12893. +struct inode_operations log_inode_operations;
  12894. +#endif
  12895. /***********************************************************************************/
  12896. /* hysdn_proclog_init is called when the module is loaded after creating the cards */
  12897. @@ -414,10 +435,20 @@ hysdn_proclog_init(hysdn_card * card)
  12898. if ((pd = (struct procdata *) kmalloc(sizeof(struct procdata), GFP_KERNEL)) != NULL) {
  12899. memset(pd, 0, sizeof(struct procdata));
  12900. +#ifdef COMPAT_NO_SOFTNET
  12901. + memset(&log_inode_operations, 0, sizeof(struct inode_operations));
  12902. + log_inode_operations.default_file_ops = &log_fops;
  12903. +#endif
  12904. sprintf(pd->log_name, "%s%d", PROC_LOG_BASENAME, card->myid);
  12905. if ((pd->log = create_proc_entry(pd->log_name, S_IFREG | S_IRUGO | S_IWUSR, hysdn_proc_entry)) != NULL) {
  12906. +#ifdef COMPAT_NO_SOFTNET
  12907. + pd->log->ops = &log_inode_operations; /* set new operations table */
  12908. +#else
  12909. pd->log->proc_fops = &log_fops;
  12910. +#ifdef COMPAT_HAS_FILEOP_OWNER
  12911. pd->log->owner = THIS_MODULE;
  12912. +#endif
  12913. +#endif
  12914. }
  12915. init_waitqueue_head(&(pd->rd_queue));
  12916. Index: linux-2.4.35.4/drivers/isdn/hysdn/hysdn_sched.c
  12917. ===================================================================
  12918. --- linux-2.4.35.4.orig/drivers/isdn/hysdn/hysdn_sched.c
  12919. +++ linux-2.4.35.4/drivers/isdn/hysdn/hysdn_sched.c
  12920. @@ -1,4 +1,4 @@
  12921. -/* $Id: hysdn_sched.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  12922. +/* $Id: hysdn_sched.c,v 1.9 2001/09/24 13:23:03 kai Exp $
  12923. *
  12924. * Linux driver for HYSDN cards
  12925. * scheduler routines for handling exchange card <-> pc.
  12926. @@ -12,11 +12,9 @@
  12927. */
  12928. #include <linux/config.h>
  12929. -#include <linux/sched.h>
  12930. #include <linux/signal.h>
  12931. #include <linux/kernel.h>
  12932. #include <linux/ioport.h>
  12933. -#include <linux/interrupt.h>
  12934. #include <asm/io.h>
  12935. #include "hysdn_defs.h"
  12936. @@ -151,22 +149,19 @@ hysdn_tx_cfgline(hysdn_card * card, ucha
  12937. if (card->debug_flags & LOG_SCHED_ASYN)
  12938. hysdn_addlog(card, "async tx-cfg chan=%d len=%d", chan, strlen(line) + 1);
  12939. -
  12940. - save_flags(flags);
  12941. - cli();
  12942. + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
  12943. while (card->async_busy) {
  12944. - sti();
  12945. -
  12946. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12947. if (card->debug_flags & LOG_SCHED_ASYN)
  12948. hysdn_addlog(card, "async tx-cfg delayed");
  12949. set_current_state(TASK_INTERRUPTIBLE);
  12950. schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
  12951. if (!--cnt) {
  12952. - restore_flags(flags);
  12953. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12954. return (-ERR_ASYNC_TIME); /* timed out */
  12955. }
  12956. - cli();
  12957. + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
  12958. } /* wait for buffer to become free */
  12959. strcpy(card->async_data, line);
  12960. @@ -177,31 +172,26 @@ hysdn_tx_cfgline(hysdn_card * card, ucha
  12961. /* now queue the task */
  12962. queue_task(&card->irq_queue, &tq_immediate);
  12963. mark_bh(IMMEDIATE_BH);
  12964. - sti();
  12965. -
  12966. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12967. if (card->debug_flags & LOG_SCHED_ASYN)
  12968. hysdn_addlog(card, "async tx-cfg data queued");
  12969. cnt++; /* short delay */
  12970. - cli();
  12971. -
  12972. + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
  12973. while (card->async_busy) {
  12974. - sti();
  12975. -
  12976. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12977. if (card->debug_flags & LOG_SCHED_ASYN)
  12978. hysdn_addlog(card, "async tx-cfg waiting for tx-ready");
  12979. set_current_state(TASK_INTERRUPTIBLE);
  12980. schedule_timeout((20 * HZ) / 1000); /* Timeout 20ms */
  12981. if (!--cnt) {
  12982. - restore_flags(flags);
  12983. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12984. return (-ERR_ASYNC_TIME); /* timed out */
  12985. }
  12986. - cli();
  12987. + HYSDN_SPIN_LOCK(&card->irq_lock, flags);
  12988. } /* wait for buffer to become free again */
  12989. -
  12990. - restore_flags(flags);
  12991. -
  12992. + HYSDN_SPIN_UNLOCK(&card->irq_lock, flags);
  12993. if (card->debug_flags & LOG_SCHED_ASYN)
  12994. hysdn_addlog(card, "async tx-cfg data send");
  12995. Index: linux-2.4.35.4/drivers/isdn/icn/icn.c
  12996. ===================================================================
  12997. --- linux-2.4.35.4.orig/drivers/isdn/icn/icn.c
  12998. +++ linux-2.4.35.4/drivers/isdn/icn/icn.c
  12999. @@ -1,4 +1,4 @@
  13000. -/* $Id: icn.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  13001. +/* $Id$
  13002. *
  13003. * ISDN low-level module for the ICN active ISDN-Card.
  13004. *
  13005. @@ -41,7 +41,7 @@ MODULE_PARM_DESC(icn_id2, "ID-String of
  13006. #undef MAP_DEBUG
  13007. static char
  13008. -*revision = "$Revision: 1.1.4.1 $";
  13009. +*revision = "$Revision$";
  13010. static int icn_addcard(int, char *, char *);
  13011. @@ -1634,6 +1634,7 @@ icn_addcard(int port, char *id1, char *i
  13012. }
  13013. #ifndef MODULE
  13014. +#ifdef COMPAT_HAS_NEW_SETUP
  13015. static int __init
  13016. icn_setup(char *line)
  13017. {
  13018. @@ -1643,6 +1644,14 @@ icn_setup(char *line)
  13019. static char sid2[20];
  13020. str = get_options(line, 2, ints);
  13021. +#else
  13022. +void
  13023. +icn_setup(char *str, int *ints)
  13024. +{
  13025. + char *p;
  13026. + static char sid[20];
  13027. + static char sid2[20];
  13028. +#endif
  13029. if (ints[0])
  13030. portbase = ints[1];
  13031. if (ints[0] > 1)
  13032. @@ -1656,9 +1665,13 @@ icn_setup(char *line)
  13033. icn_id2 = sid2;
  13034. }
  13035. }
  13036. +#ifdef COMPAT_HAS_NEW_SETUP
  13037. return(1);
  13038. }
  13039. __setup("icn=", icn_setup);
  13040. +#else
  13041. +}
  13042. +#endif
  13043. #endif /* MODULE */
  13044. static int __init icn_init(void)
  13045. Index: linux-2.4.35.4/drivers/isdn/icn/icn.h
  13046. ===================================================================
  13047. --- linux-2.4.35.4.orig/drivers/isdn/icn/icn.h
  13048. +++ linux-2.4.35.4/drivers/isdn/icn/icn.h
  13049. @@ -1,4 +1,4 @@
  13050. -/* $Id: icn.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  13051. +/* $Id$
  13052. *
  13053. * ISDN lowlevel-module for the ICN active ISDN-Card.
  13054. *
  13055. Index: linux-2.4.35.4/drivers/isdn/isdn_audio.c
  13056. ===================================================================
  13057. --- linux-2.4.35.4.orig/drivers/isdn/isdn_audio.c
  13058. +++ linux-2.4.35.4/drivers/isdn/isdn_audio.c
  13059. @@ -1,9 +1,9 @@
  13060. -/* $Id: isdn_audio.c,v 1.1.4.1 2001/11/20 14:19:33 kai Exp $
  13061. +/* $Id: isdn_audio.c,v 1.24 2002/08/13 09:57:26 keil Exp $
  13062. *
  13063. * Linux ISDN subsystem, audio conversion and compression (linklevel).
  13064. *
  13065. * Copyright 1994-1999 by Fritz Elfert ([email protected])
  13066. - * DTMF code (c) 1996 by Christian Mock ([email protected])
  13067. + * DTMF code (c) 1996 by Christian Mock ([email protected])
  13068. * Silence detection (c) 1998 by Armin Schindler ([email protected])
  13069. *
  13070. * This software may be used and distributed according to the terms
  13071. @@ -15,7 +15,7 @@
  13072. #include "isdn_audio.h"
  13073. #include "isdn_common.h"
  13074. -char *isdn_audio_revision = "$Revision: 1.1.4.1 $";
  13075. +char *isdn_audio_revision = "$Revision: 1.24 $";
  13076. /*
  13077. * Misc. lookup-tables.
  13078. @@ -169,19 +169,39 @@ static char isdn_audio_ulaw_to_alaw[] =
  13079. 0x8a, 0x8a, 0x6a, 0x6a, 0xea, 0xea, 0x2a, 0x2a
  13080. };
  13081. -#define NCOEFF 8 /* number of frequencies to be analyzed */
  13082. -#define DTMF_TRESH 4000 /* above this is dtmf */
  13083. +#define NCOEFF 16 /* number of frequencies to be analyzed */
  13084. +#define DTMF_TRESH 25000 /* above this is dtmf */
  13085. #define SILENCE_TRESH 200 /* below this is silence */
  13086. +#define H2_TRESH 20000 /* 2nd harmonic */
  13087. #define AMP_BITS 9 /* bits per sample, reduced to avoid overflow */
  13088. #define LOGRP 0
  13089. #define HIGRP 1
  13090. +typedef struct {
  13091. + int grp; /* low/high group */
  13092. + int k; /* k */
  13093. + int k2; /* k fuer 2. harmonic */
  13094. +} dtmf_t;
  13095. +
  13096. /* For DTMF recognition:
  13097. * 2 * cos(2 * PI * k / N) precalculated for all k
  13098. */
  13099. static int cos2pik[NCOEFF] =
  13100. {
  13101. - 55813, 53604, 51193, 48591, 38114, 33057, 25889, 18332
  13102. + 55812, 29528, 53603, 24032, 51193, 14443, 48590, 6517,
  13103. + 38113, -21204, 33057, -32186, 25889, -45081, 18332, -55279
  13104. +};
  13105. +
  13106. +static dtmf_t dtmf_tones[8] =
  13107. +{
  13108. + {LOGRP, 0, 1}, /* 697 Hz */
  13109. + {LOGRP, 2, 3}, /* 770 Hz */
  13110. + {LOGRP, 4, 5}, /* 852 Hz */
  13111. + {LOGRP, 6, 7}, /* 941 Hz */
  13112. + {HIGRP, 8, 9}, /* 1209 Hz */
  13113. + {HIGRP, 10, 11}, /* 1336 Hz */
  13114. + {HIGRP, 12, 13}, /* 1477 Hz */
  13115. + {HIGRP, 14, 15} /* 1633 Hz */
  13116. };
  13117. static char dtmf_matrix[4][4] =
  13118. @@ -208,7 +228,7 @@ isdn_audio_tlookup(const u_char *table,
  13119. : "memory", "ax");
  13120. #else
  13121. while (n--)
  13122. - *buff = table[*(unsigned char *)buff], buff++;
  13123. + *buff++ = table[*(unsigned char *)buff];
  13124. #endif
  13125. }
  13126. @@ -479,18 +499,6 @@ isdn_audio_goertzel(int *sample, modem_i
  13127. sk2 = sk1;
  13128. sk1 = sk;
  13129. }
  13130. - /* Avoid overflows */
  13131. - sk >>= 1;
  13132. - sk2 >>= 1;
  13133. - /* compute |X(k)|**2 */
  13134. - /* report overflows. This should not happen. */
  13135. - /* Comment this out if desired */
  13136. - if (sk < -32768 || sk > 32767)
  13137. - printk(KERN_DEBUG
  13138. - "isdn_audio: dtmf goertzel overflow, sk=%d\n", sk);
  13139. - if (sk2 < -32768 || sk2 > 32767)
  13140. - printk(KERN_DEBUG
  13141. - "isdn_audio: dtmf goertzel overflow, sk2=%d\n", sk2);
  13142. result[k] =
  13143. ((sk * sk) >> AMP_BITS) -
  13144. ((((cos2pik[k] * sk) >> 15) * sk2) >> AMP_BITS) +
  13145. @@ -514,58 +522,28 @@ isdn_audio_eval_dtmf(modem_info * info)
  13146. int grp[2];
  13147. char what;
  13148. char *p;
  13149. - int thresh;
  13150. while ((skb = skb_dequeue(&info->dtmf_queue))) {
  13151. result = (int *) skb->data;
  13152. s = info->dtmf_state;
  13153. - grp[LOGRP] = grp[HIGRP] = -1;
  13154. + grp[LOGRP] = grp[HIGRP] = -2;
  13155. silence = 0;
  13156. - thresh = 0;
  13157. - for (i = 0; i < NCOEFF; i++) {
  13158. - if (result[i] > DTMF_TRESH) {
  13159. - if (result[i] > thresh)
  13160. - thresh = result[i];
  13161. - }
  13162. - else if (result[i] < SILENCE_TRESH)
  13163. + for (i = 0; i < 8; i++) {
  13164. + if ((result[dtmf_tones[i].k] > DTMF_TRESH) &&
  13165. + (result[dtmf_tones[i].k2] < H2_TRESH))
  13166. + grp[dtmf_tones[i].grp] = (grp[dtmf_tones[i].grp] == -2) ? i : -1;
  13167. + else if ((result[dtmf_tones[i].k] < SILENCE_TRESH) &&
  13168. + (result[dtmf_tones[i].k2] < SILENCE_TRESH))
  13169. silence++;
  13170. }
  13171. - if (silence == NCOEFF)
  13172. + if (silence == 8)
  13173. what = ' ';
  13174. else {
  13175. - if (thresh > 0) {
  13176. - thresh = thresh >> 4; /* touchtones must match within 12 dB */
  13177. - for (i = 0; i < NCOEFF; i++) {
  13178. - if (result[i] < thresh)
  13179. - continue; /* ignore */
  13180. - /* good level found. This is allowed only one time per group */
  13181. - if (i < NCOEFF / 2) {
  13182. - /* lowgroup*/
  13183. - if (grp[LOGRP] >= 0) {
  13184. - // Bad. Another tone found. */
  13185. - grp[LOGRP] = -1;
  13186. - break;
  13187. - }
  13188. - else
  13189. - grp[LOGRP] = i;
  13190. - }
  13191. - else { /* higroup */
  13192. - if (grp[HIGRP] >= 0) { // Bad. Another tone found. */
  13193. - grp[HIGRP] = -1;
  13194. - break;
  13195. - }
  13196. - else
  13197. - grp[HIGRP] = i - NCOEFF/2;
  13198. - }
  13199. - }
  13200. - if ((grp[LOGRP] >= 0) && (grp[HIGRP] >= 0)) {
  13201. - what = dtmf_matrix[grp[LOGRP]][grp[HIGRP]];
  13202. - if (s->last != ' ' && s->last != '.')
  13203. - s->last = what; /* min. 1 non-DTMF between DTMF */
  13204. - } else
  13205. - what = '.';
  13206. - }
  13207. - else
  13208. + if ((grp[LOGRP] >= 0) && (grp[HIGRP] >= 0)) {
  13209. + what = dtmf_matrix[grp[LOGRP]][grp[HIGRP] - 4];
  13210. + if (s->last != ' ' && s->last != '.')
  13211. + s->last = what; /* min. 1 non-DTMF between DTMF */
  13212. + } else
  13213. what = '.';
  13214. }
  13215. if ((what != s->last) && (what != ' ') && (what != '.')) {
  13216. Index: linux-2.4.35.4/drivers/isdn/isdn_audio.h
  13217. ===================================================================
  13218. --- linux-2.4.35.4.orig/drivers/isdn/isdn_audio.h
  13219. +++ linux-2.4.35.4/drivers/isdn/isdn_audio.h
  13220. @@ -1,4 +1,4 @@
  13221. -/* $Id: isdn_audio.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  13222. +/* $Id: isdn_audio.h,v 1.10 2001/09/24 13:22:42 kai Exp $
  13223. *
  13224. * Linux ISDN subsystem, audio conversion and compression (linklevel).
  13225. *
  13226. @@ -20,7 +20,6 @@ typedef struct adpcm_state {
  13227. typedef struct dtmf_state {
  13228. char last;
  13229. - char llast;
  13230. int idx;
  13231. int buf[DTMF_NPOINTS];
  13232. } dtmf_state;
  13233. Index: linux-2.4.35.4/drivers/isdn/isdn_bsdcomp.c
  13234. ===================================================================
  13235. --- linux-2.4.35.4.orig/drivers/isdn/isdn_bsdcomp.c
  13236. +++ linux-2.4.35.4/drivers/isdn/isdn_bsdcomp.c
  13237. @@ -105,6 +105,14 @@ MODULE_LICENSE("Dual BSD/GPL");
  13238. #define DEBUG 1
  13239. +#ifdef CONFIG_ISDN_WITH_ABC
  13240. +#define BSD_C_MALLOC(x) kmalloc((x),GFP_ATOMIC)
  13241. +#define BSD_C_FREE(x) kfree(x)
  13242. +#else
  13243. +#define BSD_C_MALLOC(x) vmalloc(x)
  13244. +#define BSD_C_FREE(x) vfree(x)
  13245. +#endif
  13246. +
  13247. /*
  13248. * A dictionary for doing BSD compress.
  13249. */
  13250. @@ -285,7 +293,7 @@ static void bsd_free (void *state)
  13251. * Release the dictionary
  13252. */
  13253. if (db->dict) {
  13254. - vfree (db->dict);
  13255. + BSD_C_FREE (db->dict);
  13256. db->dict = NULL;
  13257. }
  13258. @@ -293,7 +301,7 @@ static void bsd_free (void *state)
  13259. * Release the string buffer
  13260. */
  13261. if (db->lens) {
  13262. - vfree (db->lens);
  13263. + BSD_C_FREE (db->lens);
  13264. db->lens = NULL;
  13265. }
  13266. @@ -350,14 +358,19 @@ static void *bsd_alloc (struct isdn_ppp_
  13267. * Allocate space for the dictionary. This may be more than one page in
  13268. * length.
  13269. */
  13270. - db->dict = (struct bsd_dict *) vmalloc (hsize * sizeof (struct bsd_dict));
  13271. + db->dict = (struct bsd_dict *) BSD_C_MALLOC (hsize * sizeof (struct bsd_dict));
  13272. +
  13273. + MOD_INC_USE_COUNT;
  13274. + /*
  13275. + ** MOD_INC_USE_COUNT must be before bsd_free
  13276. + ** bsd_free make MOD_DEC_USE_COUNT if db != NULL
  13277. + */
  13278. +
  13279. if (!db->dict) {
  13280. bsd_free (db);
  13281. return NULL;
  13282. }
  13283. - MOD_INC_USE_COUNT;
  13284. -
  13285. /*
  13286. * If this is the compression buffer then there is no length data.
  13287. * For decompression, the length information is needed as well.
  13288. @@ -365,7 +378,7 @@ static void *bsd_alloc (struct isdn_ppp_
  13289. if (!decomp)
  13290. db->lens = NULL;
  13291. else {
  13292. - db->lens = (unsigned short *) vmalloc ((maxmaxcode + 1) *
  13293. + db->lens = (unsigned short *) BSD_C_MALLOC ((maxmaxcode + 1) *
  13294. sizeof (db->lens[0]));
  13295. if (!db->lens) {
  13296. bsd_free (db); /* calls MOD_DEC_USE_COUNT; */
  13297. @@ -478,7 +491,11 @@ static int bsd_compress (void *state, st
  13298. int hval,disp,ilen,mxcode;
  13299. unsigned char *rptr = skb_in->data;
  13300. int isize = skb_in->len;
  13301. +#ifdef CONFIG_ISDN_WITH_ABC
  13302. + long secure = 0;
  13303. +#endif
  13304. +#ifndef CONFIG_ISDN_WITH_ABC
  13305. #define OUTPUT(ent) \
  13306. { \
  13307. bitno -= n_bits; \
  13308. @@ -490,17 +507,45 @@ static int bsd_compress (void *state, st
  13309. bitno += 8; \
  13310. } while (bitno <= 24); \
  13311. }
  13312. +#else
  13313. +#define OUTPUT(ent) \
  13314. + { \
  13315. + secure = 0; \
  13316. + bitno -= n_bits; \
  13317. + accm |= ((ent) << bitno); \
  13318. + do { \
  13319. + if(skb_out && skb_tailroom(skb_out) > 0) \
  13320. + *(skb_put(skb_out,1)) = (unsigned char) (accm>>24); \
  13321. + accm <<= 8; \
  13322. + bitno += 8; \
  13323. + } while (bitno <= 24 && ++secure < 10000); \
  13324. + if(secure >= 10000) { \
  13325. + printk(KERN_DEBUG "BSD in OUTPUT secure counter reached\n"); \
  13326. + return 0; \
  13327. + } \
  13328. + }
  13329. +#endif
  13330. /*
  13331. * If the protocol is not in the range we're interested in,
  13332. * just return without compressing the packet. If it is,
  13333. * the protocol becomes the first byte to compress.
  13334. */
  13335. +#ifdef CONFIG_ISDN_WITH_ABC
  13336. + ent = proto;
  13337. +
  13338. + if (proto < 0x21 || proto > 0xf9 || !(proto & 0x1) ) {
  13339. +
  13340. + printk(KERN_DEBUG "bsd_compress called with %x\n",proto);
  13341. + return 0;
  13342. + }
  13343. +#else
  13344. printk(KERN_DEBUG "bsd_compress called with %x\n",proto);
  13345. ent = proto;
  13346. if (proto < 0x21 || proto > 0xf9 || !(proto & 0x1) )
  13347. return 0;
  13348. +#endif
  13349. db = (struct bsd_db *) state;
  13350. hshift = db->hshift;
  13351. @@ -538,6 +583,9 @@ static int bsd_compress (void *state, st
  13352. /* continue probing until a match or invalid entry */
  13353. disp = (hval == 0) ? 1 : hval;
  13354. +#ifdef CONFIG_ISDN_WITH_ABC
  13355. + secure = 0;
  13356. +#endif
  13357. do {
  13358. hval += disp;
  13359. @@ -546,7 +594,15 @@ static int bsd_compress (void *state, st
  13360. dictp = dict_ptr (db, hval);
  13361. if (dictp->codem1 >= max_ent)
  13362. goto nomatch;
  13363. +#ifndef CONFIG_ISDN_WITH_ABC
  13364. } while (dictp->fcode != fcode);
  13365. +#else
  13366. + } while (dictp->fcode != fcode && ++secure < 100000);
  13367. + if(secure >= 100000) {
  13368. + printk(KERN_DEBUG "BSD: compress while dictp->fcode != fcode secure-counter reached\n");
  13369. + return 0;
  13370. + }
  13371. +#endif
  13372. ent = dictp->codem1 + 1; /* finally found (prefix,suffix) */
  13373. continue;
  13374. @@ -669,6 +725,9 @@ static int bsd_decompress (void *state,
  13375. int ilen;
  13376. int codelen;
  13377. int extra;
  13378. +#ifdef CONFIG_ISDN_WITH_ABC
  13379. + unsigned long secure = 0;
  13380. +#endif
  13381. db = (struct bsd_db *) state;
  13382. max_ent = db->max_ent;
  13383. @@ -677,7 +736,9 @@ static int bsd_decompress (void *state,
  13384. n_bits = db->n_bits;
  13385. tgtbitno = 32 - n_bits; /* bitno when we have a code */
  13386. +#ifndef CONFIG_ISDN_WITH_ABC
  13387. printk(KERN_DEBUG "bsd_decompress called\n");
  13388. +#endif
  13389. if(!skb_in || !skb_out) {
  13390. printk(KERN_ERR "bsd_decompress called with NULL parameter\n");
  13391. @@ -795,7 +856,11 @@ static int bsd_decompress (void *state,
  13392. p = skb_put(skb_out,codelen);
  13393. p += codelen;
  13394. +#ifdef CONFIG_ISDN_WITH_ABC
  13395. + for(secure = 0; finchar > LAST && secure < 50000;secure++) {
  13396. +#else
  13397. while (finchar > LAST) {
  13398. +#endif
  13399. struct bsd_dict *dictp2 = dict_ptr (db, finchar);
  13400. dictp = dict_ptr (db, dictp2->cptr);
  13401. @@ -822,6 +887,12 @@ static int bsd_decompress (void *state,
  13402. }
  13403. }
  13404. *--p = finchar;
  13405. +#ifdef CONFIG_ISDN_WITH_ABC
  13406. + if(secure >= 50000) {
  13407. + printk(KERN_DEBUG "BSD: decompress secure-counter reached\n");
  13408. + return DECOMP_FATALERROR;
  13409. + }
  13410. +#endif
  13411. #ifdef DEBUG
  13412. if (--codelen != 0)
  13413. @@ -851,12 +922,23 @@ static int bsd_decompress (void *state,
  13414. /* look for a free hash table entry */
  13415. if (dictp->codem1 < max_ent) {
  13416. disp = (hval == 0) ? 1 : hval;
  13417. +#ifdef CONFIG_ISDN_WITH_ABC
  13418. + secure = 0;
  13419. +#endif
  13420. do {
  13421. hval += disp;
  13422. if (hval >= db->hsize)
  13423. hval -= db->hsize;
  13424. dictp = dict_ptr (db, hval);
  13425. +#ifndef CONFIG_ISDN_WITH_ABC
  13426. } while (dictp->codem1 < max_ent);
  13427. +#else
  13428. + } while (dictp->codem1 < max_ent && ++secure < 50000);
  13429. + if(secure >= 50000) {
  13430. + printk(KERN_DEBUG "BSD: decomp while (dictp->codem1 < max_ent) secure-counter reached\n");
  13431. + return DECOMP_FATALERROR;
  13432. + }
  13433. +#endif
  13434. }
  13435. /*
  13436. @@ -895,11 +977,21 @@ static int bsd_decompress (void *state,
  13437. db->comp_bytes += skb_in->len - BSD_OVHD;
  13438. db->uncomp_bytes += skb_out->len;
  13439. +#ifdef CONFIG_ISDN_WITH_ABC
  13440. + /*
  13441. + ** bsd_check will call bsd_clear
  13442. + ** and so on the internal tables will be cleared.
  13443. + **
  13444. + ** I think that's not what we will at this point ?????
  13445. + ** For me at works without bsd_check.
  13446. + */
  13447. +#else
  13448. if (bsd_check(db)) {
  13449. if (db->debug)
  13450. printk(KERN_DEBUG "bsd_decomp%d: peer should have cleared dictionary on %d\n",
  13451. db->unit, db->seqno - 1);
  13452. }
  13453. +#endif
  13454. return skb_out->len;
  13455. }
  13456. Index: linux-2.4.35.4/drivers/isdn/isdn_common.c
  13457. ===================================================================
  13458. --- linux-2.4.35.4.orig/drivers/isdn/isdn_common.c
  13459. +++ linux-2.4.35.4/drivers/isdn/isdn_common.c
  13460. @@ -1,4 +1,4 @@
  13461. -/* $Id: isdn_common.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  13462. +/* $Id: isdn_common.c,v 1.137 2002/02/09 21:19:11 keil Exp $
  13463. *
  13464. * Linux ISDN subsystem, common used functions (linklevel).
  13465. *
  13466. @@ -19,6 +19,7 @@
  13467. #include <linux/vmalloc.h>
  13468. #include <linux/isdn.h>
  13469. #include <linux/smp_lock.h>
  13470. +#include <linux/list.h>
  13471. #include "isdn_common.h"
  13472. #include "isdn_tty.h"
  13473. #include "isdn_net.h"
  13474. @@ -33,7 +34,9 @@
  13475. #include <linux/isdn_divertif.h>
  13476. #endif /* CONFIG_ISDN_DIVERSION */
  13477. #include "isdn_v110.h"
  13478. +#ifdef HAVE_DEVFS_FS
  13479. #include <linux/devfs_fs_kernel.h>
  13480. +#endif /* HAVE_DEVFS_FS */
  13481. /* Debugflags */
  13482. #undef ISDN_DEBUG_STATCALLB
  13483. @@ -44,7 +47,7 @@ MODULE_LICENSE("GPL");
  13484. isdn_dev *dev;
  13485. -static char *isdn_revision = "$Revision: 1.1.4.1 $";
  13486. +static char *isdn_revision = "$Revision: 1.137 $";
  13487. extern char *isdn_net_revision;
  13488. extern char *isdn_tty_revision;
  13489. @@ -67,19 +70,19 @@ static isdn_divert_if *divert_if; /* = N
  13490. static int isdn_writebuf_stub(int, int, const u_char *, int, int);
  13491. static void set_global_features(void);
  13492. +#ifdef HAVE_DEVFS_FS
  13493. static void isdn_register_devfs(int);
  13494. static void isdn_unregister_devfs(int);
  13495. +#endif /* HAVE_DEVFS_FS */
  13496. static int isdn_wildmat(char *s, char *p);
  13497. void
  13498. isdn_lock_drivers(void)
  13499. {
  13500. int i;
  13501. - isdn_ctrl cmd;
  13502. - for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
  13503. - if (!dev->drv[i])
  13504. - continue;
  13505. + for (i = 0; i < dev->drivers; i++) {
  13506. + isdn_ctrl cmd;
  13507. cmd.driver = i;
  13508. cmd.arg = 0;
  13509. @@ -101,10 +104,7 @@ isdn_unlock_drivers(void)
  13510. {
  13511. int i;
  13512. - for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
  13513. - if (!dev->drv[i])
  13514. - continue;
  13515. -
  13516. + for (i = 0; i < dev->drivers; i++)
  13517. if (dev->drv[i]->locks > 0) {
  13518. isdn_ctrl cmd;
  13519. @@ -114,7 +114,6 @@ isdn_unlock_drivers(void)
  13520. isdn_command(&cmd);
  13521. dev->drv[i]->locks--;
  13522. }
  13523. - }
  13524. }
  13525. void
  13526. @@ -473,6 +472,7 @@ isdn_status_callback(isdn_ctrl * c)
  13527. dev->drv[di]->flags &= ~DRV_FLAG_RUNNING;
  13528. break;
  13529. case ISDN_STAT_ICALL:
  13530. + case ISDN_STAT_ICALLW:
  13531. if (i < 0)
  13532. return -1;
  13533. #ifdef ISDN_DEBUG_STATCALLB
  13534. @@ -718,7 +718,9 @@ isdn_status_callback(isdn_ctrl * c)
  13535. dev->drvmap[i] = -1;
  13536. dev->chanmap[i] = -1;
  13537. dev->usage[i] &= ~ISDN_USAGE_DISABLED;
  13538. +#ifdef HAVE_DEVFS_FS
  13539. isdn_unregister_devfs(i);
  13540. +#endif /* HAVE_DEVFS_FS */
  13541. }
  13542. dev->drivers--;
  13543. dev->channels -= dev->drv[di]->channels;
  13544. @@ -755,6 +757,10 @@ isdn_status_callback(isdn_ctrl * c)
  13545. if (divert_if)
  13546. return(divert_if->stat_callback(c));
  13547. #endif /* CONFIG_ISDN_DIVERSION */
  13548. + case ISDN_STAT_ALERT:
  13549. + case ISDN_STAT_PROCEED:
  13550. + isdn_tty_stat_callback(i, c);
  13551. + break;
  13552. default:
  13553. return -1;
  13554. }
  13555. @@ -900,72 +906,239 @@ isdn_minor2chan(int minor)
  13556. return (dev->chanmap[minor]);
  13557. }
  13558. -static char *
  13559. -isdn_statstr(void)
  13560. +// ----------------------------------------------------------------------
  13561. +// /dev/isdninfo
  13562. +//
  13563. +// This device has somewhat insane semantics, but we need to support
  13564. +// them for the sake of compatibility.
  13565. +//
  13566. +// After opening, the first read will succeed and return the current state
  13567. +// Then, unless O_NONBLOCK is set, it will block until a state change happens
  13568. +// and then return the new state.
  13569. +// Also, if the buffer size for the read is too small, we'll just return
  13570. +// EOF
  13571. +
  13572. +struct isdnstatus_dev {
  13573. + struct list_head list;
  13574. + int update;
  13575. +};
  13576. +
  13577. +static DECLARE_WAIT_QUEUE_HEAD(isdnstatus_waitq);
  13578. +static LIST_HEAD(isdnstatus_devs);
  13579. +static spinlock_t isdnstatus_devs_lock = SPIN_LOCK_UNLOCKED;
  13580. +
  13581. +void
  13582. +isdn_info_update(void)
  13583. +{
  13584. + struct list_head *p;
  13585. + struct isdnstatus_dev *idev;
  13586. +
  13587. + spin_lock(&isdnstatus_devs_lock);
  13588. + list_for_each(p, &isdnstatus_devs) {
  13589. + idev = list_entry(p, struct isdnstatus_dev, list);
  13590. + idev->update = 1;
  13591. + }
  13592. + spin_unlock(&isdnstatus_devs_lock);
  13593. + wake_up_interruptible(&isdnstatus_waitq);
  13594. +}
  13595. +
  13596. +static int
  13597. +isdnstatus_open(struct inode *ino, struct file *filep)
  13598. +{
  13599. + struct isdnstatus_dev *p;
  13600. +
  13601. + p = kmalloc(sizeof(struct isdnstatus_dev), GFP_USER);
  13602. + if (!p)
  13603. + return -ENOMEM;
  13604. +
  13605. + /* At opening time we allow a single update */
  13606. + p->update = 1;
  13607. + spin_lock(&isdnstatus_devs_lock);
  13608. + list_add(&p->list, &isdnstatus_devs);
  13609. + spin_unlock(&isdnstatus_devs_lock);
  13610. + filep->private_data = p;
  13611. +
  13612. + return 0;
  13613. +}
  13614. +
  13615. +static void
  13616. +isdnstatus_close(struct inode *ino, struct file *filep)
  13617. +{
  13618. + struct isdnstatus_dev *p = filep->private_data;
  13619. +
  13620. + spin_lock(&isdnstatus_devs_lock);
  13621. + list_del(&p->list);
  13622. + spin_unlock(&isdnstatus_devs_lock);
  13623. + kfree(p);
  13624. +}
  13625. +
  13626. +// FIXME we don't lock against the state changing whilst being
  13627. +// printed
  13628. +
  13629. +void
  13630. +isdn_statstr(char *buf)
  13631. {
  13632. - static char istatbuf[2048];
  13633. char *p;
  13634. int i;
  13635. - sprintf(istatbuf, "idmap:\t");
  13636. - p = istatbuf + strlen(istatbuf);
  13637. + p = buf;
  13638. + p += sprintf(p, "idmap:\t");
  13639. for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
  13640. - sprintf(p, "%s ", (dev->drvmap[i] < 0) ? "-" : dev->drvid[dev->drvmap[i]]);
  13641. - p = istatbuf + strlen(istatbuf);
  13642. + p += sprintf(p, "%s ", (dev->drvmap[i] < 0) ? "-" : dev->drvid[dev->drvmap[i]]);
  13643. }
  13644. - sprintf(p, "\nchmap:\t");
  13645. - p = istatbuf + strlen(istatbuf);
  13646. + p += sprintf(p, "\nchmap:\t");
  13647. for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
  13648. - sprintf(p, "%d ", dev->chanmap[i]);
  13649. - p = istatbuf + strlen(istatbuf);
  13650. + p += sprintf(p, "%d ", dev->chanmap[i]);
  13651. }
  13652. - sprintf(p, "\ndrmap:\t");
  13653. - p = istatbuf + strlen(istatbuf);
  13654. + p += sprintf(p, "\ndrmap:\t");
  13655. for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
  13656. - sprintf(p, "%d ", dev->drvmap[i]);
  13657. - p = istatbuf + strlen(istatbuf);
  13658. + p += sprintf(p, "%d ", dev->drvmap[i]);
  13659. }
  13660. - sprintf(p, "\nusage:\t");
  13661. - p = istatbuf + strlen(istatbuf);
  13662. + p += sprintf(p, "\nusage:\t");
  13663. for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
  13664. - sprintf(p, "%d ", dev->usage[i]);
  13665. - p = istatbuf + strlen(istatbuf);
  13666. + p += sprintf(p, "%d ", dev->usage[i]);
  13667. }
  13668. - sprintf(p, "\nflags:\t");
  13669. - p = istatbuf + strlen(istatbuf);
  13670. + p += sprintf(p, "\nflags:\t");
  13671. for (i = 0; i < ISDN_MAX_DRIVERS; i++) {
  13672. if (dev->drv[i]) {
  13673. - sprintf(p, "%ld ", dev->drv[i]->online);
  13674. - p = istatbuf + strlen(istatbuf);
  13675. + p += sprintf(p, "%ld ", dev->drv[i]->online);
  13676. } else {
  13677. - sprintf(p, "? ");
  13678. - p = istatbuf + strlen(istatbuf);
  13679. + p += sprintf(p, "? ");
  13680. }
  13681. }
  13682. - sprintf(p, "\nphone:\t");
  13683. - p = istatbuf + strlen(istatbuf);
  13684. + p += sprintf(p, "\nphone:\t");
  13685. for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
  13686. - sprintf(p, "%s ", dev->num[i]);
  13687. - p = istatbuf + strlen(istatbuf);
  13688. + p += sprintf(p, "%s ", dev->num[i]);
  13689. }
  13690. - sprintf(p, "\n");
  13691. - return istatbuf;
  13692. + p += sprintf(p, "\n");
  13693. }
  13694. -/* Module interface-code */
  13695. +static ssize_t
  13696. +isdnstatus_read(struct file *file, char *buf, size_t count, loff_t * off)
  13697. +{
  13698. + static DECLARE_MUTEX(istatbuf_mutex);
  13699. + static char istatbuf[2048];
  13700. -void
  13701. -isdn_info_update(void)
  13702. + DECLARE_WAITQUEUE(wait, current);
  13703. + struct isdnstatus_dev *idev;
  13704. + int retval = 0;
  13705. + unsigned int len;
  13706. +
  13707. + idev = file->private_data;
  13708. +
  13709. + if (off != &file->f_pos)
  13710. + return -ESPIPE;
  13711. +
  13712. + add_wait_queue(&isdnstatus_waitq, &wait);
  13713. + for (;;) {
  13714. + set_current_state(TASK_INTERRUPTIBLE);
  13715. +
  13716. + if (idev->update)
  13717. + break;
  13718. +
  13719. + retval = -EAGAIN;
  13720. + if (file->f_flags & O_NONBLOCK)
  13721. + break;
  13722. +
  13723. + retval = -ERESTARTSYS;
  13724. + if (signal_pending(current))
  13725. + break;
  13726. +
  13727. + schedule();
  13728. + }
  13729. + __set_current_state(TASK_RUNNING);
  13730. + remove_wait_queue(&isdnstatus_waitq, &wait);
  13731. +
  13732. + if (!idev->update)
  13733. + goto out;
  13734. +
  13735. + idev->update = 0;
  13736. + down(&istatbuf_mutex);
  13737. + isdn_statstr(istatbuf);
  13738. + len = strlen(istatbuf);
  13739. + if (len > count) {
  13740. + retval = 0;
  13741. + goto out_unlock;
  13742. + }
  13743. + if (copy_to_user(buf, istatbuf, len)) {
  13744. + retval = -EFAULT;
  13745. + goto out_unlock;
  13746. + }
  13747. + *off += len;
  13748. + retval = len;
  13749. +
  13750. + out_unlock:
  13751. + up(&istatbuf_mutex);
  13752. + out:
  13753. + return retval;
  13754. +}
  13755. +
  13756. +static ssize_t
  13757. +isdnstatus_write(struct file *file, const char *buf, size_t count, loff_t * off)
  13758. {
  13759. - infostruct *p = dev->infochain;
  13760. + return -EINVAL;
  13761. +}
  13762. +
  13763. +static unsigned int
  13764. +isdnstatus_poll(struct file *file, poll_table * wait)
  13765. +{
  13766. + struct isdnstatus_dev *idev;
  13767. + unsigned int mask = 0;
  13768. +
  13769. + idev = file->private_data;
  13770. - while (p) {
  13771. - *(p->private) = 1;
  13772. - p = (infostruct *) p->next;
  13773. + poll_wait(file, &isdnstatus_waitq, wait);
  13774. + if (idev->update) {
  13775. + mask |= POLLIN | POLLRDNORM;
  13776. }
  13777. - wake_up_interruptible(&(dev->info_waitq));
  13778. + return mask;
  13779. }
  13780. +static int
  13781. +isdnstatus_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
  13782. +{
  13783. + int retval;
  13784. + isdn_net_ioctl_phone phone;
  13785. +
  13786. + switch (cmd) {
  13787. + case IIOCGETDVR:
  13788. + return (TTY_DV +
  13789. + (NET_DV << 8) +
  13790. + (INF_DV << 16));
  13791. + case IIOCGETCPS:
  13792. + if (arg) {
  13793. + ulong *p = (ulong *) arg;
  13794. + int i;
  13795. + if ((retval = verify_area(VERIFY_WRITE, (void *) arg,
  13796. + sizeof(ulong) * ISDN_MAX_CHANNELS * 2)))
  13797. + return retval;
  13798. + for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
  13799. + put_user(dev->ibytes[i], p++);
  13800. + put_user(dev->obytes[i], p++);
  13801. + }
  13802. + return 0;
  13803. + } else
  13804. + return -EINVAL;
  13805. + break;
  13806. +#ifdef CONFIG_NETDEVICES
  13807. + case IIOCNETGPN:
  13808. + /* Get peer phone number of a connected
  13809. + * isdn network interface */
  13810. + if (arg) {
  13811. + if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
  13812. + return -EFAULT;
  13813. + return isdn_net_getpeer(&phone, (isdn_net_ioctl_phone *) arg);
  13814. + } else
  13815. + return -EINVAL;
  13816. +#endif
  13817. + default:
  13818. + return -EINVAL;
  13819. + }
  13820. +}
  13821. +
  13822. +// ----------------------------------------------------------------------
  13823. +
  13824. +
  13825. static ssize_t
  13826. isdn_read(struct file *file, char *buf, size_t count, loff_t * off)
  13827. {
  13828. @@ -976,37 +1149,16 @@ isdn_read(struct file *file, char *buf,
  13829. int chidx;
  13830. int retval;
  13831. char *p;
  13832. - loff_t pos = *off;
  13833. if (off != &file->f_pos)
  13834. return -ESPIPE;
  13835. - if (pos != (unsigned) pos)
  13836. - return -EINVAL;
  13837. -
  13838. +#ifndef COMPAT_HAVE_READ_LOCK_KERNEL
  13839. lock_kernel();
  13840. - if (minor == ISDN_MINOR_STATUS) {
  13841. - if (!file->private_data) {
  13842. - if (file->f_flags & O_NONBLOCK) {
  13843. - retval = -EAGAIN;
  13844. - goto out;
  13845. - }
  13846. - interruptible_sleep_on(&(dev->info_waitq));
  13847. - }
  13848. - p = isdn_statstr();
  13849. - file->private_data = 0;
  13850. - if ((len = strlen(p)) <= count) {
  13851. - if (copy_to_user(buf, p, len)) {
  13852. - retval = -EFAULT;
  13853. - goto out;
  13854. - }
  13855. - *off = pos + len;
  13856. - retval = len;
  13857. - goto out;
  13858. - }
  13859. - retval = 0;
  13860. - goto out;
  13861. - }
  13862. +#endif
  13863. + if (minor == ISDN_MINOR_STATUS)
  13864. + return isdnstatus_read(file, buf, count, off);
  13865. +
  13866. if (!dev->drivers) {
  13867. retval = -ENODEV;
  13868. goto out;
  13869. @@ -1031,7 +1183,7 @@ isdn_read(struct file *file, char *buf,
  13870. cli();
  13871. len = isdn_readbchan(drvidx, chidx, p, 0, count,
  13872. &dev->drv[drvidx]->rcv_waitq[chidx]);
  13873. - *off = pos + len;
  13874. + *off += len;
  13875. restore_flags(flags);
  13876. if (copy_to_user(buf,p,len))
  13877. len = -EFAULT;
  13878. @@ -1052,6 +1204,9 @@ isdn_read(struct file *file, char *buf,
  13879. }
  13880. interruptible_sleep_on(&(dev->drv[drvidx]->st_waitq));
  13881. }
  13882. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  13883. + if(drvidx || (len = isdn_dw_abc_lcr_readstat(buf,count)) < 1) {
  13884. +#endif
  13885. if (dev->drv[drvidx]->interface->readstat) {
  13886. if (count > dev->drv[drvidx]->stavail)
  13887. count = dev->drv[drvidx]->stavail;
  13888. @@ -1065,6 +1220,9 @@ isdn_read(struct file *file, char *buf,
  13889. } else {
  13890. len = 0;
  13891. }
  13892. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  13893. + }
  13894. +#endif
  13895. save_flags(flags);
  13896. cli();
  13897. if (len)
  13898. @@ -1072,7 +1230,7 @@ isdn_read(struct file *file, char *buf,
  13899. else
  13900. dev->drv[drvidx]->stavail = 0;
  13901. restore_flags(flags);
  13902. - *off = pos + len;
  13903. + *off += len;
  13904. retval = len;
  13905. goto out;
  13906. }
  13907. @@ -1084,7 +1242,9 @@ isdn_read(struct file *file, char *buf,
  13908. #endif
  13909. retval = -ENODEV;
  13910. out:
  13911. +#ifndef COMPAT_HAVE_READ_LOCK_KERNEL
  13912. unlock_kernel();
  13913. +#endif
  13914. return retval;
  13915. }
  13916. @@ -1096,15 +1256,18 @@ isdn_write(struct file *file, const char
  13917. int chidx;
  13918. int retval;
  13919. + if (minor == ISDN_MINOR_STATUS)
  13920. + return isdnstatus_write(file, buf, count, off);
  13921. +
  13922. if (off != &file->f_pos)
  13923. return -ESPIPE;
  13924. - if (minor == ISDN_MINOR_STATUS)
  13925. - return -EPERM;
  13926. if (!dev->drivers)
  13927. return -ENODEV;
  13928. +#ifndef COMPAT_HAVE_WRITE_LOCK_KERNEL
  13929. lock_kernel();
  13930. +#endif
  13931. if (minor <= ISDN_MINOR_BMAX) {
  13932. printk(KERN_WARNING "isdn_write minor %d obsolete!\n", minor);
  13933. drvidx = isdn_minor2drv(minor);
  13934. @@ -1149,7 +1312,9 @@ isdn_write(struct file *file, const char
  13935. #endif
  13936. retval = -ENODEV;
  13937. out:
  13938. +#ifndef COMPAT_HAVE_WRITE_LOCK_KERNEL
  13939. unlock_kernel();
  13940. +#endif
  13941. return retval;
  13942. }
  13943. @@ -1160,15 +1325,12 @@ isdn_poll(struct file *file, poll_table
  13944. unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
  13945. int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
  13946. +#ifndef COMPAT_HAVE_POLL_LOCK_KERNEL
  13947. lock_kernel();
  13948. - if (minor == ISDN_MINOR_STATUS) {
  13949. - poll_wait(file, &(dev->info_waitq), wait);
  13950. - /* mask = POLLOUT | POLLWRNORM; */
  13951. - if (file->private_data) {
  13952. - mask |= POLLIN | POLLRDNORM;
  13953. - }
  13954. - goto out;
  13955. - }
  13956. +#endif
  13957. + if (minor == ISDN_MINOR_STATUS)
  13958. + return isdnstatus_poll(file, wait);
  13959. +
  13960. if (minor >= ISDN_MINOR_CTRL && minor <= ISDN_MINOR_CTRLMAX) {
  13961. if (drvidx < 0) {
  13962. /* driver deregistered while file open */
  13963. @@ -1190,7 +1352,9 @@ isdn_poll(struct file *file, poll_table
  13964. #endif
  13965. mask = POLLERR;
  13966. out:
  13967. +#ifndef COMPAT_HAVE_POLL_LOCK_KERNEL
  13968. unlock_kernel();
  13969. +#endif
  13970. return mask;
  13971. }
  13972. @@ -1220,42 +1384,9 @@ isdn_ioctl(struct inode *inode, struct f
  13973. #define phone iocpar.phone
  13974. #define cfg iocpar.cfg
  13975. - if (minor == ISDN_MINOR_STATUS) {
  13976. - switch (cmd) {
  13977. - case IIOCGETDVR:
  13978. - return (TTY_DV +
  13979. - (NET_DV << 8) +
  13980. - (INF_DV << 16));
  13981. - case IIOCGETCPS:
  13982. - if (arg) {
  13983. - ulong *p = (ulong *) arg;
  13984. - int i;
  13985. - if ((ret = verify_area(VERIFY_WRITE, (void *) arg,
  13986. - sizeof(ulong) * ISDN_MAX_CHANNELS * 2)))
  13987. - return ret;
  13988. - for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
  13989. - put_user(dev->ibytes[i], p++);
  13990. - put_user(dev->obytes[i], p++);
  13991. - }
  13992. - return 0;
  13993. - } else
  13994. - return -EINVAL;
  13995. - break;
  13996. -#ifdef CONFIG_NETDEVICES
  13997. - case IIOCNETGPN:
  13998. - /* Get peer phone number of a connected
  13999. - * isdn network interface */
  14000. - if (arg) {
  14001. - if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
  14002. - return -EFAULT;
  14003. - return isdn_net_getpeer(&phone, (isdn_net_ioctl_phone *) arg);
  14004. - } else
  14005. - return -EINVAL;
  14006. -#endif
  14007. - default:
  14008. - return -EINVAL;
  14009. - }
  14010. - }
  14011. + if (minor == ISDN_MINOR_STATUS)
  14012. + return isdnstatus_ioctl(inode, file, cmd, arg);
  14013. +
  14014. if (!dev->drivers)
  14015. return -ENODEV;
  14016. if (minor <= ISDN_MINOR_BMAX) {
  14017. @@ -1277,11 +1408,34 @@ isdn_ioctl(struct inode *inode, struct f
  14018. */
  14019. switch (cmd) {
  14020. case IIOCNETDWRSET:
  14021. +#ifdef CONFIG_ISDN_WITH_ABC
  14022. + if (arg) {
  14023. +
  14024. + if (copy_from_user(name, (char *) arg, sizeof(name))) {
  14025. +
  14026. + return(-EFAULT);
  14027. +
  14028. + } else {
  14029. +
  14030. + isdn_net_dev *p = isdn_net_findif(name);
  14031. +
  14032. + if(p == NULL)
  14033. + return(-EINVAL);
  14034. +
  14035. + return(isdn_dw_abc_reset_interface(p->local,1));
  14036. + }
  14037. + }
  14038. +#else
  14039. printk(KERN_INFO "INFO: ISDN_DW_ABC_EXTENSION not enabled\n");
  14040. +#endif
  14041. return(-EINVAL);
  14042. case IIOCNETLCR:
  14043. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  14044. + return(isdn_dw_abc_lcr_ioctl(arg));
  14045. +#else
  14046. printk(KERN_INFO "INFO: ISDN_ABC_LCR_SUPPORT not enabled\n");
  14047. return -ENODEV;
  14048. +#endif
  14049. #ifdef CONFIG_NETDEVICES
  14050. case IIOCNETAIF:
  14051. /* Add a network-interface */
  14052. @@ -1654,22 +1808,12 @@ isdn_open(struct inode *ino, struct file
  14053. int chidx;
  14054. int retval = -ENODEV;
  14055. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  14056. + MOD_INC_USE_COUNT;
  14057. +#endif
  14058. if (minor == ISDN_MINOR_STATUS) {
  14059. - infostruct *p;
  14060. -
  14061. - if ((p = kmalloc(sizeof(infostruct), GFP_KERNEL))) {
  14062. - p->next = (char *) dev->infochain;
  14063. - p->private = (char *) &(filep->private_data);
  14064. - dev->infochain = p;
  14065. - /* At opening we allow a single update */
  14066. - filep->private_data = (char *) 1;
  14067. - retval = 0;
  14068. - goto out;
  14069. - } else {
  14070. - retval = -ENOMEM;
  14071. - goto out;
  14072. - }
  14073. + return isdnstatus_open(ino, filep);
  14074. }
  14075. if (!dev->channels)
  14076. goto out;
  14077. @@ -1692,6 +1836,9 @@ isdn_open(struct inode *ino, struct file
  14078. if (drvidx < 0)
  14079. goto out;
  14080. isdn_lock_drivers();
  14081. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  14082. + if(!drvidx) isdn_dw_abc_lcr_open();
  14083. +#endif
  14084. retval = 0;
  14085. goto out;
  14086. }
  14087. @@ -1704,6 +1851,10 @@ isdn_open(struct inode *ino, struct file
  14088. }
  14089. #endif
  14090. out:
  14091. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  14092. + if (retval)
  14093. + MOD_DEC_USE_COUNT;
  14094. +#endif
  14095. return retval;
  14096. }
  14097. @@ -1712,25 +1863,11 @@ isdn_close(struct inode *ino, struct fil
  14098. {
  14099. uint minor = MINOR(ino->i_rdev);
  14100. +#ifndef COMPAT_USE_MODCOUNT_LOCK
  14101. lock_kernel();
  14102. +#endif
  14103. if (minor == ISDN_MINOR_STATUS) {
  14104. - infostruct *p = dev->infochain;
  14105. - infostruct *q = NULL;
  14106. -
  14107. - while (p) {
  14108. - if (p->private == (char *) &(filep->private_data)) {
  14109. - if (q)
  14110. - q->next = p->next;
  14111. - else
  14112. - dev->infochain = (infostruct *) (p->next);
  14113. - kfree(p);
  14114. - goto out;
  14115. - }
  14116. - q = p;
  14117. - p = (infostruct *) (p->next);
  14118. - }
  14119. - printk(KERN_WARNING "isdn: No private data while closing isdnctrl\n");
  14120. - goto out;
  14121. + isdnstatus_close(ino, filep);
  14122. }
  14123. isdn_unlock_drivers();
  14124. if (minor <= ISDN_MINOR_BMAX)
  14125. @@ -1738,6 +1875,12 @@ isdn_close(struct inode *ino, struct fil
  14126. if (minor <= ISDN_MINOR_CTRLMAX) {
  14127. if (dev->profd == current)
  14128. dev->profd = NULL;
  14129. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  14130. + {
  14131. + int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
  14132. + if(!drvidx) isdn_dw_abc_lcr_close();
  14133. + }
  14134. +#endif
  14135. goto out;
  14136. }
  14137. #ifdef CONFIG_ISDN_PPP
  14138. @@ -1746,13 +1889,19 @@ isdn_close(struct inode *ino, struct fil
  14139. #endif
  14140. out:
  14141. +#ifdef COMPAT_USE_MODCOUNT_LOCK
  14142. + MOD_DEC_USE_COUNT;
  14143. +#else
  14144. unlock_kernel();
  14145. +#endif
  14146. return 0;
  14147. }
  14148. static struct file_operations isdn_fops =
  14149. {
  14150. +#ifdef COMPAT_HAS_FILEOP_OWNER
  14151. owner: THIS_MODULE,
  14152. +#endif
  14153. llseek: no_llseek,
  14154. read: isdn_read,
  14155. write: isdn_write,
  14156. @@ -1805,6 +1954,15 @@ isdn_get_free_channel(int usage, int l2_
  14157. if (USG_NONE(dev->usage[i]) &&
  14158. (dev->drvmap[i] != -1)) {
  14159. int d = dev->drvmap[i];
  14160. +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
  14161. + if(jiffies < dev->dwabc_chan_external_inuse[i]) {
  14162. +
  14163. + if((dev->dwabc_chan_external_inuse[i] - jiffies) > (HZ * 120))
  14164. + dev->dwabc_chan_external_inuse[i] = 0;
  14165. + else
  14166. + continue;
  14167. + }
  14168. +#endif
  14169. if ((dev->usage[i] & ISDN_USAGE_EXCLUSIVE) &&
  14170. ((pre_dev != d) || (pre_chan != dev->chanmap[i])))
  14171. continue;
  14172. @@ -1823,7 +1981,11 @@ isdn_get_free_channel(int usage, int l2_
  14173. restore_flags(flags);
  14174. return i;
  14175. } else {
  14176. +#ifdef CONFIG_ISDN_WITH_ABC
  14177. + if ((pre_dev == d) && ((pre_chan == dev->chanmap[i]) || pre_chan > 1000)) {
  14178. +#else
  14179. if ((pre_dev == d) && (pre_chan == dev->chanmap[i])) {
  14180. +#endif
  14181. dev->usage[i] &= ISDN_USAGE_EXCLUSIVE;
  14182. dev->usage[i] |= usage;
  14183. isdn_info_update();
  14184. @@ -2010,7 +2172,7 @@ isdn_add_channels(driver *d, int drvidx,
  14185. if ((adding) && (d->rcverr))
  14186. kfree(d->rcverr);
  14187. - if (!(d->rcverr = kmalloc(sizeof(int) * m, GFP_KERNEL))) {
  14188. + if (!(d->rcverr = (int *) kmalloc(sizeof(int) * m, GFP_KERNEL))) {
  14189. printk(KERN_WARNING "register_isdn: Could not alloc rcverr\n");
  14190. return -1;
  14191. }
  14192. @@ -2018,7 +2180,7 @@ isdn_add_channels(driver *d, int drvidx,
  14193. if ((adding) && (d->rcvcount))
  14194. kfree(d->rcvcount);
  14195. - if (!(d->rcvcount = kmalloc(sizeof(int) * m, GFP_KERNEL))) {
  14196. + if (!(d->rcvcount = (int *) kmalloc(sizeof(int) * m, GFP_KERNEL))) {
  14197. printk(KERN_WARNING "register_isdn: Could not alloc rcvcount\n");
  14198. if (!adding) kfree(d->rcverr);
  14199. return -1;
  14200. @@ -2030,7 +2192,8 @@ isdn_add_channels(driver *d, int drvidx,
  14201. skb_queue_purge(&d->rpqueue[j]);
  14202. kfree(d->rpqueue);
  14203. }
  14204. - if (!(d->rpqueue = kmalloc(sizeof(struct sk_buff_head) * m, GFP_KERNEL))) {
  14205. + if (!(d->rpqueue =
  14206. + (struct sk_buff_head *) kmalloc(sizeof(struct sk_buff_head) * m, GFP_KERNEL))) {
  14207. printk(KERN_WARNING "register_isdn: Could not alloc rpqueue\n");
  14208. if (!adding) {
  14209. kfree(d->rcvcount);
  14210. @@ -2044,7 +2207,8 @@ isdn_add_channels(driver *d, int drvidx,
  14211. if ((adding) && (d->rcv_waitq))
  14212. kfree(d->rcv_waitq);
  14213. - d->rcv_waitq = kmalloc(sizeof(wait_queue_head_t) * 2 * m, GFP_KERNEL);
  14214. + d->rcv_waitq = (wait_queue_head_t *)
  14215. + kmalloc(sizeof(wait_queue_head_t) * 2 * m, GFP_KERNEL);
  14216. if (!d->rcv_waitq) {
  14217. printk(KERN_WARNING "register_isdn: Could not alloc rcv_waitq\n");
  14218. if (!adding) {
  14219. @@ -2068,7 +2232,9 @@ isdn_add_channels(driver *d, int drvidx,
  14220. if (dev->chanmap[k] < 0) {
  14221. dev->chanmap[k] = j;
  14222. dev->drvmap[k] = drvidx;
  14223. +#ifdef HAVE_DEVFS_FS
  14224. isdn_register_devfs(k);
  14225. +#endif /* HAVE_DEVFS_FS */
  14226. break;
  14227. }
  14228. restore_flags(flags);
  14229. @@ -2132,6 +2298,7 @@ int DIVERT_REG_NAME(isdn_divert_if *i_di
  14230. i_div->ll_cmd = isdn_command; /* set command function */
  14231. i_div->drv_to_name = map_drvname;
  14232. i_div->name_to_drv = map_namedrv;
  14233. + i_div->dial_net_name = isdn_net_force_dial;
  14234. MOD_INC_USE_COUNT;
  14235. divert_if = i_div; /* remember interface */
  14236. return(DIVERT_NO_ERR);
  14237. @@ -2169,7 +2336,7 @@ register_isdn(isdn_if * i)
  14238. printk(KERN_WARNING "register_isdn: No write routine given.\n");
  14239. return 0;
  14240. }
  14241. - if (!(d = kmalloc(sizeof(driver), GFP_KERNEL))) {
  14242. + if (!(d = (driver *) kmalloc(sizeof(driver), GFP_KERNEL))) {
  14243. printk(KERN_WARNING "register_isdn: Could not alloc driver-struct\n");
  14244. return 0;
  14245. }
  14246. @@ -2229,6 +2396,7 @@ isdn_getrev(const char *revision)
  14247. return rev;
  14248. }
  14249. +#ifdef HAVE_DEVFS_FS
  14250. #ifdef CONFIG_DEVFS_FS
  14251. static devfs_handle_t devfs_handle;
  14252. @@ -2318,6 +2486,7 @@ static void isdn_cleanup_devfs(void)
  14253. }
  14254. #endif /* CONFIG_DEVFS_FS */
  14255. +#endif /* HAVE_DEVFS_FS */
  14256. /*
  14257. * Allocate and initialize all data, register modem-devices
  14258. @@ -2335,7 +2504,6 @@ static int __init isdn_init(void)
  14259. init_timer(&dev->timer);
  14260. dev->timer.function = isdn_timer_funct;
  14261. init_MUTEX(&dev->sem);
  14262. - init_waitqueue_head(&dev->info_waitq);
  14263. for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
  14264. dev->drvmap[i] = -1;
  14265. dev->chanmap[i] = -1;
  14266. @@ -2349,7 +2517,9 @@ static int __init isdn_init(void)
  14267. vfree(dev);
  14268. return -EIO;
  14269. }
  14270. +#ifdef HAVE_DEVFS_FS
  14271. isdn_init_devfs();
  14272. +#endif /* HAVE_DEVFS_FS */
  14273. if ((i = isdn_tty_modem_init()) < 0) {
  14274. printk(KERN_WARNING "isdn: Could not register tty devices\n");
  14275. if (i == -3)
  14276. @@ -2357,7 +2527,9 @@ static int __init isdn_init(void)
  14277. if (i <= -2)
  14278. tty_unregister_driver(&dev->mdm.tty_modem);
  14279. vfree(dev);
  14280. +#ifdef HAVE_DEVFS_FS
  14281. isdn_cleanup_devfs();
  14282. +#endif /* HAVE_DEVFS_FS */
  14283. devfs_unregister_chrdev(ISDN_MAJOR, "isdn");
  14284. return -EIO;
  14285. }
  14286. @@ -2368,7 +2540,9 @@ static int __init isdn_init(void)
  14287. tty_unregister_driver(&dev->mdm.cua_modem);
  14288. for (i = 0; i < ISDN_MAX_CHANNELS; i++)
  14289. kfree(dev->mdm.info[i].xmit_buf - 4);
  14290. +#ifdef HAVE_DEVFS_FS
  14291. isdn_cleanup_devfs();
  14292. +#endif /* HAVE_DEVFS_FS */
  14293. devfs_unregister_chrdev(ISDN_MAJOR, "isdn");
  14294. vfree(dev);
  14295. return -EIO;
  14296. @@ -2394,6 +2568,9 @@ static int __init isdn_init(void)
  14297. printk("\n");
  14298. #endif
  14299. isdn_info_update();
  14300. +#ifdef CONFIG_ISDN_WITH_ABC
  14301. + isdn_dw_abc_init_func();
  14302. +#endif
  14303. return 0;
  14304. }
  14305. @@ -2402,7 +2579,7 @@ static int __init isdn_init(void)
  14306. */
  14307. static void __exit isdn_exit(void)
  14308. {
  14309. - unsigned long flags;
  14310. + int flags;
  14311. int i;
  14312. #ifdef CONFIG_ISDN_PPP
  14313. @@ -2436,13 +2613,18 @@ static void __exit isdn_exit(void)
  14314. printk(KERN_WARNING "isdn: controldevice busy, remove cancelled\n");
  14315. restore_flags(flags);
  14316. } else {
  14317. +#ifdef HAVE_DEVFS_FS
  14318. isdn_cleanup_devfs();
  14319. +#endif /* HAVE_DEVFS_FS */
  14320. del_timer(&dev->timer);
  14321. restore_flags(flags);
  14322. /* call vfree with interrupts enabled, else it will hang */
  14323. vfree(dev);
  14324. printk(KERN_NOTICE "ISDN-subsystem unloaded\n");
  14325. }
  14326. +#ifdef CONFIG_ISDN_WITH_ABC
  14327. + isdn_dw_abc_release_func();
  14328. +#endif
  14329. }
  14330. module_init(isdn_init);
  14331. Index: linux-2.4.35.4/drivers/isdn/isdn_common.h
  14332. ===================================================================
  14333. --- linux-2.4.35.4.orig/drivers/isdn/isdn_common.h
  14334. +++ linux-2.4.35.4/drivers/isdn/isdn_common.h
  14335. @@ -1,4 +1,4 @@
  14336. -/* $Id: isdn_common.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  14337. +/* $Id: isdn_common.h,v 1.22 2001/09/24 13:22:42 kai Exp $
  14338. *
  14339. * header for Linux ISDN subsystem
  14340. * common used functions and debugging-switches (linklevel).
  14341. @@ -24,6 +24,9 @@
  14342. #undef ISDN_DEBUG_NET_DIAL
  14343. #undef ISDN_DEBUG_NET_ICALL
  14344. +#ifdef CONFIG_ISDN_WITH_ABC
  14345. +int isdn_net_force_dial_lp(isdn_net_local *);
  14346. +#endif
  14347. /* Prototypes */
  14348. extern void isdn_MOD_INC_USE_COUNT(void);
  14349. extern void isdn_MOD_DEC_USE_COUNT(void);
  14350. Index: linux-2.4.35.4/drivers/isdn/isdn_concap.c
  14351. ===================================================================
  14352. --- linux-2.4.35.4.orig/drivers/isdn/isdn_concap.c
  14353. +++ linux-2.4.35.4/drivers/isdn/isdn_concap.c
  14354. @@ -1,4 +1,4 @@
  14355. -/* $Id: isdn_concap.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  14356. +/* $Id: isdn_concap.c,v 1.9 2001/09/24 13:22:42 kai Exp $
  14357. *
  14358. * Linux ISDN subsystem, protocol encapsulation
  14359. *
  14360. Index: linux-2.4.35.4/drivers/isdn/isdn_concap.h
  14361. ===================================================================
  14362. --- linux-2.4.35.4.orig/drivers/isdn/isdn_concap.h
  14363. +++ linux-2.4.35.4/drivers/isdn/isdn_concap.h
  14364. @@ -1,4 +1,4 @@
  14365. -/* $Id: isdn_concap.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  14366. +/* $Id: isdn_concap.h,v 1.4 2001/09/24 13:22:42 kai Exp $
  14367. *
  14368. * Linux ISDN subsystem, protocol encapsulation
  14369. *
  14370. Index: linux-2.4.35.4/drivers/isdn/isdn_dwabc.c
  14371. ===================================================================
  14372. --- /dev/null
  14373. +++ linux-2.4.35.4/drivers/isdn/isdn_dwabc.c
  14374. @@ -0,0 +1,1053 @@
  14375. +
  14376. +/* $Id: isdn_dwabc.c,v 1.27 2001/12/01 23:18:21 detabc Exp $
  14377. +
  14378. + * Linux ISDN subsystem, abc-extension releated funktions.
  14379. + *
  14380. + * Copyright by abc GmbH
  14381. + * written by Detlef Wengorz <[email protected]>
  14382. + *
  14383. + * This program is free software; you can redistribute it and/or modify
  14384. + * it under the terms of the GNU General Public License as published by
  14385. + * the Free Software Foundation; either version 2, or (at your option)
  14386. + * any later version.
  14387. + *
  14388. + */
  14389. +
  14390. +#include <linux/config.h>
  14391. +#define __NO_VERSION__
  14392. +
  14393. +#ifdef CONFIG_ISDN_WITH_ABC
  14394. +
  14395. +static char *dwabcrevison = "$Revision: 1.27 $";
  14396. +
  14397. +#include <asm/semaphore.h>
  14398. +#define CONFIG_ISDN_WITH_ABC_NEED_DWSJIFFIES 1
  14399. +#include <linux/list.h>
  14400. +#include <linux/isdn.h>
  14401. +#include "isdn_common.h"
  14402. +#include "isdn_net.h"
  14403. +
  14404. +#include <linux/skbuff.h>
  14405. +
  14406. +#include <net/udp.h>
  14407. +#include <net/checksum.h>
  14408. +#include <linux/isdn_dwabc.h>
  14409. +
  14410. +
  14411. +#if CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS && CONFIG_ISDN_PPP
  14412. +#include <linux/isdn_ppp.h>
  14413. +extern struct isdn_ppp_compressor *isdn_ippp_comp_head;
  14414. +#define ipc_head isdn_ippp_comp_head
  14415. +#ifndef CI_BSD_COMPRESS
  14416. +#define CI_BSD_COMPRESS 21
  14417. +#endif
  14418. +#endif
  14419. +
  14420. +#define NBYTEORDER_30BYTES 0x1e00
  14421. +#define DWABC_TMRES (HZ / 10)
  14422. +
  14423. +#define VERBLEVEL (dev->net_verbose > 2)
  14424. +
  14425. +static struct timer_list dw_abc_timer;
  14426. +
  14427. +
  14428. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  14429. +static ISDN_DWSPINLOCK lcr_spin = ISDN_DWSPIN_UNLOCKED;
  14430. +#define LCR_LOCK() isdn_dwspin_trylock(&lcr_spin)
  14431. +#define LCR_ULOCK() isdn_dwspin_unlock(&lcr_spin)
  14432. +
  14433. +typedef struct ISDN_DW_ABC_LCR {
  14434. +
  14435. + struct list_head dll;
  14436. + char lcr_printbuf[64 + ISDN_MSNLEN + ISDN_MSNLEN];
  14437. + char *lcr_poin;
  14438. + char *lcr_epoin;
  14439. +
  14440. +} ISDN_DW_ABC_LCR;
  14441. +
  14442. +static LIST_HEAD(lcr_dll);
  14443. +static atomic_t lcr_open_count = ATOMIC_INIT(0);
  14444. +static volatile ulong lcr_call_counter = 0;
  14445. +
  14446. +
  14447. +static int myjiftime(char *p,u_long nj)
  14448. +{
  14449. + sprintf(p,"%02ld:%02ld.%02ld",
  14450. + ((nj / 100) / 60) % 100, (nj / 100) % 60,nj % 100);
  14451. +
  14452. + return(8);
  14453. +}
  14454. +
  14455. +
  14456. +static void dw_lcr_clear_all(void)
  14457. +{
  14458. + struct list_head *lh;
  14459. +
  14460. + if(!LCR_LOCK()) {
  14461. +
  14462. + while((lh = lcr_dll.next) != &lcr_dll) {
  14463. +
  14464. + ISDN_DW_ABC_LCR *p = list_entry(lh,ISDN_DW_ABC_LCR,dll);
  14465. + list_del(&p->dll);
  14466. + kfree(p);
  14467. + }
  14468. +
  14469. + LCR_ULOCK();
  14470. + }
  14471. +}
  14472. +
  14473. +void isdn_dw_abc_lcr_open(void)
  14474. +{ atomic_inc(&lcr_open_count); }
  14475. +
  14476. +void isdn_dw_abc_lcr_close(void)
  14477. +{
  14478. + if(atomic_dec_and_test(&lcr_open_count))
  14479. + dw_lcr_clear_all();
  14480. +}
  14481. +
  14482. +int isdn_dw_abc_lcr_lock(void)
  14483. +{ return(LCR_LOCK()); }
  14484. +
  14485. +void isdn_dw_abc_lcr_ulock(void)
  14486. +{ LCR_ULOCK(); }
  14487. +
  14488. +
  14489. +size_t isdn_dw_abc_lcr_readstat(char *buf,size_t count)
  14490. +{
  14491. + size_t retw = 0;
  14492. +
  14493. + while(buf != NULL && count > 0) {
  14494. +
  14495. + struct list_head *lh = NULL;
  14496. + ISDN_DW_ABC_LCR *p = NULL;
  14497. + char *dp = NULL;
  14498. + size_t n;
  14499. +
  14500. + if((n = LCR_LOCK())) {
  14501. +
  14502. + if(!retw)
  14503. + retw = n;
  14504. +
  14505. + break;
  14506. + }
  14507. +
  14508. +
  14509. + while((lh = lcr_dll.next) != &lcr_dll) {
  14510. +
  14511. + p = list_entry(lh,ISDN_DW_ABC_LCR,dll);
  14512. +
  14513. + if(p->lcr_poin >= p->lcr_epoin) {
  14514. +
  14515. + list_del(&p->dll);
  14516. + kfree(p);
  14517. + p = NULL;
  14518. +
  14519. + } else break;
  14520. + }
  14521. +
  14522. + if(p == NULL) {
  14523. +
  14524. + LCR_ULOCK();
  14525. + break;
  14526. + }
  14527. +
  14528. + n = p->lcr_epoin - p->lcr_poin;
  14529. +
  14530. + if(n > count)
  14531. + n = count;
  14532. +
  14533. + dp = p->lcr_poin;
  14534. + p->lcr_poin += n;
  14535. + retw += n;
  14536. + LCR_ULOCK();
  14537. + copy_to_user(buf,dp,n);
  14538. + buf += n;
  14539. + }
  14540. +
  14541. + return(retw);
  14542. +}
  14543. +
  14544. +
  14545. +static void isdn_dw_abc_lcr_clear_helper(isdn_net_local *lp)
  14546. +{
  14547. + if(lp != NULL) {
  14548. +
  14549. + void *a,*b;
  14550. +
  14551. + a = lp->dw_abc_lcr_cmd;
  14552. + b = lp->dw_abc_lcr_io;
  14553. + lp->dw_abc_lcr_io = NULL;
  14554. + lp->dw_abc_lcr_cmd = NULL;
  14555. + lp->dw_abc_lcr_callid =
  14556. + lp->dw_abc_lcr_start_request =
  14557. + lp->dw_abc_lcr_end_request = 0;
  14558. +
  14559. + if(a) kfree(a);
  14560. + if(b) kfree(b);
  14561. + }
  14562. +}
  14563. +
  14564. +void isdn_dw_abc_lcr_clear(isdn_net_local *lp)
  14565. +{
  14566. + if(!LCR_LOCK()) {
  14567. + isdn_dw_abc_lcr_clear_helper(lp);
  14568. + LCR_ULOCK();
  14569. + }
  14570. +}
  14571. +
  14572. +
  14573. +u_long isdn_dw_abc_lcr_call_number( isdn_net_local *lp,isdn_ctrl *call_cmd)
  14574. +{
  14575. + u_long mid = 0;
  14576. +
  14577. + if(LCR_LOCK())
  14578. + return(0);
  14579. +
  14580. + isdn_dw_abc_lcr_clear_helper(lp);
  14581. +
  14582. + if( atomic_read(&lcr_open_count) > 0 &&
  14583. + lp != NULL &&
  14584. + call_cmd != NULL) {
  14585. +
  14586. + ISDN_DW_ABC_LCR *lc = NULL;
  14587. + int ab = 0;
  14588. +
  14589. + if((lp->dw_abc_lcr_cmd =
  14590. + ( isdn_ctrl *)kmalloc(sizeof(isdn_ctrl),GFP_ATOMIC)) == NULL) {
  14591. +
  14592. +no_mem_out:;
  14593. + isdn_dw_abc_lcr_clear_helper(lp);
  14594. + LCR_ULOCK();
  14595. + printk(KERN_DEBUG "%s %d : LCR no memory\n",__FILE__,__LINE__);
  14596. + return(0);
  14597. + }
  14598. +
  14599. + memcpy(lp->dw_abc_lcr_cmd,call_cmd,sizeof(*call_cmd));
  14600. + while(!(lp->dw_abc_lcr_callid = mid = lcr_call_counter++));
  14601. +
  14602. + lp->dw_abc_lcr_end_request = lp->dw_abc_lcr_start_request = jiffies;
  14603. + lp->dw_abc_lcr_end_request += HZ * 3;
  14604. +
  14605. + if((lc = (ISDN_DW_ABC_LCR *)kmalloc(sizeof(*lc),GFP_KERNEL)) == NULL)
  14606. + goto no_mem_out;
  14607. +
  14608. + lc->lcr_poin = lc->lcr_epoin = lc->lcr_printbuf;
  14609. + lc->lcr_epoin += myjiftime(lc->lcr_epoin,jiffies);
  14610. +
  14611. + sprintf(lc->lcr_epoin," DW_ABC_LCR\t%lu\t%.*s\t%.*s\n",
  14612. + mid,
  14613. + (int)ISDN_MSNLEN,
  14614. + call_cmd->parm.setup.eazmsn,
  14615. + (int)ISDN_MSNLEN,
  14616. + call_cmd->parm.setup.phone);
  14617. +
  14618. + lc->lcr_epoin += strlen(lc->lcr_epoin);
  14619. + ab = lc->lcr_epoin - lc->lcr_poin;
  14620. +
  14621. + list_add_tail(&lc->dll,&lcr_dll);
  14622. + LCR_ULOCK();
  14623. +
  14624. + if(ab > 0) {
  14625. +
  14626. + if(dev->drv[0] != NULL ) {
  14627. +
  14628. + dev->drv[0]->stavail += ab;
  14629. + wake_up_interruptible(&dev->drv[0]->st_waitq);
  14630. + }
  14631. + }
  14632. +
  14633. + } else LCR_ULOCK();
  14634. +
  14635. + return(mid);
  14636. +}
  14637. +
  14638. +
  14639. +int isdn_dw_abc_lcr_ioctl(u_long arg)
  14640. +{
  14641. + struct ISDN_DWABC_LCR_IOCTL i;
  14642. + int need = sizeof(struct ISDN_DWABC_LCR_IOCTL);
  14643. + isdn_net_dev *p;
  14644. +
  14645. + memset(&i,0,sizeof(struct ISDN_DWABC_LCR_IOCTL));
  14646. + copy_from_user(&i,(char *)arg,sizeof(int));
  14647. +
  14648. + if(i.lcr_ioctl_sizeof < need)
  14649. + need = i.lcr_ioctl_sizeof;
  14650. +
  14651. + if(need > 0)
  14652. + copy_from_user(&i,(char *)arg,need);
  14653. +
  14654. + if(LCR_LOCK())
  14655. + return(-EAGAIN);
  14656. +
  14657. + p = dev->netdev;
  14658. +
  14659. + for(;p ; p = p->next) {
  14660. +
  14661. + isdn_net_local *lp = p->local;
  14662. +
  14663. + if( lp->dw_abc_lcr_callid != i.lcr_ioctl_callid)
  14664. + continue;
  14665. +
  14666. + if(lp->dw_abc_lcr_cmd == NULL)
  14667. + continue;
  14668. +
  14669. + if(lp->dw_abc_lcr_io == NULL)
  14670. + lp->dw_abc_lcr_io = (struct ISDN_DWABC_LCR_IOCTL *)
  14671. + kmalloc(sizeof(struct ISDN_DWABC_LCR_IOCTL),GFP_ATOMIC);
  14672. +
  14673. + if(lp->dw_abc_lcr_io == NULL) {
  14674. +
  14675. + printk(KERN_DEBUG "%s %d : no memory\n",__FILE__,__LINE__);
  14676. + continue;
  14677. + }
  14678. +
  14679. + memcpy(lp->dw_abc_lcr_io,&i,sizeof(struct ISDN_DWABC_LCR_IOCTL));
  14680. +
  14681. + if(i.lcr_ioctl_flags & DWABC_LCR_FLG_NEWNUMBER) {
  14682. +
  14683. + char *xx = i.lcr_ioctl_nr;
  14684. + char *exx = xx + sizeof(i.lcr_ioctl_nr);
  14685. + char *d = lp->dw_abc_lcr_cmd->parm.setup.phone;
  14686. + char *ed = d + sizeof(lp->dw_abc_lcr_cmd->parm.setup.phone) - 1;
  14687. +
  14688. + while(d < ed && xx < exx && *xx) *(d++) = *(xx++);
  14689. + while(d < ed) *(d++) = 0;
  14690. + *d = 0;
  14691. + }
  14692. + }
  14693. +
  14694. + LCR_ULOCK();
  14695. + return(0);
  14696. +}
  14697. +
  14698. +#endif
  14699. +
  14700. +
  14701. +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
  14702. +int dw_abc_udp_test(struct sk_buff *skb,struct net_device *ndev)
  14703. +{
  14704. + if(ndev != NULL && skb != NULL && skb->protocol == htons(ETH_P_IP)) {
  14705. +
  14706. + struct iphdr *iph = (struct iphdr *)skb->data;
  14707. + isdn_net_local *lp = (isdn_net_local *) ndev->priv;
  14708. + int rklen = skb->len;
  14709. +
  14710. + if (skb->nh.raw > skb->data && skb->nh.raw < skb->tail) {
  14711. +
  14712. + rklen -= (char *)skb->nh.raw - (char *)skb->data;
  14713. + iph = (struct iphdr *)skb->nh.raw;
  14714. + }
  14715. +
  14716. + if(rklen >= 20 && iph->version == 4 &&
  14717. + !(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_UDP_CHECK)) {
  14718. +
  14719. + if( iph->tot_len == NBYTEORDER_30BYTES &&
  14720. + iph->protocol == IPPROTO_UDP) {
  14721. +
  14722. + struct udphdr *udp =
  14723. + (struct udphdr *)((char *)iph + (iph->ihl << 2));
  14724. +
  14725. + ushort usrc = ntohs(udp->source);
  14726. +
  14727. + if( udp->dest == htons(25001) &&
  14728. + usrc >= 20000 && usrc < 25000) {
  14729. +
  14730. + char *p = (char *)(udp + 1);
  14731. +
  14732. + if(p[0] == p[1]) {
  14733. +
  14734. + char mc = 0;
  14735. +
  14736. + switch(*p) {
  14737. + case 0x30:
  14738. +
  14739. + mc = *p;
  14740. +
  14741. + if((lp->flags & ISDN_NET_CONNECTED) && (!lp->dialstate))
  14742. + mc++;
  14743. +
  14744. + break;
  14745. +
  14746. + case 0x32:
  14747. +
  14748. + mc = *p;
  14749. +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
  14750. + if((lp->flags & ISDN_NET_CONNECTED) && (!lp->dialstate)) {
  14751. +
  14752. + mc++;
  14753. + break;
  14754. + }
  14755. +
  14756. + if(!isdn_net_force_dial_lp(lp)) mc++;
  14757. +#endif
  14758. + break;
  14759. +
  14760. + case 0x11:
  14761. + mc = *p + 1;
  14762. + isdn_dw_abc_reset_interface(lp,1);
  14763. + break;
  14764. +
  14765. + case 0x28: mc = *p + 1; break;
  14766. + case 0x2a:
  14767. + case 0x2c:
  14768. +
  14769. + mc = *p;
  14770. +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
  14771. + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_UDP_HANGUP)) {
  14772. +
  14773. + if(lp->isdn_device >= 0) {
  14774. +
  14775. + isdn_net_hangup(ndev);
  14776. + mc = *p + 1;
  14777. + }
  14778. + }
  14779. +#endif
  14780. + break;
  14781. + }
  14782. +
  14783. + if(mc) {
  14784. +
  14785. + struct sk_buff *nskb;
  14786. + int need = 2+sizeof(struct iphdr)+sizeof(struct udphdr);
  14787. + int hneed = need + ndev->hard_header_len;
  14788. +
  14789. + if((nskb = (struct sk_buff *)dev_alloc_skb(hneed)) != NULL) {
  14790. +
  14791. + ushort n = sizeof(struct udphdr) + 2;
  14792. + struct iphdr *niph;
  14793. + struct udphdr *nup;
  14794. + skb_reserve(nskb,ndev->hard_header_len);
  14795. +
  14796. + if((niph = (struct iphdr *)skb_put(nskb,need))==NULL){
  14797. +
  14798. + printk(KERN_DEBUG "%s: skb_put failt (%d bytes)\n", lp->name,hneed);
  14799. + dev_kfree_skb(nskb);
  14800. + return(0);
  14801. + }
  14802. +
  14803. + nup = (struct udphdr *)(niph + 1);
  14804. + ((char *)(nup + 1))[0] = mc;
  14805. + ((char *)(nup + 1))[1] = mc;
  14806. + nup->source=udp->dest;
  14807. + nup->dest=udp->source;
  14808. + nup->len=htons(n);
  14809. + nup->check=0; /* dont need checksum */
  14810. + memset((void *)niph,0,sizeof(*niph));
  14811. + niph->version=4;
  14812. + niph->ihl=5;
  14813. + niph->tot_len=NBYTEORDER_30BYTES;
  14814. + niph->ttl = 32;
  14815. + niph->protocol = IPPROTO_UDP;
  14816. + niph->saddr=iph->daddr;
  14817. + niph->daddr=iph->saddr;
  14818. + niph->id=iph->id;
  14819. + niph->check=ip_fast_csum((unsigned char *)niph,niph->ihl);
  14820. + nskb->dev = ndev;
  14821. + nskb->pkt_type = PACKET_HOST;
  14822. + nskb->protocol = htons(ETH_P_IP);
  14823. + nskb->mac.raw = nskb->data;
  14824. + netif_rx(nskb);
  14825. + }
  14826. +
  14827. + return(1);
  14828. + }
  14829. + }
  14830. + }
  14831. + }
  14832. + }
  14833. + }
  14834. +
  14835. + return(0);
  14836. +}
  14837. +#endif
  14838. +
  14839. +
  14840. +void isdn_dw_clear_if(ulong pm,isdn_net_local *lp)
  14841. +{
  14842. + if(lp != NULL) {
  14843. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  14844. + isdn_dw_abc_lcr_clear(lp);
  14845. +#endif
  14846. + }
  14847. +}
  14848. +
  14849. +
  14850. +
  14851. +static void dw_abc_timer_func(u_long dont_need_yet)
  14852. +{
  14853. + register u_long t;
  14854. +
  14855. + if(!((t = ++isdn_dwabc_jiffies.msec_100) & 1))
  14856. + if(isdn_dwabc_jiffies.msec_200++ & 1)
  14857. + isdn_dwabc_jiffies.msec_400++;
  14858. +
  14859. + if(!(t % 5))
  14860. + if(isdn_dwabc_jiffies.msec_500++ & 1)
  14861. + isdn_dwabc_jiffies.msec_1000++;
  14862. +
  14863. + dw_abc_timer.expires = jiffies + DWABC_TMRES;
  14864. + add_timer(&dw_abc_timer);
  14865. +}
  14866. +
  14867. +
  14868. +void isdn_dw_abc_init_func(void)
  14869. +{
  14870. +
  14871. + init_timer(&dw_abc_timer);
  14872. + dw_abc_timer.function = dw_abc_timer_func;
  14873. +
  14874. +
  14875. + printk( KERN_INFO
  14876. + "abc-extension %s Kernel 0x%06X\n"
  14877. + "written by\nDetlef Wengorz <[email protected]>\n"
  14878. + "Installed options:\n"
  14879. +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
  14880. + "CONFIG_ISDN_WITH_ABC_CALLB\n"
  14881. +#endif
  14882. +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
  14883. + "CONFIG_ISDN_WITH_ABC_UDP_CHECK\n"
  14884. +#endif
  14885. +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
  14886. + "CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP\n"
  14887. +#endif
  14888. +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
  14889. + "CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL\n"
  14890. +#endif
  14891. +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  14892. + "CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ\n"
  14893. +#endif
  14894. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  14895. + "CONFIG_ISDN_WITH_ABC_LCR_SUPPORT\n"
  14896. +#endif
  14897. +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
  14898. + "CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER\n"
  14899. +#endif
  14900. +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
  14901. + "CONFIG_ISDN_WITH_ABC_CH_EXTINUSE\n"
  14902. +#endif
  14903. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  14904. + "CONFIG_ISDN_WITH_ABC_CONN_ERROR\n"
  14905. +#endif
  14906. +#ifdef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
  14907. + "CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS\n"
  14908. +#endif
  14909. + "loaded\n",
  14910. + dwabcrevison,LINUX_VERSION_CODE);
  14911. + dwsjiffies = 0;
  14912. + dw_abc_timer.expires = jiffies + DWABC_TMRES;
  14913. + add_timer(&dw_abc_timer);
  14914. +}
  14915. +
  14916. +void isdn_dw_abc_release_func(void)
  14917. +{
  14918. + del_timer(&dw_abc_timer);
  14919. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  14920. + dw_lcr_clear_all();
  14921. +#endif
  14922. + printk( KERN_INFO
  14923. + "abc-extension %s Kernel 0x%06X\n"
  14924. + "written by\n"
  14925. + "Detlef Wengorz <[email protected]>\n"
  14926. + "unloaded\n",
  14927. + dwabcrevison,LINUX_VERSION_CODE);
  14928. +}
  14929. +
  14930. +
  14931. +void isdn_dwabc_test_phone(isdn_net_local *lp)
  14932. +{
  14933. + if(lp != NULL) {
  14934. +
  14935. + isdn_net_phone *h = lp->phone[0];
  14936. + ulong oflags = lp->dw_abc_flags;
  14937. + int secure = 0;
  14938. +
  14939. + lp->dw_abc_flags = 0;
  14940. +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  14941. + *lp->dw_out_msn = 0;
  14942. +#endif
  14943. +
  14944. + for(;h != NULL && secure < 1000;secure++,h = h->next) {
  14945. +
  14946. + char *p = h->num;
  14947. + char *ep = p + ISDN_MSNLEN;
  14948. +
  14949. + for(;p < ep && *p && (*p <= ' ' || *p == '"' || *p == '\'');p++);
  14950. +
  14951. + if(p >= ep)
  14952. + continue;
  14953. +
  14954. +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  14955. + if(*p == '>') {
  14956. +
  14957. + if(++p < ep && *p != '<' && *p != '>') {
  14958. +
  14959. + char *d = lp->dw_out_msn;
  14960. +
  14961. + for(;*p && (p < ep) && (*p == ' ' || *p == '\t');p++);
  14962. + for(ep--;*p && (p < ep);) *(d++) = *(p++);
  14963. + *d = 0;
  14964. + continue;
  14965. + }
  14966. + }
  14967. +#endif
  14968. +
  14969. + if(*p == '~') {
  14970. +
  14971. + /* abc switch's */
  14972. +
  14973. + for(p++;p < ep && *p;p++) switch(*p) {
  14974. + case 'u': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_UDP_CHECK; break;
  14975. + case 'h': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_UDP_HANGUP; break;
  14976. + case 'd': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_UDP_DIAL; break;
  14977. + case 'c': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE; break;
  14978. + case 'e': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_CONN_ERROR; break;
  14979. + case 'l': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_NO_LCR; break;
  14980. +
  14981. + case 'x':
  14982. + case 'X': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER; break;
  14983. +
  14984. + case 'B': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_BSD_COMPRESS; break;
  14985. + case 'L': lp->dw_abc_flags |= ISDN_DW_ABC_FLAG_LEASED_LINE; break;
  14986. +
  14987. + case '"':
  14988. + case ' ':
  14989. + case '\t':
  14990. + case '\'': break;
  14991. +
  14992. + default:
  14993. + printk(KERN_DEBUG"isdn_net: %s abc-switch <~%c> unknown\n",lp->name,*p);
  14994. + break;
  14995. + }
  14996. + }
  14997. + }
  14998. +
  14999. + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_LEASED_LINE) {
  15000. +
  15001. + lp->dw_abc_flags |=
  15002. + ISDN_DW_ABC_FLAG_NO_UDP_CHECK |
  15003. + ISDN_DW_ABC_FLAG_NO_UDP_HANGUP |
  15004. + ISDN_DW_ABC_FLAG_NO_UDP_DIAL |
  15005. + ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE |
  15006. + ISDN_DW_ABC_FLAG_NO_CONN_ERROR |
  15007. + ISDN_DW_ABC_FLAG_NO_LCR;
  15008. + }
  15009. +
  15010. + if(dev->net_verbose && (lp->dw_abc_flags != oflags || dev->net_verbose > 4))
  15011. + printk(KERN_DEBUG "isdn_net %s abc-flags 0x%lx\n",lp->name,lp->dw_abc_flags);
  15012. +
  15013. + }
  15014. +}
  15015. +
  15016. +
  15017. +int isdn_dw_abc_reset_interface(isdn_net_local *lp,int with_message)
  15018. +{
  15019. + int r = -EINVAL;
  15020. +
  15021. + if(lp != NULL) {
  15022. +
  15023. + r = 0;
  15024. +
  15025. + lp->dw_abc_bchan_last_connect = 0;
  15026. + lp->dw_abc_dialstart = 0;
  15027. + lp->dw_abc_inuse_secure = 0;
  15028. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  15029. + lp->dw_abc_bchan_errcnt = 0;
  15030. +#endif
  15031. +
  15032. + if(with_message && dev->net_verbose > 0)
  15033. + printk(KERN_INFO
  15034. + "%s: NOTE: reset (clear) abc-interface-secure-counter\n",
  15035. + lp->name);
  15036. + }
  15037. +
  15038. + return(r);
  15039. +}
  15040. +
  15041. +
  15042. +#if CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS && CONFIG_ISDN_PPP
  15043. +
  15044. +#define DWBSD_PKT_FIRST_LEN 16
  15045. +#define DWBSD_PKT_SWITCH 165
  15046. +#define DWBSD_PKT_BSD 189
  15047. +
  15048. +#define DWBSD_VERSION 0x2
  15049. +
  15050. +void dwabc_bsd_first_gen(isdn_net_local *lp)
  15051. +{
  15052. + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
  15053. + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS)) {
  15054. +
  15055. + struct sk_buff *skb = NULL;
  15056. + char *p = NULL;
  15057. + char *ep = NULL;
  15058. +
  15059. + if((skb =(struct sk_buff *)dev_alloc_skb(128)) == NULL) {
  15060. +
  15061. + printk(KERN_INFO "%s: dwabc: alloc-skb failed for 128 bytes\n",lp->name);
  15062. + return;
  15063. + }
  15064. +
  15065. + skb_reserve(skb,64);
  15066. + p = skb_put(skb,DWBSD_PKT_FIRST_LEN);
  15067. + ep = p + DWBSD_PKT_FIRST_LEN;
  15068. +
  15069. + *(p++) = DWBSD_PKT_SWITCH;
  15070. + *(p++) = DWBSD_VERSION;
  15071. + for(;p < ep;p++) *(p++) = 0;
  15072. +
  15073. + isdn_net_write_super(lp, skb);
  15074. +
  15075. + if(dev->net_verbose > 2)
  15076. + printk(KERN_INFO "%s: dwabc: sending comm-header version 0x%x\n",lp->name,DWBSD_VERSION);
  15077. + }
  15078. +}
  15079. +
  15080. +
  15081. +void dwabc_bsd_free(isdn_net_local *lp)
  15082. +{
  15083. + if(lp != NULL) {
  15084. +
  15085. + if(lp->dw_abc_bsd_stat_rx || lp->dw_abc_bsd_stat_tx) {
  15086. +
  15087. + struct isdn_ppp_compressor *c = NULL;
  15088. +
  15089. + if(!(c = (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor)) {
  15090. +
  15091. + printk(KERN_WARNING
  15092. + "%s: PANIC: freeing bsd compressmemory without compressor\n",
  15093. + lp->name);
  15094. +
  15095. + } else {
  15096. +
  15097. + if(lp->dw_abc_bsd_stat_rx) (*c->free)(lp->dw_abc_bsd_stat_rx);
  15098. + if(lp->dw_abc_bsd_stat_tx) (*c->free)(lp->dw_abc_bsd_stat_tx);
  15099. +
  15100. + if(dev->net_verbose > 2)
  15101. + printk(KERN_INFO
  15102. + "%s: free bsd compress-memory\n",
  15103. + lp->name);
  15104. + }
  15105. + }
  15106. +
  15107. + lp->dw_abc_bsd_compressor = NULL;
  15108. + lp->dw_abc_bsd_stat_rx = NULL;
  15109. + lp->dw_abc_bsd_stat_tx = NULL;
  15110. + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_BSDAKTIV;
  15111. +
  15112. + if(dev->net_verbose > 0) {
  15113. +
  15114. + if(lp->dw_abc_bsd_rcv != lp->dw_abc_bsd_bsd_rcv) {
  15115. +
  15116. + printk(KERN_INFO "%s: Receive %lu<-%lu kb\n",lp->name,
  15117. + lp->dw_abc_bsd_rcv >> 10 , lp->dw_abc_bsd_bsd_rcv >> 10);
  15118. + }
  15119. +
  15120. +
  15121. + if(lp->dw_abc_bsd_snd != lp->dw_abc_bsd_bsd_snd) {
  15122. +
  15123. + printk(KERN_INFO "%s: Send %lu->%lu kb\n",lp->name,
  15124. + lp->dw_abc_bsd_snd >> 10 , lp->dw_abc_bsd_bsd_snd >> 10);
  15125. + }
  15126. + }
  15127. +
  15128. + lp->dw_abc_bsd_rcv =
  15129. + lp->dw_abc_bsd_bsd_rcv =
  15130. + lp->dw_abc_bsd_snd =
  15131. + lp->dw_abc_bsd_bsd_snd = 0;
  15132. + }
  15133. +}
  15134. +
  15135. +
  15136. +int dwabc_bsd_init(isdn_net_local *lp)
  15137. +{
  15138. + int r = 1;
  15139. +
  15140. + if(lp != NULL) {
  15141. +
  15142. + dwabc_bsd_free(lp);
  15143. +
  15144. + if(lp->p_encap == ISDN_NET_ENCAP_RAWIP) {
  15145. +
  15146. + void *rx = NULL;
  15147. + void *tx = NULL;
  15148. + struct isdn_ppp_comp_data *cp = NULL;
  15149. + struct isdn_ppp_compressor *c = NULL;
  15150. +
  15151. + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) do {
  15152. +
  15153. + for(c = ipc_head ;
  15154. + c != NULL && c->num != CI_BSD_COMPRESS; c = c->next);
  15155. +
  15156. + if(c == NULL) {
  15157. +
  15158. + printk(KERN_INFO
  15159. + "%s: Module isdn_bsdcompress not loaded\n",
  15160. + lp->name);
  15161. +
  15162. + break;
  15163. + }
  15164. +
  15165. + cp = (struct isdn_ppp_comp_data *)
  15166. + kmalloc(sizeof(struct isdn_ppp_comp_data),GFP_ATOMIC);
  15167. +
  15168. + if(cp == NULL) {
  15169. +
  15170. + printk(KERN_INFO
  15171. + "%s: allocation of isdn_ppp_comp_data failed\n",
  15172. + lp->name);
  15173. +
  15174. + break;
  15175. + }
  15176. +
  15177. + memset(cp,0,sizeof(*cp));
  15178. + cp->num = CI_BSD_COMPRESS;
  15179. + cp->optlen = 1;
  15180. +
  15181. + /*
  15182. + ** set BSD_VERSION 1 and 12 bits compressmode
  15183. + */
  15184. + *cp->options = (1 << 5) | 12;
  15185. +
  15186. + if((rx = (*c->alloc)(cp)) == NULL) {
  15187. +
  15188. + printk(KERN_INFO
  15189. + "%s: allocation of bsd rx-memory failed\n",
  15190. + lp->name);
  15191. +
  15192. + break;
  15193. + }
  15194. +
  15195. + if(!(*c->init)(rx,cp,0,1)) {
  15196. +
  15197. + printk(KERN_INFO
  15198. + "%s: init of bsd rx-stream failed\n",lp->name);
  15199. +
  15200. + break;
  15201. + }
  15202. +
  15203. + cp->flags = IPPP_COMP_FLAG_XMIT;
  15204. +
  15205. + if((tx = (*c->alloc)(cp)) == NULL) {
  15206. +
  15207. + printk(KERN_INFO
  15208. + "%s: allocation of bsd tx-memory failed\n",
  15209. + lp->name);
  15210. +
  15211. + break;
  15212. + }
  15213. +
  15214. + if(!(*c->init)(tx,cp,0,1)) {
  15215. +
  15216. + printk(KERN_INFO
  15217. + "%s: init of bsd tx-stream failed\n",
  15218. + lp->name);
  15219. +
  15220. + break;
  15221. + }
  15222. +
  15223. + lp->dw_abc_bsd_compressor = (void *)c;
  15224. + lp->dw_abc_bsd_stat_rx = rx;
  15225. + lp->dw_abc_bsd_stat_tx = tx;
  15226. + rx = tx = NULL;
  15227. + r = 0;
  15228. +
  15229. + if(dev->net_verbose > 2)
  15230. + printk(KERN_INFO
  15231. + "%s: bsd compress-memory and init ok\n",
  15232. + lp->name);
  15233. +
  15234. + } while(0);
  15235. +
  15236. + if(cp != NULL)
  15237. + kfree(cp);
  15238. +
  15239. + if(c != NULL) {
  15240. +
  15241. + if(tx != NULL) (*c->free)(tx);
  15242. + if(rx != NULL) (*c->free)(rx);
  15243. + }
  15244. +
  15245. + } else if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) {
  15246. +
  15247. + printk(KERN_INFO
  15248. + "%s: bsd-compress only with encapsulation rawip allowed\n",
  15249. + lp->name);
  15250. + }
  15251. + }
  15252. +
  15253. + return(r);
  15254. +}
  15255. +
  15256. +struct sk_buff *dwabc_bsd_compress( isdn_net_local *lp,
  15257. + struct sk_buff *skb,
  15258. + struct net_device *ndev)
  15259. +{
  15260. + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
  15261. + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS) &&
  15262. + (lp->dw_abc_if_flags & ISDN_DW_ABC_IFFLAG_BSDAKTIV)) {
  15263. +
  15264. + if(lp->dw_abc_bsd_stat_tx != NULL && lp->dw_abc_bsd_compressor) {
  15265. +
  15266. + struct isdn_ppp_compressor *cp =
  15267. + (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor;
  15268. +
  15269. + struct sk_buff *nskb = (struct sk_buff *)
  15270. + dev_alloc_skb(skb->len * 2 + ndev->hard_header_len);
  15271. +
  15272. + int l = 0;
  15273. +
  15274. + if(nskb == NULL) {
  15275. +
  15276. + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
  15277. + printk(KERN_INFO "%s: dwabc-compress no memory\n",lp->name);
  15278. +
  15279. + } else {
  15280. +
  15281. + skb_reserve(nskb,ndev->hard_header_len);
  15282. + *(unsigned char *)skb_put(nskb,1) = DWBSD_PKT_BSD;
  15283. + l = (*cp->compress)(lp->dw_abc_bsd_stat_tx,skb,nskb,0x21);
  15284. +
  15285. + if(l < 1 || l > skb->len) {
  15286. +
  15287. + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
  15288. + dev_kfree_skb(nskb);
  15289. +
  15290. + } else {
  15291. +
  15292. + u_short sqnr;
  15293. +
  15294. + dev_kfree_skb(skb);
  15295. + skb = nskb;
  15296. + sqnr = ((*(u_char *)skb->data) << 8) +
  15297. + ((u_char)skb->data[1]);
  15298. +
  15299. + if(sqnr > 65500)
  15300. + (void)(*cp->reset)
  15301. + (lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
  15302. + }
  15303. + }
  15304. + }
  15305. + }
  15306. +
  15307. + return(skb);
  15308. +}
  15309. +
  15310. +struct sk_buff *dwabc_bsd_rx_pkt( isdn_net_local *lp,
  15311. + struct sk_buff *skb,
  15312. + struct net_device *ndev)
  15313. +{
  15314. + struct sk_buff *r = skb;
  15315. +
  15316. + if(lp != NULL && lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
  15317. + (lp->dw_abc_flags & ISDN_DW_ABC_FLAG_BSD_COMPRESS)) {
  15318. +
  15319. + unsigned char *p = (unsigned char *)skb->data;
  15320. + struct isdn_ppp_compressor *cp =
  15321. + (struct isdn_ppp_compressor *)lp->dw_abc_bsd_compressor;
  15322. +
  15323. + if(*p == DWBSD_PKT_SWITCH) {
  15324. +
  15325. + if(skb->len == DWBSD_PKT_FIRST_LEN) {
  15326. +
  15327. + if((lp->dw_abc_remote_version = p[1]) < 0x2) {
  15328. +
  15329. + printk(KERN_INFO
  15330. + "%s: I can't really talk with remote version 0x%x\n"
  15331. + "Please upgrade remote or disable rawip-compression\n",
  15332. + lp->name,
  15333. + p[1]);
  15334. + }
  15335. +
  15336. + lp->dw_abc_if_flags |= ISDN_DW_ABC_IFFLAG_BSDAKTIV;
  15337. + dev_kfree_skb(skb);
  15338. +
  15339. + if(cp && lp->dw_abc_bsd_stat_tx)
  15340. + (void)(*cp->reset)(lp->dw_abc_bsd_stat_tx,0,0,NULL,0,NULL);
  15341. +
  15342. + if(dev->net_verbose > 2)
  15343. + printk(KERN_INFO
  15344. + "%s: receive comm-header rem-version 0x%02x\n",
  15345. + lp->name,
  15346. + lp->dw_abc_remote_version);
  15347. +
  15348. + return(NULL);
  15349. + }
  15350. +
  15351. + } else if(*p == DWBSD_PKT_BSD && lp->dw_abc_bsd_stat_rx != NULL && cp) {
  15352. +
  15353. + struct sk_buff *nskb = NULL;
  15354. +
  15355. + if(test_and_set_bit(ISDN_DW_ABC_BITLOCK_RECEIVE,
  15356. + &lp->dw_abc_bitlocks)) {
  15357. +
  15358. + printk(KERN_INFO "%s: bsd-decomp called recursivly\n",lp->name);
  15359. + dev_kfree_skb(skb);
  15360. + dwabc_bsd_first_gen(lp);
  15361. + return(NULL);
  15362. + }
  15363. +
  15364. + nskb = (struct sk_buff *)
  15365. + dev_alloc_skb(2048 + ndev->hard_header_len);
  15366. +
  15367. + if(nskb != NULL) {
  15368. +
  15369. + int l = 0;
  15370. + u_short sqnr;
  15371. +
  15372. + skb_reserve(nskb,ndev->hard_header_len);
  15373. + skb_pull(skb, 1);
  15374. + sqnr = ((*(u_char *)skb->data) << 8) | ((u_char)skb->data[1]);
  15375. +
  15376. + if(!sqnr && cp && lp->dw_abc_bsd_stat_rx)
  15377. + (void)(*cp->reset)(lp->dw_abc_bsd_stat_rx,0,0,NULL,0,NULL);
  15378. +
  15379. + if((l = (*cp->decompress)
  15380. + (lp->dw_abc_bsd_stat_rx,skb,nskb,NULL)) < 1 || l>8000) {
  15381. +
  15382. + printk(KERN_INFO "%s: abc-decomp failed\n",lp->name);
  15383. + dev_kfree_skb(nskb);
  15384. + dev_kfree_skb(skb);
  15385. + nskb = NULL;
  15386. + dwabc_bsd_first_gen(lp);
  15387. +
  15388. + } else {
  15389. +
  15390. + if (nskb->data[0] & 0x1)
  15391. + skb_pull(nskb, 1); /* protocol ID is only 8 bit */
  15392. + else
  15393. + skb_pull(nskb, 2);
  15394. +
  15395. + nskb->dev = skb->dev;
  15396. + nskb->pkt_type = skb->pkt_type;
  15397. + nskb->mac.raw = nskb->data;
  15398. + dev_kfree_skb(skb);
  15399. + }
  15400. +
  15401. + } else {
  15402. +
  15403. + printk(KERN_INFO "%s: PANIC abc-decomp no memory\n",lp->name);
  15404. + dev_kfree_skb(skb);
  15405. + dwabc_bsd_first_gen(lp);
  15406. + }
  15407. +
  15408. + clear_bit(ISDN_DW_ABC_BITLOCK_RECEIVE,&lp->dw_abc_bitlocks);
  15409. + r = nskb;
  15410. + }
  15411. + }
  15412. +
  15413. + return(r);
  15414. +}
  15415. +
  15416. +#else
  15417. +int dwabc_bsd_init(isdn_net_local *lp) { return(1); }
  15418. +void dwabc_bsd_free(isdn_net_local *lp) { return; }
  15419. +void dwabc_bsd_first_gen(isdn_net_local *lp) { return ; }
  15420. +
  15421. +struct sk_buff *dwabc_bsd_compress(isdn_net_local *lp,struct sk_buff *skb,struct net_device *ndev)
  15422. +{ return(skb); }
  15423. +
  15424. +struct sk_buff *dwabc_bsd_rx_pkt(isdn_net_local *lp,struct sk_buff *skb,struct net_device *ndev)
  15425. +{ return(skb); }
  15426. +#endif
  15427. +#endif
  15428. Index: linux-2.4.35.4/drivers/isdn/isdn_net.c
  15429. ===================================================================
  15430. --- linux-2.4.35.4.orig/drivers/isdn/isdn_net.c
  15431. +++ linux-2.4.35.4/drivers/isdn/isdn_net.c
  15432. @@ -1,4 +1,4 @@
  15433. -/* $Id: isdn_net.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  15434. +/* $Id: isdn_net.c,v 1.153 2002/08/17 18:35:23 detabc Exp $
  15435. *
  15436. * Linux ISDN subsystem, network interfaces and related functions (linklevel).
  15437. *
  15438. @@ -9,14 +9,6 @@
  15439. * This software may be used and distributed according to the terms
  15440. * of the GNU General Public License, incorporated herein by reference.
  15441. *
  15442. - * Data Over Voice (DOV) support added - Guy Ellis 23-Mar-02
  15443. - * [email protected]
  15444. - * Outgoing calls - looks for a 'V' in first char of dialed number
  15445. - * Incoming calls - checks first character of eaz as follows:
  15446. - * Numeric - accept DATA only - original functionality
  15447. - * 'V' - accept VOICE (DOV) only
  15448. - * 'B' - accept BOTH DATA and DOV types
  15449. - *
  15450. * Jan 2001: fix CISCO HDLC Bjoern A. Zeeb <[email protected]>
  15451. * for info on the protocol, see
  15452. * http://i4l.zabbadoz.net/i4l/cisco-hdlc.txt
  15453. @@ -38,6 +30,10 @@
  15454. #include "isdn_concap.h"
  15455. #endif
  15456. +#ifdef CONFIG_ISDN_WITH_ABC
  15457. +#include <linux/isdn_dwabc.h>
  15458. +#define isdn_net_log_skb(skb,lp) isdn_net_log_skb_dwabc(skb,lp,NULL)
  15459. +#endif
  15460. /*
  15461. * Outline of new tbusy handling:
  15462. @@ -79,7 +75,11 @@ static __inline__ int isdn_net_device_st
  15463. dev = lp->master;
  15464. else
  15465. dev = &n->dev;
  15466. +#ifdef COMPAT_NO_SOFTNET
  15467. + return dev->start;
  15468. +#else
  15469. return netif_running(dev);
  15470. +#endif
  15471. }
  15472. /*
  15473. @@ -143,6 +143,10 @@ static __inline__ void isdn_net_inc_fram
  15474. atomic_inc(&lp->frame_cnt);
  15475. if (isdn_net_device_busy(lp))
  15476. isdn_net_device_stop_queue(lp);
  15477. +#if 0
  15478. + printk(KERN_DEBUG "%s: inc_frame_cnt now %d\n", lp->name,
  15479. + atomic_read(&lp->frame_cnt));
  15480. +#endif
  15481. }
  15482. static __inline__ void isdn_net_dec_frame_cnt(isdn_net_local *lp)
  15483. @@ -157,11 +161,19 @@ static __inline__ void isdn_net_dec_fram
  15484. isdn_net_device_wake_queue(lp);
  15485. }
  15486. }
  15487. +#if 0
  15488. + printk(KERN_DEBUG "%s: dec_frame_cnt now %d\n", lp->name,
  15489. + atomic_read(&lp->frame_cnt));
  15490. +#endif
  15491. }
  15492. static __inline__ void isdn_net_zero_frame_cnt(isdn_net_local *lp)
  15493. {
  15494. atomic_set(&lp->frame_cnt, 0);
  15495. +#if 0
  15496. + printk(KERN_DEBUG "%s: zero_frame_cnt now %d\n", lp->name,
  15497. + atomic_read(&lp->frame_cnt));
  15498. +#endif
  15499. }
  15500. /* For 2.2.x we leave the transmitter busy timeout at 2 secs, just
  15501. @@ -173,23 +185,101 @@ static __inline__ void isdn_net_zero_fra
  15502. * which might rely on the tx timeout. If so, we'll find out this way...
  15503. */
  15504. +#ifdef COMPAT_NO_SOFTNET
  15505. +#define ISDN_NET_TX_TIMEOUT (2*HZ)
  15506. +#else
  15507. #define ISDN_NET_TX_TIMEOUT (20*HZ)
  15508. +#endif
  15509. /* Prototypes */
  15510. +#ifndef CONFIG_ISDN_WITH_ABC
  15511. int isdn_net_force_dial_lp(isdn_net_local *);
  15512. +#endif
  15513. static int isdn_net_start_xmit(struct sk_buff *, struct net_device *);
  15514. static void isdn_net_ciscohdlck_connected(isdn_net_local *lp);
  15515. static void isdn_net_ciscohdlck_disconnected(isdn_net_local *lp);
  15516. -char *isdn_net_revision = "$Revision: 1.1.4.1 $";
  15517. +char *isdn_net_revision = "$Revision: 1.153 $";
  15518. /*
  15519. * Code for raw-networking over ISDN
  15520. */
  15521. +#ifdef CONFIG_ISDN_WITH_ABC
  15522. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  15523. +static int isdn_dwabc_encap_with_conerr(isdn_net_local *lp)
  15524. +{
  15525. + if(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CONN_ERROR)
  15526. + return(0);
  15527. +
  15528. + return(
  15529. + lp->p_encap == ISDN_NET_ENCAP_SYNCPPP ||
  15530. + lp->p_encap == ISDN_NET_ENCAP_RAWIP ||
  15531. + lp->p_encap == ISDN_NET_ENCAP_CISCOHDLCK ||
  15532. + lp->p_encap == ISDN_NET_ENCAP_UIHDLC );
  15533. +}
  15534. +
  15535. +static int isdn_dwabc_conerr_ippktok(struct sk_buff *skb)
  15536. +{
  15537. + struct iphdr *iph = (struct iphdr *)skb->data;
  15538. + return(iph->version == 6 || (skb->len >= 20 && iph->version == 4));
  15539. +}
  15540. +
  15541. +#endif
  15542. +
  15543. +static int isdn_dwabc_is_interface_disabled(isdn_net_local *lp)
  15544. +{
  15545. + if(lp == NULL)
  15546. + return(0);
  15547. +
  15548. + lp->dw_abc_inuse_secure = 0;
  15549. + lp->dw_abc_dialstart = 0;
  15550. +
  15551. + /*
  15552. + ** check for jiffies overflow
  15553. + */
  15554. + if(lp->dw_abc_bchan_last_connect > jiffies) {
  15555. +
  15556. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  15557. + lp->dw_abc_bchan_errcnt = 0;
  15558. +#endif
  15559. + lp->dw_abc_bchan_last_connect = 0;
  15560. + }
  15561. +
  15562. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  15563. + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CONN_ERROR) && isdn_dwabc_encap_with_conerr(lp)) {
  15564. +
  15565. + if(lp->dw_abc_bchan_errcnt > 3 && !(lp->dw_abc_bchan_errcnt & 3)) {
  15566. + ulong nj = jiffies;
  15567. + ulong delay = lp->dw_abc_bchan_errcnt *
  15568. + lp->dw_abc_bchan_errcnt *
  15569. + lp->dw_abc_bchan_errcnt;
  15570. +
  15571. + if(delay > 86400) delay = 86400;
  15572. + delay = (lp->dw_abc_bchan_last_connect + delay * HZ);
  15573. +
  15574. + if(delay > nj) {
  15575. +
  15576. + printk(KERN_INFO
  15577. + "%s: interface auto-disabled (bchannel connect-error %lu seconds left)\n",
  15578. + lp->name,(delay - nj) / HZ);
  15579. +
  15580. + return(1);
  15581. + }
  15582. + }
  15583. + }
  15584. +#endif
  15585. + return(0);
  15586. +}
  15587. +#endif
  15588. +
  15589. +#ifdef CONFIG_ISDN_WITH_ABC
  15590. +void
  15591. +#else
  15592. static void
  15593. +#endif
  15594. isdn_net_unreachable(struct net_device *dev, struct sk_buff *skb, char *reason)
  15595. {
  15596. if(skb) {
  15597. @@ -297,6 +387,12 @@ isdn_net_unbind_channel(isdn_net_local *
  15598. save_flags(flags);
  15599. cli();
  15600. +#ifdef CONFIG_ISDN_WITH_ABC
  15601. + isdn_dw_clear_if(0l,lp);
  15602. + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_NODCHAN;
  15603. + lp->dw_abc_inuse_secure = 0;
  15604. + dwabc_bsd_free(lp);
  15605. +#endif
  15606. skb_queue_purge(&lp->super_tx_queue);
  15607. if (!lp->master) { /* reset only master device */
  15608. @@ -351,6 +447,26 @@ isdn_net_autohup()
  15609. if ((l->flags & ISDN_NET_CONNECTED) && (!l->dialstate)) {
  15610. anymore = 1;
  15611. l->huptimer++;
  15612. +#ifdef CONFIG_ISDN_WITH_ABC
  15613. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  15614. + if( isdn_dwabc_encap_with_conerr(l) && l->dw_abc_bchan_errcnt > 0) {
  15615. +
  15616. + int n = 180;
  15617. +
  15618. + if(l->dw_abc_bchan_errcnt > 3) n = 120;
  15619. + if(l->dw_abc_bchan_errcnt > 6) n = 90;
  15620. + if(l->dw_abc_bchan_errcnt > 9) n = 60;
  15621. +
  15622. + if(l->huptimer > n) {
  15623. +
  15624. + printk(KERN_INFO "%s: bchan conf-error auto-secure-hangup\n",l->name);
  15625. + isdn_net_hangup(&p->dev);
  15626. + p = (isdn_net_dev *) p->next;
  15627. + continue;
  15628. + }
  15629. + }
  15630. +#endif
  15631. +#endif
  15632. /*
  15633. * if there is some dialmode where timeout-hangup
  15634. * should _not_ be done, check for that here
  15635. @@ -465,8 +581,32 @@ isdn_net_stat_callback(int idx, isdn_ctr
  15636. printk(KERN_INFO "%s: Chargesum is %d\n", lp->name,
  15637. lp->charge);
  15638. isdn_net_unbind_channel(lp);
  15639. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  15640. + if(lp->dw_abc_bchan_errcnt) {
  15641. +
  15642. + printk(KERN_INFO
  15643. + "%s: Note: bchannel-error-counter is %hd\n",
  15644. + lp->name,
  15645. + lp->dw_abc_bchan_errcnt);
  15646. + }
  15647. +#endif
  15648. return 1;
  15649. }
  15650. +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
  15651. + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE)) {
  15652. + if((lp->dialstate == 4 || lp->dialstate == 12) &&
  15653. + lp->dw_abc_dialstart && (idx < ISDN_MAX_CHANNELS)) {
  15654. +
  15655. + if((jiffies - lp->dw_abc_dialstart) < (HZ >>2)) {
  15656. +
  15657. + lp->dw_abc_if_flags |= ISDN_DW_ABC_IFFLAG_NODCHAN;
  15658. + lp->dialstate = 1;
  15659. + dev->dwabc_chan_external_inuse[idx] = jiffies + HZ * 30;
  15660. + printk(KERN_INFO "%s: Channel %d look like external in use\n",lp->name,idx);
  15661. + }
  15662. + }
  15663. + }
  15664. +#endif
  15665. break;
  15666. #ifdef CONFIG_ISDN_X25
  15667. case ISDN_STAT_BHUP:
  15668. @@ -507,6 +647,19 @@ isdn_net_stat_callback(int idx, isdn_ctr
  15669. }
  15670. }
  15671. printk(KERN_INFO "isdn_net: %s connected\n", lp->name);
  15672. +#ifdef CONFIG_ISDN_WITH_ABC
  15673. + if(!dwabc_bsd_init(lp)) dwabc_bsd_first_gen(lp);
  15674. + lp->dw_abc_bchan_last_connect = jiffies;
  15675. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  15676. + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CONN_ERROR)) {
  15677. +
  15678. + lp->dw_abc_bchan_errcnt += isdn_dwabc_encap_with_conerr(lp);
  15679. +
  15680. + if(lp->dw_abc_bchan_errcnt > 32000)
  15681. + lp->dw_abc_bchan_errcnt = 32000;
  15682. + }
  15683. +#endif
  15684. +#endif
  15685. /* If first Chargeinfo comes before B-Channel connect,
  15686. * we correct the timestamp here.
  15687. */
  15688. @@ -578,7 +731,6 @@ isdn_net_dial(void)
  15689. int i;
  15690. unsigned long flags;
  15691. isdn_ctrl cmd;
  15692. - u_char *phone_number;
  15693. while (p) {
  15694. isdn_net_local *lp = p->local;
  15695. @@ -597,6 +749,47 @@ isdn_net_dial(void)
  15696. */
  15697. save_flags(flags);
  15698. cli();
  15699. +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
  15700. + if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE) &&
  15701. + (lp->dw_abc_if_flags & ISDN_DW_ABC_IFFLAG_NODCHAN)) {
  15702. +
  15703. + int chi = 0;
  15704. + short lsecure = 0;
  15705. +
  15706. + lsecure = lp->dw_abc_inuse_secure;
  15707. + isdn_net_unbind_channel(lp);
  15708. + lp->dw_abc_inuse_secure = lsecure + 1;
  15709. +
  15710. + /* Grab a free ISDN-Channel */
  15711. + if ((lsecure >= ISDN_MAX_CHANNELS ) || (chi =
  15712. + isdn_get_free_channel(
  15713. + ISDN_USAGE_NET,
  15714. + lp->l2_proto,
  15715. + lp->l3_proto,
  15716. + lp->pre_device,
  15717. + lp->pre_channel,
  15718. +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  15719. + (*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn)
  15720. +#else
  15721. + lp->msn)
  15722. +#endif
  15723. + ) < 0) {
  15724. +
  15725. + restore_flags(flags);
  15726. + isdn_net_unreachable(&p->dev, NULL,
  15727. + "DWABC: redial-external-inuse NO FREE CHANNEL\n");
  15728. + isdn_net_hangup(&p->dev);
  15729. + break;
  15730. + }
  15731. +
  15732. + isdn_net_bind_channel(lp, chi);
  15733. + lp->dialstate = 1;
  15734. + lp->dialstarted = 0;
  15735. + lp->dialwait_timer = 0;
  15736. + }
  15737. +
  15738. + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_NODCHAN;
  15739. +#endif
  15740. lp->dial = lp->phone[1];
  15741. restore_flags(flags);
  15742. if (!lp->dial) {
  15743. @@ -621,18 +814,69 @@ isdn_net_dial(void)
  15744. cmd.arg = lp->isdn_channel;
  15745. cmd.command = ISDN_CMD_CLREAZ;
  15746. isdn_command(&cmd);
  15747. +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  15748. + sprintf(cmd.parm.num, "%s",
  15749. + isdn_map_eaz2msn((*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn, cmd.driver));
  15750. +#else
  15751. sprintf(cmd.parm.num, "%s", isdn_map_eaz2msn(lp->msn, cmd.driver));
  15752. +#endif
  15753. cmd.command = ISDN_CMD_SETEAZ;
  15754. isdn_command(&cmd);
  15755. lp->dialretry = 0;
  15756. anymore = 1;
  15757. lp->dialstate++;
  15758. +#ifdef CONFIG_ISDN_WITH_ABC
  15759. + lp->onhtime = lp->dw_abc_old_onhtime;
  15760. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  15761. + isdn_dw_abc_lcr_clear(lp);
  15762. +#endif
  15763. +#endif
  15764. /* Fall through */
  15765. case 3:
  15766. /* Setup interface, dial current phone-number, switch to next number.
  15767. * If list of phone-numbers is exhausted, increment
  15768. * retry-counter.
  15769. */
  15770. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  15771. + if(!isdn_dw_abc_lcr_lock()) {
  15772. +
  15773. + if( lp->dw_abc_lcr_cmd != NULL &&
  15774. + lp->dw_abc_lcr_start_request !=
  15775. + lp->dw_abc_lcr_end_request) {
  15776. +
  15777. + if( lp->dw_abc_lcr_io == NULL &&
  15778. + lp->dw_abc_lcr_start_request <= jiffies &&
  15779. + lp->dw_abc_lcr_end_request > jiffies) {
  15780. +
  15781. + isdn_dw_abc_lcr_ulock();
  15782. + anymore = 1;
  15783. + break;
  15784. + }
  15785. +
  15786. + if(lp->dw_abc_lcr_io != NULL) {
  15787. +
  15788. + if(lp->dw_abc_lcr_io->lcr_ioctl_flags &
  15789. + DWABC_LCR_FLG_DISABLE) {
  15790. +
  15791. + isdn_dw_abc_lcr_ulock();
  15792. + isdn_net_hangup(&p->dev);
  15793. + break;
  15794. + }
  15795. +
  15796. + if(lp->dw_abc_lcr_io->lcr_ioctl_flags &
  15797. + DWABC_LCR_FLG_NEWHUPTIME) {
  15798. + lp->onhtime = lp->dw_abc_lcr_io->lcr_ioctl_onhtime;
  15799. + }
  15800. + }
  15801. +
  15802. + memcpy(&cmd,lp->dw_abc_lcr_cmd,sizeof(cmd));
  15803. + isdn_dw_abc_lcr_ulock();
  15804. + goto dw_abc_lcr_next_click;
  15805. + }
  15806. +
  15807. + isdn_dw_abc_lcr_ulock();
  15808. + }
  15809. +#endif
  15810. if(dev->global_flags & ISDN_GLOBAL_STOPPED || (ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_OFF)) {
  15811. char *s;
  15812. if (dev->global_flags & ISDN_GLOBAL_STOPPED)
  15813. @@ -677,20 +921,7 @@ isdn_net_dial(void)
  15814. break;
  15815. }
  15816. - cmd.driver = lp->isdn_device;
  15817. - cmd.command = ISDN_CMD_DIAL;
  15818. - cmd.parm.setup.si2 = 0;
  15819. -
  15820. - /* check for DOV */
  15821. - phone_number = lp->dial->num;
  15822. - if ((*phone_number == 'v') ||
  15823. - (*phone_number == 'V')) { /* DOV call */
  15824. - cmd.parm.setup.si1 = 1;
  15825. - } else { /* DATA call */
  15826. - cmd.parm.setup.si1 = 7;
  15827. - }
  15828. -
  15829. - strcpy(cmd.parm.setup.phone, phone_number);
  15830. + sprintf(cmd.parm.setup.phone, "%s", lp->dial->num);
  15831. /*
  15832. * Switch to next number or back to start if at end of list.
  15833. */
  15834. @@ -710,17 +941,70 @@ isdn_net_dial(void)
  15835. }
  15836. }
  15837. restore_flags(flags);
  15838. + cmd.driver = lp->isdn_device;
  15839. + cmd.command = ISDN_CMD_DIAL;
  15840. + cmd.parm.setup.si1 = 7;
  15841. + cmd.parm.setup.si2 = 0;
  15842. +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  15843. + sprintf(cmd.parm.setup.eazmsn, "%s",
  15844. + isdn_map_eaz2msn((*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn, cmd.driver));
  15845. +#else
  15846. sprintf(cmd.parm.setup.eazmsn, "%s",
  15847. isdn_map_eaz2msn(lp->msn, cmd.driver));
  15848. +#endif
  15849. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  15850. + /*
  15851. + ** if callback-out we dont need
  15852. + ** low-cost-routing LCR
  15853. + */
  15854. + if(!(lp->flags & ISDN_NET_CBOUT) &&
  15855. + !(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_LCR)) {
  15856. +
  15857. + isdn_dw_abc_lcr_call_number(lp,&cmd);
  15858. +
  15859. + if(lp->dw_abc_lcr_start_request != lp->dw_abc_lcr_end_request) {
  15860. +
  15861. + if(dev->net_verbose > 2) {
  15862. +
  15863. + printk(KERN_INFO
  15864. + "%s: Waiting for LCR-response from isdnlog %s -> %s...\n",
  15865. + lp->name,
  15866. + cmd.parm.setup.eazmsn,
  15867. + cmd.parm.setup.phone);
  15868. + }
  15869. +
  15870. + anymore = 1;
  15871. + break;
  15872. + }
  15873. + }
  15874. +
  15875. +dw_abc_lcr_next_click:;
  15876. + isdn_dw_abc_lcr_clear(lp);
  15877. +#endif
  15878. i = isdn_dc2minor(lp->isdn_device, lp->isdn_channel);
  15879. if (i >= 0) {
  15880. strcpy(dev->num[i], cmd.parm.setup.phone);
  15881. dev->usage[i] |= ISDN_USAGE_OUTGOING;
  15882. isdn_info_update();
  15883. }
  15884. - printk(KERN_INFO "%s: dialing %d %s... %s\n", lp->name,
  15885. - lp->dialretry, cmd.parm.setup.phone,
  15886. - (cmd.parm.setup.si1 == 1) ? "DOV" : "");
  15887. +#ifdef CONFIG_ISDN_WITH_ABC
  15888. + printk(KERN_INFO "%s: dialing %d %s -> %s...\n", lp->name,
  15889. + lp->dialretry,
  15890. + cmd.parm.setup.eazmsn,
  15891. + cmd.parm.setup.phone);
  15892. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  15893. + if(lp->dw_abc_bchan_errcnt) {
  15894. +
  15895. + printk(KERN_INFO
  15896. + "%s: Note: bchannel-error-counter is %hd\n",
  15897. + lp->name,
  15898. + lp->dw_abc_bchan_errcnt);
  15899. + }
  15900. +#endif
  15901. +#else
  15902. + printk(KERN_INFO "%s: dialing %d %s...\n", lp->name,
  15903. + lp->dialretry, cmd.parm.setup.phone);
  15904. +#endif
  15905. lp->dtimer = 0;
  15906. #ifdef ISDN_DEBUG_NET_DIAL
  15907. printk(KERN_DEBUG "dial: d=%d c=%d\n", lp->isdn_device,
  15908. @@ -741,6 +1025,10 @@ isdn_net_dial(void)
  15909. lp->dialstate =
  15910. (lp->cbdelay &&
  15911. (lp->flags & ISDN_NET_CBOUT)) ? 12 : 4;
  15912. +#ifdef CONFIG_ISDN_WITH_ABC
  15913. + lp->dw_abc_if_flags &= ~ISDN_DW_ABC_IFFLAG_NODCHAN;
  15914. + lp->dw_abc_dialstart = jiffies;
  15915. +#endif
  15916. break;
  15917. case 4:
  15918. /* Wait for D-Channel-connect.
  15919. @@ -890,6 +1178,15 @@ isdn_net_hangup(struct net_device *d)
  15920. isdn_command(&cmd);
  15921. printk(KERN_INFO "%s: Chargesum is %d\n", lp->name, lp->charge);
  15922. isdn_all_eaz(lp->isdn_device, lp->isdn_channel);
  15923. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  15924. + if(lp->dw_abc_bchan_errcnt) {
  15925. +
  15926. + printk(KERN_INFO
  15927. + "%s: Note: bchannel-error-counter is %hd\n",
  15928. + lp->name,
  15929. + lp->dw_abc_bchan_errcnt);
  15930. + }
  15931. +#endif
  15932. }
  15933. isdn_net_unbind_channel(lp);
  15934. }
  15935. @@ -899,8 +1196,13 @@ typedef struct {
  15936. unsigned short dest;
  15937. } ip_ports;
  15938. +#ifdef CONFIG_ISDN_WITH_ABC
  15939. +void
  15940. +isdn_net_log_skb_dwabc(struct sk_buff * skb, isdn_net_local * lp,char *reason)
  15941. +#else
  15942. static void
  15943. isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp)
  15944. +#endif
  15945. {
  15946. u_char *p = skb->nh.raw; /* hopefully, this was set correctly */
  15947. unsigned short proto = ntohs(skb->protocol);
  15948. @@ -972,7 +1274,13 @@ isdn_net_log_skb(struct sk_buff * skb, i
  15949. break;
  15950. }
  15951. printk(KERN_INFO
  15952. +#ifdef CONFIG_ISDN_WITH_ABC
  15953. + "%s %s: %d.%d.%d.%d -> %d.%d.%d.%d%s\n",
  15954. + (reason == NULL) ? "OPEN" : reason,
  15955. + (lp != NULL) ? lp->name : "",
  15956. +#else
  15957. "OPEN: %d.%d.%d.%d -> %d.%d.%d.%d%s\n",
  15958. +#endif
  15959. p[12], p[13], p[14], p[15],
  15960. p[16], p[17], p[18], p[19],
  15961. @@ -980,7 +1288,13 @@ isdn_net_log_skb(struct sk_buff * skb, i
  15962. break;
  15963. case ETH_P_ARP:
  15964. printk(KERN_INFO
  15965. +#ifdef CONFIG_ISDN_WITH_ABC
  15966. + "%s %s: ARP %d.%d.%d.%d -> *.*.*.* ?%d.%d.%d.%d\n",
  15967. + (reason == NULL) ? "OPEN" : reason,
  15968. + (lp != NULL) ? lp->name : "",
  15969. +#else
  15970. "OPEN: ARP %d.%d.%d.%d -> *.*.*.* ?%d.%d.%d.%d\n",
  15971. +#endif
  15972. p[14], p[15], p[16], p[17],
  15973. p[24], p[25], p[26], p[27]);
  15974. break;
  15975. @@ -1004,11 +1318,22 @@ void isdn_net_write_super(isdn_net_local
  15976. }
  15977. spin_lock_bh(&lp->xmit_lock);
  15978. +
  15979. if (!isdn_net_lp_busy(lp)) {
  15980. +#ifdef CONFIG_ISDN_WITH_ABC
  15981. + if(!skb_queue_empty(&lp->super_tx_queue)) {
  15982. + /*
  15983. + ** don't reverse the frame flow
  15984. + ** compression need frames in order and maybe other's too
  15985. + */
  15986. + skb_queue_tail(&lp->super_tx_queue, skb);
  15987. + skb = skb_dequeue(&lp->super_tx_queue);
  15988. + }
  15989. +#endif
  15990. isdn_net_writebuf_skb(lp, skb);
  15991. - } else {
  15992. - skb_queue_tail(&lp->super_tx_queue, skb);
  15993. - }
  15994. +
  15995. + } else skb_queue_tail(&lp->super_tx_queue, skb);
  15996. +
  15997. spin_unlock_bh(&lp->xmit_lock);
  15998. }
  15999. @@ -1056,7 +1381,6 @@ void isdn_net_writebuf_skb(isdn_net_loca
  16000. printk(KERN_WARNING "%s: HL driver queue full\n", lp->name);
  16001. goto error;
  16002. }
  16003. -
  16004. lp->transcount += len;
  16005. isdn_net_inc_frame_cnt(lp);
  16006. return;
  16007. @@ -1064,9 +1388,19 @@ void isdn_net_writebuf_skb(isdn_net_loca
  16008. error:
  16009. dev_kfree_skb(skb);
  16010. lp->stats.tx_errors++;
  16011. -
  16012. }
  16013. +#if 0
  16014. +int isdn_net_send_skb(struct net_device *ndev, isdn_net_local * lp,struct sk_buff *skb)
  16015. +{
  16016. + if (isdn_net_lp_busy(lp)) {
  16017. + printk(KERN_WARNING "isdn_net_send_skb: HL channel busy\n");
  16018. + return 1;
  16019. + }
  16020. + isdn_net_writebuf_skb(lp, skb);
  16021. + return 0;
  16022. +}
  16023. +#endif
  16024. /*
  16025. * Helper function for isdn_net_start_xmit.
  16026. @@ -1109,7 +1443,54 @@ isdn_net_xmit(struct net_device *ndev, s
  16027. /* Reset hangup-timeout */
  16028. lp->huptimer = 0; // FIXME?
  16029. +#ifdef CONFIG_ISDN_WITH_ABC
  16030. +
  16031. + if(test_and_set_bit(ISDN_DW_ABC_BITLOCK_SEND,&lp->dw_abc_bitlocks)) {
  16032. +
  16033. + if(dev->net_verbose > 2)
  16034. + printk(KERN_INFO "%s: isdn_net_xmit called recursivly\n",lp->name);
  16035. +
  16036. + spin_unlock_bh(&lp->xmit_lock);
  16037. + return(1);
  16038. + }
  16039. +
  16040. + if(skb != NULL) {
  16041. +
  16042. + int l = skb->len;
  16043. + int nl = l;
  16044. +
  16045. + if( lp->p_encap == ISDN_NET_ENCAP_RAWIP &&
  16046. + (lp->dw_abc_if_flags & ISDN_DW_ABC_IFFLAG_BSDAKTIV)) {
  16047. +
  16048. + if((skb = dwabc_bsd_compress(lp,skb,ndev)) != NULL) {
  16049. +
  16050. + int r = 0;
  16051. + nl = skb->len;
  16052. + skb_queue_tail(&lp->super_tx_queue,skb);
  16053. +
  16054. + if(l != nl && (r = isdn_dc2minor(lp->isdn_device,lp->isdn_channel)) >= 0) {
  16055. +
  16056. + dev->obytes[r] += l - nl;
  16057. + lp->stats.tx_bytes += l - nl;
  16058. + }
  16059. + }
  16060. +
  16061. + } else skb_queue_tail(&lp->super_tx_queue,skb);
  16062. +
  16063. + if(lp->p_encap == ISDN_NET_ENCAP_RAWIP) {
  16064. +
  16065. + lp->dw_abc_bsd_snd += l;
  16066. + lp->dw_abc_bsd_bsd_snd += nl;
  16067. + }
  16068. + }
  16069. + clear_bit(ISDN_DW_ABC_BITLOCK_SEND,&lp->dw_abc_bitlocks);
  16070. +
  16071. + while(!isdn_net_lp_busy(lp) && (skb = skb_dequeue(&lp->super_tx_queue)))
  16072. + isdn_net_writebuf_skb(lp, skb);
  16073. +
  16074. +#else
  16075. isdn_net_writebuf_skb(lp, skb);
  16076. +#endif
  16077. spin_unlock_bh(&lp->xmit_lock);
  16078. /* the following stuff is here for backwards compatibility.
  16079. @@ -1143,6 +1524,69 @@ isdn_net_xmit(struct net_device *ndev, s
  16080. return retv;
  16081. +#if 0
  16082. + if (lp->cps > lp->triggercps) {
  16083. + /* Device overloaded */
  16084. +
  16085. + /*
  16086. + * Packet-delivery via round-robin over master
  16087. + * and all connected slaves.
  16088. + */
  16089. + if (lp->master) {
  16090. + /* Slaves always deliver themselves */
  16091. + spin_lock_bh(&lp->xmit_lock);
  16092. + if (!isdn_net_lp_busy(lp)) {
  16093. + isdn_net_writebuf_skb(lp, skb);
  16094. + ret = 0;
  16095. + } else {
  16096. + isdn_net_device_stop_queue(lp);
  16097. + ret = 1;
  16098. + }
  16099. + ret = isdn_net_send_skb(ndev, lp, skb);
  16100. + spin_unlock_bh(&lp->xmit_lock);
  16101. + } else {
  16102. + isdn_net_local *slp = (isdn_net_local *) (lp->srobin->priv);
  16103. + /* Master delivers via srobin and maintains srobin */
  16104. + if (lp->srobin == ndev) {
  16105. + spin_lock_bh(&lp->xmit_lock);
  16106. + ret = isdn_net_send_skb(ndev, lp, skb);
  16107. + spin_unlock_bh(&lp->xmit_lock);
  16108. + } else {
  16109. + ret = isdn_net_start_xmit(skb, lp->srobin);
  16110. + }
  16111. + lp->srobin = (slp->slave) ? slp->slave : ndev;
  16112. + slp = (isdn_net_local *) (lp->srobin->priv);
  16113. + if (!((slp->flags & ISDN_NET_CONNECTED) && (slp->dialstate == 0)))
  16114. + lp->srobin = ndev;
  16115. + }
  16116. + /* Slave-startup using delay-variable */
  16117. + if (lp->slave) {
  16118. + if (!lp->sqfull) {
  16119. + /* First time overload: set timestamp only */
  16120. + lp->sqfull = 1;
  16121. + lp->sqfull_stamp = jiffies;
  16122. + } else {
  16123. + /* subsequent overload: if slavedelay exceeded, start dialing */
  16124. + if ((jiffies - lp->sqfull_stamp) > lp->slavedelay)
  16125. + isdn_net_force_dial_lp((isdn_net_local *) lp->slave->priv);
  16126. + }
  16127. + }
  16128. + } else {
  16129. + /* Not overloaded, deliver locally */
  16130. + spin_lock_bh(&lp->xmit_lock);
  16131. + if (!isdn_net_lp_busy(lp)) {
  16132. + isdn_net_writebuf_skb(lp, skb);
  16133. + ret = 0;
  16134. + } else {
  16135. + isdn_net_device_stop_queue(lp);
  16136. + ret = 1;
  16137. + }
  16138. + spin_unlock_bh(&lp->xmit_lock);
  16139. + if (lp->sqfull && ((jiffies - lp->sqfull_stamp) > (lp->slavedelay + (10 * HZ))))
  16140. + lp->sqfull = 0;
  16141. + }
  16142. + return ret;
  16143. +#endif
  16144. }
  16145. static void
  16146. @@ -1161,6 +1605,7 @@ isdn_net_adjust_hdr(struct sk_buff *skb,
  16147. }
  16148. +#ifndef COMPAT_NO_SOFTNET
  16149. void isdn_net_tx_timeout(struct net_device * ndev)
  16150. {
  16151. isdn_net_local *lp = (isdn_net_local *) ndev->priv;
  16152. @@ -1188,19 +1633,206 @@ void isdn_net_tx_timeout(struct net_devi
  16153. ndev->trans_start = jiffies;
  16154. netif_wake_queue(ndev);
  16155. }
  16156. +#endif
  16157. /*
  16158. * Try sending a packet.
  16159. * If this interface isn't connected to a ISDN-Channel, find a free channel,
  16160. * and start dialing.
  16161. */
  16162. +#ifdef CONFIG_ISDN_WITH_ABC
  16163. +static int dwabc_isdn_net_start_xmit(struct sk_buff *,struct net_device *);
  16164. +
  16165. +static int isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
  16166. +{
  16167. + if(skb == NULL || ndev == NULL)
  16168. + return(dwabc_isdn_net_start_xmit(skb,ndev));
  16169. +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
  16170. + if(!(((isdn_net_local *)ndev->priv)->dw_abc_flags &
  16171. + ISDN_DW_ABC_FLAG_NO_UDP_CHECK)) {
  16172. +
  16173. + if(dw_abc_udp_test(skb,ndev)) {
  16174. + dev_kfree_skb(skb);
  16175. + return(0);
  16176. + }
  16177. + }
  16178. +#endif
  16179. + return(dwabc_isdn_net_start_xmit(skb,ndev));
  16180. +}
  16181. +
  16182. +
  16183. +#ifdef CONFIG_ISDN_WITH_ABC
  16184. +int isdn_auto_dial_helper( isdn_net_local *lp,
  16185. + struct sk_buff *skb,
  16186. + int dm_manual_allowed)
  16187. +/**********************************************************************
  16188. + return's:
  16189. + -1 dial not allowed or impossible
  16190. + 0 interface is connected
  16191. + 1 dial is started
  16192. +***********************************************************************/
  16193. +{
  16194. + int retw = -1;
  16195. + int chi;
  16196. + ulong flags;
  16197. + char *errmsg = NULL;
  16198. +
  16199. +#ifdef ISDN_DEBUG_NET_DUMP
  16200. + {
  16201. + char *buf = skb->data;
  16202. + isdn_dumppkt("S:", buf, skb->len, 40);
  16203. + }
  16204. +#endif
  16205. + if (lp->flags & ISDN_NET_CONNECTED)
  16206. + return(0);
  16207. +
  16208. + save_flags(flags);
  16209. + cli();
  16210. +
  16211. + do {
  16212. +
  16213. + /* Log packet, which triggered dialing */
  16214. + if (dev->net_verbose)
  16215. + isdn_net_log_skb(skb, lp);
  16216. + /* only do autodial if allowed by config */
  16217. + if (!(ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_AUTO)) {
  16218. + errmsg = "dial rejected: interface not in dialmode `auto'";
  16219. +
  16220. + if(dm_manual_allowed &&
  16221. + !(ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_MANUAL)) {
  16222. +
  16223. + errmsg =
  16224. + "dial rejected: interface not in dialmode `auto or manual'";
  16225. + }
  16226. + break;
  16227. + }
  16228. +
  16229. + if (!lp->phone[1]) {
  16230. +
  16231. + errmsg = "No phone number";
  16232. + break;
  16233. + }
  16234. +
  16235. + if(lp->dialwait_timer <= 0) {
  16236. +
  16237. + if( lp->dialstarted > 0 &&
  16238. + lp->dialtimeout > 0 &&
  16239. + jiffies < (lp->dialstarted + lp->dialtimeout + lp->dialwait)) {
  16240. +
  16241. + lp->dialwait_timer =
  16242. + lp->dialstarted + lp->dialtimeout + lp->dialwait;
  16243. + }
  16244. + }
  16245. +
  16246. + if(lp->dialwait_timer > 0) {
  16247. +
  16248. + if(jiffies < lp->dialwait_timer) {
  16249. +
  16250. + errmsg = "dial rejected: retry-time not reached";
  16251. + break;
  16252. +
  16253. + } else lp->dialwait_timer = 0;
  16254. + }
  16255. +#ifdef CONFIG_ISDN_WITH_ABC
  16256. + if(isdn_dwabc_is_interface_disabled(lp))
  16257. + break;
  16258. +#endif
  16259. + /* Grab a free ISDN-Channel */
  16260. + if (((chi =
  16261. + isdn_get_free_channel(
  16262. + ISDN_USAGE_NET,
  16263. + lp->l2_proto,
  16264. + lp->l3_proto,
  16265. + lp->pre_device,
  16266. + lp->pre_channel,
  16267. +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  16268. + (*lp->dw_out_msn) ? lp->dw_out_msn :
  16269. +#endif
  16270. + lp->msn)
  16271. + ) < 0) &&
  16272. + ((chi =
  16273. + isdn_get_free_channel(
  16274. + ISDN_USAGE_NET,
  16275. + lp->l2_proto,
  16276. + lp->l3_proto,
  16277. + lp->pre_device,
  16278. + lp->pre_channel^1,
  16279. +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  16280. + (*lp->dw_out_msn) ? lp->dw_out_msn :
  16281. +#endif
  16282. + lp->msn)
  16283. + ) < 0)) {
  16284. +
  16285. + errmsg = "No channel";
  16286. + break;
  16287. + }
  16288. +
  16289. + lp->dialstate = 1;
  16290. + /* Connect interface with channel */
  16291. + isdn_net_bind_channel(lp, chi);
  16292. +#ifdef CONFIG_ISDN_PPP
  16293. + if (lp->p_encap == ISDN_NET_ENCAP_SYNCPPP) {
  16294. + /* no 'first_skb' handling for syncPPP */
  16295. + if (isdn_ppp_bind(lp) < 0) {
  16296. + isdn_net_unbind_channel(lp);
  16297. + break;
  16298. + }
  16299. +
  16300. + isdn_net_dial(); /* Initiate dialing */
  16301. + netif_stop_queue(&lp->netdev->dev);
  16302. + retw = 1;
  16303. + break;
  16304. + /* let upper layer requeue skb packet */
  16305. + }
  16306. +#endif
  16307. + /* Initiate dialing */
  16308. + isdn_net_dial();
  16309. + isdn_net_device_stop_queue(lp);
  16310. + retw = 1;
  16311. +
  16312. + } while(0);
  16313. +
  16314. + if(retw < 0 && errmsg != NULL)
  16315. + isdn_net_unreachable(&lp->netdev->dev, skb, errmsg);
  16316. +
  16317. + restore_flags(flags);
  16318. + return(retw);
  16319. +}
  16320. +#endif
  16321. +
  16322. +
  16323. +
  16324. +static int
  16325. +dwabc_isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
  16326. +#else
  16327. static int
  16328. isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
  16329. +#endif
  16330. {
  16331. isdn_net_local *lp = (isdn_net_local *) ndev->priv;
  16332. #ifdef CONFIG_ISDN_X25
  16333. struct concap_proto * cprot = lp -> netdev -> cprot;
  16334. #endif
  16335. +#ifdef COMPAT_NO_SOFTNET
  16336. + /* some comment as with the softnet TX timeout
  16337. + when this happens, it's a bug in the HL card driver
  16338. + and should be fixed there, so we can supposedly get rid of
  16339. + this here at all.
  16340. + I added a debugging message to find out if it ever occurs --KG
  16341. + */
  16342. +
  16343. + if (ndev->tbusy) {
  16344. + if (jiffies - ndev->trans_start < ISDN_NET_TX_TIMEOUT)
  16345. + return 1;
  16346. + if (!lp->dialstate){
  16347. + lp->stats.tx_errors++;
  16348. + printk(KERN_WARNING "isdn_tx_timeout dev %s dialstate %d\n",
  16349. + ndev->name, lp->dialstate);
  16350. + }
  16351. + ndev->trans_start = jiffies;
  16352. + netif_wake_queue(ndev);
  16353. + }
  16354. +#endif
  16355. #ifdef CONFIG_ISDN_X25
  16356. /* At this point hard_start_xmit() passes control to the encapsulation
  16357. protocol (if present).
  16358. @@ -1220,6 +1852,40 @@ isdn_net_start_xmit(struct sk_buff *skb,
  16359. } else
  16360. #endif
  16361. /* auto-dialing xmit function */
  16362. +#ifdef CONFIG_ISDN_WITH_ABC
  16363. + {
  16364. + int r;
  16365. +
  16366. + isdn_net_adjust_hdr(skb, ndev);
  16367. +
  16368. + if(!(r = isdn_auto_dial_helper(lp,skb,0))) {
  16369. +
  16370. + /*
  16371. + ** Device is connected to an ISDN channel
  16372. + */
  16373. + ndev->trans_start = jiffies;
  16374. +
  16375. + if (!lp->dialstate) {
  16376. +
  16377. + /*
  16378. + ** ISDN connection is established, try sending
  16379. + */
  16380. + r = isdn_net_xmit(ndev, skb);
  16381. +
  16382. + } else r = 1;
  16383. +
  16384. + if(r)
  16385. + netif_stop_queue(ndev);
  16386. +
  16387. + } else if(r < 0) {
  16388. +
  16389. + dev_kfree_skb(skb);
  16390. + r = 0;
  16391. + }
  16392. +
  16393. + return(r);
  16394. + }
  16395. +#else
  16396. {
  16397. #ifdef ISDN_DEBUG_NET_DUMP
  16398. u_char *buf;
  16399. @@ -1256,6 +1922,14 @@ isdn_net_start_xmit(struct sk_buff *skb,
  16400. } else
  16401. lp->dialwait_timer = 0;
  16402. }
  16403. +#ifdef CONFIG_ISDN_WITH_ABC
  16404. + if(isdn_dwabc_is_interface_disabled(lp)) {
  16405. +
  16406. + dev_kfree_skb(skb);
  16407. + restore_flags(flags);
  16408. + return(0);
  16409. + }
  16410. +#endif
  16411. /* Grab a free ISDN-Channel */
  16412. if (((chi =
  16413. isdn_get_free_channel(
  16414. @@ -1264,6 +1938,9 @@ isdn_net_start_xmit(struct sk_buff *skb,
  16415. lp->l3_proto,
  16416. lp->pre_device,
  16417. lp->pre_channel,
  16418. +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  16419. + (*lp->dw_out_msn) ? lp->dw_out_msn :
  16420. +#endif
  16421. lp->msn)
  16422. ) < 0) &&
  16423. ((chi =
  16424. @@ -1273,6 +1950,9 @@ isdn_net_start_xmit(struct sk_buff *skb,
  16425. lp->l3_proto,
  16426. lp->pre_device,
  16427. lp->pre_channel^1,
  16428. +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  16429. + (*lp->dw_out_msn) ? lp->dw_out_msn :
  16430. +#endif
  16431. lp->msn)
  16432. ) < 0)) {
  16433. restore_flags(flags);
  16434. @@ -1296,16 +1976,6 @@ isdn_net_start_xmit(struct sk_buff *skb,
  16435. restore_flags(flags);
  16436. return 0; /* STN (skb to nirvana) ;) */
  16437. }
  16438. -#ifdef CONFIG_IPPP_FILTER
  16439. - if (isdn_ppp_autodial_filter(skb, lp)) {
  16440. - isdn_ppp_free(lp);
  16441. - isdn_net_unbind_channel(lp);
  16442. - restore_flags(flags);
  16443. - isdn_net_unreachable(ndev, skb, "dial rejected: packet filtered");
  16444. - dev_kfree_skb(skb);
  16445. - return 0;
  16446. - }
  16447. -#endif
  16448. restore_flags(flags);
  16449. isdn_net_dial(); /* Initiate dialing */
  16450. netif_stop_queue(ndev);
  16451. @@ -1337,6 +2007,7 @@ isdn_net_start_xmit(struct sk_buff *skb,
  16452. }
  16453. }
  16454. return 1;
  16455. +#endif
  16456. }
  16457. /*
  16458. @@ -1356,6 +2027,9 @@ isdn_net_close(struct net_device *dev)
  16459. if( cprot && cprot -> pops ) cprot -> pops -> close( cprot );
  16460. #endif
  16461. netif_stop_queue(dev);
  16462. +#ifdef COMPAT_NO_SOFTNET
  16463. + dev->start = 0;
  16464. +#endif
  16465. if ((p = (((isdn_net_local *) dev->priv)->slave))) {
  16466. /* If this interface has slaves, stop them also */
  16467. while (p) {
  16468. @@ -1776,6 +2450,10 @@ isdn_net_ciscohdlck_receive(isdn_net_loc
  16469. }
  16470. switch (type) {
  16471. + case CISCO_TYPE_INET:
  16472. + skb->protocol = htons(ETH_P_IP);
  16473. + netif_rx(skb);
  16474. + break;
  16475. case CISCO_TYPE_SLARP:
  16476. isdn_net_ciscohdlck_slarp_in(lp, skb);
  16477. goto out_free;
  16478. @@ -1785,11 +2463,11 @@ isdn_net_ciscohdlck_receive(isdn_net_loc
  16479. "\"no cdp enable\" on cisco.\n", lp->name);
  16480. goto out_free;
  16481. default:
  16482. - /* no special cisco protocol */
  16483. - skb->protocol = htons(type);
  16484. - netif_rx(skb);
  16485. - return;
  16486. + printk(KERN_WARNING "%s: Unknown Cisco type 0x%04x\n",
  16487. + lp->name, type);
  16488. + goto out_free;
  16489. }
  16490. + return;
  16491. out_free:
  16492. kfree_skb(skb);
  16493. @@ -1803,9 +2481,19 @@ isdn_net_receive(struct net_device *ndev
  16494. {
  16495. isdn_net_local *lp = (isdn_net_local *) ndev->priv;
  16496. isdn_net_local *olp = lp; /* original 'lp' */
  16497. +#ifdef CONFIG_ISDN_PPP
  16498. + int proto = PPP_PROTOCOL(skb->data);
  16499. +#endif
  16500. #ifdef CONFIG_ISDN_X25
  16501. struct concap_proto *cprot = lp -> netdev -> cprot;
  16502. #endif
  16503. +#ifdef CONFIG_ISDN_WITH_ABC
  16504. + struct net_device *ondev = ndev;
  16505. +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
  16506. + ulong lp_huptimer = 0;
  16507. + ulong olp_huptimer = 0;
  16508. +#endif
  16509. +#endif
  16510. lp->transcount += skb->len;
  16511. lp->stats.rx_packets++;
  16512. @@ -1819,6 +2507,10 @@ isdn_net_receive(struct net_device *ndev
  16513. lp->stats.rx_packets++;
  16514. lp->stats.rx_bytes += skb->len;
  16515. }
  16516. +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
  16517. + lp_huptimer = lp->huptimer;
  16518. + olp_huptimer = olp->huptimer;
  16519. +#endif
  16520. skb->dev = ndev;
  16521. skb->pkt_type = PACKET_HOST;
  16522. skb->mac.raw = skb->data;
  16523. @@ -1840,9 +2532,40 @@ isdn_net_receive(struct net_device *ndev
  16524. /* Fall through */
  16525. case ISDN_NET_ENCAP_RAWIP:
  16526. /* RAW-IP without MAC-Header */
  16527. +#ifdef CONFIG_ISDN_WITH_ABC
  16528. + if(olp->p_encap == ISDN_NET_ENCAP_RAWIP) {
  16529. +
  16530. + ushort l = skb->len;
  16531. + short r = 0;
  16532. +
  16533. + olp->dw_abc_bsd_bsd_rcv += l;
  16534. +
  16535. + if((skb = dwabc_bsd_rx_pkt(olp,skb,ondev)) == NULL) {
  16536. +
  16537. + olp->dw_abc_bsd_rcv += l;
  16538. + return;
  16539. + }
  16540. +
  16541. + olp->dw_abc_bsd_rcv += skb->len;
  16542. +
  16543. + if( l != skb->len &&
  16544. + (r=isdn_dc2minor(olp->isdn_device,olp->isdn_channel))>=0) {
  16545. +
  16546. + dev->ibytes[r] += skb->len - l;
  16547. + olp->stats.rx_bytes += skb->len - l;
  16548. +
  16549. + if(olp != lp)
  16550. + lp->stats.rx_bytes += skb->len - l;
  16551. + }
  16552. + }
  16553. +#endif
  16554. olp->huptimer = 0;
  16555. lp->huptimer = 0;
  16556. skb->protocol = htons(ETH_P_IP);
  16557. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  16558. + if(isdn_dwabc_conerr_ippktok(skb))
  16559. + lp->dw_abc_bchan_errcnt = 0;
  16560. +#endif
  16561. break;
  16562. case ISDN_NET_ENCAP_CISCOHDLCK:
  16563. isdn_net_ciscohdlck_receive(lp, skb);
  16564. @@ -1862,8 +2585,22 @@ isdn_net_receive(struct net_device *ndev
  16565. break;
  16566. #ifdef CONFIG_ISDN_PPP
  16567. case ISDN_NET_ENCAP_SYNCPPP:
  16568. - /* huptimer is done in isdn_ppp_push_higher */
  16569. + /*
  16570. + * If encapsulation is syncppp, don't reset
  16571. + * huptimer on LCP packets.
  16572. + */
  16573. + if (proto != PPP_LCP) {
  16574. + olp->huptimer = 0;
  16575. + lp->huptimer = 0;
  16576. + }
  16577. isdn_ppp_receive(lp->netdev, olp, skb);
  16578. +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
  16579. + if(olp->dw_abc_flags & ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER) {
  16580. +
  16581. + lp->huptimer = lp_huptimer + 1;
  16582. + olp->huptimer = olp_huptimer+ 1;
  16583. + }
  16584. +#endif
  16585. return;
  16586. #endif
  16587. @@ -1873,6 +2610,15 @@ isdn_net_receive(struct net_device *ndev
  16588. if(cprot) if(cprot -> pops)
  16589. if( cprot -> pops -> data_ind){
  16590. cprot -> pops -> data_ind(cprot,skb);
  16591. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  16592. + lp->dw_abc_bchan_errcnt = 0;
  16593. +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
  16594. + if(olp->dw_abc_flags & ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER) {
  16595. + lp->huptimer = lp_huptimer;
  16596. + olp->huptimer = olp_huptimer;
  16597. + }
  16598. +#endif
  16599. +#endif
  16600. return;
  16601. };
  16602. #endif /* CONFIG_ISDN_X25 */
  16603. @@ -1882,6 +2628,15 @@ isdn_net_receive(struct net_device *ndev
  16604. return;
  16605. }
  16606. +#ifdef CONFIG_ISDN_WITH_ABC
  16607. +#ifdef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
  16608. + if(olp->dw_abc_flags & ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER) {
  16609. +
  16610. + lp->huptimer = lp_huptimer;
  16611. + olp->huptimer = olp_huptimer;
  16612. + }
  16613. +#endif
  16614. +#endif
  16615. netif_rx(skb);
  16616. return;
  16617. }
  16618. @@ -2160,8 +2915,10 @@ isdn_net_find_icall(int di, int ch, int
  16619. isdn_net_phone *n;
  16620. ulong flags;
  16621. char nr[32];
  16622. - char *my_eaz;
  16623. -
  16624. +#ifdef CONFIG_ISDN_WITH_ABC
  16625. + if(dev->net_verbose > 2)
  16626. + printk(KERN_DEBUG "n_fi: di=%d ch=%d idx=%d usg=0x%04X\n", di, ch, idx,dev->usage[idx]);
  16627. +#endif
  16628. /* Search name in netdev-chain */
  16629. save_flags(flags);
  16630. cli();
  16631. @@ -2180,17 +2937,15 @@ isdn_net_find_icall(int di, int ch, int
  16632. eaz = setup->eazmsn;
  16633. if (dev->net_verbose > 1)
  16634. printk(KERN_INFO "isdn_net: call from %s,%d,%d -> %s\n", nr, si1, si2, eaz);
  16635. - /* Accept DATA and VOICE calls at this stage
  16636. - local eaz is checked later for allowed call types */
  16637. - if ((si1 != 7) && (si1 != 1)) {
  16638. - restore_flags(flags);
  16639. - if (dev->net_verbose > 1)
  16640. - printk(KERN_INFO "isdn_net: Service-Indicator not 1 or 7, ignored\n");
  16641. - return 0;
  16642. - }
  16643. -
  16644. -n = (isdn_net_phone *) 0;
  16645. -p = dev->netdev;
  16646. + /* Accept only calls with Si1 = 7 (Data-Transmission) */
  16647. + if (si1 != 7) {
  16648. + restore_flags(flags);
  16649. + if (dev->net_verbose > 1)
  16650. + printk(KERN_INFO "isdn_net: Service-Indicator not 7, ignored\n");
  16651. + return 0;
  16652. + }
  16653. + n = (isdn_net_phone *) 0;
  16654. + p = dev->netdev;
  16655. ematch = wret = swapped = 0;
  16656. #ifdef ISDN_DEBUG_NET_ICALL
  16657. printk(KERN_DEBUG "n_fi: di=%d ch=%d idx=%d usg=%d\n", di, ch, idx,
  16658. @@ -2210,25 +2965,8 @@ p = dev->netdev;
  16659. break;
  16660. }
  16661. swapped = 0;
  16662. - /* check acceptable call types for DOV */
  16663. - my_eaz = isdn_map_eaz2msn(lp->msn, di);
  16664. - if (si1 == 1) { /* it's a DOV call, check if we allow it */
  16665. - if (*my_eaz == 'v' || *my_eaz == 'V' ||
  16666. - *my_eaz == 'b' || *my_eaz == 'B')
  16667. - my_eaz++; /* skip to allow a match */
  16668. - else
  16669. - my_eaz = 0; /* force non match */
  16670. - } else { /* it's a DATA call, check if we allow it */
  16671. - if (*my_eaz == 'b' || *my_eaz == 'B')
  16672. - my_eaz++; /* skip to allow a match */
  16673. - }
  16674. - if (my_eaz)
  16675. - matchret = isdn_msncmp(eaz, my_eaz);
  16676. - else
  16677. - matchret = 1;
  16678. - if (!matchret)
  16679. - ematch = 1;
  16680. -
  16681. + if (!(matchret = isdn_msncmp(eaz, isdn_map_eaz2msn(lp->msn, di))))
  16682. + ematch = 1;
  16683. /* Remember if more numbers eventually can match */
  16684. if (matchret > wret)
  16685. wret = matchret;
  16686. @@ -2236,17 +2974,122 @@ p = dev->netdev;
  16687. printk(KERN_DEBUG "n_fi: if='%s', l.msn=%s, l.flags=%d, l.dstate=%d\n",
  16688. lp->name, lp->msn, lp->flags, lp->dialstate);
  16689. #endif
  16690. +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
  16691. + if ((!matchret) && /* EAZ is matching */
  16692. + (((!(lp->flags & ISDN_NET_CONNECTED)) && /* but not connected */
  16693. + (USG_NONE(dev->usage[idx]))) || /* and ch. unused or */
  16694. + (lp->dialstate == 4) || (lp->dialstate == 12) || /* if dialing */
  16695. + ((lp->flags & ISDN_NET_CBOUT) != 0 && /* init a callback */
  16696. + lp->outgoing != 0 )))
  16697. +
  16698. + /*
  16699. + ** we dont stop call's anymore (both sides call's syncron)
  16700. + ** it will be problem in any case.
  16701. + ** both sides will make the same.
  16702. + ** i try later to make a switch (check the phon-numbers)
  16703. + ** to detect with side must be stop the call.
  16704. + */
  16705. +#else
  16706. if ((!matchret) && /* EAZ is matching */
  16707. (((!(lp->flags & ISDN_NET_CONNECTED)) && /* but not connected */
  16708. (USG_NONE(dev->usage[idx]))) || /* and ch. unused or */
  16709. ((((lp->dialstate == 4) || (lp->dialstate == 12)) && /* if dialing */
  16710. (!(lp->flags & ISDN_NET_CALLBACK))) /* but no callback */
  16711. )))
  16712. +#endif
  16713. {
  16714. #ifdef ISDN_DEBUG_NET_ICALL
  16715. printk(KERN_DEBUG "n_fi: match1, pdev=%d pch=%d\n",
  16716. lp->pre_device, lp->pre_channel);
  16717. #endif
  16718. +#ifdef CONFIG_ISDN_WITH_ABC
  16719. +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
  16720. + {
  16721. + int use_this_call = 0;
  16722. +
  16723. + if(!(lp->flags & ISDN_NET_CBOUT) && ((lp->dialstate == 4) || (lp->dialstate == 12))) {
  16724. +
  16725. + /*
  16726. + ** searching for a diff. in the calling-number and the EAZ
  16727. + ** the remote will make the same
  16728. + */
  16729. +
  16730. + char *pnr = nr;
  16731. + char *pea = eaz;
  16732. +
  16733. + for(;*pnr;pnr++);
  16734. + for(;*pea;pea++);
  16735. + for(pnr--,pea--;pnr >= nr && pea >= eaz && *pea != *pnr;pnr--,pea--);
  16736. +
  16737. + if(pnr < nr || pea < eaz || *pea > *pnr) {
  16738. +
  16739. + p = (isdn_net_dev *) p->next;
  16740. + continue;
  16741. + }
  16742. +
  16743. + use_this_call = 1;
  16744. + }
  16745. +
  16746. + if( use_this_call ||
  16747. + ((lp->flags & ISDN_NET_CBOUT) && (lp->flags & ISDN_NET_CONNECTED))) {
  16748. +
  16749. + /*
  16750. + ** the incoming call was to quick.
  16751. + ** the callback-delay-time ist not reached.
  16752. + ** in that case we can stop the call
  16753. + */
  16754. +
  16755. + if(lp->isdn_device > -1 && lp->isdn_channel > -1) {
  16756. +
  16757. + int minor = isdn_dc2minor(lp->isdn_device,lp->isdn_channel);
  16758. +
  16759. + if(lp->isdn_device != di || lp->isdn_channel != ch) {
  16760. +
  16761. + isdn_ctrl cmd;
  16762. +
  16763. + memset((void *)&cmd,0,sizeof(cmd));
  16764. + cmd.driver = lp->isdn_device;
  16765. + cmd.command = ISDN_CMD_HANGUP;
  16766. + cmd.arg = lp->isdn_channel;
  16767. + (void) dev->drv[cmd.driver]->interface->command(&cmd);
  16768. + isdn_all_eaz(lp->isdn_device, lp->isdn_channel);
  16769. +
  16770. + if(dev->net_verbose > 1) {
  16771. +
  16772. + printk(KERN_INFO
  16773. + "%s: found outgoing call hangup old call on di %d ch %d\n",
  16774. + lp->name,lp->isdn_device,lp->isdn_channel);
  16775. + }
  16776. +
  16777. + } else if (dev->net_verbose > 1) {
  16778. +
  16779. + printk(KERN_INFO "%s: found outgoing call on same di %d ch %d\n",
  16780. + lp->name,lp->isdn_device,lp->isdn_channel);
  16781. + }
  16782. +
  16783. + if(minor >= 0) {
  16784. +
  16785. + dev->rx_netdev[minor] = NULL;
  16786. + dev->st_netdev[minor] = NULL;
  16787. + }
  16788. +
  16789. + isdn_free_channel(lp->isdn_device,
  16790. + lp->isdn_channel, ISDN_USAGE_NET);
  16791. +
  16792. + } else if (dev->net_verbose > 1) {
  16793. +
  16794. + printk(KERN_INFO "%s: found outgoing call reset callstate \n",lp->name);
  16795. + }
  16796. +
  16797. + lp->flags &= ~ISDN_NET_CONNECTED;
  16798. + lp->isdn_device = -1;
  16799. + lp->isdn_channel = -1;
  16800. + lp->dtimer = 0;
  16801. + lp->dialstate = 0;
  16802. + }
  16803. + }
  16804. +#endif
  16805. +#endif
  16806. if (dev->usage[idx] & ISDN_USAGE_EXCLUSIVE) {
  16807. if ((lp->pre_channel != ch) ||
  16808. (lp->pre_device != di)) {
  16809. @@ -2375,6 +3218,12 @@ p = dev->netdev;
  16810. continue;
  16811. }
  16812. }
  16813. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  16814. + if(isdn_dwabc_is_interface_disabled(lp)) {
  16815. + restore_flags(flags);
  16816. + return 3;
  16817. + }
  16818. +#endif
  16819. if (lp->flags & ISDN_NET_CALLBACK) {
  16820. int chi;
  16821. /*
  16822. @@ -2427,6 +3276,47 @@ p = dev->netdev;
  16823. restore_flags(flags);
  16824. return 0;
  16825. } else {
  16826. +#ifdef CONFIG_ISDN_WITH_ABC_CALLB
  16827. + {
  16828. + /*
  16829. + ** this is a sanity-check.
  16830. + ** check for double use (device and channel)
  16831. + ** will be very near to a kernel-crash in that case
  16832. + */
  16833. + isdn_net_dev *sp = dev->netdev;
  16834. + int s_shl;
  16835. + isdn_net_local *ml;
  16836. +
  16837. + for(s_shl=0; s_shl < 2048 && sp != NULL; sp = (isdn_net_dev *)sp->next, s_shl++) {
  16838. +
  16839. + if(sp == p || (ml = sp->local) == NULL)
  16840. + continue;
  16841. +
  16842. + if(ml->isdn_device != di || ml->isdn_channel != ch)
  16843. + continue;
  16844. +
  16845. + if(ml->dialstate != 4 && ml->dialstate != 12) {
  16846. +
  16847. + /*
  16848. + ** wrong situation
  16849. + */
  16850. + break;
  16851. + }
  16852. +
  16853. + isdn_net_unbind_channel(ml);
  16854. + }
  16855. +
  16856. + if(sp != NULL) {
  16857. +
  16858. + printk(KERN_DEBUG
  16859. +"%s: call from %s -> %s (drv %d chan %d duplicated with %s) \n",
  16860. + lp->name, nr, eaz,di,ch,
  16861. + sp->local->name );
  16862. +
  16863. + restore_flags(flags);
  16864. + return 3;
  16865. + }}
  16866. +#endif
  16867. printk(KERN_DEBUG "%s: call from %s -> %s accepted\n", lp->name, nr,
  16868. eaz);
  16869. /* if this interface is dialing, it does it probably on a different
  16870. @@ -2516,7 +3406,11 @@ isdn_net_force_dial_lp(isdn_net_local *
  16871. lp->l3_proto,
  16872. lp->pre_device,
  16873. lp->pre_channel,
  16874. +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  16875. + (*lp->dw_out_msn) ? lp->dw_out_msn : lp->msn)
  16876. +#else
  16877. lp->msn)
  16878. +#endif
  16879. ) < 0) {
  16880. printk(KERN_WARNING "isdn_net_force_dial: No channel for %s\n", lp->name);
  16881. restore_flags(flags);
  16882. @@ -2599,7 +3493,11 @@ isdn_net_new(char *name, struct net_devi
  16883. strcpy(netdev->local->name, " ");
  16884. else
  16885. strcpy(netdev->local->name, name);
  16886. +#ifdef COMPAT_NO_SOFTNET
  16887. + netdev->dev.name = netdev->local->name;
  16888. +#else
  16889. strcpy(netdev->dev.name, netdev->local->name);
  16890. +#endif
  16891. netdev->dev.priv = netdev->local;
  16892. netdev->dev.init = isdn_net_init;
  16893. netdev->local->p_encap = ISDN_NET_ENCAP_RAWIP;
  16894. @@ -2617,11 +3515,13 @@ isdn_net_new(char *name, struct net_devi
  16895. ((isdn_net_local *) q->priv)->slave = &(netdev->dev);
  16896. } else {
  16897. /* Device shall be a master */
  16898. +#ifndef COMPAT_NO_SOFTNET
  16899. /*
  16900. * Watchdog timer (currently) for master only.
  16901. */
  16902. netdev->dev.tx_timeout = isdn_net_tx_timeout;
  16903. netdev->dev.watchdog_timeo = ISDN_NET_TX_TIMEOUT;
  16904. +#endif
  16905. if (register_netdev(&netdev->dev) != 0) {
  16906. printk(KERN_WARNING "isdn_net: Could not register net-device\n");
  16907. kfree(netdev->local);
  16908. @@ -2658,6 +3558,9 @@ isdn_net_new(char *name, struct net_devi
  16909. netdev->local->hupflags = ISDN_INHUP; /* Do hangup even on incoming calls */
  16910. netdev->local->onhtime = 10; /* Default hangup-time for saving costs
  16911. of those who forget configuring this */
  16912. +#ifdef CONFIG_ISDN_WITH_ABC
  16913. + netdev->local->dw_abc_old_onhtime = netdev->local->onhtime;
  16914. +#endif
  16915. netdev->local->dialmax = 1;
  16916. netdev->local->flags = ISDN_NET_CBHUP | ISDN_NET_DM_MANUAL; /* Hangup before Callback, manual dial */
  16917. netdev->local->cbdelay = 25; /* Wait 5 secs before Callback */
  16918. @@ -2831,7 +3734,6 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg
  16919. /* If binding is exclusive, try to grab the channel */
  16920. save_flags(flags);
  16921. - cli();
  16922. if ((i = isdn_get_free_channel(ISDN_USAGE_NET,
  16923. lp->l2_proto, lp->l3_proto, drvidx,
  16924. chidx, lp->msn)) < 0) {
  16925. @@ -2859,6 +3761,9 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg
  16926. lp->pre_device = drvidx;
  16927. lp->pre_channel = chidx;
  16928. lp->onhtime = cfg->onhtime;
  16929. +#ifdef CONFIG_ISDN_WITH_ABC
  16930. + lp->dw_abc_old_onhtime = lp->onhtime;
  16931. +#endif
  16932. lp->charge = cfg->charge;
  16933. lp->l2_proto = cfg->l2_proto;
  16934. lp->l3_proto = cfg->l3_proto;
  16935. @@ -2932,6 +3837,9 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg
  16936. }
  16937. }
  16938. lp->p_encap = cfg->p_encap;
  16939. +#ifdef CONFIG_ISDN_WITH_ABC
  16940. + isdn_dw_abc_reset_interface(lp,0);
  16941. +#endif
  16942. return 0;
  16943. }
  16944. return -ENODEV;
  16945. @@ -3007,6 +3915,9 @@ isdn_net_addphone(isdn_net_ioctl_phone *
  16946. strcpy(n->num, phone->phone);
  16947. n->next = p->local->phone[phone->outgoing & 1];
  16948. p->local->phone[phone->outgoing & 1] = n;
  16949. +#ifdef CONFIG_ISDN_WITH_ABC
  16950. + isdn_dwabc_test_phone(p->local);
  16951. +#endif
  16952. return 0;
  16953. }
  16954. return -ENODEV;
  16955. @@ -3100,6 +4011,9 @@ isdn_net_delphone(isdn_net_ioctl_phone *
  16956. else
  16957. p->local->phone[inout] = n->next;
  16958. kfree(n);
  16959. +#ifdef CONFIG_ISDN_WITH_ABC
  16960. + isdn_dwabc_test_phone(p->local);
  16961. +#endif
  16962. restore_flags(flags);
  16963. return 0;
  16964. }
  16965. @@ -3135,6 +4049,9 @@ isdn_net_rmallphone(isdn_net_dev * p)
  16966. p->local->phone[i] = NULL;
  16967. }
  16968. p->local->dial = NULL;
  16969. +#ifdef CONFIG_ISDN_WITH_ABC
  16970. + isdn_dwabc_test_phone(p->local);
  16971. +#endif
  16972. restore_flags(flags);
  16973. return 0;
  16974. }
  16975. @@ -3218,6 +4135,10 @@ isdn_net_realrm(isdn_net_dev * p, isdn_n
  16976. /* If no more net-devices remain, disable auto-hangup timer */
  16977. if (dev->netdev == NULL)
  16978. isdn_timer_ctrl(ISDN_TIMER_NETHANGUP, 0);
  16979. +#ifdef CONFIG_ISDN_WITH_ABC
  16980. + isdn_dw_clear_if(~0l,p->local);
  16981. + dwabc_bsd_free(p->local);
  16982. +#endif
  16983. restore_flags(flags);
  16984. kfree(p->local);
  16985. kfree(p);
  16986. Index: linux-2.4.35.4/drivers/isdn/isdn_net.h
  16987. ===================================================================
  16988. --- linux-2.4.35.4.orig/drivers/isdn/isdn_net.h
  16989. +++ linux-2.4.35.4/drivers/isdn/isdn_net.h
  16990. @@ -1,4 +1,4 @@
  16991. -/* $Id: isdn_net.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  16992. +/* $Id: isdn_net.h,v 1.23 2001/11/07 22:35:48 kai Exp $
  16993. *
  16994. * header for Linux ISDN subsystem, network related functions (linklevel).
  16995. *
  16996. @@ -26,6 +26,7 @@
  16997. #define CISCO_ADDR_BROADCAST 0x8f
  16998. #define CISCO_CTRL 0x00
  16999. #define CISCO_TYPE_CDP 0x2000
  17000. +#define CISCO_TYPE_INET 0x0800
  17001. #define CISCO_TYPE_SLARP 0x8035
  17002. #define CISCO_SLARP_REQUEST 0
  17003. #define CISCO_SLARP_REPLY 1
  17004. @@ -106,8 +107,6 @@ static __inline__ void isdn_net_add_to_b
  17005. spin_lock_irqsave(&nd->queue_lock, flags);
  17006. lp = nd->queue;
  17007. -// printk(KERN_DEBUG __FUNCTION__": lp:%s(%p) nlp:%s(%p) last(%p)\n",
  17008. -// lp->name, lp, nlp->name, nlp, lp->last);
  17009. nlp->last = lp->last;
  17010. lp->last->next = nlp;
  17011. lp->last = nlp;
  17012. @@ -127,20 +126,12 @@ static __inline__ void isdn_net_rm_from_
  17013. if (lp->master)
  17014. master_lp = (isdn_net_local *) lp->master->priv;
  17015. -// printk(KERN_DEBUG __FUNCTION__": lp:%s(%p) mlp:%s(%p) last(%p) next(%p) mndq(%p)\n",
  17016. -// lp->name, lp, master_lp->name, master_lp, lp->last, lp->next, master_lp->netdev->queue);
  17017. spin_lock_irqsave(&master_lp->netdev->queue_lock, flags);
  17018. lp->last->next = lp->next;
  17019. lp->next->last = lp->last;
  17020. - if (master_lp->netdev->queue == lp) {
  17021. + if (master_lp->netdev->queue == lp)
  17022. master_lp->netdev->queue = lp->next;
  17023. - if (lp->next == lp) { /* last in queue */
  17024. - master_lp->netdev->queue = master_lp->netdev->local;
  17025. - }
  17026. - }
  17027. lp->next = lp->last = lp; /* (re)set own pointers */
  17028. -// printk(KERN_DEBUG __FUNCTION__": mndq(%p)\n",
  17029. -// master_lp->netdev->queue);
  17030. spin_unlock_irqrestore(&master_lp->netdev->queue_lock, flags);
  17031. }
  17032. Index: linux-2.4.35.4/drivers/isdn/isdn_ppp.c
  17033. ===================================================================
  17034. --- linux-2.4.35.4.orig/drivers/isdn/isdn_ppp.c
  17035. +++ linux-2.4.35.4/drivers/isdn/isdn_ppp.c
  17036. @@ -1,4 +1,4 @@
  17037. -/* $Id: isdn_ppp.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  17038. +/* $Id: isdn_ppp.c,v 1.94 2001/11/07 22:35:48 kai Exp $
  17039. *
  17040. * Linux ISDN subsystem, functions for synchronous PPP (linklevel).
  17041. *
  17042. @@ -13,9 +13,6 @@
  17043. #include <linux/isdn.h>
  17044. #include <linux/poll.h>
  17045. #include <linux/ppp-comp.h>
  17046. -#ifdef CONFIG_IPPP_FILTER
  17047. -#include <linux/filter.h>
  17048. -#endif
  17049. #include "isdn_common.h"
  17050. #include "isdn_ppp.h"
  17051. @@ -72,11 +69,19 @@ static void isdn_ppp_mp_cleanup( isdn_ne
  17052. static int isdn_ppp_bundle(struct ippp_struct *, int unit);
  17053. #endif /* CONFIG_ISDN_MPP */
  17054. -char *isdn_ppp_revision = "$Revision: 1.1.4.1 $";
  17055. +char *isdn_ppp_revision = "$Revision: 1.94 $";
  17056. static struct ippp_struct *ippp_table[ISDN_MAX_CHANNELS];
  17057. +#ifndef CONFIG_ISDN_WITH_ABC
  17058. static struct isdn_ppp_compressor *ipc_head = NULL;
  17059. +#else
  17060. + /*
  17061. + ** make compressor's common usable
  17062. + */
  17063. +struct isdn_ppp_compressor *isdn_ippp_comp_head = NULL;
  17064. +#define ipc_head isdn_ippp_comp_head
  17065. +#endif
  17066. /*
  17067. * frame log (debug)
  17068. @@ -110,11 +115,8 @@ isdn_ppp_free(isdn_net_local * lp)
  17069. unsigned long flags;
  17070. struct ippp_struct *is;
  17071. - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
  17072. - printk(KERN_ERR "%s: ppp_slot(%d) out of range\n",
  17073. - __FUNCTION__, lp->ppp_slot);
  17074. + if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS)
  17075. return 0;
  17076. - }
  17077. save_flags(flags);
  17078. cli();
  17079. @@ -130,12 +132,7 @@ isdn_ppp_free(isdn_net_local * lp)
  17080. lp->netdev->pb->ref_ct--;
  17081. spin_unlock(&lp->netdev->pb->lock);
  17082. #endif /* CONFIG_ISDN_MPP */
  17083. - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
  17084. - printk(KERN_ERR "%s: ppp_slot(%d) now invalid\n",
  17085. - __FUNCTION__, lp->ppp_slot);
  17086. - restore_flags(flags);
  17087. - return 0;
  17088. - }
  17089. +
  17090. is = ippp_table[lp->ppp_slot];
  17091. if ((is->state & IPPP_CONNECT))
  17092. isdn_ppp_closewait(lp->ppp_slot); /* force wakeup on ippp device */
  17093. @@ -231,13 +228,12 @@ isdn_ppp_bind(isdn_net_local * lp)
  17094. void
  17095. isdn_ppp_wakeup_daemon(isdn_net_local * lp)
  17096. {
  17097. - if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) {
  17098. - printk(KERN_ERR "%s: ppp_slot(%d) out of range\n",
  17099. - __FUNCTION__, lp->ppp_slot);
  17100. + if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS)
  17101. return;
  17102. - }
  17103. +
  17104. ippp_table[lp->ppp_slot]->state = IPPP_OPEN | IPPP_CONNECT | IPPP_NOBLOCK;
  17105. - wake_up_interruptible(&ippp_table[lp->ppp_slot]->wq);
  17106. +
  17107. + wake_up_interruptible(&ippp_table[lp->ppp_slot]->wq);
  17108. }
  17109. /*
  17110. @@ -250,14 +246,13 @@ isdn_ppp_closewait(int slot)
  17111. {
  17112. struct ippp_struct *is;
  17113. - if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
  17114. - printk(KERN_ERR "%s: slot(%d) out of range\n",
  17115. - __FUNCTION__, slot);
  17116. + if (slot < 0 || slot >= ISDN_MAX_CHANNELS)
  17117. return 0;
  17118. - }
  17119. is = ippp_table[slot];
  17120. +
  17121. if (is->state)
  17122. wake_up_interruptible(&is->wq);
  17123. +
  17124. is->state = IPPP_CLOSEWAIT;
  17125. return 1;
  17126. }
  17127. @@ -295,9 +290,11 @@ isdn_ppp_open(int min, struct file *file
  17128. return -EBUSY;
  17129. }
  17130. is = file->private_data = ippp_table[slot];
  17131. -
  17132. - printk(KERN_DEBUG "ippp, open, slot: %d, minor: %d, state: %04x\n",
  17133. - slot, min, is->state);
  17134. +
  17135. +#if 0
  17136. + if (is->debug & 0x1)
  17137. +#endif
  17138. + printk(KERN_DEBUG "ippp, open, slot: %d, minor: %d, state: %04x\n", slot, min, is->state);
  17139. /* compression stuff */
  17140. is->link_compressor = is->compressor = NULL;
  17141. @@ -327,10 +324,7 @@ isdn_ppp_open(int min, struct file *file
  17142. */
  17143. is->slcomp = slhc_init(16, 16); /* not necessary for 2. link in bundle */
  17144. #endif
  17145. -#ifdef CONFIG_IPPP_FILTER
  17146. - is->pass_filter.filter = NULL;
  17147. - is->active_filter.filter = NULL;
  17148. -#endif
  17149. +
  17150. is->state = IPPP_OPEN;
  17151. return 0;
  17152. @@ -349,20 +343,12 @@ isdn_ppp_release(int min, struct file *f
  17153. return;
  17154. is = file->private_data;
  17155. - if (!is) {
  17156. - printk(KERN_ERR "%s: no file->private_data\n", __FUNCTION__);
  17157. - return;
  17158. - }
  17159. if (is->debug & 0x1)
  17160. printk(KERN_DEBUG "ippp: release, minor: %d %lx\n", min, (long) is->lp);
  17161. if (is->lp) { /* a lp address says: this link is still up */
  17162. isdn_net_dev *p = is->lp->netdev;
  17163. - if (!p) {
  17164. - printk(KERN_ERR "%s: no lp->netdev\n", __FUNCTION__);
  17165. - return;
  17166. - }
  17167. is->state &= ~IPPP_CONNECT; /* -> effect: no call of wakeup */
  17168. /*
  17169. * isdn_net_hangup() calls isdn_ppp_free()
  17170. @@ -385,18 +371,8 @@ isdn_ppp_release(int min, struct file *f
  17171. slhc_free(is->slcomp);
  17172. is->slcomp = NULL;
  17173. #endif
  17174. -#ifdef CONFIG_IPPP_FILTER
  17175. - if (is->pass_filter.filter) {
  17176. - kfree(is->pass_filter.filter);
  17177. - is->pass_filter.filter = NULL;
  17178. - }
  17179. - if (is->active_filter.filter) {
  17180. - kfree(is->active_filter.filter);
  17181. - is->active_filter.filter = NULL;
  17182. - }
  17183. -#endif
  17184. -/* TODO: if this was the previous master: link the stuff to the new master */
  17185. +/* TODO: if this was the previous master: link the the stuff to the new master */
  17186. if(is->comp_stat)
  17187. is->compressor->free(is->comp_stat);
  17188. if(is->link_comp_stat)
  17189. @@ -509,13 +485,15 @@ isdn_ppp_ioctl(int min, struct file *fil
  17190. if (val & SC_ENABLE_IP && !(is->pppcfg & SC_ENABLE_IP) && (is->state & IPPP_CONNECT)) {
  17191. if (lp) {
  17192. /* OK .. we are ready to send buffers */
  17193. - is->pppcfg = val; /* isdn_ppp_xmit test for SC_ENABLE_IP !!! */
  17194. netif_wake_queue(&lp->netdev->dev);
  17195. - break;
  17196. }
  17197. }
  17198. is->pppcfg = val;
  17199. break;
  17200. +#if 0
  17201. + case PPPIOCGSTAT: /* read PPP statistic information */
  17202. + break;
  17203. +#endif
  17204. case PPPIOCGIDLE: /* get idle time information */
  17205. if (lp) {
  17206. struct ppp_idle pidle;
  17207. @@ -604,39 +582,6 @@ isdn_ppp_ioctl(int min, struct file *fil
  17208. }
  17209. return set_arg((void *)arg,&pci,sizeof(struct pppcallinfo));
  17210. }
  17211. -#ifdef CONFIG_IPPP_FILTER
  17212. - case PPPIOCSPASS:
  17213. - case PPPIOCSACTIVE:
  17214. - {
  17215. - struct sock_fprog uprog, *filtp;
  17216. - struct sock_filter *code = NULL;
  17217. - int len, err;
  17218. -
  17219. - if (copy_from_user(&uprog, (void *) arg, sizeof(uprog)))
  17220. - return -EFAULT;
  17221. - if (uprog.len > 0 && uprog.len < 65536) {
  17222. - len = uprog.len * sizeof(struct sock_filter);
  17223. - code = kmalloc(len, GFP_KERNEL);
  17224. - if (code == NULL)
  17225. - return -ENOMEM;
  17226. - if (copy_from_user(code, uprog.filter, len)) {
  17227. - kfree(code);
  17228. - return -EFAULT;
  17229. - }
  17230. - err = sk_chk_filter(code, uprog.len);
  17231. - if (err) {
  17232. - kfree(code);
  17233. - return err;
  17234. - }
  17235. - }
  17236. - filtp = (cmd == PPPIOCSPASS) ? &is->pass_filter : &is->active_filter;
  17237. - if (filtp->filter)
  17238. - kfree(filtp->filter);
  17239. - filtp->filter = code;
  17240. - filtp->len = uprog.len;
  17241. - break;
  17242. - }
  17243. -#endif /* CONFIG_IPPP_FILTER */
  17244. default:
  17245. break;
  17246. }
  17247. @@ -699,7 +644,7 @@ isdn_ppp_fill_rq(unsigned char *buf, int
  17248. struct ippp_struct *is;
  17249. if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
  17250. - printk(KERN_WARNING "ippp: illegal slot(%d).\n", slot);
  17251. + printk(KERN_WARNING "ippp: illegal slot.\n");
  17252. return 0;
  17253. }
  17254. is = ippp_table[slot];
  17255. @@ -976,8 +921,7 @@ void isdn_ppp_receive(isdn_net_dev * net
  17256. slot = lp->ppp_slot;
  17257. if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
  17258. - printk(KERN_ERR "isdn_ppp_receive: lp->ppp_slot(%d)\n",
  17259. - lp->ppp_slot);
  17260. + printk(KERN_ERR "isdn_ppp_receive: lp->ppp_slot %d\n", lp->ppp_slot);
  17261. kfree_skb(skb);
  17262. return;
  17263. }
  17264. @@ -1026,23 +970,19 @@ isdn_ppp_push_higher(isdn_net_dev * net_
  17265. {
  17266. struct net_device *dev = &net_dev->dev;
  17267. struct ippp_struct *is, *mis;
  17268. - isdn_net_local *mlp = NULL;
  17269. int slot;
  17270. slot = lp->ppp_slot;
  17271. if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
  17272. - printk(KERN_ERR "isdn_ppp_push_higher: lp->ppp_slot(%d)\n",
  17273. - lp->ppp_slot);
  17274. + printk(KERN_ERR "isdn_ppp_push_higher: lp->ppp_slot %d\n", lp->ppp_slot);
  17275. goto drop_packet;
  17276. }
  17277. is = ippp_table[slot];
  17278. if (lp->master) { // FIXME?
  17279. - mlp = (isdn_net_local *) lp->master->priv;
  17280. - slot = mlp->ppp_slot;
  17281. + slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
  17282. if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
  17283. - printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot(%d)\n",
  17284. - lp->ppp_slot);
  17285. + printk(KERN_ERR "isdn_ppp_push_higher: master->ppp_slot %d\n", lp->ppp_slot);
  17286. goto drop_packet;
  17287. }
  17288. }
  17289. @@ -1076,11 +1016,6 @@ isdn_ppp_push_higher(isdn_net_dev * net_
  17290. case PPP_VJC_UNCOMP:
  17291. if (is->debug & 0x20)
  17292. printk(KERN_DEBUG "isdn_ppp: VJC_UNCOMP\n");
  17293. - if (net_dev->local->ppp_slot < 0) {
  17294. - printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n",
  17295. - __FUNCTION__, net_dev->local->ppp_slot);
  17296. - goto drop_packet;
  17297. - }
  17298. if (slhc_remember(ippp_table[net_dev->local->ppp_slot]->slcomp, skb->data, skb->len) <= 0) {
  17299. printk(KERN_WARNING "isdn_ppp: received illegal VJC_UNCOMP frame!\n");
  17300. goto drop_packet;
  17301. @@ -1102,11 +1037,6 @@ isdn_ppp_push_higher(isdn_net_dev * net_
  17302. }
  17303. skb_put(skb, skb_old->len + 128);
  17304. memcpy(skb->data, skb_old->data, skb_old->len);
  17305. - if (net_dev->local->ppp_slot < 0) {
  17306. - printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n",
  17307. - __FUNCTION__, net_dev->local->ppp_slot);
  17308. - goto drop_packet;
  17309. - }
  17310. pkt_len = slhc_uncompress(ippp_table[net_dev->local->ppp_slot]->slcomp,
  17311. skb->data, skb_old->len);
  17312. kfree_skb(skb_old);
  17313. @@ -1133,36 +1063,12 @@ isdn_ppp_push_higher(isdn_net_dev * net_
  17314. return;
  17315. }
  17316. -#ifdef CONFIG_IPPP_FILTER
  17317. - /* check if the packet passes the pass and active filters
  17318. - * the filter instructions are constructed assuming
  17319. - * a four-byte PPP header on each packet (which is still present) */
  17320. - skb_push(skb, 4);
  17321. - skb->data[0] = 0; /* indicate inbound */
  17322. -
  17323. - if (is->pass_filter.filter
  17324. - && sk_run_filter(skb, is->pass_filter.filter,
  17325. - is->pass_filter.len) == 0) {
  17326. - if (is->debug & 0x2)
  17327. - printk(KERN_DEBUG "IPPP: inbound frame filtered.\n");
  17328. - kfree_skb(skb);
  17329. - return;
  17330. - }
  17331. - if (!(is->active_filter.filter
  17332. - && sk_run_filter(skb, is->active_filter.filter,
  17333. - is->active_filter.len) == 0)) {
  17334. - if (is->debug & 0x2)
  17335. - printk(KERN_DEBUG "IPPP: link-active filter: reseting huptimer.\n");
  17336. - lp->huptimer = 0;
  17337. - if (mlp)
  17338. - mlp->huptimer = 0;
  17339. - }
  17340. - skb_pull(skb, 4);
  17341. -#else /* CONFIG_IPPP_FILTER */
  17342. - lp->huptimer = 0;
  17343. - if (mlp)
  17344. - mlp->huptimer = 0;
  17345. -#endif /* CONFIG_IPPP_FILTER */
  17346. + /* Reset hangup-timer */
  17347. + lp->huptimer = 0;
  17348. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  17349. + lp->dw_abc_bchan_errcnt = 0;
  17350. +#endif
  17351. +
  17352. skb->dev = dev;
  17353. skb->mac.raw = skb->data;
  17354. netif_rx(skb);
  17355. @@ -1199,6 +1105,7 @@ static unsigned char *isdn_ppp_skb_push(
  17356. return skb_push(skb,len);
  17357. }
  17358. +
  17359. /*
  17360. * send ppp frame .. we expect a PIDCOMPressable proto --
  17361. * (here: currently always PPP_IP,PPP_VJC_COMP,PPP_VJC_UNCOMP)
  17362. @@ -1214,25 +1121,23 @@ isdn_ppp_xmit(struct sk_buff *skb, struc
  17363. isdn_net_dev *nd;
  17364. unsigned int proto = PPP_IP; /* 0x21 */
  17365. struct ippp_struct *ipt,*ipts;
  17366. - int slot, retval = 0;
  17367. + int slot;
  17368. mlp = (isdn_net_local *) (netdev->priv);
  17369. nd = mlp->netdev; /* get master lp */
  17370. slot = mlp->ppp_slot;
  17371. if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
  17372. - printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot(%d)\n",
  17373. - mlp->ppp_slot);
  17374. + printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot %d\n", mlp->ppp_slot);
  17375. kfree_skb(skb);
  17376. - goto out;
  17377. + return 0;
  17378. }
  17379. ipts = ippp_table[slot];
  17380. if (!(ipts->pppcfg & SC_ENABLE_IP)) { /* PPP connected ? */
  17381. if (ipts->debug & 0x1)
  17382. printk(KERN_INFO "%s: IP frame delayed.\n", netdev->name);
  17383. - retval = 1;
  17384. - goto out;
  17385. + return 1;
  17386. }
  17387. switch (ntohs(skb->protocol)) {
  17388. @@ -1246,25 +1151,24 @@ isdn_ppp_xmit(struct sk_buff *skb, struc
  17389. printk(KERN_ERR "isdn_ppp: skipped unsupported protocol: %#x.\n",
  17390. skb->protocol);
  17391. dev_kfree_skb(skb);
  17392. - goto out;
  17393. + return 0;
  17394. }
  17395. lp = isdn_net_get_locked_lp(nd);
  17396. if (!lp) {
  17397. printk(KERN_WARNING "%s: all channels busy - requeuing!\n", netdev->name);
  17398. - retval = 1;
  17399. - goto out;
  17400. + return 1;
  17401. }
  17402. /* we have our lp locked from now on */
  17403. slot = lp->ppp_slot;
  17404. if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
  17405. - printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot(%d)\n",
  17406. - lp->ppp_slot);
  17407. + printk(KERN_ERR "isdn_ppp_xmit: lp->ppp_slot %d\n", lp->ppp_slot);
  17408. kfree_skb(skb);
  17409. - goto unlock;
  17410. + return 0;
  17411. }
  17412. ipt = ippp_table[slot];
  17413. + lp->huptimer = 0;
  17414. /*
  17415. * after this line .. requeueing in the device queue is no longer allowed!!!
  17416. @@ -1275,34 +1179,6 @@ isdn_ppp_xmit(struct sk_buff *skb, struc
  17417. */
  17418. skb_pull(skb,IPPP_MAX_HEADER);
  17419. -#ifdef CONFIG_IPPP_FILTER
  17420. - /* check if we should pass this packet
  17421. - * the filter instructions are constructed assuming
  17422. - * a four-byte PPP header on each packet */
  17423. - skb_push(skb, 4);
  17424. - skb->data[0] = 1; /* indicate outbound */
  17425. - *(u_int16_t *)(skb->data + 2) = htons(proto);
  17426. -
  17427. - if (ipt->pass_filter.filter
  17428. - && sk_run_filter(skb, ipt->pass_filter.filter,
  17429. - ipt->pass_filter.len) == 0) {
  17430. - if (ipt->debug & 0x4)
  17431. - printk(KERN_DEBUG "IPPP: outbound frame filtered.\n");
  17432. - kfree_skb(skb);
  17433. - goto unlock;
  17434. - }
  17435. - if (!(ipt->active_filter.filter
  17436. - && sk_run_filter(skb, ipt->active_filter.filter,
  17437. - ipt->active_filter.len) == 0)) {
  17438. - if (ipt->debug & 0x4)
  17439. - printk(KERN_DEBUG "IPPP: link-active filter: reseting huptimer.\n");
  17440. - lp->huptimer = 0;
  17441. - }
  17442. - skb_pull(skb, 4);
  17443. -#else /* CONFIG_IPPP_FILTER */
  17444. - lp->huptimer = 0;
  17445. -#endif /* CONFIG_IPPP_FILTER */
  17446. -
  17447. if (ipt->debug & 0x4)
  17448. printk(KERN_DEBUG "xmit skb, len %d\n", (int) skb->len);
  17449. if (ipts->debug & 0x40)
  17450. @@ -1440,54 +1316,9 @@ isdn_ppp_xmit(struct sk_buff *skb, struc
  17451. unlock:
  17452. spin_unlock_bh(&lp->xmit_lock);
  17453. - out:
  17454. - return retval;
  17455. + return 0;
  17456. }
  17457. -#ifdef CONFIG_IPPP_FILTER
  17458. -/*
  17459. - * check if this packet may trigger auto-dial.
  17460. - */
  17461. -
  17462. -int isdn_ppp_autodial_filter(struct sk_buff *skb, isdn_net_local *lp)
  17463. -{
  17464. - struct ippp_struct *is = ippp_table[lp->ppp_slot];
  17465. - u_int16_t proto;
  17466. - int drop = 0;
  17467. -
  17468. - switch (ntohs(skb->protocol)) {
  17469. - case ETH_P_IP:
  17470. - proto = PPP_IP;
  17471. - break;
  17472. - case ETH_P_IPX:
  17473. - proto = PPP_IPX;
  17474. - break;
  17475. - default:
  17476. - printk(KERN_ERR "isdn_ppp_autodial_filter: unsupported protocol 0x%x.\n",
  17477. - skb->protocol);
  17478. - return 1;
  17479. - }
  17480. -
  17481. - /* the filter instructions are constructed assuming
  17482. - * a four-byte PPP header on each packet. we have to
  17483. - * temporarily remove part of the fake header stuck on
  17484. - * earlier.
  17485. - */
  17486. - skb_pull(skb, IPPP_MAX_HEADER - 4);
  17487. - skb->data[0] = 1; /* indicate outbound */
  17488. - *(u_int16_t *)(skb->data + 2) = htons(proto);
  17489. -
  17490. - drop |= is->pass_filter.filter
  17491. - && sk_run_filter(skb, is->pass_filter.filter,
  17492. - is->pass_filter.len) == 0;
  17493. - drop |= is->active_filter.filter
  17494. - && sk_run_filter(skb, is->active_filter.filter,
  17495. - is->active_filter.len) == 0;
  17496. -
  17497. - skb_push(skb, IPPP_MAX_HEADER - 4);
  17498. - return drop;
  17499. -}
  17500. -#endif
  17501. #ifdef CONFIG_ISDN_MPP
  17502. /* this is _not_ rfc1990 header, but something we convert both short and long
  17503. @@ -1537,15 +1368,8 @@ static ippp_bundle * isdn_ppp_mp_bundle_
  17504. static int isdn_ppp_mp_init( isdn_net_local * lp, ippp_bundle * add_to )
  17505. {
  17506. - struct ippp_struct * is;
  17507. -
  17508. - if (lp->ppp_slot < 0) {
  17509. - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
  17510. - __FUNCTION__, lp->ppp_slot);
  17511. - return(-EINVAL);
  17512. - }
  17513. -
  17514. - is = ippp_table[lp->ppp_slot];
  17515. + struct ippp_struct * is = ippp_table[lp->ppp_slot];
  17516. +
  17517. if (add_to) {
  17518. if( lp->netdev->pb )
  17519. lp->netdev->pb->ref_ct--;
  17520. @@ -1591,8 +1415,7 @@ static void isdn_ppp_mp_receive(isdn_net
  17521. stats = &mp->stats;
  17522. slot = lp->ppp_slot;
  17523. if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
  17524. - printk(KERN_ERR "%s: lp->ppp_slot(%d)\n",
  17525. - __FUNCTION__, lp->ppp_slot);
  17526. + printk(KERN_ERR "isdn_ppp_mp_receive: lp->ppp_slot %d\n", lp->ppp_slot);
  17527. stats->frame_drops++;
  17528. dev_kfree_skb(skb);
  17529. spin_unlock_irqrestore(&mp->lock, flags);
  17530. @@ -1628,8 +1451,7 @@ static void isdn_ppp_mp_receive(isdn_net
  17531. for (lpq = net_dev->queue;;) {
  17532. slot = lpq->ppp_slot;
  17533. if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
  17534. - printk(KERN_ERR "%s: lpq->ppp_slot(%d)\n",
  17535. - __FUNCTION__, lpq->ppp_slot);
  17536. + printk(KERN_ERR "isdn_ppp_mp_receive: lpq->ppp_slot %d\n", lpq->ppp_slot);
  17537. } else {
  17538. u32 lls = ippp_table[slot]->last_link_seqno;
  17539. if (MP_LT(lls, minseq))
  17540. @@ -1861,14 +1683,9 @@ void isdn_ppp_mp_reassembly( isdn_net_de
  17541. struct sk_buff * skb;
  17542. unsigned int tot_len;
  17543. - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
  17544. - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
  17545. - __FUNCTION__, lp->ppp_slot);
  17546. - return;
  17547. - }
  17548. if( MP_FLAGS(from) == (MP_BEGIN_FRAG | MP_END_FRAG) ) {
  17549. if( ippp_table[lp->ppp_slot]->debug & 0x40 )
  17550. - printk(KERN_DEBUG "isdn_mppp: reassembly: frame %d, "
  17551. + printk(KERN_DEBUG"isdn_mppp: reassembly: frame %d, "
  17552. "len %d\n", MP_SEQ(from), from->len );
  17553. skb = from;
  17554. skb_pull(skb, MP_HEADER_LEN);
  17555. @@ -1987,10 +1804,8 @@ isdn_ppp_dev_ioctl_stats(int slot, struc
  17556. memset(&t, 0, sizeof(struct ppp_stats));
  17557. if (dev->flags & IFF_UP) {
  17558. t.p.ppp_ipackets = lp->stats.rx_packets;
  17559. - t.p.ppp_ibytes = lp->stats.rx_bytes;
  17560. t.p.ppp_ierrors = lp->stats.rx_errors;
  17561. t.p.ppp_opackets = lp->stats.tx_packets;
  17562. - t.p.ppp_obytes = lp->stats.tx_bytes;
  17563. t.p.ppp_oerrors = lp->stats.tx_errors;
  17564. #ifdef CONFIG_ISDN_PPP_VJ
  17565. if (slot >= 0 && ippp_table[slot]->slcomp) {
  17566. @@ -2018,6 +1833,9 @@ isdn_ppp_dev_ioctl(struct net_device *de
  17567. int len;
  17568. isdn_net_local *lp = (isdn_net_local *) dev->priv;
  17569. +#if 0
  17570. + printk(KERN_DEBUG "ippp, dev_ioctl: cmd %#08x , %d \n", cmd, lp->ppp_slot);
  17571. +#endif
  17572. if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP)
  17573. return -EINVAL;
  17574. @@ -2432,7 +2250,7 @@ static void isdn_ppp_ccp_reset_trans(str
  17575. return;
  17576. }
  17577. rs->state = CCPResetSentReq;
  17578. - /* We always expect an Ack if the decompressor doesn't
  17579. + /* We always expect an Ack if the decompressor doesnt
  17580. know better */
  17581. rs->expra = 1;
  17582. rs->dlen = 0;
  17583. @@ -2583,7 +2401,13 @@ static struct sk_buff *isdn_ppp_compress
  17584. }
  17585. if(type) { /* type=1 => Link compression */
  17586. +#if 0
  17587. + compressor = is->link_compressor;
  17588. + stat = is->link_comp_stat;
  17589. + new_proto = PPP_LINK_COMP;
  17590. +#else
  17591. return skb_in;
  17592. +#endif
  17593. }
  17594. else {
  17595. if(!master) {
  17596. @@ -2631,31 +2455,18 @@ static struct sk_buff *isdn_ppp_compress
  17597. static void isdn_ppp_receive_ccp(isdn_net_dev *net_dev, isdn_net_local *lp,
  17598. struct sk_buff *skb,int proto)
  17599. {
  17600. - struct ippp_struct *is;
  17601. + struct ippp_struct *is = ippp_table[lp->ppp_slot];
  17602. struct ippp_struct *mis;
  17603. int len;
  17604. struct isdn_ppp_resetparams rsparm;
  17605. unsigned char rsdata[IPPP_RESET_MAXDATABYTES];
  17606. - printk(KERN_DEBUG "Received CCP frame from peer slot(%d)\n",
  17607. - lp->ppp_slot);
  17608. - if (lp->ppp_slot < 0 || lp->ppp_slot > ISDN_MAX_CHANNELS) {
  17609. - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
  17610. - __FUNCTION__, lp->ppp_slot);
  17611. - return;
  17612. - }
  17613. - is = ippp_table[lp->ppp_slot];
  17614. + printk(KERN_DEBUG "Received CCP frame from peer\n");
  17615. isdn_ppp_frame_log("ccp-rcv", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
  17616. - if(lp->master) {
  17617. - int slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
  17618. - if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
  17619. - printk(KERN_ERR "%s: slot(%d) out of range\n",
  17620. - __FUNCTION__, slot);
  17621. - return;
  17622. - }
  17623. - mis = ippp_table[slot];
  17624. - } else
  17625. + if(lp->master)
  17626. + mis = ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot];
  17627. + else
  17628. mis = is;
  17629. switch(skb->data[0]) {
  17630. @@ -2807,18 +2618,13 @@ static void isdn_ppp_receive_ccp(isdn_ne
  17631. static void isdn_ppp_send_ccp(isdn_net_dev *net_dev, isdn_net_local *lp, struct sk_buff *skb)
  17632. {
  17633. - struct ippp_struct *mis,*is;
  17634. - int proto, slot = lp->ppp_slot;
  17635. + struct ippp_struct *mis,*is = ippp_table[lp->ppp_slot];
  17636. + int proto;
  17637. unsigned char *data;
  17638. if(!skb || skb->len < 3)
  17639. return;
  17640. - if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
  17641. - printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
  17642. - __FUNCTION__, slot);
  17643. - return;
  17644. - }
  17645. - is = ippp_table[slot];
  17646. +
  17647. /* Daemon may send with or without address and control field comp */
  17648. data = skb->data;
  17649. if(!(is->pppcfg & SC_COMP_AC) && data[0] == 0xff && data[1] == 0x03) {
  17650. @@ -2834,17 +2640,12 @@ static void isdn_ppp_send_ccp(isdn_net_d
  17651. printk(KERN_DEBUG "Received CCP frame from daemon:\n");
  17652. isdn_ppp_frame_log("ccp-xmit", skb->data, skb->len, 32, is->unit,lp->ppp_slot);
  17653. - if (lp->master) {
  17654. - slot = ((isdn_net_local *) (lp->master->priv))->ppp_slot;
  17655. - if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
  17656. - printk(KERN_ERR "%s: slot(%d) out of range\n",
  17657. - __FUNCTION__, slot);
  17658. - return;
  17659. - }
  17660. - mis = ippp_table[slot];
  17661. - } else
  17662. - mis = is;
  17663. - if (mis != is)
  17664. + if(lp->master)
  17665. + mis = ippp_table[((isdn_net_local *) (lp->master->priv))->ppp_slot];
  17666. + else
  17667. + mis = is;
  17668. +
  17669. + if(mis != is)
  17670. printk(KERN_DEBUG "isdn_ppp: Ouch! Master CCP sends on slave slot!\n");
  17671. switch(data[2]) {
  17672. Index: linux-2.4.35.4/drivers/isdn/isdn_ppp.h
  17673. ===================================================================
  17674. --- linux-2.4.35.4.orig/drivers/isdn/isdn_ppp.h
  17675. +++ linux-2.4.35.4/drivers/isdn/isdn_ppp.h
  17676. @@ -1,4 +1,4 @@
  17677. -/* $Id: isdn_ppp.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  17678. +/* $Id: isdn_ppp.h,v 1.18 2001/09/24 13:22:42 kai Exp $
  17679. *
  17680. * header for Linux ISDN subsystem, functions for synchronous PPP (linklevel).
  17681. *
  17682. @@ -19,7 +19,6 @@ extern int isdn_ppp_init(void);
  17683. extern void isdn_ppp_cleanup(void);
  17684. extern int isdn_ppp_free(isdn_net_local *);
  17685. extern int isdn_ppp_bind(isdn_net_local *);
  17686. -extern int isdn_ppp_autodial_filter(struct sk_buff *, isdn_net_local *);
  17687. extern int isdn_ppp_xmit(struct sk_buff *, struct net_device *);
  17688. extern void isdn_ppp_receive(isdn_net_dev *, isdn_net_local *, struct sk_buff *);
  17689. extern int isdn_ppp_dev_ioctl(struct net_device *, struct ifreq *, int);
  17690. Index: linux-2.4.35.4/drivers/isdn/isdn_tty.c
  17691. ===================================================================
  17692. --- linux-2.4.35.4.orig/drivers/isdn/isdn_tty.c
  17693. +++ linux-2.4.35.4/drivers/isdn/isdn_tty.c
  17694. @@ -1,4 +1,4 @@
  17695. -/* $Id: isdn_tty.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  17696. +/* $Id: isdn_tty.c,v 1.104 2002/02/09 21:19:11 keil Exp $
  17697. *
  17698. * Linux ISDN subsystem, tty functions and AT-command emulator (linklevel).
  17699. *
  17700. @@ -53,7 +53,7 @@ static int bit2si[8] =
  17701. static int si2bit[8] =
  17702. {4, 1, 4, 4, 4, 4, 4, 4};
  17703. -char *isdn_tty_revision = "$Revision: 1.1.4.1 $";
  17704. +char *isdn_tty_revision = "$Revision: 1.104 $";
  17705. /* isdn_tty_try_read() is called from within isdn_tty_rcv_skb()
  17706. @@ -321,7 +321,10 @@ isdn_tty_tint(modem_info * info)
  17707. info->send_outstanding++;
  17708. info->msr &= ~UART_MSR_CTS;
  17709. info->lsr &= ~UART_LSR_TEMT;
  17710. - tty_wakeup(tty);
  17711. + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
  17712. + tty->ldisc.write_wakeup)
  17713. + (tty->ldisc.write_wakeup) (tty);
  17714. + wake_up_interruptible(&tty->write_wait);
  17715. return;
  17716. }
  17717. if (slen < 0) {
  17718. @@ -1211,7 +1214,10 @@ isdn_tty_write(struct tty_struct *tty, i
  17719. /* If DLE decoding results in zero-transmit, but
  17720. * c originally was non-zero, do a wakeup.
  17721. */
  17722. - tty_wakeup(tty);
  17723. + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
  17724. + tty->ldisc.write_wakeup)
  17725. + (tty->ldisc.write_wakeup) (tty);
  17726. + wake_up_interruptible(&tty->write_wait);
  17727. info->msr |= UART_MSR_CTS;
  17728. info->lsr |= UART_LSR_TEMT;
  17729. }
  17730. @@ -1232,6 +1238,7 @@ isdn_tty_write(struct tty_struct *tty, i
  17731. }
  17732. }
  17733. } else
  17734. +#ifdef ISDN_TTY_FCLASS1
  17735. if (TTY_IS_FCLASS1(info)) {
  17736. int cc = isdn_tty_handleDLEdown(info, m, c);
  17737. @@ -1252,6 +1259,7 @@ isdn_tty_write(struct tty_struct *tty, i
  17738. info->xmit_count += cc;
  17739. } else
  17740. #endif
  17741. +#endif
  17742. info->xmit_count += c;
  17743. } else {
  17744. info->msr |= UART_MSR_CTS;
  17745. @@ -1329,7 +1337,10 @@ isdn_tty_flush_buffer(struct tty_struct
  17746. isdn_tty_cleanup_xmit(info);
  17747. info->xmit_count = 0;
  17748. restore_flags(flags);
  17749. - tty_wakeup(tty);
  17750. + wake_up_interruptible(&tty->write_wait);
  17751. + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
  17752. + tty->ldisc.write_wakeup)
  17753. + (tty->ldisc.write_wakeup) (tty);
  17754. }
  17755. static void
  17756. @@ -1858,7 +1869,8 @@ isdn_tty_close(struct tty_struct *tty, s
  17757. isdn_tty_shutdown(info);
  17758. if (tty->driver.flush_buffer)
  17759. tty->driver.flush_buffer(tty);
  17760. - tty_ldisc_flush(tty);
  17761. + if (tty->ldisc.flush_buffer)
  17762. + tty->ldisc.flush_buffer(tty);
  17763. info->tty = 0;
  17764. info->ncarrier = 0;
  17765. tty->closing = 0;
  17766. @@ -2306,6 +2318,22 @@ isdn_tty_stat_callback(int i, isdn_ctrl
  17767. isdn_tty_at_cout("\r\n", info);
  17768. }
  17769. return 1;
  17770. + case ISDN_STAT_ALERT:
  17771. +#ifdef ISDN_TTY_STAT_DEBUG
  17772. + printk(KERN_DEBUG "tty_STAT_ALERT ttyI%d\n", info->line);
  17773. +#endif
  17774. + /* Signal RINGING to tty-device if requested */
  17775. + if (info->emu.mdmreg[REG_ALERT] & BIT_ALERT)
  17776. + isdn_tty_modem_result(RESULT_RINGING, info);
  17777. + return 1;
  17778. + case ISDN_STAT_PROCEED:
  17779. +#ifdef ISDN_TTY_STAT_DEBUG
  17780. + printk(KERN_DEBUG "tty_STAT_PROCEED ttyI%d\n", info->line);
  17781. +#endif
  17782. + /* Signal PROCEEDING to tty-device if requested */
  17783. + if (info->emu.mdmreg[REG_PROCEED] & BIT_PROCEED)
  17784. + isdn_tty_modem_result(RESULT_PROCEEDING, info);
  17785. + return 1;
  17786. case ISDN_STAT_DCONN:
  17787. #ifdef ISDN_TTY_STAT_DEBUG
  17788. printk(KERN_DEBUG "tty_STAT_DCONN ttyI%d\n", info->line);
  17789. @@ -2618,7 +2646,7 @@ isdn_tty_modem_result(int code, modem_in
  17790. static char *msg[] =
  17791. {"OK", "CONNECT", "RING", "NO CARRIER", "ERROR",
  17792. "CONNECT 64000", "NO DIALTONE", "BUSY", "NO ANSWER",
  17793. - "RINGING", "NO MSN/EAZ", "VCON", "RUNG"};
  17794. + "RINGING", "NO MSN/EAZ", "VCON", "RUNG", "PROCEEDING"};
  17795. ulong flags;
  17796. char s[ISDN_MSNLEN+10];
  17797. @@ -2781,7 +2809,8 @@ isdn_tty_modem_result(int code, modem_in
  17798. restore_flags(flags);
  17799. return;
  17800. }
  17801. - tty_ldisc_flush(info->tty);
  17802. + if (info->tty->ldisc.flush_buffer)
  17803. + info->tty->ldisc.flush_buffer(info->tty);
  17804. if ((info->flags & ISDN_ASYNC_CHECK_CD) &&
  17805. (!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) &&
  17806. (info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) {
  17807. @@ -3296,9 +3325,11 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
  17808. #ifdef CONFIG_ISDN_TTY_FAX
  17809. if (TTY_IS_FCLASS2(info))
  17810. sprintf(rs, "\r\n2");
  17811. +#ifdef ISDN_TTY_FCLASS1
  17812. else if (TTY_IS_FCLASS1(info))
  17813. sprintf(rs, "\r\n1");
  17814. #endif
  17815. +#endif
  17816. isdn_tty_at_cout(rs, info);
  17817. break;
  17818. case '=':
  17819. @@ -3313,6 +3344,7 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
  17820. m->mdmreg[REG_PSIZE] * 16;
  17821. break;
  17822. #ifdef CONFIG_ISDN_TTY_FAX
  17823. +#ifdef ISDN_TTY_FCLASS1
  17824. case '1':
  17825. p[0]++;
  17826. if (!(dev->global_features &
  17827. @@ -3324,6 +3356,7 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
  17828. info->xmit_size =
  17829. m->mdmreg[REG_PSIZE] * 16;
  17830. break;
  17831. +#endif
  17832. case '2':
  17833. p[0]++;
  17834. if (!(dev->global_features &
  17835. @@ -3348,9 +3381,11 @@ isdn_tty_cmd_PLUSF(char **p, modem_info
  17836. p[0]++;
  17837. strcpy(rs, "\r\n0,");
  17838. #ifdef CONFIG_ISDN_TTY_FAX
  17839. +#ifdef ISDN_TTY_FCLASS1
  17840. if (dev->global_features &
  17841. ISDN_FEATURE_L3_FCLASS1)
  17842. strcat(rs, "1,");
  17843. +#endif
  17844. if (dev->global_features &
  17845. ISDN_FEATURE_L3_FCLASS2)
  17846. strcat(rs, "2,");
  17847. Index: linux-2.4.35.4/drivers/isdn/isdn_tty.h
  17848. ===================================================================
  17849. --- linux-2.4.35.4.orig/drivers/isdn/isdn_tty.h
  17850. +++ linux-2.4.35.4/drivers/isdn/isdn_tty.h
  17851. @@ -1,4 +1,4 @@
  17852. -/* $Id: isdn_tty.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  17853. +/* $Id: isdn_tty.h,v 1.25 2002/02/09 21:19:11 keil Exp $
  17854. *
  17855. * header for Linux ISDN subsystem, tty related functions (linklevel).
  17856. *
  17857. @@ -78,6 +78,10 @@
  17858. #define BIT_CPNFCON 2
  17859. #define REG_CDN 23
  17860. #define BIT_CDN 4
  17861. +#define REG_ALERT 23
  17862. +#define BIT_ALERT 8
  17863. +#define REG_PROCEED 23
  17864. +#define BIT_PROCEED 16
  17865. /* defines for result codes */
  17866. #define RESULT_OK 0
  17867. @@ -93,10 +97,13 @@
  17868. #define RESULT_NO_MSN_EAZ 10
  17869. #define RESULT_VCON 11
  17870. #define RESULT_RUNG 12
  17871. +#define RESULT_PROCEEDING 13
  17872. +#ifdef ISDN_TTY_FCLASS1
  17873. #define TTY_IS_FCLASS1(info) \
  17874. ((info->emu.mdmreg[REG_L2PROT] == ISDN_PROTO_L2_FAX) && \
  17875. (info->emu.mdmreg[REG_L3PROT] == ISDN_PROTO_L3_FCLASS1))
  17876. +#endif
  17877. #define TTY_IS_FCLASS2(info) \
  17878. ((info->emu.mdmreg[REG_L2PROT] == ISDN_PROTO_L2_FAX) && \
  17879. (info->emu.mdmreg[REG_L3PROT] == ISDN_PROTO_L3_FCLASS2))
  17880. Index: linux-2.4.35.4/drivers/isdn/isdn_ttyfax.c
  17881. ===================================================================
  17882. --- linux-2.4.35.4.orig/drivers/isdn/isdn_ttyfax.c
  17883. +++ linux-2.4.35.4/drivers/isdn/isdn_ttyfax.c
  17884. @@ -1,4 +1,4 @@
  17885. -/* $Id: isdn_ttyfax.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  17886. +/* $Id: isdn_ttyfax.c,v 1.9 2001/09/24 13:22:43 kai Exp $
  17887. *
  17888. * Linux ISDN subsystem, tty_fax AT-command emulator (linklevel).
  17889. *
  17890. @@ -20,7 +20,7 @@
  17891. #include "isdn_ttyfax.h"
  17892. -static char *isdn_tty_fax_revision = "$Revision: 1.1.4.1 $";
  17893. +static char *isdn_tty_fax_revision = "$Revision: 1.9 $";
  17894. #define PARSE_ERROR1 { isdn_tty_fax_modem_result(1, info); return 1; }
  17895. @@ -148,6 +148,7 @@ isdn_tty_fax_modem_result(int code, mode
  17896. }
  17897. }
  17898. +#ifdef ISDN_TTY_FCLASS1
  17899. int
  17900. isdn_tty_fax_command1(modem_info * info, isdn_ctrl * c)
  17901. {
  17902. @@ -186,6 +187,7 @@ isdn_tty_fax_command1(modem_info * info,
  17903. }
  17904. return (0);
  17905. }
  17906. +#endif
  17907. int
  17908. isdn_tty_fax_command(modem_info * info, isdn_ctrl * c)
  17909. @@ -193,8 +195,10 @@ isdn_tty_fax_command(modem_info * info,
  17910. T30_s *f = info->fax;
  17911. char rs[10];
  17912. +#ifdef ISDN_TTY_FCLASS1
  17913. if (TTY_IS_FCLASS1(info))
  17914. return (isdn_tty_fax_command1(info, c));
  17915. +#endif
  17916. #ifdef ISDN_TTY_FAX_CMD_DEBUG
  17917. printk(KERN_DEBUG "isdn_tty: Fax cmd %d on ttyI%d\n",
  17918. @@ -312,6 +316,7 @@ isdn_tty_fax_bitorder(modem_info * info,
  17919. }
  17920. }
  17921. +#ifdef ISDN_TTY_FCLASS1
  17922. /*
  17923. * Parse AT+F.. FAX class 1 commands
  17924. */
  17925. @@ -403,6 +408,7 @@ isdn_tty_cmd_FCLASS1(char **p, modem_inf
  17926. }
  17927. return 1;
  17928. }
  17929. +#endif
  17930. /*
  17931. * Parse AT+F.. FAX class 2 commands
  17932. @@ -970,6 +976,70 @@ isdn_tty_cmd_FCLASS2(char **p, modem_inf
  17933. }
  17934. return 0;
  17935. }
  17936. +#if 0
  17937. + /* LO=n - Flow control opts */
  17938. + if (!strncmp(p[0], "LO", 2)) { /* TODO */
  17939. + p[0] += 2;
  17940. + switch (*p[0]) {
  17941. + case '?':
  17942. + p[0]++;
  17943. + sprintf(rs, "\r\n%d", f->lo);
  17944. + isdn_tty_at_cout(rs, info);
  17945. + break;
  17946. + case '=':
  17947. + p[0]++;
  17948. + if (*p[0] == '?') {
  17949. + p[0]++;
  17950. + sprintf(rs, "\r\n0,1,2");
  17951. + isdn_tty_at_cout(rs, info);
  17952. + } else {
  17953. + par = isdn_getnum(p);
  17954. + if ((par < 0) || (par > 2))
  17955. + PARSE_ERROR1;
  17956. + f->lo = par;
  17957. +#ifdef ISDN_TTY_FAX_STAT_DEBUG
  17958. + printk(KERN_DEBUG "isdn_tty: Fax FLO=%d\n", par);
  17959. +#endif
  17960. + }
  17961. + break;
  17962. + default:
  17963. + PARSE_ERROR1;
  17964. + }
  17965. + return 0;
  17966. + }
  17967. +#endif
  17968. +#if 0
  17969. + /* LPL=n - Doc for polling cmd */
  17970. + if (!strncmp(p[0], "LPL", 3)) { /* TODO */
  17971. + p[0] += 3;
  17972. + switch (*p[0]) {
  17973. + case '?':
  17974. + p[0]++;
  17975. + sprintf(rs, "\r\n%d", f->lpl);
  17976. + isdn_tty_at_cout(rs, info);
  17977. + break;
  17978. + case '=':
  17979. + p[0]++;
  17980. + if (*p[0] == '?') {
  17981. + p[0]++;
  17982. + sprintf(rs, "\r\n0,1");
  17983. + isdn_tty_at_cout(rs, info);
  17984. + } else {
  17985. + par = isdn_getnum(p);
  17986. + if ((par < 0) || (par > 1))
  17987. + PARSE_ERROR1;
  17988. + f->lpl = par;
  17989. +#ifdef ISDN_TTY_FAX_STAT_DEBUG
  17990. + printk(KERN_DEBUG "isdn_tty: Fax FLPL=%d\n", par);
  17991. +#endif
  17992. + }
  17993. + break;
  17994. + default:
  17995. + PARSE_ERROR1;
  17996. + }
  17997. + return 0;
  17998. + }
  17999. +#endif
  18000. /* MDL? - DCE Model */
  18001. if (!strncmp(p[0], "MDL?", 4)) {
  18002. @@ -1049,6 +1119,38 @@ isdn_tty_cmd_FCLASS2(char **p, modem_inf
  18003. }
  18004. return 0;
  18005. }
  18006. +#if 0
  18007. + /* PTS=n - Page transfer status */
  18008. + if (!strncmp(p[0], "PTS", 3)) { /* TODO */
  18009. + p[0] += 3;
  18010. + switch (*p[0]) {
  18011. + case '?':
  18012. + p[0]++;
  18013. + sprintf(rs, "\r\n%d", f->pts);
  18014. + isdn_tty_at_cout(rs, info);
  18015. + break;
  18016. + case '=':
  18017. + p[0]++;
  18018. + if (*p[0] == '?') {
  18019. + p[0]++;
  18020. + sprintf(rs, "\r\n0-5");
  18021. + isdn_tty_at_cout(rs, info);
  18022. + } else {
  18023. + par = isdn_getnum(p);
  18024. + if ((par < 0) || (par > 5))
  18025. + PARSE_ERROR1;
  18026. + f->pts = par;
  18027. +#ifdef ISDN_TTY_FAX_STAT_DEBUG
  18028. + printk(KERN_DEBUG "isdn_tty: Fax FPTS=%d\n", par);
  18029. +#endif
  18030. + }
  18031. + break;
  18032. + default:
  18033. + PARSE_ERROR1;
  18034. + }
  18035. + return 0;
  18036. + }
  18037. +#endif
  18038. /* REL=n - Phase C received EOL alignment */
  18039. if (!strncmp(p[0], "REL", 3)) {
  18040. @@ -1091,6 +1193,38 @@ isdn_tty_cmd_FCLASS2(char **p, modem_inf
  18041. isdn_tty_at_cout(rs, info);
  18042. return 0;
  18043. }
  18044. +#if 0
  18045. + /* SPL=n - Enable polling */
  18046. + if (!strncmp(p[0], "SPL", 3)) { /* TODO */
  18047. + p[0] += 3;
  18048. + switch (*p[0]) {
  18049. + case '?':
  18050. + p[0]++;
  18051. + sprintf(rs, "\r\n%d", f->spl);
  18052. + isdn_tty_at_cout(rs, info);
  18053. + break;
  18054. + case '=':
  18055. + p[0]++;
  18056. + if (*p[0] == '?') {
  18057. + p[0]++;
  18058. + sprintf(rs, "\r\n0,1");
  18059. + isdn_tty_at_cout(rs, info);
  18060. + } else {
  18061. + par = isdn_getnum(p);
  18062. + if ((par < 0) || (par > 1))
  18063. + PARSE_ERROR1;
  18064. + f->spl = par;
  18065. +#ifdef ISDN_TTY_FAX_STAT_DEBUG
  18066. + printk(KERN_DEBUG "isdn_tty: Fax FSPL=%d\n", par);
  18067. +#endif
  18068. + }
  18069. + break;
  18070. + default:
  18071. + PARSE_ERROR1;
  18072. + }
  18073. + return 0;
  18074. + }
  18075. +#endif
  18076. /* Phase C Transmit Data Block Size */
  18077. if (!strncmp(p[0], "TBC=", 4)) { /* dummy, not used */
  18078. @@ -1116,7 +1250,9 @@ isdn_tty_cmd_PLUSF_FAX(char **p, modem_i
  18079. {
  18080. if (TTY_IS_FCLASS2(info))
  18081. return (isdn_tty_cmd_FCLASS2(p, info));
  18082. +#ifdef ISDN_TTY_FCLASS1
  18083. else if (TTY_IS_FCLASS1(info))
  18084. return (isdn_tty_cmd_FCLASS1(p, info));
  18085. +#endif
  18086. PARSE_ERROR1;
  18087. }
  18088. Index: linux-2.4.35.4/drivers/isdn/isdn_ttyfax.h
  18089. ===================================================================
  18090. --- linux-2.4.35.4.orig/drivers/isdn/isdn_ttyfax.h
  18091. +++ linux-2.4.35.4/drivers/isdn/isdn_ttyfax.h
  18092. @@ -1,4 +1,4 @@
  18093. -/* $Id: isdn_ttyfax.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  18094. +/* $Id: isdn_ttyfax.h,v 1.3 2001/09/24 13:22:43 kai Exp $
  18095. *
  18096. * header for Linux ISDN subsystem, tty_fax related functions (linklevel).
  18097. *
  18098. Index: linux-2.4.35.4/drivers/isdn/isdn_v110.c
  18099. ===================================================================
  18100. --- linux-2.4.35.4.orig/drivers/isdn/isdn_v110.c
  18101. +++ linux-2.4.35.4/drivers/isdn/isdn_v110.c
  18102. @@ -1,4 +1,4 @@
  18103. -/* $Id: isdn_v110.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  18104. +/* $Id: isdn_v110.c,v 1.8 2001/09/24 13:22:43 kai Exp $
  18105. *
  18106. * Linux ISDN subsystem, V.110 related functions (linklevel).
  18107. *
  18108. @@ -19,7 +19,7 @@
  18109. #undef ISDN_V110_DEBUG
  18110. -char *isdn_v110_revision = "$Revision: 1.1.4.1 $";
  18111. +char *isdn_v110_revision = "$Revision: 1.8 $";
  18112. #define V110_38400 255
  18113. #define V110_19200 15
  18114. @@ -138,6 +138,14 @@ isdn_v110_close(isdn_v110_stream * v)
  18115. return;
  18116. #ifdef ISDN_V110_DEBUG
  18117. printk(KERN_DEBUG "v110 close\n");
  18118. +#if 0
  18119. + printk(KERN_DEBUG "isdn_v110_close: nbytes=%d\n", v->nbytes);
  18120. + printk(KERN_DEBUG "isdn_v110_close: nbits=%d\n", v->nbits);
  18121. + printk(KERN_DEBUG "isdn_v110_close: key=%d\n", v->key);
  18122. + printk(KERN_DEBUG "isdn_v110_close: SyncInit=%d\n", v->SyncInit);
  18123. + printk(KERN_DEBUG "isdn_v110:close: decodelen=%d\n", v->decodelen);
  18124. + printk(KERN_DEBUG "isdn_v110_close: framelen=%d\n", v->framelen);
  18125. +#endif
  18126. #endif
  18127. kfree(v->encodebuf);
  18128. kfree(v);
  18129. Index: linux-2.4.35.4/drivers/isdn/isdn_v110.h
  18130. ===================================================================
  18131. --- linux-2.4.35.4.orig/drivers/isdn/isdn_v110.h
  18132. +++ linux-2.4.35.4/drivers/isdn/isdn_v110.h
  18133. @@ -1,4 +1,4 @@
  18134. -/* $Id: isdn_v110.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  18135. +/* $Id: isdn_v110.h,v 1.5 2001/09/24 13:22:43 kai Exp $
  18136. *
  18137. * Linux ISDN subsystem, V.110 related functions (linklevel).
  18138. *
  18139. Index: linux-2.4.35.4/drivers/isdn/isdn_x25iface.c
  18140. ===================================================================
  18141. --- linux-2.4.35.4.orig/drivers/isdn/isdn_x25iface.c
  18142. +++ linux-2.4.35.4/drivers/isdn/isdn_x25iface.c
  18143. @@ -1,4 +1,4 @@
  18144. -/* $Id: isdn_x25iface.c,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  18145. +/* $Id: isdn_x25iface.c,v 1.10 2001/09/24 13:22:43 kai Exp $
  18146. *
  18147. * Linux ISDN subsystem, X.25 related functions
  18148. *
  18149. Index: linux-2.4.35.4/drivers/isdn/isdn_x25iface.h
  18150. ===================================================================
  18151. --- linux-2.4.35.4.orig/drivers/isdn/isdn_x25iface.h
  18152. +++ linux-2.4.35.4/drivers/isdn/isdn_x25iface.h
  18153. @@ -1,4 +1,4 @@
  18154. -/* $Id: isdn_x25iface.h,v 1.1.4.1 2001/11/20 14:19:34 kai Exp $
  18155. +/* $Id: isdn_x25iface.h,v 1.4 2001/09/24 13:22:43 kai Exp $
  18156. *
  18157. * header for Linux ISDN subsystem, x.25 related functions
  18158. *
  18159. Index: linux-2.4.35.4/drivers/isdn/isdnloop/isdnloop.c
  18160. ===================================================================
  18161. --- linux-2.4.35.4.orig/drivers/isdn/isdnloop/isdnloop.c
  18162. +++ linux-2.4.35.4/drivers/isdn/isdnloop/isdnloop.c
  18163. @@ -1,4 +1,4 @@
  18164. -/* $Id: isdnloop.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  18165. +/* $Id: isdnloop.c,v 1.17 2001/08/30 10:45:42 kai Exp $
  18166. *
  18167. * ISDN low-level module implementing a dummy loop driver.
  18168. *
  18169. @@ -14,7 +14,7 @@
  18170. #include <linux/init.h>
  18171. #include "isdnloop.h"
  18172. -static char *revision = "$Revision: 1.1.4.1 $";
  18173. +static char *revision = "$Revision$";
  18174. static char *isdnloop_id;
  18175. MODULE_DESCRIPTION("ISDN4Linux: Pseudo Driver that simulates an ISDN card");
  18176. @@ -22,8 +22,8 @@ MODULE_AUTHOR("Fritz Elfert");
  18177. MODULE_LICENSE("GPL");
  18178. MODULE_PARM(isdnloop_id, "s");
  18179. MODULE_PARM_DESC(isdnloop_id, "ID-String of first card");
  18180. -
  18181. -static int isdnloop_addcard(char *);
  18182. +
  18183. + static int isdnloop_addcard(char *);
  18184. /*
  18185. * Free queue completely.
  18186. @@ -1542,11 +1542,7 @@ isdnloop_init(void)
  18187. } else
  18188. strcpy(rev, " ??? ");
  18189. printk(KERN_NOTICE "isdnloop-ISDN-driver Rev%s\n", rev);
  18190. -
  18191. - if (isdnloop_id)
  18192. - return (isdnloop_addcard(isdnloop_id));
  18193. -
  18194. - return 0;
  18195. + return (isdnloop_addcard(isdnloop_id));
  18196. }
  18197. static void __exit
  18198. Index: linux-2.4.35.4/drivers/isdn/isdnloop/isdnloop.h
  18199. ===================================================================
  18200. --- linux-2.4.35.4.orig/drivers/isdn/isdnloop/isdnloop.h
  18201. +++ linux-2.4.35.4/drivers/isdn/isdnloop/isdnloop.h
  18202. @@ -1,4 +1,4 @@
  18203. -/* $Id: isdnloop.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  18204. +/* $Id$
  18205. *
  18206. * Loopback lowlevel module for testing of linklevel.
  18207. *
  18208. Index: linux-2.4.35.4/drivers/isdn/pcbit/callbacks.c
  18209. ===================================================================
  18210. --- linux-2.4.35.4.orig/drivers/isdn/pcbit/callbacks.c
  18211. +++ linux-2.4.35.4/drivers/isdn/pcbit/callbacks.c
  18212. @@ -3,7 +3,7 @@
  18213. *
  18214. * Copyright (C) 1996 Universidade de Lisboa
  18215. *
  18216. - * Written by Pedro Roque Marques ([email protected])
  18217. + * Written by Pedro Roque Marques ([email protected])
  18218. *
  18219. * This software may be used and distributed according to the terms of
  18220. * the GNU General Public License, incorporated herein by reference.
  18221. Index: linux-2.4.35.4/drivers/isdn/pcbit/callbacks.h
  18222. ===================================================================
  18223. --- linux-2.4.35.4.orig/drivers/isdn/pcbit/callbacks.h
  18224. +++ linux-2.4.35.4/drivers/isdn/pcbit/callbacks.h
  18225. @@ -3,7 +3,7 @@
  18226. *
  18227. * Copyright (C) 1996 Universidade de Lisboa
  18228. *
  18229. - * Written by Pedro Roque Marques ([email protected])
  18230. + * Written by Pedro Roque Marques ([email protected])
  18231. *
  18232. * This software may be used and distributed according to the terms of
  18233. * the GNU General Public License, incorporated herein by reference.
  18234. Index: linux-2.4.35.4/drivers/isdn/pcbit/capi.c
  18235. ===================================================================
  18236. --- linux-2.4.35.4.orig/drivers/isdn/pcbit/capi.c
  18237. +++ linux-2.4.35.4/drivers/isdn/pcbit/capi.c
  18238. @@ -4,7 +4,7 @@
  18239. *
  18240. * Copyright (C) 1996 Universidade de Lisboa
  18241. *
  18242. - * Written by Pedro Roque Marques ([email protected])
  18243. + * Written by Pedro Roque Marques ([email protected])
  18244. *
  18245. * This software may be used and distributed according to the terms of
  18246. * the GNU General Public License, incorporated herein by reference.
  18247. Index: linux-2.4.35.4/drivers/isdn/pcbit/capi.h
  18248. ===================================================================
  18249. --- linux-2.4.35.4.orig/drivers/isdn/pcbit/capi.h
  18250. +++ linux-2.4.35.4/drivers/isdn/pcbit/capi.h
  18251. @@ -3,7 +3,7 @@
  18252. *
  18253. * Copyright (C) 1996 Universidade de Lisboa
  18254. *
  18255. - * Written by Pedro Roque Marques ([email protected])
  18256. + * Written by Pedro Roque Marques ([email protected])
  18257. *
  18258. * This software may be used and distributed according to the terms of
  18259. * the GNU General Public License, incorporated herein by reference.
  18260. @@ -63,7 +63,8 @@ extern int capi_disc_resp(struct pcbit_c
  18261. extern int capi_decode_debug_188(u_char *hdr, ushort hdrlen);
  18262. #endif
  18263. -static inline struct pcbit_chan *
  18264. +extern __inline__
  18265. +struct pcbit_chan *
  18266. capi_channel(struct pcbit_dev *dev, struct sk_buff *skb)
  18267. {
  18268. ushort callref;
  18269. Index: linux-2.4.35.4/drivers/isdn/pcbit/drv.c
  18270. ===================================================================
  18271. --- linux-2.4.35.4.orig/drivers/isdn/pcbit/drv.c
  18272. +++ linux-2.4.35.4/drivers/isdn/pcbit/drv.c
  18273. @@ -3,7 +3,7 @@
  18274. *
  18275. * Copyright (C) 1996 Universidade de Lisboa
  18276. *
  18277. - * Written by Pedro Roque Marques ([email protected])
  18278. + * Written by Pedro Roque Marques ([email protected])
  18279. *
  18280. * This software may be used and distributed according to the terms of
  18281. * the GNU General Public License, incorporated herein by reference.
  18282. @@ -35,7 +35,9 @@
  18283. #include <linux/isdnif.h>
  18284. #include <asm/string.h>
  18285. #include <asm/io.h>
  18286. +#ifdef COMPAT_HAS_ISA_IOREMAP
  18287. #include <linux/ioport.h>
  18288. +#endif
  18289. #include "pcbit.h"
  18290. #include "edss1.h"
  18291. @@ -89,6 +91,7 @@ int pcbit_init_dev(int board, int mem_ba
  18292. if (mem_base >= 0xA0000 && mem_base <= 0xFFFFF ) {
  18293. dev->ph_mem = mem_base;
  18294. +#ifdef COMPAT_HAS_ISA_IOREMAP
  18295. if (check_mem_region(dev->ph_mem, 4096)) {
  18296. printk(KERN_WARNING
  18297. "PCBIT: memory region %lx-%lx already in use\n",
  18298. @@ -100,6 +103,9 @@ int pcbit_init_dev(int board, int mem_ba
  18299. request_mem_region(dev->ph_mem, 4096, "PCBIT mem");
  18300. }
  18301. dev->sh_mem = (unsigned char*)ioremap(dev->ph_mem, 4096);
  18302. +#else
  18303. + dev->sh_mem = (unsigned char*) mem_base;
  18304. +#endif
  18305. }
  18306. else
  18307. {
  18308. @@ -112,8 +118,10 @@ int pcbit_init_dev(int board, int mem_ba
  18309. dev->b1 = kmalloc(sizeof(struct pcbit_chan), GFP_KERNEL);
  18310. if (!dev->b1) {
  18311. printk("pcbit_init: couldn't malloc pcbit_chan struct\n");
  18312. +#ifdef COMPAT_HAS_ISA_IOREMAP
  18313. iounmap((unsigned char*)dev->sh_mem);
  18314. release_mem_region(dev->ph_mem, 4096);
  18315. +#endif
  18316. kfree(dev);
  18317. return -ENOMEM;
  18318. }
  18319. @@ -122,8 +130,10 @@ int pcbit_init_dev(int board, int mem_ba
  18320. if (!dev->b2) {
  18321. printk("pcbit_init: couldn't malloc pcbit_chan struct\n");
  18322. kfree(dev->b1);
  18323. +#ifdef COMPAT_HAS_ISA_IOREMAP
  18324. iounmap((unsigned char*)dev->sh_mem);
  18325. release_mem_region(dev->ph_mem, 4096);
  18326. +#endif
  18327. kfree(dev);
  18328. return -ENOMEM;
  18329. }
  18330. @@ -144,8 +154,10 @@ int pcbit_init_dev(int board, int mem_ba
  18331. {
  18332. kfree(dev->b1);
  18333. kfree(dev->b2);
  18334. +#ifdef COMPAT_HAS_ISA_IOREMAP
  18335. iounmap((unsigned char*)dev->sh_mem);
  18336. release_mem_region(dev->ph_mem, 4096);
  18337. +#endif
  18338. kfree(dev);
  18339. dev_pcbit[board] = NULL;
  18340. return -EIO;
  18341. @@ -166,8 +178,10 @@ int pcbit_init_dev(int board, int mem_ba
  18342. free_irq(irq, dev);
  18343. kfree(dev->b1);
  18344. kfree(dev->b2);
  18345. +#ifdef COMPAT_HAS_ISA_IOREMAP
  18346. iounmap((unsigned char*)dev->sh_mem);
  18347. release_mem_region(dev->ph_mem, 4096);
  18348. +#endif
  18349. kfree(dev);
  18350. dev_pcbit[board] = NULL;
  18351. return -EIO;
  18352. @@ -197,8 +211,10 @@ int pcbit_init_dev(int board, int mem_ba
  18353. free_irq(irq, dev);
  18354. kfree(dev->b1);
  18355. kfree(dev->b2);
  18356. +#ifdef COMPAT_HAS_ISA_IOREMAP
  18357. iounmap((unsigned char*)dev->sh_mem);
  18358. release_mem_region(dev->ph_mem, 4096);
  18359. +#endif
  18360. kfree(dev);
  18361. dev_pcbit[board] = NULL;
  18362. return -EIO;
  18363. @@ -235,8 +251,10 @@ void pcbit_terminate(int board)
  18364. del_timer(&dev->b2->fsm_timer);
  18365. kfree(dev->b1);
  18366. kfree(dev->b2);
  18367. +#ifdef COMPAT_HAS_ISA_IOREMAP
  18368. iounmap((unsigned char*)dev->sh_mem);
  18369. release_mem_region(dev->ph_mem, 4096);
  18370. +#endif
  18371. kfree(dev);
  18372. }
  18373. }
  18374. @@ -430,7 +448,7 @@ int pcbit_writecmd(const u_char* buf, in
  18375. switch(dev->l2_state) {
  18376. case L2_LWMODE:
  18377. /* check (size <= rdp_size); write buf into board */
  18378. - if (len < 0 || len > BANK4 + 1)
  18379. + if (len > BANK4 + 1)
  18380. {
  18381. printk("pcbit_writecmd: invalid length %d\n", len);
  18382. return -EINVAL;
  18383. @@ -609,6 +627,20 @@ void pcbit_l3_receive(struct pcbit_dev *
  18384. dev->b1->s_refnum,
  18385. dev->b2->s_refnum);
  18386. #endif
  18387. +#if 0
  18388. + if (dev->b1->s_refnum == refnum)
  18389. + chan = dev->b1;
  18390. + else {
  18391. +
  18392. + if (dev->b2->s_refnum == refnum)
  18393. + chan = dev->b2;
  18394. + else {
  18395. + chan = NULL;
  18396. + printk(KERN_WARNING "Connection Confirm - refnum doesn't match chan\n");
  18397. + break;
  18398. + }
  18399. + }
  18400. +#else
  18401. /* We just try to find a channel in the right state */
  18402. if (dev->b1->fsm_state == ST_CALL_INIT)
  18403. @@ -622,6 +654,7 @@ void pcbit_l3_receive(struct pcbit_dev *
  18404. break;
  18405. }
  18406. }
  18407. +#endif
  18408. if (capi_decode_conn_conf(chan, skb, &complete)) {
  18409. printk(KERN_DEBUG "conn_conf indicates error\n");
  18410. pcbit_fsm_event(dev, chan, EV_ERROR, NULL);
  18411. Index: linux-2.4.35.4/drivers/isdn/pcbit/edss1.c
  18412. ===================================================================
  18413. --- linux-2.4.35.4.orig/drivers/isdn/pcbit/edss1.c
  18414. +++ linux-2.4.35.4/drivers/isdn/pcbit/edss1.c
  18415. @@ -4,7 +4,7 @@
  18416. *
  18417. * Copyright (C) 1996 Universidade de Lisboa
  18418. *
  18419. - * Written by Pedro Roque Marques ([email protected])
  18420. + * Written by Pedro Roque Marques ([email protected])
  18421. *
  18422. * This software may be used and distributed according to the terms of
  18423. * the GNU General Public License, incorporated herein by reference.
  18424. Index: linux-2.4.35.4/drivers/isdn/pcbit/edss1.h
  18425. ===================================================================
  18426. --- linux-2.4.35.4.orig/drivers/isdn/pcbit/edss1.h
  18427. +++ linux-2.4.35.4/drivers/isdn/pcbit/edss1.h
  18428. @@ -3,7 +3,7 @@
  18429. *
  18430. * Copyright (C) 1996 Universidade de Lisboa
  18431. *
  18432. - * Written by Pedro Roque Marques ([email protected])
  18433. + * Written by Pedro Roque Marques ([email protected])
  18434. *
  18435. * This software may be used and distributed according to the terms of
  18436. * the GNU General Public License, incorporated herein by reference.
  18437. Index: linux-2.4.35.4/drivers/isdn/pcbit/layer2.c
  18438. ===================================================================
  18439. --- linux-2.4.35.4.orig/drivers/isdn/pcbit/layer2.c
  18440. +++ linux-2.4.35.4/drivers/isdn/pcbit/layer2.c
  18441. @@ -3,7 +3,7 @@
  18442. *
  18443. * Copyright (C) 1996 Universidade de Lisboa
  18444. *
  18445. - * Written by Pedro Roque Marques ([email protected])
  18446. + * Written by Pedro Roque Marques ([email protected])
  18447. *
  18448. * This software may be used and distributed according to the terms of
  18449. * the GNU General Public License, incorporated herein by reference.
  18450. @@ -369,11 +369,16 @@ pcbit_receive(struct pcbit_dev *dev)
  18451. if (dev->read_frame) {
  18452. printk(KERN_DEBUG "pcbit_receive: Type 0 frame and read_frame != NULL\n");
  18453. +#if 0
  18454. + pcbit_l2_error(dev);
  18455. + return;
  18456. +#else
  18457. /* discard previous queued frame */
  18458. if (dev->read_frame->skb)
  18459. kfree_skb(dev->read_frame->skb);
  18460. kfree(dev->read_frame);
  18461. dev->read_frame = NULL;
  18462. +#endif
  18463. }
  18464. frame = kmalloc(sizeof(struct frame_buf), GFP_ATOMIC);
  18465. @@ -449,10 +454,14 @@ pcbit_receive(struct pcbit_dev *dev)
  18466. if (!(frame = dev->read_frame)) {
  18467. printk("Type 1 frame and no frame queued\n");
  18468. +#if 1
  18469. /* usually after an error: toss frame */
  18470. dev->readptr += tt;
  18471. if (dev->readptr > dev->sh_mem + BANK2 + BANKLEN)
  18472. dev->readptr -= BANKLEN;
  18473. +#else
  18474. + pcbit_l2_error(dev);
  18475. +#endif
  18476. return;
  18477. }
  18478. Index: linux-2.4.35.4/drivers/isdn/pcbit/layer2.h
  18479. ===================================================================
  18480. --- linux-2.4.35.4.orig/drivers/isdn/pcbit/layer2.h
  18481. +++ linux-2.4.35.4/drivers/isdn/pcbit/layer2.h
  18482. @@ -3,7 +3,7 @@
  18483. *
  18484. * Copyright (C) 1996 Universidade de Lisboa
  18485. *
  18486. - * Written by Pedro Roque Marques ([email protected])
  18487. + * Written by Pedro Roque Marques ([email protected])
  18488. *
  18489. * This software may be used and distributed according to the terms of
  18490. * the GNU General Public License, incorporated herein by reference.
  18491. Index: linux-2.4.35.4/drivers/isdn/pcbit/module.c
  18492. ===================================================================
  18493. --- linux-2.4.35.4.orig/drivers/isdn/pcbit/module.c
  18494. +++ linux-2.4.35.4/drivers/isdn/pcbit/module.c
  18495. @@ -3,7 +3,7 @@
  18496. *
  18497. * Copyright (C) 1996 Universidade de Lisboa
  18498. *
  18499. - * Written by Pedro Roque Marques ([email protected])
  18500. + * Written by Pedro Roque Marques ([email protected])
  18501. *
  18502. * This software may be used and distributed according to the terms of
  18503. * the GNU General Public License, incorporated herein by reference.
  18504. @@ -92,6 +92,7 @@ static void __exit pcbit_exit(void)
  18505. }
  18506. #ifndef MODULE
  18507. +#ifdef COMPAT_HAS_NEW_SETUP
  18508. #define MAX_PARA (MAX_PCBIT_CARDS * 2)
  18509. static int __init pcbit_setup(char *line)
  18510. {
  18511. @@ -100,6 +101,11 @@ static int __init pcbit_setup(char *line
  18512. int ints[MAX_PARA+1];
  18513. str = get_options(line, MAX_PARA, ints);
  18514. +#else
  18515. +void pcbit_setup(char *str, int *ints)
  18516. +{
  18517. + int i, j, argc;
  18518. +#endif
  18519. argc = ints[0];
  18520. i = 0;
  18521. j = 1;
  18522. @@ -118,9 +124,13 @@ static int __init pcbit_setup(char *line
  18523. i++;
  18524. }
  18525. +#ifdef COMPAT_HAS_NEW_SETUP
  18526. return(1);
  18527. }
  18528. __setup("pcbit=", pcbit_setup);
  18529. +#else
  18530. +}
  18531. +#endif
  18532. #endif
  18533. module_init(pcbit_init);
  18534. Index: linux-2.4.35.4/drivers/isdn/pcbit/pcbit.h
  18535. ===================================================================
  18536. --- linux-2.4.35.4.orig/drivers/isdn/pcbit/pcbit.h
  18537. +++ linux-2.4.35.4/drivers/isdn/pcbit/pcbit.h
  18538. @@ -3,7 +3,7 @@
  18539. *
  18540. * Copyright (C) 1996 Universidade de Lisboa
  18541. *
  18542. - * Written by Pedro Roque Marques ([email protected])
  18543. + * Written by Pedro Roque Marques ([email protected])
  18544. *
  18545. * This software may be used and distributed according to the terms of
  18546. * the GNU General Public License, incorporated herein by reference.
  18547. Index: linux-2.4.35.4/drivers/isdn/sc/card.h
  18548. ===================================================================
  18549. --- linux-2.4.35.4.orig/drivers/isdn/sc/card.h
  18550. +++ linux-2.4.35.4/drivers/isdn/sc/card.h
  18551. @@ -1,4 +1,4 @@
  18552. -/* $Id: card.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  18553. +/* $Id$
  18554. *
  18555. * Driver parameters for SpellCaster ISA ISDN adapters
  18556. *
  18557. Index: linux-2.4.35.4/drivers/isdn/sc/command.c
  18558. ===================================================================
  18559. --- linux-2.4.35.4.orig/drivers/isdn/sc/command.c
  18560. +++ linux-2.4.35.4/drivers/isdn/sc/command.c
  18561. @@ -1,4 +1,4 @@
  18562. -/* $Id: command.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  18563. +/* $Id$
  18564. *
  18565. * Copyright (C) 1996 SpellCaster Telecommunications Inc.
  18566. *
  18567. @@ -95,7 +95,7 @@ int get_card_from_id(int driver)
  18568. if(adapter[i]->driverId == driver)
  18569. return i;
  18570. }
  18571. - return -ENODEV;
  18572. + return -NODEV;
  18573. }
  18574. /*
  18575. Index: linux-2.4.35.4/drivers/isdn/sc/debug.c
  18576. ===================================================================
  18577. --- linux-2.4.35.4.orig/drivers/isdn/sc/debug.c
  18578. +++ linux-2.4.35.4/drivers/isdn/sc/debug.c
  18579. @@ -1,4 +1,4 @@
  18580. -/* $Id: debug.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  18581. +/* $Id$
  18582. *
  18583. * Copyright (C) 1996 SpellCaster Telecommunications Inc.
  18584. *
  18585. Index: linux-2.4.35.4/drivers/isdn/sc/debug.h
  18586. ===================================================================
  18587. --- linux-2.4.35.4.orig/drivers/isdn/sc/debug.h
  18588. +++ linux-2.4.35.4/drivers/isdn/sc/debug.h
  18589. @@ -1,4 +1,4 @@
  18590. -/* $Id: debug.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  18591. +/* $Id$
  18592. *
  18593. * Copyright (C) 1996 SpellCaster Telecommunications Inc.
  18594. *
  18595. Index: linux-2.4.35.4/drivers/isdn/sc/event.c
  18596. ===================================================================
  18597. --- linux-2.4.35.4.orig/drivers/isdn/sc/event.c
  18598. +++ linux-2.4.35.4/drivers/isdn/sc/event.c
  18599. @@ -1,4 +1,4 @@
  18600. -/* $Id: event.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  18601. +/* $Id$
  18602. *
  18603. * Copyright (C) 1996 SpellCaster Telecommunications Inc.
  18604. *
  18605. Index: linux-2.4.35.4/drivers/isdn/sc/init.c
  18606. ===================================================================
  18607. --- linux-2.4.35.4.orig/drivers/isdn/sc/init.c
  18608. +++ linux-2.4.35.4/drivers/isdn/sc/init.c
  18609. @@ -514,6 +514,15 @@ int identify_board(unsigned long rambase
  18610. schedule_timeout(HZ);
  18611. sig = readl(rambase + SIG_OFFSET);
  18612. pr_debug("Looking for a signature, got 0x%x\n", sig);
  18613. +#if 0
  18614. +/*
  18615. + * For Gary:
  18616. + * If it's a timing problem, it should be gone with the above schedule()
  18617. + * Another possible reason may be the missing volatile in the original
  18618. + * code. readl() does this for us.
  18619. + */
  18620. + printk(""); /* Hack! Doesn't work without this !!!??? */
  18621. +#endif
  18622. if(sig == SIGNATURE)
  18623. return PRI_BOARD;
  18624. @@ -525,6 +534,9 @@ int identify_board(unsigned long rambase
  18625. schedule_timeout(HZ);
  18626. sig = readl(rambase + SIG_OFFSET);
  18627. pr_debug("Looking for a signature, got 0x%x\n", sig);
  18628. +#if 0
  18629. + printk(""); /* Hack! Doesn't work without this !!!??? */
  18630. +#endif
  18631. if(sig == SIGNATURE)
  18632. return BRI_BOARD;
  18633. Index: linux-2.4.35.4/drivers/isdn/sc/interrupt.c
  18634. ===================================================================
  18635. --- linux-2.4.35.4.orig/drivers/isdn/sc/interrupt.c
  18636. +++ linux-2.4.35.4/drivers/isdn/sc/interrupt.c
  18637. @@ -1,4 +1,4 @@
  18638. -/* $Id: interrupt.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  18639. +/* $Id$
  18640. *
  18641. * Copyright (C) 1996 SpellCaster Telecommunications Inc.
  18642. *
  18643. Index: linux-2.4.35.4/drivers/isdn/sc/ioctl.c
  18644. ===================================================================
  18645. --- linux-2.4.35.4.orig/drivers/isdn/sc/ioctl.c
  18646. +++ linux-2.4.35.4/drivers/isdn/sc/ioctl.c
  18647. @@ -23,6 +23,9 @@ extern int send_and_receive(int, unsigne
  18648. extern board *adapter[];
  18649. +#if 0
  18650. +static char *ChannelStates[] = { "Idle", "Ready", "Connecting", "Connected", "Disconnecting" };
  18651. +#endif
  18652. int GetStatus(int card, boardInfo *);
  18653. Index: linux-2.4.35.4/drivers/isdn/sc/message.c
  18654. ===================================================================
  18655. --- linux-2.4.35.4.orig/drivers/isdn/sc/message.c
  18656. +++ linux-2.4.35.4/drivers/isdn/sc/message.c
  18657. @@ -1,4 +1,4 @@
  18658. -/* $Id: message.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  18659. +/* $Id$
  18660. *
  18661. * functions for sending and receiving control messages
  18662. *
  18663. Index: linux-2.4.35.4/drivers/isdn/sc/message.h
  18664. ===================================================================
  18665. --- linux-2.4.35.4.orig/drivers/isdn/sc/message.h
  18666. +++ linux-2.4.35.4/drivers/isdn/sc/message.h
  18667. @@ -1,4 +1,4 @@
  18668. -/* $Id: message.h,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  18669. +/* $Id$
  18670. *
  18671. * Copyright (C) 1996 SpellCaster Telecommunications Inc.
  18672. *
  18673. Index: linux-2.4.35.4/drivers/isdn/sc/packet.c
  18674. ===================================================================
  18675. --- linux-2.4.35.4.orig/drivers/isdn/sc/packet.c
  18676. +++ linux-2.4.35.4/drivers/isdn/sc/packet.c
  18677. @@ -1,4 +1,4 @@
  18678. -/* $Id: packet.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  18679. +/* $Id$
  18680. *
  18681. * Copyright (C) 1996 SpellCaster Telecommunications Inc.
  18682. *
  18683. Index: linux-2.4.35.4/drivers/isdn/sc/shmem.c
  18684. ===================================================================
  18685. --- linux-2.4.35.4.orig/drivers/isdn/sc/shmem.c
  18686. +++ linux-2.4.35.4/drivers/isdn/sc/shmem.c
  18687. @@ -1,4 +1,4 @@
  18688. -/* $Id: shmem.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  18689. +/* $Id$
  18690. *
  18691. * Copyright (C) 1996 SpellCaster Telecommunications Inc.
  18692. *
  18693. Index: linux-2.4.35.4/drivers/isdn/sc/timer.c
  18694. ===================================================================
  18695. --- linux-2.4.35.4.orig/drivers/isdn/sc/timer.c
  18696. +++ linux-2.4.35.4/drivers/isdn/sc/timer.c
  18697. @@ -1,4 +1,4 @@
  18698. -/* $Id: timer.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
  18699. +/* $Id$
  18700. *
  18701. * Copyright (C) 1996 SpellCaster Telecommunications Inc.
  18702. *
  18703. Index: linux-2.4.35.4/drivers/isdn/tpam/tpam.h
  18704. ===================================================================
  18705. --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam.h
  18706. +++ linux-2.4.35.4/drivers/isdn/tpam/tpam.h
  18707. @@ -1,4 +1,4 @@
  18708. -/* $Id: tpam.h,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
  18709. +/* $Id: tpam.h,v 1.3 2001/09/24 13:23:12 kai Exp $
  18710. *
  18711. * Turbo PAM ISDN driver for Linux. (Kernel Driver)
  18712. *
  18713. Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_commands.c
  18714. ===================================================================
  18715. --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_commands.c
  18716. +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_commands.c
  18717. @@ -1,4 +1,4 @@
  18718. -/* $Id: tpam_commands.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
  18719. +/* $Id: tpam_commands.c,v 1.3 2001/09/24 13:23:12 kai Exp $
  18720. *
  18721. * Turbo PAM ISDN driver for Linux. (Kernel Driver - ISDN commands)
  18722. *
  18723. Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_crcpc.c
  18724. ===================================================================
  18725. --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_crcpc.c
  18726. +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_crcpc.c
  18727. @@ -1,4 +1,4 @@
  18728. -/* $Id: tpam_crcpc.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
  18729. +/* $Id$
  18730. *
  18731. * Turbo PAM ISDN driver for Linux. (Kernel Driver - CRC encoding)
  18732. *
  18733. Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_hdlc.c
  18734. ===================================================================
  18735. --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_hdlc.c
  18736. +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_hdlc.c
  18737. @@ -1,4 +1,4 @@
  18738. -/* $Id: tpam_hdlc.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
  18739. +/* $Id: tpam_hdlc.c,v 1.3 2001/09/24 13:23:12 kai Exp $
  18740. *
  18741. * Turbo PAM ISDN driver for Linux. (Kernel Driver - HDLC encoding)
  18742. *
  18743. Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_main.c
  18744. ===================================================================
  18745. --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_main.c
  18746. +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_main.c
  18747. @@ -1,4 +1,4 @@
  18748. -/* $Id: tpam_main.c,v 1.1.2.2 2001/12/09 18:45:14 kai Exp $
  18749. +/* $Id$
  18750. *
  18751. * Turbo PAM ISDN driver for Linux. (Kernel Driver - main routines)
  18752. *
  18753. @@ -254,7 +254,7 @@ static struct pci_driver tpam_driver = {
  18754. name: "tpam",
  18755. id_table: tpam_pci_tbl,
  18756. probe: tpam_probe,
  18757. - remove: __devexit_p(tpam_remove),
  18758. + remove: tpam_remove,
  18759. };
  18760. static int __init tpam_init(void) {
  18761. Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_memory.c
  18762. ===================================================================
  18763. --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_memory.c
  18764. +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_memory.c
  18765. @@ -1,4 +1,4 @@
  18766. -/* $Id: tpam_memory.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
  18767. +/* $Id$
  18768. *
  18769. * Turbo PAM ISDN driver for Linux. (Kernel Driver - Board Memory Access)
  18770. *
  18771. Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_nco.c
  18772. ===================================================================
  18773. --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_nco.c
  18774. +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_nco.c
  18775. @@ -1,4 +1,4 @@
  18776. -/* $Id: tpam_nco.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
  18777. +/* $Id$
  18778. *
  18779. * Turbo PAM ISDN driver for Linux.
  18780. * (Kernel Driver - Low Level NCO Manipulation)
  18781. Index: linux-2.4.35.4/drivers/isdn/tpam/tpam_queues.c
  18782. ===================================================================
  18783. --- linux-2.4.35.4.orig/drivers/isdn/tpam/tpam_queues.c
  18784. +++ linux-2.4.35.4/drivers/isdn/tpam/tpam_queues.c
  18785. @@ -1,4 +1,4 @@
  18786. -/* $Id: tpam_queues.c,v 1.1.2.1 2001/11/20 14:19:37 kai Exp $
  18787. +/* $Id$
  18788. *
  18789. * Turbo PAM ISDN driver for Linux. (Kernel Driver)
  18790. *
  18791. @@ -146,7 +146,6 @@ void tpam_irq(int irq, void *dev_id, str
  18792. do {
  18793. hpic = readl(card->bar0 + TPAM_HPIC_REGISTER);
  18794. if (waiting_too_long++ > 0xfffffff) {
  18795. - kfree_skb(skb);
  18796. spin_unlock(&card->lock);
  18797. printk(KERN_ERR "TurboPAM(tpam_irq): "
  18798. "waiting too long...\n");
  18799. Index: linux-2.4.35.4/include/linux/b1lli.h
  18800. ===================================================================
  18801. --- linux-2.4.35.4.orig/include/linux/b1lli.h
  18802. +++ linux-2.4.35.4/include/linux/b1lli.h
  18803. @@ -1,4 +1,4 @@
  18804. -/* $Id: b1lli.h,v 1.8.8.3 2001/09/23 22:25:05 kai Exp $
  18805. +/* $Id$
  18806. *
  18807. * ISDN lowlevel-module for AVM B1-card.
  18808. *
  18809. Index: linux-2.4.35.4/include/linux/b1pcmcia.h
  18810. ===================================================================
  18811. --- linux-2.4.35.4.orig/include/linux/b1pcmcia.h
  18812. +++ linux-2.4.35.4/include/linux/b1pcmcia.h
  18813. @@ -1,4 +1,4 @@
  18814. -/* $Id: b1pcmcia.h,v 1.1.8.2 2001/09/23 22:25:05 kai Exp $
  18815. +/* $Id$
  18816. *
  18817. * Exported functions of module b1pcmcia to be called by
  18818. * avm_cs card services module.
  18819. Index: linux-2.4.35.4/include/linux/capi.h
  18820. ===================================================================
  18821. --- linux-2.4.35.4.orig/include/linux/capi.h
  18822. +++ linux-2.4.35.4/include/linux/capi.h
  18823. @@ -1,4 +1,4 @@
  18824. -/* $Id: capi.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
  18825. +/* $Id$
  18826. *
  18827. * CAPI 2.0 Interface for Linux
  18828. *
  18829. Index: linux-2.4.35.4/include/linux/concap.h
  18830. ===================================================================
  18831. --- linux-2.4.35.4.orig/include/linux/concap.h
  18832. +++ linux-2.4.35.4/include/linux/concap.h
  18833. @@ -1,4 +1,4 @@
  18834. -/* $Id: concap.h,v 1.2.8.1 2001/09/23 22:25:05 kai Exp $
  18835. +/* $Id: concap.h,v 1.3 2001/09/24 13:23:13 kai Exp $
  18836. *
  18837. * Copyright 1997 by Henner Eisen <[email protected]>
  18838. *
  18839. @@ -11,6 +11,7 @@
  18840. #ifdef __KERNEL__
  18841. #include <linux/skbuff.h>
  18842. #include <linux/netdevice.h>
  18843. +#include <linux/isdn_compat.h>
  18844. /* Stuff to support encapsulation protocols genericly. The encapsulation
  18845. protocol is processed at the uppermost layer of the network interface.
  18846. Index: linux-2.4.35.4/include/linux/hysdn_if.h
  18847. ===================================================================
  18848. --- linux-2.4.35.4.orig/include/linux/hysdn_if.h
  18849. +++ linux-2.4.35.4/include/linux/hysdn_if.h
  18850. @@ -1,4 +1,4 @@
  18851. -/* $Id: hysdn_if.h,v 1.1.8.3 2001/09/23 22:25:05 kai Exp $
  18852. +/* $Id$
  18853. *
  18854. * Linux driver for HYSDN cards
  18855. * ioctl definitions shared by hynetmgr and driver.
  18856. Index: linux-2.4.35.4/include/linux/isdn/tpam.h
  18857. ===================================================================
  18858. --- linux-2.4.35.4.orig/include/linux/isdn/tpam.h
  18859. +++ linux-2.4.35.4/include/linux/isdn/tpam.h
  18860. @@ -1,4 +1,4 @@
  18861. -/* $Id: tpam.h,v 1.1.2.1 2001/11/20 14:19:38 kai Exp $
  18862. +/* $Id$
  18863. *
  18864. * Turbo PAM ISDN driver for Linux. (Kernel Driver)
  18865. *
  18866. Index: linux-2.4.35.4/include/linux/isdn.h
  18867. ===================================================================
  18868. --- linux-2.4.35.4.orig/include/linux/isdn.h
  18869. +++ linux-2.4.35.4/include/linux/isdn.h
  18870. @@ -1,4 +1,4 @@
  18871. -/* $Id: isdn.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
  18872. +/* $Id: isdn.h,v 1.125 2001/12/01 23:18:21 detabc Exp $
  18873. *
  18874. * Main header for the Linux ISDN subsystem (linklevel).
  18875. *
  18876. @@ -14,6 +14,7 @@
  18877. #ifndef __ISDN_H__
  18878. #define __ISDN_H__
  18879. +#include <linux/isdn_compat.h>
  18880. #include <linux/ioctl.h>
  18881. #ifdef CONFIG_COBALT_MICRO_SERVER
  18882. @@ -93,9 +94,15 @@
  18883. #define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */
  18884. #define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */
  18885. +#ifdef BIG_PHONE_NUMBERS
  18886. #define ISDN_MSNLEN 32
  18887. #define NET_DV 0x06 /* Data version for isdn_net_ioctl_cfg */
  18888. #define TTY_DV 0x06 /* Data version for iprofd etc. */
  18889. +#else
  18890. +#define ISDN_MSNLEN 20
  18891. +#define NET_DV 0x05 /* Data version for isdn_net_ioctl_cfg */
  18892. +#define TTY_DV 0x05 /* Data version for iprofd etc. */
  18893. +#endif
  18894. #define INF_DV 0x01 /* Data version for /dev/isdninfo */
  18895. @@ -187,6 +194,61 @@ typedef struct {
  18896. #define ISDN_MINOR_PPPMAX (128 + (ISDN_MAX_CHANNELS-1))
  18897. #define ISDN_MINOR_STATUS 255
  18898. +#ifndef CONFIG_ISDN_WITH_ABC
  18899. +#undef CONFIG_ISDN_WITH_ABC_CALLB
  18900. +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK
  18901. +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
  18902. +#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
  18903. +#undef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  18904. +#undef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  18905. +#undef CONFIG_ISDN_WITH_ABC_RCV_NO_HUPTIMER
  18906. +#undef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
  18907. +#undef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  18908. +#undef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
  18909. +#else /* CONFIG_ISDN_WITH_ABC */
  18910. +#include <linux/isdn_dwabc.h>
  18911. +
  18912. +
  18913. +typedef struct DWABCJIFFIES {
  18914. +
  18915. + u_long msec_1000;
  18916. + u_long msec_500;
  18917. + u_long msec_400;
  18918. + u_long msec_200;
  18919. + u_long msec_100;
  18920. +
  18921. +} DWABCJIFFIES;
  18922. +
  18923. +
  18924. +#ifdef CONFIG_ISDN_WITH_ABC_NEED_DWSJIFFIES
  18925. +DWABCJIFFIES isdn_dwabc_jiffies;
  18926. +#else
  18927. +extern DWABCJIFFIES isdn_dwabc_jiffies;
  18928. +#endif
  18929. +#define dwsjiffies (isdn_dwabc_jiffies.msec_1000)
  18930. +
  18931. +#define ISDN_DW_ABC_FLAG_UNUSED00001 0x00000001L
  18932. +#define ISDN_DW_ABC_FLAG_NO_UDP_CHECK 0x00000002L
  18933. +#define ISDN_DW_ABC_FLAG_NO_UDP_HANGUP 0x00000004L
  18934. +#define ISDN_DW_ABC_FLAG_NO_UDP_DIAL 0x00000008L
  18935. +#define ISDN_DW_ABC_FLAG_UNUSED00010 0x00000010L
  18936. +#define ISDN_DW_ABC_FLAG_RCV_NO_HUPTIMER 0x00000020L
  18937. +#define ISDN_DW_ABC_FLAG_NO_CH_EXTINUSE 0x00000040L
  18938. +#define ISDN_DW_ABC_FLAG_NO_CONN_ERROR 0x00000080L
  18939. +#define ISDN_DW_ABC_FLAG_BSD_COMPRESS 0x00000100L
  18940. +#define ISDN_DW_ABC_FLAG_NO_LCR 0x00000200L
  18941. +#define ISDN_DW_ABC_FLAG_LEASED_LINE 0x00001000L
  18942. +
  18943. +#define ISDN_DW_ABC_IFFLAG_NODCHAN 0x00000001L
  18944. +#define ISDN_DW_ABC_IFFLAG_BSDAKTIV 0x00000002L
  18945. +
  18946. +#define ISDN_DW_ABC_BITLOCK_SEND 0
  18947. +#define ISDN_DW_ABC_BITLOCK_RECEIVE 1
  18948. +
  18949. +#endif /* CONFIG_ISDN_WITH_ABC */
  18950. +
  18951. +
  18952. +
  18953. #ifdef CONFIG_ISDN_PPP
  18954. #ifdef CONFIG_ISDN_PPP_VJ
  18955. @@ -204,9 +266,11 @@ typedef struct {
  18956. # include <linux/concap.h>
  18957. #endif
  18958. +#ifdef HAVE_DEVFS_FS
  18959. #ifdef CONFIG_DEVFS_FS
  18960. # include <linux/devfs_fs_kernel.h>
  18961. #endif
  18962. +#endif /* HAVE_DEVFS_FS */
  18963. #include <linux/isdnif.h>
  18964. @@ -272,6 +336,12 @@ typedef struct {
  18965. #define ISDN_NET_CALLBACK 0x04 /* activate callback */
  18966. #define ISDN_NET_CBHUP 0x08 /* hangup before callback */
  18967. #define ISDN_NET_CBOUT 0x10 /* remote machine does callback */
  18968. +#if 0
  18969. +/* Unused??? */
  18970. +#define ISDN_NET_CLONE 0x08 /* clone a tmp interface when called */
  18971. +#define ISDN_NET_TMP 0x10 /* tmp interface until getting an IP */
  18972. +#define ISDN_NET_DYNAMIC 0x20 /* this link is dynamically allocated */
  18973. +#endif
  18974. #define ISDN_NET_MAGIC 0x49344C02 /* for paranoia-checking */
  18975. @@ -386,6 +456,38 @@ typedef struct isdn_net_local_s {
  18976. char cisco_debserint; /* debugging flag of cisco hdlc with slarp */
  18977. struct timer_list cisco_timer;
  18978. struct tq_struct tqueue;
  18979. +#ifdef CONFIG_ISDN_WITH_ABC
  18980. + ulong dw_abc_flags;
  18981. + ulong dw_abc_if_flags;
  18982. + int dw_abc_inuse_secure;
  18983. + ulong dw_abc_dialstart;
  18984. + int dw_abc_old_onhtime;
  18985. + int dw_abc_remote_version;
  18986. + int dw_abc_bitlocks;
  18987. +#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
  18988. + char dw_out_msn[ISDN_MSNLEN]; /* eaz for outgoing call if *out_msn != 0 */
  18989. +#endif
  18990. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  18991. + ulong dw_abc_lcr_callid;
  18992. + ulong dw_abc_lcr_start_request;
  18993. + ulong dw_abc_lcr_end_request;
  18994. + isdn_ctrl *dw_abc_lcr_cmd;
  18995. + struct ISDN_DWABC_LCR_IOCTL *dw_abc_lcr_io;
  18996. +#endif
  18997. + ulong dw_abc_bchan_last_connect;
  18998. +#ifdef CONFIG_ISDN_WITH_ABC_CONN_ERROR
  18999. + short dw_abc_bchan_errcnt;
  19000. +#endif
  19001. +#ifdef CONFIG_ISDN_WITH_ABC_RAWIPCOMPRESS
  19002. + void *dw_abc_bsd_compressor;
  19003. + void *dw_abc_bsd_stat_rx;
  19004. + void *dw_abc_bsd_stat_tx;
  19005. +#endif
  19006. + ulong dw_abc_bsd_snd;
  19007. + ulong dw_abc_bsd_bsd_snd;
  19008. + ulong dw_abc_bsd_rcv;
  19009. + ulong dw_abc_bsd_bsd_rcv;
  19010. +#endif
  19011. } isdn_net_local;
  19012. /* the interface itself */
  19013. @@ -608,12 +710,13 @@ typedef struct isdn_devt {
  19014. int tflags; /* Timer-Flags: */
  19015. /* see ISDN_TIMER_..defines */
  19016. int global_flags;
  19017. - infostruct *infochain; /* List of open info-devs. */
  19018. - wait_queue_head_t info_waitq; /* Wait-Queue for isdninfo */
  19019. struct timer_list timer; /* Misc.-function Timer */
  19020. int chanmap[ISDN_MAX_CHANNELS];/* Map minor->device-channel */
  19021. int drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index */
  19022. int usage[ISDN_MAX_CHANNELS]; /* Used by tty/ip/voice */
  19023. +#ifdef CONFIG_ISDN_WITH_ABC_CH_EXTINUSE
  19024. + ulong dwabc_chan_external_inuse[ISDN_MAX_CHANNELS];
  19025. +#endif
  19026. char num[ISDN_MAX_CHANNELS][ISDN_MSNLEN];
  19027. /* Remote number of active ch.*/
  19028. int m_idx[ISDN_MAX_CHANNELS]; /* Index for mdm.... */
  19029. @@ -631,6 +734,7 @@ typedef struct isdn_devt {
  19030. isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */
  19031. struct semaphore sem; /* serialize list access*/
  19032. unsigned long global_features;
  19033. +#ifdef HAVE_DEVFS_FS
  19034. #ifdef CONFIG_DEVFS_FS
  19035. devfs_handle_t devfs_handle_isdninfo;
  19036. devfs_handle_t devfs_handle_isdnctrl;
  19037. @@ -640,10 +744,41 @@ typedef struct isdn_devt {
  19038. devfs_handle_t devfs_handle_ipppX[ISDN_MAX_CHANNELS];
  19039. #endif
  19040. #endif /* CONFIG_DEVFS_FS */
  19041. +#endif /* HAVE_DEVFS_FS */
  19042. } isdn_dev;
  19043. extern isdn_dev *dev;
  19044. +#ifdef CONFIG_ISDN_WITH_ABC
  19045. +extern int isdn_auto_dial_helper(isdn_net_local *,struct sk_buff *,int);
  19046. +extern void dwisdn_nfw_send(isdn_net_local *lp,int drop_only);
  19047. +extern void isdn_net_unreachable(struct net_device *,struct sk_buff *,char *);
  19048. +extern void isdn_net_log_skb_dwabc(struct sk_buff *,isdn_net_local *,char *);
  19049. +extern void isdn_net_hangup(struct net_device *d);
  19050. +extern void isdn_dw_clear_if(ulong pm,isdn_net_local *);
  19051. +extern void isdn_dwabc_test_phone(isdn_net_local *);
  19052. +extern void isdn_dw_abc_init_func(void);
  19053. +extern void isdn_dw_abc_release_func(void);
  19054. +extern int isdn_dw_abc_reset_interface(isdn_net_local *,int);
  19055. +extern int dwabc_bsd_init(isdn_net_local *lp);
  19056. +extern void dwabc_bsd_free(isdn_net_local *lp);
  19057. +extern struct sk_buff *dwabc_bsd_compress(isdn_net_local *,struct sk_buff *,struct net_device *);
  19058. +extern void dwabc_bsd_first_gen(isdn_net_local *);
  19059. +extern struct sk_buff *dwabc_bsd_rx_pkt(isdn_net_local *,struct sk_buff *,struct net_device *);
  19060. +#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
  19061. +extern size_t isdn_dw_abc_lcr_readstat(char *,size_t);
  19062. +extern ulong isdn_dw_abc_lcr_call_number(isdn_net_local *,isdn_ctrl *);
  19063. +extern void isdn_dw_abc_lcr_open(void);
  19064. +extern void isdn_dw_abc_lcr_close(void);
  19065. +extern int isdn_dw_abc_lcr_ioctl(ulong);
  19066. +extern void isdn_dw_abc_lcr_clear(isdn_net_local *);
  19067. +extern int isdn_dw_abc_lcr_lock(void);
  19068. +extern void isdn_dw_abc_lcr_ulock(void);
  19069. +#endif
  19070. +#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
  19071. +extern int dw_abc_udp_test(struct sk_buff *skb,struct net_device *ndev);
  19072. +#endif
  19073. +#endif
  19074. #endif /* __KERNEL__ */
  19075. Index: linux-2.4.35.4/include/linux/isdn_compat.h
  19076. ===================================================================
  19077. --- /dev/null
  19078. +++ linux-2.4.35.4/include/linux/isdn_compat.h
  19079. @@ -0,0 +1,261 @@
  19080. +/* $Id: isdn_compat.h,v 1.53 2001/09/24 13:23:13 kai Exp $
  19081. + *
  19082. + * Linux ISDN subsystem
  19083. + * Compatibility for various Linux kernel versions
  19084. + *
  19085. + * This software may be used and distributed according to the terms
  19086. + * of the GNU General Public License, incorporated herein by reference.
  19087. + *
  19088. + */
  19089. +
  19090. +#ifndef _LINUX_ISDN_COMPAT_H
  19091. +#define _LINUX_ISDN_COMPAT_H
  19092. +
  19093. +#ifdef __KERNEL__
  19094. +
  19095. +#ifndef ISDN_COMPAT_NOT_GENERIC
  19096. +/* when using std2kern -u, this part is left out and instead provided
  19097. + by the .ctrl files */
  19098. +
  19099. +#include <linux/version.h>
  19100. +
  19101. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
  19102. +
  19103. +#define set_current_state(sta) (current->state = sta)
  19104. +#define module_init(x) int init_module(void) { return x(); }
  19105. +#define module_exit(x) void cleanup_module(void) { x(); }
  19106. +#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0 = 0; } while (0)
  19107. +#define init_MUTEX(x) *(x)=MUTEX
  19108. +#define init_MUTEX_LOCKED(x) *(x)=MUTEX_LOCKED
  19109. +#define __devinit
  19110. +#define __devinitdata
  19111. +
  19112. +#else /* 2.2.18 and later */
  19113. +
  19114. +#define COMPAT_HAS_NEW_SETUP
  19115. +#define COMPAT_HAS_NEW_WAITQ
  19116. +
  19117. +#endif
  19118. +
  19119. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
  19120. +
  19121. +#define dev_kfree_skb_irq(a) dev_kfree_skb(a)
  19122. +#define dev_kfree_skb_any(a) dev_kfree_skb(a)
  19123. +#define COMPAT_HAS_2_2_PCI
  19124. +#define get_pcibase(ps, nr) ps->base_address[nr]
  19125. +#define pci_resource_start_io(pdev, nr) ((pdev)->base_address[nr] & PCI_BASE_ADDRESS_IO_MASK)
  19126. +#define pci_resource_start_mem(pdev, nr) ((pdev)->base_address[nr] & PCI_BASE_ADDRESS_MEM_MASK)
  19127. +#define pci_get_sub_vendor(pdev, id) pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &id)
  19128. +#define pci_get_sub_system(pdev, id) pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &id)
  19129. +
  19130. +#define __exit
  19131. +#define __devinit
  19132. +#define __devinitdata
  19133. +
  19134. +#define net_device device
  19135. +#define COMPAT_NO_SOFTNET
  19136. +#define netif_running(d) test_bit(LINK_STATE_START, &d->state)
  19137. +#define COMPAT_NEED_MPPP_DEFS
  19138. +#define spin_lock_bh(lock)
  19139. +#define spin_unlock_bh(lock)
  19140. +#define COMPAT_NEED_SPIN_LOCK_BH
  19141. +#define i_count_read(ic) ic
  19142. +#define i_count_inc(ic) ic++
  19143. +#define COMPAT_USE_MODCOUNT_LOCK
  19144. +#define devfs_register_chrdev(m,n,f) register_chrdev(m,n,f)
  19145. +#define devfs_unregister_chrdev(m,n) unregister_chrdev(m,n)
  19146. +#define COMPAT_NEED_PCI_IDS
  19147. +#define in_irq() (local_irq_count[smp_processor_id()] != 0)
  19148. +
  19149. +#else /* 2.4.0 and later */
  19150. +
  19151. +#define pci_resource_start_io(pdev, nr) pci_resource_start(pdev, nr)
  19152. +#define pci_resource_start_mem(pdev, nr) pci_resource_start(pdev, nr)
  19153. +#define get_pcibase(ps, nr) ps->resource[nr].start
  19154. +#define pci_get_sub_system(pdev, id) id = pdev->subsystem_device
  19155. +#define pci_get_sub_vendor(pdev, id) id = pdev->subsystem_vendor
  19156. +
  19157. +#define BIG_PHONE_NUMBERS
  19158. +#define COMPAT_HAS_ISA_IOREMAP
  19159. +#define i_count_read(ic) atomic_read(&ic)
  19160. +#define i_count_inc(ic) atomic_inc(&ic)
  19161. +#define COMPAT_HAS_FILEOP_OWNER
  19162. +#define COMPAT_HAVE_NEW_FILLDIR
  19163. +#define COMPAT_has_fileops_in_inode
  19164. +#define COMPAT_HAS_init_special_inode
  19165. +#define COMPAT_d_alloc_root_one_parameter
  19166. +#define HAVE_DEVFS_FS
  19167. +#define COMPAT_HAS_SCHEDULE_TASK
  19168. +#define COMPAT_HAS_USB_IDTAB
  19169. +
  19170. +#endif
  19171. +
  19172. +#endif /* ISDN_COMPAT_GENERIC */
  19173. +
  19174. +#ifdef COMPAT_HAS_2_2_PCI
  19175. +#include <linux/pci.h>
  19176. +#ifdef __powerpc__
  19177. +static inline int pci_enable_device(struct pci_dev *dev)
  19178. +{
  19179. + u16 cmd;
  19180. + pci_read_config_word(dev, PCI_COMMAND, &cmd);
  19181. + cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_IO | PCI_COMMAND_SERR;
  19182. + cmd &= ~PCI_COMMAND_FAST_BACK;
  19183. + pci_write_config_word(dev, PCI_COMMAND, cmd);
  19184. + return(0);
  19185. +}
  19186. +#else
  19187. +static inline int pci_enable_device(struct pci_dev *dev)
  19188. +{
  19189. + return 0;
  19190. +}
  19191. +#endif /* __powerpc__ */
  19192. +
  19193. +#define PCI_ANY_ID (~0)
  19194. +
  19195. +/* as this is included multiple times, we make it inline */
  19196. +
  19197. +static inline struct pci_dev * pci_find_subsys(unsigned int vendor, unsigned int device,
  19198. + unsigned int ss_vendor, unsigned int ss_device,
  19199. + struct pci_dev *from)
  19200. +{
  19201. + unsigned short subsystem_vendor, subsystem_device;
  19202. +
  19203. + while ((from = pci_find_device(vendor, device, from))) {
  19204. + pci_read_config_word(from, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor);
  19205. + pci_read_config_word(from, PCI_SUBSYSTEM_ID, &subsystem_device);
  19206. + if ((ss_vendor == PCI_ANY_ID || subsystem_vendor == ss_vendor) &&
  19207. + (ss_device == PCI_ANY_ID || subsystem_device == ss_device))
  19208. + return from;
  19209. + }
  19210. + return NULL;
  19211. +}
  19212. +#endif
  19213. +
  19214. +#ifdef COMPAT_NO_SOFTNET
  19215. +#include <linux/netdevice.h>
  19216. +
  19217. +/*
  19218. + * Tell upper layers that the network device is ready to xmit more frames.
  19219. + */
  19220. +static void __inline__ netif_wake_queue(struct net_device * dev)
  19221. +{
  19222. + dev->tbusy = 0;
  19223. + mark_bh(NET_BH);
  19224. +}
  19225. +
  19226. +/*
  19227. + * called during net_device open()
  19228. + */
  19229. +static void __inline__ netif_start_queue(struct net_device * dev)
  19230. +{
  19231. + dev->tbusy = 0;
  19232. + /* actually, we never use the interrupt flag at all */
  19233. + dev->interrupt = 0;
  19234. + dev->start = 1;
  19235. +}
  19236. +
  19237. +/*
  19238. + * Ask upper layers to temporarily cease passing us more xmit frames.
  19239. + */
  19240. +static void __inline__ netif_stop_queue(struct net_device * dev)
  19241. +{
  19242. + dev->tbusy = 1;
  19243. +}
  19244. +
  19245. +#endif /* COMPAT_NO_SOFTNET */
  19246. +
  19247. +#ifndef COMPAT_HAS_NEW_WAITQ
  19248. +typedef struct wait_queue wait_queue_t;
  19249. +typedef struct wait_queue *wait_queue_head_t;
  19250. +
  19251. +#define DECLARE_WAITQUEUE(wait, current) struct wait_queue wait = { current, NULL }
  19252. +#define DECLARE_WAIT_QUEUE_HEAD(wait) wait_queue_head_t wait
  19253. +#define init_waitqueue_head(x) *(x)=NULL
  19254. +#define init_waitqueue_entry(q,p) ((q)->task)=(p)
  19255. +#endif /* COMPAT_HAS_NEW_WAITQ */
  19256. +
  19257. +#ifdef COMPAT_NEED_PCI_IDS
  19258. +
  19259. +#define PCI_ANY_ID (~0)
  19260. +
  19261. +#define PCI_VENDOR_ID_DYNALINK 0x0675
  19262. +#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702
  19263. +
  19264. +#define PCI_DEVICE_ID_WINBOND2_6692 0x6692
  19265. +
  19266. +#define PCI_DEVICE_ID_PLX_R685 0x1030
  19267. +#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151
  19268. +#define PCI_DEVICE_ID_PLX_R753 0x1152
  19269. +
  19270. +#define PCI_VENDOR_ID_ELSA 0x1048
  19271. +#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000
  19272. +#define PCI_DEVICE_ID_ELSA_QS3000 0x3000
  19273. +
  19274. +#define PCI_VENDOR_ID_EICON 0x1133
  19275. +#define PCI_DEVICE_ID_EICON_DIVA20PRO 0xe001
  19276. +#define PCI_DEVICE_ID_EICON_DIVA20 0xe002
  19277. +#define PCI_DEVICE_ID_EICON_DIVA20PRO_U 0xe003
  19278. +#define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004
  19279. +#define PCI_DEVICE_ID_EICON_DIVA201 0xe005
  19280. +#define PCI_DEVICE_ID_EICON_MAESTRA 0xe010
  19281. +#define PCI_DEVICE_ID_EICON_MAESTRAQ 0xe012
  19282. +#define PCI_DEVICE_ID_EICON_MAESTRAQ_U 0xe013
  19283. +#define PCI_DEVICE_ID_EICON_MAESTRAP 0xe014
  19284. +
  19285. +#define PCI_VENDOR_ID_CCD 0x1397
  19286. +#define PCI_DEVICE_ID_CCD_2BD0 0x2BD0
  19287. +#define PCI_DEVICE_ID_CCD_B000 0xB000
  19288. +#define PCI_DEVICE_ID_CCD_B006 0xB006
  19289. +#define PCI_DEVICE_ID_CCD_B007 0xB007
  19290. +#define PCI_DEVICE_ID_CCD_B008 0xB008
  19291. +#define PCI_DEVICE_ID_CCD_B009 0xB009
  19292. +#define PCI_DEVICE_ID_CCD_B00A 0xB00A
  19293. +#define PCI_DEVICE_ID_CCD_B00B 0xB00B
  19294. +#define PCI_DEVICE_ID_CCD_B00C 0xB00C
  19295. +#define PCI_DEVICE_ID_CCD_B100 0xB100
  19296. +
  19297. +#define PCI_VENDOR_ID_ASUSTEK 0x1043
  19298. +#define PCI_DEVICE_ID_ASUSTEK_0675 0x0675
  19299. +
  19300. +#define PCI_VENDOR_ID_BERKOM 0x0871
  19301. +#define PCI_DEVICE_ID_BERKOM_A1T 0xFFA1
  19302. +#define PCI_DEVICE_ID_BERKOM_T_CONCEPT 0xFFA2
  19303. +#define PCI_DEVICE_ID_BERKOM_A4T 0xFFA4
  19304. +#define PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO 0xFFA8
  19305. +
  19306. +#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016
  19307. +
  19308. +#define PCI_DEVICE_ID_TIGERJET_100 0x0002
  19309. +
  19310. +#define PCI_VENDOR_ID_ANIGMA 0x1051
  19311. +#define PCI_DEVICE_ID_ANIGMA_MC145575 0x0100
  19312. +
  19313. +#define PCI_VENDOR_ID_ZOLTRIX 0x15b0
  19314. +#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2BD0
  19315. +
  19316. +#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070
  19317. +#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071
  19318. +#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072
  19319. +#define PCI_DEVICE_ID_DIGI_DF_M_A 0x0073
  19320. +
  19321. +#define PCI_DEVICE_ID_AVM_B1 0x0700
  19322. +#define PCI_DEVICE_ID_AVM_C4 0x0800
  19323. +#define PCI_DEVICE_ID_AVM_C2 0x1100
  19324. +#define PCI_DEVICE_ID_AVM_T1 0x1200
  19325. +
  19326. +#define PCI_VENDOR_ID_HYPERCOPE 0x1365
  19327. +#define PCI_DEVICE_ID_HYPERCOPE_PLX 0x9050
  19328. +#define PCI_SUBDEVICE_ID_HYPERCOPE_OLD_ERGO 0x0104
  19329. +#define PCI_SUBDEVICE_ID_HYPERCOPE_ERGO 0x0106
  19330. +#define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107
  19331. +#define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108
  19332. +#define PCI_SUBDEVICE_ID_HYPERCOPE_PLEXUS 0x0109
  19333. +
  19334. +#define PCI_VENDOR_ID_ABOCOM 0x13D1
  19335. +#define PCI_DEVICE_ID_ABOCOM_2BD1 0x2BD1
  19336. +
  19337. +#endif /* COMPAT_NEED_PCI_IDS */
  19338. +
  19339. +#endif /* __KERNEL__ */
  19340. +#endif /* _LINUX_ISDN_COMPAT_H */
  19341. Index: linux-2.4.35.4/include/linux/isdn_divertif.h
  19342. ===================================================================
  19343. --- linux-2.4.35.4.orig/include/linux/isdn_divertif.h
  19344. +++ linux-2.4.35.4/include/linux/isdn_divertif.h
  19345. @@ -1,4 +1,4 @@
  19346. -/* $Id: isdn_divertif.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
  19347. +/* $Id$
  19348. *
  19349. * Header for the diversion supplementary interface for i4l.
  19350. *
  19351. @@ -14,7 +14,7 @@
  19352. /***********************************************************/
  19353. /* magic value is also used to control version information */
  19354. /***********************************************************/
  19355. -#define DIVERT_IF_MAGIC 0x25873401
  19356. +#define DIVERT_IF_MAGIC 0x25873402
  19357. #define DIVERT_CMD_REG 0x00 /* register command */
  19358. #define DIVERT_CMD_REL 0x01 /* release command */
  19359. #define DIVERT_NO_ERR 0x00 /* return value no error */
  19360. @@ -34,6 +34,7 @@ typedef struct
  19361. int (*ll_cmd)(isdn_ctrl *); /* supplied by hl on return */
  19362. char * (*drv_to_name)(int); /* map a driver id to name, supplied by hl */
  19363. int (*name_to_drv)(char *); /* map a driver id to name, supplied by hl */
  19364. + int (*dial_net_name)(char *); /* force dial of a ll net interface */
  19365. } isdn_divert_if;
  19366. /*********************/
  19367. Index: linux-2.4.35.4/include/linux/isdn_dwabc.h
  19368. ===================================================================
  19369. --- /dev/null
  19370. +++ linux-2.4.35.4/include/linux/isdn_dwabc.h
  19371. @@ -0,0 +1,84 @@
  19372. +/* $Id: isdn_dwabc.h,v 1.9 2001/09/26 20:32:08 detabc Exp $
  19373. + *
  19374. + * Header for the Linux ISDN abc-extension.
  19375. + *
  19376. + * Copyright by abc GmbH
  19377. + * written by Detlef Wengorz <[email protected]>
  19378. + *
  19379. + * This software may be used and distributed according to the terms
  19380. + * of the GNU General Public License, incorporated herein by reference.
  19381. + *
  19382. + */
  19383. +
  19384. +#ifndef ISDN_DWABC_H
  19385. +#define ISDN_DWABC_H
  19386. +
  19387. +#ifdef __KERNEL__
  19388. +#include <linux/types.h>
  19389. +#include <linux/kernel.h>
  19390. +#include <linux/sched.h>
  19391. +#include <linux/smp.h>
  19392. +#include <linux/spinlock.h>
  19393. +#include <linux/errno.h>
  19394. +
  19395. +
  19396. +typedef struct ISDN_DWSPINLOCK {
  19397. +
  19398. + spinlock_t spin;
  19399. + short owner;
  19400. + short my_flags;
  19401. + ulong irq_flags;
  19402. +
  19403. +} ISDN_DWSPINLOCK;
  19404. +
  19405. +#define ISDN_DWSPIN_UNLOCKED \
  19406. + (ISDN_DWSPINLOCK) { \
  19407. + spin: SPIN_LOCK_UNLOCKED, \
  19408. + owner: -1, \
  19409. + my_flags: 0, \
  19410. + irq_flags: 0, \
  19411. + }
  19412. +
  19413. +#define ISDN_DWSPIN_INIT(x) \
  19414. + do { *(x) = ISDN_DWSPIN_UNLOCKED; } while(0);
  19415. +
  19416. +static __inline__ int isdn_dwspin_trylock(ISDN_DWSPINLOCK *spin)
  19417. +{
  19418. + if(!spin_trylock(&spin->spin)) {
  19419. +
  19420. + if(spin->owner == smp_processor_id())
  19421. + return(-EAGAIN);
  19422. +
  19423. + spin_lock(&spin->spin);
  19424. + }
  19425. +
  19426. + spin->owner = smp_processor_id();
  19427. + return(0);
  19428. +}
  19429. +
  19430. +static __inline__ void isdn_dwspin_unlock(ISDN_DWSPINLOCK *spin)
  19431. +{
  19432. + spin->owner = -1;
  19433. + spin_unlock(&spin->spin);
  19434. +}
  19435. +
  19436. +
  19437. +#else
  19438. +#include <sys/types.h>
  19439. +#endif
  19440. +
  19441. +#define DWABC_LCR_FLG_NEWNUMBER 0x00000001L
  19442. +#define DWABC_LCR_FLG_DISABLE 0x00000002L
  19443. +#define DWABC_LCR_FLG_NEWHUPTIME 0x00000004L
  19444. +
  19445. +
  19446. +struct ISDN_DWABC_LCR_IOCTL {
  19447. +
  19448. + int lcr_ioctl_sizeof; /* mustbe sizeof(ISDN_DWABC_LCR_IOCTL) */
  19449. + u_short lcr_ioctl_onhtime; /* new hanguptime */
  19450. + u_long lcr_ioctl_callid; /* callid from lcr-subsystem */
  19451. + u_long lcr_ioctl_flags; /* see above */
  19452. + char lcr_ioctl_nr[32]; /* new destination phonenumber */
  19453. +};
  19454. +
  19455. +#endif
  19456. Index: linux-2.4.35.4/include/linux/isdn_lzscomp.h
  19457. ===================================================================
  19458. --- linux-2.4.35.4.orig/include/linux/isdn_lzscomp.h
  19459. +++ linux-2.4.35.4/include/linux/isdn_lzscomp.h
  19460. @@ -1,4 +1,4 @@
  19461. -/* $Id: isdn_lzscomp.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
  19462. +/* $Id$
  19463. *
  19464. * Header for isdn_lzscomp.c
  19465. * Concentrated here to not mess up half a dozen kernel headers with code
  19466. Index: linux-2.4.35.4/include/linux/isdn_ppp.h
  19467. ===================================================================
  19468. --- linux-2.4.35.4.orig/include/linux/isdn_ppp.h
  19469. +++ linux-2.4.35.4/include/linux/isdn_ppp.h
  19470. @@ -8,6 +8,7 @@
  19471. #ifndef _LINUX_ISDN_PPP_H
  19472. #define _LINUX_ISDN_PPP_H
  19473. +#include <linux/isdn_compat.h>
  19474. #define CALLTYPE_INCOMING 0x1
  19475. #define CALLTYPE_OUTGOING 0x2
  19476. @@ -33,6 +34,11 @@ struct pppcallinfo
  19477. #define PPPIOCSCOMPRESSOR _IOW('t',135,int)
  19478. #define PPPIOCGIFNAME _IOR('t',136, char [IFNAMSIZ] )
  19479. +#ifdef COMPAT_NEED_MPPP_DEFS
  19480. +#define PPP_MP 0x003d
  19481. +#define PPP_COMPFRAG 0x00fb
  19482. +#define PPP_CCPFRAG 0x80fb
  19483. +#endif
  19484. #define SC_MP_PROT 0x00000200
  19485. #define SC_REJ_MP_PROT 0x00000400
  19486. @@ -65,9 +71,6 @@ struct isdn_ppp_comp_data {
  19487. #include <linux/config.h>
  19488. -#ifdef CONFIG_IPPP_FILTER
  19489. -#include <linux/filter.h>
  19490. -#endif
  19491. #define DECOMP_ERR_NOMEM (-10)
  19492. @@ -226,10 +229,6 @@ struct ippp_struct {
  19493. unsigned char *cbuf;
  19494. struct slcompress *slcomp;
  19495. #endif
  19496. -#ifdef CONFIG_IPPP_FILTER
  19497. - struct sock_fprog pass_filter; /* filter for packets to pass */
  19498. - struct sock_fprog active_filter; /* filter for pkts to reset idle */
  19499. -#endif
  19500. unsigned long debug;
  19501. struct isdn_ppp_compressor *compressor,*decompressor;
  19502. struct isdn_ppp_compressor *link_compressor,*link_decompressor;
  19503. Index: linux-2.4.35.4/include/linux/isdnif.h
  19504. ===================================================================
  19505. --- linux-2.4.35.4.orig/include/linux/isdnif.h
  19506. +++ linux-2.4.35.4/include/linux/isdnif.h
  19507. @@ -1,4 +1,4 @@
  19508. -/* $Id: isdnif.h,v 1.1.4.1 2001/11/20 14:19:38 kai Exp $
  19509. +/* $Id: isdnif.h,v 1.43 2002/02/09 21:19:11 keil Exp $
  19510. *
  19511. * Linux ISDN subsystem
  19512. * Definition of the interface between the subsystem and its low-level drivers.
  19513. @@ -14,6 +14,7 @@
  19514. #ifndef __ISDNIF_H__
  19515. #define __ISDNIF_H__
  19516. +#include <linux/isdn_compat.h>
  19517. /*
  19518. * Values for general protocol-selection
  19519. @@ -213,6 +214,8 @@ typedef struct
  19520. #define ISDN_STAT_FAXIND 276 /* FAX indications from HL-driver */
  19521. #define ISDN_STAT_AUDIO 277 /* DTMF, DSP indications */
  19522. #define ISDN_STAT_DISCH 278 /* Disable/Enable channel usage */
  19523. +#define ISDN_STAT_ALERT 279 /* Signal alerting */
  19524. +#define ISDN_STAT_PROCEED 280 /* Signal proceeding */
  19525. /*
  19526. * Audio commands
  19527. Index: linux-2.4.35.4/include/linux/kernelcapi.h
  19528. ===================================================================
  19529. --- linux-2.4.35.4.orig/include/linux/kernelcapi.h
  19530. +++ linux-2.4.35.4/include/linux/kernelcapi.h
  19531. @@ -1,12 +1,10 @@
  19532. -/* $Id: kernelcapi.h,v 1.1.4.2 2002/01/28 18:25:10 kai Exp $
  19533. +/*
  19534. + * $Id: kernelcapi.h,v 1.9 2000/11/28 09:34:02 kai Exp $
  19535. *
  19536. * Kernel CAPI 2.0 Interface for Linux
  19537. *
  19538. * (c) Copyright 1997 by Carsten Paeth ([email protected])
  19539. *
  19540. - * This software may be used and distributed according to the terms
  19541. - * of the GNU General Public License, incorporated herein by reference.
  19542. - *
  19543. */
  19544. #ifndef __KERNELCAPI_H__