300-pending_work.patch 424 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732
  1. --- a/drivers/net/wireless/ath/ath10k/mac.c
  2. +++ b/drivers/net/wireless/ath/ath10k/mac.c
  3. @@ -1351,12 +1351,12 @@ static int ath10k_update_channel_list(st
  4. ch->allow_vht = true;
  5. ch->allow_ibss =
  6. - !(channel->flags & IEEE80211_CHAN_NO_IBSS);
  7. + !(channel->flags & IEEE80211_CHAN_NO_IR);
  8. ch->ht40plus =
  9. !(channel->flags & IEEE80211_CHAN_NO_HT40PLUS);
  10. - passive = channel->flags & IEEE80211_CHAN_PASSIVE_SCAN;
  11. + passive = channel->flags & IEEE80211_CHAN_NO_IR;
  12. ch->passive = passive;
  13. ch->freq = channel->center_freq;
  14. --- a/drivers/net/wireless/ath/ath9k/Kconfig
  15. +++ b/drivers/net/wireless/ath/ath9k/Kconfig
  16. @@ -90,7 +90,7 @@ config ATH9K_DFS_CERTIFIED
  17. config ATH9K_TX99
  18. bool "Atheros ath9k TX99 testing support"
  19. - depends on CFG80211_CERTIFICATION_ONUS
  20. + depends on ATH9K_DEBUGFS && CFG80211_CERTIFICATION_ONUS
  21. default n
  22. ---help---
  23. Say N. This should only be enabled on systems undergoing
  24. @@ -108,6 +108,14 @@ config ATH9K_TX99
  25. be evaluated to meet the RF exposure limits set forth in the
  26. governmental SAR regulations.
  27. +config ATH9K_WOW
  28. + bool "Wake on Wireless LAN support (EXPERIMENTAL)"
  29. + depends on ATH9K && PM
  30. + default n
  31. + ---help---
  32. + This option enables Wake on Wireless LAN support for certain cards.
  33. + Currently, AR9462 is supported.
  34. +
  35. config ATH9K_LEGACY_RATE_CONTROL
  36. bool "Atheros ath9k rate control"
  37. depends on ATH9K
  38. --- a/drivers/net/wireless/ath/ath9k/Makefile
  39. +++ b/drivers/net/wireless/ath/ath9k/Makefile
  40. @@ -13,9 +13,9 @@ ath9k-$(CPTCFG_ATH9K_PCI) += pci.o
  41. ath9k-$(CPTCFG_ATH9K_AHB) += ahb.o
  42. ath9k-$(CPTCFG_ATH9K_DEBUGFS) += debug.o
  43. ath9k-$(CPTCFG_ATH9K_DFS_DEBUGFS) += dfs_debug.o
  44. -ath9k-$(CPTCFG_ATH9K_DFS_CERTIFIED) += \
  45. - dfs.o
  46. -ath9k-$(CONFIG_PM_SLEEP) += wow.o
  47. +ath9k-$(CPTCFG_ATH9K_DFS_CERTIFIED) += dfs.o
  48. +ath9k-$(CPTCFG_ATH9K_TX99) += tx99.o
  49. +ath9k-$(CPTCFG_ATH9K_WOW) += wow.o
  50. obj-$(CPTCFG_ATH9K) += ath9k.o
  51. @@ -41,6 +41,8 @@ ath9k_hw-y:= \
  52. ar9003_eeprom.o \
  53. ar9003_paprd.o
  54. +ath9k_hw-$(CPTCFG_ATH9K_WOW) += ar9003_wow.o
  55. +
  56. ath9k_hw-$(CPTCFG_ATH9K_BTCOEX_SUPPORT) += btcoex.o \
  57. ar9003_mci.o
  58. obj-$(CPTCFG_ATH9K_HW) += ath9k_hw.o
  59. --- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c
  60. +++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c
  61. @@ -17,6 +17,7 @@
  62. #include "hw.h"
  63. #include "ar9003_mac.h"
  64. #include "ar9003_2p2_initvals.h"
  65. +#include "ar9003_buffalo_initvals.h"
  66. #include "ar9485_initvals.h"
  67. #include "ar9340_initvals.h"
  68. #include "ar9330_1p1_initvals.h"
  69. @@ -26,6 +27,7 @@
  70. #include "ar9462_2p0_initvals.h"
  71. #include "ar9462_2p1_initvals.h"
  72. #include "ar9565_1p0_initvals.h"
  73. +#include "ar9565_1p1_initvals.h"
  74. /* General hardware code for the AR9003 hadware family */
  75. @@ -148,7 +150,11 @@ static void ar9003_hw_init_mode_regs(str
  76. ar9340Modes_high_ob_db_tx_gain_table_1p0);
  77. INIT_INI_ARRAY(&ah->iniModesFastClock,
  78. - ar9340Modes_fast_clock_1p0);
  79. + ar9340Modes_fast_clock_1p0);
  80. + INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
  81. + ar9340_1p0_baseband_core_txfir_coeff_japan_2484);
  82. + INIT_INI_ARRAY(&ah->ini_dfs,
  83. + ar9340_1p0_baseband_postamble_dfs_channel);
  84. if (!ah->is_clk_25mhz)
  85. INIT_INI_ARRAY(&ah->iniAdditional,
  86. @@ -187,17 +193,17 @@ static void ar9003_hw_init_mode_regs(str
  87. INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
  88. ar9485_1_1_baseband_core_txfir_coeff_japan_2484);
  89. - /* Load PCIE SERDES settings from INI */
  90. -
  91. - /* Awake Setting */
  92. -
  93. - INIT_INI_ARRAY(&ah->iniPcieSerdes,
  94. - ar9485_1_1_pcie_phy_clkreq_disable_L1);
  95. -
  96. - /* Sleep Setting */
  97. -
  98. - INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
  99. - ar9485_1_1_pcie_phy_clkreq_disable_L1);
  100. + if (ah->config.no_pll_pwrsave) {
  101. + INIT_INI_ARRAY(&ah->iniPcieSerdes,
  102. + ar9485_1_1_pcie_phy_clkreq_disable_L1);
  103. + INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
  104. + ar9485_1_1_pcie_phy_clkreq_disable_L1);
  105. + } else {
  106. + INIT_INI_ARRAY(&ah->iniPcieSerdes,
  107. + ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1);
  108. + INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
  109. + ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1);
  110. + }
  111. } else if (AR_SREV_9462_21(ah)) {
  112. INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE],
  113. ar9462_2p1_mac_core);
  114. @@ -223,6 +229,10 @@ static void ar9003_hw_init_mode_regs(str
  115. ar9462_2p1_modes_fast_clock);
  116. INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
  117. ar9462_2p1_baseband_core_txfir_coeff_japan_2484);
  118. + INIT_INI_ARRAY(&ah->iniPcieSerdes,
  119. + ar9462_2p1_pciephy_clkreq_disable_L1);
  120. + INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
  121. + ar9462_2p1_pciephy_clkreq_disable_L1);
  122. } else if (AR_SREV_9462_20(ah)) {
  123. INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], ar9462_2p0_mac_core);
  124. @@ -247,18 +257,18 @@ static void ar9003_hw_init_mode_regs(str
  125. ar9462_2p0_soc_postamble);
  126. INIT_INI_ARRAY(&ah->iniModesRxGain,
  127. - ar9462_common_rx_gain_table_2p0);
  128. + ar9462_2p0_common_rx_gain);
  129. /* Awake -> Sleep Setting */
  130. INIT_INI_ARRAY(&ah->iniPcieSerdes,
  131. - ar9462_pciephy_clkreq_disable_L1_2p0);
  132. + ar9462_2p0_pciephy_clkreq_disable_L1);
  133. /* Sleep -> Awake Setting */
  134. INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
  135. - ar9462_pciephy_clkreq_disable_L1_2p0);
  136. + ar9462_2p0_pciephy_clkreq_disable_L1);
  137. /* Fast clock modal settings */
  138. INIT_INI_ARRAY(&ah->iniModesFastClock,
  139. - ar9462_modes_fast_clock_2p0);
  140. + ar9462_2p0_modes_fast_clock);
  141. INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
  142. ar9462_2p0_baseband_core_txfir_coeff_japan_2484);
  143. @@ -330,7 +340,46 @@ static void ar9003_hw_init_mode_regs(str
  144. ar9580_1p0_low_ob_db_tx_gain_table);
  145. INIT_INI_ARRAY(&ah->iniModesFastClock,
  146. - ar9580_1p0_modes_fast_clock);
  147. + ar9580_1p0_modes_fast_clock);
  148. + INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
  149. + ar9580_1p0_baseband_core_txfir_coeff_japan_2484);
  150. + INIT_INI_ARRAY(&ah->ini_dfs,
  151. + ar9580_1p0_baseband_postamble_dfs_channel);
  152. + } else if (AR_SREV_9565_11_OR_LATER(ah)) {
  153. + INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE],
  154. + ar9565_1p1_mac_core);
  155. + INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST],
  156. + ar9565_1p1_mac_postamble);
  157. +
  158. + INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE],
  159. + ar9565_1p1_baseband_core);
  160. + INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST],
  161. + ar9565_1p1_baseband_postamble);
  162. +
  163. + INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE],
  164. + ar9565_1p1_radio_core);
  165. + INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST],
  166. + ar9565_1p1_radio_postamble);
  167. +
  168. + INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE],
  169. + ar9565_1p1_soc_preamble);
  170. + INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST],
  171. + ar9565_1p1_soc_postamble);
  172. +
  173. + INIT_INI_ARRAY(&ah->iniModesRxGain,
  174. + ar9565_1p1_Common_rx_gain_table);
  175. + INIT_INI_ARRAY(&ah->iniModesTxGain,
  176. + ar9565_1p1_Modes_lowest_ob_db_tx_gain_table);
  177. +
  178. + INIT_INI_ARRAY(&ah->iniPcieSerdes,
  179. + ar9565_1p1_pciephy_clkreq_disable_L1);
  180. + INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
  181. + ar9565_1p1_pciephy_clkreq_disable_L1);
  182. +
  183. + INIT_INI_ARRAY(&ah->iniModesFastClock,
  184. + ar9565_1p1_modes_fast_clock);
  185. + INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
  186. + ar9565_1p1_baseband_core_txfir_coeff_japan_2484);
  187. } else if (AR_SREV_9565(ah)) {
  188. INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE],
  189. ar9565_1p0_mac_core);
  190. @@ -411,7 +460,11 @@ static void ar9003_hw_init_mode_regs(str
  191. /* Fast clock modal settings */
  192. INIT_INI_ARRAY(&ah->iniModesFastClock,
  193. - ar9300Modes_fast_clock_2p2);
  194. + ar9300Modes_fast_clock_2p2);
  195. + INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
  196. + ar9300_2p2_baseband_core_txfir_coeff_japan_2484);
  197. + INIT_INI_ARRAY(&ah->ini_dfs,
  198. + ar9300_2p2_baseband_postamble_dfs_channel);
  199. }
  200. }
  201. @@ -440,7 +493,10 @@ static void ar9003_tx_gain_table_mode0(s
  202. ar9462_2p1_modes_low_ob_db_tx_gain);
  203. else if (AR_SREV_9462_20(ah))
  204. INIT_INI_ARRAY(&ah->iniModesTxGain,
  205. - ar9462_modes_low_ob_db_tx_gain_table_2p0);
  206. + ar9462_2p0_modes_low_ob_db_tx_gain);
  207. + else if (AR_SREV_9565_11(ah))
  208. + INIT_INI_ARRAY(&ah->iniModesTxGain,
  209. + ar9565_1p1_modes_low_ob_db_tx_gain_table);
  210. else if (AR_SREV_9565(ah))
  211. INIT_INI_ARRAY(&ah->iniModesTxGain,
  212. ar9565_1p0_modes_low_ob_db_tx_gain_table);
  213. @@ -474,7 +530,10 @@ static void ar9003_tx_gain_table_mode1(s
  214. ar9462_2p1_modes_high_ob_db_tx_gain);
  215. else if (AR_SREV_9462_20(ah))
  216. INIT_INI_ARRAY(&ah->iniModesTxGain,
  217. - ar9462_modes_high_ob_db_tx_gain_table_2p0);
  218. + ar9462_2p0_modes_high_ob_db_tx_gain);
  219. + else if (AR_SREV_9565_11(ah))
  220. + INIT_INI_ARRAY(&ah->iniModesTxGain,
  221. + ar9565_1p1_modes_high_ob_db_tx_gain_table);
  222. else if (AR_SREV_9565(ah))
  223. INIT_INI_ARRAY(&ah->iniModesTxGain,
  224. ar9565_1p0_modes_high_ob_db_tx_gain_table);
  225. @@ -500,6 +559,9 @@ static void ar9003_tx_gain_table_mode2(s
  226. else if (AR_SREV_9580(ah))
  227. INIT_INI_ARRAY(&ah->iniModesTxGain,
  228. ar9580_1p0_low_ob_db_tx_gain_table);
  229. + else if (AR_SREV_9565_11(ah))
  230. + INIT_INI_ARRAY(&ah->iniModesTxGain,
  231. + ar9565_1p1_modes_low_ob_db_tx_gain_table);
  232. else if (AR_SREV_9565(ah))
  233. INIT_INI_ARRAY(&ah->iniModesTxGain,
  234. ar9565_1p0_modes_low_ob_db_tx_gain_table);
  235. @@ -525,12 +587,20 @@ static void ar9003_tx_gain_table_mode3(s
  236. else if (AR_SREV_9580(ah))
  237. INIT_INI_ARRAY(&ah->iniModesTxGain,
  238. ar9580_1p0_high_power_tx_gain_table);
  239. + else if (AR_SREV_9565_11(ah))
  240. + INIT_INI_ARRAY(&ah->iniModesTxGain,
  241. + ar9565_1p1_modes_high_power_tx_gain_table);
  242. else if (AR_SREV_9565(ah))
  243. INIT_INI_ARRAY(&ah->iniModesTxGain,
  244. ar9565_1p0_modes_high_power_tx_gain_table);
  245. - else
  246. - INIT_INI_ARRAY(&ah->iniModesTxGain,
  247. - ar9300Modes_high_power_tx_gain_table_2p2);
  248. + else {
  249. + if (ah->config.tx_gain_buffalo)
  250. + INIT_INI_ARRAY(&ah->iniModesTxGain,
  251. + ar9300Modes_high_power_tx_gain_table_buffalo);
  252. + else
  253. + INIT_INI_ARRAY(&ah->iniModesTxGain,
  254. + ar9300Modes_high_power_tx_gain_table_2p2);
  255. + }
  256. }
  257. static void ar9003_tx_gain_table_mode4(struct ath_hw *ah)
  258. @@ -546,7 +616,7 @@ static void ar9003_tx_gain_table_mode4(s
  259. ar9462_2p1_modes_mix_ob_db_tx_gain);
  260. else if (AR_SREV_9462_20(ah))
  261. INIT_INI_ARRAY(&ah->iniModesTxGain,
  262. - ar9462_modes_mix_ob_db_tx_gain_table_2p0);
  263. + ar9462_2p0_modes_mix_ob_db_tx_gain);
  264. else
  265. INIT_INI_ARRAY(&ah->iniModesTxGain,
  266. ar9300Modes_mixed_ob_db_tx_gain_table_2p2);
  267. @@ -581,6 +651,13 @@ static void ar9003_tx_gain_table_mode6(s
  268. ar9580_1p0_type6_tx_gain_table);
  269. }
  270. +static void ar9003_tx_gain_table_mode7(struct ath_hw *ah)
  271. +{
  272. + if (AR_SREV_9340(ah))
  273. + INIT_INI_ARRAY(&ah->iniModesTxGain,
  274. + ar9340_cus227_tx_gain_table_1p0);
  275. +}
  276. +
  277. typedef void (*ath_txgain_tab)(struct ath_hw *ah);
  278. static void ar9003_tx_gain_table_apply(struct ath_hw *ah)
  279. @@ -593,6 +670,7 @@ static void ar9003_tx_gain_table_apply(s
  280. ar9003_tx_gain_table_mode4,
  281. ar9003_tx_gain_table_mode5,
  282. ar9003_tx_gain_table_mode6,
  283. + ar9003_tx_gain_table_mode7,
  284. };
  285. int idx = ar9003_hw_get_tx_gain_idx(ah);
  286. @@ -629,7 +707,10 @@ static void ar9003_rx_gain_table_mode0(s
  287. ar9462_2p1_common_rx_gain);
  288. else if (AR_SREV_9462_20(ah))
  289. INIT_INI_ARRAY(&ah->iniModesRxGain,
  290. - ar9462_common_rx_gain_table_2p0);
  291. + ar9462_2p0_common_rx_gain);
  292. + else if (AR_SREV_9565_11(ah))
  293. + INIT_INI_ARRAY(&ah->iniModesRxGain,
  294. + ar9565_1p1_Common_rx_gain_table);
  295. else if (AR_SREV_9565(ah))
  296. INIT_INI_ARRAY(&ah->iniModesRxGain,
  297. ar9565_1p0_Common_rx_gain_table);
  298. @@ -657,7 +738,7 @@ static void ar9003_rx_gain_table_mode1(s
  299. ar9462_2p1_common_wo_xlna_rx_gain);
  300. else if (AR_SREV_9462_20(ah))
  301. INIT_INI_ARRAY(&ah->iniModesRxGain,
  302. - ar9462_common_wo_xlna_rx_gain_table_2p0);
  303. + ar9462_2p0_common_wo_xlna_rx_gain);
  304. else if (AR_SREV_9550(ah)) {
  305. INIT_INI_ARRAY(&ah->iniModesRxGain,
  306. ar955x_1p0_common_wo_xlna_rx_gain_table);
  307. @@ -666,6 +747,9 @@ static void ar9003_rx_gain_table_mode1(s
  308. } else if (AR_SREV_9580(ah))
  309. INIT_INI_ARRAY(&ah->iniModesRxGain,
  310. ar9580_1p0_wo_xlna_rx_gain_table);
  311. + else if (AR_SREV_9565_11(ah))
  312. + INIT_INI_ARRAY(&ah->iniModesRxGain,
  313. + ar9565_1p1_common_wo_xlna_rx_gain_table);
  314. else if (AR_SREV_9565(ah))
  315. INIT_INI_ARRAY(&ah->iniModesRxGain,
  316. ar9565_1p0_common_wo_xlna_rx_gain_table);
  317. @@ -687,7 +771,7 @@ static void ar9003_rx_gain_table_mode2(s
  318. ar9462_2p1_baseband_postamble_5g_xlna);
  319. } else if (AR_SREV_9462_20(ah)) {
  320. INIT_INI_ARRAY(&ah->iniModesRxGain,
  321. - ar9462_common_mixed_rx_gain_table_2p0);
  322. + ar9462_2p0_common_mixed_rx_gain);
  323. INIT_INI_ARRAY(&ah->ini_modes_rxgain_bb_core,
  324. ar9462_2p0_baseband_core_mix_rxgain);
  325. INIT_INI_ARRAY(&ah->ini_modes_rxgain_bb_postamble,
  326. @@ -701,12 +785,12 @@ static void ar9003_rx_gain_table_mode3(s
  327. {
  328. if (AR_SREV_9462_21(ah)) {
  329. INIT_INI_ARRAY(&ah->iniModesRxGain,
  330. - ar9462_2p1_common_5g_xlna_only_rx_gain);
  331. + ar9462_2p1_common_5g_xlna_only_rxgain);
  332. INIT_INI_ARRAY(&ah->ini_modes_rxgain_5g_xlna,
  333. ar9462_2p1_baseband_postamble_5g_xlna);
  334. } else if (AR_SREV_9462_20(ah)) {
  335. INIT_INI_ARRAY(&ah->iniModesRxGain,
  336. - ar9462_2p0_5g_xlna_only_rxgain);
  337. + ar9462_2p0_common_5g_xlna_only_rxgain);
  338. INIT_INI_ARRAY(&ah->ini_modes_rxgain_5g_xlna,
  339. ar9462_2p0_baseband_postamble_5g_xlna);
  340. }
  341. @@ -750,6 +834,9 @@ static void ar9003_hw_init_mode_gain_reg
  342. static void ar9003_hw_configpcipowersave(struct ath_hw *ah,
  343. bool power_off)
  344. {
  345. + unsigned int i;
  346. + struct ar5416IniArray *array;
  347. +
  348. /*
  349. * Increase L1 Entry Latency. Some WB222 boards don't have
  350. * this change in eeprom/OTP.
  351. @@ -775,18 +862,13 @@ static void ar9003_hw_configpcipowersave
  352. * Configire PCIE after Ini init. SERDES values now come from ini file
  353. * This enables PCIe low power mode.
  354. */
  355. - if (ah->config.pcieSerDesWrite) {
  356. - unsigned int i;
  357. - struct ar5416IniArray *array;
  358. -
  359. - array = power_off ? &ah->iniPcieSerdes :
  360. - &ah->iniPcieSerdesLowPower;
  361. -
  362. - for (i = 0; i < array->ia_rows; i++) {
  363. - REG_WRITE(ah,
  364. - INI_RA(array, i, 0),
  365. - INI_RA(array, i, 1));
  366. - }
  367. + array = power_off ? &ah->iniPcieSerdes :
  368. + &ah->iniPcieSerdesLowPower;
  369. +
  370. + for (i = 0; i < array->ia_rows; i++) {
  371. + REG_WRITE(ah,
  372. + INI_RA(array, i, 0),
  373. + INI_RA(array, i, 1));
  374. }
  375. }
  376. --- a/drivers/net/wireless/ath/ath9k/ar9340_initvals.h
  377. +++ b/drivers/net/wireless/ath/ath9k/ar9340_initvals.h
  378. @@ -18,6 +18,20 @@
  379. #ifndef INITVALS_9340_H
  380. #define INITVALS_9340_H
  381. +#define ar9340_1p0_mac_postamble ar9300_2p2_mac_postamble
  382. +
  383. +#define ar9340_1p0_soc_postamble ar9300_2p2_soc_postamble
  384. +
  385. +#define ar9340Modes_fast_clock_1p0 ar9300Modes_fast_clock_2p2
  386. +
  387. +#define ar9340Common_rx_gain_table_1p0 ar9300Common_rx_gain_table_2p2
  388. +
  389. +#define ar9340Common_wo_xlna_rx_gain_table_1p0 ar9300Common_wo_xlna_rx_gain_table_2p2
  390. +
  391. +#define ar9340_1p0_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
  392. +
  393. +#define ar9340_1p0_baseband_postamble_dfs_channel ar9300_2p2_baseband_postamble_dfs_channel
  394. +
  395. static const u32 ar9340_1p0_radio_postamble[][5] = {
  396. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  397. {0x000160ac, 0xa4646800, 0xa4646800, 0xa4646800, 0xa4646800},
  398. @@ -100,8 +114,6 @@ static const u32 ar9340Modes_lowest_ob_d
  399. {0x00016448, 0x24925266, 0x24925266, 0x24925266, 0x24925266},
  400. };
  401. -#define ar9340Modes_fast_clock_1p0 ar9300Modes_fast_clock_2p2
  402. -
  403. static const u32 ar9340_1p0_radio_core[][2] = {
  404. /* Addr allmodes */
  405. {0x00016000, 0x36db6db6},
  406. @@ -215,16 +227,12 @@ static const u32 ar9340_1p0_radio_core_4
  407. {0x0000824c, 0x0001e800},
  408. };
  409. -#define ar9340_1p0_mac_postamble ar9300_2p2_mac_postamble
  410. -
  411. -#define ar9340_1p0_soc_postamble ar9300_2p2_soc_postamble
  412. -
  413. static const u32 ar9340_1p0_baseband_postamble[][5] = {
  414. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  415. {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011},
  416. {0x00009820, 0x206a022e, 0x206a022e, 0x206a022e, 0x206a022e},
  417. {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
  418. - {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
  419. + {0x00009828, 0x06903081, 0x06903081, 0x09103881, 0x09103881},
  420. {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
  421. {0x00009830, 0x0000059c, 0x0000059c, 0x0000119c, 0x0000119c},
  422. {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4},
  423. @@ -340,9 +348,9 @@ static const u32 ar9340_1p0_baseband_cor
  424. {0x0000a370, 0x00000000},
  425. {0x0000a390, 0x00000001},
  426. {0x0000a394, 0x00000444},
  427. - {0x0000a398, 0x001f0e0f},
  428. - {0x0000a39c, 0x0075393f},
  429. - {0x0000a3a0, 0xb79f6427},
  430. + {0x0000a398, 0x00000000},
  431. + {0x0000a39c, 0x210d0401},
  432. + {0x0000a3a0, 0xab9a7144},
  433. {0x0000a3a4, 0x00000000},
  434. {0x0000a3a8, 0xaaaaaaaa},
  435. {0x0000a3ac, 0x3c466478},
  436. @@ -714,266 +722,6 @@ static const u32 ar9340Modes_ub124_tx_ga
  437. {0x0000b2e8, 0xfffe0000, 0xfffe0000, 0xfffc0000, 0xfffc0000},
  438. };
  439. -static const u32 ar9340Common_rx_gain_table_1p0[][2] = {
  440. - /* Addr allmodes */
  441. - {0x0000a000, 0x00010000},
  442. - {0x0000a004, 0x00030002},
  443. - {0x0000a008, 0x00050004},
  444. - {0x0000a00c, 0x00810080},
  445. - {0x0000a010, 0x00830082},
  446. - {0x0000a014, 0x01810180},
  447. - {0x0000a018, 0x01830182},
  448. - {0x0000a01c, 0x01850184},
  449. - {0x0000a020, 0x01890188},
  450. - {0x0000a024, 0x018b018a},
  451. - {0x0000a028, 0x018d018c},
  452. - {0x0000a02c, 0x01910190},
  453. - {0x0000a030, 0x01930192},
  454. - {0x0000a034, 0x01950194},
  455. - {0x0000a038, 0x038a0196},
  456. - {0x0000a03c, 0x038c038b},
  457. - {0x0000a040, 0x0390038d},
  458. - {0x0000a044, 0x03920391},
  459. - {0x0000a048, 0x03940393},
  460. - {0x0000a04c, 0x03960395},
  461. - {0x0000a050, 0x00000000},
  462. - {0x0000a054, 0x00000000},
  463. - {0x0000a058, 0x00000000},
  464. - {0x0000a05c, 0x00000000},
  465. - {0x0000a060, 0x00000000},
  466. - {0x0000a064, 0x00000000},
  467. - {0x0000a068, 0x00000000},
  468. - {0x0000a06c, 0x00000000},
  469. - {0x0000a070, 0x00000000},
  470. - {0x0000a074, 0x00000000},
  471. - {0x0000a078, 0x00000000},
  472. - {0x0000a07c, 0x00000000},
  473. - {0x0000a080, 0x22222229},
  474. - {0x0000a084, 0x1d1d1d1d},
  475. - {0x0000a088, 0x1d1d1d1d},
  476. - {0x0000a08c, 0x1d1d1d1d},
  477. - {0x0000a090, 0x171d1d1d},
  478. - {0x0000a094, 0x11111717},
  479. - {0x0000a098, 0x00030311},
  480. - {0x0000a09c, 0x00000000},
  481. - {0x0000a0a0, 0x00000000},
  482. - {0x0000a0a4, 0x00000000},
  483. - {0x0000a0a8, 0x00000000},
  484. - {0x0000a0ac, 0x00000000},
  485. - {0x0000a0b0, 0x00000000},
  486. - {0x0000a0b4, 0x00000000},
  487. - {0x0000a0b8, 0x00000000},
  488. - {0x0000a0bc, 0x00000000},
  489. - {0x0000a0c0, 0x001f0000},
  490. - {0x0000a0c4, 0x01000101},
  491. - {0x0000a0c8, 0x011e011f},
  492. - {0x0000a0cc, 0x011c011d},
  493. - {0x0000a0d0, 0x02030204},
  494. - {0x0000a0d4, 0x02010202},
  495. - {0x0000a0d8, 0x021f0200},
  496. - {0x0000a0dc, 0x0302021e},
  497. - {0x0000a0e0, 0x03000301},
  498. - {0x0000a0e4, 0x031e031f},
  499. - {0x0000a0e8, 0x0402031d},
  500. - {0x0000a0ec, 0x04000401},
  501. - {0x0000a0f0, 0x041e041f},
  502. - {0x0000a0f4, 0x0502041d},
  503. - {0x0000a0f8, 0x05000501},
  504. - {0x0000a0fc, 0x051e051f},
  505. - {0x0000a100, 0x06010602},
  506. - {0x0000a104, 0x061f0600},
  507. - {0x0000a108, 0x061d061e},
  508. - {0x0000a10c, 0x07020703},
  509. - {0x0000a110, 0x07000701},
  510. - {0x0000a114, 0x00000000},
  511. - {0x0000a118, 0x00000000},
  512. - {0x0000a11c, 0x00000000},
  513. - {0x0000a120, 0x00000000},
  514. - {0x0000a124, 0x00000000},
  515. - {0x0000a128, 0x00000000},
  516. - {0x0000a12c, 0x00000000},
  517. - {0x0000a130, 0x00000000},
  518. - {0x0000a134, 0x00000000},
  519. - {0x0000a138, 0x00000000},
  520. - {0x0000a13c, 0x00000000},
  521. - {0x0000a140, 0x001f0000},
  522. - {0x0000a144, 0x01000101},
  523. - {0x0000a148, 0x011e011f},
  524. - {0x0000a14c, 0x011c011d},
  525. - {0x0000a150, 0x02030204},
  526. - {0x0000a154, 0x02010202},
  527. - {0x0000a158, 0x021f0200},
  528. - {0x0000a15c, 0x0302021e},
  529. - {0x0000a160, 0x03000301},
  530. - {0x0000a164, 0x031e031f},
  531. - {0x0000a168, 0x0402031d},
  532. - {0x0000a16c, 0x04000401},
  533. - {0x0000a170, 0x041e041f},
  534. - {0x0000a174, 0x0502041d},
  535. - {0x0000a178, 0x05000501},
  536. - {0x0000a17c, 0x051e051f},
  537. - {0x0000a180, 0x06010602},
  538. - {0x0000a184, 0x061f0600},
  539. - {0x0000a188, 0x061d061e},
  540. - {0x0000a18c, 0x07020703},
  541. - {0x0000a190, 0x07000701},
  542. - {0x0000a194, 0x00000000},
  543. - {0x0000a198, 0x00000000},
  544. - {0x0000a19c, 0x00000000},
  545. - {0x0000a1a0, 0x00000000},
  546. - {0x0000a1a4, 0x00000000},
  547. - {0x0000a1a8, 0x00000000},
  548. - {0x0000a1ac, 0x00000000},
  549. - {0x0000a1b0, 0x00000000},
  550. - {0x0000a1b4, 0x00000000},
  551. - {0x0000a1b8, 0x00000000},
  552. - {0x0000a1bc, 0x00000000},
  553. - {0x0000a1c0, 0x00000000},
  554. - {0x0000a1c4, 0x00000000},
  555. - {0x0000a1c8, 0x00000000},
  556. - {0x0000a1cc, 0x00000000},
  557. - {0x0000a1d0, 0x00000000},
  558. - {0x0000a1d4, 0x00000000},
  559. - {0x0000a1d8, 0x00000000},
  560. - {0x0000a1dc, 0x00000000},
  561. - {0x0000a1e0, 0x00000000},
  562. - {0x0000a1e4, 0x00000000},
  563. - {0x0000a1e8, 0x00000000},
  564. - {0x0000a1ec, 0x00000000},
  565. - {0x0000a1f0, 0x00000396},
  566. - {0x0000a1f4, 0x00000396},
  567. - {0x0000a1f8, 0x00000396},
  568. - {0x0000a1fc, 0x00000196},
  569. - {0x0000b000, 0x00010000},
  570. - {0x0000b004, 0x00030002},
  571. - {0x0000b008, 0x00050004},
  572. - {0x0000b00c, 0x00810080},
  573. - {0x0000b010, 0x00830082},
  574. - {0x0000b014, 0x01810180},
  575. - {0x0000b018, 0x01830182},
  576. - {0x0000b01c, 0x01850184},
  577. - {0x0000b020, 0x02810280},
  578. - {0x0000b024, 0x02830282},
  579. - {0x0000b028, 0x02850284},
  580. - {0x0000b02c, 0x02890288},
  581. - {0x0000b030, 0x028b028a},
  582. - {0x0000b034, 0x0388028c},
  583. - {0x0000b038, 0x038a0389},
  584. - {0x0000b03c, 0x038c038b},
  585. - {0x0000b040, 0x0390038d},
  586. - {0x0000b044, 0x03920391},
  587. - {0x0000b048, 0x03940393},
  588. - {0x0000b04c, 0x03960395},
  589. - {0x0000b050, 0x00000000},
  590. - {0x0000b054, 0x00000000},
  591. - {0x0000b058, 0x00000000},
  592. - {0x0000b05c, 0x00000000},
  593. - {0x0000b060, 0x00000000},
  594. - {0x0000b064, 0x00000000},
  595. - {0x0000b068, 0x00000000},
  596. - {0x0000b06c, 0x00000000},
  597. - {0x0000b070, 0x00000000},
  598. - {0x0000b074, 0x00000000},
  599. - {0x0000b078, 0x00000000},
  600. - {0x0000b07c, 0x00000000},
  601. - {0x0000b080, 0x23232323},
  602. - {0x0000b084, 0x21232323},
  603. - {0x0000b088, 0x19191c1e},
  604. - {0x0000b08c, 0x12141417},
  605. - {0x0000b090, 0x07070e0e},
  606. - {0x0000b094, 0x03030305},
  607. - {0x0000b098, 0x00000003},
  608. - {0x0000b09c, 0x00000000},
  609. - {0x0000b0a0, 0x00000000},
  610. - {0x0000b0a4, 0x00000000},
  611. - {0x0000b0a8, 0x00000000},
  612. - {0x0000b0ac, 0x00000000},
  613. - {0x0000b0b0, 0x00000000},
  614. - {0x0000b0b4, 0x00000000},
  615. - {0x0000b0b8, 0x00000000},
  616. - {0x0000b0bc, 0x00000000},
  617. - {0x0000b0c0, 0x003f0020},
  618. - {0x0000b0c4, 0x00400041},
  619. - {0x0000b0c8, 0x0140005f},
  620. - {0x0000b0cc, 0x0160015f},
  621. - {0x0000b0d0, 0x017e017f},
  622. - {0x0000b0d4, 0x02410242},
  623. - {0x0000b0d8, 0x025f0240},
  624. - {0x0000b0dc, 0x027f0260},
  625. - {0x0000b0e0, 0x0341027e},
  626. - {0x0000b0e4, 0x035f0340},
  627. - {0x0000b0e8, 0x037f0360},
  628. - {0x0000b0ec, 0x04400441},
  629. - {0x0000b0f0, 0x0460045f},
  630. - {0x0000b0f4, 0x0541047f},
  631. - {0x0000b0f8, 0x055f0540},
  632. - {0x0000b0fc, 0x057f0560},
  633. - {0x0000b100, 0x06400641},
  634. - {0x0000b104, 0x0660065f},
  635. - {0x0000b108, 0x067e067f},
  636. - {0x0000b10c, 0x07410742},
  637. - {0x0000b110, 0x075f0740},
  638. - {0x0000b114, 0x077f0760},
  639. - {0x0000b118, 0x07800781},
  640. - {0x0000b11c, 0x07a0079f},
  641. - {0x0000b120, 0x07c107bf},
  642. - {0x0000b124, 0x000007c0},
  643. - {0x0000b128, 0x00000000},
  644. - {0x0000b12c, 0x00000000},
  645. - {0x0000b130, 0x00000000},
  646. - {0x0000b134, 0x00000000},
  647. - {0x0000b138, 0x00000000},
  648. - {0x0000b13c, 0x00000000},
  649. - {0x0000b140, 0x003f0020},
  650. - {0x0000b144, 0x00400041},
  651. - {0x0000b148, 0x0140005f},
  652. - {0x0000b14c, 0x0160015f},
  653. - {0x0000b150, 0x017e017f},
  654. - {0x0000b154, 0x02410242},
  655. - {0x0000b158, 0x025f0240},
  656. - {0x0000b15c, 0x027f0260},
  657. - {0x0000b160, 0x0341027e},
  658. - {0x0000b164, 0x035f0340},
  659. - {0x0000b168, 0x037f0360},
  660. - {0x0000b16c, 0x04400441},
  661. - {0x0000b170, 0x0460045f},
  662. - {0x0000b174, 0x0541047f},
  663. - {0x0000b178, 0x055f0540},
  664. - {0x0000b17c, 0x057f0560},
  665. - {0x0000b180, 0x06400641},
  666. - {0x0000b184, 0x0660065f},
  667. - {0x0000b188, 0x067e067f},
  668. - {0x0000b18c, 0x07410742},
  669. - {0x0000b190, 0x075f0740},
  670. - {0x0000b194, 0x077f0760},
  671. - {0x0000b198, 0x07800781},
  672. - {0x0000b19c, 0x07a0079f},
  673. - {0x0000b1a0, 0x07c107bf},
  674. - {0x0000b1a4, 0x000007c0},
  675. - {0x0000b1a8, 0x00000000},
  676. - {0x0000b1ac, 0x00000000},
  677. - {0x0000b1b0, 0x00000000},
  678. - {0x0000b1b4, 0x00000000},
  679. - {0x0000b1b8, 0x00000000},
  680. - {0x0000b1bc, 0x00000000},
  681. - {0x0000b1c0, 0x00000000},
  682. - {0x0000b1c4, 0x00000000},
  683. - {0x0000b1c8, 0x00000000},
  684. - {0x0000b1cc, 0x00000000},
  685. - {0x0000b1d0, 0x00000000},
  686. - {0x0000b1d4, 0x00000000},
  687. - {0x0000b1d8, 0x00000000},
  688. - {0x0000b1dc, 0x00000000},
  689. - {0x0000b1e0, 0x00000000},
  690. - {0x0000b1e4, 0x00000000},
  691. - {0x0000b1e8, 0x00000000},
  692. - {0x0000b1ec, 0x00000000},
  693. - {0x0000b1f0, 0x00000396},
  694. - {0x0000b1f4, 0x00000396},
  695. - {0x0000b1f8, 0x00000396},
  696. - {0x0000b1fc, 0x00000196},
  697. -};
  698. -
  699. static const u32 ar9340Modes_low_ob_db_tx_gain_table_1p0[][5] = {
  700. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  701. {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  702. @@ -1437,8 +1185,6 @@ static const u32 ar9340_1p0_mac_core[][2
  703. {0x000083d0, 0x000101ff},
  704. };
  705. -#define ar9340Common_wo_xlna_rx_gain_table_1p0 ar9300Common_wo_xlna_rx_gain_table_2p2
  706. -
  707. static const u32 ar9340_1p0_soc_preamble[][2] = {
  708. /* Addr allmodes */
  709. {0x00007008, 0x00000000},
  710. @@ -1447,4 +1193,106 @@ static const u32 ar9340_1p0_soc_preamble
  711. {0x00007038, 0x000004c2},
  712. };
  713. +static const u32 ar9340_cus227_tx_gain_table_1p0[][5] = {
  714. + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  715. + {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  716. + {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  717. + {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  718. + {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  719. + {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
  720. + {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  721. + {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
  722. + {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
  723. + {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
  724. + {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
  725. + {0x0000a514, 0x1c000223, 0x1c000223, 0x11000400, 0x11000400},
  726. + {0x0000a518, 0x21002220, 0x21002220, 0x15000402, 0x15000402},
  727. + {0x0000a51c, 0x27002223, 0x27002223, 0x19000404, 0x19000404},
  728. + {0x0000a520, 0x2c022220, 0x2c022220, 0x1b000603, 0x1b000603},
  729. + {0x0000a524, 0x30022222, 0x30022222, 0x1f000a02, 0x1f000a02},
  730. + {0x0000a528, 0x35022225, 0x35022225, 0x23000a04, 0x23000a04},
  731. + {0x0000a52c, 0x3b02222a, 0x3b02222a, 0x26000a20, 0x26000a20},
  732. + {0x0000a530, 0x3f02222c, 0x3f02222c, 0x2a000e20, 0x2a000e20},
  733. + {0x0000a534, 0x4202242a, 0x4202242a, 0x2e000e22, 0x2e000e22},
  734. + {0x0000a538, 0x4702244a, 0x4702244a, 0x31000e24, 0x31000e24},
  735. + {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x34001640, 0x34001640},
  736. + {0x0000a540, 0x4e02246c, 0x4e02246c, 0x38001660, 0x38001660},
  737. + {0x0000a544, 0x5302266c, 0x5302266c, 0x3b001861, 0x3b001861},
  738. + {0x0000a548, 0x5702286c, 0x5702286c, 0x3e001a81, 0x3e001a81},
  739. + {0x0000a54c, 0x5c02486b, 0x5c02486b, 0x42001a83, 0x42001a83},
  740. + {0x0000a550, 0x61024a6c, 0x61024a6c, 0x44001c84, 0x44001c84},
  741. + {0x0000a554, 0x66026a6c, 0x66026a6c, 0x48001ce3, 0x48001ce3},
  742. + {0x0000a558, 0x6b026e6c, 0x6b026e6c, 0x4c001ce5, 0x4c001ce5},
  743. + {0x0000a55c, 0x7002708c, 0x7002708c, 0x50001ce9, 0x50001ce9},
  744. + {0x0000a560, 0x7302b08a, 0x7302b08a, 0x54001ceb, 0x54001ceb},
  745. + {0x0000a564, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
  746. + {0x0000a568, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
  747. + {0x0000a56c, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
  748. + {0x0000a570, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
  749. + {0x0000a574, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
  750. + {0x0000a578, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
  751. + {0x0000a57c, 0x7702b08c, 0x7702b08c, 0x56001eec, 0x56001eec},
  752. + {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000},
  753. + {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002},
  754. + {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004},
  755. + {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200},
  756. + {0x0000a590, 0x16800220, 0x16800220, 0x0f800202, 0x0f800202},
  757. + {0x0000a594, 0x1c800223, 0x1c800223, 0x11800400, 0x11800400},
  758. + {0x0000a598, 0x21820220, 0x21820220, 0x15800402, 0x15800402},
  759. + {0x0000a59c, 0x27820223, 0x27820223, 0x19800404, 0x19800404},
  760. + {0x0000a5a0, 0x2b822220, 0x2b822220, 0x1b800603, 0x1b800603},
  761. + {0x0000a5a4, 0x2f822222, 0x2f822222, 0x1f800a02, 0x1f800a02},
  762. + {0x0000a5a8, 0x34822225, 0x34822225, 0x23800a04, 0x23800a04},
  763. + {0x0000a5ac, 0x3a82222a, 0x3a82222a, 0x26800a20, 0x26800a20},
  764. + {0x0000a5b0, 0x3e82222c, 0x3e82222c, 0x2a800e20, 0x2a800e20},
  765. + {0x0000a5b4, 0x4282242a, 0x4282242a, 0x2e800e22, 0x2e800e22},
  766. + {0x0000a5b8, 0x4782244a, 0x4782244a, 0x31800e24, 0x31800e24},
  767. + {0x0000a5bc, 0x4b82244c, 0x4b82244c, 0x34801640, 0x34801640},
  768. + {0x0000a5c0, 0x4e82246c, 0x4e82246c, 0x38801660, 0x38801660},
  769. + {0x0000a5c4, 0x5382266c, 0x5382266c, 0x3b801861, 0x3b801861},
  770. + {0x0000a5c8, 0x5782286c, 0x5782286c, 0x3e801a81, 0x3e801a81},
  771. + {0x0000a5cc, 0x5c84286b, 0x5c84286b, 0x42801a83, 0x42801a83},
  772. + {0x0000a5d0, 0x61842a6c, 0x61842a6c, 0x44801c84, 0x44801c84},
  773. + {0x0000a5d4, 0x66862a6c, 0x66862a6c, 0x48801ce3, 0x48801ce3},
  774. + {0x0000a5d8, 0x6b862e6c, 0x6b862e6c, 0x4c801ce5, 0x4c801ce5},
  775. + {0x0000a5dc, 0x7086308c, 0x7086308c, 0x50801ce9, 0x50801ce9},
  776. + {0x0000a5e0, 0x738a308a, 0x738a308a, 0x54801ceb, 0x54801ceb},
  777. + {0x0000a5e4, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
  778. + {0x0000a5e8, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
  779. + {0x0000a5ec, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
  780. + {0x0000a5f0, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
  781. + {0x0000a5f4, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
  782. + {0x0000a5f8, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
  783. + {0x0000a5fc, 0x778a308c, 0x778a308c, 0x56801eec, 0x56801eec},
  784. + {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  785. + {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  786. + {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  787. + {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  788. + {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  789. + {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
  790. + {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
  791. + {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
  792. + {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
  793. + {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
  794. + {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
  795. + {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
  796. + {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  797. + {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  798. + {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  799. + {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  800. + {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  801. + {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  802. + {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  803. + {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  804. + {0x00016044, 0x056db2db, 0x056db2db, 0x03b6d2e4, 0x03b6d2e4},
  805. + {0x00016048, 0x24925666, 0x24925666, 0x8e481266, 0x8e481266},
  806. + {0x00016280, 0x01000015, 0x01000015, 0x01001015, 0x01001015},
  807. + {0x00016288, 0x30318000, 0x30318000, 0x00318000, 0x00318000},
  808. + {0x00016444, 0x056db2db, 0x056db2db, 0x03b6d2e4, 0x03b6d2e4},
  809. + {0x00016448, 0x24925666, 0x24925666, 0x8e481266, 0x8e481266},
  810. + {0x0000a3a4, 0x00000011, 0x00000011, 0x00000011, 0x00000011},
  811. + {0x0000a3a8, 0x3c3c3c3c, 0x3c3c3c3c, 0x3c3c3c3c, 0x3c3c3c3c},
  812. + {0x0000a3ac, 0x30303030, 0x30303030, 0x30303030, 0x30303030},
  813. +};
  814. +
  815. #endif /* INITVALS_9340_H */
  816. --- a/drivers/net/wireless/ath/ath9k/ath9k.h
  817. +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
  818. @@ -459,6 +459,7 @@ void ath_check_ani(struct ath_softc *sc)
  819. int ath_update_survey_stats(struct ath_softc *sc);
  820. void ath_update_survey_nf(struct ath_softc *sc, int channel);
  821. void ath9k_queue_reset(struct ath_softc *sc, enum ath_reset_type type);
  822. +void ath_ps_full_sleep(unsigned long data);
  823. /**********/
  824. /* BTCOEX */
  825. @@ -476,20 +477,19 @@ enum bt_op_flags {
  826. };
  827. struct ath_btcoex {
  828. - bool hw_timer_enabled;
  829. spinlock_t btcoex_lock;
  830. struct timer_list period_timer; /* Timer for BT period */
  831. + struct timer_list no_stomp_timer;
  832. u32 bt_priority_cnt;
  833. unsigned long bt_priority_time;
  834. unsigned long op_flags;
  835. int bt_stomp_type; /* Types of BT stomping */
  836. - u32 btcoex_no_stomp; /* in usec */
  837. + u32 btcoex_no_stomp; /* in msec */
  838. u32 btcoex_period; /* in msec */
  839. - u32 btscan_no_stomp; /* in usec */
  840. + u32 btscan_no_stomp; /* in msec */
  841. u32 duty_cycle;
  842. u32 bt_wait_time;
  843. int rssi_count;
  844. - struct ath_gen_timer *no_stomp_timer; /* Timer for no BT stomping */
  845. struct ath_mci_profile mci;
  846. u8 stomp_audio;
  847. };
  848. @@ -570,6 +570,34 @@ static inline void ath_fill_led_pin(stru
  849. }
  850. #endif
  851. +/************************/
  852. +/* Wake on Wireless LAN */
  853. +/************************/
  854. +
  855. +#ifdef CONFIG_ATH9K_WOW
  856. +void ath9k_init_wow(struct ieee80211_hw *hw);
  857. +int ath9k_suspend(struct ieee80211_hw *hw,
  858. + struct cfg80211_wowlan *wowlan);
  859. +int ath9k_resume(struct ieee80211_hw *hw);
  860. +void ath9k_set_wakeup(struct ieee80211_hw *hw, bool enabled);
  861. +#else
  862. +static inline void ath9k_init_wow(struct ieee80211_hw *hw)
  863. +{
  864. +}
  865. +static inline int ath9k_suspend(struct ieee80211_hw *hw,
  866. + struct cfg80211_wowlan *wowlan)
  867. +{
  868. + return 0;
  869. +}
  870. +static inline int ath9k_resume(struct ieee80211_hw *hw)
  871. +{
  872. + return 0;
  873. +}
  874. +static inline void ath9k_set_wakeup(struct ieee80211_hw *hw, bool enabled)
  875. +{
  876. +}
  877. +#endif /* CONFIG_ATH9K_WOW */
  878. +
  879. /*******************************/
  880. /* Antenna diversity/combining */
  881. /*******************************/
  882. @@ -632,15 +660,16 @@ void ath_ant_comb_scan(struct ath_softc
  883. /* Main driver core */
  884. /********************/
  885. -#define ATH9K_PCI_CUS198 0x0001
  886. -#define ATH9K_PCI_CUS230 0x0002
  887. -#define ATH9K_PCI_CUS217 0x0004
  888. -#define ATH9K_PCI_CUS252 0x0008
  889. -#define ATH9K_PCI_WOW 0x0010
  890. -#define ATH9K_PCI_BT_ANT_DIV 0x0020
  891. -#define ATH9K_PCI_D3_L1_WAR 0x0040
  892. -#define ATH9K_PCI_AR9565_1ANT 0x0080
  893. -#define ATH9K_PCI_AR9565_2ANT 0x0100
  894. +#define ATH9K_PCI_CUS198 0x0001
  895. +#define ATH9K_PCI_CUS230 0x0002
  896. +#define ATH9K_PCI_CUS217 0x0004
  897. +#define ATH9K_PCI_CUS252 0x0008
  898. +#define ATH9K_PCI_WOW 0x0010
  899. +#define ATH9K_PCI_BT_ANT_DIV 0x0020
  900. +#define ATH9K_PCI_D3_L1_WAR 0x0040
  901. +#define ATH9K_PCI_AR9565_1ANT 0x0080
  902. +#define ATH9K_PCI_AR9565_2ANT 0x0100
  903. +#define ATH9K_PCI_NO_PLL_PWRSAVE 0x0200
  904. /*
  905. * Default cache line size, in bytes.
  906. @@ -723,6 +752,7 @@ struct ath_softc {
  907. struct work_struct hw_check_work;
  908. struct work_struct hw_reset_work;
  909. struct completion paprd_complete;
  910. + wait_queue_head_t tx_wait;
  911. unsigned int hw_busy_count;
  912. unsigned long sc_flags;
  913. @@ -759,6 +789,7 @@ struct ath_softc {
  914. struct delayed_work tx_complete_work;
  915. struct delayed_work hw_pll_work;
  916. struct timer_list rx_poll_timer;
  917. + struct timer_list sleep_timer;
  918. #ifdef CPTCFG_ATH9K_BTCOEX_SUPPORT
  919. struct ath_btcoex btcoex;
  920. @@ -783,7 +814,7 @@ struct ath_softc {
  921. bool tx99_state;
  922. s16 tx99_power;
  923. -#ifdef CONFIG_PM_SLEEP
  924. +#ifdef CONFIG_ATH9K_WOW
  925. atomic_t wow_got_bmiss_intr;
  926. atomic_t wow_sleep_proc_intr; /* in the middle of WoW sleep ? */
  927. u32 wow_intr_before_sleep;
  928. @@ -946,10 +977,25 @@ struct fft_sample_ht20_40 {
  929. u8 data[SPECTRAL_HT20_40_NUM_BINS];
  930. } __packed;
  931. -int ath9k_tx99_init(struct ath_softc *sc);
  932. -void ath9k_tx99_deinit(struct ath_softc *sc);
  933. +/********/
  934. +/* TX99 */
  935. +/********/
  936. +
  937. +#ifdef CONFIG_ATH9K_TX99
  938. +void ath9k_tx99_init_debug(struct ath_softc *sc);
  939. int ath9k_tx99_send(struct ath_softc *sc, struct sk_buff *skb,
  940. struct ath_tx_control *txctl);
  941. +#else
  942. +static inline void ath9k_tx99_init_debug(struct ath_softc *sc)
  943. +{
  944. +}
  945. +static inline int ath9k_tx99_send(struct ath_softc *sc,
  946. + struct sk_buff *skb,
  947. + struct ath_tx_control *txctl)
  948. +{
  949. + return 0;
  950. +}
  951. +#endif /* CONFIG_ATH9K_TX99 */
  952. void ath9k_tasklet(unsigned long data);
  953. int ath_cabq_update(struct ath_softc *);
  954. @@ -966,6 +1012,9 @@ extern bool is_ath9k_unloaded;
  955. u8 ath9k_parse_mpdudensity(u8 mpdudensity);
  956. irqreturn_t ath_isr(int irq, void *dev);
  957. +int ath_reset(struct ath_softc *sc);
  958. +void ath_cancel_work(struct ath_softc *sc);
  959. +void ath_restart_work(struct ath_softc *sc);
  960. int ath9k_init_device(u16 devid, struct ath_softc *sc,
  961. const struct ath_bus_ops *bus_ops);
  962. void ath9k_deinit_device(struct ath_softc *sc);
  963. --- a/drivers/net/wireless/ath/ath9k/debug.c
  964. +++ b/drivers/net/wireless/ath/ath9k/debug.c
  965. @@ -1782,111 +1782,6 @@ void ath9k_deinit_debug(struct ath_softc
  966. }
  967. }
  968. -static ssize_t read_file_tx99(struct file *file, char __user *user_buf,
  969. - size_t count, loff_t *ppos)
  970. -{
  971. - struct ath_softc *sc = file->private_data;
  972. - char buf[3];
  973. - unsigned int len;
  974. -
  975. - len = sprintf(buf, "%d\n", sc->tx99_state);
  976. - return simple_read_from_buffer(user_buf, count, ppos, buf, len);
  977. -}
  978. -
  979. -static ssize_t write_file_tx99(struct file *file, const char __user *user_buf,
  980. - size_t count, loff_t *ppos)
  981. -{
  982. - struct ath_softc *sc = file->private_data;
  983. - struct ath_common *common = ath9k_hw_common(sc->sc_ah);
  984. - char buf[32];
  985. - bool start;
  986. - ssize_t len;
  987. - int r;
  988. -
  989. - if (sc->nvifs > 1)
  990. - return -EOPNOTSUPP;
  991. -
  992. - len = min(count, sizeof(buf) - 1);
  993. - if (copy_from_user(buf, user_buf, len))
  994. - return -EFAULT;
  995. -
  996. - if (strtobool(buf, &start))
  997. - return -EINVAL;
  998. -
  999. - if (start == sc->tx99_state) {
  1000. - if (!start)
  1001. - return count;
  1002. - ath_dbg(common, XMIT, "Resetting TX99\n");
  1003. - ath9k_tx99_deinit(sc);
  1004. - }
  1005. -
  1006. - if (!start) {
  1007. - ath9k_tx99_deinit(sc);
  1008. - return count;
  1009. - }
  1010. -
  1011. - r = ath9k_tx99_init(sc);
  1012. - if (r)
  1013. - return r;
  1014. -
  1015. - return count;
  1016. -}
  1017. -
  1018. -static const struct file_operations fops_tx99 = {
  1019. - .read = read_file_tx99,
  1020. - .write = write_file_tx99,
  1021. - .open = simple_open,
  1022. - .owner = THIS_MODULE,
  1023. - .llseek = default_llseek,
  1024. -};
  1025. -
  1026. -static ssize_t read_file_tx99_power(struct file *file,
  1027. - char __user *user_buf,
  1028. - size_t count, loff_t *ppos)
  1029. -{
  1030. - struct ath_softc *sc = file->private_data;
  1031. - char buf[32];
  1032. - unsigned int len;
  1033. -
  1034. - len = sprintf(buf, "%d (%d dBm)\n",
  1035. - sc->tx99_power,
  1036. - sc->tx99_power / 2);
  1037. -
  1038. - return simple_read_from_buffer(user_buf, count, ppos, buf, len);
  1039. -}
  1040. -
  1041. -static ssize_t write_file_tx99_power(struct file *file,
  1042. - const char __user *user_buf,
  1043. - size_t count, loff_t *ppos)
  1044. -{
  1045. - struct ath_softc *sc = file->private_data;
  1046. - int r;
  1047. - u8 tx_power;
  1048. -
  1049. - r = kstrtou8_from_user(user_buf, count, 0, &tx_power);
  1050. - if (r)
  1051. - return r;
  1052. -
  1053. - if (tx_power > MAX_RATE_POWER)
  1054. - return -EINVAL;
  1055. -
  1056. - sc->tx99_power = tx_power;
  1057. -
  1058. - ath9k_ps_wakeup(sc);
  1059. - ath9k_hw_tx99_set_txpower(sc->sc_ah, sc->tx99_power);
  1060. - ath9k_ps_restore(sc);
  1061. -
  1062. - return count;
  1063. -}
  1064. -
  1065. -static const struct file_operations fops_tx99_power = {
  1066. - .read = read_file_tx99_power,
  1067. - .write = write_file_tx99_power,
  1068. - .open = simple_open,
  1069. - .owner = THIS_MODULE,
  1070. - .llseek = default_llseek,
  1071. -};
  1072. -
  1073. int ath9k_init_debug(struct ath_hw *ah)
  1074. {
  1075. struct ath_common *common = ath9k_hw_common(ah);
  1076. @@ -1903,6 +1798,7 @@ int ath9k_init_debug(struct ath_hw *ah)
  1077. #endif
  1078. ath9k_dfs_init_debug(sc);
  1079. + ath9k_tx99_init_debug(sc);
  1080. debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc,
  1081. &fops_dma);
  1082. @@ -1978,15 +1874,6 @@ int ath9k_init_debug(struct ath_hw *ah)
  1083. debugfs_create_file("btcoex", S_IRUSR, sc->debug.debugfs_phy, sc,
  1084. &fops_btcoex);
  1085. #endif
  1086. - if (config_enabled(CPTCFG_ATH9K_TX99) &&
  1087. - AR_SREV_9300_20_OR_LATER(ah)) {
  1088. - debugfs_create_file("tx99", S_IRUSR | S_IWUSR,
  1089. - sc->debug.debugfs_phy, sc,
  1090. - &fops_tx99);
  1091. - debugfs_create_file("tx99_power", S_IRUSR | S_IWUSR,
  1092. - sc->debug.debugfs_phy, sc,
  1093. - &fops_tx99_power);
  1094. - }
  1095. return 0;
  1096. }
  1097. --- a/drivers/net/wireless/ath/ath9k/hw.c
  1098. +++ b/drivers/net/wireless/ath/ath9k/hw.c
  1099. @@ -17,6 +17,8 @@
  1100. #include <linux/io.h>
  1101. #include <linux/slab.h>
  1102. #include <linux/module.h>
  1103. +#include <linux/time.h>
  1104. +#include <linux/bitops.h>
  1105. #include <asm/unaligned.h>
  1106. #include "hw.h"
  1107. @@ -438,23 +440,13 @@ static bool ath9k_hw_chip_test(struct at
  1108. static void ath9k_hw_init_config(struct ath_hw *ah)
  1109. {
  1110. - int i;
  1111. -
  1112. ah->config.dma_beacon_response_time = 1;
  1113. ah->config.sw_beacon_response_time = 6;
  1114. - ah->config.additional_swba_backoff = 0;
  1115. ah->config.ack_6mb = 0x0;
  1116. ah->config.cwm_ignore_extcca = 0;
  1117. - ah->config.pcie_clock_req = 0;
  1118. ah->config.analog_shiftreg = 1;
  1119. - for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) {
  1120. - ah->config.spurchans[i][0] = AR_NO_SPUR;
  1121. - ah->config.spurchans[i][1] = AR_NO_SPUR;
  1122. - }
  1123. -
  1124. ah->config.rx_intr_mitigation = true;
  1125. - ah->config.pcieSerDesWrite = true;
  1126. /*
  1127. * We need this for PCI devices only (Cardbus, PCI, miniPCI)
  1128. @@ -486,7 +478,6 @@ static void ath9k_hw_init_defaults(struc
  1129. ah->hw_version.magic = AR5416_MAGIC;
  1130. ah->hw_version.subvendorid = 0;
  1131. - ah->atim_window = 0;
  1132. ah->sta_id1_defaults =
  1133. AR_STA_ID1_CRPT_MIC_ENABLE |
  1134. AR_STA_ID1_MCAST_KSRCH;
  1135. @@ -549,11 +540,11 @@ static int ath9k_hw_post_init(struct ath
  1136. * EEPROM needs to be initialized before we do this.
  1137. * This is required for regulatory compliance.
  1138. */
  1139. - if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) {
  1140. + if (AR_SREV_9300_20_OR_LATER(ah)) {
  1141. u16 regdmn = ah->eep_ops->get_eeprom(ah, EEP_REG_0);
  1142. if ((regdmn & 0xF0) == CTL_FCC) {
  1143. - ah->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_9462_FCC_2GHZ;
  1144. - ah->nf_5g.max = AR_PHY_CCA_MAX_GOOD_VAL_9462_FCC_5GHZ;
  1145. + ah->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_9300_FCC_2GHZ;
  1146. + ah->nf_5g.max = AR_PHY_CCA_MAX_GOOD_VAL_9300_FCC_5GHZ;
  1147. }
  1148. }
  1149. @@ -1502,8 +1493,9 @@ static bool ath9k_hw_channel_change(stru
  1150. int r;
  1151. if (pCap->hw_caps & ATH9K_HW_CAP_FCC_BAND_SWITCH) {
  1152. - band_switch = IS_CHAN_5GHZ(ah->curchan) != IS_CHAN_5GHZ(chan);
  1153. - mode_diff = (chan->channelFlags != ah->curchan->channelFlags);
  1154. + u32 flags_diff = chan->channelFlags ^ ah->curchan->channelFlags;
  1155. + band_switch = !!(flags_diff & CHANNEL_5GHZ);
  1156. + mode_diff = !!(flags_diff & ~CHANNEL_HT);
  1157. }
  1158. for (qnum = 0; qnum < AR_NUM_QCU; qnum++) {
  1159. @@ -1815,7 +1807,7 @@ static int ath9k_hw_do_fastcc(struct ath
  1160. * If cross-band fcc is not supoprted, bail out if channelFlags differ.
  1161. */
  1162. if (!(pCap->hw_caps & ATH9K_HW_CAP_FCC_BAND_SWITCH) &&
  1163. - chan->channelFlags != ah->curchan->channelFlags)
  1164. + ((chan->channelFlags ^ ah->curchan->channelFlags) & ~CHANNEL_HT))
  1165. goto fail;
  1166. if (!ath9k_hw_check_alive(ah))
  1167. @@ -1856,10 +1848,12 @@ int ath9k_hw_reset(struct ath_hw *ah, st
  1168. struct ath9k_hw_cal_data *caldata, bool fastcc)
  1169. {
  1170. struct ath_common *common = ath9k_hw_common(ah);
  1171. + struct timespec ts;
  1172. u32 saveLedState;
  1173. u32 saveDefAntenna;
  1174. u32 macStaId1;
  1175. u64 tsf = 0;
  1176. + s64 usec = 0;
  1177. int r;
  1178. bool start_mci_reset = false;
  1179. bool save_fullsleep = ah->chip_fullsleep;
  1180. @@ -1902,10 +1896,10 @@ int ath9k_hw_reset(struct ath_hw *ah, st
  1181. macStaId1 = REG_READ(ah, AR_STA_ID1) & AR_STA_ID1_BASE_RATE_11B;
  1182. - /* For chips on which RTC reset is done, save TSF before it gets cleared */
  1183. - if (AR_SREV_9100(ah) ||
  1184. - (AR_SREV_9280(ah) && ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)))
  1185. - tsf = ath9k_hw_gettsf64(ah);
  1186. + /* Save TSF before chip reset, a cold reset clears it */
  1187. + tsf = ath9k_hw_gettsf64(ah);
  1188. + getrawmonotonic(&ts);
  1189. + usec = ts.tv_sec * 1000 + ts.tv_nsec / 1000;
  1190. saveLedState = REG_READ(ah, AR_CFG_LED) &
  1191. (AR_CFG_LED_ASSOC_CTL | AR_CFG_LED_MODE_SEL |
  1192. @@ -1938,8 +1932,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st
  1193. }
  1194. /* Restore TSF */
  1195. - if (tsf)
  1196. - ath9k_hw_settsf64(ah, tsf);
  1197. + getrawmonotonic(&ts);
  1198. + usec = ts.tv_sec * 1000 + ts.tv_nsec / 1000 - usec;
  1199. + ath9k_hw_settsf64(ah, tsf + usec);
  1200. if (AR_SREV_9280_20_OR_LATER(ah))
  1201. REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE);
  1202. @@ -2261,9 +2256,6 @@ void ath9k_hw_beaconinit(struct ath_hw *
  1203. case NL80211_IFTYPE_ADHOC:
  1204. REG_SET_BIT(ah, AR_TXCFG,
  1205. AR_TXCFG_ADHOC_BEACON_ATIM_TX_POLICY);
  1206. - REG_WRITE(ah, AR_NEXT_NDP_TIMER, next_beacon +
  1207. - TU_TO_USEC(ah->atim_window ? ah->atim_window : 1));
  1208. - flags |= AR_NDP_TIMER_EN;
  1209. case NL80211_IFTYPE_MESH_POINT:
  1210. case NL80211_IFTYPE_AP:
  1211. REG_WRITE(ah, AR_NEXT_TBTT_TIMER, next_beacon);
  1212. @@ -2284,7 +2276,6 @@ void ath9k_hw_beaconinit(struct ath_hw *
  1213. REG_WRITE(ah, AR_BEACON_PERIOD, beacon_period);
  1214. REG_WRITE(ah, AR_DMA_BEACON_PERIOD, beacon_period);
  1215. REG_WRITE(ah, AR_SWBA_PERIOD, beacon_period);
  1216. - REG_WRITE(ah, AR_NDP_PERIOD, beacon_period);
  1217. REGWRITE_BUFFER_FLUSH(ah);
  1218. @@ -2301,12 +2292,9 @@ void ath9k_hw_set_sta_beacon_timers(stru
  1219. ENABLE_REGWRITE_BUFFER(ah);
  1220. - REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(bs->bs_nexttbtt));
  1221. -
  1222. - REG_WRITE(ah, AR_BEACON_PERIOD,
  1223. - TU_TO_USEC(bs->bs_intval));
  1224. - REG_WRITE(ah, AR_DMA_BEACON_PERIOD,
  1225. - TU_TO_USEC(bs->bs_intval));
  1226. + REG_WRITE(ah, AR_NEXT_TBTT_TIMER, bs->bs_nexttbtt);
  1227. + REG_WRITE(ah, AR_BEACON_PERIOD, bs->bs_intval);
  1228. + REG_WRITE(ah, AR_DMA_BEACON_PERIOD, bs->bs_intval);
  1229. REGWRITE_BUFFER_FLUSH(ah);
  1230. @@ -2334,9 +2322,8 @@ void ath9k_hw_set_sta_beacon_timers(stru
  1231. ENABLE_REGWRITE_BUFFER(ah);
  1232. - REG_WRITE(ah, AR_NEXT_DTIM,
  1233. - TU_TO_USEC(bs->bs_nextdtim - SLEEP_SLOP));
  1234. - REG_WRITE(ah, AR_NEXT_TIM, TU_TO_USEC(nextTbtt - SLEEP_SLOP));
  1235. + REG_WRITE(ah, AR_NEXT_DTIM, bs->bs_nextdtim - SLEEP_SLOP);
  1236. + REG_WRITE(ah, AR_NEXT_TIM, nextTbtt - SLEEP_SLOP);
  1237. REG_WRITE(ah, AR_SLEEP1,
  1238. SM((CAB_TIMEOUT_VAL << 3), AR_SLEEP1_CAB_TIMEOUT)
  1239. @@ -2350,8 +2337,8 @@ void ath9k_hw_set_sta_beacon_timers(stru
  1240. REG_WRITE(ah, AR_SLEEP2,
  1241. SM(beacontimeout, AR_SLEEP2_BEACON_TIMEOUT));
  1242. - REG_WRITE(ah, AR_TIM_PERIOD, TU_TO_USEC(beaconintval));
  1243. - REG_WRITE(ah, AR_DTIM_PERIOD, TU_TO_USEC(dtimperiod));
  1244. + REG_WRITE(ah, AR_TIM_PERIOD, beaconintval);
  1245. + REG_WRITE(ah, AR_DTIM_PERIOD, dtimperiod);
  1246. REGWRITE_BUFFER_FLUSH(ah);
  1247. @@ -2987,20 +2974,6 @@ static const struct ath_gen_timer_config
  1248. /* HW generic timer primitives */
  1249. -/* compute and clear index of rightmost 1 */
  1250. -static u32 rightmost_index(struct ath_gen_timer_table *timer_table, u32 *mask)
  1251. -{
  1252. - u32 b;
  1253. -
  1254. - b = *mask;
  1255. - b &= (0-b);
  1256. - *mask &= ~b;
  1257. - b *= debruijn32;
  1258. - b >>= 27;
  1259. -
  1260. - return timer_table->gen_timer_index[b];
  1261. -}
  1262. -
  1263. u32 ath9k_hw_gettsf32(struct ath_hw *ah)
  1264. {
  1265. return REG_READ(ah, AR_TSF_L32);
  1266. @@ -3016,6 +2989,10 @@ struct ath_gen_timer *ath_gen_timer_allo
  1267. struct ath_gen_timer_table *timer_table = &ah->hw_gen_timers;
  1268. struct ath_gen_timer *timer;
  1269. + if ((timer_index < AR_FIRST_NDP_TIMER) ||
  1270. + (timer_index >= ATH_MAX_GEN_TIMER))
  1271. + return NULL;
  1272. +
  1273. timer = kzalloc(sizeof(struct ath_gen_timer), GFP_KERNEL);
  1274. if (timer == NULL)
  1275. return NULL;
  1276. @@ -3033,23 +3010,13 @@ EXPORT_SYMBOL(ath_gen_timer_alloc);
  1277. void ath9k_hw_gen_timer_start(struct ath_hw *ah,
  1278. struct ath_gen_timer *timer,
  1279. - u32 trig_timeout,
  1280. + u32 timer_next,
  1281. u32 timer_period)
  1282. {
  1283. struct ath_gen_timer_table *timer_table = &ah->hw_gen_timers;
  1284. - u32 tsf, timer_next;
  1285. -
  1286. - BUG_ON(!timer_period);
  1287. -
  1288. - set_bit(timer->index, &timer_table->timer_mask.timer_bits);
  1289. -
  1290. - tsf = ath9k_hw_gettsf32(ah);
  1291. + u32 mask = 0;
  1292. - timer_next = tsf + trig_timeout;
  1293. -
  1294. - ath_dbg(ath9k_hw_common(ah), BTCOEX,
  1295. - "current tsf %x period %x timer_next %x\n",
  1296. - tsf, timer_period, timer_next);
  1297. + timer_table->timer_mask |= BIT(timer->index);
  1298. /*
  1299. * Program generic timer registers
  1300. @@ -3075,10 +3042,19 @@ void ath9k_hw_gen_timer_start(struct ath
  1301. (1 << timer->index));
  1302. }
  1303. - /* Enable both trigger and thresh interrupt masks */
  1304. - REG_SET_BIT(ah, AR_IMR_S5,
  1305. - (SM(AR_GENTMR_BIT(timer->index), AR_IMR_S5_GENTIMER_THRESH) |
  1306. - SM(AR_GENTMR_BIT(timer->index), AR_IMR_S5_GENTIMER_TRIG)));
  1307. + if (timer->trigger)
  1308. + mask |= SM(AR_GENTMR_BIT(timer->index),
  1309. + AR_IMR_S5_GENTIMER_TRIG);
  1310. + if (timer->overflow)
  1311. + mask |= SM(AR_GENTMR_BIT(timer->index),
  1312. + AR_IMR_S5_GENTIMER_THRESH);
  1313. +
  1314. + REG_SET_BIT(ah, AR_IMR_S5, mask);
  1315. +
  1316. + if ((ah->imask & ATH9K_INT_GENTIMER) == 0) {
  1317. + ah->imask |= ATH9K_INT_GENTIMER;
  1318. + ath9k_hw_set_interrupts(ah);
  1319. + }
  1320. }
  1321. EXPORT_SYMBOL(ath9k_hw_gen_timer_start);
  1322. @@ -3086,11 +3062,6 @@ void ath9k_hw_gen_timer_stop(struct ath_
  1323. {
  1324. struct ath_gen_timer_table *timer_table = &ah->hw_gen_timers;
  1325. - if ((timer->index < AR_FIRST_NDP_TIMER) ||
  1326. - (timer->index >= ATH_MAX_GEN_TIMER)) {
  1327. - return;
  1328. - }
  1329. -
  1330. /* Clear generic timer enable bits. */
  1331. REG_CLR_BIT(ah, gen_tmr_configuration[timer->index].mode_addr,
  1332. gen_tmr_configuration[timer->index].mode_mask);
  1333. @@ -3110,7 +3081,12 @@ void ath9k_hw_gen_timer_stop(struct ath_
  1334. (SM(AR_GENTMR_BIT(timer->index), AR_IMR_S5_GENTIMER_THRESH) |
  1335. SM(AR_GENTMR_BIT(timer->index), AR_IMR_S5_GENTIMER_TRIG)));
  1336. - clear_bit(timer->index, &timer_table->timer_mask.timer_bits);
  1337. + timer_table->timer_mask &= ~BIT(timer->index);
  1338. +
  1339. + if (timer_table->timer_mask == 0) {
  1340. + ah->imask &= ~ATH9K_INT_GENTIMER;
  1341. + ath9k_hw_set_interrupts(ah);
  1342. + }
  1343. }
  1344. EXPORT_SYMBOL(ath9k_hw_gen_timer_stop);
  1345. @@ -3131,32 +3107,32 @@ void ath_gen_timer_isr(struct ath_hw *ah
  1346. {
  1347. struct ath_gen_timer_table *timer_table = &ah->hw_gen_timers;
  1348. struct ath_gen_timer *timer;
  1349. - struct ath_common *common = ath9k_hw_common(ah);
  1350. - u32 trigger_mask, thresh_mask, index;
  1351. + unsigned long trigger_mask, thresh_mask;
  1352. + unsigned int index;
  1353. /* get hardware generic timer interrupt status */
  1354. trigger_mask = ah->intr_gen_timer_trigger;
  1355. thresh_mask = ah->intr_gen_timer_thresh;
  1356. - trigger_mask &= timer_table->timer_mask.val;
  1357. - thresh_mask &= timer_table->timer_mask.val;
  1358. + trigger_mask &= timer_table->timer_mask;
  1359. + thresh_mask &= timer_table->timer_mask;
  1360. trigger_mask &= ~thresh_mask;
  1361. - while (thresh_mask) {
  1362. - index = rightmost_index(timer_table, &thresh_mask);
  1363. + for_each_set_bit(index, &thresh_mask, ARRAY_SIZE(timer_table->timers)) {
  1364. timer = timer_table->timers[index];
  1365. - BUG_ON(!timer);
  1366. - ath_dbg(common, BTCOEX, "TSF overflow for Gen timer %d\n",
  1367. - index);
  1368. + if (!timer)
  1369. + continue;
  1370. + if (!timer->overflow)
  1371. + continue;
  1372. timer->overflow(timer->arg);
  1373. }
  1374. - while (trigger_mask) {
  1375. - index = rightmost_index(timer_table, &trigger_mask);
  1376. + for_each_set_bit(index, &trigger_mask, ARRAY_SIZE(timer_table->timers)) {
  1377. timer = timer_table->timers[index];
  1378. - BUG_ON(!timer);
  1379. - ath_dbg(common, BTCOEX,
  1380. - "Gen timer[%d] trigger\n", index);
  1381. + if (!timer)
  1382. + continue;
  1383. + if (!timer->trigger)
  1384. + continue;
  1385. timer->trigger(timer->arg);
  1386. }
  1387. }
  1388. --- a/drivers/net/wireless/ath/ath9k/hw.h
  1389. +++ b/drivers/net/wireless/ath/ath9k/hw.h
  1390. @@ -168,7 +168,7 @@
  1391. #define CAB_TIMEOUT_VAL 10
  1392. #define BEACON_TIMEOUT_VAL 10
  1393. #define MIN_BEACON_TIMEOUT_VAL 1
  1394. -#define SLEEP_SLOP 3
  1395. +#define SLEEP_SLOP TU_TO_USEC(3)
  1396. #define INIT_CONFIG_STATUS 0x00000000
  1397. #define INIT_RSSI_THR 0x00000700
  1398. @@ -280,11 +280,8 @@ struct ath9k_hw_capabilities {
  1399. struct ath9k_ops_config {
  1400. int dma_beacon_response_time;
  1401. int sw_beacon_response_time;
  1402. - int additional_swba_backoff;
  1403. int ack_6mb;
  1404. u32 cwm_ignore_extcca;
  1405. - bool pcieSerDesWrite;
  1406. - u8 pcie_clock_req;
  1407. u32 pcie_waen;
  1408. u8 analog_shiftreg;
  1409. u32 ofdm_trig_low;
  1410. @@ -295,18 +292,11 @@ struct ath9k_ops_config {
  1411. int serialize_regmode;
  1412. bool rx_intr_mitigation;
  1413. bool tx_intr_mitigation;
  1414. -#define SPUR_DISABLE 0
  1415. -#define SPUR_ENABLE_IOCTL 1
  1416. -#define SPUR_ENABLE_EEPROM 2
  1417. -#define AR_SPUR_5413_1 1640
  1418. -#define AR_SPUR_5413_2 1200
  1419. #define AR_NO_SPUR 0x8000
  1420. #define AR_BASE_FREQ_2GHZ 2300
  1421. #define AR_BASE_FREQ_5GHZ 4900
  1422. #define AR_SPUR_FEEQ_BOUND_HT40 19
  1423. #define AR_SPUR_FEEQ_BOUND_HT20 10
  1424. - int spurmode;
  1425. - u16 spurchans[AR_EEPROM_MODAL_SPURS][2];
  1426. u8 max_txtrig_level;
  1427. u16 ani_poll_interval; /* ANI poll interval in ms */
  1428. @@ -316,6 +306,8 @@ struct ath9k_ops_config {
  1429. u32 ant_ctrl_comm2g_switch_enable;
  1430. bool xatten_margin_cfg;
  1431. bool alt_mingainidx;
  1432. + bool no_pll_pwrsave;
  1433. + bool tx_gain_buffalo;
  1434. };
  1435. enum ath9k_int {
  1436. @@ -459,10 +451,6 @@ struct ath9k_beacon_state {
  1437. u32 bs_intval;
  1438. #define ATH9K_TSFOOR_THRESHOLD 0x00004240 /* 16k us */
  1439. u32 bs_dtimperiod;
  1440. - u16 bs_cfpperiod;
  1441. - u16 bs_cfpmaxduration;
  1442. - u32 bs_cfpnext;
  1443. - u16 bs_timoffset;
  1444. u16 bs_bmissthreshold;
  1445. u32 bs_sleepduration;
  1446. u32 bs_tsfoor_threshold;
  1447. @@ -498,12 +486,6 @@ struct ath9k_hw_version {
  1448. #define AR_GENTMR_BIT(_index) (1 << (_index))
  1449. -/*
  1450. - * Using de Bruijin sequence to look up 1's index in a 32 bit number
  1451. - * debruijn32 = 0000 0111 0111 1100 1011 0101 0011 0001
  1452. - */
  1453. -#define debruijn32 0x077CB531U
  1454. -
  1455. struct ath_gen_timer_configuration {
  1456. u32 next_addr;
  1457. u32 period_addr;
  1458. @@ -519,12 +501,8 @@ struct ath_gen_timer {
  1459. };
  1460. struct ath_gen_timer_table {
  1461. - u32 gen_timer_index[32];
  1462. struct ath_gen_timer *timers[ATH_MAX_GEN_TIMER];
  1463. - union {
  1464. - unsigned long timer_bits;
  1465. - u16 val;
  1466. - } timer_mask;
  1467. + u16 timer_mask;
  1468. };
  1469. struct ath_hw_antcomb_conf {
  1470. @@ -785,7 +763,6 @@ struct ath_hw {
  1471. u32 txurn_interrupt_mask;
  1472. atomic_t intr_ref_cnt;
  1473. bool chip_fullsleep;
  1474. - u32 atim_window;
  1475. u32 modes_index;
  1476. /* Calibration */
  1477. @@ -864,6 +841,7 @@ struct ath_hw {
  1478. u32 gpio_mask;
  1479. u32 gpio_val;
  1480. + struct ar5416IniArray ini_dfs;
  1481. struct ar5416IniArray iniModes;
  1482. struct ar5416IniArray iniCommon;
  1483. struct ar5416IniArray iniBB_RfGain;
  1484. @@ -920,7 +898,7 @@ struct ath_hw {
  1485. /* Enterprise mode cap */
  1486. u32 ent_mode;
  1487. -#ifdef CONFIG_PM_SLEEP
  1488. +#ifdef CONFIG_ATH9K_WOW
  1489. u32 wow_event_mask;
  1490. #endif
  1491. bool is_clk_25mhz;
  1492. @@ -1126,7 +1104,7 @@ ath9k_hw_get_btcoex_scheme(struct ath_hw
  1493. #endif /* CPTCFG_ATH9K_BTCOEX_SUPPORT */
  1494. -#ifdef CONFIG_PM_SLEEP
  1495. +#ifdef CONFIG_ATH9K_WOW
  1496. const char *ath9k_hw_wow_event_to_string(u32 wow_event);
  1497. void ath9k_hw_wow_apply_pattern(struct ath_hw *ah, u8 *user_pattern,
  1498. u8 *user_mask, int pattern_count,
  1499. --- a/drivers/net/wireless/ath/ath9k/init.c
  1500. +++ b/drivers/net/wireless/ath/ath9k/init.c
  1501. @@ -554,7 +554,7 @@ static void ath9k_init_misc(struct ath_s
  1502. sc->spec_config.fft_period = 0xF;
  1503. }
  1504. -static void ath9k_init_platform(struct ath_softc *sc)
  1505. +static void ath9k_init_pcoem_platform(struct ath_softc *sc)
  1506. {
  1507. struct ath_hw *ah = sc->sc_ah;
  1508. struct ath9k_hw_capabilities *pCap = &ah->caps;
  1509. @@ -609,6 +609,11 @@ static void ath9k_init_platform(struct a
  1510. ah->config.pcie_waen = 0x0040473b;
  1511. ath_info(common, "Enable WAR for ASPM D3/L1\n");
  1512. }
  1513. +
  1514. + if (sc->driver_data & ATH9K_PCI_NO_PLL_PWRSAVE) {
  1515. + ah->config.no_pll_pwrsave = true;
  1516. + ath_info(common, "Disable PLL PowerSave\n");
  1517. + }
  1518. }
  1519. static void ath9k_eeprom_request_cb(const struct firmware *eeprom_blob,
  1520. @@ -656,6 +661,27 @@ static void ath9k_eeprom_release(struct
  1521. release_firmware(sc->sc_ah->eeprom_blob);
  1522. }
  1523. +static int ath9k_init_soc_platform(struct ath_softc *sc)
  1524. +{
  1525. + struct ath9k_platform_data *pdata = sc->dev->platform_data;
  1526. + struct ath_hw *ah = sc->sc_ah;
  1527. + int ret = 0;
  1528. +
  1529. + if (!pdata)
  1530. + return 0;
  1531. +
  1532. + if (pdata->eeprom_name) {
  1533. + ret = ath9k_eeprom_request(sc, pdata->eeprom_name);
  1534. + if (ret)
  1535. + return ret;
  1536. + }
  1537. +
  1538. + if (pdata->tx_gain_buffalo)
  1539. + ah->config.tx_gain_buffalo = true;
  1540. +
  1541. + return ret;
  1542. +}
  1543. +
  1544. static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
  1545. const struct ath_bus_ops *bus_ops)
  1546. {
  1547. @@ -683,6 +709,7 @@ static int ath9k_init_softc(u16 devid, s
  1548. common = ath9k_hw_common(ah);
  1549. sc->dfs_detector = dfs_pattern_detector_init(common, NL80211_DFS_UNSET);
  1550. sc->tx99_power = MAX_RATE_POWER + 1;
  1551. + init_waitqueue_head(&sc->tx_wait);
  1552. if (!pdata) {
  1553. ah->ah_flags |= AH_USE_EEPROM;
  1554. @@ -708,7 +735,11 @@ static int ath9k_init_softc(u16 devid, s
  1555. /*
  1556. * Platform quirks.
  1557. */
  1558. - ath9k_init_platform(sc);
  1559. + ath9k_init_pcoem_platform(sc);
  1560. +
  1561. + ret = ath9k_init_soc_platform(sc);
  1562. + if (ret)
  1563. + return ret;
  1564. /*
  1565. * Enable WLAN/BT RX Antenna diversity only when:
  1566. @@ -722,7 +753,6 @@ static int ath9k_init_softc(u16 devid, s
  1567. common->bt_ant_diversity = 1;
  1568. spin_lock_init(&common->cc_lock);
  1569. -
  1570. spin_lock_init(&sc->sc_serial_rw);
  1571. spin_lock_init(&sc->sc_pm_lock);
  1572. mutex_init(&sc->mutex);
  1573. @@ -730,6 +760,7 @@ static int ath9k_init_softc(u16 devid, s
  1574. tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet,
  1575. (unsigned long)sc);
  1576. + setup_timer(&sc->sleep_timer, ath_ps_full_sleep, (unsigned long)sc);
  1577. INIT_WORK(&sc->hw_reset_work, ath_reset_work);
  1578. INIT_WORK(&sc->hw_check_work, ath_hw_check);
  1579. INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
  1580. @@ -743,12 +774,6 @@ static int ath9k_init_softc(u16 devid, s
  1581. ath_read_cachesize(common, &csz);
  1582. common->cachelsz = csz << 2; /* convert to bytes */
  1583. - if (pdata && pdata->eeprom_name) {
  1584. - ret = ath9k_eeprom_request(sc, pdata->eeprom_name);
  1585. - if (ret)
  1586. - return ret;
  1587. - }
  1588. -
  1589. /* Initializes the hardware for all supported chipsets */
  1590. ret = ath9k_hw_init(ah);
  1591. if (ret)
  1592. @@ -845,7 +870,8 @@ static const struct ieee80211_iface_limi
  1593. };
  1594. static const struct ieee80211_iface_limit if_dfs_limits[] = {
  1595. - { .max = 1, .types = BIT(NL80211_IFTYPE_AP) },
  1596. + { .max = 1, .types = BIT(NL80211_IFTYPE_AP) |
  1597. + BIT(NL80211_IFTYPE_ADHOC) },
  1598. };
  1599. static const struct ieee80211_iface_combination if_comb[] = {
  1600. @@ -862,20 +888,11 @@ static const struct ieee80211_iface_comb
  1601. .max_interfaces = 1,
  1602. .num_different_channels = 1,
  1603. .beacon_int_infra_match = true,
  1604. - .radar_detect_widths = BIT(NL80211_CHAN_NO_HT) |
  1605. - BIT(NL80211_CHAN_HT20),
  1606. + .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
  1607. + BIT(NL80211_CHAN_WIDTH_20),
  1608. }
  1609. };
  1610. -#ifdef CONFIG_PM
  1611. -static const struct wiphy_wowlan_support ath9k_wowlan_support = {
  1612. - .flags = WIPHY_WOWLAN_MAGIC_PKT | WIPHY_WOWLAN_DISCONNECT,
  1613. - .n_patterns = MAX_NUM_USER_PATTERN,
  1614. - .pattern_min_len = 1,
  1615. - .pattern_max_len = MAX_PATTERN_SIZE,
  1616. -};
  1617. -#endif
  1618. -
  1619. void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
  1620. {
  1621. struct ath_hw *ah = sc->sc_ah;
  1622. @@ -925,16 +942,6 @@ void ath9k_set_hw_capab(struct ath_softc
  1623. hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_5_10_MHZ;
  1624. hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
  1625. -#ifdef CONFIG_PM_SLEEP
  1626. - if ((ah->caps.hw_caps & ATH9K_HW_WOW_DEVICE_CAPABLE) &&
  1627. - (sc->driver_data & ATH9K_PCI_WOW) &&
  1628. - device_can_wakeup(sc->dev))
  1629. - hw->wiphy->wowlan = &ath9k_wowlan_support;
  1630. -
  1631. - atomic_set(&sc->wow_sleep_proc_intr, -1);
  1632. - atomic_set(&sc->wow_got_bmiss_intr, -1);
  1633. -#endif
  1634. -
  1635. hw->queues = 4;
  1636. hw->max_rates = 4;
  1637. hw->channel_change_time = 5000;
  1638. @@ -960,6 +967,7 @@ void ath9k_set_hw_capab(struct ath_softc
  1639. hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
  1640. &sc->sbands[IEEE80211_BAND_5GHZ];
  1641. + ath9k_init_wow(hw);
  1642. ath9k_reload_chainmask_settings(sc);
  1643. SET_IEEE80211_PERM_ADDR(hw, common->macaddr);
  1644. @@ -1058,6 +1066,7 @@ static void ath9k_deinit_softc(struct at
  1645. if (ATH_TXQ_SETUP(sc, i))
  1646. ath_tx_cleanupq(sc, &sc->tx.txq[i]);
  1647. + del_timer_sync(&sc->sleep_timer);
  1648. ath9k_hw_deinit(sc->sc_ah);
  1649. if (sc->dfs_detector != NULL)
  1650. sc->dfs_detector->exit(sc->dfs_detector);
  1651. --- a/drivers/net/wireless/ath/ath9k/main.c
  1652. +++ b/drivers/net/wireless/ath/ath9k/main.c
  1653. @@ -82,6 +82,22 @@ static bool ath9k_setpower(struct ath_so
  1654. return ret;
  1655. }
  1656. +void ath_ps_full_sleep(unsigned long data)
  1657. +{
  1658. + struct ath_softc *sc = (struct ath_softc *) data;
  1659. + struct ath_common *common = ath9k_hw_common(sc->sc_ah);
  1660. + bool reset;
  1661. +
  1662. + spin_lock(&common->cc_lock);
  1663. + ath_hw_cycle_counters_update(common);
  1664. + spin_unlock(&common->cc_lock);
  1665. +
  1666. + ath9k_hw_setrxabort(sc->sc_ah, 1);
  1667. + ath9k_hw_stopdmarecv(sc->sc_ah, &reset);
  1668. +
  1669. + ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP);
  1670. +}
  1671. +
  1672. void ath9k_ps_wakeup(struct ath_softc *sc)
  1673. {
  1674. struct ath_common *common = ath9k_hw_common(sc->sc_ah);
  1675. @@ -92,6 +108,7 @@ void ath9k_ps_wakeup(struct ath_softc *s
  1676. if (++sc->ps_usecount != 1)
  1677. goto unlock;
  1678. + del_timer_sync(&sc->sleep_timer);
  1679. power_mode = sc->sc_ah->power_mode;
  1680. ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE);
  1681. @@ -117,17 +134,17 @@ void ath9k_ps_restore(struct ath_softc *
  1682. struct ath_common *common = ath9k_hw_common(sc->sc_ah);
  1683. enum ath9k_power_mode mode;
  1684. unsigned long flags;
  1685. - bool reset;
  1686. spin_lock_irqsave(&sc->sc_pm_lock, flags);
  1687. if (--sc->ps_usecount != 0)
  1688. goto unlock;
  1689. if (sc->ps_idle) {
  1690. - ath9k_hw_setrxabort(sc->sc_ah, 1);
  1691. - ath9k_hw_stopdmarecv(sc->sc_ah, &reset);
  1692. - mode = ATH9K_PM_FULL_SLEEP;
  1693. - } else if (sc->ps_enabled &&
  1694. + mod_timer(&sc->sleep_timer, jiffies + HZ / 10);
  1695. + goto unlock;
  1696. + }
  1697. +
  1698. + if (sc->ps_enabled &&
  1699. !(sc->ps_flags & (PS_WAIT_FOR_BEACON |
  1700. PS_WAIT_FOR_CAB |
  1701. PS_WAIT_FOR_PSPOLL_DATA |
  1702. @@ -163,13 +180,13 @@ static void __ath_cancel_work(struct ath
  1703. #endif
  1704. }
  1705. -static void ath_cancel_work(struct ath_softc *sc)
  1706. +void ath_cancel_work(struct ath_softc *sc)
  1707. {
  1708. __ath_cancel_work(sc);
  1709. cancel_work_sync(&sc->hw_reset_work);
  1710. }
  1711. -static void ath_restart_work(struct ath_softc *sc)
  1712. +void ath_restart_work(struct ath_softc *sc)
  1713. {
  1714. ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
  1715. @@ -487,8 +504,13 @@ void ath9k_tasklet(unsigned long data)
  1716. ath_tx_edma_tasklet(sc);
  1717. else
  1718. ath_tx_tasklet(sc);
  1719. +
  1720. + wake_up(&sc->tx_wait);
  1721. }
  1722. + if (status & ATH9K_INT_GENTIMER)
  1723. + ath_gen_timer_isr(sc->sc_ah);
  1724. +
  1725. ath9k_btcoex_handle_interrupt(sc, status);
  1726. /* re-enable hardware interrupt */
  1727. @@ -579,7 +601,8 @@ irqreturn_t ath_isr(int irq, void *dev)
  1728. goto chip_reset;
  1729. }
  1730. -#ifdef CONFIG_PM_SLEEP
  1731. +
  1732. +#ifdef CONFIG_ATH9K_WOW
  1733. if (status & ATH9K_INT_BMISS) {
  1734. if (atomic_read(&sc->wow_sleep_proc_intr) == 0) {
  1735. ath_dbg(common, ANY, "during WoW we got a BMISS\n");
  1736. @@ -588,6 +611,8 @@ irqreturn_t ath_isr(int irq, void *dev)
  1737. }
  1738. }
  1739. #endif
  1740. +
  1741. +
  1742. if (status & ATH9K_INT_SWBA)
  1743. tasklet_schedule(&sc->bcon_tasklet);
  1744. @@ -627,7 +652,7 @@ chip_reset:
  1745. #undef SCHED_INTR
  1746. }
  1747. -static int ath_reset(struct ath_softc *sc)
  1748. +int ath_reset(struct ath_softc *sc)
  1749. {
  1750. int r;
  1751. @@ -735,6 +760,8 @@ static int ath9k_start(struct ieee80211_
  1752. */
  1753. ath9k_cmn_init_crypto(sc->sc_ah);
  1754. + ath9k_hw_reset_tsf(ah);
  1755. +
  1756. spin_unlock_bh(&sc->sc_pcu_lock);
  1757. mutex_unlock(&sc->mutex);
  1758. @@ -1817,13 +1844,31 @@ static void ath9k_set_coverage_class(str
  1759. mutex_unlock(&sc->mutex);
  1760. }
  1761. +static bool ath9k_has_tx_pending(struct ath_softc *sc)
  1762. +{
  1763. + int i, npend;
  1764. +
  1765. + for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
  1766. + if (!ATH_TXQ_SETUP(sc, i))
  1767. + continue;
  1768. +
  1769. + if (!sc->tx.txq[i].axq_depth)
  1770. + continue;
  1771. +
  1772. + npend = ath9k_has_pending_frames(sc, &sc->tx.txq[i]);
  1773. + if (npend)
  1774. + break;
  1775. + }
  1776. +
  1777. + return !!npend;
  1778. +}
  1779. +
  1780. static void ath9k_flush(struct ieee80211_hw *hw, u32 queues, bool drop)
  1781. {
  1782. struct ath_softc *sc = hw->priv;
  1783. struct ath_hw *ah = sc->sc_ah;
  1784. struct ath_common *common = ath9k_hw_common(ah);
  1785. - int timeout = 200; /* ms */
  1786. - int i, j;
  1787. + int timeout = HZ / 5; /* 200 ms */
  1788. bool drain_txq;
  1789. mutex_lock(&sc->mutex);
  1790. @@ -1841,25 +1886,9 @@ static void ath9k_flush(struct ieee80211
  1791. return;
  1792. }
  1793. - for (j = 0; j < timeout; j++) {
  1794. - bool npend = false;
  1795. -
  1796. - if (j)
  1797. - usleep_range(1000, 2000);
  1798. -
  1799. - for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
  1800. - if (!ATH_TXQ_SETUP(sc, i))
  1801. - continue;
  1802. -
  1803. - npend = ath9k_has_pending_frames(sc, &sc->tx.txq[i]);
  1804. -
  1805. - if (npend)
  1806. - break;
  1807. - }
  1808. -
  1809. - if (!npend)
  1810. - break;
  1811. - }
  1812. + if (wait_event_timeout(sc->tx_wait, !ath9k_has_tx_pending(sc),
  1813. + timeout) > 0)
  1814. + drop = false;
  1815. if (drop) {
  1816. ath9k_ps_wakeup(sc);
  1817. @@ -2021,333 +2050,6 @@ static int ath9k_get_antenna(struct ieee
  1818. return 0;
  1819. }
  1820. -#ifdef CONFIG_PM_SLEEP
  1821. -
  1822. -static void ath9k_wow_map_triggers(struct ath_softc *sc,
  1823. - struct cfg80211_wowlan *wowlan,
  1824. - u32 *wow_triggers)
  1825. -{
  1826. - if (wowlan->disconnect)
  1827. - *wow_triggers |= AH_WOW_LINK_CHANGE |
  1828. - AH_WOW_BEACON_MISS;
  1829. - if (wowlan->magic_pkt)
  1830. - *wow_triggers |= AH_WOW_MAGIC_PATTERN_EN;
  1831. -
  1832. - if (wowlan->n_patterns)
  1833. - *wow_triggers |= AH_WOW_USER_PATTERN_EN;
  1834. -
  1835. - sc->wow_enabled = *wow_triggers;
  1836. -
  1837. -}
  1838. -
  1839. -static void ath9k_wow_add_disassoc_deauth_pattern(struct ath_softc *sc)
  1840. -{
  1841. - struct ath_hw *ah = sc->sc_ah;
  1842. - struct ath_common *common = ath9k_hw_common(ah);
  1843. - int pattern_count = 0;
  1844. - int i, byte_cnt;
  1845. - u8 dis_deauth_pattern[MAX_PATTERN_SIZE];
  1846. - u8 dis_deauth_mask[MAX_PATTERN_SIZE];
  1847. -
  1848. - memset(dis_deauth_pattern, 0, MAX_PATTERN_SIZE);
  1849. - memset(dis_deauth_mask, 0, MAX_PATTERN_SIZE);
  1850. -
  1851. - /*
  1852. - * Create Dissassociate / Deauthenticate packet filter
  1853. - *
  1854. - * 2 bytes 2 byte 6 bytes 6 bytes 6 bytes
  1855. - * +--------------+----------+---------+--------+--------+----
  1856. - * + Frame Control+ Duration + DA + SA + BSSID +
  1857. - * +--------------+----------+---------+--------+--------+----
  1858. - *
  1859. - * The above is the management frame format for disassociate/
  1860. - * deauthenticate pattern, from this we need to match the first byte
  1861. - * of 'Frame Control' and DA, SA, and BSSID fields
  1862. - * (skipping 2nd byte of FC and Duration feild.
  1863. - *
  1864. - * Disassociate pattern
  1865. - * --------------------
  1866. - * Frame control = 00 00 1010
  1867. - * DA, SA, BSSID = x:x:x:x:x:x
  1868. - * Pattern will be A0000000 | x:x:x:x:x:x | x:x:x:x:x:x
  1869. - * | x:x:x:x:x:x -- 22 bytes
  1870. - *
  1871. - * Deauthenticate pattern
  1872. - * ----------------------
  1873. - * Frame control = 00 00 1100
  1874. - * DA, SA, BSSID = x:x:x:x:x:x
  1875. - * Pattern will be C0000000 | x:x:x:x:x:x | x:x:x:x:x:x
  1876. - * | x:x:x:x:x:x -- 22 bytes
  1877. - */
  1878. -
  1879. - /* Create Disassociate Pattern first */
  1880. -
  1881. - byte_cnt = 0;
  1882. -
  1883. - /* Fill out the mask with all FF's */
  1884. -
  1885. - for (i = 0; i < MAX_PATTERN_MASK_SIZE; i++)
  1886. - dis_deauth_mask[i] = 0xff;
  1887. -
  1888. - /* copy the first byte of frame control field */
  1889. - dis_deauth_pattern[byte_cnt] = 0xa0;
  1890. - byte_cnt++;
  1891. -
  1892. - /* skip 2nd byte of frame control and Duration field */
  1893. - byte_cnt += 3;
  1894. -
  1895. - /*
  1896. - * need not match the destination mac address, it can be a broadcast
  1897. - * mac address or an unicast to this station
  1898. - */
  1899. - byte_cnt += 6;
  1900. -
  1901. - /* copy the source mac address */
  1902. - memcpy((dis_deauth_pattern + byte_cnt), common->curbssid, ETH_ALEN);
  1903. -
  1904. - byte_cnt += 6;
  1905. -
  1906. - /* copy the bssid, its same as the source mac address */
  1907. -
  1908. - memcpy((dis_deauth_pattern + byte_cnt), common->curbssid, ETH_ALEN);
  1909. -
  1910. - /* Create Disassociate pattern mask */
  1911. -
  1912. - dis_deauth_mask[0] = 0xfe;
  1913. - dis_deauth_mask[1] = 0x03;
  1914. - dis_deauth_mask[2] = 0xc0;
  1915. -
  1916. - ath_dbg(common, WOW, "Adding disassoc/deauth patterns for WoW\n");
  1917. -
  1918. - ath9k_hw_wow_apply_pattern(ah, dis_deauth_pattern, dis_deauth_mask,
  1919. - pattern_count, byte_cnt);
  1920. -
  1921. - pattern_count++;
  1922. - /*
  1923. - * for de-authenticate pattern, only the first byte of the frame
  1924. - * control field gets changed from 0xA0 to 0xC0
  1925. - */
  1926. - dis_deauth_pattern[0] = 0xC0;
  1927. -
  1928. - ath9k_hw_wow_apply_pattern(ah, dis_deauth_pattern, dis_deauth_mask,
  1929. - pattern_count, byte_cnt);
  1930. -
  1931. -}
  1932. -
  1933. -static void ath9k_wow_add_pattern(struct ath_softc *sc,
  1934. - struct cfg80211_wowlan *wowlan)
  1935. -{
  1936. - struct ath_hw *ah = sc->sc_ah;
  1937. - struct ath9k_wow_pattern *wow_pattern = NULL;
  1938. - struct cfg80211_pkt_pattern *patterns = wowlan->patterns;
  1939. - int mask_len;
  1940. - s8 i = 0;
  1941. -
  1942. - if (!wowlan->n_patterns)
  1943. - return;
  1944. -
  1945. - /*
  1946. - * Add the new user configured patterns
  1947. - */
  1948. - for (i = 0; i < wowlan->n_patterns; i++) {
  1949. -
  1950. - wow_pattern = kzalloc(sizeof(*wow_pattern), GFP_KERNEL);
  1951. -
  1952. - if (!wow_pattern)
  1953. - return;
  1954. -
  1955. - /*
  1956. - * TODO: convert the generic user space pattern to
  1957. - * appropriate chip specific/802.11 pattern.
  1958. - */
  1959. -
  1960. - mask_len = DIV_ROUND_UP(wowlan->patterns[i].pattern_len, 8);
  1961. - memset(wow_pattern->pattern_bytes, 0, MAX_PATTERN_SIZE);
  1962. - memset(wow_pattern->mask_bytes, 0, MAX_PATTERN_SIZE);
  1963. - memcpy(wow_pattern->pattern_bytes, patterns[i].pattern,
  1964. - patterns[i].pattern_len);
  1965. - memcpy(wow_pattern->mask_bytes, patterns[i].mask, mask_len);
  1966. - wow_pattern->pattern_len = patterns[i].pattern_len;
  1967. -
  1968. - /*
  1969. - * just need to take care of deauth and disssoc pattern,
  1970. - * make sure we don't overwrite them.
  1971. - */
  1972. -
  1973. - ath9k_hw_wow_apply_pattern(ah, wow_pattern->pattern_bytes,
  1974. - wow_pattern->mask_bytes,
  1975. - i + 2,
  1976. - wow_pattern->pattern_len);
  1977. - kfree(wow_pattern);
  1978. -
  1979. - }
  1980. -
  1981. -}
  1982. -
  1983. -static int ath9k_suspend(struct ieee80211_hw *hw,
  1984. - struct cfg80211_wowlan *wowlan)
  1985. -{
  1986. - struct ath_softc *sc = hw->priv;
  1987. - struct ath_hw *ah = sc->sc_ah;
  1988. - struct ath_common *common = ath9k_hw_common(ah);
  1989. - u32 wow_triggers_enabled = 0;
  1990. - int ret = 0;
  1991. -
  1992. - mutex_lock(&sc->mutex);
  1993. -
  1994. - ath_cancel_work(sc);
  1995. - ath_stop_ani(sc);
  1996. - del_timer_sync(&sc->rx_poll_timer);
  1997. -
  1998. - if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
  1999. - ath_dbg(common, ANY, "Device not present\n");
  2000. - ret = -EINVAL;
  2001. - goto fail_wow;
  2002. - }
  2003. -
  2004. - if (WARN_ON(!wowlan)) {
  2005. - ath_dbg(common, WOW, "None of the WoW triggers enabled\n");
  2006. - ret = -EINVAL;
  2007. - goto fail_wow;
  2008. - }
  2009. -
  2010. - if (!device_can_wakeup(sc->dev)) {
  2011. - ath_dbg(common, WOW, "device_can_wakeup failed, WoW is not enabled\n");
  2012. - ret = 1;
  2013. - goto fail_wow;
  2014. - }
  2015. -
  2016. - /*
  2017. - * none of the sta vifs are associated
  2018. - * and we are not currently handling multivif
  2019. - * cases, for instance we have to seperately
  2020. - * configure 'keep alive frame' for each
  2021. - * STA.
  2022. - */
  2023. -
  2024. - if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) {
  2025. - ath_dbg(common, WOW, "None of the STA vifs are associated\n");
  2026. - ret = 1;
  2027. - goto fail_wow;
  2028. - }
  2029. -
  2030. - if (sc->nvifs > 1) {
  2031. - ath_dbg(common, WOW, "WoW for multivif is not yet supported\n");
  2032. - ret = 1;
  2033. - goto fail_wow;
  2034. - }
  2035. -
  2036. - ath9k_wow_map_triggers(sc, wowlan, &wow_triggers_enabled);
  2037. -
  2038. - ath_dbg(common, WOW, "WoW triggers enabled 0x%x\n",
  2039. - wow_triggers_enabled);
  2040. -
  2041. - ath9k_ps_wakeup(sc);
  2042. -
  2043. - ath9k_stop_btcoex(sc);
  2044. -
  2045. - /*
  2046. - * Enable wake up on recieving disassoc/deauth
  2047. - * frame by default.
  2048. - */
  2049. - ath9k_wow_add_disassoc_deauth_pattern(sc);
  2050. -
  2051. - if (wow_triggers_enabled & AH_WOW_USER_PATTERN_EN)
  2052. - ath9k_wow_add_pattern(sc, wowlan);
  2053. -
  2054. - spin_lock_bh(&sc->sc_pcu_lock);
  2055. - /*
  2056. - * To avoid false wake, we enable beacon miss interrupt only
  2057. - * when we go to sleep. We save the current interrupt mask
  2058. - * so we can restore it after the system wakes up
  2059. - */
  2060. - sc->wow_intr_before_sleep = ah->imask;
  2061. - ah->imask &= ~ATH9K_INT_GLOBAL;
  2062. - ath9k_hw_disable_interrupts(ah);
  2063. - ah->imask = ATH9K_INT_BMISS | ATH9K_INT_GLOBAL;
  2064. - ath9k_hw_set_interrupts(ah);
  2065. - ath9k_hw_enable_interrupts(ah);
  2066. -
  2067. - spin_unlock_bh(&sc->sc_pcu_lock);
  2068. -
  2069. - /*
  2070. - * we can now sync irq and kill any running tasklets, since we already
  2071. - * disabled interrupts and not holding a spin lock
  2072. - */
  2073. - synchronize_irq(sc->irq);
  2074. - tasklet_kill(&sc->intr_tq);
  2075. -
  2076. - ath9k_hw_wow_enable(ah, wow_triggers_enabled);
  2077. -
  2078. - ath9k_ps_restore(sc);
  2079. - ath_dbg(common, ANY, "WoW enabled in ath9k\n");
  2080. - atomic_inc(&sc->wow_sleep_proc_intr);
  2081. -
  2082. -fail_wow:
  2083. - mutex_unlock(&sc->mutex);
  2084. - return ret;
  2085. -}
  2086. -
  2087. -static int ath9k_resume(struct ieee80211_hw *hw)
  2088. -{
  2089. - struct ath_softc *sc = hw->priv;
  2090. - struct ath_hw *ah = sc->sc_ah;
  2091. - struct ath_common *common = ath9k_hw_common(ah);
  2092. - u32 wow_status;
  2093. -
  2094. - mutex_lock(&sc->mutex);
  2095. -
  2096. - ath9k_ps_wakeup(sc);
  2097. -
  2098. - spin_lock_bh(&sc->sc_pcu_lock);
  2099. -
  2100. - ath9k_hw_disable_interrupts(ah);
  2101. - ah->imask = sc->wow_intr_before_sleep;
  2102. - ath9k_hw_set_interrupts(ah);
  2103. - ath9k_hw_enable_interrupts(ah);
  2104. -
  2105. - spin_unlock_bh(&sc->sc_pcu_lock);
  2106. -
  2107. - wow_status = ath9k_hw_wow_wakeup(ah);
  2108. -
  2109. - if (atomic_read(&sc->wow_got_bmiss_intr) == 0) {
  2110. - /*
  2111. - * some devices may not pick beacon miss
  2112. - * as the reason they woke up so we add
  2113. - * that here for that shortcoming.
  2114. - */
  2115. - wow_status |= AH_WOW_BEACON_MISS;
  2116. - atomic_dec(&sc->wow_got_bmiss_intr);
  2117. - ath_dbg(common, ANY, "Beacon miss interrupt picked up during WoW sleep\n");
  2118. - }
  2119. -
  2120. - atomic_dec(&sc->wow_sleep_proc_intr);
  2121. -
  2122. - if (wow_status) {
  2123. - ath_dbg(common, ANY, "Waking up due to WoW triggers %s with WoW status = %x\n",
  2124. - ath9k_hw_wow_event_to_string(wow_status), wow_status);
  2125. - }
  2126. -
  2127. - ath_restart_work(sc);
  2128. - ath9k_start_btcoex(sc);
  2129. -
  2130. - ath9k_ps_restore(sc);
  2131. - mutex_unlock(&sc->mutex);
  2132. -
  2133. - return 0;
  2134. -}
  2135. -
  2136. -static void ath9k_set_wakeup(struct ieee80211_hw *hw, bool enabled)
  2137. -{
  2138. - struct ath_softc *sc = hw->priv;
  2139. -
  2140. - mutex_lock(&sc->mutex);
  2141. - device_init_wakeup(sc->dev, 1);
  2142. - device_set_wakeup_enable(sc->dev, enabled);
  2143. - mutex_unlock(&sc->mutex);
  2144. -}
  2145. -
  2146. -#endif
  2147. static void ath9k_sw_scan_start(struct ieee80211_hw *hw)
  2148. {
  2149. struct ath_softc *sc = hw->priv;
  2150. @@ -2373,134 +2075,6 @@ static void ath9k_channel_switch_beacon(
  2151. sc->csa_vif = vif;
  2152. }
  2153. -static void ath9k_tx99_stop(struct ath_softc *sc)
  2154. -{
  2155. - struct ath_hw *ah = sc->sc_ah;
  2156. - struct ath_common *common = ath9k_hw_common(ah);
  2157. -
  2158. - ath_drain_all_txq(sc);
  2159. - ath_startrecv(sc);
  2160. -
  2161. - ath9k_hw_set_interrupts(ah);
  2162. - ath9k_hw_enable_interrupts(ah);
  2163. -
  2164. - ieee80211_wake_queues(sc->hw);
  2165. -
  2166. - kfree_skb(sc->tx99_skb);
  2167. - sc->tx99_skb = NULL;
  2168. - sc->tx99_state = false;
  2169. -
  2170. - ath9k_hw_tx99_stop(sc->sc_ah);
  2171. - ath_dbg(common, XMIT, "TX99 stopped\n");
  2172. -}
  2173. -
  2174. -static struct sk_buff *ath9k_build_tx99_skb(struct ath_softc *sc)
  2175. -{
  2176. - static u8 PN9Data[] = {0xff, 0x87, 0xb8, 0x59, 0xb7, 0xa1, 0xcc, 0x24,
  2177. - 0x57, 0x5e, 0x4b, 0x9c, 0x0e, 0xe9, 0xea, 0x50,
  2178. - 0x2a, 0xbe, 0xb4, 0x1b, 0xb6, 0xb0, 0x5d, 0xf1,
  2179. - 0xe6, 0x9a, 0xe3, 0x45, 0xfd, 0x2c, 0x53, 0x18,
  2180. - 0x0c, 0xca, 0xc9, 0xfb, 0x49, 0x37, 0xe5, 0xa8,
  2181. - 0x51, 0x3b, 0x2f, 0x61, 0xaa, 0x72, 0x18, 0x84,
  2182. - 0x02, 0x23, 0x23, 0xab, 0x63, 0x89, 0x51, 0xb3,
  2183. - 0xe7, 0x8b, 0x72, 0x90, 0x4c, 0xe8, 0xfb, 0xc0};
  2184. - u32 len = 1200;
  2185. - struct ieee80211_hw *hw = sc->hw;
  2186. - struct ieee80211_hdr *hdr;
  2187. - struct ieee80211_tx_info *tx_info;
  2188. - struct sk_buff *skb;
  2189. -
  2190. - skb = alloc_skb(len, GFP_KERNEL);
  2191. - if (!skb)
  2192. - return NULL;
  2193. -
  2194. - skb_put(skb, len);
  2195. -
  2196. - memset(skb->data, 0, len);
  2197. -
  2198. - hdr = (struct ieee80211_hdr *)skb->data;
  2199. - hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA);
  2200. - hdr->duration_id = 0;
  2201. -
  2202. - memcpy(hdr->addr1, hw->wiphy->perm_addr, ETH_ALEN);
  2203. - memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
  2204. - memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
  2205. -
  2206. - hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no);
  2207. -
  2208. - tx_info = IEEE80211_SKB_CB(skb);
  2209. - memset(tx_info, 0, sizeof(*tx_info));
  2210. - tx_info->band = hw->conf.chandef.chan->band;
  2211. - tx_info->flags = IEEE80211_TX_CTL_NO_ACK;
  2212. - tx_info->control.vif = sc->tx99_vif;
  2213. -
  2214. - memcpy(skb->data + sizeof(*hdr), PN9Data, sizeof(PN9Data));
  2215. -
  2216. - return skb;
  2217. -}
  2218. -
  2219. -void ath9k_tx99_deinit(struct ath_softc *sc)
  2220. -{
  2221. - ath_reset(sc);
  2222. -
  2223. - ath9k_ps_wakeup(sc);
  2224. - ath9k_tx99_stop(sc);
  2225. - ath9k_ps_restore(sc);
  2226. -}
  2227. -
  2228. -int ath9k_tx99_init(struct ath_softc *sc)
  2229. -{
  2230. - struct ieee80211_hw *hw = sc->hw;
  2231. - struct ath_hw *ah = sc->sc_ah;
  2232. - struct ath_common *common = ath9k_hw_common(ah);
  2233. - struct ath_tx_control txctl;
  2234. - int r;
  2235. -
  2236. - if (sc->sc_flags & SC_OP_INVALID) {
  2237. - ath_err(common,
  2238. - "driver is in invalid state unable to use TX99");
  2239. - return -EINVAL;
  2240. - }
  2241. -
  2242. - sc->tx99_skb = ath9k_build_tx99_skb(sc);
  2243. - if (!sc->tx99_skb)
  2244. - return -ENOMEM;
  2245. -
  2246. - memset(&txctl, 0, sizeof(txctl));
  2247. - txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO];
  2248. -
  2249. - ath_reset(sc);
  2250. -
  2251. - ath9k_ps_wakeup(sc);
  2252. -
  2253. - ath9k_hw_disable_interrupts(ah);
  2254. - atomic_set(&ah->intr_ref_cnt, -1);
  2255. - ath_drain_all_txq(sc);
  2256. - ath_stoprecv(sc);
  2257. -
  2258. - sc->tx99_state = true;
  2259. -
  2260. - ieee80211_stop_queues(hw);
  2261. -
  2262. - if (sc->tx99_power == MAX_RATE_POWER + 1)
  2263. - sc->tx99_power = MAX_RATE_POWER;
  2264. -
  2265. - ath9k_hw_tx99_set_txpower(ah, sc->tx99_power);
  2266. - r = ath9k_tx99_send(sc, sc->tx99_skb, &txctl);
  2267. - if (r) {
  2268. - ath_dbg(common, XMIT, "Failed to xmit TX99 skb\n");
  2269. - return r;
  2270. - }
  2271. -
  2272. - ath_dbg(common, XMIT, "TX99 xmit started using %d ( %ddBm)\n",
  2273. - sc->tx99_power,
  2274. - sc->tx99_power / 2);
  2275. -
  2276. - /* We leave the harware awake as it will be chugging on */
  2277. -
  2278. - return 0;
  2279. -}
  2280. -
  2281. struct ieee80211_ops ath9k_ops = {
  2282. .tx = ath9k_tx,
  2283. .start = ath9k_start,
  2284. @@ -2531,7 +2105,7 @@ struct ieee80211_ops ath9k_ops = {
  2285. .set_antenna = ath9k_set_antenna,
  2286. .get_antenna = ath9k_get_antenna,
  2287. -#ifdef CONFIG_PM_SLEEP
  2288. +#ifdef CONFIG_ATH9K_WOW
  2289. .suspend = ath9k_suspend,
  2290. .resume = ath9k_resume,
  2291. .set_wakeup = ath9k_set_wakeup,
  2292. --- a/drivers/net/wireless/ath/ath9k/wow.c
  2293. +++ b/drivers/net/wireless/ath/ath9k/wow.c
  2294. @@ -1,5 +1,5 @@
  2295. /*
  2296. - * Copyright (c) 2012 Qualcomm Atheros, Inc.
  2297. + * Copyright (c) 2013 Qualcomm Atheros, Inc.
  2298. *
  2299. * Permission to use, copy, modify, and/or distribute this software for any
  2300. * purpose with or without fee is hereby granted, provided that the above
  2301. @@ -14,409 +14,348 @@
  2302. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  2303. */
  2304. -#include <linux/export.h>
  2305. #include "ath9k.h"
  2306. -#include "reg.h"
  2307. -#include "hw-ops.h"
  2308. -const char *ath9k_hw_wow_event_to_string(u32 wow_event)
  2309. +static const struct wiphy_wowlan_support ath9k_wowlan_support = {
  2310. + .flags = WIPHY_WOWLAN_MAGIC_PKT | WIPHY_WOWLAN_DISCONNECT,
  2311. + .n_patterns = MAX_NUM_USER_PATTERN,
  2312. + .pattern_min_len = 1,
  2313. + .pattern_max_len = MAX_PATTERN_SIZE,
  2314. +};
  2315. +
  2316. +static void ath9k_wow_map_triggers(struct ath_softc *sc,
  2317. + struct cfg80211_wowlan *wowlan,
  2318. + u32 *wow_triggers)
  2319. {
  2320. - if (wow_event & AH_WOW_MAGIC_PATTERN_EN)
  2321. - return "Magic pattern";
  2322. - if (wow_event & AH_WOW_USER_PATTERN_EN)
  2323. - return "User pattern";
  2324. - if (wow_event & AH_WOW_LINK_CHANGE)
  2325. - return "Link change";
  2326. - if (wow_event & AH_WOW_BEACON_MISS)
  2327. - return "Beacon miss";
  2328. + if (wowlan->disconnect)
  2329. + *wow_triggers |= AH_WOW_LINK_CHANGE |
  2330. + AH_WOW_BEACON_MISS;
  2331. + if (wowlan->magic_pkt)
  2332. + *wow_triggers |= AH_WOW_MAGIC_PATTERN_EN;
  2333. +
  2334. + if (wowlan->n_patterns)
  2335. + *wow_triggers |= AH_WOW_USER_PATTERN_EN;
  2336. +
  2337. + sc->wow_enabled = *wow_triggers;
  2338. - return "unknown reason";
  2339. }
  2340. -EXPORT_SYMBOL(ath9k_hw_wow_event_to_string);
  2341. -static void ath9k_hw_set_powermode_wow_sleep(struct ath_hw *ah)
  2342. +static void ath9k_wow_add_disassoc_deauth_pattern(struct ath_softc *sc)
  2343. {
  2344. + struct ath_hw *ah = sc->sc_ah;
  2345. struct ath_common *common = ath9k_hw_common(ah);
  2346. + int pattern_count = 0;
  2347. + int i, byte_cnt;
  2348. + u8 dis_deauth_pattern[MAX_PATTERN_SIZE];
  2349. + u8 dis_deauth_mask[MAX_PATTERN_SIZE];
  2350. - REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV);
  2351. + memset(dis_deauth_pattern, 0, MAX_PATTERN_SIZE);
  2352. + memset(dis_deauth_mask, 0, MAX_PATTERN_SIZE);
  2353. - /* set rx disable bit */
  2354. - REG_WRITE(ah, AR_CR, AR_CR_RXD);
  2355. + /*
  2356. + * Create Dissassociate / Deauthenticate packet filter
  2357. + *
  2358. + * 2 bytes 2 byte 6 bytes 6 bytes 6 bytes
  2359. + * +--------------+----------+---------+--------+--------+----
  2360. + * + Frame Control+ Duration + DA + SA + BSSID +
  2361. + * +--------------+----------+---------+--------+--------+----
  2362. + *
  2363. + * The above is the management frame format for disassociate/
  2364. + * deauthenticate pattern, from this we need to match the first byte
  2365. + * of 'Frame Control' and DA, SA, and BSSID fields
  2366. + * (skipping 2nd byte of FC and Duration feild.
  2367. + *
  2368. + * Disassociate pattern
  2369. + * --------------------
  2370. + * Frame control = 00 00 1010
  2371. + * DA, SA, BSSID = x:x:x:x:x:x
  2372. + * Pattern will be A0000000 | x:x:x:x:x:x | x:x:x:x:x:x
  2373. + * | x:x:x:x:x:x -- 22 bytes
  2374. + *
  2375. + * Deauthenticate pattern
  2376. + * ----------------------
  2377. + * Frame control = 00 00 1100
  2378. + * DA, SA, BSSID = x:x:x:x:x:x
  2379. + * Pattern will be C0000000 | x:x:x:x:x:x | x:x:x:x:x:x
  2380. + * | x:x:x:x:x:x -- 22 bytes
  2381. + */
  2382. - if (!ath9k_hw_wait(ah, AR_CR, AR_CR_RXE, 0, AH_WAIT_TIMEOUT)) {
  2383. - ath_err(common, "Failed to stop Rx DMA in 10ms AR_CR=0x%08x AR_DIAG_SW=0x%08x\n",
  2384. - REG_READ(ah, AR_CR), REG_READ(ah, AR_DIAG_SW));
  2385. - return;
  2386. - }
  2387. + /* Create Disassociate Pattern first */
  2388. - REG_WRITE(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_ON_INT);
  2389. -}
  2390. + byte_cnt = 0;
  2391. -static void ath9k_wow_create_keep_alive_pattern(struct ath_hw *ah)
  2392. -{
  2393. - struct ath_common *common = ath9k_hw_common(ah);
  2394. - u8 sta_mac_addr[ETH_ALEN], ap_mac_addr[ETH_ALEN];
  2395. - u32 ctl[13] = {0};
  2396. - u32 data_word[KAL_NUM_DATA_WORDS];
  2397. - u8 i;
  2398. - u32 wow_ka_data_word0;
  2399. -
  2400. - memcpy(sta_mac_addr, common->macaddr, ETH_ALEN);
  2401. - memcpy(ap_mac_addr, common->curbssid, ETH_ALEN);
  2402. -
  2403. - /* set the transmit buffer */
  2404. - ctl[0] = (KAL_FRAME_LEN | (MAX_RATE_POWER << 16));
  2405. - ctl[1] = 0;
  2406. - ctl[3] = 0xb; /* OFDM_6M hardware value for this rate */
  2407. - ctl[4] = 0;
  2408. - ctl[7] = (ah->txchainmask) << 2;
  2409. - ctl[2] = 0xf << 16; /* tx_tries 0 */
  2410. -
  2411. - for (i = 0; i < KAL_NUM_DESC_WORDS; i++)
  2412. - REG_WRITE(ah, (AR_WOW_KA_DESC_WORD2 + i * 4), ctl[i]);
  2413. -
  2414. - REG_WRITE(ah, (AR_WOW_KA_DESC_WORD2 + i * 4), ctl[i]);
  2415. -
  2416. - data_word[0] = (KAL_FRAME_TYPE << 2) | (KAL_FRAME_SUB_TYPE << 4) |
  2417. - (KAL_TO_DS << 8) | (KAL_DURATION_ID << 16);
  2418. - data_word[1] = (ap_mac_addr[3] << 24) | (ap_mac_addr[2] << 16) |
  2419. - (ap_mac_addr[1] << 8) | (ap_mac_addr[0]);
  2420. - data_word[2] = (sta_mac_addr[1] << 24) | (sta_mac_addr[0] << 16) |
  2421. - (ap_mac_addr[5] << 8) | (ap_mac_addr[4]);
  2422. - data_word[3] = (sta_mac_addr[5] << 24) | (sta_mac_addr[4] << 16) |
  2423. - (sta_mac_addr[3] << 8) | (sta_mac_addr[2]);
  2424. - data_word[4] = (ap_mac_addr[3] << 24) | (ap_mac_addr[2] << 16) |
  2425. - (ap_mac_addr[1] << 8) | (ap_mac_addr[0]);
  2426. - data_word[5] = (ap_mac_addr[5] << 8) | (ap_mac_addr[4]);
  2427. -
  2428. - if (AR_SREV_9462_20(ah)) {
  2429. - /* AR9462 2.0 has an extra descriptor word (time based
  2430. - * discard) compared to other chips */
  2431. - REG_WRITE(ah, (AR_WOW_KA_DESC_WORD2 + (12 * 4)), 0);
  2432. - wow_ka_data_word0 = AR_WOW_TXBUF(13);
  2433. - } else {
  2434. - wow_ka_data_word0 = AR_WOW_TXBUF(12);
  2435. - }
  2436. + /* Fill out the mask with all FF's */
  2437. - for (i = 0; i < KAL_NUM_DATA_WORDS; i++)
  2438. - REG_WRITE(ah, (wow_ka_data_word0 + i*4), data_word[i]);
  2439. + for (i = 0; i < MAX_PATTERN_MASK_SIZE; i++)
  2440. + dis_deauth_mask[i] = 0xff;
  2441. -}
  2442. + /* copy the first byte of frame control field */
  2443. + dis_deauth_pattern[byte_cnt] = 0xa0;
  2444. + byte_cnt++;
  2445. -void ath9k_hw_wow_apply_pattern(struct ath_hw *ah, u8 *user_pattern,
  2446. - u8 *user_mask, int pattern_count,
  2447. - int pattern_len)
  2448. -{
  2449. - int i;
  2450. - u32 pattern_val, mask_val;
  2451. - u32 set, clr;
  2452. + /* skip 2nd byte of frame control and Duration field */
  2453. + byte_cnt += 3;
  2454. - /* FIXME: should check count by querying the hardware capability */
  2455. - if (pattern_count >= MAX_NUM_PATTERN)
  2456. - return;
  2457. + /*
  2458. + * need not match the destination mac address, it can be a broadcast
  2459. + * mac address or an unicast to this station
  2460. + */
  2461. + byte_cnt += 6;
  2462. - REG_SET_BIT(ah, AR_WOW_PATTERN, BIT(pattern_count));
  2463. + /* copy the source mac address */
  2464. + memcpy((dis_deauth_pattern + byte_cnt), common->curbssid, ETH_ALEN);
  2465. - /* set the registers for pattern */
  2466. - for (i = 0; i < MAX_PATTERN_SIZE; i += 4) {
  2467. - memcpy(&pattern_val, user_pattern, 4);
  2468. - REG_WRITE(ah, (AR_WOW_TB_PATTERN(pattern_count) + i),
  2469. - pattern_val);
  2470. - user_pattern += 4;
  2471. - }
  2472. + byte_cnt += 6;
  2473. - /* set the registers for mask */
  2474. - for (i = 0; i < MAX_PATTERN_MASK_SIZE; i += 4) {
  2475. - memcpy(&mask_val, user_mask, 4);
  2476. - REG_WRITE(ah, (AR_WOW_TB_MASK(pattern_count) + i), mask_val);
  2477. - user_mask += 4;
  2478. - }
  2479. + /* copy the bssid, its same as the source mac address */
  2480. - /* set the pattern length to be matched
  2481. - *
  2482. - * AR_WOW_LENGTH1_REG1
  2483. - * bit 31:24 pattern 0 length
  2484. - * bit 23:16 pattern 1 length
  2485. - * bit 15:8 pattern 2 length
  2486. - * bit 7:0 pattern 3 length
  2487. - *
  2488. - * AR_WOW_LENGTH1_REG2
  2489. - * bit 31:24 pattern 4 length
  2490. - * bit 23:16 pattern 5 length
  2491. - * bit 15:8 pattern 6 length
  2492. - * bit 7:0 pattern 7 length
  2493. - *
  2494. - * the below logic writes out the new
  2495. - * pattern length for the corresponding
  2496. - * pattern_count, while masking out the
  2497. - * other fields
  2498. - */
  2499. + memcpy((dis_deauth_pattern + byte_cnt), common->curbssid, ETH_ALEN);
  2500. - ah->wow_event_mask |= BIT(pattern_count + AR_WOW_PAT_FOUND_SHIFT);
  2501. + /* Create Disassociate pattern mask */
  2502. - if (pattern_count < 4) {
  2503. - /* Pattern 0-3 uses AR_WOW_LENGTH1 register */
  2504. - set = (pattern_len & AR_WOW_LENGTH_MAX) <<
  2505. - AR_WOW_LEN1_SHIFT(pattern_count);
  2506. - clr = AR_WOW_LENGTH1_MASK(pattern_count);
  2507. - REG_RMW(ah, AR_WOW_LENGTH1, set, clr);
  2508. - } else {
  2509. - /* Pattern 4-7 uses AR_WOW_LENGTH2 register */
  2510. - set = (pattern_len & AR_WOW_LENGTH_MAX) <<
  2511. - AR_WOW_LEN2_SHIFT(pattern_count);
  2512. - clr = AR_WOW_LENGTH2_MASK(pattern_count);
  2513. - REG_RMW(ah, AR_WOW_LENGTH2, set, clr);
  2514. - }
  2515. + dis_deauth_mask[0] = 0xfe;
  2516. + dis_deauth_mask[1] = 0x03;
  2517. + dis_deauth_mask[2] = 0xc0;
  2518. -}
  2519. -EXPORT_SYMBOL(ath9k_hw_wow_apply_pattern);
  2520. + ath_dbg(common, WOW, "Adding disassoc/deauth patterns for WoW\n");
  2521. -u32 ath9k_hw_wow_wakeup(struct ath_hw *ah)
  2522. -{
  2523. - u32 wow_status = 0;
  2524. - u32 val = 0, rval;
  2525. + ath9k_hw_wow_apply_pattern(ah, dis_deauth_pattern, dis_deauth_mask,
  2526. + pattern_count, byte_cnt);
  2527. + pattern_count++;
  2528. /*
  2529. - * read the WoW status register to know
  2530. - * the wakeup reason
  2531. + * for de-authenticate pattern, only the first byte of the frame
  2532. + * control field gets changed from 0xA0 to 0xC0
  2533. */
  2534. - rval = REG_READ(ah, AR_WOW_PATTERN);
  2535. - val = AR_WOW_STATUS(rval);
  2536. + dis_deauth_pattern[0] = 0xC0;
  2537. - /*
  2538. - * mask only the WoW events that we have enabled. Sometimes
  2539. - * we have spurious WoW events from the AR_WOW_PATTERN
  2540. - * register. This mask will clean it up.
  2541. - */
  2542. + ath9k_hw_wow_apply_pattern(ah, dis_deauth_pattern, dis_deauth_mask,
  2543. + pattern_count, byte_cnt);
  2544. - val &= ah->wow_event_mask;
  2545. +}
  2546. - if (val) {
  2547. - if (val & AR_WOW_MAGIC_PAT_FOUND)
  2548. - wow_status |= AH_WOW_MAGIC_PATTERN_EN;
  2549. - if (AR_WOW_PATTERN_FOUND(val))
  2550. - wow_status |= AH_WOW_USER_PATTERN_EN;
  2551. - if (val & AR_WOW_KEEP_ALIVE_FAIL)
  2552. - wow_status |= AH_WOW_LINK_CHANGE;
  2553. - if (val & AR_WOW_BEACON_FAIL)
  2554. - wow_status |= AH_WOW_BEACON_MISS;
  2555. - }
  2556. +static void ath9k_wow_add_pattern(struct ath_softc *sc,
  2557. + struct cfg80211_wowlan *wowlan)
  2558. +{
  2559. + struct ath_hw *ah = sc->sc_ah;
  2560. + struct ath9k_wow_pattern *wow_pattern = NULL;
  2561. + struct cfg80211_pkt_pattern *patterns = wowlan->patterns;
  2562. + int mask_len;
  2563. + s8 i = 0;
  2564. +
  2565. + if (!wowlan->n_patterns)
  2566. + return;
  2567. /*
  2568. - * set and clear WOW_PME_CLEAR registers for the chip to
  2569. - * generate next wow signal.
  2570. - * disable D3 before accessing other registers ?
  2571. + * Add the new user configured patterns
  2572. */
  2573. + for (i = 0; i < wowlan->n_patterns; i++) {
  2574. - /* do we need to check the bit value 0x01000000 (7-10) ?? */
  2575. - REG_RMW(ah, AR_PCIE_PM_CTRL, AR_PMCTRL_WOW_PME_CLR,
  2576. - AR_PMCTRL_PWR_STATE_D1D3);
  2577. + wow_pattern = kzalloc(sizeof(*wow_pattern), GFP_KERNEL);
  2578. - /*
  2579. - * clear all events
  2580. - */
  2581. - REG_WRITE(ah, AR_WOW_PATTERN,
  2582. - AR_WOW_CLEAR_EVENTS(REG_READ(ah, AR_WOW_PATTERN)));
  2583. + if (!wow_pattern)
  2584. + return;
  2585. - /*
  2586. - * restore the beacon threshold to init value
  2587. - */
  2588. - REG_WRITE(ah, AR_RSSI_THR, INIT_RSSI_THR);
  2589. + /*
  2590. + * TODO: convert the generic user space pattern to
  2591. + * appropriate chip specific/802.11 pattern.
  2592. + */
  2593. - /*
  2594. - * Restore the way the PCI-E reset, Power-On-Reset, external
  2595. - * PCIE_POR_SHORT pins are tied to its original value.
  2596. - * Previously just before WoW sleep, we untie the PCI-E
  2597. - * reset to our Chip's Power On Reset so that any PCI-E
  2598. - * reset from the bus will not reset our chip
  2599. - */
  2600. - if (ah->is_pciexpress)
  2601. - ath9k_hw_configpcipowersave(ah, false);
  2602. + mask_len = DIV_ROUND_UP(wowlan->patterns[i].pattern_len, 8);
  2603. + memset(wow_pattern->pattern_bytes, 0, MAX_PATTERN_SIZE);
  2604. + memset(wow_pattern->mask_bytes, 0, MAX_PATTERN_SIZE);
  2605. + memcpy(wow_pattern->pattern_bytes, patterns[i].pattern,
  2606. + patterns[i].pattern_len);
  2607. + memcpy(wow_pattern->mask_bytes, patterns[i].mask, mask_len);
  2608. + wow_pattern->pattern_len = patterns[i].pattern_len;
  2609. +
  2610. + /*
  2611. + * just need to take care of deauth and disssoc pattern,
  2612. + * make sure we don't overwrite them.
  2613. + */
  2614. +
  2615. + ath9k_hw_wow_apply_pattern(ah, wow_pattern->pattern_bytes,
  2616. + wow_pattern->mask_bytes,
  2617. + i + 2,
  2618. + wow_pattern->pattern_len);
  2619. + kfree(wow_pattern);
  2620. - ah->wow_event_mask = 0;
  2621. + }
  2622. - return wow_status;
  2623. }
  2624. -EXPORT_SYMBOL(ath9k_hw_wow_wakeup);
  2625. -void ath9k_hw_wow_enable(struct ath_hw *ah, u32 pattern_enable)
  2626. +int ath9k_suspend(struct ieee80211_hw *hw,
  2627. + struct cfg80211_wowlan *wowlan)
  2628. {
  2629. - u32 wow_event_mask;
  2630. - u32 set, clr;
  2631. + struct ath_softc *sc = hw->priv;
  2632. + struct ath_hw *ah = sc->sc_ah;
  2633. + struct ath_common *common = ath9k_hw_common(ah);
  2634. + u32 wow_triggers_enabled = 0;
  2635. + int ret = 0;
  2636. - /*
  2637. - * wow_event_mask is a mask to the AR_WOW_PATTERN register to
  2638. - * indicate which WoW events we have enabled. The WoW events
  2639. - * are from the 'pattern_enable' in this function and
  2640. - * 'pattern_count' of ath9k_hw_wow_apply_pattern()
  2641. - */
  2642. - wow_event_mask = ah->wow_event_mask;
  2643. + mutex_lock(&sc->mutex);
  2644. - /*
  2645. - * Untie Power-on-Reset from the PCI-E-Reset. When we are in
  2646. - * WOW sleep, we do want the Reset from the PCI-E to disturb
  2647. - * our hw state
  2648. - */
  2649. - if (ah->is_pciexpress) {
  2650. - /*
  2651. - * we need to untie the internal POR (power-on-reset)
  2652. - * to the external PCI-E reset. We also need to tie
  2653. - * the PCI-E Phy reset to the PCI-E reset.
  2654. - */
  2655. - set = AR_WA_RESET_EN | AR_WA_POR_SHORT;
  2656. - clr = AR_WA_UNTIE_RESET_EN | AR_WA_D3_L1_DISABLE;
  2657. - REG_RMW(ah, AR_WA, set, clr);
  2658. + ath_cancel_work(sc);
  2659. + ath_stop_ani(sc);
  2660. + del_timer_sync(&sc->rx_poll_timer);
  2661. +
  2662. + if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
  2663. + ath_dbg(common, ANY, "Device not present\n");
  2664. + ret = -EINVAL;
  2665. + goto fail_wow;
  2666. }
  2667. - /*
  2668. - * set the power states appropriately and enable PME
  2669. - */
  2670. - set = AR_PMCTRL_HOST_PME_EN | AR_PMCTRL_PWR_PM_CTRL_ENA |
  2671. - AR_PMCTRL_AUX_PWR_DET | AR_PMCTRL_WOW_PME_CLR;
  2672. + if (WARN_ON(!wowlan)) {
  2673. + ath_dbg(common, WOW, "None of the WoW triggers enabled\n");
  2674. + ret = -EINVAL;
  2675. + goto fail_wow;
  2676. + }
  2677. - /*
  2678. - * set and clear WOW_PME_CLEAR registers for the chip
  2679. - * to generate next wow signal.
  2680. - */
  2681. - REG_SET_BIT(ah, AR_PCIE_PM_CTRL, set);
  2682. - clr = AR_PMCTRL_WOW_PME_CLR;
  2683. - REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, clr);
  2684. + if (!device_can_wakeup(sc->dev)) {
  2685. + ath_dbg(common, WOW, "device_can_wakeup failed, WoW is not enabled\n");
  2686. + ret = 1;
  2687. + goto fail_wow;
  2688. + }
  2689. /*
  2690. - * Setup for:
  2691. - * - beacon misses
  2692. - * - magic pattern
  2693. - * - keep alive timeout
  2694. - * - pattern matching
  2695. + * none of the sta vifs are associated
  2696. + * and we are not currently handling multivif
  2697. + * cases, for instance we have to seperately
  2698. + * configure 'keep alive frame' for each
  2699. + * STA.
  2700. */
  2701. - /*
  2702. - * Program default values for pattern backoff, aifs/slot/KAL count,
  2703. - * beacon miss timeout, KAL timeout, etc.
  2704. - */
  2705. - set = AR_WOW_BACK_OFF_SHIFT(AR_WOW_PAT_BACKOFF);
  2706. - REG_SET_BIT(ah, AR_WOW_PATTERN, set);
  2707. + if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) {
  2708. + ath_dbg(common, WOW, "None of the STA vifs are associated\n");
  2709. + ret = 1;
  2710. + goto fail_wow;
  2711. + }
  2712. +
  2713. + if (sc->nvifs > 1) {
  2714. + ath_dbg(common, WOW, "WoW for multivif is not yet supported\n");
  2715. + ret = 1;
  2716. + goto fail_wow;
  2717. + }
  2718. - set = AR_WOW_AIFS_CNT(AR_WOW_CNT_AIFS_CNT) |
  2719. - AR_WOW_SLOT_CNT(AR_WOW_CNT_SLOT_CNT) |
  2720. - AR_WOW_KEEP_ALIVE_CNT(AR_WOW_CNT_KA_CNT);
  2721. - REG_SET_BIT(ah, AR_WOW_COUNT, set);
  2722. -
  2723. - if (pattern_enable & AH_WOW_BEACON_MISS)
  2724. - set = AR_WOW_BEACON_TIMO;
  2725. - /* We are not using beacon miss, program a large value */
  2726. - else
  2727. - set = AR_WOW_BEACON_TIMO_MAX;
  2728. + ath9k_wow_map_triggers(sc, wowlan, &wow_triggers_enabled);
  2729. - REG_WRITE(ah, AR_WOW_BCN_TIMO, set);
  2730. + ath_dbg(common, WOW, "WoW triggers enabled 0x%x\n",
  2731. + wow_triggers_enabled);
  2732. - /*
  2733. - * Keep alive timo in ms except AR9280
  2734. - */
  2735. - if (!pattern_enable)
  2736. - set = AR_WOW_KEEP_ALIVE_NEVER;
  2737. - else
  2738. - set = KAL_TIMEOUT * 32;
  2739. + ath9k_ps_wakeup(sc);
  2740. - REG_WRITE(ah, AR_WOW_KEEP_ALIVE_TIMO, set);
  2741. + ath9k_stop_btcoex(sc);
  2742. /*
  2743. - * Keep alive delay in us. based on 'power on clock',
  2744. - * therefore in usec
  2745. + * Enable wake up on recieving disassoc/deauth
  2746. + * frame by default.
  2747. */
  2748. - set = KAL_DELAY * 1000;
  2749. - REG_WRITE(ah, AR_WOW_KEEP_ALIVE_DELAY, set);
  2750. + ath9k_wow_add_disassoc_deauth_pattern(sc);
  2751. - /*
  2752. - * Create keep alive pattern to respond to beacons
  2753. - */
  2754. - ath9k_wow_create_keep_alive_pattern(ah);
  2755. + if (wow_triggers_enabled & AH_WOW_USER_PATTERN_EN)
  2756. + ath9k_wow_add_pattern(sc, wowlan);
  2757. + spin_lock_bh(&sc->sc_pcu_lock);
  2758. /*
  2759. - * Configure MAC WoW Registers
  2760. + * To avoid false wake, we enable beacon miss interrupt only
  2761. + * when we go to sleep. We save the current interrupt mask
  2762. + * so we can restore it after the system wakes up
  2763. */
  2764. - set = 0;
  2765. - /* Send keep alive timeouts anyway */
  2766. - clr = AR_WOW_KEEP_ALIVE_AUTO_DIS;
  2767. -
  2768. - if (pattern_enable & AH_WOW_LINK_CHANGE)
  2769. - wow_event_mask |= AR_WOW_KEEP_ALIVE_FAIL;
  2770. - else
  2771. - set = AR_WOW_KEEP_ALIVE_FAIL_DIS;
  2772. + sc->wow_intr_before_sleep = ah->imask;
  2773. + ah->imask &= ~ATH9K_INT_GLOBAL;
  2774. + ath9k_hw_disable_interrupts(ah);
  2775. + ah->imask = ATH9K_INT_BMISS | ATH9K_INT_GLOBAL;
  2776. + ath9k_hw_set_interrupts(ah);
  2777. + ath9k_hw_enable_interrupts(ah);
  2778. - set = AR_WOW_KEEP_ALIVE_FAIL_DIS;
  2779. - REG_RMW(ah, AR_WOW_KEEP_ALIVE, set, clr);
  2780. + spin_unlock_bh(&sc->sc_pcu_lock);
  2781. /*
  2782. - * we are relying on a bmiss failure. ensure we have
  2783. - * enough threshold to prevent false positives
  2784. + * we can now sync irq and kill any running tasklets, since we already
  2785. + * disabled interrupts and not holding a spin lock
  2786. */
  2787. - REG_RMW_FIELD(ah, AR_RSSI_THR, AR_RSSI_THR_BM_THR,
  2788. - AR_WOW_BMISSTHRESHOLD);
  2789. + synchronize_irq(sc->irq);
  2790. + tasklet_kill(&sc->intr_tq);
  2791. +
  2792. + ath9k_hw_wow_enable(ah, wow_triggers_enabled);
  2793. - set = 0;
  2794. - clr = 0;
  2795. + ath9k_ps_restore(sc);
  2796. + ath_dbg(common, ANY, "WoW enabled in ath9k\n");
  2797. + atomic_inc(&sc->wow_sleep_proc_intr);
  2798. - if (pattern_enable & AH_WOW_BEACON_MISS) {
  2799. - set = AR_WOW_BEACON_FAIL_EN;
  2800. - wow_event_mask |= AR_WOW_BEACON_FAIL;
  2801. - } else {
  2802. - clr = AR_WOW_BEACON_FAIL_EN;
  2803. +fail_wow:
  2804. + mutex_unlock(&sc->mutex);
  2805. + return ret;
  2806. +}
  2807. +
  2808. +int ath9k_resume(struct ieee80211_hw *hw)
  2809. +{
  2810. + struct ath_softc *sc = hw->priv;
  2811. + struct ath_hw *ah = sc->sc_ah;
  2812. + struct ath_common *common = ath9k_hw_common(ah);
  2813. + u32 wow_status;
  2814. +
  2815. + mutex_lock(&sc->mutex);
  2816. +
  2817. + ath9k_ps_wakeup(sc);
  2818. +
  2819. + spin_lock_bh(&sc->sc_pcu_lock);
  2820. +
  2821. + ath9k_hw_disable_interrupts(ah);
  2822. + ah->imask = sc->wow_intr_before_sleep;
  2823. + ath9k_hw_set_interrupts(ah);
  2824. + ath9k_hw_enable_interrupts(ah);
  2825. +
  2826. + spin_unlock_bh(&sc->sc_pcu_lock);
  2827. +
  2828. + wow_status = ath9k_hw_wow_wakeup(ah);
  2829. +
  2830. + if (atomic_read(&sc->wow_got_bmiss_intr) == 0) {
  2831. + /*
  2832. + * some devices may not pick beacon miss
  2833. + * as the reason they woke up so we add
  2834. + * that here for that shortcoming.
  2835. + */
  2836. + wow_status |= AH_WOW_BEACON_MISS;
  2837. + atomic_dec(&sc->wow_got_bmiss_intr);
  2838. + ath_dbg(common, ANY, "Beacon miss interrupt picked up during WoW sleep\n");
  2839. }
  2840. - REG_RMW(ah, AR_WOW_BCN_EN, set, clr);
  2841. + atomic_dec(&sc->wow_sleep_proc_intr);
  2842. - set = 0;
  2843. - clr = 0;
  2844. - /*
  2845. - * Enable the magic packet registers
  2846. - */
  2847. - if (pattern_enable & AH_WOW_MAGIC_PATTERN_EN) {
  2848. - set = AR_WOW_MAGIC_EN;
  2849. - wow_event_mask |= AR_WOW_MAGIC_PAT_FOUND;
  2850. - } else {
  2851. - clr = AR_WOW_MAGIC_EN;
  2852. + if (wow_status) {
  2853. + ath_dbg(common, ANY, "Waking up due to WoW triggers %s with WoW status = %x\n",
  2854. + ath9k_hw_wow_event_to_string(wow_status), wow_status);
  2855. }
  2856. - set |= AR_WOW_MAC_INTR_EN;
  2857. - REG_RMW(ah, AR_WOW_PATTERN, set, clr);
  2858. - REG_WRITE(ah, AR_WOW_PATTERN_MATCH_LT_256B,
  2859. - AR_WOW_PATTERN_SUPPORTED);
  2860. + ath_restart_work(sc);
  2861. + ath9k_start_btcoex(sc);
  2862. - /*
  2863. - * Set the power states appropriately and enable PME
  2864. - */
  2865. - clr = 0;
  2866. - set = AR_PMCTRL_PWR_STATE_D1D3 | AR_PMCTRL_HOST_PME_EN |
  2867. - AR_PMCTRL_PWR_PM_CTRL_ENA;
  2868. + ath9k_ps_restore(sc);
  2869. + mutex_unlock(&sc->mutex);
  2870. - clr = AR_PCIE_PM_CTRL_ENA;
  2871. - REG_RMW(ah, AR_PCIE_PM_CTRL, set, clr);
  2872. + return 0;
  2873. +}
  2874. - /*
  2875. - * this is needed to prevent the chip waking up
  2876. - * the host within 3-4 seconds with certain
  2877. - * platform/BIOS. The fix is to enable
  2878. - * D1 & D3 to match original definition and
  2879. - * also match the OTP value. Anyway this
  2880. - * is more related to SW WOW.
  2881. - */
  2882. - clr = AR_PMCTRL_PWR_STATE_D1D3;
  2883. - REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, clr);
  2884. +void ath9k_set_wakeup(struct ieee80211_hw *hw, bool enabled)
  2885. +{
  2886. + struct ath_softc *sc = hw->priv;
  2887. - set = AR_PMCTRL_PWR_STATE_D1D3_REAL;
  2888. - REG_SET_BIT(ah, AR_PCIE_PM_CTRL, set);
  2889. + mutex_lock(&sc->mutex);
  2890. + device_init_wakeup(sc->dev, 1);
  2891. + device_set_wakeup_enable(sc->dev, enabled);
  2892. + mutex_unlock(&sc->mutex);
  2893. +}
  2894. - REG_CLR_BIT(ah, AR_STA_ID1, AR_STA_ID1_PRESERVE_SEQNUM);
  2895. +void ath9k_init_wow(struct ieee80211_hw *hw)
  2896. +{
  2897. + struct ath_softc *sc = hw->priv;
  2898. - /* to bring down WOW power low margin */
  2899. - set = BIT(13);
  2900. - REG_SET_BIT(ah, AR_PCIE_PHY_REG3, set);
  2901. - /* HW WoW */
  2902. - clr = BIT(5);
  2903. - REG_CLR_BIT(ah, AR_PCU_MISC_MODE3, clr);
  2904. + if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_WOW_DEVICE_CAPABLE) &&
  2905. + (sc->driver_data & ATH9K_PCI_WOW) &&
  2906. + device_can_wakeup(sc->dev))
  2907. + hw->wiphy->wowlan = &ath9k_wowlan_support;
  2908. - ath9k_hw_set_powermode_wow_sleep(ah);
  2909. - ah->wow_event_mask = wow_event_mask;
  2910. + atomic_set(&sc->wow_sleep_proc_intr, -1);
  2911. + atomic_set(&sc->wow_got_bmiss_intr, -1);
  2912. }
  2913. -EXPORT_SYMBOL(ath9k_hw_wow_enable);
  2914. --- a/drivers/net/wireless/ath/ath9k/xmit.c
  2915. +++ b/drivers/net/wireless/ath/ath9k/xmit.c
  2916. @@ -1276,6 +1276,10 @@ static void ath_tx_fill_desc(struct ath_
  2917. if (!rts_thresh || (len > rts_thresh))
  2918. rts = true;
  2919. }
  2920. +
  2921. + if (!aggr)
  2922. + len = fi->framelen;
  2923. +
  2924. ath_buf_set_rate(sc, bf, &info, len, rts);
  2925. }
  2926. @@ -1786,6 +1790,9 @@ bool ath_drain_all_txq(struct ath_softc
  2927. if (!ATH_TXQ_SETUP(sc, i))
  2928. continue;
  2929. + if (!sc->tx.txq[i].axq_depth)
  2930. + continue;
  2931. +
  2932. if (ath9k_hw_numtxpending(ah, sc->tx.txq[i].axq_qnum))
  2933. npend |= BIT(i);
  2934. }
  2935. @@ -2749,6 +2756,8 @@ void ath_tx_node_cleanup(struct ath_soft
  2936. }
  2937. }
  2938. +#ifdef CONFIG_ATH9K_TX99
  2939. +
  2940. int ath9k_tx99_send(struct ath_softc *sc, struct sk_buff *skb,
  2941. struct ath_tx_control *txctl)
  2942. {
  2943. @@ -2791,3 +2800,5 @@ int ath9k_tx99_send(struct ath_softc *sc
  2944. return 0;
  2945. }
  2946. +
  2947. +#endif /* CONFIG_ATH9K_TX99 */
  2948. --- a/drivers/net/wireless/ath/regd.c
  2949. +++ b/drivers/net/wireless/ath/regd.c
  2950. @@ -37,17 +37,17 @@ static int __ath_regd_init(struct ath_re
  2951. /* We enable active scan on these a case by case basis by regulatory domain */
  2952. #define ATH9K_2GHZ_CH12_13 REG_RULE(2467-10, 2472+10, 40, 0, 20,\
  2953. - NL80211_RRF_PASSIVE_SCAN)
  2954. + NL80211_RRF_NO_IR)
  2955. #define ATH9K_2GHZ_CH14 REG_RULE(2484-10, 2484+10, 40, 0, 20,\
  2956. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_OFDM)
  2957. + NL80211_RRF_NO_IR | NL80211_RRF_NO_OFDM)
  2958. /* We allow IBSS on these on a case by case basis by regulatory domain */
  2959. #define ATH9K_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\
  2960. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
  2961. + NL80211_RRF_NO_IR)
  2962. #define ATH9K_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\
  2963. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
  2964. + NL80211_RRF_NO_IR)
  2965. #define ATH9K_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 80, 0, 30,\
  2966. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
  2967. + NL80211_RRF_NO_IR)
  2968. #define ATH9K_2GHZ_ALL ATH9K_2GHZ_CH01_11, \
  2969. ATH9K_2GHZ_CH12_13, \
  2970. @@ -224,17 +224,16 @@ ath_reg_apply_beaconing_flags(struct wip
  2971. * regulatory_hint().
  2972. */
  2973. if (!(reg_rule->flags &
  2974. - NL80211_RRF_NO_IBSS))
  2975. + NL80211_RRF_NO_IR))
  2976. ch->flags &=
  2977. - ~IEEE80211_CHAN_NO_IBSS;
  2978. + ~IEEE80211_CHAN_NO_IR;
  2979. if (!(reg_rule->flags &
  2980. - NL80211_RRF_PASSIVE_SCAN))
  2981. + NL80211_RRF_NO_IR))
  2982. ch->flags &=
  2983. - ~IEEE80211_CHAN_PASSIVE_SCAN;
  2984. + ~IEEE80211_CHAN_NO_IR;
  2985. } else {
  2986. if (ch->beacon_found)
  2987. - ch->flags &= ~(IEEE80211_CHAN_NO_IBSS |
  2988. - IEEE80211_CHAN_PASSIVE_SCAN);
  2989. + ch->flags &= ~IEEE80211_CHAN_NO_IR;
  2990. }
  2991. }
  2992. }
  2993. @@ -260,11 +259,11 @@ ath_reg_apply_active_scan_flags(struct w
  2994. */
  2995. if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) {
  2996. ch = &sband->channels[11]; /* CH 12 */
  2997. - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
  2998. - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
  2999. + if (ch->flags & IEEE80211_CHAN_NO_IR)
  3000. + ch->flags &= ~IEEE80211_CHAN_NO_IR;
  3001. ch = &sband->channels[12]; /* CH 13 */
  3002. - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
  3003. - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
  3004. + if (ch->flags & IEEE80211_CHAN_NO_IR)
  3005. + ch->flags &= ~IEEE80211_CHAN_NO_IR;
  3006. return;
  3007. }
  3008. @@ -278,17 +277,17 @@ ath_reg_apply_active_scan_flags(struct w
  3009. ch = &sband->channels[11]; /* CH 12 */
  3010. reg_rule = freq_reg_info(wiphy, ch->center_freq);
  3011. if (!IS_ERR(reg_rule)) {
  3012. - if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
  3013. - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
  3014. - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
  3015. + if (!(reg_rule->flags & NL80211_RRF_NO_IR))
  3016. + if (ch->flags & IEEE80211_CHAN_NO_IR)
  3017. + ch->flags &= ~IEEE80211_CHAN_NO_IR;
  3018. }
  3019. ch = &sband->channels[12]; /* CH 13 */
  3020. reg_rule = freq_reg_info(wiphy, ch->center_freq);
  3021. if (!IS_ERR(reg_rule)) {
  3022. - if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
  3023. - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
  3024. - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
  3025. + if (!(reg_rule->flags & NL80211_RRF_NO_IR))
  3026. + if (ch->flags & IEEE80211_CHAN_NO_IR)
  3027. + ch->flags &= ~IEEE80211_CHAN_NO_IR;
  3028. }
  3029. }
  3030. @@ -320,8 +319,8 @@ static void ath_reg_apply_radar_flags(st
  3031. */
  3032. if (!(ch->flags & IEEE80211_CHAN_DISABLED))
  3033. ch->flags |= IEEE80211_CHAN_RADAR |
  3034. - IEEE80211_CHAN_NO_IBSS |
  3035. - IEEE80211_CHAN_PASSIVE_SCAN;
  3036. + IEEE80211_CHAN_NO_IR |
  3037. + IEEE80211_CHAN_NO_IR;
  3038. }
  3039. }
  3040. --- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
  3041. +++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c
  3042. @@ -812,7 +812,7 @@ static s32 brcmf_p2p_run_escan(struct br
  3043. struct ieee80211_channel *chan = request->channels[i];
  3044. if (chan->flags & (IEEE80211_CHAN_RADAR |
  3045. - IEEE80211_CHAN_PASSIVE_SCAN))
  3046. + IEEE80211_CHAN_NO_IR))
  3047. continue;
  3048. chanspecs[i] = channel_to_chanspec(&p2p->cfg->d11inf,
  3049. --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
  3050. +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
  3051. @@ -202,9 +202,9 @@ static struct ieee80211_supported_band _
  3052. /* This is to override regulatory domains defined in cfg80211 module (reg.c)
  3053. * By default world regulatory domain defined in reg.c puts the flags
  3054. - * NL80211_RRF_PASSIVE_SCAN and NL80211_RRF_NO_IBSS for 5GHz channels (for
  3055. - * 36..48 and 149..165). With respect to these flags, wpa_supplicant doesn't
  3056. - * start p2p operations on 5GHz channels. All the changes in world regulatory
  3057. + * NL80211_RRF_NO_IR for 5GHz channels (for * 36..48 and 149..165).
  3058. + * With respect to these flags, wpa_supplicant doesn't * start p2p
  3059. + * operations on 5GHz channels. All the changes in world regulatory
  3060. * domain are to be done here.
  3061. */
  3062. static const struct ieee80211_regdomain brcmf_regdom = {
  3063. @@ -5197,10 +5197,10 @@ static s32 brcmf_construct_reginfo(struc
  3064. if (channel & WL_CHAN_RADAR)
  3065. band_chan_arr[index].flags |=
  3066. (IEEE80211_CHAN_RADAR |
  3067. - IEEE80211_CHAN_NO_IBSS);
  3068. + IEEE80211_CHAN_NO_IR);
  3069. if (channel & WL_CHAN_PASSIVE)
  3070. band_chan_arr[index].flags |=
  3071. - IEEE80211_CHAN_PASSIVE_SCAN;
  3072. + IEEE80211_CHAN_NO_IR;
  3073. }
  3074. }
  3075. if (!update)
  3076. --- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
  3077. +++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
  3078. @@ -59,23 +59,20 @@
  3079. #define BRCM_2GHZ_2412_2462 REG_RULE(2412-10, 2462+10, 40, 0, 19, 0)
  3080. #define BRCM_2GHZ_2467_2472 REG_RULE(2467-10, 2472+10, 20, 0, 19, \
  3081. - NL80211_RRF_PASSIVE_SCAN | \
  3082. - NL80211_RRF_NO_IBSS)
  3083. + NL80211_RRF_NO_IR)
  3084. #define BRCM_5GHZ_5180_5240 REG_RULE(5180-10, 5240+10, 40, 0, 21, \
  3085. - NL80211_RRF_PASSIVE_SCAN | \
  3086. - NL80211_RRF_NO_IBSS)
  3087. + NL80211_RRF_NO_IR)
  3088. #define BRCM_5GHZ_5260_5320 REG_RULE(5260-10, 5320+10, 40, 0, 21, \
  3089. - NL80211_RRF_PASSIVE_SCAN | \
  3090. + NL80211_RRF_NO_IR | \
  3091. NL80211_RRF_DFS | \
  3092. - NL80211_RRF_NO_IBSS)
  3093. + NL80211_RRF_NO_IR)
  3094. #define BRCM_5GHZ_5500_5700 REG_RULE(5500-10, 5700+10, 40, 0, 21, \
  3095. - NL80211_RRF_PASSIVE_SCAN | \
  3096. + NL80211_RRF_NO_IR | \
  3097. NL80211_RRF_DFS | \
  3098. - NL80211_RRF_NO_IBSS)
  3099. + NL80211_RRF_NO_IR)
  3100. #define BRCM_5GHZ_5745_5825 REG_RULE(5745-10, 5825+10, 40, 0, 21, \
  3101. - NL80211_RRF_PASSIVE_SCAN | \
  3102. - NL80211_RRF_NO_IBSS)
  3103. + NL80211_RRF_NO_IR)
  3104. static const struct ieee80211_regdomain brcms_regdom_x2 = {
  3105. .n_reg_rules = 6,
  3106. @@ -395,7 +392,7 @@ brcms_c_channel_set_chanspec(struct brcm
  3107. brcms_c_set_gmode(wlc, wlc->protection->gmode_user, false);
  3108. brcms_b_set_chanspec(wlc->hw, chanspec,
  3109. - !!(ch->flags & IEEE80211_CHAN_PASSIVE_SCAN),
  3110. + !!(ch->flags & IEEE80211_CHAN_NO_IR),
  3111. &txpwr);
  3112. }
  3113. @@ -657,8 +654,8 @@ static void brcms_reg_apply_radar_flags(
  3114. */
  3115. if (!(ch->flags & IEEE80211_CHAN_DISABLED))
  3116. ch->flags |= IEEE80211_CHAN_RADAR |
  3117. - IEEE80211_CHAN_NO_IBSS |
  3118. - IEEE80211_CHAN_PASSIVE_SCAN;
  3119. + IEEE80211_CHAN_NO_IR |
  3120. + IEEE80211_CHAN_NO_IR;
  3121. }
  3122. }
  3123. @@ -688,14 +685,13 @@ brcms_reg_apply_beaconing_flags(struct w
  3124. if (IS_ERR(rule))
  3125. continue;
  3126. - if (!(rule->flags & NL80211_RRF_NO_IBSS))
  3127. - ch->flags &= ~IEEE80211_CHAN_NO_IBSS;
  3128. - if (!(rule->flags & NL80211_RRF_PASSIVE_SCAN))
  3129. + if (!(rule->flags & NL80211_RRF_NO_IR))
  3130. + ch->flags &= ~IEEE80211_CHAN_NO_IR;
  3131. + if (!(rule->flags & NL80211_RRF_NO_IR))
  3132. ch->flags &=
  3133. - ~IEEE80211_CHAN_PASSIVE_SCAN;
  3134. + ~IEEE80211_CHAN_NO_IR;
  3135. } else if (ch->beacon_found) {
  3136. - ch->flags &= ~(IEEE80211_CHAN_NO_IBSS |
  3137. - IEEE80211_CHAN_PASSIVE_SCAN);
  3138. + ch->flags &= ~IEEE80211_CHAN_NO_IR;
  3139. }
  3140. }
  3141. }
  3142. --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
  3143. +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
  3144. @@ -125,13 +125,13 @@ static struct ieee80211_channel brcms_2g
  3145. CHAN2GHZ(10, 2457, IEEE80211_CHAN_NO_HT40PLUS),
  3146. CHAN2GHZ(11, 2462, IEEE80211_CHAN_NO_HT40PLUS),
  3147. CHAN2GHZ(12, 2467,
  3148. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS |
  3149. + IEEE80211_CHAN_NO_IR |
  3150. IEEE80211_CHAN_NO_HT40PLUS),
  3151. CHAN2GHZ(13, 2472,
  3152. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS |
  3153. + IEEE80211_CHAN_NO_IR |
  3154. IEEE80211_CHAN_NO_HT40PLUS),
  3155. CHAN2GHZ(14, 2484,
  3156. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS |
  3157. + IEEE80211_CHAN_NO_IR |
  3158. IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS |
  3159. IEEE80211_CHAN_NO_OFDM)
  3160. };
  3161. @@ -144,51 +144,51 @@ static struct ieee80211_channel brcms_5g
  3162. CHAN5GHZ(48, IEEE80211_CHAN_NO_HT40PLUS),
  3163. /* UNII-2 */
  3164. CHAN5GHZ(52,
  3165. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3166. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
  3167. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3168. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
  3169. CHAN5GHZ(56,
  3170. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3171. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
  3172. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3173. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
  3174. CHAN5GHZ(60,
  3175. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3176. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
  3177. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3178. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
  3179. CHAN5GHZ(64,
  3180. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3181. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
  3182. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3183. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
  3184. /* MID */
  3185. CHAN5GHZ(100,
  3186. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3187. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
  3188. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3189. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
  3190. CHAN5GHZ(104,
  3191. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3192. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
  3193. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3194. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
  3195. CHAN5GHZ(108,
  3196. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3197. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
  3198. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3199. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
  3200. CHAN5GHZ(112,
  3201. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3202. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
  3203. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3204. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
  3205. CHAN5GHZ(116,
  3206. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3207. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
  3208. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3209. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
  3210. CHAN5GHZ(120,
  3211. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3212. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
  3213. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3214. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
  3215. CHAN5GHZ(124,
  3216. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3217. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
  3218. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3219. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
  3220. CHAN5GHZ(128,
  3221. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3222. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
  3223. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3224. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
  3225. CHAN5GHZ(132,
  3226. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3227. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40MINUS),
  3228. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3229. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40MINUS),
  3230. CHAN5GHZ(136,
  3231. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3232. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS),
  3233. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3234. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS),
  3235. CHAN5GHZ(140,
  3236. - IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS |
  3237. - IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_HT40PLUS |
  3238. + IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IR |
  3239. + IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_HT40PLUS |
  3240. IEEE80211_CHAN_NO_HT40MINUS),
  3241. /* UNII-3 */
  3242. CHAN5GHZ(149, IEEE80211_CHAN_NO_HT40MINUS),
  3243. --- a/drivers/net/wireless/cw1200/scan.c
  3244. +++ b/drivers/net/wireless/cw1200/scan.c
  3245. @@ -197,9 +197,9 @@ void cw1200_scan_work(struct work_struct
  3246. if ((*it)->band != first->band)
  3247. break;
  3248. if (((*it)->flags ^ first->flags) &
  3249. - IEEE80211_CHAN_PASSIVE_SCAN)
  3250. + IEEE80211_CHAN_NO_IR)
  3251. break;
  3252. - if (!(first->flags & IEEE80211_CHAN_PASSIVE_SCAN) &&
  3253. + if (!(first->flags & IEEE80211_CHAN_NO_IR) &&
  3254. (*it)->max_power != first->max_power)
  3255. break;
  3256. }
  3257. @@ -210,7 +210,7 @@ void cw1200_scan_work(struct work_struct
  3258. else
  3259. scan.max_tx_rate = WSM_TRANSMIT_RATE_1;
  3260. scan.num_probes =
  3261. - (first->flags & IEEE80211_CHAN_PASSIVE_SCAN) ? 0 : 2;
  3262. + (first->flags & IEEE80211_CHAN_NO_IR) ? 0 : 2;
  3263. scan.num_ssids = priv->scan.n_ssids;
  3264. scan.ssids = &priv->scan.ssids[0];
  3265. scan.num_channels = it - priv->scan.curr;
  3266. @@ -233,7 +233,7 @@ void cw1200_scan_work(struct work_struct
  3267. }
  3268. for (i = 0; i < scan.num_channels; ++i) {
  3269. scan.ch[i].number = priv->scan.curr[i]->hw_value;
  3270. - if (priv->scan.curr[i]->flags & IEEE80211_CHAN_PASSIVE_SCAN) {
  3271. + if (priv->scan.curr[i]->flags & IEEE80211_CHAN_NO_IR) {
  3272. scan.ch[i].min_chan_time = 50;
  3273. scan.ch[i].max_chan_time = 100;
  3274. } else {
  3275. @@ -241,7 +241,7 @@ void cw1200_scan_work(struct work_struct
  3276. scan.ch[i].max_chan_time = 25;
  3277. }
  3278. }
  3279. - if (!(first->flags & IEEE80211_CHAN_PASSIVE_SCAN) &&
  3280. + if (!(first->flags & IEEE80211_CHAN_NO_IR) &&
  3281. priv->scan.output_power != first->max_power) {
  3282. priv->scan.output_power = first->max_power;
  3283. wsm_set_output_power(priv,
  3284. --- a/drivers/net/wireless/ipw2x00/ipw2100.c
  3285. +++ b/drivers/net/wireless/ipw2x00/ipw2100.c
  3286. @@ -1934,10 +1934,10 @@ static int ipw2100_wdev_init(struct net_
  3287. bg_band->channels[i].max_power = geo->bg[i].max_power;
  3288. if (geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY)
  3289. bg_band->channels[i].flags |=
  3290. - IEEE80211_CHAN_PASSIVE_SCAN;
  3291. + IEEE80211_CHAN_NO_IR;
  3292. if (geo->bg[i].flags & LIBIPW_CH_NO_IBSS)
  3293. bg_band->channels[i].flags |=
  3294. - IEEE80211_CHAN_NO_IBSS;
  3295. + IEEE80211_CHAN_NO_IR;
  3296. if (geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT)
  3297. bg_band->channels[i].flags |=
  3298. IEEE80211_CHAN_RADAR;
  3299. --- a/drivers/net/wireless/ipw2x00/ipw2200.c
  3300. +++ b/drivers/net/wireless/ipw2x00/ipw2200.c
  3301. @@ -11472,10 +11472,10 @@ static int ipw_wdev_init(struct net_devi
  3302. bg_band->channels[i].max_power = geo->bg[i].max_power;
  3303. if (geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY)
  3304. bg_band->channels[i].flags |=
  3305. - IEEE80211_CHAN_PASSIVE_SCAN;
  3306. + IEEE80211_CHAN_NO_IR;
  3307. if (geo->bg[i].flags & LIBIPW_CH_NO_IBSS)
  3308. bg_band->channels[i].flags |=
  3309. - IEEE80211_CHAN_NO_IBSS;
  3310. + IEEE80211_CHAN_NO_IR;
  3311. if (geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT)
  3312. bg_band->channels[i].flags |=
  3313. IEEE80211_CHAN_RADAR;
  3314. @@ -11511,10 +11511,10 @@ static int ipw_wdev_init(struct net_devi
  3315. a_band->channels[i].max_power = geo->a[i].max_power;
  3316. if (geo->a[i].flags & LIBIPW_CH_PASSIVE_ONLY)
  3317. a_band->channels[i].flags |=
  3318. - IEEE80211_CHAN_PASSIVE_SCAN;
  3319. + IEEE80211_CHAN_NO_IR;
  3320. if (geo->a[i].flags & LIBIPW_CH_NO_IBSS)
  3321. a_band->channels[i].flags |=
  3322. - IEEE80211_CHAN_NO_IBSS;
  3323. + IEEE80211_CHAN_NO_IR;
  3324. if (geo->a[i].flags & LIBIPW_CH_RADAR_DETECT)
  3325. a_band->channels[i].flags |=
  3326. IEEE80211_CHAN_RADAR;
  3327. --- a/drivers/net/wireless/iwlegacy/3945-mac.c
  3328. +++ b/drivers/net/wireless/iwlegacy/3945-mac.c
  3329. @@ -1595,7 +1595,7 @@ il3945_get_channels_for_scan(struct il_p
  3330. * and use long active_dwell time.
  3331. */
  3332. if (!is_active || il_is_channel_passive(ch_info) ||
  3333. - (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN)) {
  3334. + (chan->flags & IEEE80211_CHAN_NO_IR)) {
  3335. scan_ch->type = 0; /* passive */
  3336. if (IL_UCODE_API(il->ucode_ver) == 1)
  3337. scan_ch->active_dwell =
  3338. --- a/drivers/net/wireless/iwlegacy/4965-mac.c
  3339. +++ b/drivers/net/wireless/iwlegacy/4965-mac.c
  3340. @@ -805,7 +805,7 @@ il4965_get_channels_for_scan(struct il_p
  3341. }
  3342. if (!is_active || il_is_channel_passive(ch_info) ||
  3343. - (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN))
  3344. + (chan->flags & IEEE80211_CHAN_NO_IR))
  3345. scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE;
  3346. else
  3347. scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE;
  3348. --- a/drivers/net/wireless/iwlegacy/common.c
  3349. +++ b/drivers/net/wireless/iwlegacy/common.c
  3350. @@ -3447,10 +3447,10 @@ il_init_geos(struct il_priv *il)
  3351. if (il_is_channel_valid(ch)) {
  3352. if (!(ch->flags & EEPROM_CHANNEL_IBSS))
  3353. - geo_ch->flags |= IEEE80211_CHAN_NO_IBSS;
  3354. + geo_ch->flags |= IEEE80211_CHAN_NO_IR;
  3355. if (!(ch->flags & EEPROM_CHANNEL_ACTIVE))
  3356. - geo_ch->flags |= IEEE80211_CHAN_PASSIVE_SCAN;
  3357. + geo_ch->flags |= IEEE80211_CHAN_NO_IR;
  3358. if (ch->flags & EEPROM_CHANNEL_RADAR)
  3359. geo_ch->flags |= IEEE80211_CHAN_RADAR;
  3360. --- a/drivers/net/wireless/iwlegacy/debug.c
  3361. +++ b/drivers/net/wireless/iwlegacy/debug.c
  3362. @@ -567,12 +567,12 @@ il_dbgfs_channels_read(struct file *file
  3363. flags & IEEE80211_CHAN_RADAR ?
  3364. " (IEEE 802.11h required)" : "",
  3365. ((channels[i].
  3366. - flags & IEEE80211_CHAN_NO_IBSS) ||
  3367. + flags & IEEE80211_CHAN_NO_IR) ||
  3368. (channels[i].
  3369. flags & IEEE80211_CHAN_RADAR)) ? "" :
  3370. ", IBSS",
  3371. channels[i].
  3372. - flags & IEEE80211_CHAN_PASSIVE_SCAN ?
  3373. + flags & IEEE80211_CHAN_NO_IR ?
  3374. "passive only" : "active/passive");
  3375. }
  3376. supp_band = il_get_hw_mode(il, IEEE80211_BAND_5GHZ);
  3377. @@ -594,12 +594,12 @@ il_dbgfs_channels_read(struct file *file
  3378. flags & IEEE80211_CHAN_RADAR ?
  3379. " (IEEE 802.11h required)" : "",
  3380. ((channels[i].
  3381. - flags & IEEE80211_CHAN_NO_IBSS) ||
  3382. + flags & IEEE80211_CHAN_NO_IR) ||
  3383. (channels[i].
  3384. flags & IEEE80211_CHAN_RADAR)) ? "" :
  3385. ", IBSS",
  3386. channels[i].
  3387. - flags & IEEE80211_CHAN_PASSIVE_SCAN ?
  3388. + flags & IEEE80211_CHAN_NO_IR ?
  3389. "passive only" : "active/passive");
  3390. }
  3391. ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
  3392. --- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c
  3393. +++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
  3394. @@ -352,12 +352,12 @@ static ssize_t iwl_dbgfs_channels_read(s
  3395. channels[i].max_power,
  3396. channels[i].flags & IEEE80211_CHAN_RADAR ?
  3397. " (IEEE 802.11h required)" : "",
  3398. - ((channels[i].flags & IEEE80211_CHAN_NO_IBSS)
  3399. + ((channels[i].flags & IEEE80211_CHAN_NO_IR)
  3400. || (channels[i].flags &
  3401. IEEE80211_CHAN_RADAR)) ? "" :
  3402. ", IBSS",
  3403. channels[i].flags &
  3404. - IEEE80211_CHAN_PASSIVE_SCAN ?
  3405. + IEEE80211_CHAN_NO_IR ?
  3406. "passive only" : "active/passive");
  3407. }
  3408. supp_band = iwl_get_hw_mode(priv, IEEE80211_BAND_5GHZ);
  3409. @@ -375,12 +375,12 @@ static ssize_t iwl_dbgfs_channels_read(s
  3410. channels[i].max_power,
  3411. channels[i].flags & IEEE80211_CHAN_RADAR ?
  3412. " (IEEE 802.11h required)" : "",
  3413. - ((channels[i].flags & IEEE80211_CHAN_NO_IBSS)
  3414. + ((channels[i].flags & IEEE80211_CHAN_NO_IR)
  3415. || (channels[i].flags &
  3416. IEEE80211_CHAN_RADAR)) ? "" :
  3417. ", IBSS",
  3418. channels[i].flags &
  3419. - IEEE80211_CHAN_PASSIVE_SCAN ?
  3420. + IEEE80211_CHAN_NO_IR ?
  3421. "passive only" : "active/passive");
  3422. }
  3423. ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
  3424. --- a/drivers/net/wireless/iwlwifi/dvm/scan.c
  3425. +++ b/drivers/net/wireless/iwlwifi/dvm/scan.c
  3426. @@ -544,7 +544,7 @@ static int iwl_get_channels_for_scan(str
  3427. channel = chan->hw_value;
  3428. scan_ch->channel = cpu_to_le16(channel);
  3429. - if (!is_active || (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN))
  3430. + if (!is_active || (chan->flags & IEEE80211_CHAN_NO_IR))
  3431. scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE;
  3432. else
  3433. scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE;
  3434. --- a/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c
  3435. +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c
  3436. @@ -614,10 +614,10 @@ static int iwl_init_channel_map(struct d
  3437. channel->flags = IEEE80211_CHAN_NO_HT40;
  3438. if (!(eeprom_ch->flags & EEPROM_CHANNEL_IBSS))
  3439. - channel->flags |= IEEE80211_CHAN_NO_IBSS;
  3440. + channel->flags |= IEEE80211_CHAN_NO_IR;
  3441. if (!(eeprom_ch->flags & EEPROM_CHANNEL_ACTIVE))
  3442. - channel->flags |= IEEE80211_CHAN_PASSIVE_SCAN;
  3443. + channel->flags |= IEEE80211_CHAN_NO_IR;
  3444. if (eeprom_ch->flags & EEPROM_CHANNEL_RADAR)
  3445. channel->flags |= IEEE80211_CHAN_RADAR;
  3446. --- a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
  3447. +++ b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
  3448. @@ -223,10 +223,10 @@ static int iwl_init_channel_map(struct d
  3449. channel->flags |= IEEE80211_CHAN_NO_160MHZ;
  3450. if (!(ch_flags & NVM_CHANNEL_IBSS))
  3451. - channel->flags |= IEEE80211_CHAN_NO_IBSS;
  3452. + channel->flags |= IEEE80211_CHAN_NO_IR;
  3453. if (!(ch_flags & NVM_CHANNEL_ACTIVE))
  3454. - channel->flags |= IEEE80211_CHAN_PASSIVE_SCAN;
  3455. + channel->flags |= IEEE80211_CHAN_NO_IR;
  3456. if (ch_flags & NVM_CHANNEL_RADAR)
  3457. channel->flags |= IEEE80211_CHAN_RADAR;
  3458. --- a/drivers/net/wireless/iwlwifi/mvm/scan.c
  3459. +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
  3460. @@ -192,7 +192,7 @@ static void iwl_mvm_scan_fill_channels(s
  3461. for (i = 0; i < cmd->channel_count; i++) {
  3462. chan->channel = cpu_to_le16(req->channels[i]->hw_value);
  3463. chan->type = cpu_to_le32(type);
  3464. - if (req->channels[i]->flags & IEEE80211_CHAN_PASSIVE_SCAN)
  3465. + if (req->channels[i]->flags & IEEE80211_CHAN_NO_IR)
  3466. chan->type &= cpu_to_le32(~SCAN_CHANNEL_TYPE_ACTIVE);
  3467. chan->active_dwell = cpu_to_le16(active_dwell);
  3468. chan->passive_dwell = cpu_to_le16(passive_dwell);
  3469. @@ -642,7 +642,7 @@ static void iwl_build_channel_cfg(struct
  3470. channels->iter_count[index] = cpu_to_le16(1);
  3471. channels->iter_interval[index] = 0;
  3472. - if (!(s_band->channels[i].flags & IEEE80211_CHAN_PASSIVE_SCAN))
  3473. + if (!(s_band->channels[i].flags & IEEE80211_CHAN_NO_IR))
  3474. channels->type[index] |=
  3475. cpu_to_le32(IWL_SCAN_OFFLOAD_CHANNEL_ACTIVE);
  3476. --- a/drivers/net/wireless/mac80211_hwsim.c
  3477. +++ b/drivers/net/wireless/mac80211_hwsim.c
  3478. @@ -159,7 +159,7 @@ static const struct ieee80211_regdomain
  3479. .reg_rules = {
  3480. REG_RULE(2412-10, 2462+10, 40, 0, 20, 0),
  3481. REG_RULE(5725-10, 5850+10, 40, 0, 30,
  3482. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS),
  3483. + NL80211_RRF_NO_IR),
  3484. }
  3485. };
  3486. @@ -1485,7 +1485,7 @@ static void hw_scan_work(struct work_str
  3487. req->channels[hwsim->scan_chan_idx]->center_freq);
  3488. hwsim->tmp_chan = req->channels[hwsim->scan_chan_idx];
  3489. - if (hwsim->tmp_chan->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
  3490. + if (hwsim->tmp_chan->flags & IEEE80211_CHAN_NO_IR ||
  3491. !req->n_ssids) {
  3492. dwell = 120;
  3493. } else {
  3494. --- a/drivers/net/wireless/mwifiex/cfg80211.c
  3495. +++ b/drivers/net/wireless/mwifiex/cfg80211.c
  3496. @@ -50,24 +50,24 @@ static const struct ieee80211_regdomain
  3497. REG_RULE(2412-10, 2462+10, 40, 3, 20, 0),
  3498. /* Channel 12 - 13 */
  3499. REG_RULE(2467-10, 2472+10, 20, 3, 20,
  3500. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS),
  3501. + NL80211_RRF_NO_IR),
  3502. /* Channel 14 */
  3503. REG_RULE(2484-10, 2484+10, 20, 3, 20,
  3504. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS |
  3505. + NL80211_RRF_NO_IR |
  3506. NL80211_RRF_NO_OFDM),
  3507. /* Channel 36 - 48 */
  3508. REG_RULE(5180-10, 5240+10, 40, 3, 20,
  3509. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS),
  3510. + NL80211_RRF_NO_IR),
  3511. /* Channel 149 - 165 */
  3512. REG_RULE(5745-10, 5825+10, 40, 3, 20,
  3513. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS),
  3514. + NL80211_RRF_NO_IR),
  3515. /* Channel 52 - 64 */
  3516. REG_RULE(5260-10, 5320+10, 40, 3, 30,
  3517. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS |
  3518. + NL80211_RRF_NO_IR |
  3519. NL80211_RRF_DFS),
  3520. /* Channel 100 - 140 */
  3521. REG_RULE(5500-10, 5700+10, 40, 3, 30,
  3522. - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS |
  3523. + NL80211_RRF_NO_IR |
  3524. NL80211_RRF_DFS),
  3525. }
  3526. };
  3527. @@ -1968,7 +1968,7 @@ mwifiex_cfg80211_scan(struct wiphy *wiph
  3528. user_scan_cfg->chan_list[i].chan_number = chan->hw_value;
  3529. user_scan_cfg->chan_list[i].radio_type = chan->band;
  3530. - if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN)
  3531. + if (chan->flags & IEEE80211_CHAN_NO_IR)
  3532. user_scan_cfg->chan_list[i].scan_type =
  3533. MWIFIEX_SCAN_TYPE_PASSIVE;
  3534. else
  3535. --- a/drivers/net/wireless/mwifiex/scan.c
  3536. +++ b/drivers/net/wireless/mwifiex/scan.c
  3537. @@ -515,14 +515,14 @@ mwifiex_scan_create_channel_list(struct
  3538. scan_chan_list[chan_idx].max_scan_time =
  3539. cpu_to_le16((u16) user_scan_in->
  3540. chan_list[0].scan_time);
  3541. - else if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
  3542. + else if (ch->flags & IEEE80211_CHAN_NO_IR)
  3543. scan_chan_list[chan_idx].max_scan_time =
  3544. cpu_to_le16(adapter->passive_scan_time);
  3545. else
  3546. scan_chan_list[chan_idx].max_scan_time =
  3547. cpu_to_le16(adapter->active_scan_time);
  3548. - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
  3549. + if (ch->flags & IEEE80211_CHAN_NO_IR)
  3550. scan_chan_list[chan_idx].chan_scan_mode_bitmap
  3551. |= MWIFIEX_PASSIVE_SCAN;
  3552. else
  3553. --- a/drivers/net/wireless/rt2x00/rt2x00lib.h
  3554. +++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
  3555. @@ -146,7 +146,7 @@ void rt2x00queue_remove_l2pad(struct sk_
  3556. * @local: frame is not from mac80211
  3557. */
  3558. int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
  3559. - bool local);
  3560. + struct ieee80211_sta *sta, bool local);
  3561. /**
  3562. * rt2x00queue_update_beacon - Send new beacon from mac80211
  3563. --- a/drivers/net/wireless/rt2x00/rt2x00mac.c
  3564. +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
  3565. @@ -90,7 +90,7 @@ static int rt2x00mac_tx_rts_cts(struct r
  3566. frag_skb->data, data_length, tx_info,
  3567. (struct ieee80211_rts *)(skb->data));
  3568. - retval = rt2x00queue_write_tx_frame(queue, skb, true);
  3569. + retval = rt2x00queue_write_tx_frame(queue, skb, NULL, true);
  3570. if (retval) {
  3571. dev_kfree_skb_any(skb);
  3572. rt2x00_warn(rt2x00dev, "Failed to send RTS/CTS frame\n");
  3573. @@ -151,7 +151,7 @@ void rt2x00mac_tx(struct ieee80211_hw *h
  3574. goto exit_fail;
  3575. }
  3576. - if (unlikely(rt2x00queue_write_tx_frame(queue, skb, false)))
  3577. + if (unlikely(rt2x00queue_write_tx_frame(queue, skb, control->sta, false)))
  3578. goto exit_fail;
  3579. /*
  3580. --- a/drivers/net/wireless/rt2x00/rt2x00queue.c
  3581. +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
  3582. @@ -635,7 +635,7 @@ static void rt2x00queue_bar_check(struct
  3583. }
  3584. int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
  3585. - bool local)
  3586. + struct ieee80211_sta *sta, bool local)
  3587. {
  3588. struct ieee80211_tx_info *tx_info;
  3589. struct queue_entry *entry;
  3590. @@ -649,7 +649,7 @@ int rt2x00queue_write_tx_frame(struct da
  3591. * after that we are free to use the skb->cb array
  3592. * for our information.
  3593. */
  3594. - rt2x00queue_create_tx_descriptor(queue->rt2x00dev, skb, &txdesc, NULL);
  3595. + rt2x00queue_create_tx_descriptor(queue->rt2x00dev, skb, &txdesc, sta);
  3596. /*
  3597. * All information is retrieved from the skb->cb array,
  3598. --- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
  3599. +++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
  3600. @@ -416,7 +416,7 @@ static int rtl8187_init_urbs(struct ieee
  3601. struct rtl8187_rx_info *info;
  3602. int ret = 0;
  3603. - while (skb_queue_len(&priv->rx_queue) < 16) {
  3604. + while (skb_queue_len(&priv->rx_queue) < 32) {
  3605. skb = __dev_alloc_skb(RTL8187_MAX_RX, GFP_KERNEL);
  3606. if (!skb) {
  3607. ret = -ENOMEM;
  3608. --- a/drivers/net/wireless/rtlwifi/base.c
  3609. +++ b/drivers/net/wireless/rtlwifi/base.c
  3610. @@ -1078,8 +1078,8 @@ u8 rtl_is_special_data(struct ieee80211_
  3611. ip = (struct iphdr *)((u8 *) skb->data + mac_hdr_len +
  3612. SNAP_SIZE + PROTOC_TYPE_SIZE);
  3613. - ether_type = *(u16 *) ((u8 *) skb->data + mac_hdr_len + SNAP_SIZE);
  3614. - /* ether_type = ntohs(ether_type); */
  3615. + ether_type = be16_to_cpu(*(__be16 *)((u8 *)skb->data + mac_hdr_len +
  3616. + SNAP_SIZE));
  3617. if (ETH_P_IP == ether_type) {
  3618. if (IPPROTO_UDP == ip->protocol) {
  3619. --- a/drivers/net/wireless/rtlwifi/regd.c
  3620. +++ b/drivers/net/wireless/rtlwifi/regd.c
  3621. @@ -59,30 +59,27 @@ static struct country_code_to_enum_rd al
  3622. */
  3623. #define RTL819x_2GHZ_CH12_13 \
  3624. REG_RULE(2467-10, 2472+10, 40, 0, 20,\
  3625. - NL80211_RRF_PASSIVE_SCAN)
  3626. + NL80211_RRF_NO_IR)
  3627. #define RTL819x_2GHZ_CH14 \
  3628. REG_RULE(2484-10, 2484+10, 40, 0, 20, \
  3629. - NL80211_RRF_PASSIVE_SCAN | \
  3630. + NL80211_RRF_NO_IR | \
  3631. NL80211_RRF_NO_OFDM)
  3632. /* 5G chan 36 - chan 64*/
  3633. #define RTL819x_5GHZ_5150_5350 \
  3634. REG_RULE(5150-10, 5350+10, 40, 0, 30, \
  3635. - NL80211_RRF_PASSIVE_SCAN | \
  3636. - NL80211_RRF_NO_IBSS)
  3637. + NL80211_RRF_NO_IR)
  3638. /* 5G chan 100 - chan 165*/
  3639. #define RTL819x_5GHZ_5470_5850 \
  3640. REG_RULE(5470-10, 5850+10, 40, 0, 30, \
  3641. - NL80211_RRF_PASSIVE_SCAN | \
  3642. - NL80211_RRF_NO_IBSS)
  3643. + NL80211_RRF_NO_IR)
  3644. /* 5G chan 149 - chan 165*/
  3645. #define RTL819x_5GHZ_5725_5850 \
  3646. REG_RULE(5725-10, 5850+10, 40, 0, 30, \
  3647. - NL80211_RRF_PASSIVE_SCAN | \
  3648. - NL80211_RRF_NO_IBSS)
  3649. + NL80211_RRF_NO_IR)
  3650. #define RTL819x_5GHZ_ALL \
  3651. (RTL819x_5GHZ_5150_5350, RTL819x_5GHZ_5470_5850)
  3652. @@ -185,16 +182,15 @@ static void _rtl_reg_apply_beaconing_fla
  3653. *regulatory_hint().
  3654. */
  3655. - if (!(reg_rule->flags & NL80211_RRF_NO_IBSS))
  3656. - ch->flags &= ~IEEE80211_CHAN_NO_IBSS;
  3657. + if (!(reg_rule->flags & NL80211_RRF_NO_IR))
  3658. + ch->flags &= ~IEEE80211_CHAN_NO_IR;
  3659. if (!(reg_rule->
  3660. - flags & NL80211_RRF_PASSIVE_SCAN))
  3661. + flags & NL80211_RRF_NO_IR))
  3662. ch->flags &=
  3663. - ~IEEE80211_CHAN_PASSIVE_SCAN;
  3664. + ~IEEE80211_CHAN_NO_IR;
  3665. } else {
  3666. if (ch->beacon_found)
  3667. - ch->flags &= ~(IEEE80211_CHAN_NO_IBSS |
  3668. - IEEE80211_CHAN_PASSIVE_SCAN);
  3669. + ch->flags &= ~IEEE80211_CHAN_NO_IR;
  3670. }
  3671. }
  3672. }
  3673. @@ -219,11 +215,11 @@ static void _rtl_reg_apply_active_scan_f
  3674. */
  3675. if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) {
  3676. ch = &sband->channels[11]; /* CH 12 */
  3677. - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
  3678. - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
  3679. + if (ch->flags & IEEE80211_CHAN_NO_IR)
  3680. + ch->flags &= ~IEEE80211_CHAN_NO_IR;
  3681. ch = &sband->channels[12]; /* CH 13 */
  3682. - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
  3683. - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
  3684. + if (ch->flags & IEEE80211_CHAN_NO_IR)
  3685. + ch->flags &= ~IEEE80211_CHAN_NO_IR;
  3686. return;
  3687. }
  3688. @@ -237,17 +233,17 @@ static void _rtl_reg_apply_active_scan_f
  3689. ch = &sband->channels[11]; /* CH 12 */
  3690. reg_rule = freq_reg_info(wiphy, ch->center_freq);
  3691. if (!IS_ERR(reg_rule)) {
  3692. - if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
  3693. - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
  3694. - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
  3695. + if (!(reg_rule->flags & NL80211_RRF_NO_IR))
  3696. + if (ch->flags & IEEE80211_CHAN_NO_IR)
  3697. + ch->flags &= ~IEEE80211_CHAN_NO_IR;
  3698. }
  3699. ch = &sband->channels[12]; /* CH 13 */
  3700. reg_rule = freq_reg_info(wiphy, ch->center_freq);
  3701. if (!IS_ERR(reg_rule)) {
  3702. - if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
  3703. - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
  3704. - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
  3705. + if (!(reg_rule->flags & NL80211_RRF_NO_IR))
  3706. + if (ch->flags & IEEE80211_CHAN_NO_IR)
  3707. + ch->flags &= ~IEEE80211_CHAN_NO_IR;
  3708. }
  3709. }
  3710. @@ -284,8 +280,8 @@ static void _rtl_reg_apply_radar_flags(s
  3711. */
  3712. if (!(ch->flags & IEEE80211_CHAN_DISABLED))
  3713. ch->flags |= IEEE80211_CHAN_RADAR |
  3714. - IEEE80211_CHAN_NO_IBSS |
  3715. - IEEE80211_CHAN_PASSIVE_SCAN;
  3716. + IEEE80211_CHAN_NO_IR |
  3717. + IEEE80211_CHAN_NO_IR;
  3718. }
  3719. }
  3720. --- a/drivers/net/wireless/ti/wl12xx/scan.c
  3721. +++ b/drivers/net/wireless/ti/wl12xx/scan.c
  3722. @@ -47,7 +47,7 @@ static int wl1271_get_scan_channels(stru
  3723. * In active scans, we only scan channels not
  3724. * marked as passive.
  3725. */
  3726. - (passive || !(flags & IEEE80211_CHAN_PASSIVE_SCAN))) {
  3727. + (passive || !(flags & IEEE80211_CHAN_NO_IR))) {
  3728. wl1271_debug(DEBUG_SCAN, "band %d, center_freq %d ",
  3729. req->channels[i]->band,
  3730. req->channels[i]->center_freq);
  3731. --- a/drivers/net/wireless/ti/wlcore/cmd.c
  3732. +++ b/drivers/net/wireless/ti/wlcore/cmd.c
  3733. @@ -1688,7 +1688,7 @@ int wlcore_cmd_regdomain_config_locked(s
  3734. if (channel->flags & (IEEE80211_CHAN_DISABLED |
  3735. IEEE80211_CHAN_RADAR |
  3736. - IEEE80211_CHAN_PASSIVE_SCAN))
  3737. + IEEE80211_CHAN_NO_IR))
  3738. continue;
  3739. ch_bit_idx = wlcore_get_reg_conf_ch_idx(b, ch);
  3740. --- a/drivers/net/wireless/ti/wlcore/main.c
  3741. +++ b/drivers/net/wireless/ti/wlcore/main.c
  3742. @@ -91,8 +91,7 @@ static void wl1271_reg_notify(struct wip
  3743. continue;
  3744. if (ch->flags & IEEE80211_CHAN_RADAR)
  3745. - ch->flags |= IEEE80211_CHAN_NO_IBSS |
  3746. - IEEE80211_CHAN_PASSIVE_SCAN;
  3747. + ch->flags |= IEEE80211_CHAN_NO_IR;
  3748. }
  3749. --- a/drivers/net/wireless/ti/wlcore/scan.c
  3750. +++ b/drivers/net/wireless/ti/wlcore/scan.c
  3751. @@ -189,14 +189,14 @@ wlcore_scan_get_channels(struct wl1271 *
  3752. flags = req_channels[i]->flags;
  3753. if (force_passive)
  3754. - flags |= IEEE80211_CHAN_PASSIVE_SCAN;
  3755. + flags |= IEEE80211_CHAN_NO_IR;
  3756. if ((req_channels[i]->band == band) &&
  3757. !(flags & IEEE80211_CHAN_DISABLED) &&
  3758. (!!(flags & IEEE80211_CHAN_RADAR) == radar) &&
  3759. /* if radar is set, we ignore the passive flag */
  3760. (radar ||
  3761. - !!(flags & IEEE80211_CHAN_PASSIVE_SCAN) == passive)) {
  3762. + !!(flags & IEEE80211_CHAN_NO_IR) == passive)) {
  3763. if (flags & IEEE80211_CHAN_RADAR) {
  3764. @@ -221,7 +221,7 @@ wlcore_scan_get_channels(struct wl1271 *
  3765. (band == IEEE80211_BAND_2GHZ) &&
  3766. (channels[j].channel >= 12) &&
  3767. (channels[j].channel <= 14) &&
  3768. - (flags & IEEE80211_CHAN_PASSIVE_SCAN) &&
  3769. + (flags & IEEE80211_CHAN_NO_IR) &&
  3770. !force_passive) {
  3771. /* pactive channels treated as DFS */
  3772. channels[j].flags = SCAN_CHANNEL_FLAGS_DFS;
  3773. @@ -244,7 +244,7 @@ wlcore_scan_get_channels(struct wl1271 *
  3774. max_dwell_time_active,
  3775. flags & IEEE80211_CHAN_RADAR ?
  3776. ", DFS" : "",
  3777. - flags & IEEE80211_CHAN_PASSIVE_SCAN ?
  3778. + flags & IEEE80211_CHAN_NO_IR ?
  3779. ", PASSIVE" : "");
  3780. j++;
  3781. }
  3782. --- a/include/net/cfg80211.h
  3783. +++ b/include/net/cfg80211.h
  3784. @@ -91,9 +91,8 @@ enum ieee80211_band {
  3785. * Channel flags set by the regulatory control code.
  3786. *
  3787. * @IEEE80211_CHAN_DISABLED: This channel is disabled.
  3788. - * @IEEE80211_CHAN_PASSIVE_SCAN: Only passive scanning is permitted
  3789. - * on this channel.
  3790. - * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel.
  3791. + * @IEEE80211_CHAN_NO_IR: do not initiate radiation, this includes
  3792. + * sending probe requests or beaconing.
  3793. * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
  3794. * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel
  3795. * is not permitted.
  3796. @@ -113,8 +112,8 @@ enum ieee80211_band {
  3797. */
  3798. enum ieee80211_channel_flags {
  3799. IEEE80211_CHAN_DISABLED = 1<<0,
  3800. - IEEE80211_CHAN_PASSIVE_SCAN = 1<<1,
  3801. - IEEE80211_CHAN_NO_IBSS = 1<<2,
  3802. + IEEE80211_CHAN_NO_IR = 1<<1,
  3803. + /* hole at 1<<2 */
  3804. IEEE80211_CHAN_RADAR = 1<<3,
  3805. IEEE80211_CHAN_NO_HT40PLUS = 1<<4,
  3806. IEEE80211_CHAN_NO_HT40MINUS = 1<<5,
  3807. @@ -4149,6 +4148,7 @@ void cfg80211_radar_event(struct wiphy *
  3808. /**
  3809. * cfg80211_cac_event - Channel availability check (CAC) event
  3810. * @netdev: network device
  3811. + * @chandef: chandef for the current channel
  3812. * @event: type of event
  3813. * @gfp: context flags
  3814. *
  3815. @@ -4157,6 +4157,7 @@ void cfg80211_radar_event(struct wiphy *
  3816. * also by full-MAC drivers.
  3817. */
  3818. void cfg80211_cac_event(struct net_device *netdev,
  3819. + const struct cfg80211_chan_def *chandef,
  3820. enum nl80211_radar_event event, gfp_t gfp);
  3821. @@ -4282,7 +4283,8 @@ bool cfg80211_reg_can_beacon(struct wiph
  3822. * @dev: the device which switched channels
  3823. * @chandef: the new channel definition
  3824. *
  3825. - * Acquires wdev_lock, so must only be called from sleepable driver context!
  3826. + * Caller must acquire wdev_lock, therefore must only be called from sleepable
  3827. + * driver context!
  3828. */
  3829. void cfg80211_ch_switch_notify(struct net_device *dev,
  3830. struct cfg80211_chan_def *chandef);
  3831. --- a/include/uapi/linux/nl80211.h
  3832. +++ b/include/uapi/linux/nl80211.h
  3833. @@ -1508,6 +1508,12 @@ enum nl80211_commands {
  3834. * to react to radar events, e.g. initiate a channel switch or leave the
  3835. * IBSS network.
  3836. *
  3837. + * @NL80211_ATTR_SUPPORT_5_MHZ: A flag indicating that the device supports
  3838. + * 5 MHz channel bandwidth.
  3839. + *
  3840. + * @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports
  3841. + * 10 MHz channel bandwidth.
  3842. + *
  3843. * @NL80211_ATTR_MAX: highest attribute number currently defined
  3844. * @__NL80211_ATTR_AFTER_LAST: internal use
  3845. */
  3846. @@ -1824,6 +1830,9 @@ enum nl80211_attrs {
  3847. NL80211_ATTR_HANDLE_DFS,
  3848. + NL80211_ATTR_SUPPORT_5_MHZ,
  3849. + NL80211_ATTR_SUPPORT_10_MHZ,
  3850. +
  3851. /* add attributes here, update the policy in nl80211.c */
  3852. __NL80211_ATTR_AFTER_LAST,
  3853. @@ -2224,10 +2233,9 @@ enum nl80211_band_attr {
  3854. * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
  3855. * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
  3856. * regulatory domain.
  3857. - * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is
  3858. - * permitted on this channel in current regulatory domain.
  3859. - * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted
  3860. - * on this channel in current regulatory domain.
  3861. + * @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation
  3862. + * are permitted on this channel, this includes sending probe
  3863. + * requests, or modes of operation that require beaconing.
  3864. * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
  3865. * on this channel in current regulatory domain.
  3866. * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
  3867. @@ -2254,8 +2262,8 @@ enum nl80211_frequency_attr {
  3868. __NL80211_FREQUENCY_ATTR_INVALID,
  3869. NL80211_FREQUENCY_ATTR_FREQ,
  3870. NL80211_FREQUENCY_ATTR_DISABLED,
  3871. - NL80211_FREQUENCY_ATTR_PASSIVE_SCAN,
  3872. - NL80211_FREQUENCY_ATTR_NO_IBSS,
  3873. + NL80211_FREQUENCY_ATTR_NO_IR,
  3874. + __NL80211_FREQUENCY_ATTR_NO_IBSS,
  3875. NL80211_FREQUENCY_ATTR_RADAR,
  3876. NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
  3877. NL80211_FREQUENCY_ATTR_DFS_STATE,
  3878. @@ -2271,6 +2279,9 @@ enum nl80211_frequency_attr {
  3879. };
  3880. #define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
  3881. +#define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR
  3882. +#define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR
  3883. +#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
  3884. /**
  3885. * enum nl80211_bitrate_attr - bitrate attributes
  3886. @@ -2413,8 +2424,9 @@ enum nl80211_sched_scan_match_attr {
  3887. * @NL80211_RRF_DFS: DFS support is required to be used
  3888. * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
  3889. * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
  3890. - * @NL80211_RRF_PASSIVE_SCAN: passive scan is required
  3891. - * @NL80211_RRF_NO_IBSS: no IBSS is allowed
  3892. + * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
  3893. + * this includes probe requests or modes of operation that require
  3894. + * beaconing.
  3895. */
  3896. enum nl80211_reg_rule_flags {
  3897. NL80211_RRF_NO_OFDM = 1<<0,
  3898. @@ -2424,10 +2436,17 @@ enum nl80211_reg_rule_flags {
  3899. NL80211_RRF_DFS = 1<<4,
  3900. NL80211_RRF_PTP_ONLY = 1<<5,
  3901. NL80211_RRF_PTMP_ONLY = 1<<6,
  3902. - NL80211_RRF_PASSIVE_SCAN = 1<<7,
  3903. - NL80211_RRF_NO_IBSS = 1<<8,
  3904. + NL80211_RRF_NO_IR = 1<<7,
  3905. + __NL80211_RRF_NO_IBSS = 1<<8,
  3906. };
  3907. +#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
  3908. +#define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR
  3909. +#define NL80211_RRF_NO_IR NL80211_RRF_NO_IR
  3910. +
  3911. +/* For backport compatibility with older userspace */
  3912. +#define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
  3913. +
  3914. /**
  3915. * enum nl80211_dfs_regions - regulatory DFS regions
  3916. *
  3917. --- a/net/mac80211/cfg.c
  3918. +++ b/net/mac80211/cfg.c
  3919. @@ -846,7 +846,7 @@ static int ieee80211_set_probe_resp(stru
  3920. if (!resp || !resp_len)
  3921. return 1;
  3922. - old = rtnl_dereference(sdata->u.ap.probe_resp);
  3923. + old = sdata_dereference(sdata->u.ap.probe_resp, sdata);
  3924. new = kzalloc(sizeof(struct probe_resp) + resp_len, GFP_KERNEL);
  3925. if (!new)
  3926. @@ -870,7 +870,8 @@ int ieee80211_assign_beacon(struct ieee8
  3927. int size, err;
  3928. u32 changed = BSS_CHANGED_BEACON;
  3929. - old = rtnl_dereference(sdata->u.ap.beacon);
  3930. + old = sdata_dereference(sdata->u.ap.beacon, sdata);
  3931. +
  3932. /* Need to have a beacon head if we don't have one yet */
  3933. if (!params->head && !old)
  3934. @@ -947,7 +948,7 @@ static int ieee80211_start_ap(struct wip
  3935. BSS_CHANGED_P2P_PS;
  3936. int err;
  3937. - old = rtnl_dereference(sdata->u.ap.beacon);
  3938. + old = sdata_dereference(sdata->u.ap.beacon, sdata);
  3939. if (old)
  3940. return -EALREADY;
  3941. @@ -1001,7 +1002,8 @@ static int ieee80211_start_ap(struct wip
  3942. err = drv_start_ap(sdata->local, sdata);
  3943. if (err) {
  3944. - old = rtnl_dereference(sdata->u.ap.beacon);
  3945. + old = sdata_dereference(sdata->u.ap.beacon, sdata);
  3946. +
  3947. if (old)
  3948. kfree_rcu(old, rcu_head);
  3949. RCU_INIT_POINTER(sdata->u.ap.beacon, NULL);
  3950. @@ -1032,7 +1034,7 @@ static int ieee80211_change_beacon(struc
  3951. if (sdata->vif.csa_active)
  3952. return -EBUSY;
  3953. - old = rtnl_dereference(sdata->u.ap.beacon);
  3954. + old = sdata_dereference(sdata->u.ap.beacon, sdata);
  3955. if (!old)
  3956. return -ENOENT;
  3957. @@ -1050,15 +1052,18 @@ static int ieee80211_stop_ap(struct wiph
  3958. struct ieee80211_local *local = sdata->local;
  3959. struct beacon_data *old_beacon;
  3960. struct probe_resp *old_probe_resp;
  3961. + struct cfg80211_chan_def chandef;
  3962. - old_beacon = rtnl_dereference(sdata->u.ap.beacon);
  3963. + old_beacon = sdata_dereference(sdata->u.ap.beacon, sdata);
  3964. if (!old_beacon)
  3965. return -ENOENT;
  3966. - old_probe_resp = rtnl_dereference(sdata->u.ap.probe_resp);
  3967. + old_probe_resp = sdata_dereference(sdata->u.ap.probe_resp, sdata);
  3968. /* abort any running channel switch */
  3969. sdata->vif.csa_active = false;
  3970. - cancel_work_sync(&sdata->csa_finalize_work);
  3971. + kfree(sdata->u.ap.next_beacon);
  3972. + sdata->u.ap.next_beacon = NULL;
  3973. +
  3974. cancel_work_sync(&sdata->u.ap.request_smps_work);
  3975. /* turn off carrier for this interface and dependent VLANs */
  3976. @@ -1091,8 +1096,10 @@ static int ieee80211_stop_ap(struct wiph
  3977. ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED);
  3978. if (sdata->wdev.cac_started) {
  3979. + chandef = sdata->vif.bss_conf.chandef;
  3980. cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
  3981. - cfg80211_cac_event(sdata->dev, NL80211_RADAR_CAC_ABORTED,
  3982. + cfg80211_cac_event(sdata->dev, &chandef,
  3983. + NL80211_RADAR_CAC_ABORTED,
  3984. GFP_KERNEL);
  3985. }
  3986. @@ -1368,7 +1375,7 @@ static int sta_apply_parameters(struct i
  3987. changed |=
  3988. ieee80211_mps_set_sta_local_pm(sta,
  3989. params->local_pm);
  3990. - ieee80211_bss_info_change_notify(sdata, changed);
  3991. + ieee80211_mbss_info_change_notify(sdata, changed);
  3992. #endif
  3993. }
  3994. @@ -1953,7 +1960,7 @@ static int ieee80211_change_bss(struct w
  3995. enum ieee80211_band band;
  3996. u32 changed = 0;
  3997. - if (!rtnl_dereference(sdata->u.ap.beacon))
  3998. + if (!sdata_dereference(sdata->u.ap.beacon, sdata))
  3999. return -ENOENT;
  4000. band = ieee80211_get_sdata_band(sdata);
  4001. @@ -2964,27 +2971,33 @@ void ieee80211_csa_finalize_work(struct
  4002. struct ieee80211_local *local = sdata->local;
  4003. int err, changed = 0;
  4004. + sdata_lock(sdata);
  4005. + /* AP might have been stopped while waiting for the lock. */
  4006. + if (!sdata->vif.csa_active)
  4007. + goto unlock;
  4008. +
  4009. if (!ieee80211_sdata_running(sdata))
  4010. - return;
  4011. + goto unlock;
  4012. sdata->radar_required = sdata->csa_radar_required;
  4013. - err = ieee80211_vif_change_channel(sdata, &local->csa_chandef,
  4014. - &changed);
  4015. + err = ieee80211_vif_change_channel(sdata, &changed);
  4016. if (WARN_ON(err < 0))
  4017. - return;
  4018. + goto unlock;
  4019. if (!local->use_chanctx) {
  4020. - local->_oper_chandef = local->csa_chandef;
  4021. + local->_oper_chandef = sdata->csa_chandef;
  4022. ieee80211_hw_config(local, 0);
  4023. }
  4024. ieee80211_bss_info_change_notify(sdata, changed);
  4025. + sdata->vif.csa_active = false;
  4026. switch (sdata->vif.type) {
  4027. case NL80211_IFTYPE_AP:
  4028. err = ieee80211_assign_beacon(sdata, sdata->u.ap.next_beacon);
  4029. if (err < 0)
  4030. - return;
  4031. + goto unlock;
  4032. +
  4033. changed |= err;
  4034. kfree(sdata->u.ap.next_beacon);
  4035. sdata->u.ap.next_beacon = NULL;
  4036. @@ -2998,20 +3011,22 @@ void ieee80211_csa_finalize_work(struct
  4037. case NL80211_IFTYPE_MESH_POINT:
  4038. err = ieee80211_mesh_finish_csa(sdata);
  4039. if (err < 0)
  4040. - return;
  4041. + goto unlock;
  4042. break;
  4043. #endif
  4044. default:
  4045. WARN_ON(1);
  4046. - return;
  4047. + goto unlock;
  4048. }
  4049. - sdata->vif.csa_active = false;
  4050. ieee80211_wake_queues_by_reason(&sdata->local->hw,
  4051. IEEE80211_MAX_QUEUE_MAP,
  4052. IEEE80211_QUEUE_STOP_REASON_CSA);
  4053. - cfg80211_ch_switch_notify(sdata->dev, &local->csa_chandef);
  4054. + cfg80211_ch_switch_notify(sdata->dev, &sdata->csa_chandef);
  4055. +
  4056. +unlock:
  4057. + sdata_unlock(sdata);
  4058. }
  4059. static int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
  4060. @@ -3024,6 +3039,8 @@ static int ieee80211_channel_switch(stru
  4061. struct ieee80211_if_mesh __maybe_unused *ifmsh;
  4062. int err, num_chanctx;
  4063. + lockdep_assert_held(&sdata->wdev.mtx);
  4064. +
  4065. if (!list_empty(&local->roc_list) || local->scanning)
  4066. return -EBUSY;
  4067. @@ -3120,9 +3137,17 @@ static int ieee80211_channel_switch(stru
  4068. params->chandef.chan->band)
  4069. return -EINVAL;
  4070. + ifmsh->chsw_init = true;
  4071. + if (!ifmsh->pre_value)
  4072. + ifmsh->pre_value = 1;
  4073. + else
  4074. + ifmsh->pre_value++;
  4075. +
  4076. err = ieee80211_mesh_csa_beacon(sdata, params, true);
  4077. - if (err < 0)
  4078. + if (err < 0) {
  4079. + ifmsh->chsw_init = false;
  4080. return err;
  4081. + }
  4082. break;
  4083. #endif
  4084. default:
  4085. @@ -3136,7 +3161,7 @@ static int ieee80211_channel_switch(stru
  4086. IEEE80211_MAX_QUEUE_MAP,
  4087. IEEE80211_QUEUE_STOP_REASON_CSA);
  4088. - local->csa_chandef = params->chandef;
  4089. + sdata->csa_chandef = params->chandef;
  4090. sdata->vif.csa_active = true;
  4091. ieee80211_bss_info_change_notify(sdata, err);
  4092. --- a/net/mac80211/iface.c
  4093. +++ b/net/mac80211/iface.c
  4094. @@ -749,6 +749,7 @@ static void ieee80211_do_stop(struct iee
  4095. u32 hw_reconf_flags = 0;
  4096. int i, flushed;
  4097. struct ps_data *ps;
  4098. + struct cfg80211_chan_def chandef;
  4099. clear_bit(SDATA_STATE_RUNNING, &sdata->state);
  4100. @@ -828,11 +829,13 @@ static void ieee80211_do_stop(struct iee
  4101. cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
  4102. if (sdata->wdev.cac_started) {
  4103. + chandef = sdata->vif.bss_conf.chandef;
  4104. WARN_ON(local->suspended);
  4105. mutex_lock(&local->iflist_mtx);
  4106. ieee80211_vif_release_channel(sdata);
  4107. mutex_unlock(&local->iflist_mtx);
  4108. - cfg80211_cac_event(sdata->dev, NL80211_RADAR_CAC_ABORTED,
  4109. + cfg80211_cac_event(sdata->dev, &chandef,
  4110. + NL80211_RADAR_CAC_ABORTED,
  4111. GFP_KERNEL);
  4112. }
  4113. @@ -1340,7 +1343,6 @@ static void ieee80211_setup_sdata(struct
  4114. sdata->vif.bss_conf.bssid = NULL;
  4115. break;
  4116. case NL80211_IFTYPE_AP_VLAN:
  4117. - break;
  4118. case NL80211_IFTYPE_P2P_DEVICE:
  4119. sdata->vif.bss_conf.bssid = sdata->vif.addr;
  4120. break;
  4121. --- a/net/mac80211/mlme.c
  4122. +++ b/net/mac80211/mlme.c
  4123. @@ -886,8 +886,7 @@ static void ieee80211_chswitch_work(stru
  4124. if (!ifmgd->associated)
  4125. goto out;
  4126. - ret = ieee80211_vif_change_channel(sdata, &local->csa_chandef,
  4127. - &changed);
  4128. + ret = ieee80211_vif_change_channel(sdata, &changed);
  4129. if (ret) {
  4130. sdata_info(sdata,
  4131. "vif channel switch failed, disconnecting\n");
  4132. @@ -897,7 +896,7 @@ static void ieee80211_chswitch_work(stru
  4133. }
  4134. if (!local->use_chanctx) {
  4135. - local->_oper_chandef = local->csa_chandef;
  4136. + local->_oper_chandef = sdata->csa_chandef;
  4137. /* Call "hw_config" only if doing sw channel switch.
  4138. * Otherwise update the channel directly
  4139. */
  4140. @@ -908,7 +907,7 @@ static void ieee80211_chswitch_work(stru
  4141. }
  4142. /* XXX: shouldn't really modify cfg80211-owned data! */
  4143. - ifmgd->associated->channel = local->csa_chandef.chan;
  4144. + ifmgd->associated->channel = sdata->csa_chandef.chan;
  4145. /* XXX: wait for a beacon first? */
  4146. ieee80211_wake_queues_by_reason(&local->hw,
  4147. @@ -1035,7 +1034,7 @@ ieee80211_sta_process_chanswitch(struct
  4148. }
  4149. mutex_unlock(&local->chanctx_mtx);
  4150. - local->csa_chandef = csa_ie.chandef;
  4151. + sdata->csa_chandef = csa_ie.chandef;
  4152. if (csa_ie.mode)
  4153. ieee80211_stop_queues_by_reason(&local->hw,
  4154. @@ -1398,10 +1397,12 @@ void ieee80211_dfs_cac_timer_work(struct
  4155. struct ieee80211_sub_if_data *sdata =
  4156. container_of(delayed_work, struct ieee80211_sub_if_data,
  4157. dfs_cac_timer_work);
  4158. + struct cfg80211_chan_def chandef = sdata->vif.bss_conf.chandef;
  4159. ieee80211_vif_release_channel(sdata);
  4160. -
  4161. - cfg80211_cac_event(sdata->dev, NL80211_RADAR_CAC_FINISHED, GFP_KERNEL);
  4162. + cfg80211_cac_event(sdata->dev, &chandef,
  4163. + NL80211_RADAR_CAC_FINISHED,
  4164. + GFP_KERNEL);
  4165. }
  4166. /* MLME */
  4167. --- a/net/mac80211/rx.c
  4168. +++ b/net/mac80211/rx.c
  4169. @@ -729,9 +729,7 @@ static void ieee80211_release_reorder_fr
  4170. lockdep_assert_held(&tid_agg_rx->reorder_lock);
  4171. while (ieee80211_sn_less(tid_agg_rx->head_seq_num, head_seq_num)) {
  4172. - index = ieee80211_sn_sub(tid_agg_rx->head_seq_num,
  4173. - tid_agg_rx->ssn) %
  4174. - tid_agg_rx->buf_size;
  4175. + index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
  4176. ieee80211_release_reorder_frame(sdata, tid_agg_rx, index,
  4177. frames);
  4178. }
  4179. @@ -757,8 +755,7 @@ static void ieee80211_sta_reorder_releas
  4180. lockdep_assert_held(&tid_agg_rx->reorder_lock);
  4181. /* release the buffer until next missing frame */
  4182. - index = ieee80211_sn_sub(tid_agg_rx->head_seq_num,
  4183. - tid_agg_rx->ssn) % tid_agg_rx->buf_size;
  4184. + index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
  4185. if (!tid_agg_rx->reorder_buf[index] &&
  4186. tid_agg_rx->stored_mpdu_num) {
  4187. /*
  4188. @@ -793,15 +790,11 @@ static void ieee80211_sta_reorder_releas
  4189. } else while (tid_agg_rx->reorder_buf[index]) {
  4190. ieee80211_release_reorder_frame(sdata, tid_agg_rx, index,
  4191. frames);
  4192. - index = ieee80211_sn_sub(tid_agg_rx->head_seq_num,
  4193. - tid_agg_rx->ssn) %
  4194. - tid_agg_rx->buf_size;
  4195. + index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
  4196. }
  4197. if (tid_agg_rx->stored_mpdu_num) {
  4198. - j = index = ieee80211_sn_sub(tid_agg_rx->head_seq_num,
  4199. - tid_agg_rx->ssn) %
  4200. - tid_agg_rx->buf_size;
  4201. + j = index = tid_agg_rx->head_seq_num % tid_agg_rx->buf_size;
  4202. for (; j != (index - 1) % tid_agg_rx->buf_size;
  4203. j = (j + 1) % tid_agg_rx->buf_size) {
  4204. @@ -861,8 +854,7 @@ static bool ieee80211_sta_manage_reorder
  4205. /* Now the new frame is always in the range of the reordering buffer */
  4206. - index = ieee80211_sn_sub(mpdu_seq_num,
  4207. - tid_agg_rx->ssn) % tid_agg_rx->buf_size;
  4208. + index = mpdu_seq_num % tid_agg_rx->buf_size;
  4209. /* check if we already stored this frame */
  4210. if (tid_agg_rx->reorder_buf[index]) {
  4211. @@ -911,7 +903,8 @@ static void ieee80211_rx_reorder_ampdu(s
  4212. u16 sc;
  4213. u8 tid, ack_policy;
  4214. - if (!ieee80211_is_data_qos(hdr->frame_control))
  4215. + if (!ieee80211_is_data_qos(hdr->frame_control) ||
  4216. + is_multicast_ether_addr(hdr->addr1))
  4217. goto dont_reorder;
  4218. /*
  4219. --- a/net/mac80211/scan.c
  4220. +++ b/net/mac80211/scan.c
  4221. @@ -526,7 +526,7 @@ static int __ieee80211_start_scan(struct
  4222. ieee80211_hw_config(local, 0);
  4223. if ((req->channels[0]->flags &
  4224. - IEEE80211_CHAN_PASSIVE_SCAN) ||
  4225. + IEEE80211_CHAN_NO_IR) ||
  4226. !local->scan_req->n_ssids) {
  4227. next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
  4228. } else {
  4229. @@ -572,7 +572,7 @@ ieee80211_scan_get_channel_time(struct i
  4230. * TODO: channel switching also consumes quite some time,
  4231. * add that delay as well to get a better estimation
  4232. */
  4233. - if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN)
  4234. + if (chan->flags & IEEE80211_CHAN_NO_IR)
  4235. return IEEE80211_PASSIVE_CHANNEL_TIME;
  4236. return IEEE80211_PROBE_DELAY + IEEE80211_CHANNEL_TIME;
  4237. }
  4238. @@ -696,7 +696,7 @@ static void ieee80211_scan_state_set_cha
  4239. *
  4240. * In any case, it is not necessary for a passive scan.
  4241. */
  4242. - if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
  4243. + if (chan->flags & IEEE80211_CHAN_NO_IR ||
  4244. !local->scan_req->n_ssids) {
  4245. *next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
  4246. local->next_scan_state = SCAN_DECISION;
  4247. @@ -881,7 +881,7 @@ int ieee80211_request_ibss_scan(struct i
  4248. struct ieee80211_channel *tmp_ch =
  4249. &local->hw.wiphy->bands[band]->channels[i];
  4250. - if (tmp_ch->flags & (IEEE80211_CHAN_NO_IBSS |
  4251. + if (tmp_ch->flags & (IEEE80211_CHAN_NO_IR |
  4252. IEEE80211_CHAN_DISABLED))
  4253. continue;
  4254. @@ -895,7 +895,7 @@ int ieee80211_request_ibss_scan(struct i
  4255. local->int_scan_req->n_channels = n_ch;
  4256. } else {
  4257. - if (WARN_ON_ONCE(chan->flags & (IEEE80211_CHAN_NO_IBSS |
  4258. + if (WARN_ON_ONCE(chan->flags & (IEEE80211_CHAN_NO_IR |
  4259. IEEE80211_CHAN_DISABLED)))
  4260. goto unlock;
  4261. --- a/net/mac80211/tx.c
  4262. +++ b/net/mac80211/tx.c
  4263. @@ -463,7 +463,6 @@ ieee80211_tx_h_unicast_ps_buf(struct iee
  4264. {
  4265. struct sta_info *sta = tx->sta;
  4266. struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
  4267. - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;
  4268. struct ieee80211_local *local = tx->local;
  4269. if (unlikely(!sta))
  4270. @@ -474,15 +473,6 @@ ieee80211_tx_h_unicast_ps_buf(struct iee
  4271. !(info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER))) {
  4272. int ac = skb_get_queue_mapping(tx->skb);
  4273. - /* only deauth, disassoc and action are bufferable MMPDUs */
  4274. - if (ieee80211_is_mgmt(hdr->frame_control) &&
  4275. - !ieee80211_is_deauth(hdr->frame_control) &&
  4276. - !ieee80211_is_disassoc(hdr->frame_control) &&
  4277. - !ieee80211_is_action(hdr->frame_control)) {
  4278. - info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER;
  4279. - return TX_CONTINUE;
  4280. - }
  4281. -
  4282. ps_dbg(sta->sdata, "STA %pM aid %d: PS buffer for AC %d\n",
  4283. sta->sta.addr, sta->sta.aid, ac);
  4284. if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER)
  4285. @@ -525,9 +515,21 @@ ieee80211_tx_h_unicast_ps_buf(struct iee
  4286. static ieee80211_tx_result debug_noinline
  4287. ieee80211_tx_h_ps_buf(struct ieee80211_tx_data *tx)
  4288. {
  4289. + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
  4290. + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;
  4291. +
  4292. if (unlikely(tx->flags & IEEE80211_TX_PS_BUFFERED))
  4293. return TX_CONTINUE;
  4294. + /* only deauth, disassoc and action are bufferable MMPDUs */
  4295. + if (ieee80211_is_mgmt(hdr->frame_control) &&
  4296. + !ieee80211_is_deauth(hdr->frame_control) &&
  4297. + !ieee80211_is_disassoc(hdr->frame_control) &&
  4298. + !ieee80211_is_action(hdr->frame_control)) {
  4299. + info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER;
  4300. + return TX_CONTINUE;
  4301. + }
  4302. +
  4303. if (tx->flags & IEEE80211_TX_UNICAST)
  4304. return ieee80211_tx_h_unicast_ps_buf(tx);
  4305. else
  4306. @@ -1728,8 +1730,7 @@ netdev_tx_t ieee80211_monitor_start_xmit
  4307. * radar detection by itself. We can do that later by adding a
  4308. * monitor flag interfaces used for AP support.
  4309. */
  4310. - if ((chan->flags & (IEEE80211_CHAN_NO_IBSS | IEEE80211_CHAN_RADAR |
  4311. - IEEE80211_CHAN_PASSIVE_SCAN)))
  4312. + if ((chan->flags & (IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_RADAR)))
  4313. goto fail_rcu;
  4314. ieee80211_xmit(sdata, skb, chan->band);
  4315. --- a/net/mac80211/util.c
  4316. +++ b/net/mac80211/util.c
  4317. @@ -2259,14 +2259,17 @@ u64 ieee80211_calculate_rx_timestamp(str
  4318. void ieee80211_dfs_cac_cancel(struct ieee80211_local *local)
  4319. {
  4320. struct ieee80211_sub_if_data *sdata;
  4321. + struct cfg80211_chan_def chandef;
  4322. mutex_lock(&local->iflist_mtx);
  4323. list_for_each_entry(sdata, &local->interfaces, list) {
  4324. cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
  4325. if (sdata->wdev.cac_started) {
  4326. + chandef = sdata->vif.bss_conf.chandef;
  4327. ieee80211_vif_release_channel(sdata);
  4328. cfg80211_cac_event(sdata->dev,
  4329. + &chandef,
  4330. NL80211_RADAR_CAC_ABORTED,
  4331. GFP_KERNEL);
  4332. }
  4333. @@ -2459,14 +2462,9 @@ int ieee80211_send_action_csa(struct iee
  4334. WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT : 0x00;
  4335. put_unaligned_le16(WLAN_REASON_MESH_CHAN, pos); /* Reason Cd */
  4336. pos += 2;
  4337. - if (!ifmsh->pre_value)
  4338. - ifmsh->pre_value = 1;
  4339. - else
  4340. - ifmsh->pre_value++;
  4341. pre_value = cpu_to_le16(ifmsh->pre_value);
  4342. memcpy(pos, &pre_value, 2); /* Precedence Value */
  4343. pos += 2;
  4344. - ifmsh->chsw_init = true;
  4345. }
  4346. ieee80211_tx_skb(sdata, skb);
  4347. --- a/net/wireless/chan.c
  4348. +++ b/net/wireless/chan.c
  4349. @@ -277,6 +277,32 @@ void cfg80211_set_dfs_state(struct wiphy
  4350. width, dfs_state);
  4351. }
  4352. +static u32 cfg80211_get_start_freq(u32 center_freq,
  4353. + u32 bandwidth)
  4354. +{
  4355. + u32 start_freq;
  4356. +
  4357. + if (bandwidth <= 20)
  4358. + start_freq = center_freq;
  4359. + else
  4360. + start_freq = center_freq - bandwidth/2 + 10;
  4361. +
  4362. + return start_freq;
  4363. +}
  4364. +
  4365. +static u32 cfg80211_get_end_freq(u32 center_freq,
  4366. + u32 bandwidth)
  4367. +{
  4368. + u32 end_freq;
  4369. +
  4370. + if (bandwidth <= 20)
  4371. + end_freq = center_freq;
  4372. + else
  4373. + end_freq = center_freq + bandwidth/2 - 10;
  4374. +
  4375. + return end_freq;
  4376. +}
  4377. +
  4378. static int cfg80211_get_chans_dfs_required(struct wiphy *wiphy,
  4379. u32 center_freq,
  4380. u32 bandwidth)
  4381. @@ -284,13 +310,8 @@ static int cfg80211_get_chans_dfs_requir
  4382. struct ieee80211_channel *c;
  4383. u32 freq, start_freq, end_freq;
  4384. - if (bandwidth <= 20) {
  4385. - start_freq = center_freq;
  4386. - end_freq = center_freq;
  4387. - } else {
  4388. - start_freq = center_freq - bandwidth/2 + 10;
  4389. - end_freq = center_freq + bandwidth/2 - 10;
  4390. - }
  4391. + start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
  4392. + end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
  4393. for (freq = start_freq; freq <= end_freq; freq += 20) {
  4394. c = ieee80211_get_channel(wiphy, freq);
  4395. @@ -330,33 +351,159 @@ int cfg80211_chandef_dfs_required(struct
  4396. }
  4397. EXPORT_SYMBOL(cfg80211_chandef_dfs_required);
  4398. -static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
  4399. - u32 center_freq, u32 bandwidth,
  4400. - u32 prohibited_flags)
  4401. +static int cfg80211_get_chans_dfs_usable(struct wiphy *wiphy,
  4402. + u32 center_freq,
  4403. + u32 bandwidth)
  4404. {
  4405. struct ieee80211_channel *c;
  4406. u32 freq, start_freq, end_freq;
  4407. + int count = 0;
  4408. - if (bandwidth <= 20) {
  4409. - start_freq = center_freq;
  4410. - end_freq = center_freq;
  4411. - } else {
  4412. - start_freq = center_freq - bandwidth/2 + 10;
  4413. - end_freq = center_freq + bandwidth/2 - 10;
  4414. + start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
  4415. + end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
  4416. +
  4417. + /*
  4418. + * Check entire range of channels for the bandwidth.
  4419. + * Check all channels are DFS channels (DFS_USABLE or
  4420. + * DFS_AVAILABLE). Return number of usable channels
  4421. + * (require CAC). Allow DFS and non-DFS channel mix.
  4422. + */
  4423. + for (freq = start_freq; freq <= end_freq; freq += 20) {
  4424. + c = ieee80211_get_channel(wiphy, freq);
  4425. + if (!c)
  4426. + return -EINVAL;
  4427. +
  4428. + if (c->flags & IEEE80211_CHAN_DISABLED)
  4429. + return -EINVAL;
  4430. +
  4431. + if (c->flags & IEEE80211_CHAN_RADAR) {
  4432. + if (c->dfs_state == NL80211_DFS_UNAVAILABLE)
  4433. + return -EINVAL;
  4434. +
  4435. + if (c->dfs_state == NL80211_DFS_USABLE)
  4436. + count++;
  4437. + }
  4438. + }
  4439. +
  4440. + return count;
  4441. +}
  4442. +
  4443. +bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy,
  4444. + const struct cfg80211_chan_def *chandef)
  4445. +{
  4446. + int width;
  4447. + int r1, r2 = 0;
  4448. +
  4449. + if (WARN_ON(!cfg80211_chandef_valid(chandef)))
  4450. + return false;
  4451. +
  4452. + width = cfg80211_chandef_get_width(chandef);
  4453. + if (width < 0)
  4454. + return false;
  4455. +
  4456. + r1 = cfg80211_get_chans_dfs_usable(wiphy, chandef->center_freq1,
  4457. + width);
  4458. +
  4459. + if (r1 < 0)
  4460. + return false;
  4461. +
  4462. + switch (chandef->width) {
  4463. + case NL80211_CHAN_WIDTH_80P80:
  4464. + WARN_ON(!chandef->center_freq2);
  4465. + r2 = cfg80211_get_chans_dfs_usable(wiphy,
  4466. + chandef->center_freq2,
  4467. + width);
  4468. + if (r2 < 0)
  4469. + return false;
  4470. + break;
  4471. + default:
  4472. + WARN_ON(chandef->center_freq2);
  4473. + break;
  4474. }
  4475. + return (r1 + r2 > 0);
  4476. +}
  4477. +
  4478. +
  4479. +static bool cfg80211_get_chans_dfs_available(struct wiphy *wiphy,
  4480. + u32 center_freq,
  4481. + u32 bandwidth)
  4482. +{
  4483. + struct ieee80211_channel *c;
  4484. + u32 freq, start_freq, end_freq;
  4485. +
  4486. + start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
  4487. + end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
  4488. +
  4489. + /*
  4490. + * Check entire range of channels for the bandwidth.
  4491. + * If any channel in between is disabled or has not
  4492. + * had gone through CAC return false
  4493. + */
  4494. for (freq = start_freq; freq <= end_freq; freq += 20) {
  4495. c = ieee80211_get_channel(wiphy, freq);
  4496. if (!c)
  4497. return false;
  4498. - /* check for radar flags */
  4499. - if ((prohibited_flags & c->flags & IEEE80211_CHAN_RADAR) &&
  4500. + if (c->flags & IEEE80211_CHAN_DISABLED)
  4501. + return false;
  4502. +
  4503. + if ((c->flags & IEEE80211_CHAN_RADAR) &&
  4504. (c->dfs_state != NL80211_DFS_AVAILABLE))
  4505. return false;
  4506. + }
  4507. +
  4508. + return true;
  4509. +}
  4510. +
  4511. +static bool cfg80211_chandef_dfs_available(struct wiphy *wiphy,
  4512. + const struct cfg80211_chan_def *chandef)
  4513. +{
  4514. + int width;
  4515. + int r;
  4516. +
  4517. + if (WARN_ON(!cfg80211_chandef_valid(chandef)))
  4518. + return false;
  4519. - /* check for the other flags */
  4520. - if (c->flags & prohibited_flags & ~IEEE80211_CHAN_RADAR)
  4521. + width = cfg80211_chandef_get_width(chandef);
  4522. + if (width < 0)
  4523. + return false;
  4524. +
  4525. + r = cfg80211_get_chans_dfs_available(wiphy, chandef->center_freq1,
  4526. + width);
  4527. +
  4528. + /* If any of channels unavailable for cf1 just return */
  4529. + if (!r)
  4530. + return r;
  4531. +
  4532. + switch (chandef->width) {
  4533. + case NL80211_CHAN_WIDTH_80P80:
  4534. + WARN_ON(!chandef->center_freq2);
  4535. + r = cfg80211_get_chans_dfs_available(wiphy,
  4536. + chandef->center_freq2,
  4537. + width);
  4538. + default:
  4539. + WARN_ON(chandef->center_freq2);
  4540. + break;
  4541. + }
  4542. +
  4543. + return r;
  4544. +}
  4545. +
  4546. +
  4547. +static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
  4548. + u32 center_freq, u32 bandwidth,
  4549. + u32 prohibited_flags)
  4550. +{
  4551. + struct ieee80211_channel *c;
  4552. + u32 freq, start_freq, end_freq;
  4553. +
  4554. + start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
  4555. + end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
  4556. +
  4557. + for (freq = start_freq; freq <= end_freq; freq += 20) {
  4558. + c = ieee80211_get_channel(wiphy, freq);
  4559. + if (!c || c->flags & prohibited_flags)
  4560. return false;
  4561. }
  4562. @@ -462,14 +609,19 @@ bool cfg80211_reg_can_beacon(struct wiph
  4563. struct cfg80211_chan_def *chandef)
  4564. {
  4565. bool res;
  4566. + u32 prohibited_flags = IEEE80211_CHAN_DISABLED |
  4567. + IEEE80211_CHAN_NO_IR |
  4568. + IEEE80211_CHAN_RADAR;
  4569. trace_cfg80211_reg_can_beacon(wiphy, chandef);
  4570. - res = cfg80211_chandef_usable(wiphy, chandef,
  4571. - IEEE80211_CHAN_DISABLED |
  4572. - IEEE80211_CHAN_PASSIVE_SCAN |
  4573. - IEEE80211_CHAN_NO_IBSS |
  4574. - IEEE80211_CHAN_RADAR);
  4575. + if (cfg80211_chandef_dfs_required(wiphy, chandef) > 0 &&
  4576. + cfg80211_chandef_dfs_available(wiphy, chandef)) {
  4577. + /* We can skip IEEE80211_CHAN_NO_IR if chandef dfs available */
  4578. + prohibited_flags = IEEE80211_CHAN_DISABLED;
  4579. + }
  4580. +
  4581. + res = cfg80211_chandef_usable(wiphy, chandef, prohibited_flags);
  4582. trace_cfg80211_return_bool(res);
  4583. return res;
  4584. --- a/net/wireless/core.h
  4585. +++ b/net/wireless/core.h
  4586. @@ -382,6 +382,19 @@ int cfg80211_can_use_iftype_chan(struct
  4587. enum cfg80211_chan_mode chanmode,
  4588. u8 radar_detect);
  4589. +/**
  4590. + * cfg80211_chandef_dfs_usable - checks if chandef is DFS usable
  4591. + * @wiphy: the wiphy to validate against
  4592. + * @chandef: the channel definition to check
  4593. + *
  4594. + * Checks if chandef is usable and we can/need start CAC on such channel.
  4595. + *
  4596. + * Return: Return true if all channels available and at least
  4597. + * one channel require CAC (NL80211_DFS_USABLE)
  4598. + */
  4599. +bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy,
  4600. + const struct cfg80211_chan_def *chandef);
  4601. +
  4602. void cfg80211_set_dfs_state(struct wiphy *wiphy,
  4603. const struct cfg80211_chan_def *chandef,
  4604. enum nl80211_dfs_state dfs_state);
  4605. --- a/net/wireless/genregdb.awk
  4606. +++ b/net/wireless/genregdb.awk
  4607. @@ -107,10 +107,13 @@ active && /^[ \t]*\(/ {
  4608. } else if (flagarray[arg] == "PTMP-ONLY") {
  4609. flags = flags "\n\t\t\tNL80211_RRF_PTMP_ONLY | "
  4610. } else if (flagarray[arg] == "PASSIVE-SCAN") {
  4611. - flags = flags "\n\t\t\tNL80211_RRF_PASSIVE_SCAN | "
  4612. + flags = flags "\n\t\t\tNL80211_RRF_NO_IR | "
  4613. } else if (flagarray[arg] == "NO-IBSS") {
  4614. - flags = flags "\n\t\t\tNL80211_RRF_NO_IBSS | "
  4615. + flags = flags "\n\t\t\tNL80211_RRF_NO_IR | "
  4616. + } else if (flagarray[arg] == "NO-IR") {
  4617. + flags = flags "\n\t\t\tNL80211_RRF_NO_IR | "
  4618. }
  4619. +
  4620. }
  4621. flags = flags "0"
  4622. printf "\t\tREG_RULE(%d, %d, %d, %d, %d, %s),\n", start, end, bw, gain, power, flags
  4623. --- a/net/wireless/ibss.c
  4624. +++ b/net/wireless/ibss.c
  4625. @@ -274,7 +274,7 @@ int cfg80211_ibss_wext_join(struct cfg80
  4626. for (i = 0; i < sband->n_channels; i++) {
  4627. chan = &sband->channels[i];
  4628. - if (chan->flags & IEEE80211_CHAN_NO_IBSS)
  4629. + if (chan->flags & IEEE80211_CHAN_NO_IR)
  4630. continue;
  4631. if (chan->flags & IEEE80211_CHAN_DISABLED)
  4632. continue;
  4633. @@ -345,7 +345,7 @@ int cfg80211_ibss_wext_siwfreq(struct ne
  4634. chan = ieee80211_get_channel(wdev->wiphy, freq);
  4635. if (!chan)
  4636. return -EINVAL;
  4637. - if (chan->flags & IEEE80211_CHAN_NO_IBSS ||
  4638. + if (chan->flags & IEEE80211_CHAN_NO_IR ||
  4639. chan->flags & IEEE80211_CHAN_DISABLED)
  4640. return -EINVAL;
  4641. }
  4642. --- a/net/wireless/mesh.c
  4643. +++ b/net/wireless/mesh.c
  4644. @@ -141,8 +141,7 @@ int __cfg80211_join_mesh(struct cfg80211
  4645. for (i = 0; i < sband->n_channels; i++) {
  4646. chan = &sband->channels[i];
  4647. - if (chan->flags & (IEEE80211_CHAN_NO_IBSS |
  4648. - IEEE80211_CHAN_PASSIVE_SCAN |
  4649. + if (chan->flags & (IEEE80211_CHAN_NO_IR |
  4650. IEEE80211_CHAN_DISABLED |
  4651. IEEE80211_CHAN_RADAR))
  4652. continue;
  4653. --- a/net/wireless/mlme.c
  4654. +++ b/net/wireless/mlme.c
  4655. @@ -763,12 +763,12 @@ void cfg80211_radar_event(struct wiphy *
  4656. EXPORT_SYMBOL(cfg80211_radar_event);
  4657. void cfg80211_cac_event(struct net_device *netdev,
  4658. + const struct cfg80211_chan_def *chandef,
  4659. enum nl80211_radar_event event, gfp_t gfp)
  4660. {
  4661. struct wireless_dev *wdev = netdev->ieee80211_ptr;
  4662. struct wiphy *wiphy = wdev->wiphy;
  4663. struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
  4664. - struct cfg80211_chan_def chandef;
  4665. unsigned long timeout;
  4666. trace_cfg80211_cac_event(netdev, event);
  4667. @@ -779,14 +779,12 @@ void cfg80211_cac_event(struct net_devic
  4668. if (WARN_ON(!wdev->channel))
  4669. return;
  4670. - cfg80211_chandef_create(&chandef, wdev->channel, NL80211_CHAN_NO_HT);
  4671. -
  4672. switch (event) {
  4673. case NL80211_RADAR_CAC_FINISHED:
  4674. timeout = wdev->cac_start_time +
  4675. msecs_to_jiffies(IEEE80211_DFS_MIN_CAC_TIME_MS);
  4676. WARN_ON(!time_after_eq(jiffies, timeout));
  4677. - cfg80211_set_dfs_state(wiphy, &chandef, NL80211_DFS_AVAILABLE);
  4678. + cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_AVAILABLE);
  4679. break;
  4680. case NL80211_RADAR_CAC_ABORTED:
  4681. break;
  4682. @@ -796,6 +794,6 @@ void cfg80211_cac_event(struct net_devic
  4683. }
  4684. wdev->cac_started = false;
  4685. - nl80211_radar_notify(rdev, &chandef, event, netdev, gfp);
  4686. + nl80211_radar_notify(rdev, chandef, event, netdev, gfp);
  4687. }
  4688. EXPORT_SYMBOL(cfg80211_cac_event);
  4689. --- a/net/wireless/nl80211.c
  4690. +++ b/net/wireless/nl80211.c
  4691. @@ -545,12 +545,12 @@ static int nl80211_msg_put_channel(struc
  4692. if ((chan->flags & IEEE80211_CHAN_DISABLED) &&
  4693. nla_put_flag(msg, NL80211_FREQUENCY_ATTR_DISABLED))
  4694. goto nla_put_failure;
  4695. - if ((chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) &&
  4696. - nla_put_flag(msg, NL80211_FREQUENCY_ATTR_PASSIVE_SCAN))
  4697. - goto nla_put_failure;
  4698. - if ((chan->flags & IEEE80211_CHAN_NO_IBSS) &&
  4699. - nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_IBSS))
  4700. - goto nla_put_failure;
  4701. + if (chan->flags & IEEE80211_CHAN_NO_IR) {
  4702. + if (nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_IR))
  4703. + goto nla_put_failure;
  4704. + if (nla_put_flag(msg, __NL80211_FREQUENCY_ATTR_NO_IBSS))
  4705. + goto nla_put_failure;
  4706. + }
  4707. if (chan->flags & IEEE80211_CHAN_RADAR) {
  4708. if (nla_put_flag(msg, NL80211_FREQUENCY_ATTR_RADAR))
  4709. goto nla_put_failure;
  4710. @@ -1229,7 +1229,8 @@ static int nl80211_send_wiphy(struct cfg
  4711. nla_put_flag(msg, NL80211_ATTR_TDLS_EXTERNAL_SETUP))
  4712. goto nla_put_failure;
  4713. if ((dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ) &&
  4714. - nla_put_flag(msg, WIPHY_FLAG_SUPPORTS_5_10_MHZ))
  4715. + (nla_put_flag(msg, NL80211_ATTR_SUPPORT_5_MHZ) ||
  4716. + nla_put_flag(msg, NL80211_ATTR_SUPPORT_10_MHZ)))
  4717. goto nla_put_failure;
  4718. state->split_start++;
  4719. @@ -2170,7 +2171,7 @@ static inline u64 wdev_id(struct wireles
  4720. }
  4721. static int nl80211_send_chandef(struct sk_buff *msg,
  4722. - struct cfg80211_chan_def *chandef)
  4723. + const struct cfg80211_chan_def *chandef)
  4724. {
  4725. WARN_ON(!cfg80211_chandef_valid(chandef));
  4726. @@ -3219,6 +3220,7 @@ static int nl80211_start_ap(struct sk_bu
  4727. return PTR_ERR(params.acl);
  4728. }
  4729. + wdev_lock(wdev);
  4730. err = rdev_start_ap(rdev, dev, &params);
  4731. if (!err) {
  4732. wdev->preset_chandef = params.chandef;
  4733. @@ -3227,6 +3229,7 @@ static int nl80211_start_ap(struct sk_bu
  4734. wdev->ssid_len = params.ssid_len;
  4735. memcpy(wdev->ssid, params.ssid, wdev->ssid_len);
  4736. }
  4737. + wdev_unlock(wdev);
  4738. kfree(params.acl);
  4739. @@ -3255,7 +3258,11 @@ static int nl80211_set_beacon(struct sk_
  4740. if (err)
  4741. return err;
  4742. - return rdev_change_beacon(rdev, dev, &params);
  4743. + wdev_lock(wdev);
  4744. + err = rdev_change_beacon(rdev, dev, &params);
  4745. + wdev_unlock(wdev);
  4746. +
  4747. + return err;
  4748. }
  4749. static int nl80211_stop_ap(struct sk_buff *skb, struct genl_info *info)
  4750. @@ -4461,7 +4468,9 @@ static int nl80211_set_bss(struct sk_buf
  4751. {
  4752. struct cfg80211_registered_device *rdev = info->user_ptr[0];
  4753. struct net_device *dev = info->user_ptr[1];
  4754. + struct wireless_dev *wdev = dev->ieee80211_ptr;
  4755. struct bss_parameters params;
  4756. + int err;
  4757. memset(&params, 0, sizeof(params));
  4758. /* default to not changing parameters */
  4759. @@ -4527,7 +4536,11 @@ static int nl80211_set_bss(struct sk_buf
  4760. dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO)
  4761. return -EOPNOTSUPP;
  4762. - return rdev_change_bss(rdev, dev, &params);
  4763. + wdev_lock(wdev);
  4764. + err = rdev_change_bss(rdev, dev, &params);
  4765. + wdev_unlock(wdev);
  4766. +
  4767. + return err;
  4768. }
  4769. static const struct nla_policy reg_rule_policy[NL80211_REG_RULE_ATTR_MAX + 1] = {
  4770. @@ -5653,7 +5666,7 @@ static int nl80211_start_radar_detection
  4771. if (err == 0)
  4772. return -EINVAL;
  4773. - if (chandef.chan->dfs_state != NL80211_DFS_USABLE)
  4774. + if (!cfg80211_chandef_dfs_usable(wdev->wiphy, &chandef))
  4775. return -EINVAL;
  4776. if (!rdev->ops->start_radar_detection)
  4777. @@ -5793,7 +5806,11 @@ skip_beacons:
  4778. if (info->attrs[NL80211_ATTR_CH_SWITCH_BLOCK_TX])
  4779. params.block_tx = true;
  4780. - return rdev_channel_switch(rdev, dev, &params);
  4781. + wdev_lock(wdev);
  4782. + err = rdev_channel_switch(rdev, dev, &params);
  4783. + wdev_unlock(wdev);
  4784. +
  4785. + return err;
  4786. }
  4787. static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb,
  4788. @@ -10809,21 +10826,18 @@ void cfg80211_ch_switch_notify(struct ne
  4789. struct wiphy *wiphy = wdev->wiphy;
  4790. struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
  4791. - trace_cfg80211_ch_switch_notify(dev, chandef);
  4792. + ASSERT_WDEV_LOCK(wdev);
  4793. - wdev_lock(wdev);
  4794. + trace_cfg80211_ch_switch_notify(dev, chandef);
  4795. if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP &&
  4796. wdev->iftype != NL80211_IFTYPE_P2P_GO &&
  4797. wdev->iftype != NL80211_IFTYPE_ADHOC &&
  4798. wdev->iftype != NL80211_IFTYPE_MESH_POINT))
  4799. - goto out;
  4800. + return;
  4801. wdev->channel = chandef->chan;
  4802. nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL);
  4803. -out:
  4804. - wdev_unlock(wdev);
  4805. - return;
  4806. }
  4807. EXPORT_SYMBOL(cfg80211_ch_switch_notify);
  4808. @@ -10882,7 +10896,7 @@ EXPORT_SYMBOL(cfg80211_cqm_txe_notify);
  4809. void
  4810. nl80211_radar_notify(struct cfg80211_registered_device *rdev,
  4811. - struct cfg80211_chan_def *chandef,
  4812. + const struct cfg80211_chan_def *chandef,
  4813. enum nl80211_radar_event event,
  4814. struct net_device *netdev, gfp_t gfp)
  4815. {
  4816. --- a/net/wireless/nl80211.h
  4817. +++ b/net/wireless/nl80211.h
  4818. @@ -70,7 +70,7 @@ int nl80211_send_mgmt(struct cfg80211_re
  4819. void
  4820. nl80211_radar_notify(struct cfg80211_registered_device *rdev,
  4821. - struct cfg80211_chan_def *chandef,
  4822. + const struct cfg80211_chan_def *chandef,
  4823. enum nl80211_radar_event event,
  4824. struct net_device *netdev, gfp_t gfp);
  4825. --- a/net/wireless/reg.c
  4826. +++ b/net/wireless/reg.c
  4827. @@ -163,35 +163,29 @@ static const struct ieee80211_regdomain
  4828. REG_RULE(2412-10, 2462+10, 40, 6, 20, 0),
  4829. /* IEEE 802.11b/g, channels 12..13. */
  4830. REG_RULE(2467-10, 2472+10, 40, 6, 20,
  4831. - NL80211_RRF_PASSIVE_SCAN |
  4832. - NL80211_RRF_NO_IBSS),
  4833. + NL80211_RRF_NO_IR),
  4834. /* IEEE 802.11 channel 14 - Only JP enables
  4835. * this and for 802.11b only */
  4836. REG_RULE(2484-10, 2484+10, 20, 6, 20,
  4837. - NL80211_RRF_PASSIVE_SCAN |
  4838. - NL80211_RRF_NO_IBSS |
  4839. + NL80211_RRF_NO_IR |
  4840. NL80211_RRF_NO_OFDM),
  4841. /* IEEE 802.11a, channel 36..48 */
  4842. REG_RULE(5180-10, 5240+10, 160, 6, 20,
  4843. - NL80211_RRF_PASSIVE_SCAN |
  4844. - NL80211_RRF_NO_IBSS),
  4845. + NL80211_RRF_NO_IR),
  4846. /* IEEE 802.11a, channel 52..64 - DFS required */
  4847. REG_RULE(5260-10, 5320+10, 160, 6, 20,
  4848. - NL80211_RRF_PASSIVE_SCAN |
  4849. - NL80211_RRF_NO_IBSS |
  4850. + NL80211_RRF_NO_IR |
  4851. NL80211_RRF_DFS),
  4852. /* IEEE 802.11a, channel 100..144 - DFS required */
  4853. REG_RULE(5500-10, 5720+10, 160, 6, 20,
  4854. - NL80211_RRF_PASSIVE_SCAN |
  4855. - NL80211_RRF_NO_IBSS |
  4856. + NL80211_RRF_NO_IR |
  4857. NL80211_RRF_DFS),
  4858. /* IEEE 802.11a, channel 149..165 */
  4859. REG_RULE(5745-10, 5825+10, 80, 6, 20,
  4860. - NL80211_RRF_PASSIVE_SCAN |
  4861. - NL80211_RRF_NO_IBSS),
  4862. + NL80211_RRF_NO_IR),
  4863. /* IEEE 802.11ad (60gHz), channels 1..3 */
  4864. REG_RULE(56160+2160*1-1080, 56160+2160*3+1080, 2160, 0, 0, 0),
  4865. @@ -698,10 +692,8 @@ regdom_intersect(const struct ieee80211_
  4866. static u32 map_regdom_flags(u32 rd_flags)
  4867. {
  4868. u32 channel_flags = 0;
  4869. - if (rd_flags & NL80211_RRF_PASSIVE_SCAN)
  4870. - channel_flags |= IEEE80211_CHAN_PASSIVE_SCAN;
  4871. - if (rd_flags & NL80211_RRF_NO_IBSS)
  4872. - channel_flags |= IEEE80211_CHAN_NO_IBSS;
  4873. + if (rd_flags & NL80211_RRF_NO_IR_ALL)
  4874. + channel_flags |= IEEE80211_CHAN_NO_IR;
  4875. if (rd_flags & NL80211_RRF_DFS)
  4876. channel_flags |= IEEE80211_CHAN_RADAR;
  4877. if (rd_flags & NL80211_RRF_NO_OFDM)
  4878. @@ -1066,13 +1058,8 @@ static void handle_reg_beacon(struct wip
  4879. chan_before.center_freq = chan->center_freq;
  4880. chan_before.flags = chan->flags;
  4881. - if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) {
  4882. - chan->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
  4883. - channel_changed = true;
  4884. - }
  4885. -
  4886. - if (chan->flags & IEEE80211_CHAN_NO_IBSS) {
  4887. - chan->flags &= ~IEEE80211_CHAN_NO_IBSS;
  4888. + if (chan->flags & IEEE80211_CHAN_NO_IR) {
  4889. + chan->flags &= ~IEEE80211_CHAN_NO_IR;
  4890. channel_changed = true;
  4891. }
  4892. --- /dev/null
  4893. +++ b/drivers/net/wireless/ath/ath9k/ar9003_wow.c
  4894. @@ -0,0 +1,422 @@
  4895. +/*
  4896. + * Copyright (c) 2012 Qualcomm Atheros, Inc.
  4897. + *
  4898. + * Permission to use, copy, modify, and/or distribute this software for any
  4899. + * purpose with or without fee is hereby granted, provided that the above
  4900. + * copyright notice and this permission notice appear in all copies.
  4901. + *
  4902. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  4903. + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  4904. + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  4905. + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  4906. + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  4907. + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  4908. + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  4909. + */
  4910. +
  4911. +#include <linux/export.h>
  4912. +#include "ath9k.h"
  4913. +#include "reg.h"
  4914. +#include "hw-ops.h"
  4915. +
  4916. +const char *ath9k_hw_wow_event_to_string(u32 wow_event)
  4917. +{
  4918. + if (wow_event & AH_WOW_MAGIC_PATTERN_EN)
  4919. + return "Magic pattern";
  4920. + if (wow_event & AH_WOW_USER_PATTERN_EN)
  4921. + return "User pattern";
  4922. + if (wow_event & AH_WOW_LINK_CHANGE)
  4923. + return "Link change";
  4924. + if (wow_event & AH_WOW_BEACON_MISS)
  4925. + return "Beacon miss";
  4926. +
  4927. + return "unknown reason";
  4928. +}
  4929. +EXPORT_SYMBOL(ath9k_hw_wow_event_to_string);
  4930. +
  4931. +static void ath9k_hw_set_powermode_wow_sleep(struct ath_hw *ah)
  4932. +{
  4933. + struct ath_common *common = ath9k_hw_common(ah);
  4934. +
  4935. + REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV);
  4936. +
  4937. + /* set rx disable bit */
  4938. + REG_WRITE(ah, AR_CR, AR_CR_RXD);
  4939. +
  4940. + if (!ath9k_hw_wait(ah, AR_CR, AR_CR_RXE, 0, AH_WAIT_TIMEOUT)) {
  4941. + ath_err(common, "Failed to stop Rx DMA in 10ms AR_CR=0x%08x AR_DIAG_SW=0x%08x\n",
  4942. + REG_READ(ah, AR_CR), REG_READ(ah, AR_DIAG_SW));
  4943. + return;
  4944. + }
  4945. +
  4946. + REG_WRITE(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_ON_INT);
  4947. +}
  4948. +
  4949. +static void ath9k_wow_create_keep_alive_pattern(struct ath_hw *ah)
  4950. +{
  4951. + struct ath_common *common = ath9k_hw_common(ah);
  4952. + u8 sta_mac_addr[ETH_ALEN], ap_mac_addr[ETH_ALEN];
  4953. + u32 ctl[13] = {0};
  4954. + u32 data_word[KAL_NUM_DATA_WORDS];
  4955. + u8 i;
  4956. + u32 wow_ka_data_word0;
  4957. +
  4958. + memcpy(sta_mac_addr, common->macaddr, ETH_ALEN);
  4959. + memcpy(ap_mac_addr, common->curbssid, ETH_ALEN);
  4960. +
  4961. + /* set the transmit buffer */
  4962. + ctl[0] = (KAL_FRAME_LEN | (MAX_RATE_POWER << 16));
  4963. + ctl[1] = 0;
  4964. + ctl[3] = 0xb; /* OFDM_6M hardware value for this rate */
  4965. + ctl[4] = 0;
  4966. + ctl[7] = (ah->txchainmask) << 2;
  4967. + ctl[2] = 0xf << 16; /* tx_tries 0 */
  4968. +
  4969. + for (i = 0; i < KAL_NUM_DESC_WORDS; i++)
  4970. + REG_WRITE(ah, (AR_WOW_KA_DESC_WORD2 + i * 4), ctl[i]);
  4971. +
  4972. + REG_WRITE(ah, (AR_WOW_KA_DESC_WORD2 + i * 4), ctl[i]);
  4973. +
  4974. + data_word[0] = (KAL_FRAME_TYPE << 2) | (KAL_FRAME_SUB_TYPE << 4) |
  4975. + (KAL_TO_DS << 8) | (KAL_DURATION_ID << 16);
  4976. + data_word[1] = (ap_mac_addr[3] << 24) | (ap_mac_addr[2] << 16) |
  4977. + (ap_mac_addr[1] << 8) | (ap_mac_addr[0]);
  4978. + data_word[2] = (sta_mac_addr[1] << 24) | (sta_mac_addr[0] << 16) |
  4979. + (ap_mac_addr[5] << 8) | (ap_mac_addr[4]);
  4980. + data_word[3] = (sta_mac_addr[5] << 24) | (sta_mac_addr[4] << 16) |
  4981. + (sta_mac_addr[3] << 8) | (sta_mac_addr[2]);
  4982. + data_word[4] = (ap_mac_addr[3] << 24) | (ap_mac_addr[2] << 16) |
  4983. + (ap_mac_addr[1] << 8) | (ap_mac_addr[0]);
  4984. + data_word[5] = (ap_mac_addr[5] << 8) | (ap_mac_addr[4]);
  4985. +
  4986. + if (AR_SREV_9462_20(ah)) {
  4987. + /* AR9462 2.0 has an extra descriptor word (time based
  4988. + * discard) compared to other chips */
  4989. + REG_WRITE(ah, (AR_WOW_KA_DESC_WORD2 + (12 * 4)), 0);
  4990. + wow_ka_data_word0 = AR_WOW_TXBUF(13);
  4991. + } else {
  4992. + wow_ka_data_word0 = AR_WOW_TXBUF(12);
  4993. + }
  4994. +
  4995. + for (i = 0; i < KAL_NUM_DATA_WORDS; i++)
  4996. + REG_WRITE(ah, (wow_ka_data_word0 + i*4), data_word[i]);
  4997. +
  4998. +}
  4999. +
  5000. +void ath9k_hw_wow_apply_pattern(struct ath_hw *ah, u8 *user_pattern,
  5001. + u8 *user_mask, int pattern_count,
  5002. + int pattern_len)
  5003. +{
  5004. + int i;
  5005. + u32 pattern_val, mask_val;
  5006. + u32 set, clr;
  5007. +
  5008. + /* FIXME: should check count by querying the hardware capability */
  5009. + if (pattern_count >= MAX_NUM_PATTERN)
  5010. + return;
  5011. +
  5012. + REG_SET_BIT(ah, AR_WOW_PATTERN, BIT(pattern_count));
  5013. +
  5014. + /* set the registers for pattern */
  5015. + for (i = 0; i < MAX_PATTERN_SIZE; i += 4) {
  5016. + memcpy(&pattern_val, user_pattern, 4);
  5017. + REG_WRITE(ah, (AR_WOW_TB_PATTERN(pattern_count) + i),
  5018. + pattern_val);
  5019. + user_pattern += 4;
  5020. + }
  5021. +
  5022. + /* set the registers for mask */
  5023. + for (i = 0; i < MAX_PATTERN_MASK_SIZE; i += 4) {
  5024. + memcpy(&mask_val, user_mask, 4);
  5025. + REG_WRITE(ah, (AR_WOW_TB_MASK(pattern_count) + i), mask_val);
  5026. + user_mask += 4;
  5027. + }
  5028. +
  5029. + /* set the pattern length to be matched
  5030. + *
  5031. + * AR_WOW_LENGTH1_REG1
  5032. + * bit 31:24 pattern 0 length
  5033. + * bit 23:16 pattern 1 length
  5034. + * bit 15:8 pattern 2 length
  5035. + * bit 7:0 pattern 3 length
  5036. + *
  5037. + * AR_WOW_LENGTH1_REG2
  5038. + * bit 31:24 pattern 4 length
  5039. + * bit 23:16 pattern 5 length
  5040. + * bit 15:8 pattern 6 length
  5041. + * bit 7:0 pattern 7 length
  5042. + *
  5043. + * the below logic writes out the new
  5044. + * pattern length for the corresponding
  5045. + * pattern_count, while masking out the
  5046. + * other fields
  5047. + */
  5048. +
  5049. + ah->wow_event_mask |= BIT(pattern_count + AR_WOW_PAT_FOUND_SHIFT);
  5050. +
  5051. + if (pattern_count < 4) {
  5052. + /* Pattern 0-3 uses AR_WOW_LENGTH1 register */
  5053. + set = (pattern_len & AR_WOW_LENGTH_MAX) <<
  5054. + AR_WOW_LEN1_SHIFT(pattern_count);
  5055. + clr = AR_WOW_LENGTH1_MASK(pattern_count);
  5056. + REG_RMW(ah, AR_WOW_LENGTH1, set, clr);
  5057. + } else {
  5058. + /* Pattern 4-7 uses AR_WOW_LENGTH2 register */
  5059. + set = (pattern_len & AR_WOW_LENGTH_MAX) <<
  5060. + AR_WOW_LEN2_SHIFT(pattern_count);
  5061. + clr = AR_WOW_LENGTH2_MASK(pattern_count);
  5062. + REG_RMW(ah, AR_WOW_LENGTH2, set, clr);
  5063. + }
  5064. +
  5065. +}
  5066. +EXPORT_SYMBOL(ath9k_hw_wow_apply_pattern);
  5067. +
  5068. +u32 ath9k_hw_wow_wakeup(struct ath_hw *ah)
  5069. +{
  5070. + u32 wow_status = 0;
  5071. + u32 val = 0, rval;
  5072. +
  5073. + /*
  5074. + * read the WoW status register to know
  5075. + * the wakeup reason
  5076. + */
  5077. + rval = REG_READ(ah, AR_WOW_PATTERN);
  5078. + val = AR_WOW_STATUS(rval);
  5079. +
  5080. + /*
  5081. + * mask only the WoW events that we have enabled. Sometimes
  5082. + * we have spurious WoW events from the AR_WOW_PATTERN
  5083. + * register. This mask will clean it up.
  5084. + */
  5085. +
  5086. + val &= ah->wow_event_mask;
  5087. +
  5088. + if (val) {
  5089. + if (val & AR_WOW_MAGIC_PAT_FOUND)
  5090. + wow_status |= AH_WOW_MAGIC_PATTERN_EN;
  5091. + if (AR_WOW_PATTERN_FOUND(val))
  5092. + wow_status |= AH_WOW_USER_PATTERN_EN;
  5093. + if (val & AR_WOW_KEEP_ALIVE_FAIL)
  5094. + wow_status |= AH_WOW_LINK_CHANGE;
  5095. + if (val & AR_WOW_BEACON_FAIL)
  5096. + wow_status |= AH_WOW_BEACON_MISS;
  5097. + }
  5098. +
  5099. + /*
  5100. + * set and clear WOW_PME_CLEAR registers for the chip to
  5101. + * generate next wow signal.
  5102. + * disable D3 before accessing other registers ?
  5103. + */
  5104. +
  5105. + /* do we need to check the bit value 0x01000000 (7-10) ?? */
  5106. + REG_RMW(ah, AR_PCIE_PM_CTRL, AR_PMCTRL_WOW_PME_CLR,
  5107. + AR_PMCTRL_PWR_STATE_D1D3);
  5108. +
  5109. + /*
  5110. + * clear all events
  5111. + */
  5112. + REG_WRITE(ah, AR_WOW_PATTERN,
  5113. + AR_WOW_CLEAR_EVENTS(REG_READ(ah, AR_WOW_PATTERN)));
  5114. +
  5115. + /*
  5116. + * restore the beacon threshold to init value
  5117. + */
  5118. + REG_WRITE(ah, AR_RSSI_THR, INIT_RSSI_THR);
  5119. +
  5120. + /*
  5121. + * Restore the way the PCI-E reset, Power-On-Reset, external
  5122. + * PCIE_POR_SHORT pins are tied to its original value.
  5123. + * Previously just before WoW sleep, we untie the PCI-E
  5124. + * reset to our Chip's Power On Reset so that any PCI-E
  5125. + * reset from the bus will not reset our chip
  5126. + */
  5127. + if (ah->is_pciexpress)
  5128. + ath9k_hw_configpcipowersave(ah, false);
  5129. +
  5130. + ah->wow_event_mask = 0;
  5131. +
  5132. + return wow_status;
  5133. +}
  5134. +EXPORT_SYMBOL(ath9k_hw_wow_wakeup);
  5135. +
  5136. +void ath9k_hw_wow_enable(struct ath_hw *ah, u32 pattern_enable)
  5137. +{
  5138. + u32 wow_event_mask;
  5139. + u32 set, clr;
  5140. +
  5141. + /*
  5142. + * wow_event_mask is a mask to the AR_WOW_PATTERN register to
  5143. + * indicate which WoW events we have enabled. The WoW events
  5144. + * are from the 'pattern_enable' in this function and
  5145. + * 'pattern_count' of ath9k_hw_wow_apply_pattern()
  5146. + */
  5147. + wow_event_mask = ah->wow_event_mask;
  5148. +
  5149. + /*
  5150. + * Untie Power-on-Reset from the PCI-E-Reset. When we are in
  5151. + * WOW sleep, we do want the Reset from the PCI-E to disturb
  5152. + * our hw state
  5153. + */
  5154. + if (ah->is_pciexpress) {
  5155. + /*
  5156. + * we need to untie the internal POR (power-on-reset)
  5157. + * to the external PCI-E reset. We also need to tie
  5158. + * the PCI-E Phy reset to the PCI-E reset.
  5159. + */
  5160. + set = AR_WA_RESET_EN | AR_WA_POR_SHORT;
  5161. + clr = AR_WA_UNTIE_RESET_EN | AR_WA_D3_L1_DISABLE;
  5162. + REG_RMW(ah, AR_WA, set, clr);
  5163. + }
  5164. +
  5165. + /*
  5166. + * set the power states appropriately and enable PME
  5167. + */
  5168. + set = AR_PMCTRL_HOST_PME_EN | AR_PMCTRL_PWR_PM_CTRL_ENA |
  5169. + AR_PMCTRL_AUX_PWR_DET | AR_PMCTRL_WOW_PME_CLR;
  5170. +
  5171. + /*
  5172. + * set and clear WOW_PME_CLEAR registers for the chip
  5173. + * to generate next wow signal.
  5174. + */
  5175. + REG_SET_BIT(ah, AR_PCIE_PM_CTRL, set);
  5176. + clr = AR_PMCTRL_WOW_PME_CLR;
  5177. + REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, clr);
  5178. +
  5179. + /*
  5180. + * Setup for:
  5181. + * - beacon misses
  5182. + * - magic pattern
  5183. + * - keep alive timeout
  5184. + * - pattern matching
  5185. + */
  5186. +
  5187. + /*
  5188. + * Program default values for pattern backoff, aifs/slot/KAL count,
  5189. + * beacon miss timeout, KAL timeout, etc.
  5190. + */
  5191. + set = AR_WOW_BACK_OFF_SHIFT(AR_WOW_PAT_BACKOFF);
  5192. + REG_SET_BIT(ah, AR_WOW_PATTERN, set);
  5193. +
  5194. + set = AR_WOW_AIFS_CNT(AR_WOW_CNT_AIFS_CNT) |
  5195. + AR_WOW_SLOT_CNT(AR_WOW_CNT_SLOT_CNT) |
  5196. + AR_WOW_KEEP_ALIVE_CNT(AR_WOW_CNT_KA_CNT);
  5197. + REG_SET_BIT(ah, AR_WOW_COUNT, set);
  5198. +
  5199. + if (pattern_enable & AH_WOW_BEACON_MISS)
  5200. + set = AR_WOW_BEACON_TIMO;
  5201. + /* We are not using beacon miss, program a large value */
  5202. + else
  5203. + set = AR_WOW_BEACON_TIMO_MAX;
  5204. +
  5205. + REG_WRITE(ah, AR_WOW_BCN_TIMO, set);
  5206. +
  5207. + /*
  5208. + * Keep alive timo in ms except AR9280
  5209. + */
  5210. + if (!pattern_enable)
  5211. + set = AR_WOW_KEEP_ALIVE_NEVER;
  5212. + else
  5213. + set = KAL_TIMEOUT * 32;
  5214. +
  5215. + REG_WRITE(ah, AR_WOW_KEEP_ALIVE_TIMO, set);
  5216. +
  5217. + /*
  5218. + * Keep alive delay in us. based on 'power on clock',
  5219. + * therefore in usec
  5220. + */
  5221. + set = KAL_DELAY * 1000;
  5222. + REG_WRITE(ah, AR_WOW_KEEP_ALIVE_DELAY, set);
  5223. +
  5224. + /*
  5225. + * Create keep alive pattern to respond to beacons
  5226. + */
  5227. + ath9k_wow_create_keep_alive_pattern(ah);
  5228. +
  5229. + /*
  5230. + * Configure MAC WoW Registers
  5231. + */
  5232. + set = 0;
  5233. + /* Send keep alive timeouts anyway */
  5234. + clr = AR_WOW_KEEP_ALIVE_AUTO_DIS;
  5235. +
  5236. + if (pattern_enable & AH_WOW_LINK_CHANGE)
  5237. + wow_event_mask |= AR_WOW_KEEP_ALIVE_FAIL;
  5238. + else
  5239. + set = AR_WOW_KEEP_ALIVE_FAIL_DIS;
  5240. +
  5241. + set = AR_WOW_KEEP_ALIVE_FAIL_DIS;
  5242. + REG_RMW(ah, AR_WOW_KEEP_ALIVE, set, clr);
  5243. +
  5244. + /*
  5245. + * we are relying on a bmiss failure. ensure we have
  5246. + * enough threshold to prevent false positives
  5247. + */
  5248. + REG_RMW_FIELD(ah, AR_RSSI_THR, AR_RSSI_THR_BM_THR,
  5249. + AR_WOW_BMISSTHRESHOLD);
  5250. +
  5251. + set = 0;
  5252. + clr = 0;
  5253. +
  5254. + if (pattern_enable & AH_WOW_BEACON_MISS) {
  5255. + set = AR_WOW_BEACON_FAIL_EN;
  5256. + wow_event_mask |= AR_WOW_BEACON_FAIL;
  5257. + } else {
  5258. + clr = AR_WOW_BEACON_FAIL_EN;
  5259. + }
  5260. +
  5261. + REG_RMW(ah, AR_WOW_BCN_EN, set, clr);
  5262. +
  5263. + set = 0;
  5264. + clr = 0;
  5265. + /*
  5266. + * Enable the magic packet registers
  5267. + */
  5268. + if (pattern_enable & AH_WOW_MAGIC_PATTERN_EN) {
  5269. + set = AR_WOW_MAGIC_EN;
  5270. + wow_event_mask |= AR_WOW_MAGIC_PAT_FOUND;
  5271. + } else {
  5272. + clr = AR_WOW_MAGIC_EN;
  5273. + }
  5274. + set |= AR_WOW_MAC_INTR_EN;
  5275. + REG_RMW(ah, AR_WOW_PATTERN, set, clr);
  5276. +
  5277. + REG_WRITE(ah, AR_WOW_PATTERN_MATCH_LT_256B,
  5278. + AR_WOW_PATTERN_SUPPORTED);
  5279. +
  5280. + /*
  5281. + * Set the power states appropriately and enable PME
  5282. + */
  5283. + clr = 0;
  5284. + set = AR_PMCTRL_PWR_STATE_D1D3 | AR_PMCTRL_HOST_PME_EN |
  5285. + AR_PMCTRL_PWR_PM_CTRL_ENA;
  5286. +
  5287. + clr = AR_PCIE_PM_CTRL_ENA;
  5288. + REG_RMW(ah, AR_PCIE_PM_CTRL, set, clr);
  5289. +
  5290. + /*
  5291. + * this is needed to prevent the chip waking up
  5292. + * the host within 3-4 seconds with certain
  5293. + * platform/BIOS. The fix is to enable
  5294. + * D1 & D3 to match original definition and
  5295. + * also match the OTP value. Anyway this
  5296. + * is more related to SW WOW.
  5297. + */
  5298. + clr = AR_PMCTRL_PWR_STATE_D1D3;
  5299. + REG_CLR_BIT(ah, AR_PCIE_PM_CTRL, clr);
  5300. +
  5301. + set = AR_PMCTRL_PWR_STATE_D1D3_REAL;
  5302. + REG_SET_BIT(ah, AR_PCIE_PM_CTRL, set);
  5303. +
  5304. + REG_CLR_BIT(ah, AR_STA_ID1, AR_STA_ID1_PRESERVE_SEQNUM);
  5305. +
  5306. + /* to bring down WOW power low margin */
  5307. + set = BIT(13);
  5308. + REG_SET_BIT(ah, AR_PCIE_PHY_REG3, set);
  5309. + /* HW WoW */
  5310. + clr = BIT(5);
  5311. + REG_CLR_BIT(ah, AR_PCU_MISC_MODE3, clr);
  5312. +
  5313. + ath9k_hw_set_powermode_wow_sleep(ah);
  5314. + ah->wow_event_mask = wow_event_mask;
  5315. +}
  5316. +EXPORT_SYMBOL(ath9k_hw_wow_enable);
  5317. --- /dev/null
  5318. +++ b/drivers/net/wireless/ath/ath9k/tx99.c
  5319. @@ -0,0 +1,263 @@
  5320. +/*
  5321. + * Copyright (c) 2013 Qualcomm Atheros, Inc.
  5322. + *
  5323. + * Permission to use, copy, modify, and/or distribute this software for any
  5324. + * purpose with or without fee is hereby granted, provided that the above
  5325. + * copyright notice and this permission notice appear in all copies.
  5326. + *
  5327. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  5328. + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  5329. + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  5330. + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  5331. + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  5332. + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  5333. + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  5334. + */
  5335. +
  5336. +#include "ath9k.h"
  5337. +
  5338. +static void ath9k_tx99_stop(struct ath_softc *sc)
  5339. +{
  5340. + struct ath_hw *ah = sc->sc_ah;
  5341. + struct ath_common *common = ath9k_hw_common(ah);
  5342. +
  5343. + ath_drain_all_txq(sc);
  5344. + ath_startrecv(sc);
  5345. +
  5346. + ath9k_hw_set_interrupts(ah);
  5347. + ath9k_hw_enable_interrupts(ah);
  5348. +
  5349. + ieee80211_wake_queues(sc->hw);
  5350. +
  5351. + kfree_skb(sc->tx99_skb);
  5352. + sc->tx99_skb = NULL;
  5353. + sc->tx99_state = false;
  5354. +
  5355. + ath9k_hw_tx99_stop(sc->sc_ah);
  5356. + ath_dbg(common, XMIT, "TX99 stopped\n");
  5357. +}
  5358. +
  5359. +static struct sk_buff *ath9k_build_tx99_skb(struct ath_softc *sc)
  5360. +{
  5361. + static u8 PN9Data[] = {0xff, 0x87, 0xb8, 0x59, 0xb7, 0xa1, 0xcc, 0x24,
  5362. + 0x57, 0x5e, 0x4b, 0x9c, 0x0e, 0xe9, 0xea, 0x50,
  5363. + 0x2a, 0xbe, 0xb4, 0x1b, 0xb6, 0xb0, 0x5d, 0xf1,
  5364. + 0xe6, 0x9a, 0xe3, 0x45, 0xfd, 0x2c, 0x53, 0x18,
  5365. + 0x0c, 0xca, 0xc9, 0xfb, 0x49, 0x37, 0xe5, 0xa8,
  5366. + 0x51, 0x3b, 0x2f, 0x61, 0xaa, 0x72, 0x18, 0x84,
  5367. + 0x02, 0x23, 0x23, 0xab, 0x63, 0x89, 0x51, 0xb3,
  5368. + 0xe7, 0x8b, 0x72, 0x90, 0x4c, 0xe8, 0xfb, 0xc0};
  5369. + u32 len = 1200;
  5370. + struct ieee80211_hw *hw = sc->hw;
  5371. + struct ieee80211_hdr *hdr;
  5372. + struct ieee80211_tx_info *tx_info;
  5373. + struct sk_buff *skb;
  5374. +
  5375. + skb = alloc_skb(len, GFP_KERNEL);
  5376. + if (!skb)
  5377. + return NULL;
  5378. +
  5379. + skb_put(skb, len);
  5380. +
  5381. + memset(skb->data, 0, len);
  5382. +
  5383. + hdr = (struct ieee80211_hdr *)skb->data;
  5384. + hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA);
  5385. + hdr->duration_id = 0;
  5386. +
  5387. + memcpy(hdr->addr1, hw->wiphy->perm_addr, ETH_ALEN);
  5388. + memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
  5389. + memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
  5390. +
  5391. + hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no);
  5392. +
  5393. + tx_info = IEEE80211_SKB_CB(skb);
  5394. + memset(tx_info, 0, sizeof(*tx_info));
  5395. + tx_info->band = hw->conf.chandef.chan->band;
  5396. + tx_info->flags = IEEE80211_TX_CTL_NO_ACK;
  5397. + tx_info->control.vif = sc->tx99_vif;
  5398. +
  5399. + memcpy(skb->data + sizeof(*hdr), PN9Data, sizeof(PN9Data));
  5400. +
  5401. + return skb;
  5402. +}
  5403. +
  5404. +static void ath9k_tx99_deinit(struct ath_softc *sc)
  5405. +{
  5406. + ath_reset(sc);
  5407. +
  5408. + ath9k_ps_wakeup(sc);
  5409. + ath9k_tx99_stop(sc);
  5410. + ath9k_ps_restore(sc);
  5411. +}
  5412. +
  5413. +static int ath9k_tx99_init(struct ath_softc *sc)
  5414. +{
  5415. + struct ieee80211_hw *hw = sc->hw;
  5416. + struct ath_hw *ah = sc->sc_ah;
  5417. + struct ath_common *common = ath9k_hw_common(ah);
  5418. + struct ath_tx_control txctl;
  5419. + int r;
  5420. +
  5421. + if (test_bit(SC_OP_INVALID, &sc->sc_flags)) {
  5422. + ath_err(common,
  5423. + "driver is in invalid state unable to use TX99");
  5424. + return -EINVAL;
  5425. + }
  5426. +
  5427. + sc->tx99_skb = ath9k_build_tx99_skb(sc);
  5428. + if (!sc->tx99_skb)
  5429. + return -ENOMEM;
  5430. +
  5431. + memset(&txctl, 0, sizeof(txctl));
  5432. + txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO];
  5433. +
  5434. + ath_reset(sc);
  5435. +
  5436. + ath9k_ps_wakeup(sc);
  5437. +
  5438. + ath9k_hw_disable_interrupts(ah);
  5439. + atomic_set(&ah->intr_ref_cnt, -1);
  5440. + ath_drain_all_txq(sc);
  5441. + ath_stoprecv(sc);
  5442. +
  5443. + sc->tx99_state = true;
  5444. +
  5445. + ieee80211_stop_queues(hw);
  5446. +
  5447. + if (sc->tx99_power == MAX_RATE_POWER + 1)
  5448. + sc->tx99_power = MAX_RATE_POWER;
  5449. +
  5450. + ath9k_hw_tx99_set_txpower(ah, sc->tx99_power);
  5451. + r = ath9k_tx99_send(sc, sc->tx99_skb, &txctl);
  5452. + if (r) {
  5453. + ath_dbg(common, XMIT, "Failed to xmit TX99 skb\n");
  5454. + return r;
  5455. + }
  5456. +
  5457. + ath_dbg(common, XMIT, "TX99 xmit started using %d ( %ddBm)\n",
  5458. + sc->tx99_power,
  5459. + sc->tx99_power / 2);
  5460. +
  5461. + /* We leave the harware awake as it will be chugging on */
  5462. +
  5463. + return 0;
  5464. +}
  5465. +
  5466. +static ssize_t read_file_tx99(struct file *file, char __user *user_buf,
  5467. + size_t count, loff_t *ppos)
  5468. +{
  5469. + struct ath_softc *sc = file->private_data;
  5470. + char buf[3];
  5471. + unsigned int len;
  5472. +
  5473. + len = sprintf(buf, "%d\n", sc->tx99_state);
  5474. + return simple_read_from_buffer(user_buf, count, ppos, buf, len);
  5475. +}
  5476. +
  5477. +static ssize_t write_file_tx99(struct file *file, const char __user *user_buf,
  5478. + size_t count, loff_t *ppos)
  5479. +{
  5480. + struct ath_softc *sc = file->private_data;
  5481. + struct ath_common *common = ath9k_hw_common(sc->sc_ah);
  5482. + char buf[32];
  5483. + bool start;
  5484. + ssize_t len;
  5485. + int r;
  5486. +
  5487. + if (sc->nvifs > 1)
  5488. + return -EOPNOTSUPP;
  5489. +
  5490. + len = min(count, sizeof(buf) - 1);
  5491. + if (copy_from_user(buf, user_buf, len))
  5492. + return -EFAULT;
  5493. +
  5494. + if (strtobool(buf, &start))
  5495. + return -EINVAL;
  5496. +
  5497. + if (start == sc->tx99_state) {
  5498. + if (!start)
  5499. + return count;
  5500. + ath_dbg(common, XMIT, "Resetting TX99\n");
  5501. + ath9k_tx99_deinit(sc);
  5502. + }
  5503. +
  5504. + if (!start) {
  5505. + ath9k_tx99_deinit(sc);
  5506. + return count;
  5507. + }
  5508. +
  5509. + r = ath9k_tx99_init(sc);
  5510. + if (r)
  5511. + return r;
  5512. +
  5513. + return count;
  5514. +}
  5515. +
  5516. +static const struct file_operations fops_tx99 = {
  5517. + .read = read_file_tx99,
  5518. + .write = write_file_tx99,
  5519. + .open = simple_open,
  5520. + .owner = THIS_MODULE,
  5521. + .llseek = default_llseek,
  5522. +};
  5523. +
  5524. +static ssize_t read_file_tx99_power(struct file *file,
  5525. + char __user *user_buf,
  5526. + size_t count, loff_t *ppos)
  5527. +{
  5528. + struct ath_softc *sc = file->private_data;
  5529. + char buf[32];
  5530. + unsigned int len;
  5531. +
  5532. + len = sprintf(buf, "%d (%d dBm)\n",
  5533. + sc->tx99_power,
  5534. + sc->tx99_power / 2);
  5535. +
  5536. + return simple_read_from_buffer(user_buf, count, ppos, buf, len);
  5537. +}
  5538. +
  5539. +static ssize_t write_file_tx99_power(struct file *file,
  5540. + const char __user *user_buf,
  5541. + size_t count, loff_t *ppos)
  5542. +{
  5543. + struct ath_softc *sc = file->private_data;
  5544. + int r;
  5545. + u8 tx_power;
  5546. +
  5547. + r = kstrtou8_from_user(user_buf, count, 0, &tx_power);
  5548. + if (r)
  5549. + return r;
  5550. +
  5551. + if (tx_power > MAX_RATE_POWER)
  5552. + return -EINVAL;
  5553. +
  5554. + sc->tx99_power = tx_power;
  5555. +
  5556. + ath9k_ps_wakeup(sc);
  5557. + ath9k_hw_tx99_set_txpower(sc->sc_ah, sc->tx99_power);
  5558. + ath9k_ps_restore(sc);
  5559. +
  5560. + return count;
  5561. +}
  5562. +
  5563. +static const struct file_operations fops_tx99_power = {
  5564. + .read = read_file_tx99_power,
  5565. + .write = write_file_tx99_power,
  5566. + .open = simple_open,
  5567. + .owner = THIS_MODULE,
  5568. + .llseek = default_llseek,
  5569. +};
  5570. +
  5571. +void ath9k_tx99_init_debug(struct ath_softc *sc)
  5572. +{
  5573. + if (!AR_SREV_9300_20_OR_LATER(sc->sc_ah))
  5574. + return;
  5575. +
  5576. + debugfs_create_file("tx99", S_IRUSR | S_IWUSR,
  5577. + sc->debug.debugfs_phy, sc,
  5578. + &fops_tx99);
  5579. + debugfs_create_file("tx99_power", S_IRUSR | S_IWUSR,
  5580. + sc->debug.debugfs_phy, sc,
  5581. + &fops_tx99_power);
  5582. +}
  5583. --- a/drivers/net/wireless/ath/ath9k/dfs_debug.c
  5584. +++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c
  5585. @@ -44,14 +44,20 @@ static ssize_t read_file_dfs(struct file
  5586. if (buf == NULL)
  5587. return -ENOMEM;
  5588. - if (sc->dfs_detector)
  5589. - dfs_pool_stats = sc->dfs_detector->get_stats(sc->dfs_detector);
  5590. -
  5591. len += scnprintf(buf + len, size - len, "DFS support for "
  5592. "macVersion = 0x%x, macRev = 0x%x: %s\n",
  5593. hw_ver->macVersion, hw_ver->macRev,
  5594. (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_DFS) ?
  5595. "enabled" : "disabled");
  5596. +
  5597. + if (!sc->dfs_detector) {
  5598. + len += scnprintf(buf + len, size - len,
  5599. + "DFS detector not enabled\n");
  5600. + goto exit;
  5601. + }
  5602. +
  5603. + dfs_pool_stats = sc->dfs_detector->get_stats(sc->dfs_detector);
  5604. +
  5605. len += scnprintf(buf + len, size - len, "Pulse detector statistics:\n");
  5606. ATH9K_DFS_STAT("pulse events reported ", pulses_total);
  5607. ATH9K_DFS_STAT("invalid pulse events ", pulses_no_dfs);
  5608. @@ -76,6 +82,7 @@ static ssize_t read_file_dfs(struct file
  5609. ATH9K_DFS_POOL_STAT("Seqs. alloc error ", pseq_alloc_error);
  5610. ATH9K_DFS_POOL_STAT("Seqs. in use ", pseq_used);
  5611. +exit:
  5612. if (len > size)
  5613. len = size;
  5614. --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
  5615. +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
  5616. @@ -641,11 +641,12 @@ static void ar9003_hw_override_ini(struc
  5617. else
  5618. ah->enabled_cals &= ~TX_IQ_CAL;
  5619. - if (REG_READ(ah, AR_PHY_CL_CAL_CTL) & AR_PHY_CL_CAL_ENABLE)
  5620. - ah->enabled_cals |= TX_CL_CAL;
  5621. - else
  5622. - ah->enabled_cals &= ~TX_CL_CAL;
  5623. }
  5624. +
  5625. + if (REG_READ(ah, AR_PHY_CL_CAL_CTL) & AR_PHY_CL_CAL_ENABLE)
  5626. + ah->enabled_cals |= TX_CL_CAL;
  5627. + else
  5628. + ah->enabled_cals &= ~TX_CL_CAL;
  5629. }
  5630. static void ar9003_hw_prog_ini(struct ath_hw *ah,
  5631. @@ -701,6 +702,54 @@ static int ar9550_hw_get_modes_txgain_in
  5632. return ret;
  5633. }
  5634. +static void ar9003_doubler_fix(struct ath_hw *ah)
  5635. +{
  5636. + if (AR_SREV_9300(ah) || AR_SREV_9580(ah) || AR_SREV_9550(ah)) {
  5637. + REG_RMW(ah, AR_PHY_65NM_CH0_RXTX2,
  5638. + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S |
  5639. + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S, 0);
  5640. + REG_RMW(ah, AR_PHY_65NM_CH1_RXTX2,
  5641. + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S |
  5642. + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S, 0);
  5643. + REG_RMW(ah, AR_PHY_65NM_CH2_RXTX2,
  5644. + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S |
  5645. + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S, 0);
  5646. +
  5647. + udelay(200);
  5648. +
  5649. + REG_CLR_BIT(ah, AR_PHY_65NM_CH0_RXTX2,
  5650. + AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK);
  5651. + REG_CLR_BIT(ah, AR_PHY_65NM_CH1_RXTX2,
  5652. + AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK);
  5653. + REG_CLR_BIT(ah, AR_PHY_65NM_CH2_RXTX2,
  5654. + AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK);
  5655. +
  5656. + udelay(1);
  5657. +
  5658. + REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_RXTX2,
  5659. + AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK, 1);
  5660. + REG_RMW_FIELD(ah, AR_PHY_65NM_CH1_RXTX2,
  5661. + AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK, 1);
  5662. + REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX2,
  5663. + AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK, 1);
  5664. +
  5665. + udelay(200);
  5666. +
  5667. + REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_SYNTH12,
  5668. + AR_PHY_65NM_CH0_SYNTH12_VREFMUL3, 0xf);
  5669. +
  5670. + REG_RMW(ah, AR_PHY_65NM_CH0_RXTX2, 0,
  5671. + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S |
  5672. + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S);
  5673. + REG_RMW(ah, AR_PHY_65NM_CH1_RXTX2, 0,
  5674. + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S |
  5675. + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S);
  5676. + REG_RMW(ah, AR_PHY_65NM_CH2_RXTX2, 0,
  5677. + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S |
  5678. + 1 << AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S);
  5679. + }
  5680. +}
  5681. +
  5682. static int ar9003_hw_process_ini(struct ath_hw *ah,
  5683. struct ath9k_channel *chan)
  5684. {
  5685. @@ -726,6 +775,8 @@ static int ar9003_hw_process_ini(struct
  5686. modesIndex);
  5687. }
  5688. + ar9003_doubler_fix(ah);
  5689. +
  5690. /*
  5691. * RXGAIN initvals.
  5692. */
  5693. @@ -1281,6 +1332,7 @@ static void ar9003_hw_ani_cache_ini_regs
  5694. static void ar9003_hw_set_radar_params(struct ath_hw *ah,
  5695. struct ath_hw_radar_conf *conf)
  5696. {
  5697. + unsigned int regWrites = 0;
  5698. u32 radar_0 = 0, radar_1 = 0;
  5699. if (!conf) {
  5700. @@ -1307,6 +1359,11 @@ static void ar9003_hw_set_radar_params(s
  5701. REG_SET_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
  5702. else
  5703. REG_CLR_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
  5704. +
  5705. + if (AR_SREV_9300(ah) || AR_SREV_9340(ah) || AR_SREV_9580(ah)) {
  5706. + REG_WRITE_ARRAY(&ah->ini_dfs,
  5707. + IS_CHAN_HT40(ah->curchan) ? 2 : 1, regWrites);
  5708. + }
  5709. }
  5710. static void ar9003_hw_set_radar_conf(struct ath_hw *ah)
  5711. --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
  5712. +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
  5713. @@ -341,14 +341,15 @@
  5714. #define AR_PHY_CCA_MAX_GOOD_VAL_9300_2GHZ -95
  5715. #define AR_PHY_CCA_MAX_GOOD_VAL_9300_5GHZ -100
  5716. +#define AR_PHY_CCA_MAX_GOOD_VAL_9300_FCC_2GHZ -95
  5717. +#define AR_PHY_CCA_MAX_GOOD_VAL_9300_FCC_5GHZ -100
  5718. +
  5719. #define AR_PHY_CCA_NOM_VAL_9462_2GHZ -127
  5720. #define AR_PHY_CCA_MIN_GOOD_VAL_9462_2GHZ -127
  5721. #define AR_PHY_CCA_MAX_GOOD_VAL_9462_2GHZ -60
  5722. -#define AR_PHY_CCA_MAX_GOOD_VAL_9462_FCC_2GHZ -95
  5723. #define AR_PHY_CCA_NOM_VAL_9462_5GHZ -127
  5724. #define AR_PHY_CCA_MIN_GOOD_VAL_9462_5GHZ -127
  5725. #define AR_PHY_CCA_MAX_GOOD_VAL_9462_5GHZ -60
  5726. -#define AR_PHY_CCA_MAX_GOOD_VAL_9462_FCC_5GHZ -100
  5727. #define AR_PHY_CCA_NOM_VAL_9330_2GHZ -118
  5728. @@ -656,13 +657,24 @@
  5729. #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x00000001 : 0x00000002)
  5730. #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0 : 1)
  5731. #define AR_PHY_65NM_CH0_SYNTH7 0x16098
  5732. +#define AR_PHY_65NM_CH0_SYNTH12 0x160ac
  5733. #define AR_PHY_65NM_CH0_BIAS1 0x160c0
  5734. #define AR_PHY_65NM_CH0_BIAS2 0x160c4
  5735. #define AR_PHY_65NM_CH0_BIAS4 0x160cc
  5736. +#define AR_PHY_65NM_CH0_RXTX2 0x16104
  5737. +#define AR_PHY_65NM_CH1_RXTX2 0x16504
  5738. +#define AR_PHY_65NM_CH2_RXTX2 0x16904
  5739. #define AR_PHY_65NM_CH0_RXTX4 0x1610c
  5740. #define AR_PHY_65NM_CH1_RXTX4 0x1650c
  5741. #define AR_PHY_65NM_CH2_RXTX4 0x1690c
  5742. +#define AR_PHY_65NM_CH0_SYNTH12_VREFMUL3 0x00780000
  5743. +#define AR_PHY_65NM_CH0_SYNTH12_VREFMUL3_S 19
  5744. +#define AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK 0x00000004
  5745. +#define AR_PHY_65NM_CH0_RXTX2_SYNTHON_MASK_S 2
  5746. +#define AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK 0x00000008
  5747. +#define AR_PHY_65NM_CH0_RXTX2_SYNTHOVR_MASK_S 3
  5748. +
  5749. #define AR_CH0_TOP (AR_SREV_9300(ah) ? 0x16288 : \
  5750. (((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x1628c : 0x16280)))
  5751. #define AR_CH0_TOP_XPABIASLVL (AR_SREV_9550(ah) ? 0x3c0 : 0x300)
  5752. --- a/drivers/net/wireless/rt2x00/rt2x00dev.c
  5753. +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
  5754. @@ -181,6 +181,7 @@ static void rt2x00lib_autowakeup(struct
  5755. static void rt2x00lib_bc_buffer_iter(void *data, u8 *mac,
  5756. struct ieee80211_vif *vif)
  5757. {
  5758. + struct ieee80211_tx_control control = {};
  5759. struct rt2x00_dev *rt2x00dev = data;
  5760. struct sk_buff *skb;
  5761. @@ -195,7 +196,7 @@ static void rt2x00lib_bc_buffer_iter(voi
  5762. */
  5763. skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif);
  5764. while (skb) {
  5765. - rt2x00mac_tx(rt2x00dev->hw, NULL, skb);
  5766. + rt2x00mac_tx(rt2x00dev->hw, &control, skb);
  5767. skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif);
  5768. }
  5769. }
  5770. --- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
  5771. +++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
  5772. @@ -898,7 +898,7 @@ static void ar9003_hw_tx_iq_cal_reload(s
  5773. static void ar9003_hw_manual_peak_cal(struct ath_hw *ah, u8 chain, bool is_2g)
  5774. {
  5775. - int offset[8], total = 0, test;
  5776. + int offset[8] = {0}, total = 0, test;
  5777. int agc_out, i;
  5778. REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_GAINSTAGES(chain),
  5779. @@ -923,12 +923,18 @@ static void ar9003_hw_manual_peak_cal(st
  5780. AR_PHY_65NM_RXRF_AGC_AGC_ON_OVR, 0x1);
  5781. REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
  5782. AR_PHY_65NM_RXRF_AGC_AGC_CAL_OVR, 0x1);
  5783. - if (is_2g)
  5784. - REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
  5785. - AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR, 0x0);
  5786. - else
  5787. +
  5788. + if (AR_SREV_9330_11(ah)) {
  5789. REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
  5790. - AR_PHY_65NM_RXRF_AGC_AGC5G_DBDAC_OVR, 0x0);
  5791. + AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR, 0x0);
  5792. + } else {
  5793. + if (is_2g)
  5794. + REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
  5795. + AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR, 0x0);
  5796. + else
  5797. + REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
  5798. + AR_PHY_65NM_RXRF_AGC_AGC5G_DBDAC_OVR, 0x0);
  5799. + }
  5800. for (i = 6; i > 0; i--) {
  5801. offset[i] = BIT(i - 1);
  5802. @@ -964,9 +970,9 @@ static void ar9003_hw_manual_peak_cal(st
  5803. AR_PHY_65NM_RXRF_AGC_AGC_CAL_OVR, 0);
  5804. }
  5805. -static void ar9003_hw_do_manual_peak_cal(struct ath_hw *ah,
  5806. - struct ath9k_channel *chan,
  5807. - bool run_rtt_cal)
  5808. +static void ar9003_hw_do_pcoem_manual_peak_cal(struct ath_hw *ah,
  5809. + struct ath9k_channel *chan,
  5810. + bool run_rtt_cal)
  5811. {
  5812. struct ath9k_hw_cal_data *caldata = ah->caldata;
  5813. int i;
  5814. @@ -1040,14 +1046,14 @@ static void ar9003_hw_cl_cal_post_proc(s
  5815. }
  5816. }
  5817. -static bool ar9003_hw_init_cal(struct ath_hw *ah,
  5818. - struct ath9k_channel *chan)
  5819. +static bool ar9003_hw_init_cal_pcoem(struct ath_hw *ah,
  5820. + struct ath9k_channel *chan)
  5821. {
  5822. struct ath_common *common = ath9k_hw_common(ah);
  5823. struct ath9k_hw_cal_data *caldata = ah->caldata;
  5824. bool txiqcal_done = false;
  5825. bool is_reusable = true, status = true;
  5826. - bool run_rtt_cal = false, run_agc_cal, sep_iq_cal = false;
  5827. + bool run_rtt_cal = false, run_agc_cal;
  5828. bool rtt = !!(ah->caps.hw_caps & ATH9K_HW_CAP_RTT);
  5829. u32 rx_delay = 0;
  5830. u32 agc_ctrl = 0, agc_supp_cals = AR_PHY_AGC_CONTROL_OFFSET_CAL |
  5831. @@ -1119,22 +1125,12 @@ static bool ar9003_hw_init_cal(struct at
  5832. REG_CLR_BIT(ah, AR_PHY_TX_IQCAL_CONTROL_0,
  5833. AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL);
  5834. txiqcal_done = run_agc_cal = true;
  5835. - } else if (caldata && !test_bit(TXIQCAL_DONE, &caldata->cal_flags)) {
  5836. - run_agc_cal = true;
  5837. - sep_iq_cal = true;
  5838. }
  5839. skip_tx_iqcal:
  5840. if (ath9k_hw_mci_is_enabled(ah) && IS_CHAN_2GHZ(chan) && run_agc_cal)
  5841. ar9003_mci_init_cal_req(ah, &is_reusable);
  5842. - if (sep_iq_cal) {
  5843. - txiqcal_done = ar9003_hw_tx_iq_cal_run(ah);
  5844. - REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_DIS);
  5845. - udelay(5);
  5846. - REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN);
  5847. - }
  5848. -
  5849. if (REG_READ(ah, AR_PHY_CL_CAL_CTL) & AR_PHY_CL_CAL_ENABLE) {
  5850. rx_delay = REG_READ(ah, AR_PHY_RX_DELAY);
  5851. /* Disable BB_active */
  5852. @@ -1155,7 +1151,7 @@ skip_tx_iqcal:
  5853. AR_PHY_AGC_CONTROL_CAL,
  5854. 0, AH_WAIT_TIMEOUT);
  5855. - ar9003_hw_do_manual_peak_cal(ah, chan, run_rtt_cal);
  5856. + ar9003_hw_do_pcoem_manual_peak_cal(ah, chan, run_rtt_cal);
  5857. }
  5858. if (REG_READ(ah, AR_PHY_CL_CAL_CTL) & AR_PHY_CL_CAL_ENABLE) {
  5859. @@ -1228,13 +1224,112 @@ skip_tx_iqcal:
  5860. return true;
  5861. }
  5862. +static bool ar9003_hw_init_cal_soc(struct ath_hw *ah,
  5863. + struct ath9k_channel *chan)
  5864. +{
  5865. + struct ath_common *common = ath9k_hw_common(ah);
  5866. + struct ath9k_hw_cal_data *caldata = ah->caldata;
  5867. + bool txiqcal_done = false;
  5868. + bool is_reusable = true, status = true;
  5869. + bool run_agc_cal = false, sep_iq_cal = false;
  5870. +
  5871. + /* Use chip chainmask only for calibration */
  5872. + ar9003_hw_set_chain_masks(ah, ah->caps.rx_chainmask, ah->caps.tx_chainmask);
  5873. +
  5874. + if (ah->enabled_cals & TX_CL_CAL) {
  5875. + REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE);
  5876. + run_agc_cal = true;
  5877. + }
  5878. +
  5879. + if (IS_CHAN_HALF_RATE(chan) || IS_CHAN_QUARTER_RATE(chan))
  5880. + goto skip_tx_iqcal;
  5881. +
  5882. + /* Do Tx IQ Calibration */
  5883. + REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_1,
  5884. + AR_PHY_TX_IQCAL_CONTROL_1_IQCORR_I_Q_COFF_DELPT,
  5885. + DELPT);
  5886. +
  5887. + /*
  5888. + * For AR9485 or later chips, TxIQ cal runs as part of
  5889. + * AGC calibration. Specifically, AR9550 in SoC chips.
  5890. + */
  5891. + if (ah->enabled_cals & TX_IQ_ON_AGC_CAL) {
  5892. + txiqcal_done = true;
  5893. + run_agc_cal = true;
  5894. + } else {
  5895. + sep_iq_cal = true;
  5896. + run_agc_cal = true;
  5897. + }
  5898. +
  5899. + /*
  5900. + * In the SoC family, this will run for AR9300, AR9331 and AR9340.
  5901. + */
  5902. + if (sep_iq_cal) {
  5903. + txiqcal_done = ar9003_hw_tx_iq_cal_run(ah);
  5904. + REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_DIS);
  5905. + udelay(5);
  5906. + REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN);
  5907. + }
  5908. +
  5909. +skip_tx_iqcal:
  5910. + if (run_agc_cal || !(ah->ah_flags & AH_FASTCC)) {
  5911. + if (AR_SREV_9330_11(ah))
  5912. + ar9003_hw_manual_peak_cal(ah, 0, IS_CHAN_2GHZ(chan));
  5913. +
  5914. + /* Calibrate the AGC */
  5915. + REG_WRITE(ah, AR_PHY_AGC_CONTROL,
  5916. + REG_READ(ah, AR_PHY_AGC_CONTROL) |
  5917. + AR_PHY_AGC_CONTROL_CAL);
  5918. +
  5919. + /* Poll for offset calibration complete */
  5920. + status = ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL,
  5921. + AR_PHY_AGC_CONTROL_CAL,
  5922. + 0, AH_WAIT_TIMEOUT);
  5923. + }
  5924. +
  5925. + if (!status) {
  5926. + ath_dbg(common, CALIBRATE,
  5927. + "offset calibration failed to complete in %d ms; noisy environment?\n",
  5928. + AH_WAIT_TIMEOUT / 1000);
  5929. + return false;
  5930. + }
  5931. +
  5932. + if (txiqcal_done)
  5933. + ar9003_hw_tx_iq_cal_post_proc(ah, is_reusable);
  5934. +
  5935. + /* Revert chainmask to runtime parameters */
  5936. + ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
  5937. +
  5938. + /* Initialize list pointers */
  5939. + ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL;
  5940. +
  5941. + INIT_CAL(&ah->iq_caldata);
  5942. + INSERT_CAL(ah, &ah->iq_caldata);
  5943. + ath_dbg(common, CALIBRATE, "enabling IQ Calibration\n");
  5944. +
  5945. + /* Initialize current pointer to first element in list */
  5946. + ah->cal_list_curr = ah->cal_list;
  5947. +
  5948. + if (ah->cal_list_curr)
  5949. + ath9k_hw_reset_calibration(ah, ah->cal_list_curr);
  5950. +
  5951. + if (caldata)
  5952. + caldata->CalValid = 0;
  5953. +
  5954. + return true;
  5955. +}
  5956. +
  5957. void ar9003_hw_attach_calib_ops(struct ath_hw *ah)
  5958. {
  5959. struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
  5960. struct ath_hw_ops *ops = ath9k_hw_ops(ah);
  5961. + if (AR_SREV_9485(ah) || AR_SREV_9462(ah) || AR_SREV_9565(ah))
  5962. + priv_ops->init_cal = ar9003_hw_init_cal_pcoem;
  5963. + else
  5964. + priv_ops->init_cal = ar9003_hw_init_cal_soc;
  5965. +
  5966. priv_ops->init_cal_settings = ar9003_hw_init_cal_settings;
  5967. - priv_ops->init_cal = ar9003_hw_init_cal;
  5968. priv_ops->setup_calibration = ar9003_hw_setup_calibration;
  5969. ops->calibrate = ar9003_hw_calibrate;
  5970. --- a/drivers/net/wireless/ath/ath9k/common.c
  5971. +++ b/drivers/net/wireless/ath/ath9k/common.c
  5972. @@ -98,10 +98,8 @@ struct ath9k_channel *ath9k_cmn_get_chan
  5973. {
  5974. struct ieee80211_channel *curchan = chandef->chan;
  5975. struct ath9k_channel *channel;
  5976. - u8 chan_idx;
  5977. - chan_idx = curchan->hw_value;
  5978. - channel = &ah->channels[chan_idx];
  5979. + channel = &ah->channels[curchan->hw_value];
  5980. ath9k_cmn_update_ichannel(channel, chandef);
  5981. return channel;
  5982. --- a/net/mac80211/rc80211_minstrel_ht.c
  5983. +++ b/net/mac80211/rc80211_minstrel_ht.c
  5984. @@ -226,7 +226,7 @@ minstrel_ht_calc_tp(struct minstrel_ht_s
  5985. nsecs = 1000 * mi->overhead / MINSTREL_TRUNC(mi->avg_ampdu_len);
  5986. nsecs += minstrel_mcs_groups[group].duration[rate];
  5987. - tp = 1000000 * ((mr->probability * 1000) / nsecs);
  5988. + tp = 1000000 * ((prob * 1000) / nsecs);
  5989. mr->cur_tp = MINSTREL_TRUNC(tp);
  5990. }
  5991. --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
  5992. +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
  5993. @@ -3965,7 +3965,7 @@ static void ar9003_hw_apply_tuning_caps(
  5994. struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
  5995. u8 tuning_caps_param = eep->baseEepHeader.params_for_tuning_caps[0];
  5996. - if (AR_SREV_9485(ah) || AR_SREV_9330(ah) || AR_SREV_9340(ah))
  5997. + if (AR_SREV_9340(ah))
  5998. return;
  5999. if (eep->baseEepHeader.featureEnable & 0x40) {
  6000. @@ -3984,18 +3984,20 @@ static void ar9003_hw_quick_drop_apply(s
  6001. int quick_drop;
  6002. s32 t[3], f[3] = {5180, 5500, 5785};
  6003. - if (!(pBase->miscConfiguration & BIT(1)))
  6004. + if (!(pBase->miscConfiguration & BIT(4)))
  6005. return;
  6006. - if (freq < 4000)
  6007. - quick_drop = eep->modalHeader2G.quick_drop;
  6008. - else {
  6009. - t[0] = eep->base_ext1.quick_drop_low;
  6010. - t[1] = eep->modalHeader5G.quick_drop;
  6011. - t[2] = eep->base_ext1.quick_drop_high;
  6012. - quick_drop = ar9003_hw_power_interpolate(freq, f, t, 3);
  6013. + if (AR_SREV_9300(ah) || AR_SREV_9580(ah) || AR_SREV_9340(ah)) {
  6014. + if (freq < 4000) {
  6015. + quick_drop = eep->modalHeader2G.quick_drop;
  6016. + } else {
  6017. + t[0] = eep->base_ext1.quick_drop_low;
  6018. + t[1] = eep->modalHeader5G.quick_drop;
  6019. + t[2] = eep->base_ext1.quick_drop_high;
  6020. + quick_drop = ar9003_hw_power_interpolate(freq, f, t, 3);
  6021. + }
  6022. + REG_RMW_FIELD(ah, AR_PHY_AGC, AR_PHY_AGC_QUICK_DROP, quick_drop);
  6023. }
  6024. - REG_RMW_FIELD(ah, AR_PHY_AGC, AR_PHY_AGC_QUICK_DROP, quick_drop);
  6025. }
  6026. static void ar9003_hw_txend_to_xpa_off_apply(struct ath_hw *ah, bool is2ghz)
  6027. @@ -4035,7 +4037,7 @@ static void ar9003_hw_xlna_bias_strength
  6028. struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
  6029. u8 bias;
  6030. - if (!(eep->baseEepHeader.featureEnable & 0x40))
  6031. + if (!(eep->baseEepHeader.miscConfiguration & 0x40))
  6032. return;
  6033. if (!AR_SREV_9300(ah))
  6034. @@ -4120,7 +4122,7 @@ static void ath9k_hw_ar9300_set_board_va
  6035. ar9003_hw_xlna_bias_strength_apply(ah, is2ghz);
  6036. ar9003_hw_atten_apply(ah, chan);
  6037. ar9003_hw_quick_drop_apply(ah, chan->channel);
  6038. - if (!AR_SREV_9330(ah) && !AR_SREV_9340(ah) && !AR_SREV_9550(ah))
  6039. + if (!AR_SREV_9330(ah) && !AR_SREV_9340(ah))
  6040. ar9003_hw_internal_regulator_apply(ah);
  6041. ar9003_hw_apply_tuning_caps(ah);
  6042. ar9003_hw_txend_to_xpa_off_apply(ah, is2ghz);
  6043. --- a/net/mac80211/ieee80211_i.h
  6044. +++ b/net/mac80211/ieee80211_i.h
  6045. @@ -735,6 +735,7 @@ struct ieee80211_sub_if_data {
  6046. int csa_counter_offset_beacon;
  6047. int csa_counter_offset_presp;
  6048. bool csa_radar_required;
  6049. + struct cfg80211_chan_def csa_chandef;
  6050. /* used to reconfigure hardware SM PS */
  6051. struct work_struct recalc_smps;
  6052. @@ -811,6 +812,9 @@ static inline void sdata_unlock(struct i
  6053. __release(&sdata->wdev.mtx);
  6054. }
  6055. +#define sdata_dereference(p, sdata) \
  6056. + rcu_dereference_protected(p, lockdep_is_held(&sdata->wdev.mtx))
  6057. +
  6058. static inline void
  6059. sdata_assert_lock(struct ieee80211_sub_if_data *sdata)
  6060. {
  6061. @@ -1098,7 +1102,6 @@ struct ieee80211_local {
  6062. enum mac80211_scan_state next_scan_state;
  6063. struct delayed_work scan_work;
  6064. struct ieee80211_sub_if_data __rcu *scan_sdata;
  6065. - struct cfg80211_chan_def csa_chandef;
  6066. /* For backward compatibility only -- do not use */
  6067. struct cfg80211_chan_def _oper_chandef;
  6068. @@ -1236,6 +1239,7 @@ struct ieee80211_csa_ie {
  6069. u8 mode;
  6070. u8 count;
  6071. u8 ttl;
  6072. + u16 pre_value;
  6073. };
  6074. /* Parsed Information Elements */
  6075. @@ -1738,7 +1742,6 @@ ieee80211_vif_change_bandwidth(struct ie
  6076. /* NOTE: only use ieee80211_vif_change_channel() for channel switch */
  6077. int __must_check
  6078. ieee80211_vif_change_channel(struct ieee80211_sub_if_data *sdata,
  6079. - const struct cfg80211_chan_def *chandef,
  6080. u32 *changed);
  6081. void ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata);
  6082. void ieee80211_vif_vlan_copy_chanctx(struct ieee80211_sub_if_data *sdata);
  6083. --- a/net/mac80211/chan.c
  6084. +++ b/net/mac80211/chan.c
  6085. @@ -411,12 +411,12 @@ int ieee80211_vif_use_channel(struct iee
  6086. }
  6087. int ieee80211_vif_change_channel(struct ieee80211_sub_if_data *sdata,
  6088. - const struct cfg80211_chan_def *chandef,
  6089. u32 *changed)
  6090. {
  6091. struct ieee80211_local *local = sdata->local;
  6092. struct ieee80211_chanctx_conf *conf;
  6093. struct ieee80211_chanctx *ctx;
  6094. + const struct cfg80211_chan_def *chandef = &sdata->csa_chandef;
  6095. int ret;
  6096. u32 chanctx_changed = 0;
  6097. --- a/net/mac80211/ibss.c
  6098. +++ b/net/mac80211/ibss.c
  6099. @@ -534,7 +534,7 @@ int ieee80211_ibss_finish_csa(struct iee
  6100. int err;
  6101. u16 capability;
  6102. - sdata_lock(sdata);
  6103. + sdata_assert_lock(sdata);
  6104. /* update cfg80211 bss information with the new channel */
  6105. if (!is_zero_ether_addr(ifibss->bssid)) {
  6106. capability = WLAN_CAPABILITY_IBSS;
  6107. @@ -550,16 +550,15 @@ int ieee80211_ibss_finish_csa(struct iee
  6108. capability);
  6109. /* XXX: should not really modify cfg80211 data */
  6110. if (cbss) {
  6111. - cbss->channel = sdata->local->csa_chandef.chan;
  6112. + cbss->channel = sdata->csa_chandef.chan;
  6113. cfg80211_put_bss(sdata->local->hw.wiphy, cbss);
  6114. }
  6115. }
  6116. - ifibss->chandef = sdata->local->csa_chandef;
  6117. + ifibss->chandef = sdata->csa_chandef;
  6118. /* generate the beacon */
  6119. err = ieee80211_ibss_csa_beacon(sdata, NULL);
  6120. - sdata_unlock(sdata);
  6121. if (err < 0)
  6122. return err;
  6123. @@ -922,7 +921,7 @@ ieee80211_ibss_process_chanswitch(struct
  6124. IEEE80211_MAX_QUEUE_MAP,
  6125. IEEE80211_QUEUE_STOP_REASON_CSA);
  6126. - sdata->local->csa_chandef = params.chandef;
  6127. + sdata->csa_chandef = params.chandef;
  6128. sdata->vif.csa_active = true;
  6129. ieee80211_bss_info_change_notify(sdata, err);
  6130. --- a/net/mac80211/mesh.c
  6131. +++ b/net/mac80211/mesh.c
  6132. @@ -943,14 +943,19 @@ ieee80211_mesh_process_chnswitch(struct
  6133. params.chandef.chan->center_freq);
  6134. params.block_tx = csa_ie.mode & WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT;
  6135. - if (beacon)
  6136. + if (beacon) {
  6137. ifmsh->chsw_ttl = csa_ie.ttl - 1;
  6138. - else
  6139. - ifmsh->chsw_ttl = 0;
  6140. + if (ifmsh->pre_value >= csa_ie.pre_value)
  6141. + return false;
  6142. + ifmsh->pre_value = csa_ie.pre_value;
  6143. + }
  6144. - if (ifmsh->chsw_ttl > 0)
  6145. + if (ifmsh->chsw_ttl < ifmsh->mshcfg.dot11MeshTTL) {
  6146. if (ieee80211_mesh_csa_beacon(sdata, &params, false) < 0)
  6147. return false;
  6148. + } else {
  6149. + return false;
  6150. + }
  6151. sdata->csa_radar_required = params.radar_required;
  6152. @@ -959,7 +964,7 @@ ieee80211_mesh_process_chnswitch(struct
  6153. IEEE80211_MAX_QUEUE_MAP,
  6154. IEEE80211_QUEUE_STOP_REASON_CSA);
  6155. - sdata->local->csa_chandef = params.chandef;
  6156. + sdata->csa_chandef = params.chandef;
  6157. sdata->vif.csa_active = true;
  6158. ieee80211_bss_info_change_notify(sdata, err);
  6159. @@ -1163,7 +1168,6 @@ static int mesh_fwd_csa_frame(struct iee
  6160. offset_ttl = (len < 42) ? 7 : 10;
  6161. *(pos + offset_ttl) -= 1;
  6162. *(pos + offset_ttl + 1) &= ~WLAN_EID_CHAN_SWITCH_PARAM_INITIATOR;
  6163. - sdata->u.mesh.chsw_ttl = *(pos + offset_ttl);
  6164. memcpy(mgmt_fwd, mgmt, len);
  6165. eth_broadcast_addr(mgmt_fwd->da);
  6166. @@ -1182,7 +1186,7 @@ static void mesh_rx_csa_frame(struct iee
  6167. u16 pre_value;
  6168. bool fwd_csa = true;
  6169. size_t baselen;
  6170. - u8 *pos, ttl;
  6171. + u8 *pos;
  6172. if (mgmt->u.action.u.measurement.action_code !=
  6173. WLAN_ACTION_SPCT_CHL_SWITCH)
  6174. @@ -1193,8 +1197,8 @@ static void mesh_rx_csa_frame(struct iee
  6175. u.action.u.chan_switch.variable);
  6176. ieee802_11_parse_elems(pos, len - baselen, false, &elems);
  6177. - ttl = elems.mesh_chansw_params_ie->mesh_ttl;
  6178. - if (!--ttl)
  6179. + ifmsh->chsw_ttl = elems.mesh_chansw_params_ie->mesh_ttl;
  6180. + if (!--ifmsh->chsw_ttl)
  6181. fwd_csa = false;
  6182. pre_value = le16_to_cpu(elems.mesh_chansw_params_ie->mesh_pre_value);
  6183. --- a/net/mac80211/spectmgmt.c
  6184. +++ b/net/mac80211/spectmgmt.c
  6185. @@ -78,6 +78,8 @@ int ieee80211_parse_ch_switch_ie(struct
  6186. if (elems->mesh_chansw_params_ie) {
  6187. csa_ie->ttl = elems->mesh_chansw_params_ie->mesh_ttl;
  6188. csa_ie->mode = elems->mesh_chansw_params_ie->mesh_flags;
  6189. + csa_ie->pre_value = le16_to_cpu(
  6190. + elems->mesh_chansw_params_ie->mesh_pre_value);
  6191. }
  6192. new_freq = ieee80211_channel_to_frequency(new_chan_no, new_band);
  6193. --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
  6194. +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
  6195. @@ -1109,7 +1109,9 @@ void ath6kl_cfg80211_ch_switch_notify(st
  6196. (mode == WMI_11G_HT20) ?
  6197. NL80211_CHAN_HT20 : NL80211_CHAN_NO_HT);
  6198. + mutex_lock(vif->wdev->mtx);
  6199. cfg80211_ch_switch_notify(vif->ndev, &chandef);
  6200. + mutex_unlock(vif->wdev->mtx);
  6201. }
  6202. static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
  6203. --- a/drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h
  6204. +++ b/drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h
  6205. @@ -20,6 +20,44 @@
  6206. /* AR9462 2.1 */
  6207. +#define ar9462_2p1_mac_postamble ar9462_2p0_mac_postamble
  6208. +
  6209. +#define ar9462_2p1_baseband_core ar9462_2p0_baseband_core
  6210. +
  6211. +#define ar9462_2p1_radio_core ar9462_2p0_radio_core
  6212. +
  6213. +#define ar9462_2p1_radio_postamble ar9462_2p0_radio_postamble
  6214. +
  6215. +#define ar9462_2p1_soc_postamble ar9462_2p0_soc_postamble
  6216. +
  6217. +#define ar9462_2p1_radio_postamble_sys2ant ar9462_2p0_radio_postamble_sys2ant
  6218. +
  6219. +#define ar9462_2p1_common_rx_gain ar9462_2p0_common_rx_gain
  6220. +
  6221. +#define ar9462_2p1_common_mixed_rx_gain ar9462_2p0_common_mixed_rx_gain
  6222. +
  6223. +#define ar9462_2p1_common_5g_xlna_only_rxgain ar9462_2p0_common_5g_xlna_only_rxgain
  6224. +
  6225. +#define ar9462_2p1_baseband_core_mix_rxgain ar9462_2p0_baseband_core_mix_rxgain
  6226. +
  6227. +#define ar9462_2p1_baseband_postamble_mix_rxgain ar9462_2p0_baseband_postamble_mix_rxgain
  6228. +
  6229. +#define ar9462_2p1_baseband_postamble_5g_xlna ar9462_2p0_baseband_postamble_5g_xlna
  6230. +
  6231. +#define ar9462_2p1_common_wo_xlna_rx_gain ar9462_2p0_common_wo_xlna_rx_gain
  6232. +
  6233. +#define ar9462_2p1_modes_low_ob_db_tx_gain ar9462_2p0_modes_low_ob_db_tx_gain
  6234. +
  6235. +#define ar9462_2p1_modes_high_ob_db_tx_gain ar9462_2p0_modes_high_ob_db_tx_gain
  6236. +
  6237. +#define ar9462_2p1_modes_mix_ob_db_tx_gain ar9462_2p0_modes_mix_ob_db_tx_gain
  6238. +
  6239. +#define ar9462_2p1_modes_fast_clock ar9462_2p0_modes_fast_clock
  6240. +
  6241. +#define ar9462_2p1_baseband_core_txfir_coeff_japan_2484 ar9462_2p0_baseband_core_txfir_coeff_japan_2484
  6242. +
  6243. +#define ar9462_2p1_pciephy_clkreq_disable_L1 ar9462_2p0_pciephy_clkreq_disable_L1
  6244. +
  6245. static const u32 ar9462_2p1_mac_core[][2] = {
  6246. /* Addr allmodes */
  6247. {0x00000008, 0x00000000},
  6248. @@ -183,168 +221,6 @@ static const u32 ar9462_2p1_mac_core[][2
  6249. {0x000083d0, 0x000301ff},
  6250. };
  6251. -static const u32 ar9462_2p1_mac_postamble[][5] = {
  6252. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  6253. - {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
  6254. - {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
  6255. - {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
  6256. - {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
  6257. - {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
  6258. - {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
  6259. - {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
  6260. - {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
  6261. -};
  6262. -
  6263. -static const u32 ar9462_2p1_baseband_core[][2] = {
  6264. - /* Addr allmodes */
  6265. - {0x00009800, 0xafe68e30},
  6266. - {0x00009804, 0xfd14e000},
  6267. - {0x00009808, 0x9c0a9f6b},
  6268. - {0x0000980c, 0x04900000},
  6269. - {0x00009814, 0x9280c00a},
  6270. - {0x00009818, 0x00000000},
  6271. - {0x0000981c, 0x00020028},
  6272. - {0x00009834, 0x6400a290},
  6273. - {0x00009838, 0x0108ecff},
  6274. - {0x0000983c, 0x0d000600},
  6275. - {0x00009880, 0x201fff00},
  6276. - {0x00009884, 0x00001042},
  6277. - {0x000098a4, 0x00200400},
  6278. - {0x000098b0, 0x32440bbe},
  6279. - {0x000098d0, 0x004b6a8e},
  6280. - {0x000098d4, 0x00000820},
  6281. - {0x000098dc, 0x00000000},
  6282. - {0x000098e4, 0x01ffffff},
  6283. - {0x000098e8, 0x01ffffff},
  6284. - {0x000098ec, 0x01ffffff},
  6285. - {0x000098f0, 0x00000000},
  6286. - {0x000098f4, 0x00000000},
  6287. - {0x00009bf0, 0x80000000},
  6288. - {0x00009c04, 0xff55ff55},
  6289. - {0x00009c08, 0x0320ff55},
  6290. - {0x00009c0c, 0x00000000},
  6291. - {0x00009c10, 0x00000000},
  6292. - {0x00009c14, 0x00046384},
  6293. - {0x00009c18, 0x05b6b440},
  6294. - {0x00009c1c, 0x00b6b440},
  6295. - {0x00009d00, 0xc080a333},
  6296. - {0x00009d04, 0x40206c10},
  6297. - {0x00009d08, 0x009c4060},
  6298. - {0x00009d0c, 0x9883800a},
  6299. - {0x00009d10, 0x01834061},
  6300. - {0x00009d14, 0x00c0040b},
  6301. - {0x00009d18, 0x00000000},
  6302. - {0x00009e08, 0x0038230c},
  6303. - {0x00009e24, 0x990bb515},
  6304. - {0x00009e28, 0x0c6f0000},
  6305. - {0x00009e30, 0x06336f77},
  6306. - {0x00009e34, 0x6af6532f},
  6307. - {0x00009e38, 0x0cc80c00},
  6308. - {0x00009e40, 0x15262820},
  6309. - {0x00009e4c, 0x00001004},
  6310. - {0x00009e50, 0x00ff03f1},
  6311. - {0x00009e54, 0xe4c555c2},
  6312. - {0x00009e58, 0xfd857722},
  6313. - {0x00009e5c, 0xe9198724},
  6314. - {0x00009fc0, 0x803e4788},
  6315. - {0x00009fc4, 0x0001efb5},
  6316. - {0x00009fcc, 0x40000014},
  6317. - {0x00009fd0, 0x0a193b93},
  6318. - {0x0000a20c, 0x00000000},
  6319. - {0x0000a220, 0x00000000},
  6320. - {0x0000a224, 0x00000000},
  6321. - {0x0000a228, 0x10002310},
  6322. - {0x0000a23c, 0x00000000},
  6323. - {0x0000a244, 0x0c000000},
  6324. - {0x0000a2a0, 0x00000001},
  6325. - {0x0000a2c0, 0x00000001},
  6326. - {0x0000a2c8, 0x00000000},
  6327. - {0x0000a2cc, 0x18c43433},
  6328. - {0x0000a2d4, 0x00000000},
  6329. - {0x0000a2ec, 0x00000000},
  6330. - {0x0000a2f0, 0x00000000},
  6331. - {0x0000a2f4, 0x00000000},
  6332. - {0x0000a2f8, 0x00000000},
  6333. - {0x0000a344, 0x00000000},
  6334. - {0x0000a34c, 0x00000000},
  6335. - {0x0000a350, 0x0000a000},
  6336. - {0x0000a364, 0x00000000},
  6337. - {0x0000a370, 0x00000000},
  6338. - {0x0000a390, 0x00000001},
  6339. - {0x0000a394, 0x00000444},
  6340. - {0x0000a398, 0x001f0e0f},
  6341. - {0x0000a39c, 0x0075393f},
  6342. - {0x0000a3a0, 0xb79f6427},
  6343. - {0x0000a3c0, 0x20202020},
  6344. - {0x0000a3c4, 0x22222220},
  6345. - {0x0000a3c8, 0x20200020},
  6346. - {0x0000a3cc, 0x20202020},
  6347. - {0x0000a3d0, 0x20202020},
  6348. - {0x0000a3d4, 0x20202020},
  6349. - {0x0000a3d8, 0x20202020},
  6350. - {0x0000a3dc, 0x20202020},
  6351. - {0x0000a3e0, 0x20202020},
  6352. - {0x0000a3e4, 0x20202020},
  6353. - {0x0000a3e8, 0x20202020},
  6354. - {0x0000a3ec, 0x20202020},
  6355. - {0x0000a3f0, 0x00000000},
  6356. - {0x0000a3f4, 0x00000006},
  6357. - {0x0000a3f8, 0x0c9bd380},
  6358. - {0x0000a3fc, 0x000f0f01},
  6359. - {0x0000a400, 0x8fa91f01},
  6360. - {0x0000a404, 0x00000000},
  6361. - {0x0000a408, 0x0e79e5c6},
  6362. - {0x0000a40c, 0x00820820},
  6363. - {0x0000a414, 0x1ce739ce},
  6364. - {0x0000a418, 0x2d001dce},
  6365. - {0x0000a434, 0x00000000},
  6366. - {0x0000a438, 0x00001801},
  6367. - {0x0000a43c, 0x00100000},
  6368. - {0x0000a444, 0x00000000},
  6369. - {0x0000a448, 0x05000080},
  6370. - {0x0000a44c, 0x00000001},
  6371. - {0x0000a450, 0x00010000},
  6372. - {0x0000a454, 0x07000000},
  6373. - {0x0000a644, 0xbfad9d74},
  6374. - {0x0000a648, 0x0048060a},
  6375. - {0x0000a64c, 0x00002037},
  6376. - {0x0000a670, 0x03020100},
  6377. - {0x0000a674, 0x09080504},
  6378. - {0x0000a678, 0x0d0c0b0a},
  6379. - {0x0000a67c, 0x13121110},
  6380. - {0x0000a680, 0x31301514},
  6381. - {0x0000a684, 0x35343332},
  6382. - {0x0000a688, 0x00000036},
  6383. - {0x0000a690, 0x00000838},
  6384. - {0x0000a6b0, 0x0000000a},
  6385. - {0x0000a6b4, 0x00512c01},
  6386. - {0x0000a7c0, 0x00000000},
  6387. - {0x0000a7c4, 0xfffffffc},
  6388. - {0x0000a7c8, 0x00000000},
  6389. - {0x0000a7cc, 0x00000000},
  6390. - {0x0000a7d0, 0x00000000},
  6391. - {0x0000a7d4, 0x00000004},
  6392. - {0x0000a7dc, 0x00000000},
  6393. - {0x0000a7f0, 0x80000000},
  6394. - {0x0000a8d0, 0x004b6a8e},
  6395. - {0x0000a8d4, 0x00000820},
  6396. - {0x0000a8dc, 0x00000000},
  6397. - {0x0000a8f0, 0x00000000},
  6398. - {0x0000a8f4, 0x00000000},
  6399. - {0x0000abf0, 0x80000000},
  6400. - {0x0000b2d0, 0x00000080},
  6401. - {0x0000b2d4, 0x00000000},
  6402. - {0x0000b2ec, 0x00000000},
  6403. - {0x0000b2f0, 0x00000000},
  6404. - {0x0000b2f4, 0x00000000},
  6405. - {0x0000b2f8, 0x00000000},
  6406. - {0x0000b408, 0x0e79e5c0},
  6407. - {0x0000b40c, 0x00820820},
  6408. - {0x0000b420, 0x00000000},
  6409. - {0x0000b6b0, 0x0000000a},
  6410. - {0x0000b6b4, 0x00000001},
  6411. -};
  6412. -
  6413. static const u32 ar9462_2p1_baseband_postamble[][5] = {
  6414. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  6415. {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a800d},
  6416. @@ -361,7 +237,7 @@ static const u32 ar9462_2p1_baseband_pos
  6417. {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32365a5e},
  6418. {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  6419. {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
  6420. - {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
  6421. + {0x00009e20, 0x000003a5, 0x000003a5, 0x000003a5, 0x000003a5},
  6422. {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021},
  6423. {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
  6424. {0x00009e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27},
  6425. @@ -400,1375 +276,16 @@ static const u32 ar9462_2p1_baseband_pos
  6426. {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000},
  6427. {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  6428. {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
  6429. - {0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce},
  6430. + {0x0000ae20, 0x000001a6, 0x000001a6, 0x000001aa, 0x000001aa},
  6431. {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550},
  6432. };
  6433. -static const u32 ar9462_2p1_radio_core[][2] = {
  6434. - /* Addr allmodes */
  6435. - {0x00016000, 0x36db6db6},
  6436. - {0x00016004, 0x6db6db40},
  6437. - {0x00016008, 0x73f00000},
  6438. - {0x0001600c, 0x00000000},
  6439. - {0x00016010, 0x6d820001},
  6440. - {0x00016040, 0x7f80fff8},
  6441. - {0x0001604c, 0x2699e04f},
  6442. - {0x00016050, 0x6db6db6c},
  6443. - {0x00016058, 0x6c200000},
  6444. - {0x00016080, 0x000c0000},
  6445. - {0x00016084, 0x9a68048c},
  6446. - {0x00016088, 0x54214514},
  6447. - {0x0001608c, 0x1203040b},
  6448. - {0x00016090, 0x24926490},
  6449. - {0x00016098, 0xd2888888},
  6450. - {0x000160a0, 0x0a108ffe},
  6451. - {0x000160a4, 0x812fc491},
  6452. - {0x000160a8, 0x423c8000},
  6453. - {0x000160b4, 0x92000000},
  6454. - {0x000160b8, 0x0285dddc},
  6455. - {0x000160bc, 0x02908888},
  6456. - {0x000160c0, 0x00adb6d0},
  6457. - {0x000160c4, 0x6db6db60},
  6458. - {0x000160c8, 0x6db6db6c},
  6459. - {0x000160cc, 0x0de6c1b0},
  6460. - {0x00016100, 0x3fffbe04},
  6461. - {0x00016104, 0xfff80000},
  6462. - {0x00016108, 0x00200400},
  6463. - {0x00016110, 0x00000000},
  6464. - {0x00016144, 0x02084080},
  6465. - {0x00016148, 0x000080c0},
  6466. - {0x00016280, 0x050a0001},
  6467. - {0x00016284, 0x3d841418},
  6468. - {0x00016288, 0x00000000},
  6469. - {0x0001628c, 0xe3000000},
  6470. - {0x00016290, 0xa1005080},
  6471. - {0x00016294, 0x00000020},
  6472. - {0x00016298, 0x54a82900},
  6473. - {0x00016340, 0x121e4276},
  6474. - {0x00016344, 0x00300000},
  6475. - {0x00016400, 0x36db6db6},
  6476. - {0x00016404, 0x6db6db40},
  6477. - {0x00016408, 0x73f00000},
  6478. - {0x0001640c, 0x00000000},
  6479. - {0x00016410, 0x6c800001},
  6480. - {0x00016440, 0x7f80fff8},
  6481. - {0x0001644c, 0x4699e04f},
  6482. - {0x00016450, 0x6db6db6c},
  6483. - {0x00016500, 0x3fffbe04},
  6484. - {0x00016504, 0xfff80000},
  6485. - {0x00016508, 0x00200400},
  6486. - {0x00016510, 0x00000000},
  6487. - {0x00016544, 0x02084080},
  6488. - {0x00016548, 0x000080c0},
  6489. -};
  6490. -
  6491. -static const u32 ar9462_2p1_radio_postamble[][5] = {
  6492. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  6493. - {0x0001609c, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524},
  6494. - {0x000160b0, 0x01d67f70, 0x01d67f70, 0x01d67f70, 0x01d67f70},
  6495. - {0x0001610c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
  6496. - {0x0001650c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
  6497. -};
  6498. -
  6499. static const u32 ar9462_2p1_soc_preamble[][2] = {
  6500. /* Addr allmodes */
  6501. - {0x000040a4, 0x00a0c1c9},
  6502. + {0x000040a4, 0x00a0c9c9},
  6503. {0x00007020, 0x00000000},
  6504. {0x00007034, 0x00000002},
  6505. {0x00007038, 0x000004c2},
  6506. };
  6507. -static const u32 ar9462_2p1_soc_postamble[][5] = {
  6508. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  6509. - {0x00007010, 0x00000033, 0x00000033, 0x00000033, 0x00000033},
  6510. -};
  6511. -
  6512. -static const u32 ar9462_2p1_radio_postamble_sys2ant[][5] = {
  6513. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  6514. - {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24645808, 0x24645808},
  6515. - {0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
  6516. - {0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
  6517. -};
  6518. -
  6519. -static const u32 ar9462_2p1_common_rx_gain[][2] = {
  6520. - /* Addr allmodes */
  6521. - {0x0000a000, 0x00010000},
  6522. - {0x0000a004, 0x00030002},
  6523. - {0x0000a008, 0x00050004},
  6524. - {0x0000a00c, 0x00810080},
  6525. - {0x0000a010, 0x00830082},
  6526. - {0x0000a014, 0x01810180},
  6527. - {0x0000a018, 0x01830182},
  6528. - {0x0000a01c, 0x01850184},
  6529. - {0x0000a020, 0x01890188},
  6530. - {0x0000a024, 0x018b018a},
  6531. - {0x0000a028, 0x018d018c},
  6532. - {0x0000a02c, 0x01910190},
  6533. - {0x0000a030, 0x01930192},
  6534. - {0x0000a034, 0x01950194},
  6535. - {0x0000a038, 0x038a0196},
  6536. - {0x0000a03c, 0x038c038b},
  6537. - {0x0000a040, 0x0390038d},
  6538. - {0x0000a044, 0x03920391},
  6539. - {0x0000a048, 0x03940393},
  6540. - {0x0000a04c, 0x03960395},
  6541. - {0x0000a050, 0x00000000},
  6542. - {0x0000a054, 0x00000000},
  6543. - {0x0000a058, 0x00000000},
  6544. - {0x0000a05c, 0x00000000},
  6545. - {0x0000a060, 0x00000000},
  6546. - {0x0000a064, 0x00000000},
  6547. - {0x0000a068, 0x00000000},
  6548. - {0x0000a06c, 0x00000000},
  6549. - {0x0000a070, 0x00000000},
  6550. - {0x0000a074, 0x00000000},
  6551. - {0x0000a078, 0x00000000},
  6552. - {0x0000a07c, 0x00000000},
  6553. - {0x0000a080, 0x22222229},
  6554. - {0x0000a084, 0x1d1d1d1d},
  6555. - {0x0000a088, 0x1d1d1d1d},
  6556. - {0x0000a08c, 0x1d1d1d1d},
  6557. - {0x0000a090, 0x171d1d1d},
  6558. - {0x0000a094, 0x11111717},
  6559. - {0x0000a098, 0x00030311},
  6560. - {0x0000a09c, 0x00000000},
  6561. - {0x0000a0a0, 0x00000000},
  6562. - {0x0000a0a4, 0x00000000},
  6563. - {0x0000a0a8, 0x00000000},
  6564. - {0x0000a0ac, 0x00000000},
  6565. - {0x0000a0b0, 0x00000000},
  6566. - {0x0000a0b4, 0x00000000},
  6567. - {0x0000a0b8, 0x00000000},
  6568. - {0x0000a0bc, 0x00000000},
  6569. - {0x0000a0c0, 0x001f0000},
  6570. - {0x0000a0c4, 0x01000101},
  6571. - {0x0000a0c8, 0x011e011f},
  6572. - {0x0000a0cc, 0x011c011d},
  6573. - {0x0000a0d0, 0x02030204},
  6574. - {0x0000a0d4, 0x02010202},
  6575. - {0x0000a0d8, 0x021f0200},
  6576. - {0x0000a0dc, 0x0302021e},
  6577. - {0x0000a0e0, 0x03000301},
  6578. - {0x0000a0e4, 0x031e031f},
  6579. - {0x0000a0e8, 0x0402031d},
  6580. - {0x0000a0ec, 0x04000401},
  6581. - {0x0000a0f0, 0x041e041f},
  6582. - {0x0000a0f4, 0x0502041d},
  6583. - {0x0000a0f8, 0x05000501},
  6584. - {0x0000a0fc, 0x051e051f},
  6585. - {0x0000a100, 0x06010602},
  6586. - {0x0000a104, 0x061f0600},
  6587. - {0x0000a108, 0x061d061e},
  6588. - {0x0000a10c, 0x07020703},
  6589. - {0x0000a110, 0x07000701},
  6590. - {0x0000a114, 0x00000000},
  6591. - {0x0000a118, 0x00000000},
  6592. - {0x0000a11c, 0x00000000},
  6593. - {0x0000a120, 0x00000000},
  6594. - {0x0000a124, 0x00000000},
  6595. - {0x0000a128, 0x00000000},
  6596. - {0x0000a12c, 0x00000000},
  6597. - {0x0000a130, 0x00000000},
  6598. - {0x0000a134, 0x00000000},
  6599. - {0x0000a138, 0x00000000},
  6600. - {0x0000a13c, 0x00000000},
  6601. - {0x0000a140, 0x001f0000},
  6602. - {0x0000a144, 0x01000101},
  6603. - {0x0000a148, 0x011e011f},
  6604. - {0x0000a14c, 0x011c011d},
  6605. - {0x0000a150, 0x02030204},
  6606. - {0x0000a154, 0x02010202},
  6607. - {0x0000a158, 0x021f0200},
  6608. - {0x0000a15c, 0x0302021e},
  6609. - {0x0000a160, 0x03000301},
  6610. - {0x0000a164, 0x031e031f},
  6611. - {0x0000a168, 0x0402031d},
  6612. - {0x0000a16c, 0x04000401},
  6613. - {0x0000a170, 0x041e041f},
  6614. - {0x0000a174, 0x0502041d},
  6615. - {0x0000a178, 0x05000501},
  6616. - {0x0000a17c, 0x051e051f},
  6617. - {0x0000a180, 0x06010602},
  6618. - {0x0000a184, 0x061f0600},
  6619. - {0x0000a188, 0x061d061e},
  6620. - {0x0000a18c, 0x07020703},
  6621. - {0x0000a190, 0x07000701},
  6622. - {0x0000a194, 0x00000000},
  6623. - {0x0000a198, 0x00000000},
  6624. - {0x0000a19c, 0x00000000},
  6625. - {0x0000a1a0, 0x00000000},
  6626. - {0x0000a1a4, 0x00000000},
  6627. - {0x0000a1a8, 0x00000000},
  6628. - {0x0000a1ac, 0x00000000},
  6629. - {0x0000a1b0, 0x00000000},
  6630. - {0x0000a1b4, 0x00000000},
  6631. - {0x0000a1b8, 0x00000000},
  6632. - {0x0000a1bc, 0x00000000},
  6633. - {0x0000a1c0, 0x00000000},
  6634. - {0x0000a1c4, 0x00000000},
  6635. - {0x0000a1c8, 0x00000000},
  6636. - {0x0000a1cc, 0x00000000},
  6637. - {0x0000a1d0, 0x00000000},
  6638. - {0x0000a1d4, 0x00000000},
  6639. - {0x0000a1d8, 0x00000000},
  6640. - {0x0000a1dc, 0x00000000},
  6641. - {0x0000a1e0, 0x00000000},
  6642. - {0x0000a1e4, 0x00000000},
  6643. - {0x0000a1e8, 0x00000000},
  6644. - {0x0000a1ec, 0x00000000},
  6645. - {0x0000a1f0, 0x00000396},
  6646. - {0x0000a1f4, 0x00000396},
  6647. - {0x0000a1f8, 0x00000396},
  6648. - {0x0000a1fc, 0x00000196},
  6649. - {0x0000b000, 0x00010000},
  6650. - {0x0000b004, 0x00030002},
  6651. - {0x0000b008, 0x00050004},
  6652. - {0x0000b00c, 0x00810080},
  6653. - {0x0000b010, 0x00830082},
  6654. - {0x0000b014, 0x01810180},
  6655. - {0x0000b018, 0x01830182},
  6656. - {0x0000b01c, 0x01850184},
  6657. - {0x0000b020, 0x02810280},
  6658. - {0x0000b024, 0x02830282},
  6659. - {0x0000b028, 0x02850284},
  6660. - {0x0000b02c, 0x02890288},
  6661. - {0x0000b030, 0x028b028a},
  6662. - {0x0000b034, 0x0388028c},
  6663. - {0x0000b038, 0x038a0389},
  6664. - {0x0000b03c, 0x038c038b},
  6665. - {0x0000b040, 0x0390038d},
  6666. - {0x0000b044, 0x03920391},
  6667. - {0x0000b048, 0x03940393},
  6668. - {0x0000b04c, 0x03960395},
  6669. - {0x0000b050, 0x00000000},
  6670. - {0x0000b054, 0x00000000},
  6671. - {0x0000b058, 0x00000000},
  6672. - {0x0000b05c, 0x00000000},
  6673. - {0x0000b060, 0x00000000},
  6674. - {0x0000b064, 0x00000000},
  6675. - {0x0000b068, 0x00000000},
  6676. - {0x0000b06c, 0x00000000},
  6677. - {0x0000b070, 0x00000000},
  6678. - {0x0000b074, 0x00000000},
  6679. - {0x0000b078, 0x00000000},
  6680. - {0x0000b07c, 0x00000000},
  6681. - {0x0000b080, 0x2a2d2f32},
  6682. - {0x0000b084, 0x21232328},
  6683. - {0x0000b088, 0x19191c1e},
  6684. - {0x0000b08c, 0x12141417},
  6685. - {0x0000b090, 0x07070e0e},
  6686. - {0x0000b094, 0x03030305},
  6687. - {0x0000b098, 0x00000003},
  6688. - {0x0000b09c, 0x00000000},
  6689. - {0x0000b0a0, 0x00000000},
  6690. - {0x0000b0a4, 0x00000000},
  6691. - {0x0000b0a8, 0x00000000},
  6692. - {0x0000b0ac, 0x00000000},
  6693. - {0x0000b0b0, 0x00000000},
  6694. - {0x0000b0b4, 0x00000000},
  6695. - {0x0000b0b8, 0x00000000},
  6696. - {0x0000b0bc, 0x00000000},
  6697. - {0x0000b0c0, 0x003f0020},
  6698. - {0x0000b0c4, 0x00400041},
  6699. - {0x0000b0c8, 0x0140005f},
  6700. - {0x0000b0cc, 0x0160015f},
  6701. - {0x0000b0d0, 0x017e017f},
  6702. - {0x0000b0d4, 0x02410242},
  6703. - {0x0000b0d8, 0x025f0240},
  6704. - {0x0000b0dc, 0x027f0260},
  6705. - {0x0000b0e0, 0x0341027e},
  6706. - {0x0000b0e4, 0x035f0340},
  6707. - {0x0000b0e8, 0x037f0360},
  6708. - {0x0000b0ec, 0x04400441},
  6709. - {0x0000b0f0, 0x0460045f},
  6710. - {0x0000b0f4, 0x0541047f},
  6711. - {0x0000b0f8, 0x055f0540},
  6712. - {0x0000b0fc, 0x057f0560},
  6713. - {0x0000b100, 0x06400641},
  6714. - {0x0000b104, 0x0660065f},
  6715. - {0x0000b108, 0x067e067f},
  6716. - {0x0000b10c, 0x07410742},
  6717. - {0x0000b110, 0x075f0740},
  6718. - {0x0000b114, 0x077f0760},
  6719. - {0x0000b118, 0x07800781},
  6720. - {0x0000b11c, 0x07a0079f},
  6721. - {0x0000b120, 0x07c107bf},
  6722. - {0x0000b124, 0x000007c0},
  6723. - {0x0000b128, 0x00000000},
  6724. - {0x0000b12c, 0x00000000},
  6725. - {0x0000b130, 0x00000000},
  6726. - {0x0000b134, 0x00000000},
  6727. - {0x0000b138, 0x00000000},
  6728. - {0x0000b13c, 0x00000000},
  6729. - {0x0000b140, 0x003f0020},
  6730. - {0x0000b144, 0x00400041},
  6731. - {0x0000b148, 0x0140005f},
  6732. - {0x0000b14c, 0x0160015f},
  6733. - {0x0000b150, 0x017e017f},
  6734. - {0x0000b154, 0x02410242},
  6735. - {0x0000b158, 0x025f0240},
  6736. - {0x0000b15c, 0x027f0260},
  6737. - {0x0000b160, 0x0341027e},
  6738. - {0x0000b164, 0x035f0340},
  6739. - {0x0000b168, 0x037f0360},
  6740. - {0x0000b16c, 0x04400441},
  6741. - {0x0000b170, 0x0460045f},
  6742. - {0x0000b174, 0x0541047f},
  6743. - {0x0000b178, 0x055f0540},
  6744. - {0x0000b17c, 0x057f0560},
  6745. - {0x0000b180, 0x06400641},
  6746. - {0x0000b184, 0x0660065f},
  6747. - {0x0000b188, 0x067e067f},
  6748. - {0x0000b18c, 0x07410742},
  6749. - {0x0000b190, 0x075f0740},
  6750. - {0x0000b194, 0x077f0760},
  6751. - {0x0000b198, 0x07800781},
  6752. - {0x0000b19c, 0x07a0079f},
  6753. - {0x0000b1a0, 0x07c107bf},
  6754. - {0x0000b1a4, 0x000007c0},
  6755. - {0x0000b1a8, 0x00000000},
  6756. - {0x0000b1ac, 0x00000000},
  6757. - {0x0000b1b0, 0x00000000},
  6758. - {0x0000b1b4, 0x00000000},
  6759. - {0x0000b1b8, 0x00000000},
  6760. - {0x0000b1bc, 0x00000000},
  6761. - {0x0000b1c0, 0x00000000},
  6762. - {0x0000b1c4, 0x00000000},
  6763. - {0x0000b1c8, 0x00000000},
  6764. - {0x0000b1cc, 0x00000000},
  6765. - {0x0000b1d0, 0x00000000},
  6766. - {0x0000b1d4, 0x00000000},
  6767. - {0x0000b1d8, 0x00000000},
  6768. - {0x0000b1dc, 0x00000000},
  6769. - {0x0000b1e0, 0x00000000},
  6770. - {0x0000b1e4, 0x00000000},
  6771. - {0x0000b1e8, 0x00000000},
  6772. - {0x0000b1ec, 0x00000000},
  6773. - {0x0000b1f0, 0x00000396},
  6774. - {0x0000b1f4, 0x00000396},
  6775. - {0x0000b1f8, 0x00000396},
  6776. - {0x0000b1fc, 0x00000196},
  6777. -};
  6778. -
  6779. -static const u32 ar9462_2p1_common_mixed_rx_gain[][2] = {
  6780. - /* Addr allmodes */
  6781. - {0x0000a000, 0x00010000},
  6782. - {0x0000a004, 0x00030002},
  6783. - {0x0000a008, 0x00050004},
  6784. - {0x0000a00c, 0x00810080},
  6785. - {0x0000a010, 0x00830082},
  6786. - {0x0000a014, 0x01810180},
  6787. - {0x0000a018, 0x01830182},
  6788. - {0x0000a01c, 0x01850184},
  6789. - {0x0000a020, 0x01890188},
  6790. - {0x0000a024, 0x018b018a},
  6791. - {0x0000a028, 0x018d018c},
  6792. - {0x0000a02c, 0x03820190},
  6793. - {0x0000a030, 0x03840383},
  6794. - {0x0000a034, 0x03880385},
  6795. - {0x0000a038, 0x038a0389},
  6796. - {0x0000a03c, 0x038c038b},
  6797. - {0x0000a040, 0x0390038d},
  6798. - {0x0000a044, 0x03920391},
  6799. - {0x0000a048, 0x03940393},
  6800. - {0x0000a04c, 0x03960395},
  6801. - {0x0000a050, 0x00000000},
  6802. - {0x0000a054, 0x00000000},
  6803. - {0x0000a058, 0x00000000},
  6804. - {0x0000a05c, 0x00000000},
  6805. - {0x0000a060, 0x00000000},
  6806. - {0x0000a064, 0x00000000},
  6807. - {0x0000a068, 0x00000000},
  6808. - {0x0000a06c, 0x00000000},
  6809. - {0x0000a070, 0x00000000},
  6810. - {0x0000a074, 0x00000000},
  6811. - {0x0000a078, 0x00000000},
  6812. - {0x0000a07c, 0x00000000},
  6813. - {0x0000a080, 0x29292929},
  6814. - {0x0000a084, 0x29292929},
  6815. - {0x0000a088, 0x29292929},
  6816. - {0x0000a08c, 0x29292929},
  6817. - {0x0000a090, 0x22292929},
  6818. - {0x0000a094, 0x1d1d2222},
  6819. - {0x0000a098, 0x0c111117},
  6820. - {0x0000a09c, 0x00030303},
  6821. - {0x0000a0a0, 0x00000000},
  6822. - {0x0000a0a4, 0x00000000},
  6823. - {0x0000a0a8, 0x00000000},
  6824. - {0x0000a0ac, 0x00000000},
  6825. - {0x0000a0b0, 0x00000000},
  6826. - {0x0000a0b4, 0x00000000},
  6827. - {0x0000a0b8, 0x00000000},
  6828. - {0x0000a0bc, 0x00000000},
  6829. - {0x0000a0c0, 0x001f0000},
  6830. - {0x0000a0c4, 0x01000101},
  6831. - {0x0000a0c8, 0x011e011f},
  6832. - {0x0000a0cc, 0x011c011d},
  6833. - {0x0000a0d0, 0x02030204},
  6834. - {0x0000a0d4, 0x02010202},
  6835. - {0x0000a0d8, 0x021f0200},
  6836. - {0x0000a0dc, 0x0302021e},
  6837. - {0x0000a0e0, 0x03000301},
  6838. - {0x0000a0e4, 0x031e031f},
  6839. - {0x0000a0e8, 0x0402031d},
  6840. - {0x0000a0ec, 0x04000401},
  6841. - {0x0000a0f0, 0x041e041f},
  6842. - {0x0000a0f4, 0x0502041d},
  6843. - {0x0000a0f8, 0x05000501},
  6844. - {0x0000a0fc, 0x051e051f},
  6845. - {0x0000a100, 0x06010602},
  6846. - {0x0000a104, 0x061f0600},
  6847. - {0x0000a108, 0x061d061e},
  6848. - {0x0000a10c, 0x07020703},
  6849. - {0x0000a110, 0x07000701},
  6850. - {0x0000a114, 0x00000000},
  6851. - {0x0000a118, 0x00000000},
  6852. - {0x0000a11c, 0x00000000},
  6853. - {0x0000a120, 0x00000000},
  6854. - {0x0000a124, 0x00000000},
  6855. - {0x0000a128, 0x00000000},
  6856. - {0x0000a12c, 0x00000000},
  6857. - {0x0000a130, 0x00000000},
  6858. - {0x0000a134, 0x00000000},
  6859. - {0x0000a138, 0x00000000},
  6860. - {0x0000a13c, 0x00000000},
  6861. - {0x0000a140, 0x001f0000},
  6862. - {0x0000a144, 0x01000101},
  6863. - {0x0000a148, 0x011e011f},
  6864. - {0x0000a14c, 0x011c011d},
  6865. - {0x0000a150, 0x02030204},
  6866. - {0x0000a154, 0x02010202},
  6867. - {0x0000a158, 0x021f0200},
  6868. - {0x0000a15c, 0x0302021e},
  6869. - {0x0000a160, 0x03000301},
  6870. - {0x0000a164, 0x031e031f},
  6871. - {0x0000a168, 0x0402031d},
  6872. - {0x0000a16c, 0x04000401},
  6873. - {0x0000a170, 0x041e041f},
  6874. - {0x0000a174, 0x0502041d},
  6875. - {0x0000a178, 0x05000501},
  6876. - {0x0000a17c, 0x051e051f},
  6877. - {0x0000a180, 0x06010602},
  6878. - {0x0000a184, 0x061f0600},
  6879. - {0x0000a188, 0x061d061e},
  6880. - {0x0000a18c, 0x07020703},
  6881. - {0x0000a190, 0x07000701},
  6882. - {0x0000a194, 0x00000000},
  6883. - {0x0000a198, 0x00000000},
  6884. - {0x0000a19c, 0x00000000},
  6885. - {0x0000a1a0, 0x00000000},
  6886. - {0x0000a1a4, 0x00000000},
  6887. - {0x0000a1a8, 0x00000000},
  6888. - {0x0000a1ac, 0x00000000},
  6889. - {0x0000a1b0, 0x00000000},
  6890. - {0x0000a1b4, 0x00000000},
  6891. - {0x0000a1b8, 0x00000000},
  6892. - {0x0000a1bc, 0x00000000},
  6893. - {0x0000a1c0, 0x00000000},
  6894. - {0x0000a1c4, 0x00000000},
  6895. - {0x0000a1c8, 0x00000000},
  6896. - {0x0000a1cc, 0x00000000},
  6897. - {0x0000a1d0, 0x00000000},
  6898. - {0x0000a1d4, 0x00000000},
  6899. - {0x0000a1d8, 0x00000000},
  6900. - {0x0000a1dc, 0x00000000},
  6901. - {0x0000a1e0, 0x00000000},
  6902. - {0x0000a1e4, 0x00000000},
  6903. - {0x0000a1e8, 0x00000000},
  6904. - {0x0000a1ec, 0x00000000},
  6905. - {0x0000a1f0, 0x00000396},
  6906. - {0x0000a1f4, 0x00000396},
  6907. - {0x0000a1f8, 0x00000396},
  6908. - {0x0000a1fc, 0x00000196},
  6909. - {0x0000b000, 0x00010000},
  6910. - {0x0000b004, 0x00030002},
  6911. - {0x0000b008, 0x00050004},
  6912. - {0x0000b00c, 0x00810080},
  6913. - {0x0000b010, 0x00830082},
  6914. - {0x0000b014, 0x01810180},
  6915. - {0x0000b018, 0x01830182},
  6916. - {0x0000b01c, 0x01850184},
  6917. - {0x0000b020, 0x02810280},
  6918. - {0x0000b024, 0x02830282},
  6919. - {0x0000b028, 0x02850284},
  6920. - {0x0000b02c, 0x02890288},
  6921. - {0x0000b030, 0x028b028a},
  6922. - {0x0000b034, 0x0388028c},
  6923. - {0x0000b038, 0x038a0389},
  6924. - {0x0000b03c, 0x038c038b},
  6925. - {0x0000b040, 0x0390038d},
  6926. - {0x0000b044, 0x03920391},
  6927. - {0x0000b048, 0x03940393},
  6928. - {0x0000b04c, 0x03960395},
  6929. - {0x0000b050, 0x00000000},
  6930. - {0x0000b054, 0x00000000},
  6931. - {0x0000b058, 0x00000000},
  6932. - {0x0000b05c, 0x00000000},
  6933. - {0x0000b060, 0x00000000},
  6934. - {0x0000b064, 0x00000000},
  6935. - {0x0000b068, 0x00000000},
  6936. - {0x0000b06c, 0x00000000},
  6937. - {0x0000b070, 0x00000000},
  6938. - {0x0000b074, 0x00000000},
  6939. - {0x0000b078, 0x00000000},
  6940. - {0x0000b07c, 0x00000000},
  6941. - {0x0000b080, 0x2a2d2f32},
  6942. - {0x0000b084, 0x21232328},
  6943. - {0x0000b088, 0x19191c1e},
  6944. - {0x0000b08c, 0x12141417},
  6945. - {0x0000b090, 0x07070e0e},
  6946. - {0x0000b094, 0x03030305},
  6947. - {0x0000b098, 0x00000003},
  6948. - {0x0000b09c, 0x00000000},
  6949. - {0x0000b0a0, 0x00000000},
  6950. - {0x0000b0a4, 0x00000000},
  6951. - {0x0000b0a8, 0x00000000},
  6952. - {0x0000b0ac, 0x00000000},
  6953. - {0x0000b0b0, 0x00000000},
  6954. - {0x0000b0b4, 0x00000000},
  6955. - {0x0000b0b8, 0x00000000},
  6956. - {0x0000b0bc, 0x00000000},
  6957. - {0x0000b0c0, 0x003f0020},
  6958. - {0x0000b0c4, 0x00400041},
  6959. - {0x0000b0c8, 0x0140005f},
  6960. - {0x0000b0cc, 0x0160015f},
  6961. - {0x0000b0d0, 0x017e017f},
  6962. - {0x0000b0d4, 0x02410242},
  6963. - {0x0000b0d8, 0x025f0240},
  6964. - {0x0000b0dc, 0x027f0260},
  6965. - {0x0000b0e0, 0x0341027e},
  6966. - {0x0000b0e4, 0x035f0340},
  6967. - {0x0000b0e8, 0x037f0360},
  6968. - {0x0000b0ec, 0x04400441},
  6969. - {0x0000b0f0, 0x0460045f},
  6970. - {0x0000b0f4, 0x0541047f},
  6971. - {0x0000b0f8, 0x055f0540},
  6972. - {0x0000b0fc, 0x057f0560},
  6973. - {0x0000b100, 0x06400641},
  6974. - {0x0000b104, 0x0660065f},
  6975. - {0x0000b108, 0x067e067f},
  6976. - {0x0000b10c, 0x07410742},
  6977. - {0x0000b110, 0x075f0740},
  6978. - {0x0000b114, 0x077f0760},
  6979. - {0x0000b118, 0x07800781},
  6980. - {0x0000b11c, 0x07a0079f},
  6981. - {0x0000b120, 0x07c107bf},
  6982. - {0x0000b124, 0x000007c0},
  6983. - {0x0000b128, 0x00000000},
  6984. - {0x0000b12c, 0x00000000},
  6985. - {0x0000b130, 0x00000000},
  6986. - {0x0000b134, 0x00000000},
  6987. - {0x0000b138, 0x00000000},
  6988. - {0x0000b13c, 0x00000000},
  6989. - {0x0000b140, 0x003f0020},
  6990. - {0x0000b144, 0x00400041},
  6991. - {0x0000b148, 0x0140005f},
  6992. - {0x0000b14c, 0x0160015f},
  6993. - {0x0000b150, 0x017e017f},
  6994. - {0x0000b154, 0x02410242},
  6995. - {0x0000b158, 0x025f0240},
  6996. - {0x0000b15c, 0x027f0260},
  6997. - {0x0000b160, 0x0341027e},
  6998. - {0x0000b164, 0x035f0340},
  6999. - {0x0000b168, 0x037f0360},
  7000. - {0x0000b16c, 0x04400441},
  7001. - {0x0000b170, 0x0460045f},
  7002. - {0x0000b174, 0x0541047f},
  7003. - {0x0000b178, 0x055f0540},
  7004. - {0x0000b17c, 0x057f0560},
  7005. - {0x0000b180, 0x06400641},
  7006. - {0x0000b184, 0x0660065f},
  7007. - {0x0000b188, 0x067e067f},
  7008. - {0x0000b18c, 0x07410742},
  7009. - {0x0000b190, 0x075f0740},
  7010. - {0x0000b194, 0x077f0760},
  7011. - {0x0000b198, 0x07800781},
  7012. - {0x0000b19c, 0x07a0079f},
  7013. - {0x0000b1a0, 0x07c107bf},
  7014. - {0x0000b1a4, 0x000007c0},
  7015. - {0x0000b1a8, 0x00000000},
  7016. - {0x0000b1ac, 0x00000000},
  7017. - {0x0000b1b0, 0x00000000},
  7018. - {0x0000b1b4, 0x00000000},
  7019. - {0x0000b1b8, 0x00000000},
  7020. - {0x0000b1bc, 0x00000000},
  7021. - {0x0000b1c0, 0x00000000},
  7022. - {0x0000b1c4, 0x00000000},
  7023. - {0x0000b1c8, 0x00000000},
  7024. - {0x0000b1cc, 0x00000000},
  7025. - {0x0000b1d0, 0x00000000},
  7026. - {0x0000b1d4, 0x00000000},
  7027. - {0x0000b1d8, 0x00000000},
  7028. - {0x0000b1dc, 0x00000000},
  7029. - {0x0000b1e0, 0x00000000},
  7030. - {0x0000b1e4, 0x00000000},
  7031. - {0x0000b1e8, 0x00000000},
  7032. - {0x0000b1ec, 0x00000000},
  7033. - {0x0000b1f0, 0x00000396},
  7034. - {0x0000b1f4, 0x00000396},
  7035. - {0x0000b1f8, 0x00000396},
  7036. - {0x0000b1fc, 0x00000196},
  7037. -};
  7038. -
  7039. -static const u32 ar9462_2p1_baseband_core_mix_rxgain[][2] = {
  7040. - /* Addr allmodes */
  7041. - {0x00009fd0, 0x0a2d6b93},
  7042. -};
  7043. -
  7044. -static const u32 ar9462_2p1_baseband_postamble_mix_rxgain[][5] = {
  7045. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  7046. - {0x00009820, 0x206a022e, 0x206a022e, 0x206a01ae, 0x206a01ae},
  7047. - {0x00009824, 0x63c640de, 0x5ac640d0, 0x63c640da, 0x63c640da},
  7048. - {0x00009828, 0x0796be89, 0x0696b081, 0x0916be81, 0x0916be81},
  7049. - {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000d8, 0x6c4000d8},
  7050. - {0x00009e10, 0x92c88d2e, 0x7ec88d2e, 0x7ec86d2e, 0x7ec86d2e},
  7051. - {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32395c5e},
  7052. -};
  7053. -
  7054. -static const u32 ar9462_2p1_baseband_postamble_5g_xlna[][5] = {
  7055. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  7056. - {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
  7057. -};
  7058. -
  7059. -static const u32 ar9462_2p1_common_wo_xlna_rx_gain[][2] = {
  7060. - /* Addr allmodes */
  7061. - {0x0000a000, 0x00010000},
  7062. - {0x0000a004, 0x00030002},
  7063. - {0x0000a008, 0x00050004},
  7064. - {0x0000a00c, 0x00810080},
  7065. - {0x0000a010, 0x00830082},
  7066. - {0x0000a014, 0x01810180},
  7067. - {0x0000a018, 0x01830182},
  7068. - {0x0000a01c, 0x01850184},
  7069. - {0x0000a020, 0x01890188},
  7070. - {0x0000a024, 0x018b018a},
  7071. - {0x0000a028, 0x018d018c},
  7072. - {0x0000a02c, 0x03820190},
  7073. - {0x0000a030, 0x03840383},
  7074. - {0x0000a034, 0x03880385},
  7075. - {0x0000a038, 0x038a0389},
  7076. - {0x0000a03c, 0x038c038b},
  7077. - {0x0000a040, 0x0390038d},
  7078. - {0x0000a044, 0x03920391},
  7079. - {0x0000a048, 0x03940393},
  7080. - {0x0000a04c, 0x03960395},
  7081. - {0x0000a050, 0x00000000},
  7082. - {0x0000a054, 0x00000000},
  7083. - {0x0000a058, 0x00000000},
  7084. - {0x0000a05c, 0x00000000},
  7085. - {0x0000a060, 0x00000000},
  7086. - {0x0000a064, 0x00000000},
  7087. - {0x0000a068, 0x00000000},
  7088. - {0x0000a06c, 0x00000000},
  7089. - {0x0000a070, 0x00000000},
  7090. - {0x0000a074, 0x00000000},
  7091. - {0x0000a078, 0x00000000},
  7092. - {0x0000a07c, 0x00000000},
  7093. - {0x0000a080, 0x29292929},
  7094. - {0x0000a084, 0x29292929},
  7095. - {0x0000a088, 0x29292929},
  7096. - {0x0000a08c, 0x29292929},
  7097. - {0x0000a090, 0x22292929},
  7098. - {0x0000a094, 0x1d1d2222},
  7099. - {0x0000a098, 0x0c111117},
  7100. - {0x0000a09c, 0x00030303},
  7101. - {0x0000a0a0, 0x00000000},
  7102. - {0x0000a0a4, 0x00000000},
  7103. - {0x0000a0a8, 0x00000000},
  7104. - {0x0000a0ac, 0x00000000},
  7105. - {0x0000a0b0, 0x00000000},
  7106. - {0x0000a0b4, 0x00000000},
  7107. - {0x0000a0b8, 0x00000000},
  7108. - {0x0000a0bc, 0x00000000},
  7109. - {0x0000a0c0, 0x001f0000},
  7110. - {0x0000a0c4, 0x01000101},
  7111. - {0x0000a0c8, 0x011e011f},
  7112. - {0x0000a0cc, 0x011c011d},
  7113. - {0x0000a0d0, 0x02030204},
  7114. - {0x0000a0d4, 0x02010202},
  7115. - {0x0000a0d8, 0x021f0200},
  7116. - {0x0000a0dc, 0x0302021e},
  7117. - {0x0000a0e0, 0x03000301},
  7118. - {0x0000a0e4, 0x031e031f},
  7119. - {0x0000a0e8, 0x0402031d},
  7120. - {0x0000a0ec, 0x04000401},
  7121. - {0x0000a0f0, 0x041e041f},
  7122. - {0x0000a0f4, 0x0502041d},
  7123. - {0x0000a0f8, 0x05000501},
  7124. - {0x0000a0fc, 0x051e051f},
  7125. - {0x0000a100, 0x06010602},
  7126. - {0x0000a104, 0x061f0600},
  7127. - {0x0000a108, 0x061d061e},
  7128. - {0x0000a10c, 0x07020703},
  7129. - {0x0000a110, 0x07000701},
  7130. - {0x0000a114, 0x00000000},
  7131. - {0x0000a118, 0x00000000},
  7132. - {0x0000a11c, 0x00000000},
  7133. - {0x0000a120, 0x00000000},
  7134. - {0x0000a124, 0x00000000},
  7135. - {0x0000a128, 0x00000000},
  7136. - {0x0000a12c, 0x00000000},
  7137. - {0x0000a130, 0x00000000},
  7138. - {0x0000a134, 0x00000000},
  7139. - {0x0000a138, 0x00000000},
  7140. - {0x0000a13c, 0x00000000},
  7141. - {0x0000a140, 0x001f0000},
  7142. - {0x0000a144, 0x01000101},
  7143. - {0x0000a148, 0x011e011f},
  7144. - {0x0000a14c, 0x011c011d},
  7145. - {0x0000a150, 0x02030204},
  7146. - {0x0000a154, 0x02010202},
  7147. - {0x0000a158, 0x021f0200},
  7148. - {0x0000a15c, 0x0302021e},
  7149. - {0x0000a160, 0x03000301},
  7150. - {0x0000a164, 0x031e031f},
  7151. - {0x0000a168, 0x0402031d},
  7152. - {0x0000a16c, 0x04000401},
  7153. - {0x0000a170, 0x041e041f},
  7154. - {0x0000a174, 0x0502041d},
  7155. - {0x0000a178, 0x05000501},
  7156. - {0x0000a17c, 0x051e051f},
  7157. - {0x0000a180, 0x06010602},
  7158. - {0x0000a184, 0x061f0600},
  7159. - {0x0000a188, 0x061d061e},
  7160. - {0x0000a18c, 0x07020703},
  7161. - {0x0000a190, 0x07000701},
  7162. - {0x0000a194, 0x00000000},
  7163. - {0x0000a198, 0x00000000},
  7164. - {0x0000a19c, 0x00000000},
  7165. - {0x0000a1a0, 0x00000000},
  7166. - {0x0000a1a4, 0x00000000},
  7167. - {0x0000a1a8, 0x00000000},
  7168. - {0x0000a1ac, 0x00000000},
  7169. - {0x0000a1b0, 0x00000000},
  7170. - {0x0000a1b4, 0x00000000},
  7171. - {0x0000a1b8, 0x00000000},
  7172. - {0x0000a1bc, 0x00000000},
  7173. - {0x0000a1c0, 0x00000000},
  7174. - {0x0000a1c4, 0x00000000},
  7175. - {0x0000a1c8, 0x00000000},
  7176. - {0x0000a1cc, 0x00000000},
  7177. - {0x0000a1d0, 0x00000000},
  7178. - {0x0000a1d4, 0x00000000},
  7179. - {0x0000a1d8, 0x00000000},
  7180. - {0x0000a1dc, 0x00000000},
  7181. - {0x0000a1e0, 0x00000000},
  7182. - {0x0000a1e4, 0x00000000},
  7183. - {0x0000a1e8, 0x00000000},
  7184. - {0x0000a1ec, 0x00000000},
  7185. - {0x0000a1f0, 0x00000396},
  7186. - {0x0000a1f4, 0x00000396},
  7187. - {0x0000a1f8, 0x00000396},
  7188. - {0x0000a1fc, 0x00000196},
  7189. - {0x0000b000, 0x00010000},
  7190. - {0x0000b004, 0x00030002},
  7191. - {0x0000b008, 0x00050004},
  7192. - {0x0000b00c, 0x00810080},
  7193. - {0x0000b010, 0x00830082},
  7194. - {0x0000b014, 0x01810180},
  7195. - {0x0000b018, 0x01830182},
  7196. - {0x0000b01c, 0x01850184},
  7197. - {0x0000b020, 0x02810280},
  7198. - {0x0000b024, 0x02830282},
  7199. - {0x0000b028, 0x02850284},
  7200. - {0x0000b02c, 0x02890288},
  7201. - {0x0000b030, 0x028b028a},
  7202. - {0x0000b034, 0x0388028c},
  7203. - {0x0000b038, 0x038a0389},
  7204. - {0x0000b03c, 0x038c038b},
  7205. - {0x0000b040, 0x0390038d},
  7206. - {0x0000b044, 0x03920391},
  7207. - {0x0000b048, 0x03940393},
  7208. - {0x0000b04c, 0x03960395},
  7209. - {0x0000b050, 0x00000000},
  7210. - {0x0000b054, 0x00000000},
  7211. - {0x0000b058, 0x00000000},
  7212. - {0x0000b05c, 0x00000000},
  7213. - {0x0000b060, 0x00000000},
  7214. - {0x0000b064, 0x00000000},
  7215. - {0x0000b068, 0x00000000},
  7216. - {0x0000b06c, 0x00000000},
  7217. - {0x0000b070, 0x00000000},
  7218. - {0x0000b074, 0x00000000},
  7219. - {0x0000b078, 0x00000000},
  7220. - {0x0000b07c, 0x00000000},
  7221. - {0x0000b080, 0x32323232},
  7222. - {0x0000b084, 0x2f2f3232},
  7223. - {0x0000b088, 0x23282a2d},
  7224. - {0x0000b08c, 0x1c1e2123},
  7225. - {0x0000b090, 0x14171919},
  7226. - {0x0000b094, 0x0e0e1214},
  7227. - {0x0000b098, 0x03050707},
  7228. - {0x0000b09c, 0x00030303},
  7229. - {0x0000b0a0, 0x00000000},
  7230. - {0x0000b0a4, 0x00000000},
  7231. - {0x0000b0a8, 0x00000000},
  7232. - {0x0000b0ac, 0x00000000},
  7233. - {0x0000b0b0, 0x00000000},
  7234. - {0x0000b0b4, 0x00000000},
  7235. - {0x0000b0b8, 0x00000000},
  7236. - {0x0000b0bc, 0x00000000},
  7237. - {0x0000b0c0, 0x003f0020},
  7238. - {0x0000b0c4, 0x00400041},
  7239. - {0x0000b0c8, 0x0140005f},
  7240. - {0x0000b0cc, 0x0160015f},
  7241. - {0x0000b0d0, 0x017e017f},
  7242. - {0x0000b0d4, 0x02410242},
  7243. - {0x0000b0d8, 0x025f0240},
  7244. - {0x0000b0dc, 0x027f0260},
  7245. - {0x0000b0e0, 0x0341027e},
  7246. - {0x0000b0e4, 0x035f0340},
  7247. - {0x0000b0e8, 0x037f0360},
  7248. - {0x0000b0ec, 0x04400441},
  7249. - {0x0000b0f0, 0x0460045f},
  7250. - {0x0000b0f4, 0x0541047f},
  7251. - {0x0000b0f8, 0x055f0540},
  7252. - {0x0000b0fc, 0x057f0560},
  7253. - {0x0000b100, 0x06400641},
  7254. - {0x0000b104, 0x0660065f},
  7255. - {0x0000b108, 0x067e067f},
  7256. - {0x0000b10c, 0x07410742},
  7257. - {0x0000b110, 0x075f0740},
  7258. - {0x0000b114, 0x077f0760},
  7259. - {0x0000b118, 0x07800781},
  7260. - {0x0000b11c, 0x07a0079f},
  7261. - {0x0000b120, 0x07c107bf},
  7262. - {0x0000b124, 0x000007c0},
  7263. - {0x0000b128, 0x00000000},
  7264. - {0x0000b12c, 0x00000000},
  7265. - {0x0000b130, 0x00000000},
  7266. - {0x0000b134, 0x00000000},
  7267. - {0x0000b138, 0x00000000},
  7268. - {0x0000b13c, 0x00000000},
  7269. - {0x0000b140, 0x003f0020},
  7270. - {0x0000b144, 0x00400041},
  7271. - {0x0000b148, 0x0140005f},
  7272. - {0x0000b14c, 0x0160015f},
  7273. - {0x0000b150, 0x017e017f},
  7274. - {0x0000b154, 0x02410242},
  7275. - {0x0000b158, 0x025f0240},
  7276. - {0x0000b15c, 0x027f0260},
  7277. - {0x0000b160, 0x0341027e},
  7278. - {0x0000b164, 0x035f0340},
  7279. - {0x0000b168, 0x037f0360},
  7280. - {0x0000b16c, 0x04400441},
  7281. - {0x0000b170, 0x0460045f},
  7282. - {0x0000b174, 0x0541047f},
  7283. - {0x0000b178, 0x055f0540},
  7284. - {0x0000b17c, 0x057f0560},
  7285. - {0x0000b180, 0x06400641},
  7286. - {0x0000b184, 0x0660065f},
  7287. - {0x0000b188, 0x067e067f},
  7288. - {0x0000b18c, 0x07410742},
  7289. - {0x0000b190, 0x075f0740},
  7290. - {0x0000b194, 0x077f0760},
  7291. - {0x0000b198, 0x07800781},
  7292. - {0x0000b19c, 0x07a0079f},
  7293. - {0x0000b1a0, 0x07c107bf},
  7294. - {0x0000b1a4, 0x000007c0},
  7295. - {0x0000b1a8, 0x00000000},
  7296. - {0x0000b1ac, 0x00000000},
  7297. - {0x0000b1b0, 0x00000000},
  7298. - {0x0000b1b4, 0x00000000},
  7299. - {0x0000b1b8, 0x00000000},
  7300. - {0x0000b1bc, 0x00000000},
  7301. - {0x0000b1c0, 0x00000000},
  7302. - {0x0000b1c4, 0x00000000},
  7303. - {0x0000b1c8, 0x00000000},
  7304. - {0x0000b1cc, 0x00000000},
  7305. - {0x0000b1d0, 0x00000000},
  7306. - {0x0000b1d4, 0x00000000},
  7307. - {0x0000b1d8, 0x00000000},
  7308. - {0x0000b1dc, 0x00000000},
  7309. - {0x0000b1e0, 0x00000000},
  7310. - {0x0000b1e4, 0x00000000},
  7311. - {0x0000b1e8, 0x00000000},
  7312. - {0x0000b1ec, 0x00000000},
  7313. - {0x0000b1f0, 0x00000396},
  7314. - {0x0000b1f4, 0x00000396},
  7315. - {0x0000b1f8, 0x00000396},
  7316. - {0x0000b1fc, 0x00000196},
  7317. -};
  7318. -
  7319. -static const u32 ar9462_2p1_common_5g_xlna_only_rx_gain[][2] = {
  7320. - /* Addr allmodes */
  7321. - {0x0000a000, 0x00010000},
  7322. - {0x0000a004, 0x00030002},
  7323. - {0x0000a008, 0x00050004},
  7324. - {0x0000a00c, 0x00810080},
  7325. - {0x0000a010, 0x00830082},
  7326. - {0x0000a014, 0x01810180},
  7327. - {0x0000a018, 0x01830182},
  7328. - {0x0000a01c, 0x01850184},
  7329. - {0x0000a020, 0x01890188},
  7330. - {0x0000a024, 0x018b018a},
  7331. - {0x0000a028, 0x018d018c},
  7332. - {0x0000a02c, 0x03820190},
  7333. - {0x0000a030, 0x03840383},
  7334. - {0x0000a034, 0x03880385},
  7335. - {0x0000a038, 0x038a0389},
  7336. - {0x0000a03c, 0x038c038b},
  7337. - {0x0000a040, 0x0390038d},
  7338. - {0x0000a044, 0x03920391},
  7339. - {0x0000a048, 0x03940393},
  7340. - {0x0000a04c, 0x03960395},
  7341. - {0x0000a050, 0x00000000},
  7342. - {0x0000a054, 0x00000000},
  7343. - {0x0000a058, 0x00000000},
  7344. - {0x0000a05c, 0x00000000},
  7345. - {0x0000a060, 0x00000000},
  7346. - {0x0000a064, 0x00000000},
  7347. - {0x0000a068, 0x00000000},
  7348. - {0x0000a06c, 0x00000000},
  7349. - {0x0000a070, 0x00000000},
  7350. - {0x0000a074, 0x00000000},
  7351. - {0x0000a078, 0x00000000},
  7352. - {0x0000a07c, 0x00000000},
  7353. - {0x0000a080, 0x29292929},
  7354. - {0x0000a084, 0x29292929},
  7355. - {0x0000a088, 0x29292929},
  7356. - {0x0000a08c, 0x29292929},
  7357. - {0x0000a090, 0x22292929},
  7358. - {0x0000a094, 0x1d1d2222},
  7359. - {0x0000a098, 0x0c111117},
  7360. - {0x0000a09c, 0x00030303},
  7361. - {0x0000a0a0, 0x00000000},
  7362. - {0x0000a0a4, 0x00000000},
  7363. - {0x0000a0a8, 0x00000000},
  7364. - {0x0000a0ac, 0x00000000},
  7365. - {0x0000a0b0, 0x00000000},
  7366. - {0x0000a0b4, 0x00000000},
  7367. - {0x0000a0b8, 0x00000000},
  7368. - {0x0000a0bc, 0x00000000},
  7369. - {0x0000a0c0, 0x001f0000},
  7370. - {0x0000a0c4, 0x01000101},
  7371. - {0x0000a0c8, 0x011e011f},
  7372. - {0x0000a0cc, 0x011c011d},
  7373. - {0x0000a0d0, 0x02030204},
  7374. - {0x0000a0d4, 0x02010202},
  7375. - {0x0000a0d8, 0x021f0200},
  7376. - {0x0000a0dc, 0x0302021e},
  7377. - {0x0000a0e0, 0x03000301},
  7378. - {0x0000a0e4, 0x031e031f},
  7379. - {0x0000a0e8, 0x0402031d},
  7380. - {0x0000a0ec, 0x04000401},
  7381. - {0x0000a0f0, 0x041e041f},
  7382. - {0x0000a0f4, 0x0502041d},
  7383. - {0x0000a0f8, 0x05000501},
  7384. - {0x0000a0fc, 0x051e051f},
  7385. - {0x0000a100, 0x06010602},
  7386. - {0x0000a104, 0x061f0600},
  7387. - {0x0000a108, 0x061d061e},
  7388. - {0x0000a10c, 0x07020703},
  7389. - {0x0000a110, 0x07000701},
  7390. - {0x0000a114, 0x00000000},
  7391. - {0x0000a118, 0x00000000},
  7392. - {0x0000a11c, 0x00000000},
  7393. - {0x0000a120, 0x00000000},
  7394. - {0x0000a124, 0x00000000},
  7395. - {0x0000a128, 0x00000000},
  7396. - {0x0000a12c, 0x00000000},
  7397. - {0x0000a130, 0x00000000},
  7398. - {0x0000a134, 0x00000000},
  7399. - {0x0000a138, 0x00000000},
  7400. - {0x0000a13c, 0x00000000},
  7401. - {0x0000a140, 0x001f0000},
  7402. - {0x0000a144, 0x01000101},
  7403. - {0x0000a148, 0x011e011f},
  7404. - {0x0000a14c, 0x011c011d},
  7405. - {0x0000a150, 0x02030204},
  7406. - {0x0000a154, 0x02010202},
  7407. - {0x0000a158, 0x021f0200},
  7408. - {0x0000a15c, 0x0302021e},
  7409. - {0x0000a160, 0x03000301},
  7410. - {0x0000a164, 0x031e031f},
  7411. - {0x0000a168, 0x0402031d},
  7412. - {0x0000a16c, 0x04000401},
  7413. - {0x0000a170, 0x041e041f},
  7414. - {0x0000a174, 0x0502041d},
  7415. - {0x0000a178, 0x05000501},
  7416. - {0x0000a17c, 0x051e051f},
  7417. - {0x0000a180, 0x06010602},
  7418. - {0x0000a184, 0x061f0600},
  7419. - {0x0000a188, 0x061d061e},
  7420. - {0x0000a18c, 0x07020703},
  7421. - {0x0000a190, 0x07000701},
  7422. - {0x0000a194, 0x00000000},
  7423. - {0x0000a198, 0x00000000},
  7424. - {0x0000a19c, 0x00000000},
  7425. - {0x0000a1a0, 0x00000000},
  7426. - {0x0000a1a4, 0x00000000},
  7427. - {0x0000a1a8, 0x00000000},
  7428. - {0x0000a1ac, 0x00000000},
  7429. - {0x0000a1b0, 0x00000000},
  7430. - {0x0000a1b4, 0x00000000},
  7431. - {0x0000a1b8, 0x00000000},
  7432. - {0x0000a1bc, 0x00000000},
  7433. - {0x0000a1c0, 0x00000000},
  7434. - {0x0000a1c4, 0x00000000},
  7435. - {0x0000a1c8, 0x00000000},
  7436. - {0x0000a1cc, 0x00000000},
  7437. - {0x0000a1d0, 0x00000000},
  7438. - {0x0000a1d4, 0x00000000},
  7439. - {0x0000a1d8, 0x00000000},
  7440. - {0x0000a1dc, 0x00000000},
  7441. - {0x0000a1e0, 0x00000000},
  7442. - {0x0000a1e4, 0x00000000},
  7443. - {0x0000a1e8, 0x00000000},
  7444. - {0x0000a1ec, 0x00000000},
  7445. - {0x0000a1f0, 0x00000396},
  7446. - {0x0000a1f4, 0x00000396},
  7447. - {0x0000a1f8, 0x00000396},
  7448. - {0x0000a1fc, 0x00000196},
  7449. - {0x0000b000, 0x00010000},
  7450. - {0x0000b004, 0x00030002},
  7451. - {0x0000b008, 0x00050004},
  7452. - {0x0000b00c, 0x00810080},
  7453. - {0x0000b010, 0x00830082},
  7454. - {0x0000b014, 0x01810180},
  7455. - {0x0000b018, 0x01830182},
  7456. - {0x0000b01c, 0x01850184},
  7457. - {0x0000b020, 0x02810280},
  7458. - {0x0000b024, 0x02830282},
  7459. - {0x0000b028, 0x02850284},
  7460. - {0x0000b02c, 0x02890288},
  7461. - {0x0000b030, 0x028b028a},
  7462. - {0x0000b034, 0x0388028c},
  7463. - {0x0000b038, 0x038a0389},
  7464. - {0x0000b03c, 0x038c038b},
  7465. - {0x0000b040, 0x0390038d},
  7466. - {0x0000b044, 0x03920391},
  7467. - {0x0000b048, 0x03940393},
  7468. - {0x0000b04c, 0x03960395},
  7469. - {0x0000b050, 0x00000000},
  7470. - {0x0000b054, 0x00000000},
  7471. - {0x0000b058, 0x00000000},
  7472. - {0x0000b05c, 0x00000000},
  7473. - {0x0000b060, 0x00000000},
  7474. - {0x0000b064, 0x00000000},
  7475. - {0x0000b068, 0x00000000},
  7476. - {0x0000b06c, 0x00000000},
  7477. - {0x0000b070, 0x00000000},
  7478. - {0x0000b074, 0x00000000},
  7479. - {0x0000b078, 0x00000000},
  7480. - {0x0000b07c, 0x00000000},
  7481. - {0x0000b080, 0x2a2d2f32},
  7482. - {0x0000b084, 0x21232328},
  7483. - {0x0000b088, 0x19191c1e},
  7484. - {0x0000b08c, 0x12141417},
  7485. - {0x0000b090, 0x07070e0e},
  7486. - {0x0000b094, 0x03030305},
  7487. - {0x0000b098, 0x00000003},
  7488. - {0x0000b09c, 0x00000000},
  7489. - {0x0000b0a0, 0x00000000},
  7490. - {0x0000b0a4, 0x00000000},
  7491. - {0x0000b0a8, 0x00000000},
  7492. - {0x0000b0ac, 0x00000000},
  7493. - {0x0000b0b0, 0x00000000},
  7494. - {0x0000b0b4, 0x00000000},
  7495. - {0x0000b0b8, 0x00000000},
  7496. - {0x0000b0bc, 0x00000000},
  7497. - {0x0000b0c0, 0x003f0020},
  7498. - {0x0000b0c4, 0x00400041},
  7499. - {0x0000b0c8, 0x0140005f},
  7500. - {0x0000b0cc, 0x0160015f},
  7501. - {0x0000b0d0, 0x017e017f},
  7502. - {0x0000b0d4, 0x02410242},
  7503. - {0x0000b0d8, 0x025f0240},
  7504. - {0x0000b0dc, 0x027f0260},
  7505. - {0x0000b0e0, 0x0341027e},
  7506. - {0x0000b0e4, 0x035f0340},
  7507. - {0x0000b0e8, 0x037f0360},
  7508. - {0x0000b0ec, 0x04400441},
  7509. - {0x0000b0f0, 0x0460045f},
  7510. - {0x0000b0f4, 0x0541047f},
  7511. - {0x0000b0f8, 0x055f0540},
  7512. - {0x0000b0fc, 0x057f0560},
  7513. - {0x0000b100, 0x06400641},
  7514. - {0x0000b104, 0x0660065f},
  7515. - {0x0000b108, 0x067e067f},
  7516. - {0x0000b10c, 0x07410742},
  7517. - {0x0000b110, 0x075f0740},
  7518. - {0x0000b114, 0x077f0760},
  7519. - {0x0000b118, 0x07800781},
  7520. - {0x0000b11c, 0x07a0079f},
  7521. - {0x0000b120, 0x07c107bf},
  7522. - {0x0000b124, 0x000007c0},
  7523. - {0x0000b128, 0x00000000},
  7524. - {0x0000b12c, 0x00000000},
  7525. - {0x0000b130, 0x00000000},
  7526. - {0x0000b134, 0x00000000},
  7527. - {0x0000b138, 0x00000000},
  7528. - {0x0000b13c, 0x00000000},
  7529. - {0x0000b140, 0x003f0020},
  7530. - {0x0000b144, 0x00400041},
  7531. - {0x0000b148, 0x0140005f},
  7532. - {0x0000b14c, 0x0160015f},
  7533. - {0x0000b150, 0x017e017f},
  7534. - {0x0000b154, 0x02410242},
  7535. - {0x0000b158, 0x025f0240},
  7536. - {0x0000b15c, 0x027f0260},
  7537. - {0x0000b160, 0x0341027e},
  7538. - {0x0000b164, 0x035f0340},
  7539. - {0x0000b168, 0x037f0360},
  7540. - {0x0000b16c, 0x04400441},
  7541. - {0x0000b170, 0x0460045f},
  7542. - {0x0000b174, 0x0541047f},
  7543. - {0x0000b178, 0x055f0540},
  7544. - {0x0000b17c, 0x057f0560},
  7545. - {0x0000b180, 0x06400641},
  7546. - {0x0000b184, 0x0660065f},
  7547. - {0x0000b188, 0x067e067f},
  7548. - {0x0000b18c, 0x07410742},
  7549. - {0x0000b190, 0x075f0740},
  7550. - {0x0000b194, 0x077f0760},
  7551. - {0x0000b198, 0x07800781},
  7552. - {0x0000b19c, 0x07a0079f},
  7553. - {0x0000b1a0, 0x07c107bf},
  7554. - {0x0000b1a4, 0x000007c0},
  7555. - {0x0000b1a8, 0x00000000},
  7556. - {0x0000b1ac, 0x00000000},
  7557. - {0x0000b1b0, 0x00000000},
  7558. - {0x0000b1b4, 0x00000000},
  7559. - {0x0000b1b8, 0x00000000},
  7560. - {0x0000b1bc, 0x00000000},
  7561. - {0x0000b1c0, 0x00000000},
  7562. - {0x0000b1c4, 0x00000000},
  7563. - {0x0000b1c8, 0x00000000},
  7564. - {0x0000b1cc, 0x00000000},
  7565. - {0x0000b1d0, 0x00000000},
  7566. - {0x0000b1d4, 0x00000000},
  7567. - {0x0000b1d8, 0x00000000},
  7568. - {0x0000b1dc, 0x00000000},
  7569. - {0x0000b1e0, 0x00000000},
  7570. - {0x0000b1e4, 0x00000000},
  7571. - {0x0000b1e8, 0x00000000},
  7572. - {0x0000b1ec, 0x00000000},
  7573. - {0x0000b1f0, 0x00000396},
  7574. - {0x0000b1f4, 0x00000396},
  7575. - {0x0000b1f8, 0x00000396},
  7576. - {0x0000b1fc, 0x00000196},
  7577. -};
  7578. -
  7579. -static const u32 ar9462_2p1_modes_low_ob_db_tx_gain[][5] = {
  7580. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  7581. - {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
  7582. - {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  7583. - {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  7584. - {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  7585. - {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  7586. - {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
  7587. - {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7588. - {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7589. - {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
  7590. - {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
  7591. - {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
  7592. - {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
  7593. - {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
  7594. - {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402},
  7595. - {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404},
  7596. - {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
  7597. - {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
  7598. - {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
  7599. - {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
  7600. - {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
  7601. - {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
  7602. - {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
  7603. - {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
  7604. - {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
  7605. - {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
  7606. - {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
  7607. - {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83},
  7608. - {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84},
  7609. - {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3},
  7610. - {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5},
  7611. - {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9},
  7612. - {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb},
  7613. - {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  7614. - {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  7615. - {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  7616. - {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  7617. - {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  7618. - {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  7619. - {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  7620. - {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7621. - {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7622. - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7623. - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7624. - {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7625. - {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
  7626. - {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
  7627. - {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
  7628. - {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
  7629. - {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
  7630. - {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
  7631. - {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
  7632. - {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  7633. - {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  7634. - {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  7635. - {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  7636. - {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  7637. - {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  7638. - {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  7639. - {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  7640. - {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
  7641. - {0x00016048, 0x64992060, 0x64992060, 0x64992060, 0x64992060},
  7642. - {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
  7643. - {0x00016444, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
  7644. - {0x00016448, 0x64992000, 0x64992000, 0x64992000, 0x64992000},
  7645. - {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
  7646. -};
  7647. -
  7648. -static const u32 ar9462_2p1_modes_high_ob_db_tx_gain[][5] = {
  7649. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  7650. - {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
  7651. - {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
  7652. - {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
  7653. - {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
  7654. - {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  7655. - {0x0000a410, 0x000050da, 0x000050da, 0x000050de, 0x000050de},
  7656. - {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7657. - {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
  7658. - {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
  7659. - {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
  7660. - {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
  7661. - {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
  7662. - {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400},
  7663. - {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402},
  7664. - {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
  7665. - {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603},
  7666. - {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02},
  7667. - {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04},
  7668. - {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20},
  7669. - {0x0000a530, 0x34025643, 0x34025643, 0x2a000e20, 0x2a000e20},
  7670. - {0x0000a534, 0x38025a44, 0x38025a44, 0x2e000e22, 0x2e000e22},
  7671. - {0x0000a538, 0x3b025e45, 0x3b025e45, 0x31000e24, 0x31000e24},
  7672. - {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x34001640, 0x34001640},
  7673. - {0x0000a540, 0x48025e6c, 0x48025e6c, 0x38001660, 0x38001660},
  7674. - {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3b001861, 0x3b001861},
  7675. - {0x0000a548, 0x55025eb3, 0x55025eb3, 0x3e001a81, 0x3e001a81},
  7676. - {0x0000a54c, 0x58025ef3, 0x58025ef3, 0x42001a83, 0x42001a83},
  7677. - {0x0000a550, 0x5d025ef6, 0x5d025ef6, 0x44001a84, 0x44001a84},
  7678. - {0x0000a554, 0x62025f56, 0x62025f56, 0x48001ce3, 0x48001ce3},
  7679. - {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5},
  7680. - {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9},
  7681. - {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb},
  7682. - {0x0000a564, 0x751ffff6, 0x751ffff6, 0x56001eec, 0x56001eec},
  7683. - {0x0000a568, 0x751ffff6, 0x751ffff6, 0x58001ef0, 0x58001ef0},
  7684. - {0x0000a56c, 0x751ffff6, 0x751ffff6, 0x5a001ef4, 0x5a001ef4},
  7685. - {0x0000a570, 0x751ffff6, 0x751ffff6, 0x5c001ff6, 0x5c001ff6},
  7686. - {0x0000a574, 0x751ffff6, 0x751ffff6, 0x5c001ff6, 0x5c001ff6},
  7687. - {0x0000a578, 0x751ffff6, 0x751ffff6, 0x5c001ff6, 0x5c001ff6},
  7688. - {0x0000a57c, 0x751ffff6, 0x751ffff6, 0x5c001ff6, 0x5c001ff6},
  7689. - {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7690. - {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7691. - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7692. - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7693. - {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
  7694. - {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
  7695. - {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
  7696. - {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
  7697. - {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
  7698. - {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
  7699. - {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
  7700. - {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  7701. - {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  7702. - {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  7703. - {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  7704. - {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  7705. - {0x0000b2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
  7706. - {0x0000b2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
  7707. - {0x0000b2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
  7708. - {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  7709. - {0x00016044, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
  7710. - {0x00016048, 0x8db49060, 0x8db49060, 0x8db49060, 0x8db49060},
  7711. - {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
  7712. - {0x00016444, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
  7713. - {0x00016448, 0x8db49000, 0x8db49000, 0x8db49000, 0x8db49000},
  7714. - {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
  7715. -};
  7716. -
  7717. -static const u32 ar9462_2p1_modes_mix_ob_db_tx_gain[][5] = {
  7718. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  7719. - {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
  7720. - {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
  7721. - {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
  7722. - {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
  7723. - {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  7724. - {0x0000a410, 0x0000d0da, 0x0000d0da, 0x0000d0de, 0x0000d0de},
  7725. - {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7726. - {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
  7727. - {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
  7728. - {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
  7729. - {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
  7730. - {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
  7731. - {0x0000a514, 0x18022622, 0x18022622, 0x12000400, 0x12000400},
  7732. - {0x0000a518, 0x1b022822, 0x1b022822, 0x16000402, 0x16000402},
  7733. - {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
  7734. - {0x0000a520, 0x22022c41, 0x22022c41, 0x1c000603, 0x1c000603},
  7735. - {0x0000a524, 0x28023042, 0x28023042, 0x21000a02, 0x21000a02},
  7736. - {0x0000a528, 0x2c023044, 0x2c023044, 0x25000a04, 0x25000a04},
  7737. - {0x0000a52c, 0x2f023644, 0x2f023644, 0x28000a20, 0x28000a20},
  7738. - {0x0000a530, 0x34025643, 0x34025643, 0x2c000e20, 0x2c000e20},
  7739. - {0x0000a534, 0x38025a44, 0x38025a44, 0x30000e22, 0x30000e22},
  7740. - {0x0000a538, 0x3b025e45, 0x3b025e45, 0x34000e24, 0x34000e24},
  7741. - {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x38001640, 0x38001640},
  7742. - {0x0000a540, 0x48025e6c, 0x48025e6c, 0x3c001660, 0x3c001660},
  7743. - {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3f001861, 0x3f001861},
  7744. - {0x0000a548, 0x55025eb3, 0x55025eb3, 0x43001a81, 0x43001a81},
  7745. - {0x0000a54c, 0x58025ef3, 0x58025ef3, 0x47001a83, 0x47001a83},
  7746. - {0x0000a550, 0x5d025ef6, 0x5d025ef6, 0x4a001c84, 0x4a001c84},
  7747. - {0x0000a554, 0x62025f56, 0x62025f56, 0x4e001ce3, 0x4e001ce3},
  7748. - {0x0000a558, 0x66027f56, 0x66027f56, 0x52001ce5, 0x52001ce5},
  7749. - {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x56001ce9, 0x56001ce9},
  7750. - {0x0000a560, 0x70049f56, 0x70049f56, 0x5a001ceb, 0x5a001ceb},
  7751. - {0x0000a564, 0x751ffff6, 0x751ffff6, 0x5c001eec, 0x5c001eec},
  7752. - {0x0000a568, 0x751ffff6, 0x751ffff6, 0x5e001ef0, 0x5e001ef0},
  7753. - {0x0000a56c, 0x751ffff6, 0x751ffff6, 0x60001ef4, 0x60001ef4},
  7754. - {0x0000a570, 0x751ffff6, 0x751ffff6, 0x62001ff6, 0x62001ff6},
  7755. - {0x0000a574, 0x751ffff6, 0x751ffff6, 0x62001ff6, 0x62001ff6},
  7756. - {0x0000a578, 0x751ffff6, 0x751ffff6, 0x62001ff6, 0x62001ff6},
  7757. - {0x0000a57c, 0x751ffff6, 0x751ffff6, 0x62001ff6, 0x62001ff6},
  7758. - {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7759. - {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7760. - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7761. - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7762. - {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
  7763. - {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
  7764. - {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
  7765. - {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
  7766. - {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
  7767. - {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
  7768. - {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
  7769. - {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  7770. - {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  7771. - {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  7772. - {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  7773. - {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  7774. - {0x0000b2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
  7775. - {0x0000b2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
  7776. - {0x0000b2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
  7777. - {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  7778. -};
  7779. -
  7780. -static const u32 ar9462_2p1_modes_fast_clock[][3] = {
  7781. - /* Addr 5G_HT20 5G_HT40 */
  7782. - {0x00001030, 0x00000268, 0x000004d0},
  7783. - {0x00001070, 0x0000018c, 0x00000318},
  7784. - {0x000010b0, 0x00000fd0, 0x00001fa0},
  7785. - {0x00008014, 0x044c044c, 0x08980898},
  7786. - {0x0000801c, 0x148ec02b, 0x148ec057},
  7787. - {0x00008318, 0x000044c0, 0x00008980},
  7788. - {0x00009e00, 0x0372131c, 0x0372131c},
  7789. - {0x0000a230, 0x0000400b, 0x00004016},
  7790. - {0x0000a254, 0x00000898, 0x00001130},
  7791. -};
  7792. -
  7793. -static const u32 ar9462_2p1_baseband_core_txfir_coeff_japan_2484[][2] = {
  7794. - /* Addr allmodes */
  7795. - {0x0000a398, 0x00000000},
  7796. - {0x0000a39c, 0x6f7f0301},
  7797. - {0x0000a3a0, 0xca9228ee},
  7798. -};
  7799. -
  7800. #endif /* INITVALS_9462_2P1_H */
  7801. --- a/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
  7802. +++ b/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
  7803. @@ -20,24 +20,11 @@
  7804. /* AR9485 1.1 */
  7805. -static const u32 ar9485_1_1_mac_postamble[][5] = {
  7806. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  7807. - {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
  7808. - {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
  7809. - {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
  7810. - {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
  7811. - {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
  7812. - {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
  7813. - {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
  7814. - {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
  7815. -};
  7816. +#define ar9485_modes_lowest_ob_db_tx_gain_1_1 ar9485Modes_low_ob_db_tx_gain_1_1
  7817. -static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_disable_L1[][2] = {
  7818. - /* Addr allmodes */
  7819. - {0x00018c00, 0x18012e5e},
  7820. - {0x00018c04, 0x000801d8},
  7821. - {0x00018c08, 0x0000080c},
  7822. -};
  7823. +#define ar9485_1_1_mac_postamble ar9331_1p1_mac_postamble
  7824. +
  7825. +#define ar9485_1_1_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
  7826. static const u32 ar9485Common_wo_xlna_rx_gain_1_1[][2] = {
  7827. /* Addr allmodes */
  7828. @@ -553,100 +540,6 @@ static const u32 ar9485Modes_low_ob_db_t
  7829. {0x00016048, 0x6c924260, 0x6c924260, 0x6c924260, 0x6c924260},
  7830. };
  7831. -static const u32 ar9485_modes_lowest_ob_db_tx_gain_1_1[][5] = {
  7832. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  7833. - {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
  7834. - {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0x7999a83a, 0x7999a83a},
  7835. - {0x0000a2dc, 0x00000000, 0x00000000, 0xfe2d3552, 0xfe2d3552},
  7836. - {0x0000a2e0, 0x00000000, 0x00000000, 0xfe2d3552, 0xfe2d3552},
  7837. - {0x0000a2e4, 0x00000000, 0x00000000, 0xfe2d3552, 0xfe2d3552},
  7838. - {0x0000a2e8, 0x00000000, 0x00000000, 0xfe2d3552, 0xfe2d3552},
  7839. - {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d8, 0x000050d8},
  7840. - {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7841. - {0x0000a500, 0x00022200, 0x00022200, 0x00000000, 0x00000000},
  7842. - {0x0000a504, 0x05062002, 0x05062002, 0x04000002, 0x04000002},
  7843. - {0x0000a508, 0x0c002e00, 0x0c002e00, 0x08000004, 0x08000004},
  7844. - {0x0000a50c, 0x11062202, 0x11062202, 0x0d000200, 0x0d000200},
  7845. - {0x0000a510, 0x17022e00, 0x17022e00, 0x11000202, 0x11000202},
  7846. - {0x0000a514, 0x1d000ec2, 0x1d000ec2, 0x15000400, 0x15000400},
  7847. - {0x0000a518, 0x25020ec0, 0x25020ec0, 0x19000402, 0x19000402},
  7848. - {0x0000a51c, 0x2b020ec3, 0x2b020ec3, 0x1d000404, 0x1d000404},
  7849. - {0x0000a520, 0x2f001f04, 0x2f001f04, 0x21000603, 0x21000603},
  7850. - {0x0000a524, 0x35001fc4, 0x35001fc4, 0x25000605, 0x25000605},
  7851. - {0x0000a528, 0x3c022f04, 0x3c022f04, 0x2a000a03, 0x2a000a03},
  7852. - {0x0000a52c, 0x41023e85, 0x41023e85, 0x2c000a04, 0x2c000a04},
  7853. - {0x0000a530, 0x48023ec6, 0x48023ec6, 0x34000e20, 0x34000e20},
  7854. - {0x0000a534, 0x4d023f01, 0x4d023f01, 0x35000e21, 0x35000e21},
  7855. - {0x0000a538, 0x53023f4b, 0x53023f4b, 0x43000e62, 0x43000e62},
  7856. - {0x0000a53c, 0x5a027f09, 0x5a027f09, 0x45000e63, 0x45000e63},
  7857. - {0x0000a540, 0x5f027fc9, 0x5f027fc9, 0x49000e65, 0x49000e65},
  7858. - {0x0000a544, 0x6502feca, 0x6502feca, 0x4b000e66, 0x4b000e66},
  7859. - {0x0000a548, 0x6b02ff4a, 0x6b02ff4a, 0x4d001645, 0x4d001645},
  7860. - {0x0000a54c, 0x7203feca, 0x7203feca, 0x51001865, 0x51001865},
  7861. - {0x0000a550, 0x7703ff0b, 0x7703ff0b, 0x55001a86, 0x55001a86},
  7862. - {0x0000a554, 0x7d06ffcb, 0x7d06ffcb, 0x57001ce9, 0x57001ce9},
  7863. - {0x0000a558, 0x8407ff0b, 0x8407ff0b, 0x5a001ceb, 0x5a001ceb},
  7864. - {0x0000a55c, 0x8907ffcb, 0x8907ffcb, 0x5e001eeb, 0x5e001eeb},
  7865. - {0x0000a560, 0x900fff0b, 0x900fff0b, 0x5e001eeb, 0x5e001eeb},
  7866. - {0x0000a564, 0x960fffcb, 0x960fffcb, 0x5e001eeb, 0x5e001eeb},
  7867. - {0x0000a568, 0x9c1fff0b, 0x9c1fff0b, 0x5e001eeb, 0x5e001eeb},
  7868. - {0x0000a56c, 0x9c1fff0b, 0x9c1fff0b, 0x5e001eeb, 0x5e001eeb},
  7869. - {0x0000a570, 0x9c1fff0b, 0x9c1fff0b, 0x5e001eeb, 0x5e001eeb},
  7870. - {0x0000a574, 0x9c1fff0b, 0x9c1fff0b, 0x5e001eeb, 0x5e001eeb},
  7871. - {0x0000a578, 0x9c1fff0b, 0x9c1fff0b, 0x5e001eeb, 0x5e001eeb},
  7872. - {0x0000a57c, 0x9c1fff0b, 0x9c1fff0b, 0x5e001eeb, 0x5e001eeb},
  7873. - {0x0000a580, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7874. - {0x0000a584, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7875. - {0x0000a588, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7876. - {0x0000a58c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7877. - {0x0000a590, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7878. - {0x0000a594, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7879. - {0x0000a598, 0x00000000, 0x00000000, 0x01404501, 0x01404501},
  7880. - {0x0000a59c, 0x00000000, 0x00000000, 0x02808a02, 0x02808a02},
  7881. - {0x0000a5a0, 0x00000000, 0x00000000, 0x02808a02, 0x02808a02},
  7882. - {0x0000a5a4, 0x00000000, 0x00000000, 0x02808803, 0x02808803},
  7883. - {0x0000a5a8, 0x00000000, 0x00000000, 0x04c14b04, 0x04c14b04},
  7884. - {0x0000a5ac, 0x00000000, 0x00000000, 0x04c15305, 0x04c15305},
  7885. - {0x0000a5b0, 0x00000000, 0x00000000, 0x04c15305, 0x04c15305},
  7886. - {0x0000a5b4, 0x00000000, 0x00000000, 0x04c15305, 0x04c15305},
  7887. - {0x0000a5b8, 0x00000000, 0x00000000, 0x04c15305, 0x04c15305},
  7888. - {0x0000a5bc, 0x00000000, 0x00000000, 0x04c15305, 0x04c15305},
  7889. - {0x0000b500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7890. - {0x0000b504, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7891. - {0x0000b508, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7892. - {0x0000b50c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7893. - {0x0000b510, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7894. - {0x0000b514, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7895. - {0x0000b518, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7896. - {0x0000b51c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7897. - {0x0000b520, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7898. - {0x0000b524, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7899. - {0x0000b528, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7900. - {0x0000b52c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7901. - {0x0000b530, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7902. - {0x0000b534, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7903. - {0x0000b538, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7904. - {0x0000b53c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7905. - {0x0000b540, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7906. - {0x0000b544, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7907. - {0x0000b548, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7908. - {0x0000b54c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7909. - {0x0000b550, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7910. - {0x0000b554, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7911. - {0x0000b558, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7912. - {0x0000b55c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7913. - {0x0000b560, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7914. - {0x0000b564, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7915. - {0x0000b568, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7916. - {0x0000b56c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7917. - {0x0000b570, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7918. - {0x0000b574, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7919. - {0x0000b578, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7920. - {0x0000b57c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7921. - {0x00016044, 0x05d6b2db, 0x05d6b2db, 0x05d6b2db, 0x05d6b2db},
  7922. - {0x00016048, 0x6c924260, 0x6c924260, 0x6c924260, 0x6c924260},
  7923. -};
  7924. -
  7925. static const u32 ar9485Modes_green_spur_ob_db_tx_gain_1_1[][5] = {
  7926. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  7927. {0x000098bc, 0x00000003, 0x00000003, 0x00000003, 0x00000003},
  7928. @@ -1101,20 +994,6 @@ static const u32 ar9485_common_rx_gain_1
  7929. {0x0000a1fc, 0x00000296},
  7930. };
  7931. -static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_enable_L1[][2] = {
  7932. - /* Addr allmodes */
  7933. - {0x00018c00, 0x18052e5e},
  7934. - {0x00018c04, 0x000801d8},
  7935. - {0x00018c08, 0x0000080c},
  7936. -};
  7937. -
  7938. -static const u32 ar9485_1_1_pcie_phy_clkreq_enable_L1[][2] = {
  7939. - /* Addr allmodes */
  7940. - {0x00018c00, 0x18053e5e},
  7941. - {0x00018c04, 0x000801d8},
  7942. - {0x00018c08, 0x0000080c},
  7943. -};
  7944. -
  7945. static const u32 ar9485_1_1_soc_preamble[][2] = {
  7946. /* Addr allmodes */
  7947. {0x00004014, 0xba280400},
  7948. @@ -1173,13 +1052,6 @@ static const u32 ar9485_1_1_baseband_pos
  7949. {0x0000be18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  7950. };
  7951. -static const u32 ar9485_1_1_pcie_phy_clkreq_disable_L1[][2] = {
  7952. - /* Addr allmodes */
  7953. - {0x00018c00, 0x18013e5e},
  7954. - {0x00018c04, 0x000801d8},
  7955. - {0x00018c08, 0x0000080c},
  7956. -};
  7957. -
  7958. static const u32 ar9485_1_1_radio_postamble[][2] = {
  7959. /* Addr allmodes */
  7960. {0x0001609c, 0x0b283f31},
  7961. @@ -1351,11 +1223,18 @@ static const u32 ar9485_1_1_mac_core[][2
  7962. {0x000083d0, 0x000301ff},
  7963. };
  7964. -static const u32 ar9485_1_1_baseband_core_txfir_coeff_japan_2484[][2] = {
  7965. +static const u32 ar9485_1_1_pcie_phy_clkreq_disable_L1[][2] = {
  7966. /* Addr allmodes */
  7967. - {0x0000a398, 0x00000000},
  7968. - {0x0000a39c, 0x6f7f0301},
  7969. - {0x0000a3a0, 0xca9228ee},
  7970. + {0x00018c00, 0x18013e5e},
  7971. + {0x00018c04, 0x000801d8},
  7972. + {0x00018c08, 0x0000080c},
  7973. +};
  7974. +
  7975. +static const u32 ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1[][2] = {
  7976. + /* Addr allmodes */
  7977. + {0x00018c00, 0x1801265e},
  7978. + {0x00018c04, 0x000801d8},
  7979. + {0x00018c08, 0x0000080c},
  7980. };
  7981. #endif /* INITVALS_9485_H */
  7982. --- a/drivers/net/wireless/ath/ath9k/pci.c
  7983. +++ b/drivers/net/wireless/ath/ath9k/pci.c
  7984. @@ -195,6 +195,93 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_i
  7985. 0x3219),
  7986. .driver_data = ATH9K_PCI_BT_ANT_DIV },
  7987. + /* AR9485 cards with PLL power-save disabled by default. */
  7988. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  7989. + 0x0032,
  7990. + PCI_VENDOR_ID_AZWAVE,
  7991. + 0x2C97),
  7992. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  7993. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  7994. + 0x0032,
  7995. + PCI_VENDOR_ID_AZWAVE,
  7996. + 0x2100),
  7997. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  7998. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  7999. + 0x0032,
  8000. + 0x1C56, /* ASKEY */
  8001. + 0x4001),
  8002. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8003. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8004. + 0x0032,
  8005. + 0x11AD, /* LITEON */
  8006. + 0x6627),
  8007. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8008. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8009. + 0x0032,
  8010. + 0x11AD, /* LITEON */
  8011. + 0x6628),
  8012. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8013. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8014. + 0x0032,
  8015. + PCI_VENDOR_ID_FOXCONN,
  8016. + 0xE04E),
  8017. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8018. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8019. + 0x0032,
  8020. + PCI_VENDOR_ID_FOXCONN,
  8021. + 0xE04F),
  8022. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8023. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8024. + 0x0032,
  8025. + 0x144F, /* ASKEY */
  8026. + 0x7197),
  8027. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8028. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8029. + 0x0032,
  8030. + 0x1B9A, /* XAVI */
  8031. + 0x2000),
  8032. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8033. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8034. + 0x0032,
  8035. + 0x1B9A, /* XAVI */
  8036. + 0x2001),
  8037. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8038. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8039. + 0x0032,
  8040. + PCI_VENDOR_ID_AZWAVE,
  8041. + 0x1186),
  8042. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8043. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8044. + 0x0032,
  8045. + PCI_VENDOR_ID_AZWAVE,
  8046. + 0x1F86),
  8047. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8048. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8049. + 0x0032,
  8050. + PCI_VENDOR_ID_AZWAVE,
  8051. + 0x1195),
  8052. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8053. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8054. + 0x0032,
  8055. + PCI_VENDOR_ID_AZWAVE,
  8056. + 0x1F95),
  8057. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8058. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8059. + 0x0032,
  8060. + 0x1B9A, /* XAVI */
  8061. + 0x1C00),
  8062. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8063. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8064. + 0x0032,
  8065. + 0x1B9A, /* XAVI */
  8066. + 0x1C01),
  8067. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8068. + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
  8069. + 0x0032,
  8070. + PCI_VENDOR_ID_ASUSTEK,
  8071. + 0x850D),
  8072. + .driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
  8073. +
  8074. { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */
  8075. { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */
  8076. --- a/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
  8077. +++ b/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
  8078. @@ -20,7 +20,15 @@
  8079. /* AR9462 2.0 */
  8080. -static const u32 ar9462_modes_fast_clock_2p0[][3] = {
  8081. +#define ar9462_2p0_mac_postamble ar9331_1p1_mac_postamble
  8082. +
  8083. +#define ar9462_2p0_common_wo_xlna_rx_gain ar9300Common_wo_xlna_rx_gain_table_2p2
  8084. +
  8085. +#define ar9462_2p0_common_5g_xlna_only_rxgain ar9462_2p0_common_mixed_rx_gain
  8086. +
  8087. +#define ar9462_2p0_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
  8088. +
  8089. +static const u32 ar9462_2p0_modes_fast_clock[][3] = {
  8090. /* Addr 5G_HT20 5G_HT40 */
  8091. {0x00001030, 0x00000268, 0x000004d0},
  8092. {0x00001070, 0x0000018c, 0x00000318},
  8093. @@ -33,13 +41,6 @@ static const u32 ar9462_modes_fast_clock
  8094. {0x0000a254, 0x00000898, 0x00001130},
  8095. };
  8096. -static const u32 ar9462_pciephy_clkreq_enable_L1_2p0[][2] = {
  8097. - /* Addr allmodes */
  8098. - {0x00018c00, 0x18253ede},
  8099. - {0x00018c04, 0x000801d8},
  8100. - {0x00018c08, 0x0003780c},
  8101. -};
  8102. -
  8103. static const u32 ar9462_2p0_baseband_postamble[][5] = {
  8104. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  8105. {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a800d},
  8106. @@ -99,7 +100,7 @@ static const u32 ar9462_2p0_baseband_pos
  8107. {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550},
  8108. };
  8109. -static const u32 ar9462_common_rx_gain_table_2p0[][2] = {
  8110. +static const u32 ar9462_2p0_common_rx_gain[][2] = {
  8111. /* Addr allmodes */
  8112. {0x0000a000, 0x00010000},
  8113. {0x0000a004, 0x00030002},
  8114. @@ -359,20 +360,13 @@ static const u32 ar9462_common_rx_gain_t
  8115. {0x0000b1fc, 0x00000196},
  8116. };
  8117. -static const u32 ar9462_pciephy_clkreq_disable_L1_2p0[][2] = {
  8118. +static const u32 ar9462_2p0_pciephy_clkreq_disable_L1[][2] = {
  8119. /* Addr allmodes */
  8120. {0x00018c00, 0x18213ede},
  8121. {0x00018c04, 0x000801d8},
  8122. {0x00018c08, 0x0003780c},
  8123. };
  8124. -static const u32 ar9462_pciephy_pll_on_clkreq_disable_L1_2p0[][2] = {
  8125. - /* Addr allmodes */
  8126. - {0x00018c00, 0x18212ede},
  8127. - {0x00018c04, 0x000801d8},
  8128. - {0x00018c08, 0x0003780c},
  8129. -};
  8130. -
  8131. static const u32 ar9462_2p0_radio_postamble_sys2ant[][5] = {
  8132. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  8133. {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24645808, 0x24645808},
  8134. @@ -380,348 +374,81 @@ static const u32 ar9462_2p0_radio_postam
  8135. {0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
  8136. };
  8137. -static const u32 ar9462_common_wo_xlna_rx_gain_table_2p0[][2] = {
  8138. - /* Addr allmodes */
  8139. - {0x0000a000, 0x00010000},
  8140. - {0x0000a004, 0x00030002},
  8141. - {0x0000a008, 0x00050004},
  8142. - {0x0000a00c, 0x00810080},
  8143. - {0x0000a010, 0x00830082},
  8144. - {0x0000a014, 0x01810180},
  8145. - {0x0000a018, 0x01830182},
  8146. - {0x0000a01c, 0x01850184},
  8147. - {0x0000a020, 0x01890188},
  8148. - {0x0000a024, 0x018b018a},
  8149. - {0x0000a028, 0x018d018c},
  8150. - {0x0000a02c, 0x03820190},
  8151. - {0x0000a030, 0x03840383},
  8152. - {0x0000a034, 0x03880385},
  8153. - {0x0000a038, 0x038a0389},
  8154. - {0x0000a03c, 0x038c038b},
  8155. - {0x0000a040, 0x0390038d},
  8156. - {0x0000a044, 0x03920391},
  8157. - {0x0000a048, 0x03940393},
  8158. - {0x0000a04c, 0x03960395},
  8159. - {0x0000a050, 0x00000000},
  8160. - {0x0000a054, 0x00000000},
  8161. - {0x0000a058, 0x00000000},
  8162. - {0x0000a05c, 0x00000000},
  8163. - {0x0000a060, 0x00000000},
  8164. - {0x0000a064, 0x00000000},
  8165. - {0x0000a068, 0x00000000},
  8166. - {0x0000a06c, 0x00000000},
  8167. - {0x0000a070, 0x00000000},
  8168. - {0x0000a074, 0x00000000},
  8169. - {0x0000a078, 0x00000000},
  8170. - {0x0000a07c, 0x00000000},
  8171. - {0x0000a080, 0x29292929},
  8172. - {0x0000a084, 0x29292929},
  8173. - {0x0000a088, 0x29292929},
  8174. - {0x0000a08c, 0x29292929},
  8175. - {0x0000a090, 0x22292929},
  8176. - {0x0000a094, 0x1d1d2222},
  8177. - {0x0000a098, 0x0c111117},
  8178. - {0x0000a09c, 0x00030303},
  8179. - {0x0000a0a0, 0x00000000},
  8180. - {0x0000a0a4, 0x00000000},
  8181. - {0x0000a0a8, 0x00000000},
  8182. - {0x0000a0ac, 0x00000000},
  8183. - {0x0000a0b0, 0x00000000},
  8184. - {0x0000a0b4, 0x00000000},
  8185. - {0x0000a0b8, 0x00000000},
  8186. - {0x0000a0bc, 0x00000000},
  8187. - {0x0000a0c0, 0x001f0000},
  8188. - {0x0000a0c4, 0x01000101},
  8189. - {0x0000a0c8, 0x011e011f},
  8190. - {0x0000a0cc, 0x011c011d},
  8191. - {0x0000a0d0, 0x02030204},
  8192. - {0x0000a0d4, 0x02010202},
  8193. - {0x0000a0d8, 0x021f0200},
  8194. - {0x0000a0dc, 0x0302021e},
  8195. - {0x0000a0e0, 0x03000301},
  8196. - {0x0000a0e4, 0x031e031f},
  8197. - {0x0000a0e8, 0x0402031d},
  8198. - {0x0000a0ec, 0x04000401},
  8199. - {0x0000a0f0, 0x041e041f},
  8200. - {0x0000a0f4, 0x0502041d},
  8201. - {0x0000a0f8, 0x05000501},
  8202. - {0x0000a0fc, 0x051e051f},
  8203. - {0x0000a100, 0x06010602},
  8204. - {0x0000a104, 0x061f0600},
  8205. - {0x0000a108, 0x061d061e},
  8206. - {0x0000a10c, 0x07020703},
  8207. - {0x0000a110, 0x07000701},
  8208. - {0x0000a114, 0x00000000},
  8209. - {0x0000a118, 0x00000000},
  8210. - {0x0000a11c, 0x00000000},
  8211. - {0x0000a120, 0x00000000},
  8212. - {0x0000a124, 0x00000000},
  8213. - {0x0000a128, 0x00000000},
  8214. - {0x0000a12c, 0x00000000},
  8215. - {0x0000a130, 0x00000000},
  8216. - {0x0000a134, 0x00000000},
  8217. - {0x0000a138, 0x00000000},
  8218. - {0x0000a13c, 0x00000000},
  8219. - {0x0000a140, 0x001f0000},
  8220. - {0x0000a144, 0x01000101},
  8221. - {0x0000a148, 0x011e011f},
  8222. - {0x0000a14c, 0x011c011d},
  8223. - {0x0000a150, 0x02030204},
  8224. - {0x0000a154, 0x02010202},
  8225. - {0x0000a158, 0x021f0200},
  8226. - {0x0000a15c, 0x0302021e},
  8227. - {0x0000a160, 0x03000301},
  8228. - {0x0000a164, 0x031e031f},
  8229. - {0x0000a168, 0x0402031d},
  8230. - {0x0000a16c, 0x04000401},
  8231. - {0x0000a170, 0x041e041f},
  8232. - {0x0000a174, 0x0502041d},
  8233. - {0x0000a178, 0x05000501},
  8234. - {0x0000a17c, 0x051e051f},
  8235. - {0x0000a180, 0x06010602},
  8236. - {0x0000a184, 0x061f0600},
  8237. - {0x0000a188, 0x061d061e},
  8238. - {0x0000a18c, 0x07020703},
  8239. - {0x0000a190, 0x07000701},
  8240. - {0x0000a194, 0x00000000},
  8241. - {0x0000a198, 0x00000000},
  8242. - {0x0000a19c, 0x00000000},
  8243. - {0x0000a1a0, 0x00000000},
  8244. - {0x0000a1a4, 0x00000000},
  8245. - {0x0000a1a8, 0x00000000},
  8246. - {0x0000a1ac, 0x00000000},
  8247. - {0x0000a1b0, 0x00000000},
  8248. - {0x0000a1b4, 0x00000000},
  8249. - {0x0000a1b8, 0x00000000},
  8250. - {0x0000a1bc, 0x00000000},
  8251. - {0x0000a1c0, 0x00000000},
  8252. - {0x0000a1c4, 0x00000000},
  8253. - {0x0000a1c8, 0x00000000},
  8254. - {0x0000a1cc, 0x00000000},
  8255. - {0x0000a1d0, 0x00000000},
  8256. - {0x0000a1d4, 0x00000000},
  8257. - {0x0000a1d8, 0x00000000},
  8258. - {0x0000a1dc, 0x00000000},
  8259. - {0x0000a1e0, 0x00000000},
  8260. - {0x0000a1e4, 0x00000000},
  8261. - {0x0000a1e8, 0x00000000},
  8262. - {0x0000a1ec, 0x00000000},
  8263. - {0x0000a1f0, 0x00000396},
  8264. - {0x0000a1f4, 0x00000396},
  8265. - {0x0000a1f8, 0x00000396},
  8266. - {0x0000a1fc, 0x00000196},
  8267. - {0x0000b000, 0x00010000},
  8268. - {0x0000b004, 0x00030002},
  8269. - {0x0000b008, 0x00050004},
  8270. - {0x0000b00c, 0x00810080},
  8271. - {0x0000b010, 0x00830082},
  8272. - {0x0000b014, 0x01810180},
  8273. - {0x0000b018, 0x01830182},
  8274. - {0x0000b01c, 0x01850184},
  8275. - {0x0000b020, 0x02810280},
  8276. - {0x0000b024, 0x02830282},
  8277. - {0x0000b028, 0x02850284},
  8278. - {0x0000b02c, 0x02890288},
  8279. - {0x0000b030, 0x028b028a},
  8280. - {0x0000b034, 0x0388028c},
  8281. - {0x0000b038, 0x038a0389},
  8282. - {0x0000b03c, 0x038c038b},
  8283. - {0x0000b040, 0x0390038d},
  8284. - {0x0000b044, 0x03920391},
  8285. - {0x0000b048, 0x03940393},
  8286. - {0x0000b04c, 0x03960395},
  8287. - {0x0000b050, 0x00000000},
  8288. - {0x0000b054, 0x00000000},
  8289. - {0x0000b058, 0x00000000},
  8290. - {0x0000b05c, 0x00000000},
  8291. - {0x0000b060, 0x00000000},
  8292. - {0x0000b064, 0x00000000},
  8293. - {0x0000b068, 0x00000000},
  8294. - {0x0000b06c, 0x00000000},
  8295. - {0x0000b070, 0x00000000},
  8296. - {0x0000b074, 0x00000000},
  8297. - {0x0000b078, 0x00000000},
  8298. - {0x0000b07c, 0x00000000},
  8299. - {0x0000b080, 0x32323232},
  8300. - {0x0000b084, 0x2f2f3232},
  8301. - {0x0000b088, 0x23282a2d},
  8302. - {0x0000b08c, 0x1c1e2123},
  8303. - {0x0000b090, 0x14171919},
  8304. - {0x0000b094, 0x0e0e1214},
  8305. - {0x0000b098, 0x03050707},
  8306. - {0x0000b09c, 0x00030303},
  8307. - {0x0000b0a0, 0x00000000},
  8308. - {0x0000b0a4, 0x00000000},
  8309. - {0x0000b0a8, 0x00000000},
  8310. - {0x0000b0ac, 0x00000000},
  8311. - {0x0000b0b0, 0x00000000},
  8312. - {0x0000b0b4, 0x00000000},
  8313. - {0x0000b0b8, 0x00000000},
  8314. - {0x0000b0bc, 0x00000000},
  8315. - {0x0000b0c0, 0x003f0020},
  8316. - {0x0000b0c4, 0x00400041},
  8317. - {0x0000b0c8, 0x0140005f},
  8318. - {0x0000b0cc, 0x0160015f},
  8319. - {0x0000b0d0, 0x017e017f},
  8320. - {0x0000b0d4, 0x02410242},
  8321. - {0x0000b0d8, 0x025f0240},
  8322. - {0x0000b0dc, 0x027f0260},
  8323. - {0x0000b0e0, 0x0341027e},
  8324. - {0x0000b0e4, 0x035f0340},
  8325. - {0x0000b0e8, 0x037f0360},
  8326. - {0x0000b0ec, 0x04400441},
  8327. - {0x0000b0f0, 0x0460045f},
  8328. - {0x0000b0f4, 0x0541047f},
  8329. - {0x0000b0f8, 0x055f0540},
  8330. - {0x0000b0fc, 0x057f0560},
  8331. - {0x0000b100, 0x06400641},
  8332. - {0x0000b104, 0x0660065f},
  8333. - {0x0000b108, 0x067e067f},
  8334. - {0x0000b10c, 0x07410742},
  8335. - {0x0000b110, 0x075f0740},
  8336. - {0x0000b114, 0x077f0760},
  8337. - {0x0000b118, 0x07800781},
  8338. - {0x0000b11c, 0x07a0079f},
  8339. - {0x0000b120, 0x07c107bf},
  8340. - {0x0000b124, 0x000007c0},
  8341. - {0x0000b128, 0x00000000},
  8342. - {0x0000b12c, 0x00000000},
  8343. - {0x0000b130, 0x00000000},
  8344. - {0x0000b134, 0x00000000},
  8345. - {0x0000b138, 0x00000000},
  8346. - {0x0000b13c, 0x00000000},
  8347. - {0x0000b140, 0x003f0020},
  8348. - {0x0000b144, 0x00400041},
  8349. - {0x0000b148, 0x0140005f},
  8350. - {0x0000b14c, 0x0160015f},
  8351. - {0x0000b150, 0x017e017f},
  8352. - {0x0000b154, 0x02410242},
  8353. - {0x0000b158, 0x025f0240},
  8354. - {0x0000b15c, 0x027f0260},
  8355. - {0x0000b160, 0x0341027e},
  8356. - {0x0000b164, 0x035f0340},
  8357. - {0x0000b168, 0x037f0360},
  8358. - {0x0000b16c, 0x04400441},
  8359. - {0x0000b170, 0x0460045f},
  8360. - {0x0000b174, 0x0541047f},
  8361. - {0x0000b178, 0x055f0540},
  8362. - {0x0000b17c, 0x057f0560},
  8363. - {0x0000b180, 0x06400641},
  8364. - {0x0000b184, 0x0660065f},
  8365. - {0x0000b188, 0x067e067f},
  8366. - {0x0000b18c, 0x07410742},
  8367. - {0x0000b190, 0x075f0740},
  8368. - {0x0000b194, 0x077f0760},
  8369. - {0x0000b198, 0x07800781},
  8370. - {0x0000b19c, 0x07a0079f},
  8371. - {0x0000b1a0, 0x07c107bf},
  8372. - {0x0000b1a4, 0x000007c0},
  8373. - {0x0000b1a8, 0x00000000},
  8374. - {0x0000b1ac, 0x00000000},
  8375. - {0x0000b1b0, 0x00000000},
  8376. - {0x0000b1b4, 0x00000000},
  8377. - {0x0000b1b8, 0x00000000},
  8378. - {0x0000b1bc, 0x00000000},
  8379. - {0x0000b1c0, 0x00000000},
  8380. - {0x0000b1c4, 0x00000000},
  8381. - {0x0000b1c8, 0x00000000},
  8382. - {0x0000b1cc, 0x00000000},
  8383. - {0x0000b1d0, 0x00000000},
  8384. - {0x0000b1d4, 0x00000000},
  8385. - {0x0000b1d8, 0x00000000},
  8386. - {0x0000b1dc, 0x00000000},
  8387. - {0x0000b1e0, 0x00000000},
  8388. - {0x0000b1e4, 0x00000000},
  8389. - {0x0000b1e8, 0x00000000},
  8390. - {0x0000b1ec, 0x00000000},
  8391. - {0x0000b1f0, 0x00000396},
  8392. - {0x0000b1f4, 0x00000396},
  8393. - {0x0000b1f8, 0x00000396},
  8394. - {0x0000b1fc, 0x00000196},
  8395. -};
  8396. -
  8397. -static const u32 ar9462_2p0_baseband_core_txfir_coeff_japan_2484[][2] = {
  8398. - /* Addr allmodes */
  8399. - {0x0000a398, 0x00000000},
  8400. - {0x0000a39c, 0x6f7f0301},
  8401. - {0x0000a3a0, 0xca9228ee},
  8402. -};
  8403. -
  8404. -static const u32 ar9462_modes_low_ob_db_tx_gain_table_2p0[][5] = {
  8405. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  8406. - {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
  8407. - {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  8408. - {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  8409. - {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  8410. - {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  8411. - {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
  8412. - {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8413. - {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8414. - {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
  8415. - {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
  8416. - {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
  8417. - {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
  8418. - {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
  8419. - {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402},
  8420. - {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404},
  8421. - {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
  8422. - {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
  8423. - {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
  8424. - {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
  8425. - {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
  8426. - {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
  8427. - {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
  8428. - {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
  8429. - {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
  8430. - {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
  8431. - {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
  8432. - {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83},
  8433. - {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84},
  8434. - {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3},
  8435. - {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5},
  8436. - {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9},
  8437. - {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb},
  8438. - {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8439. - {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8440. - {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8441. - {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8442. - {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8443. - {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8444. - {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8445. - {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8446. - {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8447. - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8448. - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8449. - {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8450. - {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
  8451. - {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
  8452. - {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
  8453. - {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
  8454. - {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
  8455. - {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
  8456. - {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
  8457. - {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  8458. - {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  8459. - {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  8460. - {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  8461. - {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  8462. - {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  8463. - {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  8464. - {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  8465. - {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
  8466. - {0x00016048, 0x64992060, 0x64992060, 0x64992060, 0x64992060},
  8467. - {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
  8468. - {0x00016444, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
  8469. - {0x00016448, 0x64992000, 0x64992000, 0x64992000, 0x64992000},
  8470. - {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
  8471. -};
  8472. -
  8473. -static const u32 ar9462_2p0_soc_postamble[][5] = {
  8474. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  8475. - {0x00007010, 0x00000033, 0x00000033, 0x00000033, 0x00000033},
  8476. -};
  8477. -
  8478. -static const u32 ar9462_2p0_baseband_core[][2] = {
  8479. +static const u32 ar9462_2p0_modes_low_ob_db_tx_gain[][5] = {
  8480. + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  8481. + {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
  8482. + {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  8483. + {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  8484. + {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  8485. + {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  8486. + {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
  8487. + {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8488. + {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8489. + {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
  8490. + {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
  8491. + {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
  8492. + {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
  8493. + {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
  8494. + {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402},
  8495. + {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404},
  8496. + {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
  8497. + {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
  8498. + {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
  8499. + {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
  8500. + {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
  8501. + {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
  8502. + {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
  8503. + {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
  8504. + {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
  8505. + {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
  8506. + {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
  8507. + {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83},
  8508. + {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84},
  8509. + {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3},
  8510. + {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5},
  8511. + {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9},
  8512. + {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb},
  8513. + {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8514. + {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8515. + {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8516. + {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8517. + {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8518. + {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8519. + {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  8520. + {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8521. + {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8522. + {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8523. + {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8524. + {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8525. + {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
  8526. + {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
  8527. + {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
  8528. + {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
  8529. + {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
  8530. + {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
  8531. + {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
  8532. + {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  8533. + {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  8534. + {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  8535. + {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
  8536. + {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  8537. + {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  8538. + {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  8539. + {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  8540. + {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
  8541. + {0x00016048, 0x64992060, 0x64992060, 0x64992060, 0x64992060},
  8542. + {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
  8543. + {0x00016444, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
  8544. + {0x00016448, 0x64992000, 0x64992000, 0x64992000, 0x64992000},
  8545. + {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
  8546. +};
  8547. +
  8548. +static const u32 ar9462_2p0_soc_postamble[][5] = {
  8549. + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  8550. + {0x00007010, 0x00000033, 0x00000033, 0x00000033, 0x00000033},
  8551. +};
  8552. +
  8553. +static const u32 ar9462_2p0_baseband_core[][2] = {
  8554. /* Addr allmodes */
  8555. {0x00009800, 0xafe68e30},
  8556. {0x00009804, 0xfd14e000},
  8557. @@ -879,7 +606,7 @@ static const u32 ar9462_2p0_radio_postam
  8558. {0x0001650c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
  8559. };
  8560. -static const u32 ar9462_modes_mix_ob_db_tx_gain_table_2p0[][5] = {
  8561. +static const u32 ar9462_2p0_modes_mix_ob_db_tx_gain[][5] = {
  8562. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  8563. {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
  8564. {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
  8565. @@ -942,7 +669,7 @@ static const u32 ar9462_modes_mix_ob_db_
  8566. {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  8567. };
  8568. -static const u32 ar9462_modes_high_ob_db_tx_gain_table_2p0[][5] = {
  8569. +static const u32 ar9462_2p0_modes_high_ob_db_tx_gain[][5] = {
  8570. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  8571. {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
  8572. {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
  8573. @@ -1240,19 +967,7 @@ static const u32 ar9462_2p0_mac_core[][2
  8574. {0x000083d0, 0x000301ff},
  8575. };
  8576. -static const u32 ar9462_2p0_mac_postamble[][5] = {
  8577. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  8578. - {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
  8579. - {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
  8580. - {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
  8581. - {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
  8582. - {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
  8583. - {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
  8584. - {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
  8585. - {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
  8586. -};
  8587. -
  8588. -static const u32 ar9462_common_mixed_rx_gain_table_2p0[][2] = {
  8589. +static const u32 ar9462_2p0_common_mixed_rx_gain[][2] = {
  8590. /* Addr allmodes */
  8591. {0x0000a000, 0x00010000},
  8592. {0x0000a004, 0x00030002},
  8593. @@ -1517,266 +1232,6 @@ static const u32 ar9462_2p0_baseband_pos
  8594. {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
  8595. };
  8596. -static const u32 ar9462_2p0_5g_xlna_only_rxgain[][2] = {
  8597. - /* Addr allmodes */
  8598. - {0x0000a000, 0x00010000},
  8599. - {0x0000a004, 0x00030002},
  8600. - {0x0000a008, 0x00050004},
  8601. - {0x0000a00c, 0x00810080},
  8602. - {0x0000a010, 0x00830082},
  8603. - {0x0000a014, 0x01810180},
  8604. - {0x0000a018, 0x01830182},
  8605. - {0x0000a01c, 0x01850184},
  8606. - {0x0000a020, 0x01890188},
  8607. - {0x0000a024, 0x018b018a},
  8608. - {0x0000a028, 0x018d018c},
  8609. - {0x0000a02c, 0x03820190},
  8610. - {0x0000a030, 0x03840383},
  8611. - {0x0000a034, 0x03880385},
  8612. - {0x0000a038, 0x038a0389},
  8613. - {0x0000a03c, 0x038c038b},
  8614. - {0x0000a040, 0x0390038d},
  8615. - {0x0000a044, 0x03920391},
  8616. - {0x0000a048, 0x03940393},
  8617. - {0x0000a04c, 0x03960395},
  8618. - {0x0000a050, 0x00000000},
  8619. - {0x0000a054, 0x00000000},
  8620. - {0x0000a058, 0x00000000},
  8621. - {0x0000a05c, 0x00000000},
  8622. - {0x0000a060, 0x00000000},
  8623. - {0x0000a064, 0x00000000},
  8624. - {0x0000a068, 0x00000000},
  8625. - {0x0000a06c, 0x00000000},
  8626. - {0x0000a070, 0x00000000},
  8627. - {0x0000a074, 0x00000000},
  8628. - {0x0000a078, 0x00000000},
  8629. - {0x0000a07c, 0x00000000},
  8630. - {0x0000a080, 0x29292929},
  8631. - {0x0000a084, 0x29292929},
  8632. - {0x0000a088, 0x29292929},
  8633. - {0x0000a08c, 0x29292929},
  8634. - {0x0000a090, 0x22292929},
  8635. - {0x0000a094, 0x1d1d2222},
  8636. - {0x0000a098, 0x0c111117},
  8637. - {0x0000a09c, 0x00030303},
  8638. - {0x0000a0a0, 0x00000000},
  8639. - {0x0000a0a4, 0x00000000},
  8640. - {0x0000a0a8, 0x00000000},
  8641. - {0x0000a0ac, 0x00000000},
  8642. - {0x0000a0b0, 0x00000000},
  8643. - {0x0000a0b4, 0x00000000},
  8644. - {0x0000a0b8, 0x00000000},
  8645. - {0x0000a0bc, 0x00000000},
  8646. - {0x0000a0c0, 0x001f0000},
  8647. - {0x0000a0c4, 0x01000101},
  8648. - {0x0000a0c8, 0x011e011f},
  8649. - {0x0000a0cc, 0x011c011d},
  8650. - {0x0000a0d0, 0x02030204},
  8651. - {0x0000a0d4, 0x02010202},
  8652. - {0x0000a0d8, 0x021f0200},
  8653. - {0x0000a0dc, 0x0302021e},
  8654. - {0x0000a0e0, 0x03000301},
  8655. - {0x0000a0e4, 0x031e031f},
  8656. - {0x0000a0e8, 0x0402031d},
  8657. - {0x0000a0ec, 0x04000401},
  8658. - {0x0000a0f0, 0x041e041f},
  8659. - {0x0000a0f4, 0x0502041d},
  8660. - {0x0000a0f8, 0x05000501},
  8661. - {0x0000a0fc, 0x051e051f},
  8662. - {0x0000a100, 0x06010602},
  8663. - {0x0000a104, 0x061f0600},
  8664. - {0x0000a108, 0x061d061e},
  8665. - {0x0000a10c, 0x07020703},
  8666. - {0x0000a110, 0x07000701},
  8667. - {0x0000a114, 0x00000000},
  8668. - {0x0000a118, 0x00000000},
  8669. - {0x0000a11c, 0x00000000},
  8670. - {0x0000a120, 0x00000000},
  8671. - {0x0000a124, 0x00000000},
  8672. - {0x0000a128, 0x00000000},
  8673. - {0x0000a12c, 0x00000000},
  8674. - {0x0000a130, 0x00000000},
  8675. - {0x0000a134, 0x00000000},
  8676. - {0x0000a138, 0x00000000},
  8677. - {0x0000a13c, 0x00000000},
  8678. - {0x0000a140, 0x001f0000},
  8679. - {0x0000a144, 0x01000101},
  8680. - {0x0000a148, 0x011e011f},
  8681. - {0x0000a14c, 0x011c011d},
  8682. - {0x0000a150, 0x02030204},
  8683. - {0x0000a154, 0x02010202},
  8684. - {0x0000a158, 0x021f0200},
  8685. - {0x0000a15c, 0x0302021e},
  8686. - {0x0000a160, 0x03000301},
  8687. - {0x0000a164, 0x031e031f},
  8688. - {0x0000a168, 0x0402031d},
  8689. - {0x0000a16c, 0x04000401},
  8690. - {0x0000a170, 0x041e041f},
  8691. - {0x0000a174, 0x0502041d},
  8692. - {0x0000a178, 0x05000501},
  8693. - {0x0000a17c, 0x051e051f},
  8694. - {0x0000a180, 0x06010602},
  8695. - {0x0000a184, 0x061f0600},
  8696. - {0x0000a188, 0x061d061e},
  8697. - {0x0000a18c, 0x07020703},
  8698. - {0x0000a190, 0x07000701},
  8699. - {0x0000a194, 0x00000000},
  8700. - {0x0000a198, 0x00000000},
  8701. - {0x0000a19c, 0x00000000},
  8702. - {0x0000a1a0, 0x00000000},
  8703. - {0x0000a1a4, 0x00000000},
  8704. - {0x0000a1a8, 0x00000000},
  8705. - {0x0000a1ac, 0x00000000},
  8706. - {0x0000a1b0, 0x00000000},
  8707. - {0x0000a1b4, 0x00000000},
  8708. - {0x0000a1b8, 0x00000000},
  8709. - {0x0000a1bc, 0x00000000},
  8710. - {0x0000a1c0, 0x00000000},
  8711. - {0x0000a1c4, 0x00000000},
  8712. - {0x0000a1c8, 0x00000000},
  8713. - {0x0000a1cc, 0x00000000},
  8714. - {0x0000a1d0, 0x00000000},
  8715. - {0x0000a1d4, 0x00000000},
  8716. - {0x0000a1d8, 0x00000000},
  8717. - {0x0000a1dc, 0x00000000},
  8718. - {0x0000a1e0, 0x00000000},
  8719. - {0x0000a1e4, 0x00000000},
  8720. - {0x0000a1e8, 0x00000000},
  8721. - {0x0000a1ec, 0x00000000},
  8722. - {0x0000a1f0, 0x00000396},
  8723. - {0x0000a1f4, 0x00000396},
  8724. - {0x0000a1f8, 0x00000396},
  8725. - {0x0000a1fc, 0x00000196},
  8726. - {0x0000b000, 0x00010000},
  8727. - {0x0000b004, 0x00030002},
  8728. - {0x0000b008, 0x00050004},
  8729. - {0x0000b00c, 0x00810080},
  8730. - {0x0000b010, 0x00830082},
  8731. - {0x0000b014, 0x01810180},
  8732. - {0x0000b018, 0x01830182},
  8733. - {0x0000b01c, 0x01850184},
  8734. - {0x0000b020, 0x02810280},
  8735. - {0x0000b024, 0x02830282},
  8736. - {0x0000b028, 0x02850284},
  8737. - {0x0000b02c, 0x02890288},
  8738. - {0x0000b030, 0x028b028a},
  8739. - {0x0000b034, 0x0388028c},
  8740. - {0x0000b038, 0x038a0389},
  8741. - {0x0000b03c, 0x038c038b},
  8742. - {0x0000b040, 0x0390038d},
  8743. - {0x0000b044, 0x03920391},
  8744. - {0x0000b048, 0x03940393},
  8745. - {0x0000b04c, 0x03960395},
  8746. - {0x0000b050, 0x00000000},
  8747. - {0x0000b054, 0x00000000},
  8748. - {0x0000b058, 0x00000000},
  8749. - {0x0000b05c, 0x00000000},
  8750. - {0x0000b060, 0x00000000},
  8751. - {0x0000b064, 0x00000000},
  8752. - {0x0000b068, 0x00000000},
  8753. - {0x0000b06c, 0x00000000},
  8754. - {0x0000b070, 0x00000000},
  8755. - {0x0000b074, 0x00000000},
  8756. - {0x0000b078, 0x00000000},
  8757. - {0x0000b07c, 0x00000000},
  8758. - {0x0000b080, 0x2a2d2f32},
  8759. - {0x0000b084, 0x21232328},
  8760. - {0x0000b088, 0x19191c1e},
  8761. - {0x0000b08c, 0x12141417},
  8762. - {0x0000b090, 0x07070e0e},
  8763. - {0x0000b094, 0x03030305},
  8764. - {0x0000b098, 0x00000003},
  8765. - {0x0000b09c, 0x00000000},
  8766. - {0x0000b0a0, 0x00000000},
  8767. - {0x0000b0a4, 0x00000000},
  8768. - {0x0000b0a8, 0x00000000},
  8769. - {0x0000b0ac, 0x00000000},
  8770. - {0x0000b0b0, 0x00000000},
  8771. - {0x0000b0b4, 0x00000000},
  8772. - {0x0000b0b8, 0x00000000},
  8773. - {0x0000b0bc, 0x00000000},
  8774. - {0x0000b0c0, 0x003f0020},
  8775. - {0x0000b0c4, 0x00400041},
  8776. - {0x0000b0c8, 0x0140005f},
  8777. - {0x0000b0cc, 0x0160015f},
  8778. - {0x0000b0d0, 0x017e017f},
  8779. - {0x0000b0d4, 0x02410242},
  8780. - {0x0000b0d8, 0x025f0240},
  8781. - {0x0000b0dc, 0x027f0260},
  8782. - {0x0000b0e0, 0x0341027e},
  8783. - {0x0000b0e4, 0x035f0340},
  8784. - {0x0000b0e8, 0x037f0360},
  8785. - {0x0000b0ec, 0x04400441},
  8786. - {0x0000b0f0, 0x0460045f},
  8787. - {0x0000b0f4, 0x0541047f},
  8788. - {0x0000b0f8, 0x055f0540},
  8789. - {0x0000b0fc, 0x057f0560},
  8790. - {0x0000b100, 0x06400641},
  8791. - {0x0000b104, 0x0660065f},
  8792. - {0x0000b108, 0x067e067f},
  8793. - {0x0000b10c, 0x07410742},
  8794. - {0x0000b110, 0x075f0740},
  8795. - {0x0000b114, 0x077f0760},
  8796. - {0x0000b118, 0x07800781},
  8797. - {0x0000b11c, 0x07a0079f},
  8798. - {0x0000b120, 0x07c107bf},
  8799. - {0x0000b124, 0x000007c0},
  8800. - {0x0000b128, 0x00000000},
  8801. - {0x0000b12c, 0x00000000},
  8802. - {0x0000b130, 0x00000000},
  8803. - {0x0000b134, 0x00000000},
  8804. - {0x0000b138, 0x00000000},
  8805. - {0x0000b13c, 0x00000000},
  8806. - {0x0000b140, 0x003f0020},
  8807. - {0x0000b144, 0x00400041},
  8808. - {0x0000b148, 0x0140005f},
  8809. - {0x0000b14c, 0x0160015f},
  8810. - {0x0000b150, 0x017e017f},
  8811. - {0x0000b154, 0x02410242},
  8812. - {0x0000b158, 0x025f0240},
  8813. - {0x0000b15c, 0x027f0260},
  8814. - {0x0000b160, 0x0341027e},
  8815. - {0x0000b164, 0x035f0340},
  8816. - {0x0000b168, 0x037f0360},
  8817. - {0x0000b16c, 0x04400441},
  8818. - {0x0000b170, 0x0460045f},
  8819. - {0x0000b174, 0x0541047f},
  8820. - {0x0000b178, 0x055f0540},
  8821. - {0x0000b17c, 0x057f0560},
  8822. - {0x0000b180, 0x06400641},
  8823. - {0x0000b184, 0x0660065f},
  8824. - {0x0000b188, 0x067e067f},
  8825. - {0x0000b18c, 0x07410742},
  8826. - {0x0000b190, 0x075f0740},
  8827. - {0x0000b194, 0x077f0760},
  8828. - {0x0000b198, 0x07800781},
  8829. - {0x0000b19c, 0x07a0079f},
  8830. - {0x0000b1a0, 0x07c107bf},
  8831. - {0x0000b1a4, 0x000007c0},
  8832. - {0x0000b1a8, 0x00000000},
  8833. - {0x0000b1ac, 0x00000000},
  8834. - {0x0000b1b0, 0x00000000},
  8835. - {0x0000b1b4, 0x00000000},
  8836. - {0x0000b1b8, 0x00000000},
  8837. - {0x0000b1bc, 0x00000000},
  8838. - {0x0000b1c0, 0x00000000},
  8839. - {0x0000b1c4, 0x00000000},
  8840. - {0x0000b1c8, 0x00000000},
  8841. - {0x0000b1cc, 0x00000000},
  8842. - {0x0000b1d0, 0x00000000},
  8843. - {0x0000b1d4, 0x00000000},
  8844. - {0x0000b1d8, 0x00000000},
  8845. - {0x0000b1dc, 0x00000000},
  8846. - {0x0000b1e0, 0x00000000},
  8847. - {0x0000b1e4, 0x00000000},
  8848. - {0x0000b1e8, 0x00000000},
  8849. - {0x0000b1ec, 0x00000000},
  8850. - {0x0000b1f0, 0x00000396},
  8851. - {0x0000b1f4, 0x00000396},
  8852. - {0x0000b1f8, 0x00000396},
  8853. - {0x0000b1fc, 0x00000196},
  8854. -};
  8855. -
  8856. static const u32 ar9462_2p0_baseband_core_mix_rxgain[][2] = {
  8857. /* Addr allmodes */
  8858. {0x00009fd0, 0x0a2d6b93},
  8859. --- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
  8860. +++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
  8861. @@ -303,7 +303,7 @@ static const u32 ar9300_2p2_mac_postambl
  8862. {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
  8863. {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
  8864. {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
  8865. - {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
  8866. + {0x00008120, 0x18f04800, 0x18f04800, 0x18f04810, 0x18f04810},
  8867. {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
  8868. {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
  8869. };
  8870. @@ -352,7 +352,7 @@ static const u32 ar9300_2p2_baseband_pos
  8871. {0x0000a288, 0x00000110, 0x00000110, 0x00000110, 0x00000110},
  8872. {0x0000a28c, 0x00022222, 0x00022222, 0x00022222, 0x00022222},
  8873. {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
  8874. - {0x0000a2d0, 0x00041981, 0x00041981, 0x00041981, 0x00041982},
  8875. + {0x0000a2d0, 0x00041983, 0x00041983, 0x00041981, 0x00041982},
  8876. {0x0000a2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
  8877. {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8878. {0x0000a830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
  8879. @@ -378,9 +378,9 @@ static const u32 ar9300_2p2_baseband_cor
  8880. {0x00009814, 0x9280c00a},
  8881. {0x00009818, 0x00000000},
  8882. {0x0000981c, 0x00020028},
  8883. - {0x00009834, 0x6400a290},
  8884. + {0x00009834, 0x6400a190},
  8885. {0x00009838, 0x0108ecff},
  8886. - {0x0000983c, 0x0d000600},
  8887. + {0x0000983c, 0x14000600},
  8888. {0x00009880, 0x201fff00},
  8889. {0x00009884, 0x00001042},
  8890. {0x000098a4, 0x00200400},
  8891. @@ -401,7 +401,7 @@ static const u32 ar9300_2p2_baseband_cor
  8892. {0x00009d04, 0x40206c10},
  8893. {0x00009d08, 0x009c4060},
  8894. {0x00009d0c, 0x9883800a},
  8895. - {0x00009d10, 0x01834061},
  8896. + {0x00009d10, 0x01884061},
  8897. {0x00009d14, 0x00c0040b},
  8898. {0x00009d18, 0x00000000},
  8899. {0x00009e08, 0x0038230c},
  8900. @@ -459,7 +459,7 @@ static const u32 ar9300_2p2_baseband_cor
  8901. {0x0000a3e8, 0x20202020},
  8902. {0x0000a3ec, 0x20202020},
  8903. {0x0000a3f0, 0x00000000},
  8904. - {0x0000a3f4, 0x00000246},
  8905. + {0x0000a3f4, 0x00000000},
  8906. {0x0000a3f8, 0x0c9bd380},
  8907. {0x0000a3fc, 0x000f0f01},
  8908. {0x0000a400, 0x8fa91f01},
  8909. @@ -534,107 +534,107 @@ static const u32 ar9300_2p2_baseband_cor
  8910. static const u32 ar9300Modes_high_power_tx_gain_table_2p2[][5] = {
  8911. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  8912. - {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  8913. - {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  8914. - {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  8915. + {0x0000a2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
  8916. + {0x0000a2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
  8917. + {0x0000a2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
  8918. {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  8919. - {0x0000a410, 0x000050d8, 0x000050d8, 0x000050d9, 0x000050d9},
  8920. - {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
  8921. - {0x0000a504, 0x04002222, 0x04002222, 0x04000002, 0x04000002},
  8922. - {0x0000a508, 0x09002421, 0x09002421, 0x08000004, 0x08000004},
  8923. - {0x0000a50c, 0x0d002621, 0x0d002621, 0x0b000200, 0x0b000200},
  8924. - {0x0000a510, 0x13004620, 0x13004620, 0x0f000202, 0x0f000202},
  8925. - {0x0000a514, 0x19004a20, 0x19004a20, 0x11000400, 0x11000400},
  8926. - {0x0000a518, 0x1d004e20, 0x1d004e20, 0x15000402, 0x15000402},
  8927. - {0x0000a51c, 0x21005420, 0x21005420, 0x19000404, 0x19000404},
  8928. - {0x0000a520, 0x26005e20, 0x26005e20, 0x1b000603, 0x1b000603},
  8929. - {0x0000a524, 0x2b005e40, 0x2b005e40, 0x1f000a02, 0x1f000a02},
  8930. - {0x0000a528, 0x2f005e42, 0x2f005e42, 0x23000a04, 0x23000a04},
  8931. - {0x0000a52c, 0x33005e44, 0x33005e44, 0x26000a20, 0x26000a20},
  8932. - {0x0000a530, 0x38005e65, 0x38005e65, 0x2a000e20, 0x2a000e20},
  8933. - {0x0000a534, 0x3c005e69, 0x3c005e69, 0x2e000e22, 0x2e000e22},
  8934. - {0x0000a538, 0x40005e6b, 0x40005e6b, 0x31000e24, 0x31000e24},
  8935. - {0x0000a53c, 0x44005e6d, 0x44005e6d, 0x34001640, 0x34001640},
  8936. - {0x0000a540, 0x49005e72, 0x49005e72, 0x38001660, 0x38001660},
  8937. - {0x0000a544, 0x4e005eb2, 0x4e005eb2, 0x3b001861, 0x3b001861},
  8938. - {0x0000a548, 0x53005f12, 0x53005f12, 0x3e001a81, 0x3e001a81},
  8939. - {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83},
  8940. - {0x0000a550, 0x5e025f12, 0x5e025f12, 0x44001c84, 0x44001c84},
  8941. - {0x0000a554, 0x61027f12, 0x61027f12, 0x48001ce3, 0x48001ce3},
  8942. - {0x0000a558, 0x6702bf12, 0x6702bf12, 0x4c001ce5, 0x4c001ce5},
  8943. - {0x0000a55c, 0x6b02bf14, 0x6b02bf14, 0x50001ce9, 0x50001ce9},
  8944. - {0x0000a560, 0x6f02bf16, 0x6f02bf16, 0x54001ceb, 0x54001ceb},
  8945. - {0x0000a564, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  8946. - {0x0000a568, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  8947. - {0x0000a56c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  8948. - {0x0000a570, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  8949. - {0x0000a574, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  8950. - {0x0000a578, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  8951. - {0x0000a57c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  8952. - {0x0000a580, 0x00802220, 0x00802220, 0x00800000, 0x00800000},
  8953. - {0x0000a584, 0x04802222, 0x04802222, 0x04800002, 0x04800002},
  8954. - {0x0000a588, 0x09802421, 0x09802421, 0x08800004, 0x08800004},
  8955. - {0x0000a58c, 0x0d802621, 0x0d802621, 0x0b800200, 0x0b800200},
  8956. - {0x0000a590, 0x13804620, 0x13804620, 0x0f800202, 0x0f800202},
  8957. - {0x0000a594, 0x19804a20, 0x19804a20, 0x11800400, 0x11800400},
  8958. - {0x0000a598, 0x1d804e20, 0x1d804e20, 0x15800402, 0x15800402},
  8959. - {0x0000a59c, 0x21805420, 0x21805420, 0x19800404, 0x19800404},
  8960. - {0x0000a5a0, 0x26805e20, 0x26805e20, 0x1b800603, 0x1b800603},
  8961. - {0x0000a5a4, 0x2b805e40, 0x2b805e40, 0x1f800a02, 0x1f800a02},
  8962. - {0x0000a5a8, 0x2f805e42, 0x2f805e42, 0x23800a04, 0x23800a04},
  8963. - {0x0000a5ac, 0x33805e44, 0x33805e44, 0x26800a20, 0x26800a20},
  8964. - {0x0000a5b0, 0x38805e65, 0x38805e65, 0x2a800e20, 0x2a800e20},
  8965. - {0x0000a5b4, 0x3c805e69, 0x3c805e69, 0x2e800e22, 0x2e800e22},
  8966. - {0x0000a5b8, 0x40805e6b, 0x40805e6b, 0x31800e24, 0x31800e24},
  8967. - {0x0000a5bc, 0x44805e6d, 0x44805e6d, 0x34801640, 0x34801640},
  8968. - {0x0000a5c0, 0x49805e72, 0x49805e72, 0x38801660, 0x38801660},
  8969. - {0x0000a5c4, 0x4e805eb2, 0x4e805eb2, 0x3b801861, 0x3b801861},
  8970. - {0x0000a5c8, 0x53805f12, 0x53805f12, 0x3e801a81, 0x3e801a81},
  8971. - {0x0000a5cc, 0x59825eb2, 0x59825eb2, 0x42801a83, 0x42801a83},
  8972. - {0x0000a5d0, 0x5e825f12, 0x5e825f12, 0x44801c84, 0x44801c84},
  8973. - {0x0000a5d4, 0x61827f12, 0x61827f12, 0x48801ce3, 0x48801ce3},
  8974. - {0x0000a5d8, 0x6782bf12, 0x6782bf12, 0x4c801ce5, 0x4c801ce5},
  8975. - {0x0000a5dc, 0x6b82bf14, 0x6b82bf14, 0x50801ce9, 0x50801ce9},
  8976. - {0x0000a5e0, 0x6f82bf16, 0x6f82bf16, 0x54801ceb, 0x54801ceb},
  8977. - {0x0000a5e4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  8978. - {0x0000a5e8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  8979. - {0x0000a5ec, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  8980. - {0x0000a5f0, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  8981. - {0x0000a5f4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  8982. - {0x0000a5f8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  8983. - {0x0000a5fc, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  8984. + {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
  8985. + {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  8986. + {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
  8987. + {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
  8988. + {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
  8989. + {0x0000a510, 0x15000028, 0x15000028, 0x0f000202, 0x0f000202},
  8990. + {0x0000a514, 0x1b00002b, 0x1b00002b, 0x12000400, 0x12000400},
  8991. + {0x0000a518, 0x1f020028, 0x1f020028, 0x16000402, 0x16000402},
  8992. + {0x0000a51c, 0x2502002b, 0x2502002b, 0x19000404, 0x19000404},
  8993. + {0x0000a520, 0x2a04002a, 0x2a04002a, 0x1c000603, 0x1c000603},
  8994. + {0x0000a524, 0x2e06002a, 0x2e06002a, 0x21000a02, 0x21000a02},
  8995. + {0x0000a528, 0x3302202d, 0x3302202d, 0x25000a04, 0x25000a04},
  8996. + {0x0000a52c, 0x3804202c, 0x3804202c, 0x28000a20, 0x28000a20},
  8997. + {0x0000a530, 0x3c06202c, 0x3c06202c, 0x2c000e20, 0x2c000e20},
  8998. + {0x0000a534, 0x4108202d, 0x4108202d, 0x30000e22, 0x30000e22},
  8999. + {0x0000a538, 0x4506402d, 0x4506402d, 0x34000e24, 0x34000e24},
  9000. + {0x0000a53c, 0x4906222d, 0x4906222d, 0x38001640, 0x38001640},
  9001. + {0x0000a540, 0x4d062231, 0x4d062231, 0x3c001660, 0x3c001660},
  9002. + {0x0000a544, 0x50082231, 0x50082231, 0x3f001861, 0x3f001861},
  9003. + {0x0000a548, 0x5608422e, 0x5608422e, 0x43001a81, 0x43001a81},
  9004. + {0x0000a54c, 0x5e08442e, 0x5e08442e, 0x47001a83, 0x47001a83},
  9005. + {0x0000a550, 0x620a4431, 0x620a4431, 0x4a001c84, 0x4a001c84},
  9006. + {0x0000a554, 0x640a4432, 0x640a4432, 0x4e001ce3, 0x4e001ce3},
  9007. + {0x0000a558, 0x680a4434, 0x680a4434, 0x52001ce5, 0x52001ce5},
  9008. + {0x0000a55c, 0x6c0a6434, 0x6c0a6434, 0x56001ce9, 0x56001ce9},
  9009. + {0x0000a560, 0x6f0a6633, 0x6f0a6633, 0x5a001ceb, 0x5a001ceb},
  9010. + {0x0000a564, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9011. + {0x0000a568, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9012. + {0x0000a56c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9013. + {0x0000a570, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9014. + {0x0000a574, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9015. + {0x0000a578, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9016. + {0x0000a57c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9017. + {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000},
  9018. + {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002},
  9019. + {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004},
  9020. + {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200},
  9021. + {0x0000a590, 0x15800028, 0x15800028, 0x0f800202, 0x0f800202},
  9022. + {0x0000a594, 0x1b80002b, 0x1b80002b, 0x12800400, 0x12800400},
  9023. + {0x0000a598, 0x1f820028, 0x1f820028, 0x16800402, 0x16800402},
  9024. + {0x0000a59c, 0x2582002b, 0x2582002b, 0x19800404, 0x19800404},
  9025. + {0x0000a5a0, 0x2a84002a, 0x2a84002a, 0x1c800603, 0x1c800603},
  9026. + {0x0000a5a4, 0x2e86002a, 0x2e86002a, 0x21800a02, 0x21800a02},
  9027. + {0x0000a5a8, 0x3382202d, 0x3382202d, 0x25800a04, 0x25800a04},
  9028. + {0x0000a5ac, 0x3884202c, 0x3884202c, 0x28800a20, 0x28800a20},
  9029. + {0x0000a5b0, 0x3c86202c, 0x3c86202c, 0x2c800e20, 0x2c800e20},
  9030. + {0x0000a5b4, 0x4188202d, 0x4188202d, 0x30800e22, 0x30800e22},
  9031. + {0x0000a5b8, 0x4586402d, 0x4586402d, 0x34800e24, 0x34800e24},
  9032. + {0x0000a5bc, 0x4986222d, 0x4986222d, 0x38801640, 0x38801640},
  9033. + {0x0000a5c0, 0x4d862231, 0x4d862231, 0x3c801660, 0x3c801660},
  9034. + {0x0000a5c4, 0x50882231, 0x50882231, 0x3f801861, 0x3f801861},
  9035. + {0x0000a5c8, 0x5688422e, 0x5688422e, 0x43801a81, 0x43801a81},
  9036. + {0x0000a5cc, 0x5e88442e, 0x5e88442e, 0x47801a83, 0x47801a83},
  9037. + {0x0000a5d0, 0x628a4431, 0x628a4431, 0x4a801c84, 0x4a801c84},
  9038. + {0x0000a5d4, 0x648a4432, 0x648a4432, 0x4e801ce3, 0x4e801ce3},
  9039. + {0x0000a5d8, 0x688a4434, 0x688a4434, 0x52801ce5, 0x52801ce5},
  9040. + {0x0000a5dc, 0x6c8a6434, 0x6c8a6434, 0x56801ce9, 0x56801ce9},
  9041. + {0x0000a5e0, 0x6f8a6633, 0x6f8a6633, 0x5a801ceb, 0x5a801ceb},
  9042. + {0x0000a5e4, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9043. + {0x0000a5e8, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9044. + {0x0000a5ec, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9045. + {0x0000a5f0, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9046. + {0x0000a5f4, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9047. + {0x0000a5f8, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9048. + {0x0000a5fc, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9049. {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  9050. {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  9051. - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  9052. - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  9053. - {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
  9054. - {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
  9055. - {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
  9056. - {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
  9057. - {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
  9058. - {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
  9059. - {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
  9060. - {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  9061. - {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  9062. - {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  9063. - {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  9064. - {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  9065. - {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  9066. - {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  9067. - {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  9068. + {0x0000a608, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
  9069. + {0x0000a60c, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
  9070. + {0x0000a610, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
  9071. + {0x0000a614, 0x01804601, 0x01804601, 0x01404000, 0x01404000},
  9072. + {0x0000a618, 0x01804601, 0x01804601, 0x01404501, 0x01404501},
  9073. + {0x0000a61c, 0x01804601, 0x01804601, 0x02008501, 0x02008501},
  9074. + {0x0000a620, 0x03408d02, 0x03408d02, 0x0280ca03, 0x0280ca03},
  9075. + {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
  9076. + {0x0000a628, 0x03410d04, 0x03410d04, 0x04014c04, 0x04014c04},
  9077. + {0x0000a62c, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
  9078. + {0x0000a630, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
  9079. + {0x0000a634, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
  9080. + {0x0000a638, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
  9081. + {0x0000a63c, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
  9082. + {0x0000b2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
  9083. + {0x0000b2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
  9084. + {0x0000b2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
  9085. {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  9086. - {0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  9087. - {0x0000c2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  9088. - {0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  9089. + {0x0000c2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
  9090. + {0x0000c2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
  9091. + {0x0000c2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
  9092. {0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  9093. {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
  9094. - {0x00016048, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
  9095. + {0x00016048, 0x61200001, 0x61200001, 0x66480001, 0x66480001},
  9096. {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
  9097. {0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
  9098. - {0x00016448, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
  9099. + {0x00016448, 0x61200001, 0x61200001, 0x66480001, 0x66480001},
  9100. {0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
  9101. {0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
  9102. - {0x00016848, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
  9103. + {0x00016848, 0x61200001, 0x61200001, 0x66480001, 0x66480001},
  9104. {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
  9105. };
  9106. @@ -644,7 +644,7 @@ static const u32 ar9300Modes_high_ob_db_
  9107. {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
  9108. {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
  9109. {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  9110. - {0x0000a410, 0x000050d8, 0x000050d8, 0x000050d9, 0x000050d9},
  9111. + {0x0000a410, 0x000050d4, 0x000050d4, 0x000050d9, 0x000050d9},
  9112. {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
  9113. {0x0000a504, 0x04002222, 0x04002222, 0x04000002, 0x04000002},
  9114. {0x0000a508, 0x09002421, 0x09002421, 0x08000004, 0x08000004},
  9115. @@ -1086,8 +1086,8 @@ static const u32 ar9300Common_rx_gain_ta
  9116. {0x0000b074, 0x00000000},
  9117. {0x0000b078, 0x00000000},
  9118. {0x0000b07c, 0x00000000},
  9119. - {0x0000b080, 0x2a2d2f32},
  9120. - {0x0000b084, 0x21232328},
  9121. + {0x0000b080, 0x23232323},
  9122. + {0x0000b084, 0x21232323},
  9123. {0x0000b088, 0x19191c1e},
  9124. {0x0000b08c, 0x12141417},
  9125. {0x0000b090, 0x07070e0e},
  9126. @@ -1385,9 +1385,9 @@ static const u32 ar9300_2p2_mac_core[][2
  9127. {0x000081f8, 0x00000000},
  9128. {0x000081fc, 0x00000000},
  9129. {0x00008240, 0x00100000},
  9130. - {0x00008244, 0x0010f424},
  9131. + {0x00008244, 0x0010f400},
  9132. {0x00008248, 0x00000800},
  9133. - {0x0000824c, 0x0001e848},
  9134. + {0x0000824c, 0x0001e800},
  9135. {0x00008250, 0x00000000},
  9136. {0x00008254, 0x00000000},
  9137. {0x00008258, 0x00000000},
  9138. @@ -1726,16 +1726,30 @@ static const u32 ar9300PciePhy_pll_on_cl
  9139. static const u32 ar9300PciePhy_clkreq_enable_L1_2p2[][2] = {
  9140. /* Addr allmodes */
  9141. - {0x00004040, 0x08253e5e},
  9142. + {0x00004040, 0x0825365e},
  9143. {0x00004040, 0x0008003b},
  9144. {0x00004044, 0x00000000},
  9145. };
  9146. static const u32 ar9300PciePhy_clkreq_disable_L1_2p2[][2] = {
  9147. /* Addr allmodes */
  9148. - {0x00004040, 0x08213e5e},
  9149. + {0x00004040, 0x0821365e},
  9150. {0x00004040, 0x0008003b},
  9151. {0x00004044, 0x00000000},
  9152. };
  9153. +static const u32 ar9300_2p2_baseband_core_txfir_coeff_japan_2484[][2] = {
  9154. + /* Addr allmodes */
  9155. + {0x0000a398, 0x00000000},
  9156. + {0x0000a39c, 0x6f7f0301},
  9157. + {0x0000a3a0, 0xca9228ee},
  9158. +};
  9159. +
  9160. +static const u32 ar9300_2p2_baseband_postamble_dfs_channel[][3] = {
  9161. + /* Addr 5G 2G */
  9162. + {0x00009824, 0x5ac668d0, 0x5ac668d0},
  9163. + {0x00009e0c, 0x6d4000e2, 0x6d4000e2},
  9164. + {0x00009e14, 0x37b9625e, 0x37b9625e},
  9165. +};
  9166. +
  9167. #endif /* INITVALS_9003_2P2_H */
  9168. --- /dev/null
  9169. +++ b/drivers/net/wireless/ath/ath9k/ar9565_1p1_initvals.h
  9170. @@ -0,0 +1,64 @@
  9171. +/*
  9172. + * Copyright (c) 2010-2011 Atheros Communications Inc.
  9173. + * Copyright (c) 2011-2012 Qualcomm Atheros Inc.
  9174. + *
  9175. + * Permission to use, copy, modify, and/or distribute this software for any
  9176. + * purpose with or without fee is hereby granted, provided that the above
  9177. + * copyright notice and this permission notice appear in all copies.
  9178. + *
  9179. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9180. + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9181. + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  9182. + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  9183. + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  9184. + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  9185. + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  9186. + */
  9187. +
  9188. +#ifndef INITVALS_9565_1P1_H
  9189. +#define INITVALS_9565_1P1_H
  9190. +
  9191. +/* AR9565 1.1 */
  9192. +
  9193. +#define ar9565_1p1_mac_core ar9565_1p0_mac_core
  9194. +
  9195. +#define ar9565_1p1_mac_postamble ar9565_1p0_mac_postamble
  9196. +
  9197. +#define ar9565_1p1_baseband_core ar9565_1p0_baseband_core
  9198. +
  9199. +#define ar9565_1p1_baseband_postamble ar9565_1p0_baseband_postamble
  9200. +
  9201. +#define ar9565_1p1_radio_core ar9565_1p0_radio_core
  9202. +
  9203. +#define ar9565_1p1_soc_preamble ar9565_1p0_soc_preamble
  9204. +
  9205. +#define ar9565_1p1_soc_postamble ar9565_1p0_soc_postamble
  9206. +
  9207. +#define ar9565_1p1_Common_rx_gain_table ar9565_1p0_Common_rx_gain_table
  9208. +
  9209. +#define ar9565_1p1_Modes_lowest_ob_db_tx_gain_table ar9565_1p0_Modes_lowest_ob_db_tx_gain_table
  9210. +
  9211. +#define ar9565_1p1_pciephy_clkreq_disable_L1 ar9565_1p0_pciephy_clkreq_disable_L1
  9212. +
  9213. +#define ar9565_1p1_modes_fast_clock ar9565_1p0_modes_fast_clock
  9214. +
  9215. +#define ar9565_1p1_common_wo_xlna_rx_gain_table ar9565_1p0_common_wo_xlna_rx_gain_table
  9216. +
  9217. +#define ar9565_1p1_modes_low_ob_db_tx_gain_table ar9565_1p0_modes_low_ob_db_tx_gain_table
  9218. +
  9219. +#define ar9565_1p1_modes_high_ob_db_tx_gain_table ar9565_1p0_modes_high_ob_db_tx_gain_table
  9220. +
  9221. +#define ar9565_1p1_modes_high_power_tx_gain_table ar9565_1p0_modes_high_power_tx_gain_table
  9222. +
  9223. +#define ar9565_1p1_baseband_core_txfir_coeff_japan_2484 ar9565_1p0_baseband_core_txfir_coeff_japan_2484
  9224. +
  9225. +static const u32 ar9565_1p1_radio_postamble[][5] = {
  9226. + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  9227. + {0x0001609c, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524},
  9228. + {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24645808, 0x24645808},
  9229. + {0x000160b0, 0x01d67f70, 0x01d67f70, 0x01d67f70, 0x01d67f70},
  9230. + {0x0001610c, 0x40000000, 0x40000000, 0x40000000, 0x40000000},
  9231. + {0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
  9232. +};
  9233. +
  9234. +#endif /* INITVALS_9565_1P1_H */
  9235. --- a/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
  9236. +++ b/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
  9237. @@ -20,18 +20,34 @@
  9238. /* AR9580 1.0 */
  9239. +#define ar9580_1p0_soc_preamble ar9300_2p2_soc_preamble
  9240. +
  9241. +#define ar9580_1p0_soc_postamble ar9300_2p2_soc_postamble
  9242. +
  9243. +#define ar9580_1p0_radio_core ar9300_2p2_radio_core
  9244. +
  9245. +#define ar9580_1p0_mac_postamble ar9300_2p2_mac_postamble
  9246. +
  9247. +#define ar9580_1p0_wo_xlna_rx_gain_table ar9300Common_wo_xlna_rx_gain_table_2p2
  9248. +
  9249. +#define ar9580_1p0_type5_tx_gain_table ar9300Modes_type5_tx_gain_table_2p2
  9250. +
  9251. +#define ar9580_1p0_high_ob_db_tx_gain_table ar9300Modes_high_ob_db_tx_gain_table_2p2
  9252. +
  9253. #define ar9580_1p0_modes_fast_clock ar9300Modes_fast_clock_2p2
  9254. +#define ar9580_1p0_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
  9255. +
  9256. static const u32 ar9580_1p0_radio_postamble[][5] = {
  9257. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  9258. {0x0001609c, 0x0dd08f29, 0x0dd08f29, 0x0b283f31, 0x0b283f31},
  9259. {0x000160ac, 0xa4653c00, 0xa4653c00, 0x24652800, 0x24652800},
  9260. {0x000160b0, 0x03284f3e, 0x03284f3e, 0x05d08f20, 0x05d08f20},
  9261. - {0x0001610c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
  9262. + {0x0001610c, 0xc8000000, 0xc0000000, 0xc0000000, 0xc0000000},
  9263. {0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
  9264. - {0x0001650c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
  9265. + {0x0001650c, 0xc8000000, 0xc0000000, 0xc0000000, 0xc0000000},
  9266. {0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
  9267. - {0x0001690c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
  9268. + {0x0001690c, 0xc8000000, 0xc0000000, 0xc0000000, 0xc0000000},
  9269. {0x00016940, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
  9270. };
  9271. @@ -41,12 +57,10 @@ static const u32 ar9580_1p0_baseband_cor
  9272. {0x00009804, 0xfd14e000},
  9273. {0x00009808, 0x9c0a9f6b},
  9274. {0x0000980c, 0x04900000},
  9275. - {0x00009814, 0x3280c00a},
  9276. - {0x00009818, 0x00000000},
  9277. {0x0000981c, 0x00020028},
  9278. - {0x00009834, 0x6400a290},
  9279. + {0x00009834, 0x6400a190},
  9280. {0x00009838, 0x0108ecff},
  9281. - {0x0000983c, 0x0d000600},
  9282. + {0x0000983c, 0x14000600},
  9283. {0x00009880, 0x201fff00},
  9284. {0x00009884, 0x00001042},
  9285. {0x000098a4, 0x00200400},
  9286. @@ -67,7 +81,7 @@ static const u32 ar9580_1p0_baseband_cor
  9287. {0x00009d04, 0x40206c10},
  9288. {0x00009d08, 0x009c4060},
  9289. {0x00009d0c, 0x9883800a},
  9290. - {0x00009d10, 0x01834061},
  9291. + {0x00009d10, 0x01884061},
  9292. {0x00009d14, 0x00c0040b},
  9293. {0x00009d18, 0x00000000},
  9294. {0x00009e08, 0x0038230c},
  9295. @@ -198,8 +212,6 @@ static const u32 ar9580_1p0_baseband_cor
  9296. {0x0000c420, 0x00000000},
  9297. };
  9298. -#define ar9580_1p0_mac_postamble ar9300_2p2_mac_postamble
  9299. -
  9300. static const u32 ar9580_1p0_low_ob_db_tx_gain_table[][5] = {
  9301. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  9302. {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  9303. @@ -306,7 +318,112 @@ static const u32 ar9580_1p0_low_ob_db_tx
  9304. {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
  9305. };
  9306. -#define ar9580_1p0_high_power_tx_gain_table ar9580_1p0_low_ob_db_tx_gain_table
  9307. +static const u32 ar9580_1p0_high_power_tx_gain_table[][5] = {
  9308. + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  9309. + {0x0000a2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
  9310. + {0x0000a2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
  9311. + {0x0000a2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
  9312. + {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  9313. + {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
  9314. + {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  9315. + {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
  9316. + {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
  9317. + {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
  9318. + {0x0000a510, 0x15000028, 0x15000028, 0x0f000202, 0x0f000202},
  9319. + {0x0000a514, 0x1b00002b, 0x1b00002b, 0x12000400, 0x12000400},
  9320. + {0x0000a518, 0x1f020028, 0x1f020028, 0x16000402, 0x16000402},
  9321. + {0x0000a51c, 0x2502002b, 0x2502002b, 0x19000404, 0x19000404},
  9322. + {0x0000a520, 0x2a04002a, 0x2a04002a, 0x1c000603, 0x1c000603},
  9323. + {0x0000a524, 0x2e06002a, 0x2e06002a, 0x21000a02, 0x21000a02},
  9324. + {0x0000a528, 0x3302202d, 0x3302202d, 0x25000a04, 0x25000a04},
  9325. + {0x0000a52c, 0x3804202c, 0x3804202c, 0x28000a20, 0x28000a20},
  9326. + {0x0000a530, 0x3c06202c, 0x3c06202c, 0x2c000e20, 0x2c000e20},
  9327. + {0x0000a534, 0x4108202d, 0x4108202d, 0x30000e22, 0x30000e22},
  9328. + {0x0000a538, 0x4506402d, 0x4506402d, 0x34000e24, 0x34000e24},
  9329. + {0x0000a53c, 0x4906222d, 0x4906222d, 0x38001640, 0x38001640},
  9330. + {0x0000a540, 0x4d062231, 0x4d062231, 0x3c001660, 0x3c001660},
  9331. + {0x0000a544, 0x50082231, 0x50082231, 0x3f001861, 0x3f001861},
  9332. + {0x0000a548, 0x5608422e, 0x5608422e, 0x43001a81, 0x43001a81},
  9333. + {0x0000a54c, 0x5e08442e, 0x5e08442e, 0x47001a83, 0x47001a83},
  9334. + {0x0000a550, 0x620a4431, 0x620a4431, 0x4a001c84, 0x4a001c84},
  9335. + {0x0000a554, 0x640a4432, 0x640a4432, 0x4e001ce3, 0x4e001ce3},
  9336. + {0x0000a558, 0x680a4434, 0x680a4434, 0x52001ce5, 0x52001ce5},
  9337. + {0x0000a55c, 0x6c0a6434, 0x6c0a6434, 0x56001ce9, 0x56001ce9},
  9338. + {0x0000a560, 0x6f0a6633, 0x6f0a6633, 0x5a001ceb, 0x5a001ceb},
  9339. + {0x0000a564, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9340. + {0x0000a568, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9341. + {0x0000a56c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9342. + {0x0000a570, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9343. + {0x0000a574, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9344. + {0x0000a578, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9345. + {0x0000a57c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
  9346. + {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000},
  9347. + {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002},
  9348. + {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004},
  9349. + {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200},
  9350. + {0x0000a590, 0x15800028, 0x15800028, 0x0f800202, 0x0f800202},
  9351. + {0x0000a594, 0x1b80002b, 0x1b80002b, 0x12800400, 0x12800400},
  9352. + {0x0000a598, 0x1f820028, 0x1f820028, 0x16800402, 0x16800402},
  9353. + {0x0000a59c, 0x2582002b, 0x2582002b, 0x19800404, 0x19800404},
  9354. + {0x0000a5a0, 0x2a84002a, 0x2a84002a, 0x1c800603, 0x1c800603},
  9355. + {0x0000a5a4, 0x2e86002a, 0x2e86002a, 0x21800a02, 0x21800a02},
  9356. + {0x0000a5a8, 0x3382202d, 0x3382202d, 0x25800a04, 0x25800a04},
  9357. + {0x0000a5ac, 0x3884202c, 0x3884202c, 0x28800a20, 0x28800a20},
  9358. + {0x0000a5b0, 0x3c86202c, 0x3c86202c, 0x2c800e20, 0x2c800e20},
  9359. + {0x0000a5b4, 0x4188202d, 0x4188202d, 0x30800e22, 0x30800e22},
  9360. + {0x0000a5b8, 0x4586402d, 0x4586402d, 0x34800e24, 0x34800e24},
  9361. + {0x0000a5bc, 0x4986222d, 0x4986222d, 0x38801640, 0x38801640},
  9362. + {0x0000a5c0, 0x4d862231, 0x4d862231, 0x3c801660, 0x3c801660},
  9363. + {0x0000a5c4, 0x50882231, 0x50882231, 0x3f801861, 0x3f801861},
  9364. + {0x0000a5c8, 0x5688422e, 0x5688422e, 0x43801a81, 0x43801a81},
  9365. + {0x0000a5cc, 0x5a88442e, 0x5a88442e, 0x47801a83, 0x47801a83},
  9366. + {0x0000a5d0, 0x5e8a4431, 0x5e8a4431, 0x4a801c84, 0x4a801c84},
  9367. + {0x0000a5d4, 0x648a4432, 0x648a4432, 0x4e801ce3, 0x4e801ce3},
  9368. + {0x0000a5d8, 0x688a4434, 0x688a4434, 0x52801ce5, 0x52801ce5},
  9369. + {0x0000a5dc, 0x6c8a6434, 0x6c8a6434, 0x56801ce9, 0x56801ce9},
  9370. + {0x0000a5e0, 0x6f8a6633, 0x6f8a6633, 0x5a801ceb, 0x5a801ceb},
  9371. + {0x0000a5e4, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9372. + {0x0000a5e8, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9373. + {0x0000a5ec, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9374. + {0x0000a5f0, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9375. + {0x0000a5f4, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9376. + {0x0000a5f8, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9377. + {0x0000a5fc, 0x738c6634, 0x738c6634, 0x5d801eec, 0x5d801eec},
  9378. + {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  9379. + {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  9380. + {0x0000a608, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
  9381. + {0x0000a60c, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
  9382. + {0x0000a610, 0x01804601, 0x01804601, 0x00000000, 0x00000000},
  9383. + {0x0000a614, 0x01804601, 0x01804601, 0x01404000, 0x01404000},
  9384. + {0x0000a618, 0x01804601, 0x01804601, 0x01404501, 0x01404501},
  9385. + {0x0000a61c, 0x01804601, 0x01804601, 0x02008501, 0x02008501},
  9386. + {0x0000a620, 0x03408d02, 0x03408d02, 0x0280ca03, 0x0280ca03},
  9387. + {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
  9388. + {0x0000a628, 0x03410d04, 0x03410d04, 0x04014c04, 0x04014c04},
  9389. + {0x0000a62c, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
  9390. + {0x0000a630, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
  9391. + {0x0000a634, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
  9392. + {0x0000a638, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
  9393. + {0x0000a63c, 0x03410d04, 0x03410d04, 0x04015005, 0x04015005},
  9394. + {0x0000b2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
  9395. + {0x0000b2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
  9396. + {0x0000b2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
  9397. + {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  9398. + {0x0000c2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
  9399. + {0x0000c2e0, 0x000f0000, 0x000f0000, 0x03ccc584, 0x03ccc584},
  9400. + {0x0000c2e4, 0x03f00000, 0x03f00000, 0x03f0f800, 0x03f0f800},
  9401. + {0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  9402. + {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
  9403. + {0x00016048, 0x65240001, 0x65240001, 0x66480001, 0x66480001},
  9404. + {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
  9405. + {0x00016288, 0x05a2040a, 0x05a2040a, 0x05a20408, 0x05a20408},
  9406. + {0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
  9407. + {0x00016448, 0x65240001, 0x65240001, 0x66480001, 0x66480001},
  9408. + {0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
  9409. + {0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
  9410. + {0x00016848, 0x65240001, 0x65240001, 0x66480001, 0x66480001},
  9411. + {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
  9412. +};
  9413. static const u32 ar9580_1p0_lowest_ob_db_tx_gain_table[][5] = {
  9414. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  9415. @@ -414,8 +531,6 @@ static const u32 ar9580_1p0_lowest_ob_db
  9416. {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
  9417. };
  9418. -#define ar9580_1p0_baseband_core_txfir_coeff_japan_2484 ar9462_2p0_baseband_core_txfir_coeff_japan_2484
  9419. -
  9420. static const u32 ar9580_1p0_mac_core[][2] = {
  9421. /* Addr allmodes */
  9422. {0x00000008, 0x00000000},
  9423. @@ -679,14 +794,6 @@ static const u32 ar9580_1p0_mixed_ob_db_
  9424. {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
  9425. };
  9426. -#define ar9580_1p0_wo_xlna_rx_gain_table ar9300Common_wo_xlna_rx_gain_table_2p2
  9427. -
  9428. -#define ar9580_1p0_soc_postamble ar9300_2p2_soc_postamble
  9429. -
  9430. -#define ar9580_1p0_high_ob_db_tx_gain_table ar9300Modes_high_ob_db_tx_gain_table_2p2
  9431. -
  9432. -#define ar9580_1p0_type5_tx_gain_table ar9300Modes_type5_tx_gain_table_2p2
  9433. -
  9434. static const u32 ar9580_1p0_type6_tx_gain_table[][5] = {
  9435. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  9436. {0x0000a2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
  9437. @@ -761,165 +868,271 @@ static const u32 ar9580_1p0_type6_tx_gai
  9438. {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
  9439. };
  9440. -static const u32 ar9580_1p0_soc_preamble[][2] = {
  9441. +static const u32 ar9580_1p0_rx_gain_table[][2] = {
  9442. /* Addr allmodes */
  9443. - {0x000040a4, 0x00a0c1c9},
  9444. - {0x00007008, 0x00000000},
  9445. - {0x00007020, 0x00000000},
  9446. - {0x00007034, 0x00000002},
  9447. - {0x00007038, 0x000004c2},
  9448. - {0x00007048, 0x00000008},
  9449. -};
  9450. -
  9451. -#define ar9580_1p0_rx_gain_table ar9462_common_rx_gain_table_2p0
  9452. -
  9453. -static const u32 ar9580_1p0_radio_core[][2] = {
  9454. - /* Addr allmodes */
  9455. - {0x00016000, 0x36db6db6},
  9456. - {0x00016004, 0x6db6db40},
  9457. - {0x00016008, 0x73f00000},
  9458. - {0x0001600c, 0x00000000},
  9459. - {0x00016040, 0x7f80fff8},
  9460. - {0x0001604c, 0x76d005b5},
  9461. - {0x00016050, 0x556cf031},
  9462. - {0x00016054, 0x13449440},
  9463. - {0x00016058, 0x0c51c92c},
  9464. - {0x0001605c, 0x3db7fffc},
  9465. - {0x00016060, 0xfffffffc},
  9466. - {0x00016064, 0x000f0278},
  9467. - {0x0001606c, 0x6db60000},
  9468. - {0x00016080, 0x00000000},
  9469. - {0x00016084, 0x0e48048c},
  9470. - {0x00016088, 0x54214514},
  9471. - {0x0001608c, 0x119f481e},
  9472. - {0x00016090, 0x24926490},
  9473. - {0x00016098, 0xd2888888},
  9474. - {0x000160a0, 0x0a108ffe},
  9475. - {0x000160a4, 0x812fc370},
  9476. - {0x000160a8, 0x423c8000},
  9477. - {0x000160b4, 0x92480080},
  9478. - {0x000160c0, 0x00adb6d0},
  9479. - {0x000160c4, 0x6db6db60},
  9480. - {0x000160c8, 0x6db6db6c},
  9481. - {0x000160cc, 0x01e6c000},
  9482. - {0x00016100, 0x3fffbe01},
  9483. - {0x00016104, 0xfff80000},
  9484. - {0x00016108, 0x00080010},
  9485. - {0x00016144, 0x02084080},
  9486. - {0x00016148, 0x00000000},
  9487. - {0x00016280, 0x058a0001},
  9488. - {0x00016284, 0x3d840208},
  9489. - {0x00016288, 0x05a20408},
  9490. - {0x0001628c, 0x00038c07},
  9491. - {0x00016290, 0x00000004},
  9492. - {0x00016294, 0x458aa14f},
  9493. - {0x00016380, 0x00000000},
  9494. - {0x00016384, 0x00000000},
  9495. - {0x00016388, 0x00800700},
  9496. - {0x0001638c, 0x00800700},
  9497. - {0x00016390, 0x00800700},
  9498. - {0x00016394, 0x00000000},
  9499. - {0x00016398, 0x00000000},
  9500. - {0x0001639c, 0x00000000},
  9501. - {0x000163a0, 0x00000001},
  9502. - {0x000163a4, 0x00000001},
  9503. - {0x000163a8, 0x00000000},
  9504. - {0x000163ac, 0x00000000},
  9505. - {0x000163b0, 0x00000000},
  9506. - {0x000163b4, 0x00000000},
  9507. - {0x000163b8, 0x00000000},
  9508. - {0x000163bc, 0x00000000},
  9509. - {0x000163c0, 0x000000a0},
  9510. - {0x000163c4, 0x000c0000},
  9511. - {0x000163c8, 0x14021402},
  9512. - {0x000163cc, 0x00001402},
  9513. - {0x000163d0, 0x00000000},
  9514. - {0x000163d4, 0x00000000},
  9515. - {0x00016400, 0x36db6db6},
  9516. - {0x00016404, 0x6db6db40},
  9517. - {0x00016408, 0x73f00000},
  9518. - {0x0001640c, 0x00000000},
  9519. - {0x00016440, 0x7f80fff8},
  9520. - {0x0001644c, 0x76d005b5},
  9521. - {0x00016450, 0x556cf031},
  9522. - {0x00016454, 0x13449440},
  9523. - {0x00016458, 0x0c51c92c},
  9524. - {0x0001645c, 0x3db7fffc},
  9525. - {0x00016460, 0xfffffffc},
  9526. - {0x00016464, 0x000f0278},
  9527. - {0x0001646c, 0x6db60000},
  9528. - {0x00016500, 0x3fffbe01},
  9529. - {0x00016504, 0xfff80000},
  9530. - {0x00016508, 0x00080010},
  9531. - {0x00016544, 0x02084080},
  9532. - {0x00016548, 0x00000000},
  9533. - {0x00016780, 0x00000000},
  9534. - {0x00016784, 0x00000000},
  9535. - {0x00016788, 0x00800700},
  9536. - {0x0001678c, 0x00800700},
  9537. - {0x00016790, 0x00800700},
  9538. - {0x00016794, 0x00000000},
  9539. - {0x00016798, 0x00000000},
  9540. - {0x0001679c, 0x00000000},
  9541. - {0x000167a0, 0x00000001},
  9542. - {0x000167a4, 0x00000001},
  9543. - {0x000167a8, 0x00000000},
  9544. - {0x000167ac, 0x00000000},
  9545. - {0x000167b0, 0x00000000},
  9546. - {0x000167b4, 0x00000000},
  9547. - {0x000167b8, 0x00000000},
  9548. - {0x000167bc, 0x00000000},
  9549. - {0x000167c0, 0x000000a0},
  9550. - {0x000167c4, 0x000c0000},
  9551. - {0x000167c8, 0x14021402},
  9552. - {0x000167cc, 0x00001402},
  9553. - {0x000167d0, 0x00000000},
  9554. - {0x000167d4, 0x00000000},
  9555. - {0x00016800, 0x36db6db6},
  9556. - {0x00016804, 0x6db6db40},
  9557. - {0x00016808, 0x73f00000},
  9558. - {0x0001680c, 0x00000000},
  9559. - {0x00016840, 0x7f80fff8},
  9560. - {0x0001684c, 0x76d005b5},
  9561. - {0x00016850, 0x556cf031},
  9562. - {0x00016854, 0x13449440},
  9563. - {0x00016858, 0x0c51c92c},
  9564. - {0x0001685c, 0x3db7fffc},
  9565. - {0x00016860, 0xfffffffc},
  9566. - {0x00016864, 0x000f0278},
  9567. - {0x0001686c, 0x6db60000},
  9568. - {0x00016900, 0x3fffbe01},
  9569. - {0x00016904, 0xfff80000},
  9570. - {0x00016908, 0x00080010},
  9571. - {0x00016944, 0x02084080},
  9572. - {0x00016948, 0x00000000},
  9573. - {0x00016b80, 0x00000000},
  9574. - {0x00016b84, 0x00000000},
  9575. - {0x00016b88, 0x00800700},
  9576. - {0x00016b8c, 0x00800700},
  9577. - {0x00016b90, 0x00800700},
  9578. - {0x00016b94, 0x00000000},
  9579. - {0x00016b98, 0x00000000},
  9580. - {0x00016b9c, 0x00000000},
  9581. - {0x00016ba0, 0x00000001},
  9582. - {0x00016ba4, 0x00000001},
  9583. - {0x00016ba8, 0x00000000},
  9584. - {0x00016bac, 0x00000000},
  9585. - {0x00016bb0, 0x00000000},
  9586. - {0x00016bb4, 0x00000000},
  9587. - {0x00016bb8, 0x00000000},
  9588. - {0x00016bbc, 0x00000000},
  9589. - {0x00016bc0, 0x000000a0},
  9590. - {0x00016bc4, 0x000c0000},
  9591. - {0x00016bc8, 0x14021402},
  9592. - {0x00016bcc, 0x00001402},
  9593. - {0x00016bd0, 0x00000000},
  9594. - {0x00016bd4, 0x00000000},
  9595. + {0x0000a000, 0x00010000},
  9596. + {0x0000a004, 0x00030002},
  9597. + {0x0000a008, 0x00050004},
  9598. + {0x0000a00c, 0x00810080},
  9599. + {0x0000a010, 0x00830082},
  9600. + {0x0000a014, 0x01810180},
  9601. + {0x0000a018, 0x01830182},
  9602. + {0x0000a01c, 0x01850184},
  9603. + {0x0000a020, 0x01890188},
  9604. + {0x0000a024, 0x018b018a},
  9605. + {0x0000a028, 0x018d018c},
  9606. + {0x0000a02c, 0x01910190},
  9607. + {0x0000a030, 0x01930192},
  9608. + {0x0000a034, 0x01950194},
  9609. + {0x0000a038, 0x038a0196},
  9610. + {0x0000a03c, 0x038c038b},
  9611. + {0x0000a040, 0x0390038d},
  9612. + {0x0000a044, 0x03920391},
  9613. + {0x0000a048, 0x03940393},
  9614. + {0x0000a04c, 0x03960395},
  9615. + {0x0000a050, 0x00000000},
  9616. + {0x0000a054, 0x00000000},
  9617. + {0x0000a058, 0x00000000},
  9618. + {0x0000a05c, 0x00000000},
  9619. + {0x0000a060, 0x00000000},
  9620. + {0x0000a064, 0x00000000},
  9621. + {0x0000a068, 0x00000000},
  9622. + {0x0000a06c, 0x00000000},
  9623. + {0x0000a070, 0x00000000},
  9624. + {0x0000a074, 0x00000000},
  9625. + {0x0000a078, 0x00000000},
  9626. + {0x0000a07c, 0x00000000},
  9627. + {0x0000a080, 0x22222229},
  9628. + {0x0000a084, 0x1d1d1d1d},
  9629. + {0x0000a088, 0x1d1d1d1d},
  9630. + {0x0000a08c, 0x1d1d1d1d},
  9631. + {0x0000a090, 0x171d1d1d},
  9632. + {0x0000a094, 0x11111717},
  9633. + {0x0000a098, 0x00030311},
  9634. + {0x0000a09c, 0x00000000},
  9635. + {0x0000a0a0, 0x00000000},
  9636. + {0x0000a0a4, 0x00000000},
  9637. + {0x0000a0a8, 0x00000000},
  9638. + {0x0000a0ac, 0x00000000},
  9639. + {0x0000a0b0, 0x00000000},
  9640. + {0x0000a0b4, 0x00000000},
  9641. + {0x0000a0b8, 0x00000000},
  9642. + {0x0000a0bc, 0x00000000},
  9643. + {0x0000a0c0, 0x001f0000},
  9644. + {0x0000a0c4, 0x01000101},
  9645. + {0x0000a0c8, 0x011e011f},
  9646. + {0x0000a0cc, 0x011c011d},
  9647. + {0x0000a0d0, 0x02030204},
  9648. + {0x0000a0d4, 0x02010202},
  9649. + {0x0000a0d8, 0x021f0200},
  9650. + {0x0000a0dc, 0x0302021e},
  9651. + {0x0000a0e0, 0x03000301},
  9652. + {0x0000a0e4, 0x031e031f},
  9653. + {0x0000a0e8, 0x0402031d},
  9654. + {0x0000a0ec, 0x04000401},
  9655. + {0x0000a0f0, 0x041e041f},
  9656. + {0x0000a0f4, 0x0502041d},
  9657. + {0x0000a0f8, 0x05000501},
  9658. + {0x0000a0fc, 0x051e051f},
  9659. + {0x0000a100, 0x06010602},
  9660. + {0x0000a104, 0x061f0600},
  9661. + {0x0000a108, 0x061d061e},
  9662. + {0x0000a10c, 0x07020703},
  9663. + {0x0000a110, 0x07000701},
  9664. + {0x0000a114, 0x00000000},
  9665. + {0x0000a118, 0x00000000},
  9666. + {0x0000a11c, 0x00000000},
  9667. + {0x0000a120, 0x00000000},
  9668. + {0x0000a124, 0x00000000},
  9669. + {0x0000a128, 0x00000000},
  9670. + {0x0000a12c, 0x00000000},
  9671. + {0x0000a130, 0x00000000},
  9672. + {0x0000a134, 0x00000000},
  9673. + {0x0000a138, 0x00000000},
  9674. + {0x0000a13c, 0x00000000},
  9675. + {0x0000a140, 0x001f0000},
  9676. + {0x0000a144, 0x01000101},
  9677. + {0x0000a148, 0x011e011f},
  9678. + {0x0000a14c, 0x011c011d},
  9679. + {0x0000a150, 0x02030204},
  9680. + {0x0000a154, 0x02010202},
  9681. + {0x0000a158, 0x021f0200},
  9682. + {0x0000a15c, 0x0302021e},
  9683. + {0x0000a160, 0x03000301},
  9684. + {0x0000a164, 0x031e031f},
  9685. + {0x0000a168, 0x0402031d},
  9686. + {0x0000a16c, 0x04000401},
  9687. + {0x0000a170, 0x041e041f},
  9688. + {0x0000a174, 0x0502041d},
  9689. + {0x0000a178, 0x05000501},
  9690. + {0x0000a17c, 0x051e051f},
  9691. + {0x0000a180, 0x06010602},
  9692. + {0x0000a184, 0x061f0600},
  9693. + {0x0000a188, 0x061d061e},
  9694. + {0x0000a18c, 0x07020703},
  9695. + {0x0000a190, 0x07000701},
  9696. + {0x0000a194, 0x00000000},
  9697. + {0x0000a198, 0x00000000},
  9698. + {0x0000a19c, 0x00000000},
  9699. + {0x0000a1a0, 0x00000000},
  9700. + {0x0000a1a4, 0x00000000},
  9701. + {0x0000a1a8, 0x00000000},
  9702. + {0x0000a1ac, 0x00000000},
  9703. + {0x0000a1b0, 0x00000000},
  9704. + {0x0000a1b4, 0x00000000},
  9705. + {0x0000a1b8, 0x00000000},
  9706. + {0x0000a1bc, 0x00000000},
  9707. + {0x0000a1c0, 0x00000000},
  9708. + {0x0000a1c4, 0x00000000},
  9709. + {0x0000a1c8, 0x00000000},
  9710. + {0x0000a1cc, 0x00000000},
  9711. + {0x0000a1d0, 0x00000000},
  9712. + {0x0000a1d4, 0x00000000},
  9713. + {0x0000a1d8, 0x00000000},
  9714. + {0x0000a1dc, 0x00000000},
  9715. + {0x0000a1e0, 0x00000000},
  9716. + {0x0000a1e4, 0x00000000},
  9717. + {0x0000a1e8, 0x00000000},
  9718. + {0x0000a1ec, 0x00000000},
  9719. + {0x0000a1f0, 0x00000396},
  9720. + {0x0000a1f4, 0x00000396},
  9721. + {0x0000a1f8, 0x00000396},
  9722. + {0x0000a1fc, 0x00000196},
  9723. + {0x0000b000, 0x00010000},
  9724. + {0x0000b004, 0x00030002},
  9725. + {0x0000b008, 0x00050004},
  9726. + {0x0000b00c, 0x00810080},
  9727. + {0x0000b010, 0x00830082},
  9728. + {0x0000b014, 0x01810180},
  9729. + {0x0000b018, 0x01830182},
  9730. + {0x0000b01c, 0x01850184},
  9731. + {0x0000b020, 0x02810280},
  9732. + {0x0000b024, 0x02830282},
  9733. + {0x0000b028, 0x02850284},
  9734. + {0x0000b02c, 0x02890288},
  9735. + {0x0000b030, 0x028b028a},
  9736. + {0x0000b034, 0x0388028c},
  9737. + {0x0000b038, 0x038a0389},
  9738. + {0x0000b03c, 0x038c038b},
  9739. + {0x0000b040, 0x0390038d},
  9740. + {0x0000b044, 0x03920391},
  9741. + {0x0000b048, 0x03940393},
  9742. + {0x0000b04c, 0x03960395},
  9743. + {0x0000b050, 0x00000000},
  9744. + {0x0000b054, 0x00000000},
  9745. + {0x0000b058, 0x00000000},
  9746. + {0x0000b05c, 0x00000000},
  9747. + {0x0000b060, 0x00000000},
  9748. + {0x0000b064, 0x00000000},
  9749. + {0x0000b068, 0x00000000},
  9750. + {0x0000b06c, 0x00000000},
  9751. + {0x0000b070, 0x00000000},
  9752. + {0x0000b074, 0x00000000},
  9753. + {0x0000b078, 0x00000000},
  9754. + {0x0000b07c, 0x00000000},
  9755. + {0x0000b080, 0x23232323},
  9756. + {0x0000b084, 0x21232323},
  9757. + {0x0000b088, 0x19191c1e},
  9758. + {0x0000b08c, 0x12141417},
  9759. + {0x0000b090, 0x07070e0e},
  9760. + {0x0000b094, 0x03030305},
  9761. + {0x0000b098, 0x00000003},
  9762. + {0x0000b09c, 0x00000000},
  9763. + {0x0000b0a0, 0x00000000},
  9764. + {0x0000b0a4, 0x00000000},
  9765. + {0x0000b0a8, 0x00000000},
  9766. + {0x0000b0ac, 0x00000000},
  9767. + {0x0000b0b0, 0x00000000},
  9768. + {0x0000b0b4, 0x00000000},
  9769. + {0x0000b0b8, 0x00000000},
  9770. + {0x0000b0bc, 0x00000000},
  9771. + {0x0000b0c0, 0x003f0020},
  9772. + {0x0000b0c4, 0x00400041},
  9773. + {0x0000b0c8, 0x0140005f},
  9774. + {0x0000b0cc, 0x0160015f},
  9775. + {0x0000b0d0, 0x017e017f},
  9776. + {0x0000b0d4, 0x02410242},
  9777. + {0x0000b0d8, 0x025f0240},
  9778. + {0x0000b0dc, 0x027f0260},
  9779. + {0x0000b0e0, 0x0341027e},
  9780. + {0x0000b0e4, 0x035f0340},
  9781. + {0x0000b0e8, 0x037f0360},
  9782. + {0x0000b0ec, 0x04400441},
  9783. + {0x0000b0f0, 0x0460045f},
  9784. + {0x0000b0f4, 0x0541047f},
  9785. + {0x0000b0f8, 0x055f0540},
  9786. + {0x0000b0fc, 0x057f0560},
  9787. + {0x0000b100, 0x06400641},
  9788. + {0x0000b104, 0x0660065f},
  9789. + {0x0000b108, 0x067e067f},
  9790. + {0x0000b10c, 0x07410742},
  9791. + {0x0000b110, 0x075f0740},
  9792. + {0x0000b114, 0x077f0760},
  9793. + {0x0000b118, 0x07800781},
  9794. + {0x0000b11c, 0x07a0079f},
  9795. + {0x0000b120, 0x07c107bf},
  9796. + {0x0000b124, 0x000007c0},
  9797. + {0x0000b128, 0x00000000},
  9798. + {0x0000b12c, 0x00000000},
  9799. + {0x0000b130, 0x00000000},
  9800. + {0x0000b134, 0x00000000},
  9801. + {0x0000b138, 0x00000000},
  9802. + {0x0000b13c, 0x00000000},
  9803. + {0x0000b140, 0x003f0020},
  9804. + {0x0000b144, 0x00400041},
  9805. + {0x0000b148, 0x0140005f},
  9806. + {0x0000b14c, 0x0160015f},
  9807. + {0x0000b150, 0x017e017f},
  9808. + {0x0000b154, 0x02410242},
  9809. + {0x0000b158, 0x025f0240},
  9810. + {0x0000b15c, 0x027f0260},
  9811. + {0x0000b160, 0x0341027e},
  9812. + {0x0000b164, 0x035f0340},
  9813. + {0x0000b168, 0x037f0360},
  9814. + {0x0000b16c, 0x04400441},
  9815. + {0x0000b170, 0x0460045f},
  9816. + {0x0000b174, 0x0541047f},
  9817. + {0x0000b178, 0x055f0540},
  9818. + {0x0000b17c, 0x057f0560},
  9819. + {0x0000b180, 0x06400641},
  9820. + {0x0000b184, 0x0660065f},
  9821. + {0x0000b188, 0x067e067f},
  9822. + {0x0000b18c, 0x07410742},
  9823. + {0x0000b190, 0x075f0740},
  9824. + {0x0000b194, 0x077f0760},
  9825. + {0x0000b198, 0x07800781},
  9826. + {0x0000b19c, 0x07a0079f},
  9827. + {0x0000b1a0, 0x07c107bf},
  9828. + {0x0000b1a4, 0x000007c0},
  9829. + {0x0000b1a8, 0x00000000},
  9830. + {0x0000b1ac, 0x00000000},
  9831. + {0x0000b1b0, 0x00000000},
  9832. + {0x0000b1b4, 0x00000000},
  9833. + {0x0000b1b8, 0x00000000},
  9834. + {0x0000b1bc, 0x00000000},
  9835. + {0x0000b1c0, 0x00000000},
  9836. + {0x0000b1c4, 0x00000000},
  9837. + {0x0000b1c8, 0x00000000},
  9838. + {0x0000b1cc, 0x00000000},
  9839. + {0x0000b1d0, 0x00000000},
  9840. + {0x0000b1d4, 0x00000000},
  9841. + {0x0000b1d8, 0x00000000},
  9842. + {0x0000b1dc, 0x00000000},
  9843. + {0x0000b1e0, 0x00000000},
  9844. + {0x0000b1e4, 0x00000000},
  9845. + {0x0000b1e8, 0x00000000},
  9846. + {0x0000b1ec, 0x00000000},
  9847. + {0x0000b1f0, 0x00000396},
  9848. + {0x0000b1f4, 0x00000396},
  9849. + {0x0000b1f8, 0x00000396},
  9850. + {0x0000b1fc, 0x00000196},
  9851. };
  9852. static const u32 ar9580_1p0_baseband_postamble[][5] = {
  9853. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  9854. {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011},
  9855. + {0x00009814, 0x3280c00a, 0x3280c00a, 0x3280c00a, 0x3280c00a},
  9856. + {0x00009818, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  9857. {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a012e},
  9858. {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
  9859. {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
  9860. @@ -956,7 +1169,7 @@ static const u32 ar9580_1p0_baseband_pos
  9861. {0x0000a288, 0x00000110, 0x00000110, 0x00000110, 0x00000110},
  9862. {0x0000a28c, 0x00022222, 0x00022222, 0x00022222, 0x00022222},
  9863. {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
  9864. - {0x0000a2d0, 0x00041981, 0x00041981, 0x00041981, 0x00041982},
  9865. + {0x0000a2d0, 0x00041983, 0x00041983, 0x00041981, 0x00041982},
  9866. {0x0000a2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
  9867. {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  9868. {0x0000a830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
  9869. @@ -994,4 +1207,13 @@ static const u32 ar9580_1p0_pcie_phy_pll
  9870. {0x00004044, 0x00000000},
  9871. };
  9872. +static const u32 ar9580_1p0_baseband_postamble_dfs_channel[][3] = {
  9873. + /* Addr 5G 2G */
  9874. + {0x00009814, 0x3400c00f, 0x3400c00f},
  9875. + {0x00009824, 0x5ac668d0, 0x5ac668d0},
  9876. + {0x00009828, 0x06903080, 0x06903080},
  9877. + {0x00009e0c, 0x6d4000e2, 0x6d4000e2},
  9878. + {0x00009e14, 0x37b9625e, 0x37b9625e},
  9879. +};
  9880. +
  9881. #endif /* INITVALS_9580_1P0_H */
  9882. --- a/drivers/net/wireless/ath/ath9k/reg.h
  9883. +++ b/drivers/net/wireless/ath/ath9k/reg.h
  9884. @@ -809,6 +809,8 @@
  9885. #define AR_SREV_REVISION_9462_21 3
  9886. #define AR_SREV_VERSION_9565 0x2C0
  9887. #define AR_SREV_REVISION_9565_10 0
  9888. +#define AR_SREV_REVISION_9565_101 1
  9889. +#define AR_SREV_REVISION_9565_11 2
  9890. #define AR_SREV_VERSION_9550 0x400
  9891. #define AR_SREV_5416(_ah) \
  9892. @@ -881,9 +883,6 @@
  9893. #define AR_SREV_9330(_ah) \
  9894. (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9330))
  9895. -#define AR_SREV_9330_10(_ah) \
  9896. - (AR_SREV_9330((_ah)) && \
  9897. - ((_ah)->hw_version.macRev == AR_SREV_REVISION_9330_10))
  9898. #define AR_SREV_9330_11(_ah) \
  9899. (AR_SREV_9330((_ah)) && \
  9900. ((_ah)->hw_version.macRev == AR_SREV_REVISION_9330_11))
  9901. @@ -927,10 +926,18 @@
  9902. #define AR_SREV_9565(_ah) \
  9903. (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565))
  9904. -
  9905. #define AR_SREV_9565_10(_ah) \
  9906. (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \
  9907. ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_10))
  9908. +#define AR_SREV_9565_101(_ah) \
  9909. + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \
  9910. + ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_101))
  9911. +#define AR_SREV_9565_11(_ah) \
  9912. + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \
  9913. + ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_11))
  9914. +#define AR_SREV_9565_11_OR_LATER(_ah) \
  9915. + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \
  9916. + ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9565_11))
  9917. #define AR_SREV_9550(_ah) \
  9918. (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9550))
  9919. --- a/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
  9920. +++ b/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
  9921. @@ -18,6 +18,10 @@
  9922. #ifndef INITVALS_9330_1P1_H
  9923. #define INITVALS_9330_1P1_H
  9924. +#define ar9331_1p1_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
  9925. +
  9926. +#define ar9331_modes_high_power_tx_gain_1p1 ar9331_modes_lowest_ob_db_tx_gain_1p1
  9927. +
  9928. static const u32 ar9331_1p1_baseband_postamble[][5] = {
  9929. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  9930. {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a8005},
  9931. @@ -55,7 +59,7 @@ static const u32 ar9331_1p1_baseband_pos
  9932. {0x0000a284, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  9933. {0x0000a288, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  9934. {0x0000a28c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  9935. - {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
  9936. + {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00058d18, 0x00058d18},
  9937. {0x0000a2d0, 0x00071982, 0x00071982, 0x00071982, 0x00071982},
  9938. {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a},
  9939. {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  9940. @@ -252,7 +256,7 @@ static const u32 ar9331_modes_low_ob_db_
  9941. {0x0000a2e0, 0xffffcc84, 0xffffcc84, 0xffffcc84, 0xffffcc84},
  9942. {0x0000a2e4, 0xfffff000, 0xfffff000, 0xfffff000, 0xfffff000},
  9943. {0x0000a2e8, 0xfffe0000, 0xfffe0000, 0xfffe0000, 0xfffe0000},
  9944. - {0x0000a410, 0x000050d7, 0x000050d7, 0x000050d0, 0x000050d0},
  9945. + {0x0000a410, 0x000050d7, 0x000050d7, 0x000050d4, 0x000050d4},
  9946. {0x0000a500, 0x00022200, 0x00022200, 0x00000000, 0x00000000},
  9947. {0x0000a504, 0x05062002, 0x05062002, 0x04000002, 0x04000002},
  9948. {0x0000a508, 0x0c002e00, 0x0c002e00, 0x08000004, 0x08000004},
  9949. @@ -337,8 +341,6 @@ static const u32 ar9331_modes_low_ob_db_
  9950. {0x00016284, 0x14d3f000, 0x14d3f000, 0x14d3f000, 0x14d3f000},
  9951. };
  9952. -#define ar9331_1p1_baseband_core_txfir_coeff_japan_2484 ar9462_2p0_baseband_core_txfir_coeff_japan_2484
  9953. -
  9954. static const u32 ar9331_1p1_xtal_25M[][2] = {
  9955. /* Addr allmodes */
  9956. {0x00007038, 0x000002f8},
  9957. @@ -373,17 +375,17 @@ static const u32 ar9331_1p1_radio_core[]
  9958. {0x000160b4, 0x92480040},
  9959. {0x000160c0, 0x006db6db},
  9960. {0x000160c4, 0x0186db60},
  9961. - {0x000160c8, 0x6db4db6c},
  9962. + {0x000160c8, 0x6db6db6c},
  9963. {0x000160cc, 0x6de6c300},
  9964. {0x000160d0, 0x14500820},
  9965. {0x00016100, 0x04cb0001},
  9966. {0x00016104, 0xfff80015},
  9967. {0x00016108, 0x00080010},
  9968. {0x0001610c, 0x00170000},
  9969. - {0x00016140, 0x10800000},
  9970. + {0x00016140, 0x50804000},
  9971. {0x00016144, 0x01884080},
  9972. {0x00016148, 0x000080c0},
  9973. - {0x00016280, 0x01000015},
  9974. + {0x00016280, 0x01001015},
  9975. {0x00016284, 0x14d20000},
  9976. {0x00016288, 0x00318000},
  9977. {0x0001628c, 0x50000000},
  9978. @@ -622,12 +624,12 @@ static const u32 ar9331_1p1_baseband_cor
  9979. {0x0000a370, 0x00000000},
  9980. {0x0000a390, 0x00000001},
  9981. {0x0000a394, 0x00000444},
  9982. - {0x0000a398, 0x001f0e0f},
  9983. - {0x0000a39c, 0x0075393f},
  9984. - {0x0000a3a0, 0xb79f6427},
  9985. - {0x0000a3a4, 0x00000000},
  9986. - {0x0000a3a8, 0xaaaaaaaa},
  9987. - {0x0000a3ac, 0x3c466478},
  9988. + {0x0000a398, 0x00000000},
  9989. + {0x0000a39c, 0x210d0401},
  9990. + {0x0000a3a0, 0xab9a7144},
  9991. + {0x0000a3a4, 0x00000011},
  9992. + {0x0000a3a8, 0x3c3c003d},
  9993. + {0x0000a3ac, 0x30310030},
  9994. {0x0000a3c0, 0x20202020},
  9995. {0x0000a3c4, 0x22222220},
  9996. {0x0000a3c8, 0x20200020},
  9997. @@ -686,100 +688,18 @@ static const u32 ar9331_1p1_baseband_cor
  9998. {0x0000a7dc, 0x00000001},
  9999. };
  10000. -static const u32 ar9331_modes_high_power_tx_gain_1p1[][5] = {
  10001. +static const u32 ar9331_1p1_mac_postamble[][5] = {
  10002. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  10003. - {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a},
  10004. - {0x0000a2dc, 0xffff2a52, 0xffff2a52, 0xffff2a52, 0xffff2a52},
  10005. - {0x0000a2e0, 0xffffcc84, 0xffffcc84, 0xffffcc84, 0xffffcc84},
  10006. - {0x0000a2e4, 0xfffff000, 0xfffff000, 0xfffff000, 0xfffff000},
  10007. - {0x0000a2e8, 0xfffe0000, 0xfffe0000, 0xfffe0000, 0xfffe0000},
  10008. - {0x0000a410, 0x000050d7, 0x000050d7, 0x000050d0, 0x000050d0},
  10009. - {0x0000a500, 0x00022200, 0x00022200, 0x00000000, 0x00000000},
  10010. - {0x0000a504, 0x05062002, 0x05062002, 0x04000002, 0x04000002},
  10011. - {0x0000a508, 0x0c002e00, 0x0c002e00, 0x08000004, 0x08000004},
  10012. - {0x0000a50c, 0x11062202, 0x11062202, 0x0d000200, 0x0d000200},
  10013. - {0x0000a510, 0x17022e00, 0x17022e00, 0x11000202, 0x11000202},
  10014. - {0x0000a514, 0x1d000ec2, 0x1d000ec2, 0x15000400, 0x15000400},
  10015. - {0x0000a518, 0x25020ec0, 0x25020ec0, 0x19000402, 0x19000402},
  10016. - {0x0000a51c, 0x2b020ec3, 0x2b020ec3, 0x1d000404, 0x1d000404},
  10017. - {0x0000a520, 0x2f001f04, 0x2f001f04, 0x23000a00, 0x23000a00},
  10018. - {0x0000a524, 0x35001fc4, 0x35001fc4, 0x27000a02, 0x27000a02},
  10019. - {0x0000a528, 0x3c022f04, 0x3c022f04, 0x2b000a04, 0x2b000a04},
  10020. - {0x0000a52c, 0x41023e85, 0x41023e85, 0x2d000a20, 0x2d000a20},
  10021. - {0x0000a530, 0x48023ec6, 0x48023ec6, 0x31000a22, 0x31000a22},
  10022. - {0x0000a534, 0x4d023f01, 0x4d023f01, 0x35000a24, 0x35000a24},
  10023. - {0x0000a538, 0x53023f4b, 0x53023f4b, 0x38000a43, 0x38000a43},
  10024. - {0x0000a53c, 0x5a027f09, 0x5a027f09, 0x3b000e42, 0x3b000e42},
  10025. - {0x0000a540, 0x5f027fc9, 0x5f027fc9, 0x3f000e44, 0x3f000e44},
  10026. - {0x0000a544, 0x6502feca, 0x6502feca, 0x42000e64, 0x42000e64},
  10027. - {0x0000a548, 0x6b02ff4a, 0x6b02ff4a, 0x46000e66, 0x46000e66},
  10028. - {0x0000a54c, 0x7203feca, 0x7203feca, 0x4a000ea6, 0x4a000ea6},
  10029. - {0x0000a550, 0x7703ff0b, 0x7703ff0b, 0x4a000ea6, 0x4a000ea6},
  10030. - {0x0000a554, 0x7d06ffcb, 0x7d06ffcb, 0x4a000ea6, 0x4a000ea6},
  10031. - {0x0000a558, 0x8407ff0b, 0x8407ff0b, 0x4a000ea6, 0x4a000ea6},
  10032. - {0x0000a55c, 0x8907ffcb, 0x8907ffcb, 0x4a000ea6, 0x4a000ea6},
  10033. - {0x0000a560, 0x900fff0b, 0x900fff0b, 0x4a000ea6, 0x4a000ea6},
  10034. - {0x0000a564, 0x960fffcb, 0x960fffcb, 0x4a000ea6, 0x4a000ea6},
  10035. - {0x0000a568, 0x9c1fff0b, 0x9c1fff0b, 0x4a000ea6, 0x4a000ea6},
  10036. - {0x0000a56c, 0x9c1fff0b, 0x9c1fff0b, 0x4a000ea6, 0x4a000ea6},
  10037. - {0x0000a570, 0x9c1fff0b, 0x9c1fff0b, 0x4a000ea6, 0x4a000ea6},
  10038. - {0x0000a574, 0x9c1fff0b, 0x9c1fff0b, 0x4a000ea6, 0x4a000ea6},
  10039. - {0x0000a578, 0x9c1fff0b, 0x9c1fff0b, 0x4a000ea6, 0x4a000ea6},
  10040. - {0x0000a57c, 0x9c1fff0b, 0x9c1fff0b, 0x4a000ea6, 0x4a000ea6},
  10041. - {0x0000a580, 0x00022200, 0x00022200, 0x00000000, 0x00000000},
  10042. - {0x0000a584, 0x05062002, 0x05062002, 0x04000002, 0x04000002},
  10043. - {0x0000a588, 0x0c002e00, 0x0c002e00, 0x08000004, 0x08000004},
  10044. - {0x0000a58c, 0x11062202, 0x11062202, 0x0b000200, 0x0b000200},
  10045. - {0x0000a590, 0x17022e00, 0x17022e00, 0x0f000202, 0x0f000202},
  10046. - {0x0000a594, 0x1d000ec2, 0x1d000ec2, 0x11000400, 0x11000400},
  10047. - {0x0000a598, 0x25020ec0, 0x25020ec0, 0x15000402, 0x15000402},
  10048. - {0x0000a59c, 0x2b020ec3, 0x2b020ec3, 0x19000404, 0x19000404},
  10049. - {0x0000a5a0, 0x2f001f04, 0x2f001f04, 0x1b000603, 0x1b000603},
  10050. - {0x0000a5a4, 0x35001fc4, 0x35001fc4, 0x1f000a02, 0x1f000a02},
  10051. - {0x0000a5a8, 0x3c022f04, 0x3c022f04, 0x23000a04, 0x23000a04},
  10052. - {0x0000a5ac, 0x41023e85, 0x41023e85, 0x26000a20, 0x26000a20},
  10053. - {0x0000a5b0, 0x48023ec6, 0x48023ec6, 0x2a000e20, 0x2a000e20},
  10054. - {0x0000a5b4, 0x4d023f01, 0x4d023f01, 0x2e000e22, 0x2e000e22},
  10055. - {0x0000a5b8, 0x53023f4b, 0x53023f4b, 0x31000e24, 0x31000e24},
  10056. - {0x0000a5bc, 0x5a027f09, 0x5a027f09, 0x34001640, 0x34001640},
  10057. - {0x0000a5c0, 0x5f027fc9, 0x5f027fc9, 0x38001660, 0x38001660},
  10058. - {0x0000a5c4, 0x6502feca, 0x6502feca, 0x3b001861, 0x3b001861},
  10059. - {0x0000a5c8, 0x6b02ff4a, 0x6b02ff4a, 0x3e001a81, 0x3e001a81},
  10060. - {0x0000a5cc, 0x7203feca, 0x7203feca, 0x42001a83, 0x42001a83},
  10061. - {0x0000a5d0, 0x7703ff0b, 0x7703ff0b, 0x44001c84, 0x44001c84},
  10062. - {0x0000a5d4, 0x7d06ffcb, 0x7d06ffcb, 0x48001ce3, 0x48001ce3},
  10063. - {0x0000a5d8, 0x8407ff0b, 0x8407ff0b, 0x4c001ce5, 0x4c001ce5},
  10064. - {0x0000a5dc, 0x8907ffcb, 0x8907ffcb, 0x50001ce9, 0x50001ce9},
  10065. - {0x0000a5e0, 0x900fff0b, 0x900fff0b, 0x54001ceb, 0x54001ceb},
  10066. - {0x0000a5e4, 0x960fffcb, 0x960fffcb, 0x56001eec, 0x56001eec},
  10067. - {0x0000a5e8, 0x9c1fff0b, 0x9c1fff0b, 0x56001eec, 0x56001eec},
  10068. - {0x0000a5ec, 0x9c1fff0b, 0x9c1fff0b, 0x56001eec, 0x56001eec},
  10069. - {0x0000a5f0, 0x9c1fff0b, 0x9c1fff0b, 0x56001eec, 0x56001eec},
  10070. - {0x0000a5f4, 0x9c1fff0b, 0x9c1fff0b, 0x56001eec, 0x56001eec},
  10071. - {0x0000a5f8, 0x9c1fff0b, 0x9c1fff0b, 0x56001eec, 0x56001eec},
  10072. - {0x0000a5fc, 0x9c1fff0b, 0x9c1fff0b, 0x56001eec, 0x56001eec},
  10073. - {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10074. - {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10075. - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10076. - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10077. - {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10078. - {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
  10079. - {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
  10080. - {0x0000a61c, 0x02008802, 0x02008802, 0x02008802, 0x02008802},
  10081. - {0x0000a620, 0x0280c802, 0x0280c802, 0x0280c802, 0x0280c802},
  10082. - {0x0000a624, 0x03010a03, 0x03010a03, 0x03010a03, 0x03010a03},
  10083. - {0x0000a628, 0x03010c04, 0x03010c04, 0x03010c04, 0x03010c04},
  10084. - {0x0000a62c, 0x03010c04, 0x03010c04, 0x03010c04, 0x03010c04},
  10085. - {0x0000a630, 0x03010c04, 0x03010c04, 0x03010c04, 0x03010c04},
  10086. - {0x0000a634, 0x03010c04, 0x03010c04, 0x03010c04, 0x03010c04},
  10087. - {0x0000a638, 0x03010c04, 0x03010c04, 0x03010c04, 0x03010c04},
  10088. - {0x0000a63c, 0x03010c04, 0x03010c04, 0x03010c04, 0x03010c04},
  10089. - {0x00016044, 0x034922db, 0x034922db, 0x034922db, 0x034922db},
  10090. - {0x00016284, 0x14d3f000, 0x14d3f000, 0x14d3f000, 0x14d3f000},
  10091. + {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
  10092. + {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
  10093. + {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
  10094. + {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
  10095. + {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
  10096. + {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
  10097. + {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
  10098. + {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
  10099. };
  10100. -#define ar9331_1p1_mac_postamble ar9300_2p2_mac_postamble
  10101. -
  10102. static const u32 ar9331_1p1_soc_preamble[][2] = {
  10103. /* Addr allmodes */
  10104. {0x00007020, 0x00000000},
  10105. --- a/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
  10106. +++ b/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
  10107. @@ -18,6 +18,28 @@
  10108. #ifndef INITVALS_9330_1P2_H
  10109. #define INITVALS_9330_1P2_H
  10110. +#define ar9331_modes_high_power_tx_gain_1p2 ar9331_modes_high_ob_db_tx_gain_1p2
  10111. +
  10112. +#define ar9331_modes_low_ob_db_tx_gain_1p2 ar9331_modes_high_ob_db_tx_gain_1p2
  10113. +
  10114. +#define ar9331_modes_lowest_ob_db_tx_gain_1p2 ar9331_modes_high_ob_db_tx_gain_1p2
  10115. +
  10116. +#define ar9331_1p2_baseband_core_txfir_coeff_japan_2484 ar9331_1p1_baseband_core_txfir_coeff_japan_2484
  10117. +
  10118. +#define ar9331_1p2_xtal_25M ar9331_1p1_xtal_25M
  10119. +
  10120. +#define ar9331_1p2_xtal_40M ar9331_1p1_xtal_40M
  10121. +
  10122. +#define ar9331_1p2_soc_postamble ar9331_1p1_soc_postamble
  10123. +
  10124. +#define ar9331_1p2_mac_postamble ar9331_1p1_mac_postamble
  10125. +
  10126. +#define ar9331_1p2_soc_preamble ar9331_1p1_soc_preamble
  10127. +
  10128. +#define ar9331_1p2_mac_core ar9331_1p1_mac_core
  10129. +
  10130. +#define ar9331_common_wo_xlna_rx_gain_1p2 ar9331_common_wo_xlna_rx_gain_1p1
  10131. +
  10132. static const u32 ar9331_modes_high_ob_db_tx_gain_1p2[][5] = {
  10133. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  10134. {0x0000a410, 0x000050d7, 0x000050d7, 0x000050d7, 0x000050d7},
  10135. @@ -103,57 +125,6 @@ static const u32 ar9331_modes_high_ob_db
  10136. {0x0000a63c, 0x04011004, 0x04011004, 0x04011004, 0x04011004},
  10137. };
  10138. -#define ar9331_modes_high_power_tx_gain_1p2 ar9331_modes_high_ob_db_tx_gain_1p2
  10139. -
  10140. -#define ar9331_modes_low_ob_db_tx_gain_1p2 ar9331_modes_high_power_tx_gain_1p2
  10141. -
  10142. -#define ar9331_modes_lowest_ob_db_tx_gain_1p2 ar9331_modes_low_ob_db_tx_gain_1p2
  10143. -
  10144. -static const u32 ar9331_1p2_baseband_postamble[][5] = {
  10145. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  10146. - {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a8005},
  10147. - {0x00009820, 0x206a002e, 0x206a002e, 0x206a002e, 0x206a002e},
  10148. - {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
  10149. - {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
  10150. - {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
  10151. - {0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x0000059c},
  10152. - {0x00009c00, 0x00000044, 0x00000044, 0x00000044, 0x00000044},
  10153. - {0x00009e00, 0x0372161e, 0x0372161e, 0x037216a4, 0x037216a4},
  10154. - {0x00009e04, 0x00182020, 0x00182020, 0x00182020, 0x00182020},
  10155. - {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2},
  10156. - {0x00009e10, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e},
  10157. - {0x00009e14, 0x31395d5e, 0x3139605e, 0x3139605e, 0x31395d5e},
  10158. - {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10159. - {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
  10160. - {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
  10161. - {0x00009e2c, 0x0000001c, 0x0000001c, 0x00003221, 0x00003221},
  10162. - {0x00009e3c, 0xcf946222, 0xcf946222, 0xcf946222, 0xcf946222},
  10163. - {0x00009e44, 0x02321e27, 0x02321e27, 0x02282324, 0x02282324},
  10164. - {0x00009e48, 0x5030201a, 0x5030201a, 0x50302010, 0x50302010},
  10165. - {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
  10166. - {0x0000a204, 0x00003fc0, 0x00003fc4, 0x00003fc4, 0x00003fc0},
  10167. - {0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004},
  10168. - {0x0000a230, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b},
  10169. - {0x0000a234, 0x00000fff, 0x00000fff, 0x10000fff, 0x00000fff},
  10170. - {0x0000a238, 0xffb81018, 0xffb81018, 0xffb81018, 0xffb81018},
  10171. - {0x0000a250, 0x00000000, 0x00000000, 0x00000210, 0x00000108},
  10172. - {0x0000a254, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898},
  10173. - {0x0000a258, 0x02020002, 0x02020002, 0x02020002, 0x02020002},
  10174. - {0x0000a25c, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e},
  10175. - {0x0000a260, 0x3a021501, 0x3a021501, 0x3a021501, 0x3a021501},
  10176. - {0x0000a264, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
  10177. - {0x0000a280, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b},
  10178. - {0x0000a284, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10179. - {0x0000a288, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10180. - {0x0000a28c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10181. - {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
  10182. - {0x0000a2d0, 0x00071981, 0x00071981, 0x00071981, 0x00071981},
  10183. - {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a},
  10184. - {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10185. - {0x0000ae04, 0x00802020, 0x00802020, 0x00802020, 0x00802020},
  10186. - {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10187. -};
  10188. -
  10189. static const u32 ar9331_1p2_radio_core[][2] = {
  10190. /* Addr allmodes */
  10191. {0x00016000, 0x36db6db6},
  10192. @@ -219,24 +190,318 @@ static const u32 ar9331_1p2_radio_core[]
  10193. {0x000163d4, 0x00000000},
  10194. };
  10195. -#define ar9331_1p2_baseband_core_txfir_coeff_japan_2484 ar9331_1p1_baseband_core_txfir_coeff_japan_2484
  10196. -
  10197. -#define ar9331_1p2_xtal_25M ar9331_1p1_xtal_25M
  10198. -
  10199. -#define ar9331_1p2_xtal_40M ar9331_1p1_xtal_40M
  10200. -
  10201. -#define ar9331_1p2_baseband_core ar9331_1p1_baseband_core
  10202. -
  10203. -#define ar9331_1p2_soc_postamble ar9331_1p1_soc_postamble
  10204. -
  10205. -#define ar9331_1p2_mac_postamble ar9331_1p1_mac_postamble
  10206. -
  10207. -#define ar9331_1p2_soc_preamble ar9331_1p1_soc_preamble
  10208. -
  10209. -#define ar9331_1p2_mac_core ar9331_1p1_mac_core
  10210. +static const u32 ar9331_1p2_baseband_core[][2] = {
  10211. + /* Addr allmodes */
  10212. + {0x00009800, 0xafe68e30},
  10213. + {0x00009804, 0xfd14e000},
  10214. + {0x00009808, 0x9c0a8f6b},
  10215. + {0x0000980c, 0x04800000},
  10216. + {0x00009814, 0x9280c00a},
  10217. + {0x00009818, 0x00000000},
  10218. + {0x0000981c, 0x00020028},
  10219. + {0x00009834, 0x5f3ca3de},
  10220. + {0x00009838, 0x0108ecff},
  10221. + {0x0000983c, 0x14750600},
  10222. + {0x00009880, 0x201fff00},
  10223. + {0x00009884, 0x00001042},
  10224. + {0x000098a4, 0x00200400},
  10225. + {0x000098b0, 0x32840bbe},
  10226. + {0x000098d0, 0x004b6a8e},
  10227. + {0x000098d4, 0x00000820},
  10228. + {0x000098dc, 0x00000000},
  10229. + {0x000098f0, 0x00000000},
  10230. + {0x000098f4, 0x00000000},
  10231. + {0x00009c04, 0x00000000},
  10232. + {0x00009c08, 0x03200000},
  10233. + {0x00009c0c, 0x00000000},
  10234. + {0x00009c10, 0x00000000},
  10235. + {0x00009c14, 0x00046384},
  10236. + {0x00009c18, 0x05b6b440},
  10237. + {0x00009c1c, 0x00b6b440},
  10238. + {0x00009d00, 0xc080a333},
  10239. + {0x00009d04, 0x40206c10},
  10240. + {0x00009d08, 0x009c4060},
  10241. + {0x00009d0c, 0x1883800a},
  10242. + {0x00009d10, 0x01834061},
  10243. + {0x00009d14, 0x00c00400},
  10244. + {0x00009d18, 0x00000000},
  10245. + {0x00009e08, 0x0038233c},
  10246. + {0x00009e24, 0x9927b515},
  10247. + {0x00009e28, 0x12ef0200},
  10248. + {0x00009e30, 0x06336f77},
  10249. + {0x00009e34, 0x6af6532f},
  10250. + {0x00009e38, 0x0cc80c00},
  10251. + {0x00009e40, 0x0d261820},
  10252. + {0x00009e4c, 0x00001004},
  10253. + {0x00009e50, 0x00ff03f1},
  10254. + {0x00009fc0, 0x803e4788},
  10255. + {0x00009fc4, 0x0001efb5},
  10256. + {0x00009fcc, 0x40000014},
  10257. + {0x0000a20c, 0x00000000},
  10258. + {0x0000a220, 0x00000000},
  10259. + {0x0000a224, 0x00000000},
  10260. + {0x0000a228, 0x10002310},
  10261. + {0x0000a23c, 0x00000000},
  10262. + {0x0000a244, 0x0c000000},
  10263. + {0x0000a2a0, 0x00000001},
  10264. + {0x0000a2c0, 0x00000001},
  10265. + {0x0000a2c8, 0x00000000},
  10266. + {0x0000a2cc, 0x18c43433},
  10267. + {0x0000a2d4, 0x00000000},
  10268. + {0x0000a2dc, 0x00000000},
  10269. + {0x0000a2e0, 0x00000000},
  10270. + {0x0000a2e4, 0x00000000},
  10271. + {0x0000a2e8, 0x00000000},
  10272. + {0x0000a2ec, 0x00000000},
  10273. + {0x0000a2f0, 0x00000000},
  10274. + {0x0000a2f4, 0x00000000},
  10275. + {0x0000a2f8, 0x00000000},
  10276. + {0x0000a344, 0x00000000},
  10277. + {0x0000a34c, 0x00000000},
  10278. + {0x0000a350, 0x0000a000},
  10279. + {0x0000a364, 0x00000000},
  10280. + {0x0000a370, 0x00000000},
  10281. + {0x0000a390, 0x00000001},
  10282. + {0x0000a394, 0x00000444},
  10283. + {0x0000a398, 0x001f0e0f},
  10284. + {0x0000a39c, 0x0075393f},
  10285. + {0x0000a3a0, 0xb79f6427},
  10286. + {0x0000a3a4, 0x00000000},
  10287. + {0x0000a3a8, 0xaaaaaaaa},
  10288. + {0x0000a3ac, 0x3c466478},
  10289. + {0x0000a3c0, 0x20202020},
  10290. + {0x0000a3c4, 0x22222220},
  10291. + {0x0000a3c8, 0x20200020},
  10292. + {0x0000a3cc, 0x20202020},
  10293. + {0x0000a3d0, 0x20202020},
  10294. + {0x0000a3d4, 0x20202020},
  10295. + {0x0000a3d8, 0x20202020},
  10296. + {0x0000a3dc, 0x20202020},
  10297. + {0x0000a3e0, 0x20202020},
  10298. + {0x0000a3e4, 0x20202020},
  10299. + {0x0000a3e8, 0x20202020},
  10300. + {0x0000a3ec, 0x20202020},
  10301. + {0x0000a3f0, 0x00000000},
  10302. + {0x0000a3f4, 0x00000006},
  10303. + {0x0000a3f8, 0x0cdbd380},
  10304. + {0x0000a3fc, 0x000f0f01},
  10305. + {0x0000a400, 0x8fa91f01},
  10306. + {0x0000a404, 0x00000000},
  10307. + {0x0000a408, 0x0e79e5c6},
  10308. + {0x0000a40c, 0x00820820},
  10309. + {0x0000a414, 0x1ce739ce},
  10310. + {0x0000a418, 0x2d001dce},
  10311. + {0x0000a41c, 0x1ce739ce},
  10312. + {0x0000a420, 0x000001ce},
  10313. + {0x0000a424, 0x1ce739ce},
  10314. + {0x0000a428, 0x000001ce},
  10315. + {0x0000a42c, 0x1ce739ce},
  10316. + {0x0000a430, 0x1ce739ce},
  10317. + {0x0000a434, 0x00000000},
  10318. + {0x0000a438, 0x00001801},
  10319. + {0x0000a43c, 0x00000000},
  10320. + {0x0000a440, 0x00000000},
  10321. + {0x0000a444, 0x00000000},
  10322. + {0x0000a448, 0x04000000},
  10323. + {0x0000a44c, 0x00000001},
  10324. + {0x0000a450, 0x00010000},
  10325. + {0x0000a458, 0x00000000},
  10326. + {0x0000a640, 0x00000000},
  10327. + {0x0000a644, 0x3fad9d74},
  10328. + {0x0000a648, 0x0048060a},
  10329. + {0x0000a64c, 0x00003c37},
  10330. + {0x0000a670, 0x03020100},
  10331. + {0x0000a674, 0x09080504},
  10332. + {0x0000a678, 0x0d0c0b0a},
  10333. + {0x0000a67c, 0x13121110},
  10334. + {0x0000a680, 0x31301514},
  10335. + {0x0000a684, 0x35343332},
  10336. + {0x0000a688, 0x00000036},
  10337. + {0x0000a690, 0x00000838},
  10338. + {0x0000a7c0, 0x00000000},
  10339. + {0x0000a7c4, 0xfffffffc},
  10340. + {0x0000a7c8, 0x00000000},
  10341. + {0x0000a7cc, 0x00000000},
  10342. + {0x0000a7d0, 0x00000000},
  10343. + {0x0000a7d4, 0x00000004},
  10344. + {0x0000a7dc, 0x00000001},
  10345. +};
  10346. -#define ar9331_common_wo_xlna_rx_gain_1p2 ar9331_common_wo_xlna_rx_gain_1p1
  10347. +static const u32 ar9331_1p2_baseband_postamble[][5] = {
  10348. + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  10349. + {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a8005},
  10350. + {0x00009820, 0x206a002e, 0x206a002e, 0x206a002e, 0x206a002e},
  10351. + {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
  10352. + {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
  10353. + {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
  10354. + {0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x0000059c},
  10355. + {0x00009c00, 0x00000044, 0x00000044, 0x00000044, 0x00000044},
  10356. + {0x00009e00, 0x0372161e, 0x0372161e, 0x037216a4, 0x037216a4},
  10357. + {0x00009e04, 0x00182020, 0x00182020, 0x00182020, 0x00182020},
  10358. + {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2},
  10359. + {0x00009e10, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e, 0x7ec80d2e},
  10360. + {0x00009e14, 0x31395d5e, 0x3139605e, 0x3139605e, 0x31395d5e},
  10361. + {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10362. + {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
  10363. + {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
  10364. + {0x00009e2c, 0x0000001c, 0x0000001c, 0x00003221, 0x00003221},
  10365. + {0x00009e3c, 0xcf946222, 0xcf946222, 0xcf946222, 0xcf946222},
  10366. + {0x00009e44, 0x02321e27, 0x02321e27, 0x02282324, 0x02282324},
  10367. + {0x00009e48, 0x5030201a, 0x5030201a, 0x50302010, 0x50302010},
  10368. + {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
  10369. + {0x0000a204, 0x00003fc0, 0x00003fc4, 0x00003fc4, 0x00003fc0},
  10370. + {0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004},
  10371. + {0x0000a230, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b},
  10372. + {0x0000a234, 0x00000fff, 0x00000fff, 0x10000fff, 0x00000fff},
  10373. + {0x0000a238, 0xffb81018, 0xffb81018, 0xffb81018, 0xffb81018},
  10374. + {0x0000a250, 0x00000000, 0x00000000, 0x00000210, 0x00000108},
  10375. + {0x0000a254, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898},
  10376. + {0x0000a258, 0x02020002, 0x02020002, 0x02020002, 0x02020002},
  10377. + {0x0000a25c, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e},
  10378. + {0x0000a260, 0x3a021501, 0x3a021501, 0x3a021501, 0x3a021501},
  10379. + {0x0000a264, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
  10380. + {0x0000a280, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b},
  10381. + {0x0000a284, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10382. + {0x0000a288, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10383. + {0x0000a28c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10384. + {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
  10385. + {0x0000a2d0, 0x00071981, 0x00071981, 0x00071981, 0x00071981},
  10386. + {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a},
  10387. + {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10388. + {0x0000ae04, 0x00802020, 0x00802020, 0x00802020, 0x00802020},
  10389. + {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  10390. +};
  10391. -#define ar9331_common_rx_gain_1p2 ar9485_common_rx_gain_1_1
  10392. +static const u32 ar9331_common_rx_gain_1p2[][2] = {
  10393. + /* Addr allmodes */
  10394. + {0x0000a000, 0x00010000},
  10395. + {0x0000a004, 0x00030002},
  10396. + {0x0000a008, 0x00050004},
  10397. + {0x0000a00c, 0x00810080},
  10398. + {0x0000a010, 0x01800082},
  10399. + {0x0000a014, 0x01820181},
  10400. + {0x0000a018, 0x01840183},
  10401. + {0x0000a01c, 0x01880185},
  10402. + {0x0000a020, 0x018a0189},
  10403. + {0x0000a024, 0x02850284},
  10404. + {0x0000a028, 0x02890288},
  10405. + {0x0000a02c, 0x03850384},
  10406. + {0x0000a030, 0x03890388},
  10407. + {0x0000a034, 0x038b038a},
  10408. + {0x0000a038, 0x038d038c},
  10409. + {0x0000a03c, 0x03910390},
  10410. + {0x0000a040, 0x03930392},
  10411. + {0x0000a044, 0x03950394},
  10412. + {0x0000a048, 0x00000396},
  10413. + {0x0000a04c, 0x00000000},
  10414. + {0x0000a050, 0x00000000},
  10415. + {0x0000a054, 0x00000000},
  10416. + {0x0000a058, 0x00000000},
  10417. + {0x0000a05c, 0x00000000},
  10418. + {0x0000a060, 0x00000000},
  10419. + {0x0000a064, 0x00000000},
  10420. + {0x0000a068, 0x00000000},
  10421. + {0x0000a06c, 0x00000000},
  10422. + {0x0000a070, 0x00000000},
  10423. + {0x0000a074, 0x00000000},
  10424. + {0x0000a078, 0x00000000},
  10425. + {0x0000a07c, 0x00000000},
  10426. + {0x0000a080, 0x28282828},
  10427. + {0x0000a084, 0x28282828},
  10428. + {0x0000a088, 0x28282828},
  10429. + {0x0000a08c, 0x28282828},
  10430. + {0x0000a090, 0x28282828},
  10431. + {0x0000a094, 0x21212128},
  10432. + {0x0000a098, 0x171c1c1c},
  10433. + {0x0000a09c, 0x02020212},
  10434. + {0x0000a0a0, 0x00000202},
  10435. + {0x0000a0a4, 0x00000000},
  10436. + {0x0000a0a8, 0x00000000},
  10437. + {0x0000a0ac, 0x00000000},
  10438. + {0x0000a0b0, 0x00000000},
  10439. + {0x0000a0b4, 0x00000000},
  10440. + {0x0000a0b8, 0x00000000},
  10441. + {0x0000a0bc, 0x00000000},
  10442. + {0x0000a0c0, 0x001f0000},
  10443. + {0x0000a0c4, 0x111f1100},
  10444. + {0x0000a0c8, 0x111d111e},
  10445. + {0x0000a0cc, 0x111b111c},
  10446. + {0x0000a0d0, 0x22032204},
  10447. + {0x0000a0d4, 0x22012202},
  10448. + {0x0000a0d8, 0x221f2200},
  10449. + {0x0000a0dc, 0x221d221e},
  10450. + {0x0000a0e0, 0x33013302},
  10451. + {0x0000a0e4, 0x331f3300},
  10452. + {0x0000a0e8, 0x4402331e},
  10453. + {0x0000a0ec, 0x44004401},
  10454. + {0x0000a0f0, 0x441e441f},
  10455. + {0x0000a0f4, 0x55015502},
  10456. + {0x0000a0f8, 0x551f5500},
  10457. + {0x0000a0fc, 0x6602551e},
  10458. + {0x0000a100, 0x66006601},
  10459. + {0x0000a104, 0x661e661f},
  10460. + {0x0000a108, 0x7703661d},
  10461. + {0x0000a10c, 0x77017702},
  10462. + {0x0000a110, 0x00007700},
  10463. + {0x0000a114, 0x00000000},
  10464. + {0x0000a118, 0x00000000},
  10465. + {0x0000a11c, 0x00000000},
  10466. + {0x0000a120, 0x00000000},
  10467. + {0x0000a124, 0x00000000},
  10468. + {0x0000a128, 0x00000000},
  10469. + {0x0000a12c, 0x00000000},
  10470. + {0x0000a130, 0x00000000},
  10471. + {0x0000a134, 0x00000000},
  10472. + {0x0000a138, 0x00000000},
  10473. + {0x0000a13c, 0x00000000},
  10474. + {0x0000a140, 0x001f0000},
  10475. + {0x0000a144, 0x111f1100},
  10476. + {0x0000a148, 0x111d111e},
  10477. + {0x0000a14c, 0x111b111c},
  10478. + {0x0000a150, 0x22032204},
  10479. + {0x0000a154, 0x22012202},
  10480. + {0x0000a158, 0x221f2200},
  10481. + {0x0000a15c, 0x221d221e},
  10482. + {0x0000a160, 0x33013302},
  10483. + {0x0000a164, 0x331f3300},
  10484. + {0x0000a168, 0x4402331e},
  10485. + {0x0000a16c, 0x44004401},
  10486. + {0x0000a170, 0x441e441f},
  10487. + {0x0000a174, 0x55015502},
  10488. + {0x0000a178, 0x551f5500},
  10489. + {0x0000a17c, 0x6602551e},
  10490. + {0x0000a180, 0x66006601},
  10491. + {0x0000a184, 0x661e661f},
  10492. + {0x0000a188, 0x7703661d},
  10493. + {0x0000a18c, 0x77017702},
  10494. + {0x0000a190, 0x00007700},
  10495. + {0x0000a194, 0x00000000},
  10496. + {0x0000a198, 0x00000000},
  10497. + {0x0000a19c, 0x00000000},
  10498. + {0x0000a1a0, 0x00000000},
  10499. + {0x0000a1a4, 0x00000000},
  10500. + {0x0000a1a8, 0x00000000},
  10501. + {0x0000a1ac, 0x00000000},
  10502. + {0x0000a1b0, 0x00000000},
  10503. + {0x0000a1b4, 0x00000000},
  10504. + {0x0000a1b8, 0x00000000},
  10505. + {0x0000a1bc, 0x00000000},
  10506. + {0x0000a1c0, 0x00000000},
  10507. + {0x0000a1c4, 0x00000000},
  10508. + {0x0000a1c8, 0x00000000},
  10509. + {0x0000a1cc, 0x00000000},
  10510. + {0x0000a1d0, 0x00000000},
  10511. + {0x0000a1d4, 0x00000000},
  10512. + {0x0000a1d8, 0x00000000},
  10513. + {0x0000a1dc, 0x00000000},
  10514. + {0x0000a1e0, 0x00000000},
  10515. + {0x0000a1e4, 0x00000000},
  10516. + {0x0000a1e8, 0x00000000},
  10517. + {0x0000a1ec, 0x00000000},
  10518. + {0x0000a1f0, 0x00000396},
  10519. + {0x0000a1f4, 0x00000396},
  10520. + {0x0000a1f8, 0x00000396},
  10521. + {0x0000a1fc, 0x00000296},
  10522. +};
  10523. #endif /* INITVALS_9330_1P2_H */
  10524. --- a/drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h
  10525. +++ b/drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h
  10526. @@ -20,6 +20,14 @@
  10527. /* AR955X 1.0 */
  10528. +#define ar955x_1p0_soc_postamble ar9300_2p2_soc_postamble
  10529. +
  10530. +#define ar955x_1p0_common_rx_gain_table ar9300Common_rx_gain_table_2p2
  10531. +
  10532. +#define ar955x_1p0_common_wo_xlna_rx_gain_table ar9300Common_wo_xlna_rx_gain_table_2p2
  10533. +
  10534. +#define ar955x_1p0_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
  10535. +
  10536. static const u32 ar955x_1p0_radio_postamble[][5] = {
  10537. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  10538. {0x00016098, 0xd2dd5554, 0xd2dd5554, 0xd28b3330, 0xd28b3330},
  10539. @@ -37,13 +45,6 @@ static const u32 ar955x_1p0_radio_postam
  10540. {0x00016940, 0x10804008, 0x10804008, 0x10804008, 0x10804008},
  10541. };
  10542. -static const u32 ar955x_1p0_baseband_core_txfir_coeff_japan_2484[][2] = {
  10543. - /* Addr allmodes */
  10544. - {0x0000a398, 0x00000000},
  10545. - {0x0000a39c, 0x6f7f0301},
  10546. - {0x0000a3a0, 0xca9228ee},
  10547. -};
  10548. -
  10549. static const u32 ar955x_1p0_baseband_postamble[][5] = {
  10550. /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  10551. {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011},
  10552. @@ -473,266 +474,6 @@ static const u32 ar955x_1p0_mac_core[][2
  10553. {0x000083d0, 0x8c7901ff},
  10554. };
  10555. -static const u32 ar955x_1p0_common_rx_gain_table[][2] = {
  10556. - /* Addr allmodes */
  10557. - {0x0000a000, 0x00010000},
  10558. - {0x0000a004, 0x00030002},
  10559. - {0x0000a008, 0x00050004},
  10560. - {0x0000a00c, 0x00810080},
  10561. - {0x0000a010, 0x00830082},
  10562. - {0x0000a014, 0x01810180},
  10563. - {0x0000a018, 0x01830182},
  10564. - {0x0000a01c, 0x01850184},
  10565. - {0x0000a020, 0x01890188},
  10566. - {0x0000a024, 0x018b018a},
  10567. - {0x0000a028, 0x018d018c},
  10568. - {0x0000a02c, 0x01910190},
  10569. - {0x0000a030, 0x01930192},
  10570. - {0x0000a034, 0x01950194},
  10571. - {0x0000a038, 0x038a0196},
  10572. - {0x0000a03c, 0x038c038b},
  10573. - {0x0000a040, 0x0390038d},
  10574. - {0x0000a044, 0x03920391},
  10575. - {0x0000a048, 0x03940393},
  10576. - {0x0000a04c, 0x03960395},
  10577. - {0x0000a050, 0x00000000},
  10578. - {0x0000a054, 0x00000000},
  10579. - {0x0000a058, 0x00000000},
  10580. - {0x0000a05c, 0x00000000},
  10581. - {0x0000a060, 0x00000000},
  10582. - {0x0000a064, 0x00000000},
  10583. - {0x0000a068, 0x00000000},
  10584. - {0x0000a06c, 0x00000000},
  10585. - {0x0000a070, 0x00000000},
  10586. - {0x0000a074, 0x00000000},
  10587. - {0x0000a078, 0x00000000},
  10588. - {0x0000a07c, 0x00000000},
  10589. - {0x0000a080, 0x22222229},
  10590. - {0x0000a084, 0x1d1d1d1d},
  10591. - {0x0000a088, 0x1d1d1d1d},
  10592. - {0x0000a08c, 0x1d1d1d1d},
  10593. - {0x0000a090, 0x171d1d1d},
  10594. - {0x0000a094, 0x11111717},
  10595. - {0x0000a098, 0x00030311},
  10596. - {0x0000a09c, 0x00000000},
  10597. - {0x0000a0a0, 0x00000000},
  10598. - {0x0000a0a4, 0x00000000},
  10599. - {0x0000a0a8, 0x00000000},
  10600. - {0x0000a0ac, 0x00000000},
  10601. - {0x0000a0b0, 0x00000000},
  10602. - {0x0000a0b4, 0x00000000},
  10603. - {0x0000a0b8, 0x00000000},
  10604. - {0x0000a0bc, 0x00000000},
  10605. - {0x0000a0c0, 0x001f0000},
  10606. - {0x0000a0c4, 0x01000101},
  10607. - {0x0000a0c8, 0x011e011f},
  10608. - {0x0000a0cc, 0x011c011d},
  10609. - {0x0000a0d0, 0x02030204},
  10610. - {0x0000a0d4, 0x02010202},
  10611. - {0x0000a0d8, 0x021f0200},
  10612. - {0x0000a0dc, 0x0302021e},
  10613. - {0x0000a0e0, 0x03000301},
  10614. - {0x0000a0e4, 0x031e031f},
  10615. - {0x0000a0e8, 0x0402031d},
  10616. - {0x0000a0ec, 0x04000401},
  10617. - {0x0000a0f0, 0x041e041f},
  10618. - {0x0000a0f4, 0x0502041d},
  10619. - {0x0000a0f8, 0x05000501},
  10620. - {0x0000a0fc, 0x051e051f},
  10621. - {0x0000a100, 0x06010602},
  10622. - {0x0000a104, 0x061f0600},
  10623. - {0x0000a108, 0x061d061e},
  10624. - {0x0000a10c, 0x07020703},
  10625. - {0x0000a110, 0x07000701},
  10626. - {0x0000a114, 0x00000000},
  10627. - {0x0000a118, 0x00000000},
  10628. - {0x0000a11c, 0x00000000},
  10629. - {0x0000a120, 0x00000000},
  10630. - {0x0000a124, 0x00000000},
  10631. - {0x0000a128, 0x00000000},
  10632. - {0x0000a12c, 0x00000000},
  10633. - {0x0000a130, 0x00000000},
  10634. - {0x0000a134, 0x00000000},
  10635. - {0x0000a138, 0x00000000},
  10636. - {0x0000a13c, 0x00000000},
  10637. - {0x0000a140, 0x001f0000},
  10638. - {0x0000a144, 0x01000101},
  10639. - {0x0000a148, 0x011e011f},
  10640. - {0x0000a14c, 0x011c011d},
  10641. - {0x0000a150, 0x02030204},
  10642. - {0x0000a154, 0x02010202},
  10643. - {0x0000a158, 0x021f0200},
  10644. - {0x0000a15c, 0x0302021e},
  10645. - {0x0000a160, 0x03000301},
  10646. - {0x0000a164, 0x031e031f},
  10647. - {0x0000a168, 0x0402031d},
  10648. - {0x0000a16c, 0x04000401},
  10649. - {0x0000a170, 0x041e041f},
  10650. - {0x0000a174, 0x0502041d},
  10651. - {0x0000a178, 0x05000501},
  10652. - {0x0000a17c, 0x051e051f},
  10653. - {0x0000a180, 0x06010602},
  10654. - {0x0000a184, 0x061f0600},
  10655. - {0x0000a188, 0x061d061e},
  10656. - {0x0000a18c, 0x07020703},
  10657. - {0x0000a190, 0x07000701},
  10658. - {0x0000a194, 0x00000000},
  10659. - {0x0000a198, 0x00000000},
  10660. - {0x0000a19c, 0x00000000},
  10661. - {0x0000a1a0, 0x00000000},
  10662. - {0x0000a1a4, 0x00000000},
  10663. - {0x0000a1a8, 0x00000000},
  10664. - {0x0000a1ac, 0x00000000},
  10665. - {0x0000a1b0, 0x00000000},
  10666. - {0x0000a1b4, 0x00000000},
  10667. - {0x0000a1b8, 0x00000000},
  10668. - {0x0000a1bc, 0x00000000},
  10669. - {0x0000a1c0, 0x00000000},
  10670. - {0x0000a1c4, 0x00000000},
  10671. - {0x0000a1c8, 0x00000000},
  10672. - {0x0000a1cc, 0x00000000},
  10673. - {0x0000a1d0, 0x00000000},
  10674. - {0x0000a1d4, 0x00000000},
  10675. - {0x0000a1d8, 0x00000000},
  10676. - {0x0000a1dc, 0x00000000},
  10677. - {0x0000a1e0, 0x00000000},
  10678. - {0x0000a1e4, 0x00000000},
  10679. - {0x0000a1e8, 0x00000000},
  10680. - {0x0000a1ec, 0x00000000},
  10681. - {0x0000a1f0, 0x00000396},
  10682. - {0x0000a1f4, 0x00000396},
  10683. - {0x0000a1f8, 0x00000396},
  10684. - {0x0000a1fc, 0x00000196},
  10685. - {0x0000b000, 0x00010000},
  10686. - {0x0000b004, 0x00030002},
  10687. - {0x0000b008, 0x00050004},
  10688. - {0x0000b00c, 0x00810080},
  10689. - {0x0000b010, 0x00830082},
  10690. - {0x0000b014, 0x01810180},
  10691. - {0x0000b018, 0x01830182},
  10692. - {0x0000b01c, 0x01850184},
  10693. - {0x0000b020, 0x02810280},
  10694. - {0x0000b024, 0x02830282},
  10695. - {0x0000b028, 0x02850284},
  10696. - {0x0000b02c, 0x02890288},
  10697. - {0x0000b030, 0x028b028a},
  10698. - {0x0000b034, 0x0388028c},
  10699. - {0x0000b038, 0x038a0389},
  10700. - {0x0000b03c, 0x038c038b},
  10701. - {0x0000b040, 0x0390038d},
  10702. - {0x0000b044, 0x03920391},
  10703. - {0x0000b048, 0x03940393},
  10704. - {0x0000b04c, 0x03960395},
  10705. - {0x0000b050, 0x00000000},
  10706. - {0x0000b054, 0x00000000},
  10707. - {0x0000b058, 0x00000000},
  10708. - {0x0000b05c, 0x00000000},
  10709. - {0x0000b060, 0x00000000},
  10710. - {0x0000b064, 0x00000000},
  10711. - {0x0000b068, 0x00000000},
  10712. - {0x0000b06c, 0x00000000},
  10713. - {0x0000b070, 0x00000000},
  10714. - {0x0000b074, 0x00000000},
  10715. - {0x0000b078, 0x00000000},
  10716. - {0x0000b07c, 0x00000000},
  10717. - {0x0000b080, 0x23232323},
  10718. - {0x0000b084, 0x21232323},
  10719. - {0x0000b088, 0x19191c1e},
  10720. - {0x0000b08c, 0x12141417},
  10721. - {0x0000b090, 0x07070e0e},
  10722. - {0x0000b094, 0x03030305},
  10723. - {0x0000b098, 0x00000003},
  10724. - {0x0000b09c, 0x00000000},
  10725. - {0x0000b0a0, 0x00000000},
  10726. - {0x0000b0a4, 0x00000000},
  10727. - {0x0000b0a8, 0x00000000},
  10728. - {0x0000b0ac, 0x00000000},
  10729. - {0x0000b0b0, 0x00000000},
  10730. - {0x0000b0b4, 0x00000000},
  10731. - {0x0000b0b8, 0x00000000},
  10732. - {0x0000b0bc, 0x00000000},
  10733. - {0x0000b0c0, 0x003f0020},
  10734. - {0x0000b0c4, 0x00400041},
  10735. - {0x0000b0c8, 0x0140005f},
  10736. - {0x0000b0cc, 0x0160015f},
  10737. - {0x0000b0d0, 0x017e017f},
  10738. - {0x0000b0d4, 0x02410242},
  10739. - {0x0000b0d8, 0x025f0240},
  10740. - {0x0000b0dc, 0x027f0260},
  10741. - {0x0000b0e0, 0x0341027e},
  10742. - {0x0000b0e4, 0x035f0340},
  10743. - {0x0000b0e8, 0x037f0360},
  10744. - {0x0000b0ec, 0x04400441},
  10745. - {0x0000b0f0, 0x0460045f},
  10746. - {0x0000b0f4, 0x0541047f},
  10747. - {0x0000b0f8, 0x055f0540},
  10748. - {0x0000b0fc, 0x057f0560},
  10749. - {0x0000b100, 0x06400641},
  10750. - {0x0000b104, 0x0660065f},
  10751. - {0x0000b108, 0x067e067f},
  10752. - {0x0000b10c, 0x07410742},
  10753. - {0x0000b110, 0x075f0740},
  10754. - {0x0000b114, 0x077f0760},
  10755. - {0x0000b118, 0x07800781},
  10756. - {0x0000b11c, 0x07a0079f},
  10757. - {0x0000b120, 0x07c107bf},
  10758. - {0x0000b124, 0x000007c0},
  10759. - {0x0000b128, 0x00000000},
  10760. - {0x0000b12c, 0x00000000},
  10761. - {0x0000b130, 0x00000000},
  10762. - {0x0000b134, 0x00000000},
  10763. - {0x0000b138, 0x00000000},
  10764. - {0x0000b13c, 0x00000000},
  10765. - {0x0000b140, 0x003f0020},
  10766. - {0x0000b144, 0x00400041},
  10767. - {0x0000b148, 0x0140005f},
  10768. - {0x0000b14c, 0x0160015f},
  10769. - {0x0000b150, 0x017e017f},
  10770. - {0x0000b154, 0x02410242},
  10771. - {0x0000b158, 0x025f0240},
  10772. - {0x0000b15c, 0x027f0260},
  10773. - {0x0000b160, 0x0341027e},
  10774. - {0x0000b164, 0x035f0340},
  10775. - {0x0000b168, 0x037f0360},
  10776. - {0x0000b16c, 0x04400441},
  10777. - {0x0000b170, 0x0460045f},
  10778. - {0x0000b174, 0x0541047f},
  10779. - {0x0000b178, 0x055f0540},
  10780. - {0x0000b17c, 0x057f0560},
  10781. - {0x0000b180, 0x06400641},
  10782. - {0x0000b184, 0x0660065f},
  10783. - {0x0000b188, 0x067e067f},
  10784. - {0x0000b18c, 0x07410742},
  10785. - {0x0000b190, 0x075f0740},
  10786. - {0x0000b194, 0x077f0760},
  10787. - {0x0000b198, 0x07800781},
  10788. - {0x0000b19c, 0x07a0079f},
  10789. - {0x0000b1a0, 0x07c107bf},
  10790. - {0x0000b1a4, 0x000007c0},
  10791. - {0x0000b1a8, 0x00000000},
  10792. - {0x0000b1ac, 0x00000000},
  10793. - {0x0000b1b0, 0x00000000},
  10794. - {0x0000b1b4, 0x00000000},
  10795. - {0x0000b1b8, 0x00000000},
  10796. - {0x0000b1bc, 0x00000000},
  10797. - {0x0000b1c0, 0x00000000},
  10798. - {0x0000b1c4, 0x00000000},
  10799. - {0x0000b1c8, 0x00000000},
  10800. - {0x0000b1cc, 0x00000000},
  10801. - {0x0000b1d0, 0x00000000},
  10802. - {0x0000b1d4, 0x00000000},
  10803. - {0x0000b1d8, 0x00000000},
  10804. - {0x0000b1dc, 0x00000000},
  10805. - {0x0000b1e0, 0x00000000},
  10806. - {0x0000b1e4, 0x00000000},
  10807. - {0x0000b1e8, 0x00000000},
  10808. - {0x0000b1ec, 0x00000000},
  10809. - {0x0000b1f0, 0x00000396},
  10810. - {0x0000b1f4, 0x00000396},
  10811. - {0x0000b1f8, 0x00000396},
  10812. - {0x0000b1fc, 0x00000196},
  10813. -};
  10814. -
  10815. static const u32 ar955x_1p0_baseband_core[][2] = {
  10816. /* Addr allmodes */
  10817. {0x00009800, 0xafe68e30},
  10818. @@ -891,266 +632,6 @@ static const u32 ar955x_1p0_baseband_cor
  10819. {0x0000c420, 0x00000000},
  10820. };
  10821. -static const u32 ar955x_1p0_common_wo_xlna_rx_gain_table[][2] = {
  10822. - /* Addr allmodes */
  10823. - {0x0000a000, 0x00010000},
  10824. - {0x0000a004, 0x00030002},
  10825. - {0x0000a008, 0x00050004},
  10826. - {0x0000a00c, 0x00810080},
  10827. - {0x0000a010, 0x00830082},
  10828. - {0x0000a014, 0x01810180},
  10829. - {0x0000a018, 0x01830182},
  10830. - {0x0000a01c, 0x01850184},
  10831. - {0x0000a020, 0x01890188},
  10832. - {0x0000a024, 0x018b018a},
  10833. - {0x0000a028, 0x018d018c},
  10834. - {0x0000a02c, 0x03820190},
  10835. - {0x0000a030, 0x03840383},
  10836. - {0x0000a034, 0x03880385},
  10837. - {0x0000a038, 0x038a0389},
  10838. - {0x0000a03c, 0x038c038b},
  10839. - {0x0000a040, 0x0390038d},
  10840. - {0x0000a044, 0x03920391},
  10841. - {0x0000a048, 0x03940393},
  10842. - {0x0000a04c, 0x03960395},
  10843. - {0x0000a050, 0x00000000},
  10844. - {0x0000a054, 0x00000000},
  10845. - {0x0000a058, 0x00000000},
  10846. - {0x0000a05c, 0x00000000},
  10847. - {0x0000a060, 0x00000000},
  10848. - {0x0000a064, 0x00000000},
  10849. - {0x0000a068, 0x00000000},
  10850. - {0x0000a06c, 0x00000000},
  10851. - {0x0000a070, 0x00000000},
  10852. - {0x0000a074, 0x00000000},
  10853. - {0x0000a078, 0x00000000},
  10854. - {0x0000a07c, 0x00000000},
  10855. - {0x0000a080, 0x29292929},
  10856. - {0x0000a084, 0x29292929},
  10857. - {0x0000a088, 0x29292929},
  10858. - {0x0000a08c, 0x29292929},
  10859. - {0x0000a090, 0x22292929},
  10860. - {0x0000a094, 0x1d1d2222},
  10861. - {0x0000a098, 0x0c111117},
  10862. - {0x0000a09c, 0x00030303},
  10863. - {0x0000a0a0, 0x00000000},
  10864. - {0x0000a0a4, 0x00000000},
  10865. - {0x0000a0a8, 0x00000000},
  10866. - {0x0000a0ac, 0x00000000},
  10867. - {0x0000a0b0, 0x00000000},
  10868. - {0x0000a0b4, 0x00000000},
  10869. - {0x0000a0b8, 0x00000000},
  10870. - {0x0000a0bc, 0x00000000},
  10871. - {0x0000a0c0, 0x001f0000},
  10872. - {0x0000a0c4, 0x01000101},
  10873. - {0x0000a0c8, 0x011e011f},
  10874. - {0x0000a0cc, 0x011c011d},
  10875. - {0x0000a0d0, 0x02030204},
  10876. - {0x0000a0d4, 0x02010202},
  10877. - {0x0000a0d8, 0x021f0200},
  10878. - {0x0000a0dc, 0x0302021e},
  10879. - {0x0000a0e0, 0x03000301},
  10880. - {0x0000a0e4, 0x031e031f},
  10881. - {0x0000a0e8, 0x0402031d},
  10882. - {0x0000a0ec, 0x04000401},
  10883. - {0x0000a0f0, 0x041e041f},
  10884. - {0x0000a0f4, 0x0502041d},
  10885. - {0x0000a0f8, 0x05000501},
  10886. - {0x0000a0fc, 0x051e051f},
  10887. - {0x0000a100, 0x06010602},
  10888. - {0x0000a104, 0x061f0600},
  10889. - {0x0000a108, 0x061d061e},
  10890. - {0x0000a10c, 0x07020703},
  10891. - {0x0000a110, 0x07000701},
  10892. - {0x0000a114, 0x00000000},
  10893. - {0x0000a118, 0x00000000},
  10894. - {0x0000a11c, 0x00000000},
  10895. - {0x0000a120, 0x00000000},
  10896. - {0x0000a124, 0x00000000},
  10897. - {0x0000a128, 0x00000000},
  10898. - {0x0000a12c, 0x00000000},
  10899. - {0x0000a130, 0x00000000},
  10900. - {0x0000a134, 0x00000000},
  10901. - {0x0000a138, 0x00000000},
  10902. - {0x0000a13c, 0x00000000},
  10903. - {0x0000a140, 0x001f0000},
  10904. - {0x0000a144, 0x01000101},
  10905. - {0x0000a148, 0x011e011f},
  10906. - {0x0000a14c, 0x011c011d},
  10907. - {0x0000a150, 0x02030204},
  10908. - {0x0000a154, 0x02010202},
  10909. - {0x0000a158, 0x021f0200},
  10910. - {0x0000a15c, 0x0302021e},
  10911. - {0x0000a160, 0x03000301},
  10912. - {0x0000a164, 0x031e031f},
  10913. - {0x0000a168, 0x0402031d},
  10914. - {0x0000a16c, 0x04000401},
  10915. - {0x0000a170, 0x041e041f},
  10916. - {0x0000a174, 0x0502041d},
  10917. - {0x0000a178, 0x05000501},
  10918. - {0x0000a17c, 0x051e051f},
  10919. - {0x0000a180, 0x06010602},
  10920. - {0x0000a184, 0x061f0600},
  10921. - {0x0000a188, 0x061d061e},
  10922. - {0x0000a18c, 0x07020703},
  10923. - {0x0000a190, 0x07000701},
  10924. - {0x0000a194, 0x00000000},
  10925. - {0x0000a198, 0x00000000},
  10926. - {0x0000a19c, 0x00000000},
  10927. - {0x0000a1a0, 0x00000000},
  10928. - {0x0000a1a4, 0x00000000},
  10929. - {0x0000a1a8, 0x00000000},
  10930. - {0x0000a1ac, 0x00000000},
  10931. - {0x0000a1b0, 0x00000000},
  10932. - {0x0000a1b4, 0x00000000},
  10933. - {0x0000a1b8, 0x00000000},
  10934. - {0x0000a1bc, 0x00000000},
  10935. - {0x0000a1c0, 0x00000000},
  10936. - {0x0000a1c4, 0x00000000},
  10937. - {0x0000a1c8, 0x00000000},
  10938. - {0x0000a1cc, 0x00000000},
  10939. - {0x0000a1d0, 0x00000000},
  10940. - {0x0000a1d4, 0x00000000},
  10941. - {0x0000a1d8, 0x00000000},
  10942. - {0x0000a1dc, 0x00000000},
  10943. - {0x0000a1e0, 0x00000000},
  10944. - {0x0000a1e4, 0x00000000},
  10945. - {0x0000a1e8, 0x00000000},
  10946. - {0x0000a1ec, 0x00000000},
  10947. - {0x0000a1f0, 0x00000396},
  10948. - {0x0000a1f4, 0x00000396},
  10949. - {0x0000a1f8, 0x00000396},
  10950. - {0x0000a1fc, 0x00000196},
  10951. - {0x0000b000, 0x00010000},
  10952. - {0x0000b004, 0x00030002},
  10953. - {0x0000b008, 0x00050004},
  10954. - {0x0000b00c, 0x00810080},
  10955. - {0x0000b010, 0x00830082},
  10956. - {0x0000b014, 0x01810180},
  10957. - {0x0000b018, 0x01830182},
  10958. - {0x0000b01c, 0x01850184},
  10959. - {0x0000b020, 0x02810280},
  10960. - {0x0000b024, 0x02830282},
  10961. - {0x0000b028, 0x02850284},
  10962. - {0x0000b02c, 0x02890288},
  10963. - {0x0000b030, 0x028b028a},
  10964. - {0x0000b034, 0x0388028c},
  10965. - {0x0000b038, 0x038a0389},
  10966. - {0x0000b03c, 0x038c038b},
  10967. - {0x0000b040, 0x0390038d},
  10968. - {0x0000b044, 0x03920391},
  10969. - {0x0000b048, 0x03940393},
  10970. - {0x0000b04c, 0x03960395},
  10971. - {0x0000b050, 0x00000000},
  10972. - {0x0000b054, 0x00000000},
  10973. - {0x0000b058, 0x00000000},
  10974. - {0x0000b05c, 0x00000000},
  10975. - {0x0000b060, 0x00000000},
  10976. - {0x0000b064, 0x00000000},
  10977. - {0x0000b068, 0x00000000},
  10978. - {0x0000b06c, 0x00000000},
  10979. - {0x0000b070, 0x00000000},
  10980. - {0x0000b074, 0x00000000},
  10981. - {0x0000b078, 0x00000000},
  10982. - {0x0000b07c, 0x00000000},
  10983. - {0x0000b080, 0x32323232},
  10984. - {0x0000b084, 0x2f2f3232},
  10985. - {0x0000b088, 0x23282a2d},
  10986. - {0x0000b08c, 0x1c1e2123},
  10987. - {0x0000b090, 0x14171919},
  10988. - {0x0000b094, 0x0e0e1214},
  10989. - {0x0000b098, 0x03050707},
  10990. - {0x0000b09c, 0x00030303},
  10991. - {0x0000b0a0, 0x00000000},
  10992. - {0x0000b0a4, 0x00000000},
  10993. - {0x0000b0a8, 0x00000000},
  10994. - {0x0000b0ac, 0x00000000},
  10995. - {0x0000b0b0, 0x00000000},
  10996. - {0x0000b0b4, 0x00000000},
  10997. - {0x0000b0b8, 0x00000000},
  10998. - {0x0000b0bc, 0x00000000},
  10999. - {0x0000b0c0, 0x003f0020},
  11000. - {0x0000b0c4, 0x00400041},
  11001. - {0x0000b0c8, 0x0140005f},
  11002. - {0x0000b0cc, 0x0160015f},
  11003. - {0x0000b0d0, 0x017e017f},
  11004. - {0x0000b0d4, 0x02410242},
  11005. - {0x0000b0d8, 0x025f0240},
  11006. - {0x0000b0dc, 0x027f0260},
  11007. - {0x0000b0e0, 0x0341027e},
  11008. - {0x0000b0e4, 0x035f0340},
  11009. - {0x0000b0e8, 0x037f0360},
  11010. - {0x0000b0ec, 0x04400441},
  11011. - {0x0000b0f0, 0x0460045f},
  11012. - {0x0000b0f4, 0x0541047f},
  11013. - {0x0000b0f8, 0x055f0540},
  11014. - {0x0000b0fc, 0x057f0560},
  11015. - {0x0000b100, 0x06400641},
  11016. - {0x0000b104, 0x0660065f},
  11017. - {0x0000b108, 0x067e067f},
  11018. - {0x0000b10c, 0x07410742},
  11019. - {0x0000b110, 0x075f0740},
  11020. - {0x0000b114, 0x077f0760},
  11021. - {0x0000b118, 0x07800781},
  11022. - {0x0000b11c, 0x07a0079f},
  11023. - {0x0000b120, 0x07c107bf},
  11024. - {0x0000b124, 0x000007c0},
  11025. - {0x0000b128, 0x00000000},
  11026. - {0x0000b12c, 0x00000000},
  11027. - {0x0000b130, 0x00000000},
  11028. - {0x0000b134, 0x00000000},
  11029. - {0x0000b138, 0x00000000},
  11030. - {0x0000b13c, 0x00000000},
  11031. - {0x0000b140, 0x003f0020},
  11032. - {0x0000b144, 0x00400041},
  11033. - {0x0000b148, 0x0140005f},
  11034. - {0x0000b14c, 0x0160015f},
  11035. - {0x0000b150, 0x017e017f},
  11036. - {0x0000b154, 0x02410242},
  11037. - {0x0000b158, 0x025f0240},
  11038. - {0x0000b15c, 0x027f0260},
  11039. - {0x0000b160, 0x0341027e},
  11040. - {0x0000b164, 0x035f0340},
  11041. - {0x0000b168, 0x037f0360},
  11042. - {0x0000b16c, 0x04400441},
  11043. - {0x0000b170, 0x0460045f},
  11044. - {0x0000b174, 0x0541047f},
  11045. - {0x0000b178, 0x055f0540},
  11046. - {0x0000b17c, 0x057f0560},
  11047. - {0x0000b180, 0x06400641},
  11048. - {0x0000b184, 0x0660065f},
  11049. - {0x0000b188, 0x067e067f},
  11050. - {0x0000b18c, 0x07410742},
  11051. - {0x0000b190, 0x075f0740},
  11052. - {0x0000b194, 0x077f0760},
  11053. - {0x0000b198, 0x07800781},
  11054. - {0x0000b19c, 0x07a0079f},
  11055. - {0x0000b1a0, 0x07c107bf},
  11056. - {0x0000b1a4, 0x000007c0},
  11057. - {0x0000b1a8, 0x00000000},
  11058. - {0x0000b1ac, 0x00000000},
  11059. - {0x0000b1b0, 0x00000000},
  11060. - {0x0000b1b4, 0x00000000},
  11061. - {0x0000b1b8, 0x00000000},
  11062. - {0x0000b1bc, 0x00000000},
  11063. - {0x0000b1c0, 0x00000000},
  11064. - {0x0000b1c4, 0x00000000},
  11065. - {0x0000b1c8, 0x00000000},
  11066. - {0x0000b1cc, 0x00000000},
  11067. - {0x0000b1d0, 0x00000000},
  11068. - {0x0000b1d4, 0x00000000},
  11069. - {0x0000b1d8, 0x00000000},
  11070. - {0x0000b1dc, 0x00000000},
  11071. - {0x0000b1e0, 0x00000000},
  11072. - {0x0000b1e4, 0x00000000},
  11073. - {0x0000b1e8, 0x00000000},
  11074. - {0x0000b1ec, 0x00000000},
  11075. - {0x0000b1f0, 0x00000396},
  11076. - {0x0000b1f4, 0x00000396},
  11077. - {0x0000b1f8, 0x00000396},
  11078. - {0x0000b1fc, 0x00000196},
  11079. -};
  11080. -
  11081. static const u32 ar955x_1p0_soc_preamble[][2] = {
  11082. /* Addr allmodes */
  11083. {0x00007000, 0x00000000},
  11084. @@ -1263,11 +744,6 @@ static const u32 ar955x_1p0_modes_no_xpa
  11085. {0x00016848, 0x66482401, 0x66482401, 0x66482401, 0x66482401, 0x66482401, 0x66482401, 0x66482401, 0x66482401},
  11086. };
  11087. -static const u32 ar955x_1p0_soc_postamble[][5] = {
  11088. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  11089. - {0x00007010, 0x00000023, 0x00000023, 0x00000023, 0x00000023},
  11090. -};
  11091. -
  11092. static const u32 ar955x_1p0_modes_fast_clock[][3] = {
  11093. /* Addr 5G_HT20 5G_HT40 */
  11094. {0x00001030, 0x00000268, 0x000004d0},
  11095. --- a/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h
  11096. +++ b/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h
  11097. @@ -20,6 +20,12 @@
  11098. /* AR9565 1.0 */
  11099. +#define ar9565_1p0_mac_postamble ar9331_1p1_mac_postamble
  11100. +
  11101. +#define ar9565_1p0_Modes_lowest_ob_db_tx_gain_table ar9565_1p0_modes_low_ob_db_tx_gain_table
  11102. +
  11103. +#define ar9565_1p0_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
  11104. +
  11105. static const u32 ar9565_1p0_mac_core[][2] = {
  11106. /* Addr allmodes */
  11107. {0x00000008, 0x00000000},
  11108. @@ -182,18 +188,6 @@ static const u32 ar9565_1p0_mac_core[][2
  11109. {0x000083d0, 0x800301ff},
  11110. };
  11111. -static const u32 ar9565_1p0_mac_postamble[][5] = {
  11112. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  11113. - {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160},
  11114. - {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c},
  11115. - {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38},
  11116. - {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00},
  11117. - {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b},
  11118. - {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810},
  11119. - {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a},
  11120. - {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
  11121. -};
  11122. -
  11123. static const u32 ar9565_1p0_baseband_core[][2] = {
  11124. /* Addr allmodes */
  11125. {0x00009800, 0xafe68e30},
  11126. @@ -711,66 +705,6 @@ static const u32 ar9565_1p0_Common_rx_ga
  11127. {0x0000b1fc, 0x00000196},
  11128. };
  11129. -static const u32 ar9565_1p0_Modes_lowest_ob_db_tx_gain_table[][5] = {
  11130. - /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  11131. - {0x0000a2dc, 0xfc0a9380, 0xfc0a9380, 0xfdab5b52, 0xfdab5b52},
  11132. - {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84},
  11133. - {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000},
  11134. - {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000},
  11135. - {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
  11136. - {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11137. - {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
  11138. - {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
  11139. - {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
  11140. - {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
  11141. - {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
  11142. - {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402},
  11143. - {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404},
  11144. - {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
  11145. - {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
  11146. - {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
  11147. - {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
  11148. - {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
  11149. - {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
  11150. - {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
  11151. - {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
  11152. - {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
  11153. - {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
  11154. - {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
  11155. - {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83},
  11156. - {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84},
  11157. - {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3},
  11158. - {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5},
  11159. - {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9},
  11160. - {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb},
  11161. - {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  11162. - {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  11163. - {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  11164. - {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  11165. - {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  11166. - {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  11167. - {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
  11168. - {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11169. - {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11170. - {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11171. - {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11172. - {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11173. - {0x0000a614, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11174. - {0x0000a618, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11175. - {0x0000a61c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11176. - {0x0000a620, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11177. - {0x0000a624, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11178. - {0x0000a628, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11179. - {0x0000a62c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11180. - {0x0000a630, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11181. - {0x0000a634, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11182. - {0x0000a638, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11183. - {0x0000a63c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11184. - {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
  11185. - {0x00016048, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11186. - {0x00016054, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11187. -};
  11188. -
  11189. static const u32 ar9565_1p0_pciephy_clkreq_disable_L1[][2] = {
  11190. /* Addr allmodes */
  11191. {0x00018c00, 0x18212ede},
  11192. @@ -1231,11 +1165,4 @@ static const u32 ar9565_1p0_modes_high_p
  11193. {0x00016054, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11194. };
  11195. -static const u32 ar9565_1p0_baseband_core_txfir_coeff_japan_2484[][2] = {
  11196. - /* Addr allmodes */
  11197. - {0x0000a398, 0x00000000},
  11198. - {0x0000a39c, 0x6f7f0301},
  11199. - {0x0000a3a0, 0xca9228ee},
  11200. -};
  11201. -
  11202. #endif /* INITVALS_9565_1P0_H */
  11203. --- a/include/linux/ath9k_platform.h
  11204. +++ b/include/linux/ath9k_platform.h
  11205. @@ -32,6 +32,8 @@ struct ath9k_platform_data {
  11206. u32 gpio_val;
  11207. bool is_clk_25mhz;
  11208. + bool tx_gain_buffalo;
  11209. +
  11210. int (*get_mac_revision)(void);
  11211. int (*external_reset)(void);
  11212. };
  11213. --- /dev/null
  11214. +++ b/drivers/net/wireless/ath/ath9k/ar9003_buffalo_initvals.h
  11215. @@ -0,0 +1,126 @@
  11216. +/*
  11217. + * Copyright (c) 2013 Qualcomm Atheros Inc.
  11218. + *
  11219. + * Permission to use, copy, modify, and/or distribute this software for any
  11220. + * purpose with or without fee is hereby granted, provided that the above
  11221. + * copyright notice and this permission notice appear in all copies.
  11222. + *
  11223. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  11224. + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11225. + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11226. + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11227. + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  11228. + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  11229. + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  11230. + */
  11231. +
  11232. +#ifndef INITVALS_9003_BUFFALO_H
  11233. +#define INITVALS_9003_BUFFALO_H
  11234. +
  11235. +static const u32 ar9300Modes_high_power_tx_gain_table_buffalo[][5] = {
  11236. + /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
  11237. + {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  11238. + {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  11239. + {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  11240. + {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  11241. + {0x0000a410, 0x000050d8, 0x000050d8, 0x000050d9, 0x000050d9},
  11242. + {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
  11243. + {0x0000a504, 0x04002222, 0x04002222, 0x04000002, 0x04000002},
  11244. + {0x0000a508, 0x09002421, 0x09002421, 0x08000004, 0x08000004},
  11245. + {0x0000a50c, 0x0d002621, 0x0d002621, 0x0b000200, 0x0b000200},
  11246. + {0x0000a510, 0x13004620, 0x13004620, 0x0f000202, 0x0f000202},
  11247. + {0x0000a514, 0x19004a20, 0x19004a20, 0x11000400, 0x11000400},
  11248. + {0x0000a518, 0x1d004e20, 0x1d004e20, 0x15000402, 0x15000402},
  11249. + {0x0000a51c, 0x21005420, 0x21005420, 0x19000404, 0x19000404},
  11250. + {0x0000a520, 0x26005e20, 0x26005e20, 0x1b000603, 0x1b000603},
  11251. + {0x0000a524, 0x2b005e40, 0x2b005e40, 0x1f000a02, 0x1f000a02},
  11252. + {0x0000a528, 0x2f005e42, 0x2f005e42, 0x23000a04, 0x23000a04},
  11253. + {0x0000a52c, 0x33005e44, 0x33005e44, 0x26000a20, 0x26000a20},
  11254. + {0x0000a530, 0x38005e65, 0x38005e65, 0x2a000e20, 0x2a000e20},
  11255. + {0x0000a534, 0x3c005e69, 0x3c005e69, 0x2e000e22, 0x2e000e22},
  11256. + {0x0000a538, 0x40005e6b, 0x40005e6b, 0x31000e24, 0x31000e24},
  11257. + {0x0000a53c, 0x44005e6d, 0x44005e6d, 0x34001640, 0x34001640},
  11258. + {0x0000a540, 0x49005e72, 0x49005e72, 0x38001660, 0x38001660},
  11259. + {0x0000a544, 0x4e005eb2, 0x4e005eb2, 0x3b001861, 0x3b001861},
  11260. + {0x0000a548, 0x53005f12, 0x53005f12, 0x3e001a81, 0x3e001a81},
  11261. + {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83},
  11262. + {0x0000a550, 0x5e025f12, 0x5e025f12, 0x44001c84, 0x44001c84},
  11263. + {0x0000a554, 0x61027f12, 0x61027f12, 0x48001ce3, 0x48001ce3},
  11264. + {0x0000a558, 0x6702bf12, 0x6702bf12, 0x4c001ce5, 0x4c001ce5},
  11265. + {0x0000a55c, 0x6b02bf14, 0x6b02bf14, 0x50001ce9, 0x50001ce9},
  11266. + {0x0000a560, 0x6f02bf16, 0x6f02bf16, 0x54001ceb, 0x54001ceb},
  11267. + {0x0000a564, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  11268. + {0x0000a568, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  11269. + {0x0000a56c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  11270. + {0x0000a570, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  11271. + {0x0000a574, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  11272. + {0x0000a578, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  11273. + {0x0000a57c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
  11274. + {0x0000a580, 0x00802220, 0x00802220, 0x00800000, 0x00800000},
  11275. + {0x0000a584, 0x04802222, 0x04802222, 0x04800002, 0x04800002},
  11276. + {0x0000a588, 0x09802421, 0x09802421, 0x08800004, 0x08800004},
  11277. + {0x0000a58c, 0x0d802621, 0x0d802621, 0x0b800200, 0x0b800200},
  11278. + {0x0000a590, 0x13804620, 0x13804620, 0x0f800202, 0x0f800202},
  11279. + {0x0000a594, 0x19804a20, 0x19804a20, 0x11800400, 0x11800400},
  11280. + {0x0000a598, 0x1d804e20, 0x1d804e20, 0x15800402, 0x15800402},
  11281. + {0x0000a59c, 0x21805420, 0x21805420, 0x19800404, 0x19800404},
  11282. + {0x0000a5a0, 0x26805e20, 0x26805e20, 0x1b800603, 0x1b800603},
  11283. + {0x0000a5a4, 0x2b805e40, 0x2b805e40, 0x1f800a02, 0x1f800a02},
  11284. + {0x0000a5a8, 0x2f805e42, 0x2f805e42, 0x23800a04, 0x23800a04},
  11285. + {0x0000a5ac, 0x33805e44, 0x33805e44, 0x26800a20, 0x26800a20},
  11286. + {0x0000a5b0, 0x38805e65, 0x38805e65, 0x2a800e20, 0x2a800e20},
  11287. + {0x0000a5b4, 0x3c805e69, 0x3c805e69, 0x2e800e22, 0x2e800e22},
  11288. + {0x0000a5b8, 0x40805e6b, 0x40805e6b, 0x31800e24, 0x31800e24},
  11289. + {0x0000a5bc, 0x44805e6d, 0x44805e6d, 0x34801640, 0x34801640},
  11290. + {0x0000a5c0, 0x49805e72, 0x49805e72, 0x38801660, 0x38801660},
  11291. + {0x0000a5c4, 0x4e805eb2, 0x4e805eb2, 0x3b801861, 0x3b801861},
  11292. + {0x0000a5c8, 0x53805f12, 0x53805f12, 0x3e801a81, 0x3e801a81},
  11293. + {0x0000a5cc, 0x59825eb2, 0x59825eb2, 0x42801a83, 0x42801a83},
  11294. + {0x0000a5d0, 0x5e825f12, 0x5e825f12, 0x44801c84, 0x44801c84},
  11295. + {0x0000a5d4, 0x61827f12, 0x61827f12, 0x48801ce3, 0x48801ce3},
  11296. + {0x0000a5d8, 0x6782bf12, 0x6782bf12, 0x4c801ce5, 0x4c801ce5},
  11297. + {0x0000a5dc, 0x6b82bf14, 0x6b82bf14, 0x50801ce9, 0x50801ce9},
  11298. + {0x0000a5e0, 0x6f82bf16, 0x6f82bf16, 0x54801ceb, 0x54801ceb},
  11299. + {0x0000a5e4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  11300. + {0x0000a5e8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  11301. + {0x0000a5ec, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  11302. + {0x0000a5f0, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  11303. + {0x0000a5f4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  11304. + {0x0000a5f8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  11305. + {0x0000a5fc, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
  11306. + {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11307. + {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11308. + {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11309. + {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
  11310. + {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
  11311. + {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
  11312. + {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
  11313. + {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
  11314. + {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
  11315. + {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
  11316. + {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
  11317. + {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  11318. + {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  11319. + {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  11320. + {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  11321. + {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
  11322. + {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  11323. + {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  11324. + {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  11325. + {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  11326. + {0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
  11327. + {0x0000c2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
  11328. + {0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
  11329. + {0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
  11330. + {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
  11331. + {0x00016048, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
  11332. + {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
  11333. + {0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
  11334. + {0x00016448, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
  11335. + {0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
  11336. + {0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
  11337. + {0x00016848, 0x66480001, 0x66480001, 0x66480001, 0x66480001},
  11338. + {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c},
  11339. +};
  11340. +
  11341. +#endif /* INITVALS_9003_BUFFALO_H */
  11342. --- a/drivers/net/wireless/ath/ath9k/ar9002_mac.c
  11343. +++ b/drivers/net/wireless/ath/ath9k/ar9002_mac.c
  11344. @@ -76,9 +76,16 @@ static bool ar9002_hw_get_isr(struct ath
  11345. mask2 |= ATH9K_INT_CST;
  11346. if (isr2 & AR_ISR_S2_TSFOOR)
  11347. mask2 |= ATH9K_INT_TSFOOR;
  11348. +
  11349. + if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
  11350. + REG_WRITE(ah, AR_ISR_S2, isr2);
  11351. + isr &= ~AR_ISR_BCNMISC;
  11352. + }
  11353. }
  11354. - isr = REG_READ(ah, AR_ISR_RAC);
  11355. + if (pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)
  11356. + isr = REG_READ(ah, AR_ISR_RAC);
  11357. +
  11358. if (isr == 0xffffffff) {
  11359. *masked = 0;
  11360. return false;
  11361. @@ -97,11 +104,23 @@ static bool ar9002_hw_get_isr(struct ath
  11362. *masked |= ATH9K_INT_TX;
  11363. - s0_s = REG_READ(ah, AR_ISR_S0_S);
  11364. + if (pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED) {
  11365. + s0_s = REG_READ(ah, AR_ISR_S0_S);
  11366. + s1_s = REG_READ(ah, AR_ISR_S1_S);
  11367. + } else {
  11368. + s0_s = REG_READ(ah, AR_ISR_S0);
  11369. + REG_WRITE(ah, AR_ISR_S0, s0_s);
  11370. + s1_s = REG_READ(ah, AR_ISR_S1);
  11371. + REG_WRITE(ah, AR_ISR_S1, s1_s);
  11372. +
  11373. + isr &= ~(AR_ISR_TXOK |
  11374. + AR_ISR_TXDESC |
  11375. + AR_ISR_TXERR |
  11376. + AR_ISR_TXEOL);
  11377. + }
  11378. +
  11379. ah->intr_txqs |= MS(s0_s, AR_ISR_S0_QCU_TXOK);
  11380. ah->intr_txqs |= MS(s0_s, AR_ISR_S0_QCU_TXDESC);
  11381. -
  11382. - s1_s = REG_READ(ah, AR_ISR_S1_S);
  11383. ah->intr_txqs |= MS(s1_s, AR_ISR_S1_QCU_TXERR);
  11384. ah->intr_txqs |= MS(s1_s, AR_ISR_S1_QCU_TXEOL);
  11385. }
  11386. @@ -114,13 +133,23 @@ static bool ar9002_hw_get_isr(struct ath
  11387. *masked |= mask2;
  11388. }
  11389. + if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
  11390. + REG_WRITE(ah, AR_ISR, isr);
  11391. + REG_READ(ah, AR_ISR);
  11392. + }
  11393. +
  11394. if (AR_SREV_9100(ah))
  11395. return true;
  11396. if (isr & AR_ISR_GENTMR) {
  11397. u32 s5_s;
  11398. - s5_s = REG_READ(ah, AR_ISR_S5_S);
  11399. + if (pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED) {
  11400. + s5_s = REG_READ(ah, AR_ISR_S5_S);
  11401. + } else {
  11402. + s5_s = REG_READ(ah, AR_ISR_S5);
  11403. + }
  11404. +
  11405. ah->intr_gen_timer_trigger =
  11406. MS(s5_s, AR_ISR_S5_GENTIMER_TRIG);
  11407. @@ -133,6 +162,11 @@ static bool ar9002_hw_get_isr(struct ath
  11408. if ((s5_s & AR_ISR_S5_TIM_TIMER) &&
  11409. !(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP))
  11410. *masked |= ATH9K_INT_TIM_TIMER;
  11411. +
  11412. + if (!(pCap->hw_caps & ATH9K_HW_CAP_RAC_SUPPORTED)) {
  11413. + REG_WRITE(ah, AR_ISR_S5, s5_s);
  11414. + isr &= ~AR_ISR_GENTMR;
  11415. + }
  11416. }
  11417. if (sync_cause) {
  11418. --- a/drivers/net/wireless/ath/ath9k/antenna.c
  11419. +++ b/drivers/net/wireless/ath/ath9k/antenna.c
  11420. @@ -724,14 +724,14 @@ void ath_ant_comb_scan(struct ath_softc
  11421. struct ath_ant_comb *antcomb = &sc->ant_comb;
  11422. int alt_ratio = 0, alt_rssi_avg = 0, main_rssi_avg = 0, curr_alt_set;
  11423. int curr_main_set;
  11424. - int main_rssi = rs->rs_rssi_ctl0;
  11425. - int alt_rssi = rs->rs_rssi_ctl1;
  11426. + int main_rssi = rs->rs_rssi_ctl[0];
  11427. + int alt_rssi = rs->rs_rssi_ctl[1];
  11428. int rx_ant_conf, main_ant_conf;
  11429. bool short_scan = false, ret;
  11430. - rx_ant_conf = (rs->rs_rssi_ctl2 >> ATH_ANT_RX_CURRENT_SHIFT) &
  11431. + rx_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_CURRENT_SHIFT) &
  11432. ATH_ANT_RX_MASK;
  11433. - main_ant_conf = (rs->rs_rssi_ctl2 >> ATH_ANT_RX_MAIN_SHIFT) &
  11434. + main_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_MAIN_SHIFT) &
  11435. ATH_ANT_RX_MASK;
  11436. if (alt_rssi >= antcomb->low_rssi_thresh) {
  11437. --- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c
  11438. +++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
  11439. @@ -32,12 +32,8 @@ static int ar9002_hw_init_mode_regs(stru
  11440. return 0;
  11441. }
  11442. - if (ah->config.pcie_clock_req)
  11443. - INIT_INI_ARRAY(&ah->iniPcieSerdes,
  11444. - ar9280PciePhy_clkreq_off_L1_9280);
  11445. - else
  11446. - INIT_INI_ARRAY(&ah->iniPcieSerdes,
  11447. - ar9280PciePhy_clkreq_always_on_L1_9280);
  11448. + INIT_INI_ARRAY(&ah->iniPcieSerdes,
  11449. + ar9280PciePhy_clkreq_always_on_L1_9280);
  11450. if (AR_SREV_9287_11_OR_LATER(ah)) {
  11451. INIT_INI_ARRAY(&ah->iniModes, ar9287Modes_9287_1_1);
  11452. --- a/drivers/net/wireless/ath/ath9k/ar9002_phy.c
  11453. +++ b/drivers/net/wireless/ath/ath9k/ar9002_phy.c
  11454. @@ -201,7 +201,6 @@ static void ar9002_hw_spur_mitigate(stru
  11455. ath9k_hw_get_channel_centers(ah, chan, &centers);
  11456. freq = centers.synth_center;
  11457. - ah->config.spurmode = SPUR_ENABLE_EEPROM;
  11458. for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) {
  11459. cur_bb_spur = ah->eep_ops->get_spur_channel(ah, i, is2GHz);
  11460. --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
  11461. +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
  11462. @@ -476,12 +476,12 @@ int ath9k_hw_process_rxdesc_edma(struct
  11463. /* XXX: Keycache */
  11464. rxs->rs_rssi = MS(rxsp->status5, AR_RxRSSICombined);
  11465. - rxs->rs_rssi_ctl0 = MS(rxsp->status1, AR_RxRSSIAnt00);
  11466. - rxs->rs_rssi_ctl1 = MS(rxsp->status1, AR_RxRSSIAnt01);
  11467. - rxs->rs_rssi_ctl2 = MS(rxsp->status1, AR_RxRSSIAnt02);
  11468. - rxs->rs_rssi_ext0 = MS(rxsp->status5, AR_RxRSSIAnt10);
  11469. - rxs->rs_rssi_ext1 = MS(rxsp->status5, AR_RxRSSIAnt11);
  11470. - rxs->rs_rssi_ext2 = MS(rxsp->status5, AR_RxRSSIAnt12);
  11471. + rxs->rs_rssi_ctl[0] = MS(rxsp->status1, AR_RxRSSIAnt00);
  11472. + rxs->rs_rssi_ctl[1] = MS(rxsp->status1, AR_RxRSSIAnt01);
  11473. + rxs->rs_rssi_ctl[2] = MS(rxsp->status1, AR_RxRSSIAnt02);
  11474. + rxs->rs_rssi_ext[0] = MS(rxsp->status5, AR_RxRSSIAnt10);
  11475. + rxs->rs_rssi_ext[1] = MS(rxsp->status5, AR_RxRSSIAnt11);
  11476. + rxs->rs_rssi_ext[2] = MS(rxsp->status5, AR_RxRSSIAnt12);
  11477. if (rxsp->status11 & AR_RxKeyIdxValid)
  11478. rxs->rs_keyix = MS(rxsp->status11, AR_KeyIdx);
  11479. --- a/drivers/net/wireless/ath/ath9k/beacon.c
  11480. +++ b/drivers/net/wireless/ath/ath9k/beacon.c
  11481. @@ -431,6 +431,33 @@ static void ath9k_beacon_init(struct ath
  11482. ath9k_hw_enable_interrupts(ah);
  11483. }
  11484. +/* Calculate the modulo of a 64 bit TSF snapshot with a TU divisor */
  11485. +static u32 ath9k_mod_tsf64_tu(u64 tsf, u32 div_tu)
  11486. +{
  11487. + u32 tsf_mod, tsf_hi, tsf_lo, mod_hi, mod_lo;
  11488. +
  11489. + tsf_mod = tsf & (BIT(10) - 1);
  11490. + tsf_hi = tsf >> 32;
  11491. + tsf_lo = ((u32) tsf) >> 10;
  11492. +
  11493. + mod_hi = tsf_hi % div_tu;
  11494. + mod_lo = ((mod_hi << 22) + tsf_lo) % div_tu;
  11495. +
  11496. + return (mod_lo << 10) | tsf_mod;
  11497. +}
  11498. +
  11499. +static u32 ath9k_get_next_tbtt(struct ath_softc *sc, u64 tsf,
  11500. + unsigned int interval)
  11501. +{
  11502. + struct ath_hw *ah = sc->sc_ah;
  11503. + unsigned int offset;
  11504. +
  11505. + tsf += TU_TO_USEC(FUDGE + ah->config.sw_beacon_response_time);
  11506. + offset = ath9k_mod_tsf64_tu(tsf, interval);
  11507. +
  11508. + return (u32) tsf + TU_TO_USEC(interval) - offset;
  11509. +}
  11510. +
  11511. /*
  11512. * For multi-bss ap support beacons are either staggered evenly over N slots or
  11513. * burst together. For the former arrange for the SWBA to be delivered for each
  11514. @@ -446,7 +473,8 @@ static void ath9k_beacon_config_ap(struc
  11515. /* NB: the beacon interval is kept internally in TU's */
  11516. intval = TU_TO_USEC(conf->beacon_interval);
  11517. intval /= ATH_BCBUF;
  11518. - nexttbtt = intval;
  11519. + nexttbtt = ath9k_get_next_tbtt(sc, ath9k_hw_gettsf64(ah),
  11520. + conf->beacon_interval);
  11521. if (conf->enable_beacon)
  11522. ah->imask |= ATH9K_INT_SWBA;
  11523. @@ -458,7 +486,7 @@ static void ath9k_beacon_config_ap(struc
  11524. (conf->enable_beacon) ? "Enable" : "Disable",
  11525. nexttbtt, intval, conf->beacon_interval);
  11526. - ath9k_beacon_init(sc, nexttbtt, intval, true);
  11527. + ath9k_beacon_init(sc, nexttbtt, intval, false);
  11528. }
  11529. /*
  11530. @@ -475,11 +503,9 @@ static void ath9k_beacon_config_sta(stru
  11531. struct ath_hw *ah = sc->sc_ah;
  11532. struct ath_common *common = ath9k_hw_common(ah);
  11533. struct ath9k_beacon_state bs;
  11534. - int dtimperiod, dtimcount, sleepduration;
  11535. - int cfpperiod, cfpcount;
  11536. - u32 nexttbtt = 0, intval, tsftu;
  11537. + int dtim_intval, sleepduration;
  11538. + u32 nexttbtt = 0, intval;
  11539. u64 tsf;
  11540. - int num_beacons, offset, dtim_dec_count, cfp_dec_count;
  11541. /* No need to configure beacon if we are not associated */
  11542. if (!test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) {
  11543. @@ -492,53 +518,25 @@ static void ath9k_beacon_config_sta(stru
  11544. intval = conf->beacon_interval;
  11545. /*
  11546. - * Setup dtim and cfp parameters according to
  11547. + * Setup dtim parameters according to
  11548. * last beacon we received (which may be none).
  11549. */
  11550. - dtimperiod = conf->dtim_period;
  11551. - dtimcount = conf->dtim_count;
  11552. - if (dtimcount >= dtimperiod) /* NB: sanity check */
  11553. - dtimcount = 0;
  11554. - cfpperiod = 1; /* NB: no PCF support yet */
  11555. - cfpcount = 0;
  11556. -
  11557. + dtim_intval = intval * conf->dtim_period;
  11558. sleepduration = conf->listen_interval * intval;
  11559. /*
  11560. * Pull nexttbtt forward to reflect the current
  11561. - * TSF and calculate dtim+cfp state for the result.
  11562. + * TSF and calculate dtim state for the result.
  11563. */
  11564. tsf = ath9k_hw_gettsf64(ah);
  11565. - tsftu = TSF_TO_TU(tsf>>32, tsf) + FUDGE;
  11566. -
  11567. - num_beacons = tsftu / intval + 1;
  11568. - offset = tsftu % intval;
  11569. - nexttbtt = tsftu - offset;
  11570. - if (offset)
  11571. - nexttbtt += intval;
  11572. -
  11573. - /* DTIM Beacon every dtimperiod Beacon */
  11574. - dtim_dec_count = num_beacons % dtimperiod;
  11575. - /* CFP every cfpperiod DTIM Beacon */
  11576. - cfp_dec_count = (num_beacons / dtimperiod) % cfpperiod;
  11577. - if (dtim_dec_count)
  11578. - cfp_dec_count++;
  11579. -
  11580. - dtimcount -= dtim_dec_count;
  11581. - if (dtimcount < 0)
  11582. - dtimcount += dtimperiod;
  11583. -
  11584. - cfpcount -= cfp_dec_count;
  11585. - if (cfpcount < 0)
  11586. - cfpcount += cfpperiod;
  11587. + nexttbtt = ath9k_get_next_tbtt(sc, tsf, intval);
  11588. - bs.bs_intval = intval;
  11589. + bs.bs_intval = TU_TO_USEC(intval);
  11590. + bs.bs_dtimperiod = conf->dtim_period * bs.bs_intval;
  11591. bs.bs_nexttbtt = nexttbtt;
  11592. - bs.bs_dtimperiod = dtimperiod*intval;
  11593. - bs.bs_nextdtim = bs.bs_nexttbtt + dtimcount*intval;
  11594. - bs.bs_cfpperiod = cfpperiod*bs.bs_dtimperiod;
  11595. - bs.bs_cfpnext = bs.bs_nextdtim + cfpcount*bs.bs_dtimperiod;
  11596. - bs.bs_cfpmaxduration = 0;
  11597. + bs.bs_nextdtim = nexttbtt;
  11598. + if (conf->dtim_period > 1)
  11599. + bs.bs_nextdtim = ath9k_get_next_tbtt(sc, tsf, dtim_intval);
  11600. /*
  11601. * Calculate the number of consecutive beacons to miss* before taking
  11602. @@ -566,18 +564,16 @@ static void ath9k_beacon_config_sta(stru
  11603. * XXX fixed at 100ms
  11604. */
  11605. - bs.bs_sleepduration = roundup(IEEE80211_MS_TO_TU(100), sleepduration);
  11606. + bs.bs_sleepduration = TU_TO_USEC(roundup(IEEE80211_MS_TO_TU(100),
  11607. + sleepduration));
  11608. if (bs.bs_sleepduration > bs.bs_dtimperiod)
  11609. bs.bs_sleepduration = bs.bs_dtimperiod;
  11610. /* TSF out of range threshold fixed at 1 second */
  11611. bs.bs_tsfoor_threshold = ATH9K_TSFOOR_THRESHOLD;
  11612. - ath_dbg(common, BEACON, "tsf: %llu tsftu: %u\n", tsf, tsftu);
  11613. - ath_dbg(common, BEACON,
  11614. - "bmiss: %u sleep: %u cfp-period: %u maxdur: %u next: %u\n",
  11615. - bs.bs_bmissthreshold, bs.bs_sleepduration,
  11616. - bs.bs_cfpperiod, bs.bs_cfpmaxduration, bs.bs_cfpnext);
  11617. + ath_dbg(common, BEACON, "bmiss: %u sleep: %u\n",
  11618. + bs.bs_bmissthreshold, bs.bs_sleepduration);
  11619. /* Set the computed STA beacon timers */
  11620. @@ -600,25 +596,11 @@ static void ath9k_beacon_config_adhoc(st
  11621. intval = TU_TO_USEC(conf->beacon_interval);
  11622. - if (conf->ibss_creator) {
  11623. + if (conf->ibss_creator)
  11624. nexttbtt = intval;
  11625. - } else {
  11626. - u32 tbtt, offset, tsftu;
  11627. - u64 tsf;
  11628. -
  11629. - /*
  11630. - * Pull nexttbtt forward to reflect the current
  11631. - * sync'd TSF.
  11632. - */
  11633. - tsf = ath9k_hw_gettsf64(ah);
  11634. - tsftu = TSF_TO_TU(tsf >> 32, tsf) + FUDGE;
  11635. - offset = tsftu % conf->beacon_interval;
  11636. - tbtt = tsftu - offset;
  11637. - if (offset)
  11638. - tbtt += conf->beacon_interval;
  11639. -
  11640. - nexttbtt = TU_TO_USEC(tbtt);
  11641. - }
  11642. + else
  11643. + nexttbtt = ath9k_get_next_tbtt(sc, ath9k_hw_gettsf64(ah),
  11644. + conf->beacon_interval);
  11645. if (conf->enable_beacon)
  11646. ah->imask |= ATH9K_INT_SWBA;
  11647. --- a/drivers/net/wireless/ath/ath9k/btcoex.c
  11648. +++ b/drivers/net/wireless/ath/ath9k/btcoex.c
  11649. @@ -66,7 +66,6 @@ void ath9k_hw_init_btcoex_hw(struct ath_
  11650. .bt_first_slot_time = 5,
  11651. .bt_hold_rx_clear = true,
  11652. };
  11653. - u32 i, idx;
  11654. bool rxclear_polarity = ath_bt_config.bt_rxclear_polarity;
  11655. if (AR_SREV_9300_20_OR_LATER(ah))
  11656. @@ -88,11 +87,6 @@ void ath9k_hw_init_btcoex_hw(struct ath_
  11657. SM(ath_bt_config.bt_hold_rx_clear, AR_BT_HOLD_RX_CLEAR) |
  11658. SM(ATH_BTCOEX_BMISS_THRESH, AR_BT_BCN_MISS_THRESH) |
  11659. AR_BT_DISABLE_BT_ANT;
  11660. -
  11661. - for (i = 0; i < 32; i++) {
  11662. - idx = (debruijn32 << i) >> 27;
  11663. - ah->hw_gen_timers.gen_timer_index[idx] = i;
  11664. - }
  11665. }
  11666. EXPORT_SYMBOL(ath9k_hw_init_btcoex_hw);
  11667. --- a/drivers/net/wireless/ath/ath9k/dfs.c
  11668. +++ b/drivers/net/wireless/ath/ath9k/dfs.c
  11669. @@ -158,8 +158,8 @@ void ath9k_dfs_process_phyerr(struct ath
  11670. return;
  11671. }
  11672. - ard.rssi = rs->rs_rssi_ctl0;
  11673. - ard.ext_rssi = rs->rs_rssi_ext0;
  11674. + ard.rssi = rs->rs_rssi_ctl[0];
  11675. + ard.ext_rssi = rs->rs_rssi_ext[0];
  11676. /*
  11677. * hardware stores this as 8 bit signed value.
  11678. --- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
  11679. +++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
  11680. @@ -1085,31 +1085,7 @@ static void ath9k_hw_4k_set_board_values
  11681. static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
  11682. {
  11683. -#define EEP_MAP4K_SPURCHAN \
  11684. - (ah->eeprom.map4k.modalHeader.spurChans[i].spurChan)
  11685. - struct ath_common *common = ath9k_hw_common(ah);
  11686. -
  11687. - u16 spur_val = AR_NO_SPUR;
  11688. -
  11689. - ath_dbg(common, ANI, "Getting spur idx:%d is2Ghz:%d val:%x\n",
  11690. - i, is2GHz, ah->config.spurchans[i][is2GHz]);
  11691. -
  11692. - switch (ah->config.spurmode) {
  11693. - case SPUR_DISABLE:
  11694. - break;
  11695. - case SPUR_ENABLE_IOCTL:
  11696. - spur_val = ah->config.spurchans[i][is2GHz];
  11697. - ath_dbg(common, ANI, "Getting spur val from new loc. %d\n",
  11698. - spur_val);
  11699. - break;
  11700. - case SPUR_ENABLE_EEPROM:
  11701. - spur_val = EEP_MAP4K_SPURCHAN;
  11702. - break;
  11703. - }
  11704. -
  11705. - return spur_val;
  11706. -
  11707. -#undef EEP_MAP4K_SPURCHAN
  11708. + return ah->eeprom.map4k.modalHeader.spurChans[i].spurChan;
  11709. }
  11710. const struct eeprom_ops eep_4k_ops = {
  11711. --- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
  11712. +++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
  11713. @@ -1004,31 +1004,7 @@ static void ath9k_hw_ar9287_set_board_va
  11714. static u16 ath9k_hw_ar9287_get_spur_channel(struct ath_hw *ah,
  11715. u16 i, bool is2GHz)
  11716. {
  11717. -#define EEP_MAP9287_SPURCHAN \
  11718. - (ah->eeprom.map9287.modalHeader.spurChans[i].spurChan)
  11719. -
  11720. - struct ath_common *common = ath9k_hw_common(ah);
  11721. - u16 spur_val = AR_NO_SPUR;
  11722. -
  11723. - ath_dbg(common, ANI, "Getting spur idx:%d is2Ghz:%d val:%x\n",
  11724. - i, is2GHz, ah->config.spurchans[i][is2GHz]);
  11725. -
  11726. - switch (ah->config.spurmode) {
  11727. - case SPUR_DISABLE:
  11728. - break;
  11729. - case SPUR_ENABLE_IOCTL:
  11730. - spur_val = ah->config.spurchans[i][is2GHz];
  11731. - ath_dbg(common, ANI, "Getting spur val from new loc. %d\n",
  11732. - spur_val);
  11733. - break;
  11734. - case SPUR_ENABLE_EEPROM:
  11735. - spur_val = EEP_MAP9287_SPURCHAN;
  11736. - break;
  11737. - }
  11738. -
  11739. - return spur_val;
  11740. -
  11741. -#undef EEP_MAP9287_SPURCHAN
  11742. + return ah->eeprom.map9287.modalHeader.spurChans[i].spurChan;
  11743. }
  11744. const struct eeprom_ops eep_ar9287_ops = {
  11745. --- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
  11746. +++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
  11747. @@ -1348,31 +1348,7 @@ static void ath9k_hw_def_set_txpower(str
  11748. static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
  11749. {
  11750. -#define EEP_DEF_SPURCHAN \
  11751. - (ah->eeprom.def.modalHeader[is2GHz].spurChans[i].spurChan)
  11752. - struct ath_common *common = ath9k_hw_common(ah);
  11753. -
  11754. - u16 spur_val = AR_NO_SPUR;
  11755. -
  11756. - ath_dbg(common, ANI, "Getting spur idx:%d is2Ghz:%d val:%x\n",
  11757. - i, is2GHz, ah->config.spurchans[i][is2GHz]);
  11758. -
  11759. - switch (ah->config.spurmode) {
  11760. - case SPUR_DISABLE:
  11761. - break;
  11762. - case SPUR_ENABLE_IOCTL:
  11763. - spur_val = ah->config.spurchans[i][is2GHz];
  11764. - ath_dbg(common, ANI, "Getting spur val from new loc. %d\n",
  11765. - spur_val);
  11766. - break;
  11767. - case SPUR_ENABLE_EEPROM:
  11768. - spur_val = EEP_DEF_SPURCHAN;
  11769. - break;
  11770. - }
  11771. -
  11772. - return spur_val;
  11773. -
  11774. -#undef EEP_DEF_SPURCHAN
  11775. + return ah->eeprom.def.modalHeader[is2GHz].spurChans[i].spurChan;
  11776. }
  11777. const struct eeprom_ops eep_def_ops = {
  11778. --- a/drivers/net/wireless/ath/ath9k/gpio.c
  11779. +++ b/drivers/net/wireless/ath/ath9k/gpio.c
  11780. @@ -157,36 +157,6 @@ static void ath_detect_bt_priority(struc
  11781. }
  11782. }
  11783. -static void ath9k_gen_timer_start(struct ath_hw *ah,
  11784. - struct ath_gen_timer *timer,
  11785. - u32 trig_timeout,
  11786. - u32 timer_period)
  11787. -{
  11788. - ath9k_hw_gen_timer_start(ah, timer, trig_timeout, timer_period);
  11789. -
  11790. - if ((ah->imask & ATH9K_INT_GENTIMER) == 0) {
  11791. - ath9k_hw_disable_interrupts(ah);
  11792. - ah->imask |= ATH9K_INT_GENTIMER;
  11793. - ath9k_hw_set_interrupts(ah);
  11794. - ath9k_hw_enable_interrupts(ah);
  11795. - }
  11796. -}
  11797. -
  11798. -static void ath9k_gen_timer_stop(struct ath_hw *ah, struct ath_gen_timer *timer)
  11799. -{
  11800. - struct ath_gen_timer_table *timer_table = &ah->hw_gen_timers;
  11801. -
  11802. - ath9k_hw_gen_timer_stop(ah, timer);
  11803. -
  11804. - /* if no timer is enabled, turn off interrupt mask */
  11805. - if (timer_table->timer_mask.val == 0) {
  11806. - ath9k_hw_disable_interrupts(ah);
  11807. - ah->imask &= ~ATH9K_INT_GENTIMER;
  11808. - ath9k_hw_set_interrupts(ah);
  11809. - ath9k_hw_enable_interrupts(ah);
  11810. - }
  11811. -}
  11812. -
  11813. static void ath_mci_ftp_adjust(struct ath_softc *sc)
  11814. {
  11815. struct ath_btcoex *btcoex = &sc->btcoex;
  11816. @@ -257,19 +227,9 @@ static void ath_btcoex_period_timer(unsi
  11817. spin_unlock_bh(&btcoex->btcoex_lock);
  11818. - /*
  11819. - * btcoex_period is in msec while (btocex/btscan_)no_stomp are in usec,
  11820. - * ensure that we properly convert btcoex_period to usec
  11821. - * for any comparision with (btcoex/btscan_)no_stomp.
  11822. - */
  11823. - if (btcoex->btcoex_period * 1000 != btcoex->btcoex_no_stomp) {
  11824. - if (btcoex->hw_timer_enabled)
  11825. - ath9k_gen_timer_stop(ah, btcoex->no_stomp_timer);
  11826. -
  11827. - ath9k_gen_timer_start(ah, btcoex->no_stomp_timer, timer_period,
  11828. - timer_period * 10);
  11829. - btcoex->hw_timer_enabled = true;
  11830. - }
  11831. + if (btcoex->btcoex_period != btcoex->btcoex_no_stomp)
  11832. + mod_timer(&btcoex->no_stomp_timer,
  11833. + jiffies + msecs_to_jiffies(timer_period));
  11834. ath9k_ps_restore(sc);
  11835. @@ -282,7 +242,7 @@ skip_hw_wakeup:
  11836. * Generic tsf based hw timer which configures weight
  11837. * registers to time slice between wlan and bt traffic
  11838. */
  11839. -static void ath_btcoex_no_stomp_timer(void *arg)
  11840. +static void ath_btcoex_no_stomp_timer(unsigned long arg)
  11841. {
  11842. struct ath_softc *sc = (struct ath_softc *)arg;
  11843. struct ath_hw *ah = sc->sc_ah;
  11844. @@ -311,24 +271,18 @@ static int ath_init_btcoex_timer(struct
  11845. struct ath_btcoex *btcoex = &sc->btcoex;
  11846. btcoex->btcoex_period = ATH_BTCOEX_DEF_BT_PERIOD;
  11847. - btcoex->btcoex_no_stomp = (100 - ATH_BTCOEX_DEF_DUTY_CYCLE) * 1000 *
  11848. + btcoex->btcoex_no_stomp = (100 - ATH_BTCOEX_DEF_DUTY_CYCLE) *
  11849. btcoex->btcoex_period / 100;
  11850. - btcoex->btscan_no_stomp = (100 - ATH_BTCOEX_BTSCAN_DUTY_CYCLE) * 1000 *
  11851. + btcoex->btscan_no_stomp = (100 - ATH_BTCOEX_BTSCAN_DUTY_CYCLE) *
  11852. btcoex->btcoex_period / 100;
  11853. setup_timer(&btcoex->period_timer, ath_btcoex_period_timer,
  11854. (unsigned long) sc);
  11855. + setup_timer(&btcoex->no_stomp_timer, ath_btcoex_no_stomp_timer,
  11856. + (unsigned long) sc);
  11857. spin_lock_init(&btcoex->btcoex_lock);
  11858. - btcoex->no_stomp_timer = ath_gen_timer_alloc(sc->sc_ah,
  11859. - ath_btcoex_no_stomp_timer,
  11860. - ath_btcoex_no_stomp_timer,
  11861. - (void *) sc, AR_FIRST_NDP_TIMER);
  11862. -
  11863. - if (!btcoex->no_stomp_timer)
  11864. - return -ENOMEM;
  11865. -
  11866. return 0;
  11867. }
  11868. @@ -343,10 +297,7 @@ void ath9k_btcoex_timer_resume(struct at
  11869. ath_dbg(ath9k_hw_common(ah), BTCOEX, "Starting btcoex timers\n");
  11870. /* make sure duty cycle timer is also stopped when resuming */
  11871. - if (btcoex->hw_timer_enabled) {
  11872. - ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer);
  11873. - btcoex->hw_timer_enabled = false;
  11874. - }
  11875. + del_timer_sync(&btcoex->no_stomp_timer);
  11876. btcoex->bt_priority_cnt = 0;
  11877. btcoex->bt_priority_time = jiffies;
  11878. @@ -363,24 +314,16 @@ void ath9k_btcoex_timer_resume(struct at
  11879. void ath9k_btcoex_timer_pause(struct ath_softc *sc)
  11880. {
  11881. struct ath_btcoex *btcoex = &sc->btcoex;
  11882. - struct ath_hw *ah = sc->sc_ah;
  11883. del_timer_sync(&btcoex->period_timer);
  11884. -
  11885. - if (btcoex->hw_timer_enabled) {
  11886. - ath9k_gen_timer_stop(ah, btcoex->no_stomp_timer);
  11887. - btcoex->hw_timer_enabled = false;
  11888. - }
  11889. + del_timer_sync(&btcoex->no_stomp_timer);
  11890. }
  11891. void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc)
  11892. {
  11893. struct ath_btcoex *btcoex = &sc->btcoex;
  11894. - if (btcoex->hw_timer_enabled) {
  11895. - ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer);
  11896. - btcoex->hw_timer_enabled = false;
  11897. - }
  11898. + del_timer_sync(&btcoex->no_stomp_timer);
  11899. }
  11900. u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen)
  11901. @@ -400,12 +343,6 @@ u16 ath9k_btcoex_aggr_limit(struct ath_s
  11902. void ath9k_btcoex_handle_interrupt(struct ath_softc *sc, u32 status)
  11903. {
  11904. - struct ath_hw *ah = sc->sc_ah;
  11905. -
  11906. - if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE)
  11907. - if (status & ATH9K_INT_GENTIMER)
  11908. - ath_gen_timer_isr(sc->sc_ah);
  11909. -
  11910. if (status & ATH9K_INT_MCI)
  11911. ath_mci_intr(sc);
  11912. }
  11913. @@ -447,10 +384,6 @@ void ath9k_deinit_btcoex(struct ath_soft
  11914. {
  11915. struct ath_hw *ah = sc->sc_ah;
  11916. - if ((sc->btcoex.no_stomp_timer) &&
  11917. - ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_3WIRE)
  11918. - ath_gen_timer_free(sc->sc_ah, sc->btcoex.no_stomp_timer);
  11919. -
  11920. if (ath9k_hw_mci_is_enabled(ah))
  11921. ath_mci_cleanup(sc);
  11922. }
  11923. --- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
  11924. +++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
  11925. @@ -70,11 +70,11 @@ static void ath9k_htc_beacon_config_sta(
  11926. struct ath9k_beacon_state bs;
  11927. enum ath9k_int imask = 0;
  11928. int dtimperiod, dtimcount, sleepduration;
  11929. - int cfpperiod, cfpcount, bmiss_timeout;
  11930. + int bmiss_timeout;
  11931. u32 nexttbtt = 0, intval, tsftu;
  11932. __be32 htc_imask = 0;
  11933. u64 tsf;
  11934. - int num_beacons, offset, dtim_dec_count, cfp_dec_count;
  11935. + int num_beacons, offset, dtim_dec_count;
  11936. int ret __attribute__ ((unused));
  11937. u8 cmd_rsp;
  11938. @@ -84,7 +84,7 @@ static void ath9k_htc_beacon_config_sta(
  11939. bmiss_timeout = (ATH_DEFAULT_BMISS_LIMIT * bss_conf->beacon_interval);
  11940. /*
  11941. - * Setup dtim and cfp parameters according to
  11942. + * Setup dtim parameters according to
  11943. * last beacon we received (which may be none).
  11944. */
  11945. dtimperiod = bss_conf->dtim_period;
  11946. @@ -93,8 +93,6 @@ static void ath9k_htc_beacon_config_sta(
  11947. dtimcount = 1;
  11948. if (dtimcount >= dtimperiod) /* NB: sanity check */
  11949. dtimcount = 0;
  11950. - cfpperiod = 1; /* NB: no PCF support yet */
  11951. - cfpcount = 0;
  11952. sleepduration = intval;
  11953. if (sleepduration <= 0)
  11954. @@ -102,7 +100,7 @@ static void ath9k_htc_beacon_config_sta(
  11955. /*
  11956. * Pull nexttbtt forward to reflect the current
  11957. - * TSF and calculate dtim+cfp state for the result.
  11958. + * TSF and calculate dtim state for the result.
  11959. */
  11960. tsf = ath9k_hw_gettsf64(priv->ah);
  11961. tsftu = TSF_TO_TU(tsf>>32, tsf) + FUDGE;
  11962. @@ -115,26 +113,14 @@ static void ath9k_htc_beacon_config_sta(
  11963. /* DTIM Beacon every dtimperiod Beacon */
  11964. dtim_dec_count = num_beacons % dtimperiod;
  11965. - /* CFP every cfpperiod DTIM Beacon */
  11966. - cfp_dec_count = (num_beacons / dtimperiod) % cfpperiod;
  11967. - if (dtim_dec_count)
  11968. - cfp_dec_count++;
  11969. -
  11970. dtimcount -= dtim_dec_count;
  11971. if (dtimcount < 0)
  11972. dtimcount += dtimperiod;
  11973. - cfpcount -= cfp_dec_count;
  11974. - if (cfpcount < 0)
  11975. - cfpcount += cfpperiod;
  11976. -
  11977. - bs.bs_intval = intval;
  11978. - bs.bs_nexttbtt = nexttbtt;
  11979. - bs.bs_dtimperiod = dtimperiod*intval;
  11980. - bs.bs_nextdtim = bs.bs_nexttbtt + dtimcount*intval;
  11981. - bs.bs_cfpperiod = cfpperiod*bs.bs_dtimperiod;
  11982. - bs.bs_cfpnext = bs.bs_nextdtim + cfpcount*bs.bs_dtimperiod;
  11983. - bs.bs_cfpmaxduration = 0;
  11984. + bs.bs_intval = TU_TO_USEC(intval);
  11985. + bs.bs_nexttbtt = TU_TO_USEC(nexttbtt);
  11986. + bs.bs_dtimperiod = dtimperiod * bs.bs_intval;
  11987. + bs.bs_nextdtim = bs.bs_nexttbtt + dtimcount * bs.bs_intval;
  11988. /*
  11989. * Calculate the number of consecutive beacons to miss* before taking
  11990. @@ -161,7 +147,8 @@ static void ath9k_htc_beacon_config_sta(
  11991. * XXX fixed at 100ms
  11992. */
  11993. - bs.bs_sleepduration = roundup(IEEE80211_MS_TO_TU(100), sleepduration);
  11994. + bs.bs_sleepduration = TU_TO_USEC(roundup(IEEE80211_MS_TO_TU(100),
  11995. + sleepduration));
  11996. if (bs.bs_sleepduration > bs.bs_dtimperiod)
  11997. bs.bs_sleepduration = bs.bs_dtimperiod;
  11998. @@ -170,10 +157,8 @@ static void ath9k_htc_beacon_config_sta(
  11999. ath_dbg(common, CONFIG, "intval: %u tsf: %llu tsftu: %u\n",
  12000. intval, tsf, tsftu);
  12001. - ath_dbg(common, CONFIG,
  12002. - "bmiss: %u sleep: %u cfp-period: %u maxdur: %u next: %u\n",
  12003. - bs.bs_bmissthreshold, bs.bs_sleepduration,
  12004. - bs.bs_cfpperiod, bs.bs_cfpmaxduration, bs.bs_cfpnext);
  12005. + ath_dbg(common, CONFIG, "bmiss: %u sleep: %u\n",
  12006. + bs.bs_bmissthreshold, bs.bs_sleepduration);
  12007. /* Set the computed STA beacon timers */
  12008. --- a/drivers/net/wireless/ath/ath9k/mac.c
  12009. +++ b/drivers/net/wireless/ath/ath9k/mac.c
  12010. @@ -481,8 +481,7 @@ bool ath9k_hw_resettxqueue(struct ath_hw
  12011. | AR_Q_MISC_CBR_INCR_DIS0);
  12012. value = (qi->tqi_readyTime -
  12013. (ah->config.sw_beacon_response_time -
  12014. - ah->config.dma_beacon_response_time) -
  12015. - ah->config.additional_swba_backoff) * 1024;
  12016. + ah->config.dma_beacon_response_time)) * 1024;
  12017. REG_WRITE(ah, AR_QRDYTIMECFG(q),
  12018. value | AR_Q_RDYTIMECFG_EN);
  12019. REG_SET_BIT(ah, AR_DMISC(q),
  12020. @@ -550,25 +549,25 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a
  12021. if (ads.ds_rxstatus8 & AR_PostDelimCRCErr) {
  12022. rs->rs_rssi = ATH9K_RSSI_BAD;
  12023. - rs->rs_rssi_ctl0 = ATH9K_RSSI_BAD;
  12024. - rs->rs_rssi_ctl1 = ATH9K_RSSI_BAD;
  12025. - rs->rs_rssi_ctl2 = ATH9K_RSSI_BAD;
  12026. - rs->rs_rssi_ext0 = ATH9K_RSSI_BAD;
  12027. - rs->rs_rssi_ext1 = ATH9K_RSSI_BAD;
  12028. - rs->rs_rssi_ext2 = ATH9K_RSSI_BAD;
  12029. + rs->rs_rssi_ctl[0] = ATH9K_RSSI_BAD;
  12030. + rs->rs_rssi_ctl[1] = ATH9K_RSSI_BAD;
  12031. + rs->rs_rssi_ctl[2] = ATH9K_RSSI_BAD;
  12032. + rs->rs_rssi_ext[0] = ATH9K_RSSI_BAD;
  12033. + rs->rs_rssi_ext[1] = ATH9K_RSSI_BAD;
  12034. + rs->rs_rssi_ext[2] = ATH9K_RSSI_BAD;
  12035. } else {
  12036. rs->rs_rssi = MS(ads.ds_rxstatus4, AR_RxRSSICombined);
  12037. - rs->rs_rssi_ctl0 = MS(ads.ds_rxstatus0,
  12038. + rs->rs_rssi_ctl[0] = MS(ads.ds_rxstatus0,
  12039. AR_RxRSSIAnt00);
  12040. - rs->rs_rssi_ctl1 = MS(ads.ds_rxstatus0,
  12041. + rs->rs_rssi_ctl[1] = MS(ads.ds_rxstatus0,
  12042. AR_RxRSSIAnt01);
  12043. - rs->rs_rssi_ctl2 = MS(ads.ds_rxstatus0,
  12044. + rs->rs_rssi_ctl[2] = MS(ads.ds_rxstatus0,
  12045. AR_RxRSSIAnt02);
  12046. - rs->rs_rssi_ext0 = MS(ads.ds_rxstatus4,
  12047. + rs->rs_rssi_ext[0] = MS(ads.ds_rxstatus4,
  12048. AR_RxRSSIAnt10);
  12049. - rs->rs_rssi_ext1 = MS(ads.ds_rxstatus4,
  12050. + rs->rs_rssi_ext[1] = MS(ads.ds_rxstatus4,
  12051. AR_RxRSSIAnt11);
  12052. - rs->rs_rssi_ext2 = MS(ads.ds_rxstatus4,
  12053. + rs->rs_rssi_ext[2] = MS(ads.ds_rxstatus4,
  12054. AR_RxRSSIAnt12);
  12055. }
  12056. if (ads.ds_rxstatus8 & AR_RxKeyIdxValid)
  12057. --- a/drivers/net/wireless/ath/ath9k/mac.h
  12058. +++ b/drivers/net/wireless/ath/ath9k/mac.h
  12059. @@ -133,12 +133,8 @@ struct ath_rx_status {
  12060. u8 rs_rate;
  12061. u8 rs_antenna;
  12062. u8 rs_more;
  12063. - int8_t rs_rssi_ctl0;
  12064. - int8_t rs_rssi_ctl1;
  12065. - int8_t rs_rssi_ctl2;
  12066. - int8_t rs_rssi_ext0;
  12067. - int8_t rs_rssi_ext1;
  12068. - int8_t rs_rssi_ext2;
  12069. + int8_t rs_rssi_ctl[3];
  12070. + int8_t rs_rssi_ext[3];
  12071. u8 rs_isaggr;
  12072. u8 rs_firstaggr;
  12073. u8 rs_moreaggr;
  12074. --- a/drivers/net/wireless/ath/ath9k/mci.c
  12075. +++ b/drivers/net/wireless/ath/ath9k/mci.c
  12076. @@ -200,7 +200,7 @@ skip_tuning:
  12077. if (btcoex->duty_cycle > ATH_MCI_MAX_DUTY_CYCLE)
  12078. btcoex->duty_cycle = ATH_MCI_MAX_DUTY_CYCLE;
  12079. - btcoex->btcoex_no_stomp = btcoex->btcoex_period * 1000 *
  12080. + btcoex->btcoex_no_stomp = btcoex->btcoex_period *
  12081. (100 - btcoex->duty_cycle) / 100;
  12082. ath9k_hw_btcoex_enable(sc->sc_ah);
  12083. --- a/drivers/net/wireless/ath/ath9k/recv.c
  12084. +++ b/drivers/net/wireless/ath/ath9k/recv.c
  12085. @@ -906,6 +906,7 @@ static void ath9k_process_rssi(struct at
  12086. struct ath_hw *ah = common->ah;
  12087. int last_rssi;
  12088. int rssi = rx_stats->rs_rssi;
  12089. + int i, j;
  12090. /*
  12091. * RSSI is not available for subframes in an A-MPDU.
  12092. @@ -924,6 +925,20 @@ static void ath9k_process_rssi(struct at
  12093. return;
  12094. }
  12095. + for (i = 0, j = 0; i < ARRAY_SIZE(rx_stats->rs_rssi_ctl); i++) {
  12096. + s8 rssi;
  12097. +
  12098. + if (!(ah->rxchainmask & BIT(i)))
  12099. + continue;
  12100. +
  12101. + rssi = rx_stats->rs_rssi_ctl[i];
  12102. + if (rssi != ATH9K_RSSI_BAD) {
  12103. + rxs->chains |= BIT(j);
  12104. + rxs->chain_signal[j] = ah->noise + rssi;
  12105. + }
  12106. + j++;
  12107. + }
  12108. +
  12109. /*
  12110. * Update Beacon RSSI, this is used by ANI.
  12111. */
  12112. @@ -1073,14 +1088,14 @@ static int ath_process_fft(struct ath_so
  12113. fft_sample_40.channel_type = chan_type;
  12114. if (chan_type == NL80211_CHAN_HT40PLUS) {
  12115. - lower_rssi = fix_rssi_inv_only(rs->rs_rssi_ctl0);
  12116. - upper_rssi = fix_rssi_inv_only(rs->rs_rssi_ext0);
  12117. + lower_rssi = fix_rssi_inv_only(rs->rs_rssi_ctl[0]);
  12118. + upper_rssi = fix_rssi_inv_only(rs->rs_rssi_ext[0]);
  12119. fft_sample_40.lower_noise = ah->noise;
  12120. fft_sample_40.upper_noise = ext_nf;
  12121. } else {
  12122. - lower_rssi = fix_rssi_inv_only(rs->rs_rssi_ext0);
  12123. - upper_rssi = fix_rssi_inv_only(rs->rs_rssi_ctl0);
  12124. + lower_rssi = fix_rssi_inv_only(rs->rs_rssi_ext[0]);
  12125. + upper_rssi = fix_rssi_inv_only(rs->rs_rssi_ctl[0]);
  12126. fft_sample_40.lower_noise = ext_nf;
  12127. fft_sample_40.upper_noise = ah->noise;
  12128. @@ -1116,7 +1131,7 @@ static int ath_process_fft(struct ath_so
  12129. fft_sample_20.tlv.length = __cpu_to_be16(length);
  12130. fft_sample_20.freq = __cpu_to_be16(freq);
  12131. - fft_sample_20.rssi = fix_rssi_inv_only(rs->rs_rssi_ctl0);
  12132. + fft_sample_20.rssi = fix_rssi_inv_only(rs->rs_rssi_ctl[0]);
  12133. fft_sample_20.noise = ah->noise;
  12134. mag_info = ((struct ath_ht20_mag_info *)radar_info) - 1;