0016-Backport-hostapd-and-mac80211-from-Barrier-Breaker.patch 467 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Mon, 28 Apr 2014 21:44:58 +0200
  3. Subject: Backport hostapd and mac80211 from Barrier Breaker
  4. diff --git a/package/hostapd/Makefile b/package/hostapd/Makefile
  5. index b4dc242..ecf9e4b 100644
  6. --- a/package/hostapd/Makefile
  7. +++ b/package/hostapd/Makefile
  8. @@ -8,9 +8,9 @@
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=hostapd
  11. -PKG_VERSION:=20131120
  12. +PKG_VERSION:=2014-04-24
  13. PKG_RELEASE:=1
  14. -PKG_REV:=594516b4c28a94ca686b17f1e463dfd6712b75a7
  15. +PKG_REV:=3cf48c4f2e2d558130253457fea02ef4047cf8e1
  16. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  17. PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
  18. diff --git a/package/hostapd/patches/100-madwifi_key_fixes.patch b/package/hostapd/patches/100-madwifi_key_fixes.patch
  19. index dcd6d10..a46943b 100644
  20. --- a/package/hostapd/patches/100-madwifi_key_fixes.patch
  21. +++ b/package/hostapd/patches/100-madwifi_key_fixes.patch
  22. @@ -1,6 +1,6 @@
  23. --- a/src/drivers/driver_madwifi.c
  24. +++ b/src/drivers/driver_madwifi.c
  25. -@@ -450,7 +450,9 @@ wpa_driver_madwifi_set_key(const char *i
  26. +@@ -449,7 +449,9 @@ wpa_driver_madwifi_set_key(const char *i
  27. memset(&wk, 0, sizeof(wk));
  28. wk.ik_type = cipher;
  29. @@ -11,7 +11,7 @@
  30. if (addr == NULL || is_broadcast_ether_addr(addr)) {
  31. memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN);
  32. wk.ik_keyix = key_idx;
  33. -@@ -462,6 +464,20 @@ wpa_driver_madwifi_set_key(const char *i
  34. +@@ -461,6 +463,20 @@ wpa_driver_madwifi_set_key(const char *i
  35. wk.ik_keylen = key_len;
  36. memcpy(wk.ik_keydata, key, key_len);
  37. diff --git a/package/hostapd/patches/110-bool_fix.patch b/package/hostapd/patches/110-bool_fix.patch
  38. index 9f82b0b..1ad84bf 100644
  39. --- a/package/hostapd/patches/110-bool_fix.patch
  40. +++ b/package/hostapd/patches/110-bool_fix.patch
  41. @@ -1,6 +1,6 @@
  42. --- a/src/ap/ieee802_1x.c
  43. +++ b/src/ap/ieee802_1x.c
  44. -@@ -1933,9 +1933,9 @@ void ieee802_1x_notify_pre_auth(struct e
  45. +@@ -2119,9 +2119,9 @@ void ieee802_1x_notify_pre_auth(struct e
  46. }
  47. diff --git a/package/hostapd/patches/130-wds_sta_del_fix.patch b/package/hostapd/patches/130-wds_sta_del_fix.patch
  48. deleted file mode 100644
  49. index 06b6906..0000000
  50. --- a/package/hostapd/patches/130-wds_sta_del_fix.patch
  51. +++ /dev/null
  52. @@ -1,13 +0,0 @@
  53. ---- a/src/drivers/driver_nl80211.c
  54. -+++ b/src/drivers/driver_nl80211.c
  55. -@@ -9083,8 +9083,8 @@ static int i802_set_wds_sta(void *priv,
  56. - name);
  57. -
  58. - i802_set_sta_vlan(priv, addr, bss->ifname, 0);
  59. -- return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN,
  60. -- name);
  61. -+ nl80211_remove_iface(drv, if_nametoindex(name));
  62. -+ return 0;
  63. - }
  64. - }
  65. -
  66. diff --git a/package/hostapd/patches/200-multicall.patch b/package/hostapd/patches/200-multicall.patch
  67. index 2289f51..1511b19 100644
  68. --- a/package/hostapd/patches/200-multicall.patch
  69. +++ b/package/hostapd/patches/200-multicall.patch
  70. @@ -1,14 +1,14 @@
  71. --- a/hostapd/Makefile
  72. +++ b/hostapd/Makefile
  73. -@@ -14,6 +14,7 @@ CFLAGS += -I../src/utils
  74. +@@ -14,6 +14,7 @@ CFLAGS += -I$(abspath ../src/utils)
  75. # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
  76. -include .config
  77. +-include $(if $(MULTICALL), ../wpa_supplicant/.config)
  78. - ifndef CONFIG_OS
  79. - ifdef CONFIG_NATIVE_WINDOWS
  80. -@@ -200,10 +201,14 @@ ifdef CONFIG_IEEE80211AC
  81. + ifdef CONFIG_TESTING_OPTIONS
  82. + CFLAGS += -DCONFIG_TESTING_OPTIONS
  83. +@@ -223,10 +224,14 @@ ifdef CONFIG_IEEE80211AC
  84. CFLAGS += -DCONFIG_IEEE80211AC
  85. endif
  86. @@ -26,7 +26,7 @@
  87. LIBS += $(DRV_AP_LIBS)
  88. ifdef CONFIG_L2_PACKET
  89. -@@ -890,6 +895,12 @@ install: all
  90. +@@ -913,6 +918,12 @@ install: all
  91. BCHECK=../src/drivers/build.hostapd
  92. @@ -39,7 +39,7 @@
  93. hostapd: $(BCHECK) $(OBJS)
  94. $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
  95. @$(E) " LD " $@
  96. -@@ -928,6 +939,12 @@ HOBJS += ../src/crypto/aes-internal.o
  97. +@@ -951,6 +962,12 @@ HOBJS += ../src/crypto/aes-internal.o
  98. HOBJS += ../src/crypto/aes-internal-enc.o
  99. endif
  100. @@ -54,15 +54,15 @@
  101. @$(E) " LD " $@
  102. --- a/wpa_supplicant/Makefile
  103. +++ b/wpa_supplicant/Makefile
  104. -@@ -14,6 +14,7 @@ CFLAGS += -I../src
  105. - CFLAGS += -I../src/utils
  106. +@@ -14,6 +14,7 @@ CFLAGS += -I$(abspath ../src)
  107. + CFLAGS += -I$(abspath ../src/utils)
  108. -include .config
  109. +-include $(if $(MULTICALL),../hostapd/.config)
  110. - BINALL=wpa_supplicant wpa_cli
  111. -
  112. -@@ -727,6 +728,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
  113. + ifdef CONFIG_TESTING_OPTIONS
  114. + CFLAGS += -DCONFIG_TESTING_OPTIONS
  115. +@@ -746,6 +747,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
  116. CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  117. LIBS += -ldl -rdynamic
  118. endif
  119. @@ -73,7 +73,7 @@
  120. endif
  121. ifdef CONFIG_AP
  122. -@@ -735,9 +740,11 @@ NEED_EAP_COMMON=y
  123. +@@ -754,9 +759,11 @@ NEED_EAP_COMMON=y
  124. NEED_RSN_AUTHENTICATOR=y
  125. CFLAGS += -DCONFIG_AP
  126. OBJS += ap.o
  127. @@ -85,7 +85,7 @@
  128. OBJS += ../src/ap/hostapd.o
  129. OBJS += ../src/ap/wpa_auth_glue.o
  130. OBJS += ../src/ap/utils.o
  131. -@@ -799,10 +806,18 @@ endif
  132. +@@ -818,10 +825,18 @@ endif
  133. ifdef CONFIG_HS20
  134. OBJS += ../src/ap/hs20.o
  135. endif
  136. @@ -104,7 +104,7 @@
  137. NEED_AES_WRAP=y
  138. OBJS += ../src/ap/wpa_auth.o
  139. OBJS += ../src/ap/wpa_auth_ie.o
  140. -@@ -1551,6 +1566,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
  141. +@@ -1584,6 +1599,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
  142. $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
  143. @@ -117,7 +117,7 @@
  144. wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
  145. $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  146. @$(E) " LD " $@
  147. -@@ -1625,6 +1646,12 @@ eap_eke.so: ../src/eap_peer/eap_eke.c ..
  148. +@@ -1664,6 +1685,12 @@ endif
  149. %@.service: %.service.arg.in
  150. sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
  151. @@ -132,7 +132,7 @@
  152. wpa_cli.exe: wpa_cli
  153. --- a/src/drivers/driver.h
  154. +++ b/src/drivers/driver.h
  155. -@@ -4079,8 +4079,8 @@ union wpa_event_data {
  156. +@@ -3886,8 +3886,8 @@ union wpa_event_data {
  157. * Driver wrapper code should call this function whenever an event is received
  158. * from the driver.
  159. */
  160. @@ -145,7 +145,7 @@
  161. /*
  162. --- a/src/ap/drv_callbacks.c
  163. +++ b/src/ap/drv_callbacks.c
  164. -@@ -844,8 +844,8 @@ static void hostapd_event_dfs_nop_finish
  165. +@@ -906,8 +906,8 @@ static void hostapd_event_dfs_nop_finish
  166. #endif /* NEED_AP_MLME */
  167. @@ -158,7 +158,7 @@
  168. #ifndef CONFIG_NO_STDOUT_DEBUG
  169. --- a/wpa_supplicant/wpa_priv.c
  170. +++ b/wpa_supplicant/wpa_priv.c
  171. -@@ -817,8 +817,8 @@ static void wpa_priv_send_ft_response(st
  172. +@@ -815,8 +815,8 @@ static void wpa_priv_send_ft_response(st
  173. }
  174. @@ -169,7 +169,7 @@
  175. {
  176. struct wpa_priv_interface *iface = ctx;
  177. -@@ -960,6 +960,7 @@ int main(int argc, char *argv[])
  178. +@@ -956,6 +956,7 @@ int main(int argc, char *argv[])
  179. if (os_program_init())
  180. return -1;
  181. @@ -179,7 +179,7 @@
  182. for (;;) {
  183. --- a/wpa_supplicant/events.c
  184. +++ b/wpa_supplicant/events.c
  185. -@@ -2710,8 +2710,8 @@ static void wpa_supplicant_update_channe
  186. +@@ -2929,8 +2929,8 @@ static void wpa_supplicant_notify_avoid_
  187. }
  188. @@ -192,7 +192,7 @@
  189. --- a/wpa_supplicant/wpa_supplicant.c
  190. +++ b/wpa_supplicant/wpa_supplicant.c
  191. -@@ -3138,6 +3138,9 @@ static void wpa_supplicant_deinit_iface(
  192. +@@ -3724,6 +3724,9 @@ static void wpa_supplicant_deinit_iface(
  193. os_free(wpa_s);
  194. }
  195. @@ -202,7 +202,7 @@
  196. /**
  197. * wpa_supplicant_add_iface - Add a new network interface
  198. -@@ -3329,6 +3332,7 @@ struct wpa_global * wpa_supplicant_init(
  199. +@@ -3915,6 +3918,7 @@ struct wpa_global * wpa_supplicant_init(
  200. wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
  201. #endif /* CONFIG_NO_WPA_MSG */
  202. @@ -212,7 +212,7 @@
  203. wpa_debug_open_syslog();
  204. --- a/hostapd/main.c
  205. +++ b/hostapd/main.c
  206. -@@ -511,6 +511,9 @@ static int hostapd_get_ctrl_iface_group(
  207. +@@ -502,6 +502,9 @@ static int hostapd_get_ctrl_iface_group(
  208. return 0;
  209. }
  210. @@ -220,27 +220,25 @@
  211. + union wpa_event_data *data);
  212. +
  213. - int main(int argc, char *argv[])
  214. - {
  215. -@@ -541,6 +544,7 @@ int main(int argc, char *argv[])
  216. + #ifdef CONFIG_WPS
  217. + static int gen_uuid(const char *txt_addr)
  218. +@@ -553,6 +556,7 @@ int main(int argc, char *argv[])
  219. interfaces.global_iface_name = NULL;
  220. interfaces.global_ctrl_sock = -1;
  221. + wpa_supplicant_event = hostapd_wpa_event;
  222. for (;;) {
  223. - c = getopt(argc, argv, "b:Bde:f:hKP:Ttvg:G:");
  224. + c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:vg:G:");
  225. if (c < 0)
  226. --- a/src/drivers/drivers.c
  227. +++ b/src/drivers/drivers.c
  228. -@@ -7,7 +7,11 @@
  229. - */
  230. -
  231. - #include "includes.h"
  232. -+#include "common.h"
  233. -+#include "driver.h"
  234. +@@ -10,6 +10,9 @@
  235. + #include "utils/common.h"
  236. + #include "driver.h"
  237. +void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
  238. + union wpa_event_data *data);
  239. -
  240. ++
  241. #ifdef CONFIG_DRIVER_WEXT
  242. extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
  243. + #endif /* CONFIG_DRIVER_WEXT */
  244. diff --git a/package/hostapd/patches/300-noscan.patch b/package/hostapd/patches/300-noscan.patch
  245. index 17e7661..50b70b7 100644
  246. --- a/package/hostapd/patches/300-noscan.patch
  247. +++ b/package/hostapd/patches/300-noscan.patch
  248. @@ -1,17 +1,17 @@
  249. --- a/hostapd/config_file.c
  250. +++ b/hostapd/config_file.c
  251. -@@ -2412,6 +2412,8 @@ static int hostapd_config_fill(struct ho
  252. - }
  253. +@@ -2638,6 +2638,8 @@ static int hostapd_config_fill(struct ho
  254. + }
  255. #endif /* CONFIG_IEEE80211W */
  256. #ifdef CONFIG_IEEE80211N
  257. -+ } else if (os_strcmp(buf, "noscan") == 0) {
  258. -+ conf->noscan = atoi(pos);
  259. - } else if (os_strcmp(buf, "ieee80211n") == 0) {
  260. - conf->ieee80211n = atoi(pos);
  261. - } else if (os_strcmp(buf, "ht_capab") == 0) {
  262. ++ } else if (os_strcmp(buf, "noscan") == 0) {
  263. ++ conf->noscan = atoi(pos);
  264. + } else if (os_strcmp(buf, "ieee80211n") == 0) {
  265. + conf->ieee80211n = atoi(pos);
  266. + } else if (os_strcmp(buf, "ht_capab") == 0) {
  267. --- a/src/ap/ap_config.h
  268. +++ b/src/ap/ap_config.h
  269. -@@ -527,6 +527,7 @@ struct hostapd_config {
  270. +@@ -576,6 +576,7 @@ struct hostapd_config {
  271. int ht_op_mode_fixed;
  272. u16 ht_capab;
  273. @@ -21,7 +21,7 @@
  274. int require_ht;
  275. --- a/src/ap/hw_features.c
  276. +++ b/src/ap/hw_features.c
  277. -@@ -577,7 +577,7 @@ static int ieee80211n_check_40mhz(struct
  278. +@@ -574,7 +574,7 @@ static int ieee80211n_check_40mhz(struct
  279. {
  280. struct wpa_driver_scan_params params;
  281. diff --git a/package/hostapd/patches/310-rescan_immediately.patch b/package/hostapd/patches/310-rescan_immediately.patch
  282. index 043f07c..f96c7e6 100644
  283. --- a/package/hostapd/patches/310-rescan_immediately.patch
  284. +++ b/package/hostapd/patches/310-rescan_immediately.patch
  285. @@ -1,6 +1,6 @@
  286. --- a/wpa_supplicant/wpa_supplicant.c
  287. +++ b/wpa_supplicant/wpa_supplicant.c
  288. -@@ -2488,7 +2488,7 @@ static struct wpa_supplicant * wpa_suppl
  289. +@@ -2746,7 +2746,7 @@ static struct wpa_supplicant * wpa_suppl
  290. if (wpa_s == NULL)
  291. return NULL;
  292. wpa_s->scan_req = INITIAL_SCAN_REQ;
  293. diff --git a/package/hostapd/patches/320-optional_rfkill.patch b/package/hostapd/patches/320-optional_rfkill.patch
  294. index 7ec51b1..b0ea38f 100644
  295. --- a/package/hostapd/patches/320-optional_rfkill.patch
  296. +++ b/package/hostapd/patches/320-optional_rfkill.patch
  297. @@ -1,218 +1,3 @@
  298. ---- a/src/drivers/driver_nl80211.c
  299. -+++ b/src/drivers/driver_nl80211.c
  300. -@@ -254,7 +254,9 @@ struct wpa_driver_nl80211_data {
  301. - int if_removed;
  302. - int if_disabled;
  303. - int ignore_if_down_event;
  304. -+#ifdef CONFIG_RFKILL
  305. - struct rfkill_data *rfkill;
  306. -+#endif
  307. - struct wpa_driver_capa capa;
  308. - u8 *extended_capa, *extended_capa_mask;
  309. - unsigned int extended_capa_len;
  310. -@@ -3630,7 +3632,7 @@ static int wpa_driver_nl80211_init_nl(st
  311. - return 0;
  312. - }
  313. -
  314. --
  315. -+#ifdef CONFIG_RFKILL
  316. - static void wpa_driver_nl80211_rfkill_blocked(void *ctx)
  317. - {
  318. - wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked");
  319. -@@ -3652,6 +3654,7 @@ static void wpa_driver_nl80211_rfkill_un
  320. - }
  321. - /* rtnetlink ifup handler will report interface as enabled */
  322. - }
  323. -+#endif /* CONFIG_RFKILL */
  324. -
  325. -
  326. - static void wpa_driver_nl80211_handle_eapol_tx_status(int sock,
  327. -@@ -3740,7 +3743,9 @@ static void * wpa_driver_nl80211_drv_ini
  328. - const u8 *set_addr)
  329. - {
  330. - struct wpa_driver_nl80211_data *drv;
  331. -+#ifdef CONFIG_RFKILL
  332. - struct rfkill_config *rcfg;
  333. -+#endif
  334. - struct i802_bss *bss;
  335. -
  336. - if (global_priv == NULL)
  337. -@@ -3778,6 +3783,7 @@ static void * wpa_driver_nl80211_drv_ini
  338. - if (nl80211_init_bss(bss))
  339. - goto failed;
  340. -
  341. -+#ifdef CONFIG_RFKILL
  342. - rcfg = os_zalloc(sizeof(*rcfg));
  343. - if (rcfg == NULL)
  344. - goto failed;
  345. -@@ -3790,6 +3796,7 @@ static void * wpa_driver_nl80211_drv_ini
  346. - wpa_printf(MSG_DEBUG, "nl80211: RFKILL status not available");
  347. - os_free(rcfg);
  348. - }
  349. -+#endif /* CONFIG_RFKILL */
  350. -
  351. - if (linux_iface_up(drv->global->ioctl_sock, ifname) > 0)
  352. - drv->start_iface_up = 1;
  353. -@@ -4116,10 +4123,12 @@ static void nl80211_mgmt_unsubscribe(str
  354. - }
  355. -
  356. -
  357. -+#ifdef CONFIG_RFKILL
  358. - static void wpa_driver_nl80211_send_rfkill(void *eloop_ctx, void *timeout_ctx)
  359. - {
  360. - wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
  361. - }
  362. -+#endif /* CONFIG_RFKILL */
  363. -
  364. -
  365. - static void nl80211_del_p2pdev(struct i802_bss *bss)
  366. -@@ -4246,13 +4255,16 @@ wpa_driver_nl80211_finish_drv_init(struc
  367. - }
  368. -
  369. - if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) {
  370. -+#ifdef CONFIG_RFKILL
  371. - if (rfkill_is_blocked(drv->rfkill)) {
  372. - wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
  373. - "interface '%s' due to rfkill",
  374. - bss->ifname);
  375. - drv->if_disabled = 1;
  376. - send_rfkill_event = 1;
  377. -- } else {
  378. -+ } else
  379. -+#endif
  380. -+ {
  381. - wpa_printf(MSG_ERROR, "nl80211: Could not set "
  382. - "interface '%s' UP", bss->ifname);
  383. - return -1;
  384. -@@ -4268,8 +4280,10 @@ wpa_driver_nl80211_finish_drv_init(struc
  385. - return -1;
  386. -
  387. - if (send_rfkill_event) {
  388. -+#ifdef CONFIG_RFKILL
  389. - eloop_register_timeout(0, 0, wpa_driver_nl80211_send_rfkill,
  390. - drv, drv->ctx);
  391. -+#endif
  392. - }
  393. -
  394. - return 0;
  395. -@@ -4347,7 +4361,9 @@ static void wpa_driver_nl80211_deinit(st
  396. -
  397. - netlink_send_oper_ifla(drv->global->netlink, drv->ifindex, 0,
  398. - IF_OPER_UP);
  399. -+#ifdef CONFIG_RFKILL
  400. - rfkill_deinit(drv->rfkill);
  401. -+#endif
  402. -
  403. - eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx);
  404. -
  405. ---- a/src/drivers/driver_wext.c
  406. -+++ b/src/drivers/driver_wext.c
  407. -@@ -740,7 +740,7 @@ static void wpa_driver_wext_event_rtm_de
  408. - }
  409. - }
  410. -
  411. --
  412. -+#ifdef CONFIG_RFKILL
  413. - static void wpa_driver_wext_rfkill_blocked(void *ctx)
  414. - {
  415. - wpa_printf(MSG_DEBUG, "WEXT: RFKILL blocked");
  416. -@@ -762,7 +762,7 @@ static void wpa_driver_wext_rfkill_unblo
  417. - }
  418. - /* rtnetlink ifup handler will report interface as enabled */
  419. - }
  420. --
  421. -+#endif /* CONFIG_RFKILL */
  422. -
  423. - static void wext_get_phy_name(struct wpa_driver_wext_data *drv)
  424. - {
  425. -@@ -808,7 +808,9 @@ void * wpa_driver_wext_init(void *ctx, c
  426. - {
  427. - struct wpa_driver_wext_data *drv;
  428. - struct netlink_config *cfg;
  429. -+#ifdef CONFIG_RFKILL
  430. - struct rfkill_config *rcfg;
  431. -+#endif
  432. - char path[128];
  433. - struct stat buf;
  434. -
  435. -@@ -843,6 +845,7 @@ void * wpa_driver_wext_init(void *ctx, c
  436. - goto err2;
  437. - }
  438. -
  439. -+#ifdef CONFIG_RFKILL
  440. - rcfg = os_zalloc(sizeof(*rcfg));
  441. - if (rcfg == NULL)
  442. - goto err3;
  443. -@@ -855,6 +858,7 @@ void * wpa_driver_wext_init(void *ctx, c
  444. - wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available");
  445. - os_free(rcfg);
  446. - }
  447. -+#endif /* CONFIG_RFKILL */
  448. -
  449. - drv->mlme_sock = -1;
  450. -
  451. -@@ -872,7 +876,9 @@ void * wpa_driver_wext_init(void *ctx, c
  452. - return drv;
  453. -
  454. - err3:
  455. -+#ifdef CONFIG_RFKILL
  456. - rfkill_deinit(drv->rfkill);
  457. -+#endif
  458. - netlink_deinit(drv->netlink);
  459. - err2:
  460. - close(drv->ioctl_sock);
  461. -@@ -882,10 +888,12 @@ err1:
  462. - }
  463. -
  464. -
  465. -+#ifdef CONFIG_RFKILL
  466. - static void wpa_driver_wext_send_rfkill(void *eloop_ctx, void *timeout_ctx)
  467. - {
  468. - wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
  469. - }
  470. -+#endif /* CONFIG_RFKILL */
  471. -
  472. -
  473. - static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv)
  474. -@@ -893,13 +901,16 @@ static int wpa_driver_wext_finish_drv_in
  475. - int send_rfkill_event = 0;
  476. -
  477. - if (linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 1) < 0) {
  478. -+#ifdef CONFIG_RFKILL
  479. - if (rfkill_is_blocked(drv->rfkill)) {
  480. - wpa_printf(MSG_DEBUG, "WEXT: Could not yet enable "
  481. - "interface '%s' due to rfkill",
  482. - drv->ifname);
  483. - drv->if_disabled = 1;
  484. - send_rfkill_event = 1;
  485. -- } else {
  486. -+ } else
  487. -+#endif
  488. -+ {
  489. - wpa_printf(MSG_ERROR, "WEXT: Could not set "
  490. - "interface '%s' UP", drv->ifname);
  491. - return -1;
  492. -@@ -947,8 +958,10 @@ static int wpa_driver_wext_finish_drv_in
  493. - 1, IF_OPER_DORMANT);
  494. -
  495. - if (send_rfkill_event) {
  496. -+#ifdef CONFIG_RFKILL
  497. - eloop_register_timeout(0, 0, wpa_driver_wext_send_rfkill,
  498. - drv, drv->ctx);
  499. -+#endif
  500. - }
  501. -
  502. - return 0;
  503. -@@ -978,7 +991,9 @@ void wpa_driver_wext_deinit(void *priv)
  504. -
  505. - netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP);
  506. - netlink_deinit(drv->netlink);
  507. -+#ifdef CONFIG_RFKILL
  508. - rfkill_deinit(drv->rfkill);
  509. -+#endif
  510. -
  511. - if (drv->mlme_sock >= 0)
  512. - eloop_unregister_read_sock(drv->mlme_sock);
  513. --- a/src/drivers/drivers.mak
  514. +++ b/src/drivers/drivers.mak
  515. @@ -25,7 +25,6 @@ NEED_SME=y
  516. @@ -247,15 +32,30 @@
  517. endif
  518. ifdef CONFIG_VLAN_NETLINK
  519. ---- a/src/drivers/driver_wext.h
  520. -+++ b/src/drivers/driver_wext.h
  521. -@@ -22,7 +22,9 @@ struct wpa_driver_wext_data {
  522. - int ifindex2;
  523. - int if_removed;
  524. - int if_disabled;
  525. -+#ifdef CONFIG_RFKILL
  526. - struct rfkill_data *rfkill;
  527. -+#endif
  528. - u8 *assoc_req_ies;
  529. - size_t assoc_req_ies_len;
  530. - u8 *assoc_resp_ies;
  531. +--- a/src/drivers/rfkill.h
  532. ++++ b/src/drivers/rfkill.h
  533. +@@ -18,8 +18,24 @@ struct rfkill_config {
  534. + void (*unblocked_cb)(void *ctx);
  535. + };
  536. +
  537. ++#ifdef CONFIG_RFKILL
  538. + struct rfkill_data * rfkill_init(struct rfkill_config *cfg);
  539. + void rfkill_deinit(struct rfkill_data *rfkill);
  540. + int rfkill_is_blocked(struct rfkill_data *rfkill);
  541. ++#else
  542. ++static inline struct rfkill_data * rfkill_init(struct rfkill_config *cfg)
  543. ++{
  544. ++ return (void *) 1;
  545. ++}
  546. ++
  547. ++static inline void rfkill_deinit(struct rfkill_data *rfkill)
  548. ++{
  549. ++}
  550. ++
  551. ++static inline int rfkill_is_blocked(struct rfkill_data *rfkill)
  552. ++{
  553. ++ return 0;
  554. ++}
  555. ++#endif
  556. +
  557. + #endif /* RFKILL_H */
  558. diff --git a/package/hostapd/patches/330-nl80211_fix_set_freq.patch b/package/hostapd/patches/330-nl80211_fix_set_freq.patch
  559. index a505a60..864ac5e 100644
  560. --- a/package/hostapd/patches/330-nl80211_fix_set_freq.patch
  561. +++ b/package/hostapd/patches/330-nl80211_fix_set_freq.patch
  562. @@ -1,6 +1,6 @@
  563. --- a/src/drivers/driver_nl80211.c
  564. +++ b/src/drivers/driver_nl80211.c
  565. -@@ -6860,7 +6860,7 @@ static int wpa_driver_nl80211_set_freq(s
  566. +@@ -7380,7 +7380,7 @@ static int wpa_driver_nl80211_set_freq(s
  567. nl80211_cmd(drv, msg, 0, NL80211_CMD_SET_WIPHY);
  568. @@ -9,7 +9,7 @@
  569. if (nl80211_put_freq_params(msg, freq) < 0)
  570. goto nla_put_failure;
  571. -@@ -11322,7 +11322,7 @@ static int nl80211_switch_channel(void *
  572. +@@ -11905,7 +11905,7 @@ static int nl80211_switch_channel(void *
  573. return -ENOMEM;
  574. nl80211_cmd(drv, msg, 0, NL80211_CMD_CHANNEL_SWITCH);
  575. diff --git a/package/hostapd/patches/340-reload_freq_change.patch b/package/hostapd/patches/340-reload_freq_change.patch
  576. index 9316794..d76f9de 100644
  577. --- a/package/hostapd/patches/340-reload_freq_change.patch
  578. +++ b/package/hostapd/patches/340-reload_freq_change.patch
  579. @@ -1,6 +1,6 @@
  580. --- a/src/ap/hostapd.c
  581. +++ b/src/ap/hostapd.c
  582. -@@ -72,6 +72,16 @@ static void hostapd_reload_bss(struct ho
  583. +@@ -68,6 +68,16 @@ static void hostapd_reload_bss(struct ho
  584. #endif /* CONFIG_NO_RADIUS */
  585. ssid = &hapd->conf->ssid;
  586. @@ -17,7 +17,7 @@
  587. if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next &&
  588. ssid->wpa_passphrase_set && ssid->wpa_passphrase) {
  589. /*
  590. -@@ -172,6 +182,9 @@ int hostapd_reload_config(struct hostapd
  591. +@@ -168,20 +178,12 @@ int hostapd_reload_config(struct hostapd
  592. oldconf = hapd->iconf;
  593. iface->conf = newconf;
  594. @@ -27,3 +27,17 @@
  595. for (j = 0; j < iface->num_bss; j++) {
  596. hapd = iface->bss[j];
  597. hapd->iconf = newconf;
  598. +- hapd->iconf->channel = oldconf->channel;
  599. +- hapd->iconf->secondary_channel = oldconf->secondary_channel;
  600. +- hapd->iconf->ieee80211n = oldconf->ieee80211n;
  601. +- hapd->iconf->ieee80211ac = oldconf->ieee80211ac;
  602. +- hapd->iconf->ht_capab = oldconf->ht_capab;
  603. +- hapd->iconf->vht_capab = oldconf->vht_capab;
  604. +- hapd->iconf->vht_oper_chwidth = oldconf->vht_oper_chwidth;
  605. +- hapd->iconf->vht_oper_centr_freq_seg0_idx =
  606. +- oldconf->vht_oper_centr_freq_seg0_idx;
  607. +- hapd->iconf->vht_oper_centr_freq_seg1_idx =
  608. +- oldconf->vht_oper_centr_freq_seg1_idx;
  609. + hapd->conf = newconf->bss[j];
  610. + hostapd_reload_bss(hapd);
  611. + }
  612. diff --git a/package/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/hostapd/patches/350-nl80211_del_beacon_bss.patch
  613. index 885922c..8da6372 100644
  614. --- a/package/hostapd/patches/350-nl80211_del_beacon_bss.patch
  615. +++ b/package/hostapd/patches/350-nl80211_del_beacon_bss.patch
  616. @@ -1,6 +1,6 @@
  617. --- a/src/drivers/driver_nl80211.c
  618. +++ b/src/drivers/driver_nl80211.c
  619. -@@ -4290,18 +4290,20 @@ wpa_driver_nl80211_finish_drv_init(struc
  620. +@@ -4748,18 +4748,20 @@ wpa_driver_nl80211_finish_drv_init(struc
  621. }
  622. @@ -24,7 +24,7 @@
  623. return send_and_recv_msgs(drv, msg, NULL, NULL);
  624. nla_put_failure:
  625. -@@ -4309,6 +4311,15 @@ static int wpa_driver_nl80211_del_beacon
  626. +@@ -4767,6 +4769,15 @@ static int wpa_driver_nl80211_del_beacon
  627. return -ENOBUFS;
  628. }
  629. @@ -40,7 +40,7 @@
  630. /**
  631. * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface
  632. -@@ -9911,7 +9922,6 @@ static int wpa_driver_nl80211_stop_ap(vo
  633. +@@ -10475,7 +10486,6 @@ static int wpa_driver_nl80211_stop_ap(vo
  634. if (!is_ap_interface(drv->nlmode))
  635. return -1;
  636. wpa_driver_nl80211_del_beacon(drv);
  637. diff --git a/package/hostapd/patches/360-ctrl_iface_reload.patch b/package/hostapd/patches/360-ctrl_iface_reload.patch
  638. index 170d4f2..e69c3d3 100644
  639. --- a/package/hostapd/patches/360-ctrl_iface_reload.patch
  640. +++ b/package/hostapd/patches/360-ctrl_iface_reload.patch
  641. @@ -1,6 +1,6 @@
  642. --- a/hostapd/ctrl_iface.c
  643. +++ b/hostapd/ctrl_iface.c
  644. -@@ -34,6 +34,7 @@
  645. +@@ -37,6 +37,7 @@
  646. #include "wps/wps.h"
  647. #include "config_file.h"
  648. #include "ctrl_iface.h"
  649. @@ -8,7 +8,7 @@
  650. struct wpa_ctrl_dst {
  651. -@@ -44,6 +45,7 @@ struct wpa_ctrl_dst {
  652. +@@ -47,6 +48,7 @@ struct wpa_ctrl_dst {
  653. int errors;
  654. };
  655. @@ -16,7 +16,7 @@
  656. static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level,
  657. const char *buf, size_t len);
  658. -@@ -153,6 +155,68 @@ static int hostapd_ctrl_iface_new_sta(st
  659. +@@ -156,6 +158,68 @@ static int hostapd_ctrl_iface_new_sta(st
  660. return 0;
  661. }
  662. @@ -85,14 +85,14 @@
  663. #ifdef CONFIG_IEEE80211W
  664. #ifdef NEED_AP_MLME
  665. -@@ -1199,6 +1263,10 @@ static void hostapd_ctrl_iface_receive(i
  666. - reply_len += res;
  667. - }
  668. - #endif /* CONFIG_NO_RADIUS */
  669. +@@ -1546,6 +1610,10 @@ static void hostapd_ctrl_iface_receive(i
  670. + } else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
  671. + reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
  672. + reply_size);
  673. + } else if (os_strcmp(buf, "DOWN") == 0) {
  674. + hostapd_ctrl_iface_set_down(hapd);
  675. + } else if (os_strncmp(buf, "UPDATE ", 7) == 0) {
  676. + hostapd_ctrl_iface_update(hapd, buf + 7);
  677. - } else if (os_strcmp(buf, "STA-FIRST") == 0) {
  678. - reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
  679. - reply_size);
  680. +
  681. + } else {
  682. + os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
  683. diff --git a/package/hostapd/patches/370-ap_sta_support.patch b/package/hostapd/patches/370-ap_sta_support.patch
  684. index a3d0572..5e82252 100644
  685. --- a/package/hostapd/patches/370-ap_sta_support.patch
  686. +++ b/package/hostapd/patches/370-ap_sta_support.patch
  687. @@ -1,6 +1,6 @@
  688. --- a/wpa_supplicant/wpa_supplicant_i.h
  689. +++ b/wpa_supplicant/wpa_supplicant_i.h
  690. -@@ -96,6 +96,11 @@ struct wpa_interface {
  691. +@@ -108,6 +108,11 @@ struct wpa_interface {
  692. const char *ifname;
  693. /**
  694. @@ -12,7 +12,7 @@
  695. * bridge_ifname - Optional bridge interface name
  696. *
  697. * If the driver interface (ifname) is included in a Linux bridge
  698. -@@ -325,6 +330,8 @@ struct wpa_supplicant {
  699. +@@ -395,6 +400,8 @@ struct wpa_supplicant {
  700. #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
  701. char bridge_ifname[16];
  702. @@ -20,12 +20,12 @@
  703. +
  704. char *confname;
  705. char *confanother;
  706. - struct wpa_config *conf;
  707. +
  708. --- a/wpa_supplicant/Makefile
  709. +++ b/wpa_supplicant/Makefile
  710. @@ -13,6 +13,10 @@ PKG_CONFIG ?= pkg-config
  711. - CFLAGS += -I../src
  712. - CFLAGS += -I../src/utils
  713. + CFLAGS += -I$(abspath ../src)
  714. + CFLAGS += -I$(abspath ../src/utils)
  715. +ifdef MULTICALL
  716. +CFLAGS += -DMULTICALL
  717. @@ -34,7 +34,7 @@
  718. -include .config
  719. -include $(if $(MULTICALL),../hostapd/.config)
  720. -@@ -76,6 +80,8 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr
  721. +@@ -82,6 +86,8 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr
  722. OBJS_c += ../src/utils/wpa_debug.o
  723. OBJS_c += ../src/utils/common.o
  724. @@ -45,9 +45,9 @@
  725. CONFIG_OS=win32
  726. --- a/wpa_supplicant/wpa_supplicant.c
  727. +++ b/wpa_supplicant/wpa_supplicant.c
  728. -@@ -109,6 +109,46 @@ extern int wpa_debug_show_keys;
  729. - extern int wpa_debug_timestamp;
  730. - extern struct wpa_driver_ops *wpa_drivers[];
  731. +@@ -104,6 +104,46 @@ const char *wpa_supplicant_full_license5
  732. + "\n";
  733. + #endif /* CONFIG_NO_STDOUT_DEBUG */
  734. +static int hostapd_stop(struct wpa_supplicant *wpa_s)
  735. +{
  736. @@ -92,7 +92,7 @@
  737. /* Configure default/group WEP keys for static WEP */
  738. int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
  739. {
  740. -@@ -685,8 +725,12 @@ void wpa_supplicant_set_state(struct wpa
  741. +@@ -705,8 +745,12 @@ void wpa_supplicant_set_state(struct wpa
  742. #endif /* CONFIG_P2P */
  743. sme_sched_obss_scan(wpa_s, 1);
  744. @@ -105,7 +105,7 @@
  745. wpa_s->new_connection = 1;
  746. wpa_drv_set_operstate(wpa_s, 0);
  747. #ifndef IEEE8021X_EAPOL
  748. -@@ -2906,6 +2950,20 @@ static int wpa_supplicant_init_iface(str
  749. +@@ -3516,6 +3560,20 @@ static int wpa_supplicant_init_iface(str
  750. sizeof(wpa_s->bridge_ifname));
  751. }
  752. @@ -126,7 +126,7 @@
  753. /* RSNA Supplicant Key Management - INITIALIZE */
  754. eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
  755. eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
  756. -@@ -3125,6 +3183,11 @@ static void wpa_supplicant_deinit_iface(
  757. +@@ -3711,6 +3769,11 @@ static void wpa_supplicant_deinit_iface(
  758. if (terminate)
  759. wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
  760. @@ -148,9 +148,9 @@
  761. #include "drivers/driver.h"
  762. #include "wpa_supplicant_i.h"
  763. #include "config.h"
  764. -@@ -245,6 +246,9 @@ static void calculate_update_time(const
  765. +@@ -247,6 +248,9 @@ static void calculate_update_time(const
  766. static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
  767. - struct os_time *fetch_time)
  768. + struct os_reltime *fetch_time)
  769. {
  770. + struct ieee80211_ht_capabilities *capab;
  771. + struct ieee802_11_elems elems;
  772. @@ -158,7 +158,7 @@
  773. dst->flags = src->flags;
  774. os_memcpy(dst->bssid, src->bssid, ETH_ALEN);
  775. dst->freq = src->freq;
  776. -@@ -255,6 +259,12 @@ static void wpa_bss_copy_res(struct wpa_
  777. +@@ -257,6 +261,12 @@ static void wpa_bss_copy_res(struct wpa_
  778. dst->level = src->level;
  779. dst->tsf = src->tsf;
  780. @@ -173,16 +173,16 @@
  781. --- a/wpa_supplicant/main.c
  782. +++ b/wpa_supplicant/main.c
  783. -@@ -27,7 +27,7 @@ static void usage(void)
  784. - " wpa_supplicant [-BddhKLqqstuvW] [-P<pid file>] "
  785. +@@ -33,7 +33,7 @@ static void usage(void)
  786. + "vW] [-P<pid file>] "
  787. "[-g<global ctrl>] \\\n"
  788. " [-G<group>] \\\n"
  789. - " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] "
  790. + " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-H<hostapd path>] "
  791. "[-p<driver_param>] \\\n"
  792. - " [-b<br_ifname>] [-f<debug file>] [-e<entropy file>] "
  793. - "\\\n"
  794. -@@ -72,6 +72,7 @@ static void usage(void)
  795. + " [-b<br_ifname>] [-e<entropy file>]"
  796. + #ifdef CONFIG_DEBUG_FILE
  797. +@@ -84,6 +84,7 @@ static void usage(void)
  798. #endif /* CONFIG_DEBUG_LINUX_TRACING */
  799. printf(" -t = include timestamp in debug messages\n"
  800. " -h = show this help text\n"
  801. @@ -190,16 +190,16 @@
  802. " -L = show license (BSD)\n"
  803. " -o = override driver parameter for new interfaces\n"
  804. " -O = override ctrl_interface parameter for new interfaces\n"
  805. -@@ -160,7 +161,7 @@ int main(int argc, char *argv[])
  806. +@@ -175,7 +176,7 @@ int main(int argc, char *argv[])
  807. for (;;) {
  808. c = getopt(argc, argv,
  809. -- "b:Bc:C:D:de:f:g:G:hi:I:KLNo:O:p:P:qsTtuvW");
  810. -+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuvW");
  811. +- "b:Bc:C:D:de:f:g:G:hi:I:KLm:No:O:p:P:qsTtuvW");
  812. ++ "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuvW");
  813. if (c < 0)
  814. break;
  815. switch (c) {
  816. -@@ -207,6 +208,9 @@ int main(int argc, char *argv[])
  817. +@@ -222,6 +223,9 @@ int main(int argc, char *argv[])
  818. usage();
  819. exitcode = 0;
  820. goto out;
  821. @@ -211,7 +211,7 @@
  822. break;
  823. --- a/wpa_supplicant/bss.h
  824. +++ b/wpa_supplicant/bss.h
  825. -@@ -69,6 +69,8 @@ struct wpa_bss {
  826. +@@ -70,6 +70,8 @@ struct wpa_bss {
  827. u8 ssid[32];
  828. /** Length of SSID */
  829. size_t ssid_len;
  830. diff --git a/package/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/hostapd/patches/380-disable_ctrl_iface_mib.patch
  831. index 27f21bd..d39ba2e 100644
  832. --- a/package/hostapd/patches/380-disable_ctrl_iface_mib.patch
  833. +++ b/package/hostapd/patches/380-disable_ctrl_iface_mib.patch
  834. @@ -1,6 +1,6 @@
  835. --- a/hostapd/Makefile
  836. +++ b/hostapd/Makefile
  837. -@@ -144,6 +144,9 @@ endif
  838. +@@ -163,6 +163,9 @@ endif
  839. ifdef CONFIG_NO_CTRL_IFACE
  840. CFLAGS += -DCONFIG_NO_CTRL_IFACE
  841. else
  842. @@ -12,28 +12,15 @@
  843. endif
  844. --- a/hostapd/ctrl_iface.c
  845. +++ b/hostapd/ctrl_iface.c
  846. -@@ -1234,6 +1234,7 @@ static void hostapd_ctrl_iface_receive(i
  847. - } else if (os_strcmp(buf, "STATUS") == 0) {
  848. - reply_len = hostapd_ctrl_iface_status(hapd, reply,
  849. +@@ -1447,6 +1447,7 @@ static void hostapd_ctrl_iface_receive(i
  850. reply_size);
  851. + } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
  852. + reply_len = hostapd_drv_status(hapd, reply, reply_size);
  853. +#ifdef CONFIG_CTRL_IFACE_MIB
  854. } else if (os_strcmp(buf, "MIB") == 0) {
  855. reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
  856. if (reply_len >= 0) {
  857. -@@ -1263,10 +1264,12 @@ static void hostapd_ctrl_iface_receive(i
  858. - reply_len += res;
  859. - }
  860. - #endif /* CONFIG_NO_RADIUS */
  861. -+#endif
  862. - } else if (os_strcmp(buf, "DOWN") == 0) {
  863. - hostapd_ctrl_iface_set_down(hapd);
  864. - } else if (os_strncmp(buf, "UPDATE ", 7) == 0) {
  865. - hostapd_ctrl_iface_update(hapd, buf + 7);
  866. -+#ifdef CONFIG_CTRL_IFACE_MIB
  867. - } else if (os_strcmp(buf, "STA-FIRST") == 0) {
  868. - reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
  869. - reply_size);
  870. -@@ -1276,6 +1279,7 @@ static void hostapd_ctrl_iface_receive(i
  871. +@@ -1488,6 +1489,7 @@ static void hostapd_ctrl_iface_receive(i
  872. } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
  873. reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
  874. reply_size);
  875. @@ -43,7 +30,7 @@
  876. reply_len = -1;
  877. --- a/wpa_supplicant/Makefile
  878. +++ b/wpa_supplicant/Makefile
  879. -@@ -778,6 +778,9 @@ ifdef CONFIG_WNM
  880. +@@ -797,6 +797,9 @@ ifdef CONFIG_WNM
  881. OBJS += ../src/ap/wnm_ap.o
  882. endif
  883. ifdef CONFIG_CTRL_IFACE
  884. @@ -55,7 +42,7 @@
  885. --- a/wpa_supplicant/ctrl_iface.c
  886. +++ b/wpa_supplicant/ctrl_iface.c
  887. -@@ -5262,6 +5262,7 @@ char * wpa_supplicant_ctrl_iface_process
  888. +@@ -6075,6 +6075,7 @@ char * wpa_supplicant_ctrl_iface_process
  889. reply_len = -1;
  890. } else if (os_strncmp(buf, "NOTE ", 5) == 0) {
  891. wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
  892. @@ -63,7 +50,7 @@
  893. } else if (os_strcmp(buf, "MIB") == 0) {
  894. reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
  895. if (reply_len >= 0) {
  896. -@@ -5273,6 +5274,7 @@ char * wpa_supplicant_ctrl_iface_process
  897. +@@ -6086,6 +6087,7 @@ char * wpa_supplicant_ctrl_iface_process
  898. else
  899. reply_len += res;
  900. }
  901. @@ -71,7 +58,7 @@
  902. } else if (os_strncmp(buf, "STATUS", 6) == 0) {
  903. reply_len = wpa_supplicant_ctrl_iface_status(
  904. wpa_s, buf + 6, reply, reply_size);
  905. -@@ -5687,6 +5689,7 @@ char * wpa_supplicant_ctrl_iface_process
  906. +@@ -6490,6 +6492,7 @@ char * wpa_supplicant_ctrl_iface_process
  907. reply_len = wpa_supplicant_ctrl_iface_bss(
  908. wpa_s, buf + 4, reply, reply_size);
  909. #ifdef CONFIG_AP
  910. @@ -79,7 +66,7 @@
  911. } else if (os_strcmp(buf, "STA-FIRST") == 0) {
  912. reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
  913. } else if (os_strncmp(buf, "STA ", 4) == 0) {
  914. -@@ -5695,6 +5698,7 @@ char * wpa_supplicant_ctrl_iface_process
  915. +@@ -6498,6 +6501,7 @@ char * wpa_supplicant_ctrl_iface_process
  916. } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
  917. reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
  918. reply_size);
  919. @@ -89,15 +76,15 @@
  920. reply_len = -1;
  921. --- a/src/ap/ctrl_iface_ap.c
  922. +++ b/src/ap/ctrl_iface_ap.c
  923. -@@ -20,6 +20,7 @@
  924. +@@ -21,6 +21,7 @@
  925. #include "ctrl_iface_ap.h"
  926. #include "ap_drv_ops.h"
  927. +#ifdef CONFIG_CTRL_IFACE_MIB
  928. - static int hostapd_get_sta_conn_time(struct sta_info *sta,
  929. - char *buf, size_t buflen)
  930. -@@ -129,6 +130,7 @@ int hostapd_ctrl_iface_sta_next(struct h
  931. + static int hostapd_get_sta_tx_rx(struct hostapd_data *hapd,
  932. + struct sta_info *sta,
  933. +@@ -214,6 +215,7 @@ int hostapd_ctrl_iface_sta_next(struct h
  934. return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
  935. }
  936. @@ -105,14 +92,14 @@
  937. #ifdef CONFIG_P2P_MANAGER
  938. static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
  939. -@@ -423,3 +425,4 @@ int hostapd_parse_csa_settings(const cha
  940. +@@ -524,3 +526,4 @@ int hostapd_parse_csa_settings(const cha
  941. return 0;
  942. }
  943. +
  944. --- a/src/ap/ieee802_1x.c
  945. +++ b/src/ap/ieee802_1x.c
  946. -@@ -1938,6 +1938,7 @@ static const char * bool_txt(Boolean boo
  947. +@@ -2124,6 +2124,7 @@ static const char * bool_txt(Boolean boo
  948. return bool_val ? "TRUE" : "FALSE";
  949. }
  950. @@ -120,17 +107,17 @@
  951. int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
  952. {
  953. -@@ -2090,6 +2091,7 @@ int ieee802_1x_get_mib_sta(struct hostap
  954. +@@ -2291,6 +2292,7 @@ int ieee802_1x_get_mib_sta(struct hostap
  955. return len;
  956. }
  957. +#endif
  958. static void ieee802_1x_finished(struct hostapd_data *hapd,
  959. - struct sta_info *sta, int success)
  960. + struct sta_info *sta, int success,
  961. --- a/src/ap/wpa_auth.c
  962. +++ b/src/ap/wpa_auth.c
  963. -@@ -2708,6 +2708,7 @@ static const char * wpa_bool_txt(int boo
  964. +@@ -2830,6 +2830,7 @@ static const char * wpa_bool_txt(int boo
  965. return bool ? "TRUE" : "FALSE";
  966. }
  967. @@ -138,7 +125,7 @@
  968. #define RSN_SUITE "%02x-%02x-%02x-%d"
  969. #define RSN_SUITE_ARG(s) \
  970. -@@ -2852,7 +2853,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
  971. +@@ -2974,7 +2975,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
  972. return len;
  973. }
  974. @@ -149,7 +136,7 @@
  975. {
  976. --- a/src/rsn_supp/wpa.c
  977. +++ b/src/rsn_supp/wpa.c
  978. -@@ -1844,6 +1844,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
  979. +@@ -1912,6 +1912,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
  980. }
  981. @@ -158,7 +145,7 @@
  982. #define RSN_SUITE "%02x-%02x-%02x-%d"
  983. #define RSN_SUITE_ARG(s) \
  984. ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
  985. -@@ -1927,6 +1929,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
  986. +@@ -1995,6 +1997,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
  987. return (int) len;
  988. }
  989. diff --git a/package/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/hostapd/patches/390-wpa_ie_cap_workaround.patch
  990. index 00a3222..40148fc 100644
  991. --- a/package/hostapd/patches/390-wpa_ie_cap_workaround.patch
  992. +++ b/package/hostapd/patches/390-wpa_ie_cap_workaround.patch
  993. @@ -1,6 +1,6 @@
  994. --- a/src/common/wpa_common.c
  995. +++ b/src/common/wpa_common.c
  996. -@@ -959,6 +959,31 @@ const char * wpa_key_mgmt_txt(int key_mg
  997. +@@ -1002,6 +1002,31 @@ const char * wpa_key_mgmt_txt(int key_mg
  998. }
  999. @@ -32,7 +32,7 @@
  1000. int wpa_compare_rsn_ie(int ft_initial_assoc,
  1001. const u8 *ie1, size_t ie1len,
  1002. const u8 *ie2, size_t ie2len)
  1003. -@@ -966,8 +991,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
  1004. +@@ -1009,8 +1034,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
  1005. if (ie1 == NULL || ie2 == NULL)
  1006. return -1;
  1007. diff --git a/package/hostapd/patches/400-terminate_on_setup_failure.patch b/package/hostapd/patches/400-terminate_on_setup_failure.patch
  1008. deleted file mode 100644
  1009. index 0d9065a..0000000
  1010. --- a/package/hostapd/patches/400-terminate_on_setup_failure.patch
  1011. +++ /dev/null
  1012. @@ -1,85 +0,0 @@
  1013. ---- a/src/ap/hostapd.c
  1014. -+++ b/src/ap/hostapd.c
  1015. -@@ -1103,13 +1103,8 @@ int hostapd_setup_interface_complete(str
  1016. - size_t j;
  1017. - u8 *prev_addr;
  1018. -
  1019. -- if (err) {
  1020. -- wpa_printf(MSG_ERROR, "Interface initialization failed");
  1021. -- hostapd_set_state(iface, HAPD_IFACE_DISABLED);
  1022. -- if (iface->interfaces && iface->interfaces->terminate_on_error)
  1023. -- eloop_terminate();
  1024. -- return -1;
  1025. -- }
  1026. -+ if (err)
  1027. -+ goto error;
  1028. -
  1029. - wpa_printf(MSG_DEBUG, "Completing interface initialization");
  1030. - if (iface->conf->channel) {
  1031. -@@ -1140,7 +1135,7 @@ int hostapd_setup_interface_complete(str
  1032. - hapd->iconf->vht_oper_centr_freq_seg1_idx)) {
  1033. - wpa_printf(MSG_ERROR, "Could not set channel for "
  1034. - "kernel driver");
  1035. -- return -1;
  1036. -+ goto error;
  1037. - }
  1038. - }
  1039. -
  1040. -@@ -1151,7 +1146,7 @@ int hostapd_setup_interface_complete(str
  1041. - hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
  1042. - HOSTAPD_LEVEL_WARNING,
  1043. - "Failed to prepare rates table.");
  1044. -- return -1;
  1045. -+ goto error;
  1046. - }
  1047. - }
  1048. -
  1049. -@@ -1159,14 +1154,14 @@ int hostapd_setup_interface_complete(str
  1050. - hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) {
  1051. - wpa_printf(MSG_ERROR, "Could not set RTS threshold for "
  1052. - "kernel driver");
  1053. -- return -1;
  1054. -+ goto error;
  1055. - }
  1056. -
  1057. - if (hapd->iconf->fragm_threshold > -1 &&
  1058. - hostapd_set_frag(hapd, hapd->iconf->fragm_threshold)) {
  1059. - wpa_printf(MSG_ERROR, "Could not set fragmentation threshold "
  1060. - "for kernel driver");
  1061. -- return -1;
  1062. -+ goto error;
  1063. - }
  1064. -
  1065. - prev_addr = hapd->own_addr;
  1066. -@@ -1176,7 +1171,7 @@ int hostapd_setup_interface_complete(str
  1067. - if (j)
  1068. - os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN);
  1069. - if (hostapd_setup_bss(hapd, j == 0))
  1070. -- return -1;
  1071. -+ goto error;
  1072. - if (hostapd_mac_comp_empty(hapd->conf->bssid) == 0)
  1073. - prev_addr = hapd->own_addr;
  1074. - }
  1075. -@@ -1191,7 +1186,7 @@ int hostapd_setup_interface_complete(str
  1076. - if (hostapd_driver_commit(hapd) < 0) {
  1077. - wpa_printf(MSG_ERROR, "%s: Failed to commit driver "
  1078. - "configuration", __func__);
  1079. -- return -1;
  1080. -+ goto error;
  1081. - }
  1082. -
  1083. - /*
  1084. -@@ -1216,6 +1211,13 @@ int hostapd_setup_interface_complete(str
  1085. - iface->interfaces->terminate_on_error--;
  1086. -
  1087. - return 0;
  1088. -+
  1089. -+error:
  1090. -+ wpa_printf(MSG_ERROR, "Interface initialization failed");
  1091. -+ hostapd_set_state(iface, HAPD_IFACE_DISABLED);
  1092. -+ if (iface->interfaces && iface->interfaces->terminate_on_error)
  1093. -+ eloop_terminate();
  1094. -+ return -1;
  1095. - }
  1096. -
  1097. -
  1098. diff --git a/package/hostapd/patches/410-bring_down_interface.patch b/package/hostapd/patches/410-bring_down_interface.patch
  1099. index 31033a0..5a57249 100644
  1100. --- a/package/hostapd/patches/410-bring_down_interface.patch
  1101. +++ b/package/hostapd/patches/410-bring_down_interface.patch
  1102. @@ -1,6 +1,6 @@
  1103. --- a/src/drivers/driver_nl80211.c
  1104. +++ b/src/drivers/driver_nl80211.c
  1105. -@@ -8480,12 +8480,7 @@ static int wpa_driver_nl80211_set_mode(s
  1106. +@@ -8936,12 +8936,7 @@ static int wpa_driver_nl80211_set_mode(s
  1107. /* Try to set the mode again while the interface is
  1108. * down */
  1109. ret = nl80211_set_mode(drv, drv->ifindex, nlmode);
  1110. @@ -14,7 +14,7 @@
  1111. break;
  1112. } else
  1113. wpa_printf(MSG_DEBUG, "nl80211: Failed to set "
  1114. -@@ -8498,6 +8493,8 @@ static int wpa_driver_nl80211_set_mode(s
  1115. +@@ -8954,6 +8949,8 @@ static int wpa_driver_nl80211_set_mode(s
  1116. "interface is down");
  1117. drv->nlmode = nlmode;
  1118. drv->ignore_if_down_event = 1;
  1119. diff --git a/package/hostapd/patches/420-fix_wps_pin_crash.patch b/package/hostapd/patches/420-fix_wps_pin_crash.patch
  1120. index 130bd53..31995c4 100644
  1121. --- a/package/hostapd/patches/420-fix_wps_pin_crash.patch
  1122. +++ b/package/hostapd/patches/420-fix_wps_pin_crash.patch
  1123. @@ -1,6 +1,6 @@
  1124. --- a/hostapd/ctrl_iface.c
  1125. +++ b/hostapd/ctrl_iface.c
  1126. -@@ -480,6 +480,9 @@ static int hostapd_ctrl_iface_wps_ap_pin
  1127. +@@ -540,6 +540,9 @@ static int hostapd_ctrl_iface_wps_ap_pin
  1128. char *pos;
  1129. const char *pin_txt;
  1130. diff --git a/package/hostapd/patches/430-wps_single_auth_enc_type.patch b/package/hostapd/patches/430-wps_single_auth_enc_type.patch
  1131. index 6e86658..8dae52b 100644
  1132. --- a/package/hostapd/patches/430-wps_single_auth_enc_type.patch
  1133. +++ b/package/hostapd/patches/430-wps_single_auth_enc_type.patch
  1134. @@ -1,6 +1,6 @@
  1135. --- a/src/ap/wps_hostapd.c
  1136. +++ b/src/ap/wps_hostapd.c
  1137. -@@ -1069,11 +1069,9 @@ int hostapd_init_wps(struct hostapd_data
  1138. +@@ -1051,11 +1051,9 @@ int hostapd_init_wps(struct hostapd_data
  1139. if (conf->rsn_pairwise & WPA_CIPHER_CCMP)
  1140. wps->encr_types |= WPS_ENCR_AES;
  1141. @@ -14,7 +14,7 @@
  1142. if (conf->wpa_key_mgmt & WPA_KEY_MGMT_PSK)
  1143. wps->auth_types |= WPS_AUTH_WPAPSK;
  1144. if (conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X)
  1145. -@@ -1081,7 +1079,7 @@ int hostapd_init_wps(struct hostapd_data
  1146. +@@ -1063,7 +1061,7 @@ int hostapd_init_wps(struct hostapd_data
  1147. if (conf->wpa_pairwise & WPA_CIPHER_CCMP)
  1148. wps->encr_types |= WPS_ENCR_AES;
  1149. diff --git a/package/hostapd/patches/440-dynamic_20_40_mhz.patch b/package/hostapd/patches/440-dynamic_20_40_mhz.patch
  1150. index 905ec2c..af2fb26 100644
  1151. --- a/package/hostapd/patches/440-dynamic_20_40_mhz.patch
  1152. +++ b/package/hostapd/patches/440-dynamic_20_40_mhz.patch
  1153. @@ -1,19 +1,19 @@
  1154. --- a/hostapd/config_file.c
  1155. +++ b/hostapd/config_file.c
  1156. -@@ -2422,6 +2422,10 @@ static int hostapd_config_fill(struct ho
  1157. - "ht_capab", line);
  1158. - errors++;
  1159. - }
  1160. -+ } else if (os_strcmp(buf, "dynamic_ht40") == 0) {
  1161. -+ conf->dynamic_ht40 = atoi(pos);
  1162. -+ if (conf->dynamic_ht40 == 1)
  1163. -+ conf->dynamic_ht40 = 1500;
  1164. - } else if (os_strcmp(buf, "require_ht") == 0) {
  1165. - conf->require_ht = atoi(pos);
  1166. - } else if (os_strcmp(buf, "obss_interval") == 0) {
  1167. +@@ -2648,6 +2648,10 @@ static int hostapd_config_fill(struct ho
  1168. + line);
  1169. + return 1;
  1170. + }
  1171. ++ } else if (os_strcmp(buf, "dynamic_ht40") == 0) {
  1172. ++ conf->dynamic_ht40 = atoi(pos);
  1173. ++ if (conf->dynamic_ht40 == 1)
  1174. ++ conf->dynamic_ht40 = 1500;
  1175. + } else if (os_strcmp(buf, "require_ht") == 0) {
  1176. + conf->require_ht = atoi(pos);
  1177. + } else if (os_strcmp(buf, "obss_interval") == 0) {
  1178. --- a/src/ap/ap_config.h
  1179. +++ b/src/ap/ap_config.h
  1180. -@@ -531,6 +531,7 @@ struct hostapd_config {
  1181. +@@ -580,6 +580,7 @@ struct hostapd_config {
  1182. int ieee80211n;
  1183. int secondary_channel;
  1184. int require_ht;
  1185. @@ -23,7 +23,7 @@
  1186. int ieee80211ac;
  1187. --- a/src/ap/hostapd.c
  1188. +++ b/src/ap/hostapd.c
  1189. -@@ -23,6 +23,7 @@
  1190. +@@ -22,6 +22,7 @@
  1191. #include "beacon.h"
  1192. #include "iapp.h"
  1193. #include "ieee802_1x.h"
  1194. @@ -31,7 +31,7 @@
  1195. #include "ieee802_11_auth.h"
  1196. #include "vlan_init.h"
  1197. #include "wpa_auth.h"
  1198. -@@ -332,6 +333,7 @@ static void hostapd_cleanup(struct hosta
  1199. +@@ -328,6 +329,7 @@ static void hostapd_cleanup(struct hosta
  1200. static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface)
  1201. {
  1202. wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface);
  1203. @@ -41,7 +41,7 @@
  1204. os_free(iface->current_rates);
  1205. --- a/src/ap/hostapd.h
  1206. +++ b/src/ap/hostapd.h
  1207. -@@ -326,6 +326,9 @@ struct hostapd_iface {
  1208. +@@ -330,6 +330,9 @@ struct hostapd_iface {
  1209. /* Overlapping BSS information */
  1210. int olbc_ht;
  1211. @@ -53,7 +53,7 @@
  1212. /* surveying helpers */
  1213. --- a/src/ap/ieee802_11.c
  1214. +++ b/src/ap/ieee802_11.c
  1215. -@@ -1538,6 +1538,9 @@ static void handle_beacon(struct hostapd
  1216. +@@ -1556,6 +1556,9 @@ static void handle_beacon(struct hostapd
  1217. sizeof(mgmt->u.beacon)), &elems,
  1218. 0);
  1219. @@ -65,7 +65,7 @@
  1220. --- a/src/ap/ieee802_11.h
  1221. +++ b/src/ap/ieee802_11.h
  1222. -@@ -82,4 +82,17 @@ int hostapd_update_time_adv(struct hosta
  1223. +@@ -83,4 +83,17 @@ int hostapd_update_time_adv(struct hosta
  1224. void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr);
  1225. u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid);
  1226. @@ -85,8 +85,8 @@
  1227. #endif /* IEEE802_11_H */
  1228. --- a/src/ap/ieee802_11_ht.c
  1229. +++ b/src/ap/ieee802_11_ht.c
  1230. -@@ -20,9 +20,11 @@
  1231. - #include "drivers/driver.h"
  1232. +@@ -13,9 +13,11 @@
  1233. + #include "common/ieee802_11_defs.h"
  1234. #include "hostapd.h"
  1235. #include "ap_config.h"
  1236. +#include "ap_drv_ops.h"
  1237. @@ -97,29 +97,25 @@
  1238. u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
  1239. -@@ -86,12 +88,15 @@ u8 * hostapd_eid_ht_operation(struct hos
  1240. +@@ -92,6 +94,9 @@ u8 * hostapd_eid_ht_operation(struct hos
  1241. - oper->control_chan = hapd->iconf->channel;
  1242. + oper->primary_chan = hapd->iconf->channel;
  1243. oper->operation_mode = host_to_le16(hapd->iface->ht_op_mode);
  1244. -- if (hapd->iconf->secondary_channel == 1)
  1245. -- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
  1246. -- HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
  1247. -- if (hapd->iconf->secondary_channel == -1)
  1248. -- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
  1249. -- HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
  1250. -+
  1251. -+ if (!hapd->iface->force_20mhz) {
  1252. -+ if (hapd->iconf->secondary_channel == 1)
  1253. -+ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
  1254. -+ HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
  1255. -+ if (hapd->iconf->secondary_channel == -1)
  1256. -+ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
  1257. -+ HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
  1258. -+ }
  1259. ++ if (hapd->iface->force_20mhz)
  1260. ++ goto skip;
  1261. ++
  1262. + if (hapd->iconf->secondary_channel == 1)
  1263. + oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
  1264. + HT_INFO_HT_PARAM_STA_CHNL_WIDTH;
  1265. +@@ -99,6 +104,7 @@ u8 * hostapd_eid_ht_operation(struct hos
  1266. + oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
  1267. + HT_INFO_HT_PARAM_STA_CHNL_WIDTH;
  1268. ++skip:
  1269. pos += sizeof(*oper);
  1270. -@@ -286,3 +291,84 @@ void hostapd_get_ht_capab(struct hostapd
  1271. + return pos;
  1272. +@@ -288,3 +294,84 @@ void hostapd_get_ht_capab(struct hostapd
  1273. neg_ht_cap->ht_capabilities_info = host_to_le16(cap);
  1274. }
  1275. diff --git a/package/hostapd/patches/450-limit_debug_messages.patch b/package/hostapd/patches/450-limit_debug_messages.patch
  1276. index aaea941..08f17dc 100644
  1277. --- a/package/hostapd/patches/450-limit_debug_messages.patch
  1278. +++ b/package/hostapd/patches/450-limit_debug_messages.patch
  1279. @@ -20,40 +20,41 @@
  1280. {
  1281. size_t i;
  1282. -@@ -375,20 +375,9 @@ static void _wpa_hexdump(int level, cons
  1283. +@@ -375,20 +375,8 @@ static void _wpa_hexdump(int level, cons
  1284. #endif /* CONFIG_ANDROID_LOG */
  1285. }
  1286. --void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len)
  1287. +-void wpa_hexdump(int level, const char *title, const void *buf, size_t len)
  1288. -{
  1289. - _wpa_hexdump(level, title, buf, len, 1);
  1290. -}
  1291. -
  1292. -
  1293. --void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len)
  1294. +-void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len)
  1295. -{
  1296. - _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys);
  1297. -}
  1298. -
  1299. -
  1300. --static void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
  1301. +-
  1302. +-static void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
  1303. - size_t len, int show)
  1304. -+void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
  1305. ++void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
  1306. + size_t len, int show)
  1307. {
  1308. size_t i, llen;
  1309. const u8 *pos = buf;
  1310. -@@ -495,19 +484,6 @@ static void _wpa_hexdump_ascii(int level
  1311. +@@ -495,20 +483,6 @@ static void _wpa_hexdump_ascii(int level
  1312. }
  1313. --void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, size_t len)
  1314. +-void wpa_hexdump_ascii(int level, const char *title, const void *buf,
  1315. +- size_t len)
  1316. -{
  1317. - _wpa_hexdump_ascii(level, title, buf, len, 1);
  1318. -}
  1319. -
  1320. -
  1321. --void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
  1322. +-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
  1323. - size_t len)
  1324. -{
  1325. - _wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys);
  1326. @@ -63,7 +64,7 @@
  1327. #ifdef CONFIG_DEBUG_FILE
  1328. static char *last_path = NULL;
  1329. #endif /* CONFIG_DEBUG_FILE */
  1330. -@@ -591,7 +567,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
  1331. +@@ -592,7 +566,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
  1332. }
  1333. @@ -72,7 +73,7 @@
  1334. {
  1335. va_list ap;
  1336. char *buf;
  1337. -@@ -625,7 +601,7 @@ void wpa_msg(void *ctx, int level, const
  1338. +@@ -630,7 +604,7 @@ void wpa_msg(void *ctx, int level, const
  1339. }
  1340. @@ -83,14 +84,14 @@
  1341. char *buf;
  1342. --- a/src/utils/wpa_debug.h
  1343. +++ b/src/utils/wpa_debug.h
  1344. -@@ -43,6 +43,17 @@ int wpa_debug_open_file(const char *path
  1345. +@@ -47,6 +47,17 @@ int wpa_debug_open_file(const char *path
  1346. int wpa_debug_reopen_file(void);
  1347. void wpa_debug_close_file(void);
  1348. +/* internal */
  1349. +void _wpa_hexdump(int level, const char *title, const u8 *buf,
  1350. + size_t len, int show);
  1351. -+void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
  1352. ++void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
  1353. + size_t len, int show);
  1354. +extern int wpa_debug_show_keys;
  1355. +
  1356. @@ -101,7 +102,7 @@
  1357. /**
  1358. * wpa_debug_printf_timestamp - Print timestamp for debug output
  1359. *
  1360. -@@ -63,9 +74,15 @@ void wpa_debug_print_timestamp(void);
  1361. +@@ -67,9 +78,15 @@ void wpa_debug_print_timestamp(void);
  1362. *
  1363. * Note: New line '\n' is added to the end of the text when printing to stdout.
  1364. */
  1365. @@ -118,11 +119,11 @@
  1366. /**
  1367. * wpa_hexdump - conditional hex dump
  1368. * @level: priority level (MSG_*) of the message
  1369. -@@ -77,7 +94,13 @@ PRINTF_FORMAT(2, 3);
  1370. +@@ -81,7 +98,13 @@ PRINTF_FORMAT(2, 3);
  1371. * output may be directed to stdout, stderr, and/or syslog based on
  1372. * configuration. The contents of buf is printed out has hex dump.
  1373. */
  1374. --void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len);
  1375. +-void wpa_hexdump(int level, const char *title, const void *buf, size_t len);
  1376. +static inline void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len)
  1377. +{
  1378. + if (level < CONFIG_MSG_MIN_PRIORITY)
  1379. @@ -133,11 +134,11 @@
  1380. static inline void wpa_hexdump_buf(int level, const char *title,
  1381. const struct wpabuf *buf)
  1382. -@@ -99,7 +122,13 @@ static inline void wpa_hexdump_buf(int l
  1383. +@@ -103,7 +126,13 @@ static inline void wpa_hexdump_buf(int l
  1384. * like wpa_hexdump(), but by default, does not include secret keys (passwords,
  1385. * etc.) in debug output.
  1386. */
  1387. --void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len);
  1388. +-void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len);
  1389. +static inline void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len)
  1390. +{
  1391. + if (level < CONFIG_MSG_MIN_PRIORITY)
  1392. @@ -148,11 +149,11 @@
  1393. static inline void wpa_hexdump_buf_key(int level, const char *title,
  1394. const struct wpabuf *buf)
  1395. -@@ -121,8 +150,14 @@ static inline void wpa_hexdump_buf_key(i
  1396. +@@ -125,8 +154,14 @@ static inline void wpa_hexdump_buf_key(i
  1397. * the hex numbers and ASCII characters (for printable range) are shown. 16
  1398. * bytes per line will be shown.
  1399. */
  1400. --void wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
  1401. +-void wpa_hexdump_ascii(int level, const char *title, const void *buf,
  1402. - size_t len);
  1403. +static inline void wpa_hexdump_ascii(int level, const char *title,
  1404. + const u8 *buf, size_t len)
  1405. @@ -165,11 +166,11 @@
  1406. /**
  1407. * wpa_hexdump_ascii_key - conditional hex dump, hide keys
  1408. -@@ -138,8 +173,14 @@ void wpa_hexdump_ascii(int level, const
  1409. +@@ -142,8 +177,14 @@ void wpa_hexdump_ascii(int level, const
  1410. * bytes per line will be shown. This works like wpa_hexdump_ascii(), but by
  1411. * default, does not include secret keys (passwords, etc.) in debug output.
  1412. */
  1413. --void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
  1414. +-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
  1415. - size_t len);
  1416. +static inline void wpa_hexdump_ascii_key(int level, const char *title,
  1417. + const u8 *buf, size_t len)
  1418. @@ -182,7 +183,7 @@
  1419. /*
  1420. * wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce
  1421. -@@ -174,7 +215,12 @@ void wpa_hexdump_ascii_key(int level, co
  1422. +@@ -178,7 +219,12 @@ void wpa_hexdump_ascii_key(int level, co
  1423. *
  1424. * Note: New line '\n' is added to the end of the text when printing to stdout.
  1425. */
  1426. @@ -196,7 +197,7 @@
  1427. /**
  1428. * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors
  1429. -@@ -188,8 +234,13 @@ void wpa_msg(void *ctx, int level, const
  1430. +@@ -192,8 +238,13 @@ void wpa_msg(void *ctx, int level, const
  1431. * attached ctrl_iface monitors. In other words, it can be used for frequent
  1432. * events that do not need to be sent to syslog.
  1433. */
  1434. diff --git a/package/hostapd/patches/460-indicate-features.patch b/package/hostapd/patches/460-indicate-features.patch
  1435. index 7a44da1..cee3e76 100644
  1436. --- a/package/hostapd/patches/460-indicate-features.patch
  1437. +++ b/package/hostapd/patches/460-indicate-features.patch
  1438. @@ -1,23 +1,23 @@
  1439. --- a/hostapd/main.c
  1440. +++ b/hostapd/main.c
  1441. -@@ -14,6 +14,7 @@
  1442. -
  1443. +@@ -15,6 +15,7 @@
  1444. #include "utils/common.h"
  1445. #include "utils/eloop.h"
  1446. + #include "utils/uuid.h"
  1447. +#include "utils/build_features.h"
  1448. #include "crypto/random.h"
  1449. #include "crypto/tls.h"
  1450. #include "common/version.h"
  1451. -@@ -546,7 +547,7 @@ int main(int argc, char *argv[])
  1452. +@@ -558,7 +559,7 @@ int main(int argc, char *argv[])
  1453. wpa_supplicant_event = hostapd_wpa_event;
  1454. for (;;) {
  1455. -- c = getopt(argc, argv, "b:Bde:f:hKP:Ttvg:G:");
  1456. -+ c = getopt(argc, argv, "b:Bde:f:hKP:Ttg:G:v::");
  1457. +- c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:vg:G:");
  1458. ++ c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:g:G:v::");
  1459. if (c < 0)
  1460. break;
  1461. switch (c) {
  1462. -@@ -583,6 +584,8 @@ int main(int argc, char *argv[])
  1463. +@@ -595,6 +596,8 @@ int main(int argc, char *argv[])
  1464. break;
  1465. #endif /* CONFIG_DEBUG_LINUX_TRACING */
  1466. case 'v':
  1467. @@ -36,16 +36,16 @@
  1468. #include "wpa_supplicant_i.h"
  1469. #include "driver_i.h"
  1470. #include "p2p_supplicant.h"
  1471. -@@ -161,7 +162,7 @@ int main(int argc, char *argv[])
  1472. +@@ -176,7 +177,7 @@ int main(int argc, char *argv[])
  1473. for (;;) {
  1474. c = getopt(argc, argv,
  1475. -- "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuvW");
  1476. -+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuv::W");
  1477. +- "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuvW");
  1478. ++ "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuv::W");
  1479. if (c < 0)
  1480. break;
  1481. switch (c) {
  1482. -@@ -259,8 +260,12 @@ int main(int argc, char *argv[])
  1483. +@@ -279,8 +280,12 @@ int main(int argc, char *argv[])
  1484. break;
  1485. #endif /* CONFIG_DBUS */
  1486. case 'v':
  1487. diff --git a/package/hostapd/patches/470-hostapd_cli_ifdef.patch b/package/hostapd/patches/470-hostapd_cli_ifdef.patch
  1488. index 5ac0fdd..d4a0f12 100644
  1489. --- a/package/hostapd/patches/470-hostapd_cli_ifdef.patch
  1490. +++ b/package/hostapd/patches/470-hostapd_cli_ifdef.patch
  1491. @@ -16,7 +16,7 @@
  1492. " get_config show current configuration\n"
  1493. " help show this usage help\n"
  1494. " interface [ifname] show interfaces/select interface\n"
  1495. -@@ -352,7 +350,6 @@ static int hostapd_cli_cmd_sa_query(stru
  1496. +@@ -362,7 +360,6 @@ static int hostapd_cli_cmd_sa_query(stru
  1497. #endif /* CONFIG_IEEE80211W */
  1498. @@ -24,7 +24,7 @@
  1499. static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
  1500. char *argv[])
  1501. {
  1502. -@@ -578,7 +575,6 @@ static int hostapd_cli_cmd_wps_config(st
  1503. +@@ -588,7 +585,6 @@ static int hostapd_cli_cmd_wps_config(st
  1504. ssid_hex, argv[1]);
  1505. return wpa_ctrl_command(ctrl, buf);
  1506. }
  1507. @@ -32,7 +32,7 @@
  1508. static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
  1509. -@@ -903,7 +899,6 @@ static struct hostapd_cli_cmd hostapd_cl
  1510. +@@ -979,7 +975,6 @@ static struct hostapd_cli_cmd hostapd_cl
  1511. #ifdef CONFIG_IEEE80211W
  1512. { "sa_query", hostapd_cli_cmd_sa_query },
  1513. #endif /* CONFIG_IEEE80211W */
  1514. @@ -40,7 +40,7 @@
  1515. { "wps_pin", hostapd_cli_cmd_wps_pin },
  1516. { "wps_check_pin", hostapd_cli_cmd_wps_check_pin },
  1517. { "wps_pbc", hostapd_cli_cmd_wps_pbc },
  1518. -@@ -917,7 +912,6 @@ static struct hostapd_cli_cmd hostapd_cl
  1519. +@@ -993,7 +988,6 @@ static struct hostapd_cli_cmd hostapd_cl
  1520. { "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin },
  1521. { "wps_config", hostapd_cli_cmd_wps_config },
  1522. { "wps_get_status", hostapd_cli_cmd_wps_get_status },
  1523. diff --git a/package/hostapd/patches/471-wpa_cli_ifdef.patch b/package/hostapd/patches/471-wpa_cli_ifdef.patch
  1524. index cc84444..36b5a44 100644
  1525. --- a/package/hostapd/patches/471-wpa_cli_ifdef.patch
  1526. +++ b/package/hostapd/patches/471-wpa_cli_ifdef.patch
  1527. @@ -10,4 +10,4 @@
  1528. +
  1529. static const char *wpa_cli_version =
  1530. "wpa_cli v" VERSION_STR "\n"
  1531. - "Copyright (c) 2004-2013, Jouni Malinen <j@w1.fi> and contributors";
  1532. + "Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi> and contributors";
  1533. diff --git a/package/hostapd/patches/480-max_num_sta_probe.patch b/package/hostapd/patches/480-max_num_sta_probe.patch
  1534. index e5ca8b4..e238bf4 100644
  1535. --- a/package/hostapd/patches/480-max_num_sta_probe.patch
  1536. +++ b/package/hostapd/patches/480-max_num_sta_probe.patch
  1537. @@ -1,6 +1,6 @@
  1538. --- a/src/ap/beacon.c
  1539. +++ b/src/ap/beacon.c
  1540. -@@ -501,6 +501,10 @@ void handle_probe_req(struct hostapd_dat
  1541. +@@ -599,6 +599,10 @@ void handle_probe_req(struct hostapd_dat
  1542. return;
  1543. }
  1544. @@ -9,5 +9,5 @@
  1545. + " too many connected stations.", MAC2STR(mgmt->sa));
  1546. +
  1547. #ifdef CONFIG_INTERWORKING
  1548. - if (elems.interworking && elems.interworking_len >= 1) {
  1549. - u8 ant = elems.interworking[0] & 0x0f;
  1550. + if (hapd->conf->interworking &&
  1551. + elems.interworking && elems.interworking_len >= 1) {
  1552. diff --git a/package/hostapd/patches/490-scan_wait.patch b/package/hostapd/patches/490-scan_wait.patch
  1553. index 61715d6..3459a61 100644
  1554. --- a/package/hostapd/patches/490-scan_wait.patch
  1555. +++ b/package/hostapd/patches/490-scan_wait.patch
  1556. @@ -1,15 +1,15 @@
  1557. --- a/hostapd/main.c
  1558. +++ b/hostapd/main.c
  1559. -@@ -33,6 +33,8 @@
  1560. - extern int wpa_debug_level;
  1561. - extern int wpa_debug_show_keys;
  1562. - extern int wpa_debug_timestamp;
  1563. +@@ -36,6 +36,8 @@ struct hapd_global {
  1564. + };
  1565. +
  1566. + static struct hapd_global global;
  1567. +static int daemonize = 0;
  1568. +static char *pid_file = NULL;
  1569. - extern struct wpa_driver_ops *wpa_drivers[];
  1570. -@@ -147,6 +149,14 @@ static void hostapd_logger_cb(void *ctx,
  1571. + #ifndef CONFIG_NO_HOSTAPD_LOGGER
  1572. +@@ -141,6 +143,14 @@ static void hostapd_logger_cb(void *ctx,
  1573. }
  1574. #endif /* CONFIG_NO_HOSTAPD_LOGGER */
  1575. @@ -24,7 +24,7 @@
  1576. /**
  1577. * hostapd_driver_init - Preparate driver interface
  1578. -@@ -165,6 +175,8 @@ static int hostapd_driver_init(struct ho
  1579. +@@ -159,6 +169,8 @@ static int hostapd_driver_init(struct ho
  1580. return -1;
  1581. }
  1582. @@ -33,7 +33,7 @@
  1583. /* Initialize the driver interface */
  1584. if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5]))
  1585. b = NULL;
  1586. -@@ -381,8 +393,6 @@ static void hostapd_global_deinit(const
  1587. +@@ -372,8 +384,6 @@ static void hostapd_global_deinit(const
  1588. #endif /* CONFIG_NATIVE_WINDOWS */
  1589. eap_server_unregister_methods();
  1590. @@ -42,7 +42,7 @@
  1591. }
  1592. -@@ -408,11 +418,6 @@ static int hostapd_global_run(struct hap
  1593. +@@ -399,11 +409,6 @@ static int hostapd_global_run(struct hap
  1594. }
  1595. #endif /* EAP_SERVER_TNC */
  1596. @@ -54,7 +54,7 @@
  1597. eloop_run();
  1598. return 0;
  1599. -@@ -521,8 +526,7 @@ int main(int argc, char *argv[])
  1600. +@@ -533,8 +538,7 @@ int main(int argc, char *argv[])
  1601. struct hapd_interfaces interfaces;
  1602. int ret = 1;
  1603. size_t i, j;
  1604. diff --git a/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch
  1605. index 544151e..5656970 100644
  1606. --- a/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch
  1607. +++ b/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch
  1608. @@ -22,9 +22,9 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1609. #include "common/defs.h"
  1610. #include "utils/list.h"
  1611. -@@ -404,6 +405,11 @@ struct wpa_driver_associate_params {
  1612. - */
  1613. - int freq;
  1614. +@@ -414,6 +415,11 @@ struct wpa_driver_associate_params {
  1615. + * responsible for selecting with which BSS to associate. */
  1616. + const u8 *bssid;
  1617. + int beacon_interval;
  1618. + int fixed_freq;
  1619. @@ -32,11 +32,11 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1620. + int mcast_rate;
  1621. +
  1622. /**
  1623. - * bg_scan_period - Background scan period in seconds, 0 to disable
  1624. - * background scan, or -1 to indicate no change to default driver
  1625. + * bssid_hint - BSSID of a proposed AP
  1626. + *
  1627. --- a/wpa_supplicant/config.c
  1628. +++ b/wpa_supplicant/config.c
  1629. -@@ -14,6 +14,7 @@
  1630. +@@ -15,6 +15,7 @@
  1631. #include "rsn_supp/wpa.h"
  1632. #include "eap_peer/eap.h"
  1633. #include "p2p/p2p.h"
  1634. @@ -44,7 +44,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1635. #include "config.h"
  1636. -@@ -1512,6 +1513,97 @@ static char * wpa_config_write_psk_list(
  1637. +@@ -1527,6 +1528,97 @@ static char * wpa_config_write_psk_list(
  1638. #endif /* CONFIG_P2P */
  1639. @@ -142,7 +142,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1640. /* Helper macros for network block parser */
  1641. #ifdef OFFSET
  1642. -@@ -1715,6 +1807,9 @@ static const struct parse_data ssid_fiel
  1643. +@@ -1733,6 +1825,9 @@ static const struct parse_data ssid_fiel
  1644. { INT(ap_max_inactivity) },
  1645. { INT(dtim_period) },
  1646. { INT(beacon_int) },
  1647. @@ -162,7 +162,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1648. #define MAX_SSID_LEN 32
  1649. -@@ -620,6 +621,10 @@ struct wpa_ssid {
  1650. +@@ -636,6 +637,10 @@ struct wpa_ssid {
  1651. * dereferences since it may not be updated in all cases.
  1652. */
  1653. void *parent_cred;
  1654. @@ -175,24 +175,11 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1655. #endif /* CONFIG_SSID_H */
  1656. --- a/wpa_supplicant/wpa_supplicant.c
  1657. +++ b/wpa_supplicant/wpa_supplicant.c
  1658. -@@ -1623,15 +1623,24 @@ void wpa_supplicant_associate(struct wpa
  1659. - params.ssid_len = ssid->ssid_len;
  1660. - }
  1661. -
  1662. -- if (ssid->mode == WPAS_MODE_IBSS && ssid->bssid_set &&
  1663. -- wpa_s->conf->ap_scan == 2) {
  1664. -- params.bssid = ssid->bssid;
  1665. -- params.fixed_bssid = 1;
  1666. -+ if (ssid->mode == WPAS_MODE_IBSS) {
  1667. -+ if (ssid->bssid_set && wpa_s->conf->ap_scan == 2) {
  1668. -+ params.bssid = ssid->bssid;
  1669. -+ params.fixed_bssid = 1;
  1670. -+ }
  1671. -+ if (ssid->frequency > 0 && params.freq == 0)
  1672. -+ /* Initial channel for IBSS */
  1673. -+ params.freq = ssid->frequency;
  1674. +@@ -1791,6 +1791,13 @@ static void wpas_start_assoc_cb(struct w
  1675. + params.beacon_int = ssid->beacon_int;
  1676. + else
  1677. + params.beacon_int = wpa_s->conf->beacon_int;
  1678. + params.fixed_freq = ssid->fixed_freq;
  1679. -+ params.beacon_interval = ssid->beacon_int;
  1680. + i = 0;
  1681. + while (i < NL80211_MAX_SUPP_RATES) {
  1682. + params.rates[i] = ssid->rates[i];
  1683. @@ -201,9 +188,4 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1684. + params.mcast_rate = ssid->mcast_rate;
  1685. }
  1686. -- if (ssid->mode == WPAS_MODE_IBSS && ssid->frequency > 0 &&
  1687. -- params.freq == 0)
  1688. -- params.freq = ssid->frequency; /* Initial channel for IBSS */
  1689. params.wpa_ie = wpa_ie;
  1690. - params.wpa_ie_len = wpa_ie_len;
  1691. - params.pairwise_suite = cipher_pairwise;
  1692. diff --git a/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch
  1693. index 565bbc9..c774682 100644
  1694. --- a/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch
  1695. +++ b/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch
  1696. @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1697. --- a/src/drivers/driver_nl80211.c
  1698. +++ b/src/drivers/driver_nl80211.c
  1699. -@@ -7903,7 +7903,7 @@ static int wpa_driver_nl80211_ibss(struc
  1700. +@@ -8455,7 +8455,7 @@ static int wpa_driver_nl80211_ibss(struc
  1701. struct wpa_driver_associate_params *params)
  1702. {
  1703. struct nl_msg *msg;
  1704. @@ -19,9 +19,9 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  1705. int count = 0;
  1706. wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
  1707. -@@ -7936,6 +7936,37 @@ retry:
  1708. - wpa_printf(MSG_DEBUG, " * freq=%d", params->freq);
  1709. - NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, params->freq);
  1710. +@@ -8494,6 +8494,37 @@ retry:
  1711. + params->beacon_int);
  1712. + }
  1713. + if (params->fixed_freq) {
  1714. + wpa_printf(MSG_DEBUG, " * fixed_freq");
  1715. diff --git a/package/hostapd/patches/502-wpa_s-support-htmode-param.patch b/package/hostapd/patches/502-wpa_s-support-htmode-param.patch
  1716. index adb20a2..fdba6d7 100644
  1717. --- a/package/hostapd/patches/502-wpa_s-support-htmode-param.patch
  1718. +++ b/package/hostapd/patches/502-wpa_s-support-htmode-param.patch
  1719. @@ -16,7 +16,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  1720. --- a/src/drivers/driver.h
  1721. +++ b/src/drivers/driver.h
  1722. -@@ -409,6 +409,8 @@ struct wpa_driver_associate_params {
  1723. +@@ -419,6 +419,8 @@ struct wpa_driver_associate_params {
  1724. int fixed_freq;
  1725. unsigned char rates[NL80211_MAX_SUPP_RATES];
  1726. int mcast_rate;
  1727. @@ -24,10 +24,10 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  1728. + unsigned int htmode;
  1729. /**
  1730. - * bg_scan_period - Background scan period in seconds, 0 to disable
  1731. + * bssid_hint - BSSID of a proposed AP
  1732. --- a/src/drivers/driver_nl80211.c
  1733. +++ b/src/drivers/driver_nl80211.c
  1734. -@@ -7967,6 +7967,22 @@ retry:
  1735. +@@ -8525,6 +8525,22 @@ retry:
  1736. NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
  1737. }
  1738. @@ -52,7 +52,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  1739. goto nla_put_failure;
  1740. --- a/wpa_supplicant/config.c
  1741. +++ b/wpa_supplicant/config.c
  1742. -@@ -1544,6 +1544,71 @@ static char * wpa_config_write_mcast_rat
  1743. +@@ -1559,6 +1559,71 @@ static char * wpa_config_write_mcast_rat
  1744. }
  1745. #endif /* NO_CONFIG_WRITE */
  1746. @@ -124,7 +124,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  1747. static int wpa_config_parse_rates(const struct parse_data *data,
  1748. struct wpa_ssid *ssid, int line,
  1749. const char *value)
  1750. -@@ -1810,6 +1875,7 @@ static const struct parse_data ssid_fiel
  1751. +@@ -1828,6 +1893,7 @@ static const struct parse_data ssid_fiel
  1752. { INT_RANGE(fixed_freq, 0, 1) },
  1753. { FUNC(rates) },
  1754. { FUNC(mcast_rate) },
  1755. @@ -134,7 +134,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  1756. #undef OFFSET
  1757. --- a/wpa_supplicant/config_ssid.h
  1758. +++ b/wpa_supplicant/config_ssid.h
  1759. -@@ -625,6 +625,8 @@ struct wpa_ssid {
  1760. +@@ -641,6 +641,8 @@ struct wpa_ssid {
  1761. int fixed_freq;
  1762. unsigned char rates[NL80211_MAX_SUPP_RATES];
  1763. double mcast_rate;
  1764. @@ -145,7 +145,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  1765. #endif /* CONFIG_SSID_H */
  1766. --- a/wpa_supplicant/wpa_supplicant.c
  1767. +++ b/wpa_supplicant/wpa_supplicant.c
  1768. -@@ -1639,6 +1639,8 @@ void wpa_supplicant_associate(struct wpa
  1769. +@@ -1798,6 +1798,8 @@ static void wpas_start_assoc_cb(struct w
  1770. i++;
  1771. }
  1772. params.mcast_rate = ssid->mcast_rate;
  1773. diff --git a/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch b/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch
  1774. deleted file mode 100644
  1775. index fe72ee2..0000000
  1776. --- a/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch
  1777. +++ /dev/null
  1778. @@ -1,18 +0,0 @@
  1779. ---- a/src/drivers/driver_nl80211.c
  1780. -+++ b/src/drivers/driver_nl80211.c
  1781. -@@ -3157,10 +3157,12 @@ static int wiphy_info_iface_comb_process
  1782. - }
  1783. -
  1784. - if (combination_has_p2p && combination_has_mgd) {
  1785. -- info->p2p_concurrent = 1;
  1786. -- info->num_multichan_concurrent =
  1787. -+ int num_channels =
  1788. - nla_get_u32(tb_comb[NL80211_IFACE_COMB_NUM_CHANNELS]);
  1789. -- return 1;
  1790. -+
  1791. -+ info->p2p_concurrent = 1;
  1792. -+ if (info->num_multichan_concurrent < num_channels)
  1793. -+ info->num_multichan_concurrent = num_channels;
  1794. - }
  1795. -
  1796. - return 0;
  1797. diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile
  1798. index 9a7093c..e19f30e 100644
  1799. --- a/package/mac80211/Makefile
  1800. +++ b/package/mac80211/Makefile
  1801. @@ -1,5 +1,5 @@
  1802. #
  1803. -# Copyright (C) 2007-2013 OpenWrt.org
  1804. +# Copyright (C) 2007-2014 OpenWrt.org
  1805. #
  1806. # This is free software, licensed under the GNU General Public License v2.
  1807. # See /LICENSE for more information.
  1808. @@ -10,11 +10,11 @@ include $(INCLUDE_DIR)/kernel.mk
  1809. PKG_NAME:=mac80211
  1810. -PKG_VERSION:=2014-01-23.1
  1811. +PKG_VERSION:=2014-03-31
  1812. PKG_RELEASE:=1
  1813. PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
  1814. PKG_BACKPORT_VERSION:=
  1815. -PKG_MD5SUM:=8db16edbdaf4abc2e9c2f3b6c86736a6
  1816. +PKG_MD5SUM:=8b5cf82d6defc5867511014af4afc0b6
  1817. PKG_SOURCE:=compat-wireless-$(PKG_VERSION)$(PKG_BACKPORT_VERSION).tar.bz2
  1818. PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
  1819. @@ -105,12 +105,12 @@ Generic IEEE 802.11 Networking Stack (mac80211)
  1820. endef
  1821. PKG_LINUX_FIRMWARE_NAME:=linux-firmware
  1822. -PKG_LINUX_FIRMWARE_VERSION:=7d0c7a8cfd78388d90cc784a185b19dcbdbce824
  1823. +PKG_LINUX_FIRMWARE_VERSION:=f8c22c692bdee57a20b092e647464ff6176df3ed
  1824. PKG_LINUX_FIRMWARE_SOURCE:=$(PKG_LINUX_FIRMWARE_NAME)-$(PKG_LINUX_FIRMWARE_VERSION).tar.bz2
  1825. PKG_LINUX_FIRMWARE_PROTO:=git
  1826. PKG_LINUX_FIRMWARE_SOURCE_URL:=git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
  1827. PKG_LINUX_FIRMWARE_SUBDIR:=$(PKG_LINUX_FIRMWARE_NAME)-$(PKG_LINUX_FIRMWARE_VERSION)
  1828. -PKG_LINUX_FIRMWARE_MIRROR_MD5SUM:=837a1a9456c1ec8b428cc0b2b08a331b
  1829. +PKG_LINUX_FIRMWARE_MIRROR_MD5SUM:=e219333f01835c6e556875a9e0deb3f9
  1830. define Download/linux-firmware
  1831. FILE:=$(PKG_LINUX_FIRMWARE_SOURCE)
  1832. @@ -124,7 +124,7 @@ endef
  1833. $(eval $(call Download,linux-firmware))
  1834. PKG_ATH10K_LINUX_FIRMWARE_NAME:=ath10k-firmware
  1835. -PKG_ATH10K_LINUX_FIRMWARE_VERSION:=d86e78e5c6be34329936c8bd73a212700437be2e
  1836. +PKG_ATH10K_LINUX_FIRMWARE_VERSION:=38eeda3ae6f90fde5546bdd48ee4ff3090f238c0
  1837. PKG_ATH10K_LINUX_FIRMWARE_SOURCE:=$(PKG_ATH10K_LINUX_FIRMWARE_NAME)-$(PKG_ATH10K_LINUX_FIRMWARE_VERSION).tar.bz2
  1838. PKG_ATH10K_LINUX_FIRMWARE_PROTO:=git
  1839. PKG_ATH10K_LINUX_FIRMWARE_SOURCE_URL:=https://github.com/kvalo/ath10k-firmware.git
  1840. @@ -606,6 +606,19 @@ Atheros IEEE 802.11ac family of chipsets. For now only
  1841. PCI is supported.
  1842. endef
  1843. +define KernelPackage/ath10k/config
  1844. + if PACKAGE_kmod-ath10k
  1845. +
  1846. + config ATH10K_STA_FW
  1847. + bool "Firmware optimized for STA operation"
  1848. + default n
  1849. + help
  1850. + Use the ath10k firmware optimized for wireless client instead
  1851. + of access point operation.
  1852. +
  1853. + endif
  1854. +endef
  1855. +
  1856. define KernelPackage/carl9170
  1857. $(call KernelPackage/mac80211/Default)
  1858. TITLE:=Driver for Atheros AR9170 USB sticks
  1859. @@ -844,6 +857,13 @@ define KernelPackage/iwlagn/config
  1860. Download and install firmware for:
  1861. Intel Centrino Advanced-N 6230, Wireless-N 1030, Wireless-N 130 and Advanced-N 6235
  1862. + config IWL7260_FW
  1863. + bool "Intel 7260 Firmware"
  1864. + default y
  1865. + help
  1866. + Download and install firmware for:
  1867. + Intel Dual Band Wireless-N 7260 and Intel Dual Band Wireless-AC 7260
  1868. +
  1869. config IWL100_FW
  1870. bool "Intel 100 Firmware"
  1871. default y
  1872. @@ -1639,8 +1659,7 @@ define KernelPackage/wl18xx/install
  1873. $(INSTALL_DIR) $(1)/lib/firmware/ti-connectivity
  1874. $(INSTALL_DATA) \
  1875. $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-conf.bin \
  1876. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-fw.bin \
  1877. - $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-fw-2.bin \
  1878. + $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/ti-connectivity/wl18xx-fw-3.bin \
  1879. $(1)/lib/firmware/ti-connectivity
  1880. endef
  1881. @@ -1664,10 +1683,19 @@ endef
  1882. define KernelPackage/ath10k/install
  1883. $(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
  1884. +ifeq ($(CONFIG_ATH10K_STA_FW),y)
  1885. + $(INSTALL_DATA) \
  1886. + $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin \
  1887. + $(1)/lib/firmware/ath10k/QCA988X/hw2.0/
  1888. + $(INSTALL_DATA) \
  1889. + $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/main/firmware-2.bin_999.999.0.636 \
  1890. + $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
  1891. +else
  1892. $(INSTALL_DATA) \
  1893. $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/board.bin \
  1894. $(PKG_BUILD_DIR)/$(PKG_ATH10K_LINUX_FIRMWARE_SUBDIR)/ath10k/QCA988X/hw2.0/firmware-2.bin \
  1895. $(1)/lib/firmware/ath10k/QCA988X/hw2.0/
  1896. +endif
  1897. endef
  1898. define KernelPackage/mwl8k/install
  1899. @@ -1714,6 +1742,9 @@ endif
  1900. ifneq ($(CONFIG_IWL6030_FW),)
  1901. $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-6000g2b-6.ucode $(1)/lib/firmware
  1902. endif
  1903. +ifneq ($(CONFIG_IWL7260_FW),)
  1904. + $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-7260-7.ucode $(1)/lib/firmware
  1905. +endif
  1906. ifneq ($(CONFIG_IWL100_FW),)
  1907. $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_LINUX_FIRMWARE_SUBDIR)/iwlwifi-100-5.ucode $(1)/lib/firmware
  1908. endif
  1909. diff --git a/package/mac80211/files/regdb.txt b/package/mac80211/files/regdb.txt
  1910. index 2badb21..fcab208 100644
  1911. --- a/package/mac80211/files/regdb.txt
  1912. +++ b/package/mac80211/files/regdb.txt
  1913. @@ -1,211 +1,216 @@
  1914. # This is the world regulatory domain
  1915. country 00:
  1916. - (2402 - 2472 @ 40), (3, 20)
  1917. + (2402 - 2472 @ 40), (20)
  1918. # Channel 12 - 13.
  1919. - (2457 - 2482 @ 40), (3, 20), PASSIVE-SCAN, NO-IBSS
  1920. + (2457 - 2482 @ 40), (20), NO-IR
  1921. # Channel 14. Only JP enables this and for 802.11b only
  1922. - (2474 - 2494 @ 20), (3, 20), PASSIVE-SCAN, NO-IBSS, NO-OFDM
  1923. + (2474 - 2494 @ 20), (20), NO-IR
  1924. # Channel 36 - 48
  1925. - (5170 - 5250 @ 80), (3, 20)
  1926. + (5170 - 5250 @ 80), (20), NO-IR
  1927. # NB: 5260 MHz - 5700 MHz requies DFS
  1928. # Channel 149 - 165
  1929. - (5735 - 5835 @ 80), (3, 20), PASSIVE-SCAN, NO-IBSS
  1930. + (5735 - 5835 @ 80), (20), NO-IR
  1931. # IEEE 802.11ad (60GHz), channels 1..3
  1932. - (57240 - 63720 @ 2160), (N/A, 0)
  1933. + (57240 - 63720 @ 2160), (0)
  1934. country AD:
  1935. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  1936. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  1937. -
  1938. -country AE:
  1939. - (2402 - 2482 @ 40), (N/A, 20)
  1940. - (5170 - 5250 @ 80), (3, 17)
  1941. - (5250 - 5330 @ 80), (3, 24), DFS
  1942. - (5490 - 5710 @ 80), (3, 24), DFS
  1943. - (5735 - 5835 @ 80), (3, 30)
  1944. -
  1945. -country AL:
  1946. - (2402 - 2482 @ 20), (N/A, 20)
  1947. -
  1948. -country AM:
  1949. - (2402 - 2482 @ 40), (N/A, 20)
  1950. - (5170 - 5250 @ 20), (N/A, 18)
  1951. - (5250 - 5330 @ 20), (N/A, 18), DFS
  1952. -
  1953. -country AN:
  1954. - (2402 - 2482 @ 40), (N/A, 20)
  1955. - (5170 - 5250 @ 40), (N/A, 20)
  1956. - (5250 - 5330 @ 40), (N/A, 20), DFS
  1957. - (5490 - 5710 @ 40), (N/A, 27), DFS
  1958. -
  1959. -country AR:
  1960. - (2402 - 2482 @ 40), (N/A, 20)
  1961. - (5170 - 5250 @ 80), (3, 17)
  1962. - (5250 - 5330 @ 80), (3, 24), DFS
  1963. - (5490 - 5710 @ 80), (3, 24), DFS
  1964. - (5735 - 5835 @ 80), (3, 30)
  1965. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  1966. +
  1967. +country AE: DFS-FCC
  1968. + (2402 - 2482 @ 40), (20)
  1969. + (5170 - 5250 @ 80), (17)
  1970. + (5250 - 5330 @ 80), (24), DFS
  1971. + (5490 - 5730 @ 80), (24), DFS
  1972. + (5735 - 5835 @ 80), (30)
  1973. +
  1974. +country AL: DFS-ETSI
  1975. + (2402 - 2482 @ 40), (20)
  1976. + (5170 - 5250 @ 80), (20.00)
  1977. + (5250 - 5330 @ 80), (20.00), DFS
  1978. + (5490 - 5710 @ 80), (27.00), DFS
  1979. +
  1980. +country AM: DFS-ETSI
  1981. + (2402 - 2482 @ 40), (20)
  1982. + (5170 - 5250 @ 80), (18)
  1983. + (5250 - 5330 @ 80), (18), DFS
  1984. +
  1985. +country AN: DFS-ETSI
  1986. + (2402 - 2482 @ 40), (20)
  1987. + (5170 - 5250 @ 80), (20)
  1988. + (5250 - 5330 @ 80), (20), DFS
  1989. + (5490 - 5710 @ 80), (27), DFS
  1990. +
  1991. +country AR: DFS-FCC
  1992. + (2402 - 2482 @ 40), (20)
  1993. + (5170 - 5250 @ 80), (17)
  1994. + (5250 - 5330 @ 80), (24), DFS
  1995. + (5490 - 5730 @ 80), (24), DFS
  1996. + (5735 - 5835 @ 80), (30)
  1997. country AT: DFS-ETSI
  1998. - (2402 - 2482 @ 40), (N/A, 20)
  1999. - (5170 - 5250 @ 80), (N/A, 20)
  2000. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2001. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2002. + (2402 - 2482 @ 40), (20)
  2003. + (5170 - 5250 @ 80), (20)
  2004. + (5250 - 5330 @ 80), (20), DFS
  2005. + (5490 - 5710 @ 80), (27), DFS
  2006. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2007. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2008. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2009. country AU:
  2010. - (2402 - 2482 @ 40), (N/A, 20)
  2011. - (5170 - 5250 @ 80), (3, 17)
  2012. - (5250 - 5330 @ 80), (3, 24), DFS
  2013. - (5490 - 5710 @ 80), (3, 24), DFS
  2014. - (5735 - 5835 @ 80), (3, 30)
  2015. -
  2016. -country AW:
  2017. - (2402 - 2482 @ 40), (N/A, 20)
  2018. - (5170 - 5250 @ 40), (N/A, 20)
  2019. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2020. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2021. -
  2022. -country AZ:
  2023. - (2402 - 2482 @ 40), (N/A, 20)
  2024. - (5170 - 5250 @ 40), (N/A, 18)
  2025. - (5250 - 5330 @ 40), (N/A, 18), DFS
  2026. + (2402 - 2482 @ 40), (20)
  2027. + (5170 - 5250 @ 80), (17)
  2028. + (5250 - 5330 @ 80), (24), DFS
  2029. + (5490 - 5710 @ 80), (24), DFS
  2030. + (5735 - 5835 @ 80), (30)
  2031. +
  2032. +country AW: DFS-ETSI
  2033. + (2402 - 2482 @ 40), (20)
  2034. + (5170 - 5250 @ 80), (20)
  2035. + (5250 - 5330 @ 80), (20), DFS
  2036. + (5490 - 5710 @ 80), (27), DFS
  2037. +
  2038. +country AZ: DFS-ETSI
  2039. + (2402 - 2482 @ 40), (20)
  2040. + (5170 - 5250 @ 80), (18)
  2041. + (5250 - 5330 @ 80), (18), DFS
  2042. country BA: DFS-ETSI
  2043. - (2402 - 2482 @ 40), (N/A, 20)
  2044. - (5170 - 5250 @ 40), (N/A, 20)
  2045. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2046. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2047. + (2402 - 2482 @ 40), (20)
  2048. + (5170 - 5250 @ 80), (20)
  2049. + (5250 - 5330 @ 80), (20), DFS
  2050. + (5490 - 5710 @ 80), (27), DFS
  2051. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2052. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2053. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2054. -country BB:
  2055. - (2402 - 2482 @ 40), (N/A, 20)
  2056. - (5170 - 5250 @ 40), (3, 23)
  2057. - (5250 - 5330 @ 40), (3, 23), DFS
  2058. - (5735 - 5835 @ 40), (3, 30)
  2059. +country BB: DFS-FCC
  2060. + (2402 - 2482 @ 40), (20)
  2061. + (5170 - 5250 @ 80), (23)
  2062. + (5250 - 5330 @ 80), (23), DFS
  2063. + (5735 - 5835 @ 80), (30)
  2064. -country BD:
  2065. - (2402 - 2482 @ 40), (N/A, 20)
  2066. +country BD: DFS-JP
  2067. + (2402 - 2482 @ 40), (20)
  2068. + (5735 - 5835 @ 80), (30)
  2069. country BE: DFS-ETSI
  2070. - (2402 - 2482 @ 40), (N/A, 20)
  2071. - (5170 - 5250 @ 80), (N/A, 20)
  2072. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2073. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2074. + (2402 - 2482 @ 40), (20)
  2075. + (5170 - 5250 @ 80), (20)
  2076. + (5250 - 5330 @ 80), (20), DFS
  2077. + (5490 - 5710 @ 80), (27), DFS
  2078. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2079. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2080. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2081. country BG: DFS-ETSI
  2082. - (2402 - 2482 @ 40), (N/A, 20)
  2083. - (5170 - 5250 @ 40), (N/A, 23)
  2084. - (5250 - 5290 @ 40), (N/A, 23), DFS
  2085. - (5490 - 5710 @ 40), (N/A, 30), DFS
  2086. + (2402 - 2482 @ 40), (20)
  2087. + (5170 - 5250 @ 80), (20)
  2088. + (5250 - 5330 @ 80), (20), DFS
  2089. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2090. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2091. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2092. -country BH:
  2093. - (2402 - 2482 @ 40), (N/A, 20)
  2094. - (5170 - 5250 @ 20), (N/A, 20)
  2095. - (5250 - 5330 @ 20), (N/A, 20), DFS
  2096. - (5735 - 5835 @ 20), (N/A, 20)
  2097. +country BH: DFS-JP
  2098. + (2402 - 2482 @ 40), (20)
  2099. + (5170 - 5250 @ 80), (20)
  2100. + (5250 - 5330 @ 80), (20), DFS
  2101. + (5735 - 5835 @ 80), (20)
  2102. country BL:
  2103. - (2402 - 2482 @ 40), (N/A, 20)
  2104. - (5170 - 5250 @ 40), (N/A, 18)
  2105. - (5250 - 5330 @ 40), (N/A, 18), DFS
  2106. -
  2107. -country BN:
  2108. - (2402 - 2482 @ 40), (N/A, 20)
  2109. - (5170 - 5250 @ 40), (N/A, 20)
  2110. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2111. - (5735 - 5835 @ 40), (N/A, 30)
  2112. -
  2113. -country BO:
  2114. - (2402 - 2482 @ 40), (N/A, 30)
  2115. - (5735 - 5835 @ 40), (N/A, 30)
  2116. -
  2117. -country BR:
  2118. - (2402 - 2482 @ 40), (N/A, 20)
  2119. - (5170 - 5250 @ 80), (3, 17)
  2120. - (5250 - 5330 @ 80), (3, 24), DFS
  2121. - (5490 - 5710 @ 80), (3, 24), DFS
  2122. - (5735 - 5835 @ 80), (3, 30)
  2123. -
  2124. -country BY:
  2125. - (2402 - 2482 @ 40), (N/A, 20)
  2126. - (5170 - 5250 @ 40), (N/A, 20)
  2127. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2128. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2129. -
  2130. -country BZ:
  2131. - (2402 - 2482 @ 40), (N/A, 30)
  2132. - (5735 - 5835 @ 40), (N/A, 30)
  2133. -
  2134. -country CA:
  2135. - (2402 - 2472 @ 40), (3, 27)
  2136. - (5170 - 5250 @ 80), (3, 17)
  2137. - (5250 - 5330 @ 80), (3, 24), DFS
  2138. - (5490 - 5710 @ 80), (3, 24), DFS
  2139. - (5735 - 5835 @ 80), (3, 30)
  2140. + (2402 - 2482 @ 40), (20)
  2141. + (5170 - 5250 @ 40), (18)
  2142. + (5250 - 5330 @ 40), (18), DFS
  2143. +
  2144. +country BN: DFS-JP
  2145. + (2402 - 2482 @ 40), (20)
  2146. + (5170 - 5250 @ 80), (20)
  2147. + (5250 - 5330 @ 80), (20), DFS
  2148. + (5735 - 5835 @ 80), (20)
  2149. +
  2150. +country BO: DFS-JP
  2151. + (2402 - 2482 @ 40), (30)
  2152. + (5735 - 5835 @ 80), (30)
  2153. +
  2154. +country BR: DFS-FCC
  2155. + (2402 - 2482 @ 40), (20)
  2156. + (5170 - 5250 @ 80), (17)
  2157. + (5250 - 5330 @ 80), (24), DFS
  2158. + (5490 - 5730 @ 80), (24), DFS
  2159. + (5735 - 5835 @ 80), (30)
  2160. +
  2161. +country BY: DFS-ETSI
  2162. + (2402 - 2482 @ 40), (20)
  2163. + (5170 - 5250 @ 80), (20)
  2164. + (5250 - 5330 @ 80), (20), DFS
  2165. + (5490 - 5710 @ 80), (27), DFS
  2166. +
  2167. +country BZ: DFS-JP
  2168. + (2402 - 2482 @ 40), (30)
  2169. + (5735 - 5835 @ 80), (30)
  2170. +
  2171. +country CA: DFS-FCC
  2172. + (2402 - 2472 @ 40), (30)
  2173. + (5170 - 5250 @ 80), (17)
  2174. + (5250 - 5330 @ 80), (24), DFS
  2175. + (5490 - 5730 @ 80), (24), DFS
  2176. + (5735 - 5835 @ 80), (30)
  2177. country CH: DFS-ETSI
  2178. - (2402 - 2482 @ 40), (N/A, 20)
  2179. - (5170 - 5250 @ 80), (N/A, 20)
  2180. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2181. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2182. - # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2183. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2184. -
  2185. -country CL:
  2186. - (2402 - 2482 @ 40), (N/A, 20)
  2187. - (5170 - 5250 @ 40), (N/A, 20)
  2188. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2189. - (5735 - 5835 @ 40), (N/A, 20)
  2190. -
  2191. -country CN:
  2192. - (2402 - 2482 @ 40), (N/A, 20)
  2193. - (5735 - 5835 @ 80), (N/A, 30)
  2194. + (2402 - 2482 @ 40), (20)
  2195. + (5170 - 5250 @ 80), (20)
  2196. + (5250 - 5330 @ 80), (20), DFS
  2197. + (5490 - 5710 @ 80), (27), DFS
  2198. + # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2199. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2200. +
  2201. +country CL: DFS-JP
  2202. + (2402 - 2482 @ 40), (20)
  2203. + (5170 - 5250 @ 80), (20)
  2204. + (5250 - 5330 @ 80), (20), DFS
  2205. + (5735 - 5835 @ 80), (20)
  2206. +
  2207. +country CN: DFS-FCC
  2208. + (2402 - 2482 @ 40), (20)
  2209. + (5170 - 5250 @ 80), (23)
  2210. + (5250 - 5330 @ 80), (23), DFS
  2211. + (5735 - 5835 @ 80), (30)
  2212. # 60 gHz band channels 1,4: 28dBm, channels 2,3: 44dBm
  2213. # ref: http://www.miit.gov.cn/n11293472/n11505629/n11506593/n11960250/n11960606/n11960700/n12330791.files/n12330790.pdf
  2214. - (57240 - 59400 @ 2160), (N/A, 28)
  2215. - (59400 - 63720 @ 2160), (N/A, 44)
  2216. - (63720 - 65880 @ 2160), (N/A, 28)
  2217. -
  2218. -country CO:
  2219. - (2402 - 2472 @ 40), (3, 27)
  2220. - (5170 - 5250 @ 80), (3, 17)
  2221. - (5250 - 5330 @ 80), (3, 24), DFS
  2222. - (5490 - 5710 @ 80), (3, 24), DFS
  2223. - (5735 - 5835 @ 80), (3, 30)
  2224. -
  2225. -country CR:
  2226. - (2402 - 2482 @ 40), (N/A, 20)
  2227. - (5170 - 5250 @ 80), (3, 17)
  2228. - (5250 - 5330 @ 80), (3, 24), DFS
  2229. - (5490 - 5710 @ 80), (3, 24), DFS
  2230. - (5735 - 5835 @ 80), (3, 30)
  2231. + (57240 - 59400 @ 2160), (28)
  2232. + (59400 - 63720 @ 2160), (44)
  2233. + (63720 - 65880 @ 2160), (28)
  2234. +
  2235. +country CO: DFS-FCC
  2236. + (2402 - 2482 @ 40), (20)
  2237. + (5170 - 5250 @ 80), (17)
  2238. + (5250 - 5330 @ 80), (24), DFS
  2239. + (5490 - 5730 @ 80), (24), DFS
  2240. + (5735 - 5835 @ 80), (30)
  2241. +
  2242. +country CR: DFS-FCC
  2243. + (2402 - 2482 @ 40), (20)
  2244. + (5170 - 5250 @ 80), (17)
  2245. + (5250 - 5330 @ 80), (24), DFS
  2246. + (5490 - 5730 @ 80), (24), DFS
  2247. + (5735 - 5835 @ 80), (30)
  2248. country CY: DFS-ETSI
  2249. - (2402 - 2482 @ 40), (N/A, 20)
  2250. - (5170 - 5250 @ 40), (N/A, 20)
  2251. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2252. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2253. + (2402 - 2482 @ 40), (20)
  2254. + (5170 - 5250 @ 80), (20)
  2255. + (5250 - 5330 @ 80), (20), DFS
  2256. + (5490 - 5710 @ 80), (27), DFS
  2257. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2258. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2259. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2260. # Data from http://www.ctu.eu/164/download/VOR/VOR-12-08-2005-34.pdf
  2261. # and http://www.ctu.eu/164/download/VOR/VOR-12-05-2007-6-AN.pdf
  2262. # Power at 5250 - 5350 MHz and 5470 - 5725 MHz can be doubled if TPC is
  2263. # implemented.
  2264. country CZ: DFS-ETSI
  2265. - (2400 - 2483.5 @ 40), (N/A, 100 mW)
  2266. - (5150 - 5250 @ 80), (N/A, 200 mW), NO-OUTDOOR
  2267. - (5250 - 5350 @ 80), (N/A, 100 mW), NO-OUTDOOR, DFS
  2268. - (5470 - 5725 @ 80), (N/A, 500 mW), DFS
  2269. + (2400 - 2483.5 @ 40), (100 mW)
  2270. + (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR
  2271. + (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR
  2272. + (5470 - 5725 @ 80), (500 mW), DFS
  2273. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2274. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2275. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2276. # Data from "Frequenznutzungsplan" (as published in April 2008), downloaded from
  2277. # http://www.bundesnetzagentur.de/cae/servlet/contentblob/38448/publicationFile/2659/Frequenznutzungsplan2008_Id17448pdf.pdf
  2278. @@ -221,542 +226,555 @@ country CZ: DFS-ETSI
  2279. country DE: DFS-ETSI
  2280. # entries 279004 and 280006
  2281. - (2400 - 2483.5 @ 40), (N/A, 100 mW)
  2282. - # entry 303005
  2283. - (5150 - 5250 @ 80), (N/A, 100 mW), NO-OUTDOOR
  2284. - # entries 304002 and 305002
  2285. - (5250 - 5350 @ 80), (N/A, 100 mW), NO-OUTDOOR, DFS
  2286. + (2400 - 2483.5 @ 40), (100 mW)
  2287. + # entry 303005, 304002 and 305002
  2288. + (5150 - 5350 @ 80), (100 mW), NO-OUTDOOR
  2289. # entries 308002, 309001 and 310003
  2290. - (5470 - 5725 @ 80), (N/A, 500 mW), DFS
  2291. + (5470 - 5725 @ 80), (500 mW), DFS
  2292. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2293. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2294. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2295. country DK: DFS-ETSI
  2296. - (2402 - 2482 @ 40), (N/A, 20)
  2297. - (5170 - 5250 @ 80), (N/A, 20)
  2298. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2299. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2300. - # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2301. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2302. -
  2303. -country DO:
  2304. - (2402 - 2472 @ 40), (3, 27)
  2305. - (5170 - 5250 @ 40), (3, 17)
  2306. - (5250 - 5330 @ 40), (3, 23), DFS
  2307. - (5735 - 5835 @ 40), (3, 30)
  2308. -
  2309. -country DZ:
  2310. - (2402 - 2482 @ 40), (N/A, 20)
  2311. -
  2312. -country EC:
  2313. - (2402 - 2482 @ 40), (N/A, 20)
  2314. - (5170 - 5250 @ 80), (3, 17)
  2315. - (5250 - 5330 @ 80), (3, 24), DFS
  2316. - (5490 - 5710 @ 80), (3, 24), DFS
  2317. - (5735 - 5835 @ 80), (3, 30)
  2318. + (2402 - 2482 @ 40), (20)
  2319. + (5170 - 5250 @ 80), (20)
  2320. + (5250 - 5330 @ 80), (20), DFS
  2321. + (5490 - 5710 @ 80), (27), DFS
  2322. + # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2323. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2324. +
  2325. +country DO: DFS-FCC
  2326. + (2402 - 2472 @ 40), (30)
  2327. + (5170 - 5250 @ 80), (17)
  2328. + (5250 - 5330 @ 80), (23), DFS
  2329. + (5735 - 5835 @ 80), (30)
  2330. +
  2331. +country DZ: DFS-JP
  2332. + (2402 - 2482 @ 40), (20)
  2333. + (5170.000 - 5250.000 @ 80.000), (23.00)
  2334. + (5250.000 - 5330.000 @ 80.000), (23.00), DFS
  2335. + (5490.000 - 5670.000 @ 80.000), (23.00), DFS
  2336. +
  2337. +country EC: DFS-FCC
  2338. + (2402 - 2482 @ 40), (20)
  2339. + (5170 - 5250 @ 80), (17)
  2340. + (5250 - 5330 @ 80), (24), DFS
  2341. + (5490 - 5730 @ 80), (24), DFS
  2342. + (5735 - 5835 @ 80), (30)
  2343. country EE: DFS-ETSI
  2344. - (2402 - 2482 @ 40), (N/A, 20)
  2345. - (5170 - 5250 @ 40), (N/A, 20)
  2346. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2347. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2348. + (2402 - 2482 @ 40), (20)
  2349. + (5170 - 5250 @ 80), (20)
  2350. + (5250 - 5330 @ 80), (20), DFS
  2351. + (5490 - 5710 @ 80), (27), DFS
  2352. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2353. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2354. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2355. -country EG:
  2356. - (2402 - 2482 @ 40), (N/A, 20)
  2357. - (5170 - 5250 @ 20), (N/A, 20)
  2358. - (5250 - 5330 @ 20), (N/A, 20), DFS
  2359. +country EG: DFS-ETSI
  2360. + (2402 - 2482 @ 40), (20)
  2361. + (5170 - 5250 @ 80), (20)
  2362. + (5250 - 5330 @ 80), (20), DFS
  2363. country ES: DFS-ETSI
  2364. - (2400 - 2483.5 @ 40), (N/A, 100 mW)
  2365. - (5150 - 5250 @ 80), (N/A, 100 mW), NO-OUTDOOR
  2366. - (5250 - 5350 @ 80), (N/A, 100 mW), NO-OUTDOOR, DFS
  2367. - (5470 - 5725 @ 80), (N/A, 500 mW), DFS
  2368. + (2400 - 2483.5 @ 40), (100 mW)
  2369. + (5150 - 5250 @ 80), (100 mW), NO-OUTDOOR
  2370. + (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR
  2371. + (5470 - 5725 @ 80), (500 mW), DFS
  2372. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2373. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2374. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2375. country FI: DFS-ETSI
  2376. - (2402 - 2482 @ 40), (N/A, 20)
  2377. - (5170 - 5250 @ 80), (N/A, 20)
  2378. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2379. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2380. + (2402 - 2482 @ 40), (20)
  2381. + (5170 - 5250 @ 80), (20)
  2382. + (5250 - 5330 @ 80), (20), DFS
  2383. + (5490 - 5710 @ 80), (27), DFS
  2384. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2385. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2386. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2387. country FR: DFS-ETSI
  2388. - (2402 - 2482 @ 40), (N/A, 20)
  2389. - (5170 - 5250 @ 80), (N/A, 20)
  2390. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2391. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2392. + (2402 - 2482 @ 40), (20)
  2393. + (5170 - 5250 @ 80), (20)
  2394. + (5250 - 5330 @ 80), (20), DFS
  2395. + (5490 - 5710 @ 80), (27), DFS
  2396. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2397. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2398. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2399. -country GE:
  2400. - (2402 - 2482 @ 40), (N/A, 20)
  2401. - (5170 - 5250 @ 40), (N/A, 18)
  2402. - (5250 - 5330 @ 40), (N/A, 18), DFS
  2403. +country GE: DFS-ETSI
  2404. + (2402 - 2482 @ 40), (20)
  2405. + (5170 - 5250 @ 80), (18)
  2406. + (5250 - 5330 @ 80), (18), DFS
  2407. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2408. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2409. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2410. country GB: DFS-ETSI
  2411. - (2402 - 2482 @ 40), (N/A, 20)
  2412. - (5170 - 5250 @ 80), (N/A, 20)
  2413. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2414. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2415. + (2402 - 2482 @ 40), (20)
  2416. + (5170 - 5250 @ 80), (20)
  2417. + (5250 - 5330 @ 80), (20), DFS
  2418. + (5490 - 5710 @ 80), (27), DFS
  2419. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2420. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2421. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2422. -country GD:
  2423. - (2402 - 2472 @ 40), (3, 27)
  2424. - (5170 - 5250 @ 40), (3, 17)
  2425. - (5250 - 5330 @ 40), (3, 20), DFS
  2426. - (5490 - 5710 @ 40), (3, 20), DFS
  2427. - (5735 - 5835 @ 40), (3, 30)
  2428. +country GD: DFS-FCC
  2429. + (2402 - 2472 @ 40), (30)
  2430. + (5170 - 5250 @ 80), (17)
  2431. + (5250 - 5330 @ 80), (24), DFS
  2432. + (5490 - 5730 @ 80), (24), DFS
  2433. + (5735 - 5835 @ 80), (30)
  2434. country GR: DFS-ETSI
  2435. - (2402 - 2482 @ 40), (N/A, 20)
  2436. - (5170 - 5250 @ 80), (N/A, 20)
  2437. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2438. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2439. + (2402 - 2482 @ 40), (20)
  2440. + (5170 - 5250 @ 80), (20)
  2441. + (5250 - 5330 @ 80), (20), DFS
  2442. + (5490 - 5710 @ 80), (27), DFS
  2443. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2444. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2445. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2446. country GL: DFS-ETSI
  2447. - (2402 - 2482 @ 40), (N/A, 20)
  2448. - (5170 - 5250 @ 20), (N/A, 20)
  2449. - (5250 - 5330 @ 20), (N/A, 20), DFS
  2450. - (5490 - 5710 @ 20), (N/A, 27), DFS
  2451. -
  2452. -country GT:
  2453. - (2402 - 2472 @ 40), (3, 27)
  2454. - (5170 - 5250 @ 40), (3, 17)
  2455. - (5250 - 5330 @ 40), (3, 23), DFS
  2456. - (5735 - 5835 @ 40), (3, 30)
  2457. -
  2458. -country GU:
  2459. - (2402 - 2472 @ 40), (3, 27)
  2460. - (5170 - 5250 @ 80), (3, 17)
  2461. - (5250 - 5330 @ 80), (3, 24), DFS
  2462. - (5490 - 5710 @ 80), (3, 24), DFS
  2463. - (5735 - 5835 @ 80), (3, 30)
  2464. -
  2465. -country HN:
  2466. - (2402 - 2482 @ 40), (N/A, 20)
  2467. - (5170 - 5250 @ 40), (3, 17)
  2468. - (5250 - 5330 @ 40), (3, 20), DFS
  2469. - (5490 - 5710 @ 40), (3, 20), DFS
  2470. - (5735 - 5835 @ 40), (3, 30)
  2471. + (2402 - 2482 @ 40), (20)
  2472. + (5170 - 5250 @ 80), (20)
  2473. + (5250 - 5330 @ 80), (20), DFS
  2474. + (5490 - 5710 @ 80), (27), DFS
  2475. +
  2476. +country GT: DFS-FCC
  2477. + (2402 - 2472 @ 40), (30)
  2478. + (5170 - 5250 @ 80), (17)
  2479. + (5250 - 5330 @ 80), (23), DFS
  2480. + (5735 - 5835 @ 80), (30)
  2481. +
  2482. +country GU: DFS-FCC
  2483. + (2402 - 2472 @ 40), (30)
  2484. + (5170 - 5250 @ 80), (17)
  2485. + (5250 - 5330 @ 80), (24), DFS
  2486. + (5490 - 5730 @ 80), (24), DFS
  2487. + (5735 - 5835 @ 80), (30)
  2488. +
  2489. +country HN: DFS-FCC
  2490. + (2402 - 2482 @ 40), (20)
  2491. + (5170 - 5250 @ 80), (17)
  2492. + (5250 - 5330 @ 80), (24), DFS
  2493. + (5490 - 5730 @ 80), (24), DFS
  2494. + (5735 - 5835 @ 80), (30)
  2495. country HK:
  2496. - (2402 - 2482 @ 40), (N/A, 20)
  2497. - (5170 - 5250 @ 80), (3, 17)
  2498. - (5250 - 5330 @ 80), (3, 24), DFS
  2499. - (5490 - 5710 @ 80), (3, 24), DFS
  2500. - (5735 - 5835 @ 80), (3, 30)
  2501. + (2402 - 2482 @ 40), (20)
  2502. + (5170 - 5250 @ 80), (17)
  2503. + (5250 - 5330 @ 80), (24), DFS
  2504. + (5490 - 5710 @ 80), (24), DFS
  2505. + (5735 - 5835 @ 80), (30)
  2506. country HR: DFS-ETSI
  2507. - (2402 - 2482 @ 40), (N/A, 20)
  2508. - (5170 - 5250 @ 40), (N/A, 20)
  2509. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2510. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2511. + (2402 - 2482 @ 40), (20)
  2512. + (5170 - 5250 @ 80), (20)
  2513. + (5250 - 5330 @ 80), (20), DFS
  2514. + (5490 - 5710 @ 80), (27), DFS
  2515. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2516. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2517. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2518. -country HT:
  2519. - (2402 - 2482 @ 40), (N/A, 20)
  2520. - (5170 - 5250 @ 40), (N/A, 20)
  2521. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2522. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2523. +country HT: DFS-ETSI
  2524. + (2402 - 2482 @ 40), (20)
  2525. + (5170 - 5250 @ 80), (20)
  2526. + (5250 - 5330 @ 80), (20), DFS
  2527. + (5490 - 5710 @ 80), (27), DFS
  2528. country HU: DFS-ETSI
  2529. - (2402 - 2482 @ 40), (N/A, 20)
  2530. - (5170 - 5250 @ 40), (N/A, 20)
  2531. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2532. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2533. + (2402 - 2482 @ 40), (20)
  2534. + (5170 - 5250 @ 80), (20)
  2535. + (5250 - 5330 @ 80), (20), DFS
  2536. + (5490 - 5710 @ 80), (27), DFS
  2537. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2538. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2539. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2540. -country ID:
  2541. +country ID: DFS-JP
  2542. # ref: http://www.postel.go.id/content/ID/regulasi/standardisasi/kepdir/bwa%205,8%20ghz.pdf
  2543. - (2402 - 2482 @ 40), (N/A, 20)
  2544. - (5735 - 5815 @ 80), (N/A, 20)
  2545. + (2402 - 2482 @ 40), (20)
  2546. + (5735 - 5815 @ 80), (23)
  2547. country IE: DFS-ETSI
  2548. - (2402 - 2482 @ 40), (N/A, 20)
  2549. - (5170 - 5250 @ 80), (N/A, 20)
  2550. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2551. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2552. + (2402 - 2482 @ 40), (20)
  2553. + (5170 - 5250 @ 80), (20)
  2554. + (5250 - 5330 @ 80), (20), DFS
  2555. + (5490 - 5710 @ 80), (27), DFS
  2556. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2557. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2558. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2559. -country IL:
  2560. - (2402 - 2482 @ 40), (N/A, 20)
  2561. - (5150 - 5250 @ 80), (N/A, 200 mW), NO-OUTDOOR
  2562. - (5250 - 5350 @ 80), (N/A, 200 mW), NO-OUTDOOR, DFS
  2563. +country IL: DFS-ETSI
  2564. + (2402 - 2482 @ 40), (20)
  2565. + (5150 - 5350 @ 80), (200 mW), NO-OUTDOOR
  2566. -country IN:
  2567. - (2402 - 2482 @ 40), (N/A, 20)
  2568. - (5170 - 5250 @ 40), (N/A, 20)
  2569. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2570. - (5735 - 5835 @ 40), (N/A, 20)
  2571. +country IN: DFS-JP
  2572. + (2402 - 2482 @ 40), (20)
  2573. + (5170 - 5250 @ 80), (20)
  2574. + (5250 - 5330 @ 80), (20), DFS
  2575. + (5735 - 5835 @ 80), (20)
  2576. country IS: DFS-ETSI
  2577. - (2402 - 2482 @ 40), (N/A, 20)
  2578. - (5170 - 5250 @ 40), (N/A, 20)
  2579. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2580. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2581. + (2402 - 2482 @ 40), (20)
  2582. + (5170 - 5250 @ 80), (20)
  2583. + (5250 - 5330 @ 80), (20), DFS
  2584. + (5490 - 5710 @ 80), (27), DFS
  2585. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2586. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2587. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2588. -country IR:
  2589. - (2402 - 2482 @ 40), (N/A, 20)
  2590. - (5735 - 5835 @ 40), (N/A, 30)
  2591. +country IR: DFS-JP
  2592. + (2402 - 2482 @ 40), (20)
  2593. + (5735 - 5835 @ 80), (30)
  2594. country IT: DFS-ETSI
  2595. - (2402 - 2482 @ 40), (N/A, 20)
  2596. - (5170 - 5250 @ 80), (N/A, 20)
  2597. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2598. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2599. - # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2600. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2601. -
  2602. -country JM:
  2603. - (2402 - 2482 @ 40), (N/A, 20)
  2604. - (5170 - 5250 @ 40), (3, 17)
  2605. - (5250 - 5330 @ 40), (3, 20), DFS
  2606. - (5490 - 5710 @ 40), (3, 20), DFS
  2607. - (5735 - 5835 @ 40), (3, 30)
  2608. -
  2609. -country JP:
  2610. - (2402 - 2482 @ 40), (N/A, 20)
  2611. - (2474 - 2494 @ 20), (N/A, 20), NO-OFDM
  2612. - (4910 - 4990 @ 40), (N/A, 23)
  2613. - (5030 - 5090 @ 40), (N/A, 23)
  2614. - (5170 - 5250 @ 80), (N/A, 20)
  2615. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2616. - (5490 - 5710 @ 160), (N/A, 23), DFS
  2617. -
  2618. -country JO:
  2619. - (2402 - 2482 @ 40), (N/A, 20)
  2620. - (5170 - 5250 @ 40), (N/A, 18)
  2621. -
  2622. -country KE:
  2623. - (2402 - 2482 @ 40), (N/A, 20)
  2624. - (5735 - 5835 @ 40), (N/A, 30)
  2625. -
  2626. -country KH:
  2627. - (2402 - 2482 @ 40), (N/A, 20)
  2628. - (5170 - 5250 @ 40), (N/A, 20)
  2629. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2630. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2631. -
  2632. -country KP:
  2633. - (2402 - 2482 @ 40), (N/A, 20)
  2634. - (5170 - 5330 @ 40), (3, 20)
  2635. - (5160 - 5250 @ 40), (3, 20), DFS
  2636. - (5490 - 5630 @ 40), (3, 30), DFS
  2637. - (5735 - 5815 @ 40), (3, 30)
  2638. -
  2639. -country KR:
  2640. - (2402 - 2482 @ 20), (N/A, 20)
  2641. - (5170 - 5250 @ 80), (3, 20)
  2642. - (5250 - 5330 @ 80), (3, 20), DFS
  2643. - (5490 - 5630 @ 80), (3, 30), DFS
  2644. - (5735 - 5815 @ 80), (3, 30)
  2645. -
  2646. -country KW:
  2647. - (2402 - 2482 @ 40), (N/A, 20)
  2648. - (5170 - 5250 @ 80), (N/A, 20)
  2649. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2650. + (2402 - 2482 @ 40), (20)
  2651. + (5170 - 5250 @ 80), (20)
  2652. + (5250 - 5330 @ 80), (20), DFS
  2653. + (5490 - 5710 @ 80), (27), DFS
  2654. + # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2655. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2656. +
  2657. +country JM: DFS-FCC
  2658. + (2402 - 2482 @ 40), (20)
  2659. + (5170 - 5250 @ 80), (17)
  2660. + (5250 - 5330 @ 80), (24), DFS
  2661. + (5490 - 5730 @ 80), (24), DFS
  2662. + (5735 - 5835 @ 80), (30)
  2663. +
  2664. +country JP: DFS-JP
  2665. + (2402 - 2482 @ 40), (20)
  2666. + (2474 - 2494 @ 20), (20), NO-OFDM
  2667. + (4910 - 4990 @ 40), (23)
  2668. + (5030 - 5090 @ 40), (23)
  2669. + (5170 - 5250 @ 80), (20)
  2670. + (5250 - 5330 @ 80), (20), DFS
  2671. + (5490 - 5710 @ 160), (23), DFS
  2672. +
  2673. +country JO: DFS-JP
  2674. + (2402 - 2482 @ 40), (20)
  2675. + (5170 - 5250 @ 80), (23)
  2676. + (5735 - 5835 @ 80), (23)
  2677. +
  2678. +country KE: DFS-JP
  2679. + (2402 - 2482 @ 40), (20)
  2680. + (5170 - 5250 @ 80), (23)
  2681. + (5490 - 5570 @ 80), (30), DFS
  2682. + (5735 - 5775 @ 40), (23)
  2683. +
  2684. +country KH: DFS-ETSI
  2685. + (2402 - 2482 @ 40), (20)
  2686. + (5170 - 5250 @ 80), (20)
  2687. + (5250 - 5330 @ 80), (20), DFS
  2688. + (5490 - 5710 @ 80), (27), DFS
  2689. +
  2690. +country KP: DFS-JP
  2691. + (2402 - 2482 @ 40), (20)
  2692. + (5170 - 5250 @ 80), (20)
  2693. + (5250 - 5330 @ 80), (20), DFS
  2694. + (5490 - 5630 @ 80), (30), DFS
  2695. + (5735 - 5815 @ 80), (30)
  2696. +
  2697. +country KR: DFS-JP
  2698. + (2402 - 2482 @ 20), (20)
  2699. + (2402 - 2482 @ 40), (20)
  2700. + (5170 - 5250 @ 80), (20)
  2701. + (5250 - 5330 @ 80), (20), DFS
  2702. + (5490 - 5710 @ 80), (30), DFS
  2703. + (5735 - 5815 @ 80), (30)
  2704. +
  2705. +country KW: DFS-ETSI
  2706. + (2402 - 2482 @ 40), (20)
  2707. + (5170 - 5250 @ 80), (20)
  2708. + (5250 - 5330 @ 80), (20), DFS
  2709. country KZ:
  2710. - (2402 - 2482 @ 40), (N/A, 20)
  2711. + (2402 - 2482 @ 40), (20)
  2712. -country LB:
  2713. - (2402 - 2482 @ 40), (N/A, 20)
  2714. - (5735 - 5835 @ 40), (N/A, 30)
  2715. +country LB: DFS-FCC
  2716. + (2402 - 2482 @ 40), (20)
  2717. + (5170 - 5250 @ 80), (17)
  2718. + (5250 - 5330 @ 80), (24), DFS
  2719. + (5490 - 5730 @ 80), (24), DFS
  2720. + (5735 - 5835 @ 80), (30)
  2721. country LI: DFS-ETSI
  2722. - (2402 - 2482 @ 40), (N/A, 20)
  2723. - (5170 - 5250 @ 40), (N/A, 20)
  2724. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2725. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2726. -
  2727. -country LK:
  2728. - (2402 - 2482 @ 40), (N/A, 20)
  2729. - (5170 - 5250 @ 20), (3, 17)
  2730. - (5250 - 5330 @ 20), (3, 20), DFS
  2731. - (5490 - 5710 @ 20), (3, 20), DFS
  2732. - (5735 - 5835 @ 20), (3, 30)
  2733. + (2402 - 2482 @ 40), (20)
  2734. + (5170 - 5250 @ 80), (20)
  2735. + (5250 - 5330 @ 80), (20), DFS
  2736. + (5490 - 5710 @ 80), (27), DFS
  2737. +
  2738. +country LK: DFS-FCC
  2739. + (2402 - 2482 @ 40), (20)
  2740. + (5170 - 5250 @ 80), (17)
  2741. + (5250 - 5330 @ 80), (24), DFS
  2742. + (5490 - 5730 @ 80), (24), DFS
  2743. + (5735 - 5835 @ 80), (30)
  2744. country LT: DFS-ETSI
  2745. - (2402 - 2482 @ 40), (N/A, 20)
  2746. - (5170 - 5250 @ 40), (N/A, 20)
  2747. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2748. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2749. + (2402 - 2482 @ 40), (20)
  2750. + (5170 - 5250 @ 80), (20)
  2751. + (5250 - 5330 @ 80), (20), DFS
  2752. + (5490 - 5710 @ 80), (27), DFS
  2753. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2754. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2755. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2756. country LU: DFS-ETSI
  2757. - (2402 - 2482 @ 40), (N/A, 20)
  2758. - (5170 - 5250 @ 80), (N/A, 20)
  2759. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2760. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2761. + (2402 - 2482 @ 40), (20)
  2762. + (5170 - 5250 @ 80), (20)
  2763. + (5250 - 5330 @ 80), (20), DFS
  2764. + (5490 - 5710 @ 80), (27), DFS
  2765. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2766. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2767. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2768. country LV: DFS-ETSI
  2769. - (2402 - 2482 @ 40), (N/A, 20)
  2770. - (5170 - 5250 @ 40), (N/A, 20)
  2771. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2772. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2773. + (2402 - 2482 @ 40), (20)
  2774. + (5170 - 5250 @ 80), (20)
  2775. + (5250 - 5330 @ 80), (20), DFS
  2776. + (5490 - 5710 @ 80), (27), DFS
  2777. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2778. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2779. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2780. country MC: DFS-ETSI
  2781. - (2402 - 2482 @ 40), (N/A, 20)
  2782. - (5170 - 5250 @ 40), (N/A, 18)
  2783. - (5250 - 5330 @ 40), (N/A, 18), DFS
  2784. + (2402 - 2482 @ 40), (20)
  2785. + (5170 - 5250 @ 80), (20)
  2786. + (5250 - 5330 @ 80), (20), DFS
  2787. + (5490 - 5710 @ 80), (27), DFS
  2788. -country MA:
  2789. - (2402 - 2482 @ 40), (N/A, 20)
  2790. - (5170 - 5250 @ 80), (N/A, 23)
  2791. - (5735 - 5835 @ 80), (N/A, 23)
  2792. +country MA: DFS-ETSI
  2793. + (2402 - 2482 @ 40), (20)
  2794. + (5170 - 5250 @ 80), (20)
  2795. + (5250 - 5330 @ 80), (20), DFS
  2796. country MO:
  2797. - (2402 - 2482 @ 40), (N/A, 20)
  2798. - (5170 - 5250 @ 40), (3, 23)
  2799. - (5250 - 5330 @ 40), (3, 23), DFS
  2800. - (5735 - 5835 @ 40), (3, 30)
  2801. + (2402 - 2482 @ 40), (20)
  2802. + (5170 - 5250 @ 40), (23)
  2803. + (5250 - 5330 @ 40), (23), DFS
  2804. + (5735 - 5835 @ 40), (30)
  2805. country MK: DFS-ETSI
  2806. - (2402 - 2482 @ 40), (N/A, 20)
  2807. - (5170 - 5250 @ 40), (N/A, 20)
  2808. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2809. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2810. + (2402 - 2482 @ 40), (20)
  2811. + (5170 - 5250 @ 80), (20)
  2812. + (5250 - 5330 @ 80), (20), DFS
  2813. + (5490 - 5710 @ 80), (27), DFS
  2814. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2815. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2816. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2817. country MT: DFS-ETSI
  2818. - (2402 - 2482 @ 40), (N/A, 20)
  2819. - (5170 - 5250 @ 40), (N/A, 20)
  2820. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2821. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2822. - # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2823. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2824. -
  2825. -country MY:
  2826. - (2402 - 2482 @ 40), (N/A, 20)
  2827. - (5170 - 5250 @ 80), (N/A, 17)
  2828. - (5250 - 5330 @ 80), (N/A, 23), DFS
  2829. - (5735 - 5835 @ 80), (N/A, 30)
  2830. -
  2831. -country MX:
  2832. - (2402 - 2472 @ 40), (3, 27)
  2833. - (5170 - 5250 @ 80), (3, 17)
  2834. - (5250 - 5330 @ 80), (3, 24), DFS
  2835. - (5490 - 5710 @ 80), (3, 24), DFS
  2836. - (5735 - 5835 @ 80), (3, 30)
  2837. + (2402 - 2482 @ 40), (20)
  2838. + (5170 - 5250 @ 80), (20)
  2839. + (5250 - 5330 @ 80), (20), DFS
  2840. + (5490 - 5710 @ 80), (27), DFS
  2841. + # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2842. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2843. +
  2844. +country MY: DFS-FCC
  2845. + (2402 - 2482 @ 40), (20)
  2846. + (5170 - 5250 @ 80), (17)
  2847. + (5250 - 5330 @ 80), (23), DFS
  2848. + (5735 - 5835 @ 80), (30)
  2849. +
  2850. +country MX: DFS-FCC
  2851. + (2402 - 2482 @ 40), (20)
  2852. + (5170 - 5250 @ 80), (17)
  2853. + (5250 - 5330 @ 80), (24), DFS
  2854. + (5490 - 5730 @ 80), (24), DFS
  2855. + (5735 - 5835 @ 80), (30)
  2856. country NL: DFS-ETSI
  2857. - (2402 - 2482 @ 40), (N/A, 20)
  2858. - (5170 - 5250 @ 80), (N/A, 20), NO-OUTDOOR
  2859. - (5250 - 5330 @ 80), (N/A, 20), NO-OUTDOOR, DFS
  2860. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2861. + (2402 - 2482 @ 40), (20)
  2862. + (5170 - 5330 @ 80), (20), NO-OUTDOOR
  2863. + (5490 - 5710 @ 80), (27), DFS
  2864. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2865. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2866. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2867. country NO: DFS-ETSI
  2868. - (2402 - 2482 @ 40), (N/A, 20)
  2869. - (5170 - 5250 @ 40), (N/A, 20)
  2870. - (5250 - 5330 @ 40), (N/A, 20), DFS
  2871. - (5490 - 5710 @ 40), (N/A, 27), DFS
  2872. - # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2873. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2874. -
  2875. -country NP:
  2876. - (2402 - 2482 @ 40), (N/A, 20)
  2877. - (5735 - 5835 @ 40), (N/A, 30)
  2878. -
  2879. -country NZ:
  2880. - (2402 - 2482 @ 40), (N/A, 30)
  2881. - (5170 - 5250 @ 80), (3, 17)
  2882. - (5250 - 5330 @ 80), (3, 24), DFS
  2883. - (5490 - 5710 @ 80), (3, 24), DFS
  2884. - (5735 - 5835 @ 80), (3, 30)
  2885. -
  2886. -country OM:
  2887. - (2402 - 2482 @ 40), (N/A, 20)
  2888. - (5170 - 5250 @ 40), (3, 17)
  2889. - (5250 - 5330 @ 40), (3, 20), DFS
  2890. - (5490 - 5710 @ 40), (3, 20), DFS
  2891. - (5735 - 5835 @ 40), (3, 30)
  2892. -
  2893. -country PA:
  2894. - (2402 - 2472 @ 40), (3, 27)
  2895. - (5170 - 5250 @ 40), (3, 17)
  2896. - (5250 - 5330 @ 40), (3, 23), DFS
  2897. - (5735 - 5835 @ 40), (3, 30)
  2898. -
  2899. -country PE:
  2900. - (2402 - 2482 @ 40), (N/A, 20)
  2901. - (5170 - 5250 @ 80), (3, 17)
  2902. - (5250 - 5330 @ 80), (3, 24), DFS
  2903. - (5490 - 5710 @ 80), (3, 24), DFS
  2904. - (5735 - 5835 @ 80), (3, 30)
  2905. -
  2906. -country PG:
  2907. - (2402 - 2482 @ 40), (N/A, 20)
  2908. - (5170 - 5250 @ 40), (3, 17)
  2909. - (5250 - 5330 @ 40), (3, 23), DFS
  2910. - (5735 - 5835 @ 40), (3, 30)
  2911. -
  2912. -country PH:
  2913. - (2402 - 2482 @ 40), (N/A, 20)
  2914. - (5170 - 5250 @ 80), (3, 17)
  2915. - (5250 - 5330 @ 80), (3, 24), DFS
  2916. - (5490 - 5710 @ 80), (3, 24), DFS
  2917. - (5735 - 5835 @ 80), (3, 30)
  2918. -
  2919. -country PK:
  2920. - (2402 - 2482 @ 40), (N/A, 20)
  2921. - (5735 - 5835 @ 40), (N/A, 30)
  2922. + (2402 - 2482 @ 40), (20)
  2923. + (5170 - 5250 @ 80), (20)
  2924. + (5250 - 5330 @ 80), (20), DFS
  2925. + (5490 - 5710 @ 80), (27), DFS
  2926. + # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2927. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2928. +
  2929. +country NP: DFS-JP
  2930. + (2402 - 2482 @ 40), (20)
  2931. + (5170 - 5250 @ 80), (20)
  2932. + (5250 - 5330 @ 80), (20), DFS
  2933. + (5735 - 5835 @ 80), (20)
  2934. +
  2935. +country NZ: DFS-FCC
  2936. + (2402 - 2482 @ 40), (30)
  2937. + (5170 - 5250 @ 80), (17)
  2938. + (5250 - 5330 @ 80), (24), DFS
  2939. + (5490 - 5730 @ 80), (24), DFS
  2940. + (5735 - 5835 @ 80), (30)
  2941. +
  2942. +country OM: DFS-ETSI
  2943. + (2402 - 2482 @ 40), (20)
  2944. + (5170 - 5250 @ 80), (20)
  2945. + (5250 - 5330 @ 80), (20), DFS
  2946. + (5490 - 5710 @ 80), (27), DFS
  2947. +
  2948. +country PA: DFS-FCC
  2949. + (2402 - 2472 @ 40), (30)
  2950. + (5170 - 5250 @ 80), (17)
  2951. + (5250 - 5330 @ 80), (23), DFS
  2952. + (5735 - 5835 @ 80), (30)
  2953. +
  2954. +country PE: DFS-FCC
  2955. + (2402 - 2482 @ 40), (20)
  2956. + (5170 - 5250 @ 80), (17)
  2957. + (5250 - 5330 @ 80), (24), DFS
  2958. + (5490 - 5730 @ 80), (24), DFS
  2959. + (5735 - 5835 @ 80), (30)
  2960. +
  2961. +country PG: DFS-FCC
  2962. + (2402 - 2482 @ 40), (20)
  2963. + (5170 - 5250 @ 80), (17)
  2964. + (5250 - 5330 @ 80), (24), DFS
  2965. + (5490 - 5730 @ 80), (24), DFS
  2966. + (5735 - 5835 @ 80), (30)
  2967. +
  2968. +country PH: DFS-FCC
  2969. + (2402 - 2482 @ 40), (20)
  2970. + (5170 - 5250 @ 80), (17)
  2971. + (5250 - 5330 @ 80), (24), DFS
  2972. + (5490 - 5730 @ 80), (24), DFS
  2973. + (5735 - 5835 @ 80), (30)
  2974. +
  2975. +country PK: DFS-JP
  2976. + (2402 - 2482 @ 40), (20)
  2977. + (5735 - 5835 @ 80), (30)
  2978. country PL: DFS-ETSI
  2979. - (2402 - 2482 @ 40), (N/A, 20)
  2980. - (5170 - 5250 @ 80), (N/A, 20)
  2981. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2982. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2983. + (2402 - 2482 @ 40), (20)
  2984. + (5170 - 5250 @ 80), (20)
  2985. + (5250 - 5330 @ 80), (20), DFS
  2986. + (5490 - 5710 @ 80), (27), DFS
  2987. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  2988. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  2989. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  2990. country PT: DFS-ETSI
  2991. - (2402 - 2482 @ 40), (N/A, 20)
  2992. - (5170 - 5250 @ 80), (N/A, 20)
  2993. - (5250 - 5330 @ 80), (N/A, 20), DFS
  2994. - (5490 - 5710 @ 80), (N/A, 27), DFS
  2995. + (2402 - 2482 @ 40), (20)
  2996. + (5170 - 5250 @ 80), (20)
  2997. + (5250 - 5330 @ 80), (20), DFS
  2998. + (5490 - 5710 @ 80), (27), DFS
  2999. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  3000. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  3001. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  3002. -country PR:
  3003. - (2402 - 2472 @ 40), (3, 27)
  3004. - (5170 - 5250 @ 80), (3, 17)
  3005. - (5250 - 5330 @ 80), (3, 24), DFS
  3006. - (5490 - 5710 @ 80), (3, 24), DFS
  3007. - (5735 - 5835 @ 80), (3, 30)
  3008. +country PR: DFS-FCC
  3009. + (2402 - 2472 @ 40), (30)
  3010. + (5170 - 5250 @ 80), (17)
  3011. + (5250 - 5330 @ 80), (24), DFS
  3012. + (5490 - 5730 @ 80), (24), DFS
  3013. + (5735 - 5835 @ 80), (30)
  3014. -country QA:
  3015. - (2402 - 2482 @ 40), (N/A, 20)
  3016. - (5735 - 5835 @ 40), (N/A, 30)
  3017. +country QA: DFS-JP
  3018. + (2402 - 2482 @ 40), (20)
  3019. + (5735 - 5835 @ 80), (30)
  3020. country RO: DFS-ETSI
  3021. - (2402 - 2482 @ 40), (N/A, 20)
  3022. - (5170 - 5250 @ 40), (N/A, 20)
  3023. - (5250 - 5330 @ 40), (N/A, 20), DFS
  3024. - (5490 - 5710 @ 40), (N/A, 27), DFS
  3025. + (2402 - 2482 @ 40), (20)
  3026. + (5170 - 5250 @ 80), (20)
  3027. + (5250 - 5330 @ 80), (20), DFS
  3028. + (5490 - 5710 @ 80), (27), DFS
  3029. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  3030. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  3031. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  3032. # Source:
  3033. # http://www.ratel.rs/upload/documents/Plan_namene/Plan_namene-sl_glasnik.pdf
  3034. -country RS:
  3035. - (2400 - 2483.5 @ 40), (N/A, 100 mW)
  3036. - (5150 - 5350 @ 40), (N/A, 200 mW), NO-OUTDOOR
  3037. - (5470 - 5725 @ 20), (3, 1000 mW), DFS
  3038. - # 60 gHz band channels 1-4, ref: Etsi En 302 567
  3039. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  3040. -
  3041. -country RU:
  3042. - (2402 - 2482 @ 40), (N/A, 20)
  3043. - (5170 - 5330 @ 40), (N/A, 20)
  3044. - (5650 - 5710 @ 40), (N/A, 30)
  3045. - (5735 - 5835 @ 40), (N/A, 30)
  3046. -
  3047. -country RW:
  3048. - (2402 - 2482 @ 40), (N/A, 20)
  3049. - (5735 - 5835 @ 40), (N/A, 30)
  3050. -
  3051. -country SA:
  3052. - (2402 - 2482 @ 40), (N/A, 20)
  3053. - (5170 - 5250 @ 80), (3, 17)
  3054. - (5250 - 5330 @ 80), (3, 24), DFS
  3055. - (5490 - 5710 @ 80), (3, 24), DFS
  3056. - (5735 - 5835 @ 80), (3, 30)
  3057. +country RS: DFS-ETSI
  3058. + (2400 - 2483.5 @ 40), (100 mW)
  3059. + (5150 - 5350 @ 40), (200 mW), NO-OUTDOOR
  3060. + (5470 - 5725 @ 20), (1000 mW), DFS
  3061. + # 60 gHz band channels 1-4, ref: Etsi En 302 567
  3062. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  3063. +
  3064. +country RU: DFS-ETSI
  3065. + (2402 - 2482 @ 40), (20)
  3066. + (5170 - 5250 @ 80), (20)
  3067. + (5250 - 5330 @ 80), (20), DFS
  3068. + (5650 - 5730 @ 80), (30), DFS
  3069. + (5735 - 5835 @ 80), (30)
  3070. +
  3071. +country RW: DFS-FCC
  3072. + (2402 - 2482 @ 40), (20)
  3073. + (5170 - 5250 @ 80), (17)
  3074. + (5250 - 5330 @ 80), (24), DFS
  3075. + (5490 - 5730 @ 80), (24), DFS
  3076. + (5735 - 5835 @ 80), (30)
  3077. +
  3078. +country SA: DFS-ETSI
  3079. + (2402 - 2482 @ 40), (20)
  3080. + (5170 - 5250 @ 80), (20)
  3081. + (5250 - 5330 @ 80), (20), DFS
  3082. + (5490 - 5710 @ 80), (27), DFS
  3083. country SE: DFS-ETSI
  3084. - (2402 - 2482 @ 40), (N/A, 20)
  3085. - (5170 - 5250 @ 80), (N/A, 20)
  3086. - (5250 - 5330 @ 80), (N/A, 20), DFS
  3087. - (5490 - 5710 @ 80), (N/A, 27), DFS
  3088. + (2402 - 2482 @ 40), (20)
  3089. + (5170 - 5250 @ 80), (20)
  3090. + (5250 - 5330 @ 80), (20), DFS
  3091. + (5490 - 5710 @ 80), (27), DFS
  3092. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  3093. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  3094. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  3095. -country SG:
  3096. - (2402 - 2482 @ 40), (N/A, 20)
  3097. - (5170 - 5250 @ 80), (3, 17)
  3098. - (5250 - 5330 @ 80), (3, 24), DFS
  3099. - (5490 - 5710 @ 80), (3, 24), DFS
  3100. - (5735 - 5835 @ 80), (3, 30)
  3101. +country SG: DFS-FCC
  3102. + (2402 - 2482 @ 40), (20)
  3103. + (5170 - 5250 @ 80), (17)
  3104. + (5250 - 5330 @ 80), (24), DFS
  3105. + (5490 - 5730 @ 80), (24), DFS
  3106. + (5735 - 5835 @ 80), (30)
  3107. country SI: DFS-ETSI
  3108. - (2402 - 2482 @ 40), (N/A, 20)
  3109. - (5170 - 5250 @ 40), (N/A, 20)
  3110. - (5250 - 5330 @ 40), (N/A, 20), DFS
  3111. - (5490 - 5710 @ 40), (N/A, 27), DFS
  3112. + (2402 - 2482 @ 40), (20)
  3113. + (5170 - 5250 @ 80), (20)
  3114. + (5250 - 5330 @ 80), (20), DFS
  3115. + (5490 - 5710 @ 80), (27), DFS
  3116. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  3117. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  3118. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  3119. country SK: DFS-ETSI
  3120. - (2402 - 2482 @ 40), (N/A, 20)
  3121. - (5170 - 5250 @ 80), (N/A, 20)
  3122. - (5250 - 5330 @ 80), (N/A, 20), DFS
  3123. - (5490 - 5710 @ 80), (N/A, 27), DFS
  3124. + (2402 - 2482 @ 40), (20)
  3125. + (5170 - 5250 @ 80), (20)
  3126. + (5250 - 5330 @ 80), (20), DFS
  3127. + (5490 - 5710 @ 80), (27), DFS
  3128. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  3129. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  3130. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  3131. -country SV:
  3132. - (2402 - 2482 @ 40), (N/A, 20)
  3133. - (5170 - 5250 @ 20), (3, 17)
  3134. - (5250 - 5330 @ 20), (3, 23), DFS
  3135. - (5735 - 5835 @ 20), (3, 30)
  3136. +country SV: DFS-FCC
  3137. + (2402 - 2482 @ 40), (20)
  3138. + (5170 - 5250 @ 80), (17)
  3139. + (5250 - 5330 @ 80), (23), DFS
  3140. + (5735 - 5835 @ 80), (30)
  3141. country SY:
  3142. - (2402 - 2482 @ 40), (N/A, 20)
  3143. -
  3144. -country TW:
  3145. - (2402 - 2472 @ 40), (3, 27)
  3146. - (5270 - 5330 @ 40), (3, 17), DFS
  3147. - (5490 - 5710 @ 80), (3, 30), DFS
  3148. - (5735 - 5815 @ 80), (3, 30)
  3149. -
  3150. -country TH:
  3151. - (2402 - 2482 @ 40), (N/A, 20)
  3152. - (5170 - 5250 @ 80), (3, 17)
  3153. - (5250 - 5330 @ 80), (3, 24), DFS
  3154. - (5490 - 5710 @ 80), (3, 24), DFS
  3155. - (5735 - 5835 @ 80), (3, 30)
  3156. -
  3157. -country TT:
  3158. - (2402 - 2482 @ 40), (N/A, 20)
  3159. - (5170 - 5250 @ 40), (3, 17)
  3160. - (5250 - 5330 @ 40), (3, 20), DFS
  3161. - (5490 - 5710 @ 40), (3, 20), DFS
  3162. - (5735 - 5835 @ 40), (3, 30)
  3163. -
  3164. -country TN:
  3165. - (2402 - 2482 @ 40), (N/A, 20)
  3166. - (5170 - 5250 @ 20), (N/A, 20)
  3167. - (5250 - 5330 @ 20), (N/A, 20), DFS
  3168. + (2402 - 2482 @ 40), (20)
  3169. +
  3170. +country TW: DFS-JP
  3171. + (2402 - 2472 @ 40), (30)
  3172. + (5270 - 5330 @ 40), (17), DFS
  3173. + (5490 - 5590 @ 80), (30), DFS
  3174. + (5650 - 5710 @ 40), (30), DFS
  3175. + (5735 - 5835 @ 80), (30)
  3176. +
  3177. +country TH: DFS-FCC
  3178. + (2402 - 2482 @ 40), (20)
  3179. + (5170 - 5250 @ 80), (17)
  3180. + (5250 - 5330 @ 80), (24), DFS
  3181. + (5490 - 5730 @ 80), (24), DFS
  3182. + (5735 - 5835 @ 80), (30)
  3183. +
  3184. +country TT: DFS-FCC
  3185. + (2402 - 2482 @ 40), (20)
  3186. + (5170 - 5250 @ 80), (17)
  3187. + (5250 - 5330 @ 80), (24), DFS
  3188. + (5490 - 5730 @ 80), (24), DFS
  3189. + (5735 - 5835 @ 80), (30)
  3190. +
  3191. +country TN: DFS-ETSI
  3192. + (2402 - 2482 @ 40), (20)
  3193. + (5170 - 5250 @ 80), (20)
  3194. + (5250 - 5330 @ 80), (20), DFS
  3195. country TR: DFS-ETSI
  3196. - (2402 - 2482 @ 40), (N/A, 20)
  3197. - (5170 - 5250 @ 80), (N/A, 20)
  3198. - (5250 - 5330 @ 80), (N/A, 20), DFS
  3199. - (5490 - 5710 @ 80), (N/A, 27), DFS
  3200. + (2402 - 2482 @ 40), (20)
  3201. + (5170 - 5250 @ 80), (20)
  3202. + (5250 - 5330 @ 80), (20), DFS
  3203. + (5490 - 5710 @ 80), (27), DFS
  3204. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  3205. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  3206. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  3207. # Source:
  3208. # #914 / 06 Sep 2007: http://www.ucrf.gov.ua/uk/doc/nkrz/1196068874
  3209. @@ -765,59 +783,63 @@ country TR: DFS-ETSI
  3210. # Listed 5GHz range is a lowest common denominator for all related
  3211. # rules in the referenced laws. Such a range is used because of
  3212. # disputable definitions there.
  3213. -country UA:
  3214. - (2400 - 2483.5 @ 40), (N/A, 20), NO-OUTDOOR
  3215. - (5150 - 5350 @ 40), (N/A, 20), NO-OUTDOOR
  3216. +country UA: DFS-ETSI
  3217. + (2400 - 2483.5 @ 40), (20), NO-OUTDOOR
  3218. + (5150 - 5350 @ 40), (20), NO-OUTDOOR
  3219. + (5490 - 5670 @ 80), (20), DFS
  3220. + (5735 - 5835 @ 80), (20)
  3221. # 60 gHz band channels 1-4, ref: Etsi En 302 567
  3222. - (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
  3223. + (57240 - 65880 @ 2160), (40), NO-OUTDOOR
  3224. country US: DFS-FCC
  3225. - (2402 - 2472 @ 40), (3, 27)
  3226. - (5170 - 5250 @ 80), (3, 17)
  3227. - (5250 - 5330 @ 80), (3, 24), DFS
  3228. - (5490 - 5600 @ 80), (3, 24), DFS
  3229. - (5650 - 5710 @ 40), (3, 24), DFS
  3230. - (5735 - 5835 @ 80), (3, 30)
  3231. + (2402 - 2472 @ 40), (30)
  3232. + (5170 - 5250 @ 80), (17)
  3233. + (5250 - 5330 @ 80), (23), DFS
  3234. + (5735 - 5835 @ 80), (30)
  3235. # 60g band
  3236. # reference: http://cfr.regstoday.com/47cfr15.aspx#47_CFR_15p255
  3237. # channels 1,2,3, EIRP=40dBm(43dBm peak)
  3238. - (57240 - 63720 @ 2160), (N/A, 40)
  3239. -
  3240. -country UY:
  3241. - (2402 - 2482 @ 40), (N/A, 20)
  3242. - (5170 - 5250 @ 40), (3, 17)
  3243. - (5250 - 5330 @ 40), (3, 20), DFS
  3244. - (5490 - 5710 @ 40), (3, 20), DFS
  3245. - (5735 - 5835 @ 40), (3, 30)
  3246. -
  3247. -country UZ:
  3248. - (2402 - 2472 @ 40), (3, 27)
  3249. - (5170 - 5250 @ 40), (3, 17)
  3250. - (5250 - 5330 @ 40), (3, 20), DFS
  3251. - (5490 - 5710 @ 40), (3, 20), DFS
  3252. - (5735 - 5835 @ 40), (3, 30)
  3253. -
  3254. -country VE:
  3255. - (2402 - 2482 @ 40), (N/A, 20)
  3256. - (5735 - 5815 @ 40), (N/A, 23)
  3257. -
  3258. -country VN:
  3259. - (2402 - 2482 @ 40), (N/A, 20)
  3260. - (5170 - 5250 @ 80), (3, 17)
  3261. - (5250 - 5330 @ 80), (3, 24), DFS
  3262. - (5490 - 5710 @ 80), (3, 24), DFS
  3263. - (5735 - 5835 @ 80), (3, 30)
  3264. + (57240 - 63720 @ 2160), (40)
  3265. +
  3266. +country UY: DFS-FCC
  3267. + (2402 - 2482 @ 40), (20)
  3268. + (5170 - 5250 @ 80), (17)
  3269. + (5250 - 5330 @ 80), (24), DFS
  3270. + (5490 - 5730 @ 80), (24), DFS
  3271. + (5735 - 5835 @ 80), (30)
  3272. +
  3273. +country UZ: DFS-FCC
  3274. + (2402 - 2472 @ 40), (30)
  3275. + (5170 - 5250 @ 80), (17)
  3276. + (5250 - 5330 @ 80), (24), DFS
  3277. + (5490 - 5730 @ 80), (24), DFS
  3278. + (5735 - 5835 @ 80), (30)
  3279. +
  3280. +country VE: DFS-FCC
  3281. + (2402 - 2482 @ 40), (20)
  3282. + (5170 - 5250 @ 80), (17)
  3283. + (5250 - 5330 @ 80), (23), DFS
  3284. + (5735 - 5835 @ 80), (30)
  3285. +
  3286. +country VN: DFS-FCC
  3287. + (2402 - 2482 @ 40), (20)
  3288. + (5170 - 5250 @ 80), (17)
  3289. + (5250 - 5330 @ 80), (24), DFS
  3290. + (5490 - 5730 @ 80), (24), DFS
  3291. + (5735 - 5835 @ 80), (30)
  3292. country YE:
  3293. - (2402 - 2482 @ 40), (N/A, 20)
  3294. -
  3295. -country ZA:
  3296. - (2402 - 2482 @ 40), (N/A, 20)
  3297. - (5170 - 5250 @ 80), (3, 17)
  3298. - (5250 - 5330 @ 80), (3, 24), DFS
  3299. - (5490 - 5710 @ 80), (3, 24), DFS
  3300. - (5735 - 5835 @ 80), (3, 30)
  3301. -
  3302. -country ZW:
  3303. - (2402 - 2482 @ 40), (N/A, 20)
  3304. + (2402 - 2482 @ 40), (20)
  3305. +
  3306. +country ZA: DFS-ETSI
  3307. + (2402 - 2482 @ 40), (20)
  3308. + (5170 - 5250 @ 80), (20)
  3309. + (5250 - 5330 @ 80), (20), DFS
  3310. + (5490 - 5710 @ 80), (27), DFS
  3311. +
  3312. +country ZW: DFS-ETSI
  3313. + (2402 - 2482 @ 40), (20)
  3314. + (5170 - 5250 @ 80), (20)
  3315. + (5250 - 5330 @ 80), (20), DFS
  3316. + (5490 - 5710 @ 80), (27), DFS
  3317. diff --git a/package/mac80211/patches/004-backports-add-led_trigger_blink-_oneshot.patch b/package/mac80211/patches/004-backports-add-led_trigger_blink-_oneshot.patch
  3318. index 584fb05..8d97224 100644
  3319. --- a/package/mac80211/patches/004-backports-add-led_trigger_blink-_oneshot.patch
  3320. +++ b/package/mac80211/patches/004-backports-add-led_trigger_blink-_oneshot.patch
  3321. @@ -18,8 +18,8 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  3322. --- a/backport-include/backport/leds-disabled.h
  3323. +++ b/backport-include/backport/leds-disabled.h
  3324. -@@ -163,6 +163,19 @@ static inline void led_trigger_event(str
  3325. - enum led_brightness event)
  3326. +@@ -176,6 +176,19 @@ static inline void led_trigger_blink_one
  3327. + int invert)
  3328. {
  3329. }
  3330. +
  3331. diff --git a/package/mac80211/patches/005-make-genregdb.awk-skip-antenna-gain.patch b/package/mac80211/patches/005-make-genregdb.awk-skip-antenna-gain.patch
  3332. new file mode 100644
  3333. index 0000000..55bffbc
  3334. --- /dev/null
  3335. +++ b/package/mac80211/patches/005-make-genregdb.awk-skip-antenna-gain.patch
  3336. @@ -0,0 +1,44 @@
  3337. +From: Luis R. Rodriguez <mcgrof@do-not-panic.com>
  3338. +Date: Wed, 23 Oct 2013 14:55:36 -0400
  3339. +Subject: [RFC] cfg80211: make genregdb.awk skip antenna gain
  3340. +
  3341. +Now that wireless-regdb doesn't include
  3342. +antenna gain lets skip parsing it completely
  3343. +for when CONFIG_CFG80211_INTERNAL_REGDB is
  3344. +enabled.
  3345. +
  3346. +Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
  3347. +---
  3348. + net/wireless/genregdb.awk | 11 ++++-------
  3349. + 1 file changed, 4 insertions(+), 7 deletions(-)
  3350. + mode change 100644 => 100755 net/wireless/genregdb.awk
  3351. +
  3352. +--- a/net/wireless/genregdb.awk
  3353. ++++ b/net/wireless/genregdb.awk
  3354. +@@ -56,14 +56,11 @@ function parse_reg_rule()
  3355. + end = $3
  3356. + bw = $5
  3357. + sub(/\),/, "", bw)
  3358. +- gain = $6
  3359. +- sub(/\(/, "", gain)
  3360. +- sub(/,/, "", gain)
  3361. +- power = $7
  3362. +- sub(/\)/, "", power)
  3363. ++ power = $6
  3364. ++ sub(/\(/, "", power)
  3365. + sub(/,/, "", power)
  3366. + # power might be in mW...
  3367. +- units = $8
  3368. ++ units = $7
  3369. + sub(/\)/, "", units)
  3370. + sub(/,/, "", units)
  3371. + dfs_cac = $9
  3372. +@@ -86,7 +83,7 @@ function parse_reg_rule()
  3373. + sub(/\(/, "", dfs_cac)
  3374. + sub(/\)/, "", dfs_cac)
  3375. + flagstr = ""
  3376. +- for (i=8; i<=NF; i++)
  3377. ++ for (i=7; i<=NF; i++)
  3378. + flagstr = flagstr $i
  3379. + split(flagstr, flagarray, ",")
  3380. + flags = ""
  3381. diff --git a/package/mac80211/patches/060-no_local_ssb_bcma.patch b/package/mac80211/patches/060-no_local_ssb_bcma.patch
  3382. index f4b9470..95f14f4 100644
  3383. --- a/package/mac80211/patches/060-no_local_ssb_bcma.patch
  3384. +++ b/package/mac80211/patches/060-no_local_ssb_bcma.patch
  3385. @@ -1,6 +1,6 @@
  3386. --- a/.local-symbols
  3387. +++ b/.local-symbols
  3388. -@@ -379,42 +379,6 @@ USB_CDC_PHONET=
  3389. +@@ -402,42 +402,6 @@ USB_CDC_PHONET=
  3390. USB_IPHETH=
  3391. USB_SIERRA_NET=
  3392. USB_VL600=
  3393. diff --git a/package/mac80211/patches/070-add-missing-header.patch b/package/mac80211/patches/070-add-missing-header.patch
  3394. new file mode 100644
  3395. index 0000000..9307804
  3396. --- /dev/null
  3397. +++ b/package/mac80211/patches/070-add-missing-header.patch
  3398. @@ -0,0 +1,10 @@
  3399. +--- a/compat/backport-3.15.c
  3400. ++++ b/compat/backport-3.15.c
  3401. +@@ -11,6 +11,7 @@
  3402. + #include <linux/kernel.h>
  3403. + #include <linux/device.h>
  3404. + #include <linux/of.h>
  3405. ++#include <linux/string.h>
  3406. +
  3407. + /**
  3408. + * devm_kstrdup - Allocate resource managed space and
  3409. diff --git a/package/mac80211/patches/100-revert_aes_ccm_port.patch b/package/mac80211/patches/100-revert_aes_ccm_port.patch
  3410. index 4654bc8..ac7d6b3 100644
  3411. --- a/package/mac80211/patches/100-revert_aes_ccm_port.patch
  3412. +++ b/package/mac80211/patches/100-revert_aes_ccm_port.patch
  3413. @@ -1,3 +1,104 @@
  3414. +--- a/net/mac80211/wpa.c
  3415. ++++ b/net/mac80211/wpa.c
  3416. +@@ -301,15 +301,22 @@ ieee80211_crypto_tkip_decrypt(struct iee
  3417. + }
  3418. +
  3419. +
  3420. +-static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad)
  3421. ++static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *scratch,
  3422. ++ int encrypted)
  3423. + {
  3424. + __le16 mask_fc;
  3425. + int a4_included, mgmt;
  3426. + u8 qos_tid;
  3427. +- u16 len_a;
  3428. ++ u8 *b_0, *aad;
  3429. ++ u16 data_len, len_a;
  3430. + unsigned int hdrlen;
  3431. + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
  3432. +
  3433. ++ memset(scratch, 0, 6 * AES_BLOCK_SIZE);
  3434. ++
  3435. ++ b_0 = scratch + 3 * AES_BLOCK_SIZE;
  3436. ++ aad = scratch + 4 * AES_BLOCK_SIZE;
  3437. ++
  3438. + /*
  3439. + * Mask FC: zero subtype b4 b5 b6 (if not mgmt)
  3440. + * Retry, PwrMgt, MoreData; set Protected
  3441. +@@ -331,21 +338,20 @@ static void ccmp_special_blocks(struct s
  3442. + else
  3443. + qos_tid = 0;
  3444. +
  3445. +- /* In CCM, the initial vectors (IV) used for CTR mode encryption and CBC
  3446. +- * mode authentication are not allowed to collide, yet both are derived
  3447. +- * from this vector b_0. We only set L := 1 here to indicate that the
  3448. +- * data size can be represented in (L+1) bytes. The CCM layer will take
  3449. +- * care of storing the data length in the top (L+1) bytes and setting
  3450. +- * and clearing the other bits as is required to derive the two IVs.
  3451. +- */
  3452. +- b_0[0] = 0x1;
  3453. ++ data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN;
  3454. ++ if (encrypted)
  3455. ++ data_len -= IEEE80211_CCMP_MIC_LEN;
  3456. +
  3457. ++ /* First block, b_0 */
  3458. ++ b_0[0] = 0x59; /* flags: Adata: 1, M: 011, L: 001 */
  3459. + /* Nonce: Nonce Flags | A2 | PN
  3460. + * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7)
  3461. + */
  3462. + b_0[1] = qos_tid | (mgmt << 4);
  3463. + memcpy(&b_0[2], hdr->addr2, ETH_ALEN);
  3464. + memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN);
  3465. ++ /* l(m) */
  3466. ++ put_unaligned_be16(data_len, &b_0[14]);
  3467. +
  3468. + /* AAD (extra authenticate-only data) / masked 802.11 header
  3469. + * FC | A1 | A2 | A3 | SC | [A4] | [QC] */
  3470. +@@ -401,8 +407,7 @@ static int ccmp_encrypt_skb(struct ieee8
  3471. + u8 *pos;
  3472. + u8 pn[6];
  3473. + u64 pn64;
  3474. +- u8 aad[2 * AES_BLOCK_SIZE];
  3475. +- u8 b_0[AES_BLOCK_SIZE];
  3476. ++ u8 scratch[6 * AES_BLOCK_SIZE];
  3477. +
  3478. + if (info->control.hw_key &&
  3479. + !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) &&
  3480. +@@ -455,9 +460,9 @@ static int ccmp_encrypt_skb(struct ieee8
  3481. + return 0;
  3482. +
  3483. + pos += IEEE80211_CCMP_HDR_LEN;
  3484. +- ccmp_special_blocks(skb, pn, b_0, aad);
  3485. +- ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len,
  3486. +- skb_put(skb, IEEE80211_CCMP_MIC_LEN));
  3487. ++ ccmp_special_blocks(skb, pn, scratch, 0);
  3488. ++ ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, scratch, pos, len,
  3489. ++ pos, skb_put(skb, IEEE80211_CCMP_MIC_LEN));
  3490. +
  3491. + return 0;
  3492. + }
  3493. +@@ -520,16 +525,16 @@ ieee80211_crypto_ccmp_decrypt(struct iee
  3494. + }
  3495. +
  3496. + if (!(status->flag & RX_FLAG_DECRYPTED)) {
  3497. +- u8 aad[2 * AES_BLOCK_SIZE];
  3498. +- u8 b_0[AES_BLOCK_SIZE];
  3499. ++ u8 scratch[6 * AES_BLOCK_SIZE];
  3500. + /* hardware didn't decrypt/verify MIC */
  3501. +- ccmp_special_blocks(skb, pn, b_0, aad);
  3502. ++ ccmp_special_blocks(skb, pn, scratch, 1);
  3503. +
  3504. + if (ieee80211_aes_ccm_decrypt(
  3505. +- key->u.ccmp.tfm, b_0, aad,
  3506. ++ key->u.ccmp.tfm, scratch,
  3507. + skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN,
  3508. + data_len,
  3509. +- skb->data + skb->len - IEEE80211_CCMP_MIC_LEN))
  3510. ++ skb->data + skb->len - IEEE80211_CCMP_MIC_LEN,
  3511. ++ skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN))
  3512. + return RX_DROP_UNUSABLE;
  3513. + }
  3514. +
  3515. --- a/net/mac80211/Kconfig
  3516. +++ b/net/mac80211/Kconfig
  3517. @@ -5,7 +5,6 @@ config MAC80211
  3518. @@ -244,104 +345,3 @@
  3519. u32 replays; /* dot11RSNAStatsCCMPReplays */
  3520. } ccmp;
  3521. struct {
  3522. ---- a/net/mac80211/wpa.c
  3523. -+++ b/net/mac80211/wpa.c
  3524. -@@ -301,16 +301,22 @@ ieee80211_crypto_tkip_decrypt(struct iee
  3525. - }
  3526. -
  3527. -
  3528. --static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad,
  3529. -+static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *scratch,
  3530. - int encrypted)
  3531. - {
  3532. - __le16 mask_fc;
  3533. - int a4_included, mgmt;
  3534. - u8 qos_tid;
  3535. -- u16 len_a;
  3536. -+ u8 *b_0, *aad;
  3537. -+ u16 data_len, len_a;
  3538. - unsigned int hdrlen;
  3539. - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
  3540. -
  3541. -+ memset(scratch, 0, 6 * AES_BLOCK_SIZE);
  3542. -+
  3543. -+ b_0 = scratch + 3 * AES_BLOCK_SIZE;
  3544. -+ aad = scratch + 4 * AES_BLOCK_SIZE;
  3545. -+
  3546. - /*
  3547. - * Mask FC: zero subtype b4 b5 b6 (if not mgmt)
  3548. - * Retry, PwrMgt, MoreData; set Protected
  3549. -@@ -332,21 +338,20 @@ static void ccmp_special_blocks(struct s
  3550. - else
  3551. - qos_tid = 0;
  3552. -
  3553. -- /* In CCM, the initial vectors (IV) used for CTR mode encryption and CBC
  3554. -- * mode authentication are not allowed to collide, yet both are derived
  3555. -- * from this vector b_0. We only set L := 1 here to indicate that the
  3556. -- * data size can be represented in (L+1) bytes. The CCM layer will take
  3557. -- * care of storing the data length in the top (L+1) bytes and setting
  3558. -- * and clearing the other bits as is required to derive the two IVs.
  3559. -- */
  3560. -- b_0[0] = 0x1;
  3561. -+ data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN;
  3562. -+ if (encrypted)
  3563. -+ data_len -= IEEE80211_CCMP_MIC_LEN;
  3564. -
  3565. -+ /* First block, b_0 */
  3566. -+ b_0[0] = 0x59; /* flags: Adata: 1, M: 011, L: 001 */
  3567. - /* Nonce: Nonce Flags | A2 | PN
  3568. - * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7)
  3569. - */
  3570. - b_0[1] = qos_tid | (mgmt << 4);
  3571. - memcpy(&b_0[2], hdr->addr2, ETH_ALEN);
  3572. - memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN);
  3573. -+ /* l(m) */
  3574. -+ put_unaligned_be16(data_len, &b_0[14]);
  3575. -
  3576. - /* AAD (extra authenticate-only data) / masked 802.11 header
  3577. - * FC | A1 | A2 | A3 | SC | [A4] | [QC] */
  3578. -@@ -402,8 +407,7 @@ static int ccmp_encrypt_skb(struct ieee8
  3579. - u8 *pos;
  3580. - u8 pn[6];
  3581. - u64 pn64;
  3582. -- u8 aad[2 * AES_BLOCK_SIZE];
  3583. -- u8 b_0[AES_BLOCK_SIZE];
  3584. -+ u8 scratch[6 * AES_BLOCK_SIZE];
  3585. -
  3586. - if (info->control.hw_key &&
  3587. - !(info->control.hw_key->flags & IEEE80211_KEY_FLAG_GENERATE_IV) &&
  3588. -@@ -456,9 +460,9 @@ static int ccmp_encrypt_skb(struct ieee8
  3589. - return 0;
  3590. -
  3591. - pos += IEEE80211_CCMP_HDR_LEN;
  3592. -- ccmp_special_blocks(skb, pn, b_0, aad, 0);
  3593. -- ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len,
  3594. -- skb_put(skb, IEEE80211_CCMP_MIC_LEN));
  3595. -+ ccmp_special_blocks(skb, pn, scratch, 0);
  3596. -+ ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, scratch, pos, len,
  3597. -+ pos, skb_put(skb, IEEE80211_CCMP_MIC_LEN));
  3598. -
  3599. - return 0;
  3600. - }
  3601. -@@ -521,16 +525,16 @@ ieee80211_crypto_ccmp_decrypt(struct iee
  3602. - }
  3603. -
  3604. - if (!(status->flag & RX_FLAG_DECRYPTED)) {
  3605. -- u8 aad[2 * AES_BLOCK_SIZE];
  3606. -- u8 b_0[AES_BLOCK_SIZE];
  3607. -+ u8 scratch[6 * AES_BLOCK_SIZE];
  3608. - /* hardware didn't decrypt/verify MIC */
  3609. -- ccmp_special_blocks(skb, pn, b_0, aad, 1);
  3610. -+ ccmp_special_blocks(skb, pn, scratch, 1);
  3611. -
  3612. - if (ieee80211_aes_ccm_decrypt(
  3613. -- key->u.ccmp.tfm, b_0, aad,
  3614. -+ key->u.ccmp.tfm, scratch,
  3615. - skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN,
  3616. - data_len,
  3617. -- skb->data + skb->len - IEEE80211_CCMP_MIC_LEN))
  3618. -+ skb->data + skb->len - IEEE80211_CCMP_MIC_LEN,
  3619. -+ skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN))
  3620. - return RX_DROP_UNUSABLE;
  3621. - }
  3622. -
  3623. diff --git a/package/mac80211/patches/150-disable_addr_notifier.patch b/package/mac80211/patches/150-disable_addr_notifier.patch
  3624. index 7b50154..3f749e9 100644
  3625. --- a/package/mac80211/patches/150-disable_addr_notifier.patch
  3626. +++ b/package/mac80211/patches/150-disable_addr_notifier.patch
  3627. @@ -18,7 +18,7 @@
  3628. static int ieee80211_ifa6_changed(struct notifier_block *nb,
  3629. unsigned long data, void *arg)
  3630. {
  3631. -@@ -1031,14 +1031,14 @@ int ieee80211_register_hw(struct ieee802
  3632. +@@ -1036,14 +1036,14 @@ int ieee80211_register_hw(struct ieee802
  3633. goto fail_pm_qos;
  3634. }
  3635. @@ -35,7 +35,7 @@
  3636. local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed;
  3637. result = register_inet6addr_notifier(&local->ifa6_notifier);
  3638. if (result)
  3639. -@@ -1047,13 +1047,13 @@ int ieee80211_register_hw(struct ieee802
  3640. +@@ -1052,13 +1052,13 @@ int ieee80211_register_hw(struct ieee802
  3641. return 0;
  3642. @@ -52,7 +52,7 @@
  3643. fail_ifa:
  3644. pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY,
  3645. &local->network_latency_notifier);
  3646. -@@ -1086,10 +1086,10 @@ void ieee80211_unregister_hw(struct ieee
  3647. +@@ -1103,10 +1103,10 @@ void ieee80211_unregister_hw(struct ieee
  3648. pm_qos_remove_notifier(PM_QOS_NETWORK_LATENCY,
  3649. &local->network_latency_notifier);
  3650. diff --git a/package/mac80211/patches/300-pending_work.patch b/package/mac80211/patches/300-pending_work.patch
  3651. index a1af6c2..892f51e 100644
  3652. --- a/package/mac80211/patches/300-pending_work.patch
  3653. +++ b/package/mac80211/patches/300-pending_work.patch
  3654. @@ -1,4153 +1,543 @@
  3655. -commit 93f310a38a1d81a4bc8fcd9bf29628bd721cf2ef
  3656. -Author: Felix Fietkau <nbd@openwrt.org>
  3657. -Date: Sun Apr 6 23:35:28 2014 +0200
  3658. -
  3659. - ath9k_hw: reduce ANI firstep range for older chips
  3660. -
  3661. - Use 0-8 instead of 0-16, which is closer to the old implementation.
  3662. - Also drop the overwrite of the firstep_low parameter to improve
  3663. - stability.
  3664. -
  3665. - Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  3666. -
  3667. -commit 584d297fd29fb39c76af25ae74ff9d5fe74c8a14
  3668. -Author: Helmut Schaa <helmut.schaa@googlemail.com>
  3669. -Date: Wed Mar 12 10:37:55 2014 +0100
  3670. -
  3671. - ath9k: Fix sequence number assignment for non-data frames
  3672. -
  3673. - Since commit 558ff225de80ac95b132d3a115ddadcd64498b4f (ath9k: fix
  3674. - ps-poll responses under a-mpdu sessions) non-data frames would have
  3675. - gotten a sequence number from a TIDs sequence counter instead of
  3676. - using the global sequence counter.
  3677. -
  3678. - This can lead to instable connections.
  3679. -
  3680. - To fix this only select the correct TID if we are processing a
  3681. - data frame. Furthermore, prevent non-data frames to get a sequence
  3682. - number from a TID sequence counter by adding a check to
  3683. - ath_tx_setup_buffer.
  3684. -
  3685. - Cc: Felix Fietkau <nbd@openwrt.org>
  3686. - Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
  3687. -
  3688. -commit 3a0f984b1cdcd6a9f8c441635ef3b05d58547f4e
  3689. -Author: Felix Fietkau <nbd@openwrt.org>
  3690. -Date: Tue Mar 11 14:03:32 2014 +0100
  3691. -
  3692. - ath9k_hw: set ANI firstep as absolute values instead of relative
  3693. -
  3694. - On older chips, the INI value differ in similar ways as cycpwr_thr1, so
  3695. - convert it to absolute values as well.
  3696. -
  3697. - Since the ANI algorithm is different here compared to the old
  3698. - implementation (fewer steps, controlled at a different point in time),
  3699. - it makes sense to use values similar to what would be applied for newer
  3700. - chips, just without relying on INI defaults.
  3701. -
  3702. - Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  3703. -
  3704. -commit 91d70d40400c569b49605b78fd7c43e9405694f4
  3705. -Author: Felix Fietkau <nbd@openwrt.org>
  3706. -Date: Tue Mar 11 14:00:37 2014 +0100
  3707. -
  3708. - ath9k_hw: set ANI cycpwr_thr1 as absolute values instead of relative
  3709. -
  3710. - The table was copied from the ANI implementation of AR9300. It assumes
  3711. - that the INI values contain a baseline value that is usable as reference
  3712. - from which to increase/decrease based on the noise immunity value.
  3713. -
  3714. - On older chips, the differences are bigger and especially AR5008/AR9001
  3715. - are configured to much more sensitive values than what is useful.
  3716. -
  3717. - Improve ANI behavior by reverting to the absolute values used in the
  3718. - previous implementation (expressed as a simple formula instead of the
  3719. - old table).
  3720. -
  3721. - Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  3722. +commit 4c8a3486cb577d40c1ef75f0a8dc9a04773eef83
  3723. +Author: Nickolay Ledovskikh <nledovskikh@gmail.com>
  3724. +Date: Fri Apr 25 22:53:34 2014 +0400
  3725. -commit c977493766310a825f406836636ffd66e1447783
  3726. -Author: Felix Fietkau <nbd@openwrt.org>
  3727. -Date: Mon Mar 10 19:52:56 2014 +0100
  3728. -
  3729. - ath9k_hw: remove ANI function restrictions for AP mode
  3730. -
  3731. - The primary purpose of this piece of code was to selectively disable
  3732. - OFDM weak signal detection. The checks for this are elsewhere, and an
  3733. - earlier commit relaxed the restrictions for older chips, which are more
  3734. - sensitive to interference.
  3735. -
  3736. - Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  3737. -
  3738. -commit 8d804f1af11e4e058b1e8453327777d73a585cb8
  3739. -Author: Felix Fietkau <nbd@openwrt.org>
  3740. -Date: Sun Mar 9 11:25:43 2014 +0100
  3741. -
  3742. - ath9k: clean up and enhance ANI debugfs file
  3743. + ath5k: Fix AR5K_PHY_TXPOWER_RATE_MAX register value setting.
  3744. - Unify scnprintf calls and include the current OFDM/CCK immunity level.
  3745. + I was reading ath5k power setting code and
  3746. + noticed typing error in ath5k_hw_txpower function.
  3747. + Invalid value was written to AR5K_PHY_TXPOWER_RATE_MAX
  3748. + register.
  3749. - Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  3750. + Signed-off-by: Nikolay Ledovskikh <nledovskikh@gmail.com>
  3751. + Acked-by: Nick Kossifidis <mickflemm@gmail.com>
  3752. + Signed-off-by: John W. Linville <linville@tuxdriver.com>
  3753. -commit 22e298b5a3a8a49e33805d4e351965123dede35b
  3754. -Author: Felix Fietkau <nbd@openwrt.org>
  3755. -Date: Sun Mar 9 10:58:47 2014 +0100
  3756. +commit 4d76248013dbb1948429555208900a585b0f351d
  3757. +Author: Janusz Dziedzic <janusz.dziedzic@tieto.com>
  3758. +Date: Tue Apr 8 13:38:43 2014 +0200
  3759. - ath9k: fix ready time of the multicast buffer queue
  3760. -
  3761. - qi->tqi_readyTime is written directly to registers that expect
  3762. - microseconds as unit instead of TU.
  3763. - When setting the CABQ ready time, cur_conf->beacon_interval is in TU, so
  3764. - convert it to microseconds before passing it to ath9k_hw.
  3765. + ath9k: Enable DFS only when ATH9K_DFS_CERTIFIED
  3766. - This should hopefully fix some Tx DMA issues with buffered multicast
  3767. - frames in AP mode.
  3768. + Add DFS interface combination only when
  3769. + CONFIG_ATH9K_DFS_CERTIFIED is set. In other case
  3770. + user can run CAC/beaconing without proper handling
  3771. + of pulse events (without radar detection activated).
  3772. - Cc: stable@vger.kernel.org
  3773. - Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  3774. + Reported-by: Cedric Voncken <cedric.voncken@acksys.fr>
  3775. + Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
  3776. + Signed-off-by: John W. Linville <linville@tuxdriver.com>
  3777. -commit fcb064fdd5a27bec8d24099bc0172468f34c97cb
  3778. -Author: Felix Fietkau <nbd@openwrt.org>
  3779. -Date: Sun Mar 9 09:43:09 2014 +0100
  3780. +commit c83a4e5156a4b4dd22137d33a5625440982d6d37
  3781. +Author: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
  3782. +Date: Mon Apr 28 21:17:08 2014 +0530
  3783. - ath9k_hw: fix unreachable code in baseband hang detection code
  3784. + ath9k_hw: fix worse EVM for 11b rates
  3785. - The commit "ath9k: reduce baseband hang detection false positive rate"
  3786. - added a delay in the loop checking the baseband state, however it was
  3787. - unreachable due to previous 'continue' statements.
  3788. + Adjust FIR filter co-efficients to improve EVM for 11b rates.
  3789. - Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
  3790. - Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  3791. + Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
  3792. + Signed-off-by: John W. Linville <linville@tuxdriver.com>
  3793. -commit 31959d8df39319e32c6d5ba9c135727be90cfad7
  3794. -Author: Michal Kazior <michal.kazior@tieto.com>
  3795. -Date: Fri Mar 7 08:09:38 2014 +0100
  3796. +commit 8aab2c7a2f4a957e344db429dfb1190ae59ce8b5
  3797. +Author: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
  3798. +Date: Mon Apr 28 21:17:07 2014 +0530
  3799. - mac80211: fix possible NULL dereference
  3800. -
  3801. - If chanctx is missing on a given vif then the band
  3802. - is assumed to be 2GHz. However if hw doesn't
  3803. - support 2GHz band then mac80211 ended up with a
  3804. - NULL dereference.
  3805. -
  3806. - This fixes a splat:
  3807. -
  3808. - [ 4605.207223] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
  3809. - [ 4605.210789] IP: [<ffffffffa07b5635>] ieee80211_parse_bitrates+0x65/0x110 [mac80211]
  3810. + ath9k_hw: update ar9300 initvals
  3811. - The splat was preceeded by WARN_ON(!chanctx_conf)
  3812. - in ieee80211_get_sdata_band().
  3813. + * rfsat gainchange hysteresis of rf_gain stuck with large
  3814. + interference present.
  3815. - Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
  3816. + Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
  3817. + Signed-off-by: John W. Linville <linville@tuxdriver.com>
  3818. -commit 6c5a3ffa0a2d22c091a2717f427259bacf77ac5e
  3819. -Author: Michael Braun <michael-dev@fami-braun.de>
  3820. -Date: Thu Mar 6 15:08:43 2014 +0100
  3821. +commit 8c7ae357cc5b6bd037ad2d666e9f3789cf882925
  3822. +Author: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
  3823. +Date: Wed Apr 23 15:07:57 2014 +0530
  3824. - mac80211: fix WPA with VLAN on AP side with ps-sta again
  3825. + ath9k: fix race in setting ATH_OP_INVALID
  3826. - commit de74a1d9032f4d37ea453ad2a647e1aff4cd2591
  3827. - "mac80211: fix WPA with VLAN on AP side with ps-sta"
  3828. - fixed an issue where queued multicast packets would
  3829. - be sent out encrypted with the key of an other bss.
  3830. + The commit "ath9k: move sc_flags to ath_common" moved setting
  3831. + ATH_OP_INVALID flag below ieee80211_register_hw. This is causing
  3832. + the flag never being cleared randomly as the drv_start is called
  3833. + prior to setting flag. Fix this by setting the flag prior to
  3834. + register_hw.
  3835. - commit "7cbf9d017dbb5e3276de7d527925d42d4c11e732"
  3836. - "mac80211: fix oops on mesh PS broadcast forwarding"
  3837. - essentially reverted it, because vif.type cannot be AP_VLAN
  3838. - due to the check to vif.type in ieee80211_get_buffered_bc before.
  3839. -
  3840. - As the later commit intended to fix the MESH case, fix it
  3841. - by checking for IFTYPE_AP instead of IFTYPE_AP_VLAN.
  3842. -
  3843. - Fixes: 7cbf9d017dbb
  3844. - Cc: <stable@vger.kernel.org> # 3.10.x
  3845. - Cc: <stable@vger.kernel.org> # 3.11.x
  3846. - Cc: <stable@vger.kernel.org> # 3.12.x
  3847. - Cc: <stable@vger.kernel.org> # 3.13.x
  3848. - Cc: <linux-wireless@vger.kernel.org>
  3849. - Cc: <projekt-wlan@fem.tu-ilmenau.de>
  3850. - Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
  3851. + Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
  3852. + Signed-off-by: John W. Linville <linville@tuxdriver.com>
  3853. -commit 9d6ab9bdb9b368a6cf9519f0f92509b5b2c297ec
  3854. -Author: Johannes Berg <johannes.berg@intel.com>
  3855. -Date: Mon Mar 3 14:19:08 2014 +0100
  3856. +commit c82552c5b0cb1735dbcbad78b1ffc6d3c212dc56
  3857. +Author: Tim Harvey <tharvey@gateworks.com>
  3858. +Date: Mon Apr 21 16:14:57 2014 -0700
  3859. - cfg80211: remove racy beacon_interval assignment
  3860. + ath9k: add a recv budget
  3861. - In case of AP mode, the beacon interval is already reset to
  3862. - zero inside cfg80211_stop_ap(), and in the other modes it
  3863. - isn't relevant. Remove the assignment to remove a potential
  3864. - race since the assignment isn't properly locked.
  3865. + Implement a recv budget so that in cases of high traffic we still allow other
  3866. + taskets to get processed.
  3867. - Reported-by: Michal Kazior <michal.kazior@tieto.com>
  3868. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  3869. -
  3870. -commit 1abdeca3c6fb9cf1f84f85e78ed8d1c33bd69db0
  3871. -Author: Felix Fietkau <nbd@openwrt.org>
  3872. -Date: Fri Feb 28 18:52:56 2014 +0100
  3873. -
  3874. - ath9k_hw: tweak noise immunity thresholds for older chipsets
  3875. + Without this, we can encounter a host of issues during high wireless traffic
  3876. + reception depending on system load including rcu stall's detected (ARM),
  3877. + soft lockups, failure to service critical tasks such as watchdog resets,
  3878. + and triggering of the tx stuck tasklet.
  3879. - Older chipsets are more sensitive to high PHY error counts, and the
  3880. - current noise immunity thresholds were based on tests run at QCA with
  3881. - newer chipsets.
  3882. + The same thing was proposed previously by Ben:
  3883. + http://www.spinics.net/lists/linux-wireless/msg112891.html
  3884. - This patch brings back the values from the old ANI implementation for
  3885. - old chipsets, and it also disables weak signal detection on an earlier
  3886. - noise immunity level, to improve overall radio stability on affected
  3887. - devices.
  3888. + The only difference here is that I make sure only processed packets are counted
  3889. + in the budget by checking at the end of the rx loop.
  3890. - Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  3891. + Signed-off-by: Tim Harvey <tharvey@gateworks.com>
  3892. + Acked-by: Felix Fietkau <nbd@openwrt.org>
  3893. + Signed-off-by: John W. Linville <linville@tuxdriver.com>
  3894. -commit 431e506da5953adc3b65af25f4b90873d528c115
  3895. -Author: Felix Fietkau <nbd@openwrt.org>
  3896. -Date: Fri Feb 28 18:44:13 2014 +0100
  3897. +commit 3a758134e66ca74a9df792616b5288b2fa2cfd7f
  3898. +Author: Tim Harvey <tharvey@gateworks.com>
  3899. +Date: Mon Apr 21 16:14:56 2014 -0700
  3900. - ath9k_hw: toggle weak signal detection in AP mode on older chipsets
  3901. -
  3902. - The commit 80b4205b "ath9k: Fix OFDM weak signal detection for AP mode"
  3903. - prevented weak signal detection changes from taking effect in AP mode on
  3904. - all chipsets, claiming it is "not allowed".
  3905. + ath9k: fix possible hang on flush
  3906. - The main reason for not disabling weak signal detection in AP mode is
  3907. - that typically beacon RSSI is used to track whether it is needed to
  3908. - boost range, and this is unavailable in AP mode for obvious reasons.
  3909. + If a flush is requested, make sure to clear the descriptor once we've
  3910. + processed it.
  3911. - The problem with not disabling weak signal detection is that older
  3912. - chipsets are very sensitive to high PHY error counts. When faced with
  3913. - heavy noise, this can lead to an excessive amount of "Failed to stop
  3914. - TX DMA" errors in the field.
  3915. + This resolves a hang that will occur if all RX descriptors are full when a
  3916. + flush is requested.
  3917. - Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  3918. + Signed-off-by: Tim Harvey <tharvey@gateworks.com>
  3919. + Acked-by: Felix Fietkau <nbd@openwrt.org>
  3920. + Signed-off-by: John W. Linville <linville@tuxdriver.com>
  3921. -commit 98d1a6c5b14688ed030e81b889f607be308e0df9
  3922. +commit eefb1d6adc4c60d219182b8917e4567484ce07fc
  3923. Author: Felix Fietkau <nbd@openwrt.org>
  3924. -Date: Mon Feb 24 22:20:32 2014 +0100
  3925. +Date: Mon Apr 28 18:27:41 2014 +0200
  3926. - ath9k: fix invalid descriptor discarding
  3927. -
  3928. - Only set sc->rx.discard_next to rx_stats->rs_more when actually
  3929. - discarding the current descriptor.
  3930. + ath9k: remove tid->paused flag
  3931. - Also, fix a detection of broken descriptors:
  3932. - First the code checks if the current descriptor is not done.
  3933. - Then it checks if the next descriptor is done.
  3934. - Add a check that afterwards checks the first descriptor again, because
  3935. - it might have been completed in the mean time.
  3936. + There are some corner cases where the driver could get stuck with a full
  3937. + tid queue that is paused, leading to a software tx queue hang.
  3938. - This fixes a regression introduced in
  3939. - commit 723e711356b5a8a95728a890e254e8b0d47b55cf
  3940. - "ath9k: fix handling of broken descriptors"
  3941. -
  3942. - Cc: stable@vger.kernel.org
  3943. - Reported-by: Marco André Dinis <marcoandredinis@gmail.com>
  3944. - Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  3945. -
  3946. -commit 52a46300e782fe6994466523eb2b0b59091ea59f
  3947. -Author: Felix Fietkau <nbd@openwrt.org>
  3948. -Date: Mon Feb 24 11:43:50 2014 +0100
  3949. -
  3950. - ath9k: reduce baseband hang detection false positive rate
  3951. + Since the tx queueing rework, pausing per-tid queues on aggregation
  3952. + session setup is no longer necessary. The driver will assign sequence
  3953. + numbers to buffered frames when a new session is established, in order
  3954. + to get the correct starting sequence number.
  3955. - Check if the baseband state remains stable, and add a small delay
  3956. - between register reads.
  3957. + mac80211 prevents new frames from entering the queue during setup.
  3958. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  3959. -commit 118945bb12082e9d4edddc868d88143164e0f440
  3960. +commit 98a713933d8495f4078f561c1e651b738dd5b531
  3961. Author: Felix Fietkau <nbd@openwrt.org>
  3962. -Date: Sat Feb 22 14:55:23 2014 +0100
  3963. +Date: Sun Apr 27 14:49:03 2014 +0200
  3964. - ath5k: set SURVEY_INFO_IN_USE on get_survey
  3965. + ath9k_hw: do not lower ANI setting below default on AR913x
  3966. - Only one channel is returned - the one currently being used.
  3967. -
  3968. - Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  3969. -
  3970. -commit ee41f72476e1ea44283dfe1cbf75b9543a1e15c8
  3971. -Author: Felix Fietkau <nbd@openwrt.org>
  3972. -Date: Sat Feb 22 14:44:52 2014 +0100
  3973. -
  3974. - ath9k: make some hardware reset log messages debug-only
  3975. + When the amount of noise fluctuates strongly, low immunity settings
  3976. + can sometimes disrupt signal detection on AR913x chips. When that
  3977. + happens, no OFDM/CCK errors are reported anymore, and ANI tunes the
  3978. + radio to the lowest immunity settings.
  3979. + Usually rx/tx fails as well in that case.
  3980. - On some chips, baseband watchdog hangs are more common than others, and
  3981. - the driver has support for handling them.
  3982. - Interrupts even after a watchdog hang are also quite common, so there's
  3983. - not much point in spamming the user's logfiles.
  3984. + To fix this, keep noise immunity settings at or above ANI default level,
  3985. + which will keep radio parameters at or above INI values.
  3986. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  3987. -commit b14fbb554fc65a2e0b5c41a319269b0350f187e7
  3988. +commit 7cbb4c021bfd1e656f5b9953a947ab3c64e4e3b0
  3989. Author: Felix Fietkau <nbd@openwrt.org>
  3990. -Date: Sat Feb 22 14:35:25 2014 +0100
  3991. +Date: Thu Apr 10 10:49:01 2014 +0200
  3992. - ath9k: do not set half/quarter channel flags in AR_PHY_MODE
  3993. -
  3994. - 5/10 MHz channel bandwidth is configured via the PLL clock, instead of
  3995. - the AR_PHY_MODE register. Using that register is AR93xx specific, and
  3996. - makes the mode incompatible with earlier chipsets.
  3997. + mac80211: exclude AP_VLAN interfaces from tx power calculation
  3998. - In some early versions, these flags were apparently applied at the wrong
  3999. - point in time and thus did not cause connectivity issues, however now
  4000. - they are causing problems, as pointed out in this OpenWrt ticket:
  4001. -
  4002. - https://dev.openwrt.org/ticket/14916
  4003. + Their power value is initialized to zero. This patch fixes an issue
  4004. + where the configured power drops to the minimum value when AP_VLAN
  4005. + interfaces are created/removed.
  4006. + Cc: stable@vger.kernel.org
  4007. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  4008. -commit 0f1cb7be2551b30b02cd54c897e0e29e483cfda5
  4009. +commit 0ca13e26341733bf9577287fb04a3bef0d2f5cc9
  4010. Author: Felix Fietkau <nbd@openwrt.org>
  4011. -Date: Sat Feb 22 13:43:29 2014 +0100
  4012. +Date: Wed Apr 9 00:07:01 2014 +0200
  4013. - ath9k: fix ps-poll responses under a-mpdu sessions
  4014. + mac80211: suppress BSS info change notifications for AP_VLAN
  4015. - When passing tx frames to the U-APSD queue for powersave poll responses,
  4016. - the ath_atx_tid pointer needs to be passed to ath_tx_setup_buffer for
  4017. - proper sequence number accounting.
  4018. + Fixes warnings on tx power changes
  4019. - This fixes high latency and connection stability issues with ath9k
  4020. - running as AP and a few kinds of mobile phones as client, when PS-Poll
  4021. - is heavily used
  4022. -
  4023. - Cc: stable@vger.kernel.org
  4024. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  4025. -commit d5d87a37bbd6066b2c3c5d0bd0fe2a6e2ea45cc5
  4026. +commit ec998e5991781ecdaad0911dc64f1c8d3749c308
  4027. Author: Felix Fietkau <nbd@openwrt.org>
  4028. -Date: Fri Feb 21 11:39:59 2014 +0100
  4029. +Date: Tue Apr 8 23:42:17 2014 +0200
  4030. - ath9k: list more reset causes in debugfs
  4031. + ath9k: fix a scheduling while atomic bug in CSA handling
  4032. - Number of MAC hangs and stuck beacons were missing
  4033. + Commit "ath9k: prepare for multi-interface CSA support" added a call to
  4034. + ieee80211_iterate_active_interfaces in atomic context (beacon tasklet),
  4035. + which is crashing.
  4036. + Use ieee80211_iterate_active_interfaces_atomic instead.
  4037. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  4038. -commit d84856012e0f10fe598a5ad3b7b869397a089e07
  4039. -Author: Johannes Berg <johannes.berg@intel.com>
  4040. -Date: Thu Feb 20 11:19:58 2014 +0100
  4041. -
  4042. - mac80211: fix station wakeup powersave race
  4043. -
  4044. - Consider the following (relatively unlikely) scenario:
  4045. - 1) station goes to sleep while frames are buffered in driver
  4046. - 2) driver blocks wakeup (until no more frames are buffered)
  4047. - 3) station wakes up again
  4048. - 4) driver unblocks wakeup
  4049. -
  4050. - In this case, the current mac80211 code will do the following:
  4051. - 1) WLAN_STA_PS_STA set
  4052. - 2) WLAN_STA_PS_DRIVER set
  4053. - 3) - nothing -
  4054. - 4) WLAN_STA_PS_DRIVER cleared
  4055. -
  4056. - As a result, no frames will be delivered to the client, even
  4057. - though it is awake, until it sends another frame to us that
  4058. - triggers ieee80211_sta_ps_deliver_wakeup() in sta_ps_end().
  4059. -
  4060. - Since we now take the PS spinlock, we can fix this while at
  4061. - the same time removing the complexity with the pending skb
  4062. - queue function. This was broken since my commit 50a9432daeec
  4063. - ("mac80211: fix powersaving clients races") due to removing
  4064. - the clearing of WLAN_STA_PS_STA in the RX path.
  4065. -
  4066. - While at it, fix a cleanup path issue when a station is
  4067. - removed while the driver is still blocking its wakeup.
  4068. -
  4069. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4070. -
  4071. -commit 798f2786602cbe93e6b928299614aa36ebf50692
  4072. -Author: Johannes Berg <johannes.berg@intel.com>
  4073. -Date: Mon Feb 17 20:49:03 2014 +0100
  4074. -
  4075. - mac80211: insert stations before adding to driver
  4076. -
  4077. - There's a race condition in mac80211 because we add stations
  4078. - to the internal lists after adding them to the driver, which
  4079. - means that (for example) the following can happen:
  4080. - 1. a station connects and is added
  4081. - 2. first, it is added to the driver
  4082. - 3. then, it is added to the mac80211 lists
  4083. -
  4084. - If the station goes to sleep between steps 2 and 3, and the
  4085. - firmware/hardware records it as being asleep, mac80211 will
  4086. - never instruct the driver to wake it up again as it never
  4087. - realized it went to sleep since the RX path discarded the
  4088. - frame as a "spurious class 3 frame", no station entry was
  4089. - present yet.
  4090. -
  4091. - Fix this by adding the station in software first, and only
  4092. - then adding it to the driver. That way, any state that the
  4093. - driver changes will be reflected properly in mac80211's
  4094. - station state. The problematic part is the roll-back if the
  4095. - driver fails to add the station, in that case a bit more is
  4096. - needed. To not make that overly complex prevent starting BA
  4097. - sessions in the meantime.
  4098. -
  4099. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4100. -
  4101. -commit b9ba6a520cb07ab3aa7aaaf9ce4a0bc7a6bc06fe
  4102. -Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
  4103. -Date: Thu Feb 20 09:22:11 2014 +0200
  4104. -
  4105. - mac80211: fix AP powersave TX vs. wakeup race
  4106. -
  4107. - There is a race between the TX path and the STA wakeup: while
  4108. - a station is sleeping, mac80211 buffers frames until it wakes
  4109. - up, then the frames are transmitted. However, the RX and TX
  4110. - path are concurrent, so the packet indicating wakeup can be
  4111. - processed while a packet is being transmitted.
  4112. -
  4113. - This can lead to a situation where the buffered frames list
  4114. - is emptied on the one side, while a frame is being added on
  4115. - the other side, as the station is still seen as sleeping in
  4116. - the TX path.
  4117. -
  4118. - As a result, the newly added frame will not be send anytime
  4119. - soon. It might be sent much later (and out of order) when the
  4120. - station goes to sleep and wakes up the next time.
  4121. -
  4122. - Additionally, it can lead to the crash below.
  4123. -
  4124. - Fix all this by synchronising both paths with a new lock.
  4125. - Both path are not fastpath since they handle PS situations.
  4126. -
  4127. - In a later patch we'll remove the extra skb queue locks to
  4128. - reduce locking overhead.
  4129. -
  4130. - BUG: unable to handle kernel
  4131. - NULL pointer dereference at 000000b0
  4132. - IP: [<ff6f1791>] ieee80211_report_used_skb+0x11/0x3e0 [mac80211]
  4133. - *pde = 00000000
  4134. - Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
  4135. - EIP: 0060:[<ff6f1791>] EFLAGS: 00210282 CPU: 1
  4136. - EIP is at ieee80211_report_used_skb+0x11/0x3e0 [mac80211]
  4137. - EAX: e5900da0 EBX: 00000000 ECX: 00000001 EDX: 00000000
  4138. - ESI: e41d00c0 EDI: e5900da0 EBP: ebe458e4 ESP: ebe458b0
  4139. - DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
  4140. - CR0: 8005003b CR2: 000000b0 CR3: 25a78000 CR4: 000407d0
  4141. - DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
  4142. - DR6: ffff0ff0 DR7: 00000400
  4143. - Process iperf (pid: 3934, ti=ebe44000 task=e757c0b0 task.ti=ebe44000)
  4144. - iwlwifi 0000:02:00.0: I iwl_pcie_enqueue_hcmd Sending command LQ_CMD (#4e), seq: 0x0903, 92 bytes at 3[3]:9
  4145. - Stack:
  4146. - e403b32c ebe458c4 00200002 00200286 e403b338 ebe458cc c10960bb e5900da0
  4147. - ff76a6ec ebe458d8 00000000 e41d00c0 e5900da0 ebe458f0 ff6f1b75 e403b210
  4148. - ebe4598c ff723dc1 00000000 ff76a6ec e597c978 e403b758 00000002 00000002
  4149. - Call Trace:
  4150. - [<ff6f1b75>] ieee80211_free_txskb+0x15/0x20 [mac80211]
  4151. - [<ff723dc1>] invoke_tx_handlers+0x1661/0x1780 [mac80211]
  4152. - [<ff7248a5>] ieee80211_tx+0x75/0x100 [mac80211]
  4153. - [<ff7249bf>] ieee80211_xmit+0x8f/0xc0 [mac80211]
  4154. - [<ff72550e>] ieee80211_subif_start_xmit+0x4fe/0xe20 [mac80211]
  4155. - [<c149ef70>] dev_hard_start_xmit+0x450/0x950
  4156. - [<c14b9aa9>] sch_direct_xmit+0xa9/0x250
  4157. - [<c14b9c9b>] __qdisc_run+0x4b/0x150
  4158. - [<c149f732>] dev_queue_xmit+0x2c2/0xca0
  4159. -
  4160. - Cc: stable@vger.kernel.org
  4161. - Reported-by: Yaara Rozenblum <yaara.rozenblum@intel.com>
  4162. - Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
  4163. - Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
  4164. - [reword commit log, use a separate lock]
  4165. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4166. -
  4167. -commit 80e419de0dff38436b30d363311c625766193f86
  4168. -Author: Inbal Hacohen <Inbal.Hacohen@intel.com>
  4169. -Date: Wed Feb 12 09:32:27 2014 +0200
  4170. -
  4171. - cfg80211: bugfix in regulatory user hint process
  4172. -
  4173. - After processing hint_user, we would want to schedule the
  4174. - timeout work only if we are actually waiting to CRDA. This happens
  4175. - when the status is not "IGNORE" nor "ALREADY_SET".
  4176. -
  4177. - Signed-off-by: Inbal Hacohen <Inbal.Hacohen@intel.com>
  4178. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4179. -
  4180. -commit 6514c93afede55284e2cb63359aadedb85884c80
  4181. -Author: Jouni Malinen <jouni@qca.qualcomm.com>
  4182. -Date: Tue Feb 18 20:41:08 2014 +0200
  4183. -
  4184. - ath9k: Enable U-APSD AP mode support
  4185. -
  4186. - mac80211 handles the actual operations, so ath9k can just indicate
  4187. - support for this. Based on initial tests, this combination seems to
  4188. - work fine.
  4189. -
  4190. - Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
  4191. -
  4192. -commit a63caf0a357ad5c1f08d6b7827dc76c451445017
  4193. -Author: Stanislaw Gruszka <sgruszka@redhat.com>
  4194. -Date: Wed Feb 19 13:15:17 2014 +0100
  4195. -
  4196. - ath9k: protect tid->sched check
  4197. -
  4198. - We check tid->sched without a lock taken on ath_tx_aggr_sleep(). That
  4199. - is race condition which can result of doing list_del(&tid->list) twice
  4200. - (second time with poisoned list node) and cause crash like shown below:
  4201. -
  4202. - [424271.637220] BUG: unable to handle kernel paging request at 00100104
  4203. - [424271.637328] IP: [<f90fc072>] ath_tx_aggr_sleep+0x62/0xe0 [ath9k]
  4204. - ...
  4205. - [424271.639953] Call Trace:
  4206. - [424271.639998] [<f90f6900>] ? ath9k_get_survey+0x110/0x110 [ath9k]
  4207. - [424271.640083] [<f90f6942>] ath9k_sta_notify+0x42/0x50 [ath9k]
  4208. - [424271.640177] [<f809cfef>] sta_ps_start+0x8f/0x1c0 [mac80211]
  4209. - [424271.640258] [<c10f730e>] ? free_compound_page+0x2e/0x40
  4210. - [424271.640346] [<f809e915>] ieee80211_rx_handlers+0x9d5/0x2340 [mac80211]
  4211. - [424271.640437] [<c112f048>] ? kmem_cache_free+0x1d8/0x1f0
  4212. - [424271.640510] [<c1345a84>] ? kfree_skbmem+0x34/0x90
  4213. - [424271.640578] [<c10fc23c>] ? put_page+0x2c/0x40
  4214. - [424271.640640] [<c1345a84>] ? kfree_skbmem+0x34/0x90
  4215. - [424271.640706] [<c1345a84>] ? kfree_skbmem+0x34/0x90
  4216. - [424271.640787] [<f809dde3>] ? ieee80211_rx_handlers_result+0x73/0x1d0 [mac80211]
  4217. - [424271.640897] [<f80a07a0>] ieee80211_prepare_and_rx_handle+0x520/0xad0 [mac80211]
  4218. - [424271.641009] [<f809e22d>] ? ieee80211_rx_handlers+0x2ed/0x2340 [mac80211]
  4219. - [424271.641104] [<c13846ce>] ? ip_output+0x7e/0xd0
  4220. - [424271.641182] [<f80a1057>] ieee80211_rx+0x307/0x7c0 [mac80211]
  4221. - [424271.641266] [<f90fa6ee>] ath_rx_tasklet+0x88e/0xf70 [ath9k]
  4222. - [424271.641358] [<f80a0f2c>] ? ieee80211_rx+0x1dc/0x7c0 [mac80211]
  4223. - [424271.641445] [<f90f82db>] ath9k_tasklet+0xcb/0x130 [ath9k]
  4224. -
  4225. - Bug report:
  4226. - https://bugzilla.kernel.org/show_bug.cgi?id=70551
  4227. -
  4228. - Reported-and-tested-by: Max Sydorenko <maxim.stargazer@gmail.com>
  4229. - Cc: stable@vger.kernel.org
  4230. - Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
  4231. -
  4232. -commit 82ed9e3ccc02797df2ffe4b78127c4cd5f799a41
  4233. +commit 93f310a38a1d81a4bc8fcd9bf29628bd721cf2ef
  4234. Author: Felix Fietkau <nbd@openwrt.org>
  4235. -Date: Tue Feb 11 15:54:13 2014 +0100
  4236. +Date: Sun Apr 6 23:35:28 2014 +0200
  4237. - mac80211: send control port protocol frames to the VO queue
  4238. + ath9k_hw: reduce ANI firstep range for older chips
  4239. - Improves reliability of wifi connections with WPA, since authentication
  4240. - frames are prioritized over normal traffic and also typically exempt
  4241. - from aggregation.
  4242. + Use 0-8 instead of 0-16, which is closer to the old implementation.
  4243. + Also drop the overwrite of the firstep_low parameter to improve
  4244. + stability.
  4245. - Cc: stable@vger.kernel.org
  4246. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  4247. -commit d4426800f71e972feaa33e04c5801fc730627bdd
  4248. -Author: Stanislaw Gruszka <stf_xl@wp.pl>
  4249. -Date: Mon Feb 10 22:38:28 2014 +0100
  4250. -
  4251. - rtl8187: fix regression on MIPS without coherent DMA
  4252. -
  4253. - This patch fixes regression caused by commit a16dad77634 "MIPS: Fix
  4254. - potencial corruption". That commit fixes one corruption scenario in
  4255. - cost of adding another one, which actually start to cause crashes
  4256. - on Yeeloong laptop when rtl8187 driver is used.
  4257. -
  4258. - For correct DMA read operation on machines without DMA coherence, kernel
  4259. - have to invalidate cache, such it will refill later with new data that
  4260. - device wrote to memory, when that data is needed to process. We can only
  4261. - invalidate full cache line. Hence when cache line includes both dma
  4262. - buffer and some other data (written in cache, but not yet in main
  4263. - memory), the other data can not hit memory due to invalidation. That
  4264. - happen on rtl8187 where struct rtl8187_priv fields are located just
  4265. - before and after small buffers that are passed to USB layer and DMA
  4266. - is performed on them.
  4267. -
  4268. - To fix the problem we align buffers and reserve space after them to make
  4269. - them match cache line.
  4270. -
  4271. - This patch does not resolve all possible MIPS problems entirely, for
  4272. - that we have to assure that we always map cache aligned buffers for DMA,
  4273. - what can be complex or even not possible. But patch fixes visible and
  4274. - reproducible regression and seems other possible corruptions do not
  4275. - happen in practice, since Yeeloong laptop works stable without rtl8187
  4276. - driver.
  4277. -
  4278. - Bug report:
  4279. - https://bugzilla.kernel.org/show_bug.cgi?id=54391
  4280. -
  4281. - Reported-by: Petr Pisar <petr.pisar@atlas.cz>
  4282. - Bisected-by: Tom Li <biergaizi2009@gmail.com>
  4283. - Reported-and-tested-by: Tom Li <biergaizi2009@gmail.com>
  4284. - Cc: stable@vger.kernel.org
  4285. - Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
  4286. -
  4287. -commit e2f141d67ad1e7fe10aaab61811e8a409dfb2442
  4288. -Author: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4289. -Date: Fri Feb 7 10:29:55 2014 +0530
  4290. -
  4291. - ath9k: Calculate IQ-CAL median
  4292. -
  4293. - This patch adds a routine to calculate the median IQ correction
  4294. - values for AR955x, which is used for outlier detection.
  4295. - The normal method which is used for all other chips is
  4296. - bypassed for AR955x.
  4297. -
  4298. - Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4299. -
  4300. -commit c52a6fce0820c8d0687443ab86058ae03b478c8f
  4301. -Author: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4302. -Date: Fri Feb 7 10:29:54 2014 +0530
  4303. -
  4304. - ath9k: Expand the IQ coefficient array
  4305. -
  4306. - This will be used for storing data for mutiple
  4307. - IQ calibration runs, for AR955x.
  4308. -
  4309. - Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4310. -
  4311. -commit 034969ff5c2b6431d10e07c1938f0b916da85cc3
  4312. -Author: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4313. -Date: Fri Feb 7 10:29:53 2014 +0530
  4314. -
  4315. - ath9k: Modify IQ calibration for AR955x
  4316. -
  4317. - IQ calibration post-processing for AR955x is different
  4318. - from other chips - instead of just doing it as part
  4319. - of AGC calibration once, it is triggered 3 times and
  4320. - a median is determined. This patch adds initial support
  4321. - for changing the calibration behavior for AR955x.
  4322. -
  4323. - Also, to simplify things, a helper routine to issue/poll
  4324. - AGC calibration is used.
  4325. -
  4326. - For non-AR955x chips, the iqcal_idx (which will be used
  4327. - in subsequent patches) is set to zero.
  4328. -
  4329. - Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4330. -
  4331. -commit 9b1ed6454e6f3511f24266be99b4e403f243f6a8
  4332. -Author: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4333. -Date: Fri Feb 7 10:29:52 2014 +0530
  4334. -
  4335. - ath9k: Fix magnitude/phase calculation
  4336. -
  4337. - Incorrect values are programmed in the registers
  4338. - containing the IQ correction coefficients by the IQ-CAL
  4339. - post-processing code. Fix this.
  4340. -
  4341. - Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4342. -
  4343. -commit 36f93484f96f79171dcecb67c5ef0c3de22531a6
  4344. -Author: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4345. -Date: Fri Feb 7 10:29:51 2014 +0530
  4346. -
  4347. - ath9k: Rename ar9003_hw_tx_iqcal_load_avg_2_passes
  4348. -
  4349. - Use ar9003_hw_tx_iq_cal_outlier_detection instead.
  4350. -
  4351. - Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4352. -
  4353. -commit 3af09a7f5d21dd5fd15b973ce6a91a575da30417
  4354. -Author: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4355. -Date: Fri Feb 7 10:29:50 2014 +0530
  4356. -
  4357. - ath9k: Check explicitly for IQ calibration
  4358. -
  4359. - In chips like AR955x, the initvals contain the information
  4360. - whether IQ calibration is to be done in the HW when an
  4361. - AGC calibration is triggered. Check if IQ-CAL is enabled
  4362. - in the initvals before flagging 'txiqcal_done' as true.
  4363. -
  4364. - Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4365. -
  4366. -commit cb4969634b93c4643a32cc3fbd27d2b288b25771
  4367. -Author: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4368. -Date: Fri Feb 7 10:29:49 2014 +0530
  4369. -
  4370. - ath9k: Fix IQ cal post processing for SoC
  4371. -
  4372. - Calibration data is not reused for SoC chips, so
  4373. - call ar9003_hw_tx_iq_cal_post_proc() with the correct
  4374. - argument. The 'is_reusable' flag is currently used
  4375. - only for PC-OEM chips, but it makes things clearer to
  4376. - specify it explicity.
  4377. -
  4378. - Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4379. -
  4380. -commit e138e0ef9560c46ce93dbb22a728a57888e94d1c
  4381. -Author: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4382. -Date: Mon Feb 3 13:31:37 2014 +0530
  4383. -
  4384. - ath9k: Fix TX power calculation
  4385. -
  4386. - The commit, "ath9k_hw: Fix incorrect Tx control power in AR9003 template"
  4387. - fixed the incorrect values in the eeprom templates, but if
  4388. - boards have already been calibrated with incorrect values,
  4389. - they would still be using the wrong TX power. Fix this by assigning
  4390. - a default value in such cases.
  4391. -
  4392. - Cc: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
  4393. - Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4394. -
  4395. -commit b9f268b5b01331c3c82179abca551429450e9417
  4396. -Author: Michal Kazior <michal.kazior@tieto.com>
  4397. -Date: Wed Jan 29 14:22:27 2014 +0100
  4398. -
  4399. - cfg80211: consider existing DFS interfaces
  4400. -
  4401. - It was possible to break interface combinations in
  4402. - the following way:
  4403. -
  4404. - combo 1: iftype = AP, num_ifaces = 2, num_chans = 2,
  4405. - combo 2: iftype = AP, num_ifaces = 1, num_chans = 1, radar = HT20
  4406. -
  4407. - With the above interface combinations it was
  4408. - possible to:
  4409. -
  4410. - step 1. start AP on DFS channel by matching combo 2
  4411. - step 2. start AP on non-DFS channel by matching combo 1
  4412. -
  4413. - This was possible beacuse (step 2) did not consider
  4414. - if other interfaces require radar detection.
  4415. -
  4416. - The patch changes how cfg80211 tracks channels -
  4417. - instead of channel itself now a complete chandef
  4418. - is stored.
  4419. -
  4420. - Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
  4421. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4422. -
  4423. -commit bc9c62f5f511cc395c62dbf4cdd437f23db53b28
  4424. -Author: Antonio Quartulli <antonio@open-mesh.com>
  4425. -Date: Wed Jan 29 17:53:43 2014 +0100
  4426. -
  4427. - cfg80211: fix channel configuration in IBSS join
  4428. -
  4429. - When receiving an IBSS_JOINED event select the BSS object
  4430. - based on the {bssid, channel} couple rather than the bssid
  4431. - only.
  4432. - With the current approach if another cell having the same
  4433. - BSSID (but using a different channel) exists then cfg80211
  4434. - picks up the wrong BSS object.
  4435. - The result is a mismatching channel configuration between
  4436. - cfg80211 and the driver, that can lead to any sort of
  4437. - problem.
  4438. -
  4439. - The issue can be triggered by having an IBSS sitting on
  4440. - given channel and then asking the driver to create a new
  4441. - cell using the same BSSID but with a different frequency.
  4442. - By passing the channel to cfg80211_get_bss() we can solve
  4443. - this ambiguity and retrieve/create the correct BSS object.
  4444. - All the users of cfg80211_ibss_joined() have been changed
  4445. - accordingly.
  4446. -
  4447. - Moreover WARN when cfg80211_ibss_joined() gets a NULL
  4448. - channel as argument and remove a bogus call of the same
  4449. - function in ath6kl (it does not make sense to call
  4450. - cfg80211_ibss_joined() with a zero BSSID on ibss-leave).
  4451. -
  4452. - Cc: Kalle Valo <kvalo@qca.qualcomm.com>
  4453. - Cc: Arend van Spriel <arend@broadcom.com>
  4454. - Cc: Bing Zhao <bzhao@marvell.com>
  4455. - Cc: Jussi Kivilinna <jussi.kivilinna@iki.fi>
  4456. - Cc: libertas-dev@lists.infradead.org
  4457. - Acked-by: Kalle Valo <kvalo@qca.qualcomm.com>
  4458. - Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
  4459. - [minor code cleanup in ath6kl]
  4460. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4461. -
  4462. -commit 7e0c41cb41f215aba2c39b1c237bb4d42ec49a85
  4463. -Author: Johannes Berg <johannes.berg@intel.com>
  4464. -Date: Fri Jan 24 14:41:44 2014 +0100
  4465. -
  4466. - mac80211: fix bufferable MMPDU RX handling
  4467. -
  4468. - Action, disassoc and deauth frames are bufferable, and as such don't
  4469. - have the PM bit in the frame control field reserved which means we
  4470. - need to react to the bit when receiving in such a frame.
  4471. -
  4472. - Fix this by introducing a new helper ieee80211_is_bufferable_mmpdu()
  4473. - and using it for the RX path that currently ignores the PM bit in
  4474. - any non-data frames for doze->wake transitions, but listens to it in
  4475. - all frames for wake->doze transitions, both of which are wrong.
  4476. -
  4477. - Also use the new helper in the TX path to clean up the code.
  4478. -
  4479. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4480. -
  4481. -commit fc0df6d2343636e3f48a069330d5b972e3d8659d
  4482. -Author: Janusz Dziedzic <janusz.dziedzic@tieto.com>
  4483. -Date: Fri Jan 24 14:29:21 2014 +0100
  4484. -
  4485. - cfg80211: set preset_chandef after channel switch
  4486. -
  4487. - Set preset_chandef in channel switch notification.
  4488. - In other case we will have old preset_chandef.
  4489. -
  4490. - Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
  4491. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4492. -
  4493. -commit cdec895e2344987ff171cece96e25d7407a3ebf6
  4494. -Author: Simon Wunderlich <simon@open-mesh.com>
  4495. -Date: Fri Jan 24 23:48:29 2014 +0100
  4496. -
  4497. - mac80211: send ibss probe responses with noack flag
  4498. -
  4499. - Responding to probe requests for scanning clients will often create
  4500. - excessive retries, as it happens quite often that the scanning client
  4501. - already left the channel. Therefore do it like hostapd and send probe
  4502. - responses for wildcard SSID only once by using the noack flag.
  4503. -
  4504. - Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
  4505. - [fix typo & 'wildcard SSID' in commit log]
  4506. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4507. -
  4508. -commit 0b865d1e6b9c05052adae9315df7cb195dc60c3b
  4509. -Author: Luciano Coelho <luciano.coelho@intel.com>
  4510. -Date: Tue Jan 28 17:09:08 2014 +0200
  4511. -
  4512. - mac80211: ibss: remove unnecessary call to release channel
  4513. -
  4514. - The ieee80211_vif_use_channel() function calls
  4515. - ieee80211_vif_release_channel(), so there's no need to call it
  4516. - explicitly in __ieee80211_sta_join_ibss().
  4517. -
  4518. - Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
  4519. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4520. -
  4521. -commit e1b6c17e971f0a51ff86c2dac2584c63cd999cd7
  4522. -Author: Michal Kazior <michal.kazior@tieto.com>
  4523. -Date: Wed Jan 29 07:56:21 2014 +0100
  4524. -
  4525. - mac80211: add missing CSA locking
  4526. -
  4527. - The patch adds a missing sdata lock and adds a few
  4528. - lockdeps for easier maintenance.
  4529. -
  4530. - Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
  4531. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4532. -
  4533. -commit ad17ba7d14d225b109b73c177cd446afb8050598
  4534. -Author: Michal Kazior <michal.kazior@tieto.com>
  4535. -Date: Wed Jan 29 07:56:20 2014 +0100
  4536. -
  4537. - mac80211: fix sdata->radar_required locking
  4538. -
  4539. - radar_required setting wasn't protected by
  4540. - local->mtx in some places. This should prevent
  4541. - from scanning/radar detection/roc colliding.
  4542. -
  4543. - Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
  4544. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4545. -
  4546. -commit 5fcd5f1808813a3d9e502fd756e01bee8a79c85d
  4547. -Author: Michal Kazior <michal.kazior@tieto.com>
  4548. -Date: Wed Jan 29 07:56:19 2014 +0100
  4549. -
  4550. - mac80211: move csa_active setting in STA CSA
  4551. -
  4552. - The sdata->vif.csa_active could be left set after,
  4553. - e.g. channel context constraints check fail in STA
  4554. - mode leaving the interface in a strange state for
  4555. - a brief period of time until it is disconnected.
  4556. - This was harmless but ugly.
  4557. -
  4558. - Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
  4559. - Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
  4560. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4561. -
  4562. -commit e486da4b7eed71821c6b4c1bb9ac62ffd3ab13e9
  4563. -Author: Michal Kazior <michal.kazior@tieto.com>
  4564. -Date: Wed Jan 29 07:56:18 2014 +0100
  4565. -
  4566. - mac80211: fix possible memory leak on AP CSA failure
  4567. -
  4568. - If CSA for AP interface failed and the interface
  4569. - was not stopped afterwards another CSA request
  4570. - would leak sdata->u.ap.next_beacon.
  4571. -
  4572. - Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
  4573. - Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
  4574. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4575. -
  4576. -commit 3a77ba08940682bf3d52cf14f980337324af9d4a
  4577. -Author: Johannes Berg <johannes.berg@intel.com>
  4578. -Date: Sat Feb 1 00:33:29 2014 +0100
  4579. -
  4580. - mac80211: fix fragmentation code, particularly for encryption
  4581. -
  4582. - The "new" fragmentation code (since my rewrite almost 5 years ago)
  4583. - erroneously sets skb->len rather than using skb_trim() to adjust
  4584. - the length of the first fragment after copying out all the others.
  4585. - This leaves the skb tail pointer pointing to after where the data
  4586. - originally ended, and thus causes the encryption MIC to be written
  4587. - at that point, rather than where it belongs: immediately after the
  4588. - data.
  4589. -
  4590. - The impact of this is that if software encryption is done, then
  4591. - a) encryption doesn't work for the first fragment, the connection
  4592. - becomes unusable as the first fragment will never be properly
  4593. - verified at the receiver, the MIC is practically guaranteed to
  4594. - be wrong
  4595. - b) we leak up to 8 bytes of plaintext (!) of the packet out into
  4596. - the air
  4597. -
  4598. - This is only mitigated by the fact that many devices are capable
  4599. - of doing encryption in hardware, in which case this can't happen
  4600. - as the tail pointer is irrelevant in that case. Additionally,
  4601. - fragmentation is not used very frequently and would normally have
  4602. - to be configured manually.
  4603. -
  4604. - Fix this by using skb_trim() properly.
  4605. -
  4606. - Cc: stable@vger.kernel.org
  4607. - Fixes: 2de8e0d999b8 ("mac80211: rewrite fragmentation")
  4608. - Reported-by: Jouni Malinen <j@w1.fi>
  4609. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4610. -
  4611. -commit de5f242e0c10e841017e37eb8c38974a642dbca8
  4612. -Author: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4613. -Date: Tue Jan 28 06:21:59 2014 +0530
  4614. -
  4615. - ath9k: Fix build error on ARM
  4616. -
  4617. - Use mdelay instead of udelay to fix this error:
  4618. -
  4619. - ERROR: "__bad_udelay" [drivers/net/wireless/ath/ath9k/ath9k_hw.ko] undefined!
  4620. - make[1]: *** [__modpost] Error 1
  4621. - make: *** [modules] Error 2
  4622. -
  4623. - Reported-by: Josh Boyer <jwboyer@fedoraproject.org>
  4624. - Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
  4625. -
  4626. -commit 8e3ea7a51dfc61810fcefd947f6edcf61125252a
  4627. -Author: Geert Uytterhoeven <geert@linux-m68k.org>
  4628. -Date: Sun Jan 26 11:53:21 2014 +0100
  4629. -
  4630. - ath9k: Fix uninitialized variable in ath9k_has_tx_pending()
  4631. -
  4632. - drivers/net/wireless/ath/ath9k/main.c: In function ‘ath9k_has_tx_pending’:
  4633. - drivers/net/wireless/ath/ath9k/main.c:1869: warning: ‘npend’ may be used uninitialized in this function
  4634. -
  4635. - Introduced by commit 10e2318103f5941aa70c318afe34bc41f1b98529 ("ath9k:
  4636. - optimize ath9k_flush").
  4637. -
  4638. - Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
  4639. -
  4640. -commit a4a634a6937ebdd827fa58e8fcdb8ca49a3769f6
  4641. -Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
  4642. -Date: Mon Jan 27 11:07:42 2014 +0200
  4643. -
  4644. - mac80211: release the channel in error path in start_ap
  4645. -
  4646. - When the driver cannot start the AP or when the assignement
  4647. - of the beacon goes wrong, we need to unassign the vif.
  4648. -
  4649. - Cc: stable@vger.kernel.org
  4650. - Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
  4651. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4652. -
  4653. -commit dfb6889a75c601aedb7450b7e606668e77da6679
  4654. -Author: Johannes Berg <johannes.berg@intel.com>
  4655. -Date: Wed Jan 22 11:14:19 2014 +0200
  4656. -
  4657. - cfg80211: send scan results from work queue
  4658. -
  4659. - Due to the previous commit, when a scan finishes, it is in theory
  4660. - possible to hit the following sequence:
  4661. - 1. interface starts being removed
  4662. - 2. scan is cancelled by driver and cfg80211 is notified
  4663. - 3. scan done work is scheduled
  4664. - 4. interface is removed completely, rdev->scan_req is freed,
  4665. - event sent to userspace but scan done work remains pending
  4666. - 5. new scan is requested on another virtual interface
  4667. - 6. scan done work runs, freeing the still-running scan
  4668. -
  4669. - To fix this situation, hang on to the scan done message and block
  4670. - new scans while that is the case, and only send the message from
  4671. - the work function, regardless of whether the scan_req is already
  4672. - freed from interface removal. This makes step 5 above impossible
  4673. - and changes step 6 to be
  4674. - 5. scan done work runs, sending the scan done message
  4675. -
  4676. - As this can't work for wext, so we send the message immediately,
  4677. - but this shouldn't be an issue since we still return -EBUSY.
  4678. -
  4679. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4680. -
  4681. -commit 45b7ab41fc08627d9a8428cb413d5d84662a9707
  4682. -Author: Johannes Berg <johannes.berg@intel.com>
  4683. -Date: Wed Jan 22 11:14:18 2014 +0200
  4684. - cfg80211: fix scan done race
  4685. -
  4686. - When an interface/wdev is removed, any ongoing scan should be
  4687. - cancelled by the driver. This will make it call cfg80211, which
  4688. - only queues a work struct. If interface/wdev removal is quick
  4689. - enough, this can leave the scan request pending and processed
  4690. - only after the interface is gone, causing a use-after-free.
  4691. -
  4692. - Fix this by making sure the scan request is not pending after
  4693. - the interface is destroyed. We can't flush or cancel the work
  4694. - item due to locking concerns, but when it'll run it shouldn't
  4695. - find anything to do. This leaves a potential issue, if a new
  4696. - scan gets requested before the work runs, it prematurely stops
  4697. - the running scan, potentially causing another crash. I'll fix
  4698. - that in the next patch.
  4699. -
  4700. - This was particularly observed with P2P_DEVICE wdevs, likely
  4701. - because freeing them is quicker than freeing netdevs.
  4702. -
  4703. - Reported-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
  4704. - Fixes: 4a58e7c38443 ("cfg80211: don't "leak" uncompleted scans")
  4705. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4706. -
  4707. -commit ae04fa489ab31b5a10d3cc8399f52761175d4321
  4708. -Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
  4709. -Date: Thu Jan 23 14:28:16 2014 +0200
  4710. -
  4711. - mac80211: avoid deadlock revealed by lockdep
  4712. -
  4713. - sdata->u.ap.request_smps_work can’t be flushed synchronously
  4714. - under wdev_lock(wdev) since ieee80211_request_smps_ap_work
  4715. - itself locks the same lock.
  4716. - While at it, reset the driver_smps_mode when the ap is
  4717. - stopped to its default: OFF.
  4718. -
  4719. - This solves:
  4720. -
  4721. - ======================================================
  4722. - [ INFO: possible circular locking dependency detected ]
  4723. - 3.12.0-ipeer+ #2 Tainted: G O
  4724. - -------------------------------------------------------
  4725. - rmmod/2867 is trying to acquire lock:
  4726. - ((&sdata->u.ap.request_smps_work)){+.+...}, at: [<c105b8d0>] flush_work+0x0/0x90
  4727. -
  4728. - but task is already holding lock:
  4729. - (&wdev->mtx){+.+.+.}, at: [<f9b32626>] cfg80211_stop_ap+0x26/0x230 [cfg80211]
  4730. -
  4731. - which lock already depends on the new lock.
  4732. -
  4733. - the existing dependency chain (in reverse order) is:
  4734. -
  4735. - -> #1 (&wdev->mtx){+.+.+.}:
  4736. - [<c10aefa9>] lock_acquire+0x79/0xe0
  4737. - [<c1607a1a>] mutex_lock_nested+0x4a/0x360
  4738. - [<fb06288b>] ieee80211_request_smps_ap_work+0x2b/0x50 [mac80211]
  4739. - [<c105cdd8>] process_one_work+0x198/0x450
  4740. - [<c105d469>] worker_thread+0xf9/0x320
  4741. - [<c10669ff>] kthread+0x9f/0xb0
  4742. - [<c1613397>] ret_from_kernel_thread+0x1b/0x28
  4743. -
  4744. - -> #0 ((&sdata->u.ap.request_smps_work)){+.+...}:
  4745. - [<c10ae9df>] __lock_acquire+0x183f/0x1910
  4746. - [<c10aefa9>] lock_acquire+0x79/0xe0
  4747. - [<c105b917>] flush_work+0x47/0x90
  4748. - [<c105d867>] __cancel_work_timer+0x67/0xe0
  4749. - [<c105d90f>] cancel_work_sync+0xf/0x20
  4750. - [<fb0765cc>] ieee80211_stop_ap+0x8c/0x340 [mac80211]
  4751. - [<f9b3268c>] cfg80211_stop_ap+0x8c/0x230 [cfg80211]
  4752. - [<f9b0d8f9>] cfg80211_leave+0x79/0x100 [cfg80211]
  4753. - [<f9b0da72>] cfg80211_netdev_notifier_call+0xf2/0x4f0 [cfg80211]
  4754. - [<c160f2c9>] notifier_call_chain+0x59/0x130
  4755. - [<c106c6de>] __raw_notifier_call_chain+0x1e/0x30
  4756. - [<c106c70f>] raw_notifier_call_chain+0x1f/0x30
  4757. - [<c14f8213>] call_netdevice_notifiers_info+0x33/0x70
  4758. - [<c14f8263>] call_netdevice_notifiers+0x13/0x20
  4759. - [<c14f82a4>] __dev_close_many+0x34/0xb0
  4760. - [<c14f83fe>] dev_close_many+0x6e/0xc0
  4761. - [<c14f9c77>] rollback_registered_many+0xa7/0x1f0
  4762. - [<c14f9dd4>] unregister_netdevice_many+0x14/0x60
  4763. - [<fb06f4d9>] ieee80211_remove_interfaces+0xe9/0x170 [mac80211]
  4764. - [<fb055116>] ieee80211_unregister_hw+0x56/0x110 [mac80211]
  4765. - [<fa3e9396>] iwl_op_mode_mvm_stop+0x26/0xe0 [iwlmvm]
  4766. - [<f9b9d8ca>] _iwl_op_mode_stop+0x3a/0x70 [iwlwifi]
  4767. - [<f9b9d96f>] iwl_opmode_deregister+0x6f/0x90 [iwlwifi]
  4768. - [<fa405179>] __exit_compat+0xd/0x19 [iwlmvm]
  4769. - [<c10b8bf9>] SyS_delete_module+0x179/0x2b0
  4770. - [<c1613421>] sysenter_do_call+0x12/0x32
  4771. -
  4772. - Fixes: 687da132234f ("mac80211: implement SMPS for AP")
  4773. - Cc: <stable@vger.kernel.org> [3.13]
  4774. - Reported-by: Ilan Peer <ilan.peer@intel.com>
  4775. - Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
  4776. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4777. -
  4778. -commit 178b205e96217164fd7c30113464250d0b6f5eca
  4779. -Author: Johannes Berg <johannes.berg@intel.com>
  4780. -Date: Thu Jan 23 16:32:29 2014 +0100
  4781. -
  4782. - cfg80211: re-enable 5/10 MHz support
  4783. -
  4784. - Unfortunately I forgot this during the merge window, but the
  4785. - patch seems small enough to go in as a fix. The userspace API
  4786. - bug that was the reason for disabling it has long been fixed.
  4787. -
  4788. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4789. -
  4790. -commit 110a1c79acda14edc83b7c8dc5af9c7ddd23eb61
  4791. -Author: Pontus Fuchs <pontus.fuchs@gmail.com>
  4792. -Date: Thu Jan 16 15:00:40 2014 +0100
  4793. -
  4794. - nl80211: Reset split_start when netlink skb is exhausted
  4795. -
  4796. - When the netlink skb is exhausted split_start is left set. In the
  4797. - subsequent retry, with a larger buffer, the dump is continued from the
  4798. - failing point instead of from the beginning.
  4799. -
  4800. - This was causing my rt28xx based USB dongle to now show up when
  4801. - running "iw list" with an old iw version without split dump support.
  4802. -
  4803. - Cc: stable@vger.kernel.org
  4804. - Fixes: 3713b4e364ef ("nl80211: allow splitting wiphy information in dumps")
  4805. - Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
  4806. - [avoid the entire workaround when state->split is set]
  4807. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4808. -
  4809. -commit b4c31b45ffc7ef110fa9ecc34d7878fe7c5b9da4
  4810. -Author: Eliad Peller <eliad@wizery.com>
  4811. -Date: Sun Jan 12 11:06:37 2014 +0200
  4812. -
  4813. - mac80211: move roc cookie assignment earlier
  4814. -
  4815. - ieee80211_start_roc_work() might add a new roc
  4816. - to existing roc, and tell cfg80211 it has already
  4817. - started.
  4818. -
  4819. - However, this might happen before the roc cookie
  4820. - was set, resulting in REMAIN_ON_CHANNEL (started)
  4821. - event with null cookie. Consequently, it can make
  4822. - wpa_supplicant go out of sync.
  4823. -
  4824. - Fix it by setting the roc cookie earlier.
  4825. -
  4826. - Cc: stable@vger.kernel.org
  4827. - Signed-off-by: Eliad Peller <eliad@wizery.com>
  4828. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4829. -
  4830. -commit cfdc9157bfd7bcf88ab4dae08873a9907eba984c
  4831. -Author: Johannes Berg <johannes.berg@intel.com>
  4832. -Date: Fri Jan 24 14:06:29 2014 +0100
  4833. -
  4834. - nl80211: send event when AP operation is stopped
  4835. -
  4836. - There are a few cases, e.g. suspend, where an AP interface is
  4837. - stopped by the kernel rather than by userspace request, most
  4838. - commonly when suspending. To let userspace know about this,
  4839. - send the NL80211_CMD_STOP_AP command as an event every time
  4840. - an AP interface is stopped. This also happens when userspace
  4841. - did in fact request the AP stop, but that's not a problem.
  4842. -
  4843. - For full-MAC drivers this may need to be extended to also
  4844. - cover cases where the device stopped the AP operation for
  4845. - some reason, this a bit more complicated because then all
  4846. - cfg80211 state also needs to be reset; such API is not part
  4847. - of this patch.
  4848. -
  4849. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4850. -
  4851. -commit d5d567eda7704f190379ca852a8f9a4112e3eee3
  4852. -Author: Johannes Berg <johannes.berg@intel.com>
  4853. -Date: Thu Jan 23 16:20:29 2014 +0100
  4854. -
  4855. - mac80211: add length check in ieee80211_is_robust_mgmt_frame()
  4856. -
  4857. - A few places weren't checking that the frame passed to the
  4858. - function actually has enough data even though the function
  4859. - clearly documents it must have a payload byte. Make this
  4860. - safer by changing the function to take an skb and checking
  4861. - the length inside. The old version is preserved for now as
  4862. - the rtl* drivers use it and don't have a correct skb.
  4863. -
  4864. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4865. -
  4866. -commit f8f6d212a047fc65c7d3442dfc038f65517236fc
  4867. -Author: Johannes Berg <johannes.berg@intel.com>
  4868. -Date: Fri Jan 24 10:53:53 2014 +0100
  4869. -
  4870. - nl80211: fix scheduled scan RSSI matchset attribute confusion
  4871. -
  4872. - The scheduled scan matchsets were intended to be a list of filters,
  4873. - with the found BSS having to pass at least one of them to be passed
  4874. - to the host. When the RSSI attribute was added, however, this was
  4875. - broken and currently wpa_supplicant adds that attribute in its own
  4876. - matchset; however, it doesn't intend that to mean that anything
  4877. - that passes the RSSI filter should be passed to the host, instead
  4878. - it wants it to mean that everything needs to also have higher RSSI.
  4879. -
  4880. - This is semantically problematic because we have a list of filters
  4881. - like [ SSID1, SSID2, SSID3, RSSI ] with no real indication which
  4882. - one should be OR'ed and which one AND'ed.
  4883. -
  4884. - To fix this, move the RSSI filter attribute into each matchset. As
  4885. - we need to stay backward compatible, treat a matchset with only the
  4886. - RSSI attribute as a "default RSSI filter" for all other matchsets,
  4887. - but only if there are other matchsets (an RSSI-only matchset by
  4888. - itself is still desirable.)
  4889. -
  4890. - To make driver implementation easier, keep a global min_rssi_thold
  4891. - for the entire request as well. The only affected driver is ath6kl.
  4892. -
  4893. - I found this when I looked into the code after Raja Mani submitted
  4894. - a patch fixing the n_match_sets calculation to disregard the RSSI,
  4895. - but that patch didn't address the semantic issue.
  4896. -
  4897. - Reported-by: Raja Mani <rmani@qti.qualcomm.com>
  4898. - Acked-by: Luciano Coelho <luciano.coelho@intel.com>
  4899. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4900. -
  4901. -commit de553e8545e65a6dc4e45f43df7e1443d4291922
  4902. -Author: Johannes Berg <johannes.berg@intel.com>
  4903. -Date: Fri Jan 24 10:17:47 2014 +0100
  4904. -
  4905. - nl80211: check nla_parse() return values
  4906. -
  4907. - If there's a policy, then nla_parse() return values must be
  4908. - checked, otherwise the policy is useless and there's nothing
  4909. - that ensures the attributes are actually what we expect them
  4910. - to be.
  4911. -
  4912. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4913. -
  4914. -commit 652204a0733e9e1c54661d6f9d36e2e1e3b22bb1
  4915. -Author: Karl Beldan <karl.beldan@rivierawaves.com>
  4916. -Date: Thu Jan 23 20:06:34 2014 +0100
  4917. -
  4918. - mac80211: send {ADD,DEL}BA on AC_VO like other mgmt frames, as per spec
  4919. -
  4920. - ATM, {ADD,DEL}BA and BAR frames are sent on the AC matching the TID of
  4921. - the BA parameters. In the discussion [1] about this patch, Johannes
  4922. - recalled that it fixed some races with the DELBA and indeed this
  4923. - behavior was introduced in [2].
  4924. - While [2] is right for the BARs, the part queueing the {ADD,DEL}BAs on
  4925. - their BA params TID AC violates the spec and is more a workaround for
  4926. - some drivers. Helmut expressed some concerns wrt such drivers, in
  4927. - particular DELBAs in rt2x00.
  4928. -
  4929. - ATM, DELBAs are sent after a driver has called (hence "purposely")
  4930. - ieee80211_start_tx_ba_cb_irqsafe and Johannes and Emmanuel gave some
  4931. - details wrt intentions behind the split of the IEEE80211_AMPDU_TX_STOP_*
  4932. - given to the driver ampdu_action supposed to call this function, which
  4933. - could prove handy to people trying to do the right thing in faulty
  4934. - drivers (if their fw/hw don't get in their way).
  4935. -
  4936. - [1] http://mid.gmane.org/1390391564-18481-1-git-send-email-karl.beldan@gmail.com
  4937. - [2] Commit: cf6bb79ad828 ("mac80211: Use appropriate TID for sending BAR, ADDBA and DELBA frames")
  4938. -
  4939. - Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
  4940. - Cc: Helmut Schaa <helmut.schaa@googlemail.com>
  4941. - Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
  4942. - Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  4943. ---- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
  4944. -+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
  4945. -@@ -790,7 +790,7 @@ void ath6kl_cfg80211_connect_event(struc
  4946. - if (nw_type & ADHOC_NETWORK) {
  4947. - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "ad-hoc %s selected\n",
  4948. - nw_type & ADHOC_CREATOR ? "creator" : "joiner");
  4949. -- cfg80211_ibss_joined(vif->ndev, bssid, GFP_KERNEL);
  4950. -+ cfg80211_ibss_joined(vif->ndev, bssid, chan, GFP_KERNEL);
  4951. - cfg80211_put_bss(ar->wiphy, bss);
  4952. - return;
  4953. - }
  4954. -@@ -861,13 +861,9 @@ void ath6kl_cfg80211_disconnect_event(st
  4955. - }
  4956. -
  4957. - if (vif->nw_type & ADHOC_NETWORK) {
  4958. -- if (vif->wdev.iftype != NL80211_IFTYPE_ADHOC) {
  4959. -+ if (vif->wdev.iftype != NL80211_IFTYPE_ADHOC)
  4960. - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
  4961. - "%s: ath6k not in ibss mode\n", __func__);
  4962. -- return;
  4963. -- }
  4964. -- memset(bssid, 0, ETH_ALEN);
  4965. -- cfg80211_ibss_joined(vif->ndev, bssid, GFP_KERNEL);
  4966. - return;
  4967. - }
  4968. -
  4969. -@@ -3256,6 +3252,15 @@ static int ath6kl_cfg80211_sscan_start(s
  4970. - struct ath6kl_vif *vif = netdev_priv(dev);
  4971. - u16 interval;
  4972. - int ret, rssi_thold;
  4973. -+ int n_match_sets = request->n_match_sets;
  4974. -+
  4975. -+ /*
  4976. -+ * If there's a matchset w/o an SSID, then assume it's just for
  4977. -+ * the RSSI (nothing else is currently supported) and ignore it.
  4978. -+ * The device only supports a global RSSI filter that we set below.
  4979. -+ */
  4980. -+ if (n_match_sets == 1 && !request->match_sets[0].ssid.ssid_len)
  4981. -+ n_match_sets = 0;
  4982. -
  4983. - if (ar->state != ATH6KL_STATE_ON)
  4984. - return -EIO;
  4985. -@@ -3268,11 +3273,11 @@ static int ath6kl_cfg80211_sscan_start(s
  4986. - ret = ath6kl_set_probed_ssids(ar, vif, request->ssids,
  4987. - request->n_ssids,
  4988. - request->match_sets,
  4989. -- request->n_match_sets);
  4990. -+ n_match_sets);
  4991. - if (ret < 0)
  4992. - return ret;
  4993. -
  4994. -- if (!request->n_match_sets) {
  4995. -+ if (!n_match_sets) {
  4996. - ret = ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx,
  4997. - ALL_BSS_FILTER, 0);
  4998. - if (ret < 0)
  4999. -@@ -3286,12 +3291,12 @@ static int ath6kl_cfg80211_sscan_start(s
  5000. -
  5001. - if (test_bit(ATH6KL_FW_CAPABILITY_RSSI_SCAN_THOLD,
  5002. - ar->fw_capabilities)) {
  5003. -- if (request->rssi_thold <= NL80211_SCAN_RSSI_THOLD_OFF)
  5004. -+ if (request->min_rssi_thold <= NL80211_SCAN_RSSI_THOLD_OFF)
  5005. - rssi_thold = 0;
  5006. -- else if (request->rssi_thold < -127)
  5007. -+ else if (request->min_rssi_thold < -127)
  5008. - rssi_thold = -127;
  5009. - else
  5010. -- rssi_thold = request->rssi_thold;
  5011. -+ rssi_thold = request->min_rssi_thold;
  5012. -
  5013. - ret = ath6kl_wmi_set_rssi_filter_cmd(ar->wmi, vif->fw_vif_idx,
  5014. - rssi_thold);
  5015. ---- a/drivers/net/wireless/ath/ath9k/hw.c
  5016. -+++ b/drivers/net/wireless/ath/ath9k/hw.c
  5017. -@@ -1316,7 +1316,7 @@ static bool ath9k_hw_set_reset(struct at
  5018. - if (AR_SREV_9300_20_OR_LATER(ah))
  5019. - udelay(50);
  5020. - else if (AR_SREV_9100(ah))
  5021. -- udelay(10000);
  5022. -+ mdelay(10);
  5023. - else
  5024. - udelay(100);
  5025. -
  5026. -@@ -1534,7 +1534,7 @@ EXPORT_SYMBOL(ath9k_hw_check_nav);
  5027. - bool ath9k_hw_check_alive(struct ath_hw *ah)
  5028. - {
  5029. - int count = 50;
  5030. -- u32 reg;
  5031. -+ u32 reg, last_val;
  5032. -
  5033. - if (AR_SREV_9300(ah))
  5034. - return !ath9k_hw_detect_mac_hang(ah);
  5035. -@@ -1542,9 +1542,14 @@ bool ath9k_hw_check_alive(struct ath_hw
  5036. - if (AR_SREV_9285_12_OR_LATER(ah))
  5037. - return true;
  5038. -
  5039. -+ last_val = REG_READ(ah, AR_OBS_BUS_1);
  5040. - do {
  5041. - reg = REG_READ(ah, AR_OBS_BUS_1);
  5042. -+ if (reg != last_val)
  5043. -+ return true;
  5044. -
  5045. -+ udelay(1);
  5046. -+ last_val = reg;
  5047. - if ((reg & 0x7E7FFFEF) == 0x00702400)
  5048. - continue;
  5049. -
  5050. -@@ -2051,9 +2056,8 @@ static bool ath9k_hw_set_power_awake(str
  5051. -
  5052. - REG_SET_BIT(ah, AR_RTC_FORCE_WAKE,
  5053. - AR_RTC_FORCE_WAKE_EN);
  5054. --
  5055. - if (AR_SREV_9100(ah))
  5056. -- udelay(10000);
  5057. -+ mdelay(10);
  5058. - else
  5059. - udelay(50);
  5060. -
  5061. ---- a/drivers/net/wireless/ath/ath9k/main.c
  5062. -+++ b/drivers/net/wireless/ath/ath9k/main.c
  5063. -@@ -451,7 +451,7 @@ void ath9k_tasklet(unsigned long data)
  5064. - * interrupts are enabled in the reset routine.
  5065. - */
  5066. - atomic_inc(&ah->intr_ref_cnt);
  5067. -- ath_dbg(common, ANY, "FATAL: Skipping interrupts\n");
  5068. -+ ath_dbg(common, RESET, "FATAL: Skipping interrupts\n");
  5069. - goto out;
  5070. - }
  5071. -
  5072. -@@ -471,7 +471,7 @@ void ath9k_tasklet(unsigned long data)
  5073. - * interrupts are enabled in the reset routine.
  5074. - */
  5075. - atomic_inc(&ah->intr_ref_cnt);
  5076. -- ath_dbg(common, ANY,
  5077. -+ ath_dbg(common, RESET,
  5078. - "BB_WATCHDOG: Skipping interrupts\n");
  5079. - goto out;
  5080. - }
  5081. -@@ -484,7 +484,7 @@ void ath9k_tasklet(unsigned long data)
  5082. - type = RESET_TYPE_TX_GTT;
  5083. - ath9k_queue_reset(sc, type);
  5084. - atomic_inc(&ah->intr_ref_cnt);
  5085. -- ath_dbg(common, ANY,
  5086. -+ ath_dbg(common, RESET,
  5087. - "GTT: Skipping interrupts\n");
  5088. - goto out;
  5089. - }
  5090. -@@ -1866,7 +1866,7 @@ static void ath9k_set_coverage_class(str
  5091. -
  5092. - static bool ath9k_has_tx_pending(struct ath_softc *sc)
  5093. - {
  5094. -- int i, npend;
  5095. -+ int i, npend = 0;
  5096. -
  5097. - for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
  5098. - if (!ATH_TXQ_SETUP(sc, i))
  5099. ---- a/drivers/net/wireless/iwlwifi/mvm/scan.c
  5100. -+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
  5101. -@@ -595,6 +595,9 @@ static void iwl_scan_offload_build_ssid(
  5102. - * config match list.
  5103. - */
  5104. - for (i = 0; i < req->n_match_sets && i < PROBE_OPTION_MAX; i++) {
  5105. -+ /* skip empty SSID matchsets */
  5106. -+ if (!req->match_sets[i].ssid.ssid_len)
  5107. -+ continue;
  5108. - scan->direct_scan[i].id = WLAN_EID_SSID;
  5109. - scan->direct_scan[i].len = req->match_sets[i].ssid.ssid_len;
  5110. - memcpy(scan->direct_scan[i].ssid, req->match_sets[i].ssid.ssid,
  5111. ---- a/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c
  5112. -+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/trx.c
  5113. -@@ -452,7 +452,7 @@ bool rtl88ee_rx_query_desc(struct ieee80
  5114. - /* During testing, hdr was NULL */
  5115. - return false;
  5116. - }
  5117. -- if ((ieee80211_is_robust_mgmt_frame(hdr)) &&
  5118. -+ if ((_ieee80211_is_robust_mgmt_frame(hdr)) &&
  5119. - (ieee80211_has_protected(hdr->frame_control)))
  5120. - rx_status->flag &= ~RX_FLAG_DECRYPTED;
  5121. - else
  5122. ---- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
  5123. -+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
  5124. -@@ -393,7 +393,7 @@ bool rtl92ce_rx_query_desc(struct ieee80
  5125. - /* In testing, hdr was NULL here */
  5126. - return false;
  5127. - }
  5128. -- if ((ieee80211_is_robust_mgmt_frame(hdr)) &&
  5129. -+ if ((_ieee80211_is_robust_mgmt_frame(hdr)) &&
  5130. - (ieee80211_has_protected(hdr->frame_control)))
  5131. - rx_status->flag &= ~RX_FLAG_DECRYPTED;
  5132. - else
  5133. ---- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
  5134. -+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
  5135. -@@ -310,7 +310,7 @@ bool rtl92se_rx_query_desc(struct ieee80
  5136. - /* during testing, hdr was NULL here */
  5137. - return false;
  5138. - }
  5139. -- if ((ieee80211_is_robust_mgmt_frame(hdr)) &&
  5140. -+ if ((_ieee80211_is_robust_mgmt_frame(hdr)) &&
  5141. - (ieee80211_has_protected(hdr->frame_control)))
  5142. - rx_status->flag &= ~RX_FLAG_DECRYPTED;
  5143. - else
  5144. ---- a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
  5145. -+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
  5146. -@@ -334,7 +334,7 @@ bool rtl8723ae_rx_query_desc(struct ieee
  5147. - /* during testing, hdr could be NULL here */
  5148. - return false;
  5149. - }
  5150. -- if ((ieee80211_is_robust_mgmt_frame(hdr)) &&
  5151. -+ if ((_ieee80211_is_robust_mgmt_frame(hdr)) &&
  5152. - (ieee80211_has_protected(hdr->frame_control)))
  5153. - rx_status->flag &= ~RX_FLAG_DECRYPTED;
  5154. - else
  5155. ---- a/include/linux/ieee80211.h
  5156. -+++ b/include/linux/ieee80211.h
  5157. -@@ -597,6 +597,20 @@ static inline int ieee80211_is_qos_nullf
  5158. - }
  5159. -
  5160. - /**
  5161. -+ * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU
  5162. -+ * @fc: frame control field in little-endian byteorder
  5163. -+ */
  5164. -+static inline bool ieee80211_is_bufferable_mmpdu(__le16 fc)
  5165. -+{
  5166. -+ /* IEEE 802.11-2012, definition of "bufferable management frame";
  5167. -+ * note that this ignores the IBSS special case. */
  5168. -+ return ieee80211_is_mgmt(fc) &&
  5169. -+ (ieee80211_is_action(fc) ||
  5170. -+ ieee80211_is_disassoc(fc) ||
  5171. -+ ieee80211_is_deauth(fc));
  5172. -+}
  5173. -+
  5174. -+/**
  5175. - * ieee80211_is_first_frag - check if IEEE80211_SCTL_FRAG is not set
  5176. - * @seq_ctrl: frame sequence control bytes in little-endian byteorder
  5177. - */
  5178. -@@ -2192,10 +2206,10 @@ static inline u8 *ieee80211_get_DA(struc
  5179. - }
  5180. -
  5181. - /**
  5182. -- * ieee80211_is_robust_mgmt_frame - check if frame is a robust management frame
  5183. -+ * _ieee80211_is_robust_mgmt_frame - check if frame is a robust management frame
  5184. - * @hdr: the frame (buffer must include at least the first octet of payload)
  5185. - */
  5186. --static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
  5187. -+static inline bool _ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
  5188. - {
  5189. - if (ieee80211_is_disassoc(hdr->frame_control) ||
  5190. - ieee80211_is_deauth(hdr->frame_control))
  5191. -@@ -2224,6 +2238,17 @@ static inline bool ieee80211_is_robust_m
  5192. - }
  5193. -
  5194. - /**
  5195. -+ * ieee80211_is_robust_mgmt_frame - check if skb contains a robust mgmt frame
  5196. -+ * @skb: the skb containing the frame, length will be checked
  5197. -+ */
  5198. -+static inline bool ieee80211_is_robust_mgmt_frame(struct sk_buff *skb)
  5199. -+{
  5200. -+ if (skb->len < 25)
  5201. -+ return false;
  5202. -+ return _ieee80211_is_robust_mgmt_frame((void *)skb->data);
  5203. -+}
  5204. -+
  5205. -+/**
  5206. - * ieee80211_is_public_action - check if frame is a public action frame
  5207. - * @hdr: the frame
  5208. - * @len: length of the frame
  5209. ---- a/include/net/cfg80211.h
  5210. -+++ b/include/net/cfg80211.h
  5211. -@@ -1395,9 +1395,11 @@ struct cfg80211_scan_request {
  5212. - * struct cfg80211_match_set - sets of attributes to match
  5213. - *
  5214. - * @ssid: SSID to be matched
  5215. -+ * @rssi_thold: don't report scan results below this threshold (in s32 dBm)
  5216. - */
  5217. - struct cfg80211_match_set {
  5218. - struct cfg80211_ssid ssid;
  5219. -+ s32 rssi_thold;
  5220. - };
  5221. -
  5222. - /**
  5223. -@@ -1420,7 +1422,8 @@ struct cfg80211_match_set {
  5224. - * @dev: the interface
  5225. - * @scan_start: start time of the scheduled scan
  5226. - * @channels: channels to scan
  5227. -- * @rssi_thold: don't report scan results below this threshold (in s32 dBm)
  5228. -+ * @min_rssi_thold: for drivers only supporting a single threshold, this
  5229. -+ * contains the minimum over all matchsets
  5230. - */
  5231. - struct cfg80211_sched_scan_request {
  5232. - struct cfg80211_ssid *ssids;
  5233. -@@ -1433,7 +1436,7 @@ struct cfg80211_sched_scan_request {
  5234. - u32 flags;
  5235. - struct cfg80211_match_set *match_sets;
  5236. - int n_match_sets;
  5237. -- s32 rssi_thold;
  5238. -+ s32 min_rssi_thold;
  5239. -
  5240. - /* internal */
  5241. - struct wiphy *wiphy;
  5242. -@@ -3130,8 +3133,8 @@ struct cfg80211_cached_keys;
  5243. - * @identifier: (private) Identifier used in nl80211 to identify this
  5244. - * wireless device if it has no netdev
  5245. - * @current_bss: (private) Used by the internal configuration code
  5246. -- * @channel: (private) Used by the internal configuration code to track
  5247. -- * the user-set AP, monitor and WDS channel
  5248. -+ * @chandef: (private) Used by the internal configuration code to track
  5249. -+ * the user-set channel definition.
  5250. - * @preset_chandef: (private) Used by the internal configuration code to
  5251. - * track the channel to be used for AP later
  5252. - * @bssid: (private) Used by the internal configuration code
  5253. -@@ -3195,9 +3198,7 @@ struct wireless_dev {
  5254. -
  5255. - struct cfg80211_internal_bss *current_bss; /* associated / joined */
  5256. - struct cfg80211_chan_def preset_chandef;
  5257. --
  5258. -- /* for AP and mesh channel tracking */
  5259. -- struct ieee80211_channel *channel;
  5260. -+ struct cfg80211_chan_def chandef;
  5261. -
  5262. - bool ibss_fixed;
  5263. - bool ibss_dfs_possible;
  5264. -@@ -3879,6 +3880,7 @@ void cfg80211_michael_mic_failure(struct
  5265. - *
  5266. - * @dev: network device
  5267. - * @bssid: the BSSID of the IBSS joined
  5268. -+ * @channel: the channel of the IBSS joined
  5269. - * @gfp: allocation flags
  5270. - *
  5271. - * This function notifies cfg80211 that the device joined an IBSS or
  5272. -@@ -3888,7 +3890,8 @@ void cfg80211_michael_mic_failure(struct
  5273. - * with the locally generated beacon -- this guarantees that there is
  5274. - * always a scan result for this IBSS. cfg80211 will handle the rest.
  5275. - */
  5276. --void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp);
  5277. -+void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,
  5278. -+ struct ieee80211_channel *channel, gfp_t gfp);
  5279. -
  5280. - /**
  5281. - * cfg80211_notify_new_candidate - notify cfg80211 of a new mesh peer candidate
  5282. ---- a/include/uapi/linux/nl80211.h
  5283. -+++ b/include/uapi/linux/nl80211.h
  5284. -@@ -2442,9 +2442,15 @@ enum nl80211_reg_rule_attr {
  5285. - * enum nl80211_sched_scan_match_attr - scheduled scan match attributes
  5286. - * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved
  5287. - * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching,
  5288. -- * only report BSS with matching SSID.
  5289. -+ * only report BSS with matching SSID.
  5290. - * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a
  5291. -- * BSS in scan results. Filtering is turned off if not specified.
  5292. -+ * BSS in scan results. Filtering is turned off if not specified. Note that
  5293. -+ * if this attribute is in a match set of its own, then it is treated as
  5294. -+ * the default value for all matchsets with an SSID, rather than being a
  5295. -+ * matchset of its own without an RSSI filter. This is due to problems with
  5296. -+ * how this API was implemented in the past. Also, due to the same problem,
  5297. -+ * the only way to create a matchset with only an RSSI filter (with this
  5298. -+ * attribute) is if there's only a single matchset with the RSSI attribute.
  5299. - * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
  5300. - * attribute number currently defined
  5301. - * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
  5302. ---- a/net/mac80211/agg-tx.c
  5303. -+++ b/net/mac80211/agg-tx.c
  5304. -@@ -107,7 +107,7 @@ static void ieee80211_send_addba_request
  5305. - mgmt->u.action.u.addba_req.start_seq_num =
  5306. - cpu_to_le16(start_seq_num << 4);
  5307. -
  5308. -- ieee80211_tx_skb_tid(sdata, skb, tid);
  5309. -+ ieee80211_tx_skb(sdata, skb);
  5310. - }
  5311. -
  5312. - void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn)
  5313. ---- a/net/mac80211/cfg.c
  5314. -+++ b/net/mac80211/cfg.c
  5315. -@@ -970,9 +970,9 @@ static int ieee80211_start_ap(struct wip
  5316. - /* TODO: make hostapd tell us what it wants */
  5317. - sdata->smps_mode = IEEE80211_SMPS_OFF;
  5318. - sdata->needed_rx_chains = sdata->local->rx_chains;
  5319. -- sdata->radar_required = params->radar_required;
  5320. -
  5321. - mutex_lock(&local->mtx);
  5322. -+ sdata->radar_required = params->radar_required;
  5323. - err = ieee80211_vif_use_channel(sdata, &params->chandef,
  5324. - IEEE80211_CHANCTX_SHARED);
  5325. - mutex_unlock(&local->mtx);
  5326. -@@ -1021,8 +1021,10 @@ static int ieee80211_start_ap(struct wip
  5327. - IEEE80211_P2P_OPPPS_ENABLE_BIT;
  5328. -
  5329. - err = ieee80211_assign_beacon(sdata, &params->beacon);
  5330. -- if (err < 0)
  5331. -+ if (err < 0) {
  5332. -+ ieee80211_vif_release_channel(sdata);
  5333. - return err;
  5334. -+ }
  5335. - changed |= err;
  5336. -
  5337. - err = drv_start_ap(sdata->local, sdata);
  5338. -@@ -1032,6 +1034,7 @@ static int ieee80211_start_ap(struct wip
  5339. - if (old)
  5340. - kfree_rcu(old, rcu_head);
  5341. - RCU_INIT_POINTER(sdata->u.ap.beacon, NULL);
  5342. -+ ieee80211_vif_release_channel(sdata);
  5343. - return err;
  5344. - }
  5345. -
  5346. -@@ -1053,6 +1056,7 @@ static int ieee80211_change_beacon(struc
  5347. - int err;
  5348. -
  5349. - sdata = IEEE80211_DEV_TO_SUB_IF(dev);
  5350. -+ sdata_assert_lock(sdata);
  5351. -
  5352. - /* don't allow changing the beacon while CSA is in place - offset
  5353. - * of channel switch counter may change
  5354. -@@ -1080,6 +1084,8 @@ static int ieee80211_stop_ap(struct wiph
  5355. - struct probe_resp *old_probe_resp;
  5356. - struct cfg80211_chan_def chandef;
  5357. -
  5358. -+ sdata_assert_lock(sdata);
  5359. -+
  5360. - old_beacon = sdata_dereference(sdata->u.ap.beacon, sdata);
  5361. - if (!old_beacon)
  5362. - return -ENOENT;
  5363. -@@ -1090,8 +1096,6 @@ static int ieee80211_stop_ap(struct wiph
  5364. - kfree(sdata->u.ap.next_beacon);
  5365. - sdata->u.ap.next_beacon = NULL;
  5366. -
  5367. -- cancel_work_sync(&sdata->u.ap.request_smps_work);
  5368. --
  5369. - /* turn off carrier for this interface and dependent VLANs */
  5370. - list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
  5371. - netif_carrier_off(vlan->dev);
  5372. -@@ -1103,6 +1107,7 @@ static int ieee80211_stop_ap(struct wiph
  5373. - kfree_rcu(old_beacon, rcu_head);
  5374. - if (old_probe_resp)
  5375. - kfree_rcu(old_probe_resp, rcu_head);
  5376. -+ sdata->u.ap.driver_smps_mode = IEEE80211_SMPS_OFF;
  5377. -
  5378. - __sta_info_flush(sdata, true);
  5379. - ieee80211_free_keys(sdata, true);
  5380. -@@ -1988,6 +1993,9 @@ static int ieee80211_change_bss(struct w
  5381. -
  5382. - band = ieee80211_get_sdata_band(sdata);
  5383. -
  5384. -+ if (WARN_ON(!wiphy->bands[band]))
  5385. -+ return -EINVAL;
  5386. -+
  5387. - if (params->use_cts_prot >= 0) {
  5388. - sdata->vif.bss_conf.use_cts_prot = params->use_cts_prot;
  5389. - changed |= BSS_CHANGED_ERP_CTS_PROT;
  5390. -@@ -2638,6 +2646,24 @@ static int ieee80211_start_roc_work(stru
  5391. - INIT_DELAYED_WORK(&roc->work, ieee80211_sw_roc_work);
  5392. - INIT_LIST_HEAD(&roc->dependents);
  5393. -
  5394. -+ /*
  5395. -+ * cookie is either the roc cookie (for normal roc)
  5396. -+ * or the SKB (for mgmt TX)
  5397. -+ */
  5398. -+ if (!txskb) {
  5399. -+ /* local->mtx protects this */
  5400. -+ local->roc_cookie_counter++;
  5401. -+ roc->cookie = local->roc_cookie_counter;
  5402. -+ /* wow, you wrapped 64 bits ... more likely a bug */
  5403. -+ if (WARN_ON(roc->cookie == 0)) {
  5404. -+ roc->cookie = 1;
  5405. -+ local->roc_cookie_counter++;
  5406. -+ }
  5407. -+ *cookie = roc->cookie;
  5408. -+ } else {
  5409. -+ *cookie = (unsigned long)txskb;
  5410. -+ }
  5411. -+
  5412. - /* if there's one pending or we're scanning, queue this one */
  5413. - if (!list_empty(&local->roc_list) ||
  5414. - local->scanning || local->radar_detect_enabled)
  5415. -@@ -2772,24 +2798,6 @@ static int ieee80211_start_roc_work(stru
  5416. - if (!queued)
  5417. - list_add_tail(&roc->list, &local->roc_list);
  5418. -
  5419. -- /*
  5420. -- * cookie is either the roc cookie (for normal roc)
  5421. -- * or the SKB (for mgmt TX)
  5422. -- */
  5423. -- if (!txskb) {
  5424. -- /* local->mtx protects this */
  5425. -- local->roc_cookie_counter++;
  5426. -- roc->cookie = local->roc_cookie_counter;
  5427. -- /* wow, you wrapped 64 bits ... more likely a bug */
  5428. -- if (WARN_ON(roc->cookie == 0)) {
  5429. -- roc->cookie = 1;
  5430. -- local->roc_cookie_counter++;
  5431. -- }
  5432. -- *cookie = roc->cookie;
  5433. -- } else {
  5434. -- *cookie = (unsigned long)txskb;
  5435. -- }
  5436. --
  5437. - return 0;
  5438. - }
  5439. -
  5440. -@@ -3004,8 +3012,10 @@ void ieee80211_csa_finalize_work(struct
  5441. - if (!ieee80211_sdata_running(sdata))
  5442. - goto unlock;
  5443. -
  5444. -- sdata->radar_required = sdata->csa_radar_required;
  5445. -+ sdata_assert_lock(sdata);
  5446. -+
  5447. - mutex_lock(&local->mtx);
  5448. -+ sdata->radar_required = sdata->csa_radar_required;
  5449. - err = ieee80211_vif_change_channel(sdata, &changed);
  5450. - mutex_unlock(&local->mtx);
  5451. - if (WARN_ON(err < 0))
  5452. -@@ -3022,13 +3032,13 @@ void ieee80211_csa_finalize_work(struct
  5453. - switch (sdata->vif.type) {
  5454. - case NL80211_IFTYPE_AP:
  5455. - err = ieee80211_assign_beacon(sdata, sdata->u.ap.next_beacon);
  5456. -+ kfree(sdata->u.ap.next_beacon);
  5457. -+ sdata->u.ap.next_beacon = NULL;
  5458. -+
  5459. - if (err < 0)
  5460. - goto unlock;
  5461. -
  5462. - changed |= err;
  5463. -- kfree(sdata->u.ap.next_beacon);
  5464. -- sdata->u.ap.next_beacon = NULL;
  5465. --
  5466. - ieee80211_bss_info_change_notify(sdata, err);
  5467. - break;
  5468. - case NL80211_IFTYPE_ADHOC:
  5469. -@@ -3066,7 +3076,7 @@ int ieee80211_channel_switch(struct wiph
  5470. - struct ieee80211_if_mesh __maybe_unused *ifmsh;
  5471. - int err, num_chanctx;
  5472. -
  5473. -- lockdep_assert_held(&sdata->wdev.mtx);
  5474. -+ sdata_assert_lock(sdata);
  5475. -
  5476. - if (!list_empty(&local->roc_list) || local->scanning)
  5477. - return -EBUSY;
  5478. ---- a/net/mac80211/ht.c
  5479. -+++ b/net/mac80211/ht.c
  5480. -@@ -375,7 +375,7 @@ void ieee80211_send_delba(struct ieee802
  5481. - mgmt->u.action.u.delba.params = cpu_to_le16(params);
  5482. - mgmt->u.action.u.delba.reason_code = cpu_to_le16(reason_code);
  5483. -
  5484. -- ieee80211_tx_skb_tid(sdata, skb, tid);
  5485. -+ ieee80211_tx_skb(sdata, skb);
  5486. - }
  5487. -
  5488. - void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
  5489. -@@ -466,7 +466,9 @@ void ieee80211_request_smps_ap_work(stru
  5490. - u.ap.request_smps_work);
  5491. -
  5492. - sdata_lock(sdata);
  5493. -- __ieee80211_request_smps_ap(sdata, sdata->u.ap.driver_smps_mode);
  5494. -+ if (sdata_dereference(sdata->u.ap.beacon, sdata))
  5495. -+ __ieee80211_request_smps_ap(sdata,
  5496. -+ sdata->u.ap.driver_smps_mode);
  5497. - sdata_unlock(sdata);
  5498. - }
  5499. -
  5500. ---- a/net/mac80211/iface.c
  5501. -+++ b/net/mac80211/iface.c
  5502. -@@ -770,12 +770,19 @@ static void ieee80211_do_stop(struct iee
  5503. -
  5504. - ieee80211_roc_purge(local, sdata);
  5505. -
  5506. -- if (sdata->vif.type == NL80211_IFTYPE_STATION)
  5507. -+ switch (sdata->vif.type) {
  5508. -+ case NL80211_IFTYPE_STATION:
  5509. - ieee80211_mgd_stop(sdata);
  5510. --
  5511. -- if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
  5512. -+ break;
  5513. -+ case NL80211_IFTYPE_ADHOC:
  5514. - ieee80211_ibss_stop(sdata);
  5515. --
  5516. -+ break;
  5517. -+ case NL80211_IFTYPE_AP:
  5518. -+ cancel_work_sync(&sdata->u.ap.request_smps_work);
  5519. -+ break;
  5520. -+ default:
  5521. -+ break;
  5522. -+ }
  5523. -
  5524. - /*
  5525. - * Remove all stations associated with this interface.
  5526. -@@ -827,7 +834,9 @@ static void ieee80211_do_stop(struct iee
  5527. - cancel_work_sync(&local->dynamic_ps_enable_work);
  5528. -
  5529. - cancel_work_sync(&sdata->recalc_smps);
  5530. -+ sdata_lock(sdata);
  5531. - sdata->vif.csa_active = false;
  5532. -+ sdata_unlock(sdata);
  5533. - cancel_work_sync(&sdata->csa_finalize_work);
  5534. -
  5535. - cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
  5536. ---- a/net/mac80211/rx.c
  5537. -+++ b/net/mac80211/rx.c
  5538. -@@ -599,10 +599,10 @@ static int ieee80211_is_unicast_robust_m
  5539. - {
  5540. - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
  5541. -
  5542. -- if (skb->len < 24 || is_multicast_ether_addr(hdr->addr1))
  5543. -+ if (is_multicast_ether_addr(hdr->addr1))
  5544. - return 0;
  5545. -
  5546. -- return ieee80211_is_robust_mgmt_frame(hdr);
  5547. -+ return ieee80211_is_robust_mgmt_frame(skb);
  5548. - }
  5549. -
  5550. -
  5551. -@@ -610,10 +610,10 @@ static int ieee80211_is_multicast_robust
  5552. - {
  5553. - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
  5554. -
  5555. -- if (skb->len < 24 || !is_multicast_ether_addr(hdr->addr1))
  5556. -+ if (!is_multicast_ether_addr(hdr->addr1))
  5557. - return 0;
  5558. -
  5559. -- return ieee80211_is_robust_mgmt_frame(hdr);
  5560. -+ return ieee80211_is_robust_mgmt_frame(skb);
  5561. - }
  5562. -
  5563. -
  5564. -@@ -626,7 +626,7 @@ static int ieee80211_get_mmie_keyidx(str
  5565. - if (skb->len < 24 + sizeof(*mmie) || !is_multicast_ether_addr(hdr->da))
  5566. - return -1;
  5567. -
  5568. -- if (!ieee80211_is_robust_mgmt_frame((struct ieee80211_hdr *) hdr))
  5569. -+ if (!ieee80211_is_robust_mgmt_frame(skb))
  5570. - return -1; /* not a robust management frame */
  5571. -
  5572. - mmie = (struct ieee80211_mmie *)
  5573. -@@ -1128,6 +1128,13 @@ static void sta_ps_end(struct sta_info *
  5574. - sta->sta.addr, sta->sta.aid);
  5575. -
  5576. - if (test_sta_flag(sta, WLAN_STA_PS_DRIVER)) {
  5577. -+ /*
  5578. -+ * Clear the flag only if the other one is still set
  5579. -+ * so that the TX path won't start TX'ing new frames
  5580. -+ * directly ... In the case that the driver flag isn't
  5581. -+ * set ieee80211_sta_ps_deliver_wakeup() will clear it.
  5582. -+ */
  5583. -+ clear_sta_flag(sta, WLAN_STA_PS_STA);
  5584. - ps_dbg(sta->sdata, "STA %pM aid %d driver-ps-blocked\n",
  5585. - sta->sta.addr, sta->sta.aid);
  5586. - return;
  5587. -@@ -1311,18 +1318,15 @@ ieee80211_rx_h_sta_process(struct ieee80
  5588. - !ieee80211_has_morefrags(hdr->frame_control) &&
  5589. - !(status->rx_flags & IEEE80211_RX_DEFERRED_RELEASE) &&
  5590. - (rx->sdata->vif.type == NL80211_IFTYPE_AP ||
  5591. -- rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) {
  5592. -+ rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) &&
  5593. -+ /* PM bit is only checked in frames where it isn't reserved,
  5594. -+ * in AP mode it's reserved in non-bufferable management frames
  5595. -+ * (cf. IEEE 802.11-2012 8.2.4.1.7 Power Management field)
  5596. -+ */
  5597. -+ (!ieee80211_is_mgmt(hdr->frame_control) ||
  5598. -+ ieee80211_is_bufferable_mmpdu(hdr->frame_control))) {
  5599. - if (test_sta_flag(sta, WLAN_STA_PS_STA)) {
  5600. -- /*
  5601. -- * Ignore doze->wake transitions that are
  5602. -- * indicated by non-data frames, the standard
  5603. -- * is unclear here, but for example going to
  5604. -- * PS mode and then scanning would cause a
  5605. -- * doze->wake transition for the probe request,
  5606. -- * and that is clearly undesirable.
  5607. -- */
  5608. -- if (ieee80211_is_data(hdr->frame_control) &&
  5609. -- !ieee80211_has_pm(hdr->frame_control))
  5610. -+ if (!ieee80211_has_pm(hdr->frame_control))
  5611. - sta_ps_end(sta);
  5612. - } else {
  5613. - if (ieee80211_has_pm(hdr->frame_control))
  5614. -@@ -1845,8 +1849,7 @@ static int ieee80211_drop_unencrypted_mg
  5615. - * having configured keys.
  5616. - */
  5617. - if (unlikely(ieee80211_is_action(fc) && !rx->key &&
  5618. -- ieee80211_is_robust_mgmt_frame(
  5619. -- (struct ieee80211_hdr *) rx->skb->data)))
  5620. -+ ieee80211_is_robust_mgmt_frame(rx->skb)))
  5621. - return -EACCES;
  5622. - }
  5623. -
  5624. ---- a/net/mac80211/tx.c
  5625. -+++ b/net/mac80211/tx.c
  5626. -@@ -452,8 +452,7 @@ static int ieee80211_use_mfp(__le16 fc,
  5627. - if (sta == NULL || !test_sta_flag(sta, WLAN_STA_MFP))
  5628. - return 0;
  5629. -
  5630. -- if (!ieee80211_is_robust_mgmt_frame((struct ieee80211_hdr *)
  5631. -- skb->data))
  5632. -+ if (!ieee80211_is_robust_mgmt_frame(skb))
  5633. - return 0;
  5634. -
  5635. - return 1;
  5636. -@@ -478,6 +477,20 @@ ieee80211_tx_h_unicast_ps_buf(struct iee
  5637. - sta->sta.addr, sta->sta.aid, ac);
  5638. - if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER)
  5639. - purge_old_ps_buffers(tx->local);
  5640. -+
  5641. -+ /* sync with ieee80211_sta_ps_deliver_wakeup */
  5642. -+ spin_lock(&sta->ps_lock);
  5643. -+ /*
  5644. -+ * STA woke up the meantime and all the frames on ps_tx_buf have
  5645. -+ * been queued to pending queue. No reordering can happen, go
  5646. -+ * ahead and Tx the packet.
  5647. -+ */
  5648. -+ if (!test_sta_flag(sta, WLAN_STA_PS_STA) &&
  5649. -+ !test_sta_flag(sta, WLAN_STA_PS_DRIVER)) {
  5650. -+ spin_unlock(&sta->ps_lock);
  5651. -+ return TX_CONTINUE;
  5652. -+ }
  5653. -+
  5654. - if (skb_queue_len(&sta->ps_tx_buf[ac]) >= STA_MAX_TX_BUFFER) {
  5655. - struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf[ac]);
  5656. - ps_dbg(tx->sdata,
  5657. -@@ -492,6 +505,7 @@ ieee80211_tx_h_unicast_ps_buf(struct iee
  5658. - info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
  5659. - info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS;
  5660. - skb_queue_tail(&sta->ps_tx_buf[ac], tx->skb);
  5661. -+ spin_unlock(&sta->ps_lock);
  5662. -
  5663. - if (!timer_pending(&local->sta_cleanup))
  5664. - mod_timer(&local->sta_cleanup,
  5665. -@@ -525,9 +539,7 @@ ieee80211_tx_h_ps_buf(struct ieee80211_t
  5666. -
  5667. - /* only deauth, disassoc and action are bufferable MMPDUs */
  5668. - if (ieee80211_is_mgmt(hdr->frame_control) &&
  5669. -- !ieee80211_is_deauth(hdr->frame_control) &&
  5670. -- !ieee80211_is_disassoc(hdr->frame_control) &&
  5671. -- !ieee80211_is_action(hdr->frame_control)) {
  5672. -+ !ieee80211_is_bufferable_mmpdu(hdr->frame_control)) {
  5673. - if (tx->flags & IEEE80211_TX_UNICAST)
  5674. - info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER;
  5675. - return TX_CONTINUE;
  5676. -@@ -567,7 +579,7 @@ ieee80211_tx_h_select_key(struct ieee802
  5677. - tx->key = key;
  5678. - else if (ieee80211_is_mgmt(hdr->frame_control) &&
  5679. - is_multicast_ether_addr(hdr->addr1) &&
  5680. -- ieee80211_is_robust_mgmt_frame(hdr) &&
  5681. -+ ieee80211_is_robust_mgmt_frame(tx->skb) &&
  5682. - (key = rcu_dereference(tx->sdata->default_mgmt_key)))
  5683. - tx->key = key;
  5684. - else if (is_multicast_ether_addr(hdr->addr1) &&
  5685. -@@ -582,12 +594,12 @@ ieee80211_tx_h_select_key(struct ieee802
  5686. - tx->key = NULL;
  5687. - else if (tx->skb->protocol == tx->sdata->control_port_protocol)
  5688. - tx->key = NULL;
  5689. -- else if (ieee80211_is_robust_mgmt_frame(hdr) &&
  5690. -+ else if (ieee80211_is_robust_mgmt_frame(tx->skb) &&
  5691. - !(ieee80211_is_action(hdr->frame_control) &&
  5692. - tx->sta && test_sta_flag(tx->sta, WLAN_STA_MFP)))
  5693. - tx->key = NULL;
  5694. - else if (ieee80211_is_mgmt(hdr->frame_control) &&
  5695. -- !ieee80211_is_robust_mgmt_frame(hdr))
  5696. -+ !ieee80211_is_robust_mgmt_frame(tx->skb))
  5697. - tx->key = NULL;
  5698. - else {
  5699. - I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted);
  5700. -@@ -878,7 +890,7 @@ static int ieee80211_fragment(struct iee
  5701. - }
  5702. -
  5703. - /* adjust first fragment's length */
  5704. -- skb->len = hdrlen + per_fragm;
  5705. -+ skb_trim(skb, hdrlen + per_fragm);
  5706. - return 0;
  5707. - }
  5708. -
  5709. -@@ -2900,7 +2912,7 @@ ieee80211_get_buffered_bc(struct ieee802
  5710. - cpu_to_le16(IEEE80211_FCTL_MOREDATA);
  5711. - }
  5712. -
  5713. -- if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
  5714. -+ if (sdata->vif.type == NL80211_IFTYPE_AP)
  5715. - sdata = IEEE80211_DEV_TO_SUB_IF(skb->dev);
  5716. - if (!ieee80211_tx_prepare(sdata, &tx, skb))
  5717. - break;
  5718. ---- a/net/mac80211/wpa.c
  5719. -+++ b/net/mac80211/wpa.c
  5720. -@@ -499,7 +499,7 @@ ieee80211_crypto_ccmp_decrypt(struct iee
  5721. - hdrlen = ieee80211_hdrlen(hdr->frame_control);
  5722. -
  5723. - if (!ieee80211_is_data(hdr->frame_control) &&
  5724. -- !ieee80211_is_robust_mgmt_frame(hdr))
  5725. -+ !ieee80211_is_robust_mgmt_frame(skb))
  5726. - return RX_CONTINUE;
  5727. -
  5728. - data_len = skb->len - hdrlen - IEEE80211_CCMP_HDR_LEN -
  5729. ---- a/net/wireless/ap.c
  5730. -+++ b/net/wireless/ap.c
  5731. -@@ -27,9 +27,10 @@ static int __cfg80211_stop_ap(struct cfg
  5732. - err = rdev_stop_ap(rdev, dev);
  5733. - if (!err) {
  5734. - wdev->beacon_interval = 0;
  5735. -- wdev->channel = NULL;
  5736. -+ memset(&wdev->chandef, 0, sizeof(wdev->chandef));
  5737. - wdev->ssid_len = 0;
  5738. - rdev_set_qos_map(rdev, dev, NULL);
  5739. -+ nl80211_send_ap_stopped(wdev);
  5740. - }
  5741. -
  5742. - return err;
  5743. ---- a/net/wireless/core.c
  5744. -+++ b/net/wireless/core.c
  5745. -@@ -203,8 +203,11 @@ void cfg80211_stop_p2p_device(struct cfg
  5746. -
  5747. - rdev->opencount--;
  5748. -
  5749. -- WARN_ON(rdev->scan_req && rdev->scan_req->wdev == wdev &&
  5750. -- !rdev->scan_req->notified);
  5751. -+ if (rdev->scan_req && rdev->scan_req->wdev == wdev) {
  5752. -+ if (WARN_ON(!rdev->scan_req->notified))
  5753. -+ rdev->scan_req->aborted = true;
  5754. -+ ___cfg80211_scan_done(rdev, false);
  5755. -+ }
  5756. - }
  5757. -
  5758. - static int cfg80211_rfkill_set_block(void *data, bool blocked)
  5759. -@@ -447,9 +450,6 @@ int wiphy_register(struct wiphy *wiphy)
  5760. - int i;
  5761. - u16 ifmodes = wiphy->interface_modes;
  5762. -
  5763. -- /* support for 5/10 MHz is broken due to nl80211 API mess - disable */
  5764. -- wiphy->flags &= ~WIPHY_FLAG_SUPPORTS_5_10_MHZ;
  5765. --
  5766. - /*
  5767. - * There are major locking problems in nl80211/mac80211 for CSA,
  5768. - * disable for all drivers until this has been reworked.
  5769. -@@ -795,8 +795,6 @@ void cfg80211_leave(struct cfg80211_regi
  5770. - default:
  5771. - break;
  5772. - }
  5773. --
  5774. -- wdev->beacon_interval = 0;
  5775. - }
  5776. -
  5777. - static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
  5778. -@@ -875,8 +873,11 @@ static int cfg80211_netdev_notifier_call
  5779. - break;
  5780. - case NETDEV_DOWN:
  5781. - cfg80211_update_iface_num(rdev, wdev->iftype, -1);
  5782. -- WARN_ON(rdev->scan_req && rdev->scan_req->wdev == wdev &&
  5783. -- !rdev->scan_req->notified);
  5784. -+ if (rdev->scan_req && rdev->scan_req->wdev == wdev) {
  5785. -+ if (WARN_ON(!rdev->scan_req->notified))
  5786. -+ rdev->scan_req->aborted = true;
  5787. -+ ___cfg80211_scan_done(rdev, false);
  5788. -+ }
  5789. -
  5790. - if (WARN_ON(rdev->sched_scan_req &&
  5791. - rdev->sched_scan_req->dev == wdev->netdev)) {
  5792. ---- a/net/wireless/core.h
  5793. -+++ b/net/wireless/core.h
  5794. -@@ -62,6 +62,7 @@ struct cfg80211_registered_device {
  5795. - struct rb_root bss_tree;
  5796. - u32 bss_generation;
  5797. - struct cfg80211_scan_request *scan_req; /* protected by RTNL */
  5798. -+ struct sk_buff *scan_msg;
  5799. - struct cfg80211_sched_scan_request *sched_scan_req;
  5800. - unsigned long suspend_at;
  5801. - struct work_struct scan_done_wk;
  5802. -@@ -210,6 +211,7 @@ struct cfg80211_event {
  5803. - } dc;
  5804. - struct {
  5805. - u8 bssid[ETH_ALEN];
  5806. -+ struct ieee80211_channel *channel;
  5807. - } ij;
  5808. - };
  5809. - };
  5810. -@@ -257,7 +259,8 @@ int __cfg80211_leave_ibss(struct cfg8021
  5811. - struct net_device *dev, bool nowext);
  5812. - int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
  5813. - struct net_device *dev, bool nowext);
  5814. --void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid);
  5815. -+void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,
  5816. -+ struct ieee80211_channel *channel);
  5817. - int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev,
  5818. - struct wireless_dev *wdev);
  5819. -
  5820. -@@ -361,7 +364,8 @@ int cfg80211_validate_key_settings(struc
  5821. - struct key_params *params, int key_idx,
  5822. - bool pairwise, const u8 *mac_addr);
  5823. - void __cfg80211_scan_done(struct work_struct *wk);
  5824. --void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev);
  5825. -+void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev,
  5826. -+ bool send_message);
  5827. - void __cfg80211_sched_scan_results(struct work_struct *wk);
  5828. - int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev,
  5829. - bool driver_initiated);
  5830. -@@ -441,7 +445,8 @@ static inline unsigned int elapsed_jiffi
  5831. - void
  5832. - cfg80211_get_chan_state(struct wireless_dev *wdev,
  5833. - struct ieee80211_channel **chan,
  5834. -- enum cfg80211_chan_mode *chanmode);
  5835. -+ enum cfg80211_chan_mode *chanmode,
  5836. -+ u8 *radar_detect);
  5837. -
  5838. - int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev,
  5839. - struct cfg80211_chan_def *chandef);
  5840. ---- a/net/wireless/nl80211.c
  5841. -+++ b/net/wireless/nl80211.c
  5842. -@@ -1723,9 +1723,10 @@ static int nl80211_dump_wiphy(struct sk_
  5843. - * We can then retry with the larger buffer.
  5844. - */
  5845. - if ((ret == -ENOBUFS || ret == -EMSGSIZE) &&
  5846. -- !skb->len &&
  5847. -+ !skb->len && !state->split &&
  5848. - cb->min_dump_alloc < 4096) {
  5849. - cb->min_dump_alloc = 4096;
  5850. -+ state->split_start = 0;
  5851. - rtnl_unlock();
  5852. - return 1;
  5853. - }
  5854. -@@ -2047,10 +2048,12 @@ static int nl80211_set_wiphy(struct sk_b
  5855. - nla_for_each_nested(nl_txq_params,
  5856. - info->attrs[NL80211_ATTR_WIPHY_TXQ_PARAMS],
  5857. - rem_txq_params) {
  5858. -- nla_parse(tb, NL80211_TXQ_ATTR_MAX,
  5859. -- nla_data(nl_txq_params),
  5860. -- nla_len(nl_txq_params),
  5861. -- txq_params_policy);
  5862. -+ result = nla_parse(tb, NL80211_TXQ_ATTR_MAX,
  5863. -+ nla_data(nl_txq_params),
  5864. -+ nla_len(nl_txq_params),
  5865. -+ txq_params_policy);
  5866. -+ if (result)
  5867. -+ goto bad_res;
  5868. - result = parse_txq_params(tb, &txq_params);
  5869. - if (result)
  5870. - goto bad_res;
  5871. -@@ -3289,7 +3292,7 @@ static int nl80211_start_ap(struct sk_bu
  5872. - if (!err) {
  5873. - wdev->preset_chandef = params.chandef;
  5874. - wdev->beacon_interval = params.beacon_interval;
  5875. -- wdev->channel = params.chandef.chan;
  5876. -+ wdev->chandef = params.chandef;
  5877. - wdev->ssid_len = params.ssid_len;
  5878. - memcpy(wdev->ssid, params.ssid, wdev->ssid_len);
  5879. - }
  5880. -@@ -5210,9 +5213,11 @@ static int nl80211_set_reg(struct sk_buf
  5881. -
  5882. - nla_for_each_nested(nl_reg_rule, info->attrs[NL80211_ATTR_REG_RULES],
  5883. - rem_reg_rules) {
  5884. -- nla_parse(tb, NL80211_REG_RULE_ATTR_MAX,
  5885. -- nla_data(nl_reg_rule), nla_len(nl_reg_rule),
  5886. -- reg_rule_policy);
  5887. -+ r = nla_parse(tb, NL80211_REG_RULE_ATTR_MAX,
  5888. -+ nla_data(nl_reg_rule), nla_len(nl_reg_rule),
  5889. -+ reg_rule_policy);
  5890. -+ if (r)
  5891. -+ goto bad_reg;
  5892. - r = parse_reg_rule(tb, &rd->reg_rules[rule_idx]);
  5893. - if (r)
  5894. - goto bad_reg;
  5895. -@@ -5277,7 +5282,7 @@ static int nl80211_trigger_scan(struct s
  5896. - if (!rdev->ops->scan)
  5897. - return -EOPNOTSUPP;
  5898. -
  5899. -- if (rdev->scan_req) {
  5900. -+ if (rdev->scan_req || rdev->scan_msg) {
  5901. - err = -EBUSY;
  5902. - goto unlock;
  5903. - }
  5904. -@@ -5475,6 +5480,7 @@ static int nl80211_start_sched_scan(stru
  5905. - enum ieee80211_band band;
  5906. - size_t ie_len;
  5907. - struct nlattr *tb[NL80211_SCHED_SCAN_MATCH_ATTR_MAX + 1];
  5908. -+ s32 default_match_rssi = NL80211_SCAN_RSSI_THOLD_OFF;
  5909. -
  5910. - if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_SCHED_SCAN) ||
  5911. - !rdev->ops->sched_scan_start)
  5912. -@@ -5509,11 +5515,40 @@ static int nl80211_start_sched_scan(stru
  5913. - if (n_ssids > wiphy->max_sched_scan_ssids)
  5914. - return -EINVAL;
  5915. -
  5916. -- if (info->attrs[NL80211_ATTR_SCHED_SCAN_MATCH])
  5917. -+ /*
  5918. -+ * First, count the number of 'real' matchsets. Due to an issue with
  5919. -+ * the old implementation, matchsets containing only the RSSI attribute
  5920. -+ * (NL80211_SCHED_SCAN_MATCH_ATTR_RSSI) are considered as the 'default'
  5921. -+ * RSSI for all matchsets, rather than their own matchset for reporting
  5922. -+ * all APs with a strong RSSI. This is needed to be compatible with
  5923. -+ * older userspace that treated a matchset with only the RSSI as the
  5924. -+ * global RSSI for all other matchsets - if there are other matchsets.
  5925. -+ */
  5926. -+ if (info->attrs[NL80211_ATTR_SCHED_SCAN_MATCH]) {
  5927. - nla_for_each_nested(attr,
  5928. - info->attrs[NL80211_ATTR_SCHED_SCAN_MATCH],
  5929. -- tmp)
  5930. -- n_match_sets++;
  5931. -+ tmp) {
  5932. -+ struct nlattr *rssi;
  5933. -+
  5934. -+ err = nla_parse(tb, NL80211_SCHED_SCAN_MATCH_ATTR_MAX,
  5935. -+ nla_data(attr), nla_len(attr),
  5936. -+ nl80211_match_policy);
  5937. -+ if (err)
  5938. -+ return err;
  5939. -+ /* add other standalone attributes here */
  5940. -+ if (tb[NL80211_SCHED_SCAN_MATCH_ATTR_SSID]) {
  5941. -+ n_match_sets++;
  5942. -+ continue;
  5943. -+ }
  5944. -+ rssi = tb[NL80211_SCHED_SCAN_MATCH_ATTR_RSSI];
  5945. -+ if (rssi)
  5946. -+ default_match_rssi = nla_get_s32(rssi);
  5947. -+ }
  5948. -+ }
  5949. -+
  5950. -+ /* However, if there's no other matchset, add the RSSI one */
  5951. -+ if (!n_match_sets && default_match_rssi != NL80211_SCAN_RSSI_THOLD_OFF)
  5952. -+ n_match_sets = 1;
  5953. -
  5954. - if (n_match_sets > wiphy->max_match_sets)
  5955. - return -EINVAL;
  5956. -@@ -5634,11 +5669,22 @@ static int nl80211_start_sched_scan(stru
  5957. - tmp) {
  5958. - struct nlattr *ssid, *rssi;
  5959. -
  5960. -- nla_parse(tb, NL80211_SCHED_SCAN_MATCH_ATTR_MAX,
  5961. -- nla_data(attr), nla_len(attr),
  5962. -- nl80211_match_policy);
  5963. -+ err = nla_parse(tb, NL80211_SCHED_SCAN_MATCH_ATTR_MAX,
  5964. -+ nla_data(attr), nla_len(attr),
  5965. -+ nl80211_match_policy);
  5966. -+ if (err)
  5967. -+ goto out_free;
  5968. - ssid = tb[NL80211_SCHED_SCAN_MATCH_ATTR_SSID];
  5969. - if (ssid) {
  5970. -+ if (WARN_ON(i >= n_match_sets)) {
  5971. -+ /* this indicates a programming error,
  5972. -+ * the loop above should have verified
  5973. -+ * things properly
  5974. -+ */
  5975. -+ err = -EINVAL;
  5976. -+ goto out_free;
  5977. -+ }
  5978. -+
  5979. - if (nla_len(ssid) > IEEE80211_MAX_SSID_LEN) {
  5980. - err = -EINVAL;
  5981. - goto out_free;
  5982. -@@ -5647,15 +5693,28 @@ static int nl80211_start_sched_scan(stru
  5983. - nla_data(ssid), nla_len(ssid));
  5984. - request->match_sets[i].ssid.ssid_len =
  5985. - nla_len(ssid);
  5986. -+ /* special attribute - old implemenation w/a */
  5987. -+ request->match_sets[i].rssi_thold =
  5988. -+ default_match_rssi;
  5989. -+ rssi = tb[NL80211_SCHED_SCAN_MATCH_ATTR_RSSI];
  5990. -+ if (rssi)
  5991. -+ request->match_sets[i].rssi_thold =
  5992. -+ nla_get_s32(rssi);
  5993. - }
  5994. -- rssi = tb[NL80211_SCHED_SCAN_MATCH_ATTR_RSSI];
  5995. -- if (rssi)
  5996. -- request->rssi_thold = nla_get_u32(rssi);
  5997. -- else
  5998. -- request->rssi_thold =
  5999. -- NL80211_SCAN_RSSI_THOLD_OFF;
  6000. - i++;
  6001. - }
  6002. -+
  6003. -+ /* there was no other matchset, so the RSSI one is alone */
  6004. -+ if (i == 0)
  6005. -+ request->match_sets[0].rssi_thold = default_match_rssi;
  6006. -+
  6007. -+ request->min_rssi_thold = INT_MAX;
  6008. -+ for (i = 0; i < n_match_sets; i++)
  6009. -+ request->min_rssi_thold =
  6010. -+ min(request->match_sets[i].rssi_thold,
  6011. -+ request->min_rssi_thold);
  6012. -+ } else {
  6013. -+ request->min_rssi_thold = NL80211_SCAN_RSSI_THOLD_OFF;
  6014. - }
  6015. -
  6016. - if (info->attrs[NL80211_ATTR_IE]) {
  6017. -@@ -5751,7 +5810,7 @@ static int nl80211_start_radar_detection
  6018. -
  6019. - err = rdev->ops->start_radar_detection(&rdev->wiphy, dev, &chandef);
  6020. - if (!err) {
  6021. -- wdev->channel = chandef.chan;
  6022. -+ wdev->chandef = chandef;
  6023. - wdev->cac_started = true;
  6024. - wdev->cac_start_time = jiffies;
  6025. - }
  6026. -@@ -7502,16 +7561,19 @@ static int nl80211_set_tx_bitrate_mask(s
  6027. - * directly to the enum ieee80211_band values used in cfg80211.
  6028. - */
  6029. - BUILD_BUG_ON(NL80211_MAX_SUPP_HT_RATES > IEEE80211_HT_MCS_MASK_LEN * 8);
  6030. -- nla_for_each_nested(tx_rates, info->attrs[NL80211_ATTR_TX_RATES], rem)
  6031. -- {
  6032. -+ nla_for_each_nested(tx_rates, info->attrs[NL80211_ATTR_TX_RATES], rem) {
  6033. - enum ieee80211_band band = nla_type(tx_rates);
  6034. -+ int err;
  6035. -+
  6036. - if (band < 0 || band >= IEEE80211_NUM_BANDS)
  6037. - return -EINVAL;
  6038. - sband = rdev->wiphy.bands[band];
  6039. - if (sband == NULL)
  6040. - return -EINVAL;
  6041. -- nla_parse(tb, NL80211_TXRATE_MAX, nla_data(tx_rates),
  6042. -- nla_len(tx_rates), nl80211_txattr_policy);
  6043. -+ err = nla_parse(tb, NL80211_TXRATE_MAX, nla_data(tx_rates),
  6044. -+ nla_len(tx_rates), nl80211_txattr_policy);
  6045. -+ if (err)
  6046. -+ return err;
  6047. - if (tb[NL80211_TXRATE_LEGACY]) {
  6048. - mask.control[band].legacy = rateset_to_mask(
  6049. - sband,
  6050. -@@ -10054,40 +10116,31 @@ void nl80211_send_scan_start(struct cfg8
  6051. - NL80211_MCGRP_SCAN, GFP_KERNEL);
  6052. - }
  6053. -
  6054. --void nl80211_send_scan_done(struct cfg80211_registered_device *rdev,
  6055. -- struct wireless_dev *wdev)
  6056. -+struct sk_buff *nl80211_build_scan_msg(struct cfg80211_registered_device *rdev,
  6057. -+ struct wireless_dev *wdev, bool aborted)
  6058. - {
  6059. - struct sk_buff *msg;
  6060. -
  6061. - msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
  6062. - if (!msg)
  6063. -- return;
  6064. -+ return NULL;
  6065. -
  6066. - if (nl80211_send_scan_msg(msg, rdev, wdev, 0, 0, 0,
  6067. -- NL80211_CMD_NEW_SCAN_RESULTS) < 0) {
  6068. -+ aborted ? NL80211_CMD_SCAN_ABORTED :
  6069. -+ NL80211_CMD_NEW_SCAN_RESULTS) < 0) {
  6070. - nlmsg_free(msg);
  6071. -- return;
  6072. -+ return NULL;
  6073. - }
  6074. -
  6075. -- genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
  6076. -- NL80211_MCGRP_SCAN, GFP_KERNEL);
  6077. -+ return msg;
  6078. - }
  6079. -
  6080. --void nl80211_send_scan_aborted(struct cfg80211_registered_device *rdev,
  6081. -- struct wireless_dev *wdev)
  6082. -+void nl80211_send_scan_result(struct cfg80211_registered_device *rdev,
  6083. -+ struct sk_buff *msg)
  6084. - {
  6085. -- struct sk_buff *msg;
  6086. --
  6087. -- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
  6088. - if (!msg)
  6089. - return;
  6090. -
  6091. -- if (nl80211_send_scan_msg(msg, rdev, wdev, 0, 0, 0,
  6092. -- NL80211_CMD_SCAN_ABORTED) < 0) {
  6093. -- nlmsg_free(msg);
  6094. -- return;
  6095. -- }
  6096. --
  6097. - genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
  6098. - NL80211_MCGRP_SCAN, GFP_KERNEL);
  6099. - }
  6100. -@@ -11158,7 +11211,8 @@ void cfg80211_ch_switch_notify(struct ne
  6101. - wdev->iftype != NL80211_IFTYPE_MESH_POINT))
  6102. - return;
  6103. -
  6104. -- wdev->channel = chandef->chan;
  6105. -+ wdev->chandef = *chandef;
  6106. -+ wdev->preset_chandef = *chandef;
  6107. - nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL);
  6108. - }
  6109. - EXPORT_SYMBOL(cfg80211_ch_switch_notify);
  6110. -@@ -11673,6 +11727,35 @@ void cfg80211_crit_proto_stopped(struct
  6111. - }
  6112. - EXPORT_SYMBOL(cfg80211_crit_proto_stopped);
  6113. -
  6114. -+void nl80211_send_ap_stopped(struct wireless_dev *wdev)
  6115. -+{
  6116. -+ struct wiphy *wiphy = wdev->wiphy;
  6117. -+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
  6118. -+ struct sk_buff *msg;
  6119. -+ void *hdr;
  6120. -+
  6121. -+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
  6122. -+ if (!msg)
  6123. -+ return;
  6124. -+
  6125. -+ hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_STOP_AP);
  6126. -+ if (!hdr)
  6127. -+ goto out;
  6128. -+
  6129. -+ if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
  6130. -+ nla_put_u32(msg, NL80211_ATTR_IFINDEX, wdev->netdev->ifindex) ||
  6131. -+ nla_put_u64(msg, NL80211_ATTR_WDEV, wdev_id(wdev)))
  6132. -+ goto out;
  6133. -+
  6134. -+ genlmsg_end(msg, hdr);
  6135. -+
  6136. -+ genlmsg_multicast_netns(&nl80211_fam, wiphy_net(wiphy), msg, 0,
  6137. -+ NL80211_MCGRP_MLME, GFP_KERNEL);
  6138. -+ return;
  6139. -+ out:
  6140. -+ nlmsg_free(msg);
  6141. -+}
  6142. -+
  6143. - /* initialisation/exit functions */
  6144. -
  6145. - int nl80211_init(void)
  6146. ---- a/net/wireless/nl80211.h
  6147. -+++ b/net/wireless/nl80211.h
  6148. -@@ -8,10 +8,10 @@ void nl80211_exit(void);
  6149. - void nl80211_notify_dev_rename(struct cfg80211_registered_device *rdev);
  6150. - void nl80211_send_scan_start(struct cfg80211_registered_device *rdev,
  6151. - struct wireless_dev *wdev);
  6152. --void nl80211_send_scan_done(struct cfg80211_registered_device *rdev,
  6153. -- struct wireless_dev *wdev);
  6154. --void nl80211_send_scan_aborted(struct cfg80211_registered_device *rdev,
  6155. -- struct wireless_dev *wdev);
  6156. -+struct sk_buff *nl80211_build_scan_msg(struct cfg80211_registered_device *rdev,
  6157. -+ struct wireless_dev *wdev, bool aborted);
  6158. -+void nl80211_send_scan_result(struct cfg80211_registered_device *rdev,
  6159. -+ struct sk_buff *msg);
  6160. - void nl80211_send_sched_scan(struct cfg80211_registered_device *rdev,
  6161. - struct net_device *netdev, u32 cmd);
  6162. - void nl80211_send_sched_scan_results(struct cfg80211_registered_device *rdev,
  6163. -@@ -74,6 +74,8 @@ nl80211_radar_notify(struct cfg80211_reg
  6164. - enum nl80211_radar_event event,
  6165. - struct net_device *netdev, gfp_t gfp);
  6166. -
  6167. -+void nl80211_send_ap_stopped(struct wireless_dev *wdev);
  6168. -+
  6169. - void cfg80211_rdev_free_coalesce(struct cfg80211_registered_device *rdev);
  6170. -
  6171. - #endif /* __NET_WIRELESS_NL80211_H */
  6172. ---- a/net/wireless/scan.c
  6173. -+++ b/net/wireless/scan.c
  6174. -@@ -161,18 +161,25 @@ static void __cfg80211_bss_expire(struct
  6175. - dev->bss_generation++;
  6176. - }
  6177. -
  6178. --void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev)
  6179. -+void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev,
  6180. -+ bool send_message)
  6181. - {
  6182. - struct cfg80211_scan_request *request;
  6183. - struct wireless_dev *wdev;
  6184. -+ struct sk_buff *msg;
  6185. - #ifdef CPTCFG_CFG80211_WEXT
  6186. - union iwreq_data wrqu;
  6187. - #endif
  6188. -
  6189. - ASSERT_RTNL();
  6190. -
  6191. -- request = rdev->scan_req;
  6192. -+ if (rdev->scan_msg) {
  6193. -+ nl80211_send_scan_result(rdev, rdev->scan_msg);
  6194. -+ rdev->scan_msg = NULL;
  6195. -+ return;
  6196. -+ }
  6197. -
  6198. -+ request = rdev->scan_req;
  6199. - if (!request)
  6200. - return;
  6201. -
  6202. -@@ -186,18 +193,16 @@ void ___cfg80211_scan_done(struct cfg802
  6203. - if (wdev->netdev)
  6204. - cfg80211_sme_scan_done(wdev->netdev);
  6205. -
  6206. -- if (request->aborted) {
  6207. -- nl80211_send_scan_aborted(rdev, wdev);
  6208. -- } else {
  6209. -- if (request->flags & NL80211_SCAN_FLAG_FLUSH) {
  6210. -- /* flush entries from previous scans */
  6211. -- spin_lock_bh(&rdev->bss_lock);
  6212. -- __cfg80211_bss_expire(rdev, request->scan_start);
  6213. -- spin_unlock_bh(&rdev->bss_lock);
  6214. -- }
  6215. -- nl80211_send_scan_done(rdev, wdev);
  6216. -+ if (!request->aborted &&
  6217. -+ request->flags & NL80211_SCAN_FLAG_FLUSH) {
  6218. -+ /* flush entries from previous scans */
  6219. -+ spin_lock_bh(&rdev->bss_lock);
  6220. -+ __cfg80211_bss_expire(rdev, request->scan_start);
  6221. -+ spin_unlock_bh(&rdev->bss_lock);
  6222. - }
  6223. -
  6224. -+ msg = nl80211_build_scan_msg(rdev, wdev, request->aborted);
  6225. -+
  6226. - #ifdef CPTCFG_CFG80211_WEXT
  6227. - if (wdev->netdev && !request->aborted) {
  6228. - memset(&wrqu, 0, sizeof(wrqu));
  6229. -@@ -211,6 +216,11 @@ void ___cfg80211_scan_done(struct cfg802
  6230. -
  6231. - rdev->scan_req = NULL;
  6232. - kfree(request);
  6233. -+
  6234. -+ if (!send_message)
  6235. -+ rdev->scan_msg = msg;
  6236. -+ else
  6237. -+ nl80211_send_scan_result(rdev, msg);
  6238. - }
  6239. -
  6240. - void __cfg80211_scan_done(struct work_struct *wk)
  6241. -@@ -221,7 +231,7 @@ void __cfg80211_scan_done(struct work_st
  6242. - scan_done_wk);
  6243. -
  6244. - rtnl_lock();
  6245. -- ___cfg80211_scan_done(rdev);
  6246. -+ ___cfg80211_scan_done(rdev, true);
  6247. - rtnl_unlock();
  6248. - }
  6249. -
  6250. -@@ -1079,7 +1089,7 @@ int cfg80211_wext_siwscan(struct net_dev
  6251. - if (IS_ERR(rdev))
  6252. - return PTR_ERR(rdev);
  6253. -
  6254. -- if (rdev->scan_req) {
  6255. -+ if (rdev->scan_req || rdev->scan_msg) {
  6256. - err = -EBUSY;
  6257. - goto out;
  6258. - }
  6259. -@@ -1481,7 +1491,7 @@ int cfg80211_wext_giwscan(struct net_dev
  6260. - if (IS_ERR(rdev))
  6261. - return PTR_ERR(rdev);
  6262. -
  6263. -- if (rdev->scan_req)
  6264. -+ if (rdev->scan_req || rdev->scan_msg)
  6265. - return -EAGAIN;
  6266. -
  6267. - res = ieee80211_scan_results(rdev, info, extra, data->length);
  6268. ---- a/net/wireless/sme.c
  6269. -+++ b/net/wireless/sme.c
  6270. -@@ -67,7 +67,7 @@ static int cfg80211_conn_scan(struct wir
  6271. - ASSERT_RDEV_LOCK(rdev);
  6272. - ASSERT_WDEV_LOCK(wdev);
  6273. -
  6274. -- if (rdev->scan_req)
  6275. -+ if (rdev->scan_req || rdev->scan_msg)
  6276. - return -EBUSY;
  6277. -
  6278. - if (wdev->conn->params.channel)
  6279. ---- a/net/mac80211/mlme.c
  6280. -+++ b/net/mac80211/mlme.c
  6281. -@@ -1001,7 +1001,6 @@ ieee80211_sta_process_chanswitch(struct
  6282. - }
  6283. -
  6284. - ifmgd->flags |= IEEE80211_STA_CSA_RECEIVED;
  6285. -- sdata->vif.csa_active = true;
  6286. -
  6287. - mutex_lock(&local->chanctx_mtx);
  6288. - if (local->use_chanctx) {
  6289. -@@ -1039,6 +1038,7 @@ ieee80211_sta_process_chanswitch(struct
  6290. - mutex_unlock(&local->chanctx_mtx);
  6291. -
  6292. - sdata->csa_chandef = csa_ie.chandef;
  6293. -+ sdata->vif.csa_active = true;
  6294. -
  6295. - if (csa_ie.mode)
  6296. - ieee80211_stop_queues_by_reason(&local->hw,
  6297. ---- a/net/mac80211/chan.c
  6298. -+++ b/net/mac80211/chan.c
  6299. -@@ -196,6 +196,8 @@ static bool ieee80211_is_radar_required(
  6300. - {
  6301. - struct ieee80211_sub_if_data *sdata;
  6302. -
  6303. -+ lockdep_assert_held(&local->mtx);
  6304. -+
  6305. - rcu_read_lock();
  6306. - list_for_each_entry_rcu(sdata, &local->interfaces, list) {
  6307. - if (sdata->radar_required) {
  6308. ---- a/net/mac80211/ibss.c
  6309. -+++ b/net/mac80211/ibss.c
  6310. -@@ -294,7 +294,6 @@ static void __ieee80211_sta_join_ibss(st
  6311. - }
  6312. -
  6313. - mutex_lock(&local->mtx);
  6314. -- ieee80211_vif_release_channel(sdata);
  6315. - if (ieee80211_vif_use_channel(sdata, &chandef,
  6316. - ifibss->fixed_channel ?
  6317. - IEEE80211_CHANCTX_SHARED :
  6318. -@@ -303,6 +302,7 @@ static void __ieee80211_sta_join_ibss(st
  6319. - mutex_unlock(&local->mtx);
  6320. - return;
  6321. - }
  6322. -+ sdata->radar_required = radar_required;
  6323. - mutex_unlock(&local->mtx);
  6324. -
  6325. - memcpy(ifibss->bssid, bssid, ETH_ALEN);
  6326. -@@ -318,7 +318,6 @@ static void __ieee80211_sta_join_ibss(st
  6327. - rcu_assign_pointer(ifibss->presp, presp);
  6328. - mgmt = (void *)presp->head;
  6329. -
  6330. -- sdata->radar_required = radar_required;
  6331. - sdata->vif.bss_conf.enable_beacon = true;
  6332. - sdata->vif.bss_conf.beacon_int = beacon_int;
  6333. - sdata->vif.bss_conf.basic_rates = basic_rates;
  6334. -@@ -386,7 +385,7 @@ static void __ieee80211_sta_join_ibss(st
  6335. - presp->head_len, 0, GFP_KERNEL);
  6336. - cfg80211_put_bss(local->hw.wiphy, bss);
  6337. - netif_carrier_on(sdata->dev);
  6338. -- cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL);
  6339. -+ cfg80211_ibss_joined(sdata->dev, ifibss->bssid, chan, GFP_KERNEL);
  6340. - }
  6341. -
  6342. - static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
  6343. -@@ -802,6 +801,8 @@ ieee80211_ibss_process_chanswitch(struct
  6344. - int err;
  6345. - u32 sta_flags;
  6346. -
  6347. -+ sdata_assert_lock(sdata);
  6348. -+
  6349. - sta_flags = IEEE80211_STA_DISABLE_VHT;
  6350. - switch (ifibss->chandef.width) {
  6351. - case NL80211_CHAN_WIDTH_5:
  6352. -@@ -1471,6 +1472,11 @@ static void ieee80211_rx_mgmt_probe_req(
  6353. - memcpy(((struct ieee80211_mgmt *) skb->data)->da, mgmt->sa, ETH_ALEN);
  6354. - ibss_dbg(sdata, "Sending ProbeResp to %pM\n", mgmt->sa);
  6355. - IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
  6356. -+
  6357. -+ /* avoid excessive retries for probe request to wildcard SSIDs */
  6358. -+ if (pos[1] == 0)
  6359. -+ IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_NO_ACK;
  6360. -+
  6361. - ieee80211_tx_skb(sdata, skb);
  6362. - }
  6363. -
  6364. ---- a/net/mac80211/mesh.c
  6365. -+++ b/net/mac80211/mesh.c
  6366. -@@ -872,6 +872,8 @@ ieee80211_mesh_process_chnswitch(struct
  6367. - if (!ifmsh->mesh_id)
  6368. - return false;
  6369. -
  6370. -+ sdata_assert_lock(sdata);
  6371. -+
  6372. - sta_flags = IEEE80211_STA_DISABLE_VHT;
  6373. - switch (sdata->vif.bss_conf.chandef.width) {
  6374. - case NL80211_CHAN_WIDTH_20_NOHT:
  6375. ---- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
  6376. -+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
  6377. -@@ -4658,6 +4658,7 @@ brcmf_notify_connect_status(struct brcmf
  6378. - struct brcmf_cfg80211_info *cfg = ifp->drvr->config;
  6379. - struct net_device *ndev = ifp->ndev;
  6380. - struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
  6381. -+ struct ieee80211_channel *chan;
  6382. - s32 err = 0;
  6383. -
  6384. - if (ifp->vif->mode == WL_MODE_AP) {
  6385. -@@ -4665,9 +4666,10 @@ brcmf_notify_connect_status(struct brcmf
  6386. - } else if (brcmf_is_linkup(e)) {
  6387. - brcmf_dbg(CONN, "Linkup\n");
  6388. - if (brcmf_is_ibssmode(ifp->vif)) {
  6389. -+ chan = ieee80211_get_channel(cfg->wiphy, cfg->channel);
  6390. - memcpy(profile->bssid, e->addr, ETH_ALEN);
  6391. - wl_inform_ibss(cfg, ndev, e->addr);
  6392. -- cfg80211_ibss_joined(ndev, e->addr, GFP_KERNEL);
  6393. -+ cfg80211_ibss_joined(ndev, e->addr, chan, GFP_KERNEL);
  6394. - clear_bit(BRCMF_VIF_STATUS_CONNECTING,
  6395. - &ifp->vif->sme_state);
  6396. - set_bit(BRCMF_VIF_STATUS_CONNECTED,
  6397. ---- a/drivers/net/wireless/libertas/cfg.c
  6398. -+++ b/drivers/net/wireless/libertas/cfg.c
  6399. -@@ -1766,7 +1766,8 @@ static void lbs_join_post(struct lbs_pri
  6400. - memcpy(priv->wdev->ssid, params->ssid, params->ssid_len);
  6401. - priv->wdev->ssid_len = params->ssid_len;
  6402. -
  6403. -- cfg80211_ibss_joined(priv->dev, bssid, GFP_KERNEL);
  6404. -+ cfg80211_ibss_joined(priv->dev, bssid, params->chandef.chan,
  6405. -+ GFP_KERNEL);
  6406. -
  6407. - /* TODO: consider doing this at MACREG_INT_CODE_LINK_SENSED time */
  6408. - priv->connect_status = LBS_CONNECTED;
  6409. ---- a/drivers/net/wireless/mwifiex/cfg80211.c
  6410. -+++ b/drivers/net/wireless/mwifiex/cfg80211.c
  6411. -@@ -1881,7 +1881,8 @@ mwifiex_cfg80211_join_ibss(struct wiphy
  6412. - params->privacy);
  6413. - done:
  6414. - if (!ret) {
  6415. -- cfg80211_ibss_joined(priv->netdev, priv->cfg_bssid, GFP_KERNEL);
  6416. -+ cfg80211_ibss_joined(priv->netdev, priv->cfg_bssid,
  6417. -+ params->chandef.chan, GFP_KERNEL);
  6418. - dev_dbg(priv->adapter->dev,
  6419. - "info: joined/created adhoc network with bssid"
  6420. - " %pM successfully\n", priv->cfg_bssid);
  6421. ---- a/drivers/net/wireless/rndis_wlan.c
  6422. -+++ b/drivers/net/wireless/rndis_wlan.c
  6423. -@@ -2835,7 +2835,9 @@ static void rndis_wlan_do_link_up_work(s
  6424. - bssid, req_ie, req_ie_len,
  6425. - resp_ie, resp_ie_len, GFP_KERNEL);
  6426. - } else if (priv->infra_mode == NDIS_80211_INFRA_ADHOC)
  6427. -- cfg80211_ibss_joined(usbdev->net, bssid, GFP_KERNEL);
  6428. -+ cfg80211_ibss_joined(usbdev->net, bssid,
  6429. -+ get_current_channel(usbdev, NULL),
  6430. -+ GFP_KERNEL);
  6431. -
  6432. - kfree(info);
  6433. +--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
  6434. ++++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
  6435. +@@ -1004,11 +1004,9 @@ static bool ar5008_hw_ani_control_new(st
  6436. + case ATH9K_ANI_FIRSTEP_LEVEL:{
  6437. + u32 level = param;
  6438. ---- a/net/wireless/ibss.c
  6439. -+++ b/net/wireless/ibss.c
  6440. -@@ -14,7 +14,8 @@
  6441. - #include "rdev-ops.h"
  6442. +- value = level * 2;
  6443. ++ value = level;
  6444. + REG_RMW_FIELD(ah, AR_PHY_FIND_SIG,
  6445. + AR_PHY_FIND_SIG_FIRSTEP, value);
  6446. +- REG_RMW_FIELD(ah, AR_PHY_FIND_SIG_LOW,
  6447. +- AR_PHY_FIND_SIG_FIRSTEP_LOW, value);
  6448. + if (level != aniState->firstepLevel) {
  6449. + ath_dbg(common, ANI,
  6450. +--- a/drivers/net/wireless/ath/ath9k/beacon.c
  6451. ++++ b/drivers/net/wireless/ath/ath9k/beacon.c
  6452. +@@ -312,10 +312,9 @@ static void ath9k_csa_update_vif(void *d
  6453. --void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid)
  6454. -+void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,
  6455. -+ struct ieee80211_channel *channel)
  6456. + void ath9k_csa_update(struct ath_softc *sc)
  6457. {
  6458. - struct wireless_dev *wdev = dev->ieee80211_ptr;
  6459. - struct cfg80211_bss *bss;
  6460. -@@ -28,8 +29,7 @@ void __cfg80211_ibss_joined(struct net_d
  6461. - if (!wdev->ssid_len)
  6462. - return;
  6463. -
  6464. -- bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid,
  6465. -- wdev->ssid, wdev->ssid_len,
  6466. -+ bss = cfg80211_get_bss(wdev->wiphy, channel, bssid, NULL, 0,
  6467. - WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
  6468. -
  6469. - if (WARN_ON(!bss))
  6470. -@@ -54,21 +54,26 @@ void __cfg80211_ibss_joined(struct net_d
  6471. - #endif
  6472. - }
  6473. -
  6474. --void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp)
  6475. -+void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,
  6476. -+ struct ieee80211_channel *channel, gfp_t gfp)
  6477. +- ieee80211_iterate_active_interfaces(sc->hw,
  6478. +- IEEE80211_IFACE_ITER_NORMAL,
  6479. +- ath9k_csa_update_vif,
  6480. +- sc);
  6481. ++ ieee80211_iterate_active_interfaces_atomic(sc->hw,
  6482. ++ IEEE80211_IFACE_ITER_NORMAL,
  6483. ++ ath9k_csa_update_vif, sc);
  6484. + }
  6485. +
  6486. + void ath9k_beacon_tasklet(unsigned long data)
  6487. +--- a/net/mac80211/main.c
  6488. ++++ b/net/mac80211/main.c
  6489. +@@ -152,6 +152,8 @@ static u32 ieee80211_hw_conf_chan(struct
  6490. + list_for_each_entry_rcu(sdata, &local->interfaces, list) {
  6491. + if (!rcu_access_pointer(sdata->vif.chanctx_conf))
  6492. + continue;
  6493. ++ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
  6494. ++ continue;
  6495. + power = min(power, sdata->vif.bss_conf.txpower);
  6496. + }
  6497. + rcu_read_unlock();
  6498. +@@ -203,7 +205,7 @@ void ieee80211_bss_info_change_notify(st
  6499. {
  6500. - struct wireless_dev *wdev = dev->ieee80211_ptr;
  6501. - struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
  6502. - struct cfg80211_event *ev;
  6503. - unsigned long flags;
  6504. -
  6505. -- trace_cfg80211_ibss_joined(dev, bssid);
  6506. -+ trace_cfg80211_ibss_joined(dev, bssid, channel);
  6507. -+
  6508. -+ if (WARN_ON(!channel))
  6509. -+ return;
  6510. + struct ieee80211_local *local = sdata->local;
  6511. - ev = kzalloc(sizeof(*ev), gfp);
  6512. - if (!ev)
  6513. +- if (!changed)
  6514. ++ if (!changed || sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
  6515. return;
  6516. - ev->type = EVENT_IBSS_JOINED;
  6517. -- memcpy(ev->cr.bssid, bssid, ETH_ALEN);
  6518. -+ memcpy(ev->ij.bssid, bssid, ETH_ALEN);
  6519. -+ ev->ij.channel = channel;
  6520. -
  6521. - spin_lock_irqsave(&wdev->event_lock, flags);
  6522. - list_add_tail(&ev->list, &wdev->event_list);
  6523. -@@ -117,6 +122,7 @@ int __cfg80211_join_ibss(struct cfg80211
  6524. -
  6525. - wdev->ibss_fixed = params->channel_fixed;
  6526. - wdev->ibss_dfs_possible = params->userspace_handles_dfs;
  6527. -+ wdev->chandef = params->chandef;
  6528. - #ifdef CPTCFG_CFG80211_WEXT
  6529. - wdev->wext.ibss.chandef = params->chandef;
  6530. - #endif
  6531. -@@ -200,6 +206,7 @@ static void __cfg80211_clear_ibss(struct
  6532. -
  6533. - wdev->current_bss = NULL;
  6534. - wdev->ssid_len = 0;
  6535. -+ memset(&wdev->chandef, 0, sizeof(wdev->chandef));
  6536. - #ifdef CPTCFG_CFG80211_WEXT
  6537. - if (!nowext)
  6538. - wdev->wext.ibss.ssid_len = 0;
  6539. ---- a/net/wireless/trace.h
  6540. -+++ b/net/wireless/trace.h
  6541. -@@ -2278,11 +2278,6 @@ DECLARE_EVENT_CLASS(cfg80211_rx_evt,
  6542. - TP_printk(NETDEV_PR_FMT ", " MAC_PR_FMT, NETDEV_PR_ARG, MAC_PR_ARG(addr))
  6543. - );
  6544. -
  6545. --DEFINE_EVENT(cfg80211_rx_evt, cfg80211_ibss_joined,
  6546. -- TP_PROTO(struct net_device *netdev, const u8 *addr),
  6547. -- TP_ARGS(netdev, addr)
  6548. --);
  6549. --
  6550. - DEFINE_EVENT(cfg80211_rx_evt, cfg80211_rx_spurious_frame,
  6551. - TP_PROTO(struct net_device *netdev, const u8 *addr),
  6552. - TP_ARGS(netdev, addr)
  6553. -@@ -2293,6 +2288,24 @@ DEFINE_EVENT(cfg80211_rx_evt, cfg80211_r
  6554. - TP_ARGS(netdev, addr)
  6555. - );
  6556. -
  6557. -+TRACE_EVENT(cfg80211_ibss_joined,
  6558. -+ TP_PROTO(struct net_device *netdev, const u8 *bssid,
  6559. -+ struct ieee80211_channel *channel),
  6560. -+ TP_ARGS(netdev, bssid, channel),
  6561. -+ TP_STRUCT__entry(
  6562. -+ NETDEV_ENTRY
  6563. -+ MAC_ENTRY(bssid)
  6564. -+ CHAN_ENTRY
  6565. -+ ),
  6566. -+ TP_fast_assign(
  6567. -+ NETDEV_ASSIGN;
  6568. -+ MAC_ASSIGN(bssid, bssid);
  6569. -+ CHAN_ASSIGN(channel);
  6570. -+ ),
  6571. -+ TP_printk(NETDEV_PR_FMT ", bssid: " MAC_PR_FMT ", " CHAN_PR_FMT,
  6572. -+ NETDEV_PR_ARG, MAC_PR_ARG(bssid), CHAN_PR_ARG)
  6573. -+);
  6574. -+
  6575. - TRACE_EVENT(cfg80211_probe_status,
  6576. - TP_PROTO(struct net_device *netdev, const u8 *addr, u64 cookie,
  6577. - bool acked),
  6578. ---- a/net/wireless/util.c
  6579. -+++ b/net/wireless/util.c
  6580. -@@ -820,7 +820,8 @@ void cfg80211_process_wdev_events(struct
  6581. - ev->dc.reason, true);
  6582. - break;
  6583. - case EVENT_IBSS_JOINED:
  6584. -- __cfg80211_ibss_joined(wdev->netdev, ev->ij.bssid);
  6585. -+ __cfg80211_ibss_joined(wdev->netdev, ev->ij.bssid,
  6586. -+ ev->ij.channel);
  6587. - break;
  6588. - }
  6589. - wdev_unlock(wdev);
  6590. -@@ -1356,7 +1357,7 @@ int cfg80211_can_use_iftype_chan(struct
  6591. - */
  6592. - mutex_lock_nested(&wdev_iter->mtx, 1);
  6593. - __acquire(wdev_iter->mtx);
  6594. -- cfg80211_get_chan_state(wdev_iter, &ch, &chmode);
  6595. -+ cfg80211_get_chan_state(wdev_iter, &ch, &chmode, &radar_detect);
  6596. - wdev_unlock(wdev_iter);
  6597. + drv_bss_info_changed(local, sdata, &sdata->vif.bss_conf, changed);
  6598. +--- a/drivers/net/wireless/ath/ath9k/ani.c
  6599. ++++ b/drivers/net/wireless/ath/ath9k/ani.c
  6600. +@@ -155,6 +155,9 @@ static void ath9k_hw_set_ofdm_nil(struct
  6601. + ATH9K_ANI_RSSI_THR_LOW,
  6602. + ATH9K_ANI_RSSI_THR_HIGH);
  6603. - switch (chmode) {
  6604. ---- a/net/wireless/chan.c
  6605. -+++ b/net/wireless/chan.c
  6606. -@@ -642,7 +642,8 @@ int cfg80211_set_monitor_channel(struct
  6607. - void
  6608. - cfg80211_get_chan_state(struct wireless_dev *wdev,
  6609. - struct ieee80211_channel **chan,
  6610. -- enum cfg80211_chan_mode *chanmode)
  6611. -+ enum cfg80211_chan_mode *chanmode,
  6612. -+ u8 *radar_detect)
  6613. - {
  6614. - *chan = NULL;
  6615. - *chanmode = CHAN_MODE_UNDEFINED;
  6616. -@@ -660,6 +661,11 @@ cfg80211_get_chan_state(struct wireless_
  6617. - !wdev->ibss_dfs_possible)
  6618. - ? CHAN_MODE_SHARED
  6619. - : CHAN_MODE_EXCLUSIVE;
  6620. -+
  6621. -+ /* consider worst-case - IBSS can try to return to the
  6622. -+ * original user-specified channel as creator */
  6623. -+ if (wdev->ibss_dfs_possible)
  6624. -+ *radar_detect |= BIT(wdev->chandef.width);
  6625. - return;
  6626. - }
  6627. - break;
  6628. -@@ -674,17 +680,26 @@ cfg80211_get_chan_state(struct wireless_
  6629. - case NL80211_IFTYPE_AP:
  6630. - case NL80211_IFTYPE_P2P_GO:
  6631. - if (wdev->cac_started) {
  6632. -- *chan = wdev->channel;
  6633. -+ *chan = wdev->chandef.chan;
  6634. - *chanmode = CHAN_MODE_SHARED;
  6635. -+ *radar_detect |= BIT(wdev->chandef.width);
  6636. - } else if (wdev->beacon_interval) {
  6637. -- *chan = wdev->channel;
  6638. -+ *chan = wdev->chandef.chan;
  6639. - *chanmode = CHAN_MODE_SHARED;
  6640. -+
  6641. -+ if (cfg80211_chandef_dfs_required(wdev->wiphy,
  6642. -+ &wdev->chandef))
  6643. -+ *radar_detect |= BIT(wdev->chandef.width);
  6644. - }
  6645. - return;
  6646. - case NL80211_IFTYPE_MESH_POINT:
  6647. - if (wdev->mesh_id_len) {
  6648. -- *chan = wdev->channel;
  6649. -+ *chan = wdev->chandef.chan;
  6650. - *chanmode = CHAN_MODE_SHARED;
  6651. ++ if (AR_SREV_9100(ah) && immunityLevel < ATH9K_ANI_OFDM_DEF_LEVEL)
  6652. ++ immunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL;
  6653. +
  6654. -+ if (cfg80211_chandef_dfs_required(wdev->wiphy,
  6655. -+ &wdev->chandef))
  6656. -+ *radar_detect |= BIT(wdev->chandef.width);
  6657. - }
  6658. - return;
  6659. - case NL80211_IFTYPE_MONITOR:
  6660. ---- a/net/wireless/mesh.c
  6661. -+++ b/net/wireless/mesh.c
  6662. -@@ -195,7 +195,7 @@ int __cfg80211_join_mesh(struct cfg80211
  6663. - if (!err) {
  6664. - memcpy(wdev->ssid, setup->mesh_id, setup->mesh_id_len);
  6665. - wdev->mesh_id_len = setup->mesh_id_len;
  6666. -- wdev->channel = setup->chandef.chan;
  6667. -+ wdev->chandef = setup->chandef;
  6668. - }
  6669. -
  6670. - return err;
  6671. -@@ -244,7 +244,7 @@ int cfg80211_set_mesh_channel(struct cfg
  6672. - err = rdev_libertas_set_mesh_channel(rdev, wdev->netdev,
  6673. - chandef->chan);
  6674. - if (!err)
  6675. -- wdev->channel = chandef->chan;
  6676. -+ wdev->chandef = *chandef;
  6677. + if (!scan)
  6678. + aniState->ofdmNoiseImmunityLevel = immunityLevel;
  6679. - return err;
  6680. - }
  6681. -@@ -276,7 +276,7 @@ static int __cfg80211_leave_mesh(struct
  6682. - err = rdev_leave_mesh(rdev, dev);
  6683. - if (!err) {
  6684. - wdev->mesh_id_len = 0;
  6685. -- wdev->channel = NULL;
  6686. -+ memset(&wdev->chandef, 0, sizeof(wdev->chandef));
  6687. - rdev_set_qos_map(rdev, dev, NULL);
  6688. - }
  6689. -
  6690. ---- a/net/wireless/mlme.c
  6691. -+++ b/net/wireless/mlme.c
  6692. -@@ -772,7 +772,7 @@ void cfg80211_cac_event(struct net_devic
  6693. - if (WARN_ON(!wdev->cac_started))
  6694. - return;
  6695. +@@ -235,6 +238,9 @@ static void ath9k_hw_set_cck_nil(struct
  6696. + BEACON_RSSI(ah), ATH9K_ANI_RSSI_THR_LOW,
  6697. + ATH9K_ANI_RSSI_THR_HIGH);
  6698. -- if (WARN_ON(!wdev->channel))
  6699. -+ if (WARN_ON(!wdev->chandef.chan))
  6700. - return;
  6701. -
  6702. - switch (event) {
  6703. ---- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
  6704. -+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
  6705. -@@ -5065,6 +5065,10 @@ static u16 ar9003_hw_get_max_edge_power(
  6706. - break;
  6707. - }
  6708. - }
  6709. ++ if (AR_SREV_9100(ah) && immunityLevel < ATH9K_ANI_CCK_DEF_LEVEL)
  6710. ++ immunityLevel = ATH9K_ANI_CCK_DEF_LEVEL;
  6711. +
  6712. -+ if (is2GHz && !twiceMaxEdgePower)
  6713. -+ twiceMaxEdgePower = 60;
  6714. -+
  6715. - return twiceMaxEdgePower;
  6716. - }
  6717. -
  6718. ---- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
  6719. -+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
  6720. -@@ -23,10 +23,11 @@
  6721. - #define MAX_MEASUREMENT MAX_IQCAL_MEASUREMENT
  6722. - #define MAX_MAG_DELTA 11
  6723. - #define MAX_PHS_DELTA 10
  6724. -+#define MAXIQCAL 3
  6725. -
  6726. - struct coeff {
  6727. -- int mag_coeff[AR9300_MAX_CHAINS][MAX_MEASUREMENT];
  6728. -- int phs_coeff[AR9300_MAX_CHAINS][MAX_MEASUREMENT];
  6729. -+ int mag_coeff[AR9300_MAX_CHAINS][MAX_MEASUREMENT][MAXIQCAL];
  6730. -+ int phs_coeff[AR9300_MAX_CHAINS][MAX_MEASUREMENT][MAXIQCAL];
  6731. - int iqc_coeff[2];
  6732. + if (ah->opmode == NL80211_IFTYPE_STATION &&
  6733. + BEACON_RSSI(ah) <= ATH9K_ANI_RSSI_THR_LOW &&
  6734. + immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI)
  6735. +--- a/drivers/net/wireless/ath/ath9k/ath9k.h
  6736. ++++ b/drivers/net/wireless/ath/ath9k/ath9k.h
  6737. +@@ -251,7 +251,6 @@ struct ath_atx_tid {
  6738. +
  6739. + s8 bar_index;
  6740. + bool sched;
  6741. +- bool paused;
  6742. + bool active;
  6743. };
  6744. -@@ -800,7 +801,7 @@ static bool ar9003_hw_calc_iq_corr(struc
  6745. - if (q_q_coff > 63)
  6746. - q_q_coff = 63;
  6747. -
  6748. -- iqc_coeff[0] = (q_q_coff * 128) + q_i_coff;
  6749. -+ iqc_coeff[0] = (q_q_coff * 128) + (0x7f & q_i_coff);
  6750. -
  6751. - ath_dbg(common, CALIBRATE, "tx chain %d: iq corr coeff=%x\n",
  6752. - chain_idx, iqc_coeff[0]);
  6753. -@@ -831,7 +832,7 @@ static bool ar9003_hw_calc_iq_corr(struc
  6754. - if (q_q_coff > 63)
  6755. - q_q_coff = 63;
  6756. -
  6757. -- iqc_coeff[1] = (q_q_coff * 128) + q_i_coff;
  6758. -+ iqc_coeff[1] = (q_q_coff * 128) + (0x7f & q_i_coff);
  6759. -
  6760. - ath_dbg(common, CALIBRATE, "rx chain %d: iq corr coeff=%x\n",
  6761. - chain_idx, iqc_coeff[1]);
  6762. -@@ -839,7 +840,8 @@ static bool ar9003_hw_calc_iq_corr(struc
  6763. - return true;
  6764. - }
  6765. -
  6766. --static void ar9003_hw_detect_outlier(int *mp_coeff, int nmeasurement,
  6767. -+static void ar9003_hw_detect_outlier(int mp_coeff[][MAXIQCAL],
  6768. -+ int nmeasurement,
  6769. - int max_delta)
  6770. - {
  6771. - int mp_max = -64, max_idx = 0;
  6772. -@@ -848,20 +850,20 @@ static void ar9003_hw_detect_outlier(int
  6773. -
  6774. - /* find min/max mismatch across all calibrated gains */
  6775. - for (i = 0; i < nmeasurement; i++) {
  6776. -- if (mp_coeff[i] > mp_max) {
  6777. -- mp_max = mp_coeff[i];
  6778. -+ if (mp_coeff[i][0] > mp_max) {
  6779. -+ mp_max = mp_coeff[i][0];
  6780. - max_idx = i;
  6781. -- } else if (mp_coeff[i] < mp_min) {
  6782. -- mp_min = mp_coeff[i];
  6783. -+ } else if (mp_coeff[i][0] < mp_min) {
  6784. -+ mp_min = mp_coeff[i][0];
  6785. - min_idx = i;
  6786. - }
  6787. - }
  6788. -
  6789. - /* find average (exclude max abs value) */
  6790. - for (i = 0; i < nmeasurement; i++) {
  6791. -- if ((abs(mp_coeff[i]) < abs(mp_max)) ||
  6792. -- (abs(mp_coeff[i]) < abs(mp_min))) {
  6793. -- mp_avg += mp_coeff[i];
  6794. -+ if ((abs(mp_coeff[i][0]) < abs(mp_max)) ||
  6795. -+ (abs(mp_coeff[i][0]) < abs(mp_min))) {
  6796. -+ mp_avg += mp_coeff[i][0];
  6797. - mp_count++;
  6798. - }
  6799. - }
  6800. -@@ -873,7 +875,7 @@ static void ar9003_hw_detect_outlier(int
  6801. - if (mp_count)
  6802. - mp_avg /= mp_count;
  6803. - else
  6804. -- mp_avg = mp_coeff[nmeasurement - 1];
  6805. -+ mp_avg = mp_coeff[nmeasurement - 1][0];
  6806. -
  6807. - /* detect outlier */
  6808. - if (abs(mp_max - mp_min) > max_delta) {
  6809. -@@ -882,15 +884,16 @@ static void ar9003_hw_detect_outlier(int
  6810. - else
  6811. - outlier_idx = min_idx;
  6812. -
  6813. -- mp_coeff[outlier_idx] = mp_avg;
  6814. -+ mp_coeff[outlier_idx][0] = mp_avg;
  6815. - }
  6816. - }
  6817. -
  6818. --static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah,
  6819. -- struct coeff *coeff,
  6820. -- bool is_reusable)
  6821. -+static void ar9003_hw_tx_iq_cal_outlier_detection(struct ath_hw *ah,
  6822. -+ struct coeff *coeff,
  6823. -+ bool is_reusable)
  6824. +--- a/drivers/net/wireless/ath/ath9k/xmit.c
  6825. ++++ b/drivers/net/wireless/ath/ath9k/xmit.c
  6826. +@@ -107,9 +107,6 @@ static void ath_tx_queue_tid(struct ath_
  6827. {
  6828. - int i, im, nmeasurement;
  6829. -+ int magnitude, phase;
  6830. - u32 tx_corr_coeff[MAX_MEASUREMENT][AR9300_MAX_CHAINS];
  6831. - struct ath9k_hw_cal_data *caldata = ah->caldata;
  6832. -
  6833. -@@ -920,21 +923,30 @@ static void ar9003_hw_tx_iqcal_load_avg_
  6834. - if (nmeasurement > MAX_MEASUREMENT)
  6835. - nmeasurement = MAX_MEASUREMENT;
  6836. + struct ath_atx_ac *ac = tid->ac;
  6837. -- /* detect outlier only if nmeasurement > 1 */
  6838. -- if (nmeasurement > 1) {
  6839. -- /* Detect magnitude outlier */
  6840. -- ar9003_hw_detect_outlier(coeff->mag_coeff[i],
  6841. -- nmeasurement, MAX_MAG_DELTA);
  6842. +- if (tid->paused)
  6843. +- return;
  6844. -
  6845. -- /* Detect phase outlier */
  6846. -- ar9003_hw_detect_outlier(coeff->phs_coeff[i],
  6847. -- nmeasurement, MAX_PHS_DELTA);
  6848. -+ /*
  6849. -+ * Skip normal outlier detection for AR9550.
  6850. -+ */
  6851. -+ if (!AR_SREV_9550(ah)) {
  6852. -+ /* detect outlier only if nmeasurement > 1 */
  6853. -+ if (nmeasurement > 1) {
  6854. -+ /* Detect magnitude outlier */
  6855. -+ ar9003_hw_detect_outlier(coeff->mag_coeff[i],
  6856. -+ nmeasurement,
  6857. -+ MAX_MAG_DELTA);
  6858. -+
  6859. -+ /* Detect phase outlier */
  6860. -+ ar9003_hw_detect_outlier(coeff->phs_coeff[i],
  6861. -+ nmeasurement,
  6862. -+ MAX_PHS_DELTA);
  6863. -+ }
  6864. - }
  6865. -
  6866. - for (im = 0; im < nmeasurement; im++) {
  6867. -+ magnitude = coeff->mag_coeff[i][im][0];
  6868. -+ phase = coeff->phs_coeff[i][im][0];
  6869. -
  6870. -- coeff->iqc_coeff[0] = (coeff->mag_coeff[i][im] & 0x7f) |
  6871. -- ((coeff->phs_coeff[i][im] & 0x7f) << 7);
  6872. -+ coeff->iqc_coeff[0] =
  6873. -+ (phase & 0x7f) | ((magnitude & 0x7f) << 7);
  6874. + if (tid->sched)
  6875. + return;
  6876. - if ((im % 2) == 0)
  6877. - REG_RMW_FIELD(ah, tx_corr_coeff[im][i],
  6878. -@@ -991,7 +1003,63 @@ static bool ar9003_hw_tx_iq_cal_run(stru
  6879. - return true;
  6880. - }
  6881. +@@ -1407,7 +1404,6 @@ int ath_tx_aggr_start(struct ath_softc *
  6882. + ath_tx_tid_change_state(sc, txtid);
  6883. --static void ar9003_hw_tx_iq_cal_post_proc(struct ath_hw *ah, bool is_reusable)
  6884. -+static void __ar955x_tx_iq_cal_sort(struct ath_hw *ah,
  6885. -+ struct coeff *coeff,
  6886. -+ int i, int nmeasurement)
  6887. -+{
  6888. -+ struct ath_common *common = ath9k_hw_common(ah);
  6889. -+ int im, ix, iy, temp;
  6890. -+
  6891. -+ for (im = 0; im < nmeasurement; im++) {
  6892. -+ for (ix = 0; ix < MAXIQCAL - 1; ix++) {
  6893. -+ for (iy = ix + 1; iy <= MAXIQCAL - 1; iy++) {
  6894. -+ if (coeff->mag_coeff[i][im][iy] <
  6895. -+ coeff->mag_coeff[i][im][ix]) {
  6896. -+ temp = coeff->mag_coeff[i][im][ix];
  6897. -+ coeff->mag_coeff[i][im][ix] =
  6898. -+ coeff->mag_coeff[i][im][iy];
  6899. -+ coeff->mag_coeff[i][im][iy] = temp;
  6900. -+ }
  6901. -+ if (coeff->phs_coeff[i][im][iy] <
  6902. -+ coeff->phs_coeff[i][im][ix]) {
  6903. -+ temp = coeff->phs_coeff[i][im][ix];
  6904. -+ coeff->phs_coeff[i][im][ix] =
  6905. -+ coeff->phs_coeff[i][im][iy];
  6906. -+ coeff->phs_coeff[i][im][iy] = temp;
  6907. -+ }
  6908. -+ }
  6909. -+ }
  6910. -+ coeff->mag_coeff[i][im][0] = coeff->mag_coeff[i][im][MAXIQCAL / 2];
  6911. -+ coeff->phs_coeff[i][im][0] = coeff->phs_coeff[i][im][MAXIQCAL / 2];
  6912. -+
  6913. -+ ath_dbg(common, CALIBRATE,
  6914. -+ "IQCAL: Median [ch%d][gain%d]: mag = %d phase = %d\n",
  6915. -+ i, im,
  6916. -+ coeff->mag_coeff[i][im][0],
  6917. -+ coeff->phs_coeff[i][im][0]);
  6918. -+ }
  6919. -+}
  6920. -+
  6921. -+static bool ar955x_tx_iq_cal_median(struct ath_hw *ah,
  6922. -+ struct coeff *coeff,
  6923. -+ int iqcal_idx,
  6924. -+ int nmeasurement)
  6925. -+{
  6926. -+ int i;
  6927. -+
  6928. -+ if ((iqcal_idx + 1) != MAXIQCAL)
  6929. -+ return false;
  6930. -+
  6931. -+ for (i = 0; i < AR9300_MAX_CHAINS; i++) {
  6932. -+ __ar955x_tx_iq_cal_sort(ah, coeff, i, nmeasurement);
  6933. -+ }
  6934. -+
  6935. -+ return true;
  6936. -+}
  6937. -+
  6938. -+static void ar9003_hw_tx_iq_cal_post_proc(struct ath_hw *ah,
  6939. -+ int iqcal_idx,
  6940. -+ bool is_reusable)
  6941. - {
  6942. - struct ath_common *common = ath9k_hw_common(ah);
  6943. - const u32 txiqcal_status[AR9300_MAX_CHAINS] = {
  6944. -@@ -1004,10 +1072,11 @@ static void ar9003_hw_tx_iq_cal_post_pro
  6945. - AR_PHY_CHAN_INFO_TAB_1,
  6946. - AR_PHY_CHAN_INFO_TAB_2,
  6947. - };
  6948. -- struct coeff coeff;
  6949. -+ static struct coeff coeff;
  6950. - s32 iq_res[6];
  6951. - int i, im, j;
  6952. -- int nmeasurement;
  6953. -+ int nmeasurement = 0;
  6954. -+ bool outlier_detect = true;
  6955. + txtid->active = true;
  6956. +- txtid->paused = true;
  6957. + *ssn = txtid->seq_start = txtid->seq_next;
  6958. + txtid->bar_index = -1;
  6959. - for (i = 0; i < AR9300_MAX_CHAINS; i++) {
  6960. - if (!(ah->txchainmask & (1 << i)))
  6961. -@@ -1065,17 +1134,23 @@ static void ar9003_hw_tx_iq_cal_post_pro
  6962. - goto tx_iqcal_fail;
  6963. - }
  6964. +@@ -1427,7 +1423,6 @@ void ath_tx_aggr_stop(struct ath_softc *
  6965. -- coeff.mag_coeff[i][im] = coeff.iqc_coeff[0] & 0x7f;
  6966. -- coeff.phs_coeff[i][im] =
  6967. -+ coeff.phs_coeff[i][im][iqcal_idx] =
  6968. -+ coeff.iqc_coeff[0] & 0x7f;
  6969. -+ coeff.mag_coeff[i][im][iqcal_idx] =
  6970. - (coeff.iqc_coeff[0] >> 7) & 0x7f;
  6971. + ath_txq_lock(sc, txq);
  6972. + txtid->active = false;
  6973. +- txtid->paused = false;
  6974. + ath_tx_flush_tid(sc, txtid);
  6975. + ath_tx_tid_change_state(sc, txtid);
  6976. + ath_txq_unlock_complete(sc, txq);
  6977. +@@ -1487,7 +1482,7 @@ void ath_tx_aggr_wakeup(struct ath_softc
  6978. + ath_txq_lock(sc, txq);
  6979. + ac->clear_ps_filter = true;
  6980. -- if (coeff.mag_coeff[i][im] > 63)
  6981. -- coeff.mag_coeff[i][im] -= 128;
  6982. -- if (coeff.phs_coeff[i][im] > 63)
  6983. -- coeff.phs_coeff[i][im] -= 128;
  6984. -+ if (coeff.mag_coeff[i][im][iqcal_idx] > 63)
  6985. -+ coeff.mag_coeff[i][im][iqcal_idx] -= 128;
  6986. -+ if (coeff.phs_coeff[i][im][iqcal_idx] > 63)
  6987. -+ coeff.phs_coeff[i][im][iqcal_idx] -= 128;
  6988. +- if (!tid->paused && ath_tid_has_buffered(tid)) {
  6989. ++ if (ath_tid_has_buffered(tid)) {
  6990. + ath_tx_queue_tid(txq, tid);
  6991. + ath_txq_schedule(sc, txq);
  6992. }
  6993. - }
  6994. -- ar9003_hw_tx_iqcal_load_avg_2_passes(ah, &coeff, is_reusable);
  6995. -+
  6996. -+ if (AR_SREV_9550(ah))
  6997. -+ outlier_detect = ar955x_tx_iq_cal_median(ah, &coeff,
  6998. -+ iqcal_idx, nmeasurement);
  6999. -+ if (outlier_detect)
  7000. -+ ar9003_hw_tx_iq_cal_outlier_detection(ah, &coeff, is_reusable);
  7001. -
  7002. - return;
  7003. -
  7004. -@@ -1409,7 +1484,7 @@ skip_tx_iqcal:
  7005. - }
  7006. -
  7007. - if (txiqcal_done)
  7008. -- ar9003_hw_tx_iq_cal_post_proc(ah, is_reusable);
  7009. -+ ar9003_hw_tx_iq_cal_post_proc(ah, 0, is_reusable);
  7010. - else if (caldata && test_bit(TXIQCAL_DONE, &caldata->cal_flags))
  7011. - ar9003_hw_tx_iq_cal_reload(ah);
  7012. +@@ -1510,7 +1505,6 @@ void ath_tx_aggr_resume(struct ath_softc
  7013. + ath_txq_lock(sc, txq);
  7014. -@@ -1455,14 +1530,38 @@ skip_tx_iqcal:
  7015. - return true;
  7016. - }
  7017. -
  7018. -+static bool do_ar9003_agc_cal(struct ath_hw *ah)
  7019. -+{
  7020. -+ struct ath_common *common = ath9k_hw_common(ah);
  7021. -+ bool status;
  7022. -+
  7023. -+ REG_WRITE(ah, AR_PHY_AGC_CONTROL,
  7024. -+ REG_READ(ah, AR_PHY_AGC_CONTROL) |
  7025. -+ AR_PHY_AGC_CONTROL_CAL);
  7026. -+
  7027. -+ status = ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL,
  7028. -+ AR_PHY_AGC_CONTROL_CAL,
  7029. -+ 0, AH_WAIT_TIMEOUT);
  7030. -+ if (!status) {
  7031. -+ ath_dbg(common, CALIBRATE,
  7032. -+ "offset calibration failed to complete in %d ms,"
  7033. -+ "noisy environment?\n",
  7034. -+ AH_WAIT_TIMEOUT / 1000);
  7035. -+ return false;
  7036. -+ }
  7037. -+
  7038. -+ return true;
  7039. -+}
  7040. -+
  7041. - static bool ar9003_hw_init_cal_soc(struct ath_hw *ah,
  7042. - struct ath9k_channel *chan)
  7043. - {
  7044. - struct ath_common *common = ath9k_hw_common(ah);
  7045. - struct ath9k_hw_cal_data *caldata = ah->caldata;
  7046. - bool txiqcal_done = false;
  7047. -- bool is_reusable = true, status = true;
  7048. -+ bool status = true;
  7049. - bool run_agc_cal = false, sep_iq_cal = false;
  7050. -+ int i = 0;
  7051. + tid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor;
  7052. +- tid->paused = false;
  7053. - /* Use chip chainmask only for calibration */
  7054. - ar9003_hw_set_chain_masks(ah, ah->caps.rx_chainmask, ah->caps.tx_chainmask);
  7055. -@@ -1485,7 +1584,12 @@ static bool ar9003_hw_init_cal_soc(struc
  7056. - * AGC calibration. Specifically, AR9550 in SoC chips.
  7057. - */
  7058. - if (ah->enabled_cals & TX_IQ_ON_AGC_CAL) {
  7059. -- txiqcal_done = true;
  7060. -+ if (REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_0,
  7061. -+ AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL)) {
  7062. -+ txiqcal_done = true;
  7063. -+ } else {
  7064. -+ txiqcal_done = false;
  7065. -+ }
  7066. - run_agc_cal = true;
  7067. - } else {
  7068. - sep_iq_cal = true;
  7069. -@@ -1512,27 +1616,37 @@ skip_tx_iqcal:
  7070. - if (AR_SREV_9330_11(ah))
  7071. - ar9003_hw_manual_peak_cal(ah, 0, IS_CHAN_2GHZ(chan));
  7072. + if (ath_tid_has_buffered(tid)) {
  7073. + ath_tx_queue_tid(txq, tid);
  7074. +@@ -1544,8 +1538,6 @@ void ath9k_release_buffered_frames(struc
  7075. + continue;
  7076. -- /* Calibrate the AGC */
  7077. -- REG_WRITE(ah, AR_PHY_AGC_CONTROL,
  7078. -- REG_READ(ah, AR_PHY_AGC_CONTROL) |
  7079. -- AR_PHY_AGC_CONTROL_CAL);
  7080. --
  7081. -- /* Poll for offset calibration complete */
  7082. -- status = ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL,
  7083. -- AR_PHY_AGC_CONTROL_CAL,
  7084. -- 0, AH_WAIT_TIMEOUT);
  7085. -- }
  7086. -+ /*
  7087. -+ * For non-AR9550 chips, we just trigger AGC calibration
  7088. -+ * in the HW, poll for completion and then process
  7089. -+ * the results.
  7090. -+ *
  7091. -+ * For AR955x, we run it multiple times and use
  7092. -+ * median IQ correction.
  7093. -+ */
  7094. -+ if (!AR_SREV_9550(ah)) {
  7095. -+ status = do_ar9003_agc_cal(ah);
  7096. -+ if (!status)
  7097. -+ return false;
  7098. + tid = ATH_AN_2_TID(an, i);
  7099. +- if (tid->paused)
  7100. +- continue;
  7101. -- if (!status) {
  7102. -- ath_dbg(common, CALIBRATE,
  7103. -- "offset calibration failed to complete in %d ms; noisy environment?\n",
  7104. -- AH_WAIT_TIMEOUT / 1000);
  7105. -- return false;
  7106. -+ if (txiqcal_done)
  7107. -+ ar9003_hw_tx_iq_cal_post_proc(ah, 0, false);
  7108. -+ } else {
  7109. -+ if (!txiqcal_done) {
  7110. -+ status = do_ar9003_agc_cal(ah);
  7111. -+ if (!status)
  7112. -+ return false;
  7113. -+ } else {
  7114. -+ for (i = 0; i < MAXIQCAL; i++) {
  7115. -+ status = do_ar9003_agc_cal(ah);
  7116. -+ if (!status)
  7117. -+ return false;
  7118. -+ ar9003_hw_tx_iq_cal_post_proc(ah, i, false);
  7119. -+ }
  7120. -+ }
  7121. -+ }
  7122. - }
  7123. + ath_txq_lock(sc, tid->ac->txq);
  7124. + while (nframes > 0) {
  7125. +@@ -1844,9 +1836,6 @@ void ath_txq_schedule(struct ath_softc *
  7126. + list_del(&tid->list);
  7127. + tid->sched = false;
  7128. -- if (txiqcal_done)
  7129. -- ar9003_hw_tx_iq_cal_post_proc(ah, is_reusable);
  7130. +- if (tid->paused)
  7131. +- continue;
  7132. -
  7133. - /* Revert chainmask to runtime parameters */
  7134. - ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
  7135. -
  7136. ---- a/drivers/net/wireless/rtl818x/rtl8187/rtl8187.h
  7137. -+++ b/drivers/net/wireless/rtl818x/rtl8187/rtl8187.h
  7138. -@@ -15,6 +15,8 @@
  7139. - #ifndef RTL8187_H
  7140. - #define RTL8187_H
  7141. -
  7142. -+#include <linux/cache.h>
  7143. -+
  7144. - #include "rtl818x.h"
  7145. - #include "leds.h"
  7146. -
  7147. -@@ -139,7 +141,10 @@ struct rtl8187_priv {
  7148. - u8 aifsn[4];
  7149. - u8 rfkill_mask;
  7150. - struct {
  7151. -- __le64 buf;
  7152. -+ union {
  7153. -+ __le64 buf;
  7154. -+ u8 dummy1[L1_CACHE_BYTES];
  7155. -+ } ____cacheline_aligned;
  7156. - struct sk_buff_head queue;
  7157. - } b_tx_status; /* This queue is used by both -b and non-b devices */
  7158. - struct mutex io_mutex;
  7159. -@@ -147,7 +152,8 @@ struct rtl8187_priv {
  7160. - u8 bits8;
  7161. - __le16 bits16;
  7162. - __le32 bits32;
  7163. -- } *io_dmabuf;
  7164. -+ u8 dummy2[L1_CACHE_BYTES];
  7165. -+ } *io_dmabuf ____cacheline_aligned;
  7166. - bool rfkill_off;
  7167. - u16 seqno;
  7168. - };
  7169. ---- a/net/mac80211/wme.c
  7170. -+++ b/net/mac80211/wme.c
  7171. -@@ -154,6 +154,11 @@ u16 ieee80211_select_queue(struct ieee80
  7172. - return IEEE80211_AC_BE;
  7173. - }
  7174. -
  7175. -+ if (skb->protocol == sdata->control_port_protocol) {
  7176. -+ skb->priority = 7;
  7177. -+ return ieee80211_downgrade_queue(sdata, skb);
  7178. -+ }
  7179. -+
  7180. - /* use the data classifier to determine what 802.1d tag the
  7181. - * data frame has */
  7182. - rcu_read_lock();
  7183. ---- a/drivers/net/wireless/ath/ath9k/xmit.c
  7184. -+++ b/drivers/net/wireless/ath/ath9k/xmit.c
  7185. -@@ -1444,14 +1444,16 @@ void ath_tx_aggr_sleep(struct ieee80211_
  7186. - for (tidno = 0, tid = &an->tid[tidno];
  7187. - tidno < IEEE80211_NUM_TIDS; tidno++, tid++) {
  7188. + if (ath_tx_sched_aggr(sc, txq, tid, &stop))
  7189. + sent = true;
  7190. +
  7191. +@@ -2698,7 +2687,6 @@ void ath_tx_node_init(struct ath_softc *
  7192. + tid->baw_size = WME_MAX_BA;
  7193. + tid->baw_head = tid->baw_tail = 0;
  7194. + tid->sched = false;
  7195. +- tid->paused = false;
  7196. + tid->active = false;
  7197. + __skb_queue_head_init(&tid->buf_q);
  7198. + __skb_queue_head_init(&tid->retry_q);
  7199. +--- a/drivers/net/wireless/ath/ath9k/recv.c
  7200. ++++ b/drivers/net/wireless/ath/ath9k/recv.c
  7201. +@@ -975,6 +975,7 @@ int ath_rx_tasklet(struct ath_softc *sc,
  7202. + u64 tsf = 0;
  7203. + unsigned long flags;
  7204. + dma_addr_t new_buf_addr;
  7205. ++ unsigned int budget = 512;
  7206. -- if (!tid->sched)
  7207. + if (edma)
  7208. + dma_type = DMA_BIDIRECTIONAL;
  7209. +@@ -1113,15 +1114,17 @@ requeue_drop_frag:
  7210. + }
  7211. + requeue:
  7212. + list_add_tail(&bf->list, &sc->rx.rxbuf);
  7213. +- if (flush)
  7214. - continue;
  7215. --
  7216. - ac = tid->ac;
  7217. - txq = ac->txq;
  7218. -
  7219. - ath_txq_lock(sc, txq);
  7220. -
  7221. -+ if (!tid->sched) {
  7222. -+ ath_txq_unlock(sc, txq);
  7223. -+ continue;
  7224. -+ }
  7225. -+
  7226. - buffered = ath_tid_has_buffered(tid);
  7227. - tid->sched = false;
  7228. -@@ -1696,7 +1698,7 @@ int ath_cabq_update(struct ath_softc *sc
  7229. -
  7230. - ath9k_hw_get_txq_props(sc->sc_ah, qnum, &qi);
  7231. -
  7232. -- qi.tqi_readyTime = (cur_conf->beacon_interval *
  7233. -+ qi.tqi_readyTime = (TU_TO_USEC(cur_conf->beacon_interval) *
  7234. - ATH_CABQ_READY_TIME) / 100;
  7235. - ath_txq_update(sc, qnum, &qi);
  7236. -
  7237. -@@ -2061,7 +2063,7 @@ static struct ath_buf *ath_tx_setup_buff
  7238. -
  7239. - ATH_TXBUF_RESET(bf);
  7240. -
  7241. -- if (tid) {
  7242. -+ if (tid && ieee80211_is_data_present(hdr->frame_control)) {
  7243. - fragno = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG;
  7244. - seqno = tid->seq_next;
  7245. - hdr->seq_ctrl = cpu_to_le16(tid->seq_next << IEEE80211_SEQ_SEQ_SHIFT);
  7246. -@@ -2184,14 +2186,15 @@ int ath_tx_start(struct ieee80211_hw *hw
  7247. - txq->stopped = true;
  7248. - }
  7249. -
  7250. -+ if (txctl->an && ieee80211_is_data_present(hdr->frame_control))
  7251. -+ tid = ath_get_skb_tid(sc, txctl->an, skb);
  7252. + if (edma) {
  7253. + ath_rx_edma_buf_link(sc, qtype);
  7254. + } else {
  7255. + ath_rx_buf_relink(sc, bf);
  7256. +- ath9k_hw_rxena(ah);
  7257. ++ if (!flush)
  7258. ++ ath9k_hw_rxena(ah);
  7259. + }
  7260. +
  7261. - if (info->flags & IEEE80211_TX_CTL_PS_RESPONSE) {
  7262. - ath_txq_unlock(sc, txq);
  7263. - txq = sc->tx.uapsdq;
  7264. - ath_txq_lock(sc, txq);
  7265. - } else if (txctl->an &&
  7266. - ieee80211_is_data_present(hdr->frame_control)) {
  7267. -- tid = ath_get_skb_tid(sc, txctl->an, skb);
  7268. --
  7269. - WARN_ON(tid->ac->txq != txctl->txq);
  7270. ++ if (!budget--)
  7271. ++ break;
  7272. + } while (1);
  7273. +
  7274. + if (!(ah->imask & ATH9K_INT_RXEOL)) {
  7275. +--- a/drivers/net/wireless/ath/ath9k/ahb.c
  7276. ++++ b/drivers/net/wireless/ath/ath9k/ahb.c
  7277. +@@ -86,7 +86,6 @@ static int ath_ahb_probe(struct platform
  7278. + int irq;
  7279. + int ret = 0;
  7280. + struct ath_hw *ah;
  7281. +- struct ath_common *common;
  7282. + char hw_name[64];
  7283. +
  7284. + if (!dev_get_platdata(&pdev->dev)) {
  7285. +@@ -146,9 +145,6 @@ static int ath_ahb_probe(struct platform
  7286. + wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n",
  7287. + hw_name, (unsigned long)mem, irq);
  7288. +
  7289. +- common = ath9k_hw_common(sc->sc_ah);
  7290. +- /* Will be cleared in ath9k_start() */
  7291. +- set_bit(ATH_OP_INVALID, &common->op_flags);
  7292. + return 0;
  7293. - if (info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT)
  7294. + err_irq:
  7295. --- a/drivers/net/wireless/ath/ath9k/init.c
  7296. +++ b/drivers/net/wireless/ath/ath9k/init.c
  7297. -@@ -943,6 +943,7 @@ static void ath9k_set_hw_capab(struct at
  7298. - hw->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
  7299. - hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_5_10_MHZ;
  7300. - hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
  7301. -+ hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD;
  7302. -
  7303. - hw->queues = 4;
  7304. - hw->max_rates = 4;
  7305. ---- a/net/mac80211/ieee80211_i.h
  7306. -+++ b/net/mac80211/ieee80211_i.h
  7307. -@@ -1700,14 +1700,8 @@ void ieee80211_stop_queue_by_reason(stru
  7308. - void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue);
  7309. - void ieee80211_add_pending_skb(struct ieee80211_local *local,
  7310. - struct sk_buff *skb);
  7311. --void ieee80211_add_pending_skbs_fn(struct ieee80211_local *local,
  7312. -- struct sk_buff_head *skbs,
  7313. -- void (*fn)(void *data), void *data);
  7314. --static inline void ieee80211_add_pending_skbs(struct ieee80211_local *local,
  7315. -- struct sk_buff_head *skbs)
  7316. --{
  7317. -- ieee80211_add_pending_skbs_fn(local, skbs, NULL, NULL);
  7318. --}
  7319. -+void ieee80211_add_pending_skbs(struct ieee80211_local *local,
  7320. -+ struct sk_buff_head *skbs);
  7321. - void ieee80211_flush_queues(struct ieee80211_local *local,
  7322. - struct ieee80211_sub_if_data *sdata);
  7323. -
  7324. ---- a/net/mac80211/sta_info.c
  7325. -+++ b/net/mac80211/sta_info.c
  7326. -@@ -91,7 +91,7 @@ static int sta_info_hash_del(struct ieee
  7327. - return -ENOENT;
  7328. - }
  7329. -
  7330. --static void cleanup_single_sta(struct sta_info *sta)
  7331. -+static void __cleanup_single_sta(struct sta_info *sta)
  7332. - {
  7333. - int ac, i;
  7334. - struct tid_ampdu_tx *tid_tx;
  7335. -@@ -99,7 +99,8 @@ static void cleanup_single_sta(struct st
  7336. - struct ieee80211_local *local = sdata->local;
  7337. - struct ps_data *ps;
  7338. -
  7339. -- if (test_sta_flag(sta, WLAN_STA_PS_STA)) {
  7340. -+ if (test_sta_flag(sta, WLAN_STA_PS_STA) ||
  7341. -+ test_sta_flag(sta, WLAN_STA_PS_DRIVER)) {
  7342. - if (sta->sdata->vif.type == NL80211_IFTYPE_AP ||
  7343. - sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
  7344. - ps = &sdata->bss->ps;
  7345. -@@ -109,6 +110,7 @@ static void cleanup_single_sta(struct st
  7346. - return;
  7347. -
  7348. - clear_sta_flag(sta, WLAN_STA_PS_STA);
  7349. -+ clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
  7350. -
  7351. - atomic_dec(&ps->num_sta_ps);
  7352. - sta_info_recalc_tim(sta);
  7353. -@@ -139,7 +141,14 @@ static void cleanup_single_sta(struct st
  7354. - ieee80211_purge_tx_queue(&local->hw, &tid_tx->pending);
  7355. - kfree(tid_tx);
  7356. - }
  7357. -+}
  7358. -
  7359. -+static void cleanup_single_sta(struct sta_info *sta)
  7360. -+{
  7361. -+ struct ieee80211_sub_if_data *sdata = sta->sdata;
  7362. -+ struct ieee80211_local *local = sdata->local;
  7363. -+
  7364. -+ __cleanup_single_sta(sta);
  7365. - sta_info_free(local, sta);
  7366. - }
  7367. -
  7368. -@@ -330,6 +339,7 @@ struct sta_info *sta_info_alloc(struct i
  7369. - rcu_read_unlock();
  7370. -
  7371. - spin_lock_init(&sta->lock);
  7372. -+ spin_lock_init(&sta->ps_lock);
  7373. - INIT_WORK(&sta->drv_unblock_wk, sta_unblock);
  7374. - INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
  7375. - mutex_init(&sta->ampdu_mlme.mtx);
  7376. -@@ -487,21 +497,26 @@ static int sta_info_insert_finish(struct
  7377. - goto out_err;
  7378. - }
  7379. -
  7380. -- /* notify driver */
  7381. -- err = sta_info_insert_drv_state(local, sdata, sta);
  7382. -- if (err)
  7383. -- goto out_err;
  7384. --
  7385. - local->num_sta++;
  7386. - local->sta_generation++;
  7387. - smp_mb();
  7388. -
  7389. -+ /* simplify things and don't accept BA sessions yet */
  7390. -+ set_sta_flag(sta, WLAN_STA_BLOCK_BA);
  7391. -+
  7392. - /* make the station visible */
  7393. - sta_info_hash_add(local, sta);
  7394. -
  7395. - list_add_rcu(&sta->list, &local->sta_list);
  7396. -
  7397. -+ /* notify driver */
  7398. -+ err = sta_info_insert_drv_state(local, sdata, sta);
  7399. -+ if (err)
  7400. -+ goto out_remove;
  7401. -+
  7402. - set_sta_flag(sta, WLAN_STA_INSERTED);
  7403. -+ /* accept BA sessions now */
  7404. -+ clear_sta_flag(sta, WLAN_STA_BLOCK_BA);
  7405. -
  7406. - ieee80211_recalc_min_chandef(sdata);
  7407. - ieee80211_sta_debugfs_add(sta);
  7408. -@@ -522,6 +537,12 @@ static int sta_info_insert_finish(struct
  7409. - mesh_accept_plinks_update(sdata);
  7410. -
  7411. - return 0;
  7412. -+ out_remove:
  7413. -+ sta_info_hash_del(local, sta);
  7414. -+ list_del_rcu(&sta->list);
  7415. -+ local->num_sta--;
  7416. -+ synchronize_net();
  7417. -+ __cleanup_single_sta(sta);
  7418. - out_err:
  7419. - mutex_unlock(&local->sta_mtx);
  7420. - rcu_read_lock();
  7421. -@@ -1071,10 +1092,14 @@ struct ieee80211_sta *ieee80211_find_sta
  7422. - }
  7423. - EXPORT_SYMBOL(ieee80211_find_sta);
  7424. -
  7425. --static void clear_sta_ps_flags(void *_sta)
  7426. -+/* powersave support code */
  7427. -+void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
  7428. - {
  7429. -- struct sta_info *sta = _sta;
  7430. - struct ieee80211_sub_if_data *sdata = sta->sdata;
  7431. -+ struct ieee80211_local *local = sdata->local;
  7432. -+ struct sk_buff_head pending;
  7433. -+ int filtered = 0, buffered = 0, ac;
  7434. -+ unsigned long flags;
  7435. - struct ps_data *ps;
  7436. -
  7437. - if (sdata->vif.type == NL80211_IFTYPE_AP ||
  7438. -@@ -1085,20 +1110,6 @@ static void clear_sta_ps_flags(void *_st
  7439. - else
  7440. - return;
  7441. -
  7442. -- clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
  7443. -- if (test_and_clear_sta_flag(sta, WLAN_STA_PS_STA))
  7444. -- atomic_dec(&ps->num_sta_ps);
  7445. --}
  7446. --
  7447. --/* powersave support code */
  7448. --void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
  7449. --{
  7450. -- struct ieee80211_sub_if_data *sdata = sta->sdata;
  7451. -- struct ieee80211_local *local = sdata->local;
  7452. -- struct sk_buff_head pending;
  7453. -- int filtered = 0, buffered = 0, ac;
  7454. -- unsigned long flags;
  7455. --
  7456. - clear_sta_flag(sta, WLAN_STA_SP);
  7457. -
  7458. - BUILD_BUG_ON(BITS_TO_LONGS(IEEE80211_NUM_TIDS) > 1);
  7459. -@@ -1109,6 +1120,8 @@ void ieee80211_sta_ps_deliver_wakeup(str
  7460. -
  7461. - skb_queue_head_init(&pending);
  7462. +@@ -670,6 +670,7 @@ static const struct ieee80211_iface_comb
  7463. + .num_different_channels = 1,
  7464. + .beacon_int_infra_match = true,
  7465. + },
  7466. ++#ifdef CONFIG_ATH9K_DFS_CERTIFIED
  7467. + {
  7468. + .limits = if_dfs_limits,
  7469. + .n_limits = ARRAY_SIZE(if_dfs_limits),
  7470. +@@ -679,6 +680,7 @@ static const struct ieee80211_iface_comb
  7471. + .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
  7472. + BIT(NL80211_CHAN_WIDTH_20),
  7473. + }
  7474. ++#endif
  7475. + };
  7476. -+ /* sync with ieee80211_tx_h_unicast_ps_buf */
  7477. -+ spin_lock(&sta->ps_lock);
  7478. - /* Send all buffered frames to the station */
  7479. - for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
  7480. - int count = skb_queue_len(&pending), tmp;
  7481. -@@ -1127,7 +1140,12 @@ void ieee80211_sta_ps_deliver_wakeup(str
  7482. - buffered += tmp - count;
  7483. - }
  7484. + static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
  7485. +@@ -781,6 +783,9 @@ int ath9k_init_device(u16 devid, struct
  7486. + common = ath9k_hw_common(ah);
  7487. + ath9k_set_hw_capab(sc, hw);
  7488. -- ieee80211_add_pending_skbs_fn(local, &pending, clear_sta_ps_flags, sta);
  7489. -+ ieee80211_add_pending_skbs(local, &pending);
  7490. -+ clear_sta_flag(sta, WLAN_STA_PS_DRIVER);
  7491. -+ clear_sta_flag(sta, WLAN_STA_PS_STA);
  7492. -+ spin_unlock(&sta->ps_lock);
  7493. ++ /* Will be cleared in ath9k_start() */
  7494. ++ set_bit(ATH_OP_INVALID, &common->op_flags);
  7495. +
  7496. -+ atomic_dec(&ps->num_sta_ps);
  7497. -
  7498. - /* This station just woke up and isn't aware of our SMPS state */
  7499. - if (!ieee80211_smps_is_restrictive(sta->known_smps_mode,
  7500. ---- a/net/mac80211/sta_info.h
  7501. -+++ b/net/mac80211/sta_info.h
  7502. -@@ -267,6 +267,7 @@ struct ieee80211_tx_latency_stat {
  7503. - * @drv_unblock_wk: used for driver PS unblocking
  7504. - * @listen_interval: listen interval of this station, when we're acting as AP
  7505. - * @_flags: STA flags, see &enum ieee80211_sta_info_flags, do not use directly
  7506. -+ * @ps_lock: used for powersave (when mac80211 is the AP) related locking
  7507. - * @ps_tx_buf: buffers (per AC) of frames to transmit to this station
  7508. - * when it leaves power saving state or polls
  7509. - * @tx_filtered: buffers (per AC) of frames we already tried to
  7510. -@@ -356,10 +357,8 @@ struct sta_info {
  7511. - /* use the accessors defined below */
  7512. - unsigned long _flags;
  7513. -
  7514. -- /*
  7515. -- * STA powersave frame queues, no more than the internal
  7516. -- * locking required.
  7517. -- */
  7518. -+ /* STA powersave lock and frame queues */
  7519. -+ spinlock_t ps_lock;
  7520. - struct sk_buff_head ps_tx_buf[IEEE80211_NUM_ACS];
  7521. - struct sk_buff_head tx_filtered[IEEE80211_NUM_ACS];
  7522. - unsigned long driver_buffered_tids;
  7523. ---- a/net/mac80211/util.c
  7524. -+++ b/net/mac80211/util.c
  7525. -@@ -435,9 +435,8 @@ void ieee80211_add_pending_skb(struct ie
  7526. - spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
  7527. - }
  7528. -
  7529. --void ieee80211_add_pending_skbs_fn(struct ieee80211_local *local,
  7530. -- struct sk_buff_head *skbs,
  7531. -- void (*fn)(void *data), void *data)
  7532. -+void ieee80211_add_pending_skbs(struct ieee80211_local *local,
  7533. -+ struct sk_buff_head *skbs)
  7534. + /* Initialize regulatory */
  7535. + error = ath_regd_init(&common->regulatory, sc->hw->wiphy,
  7536. + ath9k_reg_notifier);
  7537. +--- a/drivers/net/wireless/ath/ath9k/pci.c
  7538. ++++ b/drivers/net/wireless/ath/ath9k/pci.c
  7539. +@@ -784,7 +784,6 @@ static int ath_pci_probe(struct pci_dev
  7540. {
  7541. - struct ieee80211_hw *hw = &local->hw;
  7542. - struct sk_buff *skb;
  7543. -@@ -461,9 +460,6 @@ void ieee80211_add_pending_skbs_fn(struc
  7544. - __skb_queue_tail(&local->pending[queue], skb);
  7545. - }
  7546. -
  7547. -- if (fn)
  7548. -- fn(data);
  7549. + struct ath_softc *sc;
  7550. + struct ieee80211_hw *hw;
  7551. +- struct ath_common *common;
  7552. + u8 csz;
  7553. + u32 val;
  7554. + int ret = 0;
  7555. +@@ -877,10 +876,6 @@ static int ath_pci_probe(struct pci_dev
  7556. + wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n",
  7557. + hw_name, (unsigned long)sc->mem, pdev->irq);
  7558. +
  7559. +- /* Will be cleared in ath9k_start() */
  7560. +- common = ath9k_hw_common(sc->sc_ah);
  7561. +- set_bit(ATH_OP_INVALID, &common->op_flags);
  7562. -
  7563. - for (i = 0; i < hw->queues; i++)
  7564. - __ieee80211_wake_queue(hw, i,
  7565. - IEEE80211_QUEUE_STOP_REASON_SKB_ADD);
  7566. ---- a/net/wireless/reg.c
  7567. -+++ b/net/wireless/reg.c
  7568. -@@ -1700,7 +1700,7 @@ static void reg_process_hint(struct regu
  7569. - return;
  7570. - case NL80211_REGDOM_SET_BY_USER:
  7571. - treatment = reg_process_hint_user(reg_request);
  7572. -- if (treatment == REG_REQ_OK ||
  7573. -+ if (treatment == REG_REQ_IGNORE ||
  7574. - treatment == REG_REQ_ALREADY_SET)
  7575. - return;
  7576. - schedule_delayed_work(&reg_timeout, msecs_to_jiffies(3142));
  7577. ---- a/drivers/net/wireless/ath/ath9k/debug.c
  7578. -+++ b/drivers/net/wireless/ath/ath9k/debug.c
  7579. -@@ -138,43 +138,41 @@ static ssize_t read_file_ani(struct file
  7580. - unsigned int len = 0, size = 1024;
  7581. - ssize_t retval = 0;
  7582. - char *buf;
  7583. -+ int i;
  7584. -+ struct {
  7585. -+ const char *name;
  7586. -+ unsigned int val;
  7587. -+ } ani_info[] = {
  7588. -+ { "ANI RESET", ah->stats.ast_ani_reset },
  7589. -+ { "OFDM LEVEL", ah->ani.ofdmNoiseImmunityLevel },
  7590. -+ { "CCK LEVEL", ah->ani.cckNoiseImmunityLevel },
  7591. -+ { "SPUR UP", ah->stats.ast_ani_spurup },
  7592. -+ { "SPUR DOWN", ah->stats.ast_ani_spurup },
  7593. -+ { "OFDM WS-DET ON", ah->stats.ast_ani_ofdmon },
  7594. -+ { "OFDM WS-DET OFF", ah->stats.ast_ani_ofdmoff },
  7595. -+ { "MRC-CCK ON", ah->stats.ast_ani_ccklow },
  7596. -+ { "MRC-CCK OFF", ah->stats.ast_ani_cckhigh },
  7597. -+ { "FIR-STEP UP", ah->stats.ast_ani_stepup },
  7598. -+ { "FIR-STEP DOWN", ah->stats.ast_ani_stepdown },
  7599. -+ { "INV LISTENTIME", ah->stats.ast_ani_lneg_or_lzero },
  7600. -+ { "OFDM ERRORS", ah->stats.ast_ani_ofdmerrs },
  7601. -+ { "CCK ERRORS", ah->stats.ast_ani_cckerrs },
  7602. -+ };
  7603. -
  7604. - buf = kzalloc(size, GFP_KERNEL);
  7605. - if (buf == NULL)
  7606. - return -ENOMEM;
  7607. -
  7608. -- if (common->disable_ani) {
  7609. -- len += scnprintf(buf + len, size - len, "%s: %s\n",
  7610. -- "ANI", "DISABLED");
  7611. -+ len += scnprintf(buf + len, size - len, "%15s: %s\n", "ANI",
  7612. -+ common->disable_ani ? "DISABLED" : "ENABLED");
  7613. -+
  7614. -+ if (common->disable_ani)
  7615. - goto exit;
  7616. -- }
  7617. -
  7618. -- len += scnprintf(buf + len, size - len, "%15s: %s\n",
  7619. -- "ANI", "ENABLED");
  7620. -- len += scnprintf(buf + len, size - len, "%15s: %u\n",
  7621. -- "ANI RESET", ah->stats.ast_ani_reset);
  7622. -- len += scnprintf(buf + len, size - len, "%15s: %u\n",
  7623. -- "SPUR UP", ah->stats.ast_ani_spurup);
  7624. -- len += scnprintf(buf + len, size - len, "%15s: %u\n",
  7625. -- "SPUR DOWN", ah->stats.ast_ani_spurup);
  7626. -- len += scnprintf(buf + len, size - len, "%15s: %u\n",
  7627. -- "OFDM WS-DET ON", ah->stats.ast_ani_ofdmon);
  7628. -- len += scnprintf(buf + len, size - len, "%15s: %u\n",
  7629. -- "OFDM WS-DET OFF", ah->stats.ast_ani_ofdmoff);
  7630. -- len += scnprintf(buf + len, size - len, "%15s: %u\n",
  7631. -- "MRC-CCK ON", ah->stats.ast_ani_ccklow);
  7632. -- len += scnprintf(buf + len, size - len, "%15s: %u\n",
  7633. -- "MRC-CCK OFF", ah->stats.ast_ani_cckhigh);
  7634. -- len += scnprintf(buf + len, size - len, "%15s: %u\n",
  7635. -- "FIR-STEP UP", ah->stats.ast_ani_stepup);
  7636. -- len += scnprintf(buf + len, size - len, "%15s: %u\n",
  7637. -- "FIR-STEP DOWN", ah->stats.ast_ani_stepdown);
  7638. -- len += scnprintf(buf + len, size - len, "%15s: %u\n",
  7639. -- "INV LISTENTIME", ah->stats.ast_ani_lneg_or_lzero);
  7640. -- len += scnprintf(buf + len, size - len, "%15s: %u\n",
  7641. -- "OFDM ERRORS", ah->stats.ast_ani_ofdmerrs);
  7642. -- len += scnprintf(buf + len, size - len, "%15s: %u\n",
  7643. -- "CCK ERRORS", ah->stats.ast_ani_cckerrs);
  7644. -+ for (i = 0; i < ARRAY_SIZE(ani_info); i++)
  7645. -+ len += scnprintf(buf + len, size - len, "%15s: %u\n",
  7646. -+ ani_info[i].name, ani_info[i].val);
  7647. -+
  7648. - exit:
  7649. - if (len > size)
  7650. - len = size;
  7651. -@@ -866,6 +864,12 @@ static ssize_t read_file_reset(struct fi
  7652. - "%17s: %2d\n", "PLL RX Hang",
  7653. - sc->debug.stats.reset[RESET_TYPE_PLL_HANG]);
  7654. - len += scnprintf(buf + len, sizeof(buf) - len,
  7655. -+ "%17s: %2d\n", "MAC Hang",
  7656. -+ sc->debug.stats.reset[RESET_TYPE_MAC_HANG]);
  7657. -+ len += scnprintf(buf + len, sizeof(buf) - len,
  7658. -+ "%17s: %2d\n", "Stuck Beacon",
  7659. -+ sc->debug.stats.reset[RESET_TYPE_BEACON_STUCK]);
  7660. -+ len += scnprintf(buf + len, sizeof(buf) - len,
  7661. - "%17s: %2d\n", "MCI Reset",
  7662. - sc->debug.stats.reset[RESET_TYPE_MCI]);
  7663. -
  7664. ---- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
  7665. -+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
  7666. -@@ -868,10 +868,6 @@ static void ar9003_hw_set_rfmode(struct
  7667. -
  7668. - if (IS_CHAN_A_FAST_CLOCK(ah, chan))
  7669. - rfMode |= (AR_PHY_MODE_DYNAMIC | AR_PHY_MODE_DYN_CCK_DISABLE);
  7670. -- if (IS_CHAN_QUARTER_RATE(chan))
  7671. -- rfMode |= AR_PHY_MODE_QUARTER;
  7672. -- if (IS_CHAN_HALF_RATE(chan))
  7673. -- rfMode |= AR_PHY_MODE_HALF;
  7674. -
  7675. - if (rfMode & (AR_PHY_MODE_QUARTER | AR_PHY_MODE_HALF))
  7676. - REG_RMW_FIELD(ah, AR_PHY_FRAME_CTL,
  7677. ---- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
  7678. -+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
  7679. -@@ -706,6 +706,7 @@ ath5k_get_survey(struct ieee80211_hw *hw
  7680. - survey->channel = conf->chandef.chan;
  7681. - survey->noise = ah->ah_noise_floor;
  7682. - survey->filled = SURVEY_INFO_NOISE_DBM |
  7683. -+ SURVEY_INFO_IN_USE |
  7684. - SURVEY_INFO_CHANNEL_TIME |
  7685. - SURVEY_INFO_CHANNEL_TIME_BUSY |
  7686. - SURVEY_INFO_CHANNEL_TIME_RX |
  7687. ---- a/drivers/net/wireless/ath/ath9k/recv.c
  7688. -+++ b/drivers/net/wireless/ath/ath9k/recv.c
  7689. -@@ -732,11 +732,18 @@ static struct ath_rxbuf *ath_get_next_rx
  7690. - return NULL;
  7691. -
  7692. - /*
  7693. -- * mark descriptor as zero-length and set the 'more'
  7694. -- * flag to ensure that both buffers get discarded
  7695. -+ * Re-check previous descriptor, in case it has been filled
  7696. -+ * in the mean time.
  7697. - */
  7698. -- rs->rs_datalen = 0;
  7699. -- rs->rs_more = true;
  7700. -+ ret = ath9k_hw_rxprocdesc(ah, ds, rs);
  7701. -+ if (ret == -EINPROGRESS) {
  7702. -+ /*
  7703. -+ * mark descriptor as zero-length and set the 'more'
  7704. -+ * flag to ensure that both buffers get discarded
  7705. -+ */
  7706. -+ rs->rs_datalen = 0;
  7707. -+ rs->rs_more = true;
  7708. -+ }
  7709. - }
  7710. -
  7711. - list_del(&bf->list);
  7712. -@@ -985,32 +992,32 @@ static int ath9k_rx_skb_preprocess(struc
  7713. - struct ath_common *common = ath9k_hw_common(ah);
  7714. - struct ieee80211_hdr *hdr;
  7715. - bool discard_current = sc->rx.discard_next;
  7716. -- int ret = 0;
  7717. -
  7718. - /*
  7719. - * Discard corrupt descriptors which are marked in
  7720. - * ath_get_next_rx_buf().
  7721. - */
  7722. -- sc->rx.discard_next = rx_stats->rs_more;
  7723. - if (discard_current)
  7724. -- return -EINVAL;
  7725. -+ goto corrupt;
  7726. -+
  7727. -+ sc->rx.discard_next = false;
  7728. -
  7729. - /*
  7730. - * Discard zero-length packets.
  7731. - */
  7732. - if (!rx_stats->rs_datalen) {
  7733. - RX_STAT_INC(rx_len_err);
  7734. -- return -EINVAL;
  7735. -+ goto corrupt;
  7736. - }
  7737. -
  7738. -- /*
  7739. -- * rs_status follows rs_datalen so if rs_datalen is too large
  7740. -- * we can take a hint that hardware corrupted it, so ignore
  7741. -- * those frames.
  7742. -- */
  7743. -+ /*
  7744. -+ * rs_status follows rs_datalen so if rs_datalen is too large
  7745. -+ * we can take a hint that hardware corrupted it, so ignore
  7746. -+ * those frames.
  7747. -+ */
  7748. - if (rx_stats->rs_datalen > (common->rx_bufsize - ah->caps.rx_status_len)) {
  7749. - RX_STAT_INC(rx_len_err);
  7750. -- return -EINVAL;
  7751. -+ goto corrupt;
  7752. - }
  7753. -
  7754. - /* Only use status info from the last fragment */
  7755. -@@ -1024,10 +1031,8 @@ static int ath9k_rx_skb_preprocess(struc
  7756. - * This is different from the other corrupt descriptor
  7757. - * condition handled above.
  7758. - */
  7759. -- if (rx_stats->rs_status & ATH9K_RXERR_CORRUPT_DESC) {
  7760. -- ret = -EINVAL;
  7761. -- goto exit;
  7762. -- }
  7763. -+ if (rx_stats->rs_status & ATH9K_RXERR_CORRUPT_DESC)
  7764. -+ goto corrupt;
  7765. -
  7766. - hdr = (struct ieee80211_hdr *) (skb->data + ah->caps.rx_status_len);
  7767. -
  7768. -@@ -1043,18 +1048,15 @@ static int ath9k_rx_skb_preprocess(struc
  7769. - if (ath_process_fft(sc, hdr, rx_stats, rx_status->mactime))
  7770. - RX_STAT_INC(rx_spectral);
  7771. + return 0;
  7772. -- ret = -EINVAL;
  7773. -- goto exit;
  7774. -+ return -EINVAL;
  7775. + err_init:
  7776. +--- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
  7777. ++++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
  7778. +@@ -410,7 +410,7 @@ static const u32 ar9300_2p2_baseband_cor
  7779. + {0x00009e30, 0x06336f77},
  7780. + {0x00009e34, 0x6af6532f},
  7781. + {0x00009e38, 0x0cc80c00},
  7782. +- {0x00009e40, 0x0d261820},
  7783. ++ {0x00009e40, 0x0d261800},
  7784. + {0x00009e4c, 0x00001004},
  7785. + {0x00009e50, 0x00ff03f1},
  7786. + {0x00009e54, 0x00000000},
  7787. +--- a/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
  7788. ++++ b/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
  7789. +@@ -592,7 +592,7 @@ static const u32 ar9331_1p1_baseband_cor
  7790. + {0x00009e30, 0x06336f77},
  7791. + {0x00009e34, 0x6af6532f},
  7792. + {0x00009e38, 0x0cc80c00},
  7793. +- {0x00009e40, 0x0d261820},
  7794. ++ {0x00009e40, 0x0d261800},
  7795. + {0x00009e4c, 0x00001004},
  7796. + {0x00009e50, 0x00ff03f1},
  7797. + {0x00009fc0, 0x803e4788},
  7798. +--- a/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
  7799. ++++ b/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
  7800. +@@ -231,7 +231,7 @@ static const u32 ar9331_1p2_baseband_cor
  7801. + {0x00009e30, 0x06336f77},
  7802. + {0x00009e34, 0x6af6532f},
  7803. + {0x00009e38, 0x0cc80c00},
  7804. +- {0x00009e40, 0x0d261820},
  7805. ++ {0x00009e40, 0x0d261800},
  7806. + {0x00009e4c, 0x00001004},
  7807. + {0x00009e50, 0x00ff03f1},
  7808. + {0x00009fc0, 0x803e4788},
  7809. +--- a/drivers/net/wireless/ath/ath9k/ar9340_initvals.h
  7810. ++++ b/drivers/net/wireless/ath/ath9k/ar9340_initvals.h
  7811. +@@ -318,7 +318,7 @@ static const u32 ar9340_1p0_baseband_cor
  7812. + {0x00009e30, 0x06336f77},
  7813. + {0x00009e34, 0x6af6532f},
  7814. + {0x00009e38, 0x0cc80c00},
  7815. +- {0x00009e40, 0x0d261820},
  7816. ++ {0x00009e40, 0x0d261800},
  7817. + {0x00009e4c, 0x00001004},
  7818. + {0x00009e50, 0x00ff03f1},
  7819. + {0x00009e54, 0x00000000},
  7820. +@@ -348,9 +348,9 @@ static const u32 ar9340_1p0_baseband_cor
  7821. + {0x0000a370, 0x00000000},
  7822. + {0x0000a390, 0x00000001},
  7823. + {0x0000a394, 0x00000444},
  7824. +- {0x0000a398, 0x00000000},
  7825. +- {0x0000a39c, 0x210d0401},
  7826. +- {0x0000a3a0, 0xab9a7144},
  7827. ++ {0x0000a398, 0x001f0e0f},
  7828. ++ {0x0000a39c, 0x0075393f},
  7829. ++ {0x0000a3a0, 0xb79f6427},
  7830. + {0x0000a3a4, 0x00000000},
  7831. + {0x0000a3a8, 0xaaaaaaaa},
  7832. + {0x0000a3ac, 0x3c466478},
  7833. +--- a/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
  7834. ++++ b/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
  7835. +@@ -90,7 +90,7 @@ static const u32 ar9580_1p0_baseband_cor
  7836. + {0x00009e30, 0x06336f77},
  7837. + {0x00009e34, 0x6af6532f},
  7838. + {0x00009e38, 0x0cc80c00},
  7839. +- {0x00009e40, 0x0d261820},
  7840. ++ {0x00009e40, 0x0d261800},
  7841. + {0x00009e4c, 0x00001004},
  7842. + {0x00009e50, 0x00ff03f1},
  7843. + {0x00009e54, 0x00000000},
  7844. +--- a/drivers/net/wireless/ath/ath9k/ar953x_initvals.h
  7845. ++++ b/drivers/net/wireless/ath/ath9k/ar953x_initvals.h
  7846. +@@ -257,9 +257,9 @@ static const u32 qca953x_1p0_baseband_co
  7847. + {0x0000a370, 0x00000000},
  7848. + {0x0000a390, 0x00000001},
  7849. + {0x0000a394, 0x00000444},
  7850. +- {0x0000a398, 0x1f020503},
  7851. +- {0x0000a39c, 0x29180c03},
  7852. +- {0x0000a3a0, 0x9a8b6844},
  7853. ++ {0x0000a398, 0x001f0e0f},
  7854. ++ {0x0000a39c, 0x0075393f},
  7855. ++ {0x0000a3a0, 0xb79f6427},
  7856. + {0x0000a3a4, 0x000000ff},
  7857. + {0x0000a3a8, 0x6a6a6a6a},
  7858. + {0x0000a3ac, 0x6a6a6a6a},
  7859. +--- a/drivers/net/wireless/ath/ath5k/phy.c
  7860. ++++ b/drivers/net/wireless/ath/ath5k/phy.c
  7861. +@@ -3709,8 +3709,8 @@ ath5k_hw_txpower(struct ath5k_hw *ah, st
  7862. + AR5K_REG_MS(AR5K_TUNE_MAX_TXPOWER, AR5K_TPC_CHIRP),
  7863. + AR5K_TPC);
  7864. + } else {
  7865. +- ath5k_hw_reg_write(ah, AR5K_PHY_TXPOWER_RATE_MAX |
  7866. +- AR5K_TUNE_MAX_TXPOWER, AR5K_PHY_TXPOWER_RATE_MAX);
  7867. ++ ath5k_hw_reg_write(ah, AR5K_TUNE_MAX_TXPOWER,
  7868. ++ AR5K_PHY_TXPOWER_RATE_MAX);
  7869. }
  7870. - /*
  7871. - * everything but the rate is checked here, the rate check is done
  7872. - * separately to avoid doing two lookups for a rate for each frame.
  7873. - */
  7874. -- if (!ath9k_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error)) {
  7875. -- ret = -EINVAL;
  7876. -- goto exit;
  7877. -- }
  7878. -+ if (!ath9k_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error))
  7879. -+ return -EINVAL;
  7880. -
  7881. - if (ath_is_mybeacon(common, hdr)) {
  7882. - RX_STAT_INC(rx_beacons);
  7883. -@@ -1064,15 +1066,11 @@ static int ath9k_rx_skb_preprocess(struc
  7884. - /*
  7885. - * This shouldn't happen, but have a safety check anyway.
  7886. - */
  7887. -- if (WARN_ON(!ah->curchan)) {
  7888. -- ret = -EINVAL;
  7889. -- goto exit;
  7890. -- }
  7891. -+ if (WARN_ON(!ah->curchan))
  7892. -+ return -EINVAL;
  7893. -
  7894. -- if (ath9k_process_rate(common, hw, rx_stats, rx_status)) {
  7895. -- ret =-EINVAL;
  7896. -- goto exit;
  7897. -- }
  7898. -+ if (ath9k_process_rate(common, hw, rx_stats, rx_status))
  7899. -+ return -EINVAL;
  7900. -
  7901. - ath9k_process_rssi(common, hw, rx_stats, rx_status);
  7902. -
  7903. -@@ -1087,9 +1085,11 @@ static int ath9k_rx_skb_preprocess(struc
  7904. - sc->rx.num_pkts++;
  7905. - #endif
  7906. -
  7907. --exit:
  7908. -- sc->rx.discard_next = false;
  7909. -- return ret;
  7910. -+ return 0;
  7911. -+
  7912. -+corrupt:
  7913. -+ sc->rx.discard_next = rx_stats->rs_more;
  7914. -+ return -EINVAL;
  7915. - }
  7916. -
  7917. - static void ath9k_rx_skb_postprocess(struct ath_common *common,
  7918. ---- a/drivers/net/wireless/ath/ath9k/ani.c
  7919. -+++ b/drivers/net/wireless/ath/ath9k/ani.c
  7920. -@@ -176,16 +176,26 @@ static void ath9k_hw_set_ofdm_nil(struct
  7921. - if (ah->opmode == NL80211_IFTYPE_STATION &&
  7922. - BEACON_RSSI(ah) <= ATH9K_ANI_RSSI_THR_HIGH)
  7923. - weak_sig = true;
  7924. --
  7925. - /*
  7926. -- * OFDM Weak signal detection is always enabled for AP mode.
  7927. -+ * Newer chipsets are better at dealing with high PHY error counts -
  7928. -+ * keep weak signal detection enabled when no RSSI threshold is
  7929. -+ * available to determine if it is needed (mode != STA)
  7930. - */
  7931. -- if (ah->opmode != NL80211_IFTYPE_AP &&
  7932. -- aniState->ofdmWeakSigDetect != weak_sig) {
  7933. -- ath9k_hw_ani_control(ah,
  7934. -- ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
  7935. -- entry_ofdm->ofdm_weak_signal_on);
  7936. -- }
  7937. -+ else if (AR_SREV_9300_20_OR_LATER(ah) &&
  7938. -+ ah->opmode != NL80211_IFTYPE_STATION)
  7939. -+ weak_sig = true;
  7940. -+
  7941. -+ /* Older chipsets are more sensitive to high PHY error counts */
  7942. -+ else if (!AR_SREV_9300_20_OR_LATER(ah) &&
  7943. -+ aniState->ofdmNoiseImmunityLevel >= 8)
  7944. -+ weak_sig = false;
  7945. -+
  7946. -+ if (aniState->ofdmWeakSigDetect != weak_sig)
  7947. -+ ath9k_hw_ani_control(ah, ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION,
  7948. -+ weak_sig);
  7949. -+
  7950. -+ if (!AR_SREV_9300_20_OR_LATER(ah))
  7951. -+ return;
  7952. -
  7953. - if (aniState->ofdmNoiseImmunityLevel >= ATH9K_ANI_OFDM_DEF_LEVEL) {
  7954. - ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH;
  7955. -@@ -308,17 +318,6 @@ void ath9k_ani_reset(struct ath_hw *ah,
  7956. - BUG_ON(aniState == NULL);
  7957. - ah->stats.ast_ani_reset++;
  7958. -
  7959. -- /* only allow a subset of functions in AP mode */
  7960. -- if (ah->opmode == NL80211_IFTYPE_AP) {
  7961. -- if (IS_CHAN_2GHZ(chan)) {
  7962. -- ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL |
  7963. -- ATH9K_ANI_FIRSTEP_LEVEL);
  7964. -- if (AR_SREV_9300_20_OR_LATER(ah))
  7965. -- ah->ani_function |= ATH9K_ANI_MRC_CCK;
  7966. -- } else
  7967. -- ah->ani_function = 0;
  7968. -- }
  7969. --
  7970. - ofdm_nil = max_t(int, ATH9K_ANI_OFDM_DEF_LEVEL,
  7971. - aniState->ofdmNoiseImmunityLevel);
  7972. - cck_nil = max_t(int, ATH9K_ANI_CCK_DEF_LEVEL,
  7973. -@@ -483,10 +482,17 @@ void ath9k_hw_ani_init(struct ath_hw *ah
  7974. -
  7975. - ath_dbg(common, ANI, "Initialize ANI\n");
  7976. -
  7977. -- ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH;
  7978. -- ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW;
  7979. -- ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH;
  7980. -- ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW;
  7981. -+ if (AR_SREV_9300_20_OR_LATER(ah)) {
  7982. -+ ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH;
  7983. -+ ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW;
  7984. -+ ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH;
  7985. -+ ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW;
  7986. -+ } else {
  7987. -+ ah->config.ofdm_trig_high = ATH9K_ANI_OFDM_TRIG_HIGH_OLD;
  7988. -+ ah->config.ofdm_trig_low = ATH9K_ANI_OFDM_TRIG_LOW_OLD;
  7989. -+ ah->config.cck_trig_high = ATH9K_ANI_CCK_TRIG_HIGH_OLD;
  7990. -+ ah->config.cck_trig_low = ATH9K_ANI_CCK_TRIG_LOW_OLD;
  7991. -+ }
  7992. -
  7993. - ani->spurImmunityLevel = ATH9K_ANI_SPUR_IMMUNE_LVL;
  7994. - ani->firstepLevel = ATH9K_ANI_FIRSTEP_LVL;
  7995. ---- a/drivers/net/wireless/ath/ath9k/ani.h
  7996. -+++ b/drivers/net/wireless/ath/ath9k/ani.h
  7997. -@@ -22,12 +22,16 @@
  7998. - /* units are errors per second */
  7999. - #define ATH9K_ANI_OFDM_TRIG_HIGH 3500
  8000. - #define ATH9K_ANI_OFDM_TRIG_HIGH_BELOW_INI 1000
  8001. -+#define ATH9K_ANI_OFDM_TRIG_HIGH_OLD 500
  8002. -
  8003. - #define ATH9K_ANI_OFDM_TRIG_LOW 400
  8004. - #define ATH9K_ANI_OFDM_TRIG_LOW_ABOVE_INI 900
  8005. -+#define ATH9K_ANI_OFDM_TRIG_LOW_OLD 200
  8006. -
  8007. - #define ATH9K_ANI_CCK_TRIG_HIGH 600
  8008. -+#define ATH9K_ANI_CCK_TRIG_HIGH_OLD 200
  8009. - #define ATH9K_ANI_CCK_TRIG_LOW 300
  8010. -+#define ATH9K_ANI_CCK_TRIG_LOW_OLD 100
  8011. -
  8012. - #define ATH9K_ANI_SPUR_IMMUNE_LVL 3
  8013. - #define ATH9K_ANI_FIRSTEP_LVL 2
  8014. ---- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
  8015. -+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
  8016. -@@ -26,10 +26,6 @@ static const int firstep_table[] =
  8017. - /* level: 0 1 2 3 4 5 6 7 8 */
  8018. - { -4, -2, 0, 2, 4, 6, 8, 10, 12 }; /* lvl 0-8, default 2 */
  8019. -
  8020. --static const int cycpwrThr1_table[] =
  8021. --/* level: 0 1 2 3 4 5 6 7 8 */
  8022. -- { -6, -4, -2, 0, 2, 4, 6, 8 }; /* lvl 0-7, default 3 */
  8023. --
  8024. - /*
  8025. - * register values to turn OFDM weak signal detection OFF
  8026. - */
  8027. -@@ -921,7 +917,7 @@ static bool ar5008_hw_ani_control_new(st
  8028. - struct ath_common *common = ath9k_hw_common(ah);
  8029. - struct ath9k_channel *chan = ah->curchan;
  8030. - struct ar5416AniState *aniState = &ah->ani;
  8031. -- s32 value, value2;
  8032. -+ s32 value;
  8033. -
  8034. - switch (cmd & ah->ani_function) {
  8035. - case ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION:{
  8036. -@@ -1008,42 +1004,9 @@ static bool ar5008_hw_ani_control_new(st
  8037. - case ATH9K_ANI_FIRSTEP_LEVEL:{
  8038. - u32 level = param;
  8039. -
  8040. -- if (level >= ARRAY_SIZE(firstep_table)) {
  8041. -- ath_dbg(common, ANI,
  8042. -- "ATH9K_ANI_FIRSTEP_LEVEL: level out of range (%u > %zu)\n",
  8043. -- level, ARRAY_SIZE(firstep_table));
  8044. -- return false;
  8045. -- }
  8046. --
  8047. -- /*
  8048. -- * make register setting relative to default
  8049. -- * from INI file & cap value
  8050. -- */
  8051. -- value = firstep_table[level] -
  8052. -- firstep_table[ATH9K_ANI_FIRSTEP_LVL] +
  8053. -- aniState->iniDef.firstep;
  8054. -- if (value < ATH9K_SIG_FIRSTEP_SETTING_MIN)
  8055. -- value = ATH9K_SIG_FIRSTEP_SETTING_MIN;
  8056. -- if (value > ATH9K_SIG_FIRSTEP_SETTING_MAX)
  8057. -- value = ATH9K_SIG_FIRSTEP_SETTING_MAX;
  8058. -+ value = level;
  8059. - REG_RMW_FIELD(ah, AR_PHY_FIND_SIG,
  8060. -- AR_PHY_FIND_SIG_FIRSTEP,
  8061. -- value);
  8062. -- /*
  8063. -- * we need to set first step low register too
  8064. -- * make register setting relative to default
  8065. -- * from INI file & cap value
  8066. -- */
  8067. -- value2 = firstep_table[level] -
  8068. -- firstep_table[ATH9K_ANI_FIRSTEP_LVL] +
  8069. -- aniState->iniDef.firstepLow;
  8070. -- if (value2 < ATH9K_SIG_FIRSTEP_SETTING_MIN)
  8071. -- value2 = ATH9K_SIG_FIRSTEP_SETTING_MIN;
  8072. -- if (value2 > ATH9K_SIG_FIRSTEP_SETTING_MAX)
  8073. -- value2 = ATH9K_SIG_FIRSTEP_SETTING_MAX;
  8074. --
  8075. -- REG_RMW_FIELD(ah, AR_PHY_FIND_SIG_LOW,
  8076. -- AR_PHY_FIND_SIG_FIRSTEP_LOW, value2);
  8077. -+ AR_PHY_FIND_SIG_FIRSTEP, value);
  8078. -
  8079. - if (level != aniState->firstepLevel) {
  8080. - ath_dbg(common, ANI,
  8081. -@@ -1060,7 +1023,7 @@ static bool ar5008_hw_ani_control_new(st
  8082. - aniState->firstepLevel,
  8083. - level,
  8084. - ATH9K_ANI_FIRSTEP_LVL,
  8085. -- value2,
  8086. -+ value,
  8087. - aniState->iniDef.firstepLow);
  8088. - if (level > aniState->firstepLevel)
  8089. - ah->stats.ast_ani_stepup++;
  8090. -@@ -1073,41 +1036,13 @@ static bool ar5008_hw_ani_control_new(st
  8091. - case ATH9K_ANI_SPUR_IMMUNITY_LEVEL:{
  8092. - u32 level = param;
  8093. -
  8094. -- if (level >= ARRAY_SIZE(cycpwrThr1_table)) {
  8095. -- ath_dbg(common, ANI,
  8096. -- "ATH9K_ANI_SPUR_IMMUNITY_LEVEL: level out of range (%u > %zu)\n",
  8097. -- level, ARRAY_SIZE(cycpwrThr1_table));
  8098. -- return false;
  8099. -- }
  8100. -- /*
  8101. -- * make register setting relative to default
  8102. -- * from INI file & cap value
  8103. -- */
  8104. -- value = cycpwrThr1_table[level] -
  8105. -- cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] +
  8106. -- aniState->iniDef.cycpwrThr1;
  8107. -- if (value < ATH9K_SIG_SPUR_IMM_SETTING_MIN)
  8108. -- value = ATH9K_SIG_SPUR_IMM_SETTING_MIN;
  8109. -- if (value > ATH9K_SIG_SPUR_IMM_SETTING_MAX)
  8110. -- value = ATH9K_SIG_SPUR_IMM_SETTING_MAX;
  8111. -+ value = (level + 1) * 2;
  8112. - REG_RMW_FIELD(ah, AR_PHY_TIMING5,
  8113. -- AR_PHY_TIMING5_CYCPWR_THR1,
  8114. -- value);
  8115. -+ AR_PHY_TIMING5_CYCPWR_THR1, value);
  8116. -
  8117. -- /*
  8118. -- * set AR_PHY_EXT_CCA for extension channel
  8119. -- * make register setting relative to default
  8120. -- * from INI file & cap value
  8121. -- */
  8122. -- value2 = cycpwrThr1_table[level] -
  8123. -- cycpwrThr1_table[ATH9K_ANI_SPUR_IMMUNE_LVL] +
  8124. -- aniState->iniDef.cycpwrThr1Ext;
  8125. -- if (value2 < ATH9K_SIG_SPUR_IMM_SETTING_MIN)
  8126. -- value2 = ATH9K_SIG_SPUR_IMM_SETTING_MIN;
  8127. -- if (value2 > ATH9K_SIG_SPUR_IMM_SETTING_MAX)
  8128. -- value2 = ATH9K_SIG_SPUR_IMM_SETTING_MAX;
  8129. -- REG_RMW_FIELD(ah, AR_PHY_EXT_CCA,
  8130. -- AR_PHY_EXT_TIMING5_CYCPWR_THR1, value2);
  8131. -+ if (IS_CHAN_HT40(ah->curchan))
  8132. -+ REG_RMW_FIELD(ah, AR_PHY_EXT_CCA,
  8133. -+ AR_PHY_EXT_TIMING5_CYCPWR_THR1, value);
  8134. -
  8135. - if (level != aniState->spurImmunityLevel) {
  8136. - ath_dbg(common, ANI,
  8137. -@@ -1124,7 +1059,7 @@ static bool ar5008_hw_ani_control_new(st
  8138. - aniState->spurImmunityLevel,
  8139. - level,
  8140. - ATH9K_ANI_SPUR_IMMUNE_LVL,
  8141. -- value2,
  8142. -+ value,
  8143. - aniState->iniDef.cycpwrThr1Ext);
  8144. - if (level > aniState->spurImmunityLevel)
  8145. - ah->stats.ast_ani_spurup++;
  8146. + return 0;
  8147. diff --git a/package/mac80211/patches/310-ap_scan.patch b/package/mac80211/patches/310-ap_scan.patch
  8148. index 389a003..87f165a 100644
  8149. --- a/package/mac80211/patches/310-ap_scan.patch
  8150. +++ b/package/mac80211/patches/310-ap_scan.patch
  8151. @@ -1,6 +1,6 @@
  8152. --- a/net/mac80211/cfg.c
  8153. +++ b/net/mac80211/cfg.c
  8154. -@@ -2148,7 +2148,7 @@ static int ieee80211_scan(struct wiphy *
  8155. +@@ -2154,7 +2154,7 @@ static int ieee80211_scan(struct wiphy *
  8156. * the frames sent while scanning on other channel will be
  8157. * lost)
  8158. */
  8159. diff --git a/package/mac80211/patches/400-ath_move_debug_code.patch b/package/mac80211/patches/400-ath_move_debug_code.patch
  8160. index 0dba7ac..4cc77af 100644
  8161. --- a/package/mac80211/patches/400-ath_move_debug_code.patch
  8162. +++ b/package/mac80211/patches/400-ath_move_debug_code.patch
  8163. @@ -12,7 +12,7 @@
  8164. ccflags-y += -D__CHECK_ENDIAN__
  8165. --- a/drivers/net/wireless/ath/ath.h
  8166. +++ b/drivers/net/wireless/ath/ath.h
  8167. -@@ -282,13 +282,6 @@ void _ath_dbg(struct ath_common *common,
  8168. +@@ -295,13 +295,6 @@ void _ath_dbg(struct ath_common *common,
  8169. #endif /* CPTCFG_ATH_DEBUG */
  8170. /** Returns string describing opmode, or NULL if unknown mode. */
  8171. diff --git a/package/mac80211/patches/402-ath9k-fix-invalid-mac-address-handling.patch b/package/mac80211/patches/402-ath9k-fix-invalid-mac-address-handling.patch
  8172. index 63ab0db..acaa317 100644
  8173. --- a/package/mac80211/patches/402-ath9k-fix-invalid-mac-address-handling.patch
  8174. +++ b/package/mac80211/patches/402-ath9k-fix-invalid-mac-address-handling.patch
  8175. @@ -8,7 +8,7 @@
  8176. #include <asm/unaligned.h>
  8177. #include "hw.h"
  8178. -@@ -449,8 +450,16 @@ static int ath9k_hw_init_macaddr(struct
  8179. +@@ -448,8 +449,16 @@ static int ath9k_hw_init_macaddr(struct
  8180. common->macaddr[2 * i] = eeval >> 8;
  8181. common->macaddr[2 * i + 1] = eeval & 0xff;
  8182. }
  8183. diff --git a/package/mac80211/patches/403-ath_regd_optional.patch b/package/mac80211/patches/403-ath_regd_optional.patch
  8184. index 07c54cc..4a9b7e4 100644
  8185. --- a/package/mac80211/patches/403-ath_regd_optional.patch
  8186. +++ b/package/mac80211/patches/403-ath_regd_optional.patch
  8187. @@ -58,7 +58,7 @@
  8188. ---help---
  8189. --- a/.local-symbols
  8190. +++ b/.local-symbols
  8191. -@@ -119,6 +119,7 @@ RTL8187_LEDS=
  8192. +@@ -120,6 +120,7 @@ RTL8187_LEDS=
  8193. ATH_COMMON=
  8194. ATH_CARDS=
  8195. ATH_DEBUG=
  8196. diff --git a/package/mac80211/patches/405-regd_no_assoc_hints.patch b/package/mac80211/patches/405-regd_no_assoc_hints.patch
  8197. index 6ad4fda..4fa611f 100644
  8198. --- a/package/mac80211/patches/405-regd_no_assoc_hints.patch
  8199. +++ b/package/mac80211/patches/405-regd_no_assoc_hints.patch
  8200. @@ -1,6 +1,6 @@
  8201. --- a/net/wireless/reg.c
  8202. +++ b/net/wireless/reg.c
  8203. -@@ -1878,6 +1878,8 @@ void regulatory_hint_country_ie(struct w
  8204. +@@ -2000,6 +2000,8 @@ void regulatory_hint_country_ie(struct w
  8205. enum environment_cap env = ENVIRON_ANY;
  8206. struct regulatory_request *request = NULL, *lr;
  8207. @@ -9,7 +9,7 @@
  8208. /* IE len must be evenly divisible by 2 */
  8209. if (country_ie_len & 0x01)
  8210. return;
  8211. -@@ -2072,6 +2074,7 @@ static void restore_regulatory_settings(
  8212. +@@ -2194,6 +2196,7 @@ static void restore_regulatory_settings(
  8213. void regulatory_hint_disconnect(void)
  8214. {
  8215. diff --git a/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch b/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch
  8216. index 1f71e0b..909a5f1 100644
  8217. --- a/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch
  8218. +++ b/package/mac80211/patches/410-ath9k_allow_adhoc_and_ap.patch
  8219. @@ -1,6 +1,6 @@
  8220. --- a/drivers/net/wireless/ath/ath9k/init.c
  8221. +++ b/drivers/net/wireless/ath/ath9k/init.c
  8222. -@@ -866,6 +866,7 @@ static const struct ieee80211_iface_limi
  8223. +@@ -652,6 +652,7 @@ static const struct ieee80211_iface_limi
  8224. #endif
  8225. BIT(NL80211_IFTYPE_AP) |
  8226. BIT(NL80211_IFTYPE_P2P_GO) },
  8227. diff --git a/package/mac80211/patches/411-ath5k_allow_adhoc_and_ap.patch b/package/mac80211/patches/411-ath5k_allow_adhoc_and_ap.patch
  8228. index 3487ab2..1f06994 100644
  8229. --- a/package/mac80211/patches/411-ath5k_allow_adhoc_and_ap.patch
  8230. +++ b/package/mac80211/patches/411-ath5k_allow_adhoc_and_ap.patch
  8231. @@ -18,7 +18,7 @@
  8232. goto end;
  8233. --- a/drivers/net/wireless/ath/ath5k/base.c
  8234. +++ b/drivers/net/wireless/ath/ath5k/base.c
  8235. -@@ -1934,7 +1934,7 @@ ath5k_beacon_send(struct ath5k_hw *ah)
  8236. +@@ -1937,7 +1937,7 @@ ath5k_beacon_send(struct ath5k_hw *ah)
  8237. }
  8238. if ((ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs +
  8239. @@ -27,7 +27,7 @@
  8240. ah->opmode == NL80211_IFTYPE_MESH_POINT) {
  8241. u64 tsf = ath5k_hw_get_tsf64(ah);
  8242. u32 tsftu = TSF_TO_TU(tsf);
  8243. -@@ -2020,7 +2020,7 @@ ath5k_beacon_update_timers(struct ath5k_
  8244. +@@ -2023,7 +2023,7 @@ ath5k_beacon_update_timers(struct ath5k_
  8245. intval = ah->bintval & AR5K_BEACON_PERIOD;
  8246. if (ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs
  8247. @@ -36,7 +36,7 @@
  8248. intval /= ATH_BCBUF; /* staggered multi-bss beacons */
  8249. if (intval < 15)
  8250. ATH5K_WARN(ah, "intval %u is too low, min 15\n",
  8251. -@@ -2487,6 +2487,7 @@ static const struct ieee80211_iface_limi
  8252. +@@ -2490,6 +2490,7 @@ static const struct ieee80211_iface_limi
  8253. BIT(NL80211_IFTYPE_MESH_POINT) |
  8254. #endif
  8255. BIT(NL80211_IFTYPE_AP) },
  8256. diff --git a/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch b/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch
  8257. index 664cf45..36e0151 100644
  8258. --- a/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch
  8259. +++ b/package/mac80211/patches/500-ath9k_eeprom_debugfs.patch
  8260. @@ -1,6 +1,6 @@
  8261. --- a/drivers/net/wireless/ath/ath9k/debug.c
  8262. +++ b/drivers/net/wireless/ath/ath9k/debug.c
  8263. -@@ -1481,6 +1481,53 @@ void ath9k_deinit_debug(struct ath_softc
  8264. +@@ -1485,6 +1485,53 @@ void ath9k_deinit_debug(struct ath_softc
  8265. ath9k_spectral_deinit_debug(sc);
  8266. }
  8267. @@ -54,7 +54,7 @@
  8268. int ath9k_init_debug(struct ath_hw *ah)
  8269. {
  8270. struct ath_common *common = ath9k_hw_common(ah);
  8271. -@@ -1500,6 +1547,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  8272. +@@ -1504,6 +1551,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  8273. ath9k_tx99_init_debug(sc);
  8274. ath9k_spectral_init_debug(sc);
  8275. diff --git a/package/mac80211/patches/501-ath9k-eeprom_endianess.patch b/package/mac80211/patches/501-ath9k-eeprom_endianess.patch
  8276. index 96e7c6d..169eb9a 100644
  8277. --- a/package/mac80211/patches/501-ath9k-eeprom_endianess.patch
  8278. +++ b/package/mac80211/patches/501-ath9k-eeprom_endianess.patch
  8279. @@ -81,7 +81,7 @@
  8280. struct ath_ops reg_ops;
  8281. --- a/drivers/net/wireless/ath/ath9k/init.c
  8282. +++ b/drivers/net/wireless/ath/ath9k/init.c
  8283. -@@ -722,6 +722,8 @@ static int ath9k_init_softc(u16 devid, s
  8284. +@@ -518,6 +518,8 @@ static int ath9k_init_softc(u16 devid, s
  8285. ah->is_clk_25mhz = pdata->is_clk_25mhz;
  8286. ah->get_mac_revision = pdata->get_mac_revision;
  8287. ah->external_reset = pdata->external_reset;
  8288. diff --git a/package/mac80211/patches/502-ath9k_ahb_init.patch b/package/mac80211/patches/502-ath9k_ahb_init.patch
  8289. index 4edc63b..de61a9e 100644
  8290. --- a/package/mac80211/patches/502-ath9k_ahb_init.patch
  8291. +++ b/package/mac80211/patches/502-ath9k_ahb_init.patch
  8292. @@ -1,15 +1,15 @@
  8293. --- a/drivers/net/wireless/ath/ath9k/init.c
  8294. +++ b/drivers/net/wireless/ath/ath9k/init.c
  8295. -@@ -1112,23 +1112,23 @@ static int __init ath9k_init(void)
  8296. - goto err_out;
  8297. - }
  8298. +@@ -897,23 +897,23 @@ static int __init ath9k_init(void)
  8299. + {
  8300. + int error;
  8301. - error = ath_pci_init();
  8302. + error = ath_ahb_init();
  8303. if (error < 0) {
  8304. - pr_err("No PCI devices found, driver not installed\n");
  8305. error = -ENODEV;
  8306. - goto err_rate_unregister;
  8307. + goto err_out;
  8308. }
  8309. - error = ath_ahb_init();
  8310. @@ -27,6 +27,6 @@
  8311. - ath_pci_exit();
  8312. + err_ahb_exit:
  8313. + ath_ahb_exit();
  8314. -
  8315. - err_rate_unregister:
  8316. - ath_rate_control_unregister();
  8317. + err_out:
  8318. + return error;
  8319. + }
  8320. diff --git a/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch b/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch
  8321. index d7478ff..c818933 100644
  8322. --- a/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch
  8323. +++ b/package/mac80211/patches/510-ath9k_intr_mitigation_tweak.patch
  8324. @@ -1,6 +1,6 @@
  8325. --- a/drivers/net/wireless/ath/ath9k/hw.c
  8326. +++ b/drivers/net/wireless/ath/ath9k/hw.c
  8327. -@@ -359,13 +359,8 @@ static void ath9k_hw_init_config(struct
  8328. +@@ -358,13 +358,8 @@ static void ath9k_hw_init_config(struct
  8329. ah->config.rx_intr_mitigation = true;
  8330. diff --git a/package/mac80211/patches/511-ath9k_reduce_rxbuf.patch b/package/mac80211/patches/511-ath9k_reduce_rxbuf.patch
  8331. index ef0b9a1..e457267 100644
  8332. --- a/package/mac80211/patches/511-ath9k_reduce_rxbuf.patch
  8333. +++ b/package/mac80211/patches/511-ath9k_reduce_rxbuf.patch
  8334. @@ -1,6 +1,6 @@
  8335. --- a/drivers/net/wireless/ath/ath9k/ath9k.h
  8336. +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
  8337. -@@ -90,7 +90,7 @@ int ath_descdma_setup(struct ath_softc *
  8338. +@@ -89,7 +89,7 @@ int ath_descdma_setup(struct ath_softc *
  8339. (_l) &= ((_sz) - 1); \
  8340. } while (0)
  8341. diff --git a/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch b/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch
  8342. index 8f3cc03..665d8aa 100644
  8343. --- a/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch
  8344. +++ b/package/mac80211/patches/512-ath9k_channelbw_debugfs.patch
  8345. @@ -1,6 +1,6 @@
  8346. --- a/drivers/net/wireless/ath/ath9k/debug.c
  8347. +++ b/drivers/net/wireless/ath/ath9k/debug.c
  8348. -@@ -1528,6 +1528,52 @@ static const struct file_operations fops
  8349. +@@ -1532,6 +1532,52 @@ static const struct file_operations fops
  8350. .owner = THIS_MODULE
  8351. };
  8352. @@ -35,7 +35,7 @@
  8353. + return -EINVAL;
  8354. +
  8355. + common->chan_bw = chan_bw;
  8356. -+ if (!test_bit(SC_OP_INVALID, &sc->sc_flags))
  8357. ++ if (!test_bit(ATH_OP_INVALID, &common->op_flags))
  8358. + ath9k_ops.config(sc->hw, IEEE80211_CONF_CHANGE_CHANNEL);
  8359. +
  8360. + return count;
  8361. @@ -53,7 +53,7 @@
  8362. int ath9k_init_debug(struct ath_hw *ah)
  8363. {
  8364. struct ath_common *common = ath9k_hw_common(ah);
  8365. -@@ -1549,6 +1595,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  8366. +@@ -1553,6 +1599,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  8367. debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
  8368. &fops_eeprom);
  8369. @@ -64,17 +64,17 @@
  8370. debugfs_create_file("interrupt", S_IRUSR, sc->debug.debugfs_phy, sc,
  8371. --- a/drivers/net/wireless/ath/ath.h
  8372. +++ b/drivers/net/wireless/ath/ath.h
  8373. -@@ -130,6 +130,7 @@ struct ath_common {
  8374. - struct ieee80211_hw *hw;
  8375. +@@ -140,6 +140,7 @@ struct ath_common {
  8376. int debug_mask;
  8377. enum ath_device_state state;
  8378. + unsigned long op_flags;
  8379. + u32 chan_bw;
  8380. struct ath_ani ani;
  8381. --- a/drivers/net/wireless/ath/ath9k/common.c
  8382. +++ b/drivers/net/wireless/ath/ath9k/common.c
  8383. -@@ -52,11 +52,13 @@ EXPORT_SYMBOL(ath9k_cmn_get_hw_crypto_ke
  8384. +@@ -296,11 +296,13 @@ EXPORT_SYMBOL(ath9k_cmn_get_hw_crypto_ke
  8385. /*
  8386. * Update internal channel flags.
  8387. */
  8388. @@ -89,7 +89,7 @@
  8389. ichan->channel = chan->center_freq;
  8390. ichan->chan = chan;
  8391. -@@ -64,7 +66,19 @@ static void ath9k_cmn_update_ichannel(st
  8392. +@@ -308,7 +310,19 @@ static void ath9k_cmn_update_ichannel(st
  8393. if (chan->band == IEEE80211_BAND_5GHZ)
  8394. flags |= CHANNEL_5GHZ;
  8395. @@ -110,7 +110,7 @@
  8396. case NL80211_CHAN_WIDTH_5:
  8397. flags |= CHANNEL_QUARTER;
  8398. break;
  8399. -@@ -97,10 +111,11 @@ struct ath9k_channel *ath9k_cmn_get_chan
  8400. +@@ -341,10 +355,11 @@ struct ath9k_channel *ath9k_cmn_get_chan
  8401. struct cfg80211_chan_def *chandef)
  8402. {
  8403. struct ieee80211_channel *curchan = chandef->chan;
  8404. diff --git a/package/mac80211/patches/513-ath9k_add_pci_ids.patch b/package/mac80211/patches/513-ath9k_add_pci_ids.patch
  8405. index db4e6a1..540198f 100644
  8406. --- a/package/mac80211/patches/513-ath9k_add_pci_ids.patch
  8407. +++ b/package/mac80211/patches/513-ath9k_add_pci_ids.patch
  8408. @@ -1,6 +1,6 @@
  8409. --- a/drivers/net/wireless/ath/ath9k/hw.c
  8410. +++ b/drivers/net/wireless/ath/ath9k/hw.c
  8411. -@@ -614,6 +614,7 @@ int ath9k_hw_init(struct ath_hw *ah)
  8412. +@@ -613,6 +613,7 @@ int ath9k_hw_init(struct ath_hw *ah)
  8413. /* These are all the AR5008/AR9001/AR9002/AR9003 hardware family of chipsets */
  8414. switch (ah->hw_version.devid) {
  8415. diff --git a/package/mac80211/patches/520-mac80211_cur_txpower.patch b/package/mac80211/patches/520-mac80211_cur_txpower.patch
  8416. index 6df95bc..cb3f852 100644
  8417. --- a/package/mac80211/patches/520-mac80211_cur_txpower.patch
  8418. +++ b/package/mac80211/patches/520-mac80211_cur_txpower.patch
  8419. @@ -1,6 +1,6 @@
  8420. --- a/include/net/mac80211.h
  8421. +++ b/include/net/mac80211.h
  8422. -@@ -1711,6 +1711,7 @@ struct ieee80211_hw {
  8423. +@@ -1703,6 +1703,7 @@ struct ieee80211_hw {
  8424. u8 max_tx_aggregation_subframes;
  8425. u8 offchannel_tx_hw_queue;
  8426. u8 radiotap_mcs_details;
  8427. @@ -10,7 +10,7 @@
  8428. u8 uapsd_queues;
  8429. --- a/net/mac80211/cfg.c
  8430. +++ b/net/mac80211/cfg.c
  8431. -@@ -2329,7 +2329,9 @@ static int ieee80211_get_tx_power(struct
  8432. +@@ -2335,7 +2335,9 @@ static int ieee80211_get_tx_power(struct
  8433. struct ieee80211_local *local = wiphy_priv(wiphy);
  8434. struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
  8435. @@ -23,7 +23,7 @@
  8436. *dbm = sdata->vif.bss_conf.txpower;
  8437. --- a/net/mac80211/main.c
  8438. +++ b/net/mac80211/main.c
  8439. -@@ -158,6 +158,7 @@ static u32 ieee80211_hw_conf_chan(struct
  8440. +@@ -160,6 +160,7 @@ static u32 ieee80211_hw_conf_chan(struct
  8441. if (local->hw.conf.power_level != power) {
  8442. changed |= IEEE80211_CONF_CHANGE_POWER;
  8443. diff --git a/package/mac80211/patches/521-ath9k_cur_txpower.patch b/package/mac80211/patches/521-ath9k_cur_txpower.patch
  8444. index 0d6c360..24bc062 100644
  8445. --- a/package/mac80211/patches/521-ath9k_cur_txpower.patch
  8446. +++ b/package/mac80211/patches/521-ath9k_cur_txpower.patch
  8447. @@ -14,7 +14,7 @@
  8448. out:
  8449. spin_unlock_bh(&sc->sc_pcu_lock);
  8450. -@@ -1371,6 +1375,7 @@ static int ath9k_config(struct ieee80211
  8451. +@@ -1370,6 +1374,7 @@ static int ath9k_config(struct ieee80211
  8452. sc->config.txpowlimit = 2 * conf->power_level;
  8453. ath9k_cmn_update_txpow(ah, sc->curtxpow,
  8454. sc->config.txpowlimit, &sc->curtxpow);
  8455. diff --git a/package/mac80211/patches/522-mac80211_configure_antenna_gain.patch b/package/mac80211/patches/522-mac80211_configure_antenna_gain.patch
  8456. index 308ee6e..611f763 100644
  8457. --- a/package/mac80211/patches/522-mac80211_configure_antenna_gain.patch
  8458. +++ b/package/mac80211/patches/522-mac80211_configure_antenna_gain.patch
  8459. @@ -1,6 +1,6 @@
  8460. --- a/include/net/cfg80211.h
  8461. +++ b/include/net/cfg80211.h
  8462. -@@ -2156,6 +2156,7 @@ struct cfg80211_qos_map {
  8463. +@@ -2167,6 +2167,7 @@ struct cfg80211_qos_map {
  8464. * (as advertised by the nl80211 feature flag.)
  8465. * @get_tx_power: store the current TX power into the dbm variable;
  8466. * return 0 if successful
  8467. @@ -8,7 +8,7 @@
  8468. *
  8469. * @set_wds_peer: set the WDS peer for a WDS interface
  8470. *
  8471. -@@ -2380,6 +2381,7 @@ struct cfg80211_ops {
  8472. +@@ -2396,6 +2397,7 @@ struct cfg80211_ops {
  8473. enum nl80211_tx_power_setting type, int mbm);
  8474. int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
  8475. int *dbm);
  8476. @@ -18,7 +18,7 @@
  8477. const u8 *addr);
  8478. --- a/include/net/mac80211.h
  8479. +++ b/include/net/mac80211.h
  8480. -@@ -1033,6 +1033,7 @@ enum ieee80211_smps_mode {
  8481. +@@ -1032,6 +1032,7 @@ enum ieee80211_smps_mode {
  8482. *
  8483. * @power_level: requested transmit power (in dBm), backward compatibility
  8484. * value only that is set to the minimum of all interfaces
  8485. @@ -26,7 +26,7 @@
  8486. *
  8487. * @chandef: the channel definition to tune to
  8488. * @radar_enabled: whether radar detection is enabled
  8489. -@@ -1054,6 +1055,7 @@ struct ieee80211_conf {
  8490. +@@ -1053,6 +1054,7 @@ struct ieee80211_conf {
  8491. u32 flags;
  8492. int power_level, dynamic_ps_timeout;
  8493. int max_sleep_period;
  8494. @@ -36,9 +36,9 @@
  8495. u8 ps_dtim_period;
  8496. --- a/include/uapi/linux/nl80211.h
  8497. +++ b/include/uapi/linux/nl80211.h
  8498. -@@ -1555,6 +1555,9 @@ enum nl80211_commands {
  8499. - * data is in the format defined for the payload of the QoS Map Set element
  8500. - * in IEEE Std 802.11-2012, 8.4.2.97.
  8501. +@@ -1579,6 +1579,9 @@ enum nl80211_commands {
  8502. + * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
  8503. + * As specified in the &enum nl80211_tdls_peer_capability.
  8504. *
  8505. + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
  8506. + * transmit power to stay within regulatory limits. u32, dBi.
  8507. @@ -46,9 +46,9 @@
  8508. * @NL80211_ATTR_MAX: highest attribute number currently defined
  8509. * @__NL80211_ATTR_AFTER_LAST: internal use
  8510. */
  8511. -@@ -1883,6 +1886,8 @@ enum nl80211_attrs {
  8512. +@@ -1914,6 +1917,8 @@ enum nl80211_attrs {
  8513. - NL80211_ATTR_QOS_MAP,
  8514. + NL80211_ATTR_TDLS_PEER_CAPABILITY,
  8515. + NL80211_ATTR_WIPHY_ANTENNA_GAIN,
  8516. +
  8517. @@ -57,7 +57,7 @@
  8518. __NL80211_ATTR_AFTER_LAST,
  8519. --- a/net/mac80211/cfg.c
  8520. +++ b/net/mac80211/cfg.c
  8521. -@@ -2339,6 +2339,19 @@ static int ieee80211_get_tx_power(struct
  8522. +@@ -2345,6 +2345,19 @@ static int ieee80211_get_tx_power(struct
  8523. return 0;
  8524. }
  8525. @@ -77,7 +77,7 @@
  8526. static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev,
  8527. const u8 *addr)
  8528. {
  8529. -@@ -3924,6 +3937,7 @@ struct cfg80211_ops mac80211_config_ops
  8530. +@@ -4000,6 +4013,7 @@ const struct cfg80211_ops mac80211_confi
  8531. .set_wiphy_params = ieee80211_set_wiphy_params,
  8532. .set_tx_power = ieee80211_set_tx_power,
  8533. .get_tx_power = ieee80211_get_tx_power,
  8534. @@ -87,7 +87,7 @@
  8535. CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd)
  8536. --- a/net/mac80211/ieee80211_i.h
  8537. +++ b/net/mac80211/ieee80211_i.h
  8538. -@@ -1221,6 +1221,7 @@ struct ieee80211_local {
  8539. +@@ -1225,6 +1225,7 @@ struct ieee80211_local {
  8540. int dynamic_ps_forced_timeout;
  8541. int user_power_level; /* in dBm, for all interfaces */
  8542. @@ -102,34 +102,24 @@
  8543. struct cfg80211_chan_def chandef = {};
  8544. u32 changed = 0;
  8545. - int power;
  8546. -+ int power, ant_gain, max_power;
  8547. ++ int power, max_power;
  8548. u32 offchannel_flag;
  8549. offchannel_flag = local->hw.conf.flags & IEEE80211_CONF_OFFCHANNEL;
  8550. -@@ -156,8 +156,21 @@ static u32 ieee80211_hw_conf_chan(struct
  8551. +@@ -158,6 +158,12 @@ static u32 ieee80211_hw_conf_chan(struct
  8552. }
  8553. rcu_read_unlock();
  8554. -- if (local->hw.conf.power_level != power) {
  8555. + max_power = chandef.chan->max_reg_power;
  8556. -+ ant_gain = chandef.chan->max_antenna_gain;
  8557. + if (local->user_antenna_gain > 0) {
  8558. -+ if (local->user_antenna_gain > ant_gain) {
  8559. -+ max_power -= local->user_antenna_gain - ant_gain;
  8560. -+ ant_gain = 0;
  8561. -+ } else
  8562. -+ ant_gain -= local->user_antenna_gain;
  8563. ++ max_power -= local->user_antenna_gain;
  8564. + power = min(power, max_power);
  8565. + }
  8566. +
  8567. -+ if (local->hw.conf.power_level != power ||
  8568. -+ local->hw.conf.max_antenna_gain != ant_gain) {
  8569. + if (local->hw.conf.power_level != power) {
  8570. changed |= IEEE80211_CONF_CHANGE_POWER;
  8571. -+ local->hw.conf.max_antenna_gain = ant_gain;
  8572. local->hw.cur_power_level = power;
  8573. - local->hw.conf.power_level = power;
  8574. - }
  8575. -@@ -584,6 +597,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(
  8576. +@@ -586,6 +592,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(
  8577. IEEE80211_RADIOTAP_MCS_HAVE_BW;
  8578. local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI |
  8579. IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH;
  8580. @@ -139,32 +129,30 @@
  8581. local->user_power_level = IEEE80211_UNSET_POWER_LEVEL;
  8582. --- a/net/wireless/nl80211.c
  8583. +++ b/net/wireless/nl80211.c
  8584. -@@ -384,6 +384,7 @@ static const struct nla_policy nl80211_p
  8585. - [NL80211_ATTR_VENDOR_DATA] = { .type = NLA_BINARY },
  8586. - [NL80211_ATTR_QOS_MAP] = { .type = NLA_BINARY,
  8587. - .len = IEEE80211_QOS_MAP_LEN_MAX },
  8588. +@@ -385,6 +385,7 @@ static const struct nla_policy nl80211_p
  8589. + [NL80211_ATTR_MAC_HINT] = { .len = ETH_ALEN },
  8590. + [NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 },
  8591. + [NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 },
  8592. + [NL80211_ATTR_WIPHY_ANTENNA_GAIN] = { .type = NLA_U32 },
  8593. };
  8594. /* policy for the key attributes */
  8595. -@@ -2105,6 +2106,22 @@ static int nl80211_set_wiphy(struct sk_b
  8596. - goto bad_res;
  8597. +@@ -2116,6 +2117,20 @@ static int nl80211_set_wiphy(struct sk_b
  8598. + return result;
  8599. }
  8600. + if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_GAIN]) {
  8601. + int idx, dbi = 0;
  8602. +
  8603. -+ if (!rdev->ops->set_antenna_gain) {
  8604. -+ result = -EOPNOTSUPP;
  8605. -+ goto bad_res;
  8606. -+ }
  8607. ++ if (!rdev->ops->set_antenna_gain)
  8608. ++ return -EOPNOTSUPP;
  8609. +
  8610. + idx = NL80211_ATTR_WIPHY_ANTENNA_GAIN;
  8611. + dbi = nla_get_u32(info->attrs[idx]);
  8612. +
  8613. + result = rdev->ops->set_antenna_gain(&rdev->wiphy, dbi);
  8614. + if (result)
  8615. -+ goto bad_res;
  8616. ++ return result;
  8617. + }
  8618. +
  8619. if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX] &&
  8620. diff --git a/package/mac80211/patches/523-ath9k_use_configured_antenna_gain.patch b/package/mac80211/patches/523-ath9k_use_configured_antenna_gain.patch
  8621. index 30aa9ee..b84a991 100644
  8622. --- a/package/mac80211/patches/523-ath9k_use_configured_antenna_gain.patch
  8623. +++ b/package/mac80211/patches/523-ath9k_use_configured_antenna_gain.patch
  8624. @@ -1,6 +1,6 @@
  8625. --- a/drivers/net/wireless/ath/ath.h
  8626. +++ b/drivers/net/wireless/ath/ath.h
  8627. -@@ -74,6 +74,7 @@ struct ath_regulatory {
  8628. +@@ -83,6 +83,7 @@ struct ath_regulatory {
  8629. u16 max_power_level;
  8630. u16 current_rd;
  8631. int16_t power_limit;
  8632. @@ -10,7 +10,7 @@
  8633. --- a/drivers/net/wireless/ath/ath9k/hw.c
  8634. +++ b/drivers/net/wireless/ath/ath9k/hw.c
  8635. -@@ -2721,7 +2721,7 @@ void ath9k_hw_apply_txpower(struct ath_h
  8636. +@@ -2720,7 +2720,7 @@ void ath9k_hw_apply_txpower(struct ath_h
  8637. channel = chan->chan;
  8638. chan_pwr = min_t(int, channel->max_power * 2, MAX_RATE_POWER);
  8639. new_pwr = min_t(int, chan_pwr, reg->power_limit);
  8640. @@ -21,7 +21,7 @@
  8641. if (ant_gain > max_gain)
  8642. --- a/drivers/net/wireless/ath/ath9k/main.c
  8643. +++ b/drivers/net/wireless/ath/ath9k/main.c
  8644. -@@ -1371,7 +1371,10 @@ static int ath9k_config(struct ieee80211
  8645. +@@ -1370,7 +1370,10 @@ static int ath9k_config(struct ieee80211
  8646. }
  8647. if (changed & IEEE80211_CONF_CHANGE_POWER) {
  8648. diff --git a/package/mac80211/patches/530-ath9k_extra_leds.patch b/package/mac80211/patches/530-ath9k_extra_leds.patch
  8649. index 59f78d9..c78a3e5 100644
  8650. --- a/package/mac80211/patches/530-ath9k_extra_leds.patch
  8651. +++ b/package/mac80211/patches/530-ath9k_extra_leds.patch
  8652. @@ -1,6 +1,6 @@
  8653. --- a/drivers/net/wireless/ath/ath9k/ath9k.h
  8654. +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
  8655. -@@ -563,6 +563,9 @@ static inline int ath9k_dump_btcoex(stru
  8656. +@@ -554,6 +554,9 @@ static inline int ath9k_dump_btcoex(stru
  8657. void ath_init_leds(struct ath_softc *sc);
  8658. void ath_deinit_leds(struct ath_softc *sc);
  8659. void ath_fill_led_pin(struct ath_softc *sc);
  8660. @@ -10,7 +10,7 @@
  8661. #else
  8662. static inline void ath_init_leds(struct ath_softc *sc)
  8663. {
  8664. -@@ -710,6 +713,13 @@ enum sc_op_flags {
  8665. +@@ -692,6 +695,13 @@ void ath_ant_comb_scan(struct ath_softc
  8666. #define PS_BEACON_SYNC BIT(4)
  8667. #define PS_WAIT_FOR_ANI BIT(5)
  8668. @@ -24,8 +24,8 @@
  8669. struct ath_softc {
  8670. struct ieee80211_hw *hw;
  8671. struct device *dev;
  8672. -@@ -751,9 +761,8 @@ struct ath_softc {
  8673. - struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
  8674. +@@ -731,9 +741,8 @@ struct ath_softc {
  8675. + struct ath_beacon beacon;
  8676. #ifdef CPTCFG_MAC80211_LEDS
  8677. - bool led_registered;
  8678. @@ -162,7 +162,7 @@
  8679. void ath_fill_led_pin(struct ath_softc *sc)
  8680. --- a/drivers/net/wireless/ath/ath9k/init.c
  8681. +++ b/drivers/net/wireless/ath/ath9k/init.c
  8682. -@@ -1018,7 +1018,7 @@ int ath9k_init_device(u16 devid, struct
  8683. +@@ -811,7 +811,7 @@ int ath9k_init_device(u16 devid, struct
  8684. #ifdef CPTCFG_MAC80211_LEDS
  8685. /* must be initialized before ieee80211_register_hw */
  8686. @@ -173,7 +173,7 @@
  8687. #endif
  8688. --- a/drivers/net/wireless/ath/ath9k/debug.c
  8689. +++ b/drivers/net/wireless/ath/ath9k/debug.c
  8690. -@@ -1573,6 +1573,61 @@ static const struct file_operations fops
  8691. +@@ -1577,6 +1577,61 @@ static const struct file_operations fops
  8692. .llseek = default_llseek,
  8693. };
  8694. @@ -235,7 +235,7 @@
  8695. int ath9k_init_debug(struct ath_hw *ah)
  8696. {
  8697. -@@ -1597,6 +1652,10 @@ int ath9k_init_debug(struct ath_hw *ah)
  8698. +@@ -1601,6 +1656,10 @@ int ath9k_init_debug(struct ath_hw *ah)
  8699. &fops_eeprom);
  8700. debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
  8701. sc, &fops_chanbw);
  8702. diff --git a/package/mac80211/patches/542-ath9k_debugfs_diag.patch b/package/mac80211/patches/542-ath9k_debugfs_diag.patch
  8703. index e1b6ff1..44aa905 100644
  8704. --- a/package/mac80211/patches/542-ath9k_debugfs_diag.patch
  8705. +++ b/package/mac80211/patches/542-ath9k_debugfs_diag.patch
  8706. @@ -1,6 +1,6 @@
  8707. --- a/drivers/net/wireless/ath/ath9k/debug.c
  8708. +++ b/drivers/net/wireless/ath/ath9k/debug.c
  8709. -@@ -1629,6 +1629,50 @@ static const struct file_operations fops
  8710. +@@ -1633,6 +1633,50 @@ static const struct file_operations fops
  8711. #endif
  8712. @@ -51,7 +51,7 @@
  8713. int ath9k_init_debug(struct ath_hw *ah)
  8714. {
  8715. struct ath_common *common = ath9k_hw_common(ah);
  8716. -@@ -1656,6 +1700,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  8717. +@@ -1660,6 +1704,8 @@ int ath9k_init_debug(struct ath_hw *ah)
  8718. debugfs_create_file("gpio_led", S_IWUSR,
  8719. sc->debug.debugfs_phy, sc, &fops_gpio_led);
  8720. #endif
  8721. @@ -94,7 +94,7 @@
  8722. struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah,
  8723. --- a/drivers/net/wireless/ath/ath9k/hw.c
  8724. +++ b/drivers/net/wireless/ath/ath9k/hw.c
  8725. -@@ -1735,6 +1735,20 @@ fail:
  8726. +@@ -1734,6 +1734,20 @@ fail:
  8727. return -EINVAL;
  8728. }
  8729. @@ -115,7 +115,7 @@
  8730. int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
  8731. struct ath9k_hw_cal_data *caldata, bool fastcc)
  8732. {
  8733. -@@ -1940,6 +1954,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
  8734. +@@ -1939,6 +1953,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
  8735. ar9003_hw_disable_phy_restart(ah);
  8736. ath9k_hw_apply_gpio_override(ah);
  8737. @@ -125,7 +125,7 @@
  8738. REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, AR_BTCOEX_WL_LNADIV_FORCE_ON);
  8739. --- a/drivers/net/wireless/ath/ath9k/main.c
  8740. +++ b/drivers/net/wireless/ath/ath9k/main.c
  8741. -@@ -602,6 +602,11 @@ irqreturn_t ath_isr(int irq, void *dev)
  8742. +@@ -603,6 +603,11 @@ irqreturn_t ath_isr(int irq, void *dev)
  8743. ath9k_debug_sync_cause(sc, sync_cause);
  8744. status &= ah->imask; /* discard unasked-for bits */
  8745. diff --git a/package/mac80211/patches/543-ath9k-allow-to-disable-bands-via-platform-data.patch b/package/mac80211/patches/543-ath9k-allow-to-disable-bands-via-platform-data.patch
  8746. index d26a5af..e2e18c9 100644
  8747. --- a/package/mac80211/patches/543-ath9k-allow-to-disable-bands-via-platform-data.patch
  8748. +++ b/package/mac80211/patches/543-ath9k-allow-to-disable-bands-via-platform-data.patch
  8749. @@ -11,7 +11,7 @@
  8750. int (*external_reset)(void);
  8751. --- a/drivers/net/wireless/ath/ath9k/hw.c
  8752. +++ b/drivers/net/wireless/ath/ath9k/hw.c
  8753. -@@ -2328,17 +2328,25 @@ int ath9k_hw_fill_cap_info(struct ath_hw
  8754. +@@ -2327,17 +2327,25 @@ int ath9k_hw_fill_cap_info(struct ath_hw
  8755. }
  8756. eeval = ah->eep_ops->get_eeprom(ah, EEP_OP_MODE);
  8757. @@ -58,7 +58,7 @@
  8758. };
  8759. --- a/drivers/net/wireless/ath/ath9k/init.c
  8760. +++ b/drivers/net/wireless/ath/ath9k/init.c
  8761. -@@ -722,6 +722,8 @@ static int ath9k_init_softc(u16 devid, s
  8762. +@@ -518,6 +518,8 @@ static int ath9k_init_softc(u16 devid, s
  8763. ah->is_clk_25mhz = pdata->is_clk_25mhz;
  8764. ah->get_mac_revision = pdata->get_mac_revision;
  8765. ah->external_reset = pdata->external_reset;
  8766. diff --git a/package/mac80211/patches/550-ath9k_entropy_from_adc.patch b/package/mac80211/patches/550-ath9k_entropy_from_adc.patch
  8767. index b59c362..439a574 100644
  8768. --- a/package/mac80211/patches/550-ath9k_entropy_from_adc.patch
  8769. +++ b/package/mac80211/patches/550-ath9k_entropy_from_adc.patch
  8770. @@ -55,7 +55,7 @@
  8771. ops->spectral_scan_config = ar9003_hw_spectral_scan_config;
  8772. --- a/drivers/net/wireless/ath/ath9k/init.c
  8773. +++ b/drivers/net/wireless/ath/ath9k/init.c
  8774. -@@ -846,7 +846,8 @@ static void ath9k_init_txpower_limits(st
  8775. +@@ -643,7 +643,8 @@ static void ath9k_init_txpower_limits(st
  8776. if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ)
  8777. ath9k_init_band_txpower(sc, IEEE80211_BAND_5GHZ);
  8778. @@ -64,8 +64,8 @@
  8779. + ah->curchan = curchan;
  8780. }
  8781. - void ath9k_reload_chainmask_settings(struct ath_softc *sc)
  8782. -@@ -980,6 +981,18 @@ static void ath9k_set_hw_capab(struct at
  8783. + static const struct ieee80211_iface_limit if_limits[] = {
  8784. +@@ -770,6 +771,18 @@ static void ath9k_set_hw_capab(struct at
  8785. SET_IEEE80211_PERM_ADDR(hw, common->macaddr);
  8786. }
  8787. @@ -84,7 +84,7 @@
  8788. int ath9k_init_device(u16 devid, struct ath_softc *sc,
  8789. const struct ath_bus_ops *bus_ops)
  8790. {
  8791. -@@ -1025,6 +1038,8 @@ int ath9k_init_device(u16 devid, struct
  8792. +@@ -818,6 +831,8 @@ int ath9k_init_device(u16 devid, struct
  8793. ARRAY_SIZE(ath9k_tpt_blink));
  8794. #endif
  8795. @@ -110,7 +110,7 @@
  8796. static inline void ath9k_hw_set_bt_ant_diversity(struct ath_hw *ah, bool enable)
  8797. --- a/drivers/net/wireless/ath/ath9k/link.c
  8798. +++ b/drivers/net/wireless/ath/ath9k/link.c
  8799. -@@ -307,6 +307,11 @@ void ath_ani_calibrate(unsigned long dat
  8800. +@@ -308,6 +308,11 @@ void ath_ani_calibrate(unsigned long dat
  8801. unsigned int timestamp = jiffies_to_msecs(jiffies);
  8802. u32 cal_interval, short_cal_interval, long_cal_interval;
  8803. unsigned long flags;
  8804. diff --git a/package/mac80211/patches/551-ath9k_p2p_ifcomb.patch b/package/mac80211/patches/551-ath9k_p2p_ifcomb.patch
  8805. index ffffe0c..579a633 100644
  8806. --- a/package/mac80211/patches/551-ath9k_p2p_ifcomb.patch
  8807. +++ b/package/mac80211/patches/551-ath9k_p2p_ifcomb.patch
  8808. @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8809. --- a/drivers/net/wireless/ath/ath9k/init.c
  8810. +++ b/drivers/net/wireless/ath/ath9k/init.c
  8811. -@@ -863,15 +863,15 @@ void ath9k_reload_chainmask_settings(str
  8812. +@@ -649,15 +649,15 @@ static void ath9k_init_txpower_limits(st
  8813. static const struct ieee80211_iface_limit if_limits[] = {
  8814. { .max = 2048, .types = BIT(NL80211_IFTYPE_STATION) |
  8815. diff --git a/package/mac80211/patches/552-ath9k_p2p_ps_support.patch b/package/mac80211/patches/552-ath9k_p2p_ps_support.patch
  8816. index 4a61db3..8cf9e61 100644
  8817. --- a/package/mac80211/patches/552-ath9k_p2p_ps_support.patch
  8818. +++ b/package/mac80211/patches/552-ath9k_p2p_ps_support.patch
  8819. @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8820. return true;
  8821. }
  8822. -@@ -1126,6 +1128,8 @@ static int ath9k_add_interface(struct ie
  8823. +@@ -1128,6 +1130,8 @@ static int ath9k_add_interface(struct ie
  8824. if (ath9k_uses_beacons(vif->type))
  8825. ath9k_beacon_assign_slot(sc, vif);
  8826. @@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8827. an->sc = sc;
  8828. an->sta = NULL;
  8829. an->vif = vif;
  8830. -@@ -1170,6 +1174,29 @@ static int ath9k_change_interface(struct
  8831. +@@ -1172,6 +1176,29 @@ static int ath9k_change_interface(struct
  8832. return 0;
  8833. }
  8834. @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8835. static void ath9k_remove_interface(struct ieee80211_hw *hw,
  8836. struct ieee80211_vif *vif)
  8837. {
  8838. -@@ -1181,6 +1208,13 @@ static void ath9k_remove_interface(struc
  8839. +@@ -1183,6 +1210,13 @@ static void ath9k_remove_interface(struc
  8840. mutex_lock(&sc->mutex);
  8841. @@ -80,7 +80,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8842. sc->nvifs--;
  8843. sc->tx99_vif = NULL;
  8844. -@@ -1649,6 +1683,70 @@ static void ath9k_bss_assoc_iter(void *d
  8845. +@@ -1649,6 +1683,72 @@ static void ath9k_bss_assoc_iter(void *d
  8846. ath9k_set_assoc_state(sc, vif);
  8847. }
  8848. @@ -130,6 +130,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8849. +void ath9k_update_p2p_ps(struct ath_softc *sc, struct ieee80211_vif *vif)
  8850. +{
  8851. + struct ath_vif *avp = (void *)vif->drv_priv;
  8852. ++ unsigned long flags;
  8853. + u32 tsf;
  8854. +
  8855. + if (!sc->p2p_ps_timer)
  8856. @@ -140,18 +141,19 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8857. +
  8858. + sc->p2p_ps_vif = avp;
  8859. +
  8860. -+ if (sc->ps_flags & PS_BEACON_SYNC)
  8861. -+ return;
  8862. -+
  8863. -+ tsf = ath9k_hw_gettsf32(sc->sc_ah);
  8864. -+ ieee80211_parse_p2p_noa(&vif->bss_conf.p2p_noa_attr, &avp->noa, tsf);
  8865. -+ ath9k_update_p2p_ps_timer(sc, avp);
  8866. ++ spin_lock_irqsave(&sc->sc_pm_lock, flags);
  8867. ++ if (!(sc->ps_flags & PS_BEACON_SYNC)) {
  8868. ++ tsf = ath9k_hw_gettsf32(sc->sc_ah);
  8869. ++ ieee80211_parse_p2p_noa(&vif->bss_conf.p2p_noa_attr, &avp->noa, tsf);
  8870. ++ ath9k_update_p2p_ps_timer(sc, avp);
  8871. ++ }
  8872. ++ spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
  8873. +}
  8874. +
  8875. static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
  8876. struct ieee80211_vif *vif,
  8877. struct ieee80211_bss_conf *bss_conf,
  8878. -@@ -1723,6 +1821,12 @@ static void ath9k_bss_info_changed(struc
  8879. +@@ -1723,6 +1823,12 @@ static void ath9k_bss_info_changed(struc
  8880. }
  8881. }
  8882. @@ -166,7 +168,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8883. --- a/drivers/net/wireless/ath/ath9k/ath9k.h
  8884. +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
  8885. -@@ -115,6 +115,9 @@ int ath_descdma_setup(struct ath_softc *
  8886. +@@ -114,6 +114,9 @@ int ath_descdma_setup(struct ath_softc *
  8887. #define ATH_TXFIFO_DEPTH 8
  8888. #define ATH_TX_ERROR 0x01
  8889. @@ -176,7 +178,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8890. #define IEEE80211_SEQ_SEQ_SHIFT 4
  8891. #define IEEE80211_SEQ_MAX 4096
  8892. #define IEEE80211_WEP_IVLEN 3
  8893. -@@ -363,11 +366,15 @@ void ath9k_release_buffered_frames(struc
  8894. +@@ -366,11 +369,15 @@ void ath9k_release_buffered_frames(struc
  8895. /********/
  8896. struct ath_vif {
  8897. @@ -192,7 +194,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8898. };
  8899. struct ath9k_vif_iter_data {
  8900. -@@ -472,6 +479,8 @@ int ath_update_survey_stats(struct ath_s
  8901. +@@ -463,6 +470,8 @@ int ath_update_survey_stats(struct ath_s
  8902. void ath_update_survey_nf(struct ath_softc *sc, int channel);
  8903. void ath9k_queue_reset(struct ath_softc *sc, enum ath_reset_type type);
  8904. void ath_ps_full_sleep(unsigned long data);
  8905. @@ -201,19 +203,19 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8906. /**********/
  8907. /* BTCOEX */
  8908. -@@ -741,6 +750,9 @@ struct ath_softc {
  8909. +@@ -723,6 +732,9 @@ struct ath_softc {
  8910. struct completion paprd_complete;
  8911. wait_queue_head_t tx_wait;
  8912. + struct ath_gen_timer *p2p_ps_timer;
  8913. + struct ath_vif *p2p_ps_vif;
  8914. +
  8915. - unsigned long sc_flags;
  8916. unsigned long driver_data;
  8917. + u8 gtt_cnt;
  8918. --- a/drivers/net/wireless/ath/ath9k/init.c
  8919. +++ b/drivers/net/wireless/ath/ath9k/init.c
  8920. -@@ -797,6 +797,9 @@ static int ath9k_init_softc(u16 devid, s
  8921. +@@ -593,6 +593,9 @@ static int ath9k_init_softc(u16 devid, s
  8922. if (ret)
  8923. goto err_btcoex;
  8924. @@ -223,7 +225,7 @@ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8925. ath9k_cmn_init_crypto(sc->sc_ah);
  8926. ath9k_init_misc(sc);
  8927. ath_fill_led_pin(sc);
  8928. -@@ -1082,6 +1085,9 @@ static void ath9k_deinit_softc(struct at
  8929. +@@ -875,6 +878,9 @@ static void ath9k_deinit_softc(struct at
  8930. {
  8931. int i = 0;
  8932. diff --git a/package/mac80211/patches/566-ath9k-ar933x-usb-hang-workaround.patch b/package/mac80211/patches/566-ath9k-ar933x-usb-hang-workaround.patch
  8933. index af94c9e..eddbc6c 100644
  8934. --- a/package/mac80211/patches/566-ath9k-ar933x-usb-hang-workaround.patch
  8935. +++ b/package/mac80211/patches/566-ath9k-ar933x-usb-hang-workaround.patch
  8936. @@ -1,6 +1,6 @@
  8937. --- a/drivers/net/wireless/ath/ath9k/hw.c
  8938. +++ b/drivers/net/wireless/ath/ath9k/hw.c
  8939. -@@ -217,6 +217,19 @@ void ath9k_hw_get_channel_centers(struct
  8940. +@@ -216,6 +216,19 @@ void ath9k_hw_get_channel_centers(struct
  8941. centers->synth_center + (extoff * HT40_CHANNEL_CENTER_SHIFT);
  8942. }
  8943. @@ -20,7 +20,7 @@
  8944. /******************/
  8945. /* Chip Revisions */
  8946. /******************/
  8947. -@@ -1337,6 +1350,9 @@ static bool ath9k_hw_set_reset(struct at
  8948. +@@ -1336,6 +1349,9 @@ static bool ath9k_hw_set_reset(struct at
  8949. if (AR_SREV_9100(ah))
  8950. udelay(50);
  8951. @@ -30,7 +30,7 @@
  8952. return true;
  8953. }
  8954. -@@ -1436,6 +1452,9 @@ static bool ath9k_hw_chip_reset(struct a
  8955. +@@ -1435,6 +1451,9 @@ static bool ath9k_hw_chip_reset(struct a
  8956. ar9003_hw_internal_regulator_apply(ah);
  8957. ath9k_hw_init_pll(ah, chan);
  8958. @@ -40,7 +40,7 @@
  8959. return true;
  8960. }
  8961. -@@ -1730,8 +1749,14 @@ static int ath9k_hw_do_fastcc(struct ath
  8962. +@@ -1729,8 +1748,14 @@ static int ath9k_hw_do_fastcc(struct ath
  8963. if (AR_SREV_9271(ah))
  8964. ar9002_hw_load_ani_reg(ah, chan);
  8965. @@ -55,7 +55,7 @@
  8966. return -EINVAL;
  8967. }
  8968. -@@ -1959,6 +1984,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st
  8969. +@@ -1958,6 +1983,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st
  8970. if (AR_SREV_9565(ah) && common->bt_ant_diversity)
  8971. REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, AR_BTCOEX_WL_LNADIV_FORCE_ON);
  8972. diff --git a/package/mac80211/patches/567-ath9k_ar953x_read_mac_rev.patch b/package/mac80211/patches/567-ath9k_ar953x_read_mac_rev.patch
  8973. new file mode 100644
  8974. index 0000000..31778a4
  8975. --- /dev/null
  8976. +++ b/package/mac80211/patches/567-ath9k_ar953x_read_mac_rev.patch
  8977. @@ -0,0 +1,11 @@
  8978. +--- a/drivers/net/wireless/ath/ath9k/hw.c
  8979. ++++ b/drivers/net/wireless/ath/ath9k/hw.c
  8980. +@@ -260,6 +260,8 @@ static void ath9k_hw_read_revisions(stru
  8981. + return;
  8982. + case AR9300_DEVID_AR953X:
  8983. + ah->hw_version.macVersion = AR_SREV_VERSION_9531;
  8984. ++ if (ah->get_mac_revision)
  8985. ++ ah->hw_version.macRev = ah->get_mac_revision();
  8986. + return;
  8987. + }
  8988. +
  8989. diff --git a/package/mac80211/patches/570-restrict_dfs_regions.patch b/package/mac80211/patches/570-restrict_dfs_regions.patch
  8990. new file mode 100644
  8991. index 0000000..10157dc
  8992. --- /dev/null
  8993. +++ b/package/mac80211/patches/570-restrict_dfs_regions.patch
  8994. @@ -0,0 +1,82 @@
  8995. +--- a/drivers/net/wireless/ath/ath10k/mac.c
  8996. ++++ b/drivers/net/wireless/ath/ath10k/mac.c
  8997. +@@ -4321,6 +4321,7 @@ static const struct ieee80211_iface_comb
  8998. + BIT(NL80211_CHAN_WIDTH_20) |
  8999. + BIT(NL80211_CHAN_WIDTH_40) |
  9000. + BIT(NL80211_CHAN_WIDTH_80),
  9001. ++ .radar_detect_regions = BIT(NL80211_DFS_ETSI),
  9002. + #endif
  9003. + },
  9004. + };
  9005. +--- a/drivers/net/wireless/ath/ath9k/init.c
  9006. ++++ b/drivers/net/wireless/ath/ath9k/init.c
  9007. +@@ -688,6 +688,7 @@ static const struct ieee80211_iface_comb
  9008. + .beacon_int_infra_match = true,
  9009. + .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
  9010. + BIT(NL80211_CHAN_WIDTH_20),
  9011. ++ .radar_detect_regions = BIT(NL80211_DFS_ETSI),
  9012. + }
  9013. + #endif
  9014. + };
  9015. +--- a/include/net/cfg80211.h
  9016. ++++ b/include/net/cfg80211.h
  9017. +@@ -2620,6 +2620,7 @@ struct ieee80211_iface_limit {
  9018. + * between infrastructure and AP types must match. This is required
  9019. + * only in special cases.
  9020. + * @radar_detect_widths: bitmap of channel widths supported for radar detection
  9021. ++ * @radar_detect_regions: bitmap of regions supported for radar detection
  9022. + *
  9023. + * With this structure the driver can describe which interface
  9024. + * combinations it supports concurrently.
  9025. +@@ -2677,6 +2678,7 @@ struct ieee80211_iface_combination {
  9026. + u8 n_limits;
  9027. + bool beacon_int_infra_match;
  9028. + u8 radar_detect_widths;
  9029. ++ u8 radar_detect_regions;
  9030. + };
  9031. +
  9032. + struct ieee80211_txrx_stypes {
  9033. +--- a/net/wireless/util.c
  9034. ++++ b/net/wireless/util.c
  9035. +@@ -1259,6 +1259,7 @@ int cfg80211_can_use_iftype_chan(struct
  9036. + enum cfg80211_chan_mode chanmode,
  9037. + u8 radar_detect)
  9038. + {
  9039. ++ const struct ieee80211_regdomain *regdom;
  9040. + struct wireless_dev *wdev_iter;
  9041. + u32 used_iftypes = BIT(iftype);
  9042. + int num[NUM_NL80211_IFTYPES];
  9043. +@@ -1267,6 +1268,7 @@ int cfg80211_can_use_iftype_chan(struct
  9044. + struct ieee80211_channel *ch;
  9045. + enum cfg80211_chan_mode chmode;
  9046. + int num_different_channels = 0;
  9047. ++ enum nl80211_dfs_regions region = 0;
  9048. + int total = 1;
  9049. + int i, j;
  9050. +
  9051. +@@ -1285,6 +1287,14 @@ int cfg80211_can_use_iftype_chan(struct
  9052. + return 0;
  9053. + }
  9054. +
  9055. ++ if (radar_detect) {
  9056. ++ rcu_read_lock();
  9057. ++ regdom = rcu_dereference(cfg80211_regdomain);
  9058. ++ if (regdom)
  9059. ++ region = regdom->dfs_region;
  9060. ++ rcu_read_unlock();
  9061. ++ }
  9062. ++
  9063. + memset(num, 0, sizeof(num));
  9064. + memset(used_channels, 0, sizeof(used_channels));
  9065. +
  9066. +@@ -1392,6 +1402,10 @@ int cfg80211_can_use_iftype_chan(struct
  9067. + if (radar_detect && !(c->radar_detect_widths & radar_detect))
  9068. + goto cont;
  9069. +
  9070. ++ if (radar_detect && c->radar_detect_regions &&
  9071. ++ !(c->radar_detect_regions & BIT(region)))
  9072. ++ goto cont;
  9073. ++
  9074. + /*
  9075. + * Finally check that all iftypes that we're currently
  9076. + * using are actually part of this combination. If they
  9077. diff --git a/package/mac80211/patches/600-0001-rt2x00-rt2800lib-move-rt2800_drv_data-declaration-in.patch b/package/mac80211/patches/600-0001-rt2x00-rt2800lib-move-rt2800_drv_data-declaration-in.patch
  9078. new file mode 100644
  9079. index 0000000..d344957
  9080. --- /dev/null
  9081. +++ b/package/mac80211/patches/600-0001-rt2x00-rt2800lib-move-rt2800_drv_data-declaration-in.patch
  9082. @@ -0,0 +1,62 @@
  9083. +From 7a69da907de668fb22a30ae218062d6f081864ea Mon Sep 17 00:00:00 2001
  9084. +From: Gabor Juhos <juhosg@openwrt.org>
  9085. +Date: Sat, 17 Aug 2013 19:31:41 +0200
  9086. +Subject: [PATCH] rt2x00: rt2800lib: move rt2800_drv_data declaration into
  9087. + rt2800lib.h
  9088. +
  9089. +The rt2800_drv_data structure contains driver specific
  9090. +information. Move the declaration into the rt2800lib.h
  9091. +header which is a more logical place for it. Also fix
  9092. +the comment style to avoid checkpatch warning.
  9093. +
  9094. +The patch contains no functional changes, it is in
  9095. +preparation for the next patch.
  9096. +
  9097. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  9098. +---
  9099. +Changes since v1: ---
  9100. +---
  9101. + drivers/net/wireless/rt2x00/rt2800.h | 13 -------------
  9102. + drivers/net/wireless/rt2x00/rt2800lib.h | 11 +++++++++++
  9103. + 2 files changed, 11 insertions(+), 13 deletions(-)
  9104. +
  9105. +--- a/drivers/net/wireless/rt2x00/rt2800.h
  9106. ++++ b/drivers/net/wireless/rt2x00/rt2800.h
  9107. +@@ -2958,17 +2958,4 @@ enum rt2800_eeprom_word {
  9108. + */
  9109. + #define BCN_TBTT_OFFSET 64
  9110. +
  9111. +-/*
  9112. +- * RT2800 driver data structure
  9113. +- */
  9114. +-struct rt2800_drv_data {
  9115. +- u8 calibration_bw20;
  9116. +- u8 calibration_bw40;
  9117. +- u8 bbp25;
  9118. +- u8 bbp26;
  9119. +- u8 txmixer_gain_24g;
  9120. +- u8 txmixer_gain_5g;
  9121. +- unsigned int tbtt_tick;
  9122. +-};
  9123. +-
  9124. + #endif /* RT2800_H */
  9125. +--- a/drivers/net/wireless/rt2x00/rt2800lib.h
  9126. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.h
  9127. +@@ -20,6 +20,17 @@
  9128. + #ifndef RT2800LIB_H
  9129. + #define RT2800LIB_H
  9130. +
  9131. ++/* RT2800 driver data structure */
  9132. ++struct rt2800_drv_data {
  9133. ++ u8 calibration_bw20;
  9134. ++ u8 calibration_bw40;
  9135. ++ u8 bbp25;
  9136. ++ u8 bbp26;
  9137. ++ u8 txmixer_gain_24g;
  9138. ++ u8 txmixer_gain_5g;
  9139. ++ unsigned int tbtt_tick;
  9140. ++};
  9141. ++
  9142. + struct rt2800_ops {
  9143. + void (*register_read)(struct rt2x00_dev *rt2x00dev,
  9144. + const unsigned int offset, u32 *value);
  9145. diff --git a/package/mac80211/patches/600-0002-rt2x00-rt2800lib-introduce-RT2800_HAS_HIGH_SHARED_ME.patch b/package/mac80211/patches/600-0002-rt2x00-rt2800lib-introduce-RT2800_HAS_HIGH_SHARED_ME.patch
  9146. new file mode 100644
  9147. index 0000000..3b11b15
  9148. --- /dev/null
  9149. +++ b/package/mac80211/patches/600-0002-rt2x00-rt2800lib-introduce-RT2800_HAS_HIGH_SHARED_ME.patch
  9150. @@ -0,0 +1,80 @@
  9151. +From a7f268af31dddf763fe3dbe9cbf96ea77e0540e0 Mon Sep 17 00:00:00 2001
  9152. +From: Gabor Juhos <juhosg@openwrt.org>
  9153. +Date: Sat, 17 Aug 2013 19:31:41 +0200
  9154. +Subject: [PATCH] rt2x00: rt2800lib: introduce RT2800_HAS_HIGH_SHARED_MEM flag
  9155. +
  9156. +Some chipsets have more than 16KB of shared memory.
  9157. +Introduce a new rt2800 specific flag to indicate that
  9158. +and add a helper function which helps to check the
  9159. +presence of the new flag.
  9160. +
  9161. +Also enable the new flag for the RT3593 chipset which
  9162. +has 24KB of shared memory. The flag can also be used
  9163. +for other chipsets, but none of those has been tested
  9164. +yet.
  9165. +
  9166. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  9167. +---
  9168. +Changes since v1:
  9169. + - don't enable the new flag for RT3071 and RT5592
  9170. +---
  9171. + drivers/net/wireless/rt2x00/rt2800lib.c | 4 ++++
  9172. + drivers/net/wireless/rt2x00/rt2800lib.h | 13 +++++++++++++
  9173. + 2 files changed, 17 insertions(+)
  9174. +
  9175. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  9176. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  9177. +@@ -7712,6 +7712,7 @@ static int rt2800_probe_rt(struct rt2x00
  9178. +
  9179. + int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev)
  9180. + {
  9181. ++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
  9182. + int retval;
  9183. + u32 reg;
  9184. +
  9185. +@@ -7719,6 +7720,9 @@ int rt2800_probe_hw(struct rt2x00_dev *r
  9186. + if (retval)
  9187. + return retval;
  9188. +
  9189. ++ if (rt2x00_rt(rt2x00dev, RT3593))
  9190. ++ __set_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags);
  9191. ++
  9192. + /*
  9193. + * Allocate eeprom data.
  9194. + */
  9195. +--- a/drivers/net/wireless/rt2x00/rt2800lib.h
  9196. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.h
  9197. +@@ -20,6 +20,10 @@
  9198. + #ifndef RT2800LIB_H
  9199. + #define RT2800LIB_H
  9200. +
  9201. ++enum rt2800_flag {
  9202. ++ RT2800_HAS_HIGH_SHARED_MEM,
  9203. ++};
  9204. ++
  9205. + /* RT2800 driver data structure */
  9206. + struct rt2800_drv_data {
  9207. + u8 calibration_bw20;
  9208. +@@ -29,6 +33,8 @@ struct rt2800_drv_data {
  9209. + u8 txmixer_gain_24g;
  9210. + u8 txmixer_gain_5g;
  9211. + unsigned int tbtt_tick;
  9212. ++
  9213. ++ unsigned long rt2800_flags;
  9214. + };
  9215. +
  9216. + struct rt2800_ops {
  9217. +@@ -61,6 +67,13 @@ struct rt2800_ops {
  9218. + __le32 *(*drv_get_txwi)(struct queue_entry *entry);
  9219. + };
  9220. +
  9221. ++static inline bool rt2800_has_high_shared_mem(struct rt2x00_dev *rt2x00dev)
  9222. ++{
  9223. ++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
  9224. ++
  9225. ++ return test_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags);
  9226. ++}
  9227. ++
  9228. + static inline void rt2800_register_read(struct rt2x00_dev *rt2x00dev,
  9229. + const unsigned int offset,
  9230. + u32 *value)
  9231. diff --git a/package/mac80211/patches/600-0003-rt2x00-rt2800-serialize-shared-memory-access.patch b/package/mac80211/patches/600-0003-rt2x00-rt2800-serialize-shared-memory-access.patch
  9232. new file mode 100644
  9233. index 0000000..879b4cc
  9234. --- /dev/null
  9235. +++ b/package/mac80211/patches/600-0003-rt2x00-rt2800-serialize-shared-memory-access.patch
  9236. @@ -0,0 +1,531 @@
  9237. +From 250a1b520cd7fdc0df4fc3fedea9066913f49ecf Mon Sep 17 00:00:00 2001
  9238. +From: Gabor Juhos <juhosg@openwrt.org>
  9239. +Date: Sat, 17 Aug 2013 19:31:42 +0200
  9240. +Subject: [PATCH] rt2x00: rt2800: serialize shared memory access
  9241. +
  9242. +The shared memory of the rt2800 devices is accessible
  9243. +through the register offset range between 0x4000 and
  9244. +0x8000. The size of this range is 16KB only and on
  9245. +devices which have more than 16KB of shared memory either
  9246. +the low or the high part of the memory is accessible at a
  9247. +time.
  9248. +
  9249. +Serialize all accesses to the shared memory by a mutex,
  9250. +in order to avoid concurrent use of that.
  9251. +
  9252. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  9253. +---
  9254. +Changes since v1: ---
  9255. +---
  9256. + drivers/net/wireless/rt2x00/rt2800lib.c | 55 +++++++++++++++++++++++++++++-
  9257. + drivers/net/wireless/rt2x00/rt2800lib.h | 32 +++++++++++++++++
  9258. + drivers/net/wireless/rt2x00/rt2800mmio.c | 26 ++++++++++++++
  9259. + drivers/net/wireless/rt2x00/rt2800mmio.h | 4 +++
  9260. + drivers/net/wireless/rt2x00/rt2800pci.c | 14 ++++++++
  9261. + drivers/net/wireless/rt2x00/rt2800soc.c | 3 ++
  9262. + drivers/net/wireless/rt2x00/rt2800usb.c | 31 +++++++++++++++++
  9263. + 7 files changed, 164 insertions(+), 1 deletion(-)
  9264. +
  9265. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  9266. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  9267. +@@ -451,11 +451,13 @@ void rt2800_mcu_request(struct rt2x00_de
  9268. + rt2x00_set_field32(&reg, H2M_MAILBOX_CSR_CMD_TOKEN, token);
  9269. + rt2x00_set_field32(&reg, H2M_MAILBOX_CSR_ARG0, arg0);
  9270. + rt2x00_set_field32(&reg, H2M_MAILBOX_CSR_ARG1, arg1);
  9271. ++ rt2800_shared_mem_lock(rt2x00dev);
  9272. + rt2800_register_write_lock(rt2x00dev, H2M_MAILBOX_CSR, reg);
  9273. +
  9274. + reg = 0;
  9275. + rt2x00_set_field32(&reg, HOST_CMD_CSR_HOST_COMMAND, command);
  9276. + rt2800_register_write_lock(rt2x00dev, HOST_CMD_CSR, reg);
  9277. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9278. + }
  9279. +
  9280. + mutex_unlock(&rt2x00dev->csr_mutex);
  9281. +@@ -674,7 +676,9 @@ int rt2800_load_firmware(struct rt2x00_d
  9282. + * Wait for device to stabilize.
  9283. + */
  9284. + for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
  9285. ++ rt2800_shared_mem_lock(rt2x00dev);
  9286. + rt2800_register_read(rt2x00dev, PBF_SYS_CTRL, &reg);
  9287. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9288. + if (rt2x00_get_field32(reg, PBF_SYS_CTRL_READY))
  9289. + break;
  9290. + msleep(1);
  9291. +@@ -694,10 +698,16 @@ int rt2800_load_firmware(struct rt2x00_d
  9292. + /*
  9293. + * Initialize firmware.
  9294. + */
  9295. ++ rt2800_shared_mem_lock(rt2x00dev);
  9296. + rt2800_register_write(rt2x00dev, H2M_BBP_AGENT, 0);
  9297. + rt2800_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0);
  9298. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9299. ++
  9300. + if (rt2x00_is_usb(rt2x00dev)) {
  9301. ++ rt2800_shared_mem_lock(rt2x00dev);
  9302. + rt2800_register_write(rt2x00dev, H2M_INT_SRC, 0);
  9303. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9304. ++
  9305. + rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0, 0, 0);
  9306. + }
  9307. + msleep(1);
  9308. +@@ -1001,8 +1011,10 @@ void rt2800_write_beacon(struct queue_en
  9309. +
  9310. + beacon_base = rt2800_hw_beacon_base(rt2x00dev, entry->entry_idx);
  9311. +
  9312. ++ rt2800_shared_mem_lock(rt2x00dev);
  9313. + rt2800_register_multiwrite(rt2x00dev, beacon_base, entry->skb->data,
  9314. + entry->skb->len + padding_len);
  9315. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9316. +
  9317. + /*
  9318. + * Enable beaconing again.
  9319. +@@ -1027,6 +1039,8 @@ static inline void rt2800_clear_beacon_r
  9320. +
  9321. + beacon_base = rt2800_hw_beacon_base(rt2x00dev, index);
  9322. +
  9323. ++ rt2800_shared_mem_lock(rt2x00dev);
  9324. ++
  9325. + /*
  9326. + * For the Beacon base registers we only need to clear
  9327. + * the whole TXWI which (when set to 0) will invalidate
  9328. +@@ -1034,6 +1048,8 @@ static inline void rt2800_clear_beacon_r
  9329. + */
  9330. + for (i = 0; i < txwi_desc_size; i += sizeof(__le32))
  9331. + rt2800_register_write(rt2x00dev, beacon_base + i, 0);
  9332. ++
  9333. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9334. + }
  9335. +
  9336. + void rt2800_clear_beacon(struct queue_entry *entry)
  9337. +@@ -1217,7 +1233,9 @@ static void rt2800_delete_wcid_attr(stru
  9338. + {
  9339. + u32 offset;
  9340. + offset = MAC_WCID_ATTR_ENTRY(wcid);
  9341. ++ rt2800_shared_mem_lock(rt2x00dev);
  9342. + rt2800_register_write(rt2x00dev, offset, 0);
  9343. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9344. + }
  9345. +
  9346. + static void rt2800_config_wcid_attr_bssidx(struct rt2x00_dev *rt2x00dev,
  9347. +@@ -1230,11 +1248,13 @@ static void rt2800_config_wcid_attr_bssi
  9348. + * The BSS Idx numbers is split in a main value of 3 bits,
  9349. + * and a extended field for adding one additional bit to the value.
  9350. + */
  9351. ++ rt2800_shared_mem_lock(rt2x00dev);
  9352. + rt2800_register_read(rt2x00dev, offset, &reg);
  9353. + rt2x00_set_field32(&reg, MAC_WCID_ATTRIBUTE_BSS_IDX, (bssidx & 0x7));
  9354. + rt2x00_set_field32(&reg, MAC_WCID_ATTRIBUTE_BSS_IDX_EXT,
  9355. + (bssidx & 0x8) >> 3);
  9356. + rt2800_register_write(rt2x00dev, offset, reg);
  9357. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9358. + }
  9359. +
  9360. + static void rt2800_config_wcid_attr_cipher(struct rt2x00_dev *rt2x00dev,
  9361. +@@ -1247,6 +1267,7 @@ static void rt2800_config_wcid_attr_ciph
  9362. +
  9363. + offset = MAC_WCID_ATTR_ENTRY(key->hw_key_idx);
  9364. +
  9365. ++ rt2800_shared_mem_lock(rt2x00dev);
  9366. + if (crypto->cmd == SET_KEY) {
  9367. + rt2800_register_read(rt2x00dev, offset, &reg);
  9368. + rt2x00_set_field32(&reg, MAC_WCID_ATTRIBUTE_KEYTAB,
  9369. +@@ -1271,6 +1292,7 @@ static void rt2800_config_wcid_attr_ciph
  9370. + rt2x00_set_field32(&reg, MAC_WCID_ATTRIBUTE_RX_WIUDF, 0);
  9371. + rt2800_register_write(rt2x00dev, offset, reg);
  9372. + }
  9373. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9374. +
  9375. + offset = MAC_IVEIV_ENTRY(key->hw_key_idx);
  9376. +
  9377. +@@ -1280,8 +1302,11 @@ static void rt2800_config_wcid_attr_ciph
  9378. + (crypto->cipher == CIPHER_AES))
  9379. + iveiv_entry.iv[3] |= 0x20;
  9380. + iveiv_entry.iv[3] |= key->keyidx << 6;
  9381. ++
  9382. ++ rt2800_shared_mem_lock(rt2x00dev);
  9383. + rt2800_register_multiwrite(rt2x00dev, offset,
  9384. + &iveiv_entry, sizeof(iveiv_entry));
  9385. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9386. + }
  9387. +
  9388. + int rt2800_config_shared_key(struct rt2x00_dev *rt2x00dev,
  9389. +@@ -1304,8 +1329,11 @@ int rt2800_config_shared_key(struct rt2x
  9390. + sizeof(key_entry.rx_mic));
  9391. +
  9392. + offset = SHARED_KEY_ENTRY(key->hw_key_idx);
  9393. ++
  9394. ++ rt2800_shared_mem_lock(rt2x00dev);
  9395. + rt2800_register_multiwrite(rt2x00dev, offset,
  9396. + &key_entry, sizeof(key_entry));
  9397. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9398. + }
  9399. +
  9400. + /*
  9401. +@@ -1320,10 +1348,12 @@ int rt2800_config_shared_key(struct rt2x
  9402. +
  9403. + offset = SHARED_KEY_MODE_ENTRY(key->hw_key_idx / 8);
  9404. +
  9405. ++ rt2800_shared_mem_lock(rt2x00dev);
  9406. + rt2800_register_read(rt2x00dev, offset, &reg);
  9407. + rt2x00_set_field32(&reg, field,
  9408. + (crypto->cmd == SET_KEY) * crypto->cipher);
  9409. + rt2800_register_write(rt2x00dev, offset, reg);
  9410. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9411. +
  9412. + /*
  9413. + * Update WCID information
  9414. +@@ -1393,8 +1423,11 @@ int rt2800_config_pairwise_key(struct rt
  9415. + sizeof(key_entry.rx_mic));
  9416. +
  9417. + offset = PAIRWISE_KEY_ENTRY(key->hw_key_idx);
  9418. ++
  9419. ++ rt2800_shared_mem_lock(rt2x00dev);
  9420. + rt2800_register_multiwrite(rt2x00dev, offset,
  9421. + &key_entry, sizeof(key_entry));
  9422. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9423. + }
  9424. +
  9425. + /*
  9426. +@@ -4876,14 +4909,19 @@ static int rt2800_init_registers(struct
  9427. + /*
  9428. + * ASIC will keep garbage value after boot, clear encryption keys.
  9429. + */
  9430. ++ rt2800_shared_mem_lock(rt2x00dev);
  9431. + for (i = 0; i < 4; i++)
  9432. + rt2800_register_write(rt2x00dev,
  9433. + SHARED_KEY_MODE_ENTRY(i), 0);
  9434. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9435. +
  9436. + for (i = 0; i < 256; i++) {
  9437. + rt2800_config_wcid(rt2x00dev, NULL, i);
  9438. + rt2800_delete_wcid_attr(rt2x00dev, i);
  9439. ++
  9440. ++ rt2800_shared_mem_lock(rt2x00dev);
  9441. + rt2800_register_write(rt2x00dev, MAC_IVEIV_ENTRY(i), 0);
  9442. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9443. + }
  9444. +
  9445. + /*
  9446. +@@ -5009,8 +5047,10 @@ static int rt2800_wait_bbp_ready(struct
  9447. + * BBP was enabled after firmware was loaded,
  9448. + * but we need to reactivate it now.
  9449. + */
  9450. ++ rt2800_shared_mem_lock(rt2x00dev);
  9451. + rt2800_register_write(rt2x00dev, H2M_BBP_AGENT, 0);
  9452. + rt2800_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0);
  9453. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9454. + msleep(1);
  9455. +
  9456. + for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
  9457. +@@ -6706,11 +6746,19 @@ int rt2800_enable_radio(struct rt2x00_de
  9458. + /*
  9459. + * Send signal during boot time to initialize firmware.
  9460. + */
  9461. ++ rt2800_shared_mem_lock(rt2x00dev);
  9462. + rt2800_register_write(rt2x00dev, H2M_BBP_AGENT, 0);
  9463. + rt2800_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0);
  9464. +- if (rt2x00_is_usb(rt2x00dev))
  9465. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9466. ++
  9467. ++ if (rt2x00_is_usb(rt2x00dev)) {
  9468. ++ rt2800_shared_mem_lock(rt2x00dev);
  9469. + rt2800_register_write(rt2x00dev, H2M_INT_SRC, 0);
  9470. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9471. ++ }
  9472. ++
  9473. + rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0, 0, 0);
  9474. ++
  9475. + msleep(1);
  9476. +
  9477. + /*
  9478. +@@ -7716,6 +7764,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r
  9479. + int retval;
  9480. + u32 reg;
  9481. +
  9482. ++ rt2800_shared_mem_init_lock(rt2x00dev);
  9483. ++
  9484. + retval = rt2800_probe_rt(rt2x00dev);
  9485. + if (retval)
  9486. + return retval;
  9487. +@@ -7795,8 +7845,11 @@ void rt2800_get_tkip_seq(struct ieee8021
  9488. + u32 offset;
  9489. +
  9490. + offset = MAC_IVEIV_ENTRY(hw_key_idx);
  9491. ++
  9492. ++ rt2800_shared_mem_lock(rt2x00dev);
  9493. + rt2800_register_multiread(rt2x00dev, offset,
  9494. + &iveiv_entry, sizeof(iveiv_entry));
  9495. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9496. +
  9497. + memcpy(iv16, &iveiv_entry.iv[0], sizeof(*iv16));
  9498. + memcpy(iv32, &iveiv_entry.iv[4], sizeof(*iv32));
  9499. +--- a/drivers/net/wireless/rt2x00/rt2800lib.h
  9500. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.h
  9501. +@@ -35,6 +35,11 @@ struct rt2800_drv_data {
  9502. + unsigned int tbtt_tick;
  9503. +
  9504. + unsigned long rt2800_flags;
  9505. ++
  9506. ++ union {
  9507. ++ spinlock_t spin;
  9508. ++ struct mutex mutex;
  9509. ++ } shmem_lock;
  9510. + };
  9511. +
  9512. + struct rt2800_ops {
  9513. +@@ -65,6 +70,10 @@ struct rt2800_ops {
  9514. + const u8 *data, const size_t len);
  9515. + int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev);
  9516. + __le32 *(*drv_get_txwi)(struct queue_entry *entry);
  9517. ++
  9518. ++ void (*shmem_init_lock)(struct rt2x00_dev *rt2x00dev);
  9519. ++ void (*shmem_lock)(struct rt2x00_dev *rt2x00dev);
  9520. ++ void (*shmem_unlock)(struct rt2x00_dev *rt2x00dev);
  9521. + };
  9522. +
  9523. + static inline bool rt2800_has_high_shared_mem(struct rt2x00_dev *rt2x00dev)
  9524. +@@ -74,6 +83,29 @@ static inline bool rt2800_has_high_share
  9525. + return test_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags);
  9526. + }
  9527. +
  9528. ++static inline void rt2800_shared_mem_init_lock(struct rt2x00_dev *rt2x00dev)
  9529. ++{
  9530. ++ const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
  9531. ++
  9532. ++ rt2800ops->shmem_init_lock(rt2x00dev);
  9533. ++}
  9534. ++
  9535. ++static inline void rt2800_shared_mem_lock(struct rt2x00_dev *rt2x00dev)
  9536. ++{
  9537. ++ const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
  9538. ++
  9539. ++ if (rt2800_has_high_shared_mem(rt2x00dev))
  9540. ++ rt2800ops->shmem_lock(rt2x00dev);
  9541. ++}
  9542. ++
  9543. ++static inline void rt2800_shared_mem_unlock(struct rt2x00_dev *rt2x00dev)
  9544. ++{
  9545. ++ const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
  9546. ++
  9547. ++ if (rt2800_has_high_shared_mem(rt2x00dev))
  9548. ++ rt2800ops->shmem_unlock(rt2x00dev);
  9549. ++}
  9550. ++
  9551. + static inline void rt2800_register_read(struct rt2x00_dev *rt2x00dev,
  9552. + const unsigned int offset,
  9553. + u32 *value)
  9554. +--- a/drivers/net/wireless/rt2x00/rt2800mmio.c
  9555. ++++ b/drivers/net/wireless/rt2x00/rt2800mmio.c
  9556. +@@ -820,8 +820,10 @@ int rt2800mmio_init_registers(struct rt2
  9557. + rt2x00_set_field32(&reg, WPDMA_RST_IDX_DRX_IDX0, 1);
  9558. + rt2x00mmio_register_write(rt2x00dev, WPDMA_RST_IDX, reg);
  9559. +
  9560. ++ rt2800_shared_mem_lock(rt2x00dev);
  9561. + rt2x00mmio_register_write(rt2x00dev, PBF_SYS_CTRL, 0x00000e1f);
  9562. + rt2x00mmio_register_write(rt2x00dev, PBF_SYS_CTRL, 0x00000e00);
  9563. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9564. +
  9565. + if (rt2x00_is_pcie(rt2x00dev) &&
  9566. + (rt2x00_rt(rt2x00dev, RT3090) ||
  9567. +@@ -865,6 +867,30 @@ int rt2800mmio_enable_radio(struct rt2x0
  9568. + }
  9569. + EXPORT_SYMBOL_GPL(rt2800mmio_enable_radio);
  9570. +
  9571. ++void rt2800mmio_shmem_init_lock(struct rt2x00_dev *rt2x00dev)
  9572. ++{
  9573. ++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
  9574. ++
  9575. ++ spin_lock_init(&drv_data->shmem_lock.spin);
  9576. ++}
  9577. ++EXPORT_SYMBOL_GPL(rt2800mmio_shmem_init_lock);
  9578. ++
  9579. ++void rt2800mmio_shmem_lock(struct rt2x00_dev *rt2x00dev)
  9580. ++{
  9581. ++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
  9582. ++
  9583. ++ spin_lock_bh(&drv_data->shmem_lock.spin);
  9584. ++}
  9585. ++EXPORT_SYMBOL_GPL(rt2800mmio_shmem_lock);
  9586. ++
  9587. ++void rt2800mmio_shmem_unlock(struct rt2x00_dev *rt2x00dev)
  9588. ++{
  9589. ++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
  9590. ++
  9591. ++ spin_unlock_bh(&drv_data->shmem_lock.spin);
  9592. ++}
  9593. ++EXPORT_SYMBOL_GPL(rt2800mmio_shmem_unlock);
  9594. ++
  9595. + MODULE_AUTHOR(DRV_PROJECT);
  9596. + MODULE_VERSION(DRV_VERSION);
  9597. + MODULE_DESCRIPTION("rt2800 MMIO library");
  9598. +--- a/drivers/net/wireless/rt2x00/rt2800mmio.h
  9599. ++++ b/drivers/net/wireless/rt2x00/rt2800mmio.h
  9600. +@@ -160,4 +160,8 @@ int rt2800mmio_init_registers(struct rt2
  9601. + /* Device state switch handlers. */
  9602. + int rt2800mmio_enable_radio(struct rt2x00_dev *rt2x00dev);
  9603. +
  9604. ++void rt2800mmio_shmem_init_lock(struct rt2x00_dev *rt2x00dev);
  9605. ++void rt2800mmio_shmem_lock(struct rt2x00_dev *rt2x00dev);
  9606. ++void rt2800mmio_shmem_unlock(struct rt2x00_dev *rt2x00dev);
  9607. ++
  9608. + #endif /* RT2800MMIO_H */
  9609. +--- a/drivers/net/wireless/rt2x00/rt2800pci.c
  9610. ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c
  9611. +@@ -69,7 +69,9 @@ static void rt2800pci_mcu_status(struct
  9612. + return;
  9613. +
  9614. + for (i = 0; i < 200; i++) {
  9615. ++ rt2800_shared_mem_lock(rt2x00dev);
  9616. + rt2x00mmio_register_read(rt2x00dev, H2M_MAILBOX_CID, &reg);
  9617. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9618. +
  9619. + if ((rt2x00_get_field32(reg, H2M_MAILBOX_CID_CMD0) == token) ||
  9620. + (rt2x00_get_field32(reg, H2M_MAILBOX_CID_CMD1) == token) ||
  9621. +@@ -83,8 +85,10 @@ static void rt2800pci_mcu_status(struct
  9622. + if (i == 200)
  9623. + rt2x00_err(rt2x00dev, "MCU request failed, no response from hardware\n");
  9624. +
  9625. ++ rt2800_shared_mem_lock(rt2x00dev);
  9626. + rt2x00mmio_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);
  9627. + rt2x00mmio_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
  9628. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9629. + }
  9630. +
  9631. + static void rt2800pci_eepromregister_read(struct eeprom_93cx6 *eeprom)
  9632. +@@ -184,6 +188,8 @@ static int rt2800pci_write_firmware(stru
  9633. + */
  9634. + reg = 0;
  9635. + rt2x00_set_field32(&reg, PBF_SYS_CTRL_HOST_RAM_WRITE, 1);
  9636. ++
  9637. ++ rt2800_shared_mem_lock(rt2x00dev);
  9638. + rt2x00mmio_register_write(rt2x00dev, PBF_SYS_CTRL, reg);
  9639. +
  9640. + /*
  9641. +@@ -197,6 +203,7 @@ static int rt2800pci_write_firmware(stru
  9642. +
  9643. + rt2x00mmio_register_write(rt2x00dev, H2M_BBP_AGENT, 0);
  9644. + rt2x00mmio_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0);
  9645. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9646. +
  9647. + return 0;
  9648. + }
  9649. +@@ -213,8 +220,10 @@ static int rt2800pci_enable_radio(struct
  9650. + return retval;
  9651. +
  9652. + /* After resume MCU_BOOT_SIGNAL will trash these. */
  9653. ++ rt2800_shared_mem_lock(rt2x00dev);
  9654. + rt2x00mmio_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);
  9655. + rt2x00mmio_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
  9656. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9657. +
  9658. + rt2800_mcu_request(rt2x00dev, MCU_SLEEP, TOKEN_RADIO_OFF, 0xff, 0x02);
  9659. + rt2800pci_mcu_status(rt2x00dev, TOKEN_RADIO_OFF);
  9660. +@@ -233,10 +242,12 @@ static int rt2800pci_set_state(struct rt
  9661. + 0, 0x02);
  9662. + rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKEUP);
  9663. + } else if (state == STATE_SLEEP) {
  9664. ++ rt2800_shared_mem_lock(rt2x00dev);
  9665. + rt2x00mmio_register_write(rt2x00dev, H2M_MAILBOX_STATUS,
  9666. + 0xffffffff);
  9667. + rt2x00mmio_register_write(rt2x00dev, H2M_MAILBOX_CID,
  9668. + 0xffffffff);
  9669. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9670. + rt2800_mcu_request(rt2x00dev, MCU_SLEEP, TOKEN_SLEEP,
  9671. + 0xff, 0x01);
  9672. + }
  9673. +@@ -337,6 +348,9 @@ static const struct rt2800_ops rt2800pci
  9674. + .drv_write_firmware = rt2800pci_write_firmware,
  9675. + .drv_init_registers = rt2800mmio_init_registers,
  9676. + .drv_get_txwi = rt2800mmio_get_txwi,
  9677. ++ .shmem_init_lock = rt2800mmio_shmem_init_lock,
  9678. ++ .shmem_lock = rt2800mmio_shmem_lock,
  9679. ++ .shmem_unlock = rt2800mmio_shmem_unlock,
  9680. + };
  9681. +
  9682. + static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
  9683. +--- a/drivers/net/wireless/rt2x00/rt2800soc.c
  9684. ++++ b/drivers/net/wireless/rt2x00/rt2800soc.c
  9685. +@@ -176,6 +176,9 @@ static const struct rt2800_ops rt2800soc
  9686. + .drv_write_firmware = rt2800soc_write_firmware,
  9687. + .drv_init_registers = rt2800mmio_init_registers,
  9688. + .drv_get_txwi = rt2800mmio_get_txwi,
  9689. ++ .shmem_init_lock = rt2800mmio_shmem_init_lock,
  9690. ++ .shmem_lock = rt2800mmio_shmem_lock,
  9691. ++ .shmem_unlock = rt2800mmio_shmem_unlock,
  9692. + };
  9693. +
  9694. + static const struct rt2x00lib_ops rt2800soc_rt2x00_ops = {
  9695. +--- a/drivers/net/wireless/rt2x00/rt2800usb.c
  9696. ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c
  9697. +@@ -51,6 +51,27 @@ static bool rt2800usb_hwcrypt_disabled(s
  9698. + return modparam_nohwcrypt;
  9699. + }
  9700. +
  9701. ++static void rt2800usb_shmem_init_lock(struct rt2x00_dev *rt2x00dev)
  9702. ++{
  9703. ++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
  9704. ++
  9705. ++ mutex_init(&drv_data->shmem_lock.mutex);
  9706. ++}
  9707. ++
  9708. ++static void rt2800usb_shmem_lock(struct rt2x00_dev *rt2x00dev)
  9709. ++{
  9710. ++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
  9711. ++
  9712. ++ mutex_lock(&drv_data->shmem_lock.mutex);
  9713. ++}
  9714. ++
  9715. ++static void rt2800usb_shmem_unlock(struct rt2x00_dev *rt2x00dev)
  9716. ++{
  9717. ++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
  9718. ++
  9719. ++ mutex_unlock(&drv_data->shmem_lock.mutex);
  9720. ++}
  9721. ++
  9722. + /*
  9723. + * Queue handlers.
  9724. + */
  9725. +@@ -260,8 +281,10 @@ static int rt2800usb_write_firmware(stru
  9726. + rt2x00usb_register_multiwrite(rt2x00dev, FIRMWARE_IMAGE_BASE,
  9727. + data + offset, length);
  9728. +
  9729. ++ rt2800_shared_mem_lock(rt2x00dev);
  9730. + rt2x00usb_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
  9731. + rt2x00usb_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);
  9732. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9733. +
  9734. + /*
  9735. + * Send firmware request to device to load firmware,
  9736. +@@ -276,7 +299,10 @@ static int rt2800usb_write_firmware(stru
  9737. + }
  9738. +
  9739. + msleep(10);
  9740. ++
  9741. ++ rt2800_shared_mem_lock(rt2x00dev);
  9742. + rt2x00usb_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0);
  9743. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9744. +
  9745. + return 0;
  9746. + }
  9747. +@@ -294,8 +320,10 @@ static int rt2800usb_init_registers(stru
  9748. + if (rt2800_wait_csr_ready(rt2x00dev))
  9749. + return -EBUSY;
  9750. +
  9751. ++ rt2800_shared_mem_lock(rt2x00dev);
  9752. + rt2x00usb_register_read(rt2x00dev, PBF_SYS_CTRL, &reg);
  9753. + rt2x00usb_register_write(rt2x00dev, PBF_SYS_CTRL, reg & ~0x00002000);
  9754. ++ rt2800_shared_mem_unlock(rt2x00dev);
  9755. +
  9756. + reg = 0;
  9757. + rt2x00_set_field32(&reg, MAC_SYS_CTRL_RESET_CSR, 1);
  9758. +@@ -810,6 +838,9 @@ static const struct rt2800_ops rt2800usb
  9759. + .drv_write_firmware = rt2800usb_write_firmware,
  9760. + .drv_init_registers = rt2800usb_init_registers,
  9761. + .drv_get_txwi = rt2800usb_get_txwi,
  9762. ++ .shmem_init_lock = rt2800usb_shmem_init_lock,
  9763. ++ .shmem_lock = rt2800usb_shmem_lock,
  9764. ++ .shmem_unlock = rt2800usb_shmem_unlock,
  9765. + };
  9766. +
  9767. + static const struct rt2x00lib_ops rt2800usb_rt2x00_ops = {
  9768. diff --git a/package/mac80211/patches/600-0004-rt2x00-rt2800lib-fix-beacon-generation-on-RT3593.patch b/package/mac80211/patches/600-0004-rt2x00-rt2800lib-fix-beacon-generation-on-RT3593.patch
  9769. new file mode 100644
  9770. index 0000000..38dbb43
  9771. --- /dev/null
  9772. +++ b/package/mac80211/patches/600-0004-rt2x00-rt2800lib-fix-beacon-generation-on-RT3593.patch
  9773. @@ -0,0 +1,131 @@
  9774. +From dcfe3dd46242050f100162dce2bcad24d2c942c6 Mon Sep 17 00:00:00 2001
  9775. +From: Gabor Juhos <juhosg@openwrt.org>
  9776. +Date: Sat, 17 Aug 2013 19:31:42 +0200
  9777. +Subject: [PATCH] rt2x00: rt2800lib: fix beacon generation on RT3593
  9778. +
  9779. +On the RT3593 chipset, the beacon registers are located
  9780. +in the high 8KB part of the shared memory.
  9781. +
  9782. +The high part of the shared memory is only accessible
  9783. +if it is explicitly selected. Add a helper function
  9784. +in order to be able to control the SHR_MSEL bit in
  9785. +the PBF_SYS_CTRL register. Also add a few more helper
  9786. +functions and use those to select the correct part of
  9787. +the shared memory before and after accessing the beacon
  9788. +registers.
  9789. +
  9790. +The base addresses of the beacon registers are also
  9791. +different from the actually used values, so fix the
  9792. +'rt2800_hw_beacon_base' function to return the correct
  9793. +values.
  9794. +
  9795. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  9796. +---
  9797. +Changes since v1: ---
  9798. +---
  9799. + drivers/net/wireless/rt2x00/rt2800.h | 3 +++
  9800. + drivers/net/wireless/rt2x00/rt2800lib.c | 44 +++++++++++++++++++++++++++++++
  9801. + 2 files changed, 47 insertions(+)
  9802. +
  9803. +--- a/drivers/net/wireless/rt2x00/rt2800.h
  9804. ++++ b/drivers/net/wireless/rt2x00/rt2800.h
  9805. +@@ -572,6 +572,7 @@
  9806. + #define PBF_SYS_CTRL 0x0400
  9807. + #define PBF_SYS_CTRL_READY FIELD32(0x00000080)
  9808. + #define PBF_SYS_CTRL_HOST_RAM_WRITE FIELD32(0x00010000)
  9809. ++#define PBF_SYS_CTRL_SHR_MSEL FIELD32(0x00080000)
  9810. +
  9811. + /*
  9812. + * HOST-MCU shared memory
  9813. +@@ -2024,6 +2025,8 @@ struct mac_iveiv_entry {
  9814. + (((__index) < 6) ? (HW_BEACON_BASE4 + ((__index - 4) * 0x0200)) : \
  9815. + (HW_BEACON_BASE6 - ((__index - 6) * 0x0200))))
  9816. +
  9817. ++#define HW_BEACON_BASE_HIGH(__index) (0x4000 + (__index) * 512)
  9818. ++
  9819. + #define BEACON_BASE_TO_OFFSET(_base) (((_base) - 0x4000) / 64)
  9820. +
  9821. + /*
  9822. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  9823. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  9824. +@@ -82,6 +82,39 @@ static inline bool rt2800_is_305x_soc(st
  9825. + return false;
  9826. + }
  9827. +
  9828. ++static inline void rt2800_shared_mem_select(struct rt2x00_dev *rt2x00dev,
  9829. ++ bool high)
  9830. ++{
  9831. ++ u32 reg;
  9832. ++
  9833. ++ if (WARN_ON_ONCE(!rt2800_has_high_shared_mem(rt2x00dev)))
  9834. ++ return;
  9835. ++
  9836. ++ rt2800_register_read(rt2x00dev, PBF_SYS_CTRL, &reg);
  9837. ++ rt2x00_set_field32(&reg, PBF_SYS_CTRL_SHR_MSEL, high);
  9838. ++ rt2800_register_write(rt2x00dev, PBF_SYS_CTRL, reg);
  9839. ++}
  9840. ++
  9841. ++static inline bool rt2800_beacon_uses_high_mem(struct rt2x00_dev *rt2x00dev)
  9842. ++{
  9843. ++ if (rt2x00_rt(rt2x00dev, RT3593))
  9844. ++ return true;
  9845. ++
  9846. ++ return false;
  9847. ++}
  9848. ++
  9849. ++static inline void rt2800_select_beacon_mem(struct rt2x00_dev *rt2x00dev)
  9850. ++{
  9851. ++ if (rt2800_beacon_uses_high_mem(rt2x00dev))
  9852. ++ rt2800_shared_mem_select(rt2x00dev, true);
  9853. ++}
  9854. ++
  9855. ++static inline void rt2800_deselect_beacon_mem(struct rt2x00_dev *rt2x00dev)
  9856. ++{
  9857. ++ if (rt2800_beacon_uses_high_mem(rt2x00dev))
  9858. ++ rt2800_shared_mem_select(rt2x00dev, false);
  9859. ++}
  9860. ++
  9861. + static void rt2800_bbp_write(struct rt2x00_dev *rt2x00dev,
  9862. + const unsigned int word, const u8 value)
  9863. + {
  9864. +@@ -948,6 +981,9 @@ EXPORT_SYMBOL_GPL(rt2800_txdone_entry);
  9865. + static unsigned int rt2800_hw_beacon_base(struct rt2x00_dev *rt2x00dev,
  9866. + unsigned int index)
  9867. + {
  9868. ++ if (rt2x00_rt(rt2x00dev, RT3593))
  9869. ++ return HW_BEACON_BASE_HIGH(index);
  9870. ++
  9871. + return HW_BEACON_BASE(index);
  9872. + }
  9873. +
  9874. +@@ -1012,8 +1048,12 @@ void rt2800_write_beacon(struct queue_en
  9875. + beacon_base = rt2800_hw_beacon_base(rt2x00dev, entry->entry_idx);
  9876. +
  9877. + rt2800_shared_mem_lock(rt2x00dev);
  9878. ++
  9879. ++ rt2800_select_beacon_mem(rt2x00dev);
  9880. + rt2800_register_multiwrite(rt2x00dev, beacon_base, entry->skb->data,
  9881. + entry->skb->len + padding_len);
  9882. ++ rt2800_deselect_beacon_mem(rt2x00dev);
  9883. ++
  9884. + rt2800_shared_mem_unlock(rt2x00dev);
  9885. +
  9886. + /*
  9887. +@@ -1041,6 +1081,8 @@ static inline void rt2800_clear_beacon_r
  9888. +
  9889. + rt2800_shared_mem_lock(rt2x00dev);
  9890. +
  9891. ++ rt2800_select_beacon_mem(rt2x00dev);
  9892. ++
  9893. + /*
  9894. + * For the Beacon base registers we only need to clear
  9895. + * the whole TXWI which (when set to 0) will invalidate
  9896. +@@ -1049,6 +1091,8 @@ static inline void rt2800_clear_beacon_r
  9897. + for (i = 0; i < txwi_desc_size; i += sizeof(__le32))
  9898. + rt2800_register_write(rt2x00dev, beacon_base + i, 0);
  9899. +
  9900. ++ rt2800_deselect_beacon_mem(rt2x00dev);
  9901. ++
  9902. + rt2800_shared_mem_unlock(rt2x00dev);
  9903. + }
  9904. +
  9905. diff --git a/package/mac80211/patches/600-0005-rt2x00-rt2800lib-add-hw_beacon_count-field-to-struct.patch b/package/mac80211/patches/600-0005-rt2x00-rt2800lib-add-hw_beacon_count-field-to-struct.patch
  9906. new file mode 100644
  9907. index 0000000..3d97169
  9908. --- /dev/null
  9909. +++ b/package/mac80211/patches/600-0005-rt2x00-rt2800lib-add-hw_beacon_count-field-to-struct.patch
  9910. @@ -0,0 +1,62 @@
  9911. +From a058825fa7b53fab3b003d8928b60e5b686b3421 Mon Sep 17 00:00:00 2001
  9912. +From: Gabor Juhos <juhosg@openwrt.org>
  9913. +Date: Sun, 4 Aug 2013 14:36:11 +0200
  9914. +Subject: [PATCH] rt2x00: rt2800lib: add hw_beacon_count field to struct
  9915. + rt2800_drv_data
  9916. +
  9917. +Some chipsets can handle more than 8 beacons at once.
  9918. +Add a new field to the rt2800_drv_data structure which
  9919. +will hold the number of supported beacons of the given
  9920. +chipset.
  9921. +
  9922. +Update the rt2x00_init_registers function to get the
  9923. +beacon count from the new field instead of using a
  9924. +hardcoded value.
  9925. +
  9926. +In order to keep the current behaviour, initialize the
  9927. +new field with the actually used value.
  9928. +
  9929. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  9930. +---
  9931. + drivers/net/wireless/rt2x00/rt2800lib.c | 5 ++++-
  9932. + drivers/net/wireless/rt2x00/rt2800lib.h | 1 +
  9933. + 2 files changed, 5 insertions(+), 1 deletion(-)
  9934. +
  9935. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  9936. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  9937. +@@ -4584,6 +4584,7 @@ EXPORT_SYMBOL_GPL(rt2800_link_tuner);
  9938. + */
  9939. + static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
  9940. + {
  9941. ++ struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
  9942. + u32 reg;
  9943. + u16 eeprom;
  9944. + unsigned int i;
  9945. +@@ -4971,7 +4972,7 @@ static int rt2800_init_registers(struct
  9946. + /*
  9947. + * Clear all beacons
  9948. + */
  9949. +- for (i = 0; i < 8; i++)
  9950. ++ for (i = 0; i < drv_data->hw_beacon_count; i++)
  9951. + rt2800_clear_beacon_register(rt2x00dev, i);
  9952. +
  9953. + if (rt2x00_is_usb(rt2x00dev)) {
  9954. +@@ -7817,6 +7818,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r
  9955. + if (rt2x00_rt(rt2x00dev, RT3593))
  9956. + __set_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags);
  9957. +
  9958. ++ drv_data->hw_beacon_count = 8;
  9959. ++
  9960. + /*
  9961. + * Allocate eeprom data.
  9962. + */
  9963. +--- a/drivers/net/wireless/rt2x00/rt2800lib.h
  9964. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.h
  9965. +@@ -33,6 +33,7 @@ struct rt2800_drv_data {
  9966. + u8 txmixer_gain_24g;
  9967. + u8 txmixer_gain_5g;
  9968. + unsigned int tbtt_tick;
  9969. ++ unsigned int hw_beacon_count;
  9970. +
  9971. + unsigned long rt2800_flags;
  9972. +
  9973. diff --git a/package/mac80211/patches/600-0006-rt2x00-rt2800lib-init-additional-beacon-offset-regis.patch b/package/mac80211/patches/600-0006-rt2x00-rt2800lib-init-additional-beacon-offset-regis.patch
  9974. new file mode 100644
  9975. index 0000000..8c52713
  9976. --- /dev/null
  9977. +++ b/package/mac80211/patches/600-0006-rt2x00-rt2800lib-init-additional-beacon-offset-regis.patch
  9978. @@ -0,0 +1,67 @@
  9979. +From 1bfa43ca8f30be53ce4fa79cfc3e219642a812b6 Mon Sep 17 00:00:00 2001
  9980. +From: Gabor Juhos <juhosg@openwrt.org>
  9981. +Date: Mon, 2 Sep 2013 10:58:32 +0200
  9982. +Subject: [PATCH] rt2x00: rt2800lib: init additional beacon offset registers
  9983. +
  9984. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  9985. +---
  9986. + drivers/net/wireless/rt2x00/rt2800.h | 14 ++++++++++++++
  9987. + drivers/net/wireless/rt2x00/rt2800lib.c | 24 ++++++++++++++++++++++++
  9988. + 2 files changed, 38 insertions(+)
  9989. +
  9990. +--- a/drivers/net/wireless/rt2x00/rt2800.h
  9991. ++++ b/drivers/net/wireless/rt2x00/rt2800.h
  9992. +@@ -627,6 +627,20 @@
  9993. + */
  9994. + #define PBF_DBG 0x043c
  9995. +
  9996. ++/* BCN_OFFSET2 */
  9997. ++#define BCN_OFFSET2 0x0444
  9998. ++#define BCN_OFFSET2_BCN8 FIELD32(0x000000ff)
  9999. ++#define BCN_OFFSET2_BCN9 FIELD32(0x0000ff00)
  10000. ++#define BCN_OFFSET2_BCN10 FIELD32(0x00ff0000)
  10001. ++#define BCN_OFFSET2_BCN11 FIELD32(0xff000000)
  10002. ++
  10003. ++/* BCN_OFFSET3 */
  10004. ++#define BCN_OFFSET3 0x0448
  10005. ++#define BCN_OFFSET3_BCN12 FIELD32(0x000000ff)
  10006. ++#define BCN_OFFSET3_BCN13 FIELD32(0x0000ff00)
  10007. ++#define BCN_OFFSET3_BCN14 FIELD32(0x00ff0000)
  10008. ++#define BCN_OFFSET3_BCN15 FIELD32(0xff000000)
  10009. ++
  10010. + /*
  10011. + * RF registers
  10012. + */
  10013. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  10014. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  10015. +@@ -4618,6 +4618,30 @@ static int rt2800_init_registers(struct
  10016. + rt2800_get_beacon_offset(rt2x00dev, 7));
  10017. + rt2800_register_write(rt2x00dev, BCN_OFFSET1, reg);
  10018. +
  10019. ++ if (drv_data->hw_beacon_count == 16) {
  10020. ++ rt2800_register_read(rt2x00dev, BCN_OFFSET2, &reg);
  10021. ++ rt2x00_set_field32(&reg, BCN_OFFSET2_BCN8,
  10022. ++ rt2800_get_beacon_offset(rt2x00dev, 8));
  10023. ++ rt2x00_set_field32(&reg, BCN_OFFSET2_BCN9,
  10024. ++ rt2800_get_beacon_offset(rt2x00dev, 9));
  10025. ++ rt2x00_set_field32(&reg, BCN_OFFSET2_BCN10,
  10026. ++ rt2800_get_beacon_offset(rt2x00dev, 10));
  10027. ++ rt2x00_set_field32(&reg, BCN_OFFSET2_BCN11,
  10028. ++ rt2800_get_beacon_offset(rt2x00dev, 11));
  10029. ++ rt2800_register_write(rt2x00dev, BCN_OFFSET2, reg);
  10030. ++
  10031. ++ rt2800_register_read(rt2x00dev, BCN_OFFSET3, &reg);
  10032. ++ rt2x00_set_field32(&reg, BCN_OFFSET3_BCN12,
  10033. ++ rt2800_get_beacon_offset(rt2x00dev, 12));
  10034. ++ rt2x00_set_field32(&reg, BCN_OFFSET3_BCN13,
  10035. ++ rt2800_get_beacon_offset(rt2x00dev, 13));
  10036. ++ rt2x00_set_field32(&reg, BCN_OFFSET3_BCN14,
  10037. ++ rt2800_get_beacon_offset(rt2x00dev, 14));
  10038. ++ rt2x00_set_field32(&reg, BCN_OFFSET3_BCN15,
  10039. ++ rt2800_get_beacon_offset(rt2x00dev, 15));
  10040. ++ rt2800_register_write(rt2x00dev, BCN_OFFSET3, reg);
  10041. ++ }
  10042. ++
  10043. + rt2800_register_write(rt2x00dev, LEGACY_BASIC_RATE, 0x0000013f);
  10044. + rt2800_register_write(rt2x00dev, HT_BASIC_RATE, 0x00008003);
  10045. +
  10046. diff --git a/package/mac80211/patches/600-0007-rt2x00-rt2800lib-fix-max-supported-beacon-count-for-.patch b/package/mac80211/patches/600-0007-rt2x00-rt2800lib-fix-max-supported-beacon-count-for-.patch
  10047. new file mode 100644
  10048. index 0000000..66e8245
  10049. --- /dev/null
  10050. +++ b/package/mac80211/patches/600-0007-rt2x00-rt2800lib-fix-max-supported-beacon-count-for-.patch
  10051. @@ -0,0 +1,24 @@
  10052. +From 9bea8b61f6025cd633bd5ac71be258620b49bcb3 Mon Sep 17 00:00:00 2001
  10053. +From: Gabor Juhos <juhosg@openwrt.org>
  10054. +Date: Mon, 2 Sep 2013 11:00:06 +0200
  10055. +Subject: [PATCH] rt2x00: rt2800lib: fix max supported beacon count for RT3593
  10056. +
  10057. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  10058. +---
  10059. + drivers/net/wireless/rt2x00/rt2800lib.c | 5 ++++-
  10060. + 1 file changed, 4 insertions(+), 1 deletion(-)
  10061. +
  10062. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  10063. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  10064. +@@ -7842,7 +7842,10 @@ int rt2800_probe_hw(struct rt2x00_dev *r
  10065. + if (rt2x00_rt(rt2x00dev, RT3593))
  10066. + __set_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags);
  10067. +
  10068. +- drv_data->hw_beacon_count = 8;
  10069. ++ if (rt2x00_rt(rt2x00dev, RT3593))
  10070. ++ drv_data->hw_beacon_count = 16;
  10071. ++ else
  10072. ++ drv_data->hw_beacon_count = 8;
  10073. +
  10074. + /*
  10075. + * Allocate eeprom data.
  10076. diff --git a/package/mac80211/patches/600-0008-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch b/package/mac80211/patches/600-0008-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch
  10077. new file mode 100644
  10078. index 0000000..8a10c6e
  10079. --- /dev/null
  10080. +++ b/package/mac80211/patches/600-0008-rt2x00-allow-to-build-rt2800soc-module-for-RT3883.patch
  10081. @@ -0,0 +1,30 @@
  10082. +From 91094ed065f7794886b4a5490fd6de942f036bb4 Mon Sep 17 00:00:00 2001
  10083. +From: Gabor Juhos <juhosg@openwrt.org>
  10084. +Date: Sun, 24 Mar 2013 19:26:26 +0100
  10085. +Subject: [PATCH] rt2x00: allow to build rt2800soc module for RT3883
  10086. +
  10087. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  10088. +---
  10089. + drivers/net/wireless/rt2x00/Kconfig | 2 +-
  10090. + 1 file changed, 1 insertion(+), 1 deletion(-)
  10091. +
  10092. +--- a/drivers/net/wireless/rt2x00/Kconfig
  10093. ++++ b/drivers/net/wireless/rt2x00/Kconfig
  10094. +@@ -210,7 +210,7 @@ endif
  10095. + config RT2800SOC
  10096. + tristate "Ralink WiSoC support"
  10097. + depends on m
  10098. +- depends on SOC_RT288X || SOC_RT305X
  10099. ++ depends on SOC_RT288X || SOC_RT305X || SOC_RT3883
  10100. + select RT2X00_LIB_SOC
  10101. + select RT2X00_LIB_MMIO
  10102. + select RT2X00_LIB_CRYPTO
  10103. +@@ -245,7 +245,7 @@ config RT2X00_LIB_PCI
  10104. +
  10105. + config RT2X00_LIB_SOC
  10106. + tristate "RT2x00 SoC support"
  10107. +- depends on SOC_RT288X || SOC_RT305X
  10108. ++ depends on SOC_RT288X || SOC_RT305X || SOC_RT3883
  10109. + depends on m
  10110. + select RT2X00_LIB
  10111. +
  10112. diff --git a/package/mac80211/patches/600-0009-rt2x00-rt2800lib-enable-support-for-RT3883.patch b/package/mac80211/patches/600-0009-rt2x00-rt2800lib-enable-support-for-RT3883.patch
  10113. new file mode 100644
  10114. index 0000000..e9d847a
  10115. --- /dev/null
  10116. +++ b/package/mac80211/patches/600-0009-rt2x00-rt2800lib-enable-support-for-RT3883.patch
  10117. @@ -0,0 +1,20 @@
  10118. +From 4f16582c93a71eba9d389e0f0a8aa9099a9587cd Mon Sep 17 00:00:00 2001
  10119. +From: Gabor Juhos <juhosg@openwrt.org>
  10120. +Date: Sun, 24 Mar 2013 19:26:26 +0100
  10121. +Subject: [PATCH] rt2x00: rt2800lib: enable support for RT3883
  10122. +
  10123. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  10124. +---
  10125. + drivers/net/wireless/rt2x00/rt2800lib.c | 1 +
  10126. + 1 file changed, 1 insertion(+)
  10127. +
  10128. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  10129. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  10130. +@@ -7812,6 +7812,7 @@ static int rt2800_probe_rt(struct rt2x00
  10131. + case RT3390:
  10132. + case RT3572:
  10133. + case RT3593:
  10134. ++ case RT3883:
  10135. + case RT5390:
  10136. + case RT5392:
  10137. + case RT5592:
  10138. diff --git a/package/mac80211/patches/600-0010-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch b/package/mac80211/patches/600-0010-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch
  10139. new file mode 100644
  10140. index 0000000..b096f9f
  10141. --- /dev/null
  10142. +++ b/package/mac80211/patches/600-0010-rt2x00-rt2800lib-add-rf_vals-for-RF3853.patch
  10143. @@ -0,0 +1,112 @@
  10144. +From ecb394ccf248d8652c463133c4f404458a57a9c1 Mon Sep 17 00:00:00 2001
  10145. +From: Gabor Juhos <juhosg@openwrt.org>
  10146. +Date: Sun, 24 Mar 2013 19:26:26 +0100
  10147. +Subject: [PATCH] rt2x00: rt2800lib: add rf_vals for RF3853
  10148. +
  10149. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  10150. +---
  10151. + drivers/net/wireless/rt2x00/rt2800.h | 4 +-
  10152. + drivers/net/wireless/rt2x00/rt2800lib.c | 65 +++++++++++++++++++++++++++++++
  10153. + 2 files changed, 68 insertions(+), 1 deletion(-)
  10154. +
  10155. +--- a/drivers/net/wireless/rt2x00/rt2800.h
  10156. ++++ b/drivers/net/wireless/rt2x00/rt2800.h
  10157. +@@ -48,7 +48,8 @@
  10158. + * RF2853 2.4G/5G 3T3R
  10159. + * RF3320 2.4G 1T1R(RT3350/RT3370/RT3390)
  10160. + * RF3322 2.4G 2T2R(RT3352/RT3371/RT3372/RT3391/RT3392)
  10161. +- * RF3053 2.4G/5G 3T3R(RT3883/RT3563/RT3573/RT3593/RT3662)
  10162. ++ * RF3053 2.4G/5G 3T3R(RT3563/RT3573/RT3593)
  10163. ++ * RF3853 2.4G/5G 3T3R(RT3883/RT3662)
  10164. + * RF5592 2.4G/5G 2T2R
  10165. + * RF3070 2.4G 1T1R
  10166. + * RF5360 2.4G 1T1R
  10167. +@@ -71,6 +72,7 @@
  10168. + #define RF5592 0x000f
  10169. + #define RF3070 0x3070
  10170. + #define RF3290 0x3290
  10171. ++#define RF3853 0x3853
  10172. + #define RF5360 0x5360
  10173. + #define RF5370 0x5370
  10174. + #define RF5372 0x5372
  10175. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  10176. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  10177. +@@ -7432,6 +7432,66 @@ static const struct rf_channel rf_vals_3
  10178. + {173, 0x61, 0, 9},
  10179. + };
  10180. +
  10181. ++static const struct rf_channel rf_vals_3853[] = {
  10182. ++ {1, 241, 6, 2},
  10183. ++ {2, 241, 6, 7},
  10184. ++ {3, 242, 6, 2},
  10185. ++ {4, 242, 6, 7},
  10186. ++ {5, 243, 6, 2},
  10187. ++ {6, 243, 6, 7},
  10188. ++ {7, 244, 6, 2},
  10189. ++ {8, 244, 6, 7},
  10190. ++ {9, 245, 6, 2},
  10191. ++ {10, 245, 6, 7},
  10192. ++ {11, 246, 6, 2},
  10193. ++ {12, 246, 6, 7},
  10194. ++ {13, 247, 6, 2},
  10195. ++ {14, 248, 6, 4},
  10196. ++
  10197. ++ {36, 0x56, 8, 4},
  10198. ++ {38, 0x56, 8, 6},
  10199. ++ {40, 0x56, 8, 8},
  10200. ++ {44, 0x57, 8, 0},
  10201. ++ {46, 0x57, 8, 2},
  10202. ++ {48, 0x57, 8, 4},
  10203. ++ {52, 0x57, 8, 8},
  10204. ++ {54, 0x57, 8, 10},
  10205. ++ {56, 0x58, 8, 0},
  10206. ++ {60, 0x58, 8, 4},
  10207. ++ {62, 0x58, 8, 6},
  10208. ++ {64, 0x58, 8, 8},
  10209. ++
  10210. ++ {100, 0x5b, 8, 8},
  10211. ++ {102, 0x5b, 8, 10},
  10212. ++ {104, 0x5c, 8, 0},
  10213. ++ {108, 0x5c, 8, 4},
  10214. ++ {110, 0x5c, 8, 6},
  10215. ++ {112, 0x5c, 8, 8},
  10216. ++ {114, 0x5c, 8, 10},
  10217. ++ {116, 0x5d, 8, 0},
  10218. ++ {118, 0x5d, 8, 2},
  10219. ++ {120, 0x5d, 8, 4},
  10220. ++ {124, 0x5d, 8, 8},
  10221. ++ {126, 0x5d, 8, 10},
  10222. ++ {128, 0x5e, 8, 0},
  10223. ++ {132, 0x5e, 8, 4},
  10224. ++ {134, 0x5e, 8, 6},
  10225. ++ {136, 0x5e, 8, 8},
  10226. ++ {140, 0x5f, 8, 0},
  10227. ++
  10228. ++ {149, 0x5f, 8, 9},
  10229. ++ {151, 0x5f, 8, 11},
  10230. ++ {153, 0x60, 8, 1},
  10231. ++ {157, 0x60, 8, 5},
  10232. ++ {159, 0x60, 8, 7},
  10233. ++ {161, 0x60, 8, 9},
  10234. ++ {165, 0x61, 8, 1},
  10235. ++ {167, 0x61, 8, 3},
  10236. ++ {169, 0x61, 8, 5},
  10237. ++ {171, 0x61, 8, 7},
  10238. ++ {173, 0x61, 8, 9},
  10239. ++};
  10240. ++
  10241. + static const struct rf_channel rf_vals_5592_xtal20[] = {
  10242. + /* Channel, N, K, mod, R */
  10243. + {1, 482, 4, 10, 3},
  10244. +@@ -7660,6 +7720,11 @@ static int rt2800_probe_hw_mode(struct r
  10245. + spec->channels = rf_vals_3x;
  10246. + break;
  10247. +
  10248. ++ case RF3853:
  10249. ++ spec->num_channels = ARRAY_SIZE(rf_vals_3853);
  10250. ++ spec->channels = rf_vals_3853;
  10251. ++ break;
  10252. ++
  10253. + case RF5592:
  10254. + rt2800_register_read(rt2x00dev, MAC_DEBUG_INDEX, &reg);
  10255. + if (rt2x00_get_field32(reg, MAC_DEBUG_INDEX_XTAL)) {
  10256. diff --git a/package/mac80211/patches/600-0011-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch b/package/mac80211/patches/600-0011-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch
  10257. new file mode 100644
  10258. index 0000000..4c9a3b4
  10259. --- /dev/null
  10260. +++ b/package/mac80211/patches/600-0011-rt2x00-rt2800lib-enable-VCO-calibration-for-RF3853.patch
  10261. @@ -0,0 +1,28 @@
  10262. +From f8e3fcf18e1f2d7f9e6a9680c5452da090f33d88 Mon Sep 17 00:00:00 2001
  10263. +From: Gabor Juhos <juhosg@openwrt.org>
  10264. +Date: Thu, 1 Aug 2013 14:40:44 +0200
  10265. +Subject: [PATCH] rt2x00: rt2800lib: enable VCO calibration for RF3853
  10266. +
  10267. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  10268. +---
  10269. + drivers/net/wireless/rt2x00/rt2800lib.c | 2 ++
  10270. + 1 file changed, 2 insertions(+)
  10271. +
  10272. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  10273. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  10274. +@@ -4349,6 +4349,7 @@ void rt2800_vco_calibration(struct rt2x0
  10275. + case RF3053:
  10276. + case RF3070:
  10277. + case RF3290:
  10278. ++ case RF3853:
  10279. + case RF5360:
  10280. + case RF5370:
  10281. + case RF5372:
  10282. +@@ -7839,6 +7840,7 @@ static int rt2800_probe_hw_mode(struct r
  10283. + case RF3053:
  10284. + case RF3070:
  10285. + case RF3290:
  10286. ++ case RF3853:
  10287. + case RF5360:
  10288. + case RF5370:
  10289. + case RF5372:
  10290. diff --git a/package/mac80211/patches/600-0012-rt2x00-rt2800lib-add-channel-configuration-function-.patch b/package/mac80211/patches/600-0012-rt2x00-rt2800lib-add-channel-configuration-function-.patch
  10291. new file mode 100644
  10292. index 0000000..e3460ff
  10293. --- /dev/null
  10294. +++ b/package/mac80211/patches/600-0012-rt2x00-rt2800lib-add-channel-configuration-function-.patch
  10295. @@ -0,0 +1,235 @@
  10296. +From 6e3a17190815c6aa4dc53c2cfe9125fb1154f187 Mon Sep 17 00:00:00 2001
  10297. +From: Gabor Juhos <juhosg@openwrt.org>
  10298. +Date: Sun, 24 Mar 2013 19:26:27 +0100
  10299. +Subject: [PATCH] rt2x00: rt2800lib: add channel configuration function for
  10300. + RF3853
  10301. +
  10302. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  10303. +---
  10304. + drivers/net/wireless/rt2x00/rt2800lib.c | 208 +++++++++++++++++++++++++++++++
  10305. + 1 file changed, 208 insertions(+)
  10306. +
  10307. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  10308. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  10309. +@@ -2605,6 +2605,211 @@ static void rt2800_config_channel_rf3053
  10310. + }
  10311. + }
  10312. +
  10313. ++static void rt2800_config_channel_rf3853(struct rt2x00_dev *rt2x00dev,
  10314. ++ struct ieee80211_conf *conf,
  10315. ++ struct rf_channel *rf,
  10316. ++ struct channel_info *info)
  10317. ++{
  10318. ++ u8 rfcsr;
  10319. ++ u8 bbp;
  10320. ++ u8 pwr1, pwr2, pwr3;
  10321. ++
  10322. ++ const bool txbf_enabled = false; /* TODO */
  10323. ++
  10324. ++ /* TODO: add band selection */
  10325. ++
  10326. ++ if (rf->channel <= 14)
  10327. ++ rt2800_rfcsr_write(rt2x00dev, 6, 0x40);
  10328. ++ else if (rf->channel < 132)
  10329. ++ rt2800_rfcsr_write(rt2x00dev, 6, 0x80);
  10330. ++ else
  10331. ++ rt2800_rfcsr_write(rt2x00dev, 6, 0x40);
  10332. ++
  10333. ++ rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1);
  10334. ++ rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3);
  10335. ++
  10336. ++ if (rf->channel <= 14)
  10337. ++ rt2800_rfcsr_write(rt2x00dev, 11, 0x46);
  10338. ++ else
  10339. ++ rt2800_rfcsr_write(rt2x00dev, 11, 0x48);
  10340. ++
  10341. ++ if (rf->channel <= 14)
  10342. ++ rt2800_rfcsr_write(rt2x00dev, 12, 0x1a);
  10343. ++ else
  10344. ++ rt2800_rfcsr_write(rt2x00dev, 12, 0x52);
  10345. ++
  10346. ++ rt2800_rfcsr_write(rt2x00dev, 13, 0x12);
  10347. ++
  10348. ++ rt2800_rfcsr_read(rt2x00dev, 1, &rfcsr);
  10349. ++ rt2x00_set_field8(&rfcsr, RFCSR1_RX0_PD, 0);
  10350. ++ rt2x00_set_field8(&rfcsr, RFCSR1_TX0_PD, 0);
  10351. ++ rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 0);
  10352. ++ rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 0);
  10353. ++ rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 0);
  10354. ++ rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, 0);
  10355. ++ rt2x00_set_field8(&rfcsr, RFCSR1_RF_BLOCK_EN, 1);
  10356. ++ rt2x00_set_field8(&rfcsr, RFCSR1_PLL_PD, 1);
  10357. ++
  10358. ++ switch (rt2x00dev->default_ant.tx_chain_num) {
  10359. ++ case 3:
  10360. ++ rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, 1);
  10361. ++ /* fallthrough */
  10362. ++ case 2:
  10363. ++ rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 1);
  10364. ++ /* fallthrough */
  10365. ++ case 1:
  10366. ++ rt2x00_set_field8(&rfcsr, RFCSR1_TX0_PD, 1);
  10367. ++ break;
  10368. ++ }
  10369. ++
  10370. ++ switch (rt2x00dev->default_ant.rx_chain_num) {
  10371. ++ case 3:
  10372. ++ rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 1);
  10373. ++ /* fallthrough */
  10374. ++ case 2:
  10375. ++ rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 1);
  10376. ++ /* fallthrough */
  10377. ++ case 1:
  10378. ++ rt2x00_set_field8(&rfcsr, RFCSR1_RX0_PD, 1);
  10379. ++ break;
  10380. ++ }
  10381. ++ rt2800_rfcsr_write(rt2x00dev, 1, rfcsr);
  10382. ++
  10383. ++ rt2800_adjust_freq_offset(rt2x00dev);
  10384. ++
  10385. ++ rt2800_rfcsr_read(rt2x00dev, 30, &rfcsr);
  10386. ++ if (!conf_is_ht40(conf))
  10387. ++ rfcsr &= ~(0x06);
  10388. ++ else
  10389. ++ rfcsr |= 0x06;
  10390. ++ rt2800_rfcsr_write(rt2x00dev, 30, rfcsr);
  10391. ++
  10392. ++ if (rf->channel <= 14)
  10393. ++ rt2800_rfcsr_write(rt2x00dev, 31, 0xa0);
  10394. ++ else
  10395. ++ rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
  10396. ++
  10397. ++ if (conf_is_ht40(conf))
  10398. ++ rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
  10399. ++ else
  10400. ++ rt2800_rfcsr_write(rt2x00dev, 32, 0xd8);
  10401. ++
  10402. ++ if (rf->channel <= 14)
  10403. ++ rt2800_rfcsr_write(rt2x00dev, 34, 0x3c);
  10404. ++ else
  10405. ++ rt2800_rfcsr_write(rt2x00dev, 34, 0x20);
  10406. ++
  10407. ++ /* loopback RF_BS */
  10408. ++ rt2800_rfcsr_read(rt2x00dev, 36, &rfcsr);
  10409. ++ if (rf->channel <= 14)
  10410. ++ rt2x00_set_field8(&rfcsr, RFCSR36_RF_BS, 1);
  10411. ++ else
  10412. ++ rt2x00_set_field8(&rfcsr, RFCSR36_RF_BS, 0);
  10413. ++ rt2800_rfcsr_write(rt2x00dev, 36, rfcsr);
  10414. ++
  10415. ++ if (rf->channel <= 14)
  10416. ++ rfcsr = 0x23;
  10417. ++ else if (rf->channel < 100)
  10418. ++ rfcsr = 0x36;
  10419. ++ else if (rf->channel < 132)
  10420. ++ rfcsr = 0x32;
  10421. ++ else
  10422. ++ rfcsr = 0x30;
  10423. ++
  10424. ++ if (txbf_enabled)
  10425. ++ rfcsr |= 0x40;
  10426. ++
  10427. ++ rt2800_rfcsr_write(rt2x00dev, 39, rfcsr);
  10428. ++
  10429. ++ if (rf->channel <= 14)
  10430. ++ rt2800_rfcsr_write(rt2x00dev, 44, 0x93);
  10431. ++ else
  10432. ++ rt2800_rfcsr_write(rt2x00dev, 44, 0x9b);
  10433. ++
  10434. ++ if (rf->channel <= 14)
  10435. ++ rfcsr = 0xbb;
  10436. ++ else if (rf->channel < 100)
  10437. ++ rfcsr = 0xeb;
  10438. ++ else if (rf->channel < 132)
  10439. ++ rfcsr = 0xb3;
  10440. ++ else
  10441. ++ rfcsr = 0x9b;
  10442. ++ rt2800_rfcsr_write(rt2x00dev, 45, rfcsr);
  10443. ++
  10444. ++ if (rf->channel <= 14)
  10445. ++ rfcsr = 0x8e;
  10446. ++ else
  10447. ++ rfcsr = 0x8a;
  10448. ++
  10449. ++ if (txbf_enabled)
  10450. ++ rfcsr |= 0x20;
  10451. ++
  10452. ++ rt2800_rfcsr_write(rt2x00dev, 49, rfcsr);
  10453. ++
  10454. ++ rt2800_rfcsr_write(rt2x00dev, 50, 0x86);
  10455. ++
  10456. ++ rt2800_rfcsr_read(rt2x00dev, 51, &rfcsr);
  10457. ++ if (rf->channel <= 14)
  10458. ++ rt2800_rfcsr_write(rt2x00dev, 51, 0x75);
  10459. ++ else
  10460. ++ rt2800_rfcsr_write(rt2x00dev, 51, 0x51);
  10461. ++
  10462. ++ rt2800_rfcsr_read(rt2x00dev, 52, &rfcsr);
  10463. ++ if (rf->channel <= 14)
  10464. ++ rt2800_rfcsr_write(rt2x00dev, 52, 0x45);
  10465. ++ else
  10466. ++ rt2800_rfcsr_write(rt2x00dev, 52, 0x05);
  10467. ++
  10468. ++ if (rf->channel <= 14) {
  10469. ++ pwr1 = info->default_power1 & 0x1f;
  10470. ++ pwr2 = info->default_power2 & 0x1f;
  10471. ++ pwr3 = info->default_power3 & 0x1f;
  10472. ++ } else {
  10473. ++ pwr1 = 0x48 | ((info->default_power1 & 0x18) << 1) |
  10474. ++ (info->default_power1 & 0x7);
  10475. ++ pwr2 = 0x48 | ((info->default_power2 & 0x18) << 1) |
  10476. ++ (info->default_power2 & 0x7);
  10477. ++ pwr3 = 0x48 | ((info->default_power3 & 0x18) << 1) |
  10478. ++ (info->default_power3 & 0x7);
  10479. ++ }
  10480. ++
  10481. ++ rt2800_rfcsr_write(rt2x00dev, 53, pwr1);
  10482. ++ rt2800_rfcsr_write(rt2x00dev, 54, pwr2);
  10483. ++ rt2800_rfcsr_write(rt2x00dev, 55, pwr3);
  10484. ++
  10485. ++ rt2x00_dbg(rt2x00dev, "Channel:%d, pwr1:%02x, pwr2:%02x, pwr3:%02x\n",
  10486. ++ rf->channel, pwr1, pwr2, pwr3);
  10487. ++
  10488. ++ bbp = (info->default_power1 >> 5) |
  10489. ++ ((info->default_power2 & 0xe0) >> 1);
  10490. ++ rt2800_bbp_write(rt2x00dev, 109, bbp);
  10491. ++
  10492. ++ rt2800_bbp_read(rt2x00dev, 110, &bbp);
  10493. ++ bbp &= 0x0f;
  10494. ++ bbp |= (info->default_power3 & 0xe0) >> 1;
  10495. ++ rt2800_bbp_write(rt2x00dev, 110, bbp);
  10496. ++
  10497. ++ rt2800_rfcsr_read(rt2x00dev, 57, &rfcsr);
  10498. ++ if (rf->channel <= 14)
  10499. ++ rt2800_rfcsr_write(rt2x00dev, 57, 0x6e);
  10500. ++ else
  10501. ++ rt2800_rfcsr_write(rt2x00dev, 57, 0x3e);
  10502. ++
  10503. ++ /* Enable RF tuning */
  10504. ++ rt2800_rfcsr_read(rt2x00dev, 3, &rfcsr);
  10505. ++ rt2x00_set_field8(&rfcsr, RFCSR3_VCOCAL_EN, 1);
  10506. ++ rt2800_rfcsr_write(rt2x00dev, 3, rfcsr);
  10507. ++
  10508. ++ udelay(2000);
  10509. ++
  10510. ++ rt2800_bbp_read(rt2x00dev, 49, &bbp);
  10511. ++ /* clear update flag */
  10512. ++ rt2800_bbp_write(rt2x00dev, 49, bbp & 0xfe);
  10513. ++ rt2800_bbp_write(rt2x00dev, 49, bbp);
  10514. ++
  10515. ++ /* TODO: add calibration for TxBF */
  10516. ++}
  10517. ++
  10518. + #define POWER_BOUND 0x27
  10519. + #define POWER_BOUND_5G 0x2b
  10520. +
  10521. +@@ -3217,6 +3422,9 @@ static void rt2800_config_channel(struct
  10522. + case RF3322:
  10523. + rt2800_config_channel_rf3322(rt2x00dev, conf, rf, info);
  10524. + break;
  10525. ++ case RF3853:
  10526. ++ rt2800_config_channel_rf3853(rt2x00dev, conf, rf, info);
  10527. ++ break;
  10528. + case RF3070:
  10529. + case RF5360:
  10530. + case RF5370:
  10531. diff --git a/package/mac80211/patches/600-0013-rt2x00-rt2800lib-enable-RF3853-support.patch b/package/mac80211/patches/600-0013-rt2x00-rt2800lib-enable-RF3853-support.patch
  10532. new file mode 100644
  10533. index 0000000..8719425
  10534. --- /dev/null
  10535. +++ b/package/mac80211/patches/600-0013-rt2x00-rt2800lib-enable-RF3853-support.patch
  10536. @@ -0,0 +1,20 @@
  10537. +From afd38ae82226551bf879b6c7c4b620c271fee9d2 Mon Sep 17 00:00:00 2001
  10538. +From: Gabor Juhos <juhosg@openwrt.org>
  10539. +Date: Thu, 1 Aug 2013 14:42:05 +0200
  10540. +Subject: [PATCH] rt2x00: rt2800lib: enable RF3853 support
  10541. +
  10542. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  10543. +---
  10544. + drivers/net/wireless/rt2x00/rt2800lib.c | 1 +
  10545. + 1 file changed, 1 insertion(+)
  10546. +
  10547. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  10548. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  10549. +@@ -7398,6 +7398,7 @@ static int rt2800_init_eeprom(struct rt2
  10550. + case RF3290:
  10551. + case RF3320:
  10552. + case RF3322:
  10553. ++ case RF3853:
  10554. + case RF5360:
  10555. + case RF5370:
  10556. + case RF5372:
  10557. diff --git a/package/mac80211/patches/600-0014-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch b/package/mac80211/patches/600-0014-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch
  10558. new file mode 100644
  10559. index 0000000..8632ddd
  10560. --- /dev/null
  10561. +++ b/package/mac80211/patches/600-0014-rt2x00-rt2800lib-add-MAC-register-initialization-for.patch
  10562. @@ -0,0 +1,77 @@
  10563. +From 0094872a5e8e4664c6ea1b2dfa487063d39ae363 Mon Sep 17 00:00:00 2001
  10564. +From: Gabor Juhos <juhosg@openwrt.org>
  10565. +Date: Sun, 24 Mar 2013 19:26:26 +0100
  10566. +Subject: [PATCH] rt2x00: rt2800lib: add MAC register initialization for
  10567. + RT3883
  10568. +
  10569. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  10570. +---
  10571. + drivers/net/wireless/rt2x00/rt2800.h | 14 ++++++++++++++
  10572. + drivers/net/wireless/rt2x00/rt2800lib.c | 19 ++++++++++++++++---
  10573. + 2 files changed, 30 insertions(+), 3 deletions(-)
  10574. +
  10575. +--- a/drivers/net/wireless/rt2x00/rt2800.h
  10576. ++++ b/drivers/net/wireless/rt2x00/rt2800.h
  10577. +@@ -1586,6 +1586,20 @@
  10578. + #define TX_PWR_CFG_9_STBC7_CH2 FIELD32(0x00000f00)
  10579. +
  10580. + /*
  10581. ++ * TX_TXBF_CFG:
  10582. ++ */
  10583. ++#define TX_TXBF_CFG_0 0x138c
  10584. ++#define TX_TXBF_CFG_1 0x13a4
  10585. ++#define TX_TXBF_CFG_2 0x13a8
  10586. ++#define TX_TXBF_CFG_3 0x13ac
  10587. ++
  10588. ++/*
  10589. ++ * TX_FBK_CFG_3S:
  10590. ++ */
  10591. ++#define TX_FBK_CFG_3S_0 0x13c4
  10592. ++#define TX_FBK_CFG_3S_1 0x13c8
  10593. ++
  10594. ++/*
  10595. + * RX_FILTER_CFG: RX configuration register.
  10596. + */
  10597. + #define RX_FILTER_CFG 0x1400
  10598. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  10599. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  10600. +@@ -4973,6 +4973,12 @@ static int rt2800_init_registers(struct
  10601. + rt2800_register_write(rt2x00dev, TX_SW_CFG2,
  10602. + 0x00000000);
  10603. + }
  10604. ++ } else if (rt2x00_rt(rt2x00dev, RT3883)) {
  10605. ++ rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000402);
  10606. ++ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00000000);
  10607. ++ rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00040000);
  10608. ++ rt2800_register_write(rt2x00dev, TX_TXBF_CFG_0, 0x8000fc21);
  10609. ++ rt2800_register_write(rt2x00dev, TX_TXBF_CFG_3, 0x00009c40);
  10610. + } else if (rt2x00_rt(rt2x00dev, RT5390) ||
  10611. + rt2x00_rt(rt2x00dev, RT5392) ||
  10612. + rt2x00_rt(rt2x00dev, RT5592)) {
  10613. +@@ -5003,9 +5009,11 @@ static int rt2800_init_registers(struct
  10614. +
  10615. + rt2800_register_read(rt2x00dev, MAX_LEN_CFG, &reg);
  10616. + rt2x00_set_field32(&reg, MAX_LEN_CFG_MAX_MPDU, AGGREGATION_SIZE);
  10617. +- if (rt2x00_rt_rev_gte(rt2x00dev, RT2872, REV_RT2872E) ||
  10618. +- rt2x00_rt(rt2x00dev, RT2883) ||
  10619. +- rt2x00_rt_rev_lt(rt2x00dev, RT3070, REV_RT3070E))
  10620. ++ if (rt2x00_rt(rt2x00dev, RT3883))
  10621. ++ rt2x00_set_field32(&reg, MAX_LEN_CFG_MAX_PSDU, 3);
  10622. ++ else if (rt2x00_rt_rev_gte(rt2x00dev, RT2872, REV_RT2872E) ||
  10623. ++ rt2x00_rt(rt2x00dev, RT2883) ||
  10624. ++ rt2x00_rt_rev_lt(rt2x00dev, RT3070, REV_RT3070E))
  10625. + rt2x00_set_field32(&reg, MAX_LEN_CFG_MAX_PSDU, 2);
  10626. + else
  10627. + rt2x00_set_field32(&reg, MAX_LEN_CFG_MAX_PSDU, 1);
  10628. +@@ -5158,6 +5166,11 @@ static int rt2800_init_registers(struct
  10629. + reg = rt2x00_rt(rt2x00dev, RT5592) ? 0x00000082 : 0x00000002;
  10630. + rt2800_register_write(rt2x00dev, TXOP_HLDR_ET, reg);
  10631. +
  10632. ++ if (rt2x00_rt(rt2x00dev, RT3883)) {
  10633. ++ rt2800_register_write(rt2x00dev, TX_FBK_CFG_3S_0, 0x12111008);
  10634. ++ rt2800_register_write(rt2x00dev, TX_FBK_CFG_3S_1, 0x16151413);
  10635. ++ }
  10636. ++
  10637. + rt2800_register_read(rt2x00dev, TX_RTS_CFG, &reg);
  10638. + rt2x00_set_field32(&reg, TX_RTS_CFG_AUTO_RTS_RETRY_LIMIT, 32);
  10639. + rt2x00_set_field32(&reg, TX_RTS_CFG_RTS_THRES,
  10640. diff --git a/package/mac80211/patches/600-0015-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch b/package/mac80211/patches/600-0015-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch
  10641. new file mode 100644
  10642. index 0000000..837c025
  10643. --- /dev/null
  10644. +++ b/package/mac80211/patches/600-0015-rt2x00-rt2800soc-fix-rt2800soc_disable_radio-for-RT3.patch
  10645. @@ -0,0 +1,30 @@
  10646. +From 6c2d32478159fffff0b85abb6817a21bb2338231 Mon Sep 17 00:00:00 2001
  10647. +From: Gabor Juhos <juhosg@openwrt.org>
  10648. +Date: Sun, 24 Mar 2013 19:26:27 +0100
  10649. +Subject: [PATCH] rt2x00: rt2800soc: fix rt2800soc_disable_radio for RT3883
  10650. +
  10651. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  10652. +---
  10653. + drivers/net/wireless/rt2x00/rt2800soc.c | 9 ++++++++-
  10654. + 1 file changed, 8 insertions(+), 1 deletion(-)
  10655. +
  10656. +--- a/drivers/net/wireless/rt2x00/rt2800soc.c
  10657. ++++ b/drivers/net/wireless/rt2x00/rt2800soc.c
  10658. +@@ -51,9 +51,16 @@ static bool rt2800soc_hwcrypt_disabled(s
  10659. +
  10660. + static void rt2800soc_disable_radio(struct rt2x00_dev *rt2x00dev)
  10661. + {
  10662. ++ u32 reg;
  10663. ++
  10664. + rt2800_disable_radio(rt2x00dev);
  10665. + rt2x00mmio_register_write(rt2x00dev, PWR_PIN_CFG, 0);
  10666. +- rt2x00mmio_register_write(rt2x00dev, TX_PIN_CFG, 0);
  10667. ++
  10668. ++ reg = 0;
  10669. ++ if (rt2x00_rt(rt2x00dev, RT3883))
  10670. ++ rt2x00_set_field32(&reg, TX_PIN_CFG_RFTR_EN, 1);
  10671. ++
  10672. ++ rt2x00mmio_register_write(rt2x00dev, TX_PIN_CFG, reg);
  10673. + }
  10674. +
  10675. + static int rt2800soc_set_device_state(struct rt2x00_dev *rt2x00dev,
  10676. diff --git a/package/mac80211/patches/600-0016-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch b/package/mac80211/patches/600-0016-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch
  10677. new file mode 100644
  10678. index 0000000..967e36a
  10679. --- /dev/null
  10680. +++ b/package/mac80211/patches/600-0016-rt2x00-rt2800lib-add-BBP-register-initialization-for.patch
  10681. @@ -0,0 +1,71 @@
  10682. +From 84833056aa7dd25f5b097e31c78f2a0914c5160c Mon Sep 17 00:00:00 2001
  10683. +From: Gabor Juhos <juhosg@openwrt.org>
  10684. +Date: Sun, 24 Mar 2013 19:26:26 +0100
  10685. +Subject: [PATCH] rt2x00: rt2800lib: add BBP register initialization for
  10686. + RT3883
  10687. +
  10688. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  10689. +---
  10690. + drivers/net/wireless/rt2x00/rt2800lib.c | 44 +++++++++++++++++++++++++++++++
  10691. + 1 file changed, 44 insertions(+)
  10692. +
  10693. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  10694. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  10695. +@@ -5776,6 +5776,47 @@ static void rt2800_init_bbp_3593(struct
  10696. + rt2800_bbp_write(rt2x00dev, 103, 0xc0);
  10697. + }
  10698. +
  10699. ++static void rt2800_init_bbp_3883(struct rt2x00_dev *rt2x00dev)
  10700. ++{
  10701. ++ rt2800_init_bbp_early(rt2x00dev);
  10702. ++
  10703. ++ rt2800_bbp_write(rt2x00dev, 4, 0x50);
  10704. ++ rt2800_bbp_write(rt2x00dev, 47, 0x48);
  10705. ++
  10706. ++ rt2800_bbp_write(rt2x00dev, 86, 0x46);
  10707. ++ rt2800_bbp_write(rt2x00dev, 88, 0x90);
  10708. ++
  10709. ++ rt2800_bbp_write(rt2x00dev, 92, 0x02);
  10710. ++
  10711. ++ rt2800_bbp_write(rt2x00dev, 103, 0xc0);
  10712. ++ rt2800_bbp_write(rt2x00dev, 104, 0x92);
  10713. ++ rt2800_bbp_write(rt2x00dev, 105, 0x34);
  10714. ++ rt2800_bbp_write(rt2x00dev, 106, 0x12);
  10715. ++ rt2800_bbp_write(rt2x00dev, 120, 0x50);
  10716. ++ rt2800_bbp_write(rt2x00dev, 137, 0x0f);
  10717. ++ rt2800_bbp_write(rt2x00dev, 163, 0x9d);
  10718. ++
  10719. ++ /* Set ITxBF timeout to 0x9C40=1000msec */
  10720. ++ rt2800_bbp_write(rt2x00dev, 179, 0x02);
  10721. ++ rt2800_bbp_write(rt2x00dev, 180, 0x00);
  10722. ++ rt2800_bbp_write(rt2x00dev, 182, 0x40);
  10723. ++ rt2800_bbp_write(rt2x00dev, 180, 0x01);
  10724. ++ rt2800_bbp_write(rt2x00dev, 182, 0x9c);
  10725. ++
  10726. ++ rt2800_bbp_write(rt2x00dev, 179, 0x00);
  10727. ++
  10728. ++ /* Reprogram the inband interface to put right values in RXWI */
  10729. ++ rt2800_bbp_write(rt2x00dev, 142, 0x04);
  10730. ++ rt2800_bbp_write(rt2x00dev, 143, 0x3b);
  10731. ++ rt2800_bbp_write(rt2x00dev, 142, 0x06);
  10732. ++ rt2800_bbp_write(rt2x00dev, 143, 0xa0);
  10733. ++ rt2800_bbp_write(rt2x00dev, 142, 0x07);
  10734. ++ rt2800_bbp_write(rt2x00dev, 143, 0xa1);
  10735. ++ rt2800_bbp_write(rt2x00dev, 142, 0x08);
  10736. ++ rt2800_bbp_write(rt2x00dev, 143, 0xa2);
  10737. ++ rt2800_bbp_write(rt2x00dev, 148, 0xc8);
  10738. ++}
  10739. ++
  10740. + static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev)
  10741. + {
  10742. + int ant, div_mode;
  10743. +@@ -5994,6 +6035,9 @@ static void rt2800_init_bbp(struct rt2x0
  10744. + case RT3593:
  10745. + rt2800_init_bbp_3593(rt2x00dev);
  10746. + return;
  10747. ++ case RT3883:
  10748. ++ rt2800_init_bbp_3883(rt2x00dev);
  10749. ++ return;
  10750. + case RT5390:
  10751. + case RT5392:
  10752. + rt2800_init_bbp_53xx(rt2x00dev);
  10753. diff --git a/package/mac80211/patches/600-0017-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch b/package/mac80211/patches/600-0017-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch
  10754. new file mode 100644
  10755. index 0000000..c568b99
  10756. --- /dev/null
  10757. +++ b/package/mac80211/patches/600-0017-rt2x00-rt2800lib-add-RFCSR-initialization-for-RT3883.patch
  10758. @@ -0,0 +1,178 @@
  10759. +From 99c659cf345640fd0f733cbcaf4583cc2c868ec0 Mon Sep 17 00:00:00 2001
  10760. +From: Gabor Juhos <juhosg@openwrt.org>
  10761. +Date: Mon, 29 Apr 2013 13:21:48 +0200
  10762. +Subject: [PATCH] rt2x00: rt2800lib: add RFCSR initialization for RT3883
  10763. +
  10764. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  10765. +---
  10766. + drivers/net/wireless/rt2x00/rt2800.h | 1 +
  10767. + drivers/net/wireless/rt2x00/rt2800lib.c | 141 +++++++++++++++++++++++++++++++
  10768. + 2 files changed, 142 insertions(+)
  10769. +
  10770. +--- a/drivers/net/wireless/rt2x00/rt2800.h
  10771. ++++ b/drivers/net/wireless/rt2x00/rt2800.h
  10772. +@@ -2169,6 +2169,7 @@ struct mac_iveiv_entry {
  10773. + /*
  10774. + * RFCSR 2:
  10775. + */
  10776. ++#define RFCSR2_RESCAL_BP FIELD8(0x40)
  10777. + #define RFCSR2_RESCAL_EN FIELD8(0x80)
  10778. +
  10779. + /*
  10780. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  10781. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  10782. +@@ -6811,6 +6811,144 @@ static void rt2800_init_rfcsr_3593(struc
  10783. + /* TODO: enable stream mode support */
  10784. + }
  10785. +
  10786. ++static void rt2800_init_rfcsr_3883(struct rt2x00_dev *rt2x00dev)
  10787. ++{
  10788. ++ u8 rfcsr;
  10789. ++
  10790. ++ /* TODO: get the actual ECO value from the SoC */
  10791. ++ const unsigned int eco = 5;
  10792. ++
  10793. ++ rt2800_rf_init_calibration(rt2x00dev, 2);
  10794. ++
  10795. ++ rt2800_rfcsr_write(rt2x00dev, 0, 0xe0);
  10796. ++ rt2800_rfcsr_write(rt2x00dev, 1, 0x03);
  10797. ++ rt2800_rfcsr_write(rt2x00dev, 2, 0x50);
  10798. ++ rt2800_rfcsr_write(rt2x00dev, 3, 0x20);
  10799. ++ rt2800_rfcsr_write(rt2x00dev, 4, 0x00);
  10800. ++ rt2800_rfcsr_write(rt2x00dev, 5, 0x00);
  10801. ++ rt2800_rfcsr_write(rt2x00dev, 6, 0x40);
  10802. ++ rt2800_rfcsr_write(rt2x00dev, 7, 0x00);
  10803. ++ rt2800_rfcsr_write(rt2x00dev, 8, 0x5b);
  10804. ++ rt2800_rfcsr_write(rt2x00dev, 9, 0x08);
  10805. ++ rt2800_rfcsr_write(rt2x00dev, 10, 0xd3);
  10806. ++ rt2800_rfcsr_write(rt2x00dev, 11, 0x48);
  10807. ++ rt2800_rfcsr_write(rt2x00dev, 12, 0x1a);
  10808. ++ rt2800_rfcsr_write(rt2x00dev, 13, 0x12);
  10809. ++ rt2800_rfcsr_write(rt2x00dev, 14, 0x00);
  10810. ++ rt2800_rfcsr_write(rt2x00dev, 15, 0x00);
  10811. ++ rt2800_rfcsr_write(rt2x00dev, 16, 0x00);
  10812. ++
  10813. ++ /* RFCSR 17 will be initialized later based on the
  10814. ++ * frequency offset stored in the EEPROM
  10815. ++ */
  10816. ++
  10817. ++ rt2800_rfcsr_write(rt2x00dev, 18, 0x40);
  10818. ++ rt2800_rfcsr_write(rt2x00dev, 19, 0x00);
  10819. ++ rt2800_rfcsr_write(rt2x00dev, 20, 0x00);
  10820. ++ rt2800_rfcsr_write(rt2x00dev, 21, 0x00);
  10821. ++ rt2800_rfcsr_write(rt2x00dev, 22, 0x20);
  10822. ++ rt2800_rfcsr_write(rt2x00dev, 23, 0xc0);
  10823. ++ rt2800_rfcsr_write(rt2x00dev, 24, 0x00);
  10824. ++ rt2800_rfcsr_write(rt2x00dev, 25, 0x00);
  10825. ++ rt2800_rfcsr_write(rt2x00dev, 26, 0x00);
  10826. ++ rt2800_rfcsr_write(rt2x00dev, 27, 0x00);
  10827. ++ rt2800_rfcsr_write(rt2x00dev, 28, 0x00);
  10828. ++ rt2800_rfcsr_write(rt2x00dev, 29, 0x00);
  10829. ++ rt2800_rfcsr_write(rt2x00dev, 30, 0x10);
  10830. ++ rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
  10831. ++ rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
  10832. ++ rt2800_rfcsr_write(rt2x00dev, 33, 0x00);
  10833. ++ rt2800_rfcsr_write(rt2x00dev, 34, 0x20);
  10834. ++ rt2800_rfcsr_write(rt2x00dev, 35, 0x00);
  10835. ++ rt2800_rfcsr_write(rt2x00dev, 36, 0x00);
  10836. ++ rt2800_rfcsr_write(rt2x00dev, 37, 0x00);
  10837. ++ rt2800_rfcsr_write(rt2x00dev, 38, 0x86);
  10838. ++ rt2800_rfcsr_write(rt2x00dev, 39, 0x23);
  10839. ++ rt2800_rfcsr_write(rt2x00dev, 40, 0x00);
  10840. ++ rt2800_rfcsr_write(rt2x00dev, 41, 0x00);
  10841. ++ rt2800_rfcsr_write(rt2x00dev, 42, 0x00);
  10842. ++ rt2800_rfcsr_write(rt2x00dev, 43, 0x00);
  10843. ++ rt2800_rfcsr_write(rt2x00dev, 44, 0x93);
  10844. ++ rt2800_rfcsr_write(rt2x00dev, 45, 0xbb);
  10845. ++ rt2800_rfcsr_write(rt2x00dev, 46, 0x60);
  10846. ++ rt2800_rfcsr_write(rt2x00dev, 47, 0x00);
  10847. ++ rt2800_rfcsr_write(rt2x00dev, 48, 0x00);
  10848. ++ rt2800_rfcsr_write(rt2x00dev, 49, 0x8e);
  10849. ++ rt2800_rfcsr_write(rt2x00dev, 50, 0x86);
  10850. ++ rt2800_rfcsr_write(rt2x00dev, 51, 0x51);
  10851. ++ rt2800_rfcsr_write(rt2x00dev, 52, 0x05);
  10852. ++ rt2800_rfcsr_write(rt2x00dev, 53, 0x76);
  10853. ++ rt2800_rfcsr_write(rt2x00dev, 54, 0x76);
  10854. ++ rt2800_rfcsr_write(rt2x00dev, 55, 0x76);
  10855. ++ rt2800_rfcsr_write(rt2x00dev, 56, 0xdb);
  10856. ++ rt2800_rfcsr_write(rt2x00dev, 57, 0x3e);
  10857. ++ rt2800_rfcsr_write(rt2x00dev, 58, 0x00);
  10858. ++ rt2800_rfcsr_write(rt2x00dev, 59, 0x00);
  10859. ++ rt2800_rfcsr_write(rt2x00dev, 60, 0x00);
  10860. ++ rt2800_rfcsr_write(rt2x00dev, 61, 0x00);
  10861. ++ rt2800_rfcsr_write(rt2x00dev, 62, 0x00);
  10862. ++ rt2800_rfcsr_write(rt2x00dev, 63, 0x00);
  10863. ++
  10864. ++ /* TODO: rx filter calibration? */
  10865. ++
  10866. ++ rt2800_bbp_write(rt2x00dev, 137, 0x0f);
  10867. ++
  10868. ++ rt2800_bbp_write(rt2x00dev, 163, 0x9d);
  10869. ++
  10870. ++ rt2800_bbp_write(rt2x00dev, 105, 0x05);
  10871. ++
  10872. ++ rt2800_bbp_write(rt2x00dev, 179, 0x02);
  10873. ++ rt2800_bbp_write(rt2x00dev, 180, 0x00);
  10874. ++ rt2800_bbp_write(rt2x00dev, 182, 0x40);
  10875. ++ rt2800_bbp_write(rt2x00dev, 180, 0x01);
  10876. ++ rt2800_bbp_write(rt2x00dev, 182, 0x9c);
  10877. ++
  10878. ++ rt2800_bbp_write(rt2x00dev, 179, 0x00);
  10879. ++
  10880. ++ rt2800_bbp_write(rt2x00dev, 142, 0x04);
  10881. ++ rt2800_bbp_write(rt2x00dev, 143, 0x3b);
  10882. ++ rt2800_bbp_write(rt2x00dev, 142, 0x06);
  10883. ++ rt2800_bbp_write(rt2x00dev, 143, 0xa0);
  10884. ++ rt2800_bbp_write(rt2x00dev, 142, 0x07);
  10885. ++ rt2800_bbp_write(rt2x00dev, 143, 0xa1);
  10886. ++ rt2800_bbp_write(rt2x00dev, 142, 0x08);
  10887. ++ rt2800_bbp_write(rt2x00dev, 143, 0xa2);
  10888. ++ rt2800_bbp_write(rt2x00dev, 148, 0xc8);
  10889. ++
  10890. ++ if (eco == 5) {
  10891. ++ rt2800_rfcsr_write(rt2x00dev, 32, 0xd8);
  10892. ++ rt2800_rfcsr_write(rt2x00dev, 33, 0x32);
  10893. ++ }
  10894. ++
  10895. ++ rt2800_rfcsr_read(rt2x00dev, 2, &rfcsr);
  10896. ++ rt2x00_set_field8(&rfcsr, RFCSR2_RESCAL_BP, 0);
  10897. ++ rt2x00_set_field8(&rfcsr, RFCSR2_RESCAL_EN, 1);
  10898. ++ rt2800_rfcsr_write(rt2x00dev, 2, rfcsr);
  10899. ++ msleep(1);
  10900. ++ rt2x00_set_field8(&rfcsr, RFCSR2_RESCAL_EN, 0);
  10901. ++ rt2800_rfcsr_write(rt2x00dev, 2, rfcsr);
  10902. ++
  10903. ++ rt2800_rfcsr_read(rt2x00dev, 1, &rfcsr);
  10904. ++ rt2x00_set_field8(&rfcsr, RFCSR1_RF_BLOCK_EN, 1);
  10905. ++ rt2800_rfcsr_write(rt2x00dev, 1, rfcsr);
  10906. ++
  10907. ++ rt2800_rfcsr_read(rt2x00dev, 6, &rfcsr);
  10908. ++ rfcsr |= 0xc0;
  10909. ++ rt2800_rfcsr_write(rt2x00dev, 6, rfcsr);
  10910. ++
  10911. ++ rt2800_rfcsr_read(rt2x00dev, 22, &rfcsr);
  10912. ++ rfcsr |= 0x20;
  10913. ++ rt2800_rfcsr_write(rt2x00dev, 22, rfcsr);
  10914. ++
  10915. ++ rt2800_rfcsr_read(rt2x00dev, 46, &rfcsr);
  10916. ++ rfcsr |= 0x20;
  10917. ++ rt2800_rfcsr_write(rt2x00dev, 46, rfcsr);
  10918. ++
  10919. ++ rt2800_rfcsr_read(rt2x00dev, 20, &rfcsr);
  10920. ++ rfcsr &= ~0xee;
  10921. ++ rt2800_rfcsr_write(rt2x00dev, 20, rfcsr);
  10922. ++}
  10923. ++
  10924. + static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev)
  10925. + {
  10926. + rt2800_rf_init_calibration(rt2x00dev, 2);
  10927. +@@ -7042,6 +7180,9 @@ static void rt2800_init_rfcsr(struct rt2
  10928. + case RT3390:
  10929. + rt2800_init_rfcsr_3390(rt2x00dev);
  10930. + break;
  10931. ++ case RT3883:
  10932. ++ rt2800_init_rfcsr_3883(rt2x00dev);
  10933. ++ break;
  10934. + case RT3572:
  10935. + rt2800_init_rfcsr_3572(rt2x00dev);
  10936. + break;
  10937. diff --git a/package/mac80211/patches/600-0018-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch b/package/mac80211/patches/600-0018-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch
  10938. new file mode 100644
  10939. index 0000000..57af961
  10940. --- /dev/null
  10941. +++ b/package/mac80211/patches/600-0018-rt2x00-rt2800lib-use-the-extended-EEPROM-map-for-RT3.patch
  10942. @@ -0,0 +1,22 @@
  10943. +From 86022438ffeb1b87dfcd018bf477fdbb43076691 Mon Sep 17 00:00:00 2001
  10944. +From: Gabor Juhos <juhosg@openwrt.org>
  10945. +Date: Wed, 8 May 2013 19:35:33 +0200
  10946. +Subject: [PATCH] rt2x00: rt2800lib: use the extended EEPROM map for RT3883
  10947. +
  10948. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  10949. +---
  10950. + drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++-
  10951. + 1 file changed, 2 insertions(+), 1 deletion(-)
  10952. +
  10953. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  10954. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  10955. +@@ -342,7 +342,8 @@ static unsigned int rt2800_eeprom_word_i
  10956. + wiphy_name(rt2x00dev->hw->wiphy), word))
  10957. + return 0;
  10958. +
  10959. +- if (rt2x00_rt(rt2x00dev, RT3593))
  10960. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  10961. ++ rt2x00_rt(rt2x00dev, RT3883))
  10962. + map = rt2800_eeprom_map_ext;
  10963. + else
  10964. + map = rt2800_eeprom_map;
  10965. diff --git a/package/mac80211/patches/600-0019-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch b/package/mac80211/patches/600-0019-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch
  10966. new file mode 100644
  10967. index 0000000..47eece0
  10968. --- /dev/null
  10969. +++ b/package/mac80211/patches/600-0019-rt2x00-rt2800lib-force-rf-type-to-RF3853-on-RT3883.patch
  10970. @@ -0,0 +1,21 @@
  10971. +From 4cf5403f02fa65dc2207f61d223cffa9ae50e907 Mon Sep 17 00:00:00 2001
  10972. +From: Gabor Juhos <juhosg@openwrt.org>
  10973. +Date: Thu, 1 Aug 2013 14:48:21 +0200
  10974. +Subject: [PATCH] rt2x00: rt2800lib: force rf type to RF3853 on RT3883
  10975. +
  10976. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  10977. +---
  10978. + drivers/net/wireless/rt2x00/rt2800lib.c | 2 ++
  10979. + 1 file changed, 2 insertions(+)
  10980. +
  10981. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  10982. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  10983. +@@ -7579,6 +7579,8 @@ static int rt2800_init_eeprom(struct rt2
  10984. + rt2x00_rt(rt2x00dev, RT5390) ||
  10985. + rt2x00_rt(rt2x00dev, RT5392))
  10986. + rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf);
  10987. ++ else if (rt2x00_rt(rt2x00dev, RT3883))
  10988. ++ rf = RF3853;
  10989. + else
  10990. + rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE);
  10991. +
  10992. diff --git a/package/mac80211/patches/600-0020-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch b/package/mac80211/patches/600-0020-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch
  10993. new file mode 100644
  10994. index 0000000..d9cbb33
  10995. --- /dev/null
  10996. +++ b/package/mac80211/patches/600-0020-rt2x00-rt2800lib-add-channel-configuration-code-for-.patch
  10997. @@ -0,0 +1,136 @@
  10998. +From 269f19c848a2380db03a3f207cafb88e28d71c53 Mon Sep 17 00:00:00 2001
  10999. +From: Gabor Juhos <juhosg@openwrt.org>
  11000. +Date: Sun, 24 Mar 2013 19:26:28 +0100
  11001. +Subject: [PATCH] rt2x00: rt2800lib: add channel configuration code for RT3883
  11002. +
  11003. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11004. +---
  11005. + drivers/net/wireless/rt2x00/rt2800lib.c | 72 +++++++++++++++++++++++++++++--
  11006. + 1 file changed, 69 insertions(+), 3 deletions(-)
  11007. +
  11008. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11009. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11010. +@@ -3385,6 +3385,36 @@ static char rt2800_txpower_to_dev(struct
  11011. + return clamp_t(char, txpower, MIN_A_TXPOWER, MAX_A_TXPOWER);
  11012. + }
  11013. +
  11014. ++static void rt3883_bbp_adjust(struct rt2x00_dev *rt2x00dev,
  11015. ++ struct rf_channel *rf)
  11016. ++{
  11017. ++ u8 bbp;
  11018. ++
  11019. ++ bbp = (rf->channel > 14) ? 0x48 : 0x38;
  11020. ++ rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, bbp);
  11021. ++
  11022. ++ rt2800_bbp_write(rt2x00dev, 69, 0x12);
  11023. ++
  11024. ++ if (rf->channel <= 14) {
  11025. ++ rt2800_bbp_write(rt2x00dev, 70, 0x0a);
  11026. ++ } else {
  11027. ++ /* Disable CCK packet detection */
  11028. ++ rt2800_bbp_write(rt2x00dev, 70, 0x00);
  11029. ++ }
  11030. ++
  11031. ++ rt2800_bbp_write(rt2x00dev, 73, 0x10);
  11032. ++
  11033. ++ if (rf->channel > 14) {
  11034. ++ rt2800_bbp_write(rt2x00dev, 62, 0x1d);
  11035. ++ rt2800_bbp_write(rt2x00dev, 63, 0x1d);
  11036. ++ rt2800_bbp_write(rt2x00dev, 64, 0x1d);
  11037. ++ } else {
  11038. ++ rt2800_bbp_write(rt2x00dev, 62, 0x2d);
  11039. ++ rt2800_bbp_write(rt2x00dev, 63, 0x2d);
  11040. ++ rt2800_bbp_write(rt2x00dev, 64, 0x2d);
  11041. ++ }
  11042. ++}
  11043. ++
  11044. + static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
  11045. + struct ieee80211_conf *conf,
  11046. + struct rf_channel *rf,
  11047. +@@ -3403,6 +3433,12 @@ static void rt2800_config_channel(struct
  11048. + rt2800_txpower_to_dev(rt2x00dev, rf->channel,
  11049. + info->default_power3);
  11050. +
  11051. ++ switch (rt2x00dev->chip.rt) {
  11052. ++ case RT3883:
  11053. ++ rt3883_bbp_adjust(rt2x00dev, rf);
  11054. ++ break;
  11055. ++ }
  11056. ++
  11057. + switch (rt2x00dev->chip.rf) {
  11058. + case RF2020:
  11059. + case RF3020:
  11060. +@@ -3484,6 +3520,15 @@ static void rt2800_config_channel(struct
  11061. + rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
  11062. + rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
  11063. + rt2800_bbp_write(rt2x00dev, 77, 0x98);
  11064. ++ } else if (rt2x00_rt(rt2x00dev, RT3883)) {
  11065. ++ rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
  11066. ++ rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
  11067. ++ rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
  11068. ++
  11069. ++ if (rt2x00dev->default_ant.rx_chain_num > 1)
  11070. ++ rt2800_bbp_write(rt2x00dev, 86, 0x46);
  11071. ++ else
  11072. ++ rt2800_bbp_write(rt2x00dev, 86, 0);
  11073. + } else {
  11074. + rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
  11075. + rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
  11076. +@@ -3496,6 +3541,7 @@ static void rt2800_config_channel(struct
  11077. + !rt2x00_rt(rt2x00dev, RT5392)) {
  11078. + if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
  11079. + rt2800_bbp_write(rt2x00dev, 82, 0x62);
  11080. ++ rt2800_bbp_write(rt2x00dev, 82, 0x62);
  11081. + rt2800_bbp_write(rt2x00dev, 75, 0x46);
  11082. + } else {
  11083. + if (rt2x00_rt(rt2x00dev, RT3593))
  11084. +@@ -3504,19 +3550,22 @@ static void rt2800_config_channel(struct
  11085. + rt2800_bbp_write(rt2x00dev, 82, 0x84);
  11086. + rt2800_bbp_write(rt2x00dev, 75, 0x50);
  11087. + }
  11088. +- if (rt2x00_rt(rt2x00dev, RT3593))
  11089. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11090. ++ rt2x00_rt(rt2x00dev, RT3883))
  11091. + rt2800_bbp_write(rt2x00dev, 83, 0x8a);
  11092. + }
  11093. +
  11094. + } else {
  11095. + if (rt2x00_rt(rt2x00dev, RT3572))
  11096. + rt2800_bbp_write(rt2x00dev, 82, 0x94);
  11097. +- else if (rt2x00_rt(rt2x00dev, RT3593))
  11098. ++ else if (rt2x00_rt(rt2x00dev, RT3593) ||
  11099. ++ rt2x00_rt(rt2x00dev, RT3883))
  11100. + rt2800_bbp_write(rt2x00dev, 82, 0x82);
  11101. + else
  11102. + rt2800_bbp_write(rt2x00dev, 82, 0xf2);
  11103. +
  11104. +- if (rt2x00_rt(rt2x00dev, RT3593))
  11105. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11106. ++ rt2x00_rt(rt2x00dev, RT3883))
  11107. + rt2800_bbp_write(rt2x00dev, 83, 0x9a);
  11108. +
  11109. + if (rt2x00_has_cap_external_lna_a(rt2x00dev))
  11110. +@@ -3638,6 +3687,23 @@ static void rt2800_config_channel(struct
  11111. +
  11112. + rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
  11113. +
  11114. ++ usleep_range(1000, 1500);
  11115. ++ }
  11116. ++
  11117. ++ if (rt2x00_rt(rt2x00dev, RT3883)) {
  11118. ++ if (!conf_is_ht40(conf))
  11119. ++ rt2800_bbp_write(rt2x00dev, 105, 0x34);
  11120. ++ else
  11121. ++ rt2800_bbp_write(rt2x00dev, 105, 0x04);
  11122. ++
  11123. ++ /* AGC init */
  11124. ++ if (rf->channel <= 14)
  11125. ++ reg = 0x2e + rt2x00dev->lna_gain;
  11126. ++ else
  11127. ++ reg = 0x20 + ((rt2x00dev->lna_gain * 5) / 3);
  11128. ++
  11129. ++ rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
  11130. ++
  11131. + usleep_range(1000, 1500);
  11132. + }
  11133. +
  11134. diff --git a/package/mac80211/patches/600-0021-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch b/package/mac80211/patches/600-0021-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch
  11135. new file mode 100644
  11136. index 0000000..c927e45
  11137. --- /dev/null
  11138. +++ b/package/mac80211/patches/600-0021-rt2x00-rt2800lib-fix-txpower_to_dev-function-for-RT3.patch
  11139. @@ -0,0 +1,30 @@
  11140. +From e37d93abaabe3ab72b0332a18092acc162307274 Mon Sep 17 00:00:00 2001
  11141. +From: Gabor Juhos <juhosg@openwrt.org>
  11142. +Date: Mon, 30 Sep 2013 13:57:26 +0200
  11143. +Subject: [PATCH] rt2x00: rt2800lib: fix txpower_to_dev function for RT3883
  11144. +
  11145. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11146. +---
  11147. + drivers/net/wireless/rt2x00/rt2800lib.c | 6 ++++--
  11148. + 1 file changed, 4 insertions(+), 2 deletions(-)
  11149. +
  11150. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11151. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11152. +@@ -3372,13 +3372,15 @@ static char rt2800_txpower_to_dev(struct
  11153. + unsigned int channel,
  11154. + char txpower)
  11155. + {
  11156. +- if (rt2x00_rt(rt2x00dev, RT3593))
  11157. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11158. ++ rt2x00_rt(rt2x00dev, RT3883))
  11159. + txpower = rt2x00_get_field8(txpower, EEPROM_TXPOWER_ALC);
  11160. +
  11161. + if (channel <= 14)
  11162. + return clamp_t(char, txpower, MIN_G_TXPOWER, MAX_G_TXPOWER);
  11163. +
  11164. +- if (rt2x00_rt(rt2x00dev, RT3593))
  11165. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11166. ++ rt2x00_rt(rt2x00dev, RT3883))
  11167. + return clamp_t(char, txpower, MIN_A_TXPOWER_3593,
  11168. + MAX_A_TXPOWER_3593);
  11169. + else
  11170. diff --git a/package/mac80211/patches/600-0022-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch b/package/mac80211/patches/600-0022-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch
  11171. new file mode 100644
  11172. index 0000000..df826e5
  11173. --- /dev/null
  11174. +++ b/package/mac80211/patches/600-0022-rt2x00-rt2800lib-use-correct-txpower-calculation-fun.patch
  11175. @@ -0,0 +1,23 @@
  11176. +From c4d79e344bd580d85821390d49f92dced7d8e125 Mon Sep 17 00:00:00 2001
  11177. +From: Gabor Juhos <juhosg@openwrt.org>
  11178. +Date: Sun, 24 Mar 2013 19:26:29 +0100
  11179. +Subject: [PATCH] rt2x00: rt2800lib: use correct txpower calculation function
  11180. + for RT3883
  11181. +
  11182. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11183. +---
  11184. + drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++-
  11185. + 1 file changed, 2 insertions(+), 1 deletion(-)
  11186. +
  11187. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11188. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11189. +@@ -4582,7 +4582,8 @@ static void rt2800_config_txpower(struct
  11190. + struct ieee80211_channel *chan,
  11191. + int power_level)
  11192. + {
  11193. +- if (rt2x00_rt(rt2x00dev, RT3593))
  11194. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11195. ++ rt2x00_rt(rt2x00dev, RT3883))
  11196. + rt2800_config_txpower_rt3593(rt2x00dev, chan, power_level);
  11197. + else
  11198. + rt2800_config_txpower_rt28xx(rt2x00dev, chan, power_level);
  11199. diff --git a/package/mac80211/patches/600-0023-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch b/package/mac80211/patches/600-0023-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch
  11200. new file mode 100644
  11201. index 0000000..8a43df2
  11202. --- /dev/null
  11203. +++ b/package/mac80211/patches/600-0023-rt2x00-rt2800lib-hardcode-txmixer-gain-values-to-zer.patch
  11204. @@ -0,0 +1,33 @@
  11205. +From caea0671cd8fd9ade4f5969cbe0ee545e94ae105 Mon Sep 17 00:00:00 2001
  11206. +From: Gabor Juhos <juhosg@openwrt.org>
  11207. +Date: Sat, 24 Aug 2013 11:49:55 +0200
  11208. +Subject: [PATCH] rt2x00: rt2800lib: hardcode txmixer gain values to zero for
  11209. + RT3883
  11210. +
  11211. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11212. +---
  11213. + drivers/net/wireless/rt2x00/rt2800lib.c | 6 ++++--
  11214. + 1 file changed, 4 insertions(+), 2 deletions(-)
  11215. +
  11216. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11217. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11218. +@@ -7461,7 +7461,8 @@ static u8 rt2800_get_txmixer_gain_24g(st
  11219. + {
  11220. + u16 word;
  11221. +
  11222. +- if (rt2x00_rt(rt2x00dev, RT3593))
  11223. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11224. ++ rt2x00_rt(rt2x00dev, RT3883))
  11225. + return 0;
  11226. +
  11227. + rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_BG, &word);
  11228. +@@ -7475,7 +7476,8 @@ static u8 rt2800_get_txmixer_gain_5g(str
  11229. + {
  11230. + u16 word;
  11231. +
  11232. +- if (rt2x00_rt(rt2x00dev, RT3593))
  11233. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11234. ++ rt2x00_rt(rt2x00dev, RT3883))
  11235. + return 0;
  11236. +
  11237. + rt2800_eeprom_read(rt2x00dev, EEPROM_TXMIXER_GAIN_A, &word);
  11238. diff --git a/package/mac80211/patches/600-0024-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch b/package/mac80211/patches/600-0024-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch
  11239. new file mode 100644
  11240. index 0000000..53435aa
  11241. --- /dev/null
  11242. +++ b/package/mac80211/patches/600-0024-rt2x00-rt2800lib-use-correct-RT-XWI-size-for-RT3883.patch
  11243. @@ -0,0 +1,20 @@
  11244. +From 11c40fb47c4a4dd6ad060c2ae127ced89ffb9fe1 Mon Sep 17 00:00:00 2001
  11245. +From: Gabor Juhos <juhosg@openwrt.org>
  11246. +Date: Thu, 18 Apr 2013 14:33:33 +0200
  11247. +Subject: [PATCH] rt2x00: rt2800lib: use correct [RT]XWI size for RT3883
  11248. +
  11249. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11250. +---
  11251. + drivers/net/wireless/rt2x00/rt2800lib.c | 1 +
  11252. + 1 file changed, 1 insertion(+)
  11253. +
  11254. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11255. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11256. +@@ -558,6 +558,7 @@ void rt2800_get_txwi_rxwi_size(struct rt
  11257. + {
  11258. + switch (rt2x00dev->chip.rt) {
  11259. + case RT3593:
  11260. ++ case RT3883:
  11261. + *txwi_size = TXWI_DESC_SIZE_4WORDS;
  11262. + *rxwi_size = RXWI_DESC_SIZE_5WORDS;
  11263. + break;
  11264. diff --git a/package/mac80211/patches/600-0025-rt2x00-rt2800lib-use-correct-beacon-base-for-RT3883.patch b/package/mac80211/patches/600-0025-rt2x00-rt2800lib-use-correct-beacon-base-for-RT3883.patch
  11265. new file mode 100644
  11266. index 0000000..08f3f88
  11267. --- /dev/null
  11268. +++ b/package/mac80211/patches/600-0025-rt2x00-rt2800lib-use-correct-beacon-base-for-RT3883.patch
  11269. @@ -0,0 +1,22 @@
  11270. +From b403bdfa00665ce6b53583bdb837ffad0b91c09f Mon Sep 17 00:00:00 2001
  11271. +From: Gabor Juhos <juhosg@openwrt.org>
  11272. +Date: Sun, 24 Mar 2013 19:26:29 +0100
  11273. +Subject: [PATCH] rt2x00: rt2800lib: use correct beacon base for RT3883
  11274. +
  11275. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11276. +---
  11277. + drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++-
  11278. + 1 file changed, 2 insertions(+), 1 deletion(-)
  11279. +
  11280. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11281. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11282. +@@ -983,7 +983,8 @@ EXPORT_SYMBOL_GPL(rt2800_txdone_entry);
  11283. + static unsigned int rt2800_hw_beacon_base(struct rt2x00_dev *rt2x00dev,
  11284. + unsigned int index)
  11285. + {
  11286. +- if (rt2x00_rt(rt2x00dev, RT3593))
  11287. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11288. ++ rt2x00_rt(rt2x00dev, RT3883))
  11289. + return HW_BEACON_BASE_HIGH(index);
  11290. +
  11291. + return HW_BEACON_BASE(index);
  11292. diff --git a/package/mac80211/patches/600-0026-rt2x00-rt2800lib-use-correct-beacon-count-for-RT3883.patch b/package/mac80211/patches/600-0026-rt2x00-rt2800lib-use-correct-beacon-count-for-RT3883.patch
  11293. new file mode 100644
  11294. index 0000000..cb7a0ae
  11295. --- /dev/null
  11296. +++ b/package/mac80211/patches/600-0026-rt2x00-rt2800lib-use-correct-beacon-count-for-RT3883.patch
  11297. @@ -0,0 +1,22 @@
  11298. +From 74b7eaf75fc6eb86292056ef705e543f9cd6086b Mon Sep 17 00:00:00 2001
  11299. +From: Gabor Juhos <juhosg@openwrt.org>
  11300. +Date: Sun, 18 Aug 2013 09:57:58 +0200
  11301. +Subject: [PATCH] rt2x00: rt2800lib: use correct beacon count for RT3883
  11302. +
  11303. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11304. +---
  11305. + drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++-
  11306. + 1 file changed, 2 insertions(+), 1 deletion(-)
  11307. +
  11308. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11309. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11310. +@@ -8393,7 +8393,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r
  11311. + if (rt2x00_rt(rt2x00dev, RT3593))
  11312. + __set_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags);
  11313. +
  11314. +- if (rt2x00_rt(rt2x00dev, RT3593))
  11315. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11316. ++ rt2x00_rt(rt2x00dev, RT3883))
  11317. + drv_data->hw_beacon_count = 16;
  11318. + else
  11319. + drv_data->hw_beacon_count = 8;
  11320. diff --git a/package/mac80211/patches/600-0027-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch b/package/mac80211/patches/600-0027-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch
  11321. new file mode 100644
  11322. index 0000000..0919f90
  11323. --- /dev/null
  11324. +++ b/package/mac80211/patches/600-0027-rt2x00-rt2800lib-fix-antenna-configuration-for-RT388.patch
  11325. @@ -0,0 +1,22 @@
  11326. +From fa5ad9c025610c22048add2f0ad03f62b6ca1e74 Mon Sep 17 00:00:00 2001
  11327. +From: Gabor Juhos <juhosg@openwrt.org>
  11328. +Date: Mon, 30 Sep 2013 16:53:33 +0200
  11329. +Subject: [PATCH] rt2x00: rt2800lib: fix antenna configuration for RT3883
  11330. +
  11331. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11332. +---
  11333. + drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++-
  11334. + 1 file changed, 2 insertions(+), 1 deletion(-)
  11335. +
  11336. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11337. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11338. +@@ -1917,7 +1917,8 @@ void rt2800_config_ant(struct rt2x00_dev
  11339. + rt2800_bbp_write(rt2x00dev, 3, r3);
  11340. + rt2800_bbp_write(rt2x00dev, 1, r1);
  11341. +
  11342. +- if (rt2x00_rt(rt2x00dev, RT3593)) {
  11343. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11344. ++ rt2x00_rt(rt2x00dev, RT3883)) {
  11345. + if (ant->rx_chain_num == 1)
  11346. + rt2800_bbp_write(rt2x00dev, 86, 0x00);
  11347. + else
  11348. diff --git a/package/mac80211/patches/600-0028-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch b/package/mac80211/patches/600-0028-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch
  11349. new file mode 100644
  11350. index 0000000..e38ba78
  11351. --- /dev/null
  11352. +++ b/package/mac80211/patches/600-0028-rt2x00-rt2800lib-fix-LNA-gain-configuration-for-RT38.patch
  11353. @@ -0,0 +1,32 @@
  11354. +From 6d668fef3a1baa60bdd715ee062ddb6333d2647c Mon Sep 17 00:00:00 2001
  11355. +From: Gabor Juhos <juhosg@openwrt.org>
  11356. +Date: Mon, 30 Sep 2013 16:58:23 +0200
  11357. +Subject: [PATCH] rt2x00: rt2800lib: fix LNA gain configuration for RT3883
  11358. +
  11359. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11360. +---
  11361. + drivers/net/wireless/rt2x00/rt2800lib.c | 6 ++++--
  11362. + 1 file changed, 4 insertions(+), 2 deletions(-)
  11363. +
  11364. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11365. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11366. +@@ -1940,7 +1940,8 @@ static void rt2800_config_lna_gain(struc
  11367. + rt2800_eeprom_read(rt2x00dev, EEPROM_LNA, &eeprom);
  11368. + lna_gain = rt2x00_get_field16(eeprom, EEPROM_LNA_A0);
  11369. + } else if (libconf->rf.channel <= 128) {
  11370. +- if (rt2x00_rt(rt2x00dev, RT3593)) {
  11371. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11372. ++ rt2x00_rt(rt2x00dev, RT3883)) {
  11373. + rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2, &eeprom);
  11374. + lna_gain = rt2x00_get_field16(eeprom,
  11375. + EEPROM_EXT_LNA2_A1);
  11376. +@@ -1950,7 +1951,8 @@ static void rt2800_config_lna_gain(struc
  11377. + EEPROM_RSSI_BG2_LNA_A1);
  11378. + }
  11379. + } else {
  11380. +- if (rt2x00_rt(rt2x00dev, RT3593)) {
  11381. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11382. ++ rt2x00_rt(rt2x00dev, RT3883)) {
  11383. + rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2, &eeprom);
  11384. + lna_gain = rt2x00_get_field16(eeprom,
  11385. + EEPROM_EXT_LNA2_A2);
  11386. diff --git a/package/mac80211/patches/600-0029-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch b/package/mac80211/patches/600-0029-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch
  11387. new file mode 100644
  11388. index 0000000..4684599
  11389. --- /dev/null
  11390. +++ b/package/mac80211/patches/600-0029-rt2x00-rt2800lib-fix-VGC-setup-for-RT3883.patch
  11391. @@ -0,0 +1,44 @@
  11392. +From c49b2d829aa1c816a46a577cdec6d2ff14d9f06e Mon Sep 17 00:00:00 2001
  11393. +From: Gabor Juhos <juhosg@openwrt.org>
  11394. +Date: Tue, 1 Oct 2013 15:40:08 +0200
  11395. +Subject: [PATCH] rt2x00: rt2800lib: fix VGC setup for RT3883
  11396. +
  11397. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11398. +---
  11399. + drivers/net/wireless/rt2x00/rt2800lib.c | 11 +++++++++--
  11400. + 1 file changed, 9 insertions(+), 2 deletions(-)
  11401. +
  11402. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11403. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11404. +@@ -4781,7 +4781,8 @@ static u8 rt2800_get_default_vgc(struct
  11405. + else
  11406. + vgc = 0x2e + rt2x00dev->lna_gain;
  11407. + } else { /* 5GHZ band */
  11408. +- if (rt2x00_rt(rt2x00dev, RT3593))
  11409. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11410. ++ rt2x00_rt(rt2x00dev, RT3883))
  11411. + vgc = 0x20 + (rt2x00dev->lna_gain * 5) / 3;
  11412. + else if (rt2x00_rt(rt2x00dev, RT5592))
  11413. + vgc = 0x24 + (2 * rt2x00dev->lna_gain);
  11414. +@@ -4801,7 +4802,8 @@ static inline void rt2800_set_vgc(struct
  11415. + {
  11416. + if (qual->vgc_level != vgc_level) {
  11417. + if (rt2x00_rt(rt2x00dev, RT3572) ||
  11418. +- rt2x00_rt(rt2x00dev, RT3593)) {
  11419. ++ rt2x00_rt(rt2x00dev, RT3593) ||
  11420. ++ rt2x00_rt(rt2x00dev, RT3883)) {
  11421. + rt2800_bbp_write_with_rx_chain(rt2x00dev, 66,
  11422. + vgc_level);
  11423. + } else if (rt2x00_rt(rt2x00dev, RT5592)) {
  11424. +@@ -4848,6 +4850,11 @@ void rt2800_link_tuner(struct rt2x00_dev
  11425. + }
  11426. + break;
  11427. +
  11428. ++ case RT3883:
  11429. ++ if (qual->rssi > -65)
  11430. ++ vgc += 0x10;
  11431. ++ break;
  11432. ++
  11433. + case RT5592:
  11434. + if (qual->rssi > -65)
  11435. + vgc += 0x20;
  11436. diff --git a/package/mac80211/patches/600-0030-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch b/package/mac80211/patches/600-0030-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch
  11437. new file mode 100644
  11438. index 0000000..bc1548d
  11439. --- /dev/null
  11440. +++ b/package/mac80211/patches/600-0030-rt2x00-rt2800lib-fix-EEPROM-LNA-validation-for-RT388.patch
  11441. @@ -0,0 +1,42 @@
  11442. +From 1616650aea676541d4dc8adc6f4219856d193c8b Mon Sep 17 00:00:00 2001
  11443. +From: Gabor Juhos <juhosg@openwrt.org>
  11444. +Date: Tue, 1 Oct 2013 17:27:57 +0200
  11445. +Subject: [PATCH] rt2x00: rt2800lib: fix EEPROM LNA validation for RT3883
  11446. +
  11447. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11448. +---
  11449. + drivers/net/wireless/rt2x00/rt2800lib.c | 9 ++++++---
  11450. + 1 file changed, 6 insertions(+), 3 deletions(-)
  11451. +
  11452. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11453. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11454. +@@ -7598,7 +7598,8 @@ static int rt2800_validate_eeprom(struct
  11455. + rt2800_eeprom_read(rt2x00dev, EEPROM_RSSI_BG2, &word);
  11456. + if (abs(rt2x00_get_field16(word, EEPROM_RSSI_BG2_OFFSET2)) > 10)
  11457. + rt2x00_set_field16(&word, EEPROM_RSSI_BG2_OFFSET2, 0);
  11458. +- if (!rt2x00_rt(rt2x00dev, RT3593)) {
  11459. ++ if (!rt2x00_rt(rt2x00dev, RT3593) &&
  11460. ++ !rt2x00_rt(rt2x00dev, RT3883)) {
  11461. + if (rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0x00 ||
  11462. + rt2x00_get_field16(word, EEPROM_RSSI_BG2_LNA_A1) == 0xff)
  11463. + rt2x00_set_field16(&word, EEPROM_RSSI_BG2_LNA_A1,
  11464. +@@ -7618,7 +7619,8 @@ static int rt2800_validate_eeprom(struct
  11465. + rt2800_eeprom_read(rt2x00dev, EEPROM_RSSI_A2, &word);
  11466. + if (abs(rt2x00_get_field16(word, EEPROM_RSSI_A2_OFFSET2)) > 10)
  11467. + rt2x00_set_field16(&word, EEPROM_RSSI_A2_OFFSET2, 0);
  11468. +- if (!rt2x00_rt(rt2x00dev, RT3593)) {
  11469. ++ if (!rt2x00_rt(rt2x00dev, RT3593) &&
  11470. ++ !rt2x00_rt(rt2x00dev, RT3883)) {
  11471. + if (rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0x00 ||
  11472. + rt2x00_get_field16(word, EEPROM_RSSI_A2_LNA_A2) == 0xff)
  11473. + rt2x00_set_field16(&word, EEPROM_RSSI_A2_LNA_A2,
  11474. +@@ -7626,7 +7628,8 @@ static int rt2800_validate_eeprom(struct
  11475. + }
  11476. + rt2800_eeprom_write(rt2x00dev, EEPROM_RSSI_A2, word);
  11477. +
  11478. +- if (rt2x00_rt(rt2x00dev, RT3593)) {
  11479. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11480. ++ rt2x00_rt(rt2x00dev, RT3883)) {
  11481. + rt2800_eeprom_read(rt2x00dev, EEPROM_EXT_LNA2, &word);
  11482. + if (rt2x00_get_field16(word, EEPROM_EXT_LNA2_A1) == 0x00 ||
  11483. + rt2x00_get_field16(word, EEPROM_EXT_LNA2_A1) == 0xff)
  11484. diff --git a/package/mac80211/patches/600-0031-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch b/package/mac80211/patches/600-0031-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch
  11485. new file mode 100644
  11486. index 0000000..d6295f4
  11487. --- /dev/null
  11488. +++ b/package/mac80211/patches/600-0031-rt2x00-rt2800lib-fix-txpower-compensation-for-RT3883.patch
  11489. @@ -0,0 +1,22 @@
  11490. +From e3871034a0e7c8a95152dc3eafbcc4535398cbdc Mon Sep 17 00:00:00 2001
  11491. +From: Gabor Juhos <juhosg@openwrt.org>
  11492. +Date: Wed, 2 Oct 2013 10:11:59 +0200
  11493. +Subject: [PATCH] rt2x00: rt2800lib: fix txpower compensation for RT3883
  11494. +
  11495. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11496. +---
  11497. + drivers/net/wireless/rt2x00/rt2800lib.c | 3 +++
  11498. + 1 file changed, 3 insertions(+)
  11499. +
  11500. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11501. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11502. +@@ -3959,6 +3959,9 @@ static u8 rt2800_compensate_txpower(stru
  11503. + if (rt2x00_rt(rt2x00dev, RT3593))
  11504. + return min_t(u8, txpower, 0xc);
  11505. +
  11506. ++ if (rt2x00_rt(rt2x00dev, RT3883))
  11507. ++ return min_t(u8, txpower, 0xf);
  11508. ++
  11509. + if (rt2x00_has_cap_power_limit(rt2x00dev)) {
  11510. + /*
  11511. + * Check if eirp txpower exceed txpower_limit.
  11512. diff --git a/package/mac80211/patches/600-0032-rt2x00-rt2800lib-enable-RT2800_HAS_HIGH_SHARED_MEM-f.patch b/package/mac80211/patches/600-0032-rt2x00-rt2800lib-enable-RT2800_HAS_HIGH_SHARED_MEM-f.patch
  11513. new file mode 100644
  11514. index 0000000..c5f226a
  11515. --- /dev/null
  11516. +++ b/package/mac80211/patches/600-0032-rt2x00-rt2800lib-enable-RT2800_HAS_HIGH_SHARED_MEM-f.patch
  11517. @@ -0,0 +1,23 @@
  11518. +From f6734ec72da936989a8ce4186b3ede28fbc47836 Mon Sep 17 00:00:00 2001
  11519. +From: Gabor Juhos <juhosg@openwrt.org>
  11520. +Date: Sun, 18 Aug 2013 21:57:34 +0200
  11521. +Subject: [PATCH] rt2x00: rt2800lib: enable RT2800_HAS_HIGH_SHARED_MEM for
  11522. + RT3883
  11523. +
  11524. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11525. +---
  11526. + drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++-
  11527. + 1 file changed, 2 insertions(+), 1 deletion(-)
  11528. +
  11529. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11530. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11531. +@@ -8406,7 +8406,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r
  11532. + if (retval)
  11533. + return retval;
  11534. +
  11535. +- if (rt2x00_rt(rt2x00dev, RT3593))
  11536. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11537. ++ rt2x00_rt(rt2x00dev, RT3883))
  11538. + __set_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags);
  11539. +
  11540. + if (rt2x00_rt(rt2x00dev, RT3593) ||
  11541. diff --git a/package/mac80211/patches/600-0033-rt2x00-rt2800lib-use-high-memory-for-beacons-on-RT38.patch b/package/mac80211/patches/600-0033-rt2x00-rt2800lib-use-high-memory-for-beacons-on-RT38.patch
  11542. new file mode 100644
  11543. index 0000000..dc06e6a
  11544. --- /dev/null
  11545. +++ b/package/mac80211/patches/600-0033-rt2x00-rt2800lib-use-high-memory-for-beacons-on-RT38.patch
  11546. @@ -0,0 +1,22 @@
  11547. +From f1acfc2f397e86548ae1b479c198d4bef57050f6 Mon Sep 17 00:00:00 2001
  11548. +From: Gabor Juhos <juhosg@openwrt.org>
  11549. +Date: Sun, 29 Sep 2013 18:10:34 +0200
  11550. +Subject: [PATCH] rt2x00: rt2800lib: use high memory for beacons on RT3883
  11551. +
  11552. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11553. +---
  11554. + drivers/net/wireless/rt2x00/rt2800lib.c | 3 ++-
  11555. + 1 file changed, 2 insertions(+), 1 deletion(-)
  11556. +
  11557. +--- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11558. ++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11559. +@@ -97,7 +97,8 @@ static inline void rt2800_shared_mem_sel
  11560. +
  11561. + static inline bool rt2800_beacon_uses_high_mem(struct rt2x00_dev *rt2x00dev)
  11562. + {
  11563. +- if (rt2x00_rt(rt2x00dev, RT3593))
  11564. ++ if (rt2x00_rt(rt2x00dev, RT3593) ||
  11565. ++ rt2x00_rt(rt2x00dev, RT3883))
  11566. + return true;
  11567. +
  11568. + return false;
  11569. diff --git a/package/mac80211/patches/600-0034-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch b/package/mac80211/patches/600-0034-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch
  11570. new file mode 100644
  11571. index 0000000..79334dd
  11572. --- /dev/null
  11573. +++ b/package/mac80211/patches/600-0034-rt2x00-rt2800mmio-add-a-workaround-for-spurious-TX_F.patch
  11574. @@ -0,0 +1,136 @@
  11575. +From 5e67d4f8a46d19748b501c2ef86de3f50d3cfd51 Mon Sep 17 00:00:00 2001
  11576. +From: Gabor Juhos <juhosg@openwrt.org>
  11577. +Date: Sun, 24 Mar 2013 19:26:27 +0100
  11578. +Subject: [PATCH] rt2x00: rt2800mmio: add a workaround for spurious
  11579. + TX_FIFO_STATUS interrupts
  11580. +
  11581. +Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  11582. +---
  11583. + drivers/net/wireless/rt2x00/rt2800mmio.c | 72 +++++++++++++++++++++++++-----
  11584. + drivers/net/wireless/rt2x00/rt2x00.h | 5 +++
  11585. + 2 files changed, 65 insertions(+), 12 deletions(-)
  11586. +
  11587. +--- a/drivers/net/wireless/rt2x00/rt2800mmio.c
  11588. ++++ b/drivers/net/wireless/rt2x00/rt2800mmio.c
  11589. +@@ -415,9 +415,9 @@ void rt2800mmio_autowake_tasklet(unsigne
  11590. + }
  11591. + EXPORT_SYMBOL_GPL(rt2800mmio_autowake_tasklet);
  11592. +
  11593. +-static void rt2800mmio_txstatus_interrupt(struct rt2x00_dev *rt2x00dev)
  11594. ++static void rt2800mmio_txstatus_interrupt(struct rt2x00_dev *rt2x00dev,
  11595. ++ u32 status)
  11596. + {
  11597. +- u32 status;
  11598. + int i;
  11599. +
  11600. + /*
  11601. +@@ -438,29 +438,77 @@ static void rt2800mmio_txstatus_interrup
  11602. + * Since we have only one producer and one consumer we don't
  11603. + * need to lock the kfifo.
  11604. + */
  11605. +- for (i = 0; i < rt2x00dev->tx->limit; i++) {
  11606. +- rt2x00mmio_register_read(rt2x00dev, TX_STA_FIFO, &status);
  11607. +-
  11608. +- if (!rt2x00_get_field32(status, TX_STA_FIFO_VALID))
  11609. +- break;
  11610. +-
  11611. ++ i = 0;
  11612. ++ do {
  11613. + if (!kfifo_put(&rt2x00dev->txstatus_fifo, status)) {
  11614. +- rt2x00_warn(rt2x00dev, "TX status FIFO overrun, drop tx status report\n");
  11615. ++ rt2x00_warn(rt2x00dev,
  11616. ++ "TX status FIFO overrun, drop TX status report\n");
  11617. + break;
  11618. + }
  11619. +- }
  11620. ++
  11621. ++ if (++i >= rt2x00dev->tx->limit)
  11622. ++ break;
  11623. ++
  11624. ++ rt2x00mmio_register_read(rt2x00dev, TX_STA_FIFO, &status);
  11625. ++ } while (rt2x00_get_field32(status, TX_STA_FIFO_VALID));
  11626. +
  11627. + /* Schedule the tasklet for processing the tx status. */
  11628. + tasklet_schedule(&rt2x00dev->txstatus_tasklet);
  11629. + }
  11630. +
  11631. ++#define RT2800MMIO_TXSTATUS_IRQ_MAX_RETRIES 4
  11632. ++
  11633. ++static bool rt2800mmio_txstatus_is_spurious(struct rt2x00_dev *rt2x00dev,
  11634. ++ u32 txstatus)
  11635. ++{
  11636. ++ if (likely(rt2x00_get_field32(txstatus, TX_STA_FIFO_VALID))) {
  11637. ++ rt2x00dev->txstatus_irq_retries = 0;
  11638. ++ return false;
  11639. ++ }
  11640. ++
  11641. ++ rt2x00dev->txstatus_irq_retries++;
  11642. ++
  11643. ++ /* Ensure that we don't go into an infinite IRQ loop. */
  11644. ++ if (rt2x00dev->txstatus_irq_retries >=
  11645. ++ RT2800MMIO_TXSTATUS_IRQ_MAX_RETRIES) {
  11646. ++ rt2x00_warn(rt2x00dev,
  11647. ++ "%u spurious TX_FIFO_STATUS interrupt(s)\n",
  11648. ++ rt2x00dev->txstatus_irq_retries);
  11649. ++ rt2x00dev->txstatus_irq_retries = 0;
  11650. ++ return false;
  11651. ++ }
  11652. ++
  11653. ++ return true;
  11654. ++}
  11655. ++
  11656. + irqreturn_t rt2800mmio_interrupt(int irq, void *dev_instance)
  11657. + {
  11658. + struct rt2x00_dev *rt2x00dev = dev_instance;
  11659. + u32 reg, mask;
  11660. ++ u32 txstatus = 0;
  11661. +
  11662. +- /* Read status and ACK all interrupts */
  11663. ++ /* Read status */
  11664. + rt2x00mmio_register_read(rt2x00dev, INT_SOURCE_CSR, &reg);
  11665. ++
  11666. ++ if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TX_FIFO_STATUS)) {
  11667. ++ /* Due to unknown reason the hardware generates a
  11668. ++ * TX_FIFO_STATUS interrupt before the TX_STA_FIFO
  11669. ++ * register contain valid data. Read the TX status
  11670. ++ * here to see if we have to process the actual
  11671. ++ * request.
  11672. ++ */
  11673. ++ rt2x00mmio_register_read(rt2x00dev, TX_STA_FIFO, &txstatus);
  11674. ++ if (rt2800mmio_txstatus_is_spurious(rt2x00dev, txstatus)) {
  11675. ++ /* Remove the TX_FIFO_STATUS bit so it won't be
  11676. ++ * processed in this turn. The hardware will
  11677. ++ * generate another IRQ for us.
  11678. ++ */
  11679. ++ rt2x00_set_field32(&reg,
  11680. ++ INT_SOURCE_CSR_TX_FIFO_STATUS, 0);
  11681. ++ }
  11682. ++ }
  11683. ++
  11684. ++ /* ACK interrupts */
  11685. + rt2x00mmio_register_write(rt2x00dev, INT_SOURCE_CSR, reg);
  11686. +
  11687. + if (!reg)
  11688. +@@ -477,7 +525,7 @@ irqreturn_t rt2800mmio_interrupt(int irq
  11689. + mask = ~reg;
  11690. +
  11691. + if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TX_FIFO_STATUS)) {
  11692. +- rt2800mmio_txstatus_interrupt(rt2x00dev);
  11693. ++ rt2800mmio_txstatus_interrupt(rt2x00dev, txstatus);
  11694. + /*
  11695. + * Never disable the TX_FIFO_STATUS interrupt.
  11696. + */
  11697. +--- a/drivers/net/wireless/rt2x00/rt2x00.h
  11698. ++++ b/drivers/net/wireless/rt2x00/rt2x00.h
  11699. +@@ -986,6 +986,11 @@ struct rt2x00_dev {
  11700. + int rf_channel;
  11701. +
  11702. + /*
  11703. ++ * Counter for tx status irq retries (rt2800pci).
  11704. ++ */
  11705. ++ unsigned int txstatus_irq_retries;
  11706. ++
  11707. ++ /*
  11708. + * Protect the interrupt mask register.
  11709. + */
  11710. + spinlock_t irqmask_lock;
  11711. diff --git a/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch b/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch
  11712. index 2bbc6f1..c7d71e2 100644
  11713. --- a/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch
  11714. +++ b/package/mac80211/patches/603-rt2x00-introduce-rt2x00eeprom.patch
  11715. @@ -1,6 +1,6 @@
  11716. --- a/.local-symbols
  11717. +++ b/.local-symbols
  11718. -@@ -279,6 +279,7 @@ RT2X00_LIB_FIRMWARE=
  11719. +@@ -280,6 +280,7 @@ RT2X00_LIB_FIRMWARE=
  11720. RT2X00_LIB_CRYPTO=
  11721. RT2X00_LIB_LEDS=
  11722. RT2X00_LIB_DEBUGFS=
  11723. @@ -48,16 +48,16 @@
  11724. obj-$(CPTCFG_RT2X00_LIB_MMIO) += rt2x00mmio.o
  11725. --- a/drivers/net/wireless/rt2x00/rt2800lib.h
  11726. +++ b/drivers/net/wireless/rt2x00/rt2800lib.h
  11727. -@@ -20,6 +20,8 @@
  11728. - #ifndef RT2800LIB_H
  11729. - #define RT2800LIB_H
  11730. +@@ -43,6 +43,8 @@ struct rt2800_drv_data {
  11731. + } shmem_lock;
  11732. + };
  11733. +#include "rt2800.h"
  11734. +
  11735. struct rt2800_ops {
  11736. void (*register_read)(struct rt2x00_dev *rt2x00dev,
  11737. const unsigned int offset, u32 *value);
  11738. -@@ -119,6 +121,15 @@ static inline int rt2800_read_eeprom(str
  11739. +@@ -176,6 +178,15 @@ static inline int rt2800_read_eeprom(str
  11740. {
  11741. const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv;
  11742. @@ -75,7 +75,7 @@
  11743. --- a/drivers/net/wireless/rt2x00/rt2800soc.c
  11744. +++ b/drivers/net/wireless/rt2x00/rt2800soc.c
  11745. -@@ -95,19 +95,6 @@ static int rt2800soc_set_device_state(st
  11746. +@@ -102,19 +102,6 @@ static int rt2800soc_set_device_state(st
  11747. return retval;
  11748. }
  11749. @@ -95,7 +95,7 @@
  11750. /* Firmware functions */
  11751. static char *rt2800soc_get_firmware_name(struct rt2x00_dev *rt2x00dev)
  11752. {
  11753. -@@ -171,7 +158,6 @@ static const struct rt2800_ops rt2800soc
  11754. +@@ -178,7 +165,6 @@ static const struct rt2800_ops rt2800soc
  11755. .register_multiread = rt2x00mmio_register_multiread,
  11756. .register_multiwrite = rt2x00mmio_register_multiwrite,
  11757. .regbusy_read = rt2x00mmio_regbusy_read,
  11758. diff --git a/package/mac80211/patches/608-add_platform_data_mac_addr.patch b/package/mac80211/patches/608-add_platform_data_mac_addr.patch
  11759. index a910cc3..1db09a3 100644
  11760. --- a/package/mac80211/patches/608-add_platform_data_mac_addr.patch
  11761. +++ b/package/mac80211/patches/608-add_platform_data_mac_addr.patch
  11762. @@ -31,7 +31,7 @@
  11763. {
  11764. --- a/drivers/net/wireless/rt2x00/rt2x00.h
  11765. +++ b/drivers/net/wireless/rt2x00/rt2x00.h
  11766. -@@ -1401,6 +1401,7 @@ static inline void rt2x00debug_dump_fram
  11767. +@@ -1406,6 +1406,7 @@ static inline void rt2x00debug_dump_fram
  11768. */
  11769. u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev,
  11770. struct ieee80211_vif *vif);
  11771. diff --git a/package/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch b/package/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch
  11772. index 83fbcd0..3d32ecc 100644
  11773. --- a/package/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch
  11774. +++ b/package/mac80211/patches/610-rt2x00-fix-rt3352-ext-pa.patch
  11775. @@ -1,14 +1,15 @@
  11776. --- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11777. +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11778. -@@ -3176,11 +3176,17 @@ static void rt2800_config_channel(struct
  11779. +@@ -3506,11 +3506,18 @@ static void rt2800_config_channel(struct
  11780. /*
  11781. * Change BBP settings
  11782. */
  11783. -+ rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
  11784. -+ rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
  11785. -+ rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
  11786. +
  11787. if (rt2x00_rt(rt2x00dev, RT3352)) {
  11788. ++ rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
  11789. ++ rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
  11790. ++ rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
  11791. ++
  11792. rt2800_bbp_write(rt2x00dev, 27, 0x0);
  11793. rt2800_bbp_write(rt2x00dev, 66, 0x26 + rt2x00dev->lna_gain);
  11794. rt2800_bbp_write(rt2x00dev, 27, 0x20);
  11795. @@ -18,22 +19,7 @@
  11796. } else if (rt2x00_rt(rt2x00dev, RT3593)) {
  11797. if (rf->channel > 14) {
  11798. /* Disable CCK Packet detection on 5GHz */
  11799. -@@ -3194,14 +3200,8 @@ static void rt2800_config_channel(struct
  11800. - else
  11801. - rt2800_bbp_write(rt2x00dev, 105, 0x34);
  11802. -
  11803. -- rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
  11804. -- rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
  11805. -- rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
  11806. - rt2800_bbp_write(rt2x00dev, 77, 0x98);
  11807. - } else {
  11808. -- rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
  11809. -- rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
  11810. -- rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
  11811. - rt2800_bbp_write(rt2x00dev, 86, 0);
  11812. - }
  11813. -
  11814. -@@ -6125,6 +6125,12 @@ static void rt2800_init_rfcsr_3290(struc
  11815. +@@ -6586,6 +6593,12 @@ static void rt2800_init_rfcsr_3290(struc
  11816. static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev)
  11817. {
  11818. @@ -46,7 +32,7 @@
  11819. rt2800_rf_init_calibration(rt2x00dev, 30);
  11820. rt2800_rfcsr_write(rt2x00dev, 0, 0xf0);
  11821. -@@ -6160,15 +6166,30 @@ static void rt2800_init_rfcsr_3352(struc
  11822. +@@ -6621,15 +6634,30 @@ static void rt2800_init_rfcsr_3352(struc
  11823. rt2800_rfcsr_write(rt2x00dev, 31, 0x80);
  11824. rt2800_rfcsr_write(rt2x00dev, 32, 0x80);
  11825. rt2800_rfcsr_write(rt2x00dev, 33, 0x00);
  11826. @@ -80,7 +66,7 @@
  11827. rt2800_rfcsr_write(rt2x00dev, 43, 0xdb);
  11828. rt2800_rfcsr_write(rt2x00dev, 44, 0xdb);
  11829. rt2800_rfcsr_write(rt2x00dev, 45, 0xdb);
  11830. -@@ -6176,15 +6197,20 @@ static void rt2800_init_rfcsr_3352(struc
  11831. +@@ -6637,15 +6665,20 @@ static void rt2800_init_rfcsr_3352(struc
  11832. rt2800_rfcsr_write(rt2x00dev, 47, 0x0d);
  11833. rt2800_rfcsr_write(rt2x00dev, 48, 0x14);
  11834. rt2800_rfcsr_write(rt2x00dev, 49, 0x00);
  11835. @@ -110,7 +96,7 @@
  11836. rt2800_rfcsr_write(rt2x00dev, 59, 0x00);
  11837. rt2800_rfcsr_write(rt2x00dev, 60, 0x00);
  11838. rt2800_rfcsr_write(rt2x00dev, 61, 0x00);
  11839. -@@ -7051,6 +7077,7 @@ static int rt2800_init_eeprom(struct rt2
  11840. +@@ -7666,6 +7699,7 @@ static int rt2800_init_eeprom(struct rt2
  11841. * RT53xx: defined in "EEPROM_CHIP_ID" field
  11842. */
  11843. if (rt2x00_rt(rt2x00dev, RT3290) ||
  11844. @@ -118,7 +104,7 @@
  11845. rt2x00_rt(rt2x00dev, RT5390) ||
  11846. rt2x00_rt(rt2x00dev, RT5392))
  11847. rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf);
  11848. -@@ -7142,7 +7169,8 @@ static int rt2800_init_eeprom(struct rt2
  11849. +@@ -7760,7 +7794,8 @@ static int rt2800_init_eeprom(struct rt2
  11850. /*
  11851. * Detect if this device has Bluetooth co-existence.
  11852. */
  11853. @@ -128,7 +114,7 @@
  11854. __set_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags);
  11855. /*
  11856. -@@ -7171,6 +7199,22 @@ static int rt2800_init_eeprom(struct rt2
  11857. +@@ -7789,6 +7824,22 @@ static int rt2800_init_eeprom(struct rt2
  11858. EIRP_MAX_TX_POWER_LIMIT)
  11859. __set_bit(CAPABILITY_POWER_LIMIT, &rt2x00dev->cap_flags);
  11860. @@ -153,7 +139,7 @@
  11861. --- a/drivers/net/wireless/rt2x00/rt2800.h
  11862. +++ b/drivers/net/wireless/rt2x00/rt2800.h
  11863. -@@ -2299,6 +2299,12 @@ struct mac_iveiv_entry {
  11864. +@@ -2333,6 +2333,12 @@ struct mac_iveiv_entry {
  11865. #define RFCSR36_RF_BS FIELD8(0x80)
  11866. /*
  11867. @@ -166,7 +152,7 @@
  11868. * RFCSR 38:
  11869. */
  11870. #define RFCSR38_RX_LO1_EN FIELD8(0x20)
  11871. -@@ -2310,6 +2316,18 @@ struct mac_iveiv_entry {
  11872. +@@ -2344,6 +2350,18 @@ struct mac_iveiv_entry {
  11873. #define RFCSR39_RX_LO2_EN FIELD8(0x80)
  11874. /*
  11875. @@ -185,7 +171,7 @@
  11876. * RFCSR 49:
  11877. */
  11878. #define RFCSR49_TX FIELD8(0x3f)
  11879. -@@ -2322,6 +2340,8 @@ struct mac_iveiv_entry {
  11880. +@@ -2356,6 +2374,8 @@ struct mac_iveiv_entry {
  11881. * RFCSR 50:
  11882. */
  11883. #define RFCSR50_TX FIELD8(0x3f)
  11884. @@ -194,7 +180,7 @@
  11885. #define RFCSR50_EP FIELD8(0xc0)
  11886. /* bits for RT3593 */
  11887. #define RFCSR50_TX_LO1_EN FIELD8(0x20)
  11888. -@@ -2469,6 +2489,8 @@ enum rt2800_eeprom_word {
  11889. +@@ -2503,6 +2523,8 @@ enum rt2800_eeprom_word {
  11890. * INTERNAL_TX_ALC: 0: disable, 1: enable
  11891. * BT_COEXIST: 0: disable, 1: enable
  11892. * DAC_TEST: 0: disable, 1: enable
  11893. @@ -203,7 +189,7 @@
  11894. */
  11895. #define EEPROM_NIC_CONF1_HW_RADIO FIELD16(0x0001)
  11896. #define EEPROM_NIC_CONF1_EXTERNAL_TX_ALC FIELD16(0x0002)
  11897. -@@ -2485,6 +2507,8 @@ enum rt2800_eeprom_word {
  11898. +@@ -2519,6 +2541,8 @@ enum rt2800_eeprom_word {
  11899. #define EEPROM_NIC_CONF1_INTERNAL_TX_ALC FIELD16(0x2000)
  11900. #define EEPROM_NIC_CONF1_BT_COEXIST FIELD16(0x4000)
  11901. #define EEPROM_NIC_CONF1_DAC_TEST FIELD16(0x8000)
  11902. diff --git a/package/mac80211/patches/611-rt2x00-rf_vals-rt3352-xtal20.patch b/package/mac80211/patches/611-rt2x00-rf_vals-rt3352-xtal20.patch
  11903. index 478a0f2..c69344c 100644
  11904. --- a/package/mac80211/patches/611-rt2x00-rf_vals-rt3352-xtal20.patch
  11905. +++ b/package/mac80211/patches/611-rt2x00-rf_vals-rt3352-xtal20.patch
  11906. @@ -1,6 +1,6 @@
  11907. --- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11908. +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11909. -@@ -7491,6 +7491,27 @@ static const struct rf_channel rf_vals_5
  11910. +@@ -8176,6 +8176,27 @@ static const struct rf_channel rf_vals_5
  11911. {196, 83, 0, 12, 1},
  11912. };
  11913. @@ -28,7 +28,7 @@
  11914. static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
  11915. {
  11916. struct hw_mode_spec *spec = &rt2x00dev->spec;
  11917. -@@ -7579,7 +7600,10 @@ static int rt2800_probe_hw_mode(struct r
  11918. +@@ -8263,7 +8284,10 @@ static int rt2800_probe_hw_mode(struct r
  11919. case RF5390:
  11920. case RF5392:
  11921. spec->num_channels = 14;
  11922. @@ -40,7 +40,7 @@
  11923. break;
  11924. case RF3052:
  11925. -@@ -7755,6 +7779,19 @@ static int rt2800_probe_rt(struct rt2x00
  11926. +@@ -8446,6 +8470,19 @@ static int rt2800_probe_rt(struct rt2x00
  11927. return 0;
  11928. }
  11929. @@ -59,8 +59,8 @@
  11930. +
  11931. int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev)
  11932. {
  11933. - int retval;
  11934. -@@ -7784,6 +7821,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r
  11935. + struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
  11936. +@@ -8488,6 +8525,15 @@ int rt2800_probe_hw(struct rt2x00_dev *r
  11937. rt2800_register_write(rt2x00dev, GPIO_CTRL, reg);
  11938. /*
  11939. diff --git a/package/mac80211/patches/612-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch b/package/mac80211/patches/612-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch
  11940. index f6b4808..119e95c 100644
  11941. --- a/package/mac80211/patches/612-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch
  11942. +++ b/package/mac80211/patches/612-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch
  11943. @@ -13,7 +13,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
  11944. --- a/drivers/net/wireless/rt2x00/rt2800soc.c
  11945. +++ b/drivers/net/wireless/rt2x00/rt2800soc.c
  11946. -@@ -227,11 +227,18 @@ static int rt2800soc_probe(struct platfo
  11947. +@@ -237,11 +237,18 @@ static int rt2800soc_probe(struct platfo
  11948. return rt2x00soc_probe(pdev, &rt2800soc_ops);
  11949. }
  11950. diff --git a/package/mac80211/patches/616-rt2x00-support-rt5350.patch b/package/mac80211/patches/616-rt2x00-support-rt5350.patch
  11951. index 3bafa16..2cc136c 100644
  11952. --- a/package/mac80211/patches/616-rt2x00-support-rt5350.patch
  11953. +++ b/package/mac80211/patches/616-rt2x00-support-rt5350.patch
  11954. @@ -1,16 +1,16 @@
  11955. --- a/drivers/net/wireless/rt2x00/rt2800.h
  11956. +++ b/drivers/net/wireless/rt2x00/rt2800.h
  11957. -@@ -71,6 +71,7 @@
  11958. - #define RF5592 0x000f
  11959. +@@ -73,6 +73,7 @@
  11960. #define RF3070 0x3070
  11961. #define RF3290 0x3290
  11962. + #define RF3853 0x3853
  11963. +#define RF5350 0x5350
  11964. #define RF5360 0x5360
  11965. #define RF5370 0x5370
  11966. #define RF5372 0x5372
  11967. --- a/drivers/net/wireless/rt2x00/rt2800lib.c
  11968. +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  11969. -@@ -2704,6 +2704,13 @@ static void rt2800_config_channel_rf53xx
  11970. +@@ -2994,6 +2994,13 @@ static void rt2800_config_channel_rf53xx
  11971. rt2800_rfcsr_write(rt2x00dev, 59,
  11972. r59_non_bt[idx]);
  11973. @@ -24,15 +24,15 @@
  11974. }
  11975. }
  11976. }
  11977. -@@ -3141,6 +3148,7 @@ static void rt2800_config_channel(struct
  11978. - rt2800_config_channel_rf3322(rt2x00dev, conf, rf, info);
  11979. +@@ -3472,6 +3479,7 @@ static void rt2800_config_channel(struct
  11980. + rt2800_config_channel_rf3853(rt2x00dev, conf, rf, info);
  11981. break;
  11982. case RF3070:
  11983. + case RF5350:
  11984. case RF5360:
  11985. case RF5370:
  11986. case RF5372:
  11987. -@@ -3158,6 +3166,7 @@ static void rt2800_config_channel(struct
  11988. +@@ -3489,6 +3497,7 @@ static void rt2800_config_channel(struct
  11989. if (rt2x00_rf(rt2x00dev, RF3070) ||
  11990. rt2x00_rf(rt2x00dev, RF3290) ||
  11991. rt2x00_rf(rt2x00dev, RF3322) ||
  11992. @@ -40,7 +40,7 @@
  11993. rt2x00_rf(rt2x00dev, RF5360) ||
  11994. rt2x00_rf(rt2x00dev, RF5370) ||
  11995. rt2x00_rf(rt2x00dev, RF5372) ||
  11996. -@@ -3398,7 +3407,8 @@ static void rt2800_config_channel(struct
  11997. +@@ -3766,7 +3775,8 @@ static void rt2800_config_channel(struct
  11998. /*
  11999. * Clear update flag
  12000. */
  12001. @@ -50,15 +50,15 @@
  12002. rt2800_bbp_read(rt2x00dev, 49, &bbp);
  12003. rt2x00_set_field8(&bbp, BBP49_UPDATE_FLAG, 0);
  12004. rt2800_bbp_write(rt2x00dev, 49, bbp);
  12005. -@@ -4272,6 +4282,7 @@ void rt2800_vco_calibration(struct rt2x0
  12006. - case RF3053:
  12007. +@@ -4645,6 +4655,7 @@ void rt2800_vco_calibration(struct rt2x0
  12008. case RF3070:
  12009. case RF3290:
  12010. + case RF3853:
  12011. + case RF5350:
  12012. case RF5360:
  12013. case RF5370:
  12014. case RF5372:
  12015. -@@ -4668,6 +4679,8 @@ static int rt2800_init_registers(struct
  12016. +@@ -5079,6 +5090,8 @@ static int rt2800_init_registers(struct
  12017. rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
  12018. rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606);
  12019. rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000);
  12020. @@ -67,7 +67,7 @@
  12021. } else {
  12022. rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000000);
  12023. rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606);
  12024. -@@ -5309,9 +5322,13 @@ static void rt2800_init_bbp_3352(struct
  12025. +@@ -5734,9 +5747,13 @@ static void rt2800_init_bbp_3352(struct
  12026. rt2800_bbp_write(rt2x00dev, 82, 0x62);
  12027. @@ -84,7 +84,7 @@
  12028. rt2800_bbp_write(rt2x00dev, 86, 0x38);
  12029. -@@ -5325,9 +5342,13 @@ static void rt2800_init_bbp_3352(struct
  12030. +@@ -5750,9 +5767,13 @@ static void rt2800_init_bbp_3352(struct
  12031. rt2800_bbp_write(rt2x00dev, 104, 0x92);
  12032. @@ -101,7 +101,7 @@
  12033. rt2800_bbp_write(rt2x00dev, 120, 0x50);
  12034. -@@ -5352,6 +5373,13 @@ static void rt2800_init_bbp_3352(struct
  12035. +@@ -5777,6 +5798,13 @@ static void rt2800_init_bbp_3352(struct
  12036. rt2800_bbp_write(rt2x00dev, 143, 0xa2);
  12037. rt2800_bbp_write(rt2x00dev, 148, 0xc8);
  12038. @@ -115,7 +115,7 @@
  12039. }
  12040. static void rt2800_init_bbp_3390(struct rt2x00_dev *rt2x00dev)
  12041. -@@ -5652,6 +5680,7 @@ static void rt2800_init_bbp(struct rt2x0
  12042. +@@ -6118,6 +6146,7 @@ static void rt2800_init_bbp(struct rt2x0
  12043. rt2800_init_bbp_3290(rt2x00dev);
  12044. break;
  12045. case RT3352:
  12046. @@ -123,8 +123,8 @@
  12047. rt2800_init_bbp_3352(rt2x00dev);
  12048. break;
  12049. case RT3390:
  12050. -@@ -6462,6 +6491,76 @@ static void rt2800_init_rfcsr_3593(struc
  12051. - /* TODO: enable stream mode support */
  12052. +@@ -7069,6 +7098,76 @@ static void rt2800_init_rfcsr_3883(struc
  12053. + rt2800_rfcsr_write(rt2x00dev, 20, rfcsr);
  12054. }
  12055. +static void rt2800_init_rfcsr_5350(struct rt2x00_dev *rt2x00dev)
  12056. @@ -200,7 +200,7 @@
  12057. static void rt2800_init_rfcsr_5390(struct rt2x00_dev *rt2x00dev)
  12058. {
  12059. rt2800_rf_init_calibration(rt2x00dev, 2);
  12060. -@@ -6699,6 +6798,9 @@ static void rt2800_init_rfcsr(struct rt2
  12061. +@@ -7309,6 +7408,9 @@ static void rt2800_init_rfcsr(struct rt2
  12062. case RT3593:
  12063. rt2800_init_rfcsr_3593(rt2x00dev);
  12064. break;
  12065. @@ -210,7 +210,7 @@
  12066. case RT5390:
  12067. rt2800_init_rfcsr_5390(rt2x00dev);
  12068. break;
  12069. -@@ -6948,6 +7050,12 @@ static int rt2800_validate_eeprom(struct
  12070. +@@ -7568,6 +7670,12 @@ static int rt2800_validate_eeprom(struct
  12071. rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RF_TYPE, RF2820);
  12072. rt2800_eeprom_write(rt2x00dev, EEPROM_NIC_CONF0, word);
  12073. rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word);
  12074. @@ -223,24 +223,24 @@
  12075. } else if (rt2x00_rt(rt2x00dev, RT2860) ||
  12076. rt2x00_rt(rt2x00dev, RT2872)) {
  12077. /*
  12078. -@@ -7081,6 +7189,8 @@ static int rt2800_init_eeprom(struct rt2
  12079. - rt2x00_rt(rt2x00dev, RT5390) ||
  12080. - rt2x00_rt(rt2x00dev, RT5392))
  12081. +@@ -7706,6 +7814,8 @@ static int rt2800_init_eeprom(struct rt2
  12082. rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf);
  12083. + else if (rt2x00_rt(rt2x00dev, RT3883))
  12084. + rf = RF3853;
  12085. + else if (rt2x00_rt(rt2x00dev, RT5350))
  12086. + rf = RF5350;
  12087. else
  12088. rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE);
  12089. -@@ -7099,6 +7209,7 @@ static int rt2800_init_eeprom(struct rt2
  12090. - case RF3290:
  12091. +@@ -7725,6 +7835,7 @@ static int rt2800_init_eeprom(struct rt2
  12092. case RF3320:
  12093. case RF3322:
  12094. + case RF3853:
  12095. + case RF5350:
  12096. case RF5360:
  12097. case RF5370:
  12098. case RF5372:
  12099. -@@ -7594,6 +7705,7 @@ static int rt2800_probe_hw_mode(struct r
  12100. +@@ -8279,6 +8390,7 @@ static int rt2800_probe_hw_mode(struct r
  12101. case RF3290:
  12102. case RF3320:
  12103. case RF3322:
  12104. @@ -248,18 +248,18 @@
  12105. case RF5360:
  12106. case RF5370:
  12107. case RF5372:
  12108. -@@ -7726,6 +7838,7 @@ static int rt2800_probe_hw_mode(struct r
  12109. - case RF3053:
  12110. +@@ -8417,6 +8529,7 @@ static int rt2800_probe_hw_mode(struct r
  12111. case RF3070:
  12112. case RF3290:
  12113. + case RF3853:
  12114. + case RF5350:
  12115. case RF5360:
  12116. case RF5370:
  12117. case RF5372:
  12118. -@@ -7764,6 +7877,7 @@ static int rt2800_probe_rt(struct rt2x00
  12119. - case RT3390:
  12120. +@@ -8456,6 +8569,7 @@ static int rt2800_probe_rt(struct rt2x00
  12121. case RT3572:
  12122. case RT3593:
  12123. + case RT3883:
  12124. + case RT5350:
  12125. case RT5390:
  12126. case RT5392:
  12127. diff --git a/package/mac80211/patches/619-rt2x00-change-led-polarity-from-OF.patch b/package/mac80211/patches/619-rt2x00-change-led-polarity-from-OF.patch
  12128. index f9186d8..fc56847 100644
  12129. --- a/package/mac80211/patches/619-rt2x00-change-led-polarity-from-OF.patch
  12130. +++ b/package/mac80211/patches/619-rt2x00-change-led-polarity-from-OF.patch
  12131. @@ -8,7 +8,7 @@
  12132. #include "rt2x00.h"
  12133. #include "rt2800lib.h"
  12134. -@@ -7298,6 +7299,17 @@ static int rt2800_init_eeprom(struct rt2
  12135. +@@ -7924,6 +7925,17 @@ static int rt2800_init_eeprom(struct rt2
  12136. rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC);
  12137. rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY);
  12138. diff --git a/package/mac80211/patches/620-rt2x00-rt3352-rf-id.patch b/package/mac80211/patches/620-rt2x00-rt3352-rf-id.patch
  12139. index 5e67344..a33c01f 100644
  12140. --- a/package/mac80211/patches/620-rt2x00-rt3352-rf-id.patch
  12141. +++ b/package/mac80211/patches/620-rt2x00-rt3352-rf-id.patch
  12142. @@ -1,15 +1,11 @@
  12143. --- a/drivers/net/wireless/rt2x00/rt2800lib.c
  12144. +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  12145. -@@ -7186,10 +7186,11 @@ static int rt2800_init_eeprom(struct rt2
  12146. - * RT53xx: defined in "EEPROM_CHIP_ID" field
  12147. - */
  12148. - if (rt2x00_rt(rt2x00dev, RT3290) ||
  12149. -- rt2x00_rt(rt2x00dev, RT3352) ||
  12150. +@@ -7813,6 +7813,8 @@ static int rt2800_init_eeprom(struct rt2
  12151. rt2x00_rt(rt2x00dev, RT5390) ||
  12152. rt2x00_rt(rt2x00dev, RT5392))
  12153. rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &rf);
  12154. + else if (rt2x00_rt(rt2x00dev, RT3352))
  12155. + rf = RF3322;
  12156. + else if (rt2x00_rt(rt2x00dev, RT3883))
  12157. + rf = RF3853;
  12158. else if (rt2x00_rt(rt2x00dev, RT5350))
  12159. - rf = RF5350;
  12160. - else
  12161. diff --git a/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
  12162. index 484c075..752fb0e 100644
  12163. --- a/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
  12164. +++ b/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
  12165. @@ -1,6 +1,6 @@
  12166. --- a/drivers/net/wireless/mwl8k.c
  12167. +++ b/drivers/net/wireless/mwl8k.c
  12168. -@@ -5529,6 +5529,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
  12169. +@@ -5714,6 +5714,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
  12170. MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
  12171. static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
  12172. diff --git a/package/mac80211/patches/900-wl1251-split-wl251-platform-data-to-a-separate-structure.patch b/package/mac80211/patches/900-wl1251-split-wl251-platform-data-to-a-separate-structure.patch
  12173. deleted file mode 100644
  12174. index a8af257..0000000
  12175. --- a/package/mac80211/patches/900-wl1251-split-wl251-platform-data-to-a-separate-structure.patch
  12176. +++ /dev/null
  12177. @@ -1,109 +0,0 @@
  12178. -Move the wl1251 part of the wl12xx platform data structure into a new
  12179. -structure specifically for wl1251. Change the platform data built-in
  12180. -block and board files accordingly.
  12181. -
  12182. -Cc: Tony Lindgren <tony@atomide.com>
  12183. -Signed-off-by: Luciano Coelho <coelho@ti.com>
  12184. -Acked-by: Tony Lindgren <tony@atomide.com>
  12185. -Reviewed-by: Felipe Balbi <balbi@ti.com>
  12186. -
  12187. ---- a/drivers/net/wireless/ti/wilink_platform_data.c
  12188. -+++ b/drivers/net/wireless/ti/wilink_platform_data.c
  12189. -@@ -23,17 +23,17 @@
  12190. - #include <linux/err.h>
  12191. - #include <linux/wl12xx.h>
  12192. -
  12193. --static struct wl12xx_platform_data *platform_data;
  12194. -+static struct wl12xx_platform_data *wl12xx_platform_data;
  12195. -
  12196. - int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
  12197. - {
  12198. -- if (platform_data)
  12199. -+ if (wl12xx_platform_data)
  12200. - return -EBUSY;
  12201. - if (!data)
  12202. - return -EINVAL;
  12203. -
  12204. -- platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
  12205. -- if (!platform_data)
  12206. -+ wl12xx_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
  12207. -+ if (!wl12xx_platform_data)
  12208. - return -ENOMEM;
  12209. -
  12210. - return 0;
  12211. -@@ -41,9 +41,34 @@ int __init wl12xx_set_platform_data(cons
  12212. -
  12213. - struct wl12xx_platform_data *wl12xx_get_platform_data(void)
  12214. - {
  12215. -- if (!platform_data)
  12216. -+ if (!wl12xx_platform_data)
  12217. - return ERR_PTR(-ENODEV);
  12218. -
  12219. -- return platform_data;
  12220. -+ return wl12xx_platform_data;
  12221. - }
  12222. - EXPORT_SYMBOL(wl12xx_get_platform_data);
  12223. -+
  12224. -+static struct wl1251_platform_data *wl1251_platform_data;
  12225. -+
  12226. -+int __init wl1251_set_platform_data(const struct wl1251_platform_data *data)
  12227. -+{
  12228. -+ if (wl1251_platform_data)
  12229. -+ return -EBUSY;
  12230. -+ if (!data)
  12231. -+ return -EINVAL;
  12232. -+
  12233. -+ wl1251_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
  12234. -+ if (!wl1251_platform_data)
  12235. -+ return -ENOMEM;
  12236. -+
  12237. -+ return 0;
  12238. -+}
  12239. -+
  12240. -+struct wl1251_platform_data *wl1251_get_platform_data(void)
  12241. -+{
  12242. -+ if (!wl1251_platform_data)
  12243. -+ return ERR_PTR(-ENODEV);
  12244. -+
  12245. -+ return wl1251_platform_data;
  12246. -+}
  12247. -+EXPORT_SYMBOL(wl1251_get_platform_data);
  12248. ---- a/drivers/net/wireless/ti/wl1251/sdio.c
  12249. -+++ b/drivers/net/wireless/ti/wl1251/sdio.c
  12250. -@@ -227,7 +227,7 @@ static int wl1251_sdio_probe(struct sdio
  12251. - struct wl1251 *wl;
  12252. - struct ieee80211_hw *hw;
  12253. - struct wl1251_sdio *wl_sdio;
  12254. -- const struct wl12xx_platform_data *wl12xx_board_data;
  12255. -+ const struct wl1251_platform_data *wl1251_board_data;
  12256. -
  12257. - hw = wl1251_alloc_hw();
  12258. - if (IS_ERR(hw))
  12259. -@@ -254,11 +254,11 @@ static int wl1251_sdio_probe(struct sdio
  12260. - wl->if_priv = wl_sdio;
  12261. - wl->if_ops = &wl1251_sdio_ops;
  12262. -
  12263. -- wl12xx_board_data = wl12xx_get_platform_data();
  12264. -- if (!IS_ERR(wl12xx_board_data)) {
  12265. -- wl->set_power = wl12xx_board_data->set_power;
  12266. -- wl->irq = wl12xx_board_data->irq;
  12267. -- wl->use_eeprom = wl12xx_board_data->use_eeprom;
  12268. -+ wl1251_board_data = wl1251_get_platform_data();
  12269. -+ if (!IS_ERR(wl1251_board_data)) {
  12270. -+ wl->set_power = wl1251_board_data->set_power;
  12271. -+ wl->irq = wl1251_board_data->irq;
  12272. -+ wl->use_eeprom = wl1251_board_data->use_eeprom;
  12273. - }
  12274. -
  12275. - if (wl->irq) {
  12276. ---- a/drivers/net/wireless/ti/wl1251/spi.c
  12277. -+++ b/drivers/net/wireless/ti/wl1251/spi.c
  12278. -@@ -241,7 +241,7 @@ static const struct wl1251_if_operations
  12279. -
  12280. - static int wl1251_spi_probe(struct spi_device *spi)
  12281. - {
  12282. -- struct wl12xx_platform_data *pdata;
  12283. -+ struct wl1251_platform_data *pdata;
  12284. - struct ieee80211_hw *hw;
  12285. - struct wl1251 *wl;
  12286. - int ret;
  12287. diff --git a/package/mac80211/patches/900-wlcore-Add-support-for-DT-platform-data.patch b/package/mac80211/patches/900-wlcore-Add-support-for-DT-platform-data.patch
  12288. new file mode 100644
  12289. index 0000000..967768a
  12290. --- /dev/null
  12291. +++ b/package/mac80211/patches/900-wlcore-Add-support-for-DT-platform-data.patch
  12292. @@ -0,0 +1,139 @@
  12293. +When running with DT, we no longer have a board file that can set up the
  12294. +platform data for wlcore. Allow this data to be passed from DT.
  12295. +
  12296. +Since some platforms use a gpio-irq, add support for passing either the
  12297. +irq number or the gpio number. For the latter case, the driver will
  12298. +request the gpio and convert it to the irq number. If an irq is
  12299. +specified, it'll be used as is.
  12300. +
  12301. +[Arik - the pdev_data pointer does not belong to us and is freed when
  12302. +the device is released. Dereference to our private data first.]
  12303. +
  12304. +Signed-off-by: Ido Yariv <ido@wizery.com>
  12305. +Signed-off-by: Arik Nemtsov <arik@wizery.com>
  12306. +---
  12307. + drivers/net/wireless/ti/wlcore/sdio.c | 71 ++++++++++++++++++++++++++++++++---
  12308. + include/linux/wl12xx.h | 3 +-
  12309. + 2 files changed, 67 insertions(+), 7 deletions(-)
  12310. +
  12311. +--- a/drivers/net/wireless/ti/wlcore/sdio.c
  12312. ++++ b/drivers/net/wireless/ti/wlcore/sdio.c
  12313. +@@ -34,6 +34,7 @@
  12314. + #include <linux/wl12xx.h>
  12315. + #include <linux/pm_runtime.h>
  12316. + #include <linux/printk.h>
  12317. ++#include <linux/of.h>
  12318. +
  12319. + #include "wlcore.h"
  12320. + #include "wl12xx_80211.h"
  12321. +@@ -214,6 +215,61 @@ static struct wl1271_if_operations sdio_
  12322. + .set_block_size = wl1271_sdio_set_block_size,
  12323. + };
  12324. +
  12325. ++static const struct of_device_id wlcore_of_match[] = {
  12326. ++ {
  12327. ++ .compatible = "wlcore",
  12328. ++ },
  12329. ++ {}
  12330. ++};
  12331. ++MODULE_DEVICE_TABLE(of, wlcore_of_match);
  12332. ++
  12333. ++static struct wl12xx_platform_data *get_platform_data(struct device *dev)
  12334. ++{
  12335. ++ struct wl12xx_platform_data *pdata;
  12336. ++ struct device_node *np;
  12337. ++ u32 gpio;
  12338. ++
  12339. ++ pdata = wl12xx_get_platform_data();
  12340. ++ if (!IS_ERR(pdata))
  12341. ++ return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL);
  12342. ++
  12343. ++ np = of_find_matching_node(NULL, wlcore_of_match);
  12344. ++ if (!np) {
  12345. ++ dev_err(dev, "No platform data set\n");
  12346. ++ return NULL;
  12347. ++ }
  12348. ++
  12349. ++ pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
  12350. ++ if (!pdata) {
  12351. ++ dev_err(dev, "Can't allocate platform data\n");
  12352. ++ return NULL;
  12353. ++ }
  12354. ++
  12355. ++ if (of_property_read_u32(np, "irq", &pdata->irq)) {
  12356. ++ if (!of_property_read_u32(np, "gpio", &gpio) &&
  12357. ++ !gpio_request_one(gpio, GPIOF_IN, "wlcore_irq")) {
  12358. ++ pdata->gpio = gpio;
  12359. ++ pdata->irq = gpio_to_irq(gpio);
  12360. ++ }
  12361. ++ }
  12362. ++
  12363. ++ /* Optional fields */
  12364. ++ pdata->use_eeprom = of_property_read_bool(np, "use-eeprom");
  12365. ++ of_property_read_u32(np, "board-ref-clock", &pdata->board_ref_clock);
  12366. ++ of_property_read_u32(np, "board-tcxo-clock", &pdata->board_tcxo_clock);
  12367. ++ of_property_read_u32(np, "platform-quirks", &pdata->platform_quirks);
  12368. ++
  12369. ++ return pdata;
  12370. ++}
  12371. ++
  12372. ++static void del_platform_data(struct wl12xx_platform_data *pdata)
  12373. ++{
  12374. ++ if (pdata->gpio)
  12375. ++ gpio_free(pdata->gpio);
  12376. ++
  12377. ++ kfree(pdata);
  12378. ++}
  12379. ++
  12380. + static int wl1271_probe(struct sdio_func *func,
  12381. + const struct sdio_device_id *id)
  12382. + {
  12383. +@@ -248,12 +304,9 @@ static int wl1271_probe(struct sdio_func
  12384. + /* Use block mode for transferring over one block size of data */
  12385. + func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
  12386. +
  12387. +- pdev_data->pdata = wl12xx_get_platform_data();
  12388. +- if (IS_ERR(pdev_data->pdata)) {
  12389. +- ret = PTR_ERR(pdev_data->pdata);
  12390. +- dev_err(glue->dev, "missing wlan platform data: %d\n", ret);
  12391. ++ pdev_data->pdata = get_platform_data(&func->dev);
  12392. ++ if (!(pdev_data->pdata))
  12393. + goto out_free_glue;
  12394. +- }
  12395. +
  12396. + /* if sdio can keep power while host is suspended, enable wow */
  12397. + mmcflags = sdio_get_host_pm_caps(func);
  12398. +@@ -282,7 +335,7 @@ static int wl1271_probe(struct sdio_func
  12399. + if (!glue->core) {
  12400. + dev_err(glue->dev, "can't allocate platform_device");
  12401. + ret = -ENOMEM;
  12402. +- goto out_free_glue;
  12403. ++ goto out_free_pdata;
  12404. + }
  12405. +
  12406. + glue->core->dev.parent = &func->dev;
  12407. +@@ -316,6 +369,9 @@ static int wl1271_probe(struct sdio_func
  12408. + out_dev_put:
  12409. + platform_device_put(glue->core);
  12410. +
  12411. ++out_free_pdata:
  12412. ++ del_platform_data(pdev_data->pdata);
  12413. ++
  12414. + out_free_glue:
  12415. + kfree(glue);
  12416. +
  12417. +@@ -329,11 +385,14 @@ out:
  12418. + static void wl1271_remove(struct sdio_func *func)
  12419. + {
  12420. + struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
  12421. ++ struct wlcore_platdev_data *pdev_data = glue->core->dev.platform_data;
  12422. ++ struct wl12xx_platform_data *pdata = pdev_data->pdata;
  12423. +
  12424. + /* Undo decrement done above in wl1271_probe */
  12425. + pm_runtime_get_noresume(&func->dev);
  12426. +
  12427. + platform_device_unregister(glue->core);
  12428. ++ del_platform_data(pdata);
  12429. + kfree(glue);
  12430. + }
  12431. +
  12432. diff --git a/package/mac80211/patches/901-wl18xx-align-event-mailbox-with-current-fw.patch b/package/mac80211/patches/901-wl18xx-align-event-mailbox-with-current-fw.patch
  12433. new file mode 100644
  12434. index 0000000..77647bb
  12435. --- /dev/null
  12436. +++ b/package/mac80211/patches/901-wl18xx-align-event-mailbox-with-current-fw.patch
  12437. @@ -0,0 +1,47 @@
  12438. +From fde3f0a7f3112527a18e06e32efdd9a354c91b02 Mon Sep 17 00:00:00 2001
  12439. +From: Eliad Peller <eliad@wizery.com>
  12440. +Date: Tue, 18 Mar 2014 13:19:48 +0200
  12441. +Subject: [PATCH] wl18xx: align event mailbox with current fw
  12442. +
  12443. +Some fields are missing from the event mailbox
  12444. +struct definitions, which cause issues when
  12445. +trying to handle some events.
  12446. +
  12447. +Add the missing fields in order to align the
  12448. +struct size (without adding actual support
  12449. +for the new fields).
  12450. +
  12451. +Signed-off-by: Eliad Peller <eliad@wizery.com>
  12452. +---
  12453. + drivers/net/wireless/ti/wl18xx/event.h | 20 ++++++++++++++++++++
  12454. + 1 file changed, 20 insertions(+)
  12455. +
  12456. +--- a/drivers/net/wireless/ti/wl18xx/event.h
  12457. ++++ b/drivers/net/wireless/ti/wl18xx/event.h
  12458. +@@ -68,6 +68,26 @@ struct wl18xx_event_mailbox {
  12459. +
  12460. + /* bitmap of inactive stations (by HLID) */
  12461. + __le32 inactive_sta_bitmap;
  12462. ++
  12463. ++ /* rx BA win size indicated by RX_BA_WIN_SIZE_CHANGE_EVENT_ID */
  12464. ++ u8 rx_ba_role_id;
  12465. ++ u8 rx_ba_link_id;
  12466. ++ u8 rx_ba_win_size;
  12467. ++ u8 padding;
  12468. ++
  12469. ++ /* smart config */
  12470. ++ u8 sc_ssid_len;
  12471. ++ u8 sc_pwd_len;
  12472. ++ u8 sc_token_len;
  12473. ++ u8 padding1;
  12474. ++ u8 sc_ssid[32];
  12475. ++ u8 sc_pwd[32];
  12476. ++ u8 sc_token[32];
  12477. ++
  12478. ++ /* smart config sync channel */
  12479. ++ u8 sc_sync_channel;
  12480. ++ u8 sc_sync_band;
  12481. ++ u8 padding2[2];
  12482. + } __packed;
  12483. +
  12484. + int wl18xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event,
  12485. diff --git a/package/mac80211/patches/901-wlcore-set-irq_flags-in-the-board-files.patch b/package/mac80211/patches/901-wlcore-set-irq_flags-in-the-board-files.patch
  12486. deleted file mode 100644
  12487. index f2789a9..0000000
  12488. --- a/package/mac80211/patches/901-wlcore-set-irq_flags-in-the-board-files.patch
  12489. +++ /dev/null
  12490. @@ -1,118 +0,0 @@
  12491. -The platform_quirk element in the platform data was used to change the
  12492. -way the IRQ is triggered. When set, the EDGE_IRQ quirk would change
  12493. -the irqflags used and treat edge trigger differently from the rest.
  12494. -
  12495. -Instead of hiding this irq flag setting behind the quirk, have the
  12496. -board files set the flags during initialization. This will be more
  12497. -meaningful than driver-specific quirks when we switch to DT.
  12498. -
  12499. -Additionally, fix missing gpio_request() calls in the boarding files
  12500. -(so that setting the flags actually works).
  12501. -
  12502. -Cc: Tony Lindgren <tony@atomide.com>
  12503. -Cc: Sekhar Nori <nsekhar@ti.com>
  12504. -Signed-off-by: Luciano Coelho <coelho@ti.com>
  12505. -Reviewed-by: Felipe Balbi <balbi@ti.com>
  12506. -Acked-by: Sekhar Nori <nsekhar@ti.com>
  12507. -
  12508. ---- a/drivers/net/wireless/ti/wlcore/debugfs.c
  12509. -+++ b/drivers/net/wireless/ti/wlcore/debugfs.c
  12510. -@@ -502,7 +502,7 @@ static ssize_t driver_state_read(struct
  12511. - DRIVER_STATE_PRINT_HEX(irq);
  12512. - /* TODO: ref_clock and tcxo_clock were moved to wl12xx priv */
  12513. - DRIVER_STATE_PRINT_HEX(hw_pg_ver);
  12514. -- DRIVER_STATE_PRINT_HEX(platform_quirks);
  12515. -+ DRIVER_STATE_PRINT_HEX(irq_flags);
  12516. - DRIVER_STATE_PRINT_HEX(chip.id);
  12517. - DRIVER_STATE_PRINT_STR(chip.fw_ver_str);
  12518. - DRIVER_STATE_PRINT_STR(chip.phy_fw_ver_str);
  12519. ---- a/drivers/net/wireless/ti/wlcore/main.c
  12520. -+++ b/drivers/net/wireless/ti/wlcore/main.c
  12521. -@@ -27,6 +27,7 @@
  12522. - #include <linux/vmalloc.h>
  12523. - #include <linux/wl12xx.h>
  12524. - #include <linux/interrupt.h>
  12525. -+#include <linux/irq.h>
  12526. -
  12527. - #include "wlcore.h"
  12528. - #include "debug.h"
  12529. -@@ -528,7 +529,7 @@ static int wlcore_irq_locked(struct wl12
  12530. - * In case edge triggered interrupt must be used, we cannot iterate
  12531. - * more than once without introducing race conditions with the hardirq.
  12532. - */
  12533. -- if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ)
  12534. -+ if (wl->irq_flags & IRQF_TRIGGER_RISING)
  12535. - loopcount = 1;
  12536. -
  12537. - wl1271_debug(DEBUG_IRQ, "IRQ work");
  12538. -@@ -5934,7 +5935,6 @@ struct ieee80211_hw *wlcore_alloc_hw(siz
  12539. - wl->ap_ps_map = 0;
  12540. - wl->ap_fw_ps_map = 0;
  12541. - wl->quirks = 0;
  12542. -- wl->platform_quirks = 0;
  12543. - wl->system_hlid = WL12XX_SYSTEM_HLID;
  12544. - wl->active_sta_count = 0;
  12545. - wl->active_link_count = 0;
  12546. -@@ -6075,7 +6075,7 @@ static void wlcore_nvs_cb(const struct f
  12547. - struct platform_device *pdev = wl->pdev;
  12548. - struct wlcore_platdev_data *pdev_data = dev_get_platdata(&pdev->dev);
  12549. - struct wl12xx_platform_data *pdata = pdev_data->pdata;
  12550. -- unsigned long irqflags;
  12551. -+
  12552. - int ret;
  12553. - irq_handler_t hardirq_fn = NULL;
  12554. -
  12555. -@@ -6103,29 +6103,19 @@ static void wlcore_nvs_cb(const struct f
  12556. - wlcore_adjust_conf(wl);
  12557. -
  12558. - wl->irq = platform_get_irq(pdev, 0);
  12559. -- wl->platform_quirks = pdata->platform_quirks;
  12560. - wl->if_ops = pdev_data->if_ops;
  12561. -
  12562. --#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
  12563. -- irqflags = IRQF_TRIGGER_RISING;
  12564. -+ wl->irq_flags = irq_get_trigger_type(wl->irq) | IRQF_ONESHOT;
  12565. - hardirq_fn = wlcore_hardirq;
  12566. --#else
  12567. -- if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ) {
  12568. -- irqflags = IRQF_TRIGGER_RISING;
  12569. -- hardirq_fn = wlcore_hardirq;
  12570. -- } else {
  12571. -- irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;
  12572. -- }
  12573. --#endif
  12574. -
  12575. - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
  12576. - ret = compat_request_threaded_irq(&wl->irq_compat, wl->irq,
  12577. - hardirq_fn, wlcore_irq,
  12578. -- irqflags,
  12579. -+ wl->irqflags,
  12580. - pdev->name, wl);
  12581. - #else
  12582. - ret = request_threaded_irq(wl->irq, hardirq_fn, wlcore_irq,
  12583. -- irqflags, pdev->name, wl);
  12584. -+ wl->irq_flags, pdev->name, wl);
  12585. - #endif
  12586. - if (ret < 0) {
  12587. - wl1271_error("request_irq() failed: %d", ret);
  12588. ---- a/drivers/net/wireless/ti/wlcore/wlcore.h
  12589. -+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
  12590. -@@ -188,6 +188,8 @@ struct wl1271 {
  12591. -
  12592. - int irq;
  12593. -
  12594. -+ int irq_flags;
  12595. -+
  12596. - spinlock_t wl_lock;
  12597. -
  12598. - enum wlcore_state state;
  12599. -@@ -395,9 +397,6 @@ struct wl1271 {
  12600. - /* Quirks of specific hardware revisions */
  12601. - unsigned int quirks;
  12602. -
  12603. -- /* Platform limitations */
  12604. -- unsigned int platform_quirks;
  12605. --
  12606. - /* number of currently active RX BA sessions */
  12607. - int ba_rx_session_count;
  12608. -
  12609. diff --git a/package/mac80211/patches/902-wlcore-don-t-switch-channels-on-disconnected-STA-vif.patch b/package/mac80211/patches/902-wlcore-don-t-switch-channels-on-disconnected-STA-vif.patch
  12610. new file mode 100644
  12611. index 0000000..3d501b2
  12612. --- /dev/null
  12613. +++ b/package/mac80211/patches/902-wlcore-don-t-switch-channels-on-disconnected-STA-vif.patch
  12614. @@ -0,0 +1,36 @@
  12615. +From 4101e8dc540d19f1f6c24930629149191786e4cd Mon Sep 17 00:00:00 2001
  12616. +From: Arik Nemtsov <arik@wizery.com>
  12617. +Date: Mon, 9 Sep 2013 16:48:59 +0300
  12618. +Subject: [PATCH 27/75] wlcore: don't switch channels on disconnected STA vifs
  12619. +
  12620. +Sending the FW a channel switch command on a disconnected vif may result
  12621. +in a beacon loss event. Avoid this edge case.
  12622. +
  12623. +Signed-off-by: Arik Nemtsov <arik@wizery.com>
  12624. +---
  12625. + drivers/net/wireless/ti/wlcore/main.c | 7 +++++++
  12626. + 1 file changed, 7 insertions(+)
  12627. +
  12628. +--- a/drivers/net/wireless/ti/wlcore/main.c
  12629. ++++ b/drivers/net/wireless/ti/wlcore/main.c
  12630. +@@ -5181,6 +5181,10 @@ static void wl12xx_op_channel_switch(str
  12631. + if (unlikely(wl->state == WLCORE_STATE_OFF)) {
  12632. + wl12xx_for_each_wlvif_sta(wl, wlvif) {
  12633. + struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
  12634. ++
  12635. ++ if (!test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
  12636. ++ continue;
  12637. ++
  12638. + ieee80211_chswitch_done(vif, false);
  12639. + }
  12640. + goto out;
  12641. +@@ -5196,6 +5200,9 @@ static void wl12xx_op_channel_switch(str
  12642. + wl12xx_for_each_wlvif_sta(wl, wlvif) {
  12643. + unsigned long delay_usec;
  12644. +
  12645. ++ if (!test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
  12646. ++ continue;
  12647. ++
  12648. + ret = wl->ops->channel_switch(wl, wlvif, ch_switch);
  12649. + if (ret)
  12650. + goto out_sleep;
  12651. diff --git a/package/mac80211/patches/902-wlcore-remove-pwr_in_suspend-from-platform-data.patch b/package/mac80211/patches/902-wlcore-remove-pwr_in_suspend-from-platform-data.patch
  12652. deleted file mode 100644
  12653. index 6394377..0000000
  12654. --- a/package/mac80211/patches/902-wlcore-remove-pwr_in_suspend-from-platform-data.patch
  12655. +++ /dev/null
  12656. @@ -1,48 +0,0 @@
  12657. -The pwr_in_suspend flag depends on the MMC settings which can be
  12658. -retrieved from the SDIO subsystem, so it doesn't need to be part of
  12659. -the platform data structure. Move it to the platform device data that
  12660. -is passed from SDIO to wlcore.
  12661. -
  12662. -Signed-off-by: Luciano Coelho <coelho@ti.com>
  12663. -Reviewed-by: Felipe Balbi <balbi@ti.com>
  12664. -
  12665. ---- a/drivers/net/wireless/ti/wlcore/main.c
  12666. -+++ b/drivers/net/wireless/ti/wlcore/main.c
  12667. -@@ -6074,7 +6074,6 @@ static void wlcore_nvs_cb(const struct f
  12668. - struct wl1271 *wl = context;
  12669. - struct platform_device *pdev = wl->pdev;
  12670. - struct wlcore_platdev_data *pdev_data = dev_get_platdata(&pdev->dev);
  12671. -- struct wl12xx_platform_data *pdata = pdev_data->pdata;
  12672. -
  12673. - int ret;
  12674. - irq_handler_t hardirq_fn = NULL;
  12675. -@@ -6127,7 +6126,7 @@ static void wlcore_nvs_cb(const struct f
  12676. - if (!ret) {
  12677. - wl->irq_wake_enabled = true;
  12678. - device_init_wakeup(wl->dev, 1);
  12679. -- if (pdata->pwr_in_suspend)
  12680. -+ if (pdev_data->pwr_in_suspend)
  12681. - wl->hw->wiphy->wowlan = &wlcore_wowlan_support;
  12682. - }
  12683. - #endif
  12684. ---- a/drivers/net/wireless/ti/wlcore/sdio.c
  12685. -+++ b/drivers/net/wireless/ti/wlcore/sdio.c
  12686. -@@ -260,7 +260,7 @@ static int wl1271_probe(struct sdio_func
  12687. - dev_dbg(glue->dev, "sdio PM caps = 0x%x\n", mmcflags);
  12688. -
  12689. - if (mmcflags & MMC_PM_KEEP_POWER)
  12690. -- pdev_data->pdata->pwr_in_suspend = true;
  12691. -+ pdev_data->pwr_in_suspend = true;
  12692. -
  12693. - sdio_set_drvdata(func, glue);
  12694. -
  12695. ---- a/drivers/net/wireless/ti/wlcore/wlcore_i.h
  12696. -+++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h
  12697. -@@ -209,6 +209,7 @@ struct wl1271_if_operations {
  12698. - struct wlcore_platdev_data {
  12699. - struct wl12xx_platform_data *pdata;
  12700. - struct wl1271_if_operations *if_ops;
  12701. -+ bool pwr_in_suspend;
  12702. - };
  12703. -
  12704. - #define MAX_NUM_KEYS 14
  12705. diff --git a/package/mac80211/patches/903-wl12xx-use-frequency-instead-of-enumerations-for-pdata-clocks.patch b/package/mac80211/patches/903-wl12xx-use-frequency-instead-of-enumerations-for-pdata-clocks.patch
  12706. deleted file mode 100644
  12707. index 4b20932..0000000
  12708. --- a/package/mac80211/patches/903-wl12xx-use-frequency-instead-of-enumerations-for-pdata-clocks.patch
  12709. +++ /dev/null
  12710. @@ -1,131 +0,0 @@
  12711. -Instead of defining an enumeration with the FW specific values for the
  12712. -different clock rates, use the actual frequency instead. Also add a
  12713. -boolean to specify whether the clock is XTAL or not.
  12714. -
  12715. -Change all board files to reflect this.
  12716. -
  12717. -Additionally, this reverts commit 26f45c (ARM: OMAP2+: Legacy support
  12718. -for wl12xx when booted with devicetree), since this is not be needed
  12719. -anymore, now that DT support for WiLink is implemented.
  12720. -
  12721. -Cc: Tony Lindgren <tony@atomide.com>
  12722. -Cc: Sekhar Nori <nsekhar@ti.com>
  12723. -Signed-off-by: Luciano Coelho <coelho@ti.com>
  12724. -Reviewed-by: Felipe Balbi <balbi@ti.com>
  12725. -
  12726. ---- a/drivers/net/wireless/ti/wl12xx/main.c
  12727. -+++ b/drivers/net/wireless/ti/wl12xx/main.c
  12728. -@@ -1711,6 +1711,43 @@ static struct ieee80211_sta_ht_cap wl12x
  12729. - },
  12730. - };
  12731. -
  12732. -+static const struct wl12xx_clock wl12xx_refclock_table[] = {
  12733. -+ { 19200000, false, WL12XX_REFCLOCK_19 },
  12734. -+ { 26000000, false, WL12XX_REFCLOCK_26 },
  12735. -+ { 26000000, true, WL12XX_REFCLOCK_26_XTAL },
  12736. -+ { 38400000, false, WL12XX_REFCLOCK_38 },
  12737. -+ { 38400000, true, WL12XX_REFCLOCK_38_XTAL },
  12738. -+ { 52000000, false, WL12XX_REFCLOCK_52 },
  12739. -+ { 0, false, 0 }
  12740. -+};
  12741. -+
  12742. -+static const struct wl12xx_clock wl12xx_tcxoclock_table[] = {
  12743. -+ { 16368000, true, WL12XX_TCXOCLOCK_16_368 },
  12744. -+ { 16800000, true, WL12XX_TCXOCLOCK_16_8 },
  12745. -+ { 19200000, true, WL12XX_TCXOCLOCK_19_2 },
  12746. -+ { 26000000, true, WL12XX_TCXOCLOCK_26 },
  12747. -+ { 32736000, true, WL12XX_TCXOCLOCK_32_736 },
  12748. -+ { 33600000, true, WL12XX_TCXOCLOCK_33_6 },
  12749. -+ { 38400000, true, WL12XX_TCXOCLOCK_38_4 },
  12750. -+ { 52000000, true, WL12XX_TCXOCLOCK_52 },
  12751. -+ { 0, false, 0 }
  12752. -+};
  12753. -+
  12754. -+static int wl12xx_get_clock_idx(const struct wl12xx_clock *table,
  12755. -+ u32 freq, bool xtal)
  12756. -+{
  12757. -+ int i = 0;
  12758. -+
  12759. -+ while(table[i].freq != 0) {
  12760. -+ if ((table[i].freq == freq) &&
  12761. -+ (table[i].xtal == xtal))
  12762. -+ return table[i].hw_idx;
  12763. -+ i++;
  12764. -+ };
  12765. -+
  12766. -+ return -EINVAL;
  12767. -+}
  12768. -+
  12769. - static int wl12xx_setup(struct wl1271 *wl)
  12770. - {
  12771. - struct wl12xx_priv *priv = wl->priv;
  12772. -@@ -1732,7 +1769,16 @@ static int wl12xx_setup(struct wl1271 *w
  12773. - wl12xx_conf_init(wl);
  12774. -
  12775. - if (!fref_param) {
  12776. -- priv->ref_clock = pdata->board_ref_clock;
  12777. -+ priv->ref_clock = wl12xx_get_clock_idx(wl12xx_refclock_table,
  12778. -+ pdata->ref_clock_freq,
  12779. -+ pdata->ref_clock_xtal);
  12780. -+ if (priv->ref_clock < 0) {
  12781. -+ wl1271_error("Invalid ref_clock frequency (%d Hz, %s)",
  12782. -+ pdata->ref_clock_freq,
  12783. -+ pdata->ref_clock_xtal ? "XTAL" : "not XTAL");
  12784. -+
  12785. -+ return priv->ref_clock;
  12786. -+ }
  12787. - } else {
  12788. - if (!strcmp(fref_param, "19.2"))
  12789. - priv->ref_clock = WL12XX_REFCLOCK_19;
  12790. -@@ -1751,7 +1797,15 @@ static int wl12xx_setup(struct wl1271 *w
  12791. - }
  12792. -
  12793. - if (!tcxo_param) {
  12794. -- priv->tcxo_clock = pdata->board_tcxo_clock;
  12795. -+ priv->tcxo_clock = wl12xx_get_clock_idx(wl12xx_tcxoclock_table,
  12796. -+ pdata->tcxo_clock_freq,
  12797. -+ true);
  12798. -+ if (priv->tcxo_clock < 0) {
  12799. -+ wl1271_error("Invalid tcxo_clock frequency (%d Hz)",
  12800. -+ pdata->tcxo_clock_freq);
  12801. -+
  12802. -+ return priv->tcxo_clock;
  12803. -+ }
  12804. - } else {
  12805. - if (!strcmp(tcxo_param, "19.2"))
  12806. - priv->tcxo_clock = WL12XX_TCXOCLOCK_19_2;
  12807. ---- a/drivers/net/wireless/ti/wl12xx/wl12xx.h
  12808. -+++ b/drivers/net/wireless/ti/wl12xx/wl12xx.h
  12809. -@@ -79,4 +79,32 @@ struct wl12xx_priv {
  12810. - struct wl127x_rx_mem_pool_addr *rx_mem_addr;
  12811. - };
  12812. -
  12813. -+/* Reference clock values */
  12814. -+enum {
  12815. -+ WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */
  12816. -+ WL12XX_REFCLOCK_26 = 1, /* 26 MHz */
  12817. -+ WL12XX_REFCLOCK_38 = 2, /* 38.4 MHz */
  12818. -+ WL12XX_REFCLOCK_52 = 3, /* 52 MHz */
  12819. -+ WL12XX_REFCLOCK_38_XTAL = 4, /* 38.4 MHz, XTAL */
  12820. -+ WL12XX_REFCLOCK_26_XTAL = 5, /* 26 MHz, XTAL */
  12821. -+};
  12822. -+
  12823. -+/* TCXO clock values */
  12824. -+enum {
  12825. -+ WL12XX_TCXOCLOCK_19_2 = 0, /* 19.2MHz */
  12826. -+ WL12XX_TCXOCLOCK_26 = 1, /* 26 MHz */
  12827. -+ WL12XX_TCXOCLOCK_38_4 = 2, /* 38.4MHz */
  12828. -+ WL12XX_TCXOCLOCK_52 = 3, /* 52 MHz */
  12829. -+ WL12XX_TCXOCLOCK_16_368 = 4, /* 16.368 MHz */
  12830. -+ WL12XX_TCXOCLOCK_32_736 = 5, /* 32.736 MHz */
  12831. -+ WL12XX_TCXOCLOCK_16_8 = 6, /* 16.8 MHz */
  12832. -+ WL12XX_TCXOCLOCK_33_6 = 7, /* 33.6 MHz */
  12833. -+};
  12834. -+
  12835. -+struct wl12xx_clock {
  12836. -+ u32 freq;
  12837. -+ bool xtal;
  12838. -+ u8 hw_idx;
  12839. -+};
  12840. -+
  12841. - #endif /* __WL12XX_PRIV_H__ */
  12842. diff --git a/package/mac80211/patches/904-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch b/package/mac80211/patches/904-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch
  12843. deleted file mode 100644
  12844. index 9e1d190..0000000
  12845. --- a/package/mac80211/patches/904-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch
  12846. +++ /dev/null
  12847. @@ -1,118 +0,0 @@
  12848. -If platform data is not available, try to get the required information
  12849. -from the device tree. Register an OF match table and parse the
  12850. -appropriate device tree nodes.
  12851. -
  12852. -Parse interrupt property only, for now.
  12853. -
  12854. -Signed-off-by: Luciano Coelho <coelho@ti.com>
  12855. -Reviewed-by: Felipe Balbi <balbi@ti.com>
  12856. -
  12857. ---- a/drivers/net/wireless/ti/wlcore/sdio.c
  12858. -+++ b/drivers/net/wireless/ti/wlcore/sdio.c
  12859. -@@ -30,7 +30,7 @@
  12860. - #include <linux/mmc/sdio_ids.h>
  12861. - #include <linux/mmc/card.h>
  12862. - #include <linux/mmc/host.h>
  12863. --#include <linux/gpio.h>
  12864. -+#include <linux/of_irq.h>
  12865. - #include <linux/wl12xx.h>
  12866. - #include <linux/pm_runtime.h>
  12867. - #include <linux/printk.h>
  12868. -@@ -214,6 +214,43 @@ static struct wl1271_if_operations sdio_
  12869. - .set_block_size = wl1271_sdio_set_block_size,
  12870. - };
  12871. -
  12872. -+static struct wl12xx_platform_data *wlcore_get_pdata_from_of(struct device *dev)
  12873. -+{
  12874. -+ struct wl12xx_platform_data *pdata;
  12875. -+ struct device_node *np = dev->of_node;
  12876. -+
  12877. -+ if (!np) {
  12878. -+ np = of_find_matching_node(NULL, dev->driver->of_match_table);
  12879. -+ if (!np) {
  12880. -+ dev_notice(dev, "device tree node not available\n");
  12881. -+ pdata = ERR_PTR(-ENODEV);
  12882. -+ goto out;
  12883. -+ }
  12884. -+ }
  12885. -+
  12886. -+ pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
  12887. -+ if (!pdata) {
  12888. -+ dev_err(dev, "can't allocate platform data\n");
  12889. -+ pdata = ERR_PTR(-ENODEV);
  12890. -+ goto out;
  12891. -+ }
  12892. -+
  12893. -+ pdata->irq = irq_of_parse_and_map(np, 0);
  12894. -+ if (pdata->irq < 0) {
  12895. -+ dev_err(dev, "can't get interrupt gpio from the device tree\n");
  12896. -+ goto out_free;
  12897. -+ }
  12898. -+
  12899. -+ goto out;
  12900. -+
  12901. -+out_free:
  12902. -+ kfree(pdata);
  12903. -+ pdata = ERR_PTR(-ENODEV);
  12904. -+
  12905. -+out:
  12906. -+ return pdata;
  12907. -+}
  12908. -+
  12909. - static int wl1271_probe(struct sdio_func *func,
  12910. - const struct sdio_device_id *id)
  12911. - {
  12912. -@@ -248,11 +285,22 @@ static int wl1271_probe(struct sdio_func
  12913. - /* Use block mode for transferring over one block size of data */
  12914. - func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
  12915. -
  12916. -+ /* The pdata allocated here is freed when the device is freed,
  12917. -+ * so we don't need an additional out label to free it in case
  12918. -+ * of error further on.
  12919. -+ */
  12920. -+
  12921. -+ /* Try to get legacy platform data from the board file */
  12922. - pdev_data->pdata = wl12xx_get_platform_data();
  12923. - if (IS_ERR(pdev_data->pdata)) {
  12924. -- ret = PTR_ERR(pdev_data->pdata);
  12925. -- dev_err(glue->dev, "missing wlan platform data: %d\n", ret);
  12926. -- goto out_free_glue;
  12927. -+ dev_info(&func->dev,
  12928. -+ "legacy platform data not found, trying device tree\n");
  12929. -+
  12930. -+ pdev_data->pdata = wlcore_get_pdata_from_of(&func->dev);
  12931. -+ if (IS_ERR(pdev_data->pdata)) {
  12932. -+ dev_err(&func->dev, "can't get platform data\n");
  12933. -+ goto out_free_glue;
  12934. -+ }
  12935. - }
  12936. -
  12937. - /* if sdio can keep power while host is suspended, enable wow */
  12938. -@@ -386,16 +434,25 @@ static const struct dev_pm_ops wl1271_sd
  12939. - };
  12940. - #endif
  12941. -
  12942. -+static const struct of_device_id wlcore_sdio_of_match_table[] = {
  12943. -+ { .compatible = "ti,wilink6" },
  12944. -+ { .compatible = "ti,wilink7" },
  12945. -+ { .compatible = "ti,wilink8" },
  12946. -+ { }
  12947. -+};
  12948. -+MODULE_DEVICE_TABLE(of, wlcore_sdio_of_match_table);
  12949. -+
  12950. - static struct sdio_driver wl1271_sdio_driver = {
  12951. - .name = "wl1271_sdio",
  12952. - .id_table = wl1271_devices,
  12953. - .probe = wl1271_probe,
  12954. - .remove = wl1271_remove,
  12955. --#ifdef CONFIG_PM
  12956. - .drv = {
  12957. -+#ifdef CONFIG_PM
  12958. - .pm = &wl1271_sdio_pm_ops,
  12959. -- },
  12960. - #endif
  12961. -+ .of_match_table = of_match_ptr(wlcore_sdio_of_match_table),
  12962. -+ },
  12963. - };
  12964. -
  12965. - static int __init wl1271_init(void)
  12966. diff --git a/package/mac80211/patches/905-wlcore-sdio-add-wilink-clock-providers.patch b/package/mac80211/patches/905-wlcore-sdio-add-wilink-clock-providers.patch
  12967. deleted file mode 100644
  12968. index be1f9ad..0000000
  12969. --- a/package/mac80211/patches/905-wlcore-sdio-add-wilink-clock-providers.patch
  12970. +++ /dev/null
  12971. @@ -1,50 +0,0 @@
  12972. -Add refclock and tcxoclock as clock providers in WiLink. These clocks
  12973. -are not accesible outside the WiLink module, but they are registered
  12974. -in the clock framework anyway. Only the WiLink chip consumes these
  12975. -clocks.
  12976. -
  12977. -In theory, the WiLink chip could be connected to external clocks
  12978. -instead of using these internal clocks, so make the clock consumer
  12979. -code generic enough. If external clocks are used, then the internal
  12980. -clock device tree nodes are not necessary, but the external ones must
  12981. -be specified.
  12982. -
  12983. -Signed-off-by: Luciano Coelho <coelho@ti.com>
  12984. -Reviewed-by: Felipe Balbi <balbi@ti.com>
  12985. -
  12986. ---- a/drivers/net/wireless/ti/wlcore/sdio.c
  12987. -+++ b/drivers/net/wireless/ti/wlcore/sdio.c
  12988. -@@ -34,6 +34,7 @@
  12989. - #include <linux/wl12xx.h>
  12990. - #include <linux/pm_runtime.h>
  12991. - #include <linux/printk.h>
  12992. -+#include <linux/clk-provider.h>
  12993. -
  12994. - #include "wlcore.h"
  12995. - #include "wl12xx_80211.h"
  12996. -@@ -214,10 +215,15 @@ static struct wl1271_if_operations sdio_
  12997. - .set_block_size = wl1271_sdio_set_block_size,
  12998. - };
  12999. -
  13000. -+static const struct of_device_id wlcore_sdio_of_clk_match_table[] = {
  13001. -+ { .compatible = "ti,wilink-clock" },
  13002. -+};
  13003. -+
  13004. - static struct wl12xx_platform_data *wlcore_get_pdata_from_of(struct device *dev)
  13005. - {
  13006. - struct wl12xx_platform_data *pdata;
  13007. - struct device_node *np = dev->of_node;
  13008. -+ struct device_node *clock_node;
  13009. -
  13010. - if (!np) {
  13011. - np = of_find_matching_node(NULL, dev->driver->of_match_table);
  13012. -@@ -241,6 +247,9 @@ static struct wl12xx_platform_data *wlco
  13013. - goto out_free;
  13014. - }
  13015. -
  13016. -+ for_each_matching_node(clock_node, wlcore_sdio_of_clk_match_table)
  13017. -+ of_fixed_clk_setup(clock_node);
  13018. -+
  13019. - goto out;
  13020. -
  13021. - out_free:
  13022. diff --git a/package/mac80211/patches/906-wlcore-sdio-get-clocks-from-device-tree.patch b/package/mac80211/patches/906-wlcore-sdio-get-clocks-from-device-tree.patch
  13023. deleted file mode 100644
  13024. index 09ff4af..0000000
  13025. --- a/package/mac80211/patches/906-wlcore-sdio-get-clocks-from-device-tree.patch
  13026. +++ /dev/null
  13027. @@ -1,90 +0,0 @@
  13028. -Read the clock nodes from the device tree and use them to set the
  13029. -frequency for the refclock and the tcxo clock.
  13030. -
  13031. -Also, call sdio_set_drvdata() earlier, so the glue is already set in
  13032. -the driver data when we call wlcore_get_pdata_from_of() and we don't
  13033. -need to pass it as a parameter.
  13034. -
  13035. -Signed-off-by: Luciano Coelho <coelho@ti.com>
  13036. -Reviewed-by: Felipe Balbi <balbi@ti.com>
  13037. -
  13038. ---- a/drivers/net/wireless/ti/wlcore/sdio.c
  13039. -+++ b/drivers/net/wireless/ti/wlcore/sdio.c
  13040. -@@ -53,6 +53,7 @@ static bool dump = false;
  13041. - struct wl12xx_sdio_glue {
  13042. - struct device *dev;
  13043. - struct platform_device *core;
  13044. -+ struct clk *refclock, *tcxoclock;
  13045. - };
  13046. -
  13047. - static const struct sdio_device_id wl1271_devices[] = {
  13048. -@@ -224,6 +225,7 @@ static struct wl12xx_platform_data *wlco
  13049. - struct wl12xx_platform_data *pdata;
  13050. - struct device_node *np = dev->of_node;
  13051. - struct device_node *clock_node;
  13052. -+ struct wl12xx_sdio_glue *glue = sdio_get_drvdata(dev_to_sdio_func(dev));
  13053. -
  13054. - if (!np) {
  13055. - np = of_find_matching_node(NULL, dev->driver->of_match_table);
  13056. -@@ -250,6 +252,26 @@ static struct wl12xx_platform_data *wlco
  13057. - for_each_matching_node(clock_node, wlcore_sdio_of_clk_match_table)
  13058. - of_fixed_clk_setup(clock_node);
  13059. -
  13060. -+ /* TODO: make sure we have this when needed (ie. for WL6 and WL7) */
  13061. -+ glue->refclock = of_clk_get_by_name(np, "refclock");
  13062. -+ if (IS_ERR(glue->refclock)) {
  13063. -+ dev_err(dev, "couldn't find refclock on the device tree\n");
  13064. -+ glue->refclock = NULL;
  13065. -+ } else {
  13066. -+ clk_prepare_enable(glue->refclock);
  13067. -+ pdata->ref_clock_freq = clk_get_rate(glue->refclock);
  13068. -+ }
  13069. -+
  13070. -+ /* TODO: make sure we have this when needed (ie. for WL7) */
  13071. -+ glue->tcxoclock = of_clk_get_by_name(np, "tcxoclock");
  13072. -+ if (IS_ERR(glue->tcxoclock)) {
  13073. -+ dev_err(dev, "couldn't find tcxoclock on the device tree\n");
  13074. -+ glue->tcxoclock = NULL;
  13075. -+ } else {
  13076. -+ clk_prepare_enable(glue->tcxoclock);
  13077. -+ pdata->ref_clock_freq = clk_get_rate(glue->tcxoclock);
  13078. -+ }
  13079. -+
  13080. - goto out;
  13081. -
  13082. - out_free:
  13083. -@@ -294,6 +316,8 @@ static int wl1271_probe(struct sdio_func
  13084. - /* Use block mode for transferring over one block size of data */
  13085. - func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
  13086. -
  13087. -+ sdio_set_drvdata(func, glue);
  13088. -+
  13089. - /* The pdata allocated here is freed when the device is freed,
  13090. - * so we don't need an additional out label to free it in case
  13091. - * of error further on.
  13092. -@@ -319,8 +343,6 @@ static int wl1271_probe(struct sdio_func
  13093. - if (mmcflags & MMC_PM_KEEP_POWER)
  13094. - pdev_data->pwr_in_suspend = true;
  13095. -
  13096. -- sdio_set_drvdata(func, glue);
  13097. --
  13098. - /* Tell PM core that we don't need the card to be powered now */
  13099. - pm_runtime_put_noidle(&func->dev);
  13100. -
  13101. -@@ -387,6 +409,16 @@ static void wl1271_remove(struct sdio_fu
  13102. - {
  13103. - struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
  13104. -
  13105. -+ if (glue->refclock) {
  13106. -+ clk_disable_unprepare(glue->refclock);
  13107. -+ clk_put(glue->refclock);
  13108. -+ }
  13109. -+
  13110. -+ if (glue->tcxoclock) {
  13111. -+ clk_disable_unprepare(glue->tcxoclock);
  13112. -+ clk_put(glue->tcxoclock);
  13113. -+ }
  13114. -+
  13115. - /* Undo decrement done above in wl1271_probe */
  13116. - pm_runtime_get_noresume(&func->dev);
  13117. -
  13118. diff --git a/package/mac80211/patches/907-wlcore-wl12xx-check-if-we-got-correct-clock-data-from-DT.patch b/package/mac80211/patches/907-wlcore-wl12xx-check-if-we-got-correct-clock-data-from-DT.patch
  13119. deleted file mode 100644
  13120. index 6b09177..0000000
  13121. --- a/package/mac80211/patches/907-wlcore-wl12xx-check-if-we-got-correct-clock-data-from-DT.patch
  13122. +++ /dev/null
  13123. @@ -1,96 +0,0 @@
  13124. -The fref and the tcxo clocks settings are optional in some platforms.
  13125. -WiLink8 doesn't need either, so we don't check the values. WiLink 6
  13126. -only needs the fref clock, so we check that it is valid or return with
  13127. -an error. WiLink7 needs both clocks, if either is not available we
  13128. -return with an error.
  13129. -
  13130. -Signed-off-by: Luciano Coelho <coelho@ti.com>
  13131. -Reviewed-by: Felipe Balbi <balbi@ti.com>
  13132. -
  13133. ---- a/drivers/net/wireless/ti/wl12xx/main.c
  13134. -+++ b/drivers/net/wireless/ti/wl12xx/main.c
  13135. -@@ -930,6 +930,11 @@ static int wl128x_boot_clk(struct wl1271
  13136. - u16 sys_clk_cfg;
  13137. - int ret;
  13138. -
  13139. -+ if ((priv->ref_clock < 0) || (priv->tcxo_clock < 0)) {
  13140. -+ wl1271_error("Missing fref and/or tcxo clock settings\n");
  13141. -+ return -EINVAL;
  13142. -+ }
  13143. -+
  13144. - /* For XTAL-only modes, FREF will be used after switching from TCXO */
  13145. - if (priv->ref_clock == WL12XX_REFCLOCK_26_XTAL ||
  13146. - priv->ref_clock == WL12XX_REFCLOCK_38_XTAL) {
  13147. -@@ -979,6 +984,11 @@ static int wl127x_boot_clk(struct wl1271
  13148. - u32 clk;
  13149. - int ret;
  13150. -
  13151. -+ if (priv->ref_clock < 0) {
  13152. -+ wl1271_error("Missing fref clock settings\n");
  13153. -+ return -EINVAL;
  13154. -+ }
  13155. -+
  13156. - if (WL127X_PG_GET_MAJOR(wl->hw_pg_ver) < 3)
  13157. - wl->quirks |= WLCORE_QUIRK_END_OF_TRANSACTION;
  13158. -
  13159. -@@ -1768,7 +1778,7 @@ static int wl12xx_setup(struct wl1271 *w
  13160. - wlcore_set_ht_cap(wl, IEEE80211_BAND_5GHZ, &wl12xx_ht_cap);
  13161. - wl12xx_conf_init(wl);
  13162. -
  13163. -- if (!fref_param) {
  13164. -+ if (!fref_param && (pdata->ref_clock_freq > 0)) {
  13165. - priv->ref_clock = wl12xx_get_clock_idx(wl12xx_refclock_table,
  13166. - pdata->ref_clock_freq,
  13167. - pdata->ref_clock_xtal);
  13168. -@@ -1779,6 +1789,8 @@ static int wl12xx_setup(struct wl1271 *w
  13169. -
  13170. - return priv->ref_clock;
  13171. - }
  13172. -+ } else if (!fref_param) {
  13173. -+ priv->ref_clock = -EINVAL;
  13174. - } else {
  13175. - if (!strcmp(fref_param, "19.2"))
  13176. - priv->ref_clock = WL12XX_REFCLOCK_19;
  13177. -@@ -1796,7 +1808,7 @@ static int wl12xx_setup(struct wl1271 *w
  13178. - wl1271_error("Invalid fref parameter %s", fref_param);
  13179. - }
  13180. -
  13181. -- if (!tcxo_param) {
  13182. -+ if (!fref_param && (pdata->tcxo_clock_freq > 0)) {
  13183. - priv->tcxo_clock = wl12xx_get_clock_idx(wl12xx_tcxoclock_table,
  13184. - pdata->tcxo_clock_freq,
  13185. - true);
  13186. -@@ -1806,7 +1818,9 @@ static int wl12xx_setup(struct wl1271 *w
  13187. -
  13188. - return priv->tcxo_clock;
  13189. - }
  13190. -- } else {
  13191. -+ } else if (!fref_param) {
  13192. -+ priv->tcxo_clock = -EINVAL;
  13193. -+ }else {
  13194. - if (!strcmp(tcxo_param, "19.2"))
  13195. - priv->tcxo_clock = WL12XX_TCXOCLOCK_19_2;
  13196. - else if (!strcmp(tcxo_param, "26"))
  13197. ---- a/drivers/net/wireless/ti/wlcore/sdio.c
  13198. -+++ b/drivers/net/wireless/ti/wlcore/sdio.c
  13199. -@@ -252,20 +252,16 @@ static struct wl12xx_platform_data *wlco
  13200. - for_each_matching_node(clock_node, wlcore_sdio_of_clk_match_table)
  13201. - of_fixed_clk_setup(clock_node);
  13202. -
  13203. -- /* TODO: make sure we have this when needed (ie. for WL6 and WL7) */
  13204. - glue->refclock = of_clk_get_by_name(np, "refclock");
  13205. - if (IS_ERR(glue->refclock)) {
  13206. -- dev_err(dev, "couldn't find refclock on the device tree\n");
  13207. - glue->refclock = NULL;
  13208. - } else {
  13209. - clk_prepare_enable(glue->refclock);
  13210. - pdata->ref_clock_freq = clk_get_rate(glue->refclock);
  13211. - }
  13212. -
  13213. -- /* TODO: make sure we have this when needed (ie. for WL7) */
  13214. - glue->tcxoclock = of_clk_get_by_name(np, "tcxoclock");
  13215. - if (IS_ERR(glue->tcxoclock)) {
  13216. -- dev_err(dev, "couldn't find tcxoclock on the device tree\n");
  13217. - glue->tcxoclock = NULL;
  13218. - } else {
  13219. - clk_prepare_enable(glue->tcxoclock);